@microvac/ui 0.0.0-stage → 0.1.0-rc.14

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 (609) hide show
  1. package/README.md +29 -2
  2. package/dist/android-chrome-192x192.png +0 -0
  3. package/dist/android-chrome-512x512.png +0 -0
  4. package/dist/announcement-preview.svg +11 -0
  5. package/dist/apple-touch-icon.png +0 -0
  6. package/dist/assets/ActiveAgentsPanel-C9AP9hJu.js +1 -0
  7. package/dist/assets/AdapterManager-CmxTUKJH.js +1 -0
  8. package/dist/assets/AdvancedToolsRoute-CXsQnTei.js +39 -0
  9. package/dist/assets/AgentActionButtons-DWq2OuVK.js +1 -0
  10. package/dist/assets/AgentAdvancedTab-dhBDxF-H.js +131 -0
  11. package/dist/assets/AgentBulkSettingsSheet-DYT4ovDg.js +1 -0
  12. package/dist/assets/AgentChat-r0TPOfPK.js +1 -0
  13. package/dist/assets/AgentDetailPage-Bc_okBuS.js +39 -0
  14. package/dist/assets/AgentIdentityChip-CB2NBXkZ.js +1 -0
  15. package/dist/assets/AgentRosterFilters-b7qMLv8-.js +2 -0
  16. package/dist/assets/Agents-BsvXy3pZ.js +2 -0
  17. package/dist/assets/Agents.production-BeOZmzaF.js +2 -0
  18. package/dist/assets/AnimatedDialogContent-CWshmxP2.js +1 -0
  19. package/dist/assets/AppDetail-DbqENTF_.js +1 -0
  20. package/dist/assets/AppNotConnected-BhnCqL0F.js +1 -0
  21. package/dist/assets/ApprovalDetail-B2KiYLTj.js +1 -0
  22. package/dist/assets/Approvals-j-wRmqKj.js +1 -0
  23. package/dist/assets/AppsConnect-CcPVEZ0C.js +1 -0
  24. package/dist/assets/AppsReview-B8eWvKkS.js +1 -0
  25. package/dist/assets/ArtifactEmptyGraphic-5mdkS5jj.js +1 -0
  26. package/dist/assets/Artifacts-Bz7Oo6VX.js +1 -0
  27. package/dist/assets/AssigneePickerInner-DdpF7hck.js +1 -0
  28. package/dist/assets/AssistantConnection-BpaaJDc_.js +1 -0
  29. package/dist/assets/AttentionInlineVerbs-DlPQVCO-.js +1 -0
  30. package/dist/assets/AttentionQueueRow-BC6ezctS.js +1 -0
  31. package/dist/assets/AuditHub-BVP7LKL9.js +1 -0
  32. package/dist/assets/AuditRuns-DqizHgX1.js +1 -0
  33. package/dist/assets/Auth-DOF0snjp.js +3 -0
  34. package/dist/assets/BoardChat-BYAbDtfd.js +18 -0
  35. package/dist/assets/BoardClaim-7y41Pr8e.js +1 -0
  36. package/dist/assets/BootstrapSetupUxLab-BftH1vOv.js +1 -0
  37. package/dist/assets/Browse-Ck01W1Yl.js +1 -0
  38. package/dist/assets/BudgetPolicyCard-CKhrzfgy.js +1 -0
  39. package/dist/assets/CaseDetail-qlXKJ66D.js +1 -0
  40. package/dist/assets/CaseStatus-B3RiZVDH.js +1 -0
  41. package/dist/assets/Cases-CFV3V-5X.js +1 -0
  42. package/dist/assets/ChatEndpointDetail-7Hi5TJNt.js +5 -0
  43. package/dist/assets/ChatEndpointSetup-CtwgH6sg.js +1 -0
  44. package/dist/assets/ChatIdentityConfirm-CXjksBwX.js +1 -0
  45. package/dist/assets/CliAuth-KVjrGMfZ.js +1 -0
  46. package/dist/assets/Companies-oeJem3De.js +1 -0
  47. package/dist/assets/CompanyAccess-vWT6G-n_.js +1 -0
  48. package/dist/assets/CompanyActivity-zOzzeN1B.js +1 -0
  49. package/dist/assets/CompanyActivity.production-DbaFBsM0.js +1 -0
  50. package/dist/assets/CompanyConnections-llSEaVa2.js +1 -0
  51. package/dist/assets/CompanyEnvironments-BrP-ENHg.css +1 -0
  52. package/dist/assets/CompanyEnvironments-DNyyGC_S.js +35 -0
  53. package/dist/assets/CompanyExport-CFa-F8Es.js +4 -0
  54. package/dist/assets/CompanyImport-DG6qwQ8F.js +1 -0
  55. package/dist/assets/CompanySettings-Dv5Z3ZQi.js +1 -0
  56. package/dist/assets/CompanySettingsPluginPage-CZk1d_0d.js +1 -0
  57. package/dist/assets/CompanySkills-CdzWhJfQ.js +10 -0
  58. package/dist/assets/CompanySkills.production-IoCRW5FQ.js +10 -0
  59. package/dist/assets/ConfigureBuiltInAgentModal-BwW7XQ1O.js +1 -0
  60. package/dist/assets/CopyableGatewayUrl-PTn061ft.js +1 -0
  61. package/dist/assets/CordisPluginSettings-C_BeeGEc.js +1 -0
  62. package/dist/assets/Costs-DhuNxwSj.js +1 -0
  63. package/dist/assets/CrossIssueCollaborationUxLab-ZaAXq46r.js +1 -0
  64. package/dist/assets/Dashboard-BaDnqiKo.js +2 -0
  65. package/dist/assets/DashboardLive-D-Ed7osd.js +1 -0
  66. package/dist/assets/DecisionDateChips-D3pl_mLn.js +1 -0
  67. package/dist/assets/DecisionHistoryPanel-D5MzyrOh.js +1 -0
  68. package/dist/assets/DecisionQueuePage-D3UZ9oRk.js +1 -0
  69. package/dist/assets/DesignGuide-COTo7ICj.js +25 -0
  70. package/dist/assets/DesignSandboxTaskThread-CMeCSQid.js +28 -0
  71. package/dist/assets/EmailConnectionAccess-kCL7obSr.js +1 -0
  72. package/dist/assets/EmailEndpointSetup-BGrksR_u.js +1 -0
  73. package/dist/assets/EnforcementBanner-_Eb_nK3M.js +1 -0
  74. package/dist/assets/EntityRow-gpsOgEtu.js +1 -0
  75. package/dist/assets/ExecutionWorkspaceDetail-DwGkH6d3.js +19 -0
  76. package/dist/assets/ExternalAgentInviteDialog-CGid6pM9.js +50 -0
  77. package/dist/assets/FilterBar-1D-VhrvG.js +1 -0
  78. package/dist/assets/FolderControls-CQ6kef3c.js +1 -0
  79. package/dist/assets/GatewayDetail-CCqekM1J.js +2 -0
  80. package/dist/assets/GatewaysList-nFsRcszh.js +1 -0
  81. package/dist/assets/GitHubConnectionRecovery-B9sFWJup.js +1 -0
  82. package/dist/assets/GoalDetail-BQ8y55P-.js +1 -0
  83. package/dist/assets/GoalTree-laRjXp0P.js +1 -0
  84. package/dist/assets/Goals-Cm14EaeP.js +1 -0
  85. package/dist/assets/InstanceAccess-DxQ-Akt_.js +1 -0
  86. package/dist/assets/InstanceExperimentalSettings-BxwqbXNw.js +1 -0
  87. package/dist/assets/InviteLanding-Cf0L_u6s.js +1 -0
  88. package/dist/assets/IssueChatLongThreadPerf-BfsF6FdF.js +2 -0
  89. package/dist/assets/JoinRequestQueue-BXCdTFG_.js +1 -0
  90. package/dist/assets/Layout.production-CqzU0qMi.js +1 -0
  91. package/dist/assets/McpConnect-COWnZ9Eb.js +1 -0
  92. package/dist/assets/MembershipAction-C9i9Sdmi.js +1 -0
  93. package/dist/assets/MetricCard-Bwnt3_p3.js +1 -0
  94. package/dist/assets/MissingPluginTabPlaceholder-B0Zxv1Kx.js +1 -0
  95. package/dist/assets/NewAgent-BIlJ5Dyt.js +1 -0
  96. package/dist/assets/NewAgentDialog-CJdMxxYL.js +1 -0
  97. package/dist/assets/NewGoalDialog-B8izfKLm.js +1 -0
  98. package/dist/assets/NewProjectDialog-DXqjTYFK.js +1 -0
  99. package/dist/assets/OnboardingPrimitives-DHYBqn_0.js +1 -0
  100. package/dist/assets/OnboardingWizard-DqSfZ13V.js +2 -0
  101. package/dist/assets/OrgChart.production-DrSFUf7i.js +1 -0
  102. package/dist/assets/PaperclipCloudOAuthHandoff-jPUvjJ8q.js +1 -0
  103. package/dist/assets/PluginManager-h3LFPaUq.js +1 -0
  104. package/dist/assets/PluginPage-E5Im4454.js +1 -0
  105. package/dist/assets/PluginSettings-BBO0jAgo.js +1 -0
  106. package/dist/assets/ProfileDetailRoute-CQBD7fms.js +1 -0
  107. package/dist/assets/ProfileSettings-BwnVEHLp.js +1 -0
  108. package/dist/assets/ProfileWizardRoute-By_SC6Gn.js +1 -0
  109. package/dist/assets/ProjectDetail-CbiwFBAE.js +1 -0
  110. package/dist/assets/ProjectRepositoryInput-DZF9bX4E.js +1 -0
  111. package/dist/assets/ProjectWorkspaceDetail-DPsl_4bD.js +29 -0
  112. package/dist/assets/ProjectWorkspacesContent-COH4dOWK.js +1 -0
  113. package/dist/assets/Projects-Ch9Qu7sn.js +1 -0
  114. package/dist/assets/QuotaBar-DIFOT9Uh.js +1 -0
  115. package/dist/assets/RepositoryEditor-DHB1bqId.js +1 -0
  116. package/dist/assets/Responsibilities-C5O0JXXG.js +4 -0
  117. package/dist/assets/ResponsibilityDetail-D6NpZpkm.js +1 -0
  118. package/dist/assets/ResponsibleUserDenialUxLab-CFrIWYwe.js +1 -0
  119. package/dist/assets/ReviewQueueCard-BPC4Lm67.js +1 -0
  120. package/dist/assets/RoutineAuditActivity-sKyzMajz.js +1 -0
  121. package/dist/assets/RoutineDetail-CG8HF5fp.js +2 -0
  122. package/dist/assets/RoutineRunVariablesDialog-CKh3CmLD.js +1 -0
  123. package/dist/assets/Routines-tF2qfUKo.js +1 -0
  124. package/dist/assets/Routines.production-BTyj1Ljr.js +1 -0
  125. package/dist/assets/RoutinesToolbar-CvUFVCGN.js +1 -0
  126. package/dist/assets/Search-Z9D0NuS1.js +1 -0
  127. package/dist/assets/Secrets-DgmbLOJK.js +4 -0
  128. package/dist/assets/SkillBinaryFile-F3_9qcaM.js +1 -0
  129. package/dist/assets/SkillCardIcon-CXHUCMej.js +2 -0
  130. package/dist/assets/SkillFolderTree-CB3lrTIE.js +1 -0
  131. package/dist/assets/SkillSourceTree-BbuciCo6.js +2 -0
  132. package/dist/assets/SkillSources-Dlo6Cew3.js +2 -0
  133. package/dist/assets/SkillStudio-ZO-Nf7eI.js +9 -0
  134. package/dist/assets/SkillsNavigationTabs-B9Iqnlqt.js +1 -0
  135. package/dist/assets/SpekoPhoneCallback-C4VnMiZh.js +1 -0
  136. package/dist/assets/SpekoProviderSetup-I4evPZb3.js +1 -0
  137. package/dist/assets/StatusCards-D0MVzbsw.js +1 -0
  138. package/dist/assets/SummarySlotCard-DUXgZPxG.js +1 -0
  139. package/dist/assets/TailscaleConnector-CMhT73gj.js +1 -0
  140. package/dist/assets/TaskChatLab-D9-KAE-7.js +11 -0
  141. package/dist/assets/TaskSummaryList-CUxieFNe.js +1 -0
  142. package/dist/assets/Timeline-BNMoRbtK.js +1 -0
  143. package/dist/assets/ToolsAdminGate-CEr0zy2T.js +1 -0
  144. package/dist/assets/TrustPresetSection-B9YXZtkh.js +1 -0
  145. package/dist/assets/UserProfile-D-tnW96X.js +1 -0
  146. package/dist/assets/WebhookUrlWarning-Ba_DixKh.js +1 -0
  147. package/dist/assets/WhatNeedsMe-B-Jzj8_M.js +1 -0
  148. package/dist/assets/Workspaces-BqhDI_Bl.js +1 -0
  149. package/dist/assets/abnfDiagram-YUKMZFIV-Bn9P-nUW.js +1 -0
  150. package/dist/assets/apl-MHzTCvfx.js +1 -0
  151. package/dist/assets/arc-Dnq9Aszq.js +1 -0
  152. package/dist/assets/architecture-WOLXFQ4H-V1ldsZlt.js +1 -0
  153. package/dist/assets/architectureDiagram-47P4ROYG-BkYxt-Gc.js +36 -0
  154. package/dist/assets/array-CL5Tisss.js +1 -0
  155. package/dist/assets/arrow-down-left-o81ENfeW.js +1 -0
  156. package/dist/assets/asciiarmor-DFLNSgns.js +1 -0
  157. package/dist/assets/asn1-CfPVWRYE.js +1 -0
  158. package/dist/assets/asterisk-CJ4OeA7Y.js +1 -0
  159. package/dist/assets/blockDiagram-E7TT5TSB-BO7pPYbp.js +140 -0
  160. package/dist/assets/brainfuck-NEHkmXMc.js +1 -0
  161. package/dist/assets/budgets-0Dw6TH1A.js +1 -0
  162. package/dist/assets/building-complex-DciZTnys.js +1 -0
  163. package/dist/assets/c4Diagram-CRA5TL53-D4EpmmzV.js +38 -0
  164. package/dist/assets/channel-BQh2vFIU.js +1 -0
  165. package/dist/assets/character-CguPM7IG.js +1 -0
  166. package/dist/assets/chat-channels-DWyry-9M.js +1 -0
  167. package/dist/assets/chunk-2BW5OAIV-DFXIyCJy.js +10 -0
  168. package/dist/assets/chunk-2Q5K7J3B-CkPHWFj-.js +1 -0
  169. package/dist/assets/chunk-3YJQHVM4-Dj5wEKIw.js +2 -0
  170. package/dist/assets/chunk-4EA7E6EY-5XiUVgzK.js +1 -0
  171. package/dist/assets/chunk-5VM5RSS4-2H3r6wq0.js +15 -0
  172. package/dist/assets/chunk-7TKQ45FW-D0opKcsy.js +1 -0
  173. package/dist/assets/chunk-AW2ZBBNX-DnjsTe04.js +88 -0
  174. package/dist/assets/chunk-DBDB3WZW-DNqSQPZ0.js +1 -0
  175. package/dist/assets/chunk-DUW6YSOI-slPglwIh.js +1 -0
  176. package/dist/assets/chunk-E2ZNV5FY-cjSf_BTz.js +70 -0
  177. package/dist/assets/chunk-EU5HNXII-CZYBiaSw.js +213 -0
  178. package/dist/assets/chunk-FVRAUYC3-DSc0-wJA.js +2 -0
  179. package/dist/assets/chunk-HJ2JQQFS-MXK0gYSP.js +1 -0
  180. package/dist/assets/chunk-HTAEGDNF-BjDZm_5k.js +1 -0
  181. package/dist/assets/chunk-J5ZVWO5B-ClU583ja.js +1 -0
  182. package/dist/assets/chunk-JWPE2WC7--HEGjv3t.js +1 -0
  183. package/dist/assets/chunk-KQW6MTUR-Bfj0tDmO.js +1 -0
  184. package/dist/assets/chunk-NGNAAXSQ-e5XI1hSt.js +128 -0
  185. package/dist/assets/chunk-NTY3LDVX-Bpz5TkVb.js +1 -0
  186. package/dist/assets/chunk-VPRB5NB3-CfeHjtbb.js +129 -0
  187. package/dist/assets/chunk-XC4XBNZT-FBCWmi6K.js +62 -0
  188. package/dist/assets/chunk-XXDRQBXY-BdWplhUD.js +1 -0
  189. package/dist/assets/chunk-Y2CYZVJY-OvsAdhaO.js +1 -0
  190. package/dist/assets/circle-slash-DqKFFqfb.js +1 -0
  191. package/dist/assets/classDiagram-v2-K4WV4PDN-DbC_J0kK.js +217 -0
  192. package/dist/assets/clike-CIx9nZSv.js +1 -0
  193. package/dist/assets/clojure-DFaIEz5O.js +1 -0
  194. package/dist/assets/cmake-koz-qBlo.js +1 -0
  195. package/dist/assets/cobol-Bo8Zw9gB.js +1 -0
  196. package/dist/assets/coffeescript-CXYzYf-Y.js +1 -0
  197. package/dist/assets/coins-BztUbqyl.js +1 -0
  198. package/dist/assets/collections-BxrcELwt.js +3 -0
  199. package/dist/assets/commonlisp-C4OOCwkD.js +1 -0
  200. package/dist/assets/company-skill-routes-D5LJ1l8M.js +1 -0
  201. package/dist/assets/company-skill-summary-DnWVmP1S.js +1 -0
  202. package/dist/assets/configuration-warnings-CZKSfHJv.js +2 -0
  203. package/dist/assets/connection-owner-D-ikSHyR.js +1 -0
  204. package/dist/assets/cose-bilkent-JH36ORCC-DFyVDb92.js +1 -0
  205. package/dist/assets/crystal-BlJXQDvy.js +1 -0
  206. package/dist/assets/css-DEZwfVpY.js +1 -0
  207. package/dist/assets/cynefin-EF2NZ3EQ-COwSJ4qP.js +1 -0
  208. package/dist/assets/cynefinDiagram-3GCD6N5R-diaEJq9Y.js +62 -0
  209. package/dist/assets/cypher-z2oFsVv2.js +1 -0
  210. package/dist/assets/cytoscape.esm-C2vp4vBx.js +321 -0
  211. package/dist/assets/d-Dkt6y7AQ.js +1 -0
  212. package/dist/assets/dagre-W4DXFKR2-BPAMRuIj.js +4 -0
  213. package/dist/assets/defaultLocale-C2Bpu8Ih.js +1 -0
  214. package/dist/assets/definition-DxwMBXnu.js +1 -0
  215. package/dist/assets/diagram-2UJZ2QOL-BvRnO1Id.js +200 -0
  216. package/dist/assets/diagram-OVF4WLC6-CDgBeD0m.js +24 -0
  217. package/dist/assets/diagram-PFPMY2P6-DAw9lREG.js +30 -0
  218. package/dist/assets/diagram-UMYRVEAY-ZQqQn22t.js +24 -0
  219. package/dist/assets/diagram-YEKJPTXX-CoJtGgWs.js +41 -0
  220. package/dist/assets/diagram-ZIFT7M5P-qW_Zn_bO.js +3 -0
  221. package/dist/assets/diff-C60bAYOU.js +1 -0
  222. package/dist/assets/dist-B2E6oBK1.js +1 -0
  223. package/dist/assets/dist-B6Qde8KJ.js +1 -0
  224. package/dist/assets/dist-BCJybC91.js +1 -0
  225. package/dist/assets/dist-CG-phytt.js +1 -0
  226. package/dist/assets/dist-CG6fC1Db.js +1 -0
  227. package/dist/assets/dist-CPgRB-NQ.js +1 -0
  228. package/dist/assets/dist-CTlCK4Pe.js +1 -0
  229. package/dist/assets/dist-CYRzGbSY.js +7 -0
  230. package/dist/assets/dist-Cd7wdKYE.js +39 -0
  231. package/dist/assets/dist-CdmdXwCZ.js +1 -0
  232. package/dist/assets/dist-CeSzCyeG.js +1 -0
  233. package/dist/assets/dist-CjRqeLFz.js +2 -0
  234. package/dist/assets/dist-CuwPDbnL.js +1 -0
  235. package/dist/assets/dist-CvRpZH53.js +1 -0
  236. package/dist/assets/dist-DKyBHaH2.js +1 -0
  237. package/dist/assets/dist-DML0cJH3.js +13 -0
  238. package/dist/assets/dist-DXjkgaZX.js +1 -0
  239. package/dist/assets/dist-DZIxMHOT.js +1 -0
  240. package/dist/assets/dist-DZruZxAk.js +1 -0
  241. package/dist/assets/dist-DbXGl-wj.js +3 -0
  242. package/dist/assets/dist-Dl94YqeS.js +1 -0
  243. package/dist/assets/dist-DylHAy-6.js +1 -0
  244. package/dist/assets/dist-IcdxEhjC.js +1 -0
  245. package/dist/assets/dist-_EtfntKJ.js +6 -0
  246. package/dist/assets/dist-ptDa9fKh.js +1 -0
  247. package/dist/assets/dockerfile-BttNdtK0.js +1 -0
  248. package/dist/assets/dtd-CCVZU5Da.js +1 -0
  249. package/dist/assets/dylan-3pmV5wzs.js +1 -0
  250. package/dist/assets/ebnf-bm-I2WIh.js +1 -0
  251. package/dist/assets/ebnfDiagram-VR2GEFS7-DA4UvKXV.js +1 -0
  252. package/dist/assets/ecl-BIv3PrZb.js +1 -0
  253. package/dist/assets/eiffel-DuLnr4-r.js +1 -0
  254. package/dist/assets/elk-IJKZMXRS-CM74d3mJ.js +25 -0
  255. package/dist/assets/elm-njbaCU-L.js +1 -0
  256. package/dist/assets/erDiagram-O2IAPWRE-d869V0qL.js +99 -0
  257. package/dist/assets/erlang-CuhOC2I8.js +1 -0
  258. package/dist/assets/eventmodeling-K75KTNOO-C-oz_eyI.js +1 -0
  259. package/dist/assets/factor-CM3-9V3b.js +1 -0
  260. package/dist/assets/fcl-nWsMJ92o.js +1 -0
  261. package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +1 -0
  262. package/dist/assets/folder-plus-CxWXoYCi.js +1 -0
  263. package/dist/assets/forth-BQ9HrCVY.js +1 -0
  264. package/dist/assets/fortran-DHJe28ev.js +1 -0
  265. package/dist/assets/ganttDiagram-R7TSEDQI-BBul4Kpm.js +292 -0
  266. package/dist/assets/gas-ByO0qYMr.js +1 -0
  267. package/dist/assets/gherkin-CwOmHL5K.js +1 -0
  268. package/dist/assets/gitGraph-VSP46ZUC-BriEZgAq.js +1 -0
  269. package/dist/assets/gitGraphDiagram-XJZIOB7I-I12rg8s1.js +106 -0
  270. package/dist/assets/goals-CvMWzjH4.js +1 -0
  271. package/dist/assets/googleAccessRemoval-CQIi1dvu.js +1 -0
  272. package/dist/assets/graphlib-DHhK3saS.js +1 -0
  273. package/dist/assets/groovy-ByXGF8cx.js +1 -0
  274. package/dist/assets/haskell-CHSpCNOy.js +1 -0
  275. package/dist/assets/haxe-P2jh68ck.js +1 -0
  276. package/dist/assets/http-0jwMmfWP.js +1 -0
  277. package/dist/assets/idl-DTVVj6r5.js +1 -0
  278. package/dist/assets/index-Bt31d8ga.js +706 -0
  279. package/dist/assets/index-z7lcCz2I.css +1 -0
  280. package/dist/assets/info-OHQRW6UA-CxrcGiem.js +1 -0
  281. package/dist/assets/infoDiagram-5W2HQ5XZ-4Sm0LiOu.js +2 -0
  282. package/dist/assets/init-BXPE0p7i.js +1 -0
  283. package/dist/assets/invite-memory-BKdqfr5K.js +1 -0
  284. package/dist/assets/ishikawaDiagram-K3B6WC7H-CKXvKV-s.js +70 -0
  285. package/dist/assets/issue-detail-4PCbYpdv.js +119 -0
  286. package/dist/assets/javascript-Cblpdx44.js +1 -0
  287. package/dist/assets/journeyDiagram-COXZFDF6-BHsrZLvQ.js +139 -0
  288. package/dist/assets/julia-KVJvUu_F.js +1 -0
  289. package/dist/assets/kanban-definition-P3RFRI5V-8HhnIs_l.js +89 -0
  290. package/dist/assets/katex-Du_FPwxl.js +257 -0
  291. package/dist/assets/line-rrKrpB-b.js +1 -0
  292. package/dist/assets/linear-BRQgexd0.js +1 -0
  293. package/dist/assets/link-BecLzmfo.js +1 -0
  294. package/dist/assets/list-filter-BC3D4IoX.js +1 -0
  295. package/dist/assets/livescript-DSHsJPcD.js +1 -0
  296. package/dist/assets/log-in-BJCGwGGT.js +1 -0
  297. package/dist/assets/lua-Vher-70I.js +1 -0
  298. package/dist/assets/mathematica-CE9SaVsW.js +1 -0
  299. package/dist/assets/mbox-JGl1Fgvq.js +1 -0
  300. package/dist/assets/mcpSkills-DRs3pGKn.js +1 -0
  301. package/dist/assets/mermaid-parser.core-DmG0b4S0.js +7 -0
  302. package/dist/assets/mermaid.core-D1vILTuF.js +42 -0
  303. package/dist/assets/mindmap-definition-LZFPQGKD-DIMpL0de.js +96 -0
  304. package/dist/assets/mirc-BGWbO906.js +1 -0
  305. package/dist/assets/mllike-DuNQsEw8.js +1 -0
  306. package/dist/assets/model-DL5biheO.js +1 -0
  307. package/dist/assets/modelica-5XCgKQt8.js +1 -0
  308. package/dist/assets/mscgen-mVFg19ri.js +1 -0
  309. package/dist/assets/mumps-C7oS353s.js +1 -0
  310. package/dist/assets/nginx-DXVlpyCz.js +1 -0
  311. package/dist/assets/nsis-KFC6hioG.js +1 -0
  312. package/dist/assets/ntriples-5ckCopnn.js +1 -0
  313. package/dist/assets/octave-D1J2QQNt.js +1 -0
  314. package/dist/assets/onboarding-state-C5_mIw3o.js +1 -0
  315. package/dist/assets/ordinal-BJyFM1v8.js +1 -0
  316. package/dist/assets/oz-CPsllMDD.js +1 -0
  317. package/dist/assets/packet-JDAUHWVQ-BnbYht3G.js +1 -0
  318. package/dist/assets/palette-tokens-CL5ZDrEd.js +1 -0
  319. package/dist/assets/pascal-B-I6JP0Y.js +1 -0
  320. package/dist/assets/path-D6mommQw.js +1 -0
  321. package/dist/assets/pegDiagram-BGZESJAR-BUjtJVjT.js +1 -0
  322. package/dist/assets/perl-CI8WIWBi.js +1 -0
  323. package/dist/assets/pie-XZMESJXO-CM4VXUb-.js +1 -0
  324. package/dist/assets/pieDiagram-CAPJLFHJ-B3v8ryvG.js +39 -0
  325. package/dist/assets/pig-FQI0W3S3.js +1 -0
  326. package/dist/assets/portable-files-CloN_vbk.js +1 -0
  327. package/dist/assets/power-0mw59G-l.js +1 -0
  328. package/dist/assets/powershell-BAu6x78A.js +1 -0
  329. package/dist/assets/prod-C6Q7tISe.js +495 -0
  330. package/dist/assets/profile-summary-B5rPf8v-.js +1 -0
  331. package/dist/assets/properties-BKTTDgau.js +1 -0
  332. package/dist/assets/protobuf-UWh8gh_j.js +1 -0
  333. package/dist/assets/pug-C20tNwmy.js +1 -0
  334. package/dist/assets/puppet-BAHVzCkO.js +1 -0
  335. package/dist/assets/python-C2DOnsac.js +1 -0
  336. package/dist/assets/q-Cooe-Nh8.js +1 -0
  337. package/dist/assets/quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js +7 -0
  338. package/dist/assets/r-CktBKya9.js +1 -0
  339. package/dist/assets/radar-ABXABTNO-v6yZj4Fk.js +1 -0
  340. package/dist/assets/railroad-I3PHUGI6-D-U8Cs0m.js +1 -0
  341. package/dist/assets/railroad-abnf-LNEFI6M7-Dw3fkrVy.js +1 -0
  342. package/dist/assets/railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js +1 -0
  343. package/dist/assets/railroad-peg-JR7BVNR7-Bf8u1-RZ.js +1 -0
  344. package/dist/assets/railroadDiagram-SM67HX2B-Drr5UhQI.js +1 -0
  345. package/dist/assets/requirementDiagram-X7JNWC4A-D5ef6_ac.js +84 -0
  346. package/dist/assets/rolldown-runtime-DhZMWcEn.js +1 -0
  347. package/dist/assets/rough.esm-DnC5Tr1g.js +1 -0
  348. package/dist/assets/rpm-Csj9nLHl.js +1 -0
  349. package/dist/assets/ruby-bGx9eo-K.js +1 -0
  350. package/dist/assets/runtime-IAg0vdY9.js +4137 -0
  351. package/dist/assets/sankeyDiagram-UM26HJRW-DncJWIz_.js +40 -0
  352. package/dist/assets/sas-Drou_EQ9.js +1 -0
  353. package/dist/assets/saved-permissions-CizWg8-P.js +1 -0
  354. package/dist/assets/scheme-DcjG9bAf.js +1 -0
  355. package/dist/assets/scroll-text-Ck6HB7eM.js +1 -0
  356. package/dist/assets/sdk-CWyUlmcn.js +1 -0
  357. package/dist/assets/search-DkTqg7ab.js +1 -0
  358. package/dist/assets/send-CYVi50sh.js +1 -0
  359. package/dist/assets/sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js +169 -0
  360. package/dist/assets/shared-CIwISWMj.js +1 -0
  361. package/dist/assets/shell-BSKClwid.js +1 -0
  362. package/dist/assets/sieve-CcvsXPZo.js +1 -0
  363. package/dist/assets/simple-mode-B79cVo-x.js +1 -0
  364. package/dist/assets/sizeCapture-INFHLROL-XURNLuv_.js +1 -0
  365. package/dist/assets/skill-source-connect-return-eFTeuj7y.js +1 -0
  366. package/dist/assets/smalltalk-Cmg-4mjQ.js +1 -0
  367. package/dist/assets/smoke-lab-matrix-A7ubFpfk.js +1 -0
  368. package/dist/assets/solr-Dj8ahEwG.js +1 -0
  369. package/dist/assets/sparql-LAJYmgfk.js +1 -0
  370. package/dist/assets/spreadsheet-B8doD_pL.js +1 -0
  371. package/dist/assets/sql-C3kWxFGw.js +1 -0
  372. package/dist/assets/src-DYjgETqR.js +1 -0
  373. package/dist/assets/stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js +291 -0
  374. package/dist/assets/stex-CW6K5Nmu.js +1 -0
  375. package/dist/assets/stylus-BS-Ienrc.js +1 -0
  376. package/dist/assets/swift-BD82LMDK.js +1 -0
  377. package/dist/assets/swimlanes-N4OXWK64-NXVbx1w8.js +1 -0
  378. package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +8 -0
  379. package/dist/assets/tcl-RZa1cqc-.js +1 -0
  380. package/dist/assets/textile-C-BY_OGF.js +1 -0
  381. package/dist/assets/tiddlywiki-C9bm_Oju.js +1 -0
  382. package/dist/assets/tiki-DJOT-rFT.js +1 -0
  383. package/dist/assets/timeline-definition-YOQAKGHF-DqI-Mv2e.js +120 -0
  384. package/dist/assets/toml-Civ2fTsu.js +1 -0
  385. package/dist/assets/treeView-D4JQ5SDB-CZBlE7ya.js +1 -0
  386. package/dist/assets/treemap-SAJKECNS-BlueznID.js +1 -0
  387. package/dist/assets/troff-Lns35Xcq.js +1 -0
  388. package/dist/assets/ttcn-7vlxVTUK.js +1 -0
  389. package/dist/assets/ttcn-cfg-B8qhhp6o.js +1 -0
  390. package/dist/assets/turtle-DTIS1YQ7.js +1 -0
  391. package/dist/assets/useAgentlessOnboardingAutoOpen-CnFwEQ-H.js +1 -0
  392. package/dist/assets/useAuthorizationWindow-DnFQsiFj.js +1 -0
  393. package/dist/assets/useDateRange-9EbqkWXy.js +1 -0
  394. package/dist/assets/useFastResponsesEnabled-D8dunm4j.js +1 -0
  395. package/dist/assets/usePageView-BiX5i8ck.js +1 -0
  396. package/dist/assets/useProfilesData-0VYQ4lAT.js +1 -0
  397. package/dist/assets/useReviewCount-WBWxwKI3.js +1 -0
  398. package/dist/assets/useRoutineFormOptions-DnX5DBn1.js +3 -0
  399. package/dist/assets/useSummaryDraftStream-DPQRvaXT.js +3 -0
  400. package/dist/assets/useTailscaleConnections-BDff6dWx.js +1 -0
  401. package/dist/assets/usecaseDiagram-VIAY4XPW-BSDn8OaJ.js +362 -0
  402. package/dist/assets/vb-BO8UacKu.js +1 -0
  403. package/dist/assets/vbscript-DWLru3lT.js +1 -0
  404. package/dist/assets/velocity-BIIn-Nl2.js +1 -0
  405. package/dist/assets/vennDiagram-BLWOH2XV-BBSA9KNN.js +34 -0
  406. package/dist/assets/verilog-BVYlmXGg.js +1 -0
  407. package/dist/assets/vhdl-Cn8cC8Yb.js +1 -0
  408. package/dist/assets/wardley-7MLQ67FV-CsT-rTZ9.js +1 -0
  409. package/dist/assets/wardleyDiagram-YMQ3BMBF-BLClsIjw.js +78 -0
  410. package/dist/assets/webidl-ChvzbZ5-.js +1 -0
  411. package/dist/assets/xquery-BKN7qEbU.js +1 -0
  412. package/dist/assets/xychartDiagram-TAQBALBS-2x4wB0gq.js +7 -0
  413. package/dist/assets/yacas-BG9ha7tU.js +1 -0
  414. package/dist/assets/z80-CB2cGLew.js +1 -0
  415. package/dist/brands/adapters/LICENSE +21 -0
  416. package/dist/brands/adapters/README.md +7 -0
  417. package/dist/brands/adapters/cursor-dark.svg +1 -0
  418. package/dist/brands/adapters/cursor.svg +1 -0
  419. package/dist/brands/adapters/gemini-color.svg +1 -0
  420. package/dist/brands/adapters/grok-dark.svg +1 -0
  421. package/dist/brands/adapters/grok.svg +1 -0
  422. package/dist/brands/adapters/hermesagent-dark.svg +1 -0
  423. package/dist/brands/adapters/hermesagent.svg +1 -0
  424. package/dist/brands/adapters/kimi-color-light.svg +1 -0
  425. package/dist/brands/adapters/kimi-color.svg +1 -0
  426. package/dist/brands/adapters/openai-dot.README.md +7 -0
  427. package/dist/brands/adapters/openai-dot.svg +3 -0
  428. package/dist/brands/adapters/pi-dark.svg +1 -0
  429. package/dist/brands/adapters/pi.svg +1 -0
  430. package/dist/brands/apps/1password-dark.svg +1 -0
  431. package/dist/brands/apps/1password.svg +1 -0
  432. package/dist/brands/apps/LOBE-LICENSE +21 -0
  433. package/dist/brands/apps/agentmail-dark.svg +16 -0
  434. package/dist/brands/apps/agentmail.svg +17 -0
  435. package/dist/brands/apps/airtable.svg +1 -0
  436. package/dist/brands/apps/anthropic-dark.svg +1 -0
  437. package/dist/brands/apps/anthropic.svg +1 -0
  438. package/dist/brands/apps/antigravity.svg +31 -0
  439. package/dist/brands/apps/api-key-generic.svg +1 -0
  440. package/dist/brands/apps/arcade.png +0 -0
  441. package/dist/brands/apps/asana.svg +12 -0
  442. package/dist/brands/apps/aws-dark.svg +1 -0
  443. package/dist/brands/apps/aws.svg +1 -0
  444. package/dist/brands/apps/bedrock.svg +1 -0
  445. package/dist/brands/apps/beehiiv.png +0 -0
  446. package/dist/brands/apps/bitly.svg +1 -0
  447. package/dist/brands/apps/box.svg +1 -0
  448. package/dist/brands/apps/braintrust-dark.png +0 -0
  449. package/dist/brands/apps/braintrust.png +0 -0
  450. package/dist/brands/apps/brex-dark.svg +1 -0
  451. package/dist/brands/apps/brex.svg +1 -0
  452. package/dist/brands/apps/browser-use.svg +6 -0
  453. package/dist/brands/apps/calendly.png +0 -0
  454. package/dist/brands/apps/candid.png +0 -0
  455. package/dist/brands/apps/circleback.png +0 -0
  456. package/dist/brands/apps/clickhouse-dark.svg +1 -0
  457. package/dist/brands/apps/clickhouse.svg +1 -0
  458. package/dist/brands/apps/clickup.png +0 -0
  459. package/dist/brands/apps/cloudflare.svg +1 -0
  460. package/dist/brands/apps/cloudinary-dark.svg +1 -0
  461. package/dist/brands/apps/cloudinary.svg +3 -0
  462. package/dist/brands/apps/coda.svg +1 -0
  463. package/dist/brands/apps/cognee.png +0 -0
  464. package/dist/brands/apps/composio-dark.svg +11 -0
  465. package/dist/brands/apps/composio.svg +16 -0
  466. package/dist/brands/apps/connection-pool.svg +1 -0
  467. package/dist/brands/apps/context7-dark.svg +8 -0
  468. package/dist/brands/apps/context7.svg +8 -0
  469. package/dist/brands/apps/daytona-dark.svg +1 -0
  470. package/dist/brands/apps/daytona.svg +1 -0
  471. package/dist/brands/apps/discord-dark.svg +1 -0
  472. package/dist/brands/apps/discord.svg +1 -0
  473. package/dist/brands/apps/ditto.png +0 -0
  474. package/dist/brands/apps/egnyte.svg +1 -0
  475. package/dist/brands/apps/embat.svg +1 -0
  476. package/dist/brands/apps/enterpret.png +0 -0
  477. package/dist/brands/apps/exa.svg +5 -0
  478. package/dist/brands/apps/executor.png +0 -0
  479. package/dist/brands/apps/firecrawl.svg +12 -0
  480. package/dist/brands/apps/fireflies.svg +76 -0
  481. package/dist/brands/apps/gauge.png +0 -0
  482. package/dist/brands/apps/github-copilot-dark.svg +1 -0
  483. package/dist/brands/apps/github-copilot.svg +1 -0
  484. package/dist/brands/apps/github-dark.svg +10 -0
  485. package/dist/brands/apps/github.svg +10 -0
  486. package/dist/brands/apps/gmail.svg +1 -0
  487. package/dist/brands/apps/google-calendar.svg +1 -0
  488. package/dist/brands/apps/google-chat.svg +1 -0
  489. package/dist/brands/apps/google-docs.svg +1 -0
  490. package/dist/brands/apps/google-drive.svg +1 -0
  491. package/dist/brands/apps/google-people.svg +1 -0
  492. package/dist/brands/apps/google-sheets.svg +1 -0
  493. package/dist/brands/apps/google-slides.svg +1 -0
  494. package/dist/brands/apps/google-workspace-search.svg +1 -0
  495. package/dist/brands/apps/google.svg +1 -0
  496. package/dist/brands/apps/gsc-wizard.png +0 -0
  497. package/dist/brands/apps/honcho.svg +33 -0
  498. package/dist/brands/apps/hugging-face.svg +8 -0
  499. package/dist/brands/apps/imessage-photon.png +0 -0
  500. package/dist/brands/apps/jam-dev-dark.svg +1 -0
  501. package/dist/brands/apps/jam-dev.svg +1 -0
  502. package/dist/brands/apps/jira-dark.svg +1 -0
  503. package/dist/brands/apps/jira.svg +4 -0
  504. package/dist/brands/apps/kernel.svg +3 -0
  505. package/dist/brands/apps/klaviyo.png +0 -0
  506. package/dist/brands/apps/linear-dark.svg +5 -0
  507. package/dist/brands/apps/linear.svg +5 -0
  508. package/dist/brands/apps/local-falcon.png +0 -0
  509. package/dist/brands/apps/make-dark.svg +1 -0
  510. package/dist/brands/apps/make.svg +1 -0
  511. package/dist/brands/apps/manifest.json +756 -0
  512. package/dist/brands/apps/manufact-dark.svg +6 -0
  513. package/dist/brands/apps/manufact.svg +5 -0
  514. package/dist/brands/apps/mem0.svg +1 -0
  515. package/dist/brands/apps/microsoft-teams.svg +68 -0
  516. package/dist/brands/apps/miro-dark.svg +1 -0
  517. package/dist/brands/apps/miro.svg +4 -0
  518. package/dist/brands/apps/mixpanel-dark.svg +1 -0
  519. package/dist/brands/apps/mixpanel.svg +1 -0
  520. package/dist/brands/apps/monday-dark.png +0 -0
  521. package/dist/brands/apps/monday.png +0 -0
  522. package/dist/brands/apps/neon.png +0 -0
  523. package/dist/brands/apps/netlify-dark.svg +1 -0
  524. package/dist/brands/apps/netlify.svg +16 -0
  525. package/dist/brands/apps/notion-dark.svg +1 -0
  526. package/dist/brands/apps/notion.svg +1 -0
  527. package/dist/brands/apps/oauth-generic.svg +1 -0
  528. package/dist/brands/apps/openai-dark.svg +1 -0
  529. package/dist/brands/apps/openai.svg +1 -0
  530. package/dist/brands/apps/openrouter-dark.svg +3 -0
  531. package/dist/brands/apps/openrouter.svg +3 -0
  532. package/dist/brands/apps/oreilly.svg +1 -0
  533. package/dist/brands/apps/pagerduty.svg +4 -0
  534. package/dist/brands/apps/paperclip-notebook-dark.svg +1 -0
  535. package/dist/brands/apps/paperclip-notebook.svg +1 -0
  536. package/dist/brands/apps/parallel-dark.svg +11 -0
  537. package/dist/brands/apps/parallel.svg +11 -0
  538. package/dist/brands/apps/planetscale-dark.svg +1 -0
  539. package/dist/brands/apps/planetscale.svg +1 -0
  540. package/dist/brands/apps/posthog-dark.svg +1 -0
  541. package/dist/brands/apps/posthog.svg +1 -0
  542. package/dist/brands/apps/postman.svg +1 -0
  543. package/dist/brands/apps/railway-dark.svg +1 -0
  544. package/dist/brands/apps/railway.svg +1 -0
  545. package/dist/brands/apps/razorpay-dark.svg +1 -0
  546. package/dist/brands/apps/razorpay.svg +1 -0
  547. package/dist/brands/apps/resend-dark.svg +1 -0
  548. package/dist/brands/apps/resend.svg +1 -0
  549. package/dist/brands/apps/sanity-dark.svg +1 -0
  550. package/dist/brands/apps/sanity.svg +1 -0
  551. package/dist/brands/apps/sentry-dark.svg +1 -0
  552. package/dist/brands/apps/sentry.svg +1 -0
  553. package/dist/brands/apps/shopify.svg +24 -0
  554. package/dist/brands/apps/similarweb-dark.svg +1 -0
  555. package/dist/brands/apps/similarweb.svg +1 -0
  556. package/dist/brands/apps/slack.png +0 -0
  557. package/dist/brands/apps/slack.svg +17 -0
  558. package/dist/brands/apps/speko.svg +16 -0
  559. package/dist/brands/apps/stripe.svg +11 -0
  560. package/dist/brands/apps/supabase.svg +15 -0
  561. package/dist/brands/apps/superagent.png +0 -0
  562. package/dist/brands/apps/supermemory.png +0 -0
  563. package/dist/brands/apps/tailscale.png +0 -0
  564. package/dist/brands/apps/tavily.png +0 -0
  565. package/dist/brands/apps/telegram.svg +12 -0
  566. package/dist/brands/apps/telem-dark.svg +9 -0
  567. package/dist/brands/apps/telem.svg +9 -0
  568. package/dist/brands/apps/ticket-tailor-dark.svg +1 -0
  569. package/dist/brands/apps/ticket-tailor.svg +1 -0
  570. package/dist/brands/apps/ticktick.svg +1 -0
  571. package/dist/brands/apps/todoist.svg +1 -0
  572. package/dist/brands/apps/unikraft.svg +1 -0
  573. package/dist/brands/apps/vercel-dark.svg +1 -0
  574. package/dist/brands/apps/vercel.svg +1 -0
  575. package/dist/brands/apps/webflow.svg +1 -0
  576. package/dist/brands/apps/windsor-ai.png +0 -0
  577. package/dist/brands/apps/wix-dark.svg +12 -0
  578. package/dist/brands/apps/wix.svg +12 -0
  579. package/dist/brands/apps/xai-dark.svg +1 -0
  580. package/dist/brands/apps/xai.svg +1 -0
  581. package/dist/brands/apps/xero.svg +1 -0
  582. package/dist/brands/apps/youcom-dark.svg +13 -0
  583. package/dist/brands/apps/youcom.svg +13 -0
  584. package/dist/brands/apps/zapier.svg +1 -0
  585. package/dist/brands/apps/zep.png +0 -0
  586. package/dist/brands/claude-color.svg +17 -0
  587. package/dist/brands/codex-color.svg +17 -0
  588. package/dist/brands/opencode-logo-dark-square.svg +18 -0
  589. package/dist/brands/opencode-logo-light-square.svg +18 -0
  590. package/dist/favicon-16x16.png +0 -0
  591. package/dist/favicon-32x32.png +0 -0
  592. package/dist/favicon.ico +0 -0
  593. package/dist/favicon.svg +7 -0
  594. package/dist/fonts/InterVariable-Italic.woff2 +0 -0
  595. package/dist/fonts/InterVariable.woff2 +0 -0
  596. package/dist/fonts/NOTICE.md +30 -0
  597. package/dist/fonts/PaperMono-OFL.txt +93 -0
  598. package/dist/fonts/PaperMono-Variable.woff2 +0 -0
  599. package/dist/index.html +165 -0
  600. package/dist/microvac-push-sw.js +37 -0
  601. package/dist/paperclip-thinking.svg +17 -0
  602. package/dist/site.webmanifest +30 -0
  603. package/dist/storybook/grok-comparison.csv +4 -0
  604. package/dist/sw.js +176 -0
  605. package/dist/worktree-favicon-16x16.png +0 -0
  606. package/dist/worktree-favicon-32x32.png +0 -0
  607. package/dist/worktree-favicon.ico +0 -0
  608. package/dist/worktree-favicon.svg +9 -0
  609. package/package.json +20 -4
@@ -0,0 +1,4 @@
1
+ var Qs=Object.defineProperty;var n=(s,t)=>Qs(s,"name",{value:t,configurable:!0});import{a as ps}from"./rolldown-runtime-DhZMWcEn.js";import{$n as Ys,Ar as Js,Bn as bs,Cn as fe,Dn as Xs,En as Y,Er as Zs,Fr as ss,Gi as et,Hn as de,Jn as K,Ln as st,Lr as ts,Mr as tt,On as Le,Or as P,Pr as at,Qn as js,Sn as nt,Tn as rt,Tr as lt,Ui as pe,Wi as Ns,Xn as it,Yn as ae,_r as Ne,bn as ot,dr as dt,gr as ct,ir as ut,jr as xt,kn as mt,kr as ze,nr as as,pi as ht,sr as ft,tr as gt,ur as pt,vn as bt,wn as jt,wr as Nt,xn as yt,yn as vt}from"./issue-detail-4PCbYpdv.js";import{$ as wt,A as kt,B as At,C as St,E as Ct,F as _t,I as It,J as Rt,M as $e,N as Tt,O as $t,P as Et,Q as Z,R as ys,S as Dt,T as Mt,V as ne,Y as Lt,_ as Ot,a as Pt,b as zt,c as Ft,ct as qt,f as Bt,ft as Ut,g as Fe,h as Ht,i as Vt,it as Wt,j as Kt,k as Gt,l as Qt,m as vs,mt as Yt,n as Jt,nt as Xt,o as Zt,ot as ea,pt as ws,rt as sa,s as ge,st as ks,t as ta,tt as aa,u as na,v as ra,w as la,x as ia,z as ie}from"./usePageView-BiX5i8ck.js";import{b as ns,x as oa}from"./collections-BxrcELwt.js";import{$A as da,$g as ca,Bb as ua,Cv as xa,Dp as As,ET as ma,E_ as F,Em as ha,Ev as ye,FE as fa,Fb as rs,GS as L,Gb as R,Gg as ga,Gw as pa,JC as ba,Jv as ja,LS as Ss,ME as J,NE as N,Nb as ls,Pb as is,Py as Na,QE as qe,QT as ya,RT as Be,Rb as va,TT as wa,Tv as ka,Um as Aa,Up as Sa,VC as ve,Vp as Ca,WE as _a,YE as Ia,YS as Ue,Yb as Ra,ZC as Ta,__ as Oe,_b as $a,_v as X,_w as oe,aC as Ea,ab as we,bE as H,cb as He,dy as Ve,eD as Da,e_ as Ma,fy as ke,gC as La,g_ as Cs,gv as Oa,hE as z,hv as Ae,iC as Se,ib as Pa,jT as _s,jb as be,kT as za,lT as Fa,ly as Ce,m_ as qa,mb as te,my as _e,nT as We,nj as Ba,nn as os,on as Ua,pT as Is,pb as Rs,pv as Ie,qC as q,rn as Ha,sw as ds,sy as Re,t_ as Va,tn as Wa,uC as Ka,ub as Ke,uy as Ge,vv as Ga,wC as Qa,wv as Ya,xE as Q,xT as Ja,xv as Xa,zE as $}from"./index-Bt31d8ga.js";import{t as Ee}from"./EntityRow-gpsOgEtu.js";import{t as Za}from"./useAgentlessOnboardingAutoOpen-CnFwEQ-H.js";var Ts={name:"repeat-1",size:24,node:[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}],["path",{d:"M11 10h1v4",key:"70cz1p"}]]};Ts.node;var en=ya(Ts),m=ps(Ba(),1),e=ps(da(),1),xe="",se="__new__";function sn({open:s,onOpenChange:t,companyId:a,areas:r,defaultAreaId:l=null,onCreated:i}){const u=J(),[o,d]=(0,m.useState)(""),[x,c]=(0,m.useState)(xe),[h,g]=(0,m.useState)(""),[f,y]=(0,m.useState)(()=>as()),[v,w]=(0,m.useState)(!1),p=H({mutationFn:n(async()=>{const b=ss(f);if(!b.ok)throw new Error("The form is incomplete");let O=x===xe||x===se?null:x;return x===se&&(O=(await Xs.create(a,{title:h.trim()})).id),Y.create(a,ut({title:o,bar:b.value,areaId:O}))},"mutationFn"),onSuccess:n(b=>{u.invalidateQueries({queryKey:L.responsibilities.all}),i?.(b),t(!1)},"onSuccess"),onError:n(()=>{u.invalidateQueries({queryKey:L.responsibilities.all})},"onError")}),S=p.reset;(0,m.useEffect)(()=>{s&&(d(""),c(l??xe),g(""),y(as()),w(!1),S())},[s,l,S]);const j=ss(f),k=Nt(p.error),T=new Set([...v&&!j.ok?j.missing:[],...k]),I=new Set(v&&!j.ok?j.invalid:[]),_=v&&!j.ok?j.problems:void 0,D=v&&!o.trim(),C=v&&x===se&&!h.trim(),E=n(b=>{b.preventDefault(),w(!0),!(!o.trim()||!j.ok||x===se&&!h.trim()||p.isPending)&&p.mutate()},"submit");return(0,e.jsx)(Re,{open:s,onOpenChange:t,children:(0,e.jsx)(Ce,{className:"sm:max-w-xl",children:(0,e.jsxs)("form",{className:"flex flex-col gap-5",onSubmit:E,noValidate:!0,children:[(0,e.jsxs)(ke,{children:[(0,e.jsx)(_e,{children:"Add a responsibility"}),(0,e.jsx)(Ge,{children:"Something you own, with a bar for success and a number that shows whether you are meeting it."})]}),(0,e.jsxs)("label",{className:"flex flex-col gap-1.5 text-sm",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"What do you own?"}),(0,e.jsx)(Oe,{autoFocus:!0,value:o,maxLength:200,placeholder:"e.g. Investor pipeline","aria-invalid":D||void 0,onChange:n(b=>d(b.target.value),"onChange")}),D?(0,e.jsx)("span",{className:"text-xs text-destructive",children:"Name what you own"}):null]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 text-sm",children:[(0,e.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"Area"}),(0,e.jsxs)(As,{value:x,onChange:n(b=>c(b.target.value),"onChange"),children:[(0,e.jsx)("option",{value:xe,children:"No area"}),r.map(b=>(0,e.jsx)("option",{value:b.id,children:b.title},b.id)),(0,e.jsx)("option",{value:se,children:"New area…"})]})]}),x===se?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Oe,{"aria-label":"New area name",value:h,maxLength:200,placeholder:"e.g. Fundraising","aria-invalid":C||void 0,onChange:n(b=>g(b.target.value),"onChange")}),C?(0,e.jsx)("span",{className:"text-xs text-destructive",children:"Name the new area"}):null]}):null]}),(0,e.jsx)(Ut,{draft:f,onChange:y,missing:T,invalid:I,problems:_,showCurrent:!0}),p.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t add the responsibility. ",z(p.error).body]}):null,(0,e.jsxs)(Ve,{className:"items-center sm:justify-between",children:[(0,e.jsx)(N,{type:"button",variant:"ghost",onClick:n(()=>t(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(N,{type:"submit",disabled:p.isPending,children:p.isPending?"Adding…":"Add responsibility"})]})]})})})}n(sn,"AddResponsibilityDialog");var tn=["on_track","at_risk","behind","unclear"],$s={on_track:"On track",at_risk:"At risk",behind:"Behind",unclear:"Unclear"},Es={behind:"behind",at_risk:"at_risk",on_track:"on_track",unclear:"not_measured"},cs={behind:0,at_risk:1,unclear:2,on_track:3};function an(s){return s==="not_measured"?"unclear":s}n(an,"healthKind");function nn(s,t){const a={responsibility:s,areaId:s.areaId,reporterAgentId:t?.reporterAgentId??null,updateRequested:t?.updateRequested??!1},r=t?.current??null;if(r)return{...a,kind:r.status==="unknown"?"unclear":r.status,label:ws[r.status],source:r.userId?"person":"agent",message:r.message,detail:r.detail,outOfDate:r.outOfDate,writtenAt:r.writtenAt,authorAgentId:r.agentId,authorUserId:r.userId};const l=s.rollup.health;return{...a,kind:an(l),label:K[l],source:"number",message:s.rollup.statusSentence,detail:null,outOfDate:!1,writtenAt:null,authorAgentId:null,authorUserId:null}}n(nn,"agentStatusRow");function Ds(s){const t=n(a=>a.source==="number"?2:a.outOfDate?1:0,"freshness");return s.map((a,r)=>({row:a,index:r})).sort((a,r)=>cs[a.row.kind]-cs[r.row.kind]||t(a.row)-t(r.row)||a.index-r.index).map(({row:a})=>a)}n(Ds,"sortAgentStatusRows");function rn(s,t){const a=new Map((t?.reports??[]).map(r=>[r.responsibilityId,r]));return s.filter(r=>r.status==="active").map(r=>nn(r,a.get(r.id)))}n(rn,"agentStatusRows");function je(s,t,a){return`${s} ${s===1?t:a}`}n(je,"count");function ln(s){return s.length<=1?s[0]??"":`${s.slice(0,-1).join(", ")} and ${s.at(-1)}`}n(ln,"joinNames");function Qe(s,t,a){return s.source==="number"?null:s.source==="person"?s.authorUserId&&s.authorUserId===a?"You":"A person":s.authorAgentId&&t(s.authorAgentId)||"An agent"}n(Qe,"agentStatusAuthor");function us(s,t){const a=Math.max(0,Math.floor((t.getTime()-new Date(s).getTime())/864e5));return a===0?"today":a===1?"yesterday":a<30?`${a} days ago`:`on ${new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`}n(us,"writtenAgo");function on(s){const t=s.length,a=n(x=>s.filter(c=>c.kind===x),"of"),r=n(x=>new Set(x.map(c=>c.areaId??"__none__")).size,"areasOf"),l=tn.map(x=>{const c=a(x);let h;if(x==="on_track")h=`Of ${je(t,"responsibility","responsibilities")}`;else if(x==="unclear"){const g=c.filter(y=>y.source!=="number").length,f=c.length-g;h=c.length===0?"Every one has a status":[g>0?`${g} can't tell yet`:null,f>0?`${f} not measured`:null].filter(Boolean).join(" · ")}else h=c.length===0?"None right now":`In ${je(r(c),"area","areas")}`;return{kind:x,label:$s[x],value:c.length,line:h}}),i=s.filter(x=>x.source==="agent").length,u=s.filter(x=>x.source==="person").length,o=s.filter(x=>x.outOfDate).length,d=s.filter(x=>x.source==="number").length;return{tiles:l,total:t,byAgent:i,byPerson:u,outOfDate:o,fromNumber:d,provenance:[`${i} written by ${i===1?"an agent":"agents"}`,o>0?`${o} out of date`:null,u>0?`${u} written by a person`:null,`${d} from the ${d===1?"number":"numbers"}`].filter(Boolean).join(" · ")}}n(on,"agentStatusTiles");function dn(s,t,a,r=3){const l=s.filter(c=>c.source!=="number"),i=s.length;let u;if(i===0)u="You do not own any responsibilities yet.";else if(l.length===0)u="No agent has written a status yet. Every status below comes from the numbers.";else{const c=l.filter(f=>f.kind==="behind").length,h=l.filter(f=>f.kind==="at_risk").length,g=l.filter(f=>f.outOfDate).length;u=`${l.length===i?i===1?"Your one status is written.":`All ${i} of your statuses are written.`:`${l.length} of your ${i} statuses are written; the rest come from the numbers.`} ${c+h===0?"None of the written ones is behind or at risk.":`They put ${[c>0?`${c} behind`:null,h>0?`${h} at risk`:null].filter(Boolean).join(" and ")}.`}${g>0?` ${g} ${g===1?"is":"are"} older than 7 days.`:""}`}const o=Ds(l.filter(c=>c.kind!=="on_track")).slice(0,r).map(c=>({row:c,by:Qe(c,t,a)??""})),d=s.filter(c=>c.updateRequested);let x=null;return d.length>0&&(x=`${ln([...new Set(d.map(c=>c.reporterAgentId&&t(c.reporterAgentId)||"an agent"))])}, for ${je(d.length,"update","updates")}`),{lead:u,lines:o,waiting:x}}n(dn,"composeAgentStatusSummary");function cn(s){if(s.length===0)return null;for(const t of["behind","at_risk","on_track"])if(s.some(a=>a.kind===t))return t;return"unclear"}n(cn,"areaStatusKind");function un(s,t,a,r,l=new Set){return Ne(s,t,l).map(({area:i,items:u})=>{const o=Ds(u),d=o[0],x=o.filter(h=>h.kind==="on_track").length,c=[...new Set(o.flatMap(h=>[h.authorAgentId,h.reporterAgentId]).filter(h=>!!h))];return{area:i,rows:o,kind:cn(o),headline:d?{text:d.message,by:Qe(d,a,r),fromNumber:d.source==="number"}:null,onTrack:x,onTrackLabel:`${x} of ${je(o.length,"responsibility","responsibilities")} on track`,onTrackPercent:o.length===0?0:Math.round(x/o.length*100),agentIds:c}})}n(un,"agentStatusAreaGroups");function xn(s){if(!s)return null;const t=pt(s);return t.visual.kind==="yes_no"?{label:s.name,value:t.current??"No answer yet",target:"should be yes"}:t.visual.kind==="range"||s.kind==="range"?{label:s.name,value:t.current??"No reading yet",target:t.target?`range ${t.target}`:"no range set"}:{label:s.name,value:t.current??"No reading yet",target:t.target?`${s.direction==="at_most"?"target at most":"target"} ${t.target}`:"no target set"}}n(xn,"agentStatusMetricCell");function mn(s){const t=s?.trimStart();if(!t?.startsWith("[dashboard-demo]"))return null;const a=t.slice(16).split(`
2
+ `)[0].trim();if(!a)return null;const r=a.indexOf(" — ");if(r<0)return{name:a,role:null};const l=a.slice(0,r).trim(),i=a.slice(r+3).trim();return l?{name:l,role:i||null}:null}n(mn,"parseDashboardDemoPersona");function hn(){const{selectedCompany:s}=Ss();return(0,m.useMemo)(()=>mn(s?.description),[s?.description])}n(hn,"useDashboardDemoPerson");function re({companyId:s,onAdd:t}){const a=$a(s)?.primaryAgent??null;return(0,e.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,e.jsx)(Ua,{icon:Fa,title:"What do you own?",message:"A responsibility is something you own, with a bar for success and a number that shows whether you are meeting it. Group them under the areas you care about, such as Fundraising or Hiring.",action:"Add a responsibility",onAction:t}),a?(0,e.jsx)(N,{asChild:!0,variant:"ghost",children:(0,e.jsxs)(R,{to:`/chats/${encodeURIComponent(fa(a))}`,children:[(0,e.jsx)(Be,{"aria-hidden":"true"}),"Ask ",a.name," to draft them"]})}):null]})}n(re,"ResponsibilitiesEmpty");function Ms(){const{data:s,isPending:t}=Q({queryKey:L.auth.session,queryFn:n(()=>Ue.getSession(),"queryFn")}),a=hn(),r=s?.user??null;if(a)return(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-3","data-demo-person":"",children:[(0,e.jsx)(is,{size:"lg",children:(0,e.jsx)(rs,{className:"text-base",children:ls(a.name)})}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,e.jsx)("span",{className:"truncate text-lg font-semibold text-foreground",children:a.name}),a.role?(0,e.jsx)("span",{className:"truncate text-sm text-muted-foreground",children:a.role}):null]})]});const l=r?.name?.trim()||r?.email?.trim()||"You";return(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,e.jsxs)(is,{size:"lg",children:[r?.image?(0,e.jsx)(va,{src:r.image,alt:""}):null,(0,e.jsx)(rs,{className:"text-base",children:t?"":ls(l)})]}),t?(0,e.jsx)(te,{className:"h-6 w-32"}):(0,e.jsx)(R,{to:ja(r),className:"min-w-0 truncate text-lg font-semibold text-foreground underline-offset-4 hover:underline",children:l})]})}n(Ms,"PersonHeading");function fn({standing:s,className:t}){return(0,e.jsxs)(F,{elevation:"low",className:$("gap-1.5 px-5 py-4",t),"data-overall-status":s.health,children:[(0,e.jsxs)("p",{className:"flex items-center gap-2 text-base font-semibold text-foreground",children:[(0,e.jsx)(ie,{health:s.health}),K[s.health]]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:s.sentence})]})}n(fn,"OverallStatusCard");function me({label:s,figure:t}){return(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)("dt",{className:"text-sm text-muted-foreground",children:s}),(0,e.jsx)("dd",{className:"text-3xl font-semibold tabular-nums text-foreground",children:t.value}),(0,e.jsx)("dd",{className:$("text-sm",t.alert?"text-(--status-task-icon-blocked)":"text-muted-foreground"),children:t.line})]})}n(me,"Figure");function gn({responsibility:s}){const t=s.standard?.trim();return(0,e.jsx)("li",{"data-responsibility-id":s.id,children:(0,e.jsxs)(R,{to:P(s.id),className:"flex items-center gap-4 py-3 pl-10 pr-5 transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[(0,e.jsx)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:s.title}),(0,e.jsx)("span",{className:"text-sm text-foreground",children:t})]}):(0,e.jsx)("span",{className:"text-sm text-foreground",children:s.title})}),(0,e.jsx)(At,{health:s.rollup.health})]})})}n(gn,"OutlineRow");function pn({group:s,onAddResponsibility:t}){const a=`outline-area-${s.area?.id??"none"}`;return(0,e.jsxs)("div",{className:"flex flex-col gap-1","data-outline-area":s.area?.id??"none",children:[(0,e.jsxs)(F,{elevation:"low",className:"gap-0 overflow-hidden py-0","aria-labelledby":a,children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-4 px-5 py-4",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,e.jsxs)("h3",{id:a,className:"truncate text-base font-semibold text-foreground",children:[s.area?.title??"Not in an area",s.area?.status==="archived"?(0,e.jsx)("span",{className:"font-normal text-muted-foreground",children:" · Archived"}):null]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:s.ownedLabel})]}),s.share?(0,e.jsx)("p",{className:"shrink-0 text-sm font-medium tabular-nums text-foreground",children:s.share.label}):null]}),s.items.length>0?(0,e.jsx)("ul",{className:"flex flex-col divide-y divide-border border-t border-border",children:s.items.map(r=>(0,e.jsx)(gn,{responsibility:r},r.id))}):(0,e.jsx)("p",{className:"border-t border-border py-3 pl-10 pr-5 text-sm text-muted-foreground",children:"Nothing you own is filed here yet."})]}),s.area?.status==="archived"?null:(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsxs)(N,{size:"xs",variant:"ghost",className:"text-muted-foreground",onClick:n(()=>t(s.area?.id??null),"onClick"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"New responsibility"]})})]})}n(pn,"OutlineArea");function bn({companyId:s,overview:t,keepEmptyAreas:a,onAddResponsibility:r,onAddArea:l,onReviewProposals:i}){const u=(0,m.useMemo)(()=>Z(t.responsibilities),[t.responsibilities]),o=(0,m.useMemo)(()=>ea(t.areas,t.responsibilities,a),[t.areas,t.responsibilities,a]),d=(0,m.useMemo)(()=>ks(t.totals.byHealth),[t.totals.byHealth]),x=(0,m.useMemo)(()=>aa(t),[t]);return u.length===0&&t.proposed.length===0&&o.length===0?(0,e.jsx)(re,{companyId:s,onAdd:n(()=>r(null),"onAdd")}):(0,e.jsxs)("div",{className:"flex flex-col gap-10","data-dashboard-view":"outline",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[(0,e.jsx)(Ms,{}),(0,e.jsx)(fn,{standing:d,className:"md:w-96 md:shrink-0"})]}),(0,e.jsx)(ne,{count:t.proposed.length,onReview:i}),(0,e.jsxs)("section",{"aria-labelledby":"outline-overview-heading",className:"flex flex-col gap-5",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{id:"outline-overview-heading",className:"text-lg font-semibold text-foreground",children:"Overview"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"A snapshot of your work"})]}),(0,e.jsxs)("dl",{className:"grid grid-cols-2 gap-6 md:grid-cols-4",children:[(0,e.jsx)(me,{label:"Areas",figure:x.areas}),(0,e.jsx)(me,{label:"Responsibilities",figure:x.responsibilities}),(0,e.jsx)(me,{label:"Projects",figure:x.projects}),(0,e.jsx)(me,{label:"Tasks",figure:x.tasks})]})]}),(0,e.jsxs)("section",{"aria-labelledby":"outline-areas-heading",className:"flex flex-col gap-5",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{id:"outline-areas-heading",className:"text-lg font-semibold text-foreground",children:"Areas"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"What do you care about?"})]}),(0,e.jsxs)(N,{size:"sm",onClick:l,children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"New area"]})]}),o.length>0?(0,e.jsx)("div",{className:"flex flex-col gap-6",children:o.map(c=>(0,e.jsx)(pn,{group:c,onAddResponsibility:r},c.area?.id??"__no_area__"))}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing you own yet. Review what was proposed for you, or add a new responsibility."})]})]})}n(bn,"DashboardOutline");function jn({label:s,options:t,value:a,onChange:r,className:l}){const i=(0,m.useRef)([]),u=n(d=>{const x=(d+t.length)%t.length;r(t[x].value),i.current[x]?.focus()},"select"),o=n((d,x)=>{const c=d.key==="ArrowRight"||d.key==="ArrowDown"?x+1:d.key==="ArrowLeft"||d.key==="ArrowUp"?x-1:d.key==="Home"?0:d.key==="End"?t.length-1:null;c!==null&&(d.preventDefault(),u(c))},"onKeyDown");return(0,e.jsx)("div",{role:"radiogroup","aria-label":s,className:$("inline-flex shrink-0 items-center gap-0.5 rounded-md border border-border p-0.5",l),children:t.map((d,x)=>{const c=d.value===a;return(0,e.jsx)("button",{ref:n(h=>{i.current[x]=h},"ref"),type:"button",role:"radio","aria-checked":c,tabIndex:c?0:-1,"data-view":d.value,onClick:n(()=>r(d.value),"onClick"),onKeyDown:n(h=>o(h,x),"onKeyDown"),className:$("whitespace-nowrap rounded-sm px-2 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c&&"bg-accent text-foreground"),children:d.label},d.value)})})}n(jn,"ViewSwitcher");var Nn=5,yn=Yt.map(s=>({value:s,label:ws[s]}));function Ye({kind:s,label:t,quiet:a,outOfDate:r,className:l}){return(0,e.jsxs)("span",{"data-agent-status-chip":s,"data-quiet":a?"true":void 0,className:$("inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-foreground",a&&"border-dashed text-muted-foreground",l),children:[(0,e.jsx)(ie,{health:Es[s],className:"size-2"}),t,r?(0,e.jsx)(Is,{"aria-hidden":"true",className:"size-3 shrink-0"}):null,r?(0,e.jsx)("span",{className:"sr-only",children:" (out of date)"}):null]})}n(Ye,"AgentStatusChip");function vn({tile:s}){const t=Es[s.kind],a=ys[t];return(0,e.jsxs)(F,{elevation:"low",className:"gap-1 px-5 py-4","data-agent-status-tile":s.kind,children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsx)("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:s.value}),(0,e.jsx)(a,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]}),(0,e.jsxs)("p",{className:"flex items-center gap-2 text-sm text-foreground",children:[(0,e.jsx)(ie,{health:t,className:"size-2"}),s.label]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:s.line})]})}n(vn,"Tile");function wn({agentIds:s,agentsById:t}){if(s.length===0)return null;const a=s.slice(0,Nn),r=s.map(l=>t.get(l)?.name??"An agent");return(0,e.jsxs)("span",{className:"flex shrink-0 items-center gap-1","aria-label":`Reporting here: ${r.join(", ")}`,role:"img",children:[(0,e.jsx)("span",{className:"flex -space-x-1",children:a.map(l=>(0,e.jsx)(be,{agent:t.get(l)??{id:l},name:t.get(l)?.name,size:20},l))}),s.length>a.length?(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["+",s.length-a.length]}):null]})}n(wn,"AgentStack");function kn({row:s,actions:t}){const a=Qe(s,t.agentName,t.viewerUserId),r=s.reporterAgentId?t.agentsById.get(s.reporterAgentId):void 0,l=s.reporterAgentId?t.agentName(s.reporterAgentId)??"An agent":null;if(a&&s.writtenAt){const i=s.authorAgentId?t.agentsById.get(s.authorAgentId):void 0;return(0,e.jsxs)("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[(0,e.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs text-foreground",children:[s.source==="agent"?(0,e.jsx)(be,{agent:i??(s.authorAgentId?{id:s.authorAgentId}:null),name:a,size:16}):(0,e.jsx)(Ka,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"truncate",children:a})]}),(0,e.jsx)("span",{className:$("text-xs",s.outOfDate?"text-(--status-task-icon-todo)":"text-muted-foreground"),children:s.outOfDate?`Out of date · written ${us(s.writtenAt,t.now)}`:`Written ${us(s.writtenAt,t.now)}`})]})}return(0,e.jsxs)("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[l?(0,e.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-dashed border-border px-2 py-0.5 text-xs text-muted-foreground",children:[(0,e.jsx)(be,{agent:r??{id:s.reporterAgentId},name:l,size:16,muted:!0}),(0,e.jsx)("span",{className:"truncate",children:l})]}):null,(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:l?s.updateRequested?"Asked for an update":"No report yet":"No agent can report yet"})]})}n(kn,"ReporterCell");var An=(0,m.memo)(n(function({row:t,actions:a}){const{responsibility:r}=t,l=r.standard?.trim(),i=xn(r.rollup.metric),u=t.reporterAgentId?a.agentName(t.reporterAgentId)??"the agent":null,o=a.asking===r.id;return(0,e.jsxs)("li",{"data-responsibility-id":r.id,"data-status-source":t.source,"data-out-of-date":t.outOfDate?"true":void 0,className:"relative flex flex-col gap-3 px-5 py-3 transition-colors hover:bg-accent/50 @4xl:flex-row @4xl:items-center @4xl:gap-6",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[l?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:r.title}):null,(0,e.jsx)(R,{to:P(r.id),className:"text-sm text-foreground after:absolute after:inset-0 focus-visible:outline-none focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring",children:l??r.title}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground","data-status-message":"",children:[t.message,t.source==="number"?(0,e.jsx)("span",{className:"text-muted-foreground",children:" · From the number, not from an agent"}):null]})]}),(0,e.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 @4xl:w-40 @4xl:shrink-0","data-status-metric":"",children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:i.label}),(0,e.jsxs)("span",{className:"text-sm text-foreground",children:[(0,e.jsx)("span",{className:"font-medium tabular-nums",children:i.value}),(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[" · ",i.target]})]})]}):(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"No metric yet"})}),(0,e.jsxs)("div",{className:"@4xl:w-32 @4xl:shrink-0",children:[(0,e.jsx)(Ye,{kind:t.kind,label:t.label,quiet:t.source==="number"||t.outOfDate,outOfDate:t.outOfDate}),t.source==="number"?(0,e.jsx)("span",{className:"sr-only",children:" (from the number)"}):null]}),(0,e.jsxs)("div",{className:"relative z-10 flex flex-col items-start gap-2 @4xl:w-48 @4xl:shrink-0",children:[(0,e.jsx)(kn,{row:t,actions:a}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,e.jsx)(N,{type:"button",size:"xs",variant:"ghost",className:"text-muted-foreground",disabled:!u||t.updateRequested||o,"data-ask-update":"","aria-label":u&&!t.updateRequested?`Ask ${u} for an update on ${r.title}`:void 0,onClick:n(()=>a.onAsk(t),"onClick"),children:u?t.updateRequested?`Waiting for ${u}`:o?"Asking…":"Ask for an update":"No agent to ask"}),(0,e.jsx)(N,{type:"button",size:"xs",variant:"ghost",className:"text-muted-foreground","data-edit-status":"","aria-label":`Edit the status of ${r.title}`,onClick:n(()=>a.onEdit(t),"onClick"),children:"Edit"})]})]})]})},"AgentStatusRowItem"));function Sn({group:s,expanded:t,onToggle:a,onAddResponsibility:r,actions:l}){const i=s.area?.id??"none",u=`agent-status-area-${i}`,o=s.headline;return(0,e.jsxs)("div",{className:"flex flex-col gap-1","data-agent-status-area":i,children:[(0,e.jsxs)(F,{elevation:"low",className:"gap-0 overflow-hidden py-0",children:[(0,e.jsx)("h3",{children:(0,e.jsxs)("button",{type:"button","aria-expanded":t,"aria-controls":u,onClick:a,className:"flex w-full flex-col gap-3 px-5 py-4 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring @3xl:flex-row @3xl:items-center @3xl:gap-6",children:[(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,e.jsxs)("span",{className:"truncate text-base font-semibold text-foreground",children:[s.area?.title??"Not in an area",s.area?.status==="archived"?(0,e.jsx)("span",{className:"font-normal text-muted-foreground",children:" · Archived"}):null]}),(0,e.jsx)("span",{className:"line-clamp-2 text-sm font-normal text-muted-foreground","data-area-headline":"",children:o?`${o.text}${o.by?` (${o.by})`:o.fromNumber?" (from the number)":""}`:"Nothing you own is filed here yet."})]}),(0,e.jsxs)("span",{className:"flex flex-wrap items-center gap-4 @3xl:flex-nowrap",children:[s.kind?(0,e.jsx)(Ye,{kind:s.kind,label:$s[s.kind]}):null,s.rows.length>0?(0,e.jsxs)("span",{className:"flex w-44 flex-col gap-1",children:[(0,e.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:s.onTrackLabel}),(0,e.jsx)("span",{className:"h-1 w-full overflow-hidden rounded-full bg-muted","aria-hidden":"true",children:(0,e.jsx)("span",{className:"block h-full rounded-full bg-foreground",style:{width:`${s.onTrackPercent}%`}})})]}):null,(0,e.jsx)(wn,{agentIds:s.agentIds,agentsById:l.agentsById}),(0,e.jsx)(_s,{"aria-hidden":"true",className:$("size-4 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")})]})]})}),t&&s.rows.length>0?(0,e.jsx)("ul",{id:u,className:"flex flex-col divide-y divide-border border-t border-border",children:s.rows.map(d=>(0,e.jsx)(An,{row:d,actions:l},d.responsibility.id))}):null]}),s.area?.status==="archived"?null:(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsxs)(N,{size:"xs",variant:"ghost",className:"text-muted-foreground",onClick:n(()=>r(s.area?.id??null),"onClick"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"New responsibility"]})})]})}n(Sn,"AreaTable");function Cn({row:s,onOpenChange:t,onSaved:a}){const r=J(),[l,i]=(0,m.useState)("on_track"),[u,o]=(0,m.useState)(""),[d,x]=(0,m.useState)(""),c=H({mutationFn:n(()=>Y.writeStatusReport(s.responsibility.id,{status:l,message:u.trim(),detail:d.trim()?d.trim():null}),"mutationFn"),onSuccess:n(async()=>{await Promise.all([r.invalidateQueries({queryKey:["responsibilities","status-reports"]}),r.invalidateQueries({queryKey:L.responsibilities.statusReport(s.responsibility.id)})]),a?.(),t(!1)},"onSuccess")}),h=c.reset,g=s?.responsibility.id??null;(0,m.useEffect)(()=>{s&&(i(s.kind==="unclear"?"unknown":s.kind),o(s.source==="number"?"":s.message),x(s.detail??""),h())},[g,h]);const f=n(y=>{y.preventDefault(),!(!u.trim()||c.isPending)&&c.mutate()},"submit");return(0,e.jsx)(Re,{open:s!==null,onOpenChange:t,children:(0,e.jsx)(Ce,{children:(0,e.jsxs)("form",{className:"flex flex-col gap-5",onSubmit:f,children:[(0,e.jsxs)(ke,{children:[(0,e.jsx)(_e,{children:"Edit the status"}),(0,e.jsxs)(Ge,{children:[s?`${s.responsibility.title}: `:"","say where it stands and why. It shows as written by you until an agent writes a newer one."]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 text-sm",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"Status"}),(0,e.jsx)(jn,{label:"Status",options:yn,value:l,onChange:i,className:"self-start"})]}),(0,e.jsxs)("label",{className:"flex flex-col gap-1.5 text-sm",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"Why, in one line"}),(0,e.jsx)(Oe,{autoFocus:!0,value:u,maxLength:200,placeholder:"e.g. Holding at 1.3 MB with the font cleanup still to land.",onChange:n(y=>o(y.target.value.replace(/[\r\n]+/g," ")),"onChange")})]}),(0,e.jsxs)("label",{className:"flex flex-col gap-1.5 text-sm",children:[(0,e.jsxs)("span",{className:"font-medium text-foreground",children:["More detail ",(0,e.jsx)("span",{className:"font-normal text-muted-foreground",children:"(optional)"})]}),(0,e.jsx)(Cs,{value:d,rows:3,maxLength:800,onChange:n(y=>x(y.target.value),"onChange")})]}),c.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t save the status. ",z(c.error).body]}):null,(0,e.jsxs)(Ve,{className:"items-center sm:justify-between",children:[(0,e.jsx)(N,{type:"button",variant:"ghost",onClick:n(()=>t(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(N,{type:"submit",disabled:!u.trim()||c.isPending,children:c.isPending?"Saving…":"Save status"})]})]})})})}n(Cn,"StatusReportDialog");function _n(){return(0,e.jsxs)("div",{className:"flex flex-col gap-6","aria-hidden":"true",children:[(0,e.jsx)("div",{className:"grid grid-cols-2 gap-3 @3xl:grid-cols-4",children:[0,1,2,3].map(s=>(0,e.jsx)(te,{className:"h-28 w-full"},s))}),(0,e.jsx)(te,{className:"h-32 w-full"}),(0,e.jsx)(te,{className:"h-48 w-full"})]})}n(_n,"AgentStatusSkeleton");function xs({props:s,read:t,viewerUserId:a}){const{companyId:r,overview:l,agentsById:i,now:u,keepEmptyAreas:o,onAddResponsibility:d,onAddArea:x}=s,c=J(),h=(0,m.useCallback)(C=>i.get(C)?.name,[i]),g=(0,m.useMemo)(()=>rn(l.responsibilities,t),[l.responsibilities,t]),f=(0,m.useMemo)(()=>on(g),[g]),y=(0,m.useMemo)(()=>dn(g,h,a),[g,h,a]),v=(0,m.useMemo)(()=>un(l.areas,g,h,a,o),[l.areas,g,h,a,o]),[w,p]=(0,m.useState)(()=>new Set),[S,j]=(0,m.useState)(null),k=H({mutationFn:n(C=>Y.requestStatusUpdate(C.responsibility.id),"mutationFn"),onSuccess:n(async(C,E)=>{await Promise.all([c.invalidateQueries({queryKey:["responsibilities","status-reports",r]}),c.invalidateQueries({queryKey:L.responsibilities.statusReport(E.responsibility.id)})])},"onSuccess")}),T=k.mutate,I=k.isPending?k.variables?.responsibility.id??null:null,_=(0,m.useMemo)(()=>({agentName:h,agentsById:i,viewerUserId:a,now:u,asking:I,onAsk:n(C=>T(C),"onAsk"),onEdit:j}),[h,i,a,u,I,T]),D=(0,m.useCallback)(C=>{p(E=>{const b=new Set(E);return b.has(C)?b.delete(C):b.add(C),b})},[]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{"aria-labelledby":"agent-status-counts-heading",className:"flex flex-col gap-3",children:[(0,e.jsx)("h2",{id:"agent-status-counts-heading",className:"sr-only",children:"Where your responsibilities stand"}),(0,e.jsx)("div",{className:"grid grid-cols-2 gap-3 @3xl:grid-cols-4","data-agent-status-tiles":"",children:f.tiles.map(C=>(0,e.jsx)(vn,{tile:C},C.kind))}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-agent-status-provenance":"",children:f.provenance})]}),(0,e.jsxs)(F,{elevation:"low",className:"gap-3 px-5 py-4","data-agent-status-summary":"",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Summary"}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Composed from what agents wrote"})]}),(0,e.jsx)("p",{className:"text-sm text-foreground",children:y.lead}),y.lines.length>0?(0,e.jsx)("ul",{className:"flex flex-col gap-1.5",children:y.lines.map(({row:C,by:E})=>(0,e.jsxs)("li",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 text-sm",children:[(0,e.jsx)(Ye,{kind:C.kind,label:C.label,quiet:C.outOfDate,outOfDate:C.outOfDate}),(0,e.jsxs)("span",{className:"text-muted-foreground",children:[C.responsibility.title,":"]}),(0,e.jsx)("span",{className:"text-foreground",children:C.message}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:E})]},C.responsibility.id))}):null,y.waiting?(0,e.jsxs)("p",{className:"text-sm",children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"Waiting on: "}),(0,e.jsx)("span",{className:"text-foreground",children:y.waiting})]}):null]}),k.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t ask for an update. ",z(k.error).body]}):null,(0,e.jsxs)("section",{"aria-labelledby":"agent-status-areas-heading",className:"flex flex-col gap-5",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{id:"agent-status-areas-heading",className:"text-lg font-semibold text-foreground",children:"Areas"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Each status as the agent closest to the work wrote it."})]}),(0,e.jsxs)(N,{size:"sm",onClick:x,children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"New area"]})]}),v.length>0?(0,e.jsx)("div",{className:"flex flex-col gap-6",children:v.map(C=>{const E=C.area?.id??"__no_area__";return(0,e.jsx)(Sn,{group:C,expanded:!w.has(E),onToggle:n(()=>D(E),"onToggle"),onAddResponsibility:d,actions:_},E)})}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing you own yet. Review what was proposed for you, or add a new responsibility."})]}),(0,e.jsx)(Cn,{row:S,onOpenChange:n(C=>{C||j(null)},"onOpenChange")})]})}n(xs,"AgentStatusBody");function In(s){const{companyId:t,overview:a,onAddResponsibility:r,onReviewProposals:l}=s,i=(0,m.useMemo)(()=>Z(a.responsibilities),[a.responsibilities]),{data:u}=Q({queryKey:L.auth.session,queryFn:n(()=>Ue.getSession(),"queryFn")}),o=Q({queryKey:L.responsibilities.statusReports(t,s.overview.ownerUserId),queryFn:n(()=>Y.statusReports(t),"queryFn"),enabled:i.length>0});return i.length===0&&a.proposed.length===0&&(s.keepEmptyAreas?.size??0)===0?(0,e.jsx)(re,{companyId:t,onAdd:n(()=>r(null),"onAdd")}):(0,e.jsxs)("div",{className:"@container flex flex-col gap-8","data-dashboard-view":"agent_status",children:[(0,e.jsx)(Ms,{}),(0,e.jsx)(ne,{count:a.proposed.length,onReview:l}),i.length>0?(0,e.jsx)(He,{query:o,action:"load what your agents wrote",loading:(0,e.jsx)(_n,{}),children:n(d=>(0,e.jsx)(xs,{props:s,read:d,viewerUserId:u?.user?.id??null}),"children")}):(0,e.jsx)(xs,{props:s,read:{ownerUserId:a.ownerUserId,freshDays:0,reports:[]},viewerUserId:u?.user?.id??null})]})}n(In,"DashboardAgentStatus");function Rn({headers:s,children:t}){return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-board-grid":"",children:[(0,e.jsx)("div",{"aria-hidden":"true",className:"sticky top-0 z-10 hidden bg-background py-2 @4xl:grid @4xl:grid-cols-4 @4xl:gap-3","data-board-columns":"",children:s}),t]})}n(Rn,"BoardGrid");function Ls({headingId:s,title:t,archived:a,ownedLabel:r,shareLabel:l}){return(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-0.5",children:[(0,e.jsxs)("h2",{id:s,className:"min-w-0 text-sm font-semibold text-foreground",children:[t,a?(0,e.jsx)("span",{className:"font-normal text-muted-foreground",children:" · Archived"}):null]}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[r,l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{"aria-hidden":"true",children:" · "}),(0,e.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:l})]}):null]})]})}n(Ls,"BoardAreaHeader");function Tn({headingId:s,areaKey:t,header:a,columns:r,cells:l,renderLabel:i,renderCard:u}){return(0,e.jsxs)("section",{"aria-labelledby":s,"data-board-area":t,className:"flex flex-col gap-3 border-t border-border pt-4",children:[a,(0,e.jsx)("div",{className:"flex flex-col gap-3 @4xl:grid @4xl:grid-cols-4 @4xl:gap-3",children:r.map(o=>{const d=l[o];return(0,e.jsx)("div",{"data-board-cell":o,className:$("flex min-w-0 flex-col gap-2",d.length===0&&"hidden @4xl:flex"),children:d.length>0?(0,e.jsxs)(e.Fragment,{children:[i(o,d.length,"@4xl:sr-only"),(0,e.jsx)("ul",{className:"grid grid-cols-(--responsibility-board-wrap-cols) gap-2 @4xl:grid-cols-1",children:d.map(u)})]}):(0,e.jsx)("div",{"aria-hidden":"true",className:"h-12 rounded-lg border border-dashed border-border/60"})},o)})})]})}n(Tn,"BoardAreaSection");var $n={manual:"--responsibility-automation-manual",some_automated:"--responsibility-automation-some",mostly_automated:"--responsibility-automation-mostly",automated:"--responsibility-automation-automated"},En={manual:ht,some_automated:en,mostly_automated:ve,automated:Be},Dn={schedule:"Could run on a schedule",webhook:"Could start from a webhook",standing_check:"Could be a standing check"};function Je(s){return{"--sc":`var(${$n[s]})`}}n(Je,"levelStyle");function Mn(s){return s==="manual"?"var(--responsibility-automation-icon-manual)":"var(--responsibility-automation-icon-automated)"}n(Mn,"levelIconColor");function Ln(s){const[t,a]=(0,m.useState)(()=>({companyId:s,ids:$e(s)}));return[(0,m.useMemo)(()=>t.companyId===s?t.ids:$e(s),[t,s]),(0,m.useCallback)(r=>{a(l=>{const i=new Set(l.companyId===s?l.ids:$e(s));return i.add(r),It(s,i),{companyId:s,ids:i}})},[s])]}n(Ln,"useDismissedCandidates");function On({level:s,className:t}){const a=En[s];return(0,e.jsxs)("span",{className:$("inline-flex min-w-0 items-center gap-1.5 text-xs font-medium text-foreground",t),"data-automation-level-label":"",children:[(0,e.jsx)(a,{"aria-hidden":"true",className:"size-3.5 shrink-0",style:{color:Mn(s)}}),(0,e.jsx)("span",{className:"truncate",children:Ns[s]})]})}n(On,"LevelLabel");function Pn({counts:s}){const t=pe.reduce((a,r)=>a+s[r],0);return(0,e.jsx)("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted","aria-hidden":"true","data-automation-level-bar":"",children:t>0?pe.map(a=>s[a]>0?(0,e.jsx)("div",{"data-level":a,className:"status-fill h-full",style:{...Je(a),flexGrow:s[a],flexBasis:0}},a):null):null})}n(Pn,"LevelBar");function zn({counts:s,read:t,dismissed:a,filter:r,onToggle:l,onClear:i}){const u=pe.reduce((c,h)=>c+s[h],0),o=Mt({total:u,manual:s.manual,candidates:Tt(t,a)}),{automations:d,manualTasks:x}=t.totals;return(0,e.jsxs)(F,{elevation:"low",className:"gap-4 px-5 py-4","aria-labelledby":"responsibility-automation-heading","data-automation-summary":"",children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,e.jsx)("h3",{id:"responsibility-automation-heading",className:"text-sm font-semibold text-foreground",children:"How much runs without you"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground tabular-nums",children:u===1?"1 responsibility":`${u} responsibilities`})]}),(0,e.jsx)(Pn,{counts:s}),(0,e.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",role:"group","aria-label":"Show responsibilities by how automated they are",children:pe.map(c=>{const h=r.has(c);return(0,e.jsxs)("button",{type:"button","aria-pressed":h,disabled:s[c]===0&&!h,onClick:n(()=>l(c),"onClick"),className:$("flex min-w-0 flex-col gap-1 rounded-md border px-2 py-1.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:opacity-60",h?"border-ring bg-accent/60":"border-transparent hover:bg-accent/40"),"data-level-count":c,children:[(0,e.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"status-fill size-2 shrink-0 rounded-full",style:Je(c),"aria-hidden":"true"}),(0,e.jsx)("span",{className:"truncate",children:Ns[c]})]}),(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:s[c]})]},c)})}),(0,e.jsxs)("div",{className:"flex flex-col gap-1 border-t border-border pt-3",children:[(0,e.jsx)("p",{className:"text-sm text-foreground","data-automation-sentence":"",children:o}),(0,e.jsxs)("p",{className:"flex flex-wrap items-center gap-x-1 text-xs tabular-nums text-muted-foreground","data-automation-totals":"",children:[(0,e.jsxs)("span",{children:[d===1?"1 automation running":`${d} automations running`,(0,e.jsx)("span",{"aria-hidden":"true",children:" · "}),x===1?"1 manual task":`${x} manual tasks`," in the last ",t.recentDays," days"]}),r.size>0?(0,e.jsx)(N,{type:"button",variant:"link",size:"xs",className:"h-auto px-1 text-xs",onClick:i,"data-automation-show-all":"",children:"Show all"}):null]})]})]})}n(zn,"AutomationSummary");async function Pe(s){await Promise.all([s.invalidateQueries({queryKey:L.responsibilities.all}),s.invalidateQueries({queryKey:["routines"]}),s.invalidateQueries({queryKey:["issues","interactions"]})])}n(Pe,"refreshAutomation");function Fn({candidate:s,responsibilityId:t,agentName:a,now:r,actions:l}){const i=J(),u=zt(),o=s.pendingOffer,d=s.hint,x=d?null:Gt(s,a,r),c=s.responsibleAgentId?a(s.responsibleAgentId)??"your agent":null,h=n(()=>u.open({issueId:s.issueId,agentId:s.responsibleAgentId,responsibilityId:t,conversation:s.conversation}),"talk"),g=H({mutationFn:n(()=>ts.accept(s.issueId,o.interactionId,rt()),"mutationFn"),onSuccess:n(async w=>{l.onMade(`“${w.routine.title}” is automated now: ${o.cadenceLabel}.`),await Pe(i)},"onSuccess")}),f=H({mutationFn:n(()=>ts.decline(s.issueId,o.interactionId),"mutationFn"),onSettled:n(()=>Pe(i),"onSettled")}),y=n(()=>{l.onDismiss(s),o&&f.mutate()},"dismiss"),v=u.error??g.error;return(0,e.jsxs)("li",{className:"flex min-w-0 flex-col gap-2 border-t border-border pt-2 first:border-t-0 first:pt-0 @3xl:flex-row @3xl:items-start @3xl:justify-between @3xl:gap-4","data-candidate-id":s.issueId,"data-candidate-trigger":d?.trigger??"none",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,e.jsx)(R,{to:qe({id:s.issueId,identifier:s.identifier}),className:"min-w-0 truncate text-sm text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:s.title,children:s.title}),o?(0,e.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground","data-candidate-offer":"",children:[(0,e.jsx)(Le,{kind:"schedule"}),(0,e.jsxs)("span",{className:"truncate",children:[a(o.agentId??"")??"Your agent"," offered to repeat it: ",o.cadenceLabel]})]}):d?(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5","data-candidate-hint":d.trigger,children:[(0,e.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 text-xs font-medium text-foreground",children:[(0,e.jsx)(Le,{kind:d.trigger}),(0,e.jsxs)("span",{className:"truncate",children:[Dn[d.trigger],d.cadenceLabel?(0,e.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",d.cadenceLabel]}):null]})]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-candidate-why":"",children:d.why})]}):(0,e.jsxs)("p",{className:"text-xs text-muted-foreground","data-candidate-why":"",children:[x?`${x}. `:null,c?`How it could run is unclear from the title; work it out with ${c}.`:"How it could run is unclear from the title."]}),s.conversation?(0,e.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground","data-candidate-conversation":s.conversation.state,children:[(0,e.jsx)(ds,{"aria-hidden":"true",className:"size-3 shrink-0"}),s.conversation.state==="proposal_waiting"?`${a(s.conversation.agentId??"")??"Your agent"} has proposed an automation`:`Talking it through with ${a(s.conversation.agentId??"")??"your agent"}`]}):null,v?(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:[u.error?"Couldn’t open the conversation.":"Couldn’t accept the offer."," ",z(v).body]}):null]}),(0,e.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-1","data-candidate-actions":"",children:[o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(N,{type:"button",size:"xs",disabled:g.isPending,onClick:n(()=>g.mutate(),"onClick"),children:[(0,e.jsx)(ve,{"aria-hidden":"true"}),g.isPending?"Accepting…":"Accept"]}),(0,e.jsx)(N,{type:"button",size:"xs",variant:"ghost",disabled:g.isPending,onClick:n(()=>l.onSetUpByHand(s,t),"onClick"),children:"Change"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(N,{type:"button",size:"xs",disabled:u.isPending||!s.conversation&&!s.responsibleAgentId,title:!s.conversation&&!s.responsibleAgentId?"No agent can take this; set it up by hand":void 0,onClick:h,"data-automate-with-agent":"",children:[(0,e.jsx)(ds,{"aria-hidden":"true"}),u.isPending?"Opening…":kt(s,a)]}),(0,e.jsxs)(N,{type:"button",size:"xs",variant:"ghost",className:"text-muted-foreground",onClick:n(()=>l.onSetUpByHand(s,t),"onClick"),"data-set-up-by-hand":"",children:[(0,e.jsx)(Ea,{"aria-hidden":"true"}),"Set up by hand"]})]}),(0,e.jsx)(N,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":o?`No thanks to repeating ${s.title}`:`${s.title} doesn't repeat`,title:o?"No thanks":"Doesn't repeat",onClick:y,children:(0,e.jsx)(Se,{"aria-hidden":"true"})})]})]})}n(Fn,"CandidateRow");function Os({routineId:s,title:t,paused:a}){const r=J(),l=H({mutationFn:n(i=>Aa.update(s,{status:i}),"mutationFn"),onSettled:n(()=>Pe(r),"onSettled")});return(0,e.jsxs)("span",{className:"flex items-center gap-0.5","data-standing-check-actions":"",children:[(0,e.jsx)(N,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground",disabled:l.isPending,"aria-label":a?`Resume ${t}`:`Pause ${t}`,title:a?"Resume":"Pause",onClick:n(()=>l.mutate(a?"active":"paused"),"onClick"),children:a?(0,e.jsx)(ba,{"aria-hidden":"true"}):(0,e.jsx)(Ta,{"aria-hidden":"true"})}),(0,e.jsx)(N,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground",disabled:l.isPending,"aria-label":`Remove ${t}`,title:"Remove",onClick:n(()=>l.mutate("archived"),"onClick"),children:(0,e.jsx)(La,{"aria-hidden":"true"})}),l.error?(0,e.jsxs)("span",{role:"alert",className:"sr-only",children:["Couldn’t change it. ",z(l.error).body]}):null]})}n(Os,"StandingCheckActions");function qn({item:s,agentName:t,now:a}){const r=$t(s,a),l=t(s.assigneeAgentId)??"An agent";return(0,e.jsxs)("li",{className:"flex min-w-0 items-start gap-2","data-automation-id":s.id,"data-automation-start":s.start.kind,children:[(0,e.jsx)(Le,{kind:s.start.kind,className:"mt-0.5"}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-start justify-between gap-1",children:[(0,e.jsx)(R,{to:ze(s.id),className:"min-w-0 truncate text-sm text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:s.title,children:s.title}),s.start.kind==="standing_check"?(0,e.jsx)(Os,{routineId:s.id,title:s.title,paused:!1}):null]}),(0,e.jsxs)("span",{className:"text-xs text-muted-foreground","data-automation-start-words":"",children:[r.label,r.detail?` · ${r.detail}`:null,` · ${l}`,s.otherStarts>0?` · +${s.otherStarts} more ${s.otherStarts===1?"way":"ways"} to start`:null]}),r.status?(0,e.jsxs)("span",{className:"text-xs text-muted-foreground","data-automation-status":"",children:[r.status,s.start.kind==="standing_check"&&s.start.lastResult?.issue?(0,e.jsxs)(e.Fragment,{children:[" · ",(0,e.jsx)(R,{to:qe({id:s.start.lastResult.issue.id,identifier:s.start.lastResult.issue.identifier}),className:"underline-offset-4 hover:underline",children:s.start.lastResult.issue.identifier??s.start.lastResult.issue.title})]}):null]}):null,s.start.kind==="webhook"&&s.start.webhookUrl?(0,e.jsxs)("span",{className:"flex min-w-0 flex-col text-xs text-muted-foreground","data-automation-webhook":"",children:[(0,e.jsxs)("span",{className:"truncate font-mono",title:s.start.webhookUrl,children:["POST ",s.start.webhookUrl]}),(0,e.jsx)("span",{children:mt(s.start.signingMode)})]}):null]})]})}n(qn,"AutomationEntry");function Bn({item:s,agentName:t}){return(0,e.jsxs)("li",{className:"flex min-w-0 items-start gap-2 text-xs","data-automation-stalled":s.reason,children:[(0,e.jsx)(Ja,{"aria-hidden":"true",className:"mt-0.5 size-3.5 shrink-0 text-(--status-task-icon-todo)"}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-start justify-between gap-1",children:[(0,e.jsxs)("span",{className:"min-w-0",children:[(0,e.jsx)(R,{to:ze(s.id),className:"text-foreground hover:underline",title:s.title,children:s.title}),(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" · ",Et(s,t)]})]}),s.startKind==="standing_check"&&s.reason==="paused"?(0,e.jsx)(Os,{routineId:s.id,title:s.title,paused:!0}):null]})]})}n(Bn,"StalledEntry");var Un=(0,m.memo)(n(function({responsibility:t,automation:a,dismissed:r,agentName:l,now:i,actions:u}){const[o,d]=(0,m.useState)(!1),x=a?.level??"manual",c=a?.share??null,h=et(c),g=Ct(c),f=a?.automations??[],y=(a?.automationCount??0)-f.length,v=a?.stalledAutomations??[],w=a?_t(a,r):{shown:[],others:[],unlisted:0,more:0},p=o?[...w.shown,...w.others]:w.shown,S=a&&p.length===0?Kt(a):null,j=P(t.id);return(0,e.jsx)("li",{className:"min-w-0","data-responsibility-id":t.id,"data-automation-level":x,children:(0,e.jsxs)("div",{className:"grid min-w-0 gap-4 rounded-lg border border-border bg-card px-4 py-3 @4xl:grid-cols-(--responsibility-automation-row-cols) @4xl:gap-6",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5","data-automation-identity":"",children:[(0,e.jsx)(R,{to:j,className:"line-clamp-2 text-sm font-semibold text-foreground hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:t.title,children:t.title}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[(0,e.jsx)(On,{level:x}),g?(0,e.jsx)("span",{className:"text-xs font-medium tabular-nums text-foreground","data-automation-share":"",children:g}):null]}),(0,e.jsx)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-muted","aria-hidden":"true","data-automation-meter":"",children:h?(0,e.jsx)("div",{className:"status-fill h-full rounded-full",style:{...Je(x),width:`${h}%`}}):null}),(0,e.jsx)("p",{className:"text-xs tabular-nums text-muted-foreground","data-automation-counts":"",children:a?St(a):"Not counted yet."})]}),(0,e.jsxs)("section",{className:"flex min-w-0 flex-col gap-2","aria-label":"Runs without you","data-automation-running":"",children:[(0,e.jsx)("h3",{className:"text-xs font-semibold text-muted-foreground",children:"Runs without you"}),f.length>0?(0,e.jsxs)("ul",{className:"flex flex-col gap-2",children:[f.map(k=>(0,e.jsx)(qn,{item:k,agentName:l,now:i},k.id)),y>0?(0,e.jsx)("li",{className:"pl-5.5 text-xs text-muted-foreground",children:(0,e.jsxs)(R,{to:j,className:"hover:underline",children:["and ",y," more ",y===1?"automation":"automations"]})}):null]}):(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-automation-none-running":"",children:"Nothing runs on its own yet."}),v.length>0?(0,e.jsx)("ul",{className:"flex flex-col gap-1.5","aria-label":"Not running",children:v.map(k=>(0,e.jsx)(Bn,{item:k,agentName:l},k.id))}):null]}),(0,e.jsxs)("section",{className:"@container flex min-w-0 flex-col gap-2","aria-label":"Manual tasks that could be automated","data-automation-manual":"",children:[(0,e.jsx)("h3",{className:"text-xs font-semibold text-muted-foreground",children:"Manual tasks that could be automated"}),p.length>0?(0,e.jsx)("ul",{className:"flex flex-col gap-2",children:p.map(k=>(0,e.jsx)(Fn,{candidate:k,responsibilityId:t.id,agentName:l,now:i,actions:u},k.issueId))}):S?(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-automation-quiet":"",children:S}):null,w.more>0&&!o?w.others.length>0?(0,e.jsxs)(N,{type:"button",variant:"link",size:"xs",className:"h-auto self-start px-0 text-xs text-muted-foreground",onClick:n(()=>d(!0),"onClick"),"data-automation-more":"",children:["and ",w.more," more manual ",w.more===1?"task":"tasks"]}):(0,e.jsxs)(R,{to:j,className:"text-xs text-muted-foreground hover:underline","data-automation-more":"",children:["and ",w.more," more manual ",w.more===1?"task":"tasks"]}):null,o&&w.unlisted>0?(0,e.jsxs)(R,{to:j,className:"text-xs text-muted-foreground hover:underline","data-automation-more":"",children:["and ",w.unlisted," more on the responsibility’s page"]}):null]})]})})},"AutomationRow"));function Hn({group:s,byId:t,dismissed:a,agentName:r,now:l,actions:i}){const u=s.area?.id??"none",o=`automation-area-${u}`;return(0,e.jsxs)("section",{"aria-labelledby":o,"data-board-area":u,className:"flex flex-col gap-3 border-t border-border pt-4",children:[(0,e.jsx)(Ls,{headingId:o,title:s.area?.title??"Not in an area",archived:s.area?.status==="archived",ownedLabel:s.ownedLabel,shareLabel:s.automationShare}),(0,e.jsx)("ul",{className:"flex flex-col gap-3",children:s.items.map(d=>(0,e.jsx)(Un,{responsibility:d,automation:t.get(d.id)??null,dismissed:a,agentName:r,now:l,actions:i},d.id))})]})}n(Hn,"AutomationAreaSection");function Vn(){return(0,e.jsxs)("div",{className:"flex flex-col gap-6","aria-busy":"true","aria-label":"Loading how automated your responsibilities are",children:[(0,e.jsx)(te,{className:"h-44 w-full rounded-xl"}),(0,e.jsx)("div",{className:"flex flex-col gap-3",children:Array.from({length:3},(s,t)=>(0,e.jsx)(te,{className:"h-32 w-full rounded-lg"},t))})]})}n(Vn,"AutomationSkeleton");function Wn({companyId:s,overview:t,agents:a,agentsById:r,now:l,onAddResponsibility:i,onReviewProposals:u}){const o=(0,m.useMemo)(()=>Z(t.responsibilities),[t.responsibilities]),d=Q({queryKey:L.responsibilities.automation(s,t.ownerUserId),queryFn:n(()=>Y.automation(s),"queryFn"),enabled:o.length>0}),[x,c]=Ln(s),[h,g]=(0,m.useState)(null),[f,y]=(0,m.useState)(null),v=(0,m.useCallback)(j=>r.get(j)?.name,[r]),w=d.data,p=(0,m.useMemo)(()=>new Map(o.map(j=>[j.id,j.title])),[o]),S=(0,m.useMemo)(()=>({onSetUpByHand:n((j,k)=>{const T=[k,...(w?.responsibilities??[]).filter(I=>I.manualTaskIds.includes(j.issueId)).map(I=>I.responsibilityId).filter(I=>I!==k)];g({task:{issueId:j.issueId,identifier:j.identifier,title:j.pendingOffer?.title??j.title,assigneeAgentId:j.pendingOffer?.agentId??j.responsibleAgentId??j.assigneeAgentId,suggestedCadence:j.suggestedCadence,cadenceSource:j.cadenceSource},filedUnder:T.map(I=>p.get(I)).filter(I=>!!I)})},"onSetUpByHand"),onDismiss:n(j=>c(j.issueId),"onDismiss"),onMade:y}),[c,w,p]);return o.length===0&&t.proposed.length===0?(0,e.jsx)(re,{companyId:s,onAdd:n(()=>i(null),"onAdd")}):(0,e.jsxs)("div",{className:"@container flex flex-col gap-6","data-dashboard-view":"automation",children:[(0,e.jsx)(ne,{count:t.proposed.length,onReview:u}),f?(0,e.jsxs)("div",{role:"status",className:"flex items-center justify-between gap-2 rounded-lg border border-border bg-muted/40 px-4 py-2","data-automation-made":"",children:[(0,e.jsxs)("p",{className:"flex min-w-0 items-center gap-2 text-sm text-foreground",children:[(0,e.jsx)(ve,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"}),f]}),(0,e.jsx)(N,{type:"button",size:"icon-xs",variant:"ghost","aria-label":"Dismiss",onClick:n(()=>y(null),"onClick"),children:(0,e.jsx)(Se,{"aria-hidden":"true"})})]}):null,o.length>0?(0,e.jsx)(He,{query:d,action:"load how automated your responsibilities are",loading:(0,e.jsx)(Vn,{}),children:n(j=>(0,e.jsx)(Kn,{overview:t,active:o,read:j,dismissed:x,agentName:v,now:l,actions:S}),"children")}):null,(0,e.jsx)(jt,{open:h!==null,onOpenChange:n(j=>{j||g(null)},"onOpenChange"),companyId:s,task:h?.task??null,agents:a,filedUnder:h?.filedUnder??[],onCreated:n(j=>y(`“${j.routine.title}” is automated now: ${j.cadenceLabel}.`),"onCreated")})]})}n(Wn,"DashboardAutomation");function Kn({overview:s,active:t,read:a,dismissed:r,agentName:l,now:i,actions:u}){const[o,d]=(0,m.useState)(()=>new Set),x=(0,m.useMemo)(()=>ia(s.areas,s.responsibilities,a,o),[s.areas,s.responsibilities,a,o]),c=(0,m.useMemo)(()=>la(t,a),[t,a]),h=(0,m.useMemo)(()=>Dt(a),[a]),g=(0,m.useCallback)(f=>{d(y=>{const v=new Set(y);return v.has(f)?v.delete(f):v.add(f),v})},[]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(zn,{counts:c,read:a,dismissed:r,filter:o,onToggle:g,onClear:n(()=>d(new Set),"onClear")}),x.length>0?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-automation-rows":"",children:x.map(f=>(0,e.jsx)(Hn,{group:f,byId:h,dismissed:r,agentName:l,now:i,actions:u},f.area?.id??"__no_area__"))}):null]})}n(Kn,"AutomationBody");function Gn({counts:s}){const t=ae.reduce((a,r)=>a+s[r],0);return(0,e.jsx)("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted","aria-hidden":"true",children:t>0?ae.map(a=>s[a]>0?(0,e.jsx)("div",{"data-health":a,className:"status-fill h-full",style:{...de(a),flexGrow:s[a],flexBasis:0}},a):null):null})}n(Gn,"HealthBar");function Ps({counts:s,selected:t,onSelect:a,children:r}){const l=ae.reduce((i,u)=>i+s[u],0);return(0,e.jsxs)(F,{elevation:"low",className:"gap-4 px-5 py-4","aria-labelledby":"responsibility-standing-heading",children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,e.jsx)("h3",{id:"responsibility-standing-heading",className:"text-sm font-semibold text-foreground",children:"Where things stand"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground tabular-nums",children:l===1?"1 responsibility":`${l} responsibilities`})]}),(0,e.jsx)(Gn,{counts:s}),(0,e.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",role:a?"group":void 0,"aria-label":a?"Filter by status":void 0,children:ae.map(i=>{const u=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"status-fill size-2 shrink-0 rounded-full",style:de(i),"aria-hidden":"true"}),(0,e.jsx)("span",{className:"truncate",children:K[i]})]}),(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:s[i]})]});if(!a)return(0,e.jsx)("div",{className:"flex min-w-0 flex-col gap-1",children:u},i);const o=t===i;return(0,e.jsx)("button",{type:"button","aria-pressed":o,onClick:n(()=>a(o?null:i),"onClick"),className:$("flex min-w-0 flex-col items-start gap-1 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",o&&"bg-accent"),children:u},i)})}),r]})}n(Ps,"ResponsibilityStandingSummary");function Qn({agentTasks:s,userTasks:t,openTasks:a}){const r=Ys(s,a);return(0,e.jsxs)(F,{elevation:"low",className:"gap-4 px-5 py-4","aria-labelledby":"responsibility-agent-powered-heading",children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,e.jsx)("h3",{id:"responsibility-agent-powered-heading",className:"text-sm font-semibold text-foreground",children:"Agent-powered"}),(0,e.jsx)(Be,{className:"size-4 text-muted-foreground","aria-hidden":"true"})]}),(0,e.jsx)("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",role:"meter","aria-label":"Open tasks run by an agent","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r.percent,"aria-valuetext":a>0?`${r.label} open tasks`:r.label,children:(0,e.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${r.percent}%`}})}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Run by an agent"}),(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:s})]}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"On you alone"}),(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:t})]})]})]})}n(Qn,"AgentPoweredSummary");var Yn={holding:"text-foreground",keeping:"text-foreground",note:"text-muted-foreground"};function Jn({role:s}){return(0,e.jsx)("span",{"aria-hidden":"true",className:"status-fill mt-1.5 size-1.5 shrink-0 rounded-full",style:de(s==="holding"?"behind":s==="keeping"?"on_track":"not_measured")})}n(Jn,"LineMark");var Xn=(0,m.memo)(n(function({responsibility:t}){const{health:a,metric:r}=t.rollup,l=r?Xt(r):null,i=(0,m.useMemo)(()=>Wt(t),[t]),u=t.standard?.trim(),o=i.gap??i.missing,d=r?sa(r):null,x=r?d?`${d} · ${r.name}`:r.name:"Nothing measured";return(0,e.jsx)("li",{className:"min-w-0","data-responsibility-id":t.id,"data-health":a,children:(0,e.jsxs)(R,{to:P(t.id),className:"status-chip flex h-(--responsibility-board-card-h) flex-col overflow-hidden rounded-lg border px-3 py-3 transition-shadow hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",style:de(a),children:[(0,e.jsxs)("span",{className:"sr-only",children:[K[a],": "]}),(0,e.jsx)("span",{className:"line-clamp-2 text-sm font-medium text-foreground",title:t.title,children:t.title}),(0,e.jsx)("span",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",title:u||void 0,children:u||"No bar yet."}),(0,e.jsxs)("span",{className:"mt-2.5 flex min-w-0 items-center gap-1.5 tabular-nums","data-board-reading":"",children:[(0,e.jsx)("span",{className:$("whitespace-nowrap text-lg font-semibold",l?"text-foreground":"text-muted-foreground"),children:l??(r?"No reading":"No number")}),r?.stale?(0,e.jsxs)("span",{className:"text-(--status-task-icon-todo)",title:"Not updated recently",children:[(0,e.jsx)(Is,{"aria-hidden":"true",className:"size-3.5"}),(0,e.jsx)("span",{className:"sr-only",children:", not updated recently"})]}):null]}),(0,e.jsx)("span",{className:"line-clamp-1 text-xs text-muted-foreground",title:x,children:x}),o?(0,e.jsx)("span",{className:"mt-1 line-clamp-2 text-xs font-medium text-foreground",title:o,"data-board-gap":"",children:o}):null,i.lines.length>0?(0,e.jsxs)("span",{className:"mt-2 flex min-h-0 flex-col gap-1","data-board-why":"",children:[i.lines.map(c=>(0,e.jsxs)("span",{className:"flex min-w-0 items-start gap-1.5","data-why-role":c.role,children:[(0,e.jsx)(Jn,{role:c.role}),(0,e.jsx)("span",{className:$("line-clamp-2 text-xs",Yn[c.role]),title:c.text,children:c.text})]},`${c.kind}:${c.text}`)),i.more>0?(0,e.jsxs)("span",{className:"pl-3 text-xs text-muted-foreground",children:["and ",i.more," more"]}):null]}):null]})})},"BoardCard"));function zs({health:s,count:t,className:a}){const r=ys[s];return(0,e.jsxs)("span",{className:$("flex min-w-0 items-center gap-1.5 text-xs font-semibold text-foreground",a),children:[(0,e.jsx)(r,{"aria-hidden":"true",className:"size-3.5 shrink-0",style:{color:`var(${it[s]})`}}),(0,e.jsx)("span",{className:"truncate",children:K[s]}),(0,e.jsx)("span",{className:"font-normal tabular-nums text-muted-foreground",children:t})]})}n(zs,"StatusLabel");function Zn({row:s}){const t=`board-area-${s.area?.id??"none"}`;return(0,e.jsx)(Tn,{headingId:t,areaKey:s.area?.id??"none",header:(0,e.jsx)(Ls,{headingId:t,title:s.area?.title??"Not in an area",archived:s.area?.status==="archived",ownedLabel:s.ownedLabel,shareLabel:s.share?.label??null}),columns:ae,cells:s.byHealth,renderLabel:n((a,r,l)=>(0,e.jsx)(zs,{health:a,count:r,className:l}),"renderLabel"),renderCard:n(a=>(0,e.jsx)(Xn,{responsibility:a},a.id),"renderCard")})}n(Zn,"AreaRow");function er({companyId:s,overview:t,onAddResponsibility:a,onReviewProposals:r}){const l=(0,m.useMemo)(()=>Z(t.responsibilities),[t.responsibilities]),i=(0,m.useMemo)(()=>wt(t.areas,t.responsibilities),[t.areas,t.responsibilities]),u=ra(s),o=t.totals.byHealth;return l.length===0&&t.proposed.length===0?(0,e.jsx)(re,{companyId:s,onAdd:n(()=>a(null),"onAdd")}):(0,e.jsxs)("div",{className:"@container flex flex-col gap-6","data-dashboard-view":"board",children:[(0,e.jsx)(ne,{count:t.proposed.length,onReview:r}),(0,e.jsx)(Ps,{counts:o,children:(0,e.jsx)(Ot,{summary:u.summary,stillWaiting:u.stillWaiting,className:"border-t border-border pt-3"})}),i.length>0?(0,e.jsx)(Rn,{headers:ae.map(d=>(0,e.jsx)(zs,{health:d,count:o[d]},d)),children:i.map(d=>(0,e.jsx)(Zn,{row:d},d.area?.id??"__no_area__"))}):null]})}n(er,"DashboardBoard");function Fs(s){return s.filter(t=>qa(t))}n(Fs,"chatTargetAgents");function sr(s){let t=null;for(const a of Fs(s)){if(!t){t=a;continue}const r=new Date(a.createdAt).getTime(),l=new Date(t.createdAt).getTime();(r<l||r===l&&a.id<t.id)&&(t=a)}return t}n(sr,"defaultChatAgent");function tr(s,t){return Ma(Fs(s),[...t]).map(a=>({id:ga({assigneeAgentId:a.id}),label:a.name,searchText:`${a.name} ${a.role??""} ${a.title??""}`}))}n(tr,"chatAgentOptions");function ms(s){return s?.startsWith("agent:")&&s.slice(6)||null}n(ms,"agentIdFromChatValue");var hs="(max-width: 767px)";function ar(){const[s,t]=(0,m.useState)(()=>typeof window<"u"&&!!window.matchMedia?.(hs).matches);return(0,m.useEffect)(()=>{const a=window.matchMedia?.(hs);if(!a)return;const r=n(()=>t(a.matches),"update");return a.addEventListener?.("change",r),()=>a.removeEventListener?.("change",r)},[]),s}n(ar,"useNarrowViewport");function nr({companyId:s,agents:t,loaded:a}){const r=Q({queryKey:L.auth.session,queryFn:n(()=>Ue.getSession(),"queryFn")}),l=r.data?.user?.id??r.data?.session?.userId??null,i=Na(s,l),u=ar(),o=(0,m.useMemo)(()=>ca(),[]),d=(0,m.useMemo)(()=>tr(t,o),[t,o]),x=(0,m.useMemo)(()=>sr(t),[t]),c=(0,m.useMemo)(()=>new Map(t.map(b=>[b.id,b])),[t]),[h,g]=(0,m.useState)(null),f=h&&d.some(b=>b.id===h)?h:x?`agent:${x.id}`:"",[y,v]=(0,m.useState)(""),[w,p]=(0,m.useState)([]),[S,j]=(0,m.useState)(null),[k,T]=(0,m.useState)(null),I=(0,m.useRef)(null),_=(0,m.useCallback)(async(b,O,G)=>{const V=t.find(B=>B.id===ms(f));if(!V){T("Choose an agent to talk to.");return}const ce=`${V.id}
3
+ ${b}
4
+ ${w.map(B=>B.id).join(",")}`;I.current?.key!==ce&&(I.current={key:ce,id:crypto.randomUUID()}),T(null);try{await i({agent:V,body:b,files:w.map(B=>B.file),runSettings:G,clientRequestId:I.current.id}),I.current=null,v(""),p([])}catch(B){T(`Couldn’t start the chat with ${V.name}. ${z(B).body}`)}},[t,w,i,f]);if(!a)return null;if(d.length===0)return(0,e.jsxs)("p",{className:"mx-auto w-full max-w-(--tc-shell-max-w) text-sm text-muted-foreground","data-dashboard-chat":"no-agents",children:[(0,e.jsx)(R,{to:"/agents/new",className:"underline underline-offset-4 hover:text-foreground",children:"Add an agent"})," to start a chat from here."]});const D=w.filter(b=>b.file.type.startsWith("image/")),C=w.filter(b=>!b.file.type.startsWith("image/")),E=n(b=>p(O=>O.filter(G=>G.id!==b)),"removeFile");return(0,e.jsx)("div",{className:"mx-auto w-full max-w-(--tc-shell-max-w)","data-dashboard-chat":"",children:(0,e.jsx)(ha,{workMode:"standard",mobile:u,companyId:s,enableReassign:!0,reassignOptions:d,modelAgents:c,agentMap:c,currentAssigneeValue:f,onPendingAssigneeChange:n(b=>{if(b===null)return;const O=ms(b);O&&Va(O,s),g(b),j(null),T(null)},"onPendingAssigneeChange"),creation:{value:y,onChange:n(b=>{v(b),k&&T(null)},"onChange"),onSubmit:_,submitLabel:"Send",onSelectFiles:n(b=>p(O=>[...O,...b.map(G=>({id:crypto.randomUUID(),file:G}))]),"onSelectFiles"),images:D.map(b=>({id:b.id,name:b.file.name,file:b.file})),onRemoveImage:E,runSettings:S,onRunSettingsChange:j,header:k?(0,e.jsx)("p",{role:"alert",className:"mb-2 text-sm text-destructive",children:k}):null,details:C.length>0?(0,e.jsx)("ul",{className:"mt-2 flex flex-wrap gap-2",children:C.map(b=>(0,e.jsxs)("li",{className:"flex max-w-full items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-foreground",children:[(0,e.jsx)("span",{className:"truncate",children:b.file.name}),(0,e.jsx)("button",{type:"button",className:"rounded-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${b.file.name}`,onClick:n(()=>E(b.id),"onClick"),children:(0,e.jsx)(Se,{"aria-hidden":"true",className:"size-3"})})]},b.id))}):null}})})}n(nr,"DashboardChatComposer");function rr({entry:s,areaTitle:t}){const{responsibility:a,signal:r}=s;return(0,e.jsxs)("li",{className:"flex flex-col gap-1 px-5 py-3.5","data-responsibility-id":a.id,"data-reason":s.reason,children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,e.jsx)(R,{to:P(a.id),className:"text-sm font-semibold text-foreground underline-offset-4 hover:underline",children:a.title}),(0,e.jsx)(bs,{health:a.rollup.health,overridden:a.rollup.healthOverridden}),t?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:t}):null]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:a.rollup.statusSentence}),r?(0,e.jsx)(Fe,{signals:[r],size:"xs",responsibilityHref:P,className:"pt-0.5"}):null]})}n(rr,"ExceptionRow");function lr({companyId:s,overview:t,onAddResponsibility:a,onReviewProposals:r}){const l=(0,m.useMemo)(()=>Z(t.responsibilities).length,[t.responsibilities]),i=(0,m.useMemo)(()=>ks(t.totals.byHealth),[t.totals.byHealth]),{exceptions:u,onTrack:o}=(0,m.useMemo)(()=>qt(t.areas,t.responsibilities),[t.areas,t.responsibilities]),d=(0,m.useMemo)(()=>new Map(t.areas.map(x=>[x.id,x.title])),[t.areas]);return l===0&&t.proposed.length===0?(0,e.jsx)(re,{companyId:s,onAdd:n(()=>a(null),"onAdd")}):(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-dashboard-view":"exceptions",children:[(0,e.jsxs)("p",{className:"flex items-start gap-2.5 text-lg font-medium text-foreground","data-overall-status":i.health,children:[(0,e.jsx)(ie,{health:i.health,label:`${K[i.health]}:`,className:"mt-2.5"}),(0,e.jsx)("span",{children:i.sentence})]}),(0,e.jsx)(ne,{count:t.proposed.length,onReview:r}),u.length>0?(0,e.jsxs)("section",{"aria-labelledby":"exceptions-needs-a-look-heading",className:"flex flex-col gap-2",children:[(0,e.jsxs)("h2",{id:"exceptions-needs-a-look-heading",className:"text-sm font-semibold text-foreground",children:["Needs a look ",(0,e.jsx)("span",{className:"font-normal tabular-nums text-muted-foreground",children:u.length})]}),(0,e.jsx)(F,{elevation:"low",className:"gap-0 py-0",children:(0,e.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:u.map(x=>(0,e.jsx)(rr,{entry:x,areaTitle:x.responsibility.areaId?d.get(x.responsibility.areaId)??null:null},x.responsibility.id))})})]}):null,o.length>0?(0,e.jsxs)("section",{"aria-labelledby":"exceptions-on-track-heading",className:"flex flex-col gap-2",children:[(0,e.jsx)("h2",{id:"exceptions-on-track-heading",className:"sr-only",children:"On track"}),(0,e.jsx)("ul",{className:"flex flex-col gap-1.5",children:o.map(x=>(0,e.jsxs)("li",{className:"flex items-start gap-2 text-sm","data-on-track-area":x.areaId??"none",children:[(0,e.jsx)(ie,{health:"on_track",className:"mt-1.5 size-2"}),(0,e.jsxs)("span",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"text-foreground",children:x.label}),x.responsibilities.length>0?(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" · ",x.responsibilities.map((c,h)=>(0,e.jsxs)(m.Fragment,{children:[h>0?", ":null,(0,e.jsx)(R,{to:P(c.id),className:"underline-offset-4 hover:text-foreground hover:underline",children:c.title})]},c.id))]}):null]})]},x.areaId??"__no_area__"))})]}):null]})}n(lr,"DashboardExceptions");var qs="paperclip:responsibilities:outline-v2-collapsed",ir="one_screen_v2";function Bs(s,t,a=new Set){const r=new Set(a);for(const l of s)l.status==="active"&&r.add(l.id);return Ne(s,Z(t),r).map(l=>({key:l.area?.id??"__no_area__",area:l.area,items:l.items}))}n(Bs,"outlineV2Groups");function or(s){return s.standard?.trim()||s.title}n(or,"outlineV2Line");function fs(s){return{areas:s.filter(t=>t.area!==null).length,responsibilities:s.reduce((t,a)=>t+a.items.length,0)}}n(fs,"outlineV2Counts");function dr({areas:s,responsibilities:t}){return`${s===1?"1 area":`${s} areas`} and ${t===1?"1 responsibility":`${t} responsibilities`}`}n(dr,"outlineV2CountsLabel");function cr(s,t){if(t==="all")return[...s];const a=t==="has_routines",r=[];for(const l of s){const i=l.items.filter(u=>u.rollup.routines>0===a);i.length>0&&r.push({...l,items:i})}return r}n(cr,"filterOutlineV2Groups");function ur(s,t){const a=t.toLowerCase().split(/\s+/).filter(Boolean);if(a.length===0)return[...s];const r=n(i=>a.every(u=>i.includes(u)),"matches"),l=[];for(const i of s){const u=(i.area?.title??"").toLowerCase();if(u&&r(u)){l.push(i);continue}const o=i.items.filter(d=>r(`${u} ${d.title} ${d.standard??""}`.toLowerCase()));o.length>0&&l.push({...i,items:o})}return l}n(ur,"searchOutlineV2Groups");function Us(s,t){const a=t.routineFilter??"all",r=t.search?.trim()??"";return ur(cr(s,a),r)}n(Us,"outlineV2VisibleGroups");function xr(s){return`${P(s)}?view=${ir}`}n(xr,"outlineV2Href");function mr(s){try{const t=globalThis.localStorage?.getItem(`${qs}:${s}`),a=t?JSON.parse(t):[];return new Set(Array.isArray(a)?a.filter(r=>typeof r=="string"):[])}catch{return new Set}}n(mr,"readCollapsedAreas");function hr(s,t){try{globalThis.localStorage?.setItem(`${qs}:${t}`,JSON.stringify([...s]))}catch{}}n(hr,"writeCollapsedAreas");function fr(s,t){const a=J(),r=Ra(),l=L.responsibilities.dashboard(s,t),i=Q({queryKey:l,queryFn:n(()=>fe.state(s,t),"queryFn")}),u=H({mutationFn:n(d=>fe.start(s,{mode:d,ownerUserId:t}),"mutationFn"),onSuccess:n(d=>{a.setQueryData(l,d),d.conversation&&r(`/issues/${d.conversation.identifier??d.conversation.issueId}`)},"onSuccess")}),o=H({mutationFn:n(d=>fe.restore(d),"mutationFn"),onSuccess:n(()=>a.invalidateQueries({queryKey:L.responsibilities.all}),"onSuccess")});return{query:i,state:i.data??null,start:u,restore:o}}n(fr,"useDashboardConversation");function gr({change:s,busy:t,onUndo:a}){const[r,l]=(0,m.useState)(()=>yt());return r===s.id?null:(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2","data-dashboard-latest-change":s.cause,children:[(0,e.jsx)("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:vt(s)}),(0,e.jsxs)(N,{type:"button",size:"xs",variant:"outline",disabled:t,onClick:a,"data-dashboard-undo":"",children:[t?(0,e.jsx)(oe,{"aria-hidden":"true",className:"animate-spin"}):null,"Undo"]}),(0,e.jsx)(N,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":"Dismiss",onClick:n(()=>{nt(s.id),l(s.id)},"onClick"),children:(0,e.jsx)(Se,{"aria-hidden":"true"})})]})}n(gr,"LatestChange");function pr({list:s,agentsById:t,restoringId:a,onRestore:r}){if(s.versions.length===0)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No versions yet."});const l=n(i=>t.get(i)?.name,"agentName");return(0,e.jsx)("ul",{className:"flex flex-col divide-y divide-border","data-dashboard-versions":"",children:s.versions.map((i,u)=>(0,e.jsxs)("li",{className:"flex min-w-0 items-center gap-3 py-2.5","data-dashboard-version":i.cause,children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,e.jsx)("p",{className:"break-words text-sm text-foreground",children:i.summary}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[_a(i.createdAt)," · ",ot(i,l)]})]}),u===0?(0,e.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:"Now"}):(0,e.jsxs)(N,{type:"button",size:"xs",variant:"outline",disabled:a!==null,onClick:n(()=>r(i.id),"onClick"),children:[a===i.id?(0,e.jsx)(oe,{"aria-hidden":"true",className:"animate-spin"}):null,"Restore"]})]},i.id))})}n(pr,"DashboardVersionList");function br({companyId:s,ownerUserId:t,open:a,onOpenChange:r,agentsById:l,restore:i}){const u=Q({queryKey:L.responsibilities.dashboardVersions(s,t),queryFn:n(()=>fe.versions(s,t),"queryFn"),enabled:a,staleTime:0}),o=Ke(u);return(0,e.jsx)(Re,{open:a,onOpenChange:r,children:(0,e.jsxs)(Ce,{className:"sm:max-w-lg",children:[(0,e.jsxs)(ke,{children:[(0,e.jsx)(_e,{children:"Previous versions"}),(0,e.jsx)(Ge,{className:"sr-only",children:"Saved versions of your dashboard, newest first."})]}),o.kind==="error"?(0,e.jsx)(we,{error:o.error,size:"inline",action:"load the versions",onRetry:o.retry,retrying:o.isFetching}):o.data?(0,e.jsx)(pr,{list:o.data,agentsById:l,restoringId:i.isPending?i.variables??null:null,onRestore:n(d=>i.mutate(d),"onRestore")}):(0,e.jsx)(oe,{"aria-label":"Loading",className:"size-4 animate-spin text-muted-foreground"}),i.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t restore it. ",z(i.error).body]}):null]})})}n(br,"VersionsDialog");function jr({empty:s,state:t,agentsById:a,starting:r,startError:l,undoing:i,undoError:u,onStart:o,onUndo:d,onAddArea:x,onOpenVersions:c}){const h=n(_=>_?a.get(_)?.name:void 0,"nameOf"),g=t?.proposal??null,f=!g&&t?.state==="discussing"&&t.conversation?t.conversation:null,y=t!==null,v=y&&!f&&!g&&t.defaultAgentId===null,w=h(t?.defaultAgentId)??"an agent",p=h(f?.agentId)??"an agent",S=t?.latestChange??null,j=f?(0,e.jsx)(R,{to:`/issues/${f.identifier??f.issueId}`,className:"font-medium text-foreground underline-offset-4 hover:underline",children:"Open the conversation"}):null,k=l?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t start it. ",z(l).body]}):u?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t undo it. ",z(u).body]}):null,T=S?.previousVersionId?(0,e.jsx)(gr,{change:S,busy:i,onUndo:n(()=>d(S.previousVersionId),"onUndo")}):null,I=g?(0,e.jsx)(bt,{interaction:g,agentName:h(g.createdByAgentId),showConversationLink:!0}):null;return s?(0,e.jsxs)(F,{elevation:"low",className:"gap-4 px-5 py-5","data-dashboard-module":"create",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Create your custom dashboard"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Have an agent research and interview you to generate a custom dashboard of areas and responsibilities that matter to you."})]}),I,f?(0,e.jsxs)("p",{className:"text-sm text-muted-foreground","data-dashboard-talking":"",children:["Talking it through with ",p,". ",j]}):null,!I&&!f?v?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No agent is free to do this. Add your areas yourself."}):(0,e.jsx)("div",{children:(0,e.jsxs)(N,{disabled:!y||r,onClick:o,"data-dashboard-start":"",children:[r?(0,e.jsx)(oe,{"aria-hidden":"true",className:"animate-spin"}):null,"Start with ",w]})}):null,k,T,(0,e.jsx)("div",{children:(0,e.jsx)(N,{size:"sm",variant:v?"outline":"ghost",className:v?void 0:"text-muted-foreground",onClick:x,"data-dashboard-add-area":"",children:"Add an area yourself"})})]}):(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-dashboard-module":"edit",children:[T,I,k,(0,e.jsxs)("div",{className:"flex min-h-11 items-center gap-2 rounded-lg border border-dashed border-border pl-2 pr-2",children:[f?(0,e.jsxs)("p",{className:"min-w-0 flex-1 px-3 text-sm text-muted-foreground","data-dashboard-talking":"",children:["Editing it with ",p,". ",j]}):v?(0,e.jsx)("p",{className:"min-w-0 flex-1 px-3 text-sm text-muted-foreground",children:"No agent is free to edit your dashboard."}):(0,e.jsxs)(N,{variant:"ghost",className:"min-w-0 flex-1 justify-start text-muted-foreground",disabled:!y||r,onClick:o,"data-dashboard-edit":"",children:[r?(0,e.jsx)(oe,{"aria-hidden":"true",className:"animate-spin"}):null,"Edit your dashboard"]}),(0,e.jsx)(N,{size:"xs",variant:"ghost",className:"shrink-0 text-muted-foreground",onClick:c,"data-dashboard-versions-open":"",children:"Versions"})]})]})}n(jr,"DashboardEditModuleView");function gs({companyId:s,ownerUserId:t,empty:a,agentsById:r,onAddArea:l}){const{query:i,state:u,start:o,restore:d}=fr(s,t),x=Ke(i),[c,h]=(0,m.useState)(!1);return x.kind==="error"?(0,e.jsx)("div",{"data-dashboard-edit-module":"error",children:(0,e.jsx)(we,{error:x.error,size:"inline",action:"load your dashboard's changes",onRetry:x.retry,retrying:x.isFetching})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(jr,{empty:a,state:u,agentsById:r,starting:o.isPending,startError:o.error,undoing:d.isPending&&!c,undoError:c?null:d.error,onStart:n(()=>o.mutate(a?"create":"edit"),"onStart"),onUndo:n(g=>d.mutate(g),"onUndo"),onAddArea:l,onOpenVersions:n(()=>{d.reset(),h(!0)},"onOpenVersions")}),(0,e.jsx)(br,{companyId:s,ownerUserId:t,open:c,onOpenChange:h,agentsById:r,restore:d})]})}n(gs,"DashboardEditModule");function Nr(s){const[t,a]=(0,m.useState)(()=>mr(s));return[t,(0,m.useCallback)(r=>{a(l=>{const i=new Set(l);return i.has(r)?i.delete(r):i.add(r),hr(i,s),i})},[s])]}n(Nr,"useCollapsedAreas");var yr=4;function vr({agentIds:s,agentsById:t,names:a}){if(s.length===0)return null;const r=s.slice(0,yr),l=s.length-r.length;return(0,e.jsxs)("span",{className:"pointer-events-none flex shrink-0 items-center gap-1",role:"img","aria-label":`Routine agents: ${a.join(", ")}`,title:a.join(", "),"data-routine-agents":s.join(","),children:[(0,e.jsx)("span",{className:"flex items-center -space-x-1.5","aria-hidden":"true",children:r.map(i=>{const u=t.get(i);return(0,e.jsx)(be,{agent:u??{id:i},name:u?.name,size:20},i)})}),l>0?(0,e.jsxs)("span",{className:"text-xs tabular-nums text-muted-foreground","aria-hidden":"true",children:["+",l]}):null]})}n(vr,"RoutineAgentAvatars");function wr({responsibility:s,agentsById:t}){const a=s.rollup.routines>0?s.rollup.routineAgentIds:[],r=a.map(l=>t.get(l)?.name??"An agent");return(0,e.jsxs)("li",{"data-responsibility-id":s.id,className:"relative flex items-center justify-between gap-4 py-3 pl-11 pr-5 text-sm text-foreground transition-colors hover:bg-accent/50",children:[(0,e.jsx)(R,{to:xr(s.id),title:r.length>0?`Routine agents: ${r.join(", ")}`:void 0,className:"min-w-0 flex-1 break-words after:absolute after:inset-0 focus-visible:outline-none focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring",children:or(s)}),(0,e.jsx)(vr,{agentIds:a,agentsById:t,names:r})]})}n(wr,"OutlineV2Row");function kr({group:s,agentsById:t,expanded:a,onToggle:r,onAdd:l}){const i=s.area?.title??"No area",u=`outline-v2-area-${s.key}`,o=s.area?.status!=="archived";return(0,e.jsxs)(F,{elevation:"low",className:"gap-0 overflow-hidden py-0","data-outline-v2-area":s.key,children:[(0,e.jsxs)("div",{className:"relative flex items-center gap-2 py-3 pl-5 pr-3 transition-colors hover:bg-accent/50",children:[(0,e.jsx)("h3",{className:"min-w-0 flex-1 text-lg font-semibold text-foreground",children:(0,e.jsxs)("button",{type:"button","aria-expanded":a,"aria-controls":u,onClick:r,className:"flex w-full items-center gap-2 text-left after:absolute after:inset-0 focus-visible:outline-none focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring",children:[(0,e.jsx)(za,{"aria-hidden":"true",className:$("size-4 shrink-0 text-muted-foreground transition-transform",a&&"rotate-90")}),(0,e.jsx)("span",{className:"min-w-0 break-words",children:i})]})}),o?(0,e.jsx)(N,{type:"button",size:"icon-xs",variant:"ghost",className:"relative z-10 text-muted-foreground","aria-label":`Add a responsibility to ${i}`,onClick:l,children:(0,e.jsx)(q,{"aria-hidden":"true"})}):null]}),(0,e.jsx)("div",{id:u,hidden:!a,children:s.items.length>0?(0,e.jsx)("ul",{className:"flex flex-col divide-y divide-border border-t border-border",children:s.items.map(d=>(0,e.jsx)(wr,{responsibility:d,agentsById:t},d.id))}):o?(0,e.jsx)("button",{type:"button",onClick:l,className:"block w-full border-t border-border py-3 pl-11 pr-5 text-left text-sm text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:"Add a responsibility"}):null})]})}n(kr,"OutlineV2Area");function Ar({search:s="",routineFilter:t="all",visibleGroups:a,onClearFilter:r,companyId:l,overview:i,agentsById:u,keepEmptyAreas:o,onAddResponsibility:d,onAddArea:x,onReviewProposals:c}){const h=(0,m.useMemo)(()=>Z(i.responsibilities),[i.responsibilities]),g=(0,m.useMemo)(()=>a?null:Bs(i.areas,i.responsibilities,o),[a,i.areas,i.responsibilities,o]),[f,y]=Nr(JSON.stringify([l,i.ownerUserId])),v=s.trim(),w=(0,m.useMemo)(()=>a??Us(g??[],{search:v,routineFilter:t}),[a,g,v,t]),p=v!==""||t!=="all",S=a?i.areas.some(k=>k.status==="active"||o.has(k.id))||h.length>0:(g?.length??0)>0,j=n(k=>(0,e.jsx)(kr,{group:k,agentsById:u,expanded:p||!f.has(k.key),onToggle:n(()=>y(k.key),"onToggle"),onAdd:n(()=>d(k.area?.id??null),"onAdd")},k.key),"renderArea");return!S&&h.length===0&&i.proposed.length===0?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-dashboard-view":"outline_v2","data-dashboard-empty":"",children:(0,e.jsx)(gs,{companyId:l,ownerUserId:i.ownerUserId,empty:!0,agentsById:u,onAddArea:x})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-dashboard-view":"outline_v2",children:[(0,e.jsx)(ne,{count:i.proposed.length,onReview:c}),w.length>0?w.map(j):v?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",role:"status","data-outline-v2-no-match":"",children:[(0,e.jsx)("span",{children:t==="all"?`Nothing matches “${v}”.`:`Nothing matches “${v}” with this filter.`}),t!=="all"&&r?(0,e.jsx)(N,{type:"button",size:"xs",variant:"ghost",onClick:r,children:"Clear filter"}):null]}):t!=="all"?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",role:"status","data-outline-v2-no-match":"",children:[(0,e.jsx)("span",{children:t==="has_routines"?"None of your responsibilities have routines yet.":"Every responsibility has at least one routine."}),r?(0,e.jsx)(N,{type:"button",size:"xs",variant:"ghost",onClick:r,children:"Clear filter"}):null]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No areas yet."}),(0,e.jsx)(gs,{companyId:l,ownerUserId:i.ownerUserId,empty:!1,agentsById:u,onAddArea:x})]})}n(Ar,"DashboardOutlineV2");var he="";function Sr(s){return s.replace(/\s+/g," ").trim()}n(Sr,"sentenceFrom");function Cr({open:s,onOpenChange:t,companyId:a,areas:r,defaultAreaId:l=null,onCreated:i}){const u=J(),[o,d]=(0,m.useState)(""),[x,c]=(0,m.useState)(he),h=Sr(o),g=r.some(p=>p.id===x)?x:he,f=H({mutationFn:n(()=>Y.create(a,{title:h,...g?{areaId:g}:{}}),"mutationFn"),onSuccess:n(p=>{u.invalidateQueries({queryKey:L.responsibilities.all}),i?.(p),t(!1)},"onSuccess")}),y=f.reset;(0,m.useEffect)(()=>{s&&(d(""),c(l??he),y())},[s,l,y]);const v=n(p=>{p.preventDefault(),!(!h||f.isPending)&&f.mutate()},"submit"),w=n(p=>{p.key!=="Enter"||p.shiftKey||p.nativeEvent.isComposing||(p.preventDefault(),p.currentTarget.form?.requestSubmit())},"onKeyDown");return(0,e.jsx)(Re,{open:s,onOpenChange:t,children:(0,e.jsx)(Ce,{className:"sm:max-w-lg","aria-describedby":void 0,children:(0,e.jsxs)("form",{className:"flex flex-col gap-5",onSubmit:v,children:[(0,e.jsx)(ke,{children:(0,e.jsx)(_e,{children:"New responsibility"})}),(0,e.jsxs)("label",{className:"flex flex-col gap-1.5 text-sm",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"What must be true?"}),(0,e.jsx)(Cs,{autoFocus:!0,rows:2,value:o,maxLength:200,placeholder:"e.g. Every customer question gets an answer within a day.",onChange:n(p=>d(p.target.value),"onChange"),onKeyDown:w})]}),r.length>0?(0,e.jsxs)("label",{className:"flex flex-col gap-1.5 text-sm",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"Area"}),(0,e.jsxs)(As,{value:g,onChange:n(p=>c(p.target.value),"onChange"),children:[(0,e.jsx)("option",{value:he,children:"No area"}),r.map(p=>(0,e.jsx)("option",{value:p.id,children:p.title},p.id))]})]}):null,f.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t add the responsibility. ",z(f.error).body]}):null,(0,e.jsxs)(Ve,{className:"items-center sm:justify-between",children:[(0,e.jsx)(N,{type:"button",variant:"ghost",onClick:n(()=>t(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(N,{type:"submit",disabled:!h||f.isPending,children:f.isPending?"Adding…":"Add responsibility"})]})]})})})}n(Cr,"QuickAddResponsibilityDialog");function _r({area:s,count:t,actions:a}){const r=`area-heading-${s?.id??"none"}`;return(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("h3",{id:r,className:"flex min-w-0 items-baseline gap-2 text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:[(0,e.jsx)("span",{className:"truncate",children:s?s.title:"Not in an area"}),(0,e.jsx)("span",{className:"font-normal normal-case tabular-nums tracking-normal",children:t}),s?.status==="archived"?(0,e.jsx)("span",{className:"font-normal normal-case tracking-normal",children:"· Archived"}):null]}),s?(0,e.jsxs)(Ie,{children:[(0,e.jsx)(ye,{asChild:!0,children:(0,e.jsx)(N,{size:"icon-xs",variant:"ghost","aria-label":`More for the ${s.title} area`,children:(0,e.jsx)(We,{"aria-hidden":"true"})})}),(0,e.jsx)(Ae,{align:"end",children:s.status==="archived"?(0,e.jsx)(X,{onSelect:n(()=>a.onRestore(s),"onSelect"),children:"Restore area"}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(X,{onSelect:n(()=>a.onAddHere(s.id),"onSelect"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"Add a responsibility here"]}),(0,e.jsx)(X,{onSelect:n(()=>a.onRename(s),"onSelect"),children:"Rename area"}),(0,e.jsx)(Xa,{}),(0,e.jsx)(X,{onSelect:n(()=>a.onArchive(s),"onSelect"),children:"Archive area…"})]})})]}):null]})}n(_r,"AreaHeading");function Ir({areas:s,actions:t}){const[a,r]=(0,m.useState)(!1);return s.length===0?null:(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)(N,{size:"sm",variant:"ghost",className:"w-fit text-muted-foreground","aria-expanded":a,onClick:n(()=>r(l=>!l),"onClick"),children:[(0,e.jsx)(_s,{"aria-hidden":"true",className:$("transition-transform",!a&&"-rotate-90")}),s.length===1?"1 more area in the company":`${s.length} more areas in the company`]}),a?(0,e.jsxs)("div",{className:"flex flex-col gap-1 pl-2",children:[(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Areas the company cares about where you own nothing yet."}),(0,e.jsx)("ul",{className:"flex flex-col",children:s.map(l=>(0,e.jsxs)("li",{className:"flex items-center justify-between gap-2 py-1",children:[(0,e.jsx)("span",{className:"min-w-0 truncate text-sm text-foreground",children:l.title}),(0,e.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,e.jsxs)(N,{size:"xs",variant:"ghost",onClick:n(()=>t.onAddHere(l.id),"onClick"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"Add a responsibility here"]}),(0,e.jsxs)(Ie,{children:[(0,e.jsx)(ye,{asChild:!0,children:(0,e.jsx)(N,{size:"icon-xs",variant:"ghost","aria-label":`More for the ${l.title} area`,children:(0,e.jsx)(We,{"aria-hidden":"true"})})}),(0,e.jsxs)(Ae,{align:"end",children:[(0,e.jsx)(X,{onSelect:n(()=>t.onRename(l),"onSelect"),children:"Rename area"}),(0,e.jsx)(X,{onSelect:n(()=>t.onArchive(l),"onSelect"),children:"Archive area…"})]})]})]})]},l.id))})]}):null]})}n(Ir,"OtherAreas");function Rr({text:s,onClick:t}){return(0,e.jsxs)(N,{size:"xs",variant:"outline",className:"shrink-0",onClick:t,"aria-label":`New task for an agent: ${s}`,children:[(0,e.jsx)(Qa,{"aria-hidden":"true"}),"New task for an agent"]})}n(Rr,"NewTaskButton");function Tr({companyId:s,responsibilities:t,agents:a,onNewTask:r}){const l=t.flatMap(i=>gt(i).map(u=>({responsibility:i,item:u})));return l.length===0?(0,e.jsxs)("section",{"aria-labelledby":"responsibilities-needs-you-heading",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)(wa,{"aria-hidden":"true",className:"size-4 shrink-0 text-(--status-task-icon-done)"}),(0,e.jsx)("h3",{id:"responsibilities-needs-you-heading",className:"sr-only",children:"Needs you"}),(0,e.jsx)("p",{children:"Nothing needs you right now. Everything you own is on track or quiet."})]}):(0,e.jsxs)("section",{"aria-labelledby":"responsibilities-needs-you-heading",className:"overflow-hidden rounded-lg border border-(--status-task-todo)/30 bg-(--status-task-todo)/10",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1 border-b border-(--status-task-todo)/30 px-5 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(ma,{"aria-hidden":"true",className:"size-4 shrink-0 text-(--status-task-icon-todo)"}),(0,e.jsx)("h3",{id:"responsibilities-needs-you-heading",className:"text-base font-semibold text-foreground",children:"Needs you"}),(0,e.jsxs)("span",{className:"text-sm tabular-nums text-muted-foreground",children:[l.length,(0,e.jsx)("span",{className:"sr-only",children:l.length===1?" item":" items"})]})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"What is holding your responsibilities back. Give any of it to an agent."})]}),(0,e.jsx)("ul",{className:"flex flex-col",children:l.map(({responsibility:i,item:u})=>{const{signal:o}=u,d=o?ct(o):null,x=o?o.refType==="responsibility"&&o.refId?P(o.refId):xt(o):P(i.id),{health:c}=i.rollup;return(0,e.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-b border-(--status-task-todo)/30 px-5 py-3 last:border-b-0",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[x?(0,e.jsx)(R,{to:x,className:"text-sm font-medium text-foreground underline-offset-4 hover:underline",children:u.text}):(0,e.jsx)("span",{className:"text-sm font-medium text-foreground",children:u.text}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"status-fill size-1.5 shrink-0 rounded-full",style:de(c),"aria-hidden":"true"}),(0,e.jsx)("span",{children:K[c]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,e.jsx)(R,{to:P(i.id),className:"truncate underline-offset-4 hover:underline",children:i.title})]})]}),d?(0,e.jsx)(ge,{companyId:s,item:d,agents:a,variant:"outline"}):(0,e.jsx)(Rr,{text:u.text,onClick:n(()=>r(i,u),"onClick")})]},`${i.id}:${o?`${o.kind}:${o.refId??""}`:"status"}:${u.text}`)})})]})}n(Tr,"NeedsYouSection");function $r({responsibilities:s,agentsById:t,summary:a}){const r=s.map(l=>({responsibility:l,signals:Js(l)})).filter(l=>l.signals.length>0);return(0,e.jsxs)("section",{"aria-labelledby":"responsibilities-running-heading",className:"flex flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{id:"responsibilities-running-heading",className:"text-base font-semibold text-foreground",children:"Running without you"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r.length>0?"What agents and routines are doing under your responsibilities.":"Nothing is running without you yet. Give a task, a routine or a project to an agent to start."})]}),a,r.length>0?(0,e.jsx)(F,{elevation:"low",className:"gap-0 py-1",children:(0,e.jsx)("ul",{className:"flex flex-col",children:r.map(({responsibility:l,signals:i})=>(0,e.jsxs)("li",{className:"flex flex-col gap-2 border-b border-border px-5 py-3 last:border-b-0",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)(R,{to:P(l.id),className:"text-sm font-medium text-foreground underline-offset-4 hover:underline",children:l.title}),(0,e.jsx)(vs,{agentIds:js(l.rollup),agentsById:t})]}),(0,e.jsx)(Fe,{signals:i,size:"xs"})]},l.id))})}):null]})}n($r,"RunningWithoutYouSection");var De=5;function Er({target:s,responsibilities:t,areas:a,onFiled:r}){const l=J(),i=(0,m.useMemo)(()=>Ne(a,t),[a,t]),u=H({mutationFn:n(o=>Y.link(o.id,s.body),"mutationFn"),onSuccess:n((o,d)=>{r(`Filed “${s.label}” under ${d.title}.`),l.invalidateQueries({queryKey:L.responsibilities.all})},"onSuccess"),onError:n(o=>r(`Couldn’t file “${s.label}”. ${z(o).body}`),"onError")});return(0,e.jsxs)(Ie,{children:[(0,e.jsx)(ye,{asChild:!0,children:(0,e.jsx)(N,{size:"xs",variant:"ghost",className:"text-muted-foreground",disabled:u.isPending,"aria-label":`File ${s.label} under a responsibility`,children:"File under…"})}),(0,e.jsx)(Ae,{align:"end",className:"max-h-(--sz-50vh) overflow-y-auto",children:i.map(o=>(0,e.jsxs)(Oa,{children:[(0,e.jsx)(Ga,{children:o.area?o.area.title:"No area"}),o.items.map(d=>(0,e.jsx)(X,{onSelect:n(()=>u.mutate(d),"onSelect"),children:d.title},d.id))]},o.area?.id??"__none__"))})]})}n(Er,"FileUnderMenu");function Me({title:s,count:t,items:a,note:r,render:l}){const[i,u]=(0,m.useState)(!1),o=i?a:a.slice(0,De),d=`loose-${s.toLowerCase()}-heading`;return(0,e.jsxs)("div",{className:"flex flex-col gap-1",role:"group","aria-labelledby":d,children:[(0,e.jsxs)("h3",{id:d,className:"text-sm font-medium text-muted-foreground",children:[s," ",(0,e.jsx)("span",{className:"tabular-nums",children:t})]}),(0,e.jsx)("ul",{className:"flex flex-col",children:o.map(l)}),a.length>De?(0,e.jsx)(N,{size:"xs",variant:"ghost",className:"w-fit text-muted-foreground","aria-expanded":i,onClick:n(()=>u(x=>!x),"onClick"),children:i?"Show fewer":`Show all ${a.length}`}):null,r&&(i||a.length<=De)?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:r}):null]})}n(Me,"LooseList");function Dr({companyId:s,loose:t,responsibilities:a,areas:r,agents:l,now:i}){const[u,o]=(0,m.useState)(null);if(t.projectCount+t.openTaskCount+t.routineCount===0)return null;const d=n(c=>a.length>0?(0,e.jsx)(Er,{target:c,responsibilities:a,areas:r,onFiled:o}):null,"fileUnder"),x=t.openTaskCount>t.tasks.length?`Showing the ${t.tasks.length} most recently updated of ${t.openTaskCount} open tasks.`:null;return(0,e.jsxs)("section",{"aria-labelledby":"loose-work-heading",className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{id:"loose-work-heading",className:"text-base font-semibold text-foreground",children:"Outside your responsibilities"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Work in the company that is not filed under a responsibility. Not everything needs to be: a daily standup or a one-off errand can live here."})]}),u?(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:u}):null,t.projectCount>0?(0,e.jsx)(Me,{title:"Projects",count:t.projectCount,items:t.projects,render:n(c=>{const h=dt(c.targetDate,i);return(0,e.jsxs)("li",{className:"flex items-center gap-1 pr-2",children:[(0,e.jsx)("div",{className:"min-w-0 flex-1",children:(0,e.jsx)(Ee,{className:"border-b-0",leading:(0,e.jsx)(pa,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),title:c.name,to:Da(c),meta:h?(0,e.jsxs)("span",{className:"text-xs tabular-nums text-muted-foreground",children:["Due ",h.label]}):null,trailing:(0,e.jsx)(ns,{status:c.status})})}),(0,e.jsx)(ge,{companyId:s,agents:l,size:"icon-xs",item:{kind:"project",id:c.id,label:c.name,currentAgentId:c.leadAgentId}}),d({label:c.name,body:{projectId:c.id}})]},c.id)},"render")}):null,t.openTaskCount>0?(0,e.jsx)(Me,{title:"Open tasks",count:t.openTaskCount,items:t.tasks,note:x,render:n(c=>(0,e.jsxs)("li",{className:"flex items-center gap-1 pr-2",children:[(0,e.jsx)("div",{className:"min-w-0 flex-1",children:(0,e.jsx)(Ee,{className:"border-b-0",leading:(0,e.jsx)(Ca,{...Sa(c)}),identifier:c.identifier??void 0,title:c.title,to:qe(c)})}),(0,e.jsx)(ge,{companyId:s,agents:l,size:"icon-xs",item:{kind:"task",id:c.id,label:c.title,currentAgentId:c.assigneeAgentId}}),d({label:c.title,body:{issueId:c.id}})]},c.id),"render")}):null,t.routineCount>0?(0,e.jsx)(Me,{title:"Routines",count:t.routineCount,items:t.routines,render:n(c=>(0,e.jsxs)("li",{className:"flex items-center gap-1 pr-2",children:[(0,e.jsx)("div",{className:"min-w-0 flex-1",children:(0,e.jsx)(Ee,{className:"border-b-0",leading:(0,e.jsx)(ve,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),title:c.title,to:ze(c.id),trailing:(0,e.jsx)(ns,{status:c.status})})}),(0,e.jsx)(ge,{companyId:s,agents:l,size:"icon-xs",item:{kind:"routine",id:c.id,label:c.title,currentAgentId:c.assigneeAgentId}}),d({label:c.title,body:{routineId:c.id}})]},c.id),"render")}):null]})}n(Dr,"LooseWorkSection");var Mr=(0,m.memo)(n(function({responsibility:t,agentsById:a,areas:r,now:l}){const{rollup:i}=t,u=t.status==="let_go",o=at(i),d=Pt(t.id);return(0,e.jsxs)("li",{"data-responsibility-id":t.id,className:$("flex flex-col gap-3 px-5 py-4 md:flex-row md:items-start md:gap-6",u&&"opacity-70"),children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(R,{to:P(t.id),className:"min-w-0 text-sm font-semibold text-foreground underline-offset-4 hover:underline",children:t.title}),(0,e.jsx)(bs,{health:i.health,overridden:i.healthOverridden}),u?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Let go"}):null]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i.statusSentence}),o.length>0?(0,e.jsx)(Fe,{signals:o,size:"xs",responsibilityHref:P,className:"pt-1"}):null,d.error?(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:["Couldn’t move it. ",z(d.error).body]}):null]}),(0,e.jsx)(st,{metric:i.metric,health:i.health,now:l,className:"md:w-48 md:shrink-0"}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 md:w-48 md:shrink-0 md:justify-end",children:[(0,e.jsx)(vs,{agentIds:js(i),agentsById:a}),(0,e.jsxs)(Ie,{children:[(0,e.jsx)(ye,{asChild:!0,children:(0,e.jsx)(N,{size:"icon-xs",variant:"ghost","aria-label":`More for ${t.title}`,children:(0,e.jsx)(We,{"aria-hidden":"true"})})}),(0,e.jsx)(Ae,{align:"end",children:(0,e.jsxs)(xa,{children:[(0,e.jsx)(ka,{disabled:d.isPending,children:"Move to area"}),(0,e.jsx)(Ya,{className:"max-h-(--sz-50vh) overflow-y-auto",children:(0,e.jsx)(Vt,{areas:r,value:t.areaId,onChange:n(x=>{x!==t.areaId&&d.mutate(x)},"onChange")})})]})})]})]})]})},"ResponsibilityRow"));function Lr({companyId:s,overview:t,agents:a,agentsById:r,now:l,includeLetGo:i,onToggleLetGo:u,keepEmptyAreas:o,onAddResponsibility:d,onNewTask:x,areaActions:c}){const[h,g]=(0,m.useState)(null),f=t.responsibilities,y=(0,m.useMemo)(()=>f.filter(_=>_.status==="active"),[f]),v=(0,m.useMemo)(()=>tt(f),[f]),w=(0,m.useMemo)(()=>h?v.filter(_=>_.rollup.health===h):v,[v,h]),p=(0,m.useMemo)(()=>Ne(t.areas,w,h?new Set:o),[t.areas,w,h,o]),S=(0,m.useMemo)(()=>new Set(p.map(_=>_.area?.id).filter(_=>!!_)),[p]),j=(0,m.useMemo)(()=>Zs(t.areas,f,S),[t.areas,f,S]),k=(0,m.useMemo)(()=>t.areas.filter(_=>_.status!=="archived"),[t.areas]),T=(0,e.jsx)(Dr,{companyId:s,loose:t.loose,responsibilities:y,areas:t.areas,agents:a,now:l});if(f.length===0&&t.proposed.length===0)return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(re,{companyId:s,onAdd:n(()=>d(null),"onAdd")}),T]});const I=f.some(_=>_.status==="let_go");return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Zt,{companyId:s,proposed:t.proposed,areas:t.areas,ownerUserId:t.ownerUserId}),f.length>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{"aria-labelledby":"responsibilities-owned-heading",className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{id:"responsibilities-owned-heading",className:"text-base font-semibold text-foreground",children:"What you own"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Is each one meeting its bar?"})]}),(0,e.jsx)(N,{size:"sm",variant:"ghost",onClick:u,"aria-pressed":i,children:i?"Hide let-go responsibilities":"Show let-go responsibilities"})]}),(0,e.jsx)(Ps,{counts:t.totals.byHealth,selected:h,onSelect:g}),(0,e.jsx)(Tr,{companyId:s,responsibilities:y,agents:a,onNewTask:x}),h?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsxs)("span",{children:["Showing only ",K[h].toLowerCase(),"."]}),(0,e.jsx)(N,{size:"xs",variant:"ghost",onClick:n(()=>g(null),"onClick"),children:"Show all"})]}):null,p.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:h?`None of your responsibilities are ${K[h].toLowerCase()}.`:"Nothing to show."}):p.map(_=>(0,e.jsxs)("div",{className:"flex flex-col gap-2","data-area-group":_.area?.id??"none",children:[(0,e.jsx)(_r,{area:_.area,count:_.items.length,actions:c}),(0,e.jsx)(F,{elevation:"low",className:"gap-0 py-0",children:_.items.length>0?(0,e.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:_.items.map(D=>(0,e.jsx)(Mr,{responsibility:D,agentsById:r,areas:k,now:l},D.id))}):(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-5 py-4",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing you own is filed here yet."}),_.area?(0,e.jsxs)(N,{size:"sm",variant:"ghost",onClick:n(()=>d(_.area.id),"onClick"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"Add a responsibility here"]}):null]})})]},_.area?.id??"__no_area__")),i&&!I?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"You have not let go of any responsibilities."}):null,h?null:(0,e.jsx)(Ir,{areas:j,actions:c})]}),(0,e.jsx)($r,{responsibilities:y,agentsById:r,summary:(0,e.jsx)(Qn,{agentTasks:t.totals.agentTasks,userTasks:t.totals.userTasks,openTasks:t.totals.openTasks})})]}):null,T]})}n(Lr,"ResponsibilitiesHomeLayout");var Or=[];function Pr({responsibilities:s,agentName:t}){const a=(0,m.useMemo)(()=>lt(s),[s]);if(!a)return null;const r=a.agentId?t(a.agentId):void 0;return(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[r?`Drafted by ${r} during onboarding.`:"Drafted during onboarding.",a.confirmedAt?` Confirmed by you on ${Ia(a.confirmedAt)}.`:null]})}n(Pr,"ProvenanceLine");function Gr(){const{selectedCompanyId:s}=Ss(),t=ua();return t.error?(0,e.jsx)(we,{error:t.error,action:"load your dashboard",onRetry:n(()=>{t.retry()},"onRetry")}):!s||!t.userId?(0,e.jsx)(Rs,{variant:"dashboard"}):(0,e.jsx)(zr,{selectedCompanyId:s,ownerUserId:t.userId},JSON.stringify([s,t.userId]))}n(Gr,"Responsibilities");function zr({selectedCompanyId:s,ownerUserId:t}){const{setBreadcrumbs:a}=Pa(),[r,l]=(0,m.useState)(!1),[i,u]=(0,m.useState)(null),[o,d]=(0,m.useState)(!1),[x,c]=(0,m.useState)(()=>new Set),[h,g]=(0,m.useState)(null),[f,y]=(0,m.useState)(null),[v,w]=(0,m.useState)(null),p=Bt(),{view:S,visiting:j,visit:k,leave:T}=ta(Lt,Rt),[I,_]=(0,m.useState)(""),[D,C]=(0,m.useState)("all"),E=(0,m.useCallback)(()=>C("all"),[]),{agents:b,byId:O,query:G}=Ht(s),V=Ke(G),ce=(0,m.useMemo)(()=>new Date,[]);Za(),(0,m.useEffect)(()=>{a([{label:"Dashboard"}])},[a]);const B=Q({queryKey:L.responsibilities.overview(s??"__none__",{includeLetGo:r,ownerUserId:t}),queryFn:n(()=>Y.overview(s,{includeLetGo:r,ownerUserId:t}),"queryFn"),enabled:!!s}),M=B.data,Xe=(0,m.useMemo)(()=>M?.areas.filter(A=>A.status!=="archived")??Or,[M?.areas]),Hs=(0,m.useMemo)(()=>{const A=new Map;for(const U of M?.responsibilities??[])U.areaId&&A.set(U.areaId,(A.get(U.areaId)??0)+1);return A},[M?.responsibilities]),ee=(0,m.useMemo)(()=>M?Bs(M.areas,M.responsibilities,x):null,[M,x]),ue=(0,m.useMemo)(()=>ee?Us(ee,{search:I,routineFilter:D}):null,[ee,I,D]),Te=(0,m.useMemo)(()=>{if(!M||!ee||!ue)return null;const A=fs(ee);return A.areas===0&&A.responsibilities===0&&M.proposed.length===0?null:fs(ue)},[M,ee,ue]),le=(0,m.useCallback)(A=>u({areaId:A}),[]),Vs=(0,m.useCallback)(A=>O.get(A)?.name,[O]),Ws=(0,m.useCallback)((A,U)=>{const W=ft(U.text,A.rollup.overdueProjects);g({responsibility:{id:A.id,title:A.title},defaultTitle:W.title,projectId:W.projectId})},[]),Ze=p.mutate,Ks=(0,m.useMemo)(()=>({onAddHere:n(A=>le(A),"onAddHere"),onRename:y,onArchive:w,onRestore:n(A=>Ze(A.id),"onRestore")}),[le,Ze]);if(!s)return null;const es=M!==void 0&&M.responsibilities.length===0&&M.proposed.length===0;return(0,e.jsxs)("div",{className:$("mx-auto flex min-h-full w-full flex-col gap-8",S==="automation"?"max-w-none":S==="board"?"max-w-7xl":"max-w-5xl"),children:[(0,e.jsxs)("header",{className:$("flex flex-wrap justify-between gap-4",S==="outline_v2"?"items-center":"items-start",S==="outline_v2"&&!Te&&"hidden"),children:[S==="outline_v2"?Te?(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2",children:[(0,e.jsxs)("div",{className:"design-page-toolbar gap-2",children:[(0,e.jsx)(oa,{query:I,onQueryChange:_,label:"Search your dashboard",placeholder:"Search",inputType:"search"}),(0,e.jsx)(Ha,{activeCount:D==="all"?0:1,onClear:E,label:"Filter responsibilities",contentLabel:"Filter responsibilities",align:"start",contentClassName:"w-56",triggerDataAttr:"data-outline-v2-filter",children:(0,e.jsx)("div",{className:"task-filters-grid",children:(0,e.jsxs)(Wa,{title:"Routines",optionsKey:"routines",children:[(0,e.jsx)(os,{label:"Has routines",checked:D==="has_routines",onToggle:n(()=>C(A=>A==="has_routines"?"all":"has_routines"),"onToggle")}),(0,e.jsx)(os,{label:"No routines",checked:D==="no_routines",onToggle:n(()=>C(A=>A==="no_routines"?"all":"no_routines"),"onToggle")})]})})})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-dashboard-counts":"",children:dr(Te)})]}):null:(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Dashboard"}),S==="full"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"What you own, whether each one is meeting its bar, and the work underneath."}),M?(0,e.jsx)(Pr,{responsibilities:M.responsibilities,agentName:Vs}):null]}):null]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[j?(0,e.jsx)(N,{variant:"ghost",onClick:T,"data-dashboard-back":"",children:"Back"}):null,S==="outline_v2"?(0,e.jsxs)(N,{onClick:n(()=>d(!0),"onClick"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"New area"]}):null,S==="full"||S==="board"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(N,{variant:"outline",onClick:n(()=>d(!0),"onClick"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"Add area"]}),es?null:(0,e.jsxs)(N,{onClick:n(()=>le(null),"onClick"),children:[(0,e.jsx)(q,{"aria-hidden":"true"}),"Add responsibility"]})]}):null]})]}),p.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t restore the area. ",z(p.error).body]}):null,(0,e.jsx)(He,{query:B,size:"page",action:"load your responsibilities",loading:(0,e.jsx)(Rs,{variant:"dashboard"}),children:n(A=>{const U={companyId:s,overview:A,agents:b,agentsById:O,now:ce,includeLetGo:r,onToggleLetGo:n(()=>l(Gs=>!Gs),"onToggleLetGo"),keepEmptyAreas:x,onAddResponsibility:le,onNewTask:Ws,areaActions:Ks};if(S==="full")return(0,e.jsx)(Lr,{...U});const W={...U,onAddArea:n(()=>d(!0),"onAddArea"),onReviewProposals:n(()=>k("full"),"onReviewProposals")};return S==="outline"?(0,e.jsx)(bn,{...W}):S==="outline_v2"?(0,e.jsx)(Ar,{...W,search:I,routineFilter:D,visibleGroups:ue??void 0,onClearFilter:E}):S==="board"?(0,e.jsx)(er,{...W}):S==="automation"?(0,e.jsx)(Wn,{...W}):S==="agent_status"?(0,e.jsx)(In,{...W}):(0,e.jsx)(lr,{...W})},"children")}),(0,e.jsx)("div",{className:"pointer-events-none sticky bottom-(--tc-composer-bottom) z-20 mt-auto pt-2 md:bottom-0","data-dashboard-chat-dock":"",children:(0,e.jsxs)("div",{className:"pointer-events-auto",children:[V.kind==="error"?(0,e.jsx)("div",{className:"mb-2 rounded-lg border border-border bg-background px-4 py-3","data-dashboard-chat":"error",children:(0,e.jsx)(we,{error:V.error,size:"inline",action:"load your agents",onRetry:V.retry,retrying:V.isFetching})}):null,(0,e.jsx)(nr,{companyId:s,agents:b,loaded:G.data!==void 0})]})}),S==="outline_v2"?(0,e.jsx)(Cr,{open:i!==null,onOpenChange:n(A=>{A||u(null)},"onOpenChange"),companyId:s,areas:Xe,defaultAreaId:i?.areaId??null}):(0,e.jsx)(sn,{open:i!==null,onOpenChange:n(A=>{A||u(null)},"onOpenChange"),companyId:s,areas:Xe,defaultAreaId:i?.areaId??null}),(0,e.jsx)(Ft,{open:o,onOpenChange:d,companyId:s,onCreated:n(A=>{c(U=>new Set([...U,A.id])),es&&le(A.id)},"onCreated")}),h?(0,e.jsx)(Jt,{open:!0,onOpenChange:n(A=>{A||g(null)},"onOpenChange"),companyId:s,responsibility:h.responsibility,defaultTitle:h.defaultTitle,projectId:h.projectId}):null,(0,e.jsx)(na,{area:f,onOpenChange:n(A=>{A||y(null)},"onOpenChange")}),(0,e.jsx)(Qt,{area:v,ownedHere:v?Hs.get(v.id)??0:0,onOpenChange:n(A=>{A||w(null)},"onOpenChange")})]})}n(zr,"OwnerDashboard");export{Gr as Responsibilities};
@@ -0,0 +1 @@
1
+ var is=Object.defineProperty;var a=(t,s)=>is(t,"name",{value:s,configurable:!0});import{a as mt}from"./rolldown-runtime-DhZMWcEn.js";import{Bi as os,Bn as me,Dr as ds,En as _,Fn as ht,Fr as cs,In as us,Ir as Xe,It as xs,Jn as ms,Kt as hs,Li as gs,Ln as $e,Mn as fs,Nn as ps,Nr as js,Pn as gt,Pt as vs,Ri as bs,Rn as Ns,Sr as ks,Un as Ze,Vi as ws,Vn as Me,dr as ys,er as ft,et as Ae,fr as pt,gr as Ss,jn as Cs,jt as As,kr as jt,nr as Je,pr as vt,qt as bt,rr as Ts,ur as Rs,wn as Nt,wr as Is,xr as Ds,yr as kt,zi as Es,zn as et,zt as Ps}from"./issue-detail-4PCbYpdv.js";import{A as Fs,D as $s,E as tt,G as Ms,H as _s,K as Ls,L as zs,U as _e,V as fe,W as qs,X as Os,Z as Us,_ as Bs,a as Hs,at as Ks,b as Vs,d as Ws,dt as Qs,et as Ys,ft as Gs,g as Te,h as Xs,i as Zs,lt as Js,n as ea,o as ta,p as sa,pt as aa,q as na,r as ra,s as st,t as la,ut as ia,y as oa}from"./usePageView-BiX5i8ck.js";import{b as at}from"./collections-BxrcELwt.js";import{$A as da,Bb as ca,Cm as ua,Cv as wt,Cx as xa,Db as yt,ET as ma,E_ as q,Eb as St,Ek as Ct,Ev as U,Ex as ha,FE as ga,GS as R,Gb as M,Gw as fa,LS as pa,ME as V,NE as b,Ob as At,QE as Le,Sb as Tt,Sm as ja,Tb as Rt,Tv as It,Tx as va,UT as ba,Um as Dt,Up as Et,VC as Pt,Vp as Ft,Wm as Na,XC as Re,YS as ka,Yb as $t,Yw as wa,__ as Mt,_v as P,_w as ee,aC as ya,aE as Sa,ab as ae,bE as L,bm as Ca,bv as J,cb as Aa,cs as Ta,cw as te,dy as _t,eD as Ie,fy as ze,hE as E,hv as B,iC as Lt,iS as Ra,ib as Ia,jT as zt,jb as qt,kb as Ot,lS as Da,ly as qe,my as Oe,nT as pe,nj as Ea,pE as Pa,pb as Fa,pv as H,qC as ne,sw as $a,sy as Ue,uE as Ma,ub as je,uy as Be,vv as he,wC as nt,wb as Ut,wm as _a,wv as Bt,wx as La,xE as z,x_ as za,xv as ge,ym as qa,yv as Ht,zE as $}from"./index-Bt31d8ga.js";import{n as Oa}from"./NewProjectDialog-DXqjTYFK.js";import{t as Ua}from"./SkillCardIcon-CXHUCMej.js";import{t as Ne}from"./EntityRow-gpsOgEtu.js";import{r as He}from"./company-skill-routes-D5LJ1l8M.js";var g=mt(Ea(),1),e=mt(da(),1),Ba={behind:"behind",at_risk:"at_risk",on_track:"on_track",unknown:"not_measured"};function Ha(t,s=!0){return z({queryKey:R.responsibilities.statusReport(t),queryFn:a(()=>_.statusReport(t),"queryFn"),enabled:s,staleTime:3e4})}a(Ha,"useResponsibilityStatusReport");function Ka(t,s,n,r){return`Written by ${t.agentId?s.get(t.agentId)?.name??"an agent":t.userId?t.userId===r?"the owner":"a teammate":"an agent no longer here"} · ${pt(t.writtenAt,n)}`}a(Ka,"describeStatusAuthor");function Kt({responsibility:t,agentsById:s,now:n,editable:r,className:l}){const i=V(),c=Ha(t.id,t.status==="active"),d=L({mutationFn:a(()=>_.requestStatusUpdate(t.id),"mutationFn"),onSuccess:a(k=>i.setQueryData(R.responsibilities.statusReport(t.id),k),"onSuccess")}),{rollup:h}=t,m=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{children:(0,e.jsx)(me,{health:h.health,overridden:h.healthOverridden})}),(0,e.jsx)("p",{className:"text-sm text-foreground","data-status-sentence":"",children:h.statusSentence})]}),x=c.data?.current??null;if(!x)return(0,e.jsx)("div",{className:$("flex flex-col gap-1.5",l),children:m});const f=c.data?.reporterAgentId??x.agentId,j=f?s.get(f)?.name??"the agent":null,w=c.data?.updateRequested??!1;return(0,e.jsxs)("div",{className:$("flex flex-col gap-3",l),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-agent-status":"",children:[(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,e.jsx)(me,{health:Ba[x.status],label:aa[x.status]})}),(0,e.jsx)("p",{className:"text-sm text-foreground","data-agent-status-message":"",children:x.message}),(0,e.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{children:Ka(x,s,n,t.ownerUserId)}),x.outOfDate?(0,e.jsx)(Me,{label:"Out of date"}):null]}),r&&j?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxs)(b,{type:"button",size:"xs",variant:"ghost",className:"w-fit text-muted-foreground",disabled:w||d.isPending,onClick:a(()=>d.mutate(),"onClick"),"data-ask-for-update":"",children:[d.isPending?(0,e.jsx)(ee,{"aria-hidden":"true",className:"animate-spin"}):(0,e.jsx)(te,{"aria-hidden":"true"}),w?`Asked ${j} for an update`:`Ask ${j} for an update`]}),d.error?(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:["Couldn’t ask. ",E(d.error).body]}):null]}):null]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border pt-3","data-derived-status":"",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"From the number"}),m]})]})}a(Kt,"ResponsibilityStatusBlock");function Ke(t){const s=V();return L({mutationFn:a(n=>_.update(t,n),"mutationFn"),onSuccess:a(n=>{s.setQueriesData({queryKey:R.responsibilities.detail(t)},r=>r&&{...r,...n}),s.invalidateQueries({queryKey:R.responsibilities.all})},"onSuccess")})}a(Ke,"useUpdateResponsibility");function Va(t,s){const n=z({queryKey:R.auth.session,queryFn:a(()=>ka.getSession(),"queryFn")}),r=z({queryKey:[...R.responsibilities.activity(t.id),t.metricUpdatedAt?String(t.metricUpdatedAt):null],queryFn:a(()=>Ra.list(t.companyId,{entityType:"responsibility",entityId:t.id,limit:50}),"queryFn"),enabled:!!t.metricUpdatedAt,staleTime:6e4}),l=Ds(r.data??[],t.metricUpdatedAt);return l?l.actorType==="agent"?s.get(l.actorId)?.name??"an agent":l.actorType==="user"?n.data?.user?.id&&l.actorId===n.data.user.id?"you":l.actorId===t.ownerUserId?"the owner":"a teammate":null:null}a(Va,"useReadingAuthor");function Vt({responsibility:t}){const s=(0,g.useId)(),n=Ke(t.id),[r,l]=(0,g.useState)(""),[i,c]=(0,g.useState)(null),d=ds(r),h=a((j,w)=>{n.isPending||n.mutate({metricCurrent:j},{onSuccess:a(()=>{w?.(),c("Recorded.")},"onSuccess")})},"record"),m=n.error?(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:["Couldn’t record it. ",E(n.error).body]}):null;if(t.metricKind==="yes_no")return(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",role:"group","aria-label":"Record a new reading",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Is it true today?"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(b,{type:"button",size:"sm",variant:"outline",disabled:n.isPending,onClick:a(()=>h(!0),"onClick"),children:"Yes"}),(0,e.jsx)(b,{type:"button",size:"sm",variant:"outline",disabled:n.isPending,onClick:a(()=>h(!1),"onClick"),children:"No"})]}),i?(0,e.jsx)("p",{role:"status",className:"text-xs text-muted-foreground",children:i}):null,m]});const x=a(j=>{j.preventDefault(),typeof d=="number"&&h(d,()=>l(""))},"submit"),f=t.metricKind==="percentage"?"%":t.metricUnit?.trim();return(0,e.jsxs)("form",{className:"flex flex-col gap-1.5",onSubmit:x,"aria-label":"Record a new reading",children:[(0,e.jsxs)("label",{htmlFor:s,className:"text-xs text-muted-foreground",children:["New reading",f?` (${f})`:""]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(Mt,{id:s,inputMode:"decimal",value:r,placeholder:t.metricCurrent===null?"e.g. 9":String(t.metricCurrent),className:"max-w-40","aria-invalid":d==="invalid"||void 0,onChange:a(j=>{l(j.target.value),c(null)},"onChange")}),(0,e.jsx)(b,{type:"submit",size:"sm",variant:"outline",disabled:typeof d!="number"||n.isPending,children:n.isPending?"Saving…":"Record"})]}),d==="invalid"?(0,e.jsx)("p",{className:"text-xs text-destructive",children:"Enter a number"}):null,i?(0,e.jsx)("p",{role:"status",className:"text-xs text-muted-foreground",children:i}):null,m]})}a(Vt,"RecordReading");function Wt({responsibility:t,open:s,onOpenChange:n}){const r=Ke(t.id),[l,i]=(0,g.useState)(()=>Je(t)),[c,d]=(0,g.useState)(!1),h=r.reset;(0,g.useEffect)(()=>{s&&(i(Je(t)),d(!1),h())},[s,h]);const m=cs(l),x=new Set([...c&&!m.ok?m.missing:[],...Is(r.error)]),f=new Set(c&&!m.ok?m.invalid:[]),j=c&&!m.ok?m.problems:void 0,w=a(k=>{k.preventDefault(),d(!0),!(!m.ok||r.isPending)&&r.mutate(Ts(m.value),{onSuccess:a(()=>n(!1),"onSuccess")})},"submit");return(0,e.jsx)(Ue,{open:s,onOpenChange:n,children:(0,e.jsx)(qe,{className:"sm:max-w-xl",children:(0,e.jsxs)("form",{className:"flex flex-col gap-5",onSubmit:w,noValidate:!0,children:[(0,e.jsxs)(ze,{children:[(0,e.jsx)(Oe,{children:t.standard?.trim()?"Edit the bar":"Set the bar"}),(0,e.jsxs)(Be,{children:["How is success measured for ",t.title,"? The status follows from the reading, by the kind of measure you choose."]})]}),(0,e.jsx)(Gs,{draft:l,onChange:i,missing:x,invalid:f,problems:j}),r.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t save the bar. ",E(r.error).body]}):null,(0,e.jsxs)(_t,{className:"items-center sm:justify-between",children:[(0,e.jsx)(b,{type:"button",variant:"ghost",onClick:a(()=>n(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(b,{type:"submit",disabled:r.isPending,children:r.isPending?"Saving…":"Save the bar"})]})]})})})}a(Wt,"EditBarDialog");function Ve(t,s){const n=V(),r=$t(),l=z({queryKey:R.responsibilities.barConversation(t.id),queryFn:a(()=>Xe.conversation(t.id),"queryFn"),enabled:s}),i=L({mutationFn:a(()=>Xe.start(t.id),"mutationFn"),onSuccess:a(m=>{n.setQueryData(R.responsibilities.barConversation(t.id),m),m.conversation&&r(`/issues/${m.conversation.identifier??m.conversation.issueId}`)},"onSuccess")}),c=je(l),d=l.data??null,h=d?.state==="discussing"||d?.state==="proposal_waiting";return{state:d,open:h,canTalk:!!d&&(h||d.defaultAgentId!==null),start:i,loadError:s&&c.kind==="error"?c.error:null,retry:c.retry,retrying:c.isFetching}}a(Ve,"useBarConversation");function Wa({responsibility:t,agentsById:s}){const n=t.status==="active"||t.status==="proposed",r=Ve(t,n);return!n||!r.state||!r.state.proposal&&r.state.state!=="discussing"?null:(0,e.jsx)(Qt,{state:r.state,agentsById:s})}a(Wa,"BarConversationStatus");function Qt({state:t,agentsById:s}){if(t.proposal)return(0,e.jsx)(Cs,{interaction:t.proposal,showConversationLink:!0,showResponsibilityLink:!1});if(t.state!=="discussing"||!t.conversation)return null;const n=t.conversation.agentId?s.get(t.conversation.agentId)?.name:null;return(0,e.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 text-sm text-muted-foreground","data-testid":"bar-conversation-open",children:[(0,e.jsx)(te,{"aria-hidden":!0,className:"h-4 w-4 shrink-0"}),(0,e.jsxs)("span",{children:["You are talking the bar through with ",n??"an agent","."]}),(0,e.jsx)(M,{to:`/issues/${t.conversation.identifier??t.conversation.issueId}`,className:"font-medium text-foreground underline-offset-4 hover:underline",children:"Open the conversation"})]})}a(Qt,"BarConversationNotice");function Qa({responsibility:t}){const s=Ke(t.id),n=t.healthOverride??"automatic",{rollup:r}=t;return(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[r.healthOverridden?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Set by hand.",r.computedHealth!==r.health?` From the number alone it is ${ms[r.computedHealth].toLowerCase()}.`:""]}),(0,e.jsx)(Ae,{value:t.healthNote??"",onSave:a(l=>s.mutateAsync({healthNote:l.trim()||null}),"onSave"),as:"p",className:"text-sm text-foreground",placeholder:"Why you set it (optional)",nullable:!0})]}):null,(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsxs)(b,{size:"xs",variant:"ghost",className:"w-fit text-muted-foreground",disabled:s.isPending,children:[r.healthOverridden?"Change or clear":"Set the status by hand",(0,e.jsx)(zt,{"aria-hidden":"true"})]})}),(0,e.jsxs)(B,{align:"start",children:[(0,e.jsx)(he,{children:"Status"}),(0,e.jsxs)(Ht,{value:n,onValueChange:a(l=>s.mutate({healthOverride:l==="automatic"?null:l}),"onValueChange"),children:[(0,e.jsx)(J,{value:"automatic",children:"From the number"}),(0,e.jsx)(J,{value:"behind",children:"Behind"}),(0,e.jsx)(J,{value:"at_risk",children:"At risk"}),(0,e.jsx)(J,{value:"on_track",children:"On track"})]})]})]}),s.error?(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:["Couldn’t change the status. ",E(s.error).body]}):null]})}a(Qa,"StatusOverride");function Ya({responsibility:t,agentsById:s,now:n,editable:r}){const l=(0,g.useId)(),[i,c]=(0,g.useState)(!1),d=Ve(t,r),h=!!t.standard?.trim(),{rollup:m}=t,x=Va(t,s),f=m.metric?.updatedAt??null;return(0,e.jsxs)(q,{id:"responsibility-bar",elevation:"low",className:"gap-5 px-5 py-5","aria-labelledby":l,children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,e.jsx)("h2",{id:l,className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"The bar"}),(0,e.jsx)("p",{className:"text-base text-foreground",children:t.standard?.trim()||(0,e.jsx)("span",{className:"text-muted-foreground",children:"No bar yet. How is success measured?"})})]}),r?(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:d.canTalk?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(b,{size:"sm",variant:"ghost",onClick:a(()=>c(!0),"onClick"),children:[(0,e.jsx)(Re,{"aria-hidden":"true"}),"Edit by hand"]}),(0,e.jsxs)(b,{size:"sm",variant:h?"outline":"default","data-bar-edit-primary":"",disabled:d.start.isPending,onClick:a(()=>d.start.mutate(),"onClick"),children:[d.start.isPending?(0,e.jsx)(ee,{"aria-hidden":"true",className:"animate-spin"}):(0,e.jsx)(te,{"aria-hidden":"true"}),d.open?"Continue the conversation":h?"Edit the bar":"Set the bar"]})]}):(0,e.jsxs)(b,{size:"sm",variant:"ghost","data-bar-edit-primary":"",onClick:a(()=>c(!0),"onClick"),children:[(0,e.jsx)(Re,{"aria-hidden":"true"}),h?"Edit the bar":"Set the bar"]})}):null]}),d.start.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t start the conversation. ",E(d.start.error).body," You can still edit the bar by hand."]}):null,d.loadError?(0,e.jsx)(ae,{error:d.loadError,size:"inline",action:"load the bar conversation",onRetry:d.retry,retrying:d.retrying}):null,r&&d.state?(0,e.jsx)(Qt,{state:d.state,agentsById:s}):null,(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-bar-status":"",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Status"}),(0,e.jsx)(Kt,{responsibility:t,agentsById:s,now:n,editable:r})]}),r?(0,e.jsx)(Qa,{responsibility:t}):null]}),(0,e.jsx)("div",{className:"border-t border-border pt-5","data-bar-metrics":"",children:(0,e.jsx)(ht,{responsibilityId:t.id,primary:m.metric,now:n,agentsById:s,layout:"grid",editable:r,fallback:(0,e.jsx)($e,{metric:m.metric,health:m.health,now:n,size:"hero",className:"max-w-sm"})})}),f||m.metric?(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:f?`Updated ${pt(f,n)}${x?` by ${x}`:""}.`:"No reading yet. The agents working on this keep the number current; you can record one too."}),r&&m.metric?(0,e.jsx)(Vt,{responsibility:t}):null]}):null,r?(0,e.jsx)(Wt,{responsibility:t,open:i,onOpenChange:c}):null]})}a(Ya,"ResponsibilityBarCard");var Ga={project:3,task:4,routine:3},Xa={project:"Projects",task:"Tasks",routine:"Routines"},Za={project:"No open projects.",task:"No open tasks.",routine:"No routines."},Ja={holding:"Holding the number back: ",moving:"Moving the number: ",neutral:""},De={holding:"text-(--status-task-icon-blocked)",moving:"text-(--status-task-icon-done)",neutral:"text-muted-foreground"};function Ee({bearing:t}){return t==="holding"?(0,e.jsx)(ma,{"aria-hidden":"true",className:"size-3.5 shrink-0"}):t==="moving"?(0,e.jsx)(ba,{"aria-hidden":"true",className:"size-3.5 shrink-0"}):null}a(Ee,"BearingIcon");function en({entry:t,automate:s}){const{item:n,bearing:r,reason:l}=t,i=s?.onByHand;return(0,e.jsxs)("li",{"data-work-kind":n.kind,"data-work-id":n.id,"data-bearing":r,"data-finished":t.finished?"true":void 0,className:i?"relative":void 0,children:[(0,e.jsxs)(M,{to:n.href,className:$("flex min-w-0 items-start gap-3 px-4 py-2 text-sm transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",i&&"pr-18"),children:[(0,e.jsx)("span",{className:"mt-0.5",children:(0,e.jsx)(na,{item:n,showLabel:!1})}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,e.jsxs)("span",{className:"flex min-w-0 items-baseline gap-2",children:[n.kind==="task"&&n.task.identifier?(0,e.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:n.task.identifier}):null,(0,e.jsx)("span",{className:$("line-clamp-1 text-foreground",t.finished&&"text-muted-foreground"),title:n.title,children:n.title})]}),(0,e.jsxs)("span",{className:$("flex min-w-0 items-center gap-1 text-xs",De[r]),"data-bearing-reason":"",children:[(0,e.jsx)(Ee,{bearing:r}),(0,e.jsxs)("span",{className:"line-clamp-1",title:l,children:[(0,e.jsx)("span",{className:"sr-only",children:Ja[r]}),l]})]})]})]}),s?(0,e.jsxs)("span",{className:"absolute right-3 top-2 flex items-center gap-0.5",children:[(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground",disabled:s.busy,"aria-label":`${s.label}: “${n.title}”`,title:s.label,onClick:s.onTalk,"data-automate-with-agent":"",children:(0,e.jsx)($a,{"aria-hidden":"true"})}),(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":`Set up “${n.title}” by hand`,title:"Set it up by hand",onClick:s.onByHand,"data-make-routine":"",children:(0,e.jsx)(ya,{"aria-hidden":"true"})})]}):null]})}a(en,"BearingRow");function ke({kind:t,items:s,total:n,automateFor:r}){const{shown:l}=Ys(s,Ga[t]),i=Math.max(0,n-l.length),c=`one-screen-${t}-heading`;return(0,e.jsx)("section",{"aria-labelledby":c,"data-work-list":t,children:(0,e.jsxs)(q,{elevation:"low",className:"gap-0 overflow-hidden py-0",children:[(0,e.jsxs)("h2",{id:c,className:"flex items-baseline gap-2 border-b border-border px-4 py-2 text-sm font-semibold text-foreground",children:[Xa[t]," ",(0,e.jsx)("span",{className:"text-xs font-normal tabular-nums text-muted-foreground",children:n})]}),l.length>0?(0,e.jsx)("ul",{className:"flex flex-col",children:l.map(d=>(0,e.jsx)(en,{entry:d,automate:r?.(d)},d.item.id))}):(0,e.jsx)("p",{className:"px-4 py-2 text-sm text-muted-foreground",children:Za[t]}),i>0?(0,e.jsxs)("p",{className:"border-t border-border px-4 py-1.5 text-xs text-muted-foreground",children:["and ",i," more"]}):null]})})}a(ke,"CappedList");function tn(){return(0,e.jsxs)("p",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground","data-bearing-key":"",children:[(0,e.jsxs)("span",{className:$("flex items-center gap-1",De.holding),children:[(0,e.jsx)(Ee,{bearing:"holding"}),"Holding the number back"]}),(0,e.jsxs)("span",{className:$("flex items-center gap-1",De.moving),children:[(0,e.jsx)(Ee,{bearing:"moving"}),"Moving it"]})]})}a(tn,"BearingKey");function sn({responsibility:t,companyId:s,agents:n,agentsById:r,now:l,notices:i,actions:c,onReviewProposal:d,onEditBar:h}){const{rollup:m}=t,x=z({queryKey:R.responsibilities.automation(s,t.ownerUserId),queryFn:a(()=>_.automation(s,{ownerUserId:t.ownerUserId}),"queryFn"),enabled:!!s&&t.status==="active"}).data?.responsibilities.find(v=>v.responsibilityId===t.id)??null,[f,j]=(0,g.useState)(null),w=(0,g.useCallback)(v=>r.get(v)?.name,[r]),k=Vs(),p=k.open,C=(0,g.useCallback)(v=>{if(v.item.kind!=="task"||!x?.manualTaskIds.includes(v.item.id))return;const{task:T}=v.item,N=x.candidates.find(ve=>ve.issueId===T.id),W=N?.responsibleAgentId??T.assigneeAgentId??null;return{label:Fs({conversation:N?.conversation??null,responsibleAgentId:W},w),busy:k.isPending,onTalk:a(()=>p({issueId:T.id,agentId:W,responsibilityId:t.id,conversation:N?.conversation??null}),"onTalk"),onByHand:a(()=>j({issueId:T.id,identifier:T.identifier,title:N?.pendingOffer?.title??T.title,assigneeAgentId:N?.pendingOffer?.agentId??W,suggestedCadence:N?.suggestedCadence??null,cadenceSource:N?.cadenceSource}),"onByHand")}},[x,w,k.isPending,p,t.id]),y=(0,g.useMemo)(()=>{const v=Qs(t,l,w);return{project:v.filter(T=>T.item.kind==="project"),task:v.filter(T=>T.item.kind==="task"),routine:v.filter(T=>T.item.kind==="routine")}},[t,l,w]),A=oa(t.id),F=t.standard?.trim(),D=y.task.filter(v=>!v.finished).length,u=y.task.length-D,S=[...y.project,...y.task,...y.routine].some(v=>v.bearing!=="neutral"),I=h&&t.status!=="dismissed";return(0,e.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-5","data-responsibility-view":"one_screen",children:[(0,e.jsx)(_e,{responsibility:t,actions:(0,e.jsx)(_s,{status:t.status,actions:c}),children:i}),t.status==="proposed"?(0,e.jsx)(fe,{count:1,subject:"this",onReview:d}):null,(0,e.jsx)(Wa,{responsibility:t,agentsById:r}),(0,e.jsxs)("div",{className:"grid gap-5 lg:grid-cols-5",children:[(0,e.jsxs)(q,{id:"responsibility-bar-summary",elevation:"low",className:"h-fit gap-5 px-5 py-5 lg:col-span-2","aria-labelledby":"one-screen-bar-heading",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h2",{id:"one-screen-bar-heading",className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"The bar"}),I?(0,e.jsxs)(b,{size:"xs",variant:"ghost",onClick:h,children:[(0,e.jsx)(Re,{"aria-hidden":"true"}),"Edit the bar"]}):null]}),(0,e.jsx)("p",{className:"text-sm text-foreground",children:F||(0,e.jsx)("span",{className:"text-muted-foreground",children:"No bar yet."})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(Kt,{responsibility:t,agentsById:r,now:l,editable:!!I}),x?(0,e.jsxs)("p",{className:"flex items-center gap-1.5 text-xs tabular-nums text-muted-foreground","data-automation-line":"",children:[(0,e.jsx)(Pt,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),$s(x.automationCount,x.manualTaskCount),tt(x.share)?` · ${tt(x.share)}`:null]}):null]}),(0,e.jsx)("div",{className:"border-t border-border pt-4","data-bar-metrics":"",children:(0,e.jsx)(ht,{responsibilityId:t.id,primary:m.metric,now:l,agentsById:r,layout:"stack",editable:!!I,fallback:(0,e.jsx)($e,{metric:m.metric,health:m.health,now:l,size:"hero"})})}),A.summary?.text.trim()?(0,e.jsxs)("section",{"aria-labelledby":"one-screen-affecting-heading",className:"flex flex-col gap-1.5 border-t border-border pt-4","data-affecting-summary":"",children:[(0,e.jsx)("h3",{id:"one-screen-affecting-heading",className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"What is affecting the number"}),(0,e.jsx)(Bs,{summary:A.summary,stillWaiting:A.stillWaiting})]}):null]}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-4 lg:col-span-3","data-work-order":"",children:[S?(0,e.jsx)(tn,{}):null,(0,e.jsx)(ke,{kind:"routine",items:y.routine,total:y.routine.length}),(0,e.jsx)(Ms,{skills:t.skills,agentsById:r}),(0,e.jsx)(ke,{kind:"project",items:y.project,total:y.project.length}),(0,e.jsx)(ke,{kind:"task",items:y.task,total:Math.max(m.openTasks,D)+u,automateFor:C}),k.error?(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:["Couldn’t open the conversation. ",E(k.error).body]}):null,(0,e.jsx)(zs,{artifacts:t.artifacts,total:t.artifactsTotal})]})]}),(0,e.jsx)(Nt,{open:f!==null,onOpenChange:a(v=>{v||j(null)},"onOpenChange"),companyId:s,task:f,agents:n,filedUnder:[t.title]})]})}a(sn,"ResponsibilityOneScreen");var Pe=6e4,Fe=60*Pe,se=24*Fe,rt=7*se,lt=30*se;function X(t,s){const n=Math.max(0,s.getTime()-new Date(t).getTime());return n<Pe?"just now":n<Fe?`${Math.floor(n/Pe)}m ago`:n<se?`${Math.floor(n/Fe)}h ago`:n<rt?`${Math.floor(n/se)}d ago`:n<lt?`${Math.floor(n/rt)}w ago`:`${Math.floor(n/lt)}mo ago`}a(X,"ago");function an(t,s){if(t.status==="paused")return"Paused";const n=t.lastRun;if(!n)return"Not run yet";const r=X(n.at,s);return n.outcome==="succeeded"?`Last successful run ${r}`:n.outcome==="failed"?`Failed ${r}`:`Running, started ${r}`}a(an,"routineStat");function nn(t,s){const[n,r,l]=t.split("-").map(Number);if(!n||!r||!l)return null;const[i,c,d]=ks(s).split("-").map(Number);return Math.round((Date.UTC(n,r-1,l)-Date.UTC(i,c-1,d))/se)}a(nn,"daysUntil");function rn(t,s){if(!t.targetDate)return null;const n=nn(t.targetDate,s);return n===null?null:n===0?"Due today":n===1?"Due tomorrow":n>1?`Due in ${n} days`:n===-1?"1 day late":`${-n} days late`}a(rn,"projectDueStat");function ln(t){return`${t.done} of ${t.total} ${t.total===1?"task":"tasks"} done`}a(ln,"projectProgressLabel");function on(t){return{open:t.filter(s=>!kt(s.status)),done:t.filter(s=>s.status==="done")}}a(on,"splitTasksForTable");var dn={succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled",timed_out:"Timed out"};function cn(t,s){return t.status==="running"?`Running, started ${X(t.startedAt??t.createdAt,s)}`:t.status==="queued"?`Queued ${X(t.createdAt,s)}`:`${dn[t.status]??`${t.status.charAt(0).toUpperCase()}${t.status.slice(1).replace(/_/g," ")}`} ${X(t.finishedAt??t.startedAt??t.createdAt,s)}`}a(cn,"runStat");var it=20,un=200,K={project:"project",task:"task",routine:"routine",skill:"skill"};function xn(t,s){return t instanceof Pa&&t.status===404?`That ${K[s]} is no longer available to you. It may have been deleted or made private.`:E(t).body}a(xn,"describeLinkError");function mn(t,s){return t==="project"?{projectId:s}:t==="task"?{issueId:s}:t==="skill"?{skillId:s}:{routineId:s}}a(mn,"linkBody");function hn(t,s){const[n,r]=(0,g.useState)(t);return(0,g.useEffect)(()=>{const l=window.setTimeout(()=>r(t),s);return()=>window.clearTimeout(l)},[t,s]),n}a(hn,"useDebounced");function Yt({companyId:t,responsibilityId:s,kind:n,linkedIds:r,onLinked:l,open:i,onOpenChange:c,anchor:d}){const h=V(),[m,x]=(0,g.useState)(!1),f=i??m,j=a(N=>{i===void 0&&x(N),c?.(N)},"setOpen"),[w,k]=(0,g.useState)(""),p=hn(w.trim(),un),C=z({...za(t),enabled:f&&n==="project"}),y=z({queryKey:R.routines.list(t),queryFn:a(()=>Dt.list(t),"queryFn"),enabled:f&&n==="routine"}),A=z({queryKey:R.companySkills.list(t),queryFn:a(()=>Na.list(t),"queryFn"),enabled:f&&n==="skill"}),F=z({queryKey:R.issues.search(t,p,void 0,it),queryFn:a(()=>Da.list(t,{q:p||void 0,limit:it}),"queryFn"),enabled:f&&n==="task"}),D=(0,g.useMemo)(()=>n==="project"?(C.data??[]).map(N=>({id:N.id,label:N.name})):n==="routine"?(y.data??[]).map(N=>({id:N.id,label:N.title})):n==="skill"?(A.data??[]).map(N=>({id:N.id,label:N.name})):(F.data??[]).map(N=>({id:N.id,label:N.title,detail:N.identifier})),[n,C.data,y.data,A.data,F.data]),u=(0,g.useMemo)(()=>D.filter(N=>!r.has(N.id)),[D,r]),S=n==="project"?C:n==="routine"?y:n==="skill"?A:F,I=je({data:S.data,error:S.error,status:S.status,fetchStatus:S.fetchStatus,failureReason:S.failureReason,refetch:S.refetch}),v=L({mutationFn:a(N=>_.link(s,mn(n,N)),"mutationFn"),onSuccess:a(N=>{j(!1),k(""),l?.(N),h.invalidateQueries({queryKey:R.responsibilities.all})},"onSuccess")}),T=v.reset;return(0,g.useEffect)(()=>{f&&T()},[f,T]),(0,e.jsxs)(xa,{open:f,onOpenChange:j,children:[d?(0,e.jsx)(La,{asChild:!0,children:(0,e.jsx)("span",{className:"inline-flex",children:d})}):(0,e.jsx)(ha,{asChild:!0,children:(0,e.jsxs)(b,{size:"sm",variant:"ghost",children:[(0,e.jsx)(ne,{"aria-hidden":"true"}),"Add existing ",K[n]]})}),(0,e.jsx)(va,{align:"end",className:"w-80 p-0",children:(0,e.jsxs)(qa,{shouldFilter:n!=="task",children:[(0,e.jsx)(ja,{value:w,onValueChange:k,placeholder:`Search ${K[n]}s…`,"aria-label":`Search ${K[n]}s`}),(0,e.jsx)(_a,{children:I.kind==="error"?(0,e.jsx)("div",{className:"px-3 py-4",children:(0,e.jsx)(ae,{error:I.error,size:"inline",action:`load ${K[n]}s`,onRetry:I.retry,retrying:I.isFetching})}):I.data?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ca,{children:D.length>0&&u.length===0?`Every matching ${K[n]} is already here.`:`No ${K[n]}s found.`}),u.map(N=>(0,e.jsxs)(ua,{value:`${N.label} ${N.detail??""} ${N.id}`,disabled:v.isPending,onSelect:a(()=>v.mutate(N.id),"onSelect"),children:[N.detail?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:N.detail}):null,(0,e.jsx)("span",{className:"truncate",children:N.label})]},N.id))]}):(0,e.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",role:"status",children:"Loading…"})}),v.error?(0,e.jsx)("p",{role:"alert",className:"border-t border-border px-3 py-2 text-sm text-destructive",children:xn(v.error,n)}):null]})})]})}a(Yt,"AddExistingWorkPicker");function gn(t,s){return Ze(t,s)??Ze({...t,primaryDisplay:bs(t.bar.metricKind,t.metricCurrent===null?0:1)},s)}a(gn,"proposalVisualizations");function fn(t,s){if(s.size!==0)return Array.from({length:t},(n,r)=>r).filter(n=>!s.has(n))}a(fn,"keptMetricIndexes");function Gt(t){return t.health===null?t:{...t,health:null}}a(Gt,"withoutStatus");function Xt(t){return $("grid gap-x-6 gap-y-5",t>1&&"sm:grid-cols-2",t>2&&"lg:grid-cols-3")}a(Xt,"tileGrid");function pn({interaction:t,agentsById:s}){const n=(0,g.useMemo)(()=>new Date,[]),r=(0,g.useMemo)(()=>gn(t.payload,n),[t.payload,n]),[l,i]=(0,g.useState)(new Set),[c,d]=(0,g.useState)(!1),{accept:h,decline:m,busy:x,error:f}=ps(t),j=(t.createdByAgentId?s.get(t.createdByAgentId)?.name:null)??"Your agent",w=r.metrics.length-1,k=a(p=>i(C=>{const y=new Set(C);return y.has(p)?y.delete(p):y.add(p),y}),"toggle");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-bar-proposal":"","data-testid":"bar-proposal",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[j," proposes"]}),(0,e.jsx)("p",{className:"text-sm text-foreground",children:t.payload.bar.standard})]}),(0,e.jsx)("div",{className:Xt(r.metrics.length),children:r.metrics.map((p,C)=>{const y=C-1;return p.role==="supporting"&&l.has(y)?(0,e.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2 rounded-md border border-dashed border-border px-3 py-2.5","data-metric-key":p.key,"data-dropped":"",children:[(0,e.jsx)("span",{className:"truncate text-sm text-muted-foreground line-through",children:p.title}),(0,e.jsx)(b,{type:"button",size:"xs",variant:"ghost",disabled:x,onClick:a(()=>k(y),"onClick"),children:"Keep"})]},p.key):(0,e.jsx)(gt,{metric:Gt(p),now:n,primary:p.role==="primary"?r.primary:null,details:"on_demand",showReadLine:!1,className:"rounded-md border border-border px-3 py-2.5",menu:p.role==="primary"?w>0?(0,e.jsx)("span",{className:"pr-1.5 pt-1 text-xs text-muted-foreground","data-always-kept":"",children:"Always kept"}):null:(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":`Drop “${p.title}”`,title:"Drop",disabled:x,onClick:a(()=>k(y),"onClick"),"data-drop-metric":"",children:(0,e.jsx)(Lt,{"aria-hidden":"true"})})},p.key)})}),f?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:E(f).body}):null,c?(0,e.jsx)(fs,{busy:x,sending:m.isPending,onSend:a(p=>m.mutate(p,{onSuccess:a(()=>d(!1),"onSuccess")}),"onSend"),onBack:a(()=>d(!1),"onBack")}):(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,e.jsx)(b,{type:"button",variant:"ghost",size:"sm",disabled:x,onClick:a(()=>d(!0),"onClick"),children:"Not right"}),(0,e.jsxs)(b,{type:"button",size:"sm",disabled:x,onClick:a(()=>h.mutate(fn(w,l)),"onClick"),children:[h.isPending?(0,e.jsx)(ee,{"aria-hidden":"true",className:"animate-spin"}):null,"Use this bar"]})]})]})}a(pn,"ProposalPreview");function jn({metric:t,onShowAs:s,onRemove:n,busy:r}){const l=t.role==="primary"?t.kind:null,i=ws({role:t.role,kind:l,display:t.display,unit:t.unit}),c=os({display:t.display,kind:l});return i.length<=1&&!n?null:(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":`Options for “${t.title}”`,disabled:r,children:(0,e.jsx)(pe,{"aria-hidden":"true"})})}),(0,e.jsxs)(B,{align:"end",children:[i.length>1?(0,e.jsxs)(wt,{children:[(0,e.jsx)(It,{children:"Show as"}),(0,e.jsx)(Bt,{children:(0,e.jsx)(Ht,{value:c,onValueChange:a(d=>{d!==c&&s(Es(d))},"onValueChange"),children:i.map(d=>(0,e.jsx)(J,{value:d,children:gs[d]},d))})})]}):null,n?(0,e.jsx)(P,{variant:"destructive",onSelect:n,children:"Remove"}):null]})]})}a(jn,"VisualizationMenu");function vn(t){const s=V(),n=R.responsibilities.metrics(t);return{showAs:L({mutationFn:a(({metric:r,display:l})=>et.setDisplay(t,r.role==="primary"?"primary":r.id,l),"mutationFn"),onMutate:a(async({metric:r,display:l})=>{await s.cancelQueries({queryKey:n});const i=s.getQueryData(n);return s.setQueryData(n,c=>c&&{...c,metrics:c.metrics.map(d=>d.key===r.key?{...d,display:l,period:l==="bar"?"week":null}:d)}),{before:i}},"onMutate"),onError:a((r,l,i)=>{i?.before&&s.setQueryData(n,i.before)},"onError"),onSuccess:a(r=>s.setQueryData(n,r),"onSuccess")}),remove:L({mutationFn:a(r=>et.removeMetric(t,r.id),"mutationFn"),onSuccess:a(r=>s.setQueryData(n,r),"onSuccess")})}}a(vn,"useVisualizationWrites");function bn({responsibility:t,now:s,editable:n}){const r=us(t.id),l=je(r),{showAs:i,remove:c}=vn(t.id),[d,h]=(0,g.useState)(null),m=t.rollup.metric;if(!r.data||l.kind==="error")return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($e,{metric:m,health:t.rollup.health,now:s,size:"hero",className:"max-w-sm"}),l.kind==="error"?(0,e.jsx)(ae,{error:l.error,size:"inline",action:"load the measures",onRetry:l.retry,retrying:l.isFetching}):null]});const x=r.data,f=n&&x.source==="chosen";return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:Xt(x.metrics.length),"data-bar-visualizations":x.source,children:x.metrics.map(j=>(0,e.jsx)(gt,{metric:Gt(j),now:s,primary:j.role==="primary"?m:null,details:"on_demand",menu:f?(0,e.jsx)(jn,{metric:j,busy:i.isPending||c.isPending,onShowAs:a(w=>i.mutate({metric:j,display:w}),"onShowAs"),onRemove:j.role==="supporting"&&j.id?()=>{c.reset(),h(j)}:void 0}):void 0},j.key))}),i.error?(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:["Couldn’t change how it is shown. ",E(i.error).body]}):null,(0,e.jsx)(Tt,{open:d!==null,onOpenChange:a(j=>{j||h(null)},"onOpenChange"),children:(0,e.jsxs)(Rt,{children:[(0,e.jsxs)(At,{children:[(0,e.jsxs)(Ot,{children:["Remove “",d?.title,"”?"]}),(0,e.jsx)(St,{children:"Its readings are kept."})]}),c.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t remove it. ",E(c.error).body]}):null,(0,e.jsxs)(yt,{className:"items-center sm:justify-between",children:[(0,e.jsx)(Ut,{children:"Keep it"}),(0,e.jsx)(b,{variant:"destructive",disabled:c.isPending||!d,onClick:a(()=>d&&c.mutate(d,{onSuccess:a(()=>h(null),"onSuccess")}),"onClick"),children:c.isPending?"Removing…":"Remove"})]})]})})]})}a(bn,"SetVisualizations");function Nn({responsibility:t,agentsById:s,now:n,editable:r}){const l=(0,g.useId)(),i=Ve(t,r),[c,d]=(0,g.useState)(!1),[h,m]=(0,g.useState)(!1),x=!!t.rollup.metric,f=i.state,j=a(T=>T?s.get(T)?.name:void 0,"nameOf"),w=j(f?.conversation?.agentId)??"an agent",k=j(f?.defaultAgentId)??"your agent",p=r?f?.proposal??null:null,C=r&&!p&&f?.state==="discussing"&&f.conversation?f.conversation:null,y=!!f,A=y&&!i.canTalk,F=a(()=>i.start.mutate(),"startTalking"),D=i.start.isPending,u=r&&!x&&!p&&!C&&(A||i.start.isError),S=r&&!u?(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsx)(b,{size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":"More for the bar",children:(0,e.jsx)(pe,{"aria-hidden":"true"})})}),(0,e.jsxs)(B,{align:"end",children:[(0,e.jsx)(P,{onSelect:a(()=>d(!0),"onSelect"),children:x?"Edit by hand":"Set it by hand"}),x?(0,e.jsx)(P,{onSelect:a(()=>m(!0),"onSelect"),children:"Record a reading"}):null]})]}):null,I=r&&x&&!p&&!C&&i.canTalk?(0,e.jsxs)(b,{size:"xs",variant:"ghost",disabled:D,onClick:F,"data-bar-edit-primary":"",children:[D?(0,e.jsx)(ee,{"aria-hidden":"true",className:"animate-spin"}):(0,e.jsx)(te,{"aria-hidden":"true"}),"Change it with ",k]}):null;let v;return p?v=(0,e.jsx)(pn,{interaction:p,agentsById:s}):x?v=(0,e.jsx)(bn,{responsibility:t,now:n,editable:r}):v=r?C?null:(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3","data-bar-empty":"",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"How will you know this is going well?"}),u?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b,{size:"sm",onClick:a(()=>d(!0),"onClick"),"data-bar-edit-primary":"",children:"Set it by hand"}),A?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"No agent is free to talk it through."}):null]}):(0,e.jsxs)(b,{size:"sm",disabled:!y||D,onClick:F,"data-bar-edit-primary":"",children:[D?(0,e.jsx)(ee,{"aria-hidden":"true",className:"animate-spin"}):(0,e.jsx)(te,{"aria-hidden":"true"}),y?`Set it with ${k}`:"Set it with an agent"]})]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No bar."}),(0,e.jsxs)(q,{id:"responsibility-bar",elevation:"low",className:"gap-4 px-5 py-4","aria-labelledby":l,"data-bar-module":"",children:[(0,e.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,e.jsx)("h2",{id:l,className:"text-sm font-semibold text-foreground",children:"The bar"}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[I,S]})]}),C?(0,e.jsxs)("p",{className:"text-sm text-muted-foreground","data-bar-talking":"",children:["Talking it through with ",w,"."," ",(0,e.jsx)(M,{to:`/issues/${C.identifier??C.issueId}`,className:"font-medium text-foreground underline-offset-4 hover:underline",children:"Open the conversation"})]}):null,i.start.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t start the conversation. ",E(i.start.error).body]}):null,i.loadError?(0,e.jsx)(ae,{error:i.loadError,size:"inline",action:"load the bar conversation",onRetry:i.retry,retrying:i.retrying}):null,v,r?(0,e.jsx)(Wt,{responsibility:t,open:c,onOpenChange:d}):null,r&&x?(0,e.jsx)(Ue,{open:h,onOpenChange:m,children:(0,e.jsxs)(qe,{className:"sm:max-w-sm",children:[(0,e.jsxs)(ze,{children:[(0,e.jsx)(Oe,{children:"Record a reading"}),(0,e.jsx)(Be,{className:"sr-only",children:t.rollup.metric?.name})]}),(0,e.jsx)(Vt,{responsibility:t})]})}):null]})}a(Nn,"BarModule");var kn={recent:a((t,s)=>Ma.get(`/responsibilities/${encodeURIComponent(t)}/runs${s?`?limit=${s}`:""}`),"recent")},wn=new Set(["queued","running"]);function yn(t){return z({queryKey:R.responsibilities.runs(t),queryFn:a(()=>kn.recent(t),"queryFn"),staleTime:15e3,refetchInterval:a(s=>s.state.data?.runs.some(n=>wn.has(n.status))?5e3:!1,"refetchInterval")})}a(yn,"useResponsibilityRuns");var Zt=(0,g.createContext)(!0);function Q({section:t,title:s,add:n,empty:r,withWho:l=!0,children:i,footer:c}){const d=`one-screen-v2-${t}-heading`;return(0,e.jsx)("section",{"aria-labelledby":d,"data-section":t,children:(0,e.jsxs)(q,{elevation:"low",className:"gap-0 overflow-hidden py-0","data-section-table":"",children:[(0,e.jsxs)("div",{className:"flex min-h-11 items-center justify-between gap-2 border-b border-border px-4 py-2","data-section-header":"",children:[(0,e.jsx)("h2",{id:d,className:"text-sm font-semibold text-foreground",children:s}),n]}),r!=null?(0,e.jsx)("p",{className:"px-4 py-3 text-sm text-muted-foreground","data-section-empty":"",children:r}):(0,e.jsx)(Zt.Provider,{value:l,children:(0,e.jsx)("ul",{className:$("flex flex-col divide-y divide-border sm:grid sm:gap-x-6",l?"sm:grid-cols-(--gtc-27)":"sm:grid-cols-(--gtc-13)"),"data-section-rows":"",children:i})}),c]})})}a(Q,"SectionTable");function Y({to:t,label:s,leading:n,title:r,aside:l,stat:i,who:c,rowData:d}){const h=(0,g.useContext)(Zt);return(0,e.jsx)("li",{className:"min-w-0 sm:col-span-full sm:grid sm:grid-cols-subgrid",...d,children:(0,e.jsxs)(M,{to:t,"aria-label":s,className:"flex min-h-11 min-w-0 items-center gap-3 px-4 py-2 text-sm transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:col-span-full sm:grid sm:grid-cols-subgrid",children:[(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 sm:contents",children:[(0,e.jsxs)("span",{className:"flex min-w-0 items-center gap-2","data-row-title":"",children:[n,(0,e.jsx)("span",{className:"min-w-0 truncate text-foreground",title:r,children:r}),l?(0,e.jsx)("span",{className:"ml-auto flex shrink-0 items-center pl-2",children:l}):null]}),i!=null&&i!==""?(0,e.jsx)("span",{className:"min-w-0 truncate text-muted-foreground tabular-nums sm:whitespace-nowrap sm:text-right","data-row-stat":"",children:i}):(0,e.jsx)("span",{"aria-hidden":"true",className:"hidden sm:block"})]}),h?c?(0,e.jsx)("span",{className:"flex shrink-0 items-center justify-end gap-1","data-row-who":"",children:c}):(0,e.jsx)("span",{"aria-hidden":"true",className:"hidden sm:block"}):null]})})}a(Y,"SectionTableRow");function ot({children:t,onClick:s}){return(0,e.jsx)("button",{type:"button",onClick:s,className:"flex min-h-11 w-full items-center border-t border-border px-4 text-left text-sm text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring","data-section-footer":"",children:t})}a(ot,"SectionTableFooterButton");function dt({children:t,alert:s=!1}){return(0,e.jsx)("p",{role:s?"alert":void 0,className:$("border-t border-border px-4 py-3 text-sm",s?"text-destructive":"text-muted-foreground"),children:t})}a(dt,"SectionTableNote");function Jt({agentId:t,agentsById:s}){if(!t)return null;const n=s.get(t),r=n?.name??"An agent";return(0,e.jsx)("span",{title:r,className:"flex shrink-0",children:(0,e.jsx)(qt,{agent:n??{id:t},name:n?.name,size:20,label:r})})}a(Jt,"WhoAvatar");function ct({identifier:t,when:s}){return(0,e.jsxs)("span",{className:"inline-flex items-center gap-3",children:[t?(0,e.jsx)("span",{className:"font-mono",children:t}):null,(0,e.jsx)("span",{className:"sm:inline-block sm:min-w-16 sm:text-right",children:s})]})}a(ct,"TaskRefStat");var G={routines:"Routines",skills:"Skills",projects:"Projects",tasks:"Tasks",runs:"Recent runs",artifacts:"Artifacts"},we=8,Sn=4;function Cn({agentIds:t,agentsById:s}){const n=t.length>Sn,r=n?t.slice(0,3):t;return(0,e.jsxs)(e.Fragment,{children:[r.map(l=>(0,e.jsx)(Jt,{agentId:l,agentsById:s},l)),n?(0,e.jsxs)("span",{className:"text-sm text-muted-foreground tabular-nums",children:["+",t.length-r.length]}):null]})}a(Cn,"SkillHolders");function An({progress:t}){const s=ln(t),n=Math.round(Math.min(t.done,t.total)/t.total*100);return(0,e.jsx)("span",{role:"img","aria-label":s,title:s,className:"relative block h-1 w-16 overflow-hidden rounded-full bg-muted","data-project-progress":n,children:(0,e.jsx)("span",{className:"absolute inset-y-0 left-0 rounded-full bg-muted-foreground",style:{width:`${n}%`}})})}a(An,"ProjectProgress");function Tn({artifact:t}){const s=hs(bt(t));return(0,e.jsx)(s==="bars"?wa:s,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})}a(Tn,"ArtifactKindMark");function ye({label:t,newLabel:s,onNew:n,existing:r,onExisting:l}){const i=(0,g.useRef)(!1);return!n&&!r?null:(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":t,"data-section-add":"",children:(0,e.jsx)(ne,{"aria-hidden":"true"})})}),(0,e.jsxs)(B,{align:"end",onCloseAutoFocus:a(c=>{i.current&&(i.current=!1,c.preventDefault(),l?.())},"onCloseAutoFocus"),children:[n?(0,e.jsx)(P,{onSelect:n,children:s}):null,r&&l?(0,e.jsx)(P,{onSelect:a(()=>{i.current=!0},"onSelect"),children:"Add existing"}):null]})]})}a(ye,"AddMenu");function Rn({onExisting:t,filed:s,onRemove:n,removingLinkId:r,agents:l}){const i=(0,g.useRef)(!1);return(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":"Add or remove a skill","data-section-add":"",children:(0,e.jsx)(ne,{"aria-hidden":"true"})})}),(0,e.jsxs)(B,{align:"end",onCloseAutoFocus:a(c=>{i.current&&(i.current=!1,c.preventDefault(),t())},"onCloseAutoFocus"),children:[(0,e.jsx)(P,{onSelect:a(()=>{i.current=!0},"onSelect"),children:"Add existing skill"}),s.length>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ge,{}),(0,e.jsx)(he,{children:"Remove from this responsibility"}),s.map(c=>(0,e.jsx)(P,{disabled:r===c.linkId,"aria-label":`Remove ${c.name} from this responsibility`,onSelect:a(()=>n(c),"onSelect"),children:c.name},c.id))]}):null,l.length>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ge,{}),(0,e.jsx)(he,{children:"Give a skill to"}),l.map(c=>(0,e.jsx)(P,{asChild:!0,children:(0,e.jsx)(M,{to:Ta(ga(c),"skills"),children:c.name})},c.id))]}):null]})]})}a(Rn,"SkillsMenu");function In({label:t,reason:s}){return(0,e.jsx)("span",{title:s,className:"inline-flex","data-section-add-disabled":"",children:(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":`${t}: ${s}`,disabled:!0,children:(0,e.jsx)(ne,{"aria-hidden":"true"})})})}a(In,"DisabledAdd");function Dn({open:t,onOpenChange:s,title:n,onSave:r}){const[l,i]=(0,g.useState)(n),[c,d]=(0,g.useState)(null),[h,m]=(0,g.useState)(!1),x=a(async f=>{f.preventDefault();const j=l.trim();if(!(!j||h)){if(j===n){s(!1);return}m(!0),d(null);try{await r(j),s(!1)}catch(w){d(w)}finally{m(!1)}}},"submit");return(0,e.jsx)(Ue,{open:t,onOpenChange:a(f=>{f&&i(n),s(f)},"onOpenChange"),children:(0,e.jsx)(qe,{className:"sm:max-w-md",children:(0,e.jsxs)("form",{className:"flex flex-col gap-4",onSubmit:x,children:[(0,e.jsxs)(ze,{children:[(0,e.jsx)(Oe,{children:"Rename"}),(0,e.jsx)(Be,{className:"sr-only",children:"The short name this responsibility goes by."})]}),(0,e.jsx)(Mt,{"aria-label":"Name",value:l,maxLength:200,autoFocus:!0,onChange:a(f=>i(f.target.value),"onChange")}),c?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t rename it. ",E(c).body]}):null,(0,e.jsxs)(_t,{className:"sm:justify-between",children:[(0,e.jsx)(b,{type:"button",variant:"ghost",onClick:a(()=>s(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(b,{type:"submit",disabled:!l.trim()||h,children:h?"Saving…":"Save"})]})]})})})}a(Dn,"RenameDialog");function En({responsibility:t,companyId:s,agents:n,agentsById:r,areas:l,now:i,notices:c,actions:d,onReviewProposal:h}){const m=V(),x=t.status==="active",f=t.status!=="dismissed",j=t.status==="active"||t.status==="proposed",w=t.standard?.trim()||t.title,k=Hs(t.id),[p,C]=(0,g.useState)(!1),[y,A]=(0,g.useState)(null),[F,D]=(0,g.useState)(!1),[u,S]=(0,g.useState)(!1),[I,v]=(0,g.useState)(null),[T,N]=(0,g.useState)(!1),[W,ve]=(0,g.useState)(!1),re=yn(t.id),Z=je(re),ts=(0,g.useMemo)(()=>({project:new Set(t.projects.map(o=>o.id)),task:new Set(t.tasks.filter(o=>o.membership==="direct").map(o=>o.id)),routine:new Set(t.routines.filter(o=>o.membership==="direct").map(o=>o.id)),skill:new Set(t.skills.filter(o=>o.linkId).map(o=>o.id))}),[t.projects,t.tasks,t.routines,t.skills]),le=t.routines.filter(o=>o.status!=="archived"),We=t.projects.filter(o=>!Ks(o)),{open:ie,done:be}=(0,g.useMemo)(()=>on(t.tasks),[t.tasks]),Qe=[...T?ie:ie.slice(0,we),...W?be:[]],Ye=(0,g.useMemo)(()=>{const o=ft(t).map(O=>O.agentId);return t.runByAgentId&&!o.includes(t.runByAgentId)&&o.unshift(t.runByAgentId),o.flatMap(O=>{const ue=r.get(O);return ue?[ue]:[]})},[t,r]),ss=Ye[0]?.id??null,oe=L({mutationFn:a(o=>Dt.run(o.id,{}),"mutationFn"),onSuccess:a(async()=>{await Promise.all([m.invalidateQueries({queryKey:R.responsibilities.runs(t.id)}),m.invalidateQueries({queryKey:R.responsibilities.detail(t.id)})])},"onSuccess")}),de=a((o,O)=>(0,e.jsx)(Yt,{companyId:s,responsibilityId:t.id,kind:o,linkedIds:ts[o],open:y===o,onOpenChange:a(ue=>A(ue?o:null),"onOpenChange"),anchor:O}),"picker"),ce=a(o=>o?(0,e.jsx)(Jt,{agentId:o,agentsById:r}):null,"whoFor"),Ge=le.filter(o=>o.status==="active"),as=x?Ge.length===0?(0,e.jsx)(In,{label:"Run a routine now",reason:le.length===0?"No routines to run yet":"No active routine to run"}):(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsx)(b,{type:"button",size:"icon-xs",variant:"ghost",className:"text-muted-foreground","aria-label":"Run a routine now",disabled:oe.isPending,"data-section-add":"",children:(0,e.jsx)(ne,{"aria-hidden":"true"})})}),(0,e.jsxs)(B,{align:"end",children:[(0,e.jsx)(he,{children:"Run now"}),Ge.map(o=>(0,e.jsx)(P,{onSelect:a(()=>oe.mutate(o),"onSelect"),children:o.title},o.id))]})]}):null,ns=(0,g.useMemo)(()=>t.skills.filter(o=>o.linkId),[t.skills]),rs=f?de("skill",(0,e.jsx)(Rn,{onExisting:a(()=>A("skill"),"onExisting"),filed:ns,removingLinkId:d.unlinkingId,onRemove:a(o=>d.unlink({linkId:o.linkId,label:o.name,relink:{skillId:o.id}}),"onRemove"),agents:Ye})):null,ls=a(async o=>{v(null);try{await _.link(t.id,{projectId:o.id})}catch(O){v(O)}await m.invalidateQueries({queryKey:R.responsibilities.all})},"fileNewProject");return(0,e.jsxs)("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-8","data-responsibility-view":"one_screen_v2",children:[(0,e.jsxs)("header",{className:"flex flex-col gap-1",children:[t.area?(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-area":"",children:t.area.title}):null,(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsx)("h1",{className:"min-w-0 flex-1 text-xl font-semibold text-foreground",children:w}),(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsx)(b,{size:"icon-sm",variant:"ghost",className:"shrink-0 text-muted-foreground","aria-label":"More actions for this responsibility",children:(0,e.jsx)(pe,{"aria-hidden":"true"})})}),(0,e.jsxs)(B,{align:"end",children:[(0,e.jsx)(P,{onSelect:a(()=>C(!0),"onSelect"),children:"Rename…"}),(0,e.jsxs)(wt,{children:[(0,e.jsx)(It,{children:"Move to area"}),(0,e.jsx)(Bt,{className:"max-h-(--sz-50vh) overflow-y-auto",children:(0,e.jsx)(Zs,{areas:t.area&&!l.some(o=>o.id===t.area.id)?[t.area,...l]:l,value:t.area?.id??null,onChange:a(o=>{o!==(t.area?.id??null)&&k.mutate(o)},"onChange")})})]}),x?(0,e.jsx)(P,{onSelect:a(()=>d.setStatus("let_go"),"onSelect"),children:"Let go"}):t.status==="let_go"||t.status==="dismissed"?(0,e.jsx)(P,{onSelect:a(()=>d.setStatus("active"),"onSelect"),children:"Take it back on"}):null,(0,e.jsx)(ge,{}),(0,e.jsx)(P,{variant:"destructive",onSelect:d.requestDelete,children:"Delete…"})]})]})]}),t.status==="let_go"?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"You let go of this."}):t.status==="dismissed"?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"You dismissed this."}):null,k.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t move it. ",E(k.error).body]}):null,c]}),t.status==="proposed"?(0,e.jsx)(fe,{count:1,subject:"this",onReview:h}):null,(0,e.jsx)(Nn,{responsibility:t,agentsById:r,now:i,editable:j}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-section-order":"",children:[(0,e.jsx)(Q,{section:"routines",title:G.routines,add:f?de("routine",(0,e.jsx)(ye,{label:"Add a routine",newLabel:"New routine",onNew:x?()=>D(!0):void 0,existing:!0,onExisting:a(()=>A("routine"),"onExisting")})):null,empty:le.length===0?"None yet.":null,children:le.map(o=>(0,e.jsx)(Y,{rowData:{"data-work-id":o.id},to:jt(o.id),title:o.title,stat:an(o,i),who:ce(o.assigneeAgentId)},o.id))}),(0,e.jsx)(Q,{section:"skills",title:G.skills,add:rs,empty:t.skills.length===0?"None yet.":null,children:t.skills.map(o=>(0,e.jsx)(Y,{rowData:{"data-work-id":o.id},to:He(o),title:o.name,stat:o.linkId?"Filed here":void 0,who:o.agentIds.length>0?(0,e.jsx)(Cn,{agentIds:o.agentIds,agentsById:r}):null},o.id))}),(0,e.jsx)(Q,{section:"projects",title:G.projects,add:f?de("project",(0,e.jsx)(ye,{label:"Add a project",newLabel:"New project",onNew:x?()=>S(!0):void 0,existing:!0,onExisting:a(()=>A("project"),"onExisting")})):null,empty:We.length===0?t.projects.length>0?"None open.":"None yet.":null,footer:I?(0,e.jsxs)(dt,{alert:!0,children:["The project was made but couldn’t be filed here. ",E(I).body]}):null,children:We.map(o=>(0,e.jsx)(Y,{rowData:{"data-work-id":o.id},to:Ie(o),title:o.name,aside:o.progress?(0,e.jsx)(An,{progress:o.progress}):null,stat:rn(o,i),who:ce(o.leadAgentId)},o.id))}),(0,e.jsx)(Q,{section:"tasks",title:G.tasks,add:f?de("task",(0,e.jsx)(ye,{label:"Add a task",newLabel:"New task",onNew:x?()=>d.newTask({defaultTitle:""}):void 0,existing:!0,onExisting:a(()=>A("task"),"onExisting")})):null,empty:Qe.length===0?t.tasks.length>0?"None open.":"None yet.":null,footer:(0,e.jsxs)(e.Fragment,{children:[!T&&ie.length>we?(0,e.jsxs)(ot,{onClick:a(()=>N(!0),"onClick"),children:["Show ",ie.length-we," more"]}):null,be.length>0?(0,e.jsx)(ot,{onClick:a(()=>ve(o=>!o),"onClick"),children:W?"Hide done":`Show ${be.length} done`}):null]}),children:Qe.map(o=>(0,e.jsx)(Y,{rowData:{"data-work-id":o.id},to:Le(o),leading:(0,e.jsx)(Ft,{...Et(o),size:"sm"}),title:o.title,stat:(0,e.jsx)(ct,{identifier:o.identifier,when:X(o.updatedAt,i)}),who:ce(o.assigneeAgentId)},o.id))}),(0,e.jsx)(Q,{section:"runs",title:G.runs,add:as,empty:Z.kind==="error"?(0,e.jsx)(ae,{error:Z.error,size:"inline",action:"load the runs",onRetry:Z.retry,retrying:Z.isFetching}):re.data?re.data.runs.length===0?"None yet.":null:(0,e.jsx)("span",{role:"status",children:"Loading…"}),footer:oe.error?(0,e.jsxs)(dt,{alert:!0,children:["Couldn’t start the run. ",E(oe.error).body]}):null,children:(Z.kind==="error"?[]:re.data?.runs??[]).map(o=>{const O=cn(o,i);return(0,e.jsx)(Y,{rowData:{"data-run-id":o.id,"data-run-status":o.status},to:`/agents/${o.agentId}/runs/${o.id}`,label:`${r.get(o.agentId)?.name??"An agent"} on ${o.issue.title}: ${O}`,title:o.issue.title,stat:O,who:ce(o.agentId)},o.id)})}),(0,e.jsx)(Q,{section:"artifacts",title:G.artifacts,withWho:!1,empty:t.artifacts.length===0?"None yet.":null,children:t.artifacts.map(o=>(0,e.jsx)(Y,{rowData:{"data-artifact-id":o.id},to:o.href,leading:(0,e.jsx)(Tn,{artifact:o}),title:o.title,stat:(0,e.jsx)(ct,{identifier:o.issue.identifier,when:X(o.updatedAt,i)})},`${o.source}:${o.id}`))})]}),(0,e.jsx)(Dn,{open:p,onOpenChange:C,title:t.title,onSave:d.saveTitle}),(0,e.jsx)(Nt,{open:F,onOpenChange:D,companyId:s,task:null,newFor:{responsibilityId:t.id,responsibilityTitle:t.title,assigneeAgentId:ss},agents:n,filedUnder:[t.title]}),u?(0,e.jsx)(Oa,{companyId:s,onClose:a(()=>S(!1),"onClose"),onCreated:ls}):null]})}a(En,"ResponsibilityOneScreenV2");function es({id:t,title:s,count:n,question:r,action:l}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsxs)("h2",{id:t,className:"text-base font-semibold text-foreground",children:[s," ",(0,e.jsx)("span",{className:"text-sm font-normal tabular-nums text-muted-foreground",children:n})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r})]}),l]})}a(es,"SectionHeading$1");function Pn({agentIds:t,agentsById:s}){if(t.length===0)return null;const n=t.map(r=>s.get(r)?.name??"An agent");return(0,e.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground","aria-label":`Held by ${n.join(", ")}`,children:[(0,e.jsx)("span",{className:"flex shrink-0 -space-x-1","aria-hidden":"true",children:t.slice(0,3).map(r=>(0,e.jsx)(qt,{agent:s.get(r)??{id:r},name:s.get(r)?.name,size:16},r))}),(0,e.jsx)("span",{className:"truncate","aria-hidden":"true",children:n.join(", ")})]})}a(Pn,"Holders");function Fn({skills:t,agentsById:s,addControl:n,removeControl:r}){return(0,e.jsxs)("section",{"aria-labelledby":"responsibility-skills-heading",className:"flex flex-col gap-2",children:[(0,e.jsx)(es,{id:"responsibility-skills-heading",title:"Skills",count:t.length,question:"What does this need, and what can the agents working on it do?",action:n}),t.length>0?(0,e.jsx)("ul",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"responsibility-skills",children:t.map(l=>(0,e.jsx)("li",{className:"min-w-0",children:(0,e.jsxs)(q,{elevation:"low",className:"h-full gap-3 px-4 py-4",children:[(0,e.jsxs)(M,{to:He(l),className:"flex min-w-0 items-start gap-3 rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,e.jsx)(Ua,{card:l,size:32}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,e.jsx)("span",{className:"truncate text-sm font-medium text-foreground underline-offset-4 hover:underline",children:l.name}),l.tagline||l.description?(0,e.jsx)("span",{className:"line-clamp-2 text-xs text-muted-foreground",children:l.tagline||l.description}):null]})]}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[l.agentIds.length>0?(0,e.jsx)(Pn,{agentIds:l.agentIds,agentsById:s}):(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Filed here"}),l.linkId?r?.(l):null]})]})},l.id))}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No skills yet. Add one this needs, or they appear here from the agents doing the work: the ones assigned its tasks and routines, and the leads of its projects."})]})}a(Fn,"ResponsibilitySkills");function $n(t,s){return`Showing the newest ${t} of ${s>=1e3?`${Ct.toLocaleString("en-US")} or more`:s.toLocaleString("en-US")}.`}a($n,"artifactsTruncationNote");function Mn({artifacts:t,total:s,truncated:n}){const{enabled:r}=Ps();return(0,e.jsxs)("section",{"aria-labelledby":"responsibility-artifacts-heading",className:"flex flex-col gap-3",children:[(0,e.jsx)(es,{id:"responsibility-artifacts-heading",title:"Artifacts",count:s,question:"What has the work produced? Newest first; each opens in the task that made it."}),t.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing produced yet. Documents, files and other output from the tasks under this responsibility collect here."}):r?(0,e.jsx)(xs,{testId:"responsibility-artifacts",children:t.map(l=>(0,e.jsx)(vs,{subject:bt(l),to:l.href},`${l.source}:${l.id}`))}):(0,e.jsx)("ul",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3","data-testid":"responsibility-artifacts",children:t.map(l=>(0,e.jsxs)("li",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)(As,{artifact:l}),(0,e.jsxs)(M,{to:Le(l.issue),className:"truncate px-1 text-xs text-muted-foreground underline-offset-4 hover:underline",children:[(0,e.jsx)("span",{className:"font-mono",children:l.issue.identifier})," ",l.issue.title]})]},`${l.source}:${l.id}`))}),n?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:$n(t.length,s)}):null]})}a(Mn,"ResponsibilityArtifacts");function xe({id:t,title:s,count:n,question:r,action:l}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsxs)("h2",{id:t,className:"text-base font-semibold text-foreground",children:[s,n!==void 0?(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("span",{className:"text-sm font-normal tabular-nums text-muted-foreground",children:n})]}):null]}),r?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r}):null]}),l]})}a(xe,"SectionHeading");function _n({label:t,pending:s,onRemove:n}){return(0,e.jsx)(b,{size:"icon-xs",variant:"ghost","aria-label":`Remove ${t} from this responsibility`,title:"Remove from this responsibility. It stays wherever else it is filed.",disabled:s,onClick:n,children:(0,e.jsx)(Lt,{"aria-hidden":"true"})})}a(_n,"RemoveLinkButton");function Se({children:t,actions:s}){return(0,e.jsxs)("li",{className:"flex items-center gap-1 pr-3",children:[(0,e.jsx)("div",{className:"min-w-0 flex-1",children:t}),s?(0,e.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:s}):null]})}a(Se,"WorkRow");function Ln({responsibility:t,companyId:s,agents:n,agentsById:r,areas:l,now:i,actions:c,notices:d}){const[h,m]=(0,g.useState)(!1),x=(0,g.useMemo)(()=>new Map(t.projects.map(u=>[u.id,u])),[t.projects]),f=(0,g.useMemo)(()=>js(t.tasks),[t.tasks]),j=(0,g.useMemo)(()=>ft(t),[t]),w=(0,g.useMemo)(()=>({project:new Set(t.projects.map(u=>u.id)),task:new Set(t.tasks.filter(u=>u.membership==="direct").map(u=>u.id)),routine:new Set(t.routines.filter(u=>u.membership==="direct").map(u=>u.id)),skill:new Set(t.skills.filter(u=>u.linkId).map(u=>u.id))}),[t.projects,t.tasks,t.routines,t.skills]),k=t.status==="active",p=t.status!=="dismissed",C=a(u=>(0,e.jsx)(Yt,{companyId:s,responsibilityId:t.id,kind:u,linkedIds:w[u]}),"picker"),y=a((u,S,I)=>u&&p?(0,e.jsx)(_n,{label:S,pending:c.unlinkingId===u,onRemove:a(()=>c.unlink({linkId:u,label:S,relink:I}),"onRemove")}):null,"unlinkRow"),A=a(u=>p?(0,e.jsx)(st,{companyId:s,agents:n,item:u,size:"icon-xs"}):null,"giveRow"),F=a(u=>{if(!k||u.tone!=="attention")return null;const S=Ss(u);return S?(0,e.jsx)(st,{companyId:s,agents:n,item:S}):(0,e.jsxs)(b,{size:"xs",variant:"ghost",className:"shrink-0 text-muted-foreground",onClick:a(()=>c.newTask({defaultTitle:u.text}),"onClick"),"aria-label":`New task for an agent: ${u.text}`,children:[(0,e.jsx)(nt,{"aria-hidden":"true"}),"New task for an agent"]})},"signalAction"),D=a(u=>{const S=u.membership==="project"&&u.projectId?x.get(u.projectId):null;return(0,e.jsxs)(Se,{actions:(0,e.jsxs)(e.Fragment,{children:[kt(u.status)?null:A({kind:"task",id:u.id,label:u.title,currentAgentId:u.assigneeAgentId}),y(u.linkId,u.title,{issueId:u.id})]}),children:[(0,e.jsx)(Ne,{className:"border-b-0",leading:(0,e.jsx)(Ft,{...Et(u)}),identifier:u.identifier??void 0,title:u.title,to:Le(u),trailing:u.status==="blocked"?(0,e.jsx)("span",{className:"text-xs text-(--status-task-icon-blocked)",children:"Blocked"}):null}),S?(0,e.jsxs)("p",{className:"pb-2 pl-12 text-xs text-muted-foreground",children:["Here through"," ",(0,e.jsx)(M,{to:Ie(S),className:"underline-offset-4 hover:underline",children:S.name})]}):null]},u.id)},"renderTask");return(0,e.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-8",children:[t.status==="proposed"?(0,e.jsx)(ta,{companyId:s,proposed:[t],areas:t.area?[t.area]:[],heading:"Proposed for you",description:"Confirm it to start giving its work to agents, or adjust the bar and numbers first.",onReviewed:c.onProposalReviewed}):null,(0,e.jsxs)("header",{className:"flex flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,e.jsx)(Ae,{value:t.title,onSave:a(u=>{const S=u.trim();if(S&&S!==t.title)return c.saveTitle(S)},"onSave"),as:"h1",className:"text-2xl font-semibold text-foreground"}),(0,e.jsx)(Ae,{value:t.description??"",onSave:a(u=>c.saveDescription(u.trim()||null),"onSave"),as:"p",className:"text-sm text-muted-foreground",placeholder:"What this covers (optional)",multiline:!0,nullable:!0})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[k?(0,e.jsxs)(b,{variant:"outline",onClick:a(()=>c.newTask({defaultTitle:""}),"onClick"),children:[(0,e.jsx)(nt,{"aria-hidden":"true"}),"New task for an agent"]}):null,(0,e.jsxs)(H,{children:[(0,e.jsx)(U,{asChild:!0,children:(0,e.jsx)(b,{size:"icon",variant:"ghost","aria-label":"More actions for this responsibility",children:(0,e.jsx)(pe,{"aria-hidden":"true"})})}),(0,e.jsxs)(B,{align:"end",children:[k?(0,e.jsx)(P,{onSelect:a(()=>c.setStatus("let_go"),"onSelect"),children:"Let go"}):t.status==="let_go"||t.status==="dismissed"?(0,e.jsx)(P,{onSelect:a(()=>c.setStatus("active"),"onSelect"),children:"Take it back on"}):null,(0,e.jsx)(ge,{}),(0,e.jsx)(P,{variant:"destructive",onSelect:c.requestDelete,children:"Delete…"})]})]})]})]}),(0,e.jsxs)("dl",{className:"flex flex-col gap-2 text-sm",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,e.jsx)("dt",{className:"text-xs text-muted-foreground",children:"Area"}),(0,e.jsx)("dd",{children:(0,e.jsx)(ra,{responsibilityId:t.id,area:t.area,areas:l})})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("dt",{className:"text-xs text-muted-foreground",children:"Agents on this"}),(0,e.jsx)("dd",{children:(0,e.jsx)(sa,{agents:j,agentsById:r})})]})]}),t.status==="let_go"?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"You let go of this. Take it back on from the menu to own it again."}):t.status==="dismissed"?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"You dismissed this when it was proposed. Take it back on from the menu if you do own it."}):null]}),(0,e.jsx)(Ya,{responsibility:t,agentsById:r,now:i,editable:p}),(0,e.jsxs)("section",{"aria-labelledby":"responsibility-work-summary-heading",className:"flex flex-col gap-3",children:[(0,e.jsx)(xe,{id:"responsibility-work-summary-heading",title:"Across the work",question:"What its projects, tasks and routines need, and what they are getting done."}),t.rollup.workSummary.length>0?(0,e.jsx)(Te,{signals:t.rollup.workSummary,renderAction:F,responsibilityHref:a(()=>"#responsibility-bar","responsibilityHref")}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing to report yet. Once projects, tasks or routines are filed here, what they need shows up here."})]}),d,(0,e.jsxs)("section",{"aria-labelledby":"responsibility-routines-heading",className:"flex flex-col gap-2",children:[(0,e.jsx)(xe,{id:"responsibility-routines-heading",title:"Routines",count:t.routines.length,question:"Tasks that repeat.",action:p?C("routine"):null}),t.routines.length>0?(0,e.jsx)("ul",{className:"flex flex-col",children:t.routines.map(u=>(0,e.jsx)(Se,{actions:(0,e.jsxs)(e.Fragment,{children:[u.status==="archived"?null:A({kind:"routine",id:u.id,label:u.title,currentAgentId:u.assigneeAgentId}),y(u.linkId,u.title,{routineId:u.id})]}),children:(0,e.jsx)(Ne,{className:"border-b-0",leading:(0,e.jsx)(Pt,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),title:u.title,to:jt(u.id),trailing:(0,e.jsx)(at,{status:u.status})})},u.id))}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No routines yet. A routine is work that repeats, like a weekly review. Add one you already have."})]}),(0,e.jsx)(Fn,{skills:t.skills,agentsById:r,addControl:p?C("skill"):null,removeControl:a(u=>y(u.linkId,u.name,{skillId:u.id}),"removeControl")}),(0,e.jsxs)("section",{"aria-labelledby":"responsibility-projects-heading",className:"flex flex-col gap-2",children:[(0,e.jsx)(xe,{id:"responsibility-projects-heading",title:"Projects",count:t.projects.length,question:"What groups of work move the number?",action:p?C("project"):null}),t.projects.length>0?(0,e.jsx)("ul",{className:"flex flex-col",children:t.projects.map(u=>{const S=ys(u.targetDate,i);return(0,e.jsx)(Se,{actions:(0,e.jsxs)(e.Fragment,{children:[A({kind:"project",id:u.id,label:u.name,currentAgentId:u.leadAgentId}),y(u.linkId,u.name,{projectId:u.id})]}),children:(0,e.jsx)(Ne,{className:"border-b-0",leading:(0,e.jsx)(fa,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),title:u.name,to:Ie(u),meta:S?(0,e.jsx)("span",{className:$("text-xs tabular-nums",S.late?"text-(--status-task-icon-blocked)":"text-muted-foreground"),children:S.late?`Late · ${S.label}`:`Due ${S.label}`}):null,trailing:(0,e.jsx)(at,{status:u.status})})},u.id)})}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No projects yet. A project groups the tasks that move this number, with a due date if it has one."})]}),(0,e.jsxs)("section",{"aria-labelledby":"responsibility-tasks-heading",className:"flex flex-col gap-2",children:[(0,e.jsx)(xe,{id:"responsibility-tasks-heading",title:"Tasks",count:t.rollup.openTasks,question:"Open work, done or not done.",action:p?C("task"):null}),f.blocked>0?(0,e.jsx)("p",{className:"text-sm text-(--status-task-icon-blocked)",children:f.blocked===1?"1 task is blocked.":`${f.blocked} tasks are blocked.`}):null,f.open.length>0?(0,e.jsx)("ul",{className:"flex flex-col",children:f.open.map(D)}):(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No open tasks. ",k?"Create one for an agent, or add a task you already have.":"Add a task you already have."]}),f.done.length>0?(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)(b,{size:"sm",variant:"ghost",className:"w-fit","aria-expanded":h,onClick:a(()=>m(u=>!u),"onClick"),children:[(0,e.jsx)(zt,{"aria-hidden":"true",className:$("transition-transform",!h&&"-rotate-90")}),h?"Hide":"Show"," ",f.done.length," done"]}),h?(0,e.jsx)("ul",{className:"flex flex-col",children:f.done.map(D)}):null]}):null,t.tasksTruncated?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",200," tasks. The counts include all of them."]}):null]}),(0,e.jsx)(Mn,{artifacts:t.artifacts,total:t.artifactsTotal,truncated:t.artifactsTruncated})]})}a(Ln,"ResponsibilityPageLayout");function zn({responsibility:t,now:s,className:n}){const{rollup:r}=t,l=r.metric,i=l?Rs(l):null;return(0,e.jsxs)(q,{id:"responsibility-score",elevation:"low",className:$("gap-6 px-6 py-6",n),children:[l&&i?(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:l.name}),(0,e.jsx)("p",{className:"flex flex-wrap items-baseline gap-x-2 tabular-nums",children:i.current?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-4xl font-semibold text-foreground",children:i.current}),(0,e.jsx)("span",{className:"text-lg text-muted-foreground",children:i.targetLabel})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-2xl font-semibold text-muted-foreground",children:"No reading yet"}),(0,e.jsx)("span",{className:"text-lg text-muted-foreground",children:i.targetLabel})]})}),(0,e.jsx)(Ns,{reading:i,health:r.health,label:`${l.name}, toward its bar`,className:"h-2"})]}):(0,e.jsx)("p",{className:"text-2xl font-semibold text-muted-foreground",children:"No number to track yet"}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(me,{health:r.health,overridden:r.healthOverridden}),l?.stale&&l.updatedAt?(0,e.jsx)(Me,{label:vt(l.updatedAt,s)}):null]}),(0,e.jsx)("p",{className:"text-sm text-foreground",children:r.statusSentence})]})]})}a(zn,"ScoreHero");function Ce({label:t,count:s}){return(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1 px-5 py-4","data-count":t.toLowerCase(),children:[(0,e.jsx)("dt",{className:"text-sm text-muted-foreground",children:t}),(0,e.jsx)("dd",{className:"text-2xl font-semibold tabular-nums text-foreground",children:s.value}),(0,e.jsx)("dd",{className:$("text-sm",s.alert?"text-(--status-task-icon-blocked)":"text-muted-foreground"),children:s.line})]})}a(Ce,"CountCell");function ut({label:t,value:s,children:n}){return(0,e.jsxs)(q,{elevation:"low",className:"min-w-0 gap-0.5 px-4 py-3","data-count":t.toLowerCase(),children:[(0,e.jsxs)("dt",{className:"flex items-baseline gap-2 text-sm text-muted-foreground",children:[t," ",(0,e.jsx)("span",{className:"font-semibold tabular-nums text-foreground",children:s})]}),(0,e.jsx)("dd",{className:"truncate text-xs text-muted-foreground",children:n})]})}a(ut,"CompactCount");function qn({responsibility:t,now:s,notices:n,onReviewProposal:r}){const l=(0,g.useMemo)(()=>Js(t),[t]),{skills:i,artifacts:c,artifactsTotal:d}=t,h=c[0]??null;return(0,e.jsx)("div",{className:"mx-auto flex w-full max-w-5xl flex-col","data-responsibility-view":"scorecard",children:(0,e.jsxs)("div",{className:"flex w-full max-w-3xl flex-col gap-6",children:[(0,e.jsx)(_e,{responsibility:t,children:n}),t.status==="proposed"?(0,e.jsx)(fe,{count:1,subject:"this",onReview:r}):null,(0,e.jsx)(zn,{responsibility:t,now:s}),(0,e.jsx)(q,{elevation:"low",className:"gap-0 py-0",children:(0,e.jsxs)("dl",{className:"grid grid-cols-1 divide-y divide-border sm:grid-cols-3 sm:divide-x sm:divide-y-0","aria-label":"The work",children:[(0,e.jsx)(Ce,{label:"Routines",count:l.routines}),(0,e.jsx)(Ce,{label:"Projects",count:l.projects}),(0,e.jsx)(Ce,{label:"Tasks",count:l.tasks})]})}),(0,e.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,e.jsxs)(ut,{label:"Skills",value:String(i.length),children:[i.length===0?"None yet":i.slice(0,3).map((m,x)=>(0,e.jsxs)(g.Fragment,{children:[x>0?", ":null,(0,e.jsx)(M,{to:He(m),className:"underline-offset-4 hover:text-foreground hover:underline",children:m.name})]},m.id)),i.length>3?` and ${i.length-3} more`:null]}),(0,e.jsx)(ut,{label:"Artifacts",value:d>=1e3?`${Ct.toLocaleString("en-US")}+`:d.toLocaleString("en-US"),children:h?(0,e.jsxs)(e.Fragment,{children:["Newest:"," ",(0,e.jsx)(M,{to:h.href,className:"underline-offset-4 hover:text-foreground hover:underline",children:h.title})]}):"None yet"})]})]})})}a(qn,"ResponsibilityScorecard");var xt="#responsibility-status";function On({responsibility:t,agentsById:s,now:n,notices:r,onReviewProposal:l}){const{rollup:i}=t,c=(0,g.useMemo)(()=>i.workSummary.filter(x=>x.tone==="attention"),[i.workSummary]),d=(0,g.useMemo)(()=>i.workSummary.filter(x=>x.tone!=="attention"),[i.workSummary]),h=(0,g.useMemo)(()=>ia(t,n),[t,n]),m=i.metric?.stale&&i.metric.updatedAt?vt(i.metric.updatedAt,n):null;return(0,e.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-8","data-responsibility-view":"moving",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)(_e,{responsibility:t,children:r}),(0,e.jsxs)("p",{id:"responsibility-status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,e.jsx)(me,{health:i.health,overridden:i.healthOverridden}),(0,e.jsx)("span",{className:"text-sm text-foreground",children:i.statusSentence}),m?(0,e.jsx)(Me,{label:m}):null]})]}),t.status==="proposed"?(0,e.jsx)(fe,{count:1,subject:"this",onReview:l}):null,(0,e.jsxs)("section",{"aria-labelledby":"moving-summary-heading",className:"flex flex-col gap-3",children:[(0,e.jsx)("h2",{id:"moving-summary-heading",className:"text-base font-semibold text-foreground",children:"What's moving"}),i.workSummary.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing to report yet. Once projects, tasks or routines are filed here, what they need shows up here."}):(0,e.jsxs)(q,{elevation:"low",className:"gap-5 px-5 py-4",children:[c.length>0?(0,e.jsxs)("div",{className:"flex flex-col gap-2","data-signal-group":"attention",children:[(0,e.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Needs attention"}),(0,e.jsx)(Te,{signals:c,responsibilityHref:a(()=>xt,"responsibilityHref")})]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Nothing in the work needs attention."}),d.length>0?(0,e.jsxs)("div",{className:"flex flex-col gap-2","data-signal-group":"moving",children:[(0,e.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Everything else"}),(0,e.jsx)(Te,{signals:d,responsibilityHref:a(()=>xt,"responsibilityHref")})]}):null]})]}),(0,e.jsxs)("section",{"aria-labelledby":"moving-work-heading",className:"flex flex-col gap-2",children:[(0,e.jsxs)("h2",{id:"moving-work-heading",className:"text-base font-semibold text-foreground",children:["The work ",(0,e.jsx)("span",{className:"text-sm font-normal tabular-nums text-muted-foreground",children:h.items.length})]}),h.items.length>0?(0,e.jsx)(q,{elevation:"low",className:"gap-0 overflow-hidden py-0",children:(0,e.jsx)("ul",{className:"flex flex-col divide-y divide-border",children:h.items.map(x=>(0,e.jsx)(Ls,{item:x},`${x.kind}:${x.id}`))})}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No open projects, tasks or routines are filed here."}),h.finished>0||t.tasksTruncated?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[h.finished>0?`${h.finished} finished ${h.finished===1?"item is":"items are"} not listed.`:null,h.finished>0&&t.tasksTruncated?" ":null,t.tasksTruncated?"Only the first 200 tasks are listed.":null]}):null]}),(0,e.jsx)(qs,{skills:t.skills,artifacts:t.artifacts,artifactsTotal:t.artifactsTotal,agentsById:s})]})}a(On,"ResponsibilityWhatsMoving");function Un(t,s){const n=V(),r=$t(),[l,i]=(0,g.useState)(null),c=Xs(s),d=Ws(s),h=[...R.responsibilities.detail(t.id),s,t.ownerUserId],m=a(()=>n.invalidateQueries({queryKey:R.responsibilities.all}),"refreshAll"),x=L({mutationFn:a(k=>_.update(t.id,k),"mutationFn"),onSuccess:a(k=>{n.setQueryData(h,p=>p&&{...p,...k}),m()},"onSuccess")}),f=L({mutationFn:a(()=>_.remove(t.id),"mutationFn"),onSuccess:a(()=>{n.removeQueries({queryKey:h}),n.invalidateQueries({queryKey:R.responsibilities.overviews(s)}),r("/responsibilities")},"onSuccess")}),j=L({mutationFn:a(k=>_.unlink(t.id,k.linkId),"mutationFn"),onSuccess:a((k,p)=>{i({label:p.label,relink:p.relink}),m()},"onSuccess")}),w=L({mutationFn:a(k=>_.link(t.id,k),"mutationFn"),onSuccess:a(()=>{i(null),m()},"onSuccess")});return{directory:c,areas:d.data??[],update:x,remove:f,unlink:j,relink:w,removed:l,navigate:r}}a(Un,"useResponsibilityPage");function Bn({responsibility:t,companyId:s}){const n=Un(t,s),{update:r,remove:l,unlink:i,relink:c,removed:d,navigate:h}=n,[m,x]=(0,g.useState)(null),[f,j]=(0,g.useState)(!1),{view:w,visiting:k,visit:p,leave:C}=la(Us,Os),y=(0,g.useMemo)(()=>new Date,[]),A=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(!A.current||w!=="full")return;A.current=!1;const v=requestAnimationFrame(()=>{const T=document.getElementById("responsibility-bar");T?.scrollIntoView?.({block:"start"}),T?.querySelector("button[data-bar-edit-primary]")?.click()});return()=>cancelAnimationFrame(v)},[w]);const F=a(()=>{A.current=!0,p("full")},"editBar"),D={saveTitle:a(v=>r.mutateAsync({title:v}),"saveTitle"),saveDescription:a(v=>r.mutateAsync({description:v}),"saveDescription"),setStatus:a(v=>r.mutate({status:v}),"setStatus"),requestDelete:a(()=>j(!0),"requestDelete"),newTask:x,unlink:a(v=>i.mutate(v),"unlink"),unlinkingId:i.isPending?i.variables?.linkId??null:null,onProposalReviewed:a(({dismissed:v})=>{v.length>0&&h("/responsibilities")},"onProposalReviewed")},u=(0,e.jsxs)(e.Fragment,{children:[r.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t save the change. ",E(r.error).body]}):null,d?(0,e.jsxs)("div",{role:"status",className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsxs)("span",{children:["Removed “",d.label,"” from this responsibility. It still exists, and stays under any other responsibility it is filed under."]}),(0,e.jsx)(b,{size:"xs",variant:"ghost",disabled:c.isPending,onClick:a(()=>c.mutate(d.relink),"onClick"),children:"Undo"})]}):null,i.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t remove it from this responsibility. ",E(i.error).body]}):null,c.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t put it back. ",E(c.error).body]}):null]}),S={responsibility:t,companyId:s,agents:n.directory.agents,agentsById:n.directory.byId,areas:n.areas,now:y,actions:D,notices:u},I={...S,onReviewProposal:a(()=>p("full"),"onReviewProposal"),onEditBar:t.status==="dismissed"?void 0:F};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[k?(0,e.jsx)("div",{className:"mx-auto flex w-full max-w-5xl justify-end",children:(0,e.jsx)(b,{variant:"ghost",onClick:C,"data-responsibility-back":"",children:"Back"})}):null,w==="scorecard"?(0,e.jsx)(qn,{...I}):w==="moving"?(0,e.jsx)(On,{...I}):w==="one_screen"?(0,e.jsx)(sn,{...I}):w==="one_screen_v2"?(0,e.jsx)(En,{...I}):(0,e.jsx)(Ln,{...S})]}),m?(0,e.jsx)(ea,{open:!0,onOpenChange:a(v=>{v||x(null)},"onOpenChange"),companyId:s,responsibility:{id:t.id,title:t.title},defaultTitle:m.defaultTitle,projectId:m.projectId??null}):null,(0,e.jsx)(Tt,{open:f,onOpenChange:j,children:(0,e.jsxs)(Rt,{children:[(0,e.jsxs)(At,{children:[(0,e.jsxs)(Ot,{children:["Delete ",t.title,"?"]}),(0,e.jsx)(St,{children:"This removes the responsibility, its bar and its number. The projects, tasks and routines filed under it stay. To stop owning it but keep its history, let it go instead."})]}),l.error?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t delete it. ",E(l.error).body]}):null,(0,e.jsxs)(yt,{className:"items-center sm:justify-between",children:[(0,e.jsx)(Ut,{children:"Keep it"}),(0,e.jsx)(b,{variant:"destructive",disabled:l.isPending,onClick:a(()=>l.mutate(),"onClick"),children:l.isPending?"Deleting…":"Delete responsibility"})]})]})})]})}a(Bn,"ResponsibilityView");function er(){const{responsibilityId:t}=Sa(),{selectedCompanyId:s}=pa(),{setBreadcrumbs:n}=Ia(),{userId:r}=ca(),l=z({queryKey:[...R.responsibilities.detail(t??"__none__"),s,r],queryFn:a(()=>_.get(t),"queryFn"),enabled:!!t&&!!s&&!!r}),i=l.data?.title;return(0,g.useEffect)(()=>{n([{label:"Dashboard",href:"/responsibilities"},...i?[{label:i}]:[]])},[n,i]),!s||!t?null:(0,e.jsx)(Aa,{query:l,size:"page",action:"load this responsibility",loading:(0,e.jsx)(Fa,{variant:"detail"}),notFound:(0,e.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col items-start gap-3 py-10",children:[(0,e.jsx)("h1",{className:"text-xl font-semibold text-foreground",children:"This responsibility is not available"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"It may have been deleted, or it belongs to someone else."}),(0,e.jsx)(b,{asChild:!0,variant:"outline",children:(0,e.jsx)(M,{to:"/responsibilities",children:"Back to the dashboard"})})]}),children:a(c=>c.companyId===s?(0,e.jsx)(Bn,{responsibility:c,companyId:s}):(0,e.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col items-start gap-3 py-10",children:[(0,e.jsx)("h1",{className:"text-xl font-semibold text-foreground",children:"This responsibility belongs to another organization"}),(0,e.jsx)(b,{asChild:!0,variant:"outline",children:(0,e.jsx)(M,{to:"/responsibilities",children:"Back to the dashboard"})})]}),"children")})}a(er,"ResponsibilityDetail");export{er as ResponsibilityDetail};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var n=(t,s)=>c(t,"name",{value:s,configurable:!0});import{a as x}from"./rolldown-runtime-DhZMWcEn.js";import{f as d}from"./issue-detail-4PCbYpdv.js";import{$A as m,E_ as u,zE as h}from"./index-Bt31d8ga.js";var e=x(m(),1);function a({title:t,description:s,children:o}){return(0,e.jsxs)("section",{className:"rounded-2xl border border-border/70 bg-background/85 p-5 shadow-sm",children:[(0,e.jsxs)("div",{className:"mb-4",children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground",children:t}),(0,e.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:s})]}),(0,e.jsx)("div",{className:"grid gap-4 lg:grid-cols-2",children:o})]})}n(a,"LabSection");function r({label:t,children:s}){return(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground",children:t}),(0,e.jsx)(u,{className:"block border-border/60 p-3",children:s})]})}n(r,"BeforeAfter");function l({onBehalfOf:t,denial:s}){return(0,e.jsxs)("article",{className:"space-y-1.5 rounded-lg border border-border/60 px-3 py-2 text-xs text-muted-foreground",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"Run"}),(0,e.jsx)("span",{className:"min-w-0 max-w-full truncate font-mono text-foreground",children:"a1b2c3d4"}),(0,e.jsx)("span",{children:"by CodexCoder"}),t?(0,e.jsxs)("span",{className:"min-w-0 max-w-full truncate text-muted-foreground",children:["on behalf of ",(0,e.jsx)("span",{className:"text-foreground",children:t})]}):null,(0,e.jsx)("span",{className:"rounded-md border border-border px-1.5 py-0.5 text-(length:--text-micro) capitalize text-muted-foreground",children:s?"Failed":"Succeeded"}),(0,e.jsx)("span",{className:"ml-auto shrink-0",children:"2m ago"})]}),(0,e.jsxs)("div",{className:"grid gap-2 text-xs text-muted-foreground sm:grid-cols-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"text-foreground",children:"Elapsed"})," 1m 4s"]}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"text-foreground",children:"Last useful action"})," 2m ago"]}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"text-foreground",children:"Stop"})," ",s?"Denied":"Completed"]})]}),s]})}n(l,"RunLedgerRow");function i({onBehalfOf:t,denial:s}){return(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-lg font-semibold text-foreground",children:"Run a1b2c3d4"}),(0,e.jsx)("span",{className:"rounded-md border border-border px-1.5 py-0.5 text-(length:--text-micro) capitalize text-muted-foreground",children:s?"failed":"succeeded"})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 font-mono text-(length:--text-micro) text-muted-foreground",children:[(0,e.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide",children:"codex local"}),(0,e.jsx)("span",{children:"anthropic/claude-opus-4-8"})]}),t?(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:["On behalf of ",(0,e.jsx)("span",{className:"text-foreground",children:t})]}):null,s]})}n(i,"RunDetailHeader");function b(){return(0,e.jsx)("div",{className:"min-h-screen bg-muted/20 p-6",children:(0,e.jsxs)("div",{className:"mx-auto max-w-5xl space-y-6",children:[(0,e.jsxs)("header",{children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-caps) text-muted-foreground",children:"PAP-12462 · P7"}),(0,e.jsx)("h1",{className:"mt-1 text-xl font-semibold text-foreground",children:'Run "on behalf of" surfacing + denial copy'}),(0,e.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Before/after of the two run surfaces and the four denial-related states."})]}),(0,e.jsxs)(a,{title:"1 · Run identity — “on behalf of {user}”",description:"A run acting for a human now names that user on both the issue run ledger and the run detail header.",children:[(0,e.jsx)(r,{label:"Before — run ledger",children:(0,e.jsx)(l,{})}),(0,e.jsx)(r,{label:"After — run ledger",children:(0,e.jsx)(l,{onBehalfOf:"Ada Lovelace"})}),(0,e.jsx)(r,{label:"Before — run detail",children:(0,e.jsx)(i,{})}),(0,e.jsx)(r,{label:"After — run detail",children:(0,e.jsx)(i,{onBehalfOf:"Ada Lovelace"})})]}),(0,e.jsxs)(a,{title:"2 · Denial state — responsible user not authorized",description:"The agent is allowed, but the user the run acts for is not. Distinct from a plain agent-lacks-permission failure.",children:[(0,e.jsx)(r,{label:"Before — generic failure text",children:(0,e.jsxs)("div",{className:"text-xs",children:[(0,e.jsx)("span",{className:"text-red-600 dark:text-red-400",children:"Forbidden: action not permitted"}),(0,e.jsx)("span",{className:"ml-1 text-muted-foreground",children:"(RESPONSIBLE_USER_UNAUTHORIZED)"})]})}),(0,e.jsx)(r,{label:"After — actionable denial copy",children:(0,e.jsx)(d,{code:"RESPONSIBLE_USER_UNAUTHORIZED",userName:"Ada Lovelace"})})]}),(0,e.jsxs)(a,{title:"3 · Denial state — agent lacks permission (unchanged)",description:"A denial that is NOT a responsible-user code keeps the existing generic error copy — no responsible-user notice.",children:[(0,e.jsx)(r,{label:"Agent-lacks-permission failure",children:(0,e.jsxs)("div",{className:"text-xs",children:[(0,e.jsx)("span",{className:"text-red-600 dark:text-red-400",children:"Forbidden: agent is not permitted to perform this action"}),(0,e.jsx)("span",{className:"ml-1 text-muted-foreground",children:"(deny_missing_membership)"})]})}),(0,e.jsx)(r,{label:"No responsible-user notice rendered",children:(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:"Responsible-user denial notice intentionally absent for non-responsible-user codes."})})]}),(0,e.jsxs)(a,{title:"4 · Denial state — responsible user unavailable",description:"The user this run acts for was removed or deactivated. Steers the agent to mark work blocked.",children:[(0,e.jsx)(r,{label:"Before — generic failure text",children:(0,e.jsxs)("div",{className:"text-xs",children:[(0,e.jsx)("span",{className:"text-red-600 dark:text-red-400",children:"Forbidden: responsible user unavailable"}),(0,e.jsx)("span",{className:"ml-1 text-muted-foreground",children:"(RESPONSIBLE_USER_UNAVAILABLE)"})]})}),(0,e.jsx)(r,{label:"After — actionable denial copy",children:(0,e.jsx)(d,{code:"RESPONSIBLE_USER_UNAVAILABLE",userName:"Grace Hopper"})})]}),(0,e.jsxs)(a,{title:"In-context — denial inside a failed run ledger row",description:"How the notice reads within a run row on the issue timeline.",children:[(0,e.jsx)(r,{label:"Unauthorized",children:(0,e.jsx)(l,{onBehalfOf:"Ada Lovelace",denial:(0,e.jsx)(d,{code:"RESPONSIBLE_USER_UNAUTHORIZED",userName:"Ada Lovelace"})})}),(0,e.jsx)(r,{label:"Unavailable",children:(0,e.jsx)(l,{onBehalfOf:"Grace Hopper",denial:(0,e.jsx)(d,{code:"RESPONSIBLE_USER_UNAVAILABLE",userName:"Grace Hopper"})})})]}),(0,e.jsxs)("p",{className:h("text-center text-(length:--text-micro) text-muted-foreground"),children:["Copy is sourced from the shared ",(0,e.jsx)("code",{children:"describeResponsibleUserDenial"})," contract."]})]})})}n(b,"ResponsibleUserDenialUxLab");export{b as ResponsibleUserDenialUxLab};