@hotmeshio/long-tail 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/dashboard/dist/assets/AdminDashboard-B_AVB7tk.js +2 -0
  2. package/dashboard/dist/assets/{AdminDashboard-Bx5G6Qb_.js.map → AdminDashboard-B_AVB7tk.js.map} +1 -1
  3. package/dashboard/dist/assets/{AgentConfigPage-S-YfPwCG.js → AgentConfigPage-JoZko3JB.js} +7 -7
  4. package/dashboard/dist/assets/{AgentConfigPage-S-YfPwCG.js.map → AgentConfigPage-JoZko3JB.js.map} +1 -1
  5. package/dashboard/dist/assets/{AgentDetailPage-pFVqLY4c.js → AgentDetailPage-DfpR2Fgg.js} +3 -3
  6. package/dashboard/dist/assets/{AgentDetailPage-pFVqLY4c.js.map → AgentDetailPage-DfpR2Fgg.js.map} +1 -1
  7. package/dashboard/dist/assets/AgentsPage-F2ixDk1Q.js +2 -0
  8. package/dashboard/dist/assets/{AgentsPage-DjAluFkM.js.map → AgentsPage-F2ixDk1Q.js.map} +1 -1
  9. package/dashboard/dist/assets/AvailableEscalationsPage-D-W4OP55.js +2 -0
  10. package/dashboard/dist/assets/AvailableEscalationsPage-D-W4OP55.js.map +1 -0
  11. package/dashboard/dist/assets/{BotPicker-h2YrxQS2.js → BotPicker-B8Yal8Mm.js} +2 -2
  12. package/dashboard/dist/assets/{BotPicker-h2YrxQS2.js.map → BotPicker-B8Yal8Mm.js.map} +1 -1
  13. package/dashboard/dist/assets/BulkAssignModal-ySfoaF7f.js +2 -0
  14. package/dashboard/dist/assets/{BulkAssignModal-CNKZBgK5.js.map → BulkAssignModal-ySfoaF7f.js.map} +1 -1
  15. package/dashboard/dist/assets/CapabilitiesPage-BSJ2oFj6.js +2 -0
  16. package/dashboard/dist/assets/{CapabilitiesPage-DGsnIiJi.js.map → CapabilitiesPage-BSJ2oFj6.js.map} +1 -1
  17. package/dashboard/dist/assets/{CollapsibleSection-ptEsXSl6.js → CollapsibleSection-CcV88IUy.js} +2 -2
  18. package/dashboard/dist/assets/{CollapsibleSection-ptEsXSl6.js.map → CollapsibleSection-CcV88IUy.js.map} +1 -1
  19. package/dashboard/dist/assets/CountdownTimer-C-E9MXMk.js +2 -0
  20. package/dashboard/dist/assets/{CountdownTimer-Cvif0QtN.js.map → CountdownTimer-C-E9MXMk.js.map} +1 -1
  21. package/dashboard/dist/assets/{CredentialsPage-CwKUAtAR.js → CredentialsPage-DrydlZ65.js} +2 -2
  22. package/dashboard/dist/assets/{CredentialsPage-CwKUAtAR.js.map → CredentialsPage-DrydlZ65.js.map} +1 -1
  23. package/dashboard/dist/assets/{CronLabel-B9RbqMR-.js → CronLabel-BxQmJXos.js} +2 -2
  24. package/dashboard/dist/assets/{CronLabel-B9RbqMR-.js.map → CronLabel-BxQmJXos.js.map} +1 -1
  25. package/dashboard/dist/assets/ElapsedCell-lszUXiyP.js +2 -0
  26. package/dashboard/dist/assets/{ElapsedCell-BirS3yZq.js.map → ElapsedCell-lszUXiyP.js.map} +1 -1
  27. package/dashboard/dist/assets/EntityTimelinePanel-CwzIV87U.js +2 -0
  28. package/dashboard/dist/assets/{EntityTimelinePanel-D3QNqDiL.js.map → EntityTimelinePanel-CwzIV87U.js.map} +1 -1
  29. package/dashboard/dist/assets/{EscalationListSchemaPage-Bke-30FY.js → EscalationListSchemaPage-D16uUVcG.js} +3 -3
  30. package/dashboard/dist/assets/{EscalationListSchemaPage-Bke-30FY.js.map → EscalationListSchemaPage-D16uUVcG.js.map} +1 -1
  31. package/dashboard/dist/assets/{EscalationSchemaPage-CTFE9vko.js → EscalationSchemaPage-BLM3dUEw.js} +3 -3
  32. package/dashboard/dist/assets/{EscalationSchemaPage-CTFE9vko.js.map → EscalationSchemaPage-BLM3dUEw.js.map} +1 -1
  33. package/dashboard/dist/assets/EscalationsOverview-BlFjoKlR.js +2 -0
  34. package/dashboard/dist/assets/{EscalationsOverview-C2FaSmXk.js.map → EscalationsOverview-BlFjoKlR.js.map} +1 -1
  35. package/dashboard/dist/assets/{EventTable-zFqzbEdC.js → EventTable-rTkMR8Zf.js} +2 -2
  36. package/dashboard/dist/assets/{EventTable-zFqzbEdC.js.map → EventTable-rTkMR8Zf.js.map} +1 -1
  37. package/dashboard/dist/assets/FilterBar-BeVBUdfJ.js +2 -0
  38. package/dashboard/dist/assets/FilterBar-BeVBUdfJ.js.map +1 -0
  39. package/dashboard/dist/assets/{GraphInvokePage-CA_XYI2W.js → GraphInvokePage-BV60xkVy.js} +2 -2
  40. package/dashboard/dist/assets/{GraphInvokePage-CA_XYI2W.js.map → GraphInvokePage-BV60xkVy.js.map} +1 -1
  41. package/dashboard/dist/assets/HomePage-BA0RYzFc.js +2 -0
  42. package/dashboard/dist/assets/HomePage-BA0RYzFc.js.map +1 -0
  43. package/dashboard/dist/assets/ListToolbar-4IfsUXfV.js +2 -0
  44. package/dashboard/dist/assets/{ListToolbar-BEogxu1f.js.map → ListToolbar-4IfsUXfV.js.map} +1 -1
  45. package/dashboard/dist/assets/{McpOverview-CdMR-5qh.js → McpOverview-gDegMXvF.js} +2 -2
  46. package/dashboard/dist/assets/{McpOverview-CdMR-5qh.js.map → McpOverview-gDegMXvF.js.map} +1 -1
  47. package/dashboard/dist/assets/{McpQueryDetailPage-BXo4UjJF.js → McpQueryDetailPage-CnCffPks.js} +4 -4
  48. package/dashboard/dist/assets/{McpQueryDetailPage-BXo4UjJF.js.map → McpQueryDetailPage-CnCffPks.js.map} +1 -1
  49. package/dashboard/dist/assets/McpQueryPage-CLEMtLOG.js +2 -0
  50. package/dashboard/dist/assets/{McpQueryPage-BvvM0Ya1.js.map → McpQueryPage-CLEMtLOG.js.map} +1 -1
  51. package/dashboard/dist/assets/McpRunDetailPage-tr-lrWVv.js +2 -0
  52. package/dashboard/dist/assets/McpRunDetailPage-tr-lrWVv.js.map +1 -0
  53. package/dashboard/dist/assets/McpRunsPage-nE0d_1Px.js +2 -0
  54. package/dashboard/dist/assets/McpRunsPage-nE0d_1Px.js.map +1 -0
  55. package/dashboard/dist/assets/OperationsPage-C8h1DN5Q.js +3 -0
  56. package/dashboard/dist/assets/OperationsPage-C8h1DN5Q.js.map +1 -0
  57. package/dashboard/dist/assets/OperatorDashboard-DCG8BFKE.js +2 -0
  58. package/dashboard/dist/assets/OperatorDashboard-DCG8BFKE.js.map +1 -0
  59. package/dashboard/dist/assets/{PersonaDetailPage-BHQ44UIu.js → PersonaDetailPage-BEVeJr1q.js} +2 -2
  60. package/dashboard/dist/assets/{PersonaDetailPage-BHQ44UIu.js.map → PersonaDetailPage-BEVeJr1q.js.map} +1 -1
  61. package/dashboard/dist/assets/PersonasPage-B5fj2AK6.js +2 -0
  62. package/dashboard/dist/assets/PersonasPage-B5fj2AK6.js.map +1 -0
  63. package/dashboard/dist/assets/ProcessDetailPage-CWGby6KD.js +2 -0
  64. package/dashboard/dist/assets/{ProcessDetailPage-CZ09xiWf.js.map → ProcessDetailPage-CWGby6KD.js.map} +1 -1
  65. package/dashboard/dist/assets/ProcessesListPage-nFdLMlfb.js +2 -0
  66. package/dashboard/dist/assets/ProcessesListPage-nFdLMlfb.js.map +1 -0
  67. package/dashboard/dist/assets/RoleDetailPage-OmOdRm1F.js +8 -0
  68. package/dashboard/dist/assets/{RoleDetailPage-CDsJKPvV.js.map → RoleDetailPage-OmOdRm1F.js.map} +1 -1
  69. package/dashboard/dist/assets/{RolesPage-D2cV92bL.js → RolesPage-DwprdPCA.js} +2 -2
  70. package/dashboard/dist/assets/{RolesPage-D2cV92bL.js.map → RolesPage-DwprdPCA.js.map} +1 -1
  71. package/dashboard/dist/assets/{RunAsSelector-Cvi8x8xx.js → RunAsSelector-DGw9EKSR.js} +2 -2
  72. package/dashboard/dist/assets/{RunAsSelector-Cvi8x8xx.js.map → RunAsSelector-DGw9EKSR.js.map} +1 -1
  73. package/dashboard/dist/assets/{ScanCodesPage-BWt_iRCu.js → ScanCodesPage-RPi4qZ_l.js} +2 -2
  74. package/dashboard/dist/assets/{ScanCodesPage-BWt_iRCu.js.map → ScanCodesPage-RPi4qZ_l.js.map} +1 -1
  75. package/dashboard/dist/assets/ScanSchemeDetailPage-BKc4lUjc.js +2 -0
  76. package/dashboard/dist/assets/{ScanSchemeDetailPage-C6mRYkxL.js.map → ScanSchemeDetailPage-BKc4lUjc.js.map} +1 -1
  77. package/dashboard/dist/assets/ScanStationPage-DUfxcntB.js +2 -0
  78. package/dashboard/dist/assets/{ScanStationPage-YQiijAKy.js.map → ScanStationPage-DUfxcntB.js.map} +1 -1
  79. package/dashboard/dist/assets/{StickyPagination-BsbSade1.js → StickyPagination-DXOk5z5X.js} +2 -2
  80. package/dashboard/dist/assets/{StickyPagination-BsbSade1.js.map → StickyPagination-DXOk5z5X.js.map} +1 -1
  81. package/dashboard/dist/assets/{StreamMessageDetail-jczXwuBw.js → StreamMessageDetail-BB1h2zZN.js} +2 -2
  82. package/dashboard/dist/assets/{StreamMessageDetail-jczXwuBw.js.map → StreamMessageDetail-BB1h2zZN.js.map} +1 -1
  83. package/dashboard/dist/assets/{SwimlaneTimeline-DSO6QXmX.js → SwimlaneTimeline-CapKokLg.js} +2 -2
  84. package/dashboard/dist/assets/{SwimlaneTimeline-DSO6QXmX.js.map → SwimlaneTimeline-CapKokLg.js.map} +1 -1
  85. package/dashboard/dist/assets/{TaskDetailPage-DWLfcAF4.js → TaskDetailPage-Dfzdp97x.js} +2 -2
  86. package/dashboard/dist/assets/{TaskDetailPage-DWLfcAF4.js.map → TaskDetailPage-Dfzdp97x.js.map} +1 -1
  87. package/dashboard/dist/assets/{TasksListPage-B0at3vJ3.js → TasksListPage-DxlS7PTD.js} +2 -2
  88. package/dashboard/dist/assets/{TasksListPage-B0at3vJ3.js.map → TasksListPage-DxlS7PTD.js.map} +1 -1
  89. package/dashboard/dist/assets/TimeAgo-Bv5viQ1m.js +2 -0
  90. package/dashboard/dist/assets/{TimeAgo-poxwErGl.js.map → TimeAgo-Bv5viQ1m.js.map} +1 -1
  91. package/dashboard/dist/assets/{TimestampCell-Be6tvFQd.js → TimestampCell-DXNBf_eb.js} +2 -2
  92. package/dashboard/dist/assets/{TimestampCell-Be6tvFQd.js.map → TimestampCell-DXNBf_eb.js.map} +1 -1
  93. package/dashboard/dist/assets/{ToolTestPanel-CYOqnqMz.js → ToolTestPanel-f32mir7Q.js} +2 -2
  94. package/dashboard/dist/assets/{ToolTestPanel-CYOqnqMz.js.map → ToolTestPanel-f32mir7Q.js.map} +1 -1
  95. package/dashboard/dist/assets/{TopicDetailPage-C82WIKaU.js → TopicDetailPage-D-N8Vsd4.js} +3 -3
  96. package/dashboard/dist/assets/{TopicDetailPage-C82WIKaU.js.map → TopicDetailPage-D-N8Vsd4.js.map} +1 -1
  97. package/dashboard/dist/assets/{TopicsPage-COH547ZD.js → TopicsPage-hqlu32wg.js} +2 -2
  98. package/dashboard/dist/assets/{TopicsPage-COH547ZD.js.map → TopicsPage-hqlu32wg.js.map} +1 -1
  99. package/dashboard/dist/assets/UserName-BhA_ItNN.js +2 -0
  100. package/dashboard/dist/assets/{UserName-D2SoVbe9.js.map → UserName-BhA_ItNN.js.map} +1 -1
  101. package/dashboard/dist/assets/WorkflowExecutionPage-BAgMKnhe.js +2 -0
  102. package/dashboard/dist/assets/{WorkflowExecutionPage-C82Q-TYC.js.map → WorkflowExecutionPage-BAgMKnhe.js.map} +1 -1
  103. package/dashboard/dist/assets/WorkflowsDashboard-B2wYT_hj.js +2 -0
  104. package/dashboard/dist/assets/WorkflowsDashboard-B2wYT_hj.js.map +1 -0
  105. package/dashboard/dist/assets/WorkflowsOverview--jC5F9lz.js +2 -0
  106. package/dashboard/dist/assets/{WorkflowsOverview-DdKRtWdK.js.map → WorkflowsOverview--jC5F9lz.js.map} +1 -1
  107. package/dashboard/dist/assets/{YamlWorkflowDetailPage-D3qvyy_4.js → YamlWorkflowDetailPage-BdB5eX8s.js} +2 -2
  108. package/dashboard/dist/assets/{YamlWorkflowDetailPage-D3qvyy_4.js.map → YamlWorkflowDetailPage-BdB5eX8s.js.map} +1 -1
  109. package/dashboard/dist/assets/{YamlWorkflowsPage-BJsxZOBC.js → YamlWorkflowsPage-BUQQU9II.js} +2 -2
  110. package/dashboard/dist/assets/{YamlWorkflowsPage-BJsxZOBC.js.map → YamlWorkflowsPage-BUQQU9II.js.map} +1 -1
  111. package/dashboard/dist/assets/{agents-OQHCkIfJ.js → agents-BF_S1J_z.js} +2 -2
  112. package/dashboard/dist/assets/{agents-OQHCkIfJ.js.map → agents-BF_S1J_z.js.map} +1 -1
  113. package/dashboard/dist/assets/{bots-e8jsNOf4.js → bots-CGlEoWAu.js} +2 -2
  114. package/dashboard/dist/assets/{bots-e8jsNOf4.js.map → bots-CGlEoWAu.js.map} +1 -1
  115. package/dashboard/dist/assets/capabilities-Pq8pG0kX.js +2 -0
  116. package/dashboard/dist/assets/{capabilities-CEo0AB79.js.map → capabilities-Pq8pG0kX.js.map} +1 -1
  117. package/dashboard/dist/assets/{controlplane-CD6ti-QB.js → controlplane-dY6a4iYT.js} +2 -2
  118. package/dashboard/dist/assets/{controlplane-CD6ti-QB.js.map → controlplane-dY6a4iYT.js.map} +1 -1
  119. package/dashboard/dist/assets/escalation-columns-CBUTda5U.js +2 -0
  120. package/dashboard/dist/assets/{escalation-columns-CUtDSbxl.js.map → escalation-columns-CBUTda5U.js.map} +1 -1
  121. package/dashboard/dist/assets/{index-Bf4IPu7I.js → index-BHfISWyn.js} +2 -2
  122. package/dashboard/dist/assets/{index-Bf4IPu7I.js.map → index-BHfISWyn.js.map} +1 -1
  123. package/dashboard/dist/assets/{index-BsP7vujM.js → index-BTksPQZe.js} +2 -2
  124. package/dashboard/dist/assets/{index-BsP7vujM.js.map → index-BTksPQZe.js.map} +1 -1
  125. package/dashboard/dist/assets/{index-B76fjEom.js → index-BWtW5puE.js} +2 -2
  126. package/dashboard/dist/assets/{index-B76fjEom.js.map → index-BWtW5puE.js.map} +1 -1
  127. package/dashboard/dist/assets/index-Bn-6MP9-.js +2 -0
  128. package/dashboard/dist/assets/index-Bn-6MP9-.js.map +1 -0
  129. package/dashboard/dist/assets/{index-C8VhbKFU.js → index-BrFGgfjR.js} +2 -2
  130. package/dashboard/dist/assets/index-BrFGgfjR.js.map +1 -0
  131. package/dashboard/dist/assets/{index-COUj4v_W.js → index-ByYeo8P7.js} +3 -3
  132. package/dashboard/dist/assets/{index-COUj4v_W.js.map → index-ByYeo8P7.js.map} +1 -1
  133. package/dashboard/dist/assets/{index-BpwkKV5f.js → index-CivQGQpu.js} +3 -3
  134. package/dashboard/dist/assets/{index-BpwkKV5f.js.map → index-CivQGQpu.js.map} +1 -1
  135. package/dashboard/dist/assets/{index-DIHr2CvI.js → index-CwQn-nhR.js} +2 -2
  136. package/dashboard/dist/assets/{index-DIHr2CvI.js.map → index-CwQn-nhR.js.map} +1 -1
  137. package/dashboard/dist/assets/index-D0bjzVum.js +2 -0
  138. package/dashboard/dist/assets/index-D0bjzVum.js.map +1 -0
  139. package/dashboard/dist/assets/{index-CTZEzzN3.js → index-D1KCPoRr.js} +2 -2
  140. package/dashboard/dist/assets/{index-CTZEzzN3.js.map → index-D1KCPoRr.js.map} +1 -1
  141. package/dashboard/dist/assets/index-D9rtK9QF.js +67 -0
  142. package/dashboard/dist/assets/index-D9rtK9QF.js.map +1 -0
  143. package/dashboard/dist/assets/{index-B0C6wSrQ.js → index-DrlZc3C0.js} +2 -2
  144. package/dashboard/dist/assets/{index-B0C6wSrQ.js.map → index-DrlZc3C0.js.map} +1 -1
  145. package/dashboard/dist/assets/index-U7HShN30.js +2 -0
  146. package/dashboard/dist/assets/{index-B2aiEKtM.js.map → index-U7HShN30.js.map} +1 -1
  147. package/dashboard/dist/assets/{knowledge-C89zT4Qe.js → knowledge-8_TilyaY.js} +2 -2
  148. package/dashboard/dist/assets/{knowledge-C89zT4Qe.js.map → knowledge-8_TilyaY.js.map} +1 -1
  149. package/dashboard/dist/assets/{mcp-BLKHykZS.js → mcp-hY3O2HJa.js} +2 -2
  150. package/dashboard/dist/assets/{mcp-BLKHykZS.js.map → mcp-hY3O2HJa.js.map} +1 -1
  151. package/dashboard/dist/assets/{mcp-query-CfiqUNDV.js → mcp-query-CA8NEf2e.js} +2 -2
  152. package/dashboard/dist/assets/{mcp-query-CfiqUNDV.js.map → mcp-query-CA8NEf2e.js.map} +1 -1
  153. package/dashboard/dist/assets/{personas-B1HzC94M.js → personas-DrWgQ94s.js} +2 -2
  154. package/dashboard/dist/assets/{personas-B1HzC94M.js.map → personas-DrWgQ94s.js.map} +1 -1
  155. package/dashboard/dist/assets/{pipelines-C73X50ES.js → pipelines-DdgSlafC.js} +2 -2
  156. package/dashboard/dist/assets/{pipelines-C73X50ES.js.map → pipelines-DdgSlafC.js.map} +1 -1
  157. package/dashboard/dist/assets/{tasks-DHbFpQk4.js → tasks-UyjER1TA.js} +2 -2
  158. package/dashboard/dist/assets/{tasks-DHbFpQk4.js.map → tasks-UyjER1TA.js.map} +1 -1
  159. package/dashboard/dist/assets/{topics-Fu8qCUOd.js → topics-CIc5SpT_.js} +2 -2
  160. package/dashboard/dist/assets/{topics-Fu8qCUOd.js.map → topics-CIc5SpT_.js.map} +1 -1
  161. package/dashboard/dist/assets/useDebouncedValue-CmUqBRK4.js +2 -0
  162. package/dashboard/dist/assets/useDebouncedValue-CmUqBRK4.js.map +1 -0
  163. package/dashboard/dist/assets/{useNamespace-CpO5Hogb.js → useNamespace-BOZOwXTE.js} +2 -2
  164. package/dashboard/dist/assets/{useNamespace-CpO5Hogb.js.map → useNamespace-BOZOwXTE.js.map} +1 -1
  165. package/dashboard/dist/assets/{useYamlActivityEvents-BwIl6_d2.js → useYamlActivityEvents-BsTpIsba.js} +2 -2
  166. package/dashboard/dist/assets/{useYamlActivityEvents-BwIl6_d2.js.map → useYamlActivityEvents-BsTpIsba.js.map} +1 -1
  167. package/dashboard/dist/assets/{workflows-DR9OQcuq.js → workflows-BkFI3IwE.js} +2 -2
  168. package/dashboard/dist/assets/{workflows-DR9OQcuq.js.map → workflows-BkFI3IwE.js.map} +1 -1
  169. package/dashboard/dist/assets/{yaml-workflows-DjEHh9Wy.js → yaml-workflows-CeeqNi9k.js} +2 -2
  170. package/dashboard/dist/assets/{yaml-workflows-DjEHh9Wy.js.map → yaml-workflows-CeeqNi9k.js.map} +1 -1
  171. package/dashboard/dist/index.html +1 -1
  172. package/docs/dashboard.md +18 -0
  173. package/package.json +1 -1
  174. package/dashboard/dist/assets/AdminDashboard-Bx5G6Qb_.js +0 -2
  175. package/dashboard/dist/assets/AgentsPage-DjAluFkM.js +0 -2
  176. package/dashboard/dist/assets/AvailableEscalationsPage-BHsRZk4v.js +0 -2
  177. package/dashboard/dist/assets/AvailableEscalationsPage-BHsRZk4v.js.map +0 -1
  178. package/dashboard/dist/assets/BulkAssignModal-CNKZBgK5.js +0 -2
  179. package/dashboard/dist/assets/CapabilitiesPage-DGsnIiJi.js +0 -2
  180. package/dashboard/dist/assets/CountdownTimer-Cvif0QtN.js +0 -2
  181. package/dashboard/dist/assets/ElapsedCell-BirS3yZq.js +0 -2
  182. package/dashboard/dist/assets/EntityTimelinePanel-D3QNqDiL.js +0 -2
  183. package/dashboard/dist/assets/EscalationsOverview-C2FaSmXk.js +0 -2
  184. package/dashboard/dist/assets/FilterBar-fwUqeM-5.js +0 -2
  185. package/dashboard/dist/assets/FilterBar-fwUqeM-5.js.map +0 -1
  186. package/dashboard/dist/assets/HomePage-C2HnqdFX.js +0 -2
  187. package/dashboard/dist/assets/HomePage-C2HnqdFX.js.map +0 -1
  188. package/dashboard/dist/assets/ListToolbar-BEogxu1f.js +0 -2
  189. package/dashboard/dist/assets/McpQueryPage-BvvM0Ya1.js +0 -2
  190. package/dashboard/dist/assets/McpRunDetailPage-5eaJeupC.js +0 -2
  191. package/dashboard/dist/assets/McpRunDetailPage-5eaJeupC.js.map +0 -1
  192. package/dashboard/dist/assets/McpRunsPage-B5_-3NUF.js +0 -2
  193. package/dashboard/dist/assets/McpRunsPage-B5_-3NUF.js.map +0 -1
  194. package/dashboard/dist/assets/OperationsPage-CJXTw02Z.js +0 -3
  195. package/dashboard/dist/assets/OperationsPage-CJXTw02Z.js.map +0 -1
  196. package/dashboard/dist/assets/OperatorDashboard-Dx7639os.js +0 -2
  197. package/dashboard/dist/assets/OperatorDashboard-Dx7639os.js.map +0 -1
  198. package/dashboard/dist/assets/PersonasPage-Cnmb4uox.js +0 -2
  199. package/dashboard/dist/assets/PersonasPage-Cnmb4uox.js.map +0 -1
  200. package/dashboard/dist/assets/ProcessDetailPage-CZ09xiWf.js +0 -2
  201. package/dashboard/dist/assets/ProcessesListPage-BT76_7bW.js +0 -2
  202. package/dashboard/dist/assets/ProcessesListPage-BT76_7bW.js.map +0 -1
  203. package/dashboard/dist/assets/RoleDetailPage-CDsJKPvV.js +0 -8
  204. package/dashboard/dist/assets/ScanSchemeDetailPage-C6mRYkxL.js +0 -2
  205. package/dashboard/dist/assets/ScanStationPage-YQiijAKy.js +0 -2
  206. package/dashboard/dist/assets/TimeAgo-poxwErGl.js +0 -2
  207. package/dashboard/dist/assets/UserName-D2SoVbe9.js +0 -2
  208. package/dashboard/dist/assets/WorkflowExecutionPage-C82Q-TYC.js +0 -2
  209. package/dashboard/dist/assets/WorkflowsDashboard-DDWwCT-v.js +0 -2
  210. package/dashboard/dist/assets/WorkflowsDashboard-DDWwCT-v.js.map +0 -1
  211. package/dashboard/dist/assets/WorkflowsOverview-DdKRtWdK.js +0 -2
  212. package/dashboard/dist/assets/capabilities-CEo0AB79.js +0 -2
  213. package/dashboard/dist/assets/escalation-columns-CUtDSbxl.js +0 -2
  214. package/dashboard/dist/assets/index-B2aiEKtM.js +0 -2
  215. package/dashboard/dist/assets/index-BYIN0l5M.js +0 -2
  216. package/dashboard/dist/assets/index-BYIN0l5M.js.map +0 -1
  217. package/dashboard/dist/assets/index-C8VhbKFU.js.map +0 -1
  218. package/dashboard/dist/assets/index-DSdqso-_.js +0 -67
  219. package/dashboard/dist/assets/index-DSdqso-_.js.map +0 -1
  220. package/dashboard/dist/assets/index-VsZyCFz8.js +0 -2
  221. package/dashboard/dist/assets/index-VsZyCFz8.js.map +0 -1
  222. package/dashboard/dist/assets/useDebouncedValue-C4P2jQuh.js +0 -2
  223. package/dashboard/dist/assets/useDebouncedValue-C4P2jQuh.js.map +0 -1
  224. package/dashboard/dist/assets/useEventHooks-DL3Vhz4g.js +0 -2
  225. package/dashboard/dist/assets/useEventHooks-DL3Vhz4g.js.map +0 -1
  226. package/dashboard/dist/assets/users-C0ke1Z-8.js +0 -2
  227. package/dashboard/dist/assets/users-C0ke1Z-8.js.map +0 -1
@@ -1,3 +0,0 @@
1
- import{a as h,j as e}from"./vendor-query-RUZdMvN6.js";import{U as te,m as $t,Y as tt,M as we,n as St,aB as st,I as qt,ae as Mt,v as Ct}from"./index-DSdqso-_.js";import{j as _t,i as Rt}from"./useEventHooks-DL3Vhz4g.js";import{s as Pe,a as he,u as B,b as ze,E as We,c as nt,i as Le,d as at}from"./EntityTimelinePanel-D3QNqDiL.js";import{aq as Pt,aY as Lt,at as rt,C as Et,s as Ge,ay as Ot,c as At,X as Bt,ax as Ft,an as It,aZ as Tt,E as Wt,a0 as Dt,ao as ot}from"./vendor-icons-h-jlRSb9.js";import{u as lt,f as it,L as le}from"./vendor-react-CdqEC2zv.js";import{P as Ut}from"./PageHeader-CFVw67M6.js";function zt({groups:t,colors:s}){const o=h.useMemo(()=>{const a=(t??[]).filter(n=>(n.dwellSeconds??0)>0),c=a.reduce((n,r)=>n+(r.dwellSeconds??0),0);return c?a.map(n=>({key:he(n.subtype),label:Pe(n.subtype),seconds:n.dwellSeconds??0,pct:(n.dwellSeconds??0)/c})).sort((n,r)=>r.seconds-n.seconds):null},[t]);if(!o)return e.jsx("span",{className:"text-2xs text-text-quaternary",children:"—"});const i=o.map(a=>`${a.label} ${te(a.seconds*1e3)} · ${Math.round(a.pct*100)}%`).join(`
2
- `);return e.jsxs("div",{className:"flex items-center gap-1.5",title:i,children:[e.jsx("div",{className:"w-16 h-1.5 bg-surface-sunken rounded-full overflow-hidden flex shrink-0",children:o.map(a=>e.jsx("div",{style:{width:`${a.pct*100}%`,backgroundColor:s.get(a.key)}},a.key))}),e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary tabular-nums",children:[Math.round(o[0].pct*100),"%"]})]})}function Ee(t){return t.reduce((s,o)=>s+(o.dwellSeconds??0),0)||1}function ct(t,s){const o=[];for(const i of t){const a=i.facets[s];a==null||(i.dwellSeconds??0)<=0||o.push(a)}return o}function dt(t,s,o,i){const a=new Map;for(const r of s){const d=r.facets[i];if(d==null||(r.dwellSeconds??0)<=0)continue;const u=a.get(d)??[];u.push(r),a.set(d,u)}const c=new Map;for(const r of o){const d=r.facets[i];d==null||(r.count??0)<=0||r.state==null||c.has(d)||c.set(d,r.state)}const n=[];for(const r of t){const d=r.facets[i];if(d==null||(r.dwellSeconds??0)<=0)continue;const u=[...a.get(d)??[]].sort((m,w)=>(w.dwellSeconds??0)-(m.dwellSeconds??0));n.push({value:d,groups:u,total:r.dwellSeconds??0,nowState:c.get(d)??null})}return n}function Gt(t,s,o=12){const i=new Map;for(const a of t){if((a.dwellSeconds??0)<=0)continue;const c=a.facets[s]??"no value",n=i.get(c)??[];n.push(a),i.set(c,n)}return[...i.entries()].map(([a,c])=>({value:a,groups:[...c].sort((n,r)=>(r.dwellSeconds??0)-(n.dwellSeconds??0)),total:Ee(c)})).sort((a,c)=>c.total-a.total).slice(0,o)}function Oe({groups:t,colors:s,height:o,className:i=""}){const a=Ee(t),c=new Map([...s.keys()].map((r,d)=>[r,d])),n=[...t].sort((r,d)=>(c.get(r.state??"—")??1/0)-(c.get(d.state??"—")??1/0));return e.jsx("div",{className:`${o} flex rounded-full overflow-hidden bg-surface-sunken ${i}`,children:n.map(r=>e.jsx("div",{title:`${r.state??"—"} · ${te((r.dwellSeconds??0)*1e3)}`,style:{width:`${(r.dwellSeconds??0)/a*100}%`,backgroundColor:s.get(r.state??"—")}},r.state??"—"))})}function xt({text:t,tail:s=6,className:o=""}){if(t.length<=s+1)return e.jsx("span",{className:`truncate ${o}`,title:t,children:t});const i=t.slice(0,t.length-s),a=t.slice(t.length-s);return e.jsxs("span",{className:`flex items-baseline min-w-0 ${o}`,title:t,children:[e.jsx("span",{className:"truncate min-w-0",children:i}),e.jsx("span",{className:"shrink-0",children:a})]})}const Ye=15,ut="grid grid-cols-[0.6rem_7rem_minmax(2rem,1fr)_1rem] items-center gap-2.5",Ht=[25,50,100],Yt=50;function Vt({facetKey:t,row:s,colors:o,stateLabel:i,onOpen:a}){const c=lt(),n=r=>{if(r.metaKey||r.ctrlKey){c($t(t,s.value));return}a(s.value)};return e.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:r=>{r.key==="Enter"&&n(r)},className:`${ut} text-2xs cursor-pointer group py-0.5`,children:[e.jsx("span",{className:"w-2 h-2 rounded-full justify-self-center",style:{backgroundColor:s.nowState?o.get(s.nowState):"transparent"},title:s.nowState?i(s.nowState):"no current state"}),e.jsx(xt,{text:s.value,className:"font-mono text-text-secondary group-hover:text-accent transition-colors"}),e.jsx(Oe,{groups:s.groups,colors:o,height:"h-1.5",className:"min-w-[2rem]"}),e.jsx("button",{className:"icon-link justify-self-center",title:`${te(s.total*1e3)} tracked · open timeline · ⌘-click row searches every queue`,onClick:r=>{r.stopPropagation(),a(s.value)},children:e.jsx(rt,{className:"w-3 h-3"})})]})}function mt({facetKey:t,sliced:s,header:o,rows:i,colors:a,stateLabel:c,onOpen:n,onTarget:r,hasMore:d,emptyText:u}){return e.jsxs("div",{className:s?"w-72 shrink-0":"flex-1 max-w-3xl",children:[o&&e.jsxs("button",{type:"button",onClick:()=>r==null?void 0:r(o.value),className:`${ut} w-full text-left mb-2 group`,children:[e.jsx("span",{"aria-hidden":!0}),e.jsx(xt,{text:o.value,className:"font-mono text-xs font-medium text-text-primary group-hover:text-accent transition-colors"}),e.jsx(Oe,{groups:o.groups,colors:a,height:"h-2.5",className:"min-w-[2rem]"}),e.jsx("span",{className:"icon-link justify-self-center",title:`${te(o.total*1e3)} total in ${o.value} — the band shows the state split`,children:e.jsx(Pt,{className:"w-3 h-3"})})]}),i.length===0?e.jsx("p",{className:"text-2xs text-text-quaternary",children:u??"No entities on this page."}):e.jsx("div",{className:"space-y-0.5",children:i.map(m=>e.jsx(Vt,{facetKey:t,row:m,colors:a,stateLabel:c,onOpen:n},m.value))}),d&&o&&r&&e.jsxs("button",{type:"button",onClick:()=>r(o.value),className:"mt-2 inline-flex items-center gap-1 text-2xs text-accent hover:text-accent-hover transition-colors",children:["More ",e.jsx(Lt,{className:"w-3 h-3"})]})]})}function Qt({entityKey:t,sliceKey:s,value:o,headerGroups:i,headerTotal:a,window:c,find:n,colors:r,stateLabel:d,onOpen:u,onTarget:m}){var C;const w={entity:t,equals:{[s]:o}},j=B({query:{...w,...n?{prefix:{[t]:n}}:{}},groupBy:{facets:[t]},measure:{kind:"dwell",window:c},orderBy:[{field:"dwellSeconds",direction:"desc"}],limit:Ye}),f=h.useMemo(()=>{var b;return ct(((b=j.data)==null?void 0:b.groups)??[],t)},[j.data,t]),q=f.map(b=>({[t]:b})),k=B(f.length?{query:{entity:t,anyOf:q},groupBy:{state:!0,facets:[t]},measure:{kind:"dwell",window:c},limit:Ye*4}:null),P=B(f.length?{query:{entity:t,anyOf:q},groupBy:{state:!0,facets:[t]},measure:{kind:"membership"}}:null),$=h.useMemo(()=>{var b,F,L;return dt(((b=j.data)==null?void 0:b.groups)??[],((F=k.data)==null?void 0:F.groups)??[],((L=P.data)==null?void 0:L.groups)??[],t)},[j.data,k.data,P.data,t]);return e.jsx(mt,{facetKey:t,sliced:!0,header:{value:o,groups:i,total:a},rows:$,colors:r,stateLabel:d,onOpen:u,onTarget:m,hasMore:((C=j.data)==null?void 0:C.overflow)??!1})}function Zt({facetKey:t,rows:s,colors:o,stateLabel:i,onOpen:a,emptyText:c}){return e.jsx(mt,{facetKey:t,sliced:!1,rows:s,colors:o,stateLabel:i,onOpen:a,emptyText:c})}const Se="entity-timeline",Xt=300,Ie=12;function Jt({entityKey:t,periodHours:s,roles:o,find:i,onFindChange:a,entityValue:c,onEntityChange:n,sliceKey:r=null,onSliceKeyChange:d,sliceValue:u=null,onSliceValueChange:m}){var pe,ke,$e,K,He;const w=ze(s),j=tt(),f=r??"",q=!!f,k=q&&!!u,P=q&&!u,[$,C]=h.useState(0),[b,F]=h.useState(Yt);h.useEffect(()=>{C(0)},[i,w.from,w.to,t,f,u,b]);const[L,v]=h.useState(i??""),E=h.useRef(void 0);h.useEffect(()=>()=>clearTimeout(E.current),[]),h.useEffect(()=>{v(i??"")},[i]);const Y=p=>{v(p),clearTimeout(E.current),E.current=setTimeout(()=>{const M=p.trim();a(M||null)},Xt)},g=h.useMemo(()=>{const p=new Map;for(const M of o)p.set(M.role,we(M));return p},[o]),_=p=>p==null?"—":g.get(p)??p,z=B({query:{entity:t},groupBy:{state:!0},measure:{kind:"dwell",window:w},orderBy:[{field:"dwellSeconds",direction:"desc"}]}),G=B({query:{entity:t},groupBy:{state:!0},measure:{kind:"membership"}}),fe=B({query:{entity:t},groupBy:{},measure:{kind:"membership"},distinctBy:t}),T=B(q?{query:{entity:t},groupBy:{state:!0,facets:[f]},measure:{kind:"dwell",window:w},limit:200}:null),R=B(!P?{query:{entity:t,...k?{equals:{[f]:u}}:{},...i?{prefix:{[t]:i}}:{}},groupBy:{facets:[t]},measure:{kind:"dwell",window:w},orderBy:[{field:"dwellSeconds",direction:"desc"}],limit:b,offset:$*b}:null),se=h.useMemo(()=>{var p;return ct(((p=R==null?void 0:R.data)==null?void 0:p.groups)??[],t)},[R==null?void 0:R.data,t]),X=se.length?{entity:t,anyOf:se.map(p=>({[t]:p}))}:null,xe=B(X?{query:X,groupBy:{state:!0,facets:[t]},measure:{kind:"dwell",window:w},limit:b*10}:null),ne=B(X?{query:X,groupBy:{state:!0,facets:[t]},measure:{kind:"membership"}}:null),ue=h.useMemo(()=>{var p,M,Z;return dt(((p=R==null?void 0:R.data)==null?void 0:p.groups)??[],((M=xe.data)==null?void 0:M.groups)??[],((Z=ne.data)==null?void 0:Z.groups)??[],t)},[R==null?void 0:R.data,xe.data,ne.data,t]),V=h.useRef(()=>{}),l=h.useRef(p=>V.current(p)).current,S=h.useRef(null),O=h.useRef(!1);h.useEffect(()=>{j&&c!==S.current&&(S.current=c,c?j.setPanel(e.jsx(We,{facetKey:t,value:c,entity:t,intervalColor:l}),{key:Se,width:420}):(O.current=!1,j.closePanel(Se)))},[c,t,j]),h.useEffect(()=>{if(!(!j||!c)){if(j.open&&j.ownerKey===Se){O.current=!0;return}O.current&&(O.current=!1,n(null))}},[j,c,n]);const U=h.useRef(j);U.current=j,h.useEffect(()=>()=>{var p;S.current&&((p=U.current)==null||p.closePanel(Se))},[]);const{data:A}=St(),J=h.useMemo(()=>((A==null?void 0:A.keys)??[]).filter(p=>p!==t),[A,t]),W=(((pe=z.data)==null?void 0:pe.groups)??[]).filter(p=>(p.dwellSeconds??0)>0),D=h.useMemo(()=>{var p;return nt([...W,...((p=G.data)==null?void 0:p.groups)??[]].map(M=>({label:M.state??"—",weight:M.dwellSeconds??M.count??0})))},[W,G.data]),ae=new Map((((ke=G.data)==null?void 0:ke.groups)??[]).map(p=>[p.state??"—",p.count??0])),me=((K=($e=fe.data)==null?void 0:$e.groups[0])==null?void 0:K.count)??null,ye=h.useMemo(()=>new Set(o.filter(p=>p.entity_state_source==="subtype").map(p=>p.role)),[o]);V.current=p=>{const M=ye.has(p.role)?p.subtype??p.role:p.role;return D.get(M)};const re=h.useMemo(()=>{var p;return q?Gt(((p=T.data)==null?void 0:p.groups)??[],f,Ie):[]},[q,T.data,f]),Q=h.useMemo(()=>{var M;const p=new Set;for(const Z of((M=T.data)==null?void 0:M.groups)??[])(Z.dwellSeconds??0)>0&&Z.facets[f]!=null&&p.add(Z.facets[f]);return p.size},[T.data,f]),ve=h.useMemo(()=>{var M;if(!k)return{groups:[],total:0};const p=(((M=T.data)==null?void 0:M.groups)??[]).filter(Z=>Z.facets[f]===u);return{groups:p,total:Ee(p)}},[k,T.data,f,u]),x=((He=R==null?void 0:R.data)==null?void 0:He.overflow)??!1,N=Le(R==null?void 0:R.error),y=q&&Le(T.error);return e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-2 pt-4 pb-3 flex items-start gap-6 border-b border-surface-border/40",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4 mb-2.5",children:[e.jsxs("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:["Where the time went · ",e.jsx("span",{className:"normal-case font-mono",children:t})," system"]}),me!=null&&e.jsxs("p",{className:"text-2xs text-text-quaternary whitespace-nowrap",children:[e.jsx("span",{className:"text-xs font-mono font-semibold text-text-primary tabular-nums",children:me})," ",e.jsx("span",{className:"font-mono",children:t})," in queue now"]})]}),W.length>0?e.jsxs(e.Fragment,{children:[e.jsx(Oe,{groups:W,colors:D,height:"h-3"}),e.jsx("div",{className:"flex flex-wrap gap-x-5 gap-y-1 mt-2.5",children:W.map(p=>{const M=ae.get(p.state??"—")??0,Z=Math.round((p.dwellSeconds??0)/Ee(W)*100),kt=`${te((p.dwellSeconds??0)*1e3)} · ${Z}%${M>0?` · ${M} now`:""}`;return e.jsxs("span",{className:"flex items-center gap-1.5 text-2xs",title:kt,children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:D.get(p.state??"—")}}),e.jsx("span",{className:"font-mono text-text-secondary",children:_(p.state)})]},p.state)})})]}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No tracked time in this window."})]}),e.jsxs("div",{className:"shrink-0 w-56 space-y-2.5",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Slice by"}),e.jsxs("select",{value:f,onChange:p=>d==null?void 0:d(p.target.value||null),className:"select text-xs font-mono w-full",children:[e.jsx("option",{value:"",children:"— none —"}),J.map(p=>e.jsx("option",{value:p,children:p},p))]})]}),e.jsx("input",{type:"text",value:L,onChange:p=>Y(p.target.value),placeholder:`Find by ${t}…`,"aria-label":`Find by ${t}`,className:"w-full bg-transparent border-b border-surface-border/60 focus:border-accent focus:outline-none text-xs font-mono text-text-primary placeholder:text-text-quaternary pb-0.5 transition-colors"})]})]}),k&&e.jsxs("div",{className:"shrink-0 px-2 pt-3 flex items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>m==null?void 0:m(null),className:"inline-flex items-center gap-1 text-2xs text-accent hover:text-accent-hover transition-colors shrink-0",children:[e.jsx(Et,{className:"w-3 h-3"})," all ",f]}),e.jsx("span",{className:"font-mono text-xs text-text-primary shrink-0",children:u}),e.jsx(Oe,{groups:ve.groups,colors:D,height:"h-2",className:"flex-1 max-w-md"}),e.jsx("span",{className:"font-mono tabular-nums text-2xs text-text-tertiary shrink-0",children:te(ve.total*1e3)})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-2 py-4",children:P?y?e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Slicing requires full read access to the system's queues."}):re.length===0?e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No tracked time for this slice in the window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex gap-6 min-w-max",children:re.map(p=>e.jsx(Qt,{entityKey:t,sliceKey:f,value:p.value,headerGroups:p.groups,headerTotal:p.total,window:w,find:i,colors:D,stateLabel:_,onOpen:n,onTarget:M=>m==null?void 0:m(M)},p.value))}),Q>Ie&&e.jsxs("p",{className:"text-2xs text-text-quaternary pt-4",children:["Showing the top ",Ie," of ",Q," ",e.jsx("span",{className:"font-mono",children:f})," values — a facet this wide isn't a good slice dimension."]})]}):N?e.jsx("p",{className:"text-2xs text-text-quaternary",children:"The per-entity view requires full read access to the system's queues."}):e.jsx(Zt,{facetKey:t,rows:ue,colors:D,stateLabel:_,onOpen:n,emptyText:i?`No ${t} starts with “${i}” in this window.`:"No entities tracked in this window."})}),!P&&e.jsxs("div",{className:"shrink-0 border-t border-surface-border bg-surface/95 px-2 pt-2 pb-3 flex items-center gap-3 text-2xs",children:[e.jsx("button",{disabled:$===0,onClick:()=>C($-1),className:"text-text-tertiary hover:text-accent transition-colors disabled:opacity-40 disabled:hover:text-text-tertiary",children:"Prev"}),e.jsxs("span",{className:"font-mono tabular-nums text-text-quaternary",children:["page ",$+1]}),e.jsx("button",{disabled:!x,onClick:()=>C($+1),className:"text-text-tertiary hover:text-accent transition-colors disabled:opacity-40 disabled:hover:text-text-tertiary",children:"Next"}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-text-quaternary",children:[e.jsx("span",{children:"per page"}),e.jsx("select",{value:b,onChange:p=>F(Number(p.target.value)),"aria-label":"Results per page",className:"select text-2xs font-mono py-0.5",children:Ht.map(p=>e.jsx("option",{value:p,children:p},p))})]})]})]})}function Kt({lenses:t,activeLens:s,stationCount:o,onSelect:i}){const[a,c]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{if(!a)return;const d=m=>{n.current&&!n.current.contains(m.target)&&c(!1)},u=m=>{m.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",d),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",u)}},[a]);const r=d=>{i(d),c(!1)};return e.jsxs("div",{ref:n,className:"relative",title:"View: the board station-first, or an entity system (roles sharing an entity facet) entity-first",children:[e.jsxs("button",{type:"button",onClick:()=>c(d=>!d),className:"group flex items-baseline gap-1.5","aria-expanded":a,"aria-haspopup":"listbox","aria-label":"Board view",children:[e.jsx("span",{className:"text-2xs uppercase tracking-widest text-text-quaternary",children:"View"}),e.jsx("span",{className:"text-xs font-medium text-text-primary group-hover:text-accent transition-colors",children:s?e.jsxs(e.Fragment,{children:["by ",e.jsx("span",{className:"font-mono",children:s})]}):"Stations"}),e.jsx(Ge,{className:`w-3 h-3 self-center shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${a?"rotate-180":""}`,strokeWidth:1.5})]}),a&&e.jsxs("div",{role:"listbox",className:"absolute z-[100] top-full right-0 mt-1.5 min-w-[16rem] max-h-80 overflow-y-auto bg-surface-raised border border-surface-border rounded-md shadow-lg py-1",children:[e.jsx(pt,{label:"Stations",note:`${o} station${o===1?"":"s"}`,active:s===null,onClick:()=>r(null)}),t.map(d=>e.jsx(es,{lens:d,active:s===d,fetchCount:a,onClick:()=>r(d)},d))]})]})}function pt({label:t,note:s,active:o,onClick:i,mono:a}){return e.jsxs("button",{type:"button",role:"option","aria-selected":o,onClick:i,className:`w-full text-left px-3 py-1.5 flex items-baseline gap-2.5 transition-colors ${o?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`,children:[e.jsx("span",{className:`text-xs font-medium truncate ${a?"font-mono":""}`,children:t}),s&&e.jsx("span",{className:"ml-auto text-2xs font-mono text-text-quaternary tabular-nums shrink-0",children:s})]})}function es({lens:t,active:s,fetchCount:o,onClick:i}){var n,r;const c=(r=(n=B({query:{entity:t},groupBy:{},measure:{kind:"membership"},distinctBy:t},{enabled:o}).data)==null?void 0:n.groups[0])==null?void 0:r.count;return e.jsx(pt,{label:`by ${t}`,mono:!0,note:c!=null?`${c} in queue`:null,active:s,onClick:i})}const ht=800,ft=270,ie=28,ts=60,Ae=24,ss=72,Re=ht-ie-ts,De=ft-Ae-ss,H=Ae+De,Te=ie+Re,I="0.5s cubic-bezier(0.4, 0, 0.2, 1)",Ve=9;function ns(t){return`M ${(t.x-Ve).toFixed(1)} ${t.y.toFixed(1)} L ${(t.x+Ve).toFixed(1)} ${t.y.toFixed(1)}`}function ge(t){if(t.length===0)return"";if(t.length===1)return ns(t[0]);const s=[];for(let o=0;o<t.length-1;o++){const i=t[Math.max(0,o-1)],a=t[o],c=t[o+1],n=t[Math.min(t.length-1,o+2)],r=(a.x+(c.x-i.x)/6).toFixed(1),d=(a.y+(c.y-i.y)/6).toFixed(1),u=(c.x-(n.x-a.x)/6).toFixed(1),m=(c.y-(n.y-a.y)/6).toFixed(1);o===0&&s.push(`M ${a.x.toFixed(1)} ${a.y.toFixed(1)}`),s.push(`C ${r} ${d}, ${u} ${m}, ${c.x.toFixed(1)} ${c.y.toFixed(1)}`)}return s.join(" ")}function as(t,s){if(t.length<2||s.length<2)return"";const o=ge(t),i=[...s].reverse(),a=ge(i),c=a.slice(a.indexOf("C"));return`${o} L ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)} ${c} Z`}function Qe(t){return t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function qe(t){return t.length>0?t[t.length-1]:void 0}function rs(t){return[1,2,5,10,20,50,100,200,500,1e3,2e3,5e3,1e4,2e4,5e4].filter(o=>o>0&&o<t*.98)}function os(t){return[.25,.5,.75].map(o=>Math.round(o*t)).filter(o=>o>0)}const ce="rgb(var(--lt-status-claimed-graphic))",je="rgb(var(--lt-status-queued-graphic))",ee="rgb(var(--lt-status-success-graphic))",de="rgb(var(--lt-text-quaternary))",be="rgb(var(--lt-status-error))";function Be(t,s){return t.replace(/\)$/,` / ${s})`)}const ls=13;function is(t,s){const o=[...t].sort((n,r)=>n.y-r.y);let i=-1/0;const a=o.map(n=>{const r=Math.max(n.y+3,i+ls);return i=r,{...n,labelY:r}}),c=a.length>0?a[a.length-1].labelY-s:0;if(c>0)for(const n of a)n.labelY-=c;return a}function cs({stations:t,selectedRole:s,onSelect:o,onUpstreamSelect:i,onCmdClick:a,periodHours:c,logScale:n=!1,fill:r=!1}){const[d,u]=h.useState(null),m=t.length;if(m===0)return null;const w=l=>m===1?ie+Re/2:ie+l/(m-1)*Re,j=new Map(t.map((l,S)=>[l.role,w(S)])),f=t.map((l,S)=>{var A,J,W,D;const O=l.target_per_hour??null,U=O!=null?O*c:null;return{idx:S,x:w(S),expected:U,actual:((A=l.metric)==null?void 0:A.resolved)??0,active:((J=l.metric)==null?void 0:J.claimed)??0,pending:((W=l.metric)==null?void 0:W.pending)??0,priorityCount:((D=l.metric)==null?void 0:D.priority_count)??0}}),q=f.some(l=>l.expected!=null),P=Math.max(1,...f.map(l=>l.expected??0),...f.map(l=>l.actual),...f.map(l=>l.expected!=null?l.pending:0))*1.15,$=n?l=>{const S=Math.log(1+P);return Ae+De*(1-Math.log(1+Math.max(0,l))/S)}:l=>Ae+De*(1-Math.max(0,Math.min(l,P))/P),C=n?rs(P):os(P),b=f.filter(l=>l.expected!=null),F=b.map(l=>({...l,y:$(l.expected)})),L=b.map(l=>({...l,y:$(l.actual)})),v=b.map(l=>({...l,y:$(l.active)})),E=b.map(l=>({...l,y:$(l.pending)})),Y=ge(F),g=ge(L),_=ge(v),z=ge(E),G=qe(L),fe=qe(F),T=qe(v),Ne=qe(E),R=L.length>=2&&G?`${g} L ${G.x.toFixed(1)} ${H} L ${L[0].x.toFixed(1)} ${H} Z`:"",se=b.some(l=>l.pending>0||l.active>0),X=se&&v.length>=2&&T?`${_} L ${T.x.toFixed(1)} ${H} L ${v[0].x.toFixed(1)} ${H} Z`:"",xe=se?as(E,v):"",ne=b.some(l=>l.active>0),ue=b.some(l=>l.pending>l.active),V=is([fe?{key:"target",text:"Target",color:de,y:fe.y}:null,G?{key:"actual",text:"Resolved",color:ee,y:G.y}:null,ne&&T?{key:"active",text:"Claimed",color:ce,y:T.y}:null,ue&&Ne?{key:"queued",text:"Pending",color:je,y:Ne.y}:null].filter(Boolean),H+4);return e.jsxs("svg",{viewBox:`0 0 ${ht} ${ft}`,className:r?"w-full h-full":"w-full",preserveAspectRatio:"xMidYMid meet",style:{display:"block",...r?{}:{height:"auto"}},children:[C.map(l=>{const S=$(l);return e.jsxs("g",{children:[e.jsx("line",{x1:ie,y1:S,x2:Te,y2:S,className:"stroke-surface-border",strokeWidth:.5,opacity:n?.45:.3,strokeDasharray:n?"2 5":void 0,style:{transition:`y1 ${I}, y2 ${I}`}}),e.jsx("text",{x:ie-4,y:S+2.5,textAnchor:"end",fontSize:6,fontFamily:"ui-monospace, monospace",opacity:.35,className:"fill-text-quaternary",children:Qe(l)})]},`grid-${l}`)}),t.map(l=>{if(!l.parent_role)return null;const S=j.get(l.parent_role);if(S==null)return null;const O=w(t.findIndex(U=>U.role===l.role));return e.jsx("line",{x1:S,y1:H,x2:O,y2:H,className:"stroke-surface-border",strokeWidth:.75},`dep-${l.role}`)}),R&&e.jsx("path",{d:R,opacity:.05,style:{fill:ee,transition:`d ${I}`}}),X&&e.jsx("path",{d:X,opacity:.12,style:{fill:ce,transition:`d ${I}`}}),xe&&e.jsx("path",{d:xe,opacity:.12,style:{fill:je,transition:`d ${I}`}}),Y&&e.jsx("path",{d:Y,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.7,style:{stroke:de,transition:`d ${I}`}}),F.map(l=>e.jsxs("g",{transform:`translate(${l.x} ${l.y})`,style:{transition:`transform ${I}`},children:[e.jsx("circle",{r:2,opacity:.8,style:{fill:de}}),e.jsx("text",{y:-5,textAnchor:"middle",fontSize:6.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",opacity:.7,style:{fill:de},children:Math.round(l.expected)})]},`tval-${l.idx}`)),se&&z&&e.jsx("path",{d:z,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.55,style:{stroke:je,transition:`d ${I}`}}),_&&e.jsx("path",{d:_,fill:"none",strokeWidth:.75,strokeDasharray:"2 3",strokeLinecap:"round",opacity:.5,style:{stroke:ce,transition:`d ${I}`}}),g&&e.jsx("path",{d:g,fill:"none",strokeWidth:.6,strokeLinejoin:"round",strokeLinecap:"round",opacity:.65,style:{stroke:ee,transition:`d ${I}`}}),v.map((l,S)=>{if(l.pending<=0&&l.active<=0)return null;const O=Math.max(2.5,Math.min(5,2.5+l.active/10)),U=l.pending>l.active,A=Math.min(E[S].y-4,l.y-O-4);return e.jsxs("g",{children:[l.pending>0&&e.jsx("text",{x:l.x,y:A,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:U?je:"rgb(var(--lt-text-tertiary))",transition:`y ${I}`},children:l.pending}),e.jsxs("g",{transform:`translate(${l.x} ${l.y})`,style:{transition:`transform ${I}`},children:[e.jsx("circle",{r:O,opacity:.85,style:{fill:ce}}),l.active>0&&e.jsx("text",{y:O+9,textAnchor:"middle",fontSize:7.5,fontFamily:"ui-monospace, monospace",fontWeight:"600",style:{fill:ce},children:l.active})]})]},`active-${l.idx}`)}),f.map(l=>{var re;const S=t[l.idx],O=l.x,U=l.expected!=null?$(l.actual):H,A=Math.max(2.25,Math.min(4,2.25+l.actual/160)),J=S.role===s,W=d===l.idx,D=l.expected==null?"idle · set a target rate to plot pace":`${l.actual} resolved · target ${Math.round(l.expected)}`+(l.pending>l.active?` · ${l.pending-l.active} pending`:"")+(l.active>0?` · ${l.active} claimed`:"")+(l.priorityCount>0?` · ${l.priorityCount} in jeopardy`:""),ae=D.length*5.5+20,me=Math.max(ie+ae/2+4,Math.min(Te-ae/2-4,O)),ye=U-A-10;return e.jsxs("g",{onClick:Q=>{Q.metaKey||Q.ctrlKey?(Q.stopPropagation(),a==null||a(S.role)):o(S.role)},onMouseEnter:()=>u(l.idx),onMouseLeave:()=>u(null),style:{cursor:"pointer"},children:[e.jsxs("g",{transform:`translate(${O} ${U})`,style:{transition:`transform ${I}`},children:[e.jsx("circle",{r:22,fill:"transparent"}),e.jsx("circle",{r:A,opacity:.9,style:{fill:ee,transition:`r ${I}`}}),l.expected!=null&&e.jsx("text",{y:-A-5,textAnchor:"middle",fontSize:9.5,fontFamily:"ui-monospace, monospace",fontWeight:"500",style:{fill:ee},children:Qe(l.actual)}),W&&!J&&e.jsx("circle",{r:A+3,fill:"none",strokeWidth:1,opacity:.4,style:{stroke:ee}}),J&&e.jsx("circle",{r:A+4,fill:"none",className:"stroke-accent",strokeWidth:2})]}),(((re=S.upstream_roles)==null?void 0:re.length)??0)>0&&e.jsxs("g",{transform:`translate(${O-20} ${H})`,onClick:Q=>{Q.stopPropagation(),i==null||i(S.upstream_roles[0])},style:{cursor:"pointer"},children:[e.jsx("title",{children:`Fed by ${S.upstream_roles.join(", ")} — click to view that sequence`}),e.jsx("circle",{r:9,cy:-6,fill:"transparent"}),e.jsx("path",{d:"M -7 -14 C -3 -14 -1 -9 0 -2",fill:"none",className:"stroke-text-quaternary",strokeWidth:1,strokeDasharray:"2 2",strokeLinecap:"round"}),e.jsx("path",{d:"M 0 -2 L 8 -2",className:"stroke-text-quaternary",strokeWidth:1,strokeLinecap:"round"}),e.jsx("path",{d:"M 8 -2 l -3.5 -2 v 4 z",className:"fill-text-quaternary"})]}),e.jsx("text",{x:O,y:H+(l.idx%2===0?14:27),textAnchor:"middle",fontSize:9.5,className:"fill-text-tertiary",fontFamily:"ui-sans-serif, sans-serif",fontWeight:"500",children:we(S)}),W&&e.jsxs("g",{children:[e.jsx("rect",{x:me-ae/2,y:ye-16,width:ae,height:19,rx:3,className:"fill-text-primary",opacity:.88}),e.jsx("text",{x:me,y:ye-3,textAnchor:"middle",fontSize:8.5,className:"fill-surface",fontFamily:"ui-monospace, monospace",children:D})]})]},S.role)}),!q&&e.jsx("text",{x:ie+Re/2,y:H+48,textAnchor:"middle",fontSize:8.5,className:"fill-text-quaternary",fontFamily:"ui-sans-serif, sans-serif",children:"Set target_per_hour on each role in Admin → Roles to enable the pace chart"}),V.map(l=>e.jsx("text",{x:Te+6,y:l.labelY,fontSize:8,fontFamily:"ui-sans-serif, sans-serif",fontWeight:l.key==="actual"?700:500,opacity:l.key==="active"?.85:1,style:{fill:l.color,transition:`y ${I}`},children:l.text},l.key))]})}function yt(t){const s=t.priority_facet?`metadata.${t.priority_facet}`:"created_at",o=JSON.stringify([{field:s,direction:"asc"}]);return`/escalations/available?role=${encodeURIComponent(t.role)}&jeopardy=1&view=table&orderBy=${encodeURIComponent(o)}`}function ds({role:t,periodHours:s,onOpenEntity:o}){var C,b,F,L,v,E,Y;const i=ze(s),a=t.entity_facet,[c,n]=h.useState(!1),[,r]=it(),d=()=>{a&&r(g=>{const _=new URLSearchParams(g);return _.set("lens",a),_})},u=B({query:{roles:[t.role]},groupBy:{columns:["subtype"]},measure:{kind:"dwell",window:i},orderBy:[{field:"dwellSeconds",direction:"desc"}]}),m=B({query:{roles:[t.role]},groupBy:{columns:["subtype"]},measure:{kind:"membership"},orderBy:[{field:"count",direction:"desc"}]}),w=B(a?{query:{roles:[t.role]},groupBy:{},measure:{kind:"membership"},distinctBy:a}:null),j=B(a&&c?{query:{roles:[t.role],exists:[a]},groupBy:{facets:[a]},measure:{kind:"dwell",window:i},orderBy:[{field:"dwellSeconds",direction:"desc"}],limit:8}:null),f=h.useMemo(()=>{var g,_;return at([...((g=u.data)==null?void 0:g.groups)??[],...((_=m.data)==null?void 0:_.groups)??[]])},[u.data,m.data]);if(Le(u.error))return e.jsx("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Analytics require full read access to this station's queue."})});const q=(((C=u.data)==null?void 0:C.groups)??[]).filter(g=>(g.dwellSeconds??0)>0),k=q.reduce((g,_)=>g+(_.dwellSeconds??0),0),P=(((b=m.data)==null?void 0:b.groups)??[]).filter(g=>(g.count??0)>0),$=((L=(F=w.data)==null?void 0:F.groups[0])==null?void 0:L.count)??null;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2.5",children:"Where the time went"}),k>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-2 flex rounded-full overflow-hidden bg-surface-sunken mb-2.5",children:q.map(g=>e.jsx("div",{style:{width:`${(g.dwellSeconds??0)/k*100}%`,backgroundColor:f.get(he(g.subtype))}},he(g.subtype)))}),e.jsx("div",{className:"space-y-1",children:q.map(g=>e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:f.get(he(g.subtype))}}),e.jsx("span",{className:`font-mono truncate flex-1 ${g.subtype?"text-text-secondary":"text-text-tertiary"}`,children:Pe(g.subtype)}),e.jsx("span",{className:"font-mono tabular-nums text-text-secondary shrink-0",children:te((g.dwellSeconds??0)*1e3)}),e.jsxs("span",{className:"font-mono tabular-nums text-text-quaternary w-8 text-right shrink-0",children:[Math.round((g.dwellSeconds??0)/k*100),"%"]})]},he(g.subtype)))}),((v=u.data)==null?void 0:v.overflow)&&e.jsx("p",{className:"text-2xs text-text-quaternary mt-1.5",children:"more groups exist — narrow the window"})]}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No tracked time in this window."})]}),e.jsxs("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2.5",children:"In queue now"}),a&&$!=null&&e.jsxs("button",{onClick:d,className:"group flex items-center gap-1 text-2xs mb-2 text-left",title:`Open the ${a} lens — the whole system, entity-first`,children:[e.jsx("span",{className:"text-xs font-mono font-semibold text-text-primary tabular-nums",children:$})," ",e.jsx("span",{className:"font-mono text-text-tertiary group-hover:text-accent transition-colors",children:a}),e.jsx("span",{className:"text-text-quaternary",children:" in queue"}),e.jsx(Ot,{className:"w-3 h-3 text-text-quaternary group-hover:text-accent transition-colors"})]}),P.length>0?e.jsx("div",{className:"space-y-1",children:P.map(g=>e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:f.get(he(g.subtype))}}),e.jsx("span",{className:`font-mono truncate flex-1 ${g.subtype?"text-text-secondary":"text-text-tertiary"}`,children:Pe(g.subtype)}),e.jsx("span",{className:"font-mono tabular-nums text-text-primary shrink-0",children:g.count})]},he(g.subtype)))}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Queue clear."}),a&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{onClick:()=>n(g=>!g),className:"flex items-center gap-1 text-2xs text-text-tertiary hover:text-accent transition-colors",children:[c?e.jsx(Ge,{className:"w-3 h-3"}):e.jsx(At,{className:"w-3 h-3"}),"By entity"]}),c&&(Le(j.error)?e.jsx("p",{className:"text-2xs text-text-quaternary mt-1.5",children:"Requires full read access to this station's queue."}):e.jsxs("div",{className:"space-y-1 mt-1.5",children:[(((E=j.data)==null?void 0:E.groups)??[]).map(g=>{const _=g.facets[a];return _==null?null:e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"font-mono truncate flex-1 text-text-secondary",title:_,children:_}),e.jsx("span",{className:"font-mono tabular-nums text-text-secondary shrink-0",children:te((g.dwellSeconds??0)*1e3)}),e.jsx("button",{className:"icon-link shrink-0",title:"Open timeline",onClick:()=>o(a,_),children:e.jsx(rt,{className:"w-3 h-3"})})]},_)}),j.data&&j.data.groups.length===0&&e.jsx("p",{className:"text-2xs text-text-quaternary",children:"No entities in this window."}),((Y=j.data)==null?void 0:Y.overflow)&&e.jsx("p",{className:"text-2xs text-text-quaternary",children:"top 8 by dwell"})]}))]})]})]})}const gt=["15m","1h","24h","7d","30d"],xs=t=>gt.includes(t),us={"15m":.25,"1h":1,"24h":24,"7d":168,"30d":720};function Me(t){if(t==null)return"—";if(t<1){const s=Math.round(t*60);return s<=0?"< 1s":`${s}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function Ce({label:t,value:s}){return e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsx("span",{className:"text-2xs text-text-tertiary uppercase tracking-wider",children:t}),e.jsx("span",{className:"text-xs font-mono font-medium text-text-primary tabular-nums",children:s})]})}function ms({period:t,onChange:s}){return e.jsx("div",{className:"flex items-center gap-1 mb-4",children:gt.map(o=>e.jsx("button",{onClick:()=>s(o),className:`px-2 py-0.5 text-2xs font-mono rounded transition-colors ${t===o?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:o},o))})}function ps({role:t,globalPeriod:s,onClose:o}){const[i,a]=h.useState(xs(s)?s:"24h"),{data:c}=st(i),n=c==null?void 0:c.stations.find(j=>j.role===t.role),r=t.sla_minutes??void 0,d=t.target_per_hour??void 0,u=t.worker_count??void 0,m=tt(),w=h.useCallback((j,f)=>{m==null||m.setPanel(t.entity_facet?e.jsx(We,{facetKey:j,value:f,entity:t.entity_facet}):e.jsx(We,{facetKey:j,value:f,role:t.role}),{key:"entity-timeline",width:420})},[m,t.role,t.entity_facet]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-sm font-bold text-text-primary",children:we(t)}),e.jsx("span",{className:"text-2xs font-mono text-text-secondary",children:t.role})]}),t.description&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 line-clamp-2 leading-relaxed",children:t.description})]}),e.jsx("button",{onClick:o,className:"icon-link mt-0.5 shrink-0 ml-2",children:e.jsx(Bt,{className:"w-4 h-4"})})]}),n&&n.priority_count>0&&e.jsxs(le,{to:yt(t),className:"flex items-center justify-between group mb-4",children:[e.jsxs("span",{className:"text-2xs",style:{color:be},children:[n.priority_count," in jeopardy — pull oldest first"]}),e.jsx(Ft,{className:"w-3 h-3 transition-colors",style:{color:be}})]}),e.jsx(ms,{period:i,onChange:a}),(d||r||u)&&e.jsxs("div",{className:"flex items-center gap-6 mb-6 text-2xs border-b border-surface-border/30 pb-5",children:[d&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[d,"/h"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"target"})]}),r&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-mono font-semibold text-text-primary text-sm",children:[r,"m"]}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"SLA"})]}),u&&e.jsxs("div",{children:[e.jsx("div",{className:"font-mono font-semibold text-text-primary text-sm",children:u}),e.jsx("div",{className:"text-text-quaternary uppercase tracking-wider text-[8.5px] mt-0.5",children:"workers"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 mb-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-2",children:"Wait (queue)"}),e.jsx(Ce,{label:"P99",value:Me((n==null?void 0:n.wait.p99)??null)}),e.jsx(Ce,{label:"avg",value:Me((n==null?void 0:n.wait.avg)??null)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-2",children:"Work (proc.)"}),e.jsx(Ce,{label:"P99",value:Me((n==null?void 0:n.work.p99)??null)}),e.jsx(Ce,{label:"avg",value:Me((n==null?void 0:n.work.avg)??null)})]})]}),r&&e.jsx("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-tertiary",children:"SLA target"}),e.jsxs("span",{className:"text-xs font-mono text-text-secondary",children:[r,"m"]})]})}),e.jsx(ds,{role:t,periodHours:us[i],onOpenEntity:w})]})}function hs({allMetrics:t,orderedRoles:s,period:o}){const i=t.reduce((u,m)=>u+m.pending,0),a=t.reduce((u,m)=>u+m.resolved,0),c=t.reduce((u,m)=>u+m.priority_count,0),n=new Map(t.map(u=>[u.role,u])),r=t.filter(u=>u.priority_count>0).length,d=t.filter(u=>u.pending>0).length;return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-2xs text-text-quaternary uppercase tracking-wider mb-3",children:["Pipeline · ",o]}),e.jsx("div",{className:"mb-4",children:r>0?e.jsxs("p",{className:"text-2xs",style:{color:be},children:[r," station",r>1?"s":""," with items in jeopardy"]}):d>0?e.jsxs("p",{className:"text-2xs text-status-warning",children:[d," station",d>1?"s":""," with backlog"]}):a>0?e.jsx("p",{className:"text-2xs text-status-success",children:"Flowing — queue clear"}):e.jsx("p",{className:"text-2xs text-text-quaternary",children:"Quiet — awaiting work"})}),e.jsxs("div",{className:"space-y-1.5 mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:"Pending"}),e.jsx("span",{className:`text-xs font-mono tabular-nums ${i>0?"text-text-primary font-semibold":"text-text-quaternary"}`,children:i})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:["Resolved · ",o]}),e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:a})]}),c>0&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider",children:"Priority"}),e.jsx("span",{className:"text-xs font-mono tabular-nums font-semibold",style:{color:be},children:c})]})]}),e.jsx("div",{className:"border-t border-surface-border/40 pt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider flex-1",children:"Station"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"pend"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"clmd"}),e.jsx("span",{className:"text-2xs text-text-quaternary uppercase tracking-wider w-8 text-right shrink-0",children:"res"})]})}),e.jsx("div",{className:"space-y-0.5",children:s.map(u=>{const m=n.get(u.role),w=(m==null?void 0:m.pending)??0,j=(m==null?void 0:m.claimed)??0,f=(m==null?void 0:m.resolved)??0,q=(m==null?void 0:m.priority_count)??0,k=u.title||u.role,P=q>0,$=w>0;return e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx("span",{className:`text-2xs font-mono flex-1 truncate ${$?"text-text-primary":"text-text-quaternary"}`,title:k,children:k}),e.jsx("span",{className:"text-[0.625rem] leading-none font-semibold tabular-nums w-4 text-right shrink-0",style:{color:be},title:P?`${q} priority — pull oldest first`:void 0,children:P?q:""}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${$?"text-text-primary font-semibold":"text-text-quaternary"}`,children:w>0?w:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${j>0?"text-accent font-semibold":"text-text-quaternary"}`,children:j>0?j:"—"}),e.jsx("span",{className:`text-2xs font-mono tabular-nums w-8 text-right shrink-0 ${f>0?"text-text-secondary":"text-text-quaternary"}`,children:f>0?f:"—"})]},u.role)})}),e.jsx("p",{className:"text-2xs text-text-quaternary mt-5",children:"Select a station for queue detail."})]})}function fs({role:t,allMetrics:s,orderedRoles:o,globalPeriod:i,mixGroups:a,onClose:c}){return e.jsx("div",{className:"w-[280px] shrink-0 px-7 py-10 flex flex-col overflow-y-auto min-h-0",children:t?e.jsx(ps,{role:t,globalPeriod:i,onClose:c}):e.jsxs(e.Fragment,{children:[e.jsx(hs,{allMetrics:s,orderedRoles:o,period:i}),e.jsx(ys,{mixGroups:a,orderedRoles:o})]})})}function ys({mixGroups:t,orderedRoles:s}){const o=new Set(s.map(r=>r.role)),i=(t??[]).filter(r=>r.role&&o.has(r.role)&&(r.dwellSeconds??0)>0);if(i.length===0)return null;const a=new Map(s.map(r=>[r.role,r.title||r.role])),c=Ze(i,r=>r.role),n=Ze(i,r=>Pe(r.subtype));return e.jsxs(e.Fragment,{children:[e.jsx(Xe,{label:"Time by station",entries:c,display:r=>a.get(r)??r}),e.jsx(Xe,{label:"Time by subtype",entries:n,display:r=>r})]})}function Ze(t,s){const o=new Map;for(const i of t){const a=s(i);o.set(a,(o.get(a)??0)+(i.dwellSeconds??0))}return[...o.entries()].sort(([,i],[,a])=>a-i)}function Xe({label:t,entries:s,display:o}){const i=nt(s.map(([c,n])=>({label:c,weight:n}))),a=s.reduce((c,[,n])=>c+n,0)||1;return e.jsxs("div",{className:"border-t border-surface-border/40 pt-4 mt-5",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2.5",children:t}),e.jsx("div",{className:"h-2 flex rounded-full overflow-hidden bg-surface-sunken mb-2",children:s.map(([c,n])=>e.jsx("div",{style:{width:`${n/a*100}%`,backgroundColor:i.get(c)}},c))}),e.jsxs("div",{className:"space-y-0.5",children:[s.slice(0,6).map(([c,n])=>e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:i.get(c)}}),e.jsx("span",{className:"font-mono text-text-secondary truncate flex-1",children:o(c)}),e.jsx("span",{className:"font-mono tabular-nums text-text-tertiary shrink-0",children:te(n*1e3)}),e.jsxs("span",{className:"font-mono tabular-nums text-text-quaternary w-8 text-right shrink-0",children:[Math.round(n/a*100),"%"]})]},c)),s.length>6&&e.jsxs("p",{className:"text-2xs text-text-quaternary",children:["+",s.length-6," more"]})]})]})}const gs=de,Fe=Be(de,.09),jt=Fe,bt=Fe,wt=Be(je,.15),Nt=Be(ce,.15),vt=Be(ee,.15),js=["15m","1h","24h","7d","30d"],_e={"15m":.25,"1h":1,"24h":24,"7d":168,"30d":720};function Ue(t){const s=t.filter(n=>n.ops_visible),o=new Map(s.map(n=>[n.role,n])),i=new Set,c=s.filter(n=>!n.parent_role||!o.has(n.parent_role)).map(n=>{const r=[],d=[{role:n,depth:0}];for(;d.length>0;){const u=d.shift();i.has(u.role.role)||(i.add(u.role.role),r.push(u),s.filter(m=>m.parent_role===u.role.role&&!i.has(m.role)).forEach(m=>d.push({role:m,depth:u.depth+1})))}return{origin:n,stations:r}});return s.filter(n=>!i.has(n.role)).forEach(n=>c.push({origin:n,stations:[{role:n,depth:0}]})),c.sort((n,r)=>r.stations.length-n.stations.length||n.origin.role.localeCompare(r.origin.role))}function Je(t){if(t==null)return"—";if(t<1){const s=Math.round(t*60);return s<=0?"< 1s":`${s}s`}return t<60?`${t.toFixed(0)}m`:`${(t/60).toFixed(1)}h`}function bs(t,s){if(!s||t===0)return{pct:null,color:"bg-surface-border"};const o=t/s,i=Math.round(o*100),a=o>1?"bg-status-warning":o<.2?"bg-status-draft":"bg-status-success";return{pct:i,color:a}}function Ke({value:t,onSave:s}){const[o,i]=h.useState(t!=null?String(t):""),a=h.useRef(void 0),c=n=>{const r=parseInt(n,10);s(!n.trim()||isNaN(r)||r<0?null:r)};return e.jsx("input",{type:"number",min:0,step:1,value:o,onChange:n=>{const r=n.target.value;i(r),clearTimeout(a.current),a.current=setTimeout(()=>c(r),400)},onBlur:n=>{clearTimeout(a.current),c(n.target.value)},onClick:n=>n.stopPropagation(),onKeyDown:n=>n.stopPropagation(),className:"w-full bg-transparent text-xs font-mono tabular-nums text-right focus:outline-none"})}function ws({role:t,metric:s,mixGroups:o,mixColors:i,selected:a,periodHours:c,onClick:n}){var L;const r=Mt(),{isBuilder:d,isOps:u}=Ct(),m=(s==null?void 0:s.pending)??0,w=(s==null?void 0:s.claimed)??0,j=(s==null?void 0:s.resolved)??0,f=(s==null?void 0:s.priority_count)??0,q=t.target_per_hour??null,{pct:k,color:P}=bs(m,q),$=k!=null?Math.min(100,k):0,C=ks(t.target_per_hour??null,t.sla_minutes??null,m,c),b=v=>r.mutate({role:t.role,target_per_hour:v}),F=v=>r.mutate({role:t.role,sla_minutes:v});return e.jsxs("tr",{tabIndex:0,onClick:n,onKeyDown:v=>{v.key==="Enter"&&n()},className:`cursor-pointer border-b border-surface-border/30 last:border-b-0 transition-colors ${a?"border-l-2 !border-l-accent":""}`,children:[e.jsx("td",{className:"pl-3 pr-2 py-1.5 overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"font-bold text-text-primary truncate text-xs",children:we(t)}),(((L=t.upstream_roles)==null?void 0:L.length)??0)>0&&e.jsx("span",{title:`Fed by ${t.upstream_roles.join(", ")}`,className:"shrink-0 leading-none",children:e.jsx(Tt,{className:"w-3 h-3 text-text-quaternary"})})]})}),e.jsx("td",{className:"hidden xl:table-cell pr-2 py-1.5 overflow-hidden",children:e.jsx("span",{className:"block font-mono text-2xs text-text-tertiary truncate",children:t.role})}),e.jsx("td",{className:"px-2 py-1.5",style:{backgroundColor:Fe},children:e.jsx(Ke,{value:t.target_per_hour??null,onSave:b})}),e.jsx("td",{className:"px-2 py-1.5",style:{backgroundColor:jt},children:e.jsx(Ke,{value:t.sla_minutes??null,onSave:F})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:bt},title:C!=null?`~${C} concurrent worker${C===1?"":"s"} to sustain ${t.target_per_hour}/h within ${t.sla_minutes}m SLA`:void 0,children:e.jsx("span",{className:`text-xs font-mono tabular-nums ${C!=null?"":"text-text-quaternary"}`,children:C??"—"})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:wt},children:e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=available`,className:`text-xs font-mono tabular-nums hover:underline ${m>0?"text-text-primary font-semibold":"text-text-quaternary"}`,onClick:v=>v.stopPropagation(),children:m})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:Nt},children:e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=claimed`,className:`text-xs font-mono tabular-nums hover:underline ${w>0?"font-semibold":"text-text-quaternary"}`,style:w>0?{color:ce}:void 0,onClick:v=>v.stopPropagation(),children:w})}),e.jsx("td",{className:"px-2 py-1.5 text-right",style:{backgroundColor:vt},children:e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=resolved`,className:`text-xs font-mono tabular-nums hover:underline ${j>0?"text-text-secondary":"text-text-quaternary"}`,style:j>0?{color:ee}:void 0,onClick:v=>v.stopPropagation(),children:j})}),e.jsx("td",{className:"hidden xl:table-cell px-2 py-1.5 text-right",children:e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:Je((s==null?void 0:s.wait.p99)??null)})}),e.jsx("td",{className:"hidden xl:table-cell px-2 py-1.5 text-right",children:e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-secondary",children:Je((s==null?void 0:s.work.p99)??null)})}),e.jsx("td",{className:"hidden lg:table-cell px-2 py-1.5",children:e.jsx(zt,{groups:o,colors:i})}),e.jsx("td",{className:"hidden lg:table-cell px-2 py-1.5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-12 h-1.5 bg-surface-sunken rounded-full overflow-hidden shrink-0",children:e.jsx("div",{className:`h-full rounded-full ${P}`,style:{width:`${$}%`}})}),e.jsx("span",{className:`text-2xs font-mono tabular-nums ${k!=null&&k>100?"text-status-warning font-semibold":"text-text-quaternary"}`,children:k!=null?`${k}%`:"—"})]})}),e.jsx("td",{className:"py-1.5",children:e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx(le,{to:`/escalations/available?role=${encodeURIComponent(t.role)}&status=all`,className:"icon-link",title:"View all items in queue",onClick:v=>v.stopPropagation(),children:e.jsx(Wt,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:(d||u)&&e.jsx(le,{to:`/admin/roles/${encodeURIComponent(t.role)}?section=pace-board`,className:"icon-link",title:"Configure this station",onClick:v=>v.stopPropagation(),children:e.jsx(Dt,{className:"w-3.5 h-3.5"})})}),e.jsx("span",{className:"w-3.5 flex items-center justify-center",children:f>0&&e.jsx(le,{to:yt(t),className:"text-status-error hover:opacity-70 transition-opacity",title:`${f} item${f===1?"":"s"} in jeopardy — pull oldest first`,onClick:v=>v.stopPropagation(),children:e.jsx(ot,{className:"w-3.5 h-3.5",strokeWidth:2})})})]})})]})}function et({n:t}){return t<=0?null:e.jsxs("span",{className:"inline-flex items-center gap-0.5 font-semibold tabular-nums",style:{color:be},title:`${t} in jeopardy`,children:[e.jsx(ot,{className:"w-3 h-3",strokeWidth:2.25}),t>9?"9+":t]})}function Ns({fragments:t,aggregates:s,activeOrigin:o,onSelect:i}){const[a,c]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{if(!a)return;const u=w=>{n.current&&!n.current.contains(w.target)&&c(!1)},m=w=>{w.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",m)}},[a]);const r=t.find(u=>u.origin.role===o)??t[0];if(!r)return null;const d=s.get(r.origin.role);return e.jsxs("div",{ref:n,className:"relative px-4 pt-2",children:[e.jsxs("button",{type:"button",onClick:()=>c(u=>!u),className:"group flex items-baseline gap-2.5","aria-expanded":a,"aria-haspopup":"listbox",children:[e.jsx("span",{className:"text-sm font-medium text-text-primary group-hover:text-accent transition-colors",children:we(r.origin)}),e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary tabular-nums",children:[(d==null?void 0:d.stations)??r.stations.length," station",((d==null?void 0:d.stations)??r.stations.length)===1?"":"s"," · ",(d==null?void 0:d.pending)??0," pending"]}),e.jsx(et,{n:(d==null?void 0:d.jeopardy)??0}),e.jsx(Ge,{className:`w-3.5 h-3.5 self-center shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${a?"rotate-180":""}`,strokeWidth:1.5})]}),a&&e.jsx("div",{role:"listbox",className:"absolute z-[100] top-full left-4 mt-1.5 min-w-[20rem] max-h-80 overflow-y-auto bg-surface-raised border border-surface-border rounded-md shadow-lg py-1",children:t.map(u=>{const m=s.get(u.origin.role),w=u.origin.role===r.origin.role;return e.jsxs("button",{type:"button",role:"option","aria-selected":w,onClick:()=>{i(u.origin.role),c(!1)},className:`w-full text-left px-3 py-1.5 flex items-baseline gap-2.5 transition-colors ${w?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`,children:[e.jsx("span",{className:"text-xs font-medium truncate",children:we(u.origin)}),e.jsxs("span",{className:"ml-auto text-2xs font-mono text-text-quaternary tabular-nums shrink-0",children:[(m==null?void 0:m.stations)??u.stations.length," st · ",(m==null?void 0:m.pending)??0," pending"]}),e.jsx("span",{className:"w-12 shrink-0 text-left text-2xs",children:e.jsx(et,{n:(m==null?void 0:m.jeopardy)??0})})]},u.origin.role)})})]})}const vs=[{label:"TARGET/H",band:Fe,hue:de,w:"w-[8%]"},{label:"SLA/M",band:jt,hue:gs,w:"w-[7%]"},{label:"WORKERS",band:bt,hue:de,w:"w-[8%]"},{label:"PENDING",band:wt,hue:je,w:"w-[8%]"},{label:"CLAIMED",band:Nt,hue:ce,w:"w-[8%]"},{label:"RESOLVED",band:vt,hue:ee,w:"w-[8%]"}];function ks(t,s,o,i){if(!t||!s)return null;const a=t*s/60,c=o>0?o*s/(60*i):0;return Math.ceil(a+c)}const oe="sticky top-0 z-10 bg-surface border-b border-surface-border py-1.5 text-2xs font-semibold uppercase tracking-wider whitespace-nowrap";function $s(){return e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`${oe} pl-3 pr-2 text-left text-text-quaternary`,children:"NAME"}),e.jsx("th",{className:`${oe} hidden xl:table-cell w-[12%] pr-2 text-left text-text-quaternary`,children:"ROLE"}),vs.map(t=>e.jsx("th",{className:`${oe} ${t.w} px-2 text-right`,style:{color:t.hue,backgroundImage:`linear-gradient(${t.band}, ${t.band})`},children:t.label},t.label)),e.jsx("th",{className:`${oe} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WAIT"}),e.jsx("th",{className:`${oe} hidden xl:table-cell w-[8%] px-2 text-right text-text-quaternary`,children:"P99 WORK"}),e.jsx("th",{className:`${oe} hidden lg:table-cell w-[10%] px-2 text-left text-text-quaternary`,children:"MIX"}),e.jsx("th",{className:`${oe} hidden lg:table-cell w-[11%] px-2 text-left text-text-quaternary`,children:"TREND"}),e.jsx("th",{className:`${oe} w-20 px-1 text-center text-text-quaternary`,children:"ACTIONS"})]})})}function Ss(){var ve;const[t,s]=h.useState("1h"),[o,i]=h.useState(null),[a,c]=h.useState(!1),[n,r]=h.useState(!0);_t(),Rt();const{data:d,isLoading:u,refetch:m}=qt(),{data:w,isLoading:j,refetch:f}=st(t),q=(d==null?void 0:d.roles)??[],k=(w==null?void 0:w.stations)??[],P=h.useMemo(()=>{const x=new Map(k.map(y=>[y.role,y])),N=new Map;for(const y of Ue((d==null?void 0:d.roles)??[])){let pe=0,ke=0;for(const $e of y.stations){const K=x.get($e.role.role);pe+=(K==null?void 0:K.pending)??0,ke+=(K==null?void 0:K.priority_count)??0}N.set(y.origin.role,{stations:y.stations.length,pending:pe,jeopardy:ke})}return N},[k,d]),$=h.useMemo(()=>Ue(q),[q]),[C,b]=it(),F=C.get("fragment"),L=$.find(x=>x.origin.role===F)??$[0]??null,v=h.useCallback(x=>{i(null),b(N=>{const y=new URLSearchParams(N);return y.set("fragment",x),y})},[b]),E=(L==null?void 0:L.stations)??[],Y=h.useMemo(()=>new Set(E.map(({role:x})=>x.role)),[E]),g=ze(_e[t]),_=h.useMemo(()=>E.map(({role:x})=>x.role),[E]),{data:z}=B(_.length?{query:{roles:_},groupBy:{columns:["role","subtype"]},measure:{kind:"dwell",window:g}}:null),G=h.useMemo(()=>{const x=new Map;for(const N of(z==null?void 0:z.groups)??[]){if(!N.role)continue;const y=x.get(N.role)??[];y.push(N),x.set(N.role,y)}return x},[z]),fe=h.useMemo(()=>{const x=new Map;for(const[N,y]of G)x.set(N,at(y));return x},[G]),T=h.useMemo(()=>new Map,[]),Ne=h.useMemo(()=>k.filter(x=>Y.has(x.role)),[k,Y]),R=h.useMemo(()=>E.map(({role:x})=>({role:x.role,title:x.title,parent_role:x.parent_role,target_per_hour:x.target_per_hour??null,upstream_roles:x.upstream_roles??[],metric:k.find(N=>N.role===x.role)})),[E,k]),se=h.useCallback(x=>{const N=$.find(y=>y.stations.some(({role:pe})=>pe.role===x));N&&v(N.origin.role)},[$,v]),X=lt(),xe=((ve=E.find(({role:x})=>x.role===o))==null?void 0:ve.role)??null,ne=h.useMemo(()=>{const x=new Set;for(const N of q)N.ops_visible&&N.entity_facet&&x.add(N.entity_facet);return[...x].sort()},[q]),ue=C.get("lens"),V=ue&&ne.includes(ue)?ue:null,l=h.useCallback(x=>{i(null),b(N=>{const y=new URLSearchParams(N);return x?y.set("lens",x):y.delete("lens"),y.delete("entity"),y.delete("find"),y.delete("slice"),y.delete("sliceValue"),y})},[b]),S=C.get("entity"),O=C.get("find"),U=h.useCallback(x=>{b(N=>{const y=new URLSearchParams(N);return x?y.set("entity",x):y.delete("entity"),y})},[b]),A=h.useCallback(x=>{b(N=>{const y=new URLSearchParams(N);return x?y.set("find",x):y.delete("find"),y},{replace:!0})},[b]),J=C.get("slice"),W=C.get("sliceValue"),D=h.useCallback(x=>{b(N=>{const y=new URLSearchParams(N);return x?y.set("slice",x):y.delete("slice"),y.delete("sliceValue"),y})},[b]),ae=h.useCallback(x=>{b(N=>{const y=new URLSearchParams(N);return x?y.set("sliceValue",x):y.delete("sliceValue"),y})},[b]),me=u||j,ye=async()=>{c(!0),await Promise.all([m(),f()]),c(!1)},re=x=>i(N=>N===x?null:x),Q=e.jsx("div",{className:"flex items-center gap-0.5",children:js.map(x=>e.jsx("button",{onClick:()=>s(x),className:`px-2.5 py-1 text-2xs font-mono rounded transition-colors ${t===x?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:x},x))});return e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx(Ut,{title:"Pace Board",docsHash:"#docs:dashboard.md:pace-board",center:Q,actions:e.jsx("button",{onClick:ye,disabled:a,className:"icon-link disabled:opacity-40",children:e.jsx(It,{className:`w-3.5 h-3.5 ${a?"animate-spin":""}`})})}),me?e.jsxs("div",{className:"animate-pulse space-y-6 mt-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded w-full"}),e.jsx("div",{className:"space-y-3",children:[1,2,3].map(x=>e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-full"},x))})]}):$.length===0?e.jsxs("div",{className:"mt-8",children:[e.jsx("p",{className:"text-sm text-text-secondary mb-2",children:"Stations appear here once roles are marked visible in Operations."}),e.jsxs("p",{className:"text-xs text-text-tertiary",children:["Go to"," ",e.jsx(le,{to:"/admin/roles",className:"text-accent hover:underline",children:"Roles"})," ","and enable ",e.jsx("strong",{children:"Visible in Operations"})," on roles that represent pipeline stations."]})]}):e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"flex-1",children:!V&&$.length>1&&e.jsx(Ns,{fragments:$,aggregates:P,activeOrigin:(L==null?void 0:L.origin.role)??null,onSelect:v})}),ne.length>0&&e.jsx("div",{className:"px-4 pt-2 pb-0.5",children:e.jsx(Kt,{lenses:ne,activeLens:V,stationCount:E.length,onSelect:l})})]}),V?e.jsx(Jt,{entityKey:V,periodHours:_e[t],roles:q,find:O,onFindChange:A,entityValue:S,onEntityChange:U,sliceKey:J,onSliceKeyChange:D,sliceValue:W,onSliceValueChange:ae},V):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 min-h-[40vh] flex items-stretch overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col overflow-hidden px-2 py-4",children:[e.jsx("div",{className:"flex items-center justify-center gap-0.5 pb-2 shrink-0",children:["lin","log"].map(x=>e.jsx("button",{onClick:()=>r(x==="log"),className:`px-2 py-0.5 text-2xs font-mono rounded transition-colors ${(n?"log":"lin")===x?"text-accent font-semibold":"icon-link"}`,title:x==="lin"?"Linear Y axis":"Logarithmic Y axis — reveals shape across wide value ranges",children:x},x))}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col justify-center overflow-hidden",children:e.jsx(cs,{stations:R,selectedRole:o,onSelect:re,onUpstreamSelect:se,onCmdClick:x=>X(`/escalations/available?role=${encodeURIComponent(x)}`),periodHours:_e[t],logScale:n})})]}),e.jsx("div",{className:"w-px bg-surface-border shrink-0 self-stretch"}),e.jsx(fs,{role:xe,allMetrics:Ne,orderedRoles:E.map(x=>x.role),globalPeriod:t,mixGroups:z==null?void 0:z.groups,onClose:()=>i(null)})]}),e.jsx("div",{className:"max-h-[30vh] flex-none overflow-y-auto border-t border-surface-border",children:e.jsxs("table",{className:"w-full table-fixed",children:[e.jsx($s,{}),e.jsx("tbody",{children:E.map(({role:x})=>e.jsx(ws,{role:x,metric:k.find(N=>N.role===x.role),mixGroups:G.get(x.role),mixColors:fe.get(x.role)??T,selected:o===x.role,periodHours:_e[t],onClick:()=>re(x.role)},x.role))})]})})]})]})]})}const Es=Object.freeze(Object.defineProperty({__proto__:null,OperationsPage:Ss,buildFragments:Ue},Symbol.toStringTag,{value:"Module"}));export{Es as O,cs as P,Ue as b,yt as j};
3
- //# sourceMappingURL=OperationsPage-CJXTw02Z.js.map