@hotmeshio/long-tail 0.9.3 → 0.9.5

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 (195) hide show
  1. package/dashboard/dist/assets/{AdminDashboard-BONGlQva.js → AdminDashboard-PvD1IObg.js} +2 -2
  2. package/dashboard/dist/assets/{AdminDashboard-BONGlQva.js.map → AdminDashboard-PvD1IObg.js.map} +1 -1
  3. package/dashboard/dist/assets/{AgentConfigPage-C_NJ4-pr.js → AgentConfigPage-BB9NCIiK.js} +5 -5
  4. package/dashboard/dist/assets/{AgentConfigPage-C_NJ4-pr.js.map → AgentConfigPage-BB9NCIiK.js.map} +1 -1
  5. package/dashboard/dist/assets/{AgentDetailPage-MSCS6bFD.js → AgentDetailPage-B570UVLx.js} +3 -3
  6. package/dashboard/dist/assets/{AgentDetailPage-MSCS6bFD.js.map → AgentDetailPage-B570UVLx.js.map} +1 -1
  7. package/dashboard/dist/assets/{AgentsPage-PfSvedS-.js → AgentsPage-CgUucHar.js} +2 -2
  8. package/dashboard/dist/assets/{AgentsPage-PfSvedS-.js.map → AgentsPage-CgUucHar.js.map} +1 -1
  9. package/dashboard/dist/assets/AvailableEscalationsPage-B1cCs4jO.js +2 -0
  10. package/dashboard/dist/assets/AvailableEscalationsPage-B1cCs4jO.js.map +1 -0
  11. package/dashboard/dist/assets/{BotPicker-DmCdoim8.js → BotPicker-CYw4ZeAh.js} +2 -2
  12. package/dashboard/dist/assets/{BotPicker-DmCdoim8.js.map → BotPicker-CYw4ZeAh.js.map} +1 -1
  13. package/dashboard/dist/assets/{CapabilitiesPage-DVf4zIMZ.js → CapabilitiesPage-C8DL3cDA.js} +2 -2
  14. package/dashboard/dist/assets/{CapabilitiesPage-DVf4zIMZ.js.map → CapabilitiesPage-C8DL3cDA.js.map} +1 -1
  15. package/dashboard/dist/assets/{CollapsibleSection-7ACdYUZy.js → CollapsibleSection-CDdlmdb6.js} +2 -2
  16. package/dashboard/dist/assets/{CollapsibleSection-7ACdYUZy.js.map → CollapsibleSection-CDdlmdb6.js.map} +1 -1
  17. package/dashboard/dist/assets/{CountdownTimer-Gbp6RHav.js → CountdownTimer-BrQl3JWm.js} +2 -2
  18. package/dashboard/dist/assets/{CountdownTimer-Gbp6RHav.js.map → CountdownTimer-BrQl3JWm.js.map} +1 -1
  19. package/dashboard/dist/assets/{CredentialsPage-JWCUgQMi.js → CredentialsPage-Bt7tQHlp.js} +2 -2
  20. package/dashboard/dist/assets/{CredentialsPage-JWCUgQMi.js.map → CredentialsPage-Bt7tQHlp.js.map} +1 -1
  21. package/dashboard/dist/assets/{CronLabel-9GtrGEDe.js → CronLabel-DbwuLMO0.js} +2 -2
  22. package/dashboard/dist/assets/{CronLabel-9GtrGEDe.js.map → CronLabel-DbwuLMO0.js.map} +1 -1
  23. package/dashboard/dist/assets/{CustomDurationPicker-xNJMIvjL.js → CustomDurationPicker-CKfgf650.js} +2 -2
  24. package/dashboard/dist/assets/{CustomDurationPicker-xNJMIvjL.js.map → CustomDurationPicker-CKfgf650.js.map} +1 -1
  25. package/dashboard/dist/assets/{DropZone-wJqP4zA4.js → DropZone-C1TpkVQG.js} +2 -2
  26. package/dashboard/dist/assets/{DropZone-wJqP4zA4.js.map → DropZone-C1TpkVQG.js.map} +1 -1
  27. package/dashboard/dist/assets/{ElapsedCell-rRiChKDm.js → ElapsedCell-CgpTWk8N.js} +2 -2
  28. package/dashboard/dist/assets/{ElapsedCell-rRiChKDm.js.map → ElapsedCell-CgpTWk8N.js.map} +1 -1
  29. package/dashboard/dist/assets/{EscalationListSchemaPage-B7PHz5CB.js → EscalationListSchemaPage-CxFxPz4C.js} +3 -3
  30. package/dashboard/dist/assets/{EscalationListSchemaPage-B7PHz5CB.js.map → EscalationListSchemaPage-CxFxPz4C.js.map} +1 -1
  31. package/dashboard/dist/assets/{EscalationSchemaPage-_CbayTDk.js → EscalationSchemaPage-CXvjwJ_I.js} +3 -3
  32. package/dashboard/dist/assets/{EscalationSchemaPage-_CbayTDk.js.map → EscalationSchemaPage-CXvjwJ_I.js.map} +1 -1
  33. package/dashboard/dist/assets/{EscalationsOverview-C5bVdGf2.js → EscalationsOverview-BY4dLou7.js} +2 -2
  34. package/dashboard/dist/assets/{EscalationsOverview-C5bVdGf2.js.map → EscalationsOverview-BY4dLou7.js.map} +1 -1
  35. package/dashboard/dist/assets/{EventTable-DGaRYVnB.js → EventTable-MFAHeFTY.js} +2 -2
  36. package/dashboard/dist/assets/{EventTable-DGaRYVnB.js.map → EventTable-MFAHeFTY.js.map} +1 -1
  37. package/dashboard/dist/assets/{GraphInvokePage-R6_p2Sy7.js → GraphInvokePage-7T-6qC2N.js} +2 -2
  38. package/dashboard/dist/assets/{GraphInvokePage-R6_p2Sy7.js.map → GraphInvokePage-7T-6qC2N.js.map} +1 -1
  39. package/dashboard/dist/assets/{HomePage-DHxtqRkD.js → HomePage-1PI7E3sw.js} +2 -2
  40. package/dashboard/dist/assets/{HomePage-DHxtqRkD.js.map → HomePage-1PI7E3sw.js.map} +1 -1
  41. package/dashboard/dist/assets/{ListToolbar-BhXp7clK.js → ListToolbar-DmRE3_dX.js} +2 -2
  42. package/dashboard/dist/assets/{ListToolbar-BhXp7clK.js.map → ListToolbar-DmRE3_dX.js.map} +1 -1
  43. package/dashboard/dist/assets/{McpOverview-COgIIWkK.js → McpOverview-BukcrbtX.js} +2 -2
  44. package/dashboard/dist/assets/{McpOverview-COgIIWkK.js.map → McpOverview-BukcrbtX.js.map} +1 -1
  45. package/dashboard/dist/assets/{McpQueryDetailPage-4LEqQZax.js → McpQueryDetailPage-BVx-cGFZ.js} +2 -2
  46. package/dashboard/dist/assets/{McpQueryDetailPage-4LEqQZax.js.map → McpQueryDetailPage-BVx-cGFZ.js.map} +1 -1
  47. package/dashboard/dist/assets/{McpQueryPage-DWAcSqF-.js → McpQueryPage-DPXnA6Wa.js} +2 -2
  48. package/dashboard/dist/assets/{McpQueryPage-DWAcSqF-.js.map → McpQueryPage-DPXnA6Wa.js.map} +1 -1
  49. package/dashboard/dist/assets/{McpRunDetailPage-BNjhOPLp.js → McpRunDetailPage-D3dcICPJ.js} +2 -2
  50. package/dashboard/dist/assets/{McpRunDetailPage-BNjhOPLp.js.map → McpRunDetailPage-D3dcICPJ.js.map} +1 -1
  51. package/dashboard/dist/assets/{McpRunsPage-DAjYKqqt.js → McpRunsPage-CzISyj7e.js} +2 -2
  52. package/dashboard/dist/assets/{McpRunsPage-DAjYKqqt.js.map → McpRunsPage-CzISyj7e.js.map} +1 -1
  53. package/dashboard/dist/assets/{NamespacePill-BlhSWa5S.js → NamespacePill--ikKtMvx.js} +2 -2
  54. package/dashboard/dist/assets/{NamespacePill-BlhSWa5S.js.map → NamespacePill--ikKtMvx.js.map} +1 -1
  55. package/dashboard/dist/assets/{OperationsPage-5RkfIbtT.js → OperationsPage-BYth5Dxg.js} +2 -2
  56. package/dashboard/dist/assets/{OperationsPage-5RkfIbtT.js.map → OperationsPage-BYth5Dxg.js.map} +1 -1
  57. package/dashboard/dist/assets/{OperatorDashboard-B-2dIbj4.js → OperatorDashboard-C_bMBGyy.js} +2 -2
  58. package/dashboard/dist/assets/{OperatorDashboard-B-2dIbj4.js.map → OperatorDashboard-C_bMBGyy.js.map} +1 -1
  59. package/dashboard/dist/assets/{PageHeader-Ji1AtA4f.js → PageHeader-CiFhzGc0.js} +2 -2
  60. package/dashboard/dist/assets/{PageHeader-Ji1AtA4f.js.map → PageHeader-CiFhzGc0.js.map} +1 -1
  61. package/dashboard/dist/assets/{PageHeaderWithStats-B2qrFAaG.js → PageHeaderWithStats-_zOnWAhq.js} +2 -2
  62. package/dashboard/dist/assets/{PageHeaderWithStats-B2qrFAaG.js.map → PageHeaderWithStats-_zOnWAhq.js.map} +1 -1
  63. package/dashboard/dist/assets/{ProcessDetailPage-Bx7sF-vV.js → ProcessDetailPage-BVR41sYI.js} +2 -2
  64. package/dashboard/dist/assets/{ProcessDetailPage-Bx7sF-vV.js.map → ProcessDetailPage-BVR41sYI.js.map} +1 -1
  65. package/dashboard/dist/assets/{ProcessesListPage-Dsfc-DX_.js → ProcessesListPage-DAgFK_ln.js} +2 -2
  66. package/dashboard/dist/assets/{ProcessesListPage-Dsfc-DX_.js.map → ProcessesListPage-DAgFK_ln.js.map} +1 -1
  67. package/dashboard/dist/assets/{RoleDetailPage-DF-ov9E9.js → RoleDetailPage-NxT8GaWV.js} +3 -3
  68. package/dashboard/dist/assets/{RoleDetailPage-DF-ov9E9.js.map → RoleDetailPage-NxT8GaWV.js.map} +1 -1
  69. package/dashboard/dist/assets/{RolePill-ColM_ynA.js → RolePill-CUIJSgRq.js} +2 -2
  70. package/dashboard/dist/assets/{RolePill-ColM_ynA.js.map → RolePill-CUIJSgRq.js.map} +1 -1
  71. package/dashboard/dist/assets/{RolesPage-DIlde9bw.js → RolesPage-dRSC725H.js} +2 -2
  72. package/dashboard/dist/assets/{RolesPage-DIlde9bw.js.map → RolesPage-dRSC725H.js.map} +1 -1
  73. package/dashboard/dist/assets/{RunAsSelector-DOYUYXcD.js → RunAsSelector-C36xqdKj.js} +2 -2
  74. package/dashboard/dist/assets/{RunAsSelector-DOYUYXcD.js.map → RunAsSelector-C36xqdKj.js.map} +1 -1
  75. package/dashboard/dist/assets/{SlidePanel-BzeKveus.js → SlidePanel-BcWKelpn.js} +2 -2
  76. package/dashboard/dist/assets/{SlidePanel-BzeKveus.js.map → SlidePanel-BcWKelpn.js.map} +1 -1
  77. package/dashboard/dist/assets/{StickyPagination-BwXLmDc-.js → StickyPagination-D_HhyJ5V.js} +2 -2
  78. package/dashboard/dist/assets/{StickyPagination-BwXLmDc-.js.map → StickyPagination-D_HhyJ5V.js.map} +1 -1
  79. package/dashboard/dist/assets/StreamMessageDetail-C39lLYKC.js +2 -0
  80. package/dashboard/dist/assets/{StreamMessageDetail-CCez20kE.js.map → StreamMessageDetail-C39lLYKC.js.map} +1 -1
  81. package/dashboard/dist/assets/{SwimlaneTimeline-hcWBunXb.js → SwimlaneTimeline-dlaJS-DC.js} +2 -2
  82. package/dashboard/dist/assets/{SwimlaneTimeline-hcWBunXb.js.map → SwimlaneTimeline-dlaJS-DC.js.map} +1 -1
  83. package/dashboard/dist/assets/{TagInput-By0E_Jym.js → TagInput-BaFJCq9A.js} +2 -2
  84. package/dashboard/dist/assets/{TagInput-By0E_Jym.js.map → TagInput-BaFJCq9A.js.map} +1 -1
  85. package/dashboard/dist/assets/{TaskDetailPage-CIarmoAk.js → TaskDetailPage-DAnT9c0v.js} +2 -2
  86. package/dashboard/dist/assets/{TaskDetailPage-CIarmoAk.js.map → TaskDetailPage-DAnT9c0v.js.map} +1 -1
  87. package/dashboard/dist/assets/{TaskQueuePill-CY1ZSwWu.js → TaskQueuePill-D9e16qkU.js} +2 -2
  88. package/dashboard/dist/assets/{TaskQueuePill-CY1ZSwWu.js.map → TaskQueuePill-D9e16qkU.js.map} +1 -1
  89. package/dashboard/dist/assets/{TasksListPage-CFqMwhLE.js → TasksListPage-CkbK3vdj.js} +2 -2
  90. package/dashboard/dist/assets/{TasksListPage-CFqMwhLE.js.map → TasksListPage-CkbK3vdj.js.map} +1 -1
  91. package/dashboard/dist/assets/{TimeAgo-CuI-66Kw.js → TimeAgo-drImakaN.js} +2 -2
  92. package/dashboard/dist/assets/{TimeAgo-CuI-66Kw.js.map → TimeAgo-drImakaN.js.map} +1 -1
  93. package/dashboard/dist/assets/{TimestampCell-BI3Uptj8.js → TimestampCell-CpWhUW0W.js} +2 -2
  94. package/dashboard/dist/assets/{TimestampCell-BI3Uptj8.js.map → TimestampCell-CpWhUW0W.js.map} +1 -1
  95. package/dashboard/dist/assets/{ToolPill-D0IzqLEe.js → ToolPill-Enc3nyic.js} +2 -2
  96. package/dashboard/dist/assets/{ToolPill-D0IzqLEe.js.map → ToolPill-Enc3nyic.js.map} +1 -1
  97. package/dashboard/dist/assets/{ToolTestPanel-QwGyWRfG.js → ToolTestPanel-PvMw4dIw.js} +2 -2
  98. package/dashboard/dist/assets/{ToolTestPanel-QwGyWRfG.js.map → ToolTestPanel-PvMw4dIw.js.map} +1 -1
  99. package/dashboard/dist/assets/{TopicDetailPage-CGCiqQGf.js → TopicDetailPage-DQa0EuM9.js} +3 -3
  100. package/dashboard/dist/assets/{TopicDetailPage-CGCiqQGf.js.map → TopicDetailPage-DQa0EuM9.js.map} +1 -1
  101. package/dashboard/dist/assets/{TopicsPage-Bk8-inSO.js → TopicsPage-OzE8IWZf.js} +2 -2
  102. package/dashboard/dist/assets/{TopicsPage-Bk8-inSO.js.map → TopicsPage-OzE8IWZf.js.map} +1 -1
  103. package/dashboard/dist/assets/{UserName-BOaihCFP.js → UserName-B-5Cnap4.js} +2 -2
  104. package/dashboard/dist/assets/{UserName-BOaihCFP.js.map → UserName-B-5Cnap4.js.map} +1 -1
  105. package/dashboard/dist/assets/{WorkflowExecutionPage-CE0QzhIt.js → WorkflowExecutionPage-s4H5TnRv.js} +2 -2
  106. package/dashboard/dist/assets/{WorkflowExecutionPage-CE0QzhIt.js.map → WorkflowExecutionPage-s4H5TnRv.js.map} +1 -1
  107. package/dashboard/dist/assets/{WorkflowPill-BXmmLR0t.js → WorkflowPill-S6VV2Eax.js} +2 -2
  108. package/dashboard/dist/assets/{WorkflowPill-BXmmLR0t.js.map → WorkflowPill-S6VV2Eax.js.map} +1 -1
  109. package/dashboard/dist/assets/{WorkflowsDashboard-wgWRZOnB.js → WorkflowsDashboard-BqMJDhpp.js} +2 -2
  110. package/dashboard/dist/assets/{WorkflowsDashboard-wgWRZOnB.js.map → WorkflowsDashboard-BqMJDhpp.js.map} +1 -1
  111. package/dashboard/dist/assets/{WorkflowsOverview-CLyitES7.js → WorkflowsOverview-CVd-TybI.js} +2 -2
  112. package/dashboard/dist/assets/{WorkflowsOverview-CLyitES7.js.map → WorkflowsOverview-CVd-TybI.js.map} +1 -1
  113. package/dashboard/dist/assets/{YamlWorkflowDetailPage-pP2i1ptj.js → YamlWorkflowDetailPage-BshuXnvM.js} +25 -25
  114. package/dashboard/dist/assets/{YamlWorkflowDetailPage-pP2i1ptj.js.map → YamlWorkflowDetailPage-BshuXnvM.js.map} +1 -1
  115. package/dashboard/dist/assets/{YamlWorkflowsPage-BwQSMfYw.js → YamlWorkflowsPage-D2LRoAki.js} +2 -2
  116. package/dashboard/dist/assets/{YamlWorkflowsPage-BwQSMfYw.js.map → YamlWorkflowsPage-D2LRoAki.js.map} +1 -1
  117. package/dashboard/dist/assets/{agents-CRtBacrZ.js → agents-CqeRO052.js} +2 -2
  118. package/dashboard/dist/assets/{agents-CRtBacrZ.js.map → agents-CqeRO052.js.map} +1 -1
  119. package/dashboard/dist/assets/{bots-FjzeqLzA.js → bots-yo56kQZI.js} +2 -2
  120. package/dashboard/dist/assets/{bots-FjzeqLzA.js.map → bots-yo56kQZI.js.map} +1 -1
  121. package/dashboard/dist/assets/{capabilities-CB0y1ZCx.js → capabilities-C-LyQnOQ.js} +2 -2
  122. package/dashboard/dist/assets/{capabilities-CB0y1ZCx.js.map → capabilities-C-LyQnOQ.js.map} +1 -1
  123. package/dashboard/dist/assets/{controlplane-ZJtfQopv.js → controlplane-cpRK9tBf.js} +2 -2
  124. package/dashboard/dist/assets/{controlplane-ZJtfQopv.js.map → controlplane-cpRK9tBf.js.map} +1 -1
  125. package/dashboard/dist/assets/escalation-columns-CSG3LG3F.js +2 -0
  126. package/dashboard/dist/assets/escalation-columns-CSG3LG3F.js.map +1 -0
  127. package/dashboard/dist/assets/{index-Bho1kYrO.js → index-B9YOp7_Z.js} +2 -2
  128. package/dashboard/dist/assets/{index-Bho1kYrO.js.map → index-B9YOp7_Z.js.map} +1 -1
  129. package/dashboard/dist/assets/index-BJwHI2aX.js +63 -0
  130. package/dashboard/dist/assets/index-BJwHI2aX.js.map +1 -0
  131. package/dashboard/dist/assets/{index-DlrsXckY.js → index-C15QKc-V.js} +2 -2
  132. package/dashboard/dist/assets/{index-DlrsXckY.js.map → index-C15QKc-V.js.map} +1 -1
  133. package/dashboard/dist/assets/{index-D4z4fzW5.js → index-CvyZWk2N.js} +2 -2
  134. package/dashboard/dist/assets/{index-D4z4fzW5.js.map → index-CvyZWk2N.js.map} +1 -1
  135. package/dashboard/dist/assets/{index-GRckVBX1.js → index-D3_Kc337.js} +2 -2
  136. package/dashboard/dist/assets/{index-GRckVBX1.js.map → index-D3_Kc337.js.map} +1 -1
  137. package/dashboard/dist/assets/{index-BH0BQHF-.js → index-D9GgDI2q.js} +2 -2
  138. package/dashboard/dist/assets/{index-BH0BQHF-.js.map → index-D9GgDI2q.js.map} +1 -1
  139. package/dashboard/dist/assets/index-D9I9XhrD.js +5 -0
  140. package/dashboard/dist/assets/index-D9I9XhrD.js.map +1 -0
  141. package/dashboard/dist/assets/{index-DiCp9bmR.js → index-DNKzmRA3.js} +2 -2
  142. package/dashboard/dist/assets/{index-DiCp9bmR.js.map → index-DNKzmRA3.js.map} +1 -1
  143. package/dashboard/dist/assets/{index-iEn58vjL.js → index-DQgRu4cd.js} +2 -2
  144. package/dashboard/dist/assets/{index-iEn58vjL.js.map → index-DQgRu4cd.js.map} +1 -1
  145. package/dashboard/dist/assets/{index-B_pZXTTp.js → index-D_FpjN49.js} +2 -2
  146. package/dashboard/dist/assets/{index-B_pZXTTp.js.map → index-D_FpjN49.js.map} +1 -1
  147. package/dashboard/dist/assets/{index-DzIB5CaR.js → index-DpYsAAsj.js} +2 -2
  148. package/dashboard/dist/assets/{index-DzIB5CaR.js.map → index-DpYsAAsj.js.map} +1 -1
  149. package/dashboard/dist/assets/{index-CzYOxahh.js → index-JMRKuqah.js} +2 -2
  150. package/dashboard/dist/assets/{index-CzYOxahh.js.map → index-JMRKuqah.js.map} +1 -1
  151. package/dashboard/dist/assets/{index-AUrwksY_.js → index-d8dDpRIs.js} +2 -2
  152. package/dashboard/dist/assets/{index-AUrwksY_.js.map → index-d8dDpRIs.js.map} +1 -1
  153. package/dashboard/dist/assets/index-waKF7bKZ.css +1 -0
  154. package/dashboard/dist/assets/{knowledge-Bw51BCX9.js → knowledge-DSTPZRsM.js} +2 -2
  155. package/dashboard/dist/assets/{knowledge-Bw51BCX9.js.map → knowledge-DSTPZRsM.js.map} +1 -1
  156. package/dashboard/dist/assets/{mcp-D4KRVy2a.js → mcp-DPzcauBf.js} +2 -2
  157. package/dashboard/dist/assets/{mcp-D4KRVy2a.js.map → mcp-DPzcauBf.js.map} +1 -1
  158. package/dashboard/dist/assets/{mcp-query-0Zo3GwTv.js → mcp-query-CYLlRjwY.js} +2 -2
  159. package/dashboard/dist/assets/{mcp-query-0Zo3GwTv.js.map → mcp-query-CYLlRjwY.js.map} +1 -1
  160. package/dashboard/dist/assets/{pipelines-B8sOpeCD.js → pipelines-BtfaUf7f.js} +2 -2
  161. package/dashboard/dist/assets/{pipelines-B8sOpeCD.js.map → pipelines-BtfaUf7f.js.map} +1 -1
  162. package/dashboard/dist/assets/{roles-Bs6hUrQJ.js → roles-CDi58HW9.js} +2 -2
  163. package/dashboard/dist/assets/{roles-Bs6hUrQJ.js.map → roles-CDi58HW9.js.map} +1 -1
  164. package/dashboard/dist/assets/{tasks-KDV3bflF.js → tasks-bMka9A7P.js} +2 -2
  165. package/dashboard/dist/assets/{tasks-KDV3bflF.js.map → tasks-bMka9A7P.js.map} +1 -1
  166. package/dashboard/dist/assets/{topics-BS_n738l.js → topics-CFcuDwn2.js} +2 -2
  167. package/dashboard/dist/assets/{topics-BS_n738l.js.map → topics-CFcuDwn2.js.map} +1 -1
  168. package/dashboard/dist/assets/{useEventHooks-RbAigCWV.js → useEventHooks-DrtLEQzK.js} +2 -2
  169. package/dashboard/dist/assets/{useEventHooks-RbAigCWV.js.map → useEventHooks-DrtLEQzK.js.map} +1 -1
  170. package/dashboard/dist/assets/{useNamespace-ChDZWKAd.js → useNamespace-BUb0LZ9l.js} +2 -2
  171. package/dashboard/dist/assets/{useNamespace-ChDZWKAd.js.map → useNamespace-BUb0LZ9l.js.map} +1 -1
  172. package/dashboard/dist/assets/{useYamlActivityEvents-6xNaRNAc.js → useYamlActivityEvents-6DPlPdg0.js} +2 -2
  173. package/dashboard/dist/assets/{useYamlActivityEvents-6xNaRNAc.js.map → useYamlActivityEvents-6DPlPdg0.js.map} +1 -1
  174. package/dashboard/dist/assets/{users-BPt2YERY.js → users-FTnxEv_t.js} +2 -2
  175. package/dashboard/dist/assets/{users-BPt2YERY.js.map → users-FTnxEv_t.js.map} +1 -1
  176. package/dashboard/dist/assets/{vendor-icons-BX2Vih4L.js → vendor-icons-DPmIjhZB.js} +129 -124
  177. package/dashboard/dist/assets/vendor-icons-DPmIjhZB.js.map +1 -0
  178. package/dashboard/dist/assets/{workflows-BaSjfNsd.js → workflows-DgeQWLWK.js} +2 -2
  179. package/dashboard/dist/assets/{workflows-BaSjfNsd.js.map → workflows-DgeQWLWK.js.map} +1 -1
  180. package/dashboard/dist/assets/{yaml-workflows-Be3rM5i2.js → yaml-workflows-BjatB1t-.js} +2 -2
  181. package/dashboard/dist/assets/{yaml-workflows-Be3rM5i2.js.map → yaml-workflows-BjatB1t-.js.map} +1 -1
  182. package/dashboard/dist/index.html +3 -3
  183. package/docs/hitl-guide.md +172 -1
  184. package/package.json +1 -1
  185. package/dashboard/dist/assets/AvailableEscalationsPage-DBeBLNWW.js +0 -2
  186. package/dashboard/dist/assets/AvailableEscalationsPage-DBeBLNWW.js.map +0 -1
  187. package/dashboard/dist/assets/StreamMessageDetail-CCez20kE.js +0 -2
  188. package/dashboard/dist/assets/escalation-columns-735GLlEN.js +0 -2
  189. package/dashboard/dist/assets/escalation-columns-735GLlEN.js.map +0 -1
  190. package/dashboard/dist/assets/index-BTrN5iqE.js +0 -5
  191. package/dashboard/dist/assets/index-BTrN5iqE.js.map +0 -1
  192. package/dashboard/dist/assets/index-CsMAT5cs.css +0 -1
  193. package/dashboard/dist/assets/index-DpGeD89g.js +0 -63
  194. package/dashboard/dist/assets/index-DpGeD89g.js.map +0 -1
  195. package/dashboard/dist/assets/vendor-icons-BX2Vih4L.js.map +0 -1
@@ -250,6 +250,10 @@ The full custom vocabulary at a glance — every `x-lt-*` keyword and extension
250
250
  | `accept` | field | File-type filter for the `file-upload` widget (e.g. `".pdf,.png"`) |
251
251
  | `x-lt-bind` | field | Path this field's value occupies in the resolver payload (e.g. `"customer.email"`) |
252
252
  | `x-lt-span` | field | Column span in a `two-column` layout (`2` = full width) |
253
+ | `x-lt-showIf` | field | Show field only when a value exists at `domain.path`; prefix `!` to invert |
254
+ | `x-lt-hide-if-empty` | field | `true` — suppress the field entirely when its value is null, `""`, `false`, or `0` |
255
+ | `x-lt-section` | field | Label to group fields under (e.g. `"Facts"`, `"Station checks"`, `"Action"`) |
256
+ | `x-lt-columns` | schema (list) | Column definitions for `facet-table` layout: `[{ label, value }]` |
253
257
  | `x-lt-order` | schema | Field render sequence |
254
258
  | `x-lt-layout` | schema | `"two-column"` grid layout |
255
259
  | `x-lt-help` | schema | Markdown guidance for the side panel's Help view; `{{domain.path}}` tokens interpolate live record values |
@@ -466,6 +470,145 @@ By default, fields render in JSON key order. Use `x-lt-order` to control sequenc
466
470
  }
467
471
  ```
468
472
 
473
+ ### Conditional Visibility (`x-lt-showIf`)
474
+
475
+ A field can be hidden or shown based on a value present in the escalation record. Use `x-lt-showIf` on any property to make it conditional:
476
+
477
+ ```json
478
+ "x-lt-showIf": "domain.path"
479
+ ```
480
+
481
+ The value at `domain.path` is evaluated for truthiness. If it is present and truthy the field shows; if absent, null, false, or an empty string it is hidden. Prefix `!` to invert: show when the value is absent.
482
+
483
+ Domains follow the same `domain.path` convention as `x-lt-help` tokens:
484
+
485
+ | Domain | Resolves against |
486
+ |--------|-----------------|
487
+ | `metadata` | The row's metadata dict |
488
+ | `payload` | The escalation context payload (`escalation_payload`) |
489
+ | `envelope` | The workflow-sent input envelope |
490
+ | `escalation` | Top-level escalation row fields (`role`, `status`, `priority`, …) |
491
+ | `resolver` | The submitted resolver payload |
492
+
493
+ **Example — item type branching:**
494
+
495
+ A role where the queue receives both regular work items and crew-pill shutdown signals. The payload carries `item_type` to distinguish them.
496
+
497
+ ```json
498
+ {
499
+ "title": "Worker Station",
500
+ "properties": {
501
+ "action_taken": {
502
+ "type": "string",
503
+ "enum": ["completed", "deferred", "escalated"],
504
+ "description": "Outcome for this work item",
505
+ "x-lt-showIf": "!payload.crew_pill"
506
+ },
507
+ "notes": {
508
+ "type": "string",
509
+ "format": "textarea",
510
+ "x-lt-showIf": "!payload.crew_pill"
511
+ },
512
+ "shutdown_ack": {
513
+ "type": "boolean",
514
+ "title": "Acknowledge shutdown",
515
+ "description": "Confirm you are stopping work and clearing the station",
516
+ "x-lt-showIf": "payload.crew_pill"
517
+ }
518
+ }
519
+ }
520
+ ```
521
+
522
+ When `escalation_payload` contains `{ "crew_pill": true }`, only `shutdown_ack` renders. When the payload carries a regular item (no `crew_pill` key), only `action_taken` and `notes` render.
523
+
524
+ `x-lt-showIf` is evaluated against the escalation record and the **live form state** (via the `resolver` domain). Conditions based on `metadata`, `payload`, `envelope`, and `escalation` are static (from the stored row); conditions based on `resolver` react in real time as the user edits the form. Hidden fields are not rendered but their values (if any) remain in form state and are submitted only if they were filled before being hidden.
525
+
526
+ **Example — approval/rejection conditional fields:**
527
+
528
+ The employee sets `approved`. When they uncheck it, `rejection_reason` and `rejection_notes` appear immediately — no page reload, no submit required. The workflow receives the full payload and branches on `approved`:
529
+
530
+ ```json
531
+ {
532
+ "title": "Rejection Review",
533
+ "x-lt-layout": "two-column",
534
+ "x-lt-order": ["order_id", "rejection_type", "approved", "rejection_reason", "rejection_notes"],
535
+ "required": ["approved"],
536
+ "properties": {
537
+ "order_id": { "type": "string", "readOnly": true, "x-lt-section": "The Report" },
538
+ "rejection_type": { "type": "string", "readOnly": true, "x-lt-section": "The Report" },
539
+ "approved": { "type": "boolean", "x-lt-section": "The Verdict" },
540
+ "rejection_reason": {
541
+ "type": "string",
542
+ "enum": ["Quality", "Quantity", "Routing", "Other"],
543
+ "x-lt-showIf": "!resolver.approved",
544
+ "x-lt-section": "The Verdict"
545
+ },
546
+ "rejection_notes": {
547
+ "type": "string",
548
+ "format": "textarea",
549
+ "x-lt-span": 2,
550
+ "x-lt-showIf": "!resolver.approved",
551
+ "x-lt-section": "The Verdict"
552
+ }
553
+ }
554
+ }
555
+ ```
556
+
557
+ In the workflow, branch on `approved` from the resolver payload:
558
+
559
+ ```typescript
560
+ const decision = await conditionLT<{
561
+ approved: boolean;
562
+ rejection_reason?: string;
563
+ rejection_notes?: string;
564
+ }>(signalId, { role: 'quality-reviewer', /* ... */ });
565
+
566
+ if (!decision.approved) {
567
+ await sendForRework({ reason: decision.rejection_reason, notes: decision.rejection_notes });
568
+ } else {
569
+ await advanceOrder();
570
+ }
571
+ ```
572
+
573
+ ### Suppressing Empty Fields (`x-lt-hide-if-empty`)
574
+
575
+ A field with `"x-lt-hide-if-empty": true` is hidden when its value is null, an empty string, `false`, or `0`. This is primarily useful for `readOnly` fact fields that are only present on some records:
576
+
577
+ ```json
578
+ {
579
+ "properties": {
580
+ "heel_raise": {
581
+ "type": "string",
582
+ "readOnly": true,
583
+ "x-lt-hide-if-empty": true,
584
+ "description": "Heel raise specification — hidden when not present on this order"
585
+ }
586
+ }
587
+ }
588
+ ```
589
+
590
+ The field remains in form state and is included in the submitted payload if it has a value. Only the visual row is suppressed.
591
+
592
+ ### Section Headers (`x-lt-section`)
593
+
594
+ Group related fields under a labeled section by adding `"x-lt-section": "Label"` to each property. Fields that share the same consecutive section name are collected into one group with a header:
595
+
596
+ ```json
597
+ {
598
+ "x-lt-layout": "two-column",
599
+ "x-lt-order": ["patient_id", "heel_cup", "pdac", "approved", "notes"],
600
+ "properties": {
601
+ "patient_id": { "type": "string", "readOnly": true, "x-lt-section": "Facts", "x-lt-hide-if-empty": true },
602
+ "heel_cup": { "type": "string", "readOnly": true, "x-lt-section": "Facts", "x-lt-hide-if-empty": true },
603
+ "pdac": { "type": "boolean", "readOnly": true, "x-lt-section": "Facts", "x-lt-hide-if-empty": true },
604
+ "approved": { "type": "string", "enum": ["yes", "no"], "x-lt-section": "Action" },
605
+ "notes": { "type": "string", "format": "textarea", "x-lt-span": 2, "x-lt-section": "Action" }
606
+ }
607
+ }
608
+ ```
609
+
610
+ Sections are ordered by the first field that carries the section name (respects `x-lt-order`). A field without `x-lt-section` belongs to an unnamed group rendered without a header. Named sections render with a left accent line that spans the full section height, a small icon, and the label in uppercase — spatially grouping the header and its fields without a card or border box.
611
+
469
612
  ### Validation (`required`)
470
613
 
471
614
  Fields listed in `required` show a red asterisk and block submission when empty:
@@ -677,10 +820,11 @@ evaluated against each row); `body` strings render through the markdown renderer
677
820
 
678
821
  | Key | Level | Purpose |
679
822
  |-----|-------|---------|
680
- | `x-lt-layout` | schema | `"active-history"` (two columns), `"active"` (card only), or `"table"` (fallback) |
823
+ | `x-lt-layout` | schema | `"active-history"` (two columns), `"active"` (card only), `"facet-table"` (multi-row queue), or `"table"` (fallback) |
681
824
  | `x-lt-help` | schema | Optional markdown header, interpolated with the active row |
682
825
  | `x-lt-active` | schema | The live item card: `{ title, subtitle?, body?, fields?: [{label, value}] }` |
683
826
  | `x-lt-history` | schema | History column: `{ row: { title, subtitle?, meta? }, limit?, status? }` |
827
+ | `x-lt-columns` | schema | Column definitions for `facet-table` layout: `[{ label: string, value: string }]` — `value` is a `{{domain.path}}` token |
684
828
 
685
829
  The **active** item is the first non-terminal escalation. The **history** column is not
686
830
  auto-loaded — a "Load full history" link fetches resolved items on demand (`status`
@@ -714,6 +858,33 @@ The working reference is `examples/workflows/policy-document/` (role seeded by
714
858
  escalation, parks on it, and folds each resolution into the next revision — so the
715
859
  policy facts ride the row's metadata and the list view reads them with `{{metadata.*}}`.
716
860
 
861
+ ### `facet-table` layout — queue as a column table
862
+
863
+ Use `"x-lt-layout": "facet-table"` when the queue contains many concurrent rows and the
864
+ role's context is best expressed as a scannable table — a print farm, order queue, or
865
+ batch-processing pond. Every pending escalation is a row; columns are defined by
866
+ `x-lt-columns`.
867
+
868
+ ```json
869
+ {
870
+ "x-lt-layout": "facet-table",
871
+ "x-lt-columns": [
872
+ { "label": "Patient", "value": "{{metadata.patientId}}" },
873
+ { "label": "Heel cup", "value": "{{metadata.heelCup}}" },
874
+ { "label": "PDAC", "value": "{{metadata.pdac}}" },
875
+ { "label": "Station", "value": "{{metadata.station}}" },
876
+ { "label": "Priority", "value": "{{escalation.priority}}" },
877
+ { "label": "Created", "value": "{{escalation.created_at}}" }
878
+ ]
879
+ }
880
+ ```
881
+
882
+ A status dot precedes the first column automatically. ISO datetime values
883
+ (`{{escalation.created_at}}`, `{{escalation.resolved_at}}`, etc.) render as a
884
+ readable relative date with a full-timestamp tooltip. Missing/unresolvable token values
885
+ render as an em dash. Clicking any row navigates to the detail page. `x-lt-help` and
886
+ `x-lt-active` are ignored in this layout.
887
+
717
888
  ---
718
889
 
719
890
  ## Role-Based Routing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/long-tail",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "Long Tail Workflows — Durable AI workflows with human-in-the-loop escalation. Powered by PostgreSQL.",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,2 +0,0 @@
1
- import{j as e,a as y}from"./vendor-query-B2UbickB.js";import{c as jt,f as vt,a as Nt}from"./vendor-react-CXumBFUA.js";import{M as ce,j as He,b as qe,u as Ct,k as kt,l as St,m as wt,n as Pt,g as Mt,o as At,p as Tt,q as Et,r as Ot,s as _t,t as Bt,v as $t,w as Ft}from"./index-DpGeD89g.js";import{f as Lt}from"./useEventHooks-RbAigCWV.js";import{i as F,u as xe,C as Ge,a as Dt}from"./CustomDurationPicker-xNJMIvjL.js";import{u as zt,a as Rt}from"./roles-Bs6hUrQJ.js";import{a as It}from"./StatusBadge-CEQMRmSQ.js";import{i as Ut}from"./CountdownTimer-Gbp6RHav.js";import{a4 as Ht,n as qt,o as Gt,a5 as Jt,a6 as Vt,j as Qt,i as Kt,a7 as Wt,a8 as Xt,a9 as Yt,aa as Zt,ab as _e,ac as es,S as ts,X as Be}from"./vendor-icons-BX2Vih4L.js";import{u as ss}from"./useFilterParams-x-Dg0Vgz.js";import{u as Je}from"./useDebouncedValue-BA5S7V54.js";import{b as as}from"./api-path-u2Jf9QXS.js";import{D as ns}from"./DataTable-Byn3oyT9.js";import{S as ls}from"./StickyPagination-BwXLmDc-.js";import{P as rs}from"./PageHeader-Ji1AtA4f.js";import{P as is}from"./constants-BHkpVaqx.js";import{M as ue}from"./Modal-CSrxpXeM.js";import{u as os}from"./users-BPt2YERY.js";import{m as cs,E as ds}from"./escalation-columns-735GLlEN.js";import{R as xs,a as us}from"./RowActions-BA9L9djf.js";import{L as ms}from"./ListToolbar-BhXp7clK.js";import"./EmptyState-BcsfPq9T.js";import"./FilterBar-DDIn8TOs.js";import"./PriorityBadge-B4ykBH7f.js";import"./RolePill-ColM_ynA.js";import"./WorkflowPill-BXmmLR0t.js";const U=t=>{if(t)try{return JSON.parse(t)}catch{return}},D=t=>t==null||Array.isArray(t)&&t.length===0||typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0;function hs(t){const s={},r=U(t.get("facets"));D(r)||(s.facets=r);const a=U(t.get("block"));D(a)||(s.block=a);const p=U(t.get("range"));D(p)||(s.range=p);const x=U(t.get("exists"));D(x)||(s.exists=x);const c=U(t.get("roles"));D(c)||(s.roles=c);const u=U(t.get("orderBy"));return D(u)||(s.orderBy=u),t.get("available")!=null&&(s.available=t.get("available")==="true"),s}function ps(t,s){const r=(a,p)=>D(p)?t.delete(a):t.set(a,JSON.stringify(p));r("facets",s.facets),r("block",s.block),r("range",s.range),r("exists",s.exists),r("roles",s.roles),r("orderBy",s.orderBy),s.available==null?t.delete("available"):t.set("available",String(s.available))}function fs(t){var s,r,a,p;return Object.keys(t.facets??{}).length+(((s=t.block)==null?void 0:s.length)??0)+(((r=t.range)==null?void 0:r.length)??0)+(((a=t.exists)==null?void 0:a.length)??0)+(((p=t.orderBy)==null?void 0:p.length)??0)+(t.available!=null?1:0)}const gs=["<","<=",">",">=","="],bs=["priority","created_at","updated_at","status","role"],$="h-7 rounded border border-surface-border bg-surface px-2 text-xs text-text-primary focus:border-accent focus:outline-none",Z="text-text-tertiary hover:text-text-primary transition-colors";function $e(t){return t==="true"?!0:t==="false"?!1:t.trim()!==""&&!Number.isNaN(Number(t))?Number(t):t}const ys=t=>Object.entries(t??{}).map(([s,r])=>({key:s,value:String(r)})),js=t=>(t??[]).map(s=>{const[r,a]=Object.entries(s)[0]??["",""];return{key:r,value:String(a)}});function H({title:t,hint:s,children:r}){return e.jsxs("div",{className:"border-t border-surface-border/50 py-3 first:border-t-0 first:pt-1",children:[e.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-text-tertiary",children:t}),s&&e.jsx("span",{className:"text-[10px] font-mono text-text-tertiary/70",children:s})]}),r]})}function ee({value:t,onChange:s,placeholder:r}){return e.jsx("input",{list:"lt-facet-keys",className:`${$} w-40`,placeholder:r,value:t,onChange:a=>s(a.target.value)})}function vs({value:t,onChange:s,facetKeys:r=[],search:a="",onSearchChange:p}){const x=ys(t.facets),c=js(t.block),u=t.range??[],l=t.exists??[],j=t.orderBy??[],f=n=>{const m={};for(const d of n)d.key&&(m[d.key]=$e(d.value));s({...t,facets:Object.keys(m).length?m:void 0})},g=n=>{const m=n.filter(d=>d.key).map(d=>({[d.key]:$e(d.value)}));s({...t,block:m.length?m:void 0})},v=n=>s({...t,range:n.length?n:void 0}),M=n=>s({...t,exists:n.length?n:void 0}),k=n=>s({...t,orderBy:n.length?n:void 0});return e.jsxs("div",{className:"text-xs",children:[e.jsx("datalist",{id:"lt-facet-keys",children:r.map(n=>e.jsx("option",{value:n},n))}),e.jsxs("datalist",{id:"lt-sort-fields",children:[bs.map(n=>e.jsx("option",{value:n},n)),r.map(n=>e.jsx("option",{value:`metadata.${n}`},n))]}),p&&e.jsx(H,{title:"Match id",hint:"id · workflow · origin",children:e.jsx("input",{className:`${$} w-full`,placeholder:"Exact escalation, workflow, or origin id…",value:a,onChange:n=>p(n.target.value)})}),e.jsx(H,{title:"Has facet",hint:"metadata @>",children:[...x,{key:"",value:""}].map((n,m)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.key,placeholder:"key",onChange:d=>{const h=[...x];h[m]={...n,key:d},f(h)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${$} w-40`,placeholder:"value",value:n.value,onChange:d=>{const h=[...x];h[m]={...n,value:d.target.value},f(h)}}),m<x.length&&e.jsx("button",{className:Z,onClick:()=>f(x.filter((d,h)=>h!==m)),children:"×"})]},m))}),e.jsx(H,{title:"Range",hint:"numeric",children:[...u,{facet:"",op:"<=",value:0}].map((n,m)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.facet,placeholder:"numeric facet",onChange:d=>{const h=[...u];h[m]={...n,facet:d},v(h.filter(S=>S.facet))}}),e.jsx("select",{className:$,value:n.op,onChange:d=>{const h=[...u];h[m]={...n,op:d.target.value},v(h.filter(S=>S.facet))},children:gs.map(d=>e.jsx("option",{value:d,children:d},d))}),e.jsx("input",{type:"number",className:`${$} w-24`,value:n.value,onChange:d=>{const h=[...u];h[m]={...n,value:Number(d.target.value)},v(h.filter(S=>S.facet))}}),m<u.length&&e.jsx("button",{className:Z,onClick:()=>v(u.filter((d,h)=>h!==m)),children:"×"})]},m))}),e.jsx(H,{title:"Has key",hint:"metadata ? key",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[l.map(n=>e.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent/15 px-1.5 py-0.5 text-accent",children:[n,e.jsx("button",{className:"text-accent/70 hover:text-accent",onClick:()=>M(l.filter(m=>m!==n)),children:"×"})]},n)),e.jsx(ee,{value:"",placeholder:"+ key",onChange:n=>{n&&!l.includes(n)&&M([...l,n])}})]})}),e.jsx(H,{title:"Exclude",hint:"NOT @>",children:[...c,{key:"",value:""}].map((n,m)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.key,placeholder:"key",onChange:d=>{const h=[...c];h[m]={...n,key:d},g(h)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${$} w-40`,placeholder:"value",value:n.value,onChange:d=>{const h=[...c];h[m]={...n,value:d.target.value},g(h)}}),m<c.length&&e.jsx("button",{className:Z,onClick:()=>g(c.filter((d,h)=>h!==m)),children:"×"})]},m))}),e.jsx(H,{title:"Sort by",children:[...j,{field:"",direction:"asc"}].map((n,m)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx("input",{list:"lt-sort-fields",className:`${$} w-44`,placeholder:"column or metadata.key",value:n.field,onChange:d=>{const h=[...j];h[m]={...n,field:d.target.value},k(h.filter(S=>S.field))}}),e.jsxs("select",{className:$,value:n.direction??"asc",onChange:d=>{const h=[...j];h[m]={...n,direction:d.target.value},k(h.filter(S=>S.field))},children:[e.jsx("option",{value:"asc",children:"asc"}),e.jsx("option",{value:"desc",children:"desc"})]}),e.jsxs("label",{className:"flex items-center gap-1 text-text-tertiary",children:[e.jsx("input",{type:"checkbox",checked:!!n.numeric,onChange:d=>{const h=[...j];h[m]={...n,numeric:d.target.checked},k(h.filter(S=>S.field))}}),"num"]}),m<j.length&&e.jsx("button",{className:Z,onClick:()=>k(j.filter((d,h)=>h!==m)),children:"×"})]},m))})]})}function me(t){const s=r=>{if(!r)return null;try{const a=JSON.parse(r);return a&&typeof a=="object"?a:null}catch{return null}};return{escalation:t,metadata:t.metadata??null,envelope:s(t.envelope),payload:s(t.escalation_payload),resolver:s(t.resolver_payload)}}const Ns=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,Fe="—";function Cs({raw:t}){return!t||t===Fe?e.jsx("span",{className:"text-text-quaternary",children:Fe}):Ns.test(t)?e.jsx(qe,{date:t,format:"datetime",className:"text-text-primary"}):e.jsx(e.Fragment,{children:t})}function ks({esc:t,card:s,onOpen:r}){const a=me(t),p=s.title?F(s.title,a):t.type,x=t.status==="pending"&&!Ut(t);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-start justify-between gap-6",children:[e.jsxs("button",{onClick:r,className:"text-left group min-w-0",children:[e.jsx("h3",{className:"text-2xl font-light text-text-primary group-hover:text-accent transition-colors leading-tight",children:p}),s.subtitle&&e.jsx("p",{className:"text-xs text-text-tertiary mt-1.5",children:F(s.subtitle,a)})]}),x&&e.jsxs("button",{onClick:r,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md bg-accent text-text-inverse text-xs font-medium hover:bg-accent-hover transition-colors shrink-0",children:["Claim",e.jsx(Ht,{className:"w-3.5 h-3.5"})]})]}),s.fields&&s.fields.length>0&&e.jsx("dl",{className:"flex flex-wrap gap-x-10 gap-y-4 mt-6",children:s.fields.map((c,u)=>e.jsxs("div",{children:[e.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:c.label}),e.jsx("dd",{className:"text-xs text-text-primary mt-1",children:e.jsx(Cs,{raw:F(c.value,a)})})]},u))}),s.body&&e.jsx("div",{className:"mt-7 pt-6 border-t border-surface-border/50",children:e.jsx(ce,{content:F(s.body,a)})})]})}function Ss({role:t,def:s,onRowClick:r}){var j,f;const[a,p]=y.useState(!1),x=He({role:t,status:s.status??"resolved",sort_by:"resolved_at",order:"desc",limit:s.limit??25,enabled:a}),c=((j=x.data)==null?void 0:j.escalations)??[],u=((f=x.data)==null?void 0:f.total)??0,l=s.row??{};return a?x.isLoading?e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"Loading history…"}):c.length===0?e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No past revisions."}):e.jsxs("div",{children:[e.jsx("div",{className:"divide-y divide-surface-border/40",children:c.map(g=>{const v=me(g);return e.jsxs("button",{onClick:()=>r==null?void 0:r(g),className:"w-full text-left py-2.5 group flex items-center gap-3",children:[e.jsx("span",{className:`w-1.5 h-1.5 shrink-0 rounded-full dot-ring ${It[g.status]??"bg-status-pending"}`,title:g.status}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-xs text-text-primary group-hover:text-accent transition-colors truncate",children:l.title?F(l.title,v):g.type}),l.subtitle&&e.jsx("span",{className:"block text-[10px] text-text-tertiary truncate",children:F(l.subtitle,v)})]}),l.meta?e.jsx("span",{className:"text-[10px] text-text-tertiary shrink-0",children:F(l.meta,v)}):g.resolved_at&&e.jsx(qe,{date:g.resolved_at,format:"relative",className:"text-[10px] text-text-tertiary shrink-0 whitespace-nowrap"})]},g.id)})}),u>c.length&&e.jsxs("p",{className:"text-[10px] text-text-quaternary mt-3",children:["Showing ",c.length," of ",u,"."]})]}):e.jsx("button",{onClick:()=>p(!0),className:"text-xs text-accent hover:underline","data-testid":"load-history",children:"Load full history →"})}function Le({children:t}){return e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-3",children:t})}function ws({role:t,listSchema:s,activeEscalations:r,onRowClick:a}){const p=s["x-lt-layout"],x=s["x-lt-active"]??{},c=r[0],u=s["x-lt-help"],l=c?e.jsx(ks,{esc:c,card:x,onOpen:()=>a==null?void 0:a(c)}):e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No active item right now."}),j=u&&c?e.jsx("div",{className:"mb-8",children:e.jsx(ce,{content:F(u,me(c))})}):u?e.jsx("div",{className:"mb-8",children:e.jsx(ce,{content:u})}):null;return p==="active-history"?e.jsxs("div",{children:[j,e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1.6fr_1fr] gap-12 items-start",children:[e.jsxs("div",{children:[e.jsx(Le,{children:"Active"}),l]}),e.jsxs("div",{children:[e.jsx(Le,{children:"History"}),e.jsx(Ss,{role:t,def:s["x-lt-history"]??{},onRowClick:a})]})]})]}):e.jsxs("div",{children:[j,l]})}const Ps=t=>t.isPriorityPending||t.isClaimPending||t.isAssignPending||t.isEscalatePending||t.isTriagePending||t.isCancelPending,de="inline-flex items-center h-7 px-2.5 text-[11px] font-medium text-text-secondary bg-surface border border-surface-border rounded-[4px] hover:border-accent/50 hover:text-text-primary transition-colors disabled:opacity-50 disabled:hover:border-surface-border",oe=`${de} appearance-none cursor-pointer`,Ms="inline-flex items-center h-7 px-2.5 text-[11px] font-medium text-status-error bg-surface border border-status-error/30 rounded-[4px] hover:border-status-error hover:bg-status-error/5 transition-colors disabled:opacity-50";function As(t){var u;const s=Ps(t),r=xe(),{data:a}=Ct(),p=kt(),x=p!==null?p:((u=a==null?void 0:a.ai)==null?void 0:u.enabled)===!0,c=t.selectedCount>0;return e.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${c?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0 pointer-events-none"}`,children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-2.5 pl-3 pr-2 mt-4 mb-3 bg-surface-sunken/60 border-l-2 border-l-accent",children:[e.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-accent tabular-nums",children:[t.selectedCount," selected"]}),e.jsx("div",{className:"mx-1 h-4 w-px bg-surface-border"}),e.jsxs("select",{onChange:l=>{l.target.value&&(t.onSetPriority(parseInt(l.target.value)),l.target.value="")},disabled:s,className:oe,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Priority…"}),is.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))]}),e.jsxs("select",{onChange:l=>{l.target.value&&(t.onClaim(parseInt(l.target.value)),l.target.value="")},disabled:s,className:oe,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Claim for…"}),r.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))]}),e.jsx("button",{onClick:t.onAssign,disabled:s,className:de,children:t.isAssignPending?"Assigning…":"Assign to…"}),t.availableRoles.length>0&&e.jsxs("select",{onChange:l=>{l.target.value&&(t.onEscalate(l.target.value),l.target.value="")},disabled:s,className:oe,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Escalate to…"}),t.availableRoles.map(l=>e.jsx("option",{value:l,children:l},l))]}),x&&e.jsx("button",{onClick:t.onTriage,disabled:s,className:de,children:t.isTriagePending?"Triaging…":"Triage"}),e.jsx("button",{onClick:t.onCancel,disabled:s,className:Ms,children:t.isCancelPending?"Cancelling…":"Cancel"}),e.jsx("div",{className:"flex-1"}),s&&e.jsx("span",{className:"text-[11px] text-text-tertiary animate-pulse",children:"Processing…"}),e.jsx("button",{onClick:t.onClearSelection,className:"px-1 text-[11px] font-medium text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"})]})})})}function Ts({open:t,onClose:s,selectedCount:r,selectedRoles:a,onSubmit:p,isPending:x}){const{isSuperAdmin:c}=St(),u=xe(),[l,j]=y.useState("user"),[f,g]=y.useState(null),[v,M]=y.useState(""),[k,n]=y.useState("30"),[m,d]=y.useState(0),h=y.useCallback(b=>d(b),[]),S=!c&&a.length===1?a[0]:void 0,L=Je(v,250),{data:i,isLoading:N}=os({role:S,status:"active",search:L.trim()||void 0,limit:200}),w=(i==null?void 0:i.users)??[],P=()=>{j("user"),g(null),M(""),n("30"),d(0),s()},O=b=>{g(b),j("duration")},A=()=>{j("user")},T=()=>{if(!f)return;const b=k==="custom"?m:parseInt(k);!b||b<=0||p(f.id,b)};return e.jsx(ue,{open:t,onClose:P,title:"Assign Escalations",children:e.jsxs("div",{className:"space-y-4",children:[l==="user"&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Select a user to assign"," ",e.jsx("span",{className:"font-medium text-text-primary",children:r})," ","escalation(s) to:"]}),e.jsx("input",{type:"text",value:v,onChange:b=>M(b.target.value),placeholder:"Search by name or email...",className:"input text-xs w-full",autoFocus:!0}),e.jsxs("div",{className:"max-h-60 overflow-y-auto border border-surface-border rounded-lg divide-y divide-surface-border",children:[N&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"Loading users..."}),!N&&w.length===0&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"No users found"}),w.map(b=>e.jsxs("button",{onClick:()=>O(b),className:"w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors",children:[e.jsx("p",{className:"text-xs font-medium text-text-primary",children:b.display_name||b.external_id}),b.email&&e.jsx("p",{className:"text-[10px] text-text-tertiary",children:b.email})]},b.id))]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{onClick:P,className:"btn-secondary text-xs",children:"Cancel"})})]}),l==="duration"&&f&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Assign to"," ",e.jsx("span",{className:"font-medium text-text-primary",children:f.display_name||f.external_id})," ","for:"]}),e.jsxs("select",{value:k,onChange:b=>{n(b.target.value),d(0)},className:"select w-full text-sm",children:[u.map(b=>e.jsx("option",{value:b.value,children:b.label},b.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),k==="custom"&&e.jsx(Ge,{onChange:h,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:A,className:"btn-secondary text-xs",children:"Back"}),e.jsx("button",{onClick:T,disabled:x,className:"btn-primary text-xs",children:x?"Assigning...":"Assign"})]})]})]})})}function Es({open:t,onClose:s,selectedCount:r,onSubmit:a,isPending:p}){const[x,c]=y.useState(""),u=()=>{a(x||void 0)};return e.jsx(ue,{open:t,onClose:s,title:"Submit for AI Triage",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Submit ",e.jsx("span",{className:"font-medium text-text-primary",children:r})," escalation(s) for AI triage? The triage orchestrator will take over resolution."]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium text-text-secondary block mb-1",children:["Triage hint ",e.jsx("span",{className:"text-text-tertiary",children:"(optional)"})]}),e.jsx("input",{type:"text",value:x,onChange:l=>c(l.target.value),placeholder:"e.g., image_orientation",className:"input text-xs font-mono w-full"}),e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1",children:"Guides the triage workflow on what remediation to apply"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:s,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:u,disabled:p,className:"btn-primary text-xs",children:p?"Submitting...":"Submit for Triage"})]})]})})}function q(t,s,r){return a=>{t.mutate(a,{onSuccess:()=>{s(),r==null||r()}})}}function Os(t){const s=()=>[...t.selectedIds];return{handleSetPriority:l=>{q(t.setPriority,t.clearSelection)({ids:s(),priority:l})},handleBulkClaim:l=>{q(t.bulkClaim,t.clearSelection)({ids:s(),durationMinutes:l})},handleBulkEscalate:l=>{q(t.bulkEscalate,t.clearSelection)({ids:s(),targetRole:l})},handleBulkTriage:l=>{q(t.bulkTriage,t.clearSelection,t.closeTriageModal)({ids:s(),hint:l})},handleBulkAssign:(l,j)=>{q(t.bulkAssign,t.clearSelection,t.closeAssignModal)({ids:s(),targetUserId:l,durationMinutes:j})},handleBulkCancel:()=>{q(t.bulkCancel,t.clearSelection,t.closeCancelModal)({ids:s()})}}}function _s({claimTarget:t,onClose:s,claimDuration:r,onDurationChange:a,claimDurations:p,onCustomClaimChange:x,onClaim:c,isPending:u}){return e.jsx(ue,{open:!!t,onClose:s,title:"Claim Escalation",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claim ",e.jsx("span",{className:"font-medium text-text-primary",children:t==null?void 0:t.type})," for:"]}),e.jsxs("select",{value:r,onChange:l=>{a(l.target.value)},className:"select w-full text-sm",children:[p.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),r==="custom"&&e.jsx(Ge,{onChange:x,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:s,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:c,className:"btn-primary text-xs",disabled:u,children:u?"Claiming...":"Claim"})]})]})})}const G={pending:"#0ea5e9",claimed:"#f97316",resolved:"#16a34a",cancelled:"#94a3b8",expired:"#64748b"},De=40,Bs=64,$s=24,ze=3;function Ve(t){return t<6e4?`${Math.round(t/1e3)}s`:t<36e5?`${Math.round(t/6e4)}m`:t<864e5?`${(t/36e5).toFixed(1)}h`:`${(t/864e5).toFixed(1)}d`}function Re(t){const s=Date.now()-t;return s<6e4?"just now":s<36e5?`${Math.round(s/6e4)}m ago`:s<864e5?`${Math.round(s/36e5)}h ago`:`${Math.round(s/864e5)}d ago`}function Ie(t){return t.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function Fs(t,s){return t?[...s.filter(a=>a in t),...Object.keys(t).filter(a=>!s.includes(a))].map(a=>[a,t[a]]):[]}function Ls({e:t}){const s=t.endMs-t.startMs;if(s<=0)return null;const r=G.pending,a=G.claimed,p=t.status==="cancelled"||t.status==="expired"?G.cancelled:G.resolved;let x=100,c=0,u=0;return t.claimedMs!==null?(x=Math.max(0,Math.min(100,(t.claimedMs-t.startMs)/s*100)),t.isOpen?c=100-x:(c=Math.max(0,Math.min(100-x,(t.endMs-t.claimedMs)/s*100)),u=Math.max(0,100-x-c))):t.isOpen||(u=100,x=0),e.jsxs("div",{className:"mt-2 h-0.5 rounded-full overflow-hidden flex bg-slate-100",children:[x>0&&e.jsx("div",{style:{width:`${x}%`,backgroundColor:r,opacity:.6}}),c>0&&e.jsx("div",{style:{width:`${c}%`,backgroundColor:a,opacity:.6}}),u>0&&e.jsx("div",{style:{width:`${u}%`,backgroundColor:p,opacity:.6}})]})}function Ds({gapMs:t,heightPx:s}){return e.jsx("div",{className:"relative flex items-center justify-center",style:{height:s},children:t>=6e4&&e.jsx("span",{className:"text-[9px] text-slate-300 font-mono bg-white px-2 relative z-10",children:Ve(t)})})}function Ue({e:t,highlightKeys:s,onRowClick:r,onMetaFacet:a}){const[p,x]=y.useState(!1),c=G[t.displayStatus]??"#94a3b8",u=Fs(t.metadata,s),l=p?u:u.slice(0,ze),j=u.length-ze;return e.jsxs("div",{className:"cursor-pointer max-w-[460px] min-w-[260px] w-full bg-white rounded-lg shadow-sm border border-slate-200/60 px-3.5 pt-2.5 pb-2 hover:shadow-md hover:border-slate-300/60 transition-all duration-150",style:{borderTopWidth:"3px",borderTopColor:c},onClick:()=>r==null?void 0:r(t),children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-widest text-slate-400 shrink-0",children:Ie(t.role)}),e.jsxs("span",{className:"text-[12px] font-semibold text-slate-800 truncate",title:t.type,children:[t.type,t.subtype&&t.subtype!==t.type&&t.subtype!==""&&e.jsxs("span",{className:"font-normal text-slate-500",children:[" · ",t.subtype]})]})]}),l.length>0&&e.jsxs("div",{className:"border-t border-slate-100 pt-1 space-y-px",children:[l.map(([f,g])=>{const v=String(g),M=s.includes(f);return e.jsxs("div",{className:"group/row flex items-center gap-1.5 -mx-1 px-1 py-[2px] rounded",children:[e.jsx("span",{className:`shrink-0 w-[60px] text-[9px] font-mono uppercase tracking-wide truncate ${M?"text-accent":"text-slate-400"}`,title:f,children:f}),e.jsx("span",{className:`flex-1 min-w-0 text-[11px] font-medium truncate ${M?"text-slate-800":"text-slate-600"}`,title:v,children:v}),e.jsxs("span",{className:"flex items-center gap-px shrink-0 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[e.jsx("button",{className:"p-0.5 rounded text-slate-300 hover:text-accent transition-colors",title:`Filter ${Ie(t.role)}: ${f} = ${v}`,onClick:k=>{k.stopPropagation(),a==null||a(f,v,k.shiftKey,t.role)},children:e.jsx(Jt,{className:"w-2.5 h-2.5"})}),e.jsx("button",{className:"p-0.5 rounded text-slate-300 hover:text-accent transition-colors",title:`Search all: ${f} = ${v}`,onClick:k=>{k.stopPropagation(),a==null||a(f,v,k.shiftKey,null)},children:e.jsx(Vt,{className:"w-2.5 h-2.5"})})]})]},f)}),j>0&&e.jsx("button",{className:"flex items-center gap-0.5 text-[9px] text-slate-400 hover:text-accent transition-colors mt-0.5 -mx-1 px-1 py-px",onClick:f=>{f.stopPropagation(),x(g=>!g)},children:p?e.jsxs(e.Fragment,{children:[e.jsx(Qt,{className:"w-2.5 h-2.5"})," less"]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{className:"w-2.5 h-2.5"})," ",j," more"]})})]}),e.jsx(Ls,{e:t})]})}function zs({escalations:t,highlightKeys:s=[],onRowClick:r,onMetaFacet:a,total:p,page:x,totalPages:c,onPageChange:u,sortAsc:l=!1}){var S,L;const j=Date.now(),f=t.map(i=>{const N=new Date(i.created_at).getTime(),w=i.resolved_at?new Date(i.resolved_at).getTime():null,P=i.claimed_at?new Date(i.claimed_at).getTime():null,O=!w&&i.status!=="cancelled"&&i.status!=="expired",A=w??(O?j:N+3e4),T=i.status==="pending"&&P!==null?"claimed":i.status;return{...i,startMs:N,claimedMs:P,endMs:A,isOpen:O,displayStatus:T}}),g=l?[...f].reverse():f;if(g.length===0)return e.jsx("p",{className:"mt-12 text-center text-sm text-text-tertiary",children:"No escalations matched."});const v=g.length,k=Math.max(Math.abs((((S=g[v-1])==null?void 0:S.startMs)??0)-(((L=g[0])==null?void 0:L.startMs)??0)),1)/Math.max(v-1,1),n=Bs/Math.max(k,1),d=new Set(g.map(i=>new Date(i.startMs).toDateString())).size>1;function h(i){const N=new Date(i),w=N.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return d?N.toLocaleDateString([],{month:"short",day:"numeric"})+" "+w:w}return e.jsxs("div",{className:"mt-4 pb-24",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-1/2 -translate-x-px inset-y-0 w-px bg-slate-200/80"}),g.map((i,N)=>{const w=g[N-1],P=w?Math.abs(i.startMs-w.startMs):null,O=P!==null?Math.max($s,Math.round(P*n)):0,A=N%2===0,T=G[i.displayStatus]??"#94a3b8",b=i.endMs-i.startMs,Q=i.isOpen?Re(i.startMs):`${Re(i.startMs)} · ${Ve(b)}`;return e.jsxs("div",{children:[N>0&&e.jsx(Ds,{gapMs:P,heightPx:O}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-1 flex justify-end items-center",children:A?e.jsxs("div",{className:"flex items-center",children:[e.jsx(Ue,{e:i,highlightKeys:s,onRowClick:r,onMetaFacet:a}),e.jsx("div",{className:"flex-shrink-0 h-px bg-slate-200/70",style:{width:De}})]}):e.jsx("span",{className:"text-[10px] text-slate-400 font-mono tabular-nums pr-3",children:Q})}),e.jsx("div",{className:"relative z-10 flex-shrink-0 w-3.5 h-3.5 rounded-full border-2 border-white cursor-pointer transition-all duration-150 hover:scale-[1.5]",style:{backgroundColor:T,boxShadow:`0 0 0 3px ${T}28, 0 1px 3px ${T}30`},onClick:()=>r==null?void 0:r(i)}),e.jsx("div",{className:"flex-1 flex justify-start items-center",children:A?e.jsx("span",{className:"text-[10px] text-slate-400 font-mono tabular-nums pl-3",children:Q}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0 h-px bg-slate-200/70",style:{width:De}}),e.jsx(Ue,{e:i,highlightKeys:s,onRowClick:r,onMetaFacet:a})]})})]}),e.jsx("div",{className:"flex justify-center relative z-10 mt-0.5",children:e.jsx("span",{className:"text-[9px] text-slate-400 font-mono tabular-nums bg-white px-1.5",children:h(i.startMs)})})]},i.id)})]}),c>1&&e.jsxs("div",{className:"sticky bottom-0 z-20 bg-surface/95 backdrop-blur-sm border-t border-surface-border -mx-10 px-10 pt-2 pb-4 flex items-center justify-between mt-10",children:[e.jsxs("span",{className:"text-[11px] text-text-tertiary",children:["Page ",e.jsx("span",{className:"font-medium text-text-secondary",children:x})," ","of ",e.jsx("span",{className:"font-medium text-text-secondary",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>u(x-1),disabled:x<=1,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(qt,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>u(x+1),disabled:x>=c,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]})]})}function ma(){var Se,we,Pe,Me,Ae,Te,Ee;Lt();const t=jt(),{filters:s,setFilter:r,pagination:a,sort:p,setSort:x}=ss({filters:{role:"",type:"",priority:"",status:"available",search:""}}),c=Je(s.search,300),u=xe(),[l,j]=y.useState(null),[f,g]=y.useState("30"),[v,M]=y.useState(0),k=y.useCallback(o=>M(o),[]),[n,m]=y.useState(new Set),[d,h]=y.useState(!1),[S,L]=vt(),i=y.useMemo(()=>hs(S),[S]),N=y.useCallback(o=>{L(C=>{const B=new URLSearchParams(C);return ps(B,o),B.delete("page"),B})},[L]),{data:w}=wt(d),P=fs(i)+(s.search?1:0),[O,A]=y.useState(!1),[T,b]=y.useState(!1),[Q,te]=y.useState(!1),[se,he]=y.useState(!1),{canBulk:Qe}=Pt(),[Ke,We]=y.useState("auto"),z=Ke!=="off"&&P>0,pe=i.facets?Object.keys(i.facets):[],Xe=y.useCallback(o=>{const{[o]:C,...B}=i.facets??{};N({...i,facets:Object.keys(B).length>0?B:void 0})},[i,N]),fe=y.useCallback((o,C,B,Oe)=>{if(Oe){const yt=encodeURIComponent(JSON.stringify({[o]:C}));t(`/escalations/available?role=${encodeURIComponent(Oe)}&facets=${yt}&status=all`)}else N(B?{...i,facets:{...i.facets,[o]:C}}:{facets:{[o]:C}})},[i,N,t]),ge=Mt(),be=At(),ye=Tt(),ae=Et(),je=Ot(),ne=_t(),K=Bt(),{data:R}=zt(),{data:le}=$t();y.useEffect(()=>{m(new Set)},[s.role,s.type,s.priority,s.status,c,a.page,a.pageSize]);const J=s.status||"",V=J==="available",re=J==="claimed",ve=re?"pending":J==="resolved"?"resolved":J==="cancelled"?"cancelled":J==="expired"?"expired":void 0,Ne=100,Ce={role:s.role||void 0,type:s.type||void 0,priority:s.priority?parseInt(s.priority):void 0,limit:z?Ne:a.pageSize,offset:a.offset,sort_by:p.sort_by||"created_at",order:p.order||"desc",search:c||void 0,...i},Ye=Ft({...Ce,enabled:V}),Ze=He({status:ve,claimed:re||void 0,...Ce,enabled:!V}),et=V?Ye:Ze,{data:I,isLoading:tt,error:W,refetch:st,isFetching:at}=et,nt=as(`/escalations${V?"/available":""}`,{status:ve,claimed:re||void 0,role:s.role||void 0,type:s.type||void 0,priority:s.priority||void 0,search:c||void 0,sort_by:p.sort_by||"created_at",order:p.order||"desc",limit:a.pageSize,offset:a.offset,facets:i.facets&&Object.keys(i.facets).length?JSON.stringify(i.facets):void 0,block:(Se=i.block)!=null&&Se.length?JSON.stringify(i.block):void 0,range:(we=i.range)!=null&&we.length?JSON.stringify(i.range):void 0,exists:(Pe=i.exists)!=null&&Pe.length?JSON.stringify(i.exists):void 0,roles:(Me=i.roles)!=null&&Me.length?JSON.stringify(i.roles):void 0,orderBy:(Ae=i.orderBy)!=null&&Ae.length?JSON.stringify(i.orderBy):void 0,available:i.available!=null?String(i.available):void 0}),E=(I==null?void 0:I.escalations)??[],_=(I==null?void 0:I.total)??0,X=s.role||(((Te=i.roles)==null?void 0:Te.length)===1?i.roles[0]:null),[ie,lt]=y.useState(!1),Y=((Ee=Rt(X??"",void 0,!!X).data)==null?void 0:Ee.list_schema)??null,ke=!!X&&!!Y&&!!Y["x-lt-layout"]&&Y["x-lt-layout"]!=="table",rt=ke&&!ie,it=y.useMemo(()=>{const o=new Set;for(const C of E)n.has(C.id)&&o.add(C.role);return[...o]},[E,n]),ot=y.useCallback(()=>m(new Set),[]),ct=()=>{if(!l)return;const o=f==="custom"?v:parseInt(f);!o||o<=0||ge.mutate({id:l.id,durationMinutes:o},{onSuccess:()=>{j(null),t(`/escalations/detail/${l.id}`)}})},{handleSetPriority:dt,handleBulkClaim:xt,handleBulkEscalate:ut,handleBulkTriage:mt,handleBulkAssign:ht,handleBulkCancel:pt}=Os({selectedIds:n,clearSelection:ot,setPriority:be,bulkClaim:ye,bulkEscalate:je,bulkTriage:ne,bulkAssign:ae,bulkCancel:K,closeTriageModal:()=>A(!1),closeAssignModal:()=>b(!1),closeCancelModal:()=>te(!1)}),ft=o=>{const C=new Set(n);C.has(o)?C.delete(o):C.add(o),m(C)},gt=()=>{n.size===E.length?m(new Set):m(new Set(E.map(o=>o.id)))},bt=[Qe?{key:"select",label:e.jsx("input",{type:"checkbox",checked:E.length>0&&n.size===E.length,onChange:gt,className:"rounded"}),render:o=>e.jsx("input",{type:"checkbox",checked:n.has(o.id),onChange:C=>{C.stopPropagation(),ft(o.id)},onClick:C=>C.stopPropagation(),className:"rounded"}),className:"w-10"}:{key:"spacer",label:"",render:()=>null,className:"w-10"},...cs({onMetaFacet:fe,highlightKeys:pe}),{key:"actions",label:"",render:o=>e.jsx(xs,{children:e.jsx(us,{icon:Wt,title:"Claim escalation",onClick:()=>j(o),colorClass:"text-accent/75 hover:text-accent",size:"sm"})}),className:"w-10 text-right"}];return e.jsxs("div",{children:[e.jsx(rs,{title:"All Escalations",docsHash:"#docs:dashboard.md:all-escalations"}),e.jsx(ds,{filters:s,setFilter:r,roles:(R==null?void 0:R.roles)??[],types:(le==null?void 0:le.types)??[],showStatus:!0,showSearch:!1,actions:e.jsxs(e.Fragment,{children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[11px] text-text-tertiary whitespace-nowrap",children:[_>100&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-medium text-text-secondary",children:[(a.page-1)*100+1,"–",Math.min(a.page*100,_)]})," of "]}),e.jsx("span",{className:"font-medium text-text-secondary",children:_})," ",_===1?"escalation":"escalations"]}),e.jsxs("div",{className:"flex items-center rounded overflow-hidden border border-slate-200",children:[e.jsx("button",{onClick:()=>he(!1),className:`px-1.5 py-1 transition-colors ${se?"text-text-tertiary hover:bg-surface-hover":"bg-accent text-white"}`,title:"Newest first",children:e.jsx(Xt,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>he(!0),className:`px-1.5 py-1 border-l border-slate-200 transition-colors ${se?"bg-accent text-white":"text-text-tertiary hover:bg-surface-hover"}`,title:"Oldest first",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]}),e.jsx("span",{className:"h-3.5 w-px bg-surface-border shrink-0"})]}),e.jsx(ms,{onRefresh:()=>st(),isFetching:at,apiPath:nt}),ke&&!z&&e.jsx("button",{onClick:()=>lt(o=>!o),className:"ml-2 inline-flex h-7 w-7 items-center justify-center rounded text-text-tertiary hover:bg-surface-hover hover:text-text-primary transition-colors",title:ie?"Rich view":"Table view",children:ie?e.jsx(Zt,{className:"w-4 h-4"}):e.jsx(_e,{className:"w-4 h-4"})}),P>0&&e.jsx("button",{onClick:()=>We(o=>o==="off"?"auto":"off"),className:"ml-2 inline-flex h-7 w-7 items-center justify-center rounded text-text-tertiary hover:bg-surface-hover hover:text-text-primary transition-colors",title:z?"Table view":"Timeline view",children:z?e.jsx(_e,{className:"w-4 h-4"}):e.jsx(es,{className:"w-4 h-4"})}),e.jsxs("button",{onClick:()=>h(o=>!o),className:"relative ml-2 inline-flex h-7 w-7 items-center justify-center rounded text-text-tertiary hover:bg-surface-hover hover:text-text-primary transition-colors",title:"Faceted query",children:[e.jsx(ts,{className:"w-4 h-4"}),P>0&&e.jsx("span",{className:"absolute -right-1 -top-1 flex h-3.5 min-w-[14px] items-center justify-center rounded-full bg-accent px-0.5 text-[9px] font-medium text-white",children:P})]})]})}),Nt.createPortal(e.jsxs("div",{className:`fixed right-0 bottom-0 w-[420px] z-40 border-l border-surface-border bg-surface overflow-y-auto shadow-lg transition-transform duration-200 ease-out ${d?"translate-x-0":"pointer-events-none translate-x-full"}`,style:{top:"3.5rem"},"aria-hidden":!d,children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 bg-surface border-b border-surface-border/50",children:[e.jsx("span",{className:"text-xs font-medium text-text-primary",children:"Faceted query"}),e.jsxs("div",{className:"flex items-center gap-2",children:[P>0&&e.jsx("button",{onClick:()=>{N({}),r("search","")},className:"text-[11px] text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsx("button",{onClick:()=>h(!1),className:"p-1 rounded hover:bg-surface-hover text-text-tertiary hover:text-text-primary transition-colors",title:"Close",children:e.jsx(Be,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"px-4 py-2",children:[e.jsxs("p",{className:"mb-2 text-[11px] leading-snug text-text-tertiary",children:["Precise metadata facets plus exact correlation-id lookup — they compose in one SQL query. Facet keys are the ones that actually exist in your visible escalations. Set status to ",e.jsx("span",{className:"font-medium",children:"All"})," to find an order across every status; the whole query is shareable via the URL."]}),e.jsx(vs,{value:i,onChange:N,facetKeys:(w==null?void 0:w.keys)??[],search:s.search??"",onSearchChange:o=>r("search",o)})]})]}),document.body),e.jsx(As,{selectedCount:n.size,onClearSelection:()=>m(new Set),onSetPriority:dt,onClaim:xt,onAssign:()=>b(!0),onEscalate:ut,onTriage:()=>A(!0),onCancel:()=>te(!0),isPriorityPending:be.isPending,isClaimPending:ye.isPending,isAssignPending:ae.isPending,isEscalatePending:je.isPending,isTriagePending:ne.isPending,isCancelPending:K.isPending,availableRoles:(R==null?void 0:R.roles)??[]}),i.facets&&Object.keys(i.facets).length>0&&e.jsxs("div",{className:"sticky top-14 z-30 bg-surface/98 backdrop-blur-sm border-b border-surface-border/30 -mx-10 px-10 py-2 flex items-center gap-1.5 flex-wrap",children:[Object.entries(i.facets).map(([o,C])=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-accent/25 bg-accent/8 px-2.5 py-0.5 text-[10px] font-medium text-accent/90",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:o}),e.jsx("span",{className:"text-text-quaternary",children:"="}),e.jsx("span",{className:"font-mono max-w-[160px] truncate",title:String(C),children:String(C)}),e.jsx("button",{onClick:()=>Xe(o),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":`Remove ${o} filter`,children:e.jsx(Be,{className:"w-2.5 h-2.5"})})]},o)),Object.keys(i.facets).length>1&&e.jsx("button",{onClick:()=>N({...i,facets:void 0}),className:"text-[10px] text-text-quaternary hover:text-text-secondary transition-colors px-1",children:"clear all"})]}),W&&e.jsx("div",{className:"mb-4 px-4 py-3 rounded-md bg-status-error/10 border border-status-error/20 text-xs text-status-error",children:W.message==="Session expired"?"Your session has expired. Please log in again.":`Failed to load escalations: ${W.message}`}),z?e.jsx(zs,{escalations:E,highlightKeys:pe,onRowClick:o=>t(`/escalations/detail/${o.id}`,{state:{from:"/escalations/available"}}),onMetaFacet:fe,total:_,page:a.page,totalPages:Math.ceil(_/Ne),onPageChange:a.setPage,sortAsc:se}):rt?e.jsx(ws,{role:X,listSchema:Y,activeEscalations:E,onRowClick:o=>t(`/escalations/detail/${o.id}`,{state:{from:"/escalations/available"}})}):e.jsxs(e.Fragment,{children:[e.jsx(ns,{columns:bt,data:E,keyFn:o=>o.id,onRowClick:o=>t(`/escalations/detail/${o.id}`,{state:{from:"/escalations/available"}}),isLoading:tt,emptyMessage:W?"Unable to load data":"No escalations",sort:p,onSort:x}),e.jsx(ls,{page:a.page,totalPages:a.totalPages(_),onPageChange:a.setPage,total:_,pageSize:a.pageSize,onPageSizeChange:a.setPageSize})]}),e.jsx(_s,{claimTarget:l,onClose:()=>j(null),claimDuration:f,onDurationChange:o=>{g(o),M(0)},claimDurations:u,customClaimMinutes:v,onCustomClaimChange:k,onClaim:ct,isPending:ge.isPending}),e.jsx(Es,{open:O,onClose:()=>A(!1),selectedCount:n.size,onSubmit:mt,isPending:ne.isPending}),e.jsx(Ts,{open:T,onClose:()=>b(!1),selectedCount:n.size,selectedRoles:it,onSubmit:ht,isPending:ae.isPending}),e.jsx(Dt,{open:Q,onClose:()=>te(!1),onConfirm:pt,selectedCount:n.size,isPending:K.isPending,error:K.error})]})}export{ma as AvailableEscalationsPage};
2
- //# sourceMappingURL=AvailableEscalationsPage-DBeBLNWW.js.map