@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,2 +0,0 @@
1
- import{a as l,j as e}from"./vendor-query-RUZdMvN6.js";import{d as L,e as A,b as I,c as T,u as U}from"./personas-B1HzC94M.js";import{F as K,a as D}from"./FilterBar-fwUqeM-5.js";import{P as q}from"./PageHeader-CFVw67M6.js";import{R as O}from"./RolePill-Di_5hfvw.js";import{b as F,Y as M}from"./index-DSdqso-_.js";import{M as H}from"./Modal-BU7No9NH.js";import{u as R}from"./vendor-react-CdqEC2zv.js";import{a as V}from"./users-C0ke1Z-8.js";import{u as W}from"./useDebouncedValue-C4P2jQuh.js";import{X as Y,a7 as z}from"./vendor-icons-h-jlRSb9.js";function G({open:s,onClose:u}){const r=R(),t=L(),[o,c]=l.useState(""),[n,a]=l.useState(""),[d,i]=l.useState(""),[f,h]=l.useState(s);s!==f&&(h(s),s&&(c(""),a(""),i(""),t.reset()));const g=()=>{const m=o.trim().toLowerCase();m&&t.mutate({key:m,title:n.trim()||void 0,description:d.trim()||void 0},{onSuccess:()=>{u(),r(`/admin/personas/${encodeURIComponent(m)}`)}})};return e.jsx(H,{open:s,onClose:u,title:"Create Persona",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Key (required)"}),e.jsx("input",{type:"text",value:o,onChange:m=>c(m.target.value),placeholder:"e.g., floor-manager",className:"input text-xs w-full font-mono",onKeyDown:m=>{m.key==="Enter"&&g()}}),e.jsx("p",{className:"text-2xs text-text-tertiary mt-1",children:"Lowercase letters, numbers, hyphens, and underscores only. Stable — it names the persona everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Title"}),e.jsx("input",{type:"text",value:n,onChange:m=>a(m.target.value),placeholder:"e.g., Floor Manager",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("textarea",{value:d,onChange:m=>i(m.target.value),placeholder:"The day in the life, one paragraph.",rows:3,className:"input text-xs w-full resize-y"})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:u,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:g,disabled:!o.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}function X({selected:s,onSelect:u,excludeIds:r=[],placeholder:t="Search users…"}){const[o,c]=l.useState(!1),[n,a]=l.useState(""),d=l.useRef(null),i=W(n,300),f=20,{data:h,isFetching:g}=V({search:i.trim()||void 0,limit:f});l.useEffect(()=>{if(!o)return;function x(v){d.current&&!d.current.contains(v.target)&&c(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const m=l.useMemo(()=>new Set(r),[r]),y=((h==null?void 0:h.users)??[]).filter(x=>!m.has(x.id)),p=(h==null?void 0:h.total)??0,b=p>((h==null?void 0:h.users.length)??0),j=(s==null?void 0:s.label)??"",N=o?n:j;return e.jsxs("div",{ref:d,className:"relative",children:[e.jsx("input",{type:"text",value:N,onFocus:()=>{c(!0),a("")},onChange:x=>{a(x.target.value),x.target.value||u(null),o||c(!0)},placeholder:t,className:"input text-xs w-full min-w-0","aria-label":"User"}),o&&e.jsxs("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:[y.map(x=>{const v=x.display_name||x.external_id;return e.jsxs("button",{type:"button",onClick:()=>{u({id:x.id,label:v}),a(""),c(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 min-w-0 ${(s==null?void 0:s.id)===x.id?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-xs text-text-primary truncate",children:v}),x.email&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:x.email})]},x.id)}),y.length===0&&e.jsx("p",{className:"px-3 py-4 text-center text-2xs text-text-quaternary",children:g?"Searching…":n?`No users match "${n}"`:"No users available"}),b&&e.jsxs("p",{className:"px-3 py-1.5 text-2xs text-text-quaternary border-t border-surface-border/60 tabular-nums",children:[y.length," of ",p," — type to narrow"]})]})]})}const S="text-2xs font-semibold uppercase tracking-widest text-text-tertiary";function B({personaKey:s,onClose:u}){const{data:r}=A(s??""),t=I(),o=T(),[c,n]=l.useState(null),a=(r==null?void 0:r.assignees)??[],d=()=>{!r||!c||t.mutate({userId:c.id,key:r.key},{onSuccess:()=>n(null)})};return e.jsxs("div",{className:"h-full overflow-y-auto px-5 pt-4 pb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("p",{className:S,children:"Assignees"}),u&&e.jsx("button",{onClick:u,className:"icon-link",title:"Close","aria-label":"Close",children:e.jsx(Y,{className:"w-4 h-4"})})]}),r?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:r.title||r.key}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-0.5",children:[r.roles.length," role",r.roles.length===1?"":"s"," per assignment"]})]}),a.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Assign a user to compose their whole surface in one step."}):e.jsx("div",{className:"flex flex-col gap-2",children:a.map(i=>e.jsxs("span",{className:"flex items-center gap-2.5 w-full min-w-0 pl-2.5 pr-2 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate",title:i.external_id,children:i.display_name||i.external_id}),e.jsx("span",{className:"shrink-0 text-2xs text-text-tertiary",children:e.jsx(F,{date:i.assigned_at})}),e.jsx("button",{onClick:()=>o.mutate({userId:i.id,key:r.key}),className:"shrink-0 text-text-tertiary hover:text-status-error transition-colors ml-1",title:`Unassign ${i.display_name||i.external_id}`,children:"×"})]},i.id))}),e.jsxs("div",{className:"pt-3 border-t border-surface-border space-y-2",children:[e.jsx("p",{className:S,children:"Assign User"}),e.jsx(X,{selected:c,onSelect:n,excludeIds:a.map(i=>i.id)}),e.jsx("div",{className:"flex justify-end pt-1",children:e.jsx("button",{onClick:d,disabled:!c||t.isPending,className:"btn-primary text-xs",children:t.isPending?"...":"Assign"})}),(t.error||o.error)&&e.jsx("p",{className:"text-2xs text-status-error",children:(t.error||o.error).message})]})]}):e.jsx("p",{className:"text-xs text-text-tertiary",children:"Select a persona to assign users. An assignee joins every linked role at its scope — sidebar pins and forms compose from the roles."})]})}const $="persona-assignees",_="180px 140px 1fr 220px 56px 40px",E="text-text-secondary transition-colors group-hover/row:text-text-primary",P="text-2xs font-semibold uppercase tracking-widest text-text-quaternary",w="py-2",C="py-2.5";function k(s){return s.title?s.title:s.key.replace(/[-_]+/g," ").replace(/\b\w/g,u=>u.toUpperCase())}function J(){return e.jsxs("div",{className:"grid gap-4 px-3 border-b border-surface-border bg-surface",style:{gridTemplateColumns:_},children:[e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Persona"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Key"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Description"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Roles"}),e.jsx("span",{className:`${P} ${w} flex items-center justify-end`,children:"Users"}),e.jsx("span",{className:w})]})}const Q=3;function Z({persona:s,active:u,onClick:r,onConfigure:t}){const o=s.roles??[],c=o.slice(0,Q),n=o.length-c.length;return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&r()},className:`grid gap-4 px-3 cursor-pointer group/row transition-colors ${u?"bg-surface-hover/60":"hover:bg-surface-hover/30"}`,style:{gridTemplateColumns:_},children:[e.jsx("span",{className:`flex items-center min-w-0 text-sm truncate ${C} ${E}`,children:k(s)}),e.jsx("span",{className:`flex items-center text-xs font-mono truncate ${C} text-text-tertiary transition-colors group-hover/row:text-text-secondary`,children:s.key}),e.jsx("span",{className:`flex items-center min-w-0 text-xs text-text-tertiary truncate ${C} transition-colors group-hover/row:text-text-secondary`,children:s.description??""}),e.jsxs("div",{className:`flex items-center flex-wrap gap-x-2.5 gap-y-0.5 min-w-0 ${C}`,children:[c.map(a=>e.jsx("span",{className:"min-w-0 truncate text-text-secondary",children:e.jsx(O,{role:a.role,tone:"inherit"})},a.role)),n>0&&e.jsxs("span",{className:"text-2xs text-text-quaternary tabular-nums",children:["+",n]})]}),e.jsx("span",{className:`flex items-center justify-end text-sm tabular-nums ${C} transition-colors ${E}`,children:s.user_count>0?s.user_count:""}),e.jsx("span",{className:`flex items-center justify-end ${C}`,children:e.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-text-quaternary/70 hover:text-accent transition-colors",title:`Configure ${k(s)}`,"aria-label":`Configure ${k(s)}`,children:e.jsx(z,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})]})}function ue(){const s=R(),{data:u,isLoading:r}=U(),t=M(),[o,c]=l.useState(!1),[n,a]=l.useState(""),[d,i]=l.useState(null),f=(u==null?void 0:u.personas)??[],h=l.useRef(null),g=l.useRef(!1);l.useEffect(()=>{t&&d!==h.current&&(h.current=d,d?t.setPanel(e.jsx(B,{personaKey:d,onClose:()=>i(null)}),{key:$,width:360}):(g.current=!1,t.closePanel($)))},[d,t]),l.useEffect(()=>{if(!(!t||!d)){if(t.open&&t.ownerKey===$){g.current=!0;return}g.current&&(g.current=!1,i(null))}},[t,d]);const m=l.useRef(t);m.current=t,l.useEffect(()=>()=>{var p;h.current&&((p=m.current)==null||p.closePanel($))},[]);const y=l.useMemo(()=>{const p=[...f].sort((j,N)=>k(j).localeCompare(k(N)));if(!n.trim())return p;const b=n.toLowerCase();return p.filter(j=>{var N,x;return j.key.toLowerCase().includes(b)||k(j).toLowerCase().includes(b)||((N=j.description)==null?void 0:N.toLowerCase().includes(b))||((x=j.roles)==null?void 0:x.some(v=>v.role.toLowerCase().includes(b)))})},[f,n]);return e.jsxs("div",{children:[e.jsx(q,{title:"Personas",docsHash:"#docs:dashboard.md:personas",actions:e.jsx("button",{onClick:()=>c(!0),className:"btn-primary text-xs flex items-center gap-1.5",children:"+ Add Persona"})}),!r&&f.length>0&&e.jsxs(K,{children:[e.jsx(D,{label:"Search",value:n,onChange:a,placeholder:`${f.length} personas…`}),n&&y.length!==f.length&&e.jsxs("span",{className:"text-2xs text-text-quaternary tabular-nums shrink-0",children:[y.length," of ",f.length]})]}),e.jsxs("div",{className:"overflow-x-clip",children:[!r&&f.length>0&&y.length>0&&e.jsx("div",{className:"sticky top-[60px] z-10 bg-surface",children:e.jsx(J,{})}),r?e.jsx("div",{className:"animate-pulse space-y-3 mt-6",children:[1,2,3].map(p=>e.jsx("div",{className:"h-10 bg-surface-sunken rounded w-full"},p))}):y.length===0?e.jsx("p",{className:"text-sm text-text-tertiary mt-8",children:n?"Clear the search to see all personas.":"Create a persona to bundle roles into a one-step assignment."}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:y.map(p=>e.jsx(Z,{persona:p,active:p.key===d,onClick:()=>i(p.key),onConfigure:()=>s(`/admin/personas/${encodeURIComponent(p.key)}`)},p.key))})]}),e.jsx(G,{open:o,onClose:()=>c(!1)})]})}export{ue as PersonasPage};
2
- //# sourceMappingURL=PersonasPage-Cnmb4uox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PersonasPage-Cnmb4uox.js","sources":["../../src/pages/admin/personas/CreatePersonaModal.tsx","../../src/components/common/form/UserCombobox.tsx","../../src/pages/admin/personas/AssigneesPanel.tsx","../../src/pages/admin/personas/PersonasPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useCreatePersona } from '../../../api/personas';\nimport { Modal } from '../../../components/common/modal/Modal';\n\nexport function CreatePersonaModal({\n open,\n onClose,\n}: {\n open: boolean;\n onClose: () => void;\n}) {\n const navigate = useNavigate();\n const createPersona = useCreatePersona();\n const [key, setKey] = useState('');\n const [title, setTitle] = useState('');\n const [description, setDescription] = useState('');\n\n const [prevOpen, setPrevOpen] = useState(open);\n if (open !== prevOpen) {\n setPrevOpen(open);\n if (open) {\n setKey('');\n setTitle('');\n setDescription('');\n createPersona.reset();\n }\n }\n\n const handleCreate = () => {\n const trimmed = key.trim().toLowerCase();\n if (!trimmed) return;\n createPersona.mutate(\n {\n key: trimmed,\n title: title.trim() || undefined,\n description: description.trim() || undefined,\n },\n {\n onSuccess: () => {\n onClose();\n // Land on the detail page to link roles right away.\n navigate(`/admin/personas/${encodeURIComponent(trimmed)}`);\n },\n },\n );\n };\n\n return (\n <Modal open={open} onClose={onClose} title=\"Create Persona\">\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Key (required)\n </label>\n <input\n type=\"text\"\n value={key}\n onChange={(e) => setKey(e.target.value)}\n placeholder=\"e.g., floor-manager\"\n className=\"input text-xs w-full font-mono\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleCreate();\n }}\n />\n <p className=\"text-2xs text-text-tertiary mt-1\">\n Lowercase letters, numbers, hyphens, and underscores only. Stable — it names the persona everywhere.\n </p>\n </div>\n\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Title\n </label>\n <input\n type=\"text\"\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n placeholder=\"e.g., Floor Manager\"\n className=\"input text-xs w-full\"\n />\n </div>\n\n <div>\n <label className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n Description\n </label>\n <textarea\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n placeholder=\"The day in the life, one paragraph.\"\n rows={3}\n className=\"input text-xs w-full resize-y\"\n />\n </div>\n\n {createPersona.error && (\n <p className=\"text-xs text-status-error\">{(createPersona.error as Error).message}</p>\n )}\n\n <div className=\"flex justify-end gap-3 pt-2\">\n <button onClick={onClose} className=\"btn-secondary text-xs\">\n Cancel\n </button>\n <button\n onClick={handleCreate}\n disabled={!key.trim() || createPersona.isPending}\n className=\"btn-primary text-xs\"\n >\n {createPersona.isPending ? 'Creating...' : 'Create'}\n </button>\n </div>\n </div>\n </Modal>\n );\n}\n","import { useState, useRef, useEffect, useMemo } from 'react';\nimport { useUsers } from '../../../api/users';\nimport { useDebouncedValue } from '../../../hooks/useDebouncedValue';\n\nexport interface UserComboboxSelection {\n id: string;\n label: string;\n}\n\n/**\n * Searchable inline combobox for picking a user account. The filter drives the\n * server-side account search (name, email, external_id), so the list stays\n * bounded no matter how many accounts exist; a footer line discloses when more\n * matches remain than the page shows. Styled to match CapabilityCombobox.\n */\nexport function UserCombobox({ selected, onSelect, excludeIds = [], placeholder = 'Search users…' }: {\n selected: UserComboboxSelection | null;\n onSelect: (user: UserComboboxSelection | null) => void;\n /** Accounts to hide from the results (e.g. already assigned). */\n excludeIds?: string[];\n placeholder?: string;\n}) {\n const [open, setOpen] = useState(false);\n const [filter, setFilter] = useState('');\n const containerRef = useRef<HTMLDivElement>(null);\n\n const debounced = useDebouncedValue(filter, 300);\n const PAGE = 20;\n const { data, isFetching } = useUsers({\n search: debounced.trim() || undefined,\n limit: PAGE,\n });\n\n // Close on outside click\n useEffect(() => {\n if (!open) return;\n function handleClick(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setOpen(false);\n }\n }\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, [open]);\n\n const excluded = useMemo(() => new Set(excludeIds), [excludeIds]);\n const users = (data?.users ?? []).filter((u) => !excluded.has(u.id));\n const total = data?.total ?? 0;\n const truncated = total > (data?.users.length ?? 0);\n\n const displayValue = selected?.label ?? '';\n const filterText = open ? filter : displayValue;\n\n return (\n <div ref={containerRef} className=\"relative\">\n <input\n type=\"text\"\n value={filterText}\n onFocus={() => { setOpen(true); setFilter(''); }}\n onChange={(e) => {\n setFilter(e.target.value);\n if (!e.target.value) onSelect(null);\n if (!open) setOpen(true);\n }}\n placeholder={placeholder}\n className=\"input text-xs w-full min-w-0\"\n aria-label=\"User\"\n />\n\n {open && (\n <div className=\"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg\">\n {users.map((u) => {\n const label = u.display_name || u.external_id;\n return (\n <button\n key={u.id}\n type=\"button\"\n onClick={() => {\n onSelect({ id: u.id, label });\n setFilter('');\n setOpen(false);\n }}\n className={`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 min-w-0 ${\n selected?.id === u.id ? 'bg-accent/5' : ''\n }`}\n >\n <span className=\"text-xs text-text-primary truncate\">{label}</span>\n {u.email && (\n <span className=\"text-2xs text-text-quaternary truncate\">{u.email}</span>\n )}\n </button>\n );\n })}\n\n {users.length === 0 && (\n <p className=\"px-3 py-4 text-center text-2xs text-text-quaternary\">\n {isFetching ? 'Searching…' : filter ? `No users match \"${filter}\"` : 'No users available'}\n </p>\n )}\n\n {truncated && (\n <p className=\"px-3 py-1.5 text-2xs text-text-quaternary border-t border-surface-border/60 tabular-nums\">\n {users.length} of {total} — type to narrow\n </p>\n )}\n </div>\n )}\n </div>\n );\n}\n","import { useState } from 'react';\nimport { X } from 'lucide-react';\nimport { usePersona, useAssignPersona, useUnassignPersona } from '../../../api/personas';\nimport { DateValue } from '../../../components/common/display/DateValue';\nimport { UserCombobox, type UserComboboxSelection } from '../../../components/common/form/UserCombobox';\n\nconst SECTION_HDR = 'text-2xs font-semibold uppercase tracking-widest text-text-tertiary';\n\n/**\n * The 90% surface: pick a persona in the list, assign a user, and they get\n * every linked role — pins, list schemas, and forms compose from the roles.\n * Rendered in the global shell right panel (key 'persona-assignees').\n */\nexport function AssigneesPanel({\n personaKey,\n onClose,\n}: {\n personaKey: string | null;\n onClose?: () => void;\n}) {\n const { data: persona } = usePersona(personaKey ?? '');\n const assign = useAssignPersona();\n const unassign = useUnassignPersona();\n const [pendingUser, setPendingUser] = useState<UserComboboxSelection | null>(null);\n\n const assignees = persona?.assignees ?? [];\n\n const handleAssign = () => {\n if (!persona || !pendingUser) return;\n assign.mutate(\n { userId: pendingUser.id, key: persona.key },\n { onSuccess: () => setPendingUser(null) },\n );\n };\n\n return (\n <div className=\"h-full overflow-y-auto px-5 pt-4 pb-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <p className={SECTION_HDR}>Assignees</p>\n {onClose && (\n <button onClick={onClose} className=\"icon-link\" title=\"Close\" aria-label=\"Close\">\n <X className=\"w-4 h-4\" />\n </button>\n )}\n </div>\n\n {!persona ? (\n <p className=\"text-xs text-text-tertiary\">\n Select a persona to assign users. An assignee joins every linked role\n at its scope — sidebar pins and forms compose from the roles.\n </p>\n ) : (\n <div className=\"space-y-4\">\n <div>\n <p className=\"text-sm text-text-primary\">{persona.title || persona.key}</p>\n <p className=\"text-2xs text-text-tertiary mt-0.5\">\n {persona.roles.length} role{persona.roles.length === 1 ? '' : 's'} per assignment\n </p>\n </div>\n\n {assignees.length === 0 ? (\n <p className=\"text-xs text-text-tertiary\">\n Assign a user to compose their whole surface in one step.\n </p>\n ) : (\n <div className=\"flex flex-col gap-2\">\n {assignees.map((a) => (\n <span\n key={a.id}\n className=\"flex items-center gap-2.5 w-full min-w-0 pl-2.5 pr-2 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary\"\n >\n <span className=\"flex-1 min-w-0 truncate\" title={a.external_id}>\n {a.display_name || a.external_id}\n </span>\n <span className=\"shrink-0 text-2xs text-text-tertiary\">\n <DateValue date={a.assigned_at} />\n </span>\n <button\n onClick={() => unassign.mutate({ userId: a.id, key: persona.key })}\n className=\"shrink-0 text-text-tertiary hover:text-status-error transition-colors ml-1\"\n title={`Unassign ${a.display_name || a.external_id}`}\n >\n &times;\n </button>\n </span>\n ))}\n </div>\n )}\n\n <div className=\"pt-3 border-t border-surface-border space-y-2\">\n <p className={SECTION_HDR}>Assign User</p>\n <UserCombobox\n selected={pendingUser}\n onSelect={setPendingUser}\n excludeIds={assignees.map((a) => a.id)}\n />\n <div className=\"flex justify-end pt-1\">\n <button\n onClick={handleAssign}\n disabled={!pendingUser || assign.isPending}\n className=\"btn-primary text-xs\"\n >\n {assign.isPending ? '...' : 'Assign'}\n </button>\n </div>\n {(assign.error || unassign.error) && (\n <p className=\"text-2xs text-status-error\">\n {((assign.error || unassign.error) as Error).message}\n </p>\n )}\n </div>\n </div>\n )}\n </div>\n );\n}\n","import { useState, useMemo, useEffect, useRef } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { Pencil } from 'lucide-react';\nimport { usePersonas } from '../../../api/personas';\nimport { FilterBar, FilterInput } from '../../../components/common/data/FilterBar';\nimport type { LTPersonaRecord } from '../../../api/types';\nimport { PageHeader } from '../../../components/common/layout/PageHeader';\nimport { RolePill } from '../../../components/common/display/RolePill';\nimport { useShellPanelOptional } from '../../../hooks/useShellPanel';\nimport { CreatePersonaModal } from './CreatePersonaModal';\nimport { AssigneesPanel } from './AssigneesPanel';\n\n// Shell-panel ownership key — the Assignees panel claims/releases this slot.\nconst ASSIGNEES_PANEL_KEY = 'persona-assignees';\n\n// ── Grid columns ──────────────────────────────────────────────────────────────\n// PERSONA(title, 180px) | KEY(140px) | DESCRIPTION(1fr) | ROLES(220px) | USERS(56px) | CONFIGURE(40px)\n// Mirrors the Roles list: display title leads, exact key is the secondary\n// field, the bundle's role pills preview on the right. Clicking a row selects\n// it for the Assignees panel (the 90% path); the pencil opens configuration.\nconst GRID = '180px 140px 1fr 220px 56px 40px';\n\nconst CELL_TEXT = 'text-text-secondary transition-colors group-hover/row:text-text-primary';\nconst HDR = 'text-2xs font-semibold uppercase tracking-widest text-text-quaternary';\nconst CELL_PY = 'py-2';\nconst ROW_PY = 'py-2.5';\n\n/** Title Case fallback derived from the key, same convention as roles. */\nfunction displayPersonaTitle(p: LTPersonaRecord): string {\n if (p.title) return p.title;\n return p.key.replace(/[-_]+/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nfunction TableHead() {\n return (\n <div\n className=\"grid gap-4 px-3 border-b border-surface-border bg-surface\"\n style={{ gridTemplateColumns: GRID }}\n >\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Persona</span>\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Key</span>\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Description</span>\n <span className={`${HDR} ${CELL_PY} flex items-center`}>Roles</span>\n <span className={`${HDR} ${CELL_PY} flex items-center justify-end`}>Users</span>\n <span className={CELL_PY} />\n </div>\n );\n}\n\nconst ROLE_PREVIEW_LIMIT = 3;\n\nfunction PersonaRow({ persona, active, onClick, onConfigure }: {\n persona: LTPersonaRecord;\n active: boolean;\n onClick: () => void;\n onConfigure: () => void;\n}) {\n const roles = persona.roles ?? [];\n const preview = roles.slice(0, ROLE_PREVIEW_LIMIT);\n const overflow = roles.length - preview.length;\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') onClick(); }}\n className={`grid gap-4 px-3 cursor-pointer group/row transition-colors ${active ? 'bg-surface-hover/60' : 'hover:bg-surface-hover/30'}`}\n style={{ gridTemplateColumns: GRID }}\n >\n <span className={`flex items-center min-w-0 text-sm truncate ${ROW_PY} ${CELL_TEXT}`}>\n {displayPersonaTitle(persona)}\n </span>\n\n <span className={`flex items-center text-xs font-mono truncate ${ROW_PY} text-text-tertiary transition-colors group-hover/row:text-text-secondary`}>\n {persona.key}\n </span>\n\n <span className={`flex items-center min-w-0 text-xs text-text-tertiary truncate ${ROW_PY} transition-colors group-hover/row:text-text-secondary`}>\n {persona.description ?? ''}\n </span>\n\n <div className={`flex items-center flex-wrap gap-x-2.5 gap-y-0.5 min-w-0 ${ROW_PY}`}>\n {preview.map((r) => (\n <span key={r.role} className=\"min-w-0 truncate text-text-secondary\">\n <RolePill role={r.role} tone=\"inherit\" />\n </span>\n ))}\n {overflow > 0 && (\n <span className=\"text-2xs text-text-quaternary tabular-nums\">+{overflow}</span>\n )}\n </div>\n\n <span className={`flex items-center justify-end text-sm tabular-nums ${ROW_PY} transition-colors ${CELL_TEXT}`}>\n {persona.user_count > 0 ? persona.user_count : ''}\n </span>\n\n <span className={`flex items-center justify-end ${ROW_PY}`}>\n <button\n onClick={(e) => { e.stopPropagation(); onConfigure(); }}\n className=\"text-text-quaternary/70 hover:text-accent transition-colors\"\n title={`Configure ${displayPersonaTitle(persona)}`}\n aria-label={`Configure ${displayPersonaTitle(persona)}`}\n >\n <Pencil className=\"w-3.5 h-3.5\" strokeWidth={1.5} />\n </button>\n </span>\n </div>\n );\n}\n\n// ── Page ──────────────────────────────────────────────────────────────────────\n\nexport function PersonasPage() {\n const navigate = useNavigate();\n const { data, isLoading } = usePersonas();\n const shell = useShellPanelOptional();\n const [showCreate, setShowCreate] = useState(false);\n const [search, setSearch] = useState('');\n const [selectedKey, setSelectedKey] = useState<string | null>(null);\n\n const personas = data?.personas ?? [];\n\n // ── Selection ↔ shell panel sync ────────────────────────────────────────────\n // Clicking a row opens the Assignees panel in the shell's right slot; an\n // external close (the panel's X, slot takeover) clears the selection. The\n // applied-key ref guards against re-setting the panel on unrelated renders.\n const appliedKey = useRef<string | null>(null);\n const panelWasOpen = useRef(false);\n useEffect(() => {\n if (!shell) return;\n if (selectedKey === appliedKey.current) return;\n appliedKey.current = selectedKey;\n if (selectedKey) {\n shell.setPanel(\n <AssigneesPanel personaKey={selectedKey} onClose={() => setSelectedKey(null)} />,\n { key: ASSIGNEES_PANEL_KEY, width: 360 },\n );\n } else {\n panelWasOpen.current = false;\n shell.closePanel(ASSIGNEES_PANEL_KEY);\n }\n }, [selectedKey, shell]);\n useEffect(() => {\n if (!shell || !selectedKey) return;\n if (shell.open && shell.ownerKey === ASSIGNEES_PANEL_KEY) {\n panelWasOpen.current = true;\n return;\n }\n if (panelWasOpen.current) {\n panelWasOpen.current = false;\n setSelectedKey(null);\n }\n }, [shell, selectedKey]);\n // Unmount with the panel open releases the slot (keyed — never yanks\n // another claimant's panel).\n const shellRef = useRef(shell);\n shellRef.current = shell;\n useEffect(\n () => () => {\n if (appliedKey.current) shellRef.current?.closePanel(ASSIGNEES_PANEL_KEY);\n },\n [],\n );\n\n const filtered = useMemo(() => {\n const sorted = [...personas].sort((a, b) =>\n displayPersonaTitle(a).localeCompare(displayPersonaTitle(b)),\n );\n if (!search.trim()) return sorted;\n const q = search.toLowerCase();\n return sorted.filter(\n (p) =>\n p.key.toLowerCase().includes(q) ||\n displayPersonaTitle(p).toLowerCase().includes(q) ||\n p.description?.toLowerCase().includes(q) ||\n p.roles?.some((r) => r.role.toLowerCase().includes(q)),\n );\n }, [personas, search]);\n\n return (\n <div>\n <PageHeader\n title=\"Personas\"\n docsHash=\"#docs:dashboard.md:personas\"\n actions={\n <button\n onClick={() => setShowCreate(true)}\n className=\"btn-primary text-xs flex items-center gap-1.5\"\n >\n + Add Persona\n </button>\n }\n />\n\n {/* The standard full-width sticky filter band — above the split. */}\n {!isLoading && personas.length > 0 && (\n <FilterBar>\n <FilterInput\n label=\"Search\"\n value={search}\n onChange={setSearch}\n placeholder={`${personas.length} personas…`}\n />\n {search && filtered.length !== personas.length && (\n <span className=\"text-2xs text-text-quaternary tabular-nums shrink-0\">\n {filtered.length} of {personas.length}\n </span>\n )}\n </FilterBar>\n )}\n\n {/* The table IS the page — selecting a row opens the Assignees panel in\n the shell's right panel; the row pencil opens the persona's config. */}\n <div className=\"overflow-x-clip\">\n {!isLoading && personas.length > 0 && filtered.length > 0 && (\n <div className=\"sticky top-[60px] z-10 bg-surface\">\n <TableHead />\n </div>\n )}\n\n {isLoading ? (\n <div className=\"animate-pulse space-y-3 mt-6\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"h-10 bg-surface-sunken rounded w-full\" />\n ))}\n </div>\n ) : filtered.length === 0 ? (\n <p className=\"text-sm text-text-tertiary mt-8\">\n {search\n ? 'Clear the search to see all personas.'\n : 'Create a persona to bundle roles into a one-step assignment.'}\n </p>\n ) : (\n <div className=\"divide-y divide-surface-border/30\">\n {filtered.map((persona) => (\n <PersonaRow\n key={persona.key}\n persona={persona}\n active={persona.key === selectedKey}\n onClick={() => setSelectedKey(persona.key)}\n onConfigure={() => navigate(`/admin/personas/${encodeURIComponent(persona.key)}`)}\n />\n ))}\n </div>\n )}\n </div>\n\n <CreatePersonaModal open={showCreate} onClose={() => setShowCreate(false)} />\n </div>\n );\n}\n"],"names":["CreatePersonaModal","open","onClose","navigate","useNavigate","createPersona","useCreatePersona","key","setKey","useState","title","setTitle","description","setDescription","prevOpen","setPrevOpen","handleCreate","trimmed","jsx","Modal","jsxs","e","UserCombobox","selected","onSelect","excludeIds","placeholder","setOpen","filter","setFilter","containerRef","useRef","debounced","useDebouncedValue","PAGE","data","isFetching","useUsers","useEffect","handleClick","excluded","useMemo","users","u","total","truncated","displayValue","filterText","label","SECTION_HDR","AssigneesPanel","personaKey","persona","usePersona","assign","useAssignPersona","unassign","useUnassignPersona","pendingUser","setPendingUser","assignees","handleAssign","X","a","DateValue","ASSIGNEES_PANEL_KEY","GRID","CELL_TEXT","HDR","CELL_PY","ROW_PY","displayPersonaTitle","p","c","TableHead","ROLE_PREVIEW_LIMIT","PersonaRow","active","onClick","onConfigure","roles","preview","overflow","r","RolePill","Pencil","PersonasPage","isLoading","usePersonas","shell","useShellPanelOptional","showCreate","setShowCreate","search","setSearch","selectedKey","setSelectedKey","personas","appliedKey","panelWasOpen","shellRef","_a","filtered","sorted","b","q","_b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,CAAA,EAEhCJ,GAAUS,EAAS,SAAWL,EAAS,QACtC7E,OAAC,OAAA,CAAK,UAAU,sDACb,SAAA,CAAAkF,EAAS,OAAO,OAAKL,EAAS,MAAA,CAAA,CACjC,CAAA,EAEJ,EAKF7E,EAAAA,KAAC,MAAA,CAAI,UAAU,kBACZ,SAAA,CAAA,CAACmE,GAAaU,EAAS,OAAS,GAAKK,EAAS,OAAS,GACtDpF,EAAAA,IAAC,MAAA,CAAI,UAAU,oCACb,SAAAA,EAAAA,IAACwD,IAAU,EACb,EAGDa,EACCrE,EAAAA,IAAC,MAAA,CAAI,UAAU,+BACZ,UAAC,EAAG,EAAG,CAAC,EAAE,IAAK4F,SACb,MAAA,CAAY,UAAU,yCAAbA,CAAqD,CAChE,EACH,EACER,EAAS,SAAW,QACrB,IAAA,CAAE,UAAU,kCACV,SAAAT,EACG,wCACA,8DAAA,CACN,QAEC,MAAA,CAAI,UAAU,oCACZ,SAAAS,EAAS,IAAKlD,GACblC,EAAAA,IAAC0D,EAAA,CAEC,QAAAxB,EACA,OAAQA,EAAQ,MAAQ2C,EACxB,QAAS,IAAMC,EAAe5C,EAAQ,GAAG,EACzC,YAAa,IAAMjD,EAAS,mBAAmB,mBAAmBiD,EAAQ,GAAG,CAAC,EAAE,CAAA,EAJ3EA,EAAQ,GAAA,CAMhB,CAAA,CACH,CAAA,EAEJ,EAEAlC,MAAClB,GAAmB,KAAM2F,EAAY,QAAS,IAAMC,EAAc,EAAK,CAAA,CAAG,CAAA,EAC7E,CAEJ"}
@@ -1,2 +0,0 @@
1
- import{a as b,j as e}from"./vendor-query-RUZdMvN6.js";import{a as z}from"./tasks-DHbFpQk4.js";import{a as V}from"./useEventHooks-DL3Vhz4g.js";import{D as S,f as L,C as J,u as q,a as G,J as P,S as T}from"./index-DSdqso-_.js";import{P as K}from"./PageHeaderWithStats-D9tQxILm.js";import{S as W}from"./StatusBadge-BDeUwPtb.js";import{W as Q}from"./WorkflowPill-CN-952iI.js";import{T as y}from"./TimestampCell-Be6tvFQd.js";import{L as D,e as X}from"./vendor-react-CdqEC2zv.js";import{R as Y}from"./RolePill-Di_5hfvw.js";import{U as Z}from"./UserName-D2SoVbe9.js";import"./vendor-icons-h-jlRSb9.js";import"./users-C0ke1Z-8.js";const ee="bg-stripes animate-pulse opacity-70";function $(t){switch(t){case"completed":return"text-status-success";case"in_progress":case"pending":return"text-status-warning";case"needs_intervention":return"text-status-error";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function I(t){switch(t){case"resolved":return"text-status-success";case"pending":return"text-status-warning";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function te(t,a,l){return`${t==="task"?"Task":l?"Notification":"Escalation"} is ${a.replace(/_/g," ")}`}function se(t,a){if(a)return ee;switch(t){case"completed":case"resolved":return"bg-status-success";case"pending":case"in_progress":case"needs_intervention":return"bg-status-warning";case"cancelled":return"bg-status-error";default:return"bg-text-tertiary"}}function ae(t){return t.startsWith("mcp")||t.startsWith("Mcp")}function E(t){return!t.workflow_type}function A(t,a){if(t.length<=a)return t;const l=Math.floor((a-1)/2);return`${t.slice(0,l)}…${t.slice(t.length-l)}`}function ne(t,a){const l=Date.now(),c=new Map,x=[];for(const s of a)s.task_id?(c.has(s.task_id)||c.set(s.task_id,[]),c.get(s.task_id).push(s)):x.push(s);const r=[...t].sort((s,d)=>new Date(s.created_at).getTime()-new Date(d.created_at).getTime()),i=[];for(const s of t)i.push(new Date(s.created_at).getTime()),s.completed_at&&i.push(new Date(s.completed_at).getTime());for(const s of a)i.push(new Date(s.created_at).getTime()),s.resolved_at&&i.push(new Date(s.resolved_at).getTime()),s.claimed_at&&i.push(new Date(s.claimed_at).getTime());if(i.length===0)return{lanes:[],timeMin:0,timeMax:1};const o=Math.min(...i),f=t.some(s=>!s.completed_at)||a.some(s=>!s.resolved_at)?Math.max(l,Math.max(...i)):Math.max(...i),p=f-o||1,m=s=>(s-o)/p*100,h=[];for(const s of r){const d=new Date(s.created_at).getTime(),j=s.completed_at?new Date(s.completed_at).getTime():l,g=!s.completed_at;h.push({kind:"task",id:s.id,label:s.workflow_type,taskId:s.id,startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:g,task:s});const v=(c.get(s.id)||[]).sort((n,u)=>new Date(n.created_at).getTime()-new Date(u.created_at).getTime());for(const n of v){const u=new Date(n.created_at).getTime(),N=n.resolved_at?new Date(n.resolved_at).getTime():l,M=!n.resolved_at;let w=null;if(n.claimed_at){const U=new Date(n.claimed_at).getTime(),H=N-u||1;w=(U-u)/H*100}h.push({kind:"escalation",id:n.id,label:n.role,taskId:s.id,startMs:u,endMs:N,startPct:m(u),widthPct:Math.max((N-u)/p*100,.5),durationMs:N-u,isOpen:M,escalation:n,claimPct:w})}}for(const s of x){const d=new Date(s.created_at).getTime(),j=s.resolved_at?new Date(s.resolved_at).getTime():l;let g=null;if(s.claimed_at){const v=new Date(s.claimed_at).getTime(),n=j-d||1;g=(v-d)/n*100}h.push({kind:"escalation",id:s.id,label:s.role,taskId:"",startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:!s.resolved_at,escalation:s,claimPct:g})}return{lanes:h,timeMin:o,timeMax:f}}function re(t,a,l,c=500){const[x,r]=b.useState(0),i=b.useRef(null),o=l-a||1;b.useEffect(()=>{if(t===0)return;i.current=null,r(0);let f;const p=m=>{i.current===null&&(i.current=m);const h=m-i.current,s=Math.min(h/c,1),d=1-Math.pow(1-s,3);r(d),s<1&&(f=requestAnimationFrame(p))};return f=requestAnimationFrame(p),()=>cancelAnimationFrame(f)},[t,c]);const k=b.useCallback(f=>{const p=(f.startMs-a)/o,m=(f.endMs-a)/o;if(x<p)return{width:0,opacity:0};const h=m-p||.001,s=Math.min((x-p)/h,1),d=f.widthPct*s,j=Math.min(s/.1,1);return{width:d,opacity:j}},[x,a,o]);return{progress:x,animatedBar:k}}function R({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}function B({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})})}function F({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}function ie({allExpanded:t,onToggleAll:a}){return e.jsxs("div",{className:"flex items-center gap-4 mb-4 flex-wrap",children:[e.jsx("button",{onClick:a,className:"text-2xs text-accent hover:underline",children:t?"Collapse all":"Expand all"}),e.jsxs("div",{className:"flex items-center gap-4 ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"AI Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Escalation"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Notification"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-success"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Done"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-warning"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Active"})]})]})]})}function oe({ticks:t}){return e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-52 shrink-0"}),e.jsx("div",{className:"flex-1 relative h-6 border-b border-surface-border",children:t.map(a=>e.jsx("span",{className:"absolute text-2xs font-mono text-text-tertiary -translate-x-1/2 bottom-1 whitespace-nowrap",style:{left:`${a.pct}%`},children:a.label},a.pct))})]})}function _({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-xs text-text-primary",children:a})]})}function le({traceId:t,href:a}){const[l,c]=b.useState(!1),x=i=>{i.stopPropagation(),navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),1500)},r=i=>{i.stopPropagation(),a&&window.open(a,"_blank","noopener,noreferrer")};return e.jsxs("span",{className:"group/trace inline-flex items-center gap-1.5",children:[a&&e.jsx("button",{onClick:r,title:"Open trace",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:"w-3 h-3 text-text-tertiary hover:text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5-4.5h6m0 0v6m0-6L10.5 15"})})}),e.jsx("button",{onClick:x,title:"Copy trace ID",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:`w-3 h-3 transition-colors ${l?"text-status-success":"text-text-tertiary hover:text-accent"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"})})}),e.jsx("span",{className:"text-2xs text-accent",children:"Trace Details"})]})}function ce({task:t,traceUrl:a}){const l=t.completed_at?new Date(t.completed_at).getTime()-new Date(t.created_at).getTime():Date.now()-new Date(t.created_at).getTime();return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Q,{type:t.workflow_type})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Started",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Completed",children:t.completed_at?e.jsx(y,{date:t.completed_at}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"In progress"})}),e.jsx(_,{label:"Duration",children:e.jsx(S,{ms:l,className:"font-mono text-sm"})})]}),t.milestones.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Milestones"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.milestones.map((c,x)=>e.jsxs("span",{className:"px-2 py-0.5 text-2xs font-mono bg-accent-faint/50 rounded text-text-secondary",children:[c.name,": ",String(c.value)]},x))})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-2xs text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/workflows/tasks/detail/${t.id}`,className:"block text-2xs text-accent hover:underline",children:"Task Details"}),t.trace_id&&e.jsx(le,{traceId:t.trace_id,href:a?a.replace("{traceId}",t.trace_id):void 0})]})]})}function de({escalation:t}){const a=new Date(t.created_at).getTime(),l=t.claimed_at?new Date(t.claimed_at).getTime()-a:null,c=t.resolved_at?new Date(t.resolved_at).getTime()-a:null;return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Y,{role:t.role}),t.type&&e.jsxs("span",{className:"text-2xs text-text-tertiary",children:[t.type,t.subtype?` / ${t.subtype}`:""]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Created",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Claimed",children:t.claimed_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.claimed_at}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-0.5",children:["after ",e.jsx(S,{ms:l}),t.assigned_to&&e.jsxs(e.Fragment,{children:[" ","by"," ",e.jsx("span",{className:"text-text-secondary font-medium",children:e.jsx(Z,{userId:t.assigned_to})})]})]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Unclaimed"})}),e.jsx(_,{label:"Resolved",children:t.resolved_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.resolved_at}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-0.5",children:[e.jsx(S,{ms:c})," total"]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Pending"})})]}),t.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("p",{className:"text-2xs text-text-secondary leading-relaxed",children:t.description})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[t.workflow_id&&e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-2xs text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/escalations/detail/${t.id}`,className:"block text-2xs text-accent hover:underline",children:"Escalation Details"})]})]})}function xe({lane:t,ticks:a,isExpanded:l,onToggle:c,anim:x,animDone:r,traceUrl:i}){var m,h;const o=t.kind==="task",k=o?t.task.status:t.escalation.status,f=se(k,t.isOpen),p=x.opacity>0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center border-b border-surface-border cursor-pointer hover:bg-surface-sunken/40 transition-colors",onClick:c,children:[e.jsxs("div",{className:`w-52 shrink-0 py-3 pr-4 flex items-center gap-2 ${o?"":"pl-6"}`,style:{opacity:p?1:0,transition:"opacity 0.15s ease-out"},children:[o?ae(t.task.workflow_type)?e.jsx(B,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):e.jsx(R,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):E(t.escalation)?e.jsx(O,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}):e.jsx(F,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}),e.jsx("p",{className:"text-xs font-mono text-text-secondary whitespace-nowrap overflow-hidden",title:te(t.kind,o?t.task.status:t.escalation.status,!o&&E(t.escalation)),children:o?A(t.label,24):A(((m=t.escalation)==null?void 0:m.role)??t.label,20)})]}),e.jsxs("div",{className:"flex-1 relative h-10",children:[a.map(s=>e.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-surface-border opacity-30",style:{left:`${s.pct}%`}},s.pct)),e.jsxs("div",{className:`absolute top-2 h-6 rounded-sm ${l?`${f} ring-2 ring-accent ring-offset-1`:`${f} hover:opacity-80`}`,style:{left:`${t.startPct}%`,width:p?`${Math.max(x.width,.3)}%`:"0%",minWidth:p?"4px":"0px",opacity:x.opacity},title:`${t.label} — ${L(t.durationMs)} — ${new Date(t.startMs).toLocaleTimeString()}`,children:[x.width>8&&r&&e.jsx("span",{className:"absolute inset-0 flex items-center px-1.5 text-2xs font-mono text-text-inverse truncate",children:L(t.durationMs)}),t.claimPct!=null&&r&&e.jsx("div",{className:"absolute top-0 bottom-0 w-px border-l border-dashed border-text-inverse/70",style:{left:`${t.claimPct}%`},title:(h=t.escalation)!=null&&h.assigned_to?`Claimed by ${t.escalation.assigned_to}`:"Claimed",children:e.jsx("div",{className:"absolute -top-1 -left-[3px] w-[7px] h-[7px] rounded-full bg-text-inverse border border-status-warning"})})]})]})]}),e.jsx(J,{open:l,children:e.jsx("div",{className:"py-4 px-6 pl-52 border-b border-surface-border bg-surface-sunken/20",children:o&&t.task?e.jsx(ce,{task:t.task,traceUrl:i}):t.escalation?e.jsx(de,{escalation:t.escalation}):null})})]})}function me({tasks:t,escalations:a,traceUrl:l}){const[c,x]=b.useState(new Set),{lanes:r,timeMin:i,timeMax:o}=b.useMemo(()=>ne(t,a),[t,a]),k=o-i||1,{progress:f,animatedBar:p}=re(r.length,i,o);if(r.length===0)return e.jsx("p",{className:"text-sm text-text-tertiary py-8 text-center",children:"No events in this process."});const m=5,h=Array.from({length:m+1},(n,u)=>({pct:u/m*100,label:L(Math.round(u/m*k))})),s=n=>{x(u=>{const N=new Set(u);return N.has(n)?N.delete(n):N.add(n),N})},d=r.map(n=>n.id),j=d.length>0&&d.every(n=>c.has(n)),g=()=>{x(j?new Set:new Set(d))},v=f>=1;return e.jsxs("div",{className:"py-2",children:[e.jsx(ie,{allExpanded:j,onToggleAll:g}),e.jsx(oe,{ticks:h}),r.map(n=>e.jsx(xe,{lane:n,ticks:h,isExpanded:c.has(n.id),onToggle:()=>s(n.id),anim:p(n),animDone:v,traceUrl:l},`${n.kind}-${n.id}`))]})}function C(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}function ue(t){return t.length===0?null:[...t].sort((a,l)=>new Date(a.created_at).getTime()-new Date(l.created_at).getTime())[0]}function De(){var j;const{originId:t}=X();V(t);const{data:a,isLoading:l}=z(t??""),{data:c}=q(),x=((j=c==null?void 0:c.telemetry)==null?void 0:j.traceUrl)??null,r=(a==null?void 0:a.tasks)??[],i=(a==null?void 0:a.escalations)??[],o=b.useMemo(()=>ue(r),[r]),k=b.useMemo(()=>C(o==null?void 0:o.envelope),[o]),f=b.useMemo(()=>{if(o!=null&&o.data)return C(o.data);const g=r.filter(v=>v.status==="completed"&&v.data).sort((v,n)=>new Date(n.completed_at).getTime()-new Date(v.completed_at).getTime());return g.length>0?C(g[0].data):null},[o,r]),p=b.useMemo(()=>r.length>0&&r.some(g=>g.status!=="completed"&&g.status!=="cancelled"),[r]),m=b.useMemo(()=>{const g=r.filter(u=>u.status==="completed").length,v=r.filter(u=>u.status==="needs_intervention").length,n=i.filter(u=>u.status==="resolved").length;return{tasks:r.length,completed:g,escalated:v,escalations:i.length,resolved:n}},[r,i]),h=b.useMemo(()=>{if(r.length===0&&i.length===0)return null;const v=[...r.map(w=>w.created_at),...i.map(w=>w.created_at)].sort()[0],n=r.every(w=>w.status==="completed"||w.status==="cancelled"),u=i.every(w=>w.status==="resolved"),N=r.length>0&&n&&u,M=N?[...r.map(w=>w.completed_at),...i.map(w=>w.resolved_at)].filter(Boolean).sort().pop()??null:null;return{startIso:v,endIso:M,isFinished:N,elapsed:G(v,M)}},[r,i]),s=b.useMemo(()=>{const g=[];return h&&g.push({label:h.isFinished?"Completed":"Running",value:h.elapsed,dotClass:h.isFinished?"bg-status-success":"bg-status-pending animate-pulse"}),g.push({label:"Tasks",value:`${m.completed}/${m.tasks}`},{label:"Escalations",value:`${m.resolved}/${m.escalations}`}),g},[h,m]);if(l&&r.length===0)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-40 bg-surface-sunken rounded"})]});const d=k||f||p;return e.jsxs("div",{children:[e.jsx(K,{title:"Process Detail",docsHash:"#docs:dashboard.md:process-detail",subtitle:t,stats:s}),d&&e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-2 gap-8 mb-10",children:[e.jsx("div",{children:k?e.jsx(P,{data:k,label:"Input",defaultMode:"json",defaultCollapsed:!0}):e.jsxs("div",{children:[e.jsx(T,{children:"Input"}),e.jsx("div",{className:"font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-tertiary italic mt-2",children:"Waiting for task..."})]})}),e.jsx("div",{children:f?e.jsx(P,{data:f,label:"Output",defaultMode:"json",defaultCollapsed:!0}):p?e.jsxs("div",{children:[e.jsx(T,{children:"Output"}),e.jsxs("div",{className:"flex items-center gap-2 font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-secondary mt-2",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-pending animate-pulse"}),"Processing..."]})]}):null})]}),e.jsx(T,{className:"mb-6",children:"Timeline"}),e.jsx(me,{tasks:r,escalations:i,traceUrl:x})]})}export{De as ProcessDetailPage};
2
- //# sourceMappingURL=ProcessDetailPage-CZ09xiWf.js.map
@@ -1,2 +0,0 @@
1
- import{j as s}from"./vendor-query-RUZdMvN6.js";import{u as x}from"./tasks-DHbFpQk4.js";import{u as h}from"./workflows-DR9OQcuq.js";import{u as w}from"./useEventHooks-DL3Vhz4g.js";import{u as k}from"./useFilterParams-crmlBw_l.js";import{u as y}from"./useDebouncedValue-C4P2jQuh.js";import{b as v}from"./api-path-u2Jf9QXS.js";import{D as _}from"./DataTable-DFPMeqyQ.js";import{T as c}from"./TimestampCell-Be6tvFQd.js";import{S as b}from"./StickyPagination-BsbSade1.js";import{F as j,a as P,b as p}from"./FilterBar-fwUqeM-5.js";import{P as S}from"./PageHeader-CFVw67M6.js";import{L as N}from"./ListToolbar-BEogxu1f.js";import{W as C}from"./WorkflowPill-CN-952iI.js";import{u as T}from"./vendor-react-CdqEC2zv.js";import"./index-DSdqso-_.js";import"./vendor-icons-h-jlRSb9.js";import"./EmptyState-lpUFYfun.js";const F=[{value:"active",label:"Active"},{value:"completed",label:"Completed"},{value:"escalated",label:"Escalated"}],z=[{key:"origin_id",label:"Origin",render:e=>s.jsx("span",{className:"font-mono text-xs",title:e.origin_id,children:e.origin_id.length>40?`${e.origin_id.slice(0,40)}…`:e.origin_id})},{key:"workflow_types",label:"Workflows",render:e=>s.jsx("div",{className:"flex flex-wrap gap-1",children:e.workflow_types.map(a=>s.jsx(C,{type:a},a))})},{key:"task_count",label:"Tasks",render:e=>s.jsx("span",{children:e.task_count}),className:"w-20 text-right"},{key:"completed",label:"Completed",render:e=>e.completed>0?s.jsx("span",{className:"text-status-success",children:e.completed}):s.jsx("span",{className:"text-text-tertiary",children:"0"}),className:"w-24 text-right"},{key:"escalated",label:"Escalated",render:e=>e.escalated>0?s.jsx("span",{className:"text-status-error",children:e.escalated}):s.jsx("span",{className:"text-text-tertiary",children:"0"}),className:"w-24 text-right"},{key:"started_at",label:"Started",render:e=>s.jsx(c,{date:e.started_at}),className:"w-44"},{key:"last_activity",label:"Last Activity",render:e=>s.jsx(c,{date:e.last_activity}),className:"w-44"}];function Q(){w();const e=T(),{filters:a,setFilter:i,pagination:o}=k({filters:{workflow_type:"",status:"",search:""}}),l=y(a.search,300),{data:m}=h(),d=[...new Set((m??[]).map(t=>t.workflow_type))].sort(),{data:r,isLoading:f,refetch:u,isFetching:g}=x({workflow_type:a.workflow_type||void 0,status:a.status||void 0,search:l||void 0,limit:o.pageSize,offset:o.offset}),n=(r==null?void 0:r.total)??0;return s.jsxs("div",{children:[s.jsx(S,{title:"All Processes",docsHash:"#docs:dashboard.md:processes-overview"}),s.jsxs(j,{actions:s.jsx(N,{onRefresh:()=>u(),isFetching:g,apiPath:v("/tasks/processes",{limit:o.pageSize,offset:o.offset,workflow_type:a.workflow_type||void 0,status:a.status||void 0,search:l||void 0})}),children:[s.jsx(P,{label:"Search",value:a.search,onChange:t=>i("search",t),placeholder:"origin, workflow, or trace ID"}),s.jsx(p,{label:"Status",value:a.status,onChange:t=>i("status",t),options:F}),s.jsx(p,{label:"Workflow Type",value:a.workflow_type,onChange:t=>i("workflow_type",t),options:d.map(t=>({value:t,label:t}))})]}),s.jsx(_,{columns:z,data:(r==null?void 0:r.processes)??[],keyFn:t=>t.origin_id,onRowClick:t=>e(`/processes/detail/${encodeURIComponent(t.origin_id)}`),isLoading:f,emptyMessage:"No business processes found"}),s.jsx(b,{page:o.page,totalPages:o.totalPages(n),onPageChange:o.setPage,total:n,pageSize:o.pageSize,onPageSizeChange:o.setPageSize})]})}export{Q as ProcessesListPage};
2
- //# sourceMappingURL=ProcessesListPage-BT76_7bW.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProcessesListPage-BT76_7bW.js","sources":["../../src/pages/processes/ProcessesListPage.tsx"],"sourcesContent":["import { useNavigate } from 'react-router-dom';\nimport { useProcesses, type ProcessSummary } from '../../api/tasks';\nimport { useWorkflowConfigs } from '../../api/workflows';\nimport { useProcessListEvents } from '../../hooks/useEventHooks';\nimport { useFilterParams } from '../../hooks/useFilterParams';\nimport { useDebouncedValue } from '../../hooks/useDebouncedValue';\nimport { buildApiPath } from '../../lib/api-path';\nimport { DataTable, type Column } from '../../components/common/data/DataTable';\nimport { TimestampCell } from '../../components/common/display/TimestampCell';\nimport { StickyPagination } from '../../components/common/data/StickyPagination';\nimport { FilterBar, FilterSelect, FilterInput } from '../../components/common/data/FilterBar';\nimport { PageHeader } from '../../components/common/layout/PageHeader';\nimport { ListToolbar } from '../../components/common/data/ListToolbar';\nimport { WorkflowPill } from '../../components/common/display/WorkflowPill';\n\nconst STATUS_OPTIONS = [\n { value: 'active', label: 'Active' },\n { value: 'completed', label: 'Completed' },\n { value: 'escalated', label: 'Escalated' },\n];\n\nconst columns: Column<ProcessSummary>[] = [\n {\n key: 'origin_id',\n label: 'Origin',\n render: (row) => (\n <span className=\"font-mono text-xs\" title={row.origin_id}>\n {row.origin_id.length > 40 ? `${row.origin_id.slice(0, 40)}…` : row.origin_id}\n </span>\n ),\n },\n {\n key: 'workflow_types',\n label: 'Workflows',\n render: (row) => (\n <div className=\"flex flex-wrap gap-1\">\n {row.workflow_types.map((wt) => (\n <WorkflowPill key={wt} type={wt} />\n ))}\n </div>\n ),\n },\n {\n key: 'task_count',\n label: 'Tasks',\n render: (row) => <span>{row.task_count}</span>,\n className: 'w-20 text-right',\n },\n {\n key: 'completed',\n label: 'Completed',\n render: (row) =>\n row.completed > 0\n ? <span className=\"text-status-success\">{row.completed}</span>\n : <span className=\"text-text-tertiary\">0</span>,\n className: 'w-24 text-right',\n },\n {\n key: 'escalated',\n label: 'Escalated',\n render: (row) =>\n row.escalated > 0\n ? <span className=\"text-status-error\">{row.escalated}</span>\n : <span className=\"text-text-tertiary\">0</span>,\n className: 'w-24 text-right',\n },\n {\n key: 'started_at',\n label: 'Started',\n render: (row) => <TimestampCell date={row.started_at} />,\n className: 'w-44',\n },\n {\n key: 'last_activity',\n label: 'Last Activity',\n render: (row) => <TimestampCell date={row.last_activity} />,\n className: 'w-44',\n },\n];\n\nexport function ProcessesListPage() {\n useProcessListEvents();\n const navigate = useNavigate();\n const { filters, setFilter, pagination } = useFilterParams({\n filters: { workflow_type: '', status: '', search: '' },\n });\n\n const debouncedSearch = useDebouncedValue(filters.search, 300);\n\n const { data: configs } = useWorkflowConfigs();\n const workflowTypes = [...new Set((configs ?? []).map((c) => c.workflow_type))].sort();\n\n const { data, isLoading, refetch, isFetching } = useProcesses({\n workflow_type: filters.workflow_type || undefined,\n status: filters.status || undefined,\n search: debouncedSearch || undefined,\n limit: pagination.pageSize,\n offset: pagination.offset,\n });\n\n const total = data?.total ?? 0;\n\n return (\n <div>\n <PageHeader title=\"All Processes\" docsHash=\"#docs:dashboard.md:processes-overview\" />\n\n <FilterBar actions={\n <ListToolbar\n onRefresh={() => refetch()}\n isFetching={isFetching}\n apiPath={buildApiPath('/tasks/processes', {\n limit: pagination.pageSize,\n offset: pagination.offset,\n workflow_type: filters.workflow_type || undefined,\n status: filters.status || undefined,\n search: debouncedSearch || undefined,\n })}\n />\n }>\n <FilterInput\n label=\"Search\"\n value={filters.search}\n onChange={(v) => setFilter('search', v)}\n placeholder=\"origin, workflow, or trace ID\"\n />\n <FilterSelect\n label=\"Status\"\n value={filters.status}\n onChange={(v) => setFilter('status', v)}\n options={STATUS_OPTIONS}\n />\n <FilterSelect\n label=\"Workflow Type\"\n value={filters.workflow_type}\n onChange={(v) => setFilter('workflow_type', v)}\n options={workflowTypes.map((t) => ({ value: t, label: t }))}\n />\n </FilterBar>\n\n <DataTable\n columns={columns}\n data={data?.processes ?? []}\n keyFn={(row) => row.origin_id}\n onRowClick={(row) => navigate(`/processes/detail/${encodeURIComponent(row.origin_id)}`)}\n isLoading={isLoading}\n emptyMessage=\"No business processes found\"\n />\n\n <StickyPagination\n page={pagination.page}\n totalPages={pagination.totalPages(total)}\n onPageChange={pagination.setPage}\n total={total}\n pageSize={pagination.pageSize}\n onPageSizeChange={pagination.setPageSize}\n />\n </div>\n );\n}\n"],"names":["STATUS_OPTIONS","columns","row","jsx","wt","WorkflowPill","TimestampCell","ProcessesListPage","useProcessListEvents","navigate","useNavigate","filters","setFilter","pagination","useFilterParams","debouncedSearch","useDebouncedValue","configs","useWorkflowConfigs","workflowTypes","c","data","isLoading","refetch","isFetching","useProcesses","total","PageHeader","jsxs","FilterBar","ListToolbar","buildApiPath","FilterInput","v","FilterSelect","DataTable","StickyPagination"],"mappings":"syBAeA,MAAMA,EAAiB,CACrB,CAAE,MAAO,SAAU,MAAO,QAAA,EAC1B,CAAE,MAAO,YAAa,MAAO,WAAA,EAC7B,CAAE,MAAO,YAAa,MAAO,WAAA,CAC/B,EAEMC,EAAoC,CACxC,CACE,IAAK,YACL,MAAO,SACP,OAASC,GACPC,EAAAA,IAAC,QAAK,UAAU,oBAAoB,MAAOD,EAAI,UAC5C,SAAAA,EAAI,UAAU,OAAS,GAAK,GAAGA,EAAI,UAAU,MAAM,EAAG,EAAE,CAAC,IAAMA,EAAI,SAAA,CACtE,CAAA,EAGJ,CACE,IAAK,iBACL,MAAO,YACP,OAASA,SACN,MAAA,CAAI,UAAU,uBACZ,SAAAA,EAAI,eAAe,IAAKE,GACvBD,EAAAA,IAACE,EAAA,CAAsB,KAAMD,CAAA,EAAVA,CAAc,CAClC,CAAA,CACH,CAAA,EAGJ,CACE,IAAK,aACL,MAAO,QACP,OAASF,GAAQC,MAAC,OAAA,CAAM,WAAI,WAAW,EACvC,UAAW,iBAAA,EAEb,CACE,IAAK,YACL,MAAO,YACP,OAASD,GACPA,EAAI,UAAY,EACZC,MAAC,OAAA,CAAK,UAAU,sBAAuB,WAAI,UAAU,QACpD,OAAA,CAAK,UAAU,qBAAqB,SAAA,IAAC,EAC5C,UAAW,iBAAA,EAEb,CACE,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W,OACnB,cAAeF,EAAQ,eAAiB,OACxC,OAAQA,EAAQ,QAAU,OAC1B,OAAQI,GAAmB,MAAA,CAC5B,CAAA,CAAA,EAGH,SAAA,CAAAZ,EAAAA,IAAC6B,EAAA,CACC,MAAM,SACN,MAAOrB,EAAQ,OACf,SAAWsB,GAAMrB,EAAU,SAAUqB,CAAC,EACtC,YAAY,+BAAA,CAAA,EAEd9B,EAAAA,IAAC+B,EAAA,CACC,MAAM,SACN,MAAOvB,EAAQ,OACf,SAAWsB,GAAMrB,EAAU,SAAUqB,CAAC,EACtC,QAASjC,CAAA,CAAA,EAEXG,EAAAA,IAAC+B,EAAA,CACC,MAAM,gBACN,MAAOvB,EAAQ,cACf,SAAWsB,GAAMrB,EAAU,gBAAiBqB,CAAC,EAC7C,QAASd,EAAc,IAAK,IAAO,CAAE,MAAO,EAAG,MAAO,GAAI,CAAA,CAAA,CAC5D,EACF,EAEAhB,EAAAA,IAACgC,EAAA,CACC,QAAAlC,EACA,MAAMoB,GAAA,YAAAA,EAAM,YAAa,CAAA,EACzB,MAAQnB,GAAQA,EAAI,UACpB,WAAaA,GAAQO,EAAS,qBAAqB,mBAAmBP,EAAI,SAAS,CAAC,EAAE,EACtF,UAAAoB,EACA,aAAa,6BAAA,CAAA,EAGfnB,EAAAA,IAACiC,EAAA,CACC,KAAMvB,EAAW,KACjB,WAAYA,EAAW,WAAWa,CAAK,EACvC,aAAcb,EAAW,QACzB,MAAAa,EACA,SAAUb,EAAW,SACrB,iBAAkBA,EAAW,WAAA,CAAA,CAC/B,EACF,CAEJ"}
@@ -1,8 +0,0 @@
1
- import{j as e,a as u}from"./vendor-query-RUZdMvN6.js";import{ad as X,ae as E,J as ee,I as te}from"./index-DSdqso-_.js";import{a as se}from"./users-C0ke1Z-8.js";import{A as ae}from"./AutoGrowTextarea-DgEQeRQw.js";import{C as ne}from"./ConfirmDeleteModal-CQsJUzEa.js";import{aN as U,T as re,L as J,aO as B,aP as ie,Y as K,aE as oe,n as L,am as le,P as W,I as F,B as ce,o as V,a8 as de,aQ as xe}from"./vendor-icons-h-jlRSb9.js";import{u as me,L as I,e as he,f as ue}from"./vendor-react-CdqEC2zv.js";import"./Modal-BU7No9NH.js";function pe({role:t}){const{data:a}=se({role:t,limit:100}),s=(a==null?void 0:a.users)??[];return s.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Assign users to this role to staff its queue. Members see and resolve escalations here according to their read/write scope; admins manage the role itself."}):e.jsx("div",{className:"divide-y divide-surface-border/40",children:s.map(i=>{const c=i.roles.find(n=>n.role===t);return c?e.jsxs("div",{className:"flex items-center justify-between py-1.5 gap-2",children:[e.jsx("span",{className:"text-xs text-text-secondary truncate",children:i.display_name||i.external_id}),e.jsx("span",{className:"text-2xs text-text-quaternary font-mono shrink-0",children:fe(c)})]},i.id):null})})}function fe(t){return t.type==="superadmin"||t.type==="admin"?t.type:`member · read ${t.read_scope} · write ${t.write_scope}`}function T(t){return t==null?"":JSON.stringify(t,null,2)}function S(t){const a=t.trim();if(!a)return{ok:!0,value:void 0};try{const s=JSON.parse(a);return typeof s!="object"||Array.isArray(s)||s===null?{ok:!1}:{ok:!0,value:s}}catch{return{ok:!1}}}const M=/^[a-zA-Z0-9_]+$/;function be(t){var s;const a=S(t);return a.ok&&((s=a.value)==null?void 0:s.kiosk)===!0}function ve(t){const a=S(t);if(!a.ok)return null;const s={...a.value??{}};return s.kiosk===!0?delete s.kiosk:s.kiosk=!0,JSON.stringify(s,null,2)}const je={title:"",description:"",ops_visible:!1,ops_home_default:!1,enforce_schema:!1,parent_role:"",metadata_schema:"",properties:"{}",sla_minutes:"",target_per_hour:"",worker_count:"",priority_threshold_minutes:"",priority_facet:"",entity_facet:"",entity_state_source:"role"};function ye(t){return{title:t.title??"",description:t.description??"",ops_visible:t.ops_visible,ops_home_default:t.ops_home_default,enforce_schema:t.enforce_schema,parent_role:t.parent_role??"",metadata_schema:T(t.metadata_schema),properties:T(t.properties)||"{}",sla_minutes:t.sla_minutes!=null?String(t.sla_minutes):"",target_per_hour:t.target_per_hour!=null?String(t.target_per_hour):"",worker_count:t.worker_count!=null?String(t.worker_count):"",priority_threshold_minutes:t.priority_threshold_minutes!=null?String(t.priority_threshold_minutes):"",priority_facet:t.priority_facet??"",entity_facet:t.entity_facet??"",entity_state_source:t.entity_state_source??"role"}}function p({icon:t,label:a,annotation:s,aside:i,accent:c=!1,children:n}){const r=c?"text-accent":"text-text-tertiary";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(t,{className:`w-3 h-3 ${r} shrink-0`,strokeWidth:1.5}),e.jsx("span",{className:`text-2xs font-semibold uppercase tracking-widest ${r}`,children:a}),s&&e.jsxs("span",{className:"text-2xs text-text-quaternary truncate",children:["— ",s]})]}),i]}),e.jsx("div",{className:`border-l-2 pl-5 ${c?"border-accent/15":"border-surface-border/60"}`,children:n})]})}function G(){return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-success"}),e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-status-success",children:"Live"})]})}function q({checked:t,onChange:a,title:s}){return e.jsx("button",{onClick:a,title:s,className:`w-9 h-5 rounded-full transition-colors relative shrink-0 ${t?"bg-accent":"bg-surface-border"}`,children:e.jsx("span",{className:`absolute top-[3px] left-0 w-3.5 h-3.5 rounded-full bg-text-inverse transition-transform shadow ${t?"translate-x-[18px]":"translate-x-[3px]"}`})})}function ge({items:t,empty:a,onRemove:s}){return t.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:a}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(i=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs bg-accent/10 rounded-sm font-mono text-accent",children:[i,e.jsx("button",{onClick:()=>s(i),className:"text-accent/50 hover:text-status-error transition-colors leading-none ml-0.5",children:"×"})]},i))})}function _e({role:t,draft:a,update:s}){const i=me(),c=X(),[n,r]=u.useState(!1),m=t.user_count>0||t.chain_count>0||t.workflow_count>0;return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:U,label:"Identity",annotation:"name and description",accent:!0,children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Display Name"}),e.jsx("input",{type:"text",value:a.title,onChange:o=>s({title:o.target.value}),placeholder:`e.g., ${t.role.charAt(0).toUpperCase()+t.role.slice(1)}`,className:"input text-sm w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Description"}),e.jsx(ae,{value:a.description,onChange:o=>s({description:o}),placeholder:"A short description shown on role cards and in the operations view.",rows:2})]})]})}),e.jsx("div",{className:"border-t border-surface-border/40 pt-6",children:m?e.jsxs("p",{className:"text-2xs text-text-quaternary leading-relaxed",children:["This role is referenced by"," ",[t.user_count>0?`${t.user_count} member${t.user_count===1?"":"s"}`:null,t.workflow_count>0?`${t.workflow_count} workflow${t.workflow_count===1?"":"s"}`:null,t.chain_count>0?"routing config":null].filter(Boolean).join(", ")," ","and cannot be deleted."]}):e.jsxs("button",{onClick:()=>r(!0),className:"px-3 py-1.5 text-xs rounded-md text-status-error/60 hover:text-status-error hover:bg-status-error/10 transition-colors flex items-center gap-1",children:[e.jsx(re,{className:"w-3 h-3"})," Delete this role"]})}),e.jsx(ne,{open:n,onClose:()=>r(!1),onConfirm:()=>c.mutate(t.role,{onSuccess:()=>i("/admin/roles")}),title:"Delete Role",description:e.jsxs(e.Fragment,{children:["Delete role ",e.jsx("span",{className:"font-medium font-mono text-text-primary",children:t.role}),"? This cannot be undone."]}),isPending:c.isPending,error:c.error})]})}function Ne({role:t,allRoles:a,draft:s,update:i,errors:c}){const n=parseFloat(s.sla_minutes),r=parseFloat(s.target_per_hour),m=parseFloat(s.worker_count),o=!isNaN(n)&&n>0,f=!isNaN(r)&&r>0,y=!isNaN(m)&&m>0,d=o&&y&&!f?`→ target ≈ ${(m/(n/60)).toFixed(1)}/h`:o&&f&&!y?`→ workers ≈ ${(r*(n/60)).toFixed(1)}`:f&&y&&!o?`→ SLA ≈ ${(m/r*60).toFixed(0)}m`:null,v=u.useMemo(()=>a.filter(l=>{if(l.role===t.role)return!1;let h=l;const j=new Set;for(;h!=null&&h.parent_role;){if(h.parent_role===t.role)return!1;if(j.has(h.parent_role))break;j.add(h.parent_role),h=a.find(w=>w.role===h.parent_role)}return!0}),[a,t]);return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:J,label:"Station",annotation:"this role on the Pace Board",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Show as a station on the Pace Board"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Stations appear on the Operations chart and table with live counts, pace, and the time-in-state mix."})]}),e.jsx(q,{checked:s.ops_visible,onChange:()=>i({ops_visible:!s.ops_visible}),title:"Show as a station on the Pace Board"})]})}),e.jsx(p,{icon:B,label:"Capacity",annotation:"throughput = workers / (sla / 60)",children:e.jsxs("div",{className:"flex items-end gap-6",children:[[{key:"sla_minutes",label:"SLA",unit:"min",placeholder:"30"},{key:"target_per_hour",label:"Target",unit:"/h",placeholder:"20"},{key:"worker_count",label:"Workers",unit:"",placeholder:"4"}].map(({key:l,label:h,unit:j,placeholder:w})=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:[h,j&&e.jsx("span",{className:"normal-case font-normal ml-1",children:j})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:s[l],onChange:$=>i({[l]:$.target.value}),placeholder:w,className:"input text-xs w-20 font-mono"})]},l)),d&&e.jsx("span",{className:"text-2xs text-accent font-mono whitespace-nowrap pb-2",children:d})]})}),e.jsxs(p,{icon:B,label:"Priority",annotation:"when a pending item counts as overdue",children:[e.jsxs("div",{className:"flex items-end gap-6",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:["Threshold",e.jsx("span",{className:"normal-case font-normal ml-1",children:"min"})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:s.priority_threshold_minutes,onChange:l=>i({priority_threshold_minutes:l.target.value}),placeholder:s.sla_minutes||"60",className:"input text-xs w-20 font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:"Age Facet"}),e.jsx("input",{type:"text",value:s.priority_facet,onChange:l=>i({priority_facet:l.target.value}),placeholder:"created_at",className:"input text-xs w-36 font-mono"}),c.priority_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:c.priority_facet})]})]}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["Pending unclaimed items older than the threshold count as priority. Age is measured from the metadata facet (an ISO 8601 UTC timestamp, e.g. ",e.jsx("code",{className:"font-mono",children:"authorized_at"}),") or from"," ",e.jsx("code",{className:"font-mono",children:"created_at"})," when blank; the threshold falls back to SLA when blank."]})]}),e.jsxs(p,{icon:ie,label:"Entity",annotation:"what moves through this station",accent:!0,children:[e.jsx("input",{type:"text",value:s.entity_facet,onChange:l=>i({entity_facet:l.target.value}),placeholder:"serialNumber",className:"input text-xs w-44 font-mono"}),c.entity_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:c.entity_facet}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["The metadata key naming the entity that moves through this station —"," ",e.jsx("code",{className:"font-mono",children:"serialNumber"}),","," ",e.jsx("code",{className:"font-mono",children:"orderId"}),". Roles sharing a key form that entity's system: its state mix, per-entity dwell, and timelines all derive from it. Blank = the role has no entity notion."]}),s.entity_facet.trim()!==""&&e.jsxs("div",{className:"mt-5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1.5",children:"States from"}),e.jsx("div",{className:"flex items-center gap-1",children:[{value:"role",label:"Station"},{value:"subtype",label:"Subtypes"}].map(({value:l,label:h})=>e.jsx("button",{onClick:()=>i({entity_state_source:l}),className:`px-2.5 py-1 text-2xs rounded transition-colors ${s.entity_state_source===l?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:h},l))}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:["How this station names the entity's state. ",e.jsx("strong",{children:"Station"}),": being here is one state (a servicing or harvesting queue)."," ",e.jsx("strong",{children:"Subtypes"}),": this one role holds several states, named by each escalation's subtype (a fleet role parking"," ",e.jsx("code",{className:"font-mono",children:"ready"})," /"," ",e.jsx("code",{className:"font-mono",children:"printing"}),")."]})]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-out ${s.ops_visible?"opacity-100 max-h-[900px]":"opacity-0 max-h-0 pointer-events-none"}`,"aria-hidden":!s.ops_visible,children:e.jsx(p,{icon:K,label:"Sequence",annotation:"where this station sits on the floor",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Prior Step"}),e.jsxs("select",{value:s.parent_role,onChange:l=>i({parent_role:l.target.value}),className:"select text-sm w-full font-mono",children:[e.jsx("option",{value:"",children:"None — root process"}),v.map(l=>e.jsx("option",{value:l.role,children:l.title?`${l.role} — ${l.title}`:l.role},l.role))]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Places this role in one Pace Board sequence. A role with no prior step starts its own sequence."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Upstream Inputs"}),e.jsx(G,{})]}),e.jsx(we,{role:t,allRoles:a})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Home Segment"}),e.jsx(q,{checked:s.ops_home_default,onChange:()=>i({ops_home_default:!s.ops_home_default}),title:"Lead the home Pace Board with this role's sequence"})]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Lead the home page's Pace Board with this role's sequence. One role holds this — saving it here releases the previous holder. Unset everywhere, the board opens on its first sequence."})]})]})})})]})}function we({role:t,allRoles:a}){const s=E(),[i,c]=u.useState(""),n=t.upstream_roles??[],r=u.useMemo(()=>a.map(o=>o.role).filter(o=>o!==t.role&&o!=="superadmin"&&!n.includes(o)),[a,t.role,n]),m=o=>s.mutate({role:t.role,upstream_roles:o},{onSuccess:()=>c("")});return e.jsxs("div",{className:"space-y-2",children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:o=>c(o.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Add upstream input…"}),r.map(o=>e.jsx("option",{value:o,children:o},o))]}),e.jsx("button",{onClick:()=>{i&&m([...n,i])},disabled:!i||s.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:s.isPending?"…":"Add"})]}),e.jsx(ge,{items:n,empty:"Roles from other sequences this station draws input from. Add one above and it lands here.",onRemove:o=>m(n.filter(f=>f!==o))}),s.error&&e.jsx("p",{className:"text-2xs text-status-error",children:s.error.message})]})}function ke({role:t,draft:a,update:s,errors:i,editingJson:c,startEditingJson:n,setMetadataSchemaError:r}){return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:oe,label:"Enforcement",annotation:"server-side resolver validation",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Enforce the escalation form schema"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Every resolve surface — API, MCP, CLI — validates submitted payloads against this role's form schema and rejects violations with field-level errors before any state changes."})]}),e.jsx(q,{checked:a.enforce_schema,onChange:()=>s({enforce_schema:!a.enforce_schema}),title:"Validate every resolve payload against this role's form schema"})]})}),e.jsxs(p,{icon:L,label:"Escalation Schema",annotation:"the resolve form",accent:!0,aside:t.current_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_schema_version," in use"]}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["The form a person completes to resolve this role's escalations. Versioned — each save adds one; workflows pin any version via"," ",e.jsx("code",{className:"font-mono",children:"schemaVersion"}),"."]}),e.jsx(I,{to:`/admin/roles/${encodeURIComponent(t.role)}/schema`,className:"text-xs text-accent hover:underline",children:t.form_schema?`Open schema editor — v${t.current_schema_version??1} in use →`:"Define the escalation form →"})]}),e.jsxs(p,{icon:le,label:"Escalations List Schema",annotation:"rich list view",aside:t.current_list_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_list_schema_version," in use"]}):void 0,children:[e.jsx("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:"Richly formats the escalation list when it's scoped to just this role. Versioned on its own timeline — separate from the resolve form."}),e.jsx(I,{to:`/admin/roles/${encodeURIComponent(t.role)}/list-schema`,className:"text-xs text-accent hover:underline",children:t.list_schema?`Open list schema editor — v${t.current_list_schema_version??1} in use →`:"Define the list view →"})]}),e.jsxs(p,{icon:L,label:"Metadata Schema",annotation:"validates metadata at creation",aside:!c.has("metadata_schema")&&t.metadata_schema?e.jsx("button",{onClick:()=>n("metadata_schema"),className:"text-2xs text-accent hover:underline",children:"Edit"}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["Validates ",e.jsx("code",{className:"font-mono",children:"metadata"})," at creation time. Keys appear in faceted search autocomplete."]}),!c.has("metadata_schema")&&t.metadata_schema?e.jsx(ee,{data:t.metadata_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:a.metadata_schema,onChange:m=>{const o=m.target.value;s({metadata_schema:o}),r(S(o).ok?void 0:"Invalid JSON")},rows:10,spellCheck:!1,className:"input text-xs font-mono w-full resize-y",placeholder:`{
2
- "type": "object",
3
- "properties": {
4
- "order_id": { "type": "string" }
5
- },
6
- "required": ["order_id"]
7
- }`}),i.metadata_schema&&e.jsx("p",{className:"text-2xs text-status-error mt-1",children:i.metadata_schema})]})]})]})}function Se({role:t}){return e.jsx(p,{icon:W,label:"Default Pins",annotation:"pinned views every member starts with",aside:e.jsx(G,{}),accent:!0,children:e.jsx(Ce,{role:t})})}function Ce({role:t}){const a=E(),[s,i]=u.useState(""),[c,n]=u.useState(""),[r,m]=u.useState(!0),o=t.default_pins??[],f=d=>a.mutate({role:t.role,default_pins:d.length?d:null},{onSuccess:()=>{i(""),n(""),m(!0)}}),y=s.trim()!==""&&c.trim().startsWith("/");return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:s,onChange:d=>i(d.target.value),placeholder:"Label — e.g. Needs harvesting",className:"input text-xs w-40 shrink-0"}),e.jsx("input",{type:"text",value:c,onChange:d=>n(d.target.value),placeholder:"/escalations/available?role=…",className:"input text-xs font-mono flex-1"}),e.jsxs("label",{className:"flex items-center gap-1 text-2xs text-text-tertiary shrink-0",title:"Show a live count beside the label",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:d=>m(d.target.checked),className:"w-3 h-3 accent-accent"}),"count"]}),e.jsx("button",{onClick:()=>{y&&f([...o,{label:s.trim(),url:c.trim(),badge:r}])},disabled:!y||a.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:a.isPending?"…":"Add"})]}),o.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"Pinned views every member starts with — the persona's exact queries. Add one above and it lands here."}):e.jsx("div",{className:"space-y-1",children:o.map(d=>e.jsxs("div",{className:"flex items-baseline gap-2 text-2xs",children:[e.jsx("span",{className:"font-medium text-text-secondary shrink-0",children:d.label}),d.badge&&e.jsx("span",{className:"text-2xs text-accent shrink-0",title:"Shows a live count",children:"count"}),e.jsx("span",{className:"font-mono text-text-quaternary truncate flex-1",title:d.url,children:d.url}),e.jsx("button",{onClick:()=>f(o.filter(v=>v.label!==d.label)),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove pin ${d.label}`,children:"×"})]},d.label))}),a.error&&e.jsx("p",{className:"text-2xs text-status-error",children:a.error.message})]})}const z=[{key:"identity",label:"Identity",icon:U},{key:"pace-board",label:"Pace Board",icon:J},{key:"schemas",label:"Schemas",icon:L},{key:"members",label:"Members",icon:V},{key:"pins",label:"Pins",icon:W}],Pe=t=>z.some(a=>a.key===t);function Be(){const{role:t}=he(),{data:a,isLoading:s}=te(),i=E(),c=(a==null?void 0:a.roles)??[],n=c.find(x=>x.role===t),[r,m]=u.useState(je),[o,f]=u.useState(!1),[y,d]=u.useState(!1),[v,l]=u.useState({}),[h,j]=u.useState(new Set),w=x=>j(b=>new Set([...b,x])),[$,R]=ue(),D=$.get("section"),_=Pe(D)?D:"identity",H=u.useCallback(x=>{R(b=>{const g=new URLSearchParams(b);return g.set("section",x),g},{replace:!0})},[R]);u.useEffect(()=>{n&&(m(ye(n)),f(!1),d(!1),l({}),j(new Set))},[t,n==null?void 0:n.role]);const C=x=>{m(b=>({...b,...x})),f(!0),d(!1)},Y=()=>{if(!n)return;const x=S(r.metadata_schema),b=S(r.properties),g=r.priority_facet.trim(),A=r.entity_facet.trim(),N={};if(x.ok||(N.metadata_schema="Invalid JSON"),b.ok||(N.properties="Invalid JSON"),g&&!M.test(g)&&(N.priority_facet="Letters, numbers, underscores only"),A&&!M.test(A)&&(N.entity_facet="Letters, numbers, underscores only"),l(N),Object.keys(N).length)return;const P=O=>{const k=parseFloat(O);return isNaN(k)?null:k},Z=O=>{const k=P(O);return k==null?null:Math.round(k)};i.mutate({role:n.role,title:r.title.trim()||null,description:r.description.trim()||null,ops_visible:r.ops_visible,ops_home_default:r.ops_home_default,enforce_schema:r.enforce_schema,parent_role:r.parent_role||null,metadata_schema:x.value??null,properties:b.value??{},sla_minutes:P(r.sla_minutes),target_per_hour:P(r.target_per_hour),worker_count:Z(r.worker_count),priority_threshold_minutes:P(r.priority_threshold_minutes),priority_facet:g||null,entity_facet:A||null,entity_state_source:r.entity_state_source},{onSuccess:()=>{f(!1),d(!0),j(new Set),window.setTimeout(()=>d(!1),2500)}})};if(s)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded"})]});if(!n)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx(F,{className:"w-12 h-12 text-text-quaternary mb-4",strokeWidth:1}),e.jsx("h2",{className:"heading-3 mb-2",children:"Role not found"})]});const Q=o&&!Object.values(v).some(Boolean);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-10 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx(F,{className:"w-5 h-5 text-accent",strokeWidth:1.5}),e.jsx("h1",{className:"text-lg font-mono font-medium text-text-primary",children:n.role}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:role-detail"},className:"text-text-quaternary hover:text-accent transition-colors",title:"Open docs for this page",children:e.jsx(ce,{className:"w-4 h-4",strokeWidth:1.5})}),n.parent_role&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-text-quaternary font-mono",children:[e.jsx(K,{className:"w-3 h-3"})," ",n.parent_role]})]}),n.title&&e.jsx("p",{className:"text-sm text-text-secondary pl-8",children:n.title})]}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:z.map(x=>{const b=x.icon,g=_===x.key;return e.jsxs("button",{onClick:()=>H(x.key),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${g?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(b,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:x.label})]},x.key)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:Y,disabled:!Q||i.isPending,className:"w-full px-3 py-1.5 text-xs rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:i.isPending?"Saving…":o?"Save changes":"Save"}),y&&e.jsxs("span",{className:"flex items-center justify-center gap-1 text-xs text-status-success animate-page-enter",children:[e.jsx(de,{className:"w-3 h-3"})," Saved"]}),i.error&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:i.error.message}),Object.values(v).some(Boolean)&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:"Fix the highlighted fields before saving."})]})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2 max-w-3xl",children:[_==="identity"&&e.jsx(_e,{role:n,draft:r,update:C,errors:v}),_==="pace-board"&&e.jsx(Ne,{role:n,allRoles:c,draft:r,update:C,errors:v}),_==="schemas"&&e.jsx(ke,{role:n,draft:r,update:C,errors:v,editingJson:h,startEditingJson:w,setMetadataSchemaError:x=>l(b=>({...b,metadata_schema:x}))}),_==="members"&&e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:V,label:"Members",annotation:"read = what appears · write = what they can act on",accent:!0,children:e.jsx(pe,{role:n.role})}),e.jsx(p,{icon:xe,label:"Station Kiosk",annotation:"the locked viewport for single-role logins",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Lock single-role members to this queue"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"A member who holds only this role signs in to a locked viewport: no side navigation, this queue as home, held to the list, the item detail, and the scan screens. Members with other roles keep the full dashboard."})]}),e.jsx(q,{checked:be(r.properties),onChange:()=>{const x=ve(r.properties);x!==null&&C({properties:x})},title:"Kiosk station viewport"})]})})]}),_==="pins"&&e.jsx(Se,{role:n})]})]})]})}export{Be as RoleDetailPage};
8
- //# sourceMappingURL=RoleDetailPage-CDsJKPvV.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,a as g}from"./vendor-query-RUZdMvN6.js";import{_ as d,ar as W,as as B,at as F,I as J,ap as _,au as U,aq as V,av as G}from"./index-DSdqso-_.js";import{C as Y}from"./ConfirmDeleteModal-CQsJUzEa.js";import{P as K}from"./PageHeader-CFVw67M6.js";import{f as O,T as q,ah as z,ag as Q,j as X,a as M,h as Z}from"./vendor-icons-h-jlRSb9.js";import{e as ee,f as te,u as se}from"./vendor-react-CdqEC2zv.js";import"./Modal-BU7No9NH.js";const ae=[d.SHOW_DETAIL,d.CLAIM,d.CLAIM_SHOW_DETAIL,d.RELEASE,d.RESOLVE,d.ESCALATE,d.CANCEL],ne=()=>({label:"",verb:d.RESOLVE});function le({choices:s,onChange:t}){const x=(o,m)=>t(s.map((c,u)=>u===o?{...c,...m}:c)),l=o=>t(s.filter((m,c)=>c!==o));return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"block text-xs text-text-secondary",children:["Choices ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary",children:"The buttons the station screen offers under the item's reality. A code makes a choice double-scannable — scan the item, then the printed action card."}),e.jsx("div",{className:"divide-y divide-surface-border border-y border-surface-border",children:s.map((o,m)=>e.jsx(re,{index:m,choice:o,onPatch:c=>x(m,c),onRemove:()=>l(m)},m))}),e.jsxs("button",{type:"button",onClick:()=>t([...s,ne()]),className:"flex items-center gap-1.5 text-sm text-accent hover:text-accent-hover pt-2",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Add a choice"]})]})}function re({index:s,choice:t,onPatch:x,onRemove:l}){var p;const[o,m]=g.useState(t.params?JSON.stringify(t.params,null,2):""),[c,u]=g.useState(null),i=n=>{if(m(n),!n.trim()){u(null),x({params:void 0});return}try{x({params:JSON.parse(n)}),u(null)}catch{u("Fix the JSON to save these params.")}};return e.jsxs("div",{className:"pt-8 pb-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-semibold uppercase tracking-widest text-text-tertiary",children:["Choice ",s+1]}),e.jsx("button",{type:"button",onClick:l,className:"icon-link ml-auto",title:"Remove choice",children:e.jsx(q,{className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs("label",{className:"block flex-1 min-w-[12rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Label ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Button text — what the associate reads."}),e.jsx("input",{value:t.label,onChange:n=>x({label:n.target.value}),className:"input w-full",placeholder:"Collected"})]}),e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Runs ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The action this choice performs."}),e.jsx("select",{value:t.verb,onChange:n=>x({verb:n.target.value}),className:"select",children:ae.map(n=>e.jsx("option",{value:n,children:n},n))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Code"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Short token for double-scan selection."}),e.jsx("input",{value:t.code??"",onChange:n=>x({code:n.target.value||void 0}),className:"input w-[10rem] font-mono",placeholder:"COLLECT"})]}),e.jsxs("label",{className:"block flex-1 min-w-[14rem]",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Confirmation"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Ask before running — empty runs on tap."}),e.jsx("input",{value:((p=t.confirm)==null?void 0:p.prompt)??"",onChange:n=>x({confirm:n.target.value?{prompt:n.target.value}:void 0}),className:"input w-full",placeholder:"Run without asking"})]}),e.jsxs("label",{className:"flex items-end gap-2 pb-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.requireActingIdentity,onChange:n=>x({requireActingIdentity:n.target.checked||void 0})}),e.jsx("span",{className:"text-xs text-text-secondary",title:"This choice runs only for a badged (or write-capable) user.",children:"Requires acting identity"})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Params (JSON)"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The verb's parameters — resolverPayload, targetRole, metadata, durationMinutes."}),e.jsx("textarea",{value:o,onChange:n=>i(n.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:'{ "resolverPayload": { "outcome": "collected" } }'}),c&&e.jsx("span",{className:"block text-2xs text-status-error mt-1",children:c})]})]})}const ce={[d.SHOW_DETAIL]:"Show the item",[d.SHOW_LIST]:"Show all matches as a list",[d.CLAIM]:"Claim",[d.CLAIM_SHOW_DETAIL]:"Claim and show the item",[d.RELEASE]:"Release my claim",[d.RESOLVE]:"Resolve with a canned payload",[d.ESCALATE]:"Send to another queue",[d.CANCEL]:"Cancel",[d.PRESENT]:"Show reality + choices"};function oe({index:s,step:t,roleKeys:x,isLast:l,onPatch:o,onMove:m,onRemove:c}){var T,N,A,L,j,I;const[u,i]=g.useState((T=t.params)!=null&&T.resolverPayload?JSON.stringify(t.params.resolverPayload,null,2):""),[p,n]=g.useState(null),b=a=>o({query:{...t.query,...a}}),k=a=>o({params:{...t.params,...a}}),v=a=>{if(i(a),!a.trim()){n(null),k({resolverPayload:void 0});return}try{k({resolverPayload:JSON.parse(a)}),n(null)}catch{n("Fix the JSON to save this payload.")}},y=t.query.roles??[],r=t.verb===d.PRESENT,w=t.verb===d.ESCALATE,C=t.verb===d.RESOLVE||t.verb===d.ESCALATE&&((N=t.params)==null?void 0:N.closeCurrent)==="resolve";return e.jsxs("div",{className:"py-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-widest text-text-quaternary",children:["Step ",s+1]}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>m(-1),disabled:s===0,className:"icon-link disabled:opacity-30",title:"Move up",children:e.jsx(z,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:()=>m(1),disabled:l,className:"icon-link disabled:opacity-30",title:"Move down",children:e.jsx(Q,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",onClick:c,className:"icon-link",title:"Remove step",children:e.jsx(q,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs("div",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Look in"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The queues the item is expected in — empty means any."}),e.jsx(W,{values:y,options:x,onChange:a=>b({roles:a.length?a:void 0}),addLabel:"Add a queue…",emptyText:"Any queue I can see",ariaLabel:"Add a queue"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Held by"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Narrow to claimed, unclaimed, or my items."}),e.jsxs("select",{value:t.query.availability??"any",onChange:a=>b({availability:a.target.value==="any"?void 0:a.target.value}),className:"select",children:[e.jsx("option",{value:"any",children:"Anyone / unheld"}),e.jsx("option",{value:"available",children:"Unclaimed only"}),e.jsx("option",{value:"claimed",children:"Claimed only"}),e.jsx("option",{value:"mine",children:"Mine only"})]})]}),e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Then ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The action this step performs on a match."}),e.jsx("select",{value:t.verb,onChange:a=>o({verb:a.target.value,params:void 0,confirm:void 0,choices:void 0,autoSelectSingle:void 0}),className:"select",children:Object.entries(ce).map(([a,P])=>e.jsx("option",{value:a,children:P},a))})]}),w&&e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Send to ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"The queue the item re-homes to."}),e.jsxs("select",{value:((A=t.params)==null?void 0:A.targetRole)??"",onChange:a=>k({targetRole:a.target.value||void 0}),className:"select font-mono",children:[e.jsx("option",{value:"",disabled:!0,children:"Choose…"}),x.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),w&&e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Current item"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Close out the located item first."}),e.jsxs("select",{value:((L=t.params)==null?void 0:L.closeCurrent)??"",onChange:a=>k({closeCurrent:a.target.value||void 0}),className:"select",children:[e.jsx("option",{value:"",children:"Leave it open"}),e.jsx("option",{value:"resolve",children:"Resolve it"}),e.jsx("option",{value:"cancel",children:"Cancel it"})]})]}),!r&&e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Confirmation"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Ask before acting — the prompt shows on the item."}),e.jsx("input",{value:((j=t.confirm)==null?void 0:j.prompt)??"",onChange:a=>o({confirm:a.target.value?{prompt:a.target.value}:void 0}),className:"input w-full min-w-[16rem]",placeholder:"Run without asking"})]}),e.jsxs("label",{className:"flex items-end gap-2 pb-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.requireActingIdentity,onChange:a=>o({requireActingIdentity:a.target.checked||void 0})}),e.jsx("span",{className:"text-xs text-text-secondary",title:"This step runs only for a badged (or write-capable) user.",children:"Requires acting identity"})]}),r&&((I=t.choices)==null?void 0:I.length)===1&&e.jsxs("label",{className:"flex items-end gap-2 pb-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.autoSelectSingle,onChange:a=>o({autoSelectSingle:a.target.checked||void 0})}),e.jsx("span",{className:"text-xs text-text-secondary",title:"With one choice, the scan runs it directly instead of presenting; a badge is still collected first when required.",children:"Auto-select the single choice"})]})]}),C&&e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Resolver payload ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsxs("span",{className:"block text-2xs text-text-tertiary mb-1",children:["JSON submitted as the resolution. ","{scan.target}",", ","{scan.category}"," and ","{scan.scannedAt}"," fill in from the scan."]}),e.jsx("textarea",{value:u,onChange:a=>v(a.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:'{ "outcome": "collected", "serial": "{scan.target}" }'}),p&&e.jsx("span",{className:"block text-2xs text-status-error mt-1",children:p})]}),r&&e.jsx(le,{choices:t.choices??[],onChange:a=>o({choices:a.length?a:void 0,...a.length===1?{}:{autoSelectSingle:void 0}})})]})}const H=()=>({query:{},verb:d.SHOW_DETAIL});function ie({schemeVersion:s,schemeKind:t,category:x,rule:l,codePreview:o,onDeleted:m}){var P,$;const c=B(),u=F(),{data:i}=J(),p=((i==null?void 0:i.roles)??[]).map(h=>h.role),n=t===_.IDENTITY,[b,k]=g.useState((l==null?void 0:l.name)??""),[v,y]=g.useState((l==null?void 0:l.steps)??(n?[]:[H()])),[r,w]=g.useState(((P=l==null?void 0:l.fallback)==null?void 0:P.markdown)??""),[C,T]=g.useState((($=l==null?void 0:l.notPrimed)==null?void 0:$.markdown)??""),[N,A]=g.useState((l==null?void 0:l.enabled)??!0),L=(h,f)=>y(E=>E.map((S,R)=>R===h?{...S,...f}:S)),j=(h,f)=>y(E=>{const S=[...E],R=h+f;return R<0||R>=S.length?E:([S[h],S[R]]=[S[R],S[h]],S)}),I=h=>y(f=>f.filter((E,S)=>S!==h)),a=()=>c.mutate({scheme_version:s,category:x,name:b,steps:n?[]:v,fallback:{markdown:r||void 0},notPrimed:{markdown:C||void 0},enabled:N});return e.jsxs("div",{className:"space-y-8 max-w-form",children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["1 · Friendly name ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:n?'Name the badge population — "Associate badge".':'Print this beside the code — "Send Printer to Servicing".'}),e.jsx("input",{value:b,onChange:h=>k(h.target.value),className:"input w-full"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Status"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Disabled rules report unconfigured."}),e.jsxs("select",{value:N?"enabled":"disabled",onChange:h=>A(h.target.value==="enabled"),className:"select",children:[e.jsx("option",{value:"enabled",children:"Enabled"}),e.jsx("option",{value:"disabled",children:"Disabled"})]})]})]}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"block text-xs text-text-secondary",children:["2 · Conditions and actions ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary",children:'Scanning walks the steps in order — the first query that finds the item runs its action. Put the expected state first and a broad "show the item" last so a misplaced item still reports where it is.'})]}),e.jsx("div",{className:"divide-y divide-surface-border border-y border-surface-border",children:v.map((h,f)=>e.jsx(oe,{index:f,step:h,roleKeys:p,isLast:f===v.length-1,onPatch:E=>L(f,E),onMove:E=>j(f,E),onRemove:()=>I(f)},f))}),e.jsxs("button",{type:"button",onClick:()=>y(h=>[...h,H()]),className:"flex items-center gap-1.5 text-sm text-accent hover:text-accent-hover",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Add a step"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:n?"2 · When the badge is unknown":"3 · When nothing matches"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:n?"Markdown shown when a scanned badge matches no user.":"Markdown shown to the scanner operator when no step finds the item."}),e.jsx("textarea",{value:r,onChange:h=>w(h.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:n?"**Badge not recognized.** See your lead to get it registered.":"**Nothing here.** The item this code points at is not in any queue."})]}),!n&&e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"When a badge is required"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Markdown shown when a step or choice needs an acting identity and none is primed."}),e.jsx("textarea",{value:C,onChange:h=>T(h.target.value),rows:3,className:"textarea w-full font-mono text-sm",placeholder:"**Scan your badge** to run this action."})]})]}),c.error&&e.jsx("p",{className:"text-xs text-status-error",children:c.error.message}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:a,disabled:!b||!n&&v.length===0||c.isPending,className:"btn-primary text-xs",children:l?"Save rule":`Create rule ${s}:${x}`}),e.jsx("span",{className:"text-2xs text-text-quaternary font-mono",children:o}),l&&e.jsxs("button",{type:"button",onClick:()=>u.mutate({scheme_version:s,category:x},{onSuccess:m}),className:"ml-auto flex items-center gap-1 text-xs text-status-error/80 hover:text-status-error",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Delete rule"]})]})]})}function xe(s){for(let t=0;t<=9;t++)if(!s.has(String(t)))return String(t);return null}function D({icon:s,label:t,annotation:x,aside:l,children:o}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(s,{className:"w-3 h-3 text-text-tertiary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:t}),x&&e.jsxs("span",{className:"text-2xs text-text-quaternary truncate",children:["— ",x]})]}),l]}),e.jsx("div",{className:"border-l-2 pl-5 border-surface-border/60",children:o})]})}function Ne(){const{version:s}=ee(),t=Number(s),[x,l]=te(),{data:o,isLoading:m}=U(Number.isInteger(t)?t:null),c=x.get("category"),u=r=>{l(w=>{const C=new URLSearchParams(w);return r?C.set("category",r):C.delete("category"),C})};if(m)return e.jsx("div",{className:"text-sm text-text-tertiary",children:"Loading…"});if(!o)return e.jsxs("div",{className:"text-sm text-text-tertiary",children:["No scheme for version ",s,"."]});const{scheme:i,rules:p}=o,n=new Map(p.map(r=>[r.category,r])),b=c?n.get(c)??null:null,k=xe(new Set(p.map(r=>r.category))),v=i.encoding==="fixed"?"7".repeat(i.target_length??8):"SN-1234",y=r=>i.encoding==="fixed"?`${i.version}${r}${v}`:`${i.version}${i.delimiter}${r}${i.delimiter}${v}`;return e.jsxs("div",{className:"space-y-10",children:[e.jsx(K,{title:i.name}),e.jsxs("p",{className:"text-sm text-text-secondary max-w-form -mt-4",children:["Codes for this scheme start with ",e.jsx("span",{className:"font-mono text-text-primary",children:i.version}),".",i.kind===_.IDENTITY?" Scanning a badge primes who acts next; each slot names the badge and its unknown-badge message.":" Add an action, name it, and configure what a scan does — each action gets its own slot automatically."]}),e.jsx(de,{scheme:i,ruleCount:p.length},i.version),e.jsx(D,{icon:X,label:"Actions",annotation:i.kind===_.IDENTITY?"named badge slots — each carries its unknown-badge message":"what a scan of this scheme does — named, in the order you add them",children:e.jsxs("div",{className:"divide-y divide-surface-border border-y border-surface-border max-w-form",children:[p.map(r=>{const w=c===r.category;return e.jsxs("button",{type:"button",onClick:()=>u(w?null:r.category),className:`w-full flex items-center gap-4 py-3 px-2 text-left transition-colors ${w?"bg-accent/10":"hover:bg-surface-sunken"}`,children:[e.jsx("span",{className:"w-9 h-8 flex items-center justify-center text-xs font-mono text-accent border border-surface-border rounded shrink-0",children:r.category}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-text-primary truncate",children:r.name}),e.jsx("div",{className:"text-2xs text-text-tertiary font-mono truncate",children:y(r.category)})]})]},r.category)}),e.jsxs("div",{className:"flex items-center gap-4 py-3 px-2",children:[e.jsx("span",{className:"w-9 h-8 flex items-center justify-center text-text-quaternary shrink-0",children:e.jsx(M,{className:"w-4 h-4",strokeWidth:1.5})}),k==null?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"All 10 action slots are in use."}):e.jsxs("button",{type:"button",onClick:()=>u(k),className:"flex items-center gap-1.5 text-sm text-accent hover:text-accent-hover",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Add an action"]})]})]})}),c&&e.jsx(D,{icon:M,label:b?b.name:"New action",annotation:`this label prints beside the code — e.g. ${y(c)}`,children:e.jsx(ie,{schemeVersion:i.version,schemeKind:i.kind,category:c,rule:b,codePreview:y(c),onDeleted:()=>u(null)},`${i.version}:${c}`)})]})}function de({scheme:s,ruleCount:t}){const x=se(),l=V(),o=G(),[m,c]=g.useState(s.name),[u,i]=g.useState(s.kind),[p,n]=g.useState(s.target_facet),[b,k]=g.useState(s.grant_ttl_seconds??3600),[v,y]=g.useState(s.grant_max_uses??0),[r,w]=g.useState(s.enabled),[C,T]=g.useState(!1),N=u===_.IDENTITY,A=!N||b>=1&&b<=86400,L=m!==s.name||p!==s.target_facet||r!==s.enabled||u!==s.kind||N&&(b!==s.grant_ttl_seconds||v!==s.grant_max_uses);return e.jsxs(D,{icon:Z,label:"Scheme",annotation:`version digit ${s.version}`,aside:e.jsxs("button",{type:"button",onClick:()=>T(!0),className:"flex items-center gap-1 text-xs text-status-error/80 hover:text-status-error",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Delete scheme"]}),children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-4 max-w-form",children:[e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Kind ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:N?"A badge — scanning it primes who acts next.":"An item code — scanning it acts on the item."}),e.jsxs("select",{value:u,onChange:j=>i(j.target.value),className:"select",children:[e.jsx("option",{value:_.ACTION,children:"Action"}),e.jsx("option",{value:_.IDENTITY,children:"Identity"})]})]}),e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Name ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:N?"Say who the badge identifies.":"Say what the target identifies."}),e.jsx("input",{value:m,onChange:j=>c(j.target.value),className:"input w-full"})]}),e.jsxs("label",{className:"block flex-1 min-w-[16rem]",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Target facet ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:N?"The user-metadata key the badge matches (e.g. badge_id).":"The metadata key the scanned value matches."}),e.jsx("input",{value:p,onChange:j=>n(j.target.value),className:"input w-full font-mono"})]}),N&&e.jsxs("label",{className:"block",children:[e.jsxs("span",{className:"block text-xs text-text-secondary mb-1",children:["Grant TTL (seconds) ",e.jsx("span",{className:"text-status-error",children:"*"})]}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"How long a badge scan stays primed (1–86400)."}),e.jsx("input",{type:"number",min:1,max:86400,value:b,onChange:j=>k(Number(j.target.value)),className:"input w-[12rem]"}),!A&&e.jsx("span",{className:"block text-2xs text-status-error mt-1",children:"Enter 1–86400 seconds."})]}),N&&e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Grant max uses"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"0 = TTL-bound; n = the grant covers n scans."}),e.jsx("input",{type:"number",min:0,value:v,onChange:j=>y(Number(j.target.value)),className:"input w-[12rem]"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"block text-xs text-text-secondary mb-1",children:"Status"}),e.jsx("span",{className:"block text-2xs text-text-tertiary mb-1",children:"Disable to reject every scan of this version."}),e.jsxs("select",{value:r?"enabled":"disabled",onChange:j=>w(j.target.value==="enabled"),className:"select",children:[e.jsx("option",{value:"enabled",children:"Enabled"}),e.jsx("option",{value:"disabled",children:"Disabled"})]})]}),L&&e.jsx("button",{type:"button",disabled:l.isPending||!m||!p||!A,onClick:()=>l.mutate({version:s.version,name:m,description:s.description,target_facet:p,encoding:s.encoding,delimiter:s.delimiter,target_length:s.target_length,kind:u,grant_ttl_seconds:N?b:null,grant_max_uses:N?v:0,enabled:r}),className:"btn-primary text-xs",children:"Save"})]}),l.error&&e.jsx("p",{className:"text-xs text-status-error mt-2",children:l.error.message}),e.jsx(Y,{open:C,onClose:()=>T(!1),onConfirm:()=>o.mutate(s.version,{onSuccess:()=>x("/admin/scan-codes")}),title:`Delete scheme ${s.version}`,description:t>0?`This deletes "${s.name}" and its ${t} ${t===1?"rule":"rules"}. Codes starting with ${s.version} stop resolving, and labels already printed with them report unconfigured.`:`This deletes "${s.name}". Codes starting with ${s.version} stop resolving.`,isPending:o.isPending,error:o.error})]})}export{Ne as ScanSchemeDetailPage};
2
- //# sourceMappingURL=ScanSchemeDetailPage-C6mRYkxL.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,a as o}from"./vendor-query-RUZdMvN6.js";import{a2 as E,aw as B,ax as L,a0 as A,L as O,ay as R,az as W,aA as C,_ as v}from"./index-DSdqso-_.js";import{a as _,aV as F,aW as P}from"./vendor-icons-h-jlRSb9.js";import{M as D}from"./Modal-BU7No9NH.js";import{d as V}from"./metadata-display-DHjqWkLG.js";import{a as U,u as $}from"./vendor-react-CdqEC2zv.js";function q({stationName:t}){return e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-24",children:[e.jsx(_,{className:"w-10 h-10 text-accent-muted mb-8",strokeWidth:1}),e.jsx("h1",{className:"text-3xl font-light text-text-primary tracking-tight",children:t}),e.jsx("div",{className:"w-16 border-t border-surface-border my-8"}),e.jsx("p",{className:"text-lg text-text-secondary",children:"Scan your badge to begin"}),e.jsx("p",{className:"text-sm text-text-tertiary mt-2",children:"or scan an item"})]})}function H(t){const r=Math.floor(t/60),c=t%60;return`${r}:${String(c).padStart(2,"0")}`}function Y(){const{identity:t,remainingSeconds:r}=E(),[,c]=o.useState(0);return o.useEffect(()=>{if(!(t!=null&&t.expiresAt))return;const a=setInterval(()=>c(f=>f+1),1e3);return()=>clearInterval(a)},[t]),t?e.jsxs("div",{className:"flex items-center gap-2.5 pb-3 mb-6 border-b border-surface-border",children:[e.jsx(F,{className:"w-4 h-4 text-status-success shrink-0",strokeWidth:1.5}),e.jsxs("span",{className:"text-sm font-medium text-text-primary",children:["Hi ",t.displayName]}),t.expiresAt&&e.jsx("span",{className:"ml-auto text-sm font-mono tabular-nums text-text-tertiary",children:H(r())})]}):null}function M(t,r){return!t.withheld||r}function z(t,r,c){return t.find(a=>!!a.code&&a.code===c&&M(a,r))??null}function G(t){return t==null||t===""?"—":typeof t=="boolean"?t?"Yes":"No":typeof t=="object"?JSON.stringify(t):String(t)}function J({label:t,value:r}){return e.jsxs("div",{className:"flex items-baseline gap-4 py-2",children:[e.jsx("span",{className:"w-32 shrink-0 text-2xs uppercase tracking-wide text-text-quaternary",children:t}),e.jsx("span",{className:"text-sm text-text-primary break-words",children:r})]})}function I(){return e.jsx("span",{className:"text-text-quaternary select-none",children:"·"})}function X({response:t,hasActingIdentity:r,selfId:c,busy:a,onExecute:f,onWithheldSelect:n}){var i,m;const{setCodeInterceptor:h}=B(),[x,d]=o.useState(null),l=t.escalation??{},u=t.choices??[],S=l.metadata??{},b=s=>{s.confirm?d(s):f(s)},j=o.useRef({choices:u,hasActingIdentity:r,select:b});j.current={choices:u,hasActingIdentity:r,select:b},o.useEffect(()=>(h(s=>{const p=j.current,T=z(p.choices,p.hasActingIdentity,s);return T?(p.select(T),!0):!1}),()=>h(null)),[h]);const g=l.assigned_to??null,k=g?g===c?"Claimed by you":"Claimed":"Unclaimed",w=g===c?"text-accent":"text-text-secondary",N=[l.type,l.subtype].filter(Boolean).join(" · "),y=V(S);return e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col max-w-form",children:[e.jsxs("div",{children:[((i=t.rule)==null?void 0:i.name)&&e.jsx("div",{className:"text-2xs font-semibold uppercase tracking-widest text-accent mb-2",children:t.rule.name}),e.jsx("h2",{className:"text-2xl font-medium leading-tight text-text-primary mb-2",children:l.description||N||"Located item"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-text-secondary mb-5",children:[e.jsx("span",{children:String(l.role??"—")}),N&&e.jsxs(e.Fragment,{children:[e.jsx(I,{}),e.jsx("span",{children:N})]}),e.jsx(I,{}),e.jsx("span",{className:w,children:k}),typeof l.created_at=="string"&&e.jsxs(e.Fragment,{children:[e.jsx(I,{}),e.jsx("span",{children:L(l.created_at)})]})]}),y.length>0&&e.jsx("div",{className:"divide-y divide-surface-border border-t border-surface-border",children:y.map(([s,p])=>e.jsx(J,{label:s,value:G(p)},s))})]}),e.jsx("div",{className:"mt-8 space-y-3",children:u.map(s=>{const p=M(s,r);return e.jsx("div",{children:e.jsx("button",{type:"button",disabled:a,onClick:()=>p?b(s):n(s),className:"w-full text-left px-5 py-4 text-lg text-text-primary border border-surface-border rounded hover:bg-surface-sunken transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e.jsxs("span",{className:"flex items-baseline gap-3",children:[s.label,s.code&&e.jsx("span",{className:"ml-auto text-2xs font-mono text-text-quaternary",children:s.code})]})})},s.index)})}),x&&e.jsx(D,{open:!0,onClose:()=>d(null),title:x.label,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:(m=x.confirm)==null?void 0:m.prompt}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>d(null),disabled:a,className:"btn-secondary text-xs",children:"No, go back"}),e.jsx("button",{type:"button",onClick:()=>{const s=x;d(null),f(s)},disabled:a,className:"btn-primary text-xs",children:"Yes, continue"})]})]})})]})}function K({choice:t,notPrimedMarkdown:r,primed:c,busy:a,onExecute:f,onCancel:n}){var l;const[h,x]=o.useState(!1),d=o.useRef(!1);return o.useEffect(()=>{if(!c){d.current=!1;return}d.current||(d.current=!0,t.confirm?x(!0):f(t))},[c,t,f]),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-24",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx(_,{className:"w-8 h-8 text-text-quaternary",strokeWidth:1}),e.jsx(P,{className:"w-10 h-10 text-accent-muted",strokeWidth:1})]}),e.jsx("h2",{className:"text-2xl font-light text-text-primary tracking-tight",children:"Scan your badge to continue"}),e.jsxs("p",{className:"text-lg text-text-secondary mt-2",children:["to ",t.label]}),r&&e.jsx("div",{className:"text-sm text-text-tertiary mt-6 max-w-prose",children:e.jsx(A,{content:r,compact:!0})}),e.jsx("div",{className:"w-16 border-t border-surface-border my-8"}),e.jsx("button",{type:"button",onClick:n,disabled:a,className:"text-sm text-text-tertiary hover:text-text-secondary hover:underline",children:"Cancel"}),h&&e.jsx(D,{open:!0,onClose:n,title:t.label,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:(l=t.confirm)==null?void 0:l.prompt}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:n,disabled:a,className:"btn-secondary text-xs",children:"No, go back"}),e.jsx("button",{type:"button",onClick:()=>{x(!1),f(t)},disabled:a,className:"btn-primary text-xs",children:"Yes, continue"})]})]})})]})}const Q=8e3,Z=[v.SHOW_DETAIL,v.CLAIM,v.CLAIM_SHOW_DETAIL];function ce(){var y;const t=U(),r=$(),{user:c}=O(),{identity:a,clear:f}=E(),[n,h]=o.useState(null),[x,d]=o.useState(null),[l,u]=o.useState(null),[S,b]=o.useState(!1);o.useEffect(()=>{var s,p;const i=(s=t.state)==null?void 0:s[R];if(!i)return;h(i),u(null);const m=((p=i.choices)==null?void 0:p.length)===1?i.choices[0]:void 0;d(i.autoSelect&&m?{choice:m,returnTo:"idle"}:null),r(t.pathname,{replace:!0,state:null})},[t,r]),o.useEffect(()=>{if(!l)return;const i=setTimeout(()=>u(null),Q);return()=>clearTimeout(i)},[l]);const j=o.useCallback(async i=>{if(!(!(n!=null&&n.rule)||!n.escalation)){b(!0);try{const m=await W({schemeVersion:n.rule.schemeVersion,category:n.rule.category,stepIndex:n.stepIndex??0,choiceIndex:i.index,escalationId:String(n.escalation.id),actingToken:a==null?void 0:a.actingToken});switch(m.outcome){case C.EXECUTED:if(h(null),d(null),Z.includes(i.verb)&&m.escalation){r(`/escalations/detail/${m.escalation.id}`);break}u({at:Date.now(),tone:"text-status-success",text:`${i.label} — done`});break;case C.CONFLICT:h(null),d(null),u({at:Date.now(),tone:"text-status-warning",text:m.error||"The item changed since it was scanned — scan it again."});break;case C.UNCONFIGURED:h(null),d(null),u({at:Date.now(),tone:"text-status-warning",text:m.error||"This choice is no longer configured."});break;case C.NOT_PRIMED:f(),u(null),d(s=>({choice:i,returnTo:(s==null?void 0:s.returnTo)??"choices"}));break;default:u({at:Date.now(),tone:"text-status-error",text:m.error||"The choice did not run."})}}catch(m){u({at:Date.now(),tone:"text-status-error",text:m.message})}finally{b(!1)}}},[n,a,r,f]),g=o.useCallback(i=>{d({choice:i,returnTo:"choices"})},[]),k=o.useCallback(()=>{(x==null?void 0:x.returnTo)==="idle"&&h(null),d(null)},[x]),w=(c==null?void 0:c.displayName)||(c==null?void 0:c.username)||"Scan station",N=!!(n!=null&&n.choices&&n.escalation);return e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsx(Y,{}),x&&n?e.jsx(K,{choice:x.choice,notPrimedMarkdown:(y=n.notPrimed)==null?void 0:y.markdown,primed:!!a,busy:S,onExecute:j,onCancel:k}):N?e.jsx(X,{response:n,hasActingIdentity:!!a,selfId:(a==null?void 0:a.actorId)??(c==null?void 0:c.userId)??null,busy:S,onExecute:j,onWithheldSelect:g},String(n.escalation.id)):e.jsx(q,{stationName:w}),l&&e.jsxs("div",{role:"status",className:"mt-8 pt-3 border-t border-surface-border",children:[e.jsx("span",{className:`text-sm font-medium ${l.tone}`,children:l.text}),l.markdown&&e.jsx("div",{className:"text-sm text-text-secondary mt-1",children:e.jsx(A,{content:l.markdown,compact:!0})})]})]})}export{ce as ScanStationPage};
2
- //# sourceMappingURL=ScanStationPage-YQiijAKy.js.map
@@ -1,2 +0,0 @@
1
- import{j as o}from"./vendor-query-RUZdMvN6.js";import{b as e}from"./index-DSdqso-_.js";function i({date:r,className:t=""}){return o.jsx(e,{date:r,format:"relative",className:t})}export{i as T};
2
- //# sourceMappingURL=TimeAgo-poxwErGl.js.map
@@ -1,2 +0,0 @@
1
- import{j as r}from"./vendor-query-RUZdMvN6.js";import{u as a}from"./users-C0ke1Z-8.js";function m({userId:s,fallback:t}){const{data:e}=a(s);return e?r.jsx(r.Fragment,{children:e.display_name||e.email||e.external_id}):r.jsx(r.Fragment,{children:t??`${s.slice(0,8)}…`})}export{m as U};
2
- //# sourceMappingURL=UserName-D2SoVbe9.js.map
@@ -1,2 +0,0 @@
1
- import{a as w,j as e}from"./vendor-query-RUZdMvN6.js";import{a as B,f as F}from"./workflows-DR9OQcuq.js";import{h as Q}from"./useEventHooks-DL3Vhz4g.js";import{u as J,E as M}from"./EventTable-zFqzbEdC.js";import{b as z,e as H}from"./tasks-DHbFpQk4.js";import{P as d,b,D as K,c as Y,d as q,J as _,h as Z}from"./index-DSdqso-_.js";import{P as G}from"./PageHeader-CFVw67M6.js";import{S as X}from"./SegmentedTabs-DXNzY05q.js";import{L as ee}from"./ListToolbar-BEogxu1f.js";import{S as te,a as se}from"./StatusBadge-BDeUwPtb.js";import{C as y}from"./CopyableId-4Lqlc5cU.js";import{J as S,ar as ae,K as re,O as ne,Q as le,V as oe,s as ie}from"./vendor-icons-h-jlRSb9.js";import{L as m,e as ce,u as de}from"./vendor-react-CdqEC2zv.js";import{S as xe}from"./SwimlaneTimeline-DSO6QXmX.js";import"./FilterBar-fwUqeM-5.js";import"./StreamMessageDetail-jczXwuBw.js";function ue(t){const s=t.lastIndexOf("-");return s<=0?{taskQueue:t,workflowType:t}:{taskQueue:t.substring(0,s),workflowType:t.substring(s+1)}}function me({children:t}){return e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:t})}function E({status:t}){return e.jsx("span",{className:`w-2.5 h-2.5 shrink-0 rounded-full dot-ring ${se[t]??"bg-status-active"}`,title:t})}function pe({escalations:t}){return e.jsx("div",{children:t.map(s=>e.jsxs(m,{to:`/escalations/detail/${s.id}`,className:"grid grid-cols-[auto_1fr_auto] items-center gap-x-3 py-2 border-b border-surface-border/40 last:border-b-0 group",children:[e.jsx(E,{status:s.status}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-xs font-mono text-text-primary group-hover:text-accent transition-colors truncate",title:s.type,children:s.type}),e.jsx("span",{className:"block text-2xs text-text-tertiary truncate",children:s.role})]}),e.jsx(b,{date:s.created_at,format:"relative",className:"text-2xs text-text-tertiary whitespace-nowrap text-right"})]},s.id))})}function fe({tasks:t}){return e.jsx("div",{children:t.map(s=>e.jsxs(m,{to:`/workflows/tasks/detail/${s.id}`,className:"grid grid-cols-[auto_1fr_auto] items-center gap-x-3 py-2 border-b border-surface-border/40 last:border-b-0 group",children:[e.jsx(E,{status:s.status}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-xs font-mono text-text-primary group-hover:text-accent transition-colors truncate",title:s.workflow_type,children:s.workflow_type}),e.jsx("span",{className:"block text-2xs text-text-tertiary truncate",children:s.lt_type})]}),e.jsx(b,{date:s.created_at,format:"relative",className:"text-2xs text-text-tertiary whitespace-nowrap text-right"})]},s.id))})}function he({execution:t,parentWorkflowId:s,childTasks:a,escalations:n,headerActions:l,open:i}){const u=n.length>0||a.length>0,[x,o]=w.useState(u?"escalations":"details"),{taskQueue:p,workflowType:j}=ue(t.workflow_type),f=[{id:"details",icon:S,label:"Details",content:e.jsxs("dl",{className:"space-y-3.5",children:[e.jsx(d,{label:"Status",children:e.jsx(te,{status:t.status})}),e.jsx(d,{label:"Workflow Type",children:e.jsx(y,{bare:!0,value:j,href:`/workflows/executions?entity=${encodeURIComponent(j)}`})}),e.jsx(d,{label:"Workflow ID",children:e.jsx(y,{bare:!0,value:t.workflow_id})}),s&&e.jsx(d,{label:"Parent",children:e.jsx(y,{bare:!0,value:s,href:`/workflows/executions/${s}`})}),e.jsx(d,{label:"Task Queue",children:e.jsx("span",{className:"font-mono",children:p})}),e.jsx(d,{label:"Start Time",children:t.start_time?e.jsx(b,{date:t.start_time,format:"datetime"}):e.jsx("span",{className:"text-text-tertiary",children:"--"})}),e.jsx(d,{label:"End Time",children:t.close_time?e.jsx(b,{date:t.close_time,format:"datetime"}):e.jsx("span",{className:"text-text-tertiary",children:"--"})}),e.jsx(d,{label:"Duration",children:e.jsx(K,{ms:t.duration_ms,className:"font-mono"})}),e.jsxs(d,{label:"History Size",children:[t.summary.total_events," events"]}),e.jsxs(d,{label:"Activities",children:[t.summary.activities.completed," / ",t.summary.activities.total]})]})},{id:"escalations",icon:ae,label:"Escalations",content:e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{children:n.length>0?e.jsx(pe,{escalations:n}):e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"This workflow has not escalated."})}),a.length>0&&e.jsxs("div",{children:[e.jsx(me,{children:"Related Tasks"}),e.jsx(fe,{tasks:a})]})]})}];return e.jsx(Y,{open:i,width:384,className:"h-full",children:e.jsx("div",{className:"h-full pl-6",children:e.jsx(q,{views:f,activeId:x,onViewChange:o,headerActions:l,stickyClassName:"h-full min-h-0",labelInline:!0})})})}function we(t){var n;const s=t.events.find(l=>l.event_type==="workflow_execution_started"),a=(n=s==null?void 0:s.attributes)==null?void 0:n.input;return a&&typeof a=="object"?a:null}function je({execution:t}){const s=we(t),a=t.result,n=(a==null?void 0:a.data)??a??null;return!s&&!n?null:e.jsxs("div",{className:"grid grid-cols-1 @form-cols:grid-cols-2 gap-4 mb-6",children:[s!==null&&e.jsx("div",{children:e.jsx(_,{data:s,label:"Input Envelope"})}),n!==null&&e.jsx("div",{children:e.jsx(_,{data:n,label:"Result"})})]})}const be=["details","timeline","events"],T="lt:workflow-execution:tab";function ve({isRunning:t,hasToolCalls:s,workflowId:a,onAction:n}){const[l,i]=w.useState(!1),u=w.useRef(null);return w.useEffect(()=>{if(!l)return;const x=o=>{u.current&&!u.current.contains(o.target)&&i(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[l]),e.jsxs("div",{className:"relative",ref:u,children:[e.jsxs("button",{onClick:()=>i(!l),className:"flex items-center gap-0.5 pl-2 pr-1 py-1 rounded-md text-2xs font-medium text-accent hover:text-accent-hover hover:bg-surface-hover transition-colors",title:"Actions",children:["Actions",e.jsx(ie,{className:`w-3 h-3 transition-transform ${l?"rotate-180":""}`})]}),l&&e.jsxs("div",{className:"absolute right-0 mt-1 w-44 bg-surface-raised border border-surface-border rounded-md shadow-lg z-[100]",children:[e.jsx("button",{onClick:()=>{n("restart"),i(!1)},className:"block w-full text-left px-4 py-2 text-xs text-text-secondary hover:bg-surface-hover",children:"Restart Workflow"}),t&&e.jsx("button",{onClick:()=>{n("terminate"),i(!1)},className:"block w-full text-left px-4 py-2 text-xs text-status-error hover:bg-surface-hover",children:"Terminate"}),s&&e.jsx(m,{to:`/mcp/queries/${a}?step=3`,className:"block w-full text-left px-4 py-2 text-xs text-accent hover:bg-surface-hover",onClick:()=>i(!1),children:"Compile into Pipeline"}),e.jsx(m,{to:`/mcp/executions/${encodeURIComponent(a)}?namespace=durable`,className:"block w-full text-left px-4 py-2 text-xs text-text-secondary hover:bg-surface-hover",onClick:()=>i(!1),children:"View Pipeline Execution"}),e.jsx(m,{to:`/admin/streams?source=worker&jid=${encodeURIComponent(a)}`,className:"block w-full text-left px-4 py-2 text-xs text-text-secondary hover:bg-surface-hover",onClick:()=>i(!1),children:"Worker Messages"}),e.jsx(m,{to:`/admin/streams?source=engine&jid=${encodeURIComponent(a)}`,className:"block w-full text-left px-4 py-2 text-xs text-text-secondary hover:bg-surface-hover",onClick:()=>i(!1),children:"Engine Messages"})]})]})}function Ve(){const{workflowId:t}=ce();Q(t);const s="Workflow Execution",{data:a,isLoading:n,error:l,refetch:i,isFetching:u}=B(t),{data:x}=z(t),{data:o}=H(t),{data:p}=Z(t),j=de(),f=F(),{isCollapsed:C,toggle:I}=J("workflow-execution"),[h,P]=w.useState(()=>{try{const r=localStorage.getItem(T);return r&&be.includes(r)?r:"details"}catch{return"details"}}),R=r=>{P(r);try{localStorage.setItem(T,r)}catch{}},W=r=>{var c;if(r==="terminate")confirm("Are you sure you want to terminate this workflow?")&&f.mutate(t);else if(r==="restart"&&a){const O=a.workflow_id.replace(/-[A-Za-z0-9_-]{20,}$/,""),g=a.events.find(U=>U.event_type==="workflow_execution_started"),N=(c=g==null?void 0:g.attributes)==null?void 0:c.input;N&&sessionStorage.setItem("lt:invoke:prefill",JSON.stringify(N)),j(`/workflows/start?type=${encodeURIComponent(O)}&mode=now`)}};if(n)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-60 bg-surface-sunken rounded"})]});if(l||!a){const r=(l==null?void 0:l.message)??"",c=r.includes("expired")||r.includes("no longer available");return e.jsxs("div",{children:[e.jsx(m,{to:"/workflows/executions",className:"text-xs text-text-tertiary hover:text-text-primary",children:"← Workflows"}),e.jsxs("div",{className:"mt-4 text-center py-8",children:[e.jsx("p",{className:"text-sm text-text-primary mb-1",children:c?"Execution data is no longer available":l?"Unable to load execution":"Execution not found"}),e.jsx("p",{className:"text-xs text-text-tertiary",children:c?"This workflow's underlying job has expired. The task record is preserved, but the execution timeline has been cleaned up.":r||"The workflow could not be resolved."})]})]})}const A=a.status!=="completed"&&a.status!=="failed",v=!C("side-panel"),$=a.parent_workflow_id,L=x&&x.workflow_id===a.workflow_id,k=$||(L?x.parent_workflow_id:null)||null,V=k&&k!==a.workflow_id?k:null,D=a.status==="completed"&&a.events.some(r=>{if(r.event_type!=="activity_task_completed")return!1;const c=r.attributes.activity_type;return c==="callDbTool"||c==="callVisionTool"||c==="callMcpTool"||(c==null?void 0:c.startsWith("mcp_"))});return e.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex items-stretch -mt-8 -mr-page-x -mb-16",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:[e.jsxs("div",{className:"shrink-0 pt-8 pr-page-x",children:[e.jsx(G,{title:s,actions:e.jsx("button",{onClick:()=>I("side-panel"),className:"text-accent/60 hover:text-accent transition-colors",title:v?"Hide side panel":"Show side panel",children:v?e.jsx(re,{className:"w-5 h-5",strokeWidth:1.5}):e.jsx(ne,{className:"w-5 h-5",strokeWidth:1.5})})}),f.error&&e.jsxs("p",{className:"text-xs text-status-error py-2",children:["Terminate failed: ",f.error.message]}),e.jsx("div",{className:"mt-2",children:e.jsx(X,{"aria-label":"Execution section",active:h,onChange:R,tabs:[{key:"details",label:"Details",icon:e.jsx(S,{className:"w-3.5 h-3.5"})},{key:"timeline",label:"Execution Timeline",icon:e.jsx(le,{className:"w-3.5 h-3.5"})},{key:"events",label:"Events",icon:e.jsx(oe,{className:"w-3.5 h-3.5"})}]})})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pr-page-x pt-6 pb-16 animate-page-in",children:[h==="details"&&e.jsx(je,{execution:a}),h==="timeline"&&e.jsx(xe,{events:a.events,childTasks:o==null?void 0:o.tasks,jid:t,appId:"durable"}),h==="events"&&e.jsx(M,{events:a.events,childTasks:o==null?void 0:o.tasks,jid:t,appId:"durable"})]},h)]}),e.jsx(he,{execution:a,parentWorkflowId:V,childTasks:(o==null?void 0:o.tasks)??[],escalations:(p==null?void 0:p.escalations)??[],headerActions:e.jsxs(e.Fragment,{children:[e.jsx(ee,{onRefresh:()=>i(),isFetching:u,apiPath:`/workflow-states/${t}/execution`}),e.jsx(ve,{isRunning:A,hasToolCalls:D,workflowId:t,onAction:W})]}),open:v})]})}export{Ve as WorkflowExecutionPage};
2
- //# sourceMappingURL=WorkflowExecutionPage-C82Q-TYC.js.map
@@ -1,2 +0,0 @@
1
- import{a as d,j as t}from"./vendor-query-RUZdMvN6.js";import{E as z}from"./ElapsedCell-BirS3yZq.js";import{L as A,b as v}from"./index-DSdqso-_.js";import{u as E,d as L,b as $}from"./workflows-DR9OQcuq.js";import{u as M}from"./useNamespace-CpO5Hogb.js";import{b as I}from"./useEventHooks-DL3Vhz4g.js";import{u as U}from"./useFilterParams-crmlBw_l.js";import{b as H}from"./api-path-u2Jf9QXS.js";import{D as O}from"./DataTable-DFPMeqyQ.js";import{W as B}from"./WorkflowPill-CN-952iI.js";import{P as V}from"./PageHeader-CFVw67M6.js";import{F as G,c as f,b as x}from"./FilterBar-fwUqeM-5.js";import{S as J}from"./StickyPagination-BsbSade1.js";import{L as q}from"./ListToolbar-BEogxu1f.js";import{R as K,a as k}from"./RowActions-eYrzgQSj.js";import{H as Q,a0 as X}from"./vendor-icons-h-jlRSb9.js";import{u as Y}from"./vendor-react-CdqEC2zv.js";import"./controlplane-CD6ti-QB.js";import"./EmptyState-lpUFYfun.js";const Z={running:"in_progress",completed:"completed",failed:"failed"},ee={in_progress:"bg-status-active",completed:"bg-status-success",failed:"bg-status-error"},te={running:"text-status-active",completed:"text-status-success",failed:"text-status-error"};function se(p,n,m,l,a){return[{key:"workflow_id",label:"Workflow ID",render:e=>{const o=ee[Z[e.status]??e.status]??"bg-status-pending",r=e.status==="running"?" animate-pulse":"";return t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:`w-2.5 h-2.5 shrink-0 rounded-full dot-ring ${o}${r}`,title:e.status}),t.jsx("span",{className:"font-mono text-xs text-text-primary truncate",children:e.workflow_id})]})}},{key:"entity",label:"Type",render:e=>t.jsx(B,{type:e.entity,variant:a.get(e.entity)??"durable",size:"xs"}),className:"w-44 shrink-0"},{key:"created_at",label:"Created",render:e=>t.jsx(v,{date:e.created_at,format:"relative",className:"text-xs text-text-secondary whitespace-nowrap"}),className:"w-32",sortable:!0},{key:"updated_at",label:"Updated",render:e=>t.jsx(v,{date:e.updated_at,format:"relative",className:"text-xs text-text-secondary whitespace-nowrap"}),className:"w-32",sortable:!0},{key:"duration",label:"Duration",render:e=>t.jsx(z,{startDate:e.created_at,endDate:e.status==="running"?null:e.updated_at,isLive:e.status==="running"}),className:"w-28"},{key:"actions",label:"",render:e=>t.jsxs(K,{children:[t.jsx(k,{icon:Q,title:`Filter by ${e.entity}`,onClick:()=>p(e.entity)}),t.jsx("button",{onClick:o=>{o.stopPropagation(),n(e.status)},className:"opacity-0 group-hover/row:opacity-100 transition-opacity",title:`Filter by ${e.status}`,children:t.jsx("svg",{className:`w-[18px] h-[18px] ${te[e.status]??"text-text-tertiary"} hover:opacity-70`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:t.jsx("circle",{cx:"12",cy:"12",r:"6"})})}),m&&t.jsx(k,{icon:X,title:"View config",onClick:()=>l(`/workflows/registry/${encodeURIComponent(e.entity)}`)})]}),className:"w-24 text-right"}]}function ke({tier:p="all"}){I();const n=Y(),{isSuperAdmin:m}=A(),{namespace:l}=M(),{filters:a,setFilter:e,pagination:o,sort:r,setSort:j}=U({filters:{search:"",entity:"",status:"",tier:p}}),c=a.tier||"all",g=c==="certified"?"true":c==="durable"?"false":void 0,{data:b}=E(),{data:y}=L(),S=d.useMemo(()=>{const s=new Map;for(const w of y??[])s.set(w.workflow_type,w.tier??"durable");return s},[y]),_=se(s=>e("entity",s),s=>e("status",s),m,n,S),[u,C]=d.useState(a.search);d.useEffect(()=>{if(u===a.search)return;const s=setTimeout(()=>e("search",u),300);return()=>clearTimeout(s)},[u,e,a.search]);const{data:i,isLoading:N,refetch:P,isFetching:T}=$({limit:o.pageSize,offset:o.offset,entity:a.entity||void 0,search:a.search||void 0,status:a.status||void 0,sort_by:r.sort_by||"created_at",order:r.order||"desc",registered:g,namespace:l||void 0}),h=(i==null?void 0:i.total)??0,F=(i==null?void 0:i.jobs)??[],D=d.useMemo(()=>[...new Set((b??[]).map(s=>s.workflow_type))].sort(),[b]),R="Workflow Executions",W=c==="certified"?"No certified workflow executions found":c==="durable"?"No durable workflow executions found":"No workflow executions found";return t.jsxs("div",{children:[t.jsx(V,{title:R,docsHash:"#docs:dashboard.md:procedural-executions"}),t.jsxs(G,{actions:t.jsx(q,{onRefresh:()=>P(),isFetching:T,apiPath:H("/workflow-states/jobs",{limit:o.pageSize,offset:o.offset,entity:a.entity||void 0,search:a.search||void 0,status:a.status||void 0,sort_by:r.sort_by||"created_at",order:r.order||"desc",registered:g,namespace:l||void 0})}),children:[t.jsx("input",{type:"text",placeholder:"Search workflow ID...",value:u,onChange:s=>C(s.target.value),className:"input text-2xs py-1 px-2 w-56"}),t.jsx(f,{}),t.jsx(x,{label:"Type",value:a.entity,onChange:s=>e("entity",s),options:D.map(s=>({value:s,label:s}))}),t.jsx(f,{}),t.jsx(x,{label:"Status",value:a.status,onChange:s=>e("status",s),options:[{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}]}),t.jsx(f,{}),t.jsx(x,{label:"Tier",value:a.tier==="all"?"":a.tier,onChange:s=>e("tier",s||"all"),options:[{value:"certified",label:"Certified"},{value:"durable",label:"Durable"}]})]}),t.jsx(O,{columns:_,data:F,keyFn:s=>s.workflow_id,onRowClick:s=>n(`/workflows/executions/${s.workflow_id}`),isLoading:N,emptyMessage:W,sort:r,onSort:j}),t.jsx(J,{page:o.page,totalPages:o.totalPages(h),onPageChange:o.setPage,total:h,pageSize:o.pageSize,onPageSizeChange:o.setPageSize})]})}export{ke as WorkflowsDashboard};
2
- //# sourceMappingURL=WorkflowsDashboard-DDWwCT-v.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkflowsDashboard-DDWwCT-v.js","sources":["../../src/pages/workflows/WorkflowsDashboard.tsx"],"sourcesContent":["import { useState, useEffect, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { Filter, Settings } from 'lucide-react';\nimport { ElapsedCell } from '../../components/common/display/ElapsedCell';\nimport { DateValue } from '../../components/common/display/DateValue';\nimport { useJobs, useWorkflowConfigs, useDiscoveredWorkflows } from '../../api/workflows';\nimport { useAuth } from '../../hooks/useAuth';\nimport { useNamespace } from '../../hooks/useNamespace';\nimport { useWorkflowListEvents } from '../../hooks/useEventHooks';\nimport { useFilterParams } from '../../hooks/useFilterParams';\nimport { buildApiPath } from '../../lib/api-path';\nimport { DataTable, type Column } from '../../components/common/data/DataTable';\nimport { WorkflowPill } from '../../components/common/display/WorkflowPill';\nimport { PageHeader } from '../../components/common/layout/PageHeader';\nimport { FilterBar, FilterSelect, FilterDivider } from '../../components/common/data/FilterBar';\nimport { StickyPagination } from '../../components/common/data/StickyPagination';\nimport { ListToolbar } from '../../components/common/data/ListToolbar';\nimport { RowAction, RowActionGroup } from '../../components/common/layout/RowActions';\nimport type { LTJob, WorkflowTier } from '../../api/types';\n\nexport type ExecutionsTier = 'all' | 'certified' | 'durable';\n\nconst jobStatusMap: Record<string, string> = {\n running: 'in_progress',\n completed: 'completed',\n failed: 'failed',\n};\n\nconst STATUS_DOT: Record<string, string> = {\n in_progress: 'bg-status-active',\n completed: 'bg-status-success',\n failed: 'bg-status-error',\n};\n\nconst STATUS_COLORS: Record<string, string> = {\n running: 'text-status-active',\n completed: 'text-status-success',\n failed: 'text-status-error',\n};\n\nfunction buildColumns(\n onFilterEntity: (entity: string) => void,\n onFilterStatus: (status: string) => void,\n isSuperAdmin: boolean,\n navigate: (path: string) => void,\n tierMap: Map<string, WorkflowTier>,\n): Column<LTJob>[] {\n return [\n {\n key: 'workflow_id',\n label: 'Workflow ID',\n render: (row) => {\n const dotClass = STATUS_DOT[jobStatusMap[row.status] ?? row.status] ?? 'bg-status-pending';\n const pulseClass = row.status === 'running' ? ' animate-pulse' : '';\n return (\n <div className=\"flex items-center gap-2 min-w-0\">\n <span className={`w-2.5 h-2.5 shrink-0 rounded-full dot-ring ${dotClass}${pulseClass}`} title={row.status} />\n <span className=\"font-mono text-xs text-text-primary truncate\">{row.workflow_id}</span>\n </div>\n );\n },\n },\n {\n key: 'entity',\n label: 'Type',\n render: (row) => <WorkflowPill type={row.entity} variant={tierMap.get(row.entity) ?? 'durable'} size=\"xs\" />,\n className: 'w-44 shrink-0',\n },\n {\n key: 'created_at',\n label: 'Created',\n render: (row) => <DateValue date={row.created_at} format=\"relative\" className=\"text-xs text-text-secondary whitespace-nowrap\" />,\n className: 'w-32',\n sortable: true,\n },\n {\n key: 'updated_at',\n label: 'Updated',\n render: (row) => <DateValue date={row.updated_at} format=\"relative\" className=\"text-xs text-text-secondary whitespace-nowrap\" />,\n className: 'w-32',\n sortable: true,\n },\n {\n key: 'duration',\n label: 'Duration',\n render: (row) => (\n <ElapsedCell\n startDate={row.created_at}\n endDate={row.status === 'running' ? null : row.updated_at}\n isLive={row.status === 'running'}\n />\n ),\n className: 'w-28',\n },\n {\n key: 'actions',\n label: '',\n render: (row) => (\n <RowActionGroup>\n <RowAction\n icon={Filter}\n title={`Filter by ${row.entity}`}\n onClick={() => onFilterEntity(row.entity)}\n />\n <button\n onClick={(e) => { e.stopPropagation(); onFilterStatus(row.status); }}\n className=\"opacity-0 group-hover/row:opacity-100 transition-opacity\"\n title={`Filter by ${row.status}`}\n >\n <svg className={`w-[18px] h-[18px] ${STATUS_COLORS[row.status] ?? 'text-text-tertiary'} hover:opacity-70`} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5}>\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n </svg>\n </button>\n {isSuperAdmin && (\n <RowAction\n icon={Settings}\n title=\"View config\"\n onClick={() => navigate(`/workflows/registry/${encodeURIComponent(row.entity)}`)}\n />\n )}\n </RowActionGroup>\n ),\n className: 'w-24 text-right',\n },\n ];\n}\n\nexport function WorkflowsDashboard({ tier: initialTier = 'all' }: { tier?: ExecutionsTier }) {\n useWorkflowListEvents();\n const navigate = useNavigate();\n const { isSuperAdmin } = useAuth();\n const { namespace } = useNamespace();\n\n const { filters, setFilter, pagination, sort, setSort } = useFilterParams({\n filters: { search: '', entity: '', status: '', tier: initialTier },\n });\n\n const activeTier = (filters.tier || 'all') as ExecutionsTier;\n\n // Map tier to server-side registered filter\n const registeredFilter = activeTier === 'certified' ? 'true'\n : activeTier === 'durable' ? 'false'\n : undefined;\n\n const { data: configs } = useWorkflowConfigs();\n const { data: discoveredData } = useDiscoveredWorkflows();\n\n const tierMap = useMemo(() => {\n const map = new Map<string, WorkflowTier>();\n for (const dw of discoveredData ?? []) {\n map.set(dw.workflow_type, dw.tier ?? 'durable');\n }\n return map;\n }, [discoveredData]);\n\n const columns = buildColumns(\n (entity) => setFilter('entity', entity),\n (status) => setFilter('status', status),\n isSuperAdmin,\n navigate,\n tierMap,\n );\n const [searchInput, setSearchInput] = useState(filters.search);\n\n useEffect(() => {\n if (searchInput === filters.search) return;\n const timer = setTimeout(() => setFilter('search', searchInput), 300);\n return () => clearTimeout(timer);\n }, [searchInput, setFilter, filters.search]);\n\n const { data: jobsData, isLoading, refetch, isFetching } = useJobs({\n limit: pagination.pageSize,\n offset: pagination.offset,\n entity: filters.entity || undefined,\n search: filters.search || undefined,\n status: filters.status || undefined,\n sort_by: sort.sort_by || 'created_at',\n order: sort.order || 'desc',\n registered: registeredFilter,\n namespace: namespace || undefined,\n });\n\n const total = jobsData?.total ?? 0;\n const jobs = jobsData?.jobs ?? [];\n\n const entities = useMemo(() => {\n return [...new Set((configs ?? []).map((c) => c.workflow_type))].sort();\n }, [configs]);\n\n const pageTitle = 'Workflow Executions';\n\n const emptyMessage = activeTier === 'certified'\n ? 'No certified workflow executions found'\n : activeTier === 'durable'\n ? 'No durable workflow executions found'\n : 'No workflow executions found';\n\n return (\n <div>\n <PageHeader title={pageTitle} docsHash=\"#docs:dashboard.md:procedural-executions\" />\n\n <FilterBar actions={\n <ListToolbar\n onRefresh={() => refetch()}\n isFetching={isFetching}\n apiPath={buildApiPath('/workflow-states/jobs', {\n limit: pagination.pageSize,\n offset: pagination.offset,\n entity: filters.entity || undefined,\n search: filters.search || undefined,\n status: filters.status || undefined,\n sort_by: sort.sort_by || 'created_at',\n order: sort.order || 'desc',\n registered: registeredFilter,\n namespace: namespace || undefined,\n })}\n />\n }>\n <input\n type=\"text\"\n placeholder=\"Search workflow ID...\"\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n className=\"input text-2xs py-1 px-2 w-56\"\n />\n <FilterDivider />\n <FilterSelect\n label=\"Type\"\n value={filters.entity}\n onChange={(v) => setFilter('entity', v)}\n options={entities.map((e) => ({ value: e, label: e }))}\n />\n <FilterDivider />\n <FilterSelect\n label=\"Status\"\n value={filters.status}\n onChange={(v) => setFilter('status', v)}\n options={[\n { value: 'running', label: 'Running' },\n { value: 'completed', label: 'Completed' },\n { value: 'failed', label: 'Failed' },\n ]}\n />\n <FilterDivider />\n <FilterSelect\n label=\"Tier\"\n value={filters.tier === 'all' ? '' : filters.tier}\n onChange={(v) => setFilter('tier', v || 'all')}\n options={[\n { value: 'certified', label: 'Certified' },\n { value: 'durable', label: 'Durable' },\n ]}\n />\n </FilterBar>\n\n <DataTable\n columns={columns}\n data={jobs}\n keyFn={(row) => row.workflow_id}\n onRowClick={(row) => navigate(`/workflows/executions/${row.workflow_id}`)}\n isLoading={isLoading}\n emptyMessage={emptyMessage}\n sort={sort}\n onSort={setSort}\n />\n\n <StickyPagination\n page={pagination.page}\n totalPages={pagination.totalPages(total)}\n onPageChange={pagination.setPage}\n total={total}\n pageSize={pagination.pageSize}\n onPageSizeChange={pagination.setPageSize}\n />\n </div>\n );\n}\n"],"names":["jobStatusMap","STATUS_DOT","STATUS_COLORS","buildColumns","onFilterEntity","onFilterStatus","isSuperAdmin","navigate","tierMap","row","dotClass","pulseClass","jsxs","jsx","WorkflowPill","DateValue","ElapsedCell","RowActionGroup","RowAction","Filter","e","Settings","WorkflowsDashboard","initialTier","useWorkflowListEvents","useNavigate","useAuth","namespace","useNamespace","filters","setFilter","pagination","sort","setSort","useFilterParams","activeTier","registeredFilter","configs","useWorkflowConfigs","discoveredData","useDiscoveredWorkflows","useMemo","map","dw","columns","entity","status","searchInput","setSearchInput","useState","useEffect","timer","jobsData","isLoading","refetch","isFetching","useJobs","total","jobs","entities","c","pageTitle","emptyMessage","PageHeader","FilterBar","ListToolbar","buildApiPath","FilterDivider","FilterSelect","v","DataTable","StickyPagination"],"mappings":"04BAsBA,MAAMA,EAAuC,CAC3C,QAAS,cACT,UAAW,YACX,OAAQ,QACV,EAEMC,GAAqC,CACzC,YAAa,mBACb,UAAW,oBACX,OAAQ,iBACV,EAEMC,GAAwC,CAC5C,QAAS,qBACT,UAAW,sBACX,OAAQ,mBACV,EAEA,SAASC,GACPC,EACAC,EACAC,EACAC,EACAC,EACiB,CACjB,MAAO,CACL,CACE,IAAK,cACL,MAAO,cACP,OAASC,GAAQ,CACf,MAAMC,EAAWT,GAAWD,EAAaS,EAAI,MAAM,GAAKA,EAAI,MAAM,GAAK,oBACjEE,EAAaF,EAAI,SAAW,UAAY,iBAAmB,GACjE,OACEG,EAAAA,KAAC,MAAA,CAAI,UAAU,kCACb,S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ACA,SAAU1B,EAAW,SACrB,iBAAkBA,EAAW,WAAA,CAAA,CAC/B,EACF,CAEJ"}
@@ -1,2 +0,0 @@
1
- import{a as x,j as t}from"./vendor-query-RUZdMvN6.js";import{b as C,u as k}from"./workflows-DR9OQcuq.js";import{b as $}from"./useEventHooks-DL3Vhz4g.js";import{P as D}from"./PageHeader-CFVw67M6.js";import{S as h}from"./StatCard-BXQ8dD9Y.js";import{u as w}from"./vendor-react-CdqEC2zv.js";import"./index-DSdqso-_.js";import"./vendor-icons-h-jlRSb9.js";const v=[{label:"1h",ms:36e5},{label:"24h",ms:864e5},{label:"7d",ms:6048e5},{label:"30d",ms:2592e6}];function T(r){return r<1e3?`${Math.round(r)}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${(r/6e4).toFixed(1)}m`:`${(r/36e5).toFixed(1)}h`}function p({value:r,colorClass:o,onClick:f}){return r===0?t.jsx("span",{className:"text-text-tertiary",children:"0"}):t.jsx("button",{onClick:f,className:`${o} hover:underline tabular-nums font-medium`,children:r})}function _(){$();const r=w(),[o,f]=x.useState("24h"),{data:c}=C({limit:500}),{data:g}=k(),b=x.useMemo(()=>{const e=v.find(i=>i.label===o);return Date.now()-e.ms},[o]),n=x.useMemo(()=>((c==null?void 0:c.jobs)??[]).filter(e=>new Date(e.created_at).getTime()>=b),[c==null?void 0:c.jobs,b]),j=x.useMemo(()=>{const e=new Map;for(const a of n){const s=e.get(a.entity)??{total:0,running:0,completed:0,failed:0,durations:[]};if(s.total++,a.status==="running"&&s.running++,a.status==="completed"){s.completed++;const m=new Date(a.updated_at).getTime()-new Date(a.created_at).getTime();m>0&&s.durations.push(m)}a.status==="failed"&&s.failed++,e.set(a.entity,s)}const i=[];for(const[a,s]of e)i.push({type:a,...s,avgDuration:s.durations.length>0?s.durations.reduce((m,N)=>m+N,0)/s.durations.length:null});return i.sort((a,s)=>s.total-a.total)},[n]),u=x.useMemo(()=>({total:n.length,running:n.filter(e=>e.status==="running").length,completed:n.filter(e=>e.status==="completed").length,failed:n.filter(e=>e.status==="failed").length}),[n]),y=(g==null?void 0:g.length)??0,l=(e,i)=>{const a=new URLSearchParams;e&&a.set("entity",e),i&&a.set("status",i);const s=a.toString();r(`/workflows/executions${s?`?${s}`:""}`)},d="pb-2 text-2xs font-semibold uppercase tracking-widest text-text-tertiary";return t.jsxs("div",{children:[t.jsx(D,{title:"Workflows",actions:t.jsxs("span",{className:"text-xs text-text-tertiary",children:[y," certified type",y!==1?"s":""]})}),t.jsx("div",{className:"flex items-center gap-1 mb-6",children:v.map(e=>t.jsx("button",{onClick:()=>f(e.label),className:`px-3 py-1 text-xs rounded-full transition-colors ${o===e.label?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:e.label},e.label))}),t.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[t.jsx(h,{label:"Total",value:u.total,onClick:()=>l()}),t.jsx(h,{label:"Running",value:u.running,colorClass:"text-status-active",onClick:()=>l(void 0,"running")}),t.jsx(h,{label:"Completed",value:u.completed,colorClass:"text-status-success",onClick:()=>l(void 0,"completed")}),t.jsx(h,{label:"Failed",value:u.failed,colorClass:"text-status-error",onClick:()=>l(void 0,"failed")})]}),j.length>0&&t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-surface-border",children:[t.jsx("th",{className:d,children:"Type"}),t.jsx("th",{className:`${d} text-right w-20`,children:"Total"}),t.jsx("th",{className:`${d} text-right w-20`,children:"Running"}),t.jsx("th",{className:`${d} text-right w-24`,children:"Completed"}),t.jsx("th",{className:`${d} text-right w-20`,children:"Failed"}),t.jsx("th",{className:`${d} text-right w-28`,children:"Avg Duration"})]})}),t.jsx("tbody",{children:j.map(e=>t.jsxs("tr",{className:"border-b border-surface-border last:border-b-0",children:[t.jsx("td",{className:"py-3 text-sm font-mono text-text-primary",children:t.jsx("button",{onClick:()=>l(e.type),className:"hover:text-accent hover:underline",children:e.type})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.total,colorClass:"text-text-secondary",onClick:()=>l(e.type)})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.running,colorClass:"text-status-active",onClick:()=>l(e.type,"running")})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.completed,colorClass:"text-status-success",onClick:()=>l(e.type,"completed")})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.failed,colorClass:"text-status-error",onClick:()=>l(e.type,"failed")})}),t.jsx("td",{className:"py-3 text-sm font-mono text-text-secondary text-right",children:e.avgDuration!==null?T(e.avgDuration):"—"})]},e.type))})]}),j.length===0&&t.jsx("div",{className:"py-16 text-center",children:t.jsxs("p",{className:"text-sm text-text-tertiary",children:["No workflow activity in the last ",o]})})]})}export{_ as WorkflowsOverview};
2
- //# sourceMappingURL=WorkflowsOverview-DdKRtWdK.js.map
@@ -1,2 +0,0 @@
1
- import{u as i}from"./vendor-query-RUZdMvN6.js";import{g as e}from"./index-DSdqso-_.js";function t(){return i({queryKey:["capabilities"],queryFn:()=>e("/capabilities")})}export{t as u};
2
- //# sourceMappingURL=capabilities-CEo0AB79.js.map
@@ -1,2 +0,0 @@
1
- import{a as w,j as e}from"./vendor-query-RUZdMvN6.js";import{W as k,X as C,Y as E,m as b}from"./index-DSdqso-_.js";import{s as P,aq as S,ar as T,as as y,ai as $,aj as L,at as O}from"./vendor-icons-h-jlRSb9.js";import{E as _}from"./EntityTimelinePanel-D3QNqDiL.js";import{F,b as f,c as v,a as R}from"./FilterBar-fwUqeM-5.js";import{P as W}from"./PriorityBadge-BETdj4M-.js";import{R as A}from"./RolePill-Di_5hfvw.js";import{W as I}from"./WorkflowPill-CN-952iI.js";import{C as q,a as B,i as K}from"./CountdownTimer-Cvif0QtN.js";import{L as g}from"./vendor-react-CdqEC2zv.js";function ae({role:t,options:s,onChange:d,emptyLabel:x="All Escalations",locked:p=!1}){var a;const[i,n]=w.useState(!1),o=w.useRef(null);w.useEffect(()=>{if(!i)return;const l=h=>{o.current&&!o.current.contains(h.target)&&n(!1)},u=h=>{h.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",u)}},[i]);const m=t?((a=s.find(l=>l.value===t))==null?void 0:a.label)??k(t):x,r=l=>`w-full text-left px-3 py-1.5 text-sm flex items-baseline gap-2 transition-colors ${l?"text-accent bg-accent/5":"text-text-primary hover:bg-surface-hover"}`;return p?e.jsx("h1",{className:"heading-1 min-w-0 truncate","data-testid":"escalation-title-locked",children:m}):e.jsxs("div",{ref:o,className:"relative min-w-0",children:[e.jsxs("button",{type:"button",onClick:()=>n(l=>!l),className:"group flex items-center gap-2 min-w-0 heading-1 hover:text-accent transition-colors",children:[e.jsx("span",{className:"truncate",children:m}),e.jsx(P,{className:`w-6 h-6 shrink-0 text-text-tertiary group-hover:text-accent transition-transform ${i?"rotate-180":""}`,strokeWidth:1.5})]}),i&&e.jsxs("div",{className:"absolute z-[100] top-full left-0 mt-2 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("button",{type:"button",onClick:()=>{d(""),n(!1)},className:r(!t),children:x}),s.length>0&&e.jsx("div",{className:"h-px bg-surface-border my-1"}),s.map(l=>e.jsxs("button",{type:"button",onClick:()=>{d(l.value),n(!1)},className:r(t===l.value),children:[e.jsx("span",{className:"truncate",children:l.label}),l.label!==l.value&&e.jsx("span",{className:"text-2xs font-mono text-text-quaternary shrink-0",children:l.value})]},l.value))]})]})}const j="text-text-secondary transition-colors group-hover/row:text-text-primary";function M({row:t}){if(B(t)){const s=t.status==="resolved"?"text-status-success":"text-text-tertiary";return e.jsx(T,{className:`w-3 h-3 shrink-0 ${s}`})}return t.status==="resolved"?e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-success",strokeWidth:2.5}):t.status==="cancelled"?e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-error",strokeWidth:2.5}):K(t)?e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-warning",strokeWidth:2.5}):e.jsx(y,{className:"w-2.5 h-2.5 shrink-0 text-status-active",strokeWidth:2.5})}function D({metadata:t,role:s,highlightKeys:d}){const[x,p]=w.useState(!1),i=E();if(!t||Object.keys(t).length===0)return e.jsx("span",{className:"text-2xs text-text-tertiary",children:"—"});const n=d??[],o=[...n.filter(a=>a in t),...Object.keys(t).filter(a=>!n.includes(a))],m=x?o:o.slice(0,1),r=o.length-1;return e.jsx("div",{className:"w-full",onClick:a=>a.stopPropagation(),children:e.jsx("div",{className:"space-y-px",children:m.map((a,l)=>{const u=typeof t[a]=="object"&&t[a]!==null?JSON.stringify(t[a]):String(t[a]),h=n.includes(a),N=l===m.length-1;return e.jsxs("div",{className:"group/mrow flex items-center gap-1 min-w-0",children:[e.jsx("span",{className:`shrink-0 w-14 text-2xs font-mono uppercase tracking-wide truncate ${h?"text-accent":"text-text-tertiary"}`,title:a,children:a}),e.jsx("span",{className:`flex-1 min-w-0 text-2xs font-medium truncate ${h?"text-text-primary":"text-text-secondary"}`,title:u,children:u}),e.jsxs("span",{className:"flex items-center gap-px shrink-0 opacity-50 group-hover/mrow:opacity-100 transition-opacity",children:[e.jsx(g,{to:b(a,t[a],s),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Filter ${s}: ${a} = ${u}`,onClick:c=>c.stopPropagation(),children:e.jsx($,{className:"w-3 h-3"})}),e.jsx(g,{to:b(a,t[a]),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Search all: ${a} = ${u}`,onClick:c=>c.stopPropagation(),children:e.jsx(L,{className:"w-3 h-3"})}),i&&typeof t[a]=="string"&&e.jsx("button",{className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Timeline: every station ${u} has moved through`,onClick:c=>{c.stopPropagation(),i.setPanel(e.jsx(_,{facetKey:a,value:t[a],role:s}),{key:"entity-timeline",width:420})},children:e.jsx(O,{className:"w-3 h-3"})})]}),!x&&r>0&&e.jsxs("button",{onClick:c=>{c.stopPropagation(),p(!0)},className:"shrink-0 text-2xs text-text-quaternary hover:text-accent transition-colors font-mono",title:`Show ${r} more fields`,children:["+",r]}),x&&N&&r>0&&e.jsx("button",{onClick:c=>{c.stopPropagation(),p(!1)},className:"shrink-0 text-2xs text-text-quaternary hover:text-accent transition-colors",title:"Show less",children:"↑"})]},a)})})})}function U(t={}){return[{key:"description",label:"Summary",priority:1,render:s=>e.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[e.jsx("span",{className:"shrink-0",children:e.jsx(M,{row:s})}),e.jsx("span",{className:`truncate text-xs ${j}`,children:s.description||s.type})]}),className:"max-w-0"},{key:"role",label:"Role",priority:2,render:s=>e.jsx("span",{className:j,children:e.jsx(A,{role:s.role,size:"md",tone:"inherit"})}),className:"w-44 min-w-[11rem]"},{key:"priority",label:"Pri",priority:2,render:s=>e.jsx("span",{className:j,children:e.jsx(W,{priority:s.priority,size:"sm",tone:"inherit"})}),className:"w-10"},{key:"workflow_type",label:"Workflow",priority:2,showFrom:"split",render:s=>e.jsx(I,{type:s.workflow_type||s.type}),className:"w-40 whitespace-nowrap"},{key:"metadata",label:"Metadata",priority:2,showFrom:"wall",render:s=>e.jsx(D,{metadata:s.metadata,role:s.role,highlightKeys:t.highlightKeys}),className:"w-80 max-w-[19rem] align-top"},{key:"created_at",label:"Ago",priority:1,render:s=>e.jsx("span",{className:`text-xs tabular-nums ${j}`,title:s.created_at,children:C(s.created_at)}),className:"w-14 whitespace-nowrap"}]}const re=U(),le={key:"expires",label:e.jsx(S,{className:"w-3.5 h-3.5 text-text-tertiary"}),render:t=>t.assigned_until?e.jsx(q,{until:t.assigned_until}):e.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-16 whitespace-nowrap",priority:1},z=[{value:"1",label:"P1"},{value:"2",label:"P2"},{value:"3",label:"P3"},{value:"4",label:"P4"}],H=[{value:"all",label:"All"},{value:"available",label:"Available"},{value:"claimed",label:"Claimed"},{value:"resolved",label:"Resolved"},{value:"cancelled",label:"Cancelled"},{value:"expired",label:"Expired"}];function ne({filters:t,setFilter:s,roles:d,types:x,showStatus:p=!1,showSearch:i=!0,showRole:n=!0,actions:o}){const m=[t.role,t.type,t.priority,t.status&&t.status!=="all"?t.status:"",t.search??""].filter(Boolean).length;return e.jsxs(F,{actions:o,activeFilterCount:m,children:[p&&e.jsxs(e.Fragment,{children:[e.jsx(f,{label:"Status",value:t.status??"",onChange:r=>s("status",r),options:H}),e.jsx(v,{})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx(f,{label:"Role",value:t.role,onChange:r=>s("role",r),options:d.map(r=>({value:r,label:r}))}),e.jsx(v,{})]}),e.jsx(f,{label:"Priority",value:t.priority,onChange:r=>s("priority",r),options:z}),e.jsx(v,{}),e.jsx(f,{label:"Workflow Type",value:t.type,onChange:r=>s("type",r),options:x.map(r=>({value:r,label:r}))}),i&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx(R,{label:"Search",value:t.search??"",onChange:r=>s("search",r),placeholder:"ID, workflow, origin…"})]})]})}export{ae as E,le as T,ne as a,re as b,U as m};
2
- //# sourceMappingURL=escalation-columns-CUtDSbxl.js.map