@aeolus-fleet/console 0.38.9 → 0.39.0
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.
- package/.next/standalone/packages/console/.next/BUILD_ID +1 -1
- package/.next/standalone/packages/console/.next/app-path-routes-manifest.json +1 -0
- package/.next/standalone/packages/console/.next/build-manifest.json +14 -3
- package/.next/standalone/packages/console/.next/prerender-manifest.json +3 -3
- package/.next/standalone/packages/console/.next/routes-manifest.json +6 -0
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/[cause]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/fleet-health/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/labels/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/messages/[messageId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/network/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/scopes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/sealing/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/mcp-servers/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/mcp-servers/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/mcp-servers/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/mcp-servers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/usage/page/server-reference-manifest.json +16 -16
- package/.next/standalone/packages/console/.next/server/app/(console)/usage/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/(console)/usage/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/(console)/usage/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/packages/console/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/api/reads/[read]/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/confirm/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/confirm/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/confirm/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/out/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/refused/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/refused/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/refused/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/route.js +3 -3
- package/.next/standalone/packages/console/.next/server/app/sign-in/argo/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/done/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/enter/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/failed/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/sign-in/failed/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/failed/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/no-rights/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/sign-in/no-rights/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/no-rights/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/nothing-to-manage/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/sign-in/nothing-to-manage/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/nothing-to-manage/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/out/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/sign-in/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/renew/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/start/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page/app-paths-manifest.json +3 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page/build-manifest.json +22 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page/next-font-manifest.json +11 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page/server-reference-manifest.json +4 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page.js +24 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page.js.nft.json +1 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/switch-failed/page_client-reference-manifest.js +3 -0
- package/.next/standalone/packages/console/.next/server/app/sign-in/unreachable/page.js +2 -2
- package/.next/standalone/packages/console/.next/server/app/sign-in/unreachable/page.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app/sign-in/unreachable/page_client-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/app/version/route.js.nft.json +1 -1
- package/.next/standalone/packages/console/.next/server/app-paths-manifest.json +1 -0
- package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__08z7clj-ey1pp._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/_1uqphllhxbl0-._.js +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/packages_console_1wbjk69aa7h5_._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/packages_console_lib_account-sign-in_ts_04025ws9d1vaq._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console_features_ship_ui_organisms_request-crew-dialog_tsx_1ywnzoikdhnrw._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console_features_squadrons_ui_organisms_form-squadron-dialog_tsx_00objgim-e_v8._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{0ysl_console_features_squadrons_ui_organisms_form-squadron-dialog_tsx_0541-h9ocf4ot._.js → 0ysl_console_features_squadrons_ui_organisms_form-squadron-dialog_tsx_18qcfw90rjow0._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_sign-in_switch-failed_page_actions_0iejchazp8bt8.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1_85ykurz2_h6._.js → _0193m4ax3hfyo._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_05wuq3gwlze7e._.js → _01bzimphco24i._.js} +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_02eimerqq12jt._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_04gowqz_eh83s._.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1wnc3faztg603._.js → _077zc5ijkrzyf._.js} +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0a5k9_pc_guhs._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0ado8mrgaymyq._.js → _0o3d3i742aqyd._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0gzvdjw1lv7qp._.js → _0rdp3h_f7ai46._.js} +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0wo7e7auz11u_._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0z5rqi7fighlr._.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_13__fdxjopewy._.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1k77ebwared0n._.js → _15inuiq9gu3rk._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1bc8get8bkd3e._.js +3 -3
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1bq60qvh1u6j2._.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_03e17lb2tsgx9._.js → _1cc1ck5zgzq9o._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1oipbbgm8a58i._.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1u0h4gj3mw97-._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0jgi9_mtpupnb._.js → _205ghag29_k9v._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11n76c3fk2p6r.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_095dn1sq86gf4._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1zz1awp0w_qz0._.js → packages_console_07v7wg-wwtnws._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0cvxdaq56an-2._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0deebkzdrt66k._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0fj8fj_dfefer._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0g8wuvm9200dx._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0gb_ab5wr340f._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0p9496_ahzf02._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0pr_dn_qifobq._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0r1j1ff9-r1oq._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0spsmrxtu1yv7._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0ti-rn20urks_._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0x3yy4k4kl7e0._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0y6ht52r645g9._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_0yekw89ya_nm2._.js +3 -0
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_13eoh7dscheba._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_14ijvz4m00kwz._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1c3b5p3g1fhhe._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1dz1wwzmepxz2._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1ep4nyq96z4tz._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1ltwm3acq1a26._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1qohymrp8tz2i._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1rkytyhzvvpv7._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1mj9pzb_0sss6._.js → packages_console_1u2y_1q5i1mw4._.js} +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_1xfs-ahyxqs9h._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_1adil63q72drj._.js → packages_console_214keheryj-hu._.js} +2 -2
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_ships_[shipId]_ship-page_tsx_0oahz0rct9hdh._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_trierarchs_[shipId]_page_tsx_1u845f4qxrxnd._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_components_0k9381l71ajlx._.js → packages_console_components_1buu5yuxg8q30._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_components_molecules_crew-settings-fields_tsx_1hjvztxt75rb7._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_components_molecules_machine-labels-field_tsx_0gg0r9y8-a4ud._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_0zqksblyi-54i._.js → packages_console_features_0gshesx41xwxf._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_features_fleet_ui_organisms_commission-dialog_tsx_1t37wt5ff0nb4._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_sealing_ui_organisms_121qb_tjod7sj._.js → packages_console_features_sealing_ui_organisms_0ufvpc0c11o4k._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_trierarchs_ui_organisms_1je3e-xpdofl_._.js → packages_console_features_trierarchs_ui_organisms_1_4tdmdkzqj-9._.js} +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_crew-settings-form_ts_0x5pz_5u1rlmz._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_squadrons-api_ts_0-ls9zi1hw-2n._.js +1 -1
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_trierarch-plugin_ts_1yl4g4k1mmd8u._.js +1 -1
- package/.next/standalone/packages/console/.next/server/middleware-build-manifest.js +14 -3
- package/.next/standalone/packages/console/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/next-font-manifest.json +4 -0
- package/.next/standalone/packages/console/.next/server/pages/500.html +1 -1
- package/.next/standalone/packages/console/.next/server/preview-props.json +3 -3
- package/.next/standalone/packages/console/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/packages/console/.next/server/server-reference-manifest.json +17 -17
- package/.next/standalone/packages/console/.next/static/chunks/0-vc7d-hr5sxd.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/0322bd2lx8mpc.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/0528kks66x0jq.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{2df691xtshd2z.js → 0ma9ven9ywsvi.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/0ra2p7r6dcwbu.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{1bbccygf-72lp.js → 0ssgtx8uzn-_n.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/1k3bbfw8qkn6h.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/1nuq6osifnt78.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/1vfo8os8cye5n.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{30cil_o06tid8.js → 1wo297ivnrw8k.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/1zcvijz50pmv9.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/2-_6tz529pztr.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/{3ll7wv_sloyn4.js → 2ihul4xg6gwkw.js} +1 -1
- package/.next/standalone/packages/console/.next/static/chunks/2om3imxtf7twq.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/2rcei_g_avapb.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/32xff3ugkcg9u.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/39rep407alr0p.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/3c_f6ntg3qdw0.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/3g3gzc8xmcr07.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/3luuths3bvnyy.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/3o8t4m1qj8zrl.css +3 -0
- package/.next/standalone/packages/console/.next/static/chunks/42xk_18prdr_k.js +1 -0
- package/.next/standalone/packages/console/.next/static/chunks/43gx3cmeuhl3d.js +1 -0
- package/.next/standalone/packages/console/package.json +4 -4
- package/package.json +4 -4
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_0-glu_ggtpkjk._.js +0 -3
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_07tj0hm9wcp2_._.js +0 -3
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1xc2estqpvfi3._.js +0 -3
- package/.next/standalone/packages/console/.next/server/chunks/ssr/_1zdy0vj4r9pai._.js +0 -3
- package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_forming-members_ts_1m5cilt3yez7_._.js +0 -3
- package/.next/standalone/packages/console/.next/static/chunks/08wrqmffulgcd.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/0fcwo1imj8mkd.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/0k2yhxn8ke-qs.css +0 -3
- package/.next/standalone/packages/console/.next/static/chunks/0kof_dfbjs33b.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/0rjh27-cjfyz4.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/0yk745ywie84t.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/1bncg2vm205wz.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/1tk_wcc-un-2h.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/1vx2l51cav6s0.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/27pn_g-_1tus1.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/2ihzv5qxf304c.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/2qc3ck3-_3t_o.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/332eydk6vjrpp.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/3gj8_ba5iof1u.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/3kp4hhi8zor05.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/3r_kkn0jf0jm2.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/3tm91f71ytmoj.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/41mamud2bwmp6.js +0 -1
- package/.next/standalone/packages/console/.next/static/chunks/4222-r2viidh2.js +0 -1
- /package/.next/standalone/packages/console/.next/static/{TJol8a6iRp1nCpKu4PsuA → zdGxZlfc8QGabxn0T0Qs_}/_buildManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{TJol8a6iRp1nCpKu4PsuA → zdGxZlfc8QGabxn0T0Qs_}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/packages/console/.next/static/{TJol8a6iRp1nCpKu4PsuA → zdGxZlfc8QGabxn0T0Qs_}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,133173,e=>{var s=e.i(843476),t=e.i(93976),i=e.i(62050),a=e.i(145017),n=e.i(547125),r=e.i(410030),o=e.i(458998),l=e.i(394313),d=e.i(253535),c=e.i(998919),m=e.i(689664),u=e.i(271645),h=e.i(812437),p=e.i(527256);e.s(["f",0,function({options:e,value:f,onValueChange:x,isFreeText:g=!1,toQuery:b,onQueryChange:v,groupLabel:j,emptyText:N,leadingIcon:w,placeholder:y,id:k,isInvalid:C=!1,"aria-describedby":I,"aria-label":S,"data-testid":z}){let D=e.find(e=>e.value===f),[P,T]=(0,u.useState)(D?.label??(g?f??"":"")),[R,L]=(0,u.useState)(!1),$=e.filter(e=>e.label.toLowerCase().includes(P.trim().toLowerCase())),M=D?.label===P?D:void 0,q=void 0!==M&&(void 0!==M.detail||void 0!==M.trailing),F=g?e.find(e=>e.label===P):D;return(0,s.jsxs)(t.f.Root,{items:$,filter:null,value:F??null,itemToStringLabel:e=>e.label,isItemEqualToValue:(e,s)=>e.value===s.value,inputValue:P,open:R&&""!==P.trim(),onOpenChange:L,onInputValueChange:(e,s)=>{if(g&&"input-change"!==s.reason&&"item-press"!==s.reason)return;let t="input-change"===s.reason&&b?b(e):e;T(t),"input-change"===s.reason&&v?.(t),g?x(""===t?null:t):void 0!==D&&t!==D.label&&x(null)},onValueChange:e=>{e&&(T(e.label),x(g?e.label:e.value))},children:[(0,s.jsxs)("div",{className:"relative w-full [&_svg]:size-(--size-icon)",children:[w?(0,s.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:w}):null,(0,s.jsx)(i.f.Input,{id:k,placeholder:y,"aria-invalid":C,"aria-describedby":I,"aria-label":S,"data-testid":z,"data-slot":"combobox-input",className:(0,h.f)((0,p.B)({isMono:!0}),w?"pl-9":void 0,q?"pr-44 max-sm:pr-28":void 0)}),q?(0,s.jsxs)("span",{className:"pointer-events-none absolute inset-y-0 right-2.5 flex items-center gap-2",children:[M.detail?(0,s.jsx)("span",{className:"truncate text-meta text-muted-foreground max-sm:hidden",children:M.detail}):null,M.trailing]}):null]}),(0,s.jsx)(a.f.Portal,{children:(0,s.jsx)(n.f.Positioner,{className:"isolate z-50 outline-none",sideOffset:4,children:(0,s.jsxs)(r.f.Popup,{"data-slot":"combobox-content",className:"max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lg duration-(--duration-fast) outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",children:[N?(0,s.jsx)(o.f.Empty,{className:"px-2.5 py-2 text-meta text-muted-foreground empty:hidden",children:N(P.trim())}):null,(0,s.jsxs)(l.f.List,{children:[j&&$.length>0?(0,s.jsx)("div",{className:"px-2.5 pt-1.5 pb-1 text-caption text-muted-foreground",children:j}):null,$.map(e=>(0,s.jsxs)(d.f.Item,{value:e,"data-slot":"combobox-item",className:"relative flex min-h-8.5 items-center gap-2.5 rounded-sm pr-8 pl-2.5 text-body text-foreground outline-none select-none data-disabled:pointer-events-none data-disabled:opacity-45 data-highlighted:bg-accent",children:[(0,s.jsx)("span",{className:"font-mono text-id font-medium",children:e.label}),e.detail?(0,s.jsx)("span",{className:"truncate text-meta text-muted-foreground",children:e.detail}):null,e.trailing?(0,s.jsx)("span",{className:"ml-auto flex items-center",children:e.trailing}):null,(0,s.jsx)(c.f.ItemIndicator,{className:"absolute right-2.5 flex items-center",children:(0,s.jsx)(m.f,{"aria-hidden":!0,className:"size-(--size-icon)"})})]},e.value))]})]})})})]})}])},443988,e=>{var s=e.i(843476),t=e.i(225913),i=e.i(812437);let a=(0,t.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:t,isMono:n,rows:r=4,...o}){return(0,s.jsx)("textarea",{"data-slot":"textarea",rows:r,className:(0,i.f)(a({size:t,isMono:n}),e),...o})}])},675774,e=>{var s=e.i(843476),t=e.i(271645),i=e.i(808041),a=e.i(866616),n=e.i(443988),r=e.i(404032),o=e.i(757364),l=e.i(667609),d=e.i(569917),c=e.i(389589);e.s(["f",0,function({shipName:e,offers:m,values:u,onChange:h,firstPromptMaxBytes:p,squadrons:f,refusal:x,isDisabled:g=!1,machineLabels:b}){let v={harness:(0,t.useId)(),options:(0,t.useId)(),firstPrompt:(0,t.useId)(),squadron:(0,t.useId)()},j=m.find(e=>e.harness===u.harness),N=e=>x?.field===e?x.reason:void 0,w=(0,i.R)(u.firstPrompt),y=w>p;return(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"crew-settings-fields",children:[(0,s.jsx)(l.f,{id:v.harness,label:"Harness",error:N("harness"),children:(0,s.jsx)(d.f,{id:v.harness,items:Object.fromEntries(m.map(e=>[e.harness,(0,a.f)(e.harness)])),value:u.harness,isDisabled:g,testId:"crew-settings-harness",onPick:e=>{h((0,i.L)(u,{harness:e,offers:m}))}})}),(0,s.jsx)(c.f,{shipName:e,offered:j??{repositories:[],folders:[]},workspace:u.workspace,...x?.field==="workspace"?{refusal:x.reason}:{},isDisabled:g,onChange:e=>{h({...u,workspace:e})}}),void 0===b?null:(0,s.jsx)(r.f,{shipName:e,picked:b.chipsOf(u.machineLabels),groups:b.groups,match:b.matchOf(u.machineLabels),max:b.max,isDisabled:g,onAdd:e=>{h({...u,machineLabels:[...u.machineLabels,e]})},onRemove:e=>{h({...u,machineLabels:u.machineLabels.filter(s=>s!==e)})}}),(0,s.jsx)(o.f,{shipName:e,picked:u.mcpServers,offered:j?.mcpServers??[],isDisabled:g,onAdd:e=>{h({...u,mcpServers:[...u.mcpServers,e]})},onRemove:e=>{h({...u,mcpServers:u.mcpServers.filter(s=>s!==e)})}}),(j?.options??[]).map((e,t)=>(0,s.jsx)(l.f,{id:`${v.options}-${String(t)}`,label:e.name,error:0===t?N("options"):void 0,children:(0,s.jsx)(d.f,{id:`${v.options}-${String(t)}`,items:Object.fromEntries(e.values.map(s=>[s,s===e.defaultValue?`${s} (default)`:s])),value:u.options[e.name]??"",isDisabled:g,testId:`crew-settings-option-${e.name}`,onPick:s=>{h({...u,options:{...u.options,[e.name]:s}})}})},e.name)),(0,s.jsx)(l.f,{id:v.firstPrompt,label:"First prompt",isOptional:!0,hint:(0,s.jsxs)("span",{className:"flex justify-between gap-3",children:[(0,s.jsx)("span",{children:"The session starts with it, on its first start only."}),(0,s.jsxs)("span",{className:"tabular-nums",children:[(0,i.Q)(w)," of ",(0,i.Q)(p)]})]}),error:y?`A first prompt is at most ${(0,i.Q)(p)}.`:N("firstPrompt"),children:(0,s.jsx)(n.f,{id:v.firstPrompt,rows:3,disabled:g,"aria-invalid":!!y||void 0,"data-testid":"crew-settings-first-prompt",value:u.firstPrompt,onChange:e=>{h({...u,firstPrompt:e.target.value})}})}),void 0===f?null:(0,s.jsx)(l.f,{id:v.squadron,label:"Squadron",isOptional:!0,hint:"The session starts with that squadron’s crew line and template.",error:N("squadron"),children:(0,s.jsx)(d.f,{id:v.squadron,items:{"":"None",...Object.fromEntries(f.map(e=>[e,e]))},value:u.squadron,isDisabled:g,testId:"crew-settings-squadron",onPick:e=>{h({...u,squadron:e})}})})]})}])},404032,757364,667609,569917,389589,e=>{var s=e.i(843476),t=e.i(422768),i=e.i(474544),a=e.i(77071),n=e.i(263676),r=e.i(522016),o=e.i(271645),l=e.i(770703),d=e.i(878608),c=e.i(681924),m=e.i(406734),u=e.i(695960);let h=(0,l.default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});function p({groups:e,picked:t,isDisabled:i,onAdd:n}){let[l,d]=(0,o.useState)(!1);return(0,s.jsxs)(m.V,{open:l,onOpenChange:d,children:[(0,s.jsx)(m.J,{render:(0,s.jsx)(c.f,{type:"button",variant:"ghost",size:"xs",icon:(0,s.jsx)(a.f,{}),disabled:i,"data-testid":"machine-labels-add"}),children:"Add label"}),(0,s.jsxs)(m.T,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"machine-labels-popover",children:[(0,s.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:"Machine label"}),(0,s.jsx)(h,{groups:e,pickedValueIds:t.map(e=>e.valueId),countWord:"machine",onPick:e=>{d(!1),n(e)}}),(0,s.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:["Exact matches, all must hold.",(0,s.jsx)(r.default,{href:"/labels",className:"font-medium text-foreground hover:underline",children:"Manage labels"})]})]})]})}e.s(["f",0,function({shipName:e,picked:a,groups:r,match:l,max:c,isDisabled:m,onAdd:h,onRemove:f,unknown:x=[],onRemoveUnknown:g}){let b=(0,d.o)(a.length);return(0,s.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"machine-labels",children:[(0,s.jsxs)("span",{className:"text-body font-medium",children:["Machine labels",(0,s.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"})]}),(0,s.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===a.length?(0,s.jsx)("span",{className:"text-meta text-muted-foreground",children:"Any machine"}):null,a.map((e,t)=>(0,s.jsxs)(o.Fragment,{children:[0===t?null:(0,s.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,s.jsx)(u.f,{chip:e,testId:"machine-label",...m?{}:{onRemove:()=>{f(e.valueId)}}})]},e.valueId)),x.map(e=>(0,s.jsxs)("span",{"data-testid":"machine-label-unknown",title:`${e}: not 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 font-mono text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,s.jsx)(t.f,{"aria-hidden":!0}),e,void 0===g||m?null:(0,s.jsx)("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>{g(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,s.jsx)(n.X,{"aria-hidden":!0})})]},e)),a.length+x.length>=c?null:(0,s.jsx)(p,{groups:r,picked:a,isDisabled:m,onAdd:h})]}),0===x.length?null:(0,s.jsxs)("p",{role:"alert","data-testid":"machine-labels-unknown-note",className:"text-meta text-tone-attention-fg",children:["Not in this fleet: ",x.join(", "),". Forming refuses ",1===x.length?"it":"them",": define ",1===x.length?"it":"them"," on the Labels page, or remove ",1===x.length?"it":"them"," here."]}),0===a.length?null:0===l.matching.length?(0,s.jsxs)("p",{role:"status","data-testid":"machine-labels-match",className:"flex items-start gap-2 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-meta text-tone-waiting-fg [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,s.jsx)(i.f,{"aria-hidden":!0}),(0,s.jsxs)("span",{children:["No machine matches ",b.these,". You can still request: it waits on Needs crew until a machine ",b.carries,"."]})]}):(0,s.jsxs)("p",{className:"text-meta","data-testid":"machine-labels-match",children:["Matches ",l.matching.length," of ",l.total," ",1===l.total?"machine":"machines",": ",l.matching.join(", "),"."]}),(0,s.jsxs)("p",{className:"text-meta text-muted-foreground",children:["The plugin places ",e," only on a machine that carries every label here. Leave it empty for any machine."]})]})}],404032);var f=e.i(646013),x=e.i(912407);function g({server:e,onRemove:t}){return(0,s.jsxs)("span",{"data-testid":"mcp-server",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,s.jsx)("span",{className:"truncate",children:e}),void 0===t?null:(0,s.jsx)("button",{type:"button","aria-label":`Remove ${e}`,onClick:t,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,s.jsx)(n.X,{"aria-hidden":!0})})]})}e.s(["f",0,function({shipName:e,picked:t,offered:i,isDisabled:n=!1,onAdd:r,onRemove:o}){let l=i.filter(e=>!t.includes(e)),d=i.length>0&&0===l.length,m=(0,s.jsx)(c.f,{type:"button",variant:"ghost",size:"xs",icon:(0,s.jsx)(a.f,{}),disabled:n||d,focusableWhenDisabled:d&&!n,"data-testid":"mcp-servers-add",children:"Add server"});return(0,s.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"mcp-servers",children:[(0,s.jsxs)("span",{className:"text-body font-medium",children:["MCP servers",(0,s.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"})]}),(0,s.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===t.length?(0,s.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):null,t.map(e=>(0,s.jsx)(g,{server:e,onRemove:n?void 0:()=>{o(e)}},e)),d?(0,s.jsxs)(x.Tooltip,{children:[(0,s.jsx)(x.TooltipTrigger,{render:m}),(0,s.jsx)(x.TooltipContent,{children:"Every offered server is added."})]}):(0,s.jsxs)(f.DropdownMenu,{children:[(0,s.jsx)(f.DropdownMenuTrigger,{render:m}),(0,s.jsx)(f.DropdownMenuContent,{align:"start",children:0===l.length?(0,s.jsx)("p",{"data-testid":"mcp-servers-none-offered",className:"max-w-64 px-2 py-1.5 text-meta text-muted-foreground",children:"No machine offers an MCP server for this harness yet."}):l.map(e=>(0,s.jsx)(f.DropdownMenuItem,{className:"font-mono text-id",onClick:()=>{r(e)},children:e},e))})]})]}),(0,s.jsxs)("p",{className:"text-meta text-muted-foreground",children:[e,"’s session starts with these servers’ tools, read-only. The plugin places it only on a machine that offers every one."]})]})}],757364);var b=e.i(527256),v=e.i(808041),j=e.i(895e3),N=e.i(375773);function w({id:e,label:t,isOptional:i,hint:a,error:n,className:r,children:o}){return(0,s.jsxs)("div",{className:`flex min-w-0 flex-col gap-1.5 ${r??""}`,children:[(0,s.jsxs)(N.f,{htmlFor:e,children:[t,i?(0,s.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"}):null]}),o,void 0===a?null:(0,s.jsx)("p",{className:"text-meta text-muted-foreground",children:a}),void 0===n?null:(0,s.jsx)(j.f,{variant:"field",title:n})]})}e.s(["f",0,w],667609);var y=e.i(946033);function k({id:e,items:t,value:i,onPick:a,isDisabled:n,testId:r}){return(0,s.jsxs)(y.d,{items:t,value:i,disabled:n,onValueChange:e=>{"string"==typeof e&&a(e)},children:[(0,s.jsx)(y.P,{id:e,className:"h-(--size-control) w-full","data-testid":r,children:(0,s.jsx)(y.U,{})}),(0,s.jsx)(y.r,{children:Object.entries(t).map(([e,t])=>(0,s.jsx)(y.T,{value:e,children:t},e))})]})}function C({shipName:e,subRepositories:t,addable:i,errors:r,isDisabled:l=!1,onAdd:d,onBranchChange:m,onRemove:u}){let h=(0,o.useId)(),p=0===i.length,g=(0,s.jsx)(c.f,{type:"button",variant:"ghost",size:"xs",icon:(0,s.jsx)(a.f,{}),disabled:l||p,focusableWhenDisabled:p&&!l,"data-testid":"crew-settings-sub-repositories-add",children:"Add sub-repository"});return(0,s.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"crew-settings-sub-repositories",children:[(0,s.jsxs)("span",{className:"text-body font-medium",children:["Sub-repositories",(0,s.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"})]}),0===t.length?null:(0,s.jsx)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card",children:t.map(({repository:e,ref:t},i)=>{let a=r[i],o=void 0===a?void 0:`${h}-${String(i)}`;return(0,s.jsxs)("li",{className:"flex flex-col gap-1.5 px-2.5 py-2","data-testid":"crew-settings-sub-repository-row",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-id","data-testid":"crew-settings-sub-repository",children:e}),(0,s.jsx)(b.e,{isMono:!0,"aria-label":`Branch of ${e}`,"aria-invalid":void 0!==a||void 0,"aria-describedby":o,placeholder:"Default branch",className:"h-(--size-control-sm) w-32 shrink-0 px-2 text-id sm:w-36",value:t,disabled:l,onChange:e=>{m(i,e.target.value)}}),l?(0,s.jsx)("span",{"aria-hidden":!0,className:"size-7 shrink-0"}):(0,s.jsx)(c.f,{type:"button",variant:"ghost",size:"sm",isIconOnly:!0,"aria-label":`Remove ${e}`,"aria-describedby":o,icon:(0,s.jsx)(n.X,{}),onClick:()=>{u(i)}})]}),void 0===a?null:(0,s.jsx)(j.f,{variant:"field",id:o,title:a})]},`${e}-${String(i)}`)})}),(0,s.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===t.length?(0,s.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):null,p?(0,s.jsxs)(x.Tooltip,{children:[(0,s.jsx)(x.TooltipTrigger,{render:g}),(0,s.jsx)(x.TooltipContent,{children:"Every offered repository is added."})]}):(0,s.jsxs)(f.DropdownMenu,{children:[(0,s.jsx)(f.DropdownMenuTrigger,{render:g}),(0,s.jsx)(f.DropdownMenuContent,{align:"start",children:i.map(e=>(0,s.jsx)(f.DropdownMenuItem,{className:"font-mono text-id",onClick:()=>{d(e)},children:e},e))})]})]}),(0,s.jsxs)("p",{className:"text-meta text-muted-foreground",children:["Each is a new git worktree beside the main repository, for ",e," to work in. The plugin places ",e," only on a machine that offers every repository."]})]})}e.s(["f",0,k],569917),e.s(["f",0,function({shipName:e,offered:t,workspace:i,onChange:a,refusal:n,isDisabled:r=!1}){let l={workspace:(0,o.useId)(),branch:(0,o.useId)()},d=(0,v.j)(i,t),c=void 0===n?void 0:(0,v.S)(n,i),m=d.subRepositories.map((e,s)=>e??(s===c?n:void 0)),u=d.main??(void 0===c?n:void 0),h=e=>{i?.kind==="repositories"&&a({...i,subRepositories:e})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-x-3 gap-y-4 sm:grid-cols-[minmax(0,1fr)_11rem]",children:[(0,s.jsx)(w,{id:l.workspace,label:"Workspace",hint:i?.kind==="folder"?"A folder is used as it is, shared by the ships in it, with no sub-repositories.":void 0,error:u,className:i?.kind==="repositories"?void 0:"sm:col-span-2",children:(0,s.jsx)(k,{id:l.workspace,items:(0,v.Y)(t,i),value:(0,v.X)(i),isDisabled:r,testId:"crew-settings-workspace",onPick:e=>{a((0,v.a)(e,i))}})}),i?.kind==="repositories"?(0,s.jsx)(w,{id:l.branch,label:"Branch",isOptional:!0,children:(0,s.jsx)(b.e,{id:l.branch,isMono:!0,placeholder:"Default branch",disabled:r,"data-testid":"crew-settings-branch",value:i.main.ref,onChange:e=>{a({...i,main:{...i.main,ref:e.target.value}})}})}):null]}),i?.kind==="repositories"?(0,s.jsx)(C,{shipName:e,subRepositories:i.subRepositories,addable:(0,v.r)(i,t),errors:m,isDisabled:r,onAdd:e=>{h([...i.subRepositories,{repository:e,ref:""}])},onBranchChange:(e,s)=>{h(i.subRepositories.map((t,i)=>i===e?{...t,ref:s}:t))},onRemove:e=>{h(i.subRepositories.filter((s,t)=>t!==e))}}):null]})}],389589)},902527,e=>{var s=e.i(843476),t=e.i(367795),i=e.i(285595),a=e.i(316984),n=e.i(980799),r=e.i(271645),o=e.i(681924),l=e.i(812437),d=e.i(923060),c=e.i(348184),m=e.i(527256),u=e.i(375773),h=e.i(682592),p=e.i(681382),f=e.i(895e3),x=e.i(34512),g=e.i(808041),b=e.i(165160),v=e.i(133173),j=e.i(443988),N=e.i(675774),w=e.i(577435),y=e.i(516752);function k({types:e,taken:c,onTypedChange:C,isPending:I,error:S,shipLimit:z,accountUrl:D,crewRequest:P,scopeGroups:T,onSubmit:R}){let{shipHandleMaxLength:L,firstPromptMaxBytes:$}=(0,x.x)(),M=(0,r.useId)(),q=(0,r.useId)(),F=(0,r.useId)(),O=(0,r.useId)(),A=(0,r.useId)(),V=(0,r.useId)(),[E,B]=(0,r.useState)(""),[_,U]=(0,r.useState)(""),[W,X]=(0,r.useState)(""),[Q,H]=(0,r.useState)([]),[Y,G]=(0,r.useState)(void 0!==P),[K,Z]=(0,r.useState)(()=>(0,g.P)(P?.offers??[])),J=K.machineLabels.length>0&&P?.machineLabels?.matchOf(K.machineLabels).matching.length===0,ee=(0,g.B)(K),es=P?.check?.kind==="refused"?P.check:void 0,et=(0,g.j)(K.workspace,P?.offers.find(e=>e.harness===K.harness)).note,ei=!Y||void 0===P||void 0!==ee&&void 0===es&&void 0===et&&(0,g.R)(K.firstPrompt)<=$,ea=(0,b.L)(E,{activeNames:c.names}),en="invalid"===ea.kind||"reserved"===ea.kind||"taken"===ea.kind,er=_.trim(),eo=(0,t.C)(er),el=""!==er&&!eo,ed="available"===ea.kind&&eo&&void 0===z&&ei,ec=void 0!==P&&Y;return(0,s.jsxs)("form",{noValidate:!0,"data-testid":"commission-form",className:"contents",onSubmit:e=>{e.preventDefault(),ed&&R({name:E,type:er,...""===W.trim()?{}:{note:W},...0===Q.length?{}:{scopes:[...Q]}},Y?void 0===P?{settings:{}}:void 0===ee?void 0:{settings:ee}:void 0)},children:[(0,s.jsxs)(d.DialogHeader,{children:[(0,s.jsx)(d.DialogTitle,{children:"Commission a ship"}),(0,s.jsx)(d.DialogDescription,{children:ec?"A durable identity with its own inbox, and a crew request so it gets a session right away.":"A ship is a durable agent identity with its own inbox. Next, you get the starting prompt."})]}),void 0===z?null:(0,s.jsx)(w.f,{...(0,y.y)(z),accountUrl:D,testId:"commission-ship-limit"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,s.jsx)(u.f,{htmlFor:M,children:"Name"}),(0,s.jsxs)("span",{className:"text-caption text-muted-foreground tabular-nums",children:[E.length," / ",L]})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(m.e,{id:M,isMono:!0,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"e.g. reviewer-02","data-testid":"commission-name","aria-invalid":!!en||void 0,"aria-describedby":q,className:"pr-9 max-sm:h-(--size-control-touch) max-sm:text-input-touch",value:E,onChange:e=>{B((0,b.I)(e.target.value)),C?.({name:(0,b.I)(e.target.value),type:er})}}),"available"===ea.kind?(0,s.jsx)(i.f,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-tone-ok-fg"}):en?(0,s.jsx)(a.f,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-destructive-text"}):null]}),(0,s.jsx)("p",{id:q,"aria-live":"polite",className:(0,l.f)("text-meta",en?"text-destructive-text":"text-muted-foreground"),children:ea.message})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(u.f,{htmlFor:F,children:"Type"}),(0,s.jsx)(v.f,{id:F,options:e.map(e=>({value:e,label:e})),value:""===_?null:_,onValueChange:e=>{U(e??""),C?.({name:E,type:(e??"").trim()})},isFreeText:!0,toQuery:b.I,leadingIcon:(0,s.jsx)(n.f,{}),placeholder:"e.g. reviewer",isInvalid:el,"aria-describedby":O,"data-testid":"commission-type"}),(0,s.jsx)("p",{id:O,className:(0,l.f)("text-meta",el?"text-destructive-text":"text-muted-foreground"),children:el?`Use 1 to ${String(L)} lowercase letters, digits, hyphens or colons.`:(0,b.t)(_,c.typeShipCounts.get(er))})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(u.f,{htmlFor:A,children:"Note (optional)"}),(0,s.jsx)(j.f,{id:A,rows:2,"data-testid":"commission-note",value:W,onChange:e=>{X(e.target.value)}})]}),void 0===T?(0,s.jsx)("p",{className:"text-meta text-muted-foreground","data-testid":"commission-scopes-reading",children:"Reading the fleet's scopes."}):T.map(e=>(0,s.jsxs)("div",{className:"flex flex-col gap-2","data-testid":`commission-scopes-${e.namespace??"fleet"}`,children:[(0,s.jsx)(h.ScopePicker,{label:(0,s.jsxs)(s.Fragment,{children:[e.title," ",null===e.namespace?null:(0,s.jsx)("span",{className:"font-mono text-id text-muted-foreground",children:e.namespace})]}),listed:e.scopes,picked:Q.filter(s=>e.scopes.some(e=>e.scope===s)),onPick:s=>{H(t=>[...t.filter(s=>!e.scopes.some(e=>e.scope===s)),...s])},isDisabled:I}),null===e.namespace?(0,s.jsx)("p",{className:"text-meta text-muted-foreground",children:"Every ship sends and receives. Fleet access lets its session act as the console does; crew ships lets a trierarch start their sessions. It cannot be changed later."}):null]},e.namespace??"")),(0,s.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border pt-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)(u.f,{htmlFor:V,children:"Request a crew"}),(0,s.jsx)(p.Switch,{id:V,checked:Y,onCheckedChange:G,"data-testid":"commission-request-crew"})]}),(0,s.jsx)("p",{className:"-mt-2 text-meta text-muted-foreground",children:void 0===P?`Puts ${""===E?"the ship":E} on your Needs crew list until you crew it by hand. You get its starting prompt next either way.`:"The trierarch plugin picks a trierarch that starts the session and keeps it crewed."}),ec?(0,s.jsx)(N.f,{shipName:""===E.trim()?"this ship":E.trim(),offers:P.offers,values:K,firstPromptMaxBytes:$,onChange:e=>{Z(e),P.onSettingsChange((0,g.B)(e))},squadrons:P.squadrons,refusal:es,isDisabled:I,...void 0===P.machineLabels?{}:{machineLabels:P.machineLabels}}):null]}),void 0===S?null:(0,s.jsx)(f.f,{title:"Not commissioned",description:S}),(0,s.jsxs)(d.DialogFooter,{className:"items-center",children:[void 0===P?null:(0,s.jsx)("span",{className:"mr-auto text-meta text-muted-foreground","data-testid":"commission-crew-note",children:Y?et??(J?"The request will wait for a machine with these labels.":P.check?.kind==="noRoom"?"The request will wait for room.":"Uncheck Request a crew to get the starting prompt instead."):null}),(0,s.jsx)(d.DialogClose,{render:(0,s.jsx)(o.f,{type:"button",disabled:I}),children:"Cancel"}),(0,s.jsx)(o.f,{type:"submit",variant:"primary",isLoading:I,disabled:!ed,"data-testid":"commission-submit",children:I?"Commissioning":ec?"Commission and request crew":"Commission ship"})]})]})}e.s(["CommissionDialog",0,function(e){let{isOpen:t,onOpenChange:i,isPending:a}=e;return(0,s.jsx)(d.Dialog,{open:t,onOpenChange:e=>{a||i(e)},children:(0,s.jsx)(d.DialogContent,{size:"md","data-testid":"commission-dialog",className:c.f.phoneFullScreen,children:(0,s.jsx)(k,{...e})})})}])},165160,e=>{var s=e.i(367795),t=e.i(890135);let i=`Lowercase letters, digits, hyphens and colons, up to ${String(s.Z)} characters, unique among active ships.`;e.s(["I",0,function(e){return e.toLowerCase()},"L",0,function(e,a){return""===e?{kind:"empty",message:i}:(0,s.C)(e)?e===t.D?{kind:"reserved",message:`${t.D} is reserved for the operator ship.`}:e===a.current?{kind:"unchanged",message:"That is its name now."}:a.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(s.Z)} lowercase letters, digits, hyphens or colons.`}},"t",0,function(e,s){let t=e.trim();return""===t||void 0===s?"Free text. Pick a type in use or write a new one.":0===s?`No ship uses this type yet. ${t} becomes a new type.`:1===s?"1 ship uses this type.":`${String(s)} ships use this type.`}])},375773,e=>{var s=e.i(843476),t=e.i(812437);e.s(["f",0,function({className:e,htmlFor:i,...a}){return(0,s.jsx)("label",{"data-slot":"label",htmlFor:i,className:(0,t.f)("text-body font-medium text-foreground select-none",e),...a})}])},681382,e=>{var s=e.i(843476),t=e.i(271645),i=e.i(951437),a=e.i(828918),n=e.i(146376),r=e.i(502077),o=e.i(956789),l=e.i(552245),d=e.i(788015),c=e.i(540886),m=e.i(733332);let u=t.createContext(void 0),h={...e.i(875812).s,checked:e=>e?{"data-checked":""}:{"data-unchecked":""}};var p=e.i(64350),f=e.i(469690),x=e.i(381104),g=e.i(884708),b=e.i(247778),v=e.i(31421),j=e.i(538489),N=e.i(675606),w=e.i(380025),y=e.i(606039);let k=t.forwardRef(function(e,m){let{checked:k,className:C,defaultChecked:I,"aria-labelledby":S,form:z,id:D,inputRef:P,name:T,nativeButton:R=!1,onCheckedChange:L,readOnly:$=!1,required:M=!1,disabled:q=!1,render:F,uncheckedValue:O,value:A,style:V,...E}=e,{clearErrors:B}=(0,g.f)(),{state:_,setTouched:U,setDirty:W,validityData:X,setFilled:Q,setFocused:H,validationMode:Y,disabled:G,name:K,validation:Z}=(0,f.U)(),{labelId:J}=(0,b.f)(),ee=G||q,es=K??T,et=t.useRef(null),ei=(0,a.A)(et,P,Z.inputRef),ea=t.useRef(null),en=(0,d.f)(),er=(0,j.f)({id:D}),eo=R?void 0:er,[el,ed]=(0,i.f)({controlled:k,default:!!I,name:"Switch",state:"checked"});(0,x.f)(ea,en,el,void 0,!ee,T),(0,n.f)(()=>{Q(el)},[el,Q]),(0,y.f)(el,()=>{B(es),W(el!==X.initialValue),Z.change(el)});let{getButtonProps:ec,buttonRef:em}=(0,c.f)({disabled:ee,native:R}),eu=(0,v.f)(S,J,et,!R,eo),eh={...Z.getValidationProps(ee),checked:el,disabled:ee,form:z,id:eo,name:es,required:M,style:es?r.L:r.p,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:ei,onChange(e){if(e.nativeEvent.defaultPrevented)return;if($)return void e.preventDefault();let s=e.currentTarget.checked,t=(0,N.j)(w.f.none,e.nativeEvent);L?.(s,t),t.isCanceled||ed(s)},onClick(e){e.stopPropagation()},onFocus(){ea.current?.focus()},...void 0!==A?{value:A}:o.w},ep=t.useMemo(()=>({..._,checked:el,disabled:ee,readOnly:$,required:M}),[_,el,ee,$,M]),ef=(0,l.f)("span",e,{state:ep,ref:[m,ea,em],props:[{id:R?er:en,role:"switch","aria-checked":el,"aria-readonly":$||void 0,"aria-required":M||void 0,"aria-labelledby":eu,onFocus(){ee||H(!0)},onBlur(){let e=et.current;e&&!ee&&(U(!0),H(!1),"onBlur"===Y&&Z.commit(e.checked))},onClick(e){if($||ee)return;e.preventDefault();let s=et.current;s&&(0,p.f)(s,e)}},E,ec,e=>Z.getValidationProps(ee,e)],stateAttributesMapping:h});return(0,s.jsxs)(u.Provider,{value:ep,children:[ef,!el&&es&&void 0!==O&&(0,s.jsx)("input",{type:"hidden",form:z,name:es,value:O,disabled:ee}),(0,s.jsx)("input",{...eh,suppressHydrationWarning:!0})]})}),C=t.forwardRef(function(e,s){let{render:i,className:a,style:n,...r}=e,o=function(){let e=t.useContext(u);if(void 0===e)throw Error((0,m.f)(63));return e}();return(0,l.f)("span",e,{state:o,ref:s,stateAttributesMapping:h,props:r})});e.s(["Root",0,k,"Thumb",0,C],450994);var I=e.i(450994),I=I,S=I,z=e.i(812437);e.s(["Switch",0,function({className:e,...t}){return(0,s.jsx)(I.Root,{"data-slot":"switch",className:(0,z.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),...t,children:(0,s.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"})})}],681382)},682592,e=>{var s=e.i(843476),t=e.i(524189),t=t,i=e.i(93976),a=t,n=t,r=t,o=t,l=t,d=e.i(62050),c=e.i(145017),m=e.i(547125),u=e.i(410030),h=e.i(458998),p=e.i(394313),f=e.i(253535),x=e.i(998919),g=e.i(689664),b=e.i(263676);let v=({scope:e,description:s})=>({value:e,description:s});e.s(["ScopePicker",0,function({label:e,listed:j,picked:N,onPick:w,isDisabled:y=!1}){let{contains:k}=t.useFilter(),C=[...j.map(v),...N.filter(e=>!j.some(s=>s.scope===e)).map(e=>({value:e,description:"No longer defined in the fleet"}))],I=C.filter(e=>N.includes(e.value));return(0,s.jsxs)(i.f.Root,{multiple:!0,items:C,value:I,disabled:y,itemToStringLabel:e=>e.value,isItemEqualToValue:(e,s)=>e.value===s.value,onValueChange:(e,s)=>{"escape-key"===s.reason?s.cancel():w(e.map(e=>e.value))},filter:(e,s)=>k(e.value,s)||k(e.description,s),children:[(0,s.jsxs)("div",{className:"grid gap-1.5","data-testid":"scope-picker",children:[(0,s.jsx)(a.Label,{className:"text-body font-medium text-foreground",children:e}),(0,s.jsx)(n.InputGroup,{className:"flex min-h-(--size-control) flex-wrap items-center gap-1 rounded-md border border-input bg-background px-2 py-1 has-disabled:opacity-50",children:(0,s.jsxs)(r.Chips,{className:"contents",children:[I.map(e=>(0,s.jsxs)(o.Chip,{"data-testid":"scope-picker-chip",className:"inline-flex items-center gap-1 rounded-sm border border-border bg-muted px-1.5 font-mono text-id text-foreground","aria-label":e.value,children:[e.value,(0,s.jsx)(l.ChipRemove,{className:"text-muted-foreground hover:text-foreground","aria-label":`Remove ${e.value}`,children:(0,s.jsx)(b.X,{"aria-hidden":!0,className:"size-3"})})]},e.value)),(0,s.jsx)(d.f.Input,{"data-testid":"scope-picker-search",placeholder:0===I.length?"Search the fleet's scopes":"",className:"h-6 min-w-32 flex-1 bg-transparent text-body outline-none placeholder:text-muted-foreground"})]})})]}),(0,s.jsx)(c.f.Portal,{children:(0,s.jsx)(m.f.Positioner,{sideOffset:4,className:"z-50",children:(0,s.jsxs)(u.f.Popup,{className:"max-h-72 w-(--anchor-width) overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",children:[(0,s.jsx)(h.f.Empty,{className:"px-2 py-1 text-meta text-muted-foreground empty:hidden",children:"No scope listed matches."}),(0,s.jsx)(p.f.List,{children:e=>(0,s.jsxs)(f.f.Item,{value:e,"data-testid":"scope-picker-option",className:"grid cursor-default grid-cols-[1rem_1fr] gap-x-2 rounded-sm px-2 py-1 data-highlighted:bg-accent",children:[(0,s.jsx)(x.f.ItemIndicator,{className:"row-span-2 pt-0.5",children:(0,s.jsx)(g.f,{"aria-hidden":!0,className:"size-3.5"})}),(0,s.jsx)("span",{className:"col-start-2 font-mono text-code",children:e.value}),(0,s.jsx)("span",{className:"col-start-2 text-meta text-muted-foreground",children:e.description})]},e.value)})]})})})]})}],682592)}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,437750,e=>{var t=e.i(456420);let s={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],437750)},271567,e=>{var t=e.i(456420);let s={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],271567)},569644,269846,e=>{var t=e.i(456420);let s={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],569644);let i={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};i.node;let a=(0,t.f)(i);e.s(["f",0,a],269846)},841220,e=>{var t=e.i(456420);let s={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],841220)},383035,e=>{var t=e.i(456420);let s={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],383035)},759659,e=>{var t=e.i(456420);let s={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"]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],759659)},419413,e=>{e.s(["f",0,500])},177096,e=>{var t=e.i(843476),s=e.i(271645),n=e.i(422768),i=e.i(316984),a=e.i(456420);let r={name:"folder-x",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9.5 10.5 5 5",key:"ra9qjz"}],["path",{d:"m14.5 10.5-5 5",key:"l2rkpq"}]]};r.node;let l=(0,a.f)(r);var d=e.i(611568),o=e.i(749287),c=e.i(586875),h=e.i(759659),m=e.i(522016),x=e.i(54492),u=e.i(849635),p=e.i(681924),f=e.i(44913),g=e.i(588671),j=e.i(33479),v=e.i(861966),y=e.i(615385),w=e.i(699261),b=e.i(763481),N=e.i(36556);function k({names:e}){return 0===e.length?null:(0,t.jsxs)(t.Fragment,{children:[1===e.length?" · sub-repository ":" · sub-repositories ",e.map((e,n)=>(0,t.jsxs)(s.Fragment,{children:[0===n?null:", ",(0,t.jsx)("span",{className:"font-mono text-id",children:e})]},e))]})}function I({spot:e,now:s}){let n="running"===e.status?e.startedAt:null,i=(0,x.z)(e);return null===n&&void 0===i?null:(0,t.jsxs)("span",{className:"text-meta text-muted-foreground","data-testid":"machine-spot-session",children:[null===n?null:(0,t.jsxs)(t.Fragment,{children:["since"," ",(0,t.jsx)("time",{dateTime:n,title:(0,u.o)(new Date(n)),className:"tabular-nums",children:(0,u.l)(new Date(n),s)})]}),null!==n&&void 0!==i?" · ":null,i]})}function z({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 bg-card px-3.5 py-3",children:[(0,t.jsx)("dt",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"flex min-w-0 items-center gap-1.5 text-body text-foreground",children:s})]})}function S({title:e,count:s,note:n,children:i}){return(0,t.jsxs)("section",{"aria-label":e,className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("h2",{className:"flex items-baseline gap-2 text-section font-semibold",children:[e,void 0===s?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground tabular-nums",children:s}),void 0===n?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground",children:n})]}),i]})}function C({icon:e,name:s,meta:n,action:i}){return(0,t.jsxs)("li",{className:"flex items-start gap-2 px-3.5 py-2.5 [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[e,(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:s}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:n})]}),i]})}function $({kept:e,shipName:s,isBeingCleared:n,onClear:i}){let a=n?(0,t.jsx)(A,{}):void 0===i?void 0:(0,t.jsx)(p.f,{size:"xs",variant:"ghost",icon:(0,t.jsx)(h.f,{"aria-hidden":!0}),"aria-label":`Delete the kept ${e.repository} worktree of ${s}`,"data-testid":"machine-worktree-delete",onClick:()=>{i({...e,shipName:s})},children:"Delete"});return(0,t.jsx)(C,{icon:(0,t.jsx)(l,{"aria-hidden":!0}),name:`${e.repository}/${s}`,meta:"Kept after release, with uncommitted changes",action:a})}function A(){return(0,t.jsxs)("span",{"data-testid":"machine-worktree-clearing",className:"inline-flex shrink-0 items-center gap-1 rounded-md border border-tone-waiting-border bg-tone-waiting-bg px-1.5 py-0.5 text-meta text-tone-waiting-fg [&_svg]:mt-0 [&_svg]:text-tone-waiting-fg",children:[(0,t.jsx)(d.f,{"aria-hidden":!0}),"Clearing"]})}function M({machine:e,state:s,spots:a,location:r,labels:d,now:h,shipNames:x,clearRequests:A=[],onClearKept:T}){if("loading"===s||"ready"===s&&void 0===e)return(0,t.jsxs)("div",{"aria-busy":!0,"data-testid":"machine-detail",className:"flex flex-col gap-4",children:[(0,t.jsx)("span",{className:"sr-only",children:"Loading the machine"}),(0,t.jsx)(g.f,{className:"h-8 w-48"}),(0,t.jsx)(g.f,{className:"h-16 w-full rounded-lg"}),(0,t.jsx)(g.f,{className:"h-40 w-full rounded-lg"})]});if("not-found"===s||void 0===e)return(0,t.jsx)("div",{"data-testid":"machine-detail",children:(0,t.jsx)(f.f,{variant:"section",icon:(0,t.jsx)(n.f,{}),title:"Machine not found",description:"The trierarch plugin lists no machine with this ship id. The link may be incomplete.",action:(0,t.jsx)(p.f,{size:"sm",nativeButton:!1,render:(0,t.jsx)(m.default,{href:"/trierarchs"}),children:"Back to Trierarchs"})})});let{details:_,report:q}=e,R=null===q?null:new Date(q.reportedAt),U=e.isSilent&&null!==e.lastSeenAt,D=U&&null!==R?`As of ${(0,u.w)(R)}`:void 0;return(0,t.jsxs)("div",{"data-testid":"machine-detail",className:"flex flex-col gap-5 max-sm:gap-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2.5",children:[(0,t.jsxs)("h1",{className:"inline-flex items-center gap-2 text-title font-semibold [&_svg]:size-(--size-icon-lg) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(c.f,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(N.W,{machine:e,now:h})]}),(0,t.jsx)(p.f,{size:"xs",icon:(0,t.jsx)(o.f,{"aria-hidden":!0}),nativeButton:!1,render:(0,t.jsx)(m.default,{href:`/ships/${e.shipId}`}),"data-testid":"machine-ship-page",children:"Ship page"})]}),(0,t.jsxs)("dl",{className:"grid grid-cols-5 gap-px overflow-hidden rounded-lg border border-border bg-border max-lg:grid-cols-2",children:[(0,t.jsx)(z,{label:"Capacity",children:(0,t.jsx)(y.f,{spots:a,caps:_?.caps,unknownText:null===R?"Unknown until it answers":`Unknown since ${(0,u.w)(R)}`})}),(0,t.jsx)(z,{label:"Machine",children:(0,t.jsx)(b.f,{kind:r?.kind??null,description:r?.description,size:"md"})}),(0,t.jsx)(z,{label:"Version",children:null===_?(0,t.jsx)("span",{className:"text-muted-foreground",children:"Unknown"}):(0,t.jsxs)("span",{className:"font-mono text-id",children:["aeolus-trierarch@",_.version]})}),(0,t.jsx)(z,{label:"Last answer",children:null===R?(0,t.jsx)("span",{className:"text-muted-foreground",children:"None yet"}):(0,t.jsx)("time",{dateTime:q?.reportedAt,title:(0,u.o)(R),className:"tabular-nums",children:(0,N.J)(R,h)})}),(0,t.jsxs)(z,{label:"Ship id",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.shipId}),(0,t.jsx)(v.f,{value:e.shipId,label:"Copy ship id"})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5","data-testid":"machine-labels-row",children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Labels"}),void 0===d?(0,t.jsx)(g.f,{className:"h-5.5 w-40"}):(0,t.jsx)(w.f,{chips:d}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Read-only here. Crew requests that ask for machine labels go only to machines carrying all of them."})]}),U&&null!==e.lastSeenAt?(0,t.jsxs)("p",{role:"alert","data-testid":"machine-silent",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 [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(i.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("strong",{className:"font-medium",children:[e.name," has not answered since ",(0,u.w)(new Date(e.lastSeenAt)),"."]})," ","It is probably not running",r?.description?` on ${r.description}`:"",". Until it answers, nothing restarts its sessions; everything below is its last answer."]})]}):null,(0,t.jsx)(S,{title:"Running here",count:a.length,note:D,children:0===a.length?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"No ship is assigned to this trierarch."}):(0,t.jsx)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card","data-testid":"machine-spots",children:a.map(e=>(0,t.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3.5 py-2.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)(m.default,{href:`/ships/${e.shipId}`,className:"truncate text-body font-medium hover:underline",children:e.name}),void 0===e.workspace?null:(0,t.jsxs)("span",{className:"text-meta break-words text-muted-foreground","data-testid":"machine-spot-workspace",children:[(0,t.jsx)("span",{className:"sr-only",children:"Workspace: "}),"repositories"===e.workspace.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-mono text-id",children:e.workspace.main})," · main repository",(0,t.jsx)(k,{names:e.workspace.subRepositories})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-mono text-id",children:e.workspace.name})," · folder, as it is"]})]})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-2.5",children:[(0,t.jsx)(I,{spot:e,now:h}),(0,t.jsx)(j.T,{status:e.status})]})]},e.shipId))})}),(0,t.jsx)(S,{title:"Harnesses",count:_?.harnesses.length,note:D,children:null===_?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Unknown until it answers."}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-card px-3.5 py-3",children:_.harnesses.map(e=>(0,t.jsx)(N.P,{harness:e,now:h},e.harness))})}),(0,t.jsx)(S,{title:"Workspaces",count:null===_?void 0:_.workspaces.repositories.length+_.workspaces.folders.length,children:null===_?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Unknown until it answers."}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-card px-3.5 py-3",children:(0,t.jsx)(N.I,{workspaces:_.workspaces})})}),null===_||0===_.kept.length&&0===_.orphans.length?null:(0,t.jsxs)(S,{title:"Worktrees",children:[(0,t.jsxs)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card","data-testid":"machine-worktrees",children:[_.kept.map(s=>{var n;return(0,t.jsx)($,{kept:s,shipName:x?.get(s.shipId)??s.shipId,isBeingCleared:(n={trierarchShipId:e.shipId,...s},A.some(e=>e.trierarchShipId===n.trierarchShipId&&e.shipId===n.shipId&&e.repository===n.repository)),onClear:T},`${s.shipId}/${s.repository}`)}),_.orphans.map(e=>(0,t.jsx)(C,{icon:(0,t.jsx)(l,{"aria-hidden":!0}),name:`${e.repository}/${e.name}`,meta:"No crew request"},`${e.repository}/${e.name}`))]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"The trierarch never deletes these on its own."})]})]})}var T=e.i(835114),_=e.i(837631),q=e.i(787964),R=e.i(917540),U=e.i(490262),D=e.i(458155),K=e.i(954616),O=e.i(266027),F=e.i(912598),H=e.i(427702),V=e.i(905387),E=e.i(442111),L=e.i(280581),P=e.i(718423),W=e.i(510921),B=e.i(714695),J=e.i(928459),Z=e.i(296676),Q=e.i(678485),Y=e.i(853573),G=e.i(500265);let X=(0,R.f)(()=>e.A(551212).then(e=>e.ClearWorktreeDialog),e=>void 0!==e.worktree);e.s(["default",0,function({params:e}){let n,i,a,{shipId:r}=(0,s.use)(e),l=(0,Z.f)(),d=(0,q.y)(),o=(0,J.t)(),c=(0,P.f)(),h=(0,G.x)(),m=(0,G.t)(),x=(0,U.Q)(),[u,p]=(0,s.useState)(void 0),f=(n=(0,H.I)(),(0,O.f)(n.fleet.clearRequests.queryOptions(void 0,{refetchInterval:1e4}))),g=(i=(0,H.I)(),a=(0,F.d)(),(0,K.f)(i.fleet.clearWorktree.mutationOptions({onSuccess:()=>a.invalidateQueries({queryKey:i.fleet.clearRequests.queryKey()})})));(0,Q.n)([o.error,c.error]);let j=m.data?.find(e=>e.shipId===r),v=(0,D.f)(void 0===j?void 0:[j.shipId])??[],y=void 0===j?[]:(0,B.o)(j,v),w=(0,E.K)([...void 0===j?[]:[j.shipId],...j?.details?.kept.map(e=>e.shipId)??[]]),b=(0,V.e)(),N=void 0===j?void 0:w?.get(j.shipId),k=[...(0,Y.J)(y.map(e=>e.shipId))].flatMap(([e,t])=>null===t.crewRequest?[]:[{id:e,settings:t.crewRequest.settings}]),I=(0,W.f)(k.map(e=>e.settings)),z=new Map(k.map((e,t)=>[e.id,I?.[t]??null]));return(0,t.jsx)(_.f,{switcher:d.switcher,account:d.account,onCompose:d.onCompose,onSearch:d.onSearch,banner:d.banner,title:j?.name??"Machine",parents:[{href:"/trierarchs",label:"Trierarchs"}],live:c.live,header:"connected"!==h||m.isError?(0,t.jsx)(T.f,{connection:h,machines:m.data,ships:v,error:m.isError?m.error.message:void 0,onRetry:()=>{m.refetch()},now:l}):(0,t.jsx)(M,{machine:j,state:void 0===m.data?"loading":void 0===j?"not-found":"ready",spots:(0,B.A)(y,z),location:N?.location??null,...void 0===b||void 0===N?{}:{labels:(0,L.h)(N,b)},now:l,shipNames:new Map([...w?.values()??[]].map(e=>[e.id,e.name])),clearRequests:f.data??[],...x.canManage&&void 0!==j?{onClearKept:e=>{g.reset(),p({...e,trierarchShipId:j.shipId,machineName:j.name})}}:{}}),children:(0,t.jsx)(X,{worktree:u,onOpenChange:e=>{e||p(void 0)},isPending:g.isPending,...null===g.error?{}:{error:g.error.message},onClear:()=>{void 0!==u&&g.mutate({trierarchShipId:u.trierarchShipId,shipId:u.shipId,repository:u.repository},{onSuccess:()=>{p(void 0)}})}})})}],177096)},763481,676641,e=>{var t=e.i(843476),s=e.i(437750),n=e.i(271567),i=e.i(456420);let a={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};a.node;let r=(0,i.f)(a),l={name:"laptop",size:24,node:[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]};l.node;let d=(0,i.f)(l),o={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};o.node;let c=(0,i.f)(o),h={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};h.node;let m=(0,i.f)(h);var x=e.i(841220),u=e.i(383035),p=e.i(594831),f=e.i(812437),g=e.i(866616),j=e.i(127361),v=e.i(466787);function y(){return(0,t.jsxs)("span",{"data-testid":"harness-unknown",title:"The session stated no harness: a fault in Aeolus",className:"inline-flex h-5 shrink-0 items-center gap-1 rounded-full border border-tone-attention-border bg-tone-attention-bg px-1.5 text-micro font-semibold text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(v.f,{"aria-hidden":!0}),"Harness unknown"]})}e.s(["f",0,y],676641);let w={DEVICE:d,CLOUD:r,SERVER:x.f,OTHER:c},b={coding:u.f,chat:m,bot:n.f,console:s.f},N={md:"text-body",sm:"text-meta"};e.s(["f",0,function({kind:e,description:s=null,harness:n=null,isHarnessUnknown:i=!1,isCompact:a=!1,size:r="md",className:l}){let d=(0,f.f)("inline-flex min-w-0 items-center gap-1.5 text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",N[r],l);if(null===e)return(0,t.jsxs)("span",{"data-slot":"location-tag",className:d,children:[(0,t.jsx)(p.f,{"aria-hidden":!0}),"No session"]});let o=w[e],c=(0,j.f)(e),h=null===s?c:`${c} \xb7 ${s}`;if(i)return(0,t.jsxs)("span",{"data-slot":"location-tag",className:(0,f.f)(d,"flex-wrap"),title:h,children:[(0,t.jsx)(y,{}),(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)(o,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[c,null===s?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,children:" · "}),(0,t.jsx)("span",{className:"sr-only",children:", "}),(0,t.jsx)("span",{className:"text-foreground",children:s})]})]})]});if(null!==n){let e=(0,g._)(n),i=void 0===e?void 0:b[e],a=(0,g.f)(n);return(0,t.jsxs)("span",{"data-slot":"location-tag",className:d,title:null===s?`${a} \xb7 ${c}`:`${a} \xb7 ${c}: ${s}`,children:[void 0===i?null:(0,t.jsx)(i,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate text-foreground",children:a}),(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsx)(o,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:c}),null===s?null:(0,t.jsxs)("span",{className:"sr-only",children:[": ",s]})]})}return a?(0,t.jsxs)("span",{"data-slot":"location-tag",className:d,title:h,children:[(0,t.jsx)(o,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"sr-only",children:[c,": "]}),(0,t.jsx)("span",{className:"truncate text-foreground",children:s??c})]}):(0,t.jsxs)("span",{"data-slot":"location-tag",className:d,children:[(0,t.jsx)(o,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[c,null===s?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,children:" · "}),(0,t.jsx)("span",{className:"sr-only",children:", "}),(0,t.jsx)("span",{className:"text-foreground",children:s})]})]})]})}],763481)},721039,e=>{var t=e.i(843476),s=e.i(466787),n=e.i(866616),i=e.i(714695);e.s(["f",0,function({harness:e,reason:a}){return(0,t.jsxs)("p",{"data-testid":"not-offered",className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-meta text-tone-attention-fg [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:self-center",children:[(0,t.jsx)(s.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"font-medium",children:[(0,n.f)(e)," not offered"]}),(0,t.jsxs)("span",{children:[a,"."]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:i.N})]})}])},458155,e=>{var t=e.i(970597),s=e.i(419413),n=e.i(266027);async function i(e){let t,s=[];do{let n=await e(t);if("refused"===n.kind)return n;s.push(...n.data.items),t=n.data.nextCursor??void 0}while(void 0!==t)return{kind:"answered",data:s}}var a=e.i(905387),r=e.i(502660),l=e.i(427702);e.s(["f",0,function(e){let d=(0,l.I)(),o=(0,l._)(),c=[...new Set(e)].toSorted(),h=(0,n.f)({queryKey:d.fleet.list.queryKey({assignedTo:c}),queryFn:async()=>(0,r.h)(await i(async e=>({kind:"answered",data:await o.fleet.list.query({assignedTo:c,cursor:e,limit:s.f})}))),enabled:void 0!==e&&c.length>0,refetchInterval:a.L,select:e=>e.filter(t.f)});return void 0!==e&&0===c.length?[]:h.data}],458155)},615385,e=>{var t=e.i(843476),s=e.i(812437),n=e.i(714695);let i={running:"bg-tone-ok-fg",crewing:"bg-tone-active-fg",releasing:"bg-tone-active-fg",restarting:"bg-tone-waiting-fg",crashed:"bg-tone-attention-fg"};e.s(["f",0,function({spots:e,caps:a,unknownText:r="Unknown",testId:l}){let d=(0,n.Q)(e,a);if(void 0===a||void 0===d)return(0,t.jsx)("span",{"data-testid":l,className:"text-meta text-muted-foreground",children:r});let o=Math.max(0,a.ships-e.length);return(0,t.jsxs)("span",{role:"img","aria-label":d,"data-testid":l,className:"inline-flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[e.map((e,n)=>(0,t.jsx)("span",{title:`Spot ${String(n+1)}: ${e.name}, ${e.status}`,className:(0,s.f)("h-2 w-3 rounded-xs",i[e.status])},e.shipId)),Array.from({length:o},(s,n)=>(0,t.jsx)("span",{title:`Spot ${String(e.length+n+1)}: vacant`,className:"h-2 w-3 rounded-xs border border-input"},`free-${String(n)}`))]}),(0,t.jsx)("span",{className:"text-meta tabular-nums",children:d})]})}])},325846,e=>{var t=e.i(843476),s=e.i(912407),n=e.i(469477),i=e.i(849635);function a(){return(0,t.jsx)("span",{className:"text-muted-foreground",children:"·"})}e.s(["f",0,function({login:e}){let r="apiKey"===e.default?"subscription":"apiKey",{keyNotReady:l}=e,d=void 0===l?void 0:(0,n.Z)(l,void 0===l.at?void 0:(0,i.w)(new Date(l.at))),o=void 0===l?null:(0,t.jsx)("span",{"data-testid":"machine-key-chip","data-key":l.key,className:"inline-flex items-center rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 text-meta text-tone-attention-fg",...void 0===l.at?{}:{title:(0,i.o)(new Date(l.at))},children:n.a[l.key]});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{"data-testid":"machine-login-line",className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-meta",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"login"}),(0,t.jsx)("span",{className:"font-medium",children:n.w[e.default]}),0===e.otherCount?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e.otherCount," on ",n.w[r]]})]}),void 0===e.spentOnKeyUsd?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{}),(0,t.jsxs)(s.Tooltip,{children:[(0,t.jsxs)(s.TooltipTrigger,{render:(0,t.jsx)("span",{"data-testid":"machine-spent-on-key",className:"tabular-nums"}),children:[(0,n.D)(e.spentOnKeyUsd)," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:"on key"})]}),(0,t.jsx)(s.TooltipContent,{children:n.K})]})]})]}),null===o||void 0===e.waitingShips?null:(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta",children:[void 0===d?o:(0,t.jsxs)(s.Tooltip,{children:[(0,t.jsx)(s.TooltipTrigger,{render:(0,t.jsx)("span",{}),children:o}),(0,t.jsx)(s.TooltipContent,{children:d})]}),(0,t.jsxs)("span",{className:"text-muted-foreground","data-testid":"machine-ships-wait",children:[e.waitingShips," ",1===e.waitingShips?"ship waits":"ships wait"]})]})]})}])},36556,e=>{var t=e.i(843476),s=e.i(271567),n=e.i(152886),i=e.i(569644),a=e.i(269846),r=e.i(586875),l=e.i(466787),d=e.i(522016),o=e.i(23824),c=e.i(469477),h=e.i(866616),m=e.i(714695),x=e.i(849635),u=e.i(681924),p=e.i(705918),f=e.i(615385),g=e.i(325846),j=e.i(721039),v=e.i(763481);let y={alive:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",silent:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg","not-started":"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg"},w={alive:"Alive",silent:"Not answering","not-started":"Not started"};function b({machine:e,now:s}){let i=(0,m.k)(e),a=null===e.lastSeenAt?null:new Date(e.lastSeenAt);return(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-x-2 gap-y-1 text-meta","data-testid":"machine-liveness","data-liveness":i,children:[(0,t.jsxs)(p.f,{variant:"outline",className:y[i],children:["alive"===i?(0,t.jsx)(r.f,{"aria-hidden":!0}):(0,t.jsx)(n.f,{"aria-hidden":!0}),w[i]]}),null===a?(0,t.jsx)("span",{className:"text-muted-foreground",children:"· run its setup line on the machine"}):(0,t.jsxs)("time",{dateTime:e.lastSeenAt??void 0,title:(0,x.o)(a),className:"text-muted-foreground tabular-nums",children:["· ","silent"===i?`since ${(0,x.w)(a)}`:(0,x.V)(a,s).replace("Last seen","seen")]})]})}function N(e,t){let s=(0,x.W)(e,t);return"Just now"===s?"just now":s}function k({title:e,children:s,className:n}){return(0,t.jsxs)("div",{className:`flex min-w-0 flex-col gap-2 px-4.5 py-4 ${n??""}`,children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:e}),s]})}function I({harness:e,now:n,login:i}){let a=(0,h.Y)(e,n);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border py-2.5 first-of-type:border-t-0 first-of-type:pt-0",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-body font-medium [&_svg]:size-(--size-icon-sm) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(s.f,{"aria-hidden":!0}),(0,h.f)(e.harness),void 0===a?null:(0,t.jsx)("span",{className:"font-normal text-meta text-muted-foreground",children:a})]}),(0,m.j)(e.options).map(e=>(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e.name}),e.values.map(s=>(0,t.jsxs)("span",{className:"font-mono text-id whitespace-nowrap",children:[s,s===e.defaultValue?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:" (default)"}):null]},s))]},e.name)),0===e.flags.length?null:(0,t.jsx)("span",{className:"flex flex-wrap items-center gap-1.5",children:e.flags.map(s=>e.riskyFlags?.includes(s)===!0?(0,t.jsxs)("code",{"data-testid":"machine-risky-flag",title:"Risky: every launch runs without its harness's safeguards",className:"inline-flex items-center gap-1 rounded-sm border border-tone-waiting-border bg-tone-waiting-bg px-1.5 font-mono text-id text-tone-waiting-fg [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(l.f,{"aria-hidden":!0}),s,(0,t.jsx)("span",{className:"sr-only",children:" (risky)"})]},s):(0,t.jsx)("code",{className:"rounded-sm bg-muted px-1.5 font-mono text-id",children:s},s))}),void 0===i?null:(0,t.jsx)(g.f,{login:i})]})}function z({title:e,icon:s,names:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e}),0===n.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):n.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[s,e]},e))]})}function S({workspaces:e}){return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(z,{title:"Repositories · a new worktree per ship",icon:(0,t.jsx)(a.f,{"aria-hidden":!0}),names:e.repositories}),(0,t.jsx)(z,{title:"Folders · used as they are",icon:(0,t.jsx)(i.f,{"aria-hidden":!0}),names:e.folders})]})}e.s(["P",0,I,"$",0,function({machine:e,spots:s,location:n,ships:i,onNewSetupLine:a,now:l}){let{details:h,report:m}=e,p=null===m?null:new Date(m.reportedAt);return(0,t.jsxs)("section",{"aria-label":e.name,"data-testid":"machine-card",className:"grid grid-cols-[minmax(0,18.75rem)_minmax(0,1.25fr)_minmax(0,1fr)] divide-x divide-border rounded-lg border border-border bg-card max-lg:grid-cols-1 max-lg:divide-x-0 max-lg:divide-y",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2.5 px-4.5 py-4",children:[(0,t.jsxs)(d.default,{href:`/trierarchs/${e.shipId}`,"data-testid":"machine-card-name",className:"inline-flex items-center gap-2 text-section font-semibold hover:underline [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(r.f,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(d.default,{href:(0,o.f)({machine:e.shipId}),"data-testid":"machine-card-usage",className:"self-start text-meta font-medium text-primary underline underline-offset-3",children:"Usage"}),(0,t.jsx)(b,{machine:e,now:l}),void 0===a?null:(0,t.jsx)(u.f,{size:"sm",className:"self-start",onClick:a,"data-testid":"machine-card-new-setup-line",children:"New setup line"}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(v.f,{kind:n?.kind??null,description:n?.description}),null===h?null:(0,t.jsxs)("span",{className:"font-mono text-id",children:["· trierarch ",h.version]})]}),(0,t.jsx)("div",{role:"separator",className:"h-px bg-border"}),(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Capacity"}),(0,t.jsx)(f.f,{spots:s,caps:h?.caps,testId:"machine-card-capacity",unknownText:null===p?"Unknown until it answers":`Unknown since ${(0,x.w)(p)}`}),null===p?null:(0,t.jsxs)("time",{dateTime:m?.reportedAt,title:(0,x.o)(p),className:"text-meta text-muted-foreground",children:["Last answer ",N(p,l)]})]}),(0,t.jsxs)(k,{title:"Harnesses, options and flags",children:[h?.notOffered?.map(({harness:e,reason:s})=>(0,t.jsx)(j.f,{harness:e,reason:s},e)),null===h?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):h.harnesses.map(e=>(0,t.jsx)(I,{harness:e,now:l,...void 0===i?{}:{login:(0,c.C)(h,{harness:e.harness,ships:i})}},e.harness))]}),(0,t.jsx)(k,{title:"Workspaces",children:null===h?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):(0,t.jsx)(S,{workspaces:h.workspaces})})]})},"W",0,b,"I",0,S,"J",0,N])},835114,e=>{var t=e.i(843476),s=e.i(77071),n=e.i(586875),i=e.i(594831),a=e.i(522016),r=e.i(714695),l=e.i(418074),d=e.i(681924),o=e.i(44913),c=e.i(895e3),h=e.i(36556);e.s(["f",0,function({connection:e,machines:m,ships:x,error:u,onRetry:p,onJoin:f,onNewSetupLine:g,now:j}){return"none"===e?(0,t.jsx)(o.f,{icon:(0,t.jsx)(n.f,{"aria-hidden":!0}),title:"The trierarch plugin is not set up for this fleet",description:"Crew requests work without it: they wait on Needs crew and you crew each ship by hand with its starting prompt. With the plugin, trierarchs on your machines start, restart and stop those sessions for you.",action:(0,t.jsx)(d.f,{nativeButton:!1,render:({children:e,...s})=>(0,t.jsx)("a",{href:"https://github.com/ThomasHendrickx/aeolus-fleet-trierarch-plugin/tree/main/packages/trierarch-plugin#readme",target:"_blank",rel:"noreferrer",...s,children:e}),"data-testid":"trierarchs-setup",children:"How to set up the trierarch plugin"})}):"not-connected"===e?(0,t.jsx)(o.f,{icon:(0,t.jsx)(i.f,{"aria-hidden":!0}),title:"The trierarch plugin is not connected",description:"Connect it in Settings; its machines show up here then.",action:(0,t.jsx)(d.f,{nativeButton:!1,render:(0,t.jsx)(a.default,{href:"/settings"}),"data-testid":"trierarchs-open-settings",children:"Open Settings"})}):void 0!==u?(0,t.jsx)(c.f,{variant:"page",title:"Couldn’t read the machines",description:"Nothing changed.",detail:u,onRetry:p}):void 0===m||"unknown"===e?(0,t.jsx)(l.f,{variant:"cards",rows:2,label:"Loading the machines"}):0===m.length?(0,t.jsx)(o.f,{icon:(0,t.jsx)(n.f,{"aria-hidden":!0}),title:"No machines yet",description:"Join a machine: its trierarch then starts sessions there for the crew requests the plugin gives it.",action:f?(0,t.jsx)(d.f,{variant:"primary",icon:(0,t.jsx)(s.f,{"aria-hidden":!0}),onClick:f,"data-testid":"trierarchs-join-empty",children:"Join a machine"}):void 0}):(0,t.jsx)("div",{className:"flex flex-col gap-4","data-testid":"machine-list",children:m.map(e=>(0,t.jsx)(h.$,{machine:e,spots:(0,r.o)(e,x),ships:x,location:x.find(t=>t.id===e.shipId)?.location??null,onNewSetupLine:void 0===g?void 0:()=>{g(e)},now:j},e.shipId))})}])},469477,e=>{function t(e,t){let s=(e.usage?.ships??[]).filter(e=>t.has(e.shipId)).flatMap(e=>e.models).reduce((e,t)=>"apiKey"===t.login&&null!==t.estimatedCostUsd?e+t.estimatedCostUsd:e,0);return s>0?Math.round(100*s)/100:void 0}function s(e,t){let s=e.harnesses.find(e=>e.harness===t)?.login;if(void 0!==s&&"ready"!==s.key)return{key:s.key,...void 0===s.keyStateAt?{}:{at:s.keyStateAt}}}function n(e){return"apiKey"===e.login||"apiKey"===e.next}let i=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2});e.s(["a",0,{outOfCredit:"Out of credit",refused:"Refused",none:"No key"},"u",0,{outOfCredit:"API key out of credit",refused:"API key refused",none:"No API key"},"w",0,{apiKey:"API key",subscription:"Subscription"},"$",0,"From its next start.","K",0,"At list prices. The bill is in the Anthropic or OpenAI console.","C",0,function(e,i){let a=e.harnesses.find(e=>e.harness===i.harness)?.login;if(void 0===a)return;let r=new Set(i.ships.filter(e=>e.harness===i.harness).map(e=>e.id)),l=(e.logins??[]).filter(e=>r.has(e.shipId)),d=t(e,r),o=s(e,i.harness),c=l.filter(n).length;return{default:a.default,otherCount:l.filter(e=>e.login!==a.default).length,...void 0===d?{}:{spentOnKeyUsd:d},...void 0===o||0===c?{}:{keyNotReady:o,waitingShips:c}}},"Z",0,function(e,t){let s=void 0===t?"":`Since ${t}. `;switch(e.key){case"outOfCredit":return`${s}Checked every 15 min.`;case"refused":return`${s}Ready again with a new key.`;case"none":return}},"g",0,function(e,n){let i=e.logins?.find(e=>e.shipId===n.shipId);if(void 0===i)return;let a=t(e,new Set([n.shipId])),r="apiKey"===(n.isRunning?i.login:i.next??i.login)&&void 0!==n.harness?s(e,n.harness):void 0;return{login:i.login,...void 0===i.next?{}:{next:i.next},...void 0===a?{}:{spentOnKeyUsd:a},...void 0===r?{}:{keyNotReady:r}}},"D",0,function(e){return i.format(e)}])},127361,e=>{let t={DEVICE:"Device",CLOUD:"Cloud",SERVER:"Server",OTHER:"Other"};e.s(["f",0,function(e){return t[e]}])},23824,e=>{e.s(["f",0,function(e){return"machine"in e?`/usage?machine=${e.machine}`:`/usage?ship=${e.ship}`}])}])})();
|
package/.next/standalone/packages/console/.next/static/chunks/{2df691xtshd2z.js → 0ma9ven9ywsvi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,867858,s=>{s.v(t=>Promise.all(["static/chunks/3ezwze7zptyhf.js"].map(t=>s.l(t))).then(()=>t(259068)))},733971,s=>{s.v(t=>Promise.all(["static/chunks/3vh5wyyw772os.js"].map(t=>s.l(t))).then(()=>t(642211)))},705419,s=>{s.v(t=>Promise.all(["static/chunks/1_zch-hrah0fz.js"].map(t=>s.l(t))).then(()=>t(404510)))},88138,s=>{s.v(t=>Promise.all(["static/chunks/1on_a1c_r_tod.js"].map(t=>s.l(t))).then(()=>t(648287)))},495953,s=>{s.v(t=>Promise.all(["static/chunks/43d1gsftz85rv.js"].map(t=>s.l(t))).then(()=>t(482532)))},726403,s=>{s.v(t=>Promise.all(["static/chunks/28zytnri9jozo.js"].map(t=>s.l(t))).then(()=>t(354988)))},157993,s=>{s.v(t=>Promise.all(["static/chunks/32m13letdpfpl.js"].map(t=>s.l(t))).then(()=>t(587265)))},741585,s=>{s.v(t=>Promise.all(["static/chunks/2cr_6go19o1vl.js"].map(t=>s.l(t))).then(()=>t(711896)))},665030,s=>{s.v(t=>Promise.all(["static/chunks/0-rvb8-63eff4.js"].map(t=>s.l(t))).then(()=>t(833474)))},823569,s=>{s.v(t=>Promise.all(["static/chunks/
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,867858,s=>{s.v(t=>Promise.all(["static/chunks/3ezwze7zptyhf.js"].map(t=>s.l(t))).then(()=>t(259068)))},733971,s=>{s.v(t=>Promise.all(["static/chunks/3vh5wyyw772os.js"].map(t=>s.l(t))).then(()=>t(642211)))},705419,s=>{s.v(t=>Promise.all(["static/chunks/1_zch-hrah0fz.js"].map(t=>s.l(t))).then(()=>t(404510)))},88138,s=>{s.v(t=>Promise.all(["static/chunks/1on_a1c_r_tod.js"].map(t=>s.l(t))).then(()=>t(648287)))},495953,s=>{s.v(t=>Promise.all(["static/chunks/43d1gsftz85rv.js"].map(t=>s.l(t))).then(()=>t(482532)))},726403,s=>{s.v(t=>Promise.all(["static/chunks/28zytnri9jozo.js"].map(t=>s.l(t))).then(()=>t(354988)))},157993,s=>{s.v(t=>Promise.all(["static/chunks/32m13letdpfpl.js"].map(t=>s.l(t))).then(()=>t(587265)))},741585,s=>{s.v(t=>Promise.all(["static/chunks/2cr_6go19o1vl.js"].map(t=>s.l(t))).then(()=>t(711896)))},665030,s=>{s.v(t=>Promise.all(["static/chunks/0-rvb8-63eff4.js"].map(t=>s.l(t))).then(()=>t(833474)))},823569,s=>{s.v(t=>Promise.all(["static/chunks/32xff3ugkcg9u.js","static/chunks/33twggm6xmra-.js","static/chunks/0ra2p7r6dcwbu.js"].map(t=>s.l(t))).then(()=>t(709967)))}]);
|
|
@@ -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),n=e.i(271645),i=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},s={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},a={disabled:!1,...s};e.s(["q",0,a,"S",0,s,"t",0,r,"s",0,{valid:e=>null===e?null:e?{"data-valid":""}:{"data-invalid":""}}],875812);let l={invalid:void 0,name:void 0,validityData:{state:r,errors:[],error:"",value:"",initialValue:null},setValidityData:i.x,disabled:void 0,setTouched:i.x,setDirty:i.x,setFilled:i.x,setFocused:i.x,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:a,registerFieldControl:i.x,validation:{getValidationProps:(e,t=i.w)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:i.x,getInputControl:()=>null,commit:async()=>{},change:i.x}},o=n.createContext(l);function d(e=!0){let r=n.useContext(o);if(r.setValidityData===i.x&&!e)throw Error((0,t.f)(28));return r}e.s(["T",0,l,"H",0,o,"U",0,d],469690);var u=e.i(146376),c=e.i(388940);e.s(["f",0,function(e,t,n,i,r=!0,s){let{registerFieldControl:a}=d(),l=(0,c.f)(()=>Symbol());(0,u.f)(()=>{let o=l.current;r?a(o,{controlRef:e,getValue:i,id:t,name:s,value:n}):a(o,void 0)},[e,r,i,t,s,a,l,n]),(0,u.f)(()=>{let e=l.current;return()=>{a(e,void 0)}},[a,l])}],381104)},884708,e=>{e.i(247167);var t=e.i(271645),n=e.i(956789);let i=t.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:n.x,validationMode:"onSubmit",submitCountRef:{current:0}});e.s(["f",0,function(){return t.useContext(i)}])},538489,247778,e=>{var t=e.i(271645),n=e.i(146376),i=e.i(667865),r=e.i(388940),s=e.i(956789),a=e.i(788015);let l=t.createContext({controlId:void 0,registerControlId:s.x,resetControlId:s.x,labelId:void 0,setLabelId:s.x,messageIds:[],setMessageIds:s.x,getDescriptionProps:e=>e});function o(){return t.useContext(l)}e.s(["f",0,o],247778),e.s(["f",0,function(e={}){let{id:l,enabled:d=!0}=e,{controlId:u,registerControlId:c,resetControlId:f}=o(),m=(0,a.f)(),h=(0,r.f)(()=>Symbol()),x=t.useRef(!1),p=t.useRef(!1),g=(0,i.f)(()=>{x.current&&c!==s.x&&(x.current=!1,c(h.current,void 0))});return(0,n.f)(()=>{let e;if(!d||c===s.x)return void g();if(void 0!==l)p.current=!0,e=l;else{if(!p.current)return void f();e=m}void 0===e?g():(x.current=!0,c(h.current,e))},[l,d,c,f,m,h,g]),(0,n.f)(()=>g,[g]),(d?u:void 0)??l??m}],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)}}])},713203,265858,484325,42191,450001,868931,e=>{var t=e.i(271645);e.s(["f",0,function(e){let n=t.useRef(!0);n.current&&(n.current=!1,e())}],713203);var n=e.i(229315),i=e.i(883977),r=e.i(146376),s=e.i(388940),a=e.i(990627),l=e.i(46420),o=e.i(156341);e.s(["f",0,function(e){let{open:t=!1,onOpenChange:d,elements:u={}}=e,c=(0,i.f)(),f=null!=(0,l.G)(),m=(0,s.f)(()=>new o.f({open:t,transitionStatus:void 0,onOpenChange:d,referenceElement:u.reference??null,floatingElement:u.floating??null,triggerElements:new a.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,n.m)(u.reference)?u.reference:null),void 0!==u.floating&&(e.floatingElement=u.floating),m.update(e)},[t,c,u.reference,u.floating,m]),m.context.onOpenChange=d,m.context.nested=f,m}],265858);let d=(e,t)=>Object.is(e,t);function u(e,t,n){return null==e||null==t?Object.is(e,t):n(e,t)}function c(e,t,n){return!!e&&e.some(e=>void 0!==e&&u(t,e,n))}function f(e,t,n){return e?e.findIndex(e=>void 0!==e&&u(e,t,n)):-1}function m(e,t,n,i){let r=i&&Array.isArray(t)?e.findIndex(function(e,t){if(t!==d)return n=>c(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(0!==t||e.some(e=>Object.is(t,e)))}(t,n)):f(e,t,n);return -1===r?null:r}e.s(["i",0,u,"t",0,d,"u",0,f,"m",0,m,"H",0,function(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!function(e,t,n=Object.is){let{length:i}=e;if(i!==t.length)return!1;for(let r=0;r<i;r+=1)if(!n(e[r],t[r]))return!1;return!0}(e,t,(e,t)=>u(e,t,n)):e!==t},"j",0,function(e,t,n){return e.filter(e=>!u(t,e,n))},"b",0,function(e,t,n,i,r,s){return c(i,t,r)?null!=s&&e>s&&c(i,n[s],r)?s:e:e===s?m(n,i,r,!0):s},"v",0,c],484325);var h=e.i(186698),x=e.i(843476);function p(e){var t;return"object"==typeof(t=e?.[0])&&null!=t&&Array.isArray(t.items)}function g(e){return p(e)?e.flatMap(e=>e.items):e}function v(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,h.f)(e)}function b(e,t,n){if(n&&null!=e)return n(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)??v(e,n);if(Array.isArray(t)){let i=g(t);if(null==e||"object"!=typeof e){let t=i.find(t=>t.value===e);return t&&null!=t.label?t.label:v(e,n)}if("value"in e){let t=i.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return v(e,n)}e.s(["j",0,g,"Y",0,function(e){if(!Array.isArray(e))return null!=e&&"null"in e;if(p(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,p,"u",0,function(e,n,i){return e.reduce((e,r,s)=>(s>0&&e.push(", "),e.push((0,x.jsx)(t.Fragment,{children:b(r,n,i)},s)),e),[])},"b",0,b,"B",0,v,"P",0,function(e,t){return t&&null!=e?t(e)??"":e&&"object"==typeof e&&"value"in e&&"label"in e?(0,h.f)(e.value):(0,h.f)(e)}],42191),e.s(["u",0,function(e){return null==e?void 0:`${e}-label`},"$",0,function(e,t){return e??t}],450001);var j=e.i(415618);e.s(["f",0,j],868931)},443988,e=>{var t=e.i(843476),n=e.i(225913),i=e.i(812437);let r=(0,n.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:n,isMono:s,rows:a=4,...l}){return(0,t.jsx)("textarea",{"data-slot":"textarea",rows:a,className:(0,i.f)(r({size:n,isMono:s}),e),...l})}])},404032,757364,667609,569917,389589,e=>{var t=e.i(843476),n=e.i(422768),i=e.i(474544),r=e.i(77071),s=e.i(263676),a=e.i(522016),l=e.i(271645),o=e.i(770703),d=e.i(878608),u=e.i(681924),c=e.i(406734),f=e.i(695960);let m=(0,o.default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});function h({groups:e,picked:n,isDisabled:i,onAdd:s}){let[o,d]=(0,l.useState)(!1);return(0,t.jsxs)(c.V,{open:o,onOpenChange:d,children:[(0,t.jsx)(c.J,{render:(0,t.jsx)(u.f,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(r.f,{}),disabled:i,"data-testid":"machine-labels-add"}),children:"Add label"}),(0,t.jsxs)(c.T,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"machine-labels-popover",children:[(0,t.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:"Machine label"}),(0,t.jsx)(m,{groups:e,pickedValueIds:n.map(e=>e.valueId),countWord:"machine",onPick:e=>{d(!1),s(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:["Exact matches, all must hold.",(0,t.jsx)(a.default,{href:"/labels",className:"font-medium text-foreground hover:underline",children:"Manage labels"})]})]})]})}e.s(["f",0,function({shipName:e,picked:r,groups:a,match:o,max:u,isDisabled:c,onAdd:m,onRemove:x,unknown:p=[],onRemoveUnknown:g}){let v=(0,d.o)(r.length);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"machine-labels",children:[(0,t.jsxs)("span",{className:"text-body font-medium",children:["Machine labels",(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"})]}),(0,t.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===r.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Any machine"}):null,r.map((e,n)=>(0,t.jsxs)(l.Fragment,{children:[0===n?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(f.f,{chip:e,testId:"machine-label",...c?{}:{onRemove:()=>{x(e.valueId)}}})]},e.valueId)),p.map(e=>(0,t.jsxs)("span",{"data-testid":"machine-label-unknown",title:`${e}: not 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 font-mono text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,t.jsx)(n.f,{"aria-hidden":!0}),e,void 0===g||c?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>{g(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)(s.X,{"aria-hidden":!0})})]},e)),r.length+p.length>=u?null:(0,t.jsx)(h,{groups:a,picked:r,isDisabled:c,onAdd:m})]}),0===p.length?null:(0,t.jsxs)("p",{role:"alert","data-testid":"machine-labels-unknown-note",className:"text-meta text-tone-attention-fg",children:["Not in this fleet: ",p.join(", "),". Forming refuses ",1===p.length?"it":"them",": define ",1===p.length?"it":"them"," on the Labels page, or remove ",1===p.length?"it":"them"," here."]}),0===r.length?null:0===o.matching.length?(0,t.jsxs)("p",{role:"status","data-testid":"machine-labels-match",className:"flex items-start gap-2 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-meta text-tone-waiting-fg [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,t.jsx)(i.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["No machine matches ",v.these,". You can still request: it waits on Needs crew until a machine ",v.carries,"."]})]}):(0,t.jsxs)("p",{className:"text-meta","data-testid":"machine-labels-match",children:["Matches ",o.matching.length," of ",o.total," ",1===o.total?"machine":"machines",": ",o.matching.join(", "),"."]}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["The plugin places ",e," only on a machine that carries every label here. Leave it empty for any machine."]})]})}],404032);var x=e.i(646013),p=e.i(912407);function g({server:e,onRemove:n}){return(0,t.jsxs)("span",{"data-testid":"mcp-server",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)("span",{className:"truncate",children:e}),void 0===n?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${e}`,onClick:n,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)(s.X,{"aria-hidden":!0})})]})}e.s(["f",0,function({shipName:e,picked:n,offered:i,isDisabled:s=!1,onAdd:a,onRemove:l}){let o=i.filter(e=>!n.includes(e)),d=i.length>0&&0===o.length,c=(0,t.jsx)(u.f,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(r.f,{}),disabled:s||d,focusableWhenDisabled:d&&!s,"data-testid":"mcp-servers-add",children:"Add server"});return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"mcp-servers",children:[(0,t.jsxs)("span",{className:"text-body font-medium",children:["MCP servers",(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"})]}),(0,t.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===n.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):null,n.map(e=>(0,t.jsx)(g,{server:e,onRemove:s?void 0:()=>{l(e)}},e)),d?(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:c}),(0,t.jsx)(p.TooltipContent,{children:"Every offered server is added."})]}):(0,t.jsxs)(x.DropdownMenu,{children:[(0,t.jsx)(x.DropdownMenuTrigger,{render:c}),(0,t.jsx)(x.DropdownMenuContent,{align:"start",children:0===o.length?(0,t.jsx)("p",{"data-testid":"mcp-servers-none-offered",className:"max-w-64 px-2 py-1.5 text-meta text-muted-foreground",children:"No machine offers an MCP server for this harness yet."}):o.map(e=>(0,t.jsx)(x.DropdownMenuItem,{className:"font-mono text-id",onClick:()=>{a(e)},children:e},e))})]})]}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[e,"’s session starts with these servers’ tools, read-only. The plugin places it only on a machine that offers every one."]})]})}],757364);var v=e.i(527256),b=e.i(808041),j=e.i(895e3),y=e.i(375773);function w({id:e,label:n,isOptional:i,hint:r,error:s,className:a,children:l}){return(0,t.jsxs)("div",{className:`flex min-w-0 flex-col gap-1.5 ${a??""}`,children:[(0,t.jsxs)(y.f,{htmlFor:e,children:[n,i?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"}):null]}),l,void 0===r?null:(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:r}),void 0===s?null:(0,t.jsx)(j.f,{variant:"field",title:s})]})}e.s(["f",0,w],667609);var N=e.i(946033);function C({id:e,items:n,value:i,onPick:r,isDisabled:s,testId:a}){return(0,t.jsxs)(N.d,{items:n,value:i,disabled:s,onValueChange:e=>{"string"==typeof e&&r(e)},children:[(0,t.jsx)(N.P,{id:e,className:"h-(--size-control) w-full","data-testid":a,children:(0,t.jsx)(N.U,{})}),(0,t.jsx)(N.r,{children:Object.entries(n).map(([e,n])=>(0,t.jsx)(N.T,{value:e,children:n},e))})]})}function M({shipName:e,subRepositories:n,addable:i,errors:a,isDisabled:o=!1,onAdd:d,onBranchChange:c,onRemove:f}){let m=(0,l.useId)(),h=0===i.length,g=(0,t.jsx)(u.f,{type:"button",variant:"ghost",size:"xs",icon:(0,t.jsx)(r.f,{}),disabled:o||h,focusableWhenDisabled:h&&!o,"data-testid":"crew-settings-sub-repositories-add",children:"Add sub-repository"});return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"crew-settings-sub-repositories",children:[(0,t.jsxs)("span",{className:"text-body font-medium",children:["Sub-repositories",(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"})]}),0===n.length?null:(0,t.jsx)("ul",{className:"divide-y divide-border rounded-lg border border-border bg-card",children:n.map(({repository:e,ref:n},i)=>{let r=a[i],l=void 0===r?void 0:`${m}-${String(i)}`;return(0,t.jsxs)("li",{className:"flex flex-col gap-1.5 px-2.5 py-2","data-testid":"crew-settings-sub-repository-row",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-id","data-testid":"crew-settings-sub-repository",children:e}),(0,t.jsx)(v.e,{isMono:!0,"aria-label":`Branch of ${e}`,"aria-invalid":void 0!==r||void 0,"aria-describedby":l,placeholder:"Default branch",className:"h-(--size-control-sm) w-32 shrink-0 px-2 text-id sm:w-36",value:n,disabled:o,onChange:e=>{c(i,e.target.value)}}),o?(0,t.jsx)("span",{"aria-hidden":!0,className:"size-7 shrink-0"}):(0,t.jsx)(u.f,{type:"button",variant:"ghost",size:"sm",isIconOnly:!0,"aria-label":`Remove ${e}`,"aria-describedby":l,icon:(0,t.jsx)(s.X,{}),onClick:()=>{f(i)}})]}),void 0===r?null:(0,t.jsx)(j.f,{variant:"field",id:l,title:r})]},`${e}-${String(i)}`)})}),(0,t.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===n.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):null,h?(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:g}),(0,t.jsx)(p.TooltipContent,{children:"Every offered repository is added."})]}):(0,t.jsxs)(x.DropdownMenu,{children:[(0,t.jsx)(x.DropdownMenuTrigger,{render:g}),(0,t.jsx)(x.DropdownMenuContent,{align:"start",children:i.map(e=>(0,t.jsx)(x.DropdownMenuItem,{className:"font-mono text-id",onClick:()=>{d(e)},children:e},e))})]})]}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["Each is a new git worktree beside the main repository, for ",e," to work in. The plugin places ",e," only on a machine that offers every repository."]})]})}e.s(["f",0,C],569917),e.s(["f",0,function({shipName:e,offered:n,workspace:i,onChange:r,refusal:s,isDisabled:a=!1}){let o={workspace:(0,l.useId)(),branch:(0,l.useId)()},d=(0,b.j)(i,n),u=void 0===s?void 0:(0,b.S)(s,i),c=d.subRepositories.map((e,t)=>e??(t===u?s:void 0)),f=d.main??(void 0===u?s:void 0),m=e=>{i?.kind==="repositories"&&r({...i,subRepositories:e})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-x-3 gap-y-4 sm:grid-cols-[minmax(0,1fr)_11rem]",children:[(0,t.jsx)(w,{id:o.workspace,label:"Workspace",hint:i?.kind==="folder"?"A folder is used as it is, shared by the ships in it, with no sub-repositories.":void 0,error:f,className:i?.kind==="repositories"?void 0:"sm:col-span-2",children:(0,t.jsx)(C,{id:o.workspace,items:(0,b.Y)(n,i),value:(0,b.X)(i),isDisabled:a,testId:"crew-settings-workspace",onPick:e=>{r((0,b.a)(e,i))}})}),i?.kind==="repositories"?(0,t.jsx)(w,{id:o.branch,label:"Branch",isOptional:!0,children:(0,t.jsx)(v.e,{id:o.branch,isMono:!0,placeholder:"Default branch",disabled:a,"data-testid":"crew-settings-branch",value:i.main.ref,onChange:e=>{r({...i,main:{...i.main,ref:e.target.value}})}})}):null]}),i?.kind==="repositories"?(0,t.jsx)(M,{shipName:e,subRepositories:i.subRepositories,addable:(0,b.r)(i,n),errors:c,isDisabled:a,onAdd:e=>{m([...i.subRepositories,{repository:e,ref:""}])},onBranchChange:(e,t)=>{m(i.subRepositories.map((n,i)=>i===e?{...n,ref:t}:n))},onRemove:e=>{m(i.subRepositories.filter((t,n)=>n!==e))}}):null]})}],389589)},527256,e=>{var t=e.i(843476),n=e.i(271645),i=e.i(951437),r=e.i(146376),s=e.i(108868),a=e.i(667865),l=e.i(439957),o=e.i(469690),d=e.i(381104),u=e.i(884708),c=e.i(247778),f=e.i(538489),m=e.i(875812),h=e.i(552245),x=e.i(606039),p=e.i(675606),g=e.i(380025),v=e.i(584446);let b=n.forwardRef(function(e,t){let{render:b,className:j,id:y,name:w,value:N,disabled:C=!1,onValueChange:M,defaultValue:k,autoFocus:R=!1,style:T,...z}=e,{state:I,name:A,disabled:D,setTouched:S,setDirty:O,validityData:E,setFocused:V,setFilled:P,validationMode:$,validation:F}=(0,o.U)(),{clearErrors:B,elementRef:_,submitCountRef:U}=(0,u.f)(),L=D||C,W=A??w,X={...I,disabled:L},{labelId:q}=(0,c.f)(),K=(0,f.f)({id:y}),[Y]=(0,i.f)({controlled:N,default:k,name:"FieldControl",state:"value"}),G=void 0!==N,H=G?Y:void 0,J=null==H?void 0:String(H),Q=(0,a.f)(()=>F.inputRef.current?.value);(0,d.f)(F.inputRef,K,J,Q,!L,w),(0,r.f)(()=>{let e=J??F.inputRef.current?.value;void 0!==e&&P(""!==e)},[J,F.inputRef,P]),(0,x.f)(J,()=>{void 0!==J&&(B(W),O(J!==(E.initialValue??"")),F.change(J))});let Z=n.useRef(null),ee=(0,l.e)();return(0,r.f)(()=>{R&&Z.current===(0,v.T)((0,s.f)(Z.current))&&V(!0)},[R,V]),(0,h.f)("input",e,{ref:[t,Z],state:X,props:[{id:K,disabled:L,name:W,ref:F.inputRef,"aria-labelledby":q,autoFocus:R,...G?{value:H}:{defaultValue:k},onChange(e){let t=e.currentTarget.value,n=(0,p.j)(g.f.none,e.nativeEvent);M?.(t,n),!G&&(O(t!==(E.initialValue??"")),P(""!==t),e.nativeEvent.defaultPrevented||n.isCanceled||(B(W),F.change(t)))},onFocus(){V(!0)},onBlur(e){if(S(!0),V(!1),"onBlur"===$){let t=e.currentTarget.value;F.commit(t),G&&queueMicrotask(()=>{let e=F.inputRef.current?.value;void 0!==e&&e!==t&&e!==(E.initialValue??"")&&F.commit(e)})}},onKeyDown(e){if("INPUT"===e.currentTarget.tagName&&"Enter"===e.key){S(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===_.current&&!e.defaultPrevented){let t=e.currentTarget,n=U.current;ee.start(0,()=>{U.current===n&&F.commit(t.value)})}else F.commit(t)}}},z,e=>F.getValidationProps(L,e)],stateAttributesMapping:m.s})});e.s(["Control",0,b],305359);var j=e.i(305359),j=j;let y=n.forwardRef(function(e,n){return(0,t.jsx)(j.Control,{ref:n,...e})});var w=e.i(225913),N=e.i(812437);let C=(0,w.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:n,isMono:i,leadingIcon:r,trailingIcon:s,...a}){let l=(0,t.jsx)(y,{"data-slot":"input",className:(0,N.f)(C({size:n,isMono:i}),r?"pl-9":void 0,s?"pr-9":void 0,e),...a});return r||s?(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,l,s?(0,t.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-3 flex items-center",children:s}):null]}):l},"B",0,C],527256)},375773,e=>{var t=e.i(843476),n=e.i(812437);e.s(["f",0,function({className:e,htmlFor:i,...r}){return(0,t.jsx)("label",{"data-slot":"label",htmlFor:i,className:(0,n.f)("text-body font-medium text-foreground select-none",e),...r})}])}])})();
|
package/.next/standalone/packages/console/.next/static/chunks/{1bbccygf-72lp.js → 0ssgtx8uzn-_n.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,288882,t=>{t.v(c=>Promise.all(["static/chunks/
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,288882,t=>{t.v(c=>Promise.all(["static/chunks/2rcei_g_avapb.js","static/chunks/42xk_18prdr_k.js"].map(c=>t.l(c))).then(()=>c(628136)))}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,915860,e=>{"use strict";var t=e.i(843476),n=e.i(618566),s=e.i(271645),i=e.i(590222),a=e.i(748955),r=e.i(456420);let l={name:"arrow-down-left",size:24,node:[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]]};l.node;let d=(0,r.f)(l);var o=e.i(375775),c=e.i(96315),u=e.i(825398),m=e.i(418074),p=e.i(681924),h=e.i(812437),g=e.i(44913),x=e.i(895e3),f=e.i(33479),b=e.i(369693);function v(e,t){return RegExp(`"${t}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)"`).exec(e)?.[1]}let j={"application/vnd.aeolus.squadron.check-in+json":()=>"Checked in at its flagship","application/vnd.aeolus.squadron.role+json":e=>{let t=v(e,"role");return void 0===t?"Given its role":`Given the role: ${t}`},"application/vnd.aeolus.squadron.on-station+json":e=>{let t=v(e,"role");return void 0===t?"Took up its role":`Took up the role: ${t}`},"application/vnd.aeolus.squadron.stand-down+json":()=>"Asked to stand down","application/vnd.aeolus.squadron.stood-down+json":()=>"Stood down"};var y=e.i(379369),w=e.i(849635),z=e.i(890135);function k(e,t){return e.sentAt.localeCompare(t.sentAt)||e.id.localeCompare(t.id)}var N=e.i(639124),I=e.i(865713),S=e.i(415168);function C({message:e,shipId:n,now:s,onOpenMessage:i}){let a=e.sender.id===n,r=a?o.f:d,l=new Date(e.sentAt),c=function(e){var t,n;let s;if(!0===e.isPayloadUnreadable)return{text:"Sealed, key not reachable",isCode:!1};let i=j[t=e.contentType,t.split(";")[0]?.trim().toLowerCase()??""];return void 0!==i?{text:i(e.preview),isCode:!1}:(0,b.N)(e.contentType)?{text:0===(s=function(e){let t,n=[],s=0,i=0;for(;i<e.length;){let a=e[i]??"";if('"'===a){let{value:a,end:r}=function(e,t){let n=t+1;for(;n<e.length&&'"'!==e[n];)n+="\\"===e[n]?2:1;return{value:e.slice(t+1,n),end:n+1}}(e,i);1===s&&void 0===t&&e.slice(r).trimStart().startsWith(":")?t=a:1===s&&void 0!==t&&r<=e.length&&'"'===e[r-1]&&(n.push([t,a]),t=void 0),i=r;continue}if("{"===a||"["===a)1===s&&void 0!==t&&(n.push([t,"…"]),t=void 0),s+=1;else if("}"===a||"]"===a)s-=1;else if(1===s&&void 0!==t&&/[-\dtfn]/.test(a)){let s=/^(-?\d[\d.eE+-]*|true|false|null)/.exec(e.slice(i))?.[1];if(void 0!==s){n.push([t,s]),t=void 0,i+=s.length;continue}}i+=1}return n}(n=e.preview)).length?n:s.map(([e,t])=>`${e} ${t}`).join(" · "),isCode:!0}:{text:e.preview,isCode:!1}}(e);return(0,t.jsx)("li",{className:"border-b border-border last:border-b-0",children:(0,t.jsxs)("button",{type:"button","data-testid":"message-row","data-message-id":e.id,"aria-label":`${a?"Sent":"Received"} message: ${c.text}`,className:"flex w-full items-start gap-3 px-3.5 py-3 text-left transition-colors duration-(--duration-fast) hover:bg-accent",onClick:()=>{i(e.id)},children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-md border border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg [&_svg]:size-(--size-icon-sm)",children:(0,t.jsx)(r,{})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)(N.f,{parts:a?"ship"===e.recipient.kind?[(0,z.n)("To "),(0,z.X)(e.recipient.ship)]:[(0,z.n)(`To ${(0,S.R)(e.recipient)}`)]:[(0,z.n)("From "),(0,z.X)(e.sender)],className:"text-body text-foreground max-sm:text-body-touch"}),(0,t.jsx)(f.T,{status:(0,y.C)(e.delivery)})]}),(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.isPayloadSealed?(0,t.jsx)(I.f,{variant:"icon",testId:"message-sealed"}):null,(0,t.jsx)("span",{"data-testid":"message-line",className:(0,h.f)("truncate text-muted-foreground",c.isCode?"font-mono text-id":"text-meta"),children:c.text})]}),(0,t.jsx)("time",{dateTime:e.sentAt,title:(0,w.o)(l),className:"text-meta text-muted-foreground tabular-nums",children:(0,w.W)(l,s)})]})]})})}function $({shipId:e,messages:n,state:s,onRetry:i,more:a,now:r,onOpenMessage:l}){return"loading"===s?(0,t.jsx)(m.f,{variant:"list",rows:3,label:"Loading the messages"}):"error"===s?(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)(x.f,{title:"Couldn’t load the messages",description:"The rest of the page is current. Try again in a moment."}),i?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),onClick:i,className:"self-start",children:"Try again"}):null]}):0!==n.length||a?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(function(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map;for(let s of e){let e=function(e,t){let n=new Set([e.id]),s=e,i=null===s.inReplyTo?void 0:t.get(s.inReplyTo);for(;i&&!n.has(i.id);)n.add(i.id),i=null===(s=i).inReplyTo?void 0:t.get(s.inReplyTo);return s}(s,t);n.set(e.id,[...n.get(e.id)??[],s])}return[...n.entries()].map(([e,t])=>{let n=t.toSorted(k);return{id:e,messages:n,lastSentAt:n.at(-1)?.sentAt??""}}).toSorted((e,t)=>t.lastSentAt.localeCompare(e.lastSentAt)||t.id.localeCompare(e.id))})(n).map(n=>(0,t.jsx)("section",{"data-testid":"message-thread","aria-label":`Thread of ${String(n.messages.length)} ${1===n.messages.length?"message":"messages"}`,className:"overflow-hidden rounded-lg border border-border bg-card",children:(0,t.jsx)("ol",{children:n.messages.map(n=>(0,t.jsx)(C,{message:n,shipId:e,now:r,onOpenMessage:l},n.id))})},n.id)),a]}):(0,t.jsx)(g.f,{variant:"section",icon:(0,t.jsx)(c.f,{}),title:"No messages yet",description:"Messages this ship sends or receives appear here as they happen."})}var A=e.i(469477),T=e.i(23824),R=e.i(917540),O=e.i(490262),q=e.i(54492),D=e.i(808041),M=e.i(905387),P=e.i(280581),F=e.i(510921),L=e.i(878608),B=e.i(684156),U=e.i(500265),E=e.i(904084),V=e.i(316984),H=e.i(474544),W=e.i(758925),_=e.i(218964),K=e.i(611568),G=e.i(668997),X=e.i(457665),Q=e.i(395925),J=e.i(586875),Z=e.i(522016),Y=e.i(34512),ee=e.i(866616),et=e.i(912407),en=e.i(695960);let es={request:"Couldn’t request crew",remove:"Couldn’t remove the request",restart:"Couldn’t restart the crew"};function ei({at:e,now:n,children:s}){return(0,t.jsx)("time",{dateTime:e,title:(0,w.o)(new Date(e)),className:"tabular-nums",children:s??(0,w.l)(new Date(e),n)})}function ea({trierarch:e,hasTrierarchs:n}){return(0,t.jsxs)(Z.default,{href:n?`/trierarchs/${e.id}`:`/ships/${e.id}`,"data-testid":"crew-request-trierarch",className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground underline decoration-input underline-offset-3 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[(0,t.jsx)(J.f,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function er({requestedBy:e,requestedAt:n,now:s}){let i=null===e?null:e.name===z.D?"you":e.name;return(0,t.jsxs)("span",{"data-testid":"crew-request-requested-by",children:[null===i?"Requested ":`Requested by ${i} `,(0,t.jsx)(ei,{at:n,now:s,children:(0,w.W)(new Date(n),s)}),"."]})}let el={note:"border-border bg-muted text-muted-foreground",waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg"};function ed({tone:e,icon:n,children:s}){return(0,t.jsxs)("div",{role:"attention"===e?"alert":"waiting"===e?"status":"note","data-testid":"crew-request-note",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-meta [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 ${el[e]}`,children:[n,(0,t.jsx)("span",{children:s})]})}function eo({stage:e,now:n}){let s="running"===e.status?e.startedAt:null,i=(0,q.z)(e);return null===s&&void 0===i?null:(0,t.jsxs)("span",{className:"text-meta text-muted-foreground","data-testid":"crew-request-session",children:[null===s?null:(0,t.jsxs)(t.Fragment,{children:["since ",(0,t.jsx)(ei,{at:s,now:n})]}),null!==s&&void 0!==i?" · ":null,i]})}let ec={"Main repository":"crew-request-main-repository","Sub-repositories":"crew-request-sub-repositories"};function eu({label:e,repositories:n}){return(0,t.jsxs)("div",{className:"col-span-full flex min-w-0 flex-col gap-0.5","data-testid":ec[e],children:[(0,t.jsx)("dt",{className:"text-caption font-medium text-muted-foreground",children:e}),(0,t.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[0===n.length?(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:"None"}):null,n.map(({repository:e,ref:n})=>(0,t.jsxs)("span",{"data-testid":"crew-request-repository",className:"inline-flex h-5.5 max-w-full min-w-0 items-center rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e}),void 0===n?null:(0,t.jsx)("span",{className:"truncate text-muted-foreground",children:` \xb7 ${n}`})]},e))]})]})}function em({rows:e,machineLabels:n=[]}){return(0,t.jsxs)("dl",{"data-testid":"crew-request-settings",className:"grid grid-cols-[repeat(auto-fill,minmax(8.5rem,1fr))] gap-x-5 gap-y-3 border-t border-border pt-3",children:[e.map(e=>void 0===e.repositories?(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("dt",{className:"text-caption font-medium text-muted-foreground",children:e.label}),(0,t.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-body font-medium",children:[null===e.value?(0,t.jsx)("span",{className:"font-normal text-muted-foreground",children:"None"}):(0,t.jsx)("span",{className:e.isMono?"truncate font-mono text-id":"truncate",children:"Harness"===e.label?(0,ee.f)(e.value):e.value}),void 0===e.meta?null:(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground",children:e.meta})]})]},e.label):(0,t.jsx)(eu,{label:e.label,repositories:e.repositories},e.label)),0===n.length?null:(0,t.jsxs)("div",{className:"col-span-full flex min-w-0 flex-col gap-0.5","data-testid":"crew-request-machine-labels",children:[(0,t.jsx)("dt",{className:"text-caption font-medium text-muted-foreground",children:"Machine labels"}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:n.map((e,n)=>(0,t.jsxs)(s.Fragment,{children:[0===n?null:(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,t.jsx)(en.f,{chip:e})]},e.valueId))})]})]})}function ep({login:e}){return(0,t.jsxs)("span",{className:"text-meta","data-testid":"crew-request-login",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"· "}),A.w[e.login],void 0===e.next?null:(0,t.jsxs)(t.Fragment,{children:[","," ",(0,t.jsxs)(et.Tooltip,{children:[(0,t.jsxs)(et.TooltipTrigger,{render:(0,t.jsx)("span",{"data-testid":"crew-request-login-next"}),children:["next: ",A.w[e.next]]}),(0,t.jsx)(et.TooltipContent,{children:A.$})]})]})]})}function eh({keyNotReady:e}){return(0,t.jsxs)(ed,{tone:"attention",icon:(0,t.jsx)(W.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:A.u[e.key]}),void 0===e.at?null:(0,t.jsxs)(t.Fragment,{children:[" ","since"," ",(0,t.jsx)("time",{dateTime:e.at,title:(0,w.o)(new Date(e.at)),className:"tabular-nums",children:(0,w.w)(new Date(e.at))})]}),". Deliveries wait."]})}function eg({amount:e}){return(0,t.jsxs)(et.Tooltip,{children:[(0,t.jsxs)(et.TooltipTrigger,{render:(0,t.jsx)("span",{"data-testid":"crew-request-spent-on-key",className:"self-start text-meta text-muted-foreground"}),children:["Spent on key ",(0,t.jsx)("span",{className:"font-medium text-foreground tabular-nums",children:(0,A.D)(e)})]}),(0,t.jsx)(et.TooltipContent,{children:A.K})]})}function ex(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,t.jsx)(_.f,{"aria-hidden":!0,className:"size-(--size-icon) text-muted-foreground"}),(0,t.jsx)("h2",{className:"text-section font-semibold",children:"Crew request"})]})}function ef(e){let{noMachineMatchesReason:n}=(0,Y.x)(),{stage:s,requestedBy:i,now:a,canManage:r,isAwaitingCrew:l,busy:d,error:o}=e,c=void 0===o?null:(0,t.jsx)(x.f,{title:es[o.action],description:`${o.message} Nothing changed.`});if("none"===s.kind)return(0,t.jsxs)("section",{"aria-label":"Crew request","data-testid":"crew-request",className:"flex flex-col gap-2.5 rounded-lg border border-border bg-card px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3.5",children:[(0,t.jsx)(ex,{}),(0,t.jsx)("p",{className:"min-w-0 flex-1 text-meta text-muted-foreground",children:e.hasTrierarchs?"No crew request. A crew request keeps this ship crewed: a trierarch starts a session for it and restarts it when it stops.":"No crew request. A crew request puts this ship on your Needs crew list until you crew it by hand."}),r?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(_.f,{}),isLoading:"request"===d,onClick:e.onRequest,"data-testid":"crew-request-request",children:"Request crew"}):null]}),c]});let u=(0,q.D)(s),m=void 0!==d;return(0,t.jsxs)("section",{"aria-label":"Crew request","data-testid":"crew-request",className:"flex flex-col gap-2.5 rounded-lg border border-border bg-card px-3 py-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(ex,{}),(0,t.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-2","data-testid":"crew-request-state",children:["assigned"===s.kind?(0,t.jsx)(f.T,{status:s.status}):(0,t.jsx)(f.T,{status:s.kind}),"needsCrew"===s.kind?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.hasTrierarchs?"not assigned yet":s.reason??(0,t.jsxs)(t.Fragment,{children:["since ",(0,t.jsx)(ei,{at:s.requestedAt,now:a})]})}):null,"crewedByHand"===s.kind&&null!==s.since?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["since ",(0,t.jsx)(ei,{at:s.since,now:a})]}):null,"assigned"===s.kind?(0,t.jsx)(eo,{stage:s,now:a}):null,"assigned"===s.kind&&"releasing"===s.status&&void 0!==e.statusChangedAt?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["asked ",(0,t.jsx)(ei,{at:e.statusChangedAt,now:a})]}):null]}),"assigned"===s.kind?(0,t.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1 text-meta",children:["on ",(0,t.jsx)(ea,{trierarch:s.trierarch,hasTrierarchs:e.hasTrierarchs??!1}),void 0===e.login?null:(0,t.jsx)(ep,{login:e.login})]}):null,(0,t.jsx)("span",{className:"flex-1"}),void 0===e.usageHref?null:(0,t.jsx)(Z.default,{href:e.usageHref,"data-testid":"crew-request-usage",className:"text-meta font-medium text-primary underline underline-offset-3",children:"Usage"}),"assigned"===s.kind&&"releasing"===s.status?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["Waiting for ",s.trierarch.name]}):null,r?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:["remove"===u?(0,t.jsx)(p.f,{size:"sm",variant:"ghost",isLoading:"remove"===d,disabled:m,onClick:e.onRemove,"data-testid":"crew-request-remove",children:"Remove request"}):null,(0,q.Z)(s)?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(Q.f,{}),isLoading:"restart"===d,disabled:m,onClick:e.onRestart,"data-testid":"crew-request-restart",children:"Restart"}):null,void 0!==e.onEdit&&void 0!==u?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(G.f,{}),disabled:m,onClick:e.onEdit,"data-testid":"crew-request-edit",children:"Edit…"}):null,"release"===u?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(X.f,{}),disabled:m,onClick:e.onRelease,"data-testid":"crew-request-release",children:"Release…"}):null,"needsCrew"===s.kind&&l&&!e.hasTrierarchs?(0,t.jsx)(p.f,{size:"sm",variant:"primary",icon:(0,t.jsx)(W.f,{}),disabled:m,onClick:e.onGetStartingPrompt,"data-testid":"crew-request-prompt",children:"Get starting prompt"}):null]}):null]}),"assigned"===s.kind&&e.login?.keyNotReady!==void 0?(0,t.jsx)(eh,{keyNotReady:e.login.keyNotReady}):null,"assigned"===s.kind?function(e,n){let{trierarch:s}=e,i=void 0===n.statusChangedAt?null:(0,t.jsx)(ei,{at:n.statusChangedAt,now:n.now});switch(e.status){case"crewing":return(0,t.jsxs)(ed,{tone:"note",icon:(0,t.jsx)(K.f,{"aria-hidden":!0}),children:[s.name," is starting the session."]});case"running":return null;case"restarting":return(0,t.jsxs)(ed,{tone:"waiting",icon:(0,t.jsx)(Q.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:null===i?"The session stopped.":(0,t.jsxs)(t.Fragment,{children:["The session stopped at ",i,"."]})})," ",s.name," is starting it again. Once its restarts are used up it stops trying and the request shows Crashed."]});case"crashed":return(0,t.jsxs)(ed,{tone:"attention",icon:(0,t.jsx)(V.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:null===i?"Crashed.":(0,t.jsxs)(t.Fragment,{children:["Crashed at ",i,"."]})})," The session kept stopping and ",s.name," ","stopped trying. The lease still holds, so new deliveries wait in the inbox. Restart crews it again with the same settings."]});case"releasing":return(0,t.jsxs)(ed,{tone:"note",icon:(0,t.jsx)(X.f,{"aria-hidden":!0}),children:["Releasing: ",s.name," is stopping the session and cleaning up. The request goes away once it confirms."]})}}(s,{statusChangedAt:e.statusChangedAt,now:a}):null,"needsCrew"===s.kind&&e.hasTrierarchs?null===s.reason?(0,t.jsx)(ed,{tone:"note",icon:(0,t.jsx)(K.f,{"aria-hidden":!0}),children:"Waiting for the trierarch plugin to assign a trierarch."}):s.reason===n&&void 0!==e.machineLabels&&e.machineLabels.length>0?(0,t.jsxs)(ed,{tone:"waiting",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),children:[(0,t.jsx)("strong",{className:"font-medium",children:"No machine matches these labels."})," The plugin places this ship only on a machine with ",(0,L.U)(e.machineLabels),", and none"," ",(0,L.o)(e.machineLabels.length).carries,". It assigns a trierarch as soon as one does; until then this ship is on Needs crew."]}):(0,t.jsxs)(ed,{tone:"waiting",icon:(0,t.jsx)(H.f,{"aria-hidden":!0}),children:[(0,t.jsxs)("strong",{className:"font-medium",children:[(0,z.z)(s.reason),"."]})," The plugin assigns a trierarch as soon as one fits. Until then this ship is on Needs crew."]}):null,c,void 0===e.settingsRows?null:(0,t.jsx)(em,{rows:e.settingsRows,machineLabels:e.machineLabels}),"assigned"===s.kind&&e.login?.spentOnKeyUsd!==void 0?(0,t.jsx)(eg,{amount:e.login.spentOnKeyUsd}):null,(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:["needsCrew"!==s.kind||e.hasTrierarchs?null:"On your Needs crew list. Crew it by hand: get a starting prompt and start a session with it. Crewing it fulfils the request; the request stays until you remove it. ","crewedByHand"===s.kind?`${s.crewedBy.name===z.D?"You":s.crewedBy.name} crewed it by hand. The request stands: if the lease ends, the ship is back on Needs crew until you crew it again or release it. `:null,(0,t.jsx)(er,{requestedBy:i,requestedAt:s.requestedAt,now:a}),"assigned"===s.kind&&"releasing"!==s.status?" The trierarch keeps it crewed until you release it.":null]})]})}var eb=e.i(686165),ev=e.i(448695);let ej=(0,R.f)(()=>e.A(823569).then(e=>e.RequestCrewDialog),e=>e.isOpen),ey=(0,R.f)(()=>e.A(705419).then(e=>e.CrewReleaseDialog),e=>e.isOpen),ew=(0,R.f)(()=>e.A(495953).then(e=>e.StartingPromptDialog),e=>e.isOpen);function ez({ship:e,timeline:n,now:i}){let a=(0,O.Q)(),r=(0,U.i)(),l=(0,U.t)(),d=(0,M.a)(),o=(0,M.e)(),c=(0,M.t)(),u=(0,M.F)(),m=(0,M.s)(),[p,h]=(0,s.useState)(),[g,x]=(0,s.useState)(),[f,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(),[y,w]=(0,s.useState)(!1),[z,k]=(0,s.useState)(),[N]=(0,F.f)(null===e.crewRequest?[]:[e.crewRequest.settings])??[],I=function(e){let n=(0,U.t)(),i=(0,U.W)(),a=i.data??[],r=void 0===n.data||void 0===i.data&&!i.isError,l=(0,eb.U)(),d=(0,ev.p)(),o=(0,M.a)(),c=(0,M.e)(n.data?.map(e=>e.shipId)),[u,m]=(0,s.useState)(),[p,h]=(0,s.useState)(null),[g,x]=(0,s.useState)(),f=(0,D.i)(n.data??[],a),{shipLabelsMax:b}=(0,Y.x)(),v=void 0===c||void 0===n.data?void 0:(0,L.u)(c,{machines:n.data,shipLabelsMax:b}),j=(0,F.f)(e?.heldSettings===void 0?[]:[e.heldSettings]),y=j?.[0]??null,w=(0,D.B)("edit"===u?(0,D.T)(y,{offers:f,enabledModels:a}):(0,D.P)(f)),z=void 0!==u&&void 0!==e&&("edit"!==u||void 0!==j),k=(0,U.J)(z&&!r?null===p?w:p:void 0),N=async t=>{if(void 0!==e&&void 0!==u){o.reset();try{let e=await k.checkNow();if("refused"===e.kind)return void x(new Date)}catch{}o.mutate({shipId:e.shipId,settings:t},{onSuccess:()=>{m(void 0),(0,E.showToast)("edit"===u?{title:`Settings saved for ${e.shipName}`,description:"Its trierarch restarts the session with them.",tone:"success"}:{title:`Crew requested for ${e.shipName}`,description:"The trierarch plugin assigns a trierarch that fits.",tone:"success"})}})}};return{open:e=>{o.reset(),h(null),x(void 0),m(e)},dialog:void 0===e?null:(0,t.jsx)(ej,{shipName:e.shipName,mode:u??"request",state:n.isError?"unreachable":r?"loading":"ready",offers:f,enabledModels:a,heldSettings:y,squadrons:"connected"===l?(d.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===v?{}:{machineLabels:v},check:k.data,refusedAt:g,error:o.error?.message,isPending:o.isPending,isOpen:z,onOpenChange:e=>{e||m(void 0)},onSettingsChange:e=>{h(e),x(void 0)},onSubmit:e=>void N(e),onRetry:()=>{n.refetch(),i.refetch()}})}}("agent"===e.kind&&"retired"!==e.status?{shipId:e.id,shipName:e.name,heldSettings:e.crewRequest?.settings}:void 0);if("agent"!==e.kind||"retired"===e.status)return null;let S=(0,q.R)(e),C=e.crewRequest,$="assigned"===S.kind?l.data?.find(e=>e.shipId===S.trierarch.id)?.details:void 0,R="assigned"===S.kind&&null!=$?(0,A.g)($,{shipId:e.id,harness:N?.harness??e.harness??void 0,isRunning:"running"===S.status}):void 0,V=async(e,t)=>{h(e),x(void 0);try{return await t(),!0}catch(t){return x({action:e,message:t instanceof Error?t.message:String(t)}),!1}finally{h(void 0)}},H=()=>{m.reset(),k((0,B.f)(e)&&e.startingPrompt?{issuedAt:e.startingPrompt.issuedAt}:void 0),w(!0),m.mutate({shipId:e.id})},W=async()=>{await V("request",()=>d.mutateAsync({shipId:e.id,settings:{}}))&&(0,E.showToast)({title:`${e.name} needs crew`,description:"It is on your Needs crew list until you crew it.",tone:"success",..."awaitingCrew"===e.status&&a.canManage?{action:{label:"Get starting prompt",onClick:H}}:{}})},_=async()=>{null===C||"assigned"!==S.kind||await V("restart",()=>d.mutateAsync({shipId:e.id,settings:C.settings}))&&(0,E.showToast)({title:`Restarting ${e.name}`,description:`${S.trierarch.name} starts its session again with the same settings.`,tone:"success"})},K=async t=>{j(void 0);let n=(0,q.Q)(t),s=0;try{for(let t of n)await ("removeCrewRequest"===t?c.mutateAsync({shipId:e.id}):u.mutateAsync({shipId:e.id})),s+=1;b(!1)}catch(t){let e=t instanceof Error?t.message:String(t);j(0===s?`${e} Nothing changed.`:`${e} Its crew request is removed; the session still holds the ship. Try again to end its lease.`)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ef,{stage:S,requestedBy:(0,q.m)(n),statusChangedAt:(0,q.L)(n),now:i,canManage:a.canManage,isAwaitingCrew:"awaitingCrew"===e.status,hasTrierarchs:r,...r?{usageHref:(0,T.f)({ship:e.id})}:{},busy:p,error:g,settingsRows:null===C?void 0:(0,D.O)(N),...void 0===R?{}:{login:R},...null===C||void 0===o?{}:{machineLabels:(0,P.R)((0,L.K)(N),o)},onRequest:()=>{r?I.open("request"):W()},...r?{onEdit:()=>{I.open("edit")}}:{},onRemove:()=>void V("remove",()=>c.mutateAsync({shipId:e.id})),onRelease:()=>{j(void 0),b(!0)},onRestart:()=>void _(),onGetStartingPrompt:H}),I.dialog,"crewedByHand"===S.kind||"assigned"===S.kind?(0,t.jsx)(ey,{shipName:e.name,stage:S,sessionLocation:null===e.location?null:e.location.description??e.location.kind.toLowerCase(),inFlightCount:e.inFlightDeliveries,isOpen:f,onOpenChange:b,isPending:c.isPending||u.isPending,error:v,onConfirm:()=>void K(S)}):null,(0,t.jsx)(ew,{shipName:e.name,state:m.data?"shown":m.isError?"error":"issuing",prompt:m.data?.prompt,crewLines:m.data?.crewLines,replacesUnclaimed:z,error:m.error?.message,isOpen:y,onOpenChange:e=>{e||(m.reset(),w(!1))},onConfirm:()=>{m.mutate({shipId:e.id})}})]})}var ek=e.i(784294),eN=e.i(219249);function eI({label:e,children:n}){return(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 bg-card px-3.5 py-3",children:[(0,t.jsx)("dt",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-wrap items-center gap-1.5 text-body text-foreground",children:n})]})}function eS({shipId:e,now:n}){let s=(0,ev.p)(),i=(0,ev.b)(),a=s.data?.find(t=>t.flagship.shipId===e||t.members.some(t=>t.shipId===e));if(!a)return null;let r=(0,t.jsx)(Z.default,{href:`/squadrons/${a.id}`,className:"font-mono hover:underline","data-testid":"ship-squadron-link",children:a.id});if(a.flagship.shipId===e)return(0,t.jsxs)("div",{role:"note","data-testid":"ship-flagship-note",className:"flex flex-wrap items-center gap-3 rounded-lg border border-border bg-muted px-3.5 py-3 text-meta text-foreground",children:[(0,t.jsxs)("span",{className:"grow",children:["Flagship of squadron ",r,": the address for work sent to the team. The squadron manager crews it, so it can’t be released, renamed or retired; it retires when the squadron disbands."]}),(0,t.jsx)(p.f,{size:"xs",nativeButton:!1,render:(0,t.jsx)(Z.default,{href:`/squadrons/${a.id}`}),"data-testid":"ship-open-squadron",children:"Open squadron"})]});let l=a.members.find(t=>t.shipId===e);if(!l)return null;let d=i.data?.blueprints.find(e=>e.repository===a.blueprint.repository&&e.name===a.blueprint.name&&e.version===a.blueprint.version),o=d?.roles.find(e=>e.name===l.role)?.template,c=null===l.crew.lastSeenAt?void 0:(0,w.m)(new Date(l.crew.lastSeenAt),n);return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:["silent"===l.health&&"disbanded"!==a.state&&(0,t.jsxs)("div",{role:"alert","data-testid":"ship-silent-alert",className:"rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3.5 py-3 text-meta text-foreground",children:[(0,t.jsx)("strong",{className:"font-semibold text-tone-attention-fg",children:void 0===c?"Silent.":`Silent: not seen for ${c}.`})," It checks in"," ",(0,ek.P)(l.checkInMinutes),", so its session has probably stopped. Get a new crew line and start a new session; the old crew line then stops working."]}),(0,t.jsxs)("dl",{"data-testid":"ship-squadron-facts",className:"grid grid-cols-4 gap-px overflow-hidden rounded-lg border border-border bg-border max-sm:grid-cols-2",children:[(0,t.jsxs)(eI,{label:"Squadron",children:[r,(0,t.jsx)(f.T,{status:a.state})]}),(0,t.jsxs)(eI,{label:"Role and template",children:[(0,t.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 font-mono text-id",children:l.role}),o&&(0,t.jsxs)(Z.default,{href:(0,ek.p)(o),className:"font-mono text-meta hover:underline",children:[o.name,"@",o.version]})]}),(0,t.jsx)(eI,{label:"Health",children:(0,t.jsx)(eN._,{health:l.health,detail:"silent"===l.health||"late"===l.health?c:void 0})}),(0,t.jsx)(eI,{label:"Hand-offs",children:d?(0,t.jsx)("span",{className:"text-meta",children:(0,ek.e)((0,ek.S)(d,l.role))}):(0,t.jsx)(Z.default,{href:(0,ek.K)(a.blueprint),className:"text-meta text-muted-foreground hover:underline",children:"See its blueprint"})})]})]})}var eC=e.i(221959),e$=e.i(566297),eA=e.i(876561),eT=e.i(422768),eR=e.i(772382),eO=e.i(810818),eq=e.i(869309),eD=e.i(765649),eM=e.i(999808),eP=e.i(588671),eF=e.i(705918),eL=e.i(861966),eB=e.i(763481),eU=e.i(676641);function eE({harness:e,model:n,isHarnessUnknown:s=!1,testId:i}){if(null===e&&null===n&&!s)return null;let a=null!==e||s;return(0,t.jsxs)("span",{"data-testid":i,className:"flex min-w-0 flex-wrap items-center gap-x-1 text-meta text-muted-foreground",children:[null===e?null:(0,t.jsx)("span",{children:(0,ee.f)(e)}),null===e&&s?(0,t.jsx)(eU.f,{}):null,a&&null!==n?(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}):null,null===n?null:(0,t.jsx)("span",{className:"truncate font-mono text-id",children:n})]})}var eV=e.i(73330);function eH({ping:e,now:n,testId:s}){return null===e?null:(0,t.jsx)("span",{title:`Pinged ${(0,w.o)(new Date(e.sentAt))}`,"data-testid":s,"data-state":e.state,className:"text-meta text-muted-foreground tabular-nums",children:(0,eV.T)(e,n)})}var eW=e.i(867927),e_=e.i(793361),eK=e.i(591703);function eG({details:e,bytes:n,version:s,testId:i}){return(0,t.jsxs)("details",{"data-testid":i,className:"group rounded-lg border border-border bg-card",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 px-3.5 py-2.5 text-meta text-muted-foreground [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(eW.f,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0 transition-transform group-open:rotate-90"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Report details"}),(0,t.jsxs)("span",{className:"tabular-nums",children:["· version ",s]})]}),(0,t.jsx)("div",{className:"px-3.5 pb-3.5",children:(0,t.jsx)(eK.f,{label:(0,e_.t)(n),code:(0,e_.e)(e),copyLabel:"Copy report details",codeTestId:`${i}-code`})})]})}function eX({statement:e,testId:n}){return null===e?(0,t.jsx)("span",{"data-testid":n,className:"text-meta text-muted-foreground",children:"No statement"}):"commission"===e.by?(0,t.jsxs)("span",{"data-testid":n,className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-body text-foreground",children:e.note}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Commission note, until a crew states one"})]}):(0,t.jsxs)("span",{"data-testid":n,className:"flex min-w-0 flex-col gap-1.5",children:[(0,t.jsx)("span",{className:"text-body text-foreground",children:e.summary}),0===e.capabilities.length?null:(0,t.jsx)("ul",{"aria-label":"Offers",className:"flex min-w-0 flex-col gap-1",children:e.capabilities.map(e=>(0,t.jsxs)("li",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-meta",children:[(0,t.jsx)("span",{className:"font-mono text-id text-foreground",children:e.name}),void 0===e.title?null:(0,t.jsx)("span",{className:"text-foreground",children:e.title}),void 0===e.description?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:e.description})]},e.name))}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["Stated by its crew · version ",e.version]})]})}var eQ=e.i(781830),eJ=e.i(221980),eZ=e.i(466787);function eY({heading:e,lines:n,testId:s}){return(0,t.jsxs)("section",{"aria-label":e,"data-testid":s,className:"flex flex-col gap-1.5 rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3.5 py-2.5 text-tone-attention-fg",children:[(0,t.jsxs)("h2",{className:"flex items-center gap-1.5 text-meta font-semibold",children:[(0,t.jsx)(eZ.f,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),e]}),n.map(e=>(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-meta text-foreground",children:[void 0===e.ship?null:(0,t.jsx)("span",{className:"font-semibold",children:e.ship}),""===e.text?null:(0,t.jsx)("span",{children:e.text}),(0,t.jsx)("span",{className:"text-muted-foreground sm:ml-auto",children:e.caption})]},e.key))]})}let e0={"crew-request-unassigned":"Crew request unassigned","delivery-unacknowledged":"Delivery unacknowledged","delivery-overdue":"Delivery overdue","ping-unanswered":"Ping unanswered","report-unchanged":"Report unchanged","task-not-done":"Task not done"};function e1(e){let t=Object.entries(e0).find(([t])=>t===e)?.[1];return void 0===t?e:t.toLowerCase()}var e2=e.i(805236),e5=e.i(539448);function e6({alert:e,now:n}){let s,i,{headline:a,detail:r,caption:l}=(s=new Date(e.since),i=function(e){switch(e.signal){case"crew-request-unassigned":return e.facts.reason;case"delivery-unacknowledged":return e.facts.awaitingCrew?"awaiting crew":null;case"report-unchanged":return`expected within ${String(e.facts.minutes)} min`;case"delivery-overdue":case"ping-unanswered":case"task-not-done":return null}}(e),{headline:`${e0[e.signal]} ${(0,w.m)(s,n)}`,detail:null===i?null:`${i.charAt(0).toUpperCase()}${i.slice(1)}`,caption:[`since ${(0,w.l)(s,n)}`,...null===e.ownerShipId?[]:["owner told"],"clears by itself"].join(" · ")});return(0,t.jsx)(eY,{heading:a,lines:[{key:e.id,text:r??"",caption:l}],testId:"ship-open-alert"})}function e3({label:e,children:n}){return(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 bg-card px-3.5 py-3",children:[(0,t.jsx)("dt",{className:"text-meta text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"flex min-w-0 items-center gap-1.5 text-body text-foreground",children:n})]})}function e8({ship:e,now:n,viewerFleetId:s,labels:i,way:a}){let r,l="operator"===e.kind,d=function({reportChangesWithin:e,taskDoneBy:t},{reportTask:n,now:s,viewerFleetId:i}){let a=[];if(e&&a.push({key:"reportChangesWithin",text:`Report changes within ${String(e.minutes)} min`}),t){var r,l;let{label:e,title:d}=(0,e2.X)(t.task,i),o=null===n||!function e(t,n){if(Array.isArray(t)||Array.isArray(n))return Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((t,s)=>e(t,n[s]));if("object"==typeof t&&null!==t&&"object"==typeof n&&null!==n){let s=Object.entries(t),i=new Map(Object.entries(n));return s.length===i.size&&s.every(([t,n])=>i.has(t)&&e(n,i.get(t)))}return t===n}(n,t.task),c=`Task ${e} done by ${(r=new Date(t.doneBy),l=s,r.toDateString()===l.toDateString()?(0,w.w)(r):(0,w.B)(r))}`;a.push({key:"taskDoneBy",text:o?`${c} \xb7 lapsed`:c,title:d,isLapsed:o})}return a}(e.expectations,{reportTask:e.report?.task??null,now:n,viewerFleetId:s}),o=null===e.crewedSince?null:new Date(e.crewedSince),c=new Date(e.commissionedAt);return(0,t.jsxs)("dl",{className:"grid grid-cols-4 gap-px overflow-hidden rounded-lg border border-border bg-border max-sm:grid-cols-2",children:[(0,t.jsx)(e3,{label:"Location",children:(0,t.jsxs)("span",{className:"inline-flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)(eB.f,{kind:e.location?.kind??null,description:e.location?.description,size:"md"}),(0,t.jsx)(eE,{harness:e.harness,model:e.model?.id??null,isHarnessUnknown:"agent"===e.kind&&"crewed"===e.status&&null===e.harness,testId:"ship-model"}),null===e.lastSeenAt?null:(0,t.jsx)("time",{dateTime:e.lastSeenAt,title:(0,w.o)(new Date(e.lastSeenAt)),"data-testid":"ship-last-seen",className:"text-meta text-muted-foreground tabular-nums",children:(0,w.V)(new Date(e.lastSeenAt),n)}),(0,t.jsx)(eH,{ping:e.ping,now:n,testId:"ship-ping-status"}),"agent"!==e.kind&&"plugin"!==e.kind?null:(0,t.jsx)(eQ.f,{report:e.report,now:n,variant:"full",viewerFleetId:s,testId:"ship-report"}),(0,t.jsx)(eJ.f,{activity:e.activity,now:n,variant:"full",testId:"ship-activity"})]})}),(0,t.jsx)(e3,{label:"Crewed since",children:o?(0,t.jsx)("time",{dateTime:e.crewedSince??void 0,title:(0,w.o)(o),className:"tabular-nums",children:(r=n.getTime()-o.getTime()<864e5?(0,w.w)(o):(0,w.B)(o),`${r} \xb7 ${(0,w.m)(o,n)}`)}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not crewed"})}),(0,t.jsx)(e3,{label:"Commissioned",children:(0,t.jsx)("time",{dateTime:e.commissionedAt,title:(0,w.o)(c),children:l?`Fleet created ${(0,w.P)(c)}`:(0,w.P)(c)})}),(0,t.jsxs)(e3,{label:"Ship id",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.id}),(0,t.jsx)(eL.f,{value:e.id,label:"Copy ship id"})]}),void 0===a?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-start gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:gap-1.5","data-testid":"ship-delivery",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Delivery"}),(0,t.jsx)("dd",{className:"min-w-0 flex-1",children:a})]}),0===d.length?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-start gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:gap-1.5","data-testid":"ship-expectations",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Expectations"}),(0,t.jsx)("dd",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:d.map(e=>"reportChangesWithin"===e.key?(0,t.jsx)("span",{className:"text-body text-foreground",children:e.text},e.key):(0,t.jsx)("span",{title:e.title,className:"text-meta text-muted-foreground tabular-nums",children:e.text},e.key))})]}),l?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-start gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:gap-1.5",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Statement"}),(0,t.jsx)("dd",{className:"min-w-0 flex-1",children:(0,t.jsx)(eX,{statement:e.statement,testId:"ship-statement"})})]}),void 0===i?null:(0,t.jsxs)("div",{className:"col-span-4 flex min-w-0 items-center gap-4 bg-card px-3.5 py-2.5 max-sm:col-span-2 max-sm:flex-col max-sm:items-start max-sm:gap-1.5","data-testid":"ship-labels",children:[(0,t.jsx)("dt",{className:"shrink-0 text-meta text-muted-foreground",children:"Labels"}),(0,t.jsx)("dd",{className:"min-w-0 flex-1",children:i})]})]})}function e4({icon:e,children:n,testId:s}){return(0,t.jsxs)("p",{"data-testid":s,className:"flex items-center gap-2 rounded-lg border border-border bg-muted px-3.5 py-2.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[e,(0,t.jsx)("span",{children:n})]})}function e7({gateway:e}){return void 0===e.shipId?(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.name}):(0,t.jsx)(Z.default,{href:`/ships/${e.shipId}`,className:"font-medium text-foreground underline underline-offset-2",children:e.name})}function e9({reader:e}){return(0,t.jsxs)(e4,{icon:(0,t.jsx)(eR.f,{"aria-hidden":!0}),testId:"ship-gateway-mark",children:["The gateway reads this ship’s payloads:"," ","crew"===e.as?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e7,{gateway:e.gateway})," crews it."]}):(0,t.jsxs)(t.Fragment,{children:["it is ",(0,t.jsx)(e7,{gateway:e.gateway}),"’s proxy ship for an outside party."]})]})}function te({ship:e,shipId:n,state:s,actions:i,crewRequest:a,now:r,viewerFleetId:l,backHref:d="/",labels:o,isPluginShip:c=!1,way:u,gatewayReader:m}){if("loading"===s||"ready"===s&&void 0===e)return(0,t.jsxs)("div",{"aria-busy":!0,"data-testid":"ship-header",className:"flex flex-col gap-4",children:[(0,t.jsx)("span",{className:"sr-only",children:"Loading the ship"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eP.f,{className:"h-8 w-40"}),(0,t.jsx)(eP.f,{className:"h-6 w-20"}),(0,t.jsx)(eP.f,{className:"h-6 w-16"})]}),(0,t.jsx)(eP.f,{className:"h-16 w-full rounded-lg"})]});if("not-found"===s||void 0===e)return(0,t.jsx)("div",{"data-testid":"ship-header",children:(0,t.jsx)(g.f,{variant:"section",icon:(0,t.jsx)(eT.f,{}),title:"Ship not found",description:(0,t.jsxs)(t.Fragment,{children:["No ship with the id ",n?(0,t.jsx)("span",{className:"font-mono text-id",children:n}):"given"," exists in this fleet. The link may be incomplete. Retired ships keep their page."]}),action:(0,t.jsx)(p.f,{size:"sm",nativeButton:!1,render:({children:e,...n})=>(0,t.jsx)(Z.default,{href:d,...n,children:e}),children:"Back to fleet overview"})})});let x="operator"===e.kind,f="retired"===e.status;return(0,t.jsxs)("div",{"data-testid":"ship-header",className:"flex flex-col gap-4 max-sm:gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2.5 max-sm:flex-col max-sm:items-start max-sm:gap-1.5",children:[(0,t.jsx)("h1",{className:"min-w-0",children:(0,t.jsx)(e5.f,{name:e.name,shipId:e.id,size:"title",isSuffixShown:f})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(eM.W,{state:e.status}),e.openAlertCount>0?(0,t.jsx)(eM.W,{state:"alert",isBadge:!0}):null,x?(0,t.jsxs)(eF.f,{variant:"kind",children:[(0,t.jsx)(eD.f,{"aria-hidden":!0}),"operator"]}):(0,t.jsxs)(t.Fragment,{children:[c?(0,t.jsxs)(eF.f,{variant:"kind","data-testid":"ship-plugin",children:[(0,t.jsx)(eq.f,{"aria-hidden":!0}),"plugin"]}):null,(0,t.jsx)(eF.f,{variant:"type",children:e.type}),e.scopes.map(e=>(0,t.jsx)(eF.f,{variant:"kind","data-testid":"ship-fleet-scope",children:e},e))]}),"awaitingCrew"===e.status&&null===e.startingPrompt?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(W.f,{"aria-hidden":!0}),"No starting prompt issued"]}):null,"awaitingCrew"===e.status&&null!==e.startingPrompt?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(W.f,{"aria-hidden":!0}),(0,t.jsxs)("span",{children:["Prompt issued"," ",(0,t.jsx)("time",{dateTime:e.startingPrompt.issuedAt,title:(0,w.o)(new Date(e.startingPrompt.issuedAt)),children:(0,w.W)(new Date(e.startingPrompt.issuedAt),r)}),e.startingPrompt.isClaimed?", claimed":", not claimed yet"]})]}):null]})]}),i&&!f?(0,t.jsx)("div",{className:(0,h.f)("flex flex-wrap items-center gap-2","max-sm:w-full max-sm:[&>*]:flex-1"),children:i}):null]}),x?(0,t.jsx)(e4,{icon:(0,t.jsx)(eO.f,{"aria-hidden":!0}),children:"argo is your ship. This console session crews it. It can’t be released, renamed or retired."}):null,f&&null!==e.retiredAt?(0,t.jsxs)(e4,{icon:(0,t.jsx)(eA.f,{"aria-hidden":!0}),children:["Retired on ",(0,w.o)(new Date(e.retiredAt)),". Read-only."]}):null,void 0===m?null:(0,t.jsx)(e9,{reader:m}),a,e.openAlerts.map(e=>(0,t.jsx)(e6,{alert:e,now:r},e.id)),(0,t.jsx)(e8,{ship:e,now:r,viewerFleetId:l,labels:o,way:u}),("agent"===e.kind||"plugin"===e.kind)&&e.report?.details&&null!==e.report.detailsBytes?(0,t.jsx)(eG,{details:e.report.details,bytes:e.report.detailsBytes,version:e.report.detailsVersion,testId:"ship-report-details"}):null]})}var tt=e.i(749655),tn=e.i(446157);function ts({view:e,onOpenMessage:n}){let{lines:s,oldest:i}=e;return(0,t.jsxs)("ul",{"data-testid":"ship-way","aria-label":"Its side of the way",className:"flex flex-col gap-1",children:[s.map(e=>(0,t.jsx)(tn.Q,{line:e,testId:"ship-way-line"},e.text)),i?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"ship-way-oldest","aria-label":`Open the oldest message waiting: ${i.text}`,onClick:()=>{n(i.messageId)},className:"inline-flex flex-wrap items-center gap-1.5 rounded-xs text-left text-meta hover:underline focus-visible:outline-2 focus-visible:outline-ring max-sm:text-body-touch",children:[(0,t.jsx)(f.T,{status:i.status}),i.isOverdue?(0,t.jsx)(tt.f,{"aria-hidden":!0,className:"size-3.5 shrink-0 text-tone-attention-fg"}):null,(0,t.jsx)("span",{className:(0,h.f)(i.isOverdue?"text-tone-attention-fg":"text-muted-foreground"),children:i.text}),(0,t.jsx)(eW.f,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})]})}):null]})}let ti="gateway";var ta=e.i(699261),tr=e.i(689664),tl=e.i(716327),td=e.i(456539),to=e.i(77071),tc=e.i(263676),tu=e.i(770703),tm=e.i(406734);let tp=(0,tu.default)(()=>e.A(867858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[259068]},ssr:!1});function th({chip:e,labelKey:n,isBusy:i,onUnassign:a,onChange:r}){let[l,d]=(0,s.useState)(!1);return(0,t.jsxs)(tm.V,{open:l,onOpenChange:d,children:[(0,t.jsx)(tm.J,{render:(0,t.jsx)("button",{type:"button","aria-label":`Change or remove ${e.key}: ${e.value}`,"data-testid":"ship-label-yours",disabled:i,className:"inline-flex items-center rounded-sm focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60"}),children:(0,t.jsx)(en.f,{chip:e,trailing:(0,t.jsx)(tl.f,{"aria-hidden":!0}),className:"hover:bg-accent"})}),(0,t.jsxs)(tm.T,{align:"start",sideOffset:6,className:"w-72 p-1.5","data-testid":"ship-label-menu",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between px-2 pt-1 pb-1.5 text-meta",children:[(0,t.jsxs)("span",{className:"font-mono",children:[e.key,": ",(0,t.jsx)("span",{className:"text-muted-foreground",children:e.value})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Change the value"})]}),(0,t.jsx)("ul",{className:"flex flex-col",children:(n?.values??[]).map(s=>{let i=s.valueId===e.valueId,a=n?.carriedValueIds.includes(s.valueId)??!1;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",disabled:a,"data-testid":"ship-label-value",className:"flex h-(--size-control-sm) w-full items-center gap-2 rounded-sm px-2 text-left text-body hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none [&_svg]:size-(--size-icon-sm)",onClick:()=>{d(!1),r({from:e.valueId,to:s.valueId})},children:[(0,t.jsx)("span",{className:"w-4",children:a?(0,t.jsx)(tr.f,{"aria-hidden":!0}):null}),(0,t.jsx)("span",{className:(0,h.f)("min-w-0 grow truncate font-mono",a&&!i?"text-muted-foreground":void 0),children:s.value}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground tabular-nums",children:a&&!i?"Carried":`${String(s.shipCount)} ${1===s.shipCount?"ship":"ships"}`})]})},s.valueId)})}),(0,t.jsx)("div",{className:"mt-1 border-t border-border pt-1",children:(0,t.jsxs)("button",{type:"button","data-testid":"ship-label-remove",className:"flex h-(--size-control-sm) w-full items-center gap-2 rounded-sm px-2 text-body text-destructive-text hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",onClick:()=>{d(!1),a(e.valueId)},children:[(0,t.jsx)(tc.X,{"aria-hidden":!0}),"Remove label"]})})]})]})}function tg({keys:e,isBusy:n,onAssign:i}){let[a,r]=(0,s.useState)(!1);return(0,t.jsxs)(tm.V,{open:a,onOpenChange:r,children:[(0,t.jsx)(tm.J,{render:(0,t.jsx)(p.f,{variant:"ghost",size:"xs",icon:(0,t.jsx)(to.f,{}),disabled:n,"data-testid":"ship-labels-add"}),children:"Add label"}),(0,t.jsxs)(tm.T,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"ship-labels-add-popover",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between px-2 pt-1 pb-2 text-body font-medium",children:["Add a label",(0,t.jsx)("span",{className:"text-meta font-normal text-muted-foreground",children:"Yours"})]}),0===e.length?(0,t.jsx)("p",{className:"px-2 py-2 text-meta text-muted-foreground",children:"You have no labels yet. Define one on the Labels page, then put it on ships here."}):(0,t.jsx)(tp,{groups:[{title:"Yours",keys:[...e]}],pickedValueIds:e.flatMap(e=>e.carriedValueIds),pickedWord:"Carried",onPick:e=>{r(!1),i(e)}}),(0,t.jsx)("p",{className:"mt-2 flex items-center justify-between border-t border-border px-2 pt-2 text-meta",children:(0,t.jsx)(Z.default,{href:"/labels",className:"font-medium hover:underline",children:0===e.length?"Define a label":"Manage labels"})})]})]})}function tx({chips:e,keys:n,limit:i,isBusy:a,error:r,onAssign:l,onUnassign:d,onChange:o}){let[c,u]=(0,s.useState)(!1),m=!c&&e.length>3,p=m?e.slice(0,2):e,h=[...new Set(p.filter(e=>"none"!==e.mark).map(e=>e.ownerName))];return(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-2","data-testid":"ship-labels-edit",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[0===e.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"No labels"}):null,p.filter(e=>"none"===e.mark).map(e=>(0,t.jsx)(th,{chip:e,labelKey:n.find(t=>t.labelId===e.labelId),isBusy:a,onUnassign:d,onChange:o},e.valueId)),m?(0,t.jsxs)("button",{type:"button","aria-label":`Show all ${String(e.length)} labels`,"data-testid":"ship-labels-more",className:"inline-flex h-5.5 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium tabular-nums hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{u(!0)},children:["+",e.length-2]}):null,i.isAtLimit?null:(0,t.jsx)(tg,{keys:n,isBusy:a,onAssign:l}),h.map(e=>(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["by ",e]}),p.filter(t=>"none"!==t.mark&&t.ownerName===e).map(e=>(0,t.jsx)(en.f,{chip:e,testId:"ship-label"},e.valueId))]},e)),c&&e.length>3?(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm px-1 text-meta hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",onClick:()=>{u(!1)},children:[(0,t.jsx)(td.f,{"aria-hidden":!0}),"Show fewer"]}):null,i.isAtLimit?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"At the limit: a ship carries at most 20 labels (decision 0031)."}):null,void 0===i.count?null:(0,t.jsx)("span",{className:"ml-auto text-meta text-muted-foreground tabular-nums","data-testid":"ship-labels-count",children:i.count})]}),void 0===r?null:(0,t.jsx)(x.f,{title:r.title,description:`Refused: ${r.message}. Nothing changed.`})]})}function tf(e,t){for(let n of e){let e=n.values.find(e=>e.valueId===t);if(void 0!==e)return`${n.key}=${e.value}`}return"the label"}function tb({ship:e}){let{shipLabelsMax:n}=(0,Y.x)(),i=(0,M.e)(),a=(0,O.Q)(),r=(0,M.g)(),l=(0,M.j)(),[d,o]=(0,s.useState)(void 0);if(void 0===i)return(0,t.jsx)(eP.f,{className:"h-5.5 w-40"});let c=(0,P.h)(e,i);if(!(0,P.P)(e,a))return(0,t.jsx)(ta.f,{chips:c});let u=(0,P.i)(e,i),m=e=>t=>{o({title:e,message:t.message})};return(0,t.jsx)(tx,{chips:c,keys:u,limit:(0,P.N)(e,n),isBusy:r.isPending||l.isPending,error:d,onAssign:t=>{o(void 0),r.mutate({shipId:e.id,valueId:t},{onError:m(`Couldn’t add ${tf(u,t)}`)})},onUnassign:t=>{o(void 0),l.mutate({shipId:e.id,valueId:t},{onError:m(`Couldn’t remove ${tf(u,t)}`)})},onChange:({from:t,to:n})=>{o(void 0),l.mutate({shipId:e.id,valueId:t},{onSuccess:()=>{r.mutate({shipId:e.id,valueId:n},{onError:s=>{r.mutate({shipId:e.id,valueId:t}),m(`Couldn’t change ${tf(u,t)} to ${tf(u,n)}`)(s)}})},onError:m(`Couldn’t change ${tf(u,t)}`)})}})}var tv=e.i(987255),tj=e.i(831458);let ty={name:"lock-keyhole",size:24,node:[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]};ty.node;let tw=(0,r.f)(ty),tz={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};tz.node;let tk=(0,r.f)(tz);var tN=e.i(367784),tI=e.i(25799);let tS={name:"mail-minus",size:24,node:[["path",{d:"M22 15V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"fuxbkv"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M16 19h6",key:"xwg31i"}]]};tS.node;let tC=(0,r.f)(tS),t$={name:"mail-x",size:24,node:[["path",{d:"M22 12.532V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8.792",key:"8lpqwp"}],["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["path",{d:"m16.5 16.5 5 5",key:"zc9lw7"}],["path",{d:"m21.5 16.5-5 5",key:"1empo3"}]]};t$.node;let tA=(0,r.f)(t$),tT={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};tT.node;let tR=(0,r.f)(tT),tO={name:"package-x",size:24,node:[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16.5 14.5 5 5",key:"ozpm51"}],["path",{d:"m16.5 19.5 5-5",key:"syf6b9"}],["path",{d:"M21 10.5V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l.13-.074",key:"isw6gs"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]};tO.node;let tq=(0,r.f)(tO),tD={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};tD.node;let tM=(0,r.f)(tD),tP={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};tP.node;let tF=(0,r.f)(tP);var tL=e.i(837817),tB=e.i(127361);function tU(e,t){let n=e.details[t];return"string"==typeof n?n:void 0}function tE(e){return tU(e,"key")??""}function tV(e){return(tU(e,"values")??"").split(",").join(", ")}function tH(e){return e?[(0,z.n)(" by "),(0,z.X)(e)]:[]}let tW={deregistered:"Its session deregistered.",takenOver:"Taken over by a new console session.",signedOut:"The operator signed out.",passwordReset:"Its session ended with the operator password reset.",accountCutOff:"Its session ended: the account signed in as argo was cut off.",retired:"Its session ended: the ship was retired."};function t_(e){return e.message?.isPing===!0}function tK(e){return e.message?[(0,z.n)(t_(e)?"a ping from ":"a message from "),(0,z.X)(e.message.sender)]:[(0,z.n)("a message")]}function tG(e){let[t,...n]=tK(e);return t?.kind==="text"?[(0,z.n)((0,z.z)(t.text)),...n]:tK(e)}function tX(e,t){let{shipId:n,verb:s}=t,i=e.actor;return[...null===i||i.id===n?[(0,z.n)((0,z.z)(s))]:[(0,z.X)(i),(0,z.n)(` ${s}`)],(0,z.n)(" "),...tK(e)]}let tQ={received:d,sent:o.f,claimed:tk,released:tN.f,prompt:W.f,commissioned:tj.f,acknowledged:tI.f,returned:tL.f,undeliverable:tA,secret:tw,fleet:tv.f,password:tF,retired:eA.f,abandoned:tq,dismissed:tC,renamed:tM,reported:tR},tJ={waiting:"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg",active:"border-tone-active-border bg-tone-active-bg text-tone-active-fg",ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",attention:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg",ended:"border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg"},tZ="flex w-full gap-3 px-3.5 py-3 text-left";function tY({entry:e,shipId:n,now:s,onOpenMessage:i,accountNames:a={}}){let{parts:r,tone:l,icon:d}=function(e,t){switch(e.type){case"FleetInitialised":return{parts:[(0,z.n)("Fleet initialised")],tone:"ended",icon:"fleet"};case"ShipCommissioned":{let t=tU(e,"type");return{parts:[(0,z.n)("Commissioned"),...tH(e.actor),...void 0===t?[]:[(0,z.n)(` as ${t}`)]],tone:"ended",icon:"commissioned"}}case"OwnerSet":let n;return{parts:"inherited"===(n=tU(e,"how"))?[(0,z.n)("Owner set: its commissioner's owner")]:"named"===n?[(0,z.n)("Owner set: named"),...tH(e.actor)]:[(0,z.n)("Owner set: argo by default")],tone:"ended",icon:"commissioned"};case"OwnerChanged":return{parts:"ownerRetired"===tU(e,"why")?[(0,z.n)("Owner retired: argo owns it now")]:[(0,z.n)("Owner changed"),...tH(e.actor)],tone:"ended",icon:"renamed"};case"StartingPromptIssued":return{parts:[(0,z.n)("Starting prompt issued")],tone:"ended",icon:"prompt"};case"ShipClaimed":return{parts:[(0,z.n)(`Claimed by a session on ${function(e){let t=tU(e,"locationDescription");if(void 0!==t&&""!==t)return t;let n=tU(e,"location");return"DEVICE"===n||"CLOUD"===n||"SERVER"===n||"OTHER"===n?(0,tB.f)(n):"an unknown location"}(e)}`)],tone:"ok",icon:"claimed"};case"LeaseRevoked":let s,i;return{parts:[..."released"===(s=tU(e,"reason")??"")?[(0,z.n)("Released"),...tH(e.actor),(0,z.n)(".")]:[(0,z.n)(tW[s]??"Its session ended.")],..."number"==typeof(i=e.details.returnedDeliveries)&&i>0?[(0,z.n)(` ${(0,z.v)(i,{one:"in-flight delivery",many:"in-flight deliveries"})} went back to pending.`)]:[]],tone:"waiting",icon:"released"};case"CredentialRevoked":return{parts:[(0,z.n)("Secret invalidated")],tone:"ended",icon:"secret"};case"OperatorLoginSet":return{parts:[(0,z.n)("Email and password set")],tone:"waiting",icon:"password"};case"OperatorPasswordReset":return{parts:[(0,z.n)("Operator password reset")],tone:"waiting",icon:"password"};case"FleetLimitsChanged":return{parts:[(0,z.n)("Fleet limits changed")],tone:"ended",icon:"fleet"};case"HistoryPruned":return{parts:[(0,z.n)("Finished history past the retention pruned")],tone:"ended",icon:"fleet"};case"FleetSealingTurnedOn":return{parts:[(0,z.n)("Sealing turned on")],tone:"ended",icon:"fleet"};case"FleetPayloadsSealed":return{parts:[(0,z.n)("Every stored payload sealed")],tone:"ended",icon:"fleet"};case"FleetKeyUnavailable":return{parts:[(0,z.n)("Company key not reachable")],tone:"waiting",icon:"fleet"};case"FleetKeyAvailable":return{parts:[(0,z.n)("Company key reachable again")],tone:"ended",icon:"fleet"};case"FleetDataKeyCreated":return{parts:[(0,z.n)("New data key made")],tone:"ended",icon:"fleet"};case"FleetCompanyKeyChanged":return{parts:[(0,z.n)("Company key changed"),...tH(e.actor)],tone:"ended",icon:"fleet"};case"FleetRecoveryKeyChanged":return{parts:[(0,z.n)("Recovery key changed"),...tH(e.actor)],tone:"ended",icon:"fleet"};case"FleetKeysRecovered":return{parts:[(0,z.n)("Data keys recovered"),...tH(e.actor)],tone:"ended",icon:"fleet"};case"AlertRaised":return{parts:[(0,z.n)(`Alert raised: ${e1(tU(e,"signal")??"")}`),...tH(e.actor)],tone:"attention",icon:"undeliverable"};case"AlertCleared":return"retired"===tU(e,"why")?{parts:[(0,z.n)(`Alert cleared: ${e1(tU(e,"signal")??"")}, the ship retired`)],tone:"ended",icon:"acknowledged"}:{parts:[(0,z.n)(`Alert cleared: ${e1(tU(e,"signal")??"")}`),...tH(e.actor)],tone:"ended",icon:"acknowledged"};case"FeatureFlagTurnedOn":return{parts:[(0,z.n)(`Feature flag ${tU(e,"flag")??""} turned on`)],tone:"ended",icon:"fleet"};case"FeatureFlagTurnedOff":return{parts:[(0,z.n)(`Feature flag ${tU(e,"flag")??""} turned off`)],tone:"ended",icon:"fleet"};case"SignInTicketIssued":return{parts:[(0,z.n)("Sign-in ticket issued")],tone:"ended",icon:"password"};case"ViewerSessionStarted":return{parts:[(0,z.n)("Someone started viewing the fleet")],tone:"ended",icon:"password"};case"CrewRequested":return{parts:[(0,z.n)("Crew requested"),...tH(e.actor)],tone:"waiting",icon:"claimed"};case"CrewRequestRemoved":return{parts:[(0,z.n)("Crew request removed"),...tH(e.actor)],tone:"ended",icon:"released"};case"CrewRequestExplained":{let t=tU(e,"reason");return{parts:[(0,z.n)(void 0===t?"Crew request can not be placed yet":`Crew request can not be placed: ${t}`),...tH(e.actor)],tone:"waiting",icon:"reported"}}case"CrewRequestGivenBack":{let t=tU(e,"reason");return{parts:[(0,z.n)(void 0===t?"Crew request given back":`Crew request given back: ${t}`),...tH(e.actor)],tone:"waiting",icon:"released"}}case"WorktreeClearRequested":return{parts:[(0,z.n)(`Clearing of the kept ${tU(e,"repository")??""} worktree requested`),...tH(e.actor)],tone:"waiting",icon:"reported"};case"WorktreeCleared":return{parts:[(0,z.n)("not-kept"===tU(e,"outcome")?`Kept ${tU(e,"repository")??""} worktree cleared (none was kept)`:`Kept ${tU(e,"repository")??""} worktree cleared`),...tH(e.actor)],tone:"ended",icon:"retired"};case"WorktreeClearRemoved":return{parts:[(0,z.n)(`Clearing of the kept ${tU(e,"repository")??""} worktree dropped`),...tH(e.actor)],tone:"ended",icon:"released"};case"CrewAssigned":return{parts:[(0,z.n)("Crew request assigned"),...tH(e.actor)],tone:"waiting",icon:"claimed"};case"CrewStatusChanged":{let t=tU(e,"status");return{parts:[(0,z.n)(void 0===t?"Crew status changed":`Crew ${t}`),...tH(e.actor)],tone:"crashed"===t?"attention":"active",icon:"reported"}}case"LabelDefined":return{parts:[(0,z.n)(`Label ${tE(e)} defined: ${tV(e)}`)],tone:"ended",icon:"reported"};case"LabelValuesChanged":return{parts:[(0,z.n)(`Label ${tE(e)} values changed: ${tV(e)}`)],tone:"ended",icon:"reported"};case"LabelRetired":return{parts:[(0,z.n)(`Label ${tE(e)} retired`)],tone:"ended",icon:"retired"};case"NetworkRulesSet":{let t=e.details.rules,n=String(e.details.version??""),s="number"==typeof t?`Network rules set: ${String(t)} rules`:"Network rules cleared: every ship reaches every ship";return{parts:[(0,z.n)(`${s}, version ${n}`),...tH(e.actor)],tone:"ended",icon:"fleet"}}case"NetworkRulesDraftSaved":{let t=e.details.rules,n="number"==typeof t?`${String(t)} rules`:"every ship reaches every ship";return{parts:[(0,z.n)(`Network rules draft saved: ${n}, against version ${String(e.details.savedAgainstVersion??"")}`),...tH(e.actor)],tone:"ended",icon:"fleet"}}case"NetworkRulesDraftDiscarded":return{parts:[(0,z.n)("Network rules draft discarded"),...tH(e.actor)],tone:"ended",icon:"fleet"};case"NetworkRulesDeclared":{let t=e.details.rules,n="number"==typeof t&&t>0?`Network rules declared: ${String(t)} rules`:"Declared network rules withdrawn";return{parts:[(0,z.n)(n),...tH(e.actor)],tone:"ended",icon:"fleet"}}case"ScopesDeclared":{let t="number"==typeof e.details.scopes?e.details.scopes:0;return{parts:[(0,z.n)(`Scopes declared: namespace ${tU(e,"namespace")??""}, ${String(t)} ${1===t?"scope":"scopes"}`),...tH(e.actor)],tone:"ended",icon:"fleet"}}case"CommissionApproved":return{parts:[(0,z.n)("Commission rights approved"),...tH(e.actor)],tone:"ended",icon:"commissioned"};case"CommissionApprovalWithdrawn":return{parts:[(0,z.n)("Commission approval withdrawn"),...tH(e.actor)],tone:"ended",icon:"commissioned"};case"ScopesChanged":{let t=tU(e,"added")??"",n=tU(e,"removed")??"",s=[...""===t?[]:[`granted ${t}`],...""===n?[]:[`revoked ${n}`]];return{parts:[(0,z.n)(`Scopes changed: ${s.join(", ")}`),...tH(e.actor)],tone:"ended",icon:"fleet"}}case"ScopeDefined":return{parts:[(0,z.n)(`Scope ${tU(e,"scope")??""} defined`),...tH(e.actor)],tone:"ended",icon:"fleet"};case"ScopeDescribed":return{parts:[(0,z.n)(`Scope ${tU(e,"scope")??""} described`),...tH(e.actor)],tone:"ended",icon:"fleet"};case"ScopeRemoved":return{parts:[(0,z.n)(`Scope ${tU(e,"scope")??""} removed`),...tH(e.actor)],tone:"ended",icon:"fleet"};case"PluginConnected":return{parts:[(0,z.n)("Connected as a plugin: reads every ship"),...tH(e.actor)],tone:"ended",icon:"fleet"};case"PluginDisconnected":return{parts:[(0,z.n)(`No longer a connected plugin: ${tU(e,"why")??""}`),...tH(e.actor)],tone:"ended",icon:"fleet"};case"MeetingOpened":{let t=e.details.participants;return{parts:[(0,z.n)(`Opened a meeting of ${"number"==typeof t?(0,z.v)(t,{one:"ship",many:"ships"}):"ships"}`)],tone:"ok",icon:"sent"}}case"ParticipantAdded":return{parts:[(0,z.n)("Joined a meeting"),...e.actor?[(0,z.n)(", added by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MicRequested":return{parts:[(0,z.n)("Requested the mic in a meeting")],tone:"ok",icon:"sent"};case"MicRequestWithdrawn":return{parts:[(0,z.n)("Withdrew its mic request in a meeting")],tone:"ok",icon:"sent"};case"MicGiven":return{parts:"fifo"===e.details.pattern?[(0,z.n)("Got the mic in a meeting, first in line")]:[(0,z.n)("Got the mic in a meeting"),...e.actor?[(0,z.n)(", given by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MicReleased":return{parts:[(0,z.n)("Released the mic in a meeting")],tone:"ok",icon:"sent"};case"MicTaken":return{parts:[(0,z.n)("Lost the mic in a meeting"),...e.actor?[(0,z.n)(", taken by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MicPatternSet":return{parts:[(0,z.n)("fifo"===e.details.pattern?"Set a meeting's mic to first in line":"Set a meeting's mic to the moderator's pick")],tone:"ok",icon:"sent"};case"ParticipantLeft":return{parts:[(0,z.n)("Left a meeting")],tone:"ok",icon:"sent"};case"ParticipantRejoined":return{parts:[(0,z.n)("Rejoined a meeting")],tone:"ok",icon:"sent"};case"ParticipantRevoked":return{parts:[(0,z.n)("Taken off a meeting"),...e.actor?[(0,z.n)(", by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"OwnershipTransferred":return{parts:[(0,z.n)("Got the ownership of a meeting"),...e.actor?[(0,z.n)(", from "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"ModeratorNamed":return{parts:[(0,z.n)("Became the moderator of a meeting"),...e.actor?[(0,z.n)(", named by "),(0,z.X)(e.actor)]:[]],tone:"ok",icon:"received"};case"MeetingEnded":return{parts:[(0,z.n)("Ended a meeting")],tone:"ok",icon:"sent"};case"ScheduleCreated":return{parts:[(0,z.n)("Scheduled a message")],tone:"ok",icon:"sent"};case"ScheduleCancelled":let a;return{parts:"retired"===(a=tU(e,"reason"))?[(0,z.n)("A scheduled message was cancelled as the ship retired")]:"manager"===a?[(0,z.n)("A scheduled message was cancelled"),...tH(e.actor)]:[(0,z.n)("Cancelled a scheduled message")],tone:"ended",icon:"released"};case"ScheduledSendRefused":return{parts:[(0,z.n)(`A scheduled send was refused: ${tU(e,"code")??"refused"}`)],tone:"waiting",icon:"undeliverable"};case"ScheduledSendMissed":return{parts:[(0,z.n)("A scheduled send time was missed")],tone:"waiting",icon:"undeliverable"};case"SchedulePaused":let r;return{parts:"ship"===(r=tU(e,"reason"))?[(0,z.n)("Paused a scheduled message")]:"manager"===r?[(0,z.n)("A scheduled message was paused"),...tH(e.actor)]:[(0,z.n)("A scheduled message paused after a refused send")],tone:"waiting",icon:"reported"};case"ScheduleResumed":return{parts:[(0,z.n)("Resumed a scheduled message")],tone:"ok",icon:"sent"};case"ScheduleEnded":return{parts:[(0,z.n)("A scheduled message ended")],tone:"ended",icon:"sent"};case"VerifiedFactsRemoved":return{parts:[(0,z.n)(`Verified facts removed: ${String(e.details.facts??"")}, ${"writerRetired"===tU(e,"why")?"their writer retired":"the ship retired"}`)],tone:"ended",icon:"reported"};case"ExpectationsSet":return{parts:[(0,z.n)(null===e.details.reportChangesWithin&&null===e.details.taskDoneBy?"Expectations cleared":"Expectations set"),...tH(e.actor)],tone:"ended",icon:"reported"};case"VerifiedFactsSet":{let t=e.details.facts;return{parts:[(0,z.n)(0===t?"Verified facts withdrawn":`Verified facts set: ${String(t??"")}`),...tH(e.actor)],tone:"ended",icon:"reported"}}case"NetworkPluginRegistered":return{parts:[(0,z.n)(`Networking plugin registered: while unavailable ${tU(e,"whileUnavailable")??""}, version ${String(e.details.version??"")}`),...tH(e.actor)],tone:"ended",icon:"fleet"};case"NetworkPluginUnregistered":return{parts:[(0,z.n)(`Networking plugin unregistered: every ship reaches every ship, version ${String(e.details.version??"")}`),...tH(e.actor)],tone:"ended",icon:"fleet"};case"BuiltInRuleChanged":{let t=tU(e,"verb"),n="viewerRead"===e.details.rule?"viewer read":`${tU(e,"rule")??""}${void 0===t?"":` for ${t}`}`,s=!0===e.details.isOn?"on":"off";return{parts:[(0,z.n)(`Built-in rule ${n} turned ${s}, version ${String(e.details.version??"")}`),...tH(e.actor)],tone:"ended",icon:"fleet"}}case"LabelDeleted":return{parts:[(0,z.n)(`Label ${tE(e)} deleted`)],tone:"ended",icon:"retired"};case"LabelAssigned":return{parts:[(0,z.n)(`Labelled ${tE(e)}=${tU(e,"value")??""}`),...tH(e.actor)],tone:"ended",icon:"reported"};case"LabelUnassigned":return{parts:[(0,z.n)(`Label ${tE(e)}=${tU(e,"value")??""} removed`),...tH(e.actor)],tone:"ended",icon:"reported"};case"MessageAccepted":let l;return{parts:(l=e.message)?t_(e)&&"ship"===l.recipient.kind?l.sender.id===t?[(0,z.n)("Pinged "),(0,z.X)(l.recipient.ship)]:[(0,z.n)("Pinged by "),(0,z.X)(l.sender)]:l.sender.id===t?"ship"===l.recipient.kind?[(0,z.n)("Sent a message to "),(0,z.X)(l.recipient.ship)]:[(0,z.n)(`Sent a message to ${(0,S.R)(l.recipient)}`)]:[(0,z.n)("Received a message from "),(0,z.X)(l.sender)]:[(0,z.n)("A message was sent")],tone:"ended",icon:e.message?.sender.id===t?"sent":"received"};case"LeasePushed":return{parts:[(0,z.n)("Pushed: its trierarch or plugin watcher receives for its session")],tone:"ok",icon:"received"};case"DeliveryReceived":return{parts:tX(e,{shipId:t,verb:!0===e.details.again?"received again":"received"}),tone:"active",icon:"received"};case"DeliveryHanded":return{parts:tX(e,{shipId:t,verb:!0===e.details.onceMore?"took once more":"took"}),tone:"active",icon:"received"};case"DeliveryHandled":return{parts:tX(e,{shipId:t,verb:"handled"}),tone:"ok",icon:"acknowledged"};case"DeliveryNotHandled":return{parts:[...tG(e),(0,z.n)(" was not handled: its turn died twice")],tone:"attention",icon:"undeliverable"};case"DeliveryOverdue":let d,o,c;return{parts:[...tG(e),(0,z.n)(` is overdue: ${(o="number"==typeof(d=e.details.minutes)?`${String(d)} min`:"too long","notConfirmed"===(c=tU(e,"clock"))?`handed, not confirmed for ${o}`:`waiting ${o} while its session is ${"busy"===c?"busy":"idle"}`)}, argo told`)],tone:"attention",icon:"undeliverable"};case"DeliveryAcknowledged":return{parts:"pong"===tU(e,"answer")?[...tX(e,{shipId:t,verb:"answered"}),(0,z.n)(" with pong")]:tX(e,{shipId:t,verb:"acknowledged"}),tone:"ok",icon:"acknowledged"};case"DeliveryReturned":return{parts:[...tG(e),(0,z.n)(" went back to pending")],tone:"waiting",icon:"returned"};case"DeliveryUndeliverable":return{parts:[...tG(e),(0,z.n)(" became undeliverable")],tone:"attention",icon:"undeliverable"};case"ShipRetired":{let t=e.details.abandonedDeliveries;return{parts:[(0,z.n)("Retired"),...tH(e.actor),(0,z.n)("."),..."number"==typeof t&&t>0?[(0,z.n)(` ${(0,z.v)(t,{one:"delivery",many:"deliveries"})} abandoned.`)]:[]],tone:"ended",icon:"retired"}}case"DeliveryAbandoned":return{parts:[...tG(e),(0,z.n)(" was abandoned")],tone:"ended",icon:"abandoned"};case"ShipReported":{let t=tU(e,"state")??"in",n=tU(e,"note");return{parts:[(0,z.n)(void 0===n?`Reported ${t}`:`Reported ${t}: ${n}`)],tone:Object.hasOwn(e_.m,t)?e_.m[t]:"ended",icon:"reported"}}case"StatementSet":return{parts:[(0,z.n)(`Stated what it is and offers: ${String(e.details.capabilities??"")} capabilities, version ${String(e.details.version??"")}`)],tone:"ended",icon:"reported"};case"TurnReported":{let t=tU(e,"turn");return{parts:[(0,z.n)("busy"===t?"Turn started: busy":"Turn ended: idle")],tone:"busy"===t?"active":"ended",icon:"reported"}}case"ShipRenamed":{let t=tU(e,"from"),n=tU(e,"to");return{parts:[(0,z.n)(void 0===t||void 0===n?"Renamed":`Renamed from ${t} to ${n}`),...tH(e.actor)],tone:"ended",icon:"renamed"}}case"DeliveryDismissed":return{parts:[...tG(e),(0,z.n)(" was dismissed"),...tH(e.actor)],tone:"ended",icon:"dismissed"}}}(e,n),o=tQ[d],c=new Date(e.occurredAt),u=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,h.f)("flex size-7 shrink-0 items-center justify-center rounded-md border [&_svg]:size-(--size-icon-sm)",tJ[l]),children:(0,t.jsx)(o,{})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)(N.f,{parts:r,className:"text-body text-foreground max-sm:text-body-touch"}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[(0,t.jsx)("time",{dateTime:e.occurredAt,title:(0,w.o)(c),className:"tabular-nums",children:(0,w.W)(c,s)}),null===e.signedInAccountId?null:(0,t.jsxs)("span",{"data-testid":"ship-timeline-account",children:[" · by ",a[e.signedInAccountId]??e.signedInAccountId]})]})]})]}),{message:m}=e;return(0,t.jsx)("li",{"data-testid":"ship-timeline-entry","data-type":e.type,className:"border-b border-border last:border-b-0",children:m?(0,t.jsx)("button",{type:"button",className:(0,h.f)(tZ,"transition-colors duration-(--duration-fast) hover:bg-accent"),onClick:()=>{i(m.id)},children:u}):(0,t.jsx)("div",{className:tZ,children:u})})}function t0({shipId:e,entries:n,state:s,onRetry:i,more:a,now:r,onOpenMessage:l,accountNames:d}){return"loading"===s?(0,t.jsx)(m.f,{variant:"list",rows:4,label:"Loading the timeline"}):"error"===s?(0,t.jsxs)("div",{"data-testid":"ship-timeline",className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)(x.f,{title:"Couldn’t load the timeline",description:"The rest of the page is current. Try again in a moment."}),i?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),onClick:i,className:"self-start",children:"Try again"}):null]}):(0,t.jsxs)("div",{"data-testid":"ship-timeline",className:"overflow-hidden rounded-lg border border-border bg-card",children:[(0,t.jsx)("ol",{"aria-label":"Timeline",children:n.map(n=>(0,t.jsx)(tY,{entry:n,shipId:e,now:r,onOpenMessage:l,accountNames:d},n.id))}),a,n.length<=1&&!a?(0,t.jsx)("p",{className:"border-t border-border px-3.5 py-3 text-center text-meta text-muted-foreground first:border-t-0",children:"Nothing else yet. Claims, releases and messages appear here as they happen."}):null]})}var t1=e.i(632066),t2=e.i(298421),t5=e.i(668269),t6=e.i(749092),t3=e.i(976580),t8=e.i(994070),t4=e.i(837631),t7=e.i(787964),t9=e.i(46929),ne=e.i(718423),nt=e.i(296676),nn=e.i(743006),ns=e.i(609176),ni=e.i(750980),na=e.i(278888),nr=e.i(678485),nl=e.i(853573),nd=e.i(285595),no=e.i(928459),nc=e.i(414732);function nu({party:e}){let n=e.name===z.D;return(0,t.jsx)(e5.f,{name:e.name,shipId:e.id,size:"meta",isOperator:n,isSuffixShown:!n})}function nm({delivery:e}){let{sender:n,recipient:s}=e.message;return(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(nu,{party:n}),(0,t.jsx)("span",{"aria-hidden":!0,children:"→"}),(0,t.jsx)("span",{className:"sr-only",children:"to"}),"ship"===s.kind?(0,t.jsx)(nu,{party:s.ship}):(0,t.jsx)("span",{children:(0,S.R)(s)})]})}function np({delivery:e}){let{payload:n,contentType:s}=e.message;return(0,t.jsx)("span",{className:(0,h.f)("block min-w-0 truncate text-foreground",(0,b.N)(s)?"font-mono text-id":"text-body max-sm:text-body-touch"),title:n,children:n.split("\n")[0]})}function nh(e){var t;return`the message from ${e.message.sender.name} to ${"ship"===(t=e.message.recipient).kind?t.ship.name:(0,S.R)(t)}`}function ng({delivery:e,onResend:n,onDismiss:s,pendingIds:i,layout:a}){let r=i.has(e.deliveryId),l="phone"===a;if(void 0===n&&void 0===s)return null;let d=void 0!==n&&(0,no.c)(e)?(0,t.jsx)(p.f,{size:l?"touch":"sm",variant:l?"primary":"secondary",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),isLoading:r,"data-testid":"attention-resend","aria-label":`Resend ${nh(e)}`,onClick:()=>{n(e.deliveryId)},className:l?"flex-1":void 0,children:"Resend"}):null,o=void 0===s?null:(0,t.jsx)(p.f,{size:l?"touch":"sm",variant:l?"secondary":"ghost",disabled:r,"data-testid":"attention-dismiss","aria-label":`Dismiss ${nh(e)}`,onClick:()=>{s(e.deliveryId)},className:l?"flex-1":void 0,children:"Dismiss"});return l?(0,t.jsxs)("div",{className:"flex gap-2 pt-1",children:[o,d]}):(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[d,o]})}function nx({deliveries:e,onOpen:n,now:s,...i}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2 max-sm:hidden",children:[(0,t.jsxs)(nc.s,{"aria-label":"Undeliverable and not handled deliveries",children:[(0,t.jsx)(nc.E,{children:(0,t.jsxs)(nc.N,{children:[(0,t.jsx)(nc.U,{children:"State"}),(0,t.jsx)(nc.U,{children:"Message"}),(0,t.jsx)(nc.U,{children:"Reason"}),(0,t.jsx)(nc.U,{children:"Since"}),(0,t.jsx)(nc.U,{children:"Actions"})]})}),(0,t.jsx)(nc.z,{children:e.map(e=>{let a=new Date(e.since);return(0,t.jsxs)(nc.N,{"data-testid":"attention-row","data-delivery-id":e.deliveryId,children:[(0,t.jsx)(nc.d,{className:"align-top",children:(0,t.jsx)(f.T,{status:e.state})}),(0,t.jsx)(nc.d,{className:"max-w-96 align-top",children:(0,t.jsxs)("button",{type:"button","aria-label":`Open ${nh(e)}`,onClick:()=>{n(e)},className:"flex w-full min-w-0 flex-col gap-0.5 rounded-xs text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(np,{delivery:e}),(0,t.jsx)(nm,{delivery:e})]})}),(0,t.jsx)(nc.d,{className:"max-w-48 align-top text-meta whitespace-normal text-muted-foreground",children:(0,no.g)(e)}),(0,t.jsx)(nc.d,{className:"align-top",children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5 tabular-nums",children:[(0,t.jsx)("time",{dateTime:e.since,title:(0,w.o)(a),className:"text-body text-foreground",children:(0,w.B)(a)}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[(0,w.m)(a,s)," ago"]})]})}),(0,t.jsx)(nc.d,{className:"align-top",children:(0,t.jsx)(ng,{delivery:e,layout:"table",...i})})]},e.deliveryId)})})]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Resend creates a new message with the same payload, linked to the original. Dismiss marks the delivery resolved. Abandoned deliveries are not listed here."})]})}function nf({deliveries:e,onOpen:n,now:s,...i}){return(0,t.jsx)("ul",{"aria-label":"Undeliverable and not handled deliveries",className:"flex flex-col gap-3 sm:hidden",children:e.map(e=>{let a=new Date(e.since),r=s.getTime()-a.getTime()<864e5?(0,w.w)(a):(0,w.B)(a);return(0,t.jsxs)("li",{"data-testid":"attention-row","data-delivery-id":e.deliveryId,className:"flex flex-col gap-1.5 rounded-lg border border-border bg-card px-3.5 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(f.T,{status:e.state}),(0,t.jsxs)("button",{type:"button","aria-label":`Open ${nh(e)}`,onClick:()=>{n(e)},className:"inline-flex items-center gap-1 rounded-xs text-meta text-muted-foreground tabular-nums focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",children:[(0,w.m)(a,s),(0,t.jsx)(eW.f,{"aria-hidden":!0})]})]}),(0,t.jsx)(np,{delivery:e}),(0,t.jsx)(nm,{delivery:e}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[(0,no.g)(e)," Since"," ",(0,t.jsx)("time",{dateTime:e.since,title:(0,w.o)(a),className:"tabular-nums",children:r}),"."]}),(0,t.jsx)(ng,{delivery:e,layout:"phone",...i})]},e.deliveryId)})})}function nb({deliveries:e,state:n,onRetry:s,...i}){return"loading"===n?(0,t.jsxs)("div",{"data-slot":"needs-attention-list","data-state":"loading",children:[(0,t.jsx)(m.f,{variant:"table",rows:2,label:"Loading Needs attention",className:"max-sm:hidden"}),(0,t.jsx)(m.f,{variant:"list",rows:2,label:"Loading Needs attention",className:"sm:hidden"})]}):"error"===n?(0,t.jsx)("div",{"data-slot":"needs-attention-list","data-state":"error","data-testid":"attention-error",children:(0,t.jsx)(x.f,{variant:"page",title:"Couldn’t load Needs attention",description:"This page couldn’t reach the fleet server. Undeliverable deliveries are kept on the server, so nothing is lost.",onRetry:s})}):0===e.length?(0,t.jsx)("div",{"data-slot":"needs-attention-list","data-state":"empty","data-testid":"attention-empty",children:(0,t.jsx)(g.f,{icon:(0,t.jsx)(nd.f,{className:"text-tone-ok-fg"}),title:"Nothing needs your attention",description:"Undeliverable deliveries show up here as soon as they happen."})}):(0,t.jsxs)("div",{"data-slot":"needs-attention-list","data-state":"ready",className:"flex flex-col gap-3",children:[(0,t.jsx)(nx,{deliveries:e,...i}),(0,t.jsx)(nf,{deliveries:e,...i})]})}function nv({shipId:e}){let i=(0,n.useRouter)(),a=(0,nt.f)(),r=(0,no.t)({shipId:e,state:"notHandled"}),l=(0,no.F)(),d=(0,no.d)(),o=(0,O.Q)(),[c,u]=(0,s.useState)(new Set),m=r.items??[],p=(e,t)=>{u(t=>new Set([...t,e])),t().finally(()=>{u(t=>new Set([...t].filter(t=>t!==e)))})};return 0===m.length?null:(0,t.jsxs)("section",{"aria-labelledby":"ship-not-handled","data-testid":"ship-not-handled",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h2",{id:"ship-not-handled",className:"text-body font-semibold",children:["Not handled (",m.length,")"]}),(0,t.jsx)(nb,{deliveries:m,state:"ready",onRetry:r.retry,onResend:o.canResend?e=>{let t=(0,no.w)(m,e);p(e,async()=>{try{await l.mutateAsync({deliveryId:e}),t&&(0,E.showToast)({...(0,no.a)(t),tone:"success"})}catch(e){(0,E.showToast)({title:"Couldn’t resend the message",description:nj(e),tone:"error"})}})}:void 0,onDismiss:o.canResend?e=>{p(e,async()=>{try{await d.mutateAsync({deliveryId:e}),(0,E.showToast)({...no.Y,tone:"success"})}catch(e){(0,E.showToast)({title:"Couldn’t dismiss the delivery",description:nj(e),tone:"error"})}})}:void 0,onOpen:t=>{i.replace(`/ships/${e}?tab=messages&message=${t.message.id}`,{scroll:!1})},pendingIds:c,now:a}),r.hasMore?(0,t.jsx)(t2.f,{what:"more not handled",isLoading:r.isLoadingMore,isFailed:r.isLoadMoreFailed,onLoad:r.loadMore,area:"ship-not-handled"}):null]})}function nj(e){return e instanceof Error?e.message:"Try again in a moment."}let ny="timeline",nw="messages",nz="schedules";var nk=e.i(214126),nN=e.i(282492),nI=e.i(54105),nS=e.i(978056),nC=e.i(477562),n$=e.i(980815),nA=e.i(868217),nT=e.i(411382),nR=e.i(213056),nO=e.i(488826),nq=e.i(942203),nD=e.i(383615);let nM=/^P(?:(\d+)W|(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?)$/;function nP(e){let t=nM.exec(e);if(!t||e.endsWith("T"))return;let[,n,s,i,a,r]=t,l=6048e5*Number(n??0)+864e5*Number(s??0)+36e5*Number(i??0)+6e4*Number(a??0)+Math.round(1e3*Number(r??0));return l>0?l:void 0}let nF=nI.z.string().min(1).max(256);var nL=e.i(691113),nB=e.i(722219),nB=nB,nU=e.i(513907),nE=e.i(500901),nV=e.i(606811),nH=e.i(240192),nW=e.i(619877);let n_=nN.z.enum(["working","blocked","idle"]),nK=`A note is one line of at most ${String(200)} characters`;new TextEncoder;let nG=nH.z.record(nI.z.string(),nW.z.json()),nX=nT.z.object({kind:nI.z.string()}).catchall(nW.z.json()),nQ=nT.z.object({at:nS.z.number(),of:nS.z.number()});nT.z.object({state:n_,note:nI.z.string().trim().max(200,nK).refine(function(e){return!/[\r\n]/.test(e)},nK).optional(),details:nG.nullable().optional(),detailsPatch:nG.nullable().optional(),task:nX.nullable().optional(),step:nQ.nullable().optional()}).refine(e=>void 0===e.details||void 0===e.detailsPatch,{message:"Give details or detailsPatch, not both",path:["detailsPatch"]}),n$.z.strictObject({});let nJ=nT.z.object({state:n_,note:nI.z.string().nullable(),task:nX.nullable(),taskView:nT.z.object({canOpen:nR.z.boolean(),fleetName:nI.z.string().nullable()}).optional(),step:nQ.nullable(),reportedAt:nk.z.iso.datetime(),reportChangedAt:nk.z.iso.datetime(),detailsVersion:nL.z.int().min(0)}),nZ=nJ.extend({details:nG.nullable()});nT.z.object({report:nZ.nullable(),previousCrew:nZ.nullable()});let nY=nN.z.enum(["crew-request-unassigned","delivery-unacknowledged","delivery-overdue","ping-unanswered","report-unchanged","task-not-done"]),n0=nk.z.iso.datetime({offset:!0}),n1=nL.z.int().min(1),n2=n$.z.strictObject({settingsVersion:nL.z.int().min(1),minutes:n1,reason:nI.z.string().nullable()}),n5=n$.z.strictObject({deliveryId:(0,nD.f)("delivery"),messageId:(0,nD.f)("message"),state:nN.z.enum(["pending","received","handed"]),awaitingCrew:nR.z.boolean(),minutes:n1}),n6=n$.z.strictObject({deliveryId:(0,nD.f)("delivery"),messageId:(0,nD.f)("message"),overdueEventId:(0,nD.f)("event")}),n3=n$.z.strictObject({deliveryId:(0,nD.f)("delivery"),messageId:(0,nD.f)("message"),minutes:n1}),n8=n$.z.strictObject({reportChangedAt:n0,state:nN.z.enum(["working","blocked"]),minutes:n1,setBy:(0,nD.f)("ship")}),n4=n$.z.strictObject({task:nX,doneBy:n0,setBy:(0,nD.f)("ship")}),n7=[nT.z.object({signal:nA.z.literal("crew-request-unassigned"),facts:n2}),nT.z.object({signal:nA.z.literal("delivery-unacknowledged"),facts:n5}),nT.z.object({signal:nA.z.literal("delivery-overdue"),facts:n6}),nT.z.object({signal:nA.z.literal("ping-unanswered"),facts:n3}),nT.z.object({signal:nA.z.literal("report-unchanged"),facts:n8}),nT.z.object({signal:nA.z.literal("task-not-done"),facts:n4})],n9=nC.z.discriminatedUnion("signal",n7);nB.intersection(nT.z.object({alertId:(0,nD.f)("alert"),headline:nI.z.string().min(1).max(80),body:nI.z.string().refine(e=>2048>=(0,nE.y)(e),`A body is at most ${String(2048)} bytes`),ship:nT.z.object({id:(0,nD.f)("ship"),name:nI.z.string()}),fleetId:(0,nD.f)("fleet"),toldAs:nN.z.enum(["owner","setter"]),since:n0,raisedAt:n0}),n9).refine(e=>8192>=(0,nE.y)(JSON.stringify(e)),`An alert message is at most ${String(8192)} bytes`),nT.z.object({shipId:(0,nD.f)("ship"),signal:nY,facts:nO.z.union([n2,n5,n6,n3,n8,n4]),occurrenceKey:nI.z.string().min(1).max(200),since:n0}).transform(({shipId:e,signal:t,facts:n,occurrenceKey:s,since:i},a)=>{let r=n9.safeParse({signal:t,facts:n});return r.success?{shipId:e,occurrenceKey:s,since:i,...r.data}:(a.addIssue({code:"custom",message:"The facts are not the signal's",path:["facts"]}),nU.z.NEVER)}),nT.z.object({alertId:(0,nD.f)("alert")});let se=nN.z.enum(["cleared","retired"]),st=nB.intersection(nT.z.object({id:(0,nD.f)("alert"),ship:nT.z.object({id:(0,nD.f)("ship"),name:nI.z.string()}),occurrenceKey:nI.z.string(),ownerShipId:(0,nD.f)("ship").nullable(),since:nk.z.iso.datetime(),raisedAt:nk.z.iso.datetime(),cleared:nT.z.object({at:nk.z.iso.datetime(),why:se}).nullable()}),n9);(0,nV.G)((0,nD.f)("alert")).optional(),(0,nV._)(st,(0,nD.f)("alert"));var sn=e.i(347664);let ss=nL.z.int().min(5).max(10080);nT.z.object({shipId:(0,nD.f)("ship"),reportChangesWithin:ss.nullable().optional(),taskDoneBy:nT.z.object({task:nX,doneBy:nk.z.iso.datetime({offset:!0})}).nullable().optional()}),n$.z.strictObject({});let si=nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("ship"),shipId:(0,nD.f)("ship")}),nT.z.object({kind:nA.z.literal("account"),accountId:sn.f}),nT.z.object({kind:nA.z.literal("installation")})]),sa=nT.z.object({reportChangesWithin:nT.z.object({minutes:nL.z.int(),setBy:si,setAt:nk.z.iso.datetime()}).nullable(),taskDoneBy:nT.z.object({task:nX,doneBy:nk.z.iso.datetime(),setBy:si,setAt:nk.z.iso.datetime()}).nullable()});var sr=nB,sl=e.i(173332),sd=e.i(851756);let so=nT.z.object({approvalId:(0,nD.f)("commissionApproval"),subjectDigest:nI.z.string().min(1)});nT.z.object({commissionerId:(0,nD.f)("ship"),scopes:nq.z.array(sl.q),subjectDigest:nI.z.string().min(1)}),nT.z.object({approvalId:(0,nD.f)("commissionApproval")}),nT.z.object({approvalId:(0,nD.f)("commissionApproval")}),n$.z.strictObject({});let sc=nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("ship"),shipId:(0,nD.f)("ship"),signedInAccountId:sn.f.optional()}),nT.z.object({kind:nA.z.literal("account"),accountId:sn.f,throughShipId:(0,nD.f)("ship").nullable()}),nT.z.object({kind:nA.z.literal("installation")}),nT.z.object({kind:nA.z.literal("system")})]);nT.z.object({id:(0,nD.f)("commissionApproval"),fleetId:(0,nD.f)("fleet"),approver:sc,commissionerId:(0,nD.f)("ship"),scopes:nq.z.array(sl.q),subjectDigest:nI.z.string().min(1),createdAt:sd.z.date(),withdrawnAt:sd.z.date().nullable()});var su=e.i(367795),sm=e.i(985939),sp=e.i(998648);let sh=nN.z.enum(["text","tool","result","error"]);nT.z.object({intervalSeconds:nL.z.int().min(1).max(86400),activities:nq.z.array(nT.z.object({shipId:(0,nD.f)("ship"),at:nk.z.iso.datetime(),kind:sh,tool:nI.z.string().trim().min(1).max(100).optional()})).min(1).max(100)}),nT.z.object({refused:nq.z.array(nT.z.object({shipId:(0,nD.f)("ship"),code:nI.z.string(),message:nI.z.string()}))});let sg=nT.z.object({at:nk.z.iso.datetime(),kind:sh,tool:nI.z.string().nullable(),reportedAt:nk.z.iso.datetime(),intervalSeconds:nL.z.int().min(1)}),sx=nI.z.string().max(su.Z,su.o).regex(su.V,su.o);nT.z.object({name:sx,type:sx,kind:sl.$.optional(),scopes:nq.z.array(sl.q).optional(),valueIds:nq.z.array((0,nD.f)("labelValue")).max(sp.b).optional(),ownerOf:(0,nD.f)("ship").optional(),approval:so.optional(),owner:(0,nD.f)("ship").optional(),note:nI.z.string().trim().max(500,"A note is at most 500 characters").optional(),idempotencyKey:nF}),nT.z.object({shipId:(0,nD.f)("ship")});let sf=nT.z.object({harness:nI.z.string(),line:nI.z.string()});nT.z.object({shipId:(0,nD.f)("ship"),prompt:nI.z.string(),crewLines:nq.z.array(sf),secret:nI.z.string()}),nT.z.object({shipId:(0,nD.f)("ship"),prompt:nI.z.string().nullable(),crewLines:nq.z.array(sf).nullable(),secret:nI.z.string().nullable(),startingPrompt:nT.z.object({issuedAt:nk.z.iso.datetime(),isClaimed:nR.z.boolean()}).nullable()}),nT.z.object({shipId:(0,nD.f)("ship")}),n$.z.strictObject({}),nT.z.object({shipId:(0,nD.f)("ship"),name:sx}),n$.z.strictObject({}),nT.z.object({shipId:(0,nD.f)("ship"),ownerShipId:(0,nD.f)("ship")}),n$.z.strictObject({}),nT.z.object({shipId:(0,nD.f)("ship")}),n$.z.strictObject({}),nT.z.object({shipId:(0,nD.f)("ship")}),nT.z.object({abandonedDeliveries:nL.z.int().min(0)}),nT.z.object({shipId:(0,nD.f)("ship")});let sb=nN.z.enum(["waiting","answered","acknowledged","undeliverable"]),sv=nT.z.object({id:(0,nD.f)("ship"),name:nI.z.string(),type:nI.z.string(),kind:sl.v,status:sl.e,startingPrompt:nT.z.object({issuedAt:nk.z.iso.datetime(),isClaimed:nR.z.boolean()}).nullable(),location:nT.z.object({kind:sl.p,description:nI.z.string().nullable()}).nullable(),lastSeenAt:nk.z.iso.datetime().nullable(),ping:nT.z.object({state:sb,sentAt:nk.z.iso.datetime(),answeredAt:nk.z.iso.datetime().nullable()}).nullable(),harness:nI.z.string().nullable(),model:nT.z.object({id:nI.z.string(),statedAt:nk.z.iso.datetime()}).nullable(),scopes:nq.z.array(sl.q),report:nJ.nullable(),activity:sg.nullable(),crewRequest:sm.i.nullable(),labels:nq.z.array(sp.B),awaitingCrewSince:nk.z.iso.datetime().nullable(),retiredAt:nk.z.iso.datetime().nullable(),ownerShipId:(0,nD.f)("ship").nullable(),openAlertCount:nL.z.int().min(0)}),sj=nT.z.object({id:(0,nD.f)("ship"),name:nI.z.string(),type:nI.z.string(),status:sl.e,isInReadReach:nA.z.literal(!1)});(0,nV._)(nO.z.union([sv,sj]),nI.z.string()),nO.z.union([sv,sj]),nq.z.array(nT.z.object({kind:sl.v,active:nL.z.int().min(0),crewed:nL.z.int().min(0),awaitingCrew:nL.z.int().min(0),retired:nL.z.int().min(0),needsCrew:nT.z.object({withTrierarchs:nL.z.int().min(0),withoutTrierarchs:nL.z.int().min(0)}),longestWait:nT.z.object({id:(0,nD.f)("ship"),name:nI.z.string(),awaitingCrewSince:nk.z.iso.datetime()}).nullable()})),nT.z.object({lastEventId:nI.z.string().regex(/^\d{1,15}$/,"A position is the number of an event").nullish()});let sy=nT.z.object({seq:nS.z.number().int().positive(),id:(0,nD.f)("event"),type:sl.Q,occurredAt:nk.z.iso.datetime(),actorKind:nN.z.enum(["ship","account","installation","system"]),actorShipId:(0,nD.f)("ship").nullable(),actorAccountId:sn.f.nullable(),actorSignedInAccountId:sn.f.nullable(),shipId:(0,nD.f)("ship").nullable(),messageId:(0,nD.f)("message").nullable(),deliveryId:(0,nD.f)("delivery").nullable()});nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("event"),event:sy}),nT.z.object({kind:nA.z.literal("resync")})]),nT.z.object({ships:nT.z.object({limit:nL.z.int().min(0).nullable(),count:nL.z.int().min(0)}),dailyMessages:nT.z.object({limit:nL.z.int().min(0).nullable(),count:nL.z.int().min(0),resetsAt:nk.z.iso.datetime()}),retention:nT.z.object({days:nL.z.int().min(1).nullable(),keptFrom:nk.z.iso.datetime().nullable()})});let sw="[!#$%&'*+\\-.^_`|~0-9A-Za-z]+",sz="[ \\t]*",sk=RegExp(`^${sw}/${sw}(?:${sz};${sz}(?:${sw}=(?:${sw}|"(?:[\\t \\x21\\x23-\\x5B\\x5D-\\x7E\\x80-\\xFF]|\\\\[\\t \\x21-\\x7E\\x80-\\xFF])*"))?)*$`),sN="A content type is a media type such as text/plain or application/json; charset=utf-8, of at most 256 characters",sI=nI.z.string().max(256,sN).refine(function(e){return sk.test(e)},sN),sS=nI.z.string().trim().min(1,"A model is the exact model id the session runs, such as claude-opus-5-5").max(100,`A model is at most ${String(100)} characters`).regex(/^\S+$/,"A model id has no spaces"),sC=n$.z.strictObject({kind:nA.z.literal("label"),valueIds:nq.z.array((0,nD.f)("labelValue")).min(1,"A label selection names at least one value id").max(sp.b,`A label selection names at most ${String(sp.b)} value ids, as many as a ship carries`).refine(e=>new Set(e).size===e.length,"A label selection names each value id once")}),s$=nO.z.union([n$.z.strictObject({kind:nA.z.literal("ship"),shipId:(0,nD.f)("ship")}),n$.z.strictObject({kind:nA.z.literal("ship"),name:sx})]),sA=nO.z.union([...s$.options,n$.z.strictObject({kind:nA.z.literal("type"),type:sx}),n$.z.strictObject({kind:nA.z.literal("meeting"),meetingId:(0,nD.f)("meeting")}),sC]),sT=nO.z.union([n$.z.strictObject({kind:nA.z.literal("ship"),shipId:(0,nD.f)("ship")}),n$.z.strictObject({kind:nA.z.literal("ship"),name:sx}),n$.z.strictObject({kind:nA.z.literal("type"),type:sx}),sC]),sR=nI.z.string().refine(e=>(0,nE.y)(e)<=nE.D,`A payload is at most ${nE.D} bytes (256 KB) in UTF-8`);nT.z.object({selector:sA,payload:sR,contentType:sI.optional(),model:sS.optional(),idempotencyKey:nF,inReplyTo:(0,nD.f)("message").optional(),isForced:nR.z.boolean().optional()}),nT.z.object({messageId:(0,nD.f)("message")}),nN.z.enum(["clientIdDocumentDomain","tlsHost","a2aCardDomain","oauthSubject"]);let sO=nI.z.string().min(1).max(255),sq=nC.z.discriminatedUnion("checked",[n$.z.strictObject({checked:nN.z.enum(["clientIdDocumentDomain","tlsHost","a2aCardDomain"]),value:sO}),n$.z.strictObject({checked:nA.z.literal("oauthSubject"),issuer:nI.z.string().min(1).max(2048),value:sO})]);function sD(e){return JSON.stringify([e.checked,"issuer"in e?e.issuer:null,e.value])}nT.z.object({shipId:(0,nD.f)("ship"),facts:nq.z.array(sq).max(10,`A writer holds at most ${String(10)} facts about a ship`).refine(e=>new Set(e.map(sD)).size===e.length,"Each fact once")}),n$.z.strictObject({});let sM={by:nC.z.discriminatedUnion("kind",[n$.z.strictObject({kind:nA.z.literal("ship"),id:(0,nD.f)("ship"),name:nI.z.string()}),n$.z.strictObject({kind:nA.z.literal("account"),id:sn.f}),n$.z.strictObject({kind:nA.z.literal("installation")})]),at:nk.z.iso.datetime()},sP=nC.z.discriminatedUnion("checked",[sq.options[0].extend(sM),sq.options[1].extend(sM)]),sF=nH.z.record(nI.z.string(),nW.z.json()),sL=n$.z.strictObject({title:nI.z.string().optional(),readOnlyHint:nR.z.boolean().optional(),destructiveHint:nR.z.boolean().optional(),idempotentHint:nR.z.boolean().optional(),openWorldHint:nR.z.boolean().optional()}),sB=nq.z.array(sI).min(1,"Name at least one media type"),sU=n$.z.strictObject({name:nI.z.string().regex(/^[A-Za-z0-9_.-]{1,128}$/,"A capability name is 1 to 128 letters, digits, _, - or ., as MCP names a tool"),title:nI.z.string().optional(),description:nI.z.string().optional(),inputSchema:sF.optional(),outputSchema:sF.optional(),inputModes:sB.optional(),outputModes:sB.optional(),waitMs:nL.z.int().min(0).max(12e4).optional(),deadlineMs:nL.z.int().min(1).max(6048e5).optional(),repeatable:nR.z.boolean().optional(),scopes:nq.z.array(sl.q).optional(),annotations:sL.optional()}),sE=new TextEncoder,sV=`A statement is at most ${String(262144)} bytes (256 KB) as JSON in UTF-8`;n$.z.strictObject({summary:nI.z.string().trim().min(1,"A statement has a summary").max(1e3,`A summary is at most ${String(1e3)} characters`),capabilities:nq.z.array(sU)}).refine(e=>new Set(e.capabilities.map(e=>e.name)).size===e.capabilities.length,{message:"A statement names each capability once",path:["capabilities"]}).refine(e=>sE.encode(JSON.stringify(e)).byteLength<=262144,{message:sV}),nT.z.object({version:nL.z.int().min(1)});let sH=nC.z.discriminatedUnion("by",[nT.z.object({by:nA.z.literal("crew"),version:nL.z.int().min(1),summary:nI.z.string(),capabilities:nq.z.array(sU)}),nT.z.object({by:nA.z.literal("commission"),note:nI.z.string()})]).nullable();nT.z.object({ships:nq.z.array(nT.z.object({id:(0,nD.f)("ship"),name:nI.z.string(),type:nI.z.string(),kind:sl.v,status:sl.e,statement:sH,verified:nq.z.array(sP)})),types:nq.z.array(nT.z.object({type:nI.z.string(),reachable:nL.z.int().min(1)}))});let sW=nN.z.enum(["idle","busy"]);nT.z.object({turn:sW,at:nk.z.iso.datetime()}),n$.z.strictObject({});let s_=nk.z.iso.datetime(),sK=nT.z.object({id:(0,nD.f)("ship"),name:nI.z.string()}),sG=nT.z.object({valueId:(0,nD.f)("labelValue"),key:nI.z.string().nullable(),value:nI.z.string().nullable()}),sX=nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("ship"),ship:sK}),nT.z.object({kind:nA.z.literal("type"),type:nI.z.string()}),nT.z.object({kind:nA.z.literal("meeting"),meetingId:(0,nD.f)("meeting")}),nT.z.object({kind:nA.z.literal("label"),values:nq.z.array(sG).readonly()})]),sQ=nT.z.object({shipId:(0,nD.f)("ship")}),sJ=sv.extend({report:nZ.extend({detailsBytes:nL.z.int().min(0).nullable()}).nullable(),crewRequest:sm.M.nullable(),commissionedAt:s_,crewedSince:s_.nullable(),removedAt:s_.nullable(),inFlightDeliveries:nL.z.int().min(0),openDeliveries:nL.z.int().min(0),owner:sK.nullable(),commissionedByShipId:(0,nD.f)("ship").nullable(),statement:sH,openAlerts:nq.z.array(st),expectations:sa});nO.z.union([sJ,sj]);let sZ=nT.z.object({seq:nS.z.number().int().positive(),id:(0,nD.f)("event"),type:sl.Q,occurredAt:s_,actor:sK.nullable(),signedInAccountId:sn.f.nullable(),ship:sK.nullable(),message:nT.z.object({id:(0,nD.f)("message"),sender:sK,recipient:sX,contentType:nI.z.string(),isPing:nR.z.boolean(),model:nI.z.string().nullable()}).nullable(),details:nH.z.record(nI.z.string(),nO.z.union([nI.z.string(),nS.z.number(),nR.z.boolean(),sr.null()]))});sQ.extend((0,nV.G)((0,nD.f)("event")).shape),(0,nV._)(sZ,(0,nD.f)("event"));let sY=nT.z.object({id:(0,nD.f)("message"),sender:sK,recipient:sX,inReplyTo:(0,nD.f)("message").nullable(),sentAt:s_,contentType:nI.z.string(),model:nI.z.string().nullable(),preview:nI.z.string(),isPayloadUnreadable:nR.z.boolean(),isPayloadSealed:nR.z.boolean(),delivery:nT.z.object({id:(0,nD.f)("delivery"),state:sl.h,claimedBy:sK.nullable(),isPulled:nR.z.boolean()})});sQ.extend((0,nV.G)((0,nD.f)("message")).shape),(0,nV._)(sY,(0,nD.f)("message"));let s0=nT.z.object({messageId:(0,nD.f)("message")}),s1=nN.z.enum(["notConfirmed","idle","busy"]),s2=nN.z.enum(["released","retired","deregistered","takenOver","signedOut","passwordReset","accountCutOff"]);nN.z.enum(["trierarch","pluginWatcher","personApp","gateway","adapter"]);let s5=nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("trierarch"),trierarch:sK}),nT.z.object({kind:nA.z.literal("pluginWatcher")}),nT.z.object({kind:nA.z.literal("personApp")}),nT.z.object({kind:nA.z.literal("gateway")}),nT.z.object({kind:nA.z.literal("adapter")})]),s6=nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("fleet")}),...s5.options,nT.z.object({kind:nA.z.literal("agent")})]),s3=nT.z.object({seq:nS.z.number().int().positive(),type:nN.z.enum(["MessageAccepted","DeliveryReceived","DeliveryHanded","DeliveryReturned","DeliveryAcknowledged","DeliveryHandled","DeliveryNotHandled","DeliveryOverdue","DeliveryUndeliverable","DeliveryAbandoned","DeliveryDismissed"]),occurredAt:s_,ship:sK.nullable(),location:nT.z.object({kind:sl.p,description:nI.z.string().nullable()}).nullable(),harness:nI.z.string().nullable(),attempts:nS.z.number().int().nonnegative().nullable(),by:s5.nullable(),handOverNumber:nL.z.int().min(1).nullable(),channel:nI.z.string().nullable(),isAgain:nR.z.boolean(),isOnceMore:nR.z.boolean(),overdue:nT.z.object({clock:s1,minutes:nL.z.int().min(1)}).nullable(),leaseEnd:s2.nullable()}),s8=nT.z.object({holder:s6.nullable(),since:s_,isPulled:nR.z.boolean(),overdue:nT.z.object({clock:s1,minutes:nL.z.int().min(1),toldAt:s_}).nullable(),lease:nT.z.object({by:s5.nullable(),isEnded:nR.z.boolean(),turn:nT.z.object({turn:sW,at:s_}).nullable()}).nullable(),crew:nT.z.object({status:sm.u,attempt:nL.z.int().min(0),startedAt:s_.nullable()}).nullable()}),s4=nT.z.object({id:(0,nD.f)("message"),sender:sK,sentAt:s_}),s7=nT.z.object({id:(0,nD.f)("delivery"),ship:sK.nullable(),state:sl.h,since:s_,progress:nZ.pick({state:!0,note:!0,step:!0,reportChangedAt:!0}).nullable()});sY.omit({preview:!0,delivery:!0}).extend({payload:nI.z.string(),replies:nq.z.array(s4),delivery:nT.z.object({id:(0,nD.f)("delivery"),state:sl.h,attempts:nS.z.number().int().nonnegative(),claimedBy:sK.nullable(),way:s8,history:nq.z.array(s3)}),deliveryCount:nL.z.int().min(0),progress:nZ.pick({state:!0,note:!0,step:!0,reportChangedAt:!0}).nullable()}),s0.extend((0,nV.G)((0,nD.f)("delivery")).shape),(0,nV._)(s7,(0,nD.f)("delivery")),nT.z.object({lease:nT.z.object({by:s5.nullable(),turn:nT.z.object({turn:sW,at:s_}).nullable()}).nullable(),waiting:nL.z.int().min(0),oldest:nT.z.object({messageId:(0,nD.f)("message"),sentAt:s_,contentType:nI.z.string(),delivery:nT.z.object({id:(0,nD.f)("delivery"),state:sl.h,attempts:nL.z.int().min(0),way:s8})}).nullable()});let s9=nk.z.iso.datetime(),ie=["active","paused","ended","cancelled"],it=nN.z.enum(ie),is=nN.z.enum(["skip","retry","pause"]),ii=nN.z.enum(["each","once","skip"]),ia=nI.z.string().refine(e=>void 0!==nP(e),"A duration is ISO 8601 of weeks, or days, hours, minutes and seconds, such as PT30M or P1D"),ir=nk.z.iso.datetime({offset:!0}),il={start:ir.optional(),end:ir.optional(),count:nS.z.number().int().optional()},id=nC.z.discriminatedUnion("kind",[n$.z.strictObject({kind:nA.z.literal("once"),at:ir}),n$.z.strictObject({kind:nA.z.literal("every"),every:nI.z.string(),...il}),n$.z.strictObject({kind:nA.z.literal("cron"),cron:nI.z.string(),timeZone:nI.z.string().optional(),...il})]);nT.z.object({selector:sT,payload:sR,contentType:sI.optional(),model:sS.optional(),idempotencyKey:nF,inReplyTo:(0,nD.f)("message").optional(),isForced:nR.z.boolean().optional(),timing:id,onRefused:is.optional(),retryWindow:ia.optional(),onMissed:ii.optional(),grace:ia.optional()}),nT.z.object({scheduleId:(0,nD.f)("schedule")});let io=nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("sent"),messageId:(0,nD.f)("message"),sendTime:s9,at:s9}),nT.z.object({kind:nA.z.literal("refused"),code:nI.z.string(),sendTime:s9,at:s9}),nT.z.object({kind:nA.z.literal("missed"),sendTime:s9,at:s9})]),ic={start:s9.nullable(),end:s9.nullable(),count:nS.z.number().int().nullable()},iu=nC.z.discriminatedUnion("kind",[nT.z.object({kind:nA.z.literal("once"),at:s9}),nT.z.object({kind:nA.z.literal("every"),every:nI.z.string(),...ic}),nT.z.object({kind:nA.z.literal("cron"),cron:nI.z.string(),timeZone:nI.z.string(),...ic})]),im=nO.z.union([nT.z.object({kind:nA.z.literal("ship"),shipId:(0,nD.f)("ship")}),nT.z.object({kind:nA.z.literal("ship"),name:nI.z.string()}),nT.z.object({kind:nA.z.literal("type"),type:nI.z.string()}),nT.z.object({kind:nA.z.literal("label"),valueIds:nq.z.array((0,nD.f)("labelValue")),values:nq.z.array(sG).optional()})]),ip=nT.z.object({scheduleId:(0,nD.f)("schedule"),shipId:(0,nD.f)("ship"),state:it,selector:im,contentType:nI.z.string(),inReplyTo:(0,nD.f)("message").nullable(),isForced:nR.z.boolean(),timing:iu,onRefused:is,retryWindow:nI.z.string(),onMissed:ii,grace:nI.z.string(),nextSendTime:s9.nullable(),lastOutcome:io.nullable(),createdAt:s9,endedAt:s9.nullable(),cancelledAt:s9.nullable()});(0,nV.G)((0,nD.f)("schedule")).extend({states:nq.z.array(it).min(1).optional()}).extend({shipId:(0,nD.f)("ship")}),(0,nV._)(ip,(0,nD.f)("schedule")),nT.z.object({scheduleId:(0,nD.f)("schedule")}),nT.z.object({scheduleId:(0,nD.f)("schedule"),state:nA.z.literal("paused")}),nT.z.object({scheduleId:(0,nD.f)("schedule")}),nT.z.object({scheduleId:(0,nD.f)("schedule"),state:nN.z.enum(["active","ended"])}),nT.z.object({scheduleId:(0,nD.f)("schedule")}),nT.z.object({scheduleId:(0,nD.f)("schedule"),state:nA.z.literal("cancelled")});var ih=e.i(621482),ig=e.i(954616),ix=e.i(912598),ib=e.i(731877),iv=e.i(427702);function ij(){let e=(0,iv.I)(),t=(0,ix.d)();return async()=>{await Promise.all([t.invalidateQueries(e.fleet.schedules.pathFilter()),t.invalidateQueries(e.fleet.shipTimeline.pathFilter())])}}function iy(e,t){var n,s,i;let a;return{scheduleId:e.scheduleId,state:e.state,recipient:"type"===(n=e.selector).kind?`To ${(0,S.R)(n)}`:"label"===n.kind?`To every ship carrying ${(0,S.L)(n.values??n.valueIds.map(e=>({valueId:e,key:null,value:null})))}`:"name"in n?`To ${n.name}`:`To ${n.shipId}`,timing:"once"===(s=e.timing).kind?`Once, ${(0,w.B)(new Date(s.at))}`:["every"===s.kind?`Every ${void 0===(a=nP(i=s.every))||a<6e4?i:(0,w.m)(new Date(0),new Date(a))}`:`Cron ${s.cron}, ${s.timeZone}`,...null===s.end?[]:[`until ${(0,w.B)(new Date(s.end))}`],...null===s.count?[]:[`at most ${(0,z.v)(s.count,{one:"send",many:"sends"})}`]].join(", "),nextSend:null===e.nextSendTime?void 0:`Next ${(0,w.B)(new Date(e.nextSendTime))}`,lastOutcome:function(e,t){if(null===e)return;let n=(0,w.W)(new Date(e.at),t);switch(e.kind){case"sent":return{text:`Sent ${n}`,messageId:e.messageId};case"refused":return{text:`Refused ${n}: ${e.code}`};case"missed":return{text:`Missed the send time ${(0,w.B)(new Date(e.sendTime))}`}}}(e.lastOutcome,t),canPause:"active"===e.state,canCancel:"active"===e.state||"paused"===e.state}}var iw=e.i(368066),iz=e.i(348184);function ik({schedule:e,onOpenChange:n,isPending:s,error:i,onConfirm:a}){return(0,t.jsx)(iw.AlertDialog,{open:void 0!==e,onOpenChange:e=>{s||n(e)},children:(0,t.jsxs)(iw.AlertDialogContent,{"data-testid":"cancel-schedule-dialog",className:iz.f.phoneSheet,children:[(0,t.jsxs)(iw.AlertDialogHeader,{children:[(0,t.jsx)(iw.AlertDialogTitle,{children:"Cancel this schedule?"}),(0,t.jsx)(iw.AlertDialogDescription,{children:void 0===e?null:`${e.recipient}: ${e.timing}. It sends nothing more, and it cannot be resumed: its ship schedules anew to send again.`})]}),void 0===i?null:(0,t.jsx)(x.f,{title:"Couldn’t cancel the schedule",description:`${i}. Nothing changed: try again.`}),(0,t.jsxs)(iw.AlertDialogFooter,{children:[(0,t.jsx)(iw.AlertDialogClose,{render:(0,t.jsx)(p.f,{disabled:s}),children:"Keep it"}),(0,t.jsx)(p.f,{variant:"destructive",isLoading:s,"data-testid":"cancel-schedule-confirm",onClick:a,children:s?"Cancelling…":"Cancel schedule"})]})]})})}var iN=e.i(106501);let iI={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};iI.node;let iS=(0,r.f)(iI);function iC({row:e,isPausing:n,pauseError:s,onPause:i,onCancel:a,onOpenMessage:r}){let l=e.lastOutcome;return(0,t.jsxs)("li",{"data-testid":"ship-schedule","data-schedule-id":e.scheduleId,className:"flex flex-col gap-2 border-b border-border px-3.5 py-3 last:border-b-0",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-body text-foreground max-sm:text-body-touch",children:e.recipient}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:e.timing}),(0,t.jsxs)("span",{className:"flex flex-wrap gap-x-3 text-meta text-muted-foreground tabular-nums",children:[void 0===e.nextSend?null:(0,t.jsx)("span",{children:e.nextSend}),void 0===l?(0,t.jsx)("span",{children:"Nothing sent yet"}):void 0===l.messageId?(0,t.jsx)("span",{"data-testid":"ship-schedule-outcome",children:l.text}):(0,t.jsx)("button",{type:"button","data-testid":"ship-schedule-outcome",className:"underline-offset-2 hover:text-foreground hover:underline",onClick:()=>{void 0!==l.messageId&&r(l.messageId)},children:l.text})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f.T,{status:e.state}),e.canPause?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(iS,{"aria-hidden":!0}),isLoading:n,"data-testid":"ship-schedule-pause",onClick:()=>{i(e.scheduleId)},children:n?"Pausing…":"Pause"}):null,e.canCancel?(0,t.jsx)(p.f,{size:"sm",variant:"destructive",icon:(0,t.jsx)(V.f,{"aria-hidden":!0}),disabled:n,"data-testid":"ship-schedule-cancel",onClick:()=>{a(e.scheduleId)},children:"Cancel"}):null]})]}),void 0===s?null:(0,t.jsx)(x.f,{title:"Couldn’t pause the schedule",description:`${s}. Nothing changed: try again.`})]})}function i$({schedules:e,state:n,onRetry:s,more:i,now:a,pausingId:r,pauseError:l,onPause:d,onCancel:o,onOpenMessage:c}){return"loading"===n?(0,t.jsx)(m.f,{variant:"list",rows:3,label:"Loading the schedules"}):"error"===n?(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)(x.f,{title:"Couldn’t load the schedules",description:"The rest of the page is current. Try again in a moment."}),s?(0,t.jsx)(p.f,{size:"sm",icon:(0,t.jsx)(u.f,{"aria-hidden":!0}),onClick:s,className:"self-start",children:"Try again"}):null]}):0!==e.length||i?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)("ol",{"aria-label":"Schedules",className:"overflow-hidden rounded-lg border border-border bg-card",children:e.map(e=>(0,t.jsx)(iC,{row:iy(e,a),isPausing:r===e.scheduleId,pauseError:l?.scheduleId===e.scheduleId?l.message:void 0,onPause:d,onCancel:o,onOpenMessage:c},e.scheduleId))}),i]}):(0,t.jsx)(g.f,{variant:"section",icon:(0,t.jsx)(iN.f,{}),title:"No schedules",description:"Messages this ship schedules appear here, with what each last sent."})}function iA({shipId:e,now:n,onOpenMessage:i}){let a,r,l,d,o,c=(a=(0,iv.I)(),(0,ib.d)((0,ih.f)(a.fleet.schedules.infiniteQueryOptions({shipId:e,limit:ib.q,states:[...ie]},{getNextPageParam:ib.J})))),u=(r=(0,iv.I)(),l=ij(),(0,ig.f)(r.fleet.pauseSchedule.mutationOptions({onSuccess:l}))),m=(d=(0,iv.I)(),o=ij(),(0,ig.f)(d.fleet.cancelSchedule.mutationOptions({onSuccess:o}))),[p,h]=(0,s.useState)(),[g,x]=(0,s.useState)(),[f,b]=(0,s.useState)(),[v,j]=(0,s.useState)(),y=c.items?.find(e=>e.scheduleId===f);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i$,{schedules:c.items??[],state:c.isFailed?"error":c.items?"ready":"loading",onRetry:c.retry,more:c.hasMore?(0,t.jsx)(t2.f,{what:"older schedules",isLoading:c.isLoadingMore,isFailed:c.isLoadMoreFailed,onLoad:c.loadMore,area:"ship-schedules"}):null,now:n,pausingId:u.isPending?p:void 0,pauseError:g,onPause:e=>{x(void 0),h(e),u.mutate({scheduleId:e},{onSuccess:()=>{(0,E.showToast)({title:"Schedule paused",description:"It sends nothing until its ship resumes it.",tone:"success"})},onError:t=>{x({scheduleId:e,message:t.message})}})},onCancel:e=>{j(void 0),b(e)},onOpenMessage:i}),(0,t.jsx)(ik,{schedule:void 0===y?void 0:iy(y,n),isPending:m.isPending,error:v,onOpenChange:e=>{e||b(void 0)},onConfirm:()=>{void 0!==f&&(j(void 0),m.mutate({scheduleId:f},{onSuccess:()=>{b(void 0),(0,E.showToast)({title:"Schedule cancelled",description:"It sends nothing more.",tone:"success"})},onError:e=>{j(e.message)}}))}})]})}let iT=(0,R.f)(()=>e.A(665030).then(e=>e.MessageSheet),e=>e.isOpen);e.s(["ShipPageFor",0,function({shipId:e,tab:r,messageId:l}){let d,o=(0,n.useRouter)(),c=(0,nt.f)(),u=(0,nn.f)(),m=(0,ns.f)(),p=(0,nl.u)(e),h=(0,nl.l)(e),g=(d=[...new Set((h.items??[]).flatMap(e=>null===e.signedInAccountId?[]:[e.signedInAccountId]))].sort(),(0,t3.f)({queryKey:["account-names",...d],queryFn:()=>(0,t8.f)({read:"account-names",input:{accountIds:d}}),enabled:d.length>0}).data??{}),x=(0,nl.e)(e),f=(0,nl.v)(l),b=(0,nl.d)(f.data?.recipient.kind==="label"||f.data?.recipient.kind==="meeting"?f.data.id:void 0),v=(0,nl.j)(e),j=(0,na.f)(),z=(0,ni._)(),k=(0,t6.f)().data?.retention.keptFrom??null,N=(0,U.t)(),I=(0,ne.f)(),S=(0,t7.y)(),C=(0,ev.p)(),A=(0,O.Q)(),[T,R]=(0,s.useState)();(0,nr.n)([p.error,h.error,x.error,f.error,b.error,I.error]);let q=t=>{let n,s;o.replace((n=new URLSearchParams,t.tab!==ny&&n.set("tab",t.tab),void 0!==t.messageId&&n.set("message",t.messageId),""===(s=n.toString())?`/ships/${e}`:`/ships/${e}?${s}`),{scroll:!1})},D=e=>{q({tab:r,messageId:e})},M="NOT_FOUND"===(0,t9.N)(p.error)||null===p.data,P=v.data&&p.data?.kind==="agent"?function(e,t){let{now:n,machines:s=[]}=t;if(null===e.lease)return{lines:[],oldest:null};let{by:i,turn:a}=e.lease,r=0===e.waiting?[{icon:"time",tone:"neutral",text:"Nothing waiting"}]:[];return{lines:[null===i?{icon:"pull",tone:"neutral",text:"Pull: nobody wakes it"}:{...(0,y.s)(i),tone:"neutral"},...function(e,t){if(e?.kind!=="trierarch")return[];let n=t.machines.find(t=>t.shipId===e.trierarch.id);if(!n?.isSilent)return[];let s=null===n.lastSeenAt?"":` since ${(0,w.l)(new Date(n.lastSeenAt),t.now)}`;return[{icon:"silent",tone:"attention",text:`Trierarch on ${e.trierarch.name} silent${s}`}]}(i,{now:n,machines:s}),...function(e,t){if(null===e)return[];let n=(0,w.l)(new Date(e.at),t);return"busy"===e.turn?[{icon:"busy",tone:"active",text:`Busy since ${n}`}]:[{icon:"idle",tone:"neutral",text:`Idle since ${n}`}]}(a,n),...r],oldest:function(e,t){let{oldest:n,waiting:s}=e;if(null===n)return null;let{state:i,way:a}=n.delivery,r=[(0,w.W)(new Date(a.since),t).toLowerCase()];return"handed"===i&&r.push(a.isPulled?"not acknowledged":"not confirmed"),a.overdue&&r.push(`argo told at ${String(a.overdue.minutes)} min`),s>1&&r.push(`oldest of ${String(s)}`),{messageId:n.messageId,status:(0,y.C)({state:i,isPulled:a.isPulled}),isOverdue:null!==a.overdue,text:r.join(" · ")}}(e,n)}}(v.data,{now:c,machines:N.data??[]}):void 0,F=p.data?function(e){if(!e.isSealed)return;let{gateway:t}=e;return t?.shipId!==void 0&&"app"===e.ship.kind&&e.ship.commissionedByShipId===t.shipId?{as:"proxyShip",gateway:t}:e.leaseBy?.kind==="gateway"?{as:"crew",gateway:t??{name:ti}}:void 0}({isSealed:void 0!==j.data&&"none"!==j.data.state,ship:p.data,leaseBy:v.data?.lease?.by??null,gateway:function(e){if(void 0!==e&&"none"!==e.state)return null!==e.ship?e.ship:null===e.lastShipId?void 0:{shipId:e.lastShipId,name:ti}}(z.data)}):void 0,L=(0,ek.R)(C.data??[]).get(e),B=r!==nz||A.canManage?r:ny;return(0,t.jsx)(t4.f,{switcher:S.switcher,account:S.account,onCompose:S.onCompose,onSearch:S.onSearch,banner:S.banner,title:p.data?.name??"Ship",parents:L?[{href:"/squadrons",label:"Squadrons"},{href:`/squadrons/${L.squadronId}`,label:L.squadronId}]:[{href:"/",label:"Fleet overview"}],live:I.live,header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(te,{ship:p.data??void 0,shipId:e,state:M?"not-found":p.data?"ready":"loading",now:c,viewerFleetId:u,actions:p.data?(0,t.jsx)(eC.f,{ship:p.data,compose:a.f,crewLineFlow:e$.R}):void 0,crewRequest:p.data?(0,t.jsx)(ez,{ship:p.data,timeline:h.items??[],now:c}):void 0,labels:p.data?(0,t.jsx)(tb,{ship:p.data}):void 0,isPluginShip:m.has(e),way:P&&v.data?.lease?(0,t.jsx)(ts,{view:P,onOpenMessage:D}):void 0,gatewayReader:F}),M?null:(0,t.jsx)(eS,{shipId:e,now:c}),M?null:(0,t.jsx)(nv,{shipId:e})]}),sheet:(0,t.jsx)(iT,{message:f.data,messageId:l,state:"NOT_FOUND"===(0,t9.N)(f.error)?"not-found":f.data?"ready":"loading",isOpen:void 0!==l,now:c,machines:N.data??[],deliveries:(0,t.jsx)(t1.f,{deliveries:b.items??[],state:b.isFailed?"error":b.items?"ready":"loading",onRetry:b.retry,more:b.hasMore?(0,t.jsx)(t2.f,{what:"more deliveries",isLoading:b.isLoadingMore,isFailed:b.isLoadMoreFailed,onLoad:b.loadMore,area:"message-deliveries"}):null,now:c}),onOpenMessage:D,onOpenChange:e=>{e||q({tab:r})},onReply:A.canSend?e=>{R({messageId:e.id,sender:e.sender})}:void 0}),children:(0,t.jsxs)(t.Fragment,{children:[M?null:(0,t.jsxs)(i.Tabs,{value:B,onValueChange:e=>{var t;q({tab:(t="string"==typeof e?e:void 0)===nw||t===nz?t:ny,messageId:l})},children:[(0,t.jsxs)(i.TabsList,{variant:"line","aria-label":`${p.data?.name??"Ship"} history`,children:[(0,t.jsx)(i.TabsTrigger,{variant:"line",value:ny,children:"Timeline"}),(0,t.jsx)(i.TabsTrigger,{variant:"line",value:nw,children:"Messages"}),A.canManage?(0,t.jsx)(i.TabsTrigger,{variant:"line",value:nz,children:"Schedules"}):null]}),(0,t.jsx)(i.TabsContent,{value:ny,className:"pt-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(t0,{shipId:e,entries:h.items??[],state:h.isFailed?"error":h.items?"ready":"loading",onRetry:h.retry,more:h.hasMore?(0,t.jsx)(t2.f,{what:"older events",isLoading:h.isLoadingMore,isFailed:h.isLoadMoreFailed,onLoad:h.loadMore,area:"ship-timeline"}):null,now:c,onOpenMessage:D,accountNames:g}),(0,t.jsx)(t5.f,{keptFrom:k,area:"ship-timeline"})]})}),(0,t.jsx)(i.TabsContent,{value:nw,className:"pt-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)($,{shipId:e,messages:x.items??[],state:x.isFailed?"error":x.items?"ready":"loading",onRetry:x.retry,more:x.hasMore?(0,t.jsx)(t2.f,{what:"older messages",isLoading:x.isLoadingMore,isFailed:x.isLoadMoreFailed,onLoad:x.loadMore,area:"message-threads"}):null,now:c,onOpenMessage:D}),(0,t.jsx)(t5.f,{keptFrom:k,area:"message-threads"})]})}),A.canManage?(0,t.jsx)(i.TabsContent,{value:nz,className:"pt-4",children:(0,t.jsx)(iA,{shipId:e,now:c,onOpenMessage:D})}):null]}),(0,t.jsx)(a.f,{isOpen:void 0!==T,onOpenChange:e=>{e||R(void 0)},replyTo:T})]})})}],915860)}]);
|