@aeolus-fleet/console 0.20.0 → 0.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/squadrons/[procedure]/route.js.nft.json +1 -1
  13. package/.next/server/app/inbox/page.js.nft.json +1 -1
  14. package/.next/server/app/inbox/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/labels/page.js.nft.json +1 -1
  16. package/.next/server/app/labels/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/needs-attention/page.js.nft.json +1 -1
  18. package/.next/server/app/needs-attention/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/needs-crew/page.js.nft.json +1 -1
  20. package/.next/server/app/needs-crew/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/page.js.nft.json +1 -1
  22. package/.next/server/app/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/settings/page.js.nft.json +1 -1
  24. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/ships/[shipId]/page.js.nft.json +1 -1
  26. package/.next/server/app/ships/[shipId]/page_client-reference-manifest.js +1 -1
  27. package/.next/server/app/sign-in/failed/page.js.nft.json +1 -1
  28. package/.next/server/app/sign-in/failed/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/sign-in/page.js.nft.json +1 -1
  30. package/.next/server/app/sign-in/page_client-reference-manifest.js +1 -1
  31. package/.next/server/app/squadrons/[squadronId]/page.js.nft.json +1 -1
  32. package/.next/server/app/squadrons/[squadronId]/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app/squadrons/blueprints/[name]/page.js.nft.json +1 -1
  34. package/.next/server/app/squadrons/blueprints/[name]/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/squadrons/connection/route.js.nft.json +1 -1
  36. package/.next/server/app/squadrons/page.js.nft.json +1 -1
  37. package/.next/server/app/squadrons/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/squadrons/templates/[name]/page.js.nft.json +1 -1
  39. package/.next/server/app/squadrons/templates/[name]/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/trierarch-plugin/connection/route.js.nft.json +1 -1
  41. package/.next/server/app/trierarchs/[shipId]/page.js.nft.json +1 -1
  42. package/.next/server/app/trierarchs/[shipId]/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/trierarchs/page.js.nft.json +1 -1
  44. package/.next/server/app/trierarchs/page_client-reference-manifest.js +1 -1
  45. package/.next/server/app/version/route.js.nft.json +1 -1
  46. package/.next/server/chunks/[root-of-the-server]__1f_8ohl._.js +1 -1
  47. package/.next/server/chunks/_0h366h9._.js +1 -1
  48. package/.next/server/chunks/packages_console_lib_connect-plugin_ts_197hf-1._.js +1 -1
  49. package/.next/server/chunks/ssr/_0dogq79._.js +1 -1
  50. package/.next/server/chunks/ssr/_0rvujxo._.js +1 -1
  51. package/.next/server/chunks/ssr/_0s2b6hb._.js +1 -1
  52. package/.next/server/chunks/ssr/_0sko-kt._.js +1 -1
  53. package/.next/server/chunks/ssr/{_1bqclkf._.js → _0sv2xqb._.js} +2 -2
  54. package/.next/server/chunks/ssr/_0wr_wnm._.js +3 -0
  55. package/.next/server/chunks/ssr/_0wtj0e-._.js +1 -1
  56. package/.next/server/chunks/ssr/{_0n4kirm._.js → _0xc3etp._.js} +1 -1
  57. package/.next/server/chunks/ssr/_0xvm1ng._.js +1 -1
  58. package/.next/server/chunks/ssr/_0ziovn_._.js +1 -1
  59. package/.next/server/chunks/ssr/_11cgy8n._.js +3 -0
  60. package/.next/server/chunks/ssr/_1442xyx._.js +1 -1
  61. package/.next/server/chunks/ssr/_14rijy-._.js +3 -0
  62. package/.next/server/chunks/ssr/{_08f4mzr._.js → _17u4fan._.js} +2 -2
  63. package/.next/server/chunks/ssr/_181kpys._.js +1 -1
  64. package/.next/server/chunks/ssr/_19e0e-9._.js +1 -1
  65. package/.next/server/chunks/ssr/_1_h504-._.js +3 -0
  66. package/.next/server/chunks/ssr/_1al_cqt._.js +3 -0
  67. package/.next/server/chunks/ssr/_1bmk6y_._.js +3 -0
  68. package/.next/server/chunks/ssr/{_1oqoc4e._.js → _1ejhqt9._.js} +2 -2
  69. package/.next/server/chunks/ssr/_1ezhc7m._.js +3 -0
  70. package/.next/server/chunks/ssr/_1kv8ma5._.js +1 -1
  71. package/.next/server/chunks/ssr/_1ommvbv._.js +1 -1
  72. package/.next/server/chunks/ssr/{_0mob-i2._.js → _1on9mjs._.js} +2 -2
  73. package/.next/server/chunks/ssr/_1oofkty._.js +1 -1
  74. package/.next/server/chunks/ssr/_1r6ce_7._.js +1 -1
  75. package/.next/server/chunks/ssr/{_1tsejml._.js → _208q2q8._.js} +1 -1
  76. package/.next/server/chunks/ssr/node_modules_next_dist_0kq7z60._.js +1 -1
  77. package/.next/server/chunks/ssr/{packages_console_023iioa._.js → packages_console_0edevze._.js} +1 -1
  78. package/.next/server/chunks/ssr/packages_console_0oso305._.js +3 -0
  79. package/.next/server/chunks/ssr/{packages_console_0lv43wr._.js → packages_console_0y7h5dm._.js} +1 -1
  80. package/.next/server/chunks/ssr/packages_console_1stwpsk._.js +3 -0
  81. package/.next/server/chunks/ssr/packages_console_app_page_tsx_16ln4px._.js +1 -1
  82. package/.next/server/chunks/ssr/packages_console_app_ships_[shipId]_page_tsx_0fudjay._.js +1 -1
  83. package/.next/server/chunks/ssr/packages_console_app_squadrons_[squadronId]_page_tsx_1umxs1g._.js +1 -1
  84. package/.next/server/chunks/ssr/packages_console_app_squadrons_page_tsx_1w6ym6z._.js +1 -1
  85. package/.next/server/chunks/ssr/packages_console_components_1-5gwzg._.js +1 -1
  86. package/.next/server/chunks/ssr/packages_console_components_organisms_form-squadron_tsx_1-qlsje._.js +3 -0
  87. package/.next/server/middleware-build-manifest.js +3 -3
  88. package/.next/server/pages/500.html +1 -1
  89. package/.next/server/server-reference-manifest.js +1 -1
  90. package/.next/server/server-reference-manifest.json +1 -1
  91. package/.next/static/chunks/0y1nvhxr03jkb.js +1 -0
  92. package/.next/static/chunks/1bvfk_-_enrxp.js +1 -0
  93. package/.next/static/chunks/1ct431l_sosvm.js +1 -0
  94. package/.next/static/chunks/1h0f7mfr5wxsj.js +1 -0
  95. package/.next/static/chunks/{39-cyg4qvxgbm.js → 21y50ct8e_pis.js} +1 -1
  96. package/.next/static/chunks/25amuen1qm2o7.js +1 -0
  97. package/.next/static/chunks/28j4p-34f5axr.js +1 -0
  98. package/.next/static/chunks/28vyyv4krlzx3.js +1 -0
  99. package/.next/static/chunks/2b-ho-tbr3sac.js +1 -0
  100. package/.next/static/chunks/{2_txjvbug4b86.js → 2r2aklt62ojhs.js} +1 -1
  101. package/.next/static/chunks/2spn0c35v7c1b.js +1 -0
  102. package/.next/static/chunks/2wnrtdpkhbd_j.js +1 -0
  103. package/.next/static/chunks/3061rp6nl670n.js +1 -0
  104. package/.next/static/chunks/3ba10-qig9f07.js +1 -0
  105. package/.next/static/chunks/3drxrwegn5v1p.css +3 -0
  106. package/.next/static/chunks/3jhje-hiar2ex.js +1 -0
  107. package/.next/static/chunks/3pu5ywtisj_fp.js +1 -0
  108. package/.next/static/chunks/{21jwgqx67q8ql.js → 3splvoavlf-cc.js} +1 -1
  109. package/.next/static/chunks/3vl7dc6v-u8w0.js +1 -0
  110. package/.next/static/chunks/{3b5uomyz3knol.js → 3z61krti-vbu2.js} +1 -1
  111. package/.next/static/chunks/{0e6zs-5ou_ra4.js → 414186x82sxkk.js} +1 -1
  112. package/package.json +3 -3
  113. package/.next/server/chunks/ssr/_01f7zv3._.js +0 -3
  114. package/.next/server/chunks/ssr/_0bmd2ey._.js +0 -3
  115. package/.next/server/chunks/ssr/_0i0_i88._.js +0 -3
  116. package/.next/server/chunks/ssr/_0t1jjxf._.js +0 -3
  117. package/.next/server/chunks/ssr/_20pku2-._.js +0 -3
  118. package/.next/server/chunks/ssr/packages_console_lib_crew-settings-form_ts_1_mrtph._.js +0 -3
  119. package/.next/static/chunks/00pjrzynt0in-.js +0 -1
  120. package/.next/static/chunks/0ez9e35zkfaz5.js +0 -1
  121. package/.next/static/chunks/0vlyibw4rexm7.js +0 -1
  122. package/.next/static/chunks/16o3i61aw3cj2.js +0 -1
  123. package/.next/static/chunks/17quvh6filhxh.js +0 -1
  124. package/.next/static/chunks/19x_u3cmb9s_j.js +0 -1
  125. package/.next/static/chunks/1mbia-jrmgpuu.js +0 -1
  126. package/.next/static/chunks/2c1daktq2hun-.css +0 -3
  127. package/.next/static/chunks/2k5tcu7bvrhet.js +0 -1
  128. package/.next/static/chunks/2mvb-x6v93lfc.js +0 -1
  129. package/.next/static/chunks/2ne-qdcv-7ck1.js +0 -1
  130. package/.next/static/chunks/30ux5-xn650iq.js +0 -1
  131. package/.next/static/chunks/3e1veij7vs6ao.js +0 -1
  132. package/.next/static/chunks/3eaxbdj-y982h.js +0 -1
  133. package/.next/static/chunks/3evbxrltn9tcu.js +0 -1
  134. /package/.next/static/{LHmQaS8aizP80vXh3K-ws → tBoOmC5nKBL5eqDmRV5Vd}/_buildManifest.js +0 -0
  135. /package/.next/static/{LHmQaS8aizP80vXh3K-ws → tBoOmC5nKBL5eqDmRV5Vd}/_clientMiddlewareManifest.js +0 -0
  136. /package/.next/static/{LHmQaS8aizP80vXh3K-ws → tBoOmC5nKBL5eqDmRV5Vd}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79432,19002,11147,e=>{"use strict";var t=e.i(56420);let s={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};s.node;let i=(0,t.default)(s);e.s(["Activity",0,i],79432);let r={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};r.node;let n=(0,t.default)(r);e.s(["CirclePause",0,n],19002);let a={name:"octagon-pause",size:24,node:[["path",{d:"M10 15V9",key:"1lckn7"}],["path",{d:"M14 15V9",key:"1muqhk"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],aliases:["pause-octagon"]};a.node;let o=(0,t.default)(a);e.s(["OctagonPause",0,o],11147)},86247,e=>{"use strict";var t=e.i(56420);let s={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};s.node;let i=(0,t.default)(s);e.s(["Ellipsis",0,i],86247)},26091,e=>{"use strict";var t=e.i(56420);let s={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};s.node;let i=(0,t.default)(s);e.s(["FileText",0,i],26091)},31458,e=>{"use strict";var t=e.i(56420);let s={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};s.node;let i=(0,t.default)(s);e.s(["Flag",0,i],31458)},58925,e=>{"use strict";var t=e.i(56420);let s={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};s.node;let i=(0,t.default)(s);e.s(["KeyRound",0,i],58925)},49319,e=>{"use strict";var t=e.i(56420);let s={name:"user-minus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};s.node;let i=(0,t.default)(s);e.s(["UserMinus",0,i],49319)},82303,e=>{"use strict";var t=e.i(56420);let s={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};s.node;let i=(0,t.default)(s);e.s(["Users",0,i],82303)},24010,e=>{"use strict";var t=e.i(43476);e.s([],58762),e.i(58762);var s=e.i(66250),i=e.i(2820),r=e.i(56736),n=e.i(9793),a=e.i(84324),o=e.i(64951),l=e.i(77173);let d=e.i(13488).DialogTrigger;var c=e.i(74217),u=e.i(25326);class h extends u.DialogHandle{}e.s(["Backdrop",()=>i.DialogBackdrop,"Close",()=>r.DialogClose,"Description",()=>n.DialogDescription,"Handle",0,h,"Popup",()=>a.DialogPopup,"Portal",()=>o.DialogPortal,"Root",0,function(e){return(0,s.useRenderDialogRoot)("alert-dialog",e)},"Title",()=>l.DialogTitle,"Trigger",0,d,"Viewport",()=>c.DialogViewport,"createHandle",0,function(){return new h}],34604);var m=e.i(34604),m=m,p=e.i(90063),g=e.i(94945);e.s(["AlertDialog",0,function(e){return(0,t.jsx)(m.Root,{"data-slot":"alert-dialog",...e})},"AlertDialogClose",0,function(e){return(0,t.jsx)(m.Close,{"data-slot":"alert-dialog-close",...e})},"AlertDialogContent",0,function({className:e,size:s,children:i,...r}){return(0,t.jsxs)(m.Portal,{children:[(0,t.jsx)(m.Backdrop,{"data-slot":"alert-dialog-overlay",className:g.dialogSurface.overlay}),(0,t.jsx)(m.Popup,{"data-slot":"alert-dialog-content",className:(0,p.classNames)(g.dialogSurface.popup({size:s}),e),...r,children:i})]})},"AlertDialogDescription",0,function({className:e,...s}){return(0,t.jsx)(m.Description,{"data-slot":"alert-dialog-description",className:(0,p.classNames)(g.dialogSurface.description,e),...s})},"AlertDialogFooter",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,p.classNames)(g.dialogSurface.footer,e),...s})},"AlertDialogHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,p.classNames)(g.dialogSurface.header,e),...s})},"AlertDialogTitle",0,function({className:e,...s}){return(0,t.jsx)(m.Title,{"data-slot":"alert-dialog-title",className:(0,p.classNames)(g.dialogSurface.title,e),...s})}],24010)},1009,e=>{"use strict";var t=e.i(43476);e.s(["ConsequenceList",0,function({consequences:e}){return(0,t.jsx)("ul",{className:"flex flex-col gap-2 rounded-lg border border-border bg-muted p-3 text-meta text-foreground",children:e.map(({icon:e,text:s})=>(0,t.jsxs)("li",{className:"flex gap-2",children:[(0,t.jsx)(e,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{children:s})]},s))})}])},81830,e=>{"use strict";var t=e.i(43476),s=e.i(79432),i=e.i(19002),r=e.i(11147),n=e.i(90063),a=e.i(49635),o=e.i(93361);let l={working:s.Activity,blocked:r.OctagonPause,idle:i.CirclePause},d={active:"text-tone-active-fg",waiting:"text-tone-waiting-fg",ended:"text-tone-ended-fg"};e.s(["ReportLine",0,function({report:e,now:s,variant:i,isTimeInTitle:r=!1,testId:c}){let u="full"===i,h=(0,n.classNames)("flex min-w-0 items-center gap-1.5",u?"text-body":"text-meta");if(null===e)return(0,t.jsx)("span",{"data-testid":c,"data-state":"none",className:(0,n.classNames)(h,"text-muted-foreground"),children:"No report yet"});let m=l[e.state],p=d[o.REPORT_TONES[e.state]],g=new Date(e.reportedAt);return(0,t.jsxs)("span",{"data-testid":c,"data-state":e.state,title:r?`${(0,o.reportText)(e)} \xb7 ${(0,o.reportedWhen)(g,s)}`:(0,o.reportText)(e),className:h,children:[(0,t.jsx)(m,{"aria-hidden":!0,className:(0,n.classNames)("size-(--size-icon-sm) shrink-0",p)}),(0,t.jsx)("span",{className:(0,n.classNames)("shrink-0 font-medium",p),children:o.REPORT_STATE_WORDS[e.state]}),null===e.note?null:(0,t.jsx)("span",{className:"min-w-0 truncate text-foreground",children:e.note}),r?null:(0,t.jsx)("time",{dateTime:e.reportedAt,title:(0,a.fullDateTime)(g),className:"shrink-0 text-muted-foreground tabular-nums",children:u?`\xb7 ${(0,o.reportedWhen)(g,s)}`:(0,o.reportAge)(g,s)})]})}])},69374,e=>{"use strict";var t=e.i(43476),s=e.i(71645),i=e.i(26808),r=e.i(12470),n=e.i(91727);e.s(["TypedConfirm",0,function({expected:e,value:a,onValueChange:o,"data-testid":l="retire-typed-confirm"}){let d=(0,s.useId)(),c=(0,s.useId)();return(0,t.jsxs)("div",{"data-testid":l,className:"flex flex-col gap-1.5",children:[(0,t.jsxs)(n.Label,{htmlFor:d,className:"text-meta",children:["Type ",(0,t.jsx)("code",{className:"rounded-xs bg-muted px-1 py-0.5 font-mono text-id",children:e})," to confirm"]}),(0,t.jsx)(r.Input,{id:d,isMono:!0,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,"aria-describedby":c,className:"max-sm:h-(--size-control-touch) max-sm:text-input-touch",value:a,onChange:e=>{o(e.target.value)}}),(0,t.jsx)("p",{id:c,"aria-live":"polite",className:"text-meta text-muted-foreground",children:""===a?"Case and hyphens must match.":(0,i.isTypedMatch)(e,a)?"Matches. The button is now active.":"Doesn’t match yet."})]})}])},39874,26808,82880,3067,42211,e=>{"use strict";var t=e.i(43476),s=e.i(71645),i=e.i(46150);let r={one:"delivery",many:"deliveries"};function n(e){if(0===e)return"Nothing is in flight, so no delivery moves.";let t=1===e?"returns":"return";return`${(0,i.counted)(e,{one:"in-flight delivery",many:"in-flight deliveries"})} ${t} to pending. Nothing is lost.`}function a(e){if("crewed"===e.status){let t=null===e.location?"the session crewing it":`the session on ${e.location.description??e.location.kind.toLowerCase()}`;return`This ends ${t}. ${n(e.inFlightDeliveries)}`}if(null!==e.startingPrompt&&!e.startingPrompt.isClaimed)return"The crew line issued earlier, not claimed yet, stops working."}e.s(["abandonedLine",0,function(e){return`${(0,i.counted)(e,r)} will be abandoned`},"inFlightLine",0,n,"isTypedMatch",0,function(e,t){return t===e},"newCrewLineReplaced",0,a,"retireButtonLabel",0,function(e){return 0===e?"Retire ship":`Retire and abandon ${(0,i.counted)(e,r)}`}],26808);var o=e.i(48695),l=e.i(15905),d=e.i(10818),c=e.i(25398),u=e.i(22212),h=e.i(94945),m=e.i(19321),p=e.i(66616),g=e.i(61966),f=e.i(60592);function x({crewLines:e,subject:i,testIdPrefix:r,onCopied:n,onCopyFailed:a}){let[o,l]=(0,s.useState)(e[0]?.harness),d=e.find(e=>e.harness===o)??e[0];if(!d)return null;let c=(0,p.crewLineHarnessWord)(d.harness);return(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[(0,t.jsx)(f.Tabs,{value:d.harness,onValueChange:t=>{let s=e.find(e=>e.harness===t);s&&l(s.harness)},children:(0,t.jsx)(f.TabsList,{"aria-label":`Crew ${i} from`,children:e.map(e=>(0,t.jsx)(f.TabsTrigger,{value:e.harness,"data-testid":`${r}-${e.harness}-tab`,children:(0,p.crewLineHarnessWord)(e.harness)},e.harness))})}),(0,t.jsx)("code",{"data-testid":`${r}-${d.harness}`,title:d.line,className:"min-w-0 grow truncate rounded-md bg-muted px-2 py-1 font-mono text-code text-foreground",children:d.line}),(0,t.jsx)(g.CopyButton,{value:d.line,label:`Copy the ${c} crew line for ${i}`,isLabeled:!0,onCopied:n,onCopyFailed:a,"data-testid":`${r}-${d.harness}-copy`})]})}e.s(["CompactCrewLine",0,x],82880);var b=e.i(17981),y=e.i(26091);function v({note:e,model:s,template:i,testId:r}){return null===e&&null===s?null:(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-muted px-3 py-2 text-meta",children:[(0,t.jsx)(y.FileText,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:["Launch note",void 0===i?"":` \xb7 ${i}`]}),null!==e&&(0,t.jsx)("span",{"data-testid":r,children:e}),null!==s&&(0,t.jsxs)("span",{children:["Runs ",(0,t.jsx)("span",{className:"font-mono",children:s})]})]})]})}function j({memberName:e,template:s,launchNote:i,model:r,crewLines:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{note:i,model:r,template:s,testId:"crew-line-launch-note"}),(0,t.jsx)(x,{crewLines:n,subject:e,testIdPrefix:"crew-line-text"}),(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(d.Info,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Shown once."})," Paste the crew line into Claude Code or Codex started where the launch note says, or into a chat client with the fleet’s connector. A new crew line stops it working."]})]})]})}function w({memberName:e,state:s,template:i,launchNote:r=null,model:n=null,crewLines:a,error:o,isOpen:d,onOpenChange:p,onConfirm:g}){let f="issuing"===s;return(0,t.jsx)(u.Dialog,{open:d,onOpenChange:e=>{f||p(e)},children:(0,t.jsxs)(u.DialogContent,{size:"md","data-testid":"crew-line-dialog",className:h.dialogSurface.phoneFullScreen,children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsxs)(u.DialogTitle,{children:["Crew line for ",e]}),(0,t.jsx)(u.DialogDescription,{children:"Start Claude Code or Codex where the launch note says, or open a chat client with the fleet’s connector, then paste its crew line. The member is on station once its session checks in."})]}),f&&(0,t.jsxs)("div",{"aria-busy":!0,className:"flex flex-col gap-3",children:[(0,t.jsx)("span",{className:"sr-only",children:"Issuing a crew line..."}),(0,t.jsx)(m.Skeleton,{className:"h-10 w-full rounded-lg"}),(0,t.jsx)(m.Skeleton,{className:"h-28 w-full rounded-lg"})]}),"shown"===s&&void 0!==a&&(0,t.jsx)(j,{memberName:e,template:i,launchNote:r,model:n,crewLines:a}),"error"===s&&(0,t.jsx)(b.InlineError,{title:"Couldn’t issue a crew line",description:`${o??"The squadron manager did not answer."} No new secret was created; an earlier crew line still works.`}),(0,t.jsxs)(u.DialogFooter,{children:[("shown"===s||f)&&(0,t.jsx)(u.DialogClose,{render:(0,t.jsx)(l.Button,{variant:"primary","data-testid":"crew-line-done",disabled:f}),children:"Done"}),"error"===s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.DialogClose,{render:(0,t.jsx)(l.Button,{}),children:"Close"}),(0,t.jsx)(l.Button,{variant:"primary",icon:(0,t.jsx)(c.RotateCw,{"aria-hidden":!0}),"data-testid":"crew-line-retry",onClick:g,children:"Try again"})]})]})]})})}e.s(["LaunchNote",0,v],3067),e.s(["CrewLineDialog",0,w],42211);var C=e.i(24010);function k({memberName:e,replacedText:s,isOpen:i,onOpenChange:r,onConfirm:n}){return(0,t.jsx)(C.AlertDialog,{open:i,onOpenChange:r,children:(0,t.jsxs)(C.AlertDialogContent,{"data-testid":"new-crew-line-confirm",className:h.dialogSurface.phoneSheet,children:[(0,t.jsxs)(C.AlertDialogHeader,{children:[(0,t.jsxs)(C.AlertDialogTitle,{children:["Get a new crew line for ",e,"?"]}),(0,t.jsx)(C.AlertDialogDescription,{children:s??"Its new secret is shown once, with its launch note."})]}),(0,t.jsxs)(C.AlertDialogFooter,{children:[(0,t.jsx)(C.AlertDialogClose,{render:(0,t.jsx)(l.Button,{}),children:"Cancel"}),(0,t.jsx)(l.Button,{variant:"primary","data-testid":"new-crew-line-confirm-submit",onClick:n,children:"Get new crew line"})]})]})})}function N(e){let i=(0,o.useNewCrewLine)(),[r,n]=(0,s.useState)(!1),[l,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(void 0),h=()=>{e&&i.mutate({squadronId:e.squadronId,shipId:e.member.shipId})},m=i.data?"shown":i.isError?"error":"issuing";return{isReady:e?.ship!==void 0,start:()=>{e?.ship&&(i.reset(),u(a(e.ship)),d(!0))},dialog:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k,{memberName:e.member.name,replacedText:c,isOpen:l,onOpenChange:d,onConfirm:()=>{d(!1),n(!0),h()}}),(0,t.jsx)(w,{memberName:e.member.name,state:m,template:e.template,launchNote:i.data?.launchNote,model:i.data?.model,crewLines:i.data?.crewLines,error:i.error?.message,isOpen:r,onOpenChange:e=>{n(e),e||i.reset()},onConfirm:h})]}):null}}e.s(["GetNewCrewLine",0,function({isPrimary:e=!1,testId:s,...i}){let r=N(i);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Button,{size:"xs",variant:e?"primary":"secondary",disabled:!r.isReady,"data-testid":s,onClick:r.start,children:"Get new crew line"}),r.dialog]})},"useNewCrewLineFlow",0,N],39874)},48287,e=>{"use strict";var t=e.i(43476),s=e.i(76561),i=e.i(85595),r=e.i(66787),n=e.i(82303),a=e.i(71645),o=e.i(26808),l=e.i(46150),d=e.i(24010),c=e.i(15905),u=e.i(94945),h=e.i(1009),m=e.i(17981),p=e.i(69374);let g={one:"delivery",many:"deliveries"};function f({role:e,othersOfRole:t,blueprint:s}){let i=0===t.length?`no ${e}`:`${String(t.length)} ${e}`;return void 0===s?`The squadron then has ${i}.`:`The squadron then has ${i}; blueprint ${s.label} has ${String(s.count)}.`}function x(e){let{squadronId:u,member:x,othersOfRole:b,blueprint:y,openDeliveries:v,inFlightDeliveries:j,isPending:w,error:C,onConfirm:k}=e,[N,T]=(0,a.useState)(""),R=v>0,S=!R||(0,o.isTypedMatch)(x.name,N),D=0===b.length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d.AlertDialogHeader,{children:[(0,t.jsxs)(d.AlertDialogTitle,{children:["Remove ",x.name," from ",u,"?"]}),(0,t.jsx)(d.AlertDialogDescription,{children:R?(0,t.jsx)(t.Fragment,{children:"Its ship is retired for good. This can't be undone."}):(0,t.jsx)(t.Fragment,{children:"This can't be undone. Add a member to get the role back."})})]}),R?(0,t.jsxs)("div",{role:"alert",className:"flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg p-3 text-meta text-tone-attention-fg",children:[(0,t.jsx)(r.TriangleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("p",{className:"font-medium",children:(0,o.abandonedLine)(v)}),(0,t.jsxs)("p",{className:"text-foreground",children:[v-j," pending, ",j," in flight in its inbox. Each is marked Abandoned and its sender can see that."]})]})]}):(0,t.jsx)(h.ConsequenceList,{consequences:[{icon:s.Archive,text:`Its ship ${x.name} is retired. Its history stays read-only.`},{icon:n.Users,text:f({role:x.role,othersOfRole:b,blueprint:y})}]}),D&&(0,t.jsxs)("p",{"data-testid":"remove-member-last-of-role",className:"flex items-start gap-2 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-meta text-tone-waiting-fg",children:[(0,t.jsx)(r.TriangleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0"}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"font-medium",children:["The last ",x.role,"."]})," ",(0,t.jsxs)("span",{className:"text-foreground",children:[f({role:x.role,othersOfRole:b,blueprint:y})," Work for the role waits until a member is added."]})]})]}),!R&&(0,t.jsxs)("p",{className:"flex items-center gap-2 rounded-lg border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-meta text-tone-ok-fg",children:[(0,t.jsx)(i.CircleCheck,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),"Its inbox is empty, so no deliveries are affected."]}),R?(0,t.jsx)(p.TypedConfirm,{expected:x.name,value:N,onValueChange:T}):null,void 0!==C&&(0,t.jsx)(m.InlineError,{title:"Couldn’t remove the member",description:`${C} Nothing changed.`}),(0,t.jsxs)(d.AlertDialogFooter,{children:[(0,t.jsx)(d.AlertDialogClose,{render:(0,t.jsx)(c.Button,{disabled:w}),children:"Cancel"}),(0,t.jsx)(c.Button,{variant:"destructive",isLoading:w,disabled:!S,onClick:k,"data-testid":"remove-member-confirm",children:R?`Remove and abandon ${(0,l.counted)(v,g)}`:"Remove member"})]})]})}e.s(["RemoveMemberDialog",0,function(e){let{isOpen:s,onOpenChange:i,isPending:r}=e;return(0,t.jsx)(d.AlertDialog,{open:s,onOpenChange:e=>{r||i(e)},children:(0,t.jsx)(d.AlertDialogContent,{"data-testid":"remove-member-dialog",className:u.dialogSurface.phoneSheet,children:(0,t.jsx)(x,{...e})})})}])},66616,e=>{"use strict";let t={"claude-code":{word:"Claude Code",kind:"coding"},codex:{word:"Codex",kind:"coding"},"claude-chat":{word:"Claude chat",kind:"chat"},chatgpt:{word:"ChatGPT",kind:"chat"},grok:{word:"Grok",kind:"chat"},grokbot:{word:"Grokbot",kind:"bot"},console:{word:"Console",kind:"console"}};function s(e){return t[e]?.word??e}e.s(["crewLineHarnessWord",0,function(e){return"chat"===e?"Chat":s(e)},"harnessKind",0,function(e){return t[e]?.kind},"harnessWord",0,s])},93361,e=>{"use strict";e.i(31627);var t=e.i(94661),s=e.i(49635);let i={working:"Working",blocked:"Blocked",idle:"Idle"};e.s(["REPORT_STATE_WORDS",0,i,"REPORT_TONES",0,{working:"active",blocked:"waiting",idle:"ended"},"reportAge",0,function(e,t){let i=Math.max(0,t.getTime()-e.getTime());return i<6e4?`${String(Math.floor(i/1e3))} s`:i<36e5?`${String(Math.floor(i/6e4))} min`:i<864e5?`${String(Math.floor(i/36e5))} h`:(0,s.relativeTime)(e,t)},"reportDetailsJson",0,function(e){return JSON.stringify(e,null,2)},"reportDetailsLabel",0,function(e){return`JSON \xb7 ${String((0,t.reportDetailsBytes)(e))} bytes`},"reportText",0,function(e){let t=i[e.state];return null===e.note?t:`${t}: ${e.note}`},"reportedWhen",0,function(e,t){let i=(0,s.relativeTime)(e,t);return`reported ${"Just now"===i?"just now":i}`}])},53573,e=>{"use strict";e.i(31627);var t=e.i(83615),s=e.i(19273),i=e.i(12598),r=e.i(81384),n=e.i(73664),a=e.i(27001),o=e.i(54440),l=e.i(71645),d=e.i(15823),c=e.i(40143),u=e.i(69230);function h(e,t){let s=new Set(t);return e.filter(e=>!s.has(e))}var m=class extends d.Subscribable{#e;#t;#s;#i;#r;#n;#a;#o;#l;#d=[];constructor(e,t,s){super(),this.#e=e,this.#i=s,this.#s=[],this.#r=[],this.#t=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#r.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#s=e,this.#i=t,c.notifyManager.batch(()=>{let e=this.#r,t=this.#u(this.#s);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let i=t.map(e=>e.observer),r=i.map(e=>e.getCurrentResult()),n=e.length!==i.length,a=i.some((t,s)=>t!==e[s]),o=n||a,l=!!o||r.some((e,t)=>{let i=this.#t[t];return!i||!(0,s.shallowEqualObjects)(e,i)});(o||l)&&(o&&(this.#d=t,this.#r=i),this.#t=r,this.hasListeners()&&(o&&(h(e,i).forEach(e=>{e.destroy()}),h(i,e).forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){let s=this.#u(e),i=s.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),r=s.map(e=>e.defaultedQueryOptions.queryHash);return[i,e=>this.#m(e??i,t,r),()=>this.#p(i,s)]}#p(e,t){let s=new Set;return t.map((i,r)=>{let n=e[r];return i.defaultedQueryOptions.notifyOnChangeProps?n:i.observer.trackResult(n,e=>{s.has(e)||(s.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#m(e,t,i){if(t){let r=this.#l,n=void 0!==i&&void 0!==r&&(r.length!==i.length||i.some((e,t)=>e!==r[t]));return(this.#t!==this.#o||n||t!==this.#a)&&(this.#a=t,this.#o=this.#t,void 0!==i&&(this.#l=i),this.#n=(0,s.replaceEqualDeep)(this.#n,t(e))),this.#n}return e}#g(){return!this.#i?.combine||this.#r.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#u(e){let t=new Map;this.#r.forEach(e=>{let s=e.options.queryHash;if(!s)return;let i=t.get(s);i?i.push(e):t.set(s,[e])});let s=[];return e.forEach(e=>{let i=this.#e.defaultQueryOptions(e),r=t.get(i.queryHash)?.shift()??new u.QueryObserver(this.#e,i);s.push({defaultedQueryOptions:i,observer:r})}),s}#c(e,t){let s=this.#r.indexOf(e);-1!==s&&(this.#t=this.#t.slice(),this.#t[s]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#g(),t=this.#n,s=e?t:this.#m(this.#p(this.#t,this.#d),this.#i?.combine);(e||t!==s)&&c.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},p=e.i(66027),g=e.i(5387),f=e.i(27702);e.s(["useMessage",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.message.queryOptions(void 0===e?s.skipToken:{messageId:e}))},"useShip",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.ship.queryOptions(void 0===e?s.skipToken:{shipId:e},{refetchInterval:g.LAST_SEEN_REFRESH_MS}))},"useShipMessages",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.shipMessages.queryOptions({shipId:e}))},"useShipTimeline",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.shipTimeline.queryOptions({shipId:e}))},"useShips",0,function(e){let d=(0,f.useTRPC)(),h=function({queries:e,...t}){let d=(0,i.useQueryClient)(void 0),h=(0,r.useIsRestoring)(),p=(0,n.useQueryErrorResetBoundary)(),g=!1!==t.subscribed,f=l.useMemo(()=>e.map(e=>{let t=d.defaultQueryOptions(e);return t._optimisticResults=h?"isRestoring":g?"optimistic":void 0,t}),[e,d,h,g]);f.forEach(e=>{(0,o.ensureSuspenseTimers)(e);let t=d.getQueryCache().get(e.queryHash);(0,a.ensurePreventErrorBoundaryRetry)(e,p,t)}),(0,a.useClearResetErrorBoundary)(p);let[x]=l.useState(()=>new m(d,f,t)),[b,y,v]=x.getOptimisticResult(f,t.combine),j=!h&&g;l.useSyncExternalStore(l.useCallback(e=>j?x.subscribe(c.notifyManager.batchCalls(e)):s.noop,[x,j]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),l.useEffect(()=>{x.setQueries(f,t)},[f,t,x]);let w=b.some((e,t)=>(0,o.shouldSuspend)(f[t],e))?b.flatMap((e,t)=>{let s=f[t];if(s&&(0,o.shouldSuspend)(s,e)){let e=new u.QueryObserver(d,s);return(0,o.fetchOptimistic)(s,e,p)}return[]}):[];if(w.length>0)throw Promise.all(w);let C=b.find((e,t)=>{let s=f[t];return s&&(0,a.getHasError)({result:e,errorResetBoundary:p,throwOnError:s.throwOnError,query:d.getQueryCache().get(s.queryHash),suspense:s.suspense})});if(C)throw C.error;return y(v())}({queries:e.flatMap(e=>{let s=(0,t.idSchema)("ship").safeParse(e);return s.success?[s.data]:[]}).map(e=>d.fleet.ship.queryOptions({shipId:e},{refetchInterval:g.LAST_SEEN_REFRESH_MS}))}),p=new Map;for(let e of h)e.data&&p.set(e.data.id,e.data);return p}],53573)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79432,19002,11147,e=>{"use strict";var t=e.i(56420);let s={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};s.node;let i=(0,t.default)(s);e.s(["Activity",0,i],79432);let r={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};r.node;let n=(0,t.default)(r);e.s(["CirclePause",0,n],19002);let a={name:"octagon-pause",size:24,node:[["path",{d:"M10 15V9",key:"1lckn7"}],["path",{d:"M14 15V9",key:"1muqhk"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],aliases:["pause-octagon"]};a.node;let l=(0,t.default)(a);e.s(["OctagonPause",0,l],11147)},86247,e=>{"use strict";var t=e.i(56420);let s={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};s.node;let i=(0,t.default)(s);e.s(["Ellipsis",0,i],86247)},26091,e=>{"use strict";var t=e.i(56420);let s={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};s.node;let i=(0,t.default)(s);e.s(["FileText",0,i],26091)},31458,e=>{"use strict";var t=e.i(56420);let s={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};s.node;let i=(0,t.default)(s);e.s(["Flag",0,i],31458)},58925,e=>{"use strict";var t=e.i(56420);let s={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};s.node;let i=(0,t.default)(s);e.s(["KeyRound",0,i],58925)},49319,e=>{"use strict";var t=e.i(56420);let s={name:"user-minus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};s.node;let i=(0,t.default)(s);e.s(["UserMinus",0,i],49319)},82303,e=>{"use strict";var t=e.i(56420);let s={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};s.node;let i=(0,t.default)(s);e.s(["Users",0,i],82303)},24010,e=>{"use strict";var t=e.i(43476);e.s([],58762),e.i(58762);var s=e.i(66250),i=e.i(2820),r=e.i(56736),n=e.i(9793),a=e.i(84324),l=e.i(64951),o=e.i(77173);let d=e.i(13488).DialogTrigger;var c=e.i(74217),u=e.i(25326);class h extends u.DialogHandle{}e.s(["Backdrop",()=>i.DialogBackdrop,"Close",()=>r.DialogClose,"Description",()=>n.DialogDescription,"Handle",0,h,"Popup",()=>a.DialogPopup,"Portal",()=>l.DialogPortal,"Root",0,function(e){return(0,s.useRenderDialogRoot)("alert-dialog",e)},"Title",()=>o.DialogTitle,"Trigger",0,d,"Viewport",()=>c.DialogViewport,"createHandle",0,function(){return new h}],34604);var m=e.i(34604),m=m,p=e.i(90063),g=e.i(94945);e.s(["AlertDialog",0,function(e){return(0,t.jsx)(m.Root,{"data-slot":"alert-dialog",...e})},"AlertDialogClose",0,function(e){return(0,t.jsx)(m.Close,{"data-slot":"alert-dialog-close",...e})},"AlertDialogContent",0,function({className:e,size:s,children:i,...r}){return(0,t.jsxs)(m.Portal,{children:[(0,t.jsx)(m.Backdrop,{"data-slot":"alert-dialog-overlay",className:g.dialogSurface.overlay}),(0,t.jsx)(m.Popup,{"data-slot":"alert-dialog-content",className:(0,p.classNames)(g.dialogSurface.popup({size:s}),e),...r,children:i})]})},"AlertDialogDescription",0,function({className:e,...s}){return(0,t.jsx)(m.Description,{"data-slot":"alert-dialog-description",className:(0,p.classNames)(g.dialogSurface.description,e),...s})},"AlertDialogFooter",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,p.classNames)(g.dialogSurface.footer,e),...s})},"AlertDialogHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,p.classNames)(g.dialogSurface.header,e),...s})},"AlertDialogTitle",0,function({className:e,...s}){return(0,t.jsx)(m.Title,{"data-slot":"alert-dialog-title",className:(0,p.classNames)(g.dialogSurface.title,e),...s})}],24010)},1009,e=>{"use strict";var t=e.i(43476);e.s(["ConsequenceList",0,function({consequences:e}){return(0,t.jsx)("ul",{className:"flex flex-col gap-2 rounded-lg border border-border bg-muted p-3 text-meta text-foreground",children:e.map(({icon:e,text:s})=>(0,t.jsxs)("li",{className:"flex gap-2",children:[(0,t.jsx)(e,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{children:s})]},s))})}])},81830,e=>{"use strict";var t=e.i(43476),s=e.i(79432),i=e.i(19002),r=e.i(11147),n=e.i(90063),a=e.i(49635),l=e.i(93361);let o={working:s.Activity,blocked:r.OctagonPause,idle:i.CirclePause},d={active:"text-tone-active-fg",waiting:"text-tone-waiting-fg",ended:"text-tone-ended-fg"};e.s(["ReportLine",0,function({report:e,now:s,variant:i,isTimeInTitle:r=!1,testId:c}){let u="full"===i,h=(0,n.classNames)("flex min-w-0 items-center gap-1.5",u?"text-body":"text-meta");if(null===e)return(0,t.jsx)("span",{"data-testid":c,"data-state":"none",className:(0,n.classNames)(h,"text-muted-foreground"),children:"No report yet"});let m=o[e.state],p=d[l.REPORT_TONES[e.state]],g=new Date(e.reportedAt);return(0,t.jsxs)("span",{"data-testid":c,"data-state":e.state,title:r?`${(0,l.reportText)(e)} \xb7 ${(0,l.reportedWhen)(g,s)}`:(0,l.reportText)(e),className:h,children:[(0,t.jsx)(m,{"aria-hidden":!0,className:(0,n.classNames)("size-(--size-icon-sm) shrink-0",p)}),(0,t.jsx)("span",{className:(0,n.classNames)("shrink-0 font-medium",p),children:l.REPORT_STATE_WORDS[e.state]}),null===e.note?null:(0,t.jsx)("span",{className:"min-w-0 truncate text-foreground",children:e.note}),r?null:(0,t.jsx)("time",{dateTime:e.reportedAt,title:(0,a.fullDateTime)(g),className:"shrink-0 text-muted-foreground tabular-nums",children:u?`\xb7 ${(0,l.reportedWhen)(g,s)}`:(0,l.reportAge)(g,s)})]})}])},69374,e=>{"use strict";var t=e.i(43476),s=e.i(71645),i=e.i(26808),r=e.i(12470),n=e.i(91727);e.s(["TypedConfirm",0,function({expected:e,value:a,onValueChange:l,"data-testid":o="retire-typed-confirm"}){let d=(0,s.useId)(),c=(0,s.useId)();return(0,t.jsxs)("div",{"data-testid":o,className:"flex flex-col gap-1.5",children:[(0,t.jsxs)(n.Label,{htmlFor:d,className:"text-meta",children:["Type ",(0,t.jsx)("code",{className:"rounded-xs bg-muted px-1 py-0.5 font-mono text-id",children:e})," to confirm"]}),(0,t.jsx)(r.Input,{id:d,isMono:!0,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,"aria-describedby":c,className:"max-sm:h-(--size-control-touch) max-sm:text-input-touch",value:a,onChange:e=>{l(e.target.value)}}),(0,t.jsx)("p",{id:c,"aria-live":"polite",className:"text-meta text-muted-foreground",children:""===a?"Case and hyphens must match.":(0,i.isTypedMatch)(e,a)?"Matches. The button is now active.":"Doesn’t match yet."})]})}])},39874,26808,82880,3067,42211,e=>{"use strict";var t=e.i(43476),s=e.i(71645),i=e.i(46150);let r={one:"delivery",many:"deliveries"};function n(e){if(0===e)return"Nothing is in flight, so no delivery moves.";let t=1===e?"returns":"return";return`${(0,i.counted)(e,{one:"in-flight delivery",many:"in-flight deliveries"})} ${t} to pending. Nothing is lost.`}function a(e){if("crewed"===e.status){let t=null===e.location?"the session crewing it":`the session on ${e.location.description??e.location.kind.toLowerCase()}`;return`This ends ${t}. ${n(e.inFlightDeliveries)}`}if(null!==e.startingPrompt&&!e.startingPrompt.isClaimed)return"The crew line issued earlier, not claimed yet, stops working."}e.s(["abandonedLine",0,function(e){return`${(0,i.counted)(e,r)} will be abandoned`},"inFlightLine",0,n,"isTypedMatch",0,function(e,t){return t===e},"newCrewLineReplaced",0,a,"retireButtonLabel",0,function(e){return 0===e?"Retire ship":`Retire and abandon ${(0,i.counted)(e,r)}`}],26808);var l=e.i(48695),o=e.i(15905),d=e.i(10818),c=e.i(25398),u=e.i(22212),h=e.i(94945),m=e.i(19321),p=e.i(66616),g=e.i(61966),f=e.i(60592);function x({crewLines:e,subject:i,testIdPrefix:r,onCopied:n,onCopyFailed:a}){let[l,o]=(0,s.useState)(e[0]?.harness),d=e.find(e=>e.harness===l)??e[0];if(!d)return null;let c=(0,p.crewLineHarnessWord)(d.harness);return(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[(0,t.jsx)(f.Tabs,{value:d.harness,onValueChange:t=>{let s=e.find(e=>e.harness===t);s&&o(s.harness)},children:(0,t.jsx)(f.TabsList,{"aria-label":`Crew ${i} from`,children:e.map(e=>(0,t.jsx)(f.TabsTrigger,{value:e.harness,"data-testid":`${r}-${e.harness}-tab`,children:(0,p.crewLineHarnessWord)(e.harness)},e.harness))})}),(0,t.jsx)("code",{"data-testid":`${r}-${d.harness}`,title:d.line,className:"min-w-0 grow truncate rounded-md bg-muted px-2 py-1 font-mono text-code text-foreground",children:d.line}),(0,t.jsx)(g.CopyButton,{value:d.line,label:`Copy the ${c} crew line for ${i}`,isLabeled:!0,onCopied:n,onCopyFailed:a,"data-testid":`${r}-${d.harness}-copy`})]})}e.s(["CompactCrewLine",0,x],82880);var y=e.i(17981),b=e.i(26091);function v({note:e,model:s,template:i,testId:r}){return null===e&&null===s?null:(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-muted px-3 py-2 text-meta",children:[(0,t.jsx)(b.FileText,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:["Launch note",void 0===i?"":` \xb7 ${i}`]}),null!==e&&(0,t.jsx)("span",{"data-testid":r,children:e}),null!==s&&(0,t.jsxs)("span",{children:["Runs ",(0,t.jsx)("span",{className:"font-mono",children:s})]})]})]})}function j({memberName:e,template:s,launchNote:i,model:r,crewLines:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{note:i,model:r,template:s,testId:"crew-line-launch-note"}),(0,t.jsx)(x,{crewLines:n,subject:e,testIdPrefix:"crew-line-text"}),(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(d.Info,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Shown once."})," Paste the crew line into Claude Code or Codex started where the launch note says, or into a chat client with the fleet’s connector. A new crew line stops it working."]})]})]})}function w({memberName:e,state:s,template:i,launchNote:r=null,model:n=null,crewLines:a,error:l,isOpen:d,onOpenChange:p,onConfirm:g}){let f="issuing"===s;return(0,t.jsx)(u.Dialog,{open:d,onOpenChange:e=>{f||p(e)},children:(0,t.jsxs)(u.DialogContent,{size:"md","data-testid":"crew-line-dialog",className:h.dialogSurface.phoneFullScreen,children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsxs)(u.DialogTitle,{children:["Crew line for ",e]}),(0,t.jsx)(u.DialogDescription,{children:"Start Claude Code or Codex where the launch note says, or open a chat client with the fleet’s connector, then paste its crew line. The member is on station once its session checks in."})]}),f&&(0,t.jsxs)("div",{"aria-busy":!0,className:"flex flex-col gap-3",children:[(0,t.jsx)("span",{className:"sr-only",children:"Issuing a crew line..."}),(0,t.jsx)(m.Skeleton,{className:"h-10 w-full rounded-lg"}),(0,t.jsx)(m.Skeleton,{className:"h-28 w-full rounded-lg"})]}),"shown"===s&&void 0!==a&&(0,t.jsx)(j,{memberName:e,template:i,launchNote:r,model:n,crewLines:a}),"error"===s&&(0,t.jsx)(y.InlineError,{title:"Couldn’t issue a crew line",description:`${l??"The squadron manager did not answer."} No new secret was created; an earlier crew line still works.`}),(0,t.jsxs)(u.DialogFooter,{children:[("shown"===s||f)&&(0,t.jsx)(u.DialogClose,{render:(0,t.jsx)(o.Button,{variant:"primary","data-testid":"crew-line-done",disabled:f}),children:"Done"}),"error"===s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.DialogClose,{render:(0,t.jsx)(o.Button,{}),children:"Close"}),(0,t.jsx)(o.Button,{variant:"primary",icon:(0,t.jsx)(c.RotateCw,{"aria-hidden":!0}),"data-testid":"crew-line-retry",onClick:g,children:"Try again"})]})]})]})})}e.s(["LaunchNote",0,v],3067),e.s(["CrewLineDialog",0,w],42211);var C=e.i(24010);function k({memberName:e,replacedText:s,isOpen:i,onOpenChange:r,onConfirm:n}){return(0,t.jsx)(C.AlertDialog,{open:i,onOpenChange:r,children:(0,t.jsxs)(C.AlertDialogContent,{"data-testid":"new-crew-line-confirm",className:h.dialogSurface.phoneSheet,children:[(0,t.jsxs)(C.AlertDialogHeader,{children:[(0,t.jsxs)(C.AlertDialogTitle,{children:["Get a new crew line for ",e,"?"]}),(0,t.jsx)(C.AlertDialogDescription,{children:s??"Its new secret is shown once, with its launch note."})]}),(0,t.jsxs)(C.AlertDialogFooter,{children:[(0,t.jsx)(C.AlertDialogClose,{render:(0,t.jsx)(o.Button,{}),children:"Cancel"}),(0,t.jsx)(o.Button,{variant:"primary","data-testid":"new-crew-line-confirm-submit",onClick:n,children:"Get new crew line"})]})]})})}function N(e){let i=(0,l.useNewCrewLine)(),[r,n]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(void 0),h=()=>{e&&i.mutate({squadronId:e.squadronId,shipId:e.member.shipId})},m=i.data?"shown":i.isError?"error":"issuing";return{isReady:e?.ship!==void 0,start:()=>{e?.ship&&(i.reset(),u(a(e.ship)),d(!0))},dialog:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(k,{memberName:e.member.name,replacedText:c,isOpen:o,onOpenChange:d,onConfirm:()=>{d(!1),n(!0),h()}}),(0,t.jsx)(w,{memberName:e.member.name,state:m,template:e.template,launchNote:i.data?.launchNote,model:i.data?.model,crewLines:i.data?.crewLines,error:i.error?.message,isOpen:r,onOpenChange:e=>{n(e),e||i.reset()},onConfirm:h})]}):null}}e.s(["GetNewCrewLine",0,function({isPrimary:e=!1,testId:s,...i}){let r=N(i);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Button,{size:"xs",variant:e?"primary":"secondary",disabled:!r.isReady,"data-testid":s,onClick:r.start,children:"Get new crew line"}),r.dialog]})},"useNewCrewLineFlow",0,N],39874)},48287,e=>{"use strict";var t=e.i(43476),s=e.i(76561),i=e.i(85595),r=e.i(66787),n=e.i(82303),a=e.i(71645),l=e.i(26808),o=e.i(46150),d=e.i(24010),c=e.i(15905),u=e.i(94945),h=e.i(1009),m=e.i(17981),p=e.i(69374);let g={one:"delivery",many:"deliveries"};function f({role:e,othersOfRole:t,blueprint:s}){let i=0===t.length?`no ${e}`:`${String(t.length)} ${e}`;return void 0===s?`The squadron then has ${i}.`:`The squadron then has ${i}; blueprint ${s.label} has ${String(s.count)}.`}function x(e){let{squadronId:u,member:x,othersOfRole:y,blueprint:b,openDeliveries:v,inFlightDeliveries:j,isPending:w,error:C,onConfirm:k}=e,[N,T]=(0,a.useState)(""),R=v>0,S=!R||(0,l.isTypedMatch)(x.name,N),D=0===y.length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d.AlertDialogHeader,{children:[(0,t.jsxs)(d.AlertDialogTitle,{children:["Remove ",x.name," from ",u,"?"]}),(0,t.jsx)(d.AlertDialogDescription,{children:R?(0,t.jsx)(t.Fragment,{children:"Its ship is retired for good. This can't be undone."}):(0,t.jsx)(t.Fragment,{children:"This can't be undone. Add a member to get the role back."})})]}),R?(0,t.jsxs)("div",{role:"alert",className:"flex gap-2 rounded-lg border border-tone-attention-border bg-tone-attention-bg p-3 text-meta text-tone-attention-fg",children:[(0,t.jsx)(r.TriangleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("p",{className:"font-medium",children:(0,l.abandonedLine)(v)}),(0,t.jsxs)("p",{className:"text-foreground",children:[v-j," pending, ",j," in flight in its inbox. Each is marked Abandoned and its sender can see that."]})]})]}):(0,t.jsx)(h.ConsequenceList,{consequences:[{icon:s.Archive,text:`Its ship ${x.name} is retired. Its history stays read-only.`},{icon:n.Users,text:f({role:x.role,othersOfRole:y,blueprint:b})}]}),D&&(0,t.jsxs)("p",{"data-testid":"remove-member-last-of-role",className:"flex items-start gap-2 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-meta text-tone-waiting-fg",children:[(0,t.jsx)(r.TriangleAlert,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0"}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"font-medium",children:["The last ",x.role,"."]})," ",(0,t.jsxs)("span",{className:"text-foreground",children:[f({role:x.role,othersOfRole:y,blueprint:b})," Work for the role waits until a member is added."]})]})]}),!R&&(0,t.jsxs)("p",{className:"flex items-center gap-2 rounded-lg border border-tone-ok-border bg-tone-ok-bg px-3 py-2 text-meta text-tone-ok-fg",children:[(0,t.jsx)(i.CircleCheck,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),"Its inbox is empty, so no deliveries are affected."]}),R?(0,t.jsx)(p.TypedConfirm,{expected:x.name,value:N,onValueChange:T}):null,void 0!==C&&(0,t.jsx)(m.InlineError,{title:"Couldn’t remove the member",description:`${C} Nothing changed.`}),(0,t.jsxs)(d.AlertDialogFooter,{children:[(0,t.jsx)(d.AlertDialogClose,{render:(0,t.jsx)(c.Button,{disabled:w}),children:"Cancel"}),(0,t.jsx)(c.Button,{variant:"destructive",isLoading:w,disabled:!S,onClick:k,"data-testid":"remove-member-confirm",children:R?`Remove and abandon ${(0,o.counted)(v,g)}`:"Remove member"})]})]})}e.s(["RemoveMemberDialog",0,function(e){let{isOpen:s,onOpenChange:i,isPending:r}=e;return(0,t.jsx)(d.AlertDialog,{open:s,onOpenChange:e=>{r||i(e)},children:(0,t.jsx)(d.AlertDialogContent,{"data-testid":"remove-member-dialog",className:u.dialogSurface.phoneSheet,children:(0,t.jsx)(x,{...e})})})}])},93361,e=>{"use strict";e.i(31627);var t=e.i(94661),s=e.i(49635);let i={working:"Working",blocked:"Blocked",idle:"Idle"};e.s(["REPORT_STATE_WORDS",0,i,"REPORT_TONES",0,{working:"active",blocked:"waiting",idle:"ended"},"reportAge",0,function(e,t){let i=Math.max(0,t.getTime()-e.getTime());return i<6e4?`${String(Math.floor(i/1e3))} s`:i<36e5?`${String(Math.floor(i/6e4))} min`:i<864e5?`${String(Math.floor(i/36e5))} h`:(0,s.relativeTime)(e,t)},"reportDetailsJson",0,function(e){return JSON.stringify(e,null,2)},"reportDetailsLabel",0,function(e){return`JSON \xb7 ${String((0,t.reportDetailsBytes)(e))} bytes`},"reportText",0,function(e){let t=i[e.state];return null===e.note?t:`${t}: ${e.note}`},"reportedWhen",0,function(e,t){let i=(0,s.relativeTime)(e,t);return`reported ${"Just now"===i?"just now":i}`}])},53573,e=>{"use strict";e.i(31627);var t=e.i(83615),s=e.i(19273),i=e.i(12598),r=e.i(81384),n=e.i(73664),a=e.i(27001),l=e.i(54440),o=e.i(71645),d=e.i(15823),c=e.i(40143),u=e.i(69230);function h(e,t){let s=new Set(t);return e.filter(e=>!s.has(e))}var m=class extends d.Subscribable{#e;#t;#s;#i;#r;#n;#a;#l;#o;#d=[];constructor(e,t,s){super(),this.#e=e,this.#i=s,this.#s=[],this.#r=[],this.#t=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#r.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#s=e,this.#i=t,c.notifyManager.batch(()=>{let e=this.#r,t=this.#u(this.#s);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let i=t.map(e=>e.observer),r=i.map(e=>e.getCurrentResult()),n=e.length!==i.length,a=i.some((t,s)=>t!==e[s]),l=n||a,o=!!l||r.some((e,t)=>{let i=this.#t[t];return!i||!(0,s.shallowEqualObjects)(e,i)});(l||o)&&(l&&(this.#d=t,this.#r=i),this.#t=r,this.hasListeners()&&(l&&(h(e,i).forEach(e=>{e.destroy()}),h(i,e).forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){let s=this.#u(e),i=s.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),r=s.map(e=>e.defaultedQueryOptions.queryHash);return[i,e=>this.#m(e??i,t,r),()=>this.#p(i,s)]}#p(e,t){let s=new Set;return t.map((i,r)=>{let n=e[r];return i.defaultedQueryOptions.notifyOnChangeProps?n:i.observer.trackResult(n,e=>{s.has(e)||(s.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#m(e,t,i){if(t){let r=this.#o,n=void 0!==i&&void 0!==r&&(r.length!==i.length||i.some((e,t)=>e!==r[t]));return(this.#t!==this.#l||n||t!==this.#a)&&(this.#a=t,this.#l=this.#t,void 0!==i&&(this.#o=i),this.#n=(0,s.replaceEqualDeep)(this.#n,t(e))),this.#n}return e}#g(){return!this.#i?.combine||this.#r.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#u(e){let t=new Map;this.#r.forEach(e=>{let s=e.options.queryHash;if(!s)return;let i=t.get(s);i?i.push(e):t.set(s,[e])});let s=[];return e.forEach(e=>{let i=this.#e.defaultQueryOptions(e),r=t.get(i.queryHash)?.shift()??new u.QueryObserver(this.#e,i);s.push({defaultedQueryOptions:i,observer:r})}),s}#c(e,t){let s=this.#r.indexOf(e);-1!==s&&(this.#t=this.#t.slice(),this.#t[s]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#g(),t=this.#n,s=e?t:this.#m(this.#p(this.#t,this.#d),this.#i?.combine);(e||t!==s)&&c.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},p=e.i(66027),g=e.i(5387),f=e.i(27702);e.s(["useMessage",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.message.queryOptions(void 0===e?s.skipToken:{messageId:e}))},"useShip",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.ship.queryOptions(void 0===e?s.skipToken:{shipId:e},{refetchInterval:g.LAST_SEEN_REFRESH_MS}))},"useShipMessages",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.shipMessages.queryOptions({shipId:e}))},"useShipTimeline",0,function(e){let t=(0,f.useTRPC)();return(0,p.useQuery)(t.fleet.shipTimeline.queryOptions({shipId:e}))},"useShips",0,function(e){let d=(0,f.useTRPC)(),h=function({queries:e,...t}){let d=(0,i.useQueryClient)(void 0),h=(0,r.useIsRestoring)(),p=(0,n.useQueryErrorResetBoundary)(),g=!1!==t.subscribed,f=o.useMemo(()=>e.map(e=>{let t=d.defaultQueryOptions(e);return t._optimisticResults=h?"isRestoring":g?"optimistic":void 0,t}),[e,d,h,g]);f.forEach(e=>{(0,l.ensureSuspenseTimers)(e);let t=d.getQueryCache().get(e.queryHash);(0,a.ensurePreventErrorBoundaryRetry)(e,p,t)}),(0,a.useClearResetErrorBoundary)(p);let[x]=o.useState(()=>new m(d,f,t)),[y,b,v]=x.getOptimisticResult(f,t.combine),j=!h&&g;o.useSyncExternalStore(o.useCallback(e=>j?x.subscribe(c.notifyManager.batchCalls(e)):s.noop,[x,j]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),o.useEffect(()=>{x.setQueries(f,t)},[f,t,x]);let w=y.some((e,t)=>(0,l.shouldSuspend)(f[t],e))?y.flatMap((e,t)=>{let s=f[t];if(s&&(0,l.shouldSuspend)(s,e)){let e=new u.QueryObserver(d,s);return(0,l.fetchOptimistic)(s,e,p)}return[]}):[];if(w.length>0)throw Promise.all(w);let C=y.find((e,t)=>{let s=f[t];return s&&(0,a.getHasError)({result:e,errorResetBoundary:p,throwOnError:s.throwOnError,query:d.getQueryCache().get(s.queryHash),suspense:s.suspense})});if(C)throw C.error;return b(v())}({queries:e.flatMap(e=>{let s=(0,t.idSchema)("ship").safeParse(e);return s.success?[s.data]:[]}).map(e=>d.fleet.ship.queryOptions({shipId:e},{refetchInterval:g.LAST_SEEN_REFRESH_MS}))}),p=new Map;for(let e of h)e.data&&p.set(e.data.id,e.data);return p}],53573)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52376,e=>{"use strict";e.s([],4824),e.i(4824);var t=e.i(71645),n=e.i(52245),r=e.i(33332);let a=t.createContext(void 0);function s(){let e=t.useContext(a);if(void 0===e)throw Error((0,r.default)(13));return e}let i={imageLoadingStatus:()=>null};var o=e.i(43476);let l=t.forwardRef(function(e,r){let{className:s,render:l,style:u,...c}=e,[d,f]=t.useState("idle"),h=t.useMemo(()=>({imageLoadingStatus:d,setImageLoadingStatus:f}),[d,f]),p=(0,n.useRenderElement)("span",e,{state:{imageLoadingStatus:d},ref:r,props:c,stateAttributesMapping:i});return(0,o.jsx)(a.Provider,{value:h,children:p})});var u=e.i(67865),c=e.i(46376),d=e.i(37584),f=e.i(74354),h=e.i(23910),p=e.i(56789);let m={...i,...f.transitionStatusMapping},g=t.forwardRef(function(e,r){let{className:a,render:i,onLoadingStatusChange:o,keepMounted:l=!1,style:f,sizes:g,srcSet:b,src:v,...y}=e,{setImageLoadingStatus:x}=s(),[k,j]=function(e,{referrerPolicy:n,crossOrigin:r,sizes:a,srcSet:s},i){let o=t.useState("idle"),l=o[1];return(0,c.useIsoLayoutEffect)(()=>{if(!i)return p.NOOP;if(!e&&!s)return l("error"),p.NOOP;let t=!0,o=new window.Image,u=e=>()=>{t&&l(e)};return l("loading"),o.onload=u("loaded"),o.onerror=u("error"),n&&(o.referrerPolicy=n),o.crossOrigin=r??null,a&&(o.sizes=a),s&&(o.srcset=s),e&&(o.src=e),o.complete&&l(o.naturalWidth>0?"loaded":"error"),()=>{t=!1}},[i,e,s,a,r,n,l]),o}(v,e,!l),S="loaded"===k,{mounted:w,transitionStatus:N,setMounted:C}=(0,h.useTransitionStatus)(S),I=t.useRef(null),P=t.useRef(!0);(0,c.useIsoLayoutEffect)(()=>{if(!l)return;let e=P.current;P.current=!1;let t=I.current;if(!t)return;if(!t.complete)return void j("loading");let n=t.naturalWidth>0?"loaded":"error";j(n),"loaded"===n&&e&&C(!0)},[l,v,b,g,y.crossOrigin,y.referrerPolicy,i,j,C]);let E=l?{"data-loading":"loading"===k?"":void 0,"data-error":"error"===k?"":void 0,"aria-hidden":"loaded"!==k||void 0,onLoad(){j("loaded")},onError(){j("error")}}:void 0,O=(0,u.useStableCallback)(e=>{o?.(e),x(e)});(0,c.useIsoLayoutEffect)(()=>{"idle"!==k&&O(k)},[k,O]),(0,c.useIsoLayoutEffect)(()=>()=>x("idle"),[x]),(0,d.useOpenChangeComplete)({enabled:!S,open:S,ref:I,onComplete(){S||C(!1)}});let A=l||w,L={};void 0!==g&&(L.sizes=g),void 0!==b&&(L.srcSet=b),void 0!==v&&(L.src=v);let M=(0,n.useRenderElement)("img",e,{state:{imageLoadingStatus:k,transitionStatus:l&&"ending"===N?void 0:N},ref:[r,I],props:[E,y,L],stateAttributesMapping:m,enabled:A});return A?M:null});var b=e.i(39957);let v=t.forwardRef(function(e,r){let{className:a,render:o,delay:l=0,style:u,...c}=e,{imageLoadingStatus:d}=s(),[f,h]=t.useState(0===l),p=(0,b.useTimeout)();return t.useEffect(()=>(l>0?p.start(l,()=>h(!0)):h(!0),p.clear),[p,l]),(0,n.useRenderElement)("span",e,{state:{imageLoadingStatus:d},ref:r,props:c,stateAttributesMapping:i,enabled:"loaded"!==d&&(0===l||f)})});e.s(["Fallback",0,v,"Image",0,g,"Root",0,l],14751);var y=e.i(14751);e.s(["Avatar",0,y],52376)},80862,e=>{"use strict";e.s(["endingStyle",0,"data-ending-style","startingStyle",0,"data-starting-style"])},74354,e=>{"use strict";var t=e.i(80862);let n={[t.startingStyle]:""},r={[t.endingStyle]:""};e.s(["transitionStatusMapping",0,{transitionStatus:e=>"starting"===e?n:"ending"===e?r:null}])},37584,22640,e=>{"use strict";var t=e.i(71645),n=e.i(67865),r=e.i(74080),a=e.i(8445),s=e.i(94603),i=e.i(80862);let o=null;function l(e,t=!1,u=!1){let c=(0,a.useAnimationFrame)();return(0,n.useStableCallback)((n,a=null)=>{c.cancel();let l=(0,s.resolveRef)(e);if(null==l)return;let d=()=>{if(!u)return void r.flushSync(n);if(!o){let e=[];o=e,queueMicrotask(()=>{o=null,r.flushSync(()=>{for(let t of e)t()})})}o.push(()=>{a?.aborted||n()})};if("function"!=typeof l.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)return void n();function f(){Promise.all(l.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||d()},()=>{a?.aborted||(l.getAnimations().some(e=>e.pending||"finished"!==e.playState)?f():d())})}if(t){let e=i.startingStyle;if(!l.hasAttribute(e))return void c.request(f);let t=new MutationObserver(()=>{l.hasAttribute(e)||(t.disconnect(),f())});return t.observe(l,{attributes:!0,attributeFilter:[e]}),void a?.addEventListener("abort",()=>t.disconnect(),{once:!0})}c.request(f)})}e.s(["useAnimationsFinished",0,l],22640),e.s(["useOpenChangeComplete",0,function(e){let{enabled:r=!0,open:a,ref:s,batch:i=!1,onComplete:o}=e,u=(0,n.useStableCallback)(o),c=l(s,a,i);t.useEffect(()=>{if(!r)return;let e=new AbortController;return c(u,e.signal),()=>{e.abort()}},[r,a,u,c])}],37584)},23910,e=>{"use strict";var t=e.i(71645),n=e.i(46376),r=e.i(8445);e.s(["useTransitionStatus",0,function(e,a=!1,s=!1,i=!1){let[o,l]=t.useState(e&&a?"idle":void 0),[u,c]=t.useState(e&&!i);return e&&!u&&(c(!0),l("starting")),e||!u||"ending"===o||s||l("ending"),e||u||"ending"!==o||l(void 0),(0,n.useIsoLayoutEffect)(()=>{if(!e&&u&&"ending"!==o&&s){let e=r.AnimationFrame.request(()=>{l("ending")});return()=>{r.AnimationFrame.cancel(e)}}},[e,u,o,s]),(0,n.useIsoLayoutEffect)(()=>{if(!e||a)return;let t=r.AnimationFrame.request(()=>{l(void 0)});return()=>{r.AnimationFrame.cancel(t)}},[a,e]),(0,n.useIsoLayoutEffect)(()=>{if(!e||!a)return;e&&u&&"idle"!==o&&l("starting");let t=r.AnimationFrame.request(()=>{l("idle")});return()=>{r.AnimationFrame.cancel(t)}},[a,e,u,o]),{mounted:u,setMounted:c,transitionStatus:o}}])},94603,e=>{"use strict";e.s(["resolveRef",0,function(e){return null==e?e:"current"in e?e.current:e}])},8445,e=>{"use strict";e.i(47167);var t=e.i(88940),n=e.i(26300);let r=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||null!==this.callbacks[t]&&(this.callbacks[t]=null,this.callbacksCount-=1)}};class a{static create(){return new a}static request(e){return r.request(e)}static cancel(e){return r.cancel(e)}currentId=null;request(e){this.cancel(),this.currentId=r.request(()=>{this.currentId=null,e()})}cancel=()=>{null!==this.currentId&&(r.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel}e.s(["AnimationFrame",0,a,"useAnimationFrame",0,function(){let e=(0,t.useRefWithInit)(a.create).current;return(0,n.useOnMount)(e.disposeEffect),e}])},26300,e=>{"use strict";var t=e.i(71645),n=e.i(56789);e.s(["useOnMount",0,function(e){t.useEffect(e,n.EMPTY_ARRAY)}])},39957,e=>{"use strict";var t=e.i(88940),n=e.i(26300);class r{static create(){return new r}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}e.s(["Timeout",0,r,"useTimeout",0,function(){let e=(0,t.useRefWithInit)(r.create).current;return(0,n.useOnMount)(e.disposeEffect),e}])},92150,e=>{"use strict";var t=e.i(56420);let n={name:"boxes",size:24,node:[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]};n.node;let r=(0,t.default)(n);e.s(["Boxes",0,r],92150)},49287,e=>{"use strict";var t=e.i(56420);let n={name:"ship",size:24,node:[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 9.189V13",key:"yp40p3"}],["path",{d:"M19 12V6a2 2 0 00-2-2H7a2 2 0 00-2 2v6",key:"1wcigf"}],["path",{d:"M19.38 19A11.6 11.6 0 0021 13l-8.188-3.639a2 2 0 00-1.624 0L3 13.001a11.6 11.6 0 002.81 7.76",key:"1kdp0u"}],["path",{d:"M2 20c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"1l8w7g"}]]};n.node;let r=(0,t.default)(n);e.s(["Ship",0,r],49287)},94831,e=>{"use strict";var t=e.i(56420);let n={name:"unplug",size:24,node:[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]};n.node;let r=(0,t.default)(n);e.s(["Unplug",0,r],94831)},22016,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return b},useLinkStatus:function(){return y}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=e.r(90809),i=e.r(43476),o=s._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),h=e.r(88540),p=e.r(91949),m=e.r(73668),g=e.r(9396);function b(t){var n;let r,a,s,[b,y]=(0,o.useOptimistic)(p.IDLE_LINK_STATUS),x=(0,o.useRef)(null),{href:k,as:j,children:S,prefetch:w=null,passHref:N,replace:C,shallow:I,scroll:P,onClick:E,onMouseEnter:O,onTouchStart:A,legacyBehavior:L=!1,onNavigate:M,transitionTypes:_,ref:R,unstable_dynamicOnHover:T,...z}=t;r=S,L&&("string"==typeof r||"number"==typeof r)&&(r=(0,i.jsx)("a",{children:r}));let $=o.default.useContext(u.AppRouterContext),F=!1!==w,q=!1===w?"none":!0===w?"full":"auto",B="none"!==q?"auto"===q?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,U="string"==typeof(n=j||k)?n:(0,l.formatUrl)(n);if(L){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=o.default.Children.only(r)}let W=L?a&&"object"==typeof a&&a.ref:R,D,V=o.default.useCallback(e=>(null!==$&&(x.current=(0,p.mountLinkInstance)(e,U,$,B,F,y,D)),()=>{x.current&&((0,p.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,p.unmountPrefetchableInstance)(e)}),[F,U,$,B,y,D]),K={ref:(0,c.useMergedRef)(V,W),onClick(t){L||"function"!=typeof E||E(t),L&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!$||t.defaultPrevented||function(t,n,r,a,s,i,l,u="none"){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(n)){a&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);o.default.startTransition(()=>{f(n,a?"replace":"push",!1===s?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,r.current,l,u)})}}(t,U,x,C,P,M,_,q)},onMouseEnter(e){L||"function"!=typeof O||O(e),L&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),$&&F&&(0,p.onNavigationIntent)(e.currentTarget,!0===T)},onTouchStart:function(e){L||"function"!=typeof A||A(e),L&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),$&&F&&(0,p.onNavigationIntent)(e.currentTarget,!0===T)}};return(0,d.isAbsoluteUrl)(U)?K.href=U:L&&!N&&("a"!==a.type||"href"in a.props)||(K.href=(0,f.addBasePath)(U)),s=L?o.default.cloneElement(a,K):(0,i.jsx)("a",{...z,...K,children:r}),(0,i.jsx)(v.Provider,{value:b,children:s})}let v=(0,o.createContext)(p.IDLE_LINK_STATUS),y=()=>(0,o.useContext)(v);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return a}});let r=e.r(71645);function a(e,t){let n=(0,r.useRef)(null),a=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(n.current=s(e,r)),t&&(a.current=s(t,r))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},18967,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return x},NormalizeError:function(){return v},PageNotFoundError:function(){return y},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return s},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return j}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&o.test(e)};function u(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&f(n))return r;if(!r)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return r}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class v extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function j(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return s}});let r=e.r(18967),a=e.r(52817);function s(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,a.hasBasePath)(n.pathname)}catch(e){return!1}}},98183,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={assign:function(){return l},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return o}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});function s(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,i(e));else t.set(n,i(r));return t}function l(e,...t){for(let n of t){for(let t of n.keys())e.delete(t);for(let[t,r]of n.entries())e.append(t,r)}return e}},95057,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return o},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var a in r)Object.defineProperty(n,a,{enumerable:!0,get:r[a]});let s=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function o(e){let{auth:t,hostname:n}=e,r=e.protocol||"",a=e.pathname||"",o=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:n&&(u=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||i.test(r))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),o&&"#"!==o[0]&&(o="#"+o),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${r}${u}${a}${c}${o}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return o(e)}},94859,26478,e=>{"use strict";var t=e.i(43476),n=e.i(52376),r=e.i(25913),a=e.i(49287),s=e.i(56420);let i={name:"user-round",size:24,node:[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],aliases:["user-2"]};i.node;let o=(0,s.default)(i);e.s(["UserRound",0,o],26478);var l=e.i(90063);let u=(0,r.cva)("inline-flex shrink-0 items-center justify-center overflow-hidden font-semibold uppercase select-none",{variants:{kind:{app:"rounded-sm bg-primary text-primary-foreground",account:"rounded-full bg-secondary font-sans text-foreground",ship:"rounded-sm bg-secondary font-mono text-foreground",argo:"rounded-sm bg-highlight text-primary",retired:"rounded-sm border border-dashed border-input font-mono font-medium text-muted-foreground"},size:{20:"size-5 text-micro [&_svg]:size-3",28:"size-7 text-micro [&_svg]:size-(--size-icon-sm)",36:"size-9 text-caption [&_svg]:size-(--size-icon)"}},defaultVariants:{kind:"ship",size:28}});e.s(["Avatar",0,function({kind:e="ship",size:r,name:s="",className:i}){let c=e??"ship";return(0,t.jsx)(n.Avatar.Root,{"aria-hidden":!0,"data-slot":"avatar",className:(0,l.classNames)(u({kind:e,size:r}),i),children:(0,t.jsx)(n.Avatar.Fallback,{children:"app"===c?(0,t.jsx)(a.Ship,{"aria-hidden":!0}):"argo"===c?(0,t.jsx)(o,{"aria-hidden":!0}):s.replaceAll("-","").slice(0,2)})})}],94859)},95960,e=>{"use strict";var t=e.i(43476),n=e.i(92150),r=e.i(49287),a=e.i(86875),s=e.i(63676),i=e.i(90063);let o={"trierarch-plugin":a.ShipWheel,squadrons:n.Boxes,ship:r.Ship};e.s(["LabelChip",0,function({chip:e,onRemove:n,testId:r,className:a,trailing:l}){let u="none"===e.mark?null:o[e.mark],c=`${e.key}=${e.value}`,d="none"===e.mark?"you":e.ownerName;return(0,t.jsxs)("span",{"data-slot":"label-chip","data-testid":r,title:`${c}, by ${d}`,className:(0,i.classNames)("inline-flex h-5.5 max-w-full min-w-0 shrink-0 items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 font-mono text-id whitespace-nowrap text-foreground [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-muted-foreground",a),children:[null===u?null:(0,t.jsx)(u,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e.key,"="]}),(0,t.jsx)("span",{className:"font-medium",children:e.value})]}),l,void 0===n?null:(0,t.jsx)("button",{type:"button","aria-label":`Remove ${c}`,onClick:n,className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(s.X,{"aria-hidden":!0})})]})}])},10649,78608,87851,4032,e=>{"use strict";e.i(31627);var t=e.i(9677),n=e.i(83615),r=e.i(14695);function a(e,t){for(let n of t)e.includes(n)||e.push(n)}function s(e){return Object.fromEntries((e?.options??[]).flatMap(e=>{let t=e.defaultValue??e.values[0];return void 0===t?[]:[[e.name,t]]}))}function i(e){let[t]=e?.repositories??[];if(void 0!==t)return{kind:"worktree",repository:t};let[n]=e?.folders??[];return void 0===n?void 0:{kind:"folder",name:n}}function o(e){let[t]=e;return{harness:t?.harness??"",workspace:i(t),options:s(t),firstPrompt:"",squadron:"",machineLabels:[]}}let l=new TextEncoder;function u(e){return l.encode(e).byteLength}function c(e){return e<1024?`${String(e)} B`:`${(e/1024).toFixed(1).replace(/\.0$/,"")} KB`}e.s(["byteSize",0,c,"defaultValues",0,o,"offersOf",0,function(e){let t=[];for(let n of e)if(!n.isSilent&&null!==n.details)for(let e of n.details.harnesses){let s=t.find(t=>t.harness===e.harness);for(let i of(void 0===s&&(s={harness:e.harness,repositories:[],folders:[],options:[]},t.push(s)),a(s.repositories,n.details.workspaces.repositories),a(s.folders,n.details.workspaces.folders),(0,r.harnessOptions)(e.options))){let e=s.options.find(e=>e.name===i.name);void 0===e?s.options.push({...i,values:[...i.values]}):(a(e.values,i.values),e.defaultValue??=i.defaultValue)}}return t},"promptBytes",0,u,"settingsOf",0,function(e){if(""!==e.harness&&void 0!==e.workspace)return{harness:e.harness,workspace:e.workspace,options:e.options,...""===e.firstPrompt?{}:{firstPrompt:e.firstPrompt},...""===e.squadron?{}:{squadron:e.squadron},...0===e.machineLabels.length?{}:{machineLabels:e.machineLabels.flatMap(e=>{let t=(0,n.idSchema)("labelValue").safeParse(e);return t.success?[t.data]:[]})}}},"settingsRows",0,function(e){let n=t.crewSettingsSchema.safeParse(e);if(!n.success)return;let{harness:r,workspace:a,options:s,firstPrompt:i,squadron:o}=n.data;return[{label:"Harness",value:r??"Trierarch default"},"worktree"===a.kind?{label:"Workspace",value:a.repository,meta:"New worktree"}:{label:"Workspace",value:a.name,meta:"Folder, as it is"},...Object.entries(s).map(([e,t])=>({label:e,value:"string"==typeof t?t:JSON.stringify(t),isMono:!0})),{label:"First prompt",value:void 0===i?null:c(u(i))},{label:"Squadron",value:o??null,isMono:!0}]},"valuesOf",0,function(e,n){let r=t.crewSettingsSchema.safeParse(e);if(!r.success)return o(n);let{harness:a,workspace:s,options:i,firstPrompt:l,squadron:u,machineLabels:c}=r.data;return{harness:a??o(n).harness,workspace:"worktree"===s.kind?{kind:"worktree",repository:s.repository}:{kind:"folder",name:s.name},options:Object.fromEntries(Object.entries(i).flatMap(([e,t])=>"string"==typeof t?[[e,t]]:[])),firstPrompt:l??"",squadron:u??"",machineLabels:[...c??[]]}},"withHarness",0,function(e,t){let{harness:n,offers:r}=t,a=r.find(e=>e.harness===n),o=e.workspace,l=void 0!==o&&("worktree"===o.kind?a?.repositories.includes(o.repository)??!1:a?.folders.includes(o.name)??!1);return{...e,harness:n,workspace:l?o:i(a),options:s(a)}}],10649);var d=e.i(80581);function f(e,t){return e.ships.find(e=>e.id===t.shipId)?.labels.map(e=>e.valueId)??[]}function h(e){return 1===e?{these:"this label",carries:"carries it"}:2===e?{these:"both",carries:"carries both"}:{these:"these labels",carries:"carries them all"}}e.s(["machineLabelIdsOf",0,function(e){let n=t.crewSettingsSchema.safeParse(e);return n.success?[...n.data.machineLabels??[]]:[]},"machineLabelsInputOf",0,function(e,t){return{groups:function(e,t){let n=t.map(t=>f(e,t)),r=[],a=[];for(let t of e.labels){let s=t.values.map(e=>({valueId:e.id,value:e.value,shipCount:n.filter(t=>t.includes(e.id)).length})),i={labelId:t.id,key:t.key,mark:e.ownerOf.get(t.id)?.mark??"ship",values:s};(s.some(e=>e.shipCount>0)?r:a).push(i)}let s=(e,t)=>e.key.localeCompare(t.key);return[{title:"On machines",keys:r.toSorted(s)},{title:"On no machine yet",keys:a.toSorted(s)}].filter(e=>e.keys.length>0)}(e,t),chipsOf:t=>(0,d.pickedChips)(t,e),matchOf:n=>{var r;return{matching:(r={machines:t,valueIds:n}).machines.filter(t=>{let n=f(e,t);return r.valueIds.every(e=>n.includes(e))}).map(e=>e.name),total:r.machines.length}}}},"machineLabelsText",0,function(e){let t=e.map(e=>`${e.key}=${e.value}`);return t.length<=2?t.join(" and "):`${t.slice(0,-1).join(", ")} and ${t.at(-1)??""}`},"noMatchWords",0,h],78608);var p=e.i(43476),m=e.i(93669),g=e.i(22768),b=e.i(74544),v=e.i(77071),y=e.i(63676),x=e.i(22016),k=e.i(71645),j=e.i(15905),S=e.i(6734),w=e.i(95960),N=e.i(92150),C=e.i(24071),I=e.i(67927),P=e.i(66595),E=e.i(49287),O=e.i(86875),A=e.i(90063),L=e.i(12470);let M={"trierarch-plugin":O.ShipWheel,squadrons:N.Boxes,ship:E.Ship};function _(e,t){return`${String(e)} ${1===e?t:`${t}s`}`}function R({groups:e,pickedValueIds:t,onPick:n,size:r="sm",pickedWord:a="Picked",countWord:s="ship"}){let[i,o]=(0,k.useState)(""),[l,u]=(0,k.useState)(void 0),c="touch"===r,d=(0,A.classNames)("flex w-full items-center gap-2 rounded-sm px-2 text-left hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50",c?"min-h-(--size-control-touch) text-body-touch":"h-(--size-control-sm) text-body");if(void 0!==l)return(0,p.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"label-picker-values",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[(0,p.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-sm px-1 font-mono text-body hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring [&_svg]:size-(--size-icon-sm)",onClick:()=>{u(void 0)},"aria-label":`Back to the keys, from ${l.key}`,children:[(0,p.jsx)(C.ChevronLeft,{"aria-hidden":!0}),l.key,"="]}),(0,p.jsxs)("span",{className:"text-meta text-muted-foreground",children:["ship"===s?"Ships":"Machines"," with each"]})]}),(0,p.jsx)("ul",{className:"flex flex-col",children:l.values.map(e=>{let r=t.includes(e.valueId);return(0,p.jsx)("li",{children:(0,p.jsxs)("button",{type:"button",className:d,disabled:r,"data-testid":"label-picker-value",onClick:()=>{n(e.valueId),u(void 0),o("")},children:[(0,p.jsx)("span",{className:"min-w-0 grow truncate font-mono",children:e.value}),(0,p.jsx)("span",{className:"shrink-0 text-meta text-muted-foreground tabular-nums",children:r?a:_(e.shipCount,s)})]})},e.valueId)})})]});let f=i.trim().toLowerCase(),h=e.map(e=>({...e,keys:e.keys.filter(e=>""===f||e.key.includes(f))})).filter(e=>e.keys.length>0);return(0,p.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"label-picker",children:[(0,p.jsx)(L.Input,{type:"search","aria-label":"Find a key",placeholder:"Find a key",size:c?"touch":"md",leadingIcon:(0,p.jsx)(P.Search,{}),value:i,onChange:e=>{o(e.target.value)}}),0===h.length?(0,p.jsx)("p",{className:"px-2 py-3 text-meta text-muted-foreground",children:0===e.length?"The fleet has no labels yet.":`No key matches “${i.trim()}”.`}):h.map(e=>(0,p.jsxs)("div",{className:"flex flex-col",children:[(0,p.jsx)("span",{className:"px-2 pt-1 pb-0.5 text-caption text-muted-foreground",children:e.title}),(0,p.jsx)("ul",{className:"flex flex-col",children:e.keys.map(e=>{let t="none"===e.mark?null:M[e.mark];return(0,p.jsx)("li",{children:(0,p.jsxs)("button",{type:"button",className:(0,A.classNames)(d,"[&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground"),"data-testid":"label-picker-key",onClick:()=>{u(e)},children:[null===t?null:(0,p.jsx)(t,{"aria-hidden":!0}),(0,p.jsx)("span",{className:"font-mono",children:e.key}),(0,p.jsx)("span",{className:"min-w-0 grow truncate text-meta text-muted-foreground",children:_(e.values.length,"value")}),(0,p.jsx)(I.ChevronRight,{"aria-hidden":!0})]})},e.labelId)})})]},e.title))]})}function T({groups:e,picked:t,isDisabled:n,onAdd:r}){let[a,s]=(0,k.useState)(!1);return(0,p.jsxs)(S.Popover,{open:a,onOpenChange:s,children:[(0,p.jsx)(S.PopoverTrigger,{render:(0,p.jsx)(j.Button,{type:"button",variant:"ghost",size:"xs",icon:(0,p.jsx)(v.Plus,{}),disabled:n,"data-testid":"machine-labels-add"}),children:"Add label"}),(0,p.jsxs)(S.PopoverContent,{align:"start",sideOffset:6,className:"w-80 p-2","data-testid":"machine-labels-popover",children:[(0,p.jsx)("span",{className:"block px-2 pt-1 pb-2 text-body font-medium",children:"Machine label"}),(0,p.jsx)(R,{groups:e,pickedValueIds:t.map(e=>e.valueId),countWord:"machine",onPick:e=>{s(!1),r(e)}}),(0,p.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,p.jsx)(x.default,{href:"/labels",className:"font-medium text-foreground hover:underline",children:"Manage labels"})]})]})]})}e.s(["LabelPicker",0,R],87851),e.s(["MachineLabelsField",0,function({shipName:e,picked:t,groups:n,match:r,isDisabled:a,onAdd:s,onRemove:i,unknown:o=[],onRemoveUnknown:l}){let u=h(t.length);return(0,p.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"machine-labels",children:[(0,p.jsxs)("span",{className:"text-body font-medium",children:["Machine labels",(0,p.jsx)("span",{className:"font-normal text-muted-foreground",children:" optional"})]}),(0,p.jsxs)("div",{className:"flex min-h-(--size-control-sm) flex-wrap items-center gap-1.5",children:[0===t.length?(0,p.jsx)("span",{className:"text-meta text-muted-foreground",children:"Any machine"}):null,t.map((e,t)=>(0,p.jsxs)(k.Fragment,{children:[0===t?null:(0,p.jsx)("span",{className:"text-meta text-muted-foreground",children:"and"}),(0,p.jsx)(w.LabelChip,{chip:e,testId:"machine-label",...a?{}:{onRemove:()=>{i(e.valueId)}}})]},e.valueId)),o.map(e=>(0,p.jsxs)("span",{"data-testid":"machine-label-unknown",title:`${e}: not in this fleet`,className:"inline-flex h-5.5 items-center gap-1 rounded-sm border border-tone-attention-border bg-tone-attention-bg px-1.5 font-mono text-id text-tone-attention-fg [&_svg]:size-3",children:[(0,p.jsx)(g.CircleAlert,{"aria-hidden":!0}),e,void 0===l||a?null:(0,p.jsx)("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>{l(e)},className:"-mr-1 ml-0.5 inline-flex size-4 items-center justify-center rounded-xs hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",children:(0,p.jsx)(y.X,{"aria-hidden":!0})})]},e)),t.length+o.length>=m.SHIP_LABELS_MAX?null:(0,p.jsx)(T,{groups:n,picked:t,isDisabled:a,onAdd:s})]}),0===o.length?null:(0,p.jsxs)("p",{role:"alert","data-testid":"machine-labels-unknown-note",className:"text-meta text-tone-attention-fg",children:["Not in this fleet: ",o.join(", "),". Forming refuses ",1===o.length?"it":"them",": define ",1===o.length?"it":"them"," on the Labels page, or remove ",1===o.length?"it":"them"," here."]}),0===t.length?null:0===r.matching.length?(0,p.jsxs)("p",{role:"status","data-testid":"machine-labels-match",className:"flex items-start gap-2 rounded-lg border border-tone-waiting-border bg-tone-waiting-bg px-3 py-2 text-meta text-tone-waiting-fg [&_svg]:mt-0.5 [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",children:[(0,p.jsx)(b.Clock,{"aria-hidden":!0}),(0,p.jsxs)("span",{children:["No machine matches ",u.these,". You can still request: it waits on Needs crew until a machine ",u.carries,"."]})]}):(0,p.jsxs)("p",{className:"text-meta","data-testid":"machine-labels-match",children:["Matches ",r.matching.length," of ",r.total," ",1===r.total?"machine":"machines",": ",r.matching.join(", "),"."]}),(0,p.jsxs)("p",{className:"text-meta text-muted-foreground",children:["The plugin places ",e," only on a machine that carries every label here. Leave it empty for any machine."]})]})}],4032)},66616,e=>{"use strict";let t={"claude-code":{word:"Claude Code",kind:"coding"},codex:{word:"Codex",kind:"coding"},"claude-chat":{word:"Claude chat",kind:"chat"},chatgpt:{word:"ChatGPT",kind:"chat"},grok:{word:"Grok",kind:"chat"},grokbot:{word:"Grokbot",kind:"bot"},console:{word:"Console",kind:"console"}};function n(e){return t[e]?.word??e}e.s(["crewLineHarnessWord",0,function(e){return"chat"===e?"Chat":n(e)},"harnessKind",0,function(e){return t[e]?.kind},"harnessWord",0,n])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69644,69846,e=>{"use strict";var t=e.i(56420);let i={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};i.node;let s=(0,t.default)(i);e.s(["FolderOpen",0,s],69644);let n={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};n.node;let a=(0,t.default)(n);e.s(["GitBranch",0,a],69846)},83035,e=>{"use strict";var t=e.i(56420);let i={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};i.node;let s=(0,t.default)(i);e.s(["SquareTerminal",0,s],83035)},27290,e=>{"use strict";var t=e.i(43476),i=e.i(77071),s=e.i(71645),n=e.i(66390),a=e.i(15905),r=e.i(44824),o=e.i(45608),l=e.i(95475),d=e.i(2767);e.i(31627);var c=e.i(44827),h=e.i(22768),m=e.i(85595),u=e.i(16984),x=e.i(10818),p=e.i(90063),g=e.i(65160),f=e.i(91703),j=e.i(22212),v=e.i(94945),b=e.i(12470),y=e.i(91727),w=e.i(56478),C=e.i(17981);function N({activeNames:e,isPending:i,error:n,onSubmit:r}){let o=(0,s.useId)(),l=(0,s.useId)(),[d,h]=(0,s.useState)(""),x=(0,g.checkShipName)(d,{activeNames:e}),f="invalid"===x.kind||"reserved"===x.kind||"taken"===x.kind,v="available"===x.kind;return(0,t.jsxs)("form",{noValidate:!0,className:"contents",onSubmit:e=>{e.preventDefault(),v&&r(d)},children:[(0,t.jsxs)(j.DialogHeader,{children:[(0,t.jsx)(j.DialogTitle,{children:"Join a machine"}),(0,t.jsx)(j.DialogDescription,{children:"The trierarch plugin commissions a trierarch ship of this name. You then run its setup line on the machine, and the trierarch there starts sessions for the crew requests it is given."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,t.jsx)(y.Label,{htmlFor:o,children:"Name"}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground tabular-nums",children:[d.length," / ",c.SHIP_HANDLE_MAX_LENGTH]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(b.Input,{id:o,isMono:!0,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"trierarch-mac","data-testid":"join-machine-name","aria-invalid":!!f||void 0,"aria-describedby":l,className:"pr-9 max-sm:h-(--size-control-touch) max-sm:text-input-touch",value:d,onChange:e=>{h((0,g.asHandle)(e.target.value))}}),"available"===x.kind?(0,t.jsx)(m.CircleCheck,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-tone-ok-fg"}):f?(0,t.jsx)(u.CircleX,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-destructive-text"}):null]}),(0,t.jsx)("p",{id:l,"aria-live":"polite",className:(0,p.classNames)("text-meta",f?"text-destructive-text":"text-muted-foreground"),children:x.message})]}),void 0===n?null:(0,t.jsx)(C.InlineError,{title:"Couldn’t join the machine",description:`${n} Nothing changed.`}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(j.DialogClose,{render:(0,t.jsx)(a.Button,{type:"button",disabled:i}),children:"Cancel"}),(0,t.jsx)(a.Button,{type:"submit",variant:"primary",isLoading:i,disabled:!v,"data-testid":"join-machine-submit",children:i?"Joining":"Join machine"})]})]})}function k({joined:e}){let[i,n]=(0,s.useState)(!1),r=()=>{n(!1)},o=()=>{n(!0)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(j.DialogHeader,{children:[(0,t.jsxs)(j.DialogTitle,{children:[e.name," joined"]}),(0,t.jsxs)(j.DialogDescription,{children:["Run the setup line on the machine. It installs the trierarch, which then crews ",e.name," and reports what the machine offers."]})]}),(0,t.jsxs)("p",{className:"flex gap-2 rounded-lg border border-border bg-muted px-3 py-2 text-meta text-foreground",children:[(0,t.jsx)(x.Info,{"aria-hidden":!0,className:"mt-0.5 size-(--size-icon-sm) shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-medium",children:"Shown once. Copy it now."})," It carries the ship’s secret. If you lose it, get a new starting prompt on ",e.name,"’s ship page."]})]}),(0,t.jsx)(f.CodeBlock,{label:"Setup line",code:e.setupLine,isWrapped:!0,copyLabel:`Copy the setup line for ${e.name}`,codeTestId:"join-machine-setup-line",copyTestId:"join-machine-setup-line-copy",onCopied:r,onCopyFailed:o}),(0,t.jsx)(f.CodeBlock,{label:`Starting prompt for ${e.name}`,code:e.prompt,isWrapped:!0,copyLabel:`Copy the starting prompt for ${e.name}`,codeTestId:"join-machine-prompt",onCopied:r,onCopyFailed:o}),(0,t.jsx)(w.CrewLines,{crewLines:e.crewLines,subject:e.name,testIdPrefix:"join-machine-crew-line",onCopied:r,onCopyFailed:o}),(0,t.jsx)("p",{role:"status",className:"flex items-center gap-1.5 text-meta text-destructive-text empty:hidden",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.CircleAlert,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),"Could not copy: select the text and copy it by hand."]}):null}),(0,t.jsx)(j.DialogFooter,{children:(0,t.jsx)(j.DialogClose,{render:(0,t.jsx)(a.Button,{variant:"primary"}),children:"Done"})})]})}function S(e){let{isOpen:i,onOpenChange:s,isPending:n,joined:a}=e;return(0,t.jsx)(j.Dialog,{open:i,onOpenChange:e=>{n||s(e)},children:(0,t.jsx)(j.DialogContent,{size:"md","data-testid":"join-machine-dialog",className:v.dialogSurface.phoneFullScreen,children:void 0===a?(0,t.jsx)(N,{...e}):(0,t.jsx)(k,{joined:a})})})}var T=e.i(42383),z=e.i(87792),L=e.i(90262),B=e.i(88721),I=e.i(5387),D=e.i(86413),$=e.i(18423),A=e.i(28459),O=e.i(96676),F=e.i(3979),M=e.i(78485),q=e.i(265);e.s(["default",0,function(){let e=(0,O.useNow)(),c=(0,B.useAccountMenu)(e),h=(0,D.useOpenInboxCount)(),m=(0,A.useNeedsAttention)(),u=(0,A.useAttentionCount)(),x=(0,$.useLiveFleet)(),p=(0,I.useFleetSnapshot)(),g=(0,q.useTrierarchPluginConnection)(),f=(0,q.useMachines)(),j=(0,q.useTrierarchPluginVersion)(),v=(0,q.useJoinMachine)(),b=(0,L.useAccess)(),y=(0,F.usePluginNav)(),[w,C]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1),[_,W]=(0,s.useState)(!1);(0,M.useSignInWhenSessionEnds)([m.error,x.error]);let H=b.canManage&&"connected"===g,P=()=>{v.reset(),C(!0)};return(0,t.jsxs)(z.ListLayout,{title:"Trierarchs",titleMeta:void 0===j?void 0:(0,t.jsxs)(n.Badge,{variant:"outline","data-testid":"trierarchs-plugin-version",children:["trierarch plugin ",j]}),description:"none"===g?"Not set up.":"Machines that run sessions for crew requests. The plugin picks a trierarch for each request.",live:x.live,nav:{active:"trierarchs",inboxCount:h,attentionCount:u,...y},primaryAction:H?(0,t.jsx)(a.Button,{variant:"primary",icon:(0,t.jsx)(i.Plus,{"aria-hidden":!0}),onClick:P,"data-testid":"trierarchs-join",children:"Join a machine"}):void 0,onCompose:b.canSend?()=>{k(!0)}:void 0,onSearch:()=>{W(!0)},account:c,banner:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.ConsoleNotices,{}),(0,t.jsx)(l.ConsoleGuide,{})]}),children:[(0,t.jsx)(T.MachineList,{connection:g,machines:f.data,ships:p.data??[],error:f.isError?f.error.message:void 0,onRetry:()=>{f.refetch()},onJoin:H?P:void 0,now:e}),H&&(0,t.jsx)(S,{activeNames:(p.data??[]).filter(e=>"retired"!==e.status).map(e=>e.name),isOpen:w,onOpenChange:e=>{C(e),e||v.reset()},isPending:v.isPending,error:v.error?.message,joined:v.data,onSubmit:e=>{v.mutate(e)}}),(0,t.jsx)(r.ComposeMessage,{isOpen:N,onOpenChange:k}),(0,t.jsx)(o.ConsoleCommands,{isOpen:_,onOpenChange:W,onCompose:()=>{k(!0)}})]})}],27290)},91703,e=>{"use strict";var t=e.i(43476),i=e.i(83035),s=e.i(90063),n=e.i(61966);e.s(["CodeBlock",0,function({label:e,code:a,isWrapped:r=!1,copyValue:o,copyLabel:l=`Copy ${e.toLowerCase()}`,onCopied:d,onCopyFailed:c,codeTestId:h,copyTestId:m}){return(0,t.jsxs)("div",{"data-slot":"code-block",className:"overflow-hidden rounded-lg border border-border bg-muted",children:[(0,t.jsxs)("div",{className:"flex h-9 items-center justify-between gap-2 border-b border-border pr-1.5 pl-3",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-caption text-muted-foreground",children:[(0,t.jsx)(i.SquareTerminal,{"aria-hidden":!0,className:"size-(--size-icon-sm) shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e})]}),(0,t.jsx)(n.CopyButton,{value:o??a,label:l,isLabeled:!0,onCopied:d,onCopyFailed:c,"data-testid":m})]}),(0,t.jsx)("pre",{"data-testid":h,className:(0,s.classNames)("overflow-x-auto px-3 py-3 font-mono text-code text-foreground",r?"break-all whitespace-pre-wrap":"whitespace-pre"),children:a})]})}])},61966,8734,e=>{"use strict";var t=e.i(43476),i=e.i(89664),s=e.i(56420);let n={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};n.node;let a=(0,s.default)(n);e.s(["Copy",0,a],8734);var r=e.i(71645),o=e.i(15905);e.s(["CopyButton",0,function({value:e,label:s,size:n="xs",isLabeled:l=!1,onCopied:d,onCopyFailed:c,className:h,"data-testid":m}){let[u,x]=(0,r.useState)(!1);async function p(){try{await navigator.clipboard.writeText(e)}catch{c?.();return}x(!0),d?.(),setTimeout(()=>{x(!1)},1500)}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Button,{variant:"ghost",size:n,isIconOnly:!l,"aria-label":s,title:l?void 0:s,icon:u?(0,t.jsx)(i.Check,{"aria-hidden":!0}):(0,t.jsx)(a,{"aria-hidden":!0}),className:h,"data-testid":m,onClick:()=>{p()},children:l?u?"Copied":"Copy":null}),(0,t.jsx)("span",{role:"status",className:"sr-only",children:u?"Copied.":""})]})}],61966)},54422,e=>{"use strict";var t=e.i(43476),i=e.i(90063),s=e.i(14695);let n={running:"bg-tone-ok-fg",crewing:"bg-tone-active-fg",releasing:"bg-tone-active-fg",restarting:"bg-tone-waiting-fg",crashed:"bg-tone-attention-fg"};e.s(["CapacityBar",0,function({spots:e,caps:a,unknownText:r="Unknown",testId:o}){let l=(0,s.capacityLine)(e,a);if(void 0===a||void 0===l)return(0,t.jsx)("span",{"data-testid":o,className:"text-meta text-muted-foreground",children:r});let d=Math.max(0,a.ships-e.length);return(0,t.jsxs)("span",{role:"img","aria-label":l,"data-testid":o,className:"inline-flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[e.map((e,s)=>(0,t.jsx)("span",{title:`Spot ${String(s+1)}: ${e.name}, ${e.status}`,className:(0,i.classNames)("h-2 w-3 rounded-xs",n[e.status])},e.shipId)),Array.from({length:d},(i,s)=>(0,t.jsx)("span",{title:`Spot ${String(e.length+s+1)}: vacant`,className:"h-2 w-3 rounded-xs border border-input"},`free-${String(s)}`))]}),(0,t.jsx)("span",{className:"text-meta tabular-nums",children:l})]})}])},56478,e=>{"use strict";var t=e.i(43476),i=e.i(66616),s=e.i(91703);e.s(["CrewLines",0,function({crewLines:e,subject:n,testIdPrefix:a,onCopied:r,onCopyFailed:o}){return e.map(({harness:e,line:l})=>(0,t.jsx)(s.CodeBlock,{label:`Crew line, ${(0,i.harnessWord)(e)} with the aeolus plugin`,code:l,isWrapped:!0,copyLabel:`Copy the ${(0,i.harnessWord)(e)} crew line for ${n}`,codeTestId:`${a}-${e}`,copyTestId:`${a}-${e}-copy`,onCopied:r,onCopyFailed:o},e))}])},42383,94313,e=>{"use strict";var t=e.i(43476),i=e.i(77071),s=e.i(86875),n=e.i(94831),a=e.i(22016),r=e.i(14695),o=e.i(31513),l=e.i(15905),d=e.i(67874),c=e.i(17981),h=e.i(88393),m=e.i(71567),u=e.i(52886),x=e.i(69644),p=e.i(69846),g=e.i(66787),f=e.i(66616),j=e.i(49635),v=e.i(66390),b=e.i(54422),y=e.i(63481);let w={alive:"border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg",silent:"border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg","not-started":"border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg"},C={alive:"Alive",silent:"Not answering","not-started":"Not started"};function N({machine:e,now:i}){let n=(0,r.machineLiveness)(e),a=null===e.lastSeenAt?null:new Date(e.lastSeenAt);return(0,t.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-x-2 gap-y-1 text-meta","data-testid":"machine-liveness","data-liveness":n,children:[(0,t.jsxs)(v.Badge,{variant:"outline",className:w[n],children:["alive"===n?(0,t.jsx)(s.ShipWheel,{"aria-hidden":!0}):(0,t.jsx)(u.CircleDashed,{"aria-hidden":!0}),C[n]]}),null===a?(0,t.jsx)("span",{className:"text-muted-foreground",children:"· run its setup line on the machine"}):(0,t.jsxs)("time",{dateTime:e.lastSeenAt??void 0,title:(0,j.fullDateTime)(a),className:"text-muted-foreground tabular-nums",children:["· ","silent"===n?`since ${(0,j.clockTime)(a)}`:(0,j.lastSeen)(a,i).replace("Last seen","seen")]})]})}function k(e,t){let i=(0,j.relativeTime)(e,t);return"Just now"===i?"just now":i}function S({title:e,children:i,className:s}){return(0,t.jsxs)("div",{className:`flex min-w-0 flex-col gap-2 px-4.5 py-4 ${s??""}`,children:[(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:e}),i]})}function T({harness:e}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border py-2.5 first-of-type:border-t-0 first-of-type:pt-0",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-body font-medium [&_svg]:size-(--size-icon-sm) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(m.Bot,{"aria-hidden":!0}),(0,f.harnessWord)(e.harness)]}),(0,r.harnessOptions)(e.options).map(e=>(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-meta",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:e.name}),e.values.map(i=>(0,t.jsxs)("span",{className:"font-mono text-id whitespace-nowrap",children:[i,i===e.defaultValue?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:" (default)"}):null]},i))]},e.name)),0===e.flags.length?null:(0,t.jsx)("span",{className:"flex flex-wrap items-center gap-1.5",children:e.flags.map(i=>e.riskyFlags?.includes(i)===!0?(0,t.jsxs)("code",{"data-testid":"machine-risky-flag",title:"Risky: every launch runs without its harness's safeguards",className:"inline-flex items-center gap-1 rounded-sm border border-tone-waiting-border bg-tone-waiting-bg px-1.5 font-mono text-id text-tone-waiting-fg [&_svg]:size-(--size-icon-sm)",children:[(0,t.jsx)(g.TriangleAlert,{"aria-hidden":!0}),i,(0,t.jsx)("span",{className:"sr-only",children:" (risky)"})]},i):(0,t.jsx)("code",{className:"rounded-sm bg-muted px-1.5 font-mono text-id",children:i},i))})]})}function z({title:e,icon:i,names:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-caption text-muted-foreground",children:e}),0===s.length?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"None"}):s.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0 [&_svg]:text-muted-foreground",children:[i,e]},e))]})}function L({workspaces:e}){return(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(z,{title:"Repositories · a new worktree per ship",icon:(0,t.jsx)(p.GitBranch,{"aria-hidden":!0}),names:e.repositories}),(0,t.jsx)(z,{title:"Folders · used as they are",icon:(0,t.jsx)(x.FolderOpen,{"aria-hidden":!0}),names:e.folders})]})}function B({machine:e,spots:i,location:n,now:r}){let{details:o,report:l}=e,d=null===l?null:new Date(l.reportedAt);return(0,t.jsxs)("section",{"aria-label":e.name,"data-testid":"machine-card",className:"grid grid-cols-[minmax(0,18.75rem)_minmax(0,1.25fr)_minmax(0,1fr)] divide-x divide-border rounded-lg border border-border bg-card shadow-sm max-lg:grid-cols-1 max-lg:divide-x-0 max-lg:divide-y",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2.5 px-4.5 py-4",children:[(0,t.jsxs)(a.default,{href:`/trierarchs/${e.shipId}`,"data-testid":"machine-card-name",className:"inline-flex items-center gap-2 text-section font-semibold hover:underline [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground",children:[(0,t.jsx)(s.ShipWheel,{"aria-hidden":!0}),e.name]}),(0,t.jsx)(N,{machine:e,now:r}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(y.LocationTag,{kind:n?.kind??null,description:n?.description}),null===o?null:(0,t.jsxs)("span",{className:"font-mono text-id",children:["· trierarch ",o.version]})]}),(0,t.jsx)("div",{role:"separator",className:"h-px bg-border"}),(0,t.jsx)("span",{className:"text-caption font-medium text-muted-foreground",children:"Capacity"}),(0,t.jsx)(b.CapacityBar,{spots:i,caps:o?.caps,testId:"machine-card-capacity",unknownText:null===d?"Unknown until it answers":`Unknown since ${(0,j.clockTime)(d)}`}),null===d?null:(0,t.jsxs)("time",{dateTime:l?.reportedAt,title:(0,j.fullDateTime)(d),className:"text-meta text-muted-foreground",children:["Last answer ",k(d,r)]})]}),(0,t.jsx)(S,{title:"Harnesses, options and flags",children:null===o?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):o.harnesses.map(e=>(0,t.jsx)(T,{harness:e},e.harness))}),(0,t.jsx)(S,{title:"Workspaces",children:null===o?(0,t.jsx)("span",{className:"text-meta text-muted-foreground",children:"Unknown until it answers"}):(0,t.jsx)(L,{workspaces:o.workspaces})})]})}e.s(["HarnessOffer",0,T,"MachineCard",0,B,"MachineLiveness",0,N,"WorkspaceOffer",0,L,"lastAnswer",0,k],94313);let I=`${o.SOURCE_URL}/tree/main/packages/trierarch-plugin#readme`;e.s(["MachineList",0,function({connection:e,machines:o,ships:m,error:u,onRetry:x,onJoin:p,now:g}){return"none"===e?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(s.ShipWheel,{"aria-hidden":!0}),title:"The trierarch plugin is not set up for this fleet",description:"Crew requests work without it: they wait on Needs crew and you crew each ship by hand with its starting prompt. With the plugin, trierarchs on your machines start, restart and stop those sessions for you.",action:(0,t.jsx)(l.Button,{nativeButton:!1,render:({children:e,...i})=>(0,t.jsx)("a",{href:I,target:"_blank",rel:"noreferrer",...i,children:e}),"data-testid":"trierarchs-setup",children:"How to set up the trierarch plugin"})}):"not-connected"===e?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(n.Unplug,{"aria-hidden":!0}),title:"The trierarch plugin is not connected",description:"Connect it in Settings; its machines show up here then.",action:(0,t.jsx)(l.Button,{nativeButton:!1,render:(0,t.jsx)(a.default,{href:"/settings"}),"data-testid":"trierarchs-open-settings",children:"Open Settings"})}):void 0!==u?(0,t.jsx)(c.InlineError,{variant:"page",title:"Couldn’t read the machines",description:"Nothing changed.",detail:u,onRetry:x}):void 0===o||"unknown"===e?(0,t.jsx)(h.LoadingSkeleton,{variant:"cards",rows:2,label:"Loading the machines"}):0===o.length?(0,t.jsx)(d.EmptyState,{icon:(0,t.jsx)(s.ShipWheel,{"aria-hidden":!0}),title:"No machines yet",description:"Join a machine: its trierarch then starts sessions there for the crew requests the plugin gives it.",action:p?(0,t.jsx)(l.Button,{variant:"primary",icon:(0,t.jsx)(i.Plus,{"aria-hidden":!0}),onClick:p,"data-testid":"trierarchs-join-empty",children:"Join a machine"}):void 0}):(0,t.jsx)("div",{className:"flex flex-col gap-4","data-testid":"machine-list",children:o.map(e=>(0,t.jsx)(B,{machine:e,spots:(0,r.spotsOf)(e,m),location:m.find(t=>t.id===e.shipId)?.location??null,now:g},e.shipId))})}],42383)},87792,e=>{"use strict";var t=e.i(43476),i=e.i(19759),s=e.i(15905),n=e.i(77880),a=e.i(36779),r=e.i(15034),o=e.i(85538);e.s(["ListLayout",0,function({title:e,description:l,titleMeta:d,primaryAction:c,toolbar:h,live:m,nav:u,onCompose:x,onSearch:p,account:g,banner:f,children:j}){return(0,t.jsxs)("div",{className:"flex min-h-dvh bg-background",children:[(0,t.jsx)(a.Sidebar,{active:u.active,inboxCount:u.inboxCount,attentionCount:u.attentionCount,needsCrewCount:u.needsCrewCount,hasSquadrons:u.hasSquadrons,hasTrierarchs:u.hasTrierarchs,trierarchsCount:u.trierarchsCount,hasSettings:u.hasSettings,...g}),(0,t.jsxs)("div",{className:"flex min-w-0 grow flex-col",children:[(0,t.jsx)(n.Header,{breadcrumb:e,live:m,onCompose:x,onSearch:p}),f,(0,t.jsx)(o.TopBar,{title:e,live:m,account:g,onSearch:p,actions:x?(0,t.jsx)(s.Button,{variant:"ghost",size:"touch",isIconOnly:!0,"aria-label":"Compose","data-testid":"top-bar-compose",onClick:x,children:(0,t.jsx)(i.SquarePen,{"aria-hidden":!0})}):void 0}),(0,t.jsxs)("main",{className:"flex grow flex-col gap-5 px-8 py-6 max-sm:gap-3.5 max-sm:px-4 max-sm:pt-3.5 max-sm:pb-[calc(var(--size-tabbar)+var(--spacing)*4)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 max-sm:gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.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}),d]}),l?(0,t.jsx)("p",{className:"text-meta text-muted-foreground max-sm:text-body-touch",children:l}):null]}),c?(0,t.jsx)("div",{className:"shrink-0 max-sm:w-full max-sm:[&>*]:w-full",children:c}):null]}),h,j]})]}),(0,t.jsx)(r.TabBar,{active:"overview"===u.active||"needs-crew"===u.active?"fleet":"settings"===u.active?void 0:u.active,hasSquadrons:u.hasSquadrons,hasTrierarchs:u.hasTrierarchs,trierarchsCount:u.trierarchsCount,inboxCount:u.inboxCount,attentionCount:u.attentionCount})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19249,e=>{"use strict";var t=e.i(43476),a=e.i(90063);let n={"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 s({health:e}){return(0,t.jsx)("span",{"aria-hidden":!0,className:(0,a.classNames)("size-2 shrink-0 rounded-full",n[e].dot)})}e.s(["HealthIndicator",0,function({health:e,detail:i,className:o}){return(0,t.jsxs)("span",{"data-slot":"health-indicator","data-health":e,className:(0,a.classNames)("inline-flex items-center gap-1.5 text-meta",o),children:[(0,t.jsx)(s,{health:e}),(0,t.jsx)("span",{className:(0,a.classNames)("font-medium",n[e].text),children:n[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,a.classNames)("inline-flex flex-wrap items-center gap-x-3 gap-y-1 text-meta",i),children:e.map(({health:e,count:a})=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(s,{health:e}),(0,t.jsxs)("span",{children:[a," ",n[e].label.toLowerCase()]})]},e))})}])},33939,e=>{"use strict";var t=e.i(43476),a=e.i(94831),n=e.i(22016),s=e.i(15905),i=e.i(67874);e.s(["SquadronsNotConnected",0,function(){return(0,t.jsx)(i.EmptyState,{icon:(0,t.jsx)(a.Unplug,{"aria-hidden":!0}),title:"Squadrons is not connected",description:"Connect it in Settings; squadrons, blueprints and templates show up here then.",action:(0,t.jsx)(s.Button,{nativeButton:!1,render:(0,t.jsx)(n.default,{href:"/settings"}),"data-testid":"squadrons-open-settings",children:"Open Settings"})})}])},67551,e=>{"use strict";var t=e.i(43476),a=e.i(56420);let n={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};n.node;let s=(0,a.default)(n);var i=e.i(31458),o=e.i(71645),r=e.i(90063),d=e.i(66390);function l({name:e,count:a,onHover:n}){let s={onPointerEnter:()=>{n(e)},onPointerLeave:()=>{n(void 0)}};return"flagship"===e?(0,t.jsxs)(d.Badge,{variant:"kind",...s,children:[(0,t.jsx)(i.Flag,{"aria-hidden":!0}),"flagship"]}):(0,t.jsxs)(d.Badge,{variant:"type",...s,children:[e,void 0!==a&&a>1&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:["×",a]})]})}e.s(["HandoffWiring",0,function({blueprint:e}){let[a,n]=(0,o.useState)(void 0),i=new Map(e.roles.map(e=>[e.name,e.count]));return(0,t.jsxs)("section",{"aria-labelledby":"handoff-wiring","data-testid":"handoff-wiring",className:"flex flex-col gap-2 rounded-lg border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{id:"handoff-wiring",className:"text-body font-semibold",children:"Hand-offs"}),(0,t.jsxs)("span",{className:"text-meta text-muted-foreground",children:["from blueprint ",e.name," v",e.version]})]}),0===e.handoffs.length?(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"No hand-offs. Members only hear from the flagship and from each other by name."}):(0,t.jsx)("ul",{className:"grid grid-cols-[auto_auto_1fr] items-center gap-x-4 text-meta",children:e.handoffs.map(e=>(0,t.jsxs)("li",{"data-testid":"handoff-row",className:(0,r.classNames)("col-span-3 grid grid-cols-subgrid items-center rounded-md px-1.5 py-1",void 0!==a&&(e.role===a||e.to===a)?"bg-muted":void 0),children:[(0,t.jsx)("span",{children:(0,t.jsx)(l,{name:e.role,count:i.get(e.role),onHover:n})}),(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-muted-foreground",children:[e.handoff,(0,t.jsx)(s,{"aria-label":"goes to",className:"size-(--size-icon-sm)"})]}),(0,t.jsx)("span",{children:(0,t.jsx)(l,{name:e.to,count:i.get(e.to),onHover:n})})]},`${e.role}.${e.handoff}`))})]})}],67551)},274,e=>{"use strict";var t=e.i(43476),a=e.i(77880),n=e.i(36779),s=e.i(15034),i=e.i(85538);e.s(["DetailLayout",0,function({title:e,parents:o,header:r,children:d,sheet:l,live:c,nav:h,onCompose:m,onSearch:u,account:x,banner:f}){return(0,t.jsxs)("div",{className:"flex min-h-dvh bg-background",children:[(0,t.jsx)(n.Sidebar,{active:h.active,inboxCount:h.inboxCount,attentionCount:h.attentionCount,needsCrewCount:h.needsCrewCount,hasSquadrons:h.hasSquadrons,hasTrierarchs:h.hasTrierarchs,trierarchsCount:h.trierarchsCount,hasSettings:h.hasSettings,...x}),(0,t.jsxs)("div",{className:"flex min-w-0 grow flex-col",children:[(0,t.jsx)(a.Header,{breadcrumb:e,parents:o,live:c,onCompose:m,onSearch:u}),f,(0,t.jsx)(i.TopBar,{title:e,live:c,back:o[o.length-1]??o[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:[r,d]})]}),l,(0,t.jsx)(s.TabBar,{active:"overview"===h.active||"needs-crew"===h.active?"fleet":"settings"===h.active?void 0:h.active,hasSquadrons:h.hasSquadrons,hasTrierarchs:h.hasTrierarchs,trierarchsCount:h.trierarchsCount,inboxCount:h.inboxCount,attentionCount:h.attentionCount})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62219,e=>{"use strict";var t=e.i(43476),s=e.i(80799),a=e.i(22016),n=e.i(18566),i=e.i(71645),r=e.i(15905),l=e.i(44824),o=e.i(45608),d=e.i(95475),c=e.i(2767),u=e.i(52886),h=e.i(66787),m=e.i(92870),p=e.i(90063);let x={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 f({label:e,shortLabel:s,value:n,detail:i,href:r,icon:l,tone:o,testId:d}){return(0,t.jsxs)(a.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,p.classNames)("flex size-6.5 shrink-0 items-center justify-center rounded-md border max-sm:size-5.5",x[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:n}),(0,t.jsx)("span",{className:"truncate text-meta text-muted-foreground",children:i})]})}var g=e.i(5387),v=e.i(28459),j=e.i(96676),b=e.i(49635);function w(e){return e.filter(e=>"agent"===e.kind&&"retired"!==e.status)}function S(){var e;let s,a,n,i,r=(0,g.useFleetSnapshot)(),l=(0,v.useNeedsAttention)(),o=(0,v.useAttentionCount)(),d=(0,j.useNow)();if(!r.data)return null;let c=(n=(a=(s=w((e={ships:r.data,undeliverable:l.data??[],now:d}).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:a.length,longestWait:n&&{name:n.name,wait:(0,b.duration)(n.since,e.now)},oldestUndeliverable:i&&(0,b.duration)(i,e.now)});return 0===c.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)(f,{label:"Ships crewed",shortLabel:"Crewed",value:c.crewedCount,detail:`of ${String(c.activeCount)} active ships`,href:"/?status=crewed",icon:m.UserCheck,tone:"ok",testId:"overview-crewed"}),(0,t.jsx)(f,{label:"Awaiting crew",value:c.awaitingCount,detail:c.longestWait?`Longest wait: ${c.longestWait.name}, ${c.longestWait.wait}`:"Every active ship is crewed",href:"/?status=awaitingCrew",icon:u.CircleDashed,tone:"waiting",testId:"overview-awaiting"}),(0,t.jsx)(f,{label:"Needs attention",value:o??0,detail:c.oldestUndeliverable?`Undeliverable deliveries, oldest ${c.oldestUndeliverable}`:"Nothing needs you",href:"/needs-attention",icon:h.TriangleAlert,tone:"attention",testId:"overview-attention"})]})}var y=e.i(77071),C=e.i(10649),N=e.i(78608),k=e.i(41880),R=e.i(49092),T=e.i(87600),P=e.i(16752),I=e.i(86165),O=e.i(48695),q=e.i(265);e.i(31627);var E=e.i(73332),A=e.i(44827),M=e.i(85595),L=e.i(16984),z=e.i(9677),D=e.i(65160),V=e.i(33173),H=e.i(22212),$=e.i(94945),F=e.i(12470),B=e.i(91727),U=e.i(75867),_=e.i(43988),W=e.i(75774),K=e.i(17981),X=e.i(77435);let Y={"fleet:read":"Read the fleet","fleet:manage":"Manage the fleet","crew:assign":"Assign crews","crew:run":"Run crews","labels:define":"Define labels","labels:assign":"Assign labels"};function G({activeShips:e,isPending:a,error:n,shipLimit:l,accountUrl:o,crewRequest:d,onSubmit:c}){let u=(0,i.useId)(),h=(0,i.useId)(),m=(0,i.useId)(),x=(0,i.useId)(),f=(0,i.useId)(),g=(0,i.useId)(),[v,j]=(0,i.useState)(""),[b,w]=(0,i.useState)(""),[S,y]=(0,i.useState)(""),[N,k]=(0,i.useState)([]),[R,T]=(0,i.useState)(void 0!==d),[I,O]=(0,i.useState)(()=>(0,C.defaultValues)(d?.offers??[])),q=I.machineLabels.length>0&&d?.machineLabels?.matchOf(I.machineLabels).matching.length===0,$=(0,C.settingsOf)(I),Q=d?.check?.kind==="refused"?d.check:void 0,J=!R||void 0===d||void 0!==$&&void 0===Q&&(0,C.promptBytes)(I.firstPrompt)<=z.FIRST_PROMPT_MAX_BYTES,Z=(0,D.checkShipName)(v,{activeNames:e.map(e=>e.name)}),ee="invalid"===Z.kind||"reserved"===Z.kind||"taken"===Z.kind,et=b.trim(),es=A.shipHandleSchema.safeParse(et).success,ea=""!==et&&!es,en=[...new Set(e.map(e=>e.type))].sort(),ei="available"===Z.kind&&es&&void 0===l&&J,er=void 0!==d&&R;return(0,t.jsxs)("form",{noValidate:!0,"data-testid":"commission-form",className:"contents",onSubmit:e=>{e.preventDefault(),ei&&c({name:v,type:et,...""===S.trim()?{}:{note:S},...0===N.length?{}:{fleetScopes:[...N]}},R?void 0===d?{settings:{}}:void 0===$?void 0:{settings:$}:void 0)},children:[(0,t.jsxs)(H.DialogHeader,{children:[(0,t.jsx)(H.DialogTitle,{children:"Commission a ship"}),(0,t.jsx)(H.DialogDescription,{children:er?"A durable identity with its own inbox, and a crew request so it gets a session right away.":"A ship is a durable agent identity with its own inbox. Next, you get the starting prompt."})]}),void 0===l?null:(0,t.jsx)(X.LimitNotice,{...(0,P.shipLimitNotice)(l),accountUrl:o,testId:"commission-ship-limit"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,t.jsx)(B.Label,{htmlFor:u,children:"Name"}),(0,t.jsxs)("span",{className:"text-caption text-muted-foreground tabular-nums",children:[v.length," / ",A.SHIP_HANDLE_MAX_LENGTH]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(F.Input,{id:u,isMono:!0,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"e.g. reviewer-02","data-testid":"commission-name","aria-invalid":!!ee||void 0,"aria-describedby":h,className:"pr-9 max-sm:h-(--size-control-touch) max-sm:text-input-touch",value:v,onChange:e=>{j((0,D.asHandle)(e.target.value))}}),"available"===Z.kind?(0,t.jsx)(M.CircleCheck,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-tone-ok-fg"}):ee?(0,t.jsx)(L.CircleX,{"aria-hidden":!0,className:"absolute top-1/2 right-3 size-(--size-icon) -translate-y-1/2 text-destructive-text"}):null]}),(0,t.jsx)("p",{id:h,"aria-live":"polite",className:(0,p.classNames)("text-meta",ee?"text-destructive-text":"text-muted-foreground"),children:Z.message})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(B.Label,{htmlFor:m,children:"Type"}),(0,t.jsx)(V.Combobox,{id:m,options:en.map(e=>({value:e,label:e})),value:""===b?null:b,onValueChange:e=>{w(e??"")},isFreeText:!0,toQuery:D.asHandle,leadingIcon:(0,t.jsx)(s.Tag,{}),placeholder:"e.g. reviewer",isInvalid:ea,"aria-describedby":x,"data-testid":"commission-type"}),(0,t.jsx)("p",{id:x,className:(0,p.classNames)("text-meta",ea?"text-destructive-text":"text-muted-foreground"),children:ea?`Use 1 to ${String(A.SHIP_HANDLE_MAX_LENGTH)} lowercase letters, digits, hyphens or colons.`:(0,D.typeHint)(b,e.filter(e=>e.type===et).length)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(B.Label,{htmlFor:f,children:"Note (optional)"}),(0,t.jsx)(_.Textarea,{id:f,rows:2,"data-testid":"commission-note",value:S,onChange:e=>{y(e.target.value)}})]}),(0,t.jsxs)("fieldset",{className:"flex flex-col gap-2",children:[(0,t.jsx)("legend",{className:"mb-1.5 text-body font-medium text-foreground",children:"Fleet access"}),E.FLEET_SCOPES.map(e=>(0,t.jsxs)("label",{className:"flex items-center justify-between gap-3 text-body text-foreground",children:[(0,t.jsxs)("span",{children:[Y[e]," ",(0,t.jsx)("span",{className:"font-mono text-id text-muted-foreground",children:e})]}),(0,t.jsx)(U.Switch,{checked:N.includes(e),onCheckedChange:t=>{k(s=>t?[...s,e]:s.filter(t=>t!==e))},"data-testid":`commission-${e.replace(":","-")}`})]},e)),(0,t.jsx)("p",{className:"text-meta text-muted-foreground",children:"Every ship sends and receives. Fleet access lets its session act as the console does; crew ships lets a trierarch start their sessions. It cannot be changed later."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(B.Label,{htmlFor:g,children:"Request a crew"}),(0,t.jsx)(U.Switch,{id:g,checked:R,onCheckedChange:T,"data-testid":"commission-request-crew"})]}),(0,t.jsx)("p",{className:"-mt-2 text-meta text-muted-foreground",children:void 0===d?`Puts ${""===v?"the ship":v} on your Needs crew list until you crew it by hand. You get its starting prompt next either way.`:"The trierarch plugin picks a trierarch that starts the session and keeps it crewed."}),er?(0,t.jsx)(W.CrewSettingsFields,{offers:d.offers,values:I,onChange:e=>{O(e),d.onSettingsChange((0,C.settingsOf)(e))},squadrons:d.squadrons,refusal:Q,isDisabled:a,...void 0===d.machineLabels?{}:{machineLabels:{...d.machineLabels,shipName:""===v.trim()?"this ship":v.trim()}}}):null]}),void 0===n?null:(0,t.jsx)(K.InlineError,{title:"Not commissioned",description:n}),(0,t.jsxs)(H.DialogFooter,{className:"items-center",children:[void 0===d?null:(0,t.jsx)("span",{className:"mr-auto text-meta text-muted-foreground","data-testid":"commission-crew-note",children:R?q?"The request will wait for a machine with these labels.":d.check?.kind==="noRoom"?"The request will wait for room.":"Uncheck Request a crew to get the starting prompt instead.":null}),(0,t.jsx)(H.DialogClose,{render:(0,t.jsx)(r.Button,{type:"button",disabled:a}),children:"Cancel"}),(0,t.jsx)(r.Button,{type:"submit",variant:"primary",isLoading:a,disabled:!ei,"data-testid":"commission-submit",children:a?"Commissioning":er?"Commission and request crew":"Commission ship"})]})]})}function Q(e){let{isOpen:s,onOpenChange:a,isPending:n}=e;return(0,t.jsx)(H.Dialog,{open:s,onOpenChange:e=>{n||a(e)},children:(0,t.jsx)(H.DialogContent,{size:"md","data-testid":"commission-dialog",className:$.dialogSurface.phoneFullScreen,children:(0,t.jsx)(G,{...e})})})}var J=e.i(82532);function Z({isOpen:e,onOpenChange:s}){let a=(0,g.useFleetSnapshot)(),n=(0,R.useFleetLimits)(),l=(0,T.useHostedAccountUrl)(),o=(0,g.useCommissionShip)(),d=(0,g.useRequestCrew)(),c="connected"===(0,q.useTrierarchPluginConnection)(),u=(0,q.useMachines)(),h=(0,I.useSquadronsConnection)(),m=(0,O.useSquadrons)(),[p,x]=(0,i.useState)(!1),[f,v]=(0,i.useState)(null),j=(0,C.offersOf)(u.data??[]),b=(0,g.useLabelContext)(),w=void 0===b||void 0===u.data?void 0:(0,N.machineLabelsInputOf)(b,u.data),S=(0,q.useCrewSettingsCheck)(e&&c?null===f?(0,C.settingsOf)((0,C.defaultValues)(j)):f:void 0),E=(a.data??[]).filter(e=>"retired"!==e.status),A=(e,t)=>{o.mutate(e,{onSuccess:({shipId:a})=>{s(!1);let n=c&&void 0!==t;n||x(!0),void 0!==t&&d.mutate({shipId:a,settings:t.settings},{onSuccess:()=>{n&&(0,k.showToast)({title:`${e.name} commissioned, crew requested`,description:"The trierarch plugin assigns a trierarch that fits.",tone:"success"})},onError:t=>{(0,k.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)(y.Plus,{}),"data-testid":"fleet-commission",onClick:()=>{o.reset(),v(null),s(!0)},children:"Commission ship"}),(0,t.jsx)(Q,{activeShips:E,isOpen:e,onOpenChange:s,isPending:o.isPending,error:o.error?.message,shipLimit:(0,P.shipLimitReached)(n.data),accountUrl:l,...c?{crewRequest:{offers:j,squadrons:"connected"===h?(m.data??[]).filter(e=>"disbanded"!==e.state).map(e=>e.id):void 0,...void 0===w?{}:{machineLabels:w},check:S.data,onSettingsChange:v}}:{},onSubmit:(e,t)=>{let s={...e,idempotencyKey:crypto.randomUUID()};c&&void 0!==t?S.checkNow().catch(()=>void 0).then(e=>{e?.kind!=="refused"&&A(s,t)}).catch(()=>void 0):A(s,t)}}),(0,t.jsx)(J.StartingPromptDialog,{shipName:o.variables?.name??"",state:"shown",prompt:o.data?.prompt??void 0,crewLines:o.data?.crewLines??void 0,isOpen:p&&void 0!==o.data,onOpenChange:e=>{e||(x(!1),o.reset())},onConfirm:()=>void 0})]})}var ee=e.i(56420);let et={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"}]]};et.node;let es=(0,ee.default)(et);var ea=e.i(30274),en=e.i(49287),ei=e.i(78865);let er={ships:{label:"Ships",unit:"ships",Icon:en.Ship},messages:{label:"Messages today",unit:"messages",Icon:ea.Send}},el={below:"bg-primary",at:"bg-tone-waiting-fg",over:"bg-tone-attention-fg"},eo={at:"at-limit",over:"over-limit"};function ed({kind:e,count:s,limit:a,resetsAt:n}){let{label:i,unit:r,Icon:l}=er[e],o=(0,P.meterState)({count:s,limit:a}),d=eo[o],c=(0,P.meterCaption)({count:s,limit:a}),u=null===a?0:0===a?1:Math.min(s/a,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)(ei.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,P.meterCount)(s)}),(0,t.jsx)("span",{className:"text-body text-muted-foreground",children:null===a?r:`of ${(0,P.meterCount)(a)} ${r}`})]}),null===a?(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-meta text-muted-foreground",children:[(0,t.jsx)(es,{"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(a)}`,"aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":a,className:"block h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)("span",{className:(0,p.classNames)("block h-full rounded-full","none"===o?void 0:el[o]),style:{width:`${String(100*u)}%`}})}),(0,t.jsxs)("p",{"data-testid":`limit-meter-${e}-caption`,className:"text-caption text-muted-foreground",children:[c,void 0===n?null:` \xb7 resets at ${(0,P.resetTime)(n)}`]})]})]})}function ec(){let e=(0,R.useFleetLimits)().data,s=(0,T.useHostedAccountUrl)();return(0,P.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)(ed,{kind:"ships",count:e.ships.count,limit:e.ships.limit}),(0,t.jsx)(ed,{kind:"messages",count:e.dailyMessages.count,limit:e.dailyMessages.limit,resetsAt:e.dailyMessages.resetsAt})]})]}):null}var eu=e.i(9176),eh=e.i(84294);let em={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};em.node;let ep=(0,ee.default)(em);var ex=e.i(31458),ef=e.i(58925),eg=e.i(69309),ev=e.i(66595);let ej={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"}]]};ej.node;let eb=(0,ee.default)(ej);var ew=e.i(26478),eS=e.i(83615),ey=e.i(54492),eC=e.i(80581),eN=e.i(49841);let ek={query:"",filters:{status:"all",crewRequest:"all",type:"all",squadron:"all",isRetiredShown:!1,labelValueIds:[]}},eR="status",eT="crew",eP="type",eI="squadron",eO="retired",eq="label";function eE(e,t){return[...new Set(e.filter(e=>t||"retired"!==e.status).map(e=>e.type))].toSorted((e,t)=>e.localeCompare(t))}function eA(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 eL={crewed:"Crewed",awaitingCrew:"Awaiting crew"};function ez(e){return eD(e).length+e.labelValueIds.length}function eD(e){return["all"===e.status?void 0:`Status: ${eL[e.status]}`,"all"===e.crewRequest?void 0:`Crew request: ${(0,eN.crewRequestKeyWord)(e.crewRequest)}`,"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),eH=e.i(46033),e$=e.i(75305),eF=e.i(14732),eB=e.i(67874),eU=e.i(95960);function e_({chips:e,width:s,testId:a}){if(0===e.length)return null;let{shown:n,folded:i}=(0,eC.rowChips)(e,s);return(0,t.jsxs)("span",{"data-testid":a,className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.map((e,s)=>(0,t.jsx)(eU.LabelChip,{chip:e,className:0===s?"min-w-0 shrink":void 0},e.valueId)),0===i.length?null:(0,t.jsxs)("span",{title:i.map(e=>`${e.key}=${e.value}`).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:["+",i.length,(0,t.jsx)("span",{className:"sr-only",children:" more labels"})]})]})}var eW=e.i(88393);let eK={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"}]]};eK.node;let eX=(0,ee.default)(eK),eY={name:"signal-low",size:24,node:[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]};eY.node;let eG=(0,ee.default)(eY),eQ={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"}]]};eQ.node;let eJ=(0,ee.default)(eQ);e.s([],51047),e.i(51047);var eZ=e.i(96499),e0=e.i(56789),e1=e.i(46376),e2=e.i(33332);let e5=i.createContext(void 0);function e4(e){let t=i.useContext(e5);if(void 0===t&&!e)throw Error((0,e2.default)(72));return t}var e6=e.i(74735),e7=e.i(67865),e8=e.i(29315),e9=e.i(84446),e3=e.i(57940);function te(e){return null!=e&&null!=e.clientX}var tt=e.i(17989),ts=e.i(75606),ta=e.i(64111),tn=e.i(76782),ti=e.i(26352),tr=e.i(56434),tl=e.i(18478),to=e.i(16786),td=e.i(90627);let tc={...to.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 tu extends ti.ReactStore{constructor(e,t,s){const a=new td.PopupTriggerMap;super(th(e,a,t,s),tm(a),tc)}setOpen=(e,t)=>{(0,ta.applyPopupOpenChange)(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,(0,ts.createChangeEventDetails)(tr.REASONS.triggerPress,e))}}function th(e,t,s,a=!1){return{...(0,to.createInitialPopupStoreState)(t,s,a),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function tm(e){return{popupRef:i.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}let tp=(0,eZ.fastComponent)(function(e){let{disabled:s=!1,defaultOpen:a=!1,open:n,disableHoverablePopup:r=!1,trackCursorAxis:l="none",actionsRef:o,onOpenChange:d,onOpenChangeComplete:c,handle:u,triggerId:h,defaultTriggerId:m=null,children:p}=e,x=(0,ta.usePopupRootStore)((e,t)=>new tu({open:a,openProp:n,activeTriggerId:m,triggerIdProp:h},e,t));x.useControlledProp("openProp",n),x.useControlledProp("triggerIdProp",h),x.useContextCallback("onOpenChange",d),x.useContextCallback("onOpenChangeComplete",c);let f=x.useState("open"),g=!s&&f,v=x.useState("activeTriggerId"),j=x.useState("mounted"),b=x.useState("payload");x.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:r,disabled:s}),(0,ta.useImplicitActiveTrigger)(x,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:w,transitionStatus:S}=(0,ta.useOpenStateTransitions)(g,x),y=x.useState("isInstantPhase"),C=x.useState("instantType"),N=x.useState("lastOpenChangeReason"),k=i.useRef(null);(0,e1.useIsoLayoutEffect)(()=>{f&&s&&x.setOpen(!1,(0,ts.createChangeEventDetails)(tr.REASONS.disabled))},[f,s,x]),(0,e1.useIsoLayoutEffect)(()=>{"ending"===S&&N===tr.REASONS.none||"ending"!==S&&y?("delay"!==C&&(k.current=C),x.set("instantType","delay")):null!==k.current&&(x.set("instantType",k.current),k.current=null)},[S,y,N,C,x]),(0,e1.useIsoLayoutEffect)(()=>{g&&null==v&&x.set("payload",void 0)},[x,v,g]),i.useImperativeHandle(o,()=>({unmount:w,close:()=>x.setOpen(!1,(0,ts.createChangeEventDetails)(tr.REASONS.imperativeAction))}),[w,x]);let R=g||j||!s&&"none"!==l;return(0,t.jsxs)(e5.Provider,{value:x,children:[u&&(0,t.jsx)(ta.PopupHandleAttachment,{handle:u,store:x}),R&&(0,t.jsx)(tx,{store:x,disabled:s,trackCursorAxis:l}),"function"==typeof p?p({payload:b}):p]})});function tx({store:e,disabled:t,trackCursorAxis:s}){let a=e.useState("floatingRootContext"),n=(0,tt.useDismiss)(a,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),r=function(e,t={}){let{enabled:s=!0,axis:a="both"}=t,n="rootStore"in e?e.rootStore:e,r=n.useState("open"),l=n.useState("floatingElement"),o=n.useState("domReferenceElement"),d=n.context.dataRef,c=i.useRef(!1),u=i.useRef(null),[h,m]=i.useState(),[p,x]=i.useState([]),f=(0,e7.useStableCallback)(e=>{n.set("positionReference",e)}),g=(0,e7.useStableCallback)((e,t,s)=>{if(!c.current&&(!d.current.openEvent||te(d.current.openEvent))){var i,r;let l,c,u;n.set("positionReference",(i=s??o,r={x:e,y:t,axis:a,dataRef:d,pointerType:h},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,a=["mouseenter","mousemove"].includes(r.dataRef.current.openEvent?.type||"")&&"touch"!==r.pointerType,n=e.width,o=e.height,d=e.x,h=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,h-=c||0,n=0,o=0,!u||a?(n="y"===r.axis?e.width:0,o="x"===r.axis?e.height:0,d=t&&null!=r.x?r.x:d,h=s&&null!=r.y?r.y:h):u&&!a&&(o="x"===r.axis?e.height:o,n="y"===r.axis?e.width:n),u=!0,{width:n,height:o,x:d,y:h,top:h,right:d+n,bottom:h+o,left:d}}}))}}),v=(0,e7.useStableCallback)(e=>{r?u.current||(g(e.clientX,e.clientY,e.currentTarget),x([])):g(e.clientX,e.clientY,e.currentTarget)}),j=(0,e3.isMouseLikePointerType)(h)?l:r;i.useEffect(()=>{if(!s)return void f(o);if(!j)return;function e(){u.current?.(),u.current=null}let t=(0,e8.getWindow)(l);return!d.current.openEvent||te(d.current.openEvent)?u.current=(0,e6.addEventListener)(t,"mousemove",function(t){let s=(0,e9.getTarget)(t);(0,e9.contains)(l,s)?e():g(t.clientX,t.clientY)}):f(o),e},[j,s,l,d,o,n,g,f,p]),i.useEffect(()=>()=>{n.set("positionReference",null)},[n]),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){m(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return i.useMemo(()=>s?{reference:b,trigger:b}:{},[s,b])}(a,{enabled:!t&&"none"!==s,axis:"none"===s?void 0:s}),l=i.useMemo(()=>(0,tn.mergeProps)(r.reference,n.reference),[r.reference,n.reference]);return(0,ta.usePopupInteractionProps)(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:n.floating??e0.EMPTY_OBJECT}),null}var tf=e.i(39957),tg=e.i(46265),tv=e.i(79938),tj=e.i(52245),tb=e.i(59636),tw=e.i(88015);let tS=i.createContext(void 0);var ty=e.i(50316),tC=e.i(44681);let tN=i.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new tf.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function tk(e){let{children:s,delay:a,timeoutMs:n=0}=e,r=i.useRef(a),l=i.useRef(a),o=i.useRef(null),d=i.useRef(null),c=(0,tf.useTimeout)();return(0,e1.useIsoLayoutEffect)(()=>{if(l.current=a,!o.current){r.current=a;return}r.current={open:(0,tC.getDelay)(r.current,"open"),close:(0,tC.getDelay)(a,"close")}},[a,o,r,l]),(0,t.jsx)(tN.Provider,{value:i.useMemo(()=>({hasProvider:!0,delayRef:r,initialDelayRef:l,currentIdRef:o,timeoutMs:n,currentContextRef:d,timeout:c}),[n,c]),children:s})}var tR=e.i(13082),tT=e.i(72135),tP=e.i(73752),tI=e.i(22846);let tO="data-base-ui-tooltip-trigger";function tq(e){if("composedPath"in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let s=t[e];if((0,e8.isElement)(s))return s}}let t=e.target;return(0,e8.isElement)(t)?t:null}let tE=(0,eZ.fastComponentRef)(function(e,t){let{render:s,className:a,style:n,handle:r,payload:l,disabled:o,delay:d,closeOnClick:c=!0,closeDelay:u,id:h,...m}=e,p=e4(!0),x=(0,tb.usePopupHandleStore)(r)??p;if(!x)throw Error((0,e2.default)(82));let f=(0,tw.useBaseUiId)(h),g=x.useState("isTriggerActive",f),v=x.useState("isOpenedByTrigger",f),j=x.useState("floatingRootContext"),b=i.useRef(null),w=u??0,{registerTrigger:S,isMountedByThisTrigger:y}=(0,ta.useTriggerDataForwarding)(f,b,x,{payload:l,closeOnClick:c,closeDelay:w}),C=i.useContext(tS),{activeIdRef:N,delayRef:k,isInstantPhase:R,hasProvider:T}=function(e,t={open:!1}){let{open:s}=t,a="rootStore"in e?e.rootStore:e,n=a.useState("floatingId"),{currentIdRef:r,delayRef:l,timeoutMs:o,initialDelayRef:d,currentContextRef:c,hasProvider:u,timeout:h}=i.useContext(tN),[m,p]=i.useState(!1),x=i.useRef(s);return(0,e1.useIsoLayoutEffect)(()=>{x.current=s},[s]),(0,e1.useIsoLayoutEffect)(()=>{function e(){c.current?.setIsInstantPhase(!1),r.current=null,c.current=null,l.current=d.current,h.clear()}if(r.current&&!s&&r.current===n){if(p(!1),o)return h.start(o,()=>{a.select("open")||r.current&&r.current!==n||e()}),()=>{(x.current||r.current!==n)&&h.clear()};e()}},[s,n,r,l,o,d,c,h,a]),(0,e1.useIsoLayoutEffect)(()=>{if(!s)return;let e=c.current,t=r.current;h.clear(),c.current={onOpenChange:a.setOpen,setIsInstantPhase:p},r.current=n,l.current={open:0,close:(0,tC.getDelay)(d.current,"close")},null!==t&&t!==n?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,(0,ts.createChangeEventDetails)(tr.REASONS.none))):(p(!1),e?.setIsInstantPhase(!1))},[s,n,a,r,l,d,c,h]),(0,e1.useIsoLayoutEffect)(()=>()=>{r.current===n&&(c.current=null,x.current)&&(r.current=null,l.current=d.current,h.clear())},[c,r,l,n,d,h]),i.useMemo(()=>({activeIdRef:r,hasProvider:u,delayRef:l,isInstantPhase:m}),[r,u,l,m])}(j,{open:v}),P=(0,tP.useHoverInteractionSharedState)(j);x.useSyncedValue("isInstantPhase",R);let I=x.useState("disabled"),O=o??I,q=(0,tg.useValueAsRef)(O),E=x.useState("trackCursorAxis"),A=x.useState("disableHoverablePopup"),M=i.useRef(!1),L=(0,tf.useTimeout)(),z=i.useRef(void 0);function D(){return T&&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(`[${tO}]`);if(e)return e;let s=t.getRootNode();t="host"in s&&(0,e8.isElement)(s.host)?s.host:null}return null}(e);return null!==s&&s!==t&&(0,e9.contains)(t,s)}let H=(0,tT.useHoverReferenceInteraction)(j,{enabled:!O,mouseOnly:!0,move:!1,handleClose:A||"both"===E?null:(0,ty.safePolygon)(),restMs:D,delay:()=>null==u&&T?{close:(0,tC.getDelay)(k.current,"close")}:{close:w},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>"ending"===x.select("transitionStatus"),shouldOpen:()=>!M.current}),$=(0,tR.useFocus)(j,{enabled:!O}).reference,F=x.useState("triggerProps",y),B=y||"none"!==E;return(0,tj.useRenderElement)("button",e,{state:{open:v},ref:[t,S,b],props:[H,$,B?F:void 0,{onMouseOver(e){(e=>{let t,s=M.current,a=tq(e),n=(M.current=t=V(a),t&&(P.openChangeTimeout.clear(),P.restTimeout.clear(),P.restTimeoutPending=!1,L.clear()),t),i=b.current,r=i&&a&&(0,e9.contains)(i,a);if(n&&x.select("open")&&x.select("lastOpenChangeReason")===tr.REASONS.triggerHover)return x.setOpen(!1,(0,ts.createChangeEventDetails)(tr.REASONS.triggerHover,e));if(s&&!n&&r&&!q.current&&!x.select("open")&&i&&(0,e3.isMouseLikePointerType)(z.current)){let t=()=>{M.current||q.current||x.select("open")||x.setOpen(!0,(0,ts.createChangeEventDetails)(tr.REASONS.triggerHover,e,i))},s=D();0===s?(L.clear(),t()):L.start(s,t)}})(e.nativeEvent)},onFocus(e){V(tq(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,x.set("closeOnClick",c),c&&!x.select("open")&&x.cancelPendingOpen(e.nativeEvent)},onClick(e){c&&!x.select("open")&&x.cancelPendingOpen(e.nativeEvent)},id:f,[tI.triggerDisabled]:O?"":void 0,[tO]:O?void 0:""},m],stateAttributesMapping:tv.triggerOpenStateMapping})}),tA=i.createContext(void 0);var tM=e.i(74080),tL=e.i(26674);let tz=i.forwardRef(function(e,s){let{children:a,container:n,className:r,render:l,style:o,...d}=e,{node:c,subtree:u}=(0,tL.useFloatingPortalNode)({container:n,ref:s,componentProps:e,elementProps:d});return u||c?(0,t.jsxs)(i.Fragment,{children:[u,c&&tM.createPortal(a,c)]}):null}),tD=i.forwardRef(function(e,s){let{keepMounted:a=!1,...n}=e;return e4().useState("mounted")||a?(0,t.jsx)(tA.Provider,{value:a,children:(0,t.jsx)(tz,{ref:s,...n})}):null}),tV=i.createContext(void 0);function tH(){let e=i.useContext(tV);if(void 0===e)throw Error((0,e2.default)(71));return e}var t$=e.i(23706),tF=e.i(38396),tB=e.i(89579);let tU=i.forwardRef(function(e,s){let{render:a,className:n,anchor:r,positionMethod:l="absolute",side:o="top",align:d="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:h="clipping-ancestors",collisionPadding:m=5,arrowPadding:p=5,sticky:x=!1,disableAnchorTracking:f=!1,collisionAvoidance:g=tF.POPUP_COLLISION_AVOIDANCE,style:v,...j}=e,b=e4(),w=function(){let e=i.useContext(tA);if(void 0===e)throw Error((0,e2.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"),T=b.useState("transitionStatus"),P=b.useState("adaptiveOrigin"),I=(0,t$.useAnchorPositioning)({anchor:r,positionMethod:l,floatingRootContext:k,mounted:y,side:o,sideOffset:c,align:d,alignOffset:u,collisionBoundary:h,collisionPadding:m,sticky:x,arrowPadding:p,disableAnchorTracking:f,keepMounted:w,collisionAvoidance:g,adaptiveOrigin:P}),O=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,tB.usePositioner)(e,O,{styles:I.positionerStyles,transitionStatus:T,props:j,refs:[s,b.useStateSetter("positionerElement")],hidden:!y,inert:!S||"both"===C||N});return(0,t.jsx)(tV.Provider,{value:I,children:q})});var t_=e.i(37584),tW=e.i(53984),tK=e.i(31157);let tX=i.forwardRef(function(e,t){let{render:s,className:a,style:n,...i}=e,r=e4(),{side:l,align:o}=tH(),d=r.useState("open"),c=r.useState("instantType"),u=r.useState("transitionStatus"),h=r.useState("popupProps"),m=r.useState("floatingRootContext"),p=r.useState("disabled"),x=r.useState("closeDelay");(0,t_.useOpenChangeComplete)({open:d,ref:r.context.popupRef,onComplete(){d&&r.context.onOpenChangeComplete?.(!0)}}),(0,tK.useHoverFloatingInteraction)(m,{enabled:!p,closeDelay:x});let f=r.useStateSetter("popupElement");return(0,tj.useRenderElement)("div",e,{state:{open:d,side:l,align:o,instant:c,transitionStatus:u},ref:[t,r.context.popupRef,f],props:[ta.FOCUSABLE_POPUP_PROPS,h,(0,tW.getDisabledMountTransitionStyles)(u),i],stateAttributesMapping:tv.popupTransitionStateMapping})}),tY=i.forwardRef(function(e,t){let{render:s,className:a,style:n,...i}=e,r=e4(),{arrowRef:l,side:o,align:d,arrowUncentered:c,arrowStyles:u}=tH(),h=r.useState("open"),m=r.useState("instantType");return(0,tj.useRenderElement)("div",e,{state:{open:h,side:o,align:d,uncentered:c,instant:m},ref:[t,l],props:[{style:u,"aria-hidden":!0},i],stateAttributesMapping:tv.popupStateMapping})});var tG=e.i(18390);let tQ=i.forwardRef(function(e,t){let{render:s,className:a,style:n,children:i,...r}=e,l=e4(),o=tH(),d=l.useState("instantType"),{children:c,state:u}=(0,tG.usePopupViewport)({store:l,side:o.side,children:i}),h={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:d};return(0,tj.useRenderElement)("div",e,{state:h,ref:t,props:[r,{children:c}],stateAttributesMapping:tG.popupViewportStateMapping})});var tJ=e.i(64170);class tZ extends tJ.BasePopupHandle{constructor(){super(function(){let e=new td.PopupTriggerMap;return Object.assign(new tl.NullStore(Object.freeze(th(void 0,e)),Object.freeze(tm(e)),tc),{setOpen:e0.NOOP,cancelPendingOpen:e0.NOOP})}(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,tY,"Handle",0,tZ,"Popup",0,tX,"Portal",0,tD,"Positioner",0,tU,"Provider",0,function(e){let{delay:s,closeDelay:a,timeout:n=400}=e,r=i.useMemo(()=>({open:s,close:a}),[s,a]);return(0,t.jsx)(tS.Provider,{value:s,children:(0,t.jsx)(tk,{delay:r,timeoutMs:n,children:e.children})})},"Root",0,tp,"Trigger",0,tE,"Viewport",0,tQ,"createHandle",0,function(){return new tZ}],99643);var t0=e.i(99643),t0=t0;function t1(e){return(0,t.jsx)(t0.Root,{"data-slot":"tooltip",...e})}function t2(e){return(0,t.jsx)(t0.Trigger,{"data-slot":"tooltip-trigger",...e})}function t5({className:e,side:s="top",sideOffset:a=6,align:n="center",...i}){return(0,t.jsx)(t0.Portal,{children:(0,t.jsx)(t0.Positioner,{align:n,side:s,sideOffset:a,className:"isolate z-50 max-sm:hidden",children:(0,t.jsx)(t0.Popup,{"data-slot":"tooltip-content",className:(0,p.classNames)("w-fit max-w-xs origin-(--transform-origin) rounded-sm bg-foreground px-2 py-1 text-caption font-medium text-background shadow-md duration-(--duration-fast) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...i})})})}let t4={fresh:{Icon:eX,tone:"text-tone-ok-fg"},while:{Icon:eJ,tone:"text-muted-foreground"},long:{Icon:eG,tone:"text-tone-waiting-fg"}};function t6({seenAt:e,now:s,testId:a}){let n;if(null===e)return null;let i=new Date(e),r=(n=s.getTime()-i.getTime())<6e4?"fresh":n<=9e5?"while":"long",{Icon:l,tone:o}=t4[r],d=(0,b.lastSeen)(i,s);return(0,t.jsxs)(t1,{children:[(0,t.jsx)(t2,{render:(0,t.jsx)("span",{role:"img","aria-label":d,"data-testid":a,"data-signal":r,className:(0,p.classNames)("inline-flex [&_svg]:size-(--size-icon) max-sm:[&_svg]:size-4",o)}),children:(0,t.jsx)(l,{"aria-hidden":!0})}),(0,t.jsx)(t5,{children:d})]})}var t7=e.i(63481);let t8={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};t8.node;let t9=(0,ee.default)(t8),t3={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};t3.node;let se=(0,ee.default)(t3);function st(e){return e.startsWith("@")||/@\d+\.\d+\.\d+$/.test(e)}function ss({model:e,isCrewed:s,now:a,testId:n}){if(!s)return null;if(null===e)return(0,t.jsx)("span",{"data-testid":n,className:"text-meta text-muted-foreground",children:"Not stated yet"});let i=st(e.id),r=function(e,t){let s=new Date(e.statedAt),a=Math.max(0,t.getTime()-s.getTime()),n=st(e.id)?"Software":"Model";if(a<6e4)return`${n}, stated ${String(Math.floor(a/1e3))} s ago`;let i=(0,b.relativeTime)(s,t);return`${n}, stated ${i.charAt(0).toLowerCase()}${i.slice(1)}`}(e,a);return(0,t.jsxs)(t1,{children:[(0,t.jsxs)(t2,{render:(0,t.jsx)("span",{"data-testid":n,"data-slot":"model-tag","data-software":i?"":void 0,className:(0,p.classNames)("inline-flex max-w-44 min-w-0 items-center gap-1 rounded-sm px-1.5 py-0.5 font-mono text-id [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0",i?"border border-dashed border-border text-muted-foreground":"bg-secondary text-secondary-foreground")}),children:[(0,t.jsx)(i?t9:se,{"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:e.id}),(0,t.jsxs)("span",{className:"sr-only",children:[", ",r]})]}),(0,t.jsx)(t5,{children:(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"font-mono",children:e.id}),(0,t.jsx)("span",{className:"opacity-75",children:r})]})})]})}let sa={waiting:"bg-tone-waiting-fg",active:"bg-tone-active-fg",ok:"bg-tone-ok-fg",attention:"bg-tone-attention-fg"};function sn({cell:e,testId:s}){return void 0===e?(0,t.jsxs)("span",{className:"text-meta text-muted-foreground","data-testid":s,children:[(0,t.jsx)("span",{"aria-hidden":!0,children:"–"}),(0,t.jsx)("span",{className:"sr-only",children:"No crew request"})]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-meta whitespace-nowrap","data-testid":s,children:[(0,t.jsx)("span",{"aria-hidden":!0,className:(0,p.classNames)("size-1.5 shrink-0 rounded-full",sa[e.tone])}),e.word]})}var si=e.i(81830),sr=e.i(1935),sl=e.i(39448),so=e.i(16327),sd=e.i(68401),sc=e.i(6734),su=e.i(87851);function sh({groups:e,picked:s,onPick:n,trigger:r}){let[l,o]=(0,i.useState)(!1);return(0,t.jsxs)(sc.Popover,{open:l,onOpenChange:o,children:[(0,t.jsx)(sc.PopoverTrigger,{render:r}),(0,t.jsxs)(sc.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)(su.LabelPicker,{groups:e,pickedValueIds:s.map(e=>e.valueId),onPick:e=>{n(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)(a.default,{href:"/labels",className:"font-medium text-foreground hover:underline","data-testid":"label-filter-manage",children:"Manage labels"})]})]})]})}function sm({groups:e,picked:a,onPick:n}){return(0,t.jsx)(sh,{groups:e,picked:a,onPick:n,trigger:(0,t.jsxs)(r.Button,{variant:"secondary",size:"sm",icon:(0,t.jsx)(s.Tag,{}),"data-testid":"fleet-filter-labels",children:["Labels",0===a.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:[a.length,(0,t.jsx)("span",{className:"sr-only",children:" picked"})]}),(0,t.jsx)(so.ChevronDown,{"aria-hidden":!0,className:"text-muted-foreground"})]})})}function sp({groups:e,picked:s,onPick:a,onRemove:n,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)(eU.LabelChip,{chip:e,testId:"fleet-picked-label",onRemove:()=>{n(e.valueId)}})]},e.valueId)),(0,t.jsx)(sh,{groups:e,picked:s,onPick:a,trigger:(0,t.jsx)(r.Button,{variant:"ghost",size:"xs",icon:(0,t.jsx)(y.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 sx({groups:e,picked:s,onPick:n,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)(eU.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)(su.LabelPicker,{groups:e,pickedValueIds:s.map(e=>e.valueId),size:"touch",onPick:e=>{n(e),d(!1)}})}):(0,t.jsx)(r.Button,{variant:"secondary",size:"touch",icon:(0,t.jsx)(y.Plus,{}),className:"self-start",onClick:()=>{d(!0)},children:"Add label"}),(0,t.jsxs)(a.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)(sd.Tags,{"aria-hidden":!0}),"All labels and their owners"]})]})}function sf(e,t){return{...e,filters:{...e.filters,labelValueIds:t}}}let sg={all:"All",crewed:"Crewed",awaitingCrew:"Awaiting crew"};function sv(e){return Object.hasOwn(sg,e)}let sj={all:"All",...Object.fromEntries(eN.CREW_REQUEST_KEYS.map(e=>[e,(0,eN.crewRequestKeyWord)(e)]))};function sb(e){return Object.hasOwn(sj,e)}function sw({ship:e,squadron:s,isPluginShip:a}){return"operator"===e.kind?(0,t.jsxs)(eV.Badge,{variant:"kind",children:[(0,t.jsx)(ew.UserRound,{"aria-hidden":!0}),"operator"]}):"viewer"===e.kind?(0,t.jsxs)(eV.Badge,{variant:"kind","data-testid":"fleet-viewer",children:[(0,t.jsx)(ep,{"aria-hidden":!0}),"viewer"]}):a?(0,t.jsxs)(eV.Badge,{variant:"kind","data-testid":"fleet-plugin",children:[(0,t.jsx)(eg.Plug,{"aria-hidden":!0}),"plugin"]}):s?.role===null?(0,t.jsxs)(eV.Badge,{variant:"kind","data-testid":"fleet-flagship",children:[(0,t.jsx)(ex.Flag,{"aria-hidden":!0}),"flagship"]}):s?(0,t.jsx)(sr.SquadronTag,{squadronId:s.squadronId,role:s.role,size:"sm"}):null}function sS({ship:e,now:s}){let a=e.startingPrompt,n="inline-flex min-w-0 items-center gap-1.5 text-meta text-muted-foreground [&_svg]:size-(--size-icon-sm) [&_svg]:shrink-0";if(null===a)return(0,t.jsxs)("span",{className:n,children:[(0,t.jsx)(ef.KeyRound,{"aria-hidden":!0}),"No starting prompt issued"]});let i=new Date(a.issuedAt);return(0,t.jsxs)("span",{className:n,children:[(0,t.jsx)(ef.KeyRound,{"aria-hidden":!0}),(0,t.jsxs)("span",{className:"truncate",children:["Prompt issued"," ",(0,t.jsx)("time",{dateTime:a.issuedAt,title:(0,b.fullDateTime)(i),children:(0,b.relativeTime)(i,s)}),a.isClaimed?", claimed":", not claimed yet"]})]})}function sy({ship:e,now:s}){return"retired"===e.status?null===e.retiredAt?null:(0,t.jsxs)("span",{className:"truncate text-meta text-muted-foreground","data-testid":"fleet-retired-on",title:(0,b.fullDateTime)(new Date(e.retiredAt)),children:["Retired ",(0,b.dayMonth)(new Date(e.retiredAt))]}):"viewer"===e.kind?null:"awaitingCrew"===e.status?(0,t.jsx)(sS,{ship:e,now:s}):(0,t.jsx)(t7.LocationTag,{kind:"operator"===e.kind&&null!==e.location?"DEVICE":e.location?.kind??null,description:e.location?.description,harness:"operator"===e.kind?"console":e.harness,size:"sm"})}function sC({ship:e,now:s,next:a}){let n="agent"===e.kind&&"crewed"===e.status;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2 max-sm:flex-col max-sm:items-stretch",children:[n?(0,t.jsx)(si.ReportLine,{report:e.report,now:s,variant:"row",isTimeInTitle:!0,testId:"fleet-report"}):null,a]})}function sN({ships:e,view:s,onViewChange:a,size:n,squadronsOf:i,labels:l}){let{filters:o}=s,d={all:"All",...Object.fromEntries(eE(e,o.isRetiredShown).map(e=>[e,e]))},c=eA(e),u="sm"===n?"fleet-show-retired":"fleet-show-retired-touch",h=e=>{a({...s,filters:{...o,...e}})},m="touch"===n;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(eH.Select,{items:sg,value:o.status,onValueChange:e=>{null!==e&&sv(e)&&h({status:e})},children:[(0,t.jsx)(eH.SelectTrigger,{size:n,"aria-label":"Status","data-testid":m?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)(eH.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(eH.SelectContent,{children:Object.entries(sg).map(([e,s])=>(0,t.jsx)(eH.SelectItem,{value:e,children:s},e))})]}),(0,t.jsxs)(eH.Select,{items:sj,value:o.crewRequest,onValueChange:e=>{null!==e&&sb(e)&&h({crewRequest:e})},children:[(0,t.jsx)(eH.SelectTrigger,{size:n,"aria-label":"Crew request","data-testid":m?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)(eH.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(eH.SelectContent,{children:Object.entries(sj).map(([e,s])=>(0,t.jsx)(eH.SelectItem,{value:e,children:s},e))})]}),(0,t.jsxs)(eH.Select,{items:d,value:o.type,onValueChange:e=>{null!==e&&h({type:e})},children:[(0,t.jsx)(eH.SelectTrigger,{size:n,"aria-label":"Type","data-testid":m?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)(eH.SelectValue,{className:"font-medium"})]})}),(0,t.jsx)(eH.SelectContent,{children:Object.entries(d).map(([e,s])=>(0,t.jsx)(eH.SelectItem,{value:e,className:"all"===e?void 0:"font-mono",children:s},e))})]}),i&&(0,t.jsxs)(eH.Select,{items:{all:"All",...Object.fromEntries(eM(i).map(e=>[e,e]))},value:o.squadron,onValueChange:e=>{null!==e&&h({squadron:e})},children:[(0,t.jsx)(eH.SelectTrigger,{size:n,"aria-label":"Squadron","data-testid":m?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)(eH.SelectValue,{className:"font-medium"})]})}),(0,t.jsxs)(eH.SelectContent,{children:[(0,t.jsx)(eH.SelectItem,{value:"all",children:"All"}),eM(i).map(e=>(0,t.jsx)(eH.SelectItem,{value:e,children:e},e))]})]}),void 0===l||m?null:(0,t.jsx)(sm,{groups:(0,eC.filterGroupsOf)(l),picked:(0,eC.pickedChips)(o.labelValueIds,l),onPick:e=>{a(sf(s,[...o.labelValueIds,e]))}}),eD(o).length>0&&!m?(0,t.jsx)(r.Button,{variant:"ghost",size:"xs","data-testid":"fleet-filters-clear",onClick:()=>{a({...s,filters:ek.filters})},children:"Clear filters"}):null,(0,t.jsxs)("div",{className:(0,p.classNames)("inline-flex items-center gap-2",m?"py-2":"sm:ml-auto"),children:[(0,t.jsx)(U.Switch,{id:u,"data-testid":m?void 0:"fleet-show-retired",checked:o.isRetiredShown,onCheckedChange:e=>{h({isRetiredShown:e})}}),(0,t.jsxs)(B.Label,{htmlFor:u,className:(0,p.classNames)("font-normal text-muted-foreground",m?"text-body-touch":"text-meta"),children:["Show retired (",c,")"]})]})]})}function sk({label:e,isOn:s,kind:a,onPick:n}){return(0,t.jsx)(r.Button,{variant:s?"primary":"secondary",size:"touch",role:"radio"===a?"radio":void 0,"aria-checked":"radio"===a?s:void 0,"aria-pressed":"toggle"===a?s:void 0,onClick:n,children:e})}function sR({ships:e,view:s,onViewChange:a,shownCount:n,squadronsOf:i,labels:l}){let{filters:o}=s,d=e=>{a({...s,filters:{...o,...e}})},c=ez(o),u=eA(e);return(0,t.jsxs)(e$.Sheet,{children:[(0,t.jsx)(e$.SheetTrigger,{render:(0,t.jsx)(r.Button,{size:"touch",isIconOnly:!0,"aria-label":c>0?`Filter ships, ${String(c)} active`:"Filter ships","data-testid":"fleet-filters-open",icon:(0,t.jsx)(eb,{}),className:"relative sm:hidden",children:c>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)(e$.SheetContent,{side:"bottom",children:[(0,t.jsxs)(e$.SheetHeader,{className:"flex-row items-center justify-between",children:[(0,t.jsx)(e$.SheetTitle,{children:"Filter ships"}),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch","data-testid":"fleet-filters-reset",onClick:()=>{a({...s,filters:ek.filters})},children:"Reset"})]}),(0,t.jsxs)(e$.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(sg).map(([e,s])=>(0,t.jsx)(sk,{label:s,kind:"radio",isOn:o.status===e,onPick:()=>{sv(e)&&d({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(sj).map(([e,s])=>(0,t.jsx)(sk,{label:s,kind:"radio",isOn:o.crewRequest===e,onPick:()=>{sb(e)&&d({crewRequest: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",...eE(e,o.isRetiredShown)].map(e=>(0,t.jsx)(sk,{label:"all"===e?"All types":e,kind:"toggle",isOn:o.type===e,onPick:()=>{d({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)(sk,{label:"all"===e?"All":e,kind:"radio",isOn:o.squadron===e,onPick:()=>{d({squadron:e})}},e))})]}),void 0===l?null:(0,t.jsx)(sx,{groups:(0,eC.filterGroupsOf)(l),picked:(0,eC.pickedChips)(o.labelValueIds,l),onPick:e=>{a(sf(s,[...o.labelValueIds,e]))},onRemove:e=>{a(sf(s,o.labelValueIds.filter(t=>t!==e)))}}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 py-1",children:[(0,t.jsxs)(B.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:["(",u,")"]})]}),(0,t.jsx)(U.Switch,{id:"fleet-show-retired-touch",checked:o.isRetiredShown,onCheckedChange:e=>{d({isRetiredShown:e})}})]}),(0,t.jsx)(e$.SheetClose,{render:(0,t.jsx)(r.Button,{size:"touch","data-testid":"fleet-filters-apply"}),children:1===n?"Show 1 ship":`Show ${String(n)} ships`})]})]})]})}function sT({view:e,onViewChange:s,labels:a}){let n=eD(e.filters),i=void 0===a?[]:(0,eC.pickedChips)(e.filters.labelValueIds,a);return 0===n.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:[n.map(e=>(0,t.jsx)(eV.Badge,{variant:"outline",className:"max-w-full truncate",children:e},e)),i.map(a=>(0,t.jsx)(eU.LabelChip,{chip:a,onRemove:()=>{s(sf(e,e.filters.labelValueIds.filter(e=>e!==a.valueId)))}},a.valueId)),(0,t.jsx)(r.Button,{variant:"ghost",size:"touch",onClick:()=>{s({...e,filters:ek.filters})},children:"Clear filters"})]})}function sP({ships:e,view:s,onViewChange:a,shownCount:n,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)(F.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=>{a({...s,query:e.target.value})},leadingIcon:(0,t.jsx)(ev.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)(sN,{ships:e,view:s,onViewChange:a,squadronsOf:i,labels:r,size:"sm"})}),(0,t.jsx)(sR,{ships:e,view:s,onViewChange:a,shownCount:n,squadronsOf:i,labels:r}),(0,t.jsx)(sT,{view:s,onViewChange:a,labels:r}),(0,t.jsxs)("p",{"aria-live":"polite",className:"text-meta text-muted-foreground tabular-nums max-sm:w-full",children:[n," of ",e.length," ships"]})]})}function sI({ship:e}){return(0,t.jsx)(sl.ShipName,{name:e.name,shipId:e.id,isSuffixShown:"retired"===e.status,href:`/ships/${e.id}`})}function sO({ships:e,highlightedShipIds:s,now:a,renderRowActions:n,squadronsOf:i,labels:r,pluginShipIds:l}){return(0,t.jsx)("div",{className:"max-sm:hidden",children:(0,t.jsxs)(eF.Table,{"aria-label":"Ships",children:[(0,t.jsx)(eF.TableHeader,{children:(0,t.jsxs)(eF.TableRow,{children:[(0,t.jsx)(eF.TableHead,{children:void 0===r||0===r.labels.length?"Name":"Name and labels"}),(0,t.jsx)(eF.TableHead,{children:"Status"}),(0,t.jsx)(eF.TableHead,{children:"Crew request"}),(0,t.jsx)(eF.TableHead,{children:"Report"}),(0,t.jsx)(eF.TableHead,{children:"Runs on"}),(0,t.jsx)(eF.TableHead,{children:"Model"}),(0,t.jsx)(eF.TableHead,{children:"Seen"}),(0,t.jsx)(eF.TableHead,{children:(0,t.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,t.jsx)(eF.TableBody,{children:e.map(e=>(0,t.jsxs)(eF.TableRow,{"data-testid":`fleet-row-${e.name}`,"data-new":s?.has(e.id)?"":void 0,className:"h-12",children:[(0,t.jsx)(eF.TableCell,{className:"max-w-64",children:(0,t.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(sI,{ship:e}),(0,t.jsx)(sw,{ship:e,squadron:i?.get(e.id),isPluginShip:l?.has(e.id)??!1})]}),void 0===r?null:(0,t.jsx)(e_,{chips:(0,eC.chipsOf)(e,r),width:22,testId:"fleet-labels"})]})}),(0,t.jsx)(eF.TableCell,{children:(0,t.jsx)(ei.StatusBadge,{status:e.status})}),(0,t.jsx)(eF.TableCell,{children:(0,t.jsx)(sn,{cell:(0,eN.crewRequestCell)((0,ey.crewRequestStage)(e)),testId:"fleet-crew-request"})}),(0,t.jsx)(eF.TableCell,{className:"max-w-72",children:(0,t.jsx)(sC,{ship:e,now:a,next:n?.(e,"next")})}),(0,t.jsx)(eF.TableCell,{className:"max-w-56",children:(0,t.jsx)(sy,{ship:e,now:a})}),(0,t.jsx)(eF.TableCell,{children:"agent"!==e.kind?null:(0,t.jsx)(ss,{model:e.model,isCrewed:"crewed"===e.status,now:a,testId:"fleet-model"})}),(0,t.jsx)(eF.TableCell,{children:(0,t.jsx)(t6,{seenAt:e.lastSeenAt,now:a,testId:"fleet-last-seen"})}),(0,t.jsx)(eF.TableCell,{className:"w-10 text-right",children:n?.(e,"table")})]},e.id))})]})})}function sq({ships:e,highlightedShipIds:s,now:a,renderRowActions:n,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.jsxs)("div",{className:"flex items-center justify-between gap-3 text-body-touch",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(sI,{ship:e}),(0,t.jsx)(sw,{ship:e,squadron:i?.get(e.id),isPluginShip:r?.has(e.id)??!1})]}),(0,t.jsx)(ei.StatusBadge,{status:e.status})]}),null===e.crewRequest?null:(0,t.jsx)(sn,{cell:(0,eN.crewRequestCell)((0,ey.crewRequestStage)(e))}),(0,t.jsx)(sC,{ship:e,now:a,next:n?.(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)(sy,{ship:e,now:a}),"agent"!==e.kind?null:(0,t.jsx)(ss,{model:e.model,isCrewed:"crewed"===e.status,now:a}),(0,t.jsx)(t6,{seenAt:e.lastSeenAt,now:a})]})]}),n?.(e,"phone")]},e.id))})}function sE({ships:e,view:s,onViewChange:a,state:n,error:i,highlightedShipIds:l,now:o,renderRowActions:d,emptyAction:c,squadronsOf:u,labels:h,pluginShipIds:m}){var p;let x;if("loading"===n)return(0,t.jsxs)("div",{"data-slot":"fleet-table","data-state":"loading",className:"flex flex-col gap-3",children:[(0,t.jsx)(eW.LoadingSkeleton,{variant:"table",rows:6,label:"Loading the fleet",className:"max-sm:hidden"}),(0,t.jsx)(eW.LoadingSkeleton,{variant:"list",rows:5,label:"Loading the fleet",className:"sm:hidden"})]});if("error"===n)return(0,t.jsx)(K.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 f={highlightedShipIds:l,now:o,renderRowActions:d,squadronsOf:u,pluginShipIds:m};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)(sO,{ships:s,labels:h,...f}),(0,t.jsx)(sq,{ships:s,...f}),(0,t.jsx)(eB.EmptyState,{icon:(0,t.jsx)(en.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 g=(p={...s,squadronsOf:u},e.filter(e=>{let t;return(""===(t=p.query.trim().toLowerCase())||e.name.toLowerCase().includes(t)||e.type.toLowerCase().includes(t))&&function(e,t){let{filters:s,squadronsOf:a}=t;return("retired"!==e.status||!!s.isRetiredShown)&&("all"===s.squadron||a?.get(e.id)?.squadronId===s.squadron)&&("all"===s.status||e.status===s.status)&&("all"===s.crewRequest||(0,eN.crewRequestKey)((0,ey.crewRequestStage)(e))===s.crewRequest)&&!!(0,eC.carriesEvery)(e,s.labelValueIds)&&("all"===s.type||e.type===s.type)}(e,p)}).toSorted((e,t)=>e.kind!==t.kind?"operator"===e.kind?-1:1:e.name.localeCompare(t.name)||e.id.localeCompare(t.id))),v=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)(sP,{ships:e,view:s,onViewChange:a,shownCount:g.length,squadronsOf:u,labels:h}),void 0===h?null:(0,t.jsx)(sp,{groups:(0,eC.filterGroupsOf)(h),picked:(0,eC.pickedChips)(s.filters.labelValueIds,h),onPick:e=>{a(sf(s,[...s.filters.labelValueIds,e]))},onRemove:e=>{a(sf(s,s.filters.labelValueIds.filter(t=>t!==e)))},onClear:()=>{a(sf(s,[]))}}),0===g.length?(0,t.jsx)(eB.EmptyState,{variant:"no-results",title:""===v?"No ships match these filters.":`No ships match “${v}”.`,action:(0,t.jsx)(r.Button,{size:"xs","data-testid":"fleet-clear-filters",onClick:()=>{a(ek)},children:(x=ez(s.filters)>0,""===v?"Clear filters":x?"Clear search and filters":"Clear search")})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(sO,{ships:g,labels:h,...f}),(0,t.jsx)(sq,{ships:g,...f})]})]})}var sA=e.i(5894);function sM({view:e,onViewChange:s,newShipIds:a}){let n=(0,g.useFleetSnapshot)(),i=(0,j.useNow)(),r=(0,O.useSquadrons)(),l=(0,g.useLabelContext)(),o=(0,eu.usePluginShipIds)();return(0,t.jsx)("section",{"aria-label":"Fleet",className:"flex flex-col gap-3",children:(0,t.jsx)(sE,{ships:n.data??[],view:e,onViewChange:s,state:n.isPending?"loading":n.isError?"error":"ready",error:{detail:n.error?.message,onRetry:()=>{n.refetch()}},highlightedShipIds:a,now:i,renderRowActions:(e,s)=>(0,t.jsx)(sA.ShipActions,{ship:e,layout:"table"===s?"menu":"phone"===s?"sheet":"next"}),squadronsOf:r.data?(0,eh.shipsInSquadrons)(r.data):void 0,labels:l,pluginShipIds:o})})}var sL=e.i(87792),sz=e.i(62687),sD=e.i(90262),sV=e.i(86413),sH=e.i(18423),s$=e.i(88721),sF=e.i(78485),sB=e.i(3979);e.s(["default",0,function({searchParams:e}){var u,h;let m,p=(0,n.useRouter)(),x=function(e){let t=new URLSearchParams;for(let[s,a]of Object.entries(e))for(let e of Array.isArray(a)?a:void 0===a?[]:[a])t.append(s,e);return t}((0,i.use)(e)),f={query:x.get("q")??"",filters:{status:(u=x.get(eR),(m=E.shipStatusSchema.safeParse(u)).success&&"retired"!==m.data?m.data:"all"),crewRequest:(h=x.get(eT),eN.CREW_REQUEST_KEYS.find(e=>e===h)??"all"),type:x.get(eP)??"all",squadron:x.get(eI)??"all",isRetiredShown:"1"===x.get(eO),labelValueIds:x.getAll(eq).filter(e=>(0,eS.idSchema)("labelValue").safeParse(e).success)}},b="new"===x.get("commission"),y=(0,g.useFleetSnapshot)(),C=(0,sH.useLiveFleet)(),N=(0,j.useNow)(),k=(0,s$.useAccountMenu)(N),I=(0,P.messageLimitReached)((0,R.useFleetLimits)().data),O=(0,T.useHostedAccountUrl)(),q=(0,sV.useOpenInboxCount)(),A=(0,sD.useAccess)(),M=(0,sB.usePluginNav)(),[L,z]=(0,i.useState)(!1),[D,V]=(0,i.useState)(!1),[H,$]=(0,i.useState)(!1),F=(0,v.useAttentionCount)();(0,sF.useSignInWhenSessionEnds)([y.error,C.error]);let B=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(eR,e.filters.status),"all"!==e.filters.crewRequest&&t.set(eT,e.filters.crewRequest),"all"!==e.filters.type&&t.set(eP,e.filters.type),"all"!==e.filters.squadron&&t.set(eI,e.filters.squadron),e.filters.isRetiredShown&&t.set(eO,"1"),e.filters.labelValueIds))t.append(eq,s);return t})(e).toString();p.replace(""===t?"/":`/?${t}`,{scroll:!1})};return(0,t.jsxs)(sL.ListLayout,{title:"Fleet overview",description:y.data?function(e){let t=w(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 a=0===s?"":`, ${String(s)} retired`;return`${1===t?"1 active ship":`${String(t)} active ships`} and argo${a}. Changes appear as they happen.`}({ships:y.data,canCommission:A.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)(a.default,{href:"/labels"}),nativeButton:!1,icon:(0,t.jsx)(s.Tag,{}),"data-testid":"overview-labels",children:A.canDefineLabels?"Manage labels":"View labels"}),A.canManage?(0,t.jsx)(Z,{isOpen:H||b,onOpenChange:e=>{$(e),!e&&b&&B(f)}}):null]}),live:C.live,nav:{active:"overview",inboxCount:q,attentionCount:F,...M},onCompose:A.canSend?()=>{z(!0)}:void 0,onSearch:()=>{V(!0)},account:k,banner:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.ConsoleNotices,{}),(0,t.jsx)(d.ConsoleGuide,{})]}),children:[(0,t.jsx)(sz.FleetSegments,{active:"ships",needsCrewCount:M.needsCrewCount}),void 0===I?null:(0,t.jsx)(X.LimitNotice,{...(0,P.messageLimitNotice)(I),accountUrl:O,testId:"overview-message-limit"}),(0,t.jsx)(ec,{}),(0,t.jsx)(S,{}),(0,t.jsx)(sM,{view:f,onViewChange:B,newShipIds:C.newShipIds}),(0,t.jsx)(l.ComposeMessage,{isOpen:L,onOpenChange:z}),(0,t.jsx)(o.ConsoleCommands,{isOpen:D,onOpenChange:V,onCompose:()=>{z(!0)}})]})}],62219)}]);