prefect 3.6.14.dev3__py3-none-any.whl → 3.6.14.dev4__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/futures.py +17 -4
- prefect/runner/runner.py +113 -29
- prefect/server/ui-v2/assets/{artifact-card-CNabu-6j.js → artifact-card-DmR_0bKj.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-CNabu-6j.js.map → artifact-card-DmR_0bKj.js.map} +1 -1
- prefect/server/ui-v2/assets/{artifact._id-Emkhr_0h.js → artifact._id-BF4365i6.js} +2 -2
- prefect/server/ui-v2/assets/{artifact._id-Emkhr_0h.js.map → artifact._id-BF4365i6.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-schema-CRKJHa4q.js → automation-schema-crrFcHTg.js} +2 -2
- prefect/server/ui-v2/assets/{automation-schema-CRKJHa4q.js.map → automation-schema-crrFcHTg.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-wizard-Cej8aik5.js → automation-wizard-DMI3p_HA.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-Cej8aik5.js.map → automation-wizard-DMI3p_HA.js.map} +1 -1
- prefect/server/ui-v2/assets/automation._id-C_ZATYDQ.js +2 -0
- prefect/server/ui-v2/assets/{automation._id-Bm1T3_NO.js.map → automation._id-C_ZATYDQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-C5NIVfxR.js → automation_._id.edit-Dkc09fFA.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-C5NIVfxR.js.map → automation_._id.edit-Dkc09fFA.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-CdJSlWw8.js → automations-header-H_FW9LY7.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-CdJSlWw8.js.map → automations-header-H_FW9LY7.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-DX_X28oU.js → base-job-template-form-section-CVnxwfEi.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-DX_X28oU.js.map → base-job-template-form-section-CVnxwfEi.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-BcpcwaJS.js → block-type-details-BIzTWlfj.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-BcpcwaJS.js.map → block-type-details-BIzTWlfj.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-B3XAhRSL.js +2 -0
- prefect/server/ui-v2/assets/{block-type-logo-ox5VqJuy.js.map → block-type-logo-B3XAhRSL.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-BD6wu3yC.js → block._id-Bj0YEdv1.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-BD6wu3yC.js.map → block._id-Bj0YEdv1.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-aneXPzUW.js → block_._id.edit-C7sUQ8mQ.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-aneXPzUW.js.map → block_._id.edit-C7sUQ8mQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-C7ttFKuv.js → catalog-Cywf-iho.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-C7ttFKuv.js.map → catalog-Cywf-iho.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug-CrcphBbo.js → catalog_._slug-qLWMRQt3.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug-CrcphBbo.js.map → catalog_._slug-qLWMRQt3.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-Dd7ATIKq.js → catalog_._slug_.create-LslFlpde.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-Dd7ATIKq.js.map → catalog_._slug_.create-LslFlpde.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-D5U2XK4R.js → collapsible-BszH-EeY.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-D5U2XK4R.js.map → collapsible-BszH-EeY.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-D-xV_tiF.js → concurrency-limit._id-Dam_Ftkw.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-D-xV_tiF.js.map → concurrency-limit._id-Dam_Ftkw.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-Da7OBOa5.js → create-B11nNTmT.js} +2 -2
- prefect/server/ui-v2/assets/{create-Da7OBOa5.js.map → create-B11nNTmT.js.map} +1 -1
- prefect/server/ui-v2/assets/create-B8EFPjmO.js +2 -0
- prefect/server/ui-v2/assets/{create-CiMo25er.js.map → create-B8EFPjmO.js.map} +1 -1
- prefect/server/ui-v2/assets/cronstrue-IJcBJ9tZ.js +2 -0
- prefect/server/ui-v2/assets/cronstrue-IJcBJ9tZ.js.map +1 -0
- prefect/server/ui-v2/assets/{data-table-Bfa8_ZJd.js → data-table-C1eRvlXV.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-Bfa8_ZJd.js.map → data-table-C1eRvlXV.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-D18TITKv.js → delete-confirmation-dialog-DCmC1ZTD.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-D18TITKv.js.map → delete-confirmation-dialog-DCmC1ZTD.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment-action-header-WD51TIyE.js +2 -0
- prefect/server/ui-v2/assets/{deployment-action-header-AamGn0qI.js.map → deployment-action-header-WD51TIyE.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-QIRH-pew.js → deployment-form-FaqDdnNa.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-QIRH-pew.js.map → deployment-form-FaqDdnNa.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-yTRvIDd3.js → deployment-links-CLax44tW.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-yTRvIDd3.js.map → deployment-links-CLax44tW.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-CCBPOCfw.js → deployment._id-CbWiylvh.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-CCBPOCfw.js.map → deployment._id-CbWiylvh.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-m4luvPWl.js → deployment._id-DrtOyhFC.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-m4luvPWl.js.map → deployment._id-DrtOyhFC.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-CqlNWQfz.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-DFjSeYn4.js.map → deployment_._id.duplicate-CqlNWQfz.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-CbvCe2YU.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-5-mFOphJ.js.map → deployment_._id.edit-CbvCe2YU.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-CwVe5hPJ.js → deployment_._id.run-BnIFeR-d.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-CwVe5hPJ.js.map → deployment_._id.run-BnIFeR-d.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-g64QiYKu.js → dropdown-menu-Bhox1zoa.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-g64QiYKu.js.map → dropdown-menu-Bhox1zoa.js.map} +1 -1
- prefect/server/ui-v2/assets/{event-resource-display-BqqHFc0B.js → event-resource-display-65B76oFV.js} +2 -2
- prefect/server/ui-v2/assets/{event-resource-display-BqqHFc0B.js.map → event-resource-display-65B76oFV.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-BR0eukkm.js → event._eventDate._eventId-CxPjH2H7.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-BR0eukkm.js.map → event._eventDate._eventId-CxPjH2H7.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run-graph-kZfaIevn.js → flow-run-graph-ZOatFLjv.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run-graph-kZfaIevn.js.map → flow-run-graph-ZOatFLjv.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-1RC-URiA.js +2 -0
- prefect/server/ui-v2/assets/{flow-run._id-Caq--9Lr.js.map → flow-run._id-1RC-URiA.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-CDFeuz16.js +2 -0
- prefect/server/ui-v2/assets/{flow-run._id-DiA0_X5m.js.map → flow-run._id-CDFeuz16.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-BX0UeXTj.js → flow-run._id-U6rzXfvR.js} +4 -4
- prefect/server/ui-v2/assets/{flow-run._id-BX0UeXTj.js.map → flow-run._id-U6rzXfvR.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination-CoZZ-ed_.js → flow-runs-pagination-D_d5hdM0.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination-CoZZ-ed_.js.map → flow-runs-pagination-D_d5hdM0.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow._id-nRzTWzLb.js → flow._id-DkeN8TLS.js} +2 -2
- prefect/server/ui-v2/assets/{flow._id-nRzTWzLb.js.map → flow._id-DkeN8TLS.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-CdcF42XZ.js → form-CJfDUosd.js} +2 -2
- prefect/server/ui-v2/assets/{form-CdcF42XZ.js.map → form-CJfDUosd.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DijI5Lcu.js → header-C5liWcfp.js} +2 -2
- prefect/server/ui-v2/assets/{header-DijI5Lcu.js.map → header-C5liWcfp.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DkJo9Uge.js → header-MZZX5lQ8.js} +2 -2
- prefect/server/ui-v2/assets/{header-DkJo9Uge.js.map → header-MZZX5lQ8.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DV0gMQER.js → header-vYbWNFdK.js} +2 -2
- prefect/server/ui-v2/assets/{header-DV0gMQER.js.map → header-vYbWNFdK.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-VUajxmNL.js → index-4xVLy12E.js} +2 -2
- prefect/server/ui-v2/assets/{index-VUajxmNL.js.map → index-4xVLy12E.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-KlV75baW.js → index-5fQrQZ3K.js} +2 -2
- prefect/server/ui-v2/assets/{index-KlV75baW.js.map → index-5fQrQZ3K.js.map} +1 -1
- prefect/server/ui-v2/assets/index-7bWZ2Znt.js +2 -0
- prefect/server/ui-v2/assets/{index-CqvGvZOq.js.map → index-7bWZ2Znt.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Chtop8D8.js → index-BOVwKiXn.js} +2 -2
- prefect/server/ui-v2/assets/{index-Chtop8D8.js.map → index-BOVwKiXn.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BZ9TDxSy.js → index-BPmw935P.js} +2 -2
- prefect/server/ui-v2/assets/{index-BZ9TDxSy.js.map → index-BPmw935P.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BR6bwuK4.js +2 -0
- prefect/server/ui-v2/assets/{index-BCKNs_w7.js.map → index-BR6bwuK4.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DYKO0qOd.js → index-B_3WKH2_.js} +2 -2
- prefect/server/ui-v2/assets/{index-DYKO0qOd.js.map → index-B_3WKH2_.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BV3WqCCv.js → index-BgOHAC5L.js} +2 -2
- prefect/server/ui-v2/assets/{index-BV3WqCCv.js.map → index-BgOHAC5L.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CUZXozY8.js → index-Bmd9p_xN.js} +2 -2
- prefect/server/ui-v2/assets/{index-CUZXozY8.js.map → index-Bmd9p_xN.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-faXvGo5k.js → index-BmdTLblr.js} +2 -2
- prefect/server/ui-v2/assets/{index-faXvGo5k.js.map → index-BmdTLblr.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Cuh3BwlA.js → index-CCCwtbSq.js} +2 -2
- prefect/server/ui-v2/assets/{index-Cuh3BwlA.js.map → index-CCCwtbSq.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-yTjygRmH.js → index-CbJNJTr8.js} +2 -2
- prefect/server/ui-v2/assets/{index-yTjygRmH.js.map → index-CbJNJTr8.js.map} +1 -1
- prefect/server/ui-v2/assets/index-CcyfsgGP.js +2 -0
- prefect/server/ui-v2/assets/{index-BijfHkUE.js.map → index-CcyfsgGP.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-AXV1ellj.js → index-CfHvTOAO.js} +2 -2
- prefect/server/ui-v2/assets/{index-AXV1ellj.js.map → index-CfHvTOAO.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BGZtCgRR.js → index-ClXbR8i0.js} +2 -2
- prefect/server/ui-v2/assets/{index-BGZtCgRR.js.map → index-ClXbR8i0.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BfuGBXBN.js → index-Cyw9YHlj.js} +2 -2
- prefect/server/ui-v2/assets/{index-BfuGBXBN.js.map → index-Cyw9YHlj.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BZqccBpn.js → index-DLuXqHi9.js} +6 -6
- prefect/server/ui-v2/assets/index-DLuXqHi9.js.map +1 -0
- prefect/server/ui-v2/assets/{index-BmUvoLOK.js → index-DeeA9nPM.js} +2 -2
- prefect/server/ui-v2/assets/{index-BmUvoLOK.js.map → index-DeeA9nPM.js.map} +1 -1
- prefect/server/ui-v2/assets/index-MeJBhX-C.js +2 -0
- prefect/server/ui-v2/assets/{index-CUJoNEgb.js.map → index-MeJBhX-C.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DO_c3_A_.js → index-enqoJV8x.js} +2 -2
- prefect/server/ui-v2/assets/{index-DO_c3_A_.js.map → index-enqoJV8x.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-DFgWdLGv.js → json-input-CJ1Ipjax.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-DFgWdLGv.js.map → json-input-CJ1Ipjax.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-CpeWM0mN.js → key._key-B0wb5Umi.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-CpeWM0mN.js.map → key._key-B0wb5Umi.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-Bzi0YUUV.js → lazy-markdown-sP3PYQgB.js} +3 -3
- prefect/server/ui-v2/assets/{lazy-markdown-Bzi0YUUV.js.map → lazy-markdown-sP3PYQgB.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-CM0nuDdd.js → login-DNY0o3XU.js} +2 -2
- prefect/server/ui-v2/assets/{login-CM0nuDdd.js.map → login-DNY0o3XU.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-CGOAnaWz.js → markdown-input-Bos2JYXW.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-CGOAnaWz.js.map → markdown-input-Bos2JYXW.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-CyJ28Tm-.js → python-example-snippet-CWSJRd48.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-CyJ28Tm-.js.map → python-example-snippet-CWSJRd48.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-D8_x22t4.js → python-input-Bu4995lK.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-D8_x22t4.js.map → python-input-Bu4995lK.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-Dgu38qwz.js → radio-group-C0D0oLYd.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-Dgu38qwz.js.map → radio-group-C0D0oLYd.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-CVHTggxQ.js → route-error-state-DzKu_Iw_.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-CVHTggxQ.js.map → route-error-state-DzKu_Iw_.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-DqRLX--T.js → schema-form-BD95b0iS.js} +2 -2
- prefect/server/ui-v2/assets/schema-form-BD95b0iS.js.map +1 -0
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DuEmswz-.js → schema-form-input-string-format-datetime-DyDs1jNl.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DuEmswz-.js.map → schema-form-input-string-format-datetime-DyDs1jNl.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-CtKmYnoo.js → settings-a90cwhBe.js} +2 -2
- prefect/server/ui-v2/assets/{settings-CtKmYnoo.js.map → settings-a90cwhBe.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-BNQ6rjAG.js → sort-filter-CCltjs1E.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-BNQ6rjAG.js.map → sort-filter-CCltjs1E.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-CJS-5Aky.js → table-CrPymfJD.js} +2 -2
- prefect/server/ui-v2/assets/{table-CJS-5Aky.js.map → table-CrPymfJD.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-CDvuqe9B.js → tags-input-BdNYl8nS.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-CDvuqe9B.js.map → tags-input-BdNYl8nS.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-DMqNFEVn.js → task-run-concurrency-limits-reset-dialog-B4bdiAgf.js} +2 -2
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-DMqNFEVn.js.map → task-run-concurrency-limits-reset-dialog-B4bdiAgf.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-CV5t0LR0.js → task-run._id-BQac40_I.js} +3 -3
- prefect/server/ui-v2/assets/{task-run._id-CV5t0LR0.js.map → task-run._id-BQac40_I.js.map} +1 -1
- prefect/server/ui-v2/assets/task-run._id-BzeMfM08.js +2 -0
- prefect/server/ui-v2/assets/{task-run._id-CiVsXKpy.js.map → task-run._id-BzeMfM08.js.map} +1 -1
- prefect/server/ui-v2/assets/task-runs-pagination-WFGIqR6p.js +2 -0
- prefect/server/ui-v2/assets/{task-runs-pagination-DGjxL4DO.js.map → task-runs-pagination-WFGIqR6p.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-Mne2s-1n.js → textarea-CGFflH-n.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-Mne2s-1n.js.map → textarea-CGFflH-n.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-CPBtT8tA.js → timezone-select-ClE9nfKA.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-CPBtT8tA.js.map → timezone-select-ClE9nfKA.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-CvPe0UY1.js → toggle-group-Dnv_LMnU.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-CvPe0UY1.js.map → toggle-group-Dnv_LMnU.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-debounce-callback-Dcf0d0U7.js → use-debounce-callback-CVfZS_LP.js} +2 -2
- prefect/server/ui-v2/assets/{use-debounce-callback-Dcf0d0U7.js.map → use-debounce-callback-CVfZS_LP.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DnRkM1Cj.js → use-delete-automation-confirmation-dialog-CRGV6wvn.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DnRkM1Cj.js.map → use-delete-automation-confirmation-dialog-CRGV6wvn.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-CMHtwDvb.js → use-delete-block-document-confirmation-dialog-DNMP_gtr.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-CMHtwDvb.js.map → use-delete-block-document-confirmation-dialog-DNMP_gtr.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-confirmation-dialog-Bka9YDdO.js → use-delete-confirmation-dialog-C5d6hPL-.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-confirmation-dialog-Bka9YDdO.js.map → use-delete-confirmation-dialog-C5d6hPL-.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DB4pe2_m.js → use-flow-runs-selected-rows-D3-TVsRL.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DB4pe2_m.js.map → use-flow-runs-selected-rows-D3-TVsRL.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DUPrB7V9.js → use-get-artifacts-flow-task-runs-I3Wb9fOV.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DUPrB7V9.js.map → use-get-artifacts-flow-task-runs-I3Wb9fOV.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-is-overflowing-Cc-Qm0vx.js → use-is-overflowing-CyVH32I2.js} +2 -2
- prefect/server/ui-v2/assets/{use-is-overflowing-Cc-Qm0vx.js.map → use-is-overflowing-CyVH32I2.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-page-title-ELpQMkBC.js → use-page-title-CImKMV-D.js} +2 -2
- prefect/server/ui-v2/assets/{use-page-title-ELpQMkBC.js.map → use-page-title-CImKMV-D.js.map} +1 -1
- prefect/server/ui-v2/assets/use-quick-run-Be-i6Tzi.js +2 -0
- prefect/server/ui-v2/assets/{use-quick-run-uAasMmAv.js.map → use-quick-run-Be-i6Tzi.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-state-favicon-CzOUYzQe.js → use-state-favicon-DtW_I9k3.js} +2 -2
- prefect/server/ui-v2/assets/{use-state-favicon-CzOUYzQe.js.map → use-state-favicon-DtW_I9k3.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-DvHmfROo.js → use-stepper-BSvi_u_j.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-DvHmfROo.js.map → use-stepper-BSvi_u_j.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-XA-1-LhA.js → utilities-BCBDUmEl.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-XA-1-LhA.js.map → utilities-BCBDUmEl.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-codemirror-Dn73yRFx.js → vendor-codemirror-OTxfneaa.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-codemirror-Dn73yRFx.js.map → vendor-codemirror-OTxfneaa.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-date-Bxa7CHB1.js → vendor-date-CRz8gtWZ.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-date-Bxa7CHB1.js.map → vendor-date-CRz8gtWZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-forms-mroZAMaw.js → vendor-forms-D-iybWES.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-forms-mroZAMaw.js.map → vendor-forms-D-iybWES.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-markdown-BV905mMk.js → vendor-markdown-TdbL8FCd.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-markdown-BV905mMk.js.map → vendor-markdown-TdbL8FCd.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-radix-CP6hQtRc.js → vendor-radix-DRMjKWJW.js} +5 -5
- prefect/server/ui-v2/assets/{vendor-radix-CP6hQtRc.js.map → vendor-radix-DRMjKWJW.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-recharts-BOcghvr2.js → vendor-recharts-BGjDGXVf.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-recharts-BOcghvr2.js.map → vendor-recharts-BGjDGXVf.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-tanstack-CLpbOGYv.js → vendor-tanstack-CWDKYA_B.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-tanstack-CLpbOGYv.js.map → vendor-tanstack-CWDKYA_B.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-D4DI4Hd5.js → work-pool-filter-BuJB9elW.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-D4DI4Hd5.js.map → work-pool-filter-BuJB9elW.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-queue-toggle--tVsqhDi.js → work-pool-queue-toggle-DP2ONU28.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-queue-toggle--tVsqhDi.js.map → work-pool-queue-toggle-DP2ONU28.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-Ba0XSN4m.js → work-pool._workPoolName-BjhJe3F4.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-Ba0XSN4m.js.map → work-pool._workPoolName-BjhJe3F4.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-lHDf1Aih.js +2 -0
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CeYLESXS.js.map → work-pool_._workPoolName.edit-lHDf1Aih.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CHvlnO-U.js → work-pool_._workPoolName.queue._workQueueName-CLthz7sB.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CHvlnO-U.js.map → work-pool_._workPoolName.queue._workQueueName-CLthz7sB.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-DnQAtUi_.js → work-queue-icon-text-4iEAtZOh.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-DnQAtUi_.js.map → work-queue-icon-text-4iEAtZOh.js.map} +1 -1
- prefect/server/ui-v2/assets/{zod-cc-7bk3x.js → zod-CjGf5GIv.js} +2 -2
- prefect/server/ui-v2/assets/{zod-cc-7bk3x.js.map → zod-CjGf5GIv.js.map} +1 -1
- prefect/server/ui-v2/index.html +6 -6
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev4.dist-info}/METADATA +2 -2
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev4.dist-info}/RECORD +231 -231
- prefect/server/ui-v2/assets/automation._id-Bm1T3_NO.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-ox5VqJuy.js +0 -2
- prefect/server/ui-v2/assets/create-CiMo25er.js +0 -2
- prefect/server/ui-v2/assets/cronstrue-CeanGOEE.js +0 -2
- prefect/server/ui-v2/assets/cronstrue-CeanGOEE.js.map +0 -1
- prefect/server/ui-v2/assets/deployment-action-header-AamGn0qI.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-DFjSeYn4.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-5-mFOphJ.js +0 -2
- prefect/server/ui-v2/assets/flow-run._id-Caq--9Lr.js +0 -2
- prefect/server/ui-v2/assets/flow-run._id-DiA0_X5m.js +0 -2
- prefect/server/ui-v2/assets/index-BCKNs_w7.js +0 -2
- prefect/server/ui-v2/assets/index-BZqccBpn.js.map +0 -1
- prefect/server/ui-v2/assets/index-BijfHkUE.js +0 -2
- prefect/server/ui-v2/assets/index-CUJoNEgb.js +0 -2
- prefect/server/ui-v2/assets/index-CqvGvZOq.js +0 -2
- prefect/server/ui-v2/assets/schema-form-DqRLX--T.js.map +0 -1
- prefect/server/ui-v2/assets/task-run._id-CiVsXKpy.js +0 -2
- prefect/server/ui-v2/assets/task-runs-pagination-DGjxL4DO.js +0 -2
- prefect/server/ui-v2/assets/use-quick-run-uAasMmAv.js +0 -2
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-CeYLESXS.js +0 -2
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev4.dist-info}/WHEEL +0 -0
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev4.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-
|
|
1
|
+
{"version":3,"file":"login-DNY0o3XU.js","sources":["../../src/components/ui/prefect-logo.tsx","../../src/components/auth/login-page.tsx","../../src/routes/login.tsx?tsr-split=component"],"sourcesContent":["interface PrefectLogoProps {\n\tclassName?: string;\n}\n\nexport function PrefectLogo({ className = \"size-11\" }: PrefectLogoProps) {\n\treturn (\n\t\t<svg\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\tfill=\"none\"\n\t\t\tviewBox=\"0 0 76 76\"\n\t\t\tclassName={className}\n\t\t\taria-label=\"Prefect Logo\"\n\t\t>\n\t\t\t<title>Prefect Logo</title>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\td=\"M15.89 15.07 38 26.543v22.935l22.104-11.47.007.004V15.068l-.003.001L38 3.598z\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\td=\"M15.89 15.07 38 26.543v22.935l22.104-11.47.007.004V15.068l-.003.001L38 3.598z\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\td=\"M37.987 49.464 15.89 38v22.944l.013-.006L38 72.402V49.457z\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { type FormEvent, useState } from \"react\";\nimport { useAuth } from \"@/auth\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Input } from \"@/components/ui/input\";\nimport { PrefectLogo } from \"@/components/ui/prefect-logo\";\n\ninterface LoginPageProps {\n\tredirectTo?: string;\n}\n\nexport function LoginPage({ redirectTo = \"/dashboard\" }: LoginPageProps) {\n\tconst [password, setPassword] = useState(\"\");\n\tconst [error, setError] = useState(\"\");\n\tconst [isSubmitting, setIsSubmitting] = useState(false);\n\tconst { login } = useAuth();\n\tconst navigate = useNavigate();\n\n\tconst handleSubmit = (e: FormEvent) => {\n\t\te.preventDefault();\n\t\tif (isSubmitting || !password.trim()) return;\n\n\t\tsetIsSubmitting(true);\n\t\tsetError(\"\");\n\n\t\tvoid login(password).then((result) => {\n\t\t\tif (result.success) {\n\t\t\t\tvoid navigate({ to: redirectTo });\n\t\t\t} else {\n\t\t\t\tsetError(result.error ?? \"Authentication failed\");\n\t\t\t\tsetIsSubmitting(false);\n\t\t\t}\n\t\t});\n\t};\n\n\treturn (\n\t\t<div className=\"flex items-center justify-center min-h-screen\">\n\t\t\t<Card className=\"w-full max-w-[400px]\">\n\t\t\t\t<CardHeader className=\"flex flex-col items-center gap-4\">\n\t\t\t\t\t<PrefectLogo className=\"size-16\" />\n\t\t\t\t\t<CardTitle>Login</CardTitle>\n\t\t\t\t</CardHeader>\n\t\t\t\t<CardContent>\n\t\t\t\t\t<form onSubmit={handleSubmit} className=\"flex flex-col gap-4\">\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\tplaceholder=\"admin:pass\"\n\t\t\t\t\t\t\tvalue={password}\n\t\t\t\t\t\t\tonChange={(e) => setPassword(e.target.value)}\n\t\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\t\tdisabled={isSubmitting}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{error && <p className=\"text-sm text-destructive\">{error}</p>}\n\t\t\t\t\t\t<Button type=\"submit\" disabled={isSubmitting} className=\"w-full\">\n\t\t\t\t\t\t\t{isSubmitting ? \"Logging in...\" : \"Login\"}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</CardContent>\n\t\t\t</Card>\n\t\t</div>\n\t);\n}\n","import { createFileRoute, Navigate, redirect } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { useAuthSafe } from \"@/auth\";\nimport { LoginPage } from \"@/components/auth/login-page\";\nimport { PrefectLoading } from \"@/components/ui/loading\";\n\nconst loginSearchSchema = z.object({\n\tredirectTo: z.string().optional(),\n});\n\nexport const Route = createFileRoute(\"/login\")({\n\tvalidateSearch: zodValidator(loginSearchSchema),\n\tbeforeLoad: ({ context, search }) => {\n\t\t// If already authenticated, redirect away from login page\n\t\tif (!context.auth.isLoading && context.auth.isAuthenticated) {\n\t\t\tredirect({ to: search.redirectTo ?? \"/dashboard\", throw: true });\n\t\t}\n\t},\n\tcomponent: LoginRouteComponent,\n});\n\nfunction LoginRouteComponent() {\n\tconst { redirectTo } = Route.useSearch();\n\tconst auth = useAuthSafe();\n\n\t// If auth context is not available (e.g., in tests), just render the login page\n\tif (!auth) {\n\t\treturn <LoginPage redirectTo={redirectTo} />;\n\t}\n\n\t// Show loading state while auth is initializing\n\tif (auth.isLoading) {\n\t\treturn <PrefectLoading />;\n\t}\n\n\t// Redirect to dashboard if already authenticated\n\t// (This handles the case where beforeLoad didn't catch it due to loading state)\n\tif (auth.isAuthenticated) {\n\t\treturn <Navigate to={redirectTo ?? \"/dashboard\"} replace={true} />;\n\t}\n\n\treturn <LoginPage redirectTo={redirectTo} />;\n}\n"],"names":["PrefectLogo","className","jsxs","jsx","LoginPage","redirectTo","password","setPassword","useState","error","setError","isSubmitting","setIsSubmitting","login","useAuth","navigate","useNavigate","handleSubmit","e","result","Card","CardHeader","CardTitle","CardContent","Input","Button","LoginRouteComponent","Route","useSearch","auth","useAuthSafe","isLoading","PrefectLoading","isAuthenticated","Navigate"],"mappings":"+VAIO,SAASA,EAAY,CAAE,UAAAC,EAAY,WAA+B,CACxE,OACCC,EAAAA,KAAC,MAAA,CACA,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,UAAAD,EACA,aAAW,eAEX,SAAA,CAAAE,EAAAA,IAAC,SAAM,SAAA,cAAA,CAAY,EACnBA,EAAAA,IAAC,OAAA,CACA,KAAK,eACL,SAAS,UACT,EAAE,gFACF,SAAS,SAAA,CAAA,EAEVA,EAAAA,IAAC,OAAA,CACA,KAAK,eACL,SAAS,UACT,EAAE,gFACF,SAAS,SAAA,CAAA,EAEVA,EAAAA,IAAC,OAAA,CACA,KAAK,eACL,SAAS,UACT,EAAE,6DACF,SAAS,SAAA,CAAA,CACV,CAAA,CAAA,CAGH,CCtBO,SAASC,EAAU,CAAE,WAAAC,EAAa,cAAgC,CACxE,KAAM,CAACC,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAE,EACrC,CAACC,EAAOC,CAAQ,EAAIF,EAAAA,SAAS,EAAE,EAC/B,CAACG,EAAcC,CAAe,EAAIJ,EAAAA,SAAS,EAAK,EAChD,CAAE,MAAAK,CAAA,EAAUC,EAAA,EACZC,EAAWC,EAAA,EAEXC,EAAgBC,GAAiB,CACtCA,EAAE,eAAA,EACE,EAAAP,GAAgB,CAACL,EAAS,UAE9BM,EAAgB,EAAI,EACpBF,EAAS,EAAE,EAENG,EAAMP,CAAQ,EAAE,KAAMa,GAAW,CACjCA,EAAO,QACLJ,EAAS,CAAE,GAAIV,EAAY,GAEhCK,EAASS,EAAO,OAAS,uBAAuB,EAChDP,EAAgB,EAAK,EAEvB,CAAC,EACF,EAEA,aACE,MAAA,CAAI,UAAU,gDACd,SAAAV,EAAAA,KAACkB,EAAA,CAAK,UAAU,uBACf,SAAA,CAAAlB,EAAAA,KAACmB,EAAA,CAAW,UAAU,mCACrB,SAAA,CAAAlB,EAAAA,IAACH,EAAA,CAAY,UAAU,SAAA,CAAU,EACjCG,EAAAA,IAACmB,GAAU,SAAA,OAAA,CAAK,CAAA,EACjB,QACCC,EAAA,CACA,SAAArB,OAAC,QAAK,SAAUe,EAAc,UAAU,sBACvC,SAAA,CAAAd,EAAAA,IAACqB,EAAA,CACA,KAAK,WACL,YAAY,aACZ,MAAOlB,EACP,SAAWY,GAAMX,EAAYW,EAAE,OAAO,KAAK,EAC3C,UAAS,GACT,SAAUP,CAAA,CAAA,EAEVF,GAASN,EAAAA,IAAC,IAAA,CAAE,UAAU,2BAA4B,SAAAM,EAAM,EACzDN,EAAAA,IAACsB,EAAA,CAAO,KAAK,SAAS,SAAUd,EAAc,UAAU,SACtD,SAAAA,EAAe,gBAAkB,OAAA,CACnC,CAAA,CAAA,CACD,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAEF,CCxCA,SAASe,GAAsB,CAC9B,KAAM,CAAErB,WAAAA,CAAAA,EAAesB,EAAMC,UAAAA,EACvBC,EAAOC,EAAAA,EAGb,OAAKD,EAKDA,EAAKE,gBACAC,EAAA,EAAc,EAKnBH,EAAKI,sBACAC,EAAA,CAAS,GAAI7B,GAAc,aAAc,QAAS,GAAK,EAGzDF,MAACC,GAAU,WAAAC,EAAuB,EAdjCF,MAACC,GAAU,WAAAC,EAAuB,CAe3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as h,r as c,j as o}from"./vendor-tanstack-
|
|
2
|
-
//# sourceMappingURL=markdown-input-
|
|
1
|
+
import{c as h,r as c,j as o}from"./vendor-tanstack-CWDKYA_B.js";import{u as g,m as x,E as b}from"./vendor-codemirror-OTxfneaa.js";import{aW as w,q as v,I as y,y as C}from"./index-DLuXqHi9.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-recharts-BGjDGXVf.js";import"./vendor-forms-D-iybWES.js";import"./vendor-date-CRz8gtWZ.js";const j=[x(),b.lineWrapping],E=h.forwardRef(({className:l,value:r,onChange:u,copy:p=!1,onBlur:N,disabled:s,hideLineNumbers:f=!1,...m},i)=>{const e=c.useRef(null);let n;s&&(n={lineNumbers:!f,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:j,value:r,onChange:u,indentWithTab:!1,editable:!s,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const d=t=>{C.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return o.jsx("div",{className:w("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...m,children:p&&r&&o.jsx(v,{onClick:()=>d(r),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:o.jsx(y,{id:"Copy",className:"size-2"})})})});E.displayName="MarkdownInput";export{E as MarkdownInput};
|
|
2
|
+
//# sourceMappingURL=markdown-input-Bos2JYXW.js.map
|
prefect/server/ui-v2/assets/{markdown-input-CGOAnaWz.js.map → markdown-input-Bos2JYXW.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-input-
|
|
1
|
+
{"version":3,"file":"markdown-input-Bos2JYXW.js","sources":["../../src/components/ui/markdown-input.tsx"],"sourcesContent":["import { markdown } from \"@codemirror/lang-markdown\";\nimport {\n\ttype BasicSetupOptions,\n\tEditorView,\n\tuseCodeMirror,\n} from \"@uiw/react-codemirror\";\nimport React, { useEffect, useRef } from \"react\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/utils\";\nimport { Button } from \"./button\";\nimport { Icon } from \"./icons\";\n\nconst extensions = [markdown(), EditorView.lineWrapping];\n\ntype MarkdownInputProps = React.ComponentProps<\"div\"> & {\n\tvalue?: string;\n\tonChange?: (value: string) => void;\n\tonBlur?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport const MarkdownInput = React.forwardRef<\n\tHTMLDivElement,\n\tMarkdownInputProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tcopy = false,\n\t\t\tonBlur,\n\t\t\tdisabled,\n\t\t\thideLineNumbers = false,\n\t\t\t...props\n\t\t},\n\t\tforwardedRef,\n\t) => {\n\t\tconst editor = useRef<HTMLDivElement | null>(null);\n\t\t// Setting `basicSetup` messes up the tab order. We only change the basic setup\n\t\t// if the input is disabled, so we leave it undefined to maintain the tab order.\n\t\tlet basicSetup: BasicSetupOptions | undefined;\n\t\tif (disabled) {\n\t\t\tbasicSetup = {\n\t\t\t\tlineNumbers: !hideLineNumbers,\n\t\t\t\thighlightActiveLine: false,\n\t\t\t\tfoldGutter: false,\n\t\t\t\thighlightActiveLineGutter: false,\n\t\t\t};\n\t\t}\n\t\tconst { setContainer } = useCodeMirror({\n\t\t\tcontainer: editor.current,\n\t\t\textensions,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tonBlur,\n\t\t\tindentWithTab: false,\n\t\t\teditable: !disabled,\n\t\t\tbasicSetup,\n\t\t});\n\n\t\tuseEffect(() => {\n\t\t\tif (editor.current) {\n\t\t\t\tsetContainer(editor.current);\n\t\t\t}\n\t\t}, [setContainer]);\n\n\t\tconst handleCopy = (_value: string) => {\n\t\t\ttoast.success(\"Copied to clipboard\");\n\t\t\tvoid navigator.clipboard.writeText(_value);\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={(node) => {\n\t\t\t\t\teditor.current = node;\n\t\t\t\t\tif (typeof forwardedRef === \"function\") {\n\t\t\t\t\t\tforwardedRef(node);\n\t\t\t\t\t} else if (forwardedRef) {\n\t\t\t\t\t\tforwardedRef.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{copy && value && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={() => handleCopy(value)}\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName=\"absolute top-0 right-0 z-10\"\n\t\t\t\t\t\taria-label=\"copy\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Copy\" className=\"size-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nMarkdownInput.displayName = \"MarkdownInput\";\n"],"names":["extensions","markdown","EditorView","MarkdownInput","React","className","value","onChange","copy","onBlur","disabled","hideLineNumbers","props","forwardedRef","editor","useRef","basicSetup","setContainer","useCodeMirror","useEffect","handleCopy","_value","toast","jsx","cn","node","Button","Icon"],"mappings":"iXAYA,MAAMA,EAAa,CAACC,IAAYC,EAAW,YAAY,EAY1CC,EAAgBC,EAAM,WAIlC,CACC,CACC,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,GACP,OAAAC,EACA,SAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CAAA,EAEJC,IACI,CACJ,MAAMC,EAASC,EAAAA,OAA8B,IAAI,EAGjD,IAAIC,EACAN,IACHM,EAAa,CACZ,YAAa,CAACL,EACd,oBAAqB,GACrB,WAAY,GACZ,0BAA2B,EAAA,GAG7B,KAAM,CAAE,aAAAM,CAAA,EAAiBC,EAAc,CACtC,UAAWJ,EAAO,QAClB,WAAAd,EACA,MAAAM,EACA,SAAAC,EAEA,cAAe,GACf,SAAU,CAACG,EACX,WAAAM,CAAA,CACA,EAEDG,EAAAA,UAAU,IAAM,CACXL,EAAO,SACVG,EAAaH,EAAO,OAAO,CAE7B,EAAG,CAACG,CAAY,CAAC,EAEjB,MAAMG,EAAcC,GAAmB,CACtCC,EAAM,QAAQ,qBAAqB,EAC9B,UAAU,UAAU,UAAUD,CAAM,CAC1C,EAEA,OACCE,EAAAA,IAAC,MAAA,CACA,UAAWC,EACV,8HACAnB,CAAA,EAED,IAAMoB,GAAS,CACdX,EAAO,QAAUW,EACb,OAAOZ,GAAiB,WAC3BA,EAAaY,CAAI,EACPZ,IACVA,EAAa,QAAUY,EAEzB,EACC,GAAGb,EAEH,YAAQN,GACRiB,EAAAA,IAACG,EAAA,CACA,QAAS,IAAMN,EAAWd,CAAK,EAC/B,QAAQ,QACR,KAAK,OACL,UAAU,8BACV,aAAW,OAEX,SAAAiB,EAAAA,IAACI,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CAAA,CAIJ,CACD,EAEAxB,EAAc,YAAc"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/python-input-
|
|
2
|
-
import{j as e,r as s}from"./vendor-tanstack-
|
|
3
|
-
//# sourceMappingURL=python-example-snippet-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/python-input-Bu4995lK.js","assets/vendor-tanstack-CWDKYA_B.js","assets/vendor-react-Bce9NwRC.js","assets/vendor-codemirror-OTxfneaa.js","assets/index-DLuXqHi9.js","assets/vendor-radix-DRMjKWJW.js","assets/vendor-recharts-BGjDGXVf.js","assets/vendor-forms-D-iybWES.js","assets/vendor-date-CRz8gtWZ.js","assets/index-CYc_PWA3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as s}from"./vendor-tanstack-CWDKYA_B.js";import{b5 as p,cc as c}from"./index-DLuXqHi9.js";const i=s.lazy(()=>c(()=>import("./python-input-Bu4995lK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(t=>({default:t.PythonInput})));function a({className:t,...n}){return e.jsx(s.Suspense,{fallback:e.jsx(p,{className:`min-h-[200px] ${t??""}`}),children:e.jsx(i,{className:t,...n})})}function h({codeExample:t,name:n}){const o=s.useMemo(()=>{const[,r=""]=t.match(/```python([\S\s]*?)```/)??[];return r.replace("BLOCK_NAME",n??"block-name").trim()},[t,n]);return e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(a,{className:"p-2",value:o,disabled:!0,copy:!0,hideLineNumbers:!0})})}export{h as P};
|
|
3
|
+
//# sourceMappingURL=python-example-snippet-CWSJRd48.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";0GAIA,MAAMA,EAAkBC,OAAK,IAAAC,EAAA,IAC5B,OAAO,4BAAgB,0CAAE,KAAMC,IAAS,CAAE,QAASA,EAAI,aAAc,CACtE,EAIO,SAASC,EAAgB,CAAE,UAAAC,EAAW,GAAGC,GAA+B,CAC9E,OACCC,MAACC,WAAA,CACA,SAAUD,MAACE,EAAA,CAAS,UAAW,iBAAiBJ,GAAa,EAAE,GAAI,EAEnE,SAAAE,MAACP,EAAA,CAAgB,UAAAK,EAAuB,GAAGC,CAAA,CAAO,GAGrD,CCXO,SAASI,EAAmB,CAClC,YAAAC,EACA,KAAAC,CACD,EAA4B,CAC3B,MAAMC,EAAUC,UAAQ,IAAM,CAC7B,KAAM,EAAGC,EAAiB,EAAE,EAC3BJ,EAAY,MAAM,wBAAwB,GAAK,GAKhD,OAJsBI,EAAe,QACpC,aACAH,GAAQ,cAEY,MACtB,EAAG,CAACD,EAAaC,CAAI,CAAC,EAEtB,OACCL,MAAC,OAAI,UAAU,sBACd,SAAAA,MAACS,EAAA,CACA,UAAU,MACV,MAAOH,EACP,SAAQ,GACR,KAAI,GACJ,gBAAe,KAEjB,CAEF","names":["PythonInputLazy","lazy","__vitePreload","mod","LazyPythonInput","className","props","jsx","Suspense","Skeleton","PythonBlockSnippet","codeExample","name","snippet","useMemo","genericSnippet","PythonInput"],"ignoreList":[],"sources":["../../src/components/ui/python-input-lazy.tsx","../../src/components/blocks/python-example-snippet.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { lazy, Suspense } from \"react\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\nconst PythonInputLazy = lazy(() =>\n\timport(\"./python-input\").then((mod) => ({ default: mod.PythonInput })),\n);\n\ntype LazyPythonInputProps = ComponentProps<typeof PythonInputLazy>;\n\nexport function LazyPythonInput({ className, ...props }: LazyPythonInputProps) {\n\treturn (\n\t\t<Suspense\n\t\t\tfallback={<Skeleton className={`min-h-[200px] ${className ?? \"\"}`} />}\n\t\t>\n\t\t\t<PythonInputLazy className={className} {...props} />\n\t\t</Suspense>\n\t);\n}\n","import { useMemo } from \"react\";\nimport { LazyPythonInput as PythonInput } from \"@/components/ui/python-input-lazy\";\n\ntype PythonBlockSnippetProps = {\n\tcodeExample: string;\n\tname: string | undefined | null;\n};\nexport function PythonBlockSnippet({\n\tcodeExample,\n\tname,\n}: PythonBlockSnippetProps) {\n\tconst snippet = useMemo(() => {\n\t\tconst [, genericSnippet = \"\"] =\n\t\t\tcodeExample.match(/```python([\\S\\s]*?)```/) ?? [];\n\t\tconst customSnippet = genericSnippet.replace(\n\t\t\t\"BLOCK_NAME\",\n\t\t\tname ?? \"block-name\",\n\t\t);\n\t\treturn customSnippet.trim();\n\t}, [codeExample, name]);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<PythonInput\n\t\t\t\tclassName=\"p-2\"\n\t\t\t\tvalue={snippet}\n\t\t\t\tdisabled\n\t\t\t\tcopy\n\t\t\t\thideLineNumbers\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"file":"python-example-snippet-
|
|
1
|
+
{"version":3,"mappings":";0GAIA,MAAMA,EAAkBC,OAAK,IAAAC,EAAA,IAC5B,OAAO,4BAAgB,0CAAE,KAAMC,IAAS,CAAE,QAASA,EAAI,aAAc,CACtE,EAIO,SAASC,EAAgB,CAAE,UAAAC,EAAW,GAAGC,GAA+B,CAC9E,OACCC,MAACC,WAAA,CACA,SAAUD,MAACE,EAAA,CAAS,UAAW,iBAAiBJ,GAAa,EAAE,GAAI,EAEnE,SAAAE,MAACP,EAAA,CAAgB,UAAAK,EAAuB,GAAGC,CAAA,CAAO,GAGrD,CCXO,SAASI,EAAmB,CAClC,YAAAC,EACA,KAAAC,CACD,EAA4B,CAC3B,MAAMC,EAAUC,UAAQ,IAAM,CAC7B,KAAM,EAAGC,EAAiB,EAAE,EAC3BJ,EAAY,MAAM,wBAAwB,GAAK,GAKhD,OAJsBI,EAAe,QACpC,aACAH,GAAQ,cAEY,MACtB,EAAG,CAACD,EAAaC,CAAI,CAAC,EAEtB,OACCL,MAAC,OAAI,UAAU,sBACd,SAAAA,MAACS,EAAA,CACA,UAAU,MACV,MAAOH,EACP,SAAQ,GACR,KAAI,GACJ,gBAAe,KAEjB,CAEF","names":["PythonInputLazy","lazy","__vitePreload","mod","LazyPythonInput","className","props","jsx","Suspense","Skeleton","PythonBlockSnippet","codeExample","name","snippet","useMemo","genericSnippet","PythonInput"],"ignoreList":[],"sources":["../../src/components/ui/python-input-lazy.tsx","../../src/components/blocks/python-example-snippet.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { lazy, Suspense } from \"react\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\nconst PythonInputLazy = lazy(() =>\n\timport(\"./python-input\").then((mod) => ({ default: mod.PythonInput })),\n);\n\ntype LazyPythonInputProps = ComponentProps<typeof PythonInputLazy>;\n\nexport function LazyPythonInput({ className, ...props }: LazyPythonInputProps) {\n\treturn (\n\t\t<Suspense\n\t\t\tfallback={<Skeleton className={`min-h-[200px] ${className ?? \"\"}`} />}\n\t\t>\n\t\t\t<PythonInputLazy className={className} {...props} />\n\t\t</Suspense>\n\t);\n}\n","import { useMemo } from \"react\";\nimport { LazyPythonInput as PythonInput } from \"@/components/ui/python-input-lazy\";\n\ntype PythonBlockSnippetProps = {\n\tcodeExample: string;\n\tname: string | undefined | null;\n};\nexport function PythonBlockSnippet({\n\tcodeExample,\n\tname,\n}: PythonBlockSnippetProps) {\n\tconst snippet = useMemo(() => {\n\t\tconst [, genericSnippet = \"\"] =\n\t\t\tcodeExample.match(/```python([\\S\\s]*?)```/) ?? [];\n\t\tconst customSnippet = genericSnippet.replace(\n\t\t\t\"BLOCK_NAME\",\n\t\t\tname ?? \"block-name\",\n\t\t);\n\t\treturn customSnippet.trim();\n\t}, [codeExample, name]);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<PythonInput\n\t\t\t\tclassName=\"p-2\"\n\t\t\t\tvalue={snippet}\n\t\t\t\tdisabled\n\t\t\t\tcopy\n\t\t\t\thideLineNumbers\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"file":"python-example-snippet-CWSJRd48.js"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as d,r as c,j as s}from"./vendor-tanstack-
|
|
2
|
-
//# sourceMappingURL=python-input-
|
|
1
|
+
import{c as d,r as c,j as s}from"./vendor-tanstack-CWDKYA_B.js";import{u as g,p as x,E as y}from"./vendor-codemirror-OTxfneaa.js";import{aW as b,q as v,I as C,y as j}from"./index-DLuXqHi9.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-recharts-BGjDGXVf.js";import"./vendor-forms-D-iybWES.js";import"./vendor-date-CRz8gtWZ.js";const w=[x(),y.lineWrapping],E=d.forwardRef(({className:l,value:o,onChange:p,copy:u=!1,onBlur:N,disabled:r,hideLineNumbers:h=!1,...f},i)=>{const e=c.useRef(null);let n;r&&(n={lineNumbers:!h,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:w,value:o,onChange:p,indentWithTab:!1,editable:!r,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const m=t=>{j.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return s.jsx("div",{className:b("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...f,children:u&&o&&s.jsx(v,{onClick:()=>m(o),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:s.jsx(C,{id:"Copy",className:"size-2"})})})});E.displayName="PythonInput";export{E as PythonInput};
|
|
2
|
+
//# sourceMappingURL=python-input-Bu4995lK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"python-input-
|
|
1
|
+
{"version":3,"file":"python-input-Bu4995lK.js","sources":["../../src/components/ui/python-input.tsx"],"sourcesContent":["import { python } from \"@codemirror/lang-python\";\nimport {\n\ttype BasicSetupOptions,\n\tEditorView,\n\tuseCodeMirror,\n} from \"@uiw/react-codemirror\";\nimport React, { useEffect, useRef } from \"react\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/utils\";\nimport { Button } from \"./button\";\nimport { Icon } from \"./icons\";\n\nconst extensions = [python(), EditorView.lineWrapping];\n\ntype PythonInputProps = React.ComponentProps<\"div\"> & {\n\tvalue?: string;\n\tonChange?: (value: string) => void;\n\tonBlur?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport const PythonInput = React.forwardRef<HTMLDivElement, PythonInputProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tcopy = false,\n\t\t\tonBlur,\n\t\t\tdisabled,\n\t\t\thideLineNumbers = false,\n\t\t\t...props\n\t\t},\n\t\tforwardedRef,\n\t) => {\n\t\tconst editor = useRef<HTMLDivElement | null>(null);\n\t\t// Setting `basicSetup` messes up the tab order. We only change the basic setup\n\t\t// if the input is disabled, so we leave it undefined to maintain the tab order.\n\t\tlet basicSetup: BasicSetupOptions | undefined;\n\t\tif (disabled) {\n\t\t\tbasicSetup = {\n\t\t\t\tlineNumbers: !hideLineNumbers,\n\t\t\t\thighlightActiveLine: false,\n\t\t\t\tfoldGutter: false,\n\t\t\t\thighlightActiveLineGutter: false,\n\t\t\t};\n\t\t}\n\t\tconst { setContainer } = useCodeMirror({\n\t\t\tcontainer: editor.current,\n\t\t\textensions,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tonBlur,\n\t\t\tindentWithTab: false,\n\t\t\teditable: !disabled,\n\t\t\tbasicSetup,\n\t\t});\n\n\t\tuseEffect(() => {\n\t\t\tif (editor.current) {\n\t\t\t\tsetContainer(editor.current);\n\t\t\t}\n\t\t}, [setContainer]);\n\n\t\tconst handleCopy = (_value: string) => {\n\t\t\ttoast.success(\"Copied to clipboard\");\n\t\t\tvoid navigator.clipboard.writeText(_value);\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={(node) => {\n\t\t\t\t\teditor.current = node;\n\t\t\t\t\tif (typeof forwardedRef === \"function\") {\n\t\t\t\t\t\tforwardedRef(node);\n\t\t\t\t\t} else if (forwardedRef) {\n\t\t\t\t\t\tforwardedRef.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{copy && value && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={() => handleCopy(value)}\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName=\"absolute top-0 right-0 z-10\"\n\t\t\t\t\t\taria-label=\"copy\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Copy\" className=\"size-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nPythonInput.displayName = \"PythonInput\";\n"],"names":["extensions","python","EditorView","PythonInput","React","className","value","onChange","copy","onBlur","disabled","hideLineNumbers","props","forwardedRef","editor","useRef","basicSetup","setContainer","useCodeMirror","useEffect","handleCopy","_value","toast","jsx","cn","node","Button","Icon"],"mappings":"iXAYA,MAAMA,EAAa,CAACC,IAAUC,EAAW,YAAY,EAYxCC,EAAcC,EAAM,WAChC,CACC,CACC,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,GACP,OAAAC,EACA,SAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CAAA,EAEJC,IACI,CACJ,MAAMC,EAASC,EAAAA,OAA8B,IAAI,EAGjD,IAAIC,EACAN,IACHM,EAAa,CACZ,YAAa,CAACL,EACd,oBAAqB,GACrB,WAAY,GACZ,0BAA2B,EAAA,GAG7B,KAAM,CAAE,aAAAM,CAAA,EAAiBC,EAAc,CACtC,UAAWJ,EAAO,QAClB,WAAAd,EACA,MAAAM,EACA,SAAAC,EAEA,cAAe,GACf,SAAU,CAACG,EACX,WAAAM,CAAA,CACA,EAEDG,EAAAA,UAAU,IAAM,CACXL,EAAO,SACVG,EAAaH,EAAO,OAAO,CAE7B,EAAG,CAACG,CAAY,CAAC,EAEjB,MAAMG,EAAcC,GAAmB,CACtCC,EAAM,QAAQ,qBAAqB,EAC9B,UAAU,UAAU,UAAUD,CAAM,CAC1C,EAEA,OACCE,EAAAA,IAAC,MAAA,CACA,UAAWC,EACV,8HACAnB,CAAA,EAED,IAAMoB,GAAS,CACdX,EAAO,QAAUW,EACb,OAAOZ,GAAiB,WAC3BA,EAAaY,CAAI,EACPZ,IACVA,EAAa,QAAUY,EAEzB,EACC,GAAGb,EAEH,YAAQN,GACRiB,EAAAA,IAACG,EAAA,CACA,QAAS,IAAMN,EAAWd,CAAK,EAC/B,QAAQ,QACR,KAAK,OACL,UAAU,8BACV,aAAW,OAEX,SAAAiB,EAAAA,IAACI,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CAAA,CAIJ,CACD,EAEAxB,EAAY,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,j as r}from"./vendor-tanstack-
|
|
2
|
-
//# sourceMappingURL=radio-group-
|
|
1
|
+
import{r as o,j as r}from"./vendor-tanstack-CWDKYA_B.js";import{ak as i,al as t,am as l}from"./vendor-radix-DRMjKWJW.js";import{aW as c,cV as n}from"./index-DLuXqHi9.js";const d=o.forwardRef(({className:a,...s},e)=>r.jsx(i,{className:c("grid gap-2",a),...s,ref:e}));d.displayName=i.displayName;const m=o.forwardRef(({className:a,...s},e)=>r.jsx(t,{ref:e,className:c("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),...s,children:r.jsx(l,{className:"flex items-center justify-center",children:r.jsx(n,{className:"h-2.5 w-2.5 fill-current text-current"})})}));m.displayName=t.displayName;export{d as R,m as a};
|
|
2
|
+
//# sourceMappingURL=radio-group-C0D0oLYd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-
|
|
1
|
+
{"version":3,"file":"radio-group-C0D0oLYd.js","sources":["../../src/components/ui/radio-group.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst RadioGroup = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Root\n\t\t\tclassName={cn(\"grid gap-2\", className)}\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t/>\n\t);\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n\t\t\t\t<Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n\t\t\t</RadioGroupPrimitive.Indicator>\n\t\t</RadioGroupPrimitive.Item>\n\t);\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n"],"names":["RadioGroup","React.forwardRef","className","props","ref","jsx","RadioGroupPrimitive.Root","cn","RadioGroupItem","RadioGroupPrimitive.Item","RadioGroupPrimitive.Indicator","Circle"],"mappings":"0KAMA,MAAMA,EAAaC,EAAAA,WAGjB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACC,EAAA,CACA,UAAWC,EAAG,aAAcL,CAAS,EACpC,GAAGC,EACJ,IAAAC,CAAA,CAAA,CAGF,EACDJ,EAAW,YAAcM,EAAyB,YAElD,MAAME,EAAiBP,EAAAA,WAGrB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACI,EAAA,CACA,IAAAL,EACA,UAAWG,EACV,2OACAL,CAAA,EAEA,GAAGC,EAEJ,SAAAE,EAAAA,IAACK,EAAA,CAA8B,UAAU,mCACxC,SAAAL,EAAAA,IAACM,EAAA,CAAO,UAAU,uCAAA,CAAwC,CAAA,CAC3D,CAAA,CAAA,CAGF,EACDH,EAAe,YAAcC,EAAyB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,j as e}from"./vendor-tanstack-
|
|
2
|
-
//# sourceMappingURL=route-error-state-
|
|
1
|
+
import{r as s,j as e}from"./vendor-tanstack-CWDKYA_B.js";import{C as f,o as R,cd as h,q as g,ce as j,aW as p}from"./index-DLuXqHi9.js";const N=5e3,v=3e4;function u(a){const t=N*2**a;return Math.min(t,v)}function E({error:a,onRetry:t}){const r=s.useRef(0),[m,l]=s.useState(u(0)/1e3),[c,n]=s.useState(!1),d=s.useCallback(()=>{n(!0),t(),r.current+=1;const i=u(r.current);l(i/1e3),setTimeout(()=>n(!1),500)},[t]),x=s.useCallback(()=>{n(!0),t(),r.current=0,l(u(0)/1e3),setTimeout(()=>n(!1),500)},[t]);return s.useEffect(()=>{const i=setInterval(()=>{l(o=>o<=1?(d(),o):o-1)},1e3);return()=>clearInterval(i)},[d]),e.jsx(f,{className:"mx-auto max-w-md",children:e.jsxs(R,{className:"flex flex-col items-center gap-4 pt-6 text-center",children:[e.jsx("div",{className:"rounded-full bg-destructive/10 p-3",children:e.jsx(h,{className:"size-8 text-destructive"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.message}),a.details&&e.jsx("p",{className:"text-sm text-muted-foreground",children:a.details})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs(g,{onClick:x,disabled:c,variant:"outline",className:"gap-2",children:[e.jsx(j,{className:p("size-4",c&&"animate-spin")}),c?"Retrying...":"Retry"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retrying in ",m,"s"]})]})]})})}export{E as R};
|
|
2
|
+
//# sourceMappingURL=route-error-state-DzKu_Iw_.js.map
|
prefect/server/ui-v2/assets/{route-error-state-CVHTggxQ.js.map → route-error-state-DzKu_Iw_.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-error-state-
|
|
1
|
+
{"version":3,"file":"route-error-state-DzKu_Iw_.js","sources":["../../src/components/ui/route-error-state.tsx"],"sourcesContent":["import { AlertCircle, RefreshCw } from \"lucide-react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ServerError } from \"@/api/error-utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport { cn } from \"@/utils\";\n\nconst BASE_RETRY_INTERVAL_MS = 5000;\nconst MAX_RETRY_INTERVAL_MS = 30000;\n\nfunction getRetryInterval(attempt: number): number {\n\tconst interval = BASE_RETRY_INTERVAL_MS * 2 ** attempt;\n\treturn Math.min(interval, MAX_RETRY_INTERVAL_MS);\n}\n\ntype RouteErrorStateProps = {\n\terror: ServerError;\n\tonRetry: () => void;\n};\n\nexport function RouteErrorState({ error, onRetry }: RouteErrorStateProps) {\n\tconst retryAttemptRef = useRef(0);\n\tconst [secondsUntilRetry, setSecondsUntilRetry] = useState(\n\t\tgetRetryInterval(0) / 1000,\n\t);\n\tconst [isRetrying, setIsRetrying] = useState(false);\n\n\tconst handleAutoRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current += 1;\n\t\tconst nextInterval = getRetryInterval(retryAttemptRef.current);\n\t\tsetSecondsUntilRetry(nextInterval / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tconst handleManualRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current = 0;\n\t\tsetSecondsUntilRetry(getRetryInterval(0) / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tuseEffect(() => {\n\t\tconst interval = setInterval(() => {\n\t\t\tsetSecondsUntilRetry((prev) => {\n\t\t\t\tif (prev <= 1) {\n\t\t\t\t\thandleAutoRetry();\n\t\t\t\t\treturn prev;\n\t\t\t\t}\n\t\t\t\treturn prev - 1;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [handleAutoRetry]);\n\n\treturn (\n\t\t<Card className=\"mx-auto max-w-md\">\n\t\t\t<CardContent className=\"flex flex-col items-center gap-4 pt-6 text-center\">\n\t\t\t\t<div className=\"rounded-full bg-destructive/10 p-3\">\n\t\t\t\t\t<AlertCircle className=\"size-8 text-destructive\" />\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t<h2 className=\"text-lg font-semibold\">{error.message}</h2>\n\t\t\t\t\t{error.details && (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground\">{error.details}</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex flex-col items-center gap-2\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={handleManualRetry}\n\t\t\t\t\t\tdisabled={isRetrying}\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tclassName=\"gap-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<RefreshCw className={cn(\"size-4\", isRetrying && \"animate-spin\")} />\n\t\t\t\t\t\t{isRetrying ? \"Retrying...\" : \"Retry\"}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<p className=\"text-xs text-muted-foreground\">\n\t\t\t\t\t\tRetrying in {secondsUntilRetry}s\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n"],"names":["BASE_RETRY_INTERVAL_MS","MAX_RETRY_INTERVAL_MS","getRetryInterval","attempt","interval","RouteErrorState","error","onRetry","retryAttemptRef","useRef","secondsUntilRetry","setSecondsUntilRetry","useState","isRetrying","setIsRetrying","handleAutoRetry","useCallback","nextInterval","handleManualRetry","useEffect","prev","Card","jsxs","CardContent","jsx","AlertCircle","Button","RefreshCw","cn"],"mappings":"uIAOA,MAAMA,EAAyB,IACzBC,EAAwB,IAE9B,SAASC,EAAiBC,EAAyB,CAClD,MAAMC,EAAWJ,EAAyB,GAAKG,EAC/C,OAAO,KAAK,IAAIC,EAAUH,CAAqB,CAChD,CAOO,SAASI,EAAgB,CAAE,MAAAC,EAAO,QAAAC,GAAiC,CACzE,MAAMC,EAAkBC,EAAAA,OAAO,CAAC,EAC1B,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SACjDV,EAAiB,CAAC,EAAI,GAAA,EAEjB,CAACW,EAAYC,CAAa,EAAIF,EAAAA,SAAS,EAAK,EAE5CG,EAAkBC,EAAAA,YAAY,IAAM,CACzCF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,SAAW,EAC3B,MAAMS,EAAef,EAAiBM,EAAgB,OAAO,EAC7DG,EAAqBM,EAAe,GAAI,EACxC,WAAW,IAAMH,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAENW,EAAoBF,EAAAA,YAAY,IAAM,CAC3CF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,QAAU,EAC1BG,EAAqBT,EAAiB,CAAC,EAAI,GAAI,EAC/C,WAAW,IAAMY,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAEZY,OAAAA,EAAAA,UAAU,IAAM,CACf,MAAMf,EAAW,YAAY,IAAM,CAClCO,EAAsBS,GACjBA,GAAQ,GACXL,EAAA,EACOK,GAEDA,EAAO,CACd,CACF,EAAG,GAAI,EAEP,MAAO,IAAM,cAAchB,CAAQ,CACpC,EAAG,CAACW,CAAe,CAAC,QAGlBM,EAAA,CAAK,UAAU,mBACf,SAAAC,EAAAA,KAACC,EAAA,CAAY,UAAU,oDACtB,SAAA,CAAAC,EAAAA,IAAC,OAAI,UAAU,qCACd,eAACC,EAAA,CAAY,UAAU,0BAA0B,CAAA,CAClD,EAEAH,EAAAA,KAAC,MAAA,CAAI,UAAU,YACd,SAAA,CAAAE,EAAAA,IAAC,KAAA,CAAG,UAAU,wBAAyB,SAAAlB,EAAM,QAAQ,EACpDA,EAAM,SACNkB,EAAAA,IAAC,KAAE,UAAU,gCAAiC,WAAM,OAAA,CAAQ,CAAA,EAE9D,EAEAF,EAAAA,KAAC,MAAA,CAAI,UAAU,mCACd,SAAA,CAAAA,EAAAA,KAACI,EAAA,CACA,QAASR,EACT,SAAUL,EACV,QAAQ,UACR,UAAU,QAEV,SAAA,CAAAW,MAACG,GAAU,UAAWC,EAAG,SAAUf,GAAc,cAAc,EAAG,EACjEA,EAAa,cAAgB,OAAA,CAAA,CAAA,EAG/BS,EAAAA,KAAC,IAAA,CAAE,UAAU,gCAAgC,SAAA,CAAA,eAC/BZ,EAAkB,GAAA,CAAA,CAChC,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAEF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as d,j as s,p as je}from"./vendor-tanstack-CLpbOGYv.js";import{u as Oe}from"./use-debounce-callback-Dcf0d0U7.js";import{bH as Y,C as X,q as R,I as pe,ac as Z,ad as ee,ae as ne,af as te,ah as re,ag as se,aj as U,bp as Pe,ai as Q,G as Fe,p as z,L as ie,a6 as De,cH as Ee,cI as Ve,aW as Me,at as Ae,cJ as Te,cK as $e,i as Ke}from"./index-BZqccBpn.js";import{D as Le,a as Be,b as Ue,d as C,e as Je}from"./dropdown-menu-g64QiYKu.js";import{m as B,b as F,i as ue,p as Re,g as ze,c as We,C as Ge,d as qe,e as le,D as He,f as Qe,S as Ye,v as Xe,s as Ze,K as en,P as nn,h as tn,B as rn,j as sn,k as on}from"./schema-form-input-string-format-datetime-DuEmswz-.js";import{H as an,a4 as cn,e as un,f as fe}from"./vendor-date-Bxa7CHB1.js";import{T as ln,a as fn}from"./toggle-group-CvPe0UY1.js";import{T as dn}from"./textarea-Mne2s-1n.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CP6hQtRc.js";import"./vendor-recharts-BOcghvr2.js";import"./vendor-forms-mroZAMaw.js";import"./zod-cc-7bk3x.js";import"./timezone-select-CPBtT8tA.js";import"./form-CdcF42XZ.js";const mn=[["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"}]],hn=Y("eye-off",mn);const xn=[["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"}]],jn=Y("eye",xn);const pn=[["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"}]],gn=Y("grip-vertical",pn);function I(e){return e!==void 0}function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!an(e)}function O(e){return Array.isArray(e)}function bn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function M(e){return"$ref"in e}function ge(e){return"anyOf"in e&&I(e.anyOf)}function yn(e){return"oneOf"in e&&I(e.oneOf)}function Sn(e){return"allOf"in e&&I(e.allOf)}function vn(e){return"items"in e&&I(e.items)}function wn(e){return"definitions"in e&&N(e.definitions)}function A(e,n){if(wn(e)){const t=n.replace("#/definitions/",""),r=e.definitions?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}if("$defs"in e&&N(e.$defs)){const t=n.replace("#/$defs/",""),r=e.$defs?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}throw new Error("Schema does not contain definitions")}function be(e,n){if(M(e)&&typeof e.$ref=="string"){const{$ref:t,...r}=e;return B({},A(n,t),r)}return e}function _n({property:e,value:n,onValueChange:t,errors:r,id:i}){const{schema:o}=F(),c=d.useMemo(()=>{const{allOf:a,...f}=e,u=a.reduce((h,p)=>{if(M(p)){const l=A(o,p.$ref);return B({},h,l)}return B({},h,p)},{});return B({},u,f)},[e,o]);return s.jsx(ae,{value:n,onValueChange:t,errors:r,property:c,id:i})}function In({value:e,property:n,schema:t}){const r=I(e)?e:n.default;if(!I(r))return 0;const i=kn(n,t);switch(typeof r){case"string":return i.findIndex(o=>o.type==="string");case"number":return i.findIndex(o=>o.type==="number"||o.type==="integer");case"boolean":return i.findIndex(o=>o.type==="boolean");case"object":return Nn(r,i);default:return-1}}function kn(e,n){return e.anyOf?e.anyOf.map(t=>M(t)?A(n,t.$ref):t):[]}function Nn(e,n){return N(e)?Cn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Cn(e,n){if(bn(e))return n.findIndex(o=>o.type==="object");const t=Object.keys(e),[r,i]=n.reduce(([o,c],a,f)=>{if(!("properties"in a)||!a.properties)return[o,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[f,h]:[o,c]},[0,0]);return i===0?-1:r}const On={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function Pn(e){if(e.type&&typeof e.type=="string")return On[e.type]}function oe(e,n){if(M(e)){const r=A(n,e.$ref);return oe(r,n)}const t=Pn(e)??"Field";return e.title??e.format??t}function q({value:e,property:n,onValueChange:t,errors:r}){const{schema:i}=F(),[o,c]=d.useState(In({value:e,property:n,schema:i})),a=d.useRef(new Map);function f(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(o,e),c(h),t(a.current.get(h))}return s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ln,{size:"sm",variant:"outline",type:"single",value:o.toString(),onValueChange:f,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=oe(u,i);return s.jsx(fn,{value:h.toString(),children:p},p)})}),s.jsx(X,{className:"p-2",children:s.jsx(Ne,{value:e,property:n.anyOf[o],onValueChange:t,errors:r,showLabel:!1,nested:!1,required:!1})})]})}const b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));function Fn(e,n=0){return(b[e[n+0]]+b[e[n+1]]+b[e[n+2]]+b[e[n+3]]+"-"+b[e[n+4]]+b[e[n+5]]+"-"+b[e[n+6]]+b[e[n+7]]+"-"+b[e[n+8]]+b[e[n+9]]+"-"+b[e[n+10]]+b[e[n+11]]+b[e[n+12]]+b[e[n+13]]+b[e[n+14]]+b[e[n+15]]).toLowerCase()}let H;const Dn=new Uint8Array(16);function En(){if(!H){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H=crypto.getRandomValues.bind(crypto)}return H(Dn)}const Vn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),de={randomUUID:Vn};function Mn(e,n,t){e=e||{};const r=e.random??e.rng?.()??En();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Fn(r)}function me(e,n,t){return de.randomUUID&&!e?de.randomUUID():Mn(e)}function An(e){return typeof e=="string"}function ye(e){return N(e)&&"property"in e}function Se(e){return N(e)&&"index"in e}function ve({errors:e}){const n=d.useMemo(()=>e.filter(t=>An(t)),[e]);return n.length===0?null:n.length===1?s.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):s.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>s.jsx("li",{children:t},t))})}function we(e){return L(e)?e.__prefect_kind:null}function L(e,n){return N(e)&&ue(e.__prefect_kind)?ue(n)?e.__prefect_kind===n:!0:!1}function Tn({value:e,property:n,schema:t,to:r}){const i=we(e);try{switch(i){case"json":return $n({json:e,property:n,schema:t,to:r});case"jinja":return Kn({jinja:e,property:n,schema:t,to:r});case"workspace_variable":return Ln({workspaceVariable:e,to:r});case null:return Bn({value:e,property:n,schema:t,to:r});default:throw new Error(`Unknown prefect kind value: ${i}`)}}catch(o){console.error(o);return}}function $n({json:e,property:n,schema:t,to:r}){switch(r){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 i=JSON.parse(e.value);return W({value:i,property:n,schema:t})}catch{throw new _e("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Kn({jinja:e,property:n,schema:t,to:r}){switch(r){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 i=JSON.parse(e.template);return W({value:i,property:n,schema:t})}catch{throw new _e("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Ln({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 Bn({value:e,property:n,schema:t,to:r}){switch(r){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 W({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${r}`)}}function W({value:e,property:n,schema:t}){return O(n)?n.map(i=>J({value:e,property:i,schema:t})).find(i=>i!==void 0):J({value:e,property:n,schema:t})}function J({value:e,property:n,schema:t}){const r=be(n,t);if(ge(r))return W({value:e,property:r.anyOf,schema:t});switch(r.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 Un({value:e,property:r,schema:t});case"object":return Jn({value:e,property:r,schema:t});default:if(O(r.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${r.type}`)}}function Un({value:e,property:n,schema:t}){return O(e)?[...e].map(i=>J({value:i,property:n,schema:t})):void 0}function Jn({value:e,property:n,schema:t}){if(!N(e))return;if(n.properties===void 0)return e;const r={...e};for(const[i,o]of Object.entries(n.properties))J({value:e[i],property:o,schema:t})===void 0&&delete r[i];return r}class _e 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:r,disableKinds:i,defaultValue:o,hasDefaultValue:c})=>{const{schema:a,kinds:f}=F(),[u,h]=d.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(o);function l(){c&&n(o)}function x(w){const S=Tn({value:e,property:t,schema:a,to:w});n(S)}const y=d.useMemo(()=>{const w=we(e);return Re.filter(S=>S!==w&&(f.includes(S)||S===null)&&!i)},[e,f,i]);return s.jsxs(Le,{open:u,onOpenChange:h,children:[s.jsx(Be,{asChild:!0,children:s.jsxs(R,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(pe,{id:"MoreVertical",className:"size-4"})]})}),s.jsxs(Ue,{align:"end",children:[y.map(w=>s.jsx(C,{onClick:()=>x(w),children:ze(w)},w)),c&&s.jsx(C,{onClick:l,disabled:p,children:"Use default value"}),s.jsx(Je,{}),r]})]})};function Rn({itemKey:e,items:n,value:t,onValueChange:r,errors:i,onDelete:o,first:c,last:a,canMove:f,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=F(),y=d.useId(),{attributes:w,listeners:S,setNodeRef:k,transform:D,transition:E,isDragging:$}=We({id:e,disabled:!f}),K={transform:Ge.Transform.toString(D),transition:E,opacity:$?.5:1},_=d.useMemo(()=>O(n)?{anyOf:n}:M(n)?A(x,n.$ref):n,[n,x]);return s.jsxs("div",{ref:k,style:K,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[f?s.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",...w,...S,children:s.jsx(gn,{className:"h-5 w-5"})}):s.jsx("div",{className:"w-5"}),s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ae,{value:t,onValueChange:r,property:_,errors:i,id:y}),s.jsx(ve,{errors:i})]}),s.jsxs(Ie,{value:t,onValueChange:r,property:n,children:[s.jsx(C,{onClick:o,children:"Delete"}),f&&!c&&s.jsxs(s.Fragment,{children:[s.jsx(C,{onClick:p,children:"Move to top"}),s.jsx(C,{onClick:u,children:"Move up"})]}),f&&!a&&s.jsxs(s.Fragment,{children:[s.jsx(C,{onClick:h,children:"Move down"}),s.jsx(C,{onClick:l,children:"Move to bottom"})]})]})]})}function zn({property:e,values:n,onValuesChange:t,errors:r}){const i=n===void 0||n.length===0,o=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=qe(le(nn),le(en,{coordinateGetter:Ze})),[f,u]=d.useState(n?.map(m=>({key:me(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return r.filter(g=>Se(g)&&g.index===m).flatMap(g=>g.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 w(m,g){u(f.map(j=>j.key===m?{...j,value:g}:j))}function S(){const m=[...f,{key:me(),value:void 0}];u(m),t(m.map(({value:g})=>g))}function k(m,g){const j=[...f];j.splice(g,0,j.splice(m,1)[0]),u(j),t(j.map(({value:V})=>V))}function D(m){k(m,0)}function E(m){k(m,f.length-1)}function $(m){const g=f.filter(j=>j.key!==m);u(g),t(g.map(({value:j})=>j))}function K(m){const{active:g,over:j}=m;if(j&&g.id!==j.id){const V=f.findIndex(G=>G.key===g.id),ce=f.findIndex(G=>G.key===j.id);V!==-1&&ce!==-1&&k(V,ce)}}const _=f.slice(c).map(m=>m.key);return s.jsxs(X,{className:"flex flex-col gap-2 p-2",children:[i&&s.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),s.jsx(He,{sensors:a,collisionDetection:Qe,onDragEnd:K,children:s.jsx(Ye,{items:_,strategy:Xe,children:f?.map(({key:m,value:g},j)=>s.jsx(Rn,{itemKey:m,items:h(j),value:g,onValueChange:V=>w(m,V),errors:p(j),onDelete:()=>$(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>k(j,j-1),moveDown:()=>k(j,j+1),moveToTop:()=>D(j),moveToBottom:()=>E(j)},m))})}),o&&s.jsx("div",{className:"flex justify-end",children:s.jsx(R,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!o&&s.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function T({property:e,id:n,...t}){const[r,i]=d.useState(""),o=d.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(r.toLowerCase()))),[e.enum,r]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function f(l){const x=o[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){i("");const x=o[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 s.jsxs(Z,{children:[s.jsx(ee,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),s.jsxs(ne,{children:[s.jsx(te,{value:r,onValueChange:i,placeholder:"Search..."}),s.jsx(re,{children:"No values found"}),s.jsx(se,{children:Object.entries(o).map(([l,x])=>s.jsx(U,{value:l,onSelect:u,selected:f(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>tn(typeof n))}function v(e,n){if(typeof e==typeof n())return e}function Wn(e){if(N(e))return e}function Gn(e){return v(e,String)??v(e,Number)??v(e,Boolean)}function ke(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>v(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>v(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>v(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>v(t,String)??v(t,Number)??v(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function qn({values:e,property:n,onValuesChange:t,errors:r,id:i}){const{schema:o}=F();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(vn(n)&&N(n.items)){let a=n.items;if(M(a)&&(a=A(o,a.$ref)),P(a)){const f={...n,...a};return s.jsx(T,{multiple:!0,values:ke(e,"primitive"),property:f,onValuesChange:c,id:i})}}return s.jsx(zn,{property:n,values:e,onValuesChange:c,errors:r})}const Hn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>s.jsx(d.Suspense,{children:s.jsx(Qn,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})}),Qn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>{const[i,o]=d.useState(""),c=d.useDeferredValue(i),{data:a}=je(Pe({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})),f=d.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=d.useMemo(()=>a.find(h=>h.id===n),[a,n]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),s.jsxs(ne,{children:[s.jsx(te,{value:i,onValueChange:o,placeholder:"Search for a block..."}),s.jsx(re,{children:"No block found"}),s.jsxs(se,{children:[s.jsx(Q,{children:f.map(h=>s.jsx(U,{selected:n===h.id,onSelect:p=>{t(p),o("")},value:h.id,children:h.name},h.id))}),r&&s.jsx(Q,{children:s.jsxs(U,{onSelect:()=>{r(),o("")},value:"__create_new__",closeOnSelect:!0,children:[s.jsx(pe,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function Yn({value:e,onValueChange:n,blockTypeSlug:t,id:r}){const[i,o]=d.useState(!1),c=e?.$ref,a=u=>{n(u?{$ref:u}:void 0)},f=u=>{n({$ref:u})};return s.jsxs("div",{id:r,children:[s.jsx(Hn,{blockTypeSlug:t,selectedBlockDocumentId:c,onSelect:a,onCreateNew:()=>o(!0)}),s.jsx(rn,{open:i,onOpenChange:o,blockTypeSlug:t,onCreated:f})]})}function Xn({value:e,onValueChange:n,property:t,id:r}){function i(o){n(v(o,Boolean))}return P(t)?s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r}):s.jsx(Fe,{checked:e,onCheckedChange:i,id:r})}function Zn({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:o=>i(o.target.value),id:r})}function et(){return s.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function nt({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:o=>i(o.target.value),id:r})}function tt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"jinja",template:i||void 0})};return s.jsx(ie,{value:e.template,onChange:r,id:t})}function rt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"json",value:i||void 0})};return s.jsx(ie,{value:e.value,onChange:r,id:t})}const st=({selectedVariableName:e,onSelect:n})=>s.jsx(d.Suspense,{children:s.jsx(it,{selectedVariableName:e,onSelect:n})}),it=({selectedVariableName:e,onSelect:n})=>{const[t,r]=d.useState(""),i=d.useDeferredValue(t),{data:o}=je(De({offset:0,sort:"NAME_ASC",variables:i?{operator:"and_",name:{like_:i}}:void 0,limit:50})),c=d.useMemo(()=>o.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())),[o,i]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),s.jsxs(ne,{children:[s.jsx(te,{value:t,onValueChange:r,placeholder:"Search for a variable..."}),s.jsx(re,{children:"No variable found"}),s.jsx(se,{children:s.jsx(Q,{children:c.map(a=>s.jsx(U,{selected:e===a.name,onSelect:f=>{n(f),r("")},value:a.name,children:a.name},a.id))})})]})]})};function ot({value:e,onValueChange:n,id:t}){const r=i=>{n({__prefect_kind:"workspace_variable",variable_name:i})};return s.jsx("div",{id:t,children:s.jsx(st,{selectedVariableName:e.variable_name,onSelect:r})})}const he="yyyy-MM-dd";function at({value:e,onValueChange:n,id:t}){const r=e?cn(e,he,un()):void 0,[i,o]=d.useState(r);function c(a){o(a),n(a?fe(a,he):void 0)}return s.jsxs(Ee,{children:[s.jsx(Ve,{asChild:!0,children:s.jsxs(R,{variant:"outline",className:Me("justify-start text-left font-normal w-full",!i&&"text-muted-foreground"),id:t,children:[s.jsx(Ae,{className:"mr-2 h-4 w-4"}),i?fe(i,"PPP"):s.jsx("span",{children:"Pick a date"})]})}),s.jsx(Te,{className:"w-auto p-0",children:s.jsx($e,{mode:"single",selected:i,onSelect:c,required:!0,autoFocus:!0})})]})}function ct({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n(i||void 0)};return s.jsx(ie,{value:e,onChange:r,id:t})}function ut({value:e,onValueChange:n,id:t}){const[r,i]=d.useState(!1),o=c=>{n(c.target.value||void 0)};return s.jsxs("div",{className:"relative",children:[s.jsx(z,{id:t,type:r?"text":"password",value:e??"",onChange:o,autoComplete:"off",className:"pr-10"}),s.jsx(R,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>i(!r),"aria-label":r?"Hide password":"Show password",children:r?s.jsx(hn,{className:"h-4 w-4"}):s.jsx(jn,{className:"h-4 w-4"})})]})}function lt({value:e,onValueChange:n,id:t}){function r(i){const o=i.target.value;if(o===""){n(void 0);return}const c=Number(o);Number.isNaN(c)||n(String(c))}return s.jsx(z,{type:"number",value:e??"",onChange:r,id:t,placeholder:"Duration in seconds",min:0})}function ft({value:e,onValueChange:n,property:t,id:r}){function i(o){n(o||void 0)}return P(t)?s.jsx(T,{multiple:!1,value:e,property:t,onValueChange:i,id:r}):t.format==="date"?s.jsx(at,{value:e,onValueChange:i,id:r}):t.format==="date-time"?s.jsx(sn,{value:e,onValueChange:i,id:r}):t.format==="json-string"?s.jsx(ct,{value:e,onValueChange:i,id:r}):t.format==="time-delta"?s.jsx(lt,{value:e,onValueChange:i,id:r}):t.format==="password"?s.jsx(ut,{value:e,onValueChange:i,id:r}):s.jsx(dn,{value:e??"",rows:1,className:"min-h-min",onChange:o=>i(o.target.value),id:r})}function dt({value:e,onValueChange:n,property:t,id:r}){return d.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?s.jsx(T,{multiple:!1,value:Gn(e),property:t,onValueChange:n,id:r}):null}function ae({value:e,onValueChange:n,errors:t,property:r,id:i,nested:o=!0}){if(L(e)){if(L(e,"json"))return s.jsx(rt,{value:e,onValueChange:n,id:i});if(L(e,"jinja"))return s.jsx(tt,{value:e,onValueChange:n,id:i});if(L(e,"workspace_variable"))return s.jsx(ot,{value:e,onValueChange:n,id:i});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("blockTypeSlug"in r){const c=r.blockTypeSlug;if(typeof c=="string")return s.jsx(Yn,{value:e,onValueChange:n,blockTypeSlug:c,id:i})}if(ge(r))return s.jsx(q,{value:e,property:r,onValueChange:n,errors:t});if(yn(r)){const c={...r,anyOf:r.oneOf};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(r.type)){const c={...r,anyOf:Object.values(r.type).map(a=>({type:a}))};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Sn(r))return s.jsx(_n,{value:e,onValueChange:n,errors:t,property:r,id:i});if(r.type==="string")return s.jsx(ft,{value:v(e,String),onValueChange:n,property:r,id:i});if(r.type==="integer")return s.jsx(Zn,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="number")return s.jsx(nt,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="boolean")return s.jsx(Xn,{value:v(e,Boolean),onValueChange:n,property:r,id:i});if(r.type==="object")return s.jsx(Ce,{values:Wn(e),property:r,onValuesChange:n,errors:t,nested:o});if(r.type==="array")return s.jsx(qn,{values:ke(e),property:r,onValuesChange:n,errors:t,id:i});if(r.type==="null")return s.jsx(et,{});if(r.type===void 0)return s.jsx(dt,{value:e,onValueChange:n,property:r,id:i});throw new Error(`Schema type not implemented: ${String(r.type)}`)}function xe({property:e}){const n=d.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&s.jsx("p",{className:"text-sm text-gray-500",children:n})}function mt({property:e,required:n,id:t}){const{schema:r}=F(),i=d.useMemo(()=>{const o=oe(e,r);return n?o:`${o} (Optional)`},[e,n,r]);return s.jsx(Ke,{htmlFor:t,children:i})}function Ne({property:e,value:n,onValueChange:t,required:r,errors:i,showLabel:o=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:f}=F(),u=d.useMemo(()=>be(e,a),[e,a]),h=d.useMemo(()=>!I(u.type),[u.type]),p=d.useMemo(()=>i.filter(_=>ye(_)||Se(_)),[i]),[l,x]=d.useState(!1),[y,w]=d.useState(K),[S,k]=d.useState(!1),D=d.useId(),E=d.useCallback(_=>{w(_),t(_)},[t]),$=d.useCallback(()=>{const _=!S;k(_),t(_?void 0:y)},[S,t,y]);d.useEffect(()=>{l||f||(I(u.default)&&!I(n)&&t(u.default),x(!0))},[l,f,t,u.default,n]);function K(){if(I(n))return n;if(I(u.default)&&!f)return u.default}return s.jsxs("div",{className:"flex flex-col gap-2 group",children:[o&&s.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(mt,{property:u,required:r,id:D}),s.jsx(xe,{property:u})]}),s.jsx("div",{className:"ml-auto",children:s.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:I(u.default),children:s.jsx(C,{onClick:$,children:S?"Include value":"Omit value"})})})]}),!o&&s.jsx(xe,{property:u}),s.jsx("fieldset",{disabled:S,children:s.jsx(ae,{property:u,value:y,onValueChange:E,errors:p,id:D,nested:c})}),s.jsx(ve,{errors:i})]})}function ht(e,n){return(e.position??0)-(n.position??0)}function Ce({values:e,onValuesChange:n,property:t,errors:r,nested:i}){const o=d.useRef([]),c=Oe(d.useCallback(()=>{const l={...e};for(const{key:x,value:y}of o.current)l[x]=y,y===void 0&&delete l[x];if(o.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){o.current.push({key:l,value:x}),c()}function f(l){return e?.[l]}function u(l){return r.filter(ye).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=d.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>ht(l,x)),[t.properties]),p=s.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>s.jsx(Ne,{value:f(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return i?s.jsx(X,{className:"p-2",children:p}):p}const xt=({children:e,...n})=>s.jsx(on.Provider,{value:n,children:e}),Ft=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:r,onValuesChange:i,errors:o})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=d.useCallback(u=>{if(u===void 0){i({});return}i(u)},[i]),f={values:r,property:e,onValuesChange:a,errors:o};return s.jsx("div",{className:"flex flex-col gap-4",children:s.jsx(xt,{...c,children:s.jsx(Ce,{...f,nested:!1})})})};export{Ft as SchemaForm};
|
|
2
|
-
//# sourceMappingURL=schema-form-
|
|
1
|
+
import{r as d,j as s,s as je}from"./vendor-tanstack-CWDKYA_B.js";import{u as Oe}from"./use-debounce-callback-CVfZS_LP.js";import{bH as Y,C as X,q as R,I as pe,ac as Z,ad as ee,ae as ne,af as te,ah as re,ag as se,aj as U,bp as Pe,ai as Q,G as Fe,p as z,L as ie,a6 as De,cH as Ee,cI as Ve,aW as Me,at as Ae,cJ as $e,cK as Te,i as Ke}from"./index-DLuXqHi9.js";import{D as Le,a as Be,b as Ue,d as C,e as Je}from"./dropdown-menu-Bhox1zoa.js";import{m as B,b as F,i as ue,p as Re,g as ze,c as We,C as Ge,d as qe,e as le,D as He,f as Qe,S as Ye,v as Xe,s as Ze,K as en,P as nn,h as tn,B as rn,j as sn,k as on}from"./schema-form-input-string-format-datetime-DyDs1jNl.js";import{H as an,a4 as cn,e as un,f as fe}from"./vendor-date-CRz8gtWZ.js";import{T as ln,a as fn}from"./toggle-group-Dnv_LMnU.js";import{T as dn}from"./textarea-CGFflH-n.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-recharts-BGjDGXVf.js";import"./vendor-forms-D-iybWES.js";import"./zod-CjGf5GIv.js";import"./timezone-select-ClE9nfKA.js";import"./form-CJfDUosd.js";const mn=[["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"}]],hn=Y("eye-off",mn);const xn=[["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"}]],jn=Y("eye",xn);const pn=[["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"}]],gn=Y("grip-vertical",pn);function I(e){return e!==void 0}function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!an(e)}function O(e){return Array.isArray(e)}function bn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function M(e){return"$ref"in e}function ge(e){return"anyOf"in e&&I(e.anyOf)}function yn(e){return"oneOf"in e&&I(e.oneOf)}function Sn(e){return"allOf"in e&&I(e.allOf)}function vn(e){return"items"in e&&I(e.items)}function wn(e){return"definitions"in e&&N(e.definitions)}function A(e,n){if(wn(e)){const t=n.replace("#/definitions/",""),r=e.definitions?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}if("$defs"in e&&N(e.$defs)){const t=n.replace("#/$defs/",""),r=e.$defs?.[t];if(!r)throw new Error(`Definition not found for ${n}`);return r}throw new Error("Schema does not contain definitions")}function be(e,n){if(M(e)&&typeof e.$ref=="string"){const{$ref:t,...r}=e;return B({},A(n,t),r)}return e}function _n({property:e,value:n,onValueChange:t,errors:r,id:i}){const{schema:o}=F(),c=d.useMemo(()=>{const{allOf:a,...f}=e,u=a.reduce((h,p)=>{if(M(p)){const l=A(o,p.$ref);return B({},h,l)}return B({},h,p)},{});return B({},u,f)},[e,o]);return s.jsx(ae,{value:n,onValueChange:t,errors:r,property:c,id:i})}function In({value:e,property:n,schema:t}){const r=I(e)?e:n.default;if(!I(r))return 0;const i=kn(n,t);switch(typeof r){case"string":return i.findIndex(o=>o.type==="string");case"number":return i.findIndex(o=>o.type==="number"||o.type==="integer");case"boolean":return i.findIndex(o=>o.type==="boolean");case"object":return Nn(r,i);default:return-1}}function kn(e,n){return e.anyOf?e.anyOf.map(t=>M(t)?A(n,t.$ref):t):[]}function Nn(e,n){return N(e)?Cn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Cn(e,n){if(bn(e))return n.findIndex(o=>o.type==="object");const t=Object.keys(e),[r,i]=n.reduce(([o,c],a,f)=>{if(!("properties"in a)||!a.properties)return[o,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[f,h]:[o,c]},[0,0]);return i===0?-1:r}const On={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function Pn(e){if(e.type&&typeof e.type=="string")return On[e.type]}function oe(e,n){if(M(e)){const r=A(n,e.$ref);return oe(r,n)}const t=Pn(e)??"Field";return e.title??e.format??t}function q({value:e,property:n,onValueChange:t,errors:r}){const{schema:i}=F(),[o,c]=d.useState(In({value:e,property:n,schema:i})),a=d.useRef(new Map);function f(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(o,e),c(h),t(a.current.get(h))}return s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ln,{size:"sm",variant:"outline",type:"single",value:o.toString(),onValueChange:f,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=oe(u,i);return s.jsx(fn,{value:h.toString(),children:p},p)})}),s.jsx(X,{className:"p-2",children:s.jsx(Ne,{value:e,property:n.anyOf[o],onValueChange:t,errors:r,showLabel:!1,nested:!1,required:!1})})]})}const b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));function Fn(e,n=0){return(b[e[n+0]]+b[e[n+1]]+b[e[n+2]]+b[e[n+3]]+"-"+b[e[n+4]]+b[e[n+5]]+"-"+b[e[n+6]]+b[e[n+7]]+"-"+b[e[n+8]]+b[e[n+9]]+"-"+b[e[n+10]]+b[e[n+11]]+b[e[n+12]]+b[e[n+13]]+b[e[n+14]]+b[e[n+15]]).toLowerCase()}let H;const Dn=new Uint8Array(16);function En(){if(!H){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H=crypto.getRandomValues.bind(crypto)}return H(Dn)}const Vn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),de={randomUUID:Vn};function Mn(e,n,t){e=e||{};const r=e.random??e.rng?.()??En();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Fn(r)}function me(e,n,t){return de.randomUUID&&!e?de.randomUUID():Mn(e)}function An(e){return typeof e=="string"}function ye(e){return N(e)&&"property"in e}function Se(e){return N(e)&&"index"in e}function ve({errors:e}){const n=d.useMemo(()=>e.filter(t=>An(t)),[e]);return n.length===0?null:n.length===1?s.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):s.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>s.jsx("li",{children:t},t))})}function we(e){return L(e)?e.__prefect_kind:null}function L(e,n){return N(e)&&ue(e.__prefect_kind)?ue(n)?e.__prefect_kind===n:!0:!1}function $n({value:e,property:n,schema:t,to:r}){const i=we(e);try{switch(i){case"json":return Tn({json:e,property:n,schema:t,to:r});case"jinja":return Kn({jinja:e,property:n,schema:t,to:r});case"workspace_variable":return Ln({workspaceVariable:e,to:r});case null:return Bn({value:e,property:n,schema:t,to:r});default:throw new Error(`Unknown prefect kind value: ${i}`)}}catch(o){console.error(o);return}}function Tn({json:e,property:n,schema:t,to:r}){switch(r){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 i=JSON.parse(e.value);return W({value:i,property:n,schema:t})}catch{throw new _e("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Kn({jinja:e,property:n,schema:t,to:r}){switch(r){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 i=JSON.parse(e.template);return W({value:i,property:n,schema:t})}catch{throw new _e("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${r}`)}}function Ln({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 Bn({value:e,property:n,schema:t,to:r}){switch(r){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 W({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${r}`)}}function W({value:e,property:n,schema:t}){return O(n)?n.map(i=>J({value:e,property:i,schema:t})).find(i=>i!==void 0):J({value:e,property:n,schema:t})}function J({value:e,property:n,schema:t}){const r=be(n,t);if(ge(r))return W({value:e,property:r.anyOf,schema:t});switch(r.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 Un({value:e,property:r,schema:t});case"object":return Jn({value:e,property:r,schema:t});default:if(O(r.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${r.type}`)}}function Un({value:e,property:n,schema:t}){return O(e)?[...e].map(i=>J({value:i,property:n,schema:t})):void 0}function Jn({value:e,property:n,schema:t}){if(!N(e))return;if(n.properties===void 0)return e;const r={...e};for(const[i,o]of Object.entries(n.properties))J({value:e[i],property:o,schema:t})===void 0&&delete r[i];return r}class _e 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:r,disableKinds:i,defaultValue:o,hasDefaultValue:c})=>{const{schema:a,kinds:f}=F(),[u,h]=d.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(o);function l(){c&&n(o)}function x(w){const S=$n({value:e,property:t,schema:a,to:w});n(S)}const y=d.useMemo(()=>{const w=we(e);return Re.filter(S=>S!==w&&(f.includes(S)||S===null)&&!i)},[e,f,i]);return s.jsxs(Le,{open:u,onOpenChange:h,children:[s.jsx(Be,{asChild:!0,children:s.jsxs(R,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(pe,{id:"MoreVertical",className:"size-4"})]})}),s.jsxs(Ue,{align:"end",children:[y.map(w=>s.jsx(C,{onClick:()=>x(w),children:ze(w)},w)),c&&s.jsx(C,{onClick:l,disabled:p,children:"Use default value"}),s.jsx(Je,{}),r]})]})};function Rn({itemKey:e,items:n,value:t,onValueChange:r,errors:i,onDelete:o,first:c,last:a,canMove:f,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=F(),y=d.useId(),{attributes:w,listeners:S,setNodeRef:k,transform:D,transition:E,isDragging:T}=We({id:e,disabled:!f}),K={transform:Ge.Transform.toString(D),transition:E,opacity:T?.5:1},_=d.useMemo(()=>O(n)?{anyOf:n}:M(n)?A(x,n.$ref):n,[n,x]);return s.jsxs("div",{ref:k,style:K,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[f?s.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",...w,...S,children:s.jsx(gn,{className:"h-5 w-5"})}):s.jsx("div",{className:"w-5"}),s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[s.jsx(ae,{value:t,onValueChange:r,property:_,errors:i,id:y}),s.jsx(ve,{errors:i})]}),s.jsxs(Ie,{value:t,onValueChange:r,property:n,children:[s.jsx(C,{onClick:o,children:"Delete"}),f&&!c&&s.jsxs(s.Fragment,{children:[s.jsx(C,{onClick:p,children:"Move to top"}),s.jsx(C,{onClick:u,children:"Move up"})]}),f&&!a&&s.jsxs(s.Fragment,{children:[s.jsx(C,{onClick:h,children:"Move down"}),s.jsx(C,{onClick:l,children:"Move to bottom"})]})]})]})}function zn({property:e,values:n,onValuesChange:t,errors:r}){const i=n===void 0||n.length===0,o=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=qe(le(nn),le(en,{coordinateGetter:Ze})),[f,u]=d.useState(n?.map(m=>({key:me(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return r.filter(g=>Se(g)&&g.index===m).flatMap(g=>g.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 w(m,g){u(f.map(j=>j.key===m?{...j,value:g}:j))}function S(){const m=[...f,{key:me(),value:void 0}];u(m),t(m.map(({value:g})=>g))}function k(m,g){const j=[...f];j.splice(g,0,j.splice(m,1)[0]),u(j),t(j.map(({value:V})=>V))}function D(m){k(m,0)}function E(m){k(m,f.length-1)}function T(m){const g=f.filter(j=>j.key!==m);u(g),t(g.map(({value:j})=>j))}function K(m){const{active:g,over:j}=m;if(j&&g.id!==j.id){const V=f.findIndex(G=>G.key===g.id),ce=f.findIndex(G=>G.key===j.id);V!==-1&&ce!==-1&&k(V,ce)}}const _=f.slice(c).map(m=>m.key);return s.jsxs(X,{className:"flex flex-col gap-2 p-2",children:[i&&s.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),s.jsx(He,{sensors:a,collisionDetection:Qe,onDragEnd:K,children:s.jsx(Ye,{items:_,strategy:Xe,children:f?.map(({key:m,value:g},j)=>s.jsx(Rn,{itemKey:m,items:h(j),value:g,onValueChange:V=>w(m,V),errors:p(j),onDelete:()=>T(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>k(j,j-1),moveDown:()=>k(j,j+1),moveToTop:()=>D(j),moveToBottom:()=>E(j)},m))})}),o&&s.jsx("div",{className:"flex justify-end",children:s.jsx(R,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!o&&s.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function $({property:e,id:n,...t}){const[r,i]=d.useState(""),o=d.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(r.toLowerCase()))),[e.enum,r]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function f(l){const x=o[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){i("");const x=o[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 s.jsxs(Z,{children:[s.jsx(ee,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),s.jsxs(ne,{children:[s.jsx(te,{value:r,onValueChange:i,placeholder:"Search..."}),s.jsx(re,{children:"No values found"}),s.jsx(se,{children:Object.entries(o).map(([l,x])=>s.jsx(U,{value:l,onSelect:u,selected:f(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>tn(typeof n))}function v(e,n){if(typeof e==typeof n())return e}function Wn(e){if(N(e))return e}function Gn(e){return v(e,String)??v(e,Number)??v(e,Boolean)}function ke(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>v(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>v(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>v(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>v(t,String)??v(t,Number)??v(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function qn({values:e,property:n,onValuesChange:t,errors:r,id:i}){const{schema:o}=F();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(vn(n)&&N(n.items)){let a=n.items;if(M(a)&&(a=A(o,a.$ref)),P(a)){const f={...n,...a};return s.jsx($,{multiple:!0,values:ke(e,"primitive"),property:f,onValuesChange:c,id:i})}}return s.jsx(zn,{property:n,values:e,onValuesChange:c,errors:r})}const Hn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>s.jsx(d.Suspense,{children:s.jsx(Qn,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})}),Qn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:r})=>{const[i,o]=d.useState(""),c=d.useDeferredValue(i),{data:a}=je(Pe({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})),f=d.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=d.useMemo(()=>a.find(h=>h.id===n),[a,n]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),s.jsxs(ne,{children:[s.jsx(te,{value:i,onValueChange:o,placeholder:"Search for a block..."}),s.jsx(re,{children:"No block found"}),s.jsxs(se,{children:[s.jsx(Q,{children:f.map(h=>s.jsx(U,{selected:n===h.id,onSelect:p=>{t(p),o("")},value:h.id,children:h.name},h.id))}),r&&s.jsx(Q,{children:s.jsxs(U,{onSelect:()=>{r(),o("")},value:"__create_new__",closeOnSelect:!0,children:[s.jsx(pe,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function Yn({value:e,onValueChange:n,blockTypeSlug:t,id:r}){const[i,o]=d.useState(!1),c=e?.$ref,a=u=>{n(u?{$ref:u}:void 0)},f=u=>{n({$ref:u})};return s.jsxs("div",{id:r,children:[s.jsx(Hn,{blockTypeSlug:t,selectedBlockDocumentId:c,onSelect:a,onCreateNew:()=>o(!0)}),s.jsx(rn,{open:i,onOpenChange:o,blockTypeSlug:t,onCreated:f})]})}function Xn({value:e,onValueChange:n,property:t,id:r}){function i(o){n(v(o,Boolean))}return P(t)?s.jsx($,{multiple:!1,value:e,property:t,onValueChange:n,id:r}):s.jsx(Fe,{checked:e,onCheckedChange:i,id:r})}function Zn({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx($,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:o=>i(o.target.value),id:r})}function et(){return s.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function nt({value:e,onValueChange:n,property:t,id:r}){if(P(t))return s.jsx($,{multiple:!1,value:e,property:t,onValueChange:n,id:r});function i(o){n(o===""?void 0:Number(o))}return s.jsx(z,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:o=>i(o.target.value),id:r})}function tt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"jinja",template:i||void 0})};return s.jsx(ie,{value:e.template,onChange:r,id:t})}function rt({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n({__prefect_kind:"json",value:i||void 0})};return s.jsx(ie,{value:e.value,onChange:r,id:t})}const st=({selectedVariableName:e,onSelect:n})=>s.jsx(d.Suspense,{children:s.jsx(it,{selectedVariableName:e,onSelect:n})}),it=({selectedVariableName:e,onSelect:n})=>{const[t,r]=d.useState(""),i=d.useDeferredValue(t),{data:o}=je(De({offset:0,sort:"NAME_ASC",variables:i?{operator:"and_",name:{like_:i}}:void 0,limit:50})),c=d.useMemo(()=>o.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())),[o,i]);return s.jsxs(Z,{children:[s.jsx(ee,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),s.jsxs(ne,{children:[s.jsx(te,{value:t,onValueChange:r,placeholder:"Search for a variable..."}),s.jsx(re,{children:"No variable found"}),s.jsx(se,{children:s.jsx(Q,{children:c.map(a=>s.jsx(U,{selected:e===a.name,onSelect:f=>{n(f),r("")},value:a.name,children:a.name},a.id))})})]})]})};function ot({value:e,onValueChange:n,id:t}){const r=i=>{n({__prefect_kind:"workspace_variable",variable_name:i})};return s.jsx("div",{id:t,children:s.jsx(st,{selectedVariableName:e.variable_name,onSelect:r})})}const he="yyyy-MM-dd";function at({value:e,onValueChange:n,id:t}){const r=e?cn(e,he,un()):void 0,[i,o]=d.useState(r);function c(a){o(a),n(a?fe(a,he):void 0)}return s.jsxs(Ee,{children:[s.jsx(Ve,{asChild:!0,children:s.jsxs(R,{variant:"outline",className:Me("justify-start text-left font-normal w-full",!i&&"text-muted-foreground"),id:t,children:[s.jsx(Ae,{className:"mr-2 h-4 w-4"}),i?fe(i,"PPP"):s.jsx("span",{children:"Pick a date"})]})}),s.jsx($e,{className:"w-auto p-0",children:s.jsx(Te,{mode:"single",selected:i,onSelect:c,required:!0,autoFocus:!0})})]})}function ct({value:e,onValueChange:n,id:t}){const r=i=>{(typeof i=="string"||i===void 0)&&n(i||void 0)};return s.jsx(ie,{value:e,onChange:r,id:t})}function ut({value:e,onValueChange:n,id:t}){const[r,i]=d.useState(!1),o=c=>{n(c.target.value||void 0)};return s.jsxs("div",{className:"relative",children:[s.jsx(z,{id:t,type:r?"text":"password",value:e??"",onChange:o,autoComplete:"off",className:"pr-10"}),s.jsx(R,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>i(!r),"aria-label":r?"Hide password":"Show password",children:r?s.jsx(hn,{className:"h-4 w-4"}):s.jsx(jn,{className:"h-4 w-4"})})]})}function lt({value:e,onValueChange:n,id:t}){function r(i){const o=i.target.value;if(o===""){n(void 0);return}const c=Number(o);Number.isNaN(c)||n(String(c))}return s.jsx(z,{type:"number",value:e??"",onChange:r,id:t,placeholder:"Duration in seconds",min:0})}function ft({value:e,onValueChange:n,property:t,id:r}){function i(o){n(o||void 0)}return P(t)?s.jsx($,{multiple:!1,value:e,property:t,onValueChange:i,id:r}):t.format==="date"?s.jsx(at,{value:e,onValueChange:i,id:r}):t.format==="date-time"?s.jsx(sn,{value:e,onValueChange:i,id:r}):t.format==="json-string"?s.jsx(ct,{value:e,onValueChange:i,id:r}):t.format==="time-delta"?s.jsx(lt,{value:e,onValueChange:i,id:r}):t.format==="password"?s.jsx(ut,{value:e,onValueChange:i,id:r}):s.jsx(dn,{value:e??"",rows:1,className:"min-h-min",onChange:o=>i(o.target.value),id:r})}function dt({value:e,onValueChange:n,property:t,id:r}){return d.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?s.jsx($,{multiple:!1,value:Gn(e),property:t,onValueChange:n,id:r}):null}function ae({value:e,onValueChange:n,errors:t,property:r,id:i,nested:o=!0}){if(L(e)){if(L(e,"json"))return s.jsx(rt,{value:e,onValueChange:n,id:i});if(L(e,"jinja"))return s.jsx(tt,{value:e,onValueChange:n,id:i});if(L(e,"workspace_variable"))return s.jsx(ot,{value:e,onValueChange:n,id:i});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("block_type_slug"in r){const c=r.block_type_slug;if(typeof c=="string")return s.jsx(Yn,{value:e,onValueChange:n,blockTypeSlug:c,id:i})}if(ge(r))return s.jsx(q,{value:e,property:r,onValueChange:n,errors:t});if(yn(r)){const c={...r,anyOf:r.oneOf};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(r.type)){const c={...r,anyOf:Object.values(r.type).map(a=>({type:a}))};return s.jsx(q,{value:e,property:c,onValueChange:n,errors:t})}if(Sn(r))return s.jsx(_n,{value:e,onValueChange:n,errors:t,property:r,id:i});if(r.type==="string")return s.jsx(ft,{value:v(e,String),onValueChange:n,property:r,id:i});if(r.type==="integer")return s.jsx(Zn,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="number")return s.jsx(nt,{value:v(e,Number),onValueChange:n,property:r,id:i});if(r.type==="boolean")return s.jsx(Xn,{value:v(e,Boolean),onValueChange:n,property:r,id:i});if(r.type==="object")return s.jsx(Ce,{values:Wn(e),property:r,onValuesChange:n,errors:t,nested:o});if(r.type==="array")return s.jsx(qn,{values:ke(e),property:r,onValuesChange:n,errors:t,id:i});if(r.type==="null")return s.jsx(et,{});if(r.type===void 0)return s.jsx(dt,{value:e,onValueChange:n,property:r,id:i});throw new Error(`Schema type not implemented: ${String(r.type)}`)}function xe({property:e}){const n=d.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&s.jsx("p",{className:"text-sm text-gray-500",children:n})}function mt({property:e,required:n,id:t}){const{schema:r}=F(),i=d.useMemo(()=>{const o=oe(e,r);return n?o:`${o} (Optional)`},[e,n,r]);return s.jsx(Ke,{htmlFor:t,children:i})}function Ne({property:e,value:n,onValueChange:t,required:r,errors:i,showLabel:o=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:f}=F(),u=d.useMemo(()=>be(e,a),[e,a]),h=d.useMemo(()=>!I(u.type),[u.type]),p=d.useMemo(()=>i.filter(_=>ye(_)||Se(_)),[i]),[l,x]=d.useState(!1),[y,w]=d.useState(K),[S,k]=d.useState(!1),D=d.useId(),E=d.useCallback(_=>{w(_),t(_)},[t]),T=d.useCallback(()=>{const _=!S;k(_),t(_?void 0:y)},[S,t,y]);d.useEffect(()=>{l||f||(I(u.default)&&!I(n)&&t(u.default),x(!0))},[l,f,t,u.default,n]);function K(){if(I(n))return n;if(I(u.default)&&!f)return u.default}return s.jsxs("div",{className:"flex flex-col gap-2 group",children:[o&&s.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(mt,{property:u,required:r,id:D}),s.jsx(xe,{property:u})]}),s.jsx("div",{className:"ml-auto",children:s.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:I(u.default),children:s.jsx(C,{onClick:T,children:S?"Include value":"Omit value"})})})]}),!o&&s.jsx(xe,{property:u}),s.jsx("fieldset",{disabled:S,children:s.jsx(ae,{property:u,value:y,onValueChange:E,errors:p,id:D,nested:c})}),s.jsx(ve,{errors:i})]})}function ht(e,n){return(e.position??0)-(n.position??0)}function Ce({values:e,onValuesChange:n,property:t,errors:r,nested:i}){const o=d.useRef([]),c=Oe(d.useCallback(()=>{const l={...e};for(const{key:x,value:y}of o.current)l[x]=y,y===void 0&&delete l[x];if(o.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){o.current.push({key:l,value:x}),c()}function f(l){return e?.[l]}function u(l){return r.filter(ye).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=d.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>ht(l,x)),[t.properties]),p=s.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>s.jsx(Ne,{value:f(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return i?s.jsx(X,{className:"p-2",children:p}):p}const xt=({children:e,...n})=>s.jsx(on.Provider,{value:n,children:e}),Ft=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:r,onValuesChange:i,errors:o})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=d.useCallback(u=>{if(u===void 0){i({});return}i(u)},[i]),f={values:r,property:e,onValuesChange:a,errors:o};return s.jsx("div",{className:"flex flex-col gap-4",children:s.jsx(xt,{...c,children:s.jsx(Ce,{...f,nested:!1})})})};export{Ft as SchemaForm};
|
|
2
|
+
//# sourceMappingURL=schema-form-BD95b0iS.js.map
|