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-stepper-CZZEx5js.js","sources":["../../src/components/ui/stepper/stepper.tsx","../../src/hooks/use-set.ts","../../src/hooks/use-stepper.ts"],"sourcesContent":["import { Card } from \"@/components/ui/card\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { cn } from \"@/utils\";\n\ntype StepperProps = {\n\tcurrentStepNum: number;\n\tsteps: Array<string> | ReadonlyArray<string>;\n\tonClick: ({\n\t\tstepName,\n\t\tstepNum,\n\t}: {\n\t\tstepName: string;\n\t\tstepNum: number;\n\t}) => void;\n\tcompletedSteps: Set<number>;\n\tvisitedSteps: Set<number>;\n};\nconst Stepper = ({\n\tcurrentStepNum,\n\tonClick,\n\tsteps,\n\tcompletedSteps,\n\tvisitedSteps,\n}: StepperProps) => {\n\treturn (\n\t\t<Card className=\"p-4 flex flex-row items-center justify-around gap-4 overflow-x-auto\">\n\t\t\t{steps.map((step, i) => {\n\t\t\t\tconst isCurrentStep = currentStepNum === i;\n\t\t\t\tconst isStepVisited = visitedSteps.has(i);\n\t\t\t\tconst isStepComplete = completedSteps.has(i);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Step\n\t\t\t\t\t\tkey={step}\n\t\t\t\t\t\tdisabled={!isStepVisited}\n\t\t\t\t\t\tonClick={() => onClick({ stepName: step, stepNum: i })}\n\t\t\t\t\t\tnumber={i}\n\t\t\t\t\t\tisActive={isCurrentStep}\n\t\t\t\t\t\tisComplete={isStepComplete}\n\t\t\t\t\t\tname={step}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Card>\n\t);\n};\n\ntype StepProps = {\n\tisActive?: boolean;\n\tisComplete?: boolean;\n\tdisabled?: boolean;\n\tnumber: number;\n\tname: string;\n\tonClick?: ({ number, name }: { number: number; name: string }) => void;\n};\n\nconst Step = ({\n\tisActive = false,\n\tisComplete = false,\n\tdisabled = false,\n\tonClick = () => {},\n\t/** Assume steps are indexed =0 */\n\tnumber,\n\tname,\n}: StepProps) => {\n\t// add 1 to number assuming index 0\n\tconst adjustedNumberDisplay = number + 1;\n\tconst numberLabel =\n\t\tadjustedNumberDisplay < 10\n\t\t\t? `0${adjustedNumberDisplay}`\n\t\t\t: String(adjustedNumberDisplay);\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex items-center gap-3 text-nowrap\",\n\t\t\t\tdisabled && \"cursor-not-allowed\",\n\t\t\t)}\n\t\t\tdisabled={disabled}\n\t\t\tonClick={() => onClick({ number, name })}\n\t\t>\n\t\t\t{isComplete ? (\n\t\t\t\t<Icon\n\t\t\t\t\tid=\"CircleCheck\"\n\t\t\t\t\tcolor={isActive ? \"teal\" : \"grey\"}\n\t\t\t\t\tclassName=\"size-12\"\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<StepIcon isActive={isActive} label={numberLabel} />\n\t\t\t)}\n\t\t\t<p\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"text-lg text-gray-500 border-gray-500 whitespace-nowrap\",\n\t\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{name}\n\t\t\t</p>\n\t\t</button>\n\t);\n};\n\ntype StepIconProps = {\n\tlabel: string;\n\tisActive?: boolean;\n};\nconst StepIcon = ({ isActive = false, label }: StepIconProps) => (\n\t<div\n\t\tclassName={cn(\n\t\t\t\"flex items-center justify-center size-12 rounded-full border-4 text-gray-500 border-gray-500\",\n\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t)}\n\t>\n\t\t<p\n\t\t\tclassName={cn(\n\t\t\t\t\"text-lg text-gray-500 border-gray-500\",\n\t\t\t\tisActive && \"text-teal-700 border-teal-700\",\n\t\t\t)}\n\t\t>\n\t\t\t{label}\n\t\t</p>\n\t</div>\n);\n\nexport { Step, Stepper };\n","import { useCallback, useMemo, useState } from \"react\";\n\ntype StableActions<K> = {\n\tadd: (key: K) => void;\n\tremove: (key: K) => void;\n\ttoggle: (key: K) => void;\n\treset: () => void;\n\tclear: () => void;\n};\n\ntype Actions<K> = StableActions<K> & {\n\thas: (key: K) => boolean;\n};\n\n/**\n * A hook that is used to declarative to keep state of a 'Set' type of data structure.\n * This is useful in cases where the UX needs to keep track of selected rows by id\n *\n * @param initialSet Initial state of a Set\n * @returns a Set object and utils as a tuple\n *\n * @example\n * ```tsx\n * function FlowCheckboxList() {\n * const [selectedIDs, { has, toggle }] = useSet<string>();\n *\n * return flows.map((flow) =>\n * \t\t<Checkbox\n * \t\t\tkey={flow.id}\n * \t\t\tchecked={has(flow.id)}\n * \t\t\tonCheck={() => toggle(flow.id)}\n * \t\t\tlabel={flow.name} />\n *\n * }\n * ```\n */\nexport const useSet = <K>(initialSet = new Set<K>()): [Set<K>, Actions<K>] => {\n\tconst [set, setSet] = useState(initialSet);\n\n\tconst stableActions = useMemo(() => {\n\t\tconst add = (item: K) =>\n\t\t\tsetSet((curr) => new Set([...Array.from(curr), item]));\n\t\tconst remove = (item: K) =>\n\t\t\tsetSet(\n\t\t\t\t(curr) => new Set([...Array.from(curr).filter((i) => i !== item)]),\n\t\t\t);\n\t\tconst toggle = (item: K) =>\n\t\t\tsetSet((curr) =>\n\t\t\t\tcurr.has(item)\n\t\t\t\t\t? new Set(Array.from(curr).filter((i) => i !== item))\n\t\t\t\t\t: new Set([...Array.from(curr), item]),\n\t\t\t);\n\t\tconst reset = () => setSet(initialSet);\n\t\tconst clear = () => setSet(new Set());\n\n\t\treturn { add, remove, toggle, clear, reset };\n\t}, [initialSet]);\n\n\tconst utils = {\n\t\thas: useCallback((item) => set.has(item), [set]),\n\t\t...stableActions,\n\t} as Actions<K>;\n\n\treturn [set, utils];\n};\n","import { useState } from \"react\";\nimport { useSet } from \"./use-set\";\n/**\n *\n * @param steps\n * @param startingStep\n * @returns state with declarative utilities to increment, decrement, or skip to a current state\n *\n * @example\n * ```ts\n * const STEPS = ['Trigger', 'Actions', 'Details'] as const\n *\n * const stepper = useStepper(STEPS.length);\n *\n * return (\n * <div>\n * <h2>Current Step: {STEPS[stepper.currentStep]}</h2>\n * <ul>\n * {STEPS.map((step, i) => (\n * \t\t\t<li key={i} onClick={() => stepper.setStep(i)}>{step}</li>\n * \t\t)}\n * </ul>\n * <div>\n * <Button disabled={stepper.isStartingStep} onClick={stepper.decrementStep()}>Previous</Button>\n * <Button onClick={stepper.incrementStep()}>{stepper.isFinalStep ? 'Save' : 'Next'}</Button>\n * </div>\n * </div>\n * )\n * ```\n */\nexport const useStepper = (\n\tnumSteps: number,\n\tstartingStep = 0,\n\tinitialVisitedSteps?: Set<number>,\n) => {\n\tconst [currentStep, setCurrentStep] = useState(startingStep);\n\tconst [visitedStepsSet, { add: addVisitedStep, reset: resetVisitedSteps }] =\n\t\tuseSet(initialVisitedSteps ?? new Set<number>([0]));\n\tconst [\n\t\tcompletedStepsSet,\n\t\t{ add: addCompletedStep, reset: resetCompletedSteps },\n\t] = useSet(new Set<number>());\n\n\tconst incrementStep = () => {\n\t\tif (currentStep < numSteps - 1) {\n\t\t\t// Marks step as visited\n\t\t\taddCompletedStep(currentStep);\n\t\t\taddVisitedStep(currentStep + 1);\n\t\t\tsetCurrentStep((curr) => curr + 1);\n\t\t}\n\t};\n\n\tconst decrementStep = () => {\n\t\tif (currentStep > 0) {\n\t\t\tsetCurrentStep((curr) => curr - 1);\n\t\t}\n\t};\n\n\tconst changeStep = (stepNum: number) => {\n\t\tsetCurrentStep(stepNum);\n\t};\n\n\tconst reset = () => {\n\t\tresetCompletedSteps();\n\t\tresetVisitedSteps();\n\t\tsetCurrentStep(startingStep);\n\t};\n\n\tconst isFinalStep = currentStep === numSteps - 1;\n\tconst isStartingStep = currentStep === 0;\n\n\treturn {\n\t\tchangeStep,\n\t\tcompletedStepsSet,\n\t\tcurrentStep,\n\t\tdecrementStep,\n\t\tincrementStep,\n\t\tisFinalStep,\n\t\tisStartingStep,\n\t\treset,\n\t\tvisitedStepsSet,\n\t};\n};\n"],"names":["Stepper","currentStepNum","onClick","steps","completedSteps","visitedSteps","jsx","Card","step","i","isCurrentStep","isStepVisited","isStepComplete","Step","isActive","isComplete","disabled","number","name","adjustedNumberDisplay","numberLabel","jsxs","cn","Icon","StepIcon","label","useSet","initialSet","set","setSet","useState","stableActions","useMemo","item","curr","utils","useCallback","useStepper","numSteps","startingStep","initialVisitedSteps","currentStep","setCurrentStep","visitedStepsSet","addVisitedStep","resetVisitedSteps","completedStepsSet","addCompletedStep","resetCompletedSteps","incrementStep","decrementStep","changeStep","stepNum","reset","isFinalStep"],"mappings":"gHAiBA,MAAMA,EAAU,CAAC,CAChB,eAAAC,EACA,QAAAC,EACA,MAAAC,EACA,eAAAC,EACA,aAAAC,CACD,IAEEC,MAACC,GAAK,UAAU,sEACd,WAAM,IAAI,CAACC,EAAMC,IAAM,CACvB,MAAMC,EAAgBT,IAAmBQ,EACnCE,EAAgBN,EAAa,IAAII,CAAC,EAClCG,EAAiBR,EAAe,IAAIK,CAAC,EAE3C,OACCH,EAAAA,IAACO,EAAA,CAEA,SAAU,CAACF,EACX,QAAS,IAAMT,EAAQ,CAAE,SAAUM,EAAM,QAASC,EAAG,EACrD,OAAQA,EACR,SAAUC,EACV,WAAYE,EACZ,KAAMJ,CAAA,EANDA,CAAA,CASR,CAAC,CAAA,CACF,EAaIK,EAAO,CAAC,CACb,SAAAC,EAAW,GACX,WAAAC,EAAa,GACb,SAAAC,EAAW,GACX,QAAAd,EAAU,IAAM,CAAC,EAEjB,OAAAe,EACA,KAAAC,CACD,IAAiB,CAEhB,MAAMC,EAAwBF,EAAS,EACjCG,EACLD,EAAwB,GACrB,IAAIA,CAAqB,GACzB,OAAOA,CAAqB,EAEhC,OACCE,EAAAA,KAAC,SAAA,CACA,KAAK,SACL,UAAWC,EACV,sCACAN,GAAY,oBAAA,EAEb,SAAAA,EACA,QAAS,IAAMd,EAAQ,CAAE,OAAAe,EAAQ,KAAAC,EAAM,EAEtC,SAAA,CAAAH,EACAT,EAAAA,IAACiB,EAAA,CACA,GAAG,cACH,MAAOT,EAAW,OAAS,OAC3B,UAAU,SAAA,CAAA,EAGXR,EAAAA,IA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a,CACzBC,EACAC,EAAe,EACfC,IACI,CACJ,KAAM,CAACC,EAAaC,CAAc,EAAIZ,EAAAA,SAASS,CAAY,EACrD,CAACI,EAAiB,CAAE,IAAKC,EAAgB,MAAOC,CAAA,CAAmB,EACxEnB,EAAOc,GAAuB,IAAI,IAAY,CAAC,CAAC,CAAC,CAAC,EAC7C,CACLM,EACA,CAAE,IAAKC,EAAkB,MAAOC,CAAA,CAAoB,EACjDtB,EAAO,IAAI,GAAa,EAEtBuB,EAAgB,IAAM,CACvBR,EAAcH,EAAW,IAE5BS,EAAiBN,CAAW,EAC5BG,EAAeH,EAAc,CAAC,EAC9BC,EAAgBR,GAASA,EAAO,CAAC,EAEnC,EAEMgB,EAAgB,IAAM,CACvBT,EAAc,GACjBC,EAAgBR,GAASA,EAAO,CAAC,CAEnC,EAEMiB,EAAcC,GAAoB,CACvCV,EAAeU,CAAO,CACvB,EAEMC,EAAQ,IAAM,CACnBL,EAAA,EACAH,EAAA,EACAH,EAAeH,CAAY,CAC5B,EAEMe,EAAcb,IAAgBH,EAAW,EAG/C,MAAO,CACN,WAAAa,EACA,kBAAAL,EACA,YAAAL,EACA,cAAAS,EACA,cAAAD,EACA,YAAAK,EACA,eATsBb,IAAgB,EAUtC,MAAAY,EACA,gBAAAV,CAAA,CAEF"}
@@ -1,2 +1,2 @@
1
- import{j as a}from"./vendor-tanstack-BdLtprmr.js";import{L as n,a_ as o,f}from"./index-V_xTKaEb.js";function p({value:e,className:t,hideLineNumbers:s=!0,copy:r=!0,...i}){return a.jsx(n,{value:e,disabled:!0,hideLineNumbers:s,copy:r,className:o("bg-muted/50",t),...i})}function u(e){const t=[],s=e.split(".");for(let r=1;r<s.length;r++){const i=s.slice(0,r).join(".");t.push(`${i}.*`)}return[...t,e]}function m(e){let t=e;return t.startsWith("prefect.")?t=t.slice(8):t.startsWith("prefect-cloud.")&&(t=t.slice(14)),t.split(/[._-]/).map(s=>f(s.toLowerCase())).join(" ")}export{p as J,m as f,u as g};
2
- //# sourceMappingURL=utilities-2FfCfMAV.js.map
1
+ import{j as a}from"./vendor-tanstack-BdLtprmr.js";import{L as n,aZ as o,f}from"./index-CPpeVt8m.js";function p({value:e,className:t,hideLineNumbers:s=!0,copy:r=!0,...i}){return a.jsx(n,{value:e,disabled:!0,hideLineNumbers:s,copy:r,className:o("bg-muted/50",t),...i})}function u(e){const t=[],s=e.split(".");for(let r=1;r<s.length;r++){const i=s.slice(0,r).join(".");t.push(`${i}.*`)}return[...t,e]}function m(e){let t=e;return t.startsWith("prefect.")?t=t.slice(8):t.startsWith("prefect-cloud.")&&(t=t.slice(14)),t.split(/[._-]/).map(s=>f(s.toLowerCase())).join(" ")}export{p as J,m as f,u as g};
2
+ //# sourceMappingURL=utilities-D9BfvLg5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utilities-2FfCfMAV.js","sources":["../../src/components/ui/json-view.tsx","../../src/components/events/events-timeline/utilities.ts"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/utils\";\nimport { LazyJsonInput as JsonInput } from \"./json-input-lazy\";\n\ntype JsonViewProps = Omit<\n\tReact.ComponentProps<typeof JsonInput>,\n\t\"onChange\" | \"onBlur\" | \"disabled\"\n> & {\n\tvalue?: string;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport function JsonView({\n\tvalue,\n\tclassName,\n\thideLineNumbers = true,\n\tcopy = true,\n\t...props\n}: JsonViewProps) {\n\treturn (\n\t\t<JsonInput\n\t\t\tvalue={value}\n\t\t\tdisabled={true}\n\t\t\thideLineNumbers={hideLineNumbers}\n\t\t\tcopy={copy}\n\t\t\tclassName={cn(\"bg-muted/50\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { capitalize } from \"@/utils\";\n\n/**\n * Get event prefixes for filtering.\n * For example, \"prefect.flow-run.Completed\" returns:\n * [\"prefect.*\", \"prefect.flow-run.*\", \"prefect.flow-run.Completed\"]\n */\nexport function getEventPrefixes(eventName: string): string[] {\n\tconst prefixes: string[] = [];\n\tconst parts = eventName.split(\".\");\n\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tconst prefix = parts.slice(0, i).join(\".\");\n\t\tprefixes.push(`${prefix}.*`);\n\t}\n\n\treturn [...prefixes, eventName];\n}\n\n/**\n * Format event label from event name.\n * For example, \"prefect.flow-run.Completed\" becomes \"Flow Run Completed\"\n */\nexport function formatEventLabel(eventName: string): string {\n\t// Remove prefect. or prefect-cloud. prefix\n\tlet label = eventName;\n\tif (label.startsWith(\"prefect.\")) {\n\t\tlabel = label.slice(8);\n\t} else if (label.startsWith(\"prefect-cloud.\")) {\n\t\tlabel = label.slice(14);\n\t}\n\n\t// Replace dashes and dots with spaces, then capitalize each word\n\treturn label\n\t\t.split(/[._-]/)\n\t\t.map((word) => capitalize(word.toLowerCase()))\n\t\t.join(\" \");\n}\n"],"names":["JsonView","value","className","hideLineNumbers","copy","props","jsx","JsonInput","cn","getEventPrefixes","eventName","prefixes","parts","i","prefix","formatEventLabel","label","word","capitalize"],"mappings":"oGAcO,SAASA,EAAS,CACxB,MAAAC,EACA,UAAAC,EACA,gBAAAC,EAAkB,GAClB,KAAAC,EAAO,GACP,GAAGC,CACJ,EAAkB,CACjB,OACCC,EAAAA,IAACC,EAAA,CACA,MAAAN,EACA,SAAU,GACV,gBAAAE,EACA,KAAAC,EACA,UAAWI,EAAG,cAAeN,CAAS,EACrC,GAAGG,CAAA,CAAA,CAGP,CCxBO,SAASI,EAAiBC,EAA6B,CAC7D,MAAMC,EAAqB,CAAA,EACrBC,EAAQF,EAAU,MAAM,GAAG,EAEjC,QAASG,EAAI,EAAGA,EAAID,EAAM,OAAQC,IAAK,CACtC,MAAMC,EAASF,EAAM,MAAM,EAAGC,CAAC,EAAE,KAAK,GAAG,EACzCF,EAAS,KAAK,GAAGG,CAAM,IAAI,CAC5B,CAEA,MAAO,CAAC,GAAGH,EAAUD,CAAS,CAC/B,CAMO,SAASK,EAAiBL,EAA2B,CAE3D,IAAIM,EAAQN,EACZ,OAAIM,EAAM,WAAW,UAAU,EAC9BA,EAAQA,EAAM,MAAM,CAAC,EACXA,EAAM,WAAW,gBAAgB,IAC3CA,EAAQA,EAAM,MAAM,EAAE,GAIhBA,EACL,MAAM,OAAO,EACb,IAAKC,GAASC,EAAWD,EAAK,YAAA,CAAa,CAAC,EAC5C,KAAK,GAAG,CACX"}
1
+ {"version":3,"file":"utilities-D9BfvLg5.js","sources":["../../src/components/ui/json-view.tsx","../../src/components/events/events-timeline/utilities.ts"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/utils\";\nimport { LazyJsonInput as JsonInput } from \"./json-input-lazy\";\n\ntype JsonViewProps = Omit<\n\tReact.ComponentProps<typeof JsonInput>,\n\t\"onChange\" | \"onBlur\" | \"disabled\"\n> & {\n\tvalue?: string;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport function JsonView({\n\tvalue,\n\tclassName,\n\thideLineNumbers = true,\n\tcopy = true,\n\t...props\n}: JsonViewProps) {\n\treturn (\n\t\t<JsonInput\n\t\t\tvalue={value}\n\t\t\tdisabled={true}\n\t\t\thideLineNumbers={hideLineNumbers}\n\t\t\tcopy={copy}\n\t\t\tclassName={cn(\"bg-muted/50\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { capitalize } from \"@/utils\";\n\n/**\n * Get event prefixes for filtering.\n * For example, \"prefect.flow-run.Completed\" returns:\n * [\"prefect.*\", \"prefect.flow-run.*\", \"prefect.flow-run.Completed\"]\n */\nexport function getEventPrefixes(eventName: string): string[] {\n\tconst prefixes: string[] = [];\n\tconst parts = eventName.split(\".\");\n\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tconst prefix = parts.slice(0, i).join(\".\");\n\t\tprefixes.push(`${prefix}.*`);\n\t}\n\n\treturn [...prefixes, eventName];\n}\n\n/**\n * Format event label from event name.\n * For example, \"prefect.flow-run.Completed\" becomes \"Flow Run Completed\"\n */\nexport function formatEventLabel(eventName: string): string {\n\t// Remove prefect. or prefect-cloud. prefix\n\tlet label = eventName;\n\tif (label.startsWith(\"prefect.\")) {\n\t\tlabel = label.slice(8);\n\t} else if (label.startsWith(\"prefect-cloud.\")) {\n\t\tlabel = label.slice(14);\n\t}\n\n\t// Replace dashes and dots with spaces, then capitalize each word\n\treturn label\n\t\t.split(/[._-]/)\n\t\t.map((word) => capitalize(word.toLowerCase()))\n\t\t.join(\" \");\n}\n"],"names":["JsonView","value","className","hideLineNumbers","copy","props","jsx","JsonInput","cn","getEventPrefixes","eventName","prefixes","parts","i","prefix","formatEventLabel","label","word","capitalize"],"mappings":"oGAcO,SAASA,EAAS,CACxB,MAAAC,EACA,UAAAC,EACA,gBAAAC,EAAkB,GAClB,KAAAC,EAAO,GACP,GAAGC,CACJ,EAAkB,CACjB,OACCC,EAAAA,IAACC,EAAA,CACA,MAAAN,EACA,SAAU,GACV,gBAAAE,EACA,KAAAC,EACA,UAAWI,EAAG,cAAeN,CAAS,EACrC,GAAGG,CAAA,CAAA,CAGP,CCxBO,SAASI,EAAiBC,EAA6B,CAC7D,MAAMC,EAAqB,CAAA,EACrBC,EAAQF,EAAU,MAAM,GAAG,EAEjC,QAASG,EAAI,EAAGA,EAAID,EAAM,OAAQC,IAAK,CACtC,MAAMC,EAASF,EAAM,MAAM,EAAGC,CAAC,EAAE,KAAK,GAAG,EACzCF,EAAS,KAAK,GAAGG,CAAM,IAAI,CAC5B,CAEA,MAAO,CAAC,GAAGH,EAAUD,CAAS,CAC/B,CAMO,SAASK,EAAiBL,EAA2B,CAE3D,IAAIM,EAAQN,EACZ,OAAIM,EAAM,WAAW,UAAU,EAC9BA,EAAQA,EAAM,MAAM,CAAC,EACXA,EAAM,WAAW,gBAAgB,IAC3CA,EAAQA,EAAM,MAAM,EAAE,GAIhBA,EACL,MAAM,OAAO,EACb,IAAKC,GAASC,EAAWD,EAAK,YAAA,CAAa,CAAC,EAC5C,KAAK,GAAG,CACX"}
@@ -0,0 +1,2 @@
1
+ import{r as o,t as C,j as e}from"./vendor-tanstack-BdLtprmr.js";import{c$ as S,ag as v,ah as w,ai as N,aj as g,ak as k,al as z,am as E,an as h,ao as x,T as L}from"./index-CPpeVt8m.js";const _=2,M=({selectedDeployments:a,onSelectDeployments:t})=>{const[i,u]=o.useState(""),n=o.useDeferredValue(i),{data:c=[]}=C(S({deployments:n?{operator:"and_",name:{like_:n}}:void 0,limit:100,offset:0,sort:"NAME_ASC"})),{data:f=[]}=C(S({deployments:a.size>0?{operator:"and_",id:{any_:Array.from(a)}}:void 0,limit:a.size||1,offset:0,sort:"NAME_ASC"},{enabled:a.size>0})),j=s=>{const r=new Set(a);a.has(s)?r.delete(s):r.add(s),t(r)},p=()=>{t(new Set)},b=()=>{if(a.size===0)return"All deployments";const s=f.filter(d=>a.has(d.id)).map(d=>d.name),r=s.slice(0,_),m=s.length-_;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:r.join(", ")})}),m>0&&e.jsxs("p",{className:"text-sm shrink-0",children:["+ ",m]})]})},l=o.useMemo(()=>c.filter(s=>!n||s.name.toLowerCase().includes(n.toLowerCase())),[c,n]);return e.jsxs(v,{children:[e.jsx(w,{"aria-label":"Filter by deployment",selected:a.size===0,children:b()}),e.jsxs(N,{children:[e.jsx(g,{value:i,onValueChange:u,placeholder:"Search deployments..."}),e.jsxs(k,{children:[e.jsx(z,{children:"No deployments found"}),e.jsxs(E,{children:[e.jsxs(h,{"aria-label":"All deployments",onSelect:p,closeOnSelect:!1,value:"__all__",children:[e.jsx(x,{checked:a.size===0}),"All deployments"]}),l.map(s=>e.jsxs(h,{"aria-label":s.name,onSelect:()=>j(s.id),closeOnSelect:!1,value:s.id,children:[e.jsx(x,{checked:a.has(s.id)}),s.name]},s.id))]})]})]})]})},A=2,D=({selectedWorkPools:a,onSelectWorkPools:t})=>{const[i,u]=o.useState(""),n=o.useDeferredValue(i),{data:c=[]}=C(L({limit:100,offset:0})),f=l=>{const s=new Set(a);a.has(l)?s.delete(l):s.add(l),t(s)},j=()=>{t(new Set)},p=()=>{if(a.size===0)return"All work pools";const l=Array.from(a).sort((m,d)=>m.localeCompare(d)),s=l.slice(0,A),r=l.length-A;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:s.join(", ")})}),r>0&&e.jsxs("p",{className:"text-sm shrink-0",children:["+ ",r]})]})},b=o.useMemo(()=>c.filter(l=>!n||l.name.toLowerCase().includes(n.toLowerCase())).sort((l,s)=>l.name.localeCompare(s.name)),[c,n]);return e.jsxs(v,{children:[e.jsx(w,{"aria-label":"Filter by work pool",selected:a.size===0,children:p()}),e.jsxs(N,{children:[e.jsx(g,{value:i,onValueChange:u,placeholder:"Search work pools..."}),e.jsxs(k,{children:[e.jsx(z,{children:"No work pools found"}),e.jsxs(E,{children:[e.jsxs(h,{"aria-label":"All work pools",onSelect:j,closeOnSelect:!1,value:"__all__",children:[e.jsx(x,{checked:a.size===0}),"All work pools"]}),b.map(l=>e.jsxs(h,{"aria-label":l.name,onSelect:()=>f(l.name),closeOnSelect:!1,value:l.name,children:[e.jsx(x,{checked:a.has(l.name)}),l.name]},l.name))]})]})]})]})};export{M as D,D as W};
2
+ //# sourceMappingURL=work-pool-filter-dsJ6xeK6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-pool-filter-dsJ6xeK6.js","sources":["../../src/components/flow-runs/flow-runs-list/flow-runs-filters/deployment-filter.tsx","../../src/components/flow-runs/flow-runs-list/flow-runs-filters/work-pool-filter.tsx"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterDeploymentsQuery,\n\ttype Deployment,\n} from \"@/api/deployments\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\n\nconst MAX_DEPLOYMENTS_DISPLAYED = 2;\n\ntype DeploymentFilterProps = {\n\tselectedDeployments: Set<string>;\n\tonSelectDeployments: (deployments: Set<string>) => void;\n};\n\nexport const DeploymentFilter = ({\n\tselectedDeployments,\n\tonSelectDeployments,\n}: DeploymentFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: deployments = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery({\n\t\t\tdeployments: deferredSearch\n\t\t\t\t? {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tname: { like_: deferredSearch },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst { data: selectedDeploymentsData = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery(\n\t\t\t{\n\t\t\t\tdeployments:\n\t\t\t\t\tselectedDeployments.size > 0\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\tid: { any_: Array.from(selectedDeployments) },\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\tlimit: selectedDeployments.size || 1,\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t},\n\t\t\t{ enabled: selectedDeployments.size > 0 },\n\t\t),\n\t);\n\n\tconst handleSelectDeployment = (deploymentId: string) => {\n\t\tconst updatedDeployments = new Set(selectedDeployments);\n\t\tif (selectedDeployments.has(deploymentId)) {\n\t\t\tupdatedDeployments.delete(deploymentId);\n\t\t} else {\n\t\t\tupdatedDeployments.add(deploymentId);\n\t\t}\n\t\tonSelectDeployments(updatedDeployments);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectDeployments(new Set());\n\t};\n\n\tconst renderSelectedDeployments = () => {\n\t\tif (selectedDeployments.size === 0) {\n\t\t\treturn \"All deployments\";\n\t\t}\n\n\t\tconst selectedDeploymentNames = selectedDeploymentsData\n\t\t\t.filter((deployment) => selectedDeployments.has(deployment.id))\n\t\t\t.map((deployment) => deployment.name);\n\n\t\tconst visible = selectedDeploymentNames.slice(0, MAX_DEPLOYMENTS_DISPLAYED);\n\t\tconst extraCount =\n\t\t\tselectedDeploymentNames.length - MAX_DEPLOYMENTS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && <p className=\"text-sm shrink-0\">+ {extraCount}</p>}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredDeployments = useMemo(() => {\n\t\treturn deployments.filter(\n\t\t\t(deployment: Deployment) =>\n\t\t\t\t!deferredSearch ||\n\t\t\t\tdeployment.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [deployments, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by deployment\"\n\t\t\t\tselected={selectedDeployments.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedDeployments()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search deployments...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No deployments found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All deployments\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.size === 0} />\n\t\t\t\t\t\t\tAll deployments\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredDeployments.map((deployment: Deployment) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={deployment.id}\n\t\t\t\t\t\t\t\taria-label={deployment.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectDeployment(deployment.id)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={deployment.id}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.has(deployment.id)} />\n\t\t\t\t\t\t\t\t{deployment.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterWorkPoolsQuery,\n\ttype WorkPool,\n} from \"@/api/work-pools/work-pools\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\n\nconst MAX_WORK_POOLS_DISPLAYED = 2;\n\ntype WorkPoolFilterProps = {\n\tselectedWorkPools: Set<string>;\n\tonSelectWorkPools: (workPools: Set<string>) => void;\n};\n\nexport const WorkPoolFilter = ({\n\tselectedWorkPools,\n\tonSelectWorkPools,\n}: WorkPoolFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery({\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst handleSelectWorkPool = (workPoolName: string) => {\n\t\tconst updatedWorkPools = new Set(selectedWorkPools);\n\t\tif (selectedWorkPools.has(workPoolName)) {\n\t\t\tupdatedWorkPools.delete(workPoolName);\n\t\t} else {\n\t\t\tupdatedWorkPools.add(workPoolName);\n\t\t}\n\t\tonSelectWorkPools(updatedWorkPools);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectWorkPools(new Set());\n\t};\n\n\tconst renderSelectedWorkPools = () => {\n\t\tif (selectedWorkPools.size === 0) {\n\t\t\treturn \"All work pools\";\n\t\t}\n\n\t\tconst selectedWorkPoolNames = Array.from(selectedWorkPools).sort((a, b) =>\n\t\t\ta.localeCompare(b),\n\t\t);\n\n\t\tconst visible = selectedWorkPoolNames.slice(0, MAX_WORK_POOLS_DISPLAYED);\n\t\tconst extraCount = selectedWorkPoolNames.length - MAX_WORK_POOLS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && <p className=\"text-sm shrink-0\">+ {extraCount}</p>}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredWorkPools = useMemo(() => {\n\t\treturn workPools\n\t\t\t.filter(\n\t\t\t\t(workPool: WorkPool) =>\n\t\t\t\t\t!deferredSearch ||\n\t\t\t\t\tworkPool.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t\t)\n\t\t\t.sort((a: WorkPool, b: WorkPool) => a.name.localeCompare(b.name));\n\t}, [workPools, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by work pool\"\n\t\t\t\tselected={selectedWorkPools.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedWorkPools()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search work pools...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No work pools found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All work pools\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.size === 0} />\n\t\t\t\t\t\t\tAll work pools\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredWorkPools.map((workPool: WorkPool) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={workPool.name}\n\t\t\t\t\t\t\t\taria-label={workPool.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectWorkPool(workPool.name)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={workPool.name}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.has(workPool.name)} />\n\t\t\t\t\t\t\t\t{workPool.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n"],"names":["MAX_DEPLOYMENTS_DISPLAYED","DeploymentFilter","selectedDeployments","onSelectDeployments","search","setSearch","useState","deferredSearch","useDeferredValue","deployments","useQuery","buildFilterDeploymentsQuery","selectedDeploymentsData","handleSelectDeployment","deploymentId","updatedDeployments","handleClearAll","renderSelectedDeployments","selectedDeploymentNames","deployment","visible","extraCount","jsxs","jsx","filteredDeployments","useMemo","Combobox","ComboboxTrigger","ComboboxContent","ComboboxCommandInput","ComboboxCommandList","ComboboxCommandEmtpy","ComboboxCommandGroup","ComboboxCommandItem","Checkbox","MAX_WORK_POOLS_DISPLAYED","WorkPoolFilter","selectedWorkPools","onSelectWorkPools","workPools","buildFilterWorkPoolsQuery","handleSelectWorkPool","workPoolName","updatedWorkPools","renderSelectedWorkPools","selectedWorkPoolNames","a","b","filteredWorkPools","workPool"],"mappings":"wLAkBA,MAAMA,EAA4B,EAOrBC,EAAmB,CAAC,CAChC,oBAAAC,EACA,oBAAAC,CACD,IAA6B,CAC5B,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAE,EACjCC,EAAiBC,EAAAA,iBAAiBJ,CAAM,EAExC,CAAE,KAAMK,EAAc,CAAA,GAAOC,EAClCC,EAA4B,CAC3B,YAAaJ,EACV,CACA,SAAU,OACV,KAAM,CAAE,MAAOA,CAAA,CAAe,EAE9B,OACH,MAAO,IACP,OAAQ,EACR,KAAM,UAAA,CACN,CAAA,EAGI,CAAE,KAAMK,EAA0B,CAAA,GAAOF,EAC9CC,EACC,CACC,YACCT,EAAoB,KAAO,EACxB,CACA,SAAU,OACV,GAAI,CAAE,KAAM,MAAM,KAAKA,CAAmB,CAAA,CAAE,EAE5C,OACJ,MAAOA,EAAoB,MAAQ,EACnC,OAA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,EAAS,IAAI,EAClD,cAAe,GACf,MAAOA,EAAS,KAEhB,SAAA,CAAA1B,MAACW,GAAS,QAASG,EAAkB,IAAIY,EAAS,IAAI,EAAG,EACxDA,EAAS,IAAA,CAAA,EAPLA,EAAS,IAAA,CASf,CAAA,CAAA,CACF,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,EACD,CAEF"}
@@ -1,2 +1,2 @@
1
- import{j as e,r as y,d as T}from"./vendor-tanstack-BdLtprmr.js";import{bL as E,bX as S,bU as v,bV as C,H as M,a_ as g,bN as F,bW as W,dr as I,ds as L,y as d,a2 as A,a3 as U,a4 as O,a5 as R,p as P,I as z,a7 as B,bl as V,q as N,dt as $,bM as q,bR as H,bS as Y,bT as Z,du as G,dv as X,G as J}from"./index-V_xTKaEb.js";import{D as K,a as ee,b as oe,d as se}from"./dropdown-menu-B9LKPlz7.js";import{a as re}from"./zod-B1GLD-Zc.js";import{c as ne,o as ae,k as _,b as te,s as x,n as Q}from"./vendor-forms-BlFSCfFw.js";import{F as ie,a as h,b as j,c as b,d as w,e as k}from"./form-DOdmIC3A.js";import{T as le}from"./textarea-9v5uTuxg.js";import{D as ce}from"./delete-confirmation-dialog-dLycVNo4.js";const ue=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],de=E("square-pen",ue),me={READY:{label:"Ready",color:"bg-green-500",tooltip:"Work queue has at least one actively polling worker ready to execute work."},PAUSED:{label:"Paused",color:"bg-yellow-500",tooltip:"Work queue is paused. No work will be executed."},NOT_READY:{label:"Not Ready",color:"bg-red-500",tooltip:"Work queue does not have any actively polling workers ready to execute work."}},Ce=({status:o,className:s})=>{const r=me[o];return e.jsx(S,{children:e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsxs(M,{variant:"secondary",className:g("flex items-center space-x-1 cursor-help",s),children:[o==="PAUSED"?e.jsx(F,{className:"h-2 w-2 text-muted-foreground"}):e.jsx("div",{className:g("h-2 w-2 rounded-full",r.color)}),e.jsx("span",{children:r.label})]})}),e.jsx(W,{children:e.jsx("p",{children:r.tooltip})})]})})},pe=ae({name:x().min(1,{message:"Name is required"}).regex(/^[a-zA-Z0-9_-]+$/,{message:"Name can only contain letters, numbers, hyphens, and underscores"}),description:x().nullable().optional(),is_paused:te().default(!1),concurrency_limit:_([x().transform(o=>{if(o===""||o===null||o===void 0)return null;const s=Number(o);if(Number.isNaN(s))return null;if(s<=0)throw new Error("Flow run concurrency must be greater than 0");return s}),Q().positive({message:"Flow run concurrency must be greater than 0"}).nullable()]).nullable().optional(),priority:_([x().transform(o=>{if(o===""||o===null||o===void 0)return null;const s=Number(o);if(Number.isNaN(s))return null;if(s<=0)throw new Error("Priority must be greater than 0");if(!Number.isInteger(s))throw new Error("Priority must be a whole number");return s}),Q().int({message:"Priority must be a whole number"}).positive({message:"Priority must be greater than 0"}).nullable()]).nullable().optional()}),f={name:"",description:"",is_paused:!1,concurrency_limit:null,priority:null},he=({workPoolName:o,queueToEdit:s,onSubmit:r})=>{const{mutate:i,isPending:l}=I(),{mutate:n,isPending:c}=L(),a=ne({resolver:re(pe),defaultValues:f});return y.useEffect(()=>{s?a.reset({name:s.name,description:s.description??"",is_paused:s.is_paused??!1,concurrency_limit:s.concurrency_limit??null,priority:s.priority??null}):a.reset(f)},[a,s]),{form:a,saveOrUpdate:u=>{const m={...u,description:u.description||null};s?n({workPoolName:o,queueName:s.name,workQueueData:{...m,is_paused:m.is_paused??s.is_paused??!1}},{onSuccess:()=>{d.success("Work queue updated"),a.reset(f),r()},onError:t=>{const D=t.message||"Unknown error while updating work queue.";a.setError("root",{message:D})}}):i({workPoolName:o,workQueueData:m},{onSuccess:()=>{d.success("Work queue created"),a.reset(f),r()},onError:t=>{const D=t.message||"Unknown error while creating work queue.";a.setError("root",{message:D})}})},isLoading:l||c}},ge=({workPoolName:o,queueToEdit:s,open:r,onOpenChange:i,onSubmit:l})=>{const{form:n,isLoading:c,saveOrUpdate:a}=he({workPoolName:o,queueToEdit:s,onSubmit:l}),p=!!s,u=p?"Edit Work Queue":"Create Work Queue",m=p?"Save":"Create Work Queue";return e.jsx(A,{open:r,onOpenChange:i,children:e.jsxs(U,{"aria-describedby":void 0,children:[e.jsx(O,{children:e.jsx(R,{children:u})}),e.jsx(ie,{...n,children:e.jsxs("form",{onSubmit:t=>{n.handleSubmit(a)(t)},className:"space-y-4",children:[e.jsx(h,{children:n.formState.errors.root?.message}),e.jsx(j,{control:n.control,name:"name",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Name"}),e.jsx(k,{children:e.jsx(P,{type:"text",autoComplete:"off",...t})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"description",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Description"}),e.jsx(k,{children:e.jsx(le,{...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"concurrency_limit",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Flow Run Concurrency"}),e.jsx(k,{children:e.jsx(P,{type:"number",...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"priority",render:({field:t})=>e.jsxs(b,{children:[e.jsxs(w,{className:"flex items-center gap-2",children:["Priority",e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsx("button",{type:"button",className:"cursor-help",children:e.jsx(z,{id:"Info",className:"size-4"})})}),e.jsx(W,{children:e.jsx("p",{className:"text-xs",children:"Work on higher priority queues is executed first. Lower numbers have higher priority."})})]})]}),e.jsx(k,{children:e.jsx(P,{type:"number",...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsxs(B,{children:[e.jsx(V,{asChild:!0,children:e.jsx(N,{variant:"outline",children:"Cancel"})}),e.jsx(N,{type:"submit",loading:c,children:m})]})]})})]})})},xe=({queue:o,open:s,onOpenChange:r,onDeleted:i})=>{const l=$(),n=()=>{if(!o.work_pool_name){d.error("Work pool name is required");return}l.mutate({workPoolName:o.work_pool_name,queueName:o.name},{onSuccess:()=>{d.success("Work pool queue deleted successfully"),i?.(),r(!1)},onError:()=>{d.error("Failed to delete work pool queue")}})};return e.jsx(ce,{isOpen:s,title:"Delete Work Pool Queue",description:`Are you sure you want to delete the work pool queue "${o.name}"? This action cannot be undone.`,confirmText:o.name,isLoading:l.isPending,loadingText:"Deleting...",onConfirm:n,onClose:()=>r(!1)})},je=o=>{const s=T(),[r,i]=y.useState(!1),[l,n]=y.useState(!1),c=()=>{navigator.clipboard.writeText(o.id),d.success("ID copied to clipboard")},a=()=>{n(!0)},p=()=>{s({to:"/automations/create"})},u=o.name==="default";return{menuItems:[{label:"Copy ID",icon:q,action:c,show:!0},{label:"Edit",icon:de,action:a,show:!0},{label:"Delete",icon:H,action:()=>i(!0),show:!u,variant:"destructive"},{label:"Automate",icon:Y,action:p,show:!0}].filter(t=>t.show),showDeleteDialog:r,setShowDeleteDialog:i,showEditDialog:l,setShowEditDialog:n,triggerIcon:Z}},We=({queue:o,onUpdate:s,className:r})=>{const{menuItems:i,showDeleteDialog:l,setShowDeleteDialog:n,showEditDialog:c,setShowEditDialog:a,triggerIcon:p}=je(o);return e.jsxs(e.Fragment,{children:[e.jsxs(K,{children:[e.jsx(ee,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"icon",className:g("size-8",r),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(p,{className:"size-4"})]})}),e.jsx(oe,{align:"end",children:i.map(u=>{const m=u.icon;return e.jsxs(se,{onClick:u.action,className:g(u.variant==="destructive"&&"text-destructive"),children:[e.jsx(m,{className:"mr-2 h-4 w-4"}),u.label]},u.label)})})]}),e.jsx(xe,{queue:o,open:l,onOpenChange:n,onDeleted:s}),e.jsx(ge,{workPoolName:o.work_pool_name??"",queueToEdit:o,open:c,onOpenChange:a,onSubmit:()=>{a(!1),s?.()}})]})},be=(o,s)=>{const r=G(),i=X();return{handleToggle:y.useCallback(n=>{if(!o.work_pool_name){d.error("Work pool name is required");return}const c=n?i:r,a=n?"resumed":"paused";c.mutate({workPoolName:o.work_pool_name,queueName:o.name},{onSuccess:()=>{d.success(`Queue ${a} successfully`),s?.()},onError:()=>{d.error(`Failed to ${a.slice(0,-1)} queue`)}})},[o,r,i,s]),isLoading:r.isPending||i.isPending}},_e=({queue:o,onUpdate:s,disabled:r=!1,className:i})=>{const{handleToggle:l,isLoading:n}=be(o,s),c=o.status==="PAUSED",a=r||n;return e.jsx(S,{children:e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsx("div",{children:e.jsx(J,{checked:!c,onCheckedChange:l,disabled:a,"aria-label":c?"Resume work pool queue":"Pause work pool queue",className:g(i)})})}),e.jsx(W,{children:e.jsx("p",{children:"Pause or resume this work pool queue"})})]})})};export{de as S,Ce as W,_e as a,We as b,ge as c};
2
- //# sourceMappingURL=work-pool-queue-toggle-zSWhEFap.js.map
1
+ import{j as e,r as y,d as T}from"./vendor-tanstack-BdLtprmr.js";import{bK as E,bW as S,bT as v,bU as C,H as M,aZ as g,bM as F,bV as W,dq as I,dr as L,y as d,a2 as A,a3 as U,a4 as O,a5 as R,p as P,I as z,a7 as q,bk as B,q as N,ds as V,bL as $,bQ as H,bR as Z,bS as Y,dt as G,du as K,G as J}from"./index-CPpeVt8m.js";import{D as X,a as ee,b as oe,d as se}from"./dropdown-menu-fRiq5bS-.js";import{a as re}from"./zod-B1GLD-Zc.js";import{c as ne,o as ae,k as _,b as te,s as x,n as Q}from"./vendor-forms-BlFSCfFw.js";import{F as ie,a as h,b as j,c as b,d as w,e as k}from"./form-Cl5Hk9bq.js";import{T as le}from"./textarea-DFEOJJdc.js";import{D as ce}from"./delete-confirmation-dialog-BZg9EOfN.js";const ue=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],de=E("square-pen",ue),me={READY:{label:"Ready",color:"bg-green-500",tooltip:"Work queue has at least one actively polling worker ready to execute work."},PAUSED:{label:"Paused",color:"bg-yellow-500",tooltip:"Work queue is paused. No work will be executed."},NOT_READY:{label:"Not Ready",color:"bg-red-500",tooltip:"Work queue does not have any actively polling workers ready to execute work."}},Ce=({status:o,className:s})=>{const r=me[o];return e.jsx(S,{children:e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsxs(M,{variant:"secondary",className:g("flex items-center space-x-1 cursor-help",s),children:[o==="PAUSED"?e.jsx(F,{className:"h-2 w-2 text-muted-foreground"}):e.jsx("div",{className:g("h-2 w-2 rounded-full",r.color)}),e.jsx("span",{children:r.label})]})}),e.jsx(W,{children:e.jsx("p",{children:r.tooltip})})]})})},pe=ae({name:x().min(1,{message:"Name is required"}).regex(/^[a-zA-Z0-9_-]+$/,{message:"Name can only contain letters, numbers, hyphens, and underscores"}),description:x().nullable().optional(),is_paused:te().default(!1),concurrency_limit:_([x().transform(o=>{if(o===""||o===null||o===void 0)return null;const s=Number(o);if(Number.isNaN(s))return null;if(s<=0)throw new Error("Flow run concurrency must be greater than 0");return s}),Q().positive({message:"Flow run concurrency must be greater than 0"}).nullable()]).nullable().optional(),priority:_([x().transform(o=>{if(o===""||o===null||o===void 0)return null;const s=Number(o);if(Number.isNaN(s))return null;if(s<=0)throw new Error("Priority must be greater than 0");if(!Number.isInteger(s))throw new Error("Priority must be a whole number");return s}),Q().int({message:"Priority must be a whole number"}).positive({message:"Priority must be greater than 0"}).nullable()]).nullable().optional()}),f={name:"",description:"",is_paused:!1,concurrency_limit:null,priority:null},he=({workPoolName:o,queueToEdit:s,onSubmit:r})=>{const{mutate:i,isPending:l}=I(),{mutate:n,isPending:c}=L(),a=ne({resolver:re(pe),defaultValues:f});return y.useEffect(()=>{s?a.reset({name:s.name,description:s.description??"",is_paused:s.is_paused??!1,concurrency_limit:s.concurrency_limit??null,priority:s.priority??null}):a.reset(f)},[a,s]),{form:a,saveOrUpdate:u=>{const m={...u,description:u.description||null};s?n({workPoolName:o,queueName:s.name,workQueueData:{...m,is_paused:m.is_paused??s.is_paused??!1}},{onSuccess:()=>{d.success("Work queue updated"),a.reset(f),r()},onError:t=>{const D=t.message||"Unknown error while updating work queue.";a.setError("root",{message:D})}}):i({workPoolName:o,workQueueData:m},{onSuccess:()=>{d.success("Work queue created"),a.reset(f),r()},onError:t=>{const D=t.message||"Unknown error while creating work queue.";a.setError("root",{message:D})}})},isLoading:l||c}},ge=({workPoolName:o,queueToEdit:s,open:r,onOpenChange:i,onSubmit:l})=>{const{form:n,isLoading:c,saveOrUpdate:a}=he({workPoolName:o,queueToEdit:s,onSubmit:l}),p=!!s,u=p?"Edit Work Queue":"Create Work Queue",m=p?"Save":"Create Work Queue";return e.jsx(A,{open:r,onOpenChange:i,children:e.jsxs(U,{"aria-describedby":void 0,children:[e.jsx(O,{children:e.jsx(R,{children:u})}),e.jsx(ie,{...n,children:e.jsxs("form",{onSubmit:t=>{n.handleSubmit(a)(t)},className:"space-y-4",children:[e.jsx(h,{children:n.formState.errors.root?.message}),e.jsx(j,{control:n.control,name:"name",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Name"}),e.jsx(k,{children:e.jsx(P,{type:"text",autoComplete:"off",...t})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"description",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Description"}),e.jsx(k,{children:e.jsx(le,{...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"concurrency_limit",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Flow Run Concurrency"}),e.jsx(k,{children:e.jsx(P,{type:"number",...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"priority",render:({field:t})=>e.jsxs(b,{children:[e.jsxs(w,{className:"flex items-center gap-2",children:["Priority",e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsx("button",{type:"button",className:"cursor-help",children:e.jsx(z,{id:"Info",className:"size-4"})})}),e.jsx(W,{children:e.jsx("p",{className:"text-xs",children:"Work on higher priority queues is executed first. Lower numbers have higher priority."})})]})]}),e.jsx(k,{children:e.jsx(P,{type:"number",...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsxs(q,{children:[e.jsx(B,{asChild:!0,children:e.jsx(N,{variant:"outline",children:"Cancel"})}),e.jsx(N,{type:"submit",loading:c,children:m})]})]})})]})})},xe=({queue:o,open:s,onOpenChange:r,onDeleted:i})=>{const l=V(),n=()=>{if(!o.work_pool_name){d.error("Work pool name is required");return}l.mutate({workPoolName:o.work_pool_name,queueName:o.name},{onSuccess:()=>{d.success("Work pool queue deleted successfully"),i?.(),r(!1)},onError:()=>{d.error("Failed to delete work pool queue")}})};return e.jsx(ce,{isOpen:s,title:"Delete Work Pool Queue",description:`Are you sure you want to delete the work pool queue "${o.name}"? This action cannot be undone.`,confirmText:o.name,isLoading:l.isPending,loadingText:"Deleting...",onConfirm:n,onClose:()=>r(!1)})},je=o=>{const s=T(),[r,i]=y.useState(!1),[l,n]=y.useState(!1),c=()=>{navigator.clipboard.writeText(o.id),d.success("ID copied to clipboard")},a=()=>{n(!0)},p=()=>{s({to:"/automations/create"})},u=o.name==="default";return{menuItems:[{label:"Copy ID",icon:$,action:c,show:!0},{label:"Edit",icon:de,action:a,show:!0},{label:"Delete",icon:H,action:()=>i(!0),show:!u,variant:"destructive"},{label:"Automate",icon:Z,action:p,show:!0}].filter(t=>t.show),showDeleteDialog:r,setShowDeleteDialog:i,showEditDialog:l,setShowEditDialog:n,triggerIcon:Y}},We=({queue:o,onUpdate:s,className:r})=>{const{menuItems:i,showDeleteDialog:l,setShowDeleteDialog:n,showEditDialog:c,setShowEditDialog:a,triggerIcon:p}=je(o);return e.jsxs(e.Fragment,{children:[e.jsxs(X,{children:[e.jsx(ee,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"icon",className:g("size-8",r),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(p,{className:"size-4"})]})}),e.jsx(oe,{align:"end",children:i.map(u=>{const m=u.icon;return e.jsxs(se,{onClick:u.action,className:g(u.variant==="destructive"&&"text-destructive"),children:[e.jsx(m,{className:"mr-2 h-4 w-4"}),u.label]},u.label)})})]}),e.jsx(xe,{queue:o,open:l,onOpenChange:n,onDeleted:s}),e.jsx(ge,{workPoolName:o.work_pool_name??"",queueToEdit:o,open:c,onOpenChange:a,onSubmit:()=>{a(!1),s?.()}})]})},be=(o,s)=>{const r=G(),i=K();return{handleToggle:y.useCallback(n=>{if(!o.work_pool_name){d.error("Work pool name is required");return}const c=n?i:r,a=n?"resumed":"paused";c.mutate({workPoolName:o.work_pool_name,queueName:o.name},{onSuccess:()=>{d.success(`Queue ${a} successfully`),s?.()},onError:()=>{d.error(`Failed to ${a.slice(0,-1)} queue`)}})},[o,r,i,s]),isLoading:r.isPending||i.isPending}},_e=({queue:o,onUpdate:s,disabled:r=!1,className:i})=>{const{handleToggle:l,isLoading:n}=be(o,s),c=o.status==="PAUSED",a=r||n;return e.jsx(S,{children:e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsx("div",{children:e.jsx(J,{checked:!c,onCheckedChange:l,disabled:a,"aria-label":c?"Resume work pool queue":"Pause work pool queue",className:g(i)})})}),e.jsx(W,{children:e.jsx("p",{children:"Pause or resume this work pool queue"})})]})})};export{de as S,Ce as W,_e as a,We as b,ge as c};
2
+ //# sourceMappingURL=work-pool-queue-toggle-f_-cTWxB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"work-pool-queue-toggle-zSWhEFap.js","sources":["../../node_modules/lucide-react/dist/esm/icons/square-pen.js","../../src/components/work-pools/work-pool-queue-status-badge/work-pool-queue-status-badge.tsx","../../src/components/work-pools/work-pool-queue-create-dialog/use-create-work-pool-queue-form.ts","../../src/components/work-pools/work-pool-queue-create-dialog/work-pool-queue-create-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/components/delete-work-pool-queue-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/hooks/use-work-pool-queue-menu.ts","../../src/components/work-pools/work-pool-queue-menu/work-pool-queue-menu.tsx","../../src/components/work-pools/work-pool-queue-toggle/hooks/use-work-pool-queue-toggle.ts","../../src/components/work-pools/work-pool-queue-toggle/work-pool-queue-toggle.tsx"],"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 [\"path\", { d: \"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\", key: \"1m0v6g\" }],\n [\n \"path\",\n {\n d: \"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\",\n key: \"ohrbg2\"\n }\n ]\n];\nconst SquarePen = createLucideIcon(\"square-pen\", __iconNode);\n\nexport { __iconNode, SquarePen as default };\n//# sourceMappingURL=square-pen.js.map\n","import { Pause } from \"lucide-react\";\nimport type { WorkPoolQueueStatus } from \"@/api/work-pool-queues\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\n\ntype WorkPoolQueueStatusBadgeProps = {\n\tstatus: WorkPoolQueueStatus;\n\tclassName?: string;\n};\n\nconst statusConfig = {\n\tREADY: {\n\t\tlabel: \"Ready\",\n\t\tcolor: \"bg-green-500\",\n\t\ttooltip:\n\t\t\t\"Work queue has at least one actively polling worker ready to execute work.\",\n\t},\n\tPAUSED: {\n\t\tlabel: \"Paused\",\n\t\tcolor: \"bg-yellow-500\",\n\t\ttooltip: \"Work queue is paused. No work will be executed.\",\n\t},\n\tNOT_READY: {\n\t\tlabel: \"Not Ready\",\n\t\tcolor: \"bg-red-500\",\n\t\ttooltip:\n\t\t\t\"Work queue does not have any actively polling workers ready to execute work.\",\n\t},\n};\n\nexport const WorkPoolQueueStatusBadge = ({\n\tstatus,\n\tclassName,\n}: WorkPoolQueueStatusBadgeProps) => {\n\tconst config = statusConfig[status];\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<Badge\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName={cn(\"flex items-center space-x-1 cursor-help\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{status === \"PAUSED\" ? (\n\t\t\t\t\t\t\t<Pause className=\"h-2 w-2 text-muted-foreground\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className={cn(\"h-2 w-2 rounded-full\", config.color)} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span>{config.label}</span>\n\t\t\t\t\t</Badge>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>{config.tooltip}</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useEffect } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport {\n\tuseCreateWorkPoolQueueMutation,\n\tuseUpdateWorkPoolQueueMutation,\n\ttype WorkPoolQueue,\n} from \"@/api/work-pool-queues\";\n\nconst formSchema = z.object({\n\tname: z\n\t\t.string()\n\t\t.min(1, { message: \"Name is required\" })\n\t\t.regex(/^[a-zA-Z0-9_-]+$/, {\n\t\t\tmessage:\n\t\t\t\t\"Name can only contain letters, numbers, hyphens, and underscores\",\n\t\t}),\n\tdescription: z.string().nullable().optional(),\n\tis_paused: z.boolean().default(false),\n\tconcurrency_limit: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0)\n\t\t\t\t\tthrow new Error(\"Flow run concurrency must be greater than 0\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.positive({ message: \"Flow run concurrency must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n\tpriority: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0) throw new Error(\"Priority must be greater than 0\");\n\t\t\t\tif (!Number.isInteger(num))\n\t\t\t\t\tthrow new Error(\"Priority must be a whole number\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.int({ message: \"Priority must be a whole number\" })\n\t\t\t\t.positive({ message: \"Priority must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n});\n\nexport const DEFAULT_VALUES = {\n\tname: \"\",\n\tdescription: \"\",\n\tis_paused: false,\n\tconcurrency_limit: null,\n\tpriority: null,\n} as const;\n\ntype UseCreateOrEditWorkPoolQueueFormOptions = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditWorkPoolQueueForm = ({\n\tworkPoolName,\n\tqueueToEdit,\n\tonSubmit,\n}: UseCreateOrEditWorkPoolQueueFormOptions) => {\n\tconst { mutate: createWorkPoolQueue, isPending: isCreateLoading } =\n\t\tuseCreateWorkPoolQueueMutation();\n\tconst { mutate: updateWorkPoolQueue, isPending: isUpdateLoading } =\n\t\tuseUpdateWorkPoolQueueMutation();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with queue-to-edit data\n\tuseEffect(() => {\n\t\tif (queueToEdit) {\n\t\t\tform.reset({\n\t\t\t\tname: queueToEdit.name,\n\t\t\t\tdescription: queueToEdit.description ?? \"\",\n\t\t\t\tis_paused: queueToEdit.is_paused ?? false,\n\t\t\t\tconcurrency_limit: queueToEdit.concurrency_limit ?? null,\n\t\t\t\tpriority: queueToEdit.priority ?? null,\n\t\t\t});\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, queueToEdit]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst workQueueData = {\n\t\t\t...values,\n\t\t\tdescription: values.description || null,\n\t\t};\n\n\t\tif (queueToEdit) {\n\t\t\tupdateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tqueueName: queueToEdit.name,\n\t\t\t\t\tworkQueueData: {\n\t\t\t\t\t\t...workQueueData,\n\t\t\t\t\t\tis_paused:\n\t\t\t\t\t\t\tworkQueueData.is_paused ?? queueToEdit.is_paused ?? false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue updated\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\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 updating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tworkQueueData,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue created\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\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 creating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: isCreateLoading || isUpdateLoading,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Input } from \"@/components/ui/input\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\nimport { useCreateOrEditWorkPoolQueueForm } from \"./use-create-work-pool-queue-form\";\n\ntype WorkPoolQueueCreateOrEditDialogProps = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const WorkPoolQueueCreateOrEditDialog = ({\n\tworkPoolName,\n\tqueueToEdit,\n\topen,\n\tonOpenChange,\n\tonSubmit,\n}: WorkPoolQueueCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } = useCreateOrEditWorkPoolQueueForm({\n\t\tworkPoolName,\n\t\tqueueToEdit,\n\t\tonSubmit,\n\t});\n\n\tconst isEditMode = !!queueToEdit;\n\tconst dialogTitle = isEditMode ? \"Edit Work Queue\" : \"Create Work Queue\";\n\tconst submitButtonText = isEditMode ? \"Save\" : \"Create Work Queue\";\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>{dialogTitle}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(saveOrUpdate)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Name</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Description</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Textarea {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"concurrency_limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Flow Run Concurrency</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"priority\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t\t\tPriority\n\t\t\t\t\t\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type=\"button\" className=\"cursor-help\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon id=\"Info\" className=\"size-4\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipContent>\n\t\t\t\t\t\t\t\t\t\t\t\t<p className=\"text-xs\">\n\t\t\t\t\t\t\t\t\t\t\t\t\tWork on higher priority queues is executed first.\n\t\t\t\t\t\t\t\t\t\t\t\t\tLower numbers have higher priority.\n\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Cancel</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isLoading}>\n\t\t\t\t\t\t\t\t{submitButtonText}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { useDeleteWorkPoolQueueMutation } from \"@/api/work-pool-queues\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\ntype DeleteWorkPoolQueueDialogProps = {\n\tqueue: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonDeleted?: () => void;\n};\n\nexport const DeleteWorkPoolQueueDialog = ({\n\tqueue,\n\topen,\n\tonOpenChange,\n\tonDeleted,\n}: DeleteWorkPoolQueueDialogProps) => {\n\tconst deleteQueueMutation = useDeleteWorkPoolQueueMutation();\n\n\tconst handleDelete = () => {\n\t\tif (!queue.work_pool_name) {\n\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\treturn;\n\t\t}\n\n\t\tdeleteQueueMutation.mutate(\n\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Work pool queue deleted successfully\");\n\t\t\t\t\tonDeleted?.();\n\t\t\t\t\tonOpenChange(false);\n\t\t\t\t},\n\t\t\t\tonError: () => {\n\t\t\t\t\ttoast.error(\"Failed to delete work pool queue\");\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<DeleteConfirmationDialog\n\t\t\tisOpen={open}\n\t\t\ttitle=\"Delete Work Pool Queue\"\n\t\t\tdescription={`Are you sure you want to delete the work pool queue \"${queue.name}\"? This action cannot be undone.`}\n\t\t\tconfirmText={queue.name}\n\t\t\tisLoading={deleteQueueMutation.isPending}\n\t\t\tloadingText=\"Deleting...\"\n\t\t\tonConfirm={handleDelete}\n\t\t\tonClose={() => onOpenChange(false)}\n\t\t/>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { Copy, Edit, MoreVertical, Trash2, Zap } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueMenu = (queue: WorkPoolQueue) => {\n\tconst navigate = useNavigate();\n\tconst [showDeleteDialog, setShowDeleteDialog] = useState(false);\n\tconst [showEditDialog, setShowEditDialog] = useState(false);\n\n\tconst handleCopyId = () => {\n\t\tvoid navigator.clipboard.writeText(queue.id);\n\t\ttoast.success(\"ID copied to clipboard\");\n\t};\n\n\tconst handleEdit = () => {\n\t\tsetShowEditDialog(true);\n\t};\n\n\tconst handleAutomate = () => {\n\t\tvoid navigate({\n\t\t\tto: \"/automations/create\",\n\t\t});\n\t};\n\n\tconst isDefaultQueue = queue.name === \"default\";\n\n\tconst menuItems = [\n\t\t{\n\t\t\tlabel: \"Copy ID\",\n\t\t\ticon: Copy,\n\t\t\taction: handleCopyId,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Edit\",\n\t\t\ticon: Edit,\n\t\t\taction: handleEdit,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Delete\",\n\t\t\ticon: Trash2,\n\t\t\taction: () => setShowDeleteDialog(true),\n\t\t\tshow: !isDefaultQueue, // Default queue cannot be deleted\n\t\t\tvariant: \"destructive\" as const,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Automate\",\n\t\t\ticon: Zap,\n\t\t\taction: handleAutomate,\n\t\t\tshow: true,\n\t\t},\n\t].filter((item) => item.show);\n\n\treturn {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: MoreVertical,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { WorkPoolQueueCreateOrEditDialog } from \"@/components/work-pools/work-pool-queue-create-dialog\";\nimport { cn } from \"@/utils\";\nimport { DeleteWorkPoolQueueDialog } from \"./components/delete-work-pool-queue-dialog\";\nimport { useWorkPoolQueueMenu } from \"./hooks/use-work-pool-queue-menu\";\n\ntype WorkPoolQueueMenuProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueMenu = ({\n\tqueue,\n\tonUpdate,\n\tclassName,\n}: WorkPoolQueueMenuProps) => {\n\tconst {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: TriggerIcon,\n\t} = useWorkPoolQueueMenu(queue);\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName={cn(\"size-8\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t\t<TriggerIcon className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t\t{menuItems.map((item) => {\n\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\t\t\tkey={item.label}\n\t\t\t\t\t\t\t\tonClick={item.action}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\titem.variant === \"destructive\" && \"text-destructive\",\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon className=\"mr-2 h-4 w-4\" />\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t\t<DeleteWorkPoolQueueDialog\n\t\t\t\tqueue={queue}\n\t\t\t\topen={showDeleteDialog}\n\t\t\t\tonOpenChange={setShowDeleteDialog}\n\t\t\t\tonDeleted={onUpdate}\n\t\t\t/>\n\t\t\t<WorkPoolQueueCreateOrEditDialog\n\t\t\t\tworkPoolName={queue.work_pool_name ?? \"\"}\n\t\t\t\tqueueToEdit={queue}\n\t\t\t\topen={showEditDialog}\n\t\t\t\tonOpenChange={setShowEditDialog}\n\t\t\t\tonSubmit={() => {\n\t\t\t\t\tsetShowEditDialog(false);\n\t\t\t\t\tonUpdate?.();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n};\n","import { useCallback } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport {\n\tusePauseWorkPoolQueueMutation,\n\tuseResumeWorkPoolQueueMutation,\n} from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueToggle = (\n\tqueue: WorkPoolQueue,\n\tonUpdate?: () => void,\n) => {\n\tconst pauseMutation = usePauseWorkPoolQueueMutation();\n\tconst resumeMutation = useResumeWorkPoolQueueMutation();\n\n\tconst handleToggle = useCallback(\n\t\t(isResumed: boolean) => {\n\t\t\tif (!queue.work_pool_name) {\n\t\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mutation = isResumed ? resumeMutation : pauseMutation;\n\t\t\tconst action = isResumed ? \"resumed\" : \"paused\";\n\n\t\t\tmutation.mutate(\n\t\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(`Queue ${action} successfully`);\n\t\t\t\t\t\tonUpdate?.();\n\t\t\t\t\t},\n\t\t\t\t\tonError: () => {\n\t\t\t\t\t\ttoast.error(`Failed to ${action.slice(0, -1)} queue`);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\t[queue, pauseMutation, resumeMutation, onUpdate],\n\t);\n\n\treturn {\n\t\thandleToggle,\n\t\tisLoading: pauseMutation.isPending || resumeMutation.isPending,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Switch } from \"@/components/ui/switch\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\nimport { useWorkPoolQueueToggle } from \"./hooks/use-work-pool-queue-toggle\";\n\ntype WorkPoolQueueToggleProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueToggle = ({\n\tqueue,\n\tonUpdate,\n\tdisabled = false,\n\tclassName,\n}: WorkPoolQueueToggleProps) => {\n\tconst { handleToggle, isLoading } = useWorkPoolQueueToggle(queue, onUpdate);\n\tconst isPaused = queue.status === \"PAUSED\";\n\n\tconst isDisabled = disabled || isLoading;\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\tchecked={!isPaused}\n\t\t\t\t\t\t\tonCheckedChange={handleToggle}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tisPaused ? \"Resume work pool queue\" : \"Pause work pool queue\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName={cn(className)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>Pause or resume this work pool queue</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n"],"names":["__iconNode","SquarePen","createLucideIcon","statusConfig","WorkPoolQueueStatusBadge","status","className","config","jsx","TooltipProvider","jsxs","Tooltip","TooltipTrigger","Badge","cn","Pause","TooltipContent","formSchema","z.object","z.string","z.boolean","z.union","val","num","z.number","DEFAULT_VALUES","useCreateOrEditWorkPoolQueueForm","workPoolName","queueToEdit","onSubmit","createWorkPoolQueue","isCreateLoading","useCreateWorkPoolQueueMutation","updateWorkPoolQueue","isUpdateLoading","useUpdateWorkPoolQueueMutation","form","useForm","zodResolver","useEffect","values","workQueueData","toast","error","message","WorkPoolQueueCreateOrEditDialog","open","onOpenChange","isLoading","saveOrUpdate","isEditMode","dialogTitle","submitButtonText","Dialog","DialogContent","DialogHeader","DialogTitle","Form","e","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","Textarea","Icon","DialogFooter","DialogTrigger","Button","DeleteWorkPoolQueueDialog","queue","onDeleted","deleteQueueMutation","useDeleteWorkPoolQueueMutation","handleDelete","DeleteConfirmationDialog","useWorkPoolQueueMenu","navigate","useNavigate","showDeleteDialog","setShowDeleteDialog","useState","showEditDialog","setShowEditDialog","handleCopyId","handleEdit","handleAutomate","isDefaultQueue","Copy","Edit","Trash2","Zap","item","MoreVertical","WorkPoolQueueMenu","onUpdate","menuItems","TriggerIcon","Fragment","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","useWorkPoolQueueToggle","pauseMutation","usePauseWorkPoolQueueMutation","resumeMutation","useResumeWorkPoolQueueMutation","useCallback","isResumed","mutation","action","WorkPoolQueueToggle","disabled","handleToggle","isPaused","isDisabled","Switch"],"mappings":"orBASA,MAAMA,GAAa,CACjB,CAAC,OAAQ,CAAE,EAAG,6DAA8D,IAAK,QAAQ,CAAE,EAC3F,CACE,OACA,CACE,EAAG,0HACH,IAAK,QACX,CACA,CACA,EACMC,GAAYC,EAAiB,aAAcF,EAAU,ECHrDG,GAAe,CACpB,MAAO,CACN,MAAO,QACP,MAAO,eACP,QACC,4EAAA,EAEF,OAAQ,CACP,MAAO,SACP,MAAO,gBACP,QAAS,iDAAA,EAEV,UAAW,CACV,MAAO,YACP,MAAO,aACP,QACC,8EAAA,CAEH,EAEaC,GAA2B,CAAC,CACxC,OAAAC,EACA,UAAAC,CACD,IAAqC,CACpC,MAAMC,EAASJ,GAAaE,CAAM,EAElC,OACCG,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CAAe,QAAO,GACtB,SAAAF,EAAAA,KAACG,EAAA,CACA,QAAQ,YACR,UAAWC,EAAG,0CAA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,EAK/C,UAAWS,EAAc,WAAaE,EAAe,SAAA,CAEvD,EC3BaM,GAAsB,CAAC,CACnC,MAAA1C,EACA,SAAAyB,EACA,SAAAkB,EAAW,GACX,UAAA7G,CACD,IAAgC,CAC/B,KAAM,CAAE,aAAA8G,EAAc,UAAApE,CAAA,EAAcyD,GAAuBjC,EAAOyB,CAAQ,EACpEoB,EAAW7C,EAAM,SAAW,SAE5B8C,EAAaH,GAAYnE,EAE/B,OACCxC,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,MAACI,EAAA,CAAe,QAAO,GACtB,SAAAJ,MAAC,MAAA,CACA,SAAAA,EAAAA,IAAC+G,EAAA,CACA,QAAS,CAACF,EACV,gBAAiBD,EACjB,SAAUE,EACV,aACCD,EAAW,yBAA2B,wBAEvC,UAAWvG,EAAGR,CAAS,CAAA,CAAA,EAEzB,CAAA,CACD,EACAE,MAACQ,EAAA,CACA,SAAAR,EAAAA,IAAC,IAAA,CAAE,gDAAoC,CAAA,CACxC,CAAA,CAAA,CACD,CAAA,CACD,CAEF","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"work-pool-queue-toggle-f_-cTWxB.js","sources":["../../node_modules/lucide-react/dist/esm/icons/square-pen.js","../../src/components/work-pools/work-pool-queue-status-badge/work-pool-queue-status-badge.tsx","../../src/components/work-pools/work-pool-queue-create-dialog/use-create-work-pool-queue-form.ts","../../src/components/work-pools/work-pool-queue-create-dialog/work-pool-queue-create-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/components/delete-work-pool-queue-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/hooks/use-work-pool-queue-menu.ts","../../src/components/work-pools/work-pool-queue-menu/work-pool-queue-menu.tsx","../../src/components/work-pools/work-pool-queue-toggle/hooks/use-work-pool-queue-toggle.ts","../../src/components/work-pools/work-pool-queue-toggle/work-pool-queue-toggle.tsx"],"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 [\"path\", { d: \"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\", key: \"1m0v6g\" }],\n [\n \"path\",\n {\n d: \"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\",\n key: \"ohrbg2\"\n }\n ]\n];\nconst SquarePen = createLucideIcon(\"square-pen\", __iconNode);\n\nexport { __iconNode, SquarePen as default };\n//# sourceMappingURL=square-pen.js.map\n","import { Pause } from \"lucide-react\";\nimport type { WorkPoolQueueStatus } from \"@/api/work-pool-queues\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\n\ntype WorkPoolQueueStatusBadgeProps = {\n\tstatus: WorkPoolQueueStatus;\n\tclassName?: string;\n};\n\nconst statusConfig = {\n\tREADY: {\n\t\tlabel: \"Ready\",\n\t\tcolor: \"bg-green-500\",\n\t\ttooltip:\n\t\t\t\"Work queue has at least one actively polling worker ready to execute work.\",\n\t},\n\tPAUSED: {\n\t\tlabel: \"Paused\",\n\t\tcolor: \"bg-yellow-500\",\n\t\ttooltip: \"Work queue is paused. No work will be executed.\",\n\t},\n\tNOT_READY: {\n\t\tlabel: \"Not Ready\",\n\t\tcolor: \"bg-red-500\",\n\t\ttooltip:\n\t\t\t\"Work queue does not have any actively polling workers ready to execute work.\",\n\t},\n};\n\nexport const WorkPoolQueueStatusBadge = ({\n\tstatus,\n\tclassName,\n}: WorkPoolQueueStatusBadgeProps) => {\n\tconst config = statusConfig[status];\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<Badge\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName={cn(\"flex items-center space-x-1 cursor-help\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{status === \"PAUSED\" ? (\n\t\t\t\t\t\t\t<Pause className=\"h-2 w-2 text-muted-foreground\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className={cn(\"h-2 w-2 rounded-full\", config.color)} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span>{config.label}</span>\n\t\t\t\t\t</Badge>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>{config.tooltip}</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useEffect } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport {\n\tuseCreateWorkPoolQueueMutation,\n\tuseUpdateWorkPoolQueueMutation,\n\ttype WorkPoolQueue,\n} from \"@/api/work-pool-queues\";\n\nconst formSchema = z.object({\n\tname: z\n\t\t.string()\n\t\t.min(1, { message: \"Name is required\" })\n\t\t.regex(/^[a-zA-Z0-9_-]+$/, {\n\t\t\tmessage:\n\t\t\t\t\"Name can only contain letters, numbers, hyphens, and underscores\",\n\t\t}),\n\tdescription: z.string().nullable().optional(),\n\tis_paused: z.boolean().default(false),\n\tconcurrency_limit: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0)\n\t\t\t\t\tthrow new Error(\"Flow run concurrency must be greater than 0\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.positive({ message: \"Flow run concurrency must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n\tpriority: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0) throw new Error(\"Priority must be greater than 0\");\n\t\t\t\tif (!Number.isInteger(num))\n\t\t\t\t\tthrow new Error(\"Priority must be a whole number\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.int({ message: \"Priority must be a whole number\" })\n\t\t\t\t.positive({ message: \"Priority must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n});\n\nexport const DEFAULT_VALUES = {\n\tname: \"\",\n\tdescription: \"\",\n\tis_paused: false,\n\tconcurrency_limit: null,\n\tpriority: null,\n} as const;\n\ntype UseCreateOrEditWorkPoolQueueFormOptions = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditWorkPoolQueueForm = ({\n\tworkPoolName,\n\tqueueToEdit,\n\tonSubmit,\n}: UseCreateOrEditWorkPoolQueueFormOptions) => {\n\tconst { mutate: createWorkPoolQueue, isPending: isCreateLoading } =\n\t\tuseCreateWorkPoolQueueMutation();\n\tconst { mutate: updateWorkPoolQueue, isPending: isUpdateLoading } =\n\t\tuseUpdateWorkPoolQueueMutation();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with queue-to-edit data\n\tuseEffect(() => {\n\t\tif (queueToEdit) {\n\t\t\tform.reset({\n\t\t\t\tname: queueToEdit.name,\n\t\t\t\tdescription: queueToEdit.description ?? \"\",\n\t\t\t\tis_paused: queueToEdit.is_paused ?? false,\n\t\t\t\tconcurrency_limit: queueToEdit.concurrency_limit ?? null,\n\t\t\t\tpriority: queueToEdit.priority ?? null,\n\t\t\t});\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, queueToEdit]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst workQueueData = {\n\t\t\t...values,\n\t\t\tdescription: values.description || null,\n\t\t};\n\n\t\tif (queueToEdit) {\n\t\t\tupdateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tqueueName: queueToEdit.name,\n\t\t\t\t\tworkQueueData: {\n\t\t\t\t\t\t...workQueueData,\n\t\t\t\t\t\tis_paused:\n\t\t\t\t\t\t\tworkQueueData.is_paused ?? queueToEdit.is_paused ?? false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue updated\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\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 updating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tworkQueueData,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue created\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\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 creating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: isCreateLoading || isUpdateLoading,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Input } from \"@/components/ui/input\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\nimport { useCreateOrEditWorkPoolQueueForm } from \"./use-create-work-pool-queue-form\";\n\ntype WorkPoolQueueCreateOrEditDialogProps = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const WorkPoolQueueCreateOrEditDialog = ({\n\tworkPoolName,\n\tqueueToEdit,\n\topen,\n\tonOpenChange,\n\tonSubmit,\n}: WorkPoolQueueCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } = useCreateOrEditWorkPoolQueueForm({\n\t\tworkPoolName,\n\t\tqueueToEdit,\n\t\tonSubmit,\n\t});\n\n\tconst isEditMode = !!queueToEdit;\n\tconst dialogTitle = isEditMode ? \"Edit Work Queue\" : \"Create Work Queue\";\n\tconst submitButtonText = isEditMode ? \"Save\" : \"Create Work Queue\";\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>{dialogTitle}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(saveOrUpdate)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Name</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Description</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Textarea {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"concurrency_limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Flow Run Concurrency</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"priority\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t\t\tPriority\n\t\t\t\t\t\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type=\"button\" className=\"cursor-help\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon id=\"Info\" className=\"size-4\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipContent>\n\t\t\t\t\t\t\t\t\t\t\t\t<p className=\"text-xs\">\n\t\t\t\t\t\t\t\t\t\t\t\t\tWork on higher priority queues is executed first.\n\t\t\t\t\t\t\t\t\t\t\t\t\tLower numbers have higher priority.\n\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Cancel</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isLoading}>\n\t\t\t\t\t\t\t\t{submitButtonText}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { useDeleteWorkPoolQueueMutation } from \"@/api/work-pool-queues\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\ntype DeleteWorkPoolQueueDialogProps = {\n\tqueue: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonDeleted?: () => void;\n};\n\nexport const DeleteWorkPoolQueueDialog = ({\n\tqueue,\n\topen,\n\tonOpenChange,\n\tonDeleted,\n}: DeleteWorkPoolQueueDialogProps) => {\n\tconst deleteQueueMutation = useDeleteWorkPoolQueueMutation();\n\n\tconst handleDelete = () => {\n\t\tif (!queue.work_pool_name) {\n\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\treturn;\n\t\t}\n\n\t\tdeleteQueueMutation.mutate(\n\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Work pool queue deleted successfully\");\n\t\t\t\t\tonDeleted?.();\n\t\t\t\t\tonOpenChange(false);\n\t\t\t\t},\n\t\t\t\tonError: () => {\n\t\t\t\t\ttoast.error(\"Failed to delete work pool queue\");\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<DeleteConfirmationDialog\n\t\t\tisOpen={open}\n\t\t\ttitle=\"Delete Work Pool Queue\"\n\t\t\tdescription={`Are you sure you want to delete the work pool queue \"${queue.name}\"? This action cannot be undone.`}\n\t\t\tconfirmText={queue.name}\n\t\t\tisLoading={deleteQueueMutation.isPending}\n\t\t\tloadingText=\"Deleting...\"\n\t\t\tonConfirm={handleDelete}\n\t\t\tonClose={() => onOpenChange(false)}\n\t\t/>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { Copy, Edit, MoreVertical, Trash2, Zap } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueMenu = (queue: WorkPoolQueue) => {\n\tconst navigate = useNavigate();\n\tconst [showDeleteDialog, setShowDeleteDialog] = useState(false);\n\tconst [showEditDialog, setShowEditDialog] = useState(false);\n\n\tconst handleCopyId = () => {\n\t\tvoid navigator.clipboard.writeText(queue.id);\n\t\ttoast.success(\"ID copied to clipboard\");\n\t};\n\n\tconst handleEdit = () => {\n\t\tsetShowEditDialog(true);\n\t};\n\n\tconst handleAutomate = () => {\n\t\tvoid navigate({\n\t\t\tto: \"/automations/create\",\n\t\t});\n\t};\n\n\tconst isDefaultQueue = queue.name === \"default\";\n\n\tconst menuItems = [\n\t\t{\n\t\t\tlabel: \"Copy ID\",\n\t\t\ticon: Copy,\n\t\t\taction: handleCopyId,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Edit\",\n\t\t\ticon: Edit,\n\t\t\taction: handleEdit,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Delete\",\n\t\t\ticon: Trash2,\n\t\t\taction: () => setShowDeleteDialog(true),\n\t\t\tshow: !isDefaultQueue, // Default queue cannot be deleted\n\t\t\tvariant: \"destructive\" as const,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Automate\",\n\t\t\ticon: Zap,\n\t\t\taction: handleAutomate,\n\t\t\tshow: true,\n\t\t},\n\t].filter((item) => item.show);\n\n\treturn {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: MoreVertical,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { WorkPoolQueueCreateOrEditDialog } from \"@/components/work-pools/work-pool-queue-create-dialog\";\nimport { cn } from \"@/utils\";\nimport { DeleteWorkPoolQueueDialog } from \"./components/delete-work-pool-queue-dialog\";\nimport { useWorkPoolQueueMenu } from \"./hooks/use-work-pool-queue-menu\";\n\ntype WorkPoolQueueMenuProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueMenu = ({\n\tqueue,\n\tonUpdate,\n\tclassName,\n}: WorkPoolQueueMenuProps) => {\n\tconst {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: TriggerIcon,\n\t} = useWorkPoolQueueMenu(queue);\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName={cn(\"size-8\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t\t<TriggerIcon className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t\t{menuItems.map((item) => {\n\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\t\t\tkey={item.label}\n\t\t\t\t\t\t\t\tonClick={item.action}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\titem.variant === \"destructive\" && \"text-destructive\",\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon className=\"mr-2 h-4 w-4\" />\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t\t<DeleteWorkPoolQueueDialog\n\t\t\t\tqueue={queue}\n\t\t\t\topen={showDeleteDialog}\n\t\t\t\tonOpenChange={setShowDeleteDialog}\n\t\t\t\tonDeleted={onUpdate}\n\t\t\t/>\n\t\t\t<WorkPoolQueueCreateOrEditDialog\n\t\t\t\tworkPoolName={queue.work_pool_name ?? \"\"}\n\t\t\t\tqueueToEdit={queue}\n\t\t\t\topen={showEditDialog}\n\t\t\t\tonOpenChange={setShowEditDialog}\n\t\t\t\tonSubmit={() => {\n\t\t\t\t\tsetShowEditDialog(false);\n\t\t\t\t\tonUpdate?.();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n};\n","import { useCallback } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport {\n\tusePauseWorkPoolQueueMutation,\n\tuseResumeWorkPoolQueueMutation,\n} from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueToggle = (\n\tqueue: WorkPoolQueue,\n\tonUpdate?: () => void,\n) => {\n\tconst pauseMutation = usePauseWorkPoolQueueMutation();\n\tconst resumeMutation = useResumeWorkPoolQueueMutation();\n\n\tconst handleToggle = useCallback(\n\t\t(isResumed: boolean) => {\n\t\t\tif (!queue.work_pool_name) {\n\t\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mutation = isResumed ? resumeMutation : pauseMutation;\n\t\t\tconst action = isResumed ? \"resumed\" : \"paused\";\n\n\t\t\tmutation.mutate(\n\t\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(`Queue ${action} successfully`);\n\t\t\t\t\t\tonUpdate?.();\n\t\t\t\t\t},\n\t\t\t\t\tonError: () => {\n\t\t\t\t\t\ttoast.error(`Failed to ${action.slice(0, -1)} queue`);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\t[queue, pauseMutation, resumeMutation, onUpdate],\n\t);\n\n\treturn {\n\t\thandleToggle,\n\t\tisLoading: pauseMutation.isPending || resumeMutation.isPending,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Switch } from \"@/components/ui/switch\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\nimport { useWorkPoolQueueToggle } from \"./hooks/use-work-pool-queue-toggle\";\n\ntype WorkPoolQueueToggleProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueToggle = ({\n\tqueue,\n\tonUpdate,\n\tdisabled = false,\n\tclassName,\n}: WorkPoolQueueToggleProps) => {\n\tconst { handleToggle, isLoading } = useWorkPoolQueueToggle(queue, onUpdate);\n\tconst isPaused = queue.status === \"PAUSED\";\n\n\tconst isDisabled = disabled || isLoading;\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\tchecked={!isPaused}\n\t\t\t\t\t\t\tonCheckedChange={handleToggle}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tisPaused ? \"Resume work pool queue\" : \"Pause work pool queue\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName={cn(className)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>Pause or resume this work pool queue</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n"],"names":["__iconNode","SquarePen","createLucideIcon","statusConfig","WorkPoolQueueStatusBadge","status","className","config","jsx","TooltipProvider","jsxs","Tooltip","TooltipTrigger","Badge","cn","Pause","TooltipContent","formSchema","z.object","z.string","z.boolean","z.union","val","num","z.number","DEFAULT_VALUES","useCreateOrEditWorkPoolQueueForm","workPoolName","queueToEdit","onSubmit","createWorkPoolQueue","isCreateLoading","useCreateWorkPoolQueueMutation","updateWorkPoolQueue","isUpdateLoading","useUpdateWorkPoolQueueMutation","form","useForm","zodResolver","useEffect","values","workQueueData","toast","error","message","WorkPoolQueueCreateOrEditDialog","open","onOpenChange","isLoading","saveOrUpdate","isEditMode","dialogTitle","submitButtonText","Dialog","DialogContent","DialogHeader","DialogTitle","Form","e","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","Textarea","Icon","DialogFooter","DialogTrigger","Button","DeleteWorkPoolQueueDialog","queue","onDeleted","deleteQueueMutation","useDeleteWorkPoolQueueMutation","handleDelete","DeleteConfirmationDialog","useWorkPoolQueueMenu","navigate","useNavigate","showDeleteDialog","setShowDeleteDialog","useState","showEditDialog","setShowEditDialog","handleCopyId","handleEdit","handleAutomate","isDefaultQueue","Copy","Edit","Trash2","Zap","item","MoreVertical","WorkPoolQueueMenu","onUpdate","menuItems","TriggerIcon","Fragment","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","useWorkPoolQueueToggle","pauseMutation","usePauseWorkPoolQueueMutation","resumeMutation","useResumeWorkPoolQueueMutation","useCallback","isResumed","mutation","action","WorkPoolQueueToggle","disabled","handleToggle","isPaused","isDisabled","Switch"],"mappings":"orBASA,MAAMA,GAAa,CACjB,CAAC,OAAQ,CAAE,EAAG,6DAA8D,IAAK,QAAQ,CAAE,EAC3F,CACE,OACA,CACE,EAAG,0HACH,IAAK,QACX,CACA,CACA,EACMC,GAAYC,EAAiB,aAAcF,EAAU,ECHrDG,GAAe,CACpB,MAAO,CACN,MAAO,QACP,MAAO,eACP,QACC,4EAAA,EAEF,OAAQ,CACP,MAAO,SACP,MAAO,gBACP,QAAS,iDAAA,EAEV,UAAW,CACV,MAAO,YACP,MAAO,aACP,QACC,8EAAA,CAEH,EAEaC,GAA2B,CAAC,CACxC,OAAAC,EACA,UAAAC,CACD,IAAqC,CACpC,MAAMC,EAASJ,GAAaE,CAAM,EAElC,OACCG,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CAAe,QAAO,GACtB,SAAAF,EAAAA,KAACG,EAAA,CACA,QAAQ,YACR,UAAWC,EAAG,0CAA2CR,CAAS,EAEjE,SAAA,CAAAD,IAAW,SACXG,EAAAA,IAACO,EAAA,CAAM,UAAU,gCAAgC,EAEjDP,EAAAA,IAAC,MAAA,CAAI,UAAWM,EAAG,uBAAwBP,EAAO,KAAK,EAAG,EAE3DC,EAAAA,IAAC,OAAA,CAAM,SAAAD,EAAO,KAAA,CAAM,CAAA,CAAA,CAAA,EAEtB,QACCS,EAAA,CACA,SAAAR,EAAAA,IAAC,IAAA,CAAG,SAAAD,EAAO,QAAQ,CAAA,CACpB,CAAA,CAAA,CACD,CAAA,CACD,CAEF,ECrDMU,GAAaC,GAAS,CAC3B,KAAMC,IAEJ,IAAI,EAAG,CAAE,QAAS,kBAAA,CAAoB,EACtC,MAAM,mBAAoB,CAC1B,Q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AAiBD,EACjB,SAAUE,EACV,aACCD,EAAW,yBAA2B,wBAEvC,UAAWvG,EAAGR,CAAS,CAAA,CAAA,EAEzB,CAAA,CACD,EACAE,MAACQ,EAAA,CACA,SAAAR,EAAAA,IAAC,IAAA,CAAE,gDAAoC,CAAA,CACxC,CAAA,CAAA,CACD,CAAA,CACD,CAEF","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{r as c,j as e,t as k,d as I,L as J,C as G,H as Z,D as X,G as pe,n as ge,s as L}from"./vendor-tanstack-BdLtprmr.js";import{bL as je,a_ as x,q as C,bM as R,y as w,bi as fe,bh as be,af as ee,H as Q,bN as we,bO as ye,M as se,bC as Ne,bP as W,bQ as ve,aI as Ce,aG as ae,V as ke,J as Se,bR as te,bS as _e,bT as De,A as Te,F as We,bU as A,bV as O,G as Fe,bW as B,B as Ee,g as Me,h as z,bw as Pe,bF as Ie,bH as Le,bX as ne,aw as Re,bY as le,bZ as P,p as re,E as q,t as V,v as K,w as Y,x as Qe,b_ as Ae,b$ as Oe,c0 as E,c1 as Be,c2 as $e,c3 as ze,c4 as qe,c5 as Ve,aA as Ke,aB as Ye,aC as Ue,aD as T,b9 as h,c6 as He}from"./index-V_xTKaEb.js";import{D as Je}from"./index-DlAHvqFx.js";import{S as Ge,a as Ze,F as Xe}from"./flow-runs-pagination-CykMKOhv.js";import{D as oe,a as ie,b as ce,d as de}from"./dropdown-menu-B9LKPlz7.js";import{D as ue}from"./delete-confirmation-dialog-dLycVNo4.js";import{S as es,W as ss,a as as,b as ts,c as ns}from"./work-pool-queue-toggle-zSWhEFap.js";import{D as me}from"./data-table-QSHqmTar.js";import{o as ls,e as rs}from"./vendor-forms-BlFSCfFw.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-date-Cl1Jav-N.js";import"./use-quick-run-DzSmbSlu.js";import"./use-delete-confirmation-dialog-CkL-rSsp.js";import"./index-BTL1xHS9.js";import"./cronstrue-p-STK_QW.js";import"./use-is-overflowing-CDFKqB6i.js";import"./index-B9ttjsyu.js";import"./tags-input-2KSBvO_K.js";import"./zod-B1GLD-Zc.js";import"./form-DOdmIC3A.js";import"./textarea-9v5uTuxg.js";import"./table-ChOwO4Pk.js";const os=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],is=je("circle-question-mark",os),he=({command:s,title:a,subtitle:t,className:n})=>{const[o,l]=c.useState(!1),r=async()=>{if(!o){l(!0);try{await navigator.clipboard.writeText(s),w.success("Command copied to clipboard")}catch{w.error("Failed to copy command")}finally{l(!1)}}};return e.jsxs("div",{className:x("space-y-4",n),children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-1",children:a}),e.jsx("p",{className:"text-muted-foreground text-sm",children:t})]}),e.jsxs("div",{className:"bg-muted border border-border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"bg-muted/80 border-b border-border px-3 py-2 flex items-center space-x-2",children:[e.jsxs("div",{className:"flex space-x-1",children:[e.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"})]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:r,disabled:o,className:"ml-auto text-muted-foreground hover:text-foreground hover:bg-muted h-6 w-6 p-0",children:e.jsx(R,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"bg-gray-800 dark:bg-gray-900 px-4 py-2",children:e.jsxs("p",{className:"py-1",children:[e.jsx("code",{className:"font-mono text-sm text-gray-300 select-all",children:s}),e.jsx("span",{className:"ml-1 -mb-1 inline-block w-[7px] h-[18px] bg-gray-400 terminal-cursor"})]})})]})]})},cs=({workPoolName:s,className:a})=>{const[t,n]=c.useState({pageIndex:0,pageSize:50}),[o,l]=c.useState("CREATED_DESC"),[r,i]=c.useState([]),d=c.useMemo(()=>({page:t.pageIndex+1,limit:t.pageSize,sort:o,work_pools:{operator:"and_",name:{any_:[s]}},deployments:{operator:"and_",flow_or_deployment_name:{like_:r.find(f=>f.id==="flowOrDeploymentName")?.value??""},tags:{operator:"and_",all_:r.find(f=>f.id==="tags")?.value??[]}}}),[s,t,o,r]),b=c.useMemo(()=>({offset:0,sort:"CREATED_DESC",work_pools:{operator:"and_",name:{any_:[s]}}}),[s]),{data:u}=k(fe(d)),{data:g}=k(be(b)),y=c.useMemo(()=>[...new Set((u?.results??[]).map(f=>f.flow_id))],[u?.results]),{data:v}=k(ee({flows:{operator:"and_",id:{any_:y}},offset:0,sort:"NAME_ASC"},{enabled:y.length>0})),j=c.useMemo(()=>{if(!u?.results)return[];const f=new Map(v?.map(S=>[S.id,S])??[]);return u.results.map(S=>({...S,flow:f.get(S.flow_id)}))},[u?.results,v]),N=c.useCallback(f=>{n(f)},[]),D=c.useCallback(f=>{l(f)},[]),F=c.useCallback(f=>{i(f)},[]);return!u||g===void 0?e.jsx("div",{className:a,children:e.jsx("div",{className:"text-muted-foreground text-center py-8",children:"Loading deployments..."})}):e.jsx("div",{className:a,children:e.jsx(Je,{deployments:j,currentDeploymentsCount:g,pageCount:u.pages,pagination:t,sort:o,columnFilters:r,onPaginationChange:N,onSortChange:D,onColumnFiltersChange:F})})},ds=s=>{switch(s){case"READY":return"Ready";case"PAUSED":return"Paused";case"NOT_READY":return"Not Ready"}},us=s=>{switch(s){case"READY":return"bg-green-500";case"PAUSED":return"bg-yellow-500";case"NOT_READY":return"bg-red-500"}},ms=({status:s,className:a})=>{const t=ds(s),n=us(s);return e.jsxs(Q,{variant:"secondary",className:x("flex items-center space-x-1",a),children:[s==="PAUSED"?e.jsx(we,{className:"h-2 w-2 text-muted-foreground"}):e.jsx("div",{className:x("h-2 w-2 rounded-full",n)}),e.jsx("span",{children:t})]})},M=()=>e.jsx("dd",{className:"text-muted-foreground text-sm",children:"None"}),hs=({children:s})=>e.jsx("dt",{className:"text-sm text-muted-foreground",children:s}),_=({children:s,className:a})=>e.jsx("dd",{className:x("text-sm",a),children:s});function xs({workPool:s}){const{data:a=[],isLoading:t}=k(se(s.name)),n=c.useMemo(()=>t||a.length===0?null:a.map(r=>r.last_heartbeat_time).filter(r=>!!r).sort((r,i)=>new Date(i).getTime()-new Date(r).getTime())[0]||null,[a,t]),o=[{field:"Status",ComponentValue:()=>e.jsx("dd",{children:e.jsx(ms,{status:s.status||"NOT_READY"})})},{field:"Description",ComponentValue:()=>s.description?e.jsx(_,{children:s.description}):null},{field:"Type",ComponentValue:()=>s.type?e.jsx(_,{children:Ne(s.type)}):e.jsx(M,{})},{field:"Concurrency Limit",ComponentValue:()=>e.jsx(_,{children:s.concurrency_limit?String(s.concurrency_limit):"Unlimited"})},{field:"Last Polled",ComponentValue:()=>n?e.jsx(_,{children:e.jsx(W,{date:n})}):a.length===0?null:e.jsx(_,{className:"text-muted-foreground",children:"No recent activity"})},{field:"Created",ComponentValue:()=>s.created?e.jsx(_,{children:e.jsx(W,{date:s.created})}):e.jsx(M,{})},{field:"Last Updated",ComponentValue:()=>s.updated?e.jsx(_,{children:e.jsx(W,{date:s.updated})}):e.jsx(M,{})}].filter(({ComponentValue:l})=>l()!==null);return t?e.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading work pool details..."}):e.jsx("div",{children:e.jsx("ul",{className:"flex flex-col gap-3",children:o.map(({field:l,ComponentValue:r})=>e.jsx("li",{children:e.jsxs("dl",{children:[e.jsx(hs,{children:l}),e.jsx(r,{})]})},l))})})}function ps({workPool:s}){const a=s.base_job_template;if(!a?.variables||typeof a.variables!="object"||!("properties"in a.variables)||!a.variables.properties)return null;const t=a.variables.properties,n=(l,r)=>r.title||l.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),o=l=>l==null?"None":typeof l=="boolean"?l.toString():Array.isArray(l)?l.length>0?l.join(", "):"None":typeof l=="object"?JSON.stringify(l):String(l);return e.jsxs("div",{children:[e.jsx("h3",{className:"mb-4 text-md",children:"Base Job Configuration"}),e.jsx("ul",{className:"flex flex-col gap-3",children:Object.entries(t).map(([l,r])=>{const i=r.default??null;return e.jsxs("li",{className:"flex flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground font-medium",children:n(l,r)}),e.jsx("span",{className:"break-words",children:o(i)})]},l)})})]})}function U({workPool:s,alternate:a=!1,className:t}){const n=a?"space-y-4":"space-y-6";return e.jsxs("div",{className:x(n,t),children:[e.jsx(xs,{workPool:s}),!!(s.base_job_template?.variables&&typeof s.base_job_template.variables=="object"&&"properties"in s.base_job_template.variables&&s.base_job_template.variables.properties&&Object.keys(s.base_job_template.variables.properties).length>0)&&e.jsxs(e.Fragment,{children:[e.jsx(ye,{}),e.jsx(ps,{workPool:s})]})]})}const gs=({workPoolName:s,className:a})=>{const[t,n]=c.useState({limit:10,page:1}),[o,l]=c.useState(""),[r,i]=c.useState(new Set),d=ve(o,500),b=c.useMemo(()=>{const m={page:t.page,limit:t.limit,sort:"START_TIME_DESC",work_pools:{operator:"and_",name:{any_:[s]}}};if(d.trim()&&(m.flow_runs={operator:"and_",name:{like_:d.trim()}}),r.size>0){const p={state:{operator:"and_",name:{any_:Array.from(r)}}};m.flow_runs?m.flow_runs={...m.flow_runs,...p}:m.flow_runs={operator:"and_",...p}}return m},[s,t,d,r]),u=c.useMemo(()=>{const m={work_pools:{operator:"and_",name:{any_:[s]}}};if(d.trim()&&(m.flow_runs={operator:"and_",name:{like_:d.trim()}}),r.size>0){const p={state:{operator:"and_",name:{any_:Array.from(r)}}};m.flow_runs?m.flow_runs={...m.flow_runs,...p}:m.flow_runs={operator:"and_",...p}}return m},[s,d,r]),{data:g}=k(Ce(b)),{data:y}=k(ae(u)),v=c.useMemo(()=>[...new Set((g?.results??[]).map(m=>m.flow_id))],[g?.results]),{data:j}=k(ee({flows:{operator:"and_",id:{any_:v}},offset:0,sort:"NAME_ASC"},{enabled:v.length>0})),N=c.useMemo(()=>{if(!g?.results)return[];const m=new Map(j?.map(p=>[p.id,p])??[]);return g.results.map(p=>{const $=m.get(p.flow_id);return $?{...p,flow:$}:null}).filter(p=>p!==null)},[g?.results,j]),D=c.useCallback(m=>{l(m.target.value),n(p=>({...p,page:1}))},[]),F=c.useCallback(m=>{n(m)},[]),f=c.useCallback(m=>{i(m),n(p=>({...p,page:1}))},[]),S=c.useCallback(()=>{l(""),i(new Set),n(m=>({...m,page:1}))},[]);return!g||y===void 0?e.jsx("div",{className:a,children:e.jsx("div",{className:"text-muted-foreground text-center py-8",children:"Loading flow runs..."})}):e.jsxs("div",{className:a,children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ke,{placeholder:"Search flow runs by name...",value:o,onChange:D,debounceMs:500})}),e.jsx("div",{className:"w-full sm:w-64",children:e.jsx(Ge,{selectedFilters:r,onSelectFilter:f})})]}),e.jsx(Ze,{flowRuns:N,onClearFilters:N.length===0?S:void 0}),g.pages>1&&e.jsx("div",{className:"mt-6",children:e.jsx(Xe,{count:y,pages:g.pages,pagination:t,onChangePagination:F})})]})},js=({workPool:s,open:a,onOpenChange:t,onDeleted:n})=>{const o=I(),{deleteWorkPool:l,isPending:r}=Se(),i=()=>{l(s.name,{onSuccess:()=>{w.success("Work pool deleted successfully"),n?.(),o({to:"/work-pools"})},onError:()=>{w.error("Failed to delete work pool")}})};return e.jsx(ue,{isOpen:a,title:"Delete Work Pool",description:`Are you sure you want to delete the work pool "${s.name}"? This action cannot be undone.`,confirmText:s.name,isLoading:r,loadingText:"Deleting...",onConfirm:i,onClose:()=>t(!1)})},fs=s=>{const a=I(),[t,n]=c.useState(!1);return{menuItems:[{label:"Copy ID",icon:R,action:()=>{navigator.clipboard.writeText(s.id),w.success("ID copied to clipboard")},show:!0},{label:"Edit",icon:es,action:()=>{a({to:"/work-pools/work-pool/$workPoolName/edit",params:{workPoolName:s.name}})},show:!0},{label:"Delete",icon:te,action:()=>n(!0),show:!0,variant:"destructive"},{label:"Automate",icon:_e,action:()=>{a({to:"/automations/create"})},show:!0}].filter(d=>d.show),showDeleteDialog:t,setShowDeleteDialog:n,triggerIcon:De}},bs=({workPool:s,onUpdate:a,className:t})=>{const{menuItems:n,showDeleteDialog:o,setShowDeleteDialog:l,triggerIcon:r}=fs(s);return e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:e.jsxs(C,{variant:"outline",size:"icon",className:x("size-8",t),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(r,{className:"size-4"})]})}),e.jsx(ce,{align:"end",children:n.map(i=>{const d=i.icon;return e.jsxs(de,{onClick:i.action,className:x(i.variant==="destructive"&&"text-destructive"),children:[e.jsx(d,{className:"mr-2 h-4 w-4"}),i.label]},i.label)})})]}),e.jsx(js,{workPool:s,open:o,onOpenChange:l,onDeleted:a})]})},ws=(s,a)=>{const{pauseWorkPool:t,isPending:n}=Te(),{resumeWorkPool:o,isPending:l}=We();return{handleToggle:c.useCallback(i=>{i?o(s.name,{onSuccess:()=>{w.success("Work pool resumed"),a?.()},onError:()=>{w.error("Failed to resume work pool")}}):t(s.name,{onSuccess:()=>{w.success("Work pool paused"),a?.()},onError:()=>{w.error("Failed to pause work pool")}})},[s.name,t,o,a]),isLoading:n||l}},ys=({workPool:s,onUpdate:a,className:t})=>{const{handleToggle:n,isLoading:o}=ws(s,a),l=s.status==="PAUSED";return e.jsxs(A,{children:[e.jsx(O,{asChild:!0,children:e.jsx("div",{children:e.jsx(Fe,{checked:!l,onCheckedChange:n,disabled:o,"aria-label":l?"Resume work pool":"Pause work pool",className:x(t)})})}),e.jsx(B,{children:e.jsx("p",{children:"Pause or resume this work pool"})})]})},Ns=({workPool:s,onUpdate:a,className:t})=>e.jsxs("header",{className:x("flex mb-4 flex-row items-center justify-between",t),children:[e.jsx(Ee,{className:t,children:e.jsxs(Me,{children:[e.jsx(z,{children:e.jsx(Pe,{to:"/work-pools",className:"text-xl font-semibold",children:"Work pools"})}),e.jsx(Ie,{}),e.jsx(z,{className:"text-xl font-semibold",children:e.jsx(Le,{children:s.name})})]})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ys,{workPool:s,onUpdate:a}),e.jsx(bs,{workPool:s,onUpdate:a})]})]}),vs=({lateRunsCount:s,className:a})=>s===0?null:e.jsx(ne,{children:e.jsxs(A,{children:[e.jsx(O,{children:e.jsxs(Q,{variant:"warning",className:x("flex items-center space-x-1",a),children:[e.jsx(Re,{className:"h-3 w-3"}),e.jsx("span",{children:s})]})}),e.jsx(B,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"Late Flow Runs"}),e.jsxs("p",{className:"text-sm",children:[s," flow run",s===1?"":"s"," running late"]})]})})]})}),Cs=({queue:s})=>{const{data:a=0}=k(ae({work_pools:{operator:"and_",name:{any_:[s.work_pool_name||""]}},work_pool_queues:{operator:"and_",name:{any_:[s.name]}},flow_runs:{operator:"and_",state:{operator:"and_",name:{any_:["Late"]}}}},3e4));return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(J,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:s.work_pool_name||"",workQueueName:s.name},className:"font-medium text-blue-600 hover:text-blue-800",children:s.name}),e.jsx(vs,{lateRunsCount:a})]})},xe=({enableLateIndicator:s=!1}={})=>{const a=[];return a.push({accessorKey:"name",header:({column:t})=>e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Name"}),cell:({row:t})=>{const n=t.original;return s?e.jsx(Cs,{queue:n}):e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(J,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:n.work_pool_name||"",workQueueName:n.name},className:"font-medium text-blue-600 hover:text-blue-800",children:n.name})})}}),a.push({accessorKey:"concurrency_limit",header:({column:t})=>e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Concurrency Limit"}),cell:({row:t})=>{const n=t.original.concurrency_limit;return n!=null?n.toString():"∞"}}),a.push({accessorKey:"priority",header:({column:t})=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Priority"}),e.jsx(ne,{children:e.jsxs(A,{children:[e.jsx(O,{children:e.jsx(is,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(B,{children:e.jsx("p",{children:"Lower numbers have higher priority"})})]})})]}),cell:({row:t})=>t.original.priority}),a.push({accessorKey:"status",header:"Status",cell:({row:t})=>e.jsx(ss,{status:t.original.status||"READY"})}),a.push({id:"actions",header:"",cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(as,{queue:t.original}),e.jsx(ts,{queue:t.original})]}),enableSorting:!1}),a};xe();const ks=({hasSearchQuery:s,workPoolName:a})=>s?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(le,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:"No queues found"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"No queues match your search criteria. Try adjusting your search."})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center mb-4",children:e.jsx(P,{className:"h-6 w-6 text-muted-foreground"})}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:"No queues yet"}),e.jsx("p",{className:"text-muted-foreground mb-4 max-w-md",children:"This work pool doesn't have any queues yet. Create your first queue to start organizing work."}),e.jsxs(C,{onClick:()=>{console.log("Create queue for pool:",a)},children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Create Queue"]})]}),Ss=({searchQuery:s,onSearchChange:a,resultsCount:t,totalCount:n,workPoolName:o,className:l})=>{const[r,i]=c.useState(!1),d=s.length>0;return e.jsxs("div",{className:x("space-y-4",l),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s?`${t} of ${n} Work Queue${n!==1?"s":""}`:`${n} Work Queue${n!==1?"s":""}`}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>i(!0),children:e.jsx(P,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[d&&e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>a(""),children:"Clear filters"}),e.jsxs("div",{className:"relative",children:[e.jsx(le,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(re,{placeholder:"Search",value:s,onChange:b=>a(b.target.value),className:"pl-8 w-64"})]})]})]}),e.jsx(ns,{workPoolName:o,open:r,onOpenChange:i,onSubmit:()=>i(!1)})]})},_s=({queues:s,searchQuery:a,sortState:t,totalCount:n,workPoolName:o,className:l,onSearchChange:r,onSortingChange:i})=>{const d=c.useCallback(y=>{let v=t;typeof y=="function"?v=y(t):v=y,i(v)},[t,i]),b=xe({enableLateIndicator:!0}),u=G({data:s,columns:b,getCoreRowModel:X(),getSortedRowModel:Z(),state:{sorting:t},onSortingChange:d,initialState:{sorting:[{id:"name",desc:!1}]}}),g=s.length;return e.jsxs("div",{className:x("space-y-4",l),children:[e.jsx(Ss,{searchQuery:a,onSearchChange:r,resultsCount:g,totalCount:n,workPoolName:o}),g===0?e.jsx(ks,{hasSearchQuery:!!a,workPoolName:o}):e.jsx(me,{table:u})]})},Ds={ONLINE:{label:"Online",color:"bg-green-500"},OFFLINE:{label:"Offline",color:"bg-red-500"}},Ts=({status:s,className:a})=>{const t=Ds[s];return e.jsxs(Q,{variant:"secondary",className:x("flex items-center space-x-1",a),children:[e.jsx("div",{className:x("h-2 w-2 rounded-full",t.color)}),e.jsx("span",{children:t.label})]})},Ws=()=>[{accessorKey:"name",header:"Name",cell:({row:s})=>{const a=s.original;return e.jsx("span",{className:"font-medium",children:a.name})}},{accessorKey:"last_heartbeat_time",header:"Last Seen",cell:({row:s})=>{const a=s.original.last_heartbeat_time;return e.jsx(W,{date:a,format:"relative",showTooltip:!0})}},{accessorKey:"status",header:"Status",cell:({row:s})=>e.jsx(Ts,{status:s.original.status})}],Fs=({workPoolName:s,ActionsComponent:a})=>[...Ws(),{id:"actions",header:"",cell:({row:t})=>e.jsx(a,{worker:t.original,workPoolName:s}),enableSorting:!1,size:50,maxSize:50}],Es=({hasSearchQuery:s,workPoolName:a,className:t})=>s?e.jsxs(q,{children:[e.jsx(V,{id:"Search"}),e.jsx(K,{children:"No workers found"}),e.jsx(Y,{children:"No workers match your search criteria."})]}):e.jsx("div",{className:x("space-y-4",t),children:e.jsxs(q,{children:[e.jsx(V,{id:"Bot"}),e.jsx(K,{children:"No workers running"}),e.jsxs(Y,{children:["No workers are currently running for the “",a,"” work pool."]}),e.jsx(Qe,{children:e.jsx(he,{command:`prefect worker start --pool "${a}"`,title:"Start a worker",subtitle:"Run this command to start a worker for this pool"})})]})}),Ms=({worker:s,workPoolName:a,open:t,onOpenChange:n,onDeleted:o})=>{const{deleteWorker:l,isPending:r}=Ae(),i=()=>{l({workPoolName:a,workerName:s.name},{onSuccess:()=>{w.success("Worker deleted successfully"),o?.(),n(!1)},onError:()=>{w.error("Failed to delete worker")}})};return e.jsx(ue,{isOpen:t,title:"Delete Worker",description:`Are you sure you want to delete the worker "${s.name}"? This action cannot be undone.`,confirmText:s.name,isLoading:r,loadingText:"Deleting...",onConfirm:i,onClose:()=>n(!1)})},Ps=s=>{const[a,t]=c.useState(!1);return{menuItems:[{label:"Copy ID",icon:R,action:()=>{navigator.clipboard.writeText(s.id),w.success("ID copied to clipboard")},show:!0},{label:"Delete",icon:te,action:()=>t(!0),show:!0,variant:"destructive"}].filter(l=>l.show),showDeleteDialog:a,setShowDeleteDialog:t,triggerIcon:Oe}},Is=({worker:s,workPoolName:a,onWorkerDeleted:t,className:n})=>{const{menuItems:o,showDeleteDialog:l,setShowDeleteDialog:r,triggerIcon:i}=Ps(s);return e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:e.jsxs(C,{variant:"ghost",size:"icon",className:x("h-8 w-8",n),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(i,{className:"h-4 w-4"})]})}),e.jsx(ce,{align:"end",children:o.map(d=>{const b=d.icon;return e.jsxs(de,{onClick:d.action,className:x(d.variant==="destructive"&&"text-destructive"),children:[e.jsx(b,{className:"mr-2 h-4 w-4"}),d.label]},d.label)})})]}),e.jsx(Ms,{worker:s,workPoolName:a,open:l,onOpenChange:r,onDeleted:t})]})},Ls=({worker:s,workPoolName:a})=>e.jsx(Is,{worker:s,workPoolName:a}),H=({searchQuery:s,onSearchChange:a,resultsCount:t,totalCount:n,className:o})=>{const l=s.length>0;return e.jsxs("div",{className:x("flex items-center justify-between",o),children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s?`${t} of ${n} workers`:`${n} workers`}),e.jsxs("div",{className:"flex items-center space-x-2",children:[l&&e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>a(""),children:"Clear filters"}),e.jsx(re,{placeholder:"Search workers...",value:s,onChange:r=>a(r.target.value),className:"w-64"})]})]})},Rs=({workPoolName:s,workers:a,pagination:t,columnFilters:n,onPaginationChange:o,onColumnFiltersChange:l,className:r})=>{const i=n.find(j=>j.id==="name")?.value??"",d=c.useCallback(j=>{const N=n.filter(D=>D.id!=="name");l(j?[...N,{id:"name",value:j}]:N)},[l,n]),b=c.useCallback(j=>{let N=t;typeof j=="function"?N=j(t):N=j,o(N)},[t,o]),u=c.useMemo(()=>i?a.filter(j=>j.name.toLowerCase().includes(i.toLowerCase())):a,[a,i]),g=c.useMemo(()=>Fs({workPoolName:s,ActionsComponent:Ls}),[s]),y=G({data:u,columns:g,getCoreRowModel:X(),getSortedRowModel:Z(),getPaginationRowModel:pe(),manualPagination:!1,state:{pagination:t},onPaginationChange:b,initialState:{sorting:[{id:"name",desc:!1}]}});return a.length===0||i&&u.length===0?e.jsxs("div",{className:x("space-y-4",r),children:[e.jsx(H,{searchQuery:i,onSearchChange:d,resultsCount:u.length,totalCount:a.length}),e.jsx(Es,{hasSearchQuery:i.length>0,workPoolName:s})]}):e.jsxs("div",{className:x("space-y-4",r),children:[e.jsx(H,{searchQuery:i,onSearchChange:d,resultsCount:u.length,totalCount:a.length}),e.jsx(me,{table:y})]})};ls({tab:rs(["Details","Runs","Work Queues","Workers","Deployments"]).default("Runs")});const Qs=({workPoolName:s})=>{const[a,t]=c.useState(""),[n,o]=c.useState([]),{data:l}=L(He(s)),r=c.useMemo(()=>a?l.filter(i=>i.name.toLowerCase().includes(a.toLowerCase())):l,[l,a]);return e.jsx(_s,{queues:r,searchQuery:a,sortState:n,totalCount:l.length,workPoolName:s,onSearchChange:t,onSortingChange:o})},As=({workPoolName:s})=>{const[a,t]=c.useState({pageIndex:0,pageSize:10}),[n,o]=c.useState([]),{data:l}=L(se(s));return e.jsx(Rs,{workPoolName:s,workers:l,pagination:a,columnFilters:n,onPaginationChange:t,onColumnFiltersChange:o})};function da(){const{workPoolName:s}=E.useParams(),{tab:a}=E.useSearch(),t=I({from:E.fullPath}),n=ge(),{data:o}=L(Be(s)),l=o.status!=="READY",r=`prefect worker start --pool "${o.name}"`,i=c.useMemo(()=>[{id:"Details",label:"Details",hidden:!1,hiddenOnDesktop:!0},{id:"Runs",label:"Runs",hidden:!1,hiddenOnDesktop:!1},{id:"Work Queues",label:"Work Queues",hidden:!1,hiddenOnDesktop:!1},{id:"Workers",label:"Workers",hiddenOnDesktop:!1},{id:"Deployments",label:"Deployments",hidden:!1,hiddenOnDesktop:!1}].filter(u=>!u.hidden),[]),d=c.useCallback(u=>{t({search:{tab:u}})},[t]),b=c.useCallback(()=>{n.invalidateQueries({queryKey:$e.detailByName(s)})},[n,s]);return e.jsx(ze,{children:e.jsxs(qe,{children:[e.jsxs(Ve,{children:[e.jsx(Ns,{workPool:o,onUpdate:b}),l&&e.jsx("div",{className:"w-full bg-muted/50 py-6 px-4 rounded-lg mb-6",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsx(he,{command:r,title:"Your work pool is almost ready!",subtitle:"Run this command to start.",className:"py-0"})})})]}),e.jsxs("div",{className:"flex flex-col xl:flex-row xl:gap-8",children:[e.jsx("div",{className:"flex-1",children:e.jsxs(Ke,{value:a,onValueChange:d,children:[e.jsx(Ye,{className:"flex w-full overflow-x-auto scrollbar-none",children:i.map(u=>e.jsx(Ue,{value:u.id,className:x("whitespace-nowrap flex-shrink-0",u.hiddenOnDesktop?"xl:hidden":""),children:u.label},u.id))}),e.jsx(T,{value:"Details",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(h,{className:"h-4 w-48"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-16"}),e.jsx(h,{className:"h-6 w-24"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-20"}),e.jsx(h,{className:"h-6 w-32"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-24"}),e.jsx(h,{className:"h-6 w-28"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-18"}),e.jsx(h,{className:"h-6 w-36"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(h,{className:"h-5 w-40"}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-32 w-full"})})]})]}),children:e.jsx(U,{workPool:o})})}),e.jsx(T,{value:"Runs",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(h,{className:"h-24 w-full"}),e.jsx(h,{className:"h-24 w-full"}),e.jsx(h,{className:"h-24 w-full"})]}),children:e.jsx(gs,{workPoolName:s})})}),e.jsx(T,{value:"Work Queues",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{className:"h-6 w-24"}),e.jsx(h,{className:"h-6 w-8"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{className:"h-6 w-64"})})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(Qs,{workPoolName:s})})}),e.jsx(T,{value:"Workers",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{className:"h-4 w-20"}),e.jsx(h,{className:"h-9 w-64"})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(As,{workPoolName:s})})}),e.jsx(T,{value:"Deployments",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{className:"h-4 w-20"}),e.jsx(h,{className:"h-9 w-64"})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(cs,{workPoolName:s})})})]})}),e.jsx("aside",{className:"w-full xl:w-80 xl:shrink-0 hidden xl:block",children:e.jsx("div",{className:"sticky top-8",children:e.jsx(U,{workPool:o,alternate:!0})})})]})]})})}export{da as component};
2
- //# sourceMappingURL=work-pool._workPoolName-BwIVfCIe.js.map
1
+ import{r as c,j as e,t as k,d as L,L as J,C as G,H as Z,D as X,G as pe,n as ge,s as R}from"./vendor-tanstack-BdLtprmr.js";import{bK as je,aZ as x,q as C,bL as I,y as w,bh as fe,bg as be,af as ee,H as Q,bM as we,bN as ye,M as se,bB as Ne,bO as W,bP as ve,aH as Ce,aF as ae,V as ke,J as Se,bQ as te,bR as _e,bS as De,A as Te,F as We,bT as A,bU as O,G as Ee,bV as B,B as Fe,g as Me,h as z,bv as Pe,bE as Le,bG as Re,bW as ne,av as Ie,bX as le,bY as P,p as re,E as q,t as V,v as K,w as Y,x as Qe,bZ as Ae,b_ as Oe,b$ as F,c0 as Be,c1 as $e,c2 as ze,c3 as qe,c4 as Ve,az as Ke,aA as Ye,aB as Ue,aC as T,b8 as h,c5 as He}from"./index-CPpeVt8m.js";import{D as Je}from"./index-CE-bVgqj.js";import{S as Ge,a as Ze,F as Xe}from"./flow-runs-pagination-DMLZFM1m.js";import{D as oe,a as ie,b as ce,d as de}from"./dropdown-menu-fRiq5bS-.js";import{D as ue}from"./delete-confirmation-dialog-BZg9EOfN.js";import{S as es,W as ss,a as as,b as ts,c as ns}from"./work-pool-queue-toggle-f_-cTWxB.js";import{D as me}from"./data-table-bk-0xKWT.js";import{o as ls,e as rs}from"./vendor-forms-BlFSCfFw.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-date-Cl1Jav-N.js";import"./use-quick-run-Cpy0t7dX.js";import"./use-delete-confirmation-dialog-CkL-rSsp.js";import"./index-cp6PTdHp.js";import"./cronstrue-p-STK_QW.js";import"./use-is-overflowing-CDFKqB6i.js";import"./index-ELo08q04.js";import"./tags-input-DqZ8v99z.js";import"./zod-B1GLD-Zc.js";import"./form-Cl5Hk9bq.js";import"./textarea-DFEOJJdc.js";import"./table-Xyel2BEw.js";const os=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],is=je("circle-question-mark",os),he=({command:s,title:a,subtitle:t,className:n})=>{const[o,l]=c.useState(!1),r=async()=>{if(!o){l(!0);try{await navigator.clipboard.writeText(s),w.success("Command copied to clipboard")}catch{w.error("Failed to copy command")}finally{l(!1)}}};return e.jsxs("div",{className:x("space-y-4",n),children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-1",children:a}),e.jsx("p",{className:"text-muted-foreground text-sm",children:t})]}),e.jsxs("div",{className:"bg-muted border border-border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"bg-muted/80 border-b border-border px-3 py-2 flex items-center space-x-2",children:[e.jsxs("div",{className:"flex space-x-1",children:[e.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"})]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:r,disabled:o,className:"ml-auto text-muted-foreground hover:text-foreground hover:bg-muted h-6 w-6 p-0",children:e.jsx(I,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"bg-gray-800 dark:bg-gray-900 px-4 py-2",children:e.jsxs("p",{className:"py-1",children:[e.jsx("code",{className:"font-mono text-sm text-gray-300 select-all",children:s}),e.jsx("span",{className:"ml-1 -mb-1 inline-block w-[7px] h-[18px] bg-gray-400 terminal-cursor"})]})})]})]})},cs=({workPoolName:s,className:a})=>{const[t,n]=c.useState({pageIndex:0,pageSize:50}),[o,l]=c.useState("CREATED_DESC"),[r,i]=c.useState([]),d=c.useMemo(()=>({page:t.pageIndex+1,limit:t.pageSize,sort:o,work_pools:{operator:"and_",name:{any_:[s]}},deployments:{operator:"and_",flow_or_deployment_name:{like_:r.find(f=>f.id==="flowOrDeploymentName")?.value??""},tags:{operator:"and_",all_:r.find(f=>f.id==="tags")?.value??[]}}}),[s,t,o,r]),b=c.useMemo(()=>({offset:0,sort:"CREATED_DESC",work_pools:{operator:"and_",name:{any_:[s]}}}),[s]),{data:u}=k(fe(d)),{data:g}=k(be(b)),y=c.useMemo(()=>[...new Set((u?.results??[]).map(f=>f.flow_id))],[u?.results]),{data:v}=k(ee({flows:{operator:"and_",id:{any_:y}},offset:0,sort:"NAME_ASC"},{enabled:y.length>0})),j=c.useMemo(()=>{if(!u?.results)return[];const f=new Map(v?.map(S=>[S.id,S])??[]);return u.results.map(S=>({...S,flow:f.get(S.flow_id)}))},[u?.results,v]),N=c.useCallback(f=>{n(f)},[]),D=c.useCallback(f=>{l(f)},[]),E=c.useCallback(f=>{i(f)},[]);return!u||g===void 0?e.jsx("div",{className:a,children:e.jsx("div",{className:"text-muted-foreground text-center py-8",children:"Loading deployments..."})}):e.jsx("div",{className:a,children:e.jsx(Je,{deployments:j,currentDeploymentsCount:g,pageCount:u.pages,pagination:t,sort:o,columnFilters:r,onPaginationChange:N,onSortChange:D,onColumnFiltersChange:E})})},ds=s=>{switch(s){case"READY":return"Ready";case"PAUSED":return"Paused";case"NOT_READY":return"Not Ready"}},us=s=>{switch(s){case"READY":return"bg-green-500";case"PAUSED":return"bg-yellow-500";case"NOT_READY":return"bg-red-500"}},ms=({status:s,className:a})=>{const t=ds(s),n=us(s);return e.jsxs(Q,{variant:"secondary",className:x("flex items-center space-x-1",a),children:[s==="PAUSED"?e.jsx(we,{className:"h-2 w-2 text-muted-foreground"}):e.jsx("div",{className:x("h-2 w-2 rounded-full",n)}),e.jsx("span",{children:t})]})},M=()=>e.jsx("dd",{className:"text-muted-foreground text-sm",children:"None"}),hs=({children:s})=>e.jsx("dt",{className:"text-sm text-muted-foreground",children:s}),_=({children:s,className:a})=>e.jsx("dd",{className:x("text-sm",a),children:s});function xs({workPool:s}){const{data:a=[],isLoading:t}=k(se(s.name)),n=c.useMemo(()=>t||a.length===0?null:a.map(r=>r.last_heartbeat_time).filter(r=>!!r).sort((r,i)=>new Date(i).getTime()-new Date(r).getTime())[0]||null,[a,t]),o=[{field:"Status",ComponentValue:()=>e.jsx("dd",{children:e.jsx(ms,{status:s.status||"NOT_READY"})})},{field:"Description",ComponentValue:()=>s.description?e.jsx(_,{children:s.description}):null},{field:"Type",ComponentValue:()=>s.type?e.jsx(_,{children:Ne(s.type)}):e.jsx(M,{})},{field:"Concurrency Limit",ComponentValue:()=>e.jsx(_,{children:s.concurrency_limit?String(s.concurrency_limit):"Unlimited"})},{field:"Last Polled",ComponentValue:()=>n?e.jsx(_,{children:e.jsx(W,{date:n})}):a.length===0?null:e.jsx(_,{className:"text-muted-foreground",children:"No recent activity"})},{field:"Created",ComponentValue:()=>s.created?e.jsx(_,{children:e.jsx(W,{date:s.created})}):e.jsx(M,{})},{field:"Last Updated",ComponentValue:()=>s.updated?e.jsx(_,{children:e.jsx(W,{date:s.updated})}):e.jsx(M,{})}].filter(({ComponentValue:l})=>l()!==null);return t?e.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading work pool details..."}):e.jsx("div",{children:e.jsx("ul",{className:"flex flex-col gap-3",children:o.map(({field:l,ComponentValue:r})=>e.jsx("li",{children:e.jsxs("dl",{children:[e.jsx(hs,{children:l}),e.jsx(r,{})]})},l))})})}function ps({workPool:s}){const a=s.base_job_template;if(!a?.variables||typeof a.variables!="object"||!("properties"in a.variables)||!a.variables.properties)return null;const t=a.variables.properties,n=(l,r)=>r.title||l.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),o=l=>l==null?"None":typeof l=="boolean"?l.toString():Array.isArray(l)?l.length>0?l.join(", "):"None":typeof l=="object"?JSON.stringify(l):String(l);return e.jsxs("div",{children:[e.jsx("h3",{className:"mb-4 text-md",children:"Base Job Configuration"}),e.jsx("ul",{className:"flex flex-col gap-3",children:Object.entries(t).map(([l,r])=>{const i=r.default??null;return e.jsxs("li",{className:"flex flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground font-medium",children:n(l,r)}),e.jsx("span",{className:"break-words",children:o(i)})]},l)})})]})}function U({workPool:s,alternate:a=!1,className:t}){const n=a?"space-y-4":"space-y-6";return e.jsxs("div",{className:x(n,t),children:[e.jsx(xs,{workPool:s}),!!(s.base_job_template?.variables&&typeof s.base_job_template.variables=="object"&&"properties"in s.base_job_template.variables&&s.base_job_template.variables.properties&&Object.keys(s.base_job_template.variables.properties).length>0)&&e.jsxs(e.Fragment,{children:[e.jsx(ye,{}),e.jsx(ps,{workPool:s})]})]})}const gs=({workPoolName:s,className:a})=>{const[t,n]=c.useState({limit:10,page:1}),[o,l]=c.useState(""),[r,i]=c.useState(new Set),d=ve(o,500),b=c.useMemo(()=>{const m={page:t.page,limit:t.limit,sort:"START_TIME_DESC",work_pools:{operator:"and_",name:{any_:[s]}}};if(d.trim()&&(m.flow_runs={operator:"and_",name:{like_:d.trim()}}),r.size>0){const p={state:{operator:"and_",name:{any_:Array.from(r)}}};m.flow_runs?m.flow_runs={...m.flow_runs,...p}:m.flow_runs={operator:"and_",...p}}return m},[s,t,d,r]),u=c.useMemo(()=>{const m={work_pools:{operator:"and_",name:{any_:[s]}}};if(d.trim()&&(m.flow_runs={operator:"and_",name:{like_:d.trim()}}),r.size>0){const p={state:{operator:"and_",name:{any_:Array.from(r)}}};m.flow_runs?m.flow_runs={...m.flow_runs,...p}:m.flow_runs={operator:"and_",...p}}return m},[s,d,r]),{data:g}=k(Ce(b)),{data:y}=k(ae(u)),v=c.useMemo(()=>[...new Set((g?.results??[]).map(m=>m.flow_id))],[g?.results]),{data:j}=k(ee({flows:{operator:"and_",id:{any_:v}},offset:0,sort:"NAME_ASC"},{enabled:v.length>0})),N=c.useMemo(()=>{if(!g?.results)return[];const m=new Map(j?.map(p=>[p.id,p])??[]);return g.results.map(p=>{const $=m.get(p.flow_id);return $?{...p,flow:$}:null}).filter(p=>p!==null)},[g?.results,j]),D=c.useCallback(m=>{l(m.target.value),n(p=>({...p,page:1}))},[]),E=c.useCallback(m=>{n(m)},[]),f=c.useCallback(m=>{i(m),n(p=>({...p,page:1}))},[]),S=c.useCallback(()=>{l(""),i(new Set),n(m=>({...m,page:1}))},[]);return!g||y===void 0?e.jsx("div",{className:a,children:e.jsx("div",{className:"text-muted-foreground text-center py-8",children:"Loading flow runs..."})}):e.jsxs("div",{className:a,children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ke,{placeholder:"Search flow runs by name...",value:o,onChange:D,debounceMs:500})}),e.jsx("div",{className:"w-full sm:w-64",children:e.jsx(Ge,{selectedFilters:r,onSelectFilter:f})})]}),e.jsx(Ze,{flowRuns:N,onClearFilters:N.length===0?S:void 0}),g.pages>1&&e.jsx("div",{className:"mt-6",children:e.jsx(Xe,{count:y,pages:g.pages,pagination:t,onChangePagination:E})})]})},js=({workPool:s,open:a,onOpenChange:t,onDeleted:n})=>{const o=L(),{deleteWorkPool:l,isPending:r}=Se(),i=()=>{l(s.name,{onSuccess:()=>{w.success("Work pool deleted successfully"),n?.(),o({to:"/work-pools"})},onError:()=>{w.error("Failed to delete work pool")}})};return e.jsx(ue,{isOpen:a,title:"Delete Work Pool",description:`Are you sure you want to delete the work pool "${s.name}"? This action cannot be undone.`,confirmText:s.name,isLoading:r,loadingText:"Deleting...",onConfirm:i,onClose:()=>t(!1)})},fs=s=>{const a=L(),[t,n]=c.useState(!1);return{menuItems:[{label:"Copy ID",icon:I,action:()=>{navigator.clipboard.writeText(s.id),w.success("ID copied to clipboard")},show:!0},{label:"Edit",icon:es,action:()=>{a({to:"/work-pools/work-pool/$workPoolName/edit",params:{workPoolName:s.name}})},show:!0},{label:"Delete",icon:te,action:()=>n(!0),show:!0,variant:"destructive"},{label:"Automate",icon:_e,action:()=>{a({to:"/automations/create"})},show:!0}].filter(d=>d.show),showDeleteDialog:t,setShowDeleteDialog:n,triggerIcon:De}},bs=({workPool:s,onUpdate:a,className:t})=>{const{menuItems:n,showDeleteDialog:o,setShowDeleteDialog:l,triggerIcon:r}=fs(s);return e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:e.jsxs(C,{variant:"outline",size:"icon",className:x("size-8",t),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(r,{className:"size-4"})]})}),e.jsx(ce,{align:"end",children:n.map(i=>{const d=i.icon;return e.jsxs(de,{onClick:i.action,className:x(i.variant==="destructive"&&"text-destructive"),children:[e.jsx(d,{className:"mr-2 h-4 w-4"}),i.label]},i.label)})})]}),e.jsx(js,{workPool:s,open:o,onOpenChange:l,onDeleted:a})]})},ws=(s,a)=>{const{pauseWorkPool:t,isPending:n}=Te(),{resumeWorkPool:o,isPending:l}=We();return{handleToggle:c.useCallback(i=>{i?o(s.name,{onSuccess:()=>{w.success("Work pool resumed"),a?.()},onError:()=>{w.error("Failed to resume work pool")}}):t(s.name,{onSuccess:()=>{w.success("Work pool paused"),a?.()},onError:()=>{w.error("Failed to pause work pool")}})},[s.name,t,o,a]),isLoading:n||l}},ys=({workPool:s,onUpdate:a,className:t})=>{const{handleToggle:n,isLoading:o}=ws(s,a),l=s.status==="PAUSED";return e.jsxs(A,{children:[e.jsx(O,{asChild:!0,children:e.jsx("div",{children:e.jsx(Ee,{checked:!l,onCheckedChange:n,disabled:o,"aria-label":l?"Resume work pool":"Pause work pool",className:x(t)})})}),e.jsx(B,{children:e.jsx("p",{children:"Pause or resume this work pool"})})]})},Ns=({workPool:s,onUpdate:a,className:t})=>e.jsxs("header",{className:x("flex mb-4 flex-row items-center justify-between",t),children:[e.jsx(Fe,{className:t,children:e.jsxs(Me,{children:[e.jsx(z,{children:e.jsx(Pe,{to:"/work-pools",className:"text-xl font-semibold",children:"Work pools"})}),e.jsx(Le,{}),e.jsx(z,{className:"text-xl font-semibold",children:e.jsx(Re,{children:s.name})})]})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ys,{workPool:s,onUpdate:a}),e.jsx(bs,{workPool:s,onUpdate:a})]})]}),vs=({lateRunsCount:s,className:a})=>s===0?null:e.jsx(ne,{children:e.jsxs(A,{children:[e.jsx(O,{children:e.jsxs(Q,{variant:"warning",className:x("flex items-center space-x-1",a),children:[e.jsx(Ie,{className:"h-3 w-3"}),e.jsx("span",{children:s})]})}),e.jsx(B,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"Late Flow Runs"}),e.jsxs("p",{className:"text-sm",children:[s," flow run",s===1?"":"s"," running late"]})]})})]})}),Cs=({queue:s})=>{const{data:a=0}=k(ae({work_pools:{operator:"and_",name:{any_:[s.work_pool_name||""]}},work_pool_queues:{operator:"and_",name:{any_:[s.name]}},flow_runs:{operator:"and_",state:{operator:"and_",name:{any_:["Late"]}}}},3e4));return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(J,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:s.work_pool_name||"",workQueueName:s.name},className:"font-medium text-blue-600 hover:text-blue-800",children:s.name}),e.jsx(vs,{lateRunsCount:a})]})},xe=({enableLateIndicator:s=!1}={})=>{const a=[];return a.push({accessorKey:"name",header:({column:t})=>e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Name"}),cell:({row:t})=>{const n=t.original;return s?e.jsx(Cs,{queue:n}):e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(J,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:n.work_pool_name||"",workQueueName:n.name},className:"font-medium text-blue-600 hover:text-blue-800",children:n.name})})}}),a.push({accessorKey:"concurrency_limit",header:({column:t})=>e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Concurrency Limit"}),cell:({row:t})=>{const n=t.original.concurrency_limit;return n!=null?n.toString():"∞"}}),a.push({accessorKey:"priority",header:({column:t})=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Priority"}),e.jsx(ne,{children:e.jsxs(A,{children:[e.jsx(O,{children:e.jsx(is,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(B,{children:e.jsx("p",{children:"Lower numbers have higher priority"})})]})})]}),cell:({row:t})=>t.original.priority}),a.push({accessorKey:"status",header:"Status",cell:({row:t})=>e.jsx(ss,{status:t.original.status||"READY"})}),a.push({id:"actions",header:"",cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(as,{queue:t.original}),e.jsx(ts,{queue:t.original})]}),enableSorting:!1}),a};xe();const ks=({hasSearchQuery:s,workPoolName:a})=>s?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(le,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:"No queues found"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"No queues match your search criteria. Try adjusting your search."})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center mb-4",children:e.jsx(P,{className:"h-6 w-6 text-muted-foreground"})}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:"No queues yet"}),e.jsx("p",{className:"text-muted-foreground mb-4 max-w-md",children:"This work pool doesn't have any queues yet. Create your first queue to start organizing work."}),e.jsxs(C,{onClick:()=>{console.log("Create queue for pool:",a)},children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Create Queue"]})]}),Ss=({searchQuery:s,onSearchChange:a,resultsCount:t,totalCount:n,workPoolName:o,className:l})=>{const[r,i]=c.useState(!1),d=s.length>0;return e.jsxs("div",{className:x("space-y-4",l),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s?`${t} of ${n} Work Queue${n!==1?"s":""}`:`${n} Work Queue${n!==1?"s":""}`}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>i(!0),children:e.jsx(P,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[d&&e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>a(""),children:"Clear filters"}),e.jsxs("div",{className:"relative",children:[e.jsx(le,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(re,{placeholder:"Search",value:s,onChange:b=>a(b.target.value),className:"pl-8 w-64"})]})]})]}),e.jsx(ns,{workPoolName:o,open:r,onOpenChange:i,onSubmit:()=>i(!1)})]})},_s=({queues:s,searchQuery:a,sortState:t,totalCount:n,workPoolName:o,className:l,onSearchChange:r,onSortingChange:i})=>{const d=c.useCallback(y=>{let v=t;typeof y=="function"?v=y(t):v=y,i(v)},[t,i]),b=xe({enableLateIndicator:!0}),u=G({data:s,columns:b,getCoreRowModel:X(),getSortedRowModel:Z(),state:{sorting:t},onSortingChange:d,initialState:{sorting:[{id:"name",desc:!1}]}}),g=s.length;return e.jsxs("div",{className:x("space-y-4",l),children:[e.jsx(Ss,{searchQuery:a,onSearchChange:r,resultsCount:g,totalCount:n,workPoolName:o}),g===0?e.jsx(ks,{hasSearchQuery:!!a,workPoolName:o}):e.jsx(me,{table:u})]})},Ds={ONLINE:{label:"Online",color:"bg-green-500"},OFFLINE:{label:"Offline",color:"bg-red-500"}},Ts=({status:s,className:a})=>{const t=Ds[s];return e.jsxs(Q,{variant:"secondary",className:x("flex items-center space-x-1",a),children:[e.jsx("div",{className:x("h-2 w-2 rounded-full",t.color)}),e.jsx("span",{children:t.label})]})},Ws=()=>[{accessorKey:"name",header:"Name",cell:({row:s})=>{const a=s.original;return e.jsx("span",{className:"font-medium",children:a.name})}},{accessorKey:"last_heartbeat_time",header:"Last Seen",cell:({row:s})=>{const a=s.original.last_heartbeat_time;return e.jsx(W,{date:a,format:"relative",showTooltip:!0})}},{accessorKey:"status",header:"Status",cell:({row:s})=>e.jsx(Ts,{status:s.original.status})}],Es=({workPoolName:s,ActionsComponent:a})=>[...Ws(),{id:"actions",header:"",cell:({row:t})=>e.jsx(a,{worker:t.original,workPoolName:s}),enableSorting:!1,size:50,maxSize:50}],Fs=({hasSearchQuery:s,workPoolName:a,className:t})=>s?e.jsxs(q,{children:[e.jsx(V,{id:"Search"}),e.jsx(K,{children:"No workers found"}),e.jsx(Y,{children:"No workers match your search criteria."})]}):e.jsx("div",{className:x("space-y-4",t),children:e.jsxs(q,{children:[e.jsx(V,{id:"Bot"}),e.jsx(K,{children:"No workers running"}),e.jsxs(Y,{children:["No workers are currently running for the “",a,"” work pool."]}),e.jsx(Qe,{children:e.jsx(he,{command:`prefect worker start --pool "${a}"`,title:"Start a worker",subtitle:"Run this command to start a worker for this pool"})})]})}),Ms=({worker:s,workPoolName:a,open:t,onOpenChange:n,onDeleted:o})=>{const{deleteWorker:l,isPending:r}=Ae(),i=()=>{l({workPoolName:a,workerName:s.name},{onSuccess:()=>{w.success("Worker deleted successfully"),o?.(),n(!1)},onError:()=>{w.error("Failed to delete worker")}})};return e.jsx(ue,{isOpen:t,title:"Delete Worker",description:`Are you sure you want to delete the worker "${s.name}"? This action cannot be undone.`,confirmText:s.name,isLoading:r,loadingText:"Deleting...",onConfirm:i,onClose:()=>n(!1)})},Ps=s=>{const[a,t]=c.useState(!1);return{menuItems:[{label:"Copy ID",icon:I,action:()=>{navigator.clipboard.writeText(s.id),w.success("ID copied to clipboard")},show:!0},{label:"Delete",icon:te,action:()=>t(!0),show:!0,variant:"destructive"}].filter(l=>l.show),showDeleteDialog:a,setShowDeleteDialog:t,triggerIcon:Oe}},Ls=({worker:s,workPoolName:a,onWorkerDeleted:t,className:n})=>{const{menuItems:o,showDeleteDialog:l,setShowDeleteDialog:r,triggerIcon:i}=Ps(s);return e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:e.jsxs(C,{variant:"ghost",size:"icon",className:x("h-8 w-8",n),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(i,{className:"h-4 w-4"})]})}),e.jsx(ce,{align:"end",children:o.map(d=>{const b=d.icon;return e.jsxs(de,{onClick:d.action,className:x(d.variant==="destructive"&&"text-destructive"),children:[e.jsx(b,{className:"mr-2 h-4 w-4"}),d.label]},d.label)})})]}),e.jsx(Ms,{worker:s,workPoolName:a,open:l,onOpenChange:r,onDeleted:t})]})},Rs=({worker:s,workPoolName:a})=>e.jsx(Ls,{worker:s,workPoolName:a}),H=({searchQuery:s,onSearchChange:a,resultsCount:t,totalCount:n,className:o})=>{const l=s.length>0;return e.jsxs("div",{className:x("flex items-center justify-between",o),children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s?`${t} of ${n} workers`:`${n} workers`}),e.jsxs("div",{className:"flex items-center space-x-2",children:[l&&e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>a(""),children:"Clear filters"}),e.jsx(re,{placeholder:"Search workers...",value:s,onChange:r=>a(r.target.value),className:"w-64"})]})]})},Is=({workPoolName:s,workers:a,pagination:t,columnFilters:n,onPaginationChange:o,onColumnFiltersChange:l,className:r})=>{const i=n.find(j=>j.id==="name")?.value??"",d=c.useCallback(j=>{const N=n.filter(D=>D.id!=="name");l(j?[...N,{id:"name",value:j}]:N)},[l,n]),b=c.useCallback(j=>{let N=t;typeof j=="function"?N=j(t):N=j,o(N)},[t,o]),u=c.useMemo(()=>i?a.filter(j=>j.name.toLowerCase().includes(i.toLowerCase())):a,[a,i]),g=c.useMemo(()=>Es({workPoolName:s,ActionsComponent:Rs}),[s]),y=G({data:u,columns:g,getCoreRowModel:X(),getSortedRowModel:Z(),getPaginationRowModel:pe(),manualPagination:!1,state:{pagination:t},onPaginationChange:b,initialState:{sorting:[{id:"name",desc:!1}]}});return a.length===0||i&&u.length===0?e.jsxs("div",{className:x("space-y-4",r),children:[e.jsx(H,{searchQuery:i,onSearchChange:d,resultsCount:u.length,totalCount:a.length}),e.jsx(Fs,{hasSearchQuery:i.length>0,workPoolName:s})]}):e.jsxs("div",{className:x("space-y-4",r),children:[e.jsx(H,{searchQuery:i,onSearchChange:d,resultsCount:u.length,totalCount:a.length}),e.jsx(me,{table:y})]})};ls({tab:rs(["Details","Runs","Work Queues","Workers","Deployments"]).default("Runs")});const Qs=({workPoolName:s})=>{const[a,t]=c.useState(""),[n,o]=c.useState([]),{data:l}=R(He(s)),r=c.useMemo(()=>a?l.filter(i=>i.name.toLowerCase().includes(a.toLowerCase())):l,[l,a]);return e.jsx(_s,{queues:r,searchQuery:a,sortState:n,totalCount:l.length,workPoolName:s,onSearchChange:t,onSortingChange:o})},As=({workPoolName:s})=>{const[a,t]=c.useState({pageIndex:0,pageSize:10}),[n,o]=c.useState([]),{data:l}=R(se(s));return e.jsx(Is,{workPoolName:s,workers:l,pagination:a,columnFilters:n,onPaginationChange:t,onColumnFiltersChange:o})};function da(){const{workPoolName:s}=F.useParams(),{tab:a}=F.useSearch(),t=L({from:F.fullPath}),n=ge(),{data:o}=R(Be(s)),l=o.status!=="READY",r=`prefect worker start --pool "${o.name}"`,i=c.useMemo(()=>[{id:"Details",label:"Details",hidden:!1,hiddenOnDesktop:!0},{id:"Runs",label:"Runs",hidden:!1,hiddenOnDesktop:!1},{id:"Work Queues",label:"Work Queues",hidden:!1,hiddenOnDesktop:!1},{id:"Workers",label:"Workers",hiddenOnDesktop:!1},{id:"Deployments",label:"Deployments",hidden:!1,hiddenOnDesktop:!1}].filter(u=>!u.hidden),[]),d=c.useCallback(u=>{t({search:{tab:u}})},[t]),b=c.useCallback(()=>{n.invalidateQueries({queryKey:$e.detailByName(s)})},[n,s]);return e.jsx(ze,{children:e.jsxs(qe,{children:[e.jsxs(Ve,{children:[e.jsx(Ns,{workPool:o,onUpdate:b}),l&&e.jsx("div",{className:"w-full bg-muted/50 py-6 px-4 rounded-lg mb-6",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsx(he,{command:r,title:"Your work pool is almost ready!",subtitle:"Run this command to start.",className:"py-0"})})})]}),e.jsxs("div",{className:"flex flex-col xl:flex-row xl:gap-8",children:[e.jsx("div",{className:"flex-1",children:e.jsxs(Ke,{value:a,onValueChange:d,children:[e.jsx(Ye,{className:"flex w-full overflow-x-auto scrollbar-none",children:i.map(u=>e.jsx(Ue,{value:u.id,className:x("whitespace-nowrap flex-shrink-0",u.hiddenOnDesktop?"xl:hidden":""),children:u.label},u.id))}),e.jsx(T,{value:"Details",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(h,{className:"h-4 w-48"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-16"}),e.jsx(h,{className:"h-6 w-24"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-20"}),e.jsx(h,{className:"h-6 w-32"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-24"}),e.jsx(h,{className:"h-6 w-28"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-18"}),e.jsx(h,{className:"h-6 w-36"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(h,{className:"h-5 w-40"}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-32 w-full"})})]})]}),children:e.jsx(U,{workPool:o})})}),e.jsx(T,{value:"Runs",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(h,{className:"h-24 w-full"}),e.jsx(h,{className:"h-24 w-full"}),e.jsx(h,{className:"h-24 w-full"})]}),children:e.jsx(gs,{workPoolName:s})})}),e.jsx(T,{value:"Work Queues",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{className:"h-6 w-24"}),e.jsx(h,{className:"h-6 w-8"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{className:"h-6 w-64"})})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(Qs,{workPoolName:s})})}),e.jsx(T,{value:"Workers",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{className:"h-4 w-20"}),e.jsx(h,{className:"h-9 w-64"})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(As,{workPoolName:s})})}),e.jsx(T,{value:"Deployments",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{className:"h-4 w-20"}),e.jsx(h,{className:"h-9 w-64"})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(cs,{workPoolName:s})})})]})}),e.jsx("aside",{className:"w-full xl:w-80 xl:shrink-0 hidden xl:block",children:e.jsx("div",{className:"sticky top-8",children:e.jsx(U,{workPool:o,alternate:!0})})})]})]})})}export{da as component};
2
+ //# sourceMappingURL=work-pool._workPoolName-zBqgkYLT.js.map