prefect 3.6.14.dev6__py3-none-any.whl → 3.6.15__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.
- prefect/_build_info.py +3 -3
- prefect/events/clients.py +40 -21
- prefect/server/api/concurrency_limits_v2.py +5 -3
- prefect/server/ui-v2/assets/{artifact-card-fXxwNG3f.js → artifact-card-BBzQR-Cj.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-fXxwNG3f.js.map → artifact-card-BBzQR-Cj.js.map} +1 -1
- prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js +2 -0
- prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js.map +1 -0
- prefect/server/ui-v2/assets/{automation-wizard-bDZICLpV.js → automation-wizard-EYSfXlQ7.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-bDZICLpV.js.map → automation-wizard-EYSfXlQ7.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation._id-CmDL_Eta.js → automation._id-Dn7jABys.js} +2 -2
- prefect/server/ui-v2/assets/{automation._id-CmDL_Eta.js.map → automation._id-Dn7jABys.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-DY7_SAuk.js → automation_._id.edit-COrqswD3.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-DY7_SAuk.js.map → automation_._id.edit-COrqswD3.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-CgxOgR53.js → automations-header-DN_dmMXW.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-CgxOgR53.js.map → automations-header-DN_dmMXW.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-DilLn1Ul.js → base-job-template-form-section-De2ACYbw.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-DilLn1Ul.js.map → base-job-template-form-section-De2ACYbw.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-Cx4npO8Y.js → block-type-details-Cklc7TkK.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-Cx4npO8Y.js.map → block-type-details-Cklc7TkK.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js +2 -0
- prefect/server/ui-v2/assets/{block-type-logo-FrtMLMYr.js.map → block-type-logo-Cbpfxded.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-CWi9g5N3.js → block._id-tuz1Bcj2.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-CWi9g5N3.js.map → block._id-tuz1Bcj2.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-wf0QVPUL.js → block_._id.edit-CFEYhF5R.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-wf0QVPUL.js.map → block_._id.edit-CFEYhF5R.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-Iv1gLDUd.js → catalog-CCPRo7nY.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-Iv1gLDUd.js.map → catalog-CCPRo7nY.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug-DEHFXZzp.js → catalog_._slug-Bl2J2oI3.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug-DEHFXZzp.js.map → catalog_._slug-Bl2J2oI3.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-C-vFPUOy.js → catalog_._slug_.create-9UD_SxDN.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-C-vFPUOy.js.map → catalog_._slug_.create-9UD_SxDN.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-BlEqjqQu.js → collapsible-BVQTBG_U.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-BlEqjqQu.js.map → collapsible-BVQTBG_U.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-VfgyonlO.js → concurrency-limit._id-CsgRxA0a.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-VfgyonlO.js.map → concurrency-limit._id-CsgRxA0a.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-CC32TiFK.js → create-BycfZHGQ.js} +2 -2
- prefect/server/ui-v2/assets/{create-CC32TiFK.js.map → create-BycfZHGQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-fSiDZ1kD.js → create-D--LHaji.js} +2 -2
- prefect/server/ui-v2/assets/{create-fSiDZ1kD.js.map → create-D--LHaji.js.map} +1 -1
- prefect/server/ui-v2/assets/{data-table-B2NqBPUR.js → data-table-rlbkLcrY.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-B2NqBPUR.js.map → data-table-rlbkLcrY.js.map} +1 -1
- prefect/server/ui-v2/assets/delete-confirmation-dialog-DHkm2p8m.js +2 -0
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-jlBI67Pk.js.map → delete-confirmation-dialog-DHkm2p8m.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-C203ndcC.js → deployment-action-header-D5GOooPm.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-C203ndcC.js.map → deployment-action-header-D5GOooPm.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-DB4i73UE.js → deployment-form-wfg6HeAJ.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-DB4i73UE.js.map → deployment-form-wfg6HeAJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-UZYTtmnK.js → deployment-links-6iugOgDh.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-UZYTtmnK.js.map → deployment-links-6iugOgDh.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-Drmf70gG.js → deployment._id-Ci9zge5n.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-Drmf70gG.js.map → deployment._id-Ci9zge5n.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-Bk44iuUn.js → deployment._id-whsGcHdu.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-Bk44iuUn.js.map → deployment._id-whsGcHdu.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-D9ZWkh8H.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-aUHtHuNO.js.map → deployment_._id.duplicate-D9ZWkh8H.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-CS7sObzC.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-CPRKkA-W.js.map → deployment_._id.edit-CS7sObzC.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-C8EGDJeT.js → deployment_._id.run-g7SZuDFi.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-C8EGDJeT.js.map → deployment_._id.run-g7SZuDFi.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-CT6uZu-V.js → dropdown-menu-0atiOSFo.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-CT6uZu-V.js.map → dropdown-menu-0atiOSFo.js.map} +1 -1
- prefect/server/ui-v2/assets/{event-resource-display-DmCKu0PD.js → event-resource-display-DHiAb1Up.js} +2 -2
- prefect/server/ui-v2/assets/{event-resource-display-DmCKu0PD.js.map → event-resource-display-DHiAb1Up.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-DqO9viGu.js → event._eventDate._eventId-D7Twzb22.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-DqO9viGu.js.map → event._eventDate._eventId-D7Twzb22.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run-graph-BhzuSJLm.js +2 -0
- prefect/server/ui-v2/assets/{flow-run-graph-CIvkp1kl.js.map → flow-run-graph-BhzuSJLm.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-DyUEsBSd.js → flow-run._id-CqpH6bvx.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-DyUEsBSd.js.map → flow-run._id-CqpH6bvx.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js +4 -0
- prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-xahYswsG.js → flow-run._id-lIIQBD7H.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-xahYswsG.js.map → flow-run._id-lIIQBD7H.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination--FfnMca3.js → flow-runs-pagination-BATUweRV.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination--FfnMca3.js.map → flow-runs-pagination-BATUweRV.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow._id-C_ho4p55.js → flow._id-BdQGWPKP.js} +2 -2
- prefect/server/ui-v2/assets/{flow._id-C_ho4p55.js.map → flow._id-BdQGWPKP.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-CxD6-5Qf.js → form-DLrbC7rV.js} +2 -2
- prefect/server/ui-v2/assets/{form-CxD6-5Qf.js.map → form-DLrbC7rV.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-CYjjmMrB.js → header-BTAWyeXv.js} +2 -2
- prefect/server/ui-v2/assets/{header-CYjjmMrB.js.map → header-BTAWyeXv.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-Cjet3B6Z.js → header-ChFAx5uR.js} +2 -2
- prefect/server/ui-v2/assets/{header-Cjet3B6Z.js.map → header-ChFAx5uR.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-iN9gVtk7.js → header-CyQqOj1w.js} +2 -2
- prefect/server/ui-v2/assets/{header-iN9gVtk7.js.map → header-CyQqOj1w.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-C2ayqOiQ.js → index-7i4X9TeK.js} +2 -2
- prefect/server/ui-v2/assets/{index-C2ayqOiQ.js.map → index-7i4X9TeK.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-ltOkPb3X.js → index-BaWDC4da.js} +2 -2
- prefect/server/ui-v2/assets/{index-ltOkPb3X.js.map → index-BaWDC4da.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-d9_i_klL.js → index-BkiGTHwU.js} +2 -2
- prefect/server/ui-v2/assets/{index-d9_i_klL.js.map → index-BkiGTHwU.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-B5eJQPOP.js → index-Btb_-PDp.js} +2 -2
- prefect/server/ui-v2/assets/{index-B5eJQPOP.js.map → index-Btb_-PDp.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Cwd5Gvad.js → index-BwCLKpNb.js} +2 -2
- prefect/server/ui-v2/assets/{index-Cwd5Gvad.js.map → index-BwCLKpNb.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CT2kL3dS.js → index-CHf6xi9j.js} +2 -2
- prefect/server/ui-v2/assets/{index-CT2kL3dS.js.map → index-CHf6xi9j.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DQOPH4Rq.js → index-CKGj5lSu.js} +2 -2
- prefect/server/ui-v2/assets/{index-DQOPH4Rq.js.map → index-CKGj5lSu.js.map} +1 -1
- prefect/server/ui-v2/assets/index-COouj_0-.css +1 -0
- prefect/server/ui-v2/assets/{index-D0ANIqVp.js → index-CQnWiUE5.js} +2 -2
- prefect/server/ui-v2/assets/{index-D0ANIqVp.js.map → index-CQnWiUE5.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D4df3B9r.js → index-CiSFHkhI.js} +2 -2
- prefect/server/ui-v2/assets/{index-D4df3B9r.js.map → index-CiSFHkhI.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CSQa2wYx.js → index-CnlN-VC_.js} +2 -2
- prefect/server/ui-v2/assets/{index-CSQa2wYx.js.map → index-CnlN-VC_.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BfXKkd3I.js → index-CxUfZRkN.js} +2 -2
- prefect/server/ui-v2/assets/{index-BfXKkd3I.js.map → index-CxUfZRkN.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DI-aZXNg.js → index-D5RT-SAp.js} +2 -2
- prefect/server/ui-v2/assets/{index-DI-aZXNg.js.map → index-D5RT-SAp.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CTeNzxT9.js → index-DATPYZfT.js} +2 -2
- prefect/server/ui-v2/assets/{index-CTeNzxT9.js.map → index-DATPYZfT.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CfMaY6sy.js → index-DNh9ZBy4.js} +2 -2
- prefect/server/ui-v2/assets/{index-CfMaY6sy.js.map → index-DNh9ZBy4.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-C3A0XavU.js → index-DQGif3jm.js} +2 -2
- prefect/server/ui-v2/assets/{index-C3A0XavU.js.map → index-DQGif3jm.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BF3HB5BS.js → index-Eqdr6Ff7.js} +2 -2
- prefect/server/ui-v2/assets/{index-BF3HB5BS.js.map → index-Eqdr6Ff7.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D8SbV2Tp.js → index-VH4TnZ4e.js} +2 -2
- prefect/server/ui-v2/assets/{index-D8SbV2Tp.js.map → index-VH4TnZ4e.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-0opjCZAR.js → index-kP_I5Qfd.js} +2 -2
- prefect/server/ui-v2/assets/{index-0opjCZAR.js.map → index-kP_I5Qfd.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D-yYhKPg.js → index-lyQav_XM.js} +2 -2
- prefect/server/ui-v2/assets/{index-D-yYhKPg.js.map → index-lyQav_XM.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-nxDkMXcY.js → index-m48E4KcG.js} +13 -13
- prefect/server/ui-v2/assets/index-m48E4KcG.js.map +1 -0
- prefect/server/ui-v2/assets/{json-input-BGfZindW.js → json-input-Ba-BeBcw.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-BGfZindW.js.map → json-input-Ba-BeBcw.js.map} +1 -1
- prefect/server/ui-v2/assets/key-value-DkSKn6jE.js +2 -0
- prefect/server/ui-v2/assets/key-value-DkSKn6jE.js.map +1 -0
- prefect/server/ui-v2/assets/{key._key-mnO405kp.js → key._key-Cjx57ymg.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-mnO405kp.js.map → key._key-Cjx57ymg.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-CLclUkkd.js → lazy-markdown-Du2Xu3Yp.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-CLclUkkd.js.map → lazy-markdown-Du2Xu3Yp.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-ST_-h2GY.js → login-DxMF9Jvj.js} +2 -2
- prefect/server/ui-v2/assets/{login-ST_-h2GY.js.map → login-DxMF9Jvj.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-DemuemAs.js → markdown-input-DPi8zyRr.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-DemuemAs.js.map → markdown-input-DPi8zyRr.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-BUllaeTS.js → python-example-snippet-DfCFYPN_.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-BUllaeTS.js.map → python-example-snippet-DfCFYPN_.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-DTpMdYLs.js → python-input-mr6GD840.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-DTpMdYLs.js.map → python-input-mr6GD840.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-CJhtPDwC.js → radio-group-Co3cN0Kv.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-CJhtPDwC.js.map → radio-group-Co3cN0Kv.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-D0wedcpP.js → route-error-state-DnBaNT2T.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-D0wedcpP.js.map → route-error-state-DnBaNT2T.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-Cx-6swYW.js → schema-form-CWDHSME9.js} +2 -2
- prefect/server/ui-v2/assets/{schema-form-Cx-6swYW.js.map → schema-form-CWDHSME9.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-CZkUje5U.js → schema-form-input-string-format-datetime-BSWlW_aQ.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-CZkUje5U.js.map → schema-form-input-string-format-datetime-BSWlW_aQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-nHtCkknH.js → settings-DU5y6tJE.js} +2 -2
- prefect/server/ui-v2/assets/{settings-nHtCkknH.js.map → settings-DU5y6tJE.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-QjOHFWPI.js → sort-filter-DpuWNkQo.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-QjOHFWPI.js.map → sort-filter-DpuWNkQo.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-Bx2Ol4j-.js → table-bBL6C0ZK.js} +2 -2
- prefect/server/ui-v2/assets/{table-Bx2Ol4j-.js.map → table-bBL6C0ZK.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-C7cxdTyV.js → tags-input-BLPMVWpZ.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-C7cxdTyV.js.map → tags-input-BLPMVWpZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CG2F0Ufy.js → task-run-concurrency-limits-reset-dialog-S69sih55.js} +2 -2
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CG2F0Ufy.js.map → task-run-concurrency-limits-reset-dialog-S69sih55.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-CapS5wad.js → task-run._id-B_tIDm4K.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-CapS5wad.js.map → task-run._id-B_tIDm4K.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-CevQxX-E.js → task-run._id-Dl3Azs8t.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-CevQxX-E.js.map → task-run._id-Dl3Azs8t.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-runs-pagination-Dbwa2yPe.js → task-runs-pagination-VdR-LO4r.js} +2 -2
- prefect/server/ui-v2/assets/{task-runs-pagination-Dbwa2yPe.js.map → task-runs-pagination-VdR-LO4r.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-vy4DM6KG.js → textarea-B3_TtPRi.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-vy4DM6KG.js.map → textarea-B3_TtPRi.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-DDUTUy-L.js → timezone-select-BuPYznge.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-DDUTUy-L.js.map → timezone-select-BuPYznge.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-Dx_fy9WJ.js → toggle-group-Cn07UIim.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-Dx_fy9WJ.js.map → toggle-group-Cn07UIim.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-ClQsotEa.js → use-delete-automation-confirmation-dialog-DpdsLH4t.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-ClQsotEa.js.map → use-delete-automation-confirmation-dialog-DpdsLH4t.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DM0Dy1PL.js → use-delete-block-document-confirmation-dialog-Cq5nGhzr.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DM0Dy1PL.js.map → use-delete-block-document-confirmation-dialog-Cq5nGhzr.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-UhMaQqzZ.js → use-flow-runs-selected-rows-DmQSWBTu.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-UhMaQqzZ.js.map → use-flow-runs-selected-rows-DmQSWBTu.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-P8C-ARMZ.js → use-get-artifacts-flow-task-runs-DTwcWiqW.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-P8C-ARMZ.js.map → use-get-artifacts-flow-task-runs-DTwcWiqW.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-DT0VEa9Z.js → use-quick-run-CPempwLh.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-DT0VEa9Z.js.map → use-quick-run-CPempwLh.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-state-favicon-DfEAuEQL.js → use-state-favicon-M09DmrNy.js} +2 -2
- prefect/server/ui-v2/assets/{use-state-favicon-DfEAuEQL.js.map → use-state-favicon-M09DmrNy.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-1OG0a_eo.js → use-stepper-CDucnvzp.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-1OG0a_eo.js.map → use-stepper-CDucnvzp.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-DabzLyXd.js → utilities-BRCNRcQl.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-DabzLyXd.js.map → utilities-BRCNRcQl.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-CTTGgdIN.js → work-pool-filter-C2tpSS-w.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-CTTGgdIN.js.map → work-pool-filter-C2tpSS-w.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-B9KQxNdY.js → work-pool-queue-toggle-BQ9b-Wxy.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-B9KQxNdY.js.map → work-pool-queue-toggle-BQ9b-Wxy.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-CGqG95Pv.js → work-pool._workPoolName-C_LiL3SE.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-CGqG95Pv.js.map → work-pool._workPoolName-C_LiL3SE.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CcFrethu.js → work-pool_._workPoolName.edit-DBHlrVVx.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CcFrethu.js.map → work-pool_._workPoolName.edit-DBHlrVVx.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CwPnpSI9.js → work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CwPnpSI9.js.map → work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-Bix0rRM1.js → work-queue-icon-text-D4BWBVDN.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-Bix0rRM1.js.map → work-queue-icon-text-D4BWBVDN.js.map} +1 -1
- prefect/server/ui-v2/index.html +2 -2
- prefect/testing/fixtures.py +14 -13
- {prefect-3.6.14.dev6.dist-info → prefect-3.6.15.dist-info}/METADATA +2 -2
- {prefect-3.6.14.dev6.dist-info → prefect-3.6.15.dist-info}/RECORD +207 -205
- prefect/server/ui-v2/assets/artifact._id-BIyzb0Jb.js +0 -2
- prefect/server/ui-v2/assets/artifact._id-BIyzb0Jb.js.map +0 -1
- prefect/server/ui-v2/assets/block-type-logo-FrtMLMYr.js +0 -2
- prefect/server/ui-v2/assets/delete-confirmation-dialog-jlBI67Pk.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-aUHtHuNO.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-CPRKkA-W.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-CIvkp1kl.js +0 -2
- prefect/server/ui-v2/assets/flow-run._id-BT3wztDF.js +0 -4
- prefect/server/ui-v2/assets/flow-run._id-BT3wztDF.js.map +0 -1
- prefect/server/ui-v2/assets/index-CYc_PWA3.css +0 -1
- prefect/server/ui-v2/assets/index-nxDkMXcY.js.map +0 -1
- {prefect-3.6.14.dev6.dist-info → prefect-3.6.15.dist-info}/WHEEL +0 -0
- {prefect-3.6.14.dev6.dist-info → prefect-3.6.15.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.14.dev6.dist-info → prefect-3.6.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as f,j as r,s as J}from"./vendor-tanstack-BcZfOOfy.js";import{u as Pe}from"./use-debounce-callback-CSs1BjLI.js";import{bH as Z,C as ee,q as L,I as ne,ac as te,ad as re,ae as se,af as oe,ah as ie,ag as ae,aj as z,bp as De,ai as X,dd as Fe,dh as Ee,b5 as H,G as Ae,p as W,L as ce,a6 as Ve,cH as Me,cI as Te,aW as $e,at as Ke,cJ as Be,cK as Le,i as Ue}from"./index-nxDkMXcY.js";import{D as Je,a as ze,b as Re,d as C,e as We}from"./dropdown-menu-CT6uZu-V.js";import{m as U,b as D,i as fe,p as Ge,g as qe,c as He,C as Qe,d as Ye,e as me,D as Xe,f as Ze,S as en,v as nn,s as tn,K as rn,P as sn,h as on,B as an,j as cn,k as ln}from"./schema-form-input-string-format-datetime-CZkUje5U.js";import{H as un,a4 as dn,e as fn,f as he}from"./vendor-date-wwuDAncJ.js";import{T as mn,a as hn}from"./toggle-group-Dx_fy9WJ.js";import{B as xn}from"./block-type-logo-FrtMLMYr.js";import{T as jn}from"./textarea-vy4DM6KG.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./zod-Cuos7J7w.js";import"./timezone-select-DDUTUy-L.js";import"./form-CxD6-5Qf.js";const pn=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bn=Z("eye-off",pn);const gn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],yn=Z("eye",gn);const Sn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],_n=Z("grip-vertical",Sn);function k(e){return e!==void 0}function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!un(e)}function O(e){return Array.isArray(e)}function vn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function V(e){return"$ref"in e}function ge(e){return"anyOf"in e&&k(e.anyOf)}function wn(e){return"oneOf"in e&&k(e.oneOf)}function kn(e){return"allOf"in e&&k(e.allOf)}function In(e){return"items"in e&&k(e.items)}function Nn(e){return"definitions"in e&&N(e.definitions)}function M(e,n){if(Nn(e)){const t=n.replace("#/definitions/",""),s=e.definitions?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}if("$defs"in e&&N(e.$defs)){const t=n.replace("#/$defs/",""),s=e.$defs?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}throw new Error("Schema does not contain definitions")}function ye(e,n){if(V(e)&&typeof e.$ref=="string"){const{$ref:t,...s}=e;return U({},M(n,t),s)}return e}function Cn({property:e,value:n,onValueChange:t,errors:s,id:o}){const{schema:i}=D(),c=f.useMemo(()=>{const{allOf:a,...d}=e,u=a.reduce((h,p)=>{if(V(p)){const l=M(i,p.$ref);return U({},h,l)}return U({},h,p)},{});return U({},u,d)},[e,i]);return r.jsx(ue,{value:n,onValueChange:t,errors:s,property:c,id:o})}function On({value:e,property:n,schema:t}){const s=k(e)?e:n.default;if(!k(s))return 0;const o=Pn(n,t);switch(typeof s){case"string":return o.findIndex(i=>i.type==="string");case"number":return o.findIndex(i=>i.type==="number"||i.type==="integer");case"boolean":return o.findIndex(i=>i.type==="boolean");case"object":return Dn(s,o);default:return-1}}function Pn(e,n){return e.anyOf?e.anyOf.map(t=>V(t)?M(n,t.$ref):t):[]}function Dn(e,n){return N(e)?Fn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Fn(e,n){if(vn(e))return n.findIndex(i=>i.type==="object");const t=Object.keys(e),[s,o]=n.reduce(([i,c],a,d)=>{if(!("properties"in a)||!a.properties)return[i,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[d,h]:[i,c]},[0,0]);return o===0?-1:s}const En={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function An(e){if(e.type&&typeof e.type=="string")return En[e.type]}function le(e,n){if(V(e)){const s=M(n,e.$ref);return le(s,n)}const t=An(e)??"Field";return e.title??e.format??t}function Q({value:e,property:n,onValueChange:t,errors:s}){const{schema:o}=D(),[i,c]=f.useState(On({value:e,property:n,schema:o})),a=f.useRef(new Map);function d(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(i,e),c(h),t(a.current.get(h))}return r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(mn,{size:"sm",variant:"outline",type:"single",value:i.toString(),onValueChange:d,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=le(u,o);return r.jsx(hn,{value:h.toString(),children:p},p)})}),r.jsx(ee,{className:"p-2",children:r.jsx(Ce,{value:e,property:n.anyOf[i],onValueChange:t,errors:s,showLabel:!1,nested:!1,required:!1})})]})}const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function Vn(e,n=0){return(g[e[n+0]]+g[e[n+1]]+g[e[n+2]]+g[e[n+3]]+"-"+g[e[n+4]]+g[e[n+5]]+"-"+g[e[n+6]]+g[e[n+7]]+"-"+g[e[n+8]]+g[e[n+9]]+"-"+g[e[n+10]]+g[e[n+11]]+g[e[n+12]]+g[e[n+13]]+g[e[n+14]]+g[e[n+15]]).toLowerCase()}let Y;const Mn=new Uint8Array(16);function Tn(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(Mn)}const $n=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xe={randomUUID:$n};function Kn(e,n,t){e=e||{};const s=e.random??e.rng?.()??Tn();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Vn(s)}function je(e,n,t){return xe.randomUUID&&!e?xe.randomUUID():Kn(e)}function Bn(e){return typeof e=="string"}function Se(e){return N(e)&&"property"in e}function _e(e){return N(e)&&"index"in e}function ve({errors:e}){const n=f.useMemo(()=>e.filter(t=>Bn(t)),[e]);return n.length===0?null:n.length===1?r.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):r.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>r.jsx("li",{children:t},t))})}function we(e){return B(e)?e.__prefect_kind:null}function B(e,n){return N(e)&&fe(e.__prefect_kind)?fe(n)?e.__prefect_kind===n:!0:!1}function Ln({value:e,property:n,schema:t,to:s}){const o=we(e);try{switch(o){case"json":return Un({json:e,property:n,schema:t,to:s});case"jinja":return Jn({jinja:e,property:n,schema:t,to:s});case"workspace_variable":return zn({workspaceVariable:e,to:s});case null:return Rn({value:e,property:n,schema:t,to:s});default:throw new Error(`Unknown prefect kind value: ${o}`)}}catch(i){console.error(i);return}}function Un({json:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e.value};case"json":return e;case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.value===void 0)return;try{const o=JSON.parse(e.value);return G({value:o,property:n,schema:t})}catch{throw new ke("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function Jn({jinja:e,property:n,schema:t,to:s}){switch(s){case"jinja":return e;case"json":return{__prefect_kind:"json",value:e.template};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.template===void 0)return;try{const o=JSON.parse(e.template);return G({value:o,property:n,schema:t})}catch{throw new ke("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function zn({workspaceVariable:e,to:n}){switch(n){case"workspace_variable":return e;case"jinja":return{__prefect_kind:"jinja",template:void 0};case"json":return{__prefect_kind:"json",value:void 0};case null:return;default:throw new Error(`mapSchemaValueWorkspaceVariable missing case for kind: ${n}`)}}function Rn({value:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e===void 0?void 0:JSON.stringify(e,null,2)};case"json":return{__prefect_kind:"json",value:e===void 0?void 0:JSON.stringify(e,null,2)};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:return G({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${s}`)}}function G({value:e,property:n,schema:t}){return O(n)?n.map(o=>R({value:e,property:o,schema:t})).find(o=>o!==void 0):R({value:e,property:n,schema:t})}function R({value:e,property:n,schema:t}){const s=ye(n,t);if(ge(s))return G({value:e,property:s.anyOf,schema:t});switch(s.type){case"null":return null;case"string":return typeof e=="string"?e:void 0;case"boolean":return typeof e=="boolean"?e:void 0;case"number":return typeof e=="number"?e:void 0;case"integer":return typeof e=="number"?Math.round(e):void 0;case"array":return Wn({value:e,property:s,schema:t});case"object":return Gn({value:e,property:s,schema:t});default:if(O(s.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${s.type}`)}}function Wn({value:e,property:n,schema:t}){return O(e)?[...e].map(o=>R({value:o,property:n,schema:t})):void 0}function Gn({value:e,property:n,schema:t}){if(!N(e))return;if(n.properties===void 0)return e;const s={...e};for(const[o,i]of Object.entries(n.properties))R({value:e[o],property:i,schema:t})===void 0&&delete s[o];return s}class ke extends Error{constructor(n,t){super(`Unable to convert prefect kind value from "${n}" to "${t??"null"}"`)}}const Ie=({value:e,onValueChange:n,property:t,children:s,disableKinds:o,defaultValue:i,hasDefaultValue:c})=>{const{schema:a,kinds:d}=D(),[u,h]=f.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(i);function l(){c&&n(i)}function x(v){const S=Ln({value:e,property:t,schema:a,to:v});n(S)}const y=f.useMemo(()=>{const v=we(e);return Ge.filter(S=>S!==v&&(d.includes(S)||S===null)&&!o)},[e,d,o]);return r.jsxs(Je,{open:u,onOpenChange:h,children:[r.jsx(ze,{asChild:!0,children:r.jsxs(L,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[r.jsx("span",{className:"sr-only",children:"Open menu"}),r.jsx(ne,{id:"MoreVertical",className:"size-4"})]})}),r.jsxs(Re,{align:"end",children:[y.map(v=>r.jsx(C,{onClick:()=>x(v),children:qe(v)},v)),c&&r.jsx(C,{onClick:l,disabled:p,children:"Use default value"}),r.jsx(We,{}),s]})]})};function qn({itemKey:e,items:n,value:t,onValueChange:s,errors:o,onDelete:i,first:c,last:a,canMove:d,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=D(),y=f.useId(),{attributes:v,listeners:S,setNodeRef:I,transform:F,transition:E,isDragging:$}=He({id:e,disabled:!d}),K={transform:Qe.Transform.toString(F),transition:E,opacity:$?.5:1},w=f.useMemo(()=>O(n)?{anyOf:n}:V(n)?M(x,n.$ref):n,[n,x]);return r.jsxs("div",{ref:I,style:K,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[d?r.jsx("button",{type:"button",className:"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none","aria-label":"Drag to reorder",...v,...S,children:r.jsx(_n,{className:"h-5 w-5"})}):r.jsx("div",{className:"w-5"}),r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(ue,{value:t,onValueChange:s,property:w,errors:o,id:y}),r.jsx(ve,{errors:o})]}),r.jsxs(Ie,{value:t,onValueChange:s,property:n,children:[r.jsx(C,{onClick:i,children:"Delete"}),d&&!c&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:p,children:"Move to top"}),r.jsx(C,{onClick:u,children:"Move up"})]}),d&&!a&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:h,children:"Move down"}),r.jsx(C,{onClick:l,children:"Move to bottom"})]})]})]})}function Hn({property:e,values:n,onValuesChange:t,errors:s}){const o=n===void 0||n.length===0,i=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=Ye(me(sn),me(rn,{coordinateGetter:tn})),[d,u]=f.useState(n?.map(m=>({key:je(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return s.filter(b=>_e(b)&&b.index===m).flatMap(b=>b.errors)}function l(m){return m===0}function x(m){return m===(n?.length??0)-1}function y(m){return!(O(e.prefixItems)&&m<e.prefixItems.length)}function v(m,b){u(d.map(j=>j.key===m?{...j,value:b}:j))}function S(){const m=[...d,{key:je(),value:void 0}];u(m),t(m.map(({value:b})=>b))}function I(m,b){const j=[...d];j.splice(b,0,j.splice(m,1)[0]),u(j),t(j.map(({value:A})=>A))}function F(m){I(m,0)}function E(m){I(m,d.length-1)}function $(m){const b=d.filter(j=>j.key!==m);u(b),t(b.map(({value:j})=>j))}function K(m){const{active:b,over:j}=m;if(j&&b.id!==j.id){const A=d.findIndex(q=>q.key===b.id),de=d.findIndex(q=>q.key===j.id);A!==-1&&de!==-1&&I(A,de)}}const w=d.slice(c).map(m=>m.key);return r.jsxs(ee,{className:"flex flex-col gap-2 p-2",children:[o&&r.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),r.jsx(Xe,{sensors:a,collisionDetection:Ze,onDragEnd:K,children:r.jsx(en,{items:w,strategy:nn,children:d?.map(({key:m,value:b},j)=>r.jsx(qn,{itemKey:m,items:h(j),value:b,onValueChange:A=>v(m,A),errors:p(j),onDelete:()=>$(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>I(j,j-1),moveDown:()=>I(j,j+1),moveToTop:()=>F(j),moveToBottom:()=>E(j)},m))})}),i&&r.jsx("div",{className:"flex justify-end",children:r.jsx(L,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!i&&r.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function T({property:e,id:n,...t}){const[s,o]=f.useState(""),i=f.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(s.toLowerCase()))),[e.enum,s]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function d(l){const x=i[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){o("");const x=i[l];return t.multiple?p(x):h(x)}function h(l){if(t.multiple)throw new Error("onSingleSelect called on multiple value input");t.onValueChange(l)}function p(l){if(!t.multiple)throw new Error("onMultipleSelect called on single value input");if(!t.values){t.onValuesChange([l]);return}if(t.values?.includes(l)){t.onValuesChange(t.values.filter(x=>x!==l));return}t.onValuesChange([...t.values,l])}return r.jsxs(te,{children:[r.jsx(re,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),r.jsxs(se,{children:[r.jsx(oe,{value:s,onValueChange:o,placeholder:"Search..."}),r.jsx(ie,{children:"No values found"}),r.jsx(ae,{children:Object.entries(i).map(([l,x])=>r.jsx(z,{value:l,onSelect:u,selected:d(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>on(typeof n))}function _(e,n){if(typeof e==typeof n())return e}function Qn(e){if(N(e))return e}function Yn(e){return _(e,String)??_(e,Number)??_(e,Boolean)}function Ne(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>_(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>_(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>_(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>_(t,String)??_(t,Number)??_(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function Xn({values:e,property:n,onValuesChange:t,errors:s,id:o}){const{schema:i}=D();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(In(n)&&N(n.items)){let a=n.items;if(V(a)&&(a=M(i,a.$ref)),P(a)){const d={...n,...a};return r.jsx(T,{multiple:!0,values:Ne(e,"primitive"),property:d,onValuesChange:c,id:o})}}return r.jsx(Hn,{property:n,values:e,onValuesChange:c,errors:s})}const Zn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>r.jsx(f.Suspense,{children:r.jsx(et,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})}),et=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>{const[o,i]=f.useState(""),c=f.useDeferredValue(o),{data:a}=J(De({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_types:{slug:{any_:[e]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1},...c?{name:{like_:c}}:{}},limit:50})),d=f.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=f.useMemo(()=>a.find(h=>h.id===n),[a,n]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),r.jsxs(se,{children:[r.jsx(oe,{value:o,onValueChange:i,placeholder:"Search for a block..."}),r.jsx(ie,{children:"No block found"}),r.jsxs(ae,{children:[r.jsx(X,{children:d.map(h=>r.jsx(z,{selected:n===h.id,onSelect:p=>{t(p),i("")},value:h.id,children:h.name},h.id))}),s&&r.jsx(X,{children:r.jsxs(z,{onSelect:()=>{s(),i("")},value:"__create_new__",closeOnSelect:!0,children:[r.jsx(ne,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function nt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){return r.jsx(f.Suspense,{fallback:r.jsx(tt,{}),children:r.jsx(rt,{value:e,onValueChange:n,blockTypeSlug:t,id:s})})}function tt(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(H,{className:"size-8 rounded"}),r.jsx(H,{className:"h-9 flex-1"}),r.jsx(H,{className:"h-9 w-20"})]})}function rt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){const[o,i]=f.useState(!1),{data:c}=J(Fe(t)),{data:a}=J(Ee({block_types:{slug:{any_:[t]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1}},include_secrets:!1,sort:"BLOCK_TYPE_AND_NAME_ASC",offset:0})),d=a>0,u=e?.$ref,h=l=>{n(l?{$ref:l}:void 0)},p=l=>{n({$ref:l})};return r.jsxs("div",{id:s,className:"flex items-center gap-2",children:[r.jsx(xn,{logoUrl:c.logo_url,alt:c.name}),d&&r.jsx("div",{className:"flex-1",children:r.jsx(Zn,{blockTypeSlug:t,selectedBlockDocumentId:u,onSelect:h,onCreateNew:()=>i(!0)})}),r.jsxs(L,{type:"button",variant:"outline",onClick:()=>i(!0),children:["Add",r.jsx(ne,{id:"Plus",className:"ml-2 size-4"})]}),r.jsx(an,{open:o,onOpenChange:i,blockTypeSlug:t,onCreated:p})]})}function st({value:e,onValueChange:n,property:t,id:s}){function o(i){n(_(i,Boolean))}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s}):r.jsx(Ae,{checked:e,onCheckedChange:o,id:s})}function ot({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:i=>o(i.target.value),id:s})}function it(){return r.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function at({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:i=>o(i.target.value),id:s})}function ct({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"jinja",template:o||void 0})};return r.jsx(ce,{value:e.template,onChange:s,id:t})}function lt({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"json",value:o||void 0})};return r.jsx(ce,{value:e.value,onChange:s,id:t})}const ut=({selectedVariableName:e,onSelect:n})=>r.jsx(f.Suspense,{children:r.jsx(dt,{selectedVariableName:e,onSelect:n})}),dt=({selectedVariableName:e,onSelect:n})=>{const[t,s]=f.useState(""),o=f.useDeferredValue(t),{data:i}=J(Ve({offset:0,sort:"NAME_ASC",variables:o?{operator:"and_",name:{like_:o}}:void 0,limit:50})),c=f.useMemo(()=>i.filter(a=>a.name.toLowerCase().includes(o.toLowerCase())),[i,o]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),r.jsxs(se,{children:[r.jsx(oe,{value:t,onValueChange:s,placeholder:"Search for a variable..."}),r.jsx(ie,{children:"No variable found"}),r.jsx(ae,{children:r.jsx(X,{children:c.map(a=>r.jsx(z,{selected:e===a.name,onSelect:d=>{n(d),s("")},value:a.name,children:a.name},a.id))})})]})]})};function ft({value:e,onValueChange:n,id:t}){const s=o=>{n({__prefect_kind:"workspace_variable",variable_name:o})};return r.jsx("div",{id:t,children:r.jsx(ut,{selectedVariableName:e.variable_name,onSelect:s})})}const pe="yyyy-MM-dd";function mt({value:e,onValueChange:n,id:t}){const s=e?dn(e,pe,fn()):void 0,[o,i]=f.useState(s);function c(a){i(a),n(a?he(a,pe):void 0)}return r.jsxs(Me,{children:[r.jsx(Te,{asChild:!0,children:r.jsxs(L,{variant:"outline",className:$e("justify-start text-left font-normal w-full",!o&&"text-muted-foreground"),id:t,children:[r.jsx(Ke,{className:"mr-2 h-4 w-4"}),o?he(o,"PPP"):r.jsx("span",{children:"Pick a date"})]})}),r.jsx(Be,{className:"w-auto p-0",children:r.jsx(Le,{mode:"single",selected:o,onSelect:c,required:!0,autoFocus:!0})})]})}function ht({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n(o||void 0)};return r.jsx(ce,{value:e,onChange:s,id:t})}function xt({value:e,onValueChange:n,id:t}){const[s,o]=f.useState(!1),i=c=>{n(c.target.value||void 0)};return r.jsxs("div",{className:"relative",children:[r.jsx(W,{id:t,type:s?"text":"password",value:e??"",onChange:i,autoComplete:"off",className:"pr-10"}),r.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>o(!s),"aria-label":s?"Hide password":"Show password",children:s?r.jsx(bn,{className:"h-4 w-4"}):r.jsx(yn,{className:"h-4 w-4"})})]})}function jt({value:e,onValueChange:n,id:t}){function s(o){const i=o.target.value;if(i===""){n(void 0);return}const c=Number(i);Number.isNaN(c)||n(String(c))}return r.jsx(W,{type:"number",value:e??"",onChange:s,id:t,placeholder:"Duration in seconds",min:0})}function pt({value:e,onValueChange:n,property:t,id:s}){function o(i){n(i||void 0)}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:o,id:s}):t.format==="date"?r.jsx(mt,{value:e,onValueChange:o,id:s}):t.format==="date-time"?r.jsx(cn,{value:e,onValueChange:o,id:s}):t.format==="json-string"?r.jsx(ht,{value:e,onValueChange:o,id:s}):t.format==="time-delta"?r.jsx(jt,{value:e,onValueChange:o,id:s}):t.format==="password"?r.jsx(xt,{value:e,onValueChange:o,id:s}):r.jsx(jn,{value:e??"",rows:1,className:"min-h-min",onChange:i=>o(i.target.value),id:s})}function bt({value:e,onValueChange:n,property:t,id:s}){return f.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?r.jsx(T,{multiple:!1,value:Yn(e),property:t,onValueChange:n,id:s}):null}function ue({value:e,onValueChange:n,errors:t,property:s,id:o,nested:i=!0}){if(B(e)){if(B(e,"json"))return r.jsx(lt,{value:e,onValueChange:n,id:o});if(B(e,"jinja"))return r.jsx(ct,{value:e,onValueChange:n,id:o});if(B(e,"workspace_variable"))return r.jsx(ft,{value:e,onValueChange:n,id:o});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("block_type_slug"in s){const c=s.block_type_slug;if(typeof c=="string")return r.jsx(nt,{value:e,onValueChange:n,blockTypeSlug:c,id:o})}if(ge(s))return r.jsx(Q,{value:e,property:s,onValueChange:n,errors:t});if(wn(s)){const c={...s,anyOf:s.oneOf};return r.jsx(Q,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(s.type)){const c={...s,anyOf:Object.values(s.type).map(a=>({type:a}))};return r.jsx(Q,{value:e,property:c,onValueChange:n,errors:t})}if(kn(s))return r.jsx(Cn,{value:e,onValueChange:n,errors:t,property:s,id:o});if(s.type==="string")return r.jsx(pt,{value:_(e,String),onValueChange:n,property:s,id:o});if(s.type==="integer")return r.jsx(ot,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="number")return r.jsx(at,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="boolean")return r.jsx(st,{value:_(e,Boolean),onValueChange:n,property:s,id:o});if(s.type==="object")return r.jsx(Oe,{values:Qn(e),property:s,onValuesChange:n,errors:t,nested:i});if(s.type==="array")return r.jsx(Xn,{values:Ne(e),property:s,onValuesChange:n,errors:t,id:o});if(s.type==="null")return r.jsx(it,{});if(s.type===void 0)return r.jsx(bt,{value:e,onValueChange:n,property:s,id:o});throw new Error(`Schema type not implemented: ${String(s.type)}`)}function be({property:e}){const n=f.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&r.jsx("p",{className:"text-sm text-gray-500",children:n})}function gt({property:e,required:n,id:t}){const{schema:s}=D(),o=f.useMemo(()=>{const i=le(e,s);return n?i:`${i} (Optional)`},[e,n,s]);return r.jsx(Ue,{htmlFor:t,children:o})}function Ce({property:e,value:n,onValueChange:t,required:s,errors:o,showLabel:i=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:d}=D(),u=f.useMemo(()=>ye(e,a),[e,a]),h=f.useMemo(()=>!k(u.type),[u.type]),p=f.useMemo(()=>o.filter(w=>Se(w)||_e(w)),[o]),[l,x]=f.useState(!1),[y,v]=f.useState(K),[S,I]=f.useState(!1),F=f.useId(),E=f.useCallback(w=>{v(w),t(w)},[t]),$=f.useCallback(()=>{const w=!S;I(w),t(w?void 0:y)},[S,t,y]);f.useEffect(()=>{l||d||(k(u.default)&&!k(n)&&t(u.default),x(!0))},[l,d,t,u.default,n]);function K(){if(k(n))return n;if(k(u.default)&&!d)return u.default}return r.jsxs("div",{className:"flex flex-col gap-2 group",children:[i&&r.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(gt,{property:u,required:s,id:F}),r.jsx(be,{property:u})]}),r.jsx("div",{className:"ml-auto",children:r.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:k(u.default),children:r.jsx(C,{onClick:$,children:S?"Include value":"Omit value"})})})]}),!i&&r.jsx(be,{property:u}),r.jsx("fieldset",{disabled:S,children:r.jsx(ue,{property:u,value:y,onValueChange:E,errors:p,id:F,nested:c})}),r.jsx(ve,{errors:o})]})}function yt(e,n){return(e.position??0)-(n.position??0)}function Oe({values:e,onValuesChange:n,property:t,errors:s,nested:o}){const i=f.useRef([]),c=Pe(f.useCallback(()=>{const l={...e};for(const{key:x,value:y}of i.current)l[x]=y,y===void 0&&delete l[x];if(i.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){i.current.push({key:l,value:x}),c()}function d(l){return e?.[l]}function u(l){return s.filter(Se).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=f.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>yt(l,x)),[t.properties]),p=r.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>r.jsx(Ce,{value:d(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return o?r.jsx(ee,{className:"p-2",children:p}):p}const St=({children:e,...n})=>r.jsx(ln.Provider,{value:n,children:e}),$t=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:s,onValuesChange:o,errors:i})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=f.useCallback(u=>{if(u===void 0){o({});return}o(u)},[o]),d={values:s,property:e,onValuesChange:a,errors:i};return r.jsx("div",{className:"flex flex-col gap-4",children:r.jsx(St,{...c,children:r.jsx(Oe,{...d,nested:!1})})})};export{$t as SchemaForm};
|
|
2
|
-
//# sourceMappingURL=schema-form-
|
|
1
|
+
import{r as f,j as r,s as J}from"./vendor-tanstack-BcZfOOfy.js";import{u as Pe}from"./use-debounce-callback-CSs1BjLI.js";import{bH as Z,C as ee,q as L,I as ne,ac as te,ad as re,ae as se,af as oe,ah as ie,ag as ae,aj as z,bp as De,ai as X,df as Fe,dj as Ee,b5 as Q,G as Ae,p as W,L as ce,a6 as Ve,cR as Me,cS as Te,aW as $e,at as Be,cT as Ke,cU as Le,i as Ue}from"./index-m48E4KcG.js";import{D as Je,a as ze,b as Re,d as C,e as We}from"./dropdown-menu-0atiOSFo.js";import{m as U,c as D,i as fe,p as Ge,g as qe,d as Qe,C as He,e as Ye,f as me,D as Xe,h as Ze,S as en,v as nn,s as tn,K as rn,P as sn,j as on,B as an,k as cn,l as ln}from"./schema-form-input-string-format-datetime-BSWlW_aQ.js";import{H as un,a4 as dn,e as fn,f as he}from"./vendor-date-wwuDAncJ.js";import{T as mn,a as hn}from"./toggle-group-Cn07UIim.js";import{B as xn}from"./block-type-logo-Cbpfxded.js";import{T as jn}from"./textarea-B3_TtPRi.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./zod-Cuos7J7w.js";import"./timezone-select-BuPYznge.js";import"./form-DLrbC7rV.js";const pn=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bn=Z("eye-off",pn);const gn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],yn=Z("eye",gn);const Sn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],_n=Z("grip-vertical",Sn);function k(e){return e!==void 0}function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!un(e)}function O(e){return Array.isArray(e)}function vn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function V(e){return"$ref"in e}function ge(e){return"anyOf"in e&&k(e.anyOf)}function wn(e){return"oneOf"in e&&k(e.oneOf)}function kn(e){return"allOf"in e&&k(e.allOf)}function In(e){return"items"in e&&k(e.items)}function Nn(e){return"definitions"in e&&N(e.definitions)}function M(e,n){if(Nn(e)){const t=n.replace("#/definitions/",""),s=e.definitions?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}if("$defs"in e&&N(e.$defs)){const t=n.replace("#/$defs/",""),s=e.$defs?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}throw new Error("Schema does not contain definitions")}function ye(e,n){if(V(e)&&typeof e.$ref=="string"){const{$ref:t,...s}=e;return U({},M(n,t),s)}return e}function Cn({property:e,value:n,onValueChange:t,errors:s,id:o}){const{schema:i}=D(),c=f.useMemo(()=>{const{allOf:a,...d}=e,u=a.reduce((h,p)=>{if(V(p)){const l=M(i,p.$ref);return U({},h,l)}return U({},h,p)},{});return U({},u,d)},[e,i]);return r.jsx(ue,{value:n,onValueChange:t,errors:s,property:c,id:o})}function On({value:e,property:n,schema:t}){const s=k(e)?e:n.default;if(!k(s))return 0;const o=Pn(n,t);switch(typeof s){case"string":return o.findIndex(i=>i.type==="string");case"number":return o.findIndex(i=>i.type==="number"||i.type==="integer");case"boolean":return o.findIndex(i=>i.type==="boolean");case"object":return Dn(s,o);default:return-1}}function Pn(e,n){return e.anyOf?e.anyOf.map(t=>V(t)?M(n,t.$ref):t):[]}function Dn(e,n){return N(e)?Fn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Fn(e,n){if(vn(e))return n.findIndex(i=>i.type==="object");const t=Object.keys(e),[s,o]=n.reduce(([i,c],a,d)=>{if(!("properties"in a)||!a.properties)return[i,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[d,h]:[i,c]},[0,0]);return o===0?-1:s}const En={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function An(e){if(e.type&&typeof e.type=="string")return En[e.type]}function le(e,n){if(V(e)){const s=M(n,e.$ref);return le(s,n)}const t=An(e)??"Field";return e.title??e.format??t}function H({value:e,property:n,onValueChange:t,errors:s}){const{schema:o}=D(),[i,c]=f.useState(On({value:e,property:n,schema:o})),a=f.useRef(new Map);function d(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(i,e),c(h),t(a.current.get(h))}return r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(mn,{size:"sm",variant:"outline",type:"single",value:i.toString(),onValueChange:d,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=le(u,o);return r.jsx(hn,{value:h.toString(),children:p},p)})}),r.jsx(ee,{className:"p-2",children:r.jsx(Ce,{value:e,property:n.anyOf[i],onValueChange:t,errors:s,showLabel:!1,nested:!1,required:!1})})]})}const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function Vn(e,n=0){return(g[e[n+0]]+g[e[n+1]]+g[e[n+2]]+g[e[n+3]]+"-"+g[e[n+4]]+g[e[n+5]]+"-"+g[e[n+6]]+g[e[n+7]]+"-"+g[e[n+8]]+g[e[n+9]]+"-"+g[e[n+10]]+g[e[n+11]]+g[e[n+12]]+g[e[n+13]]+g[e[n+14]]+g[e[n+15]]).toLowerCase()}let Y;const Mn=new Uint8Array(16);function Tn(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(Mn)}const $n=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xe={randomUUID:$n};function Bn(e,n,t){e=e||{};const s=e.random??e.rng?.()??Tn();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Vn(s)}function je(e,n,t){return xe.randomUUID&&!e?xe.randomUUID():Bn(e)}function Kn(e){return typeof e=="string"}function Se(e){return N(e)&&"property"in e}function _e(e){return N(e)&&"index"in e}function ve({errors:e}){const n=f.useMemo(()=>e.filter(t=>Kn(t)),[e]);return n.length===0?null:n.length===1?r.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):r.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>r.jsx("li",{children:t},t))})}function we(e){return K(e)?e.__prefect_kind:null}function K(e,n){return N(e)&&fe(e.__prefect_kind)?fe(n)?e.__prefect_kind===n:!0:!1}function Ln({value:e,property:n,schema:t,to:s}){const o=we(e);try{switch(o){case"json":return Un({json:e,property:n,schema:t,to:s});case"jinja":return Jn({jinja:e,property:n,schema:t,to:s});case"workspace_variable":return zn({workspaceVariable:e,to:s});case null:return Rn({value:e,property:n,schema:t,to:s});default:throw new Error(`Unknown prefect kind value: ${o}`)}}catch(i){console.error(i);return}}function Un({json:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e.value};case"json":return e;case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.value===void 0)return;try{const o=JSON.parse(e.value);return G({value:o,property:n,schema:t})}catch{throw new ke("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function Jn({jinja:e,property:n,schema:t,to:s}){switch(s){case"jinja":return e;case"json":return{__prefect_kind:"json",value:e.template};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.template===void 0)return;try{const o=JSON.parse(e.template);return G({value:o,property:n,schema:t})}catch{throw new ke("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function zn({workspaceVariable:e,to:n}){switch(n){case"workspace_variable":return e;case"jinja":return{__prefect_kind:"jinja",template:void 0};case"json":return{__prefect_kind:"json",value:void 0};case null:return;default:throw new Error(`mapSchemaValueWorkspaceVariable missing case for kind: ${n}`)}}function Rn({value:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e===void 0?void 0:JSON.stringify(e,null,2)};case"json":return{__prefect_kind:"json",value:e===void 0?void 0:JSON.stringify(e,null,2)};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:return G({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${s}`)}}function G({value:e,property:n,schema:t}){return O(n)?n.map(o=>R({value:e,property:o,schema:t})).find(o=>o!==void 0):R({value:e,property:n,schema:t})}function R({value:e,property:n,schema:t}){const s=ye(n,t);if(ge(s))return G({value:e,property:s.anyOf,schema:t});switch(s.type){case"null":return null;case"string":return typeof e=="string"?e:void 0;case"boolean":return typeof e=="boolean"?e:void 0;case"number":return typeof e=="number"?e:void 0;case"integer":return typeof e=="number"?Math.round(e):void 0;case"array":return Wn({value:e,property:s,schema:t});case"object":return Gn({value:e,property:s,schema:t});default:if(O(s.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${s.type}`)}}function Wn({value:e,property:n,schema:t}){return O(e)?[...e].map(o=>R({value:o,property:n,schema:t})):void 0}function Gn({value:e,property:n,schema:t}){if(!N(e))return;if(n.properties===void 0)return e;const s={...e};for(const[o,i]of Object.entries(n.properties))R({value:e[o],property:i,schema:t})===void 0&&delete s[o];return s}class ke extends Error{constructor(n,t){super(`Unable to convert prefect kind value from "${n}" to "${t??"null"}"`)}}const Ie=({value:e,onValueChange:n,property:t,children:s,disableKinds:o,defaultValue:i,hasDefaultValue:c})=>{const{schema:a,kinds:d}=D(),[u,h]=f.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(i);function l(){c&&n(i)}function x(v){const S=Ln({value:e,property:t,schema:a,to:v});n(S)}const y=f.useMemo(()=>{const v=we(e);return Ge.filter(S=>S!==v&&(d.includes(S)||S===null)&&!o)},[e,d,o]);return r.jsxs(Je,{open:u,onOpenChange:h,children:[r.jsx(ze,{asChild:!0,children:r.jsxs(L,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[r.jsx("span",{className:"sr-only",children:"Open menu"}),r.jsx(ne,{id:"MoreVertical",className:"size-4"})]})}),r.jsxs(Re,{align:"end",children:[y.map(v=>r.jsx(C,{onClick:()=>x(v),children:qe(v)},v)),c&&r.jsx(C,{onClick:l,disabled:p,children:"Use default value"}),r.jsx(We,{}),s]})]})};function qn({itemKey:e,items:n,value:t,onValueChange:s,errors:o,onDelete:i,first:c,last:a,canMove:d,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=D(),y=f.useId(),{attributes:v,listeners:S,setNodeRef:I,transform:F,transition:E,isDragging:$}=Qe({id:e,disabled:!d}),B={transform:He.Transform.toString(F),transition:E,opacity:$?.5:1},w=f.useMemo(()=>O(n)?{anyOf:n}:V(n)?M(x,n.$ref):n,[n,x]);return r.jsxs("div",{ref:I,style:B,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[d?r.jsx("button",{type:"button",className:"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none","aria-label":"Drag to reorder",...v,...S,children:r.jsx(_n,{className:"h-5 w-5"})}):r.jsx("div",{className:"w-5"}),r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(ue,{value:t,onValueChange:s,property:w,errors:o,id:y}),r.jsx(ve,{errors:o})]}),r.jsxs(Ie,{value:t,onValueChange:s,property:n,children:[r.jsx(C,{onClick:i,children:"Delete"}),d&&!c&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:p,children:"Move to top"}),r.jsx(C,{onClick:u,children:"Move up"})]}),d&&!a&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:h,children:"Move down"}),r.jsx(C,{onClick:l,children:"Move to bottom"})]})]})]})}function Qn({property:e,values:n,onValuesChange:t,errors:s}){const o=n===void 0||n.length===0,i=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=Ye(me(sn),me(rn,{coordinateGetter:tn})),[d,u]=f.useState(n?.map(m=>({key:je(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return s.filter(b=>_e(b)&&b.index===m).flatMap(b=>b.errors)}function l(m){return m===0}function x(m){return m===(n?.length??0)-1}function y(m){return!(O(e.prefixItems)&&m<e.prefixItems.length)}function v(m,b){u(d.map(j=>j.key===m?{...j,value:b}:j))}function S(){const m=[...d,{key:je(),value:void 0}];u(m),t(m.map(({value:b})=>b))}function I(m,b){const j=[...d];j.splice(b,0,j.splice(m,1)[0]),u(j),t(j.map(({value:A})=>A))}function F(m){I(m,0)}function E(m){I(m,d.length-1)}function $(m){const b=d.filter(j=>j.key!==m);u(b),t(b.map(({value:j})=>j))}function B(m){const{active:b,over:j}=m;if(j&&b.id!==j.id){const A=d.findIndex(q=>q.key===b.id),de=d.findIndex(q=>q.key===j.id);A!==-1&&de!==-1&&I(A,de)}}const w=d.slice(c).map(m=>m.key);return r.jsxs(ee,{className:"flex flex-col gap-2 p-2",children:[o&&r.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),r.jsx(Xe,{sensors:a,collisionDetection:Ze,onDragEnd:B,children:r.jsx(en,{items:w,strategy:nn,children:d?.map(({key:m,value:b},j)=>r.jsx(qn,{itemKey:m,items:h(j),value:b,onValueChange:A=>v(m,A),errors:p(j),onDelete:()=>$(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>I(j,j-1),moveDown:()=>I(j,j+1),moveToTop:()=>F(j),moveToBottom:()=>E(j)},m))})}),i&&r.jsx("div",{className:"flex justify-end",children:r.jsx(L,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!i&&r.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function T({property:e,id:n,...t}){const[s,o]=f.useState(""),i=f.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(s.toLowerCase()))),[e.enum,s]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function d(l){const x=i[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){o("");const x=i[l];return t.multiple?p(x):h(x)}function h(l){if(t.multiple)throw new Error("onSingleSelect called on multiple value input");t.onValueChange(l)}function p(l){if(!t.multiple)throw new Error("onMultipleSelect called on single value input");if(!t.values){t.onValuesChange([l]);return}if(t.values?.includes(l)){t.onValuesChange(t.values.filter(x=>x!==l));return}t.onValuesChange([...t.values,l])}return r.jsxs(te,{children:[r.jsx(re,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),r.jsxs(se,{children:[r.jsx(oe,{value:s,onValueChange:o,placeholder:"Search..."}),r.jsx(ie,{children:"No values found"}),r.jsx(ae,{children:Object.entries(i).map(([l,x])=>r.jsx(z,{value:l,onSelect:u,selected:d(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>on(typeof n))}function _(e,n){if(typeof e==typeof n())return e}function Hn(e){if(N(e))return e}function Yn(e){return _(e,String)??_(e,Number)??_(e,Boolean)}function Ne(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>_(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>_(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>_(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>_(t,String)??_(t,Number)??_(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function Xn({values:e,property:n,onValuesChange:t,errors:s,id:o}){const{schema:i}=D();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(In(n)&&N(n.items)){let a=n.items;if(V(a)&&(a=M(i,a.$ref)),P(a)){const d={...n,...a};return r.jsx(T,{multiple:!0,values:Ne(e,"primitive"),property:d,onValuesChange:c,id:o})}}return r.jsx(Qn,{property:n,values:e,onValuesChange:c,errors:s})}const Zn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>r.jsx(f.Suspense,{children:r.jsx(et,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})}),et=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>{const[o,i]=f.useState(""),c=f.useDeferredValue(o),{data:a}=J(De({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_types:{slug:{any_:[e]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1},...c?{name:{like_:c}}:{}},limit:50})),d=f.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=f.useMemo(()=>a.find(h=>h.id===n),[a,n]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),r.jsxs(se,{children:[r.jsx(oe,{value:o,onValueChange:i,placeholder:"Search for a block..."}),r.jsx(ie,{children:"No block found"}),r.jsxs(ae,{children:[r.jsx(X,{children:d.map(h=>r.jsx(z,{selected:n===h.id,onSelect:p=>{t(p),i("")},value:h.id,children:h.name},h.id))}),s&&r.jsx(X,{children:r.jsxs(z,{onSelect:()=>{s(),i("")},value:"__create_new__",closeOnSelect:!0,children:[r.jsx(ne,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function nt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){return r.jsx(f.Suspense,{fallback:r.jsx(tt,{}),children:r.jsx(rt,{value:e,onValueChange:n,blockTypeSlug:t,id:s})})}function tt(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{className:"size-8 rounded"}),r.jsx(Q,{className:"h-9 flex-1"}),r.jsx(Q,{className:"h-9 w-20"})]})}function rt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){const[o,i]=f.useState(!1),{data:c}=J(Fe(t)),{data:a}=J(Ee({block_types:{slug:{any_:[t]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1}},include_secrets:!1,sort:"BLOCK_TYPE_AND_NAME_ASC",offset:0})),d=a>0,u=e?.$ref,h=l=>{n(l?{$ref:l}:void 0)},p=l=>{n({$ref:l})};return r.jsxs("div",{id:s,className:"flex items-center gap-2",children:[r.jsx(xn,{logoUrl:c.logo_url,alt:c.name}),d&&r.jsx("div",{className:"flex-1",children:r.jsx(Zn,{blockTypeSlug:t,selectedBlockDocumentId:u,onSelect:h,onCreateNew:()=>i(!0)})}),r.jsxs(L,{type:"button",variant:"outline",onClick:()=>i(!0),children:["Add",r.jsx(ne,{id:"Plus",className:"ml-2 size-4"})]}),r.jsx(an,{open:o,onOpenChange:i,blockTypeSlug:t,onCreated:p})]})}function st({value:e,onValueChange:n,property:t,id:s}){function o(i){n(_(i,Boolean))}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s}):r.jsx(Ae,{checked:e,onCheckedChange:o,id:s})}function ot({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:i=>o(i.target.value),id:s})}function it(){return r.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function at({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:i=>o(i.target.value),id:s})}function ct({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"jinja",template:o||void 0})};return r.jsx(ce,{value:e.template,onChange:s,id:t})}function lt({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"json",value:o||void 0})};return r.jsx(ce,{value:e.value,onChange:s,id:t})}const ut=({selectedVariableName:e,onSelect:n})=>r.jsx(f.Suspense,{children:r.jsx(dt,{selectedVariableName:e,onSelect:n})}),dt=({selectedVariableName:e,onSelect:n})=>{const[t,s]=f.useState(""),o=f.useDeferredValue(t),{data:i}=J(Ve({offset:0,sort:"NAME_ASC",variables:o?{operator:"and_",name:{like_:o}}:void 0,limit:50})),c=f.useMemo(()=>i.filter(a=>a.name.toLowerCase().includes(o.toLowerCase())),[i,o]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),r.jsxs(se,{children:[r.jsx(oe,{value:t,onValueChange:s,placeholder:"Search for a variable..."}),r.jsx(ie,{children:"No variable found"}),r.jsx(ae,{children:r.jsx(X,{children:c.map(a=>r.jsx(z,{selected:e===a.name,onSelect:d=>{n(d),s("")},value:a.name,children:a.name},a.id))})})]})]})};function ft({value:e,onValueChange:n,id:t}){const s=o=>{n({__prefect_kind:"workspace_variable",variable_name:o})};return r.jsx("div",{id:t,children:r.jsx(ut,{selectedVariableName:e.variable_name,onSelect:s})})}const pe="yyyy-MM-dd";function mt({value:e,onValueChange:n,id:t}){const s=e?dn(e,pe,fn()):void 0,[o,i]=f.useState(s);function c(a){i(a),n(a?he(a,pe):void 0)}return r.jsxs(Me,{children:[r.jsx(Te,{asChild:!0,children:r.jsxs(L,{variant:"outline",className:$e("justify-start text-left font-normal w-full",!o&&"text-muted-foreground"),id:t,children:[r.jsx(Be,{className:"mr-2 h-4 w-4"}),o?he(o,"PPP"):r.jsx("span",{children:"Pick a date"})]})}),r.jsx(Ke,{className:"w-auto p-0",children:r.jsx(Le,{mode:"single",selected:o,onSelect:c,required:!0,autoFocus:!0})})]})}function ht({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n(o||void 0)};return r.jsx(ce,{value:e,onChange:s,id:t})}function xt({value:e,onValueChange:n,id:t}){const[s,o]=f.useState(!1),i=c=>{n(c.target.value||void 0)};return r.jsxs("div",{className:"relative",children:[r.jsx(W,{id:t,type:s?"text":"password",value:e??"",onChange:i,autoComplete:"off",className:"pr-10"}),r.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>o(!s),"aria-label":s?"Hide password":"Show password",children:s?r.jsx(bn,{className:"h-4 w-4"}):r.jsx(yn,{className:"h-4 w-4"})})]})}function jt({value:e,onValueChange:n,id:t}){function s(o){const i=o.target.value;if(i===""){n(void 0);return}const c=Number(i);Number.isNaN(c)||n(String(c))}return r.jsx(W,{type:"number",value:e??"",onChange:s,id:t,placeholder:"Duration in seconds",min:0})}function pt({value:e,onValueChange:n,property:t,id:s}){function o(i){n(i||void 0)}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:o,id:s}):t.format==="date"?r.jsx(mt,{value:e,onValueChange:o,id:s}):t.format==="date-time"?r.jsx(cn,{value:e,onValueChange:o,id:s}):t.format==="json-string"?r.jsx(ht,{value:e,onValueChange:o,id:s}):t.format==="time-delta"?r.jsx(jt,{value:e,onValueChange:o,id:s}):t.format==="password"?r.jsx(xt,{value:e,onValueChange:o,id:s}):r.jsx(jn,{value:e??"",rows:1,className:"min-h-min",onChange:i=>o(i.target.value),id:s})}function bt({value:e,onValueChange:n,property:t,id:s}){return f.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?r.jsx(T,{multiple:!1,value:Yn(e),property:t,onValueChange:n,id:s}):null}function ue({value:e,onValueChange:n,errors:t,property:s,id:o,nested:i=!0}){if(K(e)){if(K(e,"json"))return r.jsx(lt,{value:e,onValueChange:n,id:o});if(K(e,"jinja"))return r.jsx(ct,{value:e,onValueChange:n,id:o});if(K(e,"workspace_variable"))return r.jsx(ft,{value:e,onValueChange:n,id:o});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("block_type_slug"in s){const c=s.block_type_slug;if(typeof c=="string")return r.jsx(nt,{value:e,onValueChange:n,blockTypeSlug:c,id:o})}if(ge(s))return r.jsx(H,{value:e,property:s,onValueChange:n,errors:t});if(wn(s)){const c={...s,anyOf:s.oneOf};return r.jsx(H,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(s.type)){const c={...s,anyOf:Object.values(s.type).map(a=>({type:a}))};return r.jsx(H,{value:e,property:c,onValueChange:n,errors:t})}if(kn(s))return r.jsx(Cn,{value:e,onValueChange:n,errors:t,property:s,id:o});if(s.type==="string")return r.jsx(pt,{value:_(e,String),onValueChange:n,property:s,id:o});if(s.type==="integer")return r.jsx(ot,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="number")return r.jsx(at,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="boolean")return r.jsx(st,{value:_(e,Boolean),onValueChange:n,property:s,id:o});if(s.type==="object")return r.jsx(Oe,{values:Hn(e),property:s,onValuesChange:n,errors:t,nested:i});if(s.type==="array")return r.jsx(Xn,{values:Ne(e),property:s,onValuesChange:n,errors:t,id:o});if(s.type==="null")return r.jsx(it,{});if(s.type===void 0)return r.jsx(bt,{value:e,onValueChange:n,property:s,id:o});throw new Error(`Schema type not implemented: ${String(s.type)}`)}function be({property:e}){const n=f.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&r.jsx("p",{className:"text-sm text-gray-500",children:n})}function gt({property:e,required:n,id:t}){const{schema:s}=D(),o=f.useMemo(()=>{const i=le(e,s);return n?i:`${i} (Optional)`},[e,n,s]);return r.jsx(Ue,{htmlFor:t,children:o})}function Ce({property:e,value:n,onValueChange:t,required:s,errors:o,showLabel:i=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:d}=D(),u=f.useMemo(()=>ye(e,a),[e,a]),h=f.useMemo(()=>!k(u.type),[u.type]),p=f.useMemo(()=>o.filter(w=>Se(w)||_e(w)),[o]),[l,x]=f.useState(!1),[y,v]=f.useState(B),[S,I]=f.useState(!1),F=f.useId(),E=f.useCallback(w=>{v(w),t(w)},[t]),$=f.useCallback(()=>{const w=!S;I(w),t(w?void 0:y)},[S,t,y]);f.useEffect(()=>{l||d||(k(u.default)&&!k(n)&&t(u.default),x(!0))},[l,d,t,u.default,n]);function B(){if(k(n))return n;if(k(u.default)&&!d)return u.default}return r.jsxs("div",{className:"flex flex-col gap-2 group",children:[i&&r.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(gt,{property:u,required:s,id:F}),r.jsx(be,{property:u})]}),r.jsx("div",{className:"ml-auto",children:r.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:k(u.default),children:r.jsx(C,{onClick:$,children:S?"Include value":"Omit value"})})})]}),!i&&r.jsx(be,{property:u}),r.jsx("fieldset",{disabled:S,children:r.jsx(ue,{property:u,value:y,onValueChange:E,errors:p,id:F,nested:c})}),r.jsx(ve,{errors:o})]})}function yt(e,n){return(e.position??0)-(n.position??0)}function Oe({values:e,onValuesChange:n,property:t,errors:s,nested:o}){const i=f.useRef([]),c=Pe(f.useCallback(()=>{const l={...e};for(const{key:x,value:y}of i.current)l[x]=y,y===void 0&&delete l[x];if(i.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){i.current.push({key:l,value:x}),c()}function d(l){return e?.[l]}function u(l){return s.filter(Se).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=f.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>yt(l,x)),[t.properties]),p=r.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>r.jsx(Ce,{value:d(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return o?r.jsx(ee,{className:"p-2",children:p}):p}const St=({children:e,...n})=>r.jsx(ln.Provider,{value:n,children:e}),$t=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:s,onValuesChange:o,errors:i})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=f.useCallback(u=>{if(u===void 0){o({});return}o(u)},[o]),d={values:s,property:e,onValuesChange:a,errors:i};return r.jsx("div",{className:"flex flex-col gap-4",children:r.jsx(St,{...c,children:r.jsx(Oe,{...d,nested:!1})})})};export{$t as SchemaForm};
|
|
2
|
+
//# sourceMappingURL=schema-form-CWDHSME9.js.map
|