@aeolus-fleet/console 0.19.0 → 0.20.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/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +6 -0
- package/.next/build-manifest.json +3 -3
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +40 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/squadrons/[procedure]/route.js +1 -1
- package/.next/server/app/api/squadrons/[procedure]/route.js.nft.json +1 -1
- package/.next/server/app/api/trierarch-plugin/[procedure]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/trierarch-plugin/[procedure]/route/build-manifest.json +12 -0
- package/.next/server/app/api/trierarch-plugin/[procedure]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/trierarch-plugin/[procedure]/route.js +6 -0
- package/.next/server/app/api/trierarch-plugin/[procedure]/route.js.nft.json +1 -0
- package/.next/server/app/api/trierarch-plugin/[procedure]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/health/route.js +1 -1
- package/.next/server/app/health/route.js.nft.json +1 -1
- package/.next/server/app/inbox/page.js.nft.json +1 -1
- package/.next/server/app/inbox/page_client-reference-manifest.js +1 -1
- package/.next/server/app/labels/page/app-paths-manifest.json +3 -0
- package/.next/server/app/labels/page/build-manifest.json +20 -0
- package/.next/server/app/labels/page/next-font-manifest.json +11 -0
- package/.next/server/app/labels/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/labels/page/server-reference-manifest.json +4 -0
- package/.next/server/app/labels/page.js +14 -0
- package/.next/server/app/labels/page.js.nft.json +1 -0
- package/.next/server/app/labels/page_client-reference-manifest.js +3 -0
- package/.next/server/app/needs-attention/page.js.nft.json +1 -1
- package/.next/server/app/needs-attention/page_client-reference-manifest.js +1 -1
- package/.next/server/app/needs-crew/page/app-paths-manifest.json +3 -0
- package/.next/server/app/needs-crew/page/build-manifest.json +20 -0
- package/.next/server/app/needs-crew/page/next-font-manifest.json +11 -0
- package/.next/server/app/needs-crew/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/needs-crew/page/server-reference-manifest.json +4 -0
- package/.next/server/app/needs-crew/page.js +14 -0
- package/.next/server/app/needs-crew/page.js.nft.json +1 -0
- package/.next/server/app/needs-crew/page_client-reference-manifest.js +3 -0
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/ships/[shipId]/page.js.nft.json +1 -1
- package/.next/server/app/ships/[shipId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sign-in/failed/page.js.nft.json +1 -1
- package/.next/server/app/sign-in/failed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sign-in/page.js.nft.json +1 -1
- package/.next/server/app/sign-in/page_client-reference-manifest.js +1 -1
- package/.next/server/app/squadrons/[squadronId]/page.js.nft.json +1 -1
- package/.next/server/app/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/squadrons/blueprints/[name]/page.js.nft.json +1 -1
- package/.next/server/app/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/squadrons/connection/route.js +3 -3
- package/.next/server/app/squadrons/connection/route.js.nft.json +1 -1
- package/.next/server/app/squadrons/page.js.nft.json +1 -1
- package/.next/server/app/squadrons/page_client-reference-manifest.js +1 -1
- package/.next/server/app/squadrons/templates/[name]/page.js.nft.json +1 -1
- package/.next/server/app/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/trierarch-plugin/connection/route/app-paths-manifest.json +3 -0
- package/.next/server/app/trierarch-plugin/connection/route/build-manifest.json +12 -0
- package/.next/server/app/trierarch-plugin/connection/route/server-reference-manifest.json +4 -0
- package/.next/server/app/trierarch-plugin/connection/route.js +8 -0
- package/.next/server/app/trierarch-plugin/connection/route.js.nft.json +1 -0
- package/.next/server/app/trierarch-plugin/connection/route_client-reference-manifest.js +3 -0
- package/.next/server/app/trierarchs/[shipId]/page/app-paths-manifest.json +3 -0
- package/.next/server/app/trierarchs/[shipId]/page/build-manifest.json +20 -0
- package/.next/server/app/trierarchs/[shipId]/page/next-font-manifest.json +11 -0
- package/.next/server/app/trierarchs/[shipId]/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/trierarchs/[shipId]/page/server-reference-manifest.json +4 -0
- package/.next/server/app/trierarchs/[shipId]/page.js +14 -0
- package/.next/server/app/trierarchs/[shipId]/page.js.nft.json +1 -0
- package/.next/server/app/trierarchs/[shipId]/page_client-reference-manifest.js +3 -0
- package/.next/server/app/trierarchs/page/app-paths-manifest.json +3 -0
- package/.next/server/app/trierarchs/page/build-manifest.json +20 -0
- package/.next/server/app/trierarchs/page/next-font-manifest.json +11 -0
- package/.next/server/app/trierarchs/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/trierarchs/page/server-reference-manifest.json +4 -0
- package/.next/server/app/trierarchs/page.js +14 -0
- package/.next/server/app/trierarchs/page.js.nft.json +1 -0
- package/.next/server/app/trierarchs/page_client-reference-manifest.js +3 -0
- package/.next/server/app/version/route.js +3 -2
- package/.next/server/app/version/route.js.nft.json +1 -1
- package/.next/server/app-paths-manifest.json +6 -0
- package/.next/server/chunks/04lx_next-internal_server_app_api_trierarch-plugin_[procedure]_route_actions_0pov8t_.js +3 -0
- package/.next/server/chunks/1eui__next-internal_server_app_trierarch-plugin_connection_route_actions_1jgdi18.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0w2mqex._.js → [root-of-the-server]__14rtv1n._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1c6takz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1f7engf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1f_8ohl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1h3r48l._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1kc3njk._.js +3 -0
- package/.next/server/chunks/_0h366h9._.js +3 -0
- package/.next/server/chunks/packages_console_lib_connect-plugin_ts_197hf-1._.js +3 -0
- package/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_trierarchs_[shipId]_page_actions_0e_rw4u.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0qbhnxj._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__18derwo._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__18g_7b-._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1m1u7bl._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1uan58j._.js +3 -3
- package/.next/server/chunks/ssr/_01f7zv3._.js +3 -0
- package/.next/server/chunks/ssr/_06c6zlg._.js +3 -0
- package/.next/server/chunks/ssr/_08f4mzr._.js +3 -0
- package/.next/server/chunks/ssr/_0bmd2ey._.js +3 -0
- package/.next/server/chunks/ssr/{_0plfddz._.js → _0dogq79._.js} +2 -2
- package/.next/server/chunks/ssr/_0exrpxl._.js +3 -0
- package/.next/server/chunks/ssr/_0gt230s._.js +3 -0
- package/.next/server/chunks/ssr/_0i0_i88._.js +3 -0
- package/.next/server/chunks/ssr/_0mob-i2._.js +3 -0
- package/.next/server/chunks/ssr/_0n4kirm._.js +3 -0
- package/.next/server/chunks/ssr/_0rvujxo._.js +3 -0
- package/.next/server/chunks/ssr/{_00yiulp._.js → _0s2b6hb._.js} +2 -2
- package/.next/server/chunks/ssr/{_050suap._.js → _0sko-kt._.js} +2 -2
- package/.next/server/chunks/ssr/_0snpwr0._.js +3 -0
- package/.next/server/chunks/ssr/_0t1jjxf._.js +1 -1
- package/.next/server/chunks/ssr/_0udw2gs._.js +3 -0
- package/.next/server/chunks/ssr/{_0-rsrfr._.js → _0wtj0e-._.js} +2 -2
- package/.next/server/chunks/ssr/_0xi2v5k._.js +3 -0
- package/.next/server/chunks/ssr/{_0igx2qf._.js → _0xvm1ng._.js} +2 -2
- package/.next/server/chunks/ssr/_0ziovn_._.js +3 -0
- package/.next/server/chunks/ssr/_1442xyx._.js +3 -0
- package/.next/server/chunks/ssr/_16jiag3._.js +3 -0
- package/.next/server/chunks/ssr/_181kpys._.js +3 -0
- package/.next/server/chunks/ssr/_19e0e-9._.js +3 -3
- package/.next/server/chunks/ssr/_1bqclkf._.js +3 -0
- package/.next/server/chunks/ssr/_1cn9_0f._.js +3 -0
- package/.next/server/chunks/ssr/_1d6cgif._.js +3 -0
- package/.next/server/chunks/ssr/_1g2wuzd._.js +1 -1
- package/.next/server/chunks/ssr/_1hcta3c._.js +3 -0
- package/.next/server/chunks/ssr/_1kv8ma5._.js +3 -0
- package/.next/server/chunks/ssr/{_1s07u90._.js → _1lu1eda._.js} +2 -2
- package/.next/server/chunks/ssr/_1ntb2un._.js +3 -0
- package/.next/server/chunks/ssr/_1ommvbv._.js +3 -0
- package/.next/server/chunks/ssr/_1oofkty._.js +3 -0
- package/.next/server/chunks/ssr/_1oqoc4e._.js +3 -0
- package/.next/server/chunks/ssr/_1r6ce_7._.js +3 -0
- package/.next/server/chunks/ssr/_1tsejml._.js +3 -0
- package/.next/server/chunks/ssr/{_1s8-j5t._.js → _1ub6rp3._.js} +2 -2
- package/.next/server/chunks/ssr/_20pku2-._.js +3 -0
- package/.next/server/chunks/ssr/packages_console_023iioa._.js +3 -0
- package/.next/server/chunks/ssr/packages_console_03isfmy._.js +3 -0
- package/.next/server/chunks/ssr/packages_console_0lv43wr._.js +3 -0
- package/.next/server/chunks/ssr/packages_console_10fqil_._.js +1 -1
- package/.next/server/chunks/ssr/packages_console__next-internal_server_app_labels_page_actions_0-7_20w.js +3 -0
- package/.next/server/chunks/ssr/packages_console__next-internal_server_app_needs-crew_page_actions_0rw7fgn.js +3 -0
- package/.next/server/chunks/ssr/packages_console__next-internal_server_app_trierarchs_page_actions_1zds6hw.js +3 -0
- package/.next/server/chunks/ssr/packages_console_app_inbox_page_tsx_1bpmlpx._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_labels_page_tsx_0xxovjk._.js +3 -0
- package/.next/server/chunks/ssr/packages_console_app_needs-attention_page_tsx_1agfico._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_page_tsx_16ln4px._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_providers_tsx_06ai92n._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_settings_page_tsx_1zqt7sk._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_ships_[shipId]_page_tsx_0fudjay._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_squadrons_[squadronId]_page_tsx_1umxs1g._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_squadrons_page_tsx_1w6ym6z._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_app_trierarchs_[shipId]_page_tsx_1rqyoj3._.js +3 -0
- package/.next/server/chunks/ssr/{packages_console_components_1_4zc74._.js → packages_console_components_1-5gwzg._.js} +2 -2
- package/.next/server/chunks/ssr/packages_console_components_atoms_select_tsx_1v_3j3i._.js +1 -1
- package/.next/server/chunks/ssr/packages_console_lib_crew-settings-form_ts_1_mrtph._.js +3 -0
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +16 -0
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/00pjrzynt0in-.js +1 -0
- package/.next/static/chunks/038sk3qwghvto.js +1 -0
- package/.next/static/chunks/{1cbzjk-qf984o.js → 0e6zs-5ou_ra4.js} +1 -1
- package/.next/static/chunks/0ez9e35zkfaz5.js +1 -0
- package/.next/static/chunks/0f5-vxw1bk8ym.js +1 -0
- package/.next/static/chunks/0vlyibw4rexm7.js +1 -0
- package/.next/static/chunks/{2ff-56ohrio7h.js → 0z1nza3zgavbi.js} +1 -1
- package/.next/static/chunks/16o3i61aw3cj2.js +1 -0
- package/.next/static/chunks/177iv_tzmr_0a.js +1 -0
- package/.next/static/chunks/17quvh6filhxh.js +1 -0
- package/.next/static/chunks/19x_u3cmb9s_j.js +1 -0
- package/.next/static/chunks/1auwxv_urmljv.js +1 -0
- package/.next/static/chunks/1mbia-jrmgpuu.js +1 -0
- package/.next/static/chunks/1zuzmwfsw_7q0.js +1 -0
- package/.next/static/chunks/{2z2hhi291ems4.js → 21jwgqx67q8ql.js} +12 -12
- package/.next/static/chunks/26dg2z_6kosr0.js +1 -0
- package/.next/static/chunks/2_txjvbug4b86.js +1 -0
- package/.next/static/chunks/2c1daktq2hun-.css +3 -0
- package/.next/static/chunks/{04p19br-6pr3q.js → 2k5tcu7bvrhet.js} +1 -1
- package/.next/static/chunks/2ne-qdcv-7ck1.js +1 -0
- package/.next/static/chunks/2r01e5tqyyrsv.js +1 -0
- package/.next/static/chunks/{0hl9b82m3b_kf.js → 2zu1o4z0tmf0-.js} +1 -1
- package/.next/static/chunks/{22wd2oyjf0iq_.js → 30ux5-xn650iq.js} +1 -1
- package/.next/static/chunks/32oc7qg77tpjj.js +1 -0
- package/.next/static/chunks/36_a72wj7_f-y.js +1 -0
- package/.next/static/chunks/39-cyg4qvxgbm.js +1 -0
- package/.next/static/chunks/3b5uomyz3knol.js +1 -0
- package/.next/static/chunks/3e1veij7vs6ao.js +1 -0
- package/.next/static/chunks/3eaxbdj-y982h.js +1 -0
- package/.next/static/chunks/{0nchi43nyih52.js → 3evbxrltn9tcu.js} +1 -1
- package/.next/static/chunks/3jsj5ozfio3me.js +1 -0
- package/.next/static/chunks/3pkfx52bufv4g.js +1 -0
- package/.next/static/chunks/{2quoh5csh67oz.js → 3t2amxc2hojri.js} +1 -1
- package/.next/static/chunks/3x_52f9if0z-8.js +1 -0
- package/.next/static/chunks/42y_hgylfwlq5.js +1 -0
- package/README.md +1 -0
- package/package.json +3 -3
- package/.next/server/chunks/[root-of-the-server]__0eg7gro._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11ajlfh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1w1vtvn._.js +0 -3
- package/.next/server/chunks/_1mul6_v._.js +0 -3
- package/.next/server/chunks/ssr/_01eh2h5._.js +0 -3
- package/.next/server/chunks/ssr/_05wjy-d._.js +0 -3
- package/.next/server/chunks/ssr/_09pq8b7._.js +0 -3
- package/.next/server/chunks/ssr/_0_6abve._.js +0 -3
- package/.next/server/chunks/ssr/_0aqa8e3._.js +0 -3
- package/.next/server/chunks/ssr/_0c1ebla._.js +0 -3
- package/.next/server/chunks/ssr/_0g98qoq._.js +0 -3
- package/.next/server/chunks/ssr/_0k0kffc._.js +0 -3
- package/.next/server/chunks/ssr/_0ksc8ky._.js +0 -3
- package/.next/server/chunks/ssr/_0nxk8e5._.js +0 -3
- package/.next/server/chunks/ssr/_0sh180u._.js +0 -3
- package/.next/server/chunks/ssr/_0vz-_zq._.js +0 -3
- package/.next/server/chunks/ssr/_0y_ez3b._.js +0 -3
- package/.next/server/chunks/ssr/_0zz00ec._.js +0 -3
- package/.next/server/chunks/ssr/_101_mtq._.js +0 -3
- package/.next/server/chunks/ssr/_10vocmg._.js +0 -3
- package/.next/server/chunks/ssr/_16klr-g._.js +0 -3
- package/.next/server/chunks/ssr/_1_hm4gt._.js +0 -3
- package/.next/server/chunks/ssr/_1c2ijn5._.js +0 -3
- package/.next/server/chunks/ssr/_1jgnfkf._.js +0 -3
- package/.next/server/chunks/ssr/_1m_b36m._.js +0 -3
- package/.next/server/chunks/ssr/_1pif908._.js +0 -3
- package/.next/server/chunks/ssr/_20fp5al._.js +0 -3
- package/.next/static/chunks/05xsztb02v-3h.js +0 -1
- package/.next/static/chunks/0atm4wesk-4u8.js +0 -1
- package/.next/static/chunks/0es5vdu6lt-lm.css +0 -3
- package/.next/static/chunks/0jkliy--t1bbh.js +0 -1
- package/.next/static/chunks/0oh4dxohbk7m8.js +0 -1
- package/.next/static/chunks/0w8wux_7extu3.js +0 -1
- package/.next/static/chunks/0xdkx7wg739q7.js +0 -1
- package/.next/static/chunks/1q-shkfypoia-.js +0 -1
- package/.next/static/chunks/1t5mkoni0wrc0.js +0 -1
- package/.next/static/chunks/21py3ha_f_e3-.js +0 -1
- package/.next/static/chunks/2t6jzvnrf9ejw.js +0 -1
- package/.next/static/chunks/32-17dotvltga.js +0 -1
- package/.next/static/chunks/3m4-wgj579r4x.js +0 -1
- package/.next/static/chunks/3tsjbqptivphr.js +0 -1
- package/.next/static/chunks/42-u_9nvmdste.js +0 -1
- /package/.next/static/{4BHf_wBvFUce1tC4Uw_GD → LHmQaS8aizP80vXh3K-ws}/_buildManifest.js +0 -0
- /package/.next/static/{4BHf_wBvFUce1tC4Uw_GD → LHmQaS8aizP80vXh3K-ws}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{4BHf_wBvFUce1tC4Uw_GD → LHmQaS8aizP80vXh3K-ws}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26091,e=>{"use strict";var t=e.i(56420);let i={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};i.node;let s=(0,t.default)(i);e.s(["FileText",0,s],26091)},68997,15331,71139,73330,84156,37817,29244,88280,39844,e=>{"use strict";var t=e.i(56420);let i={name:"pen",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-2"]};i.node;let s=(0,t.default)(i);e.s(["Pen",0,s],68997);let n={name:"radio",size:24,node:[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};n.node;let a=(0,t.default)(n);e.s(["Radio",0,a],15331);let r={name:"user-x",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]};r.node;let o=(0,t.default)(r);e.s(["UserX",0,o],71139);var l=e.i(49635);e.s(["canPing",0,function(e){return"agent"===e.kind&&"crewed"===e.status},"pingLine",0,function(e,t){let i=new Date(e.sentAt);switch(e.state){case"waiting":{let e=(0,l.relativeTime)(i,t);return`Pinged ${"Just now"===e?"just now":e}, no answer yet`}case"answered":var s;let n;return null===e.answeredAt?"Answered ping":`Answered ping in ${(n=Math.max(0,(s=new Date(e.answeredAt)).getTime()-i.getTime()))<6e4?`${String(Math.round(n/1e3))} s`:(0,l.duration)(i,s)}`;case"received":return"Received, not answered with pong";case"undeliverable":return"Ping not answered: undeliverable"}}],73330),e.s(["isUnclaimedPromptOut",0,function(e){return null!==e.startingPrompt&&!e.startingPrompt.isClaimed}],84156);var d=e.i(43476),c=e.i(52886);let u={name:"file-key",size:24,node:[["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M4 12v6",key:"bg1pfk"}],["path",{d:"M4 14h2",key:"1sf9f8"}],["path",{d:"M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4",key:"d56i0q"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["file-key-2"]};u.node;let h=(0,t.default)(u);var p=e.i(58925);let m={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};m.node;let x=(0,t.default)(m);e.s(["Undo2",0,x],37817);var g=e.i(26808),f=e.i(24010),b=e.i(15905),v=e.i(94945),y=e.i(1009),j=e.i(17981);let w={release:{title:"Release",action:"Release ship",busy:"Releasing",failed:"Couldn’t release the ship",testId:"release-dialog"},recrew:{title:"Re-crew",action:"Re-crew ship",busy:"Re-crewing",failed:"Couldn’t re-crew the ship",testId:"recrew-dialog"}};e.s(["ReleaseDialog",0,function(e){let{shipName:t,sessionLocation:i,mode:s="release",isOpen:n,onOpenChange:a,isPending:r,error:o,onConfirm:l}=e,u=w[s],m=i?`The session on ${i}`:"The session crewing it";return(0,d.jsx)(f.AlertDialog,{open:n,onOpenChange:e=>{r||a(e)},children:(0,d.jsxs)(f.AlertDialogContent,{"data-testid":u.testId,className:v.dialogSurface.phoneSheet,children:[(0,d.jsxs)(f.AlertDialogHeader,{children:[(0,d.jsxs)(f.AlertDialogTitle,{children:[u.title," ",t,"?"]}),(0,d.jsxs)(f.AlertDialogDescription,{children:[m," loses this ship now."]})]}),(0,d.jsx)(y.ConsequenceList,{consequences:function(e){let{shipName:t,inFlightCount:i,mode:s="release"}=e;return[{icon:p.KeyRound,text:"Its secret and crew token stop working, so that session cannot come back."},{icon:x,text:(0,g.inFlightLine)(i)},"release"===s?{icon:c.CircleDashed,text:`${t} shows as Awaiting crew until you get a new starting prompt.`}:{icon:h,text:"A new starting prompt and its crew lines are shown once, for the new crew."}]}(e)}),void 0===o?null:(0,d.jsx)(j.InlineError,{title:u.failed,description:`${o} Nothing changed; the session still holds the ship.`}),(0,d.jsxs)(f.AlertDialogFooter,{children:[(0,d.jsx)(f.AlertDialogClose,{render:(0,d.jsx)(b.Button,{disabled:r}),children:"Cancel"}),(0,d.jsx)(b.Button,{variant:"primary",isLoading:r,onClick:l,children:r?u.busy:u.action})]})]})})}],29244),e.i(31627);var C=e.i(44827),k=e.i(85595),N=e.i(16984),S=e.i(66787),D=e.i(71645),I=e.i(90063),R=e.i(65160),M=e.i(22212),T=e.i(12470),z=e.i(91727);function L({shipName:e,activeNames:t,isPending:i,error:s,onSubmit:n}){let a=(0,D.useId)(),r=(0,D.useId)(),[o,l]=(0,D.useState)(""),c=(0,R.checkShipName)(o,{activeNames:t,current:e}),u="invalid"===c.kind||"reserved"===c.kind||"taken"===c.kind,h="available"===c.kind;return(0,d.jsxs)("form",{noValidate:!0,className:"contents",onSubmit:e=>{e.preventDefault(),h&&n(o)},children:[(0,d.jsxs)(M.DialogHeader,{children:[(0,d.jsxs)(M.DialogTitle,{children:["Rename ",e]}),(0,d.jsx)(M.DialogDescription,{children:"The ship keeps its id, inbox and history."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,d.jsx)(z.Label,{htmlFor:a,children:"New name"}),(0,d.jsxs)("span",{className:"text-caption text-muted-foreground tabular-nums",children:[o.length," / ",C.SHIP_HANDLE_MAX_LENGTH]})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(T.Input,{id:a,isMono:!0,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,placeholder:e,"data-testid":"rename-name","aria-invalid":!!u||void 0,"aria-describedby":r,className:"pr-9 max-sm:h-(--size-control-touch) max-sm:text-input-touch",value:o,onChange:e=>{l((0,R.asHandle)(e.target.value))}}),"available"===c.kind?(0,d.jsx)(k.CircleCheck,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-tone-ok-fg"}):u?(0,d.jsx)(N.CircleX,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-destructive-text"}):null]}),(0,d.jsx)("p",{id:r,"aria-live":"polite",className:(0,I.classNames)("text-meta",u?"text-destructive-text":"text-muted-foreground"),children:c.message})]}),(0,d.jsxs)("div",{className:"flex gap-2 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg p-3 text-tone-waiting-fg",children:[(0,d.jsx)(S.TriangleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon) shrink-0"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("p",{className:"text-body font-medium",children:["Ships that address ",e," by name stop reaching it"]}),(0,d.jsx)("p",{className:"text-meta text-foreground",children:"Messages already sent are unaffected, because they are stored by ship id."})]})]}),void 0===s?null:(0,d.jsx)(j.InlineError,{title:"Couldn’t rename the ship",description:`${s} Nothing changed.`}),(0,d.jsxs)(M.DialogFooter,{children:[(0,d.jsx)(M.DialogClose,{render:(0,d.jsx)(b.Button,{type:"button",disabled:i}),children:"Cancel"}),(0,d.jsx)(b.Button,{type:"submit",variant:"primary",isLoading:i,disabled:!h,"data-testid":"rename-submit",children:i?"Renaming":"Rename ship"})]})]})}e.s(["RenameDialog",0,function(e){let{isOpen:t,onOpenChange:i,isPending:s}=e;return(0,d.jsx)(M.Dialog,{open:t,onOpenChange:e=>{s||i(e)},children:(0,d.jsx)(M.DialogContent,{"data-testid":"rename-dialog",className:v.dialogSurface.phoneFullScreen,children:(0,d.jsx)(L,{...e})})})}],88280);var P=e.i(80799),A=e.i(82303),O=e.i(69374);function q({openDeliveries:e}){return 0===e?(0,d.jsxs)("p",{className:"flex items-center gap-2 rounded-lg border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-meta text-tone-ok-fg",children:[(0,d.jsx)(k.CircleCheck,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),"Its inbox is empty, so no deliveries are affected."]}):(0,d.jsxs)("div",{className:"flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg p-3 text-tone-attention-fg",children:[(0,d.jsx)(S.TriangleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon) shrink-0"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-body font-medium",children:(0,g.abandonedLine)(e)}),(0,d.jsx)("p",{className:"text-meta text-foreground",children:"Each is marked Abandoned and its sender can see that."})]})]})}function B(e){let{shipName:t,openDeliveries:i,isCrewed:s,isPending:n,error:a,onConfirm:r}=e,[l,c]=(0,D.useState)(""),u=i>0,h=!u||(0,g.isTypedMatch)(t,l);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.AlertDialogHeader,{children:[(0,d.jsxs)(f.AlertDialogTitle,{children:["Retire ",t,"?"]}),(0,d.jsx)(f.AlertDialogDescription,{children:"Retiring ends this ship for good. Its history stays available read-only. This can’t be undone."})]}),(0,d.jsx)(q,{openDeliveries:i}),(0,d.jsx)(y.ConsequenceList,{consequences:[...s?[{icon:o,text:"The session crewing it loses it now."}]:[],{icon:p.KeyRound,text:"Its secret stops working."},{icon:P.Tag,text:"It is never crewed or messaged again, and its name is free for a new ship."},{icon:A.Users,text:"Deliveries to its type stay, for the other ships of the type."}]}),u?(0,d.jsx)(O.TypedConfirm,{expected:t,value:l,onValueChange:c}):null,void 0===a?null:(0,d.jsx)(j.InlineError,{title:"Couldn’t retire the ship",description:`${a} Nothing changed.`}),(0,d.jsxs)(f.AlertDialogFooter,{children:[(0,d.jsx)(f.AlertDialogClose,{render:(0,d.jsx)(b.Button,{disabled:n}),children:"Cancel"}),(0,d.jsx)(b.Button,{variant:"destructive",isLoading:n,disabled:!h,onClick:r,children:(0,g.retireButtonLabel)(i)})]})]})}e.s(["RetireDialog",0,function(e){let{isOpen:t,onOpenChange:i,isPending:s}=e;return(0,d.jsx)(f.AlertDialog,{open:t,onOpenChange:e=>{s||i(e)},children:(0,d.jsx)(f.AlertDialogContent,{"data-testid":"retire-dialog",className:v.dialogSurface.phoneSheet,children:(0,d.jsx)(B,{...e})})})}],39844)},83035,e=>{"use strict";var t=e.i(56420);let i={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"]};i.node;let s=(0,t.default)(i);e.s(["SquareTerminal",0,s],83035)},91703,e=>{"use strict";var t=e.i(43476),i=e.i(83035),s=e.i(90063),n=e.i(61966);e.s(["CodeBlock",0,function({label:e,code:a,isWrapped:r=!1,copyValue:o,copyLabel:l=`Copy ${e.toLowerCase()}`,onCopied:d,onCopyFailed:c,codeTestId:u,copyTestId:h}){return(0,t.jsxs)("div",{"data-slot":"code-block",className:"overflow-hidden rounded-lg border border-border bg-muted",children:[(0,t.jsxs)("div",{className:"flex h-9 items-center justify-between gap-2 border-b border-border pr-1.5 pl-3",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsx)(i.SquareTerminal,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e})]}),(0,t.jsx)(n.CopyButton,{value:o??a,label:l,isLabeled:!0,onCopied:d,onCopyFailed:c,"data-testid":h})]}),(0,t.jsx)("pre",{"data-testid":u,className:(0,s.classNames)("overflow-x-auto px-3 py-3 font-mono text-code text-foreground",r?"break-all whitespace-pre-wrap":"whitespace-pre"),children:a})]})}])},61966,8734,e=>{"use strict";var t=e.i(43476),i=e.i(89664),s=e.i(56420);let n={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};n.node;let a=(0,s.default)(n);e.s(["Copy",0,a],8734);var r=e.i(71645),o=e.i(15905);e.s(["CopyButton",0,function({value:e,label:s,size:n="xs",isLabeled:l=!1,onCopied:d,onCopyFailed:c,className:u,"data-testid":h}){let[p,m]=(0,r.useState)(!1);async function x(){try{await navigator.clipboard.writeText(e)}catch{c?.();return}m(!0),d?.(),setTimeout(()=>{m(!1)},1500)}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Button,{variant:"ghost",size:n,isIconOnly:!l,"aria-label":s,title:l?void 0:s,icon:p?(0,t.jsx)(i.Check,{"aria-hidden":!0}):(0,t.jsx)(a,{"aria-hidden":!0}),className:u,"data-testid":h,onClick:()=>{x()},children:l?p?"Copied":"Copy":null}),(0,t.jsx)("span",{role:"status",className:"sr-only",children:p?"Copied.":""})]})}],61966)},75867,e=>{"use strict";var t=e.i(43476);e.s([],24305),e.i(24305);var i=e.i(71645),s=e.i(51437),n=e.i(28918),a=e.i(46376),r=e.i(2077),o=e.i(56789),l=e.i(52245),d=e.i(88015),c=e.i(40886),u=e.i(33332);let h=i.createContext(void 0),p={...e.i(75812).fieldValidityMapping,checked:e=>e?{"data-checked":""}:{"data-unchecked":""}};var m=e.i(64350),x=e.i(69690),g=e.i(81104),f=e.i(84708),b=e.i(47778),v=e.i(38489),y=e.i(75606),j=e.i(56434),w=e.i(6039);let C=i.forwardRef(function(e,u){let{checked:C,className:k,defaultChecked:N,"aria-labelledby":S,form:D,id:I,inputRef:R,name:M,nativeButton:T=!1,onCheckedChange:z,readOnly:L=!1,required:P=!1,disabled:A=!1,render:O,uncheckedValue:q,value:B,style:F,...$}=e,{clearErrors:E}=(0,f.useFormContext)(),{state:H,setTouched:U,setDirty:_,validityData:V,setFilled:G,setFocused:K,validationMode:W,disabled:X,name:J,validation:Y}=(0,x.useFieldRootContext)(),{labelId:Q}=(0,b.useLabelableContext)(),Z=X||A,ee=J??M,et=i.useRef(null),ei=(0,n.useMergedRefs)(et,R,Y.inputRef),es=i.useRef(null),en=(0,d.useBaseUiId)(),ea=(0,v.useLabelableId)({id:I}),er=T?void 0:ea,[eo,el]=(0,s.useControlled)({controlled:C,default:!!N,name:"Switch",state:"checked"});(0,g.useRegisterFieldControl)(es,en,eo,void 0,!Z,M),(0,a.useIsoLayoutEffect)(()=>{G(eo)},[eo,G]),(0,w.useValueChanged)(eo,()=>{E(ee),_(eo!==V.initialValue),Y.change(eo)});let{getButtonProps:ed,buttonRef:ec}=(0,c.useButton)({disabled:Z,native:T}),eu=function(e,t,s,n=!0,r){let[o,l]=i.useState(),c=(0,d.useBaseUiId)(r?`${r}-label`:void 0),u=e??t??o;return(0,a.useIsoLayoutEffect)(()=>{let i=e||t||!n?void 0:function(e,t){let i=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let i=e.id;if(i){let t=e.nextElementSibling;if(t&&t.htmlFor===i)return t}let s=e.labels;return s&&s[0]}(e);if(i)return!i.id&&t&&(i.id=t),i.id||void 0}(s.current,c);o!==i&&l(i)}),u}(S,Q,et,!T,er),eh={...Y.getValidationProps(Z),checked:eo,disabled:Z,form:D,id:er,name:ee,required:P,style:ee?r.visuallyHiddenInput:r.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:ei,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(L)return void e.preventDefault();let t=e.currentTarget.checked,i=(0,y.createChangeEventDetails)(j.REASONS.none,e.nativeEvent);z?.(t,i),i.isCanceled||el(t)},onClick(e){e.stopPropagation()},onFocus(){es.current?.focus()},...void 0!==B?{value:B}:o.EMPTY_OBJECT},ep=i.useMemo(()=>({...H,checked:eo,disabled:Z,readOnly:L,required:P}),[H,eo,Z,L,P]),em=(0,l.useRenderElement)("span",e,{state:ep,ref:[u,es,ec],props:[{id:T?ea:en,role:"switch","aria-checked":eo,"aria-readonly":L||void 0,"aria-required":P||void 0,"aria-labelledby":eu,onFocus(){Z||K(!0)},onBlur(){let e=et.current;e&&!Z&&(U(!0),K(!1),"onBlur"===W&&Y.commit(e.checked))},onClick(e){if(L||Z)return;e.preventDefault();let t=et.current;t&&(0,m.dispatchClickWithModifiers)(t,e)}},$,ed,e=>Y.getValidationProps(Z,e)],stateAttributesMapping:p});return(0,t.jsxs)(h.Provider,{value:ep,children:[em,!eo&&ee&&void 0!==q&&(0,t.jsx)("input",{type:"hidden",form:D,name:ee,value:q,disabled:Z}),(0,t.jsx)("input",{...eh,suppressHydrationWarning:!0})]})}),k=i.forwardRef(function(e,t){let{render:s,className:n,style:a,...r}=e,o=function(){let e=i.useContext(h);if(void 0===e)throw Error((0,u.default)(63));return e}();return(0,l.useRenderElement)("span",e,{state:o,ref:t,stateAttributesMapping:p,props:r})});e.s(["Root",0,C,"Thumb",0,k],50994);var N=e.i(50994),N=N,S=e.i(90063);e.s(["Switch",0,function({className:e,...i}){return(0,t.jsx)(N.Root,{"data-slot":"switch",className:(0,S.classNames)("peer inline-flex h-5 w-8.5 shrink-0 items-center rounded-full border border-transparent bg-input p-0.5 transition-colors duration-(--duration-fast) outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-checked:bg-primary data-disabled:opacity-45",e),...i,children:(0,t.jsx)(N.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"})})}],75867)},14732,e=>{"use strict";var t=e.i(43476),i=e.i(90063);e.s(["Table",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto rounded-lg border border-border bg-card shadow-sm",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,i.classNames)("w-full caption-bottom text-body",e),...s})})},"TableBody",0,function({className:e,...s}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,i.classNames)("[&_tr:last-child]:border-0",e),...s})},"TableCell",0,function({className:e,...s}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,i.classNames)("px-4 align-middle",e),...s})},"TableHead",0,function({className:e,...s}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,i.classNames)("px-4 text-left align-middle text-caption font-medium whitespace-nowrap text-muted-foreground",e),...s})},"TableHeader",0,function({className:e,...s}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,i.classNames)("bg-muted [&_tr]:border-b",e),...s})},"TableRow",0,function({className:e,...s}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,i.classNames)("h-(--size-row) border-b border-border transition-colors duration-(--duration-fast) hover:bg-muted has-focus-visible:outline-2 has-focus-visible:-outline-offset-2 has-focus-visible:outline-ring data-new:animate-highlight [thead_&]:h-(--size-row-header) [thead_&]:hover:bg-transparent",e),...s})}])},39448,e=>{"use strict";var t=e.i(43476),i=e.i(25913),s=e.i(22016),n=e.i(90063);let a=(0,i.cva)("min-w-0 truncate font-sans font-medium",{variants:{size:{body:"text-body text-foreground",meta:"text-meta text-muted-foreground",title:"text-title font-semibold tracking-tight text-foreground max-sm:text-title-touch"}},defaultVariants:{size:"body"}});e.s(["ShipName",0,function({name:e,shipId:i,size:r,isSuffixShown:o=!1,isOperator:l=!1,href:d,className:c}){let u=d?(0,t.jsx)(s.default,{href:d,className:(0,n.classNames)(a({size:r}),"rounded-xs underline-offset-3 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"),title:e,children:e}):(0,t.jsx)("span",{className:a({size:r}),title:e,children:e});return(0,t.jsxs)("span",{"data-slot":"ship-name",className:(0,n.classNames)("inline-flex min-w-0 items-baseline gap-1.5",c),children:[u,l?(0,t.jsx)("span",{className:"shrink-0 font-normal text-muted-foreground",children:"(you)"}):null,o&&!l?(0,t.jsxs)("span",{className:"shrink-0 font-mono text-id text-muted-foreground uppercase",children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"· "}),i.slice(-4)]}):null]})}])},1935,e=>{"use strict";var t=e.i(43476),i=e.i(60011),s=e.i(22016),n=e.i(90063);e.s(["SquadronTag",0,function({squadronId:e,role:a,size:r="md",className:o}){return(0,t.jsxs)(s.default,{href:`/squadrons/${e}`,"data-slot":"squadron-tag",className:(0,n.classNames)("inline-flex max-w-full items-center gap-1 rounded-sm bg-secondary px-1.5 text-secondary-foreground hover:underline [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0","sm"===r?"h-5.5 text-meta":"h-6 text-body",o),children:[(0,t.jsx)(i.Shapes,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate font-medium",children:e}),void 0!==a&&(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:["· ",a]})]})}])},5894,e=>{"use strict";var t=e.i(43476),i=e.i(76561),s=e.i(8734),n=e.i(86247),a=e.i(44594),r=e.i(58925),o=e.i(68997),l=e.i(15331),d=e.i(60011),c=e.i(19759),u=e.i(49319),h=e.i(57443),p=e.i(71139),m=e.i(22016),x=e.i(71645),g=e.i(5387),f=e.i(90262),b=e.i(73330),v=e.i(53573),y=e.i(86165),j=e.i(48695),w=e.i(84294),C=e.i(84156),k=e.i(15905),N=e.i(57334),S=e.i(75305),D=e.i(41880),I=e.i(44824),R=e.i(29244),M=e.i(39874),T=e.i(48287),z=e.i(88280),L=e.i(39844),P=e.i(82532);function A({action:e,className:i}){let s=e.isPrimary?"primary":e.isDestructive||"rename"===e.key?"ghost":"secondary";return void 0!==e.href?(0,t.jsx)(k.Button,{size:"xs",variant:s,nativeButton:!1,"data-testid":e.testId,className:i,render:(0,t.jsx)(m.default,{href:e.href}),children:e.label}):(0,t.jsx)(k.Button,{size:"xs",variant:s,"data-testid":e.testId,disabled:e.isDisabled,isLoading:e.isLoading,className:i,onClick:e.onSelect,children:e.label})}function O(e,t){let i=e[t-1],s=e[t];return void 0!==i&&void 0!==s&&(!0===i.isMenuOnly&&!0!==s.isMenuOnly||!0===s.isDestructive&&!0!==i.isDestructive)}function q({layout:e,ship:i,actions:s}){if("next"===e){let e=s.find(e=>"prompt"===e.key||"crew-line"===e.key&&!0===e.isPrimary);return e?(0,t.jsx)(A,{action:{...e,isPrimary:!1},className:"max-sm:h-(--size-control-touch) max-sm:w-full max-sm:text-body-touch"}):null}if("buttons"===e){let e=s.filter(e=>!0!==e.isMenuOnly);return 0===e.length?null:(0,t.jsx)("div",{className:"flex flex-wrap items-center justify-end gap-2 max-sm:justify-start",children:e.map(e=>(0,t.jsx)(A,{action:e},e.key))})}let a=(0,t.jsx)(k.Button,{size:"sheet"===e?"touch":"xs",variant:"ghost",isIconOnly:!0,"aria-label":`Actions for ${i.name}`,icon:(0,t.jsx)(n.Ellipsis,{}),"data-testid":"fleet-actions"});return"sheet"===e?(0,t.jsxs)(S.Sheet,{children:[(0,t.jsx)(S.SheetTrigger,{render:a}),(0,t.jsxs)(S.SheetContent,{side:"bottom","data-testid":"fleet-row-sheet",children:[(0,t.jsx)(S.SheetHeader,{children:(0,t.jsx)(S.SheetTitle,{children:i.name})}),(0,t.jsx)("ul",{className:"flex flex-col pb-2",children:s.map((e,i)=>(0,t.jsx)("li",{className:O(s,i)?"mt-1 border-t border-border pt-1":void 0,children:(0,t.jsxs)(S.SheetClose,{render:void 0===e.href?(0,t.jsx)("button",{type:"button",disabled:e.isDisabled,onClick:e.onSelect}):(0,t.jsx)(m.default,{href:e.href}),"data-testid":e.testId,className:`flex h-(--size-control-touch) w-full items-center gap-3 px-4 text-left text-body-touch disabled:opacity-45 [&_svg]:size-(--size-icon) [&_svg]:shrink-0 ${e.isDestructive?"text-destructive-text":"text-foreground"}`,children:[(0,t.jsx)(e.icon,{"aria-hidden":!0}),e.menuLabel.replace(/…$/,"")]})},e.key))}),(0,t.jsx)("div",{className:"px-4 pb-4",children:(0,t.jsx)(S.SheetClose,{render:(0,t.jsx)(k.Button,{size:"touch",className:"w-full"}),children:"Cancel"})})]})]}):(0,t.jsxs)(N.DropdownMenu,{children:[(0,t.jsx)(N.DropdownMenuTrigger,{render:a}),(0,t.jsx)(N.DropdownMenuContent,{children:s.map((e,i)=>(0,t.jsxs)(x.Fragment,{children:[O(s,i)?(0,t.jsx)(N.DropdownMenuSeparator,{}):null,void 0===e.href?(0,t.jsxs)(N.DropdownMenuItem,{"data-testid":e.testId,disabled:e.isDisabled,variant:e.isDestructive?"destructive":"default",onClick:e.onSelect,children:[(0,t.jsx)(e.icon,{"aria-hidden":!0}),e.menuLabel]}):(0,t.jsxs)(N.DropdownMenuItem,{"data-testid":e.testId,render:(0,t.jsx)(m.default,{href:e.href}),children:[(0,t.jsx)(e.icon,{"aria-hidden":!0}),e.menuLabel]})]},e.key))})]})}e.s(["ShipActions",0,function({ship:e,layout:n="buttons"}){var m,k;let N=(0,f.useAccess)(),[S,A]=(0,x.useState)(),[O,B]=(0,x.useState)(!1),[F,$]=(0,x.useState)(void 0),E=(0,g.useGetStartingPrompt)(),H=(0,g.useReleaseShip)(),U=(0,g.useRetireShip)(),_=(0,g.useRecrewShip)(),V=(0,g.useRenameShip)(),G=(0,g.usePingShip)(),K=(0,g.useFleetSnapshot)(),W=(0,v.useShip)("release"===S||"recrew"===S||"retire"===S||"remove"===S?e.id:void 0),X=(0,y.useSquadronsConnection)(),J=(0,j.useSquadrons)(),Y=(0,j.useRemoveMember)(),Q=J.data?.find(t=>"disbanded"!==t.state&&(t.flagship.shipId===e.id||t.members.some(t=>t.shipId===e.id))),Z=void 0!==Q&&Q.flagship.shipId!==e.id,ee=(0,v.useShip)(Z&&"retired"!==e.status?e.id:void 0),et=Q?.members.find(t=>t.shipId===e.id),ei=(0,M.useNewCrewLineFlow)(Q&&et?{squadronId:Q.id,member:et,ship:ee.data}:void 0),es="unknown"===X||"connected"===X&&!J.isFetched,en=()=>{A(void 0)},ea=E.data??_.data,er=ea?"shown":E.isError?"error":"issuing",eo=e=>()=>{H.reset(),U.reset(),_.reset(),V.reset(),Y.reset(),A(e)},el=async()=>{try{await navigator.clipboard.writeText(e.id),(0,D.showToast)({title:"Ship id copied",description:e.id,tone:"success"})}catch{(0,D.showToast)({title:"Couldn’t copy the ship id",description:e.id,tone:"error"})}},ed=Q?.flagship.shipId===e.id,ec={key:"message",label:"Message",menuLabel:"Message this ship…",icon:c.SquarePen,testId:"fleet-ship-message",onSelect:()=>{B(!0)},isMenuOnly:!0,needs:"canSend"},eu={key:"copy",label:"Copy ship id",menuLabel:"Copy ship id",icon:s.Copy,testId:"fleet-ship-copy-id",onSelect:()=>{el()},isMenuOnly:!0},eh=(0,b.canPing)(e)?[{key:"ping",label:"Ping",menuLabel:"Ping",icon:l.Radio,testId:"fleet-ship-ping",onSelect:()=>{G.mutate({shipId:e.id},{onSuccess:({isNew:t})=>{(0,D.showToast)(t?{title:`Pinged ${e.name}`,description:"Its session answers with pong on its next turn.",tone:"success"}:{title:`A ping already waits for ${e.name}`,description:"Pings never stack: this is the one shown.",tone:"info"})},onError:t=>{(0,D.showToast)({title:`Couldn’t ping ${e.name}`,description:t.message,tone:"error"})}})},isLoading:G.isPending,needs:"canManage"}]:[],ep=[];return"operator"===e.kind?ep.push({key:"inbox",label:"Open inbox",menuLabel:"Open inbox",icon:a.Inbox,testId:"fleet-ship-open-inbox",href:"/inbox",isMenuOnly:!0},eu):"retired"===e.status||"viewer"===e.kind?ep.push(eu):ed?ep.push({key:"squadron",label:"Open squadron",menuLabel:"Open squadron",icon:d.Shapes,testId:"fleet-ship-open-squadron",href:`/squadrons/${Q.id}`}):es?ep.push(ec,eu,...eh):et&&Q?(ep.push(ec,eu,...eh,{key:"crew-line",label:"Get new crew line",menuLabel:"Get new crew line…",icon:r.KeyRound,testId:"fleet-ship-new-crew-line",onSelect:ei.start,needs:"canManage",isDisabled:!ei.isReady,isPrimary:"silent"===et.health}),"crewed"===e.status&&ep.push({key:"release",label:"Release",menuLabel:"Release ship…",icon:p.UserX,testId:"fleet-ship-release",onSelect:eo("release"),needs:"canManage"}),("sailing"===Q.state||"standing-down"===Q.state)&&ep.push({key:"remove",label:"Remove from squadron",menuLabel:"Remove from squadron…",icon:u.UserMinus,testId:"fleet-ship-remove",onSelect:eo("remove"),isDestructive:!0,needs:"canManage"})):(ep.push(ec,eu),"awaitingCrew"===e.status?ep.push({key:"prompt",label:"Get starting prompt",menuLabel:"Get starting prompt…",icon:r.KeyRound,testId:"fleet-ship-prompt",onSelect:()=>{E.reset(),_.reset(),$((0,C.isUnclaimedPromptOut)(e)&&e.startingPrompt?{issuedAt:e.startingPrompt.issuedAt}:void 0),A("prompt"),E.mutate({shipId:e.id})},needs:"canManage"}):ep.push(...eh,{key:"recrew",label:"Re-crew",menuLabel:"Re-crew…",icon:h.UserPlus,testId:"fleet-ship-recrew",onSelect:eo("recrew"),needs:"canManage"},{key:"release",label:"Release",menuLabel:"Release ship…",icon:p.UserX,testId:"fleet-ship-release",onSelect:eo("release"),needs:"canManage"}),ep.push({key:"rename",label:"Rename",menuLabel:"Rename…",icon:o.Pen,testId:"fleet-ship-rename",onSelect:eo("rename"),needs:"canManage"},{key:"retire",label:"Retire",menuLabel:"Retire ship…",icon:i.Archive,testId:"fleet-ship-retire",onSelect:eo("retire"),isDestructive:!0,needs:"canManage"})),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q,{layout:n,ship:e,actions:(m=ep,k=N,m.filter(e=>void 0===e.needs||k[e.needs]))}),(0,t.jsx)(R.ReleaseDialog,{shipName:e.name,sessionLocation:null===e.location?null:e.location.description??e.location.kind.toLowerCase(),inFlightCount:W.data?.inFlightDeliveries??0,mode:"recrew"===S?"recrew":"release",isOpen:("release"===S||"recrew"===S)&&void 0!==W.data,onOpenChange:e=>{e||en()},isPending:H.isPending||_.isPending,error:("recrew"===S?_.error:H.error)?.message,onConfirm:()=>{"recrew"===S?_.mutate({shipId:e.id},{onSuccess:()=>{$(void 0),A("prompt")}}):H.mutate({shipId:e.id},{onSuccess:en})}}),(0,t.jsx)(L.RetireDialog,{shipName:e.name,openDeliveries:W.data?.openDeliveries??0,isCrewed:"crewed"===e.status,isOpen:"retire"===S&&void 0!==W.data,onOpenChange:e=>{e||en()},isPending:U.isPending,error:U.error?.message,onConfirm:()=>{U.mutate({shipId:e.id},{onSuccess:en})}}),Q&&et&&(0,t.jsx)(T.RemoveMemberDialog,{squadronId:Q.id,member:et,othersOfRole:(0,w.otherMembersOfRole)(Q,et.shipId),openDeliveries:W.data?.openDeliveries??0,inFlightDeliveries:W.data?.inFlightDeliveries??0,isOpen:"remove"===S&&void 0!==W.data,onOpenChange:e=>{e||en()},isPending:Y.isPending,error:Y.error?.message,onConfirm:()=>{Y.mutate({squadronId:Q.id,shipId:et.shipId},{onSuccess:en})}}),(0,t.jsx)(z.RenameDialog,{shipName:e.name,activeNames:(K.data??[]).filter(e=>"retired"!==e.status).map(e=>e.name),isOpen:"rename"===S,onOpenChange:e=>{e||en()},isPending:V.isPending,error:V.error?.message,onSubmit:t=>{V.mutate({shipId:e.id,name:t},{onSuccess:en})}}),(0,t.jsx)(P.StartingPromptDialog,{shipName:e.name,state:er,prompt:ea?.prompt,crewLines:ea?.crewLines,replacesUnclaimed:F,error:E.error?.message,isOpen:"prompt"===S,onOpenChange:e=>{e||(E.reset(),_.reset(),en())},onConfirm:()=>{_.reset(),E.mutate({shipId:e.id})}}),ei.dialog,O&&(0,t.jsx)(I.ComposeMessage,{isOpen:!0,onOpenChange:B,toShipId:e.id})]})}])},82532,e=>{"use strict";var t=e.i(43476),i=e.i(22768),s=e.i(10818),n=e.i(25398),a=e.i(71645),r=e.i(49635),o=e.i(15905),l=e.i(91703),d=e.i(22212),c=e.i(94945),u=e.i(19321),h=e.i(66616);function p({crewLines:e,subject:i,testIdPrefix:s,onCopied:n,onCopyFailed:a}){return e.map(({harness:e,line:r})=>(0,t.jsx)(l.CodeBlock,{label:`Crew line, ${(0,h.harnessWord)(e)} with the aeolus plugin`,code:r,isWrapped:!0,copyLabel:`Copy the ${(0,h.harnessWord)(e)} crew line for ${i}`,codeTestId:`${s}-${e}`,copyTestId:`${s}-${e}-copy`,onCopied:n,onCopyFailed:a},e))}var m=e.i(17981);function x({shipName:e,prompt:n,crewLines:r}){let[o,d]=(0,a.useState)(!1),c=()=>{d(!1)},u=()=>{d(!0)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"flex gap-2 rounded-lg border border-border bg-muted px-3 py-2 text-meta text-foreground",children:[(0,t.jsx)(s.Info,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Shown once. Copy it now."})," If you lose it, get a new one; this one then stops working."]})]}),(0,t.jsx)(l.CodeBlock,{label:`Starting prompt for ${e}`,code:n,isWrapped:!0,copyLabel:`Copy the starting prompt for ${e}`,codeTestId:"starting-prompt-text",copyTestId:"starting-prompt-copy",onCopied:c,onCopyFailed:u}),(0,t.jsx)(p,{crewLines:r,subject:e,testIdPrefix:"starting-prompt-crew-line",onCopied:c,onCopyFailed:u}),(0,t.jsx)("p",{role:"status",className:"flex items-center gap-1.5 text-meta text-destructive-text empty:hidden",children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.CircleAlert,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),"Could not copy: select the text and copy it by hand."]}):null})]})}e.s(["StartingPromptDialog",0,function(e){let{shipName:i,state:s,prompt:a,crewLines:l,replacesUnclaimed:h,error:p,isOpen:g,onOpenChange:f,onConfirm:b}=e,v="issuing"===s;return(0,t.jsx)(d.Dialog,{open:g,onOpenChange:e=>{v||f(e)},children:(0,t.jsxs)(d.DialogContent,{size:"md","data-testid":"starting-prompt-dialog",className:c.dialogSurface.phoneFullScreen,children:[(0,t.jsxs)(d.DialogHeader,{children:[(0,t.jsxs)(d.DialogTitle,{children:["Starting prompt for ",i]}),(0,t.jsxs)(d.DialogDescription,{children:["Paste it into the agent session that should crew this ship, or a crew line into Claude Code or Codex with the aeolus plugin. Any earlier prompt for ",i," stops working now."]})]}),"error"!==s&&h?(0,t.jsxs)("p",{className:"rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-meta text-tone-waiting-fg",children:["This prompt stops the one issued"," ",(0,t.jsx)("time",{dateTime:h.issuedAt,children:(0,r.shortDateTime)(new Date(h.issuedAt))})," ","working."]}):null,v?(0,t.jsxs)("div",{"aria-busy":!0,className:"flex flex-col gap-3",children:[(0,t.jsx)("span",{className:"sr-only",children:"Issuing a starting prompt..."}),(0,t.jsx)(u.Skeleton,{className:"h-10 w-full rounded-lg"}),(0,t.jsx)(u.Skeleton,{className:"h-40 w-full rounded-lg"})]}):null,"shown"===s&&void 0!==a&&void 0!==l?(0,t.jsx)(x,{shipName:i,prompt:a,crewLines:l}):null,"error"===s?(0,t.jsx)(m.InlineError,{title:"Couldn’t issue a starting prompt",description:`${p??"The server did not answer."} No new secret was created; any earlier prompt still works.`}):null,(0,t.jsxs)(d.DialogFooter,{children:["issuing"===s||"shown"===s?(0,t.jsx)(d.DialogClose,{render:(0,t.jsx)(o.Button,{variant:"primary",disabled:v}),children:"Done"}):null,"error"===s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.DialogClose,{render:(0,t.jsx)(o.Button,{}),children:"Close"}),(0,t.jsx)(o.Button,{variant:"primary",icon:(0,t.jsx)(n.RotateCw,{}),onClick:b,children:"Try again"})]}):null]})]})})}],82532)},87792,e=>{"use strict";var t=e.i(43476),i=e.i(19759),s=e.i(15905),n=e.i(77880),a=e.i(36779),r=e.i(15034),o=e.i(85538);e.s(["ListLayout",0,function({title:e,description:l,primaryAction:d,toolbar:c,live:u,nav:h,onCompose:p,onSearch:m,account:x,banner:g,children:f}){return(0,t.jsxs)("div",{className:"flex min-h-dvh bg-background",children:[(0,t.jsx)(a.Sidebar,{active:h.active,inboxCount:h.inboxCount,attentionCount:h.attentionCount,hasSquadrons:h.hasSquadrons,hasSettings:h.hasSettings,...x}),(0,t.jsxs)("div",{className:"flex min-w-0 grow flex-col",children:[(0,t.jsx)(n.Header,{breadcrumb:e,live:u,onCompose:p,onSearch:m}),g,(0,t.jsx)(o.TopBar,{title:e,live:u,account:x,onSearch:m,actions:p?(0,t.jsx)(s.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:p,children:(0,t.jsx)(i.SquarePen,{"aria-hidden":!0})}):void 0}),(0,t.jsxs)("main",{className:"flex grow flex-col gap-5 px-8 py-6 max-sm:gap-3.5 max-sm:px-4 max-sm:pt-3.5 max-sm:pb-[calc(var(--size-tabbar)+var(--spacing)*4)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 max-sm:gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)("h1",{className:"text-title font-semibold tracking-tight text-foreground max-sm:hidden",children:e}),l?(0,t.jsx)("p",{className:"text-meta text-muted-foreground max-sm:text-body-touch",children:l}):null]}),d?(0,t.jsx)("div",{className:"shrink-0 max-sm:w-full max-sm:[&>*]:w-full",children:d}):null]}),c,f]})]}),(0,t.jsx)(r.TabBar,{active:"overview"===h.active?"fleet":"settings"===h.active?void 0:h.active,hasSquadrons:h.hasSquadrons,inboxCount:h.inboxCount,attentionCount:h.attentionCount})]})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62219,e=>{"use strict";var t=e.i(43476),s=e.i(18566),n=e.i(71645),a=e.i(44824),i=e.i(45608),r=e.i(95475),l=e.i(2767),o=e.i(52886),d=e.i(66787),c=e.i(92870),u=e.i(22016),p=e.i(90063);let h={ok:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",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 m({label:e,shortLabel:s,value:n,detail:a,href:i,icon:r,tone:l,testId:o}){return(0,t.jsxs)(u.default,{href:i,"data-testid":o,className:"flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-card px-4.5 py-4 shadow-sm transition-colors duration-(--duration-fast) hover:bg-accent max-sm:gap-1.5 max-sm:rounded-xl max-sm:px-3.5 max-sm:py-3",children:[(0,t.jsxs)("span",{className:"flex items-center justify-between gap-2 text-meta font-medium text-muted-foreground",children:[(0,t.jsx)("span",{className:"max-sm:hidden",children:e}),(0,t.jsx)("span",{className:"sm:hidden",children:s??e}),(0,t.jsx)("span",{className:(0,p.classNames)("flex size-6.5 shrink-0 items-center justify-center rounded-md border max-sm:size-5.5",h[l]),children:(0,t.jsx)(r,{"aria-hidden":!0,className:"size-3.5"})})]}),(0,t.jsx)("span",{className:"text-[28px] leading-none font-semibold tracking-tight tabular-nums text-foreground max-sm:text-2xl",children:n}),(0,t.jsx)("span",{className:"truncate text-meta text-muted-foreground",children:a})]})}var x=e.i(5387),f=e.i(28459),g=e.i(96676),v=e.i(49635);function j(e){return e.filter(e=>"agent"===e.kind&&"retired"!==e.status)}function w(){var e;let s,n,a,i,r=(0,x.useFleetSnapshot)(),l=(0,f.useNeedsAttention)(),u=(0,f.useAttentionCount)(),p=(0,g.useNow)();if(!r.data)return null;let h=(a=(n=(s=j((e={ships:r.data,undeliverable:l.data??[],now:p}).ships)).filter(e=>"awaitingCrew"===e.status)).flatMap(e=>null===e.awaitingCrewSince?[]:[{name:e.name,since:new Date(e.awaitingCrewSince)}]).sort((e,t)=>e.since.getTime()-t.since.getTime())[0],i=e.undeliverable.map(e=>new Date(e.since)).sort((e,t)=>e.getTime()-t.getTime())[0],{activeCount:s.length,crewedCount:s.filter(e=>"crewed"===e.status).length,awaitingCount:n.length,longestWait:a&&{name:a.name,wait:(0,v.duration)(a.since,e.now)},oldestUndeliverable:i&&(0,v.duration)(i,e.now)});return 0===h.activeCount?null:(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4 max-sm:grid-cols-2 max-sm:gap-2.5","data-testid":"overview-metrics",children:[(0,t.jsx)(m,{label:"Ships crewed",shortLabel:"Crewed",value:h.crewedCount,detail:`of ${String(h.activeCount)} active ships`,href:"/?status=crewed",icon:c.UserCheck,tone:"ok",testId:"overview-crewed"}),(0,t.jsx)(m,{label:"Awaiting crew",value:h.awaitingCount,detail:h.longestWait?`Longest wait: ${h.longestWait.name}, ${h.longestWait.wait}`:"Every active ship is crewed",href:"/?status=awaitingCrew",icon:o.CircleDashed,tone:"waiting",testId:"overview-awaiting"}),(0,t.jsx)(m,{label:"Needs attention",value:u??0,detail:h.oldestUndeliverable?`Undeliverable deliveries, oldest ${h.oldestUndeliverable}`:"Nothing needs you",href:"/needs-attention",icon:d.TriangleAlert,tone:"attention",testId:"overview-attention"})]})}var y=e.i(77071),b=e.i(15905),S=e.i(49092),C=e.i(87600),N=e.i(16752);e.i(31627);var k=e.i(73332),T=e.i(44827),R=e.i(85595),P=e.i(16984),O=e.i(80799),I=e.i(65160),E=e.i(33173),A=e.i(22212),M=e.i(94945),L=e.i(12470),z=e.i(91727),q=e.i(75867),D=e.i(43988),H=e.i(17981),F=e.i(77435);let $={"fleet:read":"Read the fleet","fleet:manage":"Manage the fleet","crew:assign":"Assign crews","crew:run":"Run crews"};function B({activeShips:e,isPending:s,error:a,shipLimit:i,accountUrl:r,onSubmit:l}){let o=(0,n.useId)(),d=(0,n.useId)(),c=(0,n.useId)(),u=(0,n.useId)(),h=(0,n.useId)(),[m,x]=(0,n.useState)(""),[f,g]=(0,n.useState)(""),[v,j]=(0,n.useState)(""),[w,y]=(0,n.useState)([]),S=(0,I.checkShipName)(m,{activeNames:e.map(e=>e.name)}),C="invalid"===S.kind||"reserved"===S.kind||"taken"===S.kind,M=f.trim(),V=T.shipHandleSchema.safeParse(M).success,U=""!==M&&!V,_=[...new Set(e.map(e=>e.type))].sort(),W="available"===S.kind&&V&&void 0===i;return(0,t.jsxs)("form",{noValidate:!0,"data-testid":"commission-form",className:"contents",onSubmit:e=>{e.preventDefault(),W&&l({name:m,type:M,...""===v.trim()?{}:{note:v},...0===w.length?{}:{fleetScopes:[...w]}})},children:[(0,t.jsxs)(A.DialogHeader,{children:[(0,t.jsx)(A.DialogTitle,{children:"Commission a ship"}),(0,t.jsx)(A.DialogDescription,{children:"A ship is a durable agent identity with its own inbox. Next, you get the starting prompt."})]}),void 0===i?null:(0,t.jsx)(F.LimitNotice,{...(0,N.shipLimitNotice)(i),accountUrl:r,testId:"commission-ship-limit"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,t.jsx)(z.Label,{htmlFor:o,children:"Name"}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground tabular-nums",children:[m.length," / ",T.SHIP_HANDLE_MAX_LENGTH]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(L.Input,{id:o,isMono:!0,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"e.g. reviewer-02","data-testid":"commission-name","aria-invalid":!!C||void 0,"aria-describedby":d,className:"pr-9 max-sm:h-(--size-control-touch) max-sm:text-input-touch",value:m,onChange:e=>{x((0,I.asHandle)(e.target.value))}}),"available"===S.kind?(0,t.jsx)(R.CircleCheck,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-tone-ok-fg"}):C?(0,t.jsx)(P.CircleX,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-destructive-text"}):null]}),(0,t.jsx)("p",{id:d,"aria-live":"polite",className:(0,p.classNames)("text-meta",C?"text-destructive-text":"text-muted-foreground"),children:S.message})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(z.Label,{htmlFor:c,children:"Type"}),(0,t.jsx)(E.Combobox,{id:c,options:_.map(e=>({value:e,label:e})),value:""===f?null:f,onValueChange:e=>{g(e??"")},isFreeText:!0,toQuery:I.asHandle,leadingIcon:(0,t.jsx)(O.Tag,{}),placeholder:"e.g. reviewer",isInvalid:U,"aria-describedby":u,"data-testid":"commission-type"}),(0,t.jsx)("p",{id:u,className:(0,p.classNames)("text-meta",U?"text-destructive-text":"text-muted-foreground"),children:U?`Use 1 to ${String(T.SHIP_HANDLE_MAX_LENGTH)} lowercase letters, digits, hyphens or colons.`:(0,I.typeHint)(f,e.filter(e=>e.type===M).length)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(z.Label,{htmlFor:h,children:"Note (optional)"}),(0,t.jsx)(D.Textarea,{id:h,rows:2,"data-testid":"commission-note",value:v,onChange:e=>{j(e.target.value)}})]}),(0,t.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,t.jsx)("legend",{className:"mb-1.5 text-body font-medium text-foreground",children:"Fleet access"}),k.FLEET_SCOPES.map(e=>(0,t.jsxs)("label",{className:"flex items-center justify-between gap-3 text-body text-foreground",children:[(0,t.jsxs)("span",{children:[$[e]," ",(0,t.jsx)("span",{className:"font-mono text-id text-muted-foreground",children:e})]}),(0,t.jsx)(q.Switch,{checked:w.includes(e),onCheckedChange:t=>{y(s=>t?[...s,e]:s.filter(t=>t!==e))},"data-testid":`commission-${e.replace(":","-")}`})]},e)),(0,t.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."})]}),void 0===a?null:(0,t.jsx)(H.InlineError,{title:"Not commissioned",description:a}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(A.DialogClose,{render:(0,t.jsx)(b.Button,{type:"button",disabled:s}),children:"Cancel"}),(0,t.jsx)(b.Button,{type:"submit",variant:"primary",isLoading:s,disabled:!W,"data-testid":"commission-submit",children:s?"Commissioning":"Commission ship"})]})]})}function V(e){let{isOpen:s,onOpenChange:n,isPending:a}=e;return(0,t.jsx)(A.Dialog,{open:s,onOpenChange:e=>{a||n(e)},children:(0,t.jsx)(A.DialogContent,{size:"md","data-testid":"commission-dialog",className:M.dialogSurface.phoneFullScreen,children:(0,t.jsx)(B,{...e})})})}var U=e.i(82532);function _({isOpen:e,onOpenChange:s}){let a=(0,x.useFleetSnapshot)(),i=(0,S.useFleetLimits)(),r=(0,C.useHostedAccountUrl)(),l=(0,x.useCommissionShip)(),[o,d]=(0,n.useState)(!1),c=(a.data??[]).filter(e=>"retired"!==e.status);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.Button,{variant:"primary",icon:(0,t.jsx)(y.Plus,{}),"data-testid":"fleet-commission",onClick:()=>{l.reset(),s(!0)},children:"Commission ship"}),(0,t.jsx)(V,{activeShips:c,isOpen:e,onOpenChange:s,isPending:l.isPending,error:l.error?.message,shipLimit:(0,N.shipLimitReached)(i.data),accountUrl:r,onSubmit:e=>{l.mutate({...e,idempotencyKey:crypto.randomUUID()},{onSuccess:()=>{s(!1),d(!0)}})}}),(0,t.jsx)(U.StartingPromptDialog,{shipName:l.variables?.name??"",state:"shown",prompt:l.data?.prompt??void 0,crewLines:l.data?.crewLines??void 0,isOpen:o&&void 0!==l.data,onOpenChange:e=>{e||(d(!1),l.reset())},onConfirm:()=>void 0})]})}var W=e.i(56420);let X={name:"infinity",size:24,node:[["path",{d:"M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8",key:"18ogeb"}]]};X.node;let K=(0,W.default)(X);var Y=e.i(30274),G=e.i(49287),J=e.i(78865);let Q={ships:{label:"Ships",unit:"ships",Icon:G.Ship},messages:{label:"Messages today",unit:"messages",Icon:Y.Send}},Z={below:"bg-primary",at:"bg-tone-waiting-fg",over:"bg-tone-attention-fg"},ee={at:"at-limit",over:"over-limit"};function et({kind:e,count:s,limit:n,resetsAt:a}){let{label:i,unit:r,Icon:l}=Q[e],o=(0,N.meterState)({count:s,limit:n}),d=ee[o],c=(0,N.meterCaption)({count:s,limit:n}),u=null===n?0:0===n?1:Math.min(s/n,1);return(0,t.jsxs)("div",{"data-testid":`limit-meter-${e}`,"data-state":o,className:"flex flex-col gap-2 rounded-lg border border-border bg-card p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta font-medium text-muted-foreground",children:[(0,t.jsx)(l,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),i]}),void 0===d?null:(0,t.jsx)(J.StatusBadge,{status:d})]}),(0,t.jsxs)("p",{className:"flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"text-metric font-semibold tabular-nums",children:(0,N.meterCount)(s)}),(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:null===n?r:`of ${(0,N.meterCount)(n)} ${r}`})]}),null===n?(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(K,{"aria-hidden":!0,className:"size-(--size-icon-sm)"}),"No limit"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{role:"meter","aria-label":`${i}: ${String(s)} of ${String(n)}`,"aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":n,className:"block h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)("span",{className:(0,p.classNames)("block h-full rounded-full","none"===o?void 0:Z[o]),style:{width:`${String(100*u)}%`}})}),(0,t.jsxs)("p",{"data-testid":`limit-meter-${e}-caption`,className:"text-caption text-muted-foreground",children:[c,void 0===a?null:` \xb7 resets at ${(0,N.resetTime)(a)}`]})]})]})}function es(){let e=(0,S.useFleetLimits)().data,s=(0,C.useHostedAccountUrl)();return(0,N.hasLimits)(e)?(0,t.jsxs)("section",{"aria-labelledby":"overview-limits-title","data-testid":"overview-limits",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("h2",{id:"overview-limits-title",className:"text-body font-semibold",children:"Limits"}),void 0===s?null:(0,t.jsx)("a",{href:s,"data-testid":"overview-limits-view",className:"text-meta font-medium text-primary underline underline-offset-2",children:"View limits"})]}),(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsx)(et,{kind:"ships",count:e.ships.count,limit:e.ships.limit}),(0,t.jsx)(et,{kind:"messages",count:e.dailyMessages.count,limit:e.dailyMessages.limit,resetsAt:e.dailyMessages.resetsAt})]})]}):null}var en=e.i(48695),ea=e.i(84294);let ei={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};ei.node;let er=(0,W.default)(ei);var el=e.i(31458),eo=e.i(58925),ed=e.i(66595);let ec={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};ec.node;let eu=(0,W.default)(ec);var ep=e.i(26478);let eh={query:"",filters:{status:"all",type:"all",squadron:"all",isRetiredShown:!1}},em="status",ex="type",ef="squadron",eg="retired";function ev(e,t){return[...new Set(e.filter(e=>t||"retired"!==e.status).map(e=>e.type))].toSorted((e,t)=>e.localeCompare(t))}function ej(e){return e.filter(e=>"retired"===e.status).length}function ew(e){return[...new Set([...e.values()].map(e=>e.squadronId))].toSorted((e,t)=>e.localeCompare(t))}let ey={crewed:"Crewed",awaitingCrew:"Awaiting crew"};function eb(e){return["all"===e.status?void 0:`Status: ${ey[e.status]}`,"all"===e.type?void 0:`Type: ${e.type}`,"all"===e.squadron?void 0:`Squadron: ${e.squadron}`,e.isRetiredShown?"Retired shown":void 0].filter(e=>void 0!==e)}var eS=e.i(66390),eC=e.i(46033),eN=e.i(75305),ek=e.i(14732),eT=e.i(67874),eR=e.i(88393);let eP={name:"signal",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]]};eP.node;let eO=(0,W.default)(eP),eI={name:"signal-low",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]};eI.node;let eE=(0,W.default)(eI),eA={name:"signal-medium",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}]]};eA.node;let eM=(0,W.default)(eA);e.s([],51047),e.i(51047);var eL=e.i(96499),ez=e.i(56789),eq=e.i(46376),eD=e.i(33332);let eH=n.createContext(void 0);function eF(e){let t=n.useContext(eH);if(void 0===t&&!e)throw Error((0,eD.default)(72));return t}var e$=e.i(74735),eB=e.i(67865),eV=e.i(29315),eU=e.i(84446),e_=e.i(57940);function eW(e){return null!=e&&null!=e.clientX}var eX=e.i(17989),eK=e.i(75606),eY=e.i(64111),eG=e.i(76782),eJ=e.i(26352),eQ=e.i(56434),eZ=e.i(18478),e0=e.i(16786),e1=e.i(90627);let e2={...e0.popupStoreSelectors,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class e5 extends eJ.ReactStore{constructor(e,t,s){const n=new e1.PopupTriggerMap;super(e4(e,n,t,s),e6(n),e2)}setOpen=(e,t)=>{(0,eY.applyPopupOpenChange)(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,(0,eK.createChangeEventDetails)(eQ.REASONS.triggerPress,e))}}function e4(e,t,s,n=!1){return{...(0,e0.createInitialPopupStoreState)(t,s,n),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function e6(e){return{popupRef:n.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}let e7=(0,eL.fastComponent)(function(e){let{disabled:s=!1,defaultOpen:a=!1,open:i,disableHoverablePopup:r=!1,trackCursorAxis:l="none",actionsRef:o,onOpenChange:d,onOpenChangeComplete:c,handle:u,triggerId:p,defaultTriggerId:h=null,children:m}=e,x=(0,eY.usePopupRootStore)((e,t)=>new e5({open:a,openProp:i,activeTriggerId:h,triggerIdProp:p},e,t));x.useControlledProp("openProp",i),x.useControlledProp("triggerIdProp",p),x.useContextCallback("onOpenChange",d),x.useContextCallback("onOpenChangeComplete",c);let f=x.useState("open"),g=!s&&f,v=x.useState("activeTriggerId"),j=x.useState("mounted"),w=x.useState("payload");x.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:r,disabled:s}),(0,eY.useImplicitActiveTrigger)(x,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=(0,eY.useOpenStateTransitions)(g,x),S=x.useState("isInstantPhase"),C=x.useState("instantType"),N=x.useState("lastOpenChangeReason"),k=n.useRef(null);(0,eq.useIsoLayoutEffect)(()=>{f&&s&&x.setOpen(!1,(0,eK.createChangeEventDetails)(eQ.REASONS.disabled))},[f,s,x]),(0,eq.useIsoLayoutEffect)(()=>{"ending"===b&&N===eQ.REASONS.none||"ending"!==b&&S?("delay"!==C&&(k.current=C),x.set("instantType","delay")):null!==k.current&&(x.set("instantType",k.current),k.current=null)},[b,S,N,C,x]),(0,eq.useIsoLayoutEffect)(()=>{g&&null==v&&x.set("payload",void 0)},[x,v,g]),n.useImperativeHandle(o,()=>({unmount:y,close:()=>x.setOpen(!1,(0,eK.createChangeEventDetails)(eQ.REASONS.imperativeAction))}),[y,x]);let T=g||j||!s&&"none"!==l;return(0,t.jsxs)(eH.Provider,{value:x,children:[u&&(0,t.jsx)(eY.PopupHandleAttachment,{handle:u,store:x}),T&&(0,t.jsx)(e8,{store:x,disabled:s,trackCursorAxis:l}),"function"==typeof m?m({payload:w}):m]})});function e8({store:e,disabled:t,trackCursorAxis:s}){let a=e.useState("floatingRootContext"),i=(0,eX.useDismiss)(a,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),r=function(e,t={}){let{enabled:s=!0,axis:a="both"}=t,i="rootStore"in e?e.rootStore:e,r=i.useState("open"),l=i.useState("floatingElement"),o=i.useState("domReferenceElement"),d=i.context.dataRef,c=n.useRef(!1),u=n.useRef(null),[p,h]=n.useState(),[m,x]=n.useState([]),f=(0,eB.useStableCallback)(e=>{i.set("positionReference",e)}),g=(0,eB.useStableCallback)((e,t,s)=>{if(!c.current&&(!d.current.openEvent||eW(d.current.openEvent))){var n,r;let l,c,u;i.set("positionReference",(n=s??o,r={x:e,y:t,axis:a,dataRef:d,pointerType:p},l=null,c=null,u=!1,{contextElement:n||void 0,getBoundingClientRect(){let e=n?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},t="x"===r.axis||"both"===r.axis,s="y"===r.axis||"both"===r.axis,a=["mouseenter","mousemove"].includes(r.dataRef.current.openEvent?.type||"")&&"touch"!==r.pointerType,i=e.width,o=e.height,d=e.x,p=e.y;return null==l&&r.x&&t&&(l=e.x-r.x),null==c&&r.y&&s&&(c=e.y-r.y),d-=l||0,p-=c||0,i=0,o=0,!u||a?(i="y"===r.axis?e.width:0,o="x"===r.axis?e.height:0,d=t&&null!=r.x?r.x:d,p=s&&null!=r.y?r.y:p):u&&!a&&(o="x"===r.axis?e.height:o,i="y"===r.axis?e.width:i),u=!0,{width:i,height:o,x:d,y:p,top:p,right:d+i,bottom:p+o,left:d}}}))}}),v=(0,eB.useStableCallback)(e=>{r?u.current||(g(e.clientX,e.clientY,e.currentTarget),x([])):g(e.clientX,e.clientY,e.currentTarget)}),j=(0,e_.isMouseLikePointerType)(p)?l:r;n.useEffect(()=>{if(!s)return void f(o);if(!j)return;function e(){u.current?.(),u.current=null}let t=(0,eV.getWindow)(l);return!d.current.openEvent||eW(d.current.openEvent)?u.current=(0,e$.addEventListener)(t,"mousemove",function(t){let s=(0,eU.getTarget)(t);(0,eU.contains)(l,s)?e():g(t.clientX,t.clientY)}):f(o),e},[j,s,l,d,o,i,g,f,m]),n.useEffect(()=>()=>{i.set("positionReference",null)},[i]),n.useEffect(()=>{s&&!l&&(c.current=!1)},[s,l]),n.useEffect(()=>{!s&&r&&(c.current=!0)},[s,r]);let w=n.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return n.useMemo(()=>s?{reference:w,trigger:w}:{},[s,w])}(a,{enabled:!t&&"none"!==s,axis:"none"===s?void 0:s}),l=n.useMemo(()=>(0,eG.mergeProps)(r.reference,i.reference),[r.reference,i.reference]);return(0,eY.usePopupInteractionProps)(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:i.floating??ez.EMPTY_OBJECT}),null}var e3=e.i(39957),e9=e.i(46265),te=e.i(79938),tt=e.i(52245),ts=e.i(59636),tn=e.i(88015);let ta=n.createContext(void 0);var ti=e.i(50316),tr=e.i(44681);let tl=n.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new e3.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function to(e){let{children:s,delay:a,timeoutMs:i=0}=e,r=n.useRef(a),l=n.useRef(a),o=n.useRef(null),d=n.useRef(null),c=(0,e3.useTimeout)();return(0,eq.useIsoLayoutEffect)(()=>{if(l.current=a,!o.current){r.current=a;return}r.current={open:(0,tr.getDelay)(r.current,"open"),close:(0,tr.getDelay)(a,"close")}},[a,o,r,l]),(0,t.jsx)(tl.Provider,{value:n.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:l,currentIdRef:o,timeoutMs:i,currentContextRef:d,timeout:c}),[i,c]),children:s})}var td=e.i(13082),tc=e.i(72135),tu=e.i(73752),tp=e.i(22846);let th="data-base-ui-tooltip-trigger";function tm(e){if("composedPath"in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let s=t[e];if((0,eV.isElement)(s))return s}}let t=e.target;return(0,eV.isElement)(t)?t:null}let tx=(0,eL.fastComponentRef)(function(e,t){let{render:s,className:a,style:i,handle:r,payload:l,disabled:o,delay:d,closeOnClick:c=!0,closeDelay:u,id:p,...h}=e,m=eF(!0),x=(0,ts.usePopupHandleStore)(r)??m;if(!x)throw Error((0,eD.default)(82));let f=(0,tn.useBaseUiId)(p),g=x.useState("isTriggerActive",f),v=x.useState("isOpenedByTrigger",f),j=x.useState("floatingRootContext"),w=n.useRef(null),y=u??0,{registerTrigger:b,isMountedByThisTrigger:S}=(0,eY.useTriggerDataForwarding)(f,w,x,{payload:l,closeOnClick:c,closeDelay:y}),C=n.useContext(ta),{activeIdRef:N,delayRef:k,isInstantPhase:T,hasProvider:R}=function(e,t={open:!1}){let{open:s}=t,a="rootStore"in e?e.rootStore:e,i=a.useState("floatingId"),{currentIdRef:r,delayRef:l,timeoutMs:o,initialDelayRef:d,currentContextRef:c,hasProvider:u,timeout:p}=n.useContext(tl),[h,m]=n.useState(!1),x=n.useRef(s);return(0,eq.useIsoLayoutEffect)(()=>{x.current=s},[s]),(0,eq.useIsoLayoutEffect)(()=>{function e(){c.current?.setIsInstantPhase(!1),r.current=null,c.current=null,l.current=d.current,p.clear()}if(r.current&&!s&&r.current===i){if(m(!1),o)return p.start(o,()=>{a.select("open")||r.current&&r.current!==i||e()}),()=>{(x.current||r.current!==i)&&p.clear()};e()}},[s,i,r,l,o,d,c,p,a]),(0,eq.useIsoLayoutEffect)(()=>{if(!s)return;let e=c.current,t=r.current;p.clear(),c.current={onOpenChange:a.setOpen,setIsInstantPhase:m},r.current=i,l.current={open:0,close:(0,tr.getDelay)(d.current,"close")},null!==t&&t!==i?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,(0,eK.createChangeEventDetails)(eQ.REASONS.none))):(m(!1),e?.setIsInstantPhase(!1))},[s,i,a,r,l,d,c,p]),(0,eq.useIsoLayoutEffect)(()=>()=>{r.current===i&&(c.current=null,x.current)&&(r.current=null,l.current=d.current,p.clear())},[c,r,l,i,d,p]),n.useMemo(()=>({activeIdRef:r,hasProvider:u,delayRef:l,isInstantPhase:h}),[r,u,l,h])}(j,{open:v}),P=(0,tu.useHoverInteractionSharedState)(j);x.useSyncedValue("isInstantPhase",T);let O=x.useState("disabled"),I=o??O,E=(0,e9.useValueAsRef)(I),A=x.useState("trackCursorAxis"),M=x.useState("disableHoverablePopup"),L=n.useRef(!1),z=(0,e3.useTimeout)(),q=n.useRef(void 0);function D(){return R&&null!=N.current?0:d??C??600}function H(e){let t=w.current;if(!t||!e)return!1;let s=function(e){let t=e;for(;t;){let e=t.closest(`[${th}]`);if(e)return e;let s=t.getRootNode();t="host"in s&&(0,eV.isElement)(s.host)?s.host:null}return null}(e);return null!==s&&s!==t&&(0,eU.contains)(t,s)}let F=(0,tc.useHoverReferenceInteraction)(j,{enabled:!I,mouseOnly:!0,move:!1,handleClose:M||"both"===A?null:(0,ti.safePolygon)(),restMs:D,delay:()=>null==u&&R?{close:(0,tr.getDelay)(k.current,"close")}:{close:y},triggerElementRef:w,isActiveTrigger:g,isClosing:()=>"ending"===x.select("transitionStatus"),shouldOpen:()=>!L.current}),$=(0,td.useFocus)(j,{enabled:!I}).reference,B=x.useState("triggerProps",S),V=S||"none"!==A;return(0,tt.useRenderElement)("button",e,{state:{open:v},ref:[t,b,w],props:[F,$,V?B:void 0,{onMouseOver(e){(e=>{let t,s=L.current,n=tm(e),a=(L.current=t=H(n),t&&(P.openChangeTimeout.clear(),P.restTimeout.clear(),P.restTimeoutPending=!1,z.clear()),t),i=w.current,r=i&&n&&(0,eU.contains)(i,n);if(a&&x.select("open")&&x.select("lastOpenChangeReason")===eQ.REASONS.triggerHover)return x.setOpen(!1,(0,eK.createChangeEventDetails)(eQ.REASONS.triggerHover,e));if(s&&!a&&r&&!E.current&&!x.select("open")&&i&&(0,e_.isMouseLikePointerType)(q.current)){let t=()=>{L.current||E.current||x.select("open")||x.setOpen(!0,(0,eK.createChangeEventDetails)(eQ.REASONS.triggerHover,e,i))},s=D();0===s?(z.clear(),t()):z.start(s,t)}})(e.nativeEvent)},onFocus(e){H(tm(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){L.current=!1,z.clear(),q.current=void 0},onPointerEnter(e){q.current=e.pointerType},onPointerDown(e){q.current=e.pointerType,x.set("closeOnClick",c),c&&!x.select("open")&&x.cancelPendingOpen(e.nativeEvent)},onClick(e){c&&!x.select("open")&&x.cancelPendingOpen(e.nativeEvent)},id:f,[tp.triggerDisabled]:I?"":void 0,[th]:I?void 0:""},h],stateAttributesMapping:te.triggerOpenStateMapping})}),tf=n.createContext(void 0);var tg=e.i(74080),tv=e.i(26674);let tj=n.forwardRef(function(e,s){let{children:a,container:i,className:r,render:l,style:o,...d}=e,{node:c,subtree:u}=(0,tv.useFloatingPortalNode)({container:i,ref:s,componentProps:e,elementProps:d});return u||c?(0,t.jsxs)(n.Fragment,{children:[u,c&&tg.createPortal(a,c)]}):null}),tw=n.forwardRef(function(e,s){let{keepMounted:n=!1,...a}=e;return eF().useState("mounted")||n?(0,t.jsx)(tf.Provider,{value:n,children:(0,t.jsx)(tj,{ref:s,...a})}):null}),ty=n.createContext(void 0);function tb(){let e=n.useContext(ty);if(void 0===e)throw Error((0,eD.default)(71));return e}var tS=e.i(23706),tC=e.i(38396),tN=e.i(89579);let tk=n.forwardRef(function(e,s){let{render:a,className:i,anchor:r,positionMethod:l="absolute",side:o="top",align:d="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:p="clipping-ancestors",collisionPadding:h=5,arrowPadding:m=5,sticky:x=!1,disableAnchorTracking:f=!1,collisionAvoidance:g=tC.POPUP_COLLISION_AVOIDANCE,style:v,...j}=e,w=eF(),y=function(){let e=n.useContext(tf);if(void 0===e)throw Error((0,eD.default)(70));return e}(),b=w.useState("open"),S=w.useState("mounted"),C=w.useState("trackCursorAxis"),N=w.useState("disableHoverablePopup"),k=w.useState("floatingRootContext"),T=w.useState("instantType"),R=w.useState("transitionStatus"),P=w.useState("adaptiveOrigin"),O=(0,tS.useAnchorPositioning)({anchor:r,positionMethod:l,floatingRootContext:k,mounted:S,side:o,sideOffset:c,align:d,alignOffset:u,collisionBoundary:p,collisionPadding:h,sticky:x,arrowPadding:m,disableAnchorTracking:f,keepMounted:y,collisionAvoidance:g,adaptiveOrigin:P}),I=n.useMemo(()=>({open:b,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:"none"!==C?"tracking-cursor":T}),[b,O.side,O.align,O.anchorHidden,C,T]),E=(0,tN.usePositioner)(e,I,{styles:O.positionerStyles,transitionStatus:R,props:j,refs:[s,w.useStateSetter("positionerElement")],hidden:!S,inert:!b||"both"===C||N});return(0,t.jsx)(ty.Provider,{value:O,children:E})});var tT=e.i(37584),tR=e.i(53984),tP=e.i(31157);let tO=n.forwardRef(function(e,t){let{render:s,className:n,style:a,...i}=e,r=eF(),{side:l,align:o}=tb(),d=r.useState("open"),c=r.useState("instantType"),u=r.useState("transitionStatus"),p=r.useState("popupProps"),h=r.useState("floatingRootContext"),m=r.useState("disabled"),x=r.useState("closeDelay");(0,tT.useOpenChangeComplete)({open:d,ref:r.context.popupRef,onComplete(){d&&r.context.onOpenChangeComplete?.(!0)}}),(0,tP.useHoverFloatingInteraction)(h,{enabled:!m,closeDelay:x});let f=r.useStateSetter("popupElement");return(0,tt.useRenderElement)("div",e,{state:{open:d,side:l,align:o,instant:c,transitionStatus:u},ref:[t,r.context.popupRef,f],props:[eY.FOCUSABLE_POPUP_PROPS,p,(0,tR.getDisabledMountTransitionStyles)(u),i],stateAttributesMapping:te.popupTransitionStateMapping})}),tI=n.forwardRef(function(e,t){let{render:s,className:n,style:a,...i}=e,r=eF(),{arrowRef:l,side:o,align:d,arrowUncentered:c,arrowStyles:u}=tb(),p=r.useState("open"),h=r.useState("instantType");return(0,tt.useRenderElement)("div",e,{state:{open:p,side:o,align:d,uncentered:c,instant:h},ref:[t,l],props:[{style:u,"aria-hidden":!0},i],stateAttributesMapping:te.popupStateMapping})});var tE=e.i(18390);let tA=n.forwardRef(function(e,t){let{render:s,className:n,style:a,children:i,...r}=e,l=eF(),o=tb(),d=l.useState("instantType"),{children:c,state:u}=(0,tE.usePopupViewport)({store:l,side:o.side,children:i}),p={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:d};return(0,tt.useRenderElement)("div",e,{state:p,ref:t,props:[r,{children:c}],stateAttributesMapping:tE.popupViewportStateMapping})});var tM=e.i(64170);class tL extends tM.BasePopupHandle{constructor(){super(function(){let e=new e1.PopupTriggerMap;return Object.assign(new eZ.NullStore(Object.freeze(e4(void 0,e)),Object.freeze(e6(e)),e2),{setOpen:ez.NOOP,cancelPendingOpen:ez.NOOP})}(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,tI,"Handle",0,tL,"Popup",0,tO,"Portal",0,tw,"Positioner",0,tk,"Provider",0,function(e){let{delay:s,closeDelay:a,timeout:i=400}=e,r=n.useMemo(()=>({open:s,close:a}),[s,a]);return(0,t.jsx)(ta.Provider,{value:s,children:(0,t.jsx)(to,{delay:r,timeoutMs:i,children:e.children})})},"Root",0,e7,"Trigger",0,tx,"Viewport",0,tA,"createHandle",0,function(){return new tL}],99643);var tz=e.i(99643),tz=tz;function tq(e){return(0,t.jsx)(tz.Root,{"data-slot":"tooltip",...e})}function tD(e){return(0,t.jsx)(tz.Trigger,{"data-slot":"tooltip-trigger",...e})}function tH({className:e,side:s="top",sideOffset:n=6,align:a="center",...i}){return(0,t.jsx)(tz.Portal,{children:(0,t.jsx)(tz.Positioner,{align:a,side:s,sideOffset:n,className:"isolate z-50 max-sm:hidden",children:(0,t.jsx)(tz.Popup,{"data-slot":"tooltip-content",className:(0,p.classNames)("w-fit max-w-xs origin-(--transform-origin) rounded-sm bg-foreground px-2 py-1 text-caption font-medium text-background shadow-md duration-(--duration-fast) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...i})})})}let tF={fresh:{Icon:eO,tone:"text-tone-ok-fg"},while:{Icon:eM,tone:"text-muted-foreground"},long:{Icon:eE,tone:"text-tone-waiting-fg"}};function t$({seenAt:e,now:s,testId:n}){let a;if(null===e)return null;let i=new Date(e),r=(a=s.getTime()-i.getTime())<6e4?"fresh":a<=9e5?"while":"long",{Icon:l,tone:o}=tF[r],d=(0,v.lastSeen)(i,s);return(0,t.jsxs)(tq,{children:[(0,t.jsx)(tD,{render:(0,t.jsx)("span",{role:"img","aria-label":d,"data-testid":n,"data-signal":r,className:(0,p.classNames)("inline-flex [&_svg]:size-(--size-icon) max-sm:[&_svg]:size-4",o)}),children:(0,t.jsx)(l,{"aria-hidden":!0})}),(0,t.jsx)(tH,{children:d})]})}var tB=e.i(63481);let tV={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};tV.node;let tU=(0,W.default)(tV),t_={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};t_.node;let tW=(0,W.default)(t_);function tX(e){return e.startsWith("@")||/@\d+\.\d+\.\d+$/.test(e)}function tK({model:e,isCrewed:s,now:n,testId:a}){if(!s)return null;if(null===e)return(0,t.jsx)("span",{"data-testid":a,className:"text-meta text-muted-foreground",children:"Not stated yet"});let i=tX(e.id),r=function(e,t){let s=new Date(e.statedAt),n=Math.max(0,t.getTime()-s.getTime()),a=tX(e.id)?"Software":"Model";if(n<6e4)return`${a}, stated ${String(Math.floor(n/1e3))} s ago`;let i=(0,v.relativeTime)(s,t);return`${a}, stated ${i.charAt(0).toLowerCase()}${i.slice(1)}`}(e,n);return(0,t.jsxs)(tq,{children:[(0,t.jsxs)(tD,{render:(0,t.jsx)("span",{"data-testid":a,"data-slot":"model-tag","data-software":i?"":void 0,className:(0,p.classNames)("inline-flex max-w-44 min-w-0 items-center gap-1 rounded-sm px-1.5 py-0.5 font-mono text-id [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",i?"border border-dashed border-border text-muted-foreground":"bg-secondary text-secondary-foreground")}),children:[(0,t.jsx)(i?tU:tW,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:e.id}),(0,t.jsxs)("span",{className:"sr-only",children:[", ",r]})]}),(0,t.jsx)(tH,{children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"font-mono",children:e.id}),(0,t.jsx)("span",{className:"opacity-75",children:r})]})})]})}var tY=e.i(81830),tG=e.i(1935),tJ=e.i(39448);let tQ={all:"All",crewed:"Crewed",awaitingCrew:"Awaiting crew"};function tZ(e){return Object.hasOwn(tQ,e)}function t0({ship:e,squadron:s}){return"operator"===e.kind?(0,t.jsxs)(eS.Badge,{variant:"kind",children:[(0,t.jsx)(ep.UserRound,{"aria-hidden":!0}),"operator"]}):"viewer"===e.kind?(0,t.jsxs)(eS.Badge,{variant:"kind","data-testid":"fleet-viewer",children:[(0,t.jsx)(er,{"aria-hidden":!0}),"viewer"]}):s?.role===null?(0,t.jsxs)(eS.Badge,{variant:"kind","data-testid":"fleet-flagship",children:[(0,t.jsx)(el.Flag,{"aria-hidden":!0}),"flagship"]}):s?(0,t.jsx)(tG.SquadronTag,{squadronId:s.squadronId,role:s.role,size:"sm"}):null}function t1({ship:e,now:s}){let n=e.startingPrompt,a="inline-flex min-w-0 items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0";if(null===n)return(0,t.jsxs)("span",{className:a,children:[(0,t.jsx)(eo.KeyRound,{"aria-hidden":!0}),"No starting prompt issued"]});let i=new Date(n.issuedAt);return(0,t.jsxs)("span",{className:a,children:[(0,t.jsx)(eo.KeyRound,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:["Prompt issued"," ",(0,t.jsx)("time",{dateTime:n.issuedAt,title:(0,v.fullDateTime)(i),children:(0,v.relativeTime)(i,s)}),n.isClaimed?", claimed":", not claimed yet"]})]})}function t2({ship:e,now:s}){return"retired"===e.status?null===e.retiredAt?null:(0,t.jsxs)("span",{className:"truncate text-meta text-muted-foreground","data-testid":"fleet-retired-on",title:(0,v.fullDateTime)(new Date(e.retiredAt)),children:["Retired ",(0,v.dayMonth)(new Date(e.retiredAt))]}):"viewer"===e.kind?null:"awaitingCrew"===e.status?(0,t.jsx)(t1,{ship:e,now:s}):(0,t.jsx)(tB.LocationTag,{kind:"operator"===e.kind&&null!==e.location?"DEVICE":e.location?.kind??null,description:e.location?.description,harness:"operator"===e.kind?"console":e.harness,size:"sm"})}function t5({ship:e,now:s,next:n}){let a="agent"===e.kind&&"crewed"===e.status;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[a?(0,t.jsx)(tY.ReportLine,{report:e.report,now:s,variant:"row",isTimeInTitle:!0,testId:"fleet-report"}):null,n]})}function t4({ships:e,view:s,onViewChange:n,size:a,squadronsOf:i}){let{filters:r}=s,l={all:"All",...Object.fromEntries(ev(e,r.isRetiredShown).map(e=>[e,e]))},o=ej(e),d="sm"===a?"fleet-show-retired":"fleet-show-retired-touch",c=e=>{n({...s,filters:{...r,...e}})},u="touch"===a;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(eC.Select,{items:tQ,value:r.status,onValueChange:e=>{null!==e&&tZ(e)&&c({status:e})},children:[(0,t.jsx)(eC.SelectTrigger,{size:a,"aria-label":"Status","data-testid":u?void 0:"fleet-filter-status",children:(0,t.jsxs)("span",{className:"flex gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Status"}),(0,t.jsx)(eC.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(eC.SelectContent,{children:Object.entries(tQ).map(([e,s])=>(0,t.jsx)(eC.SelectItem,{value:e,children:s},e))})]}),(0,t.jsxs)(eC.Select,{items:l,value:r.type,onValueChange:e=>{null!==e&&c({type:e})},children:[(0,t.jsx)(eC.SelectTrigger,{size:a,"aria-label":"Type","data-testid":u?void 0:"fleet-filter-type",children:(0,t.jsxs)("span",{className:"flex gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Type"}),(0,t.jsx)(eC.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(eC.SelectContent,{children:Object.entries(l).map(([e,s])=>(0,t.jsx)(eC.SelectItem,{value:e,className:"all"===e?void 0:"font-mono",children:s},e))})]}),i&&(0,t.jsxs)(eC.Select,{items:{all:"All",...Object.fromEntries(ew(i).map(e=>[e,e]))},value:r.squadron,onValueChange:e=>{null!==e&&c({squadron:e})},children:[(0,t.jsx)(eC.SelectTrigger,{size:a,"aria-label":"Squadron","data-testid":u?void 0:"fleet-filter-squadron",children:(0,t.jsxs)("span",{className:"flex gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Squadron"}),(0,t.jsx)(eC.SelectValue,{className:"font-medium"})]})}),(0,t.jsxs)(eC.SelectContent,{children:[(0,t.jsx)(eC.SelectItem,{value:"all",children:"All"}),ew(i).map(e=>(0,t.jsx)(eC.SelectItem,{value:e,children:e},e))]})]}),eb(r).length>0&&!u?(0,t.jsx)(b.Button,{variant:"ghost",size:"xs","data-testid":"fleet-filters-clear",onClick:()=>{n({...s,filters:eh.filters})},children:"Clear filters"}):null,(0,t.jsxs)("div",{className:(0,p.classNames)("inline-flex items-center gap-2",u?"py-2":"sm:ml-auto"),children:[(0,t.jsx)(q.Switch,{id:d,"data-testid":u?void 0:"fleet-show-retired",checked:r.isRetiredShown,onCheckedChange:e=>{c({isRetiredShown:e})}}),(0,t.jsxs)(z.Label,{htmlFor:d,className:(0,p.classNames)("font-normal text-muted-foreground",u?"text-body-touch":"text-meta"),children:["Show retired (",o,")"]})]})]})}function t6({label:e,isOn:s,kind:n,onPick:a}){return(0,t.jsx)(b.Button,{variant:s?"primary":"secondary",size:"touch",role:"radio"===n?"radio":void 0,"aria-checked":"radio"===n?s:void 0,"aria-pressed":"toggle"===n?s:void 0,onClick:a,children:e})}function t7({ships:e,view:s,onViewChange:n,shownCount:a,squadronsOf:i}){let{filters:r}=s,l=e=>{n({...s,filters:{...r,...e}})},o=eb(r).length,d=ej(e);return(0,t.jsxs)(eN.Sheet,{children:[(0,t.jsx)(eN.SheetTrigger,{render:(0,t.jsx)(b.Button,{size:"touch",isIconOnly:!0,"aria-label":o>0?`Filter ships, ${String(o)} active`:"Filter ships","data-testid":"fleet-filters-open",icon:(0,t.jsx)(eu,{}),className:"relative sm:hidden",children:o>0?(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute top-1.5 right-1.5 size-2 rounded-full bg-primary"}):null})}),(0,t.jsxs)(eN.SheetContent,{side:"bottom",children:[(0,t.jsxs)(eN.SheetHeader,{className:"flex-row items-center justify-between",children:[(0,t.jsx)(eN.SheetTitle,{children:"Filter ships"}),(0,t.jsx)(b.Button,{variant:"ghost",size:"touch","data-testid":"fleet-filters-reset",onClick:()=>{n({...s,filters:eh.filters})},children:"Reset"})]}),(0,t.jsxs)(eN.SheetBody,{className:"flex flex-col gap-4 pb-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{id:"fleet-filter-status-label",className:"text-meta font-medium text-muted-foreground",children:"Status"}),(0,t.jsx)("div",{role:"radiogroup","aria-labelledby":"fleet-filter-status-label",className:"flex gap-1.5 [&>*]:flex-1",children:Object.entries(tQ).map(([e,s])=>(0,t.jsx)(t6,{label:s,kind:"radio",isOn:r.status===e,onPick:()=>{tZ(e)&&l({status:e})}},e))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-meta font-medium text-muted-foreground",children:"Type"}),(0,t.jsx)("div",{role:"group","aria-label":"Type",className:"flex flex-wrap gap-1.5",children:["all",...ev(e,r.isRetiredShown)].map(e=>(0,t.jsx)(t6,{label:"all"===e?"All types":e,kind:"toggle",isOn:r.type===e,onPick:()=>{l({type:e})}},e))})]}),i&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{id:"fleet-filter-squadron-label",className:"text-meta font-medium text-muted-foreground",children:"Squadron"}),(0,t.jsx)("div",{role:"radiogroup","aria-labelledby":"fleet-filter-squadron-label",className:"flex flex-wrap gap-1.5",children:["all",...ew(i)].map(e=>(0,t.jsx)(t6,{label:"all"===e?"All":e,kind:"radio",isOn:r.squadron===e,onPick:()=>{l({squadron:e})}},e))})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 py-1",children:[(0,t.jsxs)(z.Label,{htmlFor:"fleet-show-retired-touch",className:"text-body-touch font-normal",children:["Show retired ships ",(0,t.jsxs)("span",{className:"text-muted-foreground",children:["(",d,")"]})]}),(0,t.jsx)(q.Switch,{id:"fleet-show-retired-touch",checked:r.isRetiredShown,onCheckedChange:e=>{l({isRetiredShown:e})}})]}),(0,t.jsx)(eN.SheetClose,{render:(0,t.jsx)(b.Button,{size:"touch","data-testid":"fleet-filters-apply"}),children:1===a?"Show 1 ship":`Show ${String(a)} ships`})]})]})]})}function t8({view:e,onViewChange:s}){let n=eb(e.filters);return 0===n.length?null:(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-1.5 sm:hidden","data-testid":"fleet-filter-chips",children:[n.map(e=>(0,t.jsx)(eS.Badge,{variant:"outline",className:"max-w-full truncate",children:e},e)),(0,t.jsx)(b.Button,{variant:"ghost",size:"touch",onClick:()=>{s({...e,filters:eh.filters})},children:"Clear filters"})]})}function t3({ships:e,view:s,onViewChange:n,shownCount:a,squadronsOf:i}){return(0,t.jsxs)("div",{"data-slot":"fleet-toolbar",className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("div",{className:"w-60 max-sm:min-w-0 max-sm:flex-1",children:(0,t.jsx)(L.Input,{type:"search","aria-label":"Search ships by name or type",placeholder:"Search ships by name","data-testid":"fleet-search",value:s.query,onChange:e=>{n({...s,query:e.target.value})},leadingIcon:(0,t.jsx)(ed.Search,{}),className:"h-(--size-control-sm) text-meta max-sm:h-(--size-control-touch) max-sm:text-input-touch"})}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 max-sm:hidden sm:flex-1",children:(0,t.jsx)(t4,{ships:e,view:s,onViewChange:n,squadronsOf:i,size:"sm"})}),(0,t.jsx)(t7,{ships:e,view:s,onViewChange:n,shownCount:a,squadronsOf:i}),(0,t.jsx)(t8,{view:s,onViewChange:n}),(0,t.jsxs)("p",{"aria-live":"polite",className:"text-meta text-muted-foreground tabular-nums max-sm:w-full",children:[a," of ",e.length," ships"]})]})}function t9({ship:e}){return(0,t.jsx)(tJ.ShipName,{name:e.name,shipId:e.id,isSuffixShown:"retired"===e.status,href:`/ships/${e.id}`})}function se({ships:e,highlightedShipIds:s,now:n,renderRowActions:a,squadronsOf:i}){return(0,t.jsx)("div",{className:"max-sm:hidden",children:(0,t.jsxs)(ek.Table,{"aria-label":"Ships",children:[(0,t.jsx)(ek.TableHeader,{children:(0,t.jsxs)(ek.TableRow,{children:[(0,t.jsx)(ek.TableHead,{children:"Name"}),(0,t.jsx)(ek.TableHead,{children:"Status"}),(0,t.jsx)(ek.TableHead,{children:"Report"}),(0,t.jsx)(ek.TableHead,{children:"Runs on"}),(0,t.jsx)(ek.TableHead,{children:"Model"}),(0,t.jsx)(ek.TableHead,{children:"Seen"}),(0,t.jsx)(ek.TableHead,{children:(0,t.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,t.jsx)(ek.TableBody,{children:e.map(e=>(0,t.jsxs)(ek.TableRow,{"data-testid":`fleet-row-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"h-12",children:[(0,t.jsx)(ek.TableCell,{className:"max-w-64",children:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(t9,{ship:e}),(0,t.jsx)(t0,{ship:e,squadron:i?.get(e.id)})]})}),(0,t.jsx)(ek.TableCell,{children:(0,t.jsx)(J.StatusBadge,{status:e.status})}),(0,t.jsx)(ek.TableCell,{className:"max-w-72",children:(0,t.jsx)(t5,{ship:e,now:n,next:a?.(e,"next")})}),(0,t.jsx)(ek.TableCell,{className:"max-w-56",children:(0,t.jsx)(t2,{ship:e,now:n})}),(0,t.jsx)(ek.TableCell,{children:"agent"!==e.kind?null:(0,t.jsx)(tK,{model:e.model,isCrewed:"crewed"===e.status,now:n,testId:"fleet-model"})}),(0,t.jsx)(ek.TableCell,{children:(0,t.jsx)(t$,{seenAt:e.lastSeenAt,now:n,testId:"fleet-last-seen"})}),(0,t.jsx)(ek.TableCell,{className:"w-10 text-right",children:a?.(e,"table")})]},e.id))})]})})}function st({ships:e,highlightedShipIds:s,now:n,renderRowActions:a,squadronsOf:i}){return(0,t.jsx)("ul",{"aria-label":"Ships",className:"overflow-hidden rounded-lg border border-border bg-card sm:hidden",children:e.map(e=>(0,t.jsxs)("li",{"data-testid":`fleet-card-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"flex items-start gap-2 border-b border-border px-3.5 py-3 last:border-0 data-new:animate-highlight",children:[(0,t.jsxs)("div",{className:"flex min-w-0 grow flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 text-body-touch",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(t9,{ship:e}),(0,t.jsx)(t0,{ship:e,squadron:i?.get(e.id)})]}),(0,t.jsx)(J.StatusBadge,{status:e.status})]}),(0,t.jsx)(t5,{ship:e,now:n,next:a?.(e,"next")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1",children:[(0,t.jsx)(t2,{ship:e,now:n}),"agent"!==e.kind?null:(0,t.jsx)(tK,{model:e.model,isCrewed:"crewed"===e.status,now:n}),(0,t.jsx)(t$,{seenAt:e.lastSeenAt,now:n})]})]}),a?.(e,"phone")]},e.id))})}function ss({ships:e,view:s,onViewChange:n,state:a,error:i,highlightedShipIds:r,now:l,renderRowActions:o,emptyAction:d,squadronsOf:c}){var u;let p;if("loading"===a)return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"loading",className:"flex flex-col gap-3",children:[(0,t.jsx)(eR.LoadingSkeleton,{variant:"table",rows:6,label:"Loading the fleet",className:"max-sm:hidden"}),(0,t.jsx)(eR.LoadingSkeleton,{variant:"list",rows:5,label:"Loading the fleet",className:"sm:hidden"})]});if("error"===a)return(0,t.jsx)(H.InlineError,{variant:"page",title:"Couldn’t load the fleet",description:"This page couldn’t reach the fleet server. Check that the server is running and reachable from this browser, then try again.",detail:i?.detail,retryNote:i?.retryNote,onRetry:i?.onRetry});let h={highlightedShipIds:r,now:l,renderRowActions:o,squadronsOf:c};if(e.every(e=>"operator"===e.kind||"retired"===e.status)){let s=e.filter(e=>"operator"===e.kind);return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"empty",className:"flex flex-col gap-3",children:[(0,t.jsx)(se,{ships:s,...h}),(0,t.jsx)(st,{ships:s,...h}),(0,t.jsx)(eT.EmptyState,{icon:(0,t.jsx)(G.Ship,{}),title:"No ships besides argo yet",description:"argo is your own ship: messages to the operator land in its inbox. Commission a ship to add an agent to the fleet.",action:d})]})}let m=(u={...s,squadronsOf:c},e.filter(e=>{let t;return(""===(t=u.query.trim().toLowerCase())||e.name.toLowerCase().includes(t)||e.type.toLowerCase().includes(t))&&function(e,t){let{filters:s,squadronsOf:n}=t;return("retired"!==e.status||!!s.isRetiredShown)&&("all"===s.squadron||n?.get(e.id)?.squadronId===s.squadron)&&("all"===s.status||e.status===s.status)&&("all"===s.type||e.type===s.type)}(e,u)}).toSorted((e,t)=>e.kind!==t.kind?"operator"===e.kind?-1:1:e.name.localeCompare(t.name)||e.id.localeCompare(t.id))),x=s.query.trim();return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"ready",className:"flex flex-col gap-3",children:[(0,t.jsx)(t3,{ships:e,view:s,onViewChange:n,shownCount:m.length,squadronsOf:c}),0===m.length?(0,t.jsx)(eT.EmptyState,{variant:"no-results",title:""===x?"No ships match these filters.":`No ships match “${x}”.`,action:(0,t.jsx)(b.Button,{size:"xs","data-testid":"fleet-clear-filters",onClick:()=>{n(eh)},children:(p=eb(s.filters).length>0,""===x?"Clear filters":p?"Clear search and filters":"Clear search")})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(se,{ships:m,...h}),(0,t.jsx)(st,{ships:m,...h})]})]})}var sn=e.i(5894);function sa({view:e,onViewChange:s,newShipIds:n}){let a=(0,x.useFleetSnapshot)(),i=(0,g.useNow)(),r=(0,en.useSquadrons)();return(0,t.jsx)("section",{"aria-label":"Fleet",className:"flex flex-col gap-3",children:(0,t.jsx)(ss,{ships:a.data??[],view:e,onViewChange:s,state:a.isPending?"loading":a.isError?"error":"ready",error:{detail:a.error?.message,onRetry:()=>{a.refetch()}},highlightedShipIds:n,now:i,renderRowActions:(e,s)=>(0,t.jsx)(sn.ShipActions,{ship:e,layout:"table"===s?"menu":"phone"===s?"sheet":"next"}),squadronsOf:r.data?(0,ea.shipsInSquadrons)(r.data):void 0})})}var si=e.i(87792),sr=e.i(90262),sl=e.i(86413),so=e.i(18423),sd=e.i(88721),sc=e.i(78485),su=e.i(86165);e.s(["default",0,function({searchParams:e}){var o;let d,c=(0,s.useRouter)(),u=function(e){let t=new URLSearchParams;for(let[s,n]of Object.entries(e)){let e=Array.isArray(n)?n[0]:n;void 0!==e&&t.set(s,e)}return t}((0,n.use)(e)),p={query:u.get("q")??"",filters:{status:(o=u.get(em),(d=k.shipStatusSchema.safeParse(o)).success&&"retired"!==d.data?d.data:"all"),type:u.get(ex)??"all",squadron:u.get(ef)??"all",isRetiredShown:"1"===u.get(eg)}},h="new"===u.get("commission"),m=(0,x.useFleetSnapshot)(),v=(0,so.useLiveFleet)(),y=(0,g.useNow)(),b=(0,sd.useAccountMenu)(y),T=(0,su.useHasSquadrons)(),R=(0,N.messageLimitReached)((0,S.useFleetLimits)().data),P=(0,C.useHostedAccountUrl)(),O=(0,sl.useOpenInboxCount)(),I=(0,sr.useAccess)(),[E,A]=(0,n.useState)(!1),[M,L]=(0,n.useState)(!1),[z,q]=(0,n.useState)(!1),D=(0,f.useAttentionCount)();(0,sc.useSignInWhenSessionEnds)([m.error,v.error]);let H=e=>{let t,s=(t=new URLSearchParams,""!==e.query&&t.set("q",e.query),"all"!==e.filters.status&&t.set(em,e.filters.status),"all"!==e.filters.type&&t.set(ex,e.filters.type),"all"!==e.filters.squadron&&t.set(ef,e.filters.squadron),e.filters.isRetiredShown&&t.set(eg,"1"),t).toString();c.replace(""===s?"/":`/?${s}`,{scroll:!1})};return(0,t.jsxs)(si.ListLayout,{title:"Fleet overview",description:m.data?function(e){let t=j(e.ships).length,s=e.ships.filter(e=>"agent"===e.kind&&"retired"===e.status).length;if(0===t&&0===s)return e.canCommission?"Only argo so far. Ships you commission appear here.":"Only argo so far.";let n=0===s?"":`, ${String(s)} retired`;return`${1===t?"1 active ship":`${String(t)} active ships`} and argo${n}. Changes appear as they happen.`}({ships:m.data,canCommission:I.canManage}):"Loading your fleet",primaryAction:I.canManage?(0,t.jsx)(_,{isOpen:z||h,onOpenChange:e=>{q(e),!e&&h&&H(p)}}):void 0,live:v.live,nav:{active:"overview",inboxCount:O,attentionCount:D,hasSquadrons:T,hasSettings:T&&I.canManage},onCompose:I.canSend?()=>{A(!0)}:void 0,onSearch:()=>{L(!0)},account:b,banner:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.ConsoleNotices,{}),(0,t.jsx)(r.ConsoleGuide,{})]}),children:[void 0===R?null:(0,t.jsx)(F.LimitNotice,{...(0,N.messageLimitNotice)(R),accountUrl:P,testId:"overview-message-limit"}),(0,t.jsx)(es,{}),(0,t.jsx)(w,{}),(0,t.jsx)(sa,{view:p,onViewChange:H,newShipIds:v.newShipIds}),(0,t.jsx)(a.ComposeMessage,{isOpen:E,onOpenChange:A}),(0,t.jsx)(i.ConsoleCommands,{isOpen:M,onOpenChange:L,onCompose:()=>{A(!0)}})]})}],62219)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52376,e=>{"use strict";e.s([],4824),e.i(4824);var t=e.i(71645),r=e.i(52245),n=e.i(33332);let s=t.createContext(void 0);function i(){let e=t.useContext(s);if(void 0===e)throw Error((0,n.default)(13));return e}let a={imageLoadingStatus:()=>null};var o=e.i(43476);let l=t.forwardRef(function(e,n){let{className:i,render:l,style:u,...c}=e,[d,h]=t.useState("idle"),f=t.useMemo(()=>({imageLoadingStatus:d,setImageLoadingStatus:h}),[d,h]),p=(0,r.useRenderElement)("span",e,{state:{imageLoadingStatus:d},ref:n,props:c,stateAttributesMapping:a});return(0,o.jsx)(s.Provider,{value:f,children:p})});var u=e.i(67865),c=e.i(46376),d=e.i(37584),h=e.i(74354),f=e.i(23910),p=e.i(56789);let m={...a,...h.transitionStatusMapping},g=t.forwardRef(function(e,n){let{className:s,render:a,onLoadingStatusChange:o,keepMounted:l=!1,style:h,sizes:g,srcSet:y,src:b,...v}=e,{setImageLoadingStatus:x}=i(),[w,C]=function(e,{referrerPolicy:r,crossOrigin:n,sizes:s,srcSet:i},a){let o=t.useState("idle"),l=o[1];return(0,c.useIsoLayoutEffect)(()=>{if(!a)return p.NOOP;if(!e&&!i)return l("error"),p.NOOP;let t=!0,o=new window.Image,u=e=>()=>{t&&l(e)};return l("loading"),o.onload=u("loaded"),o.onerror=u("error"),r&&(o.referrerPolicy=r),o.crossOrigin=n??null,s&&(o.sizes=s),i&&(o.srcset=i),e&&(o.src=e),o.complete&&l(o.naturalWidth>0?"loaded":"error"),()=>{t=!1}},[a,e,i,s,n,r,l]),o}(b,e,!l),S="loaded"===w,{mounted:k,transitionStatus:j,setMounted:R}=(0,f.useTransitionStatus)(S),E=t.useRef(null),T=t.useRef(!0);(0,c.useIsoLayoutEffect)(()=>{if(!l)return;let e=T.current;T.current=!1;let t=E.current;if(!t)return;if(!t.complete)return void C("loading");let r=t.naturalWidth>0?"loaded":"error";C(r),"loaded"===r&&e&&R(!0)},[l,b,y,g,v.crossOrigin,v.referrerPolicy,a,C,R]);let O=l?{"data-loading":"loading"===w?"":void 0,"data-error":"error"===w?"":void 0,"aria-hidden":"loaded"!==w||void 0,onLoad(){C("loaded")},onError(){C("error")}}:void 0,N=(0,u.useStableCallback)(e=>{o?.(e),x(e)});(0,c.useIsoLayoutEffect)(()=>{"idle"!==w&&N(w)},[w,N]),(0,c.useIsoLayoutEffect)(()=>()=>x("idle"),[x]),(0,d.useOpenChangeComplete)({enabled:!S,open:S,ref:E,onComplete(){S||R(!1)}});let A=l||k,P={};void 0!==g&&(P.sizes=g),void 0!==y&&(P.srcSet=y),void 0!==b&&(P.src=b);let M=(0,r.useRenderElement)("img",e,{state:{imageLoadingStatus:w,transitionStatus:l&&"ending"===j?void 0:j},ref:[n,E],props:[O,v,P],stateAttributesMapping:m,enabled:A});return A?M:null});var y=e.i(39957);let b=t.forwardRef(function(e,n){let{className:s,render:o,delay:l=0,style:u,...c}=e,{imageLoadingStatus:d}=i(),[h,f]=t.useState(0===l),p=(0,y.useTimeout)();return t.useEffect(()=>(l>0?p.start(l,()=>f(!0)):f(!0),p.clear),[p,l]),(0,r.useRenderElement)("span",e,{state:{imageLoadingStatus:d},ref:n,props:c,stateAttributesMapping:a,enabled:"loaded"!==d&&(0===l||h)})});e.s(["Fallback",0,b,"Image",0,g,"Root",0,l],14751);var v=e.i(14751);e.s(["Avatar",0,v],52376)},80862,e=>{"use strict";e.s(["endingStyle",0,"data-ending-style","startingStyle",0,"data-starting-style"])},74354,e=>{"use strict";var t=e.i(80862);let r={[t.startingStyle]:""},n={[t.endingStyle]:""};e.s(["transitionStatusMapping",0,{transitionStatus:e=>"starting"===e?r:"ending"===e?n:null}])},37584,22640,e=>{"use strict";var t=e.i(71645),r=e.i(67865),n=e.i(74080),s=e.i(8445),i=e.i(94603),a=e.i(80862);let o=null;function l(e,t=!1,u=!1){let c=(0,s.useAnimationFrame)();return(0,r.useStableCallback)((r,s=null)=>{c.cancel();let l=(0,i.resolveRef)(e);if(null==l)return;let d=()=>{if(!u)return void n.flushSync(r);if(!o){let e=[];o=e,queueMicrotask(()=>{o=null,n.flushSync(()=>{for(let t of e)t()})})}o.push(()=>{s?.aborted||r()})};if("function"!=typeof l.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)return void r();function h(){Promise.all(l.getAnimations().map(e=>e.finished)).then(()=>{s?.aborted||d()},()=>{s?.aborted||(l.getAnimations().some(e=>e.pending||"finished"!==e.playState)?h():d())})}if(t){let e=a.startingStyle;if(!l.hasAttribute(e))return void c.request(h);let t=new MutationObserver(()=>{l.hasAttribute(e)||(t.disconnect(),h())});return t.observe(l,{attributes:!0,attributeFilter:[e]}),void s?.addEventListener("abort",()=>t.disconnect(),{once:!0})}c.request(h)})}e.s(["useAnimationsFinished",0,l],22640),e.s(["useOpenChangeComplete",0,function(e){let{enabled:n=!0,open:s,ref:i,batch:a=!1,onComplete:o}=e,u=(0,r.useStableCallback)(o),c=l(i,s,a);t.useEffect(()=>{if(!n)return;let e=new AbortController;return c(u,e.signal),()=>{e.abort()}},[n,s,u,c])}],37584)},23910,e=>{"use strict";var t=e.i(71645),r=e.i(46376),n=e.i(8445);e.s(["useTransitionStatus",0,function(e,s=!1,i=!1,a=!1){let[o,l]=t.useState(e&&s?"idle":void 0),[u,c]=t.useState(e&&!a);return e&&!u&&(c(!0),l("starting")),e||!u||"ending"===o||i||l("ending"),e||u||"ending"!==o||l(void 0),(0,r.useIsoLayoutEffect)(()=>{if(!e&&u&&"ending"!==o&&i){let e=n.AnimationFrame.request(()=>{l("ending")});return()=>{n.AnimationFrame.cancel(e)}}},[e,u,o,i]),(0,r.useIsoLayoutEffect)(()=>{if(!e||s)return;let t=n.AnimationFrame.request(()=>{l(void 0)});return()=>{n.AnimationFrame.cancel(t)}},[s,e]),(0,r.useIsoLayoutEffect)(()=>{if(!e||!s)return;e&&u&&"idle"!==o&&l("starting");let t=n.AnimationFrame.request(()=>{l("idle")});return()=>{n.AnimationFrame.cancel(t)}},[s,e,u,o]),{mounted:u,setMounted:c,transitionStatus:o}}])},94603,e=>{"use strict";e.s(["resolveRef",0,function(e){return null==e?e:"current"in e?e.current:e}])},8445,e=>{"use strict";e.i(47167);var t=e.i(88940),r=e.i(26300);let n=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||null!==this.callbacks[t]&&(this.callbacks[t]=null,this.callbacksCount-=1)}};class s{static create(){return new s}static request(e){return n.request(e)}static cancel(e){return n.cancel(e)}currentId=null;request(e){this.cancel(),this.currentId=n.request(()=>{this.currentId=null,e()})}cancel=()=>{null!==this.currentId&&(n.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel}e.s(["AnimationFrame",0,s,"useAnimationFrame",0,function(){let e=(0,t.useRefWithInit)(s.create).current;return(0,r.useOnMount)(e.disposeEffect),e}])},26300,e=>{"use strict";var t=e.i(71645),r=e.i(56789);e.s(["useOnMount",0,function(e){t.useEffect(e,r.EMPTY_ARRAY)}])},39957,e=>{"use strict";var t=e.i(88940),r=e.i(26300);class n{static create(){return new n}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}e.s(["Timeout",0,n,"useTimeout",0,function(){let e=(0,t.useRefWithInit)(n.create).current;return(0,r.useOnMount)(e.disposeEffect),e}])},79432,19002,11147,e=>{"use strict";var t=e.i(56420);let r={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};r.node;let n=(0,t.default)(r);e.s(["Activity",0,n],79432);let s={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};s.node;let i=(0,t.default)(s);e.s(["CirclePause",0,i],19002);let a={name:"octagon-pause",size:24,node:[["path",{d:"M10 15V9",key:"1lckn7"}],["path",{d:"M14 15V9",key:"1muqhk"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],aliases:["pause-octagon"]};a.node;let o=(0,t.default)(a);e.s(["OctagonPause",0,o],11147)},26091,e=>{"use strict";var t=e.i(56420);let r={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};r.node;let n=(0,t.default)(r);e.s(["FileText",0,n],26091)},49287,e=>{"use strict";var t=e.i(56420);let r={name:"ship",size:24,node:[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 9.189V13",key:"yp40p3"}],["path",{d:"M19 12V6a2 2 0 00-2-2H7a2 2 0 00-2 2v6",key:"1wcigf"}],["path",{d:"M19.38 19A11.6 11.6 0 0021 13l-8.188-3.639a2 2 0 00-1.624 0L3 13.001a11.6 11.6 0 002.81 7.76",key:"1kdp0u"}],["path",{d:"M2 20c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"1l8w7g"}]]};r.node;let n=(0,t.default)(r);e.s(["Ship",0,n],49287)},22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return v}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(90809),a=e.r(43476),o=i._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),h=e.r(5550),f=e.r(88540),p=e.r(91949),m=e.r(73668),g=e.r(9396);function y(t){var r;let n,s,i,[y,v]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),x=(0,o.useRef)(null),{href:w,as:C,children:S,prefetch:k=null,passHref:j,replace:R,shallow:E,scroll:T,onClick:O,onMouseEnter:N,onTouchStart:A,legacyBehavior:P=!1,onNavigate:M,transitionTypes:I,ref:L,unstable_dynamicOnHover:D,..._}=t;n=S,P&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let $=o.default.useContext(u.AppRouterContext),z=!1!==k,F=!1===k?"none":!0===k?"full":"auto",q="none"!==F?"auto"===F?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,B="string"==typeof(r=C||w)?r:(0,l.formatUrl)(r);if(P){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=o.default.Children.only(n)}let Q=P?s&&"object"==typeof s&&s.ref:L,H,U=o.default.useCallback(e=>(null!==$&&(x.current=(0,p.mountLinkInstance)(e,B,$,q,z,v,H)),()=>{x.current&&((0,p.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,p.unmountPrefetchableInstance)(e)}),[z,B,$,q,v,H]),W={ref:(0,c.useMergedRef)(U,Q),onClick(t){P||"function"!=typeof O||O(t),P&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,s,i,a,l,u="none"){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:h}=e.r(99781);o.default.startTransition(()=>{h(r,s?"replace":"push",!1===i?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,l,u)})}}(t,B,x,R,T,M,I,F)},onMouseEnter(e){P||"function"!=typeof N||N(e),P&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),$&&z&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){P||"function"!=typeof A||A(e),P&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),$&&z&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(B)?W.href=B:P&&!j&&("a"!==s.type||"href"in s.props)||(W.href=(0,h.addBasePath)(B)),i=P?o.default.cloneElement(s,W):(0,a.jsx)("a",{..._,...W,children:n}),(0,a.jsx)(b.Provider,{value:y,children:i})}let b=(0,o.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,o.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(71645);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=i(e,n)),t&&(s.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return h},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return C}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&o.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&h(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function C(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(18967),s=e.r(52817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,a(e));else t.set(r,a(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},95057,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return o},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(90809)._(e.r(98183)),a=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",o=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),s&&"/"!==s[0]&&(s="/"+s)):u||(u=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),s=s.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${s}${c}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return o(e)}},24010,e=>{"use strict";var t=e.i(43476);e.s([],58762),e.i(58762);var r=e.i(66250),n=e.i(2820),s=e.i(56736),i=e.i(9793),a=e.i(84324),o=e.i(64951),l=e.i(77173);let u=e.i(13488).DialogTrigger;var c=e.i(74217),d=e.i(25326);class h extends d.DialogHandle{}e.s(["Backdrop",()=>n.DialogBackdrop,"Close",()=>s.DialogClose,"Description",()=>i.DialogDescription,"Handle",0,h,"Popup",()=>a.DialogPopup,"Portal",()=>o.DialogPortal,"Root",0,function(e){return(0,r.useRenderDialogRoot)("alert-dialog",e)},"Title",()=>l.DialogTitle,"Trigger",0,u,"Viewport",()=>c.DialogViewport,"createHandle",0,function(){return new h}],34604);var f=e.i(34604),f=f,p=e.i(90063),m=e.i(94945);e.s(["AlertDialog",0,function(e){return(0,t.jsx)(f.Root,{"data-slot":"alert-dialog",...e})},"AlertDialogClose",0,function(e){return(0,t.jsx)(f.Close,{"data-slot":"alert-dialog-close",...e})},"AlertDialogContent",0,function({className:e,size:r,children:n,...s}){return(0,t.jsxs)(f.Portal,{children:[(0,t.jsx)(f.Backdrop,{"data-slot":"alert-dialog-overlay",className:m.dialogSurface.overlay}),(0,t.jsx)(f.Popup,{"data-slot":"alert-dialog-content",className:(0,p.classNames)(m.dialogSurface.popup({size:r}),e),...s,children:n})]})},"AlertDialogDescription",0,function({className:e,...r}){return(0,t.jsx)(f.Description,{"data-slot":"alert-dialog-description",className:(0,p.classNames)(m.dialogSurface.description,e),...r})},"AlertDialogFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,p.classNames)(m.dialogSurface.footer,e),...r})},"AlertDialogHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,p.classNames)(m.dialogSurface.header,e),...r})},"AlertDialogTitle",0,function({className:e,...r}){return(0,t.jsx)(f.Title,{"data-slot":"alert-dialog-title",className:(0,p.classNames)(m.dialogSurface.title,e),...r})}],24010)},94859,26478,e=>{"use strict";var t=e.i(43476),r=e.i(52376),n=e.i(25913),s=e.i(49287),i=e.i(56420);let a={name:"user-round",size:24,node:[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],aliases:["user-2"]};a.node;let o=(0,i.default)(a);e.s(["UserRound",0,o],26478);var l=e.i(90063);let u=(0,n.cva)("inline-flex shrink-0 items-center justify-center overflow-hidden font-semibold uppercase select-none",{variants:{kind:{app:"rounded-sm bg-primary text-primary-foreground",account:"rounded-full bg-secondary font-sans text-foreground",ship:"rounded-sm bg-secondary font-mono text-foreground",argo:"rounded-sm bg-highlight text-primary",retired:"rounded-sm border border-dashed border-input font-mono font-medium text-muted-foreground"},size:{20:"size-5 text-micro [&_svg]:size-3",28:"size-7 text-micro [&_svg]:size-(--size-icon-sm)",36:"size-9 text-caption [&_svg]:size-(--size-icon)"}},defaultVariants:{kind:"ship",size:28}});e.s(["Avatar",0,function({kind:e="ship",size:n,name:i="",className:a}){let c=e??"ship";return(0,t.jsx)(r.Avatar.Root,{"aria-hidden":!0,"data-slot":"avatar",className:(0,l.classNames)(u({kind:e,size:n}),a),children:(0,t.jsx)(r.Avatar.Fallback,{children:"app"===c?(0,t.jsx)(s.Ship,{"aria-hidden":!0}):"argo"===c?(0,t.jsx)(o,{"aria-hidden":!0}):i.replaceAll("-","").slice(0,2)})})}],94859)},61966,8734,e=>{"use strict";var t=e.i(43476),r=e.i(89664),n=e.i(56420);let s={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};s.node;let i=(0,n.default)(s);e.s(["Copy",0,i],8734);var a=e.i(71645),o=e.i(15905);e.s(["CopyButton",0,function({value:e,label:n,size:s="xs",isLabeled:l=!1,onCopied:u,onCopyFailed:c,className:d,"data-testid":h}){let[f,p]=(0,a.useState)(!1);async function m(){try{await navigator.clipboard.writeText(e)}catch{c?.();return}p(!0),u?.(),setTimeout(()=>{p(!1)},1500)}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Button,{variant:"ghost",size:s,isIconOnly:!l,"aria-label":n,title:l?void 0:n,icon:f?(0,t.jsx)(r.Check,{"aria-hidden":!0}):(0,t.jsx)(i,{"aria-hidden":!0}),className:d,"data-testid":h,onClick:()=>{m()},children:l?f?"Copied":"Copy":null}),(0,t.jsx)("span",{role:"status",className:"sr-only",children:f?"Copied.":""})]})}],61966)},81830,e=>{"use strict";var t=e.i(43476),r=e.i(79432),n=e.i(19002),s=e.i(11147),i=e.i(90063),a=e.i(49635),o=e.i(93361);let l={working:r.Activity,blocked:s.OctagonPause,idle:n.CirclePause},u={active:"text-tone-active-fg",waiting:"text-tone-waiting-fg",ended:"text-tone-ended-fg"};e.s(["ReportLine",0,function({report:e,now:r,variant:n,isTimeInTitle:s=!1,testId:c}){let d="full"===n,h=(0,i.classNames)("flex min-w-0 items-center gap-1.5",d?"text-body":"text-meta");if(null===e)return(0,t.jsx)("span",{"data-testid":c,"data-state":"none",className:(0,i.classNames)(h,"text-muted-foreground"),children:"No report yet"});let f=l[e.state],p=u[o.REPORT_TONES[e.state]],m=new Date(e.reportedAt);return(0,t.jsxs)("span",{"data-testid":c,"data-state":e.state,title:s?`${(0,o.reportText)(e)} \xb7 ${(0,o.reportedWhen)(m,r)}`:(0,o.reportText)(e),className:h,children:[(0,t.jsx)(f,{"aria-hidden":!0,className:(0,i.classNames)("size-(--size-icon-sm) shrink-0",p)}),(0,t.jsx)("span",{className:(0,i.classNames)("shrink-0 font-medium",p),children:o.REPORT_STATE_WORDS[e.state]}),null===e.note?null:(0,t.jsx)("span",{className:"min-w-0 truncate text-foreground",children:e.note}),s?null:(0,t.jsx)("time",{dateTime:e.reportedAt,title:(0,a.fullDateTime)(m),className:"shrink-0 text-muted-foreground tabular-nums",children:d?`\xb7 ${(0,o.reportedWhen)(m,r)}`:(0,o.reportAge)(m,r)})]})}])},39874,82880,3067,42211,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(26808),s=e.i(48695),i=e.i(15905),a=e.i(10818),o=e.i(25398),l=e.i(22212),u=e.i(94945),c=e.i(19321),d=e.i(66616),h=e.i(61966),f=e.i(60592);function p({crewLines:e,subject:n,testIdPrefix:s,onCopied:i,onCopyFailed:a}){let[o,l]=(0,r.useState)(e[0]?.harness),u=e.find(e=>e.harness===o)??e[0];if(!u)return null;let c=(0,d.crewLineHarnessWord)(u.harness);return(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[(0,t.jsx)(f.Tabs,{value:u.harness,onValueChange:t=>{let r=e.find(e=>e.harness===t);r&&l(r.harness)},children:(0,t.jsx)(f.TabsList,{"aria-label":`Crew ${n} from`,children:e.map(e=>(0,t.jsx)(f.TabsTrigger,{value:e.harness,"data-testid":`${s}-${e.harness}-tab`,children:(0,d.crewLineHarnessWord)(e.harness)},e.harness))})}),(0,t.jsx)("code",{"data-testid":`${s}-${u.harness}`,title:u.line,className:"min-w-0 grow truncate rounded-md bg-muted px-2 py-1 font-mono text-code text-foreground",children:u.line}),(0,t.jsx)(h.CopyButton,{value:u.line,label:`Copy the ${c} crew line for ${n}`,isLabeled:!0,onCopied:i,onCopyFailed:a,"data-testid":`${s}-${u.harness}-copy`})]})}e.s(["CompactCrewLine",0,p],82880);var m=e.i(17981),g=e.i(26091);function y({note:e,model:r,template:n,testId:s}){return null===e&&null===r?null:(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-muted px-3 py-2 text-meta",children:[(0,t.jsx)(g.FileText,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:["Launch note",void 0===n?"":` \xb7 ${n}`]}),null!==e&&(0,t.jsx)("span",{"data-testid":s,children:e}),null!==r&&(0,t.jsxs)("span",{children:["Runs ",(0,t.jsx)("span",{className:"font-mono",children:r})]})]})]})}function b({memberName:e,template:r,launchNote:n,model:s,crewLines:i}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y,{note:n,model:s,template:r,testId:"crew-line-launch-note"}),(0,t.jsx)(p,{crewLines:i,subject:e,testIdPrefix:"crew-line-text"}),(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(a.Info,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Shown once."})," Paste the crew line into Claude Code or Codex started where the launch note says, or into a chat client with the fleet’s connector. A new crew line stops it working."]})]})]})}function v({memberName:e,state:r,template:n,launchNote:s=null,model:a=null,crewLines:d,error:h,isOpen:f,onOpenChange:p,onConfirm:g}){let y="issuing"===r;return(0,t.jsx)(l.Dialog,{open:f,onOpenChange:e=>{y||p(e)},children:(0,t.jsxs)(l.DialogContent,{size:"md","data-testid":"crew-line-dialog",className:u.dialogSurface.phoneFullScreen,children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsxs)(l.DialogTitle,{children:["Crew line for ",e]}),(0,t.jsx)(l.DialogDescription,{children:"Start Claude Code or Codex where the launch note says, or open a chat client with the fleet’s connector, then paste its crew line. The member is on station once its session checks in."})]}),y&&(0,t.jsxs)("div",{"aria-busy":!0,className:"flex flex-col gap-3",children:[(0,t.jsx)("span",{className:"sr-only",children:"Issuing a crew line..."}),(0,t.jsx)(c.Skeleton,{className:"h-10 w-full rounded-lg"}),(0,t.jsx)(c.Skeleton,{className:"h-28 w-full rounded-lg"})]}),"shown"===r&&void 0!==d&&(0,t.jsx)(b,{memberName:e,template:n,launchNote:s,model:a,crewLines:d}),"error"===r&&(0,t.jsx)(m.InlineError,{title:"Couldn’t issue a crew line",description:`${h??"The squadron manager did not answer."} No new secret was created; an earlier crew line still works.`}),(0,t.jsxs)(l.DialogFooter,{children:[("shown"===r||y)&&(0,t.jsx)(l.DialogClose,{render:(0,t.jsx)(i.Button,{variant:"primary","data-testid":"crew-line-done",disabled:y}),children:"Done"}),"error"===r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.DialogClose,{render:(0,t.jsx)(i.Button,{}),children:"Close"}),(0,t.jsx)(i.Button,{variant:"primary",icon:(0,t.jsx)(o.RotateCw,{"aria-hidden":!0}),"data-testid":"crew-line-retry",onClick:g,children:"Try again"})]})]})]})})}e.s(["LaunchNote",0,y],3067),e.s(["CrewLineDialog",0,v],42211);var x=e.i(24010);function w({memberName:e,replacedText:r,isOpen:n,onOpenChange:s,onConfirm:a}){return(0,t.jsx)(x.AlertDialog,{open:n,onOpenChange:s,children:(0,t.jsxs)(x.AlertDialogContent,{"data-testid":"new-crew-line-confirm",className:u.dialogSurface.phoneSheet,children:[(0,t.jsxs)(x.AlertDialogHeader,{children:[(0,t.jsxs)(x.AlertDialogTitle,{children:["Get a new crew line for ",e,"?"]}),(0,t.jsx)(x.AlertDialogDescription,{children:r??"Its new secret is shown once, with its launch note."})]}),(0,t.jsxs)(x.AlertDialogFooter,{children:[(0,t.jsx)(x.AlertDialogClose,{render:(0,t.jsx)(i.Button,{}),children:"Cancel"}),(0,t.jsx)(i.Button,{variant:"primary","data-testid":"new-crew-line-confirm-submit",onClick:a,children:"Get new crew line"})]})]})})}function C(e){let i=(0,s.useNewCrewLine)(),[a,o]=(0,r.useState)(!1),[l,u]=(0,r.useState)(!1),[c,d]=(0,r.useState)(void 0),h=()=>{e&&i.mutate({squadronId:e.squadronId,shipId:e.member.shipId})},f=i.data?"shown":i.isError?"error":"issuing";return{isReady:e?.ship!==void 0,start:()=>{e?.ship&&(i.reset(),d((0,n.newCrewLineReplaced)(e.ship)),u(!0))},dialog:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{memberName:e.member.name,replacedText:c,isOpen:l,onOpenChange:u,onConfirm:()=>{u(!1),o(!0),h()}}),(0,t.jsx)(v,{memberName:e.member.name,state:f,template:e.template,launchNote:i.data?.launchNote,model:i.data?.model,crewLines:i.data?.crewLines,error:i.error?.message,isOpen:a,onOpenChange:e=>{o(e),e||i.reset()},onConfirm:h})]}):null}}e.s(["GetNewCrewLine",0,function({isPrimary:e=!1,testId:r,...n}){let s=C(n);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Button,{size:"xs",variant:e?"primary":"secondary",disabled:!s.isReady,"data-testid":r,onClick:s.start,children:"Get new crew line"}),s.dialog]})},"useNewCrewLineFlow",0,C],39874)},66616,e=>{"use strict";let t={"claude-code":{word:"Claude Code",kind:"coding"},codex:{word:"Codex",kind:"coding"},"claude-chat":{word:"Claude chat",kind:"chat"},chatgpt:{word:"ChatGPT",kind:"chat"},grok:{word:"Grok",kind:"chat"},grokbot:{word:"Grokbot",kind:"bot"},console:{word:"Console",kind:"console"}};function r(e){return t[e]?.word??e}e.s(["crewLineHarnessWord",0,function(e){return"chat"===e?"Chat":r(e)},"harnessKind",0,function(e){return t[e]?.kind},"harnessWord",0,r])},93361,e=>{"use strict";e.i(31627);var t=e.i(94661),r=e.i(49635);let n={working:"Working",blocked:"Blocked",idle:"Idle"};e.s(["REPORT_STATE_WORDS",0,n,"REPORT_TONES",0,{working:"active",blocked:"waiting",idle:"ended"},"reportAge",0,function(e,t){let n=Math.max(0,t.getTime()-e.getTime());return n<6e4?`${String(Math.floor(n/1e3))} s`:n<36e5?`${String(Math.floor(n/6e4))} min`:n<864e5?`${String(Math.floor(n/36e5))} h`:(0,r.relativeTime)(e,t)},"reportDetailsJson",0,function(e){return JSON.stringify(e,null,2)},"reportDetailsLabel",0,function(e){return`JSON \xb7 ${String((0,t.reportDetailsBytes)(e))} bytes`},"reportText",0,function(e){let t=n[e.state];return null===e.note?t:`${t}: ${e.note}`},"reportedWhen",0,function(e,t){let n=(0,r.relativeTime)(e,t);return`reported ${"Just now"===n?"just now":n}`}])},26808,e=>{"use strict";var t=e.i(46150);let r={one:"delivery",many:"deliveries"};function n(e){if(0===e)return"Nothing is in flight, so no delivery moves.";let r=1===e?"returns":"return";return`${(0,t.counted)(e,{one:"in-flight delivery",many:"in-flight deliveries"})} ${r} to pending. Nothing is lost.`}e.s(["abandonedLine",0,function(e){return`${(0,t.counted)(e,r)} will be abandoned`},"inFlightLine",0,n,"isTypedMatch",0,function(e,t){return t===e},"newCrewLineReplaced",0,function(e){if("crewed"===e.status){let t=null===e.location?"the session crewing it":`the session on ${e.location.description??e.location.kind.toLowerCase()}`;return`This ends ${t}. ${n(e.inFlightDeliveries)}`}if(null!==e.startingPrompt&&!e.startingPrompt.isClaimed)return"The crew line issued earlier, not claimed yet, stops working."},"retireButtonLabel",0,function(e){return 0===e?"Retire ship":`Retire and abandon ${(0,t.counted)(e,r)}`}])},53573,e=>{"use strict";e.i(31627);var t=e.i(83615),r=e.i(19273),n=e.i(12598),s=e.i(81384),i=e.i(73664),a=e.i(27001),o=e.i(54440),l=e.i(71645),u=e.i(15823),c=e.i(40143),d=e.i(69230);function h(e,t){let r=new Set(t);return e.filter(e=>!r.has(e))}var f=class extends u.Subscribable{#e;#t;#r;#n;#s;#i;#a;#o;#l;#u=[];constructor(e,t,r){super(),this.#e=e,this.#n=r,this.#r=[],this.#s=[],this.#t=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#s.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#n=t,c.notifyManager.batch(()=>{let e=this.#s,t=this.#d(this.#r);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),s=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,r)=>t!==e[r]),o=i||a,l=!!o||s.some((e,t)=>{let n=this.#t[t];return!n||!(0,r.shallowEqualObjects)(e,n)});(o||l)&&(o&&(this.#u=t,this.#s=n),this.#t=s,this.hasListeners()&&(o&&(h(e,n).forEach(e=>{e.destroy()}),h(n,e).forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){let r=this.#d(e),n=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),s=r.map(e=>e.defaultedQueryOptions.queryHash);return[n,e=>this.#f(e??n,t,s),()=>this.#p(n,r)]}#p(e,t){let r=new Set;return t.map((n,s)=>{let i=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{r.has(e)||(r.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#f(e,t,n){if(t){let s=this.#l,i=void 0!==n&&void 0!==s&&(s.length!==n.length||n.some((e,t)=>e!==s[t]));return(this.#t!==this.#o||i||t!==this.#a)&&(this.#a=t,this.#o=this.#t,void 0!==n&&(this.#l=n),this.#i=(0,r.replaceEqualDeep)(this.#i,t(e))),this.#i}return e}#m(){return!this.#n?.combine||this.#s.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#d(e){let t=new Map;this.#s.forEach(e=>{let r=e.options.queryHash;if(!r)return;let n=t.get(r);n?n.push(e):t.set(r,[e])});let r=[];return e.forEach(e=>{let n=this.#e.defaultQueryOptions(e),s=t.get(n.queryHash)?.shift()??new d.QueryObserver(this.#e,n);r.push({defaultedQueryOptions:n,observer:s})}),r}#c(e,t){let r=this.#s.indexOf(e);-1!==r&&(this.#t=this.#t.slice(),this.#t[r]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#m(),t=this.#i,r=e?t:this.#f(this.#p(this.#t,this.#u),this.#n?.combine);(e||t!==r)&&c.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},p=e.i(66027),m=e.i(5387),g=e.i(27702);e.s(["useMessage",0,function(e){let t=(0,g.useTRPC)();return(0,p.useQuery)(t.fleet.message.queryOptions(void 0===e?r.skipToken:{messageId:e}))},"useShip",0,function(e){let t=(0,g.useTRPC)();return(0,p.useQuery)(t.fleet.ship.queryOptions(void 0===e?r.skipToken:{shipId:e},{refetchInterval:m.LAST_SEEN_REFRESH_MS}))},"useShipMessages",0,function(e){let t=(0,g.useTRPC)();return(0,p.useQuery)(t.fleet.shipMessages.queryOptions({shipId:e}))},"useShipTimeline",0,function(e){let t=(0,g.useTRPC)();return(0,p.useQuery)(t.fleet.shipTimeline.queryOptions({shipId:e}))},"useShips",0,function(e){let u=(0,g.useTRPC)(),h=function({queries:e,...t}){let u=(0,n.useQueryClient)(void 0),h=(0,s.useIsRestoring)(),p=(0,i.useQueryErrorResetBoundary)(),m=!1!==t.subscribed,g=l.useMemo(()=>e.map(e=>{let t=u.defaultQueryOptions(e);return t._optimisticResults=h?"isRestoring":m?"optimistic":void 0,t}),[e,u,h,m]);g.forEach(e=>{(0,o.ensureSuspenseTimers)(e);let t=u.getQueryCache().get(e.queryHash);(0,a.ensurePreventErrorBoundaryRetry)(e,p,t)}),(0,a.useClearResetErrorBoundary)(p);let[y]=l.useState(()=>new f(u,g,t)),[b,v,x]=y.getOptimisticResult(g,t.combine),w=!h&&m;l.useSyncExternalStore(l.useCallback(e=>w?y.subscribe(c.notifyManager.batchCalls(e)):r.noop,[y,w]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),l.useEffect(()=>{y.setQueries(g,t)},[g,t,y]);let C=b.some((e,t)=>(0,o.shouldSuspend)(g[t],e))?b.flatMap((e,t)=>{let r=g[t];if(r&&(0,o.shouldSuspend)(r,e)){let e=new d.QueryObserver(u,r);return(0,o.fetchOptimistic)(r,e,p)}return[]}):[];if(C.length>0)throw Promise.all(C);let S=b.find((e,t)=>{let r=g[t];return r&&(0,a.getHasError)({result:e,errorResetBoundary:p,throwOnError:r.throwOnError,query:u.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(S)throw S.error;return v(x())}({queries:e.flatMap(e=>{let r=(0,t.idSchema)("ship").safeParse(e);return r.success?[r.data]:[]}).map(e=>u.fleet.ship.queryOptions({shipId:e},{refetchInterval:m.LAST_SEEN_REFRESH_MS}))}),p=new Map;for(let e of h)e.data&&p.set(e.data.id,e.data);return p}],53573)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21607,e=>{"use strict";var t=e.i(43476);e.i(31627);var s=e.i(83615),a=e.i(18566),n=e.i(71645),i=e.i(60592),r=e.i(44824),d=e.i(45608),l=e.i(95475),o=e.i(2767),c=e.i(56420);let p={name:"mail-question-mark",size:24,node:[["path",{d:"M22 10.5V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h12.5",key:"e61zoh"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"M18 15.28c.2-.4.5-.8.9-1a2.1 2.1 0 0 1 2.6.4c.3.4.5.8.5 1.3 0 1.3-2 2-2 2",key:"7z9rxb"}],["path",{d:"M20 22v.01",key:"12bgn6"}]],aliases:["mail-question"]};p.node;let m=(0,c.default)(p),u={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};u.node;let h=(0,c.default)(u);var x=e.i(69693),g=e.i(49635),f=e.i(46150),b=e.i(91703),j=e.i(15905),v=e.i(61966),y=e.i(75305),w=e.i(19321),k=e.i(67874),N=e.i(39448);function S({parts:e,className:s}){let a;return(0,t.jsx)("span",{className:s,children:(a=new Map,e.map(e=>{let t="text"===e.kind?`text:${e.text}`:`ship:${e.party.id}`,s=a.get(t)??0;return a.set(t,s+1),{key:`${t}#${String(s)}`,part:e}})).map(({key:e,part:s})=>"text"===s.kind?(0,t.jsx)("span",{children:s.text},e):(0,t.jsx)(N.ShipName,{name:s.party.name,shipId:s.party.id,isSuffixShown:s.party.name!==f.OPERATOR_NAME,className:"align-baseline"},e))})}var T=e.i(78865),C=e.i(40798);function R(e){return e.ship?[(0,f.ship)(e.ship)]:[(0,f.text)("a ship")]}var A=e.i(66390);function D({entries:e,recipient:s}){return(0,t.jsx)("ol",{"data-testid":"delivery-history","aria-label":"Delivery history",className:"flex flex-col",children:e.map((a,n)=>{let i=new Date(a.occurredAt);return(0,t.jsxs)("li",{"data-testid":"delivery-history-entry","data-type":a.type,className:"relative flex gap-3 pb-4 last:pb-0",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"relative flex w-3 shrink-0 justify-center",children:[(0,t.jsx)("span",{className:"mt-1.5 size-2.5 rounded-full border-2 border-muted-foreground bg-card"}),n<e.length-1?(0,t.jsx)("span",{className:"absolute top-5 bottom-[-0.25rem] w-px bg-border"}):null]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(T.StatusBadge,{status:function(e){switch(e.type){case"MessageAccepted":case"DeliveryReturned":return"pending";case"DeliveryClaimed":return"delivered";case"DeliveryAcknowledged":return"acknowledged";case"DeliveryUndeliverable":return"undeliverable";case"DeliveryAbandoned":return"abandoned";case"DeliveryDismissed":return"dismissed"}}(a)}),(0,t.jsx)("time",{dateTime:a.occurredAt,title:(0,g.fullDateTime)(i),className:"font-mono text-id text-muted-foreground tabular-nums",children:(0,g.secondsTime)(i)}),0===n?(0,t.jsx)(A.Badge,{variant:"outline",children:"Current"}):null]}),(0,t.jsx)(S,{parts:function(e,t){switch(e.type){case"MessageAccepted":return"ship"===t.kind?[(0,f.text)("Stored in the inbox of "),(0,f.ship)(t.ship),(0,f.text)(".")]:[(0,f.text)(`Queued for any ship of type ${t.type}.`)];case"DeliveryClaimed":{let t=null!==e.attempts&&e.attempts>1?`Attempt ${String(e.attempts)}: claimed`:"Claimed";return[(0,f.text)(`${t} by `),...R(e),...function(e){if(null===e)return[];let t=null!==e.description&&""!==e.description?e.description:(0,C.locationKindWord)(e.kind);return[(0,f.text)(`, session on ${t}`)]}(e.location),(0,f.text)(".")]}case"DeliveryReturned":return"ship"===t.kind?[(0,f.text)("Back in the inbox: the session of "),...R(e),(0,f.text)(" ended before acknowledging it.")]:[(0,f.text)("Returned to the queue: the session of "),...R(e),(0,f.text)(" ended before acknowledging it.")];case"DeliveryAcknowledged":return[(0,f.text)("Acknowledged by "),...R(e),(0,f.text)(".")];case"DeliveryUndeliverable":return[(0,f.text)(null===e.attempts?"Never acknowledged: no ship takes it automatically any more.":`Received ${String(e.attempts)} times, never acknowledged.`)];case"DeliveryAbandoned":return[(0,f.text)("Abandoned: "),...R(e),(0,f.text)(" was retired before taking it.")];case"DeliveryDismissed":return[(0,f.text)("Dismissed by the operator: no ship takes it any more.")]}}(a,s),className:"text-meta text-muted-foreground max-sm:text-body-touch"})]})]},a.seq)})})}let M="text-section font-semibold text-foreground";function I({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-3 py-2 last:border-b-0",children:[(0,t.jsx)("dt",{className:"w-24 shrink-0 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 $({message:e}){let s=e.recipient;return(0,t.jsxs)("dl",{"aria-label":"Envelope",className:"overflow-hidden rounded-lg border border-border bg-card",children:[(0,t.jsxs)(I,{label:"Message id",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.id}),(0,t.jsx)(v.CopyButton,{value:e.id,label:"Copy message id"})]}),(0,t.jsx)(I,{label:"From",children:(0,t.jsx)(N.ShipName,{name:e.sender.name,shipId:e.sender.id,isSuffixShown:e.sender.name!==f.OPERATOR_NAME})}),(0,t.jsx)(I,{label:"To",children:"ship"===s.kind?(0,t.jsx)(N.ShipName,{name:s.ship.name,shipId:s.ship.id,isSuffixShown:s.ship.name!==f.OPERATOR_NAME}):(0,t.jsxs)("span",{children:["Any ship of type ",(0,t.jsx)("span",{className:"font-mono text-id",children:s.type})]})}),(0,t.jsx)(I,{label:"Sent",children:(0,t.jsx)("time",{dateTime:e.sentAt,className:"tabular-nums",children:(0,g.fullDateTime)(new Date(e.sentAt))})}),null===e.model?null:(0,t.jsx)(I,{label:"Model",children:(0,t.jsx)("span",{className:"truncate font-mono text-id","data-testid":"message-model",children:e.model})}),e.inReplyTo?(0,t.jsx)(I,{label:"In reply to",children:(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.inReplyTo})}):null]})}function z({message:e}){let s=(0,x.payloadLabel)(e.payload,e.contentType),a=(0,x.formattedPayload)(e.payload,e.contentType),n=(0,t.jsx)(b.CodeBlock,{label:s,code:e.payload,isWrapped:!0,copyLabel:"Copy payload",codeTestId:"message-payload"});return void 0===a?(0,t.jsxs)("section",{"aria-label":"Payload",className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:M,children:"Payload"}),n]}):(0,t.jsx)("section",{"aria-label":"Payload",className:"flex flex-col gap-2",children:(0,t.jsxs)(i.Tabs,{defaultValue:"formatted",className:"gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:M,children:"Payload"}),(0,t.jsxs)(i.TabsList,{className:"max-sm:w-auto",children:[(0,t.jsx)(i.TabsTrigger,{value:"formatted",children:"Formatted"}),(0,t.jsx)(i.TabsTrigger,{value:"raw",children:"Raw"})]})]}),(0,t.jsx)(i.TabsContent,{value:"formatted",children:(0,t.jsx)(b.CodeBlock,{label:s,code:a,copyValue:e.payload,copyLabel:"Copy payload",codeTestId:"message-payload"})}),(0,t.jsx)(i.TabsContent,{value:"raw",children:n})]})})}function q({message:e}){return(0,t.jsxs)("section",{"aria-label":"Delivery",className:"flex flex-col gap-2 max-sm:order-first",children:[(0,t.jsx)("h3",{className:M,children:"Delivery"}),(0,t.jsx)("div",{className:"rounded-lg border border-border bg-card p-3",children:(0,t.jsx)(D,{entries:e.delivery.history,recipient:e.recipient})})]})}function O(){return(0,t.jsxs)("div",{"aria-busy":!0,className:"flex flex-col gap-4",children:[(0,t.jsx)("span",{className:"sr-only",children:"Loading the message"}),(0,t.jsx)(w.Skeleton,{className:"h-32 w-full rounded-lg"}),(0,t.jsx)(w.Skeleton,{className:"h-28 w-full rounded-lg"}),(0,t.jsx)(w.Skeleton,{className:"h-40 w-full rounded-lg"})]})}function E({message:e,messageId:s,state:a,isOpen:n,onOpenChange:i,onReply:r}){let d="ready"===a&&void 0!==e;return(0,t.jsx)(y.Sheet,{open:n,onOpenChange:i,children:(0,t.jsxs)(y.SheetContent,{side:"right","data-testid":"message-sheet",children:[(0,t.jsx)(y.SheetHeader,{children:d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(y.SheetTitle,{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,t.jsx)("span",{children:"Message from"}),(0,t.jsx)(N.ShipName,{name:e.sender.name,shipId:e.sender.id,isSuffixShown:e.sender.name!==f.OPERATOR_NAME,className:"text-heading"})]}),(0,t.jsxs)(y.SheetDescription,{children:[(0,t.jsx)(S,{parts:"ship"===e.recipient.kind?[(0,f.text)("To "),(0,f.ship)(e.recipient.ship)]:[(0,f.text)(`To any ship of type ${e.recipient.type}`)]}),". ",(0,T.statusLabel)(e.delivery.state),"."]}),r&&e.sender.name!==f.OPERATOR_NAME?(0,t.jsx)("div",{children:(0,t.jsxs)(j.Button,{size:"xs",icon:(0,t.jsx)(h,{}),"data-testid":"message-reply",onClick:()=>{r(e)},children:["Reply to ",e.sender.name]})}):null]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.SheetTitle,{children:"Message"}),(0,t.jsx)(y.SheetDescription,{children:"not-found"===a?"Couldn’t open this message":"Loading"})]})}),(0,t.jsxs)(y.SheetBody,{className:"flex flex-col gap-5",children:["loading"===a?(0,t.jsx)(O,{}):null,"not-found"===a?(0,t.jsx)(k.EmptyState,{variant:"section",icon:(0,t.jsx)(m,{}),title:"Message not found",description:(0,t.jsxs)(t.Fragment,{children:["No message with this id exists in this fleet, or the link is incomplete.",s?(0,t.jsx)("span",{className:"mt-2 block font-mono text-id",children:s}):null]})}):null,d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)($,{message:e}),(0,t.jsx)(z,{message:e}),(0,t.jsx)(q,{message:e})]}):null]})]})})}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 P=(0,c.default)(L),B={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};B.node;let F=(0,c.default)(B),V={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};V.node;let _=(0,c.default)(V);var H=e.i(25398),U=e.i(90063);function K(e,t){return RegExp(`"${t}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)"`).exec(e)?.[1]}let W={"application/vnd.aeolus.squadron.check-in+json":()=>"Checked in at its flagship","application/vnd.aeolus.squadron.role+json":e=>{let t=K(e,"role");return void 0===t?"Given its role":`Given the role: ${t}`},"application/vnd.aeolus.squadron.on-station+json":e=>{let t=K(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"};function G(e,t){return e.sentAt.localeCompare(t.sentAt)||e.id.localeCompare(t.id)}var J=e.i(17981),Q=e.i(88393);function X({message:e,shipId:s,now:a,onOpenMessage:n}){var i,r,d;let l,o,c=e.sender.id===s,p=new Date(e.sentAt),m=void 0!==(o=W[r=(i=e).contentType,r.split(";")[0]?.trim().toLowerCase()??""])?{text:o(i.preview),isCode:!1}:(0,x.isJson)(i.contentType)?{text:0===(l=function(e){let t,s=[],a=0,n=0;for(;n<e.length;){let i=e[n]??"";if('"'===i){let{value:i,end:r}=function(e,t){let s=t+1;for(;s<e.length&&'"'!==e[s];)s+="\\"===e[s]?2:1;return{value:e.slice(t+1,s),end:s+1}}(e,n);1===a&&void 0===t&&e.slice(r).trimStart().startsWith(":")?t=i:1===a&&void 0!==t&&r<=e.length&&'"'===e[r-1]&&(s.push([t,i]),t=void 0),n=r;continue}if("{"===i||"["===i)1===a&&void 0!==t&&(s.push([t,"…"]),t=void 0),a+=1;else if("}"===i||"]"===i)a-=1;else if(1===a&&void 0!==t&&/[-\dtfn]/.test(i)){let a=/^(-?\d[\d.eE+-]*|true|false|null)/.exec(e.slice(n))?.[1];if(void 0!==a){s.push([t,a]),t=void 0,n+=a.length;continue}}n+=1}return s}(d=i.preview)).length?d:l.map(([e,t])=>`${e} ${t}`).join(" · "),isCode:!0}:{text:i.preview,isCode:!1};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":`${c?"Sent":"Received"} message: ${m.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:()=>{n(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)(c?F:P,{})}),(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)(S,{parts:c?"ship"===e.recipient.kind?[(0,f.text)("To "),(0,f.ship)(e.recipient.ship)]:[(0,f.text)(`To any ship of type ${e.recipient.type}`)]:[(0,f.text)("From "),(0,f.ship)(e.sender)],className:"text-body text-foreground max-sm:text-body-touch"}),(0,t.jsx)(T.StatusBadge,{status:e.delivery.state})]}),(0,t.jsx)("span",{"data-testid":"message-line",className:(0,U.classNames)("truncate text-muted-foreground",m.isCode?"font-mono text-id":"text-meta"),children:m.text}),(0,t.jsx)("time",{dateTime:e.sentAt,title:(0,g.fullDateTime)(p),className:"text-meta text-muted-foreground tabular-nums",children:(0,g.relativeTime)(p,a)})]})]})})}function Y({shipId:e,messages:s,state:a,onRetry:n,now:i,onOpenMessage:r}){return"loading"===a?(0,t.jsx)(Q.LoadingSkeleton,{variant:"list",rows:3,label:"Loading the messages"}):"error"===a?(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-3",children:[(0,t.jsx)(J.InlineError,{title:"Couldn’t load the messages",description:"The rest of the page is current. Try again in a moment."}),n?(0,t.jsx)(j.Button,{size:"sm",icon:(0,t.jsx)(H.RotateCw,{"aria-hidden":!0}),onClick:n,className:"self-start",children:"Try again"}):null]}):0===s.length?(0,t.jsx)(k.EmptyState,{variant:"section",icon:(0,t.jsx)(_,{}),title:"No messages yet",description:"Messages this ship sends or receives appear here as they happen."}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(function(e){let t=new Map(e.map(e=>[e.id,e])),s=new Map;for(let a of e){let e=function(e,t){let s=new Set([e.id]),a=e,n=null===a.inReplyTo?void 0:t.get(a.inReplyTo);for(;n&&!s.has(n.id);)s.add(n.id),n=null===(a=n).inReplyTo?void 0:t.get(a.inReplyTo);return a}(a,t);s.set(e.id,[...s.get(e.id)??[],a])}return[...s.entries()].map(([e,t])=>{let s=t.toSorted(G);return{id:e,messages:s,lastSentAt:s.at(-1)?.sentAt??""}}).toSorted((e,t)=>t.lastSentAt.localeCompare(e.lastSentAt)||t.id.localeCompare(e.id))})(s).map(s=>(0,t.jsx)("section",{"data-testid":"message-thread","aria-label":`Thread of ${String(s.messages.length)} ${1===s.messages.length?"message":"messages"}`,className:"overflow-hidden rounded-lg border border-border bg-card",children:(0,t.jsx)("ol",{children:s.messages.map(s=>(0,t.jsx)(X,{message:s,shipId:e,now:i,onOpenMessage:r},s.id))})},s.id))})}var Z=e.i(22016),ee=e.i(48695),et=e.i(84294),es=e.i(19249);function ea({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 flex-wrap items-center gap-1.5 text-body text-foreground",children:s})]})}function en({shipId:e,now:s}){let a=(0,ee.useSquadrons)(),n=(0,ee.useCatalogue)(),i=a.data?.find(t=>t.flagship.shipId===e||t.members.some(t=>t.shipId===e));if(!i)return null;let r=(0,t.jsx)(Z.default,{href:`/squadrons/${i.id}`,className:"font-mono hover:underline","data-testid":"ship-squadron-link",children:i.id});if(i.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)(j.Button,{size:"xs",nativeButton:!1,render:(0,t.jsx)(Z.default,{href:`/squadrons/${i.id}`}),"data-testid":"ship-open-squadron",children:"Open squadron"})]});let d=i.members.find(t=>t.shipId===e);if(!d)return null;let l=n.data?.blueprints.find(e=>e.repository===i.blueprint.repository&&e.name===i.blueprint.name&&e.version===i.blueprint.version),o=l?.roles.find(e=>e.name===d.role)?.template,c=null===d.crew.lastSeenAt?void 0:(0,g.duration)(new Date(d.crew.lastSeenAt),s);return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:["silent"===d.health&&"disbanded"!==i.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,et.checkInText)(d.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)(ea,{label:"Squadron",children:[r,(0,t.jsx)(T.StatusBadge,{status:i.state})]}),(0,t.jsxs)(ea,{label:"Role and template",children:[(0,t.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 font-mono text-id",children:d.role}),o&&(0,t.jsxs)(Z.default,{href:(0,et.templatePath)(o),className:"font-mono text-meta hover:underline",children:[o.name,"@",o.version]})]}),(0,t.jsx)(ea,{label:"Health",children:(0,t.jsx)(es.HealthIndicator,{health:d.health,detail:"silent"===d.health||"late"===d.health?c:void 0})}),(0,t.jsx)(ea,{label:"Hand-offs",children:l?(0,t.jsx)("span",{className:"text-meta",children:(0,et.handoffsText)((0,et.handoffsOf)(l,d.role))}):(0,t.jsx)(Z.default,{href:(0,et.blueprintPath)(i.blueprint),className:"text-meta text-muted-foreground hover:underline",children:"See its blueprint"})})]})]})}var ei=e.i(5894),er=e.i(73332),ed=e.i(76561),el=e.i(22768),eo=e.i(10818),ec=e.i(58925),ep=e.i(26478),em=e.i(63481),eu=e.i(66616);function eh({harness:e,model:s,testId:a}){return null===e&&null===s?null:(0,t.jsxs)("span",{"data-testid":a,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,eu.harnessWord)(e)}),null!==e&&null!==s?(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}):null,null===s?null:(0,t.jsx)("span",{className:"truncate font-mono text-id",children:s})]})}var ex=e.i(73330);function eg({ping:e,now:s,testId:a}){return null===e?null:(0,t.jsx)("span",{title:`Pinged ${(0,g.fullDateTime)(new Date(e.sentAt))}`,"data-testid":a,"data-state":e.state,className:"text-meta text-muted-foreground tabular-nums",children:(0,ex.pingLine)(e,s)})}var ef=e.i(67927),eb=e.i(93361);function ej({details:e,version:s,testId:a}){return(0,t.jsxs)("details",{"data-testid":a,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)(ef.ChevronRight,{"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)(b.CodeBlock,{label:(0,eb.reportDetailsLabel)(e),code:(0,eb.reportDetailsJson)(e),copyLabel:"Copy report details",codeTestId:`${a}-code`})})]})}var ev=e.i(81830);function ey({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 ew({ship:e,now:s}){let a,n="operator"===e.kind,i=null===e.crewedSince?null:new Date(e.crewedSince),r=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)(ey,{label:"Location",children:(0,t.jsxs)("span",{className:"inline-flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)(em.LocationTag,{kind:e.location?.kind??null,description:e.location?.description,size:"md"}),(0,t.jsx)(eh,{harness:e.harness,model:e.model?.id??null,testId:"ship-model"}),null===e.lastSeenAt?null:(0,t.jsx)("time",{dateTime:e.lastSeenAt,title:(0,g.fullDateTime)(new Date(e.lastSeenAt)),"data-testid":"ship-last-seen",className:"text-meta text-muted-foreground tabular-nums",children:(0,g.lastSeen)(new Date(e.lastSeenAt),s)}),(0,t.jsx)(eg,{ping:e.ping,now:s,testId:"ship-ping-status"}),"agent"!==e.kind?null:(0,t.jsx)(ev.ReportLine,{report:e.report,now:s,variant:"full",testId:"ship-report"})]})}),(0,t.jsx)(ey,{label:"Crewed since",children:i?(0,t.jsx)("time",{dateTime:e.crewedSince??void 0,title:(0,g.fullDateTime)(i),className:"tabular-nums",children:(a=s.getTime()-i.getTime()<864e5?(0,g.clockTime)(i):(0,g.shortDateTime)(i),`${a} \xb7 ${(0,g.duration)(i,s)}`)}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Not crewed"})}),(0,t.jsx)(ey,{label:"Commissioned",children:(0,t.jsx)("time",{dateTime:e.commissionedAt,title:(0,g.fullDateTime)(r),children:n?`Fleet created ${(0,g.dayDate)(r)}`:(0,g.dayDate)(r)})}),(0,t.jsxs)(ey,{label:"Ship id",children:[(0,t.jsx)("span",{className:"truncate font-mono text-id",children:e.id}),(0,t.jsx)(v.CopyButton,{value:e.id,label:"Copy ship id"})]})]})}function ek({icon:e,children:s}){return(0,t.jsxs)("p",{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:s})]})}function eN({ship:e,shipId:s,state:a,actions:n,now:i,backHref:r="/"}){if("loading"===a||"ready"===a&&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)(w.Skeleton,{className:"h-8 w-40"}),(0,t.jsx)(w.Skeleton,{className:"h-6 w-20"}),(0,t.jsx)(w.Skeleton,{className:"h-6 w-16"})]}),(0,t.jsx)(w.Skeleton,{className:"h-16 w-full rounded-lg"})]});if("not-found"===a||void 0===e)return(0,t.jsx)("div",{"data-testid":"ship-header",children:(0,t.jsx)(k.EmptyState,{variant:"section",icon:(0,t.jsx)(el.CircleAlert,{}),title:"Ship not found",description:(0,t.jsxs)(t.Fragment,{children:["No ship with the id ",s?(0,t.jsx)("span",{className:"font-mono text-id",children:s}):"given"," exists in this fleet. The link may be incomplete. Retired ships keep their page."]}),action:(0,t.jsx)(j.Button,{size:"sm",nativeButton:!1,render:({children:e,...s})=>(0,t.jsx)(Z.default,{href:r,...s,children:e}),children:"Back to fleet overview"})})});let d="operator"===e.kind,l="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)(N.ShipName,{name:e.name,shipId:e.id,size:"title",isSuffixShown:l})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(T.StatusBadge,{status:e.status}),d?(0,t.jsxs)(A.Badge,{variant:"kind",children:[(0,t.jsx)(ep.UserRound,{"aria-hidden":!0}),"operator"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.Badge,{variant:"type",children:e.type}),e.scopes.filter(e=>er.FLEET_SCOPES.some(t=>t===e)).map(e=>(0,t.jsx)(A.Badge,{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)(ec.KeyRound,{"aria-hidden":!0}),"No starting prompt issued"]}):null]})]}),n&&!l?(0,t.jsx)("div",{className:(0,U.classNames)("flex flex-wrap items-center gap-2","max-sm:w-full max-sm:[&>*]:flex-1"),children:n}):null]}),d?(0,t.jsx)(ek,{icon:(0,t.jsx)(eo.Info,{"aria-hidden":!0}),children:"argo is your ship. This console session crews it. It can’t be released, renamed or retired."}):null,l&&null!==e.retiredAt?(0,t.jsxs)(ek,{icon:(0,t.jsx)(ed.Archive,{"aria-hidden":!0}),children:["Retired on ",(0,g.fullDateTime)(new Date(e.retiredAt)),". Read-only."]}):null,(0,t.jsx)(ew,{ship:e,now:i}),"agent"===e.kind&&e.report?.details?(0,t.jsx)(ej,{details:e.report.details,version:e.report.detailsVersion,testId:"ship-report-details"}):null]})}var eS=e.i(87255),eT=e.i(31458);let eC={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"}]]};eC.node;let eR=(0,c.default)(eC),eA={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"}]]};eA.node;let eD=(0,c.default)(eA);var eM=e.i(67784);let eI={name:"mail-check",size:24,node:[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]};eI.node;let e$=(0,c.default)(eI),ez={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"}]]};ez.node;let eq=(0,c.default)(ez),eO={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"}]]};eO.node;let eE=(0,c.default)(eO),eL={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"}]]};eL.node;let eP=(0,c.default)(eL),eB={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"}]]};eB.node;let eF=(0,c.default)(eB),eV={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"]};eV.node;let e_=(0,c.default)(eV),eH={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"}]]};eH.node;let eU=(0,c.default)(eH);var eK=e.i(37817),eW=e.i(53341),eG=e.i(94661);function eJ(e,t){let s=e.details[t];return"string"==typeof s?s:void 0}function eQ(e){return e?[(0,f.text)(" by "),(0,f.ship)(e)]:[]}let eX={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.",retired:"Its session ended: the ship was retired."};function eY(e){return null!==e.message&&(0,eW.isPingContentType)(e.message.contentType)}function eZ(e){return e.message?[(0,f.text)(eY(e)?"a ping from ":"a message from "),(0,f.ship)(e.message.sender)]:[(0,f.text)("a message")]}function e0(e){let[t,...s]=eZ(e);return t?.kind==="text"?[(0,f.text)((0,f.capitalised)(t.text)),...s]:eZ(e)}function e2(e,t){let{shipId:s,verb:a}=t,n=e.actor;return[...null===n||n.id===s?[(0,f.text)((0,f.capitalised)(a))]:[(0,f.ship)(n),(0,f.text)(` ${a}`)],(0,f.text)(" "),...eZ(e)]}let e1={received:P,sent:F,claimed:eD,released:eM.LogOut,prompt:ec.KeyRound,commissioned:eT.Flag,acknowledged:e$,returned:eK.Undo2,undeliverable:eE,secret:eR,fleet:eS.Anchor,password:eU,retired:ed.Archive,abandoned:eF,dismissed:eq,renamed:e_,reported:eP},e5={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"},e3="flex w-full gap-3 px-3.5 py-3 text-left";function e7({entry:e,shipId:s,now:a,onOpenMessage:n}){let{parts:i,tone:r,icon:d}=function(e,t){switch(e.type){case"FleetInitialised":return{parts:[(0,f.text)("Fleet initialised")],tone:"ended",icon:"fleet"};case"ShipCommissioned":{let t=eJ(e,"type");return{parts:[(0,f.text)("Commissioned"),...eQ(e.actor),...void 0===t?[]:[(0,f.text)(` as ${t}`)]],tone:"ended",icon:"commissioned"}}case"StartingPromptIssued":return{parts:[(0,f.text)("Starting prompt issued")],tone:"ended",icon:"prompt"};case"ShipClaimed":return{parts:[(0,f.text)(`Claimed by a session on ${function(e){let t=eJ(e,"locationDescription");if(void 0!==t&&""!==t)return t;let s=eJ(e,"location");return"DEVICE"===s||"CLOUD"===s||"SERVER"===s||"OTHER"===s?(0,C.locationKindWord)(s):"an unknown location"}(e)}`)],tone:"ok",icon:"claimed"};case"LeaseRevoked":let s,a;return{parts:[..."released"===(s=eJ(e,"reason")??"")?[(0,f.text)("Released"),...eQ(e.actor),(0,f.text)(".")]:[(0,f.text)(eX[s]??"Its session ended.")],..."number"==typeof(a=e.details.returnedDeliveries)&&a>0?[(0,f.text)(` ${(0,f.counted)(a,{one:"in-flight delivery",many:"in-flight deliveries"})} went back to pending.`)]:[]],tone:"waiting",icon:"released"};case"CredentialRevoked":return{parts:[(0,f.text)("Secret invalidated")],tone:"ended",icon:"secret"};case"OperatorPasswordReset":return{parts:[(0,f.text)("Operator password reset")],tone:"waiting",icon:"password"};case"FleetLimitsChanged":return{parts:[(0,f.text)("Fleet limits changed")],tone:"ended",icon:"fleet"};case"SignInTicketIssued":return{parts:[(0,f.text)("Sign-in ticket issued")],tone:"ended",icon:"password"};case"ViewerSessionStarted":return{parts:[(0,f.text)("Someone started viewing the fleet")],tone:"ended",icon:"password"};case"CrewRequested":return{parts:[(0,f.text)("Crew requested"),...eQ(e.actor)],tone:"waiting",icon:"claimed"};case"CrewRequestRemoved":return{parts:[(0,f.text)("Crew request removed"),...eQ(e.actor)],tone:"ended",icon:"released"};case"CrewRequestExplained":{let t=eJ(e,"reason");return{parts:[(0,f.text)(void 0===t?"Crew request can not be placed yet":`Crew request can not be placed: ${t}`),...eQ(e.actor)],tone:"waiting",icon:"reported"}}case"CrewAssigned":return{parts:[(0,f.text)("Crew request assigned"),...eQ(e.actor)],tone:"waiting",icon:"claimed"};case"CrewStatusChanged":{let t=eJ(e,"status");return{parts:[(0,f.text)(void 0===t?"Crew status changed":`Crew ${t}`),...eQ(e.actor)],tone:"crashed"===t?"attention":"active",icon:"reported"}}case"MessageAccepted":let n;return{parts:(n=e.message)?eY(e)&&"ship"===n.recipient.kind?n.sender.id===t?[(0,f.text)("Pinged "),(0,f.ship)(n.recipient.ship)]:[(0,f.text)("Pinged by "),(0,f.ship)(n.sender)]:n.sender.id===t?"ship"===n.recipient.kind?[(0,f.text)("Sent a message to "),(0,f.ship)(n.recipient.ship)]:[(0,f.text)(`Sent a message to any ship of type ${n.recipient.type}`)]:[(0,f.text)("Received a message from "),(0,f.ship)(n.sender)]:[(0,f.text)("A message was sent")],tone:"ended",icon:e.message?.sender.id===t?"sent":"received"};case"DeliveryClaimed":return{parts:e2(e,{shipId:t,verb:"took"}),tone:"active",icon:"received"};case"DeliveryAcknowledged":return{parts:"pong"===eJ(e,"answer")?[...e2(e,{shipId:t,verb:"answered"}),(0,f.text)(" with pong")]:e2(e,{shipId:t,verb:"acknowledged"}),tone:"ok",icon:"acknowledged"};case"DeliveryReturned":return{parts:[...e0(e),(0,f.text)(" went back to pending")],tone:"waiting",icon:"returned"};case"DeliveryUndeliverable":return{parts:[...e0(e),(0,f.text)(" became undeliverable")],tone:"attention",icon:"undeliverable"};case"ShipRetired":{let t=e.details.abandonedDeliveries;return{parts:[(0,f.text)("Retired"),...eQ(e.actor),(0,f.text)("."),..."number"==typeof t&&t>0?[(0,f.text)(` ${(0,f.counted)(t,{one:"delivery",many:"deliveries"})} abandoned.`)]:[]],tone:"ended",icon:"retired"}}case"DeliveryAbandoned":return{parts:[...e0(e),(0,f.text)(" was abandoned")],tone:"ended",icon:"abandoned"};case"ShipReported":{let t=eJ(e,"state")??"in",s=eJ(e,"note");return{parts:[(0,f.text)(void 0===s?`Reported ${t}`:`Reported ${t}: ${s}`)],tone:eG.REPORT_STATES.some(e=>e===t)?eb.REPORT_TONES[t]:"ended",icon:"reported"}}case"ShipRenamed":{let t=eJ(e,"from"),s=eJ(e,"to");return{parts:[(0,f.text)(void 0===t||void 0===s?"Renamed":`Renamed from ${t} to ${s}`),...eQ(e.actor)],tone:"ended",icon:"renamed"}}case"DeliveryDismissed":return{parts:[...e0(e),(0,f.text)(" was dismissed"),...eQ(e.actor)],tone:"ended",icon:"dismissed"}}}(e,s),l=e1[d],o=new Date(e.occurredAt),c=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,U.classNames)("flex size-7 shrink-0 items-center justify-center rounded-md border [&_svg]:size-(--size-icon-sm)",e5[r]),children:(0,t.jsx)(l,{})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)(S,{parts:i,className:"text-body text-foreground max-sm:text-body-touch"}),(0,t.jsx)("time",{dateTime:e.occurredAt,title:(0,g.fullDateTime)(o),className:"text-meta text-muted-foreground tabular-nums",children:(0,g.relativeTime)(o,a)})]})]}),{message:p}=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:p?(0,t.jsx)("button",{type:"button",className:(0,U.classNames)(e3,"transition-colors duration-(--duration-fast) hover:bg-accent"),onClick:()=>{n(p.id)},children:c}):(0,t.jsx)("div",{className:e3,children:c})})}function e4({shipId:e,entries:s,state:a,onRetry:n,now:i,onOpenMessage:r}){return"loading"===a?(0,t.jsx)(Q.LoadingSkeleton,{variant:"list",rows:4,label:"Loading the timeline"}):"error"===a?(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)(J.InlineError,{title:"Couldn’t load the timeline",description:"The rest of the page is current. Try again in a moment."}),n?(0,t.jsx)(j.Button,{size:"sm",icon:(0,t.jsx)(H.RotateCw,{"aria-hidden":!0}),onClick:n,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:s.map(s=>(0,t.jsx)(e7,{entry:s,shipId:e,now:i,onOpenMessage:r},s.id))}),s.length<=1?(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 e6=e.i(274),e8=e.i(90262),e9=e.i(46929),te=e.i(86413),tt=e.i(18423),ts=e.i(28459),ta=e.i(96676),tn=e.i(88721),ti=e.i(78485),tr=e.i(53573),td=e.i(86165);let tl="timeline",to="messages";function tc(e){return Array.isArray(e)?e[0]:e}function tp({shipId:e,searchParams:c}){let p=(0,a.useRouter)(),m=(0,ta.useNow)(),u=tc(c.tab)===to?to:tl,h=(0,s.idSchema)("message").safeParse(tc(c.message)),x=h.success?h.data:void 0,g=(0,tr.useShip)(e),f=(0,tr.useShipTimeline)(e),b=(0,tr.useShipMessages)(e),j=(0,tr.useMessage)(x),v=(0,tt.useLiveFleet)(),y=(0,tn.useAccountMenu)(m),w=(0,td.useHasSquadrons)(),k=(0,ee.useSquadrons)(),N=(0,te.useOpenInboxCount)(),S=(0,e8.useAccess)(),[T,C]=(0,n.useState)(!1),[R,A]=(0,n.useState)(!1),[D,M]=(0,n.useState)(),I=(0,ts.useAttentionCount)();(0,ti.useSignInWhenSessionEnds)([g.error,f.error,b.error,j.error,v.error]);let $=t=>{let s,a;p.replace((s=new URLSearchParams,t.tab!==tl&&s.set("tab",t.tab),void 0!==t.messageId&&s.set("message",t.messageId),""===(a=s.toString())?`/ships/${e}`:`/ships/${e}?${a}`),{scroll:!1})},z=e=>{$({tab:u,messageId:e})},q="NOT_FOUND"===(0,e9.trpcErrorCode)(g.error),O=(0,et.shipsInSquadrons)(k.data??[]).get(e);return(0,t.jsx)(e6.DetailLayout,{title:g.data?.name??"Ship",parents:O?[{href:"/squadrons",label:"Squadrons"},{href:`/squadrons/${O.squadronId}`,label:O.squadronId}]:[{href:"/",label:"Fleet overview"}],live:v.live,nav:{active:"overview",inboxCount:N,attentionCount:I,hasSquadrons:w,hasSettings:w&&S.canManage},onCompose:S.canSend?()=>{C(!0)}:void 0,onSearch:()=>{A(!0)},account:y,banner:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.ConsoleNotices,{}),(0,t.jsx)(l.ConsoleGuide,{})]}),header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eN,{ship:g.data,shipId:e,state:q?"not-found":g.data?"ready":"loading",now:m,actions:g.data?(0,t.jsx)(ei.ShipActions,{ship:g.data}):void 0}),q?null:(0,t.jsx)(en,{shipId:e,now:m})]}),sheet:(0,t.jsx)(E,{message:j.data,messageId:x,state:"NOT_FOUND"===(0,e9.trpcErrorCode)(j.error)?"not-found":j.data?"ready":"loading",isOpen:void 0!==x,onOpenChange:e=>{e||$({tab:u})},onReply:S.canSend?e=>{M({messageId:e.id,sender:e.sender})}:void 0}),children:(0,t.jsxs)(t.Fragment,{children:[q?null:(0,t.jsxs)(i.Tabs,{value:u,onValueChange:e=>{$({tab:e===to?to:tl,messageId:x})},children:[(0,t.jsxs)(i.TabsList,{variant:"line","aria-label":`${g.data?.name??"Ship"} history`,children:[(0,t.jsx)(i.TabsTrigger,{variant:"line",value:tl,children:"Timeline"}),(0,t.jsx)(i.TabsTrigger,{variant:"line",value:to,children:"Messages"})]}),(0,t.jsx)(i.TabsContent,{value:tl,className:"pt-4",children:(0,t.jsx)(e4,{shipId:e,entries:f.data??[],state:f.isError?"error":f.data?"ready":"loading",onRetry:()=>{f.refetch()},now:m,onOpenMessage:z})}),(0,t.jsx)(i.TabsContent,{value:to,className:"pt-4",children:(0,t.jsx)(Y,{shipId:e,messages:b.data??[],state:b.isError?"error":b.data?"ready":"loading",onRetry:()=>{b.refetch()},now:m,onOpenMessage:z})})]}),(0,t.jsx)(r.ComposeMessage,{isOpen:T,onOpenChange:C}),(0,t.jsx)(r.ComposeMessage,{isOpen:void 0!==D,onOpenChange:e=>{e||M(void 0)},replyTo:D}),(0,t.jsx)(d.ConsoleCommands,{isOpen:R,onOpenChange:A,onCompose:()=>{C(!0)}})]})})}e.s(["default",0,function({params:e,searchParams:a}){let i=(0,s.idSchema)("ship").safeParse((0,n.use)(e).shipId),r=(0,n.use)(a),d=i.success?i.data:(0,s.idSchema)("ship").parse(`shp_${"0".repeat(26)}`);return(0,t.jsx)(tp,{shipId:d,searchParams:r})}],21607)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,46033,e=>{"use strict";var t=e.i(43476);e.s([],64623),e.i(64623);var n=e.i(71645),r=e.i(2077),l=e.i(28918),o=e.i(88940),i=e.i(13203),s=e.i(94258),a=e.i(90803),u=e.i(51437),c=e.i(46376),d=e.i(67865),p=e.i(46265),f=e.i(26352),m=e.i(56789),g=e.i(85689),h=e.i(17989),x=e.i(65858),S=e.i(60891),v=e.i(5049),b=e.i(33332);let R=n.createContext(void 0),y=n.createContext(void 0),w=n.createContext(void 0);function E(){let e=n.useContext(R);if(void 0===e)throw Error((0,b.default)(60));return e}function I(){let e=n.useContext(y);if(void 0===e)throw Error((0,b.default)(101));return e}function C(){let e=n.useContext(w);if(void 0===e)throw Error((0,b.default)(61));return e}var A=e.i(69690),M=e.i(81104),T=e.i(38489),P=e.i(23910),V=e.i(84325),O=e.i(42191);let L={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return null!=t&&(n&&Array.isArray(t)?t.length>0:""!==(0,O.stringifyAsValue)(t,r))},hasNullItemLabel:(e,t)=>!!t&&(0,O.hasNullItemLabel)(e.items),open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>(0,V.compareItemEquality)(t,e,n)):(0,V.compareItemEquality)(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};var N=e.i(75606),D=e.i(56434),k=e.i(37584),j=e.i(84708),H=e.i(6039),F=e.i(32199);function B(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function U(e,t){return Math.max(0,e-t)}function _(e,t){if(t<=0)return 0;let n=B(e,0,t),r=t-n,l=n<=1,o=r<=1;return l&&o?n<=r?0:t:l?0:o?t:n}var Y=e.i(64111),z=e.i(76782),W=e.i(52245),q=e.i(75812),$=e.i(97886),K=e.i(50001);let G=n.forwardRef(function(e,t){let{render:n,className:r,style:l,...o}=e;delete o.id;let i=(0,A.useFieldRootContext)(),s=E(),a=s.useState("triggerElement"),u=s.useState("id"),c=(0,K.getDefaultLabelId)(u),d=(0,$.useLabel)({id:c,fallbackControlId:a?.id??u,setLabelId(e){let t="function"==typeof e?e(s.state.labelId):e;s.set("labelId",t)}});return(0,W.useRenderElement)("div",e,{ref:t,state:i.state,props:[d,o],stateAttributesMapping:q.fieldValidityMapping})});var J=e.i(8868),X=e.i(39957),Q=e.i(47778),Z=e.i(79938),ee=e.i(64042),et=e.i(84446),en=e.i(96296),er=e.i(40886),el=e.i(45147);el.CommonTriggerDataAttributes.popupOpen,el.CommonTriggerDataAttributes.pressed;let eo={...Z.pressableTriggerOpenStateMapping,...q.fieldValidityMapping,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},ei=n.forwardRef(function(e,t){let{render:r,className:l,id:o,disabled:i=!1,nativeButton:s=!0,style:a,...u}=e,{setTouched:c,setFocused:d,validationMode:f,validation:m,state:g,disabled:h}=(0,A.useFieldRootContext)(),{labelId:x}=(0,Q.useLabelableContext)(),S=E(),{readOnly:v,required:b,disabled:R}=I(),y=h||R||i,w=S.useState("open"),C=S.useState("mounted"),M=S.useState("value"),P=S.useState("triggerProps"),V=S.useState("positionerElement"),O=S.useState("listElement"),L=S.useState("popupSide"),k=S.useState("id"),j=S.useState("labelId"),H=S.useState("hasSelectedValue"),F=C&&V?L:null,B=(0,K.resolveAriaLabelledBy)(x,j);(0,T.useLabelableId)({id:o});let U=(0,p.useValueAsRef)(V),_=n.useRef(null),{getButtonProps:Y,buttonRef:q}=(0,er.useButton)({disabled:y,native:s}),$=S.useStateSetter("triggerElement"),G=(0,X.useTimeout)(),Z=(0,X.useTimeout)(),el=(0,X.useTimeout)();n.useEffect(()=>{if(w)return el.start(400,()=>{S.context.selectionRef.current.allowUnselectedMouseUp=!0,S.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{el.clear()};S.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Z.clear()},[w,S,Z,el]);let ei=(0,z.mergeProps)(P,{id:o??k,role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-controls":w?O?.id??(0,en.getFloatingFocusElement)(V)?.id:void 0,"aria-labelledby":B,"aria-readonly":v||void 0,"aria-required":b||void 0,tabIndex:y?-1:0,onFocus(e){d(!0),w&&S.context.alignItemWithTriggerActiveRef.current&&S.context.setOpen(!1,(0,N.createChangeEventDetails)(D.REASONS.none,e.nativeEvent)),G.start(0,()=>{S.set("forceMount",!0)})},onBlur(e){(0,et.contains)(V,e.relatedTarget)||(c(!0),d(!1),"onBlur"===f&&m.commit(M))},onMouseDown(e){if(w)return;let t=(0,J.ownerDocument)(e.currentTarget);function n(e){if(!_.current)return;let t=e.target;(0,et.contains)(_.current,t)||(0,et.contains)(U.current,t)||(0,ee.isMouseWithinBounds)(e,_.current)||S.context.setOpen(!1,(0,N.createChangeEventDetails)(D.REASONS.cancelOpen,e))}Z.start(0,()=>{t.addEventListener("mouseup",n,{once:!0})})}},u,Y),es=m.getValidationProps(y,ei);es.role="combobox";let ea={...g,open:w,disabled:y,value:M,readOnly:v,popupSide:F,placeholder:!H};return(0,W.useRenderElement)("button",e,{ref:[t,_,q,$],state:ea,stateAttributesMapping:eo,props:es})}),es={value:()=>null},ea=n.forwardRef(function(e,t){let{className:n,render:r,children:l,placeholder:o,style:i,...s}=e,a=E(),u=a.useState("value"),c=a.useState("items"),d=a.useState("itemToStringLabel"),p=a.useState("hasSelectedValue"),f=!p&&null!=o&&null==l,m=a.useState("hasNullItemLabel",f),g=null;return g="function"==typeof l?l(u):null!=l?l:f&&!m?o:Array.isArray(u)?(0,O.resolveMultipleLabels)(u,c,d):(0,O.resolveSelectedLabel)(u,c,d),(0,W.useRenderElement)("span",e,{state:{value:u,placeholder:!p},ref:[t,a.context.valueRef],props:[{children:g},s],stateAttributesMapping:es})}),eu=n.forwardRef(function(e,t){let{render:n,className:r,style:l,...o}=e,i=E().useState("open");return(0,W.useRenderElement)("span",e,{state:{open:i},ref:t,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:Z.triggerOpenStateMapping})});var ec=e.i(26674);let ed=n.forwardRef(function(e,n){let r=E(),l=r.useState("mounted"),o=r.useState("forceMount");return l||o?(0,t.jsx)(ec.FloatingPortal,{ref:n,...e}):null});var ep=e.i(74354);let ef={...Z.popupStateMapping,...ep.transitionStatusMapping},em=n.forwardRef(function(e,t){let{render:n,className:r,style:l,...o}=e,i=E(),s=i.useState("open"),a=i.useState("mounted"),u=i.useState("transitionStatus");return(0,W.useRenderElement)("div",e,{state:{open:s,transitionStatus:u},ref:t,props:[{role:"presentation",hidden:!a,style:{userSelect:"none",WebkitUserSelect:"none"}},o],stateAttributesMapping:ef})});var eg=e.i(44394),eh=e.i(53687),ex=e.i(23706);let eS=n.createContext(void 0);function ev(){let e=n.useContext(eS);if(!e)throw Error((0,b.default)(59));return e}var eb=e.i(426),eR=e.i(38396);function ey(e,t){e&&Object.assign(e.style,t)}let ew={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var eE=e.i(89579),eI=e.i(33383);let eC={position:"fixed"},eA=n.forwardRef(function(e,r){let{anchor:l,className:o,render:i,positionMethod:s,side:a,align:u,sideOffset:p,alignOffset:f,collisionBoundary:m="clipping-ancestors",collisionPadding:g,arrowPadding:h,sticky:x,disableAnchorTracking:S,alignItemWithTrigger:v=!0,collisionAvoidance:b=eR.DROPDOWN_COLLISION_AVOIDANCE,style:R,...y}=e,w=E(),I=C(),A=w.useState("open"),M=w.useState("mounted"),T=w.useState("modal"),P=w.useState("value"),O=w.useState("openMethod"),L=w.useState("positionerElement"),k=w.useState("triggerElement"),j=w.useState("isItemEqualToValue"),H=w.useState("transitionStatus"),F=n.useRef(null),B=n.useRef(null),[U,_]=n.useState(v),Y=M&&U&&"touch"!==O;M||U===v||_(v),n.useImperativeHandle(w.context.alignItemWithTriggerActiveRef,()=>Y),(0,eI.useAnchoredPopupScrollLock)((Y||T)&&A,"touch"===O,L,k);let z=(0,ex.useAnchorPositioning)({anchor:l,floatingRootContext:I,positionMethod:s,mounted:M,side:a,sideOffset:p,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:x,disableAnchorTracking:S??Y,collisionAvoidance:b,keepMounted:!0}),W=Y?"none":z.side,q=Y?eC:z.positionerStyles,$={open:A,side:W,align:z.align,anchorHidden:z.anchorHidden};(0,c.useIsoLayoutEffect)(()=>{w.set("popupSide",z.side)},[w,z.side]);let K=w.useStateSetter("positionerElement"),G=(0,eE.usePositioner)(e,$,{styles:q,transitionStatus:H,props:y,refs:[r,K],hidden:!M,inert:!A}),J=n.useRef(0),X=(0,d.useStableCallback)(e=>{if(0===w.context.valuesRef.current.length)return;let t=J.current;J.current=e.size;let n=(0,N.createChangeEventDetails)(D.REASONS.none);if(0!==t&&!w.state.multiple&&null!==P&&-1===(0,V.findItemIndex)(w.context.valuesRef.current,P,j)){let e=w.context.initialValueRef.current,t=null!=e&&-1!==(0,V.findItemIndex)(w.context.valuesRef.current,e,j)?e:null;w.context.setValue(t,n),null===t&&(w.set("selectedIndex",null),w.context.selectedItemTextRef.current=null)}if(0!==t&&w.state.multiple&&Array.isArray(P)){let e=P.filter(e=>-1!==(0,V.findItemIndex)(w.context.valuesRef.current,e,j));e.length!==P.length&&(w.context.setValue(e,n),0===e.length&&(w.set("selectedIndex",null),w.context.selectedItemTextRef.current=null))}if(A&&Y){w.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:""};ey(L,e),ey(w.context.popupRef.current,e)}}),Q=n.useMemo(()=>({...z,side:W,alignItemWithTriggerActive:Y,setControlledAlignItemWithTrigger:_,scrollUpArrowRef:F,scrollDownArrowRef:B}),[z,W,Y,_]);return(0,t.jsx)(eh.CompositeList,{elementsRef:w.context.listRef,labelsRef:w.context.labelsRef,onMapChange:X,children:(0,t.jsxs)(eS.Provider,{value:Q,children:[M&&T&&(0,t.jsx)(eb.InternalBackdrop,{inert:(0,eg.inertValue)(!A),cutout:k}),G]})})});var eM=e.i(43084),eT=e.i(74735),eP=e.i(28744),eV=e.i(33848),eO=e.i(8445),eL=e.i(61487),eN=e.i(53760);let eD="base-ui-disable-scrollbar";var ek=e.i(96533),ej=e.i(73327),eH=e.i(53984),eF=e.i(72410),eB=e.i(72855);let eU="--transform-origin",e_={...Z.popupStateMapping,...ep.transitionStatusMapping},eY=n.forwardRef(function(e,r){let l,{render:o,className:i,style:s,finalFocus:a,...u}=e,p=E(),{multiple:f,readOnly:m,highlightItemOnHover:g}=I(),h=C(),{side:x,align:S,alignItemWithTriggerActive:v,isPositioned:b,setControlledAlignItemWithTrigger:R}=ev(),y=null!=(0,ek.useToolbarRootContext)(!0),w=(0,eB.useDirection)(),{nonce:A,disableStyleElements:M}=(0,eF.useCSPContext)(),T=p.useState("id"),P=p.useState("open"),V=p.useState("openMethod"),O=p.useState("mounted"),L=p.useState("popupProps"),j=p.useState("transitionStatus"),H=p.useState("triggerElement"),F=p.useState("positionerElement"),U=p.useState("listElement"),_=n.useRef(!1),Y=n.useRef(!1),z=n.useRef({}),q=(0,eO.useAnimationFrame)(),$=(0,d.useStableCallback)(e=>{var t;if(!F||!p.context.popupRef.current||!Y.current)return;let n="0px"===F.style.top,r="0px"===F.style.bottom;if(_.current||!v||!n&&!r)return void p.context.handleScrollArrowVisibility(e);let l=eq(F),o=(t=F.getBoundingClientRect().height,t/l.y),i=(0,J.ownerDocument)(F),s=(0,eV.ownerWindow)(F),a=s.getComputedStyle(F),u=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),d=ez(s.getComputedStyle(p.context.popupRef.current)),f=Math.min(i.documentElement.clientHeight-u-c,d),m=e.scrollTop,g=eW(e),h=null,x=e=>{F.style.height=`${e}px`},S=n?g-m:m,b=Math.min(o+S,f);if(S<=1){let t=B(S,0,f-o);t>0&&x(o+t),e.scrollTop=n?g:0,f-(o+t)<=1&&(_.current=!0),p.context.handleScrollArrowVisibility(e);return}if(f-b>1)h=n?1/0:0;else if(r&&m<g){let e=o+S-f;h=m-(S-e)}let R=Math.ceil(b);if(0!==R&&x(R),null!=h){let t=B(h,0,eW(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}R>=f-1&&(_.current=!0),p.context.handleScrollArrowVisibility(e)});n.useImperativeHandle(p.context.scrollHandlerRef,()=>$,[$]),(0,k.useOpenChangeComplete)({open:P,ref:p.context.popupRef,onComplete(){P&&p.context.onOpenChangeComplete(!0)}}),(0,c.useIsoLayoutEffect)(()=>{F&&p.context.popupRef.current&&!Object.keys(z.current).length&&(z.current={top:F.style.top||"0",left:F.style.left||"0",right:F.style.right,height:F.style.height,bottom:F.style.bottom,minHeight:F.style.minHeight,maxHeight:F.style.maxHeight,marginTop:F.style.marginTop,marginBottom:F.style.marginBottom})},[p,F]),(0,c.useIsoLayoutEffect)(()=>{P||v||(Y.current=!1,_.current=!1,ey(F,z.current))},[P,v,F]),(0,c.useIsoLayoutEffect)(()=>{let e=p.context.popupRef.current;if(!P||!H||!F||!e||v&&!b||"ending"===p.state.transitionStatus)return;if(Y.current=!0,e.style.removeProperty(eU),!v)return void q.request(()=>p.context.handleScrollArrowVisibility(U||e));let t=function(e){let{style:t}=e,n={};for(let[e,r]of eK)n[e]=t.getPropertyValue(e),t.setProperty(e,r,"important");return()=>{for(let[e]of eK){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}(e);try{let t,n=p.context.selectedItemTextRef.current;n?.isConnected||(n=!p.select("hasSelectedValue")&&p.context.firstItemTextRef.current?.isConnected?p.context.firstItemTextRef.current:null);let r=p.context.valueRef.current,l=(0,eV.ownerWindow)(F),o=l.getComputedStyle(F),i=l.getComputedStyle(e),s=(0,J.ownerDocument)(H),a=eq(H),u=e$(H.getBoundingClientRect(),a),c=e$(F.getBoundingClientRect(),a),d=u.height,f=U||e,m=f.scrollHeight,h=parseFloat(i.borderBottomWidth),x=parseFloat(o.marginTop)||10,S=parseFloat(o.marginBottom)||10,v=parseFloat(o.minHeight)||100,b=ez(i),y=s.documentElement.clientHeight-x-S,E=s.documentElement.clientWidth,I=y-u.bottom+d,C="rtl"===w?u.right-c.width:u.left,A=0;if(n&&r){let e=e$(r.getBoundingClientRect(),a);t=e$(n.getBoundingClientRect(),a),C=c.left+("rtl"===w?e.right-t.right:e.left-t.left);let l=e.top-u.top+e.height/2;A=t.top-c.top+t.height/2-l}let M=I+A+S+h,T=Math.min(y,M),P=y-x-S,V=M-T;F.style.left=`${B(C,5,E-5-c.width)}px`,F.style.height=`${T}px`,F.style.maxHeight="none",F.style.marginTop=`${x}px`,F.style.marginBottom=`${S}px`,e.style.height="100%";let O=eW(f),L=V>=O-1;L&&(T=Math.min(y,c.height)-(V-O));let N=u.top<20||u.bottom>y-20||Math.ceil(T)+1<Math.min(m,v),D=(l.visualViewport?.scale??1)!==1&&eP.platform.engine.webkit;if(N||D){ey(F,z.current),R(!1);return}let k=Math.max(v,T);if(L){let e=Math.max(0,y-M);F.style.top=c.height>=P?"0":`${e}px`,F.style.height=`${T}px`,f.scrollTop=eW(f)}else F.style.bottom="0",f.scrollTop=V;if(t){let n=c.top,r=c.height,l=t.top+t.height/2,o=B(r>0?(l-n)/r*100:50,0,100);e.style.setProperty(eU,`50% ${o}%`)}(k===y||T>=b)&&(_.current=!0),p.context.handleScrollArrowVisibility(f),g&&null===p.state.selectedIndex&&null===p.state.activeIndex&&null!=p.context.listRef.current[0]&&p.set("activeIndex",0)}finally{t()}},[p,P,F,H,v,R,q,U,g,w,b]),n.useEffect(()=>{if(!v||!F||!P)return;let e=(0,eV.ownerWindow)(F);return(0,eT.addEventListener)(e,"resize",function(e){p.context.setOpen(!1,(0,N.createChangeEventDetails)(D.REASONS.windowResize,e))})},[p,v,F,P]);let K={...U?{role:"presentation"}:{role:"listbox","aria-multiselectable":f||void 0,"aria-readonly":m||void 0,id:`${T}-list`},onKeyDown(e){y&&ej.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()},onScroll(e){U||$(e.currentTarget)},...v&&{style:U?{height:"100%"}:ew},className:!U&&v?eD:void 0},G=(0,W.useRenderElement)("div",e,{ref:[r,p.context.popupRef],state:{open:P,transitionStatus:j,side:x,align:S},stateAttributesMapping:e_,props:[L,K,(0,eH.getDisabledMountTransitionStyles)(j),u]});return(0,t.jsxs)(n.Fragment,{children:[!M&&(l=A,(0,t.jsx)("style",{nonce:l,href:eD,precedence:"base-ui:low",children:`.${eD}{scrollbar-width:none}.${eD}::-webkit-scrollbar{display:none}`})),(0,t.jsx)(eL.FloatingFocusManager,{context:h,modal:!1,disabled:!O,openInteractionType:V,returnFocus:a,restoreFocus:!0,children:G})]})});function ez(e){let t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function eW(e){return U(e.scrollHeight,e.clientHeight)}function eq(e){return eN.platform.getScale(e)}function e$(e,t){return(0,eM.rectToClientRect)({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}let eK=[["transform","none"],["scale","1"],["translate","0 0"]],eG=n.forwardRef(function(e,t){let{render:n,className:r,style:l,...o}=e,i=E(),{multiple:s,readOnly:a}=I(),{alignItemWithTriggerActive:u}=ev(),c=i.useState("hasScrollArrows"),d=i.useState("openMethod"),p=i.useState("id"),f={id:`${p}-list`,role:"listbox","aria-multiselectable":s||void 0,"aria-readonly":a||void 0,onScroll(e){i.context.scrollHandlerRef.current?.(e.currentTarget)},...u&&{style:ew},className:c&&"touch"!==d?eD:void 0},m=i.useStateSetter("listElement");return(0,W.useRenderElement)("div",e,{ref:[t,m],props:[f,o]})});var eJ=e.i(73553);let eX=n.createContext(void 0);function eQ(){let e=n.useContext(eX);if(!e)throw Error((0,b.default)(57));return e}var eZ=e.i(57940);let e0=n.memo(n.forwardRef(function(e,r){let{render:l,className:o,style:i,value:s=null,label:a,disabled:u=!1,nativeButton:d=!1,...p}=e,f=n.useRef(null),m=(0,eJ.useCompositeListItem)({guess:!0,label:a,textRef:f}),g=E(),{itemProps:h,multiple:x,disabled:S,readOnly:v}=I(),b=S||u,R=g.useState("isActive",m.index),y=g.useState("open"),w=g.useState("isSelected",s),C=g.useState("isSelectedByFocus",m.index),A=g.useState("isItemEqualToValue"),M=m.index,T=n.useRef(null);(0,c.useIsoLayoutEffect)(()=>{let e=g.context.valuesRef.current;return e[M]=s,()=>{delete e[M]}},[M,s,g]),(0,c.useIsoLayoutEffect)(()=>{let e,t=g.state.value,n=g.state.selectedIndex,r=n;x&&Array.isArray(t)?(e=(r=(0,V.resolveSelectedIndex)(M,s,g.context.valuesRef.current,t,A,n))===M,M!==n||e||(g.context.selectedItemTextRef.current=null)):(e=void 0!==t&&(0,V.compareItemEquality)(s,t,A))&&(r=M),g.set("selectedIndex",r),e&&f.current&&(g.context.selectedItemTextRef.current=f.current)},[M,x,A,g,s]);let P=n.useRef("mouse"),O=n.useRef(!1),{getButtonProps:L,buttonRef:k}=(0,er.useButton)({disabled:b,focusableWhenDisabled:!0,native:d,composite:!0});function j(){g.context.selectionRef.current.dragY=0}let H=(0,W.useRenderElement)("div",e,{ref:[k,r,m.ref,T],state:{disabled:b,selected:w,highlighted:R},props:[h,{role:"option","aria-selected":w,tabIndex:y&&R?0:-1,onKeyDown(e){g.set("activeIndex",M)," "===e.key&&g.context.typingRef.current&&e.preventDefault()},onClick(e){let t="touch"!==P.current,n=e.nativeEvent.pointerType,r=t&&(0,eZ.isVirtualClick)(e.nativeEvent)&&(void 0!==n||R),l=t&&!r&&!O.current;O.current=!1,b||l||function(e){if(S||v)return;let t=g.state.value;if(x){let n=Array.isArray(t)?t:[],r=w?(0,V.removeItem)(n,s,A):[...n,s];g.context.setValue(r,(0,N.createChangeEventDetails)(D.REASONS.itemPress,e))}else g.context.setValue(s,(0,N.createChangeEventDetails)(D.REASONS.itemPress,e)),g.context.setOpen(!1,(0,N.createChangeEventDetails)(D.REASONS.itemPress,e))}(e.nativeEvent)},onPointerEnter(e){P.current=e.pointerType},onPointerMove(e){if("mouse"===e.pointerType&&1===e.buttons){let t=g.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){P.current=e.pointerType,O.current=!0,j()},onMouseUp(){if(j(),b||"touch"===P.current||O.current)return;let e=!g.context.selectionRef.current.allowSelectedMouseUp&&w,t=!g.context.selectionRef.current.allowUnselectedMouseUp&&!w;e||t||(O.current=!0,T.current?.click(),O.current=!1)}},p,L]}),F=n.useMemo(()=>({selected:w,index:M,textRef:f,selectedByFocus:C}),[w,M,f,C]);return(0,t.jsx)(eX.Provider,{value:F,children:H})})),e1=n.forwardRef(function(e,n){let{selected:r}=eQ();return e.keepMounted||r?(0,t.jsx)(e4,{...e,ref:n}):null}),e4=n.memo(n.forwardRef((e,t)=>{let{render:r,className:l,style:o,keepMounted:i,...s}=e,{selected:a}=eQ(),u=n.useRef(null),{transitionStatus:c,setMounted:d}=(0,P.useTransitionStatus)(a),p=(0,W.useRenderElement)("span",e,{ref:[t,u],state:{selected:a,transitionStatus:c},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:ep.transitionStatusMapping});return(0,k.useOpenChangeComplete)({batch:!0,enabled:!a,open:a,ref:u,onComplete(){a||d(!1)}}),p})),e6=n.memo(n.forwardRef(function(e,t){let{index:r,textRef:l,selectedByFocus:o}=eQ(),i=E(),{render:s,className:a,style:u,...c}=e,d=n.useCallback(e=>{e&&(0===r&&(i.context.firstItemTextRef.current=e),o&&(i.context.selectedItemTextRef.current=e))},[i,r,o]);return(0,W.useRenderElement)("div",e,{ref:[d,t,l],props:c})})),e8=n.forwardRef(function(e,t){let{render:n,className:r,style:l,...o}=e,i=E(),{side:s,align:a,arrowRef:u,arrowStyles:c,arrowUncentered:d,alignItemWithTriggerActive:p}=ev(),f=i.useState("open"),m=(0,W.useRenderElement)("div",e,{state:{open:f,side:s,align:a,uncentered:d},ref:[u,t],props:[{style:c,"aria-hidden":!0},o],stateAttributesMapping:Z.popupTransitionStateMapping});return p?null:m}),e3=n.forwardRef(function(e,t){let{render:n,className:r,style:l,direction:o,keepMounted:i,...s}=e,a="up"===o,u=E(),{side:d,scrollDownArrowRef:p,scrollUpArrowRef:f}=ev(),m=u.useState(a?"scrollUpArrowVisible":"scrollDownArrowVisible"),g=u.useState("openMethod"),h=m&&"touch"!==g,x=(0,X.useTimeout)(),S=a?f:p,{mounted:v,transitionStatus:b,setMounted:R}=(0,P.useTransitionStatus)(h);(0,c.useIsoLayoutEffect)(()=>(u.context.scrollArrowsMountedCountRef.current+=1,u.set("hasScrollArrows",!0),()=>{u.context.scrollArrowsMountedCountRef.current=Math.max(0,u.context.scrollArrowsMountedCountRef.current-1),0===u.context.scrollArrowsMountedCountRef.current&&u.set("hasScrollArrows",!1)}),[u]),(0,k.useOpenChangeComplete)({open:h,ref:S,onComplete(){h||R(!1)}});let y=(0,W.useRenderElement)("div",e,{ref:[t,S],state:{direction:o,visible:h,side:d,transitionStatus:b},props:[{"aria-hidden":!0,children:a?"▲":"▼",style:{position:"absolute"},onMouseMove(e){0===e.movementX&&0===e.movementY||x.isStarted()||(u.set("activeIndex",null),x.start(40,function e(){let t=u.state.listElement??u.context.popupRef.current;if(!t)return;u.set("activeIndex",null),u.context.handleScrollArrowVisibility(t);let n=U(t.scrollHeight,t.clientHeight),r=_(t.scrollTop,n),l=r===(a?0:n),o=u.context.listRef.current;if(r!==t.scrollTop&&(t.scrollTop=r),l)return void x.clear();if(o.length>0){let e=S.current?.offsetHeight||0;t.scrollTop=function(e,t,n,r,l,o){if(t){let t=0,r=n+l-1;for(let n=0;n<e.length;n+=1){let l=e[n];if(l&&l.offsetTop>=r){t=n;break}}let i=Math.max(0,t-1),s=e[i];return i<t&&s?_(s.offsetTop-l,o):0}let i=e.length-1,s=n+r-l+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){i=Math.max(0,t-1);break}}let a=Math.min(e.length-1,i+1),u=e[a];return a>i&&u?_(u.offsetTop+u.offsetHeight-r+l,o):o}(o,a,r,t.clientHeight,e,n)}x.start(40,e)}))},onMouseLeave(){x.clear()}},s],stateAttributesMapping:ep.transitionStatusMapping});return v||i?y:null}),e5=n.forwardRef(function(e,n){return(0,t.jsx)(e3,{...e,ref:n,direction:"down"})}),e7=n.forwardRef(function(e,n){return(0,t.jsx)(e3,{...e,ref:n,direction:"up"})}),e2=n.createContext(void 0),e9=n.forwardRef(function(e,r){let{render:l,className:o,style:i,...s}=e,[a,u]=n.useState(),c=n.useMemo(()=>({labelId:a,setLabelId:u}),[a,u]),d=(0,W.useRenderElement)("div",e,{ref:r,props:[{role:"group","aria-labelledby":a},s]});return(0,t.jsx)(e2.Provider,{value:c,children:d})});var te=e.i(88015);let tt=n.forwardRef(function(e,t){let{render:r,className:l,style:o,id:i,...s}=e,{setLabelId:a}=function(){let e=n.useContext(e2);if(void 0===e)throw Error((0,b.default)(56));return e}(),u=(0,te.useBaseUiId)(i);return(0,c.useIsoLayoutEffect)(()=>(a(u),()=>{a(e=>e===u?void 0:e)}),[u,a]),(0,W.useRenderElement)("div",e,{ref:t,props:[{id:u,"aria-hidden":!0},s]})}),tn=e.i(18438).ListboxSeparator;e.s(["Arrow",0,e8,"Backdrop",0,em,"Group",0,e9,"GroupLabel",0,tt,"Icon",0,eu,"Item",0,e0,"ItemIndicator",0,e1,"ItemText",0,e6,"Label",0,G,"List",0,eG,"Popup",0,eY,"Portal",0,ed,"Positioner",0,eA,"Root",0,function(e){let{id:b,value:E,defaultValue:I=null,onValueChange:C,open:B,defaultOpen:W=!1,onOpenChange:q,name:$,form:K,autoComplete:G,disabled:J=!1,readOnly:X=!1,required:Q=!1,modal:Z=!0,actionsRef:ee,inputRef:et,onOpenChangeComplete:en,items:er,multiple:el=!1,itemToStringLabel:eo,itemToStringValue:ei,isItemEqualToValue:es=V.defaultItemEquality,highlightItemOnHover:ea=!0,children:eu}=e,{clearErrors:ec}=(0,j.useFormContext)(),{setDirty:ed,setTouched:ep,setFocused:ef,validityData:em,setFilled:eg,name:eh,disabled:ex,validation:eS,validationMode:ev}=(0,A.useFieldRootContext)(),eb=(0,T.useLabelableId)({id:b}),eR=ex||J,ey=eh??$,[ew,eE]=(0,u.useControlled)({controlled:E,default:el?I??m.EMPTY_ARRAY:I,name:"Select",state:"value"}),[eI,eC]=(0,u.useControlled)({controlled:B,default:W,name:"Select",state:"open"}),eA=n.useRef([]),eM=n.useRef([]),eT=n.useRef(null),eP=n.useRef(null),eV=n.useRef(0),eO=n.useRef(null),eL=n.useRef([]),eN=n.useRef(!1),eD=n.useRef(null),ek=n.useRef(null),ej=n.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),eH=n.useRef(!1),eF=n.useRef(ew),{mounted:eB,setMounted:eU,transitionStatus:e_}=(0,P.useTransitionStatus)(eI),{openMethod:eY,triggerProps:ez}=(0,F.useOpenInteractionType)(eI),eW=(0,o.useRefWithInit)(()=>new f.ReactStore({id:eb,labelId:void 0,modal:Z,multiple:el,itemToStringLabel:eo,itemToStringValue:ei,isItemEqualToValue:es,value:ew,open:eI,mounted:eB,transitionStatus:e_,items:er,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:m.EMPTY_OBJECT,triggerProps:m.EMPTY_OBJECT,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:m.NOOP,setOpen:m.NOOP,handleScrollArrowVisibility:m.NOOP,onOpenChangeComplete:m.NOOP,listRef:eA,popupRef:eT,scrollHandlerRef:eP,scrollArrowsMountedCountRef:eV,valueRef:eO,valuesRef:eL,labelsRef:eM,typingRef:eN,selectionRef:ej,firstItemTextRef:eD,selectedItemTextRef:ek,alignItemWithTriggerActiveRef:eH,initialValueRef:eF},L)).current,eq=eW.useState("activeIndex"),e$=eW.useState("selectedIndex"),eK=eW.useState("triggerElement"),eG=eW.useState("positionerElement"),eJ=(0,s.usePreviousValue)(eY),eX=eY??eJ,eQ=n.useMemo(()=>el?"":(0,O.stringifyAsValue)(ew,ei),[el,ew,ei]),eZ=n.useMemo(()=>el&&Array.isArray(ew)?ew.map(e=>(0,O.stringifyAsValue)(e,ei)):(0,O.stringifyAsValue)(ew,ei),[el,ew,ei]),e0=(0,p.useValueAsRef)(eK),e1=(0,d.useStableCallback)(()=>eZ);(0,M.useRegisterFieldControl)(e0,eb,ew,e1,!eR,$);let e4=el?Array.isArray(ew)&&ew.length>0:null!=ew&&""!==eQ;(0,c.useIsoLayoutEffect)(()=>{eg(e4)},[e4,eg]),(0,c.useIsoLayoutEffect)(function(){let e=(0,V.findSelectionIndex)(eL.current,ew,es,el);null===e&&(ek.current=null),eI||eW.set("selectedIndex",e)},[el,eI,ew,es,eW]),(0,H.useValueChanged)(ew,()=>{ec(ey),ed((0,V.isSelectedValueDirty)(ew,em.initialValue,es)),eS.change(ew)});let e6=(0,d.useStableCallback)((e,t)=>{q?.(e,t),!t.isCanceled&&(eC(e),e||t.reason!==D.REASONS.focusOut&&t.reason!==D.REASONS.outsidePress||(ep(!0),ef(!1),"onBlur"===ev&&eS.commit(ew)))}),e8=(0,d.useStableCallback)(()=>{eU(!1),eW.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),en?.(!1)});(0,k.useOpenChangeComplete)({enabled:!ee,open:eI,ref:eT,onComplete(){eI||e8()}}),n.useImperativeHandle(ee,()=>({unmount:e8}),[e8]);let e3=(0,d.useStableCallback)((e,t)=>{C?.(e,t),t.isCanceled||eE(e)}),e5=(0,d.useStableCallback)(e=>{let t=U(e.scrollHeight,e.clientHeight),n=_(e.scrollTop,t);eW.set("scrollUpArrowVisible",n>0),eW.set("scrollDownArrowVisible",n<t)}),e7=(0,x.useFloatingRootContext)({open:eI,onOpenChange:e6,elements:{reference:eK,floating:eG}}),e2=(0,g.useClick)(e7,{enabled:!eR,event:"mousedown"}),e9=(0,h.useDismiss)(e7),te=(0,S.useListNavigation)(e7,{enabled:!eR,listRef:eA,activeIndex:eq,selectedIndex:e$,disabledIndices:m.EMPTY_ARRAY,onNavigate(e){(null!==e||eI)&&eW.set("activeIndex",e)},focusItemOnHover:ea}),tt=(0,v.useTypeahead)(e7,{enabled:!eR&&(eI||!X&&!el),listRef:eM,activeIndex:eq,selectedIndex:e$,disabledIndices:e=>(0,a.isElementDisabled)(eA.current[e]),onMatch(e){eI?eW.set("activeIndex",e):e3(eL.current[e],(0,N.createChangeEventDetails)(D.REASONS.none))},onTyping(e){eN.current=e}}),tn=n.useMemo(()=>(0,z.mergeProps)(tt.reference,te.reference,e9.reference,e2.reference,ez),[e2.reference,tt.reference,te.reference,e9.reference,ez]),tr=n.useMemo(()=>(0,z.mergeProps)(Y.FOCUSABLE_POPUP_PROPS,tt.floating,te.floating,e9.floating),[tt.floating,te.floating,e9.floating]),tl=te.item??m.EMPTY_OBJECT;eW.useContextCallback("setValue",e3),eW.useContextCallback("setOpen",e6),eW.useContextCallback("handleScrollArrowVisibility",e5),eW.useContextCallback("onOpenChangeComplete",en),(0,i.useOnFirstRender)(()=>{eW.update({popupProps:tr,triggerProps:tn})}),eW.useSyncedValues({id:eb,modal:Z,multiple:el,value:ew,open:eI,mounted:eB,transitionStatus:e_,popupProps:tr,triggerProps:tn,items:er,itemToStringLabel:eo,itemToStringValue:ei,isItemEqualToValue:es,openMethod:eX});let to=n.useMemo(()=>({disabled:eR,readOnly:X,required:Q,multiple:el,highlightItemOnHover:ea,itemProps:tl}),[eR,X,Q,el,ea,tl]),ti=(0,l.useMergedRefs)(et,eS.inputRef),ts=el?void 0:ey,ta=n.useMemo(()=>el&&Array.isArray(ew)&&ey?ew.map(e=>{let n=(0,O.stringifyAsValue)(e,ei);return(0,t.jsx)("input",{type:"hidden",form:K,name:ey,value:n,disabled:eR},n)}):null,[el,ew,K,ey,ei,eR]);return(0,t.jsxs)(R.Provider,{value:eW,children:[(0,t.jsx)(y.Provider,{value:to,children:(0,t.jsx)(w.Provider,{value:e7,children:eu})}),(0,t.jsx)("input",{...eS.getValidationProps(eR,{onFocus(){eW.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||eR||X)return;let t=e.currentTarget.value,n=(0,N.createChangeEventDetails)(D.REASONS.none,e.nativeEvent);eW.set("forceMount",!0),queueMicrotask(function(){if(el)return;let e=t.toLowerCase(),r=eL.current.findIndex(t=>(0,O.stringifyAsValue)(t,ei).toLowerCase()===e||(0,O.stringifyAsLabel)(t,eo).toLowerCase()===e);-1===r&&(r=eL.current.findIndex((t,n)=>{let r=eM.current[n];return null!=r&&r.toLowerCase()===e}));let l=eL.current[r];null!=l&&e3(l,n)})}}),id:eb&&null==ts?`${eb}-hidden-input`:void 0,form:K,name:ts,autoComplete:G,value:eQ,disabled:eR,required:Q&&!(el&&e4),readOnly:X,ref:ti,style:ey?r.visuallyHiddenInput:r.visuallyHidden,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ta]})},"ScrollDownArrow",0,e5,"ScrollUpArrow",0,e7,"Separator",0,tn,"Trigger",0,ei,"Value",0,ea],74786);var tr=e.i(74786),tr=tr,tl=e.i(25913),to=e.i(89664),ti=e.i(56420);let ts={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};ts.node;let ta=(0,ti.default)(ts);var tu=e.i(90063);let tc=tr.Root,td=(0,tl.cva)("inline-flex w-fit shrink-0 items-center justify-between gap-1.5 rounded-md border border-input bg-card whitespace-nowrap text-foreground shadow-sm transition-[border-color,box-shadow] duration-(--duration-fast) outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/22 data-disabled:pointer-events-none data-disabled:opacity-45 data-popup-open:border-ring [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{size:{sm:"h-(--size-control-sm) px-2.5 text-meta [&_svg]:size-(--size-icon-sm)",touch:"h-(--size-control-touch) w-full rounded-lg px-3 text-body-touch [&_svg]:size-(--size-icon)"}},defaultVariants:{size:"sm"}});e.s(["Select",0,tc,"SelectContent",0,function({className:e,children:n,...r}){return(0,t.jsx)(tr.Portal,{children:(0,t.jsx)(tr.Positioner,{className:"isolate z-50 outline-none",sideOffset:4,alignItemWithTrigger:!1,children:(0,t.jsx)(tr.Popup,{"data-slot":"select-content",className:(0,tu.classNames)("max-h-(--available-height) min-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",e),...r,children:(0,t.jsx)(tr.List,{children:n})})})})},"SelectItem",0,function({className:e,children:n,...r}){return(0,t.jsxs)(tr.Item,{"data-slot":"select-item",className:(0,tu.classNames)("relative flex 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",e),...r,children:[(0,t.jsx)(tr.ItemText,{children:n}),(0,t.jsx)(tr.ItemIndicator,{className:"absolute right-2.5 flex items-center",children:(0,t.jsx)(to.Check,{"aria-hidden":!0,className:"size-(--size-icon)"})})]})},"SelectTrigger",0,function({className:e,size:n,children:r,...l}){return(0,t.jsxs)(tr.Trigger,{"data-slot":"select-trigger",className:(0,tu.classNames)(td({size:n}),e),...l,children:[r,(0,t.jsx)(tr.Icon,{className:"flex text-muted-foreground",children:(0,t.jsx)(ta,{"aria-hidden":!0})})]})},"SelectValue",0,function(e){return(0,t.jsx)(tr.Value,{"data-slot":"select-value",...e})}],46033)}]);
|