prefect 3.6.16.dev5__py3-none-any.whl → 3.6.16.dev6__py3-none-any.whl

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 (286) hide show
  1. prefect/_build_info.py +3 -3
  2. prefect/cli/__init__.py +1 -0
  3. prefect/cli/cloud/asset.py +135 -0
  4. prefect/server/ui-v2/assets/artifact-card-BnPKAfkY.js +2 -0
  5. prefect/server/ui-v2/assets/artifact-card-BnPKAfkY.js.map +1 -0
  6. prefect/server/ui-v2/assets/artifact._id-vDOuIuta.js +2 -0
  7. prefect/server/ui-v2/assets/artifact._id-vDOuIuta.js.map +1 -0
  8. prefect/server/ui-v2/assets/automation-wizard-RlOhF90R.js +2 -0
  9. prefect/server/ui-v2/assets/automation-wizard-RlOhF90R.js.map +1 -0
  10. prefect/server/ui-v2/assets/automation._id-CEHa-X0X.js +2 -0
  11. prefect/server/ui-v2/assets/{automation._id-CMiura1b.js.map → automation._id-CEHa-X0X.js.map} +1 -1
  12. prefect/server/ui-v2/assets/{automation_._id.edit-Cbfcwa-K.js → automation_._id.edit-BRWAsELa.js} +2 -2
  13. prefect/server/ui-v2/assets/{automation_._id.edit-Cbfcwa-K.js.map → automation_._id.edit-BRWAsELa.js.map} +1 -1
  14. prefect/server/ui-v2/assets/{automations-header-BxPCOE-0.js → automations-header-Dr6v5dPp.js} +2 -2
  15. prefect/server/ui-v2/assets/{automations-header-BxPCOE-0.js.map → automations-header-Dr6v5dPp.js.map} +1 -1
  16. prefect/server/ui-v2/assets/base-job-template-form-section-C8_R96gO.js +2 -0
  17. prefect/server/ui-v2/assets/base-job-template-form-section-C8_R96gO.js.map +1 -0
  18. prefect/server/ui-v2/assets/block-type-details-tAkUWqs1.js +2 -0
  19. prefect/server/ui-v2/assets/block-type-details-tAkUWqs1.js.map +1 -0
  20. prefect/server/ui-v2/assets/block-type-logo-scnMsyY5.js +2 -0
  21. prefect/server/ui-v2/assets/{block-type-logo-DuvU7goV.js.map → block-type-logo-scnMsyY5.js.map} +1 -1
  22. prefect/server/ui-v2/assets/block._id-BY42cyjR.js +2 -0
  23. prefect/server/ui-v2/assets/block._id-BY42cyjR.js.map +1 -0
  24. prefect/server/ui-v2/assets/{block_._id.edit-C4SmoQ4y.js → block_._id.edit-n2jwU5yr.js} +2 -2
  25. prefect/server/ui-v2/assets/{block_._id.edit-C4SmoQ4y.js.map → block_._id.edit-n2jwU5yr.js.map} +1 -1
  26. prefect/server/ui-v2/assets/catalog-5_GoCKpb.js +2 -0
  27. prefect/server/ui-v2/assets/catalog-5_GoCKpb.js.map +1 -0
  28. prefect/server/ui-v2/assets/catalog_._slug-sZvt0fDy.js +2 -0
  29. prefect/server/ui-v2/assets/catalog_._slug-sZvt0fDy.js.map +1 -0
  30. prefect/server/ui-v2/assets/{catalog_._slug_.create-CgKL4TS2.js → catalog_._slug_.create-rboQmoyW.js} +2 -2
  31. prefect/server/ui-v2/assets/{catalog_._slug_.create-CgKL4TS2.js.map → catalog_._slug_.create-rboQmoyW.js.map} +1 -1
  32. prefect/server/ui-v2/assets/{collapsible-DZbPzSgr.js → collapsible-Lk7MRvBH.js} +2 -2
  33. prefect/server/ui-v2/assets/{collapsible-DZbPzSgr.js.map → collapsible-Lk7MRvBH.js.map} +1 -1
  34. prefect/server/ui-v2/assets/concurrency-limit._id-D5i9zZJh.js +2 -0
  35. prefect/server/ui-v2/assets/concurrency-limit._id-D5i9zZJh.js.map +1 -0
  36. prefect/server/ui-v2/assets/create-CtsA2QIl.js +2 -0
  37. prefect/server/ui-v2/assets/{create-BrNwbpVu.js.map → create-CtsA2QIl.js.map} +1 -1
  38. prefect/server/ui-v2/assets/{create-DWgkh2HT.js → create-DJPAEZ93.js} +2 -2
  39. prefect/server/ui-v2/assets/create-DJPAEZ93.js.map +1 -0
  40. prefect/server/ui-v2/assets/{data-table-QSHqmTar.js → data-table-bk-0xKWT.js} +2 -2
  41. prefect/server/ui-v2/assets/{data-table-QSHqmTar.js.map → data-table-bk-0xKWT.js.map} +1 -1
  42. prefect/server/ui-v2/assets/{delete-confirmation-dialog-dLycVNo4.js → delete-confirmation-dialog-BZg9EOfN.js} +2 -2
  43. prefect/server/ui-v2/assets/{delete-confirmation-dialog-dLycVNo4.js.map → delete-confirmation-dialog-BZg9EOfN.js.map} +1 -1
  44. prefect/server/ui-v2/assets/{deployment-action-header-CzvBTL6H.js → deployment-action-header-DwuMPgVg.js} +2 -2
  45. prefect/server/ui-v2/assets/{deployment-action-header-CzvBTL6H.js.map → deployment-action-header-DwuMPgVg.js.map} +1 -1
  46. prefect/server/ui-v2/assets/deployment-form-BpKkzEf2.js +3 -0
  47. prefect/server/ui-v2/assets/deployment-form-BpKkzEf2.js.map +1 -0
  48. prefect/server/ui-v2/assets/{deployment-links-CGjJpxJA.js → deployment-links-B67P-6Ph.js} +2 -2
  49. prefect/server/ui-v2/assets/{deployment-links-CGjJpxJA.js.map → deployment-links-B67P-6Ph.js.map} +1 -1
  50. prefect/server/ui-v2/assets/{deployment._id-DXrb6frJ.js → deployment._id-BVOBfMVf.js} +2 -2
  51. prefect/server/ui-v2/assets/deployment._id-BVOBfMVf.js.map +1 -0
  52. prefect/server/ui-v2/assets/deployment._id-KOMC9fpE.js +2 -0
  53. prefect/server/ui-v2/assets/deployment._id-KOMC9fpE.js.map +1 -0
  54. prefect/server/ui-v2/assets/deployment_._id.duplicate-BPk2SchT.js +2 -0
  55. prefect/server/ui-v2/assets/deployment_._id.duplicate-BPk2SchT.js.map +1 -0
  56. prefect/server/ui-v2/assets/deployment_._id.edit-Dv0M_huv.js +2 -0
  57. prefect/server/ui-v2/assets/deployment_._id.edit-Dv0M_huv.js.map +1 -0
  58. prefect/server/ui-v2/assets/deployment_._id.run-DFVA4Xhx.js +2 -0
  59. prefect/server/ui-v2/assets/{deployment_._id.run-CnacOmhY.js.map → deployment_._id.run-DFVA4Xhx.js.map} +1 -1
  60. prefect/server/ui-v2/assets/{dropdown-menu-B9LKPlz7.js → dropdown-menu-fRiq5bS-.js} +2 -2
  61. prefect/server/ui-v2/assets/{dropdown-menu-B9LKPlz7.js.map → dropdown-menu-fRiq5bS-.js.map} +1 -1
  62. prefect/server/ui-v2/assets/{event-resource-display-B42RIaiX.js → event-resource-display-C1ZAey-o.js} +2 -2
  63. prefect/server/ui-v2/assets/{event-resource-display-B42RIaiX.js.map → event-resource-display-C1ZAey-o.js.map} +1 -1
  64. prefect/server/ui-v2/assets/event._eventDate._eventId-CcbtP9Ag.js +2 -0
  65. prefect/server/ui-v2/assets/{event._eventDate._eventId-CKTuT_8S.js.map → event._eventDate._eventId-CcbtP9Ag.js.map} +1 -1
  66. prefect/server/ui-v2/assets/flow-run-graph-CycKStSg.js +2 -0
  67. prefect/server/ui-v2/assets/flow-run-graph-CycKStSg.js.map +1 -0
  68. prefect/server/ui-v2/assets/{flow-run._id-BKv9Meqc.js → flow-run._id-Dn9R_Tjy.js} +2 -2
  69. prefect/server/ui-v2/assets/flow-run._id-Dn9R_Tjy.js.map +1 -0
  70. prefect/server/ui-v2/assets/{flow-run._id-ZTkjj6bM.js → flow-run._id-Dwx7ojcj.js} +2 -2
  71. prefect/server/ui-v2/assets/flow-run._id-Dwx7ojcj.js.map +1 -0
  72. prefect/server/ui-v2/assets/flow-run._id-YzRd5jrC.js +4 -0
  73. prefect/server/ui-v2/assets/flow-run._id-YzRd5jrC.js.map +1 -0
  74. prefect/server/ui-v2/assets/flow-runs-pagination-DMLZFM1m.js +2 -0
  75. prefect/server/ui-v2/assets/flow-runs-pagination-DMLZFM1m.js.map +1 -0
  76. prefect/server/ui-v2/assets/flow._id-V6-Qhkwk.js +2 -0
  77. prefect/server/ui-v2/assets/flow._id-V6-Qhkwk.js.map +1 -0
  78. prefect/server/ui-v2/assets/{form-DOdmIC3A.js → form-Cl5Hk9bq.js} +2 -2
  79. prefect/server/ui-v2/assets/{form-DOdmIC3A.js.map → form-Cl5Hk9bq.js.map} +1 -1
  80. prefect/server/ui-v2/assets/{header-DcIuN5UN.js → header-BuI436ik.js} +2 -2
  81. prefect/server/ui-v2/assets/{header-DcIuN5UN.js.map → header-BuI436ik.js.map} +1 -1
  82. prefect/server/ui-v2/assets/{header-CnBwASd-.js → header-DcAQCxQl.js} +2 -2
  83. prefect/server/ui-v2/assets/{header-CnBwASd-.js.map → header-DcAQCxQl.js.map} +1 -1
  84. prefect/server/ui-v2/assets/{header-DxE-NzAK.js → header-qlcK4NLD.js} +2 -2
  85. prefect/server/ui-v2/assets/{header-DxE-NzAK.js.map → header-qlcK4NLD.js.map} +1 -1
  86. prefect/server/ui-v2/assets/index--Z69UYXV.js +2 -0
  87. prefect/server/ui-v2/assets/index--Z69UYXV.js.map +1 -0
  88. prefect/server/ui-v2/assets/{index-D0R9_LIL.js → index-BO4Qqsm8.js} +2 -2
  89. prefect/server/ui-v2/assets/index-BO4Qqsm8.js.map +1 -0
  90. prefect/server/ui-v2/assets/index-Bg45XS_V.js +2 -0
  91. prefect/server/ui-v2/assets/index-Bg45XS_V.js.map +1 -0
  92. prefect/server/ui-v2/assets/{index-BIBIJufF.js → index-BleYpDoN.js} +2 -2
  93. prefect/server/ui-v2/assets/index-BleYpDoN.js.map +1 -0
  94. prefect/server/ui-v2/assets/{index-DyOAqIOp.js → index-C63VUjOh.js} +2 -2
  95. prefect/server/ui-v2/assets/{index-DyOAqIOp.js.map → index-C63VUjOh.js.map} +1 -1
  96. prefect/server/ui-v2/assets/{index-DfKXdmko.js → index-C6LgWyJb.js} +2 -2
  97. prefect/server/ui-v2/assets/index-C6LgWyJb.js.map +1 -0
  98. prefect/server/ui-v2/assets/index-CE-bVgqj.js +2 -0
  99. prefect/server/ui-v2/assets/{index-DlAHvqFx.js.map → index-CE-bVgqj.js.map} +1 -1
  100. prefect/server/ui-v2/assets/{index-V_xTKaEb.js → index-CPpeVt8m.js} +13 -13
  101. prefect/server/ui-v2/assets/index-CPpeVt8m.js.map +1 -0
  102. prefect/server/ui-v2/assets/index-CYaUe0Ym.js +2 -0
  103. prefect/server/ui-v2/assets/index-CYaUe0Ym.js.map +1 -0
  104. prefect/server/ui-v2/assets/{index-C5RMFRyZ.js → index-Clbms0kg.js} +2 -2
  105. prefect/server/ui-v2/assets/index-Clbms0kg.js.map +1 -0
  106. prefect/server/ui-v2/assets/index-D13YFoYA.js +2 -0
  107. prefect/server/ui-v2/assets/index-D13YFoYA.js.map +1 -0
  108. prefect/server/ui-v2/assets/{index-Cx1qEoCK.js → index-D73a_nGu.js} +2 -2
  109. prefect/server/ui-v2/assets/{index-Cx1qEoCK.js.map → index-D73a_nGu.js.map} +1 -1
  110. prefect/server/ui-v2/assets/index-DJXBzX1E.css +1 -0
  111. prefect/server/ui-v2/assets/{index-BO60ehN6.js → index-DPPPaOr_.js} +2 -2
  112. prefect/server/ui-v2/assets/index-DPPPaOr_.js.map +1 -0
  113. prefect/server/ui-v2/assets/{index-DP8W-xJo.js → index-DU9ShbqW.js} +2 -2
  114. prefect/server/ui-v2/assets/index-DU9ShbqW.js.map +1 -0
  115. prefect/server/ui-v2/assets/index-DdR1lzZk.js +2 -0
  116. prefect/server/ui-v2/assets/index-DdR1lzZk.js.map +1 -0
  117. prefect/server/ui-v2/assets/{index-B9ttjsyu.js → index-ELo08q04.js} +2 -2
  118. prefect/server/ui-v2/assets/{index-B9ttjsyu.js.map → index-ELo08q04.js.map} +1 -1
  119. prefect/server/ui-v2/assets/{index-BTL1xHS9.js → index-cp6PTdHp.js} +2 -2
  120. prefect/server/ui-v2/assets/{index-BTL1xHS9.js.map → index-cp6PTdHp.js.map} +1 -1
  121. prefect/server/ui-v2/assets/{index-D6G96ToY.js → index-kM_g8J0u.js} +2 -2
  122. prefect/server/ui-v2/assets/{index-D6G96ToY.js.map → index-kM_g8J0u.js.map} +1 -1
  123. prefect/server/ui-v2/assets/{index-q5Y3hlDT.js → index-mYcm9Rkr.js} +2 -2
  124. prefect/server/ui-v2/assets/index-mYcm9Rkr.js.map +1 -0
  125. prefect/server/ui-v2/assets/{index-D9cOtoSU.js → index-yavn_NBp.js} +2 -2
  126. prefect/server/ui-v2/assets/index-yavn_NBp.js.map +1 -0
  127. prefect/server/ui-v2/assets/{json-input-YKJMJCcT.js → json-input-iUzf6BvZ.js} +2 -2
  128. prefect/server/ui-v2/assets/{json-input-YKJMJCcT.js.map → json-input-iUzf6BvZ.js.map} +1 -1
  129. prefect/server/ui-v2/assets/{key-value-RPUUqQ6F.js → key-value-DI27Dv4P.js} +2 -2
  130. prefect/server/ui-v2/assets/{key-value-RPUUqQ6F.js.map → key-value-DI27Dv4P.js.map} +1 -1
  131. prefect/server/ui-v2/assets/key._key-C-nk2nld.js +2 -0
  132. prefect/server/ui-v2/assets/key._key-C-nk2nld.js.map +1 -0
  133. prefect/server/ui-v2/assets/{lazy-markdown-B9vEkJ0h.js → lazy-markdown-D_y73qoD.js} +2 -2
  134. prefect/server/ui-v2/assets/{lazy-markdown-B9vEkJ0h.js.map → lazy-markdown-D_y73qoD.js.map} +1 -1
  135. prefect/server/ui-v2/assets/{login-C3PhSGQJ.js → login-DR_xuMmg.js} +2 -2
  136. prefect/server/ui-v2/assets/{login-C3PhSGQJ.js.map → login-DR_xuMmg.js.map} +1 -1
  137. prefect/server/ui-v2/assets/{markdown-input-Dei7u1qp.js → markdown-input-hzlzpUdj.js} +2 -2
  138. prefect/server/ui-v2/assets/{markdown-input-Dei7u1qp.js.map → markdown-input-hzlzpUdj.js.map} +1 -1
  139. prefect/server/ui-v2/assets/{python-example-snippet-DvulFxgw.js → python-example-snippet-d8bTNJ0J.js} +3 -3
  140. prefect/server/ui-v2/assets/{python-example-snippet-DvulFxgw.js.map → python-example-snippet-d8bTNJ0J.js.map} +1 -1
  141. prefect/server/ui-v2/assets/{python-input-niCawr8m.js → python-input-Bxdnzvx3.js} +2 -2
  142. prefect/server/ui-v2/assets/{python-input-niCawr8m.js.map → python-input-Bxdnzvx3.js.map} +1 -1
  143. prefect/server/ui-v2/assets/{radio-group-D55TQZsk.js → radio-group-0oOEMJCS.js} +2 -2
  144. prefect/server/ui-v2/assets/{radio-group-D55TQZsk.js.map → radio-group-0oOEMJCS.js.map} +1 -1
  145. prefect/server/ui-v2/assets/{route-error-state-Cu4m0LTX.js → route-error-state-BqbnZCc-.js} +2 -2
  146. prefect/server/ui-v2/assets/{route-error-state-Cu4m0LTX.js.map → route-error-state-BqbnZCc-.js.map} +1 -1
  147. prefect/server/ui-v2/assets/{schema-form-BQAcWW5k.js → schema-form-BD-WM4S0.js} +2 -2
  148. prefect/server/ui-v2/assets/{schema-form-BQAcWW5k.js.map → schema-form-BD-WM4S0.js.map} +1 -1
  149. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-Cb4sTJle.js → schema-form-input-string-format-datetime-Dg3zVAp5.js} +4 -4
  150. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-Cb4sTJle.js.map → schema-form-input-string-format-datetime-Dg3zVAp5.js.map} +1 -1
  151. prefect/server/ui-v2/assets/{settings-DV4ewZ_4.js → settings-Dm6yMLix.js} +2 -2
  152. prefect/server/ui-v2/assets/{settings-DV4ewZ_4.js.map → settings-Dm6yMLix.js.map} +1 -1
  153. prefect/server/ui-v2/assets/{sort-filter-DY7vgl7C.js → sort-filter-X6JyRc0-.js} +2 -2
  154. prefect/server/ui-v2/assets/{sort-filter-DY7vgl7C.js.map → sort-filter-X6JyRc0-.js.map} +1 -1
  155. prefect/server/ui-v2/assets/{table-ChOwO4Pk.js → table-Xyel2BEw.js} +2 -2
  156. prefect/server/ui-v2/assets/{table-ChOwO4Pk.js.map → table-Xyel2BEw.js.map} +1 -1
  157. prefect/server/ui-v2/assets/{tags-input-2KSBvO_K.js → tags-input-DqZ8v99z.js} +2 -2
  158. prefect/server/ui-v2/assets/{tags-input-2KSBvO_K.js.map → tags-input-DqZ8v99z.js.map} +1 -1
  159. prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CNrP9yPQ.js → task-run-concurrency-limits-reset-dialog-5xFWeoYy.js} +2 -2
  160. prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CNrP9yPQ.js.map → task-run-concurrency-limits-reset-dialog-5xFWeoYy.js.map} +1 -1
  161. prefect/server/ui-v2/assets/{task-run._id-cqXH0PMU.js → task-run._id-9DcrUEGz.js} +3 -3
  162. prefect/server/ui-v2/assets/{task-run._id-cqXH0PMU.js.map → task-run._id-9DcrUEGz.js.map} +1 -1
  163. prefect/server/ui-v2/assets/{task-run._id-CQGeAiBh.js → task-run._id-DJkoLl_e.js} +2 -2
  164. prefect/server/ui-v2/assets/task-run._id-DJkoLl_e.js.map +1 -0
  165. prefect/server/ui-v2/assets/task-runs-pagination-B2fSdB1t.js +2 -0
  166. prefect/server/ui-v2/assets/task-runs-pagination-B2fSdB1t.js.map +1 -0
  167. prefect/server/ui-v2/assets/{textarea-9v5uTuxg.js → textarea-DFEOJJdc.js} +2 -2
  168. prefect/server/ui-v2/assets/{textarea-9v5uTuxg.js.map → textarea-DFEOJJdc.js.map} +1 -1
  169. prefect/server/ui-v2/assets/{timezone-select-DPtR_b06.js → timezone-select-NViFNNLz.js} +2 -2
  170. prefect/server/ui-v2/assets/{timezone-select-DPtR_b06.js.map → timezone-select-NViFNNLz.js.map} +1 -1
  171. prefect/server/ui-v2/assets/{toggle-group-CBJphTE6.js → toggle-group-EMgSOoYH.js} +2 -2
  172. prefect/server/ui-v2/assets/{toggle-group-CBJphTE6.js.map → toggle-group-EMgSOoYH.js.map} +1 -1
  173. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-BHgDXlwg.js +2 -0
  174. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-BHgDXlwg.js.map +1 -0
  175. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BYY1b8yH.js → use-delete-block-document-confirmation-dialog-CxRkBKPg.js} +2 -2
  176. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BYY1b8yH.js.map → use-delete-block-document-confirmation-dialog-CxRkBKPg.js.map} +1 -1
  177. prefect/server/ui-v2/assets/use-flow-runs-selected-rows-Ck8nwx2q.js +2 -0
  178. prefect/server/ui-v2/assets/use-flow-runs-selected-rows-Ck8nwx2q.js.map +1 -0
  179. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-BOTU5FPq.js → use-get-artifacts-flow-task-runs-D7Djt53s.js} +2 -2
  180. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-BOTU5FPq.js.map → use-get-artifacts-flow-task-runs-D7Djt53s.js.map} +1 -1
  181. prefect/server/ui-v2/assets/{use-quick-run-DzSmbSlu.js → use-quick-run-Cpy0t7dX.js} +2 -2
  182. prefect/server/ui-v2/assets/{use-quick-run-DzSmbSlu.js.map → use-quick-run-Cpy0t7dX.js.map} +1 -1
  183. prefect/server/ui-v2/assets/{use-state-favicon-UFxhmhHr.js → use-state-favicon-CMsL9s6j.js} +2 -2
  184. prefect/server/ui-v2/assets/{use-state-favicon-UFxhmhHr.js.map → use-state-favicon-CMsL9s6j.js.map} +1 -1
  185. prefect/server/ui-v2/assets/use-stepper-CZZEx5js.js +2 -0
  186. prefect/server/ui-v2/assets/use-stepper-CZZEx5js.js.map +1 -0
  187. prefect/server/ui-v2/assets/{utilities-2FfCfMAV.js → utilities-D9BfvLg5.js} +2 -2
  188. prefect/server/ui-v2/assets/{utilities-2FfCfMAV.js.map → utilities-D9BfvLg5.js.map} +1 -1
  189. prefect/server/ui-v2/assets/work-pool-filter-dsJ6xeK6.js +2 -0
  190. prefect/server/ui-v2/assets/work-pool-filter-dsJ6xeK6.js.map +1 -0
  191. prefect/server/ui-v2/assets/{work-pool-queue-toggle-zSWhEFap.js → work-pool-queue-toggle-f_-cTWxB.js} +2 -2
  192. prefect/server/ui-v2/assets/{work-pool-queue-toggle-zSWhEFap.js.map → work-pool-queue-toggle-f_-cTWxB.js.map} +1 -1
  193. prefect/server/ui-v2/assets/{work-pool._workPoolName-BwIVfCIe.js → work-pool._workPoolName-zBqgkYLT.js} +2 -2
  194. prefect/server/ui-v2/assets/{work-pool._workPoolName-BwIVfCIe.js.map → work-pool._workPoolName-zBqgkYLT.js.map} +1 -1
  195. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-j7cjgoJp.js → work-pool_._workPoolName.edit-B-8_CnfA.js} +2 -2
  196. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-j7cjgoJp.js.map → work-pool_._workPoolName.edit-B-8_CnfA.js.map} +1 -1
  197. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-BlFjSdoB.js → work-pool_._workPoolName.queue._workQueueName-DzrY1tMq.js} +2 -2
  198. prefect/server/ui-v2/assets/work-pool_._workPoolName.queue._workQueueName-DzrY1tMq.js.map +1 -0
  199. prefect/server/ui-v2/assets/{work-queue-icon-text-vWlRNW-b.js → work-queue-icon-text-BqqQ413o.js} +2 -2
  200. prefect/server/ui-v2/assets/{work-queue-icon-text-vWlRNW-b.js.map → work-queue-icon-text-BqqQ413o.js.map} +1 -1
  201. prefect/server/ui-v2/index.html +2 -2
  202. prefect/task_engine.py +26 -12
  203. prefect/workers/base.py +18 -1
  204. {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev6.dist-info}/METADATA +1 -1
  205. {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev6.dist-info}/RECORD +208 -207
  206. prefect/server/ui-v2/assets/artifact-card-DQfjRA2u.js +0 -2
  207. prefect/server/ui-v2/assets/artifact-card-DQfjRA2u.js.map +0 -1
  208. prefect/server/ui-v2/assets/artifact._id-BBhuX3px.js +0 -2
  209. prefect/server/ui-v2/assets/artifact._id-BBhuX3px.js.map +0 -1
  210. prefect/server/ui-v2/assets/automation-wizard-DeT-tz5i.js +0 -2
  211. prefect/server/ui-v2/assets/automation-wizard-DeT-tz5i.js.map +0 -1
  212. prefect/server/ui-v2/assets/automation._id-CMiura1b.js +0 -2
  213. prefect/server/ui-v2/assets/base-job-template-form-section-MeO0M71Y.js +0 -2
  214. prefect/server/ui-v2/assets/base-job-template-form-section-MeO0M71Y.js.map +0 -1
  215. prefect/server/ui-v2/assets/block-type-details-Bcb9qEO8.js +0 -2
  216. prefect/server/ui-v2/assets/block-type-details-Bcb9qEO8.js.map +0 -1
  217. prefect/server/ui-v2/assets/block-type-logo-DuvU7goV.js +0 -2
  218. prefect/server/ui-v2/assets/block._id-DFR6zmOy.js +0 -2
  219. prefect/server/ui-v2/assets/block._id-DFR6zmOy.js.map +0 -1
  220. prefect/server/ui-v2/assets/catalog-CPzaK8QS.js +0 -2
  221. prefect/server/ui-v2/assets/catalog-CPzaK8QS.js.map +0 -1
  222. prefect/server/ui-v2/assets/catalog_._slug-60h4tERz.js +0 -2
  223. prefect/server/ui-v2/assets/catalog_._slug-60h4tERz.js.map +0 -1
  224. prefect/server/ui-v2/assets/concurrency-limit._id-BFfR6_U0.js +0 -2
  225. prefect/server/ui-v2/assets/concurrency-limit._id-BFfR6_U0.js.map +0 -1
  226. prefect/server/ui-v2/assets/create-BrNwbpVu.js +0 -2
  227. prefect/server/ui-v2/assets/create-DWgkh2HT.js.map +0 -1
  228. prefect/server/ui-v2/assets/deployment-form-B33C7F2u.js +0 -3
  229. prefect/server/ui-v2/assets/deployment-form-B33C7F2u.js.map +0 -1
  230. prefect/server/ui-v2/assets/deployment._id-5rPcPD0T.js +0 -2
  231. prefect/server/ui-v2/assets/deployment._id-5rPcPD0T.js.map +0 -1
  232. prefect/server/ui-v2/assets/deployment._id-DXrb6frJ.js.map +0 -1
  233. prefect/server/ui-v2/assets/deployment_._id.duplicate-D7YLydeq.js +0 -2
  234. prefect/server/ui-v2/assets/deployment_._id.duplicate-D7YLydeq.js.map +0 -1
  235. prefect/server/ui-v2/assets/deployment_._id.edit-Daq0J0Ow.js +0 -2
  236. prefect/server/ui-v2/assets/deployment_._id.edit-Daq0J0Ow.js.map +0 -1
  237. prefect/server/ui-v2/assets/deployment_._id.run-CnacOmhY.js +0 -2
  238. prefect/server/ui-v2/assets/event._eventDate._eventId-CKTuT_8S.js +0 -2
  239. prefect/server/ui-v2/assets/flow-run-graph-OrT2Osbu.js +0 -2
  240. prefect/server/ui-v2/assets/flow-run-graph-OrT2Osbu.js.map +0 -1
  241. prefect/server/ui-v2/assets/flow-run._id-BKv9Meqc.js.map +0 -1
  242. prefect/server/ui-v2/assets/flow-run._id-DCYAnq0D.js +0 -4
  243. prefect/server/ui-v2/assets/flow-run._id-DCYAnq0D.js.map +0 -1
  244. prefect/server/ui-v2/assets/flow-run._id-ZTkjj6bM.js.map +0 -1
  245. prefect/server/ui-v2/assets/flow-runs-pagination-CykMKOhv.js +0 -2
  246. prefect/server/ui-v2/assets/flow-runs-pagination-CykMKOhv.js.map +0 -1
  247. prefect/server/ui-v2/assets/flow._id-DhrxqQmD.js +0 -2
  248. prefect/server/ui-v2/assets/flow._id-DhrxqQmD.js.map +0 -1
  249. prefect/server/ui-v2/assets/index-BIBIJufF.js.map +0 -1
  250. prefect/server/ui-v2/assets/index-BO60ehN6.js.map +0 -1
  251. prefect/server/ui-v2/assets/index-BS7fbJ2s.js +0 -2
  252. prefect/server/ui-v2/assets/index-BS7fbJ2s.js.map +0 -1
  253. prefect/server/ui-v2/assets/index-C5RMFRyZ.js.map +0 -1
  254. prefect/server/ui-v2/assets/index-D0R9_LIL.js.map +0 -1
  255. prefect/server/ui-v2/assets/index-D9cOtoSU.js.map +0 -1
  256. prefect/server/ui-v2/assets/index-DEpWUeaO.js +0 -2
  257. prefect/server/ui-v2/assets/index-DEpWUeaO.js.map +0 -1
  258. prefect/server/ui-v2/assets/index-DP8W-xJo.js.map +0 -1
  259. prefect/server/ui-v2/assets/index-DfKXdmko.js.map +0 -1
  260. prefect/server/ui-v2/assets/index-DiVKp6rW.js +0 -2
  261. prefect/server/ui-v2/assets/index-DiVKp6rW.js.map +0 -1
  262. prefect/server/ui-v2/assets/index-DlAHvqFx.js +0 -2
  263. prefect/server/ui-v2/assets/index-VNFzALsC.js +0 -2
  264. prefect/server/ui-v2/assets/index-VNFzALsC.js.map +0 -1
  265. prefect/server/ui-v2/assets/index-V_xTKaEb.js.map +0 -1
  266. prefect/server/ui-v2/assets/index-WIq8QUNT.js +0 -2
  267. prefect/server/ui-v2/assets/index-WIq8QUNT.js.map +0 -1
  268. prefect/server/ui-v2/assets/index-m9O-nIOl.css +0 -1
  269. prefect/server/ui-v2/assets/index-q5Y3hlDT.js.map +0 -1
  270. prefect/server/ui-v2/assets/key._key-CX8FwfwL.js +0 -2
  271. prefect/server/ui-v2/assets/key._key-CX8FwfwL.js.map +0 -1
  272. prefect/server/ui-v2/assets/task-run._id-CQGeAiBh.js.map +0 -1
  273. prefect/server/ui-v2/assets/task-runs-pagination-CYoOghEN.js +0 -2
  274. prefect/server/ui-v2/assets/task-runs-pagination-CYoOghEN.js.map +0 -1
  275. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DZplMJDW.js +0 -2
  276. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DZplMJDW.js.map +0 -1
  277. prefect/server/ui-v2/assets/use-flow-runs-selected-rows-1YE-VIgM.js +0 -2
  278. prefect/server/ui-v2/assets/use-flow-runs-selected-rows-1YE-VIgM.js.map +0 -1
  279. prefect/server/ui-v2/assets/use-stepper-CnGJHRLP.js +0 -2
  280. prefect/server/ui-v2/assets/use-stepper-CnGJHRLP.js.map +0 -1
  281. prefect/server/ui-v2/assets/work-pool-filter-CGfXNujK.js +0 -2
  282. prefect/server/ui-v2/assets/work-pool-filter-CGfXNujK.js.map +0 -1
  283. prefect/server/ui-v2/assets/work-pool_._workPoolName.queue._workQueueName-BlFjSdoB.js.map +0 -1
  284. {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev6.dist-info}/WHEEL +0 -0
  285. {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev6.dist-info}/entry_points.txt +0 -0
  286. {prefect-3.6.16.dev5.dist-info → prefect-3.6.16.dev6.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-delete-automation-confirmation-dialog-BHgDXlwg.js","sources":["../../src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts","../../src/components/automations/action-details/action-details.tsx","../../src/components/automations/trigger-details/trigger-details-compound.tsx","../../src/components/automations/trigger-details/trigger-details-custom.tsx","../../src/components/deployments/deployment-link.tsx","../../src/components/automations/trigger-details/trigger-utils.ts","../../src/components/automations/trigger-details/trigger-details-deployment-status.tsx","../../src/components/automations/trigger-details/trigger-details-flow-run-state.tsx","../../src/components/automations/trigger-details/trigger-details-sequence.tsx","../../src/components/automations/trigger-details/trigger-details-work-pool-status.tsx","../../src/components/automations/trigger-details/trigger-details-work-queue-status.tsx","../../src/components/automations/trigger-details/trigger-details.tsx","../../src/components/automations/automation-details.tsx","../../src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx","../../src/components/automations/automations-actions-menu/automations-actions-menu.tsx","../../src/components/automations/use-delete-automation-confirmation-dialog.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { type Automation, buildGetAutomationQuery } from \"@/api/automations\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildFilterDeploymentsQuery } from \"@/api/deployments\";\nimport { buildFilterWorkPoolsQuery } from \"@/api/work-pools\";\nimport { buildFilterWorkQueuesQuery } from \"@/api/work-queues\";\n\n/**\n *\n * @param automation\n * @returns an object of maps to get information about an action's selected source (automations, deployments, work pools, and work queues)\n *\n * @example\n * ```ts\n * const { loading, data } = useGetAutomationActionResources(MY_AUTOMATION);\n *\n *\n * if (loading) {\n * return \"Loading...\"\n * }\n *\n * const { automationsMap, blockDocumentsMap, deploymentsMap, workPoolsMap, workQueuesMap } = data\n * return (\n * \t\t<ActionDetails\n *\t\t\tautomation={MY_AUTOMATION}\n *\t\t\tautomations={automationsMap}\n *\t\t\tblockDocumentsMap={blockDocumentsMap}\n *\t\t\tdeployments={deploymentsMap}\n *\t\t\tworkPools={workPoolsMap}\n *\t\t\tworkQueues={workQueuesMap}\n *\t\t/>)\n * ```\n */\nexport const useGetAutomationActionResources = (automation: Automation) => {\n\tconst {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t} = getResourceSets(automation.actions);\n\n\t// nb: Automations /filter doesn't support `id`. Need to do it per GET call\n\tconst { data: automationsData, loading: automationsLoading } =\n\t\tuseListAutomationsQueries(Array.from(automationIds));\n\n\t// Need to do deployments filter API\n\tconst remainingQueries = useQueries({\n\t\tqueries: [\n\t\t\tbuildListFilterBlockDocumentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\t\t\tinclude_secrets: false,\n\t\t\t\t\tblock_documents: {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tid: { any_: Array.from(blockDocumentIds) },\n\t\t\t\t\t\tis_anonymous: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: blockDocumentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterDeploymentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"CREATED_DESC\",\n\t\t\t\t\tdeployments: {\n\t\t\t\t\t\tid: { any_: Array.from(deploymentIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: deploymentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkPoolsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_pools: {\n\t\t\t\t\t\tid: { any_: Array.from(workPoolIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workPoolIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkQueuesQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_queues: {\n\t\t\t\t\t\tid: { any_: Array.from(workQueueIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workQueueIds.size > 0 },\n\t\t\t),\n\t\t],\n\t\tcombine: (results) => {\n\t\t\tconst [blockDocuments, deployments, workPools, workQueues] = results;\n\t\t\treturn {\n\t\t\t\tdata: {\n\t\t\t\t\tblockDocuments: blockDocuments.data,\n\t\t\t\t\tdeployments: deployments.data,\n\t\t\t\t\tworkPools: workPools.data,\n\t\t\t\t\tworkQueues: workQueues.data,\n\t\t\t\t},\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\n\treturn {\n\t\tloading: automationsLoading || remainingQueries.loading,\n\t\tdata: {\n\t\t\tautomationsMap: automationsData,\n\t\t\tblockDocumentsMap: listToMap(remainingQueries.data.blockDocuments),\n\t\t\tdeploymentsMap: listToMap(remainingQueries.data.deployments),\n\t\t\tworkPoolsMap: listToMap(remainingQueries.data.workPools),\n\t\t\tworkQueuesMap: listToMap(remainingQueries.data.workQueues),\n\t\t},\n\t};\n};\n\nconst useListAutomationsQueries = (automationIds: Array<string>) =>\n\tuseQueries({\n\t\tqueries: Array.from(automationIds).map((automationId) =>\n\t\t\tbuildGetAutomationQuery(automationId),\n\t\t),\n\t\tcombine: (results) => {\n\t\t\tconst retMap = new Map<string, Automation>();\n\t\t\tfor (const result of results) {\n\t\t\t\tif (result.data) {\n\t\t\t\t\tretMap.set(result.data.id, result.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: retMap,\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\nexport const getResourceSets = (actions: Automation[\"actions\"]) => {\n\tconst automationIds = new Set<string>();\n\tconst blockDocumentIds = new Set<string>();\n\tconst deploymentIds = new Set<string>();\n\tconst workPoolIds = new Set<string>();\n\tconst workQueueIds = new Set<string>();\n\n\tfor (const action of actions) {\n\t\tswitch (action.type) {\n\t\t\tcase \"run-deployment\":\n\t\t\tcase \"pause-deployment\":\n\t\t\tcase \"resume-deployment\":\n\t\t\t\tif (action.deployment_id) {\n\t\t\t\t\tdeploymentIds.add(action.deployment_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-queue\":\n\t\t\tcase \"resume-work-queue\":\n\t\t\t\tif (action.work_queue_id) {\n\t\t\t\t\tworkQueueIds.add(action.work_queue_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-automation\":\n\t\t\tcase \"resume-automation\":\n\t\t\t\tif (action.automation_id) {\n\t\t\t\t\tautomationIds.add(action.automation_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-pool\":\n\t\t\tcase \"resume-work-pool\":\n\t\t\t\tif (action.work_pool_id) {\n\t\t\t\t\tworkPoolIds.add(action.work_pool_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"send-notification\":\n\t\t\tcase \"call-webhook\":\n\t\t\t\tif (action.block_document_id) {\n\t\t\t\t\tblockDocumentIds.add(action.block_document_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// TODO: add these back when the corresponding actions are implemented\n\t\t\t// case \"do-nothing\":\n\t\t\t// case \"cancel-flow-run\":\n\t\t\t// case \"change-flow-run-state\":\n\t\t\t// case \"suspend-flow-run\":\n\t\t\t// case \"resume-flow-run\":\n\t\t}\n\t}\n\n\treturn {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t};\n};\n\nfunction listToMap<T extends { id: string }>(\n\tlist: T[] | undefined,\n): Map<T[\"id\"], T> {\n\tconst map = new Map<T[\"id\"], T>();\n\tfor (const item of list ?? []) {\n\t\tmap.set(item.id, item);\n\t}\n\treturn map;\n}\n","import { Link } from \"@tanstack/react-router\";\nimport type { Automation } from \"@/api/automations\";\nimport type { BlockDocument } from \"@/api/block-documents\";\nimport type { Deployment } from \"@/api/deployments\";\nimport type { components } from \"@/api/prefect\";\nimport type { WorkPool } from \"@/api/work-pools\";\nimport type { WorkQueue } from \"@/api/work-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { Icon, type IconId } from \"@/components/ui/icons\";\nimport { LazyJsonInput as JsonInput } from \"@/components/ui/json-input-lazy\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { capitalize } from \"@/utils\";\n\nconst ACTION_TYPE_TO_STRING = {\n\t\"cancel-flow-run\": \"Cancel flow run\",\n\t\"suspend-flow-run\": \"Suspend flow run\",\n\t\"resume-flow-run\": \"Resume a flow run\",\n\t\"change-flow-run-state\": \"Change state of a flow run\",\n\t\"run-deployment\": \"Run deployment\",\n\t\"pause-deployment\": \"Pause deployment\",\n\t\"resume-deployment\": \"Resume deployment\",\n\t\"pause-work-queue\": \"Pause work queue\",\n\t\"resume-work-queue\": \"Resume work queue\",\n\t\"pause-work-pool\": \"Pause work pool\",\n\t\"resume-work-pool\": \"Resume work pool\",\n\t\"pause-automation\": \"Pause automation\",\n\t\"resume-automation\": \"Resume automation\",\n\t\"call-webhook\": \"Call webhook using\",\n\t/** Default string if `block_type_name` is not found. */\n\t\"send-notification\": \"Send a notification using\",\n\t\"do-nothing\": \"Do nothing\",\n} as const;\ntype ActionLabel =\n\t(typeof ACTION_TYPE_TO_STRING)[keyof typeof ACTION_TYPE_TO_STRING];\n\ntype AutomationAction = Automation[\"actions\"][number];\n\ntype ActionDetailsProps = {\n\taction: AutomationAction;\n\tautomationsMap: Map<string, Automation>;\n\tblockDocumentsMap: Map<string, BlockDocument>;\n\tdeploymentsMap: Map<string, Deployment>;\n\tworkPoolsMap: Map<string, WorkPool>;\n\tworkQueuesMap: Map<string, WorkQueue>;\n};\nexport const ActionDetails = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => (\n\t<Card className=\"p-4\">\n\t\t<ActionDetailsType\n\t\t\taction={action}\n\t\t\tautomationsMap={automationsMap}\n\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\tworkQueuesMap={workQueuesMap}\n\t\t/>\n\t</Card>\n);\n\nconst ActionDetailsType = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => {\n\tconst label = ACTION_TYPE_TO_STRING[action.type];\n\tswitch (action.type) {\n\t\t// Non-inferrable Actions\n\t\tcase \"cancel-flow-run\":\n\t\tcase \"suspend-flow-run\":\n\t\tcase \"resume-flow-run\":\n\t\tcase \"do-nothing\":\n\t\t\treturn <NoninferredAction label={label} />;\n\t\t// Inferable actions\n\t\tcase \"run-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <p className=\"text-base\">Deployment not found</p>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails\n\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\tdeployment={deployment}\n\t\t\t\t\t\tparameters={action.parameters}\n\t\t\t\t\t\tjob_variables={action.job_variables}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-deployment\":\n\t\tcase \"resume-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <p className=\"text-base\">Deployment not found</p>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails label={label} deployment={deployment} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-queue\":\n\t\tcase \"resume-work-queue\":\n\t\t\tif (action.work_queue_id && action.source === \"selected\") {\n\t\t\t\tconst workQueue = workQueuesMap.get(action.work_queue_id);\n\t\t\t\tif (!workQueue) {\n\t\t\t\t\treturn <p className=\"text-base\">Work queue not found</p>;\n\t\t\t\t}\n\t\t\t\treturn <WorkQueueActionDetails label={label} workQueue={workQueue} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-automation\":\n\t\tcase \"resume-automation\":\n\t\t\tif (action.automation_id && action.source === \"selected\") {\n\t\t\t\tconst automation = automationsMap.get(action.automation_id);\n\t\t\t\tif (!automation) {\n\t\t\t\t\treturn <p className=\"text-base\">Automation not found</p>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<AutomationActionDetails label={label} automation={automation} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-pool\":\n\t\tcase \"resume-work-pool\":\n\t\t\tif (action.work_pool_id && action.source === \"selected\") {\n\t\t\t\tconst workPool = workPoolsMap.get(action.work_pool_id);\n\t\t\t\tif (!workPool) {\n\t\t\t\t\treturn <p className=\"text-base\">Workpool not found</p>;\n\t\t\t\t}\n\t\t\t\treturn <WorkPoolActionDetails label={label} workPool={workPool} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\t// Other actions\n\t\tcase \"send-notification\": {\n\t\t\tconst blockDocument = blockDocumentsMap.get(action.block_document_id);\n\t\t\tif (!blockDocument) {\n\t\t\t\treturn <p className=\"text-base\">Block document not found</p>;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<BlockDocumentActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tblockDocument={blockDocument}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tcase \"call-webhook\": {\n\t\t\tconst blockDocument = blockDocumentsMap.get(action.block_document_id);\n\t\t\tif (!blockDocument) {\n\t\t\t\treturn <p className=\"text-base\">Block document not found</p>;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<CallWebhookActionDetails label={label} blockDocument={blockDocument} />\n\t\t\t);\n\t\t}\n\t\tcase \"change-flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<ChangeFlowRunStateActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\ttype={action.state}\n\t\t\t\t\tname={action.name}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n\nconst ActionResource = ({ children }: { children: React.ReactNode }) => (\n\t<div className=\"text-sm flex items-center gap-1\">{children}</div>\n);\n\nconst ActionResourceName = ({\n\ticonId,\n\tname,\n}: {\n\tname: string;\n\ticonId: IconId;\n}) => (\n\t<div className=\"text-xs flex items-center\">\n\t\t<Icon id={iconId} className=\"size-4 mr-1\" />\n\t\t{name}\n\t</div>\n);\n\nconst NoninferredAction = ({ label }: { label: ActionLabel }) => (\n\t<p className=\"text-sm\">{label} from the triggering event</p>\n);\n\nconst InferredAction = ({ label }: { label: ActionLabel }) => (\n\t<p className=\"text-sm\">{label} inferred from the triggering event</p>\n);\n\ntype ChangeFlowRunStateActionDetailsProps = {\n\tlabel: ActionLabel;\n\ttype: components[\"schemas\"][\"StateType\"];\n\tname?: string | null;\n};\n\nexport const ChangeFlowRunStateActionDetails = ({\n\tlabel,\n\ttype,\n\tname,\n}: ChangeFlowRunStateActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<InferredAction label={label} /> to <StateBadge type={type} name={name} />\n\t\t</ActionResource>\n\t);\n};\n\n// Selected resources\ntype DeploymentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tdeployment: Deployment;\n\tparameters?: Record<string, unknown> | null;\n\tjob_variables?: Record<string, unknown> | null;\n};\nexport const DeploymentActionDetails = ({\n\tlabel,\n\tdeployment,\n\tparameters,\n\tjob_variables,\n}: DeploymentActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${deployment.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\taria-label={deployment.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Rocket\" name={deployment.name} />\n\t\t\t</Link>\n\t\t\t{parameters !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog title=\"Parameters\" payload={parameters} />\n\t\t\t)}\n\t\t\t{job_variables !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog\n\t\t\t\t\ttitle=\"Job Variables\"\n\t\t\t\t\tpayload={job_variables}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ActionResource>\n\t);\n};\n\ntype RunDeploymentJsonDialogProps = {\n\ttitle: string;\n\tpayload: Record<string, unknown> | null | undefined;\n};\n\nconst RunDeploymentJsonDialog = ({\n\ttitle,\n\tpayload,\n}: RunDeploymentJsonDialogProps) => {\n\treturn (\n\t\t<Dialog>\n\t\t\t<DialogTrigger asChild>\n\t\t\t\t<Button variant=\"secondary\" size=\"sm\">\n\t\t\t\t\tShow {capitalize(title)}\n\t\t\t\t</Button>\n\t\t\t</DialogTrigger>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<JsonInput value={JSON.stringify(payload)} disabled />\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\ntype AutomationActionDetailsProps = {\n\tlabel: ActionLabel;\n\tautomation: Automation;\n};\nexport const AutomationActionDetails = ({\n\tlabel,\n\tautomation,\n}: AutomationActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${automation.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/automations/automation/$id\"\n\t\t\t\tparams={{ id: automation.id }}\n\t\t\t\taria-label={automation.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Bot\" name={automation.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype BlockDocumentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tblockDocument: BlockDocument;\n};\nexport const BlockDocumentActionDetails = ({\n\tlabel,\n\tblockDocument,\n}: BlockDocumentActionDetailsProps) => {\n\tif (!blockDocument.name) {\n\t\treturn <p className=\"text-base\">Block not found</p>;\n\t}\n\n\tconst _label = blockDocument.block_type_name\n\t\t? `Send a ${blockDocument.block_type_name.toLowerCase()} using`\n\t\t: label;\n\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${blockDocument.id}`}>{_label}</label>\n\t\t\t<Link\n\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\taria-label={blockDocument.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Box\" name={blockDocument.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype CallWebhookActionDetailsProps = {\n\tlabel: ActionLabel;\n\tblockDocument: BlockDocument;\n};\nexport const CallWebhookActionDetails = ({\n\tlabel,\n\tblockDocument,\n}: CallWebhookActionDetailsProps) => {\n\tif (!blockDocument.name) {\n\t\treturn <p className=\"text-base\">Block not found</p>;\n\t}\n\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${blockDocument.id}`}>{label}</label>\n\t\t\t<Link\n\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\taria-label={blockDocument.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Box\" name={blockDocument.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkPoolActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkPool: WorkPool;\n};\nexport const WorkPoolActionDetails = ({\n\tlabel,\n\tworkPool,\n}: WorkPoolActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workPool.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\t\tparams={{ workPoolName: workPool.name }}\n\t\t\t\taria-label={workPool.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workPool.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkQueueActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkQueue: WorkQueue;\n};\nexport const WorkQueueActionDetails = ({\n\tlabel,\n\tworkQueue,\n}: WorkQueueActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workQueue.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName/queue/$workQueueName\"\n\t\t\t\tparams={{\n\t\t\t\t\tworkPoolName: workQueue.name,\n\t\t\t\t\tworkQueueName: workQueue.name,\n\t\t\t\t}}\n\t\t\t\taria-label={workQueue.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workQueue.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n","import type { CompoundTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsCompoundProps = {\n\ttrigger: CompoundTrigger;\n};\n\nexport const TriggerDetailsCompound = ({\n\ttrigger,\n}: TriggerDetailsCompoundProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\tconst requireValue = trigger.require;\n\n\tlet requireLabel: string;\n\tif (requireValue === \"all\") {\n\t\trequireLabel = \"all\";\n\t} else if (requireValue === \"any\") {\n\t\trequireLabel = \"any\";\n\t} else if (typeof requireValue === \"number\") {\n\t\trequireLabel = `at least ${requireValue}`;\n\t} else {\n\t\trequireLabel = \"all\";\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<p className=\"text-sm\">\n\t\t\t\tA compound trigger requiring {requireLabel} of {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} to fire\n\t\t\t</p>\n\t\t</div>\n\t);\n};\n","export const TriggerDetailsCustom = () => {\n\treturn <p className=\"text-sm\">A custom trigger</p>;\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { buildDeploymentDetailsQuery } from \"@/api/deployments\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\ntype DeploymentLinkProps = {\n\tdeploymentId: string;\n};\n\nexport const DeploymentLink = ({ deploymentId }: DeploymentLinkProps) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<DeploymentLinkImplementation deploymentId={deploymentId} />\n\t\t</Suspense>\n\t);\n};\n\nconst DeploymentLinkImplementation = ({\n\tdeploymentId,\n}: DeploymentLinkProps) => {\n\tconst { data: deployment } = useSuspenseQuery(\n\t\tbuildDeploymentDetailsQuery(deploymentId),\n\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1 text-xs\">\n\t\t\tDeployment\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\tclassName=\"flex items-center gap-1\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Rocket\" className=\"size-4\" />\n\t\t\t\t{deployment.name}\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\n\n// Type aliases for OpenAPI schema types\nexport type EventTrigger = components[\"schemas\"][\"EventTrigger\"];\nexport type CompoundTrigger = components[\"schemas\"][\"CompoundTrigger-Input\"];\nexport type SequenceTrigger = components[\"schemas\"][\"SequenceTrigger-Input\"];\n\n// Union type for all automation triggers\nexport type AutomationTrigger =\n\t| EventTrigger\n\t| CompoundTrigger\n\t| SequenceTrigger;\n\n// Template constants - following Vue implementation (5 templates)\nexport const AUTOMATION_TRIGGER_TEMPLATES = [\n\t\"deployment-status\",\n\t\"flow-run-state\",\n\t\"work-pool-status\",\n\t\"work-queue-status\",\n\t\"custom\",\n] as const;\n\nexport type AutomationTriggerTemplate =\n\t(typeof AUTOMATION_TRIGGER_TEMPLATES)[number];\n\n// Event posture types\nexport type AutomationTriggerEventPosture = \"Reactive\" | \"Proactive\";\n\n// Default threshold for event triggers (from Vue implementation)\nexport const DEFAULT_EVENT_TRIGGER_THRESHOLD = 1;\n\n// Event constants for each template type\nexport const DEPLOYMENT_STATUS_EVENTS = [\n\t\"prefect.deployment.ready\",\n\t\"prefect.deployment.not-ready\",\n\t\"prefect.deployment.disabled\",\n] as const;\n\nexport const WORK_POOL_STATUS_EVENTS = [\n\t\"prefect.work-pool.ready\",\n\t\"prefect.work-pool.not-ready\",\n\t\"prefect.work-pool.paused\",\n\t\"prefect.work-pool.not_ready\",\n] as const;\n\nexport const WORK_QUEUE_STATUS_EVENTS = [\n\t\"prefect.work-queue.ready\",\n\t\"prefect.work-queue.not-ready\",\n\t\"prefect.work-queue.paused\",\n] as const;\n\n// Type guard helper - check if value is a record/object\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// Primary type guards for trigger types\nexport function isEventTrigger(trigger: unknown): trigger is EventTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"event\" &&\n\t\t(trigger.posture === \"Reactive\" || trigger.posture === \"Proactive\")\n\t);\n}\n\nexport function isCompoundTrigger(\n\ttrigger: unknown,\n): trigger is CompoundTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"compound\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isSequenceTrigger(\n\ttrigger: unknown,\n): trigger is SequenceTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"sequence\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isAutomationTrigger(\n\ttrigger: unknown,\n): trigger is AutomationTrigger {\n\treturn (\n\t\tisEventTrigger(trigger) ||\n\t\tisCompoundTrigger(trigger) ||\n\t\tisSequenceTrigger(trigger)\n\t);\n}\n\n// Helper to convert value to array (handles undefined, single value, or array)\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\n// Get match value from trigger (handles snake_case field names from OpenAPI)\nfunction getTriggerMatchValue(\n\ttrigger: AutomationTrigger,\n\tkey: string,\n): string[] {\n\tif (isEventTrigger(trigger)) {\n\t\tconst match = trigger.match;\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\treturn value ? asArray(value as string | string[]) : [];\n\t\t}\n\t}\n\treturn [];\n}\n\n// Validation helper: check if match resource satisfies predicate\nexport function isMatchResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (resourceIds: string[]) => boolean,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn predicate(prefectResourceIds);\n}\n\n// Validation helper: check if for_each contains the expected resource\nexport function isForEachResource(\n\ttrigger: AutomationTrigger,\n\tresource: string,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\tconst forEach = trigger.for_each ?? [];\n\t\treturn forEach.every((value) => value.startsWith(resource));\n\t}\n\treturn false;\n}\n\n// Validation helper: check if after events satisfy predicate\nexport function isAfterResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.after ?? []);\n\t}\n\treturn false;\n}\n\n// Validation helper: check if expect events satisfy predicate\nexport function isExpectResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.expect ?? []);\n\t}\n\treturn false;\n}\n\n// Event type checkers\nfunction isDeploymentStatusEvent(event: string): boolean {\n\treturn (DEPLOYMENT_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkPoolStatusEvent(event: string): boolean {\n\treturn (WORK_POOL_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkQueueStatusEvent(event: string): boolean {\n\treturn (WORK_QUEUE_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\n// Template-specific type guards\n\n/**\n * Check if trigger is a deployment-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.deployment'\n * - for_each contains 'prefect.resource.id'\n * - after events are deployment status events\n * - expect events are deployment status events\n * - threshold === 1\n */\nexport function isDeploymentStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.deployment\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isDeploymentStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isDeploymentStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Helper functions for flow-run-state template validation\nfunction getTriggerMatchRelatedValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\t// match_related can be a single object or an array of objects\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction isEmptyMatchRelated(trigger: EventTrigger): boolean {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn true;\n\t}\n\tif (Array.isArray(matchRelated)) {\n\t\treturn matchRelated.length === 0;\n\t}\n\treturn Object.keys(matchRelated).length === 0;\n}\n\nfunction isMatchRelatedResource(\n\ttrigger: EventTrigger,\n\tresource: string,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn prefectResourceIds.every((value) => value.startsWith(resource));\n}\n\nfunction isFlowRunStateTriggerMatchRelated(trigger: EventTrigger): boolean {\n\treturn (\n\t\tisEmptyMatchRelated(trigger) ||\n\t\tisMatchRelatedResource(trigger, \"prefect.flow\") ||\n\t\tisMatchRelatedResource(trigger, \"prefect.tag\")\n\t);\n}\n\n/**\n * Check if trigger is a flow-run-state template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.flow-run'\n * - for_each contains 'prefect.resource.id'\n * - after events start with 'prefect.flow-run'\n * - expect events start with 'prefect.flow-run'\n * - matchRelated is empty OR contains flow/tag patterns\n * - threshold === 1\n */\nexport function isFlowRunStateTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) => value.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => after.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => expect.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisFlowRunStateTriggerMatchRelated(trigger) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-pool-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-pool'\n * - for_each contains 'prefect.resource.id'\n * - after events are work pool status events\n * - expect events are work pool status events\n * - threshold === 1\n */\nexport function isWorkPoolStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-pool\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkPoolStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkPoolStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-queue-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-queue'\n * - for_each contains 'prefect.resource.id'\n * - after events are work queue status events\n * - expect events are work queue status events\n * - threshold === 1\n */\nexport function isWorkQueueStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-queue\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkQueueStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkQueueStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Template check registry (excluding 'custom' which is the default)\nconst automationTriggerTemplateChecks: Record<\n\tExclude<AutomationTriggerTemplate, \"custom\">,\n\t(trigger: unknown) => boolean\n> = {\n\t\"deployment-status\": isDeploymentStatusTrigger,\n\t\"flow-run-state\": isFlowRunStateTrigger,\n\t\"work-pool-status\": isWorkPoolStatusTrigger,\n\t\"work-queue-status\": isWorkQueueStatusTrigger,\n};\n\n/**\n * Detect the template type of an automation trigger\n * Returns 'custom' if no template matches\n */\nexport function getAutomationTriggerTemplate(\n\ttrigger: AutomationTrigger,\n): AutomationTriggerTemplate {\n\tfor (const [type, guard] of Object.entries(automationTriggerTemplateChecks)) {\n\t\tif (guard(trigger)) {\n\t\t\treturn type as AutomationTriggerTemplate;\n\t\t}\n\t}\n\n\treturn \"custom\";\n}\n\n// Template labels\nconst automationTriggerTemplateLabels: Record<\n\tAutomationTriggerTemplate,\n\tstring\n> = {\n\t\"deployment-status\": \"Deployment status\",\n\t\"flow-run-state\": \"Flow run state\",\n\t\"work-pool-status\": \"Work pool status\",\n\t\"work-queue-status\": \"Work queue status\",\n\tcustom: \"Custom\",\n};\n\n/**\n * Get human-readable label for a trigger template\n */\nexport function getAutomationTriggerTemplateLabel(\n\ttemplate: AutomationTriggerTemplate,\n): string {\n\treturn automationTriggerTemplateLabels[template];\n}\n\n/**\n * Get human-readable label for event posture\n * \"Reactive\" -> \"enters\"\n * \"Proactive\" -> \"stays in\"\n */\nexport function getAutomationTriggerEventPostureLabel(\n\tposture: AutomationTriggerEventPosture,\n): string {\n\tswitch (posture) {\n\t\tcase \"Reactive\":\n\t\t\treturn \"enters\";\n\t\tcase \"Proactive\":\n\t\t\treturn \"stays in\";\n\t}\n}\n\n/**\n * Check if a string is a valid automation trigger template\n */\nexport function isAutomationTriggerTemplate(\n\tvalue: string,\n): value is AutomationTriggerTemplate {\n\treturn (AUTOMATION_TRIGGER_TEMPLATES as readonly string[]).includes(value);\n}\n\n// Work queue status types and labels\nexport type WorkQueueStatusTriggerStatus = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\n/**\n * Get human-readable label for work queue status\n * \"READY\" -> \"Ready\"\n * \"NOT_READY\" -> \"Not Ready\"\n * \"PAUSED\" -> \"Paused\"\n */\nexport function getWorkQueueStatusLabel(\n\tstatus: WorkQueueStatusTriggerStatus,\n): string {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t\tdefault: {\n\t\t\tconst exhaustive: never = status;\n\t\t\tthrow new Error(\n\t\t\t\t`getWorkQueueStatusLabel missing case for ${exhaustive as string}`,\n\t\t\t);\n\t\t}\n\t}\n}\n","import { DeploymentLink } from \"@/components/deployments/deployment-link\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\n\ntype TriggerDetailsDeploymentStatusProps = {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n};\n\nfunction getDeploymentStatusLabel(status: DeploymentStatus): string {\n\tswitch (status) {\n\t\tcase \"ready\":\n\t\t\treturn \"ready\";\n\t\tcase \"not_ready\":\n\t\t\treturn \"not ready\";\n\t}\n}\n\nexport const TriggerDetailsDeploymentStatus = ({\n\tdeploymentIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsDeploymentStatusProps) => {\n\tconst isAnyDeployment = deploymentIds.length === 0;\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\tconst statusLabel = getDeploymentStatusLabel(status);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\n\t\t\t{isAnyDeployment ? (\n\t\t\t\t<span>any deployment</span>\n\t\t\t) : (\n\t\t\t\tdeploymentIds.map((deploymentId, index) => (\n\t\t\t\t\t<span key={deploymentId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<DeploymentLink deploymentId={deploymentId} />\n\t\t\t\t\t\t{index === deploymentIds.length - 2 && <span>or</span>}\n\t\t\t\t\t</span>\n\t\t\t\t))\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\nimport { FlowLink } from \"@/components/flows/flow-link\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { TagBadgeGroup } from \"@/components/ui/tag-badge-group\";\nimport { secondsToApproximateString } from \"@/utils\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\ntype TriggerDetailsFlowRunStateProps = {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n};\n\n/**\n * Maps a state name string to a StateType enum value.\n * Handles various state name formats (e.g., \"Completed\", \"COMPLETED\", \"completed\")\n * and maps them to the uppercase StateType values expected by StateBadge.\n */\nfunction mapStateNameToStateType(stateName: string): StateType | null {\n\tconst normalizedName = stateName.toUpperCase();\n\n\tconst validStateTypes: StateType[] = [\n\t\t\"COMPLETED\",\n\t\t\"FAILED\",\n\t\t\"RUNNING\",\n\t\t\"CANCELLED\",\n\t\t\"CANCELLING\",\n\t\t\"CRASHED\",\n\t\t\"PAUSED\",\n\t\t\"PENDING\",\n\t\t\"SCHEDULED\",\n\t];\n\n\tif (validStateTypes.includes(normalizedName as StateType)) {\n\t\treturn normalizedName as StateType;\n\t}\n\n\treturn null;\n}\n\nexport const TriggerDetailsFlowRunState = ({\n\tflowIds,\n\ttags,\n\tposture,\n\tstates,\n\ttime,\n}: TriggerDetailsFlowRunStateProps) => {\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When any flow run</span>\n\n\t\t\t{flowIds.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>of flow</span>\n\t\t\t\t\t{flowIds.map((flowId, index) => (\n\t\t\t\t\t\t<span key={flowId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<FlowLink flowId={flowId} />\n\t\t\t\t\t\t\t{index === flowIds.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{tags.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>with the tag</span>\n\t\t\t\t\t<TagBadgeGroup tags={tags} />\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\n\t\t\t{states.length > 0 ? (\n\t\t\t\tstates.map((state) => {\n\t\t\t\t\tconst stateType = mapStateNameToStateType(state);\n\t\t\t\t\tif (stateType) {\n\t\t\t\t\t\treturn <StateBadge key={state} type={stateType} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t) : (\n\t\t\t\t<span>any state</span>\n\t\t\t)}\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToApproximateString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import type { SequenceTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsSequenceProps = {\n\ttrigger: SequenceTrigger;\n};\n\nexport const TriggerDetailsSequence = ({\n\ttrigger,\n}: TriggerDetailsSequenceProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<p className=\"text-sm\">\n\t\t\t\tA sequence trigger with {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} that must fire in order\n\t\t\t</p>\n\t\t</div>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { buildFilterWorkPoolsQuery, type WorkPool } from \"@/api/work-pools\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport type { AutomationTriggerEventPosture } from \"./trigger-utils\";\n\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nexport type TriggerDetailsWorkPoolStatusProps = {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n};\n\nconst getStatusLabel = (status: WorkPoolStatusType): string => {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t}\n};\n\nconst WorkPoolLinkInline = ({ workPoolName }: { workPoolName: string }) => {\n\treturn (\n\t\t<Link\n\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\tparams={{ workPoolName }}\n\t\t\tclassName=\"inline-flex items-center gap-1\"\n\t\t>\n\t\t\t<Icon id=\"Cpu\" className=\"size-4\" />\n\t\t\t{workPoolName}\n\t\t</Link>\n\t);\n};\n\nconst renderWorkPoolLinks = (workPools: WorkPool[]) => {\n\tif (workPools.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn workPools.map((workPool, index) => (\n\t\t<span key={workPool.id} className=\"inline-flex items-center gap-1\">\n\t\t\t<WorkPoolLinkInline workPoolName={workPool.name} />\n\t\t\t{index === workPools.length - 2 && \" or \"}\n\t\t\t{index < workPools.length - 2 && \", \"}\n\t\t</span>\n\t));\n};\n\nexport const TriggerDetailsWorkPoolStatus = ({\n\tworkPoolIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkPoolStatusProps) => {\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery(\n\t\t\t{\n\t\t\t\toffset: 0,\n\t\t\t\twork_pools: { id: { any_: workPoolIds }, operator: \"and_\" },\n\t\t\t},\n\t\t\t{ enabled: workPoolIds.length > 0 },\n\t\t),\n\t);\n\n\tconst postureLabel = posture === \"Reactive\" ? \"enters\" : \"stays in\";\n\tconst statusLabel = getStatusLabel(status).toLowerCase();\n\n\tconst workPoolLabel =\n\t\tworkPoolIds.length === 0\n\t\t\t? \"any work pool\"\n\t\t\t: `${pluralize(workPoolIds.length, \"work pool\")} `;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\t\t\t<span>{workPoolLabel}</span>\n\t\t\t{workPoolIds.length > 0 && renderWorkPoolLinks(workPools)}\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { Suspense } from \"react\";\nimport { buildGetWorkQueueQuery } from \"@/api/work-queues\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { WorkPoolLink } from \"@/components/work-pools/work-pool-link\";\nimport { WorkQueueIconText } from \"@/components/work-pools/work-queue-icon-text\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n\tgetWorkQueueStatusLabel,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\nexport type TriggerDetailsWorkQueueStatusProps = {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n};\n\nexport const TriggerDetailsWorkQueueStatus = (\n\tprops: TriggerDetailsWorkQueueStatusProps,\n) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<TriggerDetailsWorkQueueStatusImplementation {...props} />\n\t\t</Suspense>\n\t);\n};\n\nconst TriggerDetailsWorkQueueStatusImplementation = ({\n\tworkQueueIds,\n\tworkPoolNames,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkQueueStatusProps) => {\n\tconst anyWorkQueue = workQueueIds.length === 0;\n\tconst anyWorkPool = workPoolNames.length === 0;\n\n\tconst workQueueQueries = useSuspenseQueries({\n\t\tqueries: workQueueIds.map((id) => buildGetWorkQueueQuery(id)),\n\t});\n\n\tconst workQueues = workQueueQueries.map((query) => query.data);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center text-sm\">\n\t\t\t<span>When</span>\n\n\t\t\t{anyWorkQueue ? (\n\t\t\t\t<span>any work queue</span>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span>{pluralize(workQueues.length, \"work queue\")}</span>\n\t\t\t\t\t{workQueues.map((workQueue, index) => (\n\t\t\t\t\t\t<span key={workQueue.id} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkQueueIconText\n\t\t\t\t\t\t\t\tworkPoolName={workQueue.work_pool_name ?? \"\"}\n\t\t\t\t\t\t\t\tworkQueueName={workQueue.name}\n\t\t\t\t\t\t\t\tshowLabel\n\t\t\t\t\t\t\t\tshowStatus\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{index === workQueues.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{!anyWorkPool && (\n\t\t\t\t<>\n\t\t\t\t\t<span>from the {pluralize(workPoolNames.length, \"work pool\")}</span>\n\t\t\t\t\t{workPoolNames.map((workPoolName, index) => (\n\t\t\t\t\t\t<span key={workPoolName} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkPoolLink workPoolName={workPoolName} />\n\t\t\t\t\t\t\t{index === workPoolNames.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{getAutomationTriggerEventPostureLabel(posture)}</span>\n\t\t\t<span>{getWorkQueueStatusLabel(status).toLowerCase()}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { TriggerDetailsCompound } from \"./trigger-details-compound\";\nimport { TriggerDetailsCustom } from \"./trigger-details-custom\";\nimport { TriggerDetailsDeploymentStatus } from \"./trigger-details-deployment-status\";\nimport { TriggerDetailsFlowRunState } from \"./trigger-details-flow-run-state\";\nimport { TriggerDetailsSequence } from \"./trigger-details-sequence\";\nimport { TriggerDetailsWorkPoolStatus } from \"./trigger-details-work-pool-status\";\nimport { TriggerDetailsWorkQueueStatus } from \"./trigger-details-work-queue-status\";\nimport {\n\ttype AutomationTrigger,\n\ttype AutomationTriggerEventPosture,\n\ttype EventTrigger,\n\tgetAutomationTriggerTemplate,\n\tisCompoundTrigger,\n\tisEventTrigger,\n\tisSequenceTrigger,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\ntype TriggerDetailsProps = {\n\ttrigger: AutomationTrigger;\n};\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\nfunction getMatchValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string | string[] | undefined {\n\tconst match = trigger.match;\n\tif (match && typeof match === \"object\") {\n\t\treturn (match as Record<string, string | string[] | undefined>)[key];\n\t}\n\treturn undefined;\n}\n\nfunction getMatchRelatedValue(trigger: EventTrigger, key: string): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction fromResourceId(resource: string, value: unknown): string[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\n\tconst values = asArray(value as string | string[]);\n\n\tif (values.includes(`${resource}.*`)) {\n\t\treturn [];\n\t}\n\n\treturn values\n\t\t.filter((v) => v.startsWith(resource))\n\t\t.map((v) => {\n\t\t\tconst parts = v.split(`${resource}.`);\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((id) => id !== \"\" && id !== \"*\");\n}\n\nfunction fromStateNameEvents(events: string[]): string[] {\n\tif (events.includes(\"prefect.flow-run.*\")) {\n\t\treturn [];\n\t}\n\n\treturn events\n\t\t.filter((event) => event.startsWith(\"prefect.flow-run.\"))\n\t\t.map((event) => {\n\t\t\tconst parts = event.split(\"prefect.flow-run.\");\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((name) => name !== \"\");\n}\n\nfunction extractFlowRunStateProps(trigger: EventTrigger): {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n} {\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tconst flowIds = fromResourceId(\"prefect.flow\", matchRelatedResourceIds);\n\tconst tags = fromResourceId(\"prefect.tag\", matchRelatedResourceIds);\n\n\tconst posture = trigger.posture;\n\tconst states =\n\t\tposture === \"Reactive\"\n\t\t\t? fromStateNameEvents(trigger.expect ?? [])\n\t\t\t: fromStateNameEvents(trigger.after ?? []);\n\n\treturn {\n\t\tflowIds,\n\t\ttags,\n\t\tposture,\n\t\tstates,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst DEPLOYMENT_STATUS_EVENT_TO_STATUS: Record<string, DeploymentStatus> = {\n\t\"prefect.deployment.ready\": \"ready\",\n\t\"prefect.deployment.not-ready\": \"not_ready\",\n\t\"prefect.deployment.disabled\": \"not_ready\",\n};\n\nfunction extractDeploymentStatusProps(trigger: EventTrigger): {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst deploymentIds = fromResourceId(\"prefect.deployment\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: DeploymentStatus = \"ready\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in DEPLOYMENT_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = DEPLOYMENT_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tdeploymentIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_POOL_STATUS_EVENT_TO_STATUS: Record<string, WorkPoolStatusType> = {\n\t\"prefect.work-pool.ready\": \"READY\",\n\t\"prefect.work-pool.not-ready\": \"NOT_READY\",\n\t\"prefect.work-pool.not_ready\": \"NOT_READY\",\n\t\"prefect.work-pool.paused\": \"PAUSED\",\n};\n\nfunction extractWorkPoolStatusProps(trigger: EventTrigger): {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workPoolIds = fromResourceId(\"prefect.work-pool\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkPoolStatusType = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_POOL_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_POOL_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkPoolIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_QUEUE_STATUS_EVENT_TO_STATUS: Record<\n\tstring,\n\tWorkQueueStatusTriggerStatus\n> = {\n\t\"prefect.work-queue.ready\": \"READY\",\n\t\"prefect.work-queue.not-ready\": \"NOT_READY\",\n\t\"prefect.work-queue.paused\": \"PAUSED\",\n};\n\nfunction extractWorkQueueStatusProps(trigger: EventTrigger): {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workQueueIds = fromResourceId(\"prefect.work-queue\", resourceIdValue);\n\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\tconst workPoolNames = fromResourceId(\n\t\t\"prefect.work-pool\",\n\t\tmatchRelatedResourceIds,\n\t);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkQueueStatusTriggerStatus = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_QUEUE_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_QUEUE_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkQueueIds,\n\t\tworkPoolNames,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nexport const TriggerDetails = ({ trigger }: TriggerDetailsProps) => {\n\tif (isCompoundTrigger(trigger)) {\n\t\treturn <TriggerDetailsCompound trigger={trigger} />;\n\t}\n\n\tif (isSequenceTrigger(trigger)) {\n\t\treturn <TriggerDetailsSequence trigger={trigger} />;\n\t}\n\n\tif (!isEventTrigger(trigger)) {\n\t\treturn <TriggerDetailsCustom />;\n\t}\n\n\tconst template = getAutomationTriggerTemplate(trigger);\n\n\tswitch (template) {\n\t\tcase \"flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsFlowRunState {...extractFlowRunStateProps(trigger)} />\n\t\t\t);\n\t\tcase \"deployment-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsDeploymentStatus\n\t\t\t\t\t{...extractDeploymentStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-pool-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkPoolStatus\n\t\t\t\t\t{...extractWorkPoolStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-queue-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkQueueStatus\n\t\t\t\t\t{...extractWorkQueueStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn <TriggerDetailsCustom />;\n\t}\n};\n","import type { Automation } from \"@/api/automations\";\nimport { useGetAutomationActionResources } from \"@/api/automations/use-get-automation-action-resources\";\nimport { ActionDetails } from \"@/components/automations/action-details\";\nimport { TriggerDetails } from \"@/components/automations/trigger-details\";\nimport { Card } from \"@/components/ui/card\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { pluralize } from \"@/utils\";\n\ntype AutomationDetailsProps = {\n\tautomation: Automation;\n};\n\nexport const AutomationDescription = ({\n\tautomation,\n}: AutomationDetailsProps) => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<p className=\"text-sm text-muted-foreground\">Description</p>\n\t\t\t<p className=\"text-base text-muted-foreground\">\n\t\t\t\t{automation.description || \"None\"}\n\t\t\t</p>\n\t\t</div>\n\t);\n};\n\nexport const AutomationTrigger = ({ automation }: AutomationDetailsProps) => {\n\tconst { trigger } = automation;\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<p className=\"text-base\">Trigger</p>\n\t\t\t<TriggerDetails trigger={trigger} />\n\t\t</div>\n\t);\n};\n\nexport const AutomationActions = ({ automation }: AutomationDetailsProps) => {\n\tconst { data: resources, loading } =\n\t\tuseGetAutomationActionResources(automation);\n\n\tconst {\n\t\tautomationsMap,\n\t\tblockDocumentsMap,\n\t\tdeploymentsMap,\n\t\tworkPoolsMap,\n\t\tworkQueuesMap,\n\t} = resources;\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<p className=\"text-base\">\n\t\t\t\t{pluralize(automation.actions.length, \"Action\")}\n\t\t\t</p>\n\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t{loading\n\t\t\t\t\t? Array.from({ length: automation.actions.length }, (_, i) => (\n\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ok for loading skeletons\n\t\t\t\t\t\t\t<Card className=\"p-4\" key={i}>\n\t\t\t\t\t\t\t\t<Skeleton className=\"p-2 h-2 w-full\" />\n\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t))\n\t\t\t\t\t: automation.actions.map((action) => (\n\t\t\t\t\t\t\t<li key={action.type}>\n\t\t\t\t\t\t\t\t<ActionDetails\n\t\t\t\t\t\t\t\t\taction={action}\n\t\t\t\t\t\t\t\t\tautomationsMap={automationsMap}\n\t\t\t\t\t\t\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\t\t\t\t\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\t\t\t\t\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\t\t\t\t\t\t\tworkQueuesMap={workQueuesMap}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t</ul>\n\t\t</div>\n\t);\n};\n","import { toast } from \"sonner\";\nimport { type Automation, useUpdateAutomation } from \"@/api/automations\";\nimport { Switch } from \"@/components/ui/switch\";\n\ntype AutomationEnableToggleProps = {\n\tautomation: Automation;\n};\nexport const AutomationEnableToggle = ({\n\tautomation,\n}: AutomationEnableToggleProps) => {\n\tconst { updateAutomation } = useUpdateAutomation();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateAutomation(\n\t\t\t{\n\t\t\t\tenabled: checked,\n\t\t\t\tid,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(`Automation ${checked ? \"enabled\" : \"disabled\"}`);\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating automation\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle automation\"\n\t\t\tchecked={automation.enabled}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, automation.id)}\n\t\t/>\n\t);\n};\n","import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { Button } from \"@/components/ui/button\";\nimport { DOCS_LINKS } from \"@/components/ui/docs-link\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype Props = {\n\tid: string;\n\tonDelete: () => void;\n};\n\nexport const AutomationsActionsMenu = ({ id, onDelete }: Props) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<Link to=\"/automations/automation/$id/edit\" params={{ id }}>\n\t\t\t\t\t\tEdit\n\t\t\t\t\t</Link>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={DOCS_LINKS[\"automations-guide\"]}\n\t\t\t\t\t\tclassName=\"flex items-center\"\n\t\t\t\t\t>\n\t\t\t\t\t\tDocumentation <Icon id=\"ExternalLink\" className=\"ml-2 size-4\" />\n\t\t\t\t\t</a>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { type Automation, useDeleteAutomation } from \"@/api/automations\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteAutomationConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteAutomation } = useDeleteAutomation();\n\n\tconst handleConfirmDelete = (\n\t\tautomation: Automation,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t}: {\n\t\t\t/** Should navigate back to /automations */\n\t\t\tshouldNavigate?: boolean;\n\t\t} = {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Automation\",\n\t\t\tdescription: `Are you sure you want to delete ${automation.name}?`,\n\t\t\tonConfirm: () => {\n\t\t\t\tdeleteAutomation(automation.id, {\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Automation deleted\");\n\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\tvoid navigate({ to: \"/automations\" });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while deleting automation.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n"],"names":["useGetAutomationActionResources","automation","automationIds","blockDocumentIds","deploymentIds","workPoolIds","workQueueIds","getResourceSets","automationsData","automationsLoading","useListAutomationsQueries","remainingQueries","useQueries","buildListFilterBlockDocumentsQuery","buildFilterDeploymentsQuery","buildFilterWorkPoolsQuery","buildFilterWorkQueuesQuery","results","blockDocuments","deployments","workPools","workQueues","result","listToMap","automationId","buildGetAutomationQuery","retMap","actions","action","list","map","item","ACTION_TYPE_TO_STRING","ActionDetails","automationsMap","blockDocumentsMap","deploymentsMap","workPoolsMap","workQueuesMap","jsx","Card","ActionDetailsType","label","NoninferredAction","deployment","DeploymentActionDetails","InferredAction","workQueue","WorkQueueActionDetails","AutomationActionDetails","workPool","WorkPoolActionDetails","blockDocument","BlockDocumentActionDetails","CallWebhookActionDetails","ChangeFlowRunStateActionDetails","ActionResource","children","ActionResourceName","iconId","name","jsxs","Icon","type","StateBadge","parameters","job_variables","Link","RunDeploymentJsonDialog","title","payload","Dialog","DialogTrigger","Button","capitalize","DialogContent","DialogHeader","DialogTitle","JsonInput","_label","TriggerDetailsCompound","trigger","triggerCount","requireValue","requireLabel","TriggerDetailsCustom","DeploymentLink","deploymentId","Suspense","Skeleton","DeploymentLinkImplementation","useSuspenseQuery","buildDeploymentDetailsQuery","DEFAULT_EVENT_TRIGGER_THRESHOLD","DEPLOYMENT_STATUS_EVENTS","WORK_POOL_STATUS_EVENTS","WORK_QUEUE_STATUS_EVENTS","isRecord","value","isEventTrigger","isCompoundTrigger","isSequenceTrigger","asArray","getTriggerMatchValue","key","match","isMatchResource","predicate","prefectResourceIds","isForEachResource","resource","isAfterResource","isExpectResource","isDeploymentStatusEvent","event","isWorkPoolStatusEvent","isWorkQueueStatusEvent","isDeploymentStatusTrigger","triggerAfters","after","triggerExpects","expect","getTriggerMatchRelatedValue","matchRelated","matchRelatedArray","values","isEmptyMatchRelated","isMatchRelatedResource","isFlowRunStateTriggerMatchRelated","isFlowRunStateTrigger","isWorkPoolStatusTrigger","isWorkQueueStatusTrigger","automationTriggerTemplateChecks","getAutomationTriggerTemplate","guard","getAutomationTriggerEventPostureLabel","posture","getWorkQueueStatusLabel","status","exhaustive","getDeploymentStatusLabel","TriggerDetailsDeploymentStatus","time","isAnyDeployment","postureLabel","statusLabel","index","secondsToString","mapStateNameToStateType","stateName","normalizedName","TriggerDetailsFlowRunState","flowIds","tags","states","Fragment","flowId","FlowLink","TagBadgeGroup","state","stateType","secondsToApproximateString","TriggerDetailsSequence","getStatusLabel","WorkPoolLinkInline","workPoolName","renderWorkPoolLinks","TriggerDetailsWorkPoolStatus","useQuery","workPoolLabel","pluralize","TriggerDetailsWorkQueueStatus","props","TriggerDetailsWorkQueueStatusImplementation","workPoolNames","anyWorkQueue","anyWorkPool","useSuspenseQueries","id","buildGetWorkQueueQuery","query","WorkQueueIconText","WorkPoolLink","getMatchValue","getMatchRelatedValue","fromResourceId","v","fromStateNameEvents","events","extractFlowRunStateProps","matchRelatedResourceIds","DEPLOYMENT_STATUS_EVENT_TO_STATUS","extractDeploymentStatusProps","resourceIdValue","statusEvents","WORK_POOL_STATUS_EVENT_TO_STATUS","extractWorkPoolStatusProps","WORK_QUEUE_STATUS_EVENT_TO_STATUS","extractWorkQueueStatusProps","TriggerDetails","AutomationDescription","AutomationTrigger","AutomationActions","resources","loading","_","i","AutomationEnableToggle","updateAutomation","useUpdateAutomation","handleCheckedChange","checked","toast","error","message","Switch","AutomationsActionsMenu","onDelete","handleCopyId","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","DOCS_LINKS","useDeleteAutomationConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteAutomation","useDeleteAutomation","shouldNavigate"],"mappings":"2kBAiCO,MAAMA,GAAmCC,GAA2B,CAC1E,KAAM,CACL,cAAAC,EACA,iBAAAC,EACA,cAAAC,EACA,YAAAC,EACA,aAAAC,CAAA,EACGC,GAAgBN,EAAW,OAAO,EAGhC,CAAE,KAAMO,EAAiB,QAASC,GACvCC,GAA0B,MAAM,KAAKR,CAAa,CAAC,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AE,iBAAAC,CAAA,EAAqBC,GAAA,EAgC7B,MAAO,CAACJ,EA9BoB,CAC3BnO,EACA,CACC,eAAAwO,EAAiB,EAAA,EAId,CAAA,IAEJJ,EAAc,CACb,MAAO,oBACP,YAAa,mCAAmCpO,EAAW,IAAI,IAC/D,UAAW,IAAM,CAChBsO,EAAiBtO,EAAW,GAAI,CAC/B,UAAW,IAAM,CAChBmN,EAAM,QAAQ,oBAAoB,EAC9BqB,GACEP,EAAS,CAAE,GAAI,eAAgB,CAEtC,EACA,QAAUb,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,2CAClBD,EAAM,MAAME,CAAO,EACnB,QAAQ,MAAMA,CAAO,CACtB,CAAA,CACA,CACF,CAAA,CACA,CAEsC,CACzC"}
@@ -1,2 +1,2 @@
1
- import{j as e,L as D,d as f}from"./vendor-tanstack-BdLtprmr.js";import{q as g,I as x,y as s,dc as y}from"./index-V_xTKaEb.js";import{D as w,a as j,b as C,c as B,d as m}from"./dropdown-menu-B9LKPlz7.js";import{u as A}from"./use-delete-confirmation-dialog-CkL-rSsp.js";const E=({blockDocument:n,onDelete:a})=>{const t=u=>{navigator.clipboard.writeText(u),s.success("Copied to clipboard!")},{id:c,name:r}=n;return e.jsxs(w,{children:[e.jsx(j,{asChild:!0,children:e.jsxs(g,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(x,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(C,{align:"end",children:[e.jsx(B,{children:"Actions"}),r&&e.jsx(m,{onClick:()=>t(r),children:"Copy Name"}),e.jsx(D,{to:"/blocks/block/$id/edit",params:{id:c},children:e.jsx(m,{children:"Edit"})}),e.jsx(m,{onClick:a,children:"Delete"})]})]})},I=()=>{const n=f(),[a,t]=A(),{deleteBlockDocument:c,mutateAsync:r}=y();return[a,(o,{shouldNavigate:p=!1,onSuccess:h=()=>{}}={})=>{if(Array.isArray(o)){const d=async()=>{try{await Promise.all(o.map(l=>r(l))),s.success("Blocks deleted"),p&&n({to:"/blocks"})}catch(l){const k=l instanceof Error?l.message:"Unknown error while deleting block.";s.error(k),console.error(k)}},i=o.length>1?`Are you sure you want to delete these ${o.length} selected blocks?`:"Are you sure you want to delete this selected block?";t({title:"Delete Blocks",description:i,onConfirm:()=>{d(),h()}})}else t({title:"Delete Block",description:`Are you sure you want to delete ${o.name?o.name:"this block"}?`,onConfirm:()=>{c(o.id,{onSuccess:()=>{s.success("Block deleted"),p&&n({to:"/blocks"}),h()},onError:d=>{const i=d.message||"Unknown error while deleting block.";s.error(i),console.error(i)}})}})}]};export{E as B,I as u};
2
- //# sourceMappingURL=use-delete-block-document-confirmation-dialog-BYY1b8yH.js.map
1
+ import{j as e,L as D,d as f}from"./vendor-tanstack-BdLtprmr.js";import{q as g,I as x,y as s,db as y}from"./index-CPpeVt8m.js";import{D as w,a as j,b as C,c as B,d as m}from"./dropdown-menu-fRiq5bS-.js";import{u as b}from"./use-delete-confirmation-dialog-CkL-rSsp.js";const E=({blockDocument:n,onDelete:a})=>{const t=u=>{navigator.clipboard.writeText(u),s.success("Copied to clipboard!")},{id:c,name:r}=n;return e.jsxs(w,{children:[e.jsx(j,{asChild:!0,children:e.jsxs(g,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(x,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(C,{align:"end",children:[e.jsx(B,{children:"Actions"}),r&&e.jsx(m,{onClick:()=>t(r),children:"Copy Name"}),e.jsx(D,{to:"/blocks/block/$id/edit",params:{id:c},children:e.jsx(m,{children:"Edit"})}),e.jsx(m,{onClick:a,children:"Delete"})]})]})},I=()=>{const n=f(),[a,t]=b(),{deleteBlockDocument:c,mutateAsync:r}=y();return[a,(o,{shouldNavigate:p=!1,onSuccess:h=()=>{}}={})=>{if(Array.isArray(o)){const d=async()=>{try{await Promise.all(o.map(l=>r(l))),s.success("Blocks deleted"),p&&n({to:"/blocks"})}catch(l){const k=l instanceof Error?l.message:"Unknown error while deleting block.";s.error(k),console.error(k)}},i=o.length>1?`Are you sure you want to delete these ${o.length} selected blocks?`:"Are you sure you want to delete this selected block?";t({title:"Delete Blocks",description:i,onConfirm:()=>{d(),h()}})}else t({title:"Delete Block",description:`Are you sure you want to delete ${o.name?o.name:"this block"}?`,onConfirm:()=>{c(o.id,{onSuccess:()=>{s.success("Block deleted"),p&&n({to:"/blocks"}),h()},onError:d=>{const i=d.message||"Unknown error while deleting block.";s.error(i),console.error(i)}})}})}]};export{E as B,I as u};
2
+ //# sourceMappingURL=use-delete-block-document-confirmation-dialog-CxRkBKPg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-delete-block-document-confirmation-dialog-BYY1b8yH.js","sources":["../../src/components/blocks/block-document-action-menu/block-document-action-menu.tsx","../../src/components/blocks/use-delete-block-document-confirmation-dialog.ts"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport type { BlockDocument } from \"@/api/block-documents\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\nexport type BlockDocumentActionMenuProps = {\n\tblockDocument: BlockDocument;\n\tonDelete: () => void;\n};\n\nexport const BlockDocumentActionMenu = ({\n\tblockDocument,\n\tonDelete,\n}: BlockDocumentActionMenuProps) => {\n\tconst handleCopyName = (_name: string) => {\n\t\tvoid navigator.clipboard.writeText(_name);\n\t\ttoast.success(\"Copied to clipboard!\");\n\t};\n\n\tconst { id, name } = blockDocument;\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t{name && (\n\t\t\t\t\t<DropdownMenuItem onClick={() => handleCopyName(name)}>\n\t\t\t\t\t\tCopy Name\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t)}\n\t\t\t\t<Link to=\"/blocks/block/$id/edit\" params={{ id }}>\n\t\t\t\t\t<DropdownMenuItem>Edit</DropdownMenuItem>\n\t\t\t\t</Link>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport {\n\ttype BlockDocument,\n\tuseDeleteBlockDocument,\n} from \"@/api/block-documents\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteBlockDocumentConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteBlockDocument, mutateAsync } = useDeleteBlockDocument();\n\n\tconst handleConfirmDelete = (\n\t\t/** Pass a block document or list of block document ids for bulk edit */\n\t\tblockDocument: BlockDocument | Array<string>,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t\tonSuccess = () => {},\n\t\t}: {\n\t\t\t/** Should navigate back to /blocks */\n\t\t\tshouldNavigate?: boolean;\n\t\t\tonSuccess?: () => void;\n\t\t} = {},\n\t) => {\n\t\tif (Array.isArray(blockDocument)) {\n\t\t\tconst handleDeleteBlockDocuments = async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait Promise.all(blockDocument.map((id) => mutateAsync(id)));\n\t\t\t\t\ttoast.success(\"Blocks deleted\");\n\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\tvoid navigate({ to: \"/blocks\" });\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror instanceof Error\n\t\t\t\t\t\t\t? error.message\n\t\t\t\t\t\t\t: \"Unknown error while deleting block.\";\n\t\t\t\t\ttoast.error(message);\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst description =\n\t\t\t\tblockDocument.length > 1\n\t\t\t\t\t? `Are you sure you want to delete these ${blockDocument.length} selected blocks?`\n\t\t\t\t\t: \"Are you sure you want to delete this selected block?\";\n\n\t\t\tconfirmDelete({\n\t\t\t\ttitle: \"Delete Blocks\",\n\t\t\t\tdescription,\n\t\t\t\tonConfirm: () => {\n\t\t\t\t\tvoid handleDeleteBlockDocuments();\n\t\t\t\t\tonSuccess();\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tconfirmDelete({\n\t\t\t\ttitle: \"Delete Block\",\n\t\t\t\tdescription: `Are you sure you want to delete ${blockDocument.name ? blockDocument.name : \"this block\"}?`,\n\t\t\t\tonConfirm: () => {\n\t\t\t\t\tdeleteBlockDocument(blockDocument.id, {\n\t\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\t\ttoast.success(\"Block deleted\");\n\t\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\t\tvoid navigate({ to: \"/blocks\" });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonSuccess();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\t\terror.message || \"Unknown error while deleting block.\";\n\t\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t};\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n"],"names":["BlockDocumentActionMenu","blockDocument","onDelete","handleCopyName","_name","toast","id","name","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","Link","useDeleteBlockDocumentConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteBlockDocument","mutateAsync","useDeleteBlockDocument","shouldNavigate","onSuccess","handleDeleteBlockDocuments","error","message","description"],"mappings":"2QAkBO,MAAMA,EAA0B,CAAC,CACvC,cAAAC,EACA,SAAAC,CACD,IAAoC,CACnC,MAAMC,EAAkBC,GAAkB,CACpC,UAAU,UAAU,UAAUA,CAAK,EACxCC,EAAM,QAAQ,sBAAsB,CACrC,EAEM,CAAE,GAAAC,EAAI,KAAAC,CAAA,EAASN,EAErB,cACEO,EAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,EAAA,CAAoB,QAAO,GAC3B,SAAAC,EAAAA,KAACC,GAAO,QAAQ,UAAU,UAAU,aACnC,SAAA,CAAAH,EAAAA,IAAC,OAAA,CAAK,UAAU,UAAU,SAAA,YAAS,EACnCA,EAAAA,IAACI,EAAA,CAAK,GAAG,eAAe,UAAU,QAAA,CAAS,CAAA,CAAA,CAC5C,CAAA,CACD,EACAF,EAAAA,KAACG,EAAA,CAAoB,MAAM,MAC1B,SAAA,CAAAL,EAAAA,IAACM,GAAkB,SAAA,SAAA,CAAO,EACzBR,SACCS,EAAA,CAAiB,QAAS,IAAMb,EAAeI,CAAI,EAAG,SAAA,YAEvD,EAEDE,EAAAA,IAACQ,EAAA,CAAK,GAAG,yBAAyB,OAAQ,CAAE,GAAAX,CAAA,EAC3C,SAAAG,EAAAA,IAACO,EAAA,CAAiB,SAAA,MAAA,CAAI,CAAA,CACvB,EACAP,EAAAA,IAACO,EAAA,CAAiB,QAASd,EAAU,SAAA,QAAA,CAAM,CAAA,CAAA,CAC5C,CAAA,EACD,CAEF,EC3CagB,EAA2C,IAAM,CAC7D,MAAMC,EAAWC,EAAA,EACX,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAE/B,CAAE,oBAAAC,EAAqB,YAAAC,CAAA,EAAgBC,EAAA,EAsE7C,MAAO,CAACL,EApEoB,CAE3BpB,EACA,CACC,eAAA0B,EAAiB,GACjB,UAAAC,EAAY,IAAM,CAAC,CAAA,EAKhB,KACA,CACJ,GAAI,MAAM,QAAQ3B,CAAa,EAAG,CACjC,MAAM4B,EAA6B,SAAY,CAC9C,GAAI,CACH,MAAM,QAAQ,IAAI5B,EAAc,IAAKK,GAAOmB,EAAYnB,CAAE,CAAC,CAAC,EAC5DD,EAAM,QAAQ,gBAAgB,EAC1BsB,GACER,EAAS,CAAE,GAAI,UAAW,CAEjC,OAASW,EAAO,CACf,MAAMC,EACLD,aAAiB,MACdA,EAAM,QACN,sCACJzB,EAAM,MAAM0B,CAAO,EACnB,QAAQ,MAAMA,CAAO,CACtB,CACD,EAEMC,EACL/B,EAAc,OAAS,EACpB,yCAAyCA,EAAc,MAAM,oBAC7D,uDAEJqB,EAAc,CACb,MAAO,gBACP,YAAAU,EACA,UAAW,IAAM,CACXH,EAAA,EACLD,EAAA,CACD,CAAA,CACA,CACF,MACCN,EAAc,CACb,MAAO,eACP,YAAa,mCAAmCrB,EAAc,KAAOA,EAAc,KAAO,YAAY,IACtG,UAAW,IAAM,CAChBuB,EAAoBvB,EAAc,GAAI,CACrC,UAAW,IAAM,CAChBI,EAAM,QAAQ,eAAe,EACzBsB,GACER,EAAS,CAAE,GAAI,UAAW,EAEhCS,EAAA,CACD,EACA,QAAUE,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,sCAClBzB,EAAM,MAAM0B,CAAO,EACnB,QAAQ,MAAMA,CAAO,CACtB,CAAA,CACA,CACF,CAAA,CACA,CAEH,CAEwC,CACzC"}
1
+ {"version":3,"file":"use-delete-block-document-confirmation-dialog-CxRkBKPg.js","sources":["../../src/components/blocks/block-document-action-menu/block-document-action-menu.tsx","../../src/components/blocks/use-delete-block-document-confirmation-dialog.ts"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport type { BlockDocument } from \"@/api/block-documents\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\nexport type BlockDocumentActionMenuProps = {\n\tblockDocument: BlockDocument;\n\tonDelete: () => void;\n};\n\nexport const BlockDocumentActionMenu = ({\n\tblockDocument,\n\tonDelete,\n}: BlockDocumentActionMenuProps) => {\n\tconst handleCopyName = (_name: string) => {\n\t\tvoid navigator.clipboard.writeText(_name);\n\t\ttoast.success(\"Copied to clipboard!\");\n\t};\n\n\tconst { id, name } = blockDocument;\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t{name && (\n\t\t\t\t\t<DropdownMenuItem onClick={() => handleCopyName(name)}>\n\t\t\t\t\t\tCopy Name\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t)}\n\t\t\t\t<Link to=\"/blocks/block/$id/edit\" params={{ id }}>\n\t\t\t\t\t<DropdownMenuItem>Edit</DropdownMenuItem>\n\t\t\t\t</Link>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport {\n\ttype BlockDocument,\n\tuseDeleteBlockDocument,\n} from \"@/api/block-documents\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteBlockDocumentConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteBlockDocument, mutateAsync } = useDeleteBlockDocument();\n\n\tconst handleConfirmDelete = (\n\t\t/** Pass a block document or list of block document ids for bulk edit */\n\t\tblockDocument: BlockDocument | Array<string>,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t\tonSuccess = () => {},\n\t\t}: {\n\t\t\t/** Should navigate back to /blocks */\n\t\t\tshouldNavigate?: boolean;\n\t\t\tonSuccess?: () => void;\n\t\t} = {},\n\t) => {\n\t\tif (Array.isArray(blockDocument)) {\n\t\t\tconst handleDeleteBlockDocuments = async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait Promise.all(blockDocument.map((id) => mutateAsync(id)));\n\t\t\t\t\ttoast.success(\"Blocks deleted\");\n\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\tvoid navigate({ to: \"/blocks\" });\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror instanceof Error\n\t\t\t\t\t\t\t? error.message\n\t\t\t\t\t\t\t: \"Unknown error while deleting block.\";\n\t\t\t\t\ttoast.error(message);\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst description =\n\t\t\t\tblockDocument.length > 1\n\t\t\t\t\t? `Are you sure you want to delete these ${blockDocument.length} selected blocks?`\n\t\t\t\t\t: \"Are you sure you want to delete this selected block?\";\n\n\t\t\tconfirmDelete({\n\t\t\t\ttitle: \"Delete Blocks\",\n\t\t\t\tdescription,\n\t\t\t\tonConfirm: () => {\n\t\t\t\t\tvoid handleDeleteBlockDocuments();\n\t\t\t\t\tonSuccess();\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\tconfirmDelete({\n\t\t\t\ttitle: \"Delete Block\",\n\t\t\t\tdescription: `Are you sure you want to delete ${blockDocument.name ? blockDocument.name : \"this block\"}?`,\n\t\t\t\tonConfirm: () => {\n\t\t\t\t\tdeleteBlockDocument(blockDocument.id, {\n\t\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\t\ttoast.success(\"Block deleted\");\n\t\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\t\tvoid navigate({ to: \"/blocks\" });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonSuccess();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\t\terror.message || \"Unknown error while deleting block.\";\n\t\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t};\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n"],"names":["BlockDocumentActionMenu","blockDocument","onDelete","handleCopyName","_name","toast","id","name","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","Link","useDeleteBlockDocumentConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteBlockDocument","mutateAsync","useDeleteBlockDocument","shouldNavigate","onSuccess","handleDeleteBlockDocuments","error","message","description"],"mappings":"2QAkBO,MAAMA,EAA0B,CAAC,CACvC,cAAAC,EACA,SAAAC,CACD,IAAoC,CACnC,MAAMC,EAAkBC,GAAkB,CACpC,UAAU,UAAU,UAAUA,CAAK,EACxCC,EAAM,QAAQ,sBAAsB,CACrC,EAEM,CAAE,GAAAC,EAAI,KAAAC,CAAA,EAASN,EAErB,cACEO,EAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,EAAA,CAAoB,QAAO,GAC3B,SAAAC,EAAAA,KAACC,GAAO,QAAQ,UAAU,UAAU,aAC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,oBAC7D,uDAEJqB,EAAc,CACb,MAAO,gBACP,YAAAU,EACA,UAAW,IAAM,CACXH,EAAA,EACLD,EAAA,CACD,CAAA,CACA,CACF,MACCN,EAAc,CACb,MAAO,eACP,YAAa,mCAAmCrB,EAAc,KAAOA,EAAc,KAAO,YAAY,IACtG,UAAW,IAAM,CAChBuB,EAAoBvB,EAAc,GAAI,CACrC,UAAW,IAAM,CAChBI,EAAM,QAAQ,eAAe,EACzBsB,GACER,EAAS,CAAE,GAAI,UAAW,EAEhCS,EAAA,CACD,EACA,QAAUE,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,sCAClBzB,EAAM,MAAM0B,CAAO,EACnB,QAAQ,MAAMA,CAAO,CACtB,CAAA,CACA,CACF,CAAA,CACA,CAEH,CAEwC,CACzC"}
@@ -0,0 +1,2 @@
1
+ import{j as s,r as h}from"./vendor-tanstack-BdLtprmr.js";import{cx as g,y as w,U as S,q as j,I as D,ao as x}from"./index-CPpeVt8m.js";import{D as C}from"./delete-confirmation-dialog-BZg9EOfN.js";import{u as F}from"./use-delete-confirmation-dialog-CkL-rSsp.js";const k=()=>{const[o,t]=F(),{mutateAsync:n}=g(),r=async(u,c=()=>{})=>{try{const i=await Promise.allSettled(u.map(a=>n(a))),{numFails:l,numSuccess:e}=i.reduce((a,m)=>(m.status==="rejected"?a.numFails+=1:a.numSuccess+=1,a),{numFails:0,numSuccess:0});l>1?w.error(`${l} flow runs failed to delete`):l===1?w.error("Flow run failed to delete"):e>1?w.success(`${e} flow runs deleted`):w.success("Flow run deleted")}catch(i){console.error("Unknown error while deleting flow run.",i)}finally{c()}};return[o,(u,c=()=>{})=>t({title:"Delete Flow Runs",description:"Are you sure you want to delete selected flow runs?",onConfirm:()=>{r(u,c)}})]},v=({count:o=0,...t})=>"results"in t&&"setSelectedRows"in t&&"selectedRows"in t?s.jsx(R,{count:o,...t}):s.jsxs("p",{className:"text-sm text-muted-foreground",children:[o," ",S(o,"Flow run")]});function R({count:o=0,results:t=[],setSelectedRows:n,selectedRows:r}){const[d,u]=k(),c=h.useMemo(()=>t.map(({id:e})=>e),[t]),i=Array.from(r),l=()=>{const e=c.every(f=>r.has(f)),a=c.some(f=>r.has(f));let m=!1;return e?m=!0:a&&(m="indeterminate"),s.jsx(x,{className:"block",checked:m,onCheckedChange:f=>{n(f?new Set(c):new Set)},"aria-label":"Toggle all"})};return r.size>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(l,{}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," selected"]}),s.jsx(j,{"aria-label":"Delete rows",size:"icon",variant:"secondary",onClick:()=>{u(i,()=>n(new Set))},children:s.jsx(D,{id:"Trash2",className:"size-4"})})]}),s.jsx(C,{...d})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[t&&n&&r&&s.jsx(x,{className:"block",checked:!1,onCheckedChange:e=>{n(new Set(e?c:void 0))},"aria-label":"Toggle all"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[o," ",S(o,"Flow run")]})]})}const z=o=>{const[t,n]=h.useState(new Set(o)),r=l=>n(e=>new Set(e).add(l)),d=l=>n(e=>{const a=new Set(e);return a.delete(l),a});return[t,n,{addRow:r,removeRow:d,onSelectRow:(l,e)=>{e?r(l):d(l)},clearSet:()=>n(new Set)}]};export{v as F,z as u};
2
+ //# sourceMappingURL=use-flow-runs-selected-rows-Ck8nwx2q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-flow-runs-selected-rows-Ck8nwx2q.js","sources":["../../src/components/flow-runs/flow-runs-list/use-delete-flow-runs-dialog.ts","../../src/components/flow-runs/flow-runs-list/flow-runs-row-count.tsx","../../src/components/flow-runs/flow-runs-list/use-flow-runs-selected-rows.ts"],"sourcesContent":["import { toast } from \"sonner\";\nimport { useDeleteFlowRun } from \"@/api/flow-runs\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteFlowRunsDialog = () => {\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { mutateAsync } = useDeleteFlowRun();\n\n\tconst handleDeletes = async (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) => {\n\t\ttry {\n\t\t\tconst res = await Promise.allSettled(\n\t\t\t\tflowRunIds.map((id) => mutateAsync(id)),\n\t\t\t);\n\t\t\tconst { numFails, numSuccess } = res.reduce(\n\t\t\t\t(accumulator, currentValue) => {\n\t\t\t\t\tif (currentValue.status === \"rejected\") {\n\t\t\t\t\t\taccumulator.numFails += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taccumulator.numSuccess += 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\t{ numFails: 0, numSuccess: 0 },\n\t\t\t);\n\t\t\tif (numFails > 1) {\n\t\t\t\ttoast.error(`${numFails} flow runs failed to delete`);\n\t\t\t} else if (numFails === 1) {\n\t\t\t\ttoast.error(\"Flow run failed to delete\");\n\t\t\t} else if (numSuccess > 1) {\n\t\t\t\ttoast.success(`${numSuccess} flow runs deleted`);\n\t\t\t} else {\n\t\t\t\ttoast.success(\"Flow run deleted\");\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.error(\"Unknown error while deleting flow run.\", err);\n\t\t} finally {\n\t\t\tonConfirm();\n\t\t}\n\t};\n\n\tconst handleConfirmDelete = (\n\t\tflowRunIds: Array<string>,\n\t\tonConfirm = () => {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Flow Runs\",\n\t\t\tdescription: \"Are you sure you want to delete selected flow runs?\",\n\t\t\tonConfirm: () => {\n\t\t\t\tvoid handleDeletes(flowRunIds, onConfirm);\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n","import type { CheckedState } from \"@radix-ui/react-checkbox\";\nimport { useMemo } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { pluralize } from \"@/utils\";\nimport type { FlowRunCardData } from \"../flow-run-card\";\nimport { useDeleteFlowRunsDialog } from \"./use-delete-flow-runs-dialog\";\n\ntype CountOnlyProps = {\n\tcount: number | undefined;\n};\ntype SelectableProps = {\n\tcount: number | undefined;\n\tresults: Array<FlowRunCardData> | undefined;\n\tsetSelectedRows: (rows: Set<string>) => void;\n\tselectedRows: Set<string>;\n};\ntype FlowRunsRowCountProps = CountOnlyProps | SelectableProps;\n\nexport const FlowRunsRowCount = ({\n\tcount = 0,\n\t...props\n}: FlowRunsRowCountProps) => {\n\t// Selectable UX\n\tif (\n\t\t\"results\" in props &&\n\t\t\"setSelectedRows\" in props &&\n\t\t\"selectedRows\" in props\n\t) {\n\t\treturn <SelectedCount count={count} {...props} />;\n\t}\n\n\t// Count only UX\n\treturn (\n\t\t<p className=\"text-sm text-muted-foreground\">\n\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t</p>\n\t);\n};\n\nfunction SelectedCount({\n\tcount = 0,\n\tresults = [],\n\tsetSelectedRows,\n\tselectedRows,\n}: SelectableProps) {\n\tconst [deleteConfirmationDialogState, confirmDelete] =\n\t\tuseDeleteFlowRunsDialog();\n\n\tconst resultsIds = useMemo(() => results.map(({ id }) => id), [results]);\n\n\tconst selectedRowsList = Array.from(selectedRows);\n\n\tconst ToggleCheckbox = () => {\n\t\tconst isAllRowsSelected = resultsIds.every((id) => selectedRows.has(id));\n\t\tconst isSomeRowsSelected = resultsIds.some((id) => selectedRows.has(id));\n\t\tlet checkedState: CheckedState = false;\n\t\tif (isAllRowsSelected) {\n\t\t\tcheckedState = true;\n\t\t} else if (isSomeRowsSelected) {\n\t\t\tcheckedState = \"indeterminate\";\n\t\t}\n\t\treturn (\n\t\t\t<Checkbox\n\t\t\t\tclassName=\"block\"\n\t\t\t\tchecked={checkedState}\n\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\tif (checked) {\n\t\t\t\t\t\tsetSelectedRows(new Set(resultsIds));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetSelectedRows(new Set());\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\taria-label=\"Toggle all\"\n\t\t\t/>\n\t\t);\n\t};\n\n\t// If has selected rows\n\tif (selectedRows.size > 0)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<ToggleCheckbox />\n\t\t\t\t\t<p className=\"text-sm text-muted-foreground\">\n\t\t\t\t\t\t{selectedRowsList.length} selected\n\t\t\t\t\t</p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Delete rows\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tconfirmDelete(selectedRowsList, () => setSelectedRows(new Set()));\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Trash2\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t<DeleteConfirmationDialog {...deleteConfirmationDialogState} />\n\t\t\t</>\n\t\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t{results && setSelectedRows && selectedRows && (\n\t\t\t\t<Checkbox\n\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\tchecked={false}\n\t\t\t\t\tonCheckedChange={(checked) => {\n\t\t\t\t\t\tsetSelectedRows(new Set(checked ? resultsIds : undefined));\n\t\t\t\t\t}}\n\t\t\t\t\taria-label=\"Toggle all\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<p className=\"text-sm text-muted-foreground\">\n\t\t\t\t{count} {pluralize(count, \"Flow run\")}\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n","import { useState } from \"react\";\n\nexport const useFlowRunsSelectedRows = (defaultValues?: Array<string>) => {\n\tconst [selectedRows, setSelectedRows] = useState<Set<string>>(\n\t\tnew Set(defaultValues),\n\t);\n\n\tconst addRow = (id: string) =>\n\t\tsetSelectedRows((curr) => new Set(curr).add(id));\n\n\tconst removeRow = (id: string) =>\n\t\tsetSelectedRows((curr) => {\n\t\t\tconst newValue = new Set(curr);\n\t\t\tnewValue.delete(id);\n\t\t\treturn newValue;\n\t\t});\n\n\tconst onSelectRow = (id: string, checked: boolean) => {\n\t\tif (checked) {\n\t\t\taddRow(id);\n\t\t} else {\n\t\t\tremoveRow(id);\n\t\t}\n\t};\n\n\tconst clearSet = () => setSelectedRows(new Set());\n\n\tconst utils = {\n\t\taddRow,\n\t\tremoveRow,\n\t\tonSelectRow,\n\t\tclearSet,\n\t};\n\n\treturn [selectedRows, setSelectedRows, utils] as const;\n};\n"],"names":["useDeleteFlowRunsDialog","dialogState","confirmDelete","useDeleteConfirmationDialog","mutateAsync","useDeleteFlowRun","handleDeletes","flowRunIds","onConfirm","res","id","numFails","numSuccess","accumulator","currentValue","toast","err","FlowRunsRowCount","count","props","jsx","SelectedCount","jsxs","pluralize","results","setSelectedRows","selectedRows","deleteConfirmationDialogState","resultsIds","useMemo","selectedRowsList","ToggleCheckbox","isAllRowsSelected","isSomeRowsSelected","checkedState","Checkbox","checked","Fragment","Button","Icon","DeleteConfirmationDialog","useFlowRunsSelectedRows","defaultValues","useState","addRow","curr","removeRow","newValue"],"mappings":"oQAIO,MAAMA,EAA0B,IAAM,CAC5C,KAAM,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAE/B,CAAE,YAAAC,CAAA,EAAgBC,EAAA,EAElBC,EAAgB,MACrBC,EACAC,EAAY,IAAM,CAAC,IACf,CACJ,GAAI,CACH,MAAMC,EAAM,MAAM,QAAQ,WACzBF,EAAW,IAAKG,GAAON,EAAYM,CAAE,CAAC,CAAA,EAEjC,CAAE,SAAAC,EAAU,WAAAC,CAAA,EAAeH,EAAI,OACpC,CAACI,EA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vC,IAAI,IAAID,CAAa,CAAA,EAGhBE,EAAUlC,GACfe,EAAiBoB,GAAS,IAAI,IAAIA,CAAI,EAAE,IAAInC,CAAE,CAAC,EAE1CoC,EAAapC,GAClBe,EAAiBoB,GAAS,CACzB,MAAME,EAAW,IAAI,IAAIF,CAAI,EAC7B,OAAAE,EAAS,OAAOrC,CAAE,EACXqC,CACR,CAAC,EAmBF,MAAO,CAACrB,EAAcD,EAPR,CACb,OAAAmB,EACA,UAAAE,EACA,YAbmB,CAACpC,EAAY0B,IAAqB,CACjDA,EACHQ,EAAOlC,CAAE,EAEToC,EAAUpC,CAAE,CAEd,EAQC,SANgB,IAAMe,EAAgB,IAAI,GAAK,CAM/C,CAG2C,CAC7C"}
@@ -1,2 +1,2 @@
1
- import{t as _,u as l}from"./vendor-tanstack-BdLtprmr.js";import{bz as k,aR as c,dA as R,dB as w}from"./index-V_xTKaEb.js";const y=a=>{const{data:t}=_(k(a)),u=t?.map(s=>s.flow_run_id).filter(s=>s!=null&&s!==void 0),o=t?.map(s=>s.task_run_id).filter(s=>s!=null&&s!==void 0),{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:u}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:o}},sort:"ID_DESC",offset:0})],combine:s=>{const[n,e]=s;return{flowRuns:n.data,taskRuns:e.data}}});return t?.map(s=>{const n=r?.find(d=>d.id===s.flow_run_id),e=i?.find(d=>d.id===s.task_run_id);return{...s,flow_run:n,task_run:e}})},D=a=>{const{data:t}=_(w(a)),u=t?.flow_run_id,o=t?.task_run_id,{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:[u??""]}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:[o??""]}},sort:"ID_DESC",offset:0})],combine:f=>{const[s,n]=f;return{flowRuns:s.data,taskRuns:n.data}}});return{...t,flow_run:r?.[0],task_run:i?.[0]}};export{D as a,y as u};
2
- //# sourceMappingURL=use-get-artifacts-flow-task-runs-BOTU5FPq.js.map
1
+ import{t as _,u as l}from"./vendor-tanstack-BdLtprmr.js";import{by as k,aQ as c,dz as R,dA as w}from"./index-CPpeVt8m.js";const m=a=>{const{data:t}=_(k(a)),u=t?.map(s=>s.flow_run_id).filter(s=>s!=null&&s!==void 0),o=t?.map(s=>s.task_run_id).filter(s=>s!=null&&s!==void 0),{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:u}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:o}},sort:"ID_DESC",offset:0})],combine:s=>{const[n,e]=s;return{flowRuns:n.data,taskRuns:e.data}}});return t?.map(s=>{const n=r?.find(d=>d.id===s.flow_run_id),e=i?.find(d=>d.id===s.task_run_id);return{...s,flow_run:n,task_run:e}})},D=a=>{const{data:t}=_(w(a)),u=t?.flow_run_id,o=t?.task_run_id,{flowRuns:r,taskRuns:i}=l({queries:[c({flow_runs:{operator:"and_",id:{any_:[u??""]}},sort:"ID_DESC",offset:0}),R({task_runs:{operator:"and_",id:{any_:[o??""]}},sort:"ID_DESC",offset:0})],combine:f=>{const[s,n]=f;return{flowRuns:s.data,taskRuns:n.data}}});return{...t,flow_run:r?.[0],task_run:i?.[0]}};export{D as a,m as u};
2
+ //# sourceMappingURL=use-get-artifacts-flow-task-runs-D7Djt53s.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-get-artifacts-flow-task-runs-BOTU5FPq.js","sources":["../../src/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs.ts"],"sourcesContent":["import { useQueries, useQuery } from \"@tanstack/react-query\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport { buildListTaskRunsQuery } from \"@/api/task-runs\";\nimport {\n\ttype ArtifactsFilter,\n\ttype ArtifactWithFlowRunAndTaskRun,\n\tbuildGetArtifactQuery,\n\tbuildListArtifactsQuery,\n} from \"..\";\n\nexport const useFilterArtifactsFlowTaskRuns = (filter: ArtifactsFilter) => {\n\tconst { data: artifacts } = useQuery(buildListArtifactsQuery(filter));\n\n\tconst flowRunIds = artifacts\n\t\t?.map((artifact) => artifact.flow_run_id)\n\t\t.filter((val) => val != null && val !== undefined);\n\tconst taskRunIds = artifacts\n\t\t?.map((artifact) => artifact.task_run_id)\n\t\t.filter((val) => val != null && val !== undefined);\n\n\tconst { flowRuns, taskRuns } = useQueries({\n\t\tqueries: [\n\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: flowRunIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t\tbuildListTaskRunsQuery({\n\t\t\t\ttask_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: taskRunIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t],\n\t\tcombine: (data) => {\n\t\t\tconst [flowRuns, taskRuns] = data;\n\t\t\treturn {\n\t\t\t\tflowRuns: flowRuns.data,\n\t\t\t\ttaskRuns: taskRuns.data,\n\t\t\t};\n\t\t},\n\t});\n\n\tconst artifactsWithMetadata = artifacts?.map((artifact) => {\n\t\tconst flowRun = flowRuns?.find(\n\t\t\t(flowRun) => flowRun.id === artifact.flow_run_id,\n\t\t);\n\t\tconst taskRun = taskRuns?.find(\n\t\t\t(taskRun) => taskRun.id === artifact.task_run_id,\n\t\t);\n\n\t\treturn {\n\t\t\t...artifact,\n\t\t\tflow_run: flowRun,\n\t\t\ttask_run: taskRun,\n\t\t};\n\t});\n\n\treturn artifactsWithMetadata as ArtifactWithFlowRunAndTaskRun[];\n};\n\nexport const useGetArtifactFlowTaskRuns = (artifactId: string) => {\n\tconst { data: artifact } = useQuery(buildGetArtifactQuery(artifactId));\n\n\tconst flowRunId = artifact?.flow_run_id;\n\tconst taskRunId = artifact?.task_run_id;\n\tconst { flowRuns, taskRuns } = useQueries({\n\t\tqueries: [\n\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [flowRunId ?? \"\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t\tbuildListTaskRunsQuery({\n\t\t\t\ttask_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [taskRunId ?? \"\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t],\n\t\tcombine: (data) => {\n\t\t\tconst [flowRuns, taskRuns] = data;\n\t\t\treturn {\n\t\t\t\tflowRuns: flowRuns.data,\n\t\t\t\ttaskRuns: taskRuns.data,\n\t\t\t};\n\t\t},\n\t});\n\n\treturn {\n\t\t...artifact,\n\t\tflow_run: flowRuns?.[0],\n\t\ttask_run: taskRuns?.[0],\n\t} as ArtifactWithFlowRunAndTaskRun;\n};\n"],"names":["useFilterArtifactsFlowTaskRuns","filter","artifacts","useQuery","buildListArtifactsQuery","flowRunIds","artifact","val","taskRunIds","flowRuns","taskRuns","useQueries","buildFilterFlowRunsQuery","buildListTaskRunsQuery","data","flowRun","taskRun","useGetArtifactFlowTaskRuns","artifactId","buildGetArtifactQuery","flowRunId","taskRunId"],"mappings":"0HAUO,MAAMA,EAAkCC,GAA4B,CAC1E,KAAM,CAAE,KAAMC,CAAA,EAAcC,EAASC,EAAwBH,CAAM,CAAC,EAE9DI,EAAaH,GAChB,IAAKI,GAAaA,EAAS,WAAW,EACvC,OAAQC,GAAQA,GAAO,MAAQA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KAAM,CAACL,EAAUC,CAAQ,EAAII,EAC7B,MAAO,CACN,SAAUL,EAAS,KACnB,SAAUC,EAAS,IAAA,CAErB,CAAA,CACA,EAED,MAAO,CACN,GAAGJ,EACH,SAAUG,IAAW,CAAC,EACtB,SAAUC,IAAW,CAAC,CAAA,CAExB"}
1
+ {"version":3,"file":"use-get-artifacts-flow-task-runs-D7Djt53s.js","sources":["../../src/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs.ts"],"sourcesContent":["import { useQueries, useQuery } from \"@tanstack/react-query\";\nimport { buildFilterFlowRunsQuery } from \"@/api/flow-runs\";\nimport { buildListTaskRunsQuery } from \"@/api/task-runs\";\nimport {\n\ttype ArtifactsFilter,\n\ttype ArtifactWithFlowRunAndTaskRun,\n\tbuildGetArtifactQuery,\n\tbuildListArtifactsQuery,\n} from \"..\";\n\nexport const useFilterArtifactsFlowTaskRuns = (filter: ArtifactsFilter) => {\n\tconst { data: artifacts } = useQuery(buildListArtifactsQuery(filter));\n\n\tconst flowRunIds = artifacts\n\t\t?.map((artifact) => artifact.flow_run_id)\n\t\t.filter((val) => val != null && val !== undefined);\n\tconst taskRunIds = artifacts\n\t\t?.map((artifact) => artifact.task_run_id)\n\t\t.filter((val) => val != null && val !== undefined);\n\n\tconst { flowRuns, taskRuns } = useQueries({\n\t\tqueries: [\n\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: flowRunIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t\tbuildListTaskRunsQuery({\n\t\t\t\ttask_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: taskRunIds,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t],\n\t\tcombine: (data) => {\n\t\t\tconst [flowRuns, taskRuns] = data;\n\t\t\treturn {\n\t\t\t\tflowRuns: flowRuns.data,\n\t\t\t\ttaskRuns: taskRuns.data,\n\t\t\t};\n\t\t},\n\t});\n\n\tconst artifactsWithMetadata = artifacts?.map((artifact) => {\n\t\tconst flowRun = flowRuns?.find(\n\t\t\t(flowRun) => flowRun.id === artifact.flow_run_id,\n\t\t);\n\t\tconst taskRun = taskRuns?.find(\n\t\t\t(taskRun) => taskRun.id === artifact.task_run_id,\n\t\t);\n\n\t\treturn {\n\t\t\t...artifact,\n\t\t\tflow_run: flowRun,\n\t\t\ttask_run: taskRun,\n\t\t};\n\t});\n\n\treturn artifactsWithMetadata as ArtifactWithFlowRunAndTaskRun[];\n};\n\nexport const useGetArtifactFlowTaskRuns = (artifactId: string) => {\n\tconst { data: artifact } = useQuery(buildGetArtifactQuery(artifactId));\n\n\tconst flowRunId = artifact?.flow_run_id;\n\tconst taskRunId = artifact?.task_run_id;\n\tconst { flowRuns, taskRuns } = useQueries({\n\t\tqueries: [\n\t\t\tbuildFilterFlowRunsQuery({\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [flowRunId ?? \"\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t\tbuildListTaskRunsQuery({\n\t\t\t\ttask_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [taskRunId ?? \"\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t],\n\t\tcombine: (data) => {\n\t\t\tconst [flowRuns, taskRuns] = data;\n\t\t\treturn {\n\t\t\t\tflowRuns: flowRuns.data,\n\t\t\t\ttaskRuns: taskRuns.data,\n\t\t\t};\n\t\t},\n\t});\n\n\treturn {\n\t\t...artifact,\n\t\tflow_run: flowRuns?.[0],\n\t\ttask_run: taskRuns?.[0],\n\t} as ArtifactWithFlowRunAndTaskRun;\n};\n"],"names":["useFilterArtifactsFlowTaskRuns","filter","artifacts","useQuery","buildListArtifactsQuery","flowRunIds","artifact","val","taskRunIds","flowRuns","taskRuns","useQueries","buildFilterFlowRunsQuery","buildListTaskRunsQuery","data","flowRun","taskRun","useGetArtifactFlowTaskRuns","artifactId","buildGetArtifactQuery","flowRunId","taskRunId"],"mappings":"0HAUO,MAAMA,EAAkCC,GAA4B,CAC1E,KAAM,CAAE,KAAMC,CAAA,EAAcC,EAASC,EAAwBH,CAAM,CAAC,EAE9DI,EAAaH,GAChB,IAAKI,GAAaA,EAAS,WAAW,EACvC,OAAQC,GAAQA,GAAO,MAAQA,IAAQ,MAAS,EAC5CC,EAAaN,GAChB,IAAKI,GAAaA,EAAS,WAAW,EACvC,OAAQC,GAAQA,GAAO,MAAQA,IAAQ,MAAS,EAE5C,CAAE,SAAAE,EAAU,SAAAC,CAAA,EAAaC,EAAW,CACzC,QAAS,CACRC,EAAyB,CACxB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAMP,CAAA,CACP,EAED,KAAM,UACN,OAAQ,CAAA,CACR,EACDQ,EAAuB,CACtB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAML,CAAA,CACP,EAED,KAAM,UACN,OAAQ,CAAA,CACR,CAAA,EAEF,QAAUM,GAAS,CAClB,KAAM,CAACL,EAAUC,CAAQ,EAAII,EAC7B,MAAO,CACN,SAAUL,EAAS,KACnB,SAAUC,EAAS,IAAA,CAErB,CAAA,CACA,EAiBD,OAf8BR,GAAW,IAAKI,GAAa,CAC1D,MAAMS,EAAUN,GAAU,KACxBM,GAAYA,EAAQ,KAAOT,EAAS,WAAA,EAEhCU,EAAUN,GAAU,KACxBM,GAAYA,EAAQ,KAAOV,EAAS,WAAA,EAGtC,MAAO,CACN,GAAGA,EACH,SAAUS,EACV,SAAUC,CAAA,CAEZ,CAAC,CAGF,EAEaC,EAA8BC,GAAuB,CACjE,KAAM,CAAE,KAAMZ,CAAA,EAAaH,EAASgB,EAAsBD,CAAU,CAAC,EAE/DE,EAAYd,GAAU,YACtBe,EAAYf,GAAU,YACtB,CAAE,SAAAG,EAAU,SAAAC,CAAA,EAAaC,EAAW,CACzC,QAAS,CACRC,EAAyB,CACxB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAM,CAACQ,GAAa,EAAE,CAAA,CACvB,EAED,KAAM,UACN,OAAQ,CAAA,CACR,EACDP,EAAuB,CACtB,UAAW,CACV,SAAU,OACV,GAAI,CACH,KAAM,CAACQ,GAAa,EAAE,CAAA,CACvB,EAED,KAAM,UACN,OAAQ,CAAA,CACR,CAAA,EAEF,QAAUP,GAAS,CAClB,KAAM,CAACL,EAAUC,CAAQ,EAAII,EAC7B,MAAO,CACN,SAAUL,EAAS,KACnB,SAAUC,EAAS,IAAA,CAErB,CAAA,CACA,EAED,MAAO,CACN,GAAGJ,EACH,SAAUG,IAAW,CAAC,EACtB,SAAUC,IAAW,CAAC,CAAA,CAExB"}
@@ -1,2 +1,2 @@
1
- import{d,j as n,L as m}from"./vendor-tanstack-BdLtprmr.js";import{cH as f,y as l,d1 as p,q as D}from"./index-V_xTKaEb.js";import{u as h}from"./use-delete-confirmation-dialog-CkL-rSsp.js";const C=()=>{const o=d(),[t,a]=h(),{deleteDeployment:r}=f();return[t,(s,{shouldNavigate:i=!1}={})=>a({title:"Delete Deployment",description:`Are you sure you want to delete ${s.name}? This action cannot be undone.`,onConfirm:()=>{r(s.id,{onSuccess:()=>{l.success("Deployment deleted"),i&&o({to:"/deployments"})},onError:c=>{const u=c.message||"Unknown error while deleting deployment.";console.error(u)}})}})]},g={state:{type:"SCHEDULED",message:"Run from the Prefect UI with defaults",state_details:{deferred:!1,untrackable_result:!1,pause_reschedule:!1}}},R=()=>{const{createDeploymentFlowRun:o,isPending:t}=p();return{onQuickRun:r=>{o({id:r,...g},{onSuccess:e=>{l.success("Flow run created",{action:n.jsx(m,{to:"/runs/flow-run/$id",params:{id:e.id},children:n.jsx(D,{size:"sm",children:"View run"})}),description:n.jsxs("p",{children:[n.jsx("span",{className:"font-bold",children:e.name})," scheduled to start"," ",n.jsx("span",{className:"font-bold",children:"now"})]})})},onError:e=>{const s=e.message||"Unknown error while creating flow run.";console.error(s)}})},isPending:t}};export{C as a,R as u};
2
- //# sourceMappingURL=use-quick-run-DzSmbSlu.js.map
1
+ import{d,j as n,L as m}from"./vendor-tanstack-BdLtprmr.js";import{cG as f,y as l,d0 as p,q as D}from"./index-CPpeVt8m.js";import{u as h}from"./use-delete-confirmation-dialog-CkL-rSsp.js";const C=()=>{const o=d(),[t,a]=h(),{deleteDeployment:r}=f();return[t,(s,{shouldNavigate:i=!1}={})=>a({title:"Delete Deployment",description:`Are you sure you want to delete ${s.name}? This action cannot be undone.`,onConfirm:()=>{r(s.id,{onSuccess:()=>{l.success("Deployment deleted"),i&&o({to:"/deployments"})},onError:c=>{const u=c.message||"Unknown error while deleting deployment.";console.error(u)}})}})]},g={state:{type:"SCHEDULED",message:"Run from the Prefect UI with defaults",state_details:{deferred:!1,untrackable_result:!1,pause_reschedule:!1}}},R=()=>{const{createDeploymentFlowRun:o,isPending:t}=p();return{onQuickRun:r=>{o({id:r,...g},{onSuccess:e=>{l.success("Flow run created",{action:n.jsx(m,{to:"/runs/flow-run/$id",params:{id:e.id},children:n.jsx(D,{size:"sm",children:"View run"})}),description:n.jsxs("p",{children:[n.jsx("span",{className:"font-bold",children:e.name})," scheduled to start"," ",n.jsx("span",{className:"font-bold",children:"now"})]})})},onError:e=>{const s=e.message||"Unknown error while creating flow run.";console.error(s)}})},isPending:t}};export{C as a,R as u};
2
+ //# sourceMappingURL=use-quick-run-Cpy0t7dX.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-quick-run-DzSmbSlu.js","sources":["../../src/components/deployments/use-delete-deployment-confirmation-dialog.ts","../../src/components/deployments/use-quick-run.tsx"],"sourcesContent":["import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { type Deployment, useDeleteDeployment } from \"@/api/deployments\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteDeploymentConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteDeployment } = useDeleteDeployment();\n\n\tconst handleConfirmDelete = (\n\t\tdeployment: Deployment,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t}: {\n\t\t\t/** Should navigate back to /deployments */\n\t\t\tshouldNavigate?: boolean;\n\t\t} = {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Deployment\",\n\t\t\tdescription: `Are you sure you want to delete ${deployment.name}? This action cannot be undone.`,\n\t\t\tonConfirm: () => {\n\t\t\t\tdeleteDeployment(deployment.id, {\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Deployment deleted\");\n\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\tvoid navigate({ to: \"/deployments\" });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while deleting deployment.\";\n\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n","import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { useDeploymentCreateFlowRun } from \"@/api/flow-runs\";\nimport { Button } from \"@/components/ui/button\";\n\nconst DEPLOYMENT_QUICK_RUN_PAYLOAD = {\n\tstate: {\n\t\ttype: \"SCHEDULED\",\n\t\tmessage: \"Run from the Prefect UI with defaults\",\n\t\tstate_details: {\n\t\t\tdeferred: false,\n\t\t\tuntrackable_result: false,\n\t\t\tpause_reschedule: false,\n\t\t},\n\t},\n} as const;\n\n/**\n *\n * @returns a function that handles the mutation and UX when a deployment creates a quick run\n */\nexport const useQuickRun = () => {\n\tconst { createDeploymentFlowRun, isPending } = useDeploymentCreateFlowRun();\n\tconst onQuickRun = (id: string) => {\n\t\tcreateDeploymentFlowRun(\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\t...DEPLOYMENT_QUICK_RUN_PAYLOAD,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: (res) => {\n\t\t\t\t\ttoast.success(\"Flow run created\", {\n\t\t\t\t\t\taction: (\n\t\t\t\t\t\t\t<Link to=\"/runs/flow-run/$id\" params={{ id: res.id }}>\n\t\t\t\t\t\t\t\t<Button size=\"sm\">View run</Button>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdescription: (\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<span className=\"font-bold\">{res.name}</span> scheduled to start{\" \"}\n\t\t\t\t\t\t\t\t<span className=\"font-bold\">now</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while creating flow run.\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn { onQuickRun, isPending };\n};\n"],"names":["useDeleteDeploymentConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteDeployment","useDeleteDeployment","deployment","shouldNavigate","toast","error","message","DEPLOYMENT_QUICK_RUN_PAYLOAD","useQuickRun","createDeploymentFlowRun","isPending","useDeploymentCreateFlowRun","id","res","jsx","Link","Button"],"mappings":"2LAKO,MAAMA,EAAwC,IAAM,CAC1D,MAAMC,EAAWC,EAA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AAMC,CAAO,CACtB,CAAA,CACD,CAEF,EAEqB,UAAAI,CAAA,CACtB"}
1
+ {"version":3,"file":"use-quick-run-Cpy0t7dX.js","sources":["../../src/components/deployments/use-delete-deployment-confirmation-dialog.ts","../../src/components/deployments/use-quick-run.tsx"],"sourcesContent":["import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { type Deployment, useDeleteDeployment } from \"@/api/deployments\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteDeploymentConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteDeployment } = useDeleteDeployment();\n\n\tconst handleConfirmDelete = (\n\t\tdeployment: Deployment,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t}: {\n\t\t\t/** Should navigate back to /deployments */\n\t\t\tshouldNavigate?: boolean;\n\t\t} = {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Deployment\",\n\t\t\tdescription: `Are you sure you want to delete ${deployment.name}? This action cannot be undone.`,\n\t\t\tonConfirm: () => {\n\t\t\t\tdeleteDeployment(deployment.id, {\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Deployment deleted\");\n\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\tvoid navigate({ to: \"/deployments\" });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while deleting deployment.\";\n\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n","import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { useDeploymentCreateFlowRun } from \"@/api/flow-runs\";\nimport { Button } from \"@/components/ui/button\";\n\nconst DEPLOYMENT_QUICK_RUN_PAYLOAD = {\n\tstate: {\n\t\ttype: \"SCHEDULED\",\n\t\tmessage: \"Run from the Prefect UI with defaults\",\n\t\tstate_details: {\n\t\t\tdeferred: false,\n\t\t\tuntrackable_result: false,\n\t\t\tpause_reschedule: false,\n\t\t},\n\t},\n} as const;\n\n/**\n *\n * @returns a function that handles the mutation and UX when a deployment creates a quick run\n */\nexport const useQuickRun = () => {\n\tconst { createDeploymentFlowRun, isPending } = useDeploymentCreateFlowRun();\n\tconst onQuickRun = (id: string) => {\n\t\tcreateDeploymentFlowRun(\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\t...DEPLOYMENT_QUICK_RUN_PAYLOAD,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: (res) => {\n\t\t\t\t\ttoast.success(\"Flow run created\", {\n\t\t\t\t\t\taction: (\n\t\t\t\t\t\t\t<Link to=\"/runs/flow-run/$id\" params={{ id: res.id }}>\n\t\t\t\t\t\t\t\t<Button size=\"sm\">View run</Button>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdescription: (\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<span className=\"font-bold\">{res.name}</span> scheduled to start{\" \"}\n\t\t\t\t\t\t\t\t<span className=\"font-bold\">now</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while creating flow run.\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn { onQuickRun, isPending };\n};\n"],"names":["useDeleteDeploymentConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteDeployment","useDeleteDeployment","deployment","shouldNavigate","toast","error","message","DEPLOYMENT_QUICK_RUN_PAYLOAD","useQuickRun","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AAA,KAAA,CAAG,CAAA,CAAA,CAChC,CAAA,CAED,CACF,EACA,QAAUT,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,yCAClB,QAAQ,MAAMC,CAAO,CACtB,CAAA,CACD,CAEF,EAEqB,UAAAI,CAAA,CACtB"}
@@ -1,2 +1,2 @@
1
- import{bL as y,a_ as k,H as C,cE as N,a2 as S,a3 as w,a4 as I,a5 as D,i as v,au as E,p as R,a7 as L,q as b}from"./index-V_xTKaEb.js";import{r as n,J as A,j as e}from"./vendor-tanstack-BdLtprmr.js";import{I as B,Z as j}from"./vendor-date-Cl1Jav-N.js";import{S as M}from"./index-DyOAqIOp.js";const O=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],W=y("rows-3",O),q=({logs:t,taskRun:s,onBottomReached:r,virtualize:o=!0,className:d})=>{const u=n.useRef(null),l=n.useRef(t);l.current=t;const g=n.useCallback(a=>l.current[a]?.id??a,[]),c=A({count:t.length,getScrollElement:()=>u.current,estimateSize:()=>90,overscan:5,getItemKey:g}),h=n.useCallback(a=>{a&&c.measureElement(a)},[c]),f=o?c.getVirtualItems():Array.from({length:t.length},(a,i)=>({index:i,size:90,start:i*90})),m=f.at(-1)?.index;n.useEffect(()=>{m!==void 0&&m>=t.length-1&&r()},[t.length,m,r]);const x=a=>{if(a===0)return!0;const i=t[a-1],p=t[a];return!B(i.timestamp,p.timestamp)};return t.length===0?e.jsx("div",{className:"flex flex-col gap-2 bg-muted p-2 rounded-md font-mono",children:e.jsx("span",{className:"text-muted-foreground",children:"No logs found"})}):e.jsx("div",{ref:u,className:k("bg-muted rounded-md font-mono p-4 overflow-y-auto",d),role:"log",children:e.jsx("ol",{className:"relative",style:{height:`${c.getTotalSize()}px`},children:f.map(a=>{const i=t[a.index],p=x(a.index);return e.jsxs("li",{"data-index":a.index,ref:h,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${a.start}px)`},children:[p&&e.jsx(V,{date:new Date(i.timestamp)}),e.jsx(F,{log:i,taskRunName:s?.name})]},i.id)})})})},F=({log:t,taskRunName:s})=>e.jsxs("div",{className:"grid grid-cols-[84px_minmax(0,1fr)_150px] gap-2 text-sm py-2",children:[e.jsx("div",{children:e.jsx(z,{level:t.level})}),e.jsx("div",{className:"select-auto whitespace-pre-wrap break-words",children:t.message}),e.jsxs("div",{className:"text-xs grid grid-cols-1 gap-1 justify-items-end text-muted-foreground truncate",children:[e.jsx("span",{children:j(t.timestamp,"pp")}),s&&e.jsx("span",{children:s}),e.jsx("span",{className:"font-bold break-all whitespace-normal",children:t.name})]})]}),_=N("gap-1",{variants:{level:{CRITICAL:"bg-red-600 text-red-50 hover:bg-red-600",ERROR:"bg-red-600 text-red-50 hover:bg-red-600",WARNING:"bg-orange-600 text-orange-50 hover:bg-orange-600",INFO:"bg-sky-600 text-blue-50 hover:bg-sky-600",DEBUG:"bg-gray-700 text-gray-50 hover:bg-gray-700",CUSTOM:"bg-gray-700 text-gray-50 hover:bg-gray-700"}}}),z=({level:t})=>{const s=U(t);return e.jsx(C,{className:_({level:s}),children:s})};function U(t){const[s]=t.toString();switch(s){case"5":return"CRITICAL";case"4":return"ERROR";case"3":return"WARNING";case"2":return"INFO";case"1":return"DEBUG";default:return"CUSTOM"}}const V=({date:t})=>e.jsxs("div",{className:"flex flex-row justify-center items-center gap-2",children:[e.jsx("div",{className:"h-[1px] w-full bg-muted-foreground/30"}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:j(t,"MMM d, yyyy")}),e.jsx("div",{className:"h-[1px] w-full bg-muted-foreground/30"})]}),J=({open:t,onOpenChange:s,currentState:r,label:o,onConfirm:d,isLoading:u=!1})=>{const[l,g]=n.useState(void 0),[c,h]=n.useState("");n.useEffect(()=>{t||(g(void 0),h(""))},[t]);const f=()=>{l&&d({type:l,message:c||void 0})},m=!l||u;return e.jsx(S,{open:t,onOpenChange:s,children:e.jsxs(w,{"aria-describedby":void 0,children:[e.jsx(I,{children:e.jsxs(D,{children:["Change ",o," State"]})}),e.jsxs("div",{className:"space-y-4",children:[r&&e.jsxs("div",{children:[e.jsx(v,{className:"mb-2 block",children:"Current State"}),e.jsx(E,{type:r.type,name:r.name})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"desired-state",className:"mb-2 block",children:"Desired State"}),e.jsx(M,{value:l,onValueChange:g,terminalOnly:!0})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"message",className:"mb-2 block",children:"Reason (Optional)"}),e.jsx(R,{id:"message",value:c,onChange:x=>h(x.target.value),placeholder:"State changed manually via UI"})]})]}),e.jsxs(L,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:u,children:"Close"}),e.jsx(b,{type:"button",onClick:f,disabled:m,loading:u,children:"Change"})]})]})})},K=()=>{const[t,s]=n.useState(!1),r=n.useCallback(()=>s(!0),[]),o=n.useCallback(()=>s(!1),[]);return{open:t,onOpenChange:s,openDialog:r,closeDialog:o}};function G(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"no-preference"}function Y(t){n.useEffect(()=>{const s=G(),r=s==="dark"?document.getElementById("favicon-16-dark"):document.getElementById("favicon-16"),o=s==="dark"?document.getElementById("favicon-32-dark"):document.getElementById("favicon-32");if(t){const d=`/${t.toLowerCase()}.svg`;r?.setAttribute("href",d),o?.setAttribute("href",d)}return()=>{s==="dark"?(r?.setAttribute("href","/favicon-16x16-dark.png"),o?.setAttribute("href","/favicon-32x32-dark.png")):(r?.setAttribute("href","/favicon-16x16.png"),o?.setAttribute("href","/favicon-32x32.png"))}},[t])}export{J as C,W as R,q as a,K as b,Y as u};
2
- //# sourceMappingURL=use-state-favicon-UFxhmhHr.js.map
1
+ import{bK as y,aZ as k,H as C,cD as N,a2 as S,a3 as w,a4 as I,a5 as D,i as v,at as R,p as E,a7 as L,q as b}from"./index-CPpeVt8m.js";import{r as n,J as A,j as e}from"./vendor-tanstack-BdLtprmr.js";import{I as B,Z as j}from"./vendor-date-Cl1Jav-N.js";import{S as M}from"./index-C63VUjOh.js";const O=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],P=y("rows-3",O),W=({logs:t,taskRun:s,onBottomReached:r,virtualize:o=!0,className:d})=>{const u=n.useRef(null),l=n.useRef(t);l.current=t;const g=n.useCallback(a=>l.current[a]?.id??a,[]),c=A({count:t.length,getScrollElement:()=>u.current,estimateSize:()=>90,overscan:5,getItemKey:g}),h=n.useCallback(a=>{a&&c.measureElement(a)},[c]),f=o?c.getVirtualItems():Array.from({length:t.length},(a,i)=>({index:i,size:90,start:i*90})),m=f.at(-1)?.index;n.useEffect(()=>{m!==void 0&&m>=t.length-1&&r()},[t.length,m,r]);const x=a=>{if(a===0)return!0;const i=t[a-1],p=t[a];return!B(i.timestamp,p.timestamp)};return t.length===0?e.jsx("div",{className:"flex flex-col gap-2 bg-muted p-2 rounded-md font-mono",children:e.jsx("span",{className:"text-muted-foreground",children:"No logs found"})}):e.jsx("div",{ref:u,className:k("bg-muted rounded-md font-mono p-4 overflow-y-auto",d),role:"log",children:e.jsx("ol",{className:"relative",style:{height:`${c.getTotalSize()}px`},children:f.map(a=>{const i=t[a.index],p=x(a.index);return e.jsxs("li",{"data-index":a.index,ref:h,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${a.start}px)`},children:[p&&e.jsx(_,{date:new Date(i.timestamp)}),e.jsx(F,{log:i,taskRunName:s?.name})]},i.id)})})})},F=({log:t,taskRunName:s})=>e.jsxs("div",{className:"grid grid-cols-[84px_minmax(0,1fr)_150px] gap-2 text-sm py-2",children:[e.jsx("div",{children:e.jsx(U,{level:t.level})}),e.jsx("div",{className:"select-auto whitespace-pre-wrap break-words",children:t.message}),e.jsxs("div",{className:"text-xs grid grid-cols-1 gap-1 justify-items-end text-muted-foreground truncate",children:[e.jsx("span",{children:j(t.timestamp,"pp")}),s&&e.jsx("span",{children:s}),e.jsx("span",{className:"font-bold break-all whitespace-normal",children:t.name})]})]}),z=N("gap-1",{variants:{level:{CRITICAL:"bg-red-600 text-red-50 hover:bg-red-600",ERROR:"bg-red-600 text-red-50 hover:bg-red-600",WARNING:"bg-orange-600 text-orange-50 hover:bg-orange-600",INFO:"bg-sky-600 text-blue-50 hover:bg-sky-600",DEBUG:"bg-gray-700 text-gray-50 hover:bg-gray-700",CUSTOM:"bg-gray-700 text-gray-50 hover:bg-gray-700"}}}),U=({level:t})=>{const s=V(t);return e.jsx(C,{className:z({level:s}),children:s})};function V(t){const[s]=t.toString();switch(s){case"5":return"CRITICAL";case"4":return"ERROR";case"3":return"WARNING";case"2":return"INFO";case"1":return"DEBUG";default:return"CUSTOM"}}const _=({date:t})=>e.jsxs("div",{className:"flex flex-row justify-center items-center gap-2",children:[e.jsx("div",{className:"h-[1px] w-full bg-muted-foreground/30"}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:j(t,"MMM d, yyyy")}),e.jsx("div",{className:"h-[1px] w-full bg-muted-foreground/30"})]}),Z=({open:t,onOpenChange:s,currentState:r,label:o,onConfirm:d,isLoading:u=!1})=>{const[l,g]=n.useState(void 0),[c,h]=n.useState("");n.useEffect(()=>{t||(g(void 0),h(""))},[t]);const f=()=>{l&&d({type:l,message:c||void 0})},m=!l||u;return e.jsx(S,{open:t,onOpenChange:s,children:e.jsxs(w,{"aria-describedby":void 0,children:[e.jsx(I,{children:e.jsxs(D,{children:["Change ",o," State"]})}),e.jsxs("div",{className:"space-y-4",children:[r&&e.jsxs("div",{children:[e.jsx(v,{className:"mb-2 block",children:"Current State"}),e.jsx(R,{type:r.type,name:r.name})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"desired-state",className:"mb-2 block",children:"Desired State"}),e.jsx(M,{value:l,onValueChange:g,terminalOnly:!0})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"message",className:"mb-2 block",children:"Reason (Optional)"}),e.jsx(E,{id:"message",value:c,onChange:x=>h(x.target.value),placeholder:"State changed manually via UI"})]})]}),e.jsxs(L,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:u,children:"Close"}),e.jsx(b,{type:"button",onClick:f,disabled:m,loading:u,children:"Change"})]})]})})},q=()=>{const[t,s]=n.useState(!1),r=n.useCallback(()=>s(!0),[]),o=n.useCallback(()=>s(!1),[]);return{open:t,onOpenChange:s,openDialog:r,closeDialog:o}};function G(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"no-preference"}function J(t){n.useEffect(()=>{const s=G(),r=s==="dark"?document.getElementById("favicon-16-dark"):document.getElementById("favicon-16"),o=s==="dark"?document.getElementById("favicon-32-dark"):document.getElementById("favicon-32");if(t){const d=`/${t.toLowerCase()}.svg`;r?.setAttribute("href",d),o?.setAttribute("href",d)}return()=>{s==="dark"?(r?.setAttribute("href","/favicon-16x16-dark.png"),o?.setAttribute("href","/favicon-32x32-dark.png")):(r?.setAttribute("href","/favicon-16x16.png"),o?.setAttribute("href","/favicon-32x32.png"))}},[t])}export{Z as C,P as R,W as a,q as b,J as u};
2
+ //# sourceMappingURL=use-state-favicon-CMsL9s6j.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-state-favicon-UFxhmhHr.js","sources":["../../node_modules/lucide-react/dist/esm/icons/rows-3.js","../../src/components/ui/run-logs/index.tsx","../../src/components/ui/change-state-dialog/index.tsx","../../src/hooks/use-state-favicon.ts"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M21 9H3\", key: \"1338ky\" }],\n [\"path\", { d: \"M21 15H3\", key: \"9uk58r\" }]\n];\nconst Rows3 = createLucideIcon(\"rows-3\", __iconNode);\n\nexport { __iconNode, Rows3 as default };\n//# sourceMappingURL=rows-3.js.map\n","import { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { cva } from \"class-variance-authority\";\nimport { isSameDay } from \"date-fns\";\nimport { format } from \"date-fns-tz\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/utils\";\n\ntype RunLogsProps = {\n\tlogs: components[\"schemas\"][\"Log\"][];\n\ttaskRun?: components[\"schemas\"][\"TaskRun\"];\n\tonBottomReached: () => void;\n\tvirtualize?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Displays logs from a run in a virtualized list.\n *\n * @param logs - Array of log entries to display\n * @param taskRun - Optional task run information to display with logs\n * @param onBottomReached - Callback function triggered when the user scrolls to the bottom of the logs\n *\n */\nexport const RunLogs = ({\n\tlogs,\n\ttaskRun,\n\tonBottomReached,\n\tvirtualize = true,\n\tclassName,\n}: RunLogsProps) => {\n\tconst parentRef = useRef<HTMLDivElement>(null);\n\n\t// Use a ref to store logs for stable getItemKey callback\n\tconst logsRef = useRef(logs);\n\tlogsRef.current = logs;\n\n\tconst getItemKey = useCallback(\n\t\t(index: number) => logsRef.current[index]?.id ?? index,\n\t\t[],\n\t);\n\n\tconst virtualizer = useVirtualizer({\n\t\tcount: logs.length,\n\t\tgetScrollElement: () => parentRef.current,\n\t\testimateSize: () => 90,\n\t\toverscan: 5,\n\t\tgetItemKey,\n\t});\n\n\t// Wrap measureElement in a stable callback to prevent infinite re-renders\n\tconst measureElement = useCallback(\n\t\t(el: HTMLElement | null) => {\n\t\t\tif (el) {\n\t\t\t\tvirtualizer.measureElement(el);\n\t\t\t}\n\t\t},\n\t\t[virtualizer],\n\t);\n\n\tconst virtualItems = virtualize\n\t\t? virtualizer.getVirtualItems()\n\t\t: Array.from({ length: logs.length }, (_, i) => ({\n\t\t\t\tindex: i,\n\t\t\t\tsize: 90,\n\t\t\t\tstart: i * 90,\n\t\t\t}));\n\n\t// Get the last visible item index for stable effect dependency\n\tconst lastVisibleIndex = virtualItems.at(-1)?.index;\n\n\t/**\n\t * This effect detects when the user has scrolled to the bottom of the logs.\n\t * It works by checking if the last visible virtual item is also the last item in the logs array.\n\t * When this condition is met, it calls the bottomReached callback to potentially load more logs.\n\t */\n\tuseEffect(() => {\n\t\tif (lastVisibleIndex === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastVisibleIndex >= logs.length - 1) {\n\t\t\tonBottomReached();\n\t\t}\n\t}, [logs.length, lastVisibleIndex, onBottomReached]);\n\n\tconst showDivider = (index: number): boolean => {\n\t\tif (index === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst previous = logs[index - 1];\n\t\tconst current = logs[index];\n\n\t\treturn !isSameDay(previous.timestamp, current.timestamp);\n\t};\n\n\tif (logs.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"flex flex-col gap-2 bg-muted p-2 rounded-md font-mono\">\n\t\t\t\t<span className=\"text-muted-foreground\">No logs found</span>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={parentRef}\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-muted rounded-md font-mono p-4 overflow-y-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\trole=\"log\"\n\t\t>\n\t\t\t<ol\n\t\t\t\tclassName=\"relative\"\n\t\t\t\tstyle={{\n\t\t\t\t\theight: `${virtualizer.getTotalSize()}px`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{virtualItems.map((virtualRow) => {\n\t\t\t\t\tconst log = logs[virtualRow.index];\n\t\t\t\t\tconst shouldShowDivider = showDivider(virtualRow.index);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={log.id}\n\t\t\t\t\t\t\tdata-index={virtualRow.index}\n\t\t\t\t\t\t\tref={measureElement}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\ttransform: `translateY(${virtualRow.start}px)`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{shouldShowDivider && (\n\t\t\t\t\t\t\t\t<LogDivider date={new Date(log.timestamp)} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<RunLogRow log={log} taskRunName={taskRun?.name} />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\t\t</div>\n\t);\n};\n\ntype RunLogRowProps = {\n\tlog: components[\"schemas\"][\"Log\"];\n\ttaskRunName?: string;\n};\n\nconst RunLogRow = ({ log, taskRunName }: RunLogRowProps) => {\n\treturn (\n\t\t<div className=\"grid grid-cols-[84px_minmax(0,1fr)_150px] gap-2 text-sm py-2\">\n\t\t\t<div>\n\t\t\t\t<LogLevelBadge level={log.level} />\n\t\t\t</div>\n\t\t\t<div className=\"select-auto whitespace-pre-wrap break-words\">\n\t\t\t\t{log.message}\n\t\t\t</div>\n\t\t\t<div className=\"text-xs grid grid-cols-1 gap-1 justify-items-end text-muted-foreground truncate\">\n\t\t\t\t<span>{format(log.timestamp, \"pp\")}</span>\n\t\t\t\t{taskRunName && <span>{taskRunName}</span>}\n\t\t\t\t<span className=\"font-bold break-all whitespace-normal\">\n\t\t\t\t\t{log.name}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst logLevelBadgeVariants = cva(\"gap-1\", {\n\tvariants: {\n\t\tlevel: {\n\t\t\tCRITICAL: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tERROR: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tWARNING: \"bg-orange-600 text-orange-50 hover:bg-orange-600\",\n\t\t\tINFO: \"bg-sky-600 text-blue-50 hover:bg-sky-600\",\n\t\t\tDEBUG: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t\tCUSTOM: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t} satisfies Record<LogLevel, string>,\n\t},\n});\n\nexport const LogLevelBadge = ({ level }: { level: number }) => {\n\tconst levelLabel = logLevelLabel(level);\n\treturn (\n\t\t<Badge className={logLevelBadgeVariants({ level: levelLabel })}>\n\t\t\t{levelLabel}\n\t\t</Badge>\n\t);\n};\n\ntype LogLevel = \"CRITICAL\" | \"ERROR\" | \"WARNING\" | \"INFO\" | \"DEBUG\" | \"CUSTOM\";\n\nfunction logLevelLabel(level: number): LogLevel {\n\tconst [first] = level.toString();\n\n\tswitch (first) {\n\t\tcase \"5\":\n\t\t\treturn \"CRITICAL\";\n\t\tcase \"4\":\n\t\t\treturn \"ERROR\";\n\t\tcase \"3\":\n\t\t\treturn \"WARNING\";\n\t\tcase \"2\":\n\t\t\treturn \"INFO\";\n\t\tcase \"1\":\n\t\t\treturn \"DEBUG\";\n\t\tdefault:\n\t\t\treturn \"CUSTOM\";\n\t}\n}\n\nconst LogDivider = ({ date }: { date: Date }) => {\n\treturn (\n\t\t<div className=\"flex flex-row justify-center items-center gap-2\">\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t\t<span className=\"text-xs text-muted-foreground whitespace-nowrap\">\n\t\t\t\t{format(date, \"MMM d, yyyy\")}\n\t\t\t</span>\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t</div>\n\t);\n};\n","import { useCallback, useEffect, useState } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n} from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { StateSelect } from \"@/components/ui/state-select\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\nexport type ChangeStateDialogProps = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tcurrentState: { type: string; name: string } | null;\n\tlabel: string;\n\tonConfirm: (newState: { type: string; message?: string }) => void;\n\tisLoading?: boolean;\n};\n\nexport const ChangeStateDialog = ({\n\topen,\n\tonOpenChange,\n\tcurrentState,\n\tlabel,\n\tonConfirm,\n\tisLoading = false,\n}: ChangeStateDialogProps) => {\n\tconst [selectedState, setSelectedState] = useState<StateType | undefined>(\n\t\tundefined,\n\t);\n\tconst [message, setMessage] = useState(\"\");\n\n\tuseEffect(() => {\n\t\tif (!open) {\n\t\t\tsetSelectedState(undefined);\n\t\t\tsetMessage(\"\");\n\t\t}\n\t}, [open]);\n\n\tconst handleConfirm = () => {\n\t\tif (selectedState) {\n\t\t\tonConfirm({\n\t\t\t\ttype: selectedState,\n\t\t\t\tmessage: message || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\tconst isConfirmDisabled = !selectedState || isLoading;\n\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Change {label} State</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<div className=\"space-y-4\">\n\t\t\t\t\t{currentState && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Label className=\"mb-2 block\">Current State</Label>\n\t\t\t\t\t\t\t<StateBadge\n\t\t\t\t\t\t\t\ttype={currentState.type as StateType}\n\t\t\t\t\t\t\t\tname={currentState.name}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"desired-state\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tDesired State\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<StateSelect\n\t\t\t\t\t\t\tvalue={selectedState}\n\t\t\t\t\t\t\tonValueChange={setSelectedState}\n\t\t\t\t\t\t\tterminalOnly\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"message\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tReason (Optional)\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tid=\"message\"\n\t\t\t\t\t\t\tvalue={message}\n\t\t\t\t\t\t\tonChange={(e) => setMessage(e.target.value)}\n\t\t\t\t\t\t\tplaceholder=\"State changed manually via UI\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => onOpenChange(false)}\n\t\t\t\t\t\tdisabled={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tClose\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleConfirm}\n\t\t\t\t\t\tdisabled={isConfirmDisabled}\n\t\t\t\t\t\tloading={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tChange\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\nexport type UseChangeStateDialogResult = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\topenDialog: () => void;\n\tcloseDialog: () => void;\n};\n\nexport const useChangeStateDialog = (): UseChangeStateDialogResult => {\n\tconst [open, setOpen] = useState(false);\n\n\tconst openDialog = useCallback(() => setOpen(true), []);\n\tconst closeDialog = useCallback(() => setOpen(false), []);\n\n\treturn {\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\topenDialog,\n\t\tcloseDialog,\n\t};\n};\n","import { useEffect } from \"react\";\n\ntype StateType =\n\t| \"SCHEDULED\"\n\t| \"PENDING\"\n\t| \"RUNNING\"\n\t| \"COMPLETED\"\n\t| \"FAILED\"\n\t| \"CANCELLED\"\n\t| \"CANCELLING\"\n\t| \"CRASHED\"\n\t| \"PAUSED\";\n\nfunction getPreferredColorScheme(): \"dark\" | \"light\" | \"no-preference\" {\n\tif (window.matchMedia(\"(prefers-color-scheme: dark)\").matches) {\n\t\treturn \"dark\";\n\t}\n\tif (window.matchMedia(\"(prefers-color-scheme: light)\").matches) {\n\t\treturn \"light\";\n\t}\n\treturn \"no-preference\";\n}\n\n/**\n * A hook that sets the browser favicon based on the provided state type.\n * Resets the favicon to the default when the component unmounts.\n *\n * @param stateType - The state type to display in the favicon (e.g., \"COMPLETED\", \"FAILED\")\n * @returns void\n *\n * @example\n * ```tsx\n * // Set favicon based on task run state\n * useStateFavicon(taskRun.state_type);\n * ```\n */\nexport function useStateFavicon(stateType: StateType | null | undefined): void {\n\tuseEffect(() => {\n\t\tconst colorScheme = getPreferredColorScheme();\n\t\tconst favicon16 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-16-dark\")\n\t\t\t\t: document.getElementById(\"favicon-16\");\n\t\tconst favicon32 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-32-dark\")\n\t\t\t\t: document.getElementById(\"favicon-32\");\n\n\t\tif (stateType) {\n\t\t\tconst faviconPath = `/${stateType.toLowerCase()}.svg`;\n\t\t\tfavicon16?.setAttribute(\"href\", faviconPath);\n\t\t\tfavicon32?.setAttribute(\"href\", faviconPath);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Reset to default favicon on unmount\n\t\t\tif (colorScheme === \"dark\") {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16-dark.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32-dark.png\");\n\t\t\t} else {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32.png\");\n\t\t\t}\n\t\t};\n\t}, [stateType]);\n}\n"],"names":["__iconNode","Rows3","createLucideIcon","RunLogs","logs","taskRun","onBottomReached","virtualize","className","parentRef","useRef","logsRef","getItemKey","useCallback","index","virtualizer","useVirtualizer","measureElement","el","virtualItems","_","lastVisibleIndex","useEffect","showDivider","previous","current","isSameDay","jsx","cn","virtualRow","log","shouldShowDivider","jsxs","LogDivider","RunLogRow","taskRunName","LogLevelBadge","format","logLevelBadgeVariants","cva","level","levelLabel","logLevelLabel","Badge","first","date","ChangeStateDialog","open","onOpenChange","currentState","label","onConfirm","isLoading","selectedState","setSelectedState","useState","message","setMessage","handleConfirm","isConfirmDisabled","Dialog","DialogContent","DialogHeader","DialogTitle","Label","StateBadge","StateSelect","Input","e","DialogFooter","Button","useChangeStateDialog","setOpen","openDialog","closeDialog","getPreferredColorScheme","useStateFavicon","stateType","colorScheme","favicon16","favicon32","faviconPath"],"mappings":"kSASA,MAAMA,EAAa,CACjB,CAAC,OAAQ,CAAE,MAAO,KAAM,OAAQ,KAAM,EAAG,IAAK,EAAG,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC9E,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAQ,CAAE,CAC3C,EACMC,EAAQC,EAAiB,SAAUF,CAAU,ECWtCG,EAAU,CAAC,CACvB,KAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,WAAAC,EAAa,GACb,UAAAC,CACD,IAAoB,CACnB,MAAMC,EAAYC,EAAAA,OAAuB,IAAI,EAGvC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,GAA8D,CACtE,OAAI,OAAO,WAAW,8BAA8B,EAAE,QAC9C,OAEJ,OAAO,WAAW,+BAA+B,EAAE,QAC/C,QAED,eACR,CAeO,SAASC,EAAgBC,EAA+C,CAC9EvD,EAAAA,UAAU,IAAM,CACf,MAAMwD,EAAcH,EAAA,EACdI,EACLD,IAAgB,OACb,SAAS,eAAe,iBAAiB,EACzC,SAAS,eAAe,YAAY,EAClCE,EACLF,IAAgB,OACb,SAAS,eAAe,iBAAiB,EACzC,SAAS,eAAe,YAAY,EAExC,GAAID,EAAW,CACd,MAAMI,EAAc,IAAIJ,EAAU,YAAA,CAAa,OAC/CE,GAAW,aAAa,OAAQE,CAAW,EAC3CD,GAAW,aAAa,OAAQC,CAAW,CAC5C,CAEA,MAAO,IAAM,CAERH,IAAgB,QACnBC,GAAW,aAAa,OAAQ,yBAAyB,EACzDC,GAAW,aAAa,OAAQ,yBAAyB,IAEzDD,GAAW,aAAa,OAAQ,oBAAoB,EACpDC,GAAW,aAAa,OAAQ,oBAAoB,EAEtD,CACD,EAAG,CAACH,CAAS,CAAC,CACf","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"use-state-favicon-CMsL9s6j.js","sources":["../../node_modules/lucide-react/dist/esm/icons/rows-3.js","../../src/components/ui/run-logs/index.tsx","../../src/components/ui/change-state-dialog/index.tsx","../../src/hooks/use-state-favicon.ts"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }],\n [\"path\", { d: \"M21 9H3\", key: \"1338ky\" }],\n [\"path\", { d: \"M21 15H3\", key: \"9uk58r\" }]\n];\nconst Rows3 = createLucideIcon(\"rows-3\", __iconNode);\n\nexport { __iconNode, Rows3 as default };\n//# sourceMappingURL=rows-3.js.map\n","import { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { cva } from \"class-variance-authority\";\nimport { isSameDay } from \"date-fns\";\nimport { format } from \"date-fns-tz\";\nimport { useCallback, useEffect, useRef } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/utils\";\n\ntype RunLogsProps = {\n\tlogs: components[\"schemas\"][\"Log\"][];\n\ttaskRun?: components[\"schemas\"][\"TaskRun\"];\n\tonBottomReached: () => void;\n\tvirtualize?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Displays logs from a run in a virtualized list.\n *\n * @param logs - Array of log entries to display\n * @param taskRun - Optional task run information to display with logs\n * @param onBottomReached - Callback function triggered when the user scrolls to the bottom of the logs\n *\n */\nexport const RunLogs = ({\n\tlogs,\n\ttaskRun,\n\tonBottomReached,\n\tvirtualize = true,\n\tclassName,\n}: RunLogsProps) => {\n\tconst parentRef = useRef<HTMLDivElement>(null);\n\n\t// Use a ref to store logs for stable getItemKey callback\n\tconst logsRef = useRef(logs);\n\tlogsRef.current = logs;\n\n\tconst getItemKey = useCallback(\n\t\t(index: number) => logsRef.current[index]?.id ?? index,\n\t\t[],\n\t);\n\n\tconst virtualizer = useVirtualizer({\n\t\tcount: logs.length,\n\t\tgetScrollElement: () => parentRef.current,\n\t\testimateSize: () => 90,\n\t\toverscan: 5,\n\t\tgetItemKey,\n\t});\n\n\t// Wrap measureElement in a stable callback to prevent infinite re-renders\n\tconst measureElement = useCallback(\n\t\t(el: HTMLElement | null) => {\n\t\t\tif (el) {\n\t\t\t\tvirtualizer.measureElement(el);\n\t\t\t}\n\t\t},\n\t\t[virtualizer],\n\t);\n\n\tconst virtualItems = virtualize\n\t\t? virtualizer.getVirtualItems()\n\t\t: Array.from({ length: logs.length }, (_, i) => ({\n\t\t\t\tindex: i,\n\t\t\t\tsize: 90,\n\t\t\t\tstart: i * 90,\n\t\t\t}));\n\n\t// Get the last visible item index for stable effect dependency\n\tconst lastVisibleIndex = virtualItems.at(-1)?.index;\n\n\t/**\n\t * This effect detects when the user has scrolled to the bottom of the logs.\n\t * It works by checking if the last visible virtual item is also the last item in the logs array.\n\t * When this condition is met, it calls the bottomReached callback to potentially load more logs.\n\t */\n\tuseEffect(() => {\n\t\tif (lastVisibleIndex === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastVisibleIndex >= logs.length - 1) {\n\t\t\tonBottomReached();\n\t\t}\n\t}, [logs.length, lastVisibleIndex, onBottomReached]);\n\n\tconst showDivider = (index: number): boolean => {\n\t\tif (index === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst previous = logs[index - 1];\n\t\tconst current = logs[index];\n\n\t\treturn !isSameDay(previous.timestamp, current.timestamp);\n\t};\n\n\tif (logs.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"flex flex-col gap-2 bg-muted p-2 rounded-md font-mono\">\n\t\t\t\t<span className=\"text-muted-foreground\">No logs found</span>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={parentRef}\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-muted rounded-md font-mono p-4 overflow-y-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\trole=\"log\"\n\t\t>\n\t\t\t<ol\n\t\t\t\tclassName=\"relative\"\n\t\t\t\tstyle={{\n\t\t\t\t\theight: `${virtualizer.getTotalSize()}px`,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{virtualItems.map((virtualRow) => {\n\t\t\t\t\tconst log = logs[virtualRow.index];\n\t\t\t\t\tconst shouldShowDivider = showDivider(virtualRow.index);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={log.id}\n\t\t\t\t\t\t\tdata-index={virtualRow.index}\n\t\t\t\t\t\t\tref={measureElement}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\ttransform: `translateY(${virtualRow.start}px)`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{shouldShowDivider && (\n\t\t\t\t\t\t\t\t<LogDivider date={new Date(log.timestamp)} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<RunLogRow log={log} taskRunName={taskRun?.name} />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\t\t</div>\n\t);\n};\n\ntype RunLogRowProps = {\n\tlog: components[\"schemas\"][\"Log\"];\n\ttaskRunName?: string;\n};\n\nconst RunLogRow = ({ log, taskRunName }: RunLogRowProps) => {\n\treturn (\n\t\t<div className=\"grid grid-cols-[84px_minmax(0,1fr)_150px] gap-2 text-sm py-2\">\n\t\t\t<div>\n\t\t\t\t<LogLevelBadge level={log.level} />\n\t\t\t</div>\n\t\t\t<div className=\"select-auto whitespace-pre-wrap break-words\">\n\t\t\t\t{log.message}\n\t\t\t</div>\n\t\t\t<div className=\"text-xs grid grid-cols-1 gap-1 justify-items-end text-muted-foreground truncate\">\n\t\t\t\t<span>{format(log.timestamp, \"pp\")}</span>\n\t\t\t\t{taskRunName && <span>{taskRunName}</span>}\n\t\t\t\t<span className=\"font-bold break-all whitespace-normal\">\n\t\t\t\t\t{log.name}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst logLevelBadgeVariants = cva(\"gap-1\", {\n\tvariants: {\n\t\tlevel: {\n\t\t\tCRITICAL: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tERROR: \"bg-red-600 text-red-50 hover:bg-red-600\",\n\t\t\tWARNING: \"bg-orange-600 text-orange-50 hover:bg-orange-600\",\n\t\t\tINFO: \"bg-sky-600 text-blue-50 hover:bg-sky-600\",\n\t\t\tDEBUG: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t\tCUSTOM: \"bg-gray-700 text-gray-50 hover:bg-gray-700\",\n\t\t} satisfies Record<LogLevel, string>,\n\t},\n});\n\nexport const LogLevelBadge = ({ level }: { level: number }) => {\n\tconst levelLabel = logLevelLabel(level);\n\treturn (\n\t\t<Badge className={logLevelBadgeVariants({ level: levelLabel })}>\n\t\t\t{levelLabel}\n\t\t</Badge>\n\t);\n};\n\ntype LogLevel = \"CRITICAL\" | \"ERROR\" | \"WARNING\" | \"INFO\" | \"DEBUG\" | \"CUSTOM\";\n\nfunction logLevelLabel(level: number): LogLevel {\n\tconst [first] = level.toString();\n\n\tswitch (first) {\n\t\tcase \"5\":\n\t\t\treturn \"CRITICAL\";\n\t\tcase \"4\":\n\t\t\treturn \"ERROR\";\n\t\tcase \"3\":\n\t\t\treturn \"WARNING\";\n\t\tcase \"2\":\n\t\t\treturn \"INFO\";\n\t\tcase \"1\":\n\t\t\treturn \"DEBUG\";\n\t\tdefault:\n\t\t\treturn \"CUSTOM\";\n\t}\n}\n\nconst LogDivider = ({ date }: { date: Date }) => {\n\treturn (\n\t\t<div className=\"flex flex-row justify-center items-center gap-2\">\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t\t<span className=\"text-xs text-muted-foreground whitespace-nowrap\">\n\t\t\t\t{format(date, \"MMM d, yyyy\")}\n\t\t\t</span>\n\t\t\t<div className=\"h-[1px] w-full bg-muted-foreground/30\" />\n\t\t</div>\n\t);\n};\n","import { useCallback, useEffect, useState } from \"react\";\nimport type { components } from \"@/api/prefect\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n} from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { StateSelect } from \"@/components/ui/state-select\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\nexport type ChangeStateDialogProps = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tcurrentState: { type: string; name: string } | null;\n\tlabel: string;\n\tonConfirm: (newState: { type: string; message?: string }) => void;\n\tisLoading?: boolean;\n};\n\nexport const ChangeStateDialog = ({\n\topen,\n\tonOpenChange,\n\tcurrentState,\n\tlabel,\n\tonConfirm,\n\tisLoading = false,\n}: ChangeStateDialogProps) => {\n\tconst [selectedState, setSelectedState] = useState<StateType | undefined>(\n\t\tundefined,\n\t);\n\tconst [message, setMessage] = useState(\"\");\n\n\tuseEffect(() => {\n\t\tif (!open) {\n\t\t\tsetSelectedState(undefined);\n\t\t\tsetMessage(\"\");\n\t\t}\n\t}, [open]);\n\n\tconst handleConfirm = () => {\n\t\tif (selectedState) {\n\t\t\tonConfirm({\n\t\t\t\ttype: selectedState,\n\t\t\t\tmessage: message || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\tconst isConfirmDisabled = !selectedState || isLoading;\n\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Change {label} State</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<div className=\"space-y-4\">\n\t\t\t\t\t{currentState && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Label className=\"mb-2 block\">Current State</Label>\n\t\t\t\t\t\t\t<StateBadge\n\t\t\t\t\t\t\t\ttype={currentState.type as StateType}\n\t\t\t\t\t\t\t\tname={currentState.name}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"desired-state\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tDesired State\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<StateSelect\n\t\t\t\t\t\t\tvalue={selectedState}\n\t\t\t\t\t\t\tonValueChange={setSelectedState}\n\t\t\t\t\t\t\tterminalOnly\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Label htmlFor=\"message\" className=\"mb-2 block\">\n\t\t\t\t\t\t\tReason (Optional)\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tid=\"message\"\n\t\t\t\t\t\t\tvalue={message}\n\t\t\t\t\t\t\tonChange={(e) => setMessage(e.target.value)}\n\t\t\t\t\t\t\tplaceholder=\"State changed manually via UI\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => onOpenChange(false)}\n\t\t\t\t\t\tdisabled={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tClose\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleConfirm}\n\t\t\t\t\t\tdisabled={isConfirmDisabled}\n\t\t\t\t\t\tloading={isLoading}\n\t\t\t\t\t>\n\t\t\t\t\t\tChange\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\nexport type UseChangeStateDialogResult = {\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\topenDialog: () => void;\n\tcloseDialog: () => void;\n};\n\nexport const useChangeStateDialog = (): UseChangeStateDialogResult => {\n\tconst [open, setOpen] = useState(false);\n\n\tconst openDialog = useCallback(() => setOpen(true), []);\n\tconst closeDialog = useCallback(() => setOpen(false), []);\n\n\treturn {\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\topenDialog,\n\t\tcloseDialog,\n\t};\n};\n","import { useEffect } from \"react\";\n\ntype StateType =\n\t| \"SCHEDULED\"\n\t| \"PENDING\"\n\t| \"RUNNING\"\n\t| \"COMPLETED\"\n\t| \"FAILED\"\n\t| \"CANCELLED\"\n\t| \"CANCELLING\"\n\t| \"CRASHED\"\n\t| \"PAUSED\";\n\nfunction getPreferredColorScheme(): \"dark\" | \"light\" | \"no-preference\" {\n\tif (window.matchMedia(\"(prefers-color-scheme: dark)\").matches) {\n\t\treturn \"dark\";\n\t}\n\tif (window.matchMedia(\"(prefers-color-scheme: light)\").matches) {\n\t\treturn \"light\";\n\t}\n\treturn \"no-preference\";\n}\n\n/**\n * A hook that sets the browser favicon based on the provided state type.\n * Resets the favicon to the default when the component unmounts.\n *\n * @param stateType - The state type to display in the favicon (e.g., \"COMPLETED\", \"FAILED\")\n * @returns void\n *\n * @example\n * ```tsx\n * // Set favicon based on task run state\n * useStateFavicon(taskRun.state_type);\n * ```\n */\nexport function useStateFavicon(stateType: StateType | null | undefined): void {\n\tuseEffect(() => {\n\t\tconst colorScheme = getPreferredColorScheme();\n\t\tconst favicon16 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-16-dark\")\n\t\t\t\t: document.getElementById(\"favicon-16\");\n\t\tconst favicon32 =\n\t\t\tcolorScheme === \"dark\"\n\t\t\t\t? document.getElementById(\"favicon-32-dark\")\n\t\t\t\t: document.getElementById(\"favicon-32\");\n\n\t\tif (stateType) {\n\t\t\tconst faviconPath = `/${stateType.toLowerCase()}.svg`;\n\t\t\tfavicon16?.setAttribute(\"href\", faviconPath);\n\t\t\tfavicon32?.setAttribute(\"href\", faviconPath);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Reset to default favicon on unmount\n\t\t\tif (colorScheme === \"dark\") {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16-dark.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32-dark.png\");\n\t\t\t} else {\n\t\t\t\tfavicon16?.setAttribute(\"href\", \"/favicon-16x16.png\");\n\t\t\t\tfavicon32?.setAttribute(\"href\", \"/favicon-32x32.png\");\n\t\t\t}\n\t\t};\n\t}, [stateType]);\n}\n"],"names":["__iconNode","Rows3","createLucideIcon","RunLogs","logs","taskRun","onBottomReached","virtualize","className","parentRef","useRef","logsRef","getItemKey","useCallback","index","virtualizer","useVirtualizer","measureElement","el","virtualItems","_","lastVisibleIndex","useEffect","showDivider","previous","current","isSameDay","jsx","cn","virtualRow","log","shouldShowDivider","jsxs","LogDivider","RunLogRow","taskRunName","LogLevelBadge","format","logLevelBadgeVariants","cva","level","levelLabel","logLevelLabel","Badge","first","date","ChangeStateDialog","open","onOpenChange","currentState","label","onConfirm","isLoading","selectedState","setSelectedState","useState","message","setMessage","handleConfirm","isConfirmDisabled","Dialog","DialogContent","DialogHeader","DialogTitle","Label","StateBadge","StateSelect","Input","e","DialogFooter","Button","useChangeStateDialog","setOpen","openDialog","closeDialog","getPreferredColorScheme","useStateFavicon","stateType","colorScheme","favicon16","favicon32","faviconPath"],"mappings":"kSASA,MAAMA,EAAa,CACjB,CAAC,OAAQ,CAAE,MAAO,KAAM,OAAQ,KAAM,EAAG,IAAK,EAAG,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC9E,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAQ,CAAE,CAC3C,EACMC,EAAQC,EAAiB,SAAUF,CAAU,ECWtCG,EAAU,CAAC,CACvB,KAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,WAAAC,EAAa,GACb,UAAAC,CACD,IAAoB,CACnB,MAAMC,EAAYC,EAAAA,OAAuB,IAAI,EAGvCC,EAAUD,EAAAA,OAAON,CAAI,EAC3BO,EAAQ,QAAUP,EAElB,MAAMQ,EAAaC,EAAAA,YACjBC,GAAkBH,EAAQ,QAAQG,CAAK,GAAG,IAAMA,EACjD,CAAA,CAAC,EAGIC,EAAcC,EAAe,CAClC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,EAAcH,EAAA,EACdI,EACLD,IAAgB,OACb,SAAS,eAAe,iBAAiB,EACzC,SAAS,eAAe,YAAY,EAClCE,EACLF,IAAgB,OACb,SAAS,eAAe,iBAAiB,EACzC,SAAS,eAAe,YAAY,EAExC,GAAID,EAAW,CACd,MAAMI,EAAc,IAAIJ,EAAU,YAAA,CAAa,OAC/CE,GAAW,aAAa,OAAQE,CAAW,EAC3CD,GAAW,aAAa,OAAQC,CAAW,CAC5C,CAEA,MAAO,IAAM,CAERH,IAAgB,QACnBC,GAAW,aAAa,OAAQ,yBAAyB,EACzDC,GAAW,aAAa,OAAQ,yBAAyB,IAEzDD,GAAW,aAAa,OAAQ,oBAAoB,EACpDC,GAAW,aAAa,OAAQ,oBAAoB,EAEtD,CACD,EAAG,CAACH,CAAS,CAAC,CACf","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
1
+ import{j as p,r as x}from"./vendor-tanstack-BdLtprmr.js";import{C as h,aZ as f,I as j}from"./index-CPpeVt8m.js";const I=({currentStepNum:e,onClick:s,steps:r,completedSteps:t,visitedSteps:o})=>p.jsx(h,{className:"p-4 flex flex-row items-center justify-around gap-4 overflow-x-auto",children:r.map((n,a)=>{const d=e===a,m=o.has(a),u=t.has(a);return p.jsx(C,{disabled:!m,onClick:()=>s({stepName:n,stepNum:a}),number:a,isActive:d,isComplete:u,name:n},n)})}),C=({isActive:e=!1,isComplete:s=!1,disabled:r=!1,onClick:t=()=>{},number:o,name:n})=>{const a=o+1,d=a<10?`0${a}`:String(a);return p.jsxs("button",{type:"button",className:f("flex items-center gap-3 text-nowrap",r&&"cursor-not-allowed"),disabled:r,onClick:()=>t({number:o,name:n}),children:[s?p.jsx(j,{id:"CircleCheck",color:e?"teal":"grey",className:"size-12"}):p.jsx(N,{isActive:e,label:d}),p.jsx("p",{className:f("text-lg text-gray-500 border-gray-500 whitespace-nowrap",e&&"text-teal-700 border-teal-700"),children:n})]})},N=({isActive:e=!1,label:s})=>p.jsx("div",{className:f("flex items-center justify-center size-12 rounded-full border-4 text-gray-500 border-gray-500",e&&"text-teal-700 border-teal-700"),children:p.jsx("p",{className:f("text-lg text-gray-500 border-gray-500",e&&"text-teal-700 border-teal-700"),children:s})}),g=(e=new Set)=>{const[s,r]=x.useState(e),t=x.useMemo(()=>({add:c=>r(l=>new Set([...Array.from(l),c])),remove:c=>r(l=>new Set([...Array.from(l).filter(S=>S!==c)])),toggle:c=>r(l=>l.has(c)?new Set(Array.from(l).filter(S=>S!==c)):new Set([...Array.from(l),c])),clear:()=>r(new Set),reset:()=>r(e)}),[e]),o={has:x.useCallback(n=>s.has(n),[s]),...t};return[s,o]},V=(e,s=0,r)=>{const[t,o]=x.useState(s),[n,{add:a,reset:d}]=g(r??new Set([0])),[m,{add:u,reset:c}]=g(new Set),l=()=>{t<e-1&&(u(t),a(t+1),o(i=>i+1))},S=()=>{t>0&&o(i=>i-1)},b=i=>{o(i)},y=()=>{c(),d(),o(s)},w=t===e-1;return{changeStep:b,completedStepsSet:m,currentStep:t,decrementStep:S,incrementStep:l,isFinalStep:w,isStartingStep:t===0,reset:y,visitedStepsSet:n}};export{I as S,V as u};
2
+ //# sourceMappingURL=use-stepper-CZZEx5js.js.map