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,2 @@
1
+ import{s as n,j as t}from"./vendor-tanstack-BdLtprmr.js";import{d9 as m,B as l,g as c,h as a,bv as u,bE as d,bG as x,dx as j}from"./index-CPpeVt8m.js";import{D as p}from"./delete-confirmation-dialog-BZg9EOfN.js";import{u as f,A as b,a as g,b as h,c as A,d as D}from"./use-delete-automation-confirmation-dialog-BHgDXlwg.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";import"./work-queue-icon-text-BqqQ413o.js";import"./index-ELo08q04.js";import"./dropdown-menu-fRiq5bS-.js";import"./use-delete-confirmation-dialog-CkL-rSsp.js";const N=({id:s})=>{const[o,i]=f(),{data:e}=n(m(s)),r=()=>i(e,{shouldNavigate:!0});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(v,{automation:e}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(b,{automation:e}),t.jsx(g,{id:e.id,onDelete:r})]})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(h,{automation:e}),t.jsx(A,{automation:e}),t.jsx(D,{automation:e})]})]}),t.jsx(p,{...o})]})},v=({automation:s})=>t.jsx(l,{children:t.jsxs(c,{children:[t.jsx(a,{children:t.jsx(u,{to:"/automations",className:"text-xl font-semibold",children:"Automations"})}),t.jsx(d,{}),t.jsx(a,{className:"text-xl font-semibold",children:t.jsx(x,{children:s.name})})]})});function F(){const{id:s}=j.useParams();return t.jsx(N,{id:s})}export{F as component};
2
+ //# sourceMappingURL=automation._id-CEHa-X0X.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"automation._id-CMiura1b.js","sources":["../../src/components/automations/automation-details-page.tsx","../../src/routes/automations/automation.$id.tsx?tsr-split=component"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { type Automation, buildGetAutomationQuery } from \"@/api/automations\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport {\n\tAutomationActions,\n\tAutomationDescription,\n\tAutomationTrigger,\n} from \"./automation-details\";\nimport { AutomationEnableToggle } from \"./automation-enable-toggle\";\nimport { AutomationsActionsMenu } from \"./automations-actions-menu\";\nimport { useDeleteAutomationConfirmationDialog } from \"./use-delete-automation-confirmation-dialog\";\n\ntype AutomationsDetailsPageProps = {\n\tid: string;\n};\n\nexport const AutomationDetailsPage = ({ id }: AutomationsDetailsPageProps) => {\n\tconst [dialogState, confirmDelete] = useDeleteAutomationConfirmationDialog();\n\tconst { data } = useSuspenseQuery(buildGetAutomationQuery(id));\n\n\tconst handleDelete = () => confirmDelete(data, { shouldNavigate: true });\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t<NavHeader automation={data} />\n\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t<AutomationEnableToggle automation={data} />\n\t\t\t\t\t\t<AutomationsActionsMenu id={data.id} onDelete={handleDelete} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t\t<AutomationDescription automation={data} />\n\t\t\t\t\t<AutomationTrigger automation={data} />\n\t\t\t\t\t<AutomationActions automation={data} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<DeleteConfirmationDialog {...dialogState} />\n\t\t</>\n\t);\n};\n\ntype NavHeaderProps = {\n\tautomation: Automation;\n};\nconst NavHeader = ({ automation }: NavHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/automations\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tAutomations\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>{automation.name}</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import { createFileRoute } from \"@tanstack/react-router\";\n\nimport { buildGetAutomationQuery } from \"@/api/automations\";\nimport { AutomationDetailsPage } from \"@/components/automations/automation-details-page\";\n\nexport const Route = createFileRoute(\"/automations/automation/$id\")({\n\tcomponent: RouteComponent,\n\tloader: ({ context, params }) =>\n\t\tcontext.queryClient.ensureQueryData(buildGetAutomationQuery(params.id)),\n\twrapInSuspense: true,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\treturn <AutomationDetailsPage id={id} />;\n}\n"],"names":["AutomationDetailsPage","id","dialogState","confirmDelete","useDeleteAutomationConfirmationDialog","data","useSuspenseQuery","buildGetAutomationQuery","handleDelete","jsxs","Fragment","jsx","NavHeader","AutomationEnableToggle","AutomationsActionsMenu","AutomationDescription","AutomationTrigger","AutomationActions","DeleteConfirmationDialog","automation","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","RouteComponent","Route","useParams"],"mappings":"opBAwBO,MAAMA,EAAwB,CAAC,CAAE,GAAAC,KAAsC,CAC7E,KAAM,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAC/B,CAAE,KAAAC,CAAA,EAASC,EAAiBC,EAAwBN,CAAE,CAAC,EAEvDO,EAAe,IAAML,EAAcE,EAAM,CAAE,eAAgB,GAAM,EAEvE,OACCI,EAAAA,KAAAC,WAAA,CACC,SAAA,CAAAD,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACd,SAAA,CAAAE,EAAAA,IAACC,EAAA,CAAU,WAAYP,CAAA,CAAM,EAC7BI,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAE,EAAAA,IAACE,EAAA,CAAuB,WAAYR,CAAA,CAAM,QACzCS,EAAA,CAAuB,GAAIT,EAAK,GAAI,SAAUG,CAAA,CAAc,CAAA,CAAA,CAC9D,CAAA,EACD,EACAC,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAE,EAAAA,IAACI,EAAA,CAAsB,WAAYV,CAAA,CAAM,EACzCM,EAAAA,IAACK,EAAA,CAAkB,WAAYX,CAAA,CAAM,EACrCM,EAAAA,IAACM,EAAA,CAAkB,WAAYZ,CAAA,CAAM,CAAA,CAAA,CACtC,CAAA,EACD,EACAM,MAACO,EAAA,CAA0B,GAAGhB,CAAA,CAAa,CAAA,EAC5C,CAEF,EAKMU,EAAY,CAAC,CAAE,WAAAO,KAEnBR,EAAAA,IAACS,EAAA,CACA,SAAAX,EAAAA,KAACY,EAAA,CACA,SAAA,CAAAV,EAAAA,IAACW,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,eAAe,UAAU,wBAAwB,uBAEpE,CAAA,CACD,QACCC,EAAA,EAAoB,EACrBb,EAAAA,IAACW,GAAe,UAAU,wBACzB,eAACG,EAAA,CAAgB,SAAAN,EAAW,KAAK,CAAA,CAClC,CAAA,CAAA,CACD,CAAA,CACD,ECxDF,SAASO,GAAiB,CACzB,KAAM,CAAEzB,GAAAA,CAAAA,EAAO0B,EAAMC,UAAAA,EACrB,OAAOjB,MAACX,GAAsB,GAAAC,EAAO,CACtC"}
1
+ {"version":3,"file":"automation._id-CEHa-X0X.js","sources":["../../src/components/automations/automation-details-page.tsx","../../src/routes/automations/automation.$id.tsx?tsr-split=component"],"sourcesContent":["import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { type Automation, buildGetAutomationQuery } from \"@/api/automations\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport {\n\tAutomationActions,\n\tAutomationDescription,\n\tAutomationTrigger,\n} from \"./automation-details\";\nimport { AutomationEnableToggle } from \"./automation-enable-toggle\";\nimport { AutomationsActionsMenu } from \"./automations-actions-menu\";\nimport { useDeleteAutomationConfirmationDialog } from \"./use-delete-automation-confirmation-dialog\";\n\ntype AutomationsDetailsPageProps = {\n\tid: string;\n};\n\nexport const AutomationDetailsPage = ({ id }: AutomationsDetailsPageProps) => {\n\tconst [dialogState, confirmDelete] = useDeleteAutomationConfirmationDialog();\n\tconst { data } = useSuspenseQuery(buildGetAutomationQuery(id));\n\n\tconst handleDelete = () => confirmDelete(data, { shouldNavigate: true });\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t<NavHeader automation={data} />\n\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t<AutomationEnableToggle automation={data} />\n\t\t\t\t\t\t<AutomationsActionsMenu id={data.id} onDelete={handleDelete} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t\t<AutomationDescription automation={data} />\n\t\t\t\t\t<AutomationTrigger automation={data} />\n\t\t\t\t\t<AutomationActions automation={data} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<DeleteConfirmationDialog {...dialogState} />\n\t\t</>\n\t);\n};\n\ntype NavHeaderProps = {\n\tautomation: Automation;\n};\nconst NavHeader = ({ automation }: NavHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/automations\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tAutomations\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>{automation.name}</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import { createFileRoute } from \"@tanstack/react-router\";\nimport { buildGetAutomationQuery } from \"@/api/automations\";\nimport { AutomationDetailsPage } from \"@/components/automations/automation-details-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nexport const Route = createFileRoute(\"/automations/automation/$id\")({\n\tcomponent: RouteComponent,\n\tloader: ({ context, params }) =>\n\t\tcontext.queryClient.ensureQueryData(buildGetAutomationQuery(params.id)),\n\twrapInSuspense: true,\n\tpendingComponent: PrefectLoading,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\treturn <AutomationDetailsPage id={id} />;\n}\n"],"names":["AutomationDetailsPage","id","dialogState","confirmDelete","useDeleteAutomationConfirmationDialog","data","useSuspenseQuery","buildGetAutomationQuery","handleDelete","jsxs","Fragment","jsx","NavHeader","AutomationEnableToggle","AutomationsActionsMenu","AutomationDescription","AutomationTrigger","AutomationActions","DeleteConfirmationDialog","automation","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","RouteComponent","Route","useParams"],"mappings":"opBAwBO,MAAMA,EAAwB,CAAC,CAAE,GAAAC,KAAsC,CAC7E,KAAM,CAACC,EAAaC,CAAa,EAAIC,EAAA,EAC/B,CAAE,KAAAC,CAAA,EAASC,EAAiBC,EAAwBN,CAAE,CAAC,EAEvDO,EAAe,IAAML,EAAcE,EAAM,CAAE,eAAgB,GAAM,EAEvE,OACCI,EAAAA,KAAAC,WAAA,CACC,SAAA,CAAAD,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACd,SAAA,CAAAE,EAAAA,IAACC,EAAA,CAAU,WAAYP,CAAA,CAAM,EAC7BI,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAE,EAAAA,IAACE,EAAA,CAAuB,WAAYR,CAAA,CAAM,QACzCS,EAAA,CAAuB,GAAIT,EAAK,GAAI,SAAUG,CAAA,CAAc,CAAA,CAAA,CAC9D,CAAA,EACD,EACAC,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAE,EAAAA,IAACI,EAAA,CAAsB,WAAYV,CAAA,CAAM,EACzCM,EAAAA,IAACK,EAAA,CAAkB,WAAYX,CAAA,CAAM,EACrCM,EAAAA,IAACM,EAAA,CAAkB,WAAYZ,CAAA,CAAM,CAAA,CAAA,CACtC,CAAA,EACD,EACAM,MAACO,EAAA,CAA0B,GAAGhB,CAAA,CAAa,CAAA,EAC5C,CAEF,EAKMU,EAAY,CAAC,CAAE,WAAAO,KAEnBR,EAAAA,IAACS,EAAA,CACA,SAAAX,EAAAA,KAACY,EAAA,CACA,SAAA,CAAAV,EAAAA,IAACW,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,eAAe,UAAU,wBAAwB,uBAEpE,CAAA,CACD,QACCC,EAAA,EAAoB,EACrBb,EAAAA,IAACW,GAAe,UAAU,wBACzB,eAACG,EAAA,CAAgB,SAAAN,EAAW,KAAK,CAAA,CAClC,CAAA,CAAA,CACD,CAAA,CACD,ECvDF,SAASO,GAAiB,CACzB,KAAM,CAAEzB,GAAAA,CAAAA,EAAO0B,EAAMC,UAAAA,EACrB,OAAOjB,MAACX,GAAsB,GAAAC,EAAO,CACtC"}
@@ -1,2 +1,2 @@
1
- import{j as t,s as b,r as w,d as x}from"./vendor-tanstack-BdLtprmr.js";import{D as _,B as A,g as j,h as d,bw as v,bF as k,bH as g,da as S,dT as E,y as p,dU as N}from"./index-V_xTKaEb.js";import{A as I}from"./automation-wizard-DeT-tz5i.js";import{U as n}from"./automation-schema-D1HDjyeB.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";import"./zod-B1GLD-Zc.js";import"./form-DOdmIC3A.js";import"./use-stepper-CnGJHRLP.js";import"./textarea-9v5uTuxg.js";import"./index-DyOAqIOp.js";import"./radio-group-D55TQZsk.js";import"./collapsible-DZbPzSgr.js";import"./tags-input-2KSBvO_K.js";const T=()=>t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(q,{}),t.jsx(_,{label:"Documentation",id:"automations-guide"})]}),q=()=>t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(A,{children:t.jsxs(j,{children:[t.jsx(d,{children:t.jsx(v,{to:"/automations",className:"text-xl font-semibold",children:"Automations"})}),t.jsx(k,{}),t.jsx(d,{className:"text-xl font-semibold",children:t.jsx(g,{children:"Edit Automation"})})]})})});function V(e){switch(e.type){case"run-deployment":return{type:"run-deployment",deployment_id:e.deployment_id??n,parameters:e.parameters??void 0,job_variables:e.job_variables??void 0};case"pause-deployment":case"resume-deployment":return{type:e.type,deployment_id:e.deployment_id??n};case"pause-work-queue":case"resume-work-queue":return{type:e.type,work_queue_id:e.work_queue_id??n};case"pause-work-pool":case"resume-work-pool":return{type:e.type,work_pool_id:e.work_pool_id??n};case"pause-automation":case"resume-automation":return{type:e.type,automation_id:e.automation_id??n};case"cancel-flow-run":case"suspend-flow-run":case"resume-flow-run":return{type:e.type};case"change-flow-run-state":return{type:"change-flow-run-state",state:e.state,name:e.name??void 0,message:e.message??void 0};case"send-notification":return{type:"send-notification",block_document_id:e.block_document_id,body:e.body,subject:e.subject};case"do-nothing":return{type:"do-nothing"};case"call-webhook":return{type:"do-nothing"};default:return{type:"do-nothing"}}}function c(e){switch(e.type){case"event":return{type:"event",posture:e.posture,threshold:e.threshold,within:e.within,match:e.match,match_related:Array.isArray(e.match_related)?e.match_related[0]:e.match_related,for_each:e.for_each,after:e.after,expect:e.expect};case"compound":return{type:"compound",triggers:e.triggers.map(c),require:e.require,within:e.within??void 0};case"sequence":return{type:"sequence",triggers:e.triggers.map(c),within:e.within??void 0};default:return{type:"event",posture:"Reactive",threshold:1,within:0}}}function B(e){if(e.type!=="event")return"custom";const o=e.match?.["prefect.resource.id"];if(!o)return"custom";const r=Array.isArray(o)?o[0]:o;return r?.startsWith("prefect.flow-run.")?"flow-run-state":r?.startsWith("prefect.deployment.")?"deployment-status":r?.startsWith("prefect.work-pool.")?"work-pool-status":r?.startsWith("prefect.work-queue.")?"work-queue-status":"custom"}function F(e){return{name:e.name,description:e.description||void 0,triggerTemplate:B(e.trigger),trigger:c(e.trigger),actions:e.actions.map(V)}}function P(e){return{name:e.name,description:e.description??"",trigger:e.trigger,actions:e.actions}}const L=e=>{const{automationId:o,onSuccess:r,onError:u}=e,{data:s,isLoading:i}=b(S(o)),a=w.useMemo(()=>{if(s)return F(s)},[s]),{replaceAutomation:l,isPending:f}=E();return{defaultValues:a,isLoading:i,updateAutomation:h=>{const y=P(h);l({id:o,enabled:s?.enabled??!0,...y},{onSuccess:()=>{r?.()},onError:m=>{u?.(m instanceof Error?m:new Error(String(m)))}})},isPending:f}},R=({id:e})=>{const o=x(),{defaultValues:r,updateAutomation:u,isPending:s}=L({automationId:e,onSuccess:()=>{p.success("Automation updated successfully"),o({to:"/automations"})},onError:a=>{p.error(`Failed to update automation: ${a.message}`,{duration:Number.POSITIVE_INFINITY})}}),i=a=>{u(a)};return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(T,{}),t.jsx(I,{defaultValues:r,onSubmit:i,submitLabel:"Save",isSubmitting:s})]})};function oe(){const{id:e}=N.useParams();return t.jsx(R,{id:e})}export{oe as component};
2
- //# sourceMappingURL=automation_._id.edit-Cbfcwa-K.js.map
1
+ import{j as t,s as b,r as w,d as x}from"./vendor-tanstack-BdLtprmr.js";import{D as _,B as A,g as j,h as d,bv as v,bE as k,bG as S,d9 as g,dS as E,y as p,dT as N}from"./index-CPpeVt8m.js";import{A as I}from"./automation-wizard-RlOhF90R.js";import{U as n}from"./automation-schema-D1HDjyeB.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";import"./zod-B1GLD-Zc.js";import"./form-Cl5Hk9bq.js";import"./use-stepper-CZZEx5js.js";import"./textarea-DFEOJJdc.js";import"./index-C63VUjOh.js";import"./radio-group-0oOEMJCS.js";import"./collapsible-Lk7MRvBH.js";import"./tags-input-DqZ8v99z.js";const T=()=>t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(q,{}),t.jsx(_,{label:"Documentation",id:"automations-guide"})]}),q=()=>t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(A,{children:t.jsxs(j,{children:[t.jsx(d,{children:t.jsx(v,{to:"/automations",className:"text-xl font-semibold",children:"Automations"})}),t.jsx(k,{}),t.jsx(d,{className:"text-xl font-semibold",children:t.jsx(S,{children:"Edit Automation"})})]})})});function V(e){switch(e.type){case"run-deployment":return{type:"run-deployment",deployment_id:e.deployment_id??n,parameters:e.parameters??void 0,job_variables:e.job_variables??void 0};case"pause-deployment":case"resume-deployment":return{type:e.type,deployment_id:e.deployment_id??n};case"pause-work-queue":case"resume-work-queue":return{type:e.type,work_queue_id:e.work_queue_id??n};case"pause-work-pool":case"resume-work-pool":return{type:e.type,work_pool_id:e.work_pool_id??n};case"pause-automation":case"resume-automation":return{type:e.type,automation_id:e.automation_id??n};case"cancel-flow-run":case"suspend-flow-run":case"resume-flow-run":return{type:e.type};case"change-flow-run-state":return{type:"change-flow-run-state",state:e.state,name:e.name??void 0,message:e.message??void 0};case"send-notification":return{type:"send-notification",block_document_id:e.block_document_id,body:e.body,subject:e.subject};case"do-nothing":return{type:"do-nothing"};case"call-webhook":return{type:"do-nothing"};default:return{type:"do-nothing"}}}function c(e){switch(e.type){case"event":return{type:"event",posture:e.posture,threshold:e.threshold,within:e.within,match:e.match,match_related:Array.isArray(e.match_related)?e.match_related[0]:e.match_related,for_each:e.for_each,after:e.after,expect:e.expect};case"compound":return{type:"compound",triggers:e.triggers.map(c),require:e.require,within:e.within??void 0};case"sequence":return{type:"sequence",triggers:e.triggers.map(c),within:e.within??void 0};default:return{type:"event",posture:"Reactive",threshold:1,within:0}}}function B(e){if(e.type!=="event")return"custom";const o=e.match?.["prefect.resource.id"];if(!o)return"custom";const r=Array.isArray(o)?o[0]:o;return r?.startsWith("prefect.flow-run.")?"flow-run-state":r?.startsWith("prefect.deployment.")?"deployment-status":r?.startsWith("prefect.work-pool.")?"work-pool-status":r?.startsWith("prefect.work-queue.")?"work-queue-status":"custom"}function F(e){return{name:e.name,description:e.description||void 0,triggerTemplate:B(e.trigger),trigger:c(e.trigger),actions:e.actions.map(V)}}function P(e){return{name:e.name,description:e.description??"",trigger:e.trigger,actions:e.actions}}const L=e=>{const{automationId:o,onSuccess:r,onError:u}=e,{data:s,isLoading:i}=b(g(o)),a=w.useMemo(()=>{if(s)return F(s)},[s]),{replaceAutomation:l,isPending:f}=E();return{defaultValues:a,isLoading:i,updateAutomation:h=>{const y=P(h);l({id:o,enabled:s?.enabled??!0,...y},{onSuccess:()=>{r?.()},onError:m=>{u?.(m instanceof Error?m:new Error(String(m)))}})},isPending:f}},R=({id:e})=>{const o=x(),{defaultValues:r,updateAutomation:u,isPending:s}=L({automationId:e,onSuccess:()=>{p.success("Automation updated successfully"),o({to:"/automations"})},onError:a=>{p.error(`Failed to update automation: ${a.message}`,{duration:Number.POSITIVE_INFINITY})}}),i=a=>{u(a)};return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(T,{}),t.jsx(I,{defaultValues:r,onSubmit:i,submitLabel:"Save",isSubmitting:s})]})};function oe(){const{id:e}=N.useParams();return t.jsx(R,{id:e})}export{oe as component};
2
+ //# sourceMappingURL=automation_._id.edit-BRWAsELa.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"automation_._id.edit-Cbfcwa-K.js","sources":["../../src/components/automations/automations-edit-header/automations-edit-header.tsx","../../src/components/automations/automations-wizard/use-edit-automation.ts","../../src/components/automations/automation-edit-page.tsx","../../src/routes/automations/automation_.$id.edit.tsx?tsr-split=component"],"sourcesContent":["import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\n\nexport const AutomationsEditHeader = () => (\n\t<div className=\"flex items-center justify-between\">\n\t\t<NavHeader />\n\t\t<DocsLink label=\"Documentation\" id=\"automations-guide\" />\n\t</div>\n);\n\nconst NavHeader = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/automations\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tAutomations\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>Edit Automation</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t</div>\n);\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport {\n\ttype Automation,\n\tbuildGetAutomationQuery,\n\tuseReplaceAutomation,\n} from \"@/api/automations\";\nimport type { components } from \"@/api/prefect\";\nimport {\n\ttype AutomationWizardSchema as AutomationWizardSchemaType,\n\ttype TriggerInput,\n\ttype TriggerTemplate,\n\tUNASSIGNED,\n} from \"./automation-schema\";\n\ntype AutomationAction = Automation[\"actions\"][number];\ntype AutomationTrigger = Automation[\"trigger\"];\ntype AutomationUpdate = components[\"schemas\"][\"AutomationUpdate\"];\n\n/**\n * Input type for the automation wizard form (before Zod transformations).\n * This represents what the form fields accept, not the transformed output.\n */\ntype AutomationWizardFormInput = {\n\tname: string;\n\tdescription?: string;\n\ttriggerTemplate?: TriggerTemplate;\n\ttrigger: TriggerInput;\n\tactions: ActionFormInput[];\n};\n\n/**\n * Input type for actions (before Zod transformations).\n * These types don't have the `source` field - that's added by the transform.\n */\ntype ActionFormInput =\n\t| { type: \"do-nothing\" }\n\t| { type: \"cancel-flow-run\" | \"suspend-flow-run\" | \"resume-flow-run\" }\n\t| {\n\t\t\ttype: \"change-flow-run-state\";\n\t\t\tstate:\n\t\t\t\t| \"COMPLETED\"\n\t\t\t\t| \"RUNNING\"\n\t\t\t\t| \"SCHEDULED\"\n\t\t\t\t| \"PENDING\"\n\t\t\t\t| \"FAILED\"\n\t\t\t\t| \"CANCELLED\"\n\t\t\t\t| \"CANCELLING\"\n\t\t\t\t| \"CRASHED\"\n\t\t\t\t| \"PAUSED\";\n\t\t\tname?: string;\n\t\t\tmessage?: string;\n\t }\n\t| {\n\t\t\ttype: \"run-deployment\";\n\t\t\tdeployment_id: string;\n\t\t\tparameters?: Record<string, unknown>;\n\t\t\tjob_variables?: Record<string, unknown>;\n\t }\n\t| {\n\t\t\ttype: \"pause-deployment\" | \"resume-deployment\";\n\t\t\tdeployment_id: string;\n\t }\n\t| {\n\t\t\ttype: \"pause-work-queue\" | \"resume-work-queue\";\n\t\t\twork_queue_id: string;\n\t }\n\t| {\n\t\t\ttype: \"pause-work-pool\" | \"resume-work-pool\";\n\t\t\twork_pool_id: string;\n\t }\n\t| {\n\t\t\ttype: \"pause-automation\" | \"resume-automation\";\n\t\t\tautomation_id: string;\n\t }\n\t| {\n\t\t\ttype: \"send-notification\";\n\t\t\tblock_document_id: string;\n\t\t\tbody: string;\n\t\t\tsubject: string;\n\t };\n\ntype UseEditAutomationOptions = {\n\tautomationId: string;\n\tonSuccess?: () => void;\n\tonError?: (error: Error) => void;\n};\n\ntype UseEditAutomationReturn = {\n\tdefaultValues: AutomationWizardFormInput | undefined;\n\tisLoading: boolean;\n\tupdateAutomation: (values: AutomationWizardSchemaType) => void;\n\tisPending: boolean;\n};\n\n/**\n * Transforms an API action to form-compatible format.\n * Converts null resource IDs to UNASSIGNED constant and removes source fields.\n */\nfunction transformActionToFormValue(action: AutomationAction): ActionFormInput {\n\tswitch (action.type) {\n\t\tcase \"run-deployment\": {\n\t\t\treturn {\n\t\t\t\ttype: \"run-deployment\",\n\t\t\t\tdeployment_id: action.deployment_id ?? UNASSIGNED,\n\t\t\t\tparameters: action.parameters ?? undefined,\n\t\t\t\tjob_variables: action.job_variables ?? undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-deployment\":\n\t\tcase \"resume-deployment\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\tdeployment_id: action.deployment_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-work-queue\":\n\t\tcase \"resume-work-queue\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\twork_queue_id: action.work_queue_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-work-pool\":\n\t\tcase \"resume-work-pool\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\twork_pool_id: action.work_pool_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-automation\":\n\t\tcase \"resume-automation\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\tautomation_id: action.automation_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"cancel-flow-run\":\n\t\tcase \"suspend-flow-run\":\n\t\tcase \"resume-flow-run\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t};\n\t\t}\n\t\tcase \"change-flow-run-state\": {\n\t\t\treturn {\n\t\t\t\ttype: \"change-flow-run-state\",\n\t\t\t\tstate: action.state,\n\t\t\t\tname: action.name ?? undefined,\n\t\t\t\tmessage: action.message ?? undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"send-notification\": {\n\t\t\treturn {\n\t\t\t\ttype: \"send-notification\",\n\t\t\t\tblock_document_id: action.block_document_id,\n\t\t\t\tbody: action.body,\n\t\t\t\tsubject: action.subject,\n\t\t\t};\n\t\t}\n\t\tcase \"do-nothing\": {\n\t\t\treturn {\n\t\t\t\ttype: \"do-nothing\",\n\t\t\t};\n\t\t}\n\t\tcase \"call-webhook\": {\n\t\t\t// call-webhook is not supported in the form schema, treat as do-nothing\n\t\t\treturn {\n\t\t\t\ttype: \"do-nothing\",\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\t// Fallback for any unknown action types\n\t\t\treturn {\n\t\t\t\ttype: \"do-nothing\",\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Transforms an API trigger to form-compatible format.\n * Handles event triggers, compound triggers, and sequence triggers.\n */\nfunction transformTriggerToFormValue(trigger: AutomationTrigger): TriggerInput {\n\tswitch (trigger.type) {\n\t\tcase \"event\": {\n\t\t\treturn {\n\t\t\t\ttype: \"event\",\n\t\t\t\tposture: trigger.posture,\n\t\t\t\tthreshold: trigger.threshold,\n\t\t\t\twithin: trigger.within,\n\t\t\t\tmatch: trigger.match,\n\t\t\t\tmatch_related: Array.isArray(trigger.match_related)\n\t\t\t\t\t? trigger.match_related[0]\n\t\t\t\t\t: trigger.match_related,\n\t\t\t\tfor_each: trigger.for_each,\n\t\t\t\tafter: trigger.after,\n\t\t\t\texpect: trigger.expect,\n\t\t\t};\n\t\t}\n\t\tcase \"compound\": {\n\t\t\treturn {\n\t\t\t\ttype: \"compound\",\n\t\t\t\ttriggers: trigger.triggers.map(transformTriggerToFormValue),\n\t\t\t\trequire: trigger.require,\n\t\t\t\twithin: trigger.within ?? undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"sequence\": {\n\t\t\treturn {\n\t\t\t\ttype: \"sequence\",\n\t\t\t\ttriggers: trigger.triggers.map(transformTriggerToFormValue),\n\t\t\t\twithin: trigger.within ?? undefined,\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\t// Fallback to a basic event trigger\n\t\t\treturn {\n\t\t\t\ttype: \"event\",\n\t\t\t\tposture: \"Reactive\",\n\t\t\t\tthreshold: 1,\n\t\t\t\twithin: 0,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Infers the trigger template from an event trigger's match conditions.\n * Returns \"custom\" if the template cannot be determined.\n */\nfunction inferTriggerTemplate(trigger: AutomationTrigger): TriggerTemplate {\n\tif (trigger.type !== \"event\") {\n\t\treturn \"custom\";\n\t}\n\n\tconst resourceId = trigger.match?.[\"prefect.resource.id\"];\n\tif (!resourceId) {\n\t\treturn \"custom\";\n\t}\n\n\tconst resourceIdStr = Array.isArray(resourceId) ? resourceId[0] : resourceId;\n\n\tif (resourceIdStr?.startsWith(\"prefect.flow-run.\")) {\n\t\treturn \"flow-run-state\";\n\t}\n\tif (resourceIdStr?.startsWith(\"prefect.deployment.\")) {\n\t\treturn \"deployment-status\";\n\t}\n\tif (resourceIdStr?.startsWith(\"prefect.work-pool.\")) {\n\t\treturn \"work-pool-status\";\n\t}\n\tif (resourceIdStr?.startsWith(\"prefect.work-queue.\")) {\n\t\treturn \"work-queue-status\";\n\t}\n\n\treturn \"custom\";\n}\n\n/**\n * Transforms API automation data to form-compatible values.\n * Converts null resource IDs to UNASSIGNED, removes source fields from actions,\n * and handles trigger transformations.\n */\nexport function transformAutomationToFormValues(\n\tautomation: Automation,\n): AutomationWizardFormInput {\n\treturn {\n\t\tname: automation.name,\n\t\tdescription: automation.description || undefined,\n\t\ttriggerTemplate: inferTriggerTemplate(automation.trigger),\n\t\ttrigger: transformTriggerToFormValue(automation.trigger),\n\t\tactions: automation.actions.map(transformActionToFormValue),\n\t};\n}\n\n/**\n * Transforms form values to API update format.\n * The Zod schema transformations handle most of the conversion (UNASSIGNED -> null, adding source fields).\n * This function removes form-only fields and ensures proper typing.\n */\nexport function transformFormValuesToApi(\n\tvalues: AutomationWizardSchemaType,\n): Omit<AutomationUpdate, \"enabled\"> {\n\treturn {\n\t\tname: values.name,\n\t\tdescription: values.description ?? \"\",\n\t\ttrigger: values.trigger,\n\t\tactions: values.actions,\n\t};\n}\n\n/**\n * Hook for editing an automation.\n * Fetches automation data, transforms it for form editing, and handles update submissions.\n */\nexport const useEditAutomation = (\n\toptions: UseEditAutomationOptions,\n): UseEditAutomationReturn => {\n\tconst { automationId, onSuccess, onError } = options;\n\n\tconst { data: automation, isLoading } = useSuspenseQuery(\n\t\tbuildGetAutomationQuery(automationId),\n\t);\n\n\tconst defaultValues = useMemo(() => {\n\t\tif (!automation) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn transformAutomationToFormValues(automation);\n\t}, [automation]);\n\n\tconst { replaceAutomation: replaceAutomationMutation, isPending } =\n\t\tuseReplaceAutomation();\n\n\tconst updateAutomation = (values: AutomationWizardSchemaType) => {\n\t\tconst apiValues = transformFormValuesToApi(values);\n\t\treplaceAutomationMutation(\n\t\t\t{\n\t\t\t\tid: automationId,\n\t\t\t\tenabled: automation?.enabled ?? true,\n\t\t\t\t...apiValues,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\tonSuccess?.();\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tonError?.(error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn {\n\t\tdefaultValues,\n\t\tisLoading,\n\t\tupdateAutomation,\n\t\tisPending,\n\t};\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { AutomationsEditHeader } from \"./automations-edit-header\";\nimport type { AutomationWizardSchema } from \"./automations-wizard/automation-schema\";\nimport { AutomationWizard } from \"./automations-wizard/automation-wizard\";\nimport { useEditAutomation } from \"./automations-wizard/use-edit-automation\";\n\ntype AutomationEditPageProps = {\n\tid: string;\n};\n\nexport const AutomationEditPage = ({ id }: AutomationEditPageProps) => {\n\tconst navigate = useNavigate();\n\n\tconst { defaultValues, updateAutomation, isPending } = useEditAutomation({\n\t\tautomationId: id,\n\t\tonSuccess: () => {\n\t\t\ttoast.success(\"Automation updated successfully\");\n\t\t\tvoid navigate({ to: \"/automations\" });\n\t\t},\n\t\tonError: (error) => {\n\t\t\ttoast.error(`Failed to update automation: ${error.message}`, {\n\t\t\t\tduration: Number.POSITIVE_INFINITY,\n\t\t\t});\n\t\t},\n\t});\n\n\tconst handleSubmit = (values: AutomationWizardSchema) => {\n\t\tupdateAutomation(values);\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<AutomationsEditHeader />\n\t\t\t<AutomationWizard\n\t\t\t\tdefaultValues={defaultValues}\n\t\t\t\tonSubmit={handleSubmit}\n\t\t\t\tsubmitLabel=\"Save\"\n\t\t\t\tisSubmitting={isPending}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import { createFileRoute } from \"@tanstack/react-router\";\n\nimport { buildGetAutomationQuery } from \"@/api/automations\";\nimport { AutomationEditPage } from \"@/components/automations/automation-edit-page\";\n\nexport const Route = createFileRoute(\"/automations/automation_/$id/edit\")({\n\tcomponent: RouteComponent,\n\tloader: ({ context, params }) =>\n\t\tcontext.queryClient.ensureQueryData(buildGetAutomationQuery(params.id)),\n\twrapInSuspense: true,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\treturn <AutomationEditPage id={id} />;\n}\n"],"names":["AutomationsEditHeader","jsxs","jsx","NavHeader","DocsLink","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","transformActionToFormValue","action","UNASSIGNED","transformTriggerToFormValue","trigger","inferTriggerTemplate","resourceId","resourceIdStr","transformAutomationToFormValues","automation","transformFormValuesToApi","values","useEditAutomation","options","automationId","onSuccess","onError","isLoading","useSuspenseQuery","buildGetAutomationQuery","defaultValues","useMemo","replaceAutomationMutation","isPending","useReplaceAutomation","apiValues","error","AutomationEditPage","id","navigate","useNavigate","updateAutomation","toast","handleSubmit","AutomationWizard","RouteComponent","Route","useParams"],"mappings":"2sBAUO,MAAMA,EAAwB,IACpCC,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACd,SAAA,CAAAC,EAAAA,IAACC,EAAA,EAAU,EACXD,EAAAA,IAACE,EAAA,CAAS,MAAM,gBAAgB,GAAG,mBAAA,CAAoB,CAAA,EACxD,EAGKD,EAAY,IACjBD,EAAAA,IAAC,MAAA,CAAI,UAAU,0BACd,SAAAA,EAAAA,IAACG,EAAA,CACA,SAAAJ,EAAAA,KAACK,EAAA,CACA,SAAA,CAAAJ,EAAAA,IAACK,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,eAAe,UAAU,wBAAwB,uBAEpE,CAAA,CACD,QACCC,EAAA,EAAoB,QACpBF,EAAA,CAAe,UAAU,wBACzB,SAAAL,EAAAA,IAACQ,EAAA,CAAe,2BAAe,CAAA,CAChC,CAAA,CAAA,CACD,EACD,EACD,ECmED,SAASC,EAA2BC,EAA2C,CAC9E,OAAQA,EAAO,KAAA,CACd,IAAK,iBACJ,MAAO,CACN,KAAM,iBACN,cAAeA,EAAO,eAAiBC,EACvC,WAAYD,EAAO,YAAc,OACjC,cAAeA,EAAO,eAAiB,MAAA,EAGzC,IAAK,mBACL,IAAK,oBACJ,MAAO,CACN,KAAMA,EAAO,KACb,cAAeA,EAAO,eAAiBC,CAAA,EAGzC,IAAK,mBACL,IAAK,oBACJ,MAAO,CACN,KAAMD,EAAO,KACb,cAAeA,EAAO,eAAiBC,CAAA,EAGzC,IAAK,kBACL,IAAK,mBACJ,MAAO,CACN,KAAMD,EAAO,KACb,aAAcA,EAAO,cAAgBC,CAAA,EAGvC,IAAK,mBACL,IAAK,oBACJ,MAAO,CACN,KAAMD,EAAO,KACb,cAAeA,EA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CAAE,GAAAC,KAAkC,CACtE,MAAMC,EAAWC,EAAA,EAEX,CAAE,cAAAV,EAAe,iBAAAW,EAAkB,UAAAR,CAAA,EAAcX,EAAkB,CACxE,aAAcgB,EACd,UAAW,IAAM,CAChBI,EAAM,QAAQ,iCAAiC,EAC1CH,EAAS,CAAE,GAAI,eAAgB,CACrC,EACA,QAAUH,GAAU,CACnBM,EAAM,MAAM,gCAAgCN,EAAM,OAAO,GAAI,CAC5D,SAAU,OAAO,iBAAA,CACjB,CACF,CAAA,CACA,EAEKO,EAAgBtB,GAAmC,CACxDoB,EAAiBpB,CAAM,CACxB,EAEA,OACCrB,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAC,EAAAA,IAACF,EAAA,EAAsB,EACvBE,EAAAA,IAAC2C,EAAA,CACA,cAAAd,EACA,SAAUa,EACV,YAAY,OACZ,aAAcV,CAAA,CAAA,CACf,EACD,CAEF,EC9BA,SAASY,IAAiB,CACzB,KAAM,CAAEP,GAAAA,CAAAA,EAAOQ,EAAMC,UAAAA,EACrB,OAAO9C,MAACoC,GAAmB,GAAAC,EAAO,CACnC"}
1
+ {"version":3,"file":"automation_._id.edit-BRWAsELa.js","sources":["../../src/components/automations/automations-edit-header/automations-edit-header.tsx","../../src/components/automations/automations-wizard/use-edit-automation.ts","../../src/components/automations/automation-edit-page.tsx","../../src/routes/automations/automation_.$id.edit.tsx?tsr-split=component"],"sourcesContent":["import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\n\nexport const AutomationsEditHeader = () => (\n\t<div className=\"flex items-center justify-between\">\n\t\t<NavHeader />\n\t\t<DocsLink label=\"Documentation\" id=\"automations-guide\" />\n\t</div>\n);\n\nconst NavHeader = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/automations\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tAutomations\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>Edit Automation</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t</div>\n);\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport {\n\ttype Automation,\n\tbuildGetAutomationQuery,\n\tuseReplaceAutomation,\n} from \"@/api/automations\";\nimport type { components } from \"@/api/prefect\";\nimport {\n\ttype AutomationWizardSchema as AutomationWizardSchemaType,\n\ttype TriggerInput,\n\ttype TriggerTemplate,\n\tUNASSIGNED,\n} from \"./automation-schema\";\n\ntype AutomationAction = Automation[\"actions\"][number];\ntype AutomationTrigger = Automation[\"trigger\"];\ntype AutomationUpdate = components[\"schemas\"][\"AutomationUpdate\"];\n\n/**\n * Input type for the automation wizard form (before Zod transformations).\n * This represents what the form fields accept, not the transformed output.\n */\ntype AutomationWizardFormInput = {\n\tname: string;\n\tdescription?: string;\n\ttriggerTemplate?: TriggerTemplate;\n\ttrigger: TriggerInput;\n\tactions: ActionFormInput[];\n};\n\n/**\n * Input type for actions (before Zod transformations).\n * These types don't have the `source` field - that's added by the transform.\n */\ntype ActionFormInput =\n\t| { type: \"do-nothing\" }\n\t| { type: \"cancel-flow-run\" | \"suspend-flow-run\" | \"resume-flow-run\" }\n\t| {\n\t\t\ttype: \"change-flow-run-state\";\n\t\t\tstate:\n\t\t\t\t| \"COMPLETED\"\n\t\t\t\t| \"RUNNING\"\n\t\t\t\t| \"SCHEDULED\"\n\t\t\t\t| \"PENDING\"\n\t\t\t\t| \"FAILED\"\n\t\t\t\t| \"CANCELLED\"\n\t\t\t\t| \"CANCELLING\"\n\t\t\t\t| \"CRASHED\"\n\t\t\t\t| \"PAUSED\";\n\t\t\tname?: string;\n\t\t\tmessage?: string;\n\t }\n\t| {\n\t\t\ttype: \"run-deployment\";\n\t\t\tdeployment_id: string;\n\t\t\tparameters?: Record<string, unknown>;\n\t\t\tjob_variables?: Record<string, unknown>;\n\t }\n\t| {\n\t\t\ttype: \"pause-deployment\" | \"resume-deployment\";\n\t\t\tdeployment_id: string;\n\t }\n\t| {\n\t\t\ttype: \"pause-work-queue\" | \"resume-work-queue\";\n\t\t\twork_queue_id: string;\n\t }\n\t| {\n\t\t\ttype: \"pause-work-pool\" | \"resume-work-pool\";\n\t\t\twork_pool_id: string;\n\t }\n\t| {\n\t\t\ttype: \"pause-automation\" | \"resume-automation\";\n\t\t\tautomation_id: string;\n\t }\n\t| {\n\t\t\ttype: \"send-notification\";\n\t\t\tblock_document_id: string;\n\t\t\tbody: string;\n\t\t\tsubject: string;\n\t };\n\ntype UseEditAutomationOptions = {\n\tautomationId: string;\n\tonSuccess?: () => void;\n\tonError?: (error: Error) => void;\n};\n\ntype UseEditAutomationReturn = {\n\tdefaultValues: AutomationWizardFormInput | undefined;\n\tisLoading: boolean;\n\tupdateAutomation: (values: AutomationWizardSchemaType) => void;\n\tisPending: boolean;\n};\n\n/**\n * Transforms an API action to form-compatible format.\n * Converts null resource IDs to UNASSIGNED constant and removes source fields.\n */\nfunction transformActionToFormValue(action: AutomationAction): ActionFormInput {\n\tswitch (action.type) {\n\t\tcase \"run-deployment\": {\n\t\t\treturn {\n\t\t\t\ttype: \"run-deployment\",\n\t\t\t\tdeployment_id: action.deployment_id ?? UNASSIGNED,\n\t\t\t\tparameters: action.parameters ?? undefined,\n\t\t\t\tjob_variables: action.job_variables ?? undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-deployment\":\n\t\tcase \"resume-deployment\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\tdeployment_id: action.deployment_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-work-queue\":\n\t\tcase \"resume-work-queue\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\twork_queue_id: action.work_queue_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-work-pool\":\n\t\tcase \"resume-work-pool\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\twork_pool_id: action.work_pool_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"pause-automation\":\n\t\tcase \"resume-automation\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t\tautomation_id: action.automation_id ?? UNASSIGNED,\n\t\t\t};\n\t\t}\n\t\tcase \"cancel-flow-run\":\n\t\tcase \"suspend-flow-run\":\n\t\tcase \"resume-flow-run\": {\n\t\t\treturn {\n\t\t\t\ttype: action.type,\n\t\t\t};\n\t\t}\n\t\tcase \"change-flow-run-state\": {\n\t\t\treturn {\n\t\t\t\ttype: \"change-flow-run-state\",\n\t\t\t\tstate: action.state,\n\t\t\t\tname: action.name ?? undefined,\n\t\t\t\tmessage: action.message ?? undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"send-notification\": {\n\t\t\treturn {\n\t\t\t\ttype: \"send-notification\",\n\t\t\t\tblock_document_id: action.block_document_id,\n\t\t\t\tbody: action.body,\n\t\t\t\tsubject: action.subject,\n\t\t\t};\n\t\t}\n\t\tcase \"do-nothing\": {\n\t\t\treturn {\n\t\t\t\ttype: \"do-nothing\",\n\t\t\t};\n\t\t}\n\t\tcase \"call-webhook\": {\n\t\t\t// call-webhook is not supported in the form schema, treat as do-nothing\n\t\t\treturn {\n\t\t\t\ttype: \"do-nothing\",\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\t// Fallback for any unknown action types\n\t\t\treturn {\n\t\t\t\ttype: \"do-nothing\",\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Transforms an API trigger to form-compatible format.\n * Handles event triggers, compound triggers, and sequence triggers.\n */\nfunction transformTriggerToFormValue(trigger: AutomationTrigger): TriggerInput {\n\tswitch (trigger.type) {\n\t\tcase \"event\": {\n\t\t\treturn {\n\t\t\t\ttype: \"event\",\n\t\t\t\tposture: trigger.posture,\n\t\t\t\tthreshold: trigger.threshold,\n\t\t\t\twithin: trigger.within,\n\t\t\t\tmatch: trigger.match,\n\t\t\t\tmatch_related: Array.isArray(trigger.match_related)\n\t\t\t\t\t? trigger.match_related[0]\n\t\t\t\t\t: trigger.match_related,\n\t\t\t\tfor_each: trigger.for_each,\n\t\t\t\tafter: trigger.after,\n\t\t\t\texpect: trigger.expect,\n\t\t\t};\n\t\t}\n\t\tcase \"compound\": {\n\t\t\treturn {\n\t\t\t\ttype: \"compound\",\n\t\t\t\ttriggers: trigger.triggers.map(transformTriggerToFormValue),\n\t\t\t\trequire: trigger.require,\n\t\t\t\twithin: trigger.within ?? undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"sequence\": {\n\t\t\treturn {\n\t\t\t\ttype: \"sequence\",\n\t\t\t\ttriggers: trigger.triggers.map(transformTriggerToFormValue),\n\t\t\t\twithin: trigger.within ?? undefined,\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\t// Fallback to a basic event trigger\n\t\t\treturn {\n\t\t\t\ttype: \"event\",\n\t\t\t\tposture: \"Reactive\",\n\t\t\t\tthreshold: 1,\n\t\t\t\twithin: 0,\n\t\t\t};\n\t\t}\n\t}\n}\n\n/**\n * Infers the trigger template from an event trigger's match conditions.\n * Returns \"custom\" if the template cannot be determined.\n */\nfunction inferTriggerTemplate(trigger: AutomationTrigger): TriggerTemplate {\n\tif (trigger.type !== \"event\") {\n\t\treturn \"custom\";\n\t}\n\n\tconst resourceId = trigger.match?.[\"prefect.resource.id\"];\n\tif (!resourceId) {\n\t\treturn \"custom\";\n\t}\n\n\tconst resourceIdStr = Array.isArray(resourceId) ? resourceId[0] : resourceId;\n\n\tif (resourceIdStr?.startsWith(\"prefect.flow-run.\")) {\n\t\treturn \"flow-run-state\";\n\t}\n\tif (resourceIdStr?.startsWith(\"prefect.deployment.\")) {\n\t\treturn \"deployment-status\";\n\t}\n\tif (resourceIdStr?.startsWith(\"prefect.work-pool.\")) {\n\t\treturn \"work-pool-status\";\n\t}\n\tif (resourceIdStr?.startsWith(\"prefect.work-queue.\")) {\n\t\treturn \"work-queue-status\";\n\t}\n\n\treturn \"custom\";\n}\n\n/**\n * Transforms API automation data to form-compatible values.\n * Converts null resource IDs to UNASSIGNED, removes source fields from actions,\n * and handles trigger transformations.\n */\nexport function transformAutomationToFormValues(\n\tautomation: Automation,\n): AutomationWizardFormInput {\n\treturn {\n\t\tname: automation.name,\n\t\tdescription: automation.description || undefined,\n\t\ttriggerTemplate: inferTriggerTemplate(automation.trigger),\n\t\ttrigger: transformTriggerToFormValue(automation.trigger),\n\t\tactions: automation.actions.map(transformActionToFormValue),\n\t};\n}\n\n/**\n * Transforms form values to API update format.\n * The Zod schema transformations handle most of the conversion (UNASSIGNED -> null, adding source fields).\n * This function removes form-only fields and ensures proper typing.\n */\nexport function transformFormValuesToApi(\n\tvalues: AutomationWizardSchemaType,\n): Omit<AutomationUpdate, \"enabled\"> {\n\treturn {\n\t\tname: values.name,\n\t\tdescription: values.description ?? \"\",\n\t\ttrigger: values.trigger,\n\t\tactions: values.actions,\n\t};\n}\n\n/**\n * Hook for editing an automation.\n * Fetches automation data, transforms it for form editing, and handles update submissions.\n */\nexport const useEditAutomation = (\n\toptions: UseEditAutomationOptions,\n): UseEditAutomationReturn => {\n\tconst { automationId, onSuccess, onError } = options;\n\n\tconst { data: automation, isLoading } = useSuspenseQuery(\n\t\tbuildGetAutomationQuery(automationId),\n\t);\n\n\tconst defaultValues = useMemo(() => {\n\t\tif (!automation) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn transformAutomationToFormValues(automation);\n\t}, [automation]);\n\n\tconst { replaceAutomation: replaceAutomationMutation, isPending } =\n\t\tuseReplaceAutomation();\n\n\tconst updateAutomation = (values: AutomationWizardSchemaType) => {\n\t\tconst apiValues = transformFormValuesToApi(values);\n\t\treplaceAutomationMutation(\n\t\t\t{\n\t\t\t\tid: automationId,\n\t\t\t\tenabled: automation?.enabled ?? true,\n\t\t\t\t...apiValues,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\tonSuccess?.();\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tonError?.(error instanceof Error ? error : new Error(String(error)));\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn {\n\t\tdefaultValues,\n\t\tisLoading,\n\t\tupdateAutomation,\n\t\tisPending,\n\t};\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { AutomationsEditHeader } from \"./automations-edit-header\";\nimport type { AutomationWizardSchema } from \"./automations-wizard/automation-schema\";\nimport { AutomationWizard } from \"./automations-wizard/automation-wizard\";\nimport { useEditAutomation } from \"./automations-wizard/use-edit-automation\";\n\ntype AutomationEditPageProps = {\n\tid: string;\n};\n\nexport const AutomationEditPage = ({ id }: AutomationEditPageProps) => {\n\tconst navigate = useNavigate();\n\n\tconst { defaultValues, updateAutomation, isPending } = useEditAutomation({\n\t\tautomationId: id,\n\t\tonSuccess: () => {\n\t\t\ttoast.success(\"Automation updated successfully\");\n\t\t\tvoid navigate({ to: \"/automations\" });\n\t\t},\n\t\tonError: (error) => {\n\t\t\ttoast.error(`Failed to update automation: ${error.message}`, {\n\t\t\t\tduration: Number.POSITIVE_INFINITY,\n\t\t\t});\n\t\t},\n\t});\n\n\tconst handleSubmit = (values: AutomationWizardSchema) => {\n\t\tupdateAutomation(values);\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<AutomationsEditHeader />\n\t\t\t<AutomationWizard\n\t\t\t\tdefaultValues={defaultValues}\n\t\t\t\tonSubmit={handleSubmit}\n\t\t\t\tsubmitLabel=\"Save\"\n\t\t\t\tisSubmitting={isPending}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import { createFileRoute } from \"@tanstack/react-router\";\nimport { buildGetAutomationQuery } from \"@/api/automations\";\nimport { AutomationEditPage } from \"@/components/automations/automation-edit-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nexport const Route = createFileRoute(\"/automations/automation_/$id/edit\")({\n\tcomponent: RouteComponent,\n\tloader: ({ context, params }) =>\n\t\tcontext.queryClient.ensureQueryData(buildGetAutomationQuery(params.id)),\n\twrapInSuspense: true,\n\tpendingComponent: PrefectLoading,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\treturn <AutomationEditPage id={id} />;\n}\n"],"names":["AutomationsEditHeader","jsxs","jsx","NavHeader","DocsLink","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","transformActionToFormValue","action","UNASSIGNED","transformTriggerToFormValue","trigger","inferTriggerTemplate","resourceId","resourceIdStr","transformAutomationToFormValues","automation","transformFormValuesToApi","values","useEditAutomation","options","automationId","onSuccess","onError","isLoading","useSuspenseQuery","buildGetAutomationQuery","defaultValues","useMemo","replaceAutomationMutation","isPending","useReplaceAutomation","apiValues","error","AutomationEditPage","id","navigate","useNavigate","updateAutomation","toast","handleSubmit","AutomationWizard","RouteComponent","Route","useParams"],"mappings":"2sBAUO,MAAMA,EAAwB,IACpCC,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACd,SAAA,CAAAC,EAAAA,IAACC,EAAA,EAAU,EACXD,EAAAA,IAACE,EAAA,CAAS,MAAM,gBAAgB,GAAG,mBAAA,CAAoB,CAAA,EACxD,EAGKD,EAAY,IACjBD,EAAAA,IAAC,MAAA,CAAI,UAAU,0BACd,SAAAA,EAAAA,IAACG,EAAA,CACA,SAAAJ,EAAAA,KAACK,EAAA,CACA,SAAA,CAAAJ,EAAAA,IAACK,EAAA,CACA,eAAC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V,YAAY,OACZ,aAAcV,CAAA,CAAA,CACf,EACD,CAEF,EC7BA,SAASY,IAAiB,CACzB,KAAM,CAAEP,GAAAA,CAAAA,EAAOQ,EAAMC,UAAAA,EACrB,OAAO9C,MAACoC,GAAmB,GAAAC,EAAO,CACnC"}
@@ -1,2 +1,2 @@
1
- import{j as e,L as s}from"./vendor-tanstack-BdLtprmr.js";import{D as a,B as t,g as i,h as r,q as n,I as o}from"./index-V_xTKaEb.js";const d=()=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(c,{}),e.jsx(a,{id:"automations-guide",label:"Documentation"})]}),c=()=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{children:e.jsx(i,{children:e.jsx(r,{className:"text-xl font-semibold",children:"Automations"})})}),e.jsx(s,{to:"/automations/create","aria-label":"create automation",children:e.jsx(n,{size:"icon",className:"size-7",variant:"outline","aria-label":"create automation",children:e.jsx(o,{id:"Plus",className:"size-4"})})})]});export{d as A};
2
- //# sourceMappingURL=automations-header-BxPCOE-0.js.map
1
+ import{j as e,L as s}from"./vendor-tanstack-BdLtprmr.js";import{D as a,B as t,g as i,h as r,q as n,I as o}from"./index-CPpeVt8m.js";const d=()=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(c,{}),e.jsx(a,{id:"automations-guide",label:"Documentation"})]}),c=()=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{children:e.jsx(i,{children:e.jsx(r,{className:"text-xl font-semibold",children:"Automations"})})}),e.jsx(s,{to:"/automations/create","aria-label":"create automation",children:e.jsx(n,{size:"icon",className:"size-7",variant:"outline","aria-label":"create automation",children:e.jsx(o,{id:"Plus",className:"size-4"})})})]});export{d as A};
2
+ //# sourceMappingURL=automations-header-Dr6v5dPp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"automations-header-BxPCOE-0.js","sources":["../../src/components/automations/automations-header/automations-header.tsx"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport { Icon } from \"@/components/ui/icons\";\n\nexport const AutomationsHeader = () => {\n\treturn (\n\t\t<div className=\"flex items-center justify-between\">\n\t\t\t<Header />\n\t\t\t<DocsLink id=\"automations-guide\" label=\"Documentation\" />\n\t\t</div>\n\t);\n};\n\nconst Header = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\tAutomations\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t\t<Link to=\"/automations/create\" aria-label=\"create automation\">\n\t\t\t<Button\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"create automation\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</Link>\n\t</div>\n);\n"],"names":["AutomationsHeader","jsxs","jsx","Header","DocsLink","Breadcrumb","BreadcrumbList","BreadcrumbItem","Link","Button","Icon"],"mappings":"oIAUO,MAAMA,EAAoB,IAE/BC,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACd,SAAA,CAAAC,EAAAA,IAACC,EAAA,EAAO,EACRD,EAAAA,IAACE,EAAA,CAAS,GAAG,oBAAoB,MAAM,eAAA,CAAgB,CAAA,EACxD,EAIID,EAAS,IACdF,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAC,EAAAA,IAACG,EAAA,CACA,eAACC,EAAA,CACA,SAAAJ,EAAAA,IAACK,GAAe,UAAU,wBAAwB,SAAA,aAAA,CAElD,CAAA,CACD,EACD,EACAL,EAAAA,IAACM,EAAA,CAAK,GAAG,sBAAsB,aAAW,oBACzC,SAAAN,EAAAA,IAACO,EAAA,CACA,KAAK,OACL,UAAU,SACV,QAAQ,UACR,aAAW,oBAEX,SAAAP,EAAAA,IAACQ,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CACD,CAAA,EACD"}
1
+ {"version":3,"file":"automations-header-Dr6v5dPp.js","sources":["../../src/components/automations/automations-header/automations-header.tsx"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport { Icon } from \"@/components/ui/icons\";\n\nexport const AutomationsHeader = () => {\n\treturn (\n\t\t<div className=\"flex items-center justify-between\">\n\t\t\t<Header />\n\t\t\t<DocsLink id=\"automations-guide\" label=\"Documentation\" />\n\t\t</div>\n\t);\n};\n\nconst Header = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\tAutomations\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t\t<Link to=\"/automations/create\" aria-label=\"create automation\">\n\t\t\t<Button\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"create automation\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</Link>\n\t</div>\n);\n"],"names":["AutomationsHeader","jsxs","jsx","Header","DocsLink","Breadcrumb","BreadcrumbList","BreadcrumbItem","Link","Button","Icon"],"mappings":"oIAUO,MAAMA,EAAoB,IAE/BC,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACd,SAAA,CAAAC,EAAAA,IAACC,EAAA,EAAO,EACRD,EAAAA,IAACE,EAAA,CAAS,GAAG,oBAAoB,MAAM,eAAA,CAAgB,CAAA,EACxD,EAIID,EAAS,IACdF,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAC,EAAAA,IAACG,EAAA,CACA,eAACC,EAAA,CACA,SAAAJ,EAAAA,IAACK,GAAe,UAAU,wBAAwB,SAAA,aAAA,CAElD,CAAA,CACD,EACD,EACAL,EAAAA,IAACM,EAAA,CAAK,GAAG,sBAAsB,aAAW,oBACzC,SAAAN,EAAAA,IAACO,EAAA,CACA,KAAK,OACL,UAAU,SACV,QAAQ,UACR,aAAW,oBAEX,SAAAP,EAAAA,IAACQ,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CACD,CAAA,EACD"}
@@ -0,0 +1,2 @@
1
+ import{r as o,j as e}from"./vendor-tanstack-BdLtprmr.js";import{a as O,b as k}from"./schema-form-input-string-format-datetime-Dg3zVAp5.js";import{SchemaForm as w}from"./schema-form-BD-WM4S0.js";import{az as E,aA as V,aB as p,aC as f,C as i,o as d,bz as u,i as T,L as F}from"./index-CPpeVt8m.js";function M({baseJobTemplate:n,onBaseJobTemplateChange:l}){const[x,h]=o.useState(()=>JSON.stringify(n||{},null,2)),[c,m]=o.useState(null),s=o.useMemo(()=>n?.variables,[n?.variables]),b=o.useMemo(()=>s?.properties&&Object.keys(s.properties).length>0,[s?.properties]),v=o.useMemo(()=>{if(!s?.properties)return{};const a={};return Object.entries(s.properties).forEach(([r,t])=>{t&&typeof t=="object"&&"default"in t&&(a[r]=t.default)}),a},[s?.properties]),[S,j]=O(v),[N]=k([]),g=o.useCallback(a=>{if(j(a),!s?.properties)return;const r={...n,variables:{...s,properties:Object.fromEntries(Object.entries(s.properties).map(([t,C])=>[t,{...C,default:a[t]}]))}};l(r),h(JSON.stringify(r,null,2))},[n,s,l,j]),y=o.useCallback(a=>{h(a),m(null);try{const r=JSON.parse(a);l(r)}catch(r){m(r instanceof Error?r.message:"Invalid JSON")}},[l]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-2xl font-semibold tracking-tight",children:"Base Job Template"}),e.jsxs(E,{defaultValue:"defaults",className:"w-full",children:[e.jsxs(V,{children:[e.jsx(p,{value:"defaults",children:"Defaults"}),e.jsx(p,{value:"advanced",children:"Advanced"})]}),e.jsx(f,{value:"defaults",className:"space-y-4",children:b?e.jsxs(e.Fragment,{children:[e.jsx(i,{children:e.jsx(d,{children:e.jsx(u,{children:"The fields below control the default values for the base job template. These values can be overridden by deployments."})})}),s&&e.jsx(w,{schema:s,kinds:["json"],values:S,onValuesChange:g,errors:N})]}):e.jsx(i,{children:e.jsx(d,{children:e.jsxs(u,{children:["This work pool's base job template does not have any customizations. To add customizations, edit the base job template directly with the ",e.jsx("strong",{children:"Advanced"})," tab."]})})})}),e.jsxs(f,{value:"advanced",className:"space-y-4",children:[e.jsx(i,{children:e.jsx(d,{children:e.jsxs(u,{children:["This is the JSON representation of the base job template. A work pool's job template controls infrastructure configuration for all flow runs in the work pool, and specifies the configuration that can be overridden by deployments.",e.jsx("br",{}),e.jsx("br",{}),"For more information on the structure of a work pool's base job template, check out the docs."]})})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{children:"Base Job Template JSON"}),e.jsx(F,{value:x,onChange:y,className:c?"border-destructive":""}),c&&e.jsx("p",{className:"text-sm text-destructive",children:c})]})]})]})]})}export{M as B};
2
+ //# sourceMappingURL=base-job-template-form-section-C8_R96gO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-job-template-form-section-C8_R96gO.js","sources":["../../src/components/work-pools/create/infrastructure-configuration-step/base-job-template-form-section.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from \"react\";\nimport { useSchemaFormErrors } from \"@/components/schemas/hooks/useSchemaFormErrors\";\nimport { useSchemaFormValues } from \"@/components/schemas/hooks/useSchemaValues\";\nimport { SchemaForm } from \"@/components/schemas/schema-form\";\nimport type { PrefectSchemaObject } from \"@/components/schemas/types/schemas\";\nimport type { SchemaFormValues } from \"@/components/schemas/types/values\";\nimport { Card, CardContent, CardDescription } from \"@/components/ui/card\";\nimport type { JsonInputOnChange } from \"@/components/ui/json-input\";\nimport { LazyJsonInput as JsonInput } from \"@/components/ui/json-input-lazy\";\nimport { Label } from \"@/components/ui/label\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport type { WorkerBaseJobTemplate } from \"./schema\";\n\ntype BaseJobTemplateFormSectionProps = {\n\tbaseJobTemplate?: WorkerBaseJobTemplate;\n\tonBaseJobTemplateChange: (value: WorkerBaseJobTemplate) => void;\n};\n\nexport function BaseJobTemplateFormSection({\n\tbaseJobTemplate,\n\tonBaseJobTemplateChange,\n}: BaseJobTemplateFormSectionProps) {\n\tconst [jsonValue, setJsonValue] = useState(() =>\n\t\tJSON.stringify(baseJobTemplate || {}, null, 2),\n\t);\n\tconst [jsonError, setJsonError] = useState<string | null>(null);\n\n\tconst variablesSchema = useMemo<PrefectSchemaObject | undefined>(() => {\n\t\treturn baseJobTemplate?.variables as PrefectSchemaObject;\n\t}, [baseJobTemplate?.variables]);\n\n\tconst hasSchemaProperties = useMemo(() => {\n\t\treturn (\n\t\t\tvariablesSchema?.properties &&\n\t\t\tObject.keys(variablesSchema.properties).length > 0\n\t\t);\n\t}, [variablesSchema?.properties]);\n\n\t// Get default values from schema properties\n\tconst defaultValues = useMemo<SchemaFormValues>(() => {\n\t\tif (!variablesSchema?.properties) return {};\n\n\t\tconst defaults: SchemaFormValues = {};\n\t\tObject.entries(variablesSchema.properties).forEach(([key, property]) => {\n\t\t\tif (property && typeof property === \"object\" && \"default\" in property) {\n\t\t\t\tdefaults[key] = property.default;\n\t\t\t}\n\t\t});\n\t\treturn defaults;\n\t}, [variablesSchema?.properties]);\n\n\tconst [schemaValues, setSchemaValues] = useSchemaFormValues(defaultValues);\n\tconst [schemaErrors] = useSchemaFormErrors([]);\n\n\tconst handleSchemaValuesChange = useCallback(\n\t\t(values: SchemaFormValues) => {\n\t\t\tsetSchemaValues(values);\n\n\t\t\tif (!variablesSchema?.properties) return;\n\n\t\t\t// Update the base job template with new default values\n\t\t\tconst newTemplate: WorkerBaseJobTemplate = {\n\t\t\t\t...baseJobTemplate,\n\t\t\t\tvariables: {\n\t\t\t\t\t...variablesSchema,\n\t\t\t\t\tproperties: Object.fromEntries(\n\t\t\t\t\t\tObject.entries(variablesSchema.properties).map(\n\t\t\t\t\t\t\t([key, property]) => [\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...property,\n\t\t\t\t\t\t\t\t\tdefault: values[key],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tonBaseJobTemplateChange(newTemplate);\n\t\t\tsetJsonValue(JSON.stringify(newTemplate, null, 2));\n\t\t},\n\t\t[\n\t\t\tbaseJobTemplate,\n\t\t\tvariablesSchema,\n\t\t\tonBaseJobTemplateChange,\n\t\t\tsetSchemaValues,\n\t\t],\n\t);\n\n\tconst handleJsonChange = useCallback(\n\t\t(value: string) => {\n\t\t\tsetJsonValue(value);\n\t\t\tsetJsonError(null);\n\n\t\t\ttry {\n\t\t\t\tconst parsed = JSON.parse(value) as WorkerBaseJobTemplate;\n\t\t\t\tonBaseJobTemplateChange(parsed);\n\t\t\t} catch (error) {\n\t\t\t\tsetJsonError(error instanceof Error ? error.message : \"Invalid JSON\");\n\t\t\t}\n\t\t},\n\t\t[onBaseJobTemplateChange],\n\t);\n\n\treturn (\n\t\t<div className=\"space-y-4\">\n\t\t\t<h3 className=\"text-2xl font-semibold tracking-tight\">\n\t\t\t\tBase Job Template\n\t\t\t</h3>\n\n\t\t\t<Tabs defaultValue=\"defaults\" className=\"w-full\">\n\t\t\t\t<TabsList>\n\t\t\t\t\t<TabsTrigger value=\"defaults\">Defaults</TabsTrigger>\n\t\t\t\t\t<TabsTrigger value=\"advanced\">Advanced</TabsTrigger>\n\t\t\t\t</TabsList>\n\n\t\t\t\t<TabsContent value=\"defaults\" className=\"space-y-4\">\n\t\t\t\t\t{hasSchemaProperties ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Card>\n\t\t\t\t\t\t\t\t<CardContent>\n\t\t\t\t\t\t\t\t\t<CardDescription>\n\t\t\t\t\t\t\t\t\t\tThe fields below control the default values for the base job\n\t\t\t\t\t\t\t\t\t\ttemplate. These values can be overridden by deployments.\n\t\t\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t\t\t</CardContent>\n\t\t\t\t\t\t\t</Card>\n\n\t\t\t\t\t\t\t{variablesSchema && (\n\t\t\t\t\t\t\t\t<SchemaForm\n\t\t\t\t\t\t\t\t\tschema={variablesSchema}\n\t\t\t\t\t\t\t\t\tkinds={[\"json\"]}\n\t\t\t\t\t\t\t\t\tvalues={schemaValues}\n\t\t\t\t\t\t\t\t\tonValuesChange={handleSchemaValuesChange}\n\t\t\t\t\t\t\t\t\terrors={schemaErrors}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Card>\n\t\t\t\t\t\t\t<CardContent>\n\t\t\t\t\t\t\t\t<CardDescription>\n\t\t\t\t\t\t\t\t\tThis work pool&apos;s base job template does not have any\n\t\t\t\t\t\t\t\t\tcustomizations. To add customizations, edit the base job\n\t\t\t\t\t\t\t\t\ttemplate directly with the <strong>Advanced</strong> tab.\n\t\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t\t</CardContent>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t)}\n\t\t\t\t</TabsContent>\n\n\t\t\t\t<TabsContent value=\"advanced\" className=\"space-y-4\">\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardContent>\n\t\t\t\t\t\t\t<CardDescription>\n\t\t\t\t\t\t\t\tThis is the JSON representation of the base job template. A work\n\t\t\t\t\t\t\t\tpool&apos;s job template controls infrastructure configuration\n\t\t\t\t\t\t\t\tfor all flow runs in the work pool, and specifies the\n\t\t\t\t\t\t\t\tconfiguration that can be overridden by deployments.\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\tFor more information on the structure of a work pool&apos;s base\n\t\t\t\t\t\t\t\tjob template, check out the docs.\n\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t</CardContent>\n\t\t\t\t\t</Card>\n\n\t\t\t\t\t<div className=\"space-y-2\">\n\t\t\t\t\t\t<Label>Base Job Template JSON</Label>\n\t\t\t\t\t\t<JsonInput\n\t\t\t\t\t\t\tvalue={jsonValue}\n\t\t\t\t\t\t\tonChange={handleJsonChange as JsonInputOnChange}\n\t\t\t\t\t\t\tclassName={jsonError ? \"border-destructive\" : \"\"}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{jsonError && (\n\t\t\t\t\t\t\t<p className=\"text-sm text-destructive\">{jsonError}</p>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</TabsContent>\n\t\t\t</Tabs>\n\t\t</div>\n\t);\n}\n"],"names":["BaseJobTemplateFormSection","baseJobTemplate","onBaseJobTemplateChange","jsonValue","setJsonValue","useState","jsonError","setJsonError","variablesSchema","useMemo","hasSchemaProperties","defaultValues","defaults","key","property","schemaValues","setSchemaValues","useSchemaFormValues","schemaErrors","useSchemaFormErrors","handleSchemaValuesChange","useCallback","values","newTemplate","handleJsonChange","value","parsed","error","jsxs","jsx","Tabs","TabsList","TabsTrigger","TabsContent","Fragment","Card","CardContent","CardDescription","SchemaForm","Label","JsonInput"],"mappings":"uSAkBO,SAASA,EAA2B,CAC1C,gBAAAC,EACA,wBAAAC,CACD,EAAoC,CACnC,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAS,IAC1C,KAAK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,QACH,KAAA,EAAG,EAAE,+FAAA,CAAA,CAGP,EACD,EACD,EAEAT,EAAAA,KAAC,MAAA,CAAI,UAAU,YACd,SAAA,CAAAC,EAAAA,IAACU,GAAM,SAAA,wBAAA,CAAsB,EAC7BV,EAAAA,IAACW,EAAA,CACA,MAAOrC,EACP,SAAUqB,EACV,UAAWlB,EAAY,qBAAuB,EAAA,CAAA,EAE9CA,GACAuB,EAAAA,IAAC,IAAA,CAAE,UAAU,2BAA4B,SAAAvB,CAAA,CAAU,CAAA,CAAA,CAErD,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,EACD,CAEF"}
@@ -0,0 +1,2 @@
1
+ import{j as s}from"./vendor-tanstack-BdLtprmr.js";import{B as e}from"./block-type-logo-scnMsyY5.js";import{C as o}from"./index-CPpeVt8m.js";import{L as i}from"./lazy-markdown-D_y73qoD.js";function n({blockType:r}){return s.jsxs(o,{className:"p-6 max-h-60",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(e,{size:"lg",logoUrl:r.logo_url}),s.jsx("h4",{className:"text-xl font-semibold tracking-tight",children:r.name})]}),r.description&&s.jsx("div",{className:"prose max-w-none overflow-y-scroll text-sm",children:s.jsx(i,{children:r.description})})]})}export{n as B};
2
+ //# sourceMappingURL=block-type-details-tAkUWqs1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-type-details-tAkUWqs1.js","sources":["../../src/components/blocks/block-type-details.tsx"],"sourcesContent":["import type { BlockType } from \"@/api/block-types\";\nimport { BlockTypeLogo } from \"@/components/block-type-logo/block-type-logo\";\nimport { Card } from \"@/components/ui/card\";\nimport { LazyMarkdown } from \"@/components/ui/lazy-markdown\";\n\ntype BlockTypeDetailsProps = {\n\tblockType: BlockType;\n};\n\nexport function BlockTypeDetails({ blockType }: BlockTypeDetailsProps) {\n\treturn (\n\t\t<Card className=\"p-6 max-h-60\">\n\t\t\t<div className=\"flex items-center gap-4\">\n\t\t\t\t<BlockTypeLogo size=\"lg\" logoUrl={blockType.logo_url} />\n\t\t\t\t<h4 className=\"text-xl font-semibold tracking-tight\">\n\t\t\t\t\t{blockType.name}\n\t\t\t\t</h4>\n\t\t\t</div>\n\n\t\t\t{blockType.description && (\n\t\t\t\t<div className=\"prose max-w-none overflow-y-scroll text-sm\">\n\t\t\t\t\t<LazyMarkdown>{blockType.description}</LazyMarkdown>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n"],"names":["BlockTypeDetails","blockType","jsxs","Card","jsx","BlockTypeLogo","LazyMarkdown"],"mappings":"4LASO,SAASA,EAAiB,CAAE,UAAAC,GAAoC,CACtE,OACCC,EAAAA,KAACC,EAAA,CAAK,UAAU,eACf,SAAA,CAAAD,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAE,EAAAA,IAACC,EAAA,CAAc,KAAK,KAAK,QAASJ,EAAU,SAAU,EACtDG,EAAAA,IAAC,KAAA,CAAG,UAAU,uCACZ,WAAU,IAAA,CACZ,CAAA,EACD,EAECH,EAAU,aACVG,EAAAA,IAAC,MAAA,CAAI,UAAU,6CACd,SAAAA,EAAAA,IAACE,EAAA,CAAc,SAAAL,EAAU,WAAA,CAAY,CAAA,CACtC,CAAA,EAEF,CAEF"}
@@ -0,0 +1,2 @@
1
+ import{j as e}from"./vendor-tanstack-BdLtprmr.js";import{cD as a}from"./index-CPpeVt8m.js";const c=({alt:o,logoUrl:s,size:r="sm"})=>e.jsx("img",{alt:o,src:s??void 0,className:i({size:r})}),i=a("border border-border bg-muted rounded",{variants:{size:{sm:"size-8",lg:"size-14"}}});export{c as B};
2
+ //# sourceMappingURL=block-type-logo-scnMsyY5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-type-logo-DuvU7goV.js","sources":["../../src/components/block-type-logo/block-type-logo.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { BlockType } from \"@/api/block-types\";\n\ntype BlockTypeLogoProps = {\n\talt?: string;\n\tlogoUrl: BlockType[\"logo_url\"];\n\tsize?: \"sm\" | \"lg\";\n};\n\nexport const BlockTypeLogo = ({\n\talt,\n\tlogoUrl,\n\tsize = \"sm\",\n}: BlockTypeLogoProps) => (\n\t<img\n\t\talt={alt}\n\t\tsrc={logoUrl ?? undefined}\n\t\tclassName={blockTypeLogoVariant({ size })}\n\t/>\n);\n\nconst blockTypeLogoVariant = cva(\"border border-border bg-muted rounded\", {\n\tvariants: {\n\t\tsize: {\n\t\t\tsm: \"size-8\",\n\t\t\tlg: \"size-14\",\n\t\t},\n\t},\n});\n"],"names":["BlockTypeLogo","alt","logoUrl","size","jsx","blockTypeLogoVariant","cva"],"mappings":"2FASO,MAAMA,EAAgB,CAAC,CAC7B,IAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,IACR,IACCC,EAAAA,IAAC,MAAA,CACA,IAAAH,EACA,IAAKC,GAAW,OAChB,UAAWG,EAAqB,CAAE,KAAAF,CAAA,CAAM,CAAA,CACzC,EAGKE,EAAuBC,EAAI,wCAAyC,CACzE,SAAU,CACT,KAAM,CACL,GAAI,SACJ,GAAI,SAAA,CACL,CAEF,CAAC"}
1
+ {"version":3,"file":"block-type-logo-scnMsyY5.js","sources":["../../src/components/block-type-logo/block-type-logo.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { BlockType } from \"@/api/block-types\";\n\ntype BlockTypeLogoProps = {\n\talt?: string;\n\tlogoUrl: BlockType[\"logo_url\"];\n\tsize?: \"sm\" | \"lg\";\n};\n\nexport const BlockTypeLogo = ({\n\talt,\n\tlogoUrl,\n\tsize = \"sm\",\n}: BlockTypeLogoProps) => (\n\t<img\n\t\talt={alt}\n\t\tsrc={logoUrl ?? undefined}\n\t\tclassName={blockTypeLogoVariant({ size })}\n\t/>\n);\n\nconst blockTypeLogoVariant = cva(\"border border-border bg-muted rounded\", {\n\tvariants: {\n\t\tsize: {\n\t\t\tsm: \"size-8\",\n\t\t\tlg: \"size-14\",\n\t\t},\n\t},\n});\n"],"names":["BlockTypeLogo","alt","logoUrl","size","jsx","blockTypeLogoVariant","cva"],"mappings":"2FASO,MAAMA,EAAgB,CAAC,CAC7B,IAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,IACR,IACCC,EAAAA,IAAC,MAAA,CACA,IAAAH,EACA,IAAKC,GAAW,OAChB,UAAWG,EAAqB,CAAE,KAAAF,CAAA,CAAM,CAAA,CACzC,EAGKE,EAAuBC,EAAI,wCAAyC,CACzE,SAAU,CACT,KAAM,CACL,GAAI,SACJ,GAAI,SAAA,CACL,CAEF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{j as e,r as n,s as m}from"./vendor-tanstack-BdLtprmr.js";import{B as d,g as x,h as c,bv as p,bE as u,C as h,bD as f,dw as j,d8 as N}from"./index-CPpeVt8m.js";import{u as B,B as g}from"./use-delete-block-document-confirmation-dialog-CxRkBKPg.js";import{B as b}from"./block-type-details-tAkUWqs1.js";import{D as k}from"./delete-confirmation-dialog-BZg9EOfN.js";import{P as D}from"./python-example-snippet-d8bTNJ0J.js";import{c as _}from"./vendor-recharts-CY3PKigC.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";import"./dropdown-menu-fRiq5bS-.js";import"./use-delete-confirmation-dialog-CkL-rSsp.js";import"./block-type-logo-scnMsyY5.js";import"./lazy-markdown-D_y73qoD.js";const y=({blockName:s})=>e.jsx(d,{children:e.jsxs(x,{children:[e.jsx(c,{children:e.jsx(p,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),e.jsx(u,{}),e.jsx(c,{className:"text-xl font-semibold",children:s})]})});function v({data:s,fields:a}){const r=n.useMemo(()=>{let l={};return"properties"in a&&(l=a.properties),Object.keys(l).map(t=>{let o=t;const i=l[t];return i.title&&(o=i.title),{label:o,value:s[t]?JSON.stringify(s[t],null,2):null}})},[s,a]);return e.jsx("dl",{className:"flex flex-col gap-2 p-2 text-xs",children:r.map(({label:l,value:t})=>e.jsxs(n.Fragment,{children:[e.jsx("dt",{className:"text-gray-500 text-sm",children:l}),e.jsx("dd",{className:_("text-base",!t&&"text-gray-500 "),children:t??"None"})]},l))})}const C=({blockDocument:s})=>{const[a,r]=B(),l=()=>r(s,{shouldNavigate:!0}),{block_type:t}=s,o=s.name??s.block_type_name??"Block Document";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(y,{blockName:o}),e.jsx(g,{blockDocument:s,onDelete:l})]}),e.jsx(h,{className:"p-4",children:e.jsxs("div",{className:"grid grid-cols-[minmax(0,_1fr)_250px] gap-4 ",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[(t?.code_example||t?.documentation_url)&&e.jsx(S,{hasCodeExample:!!t?.code_example,hasDocumentationUrl:!!t?.documentation_url}),t?.code_example&&e.jsx(D,{codeExample:t.code_example,name:s.name}),s.data&&s.block_schema?.fields&&e.jsx(v,{data:s.data,fields:s.block_schema?.fields})]}),t&&e.jsx(b,{blockType:t})]})})]}),e.jsx(k,{...a})]})};function S({hasCodeExample:s,hasDocumentationUrl:a}){return e.jsxs("div",{className:"flex items-center gap-1",children:[s&&e.jsxs("p",{className:"text-sm muted",children:["Paste this snippet"," ",e.jsx("span",{className:"font-semibold",children:"into your flows"})," to use this block."]}),a&&e.jsxs("p",{className:"text-sm muted",children:["Need help?"," ",e.jsx("a",{className:"underline text-blue-600 hover:text-blue-800 visited:text-purple-600",href:f["blocks-guide"],children:"View Docs"})]})]})}function J(){const{id:s}=j.useParams(),{data:a}=m(N(s));return e.jsx(C,{blockDocument:a})}export{J as component};
2
+ //# sourceMappingURL=block._id-BY42cyjR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block._id-BY42cyjR.js","sources":["../../src/components/blocks/block-document-details-page/block-document-details-page-header.tsx","../../src/components/blocks/block-document-details-page/block-document-schema-properties.tsx","../../src/components/blocks/block-document-details-page/block-document-details-page.tsx","../../src/routes/blocks/block.$id.tsx?tsr-split=component"],"sourcesContent":["import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\n\ntype BlockDocumentDetailsPageHeaderProps = {\n\tblockName: string;\n};\n\nexport const BlockDocumentDetailsPageHeader = ({\n\tblockName,\n}: BlockDocumentDetailsPageHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/blocks\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tBlocks\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t{blockName}\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import clsx from \"clsx\";\nimport { Fragment, useMemo } from \"react\";\n\ntype BlockDocumentSchemaProperties = {\n\tdata: { [key: string]: unknown };\n\tfields: { [key: string]: unknown };\n};\nexport function BlockDocumentSchemaProperties({\n\tdata,\n\tfields,\n}: BlockDocumentSchemaProperties) {\n\tconst fieldValues = useMemo(() => {\n\t\tlet properties: { [key: string]: unknown } = {};\n\t\tif (\"properties\" in fields) {\n\t\t\tproperties = fields.properties as { [key: string]: unknown };\n\t\t}\n\n\t\treturn Object.keys(properties).map((property) => {\n\t\t\tlet label = property;\n\t\t\t// nb: expect this type from Prefect Schema\n\t\t\tconst field = properties[property] as {\n\t\t\t\t[key: string]: unknown;\n\t\t\t\ttitle: string;\n\t\t\t};\n\t\t\tif (field.title) {\n\t\t\t\tlabel = field.title;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tvalue: data[property] ? JSON.stringify(data[property], null, 2) : null,\n\t\t\t};\n\t\t});\n\t}, [data, fields]);\n\n\treturn (\n\t\t<dl className=\"flex flex-col gap-2 p-2 text-xs\">\n\t\t\t{fieldValues.map(({ label, value }) => (\n\t\t\t\t<Fragment key={label}>\n\t\t\t\t\t<dt className=\"text-gray-500 text-sm\">{label}</dt>\n\t\t\t\t\t<dd className={clsx(\"text-base\", !value && \"text-gray-500 \")}>\n\t\t\t\t\t\t{value ?? \"None\"}\n\t\t\t\t\t</dd>\n\t\t\t\t</Fragment>\n\t\t\t))}\n\t\t</dl>\n\t);\n}\n","import type { BlockDocument } from \"@/api/block-documents\";\nimport { BlockDocumentActionMenu } from \"@/components/blocks/block-document-action-menu\";\nimport { BlockTypeDetails } from \"@/components/blocks/block-type-details\";\nimport { Card } from \"@/components/ui/card\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\nimport { DOCS_LINKS } from \"@/components/ui/docs-link\";\nimport { PythonBlockSnippet } from \"../python-example-snippet\";\nimport { useDeleteBlockDocumentConfirmationDialog } from \"../use-delete-block-document-confirmation-dialog\";\nimport { BlockDocumentDetailsPageHeader } from \"./block-document-details-page-header\";\nimport { BlockDocumentSchemaProperties } from \"./block-document-schema-properties\";\n\ntype BlockDocumentDetailsPageProps = {\n\tblockDocument: BlockDocument;\n};\n\nexport const BlockDocumentDetailsPage = ({\n\tblockDocument,\n}: BlockDocumentDetailsPageProps) => {\n\tconst [dialogState, handleConfirmDelete] =\n\t\tuseDeleteBlockDocumentConfirmationDialog();\n\n\tconst handleDeleteBlock = () =>\n\t\thandleConfirmDelete(blockDocument, { shouldNavigate: true });\n\n\tconst { block_type } = blockDocument;\n\n\tconst blockName =\n\t\tblockDocument.name ?? blockDocument.block_type_name ?? \"Block Document\";\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t\t<BlockDocumentDetailsPageHeader blockName={blockName} />\n\t\t\t\t\t<BlockDocumentActionMenu\n\t\t\t\t\t\tblockDocument={blockDocument}\n\t\t\t\t\t\tonDelete={handleDeleteBlock}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<Card className=\"p-4\">\n\t\t\t\t\t<div className=\"grid grid-cols-[minmax(0,_1fr)_250px] gap-4 \">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t\t\t\t{(block_type?.code_example || block_type?.documentation_url) && (\n\t\t\t\t\t\t\t\t<NeedHelpDocsLink\n\t\t\t\t\t\t\t\t\thasCodeExample={Boolean(block_type?.code_example)}\n\t\t\t\t\t\t\t\t\thasDocumentationUrl={Boolean(block_type?.documentation_url)}\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{block_type?.code_example && (\n\t\t\t\t\t\t\t\t<PythonBlockSnippet\n\t\t\t\t\t\t\t\t\tcodeExample={block_type.code_example}\n\t\t\t\t\t\t\t\t\tname={blockDocument.name}\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{blockDocument.data && blockDocument.block_schema?.fields && (\n\t\t\t\t\t\t\t\t<BlockDocumentSchemaProperties\n\t\t\t\t\t\t\t\t\tdata={blockDocument.data}\n\t\t\t\t\t\t\t\t\tfields={blockDocument.block_schema?.fields}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{block_type && <BlockTypeDetails blockType={block_type} />}\n\t\t\t\t\t</div>\n\t\t\t\t</Card>\n\t\t\t</div>\n\t\t\t<DeleteConfirmationDialog {...dialogState} />\n\t\t</>\n\t);\n};\n\ntype NeedHelpDocsLinkProps = {\n\thasCodeExample: boolean;\n\thasDocumentationUrl: boolean;\n};\nfunction NeedHelpDocsLink({\n\thasCodeExample,\n\thasDocumentationUrl,\n}: NeedHelpDocsLinkProps) {\n\treturn (\n\t\t<div className=\"flex items-center gap-1\">\n\t\t\t{hasCodeExample && (\n\t\t\t\t<p className=\"text-sm muted\">\n\t\t\t\t\tPaste this snippet{\" \"}\n\t\t\t\t\t<span className=\"font-semibold\">into your flows</span> to use this\n\t\t\t\t\tblock.\n\t\t\t\t</p>\n\t\t\t)}\n\t\t\t{hasDocumentationUrl && (\n\t\t\t\t<p className=\"text-sm muted\">\n\t\t\t\t\tNeed help?{\" \"}\n\t\t\t\t\t<a\n\t\t\t\t\t\tclassName=\"underline text-blue-600 hover:text-blue-800 visited:text-purple-600\"\n\t\t\t\t\t\thref={DOCS_LINKS[\"blocks-guide\"]}\n\t\t\t\t\t>\n\t\t\t\t\t\tView Docs\n\t\t\t\t\t</a>\n\t\t\t\t</p>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildGetBlockDocumentQuery } from \"@/api/block-documents\";\nimport { BlockDocumentDetailsPage } from \"@/components/blocks/block-document-details-page/block-document-details-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nexport const Route = createFileRoute(\"/blocks/block/$id\")({\n\tcomponent: RouteComponent,\n\tloader: ({ params, context: { queryClient } }) =>\n\t\tqueryClient.ensureQueryData(buildGetBlockDocumentQuery(params.id)),\n\twrapInSuspense: true,\n\tpendingComponent: PrefectLoading,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\tconst { data } = useSuspenseQuery(buildGetBlockDocumentQuery(id));\n\treturn <BlockDocumentDetailsPage blockDocument={data} />;\n}\n"],"names":["BlockDocumentDetailsPageHeader","blockName","jsx","Breadcrumb","jsxs","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BlockDocumentSchemaProperties","data","fields","fieldValues","useMemo","properties","property","label","field","value","Fragment","clsx","BlockDocumentDetailsPage","blockDocument","dialogState","handleConfirmDelete","useDeleteBlockDocumentConfirmationDialog","handleDeleteBlock","block_type","BlockDocumentActionMenu","Card","NeedHelpDocsLink","PythonBlockSnippet","BlockTypeDetails","DeleteConfirmationDialog","hasCodeExample","hasDocumentationUrl","DOCS_LINKS","RouteComponent","id","Route","useParams","useSuspenseQuery","buildGetBlockDocumentQuery"],"mappings":"uwBAYO,MAAMA,EAAiC,CAAC,CAC9C,UAAAC,CACD,IAEEC,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,UAAU,UAAU,wBAAwB,kBAE/D,CAAA,CACD,QACCC,EAAA,EAAoB,EAErBN,EAAAA,IAACI,EAAA,CAAe,UAAU,wBACxB,SAAAL,CAAA,CACF,CAAA,CAAA,CACD,CAAA,CACD,ECtBK,SAASQ,EAA8B,CAC7C,KAAAC,EACA,OAAAC,CACD,EAAkC,CACjC,MAAMC,EAAcC,EAAAA,QAAQ,IAAM,CACjC,IAAIC,EAAyC,CAAA,EAC7C,MAAI,eAAgBH,IACnBG,EAAaH,EAAO,YAGd,OAAO,KAAKG,CAAU,EAAE,IAAKC,GAAa,CAChD,IAAIC,EAAQD,EAEZ,MAAME,EAAQH,EAAWC,CAAQ,EAIjC,OAAIE,EAAM,QACTD,EAAQC,EAAM,OAGR,CACN,MAAAD,EACA,MAAON,EAAKK,CAAQ,EAAI,KAAK,UAAUL,EAAKK,CAAQ,EAAG,KAAM,CAAC,EAAI,IAAA,CAEpE,CAAC,CACF,EAAG,CAACL,EAAMC,CAAM,CAAC,EAEjB,OACCT,EAAAA,IAAC,KAAA,CAAG,UAAU,kCACZ,SAAAU,EAAY,IAAI,CAAC,CAAE,MAAAI,EAAO,MAAAE,CAAA,IAC1Bd,EAAAA,KAACe,EAAAA,SAAA,CACA,SAAA,CAAAjB,EAAAA,IAAC,KAAA,CAAG,UAAU,wBAAyB,SAAAc,EAAM,EAC7Cd,EAAAA,IAAC,KAAA,CAAG,UAAWkB,EAAK,YAAa,C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,CACzB,eAAAI,EACA,oBAAAC,CACD,EAA0B,CACzB,OACC/B,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACb,SAAA,CAAA8B,GACA9B,EAAAA,KAAC,IAAA,CAAE,UAAU,gBAAgB,SAAA,CAAA,qBACT,IACnBF,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAgB,SAAA,kBAAe,EAAO,qBAAA,EAEvD,EAEAiC,GACA/B,EAAAA,KAAC,IAAA,CAAE,UAAU,gBAAgB,SAAA,CAAA,aACjB,IACXF,EAAAA,IAAC,IAAA,CACA,UAAU,sEACV,KAAMkC,EAAW,cAAc,EAC/B,SAAA,WAAA,CAAA,CAED,CAAA,CACD,CAAA,EAEF,CAEF,CCtFA,SAASC,GAAiB,CACzB,KAAM,CAAEC,GAAAA,CAAAA,EAAOC,EAAMC,UAAAA,EACf,CAAE9B,KAAAA,CAAAA,EAAS+B,EAAiBC,EAA2BJ,CAAE,CAAC,EAChE,OAAOpC,EAAAA,IAACmB,EAAA,CAAyB,cAAeX,CAAAA,CAAK,CACtD"}
@@ -1,2 +1,2 @@
1
- import{j as s,d as g,r as b,L as B,s as k}from"./vendor-tanstack-BdLtprmr.js";import{B as y,g as v,h as c,bw as l,bF as m,bH as S,dR as _,C as N,q as p,y as n,dS as E,d9 as w}from"./index-V_xTKaEb.js";import{B as L}from"./block-type-details-Bcb9qEO8.js";import{u as C,L as P}from"./schema-form-input-string-format-datetime-Cb4sTJle.js";import"./toggle-group-CBJphTE6.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";import"./block-type-logo-DuvU7goV.js";import"./lazy-markdown-B9vEkJ0h.js";import"./zod-B1GLD-Zc.js";import"./use-debounce-callback-Dk7Ebi48.js";import"./timezone-select-DPtR_b06.js";import"./dropdown-menu-B9LKPlz7.js";import"./form-DOdmIC3A.js";const F=({blockDocument:e})=>s.jsx(y,{children:s.jsxs(v,{children:[s.jsx(c,{children:s.jsx(l,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),s.jsx(m,{}),s.jsx(c,{children:s.jsx(l,{to:"/blocks/block/$id",params:{id:e.id},className:"text-xl font-semibold",children:e.name??e.block_type_name??e.id})}),s.jsx(m,{}),s.jsx(c,{className:"text-xl font-semibold",children:s.jsx(S,{children:"Edit"})})]})}),R=({blockDocument:e})=>{const r=g(),{values:t,setValues:o,errors:x,validateForm:u}=C(),{updateBlockDocument:h,isPending:j}=_();b.useEffect(()=>{e.data&&o(e.data)},[e.data,o]);const f=async i=>{i.preventDefault();try{await u({schema:t}),h({id:e.id,data:t,merge_existing_data:!1},{onSuccess:()=>{n.success("Block updated successfully"),r({to:"/blocks/block/$id",params:{id:e.id}})},onError:d=>{const a="Unknown error while updating block.";n.error(a),console.error(a,d)}})}catch(d){const a="Unknown error while validating block data.";n.error(a),console.error(a,d)}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(F,{blockDocument:e}),s.jsxs(N,{className:" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 ",children:[s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:i=>{f(i)},children:[s.jsx(P,{values:t,onValuesChange:o,errors:x,kinds:["json"],schema:e?.block_schema?.fields??{}}),s.jsxs("div",{className:"flex gap-3 justify-end",children:[s.jsx(p,{variant:"secondary",children:s.jsx(B,{to:"/blocks/block/$id",params:{id:e.id},children:"Cancel"})}),s.jsx(p,{loading:j,type:"submit",children:"Save"})]})]}),e.block_type&&s.jsx(L,{blockType:e.block_type})]})]})};function Y(){const{id:e}=E.useParams(),{data:r}=k(w(e));return s.jsx(R,{blockDocument:r})}export{Y as component};
2
- //# sourceMappingURL=block_._id.edit-C4SmoQ4y.js.map
1
+ import{j as s,d as g,r as b,L as B,s as k}from"./vendor-tanstack-BdLtprmr.js";import{B as y,g as v,h as c,bv as l,bE as m,bG as _,dQ as E,C as N,q as p,y as n,dR as S,d8 as L}from"./index-CPpeVt8m.js";import{B as w}from"./block-type-details-tAkUWqs1.js";import{u as C,L as P}from"./schema-form-input-string-format-datetime-Dg3zVAp5.js";import"./toggle-group-EMgSOoYH.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";import"./block-type-logo-scnMsyY5.js";import"./lazy-markdown-D_y73qoD.js";import"./zod-B1GLD-Zc.js";import"./use-debounce-callback-Dk7Ebi48.js";import"./timezone-select-NViFNNLz.js";import"./dropdown-menu-fRiq5bS-.js";import"./form-Cl5Hk9bq.js";const R=({blockDocument:e})=>s.jsx(y,{children:s.jsxs(v,{children:[s.jsx(c,{children:s.jsx(l,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),s.jsx(m,{}),s.jsx(c,{children:s.jsx(l,{to:"/blocks/block/$id",params:{id:e.id},className:"text-xl font-semibold",children:e.name??e.block_type_name??e.id})}),s.jsx(m,{}),s.jsx(c,{className:"text-xl font-semibold",children:s.jsx(_,{children:"Edit"})})]})}),F=({blockDocument:e})=>{const r=g(),{values:t,setValues:o,errors:x,validateForm:u}=C(),{updateBlockDocument:h,isPending:j}=E();b.useEffect(()=>{e.data&&o(e.data)},[e.data,o]);const f=async i=>{i.preventDefault();try{await u({schema:t}),h({id:e.id,data:t,merge_existing_data:!1},{onSuccess:()=>{n.success("Block updated successfully"),r({to:"/blocks/block/$id",params:{id:e.id}})},onError:d=>{const a="Unknown error while updating block.";n.error(a),console.error(a,d)}})}catch(d){const a="Unknown error while validating block data.";n.error(a),console.error(a,d)}};return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(R,{blockDocument:e}),s.jsxs(N,{className:" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 ",children:[s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:i=>{f(i)},children:[s.jsx(P,{values:t,onValuesChange:o,errors:x,kinds:["json"],schema:e?.block_schema?.fields??{}}),s.jsxs("div",{className:"flex gap-3 justify-end",children:[s.jsx(p,{variant:"secondary",children:s.jsx(B,{to:"/blocks/block/$id",params:{id:e.id},children:"Cancel"})}),s.jsx(p,{loading:j,type:"submit",children:"Save"})]})]}),e.block_type&&s.jsx(w,{blockType:e.block_type})]})]})};function Y(){const{id:e}=S.useParams(),{data:r}=k(L(e));return s.jsx(F,{blockDocument:r})}export{Y as component};
2
+ //# sourceMappingURL=block_._id.edit-n2jwU5yr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"block_._id.edit-C4SmoQ4y.js","sources":["../../src/components/blocks/block-document-edit-page/block-document-edit-page-header.tsx","../../src/components/blocks/block-document-edit-page/block-document-edit-page.tsx","../../src/routes/blocks/block_.$id.edit.tsx?tsr-split=component"],"sourcesContent":["import type { BlockDocument } from \"@/api/block-documents\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\n\ntype BlockDocumentEditPageHeaderProps = {\n\tblockDocument: BlockDocument;\n};\n\nexport const BlockDocumentEditPageHeader = ({\n\tblockDocument,\n}: BlockDocumentEditPageHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/blocks\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tBlocks\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{blockDocument.name ??\n\t\t\t\t\t\t\tblockDocument.block_type_name ??\n\t\t\t\t\t\t\tblockDocument.id}\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>Edit</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import { Link, useNavigate } from \"@tanstack/react-router\";\nimport { type FormEvent, useEffect } from \"react\";\nimport { toast } from \"sonner\";\nimport {\n\ttype BlockDocument,\n\tuseUpdateBlockDocument,\n} from \"@/api/block-documents\";\nimport { BlockTypeDetails } from \"@/components/blocks/block-type-details\";\nimport {\n\tLazySchemaForm,\n\ttype PrefectSchemaObject,\n\tuseSchemaForm,\n} from \"@/components/schemas\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport { BlockDocumentEditPageHeader } from \"./block-document-edit-page-header\";\n\ntype BlockDocumentEditPageProps = {\n\tblockDocument: BlockDocument;\n};\n\nexport const BlockDocumentEditPage = ({\n\tblockDocument,\n}: BlockDocumentEditPageProps) => {\n\tconst navigate = useNavigate();\n\tconst { values, setValues, errors, validateForm } = useSchemaForm();\n\tconst { updateBlockDocument, isPending } = useUpdateBlockDocument();\n\n\t// sync up values with block document values\n\tuseEffect(() => {\n\t\tif (blockDocument.data) {\n\t\t\tsetValues(blockDocument.data);\n\t\t}\n\t}, [blockDocument.data, setValues]);\n\n\tconst handleSubmit = async (event: FormEvent) => {\n\t\tevent.preventDefault();\n\t\ttry {\n\t\t\tawait validateForm({ schema: values });\n\t\t\tupdateBlockDocument(\n\t\t\t\t{\n\t\t\t\t\tid: blockDocument.id,\n\t\t\t\t\tdata: values,\n\t\t\t\t\tmerge_existing_data: false,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Block updated successfully\");\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/blocks/block/$id\",\n\t\t\t\t\t\t\tparams: { id: blockDocument.id },\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\tonError: (err) => {\n\t\t\t\t\t\tconst message = \"Unknown error while updating block.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message, err);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tconst message = \"Unknown error while validating block data.\";\n\t\t\ttoast.error(message);\n\t\t\tconsole.error(message, err);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<BlockDocumentEditPageHeader blockDocument={blockDocument} />\n\t\t\t<Card className=\" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 \">\n\t\t\t\t<form\n\t\t\t\t\tclassName=\"flex flex-col gap-4\"\n\t\t\t\t\tonSubmit={(e) => void handleSubmit(e)}\n\t\t\t\t>\n\t\t\t\t\t<LazySchemaForm\n\t\t\t\t\t\tvalues={values}\n\t\t\t\t\t\tonValuesChange={setValues}\n\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\tkinds={[\"json\"]}\n\t\t\t\t\t\tschema={\n\t\t\t\t\t\t\t(blockDocument?.block_schema?.fields ??\n\t\t\t\t\t\t\t\t{}) as unknown as PrefectSchemaObject\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"flex gap-3 justify-end\">\n\t\t\t\t\t\t<Button variant=\"secondary\">\n\t\t\t\t\t\t\t<Link to=\"/blocks/block/$id\" params={{ id: blockDocument.id }}>\n\t\t\t\t\t\t\t\tCancel\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button loading={isPending} type=\"submit\">\n\t\t\t\t\t\t\tSave\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\n\t\t\t\t{blockDocument.block_type && (\n\t\t\t\t\t<BlockTypeDetails blockType={blockDocument.block_type} />\n\t\t\t\t)}\n\t\t\t</Card>\n\t\t</div>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildGetBlockDocumentQuery } from \"@/api/block-documents\";\nimport { BlockDocumentEditPage } from \"@/components/blocks/block-document-edit-page\";\n\nexport const Route = createFileRoute(\"/blocks/block_/$id/edit\")({\n\tcomponent: RouteComponent,\n\tloader: ({ params, context: { queryClient } }) =>\n\t\tqueryClient.ensureQueryData(buildGetBlockDocumentQuery(params.id)),\n\twrapInSuspense: true,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\tconst { data } = useSuspenseQuery(buildGetBlockDocumentQuery(id));\n\treturn <BlockDocumentEditPage blockDocument={data} />;\n}\n"],"names":["BlockDocumentEditPageHeader","blockDocument","jsx","Breadcrumb","jsxs","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","BlockDocumentEditPage","navigate","useNavigate","values","setValues","errors","validateForm","useSchemaForm","updateBlockDocument","isPending","useUpdateBlockDocument","useEffect","handleSubmit","event","toast","err","message","Card","e","LazySchemaForm","Button","Link","BlockTypeDetails","RouteComponent","id","Route","useParams","data","useSuspenseQuery","buildGetBlockDocumentQuery"],"mappings":"yxBAcO,MAAMA,EAA8B,CAAC,CAC3C,cAAAC,CACD,IAEEC,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,UAAU,UAAU,wBAAwB,kBAE/D,CAAA,CACD,QACCC,EAAA,EAAoB,QAEpBF,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CACA,GAAG,oBACH,OAAQ,CAAE,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AAA,KAAC,OAAA,CACA,UAAU,sBACV,SAAWwB,IAAWN,EAAaM,CAAC,GAEpC,SAAA,CAAA1B,EAAAA,IAAC2B,EAAA,CACA,OAAAhB,EACA,eAAgBC,EAChB,OAAAC,EACA,MAAO,CAAC,MAAM,EACd,OACEd,GAAe,cAAc,QAC7B,CAAA,CAAC,CAAA,EAGJG,EAAAA,KAAC,MAAA,CAAI,UAAU,yBACd,SAAA,CAAAF,MAAC4B,EAAA,CAAO,QAAQ,YACf,SAAA5B,EAAAA,IAAC6B,GAAK,GAAG,oBAAoB,OAAQ,CAAE,GAAI9B,EAAc,EAAA,EAAM,kBAE/D,EACD,QACC6B,EAAA,CAAO,QAASX,EAAW,KAAK,SAAS,SAAA,MAAA,CAE1C,CAAA,CAAA,CACD,CAAA,CAAA,CAAA,EAGAlB,EAAc,YACdC,MAAC8B,EAAA,CAAiB,UAAW/B,EAAc,UAAA,CAAY,CAAA,CAAA,CAEzD,CAAA,EACD,CAEF,EC3FA,SAASgC,GAAiB,CACzB,KAAM,CAAEC,GAAAA,CAAAA,EAAOC,EAAMC,UAAAA,EACf,CAAEC,KAAAA,CAAAA,EAASC,EAAiBC,EAA2BL,CAAE,CAAC,EAChE,OAAOhC,EAAAA,IAACQ,EAAA,CAAsB,cAAe2B,CAAAA,CAAK,CACnD"}
1
+ {"version":3,"file":"block_._id.edit-n2jwU5yr.js","sources":["../../src/components/blocks/block-document-edit-page/block-document-edit-page-header.tsx","../../src/components/blocks/block-document-edit-page/block-document-edit-page.tsx","../../src/routes/blocks/block_.$id.edit.tsx?tsr-split=component"],"sourcesContent":["import type { BlockDocument } from \"@/api/block-documents\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\n\ntype BlockDocumentEditPageHeaderProps = {\n\tblockDocument: BlockDocument;\n};\n\nexport const BlockDocumentEditPageHeader = ({\n\tblockDocument,\n}: BlockDocumentEditPageHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/blocks\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tBlocks\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{blockDocument.name ??\n\t\t\t\t\t\t\tblockDocument.block_type_name ??\n\t\t\t\t\t\t\tblockDocument.id}\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>Edit</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import { Link, useNavigate } from \"@tanstack/react-router\";\nimport { type FormEvent, useEffect } from \"react\";\nimport { toast } from \"sonner\";\nimport {\n\ttype BlockDocument,\n\tuseUpdateBlockDocument,\n} from \"@/api/block-documents\";\nimport { BlockTypeDetails } from \"@/components/blocks/block-type-details\";\nimport {\n\tLazySchemaForm,\n\ttype PrefectSchemaObject,\n\tuseSchemaForm,\n} from \"@/components/schemas\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport { BlockDocumentEditPageHeader } from \"./block-document-edit-page-header\";\n\ntype BlockDocumentEditPageProps = {\n\tblockDocument: BlockDocument;\n};\n\nexport const BlockDocumentEditPage = ({\n\tblockDocument,\n}: BlockDocumentEditPageProps) => {\n\tconst navigate = useNavigate();\n\tconst { values, setValues, errors, validateForm } = useSchemaForm();\n\tconst { updateBlockDocument, isPending } = useUpdateBlockDocument();\n\n\t// sync up values with block document values\n\tuseEffect(() => {\n\t\tif (blockDocument.data) {\n\t\t\tsetValues(blockDocument.data);\n\t\t}\n\t}, [blockDocument.data, setValues]);\n\n\tconst handleSubmit = async (event: FormEvent) => {\n\t\tevent.preventDefault();\n\t\ttry {\n\t\t\tawait validateForm({ schema: values });\n\t\t\tupdateBlockDocument(\n\t\t\t\t{\n\t\t\t\t\tid: blockDocument.id,\n\t\t\t\t\tdata: values,\n\t\t\t\t\tmerge_existing_data: false,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Block updated successfully\");\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/blocks/block/$id\",\n\t\t\t\t\t\t\tparams: { id: blockDocument.id },\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\tonError: (err) => {\n\t\t\t\t\t\tconst message = \"Unknown error while updating block.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message, err);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tconst message = \"Unknown error while validating block data.\";\n\t\t\ttoast.error(message);\n\t\t\tconsole.error(message, err);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<BlockDocumentEditPageHeader blockDocument={blockDocument} />\n\t\t\t<Card className=\" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 \">\n\t\t\t\t<form\n\t\t\t\t\tclassName=\"flex flex-col gap-4\"\n\t\t\t\t\tonSubmit={(e) => void handleSubmit(e)}\n\t\t\t\t>\n\t\t\t\t\t<LazySchemaForm\n\t\t\t\t\t\tvalues={values}\n\t\t\t\t\t\tonValuesChange={setValues}\n\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\tkinds={[\"json\"]}\n\t\t\t\t\t\tschema={\n\t\t\t\t\t\t\t(blockDocument?.block_schema?.fields ??\n\t\t\t\t\t\t\t\t{}) as unknown as PrefectSchemaObject\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"flex gap-3 justify-end\">\n\t\t\t\t\t\t<Button variant=\"secondary\">\n\t\t\t\t\t\t\t<Link to=\"/blocks/block/$id\" params={{ id: blockDocument.id }}>\n\t\t\t\t\t\t\t\tCancel\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button loading={isPending} type=\"submit\">\n\t\t\t\t\t\t\tSave\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\n\t\t\t\t{blockDocument.block_type && (\n\t\t\t\t\t<BlockTypeDetails blockType={blockDocument.block_type} />\n\t\t\t\t)}\n\t\t\t</Card>\n\t\t</div>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildGetBlockDocumentQuery } from \"@/api/block-documents\";\nimport { BlockDocumentEditPage } from \"@/components/blocks/block-document-edit-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nexport const Route = createFileRoute(\"/blocks/block_/$id/edit\")({\n\tcomponent: RouteComponent,\n\tloader: ({ params, context: { queryClient } }) =>\n\t\tqueryClient.ensureQueryData(buildGetBlockDocumentQuery(params.id)),\n\twrapInSuspense: true,\n\tpendingComponent: PrefectLoading,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\tconst { data } = useSuspenseQuery(buildGetBlockDocumentQuery(id));\n\treturn <BlockDocumentEditPage blockDocument={data} />;\n}\n"],"names":["BlockDocumentEditPageHeader","blockDocument","jsx","Breadcrumb","jsxs","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","BlockDocumentEditPage","navigate","useNavigate","values","setValues","errors","validateForm","useSchemaForm","updateBlockDocument","isPending","useUpdateBlockDocument","useEffect","handleSubmit","event","toast","err","message","Card","e","LazySchemaForm","Button","Link","BlockTypeDetails","RouteComponent","id","Route","useParams","data","useSuspenseQuery","buildGetBlockDocumentQuery"],"mappings":"yxBAcO,MAAMA,EAA8B,CAAC,CAC3C,cAAAC,CACD,IAEEC,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,UAAU,UAAU,wBAAwB,kBAE/D,CAAA,CACD,QACCC,EAAA,EAAoB,QAEpBF,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CACA,GAAG,oBACH,OAAQ,CAAE,GAAIN,EAAc,EAAA,EAC5B,UAAU,wBAET,SAAAA,EAAc,MACdA,EAAc,iBACdA,EAAc,EAAA,CAAA,EAEjB,QACCO,EAAA,EAAoB,QAEpBF,EAAA,CAAe,UAAU,wBACzB,SAAAJ,EAAAA,IAACO,EAAA,CAAe,gBAAI,CAAA,CACrB,CAAA,CAAA,CACD,CAAA,CACD,ECvBWC,EAAwB,CAAC,CACrC,cAAAT,CACD,IAAkC,CACjC,MAAMU,EAAWC,EAAA,EACX,CAAE,OAAAC,EAAQ,UAAAC,EAAW,OAAAC,EAAQ,aAAAC,CAAA,EAAiBC,EAAA,EAC9C,CAAE,oBAAAC,EAAqB,UAAAC,CAAA,EAAcC,EAAA,EAG3CC,EAAAA,UAAU,IAAM,CACXpB,EAAc,MACjBa,EAAUb,EAAc,IAAI,CAE9B,EAAG,CAACA,EAAc,KAAMa,CAAS,CAAC,EAElC,MAAMQ,EAAe,MAAOC,GAAqB,CAChDA,EAAM,eAAA,EACN,GAAI,CACH,MAAMP,EAAa,CAAE,OAAQH,EAAQ,EACrCK,EACC,CACC,GAAIjB,EAAc,GAClB,KAAMY,EACN,oBAAqB,EAA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EAAiBC,EAA2BL,CAAE,CAAC,EAChE,OAAOhC,EAAAA,IAACQ,EAAA,CAAsB,cAAe2B,CAAAA,CAAK,CACnD"}
@@ -0,0 +1,2 @@
1
+ import{j as s,L as l,s as u,r as c}from"./vendor-tanstack-BdLtprmr.js";import{C as d,q as o,U as h,V as g,bD as j,B as p,g as f,h as i,bv as N,bE as b,bp as v,bF as n}from"./index-CPpeVt8m.js";import{B as k}from"./block-type-logo-scnMsyY5.js";import{L as B}from"./lazy-markdown-D_y73qoD.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";function C({blockType:e}){return s.jsxs(d,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(k,{size:"lg",logoUrl:e.logo_url}),s.jsx("h4",{className:"text-xl font-semibold tracking-tight",children:e.name})]}),e.description&&s.jsx("div",{className:"prose max-w-none h-32 overflow-y-scroll text-sm",children:s.jsx(B,{children:e.description})}),s.jsxs("div",{className:"flex justify-end gap-4",children:[s.jsx(o,{variant:"secondary",size:"sm",children:s.jsx(l,{to:"/blocks/catalog/$slug",params:{slug:e.slug},children:"Details"})}),s.jsx(o,{size:"sm",children:s.jsx(l,{to:"/blocks/catalog/$slug/create",params:{slug:e.slug},children:"Create"})})]})]})}const S=({blockTypes:e,search:a,onSearch:r})=>s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," ",h(e.length,"Block")]}),s.jsx("div",{className:"min-w-40",children:s.jsx(g,{value:a,placeholder:"Search blocks",onChange:t=>r(t.target.value)})})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(t=>s.jsx(C,{blockType:t},t.id))})]}),L=()=>s.jsx(d,{className:"p-4",children:s.jsxs("p",{className:"text-sm",children:["Can't find a block for your service? Check out the"," ",s.jsx("a",{className:"underline text-blue-600 hover:text-blue-800 visited:text-purple-600",href:j["integrations-guide"],children:"docs"})," ","for a full list of integrations in the SDK"]})}),y=()=>s.jsx(p,{children:s.jsxs(f,{children:[s.jsx(i,{children:s.jsx(N,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),s.jsx(b,{}),s.jsx(i,{className:"text-xl font-semibold",children:"Catalog"})]})}),w=({blockTypes:e,search:a,onSearch:r})=>s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(y,{}),s.jsx(L,{}),s.jsx(S,{blockTypes:e,search:a,onSearch:r})]});function Q(){const[e,a]=z(),{data:r}=u(v({block_types:{name:{like_:e}},offset:0}));return s.jsx(w,{blockTypes:r,search:e,onSearch:a})}function z(){const{blockName:e}=n.useSearch(),a=n.useNavigate(),r=c.useCallback(m=>{a({to:".",search:x=>({...x,blockName:m}),replace:!0})},[a]);return[c.useMemo(()=>e??"",[e]),r]}export{Q as component};
2
+ //# sourceMappingURL=catalog-5_GoCKpb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-5_GoCKpb.js","sources":["../../src/components/blocks/blocks-catalog-page/block-type-card.tsx","../../src/components/blocks/blocks-catalog-page/block-types-grid.tsx","../../src/components/blocks/blocks-catalog-page/blocks-catalog-message.tsx","../../src/components/blocks/blocks-catalog-page/blocks-catalog-page-header.tsx","../../src/components/blocks/blocks-catalog-page/blocks-catalog-page.tsx","../../src/routes/blocks/catalog.tsx?tsr-split=component"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport type { BlockType } from \"@/api/block-types\";\nimport { BlockTypeLogo } from \"@/components/block-type-logo/block-type-logo\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport { LazyMarkdown } from \"@/components/ui/lazy-markdown\";\n\ntype BlockTypeCardProps = {\n\tblockType: BlockType;\n};\n\nexport function BlockTypeCard({ blockType }: BlockTypeCardProps) {\n\treturn (\n\t\t<Card className=\"p-6\">\n\t\t\t<div className=\"flex items-center gap-4\">\n\t\t\t\t<BlockTypeLogo size=\"lg\" logoUrl={blockType.logo_url} />\n\t\t\t\t<h4 className=\"text-xl font-semibold tracking-tight\">\n\t\t\t\t\t{blockType.name}\n\t\t\t\t</h4>\n\t\t\t</div>\n\n\t\t\t{blockType.description && (\n\t\t\t\t<div className=\"prose max-w-none h-32 overflow-y-scroll text-sm\">\n\t\t\t\t\t<LazyMarkdown>{blockType.description}</LazyMarkdown>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<div className=\"flex justify-end gap-4\">\n\t\t\t\t<Button variant=\"secondary\" size=\"sm\">\n\t\t\t\t\t<Link to=\"/blocks/catalog/$slug\" params={{ slug: blockType.slug }}>\n\t\t\t\t\t\tDetails\n\t\t\t\t\t</Link>\n\t\t\t\t</Button>\n\n\t\t\t\t<Button size=\"sm\">\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto=\"/blocks/catalog/$slug/create\"\n\t\t\t\t\t\tparams={{ slug: blockType.slug }}\n\t\t\t\t\t>\n\t\t\t\t\t\tCreate\n\t\t\t\t\t</Link>\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</Card>\n\t);\n}\n","import type { BlockType } from \"@/api/block-types\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport { pluralize } from \"@/utils\";\nimport { BlockTypeCard } from \"./block-type-card\";\n\ntype BlockTypesGridProps = {\n\tblockTypes: Array<BlockType>;\n\tsearch: string;\n\tonSearch: (value?: string) => void;\n};\n\nexport const BlockTypesGrid = ({\n\tblockTypes,\n\tsearch,\n\tonSearch,\n}: BlockTypesGridProps) => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div className=\"flex justify-between items-center\">\n\t\t\t\t<p className=\"text-sm text-muted-foreground\">\n\t\t\t\t\t{blockTypes.length} {pluralize(blockTypes.length, \"Block\")}\n\t\t\t\t</p>\n\t\t\t\t<div className=\"min-w-40\">\n\t\t\t\t\t<SearchInput\n\t\t\t\t\t\tvalue={search}\n\t\t\t\t\t\tplaceholder=\"Search blocks\"\n\t\t\t\t\t\tonChange={(e) => onSearch(e.target.value)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n\t\t\t\t{blockTypes.map((blockType) => (\n\t\t\t\t\t<BlockTypeCard key={blockType.id} blockType={blockType} />\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { Card } from \"@/components/ui/card\";\nimport { DOCS_LINKS } from \"@/components/ui/docs-link\";\n\nexport const BlocksCatalogMessage = () => {\n\treturn (\n\t\t<Card className=\"p-4\">\n\t\t\t<p className=\"text-sm\">\n\t\t\t\tCan&apos;t find a block for your service? Check out the{\" \"}\n\t\t\t\t<a\n\t\t\t\t\tclassName=\"underline text-blue-600 hover:text-blue-800 visited:text-purple-600\"\n\t\t\t\t\thref={DOCS_LINKS[\"integrations-guide\"]}\n\t\t\t\t>\n\t\t\t\t\tdocs\n\t\t\t\t</a>{\" \"}\n\t\t\t\tfor a full list of integrations in the SDK\n\t\t\t</p>\n\t\t</Card>\n\t);\n};\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\n\nexport const BlocksCatalogPageHeader = () => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/blocks\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tBlocks\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\tCatalog\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import type { BlockType } from \"@/api/block-types\";\nimport { BlockTypesGrid } from \"./block-types-grid\";\nimport { BlocksCatalogMessage } from \"./blocks-catalog-message\";\nimport { BlocksCatalogPageHeader } from \"./blocks-catalog-page-header\";\n\ntype BlocksCatalogPageProps = {\n\tblockTypes: Array<BlockType>;\n\tsearch: string;\n\tonSearch: (value?: string) => void;\n};\n\nexport const BlocksCatalogPage = ({\n\tblockTypes,\n\tsearch,\n\tonSearch,\n}: BlocksCatalogPageProps) => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<BlocksCatalogPageHeader />\n\t\t\t<BlocksCatalogMessage />\n\t\t\t<BlockTypesGrid\n\t\t\t\tblockTypes={blockTypes}\n\t\t\t\tsearch={search}\n\t\t\t\tonSearch={onSearch}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { useCallback, useMemo } from \"react\";\nimport { z } from \"zod\";\nimport { buildListFilterBlockTypesQuery } from \"@/api/block-types\";\nimport { BlocksCatalogPage } from \"@/components/blocks/blocks-catalog-page/blocks-catalog-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nconst searchParams = z.object({\n\tblockName: z.string().optional(),\n});\n\nexport const Route = createFileRoute(\"/blocks/catalog\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\tloaderDeps: ({ search: { blockName } }) => ({\n\t\tblockName,\n\t}),\n\tloader: ({ deps, context: { queryClient } }) => {\n\t\treturn queryClient.ensureQueryData(\n\t\t\tbuildListFilterBlockTypesQuery({\n\t\t\t\tblock_types: { name: { like_: deps.blockName } },\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t);\n\t},\n\twrapInSuspense: true,\n\tpendingComponent: PrefectLoading,\n});\n\nfunction RouteComponent() {\n\tconst [search, onSearch] = useSearch();\n\tconst { data: blockTypes } = useSuspenseQuery(\n\t\tbuildListFilterBlockTypesQuery({\n\t\t\tblock_types: { name: { like_: search } },\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\treturn (\n\t\t<BlocksCatalogPage\n\t\t\tblockTypes={blockTypes}\n\t\t\tsearch={search}\n\t\t\tonSearch={onSearch}\n\t\t/>\n\t);\n}\n\nfunction useSearch() {\n\tconst { blockName } = Route.useSearch();\n\tconst navigate = Route.useNavigate();\n\n\tconst onSearch = useCallback(\n\t\t(value?: string) => {\n\t\t\tvoid navigate({\n\t\t\t\tto: \".\",\n\t\t\t\tsearch: (prev) => ({\n\t\t\t\t\t...prev,\n\t\t\t\t\tblockName: value,\n\t\t\t\t}),\n\t\t\t\treplace: true,\n\t\t\t});\n\t\t},\n\t\t[navigate],\n\t);\n\tconst search = useMemo(() => blockName ?? \"\", [blockName]);\n\treturn [search, onSearch] as const;\n}\n"],"names":["BlockTypeCard","blockType","jsxs","Card","jsx","BlockTypeLogo","LazyMarkdown","Button","Link","BlockTypesGrid","blockTypes","search","onSearch","pluralize","SearchInput","e","BlocksCatalogMessage","DOCS_LINKS","BlocksCatalogPageHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BlocksCatalogPage","RouteComponent","useSearch","data","useSuspenseQuery","buildListFilterBlockTypesQuery","block_types","name","like_","offset","blockName","Route","navigate","useNavigate","useCallback","value","to","prev","replace","useMemo"],"mappings":"odAWO,SAASA,EAAc,CAAE,UAAAC,GAAiC,CAChE,OACCC,EAAAA,KAACC,EAAA,CAAK,UAAU,MACf,SAAA,CAAAD,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAE,EAAAA,IAACC,EAAA,CAAc,KAAK,KAAK,QAASJ,EAAU,SAAU,EACtDG,EAAAA,IAAC,KAAA,CAAG,UAAU,uCACZ,WAAU,IAAA,CACZ,C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,CACV,EAEA,MAAO,CADQO,EAAAA,QAAQ,IAAMT,GAAa,GAAI,CAACA,CAAS,CAAC,EACzCtB,CAAQ,CACzB"}
@@ -0,0 +1,2 @@
1
+ import{j as e,L as i,s as n}from"./vendor-tanstack-BdLtprmr.js";import{B as c,g as m,h as r,bv as o,bE as l,C as d,q as x,dv as u,dh as p}from"./index-CPpeVt8m.js";import{B as j}from"./block-type-logo-scnMsyY5.js";import{P as h}from"./python-example-snippet-d8bTNJ0J.js";import{L as f}from"./lazy-markdown-D_y73qoD.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-forms-BlFSCfFw.js";import"./vendor-date-Cl1Jav-N.js";const g=({blockType:s})=>e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(B,{blockType:s}),e.jsx(N,{blockType:s})]});function B({blockType:s}){return e.jsx(c,{children:e.jsxs(m,{children:[e.jsx(r,{children:e.jsx(o,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),e.jsx(l,{}),e.jsx(r,{children:e.jsx(o,{to:"/blocks/catalog",className:"text-xl font-semibold",children:"Catalog"})}),e.jsx(l,{}),e.jsx(r,{className:"text-xl font-semibold",children:s.slug})]})})}function N({blockType:s}){return e.jsx("div",{children:e.jsxs(d,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(j,{size:"lg",logoUrl:s.logo_url}),e.jsx("h3",{className:"text-2xl font-semibold tracking-tight",children:s.name})]}),s.description&&e.jsx(b,{description:s.description,documentationUrl:s.documentation_url}),s.code_example&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h4",{className:"text-xl font-semibold tracking-tight",children:"Example"}),e.jsx(h,{codeExample:s.code_example,name:s.name})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(x,{children:e.jsx(i,{to:"/blocks/catalog/$slug/create",params:{slug:s.slug},children:"Create"})})})]})})}function b({description:s,documentationUrl:a}){let t=s;return a&&(t=`${t} [Documentation](${a})`),e.jsx("div",{className:"prose max-w-none",children:e.jsx(f,{children:t})})}function S(){const{slug:s}=u.useParams(),{data:a}=n(p(s));return e.jsx(g,{blockType:a})}export{S as component};
2
+ //# sourceMappingURL=catalog_._slug-sZvt0fDy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog_._slug-sZvt0fDy.js","sources":["../../src/components/blocks/block-type-page/block-type-page.tsx","../../src/routes/blocks/catalog_.$slug.tsx?tsr-split=component"],"sourcesContent":["import { Link } from \"@tanstack/react-router\";\nimport type { BlockType } from \"@/api/block-types\";\nimport { BlockTypeLogo } from \"@/components/block-type-logo/block-type-logo\";\nimport { PythonBlockSnippet } from \"@/components/blocks/python-example-snippet\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport { LazyMarkdown } from \"@/components/ui/lazy-markdown\";\n\ntype BlockTypePageProps = {\n\tblockType: BlockType;\n};\n\nexport const BlockTypePage = ({ blockType }: BlockTypePageProps) => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<BlockTypePageHeader blockType={blockType} />\n\t\t\t<BlockTypeCardDetails blockType={blockType} />\n\t\t</div>\n\t);\n};\n\nfunction BlockTypePageHeader({ blockType }: BlockTypePageProps) {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/blocks\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tBlocks\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/blocks/catalog\"\n\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\tCatalog\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t{blockType.slug}\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n}\n\nfunction BlockTypeCardDetails({ blockType }: BlockTypePageProps) {\n\treturn (\n\t\t<div>\n\t\t\t<Card className=\"p-6\">\n\t\t\t\t<div className=\"flex items-center gap-4\">\n\t\t\t\t\t<BlockTypeLogo size=\"lg\" logoUrl={blockType.logo_url} />\n\t\t\t\t\t<h3 className=\"text-2xl font-semibold tracking-tight\">\n\t\t\t\t\t\t{blockType.name}\n\t\t\t\t\t</h3>\n\t\t\t\t</div>\n\n\t\t\t\t{blockType.description && (\n\t\t\t\t\t<BlockTypeDescription\n\t\t\t\t\t\tdescription={blockType.description}\n\t\t\t\t\t\tdocumentationUrl={blockType.documentation_url}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{blockType.code_example && (\n\t\t\t\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t\t\t\t<h4 className=\"text-xl font-semibold tracking-tight\">Example</h4>\n\t\t\t\t\t\t<PythonBlockSnippet\n\t\t\t\t\t\t\tcodeExample={blockType.code_example}\n\t\t\t\t\t\t\tname={blockType.name}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"flex justify-end\">\n\t\t\t\t\t<Button>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tto=\"/blocks/catalog/$slug/create\"\n\t\t\t\t\t\t\tparams={{ slug: blockType.slug }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tCreate\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</Card>\n\t\t</div>\n\t);\n}\n\ntype BlockTypeDescriptionProps = {\n\tdescription: string;\n\tdocumentationUrl: string | null | undefined;\n};\nfunction BlockTypeDescription({\n\tdescription,\n\tdocumentationUrl,\n}: BlockTypeDescriptionProps) {\n\tlet retDescription = description;\n\tif (documentationUrl) {\n\t\tretDescription = `${retDescription} [Documentation](${documentationUrl})`;\n\t}\n\n\treturn (\n\t\t<div className=\"prose max-w-none\">\n\t\t\t<LazyMarkdown>{retDescription}</LazyMarkdown>\n\t\t</div>\n\t);\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildGetBlockTypeQuery } from \"@/api/block-types\";\nimport { BlockTypePage } from \"@/components/blocks/block-type-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nexport const Route = createFileRoute(\"/blocks/catalog_/$slug\")({\n\tcomponent: RouteComponent,\n\tloader: ({ params, context: { queryClient } }) =>\n\t\tqueryClient.ensureQueryData(buildGetBlockTypeQuery(params.slug)),\n\twrapInSuspense: true,\n\tpendingComponent: PrefectLoading,\n});\n\nfunction RouteComponent() {\n\tconst { slug } = Route.useParams();\n\tconst { data: blockType } = useSuspenseQuery(buildGetBlockTypeQuery(slug));\n\treturn <BlockTypePage blockType={blockType} />;\n}\n"],"names":["BlockTypePage","blockType","jsxs","jsx","BlockTypePageHeader","BlockTypeCardDetails","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","Card","BlockTypeLogo","BlockTypeDescription","PythonBlockSnippet","Button","Link","description","documentationUrl","retDescription","LazyMarkdown","RouteComponent","slug","Route","useParams","data","useSuspenseQuery","buildGetBlockTypeQuery"],"mappings":"gfAmBO,MAAMA,EAAgB,CAAC,CAAE,UAAAC,KAE9BC,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAC,MAACC,GAAoB,UAAAH,EAAsB,EAC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IAAA,EAC1B,SAAA,QAAA,CAAA,EAGF,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAEF,CAMA,SAASY,EAAqB,CAC7B,YAAAI,EACA,iBAAAC,CACD,EAA8B,CAC7B,IAAIC,EAAiBF,EACrB,OAAIC,IACHC,EAAiB,GAAGA,CAAc,oBAAoBD,CAAgB,WAIrE,MAAA,CAAI,UAAU,mBACd,SAAAf,EAAAA,IAACiB,EAAA,CAAc,WAAe,CAAA,CAC/B,CAEF,CCxGA,SAASC,GAAiB,CACzB,KAAM,CAAEC,KAAAA,CAAAA,EAASC,EAAMC,UAAAA,EACjB,CAAEC,KAAMxB,CAAAA,EAAcyB,EAAiBC,EAAuBL,CAAI,CAAC,EACzE,OAAOnB,MAACH,GAAc,UAAAC,EAAqB,CAC5C"}
@@ -1,2 +1,2 @@
1
- import{j as e,d as B,L as y,s as h}from"./vendor-tanstack-BdLtprmr.js";import{B as N,g as F,h as n,bw as i,bF as d,bH as v,dk as _,C as S,p as C,q as p,y as u,dQ as L,di as w,dj as E}from"./index-V_xTKaEb.js";import{a as D}from"./zod-B1GLD-Zc.js";import{c as P,o as A,s as Q}from"./vendor-forms-BlFSCfFw.js";import{B as R}from"./block-type-details-Bcb9qEO8.js";import{u as T,L as U}from"./schema-form-input-string-format-datetime-Cb4sTJle.js";import"./toggle-group-CBJphTE6.js";import{F as V,b as I,c as z,d as G,e as H,a as M}from"./form-DOdmIC3A.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-date-Cl1Jav-N.js";import"./block-type-logo-DuvU7goV.js";import"./lazy-markdown-B9vEkJ0h.js";import"./use-debounce-callback-Dk7Ebi48.js";import"./timezone-select-DPtR_b06.js";import"./dropdown-menu-B9LKPlz7.js";const $=({blockType:s})=>e.jsx(N,{children:e.jsxs(F,{children:[e.jsx(n,{children:e.jsx(i,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),e.jsx(d,{}),e.jsx(n,{children:e.jsx(i,{to:"/blocks/catalog",className:"text-xl font-semibold",children:"Catalog"})}),e.jsx(d,{}),e.jsx(n,{children:e.jsx(i,{to:"/blocks/catalog",className:"text-xl font-semibold",children:s.name})}),e.jsx(d,{}),e.jsx(n,{className:"text-xl font-semibold",children:e.jsx(v,{children:"Create"})})]})}),q=/^[a-zA-Z0-9-]+$/,K=A({blockName:Q().regex(q,{message:"Name must only contain lowercase letters, numbers, and dashes"})}),O={blockName:""},X=({blockSchema:s,blockType:o})=>{const l=B(),{values:a,setValues:b,errors:x,validateForm:j}=T(),{createBlockDocument:k,isPending:f}=_(),m=P({resolver:D(K),defaultValues:O}),g=async r=>{try{if(await j({schema:a}),x.length>0)return;k({block_schema_id:s.id,block_type_id:o.id,is_anonymous:!1,data:a,name:r.blockName},{onSuccess:t=>{u.success("Block created successfully"),l({to:"/blocks/block/$id",params:{id:t.id}})},onError:t=>{const c="Unknown error while creating block.";u.error(c),console.error(c,t)}})}catch(t){const c="Unknown error while validating block data.";u.error(c),console.error(c,t)}};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx($,{blockType:o}),e.jsxs(S,{className:" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 ",children:[e.jsx(V,{...m,children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:r=>{m.handleSubmit(g)(r)},children:[e.jsx(I,{control:m.control,name:"blockName",render:({field:r})=>e.jsxs(z,{children:[e.jsx(G,{children:"Name"}),e.jsx(H,{children:e.jsx(C,{...r,value:r.value})}),e.jsx(M,{})]})}),e.jsx(U,{values:a,onValuesChange:b,errors:x,kinds:["json"],schema:s.fields}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(p,{variant:"secondary",children:e.jsx(y,{to:"/blocks/catalog",children:"Cancel"})}),e.jsx(p,{loading:f,type:"submit",children:"Save"})]})]})}),e.jsx(R,{blockType:o})]})]})};function xe(){const{slug:s}=L.useParams(),{data:o}=h(w(s)),{data:l}=h(E({block_schemas:{block_type_id:{any_:[o.id]},operator:"and_"},offset:0})),a=l[0];if(!a)throw new Error("Block schema not found");return e.jsx(X,{blockSchema:a,blockType:o})}export{xe as component};
2
- //# sourceMappingURL=catalog_._slug_.create-CgKL4TS2.js.map
1
+ import{j as e,d as B,L as y,s as h}from"./vendor-tanstack-BdLtprmr.js";import{B as N,g as v,h as n,bv as i,bE as d,bG as F,dj as _,C as S,p as C,q as p,y as u,dP as L,dh as E,di as w}from"./index-CPpeVt8m.js";import{a as D}from"./zod-B1GLD-Zc.js";import{c as P,o as A,s as R}from"./vendor-forms-BlFSCfFw.js";import{B as T}from"./block-type-details-tAkUWqs1.js";import{u as U,L as V}from"./schema-form-input-string-format-datetime-Dg3zVAp5.js";import"./toggle-group-EMgSOoYH.js";import{F as G,b as I,c as Q,d as z,e as M,a as $}from"./form-Cl5Hk9bq.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-CJc458uP.js";import"./vendor-recharts-CY3PKigC.js";import"./vendor-date-Cl1Jav-N.js";import"./block-type-logo-scnMsyY5.js";import"./lazy-markdown-D_y73qoD.js";import"./use-debounce-callback-Dk7Ebi48.js";import"./timezone-select-NViFNNLz.js";import"./dropdown-menu-fRiq5bS-.js";const q=({blockType:s})=>e.jsx(N,{children:e.jsxs(v,{children:[e.jsx(n,{children:e.jsx(i,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),e.jsx(d,{}),e.jsx(n,{children:e.jsx(i,{to:"/blocks/catalog",className:"text-xl font-semibold",children:"Catalog"})}),e.jsx(d,{}),e.jsx(n,{children:e.jsx(i,{to:"/blocks/catalog",className:"text-xl font-semibold",children:s.name})}),e.jsx(d,{}),e.jsx(n,{className:"text-xl font-semibold",children:e.jsx(F,{children:"Create"})})]})}),H=/^[a-zA-Z0-9-]+$/,K=A({blockName:R().regex(H,{message:"Name must only contain lowercase letters, numbers, and dashes"})}),O={blockName:""},X=({blockSchema:s,blockType:o})=>{const l=B(),{values:a,setValues:b,errors:x,validateForm:j}=U(),{createBlockDocument:k,isPending:f}=_(),m=P({resolver:D(K),defaultValues:O}),g=async r=>{try{if(await j({schema:a}),x.length>0)return;k({block_schema_id:s.id,block_type_id:o.id,is_anonymous:!1,data:a,name:r.blockName},{onSuccess:t=>{u.success("Block created successfully"),l({to:"/blocks/block/$id",params:{id:t.id}})},onError:t=>{const c="Unknown error while creating block.";u.error(c),console.error(c,t)}})}catch(t){const c="Unknown error while validating block data.";u.error(c),console.error(c,t)}};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(q,{blockType:o}),e.jsxs(S,{className:" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 ",children:[e.jsx(G,{...m,children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:r=>{m.handleSubmit(g)(r)},children:[e.jsx(I,{control:m.control,name:"blockName",render:({field:r})=>e.jsxs(Q,{children:[e.jsx(z,{children:"Name"}),e.jsx(M,{children:e.jsx(C,{...r,value:r.value})}),e.jsx($,{})]})}),e.jsx(V,{values:a,onValuesChange:b,errors:x,kinds:["json"],schema:s.fields}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(p,{variant:"secondary",children:e.jsx(y,{to:"/blocks/catalog",children:"Cancel"})}),e.jsx(p,{loading:f,type:"submit",children:"Save"})]})]})}),e.jsx(T,{blockType:o})]})]})};function xe(){const{slug:s}=L.useParams(),{data:o}=h(E(s)),{data:l}=h(w({block_schemas:{block_type_id:{any_:[o.id]},operator:"and_"},offset:0})),a=l[0];if(!a)throw new Error("Block schema not found");return e.jsx(X,{blockSchema:a,blockType:o})}export{xe as component};
2
+ //# sourceMappingURL=catalog_._slug_.create-rboQmoyW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog_._slug_.create-CgKL4TS2.js","sources":["../../src/components/blocks/block-document-create-page/block-document-create-page-header.tsx","../../src/components/blocks/block-document-create-page/block-document-create-page.tsx","../../src/routes/blocks/catalog_.$slug_.create.tsx?tsr-split=component"],"sourcesContent":["import type { BlockType } from \"@/api/block-types\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\n\ntype BlockDocumentCreatePageHeaderProps = {\n\tblockType: BlockType;\n};\n\nexport const BlockDocumentCreatePageHeader = ({\n\tblockType,\n}: BlockDocumentCreatePageHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/blocks\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tBlocks\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/blocks/catalog\"\n\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\tCatalog\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/blocks/catalog\"\n\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{blockType.name}\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>Create</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { Link, useNavigate } from \"@tanstack/react-router\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport { useCreateBlockDocument } from \"@/api/block-documents\";\nimport type { BlockSchema } from \"@/api/block-schemas\";\nimport type { BlockType } from \"@/api/block-types\";\nimport { BlockTypeDetails } from \"@/components/blocks/block-type-details\";\nimport {\n\tLazySchemaForm,\n\ttype PrefectSchemaObject,\n\tuseSchemaForm,\n} from \"@/components/schemas\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Input } from \"@/components/ui/input\";\nimport { BlockDocumentCreatePageHeader } from \"./block-document-create-page-header\";\n\ntype BlockDocumentCreatePageProps = {\n\tblockSchema: BlockSchema;\n\tblockType: BlockType;\n};\n\n// Letters, numbers, and dashes only\nconst BLOCK_NAME_REGEX = /^[a-zA-Z0-9-]+$/;\n\nconst BlockNameFormSchema = z.object({\n\tblockName: z.string().regex(BLOCK_NAME_REGEX, {\n\t\tmessage: \"Name must only contain lowercase letters, numbers, and dashes\",\n\t}),\n});\n\nexport type BlockNameFormSchema = z.infer<typeof BlockNameFormSchema>;\nconst DEFAULT_VALUES: BlockNameFormSchema = {\n\tblockName: \"\",\n};\n\nexport const BlockDocumentCreatePage = ({\n\tblockSchema,\n\tblockType,\n}: BlockDocumentCreatePageProps) => {\n\tconst navigate = useNavigate();\n\tconst { values, setValues, errors, validateForm } = useSchemaForm();\n\tconst { createBlockDocument, isPending } = useCreateBlockDocument();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(BlockNameFormSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\tconst onSave = async (zodFormValues: BlockNameFormSchema) => {\n\t\ttry {\n\t\t\tawait validateForm({ schema: values });\n\t\t\t// Early exit if there's errors from block schema validation\n\t\t\tif (errors.length > 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcreateBlockDocument(\n\t\t\t\t{\n\t\t\t\t\tblock_schema_id: blockSchema.id,\n\t\t\t\t\tblock_type_id: blockType.id,\n\t\t\t\t\tis_anonymous: false,\n\t\t\t\t\tdata: values,\n\t\t\t\t\tname: zodFormValues.blockName,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: (res) => {\n\t\t\t\t\t\ttoast.success(\"Block created successfully\");\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/blocks/block/$id\",\n\t\t\t\t\t\t\tparams: { id: res.id },\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\tonError: (err) => {\n\t\t\t\t\t\tconst message = \"Unknown error while creating block.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message, err);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tconst message = \"Unknown error while validating block data.\";\n\t\t\ttoast.error(message);\n\t\t\tconsole.error(message, err);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<BlockDocumentCreatePageHeader blockType={blockType} />\n\t\t\t<Card className=\" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 \">\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"flex flex-col gap-4\"\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(onSave)(e)}\n\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=\"blockName\"\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 {...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\n\t\t\t\t\t\t<LazySchemaForm\n\t\t\t\t\t\t\tvalues={values}\n\t\t\t\t\t\t\tonValuesChange={setValues}\n\t\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\t\tkinds={[\"json\"]}\n\t\t\t\t\t\t\tschema={blockSchema.fields as unknown as PrefectSchemaObject}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div className=\"flex gap-3 justify-end\">\n\t\t\t\t\t\t\t<Button variant=\"secondary\">\n\t\t\t\t\t\t\t\t<Link to=\"/blocks/catalog\">Cancel</Link>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button loading={isPending} type=\"submit\">\n\t\t\t\t\t\t\t\tSave\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t\t<BlockTypeDetails blockType={blockType} />\n\t\t\t</Card>\n\t\t</div>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildListFilterBlockSchemasQuery } from \"@/api/block-schemas\";\nimport { buildGetBlockTypeQuery } from \"@/api/block-types\";\nimport { BlockDocumentCreatePage } from \"@/components/blocks/block-document-create-page\";\n\nexport const Route = createFileRoute(\"/blocks/catalog_/$slug_/create\")({\n\tcomponent: RouteComponent,\n\tloader: async ({ params, context: { queryClient } }) => {\n\t\t// critical data\n\t\tconst res = await queryClient.ensureQueryData(\n\t\t\tbuildGetBlockTypeQuery(params.slug),\n\t\t);\n\t\tvoid queryClient.ensureQueryData(\n\t\t\tbuildListFilterBlockSchemasQuery({\n\t\t\t\tblock_schemas: {\n\t\t\t\t\tblock_type_id: { any_: [res.id] },\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t},\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t);\n\t},\n\twrapInSuspense: true,\n});\n\nfunction RouteComponent() {\n\tconst { slug } = Route.useParams();\n\tconst { data: blockType } = useSuspenseQuery(buildGetBlockTypeQuery(slug));\n\tconst { data: blockSchemas } = useSuspenseQuery(\n\t\tbuildListFilterBlockSchemasQuery({\n\t\t\tblock_schemas: {\n\t\t\t\tblock_type_id: { any_: [blockType.id] },\n\t\t\t\toperator: \"and_\",\n\t\t\t},\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\tconst blockSchema = blockSchemas[0];\n\tif (!blockSchema) {\n\t\tthrow new Error(\"Block schema not found\");\n\t}\n\n\treturn (\n\t\t<BlockDocumentCreatePage blockSchema={blockSchema} blockType={blockType} />\n\t);\n}\n"],"names":["BlockDocumentCreatePageHeader","blockType","jsx","Breadcrumb","jsxs","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","BLOCK_NAME_REGEX","BlockNameFormSchema","z.object","z.string","DEFAULT_VALUES","BlockDocumentCreatePage","blockSchema","navigate","useNavigate","values","setValues","errors","validateForm","useSchemaForm","createBlockDocument","isPending","useCreateBlockDocument","form","useForm","zodResolver","onSave","zodFormValues","res","toast","err","message","Card","Form","e","FormField","field","FormItem","FormLabel","FormControl","Input","FormMessage","LazySchemaForm","Button","Link","BlockTypeDetails","RouteComponent","slug","Route","useParams","data","useSuspenseQuery","buildGetBlockTypeQuery","blockSchemas","buildListFilterBlockSchemasQuery","block_schemas","block_type_id","any_","id","operator","offset","Error"],"mappings":"s3BAcO,MAAMA,EAAgC,CAAC,CAC7C,UAAAC,CACD,IAEEC,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,UAAU,UAAU,wBAAwB,kBAE/D,CAAA,CACD,QACCC,EAAA,EAAoB,QAEpBF,EAAA,CACA,SAAAJ,EAAAA,IAACK,E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AAEC,KAAAA,CAAAA,EAASC,EAAMC,UAAAA,EACjB,CAAEC,KAAMrD,CAAAA,EAAcsD,EAAiBC,EAAuBL,CAAI,CAAC,EACnE,CAAEG,KAAMG,CAAAA,EAAiBF,EAC9BG,EAAiC,CAChCC,cAAe,CACdC,cAAe,CAAEC,KAAM,CAAC5D,EAAU6D,EAAE,CAAA,EACpCC,SAAU,MAAA,EAEXC,OAAQ,CAAA,CACR,CACF,EACMhD,EAAcyC,EAAa,CAAC,EAClC,GAAI,CAACzC,EACJ,MAAM,IAAIiD,MAAM,wBAAwB,EAGzC,OACC/D,EAAAA,IAACa,EAAA,CAAwB,YAAAC,EAA0B,UAAAf,CAAA,CAAqB,CAE1E"}
1
+ {"version":3,"file":"catalog_._slug_.create-rboQmoyW.js","sources":["../../src/components/blocks/block-document-create-page/block-document-create-page-header.tsx","../../src/components/blocks/block-document-create-page/block-document-create-page.tsx","../../src/routes/blocks/catalog_.$slug_.create.tsx?tsr-split=component"],"sourcesContent":["import type { BlockType } from \"@/api/block-types\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\n\ntype BlockDocumentCreatePageHeaderProps = {\n\tblockType: BlockType;\n};\n\nexport const BlockDocumentCreatePageHeader = ({\n\tblockType,\n}: BlockDocumentCreatePageHeaderProps) => {\n\treturn (\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink to=\"/blocks\" className=\"text-xl font-semibold\">\n\t\t\t\t\t\tBlocks\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/blocks/catalog\"\n\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\tCatalog\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\tto=\"/blocks/catalog\"\n\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{blockType.name}\n\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t\t<BreadcrumbSeparator />\n\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t<BreadcrumbPage>Create</BreadcrumbPage>\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { Link, useNavigate } from \"@tanstack/react-router\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport { useCreateBlockDocument } from \"@/api/block-documents\";\nimport type { BlockSchema } from \"@/api/block-schemas\";\nimport type { BlockType } from \"@/api/block-types\";\nimport { BlockTypeDetails } from \"@/components/blocks/block-type-details\";\nimport {\n\tLazySchemaForm,\n\ttype PrefectSchemaObject,\n\tuseSchemaForm,\n} from \"@/components/schemas\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Input } from \"@/components/ui/input\";\nimport { BlockDocumentCreatePageHeader } from \"./block-document-create-page-header\";\n\ntype BlockDocumentCreatePageProps = {\n\tblockSchema: BlockSchema;\n\tblockType: BlockType;\n};\n\n// Letters, numbers, and dashes only\nconst BLOCK_NAME_REGEX = /^[a-zA-Z0-9-]+$/;\n\nconst BlockNameFormSchema = z.object({\n\tblockName: z.string().regex(BLOCK_NAME_REGEX, {\n\t\tmessage: \"Name must only contain lowercase letters, numbers, and dashes\",\n\t}),\n});\n\nexport type BlockNameFormSchema = z.infer<typeof BlockNameFormSchema>;\nconst DEFAULT_VALUES: BlockNameFormSchema = {\n\tblockName: \"\",\n};\n\nexport const BlockDocumentCreatePage = ({\n\tblockSchema,\n\tblockType,\n}: BlockDocumentCreatePageProps) => {\n\tconst navigate = useNavigate();\n\tconst { values, setValues, errors, validateForm } = useSchemaForm();\n\tconst { createBlockDocument, isPending } = useCreateBlockDocument();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(BlockNameFormSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\tconst onSave = async (zodFormValues: BlockNameFormSchema) => {\n\t\ttry {\n\t\t\tawait validateForm({ schema: values });\n\t\t\t// Early exit if there's errors from block schema validation\n\t\t\tif (errors.length > 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcreateBlockDocument(\n\t\t\t\t{\n\t\t\t\t\tblock_schema_id: blockSchema.id,\n\t\t\t\t\tblock_type_id: blockType.id,\n\t\t\t\t\tis_anonymous: false,\n\t\t\t\t\tdata: values,\n\t\t\t\t\tname: zodFormValues.blockName,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: (res) => {\n\t\t\t\t\t\ttoast.success(\"Block created successfully\");\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/blocks/block/$id\",\n\t\t\t\t\t\t\tparams: { id: res.id },\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\tonError: (err) => {\n\t\t\t\t\t\tconst message = \"Unknown error while creating block.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message, err);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} catch (err) {\n\t\t\tconst message = \"Unknown error while validating block data.\";\n\t\t\ttoast.error(message);\n\t\t\tconsole.error(message, err);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t<BlockDocumentCreatePageHeader blockType={blockType} />\n\t\t\t<Card className=\" p-6 grid grid-cols-[minmax(0,_1fr)_250px] gap-4 \">\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tclassName=\"flex flex-col gap-4\"\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(onSave)(e)}\n\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=\"blockName\"\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 {...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\n\t\t\t\t\t\t<LazySchemaForm\n\t\t\t\t\t\t\tvalues={values}\n\t\t\t\t\t\t\tonValuesChange={setValues}\n\t\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\t\tkinds={[\"json\"]}\n\t\t\t\t\t\t\tschema={blockSchema.fields as unknown as PrefectSchemaObject}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div className=\"flex gap-3 justify-end\">\n\t\t\t\t\t\t\t<Button variant=\"secondary\">\n\t\t\t\t\t\t\t\t<Link to=\"/blocks/catalog\">Cancel</Link>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button loading={isPending} type=\"submit\">\n\t\t\t\t\t\t\t\tSave\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t\t<BlockTypeDetails blockType={blockType} />\n\t\t\t</Card>\n\t\t</div>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildListFilterBlockSchemasQuery } from \"@/api/block-schemas\";\nimport { buildGetBlockTypeQuery } from \"@/api/block-types\";\nimport { BlockDocumentCreatePage } from \"@/components/blocks/block-document-create-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nexport const Route = createFileRoute(\"/blocks/catalog_/$slug_/create\")({\n\tcomponent: RouteComponent,\n\tloader: async ({ params, context: { queryClient } }) => {\n\t\t// critical data\n\t\tconst res = await queryClient.ensureQueryData(\n\t\t\tbuildGetBlockTypeQuery(params.slug),\n\t\t);\n\t\tvoid queryClient.ensureQueryData(\n\t\t\tbuildListFilterBlockSchemasQuery({\n\t\t\t\tblock_schemas: {\n\t\t\t\t\tblock_type_id: { any_: [res.id] },\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t},\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t);\n\t},\n\twrapInSuspense: true,\n\tpendingComponent: PrefectLoading,\n});\n\nfunction RouteComponent() {\n\tconst { slug } = Route.useParams();\n\tconst { data: blockType } = useSuspenseQuery(buildGetBlockTypeQuery(slug));\n\tconst { data: blockSchemas } = useSuspenseQuery(\n\t\tbuildListFilterBlockSchemasQuery({\n\t\t\tblock_schemas: {\n\t\t\t\tblock_type_id: { any_: [blockType.id] },\n\t\t\t\toperator: \"and_\",\n\t\t\t},\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\tconst blockSchema = blockSchemas[0];\n\tif (!blockSchema) {\n\t\tthrow new Error(\"Block schema not found\");\n\t}\n\n\treturn (\n\t\t<BlockDocumentCreatePage blockSchema={blockSchema} blockType={blockType} />\n\t);\n}\n"],"names":["BlockDocumentCreatePageHeader","blockType","jsx","Breadcrumb","jsxs","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","BreadcrumbPage","BLOCK_NAME_REGEX","BlockNameFormSchema","z.object","z.string","DEFAULT_VALUES","BlockDocumentCreatePage","blockSchema","navigate","useNavigate","values","setValues","errors","validateForm","useSchemaForm","createBlockDocument","isPending","useCreateBlockDocument","form","useForm","zodResolver","onSave","zodFormValues","res","toast","err","message","Card","Form","e","FormField","field","FormItem","FormLabel","FormControl","Input","FormMessage","LazySchemaForm","Button","Link","BlockTypeDetails","RouteComponent","slug","Route","useParams","data","useSuspenseQuery","buildGetBlockTypeQuery","blockSchemas","buildListFilterBlockSchemasQuery","block_schemas","block_type_id","any_","id","operator","offset","Error"],"mappings":"s3BAcO,MAAMA,EAAgC,CAAC,CAC7C,UAAAC,CACD,IAEEC,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CACA,eAACC,EAAA,CAAe,GAAG,UAAU,UAAU,wBAAwB,kBAE/D,CAAA,CACD,QACCC,EAAA,EAAoB,QAEpBF,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CACA,GAAG,kBACH,UAAU,wBACV,SAAA,SAAA,CAAA,EAGF,QACCC,EAAA,EAAoB,QAEpBF,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CACA,GAAG,kBACH,UAAU,wBAET,SAAAN,EAAU,IAAA,CAAA,EAEb,QACCO,EAAA,EAAoB,QAEpBF,EAAA,CAAe,UAAU,wBACzB,SAAAJ,EAAAA,IAACO,EAAA,CAAe,kBAAM,CAAA,CACvB,CAAA,CAAA,CACD,CAAA,CACD,EClBIC,EAAmB,kBAEnBC,EAAsBC,EAAS,CACpC,UAAWC,EAAE,EAAS,MAAMH,EAAkB,CAC7C,QAAS,+DAAA,CACT,CACF,CAAC,EAGKI,EAAsC,CAC3C,UAAW,EACZ,EAEaC,EAA0B,CAAC,CACvC,YAAAC,EACA,UAAAf,CACD,IAAoC,CACnC,MAAMgB,EAAWC,EAAA,EACX,CAAE,OAAAC,EAA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k,aB as w,aC as Q}from"./vendor-radix-CJc458uP.js";const I=()=>{const[{data:o},{data:r},{data:a},{data:u},{data:n},{data:i}]=l({queries:[p(),c(),m(),f(),b(),y()]});return{resourceOptions:d.useMemo(()=>{const t=[];for(const e of o??[])t.push({id:e.id,name:e.name,type:"automation",resourceId:`prefect.automation.${e.id}`});for(const e of r??[])t.push({id:e.id,name:e.name??"",type:"block",resourceId:`prefect.block-document.${e.id}`});for(const e of a??[])t.push({id:e.id,name:e.name,type:"deployment",resourceId:`prefect.deployment.${e.id}`});for(const e of u??[])t.push({id:e.id,name:e.name,type:"flow",resourceId:`prefect.flow.${e.id}`});for(const e of n??[])t.push({id:e.name,name:e.name,type:"work-pool",resourceId:`prefect.work-pool.${e.name}`});for(const e of i??[])t.push({id:e.id,name:e.name,type:"work-queue",resourceId:`prefect.work-queue.${e.id}`});return t},[o,r,a,u,n,i])}};function $({...o}){return s.jsx(k,{"data-slot":"collapsible",...o})}function j({...o}){return s.jsx(w,{"data-slot":"collapsible-trigger",...o})}function F({...o}){return s.jsx(Q,{"data-slot":"collapsible-content",...o})}export{$ as C,j as a,F as b,I as u};
2
- //# sourceMappingURL=collapsible-DZbPzSgr.js.map
1
+ import{u as l,r as d,j as s}from"./vendor-tanstack-BdLtprmr.js";import{bu as p,bs as c,c$ as m,af as f,T as b,d6 as y}from"./index-CPpeVt8m.js";import{aA as k,aB as w,aC as Q}from"./vendor-radix-CJc458uP.js";const h=()=>{const[{data:o},{data:r},{data:a},{data:u},{data:n},{data:i}]=l({queries:[p(),c(),m(),f(),b(),y()]});return{resourceOptions:d.useMemo(()=>{const t=[];for(const e of o??[])t.push({id:e.id,name:e.name,type:"automation",resourceId:`prefect.automation.${e.id}`});for(const e of r??[])t.push({id:e.id,name:e.name??"",type:"block",resourceId:`prefect.block-document.${e.id}`});for(const e of a??[])t.push({id:e.id,name:e.name,type:"deployment",resourceId:`prefect.deployment.${e.id}`});for(const e of u??[])t.push({id:e.id,name:e.name,type:"flow",resourceId:`prefect.flow.${e.id}`});for(const e of n??[])t.push({id:e.name,name:e.name,type:"work-pool",resourceId:`prefect.work-pool.${e.name}`});for(const e of i??[])t.push({id:e.id,name:e.name,type:"work-queue",resourceId:`prefect.work-queue.${e.id}`});return t},[o,r,a,u,n,i])}};function I({...o}){return s.jsx(k,{"data-slot":"collapsible",...o})}function j({...o}){return s.jsx(w,{"data-slot":"collapsible-trigger",...o})}function F({...o}){return s.jsx(Q,{"data-slot":"collapsible-content",...o})}export{I as C,j as a,F as b,h as u};
2
+ //# sourceMappingURL=collapsible-Lk7MRvBH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible-DZbPzSgr.js","sources":["../../src/components/events/events-resource-filter/use-resource-options.ts","../../src/components/ui/collapsible.tsx"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport { buildListAutomationsQuery } from \"@/api/automations\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildFilterDeploymentsQuery } from \"@/api/deployments\";\nimport { buildListFlowsQuery } from \"@/api/flows\";\nimport { buildFilterWorkPoolsQuery } from \"@/api/work-pools\";\nimport { buildFilterWorkQueuesQuery } from \"@/api/work-queues\";\n\nexport type ResourceOption = {\n\tid: string;\n\tname: string;\n\ttype:\n\t\t| \"automation\"\n\t\t| \"block\"\n\t\t| \"deployment\"\n\t\t| \"flow\"\n\t\t| \"work-pool\"\n\t\t| \"work-queue\";\n\tresourceId: string;\n};\n\nexport const useResourceOptions = (): { resourceOptions: ResourceOption[] } => {\n\tconst [\n\t\t{ data: automations },\n\t\t{ data: blocks },\n\t\t{ data: deployments },\n\t\t{ data: flows },\n\t\t{ data: workPools },\n\t\t{ data: workQueues },\n\t] = useQueries({\n\t\tqueries: [\n\t\t\tbuildListAutomationsQuery(),\n\t\t\tbuildListFilterBlockDocumentsQuery(),\n\t\t\tbuildFilterDeploymentsQuery(),\n\t\t\tbuildListFlowsQuery(),\n\t\t\tbuildFilterWorkPoolsQuery(),\n\t\t\tbuildFilterWorkQueuesQuery(),\n\t\t],\n\t});\n\n\tconst resourceOptions = useMemo(() => {\n\t\tconst options: ResourceOption[] = [];\n\n\t\tfor (const a of automations ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: a.id,\n\t\t\t\tname: a.name,\n\t\t\t\ttype: \"automation\",\n\t\t\t\tresourceId: `prefect.automation.${a.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const b of blocks ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: b.id,\n\t\t\t\tname: b.name ?? \"\",\n\t\t\t\ttype: \"block\",\n\t\t\t\tresourceId: `prefect.block-document.${b.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const d of deployments ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: d.id,\n\t\t\t\tname: d.name,\n\t\t\t\ttype: \"deployment\",\n\t\t\t\tresourceId: `prefect.deployment.${d.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const f of flows ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: f.id,\n\t\t\t\tname: f.name,\n\t\t\t\ttype: \"flow\",\n\t\t\t\tresourceId: `prefect.flow.${f.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const wp of workPools ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: wp.name,\n\t\t\t\tname: wp.name,\n\t\t\t\ttype: \"work-pool\",\n\t\t\t\tresourceId: `prefect.work-pool.${wp.name}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const wq of workQueues ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: wq.id,\n\t\t\t\tname: wq.name,\n\t\t\t\ttype: \"work-queue\",\n\t\t\t\tresourceId: `prefect.work-queue.${wq.id}`,\n\t\t\t});\n\t\t}\n\n\t\treturn options;\n\t}, [automations, blocks, deployments, flows, workPools, workQueues]);\n\n\treturn { resourceOptions };\n};\n","import * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport type * as React from \"react\";\n\nfunction Collapsible({\n\t...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n\treturn <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n\t...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Trigger>) {\n\treturn (\n\t\t<CollapsiblePrimitive.Trigger data-slot=\"collapsible-trigger\" {...props} />\n\t);\n}\n\nfunction CollapsibleContent({\n\t...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Content>) {\n\treturn (\n\t\t<CollapsiblePrimitive.Content data-slot=\"collapsible-content\" {...props} />\n\t);\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"names":["useResourceOptions","automations","blocks","deployments","flows","workPools","workQueues","useQueries","buildListAutomationsQuery","buildListFilterBlockDocumentsQuery","buildFilterDeploymentsQuery","buildListFlowsQuery","buildFilterWorkPoolsQuery","buildFilterWorkQueuesQuery","useMemo","options","a","b","d","f","wp","wq","Collapsible","props","CollapsiblePrimitive.Root","CollapsibleTrigger","CollapsiblePrimitive.Trigger","CollapsibleContent","CollapsiblePrimitive.Content"],"mappings":"gNAsBO,MAAMA,EAAqB,IAA6C,CAC9E,KAAM,CACL,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,CAAW,EAChBC,EAAW,CACd,QAAS,CACRC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,CAA2B,CAC5B,CACA,EA8DD,MAAO,CAAE,gBA5DeC,EAAAA,QAAQ,IAAM,CACrC,MAAMC,EAA4B,CAAA,EAElC,UAAWC,KAAKf,GAAe,GAC9Bc,EAAQ,KAAK,CACZ,GAAIC,EAAE,GACN,KAAMA,EAAE,KACR,KAAM,aACN,WAAY,sBAAsBA,EAAE,EAAE,EAAA,CACtC,EAGF,UAAWC,KAAKf,GAAU,GACzBa,EAAQ,KAAK,CACZ,GAAIE,EAAE,GACN,KAAMA,EAAE,MAAQ,GAChB,KAAM,QACN,WAAY,0BAA0BA,EAAE,EAAE,EAAA,CAC1C,EAGF,UAAWC,KAAKf,GAAe,GAC9BY,EAAQ,KAAK,CACZ,GAAIG,EAAE,GACN,KAAMA,EAAE,KACR,KAAM,aACN,WAAY,sBAAsBA,EAAE,EAAE,EAAA,CACtC,EAGF,UAAWC,KAAKf,GAAS,GACxBW,EAAQ,KAAK,CACZ,GAAII,EAAE,GACN,KAAMA,EAAE,KACR,KAAM,OACN,WAAY,gBAAgBA,EAAE,EAAE,EAAA,CAChC,EAGF,UAAWC,KAAMf,GAAa,GAC7BU,EAAQ,KAAK,CACZ,GAAIK,EAAG,KACP,KAAMA,EAAG,KACT,KAAM,YACN,WAAY,qBAAqBA,EAAG,IAAI,EAAA,CACxC,EAGF,UAAWC,KAAMf,GAAc,GAC9BS,EAAQ,KAAK,CACZ,GAAIM,EAAG,GACP,KAAMA,EAAG,KACT,KAAM,aACN,WAAY,sBAAsBA,EAAG,EAAE,EAAA,CACvC,EAGF,OAAON,CACR,EAAG,CAACd,EAAaC,EAAQC,EAAaC,EAAOC,EAAWC,CAAU,CAAC,CAE1D,CACV,ECnGA,SAASgB,EAAY,CACpB,GAAGC,CACJ,EAA2D,CAC1D,aAAQC,EAAA,CAA0B,YAAU,cAAe,GAAGD,EAAO,CACtE,CAEA,SAASE,EAAmB,CAC3B,GAAGF,CACJ,EAA8D,CAC7D,aACEG,EAAA,CAA6B,YAAU,sBAAuB,GAAGH,EAAO,CAE3E,CAEA,SAASI,EAAmB,CAC3B,GAAGJ,CACJ,EAA8D,CAC7D,aACEK,EAAA,CAA6B,YAAU,sBAAuB,GAAGL,EAAO,CAE3E"}
1
+ {"version":3,"file":"collapsible-Lk7MRvBH.js","sources":["../../src/components/events/events-resource-filter/use-resource-options.ts","../../src/components/ui/collapsible.tsx"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport { buildListAutomationsQuery } from \"@/api/automations\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildFilterDeploymentsQuery } from \"@/api/deployments\";\nimport { buildListFlowsQuery } from \"@/api/flows\";\nimport { buildFilterWorkPoolsQuery } from \"@/api/work-pools\";\nimport { buildFilterWorkQueuesQuery } from \"@/api/work-queues\";\n\nexport type ResourceOption = {\n\tid: string;\n\tname: string;\n\ttype:\n\t\t| \"automation\"\n\t\t| \"block\"\n\t\t| \"deployment\"\n\t\t| \"flow\"\n\t\t| \"work-pool\"\n\t\t| \"work-queue\";\n\tresourceId: string;\n};\n\nexport const useResourceOptions = (): { resourceOptions: ResourceOption[] } => {\n\tconst [\n\t\t{ data: automations },\n\t\t{ data: blocks },\n\t\t{ data: deployments },\n\t\t{ data: flows },\n\t\t{ data: workPools },\n\t\t{ data: workQueues },\n\t] = useQueries({\n\t\tqueries: [\n\t\t\tbuildListAutomationsQuery(),\n\t\t\tbuildListFilterBlockDocumentsQuery(),\n\t\t\tbuildFilterDeploymentsQuery(),\n\t\t\tbuildListFlowsQuery(),\n\t\t\tbuildFilterWorkPoolsQuery(),\n\t\t\tbuildFilterWorkQueuesQuery(),\n\t\t],\n\t});\n\n\tconst resourceOptions = useMemo(() => {\n\t\tconst options: ResourceOption[] = [];\n\n\t\tfor (const a of automations ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: a.id,\n\t\t\t\tname: a.name,\n\t\t\t\ttype: \"automation\",\n\t\t\t\tresourceId: `prefect.automation.${a.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const b of blocks ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: b.id,\n\t\t\t\tname: b.name ?? \"\",\n\t\t\t\ttype: \"block\",\n\t\t\t\tresourceId: `prefect.block-document.${b.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const d of deployments ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: d.id,\n\t\t\t\tname: d.name,\n\t\t\t\ttype: \"deployment\",\n\t\t\t\tresourceId: `prefect.deployment.${d.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const f of flows ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: f.id,\n\t\t\t\tname: f.name,\n\t\t\t\ttype: \"flow\",\n\t\t\t\tresourceId: `prefect.flow.${f.id}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const wp of workPools ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: wp.name,\n\t\t\t\tname: wp.name,\n\t\t\t\ttype: \"work-pool\",\n\t\t\t\tresourceId: `prefect.work-pool.${wp.name}`,\n\t\t\t});\n\t\t}\n\n\t\tfor (const wq of workQueues ?? []) {\n\t\t\toptions.push({\n\t\t\t\tid: wq.id,\n\t\t\t\tname: wq.name,\n\t\t\t\ttype: \"work-queue\",\n\t\t\t\tresourceId: `prefect.work-queue.${wq.id}`,\n\t\t\t});\n\t\t}\n\n\t\treturn options;\n\t}, [automations, blocks, deployments, flows, workPools, workQueues]);\n\n\treturn { resourceOptions };\n};\n","import * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport type * as React from \"react\";\n\nfunction Collapsible({\n\t...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n\treturn <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n\t...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Trigger>) {\n\treturn (\n\t\t<CollapsiblePrimitive.Trigger data-slot=\"collapsible-trigger\" {...props} />\n\t);\n}\n\nfunction CollapsibleContent({\n\t...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Content>) {\n\treturn (\n\t\t<CollapsiblePrimitive.Content data-slot=\"collapsible-content\" {...props} />\n\t);\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"names":["useResourceOptions","automations","blocks","deployments","flows","workPools","workQueues","useQueries","buildListAutomationsQuery","buildListFilterBlockDocumentsQuery","buildFilterDeploymentsQuery","buildListFlowsQuery","buildFilterWorkPoolsQuery","buildFilterWorkQueuesQuery","useMemo","options","a","b","d","f","wp","wq","Collapsible","props","CollapsiblePrimitive.Root","CollapsibleTrigger","CollapsiblePrimitive.Trigger","CollapsibleContent","CollapsiblePrimitive.Content"],"mappings":"gNAsBO,MAAMA,EAAqB,IAA6C,CAC9E,KAAM,CACL,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,EACR,CAAE,KAAMC,CAAA,CAAW,EAChBC,EAAW,CACd,QAAS,CACRC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,EACAC,EAAA,CAA2B,CAC5B,CACA,EA8DD,MAAO,CAAE,gBA5DeC,EAAAA,QAAQ,IAAM,CACrC,MAAMC,EAA4B,CAAA,EAElC,UAAWC,KAAKf,GAAe,GAC9Bc,EAAQ,KAAK,CACZ,GAAIC,EAAE,GACN,KAAMA,EAAE,KACR,KAAM,aACN,WAAY,sBAAsBA,EAAE,EAAE,EAAA,CACtC,EAGF,UAAWC,KAAKf,GAAU,GACzBa,EAAQ,KAAK,CACZ,GAAIE,EAAE,GACN,KAAMA,EAAE,MAAQ,GAChB,KAAM,QACN,WAAY,0BAA0BA,EAAE,EAAE,EAAA,CAC1C,EAGF,UAAWC,KAAKf,GAAe,GAC9BY,EAAQ,KAAK,CACZ,GAAIG,EAAE,GACN,KAAMA,EAAE,KACR,KAAM,aACN,WAAY,sBAAsBA,EAAE,EAAE,EAAA,CACtC,EAGF,UAAWC,KAAKf,GAAS,GACxBW,EAAQ,KAAK,CACZ,GAAII,EAAE,GACN,KAAMA,EAAE,KACR,KAAM,OACN,WAAY,gBAAgBA,EAAE,EAAE,EAAA,CAChC,EAGF,UAAWC,KAAMf,GAAa,GAC7BU,EA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