@aeolus-fleet/console 0.25.0 → 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/.next/standalone/packages/console/.next/BUILD_ID +1 -1
  2. package/.next/standalone/packages/console/.next/build-manifest.json +3 -3
  3. package/.next/standalone/packages/console/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page/server-reference-manifest.json +16 -16
  5. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page.js.nft.json +1 -1
  6. package/.next/standalone/packages/console/.next/server/app/(console)/inbox/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page/server-reference-manifest.json +16 -16
  8. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page.js.nft.json +1 -1
  9. package/.next/standalone/packages/console/.next/server/app/(console)/labels/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page/server-reference-manifest.json +16 -16
  11. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page.js.nft.json +1 -1
  12. package/.next/standalone/packages/console/.next/server/app/(console)/needs-attention/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page/server-reference-manifest.json +16 -16
  14. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page.js.nft.json +1 -1
  15. package/.next/standalone/packages/console/.next/server/app/(console)/needs-crew/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/packages/console/.next/server/app/(console)/network/page/server-reference-manifest.json +16 -16
  17. package/.next/standalone/packages/console/.next/server/app/(console)/network/page.js.nft.json +1 -1
  18. package/.next/standalone/packages/console/.next/server/app/(console)/network/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/packages/console/.next/server/app/(console)/page/server-reference-manifest.json +16 -16
  20. package/.next/standalone/packages/console/.next/server/app/(console)/page.js.nft.json +1 -1
  21. package/.next/standalone/packages/console/.next/server/app/(console)/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/packages/console/.next/server/app/(console)/questions/page/server-reference-manifest.json +16 -16
  23. package/.next/standalone/packages/console/.next/server/app/(console)/questions/page.js.nft.json +1 -1
  24. package/.next/standalone/packages/console/.next/server/app/(console)/questions/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page/server-reference-manifest.json +16 -16
  26. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page.js.nft.json +1 -1
  27. package/.next/standalone/packages/console/.next/server/app/(console)/settings/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page/server-reference-manifest.json +16 -16
  29. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page.js.nft.json +1 -1
  30. package/.next/standalone/packages/console/.next/server/app/(console)/ships/[shipId]/page_client-reference-manifest.js +1 -1
  31. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page/server-reference-manifest.json +16 -16
  32. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page.js.nft.json +1 -1
  33. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page/server-reference-manifest.json +16 -16
  35. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page.js.nft.json +1 -1
  36. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page/server-reference-manifest.json +16 -16
  38. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page.js.nft.json +1 -1
  39. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page/server-reference-manifest.json +16 -16
  41. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page.js.nft.json +1 -1
  42. package/.next/standalone/packages/console/.next/server/app/(console)/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page/server-reference-manifest.json +16 -16
  44. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page.js.nft.json +1 -1
  45. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/[shipId]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page/server-reference-manifest.json +16 -16
  47. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page.js.nft.json +1 -1
  48. package/.next/standalone/packages/console/.next/server/app/(console)/trierarchs/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/packages/console/.next/server/app/_global-error.html +1 -1
  50. package/.next/standalone/packages/console/.next/server/app/_global-error.rsc +1 -1
  51. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  52. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  53. package/.next/standalone/packages/console/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  54. package/.next/standalone/packages/console/.next/server/app/api/reads/[read]/route.js.nft.json +1 -1
  55. package/.next/standalone/packages/console/.next/server/app/version/route.js.nft.json +1 -1
  56. package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__06f_104._.js +1 -1
  57. package/.next/standalone/packages/console/.next/server/chunks/[root-of-the-server]__1cfwaji._.js +1 -1
  58. package/.next/standalone/packages/console/.next/server/chunks/ssr/0mxb_server_app_(console)_squadrons_blueprints_[name]_page_actions_170owr_.js +1 -1
  59. package/.next/standalone/packages/console/.next/server/chunks/ssr/0mxb_server_app_(console)_squadrons_templates_[name]_page_actions_09abrr0.js +1 -1
  60. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_needs-crew_page_actions_08gu8-f.js +1 -1
  61. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_network_page_actions_1muuv-j.js +1 -1
  62. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_questions_page_actions_12d6yd2.js +1 -1
  63. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_settings_page_actions_0b6qztr.js +1 -1
  64. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_ships_[shipId]_page_actions_0g2nd1p.js +1 -1
  65. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_squadrons_page_actions_1x3afts.js +1 -1
  66. package/.next/standalone/packages/console/.next/server/chunks/ssr/0ysl_console__next-internal_server_app_(console)_trierarchs_page_actions_1ow37mz.js +1 -1
  67. package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_needs-attention_page_actions_1jfgclw.js +1 -1
  68. package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_squadrons_[squadronId]_page_actions_1lzqlye.js +1 -1
  69. package/.next/standalone/packages/console/.next/server/chunks/ssr/1eui__next-internal_server_app_(console)_trierarchs_[shipId]_page_actions_0l7bxva.js +1 -1
  70. package/.next/standalone/packages/console/.next/server/chunks/ssr/[root-of-the-server]__197gd9r._.js +1 -1
  71. package/.next/standalone/packages/console/.next/server/chunks/ssr/_01eyvjo._.js +1 -1
  72. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_20i0fo8._.js → _03figwl._.js} +1 -1
  73. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0cak8i7._.js +1 -1
  74. package/.next/standalone/packages/console/.next/server/chunks/ssr/_0ll55v1._.js +1 -1
  75. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_127j_99._.js → _0magod9._.js} +1 -1
  76. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0or-_73._.js → _0ze4jen._.js} +1 -1
  77. package/.next/standalone/packages/console/.next/server/chunks/ssr/_11s1izd._.js +1 -1
  78. package/.next/standalone/packages/console/.next/server/chunks/ssr/_195z53h._.js +1 -1
  79. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0wxg7hg._.js → _1aub6rh._.js} +1 -1
  80. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1buuyye._.js +1 -1
  81. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1geqwzr._.js +1 -1
  82. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_1r9nd0e._.js → _1hl4kpn._.js} +1 -1
  83. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1or2awi._.js +1 -1
  84. package/.next/standalone/packages/console/.next/server/chunks/ssr/{_0punyro._.js → _1tt3h4z._.js} +1 -1
  85. package/.next/standalone/packages/console/.next/server/chunks/ssr/_1u0h4gj._.js +1 -1
  86. package/.next/standalone/packages/console/.next/server/chunks/ssr/{node_modules_@base-ui_react_0xxx54b._.js → node_modules_@base-ui_react_1of81la._.js} +2 -2
  87. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_01vespm._.js → packages_console_122o2i3._.js} +1 -1
  88. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_0n040z7._.js → packages_console_1adfz1r._.js} +1 -1
  89. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_02tq-5j._.js → packages_console_1upjt78._.js} +1 -1
  90. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_inbox_page_actions_0q9_xye.js +1 -1
  91. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_labels_page_actions_0tk7mqs.js +1 -1
  92. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console__next-internal_server_app_(console)_page_actions_1ftjjyq.js +1 -1
  93. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_needs-attention_page_tsx_03s6y-o._.js +1 -1
  94. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_app_(console)_overview-page_tsx_15siba6._.js +1 -1
  95. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_1_fszuc._.js → packages_console_features_1ycqicv._.js} +1 -1
  96. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_143srw6._.js → packages_console_features_squadrons_organisms_form-squadron-dialog_tsx_12z690a._.js} +1 -1
  97. package/.next/standalone/packages/console/.next/server/chunks/ssr/{packages_console_features_trierarchs_organisms_clear-worktree-dialog_tsx_0mlws3e._.js → packages_console_features_trierarchs_organisms_clear-worktree-dialog_tsx_140y8dv._.js} +1 -1
  98. package/.next/standalone/packages/console/.next/server/chunks/ssr/packages_console_lib_11xnux-._.js +1 -1
  99. package/.next/standalone/packages/console/.next/server/middleware-build-manifest.js +3 -3
  100. package/.next/standalone/packages/console/.next/server/pages/500.html +1 -1
  101. package/.next/standalone/packages/console/.next/server/server-reference-manifest.js +1 -1
  102. package/.next/standalone/packages/console/.next/server/server-reference-manifest.json +17 -17
  103. package/.next/standalone/packages/console/.next/static/chunks/{2vnmap15_4ik5.js → 08fntqgo3353u.js} +1 -1
  104. package/.next/standalone/packages/console/.next/static/chunks/{0rr9rjc_bc3gf.js → 0nztfy7ba1ez4.js} +1 -1
  105. package/.next/standalone/packages/console/.next/static/chunks/{1s_391feiypzt.js → 0xklzua--y-te.js} +1 -1
  106. package/.next/standalone/packages/console/.next/static/chunks/{1p87dal8vyega.js → 1cys0q4nekmo8.js} +1 -1
  107. package/.next/standalone/packages/console/.next/static/chunks/{0jvnv44qtww0y.js → 1vusd9lpo6rtl.js} +1 -1
  108. package/.next/standalone/packages/console/.next/static/chunks/{1ek70m0owmcgq.js → 274y91hwkjxt3.js} +1 -1
  109. package/.next/standalone/packages/console/.next/static/chunks/{28eaginqf0r6l.js → 2fawp7c5ud5cq.js} +1 -1
  110. package/.next/standalone/packages/console/.next/static/chunks/{14gq9h4bre4zl.js → 2fcx48n2u74f8.js} +1 -1
  111. package/.next/standalone/packages/console/.next/static/chunks/{2mlx4u2m3gj4n.js → 2fqbkmkhj5cfr.js} +1 -1
  112. package/.next/standalone/packages/console/.next/static/chunks/{2vjnc-m734xfm.js → 2fsy26x-aeybj.js} +1 -1
  113. package/.next/standalone/packages/console/.next/static/chunks/{1kzen4nzgfhzx.js → 2nxpt1ggh42xf.js} +1 -1
  114. package/.next/standalone/packages/console/.next/static/chunks/2sdb6_s313-_0.js +1 -0
  115. package/.next/standalone/packages/console/.next/static/chunks/{0r2pzmadty78a.js → 3a-i8z6d_l5j9.js} +1 -1
  116. package/.next/standalone/packages/console/.next/static/chunks/{2iwxdddbd25in.js → 3hfbb6--wbkq6.js} +1 -1
  117. package/.next/standalone/packages/console/.next/static/chunks/{11tuykopff7e_.js → 3lwa1pmekf5yn.js} +1 -1
  118. package/.next/standalone/packages/console/.next/static/chunks/3otcabh_gijq-.js +1 -0
  119. package/.next/standalone/packages/console/.next/static/chunks/{3sgvr4qucbnoq.js → 3pq58846qyog_.js} +1 -1
  120. package/.next/standalone/packages/console/.next/static/chunks/{3fz2o2p_07f9u.js → 3t0b867w1fd16.js} +1 -1
  121. package/.next/standalone/packages/console/.next/static/chunks/{2w9atwkwe6d4r.js → 3yteehwrrznjm.js} +1 -1
  122. package/.next/standalone/packages/console/.next/static/chunks/{1cg31hv7ug_rw.js → 43wruh-j46sq_.js} +1 -1
  123. package/.next/standalone/packages/console/package.json +3 -3
  124. package/package.json +3 -3
  125. package/.next/standalone/packages/console/.next/static/chunks/0bb19hfyc42kn.js +0 -1
  126. package/.next/standalone/packages/console/.next/static/chunks/3dmesrmg4eee9.js +0 -1
  127. /package/.next/standalone/packages/console/.next/static/{JdC0gQewmBAtNW6TcHLnI → -CS98dpuGlTUZ_q58bGCs}/_buildManifest.js +0 -0
  128. /package/.next/standalone/packages/console/.next/static/{JdC0gQewmBAtNW6TcHLnI → -CS98dpuGlTUZ_q58bGCs}/_clientMiddlewareManifest.js +0 -0
  129. /package/.next/standalone/packages/console/.next/static/{JdC0gQewmBAtNW6TcHLnI → -CS98dpuGlTUZ_q58bGCs}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42047,e=>{"use strict";var t=e.i(43476),s=e.i(80799),n=e.i(22016),a=e.i(18566),i=e.i(71645),r=e.i(15905),l=e.i(65041),o=e.i(52886),d=e.i(66787),c=e.i(92870),u=e.i(90063);let p={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 h({label:e,shortLabel:s,value:a,detail:i,href:r,icon:l,tone:o,testId:d}){return(0,t.jsxs)(n.default,{href:r,"data-testid":d,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,u.classNames)("flex size-6.5 shrink-0 items-center justify-center rounded-md border max-sm:size-5.5",p[o]),children:(0,t.jsx)(l,{"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:a}),(0,t.jsx)("span",{className:"truncate text-meta text-muted-foreground",children:i})]})}var m=e.i(5387),f=e.i(28459),x=e.i(96676),g=e.i(49635);function v(e){return e.filter(e=>"agent"===e.kind&&"retired"!==e.status)}function j(){var e;let s,n,a,i,r=(0,m.useFleetSnapshot)(),l=(0,f.useNeedsAttention)(),u=(0,f.useAttentionCount)(),p=(0,x.useNow)();if(!r.data)return null;let j=(a=(n=(s=v((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,g.duration)(a.since,e.now)},oldestUndeliverable:i&&(0,g.duration)(i,e.now)});return 0===j.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)(h,{label:"Ships crewed",shortLabel:"Crewed",value:j.crewedCount,detail:`of ${String(j.activeCount)} active ships`,href:"/?status=crewed",icon:c.UserCheck,tone:"ok",testId:"overview-crewed"}),(0,t.jsx)(h,{label:"Awaiting crew",value:j.awaitingCount,detail:j.longestWait?`Longest wait: ${j.longestWait.name}, ${j.longestWait.wait}`:"Every active ship is crewed",href:"/?status=awaitingCrew",icon:o.CircleDashed,tone:"waiting",testId:"overview-awaiting"}),(0,t.jsx)(h,{label:"Needs attention",value:u??0,detail:j.oldestUndeliverable?`Undeliverable deliveries, oldest ${j.oldestUndeliverable}`:"Nothing needs you",href:"/needs-attention",icon:d.TriangleAlert,tone:"attention",testId:"overview-attention"})]})}var b=e.i(77071),w=e.i(17540),S=e.i(25242),y=e.i(8041),C=e.i(78608),N=e.i(41880),k=e.i(49092),R=e.i(87600),O=e.i(16752),P=e.i(86165),I=e.i(48695),T=e.i(265);let q=(0,w.lazyDialog)(()=>e.A(27830).then(e=>e.CommissionDialog),e=>e.isOpen),E=(0,w.lazyDialog)(()=>e.A(95953).then(e=>e.StartingPromptDialog),e=>e.isOpen);function A({isOpen:e,onOpenChange:s}){let n=(0,m.useFleetSnapshot)(),a=(0,k.useFleetLimits)(),l=(0,R.useHostedAccountUrl)(),o=(0,m.useCommissionShip)(),d=(0,m.useRequestCrew)(),c="connected"===(0,T.useTrierarchPluginConnection)(),u=(0,T.useMachines)(),p=(0,P.useSquadronsConnection)(),h=(0,I.useSquadrons)(),[f,x]=(0,i.useState)(!1),[g,v]=(0,i.useState)(null),j=(0,y.offersOf)(u.data??[]),w=(0,m.useLabelContext)(),{shipLabelsMax:M}=(0,S.useConsoleConstants)(),L=void 0===w||void 0===u.data?void 0:(0,C.machineLabelsInputOf)(w,{machines:u.data,shipLabelsMax:M}),z=(0,T.useCrewSettingsCheck)(e&&c?null===g?(0,y.settingsOf)((0,y.defaultValues)(j)):g:void 0),$=(n.data??[]).filter(e=>"retired"!==e.status),V=(e,t)=>{o.mutate(e,{onSuccess:({shipId:n})=>{s(!1);let a=c&&void 0!==t;a||x(!0),void 0!==t&&d.mutate({shipId:n,settings:t.settings},{onSuccess:()=>{a&&(0,N.showToast)({title:`${e.name} commissioned, crew requested`,description:"The trierarch plugin assigns a trierarch that fits.",tone:"success"})},onError:t=>{(0,N.showToast)({title:`Couldn’t request a crew for ${e.name}`,description:`${t.message} The ship is commissioned; request a crew on its page.`,tone:"error"})}})}})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"primary",icon:(0,t.jsx)(b.Plus,{}),"data-testid":"fleet-commission",onClick:()=>{o.reset(),v(null),s(!0)},children:"Commission ship"}),(0,t.jsx)(q,{activeShips:$,isOpen:e,onOpenChange:s,isPending:o.isPending,error:o.error?.message,shipLimit:(0,O.shipLimitReached)(a.data),accountUrl:l,...c?{crewRequest:{offers:j,squadrons:"connected"===p?(h.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===L?{}:{machineLabels:L},check:z.data,onSettingsChange:v}}:{},onSubmit:(e,t)=>{let s={...e,idempotencyKey:crypto.randomUUID()};c&&void 0!==t?z.checkNow().catch(()=>void 0).then(e=>{e?.kind!=="refused"&&V(s,t)}).catch(()=>void 0):V(s,t)}}),(0,t.jsx)(E,{shipName:o.variables?.name??"",state:"shown",prompt:o.data?.prompt??void 0,crewLines:o.data?.crewLines??void 0,isOpen:f&&void 0!==o.data,onOpenChange:e=>{e||(x(!1),o.reset())},onConfirm:()=>void 0})]})}var M=e.i(56420);let L={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"}]]};L.node;let z=(0,M.default)(L);var $=e.i(30274),V=e.i(49287),D=e.i(78865);let B={ships:{label:"Ships",unit:"ships",Icon:V.Ship},messages:{label:"Messages today",unit:"messages",Icon:$.Send}},F={below:"bg-primary",at:"bg-tone-waiting-fg",over:"bg-tone-attention-fg"},H={at:"at-limit",over:"over-limit"};function U({kind:e,count:s,limit:n,resetsAt:a}){let{label:i,unit:r,Icon:l}=B[e],o=(0,O.meterState)({count:s,limit:n}),d=H[o],c=(0,O.meterCaption)({count:s,limit:n}),p=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)(D.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,O.meterCount)(s)}),(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:null===n?r:`of ${(0,O.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)(z,{"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,u.classNames)("block h-full rounded-full","none"===o?void 0:F[o]),style:{width:`${String(100*p)}%`}})}),(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,O.resetTime)(a)}`]})]})]})}function K(){let e=(0,k.useFleetLimits)().data,s=(0,R.useHostedAccountUrl)();return(0,O.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)(U,{kind:"ships",count:e.ships.count,limit:e.ships.limit}),(0,t.jsx)(U,{kind:"messages",count:e.dailyMessages.count,limit:e.dailyMessages.limit,resetsAt:e.dailyMessages.resetsAt})]})]}):null}var _=e.i(9176),W=e.i(84294),G=e.i(72382),X=e.i(31458),Y=e.i(69309),J=e.i(66595);let Q={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"}]]};Q.node;let Z=(0,M.default)(Q);var ee=e.i(26478);let et=["console","claudeCode","codex","trierarch","plugin","other"],es={console:"Console",claudeCode:"Claude Code",codex:"Codex",trierarch:"Trierarch",plugin:"Plugin",other:"Other"},en={"claude-code":"claudeCode",codex:"codex"},ea={awaitingCrew:"Awaiting crew",crewed:"Crewed",retired:"Retired"};function ei(e,{column:t,squadronsOf:s}){switch(t){case"ship":return e.name;case"status":return ea[e.status];case"report":return"agent"===e.kind&&"crewed"===e.status?e.report?.note??void 0:void 0;case"squadronAndLabels":{let t=s?.get(e.id);if(void 0!==t&&null!==t.role)return t.squadronId;let[n]=e.labels;return void 0===n?void 0:`${n.key}=${n.value}`}case"runsOn":if("crewed"!==e.status||"viewer"===e.kind)return;return"operator"===e.kind?"console":e.harness??void 0;case"seen":return e.lastSeenAt??void 0}}var er=e.i(54492),el=e.i(80581),eo=e.i(49841);let ed={query:"",filters:{status:"all",crewRequest:"all",kind:"all",type:"all",squadron:"all",isRetiredShown:!1,labelValueIds:[]},sort:null},ec=new Set;function eu(e,t){return e.kind!==t.kind?"operator"===e.kind?-1:+("operator"===t.kind):0}function ep(e,t){return[...new Set(e.filter(e=>t||"retired"!==e.status).map(e=>e.type))].toSorted((e,t)=>e.localeCompare(t))}function eh(e){return e.filter(e=>"retired"===e.status).length}function em(e){return[...new Set([...e.values()].map(e=>e.squadronId))].toSorted((e,t)=>e.localeCompare(t))}let ef={crewed:"Crewed",awaitingCrew:"Awaiting crew"};function ex(e){return eg(e).length+e.labelValueIds.length}function eg(e){return["all"===e.status?void 0:`Status: ${ef[e.status]}`,"all"===e.crewRequest?void 0:`Crew request: ${(0,eo.crewRequestKeyWord)(e.crewRequest)}`,"all"===e.kind?void 0:`Kind: ${es[e.kind]}`,"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 ev=e.i(66390),ej=e.i(12470),eb=e.i(91727),ew=e.i(46033),eS=e.i(75305),ey=e.i(75867),eC=e.i(14732),eN=e.i(67874),ek=e.i(17981),eR=e.i(95960);function eO({chips:e,width:s,testId:a,href:i}){if(0===e.length)return null;let{shown:r,folded:l}=0===s?{shown:[],folded:e}:(0,el.rowChips)(e,s);return(0,t.jsxs)("span",{"data-testid":a,className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r.map((e,s)=>(0,t.jsx)(eR.LabelChip,{chip:e,className:0===s?"min-w-0 shrink":void 0},e.valueId)),0===l.length?null:void 0===i?(0,t.jsxs)("span",{title:l.map(el.chipTitleOf).join("; "),className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums",children:["+",l.length,(0,t.jsx)("span",{className:"sr-only",children:" more labels"})]}):(0,t.jsxs)(n.default,{href:i,title:l.map(el.chipTitleOf).join("; "),"aria-label":`View ${l.length} more labels`,className:"inline-flex h-5.5 shrink-0 items-center rounded-sm bg-secondary px-1.5 text-caption font-medium text-foreground tabular-nums hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:["+",l.length]})]})}var eP=e.i(88393);let eI={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"}]]};eI.node;let eT=(0,M.default)(eI),eq={name:"signal-low",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]};eq.node;let eE=(0,M.default)(eq),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,M.default)(eA);e.s([],51047),e.i(51047);var eL=e.i(96499),ez=e.i(56789),e$=e.i(46376),eV=e.i(33332);let eD=i.createContext(void 0);function eB(e){let t=i.useContext(eD);if(void 0===t&&!e)throw Error((0,eV.default)(72));return t}var eF=e.i(74735),eH=e.i(67865),eU=e.i(29315),eK=e.i(84446),e_=e.i(57940);function eW(e){return null!=e&&null!=e.clientX}var eG=e.i(17989),eX=e.i(75606),eY=e.i(64111),eJ=e.i(76782),eQ=e.i(26352),eZ=e.i(56434),e0=e.i(18478),e1=e.i(16786),e2=e.i(90627);let e5={...e1.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 e4 extends eQ.ReactStore{constructor(e,t,s){const n=new e2.PopupTriggerMap;super(e6(e,n,t,s),e7(n),e5)}setOpen=(e,t)=>{(0,eY.applyPopupOpenChange)(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,(0,eX.createChangeEventDetails)(eZ.REASONS.triggerPress,e))}}function e6(e,t,s,n=!1){return{...(0,e1.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 e7(e){return{popupRef:i.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}let e8=(0,eL.fastComponent)(function(e){let{disabled:s=!1,defaultOpen:n=!1,open:a,disableHoverablePopup:r=!1,trackCursorAxis:l="none",actionsRef:o,onOpenChange:d,onOpenChangeComplete:c,handle:u,triggerId:p,defaultTriggerId:h=null,children:m}=e,f=(0,eY.usePopupRootStore)((e,t)=>new e4({open:n,openProp:a,activeTriggerId:h,triggerIdProp:p},e,t));f.useControlledProp("openProp",a),f.useControlledProp("triggerIdProp",p),f.useContextCallback("onOpenChange",d),f.useContextCallback("onOpenChangeComplete",c);let x=f.useState("open"),g=!s&&x,v=f.useState("activeTriggerId"),j=f.useState("mounted"),b=f.useState("payload");f.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:r,disabled:s}),(0,eY.useImplicitActiveTrigger)(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:w,transitionStatus:S}=(0,eY.useOpenStateTransitions)(g,f),y=f.useState("isInstantPhase"),C=f.useState("instantType"),N=f.useState("lastOpenChangeReason"),k=i.useRef(null);(0,e$.useIsoLayoutEffect)(()=>{x&&s&&f.setOpen(!1,(0,eX.createChangeEventDetails)(eZ.REASONS.disabled))},[x,s,f]),(0,e$.useIsoLayoutEffect)(()=>{"ending"===S&&N===eZ.REASONS.none||"ending"!==S&&y?("delay"!==C&&(k.current=C),f.set("instantType","delay")):null!==k.current&&(f.set("instantType",k.current),k.current=null)},[S,y,N,C,f]),(0,e$.useIsoLayoutEffect)(()=>{g&&null==v&&f.set("payload",void 0)},[f,v,g]),i.useImperativeHandle(o,()=>({unmount:w,close:()=>f.setOpen(!1,(0,eX.createChangeEventDetails)(eZ.REASONS.imperativeAction))}),[w,f]);let R=g||j||!s&&"none"!==l;return(0,t.jsxs)(eD.Provider,{value:f,children:[u&&(0,t.jsx)(eY.PopupHandleAttachment,{handle:u,store:f}),R&&(0,t.jsx)(e3,{store:f,disabled:s,trackCursorAxis:l}),"function"==typeof m?m({payload:b}):m]})});function e3({store:e,disabled:t,trackCursorAxis:s}){let n=e.useState("floatingRootContext"),a=(0,eG.useDismiss)(n,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),r=function(e,t={}){let{enabled:s=!0,axis:n="both"}=t,a="rootStore"in e?e.rootStore:e,r=a.useState("open"),l=a.useState("floatingElement"),o=a.useState("domReferenceElement"),d=a.context.dataRef,c=i.useRef(!1),u=i.useRef(null),[p,h]=i.useState(),[m,f]=i.useState([]),x=(0,eH.useStableCallback)(e=>{a.set("positionReference",e)}),g=(0,eH.useStableCallback)((e,t,s)=>{if(!c.current&&(!d.current.openEvent||eW(d.current.openEvent))){var i,r;let l,c,u;a.set("positionReference",(i=s??o,r={x:e,y:t,axis:n,dataRef:d,pointerType:p},l=null,c=null,u=!1,{contextElement:i||void 0,getBoundingClientRect(){let e=i?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},t="x"===r.axis||"both"===r.axis,s="y"===r.axis||"both"===r.axis,n=["mouseenter","mousemove"].includes(r.dataRef.current.openEvent?.type||"")&&"touch"!==r.pointerType,a=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,a=0,o=0,!u||n?(a="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&&!n&&(o="x"===r.axis?e.height:o,a="y"===r.axis?e.width:a),u=!0,{width:a,height:o,x:d,y:p,top:p,right:d+a,bottom:p+o,left:d}}}))}}),v=(0,eH.useStableCallback)(e=>{r?u.current||(g(e.clientX,e.clientY,e.currentTarget),f([])):g(e.clientX,e.clientY,e.currentTarget)}),j=(0,e_.isMouseLikePointerType)(p)?l:r;i.useEffect(()=>{if(!s)return void x(o);if(!j)return;function e(){u.current?.(),u.current=null}let t=(0,eU.getWindow)(l);return!d.current.openEvent||eW(d.current.openEvent)?u.current=(0,eF.addEventListener)(t,"mousemove",function(t){let s=(0,eK.getTarget)(t);(0,eK.contains)(l,s)?e():g(t.clientX,t.clientY)}):x(o),e},[j,s,l,d,o,a,g,x,m]),i.useEffect(()=>()=>{a.set("positionReference",null)},[a]),i.useEffect(()=>{s&&!l&&(c.current=!1)},[s,l]),i.useEffect(()=>{!s&&r&&(c.current=!0)},[s,r]);let b=i.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return i.useMemo(()=>s?{reference:b,trigger:b}:{},[s,b])}(n,{enabled:!t&&"none"!==s,axis:"none"===s?void 0:s}),l=i.useMemo(()=>(0,eJ.mergeProps)(r.reference,a.reference),[r.reference,a.reference]);return(0,eY.usePopupInteractionProps)(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:a.floating??ez.EMPTY_OBJECT}),null}var e9=e.i(39957),te=e.i(46265),tt=e.i(79938),ts=e.i(52245),tn=e.i(59636),ta=e.i(88015);let ti=i.createContext(void 0);var tr=e.i(50316),tl=e.i(44681);let to=i.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new e9.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function td(e){let{children:s,delay:n,timeoutMs:a=0}=e,r=i.useRef(n),l=i.useRef(n),o=i.useRef(null),d=i.useRef(null),c=(0,e9.useTimeout)();return(0,e$.useIsoLayoutEffect)(()=>{if(l.current=n,!o.current){r.current=n;return}r.current={open:(0,tl.getDelay)(r.current,"open"),close:(0,tl.getDelay)(n,"close")}},[n,o,r,l]),(0,t.jsx)(to.Provider,{value:i.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:l,currentIdRef:o,timeoutMs:a,currentContextRef:d,timeout:c}),[a,c]),children:s})}var tc=e.i(13082),tu=e.i(72135),tp=e.i(73752),th=e.i(22846);let tm="data-base-ui-tooltip-trigger";function tf(e){if("composedPath"in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let s=t[e];if((0,eU.isElement)(s))return s}}let t=e.target;return(0,eU.isElement)(t)?t:null}let tx=(0,eL.fastComponentRef)(function(e,t){let{render:s,className:n,style:a,handle:r,payload:l,disabled:o,delay:d,closeOnClick:c=!0,closeDelay:u,id:p,...h}=e,m=eB(!0),f=(0,tn.usePopupHandleStore)(r)??m;if(!f)throw Error((0,eV.default)(82));let x=(0,ta.useBaseUiId)(p),g=f.useState("isTriggerActive",x),v=f.useState("isOpenedByTrigger",x),j=f.useState("floatingRootContext"),b=i.useRef(null),w=u??0,{registerTrigger:S,isMountedByThisTrigger:y}=(0,eY.useTriggerDataForwarding)(x,b,f,{payload:l,closeOnClick:c,closeDelay:w}),C=i.useContext(ti),{activeIdRef:N,delayRef:k,isInstantPhase:R,hasProvider:O}=function(e,t={open:!1}){let{open:s}=t,n="rootStore"in e?e.rootStore:e,a=n.useState("floatingId"),{currentIdRef:r,delayRef:l,timeoutMs:o,initialDelayRef:d,currentContextRef:c,hasProvider:u,timeout:p}=i.useContext(to),[h,m]=i.useState(!1),f=i.useRef(s);return(0,e$.useIsoLayoutEffect)(()=>{f.current=s},[s]),(0,e$.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===a){if(m(!1),o)return p.start(o,()=>{n.select("open")||r.current&&r.current!==a||e()}),()=>{(f.current||r.current!==a)&&p.clear()};e()}},[s,a,r,l,o,d,c,p,n]),(0,e$.useIsoLayoutEffect)(()=>{if(!s)return;let e=c.current,t=r.current;p.clear(),c.current={onOpenChange:n.setOpen,setIsInstantPhase:m},r.current=a,l.current={open:0,close:(0,tl.getDelay)(d.current,"close")},null!==t&&t!==a?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,(0,eX.createChangeEventDetails)(eZ.REASONS.none))):(m(!1),e?.setIsInstantPhase(!1))},[s,a,n,r,l,d,c,p]),(0,e$.useIsoLayoutEffect)(()=>()=>{r.current===a&&(c.current=null,f.current)&&(r.current=null,l.current=d.current,p.clear())},[c,r,l,a,d,p]),i.useMemo(()=>({activeIdRef:r,hasProvider:u,delayRef:l,isInstantPhase:h}),[r,u,l,h])}(j,{open:v}),P=(0,tp.useHoverInteractionSharedState)(j);f.useSyncedValue("isInstantPhase",R);let I=f.useState("disabled"),T=o??I,q=(0,te.useValueAsRef)(T),E=f.useState("trackCursorAxis"),A=f.useState("disableHoverablePopup"),M=i.useRef(!1),L=(0,e9.useTimeout)(),z=i.useRef(void 0);function $(){return O&&null!=N.current?0:d??C??600}function V(e){let t=b.current;if(!t||!e)return!1;let s=function(e){let t=e;for(;t;){let e=t.closest(`[${tm}]`);if(e)return e;let s=t.getRootNode();t="host"in s&&(0,eU.isElement)(s.host)?s.host:null}return null}(e);return null!==s&&s!==t&&(0,eK.contains)(t,s)}let D=(0,tu.useHoverReferenceInteraction)(j,{enabled:!T,mouseOnly:!0,move:!1,handleClose:A||"both"===E?null:(0,tr.safePolygon)(),restMs:$,delay:()=>null==u&&O?{close:(0,tl.getDelay)(k.current,"close")}:{close:w},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>"ending"===f.select("transitionStatus"),shouldOpen:()=>!M.current}),B=(0,tc.useFocus)(j,{enabled:!T}).reference,F=f.useState("triggerProps",y),H=y||"none"!==E;return(0,ts.useRenderElement)("button",e,{state:{open:v},ref:[t,S,b],props:[D,B,H?F:void 0,{onMouseOver(e){(e=>{let t,s=M.current,n=tf(e),a=(M.current=t=V(n),t&&(P.openChangeTimeout.clear(),P.restTimeout.clear(),P.restTimeoutPending=!1,L.clear()),t),i=b.current,r=i&&n&&(0,eK.contains)(i,n);if(a&&f.select("open")&&f.select("lastOpenChangeReason")===eZ.REASONS.triggerHover)return f.setOpen(!1,(0,eX.createChangeEventDetails)(eZ.REASONS.triggerHover,e));if(s&&!a&&r&&!q.current&&!f.select("open")&&i&&(0,e_.isMouseLikePointerType)(z.current)){let t=()=>{M.current||q.current||f.select("open")||f.setOpen(!0,(0,eX.createChangeEventDetails)(eZ.REASONS.triggerHover,e,i))},s=$();0===s?(L.clear(),t()):L.start(s,t)}})(e.nativeEvent)},onFocus(e){V(tf(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){M.current=!1,L.clear(),z.current=void 0},onPointerEnter(e){z.current=e.pointerType},onPointerDown(e){z.current=e.pointerType,f.set("closeOnClick",c),c&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},onClick(e){c&&!f.select("open")&&f.cancelPendingOpen(e.nativeEvent)},id:x,[th.triggerDisabled]:T?"":void 0,[tm]:T?void 0:""},h],stateAttributesMapping:tt.triggerOpenStateMapping})}),tg=i.createContext(void 0);var tv=e.i(74080),tj=e.i(26674);let tb=i.forwardRef(function(e,s){let{children:n,container:a,className:r,render:l,style:o,...d}=e,{node:c,subtree:u}=(0,tj.useFloatingPortalNode)({container:a,ref:s,componentProps:e,elementProps:d});return u||c?(0,t.jsxs)(i.Fragment,{children:[u,c&&tv.createPortal(n,c)]}):null}),tw=i.forwardRef(function(e,s){let{keepMounted:n=!1,...a}=e;return eB().useState("mounted")||n?(0,t.jsx)(tg.Provider,{value:n,children:(0,t.jsx)(tb,{ref:s,...a})}):null}),tS=i.createContext(void 0);function ty(){let e=i.useContext(tS);if(void 0===e)throw Error((0,eV.default)(71));return e}var tC=e.i(23706),tN=e.i(38396),tk=e.i(89579);let tR=i.forwardRef(function(e,s){let{render:n,className:a,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:f=!1,disableAnchorTracking:x=!1,collisionAvoidance:g=tN.POPUP_COLLISION_AVOIDANCE,style:v,...j}=e,b=eB(),w=function(){let e=i.useContext(tg);if(void 0===e)throw Error((0,eV.default)(70));return e}(),S=b.useState("open"),y=b.useState("mounted"),C=b.useState("trackCursorAxis"),N=b.useState("disableHoverablePopup"),k=b.useState("floatingRootContext"),R=b.useState("instantType"),O=b.useState("transitionStatus"),P=b.useState("adaptiveOrigin"),I=(0,tC.useAnchorPositioning)({anchor:r,positionMethod:l,floatingRootContext:k,mounted:y,side:o,sideOffset:c,align:d,alignOffset:u,collisionBoundary:p,collisionPadding:h,sticky:f,arrowPadding:m,disableAnchorTracking:x,keepMounted:w,collisionAvoidance:g,adaptiveOrigin:P}),T=i.useMemo(()=>({open:S,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:"none"!==C?"tracking-cursor":R}),[S,I.side,I.align,I.anchorHidden,C,R]),q=(0,tk.usePositioner)(e,T,{styles:I.positionerStyles,transitionStatus:O,props:j,refs:[s,b.useStateSetter("positionerElement")],hidden:!y,inert:!S||"both"===C||N});return(0,t.jsx)(tS.Provider,{value:I,children:q})});var tO=e.i(37584),tP=e.i(53984),tI=e.i(31157);let tT=i.forwardRef(function(e,t){let{render:s,className:n,style:a,...i}=e,r=eB(),{side:l,align:o}=ty(),d=r.useState("open"),c=r.useState("instantType"),u=r.useState("transitionStatus"),p=r.useState("popupProps"),h=r.useState("floatingRootContext"),m=r.useState("disabled"),f=r.useState("closeDelay");(0,tO.useOpenChangeComplete)({open:d,ref:r.context.popupRef,onComplete(){d&&r.context.onOpenChangeComplete?.(!0)}}),(0,tI.useHoverFloatingInteraction)(h,{enabled:!m,closeDelay:f});let x=r.useStateSetter("popupElement");return(0,ts.useRenderElement)("div",e,{state:{open:d,side:l,align:o,instant:c,transitionStatus:u},ref:[t,r.context.popupRef,x],props:[eY.FOCUSABLE_POPUP_PROPS,p,(0,tP.getDisabledMountTransitionStyles)(u),i],stateAttributesMapping:tt.popupTransitionStateMapping})}),tq=i.forwardRef(function(e,t){let{render:s,className:n,style:a,...i}=e,r=eB(),{arrowRef:l,side:o,align:d,arrowUncentered:c,arrowStyles:u}=ty(),p=r.useState("open"),h=r.useState("instantType");return(0,ts.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:tt.popupStateMapping})});var tE=e.i(18390);let tA=i.forwardRef(function(e,t){let{render:s,className:n,style:a,children:i,...r}=e,l=eB(),o=ty(),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,ts.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 e2.PopupTriggerMap;return Object.assign(new e0.NullStore(Object.freeze(e6(void 0,e)),Object.freeze(e7(e)),e5),{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,tq,"Handle",0,tL,"Popup",0,tT,"Portal",0,tw,"Positioner",0,tR,"Provider",0,function(e){let{delay:s,closeDelay:n,timeout:a=400}=e,r=i.useMemo(()=>({open:s,close:n}),[s,n]);return(0,t.jsx)(ti.Provider,{value:s,children:(0,t.jsx)(td,{delay:r,timeoutMs:a,children:e.children})})},"Root",0,e8,"Trigger",0,tx,"Viewport",0,tA,"createHandle",0,function(){return new tL}],99643);var tz=e.i(99643),tz=tz;function t$(e){return(0,t.jsx)(tz.Root,{"data-slot":"tooltip",...e})}function tV(e){return(0,t.jsx)(tz.Trigger,{"data-slot":"tooltip-trigger",...e})}function tD({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,u.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 tB={fresh:{Icon:eT,tone:"text-tone-ok-fg"},while:{Icon:eM,tone:"text-muted-foreground"},long:{Icon:eE,tone:"text-tone-waiting-fg"}};function tF({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}=tB[r],d=(0,g.lastSeen)(i,s);return(0,t.jsxs)(t$,{children:[(0,t.jsx)(tV,{render:(0,t.jsx)("span",{role:"img","aria-label":d,"data-testid":n,"data-signal":r,className:(0,u.classNames)("inline-flex [&_svg]:size-(--size-icon) max-sm:[&_svg]:size-4",o)}),children:(0,t.jsx)(l,{"aria-hidden":!0})}),(0,t.jsx)(tD,{children:d})]})}var tH=e.i(63481);function tU({model:e,now:s}){let n=function(e,t){var s;let n=new Date(e.statedAt),a=Math.max(0,t.getTime()-n.getTime()),i=(s=e.id).startsWith("@")||/@\d+\.\d+\.\d+$/.test(s)?"Software":"Model";if(a<6e4)return`${i}, stated ${String(Math.floor(a/1e3))} s ago`;let r=(0,g.relativeTime)(n,t);return`${i}, stated ${r.charAt(0).toLowerCase()}${r.slice(1)}`}(e,s);return(0,t.jsxs)(t$,{children:[(0,t.jsxs)(tV,{render:(0,t.jsx)("span",{"data-testid":"fleet-model-hint",className:"min-w-0 truncate font-mono text-id text-muted-foreground"}),children:[e.id,(0,t.jsxs)("span",{className:"sr-only",children:[", ",n]})]}),(0,t.jsx)(tD,{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",{children:n})]})})]})}var tK=e.i(81830),t_=e.i(1935),tW=e.i(39448),tG=e.i(16327),tX=e.i(68401),tY=e.i(70703),tJ=e.i(6734);let tQ=(0,tY.default)(()=>e.A(67858).then(e=>e.LabelPicker),{loadableGenerated:{modules:[59068]},ssr:!1});function tZ({groups:e,picked:s,onPick:a,trigger:r}){let[l,o]=(0,i.useState)(!1);return(0,t.jsxs)(tJ.Popover,{open:l,onOpenChange:o,children:[(0,t.jsx)(tJ.PopoverTrigger,{render:r}),(0,t.jsxs)(tJ.PopoverContent,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"label-filter-popover",children:[(0,t.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:"Filter by label"}),(0,t.jsx)(tQ,{groups:e,pickedValueIds:s.map(e=>e.valueId),onPick:e=>{a(e),o(!1)}}),(0,t.jsxs)("p",{className:"mt-2 flex items-center justify-between gap-2 border-t border-border px-2 pt-2 text-meta text-muted-foreground",children:["Exact matches, all must hold.",(0,t.jsx)(n.default,{href:"/labels",className:"font-medium text-foreground hover:underline","data-testid":"label-filter-manage",children:"Manage labels"})]})]})]})}function t0({groups:e,picked:n,onPick:a}){return(0,t.jsx)(tZ,{groups:e,picked:n,onPick:a,trigger:(0,t.jsxs)(r.Button,{variant:"secondary",size:"sm",icon:(0,t.jsx)(s.Tag,{}),"data-testid":"fleet-filter-labels",children:["Labels",0===n.length?null:(0,t.jsxs)("span",{className:"inline-flex size-5 items-center justify-center rounded-full bg-primary text-caption font-semibold text-primary-foreground tabular-nums",children:[n.length,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}),(0,t.jsx)(tG.ChevronDown,{"aria-hidden":!0,className:"text-muted-foreground"})]})})}function t1({groups:e,picked:s,onPick:n,onRemove:a,onClear:i}){return 0===s.length?null:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5 text-meta max-sm:hidden","data-testid":"fleet-picked-labels",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Ships with"}),s.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[0===s?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"and"}),(0,t.jsx)(eR.LabelChip,{chip:e,testId:"fleet-picked-label",onRemove:()=>{a(e.valueId)}})]},e.valueId)),(0,t.jsx)(tZ,{groups:e,picked:s,onPick:n,trigger:(0,t.jsx)(r.Button,{variant:"ghost",size:"xs",icon:(0,t.jsx)(b.Plus,{}),children:"Add"})}),(0,t.jsx)("span",{"aria-hidden":!0,className:"h-4 w-px bg-border"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"xs",onClick:i,"data-testid":"fleet-labels-clear",children:"Clear labels"})]})}function t2({groups:e,picked:s,onPick:a,onRemove:l}){let[o,d]=(0,i.useState)(!1);return(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"fleet-filter-labels-touch",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-meta font-medium text-muted-foreground",children:["Labels ",(0,t.jsx)("span",{className:"font-normal",children:"all must hold"})]}),0===s.length?null:(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-meta",children:s.map((e,s)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-2",children:[0===s?null:(0,t.jsx)("span",{className:"text-muted-foreground",children:"and"}),(0,t.jsx)(eR.LabelChip,{chip:e,onRemove:()=>{l(e.valueId)}})]},e.valueId))}),o?(0,t.jsx)("div",{className:"rounded-lg border border-border p-2",children:(0,t.jsx)(tQ,{groups:e,pickedValueIds:s.map(e=>e.valueId),size:"touch",onPick:e=>{a(e),d(!1)}})}):(0,t.jsx)(r.Button,{variant:"secondary",size:"touch",icon:(0,t.jsx)(b.Plus,{}),className:"self-start",onClick:()=>{d(!0)},children:"Add label"}),(0,t.jsxs)(n.default,{href:"/labels",className:"inline-flex items-center gap-1.5 self-start text-meta text-muted-foreground hover:underline [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(tX.Tags,{"aria-hidden":!0}),"All labels and their owners"]})]})}function t5(e,t){return{...e,filters:{...e.filters,labelValueIds:t}}}let t4={all:"All",crewed:"Crewed",awaitingCrew:"Awaiting crew"};function t6(e){return Object.hasOwn(t4,e)}let t7={all:"All",...es};function t8(e){return"all"===e||et.some(t=>t===e)}function t3(e){return{all:"All",...Object.fromEntries((0,eo.crewRequestKeysOf)(e).map(e=>[e,(0,eo.crewRequestKeyWord)(e)]))}}function t9(e,t){return Object.hasOwn(t,e)}function se({ship:e,squadron:s,isPluginShip:n}){return"operator"===e.kind?(0,t.jsxs)(ev.Badge,{variant:"kind",children:[(0,t.jsx)(ee.UserRound,{"aria-hidden":!0}),"operator"]}):"viewer"===e.kind?(0,t.jsxs)(ev.Badge,{variant:"kind","data-testid":"fleet-viewer",children:[(0,t.jsx)(G.Eye,{"aria-hidden":!0}),"viewer"]}):n?(0,t.jsxs)(ev.Badge,{variant:"kind","data-testid":"fleet-plugin",children:[(0,t.jsx)(Y.Plug,{"aria-hidden":!0}),"plugin"]}):s?.role===null?(0,t.jsxs)(ev.Badge,{variant:"kind","data-testid":"fleet-flagship",children:[(0,t.jsx)(X.Flag,{"aria-hidden":!0}),"flagship"]}):null}function st({ship:e,now:s}){return"crewed"!==e.status||"viewer"===e.kind?null:(0,t.jsxs)("span",{"data-testid":"fleet-runs-on",className:"flex min-w-0 items-center gap-3 max-sm:flex-wrap max-sm:gap-y-1",children:[(0,t.jsx)(tH.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",className:"shrink-0"}),"agent"===e.kind&&null!==e.model?(0,t.jsx)(tU,{model:e.model,now:s}):null]})}function ss({ship:e,squadron:s,labels:n}){let a=s?.role===null?void 0:s,i=void 0===n?[]:(0,el.chipsOf)(e,n).filter(e=>void 0===a||("squadron"!==e.key||e.value!==a.squadronId)&&("squadron-role"!==e.key||e.value!==a.role));return void 0===a&&0===i.length?null:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[void 0===a?null:(0,t.jsx)("span",{className:"min-w-0 shrink",title:null===a.role?a.squadronId:`${a.squadronId} \xb7 ${a.role}`,children:(0,t.jsx)(t_.SquadronTag,{squadronId:a.squadronId,size:"sm"})}),(0,t.jsx)(eO,{chips:i,width:22*(void 0===a),testId:"fleet-labels",href:`/ships/${e.id}`})]})}function sn({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 [&:has(button)>[data-testid=fleet-report]]:hidden",children:[a?(0,t.jsx)(tK.ReportLine,{report:e.report,now:s,variant:"row",isTimeInTitle:!0,testId:"fleet-report"}):null,n]})}function sa({ships:e,view:s,onViewChange:n,size:a,squadronsOf:i,labels:l}){let o=t3((0,S.useConsoleConstants)().crewStatuses),{filters:d}=s,c={all:"All",...Object.fromEntries(ep(e,d.isRetiredShown).map(e=>[e,e]))},p=eh(e),h="sm"===a?"fleet-show-retired":"fleet-show-retired-touch",m=e=>{n({...s,filters:{...d,...e}})},f="touch"===a;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ew.Select,{items:t4,value:d.status,onValueChange:e=>{null!==e&&t6(e)&&m({status:e})},children:[(0,t.jsx)(ew.SelectTrigger,{size:a,"aria-label":"Status","data-testid":f?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)(ew.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(ew.SelectContent,{children:Object.entries(t4).map(([e,s])=>(0,t.jsx)(ew.SelectItem,{value:e,children:s},e))})]}),(0,t.jsxs)(ew.Select,{items:o,value:d.crewRequest,onValueChange:e=>{null!==e&&t9(e,o)&&m({crewRequest:e})},children:[(0,t.jsx)(ew.SelectTrigger,{size:a,"aria-label":"Crew request","data-testid":f?void 0:"fleet-filter-crew-request",children:(0,t.jsxs)("span",{className:"flex gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Crew request"}),(0,t.jsx)(ew.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(ew.SelectContent,{children:Object.entries(o).map(([e,s])=>(0,t.jsx)(ew.SelectItem,{value:e,children:s},e))})]}),(0,t.jsxs)(ew.Select,{items:t7,value:d.kind,onValueChange:e=>{null!==e&&t8(e)&&m({kind:e})},children:[(0,t.jsx)(ew.SelectTrigger,{size:a,"aria-label":"Kind","data-testid":f?void 0:"fleet-filter-kind",children:(0,t.jsxs)("span",{className:"flex gap-1.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Kind"}),(0,t.jsx)(ew.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(ew.SelectContent,{children:Object.entries(t7).map(([e,s])=>(0,t.jsx)(ew.SelectItem,{value:e,children:s},e))})]}),(0,t.jsxs)(ew.Select,{items:c,value:d.type,onValueChange:e=>{null!==e&&m({type:e})},children:[(0,t.jsx)(ew.SelectTrigger,{size:a,"aria-label":"Type","data-testid":f?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)(ew.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(ew.SelectContent,{children:Object.entries(c).map(([e,s])=>(0,t.jsx)(ew.SelectItem,{value:e,className:"all"===e?void 0:"font-mono",children:s},e))})]}),i&&(0,t.jsxs)(ew.Select,{items:{all:"All",...Object.fromEntries(em(i).map(e=>[e,e]))},value:d.squadron,onValueChange:e=>{null!==e&&m({squadron:e})},children:[(0,t.jsx)(ew.SelectTrigger,{size:a,"aria-label":"Squadron","data-testid":f?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)(ew.SelectValue,{className:"font-medium"})]})}),(0,t.jsxs)(ew.SelectContent,{children:[(0,t.jsx)(ew.SelectItem,{value:"all",children:"All"}),em(i).map(e=>(0,t.jsx)(ew.SelectItem,{value:e,children:e},e))]})]}),void 0===l||f?null:(0,t.jsx)(t0,{groups:(0,el.filterGroupsOf)(l),picked:(0,el.pickedChips)(d.labelValueIds,l),onPick:e=>{n(t5(s,[...d.labelValueIds,e]))}}),eg(d).length>0&&!f?(0,t.jsx)(r.Button,{variant:"ghost",size:"xs","data-testid":"fleet-filters-clear",onClick:()=>{n({...s,filters:ed.filters})},children:"Clear filters"}):null,(0,t.jsxs)("div",{className:(0,u.classNames)("inline-flex items-center gap-2",f?"py-2":"sm:ml-auto"),children:[(0,t.jsx)(ey.Switch,{id:h,"data-testid":f?void 0:"fleet-show-retired",checked:d.isRetiredShown,onCheckedChange:e=>{m({isRetiredShown:e})}}),(0,t.jsxs)(eb.Label,{htmlFor:h,className:(0,u.classNames)("font-normal text-muted-foreground",f?"text-body-touch":"text-meta"),children:["Show retired (",p,")"]})]})]})}function si({label:e,isOn:s,kind:n,onPick:a}){return(0,t.jsx)(r.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 sr({ships:e,view:s,onViewChange:n,shownCount:a,squadronsOf:i,labels:l}){let o=t3((0,S.useConsoleConstants)().crewStatuses),{filters:d}=s,c=e=>{n({...s,filters:{...d,...e}})},u=ex(d),p=eh(e);return(0,t.jsxs)(eS.Sheet,{children:[(0,t.jsx)(eS.SheetTrigger,{render:(0,t.jsx)(r.Button,{size:"touch",isIconOnly:!0,"aria-label":u>0?`Filter ships, ${String(u)} active`:"Filter ships","data-testid":"fleet-filters-open",icon:(0,t.jsx)(Z,{}),className:"relative sm:hidden",children:u>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)(eS.SheetContent,{side:"bottom",children:[(0,t.jsxs)(eS.SheetHeader,{className:"flex-row items-center justify-between",children:[(0,t.jsx)(eS.SheetTitle,{children:"Filter ships"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch","data-testid":"fleet-filters-reset",onClick:()=>{n({...s,filters:ed.filters})},children:"Reset"})]}),(0,t.jsxs)(eS.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(t4).map(([e,s])=>(0,t.jsx)(si,{label:s,kind:"radio",isOn:d.status===e,onPick:()=>{t6(e)&&c({status:e})}},e))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{id:"fleet-filter-crew-request-label",className:"text-meta font-medium text-muted-foreground",children:"Crew request"}),(0,t.jsx)("div",{role:"radiogroup","aria-labelledby":"fleet-filter-crew-request-label",className:"flex flex-wrap gap-1.5",children:Object.entries(o).map(([e,s])=>(0,t.jsx)(si,{label:s,kind:"radio",isOn:d.crewRequest===e,onPick:()=>{t9(e,o)&&c({crewRequest:e})}},e))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{id:"fleet-filter-kind-label",className:"text-meta font-medium text-muted-foreground",children:"Kind"}),(0,t.jsx)("div",{role:"radiogroup","aria-labelledby":"fleet-filter-kind-label","data-testid":"fleet-filter-kind-touch",className:"flex flex-wrap gap-1.5",children:Object.entries(t7).map(([e,s])=>(0,t.jsx)(si,{label:s,kind:"radio",isOn:d.kind===e,onPick:()=>{t8(e)&&c({kind: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",...ep(e,d.isRetiredShown)].map(e=>(0,t.jsx)(si,{label:"all"===e?"All types":e,kind:"toggle",isOn:d.type===e,onPick:()=>{c({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",...em(i)].map(e=>(0,t.jsx)(si,{label:"all"===e?"All":e,kind:"radio",isOn:d.squadron===e,onPick:()=>{c({squadron:e})}},e))})]}),void 0===l?null:(0,t.jsx)(t2,{groups:(0,el.filterGroupsOf)(l),picked:(0,el.pickedChips)(d.labelValueIds,l),onPick:e=>{n(t5(s,[...d.labelValueIds,e]))},onRemove:e=>{n(t5(s,d.labelValueIds.filter(t=>t!==e)))}}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 py-1",children:[(0,t.jsxs)(eb.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:["(",p,")"]})]}),(0,t.jsx)(ey.Switch,{id:"fleet-show-retired-touch",checked:d.isRetiredShown,onCheckedChange:e=>{c({isRetiredShown:e})}})]}),(0,t.jsx)(eS.SheetClose,{render:(0,t.jsx)(r.Button,{size:"touch","data-testid":"fleet-filters-apply"}),children:1===a?"Show 1 ship":`Show ${String(a)} ships`})]})]})]})}function sl({view:e,onViewChange:s,labels:n}){let a=eg(e.filters),i=void 0===n?[]:(0,el.pickedChips)(e.filters.labelValueIds,n);return 0===a.length&&0===i.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:[a.map(e=>(0,t.jsx)(ev.Badge,{variant:"outline",className:"max-w-full truncate",children:e},e)),i.map(n=>(0,t.jsx)(eR.LabelChip,{chip:n,onRemove:()=>{s(t5(e,e.filters.labelValueIds.filter(e=>e!==n.valueId)))}},n.valueId)),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",onClick:()=>{s({...e,filters:ed.filters})},children:"Clear filters"})]})}function so({ships:e,view:s,onViewChange:n,shownCount:a,squadronsOf:i,labels:r}){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)(ej.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)(J.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)(sa,{ships:e,view:s,onViewChange:n,squadronsOf:i,labels:r,size:"sm"})}),(0,t.jsx)(sr,{ships:e,view:s,onViewChange:n,shownCount:a,squadronsOf:i,labels:r}),(0,t.jsx)(sl,{view:s,onViewChange:n,labels:r}),(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 sd({ship:e}){return(0,t.jsx)(tW.ShipName,{name:e.name,shipId:e.id,isSuffixShown:"retired"===e.status,href:"operator"===e.kind?"/inbox":`/ships/${e.id}`,className:"[&_a]:max-sm:whitespace-normal [&_a]:max-sm:break-all [&_a]:max-sm:text-body-touch"})}let sc=[{column:"ship",head:"Ship"},{column:"status",head:"Status"},{column:"report",head:"Report"},{column:"squadronAndLabels",head:"Squadron and labels"},{column:"runsOn",head:"Runs on"},{column:"seen",head:"Seen"}];function su({ships:e,highlightedShipIds:s,now:n,renderRowActions:a,squadronsOf:i,labels:r,pluginShipIds:l,sort:o,onSort:d}){return(0,t.jsx)("div",{className:"max-sm:hidden",children:(0,t.jsxs)(eC.Table,{"aria-label":"Ships",className:"min-w-320 table-fixed",children:[(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{className:"w-56"}),(0,t.jsx)("col",{className:"w-40"}),(0,t.jsx)("col",{className:"w-64"}),(0,t.jsx)("col",{className:"w-56"}),(0,t.jsx)("col",{className:"w-80"}),(0,t.jsx)("col",{className:"w-12"}),(0,t.jsx)("col",{className:"w-12"})]}),(0,t.jsx)(eC.TableHeader,{children:(0,t.jsxs)(eC.TableRow,{children:[sc.map(({column:e,head:s})=>void 0===d?(0,t.jsx)(eC.TableHead,{children:s},e):(0,t.jsx)(eC.TableSortHead,{"data-testid":`fleet-sort-${e}`,direction:o?.column===e?o.direction:null,onSort:()=>{d(e)},children:s},e)),(0,t.jsx)(eC.TableHead,{children:(0,t.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,t.jsx)(eC.TableBody,{children:e.map(e=>(0,t.jsxs)(eC.TableRow,{"data-testid":`fleet-row-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"h-12",children:[(0,t.jsx)(eC.TableCell,{children:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 whitespace-nowrap",children:[(0,t.jsx)(sd,{ship:e}),(0,t.jsx)(se,{ship:e,squadron:i?.get(e.id),isPluginShip:l?.has(e.id)??!1})]})}),(0,t.jsx)(eC.TableCell,{children:(0,t.jsx)(D.StatusBadge,{status:e.status})}),(0,t.jsx)(eC.TableCell,{children:(0,t.jsx)(sn,{ship:e,now:n,next:a?.(e,"next")})}),(0,t.jsx)(eC.TableCell,{children:(0,t.jsx)(ss,{ship:e,squadron:i?.get(e.id),labels:r})}),(0,t.jsx)(eC.TableCell,{children:(0,t.jsx)(st,{ship:e,now:n})}),(0,t.jsx)(eC.TableCell,{children:(0,t.jsx)(tF,{seenAt:e.lastSeenAt,now:n,testId:"fleet-last-seen"})}),(0,t.jsx)(eC.TableCell,{className:"w-10 text-right",children:a?.(e,"table")})]},e.id))})]})})}function sp({ships:e,highlightedShipIds:s,now:n,renderRowActions:a,squadronsOf:i,pluginShipIds:r}){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.jsx)("div",{className:"text-body-touch",children:(0,t.jsx)(sd,{ship:e})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(D.StatusBadge,{status:e.status}),(0,t.jsx)(se,{ship:e,squadron:i?.get(e.id),isPluginShip:r?.has(e.id)??!1})]}),(0,t.jsx)(ss,{ship:e,squadron:i?.get(e.id)}),(0,t.jsx)(sn,{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)(st,{ship:e,now:n}),(0,t.jsx)(tF,{seenAt:e.lastSeenAt,now:n})]})]}),a?.(e,"phone")]},e.id))})}function sh({ships:e,view:s,onViewChange:n,state:a,error:i,highlightedShipIds:l,now:o,renderRowActions:d,emptyAction:c,squadronsOf:u,labels:p,pluginShipIds:h}){var m,f,x;let g,v,j;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)(eP.LoadingSkeleton,{variant:"table",rows:6,label:"Loading the fleet",className:"max-sm:hidden"}),(0,t.jsx)(eP.LoadingSkeleton,{variant:"list",rows:5,label:"Loading the fleet",className:"sm:hidden"})]});if("error"===a)return(0,t.jsx)(ek.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 b={highlightedShipIds:l,now:o,renderRowActions:d,squadronsOf:u,pluginShipIds:h};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)(su,{ships:s,labels:p,...b}),(0,t.jsx)(sp,{ships:s,...b}),(0,t.jsx)(eN.EmptyState,{icon:(0,t.jsx)(V.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:c})]})}let w=(v=null===(m={...s,squadronsOf:u,pluginShipIds:h}).sort?eu:(f=m.sort,x=m.squadronsOf,g=("ascending"===f.direction?1:-1)*("seen"===f.column?-1:1),(e,t)=>{let s=ei(e,{column:f.column,squadronsOf:x}),n=ei(t,{column:f.column,squadronsOf:x});return void 0===s||void 0===n?Number(void 0===s)-Number(void 0===n):g*s.localeCompare(n,void 0,{sensitivity:"base"})}),e.filter(e=>{let t;return(""===(t=m.query.trim().toLowerCase())||e.name.toLowerCase().includes(t)||e.type.toLowerCase().includes(t))&&function(e,t){let{filters:s,squadronsOf:n,pluginShipIds:a=ec}=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.crewRequest||(0,eo.crewRequestKey)((0,er.crewRequestStage)(e))===s.crewRequest)&&("all"===s.kind||("operator"===e.kind||"viewer"===e.kind?"console":a.has(e.id)?"plugin":"trierarch"===e.type?"trierarch":(null===e.harness?void 0:en[e.harness])??"other")===s.kind)&&!!(0,el.carriesEvery)(e,s.labelValueIds)&&("all"===s.type||e.type===s.type)}(e,m)}).toSorted((e,t)=>v(e,t)||e.name.localeCompare(t.name)||e.id.localeCompare(t.id))),S=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)(so,{ships:e,view:s,onViewChange:n,shownCount:w.length,squadronsOf:u,labels:p}),void 0===p?null:(0,t.jsx)(t1,{groups:(0,el.filterGroupsOf)(p),picked:(0,el.pickedChips)(s.filters.labelValueIds,p),onPick:e=>{n(t5(s,[...s.filters.labelValueIds,e]))},onRemove:e=>{n(t5(s,s.filters.labelValueIds.filter(t=>t!==e)))},onClear:()=>{n(t5(s,[]))}}),0===w.length?(0,t.jsx)(eN.EmptyState,{variant:"no-results",title:""===S?"No ships match these filters.":`No ships match “${S}”.`,action:(0,t.jsx)(r.Button,{size:"xs","data-testid":"fleet-clear-filters",onClick:()=>{n({...ed,sort:s.sort})},children:(j=ex(s.filters)>0,""===S?"Clear filters":j?"Clear search and filters":"Clear search")})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(su,{ships:w,labels:p,sort:s.sort,onSort:e=>{var t;n({...s,sort:(t=s.sort,t?.column!==e?{column:e,direction:"ascending"}:"ascending"===t.direction?{column:e,direction:"descending"}:null)})},...b}),(0,t.jsx)(sp,{ships:w,...b})]})]})}function sm({view:e,onViewChange:s,newShipIds:n,renderRowActions:a}){let i=(0,m.useFleetSnapshot)(),r=(0,x.useNow)(),l=(0,I.useSquadrons)(),o=(0,m.useLabelContext)(),d=(0,_.usePluginShipIds)();return(0,t.jsx)("section",{"aria-label":"Fleet",className:"flex flex-col gap-3",children:(0,t.jsx)(sh,{ships:i.data??[],view:e,onViewChange:s,state:i.isPending?"loading":i.isError?"error":"ready",error:{detail:i.error?.message,onRetry:()=>{i.refetch()}},highlightedShipIds:n,now:r,renderRowActions:a,squadronsOf:l.data?(0,W.shipsInSquadrons)(l.data):void 0,labels:o,pluginShipIds:d})})}var sf=e.i(21959),sx=e.i(15327),sg=e.i(77435),sv=e.i(77821),sj=e.i(87964),sb=e.i(62687),sw=e.i(90262),sS=e.i(18423),sy=e.i(78485),sC=e.i(3979);e.s(["OverviewPage",0,function({view:e,isCommissionAsked:o}){let d=(0,a.useRouter)(),c=(0,m.useFleetSnapshot)(),u=(0,sS.useLiveFleet)(),p=(0,sj.useConsoleFrame)(),h=(0,O.messageLimitReached)((0,k.useFleetLimits)().data),f=(0,R.useHostedAccountUrl)(),x=(0,sw.useAccess)(),g=(0,sC.usePluginNav)(),[b,w]=(0,i.useState)(!1);(0,sy.useSignInWhenSessionEnds)([c.error,u.error]);let S=e=>{let t=(function(e){let t=new URLSearchParams;for(let s of(""!==e.query&&t.set("q",e.query),"all"!==e.filters.status&&t.set("status",e.filters.status),"all"!==e.filters.crewRequest&&t.set("crew",e.filters.crewRequest),"all"!==e.filters.kind&&t.set("kind",e.filters.kind),"all"!==e.filters.type&&t.set("type",e.filters.type),"all"!==e.filters.squadron&&t.set("squadron",e.filters.squadron),e.filters.isRetiredShown&&t.set("retired","1"),e.filters.labelValueIds))t.append("label",s);return null!==e.sort&&(t.set("sort",e.sort.column),"descending"===e.sort.direction&&t.set("order","desc")),t})(e).toString();d.replace(""===t?"/":`/?${t}`,{scroll:!1})};return(0,t.jsxs)(sv.ListPage,{...p,title:"Fleet overview",description:c.data?function(e){let t=v(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:c.data,canCommission:x.canManage}):"Loading your fleet",primaryAction:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[(0,t.jsx)(r.Button,{render:(0,t.jsx)(n.default,{href:"/labels"}),nativeButton:!1,icon:(0,t.jsx)(s.Tag,{}),"data-testid":"overview-labels",children:x.canDefineLabels?"Manage labels":"View labels"}),x.canManage?(0,t.jsx)(A,{isOpen:b||o,onOpenChange:t=>{w(t),!t&&o&&S(e)}}):null]}),live:u.live,children:[(0,t.jsx)(sb.FleetSegments,{active:"ships",needsCrewCount:g.needsCrewCount}),void 0===h?null:(0,t.jsx)(sg.LimitNotice,{...(0,O.messageLimitNotice)(h),accountUrl:f,testId:"overview-message-limit"}),(0,t.jsx)(K,{}),(0,t.jsx)(j,{}),(0,t.jsx)(sm,{view:e,onViewChange:S,newShipIds:u.newShipIds,renderRowActions:(e,s)=>(0,t.jsx)(sf.ShipActions,{ship:e,layout:"table"===s?"menu":"phone"===s?"sheet":"next",compose:l.ComposeMessage,crewLineFlow:sx.NewCrewLineFlow})})]})}],42047)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24071,e=>{"use strict";var t=e.i(56420);let s={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};s.node;let a=(0,t.default)(s);e.s(["ChevronLeft",0,a],24071)},67927,e=>{"use strict";var t=e.i(56420);let s={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};s.node;let a=(0,t.default)(s);e.s(["ChevronRight",0,a],67927)},66595,e=>{"use strict";var t=e.i(56420);let s={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};s.node;let a=(0,t.default)(s);e.s(["Search",0,a],66595)},19759,e=>{"use strict";var t=e.i(56420);let s={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};s.node;let a=(0,t.default)(s);e.s(["SquarePen",0,a],19759)},31034,e=>{"use strict";var t=e.i(43476),s=e.i(18566),a=e.i(71645),n=e.i(41880),i=e.i(67927),l=e.i(85595),r=e.i(25398),d=e.i(90063),o=e.i(28459),c=e.i(69693),m=e.i(49635),u=e.i(46150),x=e.i(15905),h=e.i(14732),f=e.i(67874),p=e.i(17981),g=e.i(88393),b=e.i(39448),v=e.i(78865);function j({party:e}){let s=e.name===u.OPERATOR_NAME;return(0,t.jsx)(b.ShipName,{name:e.name,shipId:e.id,size:"meta",isOperator:s,isSuffixShown:!s})}function y({delivery:e}){let{sender:s,recipient:a}=e.message;return(0,t.jsxs)("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(j,{party:s}),(0,t.jsx)("span",{"aria-hidden":!0,children:"→"}),(0,t.jsx)("span",{className:"sr-only",children:"to"}),"ship"===a.kind?(0,t.jsx)(j,{party:a.ship}):(0,t.jsxs)("span",{children:["any ship of type ",a.type]})]})}function N({delivery:e}){let{payload:s,contentType:a}=e.message;return(0,t.jsx)("span",{className:(0,d.classNames)("block min-w-0 truncate text-foreground",(0,c.isJson)(a)?"font-mono text-id":"text-body max-sm:text-body-touch"),title:s,children:s.split("\n")[0]})}function w(e){return(0,o.attentionReason)(e)}function k(e){var t;return`the message from ${e.message.sender.name} to ${"ship"===(t=e.message.recipient).kind?t.ship.name:`any ship of type ${t.type}`}`}function S({delivery:e,onResend:s,onDismiss:a,pendingIds:n,layout:i}){let l=n.has(e.deliveryId),d="phone"===i;if(void 0===s&&void 0===a)return null;let c=void 0!==s&&(0,o.canResend)(e)?(0,t.jsx)(x.Button,{size:d?"touch":"sm",variant:d?"primary":"secondary",icon:(0,t.jsx)(r.RotateCw,{"aria-hidden":!0}),isLoading:l,"data-testid":"attention-resend","aria-label":`Resend ${k(e)}`,onClick:()=>{s(e.deliveryId)},className:d?"flex-1":void 0,children:"Resend"}):null,m=void 0===a?null:(0,t.jsx)(x.Button,{size:d?"touch":"sm",variant:d?"secondary":"ghost",disabled:l,"data-testid":"attention-dismiss","aria-label":`Dismiss ${k(e)}`,onClick:()=>{a(e.deliveryId)},className:d?"flex-1":void 0,children:"Dismiss"});return d?(0,t.jsxs)("div",{className:"flex gap-2 pt-1",children:[m,c]}):(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[c,m]})}function T({deliveries:e,onOpen:s,now:a,...n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2 max-sm:hidden",children:[(0,t.jsxs)(h.Table,{"aria-label":"Undeliverable deliveries",children:[(0,t.jsx)(h.TableHeader,{children:(0,t.jsxs)(h.TableRow,{children:[(0,t.jsx)(h.TableHead,{children:"State"}),(0,t.jsx)(h.TableHead,{children:"Message"}),(0,t.jsx)(h.TableHead,{children:"Reason"}),(0,t.jsx)(h.TableHead,{children:"Since"}),(0,t.jsx)(h.TableHead,{children:"Actions"})]})}),(0,t.jsx)(h.TableBody,{children:e.map(e=>{let i=new Date(e.since);return(0,t.jsxs)(h.TableRow,{"data-testid":"attention-row","data-delivery-id":e.deliveryId,children:[(0,t.jsx)(h.TableCell,{className:"align-top",children:(0,t.jsx)(v.StatusBadge,{status:e.state})}),(0,t.jsx)(h.TableCell,{className:"max-w-96 align-top",children:(0,t.jsxs)("button",{type:"button","aria-label":`Open ${k(e)}`,onClick:()=>{s(e)},className:"flex w-full min-w-0 flex-col gap-0.5 rounded-xs text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(N,{delivery:e}),(0,t.jsx)(y,{delivery:e})]})}),(0,t.jsx)(h.TableCell,{className:"max-w-48 align-top text-meta whitespace-normal text-muted-foreground",children:w(e)}),(0,t.jsx)(h.TableCell,{className:"align-top",children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5 tabular-nums",children:[(0,t.jsx)("time",{dateTime:e.since,title:(0,m.fullDateTime)(i),className:"text-body text-foreground",children:(0,m.shortDateTime)(i)}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:[(0,m.duration)(i,a)," ago"]})]})}),(0,t.jsx)(h.TableCell,{className:"align-top",children:(0,t.jsx)(S,{delivery:e,layout:"table",...n})})]},e.deliveryId)})})]}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Resend creates a new message with the same payload, linked to the original. Dismiss marks the delivery resolved. Abandoned deliveries are not listed here."})]})}function C({deliveries:e,onOpen:s,now:a,...n}){return(0,t.jsx)("ul",{"aria-label":"Undeliverable deliveries",className:"flex flex-col gap-3 sm:hidden",children:e.map(e=>{let l=new Date(e.since),r=a.getTime()-l.getTime()<864e5?(0,m.clockTime)(l):(0,m.shortDateTime)(l);return(0,t.jsxs)("li",{"data-testid":"attention-row","data-delivery-id":e.deliveryId,className:"flex flex-col gap-1.5 rounded-lg border border-border bg-card px-3.5 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(v.StatusBadge,{status:e.state}),(0,t.jsxs)("button",{type:"button","aria-label":`Open ${k(e)}`,onClick:()=>{s(e)},className:"inline-flex items-center gap-1 rounded-xs text-meta text-muted-foreground tabular-nums focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",children:[(0,m.duration)(l,a),(0,t.jsx)(i.ChevronRight,{"aria-hidden":!0})]})]}),(0,t.jsx)(N,{delivery:e}),(0,t.jsx)(y,{delivery:e}),(0,t.jsxs)("p",{className:"text-meta text-muted-foreground",children:[w(e)," Since"," ",(0,t.jsx)("time",{dateTime:e.since,title:(0,m.fullDateTime)(l),className:"tabular-nums",children:r}),"."]}),(0,t.jsx)(S,{delivery:e,layout:"phone",...n})]},e.deliveryId)})})}function z({deliveries:e,state:s,onRetry:a,...n}){return"loading"===s?(0,t.jsxs)("div",{"data-slot":"needs-attention-list","data-state":"loading",children:[(0,t.jsx)(g.LoadingSkeleton,{variant:"table",rows:2,label:"Loading Needs attention",className:"max-sm:hidden"}),(0,t.jsx)(g.LoadingSkeleton,{variant:"list",rows:2,label:"Loading Needs attention",className:"sm:hidden"})]}):"error"===s?(0,t.jsx)("div",{"data-slot":"needs-attention-list","data-state":"error","data-testid":"attention-error",children:(0,t.jsx)(p.InlineError,{variant:"page",title:"Couldn’t load Needs attention",description:"This page couldn’t reach the fleet server. Undeliverable deliveries are kept on the server, so nothing is lost.",onRetry:a})}):0===e.length?(0,t.jsx)("div",{"data-slot":"needs-attention-list","data-state":"empty","data-testid":"attention-empty",children:(0,t.jsx)(f.EmptyState,{icon:(0,t.jsx)(l.CircleCheck,{className:"text-tone-ok-fg"}),title:"Nothing needs your attention",description:"Undeliverable deliveries show up here as soon as they happen."})}):(0,t.jsxs)("div",{"data-slot":"needs-attention-list","data-state":"ready",className:"flex flex-col gap-3",children:[(0,t.jsx)(T,{deliveries:e,...n}),(0,t.jsx)(C,{deliveries:e,...n})]})}var I=e.i(66390);function R({deliveries:e,onOpen:s,now:a}){return(0,t.jsx)("ul",{"data-testid":"no-ship-can-take","aria-label":"Deliveries no ship can take",className:"divide-y divide-border overflow-hidden rounded-lg border border-border",children:e.map(e=>{let{sender:n,payload:l,contentType:r}=e.message,o=new Date(e.message.sentAt),x=n.name===u.OPERATOR_NAME;return(0,t.jsxs)("li",{"data-testid":"no-ship-can-take-row","data-delivery-id":e.deliveryId,className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 px-3 py-2.5",children:[(0,t.jsx)(I.Badge,{variant:"type",children:e.type}),(0,t.jsxs)("span",{className:"flex min-w-0 grow basis-48 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,d.classNames)("block min-w-0 truncate text-foreground",(0,c.isJson)(r)?"font-mono text-id":"text-body max-sm:text-body-touch"),title:l,children:l.split("\n")[0]}),(0,t.jsxs)("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-meta text-muted-foreground",children:["from ",(0,t.jsx)(b.ShipName,{name:n.name,shipId:n.id,size:"meta",isOperator:x,isSuffixShown:!x})]})]}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground tabular-nums",children:["waiting"," ",(0,t.jsx)("time",{dateTime:e.message.sentAt,title:(0,m.fullDateTime)(o),children:(0,m.duration)(o,a)})]}),(0,t.jsxs)("button",{type:"button","data-testid":"no-ship-can-take-open","aria-label":`Open the message from ${n.name} to any ship of type ${e.type}`,onClick:()=>{s(e)},className:"inline-flex items-center gap-1 rounded-xs text-meta font-medium hover:underline focus-visible:outline-2 focus-visible:outline-ring",children:["Open",(0,t.jsx)(i.ChevronRight,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})]})]},e.deliveryId)})})}var O=e.i(49655);function L({deliveries:e,onOpen:s,now:a}){return(0,t.jsx)("ul",{"data-testid":"overdue-deliveries","aria-label":"Overdue deliveries",className:"divide-y divide-border overflow-hidden rounded-lg border border-border",children:e.map(e=>{let{payload:n,contentType:l}=e.message,r=new Date(e.toldAt);return(0,t.jsxs)("li",{"data-testid":"overdue-row","data-delivery-id":e.deliveryId,className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 px-3 py-2.5",children:[(0,t.jsx)(v.StatusBadge,{status:"overdue"}),(0,t.jsxs)("span",{className:"flex min-w-0 grow basis-48 flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-body text-foreground max-sm:text-body-touch",children:[(0,t.jsx)(b.ShipName,{name:e.ship.name,shipId:e.ship.id,size:"meta"}),(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:(0,o.overdueReason)(e)})]}),(0,t.jsx)("span",{className:(0,d.classNames)("block min-w-0 truncate text-muted-foreground",(0,c.isJson)(l)?"font-mono text-id":"text-meta"),title:n,children:n.split("\n")[0]})]}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta text-tone-attention-fg tabular-nums",children:[(0,t.jsx)(O.AlarmClock,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),(0,t.jsxs)("span",{children:["argo told at ",String(e.minutes)," min ·"," ",(0,t.jsx)("time",{dateTime:e.toldAt,title:(0,m.fullDateTime)(r),children:(0,m.relativeTime)(r,a).toLowerCase()})]})]}),(0,t.jsxs)("button",{type:"button","data-testid":"overdue-open","aria-label":`Open the message overdue on ${e.ship.name}`,onClick:()=>{s(e)},className:"inline-flex items-center gap-1 rounded-xs text-meta font-medium hover:underline focus-visible:outline-2 focus-visible:outline-ring",children:["Open",(0,t.jsx)(i.ChevronRight,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})]})]},e.deliveryId)})})}var q=e.i(15327),D=e.i(22016),A=e.i(84294),K=e.i(19249),B=e.i(81830),E=e.i(1935);function H({members:e,ships:s,now:a,renderAction:n}){return(0,t.jsx)("ul",{"data-testid":"silent-members",className:"divide-y divide-border overflow-hidden rounded-lg border border-border",children:e.map(({squadronId:e,member:l})=>{let{lastSeenAt:r}=l.crew;return(0,t.jsxs)("li",{"data-testid":"silent-member",className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 px-3 py-2.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(K.HealthIndicator,{health:"silent"}),(0,t.jsx)("span",{className:"font-medium",children:l.name})]}),(0,t.jsx)(E.SquadronTag,{squadronId:e,role:l.role,size:"sm"})]}),(0,t.jsxs)("span",{className:"flex flex-col text-meta",children:[(0,t.jsx)("span",{children:null===r?"never seen":`not seen for ${(0,m.duration)(new Date(r),a)}`}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["checks in ",(0,A.checkInText)(l.checkInMinutes)]})]}),(0,t.jsx)("span",{className:"grow",children:(0,t.jsx)(B.ReportLine,{report:s.get(l.shipId)?.report??null,now:a,variant:"row",testId:"silent-member-report"})}),n?.({squadronId:e,member:l}),(0,t.jsxs)(D.default,{href:`/squadrons/${e}`,className:"inline-flex items-center gap-1 text-meta font-medium hover:underline",children:["Open",(0,t.jsx)(i.ChevronRight,{"aria-hidden":!0,className:"size-(--size-icon-sm)"})]})]},l.shipId)})})}var M=e.i(77821),P=e.i(87964),$=e.i(90262),U=e.i(18423),_=e.i(96676),F=e.i(78485),J=e.i(5387),W=e.i(53573),Q=e.i(48695);function V(e){return e instanceof Error?e.message:"Try again in a moment."}e.s(["default",0,function(){let e=(0,s.useRouter)(),i=(0,_.useNow)(),l=(0,o.useNeedsAttention)(),r=(0,o.useNoShipCanTake)().data??[],d=(0,o.useOverdue)().data??[],c=(0,o.useResendDelivery)(),m=(0,o.useDismissDelivery)(),u=(0,U.useLiveFleet)(),x=(0,P.useConsoleFrame)(),h=(0,Q.useSquadrons)(),f=(0,A.silentMembers)(h.data??[]),p=(0,W.useShips)(f.map(({member:e})=>e.shipId)),g=new Map(((0,J.useFleetSnapshot)().data??[]).map(e=>[e.id,e])),b=(0,$.useAccess)();(0,F.useSignInWhenSessionEnds)([l.error,u.error]);let[v,j]=(0,a.useState)(new Set),y=(e,t)=>{j(t=>new Set([...t,e])),t().finally(()=>{j(t=>new Set([...t].filter(t=>t!==e)))})},N=(0,t.jsx)(z,{deliveries:l.data??[],state:l.isError?"error":l.data?"ready":"loading",onRetry:()=>{l.refetch()},onResend:b.canManage?e=>{let t=(0,o.deliveryWithId)(l.data,e);y(e,async()=>{try{await c.mutateAsync({deliveryId:e}),t&&(0,n.showToast)({...(0,o.resentToast)(t),tone:"success"})}catch(e){(0,n.showToast)({title:"Couldn’t resend the message",description:V(e),tone:"error"})}})}:void 0,onDismiss:b.canManage?e=>{y(e,async()=>{try{await m.mutateAsync({deliveryId:e}),(0,n.showToast)({...o.DISMISSED_TOAST,tone:"success"})}catch(e){(0,n.showToast)({title:"Couldn’t dismiss the delivery",description:V(e),tone:"error"})}})}:void 0,onOpen:t=>{e.push((0,o.messagePathOf)(t))},pendingIds:v,now:i});return(0,t.jsx)(M.ListPage,{...x,title:"Needs attention",description:"Deliveries no ship acknowledged after five tries, or not handled, oldest first. Resend or dismiss each one.",live:u.live,children:f.length>0||d.length>0||r.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("section",{"aria-labelledby":"attention-undeliverable",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h2",{id:"attention-undeliverable",className:"text-body font-semibold",children:["Undeliverable deliveries (",l.data?.length??0,")"]}),l.data?.length===0?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"None."}):N]}),d.length>0?(0,t.jsxs)("section",{"aria-labelledby":"attention-overdue",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h2",{id:"attention-overdue",className:"text-body font-semibold",children:["Overdue (",d.length,")"]}),(0,t.jsx)(L,{deliveries:d,onOpen:t=>{e.push((0,o.overduePathOf)(t))},now:i}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Handed and not confirmed for 10 min, or waiting 10 min while the session is idle or 60 while it is busy. They clear by themselves once they move on."})]}):null,r.length>0?(0,t.jsxs)("section",{"aria-labelledby":"attention-no-ship-can-take",className:"flex flex-col gap-2",children:[(0,t.jsxs)("h2",{id:"attention-no-ship-can-take",className:"text-body font-semibold",children:["No ship can take it (",r.length,")"]}),(0,t.jsx)(R,{deliveries:r,onOpen:t=>{e.push((0,o.messagePathOf)(t))},now:i}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Sent to a type no active ship has, or none its sender may reach. Commission a ship of the type and it takes them; they clear by themselves."})]}):null,f.length>0?(0,t.jsxs)("section",{"aria-labelledby":"attention-silent",className:"flex flex-col gap-2 max-sm:order-first",children:[(0,t.jsxs)("h2",{id:"attention-silent",className:"text-body font-semibold",children:["Silent members (",f.length,")"]}),(0,t.jsx)(H,{members:f,ships:g,now:i,renderAction:b.canManage?({squadronId:e,member:s})=>(0,t.jsx)(q.GetNewCrewLine,{squadronId:e,member:s,ship:p.get(s.shipId),isPrimary:!0,testId:"silent-member-new-crew-line"}):void 0}),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"A member is silent after 3 missed check-ins; only you can start its new session. Late members and blocked reports stay on their squadron page."})]}):null]}):N})}],31034)},36651,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Kbd",0,function({className:e,...a}){return(0,t.jsx)("kbd",{"data-slot":"kbd",className:(0,s.classNames)("inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-xs border border-border bg-muted px-1.25 font-sans text-micro font-medium text-muted-foreground max-sm:hidden",e),...a})}])},19321,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["Skeleton",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"skeleton","aria-hidden":!0,className:(0,s.classNames)("animate-pulse rounded-sm bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none",e),...a})}])},14732,e=>{"use strict";var t=e.i(43476),s=e.i(56420);let a={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};a.node;let n=(0,s.default)(a),i={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};i.node;let l=(0,s.default)(i);var r=e.i(63707),d=e.i(90063);function o({className:e,...s}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,d.classNames)("px-4 text-left align-middle text-caption font-medium whitespace-nowrap text-muted-foreground",e),...s})}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,d.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,d.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,d.classNames)("px-4 align-middle",e),...s})},"TableHead",0,o,"TableHeader",0,function({className:e,...s}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,d.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,d.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})},"TableSortHead",0,function({direction:e,onSort:s,children:a,className:i,...c}){let m="ascending"===e?l:"descending"===e?n:r.ChevronsUpDown;return(0,t.jsx)(o,{"aria-sort":e??"none",className:(0,d.classNames)("px-2",i),...c,children:(0,t.jsxs)("button",{type:"button",onClick:s,className:"inline-flex h-7 items-center gap-1 rounded-sm px-2 font-medium hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring data-sorted:text-foreground","data-sorted":null===e?void 0:"",children:[a,(0,t.jsx)(m,{"aria-hidden":!0,className:(0,d.classNames)("size-3.5 shrink-0",null===e?"opacity-50":void 0)})]})})}],14732)},67874,e=>{"use strict";var t=e.i(43476),s=e.i(90063);e.s(["EmptyState",0,function({title:e,description:a,icon:n,action:i,variant:l="page",className:r}){return"section"===l?(0,t.jsxs)("p",{"data-slot":"empty-state","data-variant":l,className:(0,s.classNames)("rounded-lg border border-border px-4 py-3 text-center text-meta text-muted-foreground",r),children:[e,a?(0,t.jsxs)(t.Fragment,{children:[" ",a]}):null]}):"no-results"===l?(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":l,className:(0,s.classNames)("flex flex-col items-center gap-2.5 rounded-lg border border-border bg-card px-4 py-6 text-center",r),children:[(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:e}),i]}):(0,t.jsxs)("div",{"data-slot":"empty-state","data-variant":l,className:(0,s.classNames)("flex flex-col items-center gap-3 rounded-lg border border-dashed border-border bg-card px-6 py-10 text-center",r),children:[n?(0,t.jsx)("span",{"aria-hidden":!0,className:"flex size-10 items-center justify-center rounded-lg border border-border bg-muted text-muted-foreground [&_svg]:size-(--size-icon-xl)",children:n}):null,(0,t.jsx)("h2",{className:"text-heading font-semibold text-foreground max-sm:text-heading-touch",children:e}),a?(0,t.jsx)("p",{className:"max-w-96 text-meta text-muted-foreground max-sm:text-body-touch",children:a}):null,i?(0,t.jsx)("div",{className:"mt-1 max-sm:w-full max-sm:[&>*]:w-full",children:i}):null]})}])},19249,e=>{"use strict";var t=e.i(43476),s=e.i(90063);let a={"on-time":{label:"On time",dot:"bg-tone-ok-fg",text:"text-tone-ok-fg"},late:{label:"Late",dot:"bg-tone-waiting-fg",text:"text-tone-waiting-fg"},silent:{label:"Silent",dot:"bg-tone-attention-fg",text:"text-tone-attention-fg"},"standing-down":{label:"Standing down",dot:"bg-tone-active-fg",text:"text-tone-active-fg"},"not-on-station":{label:"Not on station",dot:"border border-dashed border-muted-foreground",text:"text-foreground"}};function n({health:e}){return(0,t.jsx)("span",{"aria-hidden":!0,className:(0,s.classNames)("size-2 shrink-0 rounded-full",a[e].dot)})}e.s(["HealthIndicator",0,function({health:e,detail:i,className:l}){return(0,t.jsxs)("span",{"data-slot":"health-indicator","data-health":e,className:(0,s.classNames)("inline-flex items-center gap-1.5 text-meta",l),children:[(0,t.jsx)(n,{health:e}),(0,t.jsx)("span",{className:(0,s.classNames)("font-medium",a[e].text),children:a[e].label}),void 0!==i&&(0,t.jsx)("span",{className:"text-muted-foreground",children:i})]})},"HealthSummary",0,function({counts:e,className:i}){return(0,t.jsx)("span",{"data-slot":"health-summary",className:(0,s.classNames)("inline-flex flex-wrap items-center gap-x-3 gap-y-1 text-meta",i),children:e.map(({health:e,count:s})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(n,{health:e}),(0,t.jsxs)("span",{children:[s," ",a[e].label.toLowerCase()]})]},e))})}])},88393,e=>{"use strict";var t=e.i(43476),s=e.i(90063),a=e.i(19321);function n(e){return Array.from({length:e},(e,t)=>`row-${String(t)}`)}e.s(["LoadingSkeleton",0,function({variant:e,rows:i=4,label:l="Loading",className:r}){return(0,t.jsxs)("div",{role:"status","data-slot":"loading-skeleton","data-variant":e,className:(0,s.classNames)("w-full",r),children:[(0,t.jsx)("span",{className:"sr-only",children:l}),"table"===e?(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-card shadow-sm",children:[(0,t.jsx)("div",{className:"h-(--size-row-header) border-b border-border bg-muted"}),n(i).map(e=>(0,t.jsxs)("div",{className:"flex h-(--size-row) items-center gap-8 border-b border-border px-4 last:border-0",children:[(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-24"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-28"})]},e))]}):null,"cards"===e?(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:n(4).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-card p-4",children:[(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-6 w-10"}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-28"})]},e))}):null,"detail"===e?(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(a.Skeleton,{className:"h-7 w-48"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.Skeleton,{className:"h-5 w-20"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(a.Skeleton,{className:"h-16 w-full rounded-lg"})]}):null,"list"===e?(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border bg-card",children:n(i).map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 border-b border-border px-3.5 py-3 last:border-0",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)(a.Skeleton,{className:"h-3 w-28"}),(0,t.jsx)(a.Skeleton,{className:"h-5 w-16"})]}),(0,t.jsx)(a.Skeleton,{className:"h-2.5 w-44"})]},e))}):null]})}])},39448,e=>{"use strict";var t=e.i(43476),s=e.i(25913),a=e.i(22016),n=e.i(90063);let i=(0,s.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:s,size:l,isSuffixShown:r=!1,isOperator:d=!1,href:o,className:c}){let m=o?(0,t.jsx)(a.default,{href:o,className:(0,n.classNames)(i({size:l}),"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:i({size:l}),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:[m,d?(0,t.jsx)("span",{className:"shrink-0 font-normal text-muted-foreground",children:"(you)"}):null,r&&!d?(0,t.jsxs)("span",{className:"shrink-0 font-mono text-id text-muted-foreground uppercase",children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"· "}),s.slice(-4)]}):null]})}])},1935,e=>{"use strict";var t=e.i(43476),s=e.i(60011),a=e.i(22016),n=e.i(90063);e.s(["SquadronTag",0,function({squadronId:e,role:i,size:l="md",className:r}){return(0,t.jsxs)(a.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"===l?"h-5.5 text-meta":"h-6 text-body",r),children:[(0,t.jsx)(s.Shapes,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate font-medium",children:e}),void 0!==i&&(0,t.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:["· ",i]})]})}])},77880,85538,e=>{"use strict";var t=e.i(43476),s=e.i(67927),a=e.i(66595),n=e.i(19759),i=e.i(22016),l=e.i(15905),r=e.i(36651),d=e.i(90063);let o={live:{label:"Live",dot:"bg-tone-ok-fg"},reconnecting:{label:"Reconnecting",dot:"bg-tone-waiting-fg"},offline:{label:"Offline",dot:"bg-tone-attention-fg"}};function c({state:e,className:s}){let{label:a,dot:n}=o[e];return(0,t.jsxs)("span",{"data-slot":"live-status","data-state":e,"aria-live":"polite",className:(0,d.classNames)("inline-flex items-center gap-1.5 text-meta text-muted-foreground",s),children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,d.classNames)("size-2 shrink-0 rounded-full",n)}),a]})}e.s(["Header",0,function({breadcrumb:e,parents:d=[],live:o,onCompose:m,onSearch:u}){return(0,t.jsxs)("header",{"data-slot":"header",className:"sticky top-0 z-30 hidden h-(--size-header) shrink-0 items-center justify-between gap-4 border-b border-border bg-background px-6 sm:flex",children:[(0,t.jsx)("nav",{"aria-label":"Breadcrumb","data-testid":"header-breadcrumb",className:"min-w-0 text-body",children:(0,t.jsxs)("ol",{className:"flex min-w-0 items-center gap-1.5",children:[d.map(e=>(0,t.jsxs)("li",{className:"flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)(i.default,{href:e.href,className:"text-muted-foreground hover:text-foreground hover:underline",children:e.label}),(0,t.jsx)(s.ChevronRight,{"aria-hidden":!0,className:"size-3.5 text-muted-foreground"})]},e.href)),(0,t.jsx)("li",{"aria-current":"page",className:"truncate font-medium text-foreground",children:e})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(c,{state:o}),u?(0,t.jsxs)(l.Button,{size:"sm",icon:(0,t.jsx)(a.Search,{"aria-hidden":!0}),"data-testid":"header-search",className:"w-60 justify-start font-normal text-muted-foreground",onClick:u,children:[(0,t.jsx)("span",{className:"grow text-left",children:"Search ships or jump to"}),(0,t.jsx)(r.Kbd,{children:"⌘K"})]}):null,m?(0,t.jsx)(l.Button,{size:"sm",icon:(0,t.jsx)(n.SquarePen,{"aria-hidden":!0}),"data-testid":"header-compose",onClick:m,children:"Compose"}):null]})]})}],77880);var m=e.i(24071),u=e.i(57957);e.s(["TopBar",0,function({title:e,live:s,actions:n,back:r,account:d,onSearch:o}){let x=o&&!r?o:void 0;return(0,t.jsxs)("header",{"data-slot":"top-bar","data-mode":r?"detail":"root",className:"sticky top-0 z-30 flex h-(--size-header) items-center gap-2.5 border-b border-border bg-background px-4 sm:hidden",children:[r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.default,{href:r.href,className:"-ml-1.5 inline-flex h-(--size-control-touch) shrink-0 items-center gap-0.5 rounded-md pr-2 text-body-touch text-foreground focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon)",children:[(0,t.jsx)(m.ChevronLeft,{"aria-hidden":!0}),r.label]}),(0,t.jsx)("p",{className:"min-w-0 flex-1 truncate text-center text-body-touch font-semibold text-foreground",children:e})]}):(0,t.jsx)("h1",{className:"truncate text-title-touch font-semibold tracking-tight text-foreground",children:e}),(0,t.jsx)(c,{state:s}),n||x||d&&!r?(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[x?(0,t.jsx)(l.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Search ships or jump to","data-testid":"top-bar-search",onClick:x,children:(0,t.jsx)(a.Search,{"aria-hidden":!0})}):null,n,d&&!r?(0,t.jsx)(u.AccountMenuSheet,{...d}):null]}):null]})}],85538)},77821,e=>{"use strict";var t=e.i(43476),s=e.i(19759),a=e.i(15905),n=e.i(77880),i=e.i(85538);e.s(["ListPage",0,function({title:e,description:l,titleMeta:r,primaryAction:d,toolbar:o,live:c,onCompose:m,onSearch:u,account:x,banner:h,children:f}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.Header,{breadcrumb:e,live:c,onCompose:m,onSearch:u}),h,(0,t.jsx)(i.TopBar,{title:e,live:c,account:x,onSearch:u,actions:m?(0,t.jsx)(a.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:m,children:(0,t.jsx)(s.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.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1",children:[(0,t.jsx)("h1",{className:"text-title font-semibold tracking-tight text-foreground max-sm:hidden",children:e}),r]}),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]}),o,f]})]})}])},18423,e=>{"use strict";var t=e.i(12598),s=e.i(5861),a=e.i(71645),n=e.i(42454),i=e.i(27702);let l=new Set(["FleetInitialised","ShipCommissioned","ShipClaimed","LeaseRevoked","CredentialRevoked","StartingPromptIssued","ShipRetired","DeliveryAcknowledged","DeliveryUndeliverable","ShipReported","CrewRequested","CrewRequestRemoved","CrewAssigned","CrewStatusChanged","CrewRequestExplained","CrewRequestGivenBack","LabelAssigned","LabelUnassigned","LabelRetired"]);async function r(e,t){await e.cancelQueries({queryKey:t,predicate:e=>void 0===e.state.data&&"fetching"===e.state.fetchStatus}),await e.invalidateQueries({queryKey:t})}let d=new Set(["LabelDefined","LabelValuesChanged","LabelRetired","LabelAssigned","LabelUnassigned","LabelDeleted"]),o=new Set(["DeliveryUndeliverable","DeliveryDismissed"]);e.s(["useLiveFleet",0,function(){let e=(0,i.useTRPC)(),c=(0,t.useQueryClient)(),[m,u]=(0,a.useState)(new Set),x=e=>{r(c,e)},h=(0,s.useSubscription)(e.fleet.events.subscriptionOptions({lastEventId:null},{onData:({data:t})=>{var s,a,i;if("resync"===t.kind)return void x(e.fleet.pathKey());let{event:r}=t;for(let t of new Set([r.shipId,r.actorShipId]))null!==t&&(x(e.fleet.ship.queryKey({shipId:t})),x(e.fleet.shipTimeline.queryKey({shipId:t})),x(e.fleet.shipWay.queryKey({shipId:t})));if(null!==r.messageId&&(x(e.fleet.shipMessages.pathKey()),x(e.fleet.shipWay.pathKey()),x(e.fleet.overdue.queryKey()),x(e.fleet.message.queryKey({messageId:r.messageId})),x(e.fleet.inbox.pathKey()),x(n.QUESTIONS_KEY),x(e.fleet.noShipCanTake.queryKey())),s=r.type,o.has(s)&&x(e.fleet.needsAttention.queryKey()),a=r.type,d.has(a)&&x(e.fleet.labels.queryKey()),"NetworkRulesDeclared"===r.type&&x(e.fleet.declaredNetworkRules.queryKey()),i=r.type,!l.has(i))return;x(e.fleet.list.queryKey()),x(e.fleet.noShipCanTake.queryKey());let{shipId:c}=r;"ShipCommissioned"===r.type&&null!==c&&u(e=>new Set([...e,c]))}}));return{live:function(e){switch(e){case"pending":return"live";case"connecting":return"reconnecting";case"idle":case"error":return"offline"}}(h.status),newShipIds:m,error:h.error}}])},69693,e=>{"use strict";var t=e.i(46150);function s(e){let t=e.split(";")[0]?.trim().toLowerCase()??"";return"application/json"===t||t.endsWith("+json")}e.s(["formattedPayload",0,function(e,t){if(s(t))try{return JSON.stringify(JSON.parse(e),null,2)}catch{return}},"isJson",0,s,"payloadLabel",0,function(e,a){let n=s(a)?"JSON":a.split(";")[0]?.trim()??a,i=new TextEncoder().encode(e).byteLength;return`${n} \xb7 ${(0,t.counted)(i,{one:"byte",many:"bytes"})}`}])}]);