@protobase/ui 0.119.0 → 0.119.1
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.
- package/dist/account/messages.d.ts +2 -2
- package/dist/app/change-confirm/messages.d.ts +2 -2
- package/dist/app/charts/messages.d.ts +2 -2
- package/dist/app/conversation/thread-state.d.ts +1 -1
- package/dist/app/create/messages.d.ts +2 -2
- package/dist/app/delete/messages.d.ts +2 -2
- package/dist/app/displays/messages.d.ts +2 -2
- package/dist/app/embedded-list/messages.d.ts +2 -2
- package/dist/app/export/messages.d.ts +2 -2
- package/dist/app/field-messages.d.ts +2 -2
- package/dist/app/field-types/runner-install/messages.d.ts +2 -2
- package/dist/app/field-types/workflow/definition.d.ts +1 -1
- package/dist/app/field-types/workflow/messages.d.ts +2 -2
- package/dist/app/field-types/workflow/pins/pin-text.d.ts +1 -1
- package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
- package/dist/app/focus/messages.d.ts +2 -2
- package/dist/app/gallery/gallery-layout.d.ts +2 -2
- package/dist/app/gallery/messages.d.ts +2 -2
- package/dist/app/hand-order/messages.d.ts +2 -2
- package/dist/app/history/messages.d.ts +2 -2
- package/dist/app/import/messages.d.ts +2 -2
- package/dist/app/list-messages.d.ts +2 -2
- package/dist/app/messages.d.ts +2 -2
- package/dist/app/meta-gate-messages.d.ts +2 -2
- package/dist/app/pages/messages.d.ts +2 -2
- package/dist/app/record-chart/messages.d.ts +2 -2
- package/dist/app/record-messages.d.ts +2 -2
- package/dist/app/record-mode/shown-layout.d.ts +1 -1
- package/dist/app/record-row/messages.d.ts +2 -2
- package/dist/app/related-cards/messages.d.ts +2 -2
- package/dist/app/runtime/messages.d.ts +2 -2
- package/dist/app/saved/messages.d.ts +2 -2
- package/dist/app/search/messages.d.ts +2 -2
- package/dist/app/searches/messages.d.ts +2 -2
- package/dist/app-shell/messages.d.ts +2 -2
- package/dist/assistant-dock/messages.d.ts +2 -2
- package/dist/auth/auth-messages.d.ts +2 -0
- package/dist/auth/auth-messages.js +3 -1
- package/dist/auth/messages.d.ts +2 -2
- package/dist/calls/messages.d.ts +2 -2
- package/dist/chat/messages.d.ts +2 -2
- package/dist/data-grid/column-spec.d.ts +1 -1
- package/dist/data-grid/messages.d.ts +2 -2
- package/dist/filter-panel/messages.d.ts +2 -2
- package/dist/forms/messages.d.ts +2 -2
- package/dist/invitations/messages.d.ts +2 -2
- package/dist/locale/en.js +4 -1
- package/dist/locale/en.json.d.ts +3 -0
- package/dist/locale/messages.d.ts +6 -0
- package/dist/locale/nl.js +4 -1
- package/dist/mentions/messages.d.ts +2 -2
- package/dist/mocks/customers.d.ts +1 -1
- package/dist/mocks/invoices.d.ts +1 -1
- package/dist/mocks/orders.d.ts +3 -3
- package/dist/notifications/bell/messages.d.ts +2 -2
- package/dist/organizations/first-organization-page.js +5 -7
- package/dist/organizations/messages.d.ts +2 -2
- package/dist/organizations/my-invitation-row.d.ts +6 -2
- package/dist/organizations/my-invitation-row.js +8 -3
- package/dist/organizations/new-organization-form.js +3 -2
- package/dist/organizations/organizations-page.js +4 -6
- package/dist/organizations/use-action.d.ts +10 -1
- package/dist/organizations/use-action.js +25 -15
- package/dist/organizations/use-join-invitation.d.ts +9 -0
- package/dist/organizations/use-join-invitation.js +25 -0
- package/dist/package.js +1 -1
- package/dist/plugins/messages.d.ts +2 -2
- package/dist/primitives/button.d.ts +4 -2
- package/dist/primitives/button.js +23 -15
- package/dist/primitives/messages.d.ts +2 -2
- package/dist/record-view/messages.d.ts +2 -2
- package/dist/record-view/use-autosave.d.ts +1 -1
- package/dist/shell/assets/{account-page-BQp5_GhJ.js → account-page-BXnceUQo.js} +2 -2
- package/dist/shell/assets/app-D3BCcbgE.js +34 -0
- package/dist/shell/assets/{assistant-shell-BZIclUxo.js → assistant-shell-DKf9TfL2.js} +2 -2
- package/dist/shell/assets/{board-display-i-mb2Cpu.js → board-display-DJkQwIfT.js} +2 -2
- package/dist/shell/assets/{calendar-display-DeNTjhbB.js → calendar-display-BKyuHAAF.js} +2 -2
- package/dist/shell/assets/{call-rings-BJF7hAje.js → call-rings-D_kQbFd3.js} +2 -2
- package/dist/shell/assets/{calls-BcTDHAo3.js → calls-D6jSGMCo.js} +2 -2
- package/dist/shell/assets/{circle-alert-lCeGgu8R.js → circle-alert-ytReRN_c.js} +2 -2
- package/dist/shell/assets/{composed-page-DNJnwQvq.js → composed-page-CbNBBioS.js} +2 -2
- package/dist/shell/assets/{composer-section-Ca3NwGut.js → composer-section-cg-cdFZx.js} +2 -2
- package/dist/shell/assets/{connect-route-S-wzFft6.js → connect-route-hMUPiAft.js} +2 -2
- package/dist/shell/assets/{copy-field-BlILh8XJ.js → copy-field-BoXXafL7.js} +2 -2
- package/dist/shell/assets/{create-route-BzX8GS_M.js → create-route-BePHRkTZ.js} +2 -2
- package/dist/shell/assets/{custom-step-container-field-0KjqrW7Y.js → custom-step-container-field-B3bsPeCV.js} +2 -2
- package/dist/shell/assets/{embedded-list-DJUmoyQF.js → embedded-list-6lQyJozS.js} +3 -3
- package/dist/shell/assets/{en-BrEwbNhJ.js → en-dURxhEht.js} +2 -2
- package/dist/shell/assets/{export-dialog-DB5gIvOy.js → export-dialog-BUbdSkkU.js} +2 -2
- package/dist/shell/assets/export-worker-DfIG4xQy.js +15 -0
- package/dist/shell/assets/first-organization-page-BhQOFT5P.js +2 -0
- package/dist/shell/assets/{graph-view-AIzSVa3P.js → graph-view-DZHMI-UQ.js} +2 -2
- package/dist/shell/assets/{group-donut-9Eg3TrZC.js → group-donut-Cu5Ny3gq.js} +2 -2
- package/dist/shell/assets/{guest-call-page-CuUFfdZa.js → guest-call-page-DlAkbaRH.js} +3 -3
- package/dist/shell/assets/{html-viewer-CFbk369s.js → html-viewer-DrSS-WnU.js} +2 -2
- package/dist/shell/assets/{import-dialog-DWGqsC2-.js → import-dialog-Dk_31-PT.js} +2 -2
- package/dist/shell/assets/{import-table-dialog-BNe0eZoG.js → import-table-dialog-vL-juOMH.js} +2 -2
- package/dist/shell/assets/{index-dMJn1vs1.js → index-CTmZ8-B4.js} +1 -1
- package/dist/shell/assets/{invitations-page-AmDwJw-A.js → invitations-page-CfTEdorg.js} +2 -2
- package/dist/shell/assets/{layout-grid-CxTl_dur.js → layout-grid-CTlIrnH5.js} +2 -2
- package/dist/shell/assets/{legend-item-DXXBS_hw.js → legend-item-CqkLpsWb.js} +2 -2
- package/dist/shell/assets/{list-page-CXrB1As-.js → list-page-Czg2Jaxx.js} +4 -4
- package/dist/shell/assets/{maplibre-Cd9zd3y9.js → maplibre-Bd79IbdT.js} +2 -2
- package/dist/shell/assets/{markdown-content-CqKm2ku9.js → markdown-content-BGl9PFVi.js} +2 -2
- package/dist/shell/assets/{members-page-Da7ADmBH.js → members-page-CEB-Wkl8.js} +2 -2
- package/dist/shell/assets/{messages-ZaTNJ5q-.js → messages-Ce8dRRRN.js} +2 -2
- package/dist/shell/assets/{nl-Dto12ewP.js → nl-B0dpIbbz.js} +2 -2
- package/dist/shell/assets/{organization-page-CfK6Dim2.js → organization-page-CTxtblmm.js} +2 -2
- package/dist/shell/assets/organizations-page-DeNhUQDU.js +2 -0
- package/dist/shell/assets/parse-worker-VaelBbE0.js +35 -0
- package/dist/shell/assets/{pending-invitation-row-Bcf8ttkD.js → pending-invitation-row-BMp0ZxE8.js} +2 -2
- package/dist/shell/assets/{period-chart-Ckx_KTsu.js → period-chart-BDqtO8mc.js} +2 -2
- package/dist/shell/assets/{person-row-4RzpLZJE.js → person-row-DRqtbPma.js} +2 -2
- package/dist/shell/assets/{public-form-page-BQR19Cet.js → public-form-page-XgK3-Nzh.js} +2 -2
- package/dist/shell/assets/{record-lines-BmaATx8t.js → record-lines-DdN5hlI_.js} +2 -2
- package/dist/shell/assets/{record-map-BnCgDA0b.js → record-map-sOmjX80D.js} +2 -2
- package/dist/shell/assets/{record-opens-DrMa-fHq.js → record-opens-DLfbC3xo.js} +2 -2
- package/dist/shell/assets/{record-page-DHgth2rZ.js → record-page-BntRofCL.js} +3 -3
- package/dist/shell/assets/{record-preview-Dcgb16a2.js → record-preview-QMV2lW2j.js} +2 -2
- package/dist/shell/assets/{records-map-Clj4sGQc.js → records-map-DgTxGcbC.js} +2 -2
- package/dist/shell/assets/{render-node-DSmBsYMg.js → render-node-CkL5Sgl_.js} +3 -3
- package/dist/shell/assets/{reorder-button-DaTBmXBl.js → reorder-button-8yWv8J72.js} +2 -2
- package/dist/shell/assets/{run-trace-view-DlxVKKf8.js → run-trace-view-BPvPw3Ko.js} +2 -2
- package/dist/shell/assets/{runner-install-field-Bo_itrWB.js → runner-install-field-CKP8E9ZO.js} +2 -2
- package/dist/shell/assets/{runtime-update-D8Ly6R1y.js → runtime-update-DGbf2Nmm.js} +2 -2
- package/dist/shell/assets/{shared-protobase-ui-BzbF8jUw.js → shared-protobase-ui-DN-uvpOy.js} +1 -1
- package/dist/shell/assets/{sheet-source-BYMMaydU.js → sheet-source-cKJfUaud.js} +3 -3
- package/dist/shell/assets/{sign-in-policy-page-Bw2A76AY.js → sign-in-policy-page-Bty4Ih1x.js} +2 -2
- package/dist/shell/assets/{start-block-queries-BCn7NH98.js → start-block-queries-x-gNbPt1.js} +2 -2
- package/dist/shell/assets/{step-catalog-DeHAX9pK.js → step-catalog-CCAXc8kn.js} +2 -2
- package/dist/shell/assets/{step-panel-Df4GlchE.js → step-panel-jmfh86YA.js} +2 -2
- package/dist/shell/assets/{timeline-display-BijL0a02.js → timeline-display-CtxOHPoJ.js} +2 -2
- package/dist/shell/assets/{trash-CM78fU0k.js → trash-CFCBxAWq.js} +2 -2
- package/dist/shell/assets/{update-set-BmW6qYcW.js → update-set-BYNQUWVp.js} +2 -2
- package/dist/shell/assets/{use-calendar-move-DdkPJiaa.js → use-calendar-move-BytgRG51.js} +2 -2
- package/dist/shell/assets/{use-display-rows-DAUXr6DH.js → use-display-rows-DGw9J73C.js} +2 -2
- package/dist/shell/assets/use-my-invitations-BcMFAcXl.js +2 -0
- package/dist/shell/assets/{use-paged-search-BXLXKyHF.js → use-paged-search-CKcKKO6y.js} +2 -2
- package/dist/shell/assets/{use-run-trace-D9muWJxD.js → use-run-trace-BRwbwZcf.js} +2 -2
- package/dist/shell/assets/{use-workflow-page-DSt6Ws-R.js → use-workflow-page-DsD276W-.js} +2 -2
- package/dist/shell/assets/{use-workflow-types-BcmFpA4n.js → use-workflow-types-Bn24Chp-.js} +2 -2
- package/dist/shell/assets/{workflow-canvas-B2SGJgTS.js → workflow-canvas-BKd_Yd0v.js} +2 -2
- package/dist/shell/assets/{workflow-field-DN0iAPqC.js → workflow-field-DyBaV6m5.js} +3 -3
- package/dist/shell/assets/{workflow-graph-editor-DQYfPu8C.js → workflow-graph-editor-B8RJ52_E.js} +2 -2
- package/dist/shell/assets/{workflow-run-field-Bau9h_Pu.js → workflow-run-field-CzluYhjs.js} +3 -3
- package/dist/shell/assets/{workflow-status-field-CBRUOn6n.js → workflow-status-field-_umgNjK4.js} +2 -2
- package/dist/shell/assets/{workflow-workbench-B2GjHXy6.js → workflow-workbench-CqOI36Oy.js} +2 -2
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +2 -2
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/{account-page-BQp5_GhJ.js.map → account-page-BXnceUQo.js.map} +1 -1
- package/dist/shell-source-maps/assets/app-D3BCcbgE.js.map +1 -0
- package/dist/shell-source-maps/assets/{assistant-shell-BZIclUxo.js.map → assistant-shell-DKf9TfL2.js.map} +1 -1
- package/dist/shell-source-maps/assets/{board-display-i-mb2Cpu.js.map → board-display-DJkQwIfT.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calendar-display-DeNTjhbB.js.map → calendar-display-BKyuHAAF.js.map} +1 -1
- package/dist/shell-source-maps/assets/{call-rings-BJF7hAje.js.map → call-rings-D_kQbFd3.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calls-BcTDHAo3.js.map → calls-D6jSGMCo.js.map} +1 -1
- package/dist/shell-source-maps/assets/{circle-alert-lCeGgu8R.js.map → circle-alert-ytReRN_c.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composed-page-DNJnwQvq.js.map → composed-page-CbNBBioS.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composer-section-Ca3NwGut.js.map → composer-section-cg-cdFZx.js.map} +1 -1
- package/dist/shell-source-maps/assets/{connect-route-S-wzFft6.js.map → connect-route-hMUPiAft.js.map} +1 -1
- package/dist/shell-source-maps/assets/{copy-field-BlILh8XJ.js.map → copy-field-BoXXafL7.js.map} +1 -1
- package/dist/shell-source-maps/assets/{create-route-BzX8GS_M.js.map → create-route-BePHRkTZ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{custom-step-container-field-0KjqrW7Y.js.map → custom-step-container-field-B3bsPeCV.js.map} +1 -1
- package/dist/shell-source-maps/assets/{embedded-list-DJUmoyQF.js.map → embedded-list-6lQyJozS.js.map} +1 -1
- package/dist/shell-source-maps/assets/en-dURxhEht.js.map +1 -0
- package/dist/shell-source-maps/assets/{export-dialog-DB5gIvOy.js.map → export-dialog-BUbdSkkU.js.map} +1 -1
- package/dist/shell-source-maps/assets/export-worker-DfIG4xQy.js.map +1 -0
- package/dist/shell-source-maps/assets/first-organization-page-BhQOFT5P.js.map +1 -0
- package/dist/shell-source-maps/assets/{graph-view-AIzSVa3P.js.map → graph-view-DZHMI-UQ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{group-donut-9Eg3TrZC.js.map → group-donut-Cu5Ny3gq.js.map} +1 -1
- package/dist/shell-source-maps/assets/{guest-call-page-CuUFfdZa.js.map → guest-call-page-DlAkbaRH.js.map} +1 -1
- package/dist/shell-source-maps/assets/{html-viewer-CFbk369s.js.map → html-viewer-DrSS-WnU.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-dialog-DWGqsC2-.js.map → import-dialog-Dk_31-PT.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-table-dialog-BNe0eZoG.js.map → import-table-dialog-vL-juOMH.js.map} +1 -1
- package/dist/shell-source-maps/assets/{invitations-page-AmDwJw-A.js.map → invitations-page-CfTEdorg.js.map} +1 -1
- package/dist/shell-source-maps/assets/{layout-grid-CxTl_dur.js.map → layout-grid-CTlIrnH5.js.map} +1 -1
- package/dist/shell-source-maps/assets/{legend-item-DXXBS_hw.js.map → legend-item-CqkLpsWb.js.map} +1 -1
- package/dist/shell-source-maps/assets/{list-page-CXrB1As-.js.map → list-page-Czg2Jaxx.js.map} +1 -1
- package/dist/shell-source-maps/assets/{maplibre-Cd9zd3y9.js.map → maplibre-Bd79IbdT.js.map} +1 -1
- package/dist/shell-source-maps/assets/{markdown-content-CqKm2ku9.js.map → markdown-content-BGl9PFVi.js.map} +1 -1
- package/dist/shell-source-maps/assets/{members-page-Da7ADmBH.js.map → members-page-CEB-Wkl8.js.map} +1 -1
- package/dist/shell-source-maps/assets/{messages-ZaTNJ5q-.js.map → messages-Ce8dRRRN.js.map} +1 -1
- package/dist/shell-source-maps/assets/nl-B0dpIbbz.js.map +1 -0
- package/dist/shell-source-maps/assets/{organization-page-CfK6Dim2.js.map → organization-page-CTxtblmm.js.map} +1 -1
- package/dist/shell-source-maps/assets/organizations-page-DeNhUQDU.js.map +1 -0
- package/dist/shell-source-maps/assets/parse-worker-VaelBbE0.js.map +1 -0
- package/dist/shell-source-maps/assets/{pending-invitation-row-Bcf8ttkD.js.map → pending-invitation-row-BMp0ZxE8.js.map} +1 -1
- package/dist/shell-source-maps/assets/{period-chart-Ckx_KTsu.js.map → period-chart-BDqtO8mc.js.map} +1 -1
- package/dist/shell-source-maps/assets/{person-row-4RzpLZJE.js.map → person-row-DRqtbPma.js.map} +1 -1
- package/dist/shell-source-maps/assets/{public-form-page-BQR19Cet.js.map → public-form-page-XgK3-Nzh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-lines-BmaATx8t.js.map → record-lines-DdN5hlI_.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-map-BnCgDA0b.js.map → record-map-sOmjX80D.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-opens-DrMa-fHq.js.map → record-opens-DLfbC3xo.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-page-DHgth2rZ.js.map → record-page-BntRofCL.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-preview-Dcgb16a2.js.map → record-preview-QMV2lW2j.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-Clj4sGQc.js.map → records-map-DgTxGcbC.js.map} +1 -1
- package/dist/shell-source-maps/assets/{render-node-DSmBsYMg.js.map → render-node-CkL5Sgl_.js.map} +1 -1
- package/dist/shell-source-maps/assets/{reorder-button-DaTBmXBl.js.map → reorder-button-8yWv8J72.js.map} +1 -1
- package/dist/shell-source-maps/assets/{run-trace-view-DlxVKKf8.js.map → run-trace-view-BPvPw3Ko.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runner-install-field-Bo_itrWB.js.map → runner-install-field-CKP8E9ZO.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runtime-update-D8Ly6R1y.js.map → runtime-update-DGbf2Nmm.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sheet-source-BYMMaydU.js.map → sheet-source-cKJfUaud.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sign-in-policy-page-Bw2A76AY.js.map → sign-in-policy-page-Bty4Ih1x.js.map} +1 -1
- package/dist/shell-source-maps/assets/{start-block-queries-BCn7NH98.js.map → start-block-queries-x-gNbPt1.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-catalog-DeHAX9pK.js.map → step-catalog-CCAXc8kn.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-panel-Df4GlchE.js.map → step-panel-jmfh86YA.js.map} +1 -1
- package/dist/shell-source-maps/assets/{timeline-display-BijL0a02.js.map → timeline-display-CtxOHPoJ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{trash-CM78fU0k.js.map → trash-CFCBxAWq.js.map} +1 -1
- package/dist/shell-source-maps/assets/{update-set-BmW6qYcW.js.map → update-set-BYNQUWVp.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-calendar-move-DdkPJiaa.js.map → use-calendar-move-BytgRG51.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-display-rows-DAUXr6DH.js.map → use-display-rows-DGw9J73C.js.map} +1 -1
- package/dist/shell-source-maps/assets/use-my-invitations-BcMFAcXl.js.map +1 -0
- package/dist/shell-source-maps/assets/{use-paged-search-BXLXKyHF.js.map → use-paged-search-CKcKKO6y.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-run-trace-D9muWJxD.js.map → use-run-trace-BRwbwZcf.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-page-DSt6Ws-R.js.map → use-workflow-page-DsD276W-.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-types-BcmFpA4n.js.map → use-workflow-types-Bn24Chp-.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-canvas-B2SGJgTS.js.map → workflow-canvas-BKd_Yd0v.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-field-DN0iAPqC.js.map → workflow-field-DyBaV6m5.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-graph-editor-DQYfPu8C.js.map → workflow-graph-editor-B8RJ52_E.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-run-field-Bau9h_Pu.js.map → workflow-run-field-CzluYhjs.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-status-field-CBRUOn6n.js.map → workflow-status-field-_umgNjK4.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-workbench-B2GjHXy6.js.map → workflow-workbench-CqOI36Oy.js.map} +1 -1
- package/dist/status/messages.d.ts +2 -2
- package/dist/users/messages.d.ts +2 -2
- package/package.json +5 -5
- package/dist/shell/assets/app-Bu6FwwHZ.js +0 -34
- package/dist/shell/assets/export-worker-DuHOhIiP.js +0 -15
- package/dist/shell/assets/first-organization-page-CBSCVXlw.js +0 -2
- package/dist/shell/assets/organizations-page-B0QsHpBE.js +0 -2
- package/dist/shell/assets/parse-worker-BRxyLV_D.js +0 -35
- package/dist/shell/assets/use-my-invitations-Cy6qlxUU.js +0 -2
- package/dist/shell-source-maps/assets/app-Bu6FwwHZ.js.map +0 -1
- package/dist/shell-source-maps/assets/en-BrEwbNhJ.js.map +0 -1
- package/dist/shell-source-maps/assets/export-worker-DuHOhIiP.js.map +0 -1
- package/dist/shell-source-maps/assets/first-organization-page-CBSCVXlw.js.map +0 -1
- package/dist/shell-source-maps/assets/nl-Dto12ewP.js.map +0 -1
- package/dist/shell-source-maps/assets/organizations-page-B0QsHpBE.js.map +0 -1
- package/dist/shell-source-maps/assets/parse-worker-BRxyLV_D.js.map +0 -1
- package/dist/shell-source-maps/assets/use-my-invitations-Cy6qlxUU.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Vc as e}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Vc as e}from"./app-D3BCcbgE.js";var t={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};t.node;var n=e(t);export{n as t};
|
|
2
|
+
//# debugId=85081c40-5aac-413c-8c6c-8d527bd0e513
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Jl as e,Rl as t,Xl as n,Yl as r,Zl as i,ql as a}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Jl as e,Rl as t,Xl as n,Yl as r,Zl as i,ql as a}from"./app-D3BCcbgE.js";import{A as o}from"./vendor-t7Q7QbPu.js";var s=e=>()=>{throw Error(`Not implemented: ${e}() needs the database (the resource's search fields, trigram matching), so it cannot be evaluated against a record`)},c=(e,t,n)=>({...i,search:{...i.search,evaluate:n?e=>a(n,t,e):s(`search`)},similar:{...i.similar,evaluate:s(`similar`)},regex:{...i.regex,evaluate:(e,t)=>e.some(e=>typeof e==`string`&&new RegExp(t).test(e))},now:{...i.now,evaluate:e}}),l=(e,t,n={})=>o(r(e,{expand:!0}),t,{functions:c(n.now??(()=>new Date),t,n.search)}),u=(e,t,n,r={})=>({name:e,kind:t,label:n.label,required:t!==`boolean`&&!n.optional,...n.help!==void 0&&{help:n.help},...n.when!==void 0&&{when:n.when},...n.default!==void 0&&{default:n.default},...r}),d={text:(e,t)=>u(e,`text`,t,{...t.multiline&&{multiline:!0},...t.max!==void 0&&{max:t.max}}),integer:(e,t)=>u(e,`integer`,t),decimal:(e,t)=>u(e,`decimal`,t),boolean:(e,t)=>u(e,`boolean`,t),secret:(e,t)=>u(e,`secret`,t),date:(e,t)=>u(e,`date`,t),choice:(e,t)=>u(e,`choice`,t,`options`in t?{options:t.options.map(({value:e,label:t})=>({value:e,label:t}))}:{resource:t.resource}),checklist:(e,t)=>u(e,`checklist`,t,{...`items`in t&&{items:[...t.items]},...`from`in t&&{from:t.from}}),custom:(e,t)=>u(e,`custom`,t,{component:t.component,...t.props!==void 0&&{props:t.props}})},f={text:`text`,integer:`integer`,decimal:`decimal`,boolean:`boolean`,date:`date`,choice:`text`,secret:`text`,checklist:`json`,custom:`json`},p=e=>({name:e.name,column:e.name,type:e.options?`enum`:f[e.kind],nullable:!0,readOnly:!1,filterable:e.kind!==`custom`&&e.kind!==`checklist`&&e.kind!==`secret`,sortable:!1,aliases:[],...e.options&&{enumValues:e.options.map(e=>e.value)}}),m=e=>({name:`inputs`,table:{name:`inputs`},fields:Object.fromEntries(e.map(e=>[e.name,p(e)])),primaryKey:[]}),h=(t,r)=>{let i=t[r].when;if(i===void 0)return;let a=n(i);if(!a.ok)return a.errors.map(e=>e.message).join(`; `);if(!a.ast)return`it is empty`;let o=e(m(t.slice(0,r)),a.ast);return o.ok?o.filter:o.errors.map(e=>e.message).join(`; `)},g=e=>e.kind===`checklist`?e.items===void 0==(e.from===void 0)?[`input "${e.name}": a checklist takes either "items" or "from"`]:e.items&&e.items.length===0?[`input "${e.name}": a checklist needs at least one item`]:[]:[],_=e=>e.flatMap((t,n)=>{let r=[];e.findIndex(e=>e.name===t.name)!==n&&r.push(`input "${t.name}" is declared twice`),t.kind===`secret`&&t.default!==void 0&&r.push(`input "${t.name}": a secret takes no default`),t.kind!==`secret`&&t.options&&t.default!==void 0&&!t.options.some(e=>e.value===t.default)&&r.push(`input "${t.name}": default "${String(t.default)}" is not one of its options`);let i=h(e,n);return typeof i==`string`&&r.push(`input "${t.name}": "when" is not a valid condition over the inputs before it: ${i}`),[...r,...g(t)]}),v=(e,t)=>{let n=new Set,r={};return e.forEach((i,a)=>{let o=h(e,a);if(typeof o==`string`)throw Error(`Input "${i.name}": ${o}`);let s=o===void 0||l(o,r)===!0;s&&n.add(i.name),r[i.name]=s?t[i.name]??null:null}),n},y=(e,n=[])=>Object.entries(e).flatMap(([e,r])=>{let i=typeof r==`string`?t(r):void 0;if(i===void 0)return[];let a=n.find(e=>e.name===i);return a?a.kind===`secret`?[`set "${e}" names secret input "${i}", which an update never writes; take it in an action's handler`]:[]:[`set "${e}" names input "${i}", which it does not ask for`]}),b=(e,n)=>Object.fromEntries(Object.entries(e).flatMap(([e,r])=>{let i=typeof r==`string`?t(r):void 0;return i===void 0?[[e,r]]:Object.hasOwn(n,i)?[[e,n[i]]]:[]}));export{v as a,d as i,b as n,_ as r,y as t};
|
|
2
|
+
//# debugId=58350516-569f-4a31-8d43-431492dab249
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Gl as r,Hc as i,Ji as a,Kl as o,Lr as s,Nc as c,Pa as l,Pc as u,aa as d,ca as f,cc as p,gi as m,la as h,li as ee,ls as g,na as _,ns as v,oa as te,ol as ne,sa as re,ui as y,vn as b,xa as x,xo as S}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Gl as r,Hc as i,Ji as a,Kl as o,Lr as s,Nc as c,Pa as l,Pc as u,aa as d,ca as f,cc as p,gi as m,la as h,li as ee,ls as g,na as _,ns as v,oa as te,ol as ne,sa as re,ui as y,vn as b,xa as x,xo as S}from"./app-D3BCcbgE.js";import{i as C}from"./vendor-t7Q7QbPu.js";import{r as w,t as T}from"./record-preview-QMV2lW2j.js";import{h as ie}from"./lib-dnd-kit-core-xi-7xL_N.js";import{t as E}from"./use-display-rows-DGw9J73C.js";var D=e(t(),1),O=e(n(),1),k=864e5,A=e=>new Date(e).toISOString().slice(0,10),j=e=>Date.parse(`${e}T00:00:00Z`),M=(e,t)=>A(j(e)+t*k),N=e=>M(e,-((new Date(j(e)).getUTCDay()+6)%7)),P=(e,t=0)=>{let n=new Date(j(e));return A(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+t,1))},F=({scale:e,day:t})=>({scale:e,day:e===`month`?P(t):N(t)}),I=(e,t,n=f())=>F(e??{scale:`month`,day:d(t,n)}),L=(e,t,n=f())=>F({scale:e,day:d(t,n)}),R=(e,t)=>e.scale===`month`?{scale:`month`,day:P(e.day,t)}:{scale:`week`,day:M(N(e.day),7*t)},z=e=>{let t=N(e.scale===`month`?P(e.day):e.day),n=(j(e.scale===`month`?M(N(M(P(e.day,1),-1)),6):M(t,6))-j(t))/k+1;return Array.from({length:n},(e,n)=>M(t,n))},B=e=>{let t=z(e);return{from:t[0],to:M(t.at(-1),1)}},V=(e,t)=>t.fields[e.start]?.type===`timestamp`,H=(e,t,n,i=f())=>{let a=V(e,t),s=e=>new Date(re(e,i)).toISOString().replace(`.000Z`,`Z`),c=e=>a?{kind:`timestamp`,value:s(e),span:{start:0,end:0}}:{kind:`string`,value:e,span:{start:0,end:0}},l=r.and(r.gte(e.start,c(n.from)),r.lt(e.start,c(n.to)));if(e.end===void 0)return o(l);let u=a?r.gt(e.end,c(n.from)):r.gte(e.end,c(n.from));return o(r.or(l,r.and(r.lt(e.start,c(n.from)),u)))},U=(e,t)=>e===``?t:`(${e}) AND (${t})`,W=e=>{if(typeof e!=`string`)return;let t=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);return Number.isNaN(t)?void 0:t},G=(e,t,n,r=f())=>{let i=W(e[t.start]);if(i===void 0)return;let a=V(t,n),o=e=>a?d(e,r):A(e),s=o(i),c=t.end===void 0?void 0:W(e[t.end]),l=c===void 0?s:o(a?c-1:c);return{first:s,last:l<s?s:l}},K=(e,t,n,r,i=f())=>{let a=G(e,t,n,i);return a?r.filter(e=>e>=a.first&&e<=a.last):[]},q=(e,t)=>e.toSorted((e,n)=>(W(e.record[t.start])??0)-(W(n.record[t.start])??0)),J=(e,t,n,r,i=f())=>{let a=new Map(r.map(e=>[e,[]]));for(let o of q(e,t))for(let e of K(o.record,t,n,r,i))a.get(e).push(o);return a},Y=(e,t,n,r,i,a=f())=>{let o=(j(i)-j(r))/k,s=V(t,n),c=e=>{let t=W(e);if(t!==void 0)return s?new Date(te(t+h(t,a)+o*k,a)).toISOString():M(A(t),o)},l=c(e[t.start]),u=t.end===void 0?void 0:c(e[t.end]);return{...l!==void 0&&{[t.start]:l},...u!==void 0&&{[t.end]:u}}},ae=({heading:e,unit:t,previous:n,today:r,next:i,scales:a,scalesLabel:o,linkTo:l,onView:d})=>{let f=(e,t,n,r,i)=>l?(0,O.jsx)(s,{to:l(e),className:t,"aria-label":n,"aria-current":i?`page`:void 0,children:r}):(0,O.jsx)(`button`,{type:`button`,className:t,"aria-label":n,"aria-pressed":i,onClick:()=>d?.(e),children:r}),m=p({variant:`secondary`,size:`sm`});return(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,O.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-1`,children:[f(n,m,y(`previousPeriod`,{unit:t}),(0,O.jsx)(u,{className:`size-3.5`})),f(r,m,y(`today`),y(`today`)),f(i,m,y(`nextPeriod`,{unit:t}),(0,O.jsx)(c,{className:`size-3.5`}))]}),(0,O.jsx)(`span`,{role:`group`,"aria-label":o,className:S.group(),children:a.map(e=>(0,O.jsx)(D.Fragment,{children:f(e.view,S.option(e.current),e.label,e.label,e.current)},e.label))})]})]})},oe=`day:`,X=e=>`${oe}${e}`,Z=(e,t)=>`${e}@${t}`,se=(e,{context:{active:t,collisionRect:n,droppableRects:r,over:i}})=>{let a={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.code],o=i?String(i.id).slice(4):t?.data.current?.day;if(a===void 0||!n||o===void 0)return;e.preventDefault();let s=r.get(X(M(o,a)));if(s)return{x:s.left+(s.width-n.width)/2,y:s.top+4}},Q=(e,t,n,r)=>{let i=n.title??ne(e,t),a=e.fields[i],o=r.labels[i]??(a?m(a,r.record[i],t?.fields[i]):``);return o===``?r.key:o},ce=(e,t,n,r)=>{let i=n.record[t.start];if(e.fields[t.start]?.type!==`timestamp`||typeof i!=`string`)return;let a=Date.parse(i);return d(a,f())===r?_(a):void 0},$=({model:e,view:t,display:n,row:r,day:a,className:o})=>{let c=T(e),l=ce(e,n,r,a);return(0,O.jsxs)(s,{to:{kind:`record`,resource:e.name,key:r.key},onClick:()=>c(r.record),className:i(`flex min-w-0 items-baseline gap-1 rounded-md border border-border bg-background px-1.5 py-0.5 text-xs hover:border-border-strong hover:bg-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30`,o),children:[l&&(0,O.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:l}),(0,O.jsx)(`span`,{className:`min-w-0 truncate`,children:Q(e,t,n,r)})]})},le=({movable:e,dragged:t,...n})=>{let{setNodeRef:r,setActivatorNodeRef:a,listeners:o,isDragging:s}=ie({id:Z(n.row.key,n.day),data:{row:n.row,day:n.day},disabled:!e});return(0,O.jsx)(`div`,{ref:e=>{r(e),a(e?.querySelector(`a`)??e)},...o,onDragStart:e=>e.preventDefault(),onClickCapture:e=>{t()&&(e.preventDefault(),e.stopPropagation())},className:i(`min-w-0`,e&&`cursor-grab touch-manipulation`,s&&`opacity-40`),children:(0,O.jsx)($,{...n})})},ue=({model:e,display:t,range:n,fields:r,filter:i})=>{let{resources:a,views:o}=v(),s=w({resources:a,views:o,model:e,columns:r,filter:U(i,H(t,e,n)),orderBy:`${t.start} asc`}),c=E(e,s.page,s.key,!0),l=c.more&&!c.loading&&c.rows.length<500;(0,D.useEffect)(()=>{l&&c.loadMore()},[l,c.rows.length]);let u=c.rows.length>500||c.rows.length===500&&c.more;return{rows:c.rows.slice(0,500),capped:u,loading:c.loading,error:c.error}},de=(e,t)=>{let n=new Map(t.map(e=>[e.key,e.patch]));return e.map(e=>n.has(e.key)?{...e,record:{...e.record,...n.get(e.key)}}:e)},fe=(e,t)=>{let n=g(),r=l(),i=b(),[o,s]=(0,D.useState)([]),c=e=>s(t=>t.filter(t=>t.key!==e)),u=C({mutationFn:({row:t,patch:r})=>{let i=typeof t.record.etag==`string`?t.record.etag:`*`;return n.update(e.name,x(e,t.record),r,i)},onMutate:({row:e,patch:t})=>s(n=>[...n.filter(t=>t.key!==e.key),{key:e.key,patch:t}]),onError:(e,{row:t,to:n})=>{c(t.key),r.show({state:`error`,title:y(`couldNotMoveTo`,{to:a(Date.parse(`${n}T00:00:00Z`))}),description:ee(e)})},onSettled:async(t,n,{row:r})=>{await i(e.name),c(r.key)}});return{moves:o,move:(n,r,i)=>u.mutate({row:n,patch:Y(n.record,t,e,r,i),to:i})}};export{B as _,$ as a,L as b,X as c,J as d,I as f,P as g,N as h,le as i,ae as l,q as m,fe as n,Q as o,z as p,ue as r,se as s,de as t,M as u,G as v,R as y};
|
|
2
|
+
//# debugId=72b60446-e75e-40d3-a551-6dc78bf8deac
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Kr as e}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Kr as e}from"./app-D3BCcbgE.js";import{r as t}from"./vendor-t7Q7QbPu.js";var n=(n,r,i,a)=>{let o=t({queryKey:[...i,`display`],enabled:a,initialPageParam:0,queryFn:({pageParam:e})=>r(e),getNextPageParam:(e,t)=>e.rows.length===40&&t.length*40<(t[0]?.total??0)?t.length:void 0}),s=o.data?.pages??[];return{resource:n.name,rows:s.flatMap(t=>t.rows.map(t=>e(n,t))),total:s[0]?.total??0,loading:o.isPending,error:o.error,more:o.hasNextPage,loadMore:()=>void o.fetchNextPage()}};export{n as t};
|
|
2
|
+
//# debugId=c6c3d27b-dc2b-4236-9495-13203beb3154
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{$a as r,$c as i,Do as a,Ka as o,Oa as s,Yc as c,fs as l,ms as u,ps as d,sc as f,ys as p}from"./app-D3BCcbgE.js";import{o as m}from"./vendor-t7Q7QbPu.js";var h=e(n(),1),g=({invitation:e,t,busy:n,joining:a,onJoin:o})=>{let s=p().organizations?.roles??[],c=e.organizationName??t(`anOrganization`),l=e.appRoles.map(e=>r(s,e)).join(`, `),u=t(`expires`,{date:new Date(e.expiresAt).toLocaleDateString(i(),{dateStyle:`long`})});return(0,h.jsxs)(`li`,{className:`flex flex-col gap-2 px-3 py-2.5 sm:flex-row sm:items-center sm:gap-3`,children:[(0,h.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`span`,{className:`block break-words font-medium`,children:c}),(0,h.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:l?`${l} · ${u}`:u})]}),(0,h.jsx)(f,{variant:`primary`,disabled:n,loading:a,busyLabel:t(`joining`,{name:c}),onClick:o,className:`min-h-10 w-full sm:min-h-0 sm:w-auto`,children:t(`join`,{name:c})})]})},_=e(t(),1),v=({onCreated:e,autoFocus:t=!1})=>{let{session:n}=p(),r=s(),[i,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(!1),{busy:d,error:m,run:g}=o(),v=(0,_.useId)(),y=(0,_.useRef)(null),b=()=>{if(!d){if(i.trim()===``){u(!0),y.current?.focus();return}g(async()=>{await n.organizations.create({name:i.trim()}),e()})}},x=l?r(`nameNeeded`):m;return(0,h.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:e=>{e.preventDefault(),b()},children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,h.jsxs)(`label`,{className:`flex flex-col gap-1.5 font-medium`,children:[r(`organizationName`),(0,h.jsx)(a,{ref:y,name:`organization`,autoComplete:`organization`,autoFocus:t,maxLength:200,value:i,invalid:l,"aria-describedby":l?v:void 0,onChange:e=>{c(e.target.value),u(!1)},className:`min-h-6`})]}),x&&(0,h.jsx)(`p`,{id:v,role:`alert`,className:`text-body font-medium text-danger-text`,children:x})]}),(0,h.jsx)(f,{variant:`primary`,type:`submit`,loading:d,busyLabel:r(`creating`),className:`min-h-10`,children:r(`createButton`)})]})},y=e=>{let{session:t}=p(),{busy:n,error:r,run:i}=o(),[a,s]=(0,_.useState)();return{busy:n,error:r,joining:n?a:void 0,join:n=>{s(n),i(async()=>{await t.organizations.acceptMine(n),e()})}}},b=()=>{let{session:e}=p(),t=(0,_.useContext)(l),n=m({queryKey:c.myInvitations,queryFn:()=>e.organizations.myInvitations(),retry:!1});return n.data&&d(n,t)?{state:`ready`,invitations:n.data}:u(n)?{state:`failed`,retry:()=>void n.refetch()}:{state:`loading`}};export{g as i,y as n,v as r,b as t};
|
|
2
|
+
//# debugId=5c30501c-5e55-4e78-88a1-d4b71fdfda83
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Do as r,Jo as i,Xc as a,Yo as o,hc as s,sc as c}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Do as r,Jo as i,Xc as a,Yo as o,hc as s,sc as c}from"./app-D3BCcbgE.js";var l=a(`lists`),u=e(n(),1),d=({title:e,description:t,searchLabel:n,placeholder:a,query:d,onQuery:f,list:p,error:m,renderRow:h})=>(0,u.jsxs)(i,{title:e,description:t,children:[(0,u.jsx)(o,{message:m}),(0,u.jsx)(r,{"aria-label":n,placeholder:a,value:d,onChange:e=>f(e.target.value),leading:(0,u.jsx)(s,{className:`size-3.5`}),wrapperClassName:`mb-2`}),(0,u.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[p.found.length,` of `,p.total]}),p.found.length>0&&(0,u.jsx)(`ul`,{className:`divide-y rounded-md border`,children:p.found.map(h)}),p.found.length<p.total&&(0,u.jsx)(c,{className:`mt-3`,loading:p.loading,onClick:()=>void p.more(),children:l(`showMore`)})]}),f=e(t(),1),p=(e,t)=>{let[n,r]=(0,f.useState)([]),[i,a]=(0,f.useState)(0),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(t);return c.current=t,(0,f.useEffect)(()=>{let n=setTimeout(()=>{s(!0),e(t,0).then(e=>{c.current===t&&(r(e.items),a(e.total),s(!1))},()=>{c.current===t&&(r([]),a(0),s(!1))})},200);return()=>clearTimeout(n)},[e,t]),{found:n,total:i,more:async()=>{let i=t;s(!0);let o=await e(i,n.length).catch(()=>void 0);c.current===i&&(o&&(r(e=>[...e,...o.items]),a(o.total)),s(!1))},loading:o}};export{d as n,p as t};
|
|
2
|
+
//# debugId=8a70a28e-eb29-4420-8664-5c89c17efa04
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t}from"./react-CuiNlnus.js";import{Ra as n,Yc as r,hs as i,ls as a,za as o}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t}from"./react-CuiNlnus.js";import{Ra as n,Yc as r,hs as i,ls as a,za as o}from"./app-D3BCcbgE.js";import{h as s,o as c}from"./vendor-t7Q7QbPu.js";import{C as l,E as u,M as d,O as f,P as p,S as m,T as h,h as g,t as ee,w as _,y as v}from"./workflows-Bey4jszG.js";var y=()=>({trigger:{manual:{}},stateMachine:{QueryLanguage:`JSONata`,StartAt:``,States:{}}}),b=e=>{if(typeof e!=`object`||!e||Array.isArray(e))return y();let t=e,n=t.stateMachine,r=typeof n?.States==`object`&&n.States!==null&&!Array.isArray(n.States)?n.States:{},i=t.order===`data`?{}:{StartAt:n?.StartAt??``};return{...t,trigger:t.trigger??{manual:{}},stateMachine:{...n,QueryLanguage:`JSONata`,...i,States:r}}},x=e=>b({trigger:e.trigger,order:e.execution_order??`sequence`,stateMachine:e.state_machine,...e.connections?{connections:e.connections}:{},...e.trace?{trace:e.trace}:{}}),S=e=>{let{StartAt:t,...n}=e.stateMachine;return{state_machine:g(e)===`data`?n:e.stateMachine,trigger:e.trigger,execution_order:g(e),connections:e.connections??null,trace:e.trace??null}},C=e=>e.split(`/`),w=(e,t)=>[...e,t].join(`/`),T=e=>{let t=C(e);return{scope:t.slice(0,-1),name:t.at(-1)}},E=(e,t)=>{let n=e.stateMachine;for(let e of t)n=d(n?.States[e]);return n},D=(e,t)=>{let{scope:n,name:r}=T(t);return E(e,n)?.States[r]},O=e=>Object.entries(e.States).flatMap(([e,t])=>{let n=d(t);return[e,...n?.States?O(n):[]]}),k=(e,t,n=[])=>{if(Object.hasOwn(e.States,t))return[...n,t];for(let[r,i]of Object.entries(e.States)){let e=d(i),a=e?.States&&k(e,t,[...n,r]);if(a)return a}},te=e=>e?.Type===`Map`||e?.Type===`Block`,A=e=>typeof e==`object`&&!!e&&!Array.isArray(e),j=e=>{if(!e)return[];let t=[e.anyOf,e.oneOf].find(Array.isArray),n=A(e.properties)?Object.entries(e.properties).filter(e=>A(e[1])):[];if(!t)return n;let r=new Map(n.map(([e,t])=>[e,[t]]));for(let[e,i]of t.filter(A).flatMap(e=>j(e)))n.some(([t])=>t===e)||r.set(e,[...r.get(e)??[],i]);return[...r].map(([e,t])=>[e,t.length===1?t[0]:{anyOf:t}])},M=e=>j(e),N=e=>e===void 0||e===``?`empty`:v(e)?`wired`:p(e)===void 0?A(e)&&Object.values(e).some(e=>p(e)!==void 0)?`made`:`literal`:`expression`,P=e=>`Arguments`in e&&A(e.Arguments)?e.Arguments:{},F=(e,t,n,r)=>{let i=Array.isArray(t.enum)&&t.enum.every(e=>typeof e==`string`)?t.enum:void 0;return{key:e,type:f(t),required:r,value:n,state:N(n),...i&&{options:i}}},ne=(e,t)=>{let n=m(e,t);if(!n)return[];let r=Array.isArray(n.required)?n.required:[],i=P(e);return M(n).map(([e,t])=>F(e,t,i[e],r.includes(e)))},I=e=>{let t=typeof e?.title==`string`?[]:M(e);return t.length===0?[{path:[],type:f(e)}]:t.map(([e,t])=>({path:[e],type:f(t)}))},re=(e,t)=>e.Type===`Task`?I(l(e,t)):e.Type===`Map`?[{path:[],type:f({type:`array`})}]:e.Type===`Block`?[{path:[],type:f(void 0)}]:[],ie=(e,t)=>I(h(e,t)),L=`#status`,R=`#condition`,z={path:[L],type:f(_)},B=e=>({key:R,type:{kinds:[`boolean`]},required:!1,value:e.Condition,state:N(e.Condition)}),V=(e,t,n,r)=>r[0]===`#status`?u(_,r.slice(1)):u(t?l(t,n):h(e,n),r),H=`$trigger`,U=e=>typeof e==`object`&&!!e&&!Array.isArray(e),W=e=>U(e)&&Number.isFinite(e.x)&&Number.isFinite(e.y),G=e=>U(e)?Object.fromEntries(Object.entries(e).flatMap(([e,t])=>W(t)?[[e,{x:t.x,y:t.y}]]:[])):{},K=e=>{let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{t=void 0}let n=U(t)?t:{};return{pins:G(n.pins),simple:G(n.simple)}},q=e=>e.replaceAll(`%`,`%25`).replaceAll(`.`,`%2E`).replace(/^#/,`%23`).replace(/^\$/,`%24`),J=e=>e===``?H:q(T(e).name),ae=e=>e.map(e=>e===`#status`?L:q(e)),oe=(e,t)=>t?.kind===`break`?[J(t.source),...t.path.length===0?[`#break`]:ae(t.path)].join(`.`):t?.kind===`make`?[J(t.target),`#make`,q(t.key)].join(`.`):t?.kind===`select`?[J(t.target),`#select`,q(t.key)].join(`.`):t?.kind===`condition`?[J(t.target),`#when`,...t.at.map(String)].join(`.`):J(e),se=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),ce=32,Y={right:24,bottom:24},X=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,le=(e,t,n)=>{if(![...t.keys()].some(t=>e.has(t)))return e;let r=new Map([...e].map(([e,n])=>[e,{...n,...t.get(e)}])),i=new Map;for(let e of r.keys())i.set(n(e),[...i.get(n(e))??[],e]);let a=e=>e===void 0?0:a(n(e))+1,o=new Set;for(let e of[...i.keys()].sort((e,t)=>a(t)-a(e))){let n=i.get(e);if(n.some(e=>t.has(e)||o.has(e))){let e=n.filter(e=>t.has(e)).map(e=>r.get(e)),i=n.filter(e=>!t.has(e)).map(e=>r.get(e)).sort((e,t)=>e.y-t.y||e.x-t.x);for(let t of i){let n=e.find(e=>X(t,e));for(;n;)t.y=n.y+n.height+ce,n=e.find(e=>X(t,e));e.push(t)}}let a=e===void 0?void 0:r.get(e);if(!a)continue;let s=Math.max(a.width,...n.map(e=>r.get(e)).map(e=>e.x+e.width+Y.right)),c=Math.max(a.height,...n.map(e=>r.get(e)).map(e=>e.y+e.height+Y.bottom));(s!==a.width||c!==a.height)&&(Object.assign(a,{width:s,height:c}),o.add(e))}return r},Z=e(t(),1),Q=1e3,ue=e=>({...e,id:`${e.scope}#${e.seq}`,resume_at:e.resumeAt??null,started_at:e.startedAt,finished_at:e.finishedAt,duration_ms:Date.parse(e.finishedAt)-Date.parse(e.startedAt)}),de=(e,{from:t,steps:n,revision:r})=>({rows:[...e.slice(0,t),...n.map(ue)],revision:r}),$=(e,t)=>{let n=a(),i=s(),o=r.workflowRunTrace(e??``),l=c({queryKey:o,queryFn:async()=>{let t=i.getQueryData(o);return de(t?.rows??[],await n.workflowRunTrace(e,t&&{after:t.rows.length,revision:t.revision}))},select:e=>e.rows,enabled:e!==void 0,refetchInterval:t?Q:!1}),u=(0,Z.useRef)(t),{refetch:d}=l;return(0,Z.useEffect)(()=>{let n=u.current&&!t;u.current=t,n&&e!==void 0&&d()},[t,e,d]),l},fe=new Set([`queued`,`running`,`waiting`]),pe=e=>{let t=s();(0,Z.useEffect)(()=>{if(!e)return;let n=o(t,()=>!1),r=setInterval(()=>n.changed([`workflow_runs`]),Q);return()=>{clearInterval(r),n.stop()}},[e,t])},me=e=>{let t=s(),n=(0,Z.useContext)(i),r=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{let i=r.current&&!e;r.current=e,i&&o(t,()=>n?.paused()??!1).changed([`workflows`])},[e,t,n])},he=(e,t)=>{if(!e)return;let n=typeof t==`string`?k(e.stateMachine,t):void 0,r=n&&D(e,n.join(`/`));return n&&r?.Type===`Block`?{within:n,startAt:r.Processor.StartAt}:{within:[],startAt:e.stateMachine.StartAt}},ge=e=>{let t=n(`workflow_runs`,e??``,e!==void 0),r=t.data?.record,i=r?.workflow_id!=null&&r.version!=null,a=n(`workflow_versions`,[String(r?.workflow_id??``),Number(r?.version??0)],i),o=fe.has(String(r?.status)),s=typeof r?.test_step==`string`?ee(r.test_step):a.data?x(a.data.record):void 0,c=$(e,o);return pe(o),me(o),{id:e,run:r,stored:t.data,definition:s,place:he(s,r?.block_state),steps:c.data??[],going:o,error:t.error??a.error??c.error}};export{k as C,D as E,w as S,T,O as _,se as a,te as b,B as c,F as d,ne as f,ie as g,re as h,le as i,M as l,z as m,$ as n,K as o,L as p,oe as r,R as s,ge as t,V as u,b as v,x as w,E as x,S as y};
|
|
2
|
+
//# debugId=51c1bc19-71ff-4ce0-bc85-6fe236a86489
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Pr as e,Q as t,Ra as n,Rr as r}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Pr as e,Q as t,Ra as n,Rr as r}from"./app-D3BCcbgE.js";import{o as i,t as a,w as o}from"./use-run-trace-BRwbwZcf.js";var s=`workflows`,c=({workflow:e,version:t,run:n})=>({kind:`record`,resource:s,key:e,...t!==void 0&&{version:t},...n&&{run:n}}),l=(e,t,n)=>c({workflow:e,...t!==n&&{version:t}}),u=(e,t,n,r)=>c({workflow:e,...n!==r&&{version:n},run:t}),d=({workflow:e,version:t},n)=>t===void 0?c({workflow:e}):l(e,t,n),f=e=>e==null?void 0:Number(e),p=()=>{let{address:e}=r(),n=t();if(n&&e?.kind===`record`)return{workflow:n.key,...e.version!==void 0&&{version:e.version},...e.run&&{run:e.run}}},m=t=>{let r=n(s,t.workflow),c=f(r.data?.record.version),l=f(r.data?.record.enabled_version),u=`workflow_id = ${JSON.stringify(t.workflow)}`,d=e(`workflow_versions`,{filter:u,orderBy:`version desc`,pageSize:100,fields:[`version`,`saved_at`]}),p=e(`workflow_runs`,{filter:`${u} AND isNull(block_of)`,orderBy:`created_at desc`,pageSize:20,fields:[`id`,`status`,`version`,`created_at`,`duration_ms`,`input`,`started_by`,`rerun_of`,`replay`,`error`]}),m=a(t.run),h=t.version,g=n(`workflow_versions`,[t.workflow,h??0],h!==void 0);return{latest:c,enabled:l,versions:d.items.map(e=>({version:Number(e.version),savedAt:String(e.saved_at)})),runs:p.items,trace:m,shown:h,pastDefinition:g.data&&o(g.data.record),pastLayout:g.data&&i(g.data.record.layout),versionsError:d.error,runsError:p.error,pastError:g.error}};export{l as a,u as i,p as n,c as o,d as r,s,m as t};
|
|
2
|
+
//# debugId=ec0f6efa-5bea-43ad-bb02-26b82daf4fe7
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Xc as e,Yc as t,ls as n}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Xc as e,Yc as t,ls as n}from"./app-D3BCcbgE.js";import{o as r}from"./vendor-t7Q7QbPu.js";var i=e(`app/field-types/workflow`),a=()=>{let e=n();return r({queryKey:t.workflowTypes,queryFn:()=>e.workflowTypes()})};export{i as n,a as t};
|
|
2
|
+
//# debugId=67db80a1-a7ec-4933-ab5a-df834d76e881
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Do as r,Hc as i,Ql as a,V as o,Vc as s,Zo as c,bo as l,dc as u,sc as d,to as f}from"./app-
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Do as r,Hc as i,Ql as a,V as o,Vc as s,Zo as c,bo as l,dc as u,sc as d,to as f}from"./app-D3BCcbgE.js";import{t as p}from"./circle-alert-ytReRN_c.js";import{t as m}from"./layout-grid-CTlIrnH5.js";import{E as h,M as g,O as _,P as v,S as ee,_ as y,b as te,c as b,d as x,g as S,h as ne,j as re,k as C,l as w,m as T,o as E,u as D,v as O,x as k,y as ie}from"./workflows-Bey4jszG.js";import{C as ae,S as A,a as oe,b as j,c as M,d as N,f as se,g as ce,h as le,i as ue,l as de,m as fe,o as pe,p as P,r as me,s as he,u as ge}from"./use-run-trace-BRwbwZcf.js";import{n as F}from"./use-workflow-types-Bn24Chp-.js";import{E as _e,a as I}from"./lib-xyflow-system-hojcPWkY.js";import{a as ve,c as ye,i as be,l as xe,n as Se,o as Ce,r as L,s as we,t as Te,u as Ee}from"./lib-xyflow-react-CuNAzocq.js";import{t as De}from"./use-elk-u1Ql5AOs.js";var Oe={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Oe.node;var ke=s(Oe),R=e(t(),1),Ae={"app:http":()=>F(`stepHttp`),"app:records.create":()=>F(`stepRecordsCreate`),"app:records.update":()=>F(`stepRecordsUpdate`),"app:records.get":()=>F(`stepRecordsGet`),"app:records.list":()=>F(`stepRecordsList`),"app:mail.send":()=>F(`stepMailSend`),"app:mail.template":()=>F(`stepMailTemplate`),"app:piece":()=>F(`stepPiece`)},je=(e,t)=>Ae[e]?.()??t??e,Me=(e,t)=>{let n=je(e,t),r=T(e);return r?F(`stepTypeVersion`,{type:n,version:r.version}):n},Ne={Pass:()=>F(`typePass`),Choice:()=>F(`typeChoice`),Wait:()=>F(`typeWait`),Map:()=>F(`typeMap`),Block:()=>F(`typeBlock`),Succeed:()=>F(`typeSucceed`),Fail:()=>F(`typeFail`)},Pe=e=>Ne[e]?.()??e,Fe=(e,t)=>{if(e.Type!==`Task`)return Pe(e.Type);let{type:n,waits:r}=C(String(e.Resource)),i=je(n,t?.step_types.find(e=>e.id===n)?.label);return r?F(`stepTypeWaits`,{type:i}):i},Ie={url:()=>F(`inputUrl`),method:()=>F(`inputMethod`),headers:()=>F(`inputHeaders`),query:()=>F(`inputQuery`),body:()=>F(`inputBody`),response:()=>F(`inputResponse`),resource:()=>F(`inputResource`),data:()=>F(`inputData`),key:()=>F(`inputKey`),filter:()=>F(`inputFilter`),order_by:()=>F(`inputOrderBy`),limit:()=>F(`inputLimit`),to:()=>F(`inputTo`),subject:()=>F(`inputSubject`),text:()=>F(`inputText`),html:()=>F(`inputHtml`),attachments:()=>F(`inputAttachments`),piece:()=>F(`inputPiece`),action:()=>F(`inputAction`),connection:()=>F(`inputConnection`),props:()=>F(`inputProps`),when:()=>F(`inputWhen`),body_schema:()=>F(`inputBodySchema`)},Le=(e,t)=>Ie[e]?.()??t??e,Re={manual:()=>F(`triggerManual`),"app:record":()=>F(`triggerRecord`)},ze=(e,t)=>Re[e]?.()??t??e,Be=e=>Object.keys(e??{})[0],Ve=(e,t)=>{let n=Be(e);return n===void 0?F(`triggerUnknown`):ze(n,t?.triggers.find(e=>e.id===n)?.label)},He={succeeded:()=>F(`traceSucceeded`),caught:()=>F(`traceCaught`),retrying:()=>F(`traceRetrying`),failed:()=>F(`traceFailed`),current:()=>F(`traceCurrent`)},Ue=e=>He[e](),We=(e,t)=>t?.step_types.find(t=>t.id===C(e.Resource).type)?.cache,Ge=(e,t)=>e.Type===`Task`&&e.Cache===!0&&We(e,t)?.choice===`discouraged`,Ke=(e,t)=>{let n=We(e,t);if(n?.choice!==`hidden`)return n?.choice===`switch`?{on:e.Cache??n.default===!0,forces:!1,offValue:!1,disclaimer:void 0}:{on:e.Cache===!0,forces:!0,offValue:void 0,disclaimer:n?.choice===`discouraged`?n.disclaimer:void 0}},z=e=>encodeURIComponent(e),qe=e=>e.map(e=>`/${z(e)}`).join(``),Je=e=>e===``?[]:e.split(`/`).slice(1).map(decodeURIComponent),Ye=(e,t)=>`break:${z(e)}|${qe(t)}`,Xe=(e,t)=>`make:${z(e)}|${z(t)}`,Ze=(e,t)=>`when:${z(e)}|${t.join(`/`)}`,Qe=(e,t)=>`select:${z(e)}|${z(t)}`,B=e=>`in:${z(e)}`,V=e=>`out:${qe(e)}`,$e=`break-in`,et=`make-out`,tt=`condition-out`,nt=`select-out`,rt=`value`,it=e=>e?.startsWith(`in:`)?decodeURIComponent(e.slice(3)):void 0,at=e=>e?.startsWith(`out:`)?Je(e.slice(4)):void 0,H=e(n(),1),ot=(e,t)=>{let n=e.pure.find(e=>e.id===t.target),r=it(t.targetHandle);return n?.kind===`condition`&&r!==void 0?{step:n.target,at:[...n.at,Number(r)]}:void 0},st=e=>e.kind===`condition`?{step:e.target,at:e.at}:void 0,ct=(e,t)=>{for(let n=0;n<Math.min(e.length,t.length);n++)if(e[n]!==t[n])return e[n]-t[n];return e.length-t.length},lt=(e,t,n)=>{let r=new Map,i=[];for(let e of t){let t=n(e);if(!t){i.push(e);continue}let a=`step:${t.step}`;r.has(a)||(r.set(a,[]),i.push(a)),r.get(a).push({removal:e,at:t.at})}return i.flatMap(e=>typeof e==`string`&&r.has(e)?r.get(e).toSorted((e,t)=>ct(t.at,e.at)).map(({removal:e})=>e):[e])},ut=e=>e.Type===`Choice`&&Array.isArray(e.Choices)?e.Choices:[],dt=e=>`Catch`in e&&Array.isArray(e.Catch)?e.Catch:[],ft=(e,t,n,r)=>{let i=A(t,n),a=(n,r,a,o)=>Object.hasOwn(e.States,a)?[{id:`${i}\n${r}`,kind:n,source:i,target:A(t,a),field:r,...o!==void 0&&{label:o}}]:[];return[...`Next`in r&&typeof r.Next==`string`?a(`next`,`Next`,r.Next):[],...ut(r).flatMap((e,t)=>a(`rule`,`Choices[${t}].Next`,e.Next,e.Condition)),...r.Type===`Choice`&&typeof r.Default==`string`?a(`default`,`Default`,r.Default):[],...dt(r).flatMap((e,t)=>e.Next===void 0?[]:a(`catch`,`Catch[${t}].Next`,e.Next,Array.isArray(e.ErrorEquals)?e.ErrorEquals.join(`, `):void 0))]},pt=(e,t)=>{let n=t.length>0?t.join(`/`):void 0,r=Object.entries(e.States).map(([r,i])=>{let a={kind:`state`,id:A(t,r),name:r,state:i,scope:t,...n!==void 0&&{parent:n},first:e.StartAt===r},o=g(i),s=o?.States?pt(o,[...t,r]):{nodes:[],edges:[]};return{nodes:[a,...s.nodes],edges:[...ft(e,t,r,i),...s.edges]}});return{nodes:r.flatMap(e=>e.nodes),edges:r.flatMap(e=>e.edges)}},mt=(e,t,n)=>[...y(e)].flatMap(([r,i])=>{let a=A(t,r),o=[...S(i)].map(e=>{let n=i.data.has(e)?`reads`:`status`;return{id:`${A(t,e)}\n${n}\n${a}`,kind:n,source:A(t,e),target:a,field:n}}),s=g(e.States[r]),c=s?.States?mt(s,[...t,r],!1):[];return[...n&&o.length===0?[{id:`\nStart\n${a}`,kind:`start`,source:``,target:a,field:`StartAt`}]:[],...o,...c]}),ht=e=>{let t=e.stateMachine,n=pt(t,[]);if(ne(e)===`data`)return{nodes:[{kind:`trigger`,id:``,trigger:e.trigger},...n.nodes.map(e=>e.kind===`state`?{...e,first:!1}:e)],edges:mt(t,[],!0)};let r=t.StartAt!==void 0&&Object.hasOwn(t.States,t.StartAt)?[{id:`
|
|
2
2
|
StartAt`,kind:`start`,source:``,target:t.StartAt,field:`StartAt`}]:[];return{nodes:[{kind:`trigger`,id:``,trigger:e.trigger},...n.nodes],edges:[...r,...n.edges]}},U={width:224,height:64},gt=(e,t)=>`${e}\u0000${t}`,_t={"elk.algorithm":`layered`,"elk.direction":`RIGHT`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.layered.spacing.nodeNodeBetweenLayers":`72`,"elk.spacing.nodeNode":`32`,"elk.edgeLabels.inline":`false`},vt={"elk.layered.layering.strategy":`LONGEST_PATH`},yt={"elk.padding":`[top=48,left=24,bottom=24,right=24]`},bt=e=>e.kind===`state`&&j(e.state),xt=(e,t={})=>{let n=e=>{let n=t.sizes?.get(e)??U,r=t.ports?.get(e);return r?.length?{id:e,...n,layoutOptions:{"elk.portConstraints":`FIXED_POS`},ports:r.map(t=>({id:gt(e,t.handle),x:t.side===`in`?0:n.width,y:t.y,width:0,height:0,layoutOptions:{"elk.port.side":t.side===`in`?`WEST`:`EAST`}}))}:{id:e,...n}},r=(e,n)=>n!==void 0&&t.ports?.get(e)?.some(e=>e.handle===n)?gt(e,n):e,i=e=>(t.pure??[]).filter(t=>t.parent===e).map(e=>n(e.id)),a=t=>{if(!bt(t))return n(t.id);let r=e.nodes.filter(e=>e.kind===`state`&&e.parent===t.id);return{id:t.id,layoutOptions:yt,children:[...r.map(a),...i(t.id)],edges:s(t.id)}},o=n=>{let r=t.pure?.find(e=>e.id===n);if(r)return r.parent;let i=e.nodes.find(e=>e.id===n);return i?.kind===`state`?i.parent:void 0},s=n=>[...e.edges.filter(e=>o(e.target)===n).map(e=>({id:e.id,sources:[e.source],targets:[e.target]})),...(t.wires??[]).filter(e=>o(e.target)===n&&o(e.source)===n).map(e=>({id:e.id,sources:[r(e.source,e.sourceHandle)],targets:[r(e.target,e.targetHandle)]}))],c=e.nodes.filter(e=>e.kind===`trigger`||e.parent===void 0);return{id:`root`,layoutOptions:t.dataOrder?{..._t,...vt}:_t,children:[...c.map(a),...i(void 0)],edges:s(void 0)}},St=e=>{let t=new Map,n=e=>{for(let r of e.children??[])t.set(r.id,{x:r.x??0,y:r.y??0,width:r.width??U.width,height:r.height??U.height}),n(r)};return n(e),t},Ct=async(e,t)=>St(await e.layout(t)),wt=24,Tt=8,Et=(e,t)=>{let n=t?[...e]:e.filter(e=>e.required||e.state!==`empty`);return{shown:n,folded:e.length-n.length}},Dt=(e,t,n,r=52)=>r+Math.max(e,typeof t==`number`?t:t.length)*26+(n?wt:0)+Tt,Ot={string:()=>F(`typeString`),integer:()=>F(`typeInteger`),number:()=>F(`typeNumber`),boolean:()=>F(`typeBoolean`),object:()=>F(`typeObject`),array:()=>F(`typeArray`),null:()=>F(`typeNull`),any:()=>F(`typeAny`)},W=e=>e.title===void 0?e.kinds===`any`?Ot.any():e.kinds.map(e=>Ot[e]()).reduce((e,t)=>F(`typeOr`,{first:e,second:t})):e.title,G=e=>e.kinds===`any`?`any`:e.kinds[0],kt={status:()=>F(`outputStatus`),headers:()=>F(`outputHeaders`),body:()=>F(`outputBody`),record:()=>F(`outputRecord`),resource:()=>F(`outputResource`),key:()=>F(`outputKey`),records:()=>F(`outputRecords`),message_id:()=>F(`outputMessageId`)},At=(e,t=!1,n=!1)=>{if(e.length===0)return F(t?`pinRunInput`:`pinResult`);if(e.length===1&&e[0]===`#status`)return F(`stepStatusType`);let r=e.at(-1);return n||!Object.hasOwn(kt,r)?r:kt[r]()},jt=e=>e===`#condition`?F(`onlyWhen`):Le(e),Mt={"=":()=>F(`conditionEquals`),"!=":()=>F(`conditionNotEquals`),">":()=>F(`conditionGreater`),"<":()=>F(`conditionLess`),matches:()=>F(`conditionMatches`),and:()=>F(`conditionAnd`),or:()=>F(`conditionOr`),not:()=>F(`conditionNot`),expression:()=>F(`conditionExpression`)},Nt=e=>Mt[e](),Pt=({part:e})=>Nt(e.kind===`compare`||e.kind===`logic`?e.op:e.kind),Ft={SUCCEEDED:()=>F(`statusSucceeded`),FAILED:()=>F(`statusFailed`),TIMED_OUT:()=>F(`statusTimedOut`),ABORTED:()=>F(`statusAborted`),SKIPPED:()=>F(`statusSkipped`)},It=e=>Object.hasOwn(Ft,e)?Ft[e]():e,Lt=34,Rt=280,zt=8,Bt=(e,t)=>e.kind===`condition`?{shown:e.inputs,folded:0}:e.kind===`make`?Et(e.inputs,t||e.inputs.length<=zt):{shown:[],folded:0},Vt=(e,t,n)=>{let r=new Set(t.filter(t=>t.source===e.id).map(e=>e.sourceHandle)),i=e.outputs.filter(e=>r.has(V(e.path))),a=i.length>0&&i.length<e.outputs.length;return n||!a?{shown:e.outputs,folded:0,foldable:a}:{shown:i,folded:e.outputs.length-i.length,foldable:a}},Ht=e=>106+e*26+8,Ut=(e,t,n)=>{let r=new Map;for(let i of e.nodes){if(i.kind===`state`&&j(i.state))continue;let{shown:e,folded:a}=Et(t.inputs.get(i.id)??[],n.has(i.id));r.set(i.id,{width:296,height:Dt(e.length,t.outputs.get(i.id)??[],a>0||n.has(i.id))})}for(let e of t.pure){if(e.kind===`condition`&&e.part.kind===`expression`){r.set(e.id,{width:216,height:Ht(e.inputs.length)});continue}if(e.kind===`select`){r.set(e.id,{width:Rt,height:Dt(e.part.cases.length+3,1,!1,Lt)});continue}if(e.kind===`break`){let i=Vt(e,t.edges,n.has(e.id));r.set(e.id,{width:216,height:Dt(0,i.shown.length,i.foldable,Lt)});continue}let{shown:i,folded:a}=Bt(e,n.has(e.id));r.set(e.id,{width:216,height:Dt(i.length,1,e.kind===`make`&&(a>0||n.has(e.id)),Lt)})}return r},Wt=(e,t)=>e+t*26+13,Gt=13,Kt=38,qt=(e,t,n)=>{let r=new Map;for(let i of e.nodes){if(i.kind===`state`&&j(i.state))continue;let{shown:e}=Et(t.inputs.get(i.id)??[],n.has(i.id));r.set(i.id,[...e.map((e,t)=>({handle:B(e.key),side:`in`,y:Wt(52,t)})),...(t.outputs.get(i.id)??[]).map((e,t)=>({handle:V(e.path),side:`out`,y:Wt(52,t)}))])}for(let e of t.pure){let i=(e,t=Kt)=>e.map((e,n)=>({handle:B(e.key),side:`in`,y:Wt(t,n)}));if(e.kind===`break`){let{shown:i}=Vt(e,t.edges,n.has(e.id));r.set(e.id,[{handle:$e,side:`in`,y:Gt},...i.map((e,t)=>({handle:V(e.path),side:`out`,y:Wt(Kt,t)}))])}else if(e.kind===`make`)r.set(e.id,[{handle:et,side:`out`,y:Gt},...i(Bt(e,n.has(e.id)).shown)]);else if(e.kind===`select`)r.set(e.id,[{handle:nt,side:`out`,y:Gt},...i(e.inputs)]);else{let t=e.part.kind===`expression`?Kt+64+4:Kt;r.set(e.id,[{handle:tt,side:`out`,y:Gt},...i(e.inputs,t)])}}return r},Jt=(e,t)=>{let n=e.nodes.find(e=>e.id===(t.kind===`break`?t.source:t.target));return n?.kind===`state`?n.parent:void 0},Yt=`trigger`,K=e=>e===``?Yt:`state:${e}`,q=e=>e!==Yt&&!e.startsWith(`state:`),J=e=>e===Yt?``:e.startsWith(`state:`)?e.slice(6):e,Xt=(e,t,n)=>{let{shown:r,folded:i}=Et(e.inputs.get(t)??[],n);return{inputs:r,outputs:e.outputs.get(t)??[],folded:i,open:n}},Zt=(e,t,n,r,i,a,o,s,c=!1)=>e.nodes.map(e=>{let l=t?.get(e.id)??{x:0,y:0,...U},u=e.kind===`state`?e.parent:void 0,d=e.kind===`trigger`?Ve(e.trigger,a):Fe(e.state,a),f=e.kind===`state`&&Ge(e.state,a),p=e.kind===`state`?F(`stateNode`,{name:e.name,type:d}):F(`triggerNode`,{trigger:d}),m=o?.get(e.id)??[],h=[...f?[F(`cacheForcedAgainst`)]:[],...m.map(e=>e.message)];return{id:K(e.id),type:e.kind,ariaLabel:[p,...h].join(`, `),position:{x:l.x,y:l.y},width:l.width,height:l.height,measured:{width:l.width,height:l.height},data:{node:e,kind:d,problems:n.get(e.id)??[],...i?.has(e.id)&&{trace:i.get(e.id)},...f&&{cacheWarning:f},...m.length>0&&{warnings:m},...s&&{pins:Xt(s.data,e.id,s.open.has(e.id))},...c&&{dataOrder:c}},draggable:!1,deletable:e.kind===`state`,selected:e.id===r,...u!==void 0&&{parentId:K(u),extent:`parent`}}}),Qt=40,$t=e=>e.length>Qt?`${e.slice(0,39)}…`:e,en=e=>{if(e.kind==="default")return F(`otherwise`);if(e.kind===`catch`)return F(`onError`,{errors:e.label??``});if(e.kind===`rule`)return e.label?$t(e.label):F(`conditionToWrite`)},tn=e=>({id:e.id,source:K(e.source),sourceHandle:`out`,target:K(e.target),targetHandle:`in`,deletable:!1,data:{kind:e.kind,field:e.field,source:e.source},...e.kind===`status`&&{className:`pb-workflow-status`}}),nn=(e,t=!1)=>e.edges.map(e=>{if(t)return tn(e);let n=en(e);return{id:e.id,source:K(e.source),sourceHandle:e.kind,target:K(e.target),targetHandle:`in`,deletable:e.kind!==`start`,data:{kind:e.kind,field:e.field,source:e.source},...n!==void 0&&{label:n},...e.kind===`catch`&&{className:`pb-workflow-catch`}}}),rn=(e,t,n,r)=>t.pure.map(i=>{let a=n?.get(i.id)??{x:0,y:0,...U},o=Jt(e,i),{shown:s,folded:c}=Bt(i,r.has(i.id)),l=i.kind===`break`?Vt(i,t.edges,r.has(i.id)):void 0,u=e.nodes.find(e=>e.id===(i.kind===`break`?i.source:i.target));return{id:i.id,type:`pure`,position:{x:a.x,y:a.y},width:a.width,height:a.height,measured:{width:a.width,height:a.height},data:{node:u,kind:i.kind,problems:[],pureData:{pure:i,shownInputs:s,shownOutputs:l?.shown??[],folded:l?.folded??c,open:r.has(i.id),foldable:l?l.foldable:c>0||r.has(i.id)}},draggable:!1,deletable:!0,...o!==void 0&&{parentId:K(o),extent:`parent`}}}),an=(e,t)=>{let n=e=>{let n=t.pure.find(t=>t.id===e);return n?n.kind===`break`?n.source:n.target:e},r=new Set(t.edges.map(e=>`${n(e.source)}\n${n(e.target)}`));return nn({...e,edges:e.edges.filter(e=>e.source!==``&&!r.has(`${e.source}\n${e.target}`))},!0)},on=e=>{let t=new Set(e.pure.map(e=>e.id)),n=e=>t.has(e)?e:K(e);return e.edges.map(e=>({id:e.id,source:n(e.source),sourceHandle:e.sourceHandle,target:n(e.target),targetHandle:e.targetHandle,deletable:!e.expression,data:{kind:`data`,wire:e},className:`pb-wire pb-wire-${G(e.type)}${e.expression?` pb-wire-expression`:``}`}))},sn=(0,R.createContext)(void 0),cn={succeeded:`green`,caught:`amber`,retrying:`amber`,failed:`red`,current:`blue`},ln=(0,R.createContext)(void 0),Y=()=>(0,R.useContext)(ln),un=e=>{if(e.options)return`choice`;if(e.type.kinds===`any`)return;let[t,...n]=e.type.kinds.filter(e=>e!==`null`);if(t===`string`&&n.every(e=>e===`integer`||e===`number`))return`string`;if(!(n.length>0))return t===`integer`||t===`number`?`number`:t===`boolean`?`boolean`:void 0},dn=e=>e.trim()===``?void 0:Number.isNaN(Number(e))?e:Number(e),fn=({name:e,className:t,value:n,onChange:i})=>{let[a,o]=(0,R.useState)();return(0,H.jsx)(r,{"aria-label":e,wrapperClassName:`${t} h-6 w-[55%] px-1.5`,className:`text-xs`,inputMode:`decimal`,value:a??(n===void 0?``:String(n)),onChange:e=>{o(e.target.value),i(dn(e.target.value))},onBlur:()=>o(void 0)})},pn=({pin:e,label:t,onChange:n})=>{if(e.state===`wired`||e.state===`made`||e.key===`#condition`&&e.state!==`expression`)return null;if(e.state===`expression`)return(0,H.jsx)(`span`,{className:`ml-auto shrink-0 rounded bg-muted px-1 font-mono text-xs text-muted-foreground`,title:F(`pinExpression`,{expression:String(e.value)}),children:`ƒ`});let i=un(e);if(e.state===`literal`&&typeof e.value==`object`)return(0,H.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,title:F(`pinObjectValue`),children:`{…}`});if(!i)return e.state===`literal`?(0,H.jsx)(`span`,{className:`ml-auto min-w-0 truncate text-xs text-muted-foreground`,children:String(e.value)}):null;let a=F(`inputValue`,{label:t});if(!n)return(0,H.jsx)(`span`,{className:`ml-auto min-w-0 truncate text-xs text-muted-foreground`,children:e.value===void 0?``:String(e.value)});let s=`nodrag nopan nowheel ml-auto min-w-0`;return i===`boolean`?(0,H.jsx)(f,{className:s,checked:e.value===!0,label:a,onChange:e=>n(e)}):i===`choice`?(0,H.jsxs)(o,{"aria-label":a,className:`${s} h-6 max-w-[55%] px-1 py-0 text-xs`,value:typeof e.value==`string`?e.value:``,onChange:e=>n(e.target.value===``?void 0:e.target.value),children:[(0,H.jsx)(`option`,{value:``}),e.options.map(t=>(0,H.jsx)(`option`,{value:t,children:e.statuses?It(t):t},t))]}):i===`number`?(0,H.jsx)(fn,{name:a,className:s,value:e.value,onChange:n}):(0,H.jsx)(r,{"aria-label":a,wrapperClassName:`${s} h-6 w-[55%] px-1.5`,className:`text-xs`,value:e.value===void 0?``:String(e.value),onChange:e=>n(e.target.value===``?void 0:e.target.value)})},mn=e=>`pb-pin pb-pin-${G(e.type)}`,hn=({pin:e,step:t,keys:n,connectable:r,name:i,onValue:a,bare:o=!1})=>{let s=Y(),c=i??jt(e.key);return(0,H.jsxs)(`div`,{className:`relative flex h-[26px] items-center gap-1.5 pr-2 pl-3`,children:[(0,H.jsx)(L,{id:B(e.key),type:`target`,position:I.Left,isConnectable:r,className:mn(e)}),(0,H.jsxs)(`span`,{className:`min-w-0 shrink truncate text-xs text-body`,title:F(`pinTypeTitle`,{label:c,type:W(e.type)}),children:[c,e.required&&(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-danger-text`,children:`*`})]}),!o&&(0,H.jsx)(pn,{pin:e,label:c,...s&&r&&{onChange:a??(e=>s.setArgument(t,n,e))}})]})},gn=({pin:e,connectable:t,trigger:n=!1,field:r=!1})=>{let i=At(e.path,n,r);return(0,H.jsxs)(`div`,{className:`relative flex h-[26px] items-center justify-end pr-3 pl-2`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate text-xs text-body`,title:F(`pinTypeTitle`,{label:i,type:W(e.type)}),children:i}),(0,H.jsx)(L,{id:V(e.path),type:`source`,position:I.Right,isConnectable:t,className:mn(e)})]})},_n=({inputs:e,outputs:t,connectable:n})=>{let r=(e,t)=>({top:`${(e+1)*100/(t+1)}%`});return(0,H.jsxs)(H.Fragment,{children:[e.map((t,i)=>(0,H.jsx)(L,{id:B(t.key),type:`target`,position:I.Left,isConnectable:n,className:mn(t),style:r(i,e.length),title:F(`pinTypeTitle`,{label:jt(t.key),type:W(t.type)})},t.key)),t.map((e,i)=>(0,H.jsx)(L,{id:V(e.path),type:`source`,position:I.Right,isConnectable:n,className:mn(e),style:r(i,t.length),title:F(`pinTypeTitle`,{label:At(e.path),type:W(e.type)})},e.path.join(`/`)))]})},vn=({node:e,folded:t,open:n,fields:r=!1})=>{let i=Y();return t===0&&!n?null:(0,H.jsx)(`button`,{type:`button`,className:`nodrag h-6 w-full px-3 text-left text-xs text-muted-foreground hover:text-foreground`,onClick:()=>i?.toggleOpen(e),disabled:!i,children:r?n?F(`foldLessFields`):F(`foldMoreFields`,{count:t}):n?F(`foldLess`):F(`foldMore`,{count:t})})},yn=({node:e,inputs:t,outputs:n,folded:r,open:i,editable:a,trigger:o=!1})=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-[3fr_2fr]`,children:[(0,H.jsx)(`div`,{className:`min-w-0`,children:t.map(t=>(0,H.jsx)(hn,{pin:t,step:e,keys:[t.key],connectable:a},t.key))}),(0,H.jsx)(`div`,{className:`min-w-0`,children:n.map(e=>(0,H.jsx)(gn,{pin:e,connectable:a,trigger:o},JSON.stringify(e.path)))})]}),(0,H.jsx)(vn,{node:e,folded:r,open:i})]}),bn=(0,R.createContext)(void 0),xn=`nodrag absolute -top-4 -right-4 z-10`,Sn=({node:e,name:t})=>{let n=(0,R.useContext)(bn);return n?(0,H.jsx)(d,{size:`icon`,className:xn,"aria-label":F(`unpin`,{name:t}),title:F(`unpinHelp`),onClick:t=>{t.stopPropagation(),n(e)},children:(0,H.jsx)(ke,{className:`size-3.5`,"aria-hidden":!0})}):(0,H.jsxs)(`span`,{className:i(xn,`inline-flex size-7 items-center justify-center rounded-md border border-border-strong bg-background text-muted-foreground shadow-sm`),title:F(`movedByHand`),children:[(0,H.jsx)(ke,{className:`size-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`sr-only`,children:F(`movedByHand`)})]})},X=[18,38],Cn=e=>{if(e.Type===`Choice`)return[{kind:`rule`,top:X[0],label:F(`when`)},{kind:`default`,top:X[1],label:F(`otherwise`)}];let t=[`Task`,`Pass`,`Wait`,`Map`,`Block`].includes(e.Type)?[{kind:`next`,top:X[0]}]:[],n=e.Type===`Task`||e.Type===`Map`||e.Type===`Block`?[{kind:`catch`,top:X[t.length],label:F(`onErrorHandle`)}]:[];return[...t,...n]},wn=(e,t,n)=>{let r=(0,R.useContext)(sn);if(!r||!t)return{};let i=t=>{t.stopPropagation(),r(e)},a=n?F(`addStepAtNamedHandle`,{handle:n}):F(`addStepAtHandle`);return{role:`button`,tabIndex:0,"aria-label":a,title:a,onClick:i,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i(e))}}},Tn=({source:e,path:t,editable:n})=>(0,H.jsx)(L,{id:e.kind,type:`source`,position:I.Right,isConnectable:n,style:{top:e.top},className:i(`pb-workflow-exec`,`pb-workflow-handle-${e.kind}`),...wn({kind:e.kind,source:t},n,e.label),children:e.label&&(0,H.jsx)(`span`,{className:`pb-workflow-handle-label`,children:e.label})}),En=({state:e,path:t,editable:n})=>Cn(e).map(e=>(0,H.jsx)(Tn,{source:e,path:t,editable:n},e.kind)),Dn=({count:e})=>e>0&&(0,H.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-xs font-medium text-danger-text`,title:F(`problemCount`,{count:e}),children:[(0,H.jsx)(p,{className:`size-3.5`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`sr-only`,children:F(`problemCount`,{count:e})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:e})]}),On=({label:e})=>(0,H.jsxs)(`span`,{className:`inline-flex shrink-0 items-center text-warning-text`,title:e,children:[(0,H.jsx)(p,{className:`size-3.5`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`sr-only`,children:e})]}),kn=({trace:e})=>(0,H.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[e.changed?(0,H.jsx)(`span`,{title:F(`changedSinceRun`),className:`rounded-full border border-dashed px-1.5 text-xs text-muted-foreground`,children:F(`changedShort`)}):(0,H.jsx)(c,{tone:cn[e.status],children:Ue(e.status)}),e.steps>1&&(0,H.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:F(`traceSteps`,{count:e.steps})})]}),An=(e,t,n)=>i(`rounded-lg border bg-background text-body shadow-sm`,t>0||n?.status===`failed`?`border-danger`:`border-border-strong`,e&&`ring-2 ring-primary/40`),jn=({name:e,kind:t,problems:n,first:r,trace:i,warnings:a=[]})=>(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:[t,r&&(0,H.jsxs)(`span`,{className:`text-primary-text`,children:[` · `,F(`startsHere`)]})]}),a.length>0&&(0,H.jsx)(On,{label:a.join(`
|
|
3
3
|
`)}),(0,H.jsx)(Dn,{count:n}),i&&(0,H.jsx)(kn,{trace:i})]}),(0,H.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e})]}),Mn=()=>(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(L,{id:`in`,type:`target`,position:I.Left,isConnectable:!1,className:`pb-workflow-side`,style:{top:X[0]}}),(0,H.jsx)(L,{id:`out`,type:`source`,position:I.Right,isConnectable:!1,className:`pb-workflow-side`,style:{top:X[0]}})]}),Nn=({condition:e})=>e!==void 0&&(0,H.jsx)(`span`,{className:`absolute top-1 right-6 max-w-[45%] truncate rounded bg-muted px-1 text-[0.625rem] text-muted-foreground`,title:e,children:F(`onlyWhenBadge`)}),Pn=({id:e,data:t,selected:n,isConnectable:r})=>{let{node:a,kind:o,problems:s,trace:c,cacheWarning:l,warnings:u=[],pins:d,dataOrder:f,moved:p}=t;return a.kind===`state`?(0,H.jsxs)(`div`,{className:i(An(n,s.length,c),`h-full`,j(a.state)&&`bg-muted/40`),children:[p&&(0,H.jsx)(Sn,{node:e,name:a.name}),(0,H.jsxs)(`div`,{className:`relative h-[52px] py-2 pr-6 pl-4`,children:[f?(0,H.jsx)(Mn,{}):(0,H.jsx)(L,{id:`in`,type:`target`,position:I.Left,isConnectable:r,className:`pb-workflow-exec`,style:{top:X[0]}}),f&&(0,H.jsx)(Nn,{condition:a.state.Condition}),(0,H.jsx)(jn,{name:a.name,kind:o,problems:s.length,first:a.first&&a.parent!==void 0,trace:c,warnings:[...l?[F(`cacheForcedAgainst`)]:[],...u.map(e=>e.message)]}),!f&&(0,H.jsx)(En,{state:a.state,path:a.id,editable:r}),d&&j(a.state)&&(0,H.jsx)(_n,{inputs:d.inputs,outputs:d.outputs,connectable:r})]}),d&&!j(a.state)&&(0,H.jsx)(yn,{node:a.id,inputs:d.inputs,outputs:d.outputs,folded:d.folded,open:d.open,editable:r})]}):null},Fn=({id:e,data:t,selected:n,isConnectable:r})=>{let{node:a,kind:o,problems:s,pins:c,dataOrder:l,moved:u}=t,d=wn({kind:`start`,source:a.id},r&&!l);return a.kind===`trigger`?(0,H.jsxs)(`div`,{className:i(An(n,s.length),`h-full border-dashed`),children:[u&&(0,H.jsx)(Sn,{node:e,name:F(`trigger`)}),(0,H.jsxs)(`div`,{className:`relative h-[52px] py-2 pr-6 pl-4`,children:[(0,H.jsx)(jn,{name:o,kind:F(`trigger`),problems:s.length}),l?(0,H.jsx)(L,{id:`out`,type:`source`,position:I.Right,isConnectable:!1,className:`pb-workflow-side`,style:{top:X[0]}}):(0,H.jsx)(L,{id:`start`,type:`source`,position:I.Right,isConnectable:r,className:`pb-workflow-exec`,style:{top:X[0]},...d})]}),c&&(0,H.jsx)(yn,{node:a.id,inputs:[],outputs:c.outputs,folded:0,open:!1,editable:r,trigger:!0})]}):null},In=`protobase:workflow-graph-view`,Ln=e=>a(()=>e().getItem(`protobase:workflow-graph-view`),null)===`simple`?`simple`:`pins`,Rn=(e,t)=>a(()=>t===`pins`?e().removeItem(In):e().setItem(In,t),void 0),zn=()=>localStorage,Bn=()=>{let[e,t]=(0,R.useState)(()=>Ln(zn));return[e,e=>{t(e),Rn(zn,e)}]},Vn=(e,t)=>e.part.kind===`not`?F(`conditionNotSide`):e.part.kind===`matches`?F(t===`0`?`conditionMatchesText`:`conditionMatchesPattern`):e.part.kind===`logic`?String.fromCharCode(65+Number(t)%26):F(t===`0`?`conditionSideA`:`conditionSideB`),Hn=({node:e,source:t})=>{let n=Y(),[r,i]=(0,R.useState)(),a=t.trim();return(0,H.jsx)(`textarea`,{"aria-label":F(`conditionExpressionText`),className:`nodrag nopan nowheel block w-full resize-none rounded border border-border bg-background px-1.5 py-1 font-mono text-xs text-foreground`,style:{height:64},spellCheck:!1,readOnly:!n,value:r??a,onChange:e=>i(e.target.value),onBlur:()=>{i(void 0);let t=r?.trim();t!==void 0&&t!==a&&n?.setCondition(e.target,t===``?void 0:`{% ${t} %}`)}})},Un=e=>e.replace(/^\$states\.context\.Steps\./,``).replace(/^\$states\.context\.Execution\.Input/,`input`),Wn=({node:e,editable:t})=>{let n=Y(),[i,a]=(0,R.useState)(),o=F(`conditionMatchesPattern`),s=String(e.inputs[1]?.value??``);return(0,H.jsxs)(`div`,{className:`relative flex h-[26px] items-center gap-1.5 pr-2 pl-3`,children:[(0,H.jsx)(`span`,{className:`min-w-0 shrink truncate text-xs text-body`,children:o}),(0,H.jsx)(r,{"aria-label":F(`inputValue`,{label:o}),wrapperClassName:`nodrag nopan nowheel ml-auto h-6 w-[60%] min-w-0 px-1.5`,className:`font-mono text-xs`,value:i??s,disabled:!n||!t,onChange:t=>{a(t.target.value),t.target.value!==``&&n?.setConditionSide(e.target,[...e.at,1],t.target.value)},onBlur:()=>a(void 0)})]})},Gn=({node:e,editable:t})=>{let n=Y(),r=(0,H.jsx)(L,{id:tt,type:`source`,position:I.Right,isConnectable:!1,className:`pb-pin pb-pin-boolean`,style:{top:13}});return e.part.kind===`expression`?(0,H.jsxs)(`div`,{className:`relative grid gap-1 px-2 pt-1`,children:[r,(0,H.jsx)(Hn,{node:e,source:e.part.source}),(0,H.jsx)(`div`,{className:`-mx-2`,children:e.inputs.map(e=>(0,H.jsxs)(`div`,{className:`relative flex h-[26px] items-center pr-2 pl-3`,children:[(0,H.jsx)(L,{id:B(e.key),type:`target`,position:I.Left,isConnectable:!1,className:`pb-pin pb-pin-${G(e.type)}`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-body`,title:F(`pinTypeTitle`,{label:e.key,type:W(e.type)}),children:Un(e.key)})]},e.key))})]}):(0,H.jsxs)(`div`,{className:`relative pt-1`,children:[r,e.inputs.map(r=>e.part.kind===`matches`&&r.key===`1`?(0,H.jsx)(Wn,{node:e,editable:t},r.key):(0,H.jsx)(hn,{pin:r,step:e.target,keys:[],name:Vn(e,r.key),bare:e.part.kind===`logic`&&Number(r.key)===e.part.sides.length,connectable:t,onValue:t=>n?.setConditionSide(e.target,[...e.at,Number(r.key)],t??``)},r.key))]})},Kn=(e,t)=>typeof t==`number`&&e.trim()!==``&&Number.isFinite(Number(e))?Number(e):typeof t==`boolean`&&(e===`true`||e===`false`)?e===`true`:e,qn=`nodrag nopan nowheel h-6 min-w-0 px-1.5`,Jn=({label:e,value:t,onChange:n,disabled:i})=>(0,H.jsx)(r,{"aria-label":e,wrapperClassName:`${qn} flex-1`,className:`text-xs`,value:String(t),disabled:i,onChange:e=>n(Kn(e.target.value,t))}),Yn=({node:e,editable:t})=>{let n=Y(),r=!n||!t,i=t=>n?.setArgument(e.target,[e.key],D(t)),{part:a}=e,o=(e,t)=>i({...a,cases:a.cases.map((n,r)=>r===e?{...n,...t}:n)});return(0,H.jsxs)(`div`,{className:`relative pt-1`,children:[(0,H.jsx)(L,{id:nt,type:`source`,position:I.Right,isConnectable:!1,className:`pb-pin pb-pin-${G(e.type)}`,style:{top:13}}),e.inputs.map(n=>(0,H.jsx)(hn,{pin:n,step:e.target,keys:[],name:F(`selectInput`),connectable:t,onValue:e=>i({...a,operand:{value:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?e:``}})},n.key)),a.cases.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex h-[26px] items-center gap-1 pr-2 pl-3`,children:[(0,H.jsx)(Jn,{label:F(`selectWhen`,{case:t+1}),value:e.when,disabled:r,onChange:e=>o(t,{when:e})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs text-muted-foreground`,children:`→`}),(0,H.jsx)(Jn,{label:F(`selectThen`,{case:t+1}),value:e.then,disabled:r,onChange:e=>o(t,{then:e})}),(0,H.jsx)(`button`,{type:`button`,className:`nodrag shrink-0 text-muted-foreground hover:text-foreground disabled:opacity-40`,"aria-label":F(`selectRemoveCase`,{case:t+1}),disabled:r||a.cases.length===1,onClick:()=>i({...a,cases:a.cases.filter((e,n)=>n!==t)}),children:(0,H.jsx)(u,{className:`size-3`,"aria-hidden":!0})})]},t)),(0,H.jsxs)(`div`,{className:`flex h-[26px] items-center gap-1 pr-2 pl-3`,children:[(0,H.jsx)(`span`,{className:`shrink-0 text-xs text-body`,children:F(`selectOtherwise`)}),(0,H.jsx)(Jn,{label:F(`selectOtherwise`),value:a.otherwise,disabled:r,onChange:e=>i({...a,otherwise:e})})]}),(0,H.jsx)(`button`,{type:`button`,className:`nodrag h-6 w-full px-3 text-left text-xs text-muted-foreground hover:text-foreground`,disabled:r,onClick:()=>i({...a,cases:[...a.cases,{when:``,then:``}]}),children:F(`selectAddCase`)})]})},Xn=e=>e.kind===`condition`?Pt(e):e.kind===`select`?F(`selectTitle`):e.kind===`break`?F(`breakTitle`,{type:W(e.type)}):F(`makeTitle`,{type:W(e.type)}),Zn=({pure:e})=>(0,H.jsx)(`div`,{className:`truncate border-b px-3 py-1.5 text-xs font-medium text-foreground`,children:Xn(e)}),Qn=({id:e,data:t,selected:n,isConnectable:r})=>{let{pureData:a,moved:o}=t;if(!a)return null;let{pure:s,shownInputs:c,shownOutputs:l,folded:u,open:d,foldable:f}=a;return(0,H.jsxs)(`div`,{className:i(`h-full rounded-lg border border-dashed border-border-strong bg-background text-body shadow-sm`,n&&`ring-2 ring-primary/40`),children:[o&&(0,H.jsx)(Sn,{node:e,name:Xn(s)}),(0,H.jsx)(Zn,{pure:s}),s.kind===`condition`?(0,H.jsx)(Gn,{node:s,editable:r}):s.kind===`select`?(0,H.jsx)(Yn,{node:s,editable:r}):s.kind===`break`?(0,H.jsxs)(`div`,{className:`relative pt-1`,children:[(0,H.jsx)(L,{id:$e,type:`target`,position:I.Left,isConnectable:!1,className:`pb-pin pb-pin-${G(s.type)}`,style:{top:13}}),l.map(e=>(0,H.jsx)(gn,{pin:e,connectable:r,field:!0},JSON.stringify(e.path))),f&&(0,H.jsx)(vn,{node:s.id,folded:u,open:d,fields:!0})]}):(0,H.jsxs)(`div`,{className:`relative pt-1`,children:[(0,H.jsx)(L,{id:et,type:`source`,position:I.Right,isConnectable:!1,className:`pb-pin pb-pin-${G(s.type)}`,style:{top:13}}),c.map(e=>(0,H.jsx)(hn,{pin:e,step:s.target,keys:[s.key,e.key],connectable:r},e.key)),(0,H.jsx)(vn,{node:s.id,folded:u,open:d})]})]})},$n=({offer:e,onClose:t})=>(0,H.jsxs)(`div`,{role:`dialog`,"aria-label":F(`pureOfferTitle`),className:`absolute z-10 grid gap-1 rounded-md border bg-background p-1 shadow-md`,style:{left:e.x,top:e.y},children:[e.choices.map((e,n)=>(0,H.jsx)(d,{size:`sm`,variant:`ghost`,className:`justify-start`,autoFocus:n===0,onClick:()=>{e.add(),t()},children:e.label},e.label)),(0,H.jsx)(d,{size:`sm`,variant:`ghost`,onClick:t,children:F(`pureOfferClose`)})]}),er=e=>typeof e==`object`&&!!e&&!Array.isArray(e),tr=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Z={kinds:[`boolean`]},nr=e=>e.sides.flatMap(e=>b(e)?nr(e):`read`in e?[e.read]:[]),rr=e=>!b(e)&&`read`in e&&`step`in e.read.base&&tr(e.read.path,[`Status`]),ir=(e,t)=>{if(t&&t.kinds!==`any`){let e=t.kinds.filter(e=>e!==`null`);if(e.length===1&&[`string`,`integer`,`number`,`boolean`].includes(e[0]))return{kinds:e}}return{kinds:[typeof e==`number`?`number`:typeof e==`boolean`?`boolean`:`string`]}},ar=e=>{let t=new Map;for(let[n,r]of re(e.stateMachine)){let i=`Assign`in r&&er(r.Assign)?r.Assign:{};for(let[r,a]of Object.entries(i)){let i=a===`{% $states.result %}`?ae(e.stateMachine,n)?.join(`/`):void 0;t.set(r,t.has(r)||i===void 0?null:i)}}return t},or=(e,t,n=[])=>{let r=new Map(re(e.stateMachine).map(([t,n])=>[ae(e.stateMachine,t).join(`/`),n])),i=ne(e)===`data`,a=new Map([[``,ce(e,t)],...[...r].map(([e,n])=>[e,[...le(n,t),...i?[fe]:[]]])]),o=new Map([...r].filter(([,e])=>i||e.Type===`Task`).map(([e,n])=>[e,[...i?[M(n)]:[],...se(n,t)]])),s=e=>[...r.keys()].find(t=>t.split(`/`).at(-1)===e),c=new Map,l=new Map,u=[],d=[],f=new Map,p=ar(e),m=(e,t,n,r=!1)=>{let i=`data:${e.node}|${e.handle}->${t}|${n}`;r&&f.has(i)||f.set(i,{id:i,source:e.node,sourceHandle:e.handle,target:t,targetHandle:n,type:e.type,...r&&{expression:!0}})},g=(e,t)=>{let n=e.find(e=>tr(e.path,t));return n||(n={path:t,type:_(void 0)},e.push(n)),n},y=(e,t)=>{let n=a.get(e),r=n.find(e=>tr(e.path,t)),i=n.some(e=>e.path.length>0&&e.path[0]!==`#status`);if(r||t.length===0||i&&t.length===1){let i=r??g(n,t);return{node:e,handle:V(i.path),type:i.type}}let o=S(e,t.slice(0,-1)),s=g(o.outputs,t.slice(-1));return{node:o.id,handle:V(s.path),type:s.type}},S=(n,i)=>{let a=Ye(n,i),o=c.get(a);if(o)return o;let s=ge(e,r.get(n),t,i),l={kind:`break`,id:a,source:n,path:i,type:_(s),outputs:de(s).map(([e,t])=>({path:[e],type:_(t)}))};return c.set(a,l),m(y(n,i),a,$e),l},C=(e,t,n)=>{let r=T(e);if(r)return m(r,t,n);for(let r of O(e)){let e=D(r);e&&m(e,t,n,!0)}},T=e=>{let t=ie(e);return t&&D(t)},D=e=>{if(`step`in e.base){let t=s(e.base.step);return t===void 0||!a.has(t)?void 0:y(t,[P,...e.path])}let t=`input`in e.base?``:p.get(e.base.variable);return t==null||!a.has(t)?void 0:y(t,e.path)},A=e=>{if(b(e)||!(`read`in e))return;if(!rr(e))return D(e.read);let t=s(e.read.base.step);return t===void 0||!a.has(t)?void 0:y(t,[P])},oe=(e,t,n,r)=>{let i=Ze(e,n),a=t.sides,o=a.map(A),s=a.map((e,n)=>{let r=String(n);if(b(e))return{key:r,type:Z,required:!1,value:void 0,state:`made`};if(`read`in e)return{key:r,type:o[n]?.type??_(void 0),required:!1,value:k(e.read),state:`wired`};if(`pattern`in e)return{key:r,type:{kinds:[`string`]},required:!1,value:e.pattern,state:`literal`};if(t.kind===`matches`)return{key:r,type:{kinds:[`string`]},required:!1,value:e.value,state:`literal`};if(t.kind!==`compare`)return{key:r,type:Z,required:!1,value:e.value,state:`literal`};let i=a[1-n];return rr(i)?{key:r,type:{kinds:[`string`]},required:!1,value:e.value,state:`literal`,options:x,statuses:!0}:{key:r,type:ir(e.value,o[1-n]?.type),required:!1,value:e.value,state:`literal`}});t.kind===`logic`&&s.push({key:String(a.length),type:Z,required:!1,value:void 0,state:`empty`}),u.push({kind:`condition`,id:i,target:e,at:n,part:t,inputs:s}),m({node:i,handle:tt,type:Z},r.node,r.handle),a.forEach((t,r)=>{b(t)?oe(e,t,[...n,r],{node:i,handle:B(String(r))}):o[r]&&m(o[r],i,B(String(r)))})},j=(e,t)=>{let n=E(t),r={node:e,handle:B(he)};if(n&&nr(n).every(e=>A({read:e})))return oe(e,n,[],r);let i=Ze(e,[]),a=O(t).flatMap(e=>{let t=A({read:e});return t?[{read:e,source:t}]:[]});u.push({kind:`condition`,id:i,target:e,at:[],part:{kind:`expression`,source:v(t)},inputs:a.map(({read:e,source:t})=>({key:te(e),type:t.type,required:!1,value:k(e),state:`wired`}))}),m({node:i,handle:tt,type:Z},r.node,r.handle);for(let{read:e,source:t}of a)m(t,i,B(te(e)),!0)},ue=(e,t)=>{let n=w(t.value),r=n&&A(n.operand);if(!n||`read`in n.operand&&!r)return!1;let i=Qe(e,t.key),a=`read`in n.operand?{key:rt,type:r.type,required:!1,value:k(n.operand.read),state:`wired`}:{key:rt,type:{kinds:[`string`]},required:!1,value:n.operand.value,state:`literal`};return d.push({kind:`select`,id:i,target:e,key:t.key,part:n,type:t.type,inputs:[a]}),m({node:i,handle:nt,type:t.type},e,B(t.key)),r&&m(r,i,B(rt)),!0},pe=(e,n)=>{let i=Xe(e,n),a=l.get(i);if(a)return a;let s=o.get(e)?.find(e=>e.key===n),c=r.get(e),u=h(ee(c,t),[n]),d=er(s?.value)?s.value:{},f=new Set(Array.isArray(u?.required)?u.required:[]),p=de(u).map(([e,t])=>N(e,t,d[e],f.has(e))),g=Object.keys(d).filter(e=>!p.some(t=>t.key===e)).map(e=>N(e,h(u,[e])??{},d[e],!1)),v={kind:`make`,id:i,target:e,key:n,type:s?.type??_(u),inputs:[...p,...g]};l.set(i,v),m({node:i,handle:et,type:v.type},e,B(n));for(let e of v.inputs)C(e.value,i,B(e.key));return v};for(let[e,t]of o)for(let[n,r]of t.entries()){if(r.key===`#condition`&&r.state===`expression`){t[n]={...r,state:`made`},j(e,r.value);continue}if(r.state===`expression`&&ue(e,r)){t[n]={...r,state:`made`};continue}r.state===`made`&&pe(e,r.key),(r.state===`wired`||r.state===`expression`)&&C(r.value,e,B(r.key))}for(let e of n)e.kind===`break`&&a.has(e.source)&&S(e.source,e.path),e.kind===`make`&&o.get(e.target)?.some(t=>t.key===e.key&&t.state!==`wired`&&t.state!==`expression`)&&pe(e.target,e.key);return{inputs:o,outputs:a,pure:[...c.values(),...l.values(),...u,...d],edges:[...f.values()]}},sr=e=>e.reason===`notBefore`?F(`refuseNotBefore`,{step:e.step}):e.reason===`otherScope`?F(`refuseOtherScope`,{step:e.step}):e.reason===`shapesOutput`?F(`refuseShaped`,{step:e.step}):e.reason===`type`?F(`refuseType`,{source:W(e.source),target:W(e.target)}):F(`refuseNotPins`),Q=e=>it(e)!==void 0||at(e)!==void 0,$=(e,t)=>({node:J(e),handle:t??``}),cr=e=>e!==`any`&&e.includes(`object`),lr=(e,t)=>e.map(e=>({label:Nt(e),add:()=>t(e)})),ur=(e,t)=>{let n=e=>e.kind===`break`?Ye(e.source,e.path):Xe(e.target,e.key),r=e=>e.kind===`break`&&t.some(t=>t.kind===`break`&&t.source===e.source&&t.path.every((t,n)=>e.path[n]===t));return e.filter(e=>!r(e)&&!t.some(t=>t.id===n(e)))},dr=(e,t,n,r,i)=>{let a=r?.edits,[o,s]=(0,R.useState)([]),[c,l]=(0,R.useState)(new Set),[u,d]=(0,R.useState)(),f=(0,R.useRef)({definition:e,editing:r});(0,R.useEffect)(()=>{f.current={definition:e,editing:r}});let p=(0,R.useMemo)(()=>n&&or(e,n,o),[e,n,o]),m=ne(e)===`data`,h=(0,R.useMemo)(()=>{if(p)return{sizes:Ut(t,p,c),pure:p.pure.map(e=>({id:e.id,parent:Jt(t,e)})),wires:p.edges.map(e=>({id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),ports:qt(t,p,c),dataOrder:m}},[t,p,c,m]),g=r&&{setArgument:(t,n,i)=>r.onChange(r.edits.setArgument(e,t,n,i)),setConditionSide:(t,n,i)=>r.onChange(r.edits.setConditionSide(e,t,n,{value:i})),setCondition:(t,n)=>r.onChange(r.edits.setArgument(e,t,[`#condition`],n)),toggleOpen:e=>l(t=>t.has(e)?new Set([...t].filter(t=>t!==e)):new Set([...t,e]))},_=(t,n)=>{if(!p||!a||!Q(t.handle)||!Q(n.handle))return;let[r,i]=at(t.handle)?[t,n]:[n,t],o=a.wireRefusal(e,p,$(r.node,r.handle),$(i.node,i.handle));return o&&sr(o)},v=t=>!!(p&&a)&&a.wireRefusal(e,p,$(t.source,t.sourceHandle),$(t.target,t.targetHandle))===void 0,ee=t=>{r&&p&&r.onChange(r.edits.connectData(e,p,$(t.source,t.sourceHandle),$(t.target,t.targetHandle)))},y=(e,t,n)=>{if(!p||!a)return e;let r=e,i=n.flatMap(e=>{let t=e.data?.wire,n=t&&p.pure.find(e=>e.kind===`break`&&e.id===t.target||e.kind===`make`&&e.id===t.source);return n?[{id:n.id}]:[]}),o=[...t.filter(e=>q(e.id)),...i.filter(e=>!t.some(t=>t.id===e.id))],c=n.flatMap(e=>{let t=e.data?.wire;return t&&!o.some(e=>e.id===t.source||e.id===t.target)?[{wire:t}]:[]}),l=o.flatMap(e=>p.pure.filter(t=>t.id===e.id).map(e=>({pure:e}))),u=[...c,...l];for(let e of lt(p,u,e=>`wire`in e?ot(p,e.wire):st(e.pure)))r=`wire`in e?a.disconnectData(r,p,e.wire):a.removePure(r,p,e.pure);return o.length>0&&s(e=>ur(e,o.flatMap(e=>p.pure.filter(t=>t.id===e.id)))),r},te=(e,t)=>{let{definition:n,editing:r}=f.current;r?.onChange(r.edits.addSelect(n,e,t))},b=(e,t,n)=>{let{definition:r,editing:i}=f.current;i?.onChange(i.edits.addCondition(r,e,t,n))};return{data:p,open:c,layout:h,actions:g,check:_,isValid:v,connect:ee,remove:y,connectEnd:(e,t)=>{if(!p||!r||t.isValid||t.toHandle||!t.fromHandle?.id||!t.fromNode)return;let n=J(t.fromNode.id),a=t.fromHandle.id,o=`changedTouches`in e?e.changedTouches[0]:e,c=i.current?.getBoundingClientRect(),l={x:o.clientX-(c?.left??0),y:o.clientY-(c?.top??0)},u=at(a);if(u){let e=p.pure.find(e=>e.id===n),t=(e?.kind===`break`?e.outputs:p.outputs.get(n)??[]).find(e=>JSON.stringify(e.path)===JSON.stringify(u))?.type;if(!t||!cr(t.kinds))return;let r=e?.kind===`break`?{source:e.source,path:[...e.path,...u]}:{source:n,path:u};d({...l,choices:[{label:F(`breakTitle`,{type:W(t)}),add:()=>s(e=>[...e,{kind:`break`,...r}])}]});return}let f=it(a),m=p.pure.find(e=>e.id===n);if(m?.kind===`condition`){let e=m.inputs.find(e=>e.key===f);if(!e||e.state!==`literal`&&e.state!==`empty`||m.part.kind!==`logic`&&m.part.kind!==`not`)return;d({...l,choices:lr(r.edits.conditionChoices(!1),e=>b(m.target,[...m.at,Number(f)],e))});return}let h=f===void 0?void 0:p.inputs.get(n)?.find(e=>e.key===f);if(h?.key===`#condition`&&h.state===`empty`){d({...l,choices:lr(r.edits.conditionChoices(!0),e=>b(n,[],e))});return}if(h&&h.key!==`#condition`&&!cr(h.type.kinds)&&(h.state===`empty`||h.state===`literal`)){d({...l,choices:[{label:F(`selectOffer`),add:()=>te(n,h.key)}]});return}h&&cr(h.type.kinds)&&h.state!==`wired`&&h.state!==`expression`&&d({...l,choices:[{label:F(`makeTitle`,{type:W(h.type)}),add:()=>s(e=>[...e,{kind:`make`,target:n,key:h.key}])}]})},offer:u,closeOffer:()=>d(void 0)}},fr=(0,R.createContext)(void 0),pr=({fromX:e,fromY:t,toX:n,toY:r,fromPosition:i,toPosition:a,connectionStatus:o,fromNode:s,fromHandle:c,toNode:l,toHandle:u})=>{let d=(0,R.useContext)(fr),[f]=_e({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:a}),p=o===`invalid`&&l&&u?.id&&c.id?d?.({node:s.id,handle:c.id},{node:l.id,handle:u.id}):void 0;return(0,H.jsxs)(`g`,{className:p?`pb-wire-refused`:void 0,children:[(0,H.jsx)(`path`,{d:f,fill:`none`,className:`react-flow__connection-path`}),p&&(0,H.jsx)(`foreignObject`,{x:n+12,y:r-30,width:260,height:28,className:`overflow-visible`,children:(0,H.jsx)(`div`,{className:`inline-block rounded border border-danger bg-danger-soft px-1.5 py-0.5 text-xs whitespace-nowrap text-danger-text shadow`,children:p})})]})},mr=(e,t)=>{let n=De(),[r,i]=(0,R.useState)(),a=(0,R.useMemo)(()=>JSON.stringify(xt(e,t)),[e,t]);return(0,R.useEffect)(()=>{if(!n)return;let e=!0;return Ct(n,JSON.parse(a)).then(t=>{e&&i(t)}),()=>{e=!1}},[n,a]),r},hr={state:Pn,trigger:Fn,pure:Qn},gr=e=>e?.kind===`state`?e.scope.join(`/`):``,_r=({laidOut:e,tidied:t})=>{let n=ye();return(0,R.useEffect)(()=>{e&&n.fitView({maxZoom:1,padding:.1})},[e,t]),null},vr=()=>{let e=ye(),t=xe(e=>e.width),n=(0,R.useRef)(t);return(0,R.useEffect)(()=>{let r=n.current;if(n.current=t,r===0||t===0||t===r)return;let{x:i,y:a,zoom:o}=e.getViewport();e.setViewport({x:i+(t-r)/2,y:a,zoom:o})},[t,e]),null},yr=({laidOut:e,ids:t})=>{let n=Ee();return(0,R.useEffect)(()=>{e&&n(t)},[e]),null},br=new Map,xr=({definition:e,problems:t,warnings:n,selected:r,onSelect:i,onChange:a,edits:o,onAddAt:s,traces:c,types:u,schemas:f,fills:p=!1,layout:h,onLayoutChange:g})=>{let _=a&&o&&{onChange:a,edits:o},v=(0,R.useMemo)(()=>ht(e),[e]),ee=(0,R.useRef)(null),[y,te]=Bn(),b=dr(e,v,y===`pins`?f:void 0,_,ee),x=mr(v,b.layout),S=(0,R.useMemo)(()=>new Map(v.nodes.map(e=>[e.id,e])),[v]),re=JSON.stringify(h??{}),C=(0,R.useMemo)(()=>pe(re),[re]),w=C[y],T=e=>g?.({...C,[y]:e}),E=(0,R.useMemo)(()=>new Map([...v.nodes.map(e=>[e.id,me(e.id)]),...(b.data?.pure??[]).map(e=>[e.id,me(e.id,e)])]),[v,b.data]),D=(0,R.useMemo)(()=>new Map([...E].flatMap(([e,t])=>Object.hasOwn(w,t)?[[e,w[t]]]:[])),[E,w]),O=(0,R.useMemo)(()=>{if(!x)return;let e=new Map((b.data?.pure??[]).map(e=>[e.id,e]));return ue(x,D,t=>{let n=S.get(t);return e.has(t)?Jt(v,e.get(t)):n?.kind===`state`?n.parent:void 0})},[x,D,S,v,b.data]),k=!!g,[ie,ae]=(0,R.useState)(br),[A,j]=(0,R.useState)(0),M=ne(e)===`data`,[N,se]=(0,R.useState)(()=>new Set(r===void 0?[]:[K(r)]));(0,R.useEffect)(()=>{se(e=>r===void 0?e.size===1&&!q([...e][0])?new Set:e:e.has(K(r))?e:new Set([K(r)]))},[r]);let ce=(0,R.useMemo)(()=>[...Zt(v,O,t,r,c,u,n,b.data&&{data:b.data,open:b.open},M),...b.data?rn(v,b.data,O,b.open):[]].map(e=>{let t=ie.get(e.id),n=D.has(J(e.id));return{...e,selected:N.has(e.id),draggable:k,...t&&{position:t},...n&&{data:{...e.data,moved:!0},...e.ariaLabel&&{ariaLabel:`${e.ariaLabel}, ${F(`movedByHand`)}`}}}}),[v,O,t,r,c,u,n,b.data,b.open,M,N,ie,D,k]),[le,de]=(0,R.useState)(),fe=(0,R.useMemo)(()=>[...M&&b.data?an(v,b.data):nn(v,M),...b.data?on(b.data):[]].map(e=>({...e,selected:e.id===le})),[v,b.data,le,M]),P=!!_,he=e=>{if(Q(e.sourceHandle)||Q(e.targetHandle))return Q(e.sourceHandle)&&Q(e.targetHandle)&&b.isValid(e);if(e.targetHandle!==`in`)return!1;let t=S.get(J(e.target)),n=S.get(J(e.source));return t?.kind===`state`&&gr(n)===gr(t)},ge=e=>{ae(br);let t=[...e].flatMap(([e,t])=>{let n=J(e),r=E.get(n),i=O?.get(n),a={x:Math.round(t.x),y:Math.round(t.y)};return r===void 0||!D.has(n)&&i&&Math.round(i.x)===a.x&&Math.round(i.y)===a.y?[]:[[r,a]]});t.length>0&&T({...w,...Object.fromEntries(t)})},_e=g&&(e=>{let t=E.get(J(e));t!==void 0&&T(oe(w,t))}),I=()=>{T({}),j(e=>e+1)},ve=e=>{let t=new Map;for(let n of e){if(n.type!==`position`||!n.position||!k)continue;let e=n.position;n.dragging?ae(t=>new Map(t).set(n.id,e)):t.set(n.id,e)}t.size>0&&ge(t);let n=e.filter(e=>e.type===`select`);if(n.length===0)return;let a=new Set(N);for(let e of n)e.selected?a.add(e.id):a.delete(e.id);se(a);let[o]=a.size===1?[...a]:[],s=o===void 0||q(o)?void 0:J(o);if(s!==void 0&&(ye||xe.current))return r===void 0?void 0:i(void 0);s!==r&&i(s)},ye=we(`Shift`),xe=(0,R.useRef)(!1);return(0,H.jsx)(sn.Provider,{value:_?s:void 0,children:(0,H.jsx)(bn.Provider,{value:_e,children:(0,H.jsx)(ln.Provider,{value:b.actions,children:(0,H.jsx)(fr.Provider,{value:b.check,children:(0,H.jsxs)(`div`,{ref:ee,className:`relative h-full w-full`,children:[(0,H.jsxs)(Ce,{className:`pb-workflow`,nodes:ce,edges:fe,nodeTypes:hr,nodesDraggable:k,nodeDragThreshold:4,selectNodesOnDrag:!1,nodesConnectable:P,connectOnClick:!1,connectionDragThreshold:4,edgesFocusable:P,elementsSelectable:!0,deleteKeyCode:P?[`Backspace`,`Delete`]:null,onNodesChange:ve,onEdgesChange:e=>{for(let t of e)t.type===`select`&&(t.selected?de(t.id):de(e=>e===t.id?void 0:e))},isValidConnection:he,onConnect:t=>{if(_&&t.sourceHandle){if(Q(t.sourceHandle))return b.connect(t);_.onChange(_.edits.connect(e,t.sourceHandle,J(t.source),J(t.target)))}},onConnectEnd:b.connectEnd,connectionLineComponent:pr,onDelete:({nodes:t,edges:n})=>{if(!_)return;let r=t.filter(e=>!q(e.id)).map(e=>J(e.id)).filter(e=>e!==``),i=b.remove(e,t,n);for(let e of n){let t=e.data;t.kind!==`data`&&!r.includes(t.source)&&!r.includes(J(e.target))&&(i=_.edits.disconnect(i,t))}for(let e of r)r.some(t=>e.startsWith(`${t}/`))||(i=_.edits.removeState(i,e));_.onChange(i)},multiSelectionKeyCode:`Shift`,onSelectionStart:()=>void(xe.current=!0),onSelectionEnd:()=>void(xe.current=!1),onNodeClick:(e,t)=>!e.shiftKey&&!q(t.id)&&i(J(t.id)),onPaneClick:()=>i(void 0),zoomOnScroll:!0,panOnScroll:!1,panOnDrag:[0,1,2],selectionOnDrag:!1,selectionKeyCode:`Shift`,preventScrolling:!0,onPaneContextMenu:e=>e.preventDefault(),minZoom:.2,maxZoom:1.5,"aria-label":F(`canvas`),children:[(0,H.jsx)(Te,{gap:16}),f&&(0,H.jsx)(be,{position:`top-left`,children:(0,H.jsx)(l,{label:F(`graphView`),value:y,onChange:te,options:[{value:`pins`,label:F(`viewPins`)},{value:`simple`,label:F(`viewSimple`)}]})}),k&&Object.keys(w).length>0&&(0,H.jsx)(be,{position:`top-right`,children:(0,H.jsxs)(d,{title:F(`tidyUpHelp`),onClick:I,children:[(0,H.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),F(`tidyUp`)]})}),(0,H.jsx)(Se,{showInteractive:!1}),(0,H.jsx)(_r,{laidOut:x,tidied:A}),p&&(0,H.jsx)(vr,{}),(0,H.jsx)(yr,{laidOut:O,ids:ce.map(e=>e.id)})]}),b.offer&&(0,H.jsx)($n,{offer:b.offer,onClose:b.closeOffer})]})})})})})},Sr=e=>(0,H.jsx)(ve,{children:(0,H.jsx)(xr,{...e})});export{it as a,Le as c,Pe as d,je as f,ze as g,Be as h,ot as i,Ue as l,Ve as m,cn as n,at as o,Me as p,lt as r,Ke as s,Sr as t,Fe as u};
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=4a77f61d-d2f1-48c4-8413-ea36101e14ac
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workflow-graph-editor-
|
|
2
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{O as r,Oo as i,Q as a,ic as o,mr as s,nl as c}from"./app-
|
|
3
|
-
//# debugId=
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workflow-graph-editor-B8RJ52_E.js","assets/rolldown-runtime-DFwUHQ4A.js","assets/react-CuiNlnus.js","assets/app-D3BCcbgE.js","assets/vendor-t7Q7QbPu.js","assets/app-xwgcmboV.css","assets/step-catalog-CCAXc8kn.js","assets/circle-alert-ytReRN_c.js","assets/workflow-canvas-BKd_Yd0v.js","assets/layout-grid-CTlIrnH5.js","assets/workflows-Bey4jszG.js","assets/lib-ajv-BPyvefs9.js","assets/lib-fast-deep-equal-BGljVuDb.js","assets/lib-json-schema-traverse-DxXzBYGi.js","assets/lib-fast-uri-DriPOqOU.js","assets/lib-jsonata-Cu4QFOo8.js","assets/use-run-trace-BRwbwZcf.js","assets/use-workflow-types-Bn24Chp-.js","assets/lib-xyflow-system-hojcPWkY.js","assets/lib-d3-interpolate-C7dFwq8w.js","assets/lib-d3-color-B6XHLQii.js","assets/lib-d3-selection-C1a5EtaJ.js","assets/lib-d3-drag-CUJR_Vab.js","assets/lib-d3-dispatch-Bjkn7q4t.js","assets/lib-d3-zoom-DuEhbOrX.js","assets/lib-d3-transition-CUMO2iZu.js","assets/lib-d3-timer-CduGpaSm.js","assets/lib-d3-ease-ouQSXgQM.js","assets/lib-xyflow-react-CuNAzocq.js","assets/lib-classcat-otpLnDWv.js","assets/lib-zustand-r6mNROKr.js","assets/lib-use-sync-external-store-D4s7MiFL.js","assets/lib-xyflow-react-DLioOiRN.css","assets/use-elk-u1Ql5AOs.js","assets/lib-elkjs-ylMkguT9.js","assets/workflow-canvas-C5ExDFGN.css","assets/trash-CFCBxAWq.js","assets/graph-frame-PVfWqgbJ.js","assets/workflow-workbench-CqOI36Oy.js","assets/record-sidebar-HqyBXBwn.js","assets/step-panel-jmfh86YA.js","assets/use-workflow-page-DsD276W-.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{O as r,Oo as i,Q as a,ic as o,mr as s,nl as c}from"./app-D3BCcbgE.js";import{C as l}from"./vendor-t7Q7QbPu.js";import{_ as u,o as d,v as f,w as p,y as m}from"./use-run-trace-BRwbwZcf.js";import{n as h,t as g}from"./use-workflow-types-Bn24Chp-.js";import{n as _}from"./use-workflow-page-DsD276W-.js";var v=e(t(),1),y=e(n(),1),b=(0,v.lazy)(()=>l(()=>import(`./workflow-graph-editor-B8RJ52_E.js`).then(e=>({default:e.WorkflowGraphEditor})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]))),x=(0,v.lazy)(()=>l(()=>import(`./workflow-workbench-CqOI36Oy.js`).then(e=>({default:e.WorkflowWorkbench})),__vite__mapDeps([38,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,39,40,41]))),S=()=>(0,y.jsx)(o,{className:`h-full min-h-[22rem] w-full`}),C=[`trigger`,`execution_order`,`connections`,`trace`],w=(e,t)=>{let n=a(),i=e=>{if(!n?.model.fields[e])return null;let t=n.value(e);if(t===``||t===void 0)return null;if(typeof t!=`string`||e!==`trigger`&&e!==`connections`)return t;try{return JSON.parse(t)}catch{return t}},o=n?p({...Object.fromEntries(C.map(e=>[e,i(e)])),state_machine:e}):f({stateMachine:e}),s=t&&(e=>{let a=m(e);if(t(a.state_machine),n)for(let e of C){let t=n.model.fields[e];t&&JSON.stringify(a[e])!==JSON.stringify(i(e))&&n.change(e,r(t,a[e]))}}),c=n?.model.fields.layout;return{definition:o,change:s,layout:c?d(n.value(`layout`)):void 0,changeLayout:t&&c&&(e=>n.change(`layout`,r(c,e)))}},T=({value:e,onChange:t})=>{let n=g(),r=_(),{definition:a,change:o,layout:c,changeLayout:l}=w(e,t),u={...c&&{layout:c},...l&&{onLayoutChange:l}};return n.error?(0,y.jsx)(s,{title:h(`typesFailed`),error:n.error}):n.data?(0,y.jsx)(i.Provider,{value:void 0,children:(0,y.jsx)(v.Suspense,{fallback:(0,y.jsx)(S,{}),children:r?(0,y.jsx)(x,{view:r,value:a,types:n.data,...o&&{onChange:o},...u}):(0,y.jsx)(b,{value:a,types:n.data,...o&&{onChange:o},...u})})}):(0,y.jsx)(S,{})},E=({value:e})=>(0,y.jsx)(T,{value:e}),D=({value:e,onChange:t})=>(0,y.jsx)(T,{value:e,onChange:t}),O=({value:e})=>(0,y.jsx)(`span`,{className:`tabular-nums`,children:h(`stateCount`,{count:u(f({stateMachine:e}).stateMachine).length})}),k={of:[...c.workflow],display:E,editor:D,cell:O,wide:!0};export{k as workflowField};
|
|
3
|
+
//# debugId=f205a57a-9b9e-4f8e-a7da-de77dd14153e
|
package/dist/shell/assets/{workflow-graph-editor-DQYfPu8C.js → workflow-graph-editor-B8RJ52_E.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{X as r,sc as i,yc as a}from"./app-
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{X as r,sc as i,yc as a}from"./app-D3BCcbgE.js";import{E as o,S as s,_ as c,a as l,b as u,g as d,i as f,k as p,m,n as h,t as g,w as _,y as v}from"./step-catalog-CCAXc8kn.js";import{t as y}from"./workflow-canvas-BKd_Yd0v.js";import{E as b,S as x,b as S,v as C}from"./use-run-trace-BRwbwZcf.js";import{n as w}from"./use-workflow-types-Bn24Chp-.js";import{n as T,t as E}from"./graph-frame-PVfWqgbJ.js";var D=e(t(),1),O=e(n(),1),k=(e,t)=>{if(t===void 0||t===``)return[];let n=t.split(`/`);return S(b(e,t))?n:n.slice(0,-1)},A=({value:e,types:t,onChange:n,notice:S,layout:A,onLayoutChange:j})=>{let M=JSON.stringify(e??null),N=(0,D.useMemo)(()=>C(JSON.parse(M)),[M]),P=f(t),F=(0,D.useMemo)(()=>v(c(N,t,P)),[N,t,P]),I=(0,D.useMemo)(()=>u(N),[N]),[L,R]=(0,D.useState)(),[z,B]=(0,D.useState)(),V=(0,D.useMemo)(()=>h(t),[t]),H=L===``||L!==void 0&&b(N,L)?L:void 0,U=k(N,H),W=(e,t)=>{if(!n)return;let r=o(N,w(`newStep`));n(t?_(N,e,r,w(`newStep`),t):s(N,U,e,r,w(`newStep`))),R(x(t?p(t):U,r)),B(void 0)};return(0,O.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n&&(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,O.jsxs)(i,{onClick:()=>B(z?void 0:{}),"aria-expanded":!!z,children:[(0,O.jsx)(a,{className:`size-3.5`,"aria-hidden":!0}),U.length>0?w(`addStepInside`,{map:U.join(`/`)}):w(`addStep`)]}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w(`connectHelp`)})]}),(0,O.jsx)(d,{problems:F.whole}),(0,O.jsx)(E,{canvas:(0,O.jsx)(y,{definition:N,problems:F.byNode,warnings:I,selected:H,onSelect:R,onChange:n,edits:l,onAddAt:e=>B({at:e}),types:t,schemas:P,layout:A,onLayoutChange:j}),panel:(0,O.jsxs)(O.Fragment,{children:[S,z?(0,O.jsx)(r,{autoFocus:!0,groups:V,onPick:e=>W(g(e.id),z.at)}):H===void 0?(0,O.jsx)(T,{children:w(`pickNode`)}):(0,O.jsx)(m,{definition:N,types:t,selected:H,problems:F.byNode.get(H)??[],warnings:I.get(H)??[],onChange:n,onSelect:R})]})})]})};export{A as WorkflowGraphEditor};
|
|
2
|
+
//# debugId=7c449e76-fc41-4ae5-b5f7-c781771a3ba1
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/run-trace-view-
|
|
2
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{ic as r,nl as i}from"./app-
|
|
3
|
-
//# debugId=
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/run-trace-view-BPvPw3Ko.js","assets/rolldown-runtime-DFwUHQ4A.js","assets/react-CuiNlnus.js","assets/app-D3BCcbgE.js","assets/vendor-t7Q7QbPu.js","assets/app-xwgcmboV.css","assets/workflow-canvas-BKd_Yd0v.js","assets/circle-alert-ytReRN_c.js","assets/layout-grid-CTlIrnH5.js","assets/workflows-Bey4jszG.js","assets/lib-ajv-BPyvefs9.js","assets/lib-fast-deep-equal-BGljVuDb.js","assets/lib-json-schema-traverse-DxXzBYGi.js","assets/lib-fast-uri-DriPOqOU.js","assets/lib-jsonata-Cu4QFOo8.js","assets/use-run-trace-BRwbwZcf.js","assets/use-workflow-types-Bn24Chp-.js","assets/lib-xyflow-system-hojcPWkY.js","assets/lib-d3-interpolate-C7dFwq8w.js","assets/lib-d3-color-B6XHLQii.js","assets/lib-d3-selection-C1a5EtaJ.js","assets/lib-d3-drag-CUJR_Vab.js","assets/lib-d3-dispatch-Bjkn7q4t.js","assets/lib-d3-zoom-DuEhbOrX.js","assets/lib-d3-transition-CUMO2iZu.js","assets/lib-d3-timer-CduGpaSm.js","assets/lib-d3-ease-ouQSXgQM.js","assets/lib-xyflow-react-CuNAzocq.js","assets/lib-classcat-otpLnDWv.js","assets/lib-zustand-r6mNROKr.js","assets/lib-use-sync-external-store-D4s7MiFL.js","assets/lib-xyflow-react-DLioOiRN.css","assets/use-elk-u1Ql5AOs.js","assets/lib-elkjs-ylMkguT9.js","assets/workflow-canvas-C5ExDFGN.css","assets/step-panel-jmfh86YA.js","assets/graph-frame-PVfWqgbJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{ic as r,nl as i}from"./app-D3BCcbgE.js";import{C as a}from"./vendor-t7Q7QbPu.js";var o=e(t(),1),s=e(n(),1),c=(0,o.lazy)(()=>a(()=>import(`./run-trace-view-BPvPw3Ko.js`).then(e=>({default:e.RunTrace})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]))),l=({value:e})=>e===null?null:(0,s.jsx)(o.Suspense,{fallback:(0,s.jsx)(r,{className:`h-[28rem] w-full max-sm:h-[22rem]`}),children:(0,s.jsx)(c,{runId:e})}),u=({value:e})=>(0,s.jsx)(`span`,{className:`font-mono text-xs`,children:e}),d={of:[...i.workflow_run],display:l,cell:u,wide:!0};export{d as workflowRunField};
|
|
3
|
+
//# debugId=b396e621-8ec3-4266-b62f-77c346b0013d
|
package/dist/shell/assets/{workflow-status-field-CBRUOn6n.js → workflow-status-field-_umgNjK4.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Al as r,Bl as i,Cl as a,El as o,Lr as s,Pa as c,Ra as l,Sl as u,Tl as d,Xc as f,Yi as p,_l as m,_o as h,bl as g,bs as _,gl as ee,hl as v,jl as te,kl as y,ls as b,ml as x,nl as S,pl as ne,rs as re,sc as ie,vl as ae,vn as oe,wa as se,wl as ce,xl as le,yl as ue,zi as de,zl as fe}from"./app-Bu6FwwHZ.js";import{i as pe,r as me,t as he}from"./update-set-BmW6qYcW.js";import{a as C,c as w,d as ge,i as _e,l as ve,n as ye,o as be,r as xe,s as Se,t as Ce,u as we}from"./lib-zod-B92j-KH2.js";import{t as T}from"./view-chart-ChBtewKd.js";import{n as E,o as D,s as O}from"./use-workflow-page-DSt6Ws-R.js";var k=/^-?\d+$/,Te=-(2n**63n),Ee=2n**63n-1n,De={type:`bigint`,constraints:[],build:()=>w().refine(e=>k.test(e)&&BigInt(e)>=Te&&BigInt(e)<=Ee,{message:`Expected a 64-bit integer as a string`})},Oe={type:`boolean`,constraints:[],build:()=>_e()},ke={type:`country`,constraints:[],build:()=>w().regex(/^[A-Z]{2}$/,`Expected an ISO 3166-1 alpha-2 country code`)},Ae={type:`currency`,constraints:[],build:()=>w().regex(/^[A-Z]{3}$/,`Expected an ISO 4217 currency code`)},je={type:`date`,constraints:[],build:()=>Ce()},Me=/^-?(\d*)(?:\.(\d+))?$/,Ne={type:`decimal`,constraints:[],build:e=>{if(e.precision===void 0||e.scale===void 0)throw Error(`f.decimal requires precision and scale`);let t=e.precision-e.scale,n=e.scale;return w().refine(e=>{let r=Me.exec(e);if(!r)return!1;let i=(r[1]??``).replace(/^0+/,``),a=r[2]??``;return r[1]||a?i.length<=t&&a.length<=n:!1},{message:`Expected a decimal string with at most ${e.precision} digits, ${e.scale} after the point`,params:{precision:e.precision,scale:e.scale}})}},Pe={type:`enum`,constraints:[],build:e=>{if(!e.enumValues?.length)throw Error(`f.enum requires at least one value`);return xe(e.enumValues)}},A={type:`file`,constraints:[],build:()=>w().min(1).max(4096)},Fe={type:`integer`,constraints:[`min`,`max`],build:e=>{let t=C();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),t}},Ie=(e,t=256)=>{let n=[[e,0]];for(;n.length>0;){let[e,r]=n.pop();if(typeof e==`object`&&e){if(r+1>t)return!1;for(let t of Object.values(e))n.push([t,r+1])}}return!0},Le={type:`json`,constraints:[],build:()=>Se((e,t)=>(Ie(e)||t.addIssue({code:`custom`,message:`Nested deeper than 256 levels`,params:{max_depth:256}}),e),be())},j={type:`relation`,constraints:[],build:()=>ve([w(),C()])},Re={type:`text`,constraints:[`min`,`max`,`regex`],build:e=>{let t=w();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),e.regex&&(t=t.regex(e.regex.re,e.regex.message)),t}},ze={type:`timestamp`,constraints:[],build:()=>ye({offset:!0})},Be={type:`uuid`,constraints:[],build:()=>we()},Ve=e=>fe(e),M=e=>Ve(e).length===0?`its prompt must name at least one {{field}} of the record`:void 0,N=/\s*(?:(\d+(?:\.\d+)?)|([A-Za-z_][A-Za-z0-9_]*)|([-+*/(),]))/y,He=e=>{let t=[];for(N.lastIndex=0;N.lastIndex<e.length;){let n=N.lastIndex,r=N.exec(e);if(!r){let t=e.slice(n);if(t.trim()===``)break;let r=t.length-t.trimStart().length;throw Error(`Formula "${e}": unexpected "${t[r]}" at ${n+r+1}`)}let[i,a,o,s]=r,c=a??o??s;t.push({kind:a===void 0?o===void 0?`symbol`:`name`:`number`,text:c,at:n+i.length-c.length})}return t},Ue=e=>{let t=He(e),n=0,r=r=>{let i=t[n];throw Error(`Formula "${e}": ${r}${i?` at ${i.at+1}, found "${i.text}"`:` at the end`}`)},i=e=>t[n]?.kind===`symbol`&&t[n].text===e,a=e=>{i(e)||r(`expected "${e}"`),n+=1},o=()=>{a(`(`);let e=[u()];for(;i(`,`);)n+=1,e.push(u());return a(`)`),e},s=e=>{if(e===`coalesce`){let e=o();return e.length<2&&r(`coalesce() takes at least two values`),{kind:`coalesce`,args:e}}let t=o(),[n,i]=t;return t.length>2&&r(`round() takes a value and at most a number of digits`),i===void 0?{kind:`round`,value:n}:((i.kind!==`number`||i.value.includes(`.`))&&r(`round()'s digits must be a whole number`),{kind:`round`,value:n,digits:Number(i.value)})},c=()=>{let e=t[n];if(!e)return r(`expected a number, a field or "("`);if(e.kind===`number`)return n+=1,{kind:`number`,value:e.text};if(e.kind===`name`)return n+=1,i(`(`)?e.text!==`coalesce`&&e.text!==`round`?(--n,r(`unknown function "${e.text}", only coalesce() and round()`)):s(e.text):{kind:`field`,name:e.text};if(e.text===`-`)return n+=1,{kind:`negate`,operand:c()};if(e.text===`(`){n+=1;let e=u();return a(`)`),e}return r(`expected a number, a field or "("`)},l=()=>{let e=c();for(;i(`*`)||i(`/`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:c()}}return e},u=()=>{let e=l();for(;i(`+`)||i(`-`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:l()}}return e},d=u();return n<t.length&&r(`expected an operator`),d},We=ge(),P=class e{def;meta;schema;constructor(e,t){this.def=e,this.meta=t;let n=e.build(t);t.nullable&&(n=n.nullable()),t.hasDefault&&(n=n.default(t.defaultValue)),this.schema=n.register(We,t)}column(e){return this.with({column:e})}readOnly(){return this.with({readOnly:!0})}optional(){return this.with({nullable:!0})}default(e){return this.with({hasDefault:!0,defaultValue:e})}access(e){return this.with({access:{...this.meta.access,...e}})}sensitive(){return this.with({sensitive:!0})}encrypted(){if(this.meta.type!==`text`)throw Error(`.encrypted() takes only f.text() fields`);return this.with({encrypted:!0,sensitive:!0})}strongSignIn(e={}){let t=e.minutes??15;if(!Number.isInteger(t)||t<1)throw Error(`.strongSignIn(): minutes must be a whole number of at least 1`);return this.with({strongSignIn:{minutes:t},sensitive:!0})}dbDefault(){return this.with({dbDefault:!0})}alias(...e){return this.with({aliases:[...this.meta.aliases,...e]})}filterable(){return this.with({filterable:!0})}sortable(){return this.with({sortable:!0})}regex(e,t){return this.constrain(`regex`,{regex:{re:e,message:t}})}min(e){return this.constrain(`min`,{min:e})}max(e){return this.constrain(`max`,{max:e})}ai(e){let t=M(e.prompt);if(t)throw Error(`.ai(): ${t}`);return this.with({ai:{prompt:e.prompt}})}rollup(e){return this.with({rollup:{...e},readOnly:!0})}formula(e){return Ue(e),this.with({formula:e,readOnly:!0})}lookup(e){return this.with({lookup:{...e},readOnly:!0,nullable:!0})}with(t){return new e(this.def,{...this.meta,...t})}constrain(e,t){if(!this.def.constraints.includes(e))throw Error(`f.${this.def.type} does not support .${e}()`);return this.with(t)}},Ge=class extends P{columns(e){return this.with({relation:{resource:this.meta.relation.resource,columns:e}})}},F=[`webp`,`avif`,`jpeg`,`png`],Ke=5e7,qe={b:1,kb:1e3,mb:1e6,gb:1e9,kib:1024,mib:1024**2,gib:1024**3},I=e=>{if(typeof e==`number`){if(!Number.isSafeInteger(e)||e<=0)throw Error(`A file size must be a positive whole number of bytes, not ${e}`);return e}let t=/^\s*(\d+(?:\.\d+)?)\s*([a-z]+)?\s*$/i.exec(e),n=qe[(t?.[2]??`b`).toLowerCase()];if(!t||!n)throw Error(`"${e}" is not a size; write it like "10 MB" or "512 KiB"`);return I(Math.round(Number(t[1])*n))},Je=/^(?:\*\/\*|[a-z0-9][a-z0-9!#$&^_.+-]*\/(?:\*|[a-z0-9][a-z0-9!#$&^_.+-]*))$/,L=e=>e.map(e=>{let t=e.trim().toLowerCase();if(!Je.test(t))throw Error(`"${e}" is not a media type or a type/* wildcard`);return t}),Ye=/^[a-z][a-z0-9-]{0,31}$/,Xe=new Set([`http`,`https`,`data`,`blob`,`file`,`javascript`,`mailto`]),Ze=e=>{if(!Ye.test(e))throw Error(`"${e}" is not a file provider name: lowercase letters, digits and dashes, starting with a letter`);if(Xe.has(e))throw Error(`"${e}" cannot name a file provider: stored values would read as ${e}: links`);return e},Qe=/^[a-z][a-z0-9_]{0,31}$/,$e=[`inside`,`cover`],R=(e,t)=>{if(t!==void 0&&(!Number.isSafeInteger(t)||t<1||t>16384))throw Error(`${e} must be a whole number of pixels from 1 to 16384, not ${t}`)},z=(e,t)=>{if(!F.includes(t.format))throw Error(`${e}: "${t.format}" is not an image format; use ${F.join(`, `)}`);if(t.fit!==void 0&&!$e.includes(t.fit))throw Error(`${e}: fit is "inside" or "cover", not "${t.fit}"`);if(t.fit===`cover`&&(t.width===void 0||t.height===void 0))throw Error(`${e}: fit "cover" needs both a width and a height`);if(R(`${e}: width`,t.width),R(`${e}: height`,t.height),t.quality!==void 0&&(!Number.isSafeInteger(t.quality)||t.quality<1||t.quality>100))throw Error(`${e}: quality must be a whole number from 1 to 100, not ${t.quality}`);return{...t}},et=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>{if(!Qe.test(e))throw Error(`"${e}" cannot name an image variant: lowercase letters, digits and underscores, starting with a letter`);return[e,z(`Image variant "${e}"`,t)]})),tt=class e extends P{accept(e){return this.withFile({accept:L(e)})}maxSize(e){return this.withFile({maxSize:I(e)})}public(){return this.storage(`public`)}storage(e){return this.withFile({provider:Ze(e)})}derive(e){return this.withFile({derive:{...this.meta.file.derive,...e}})}placeholder(e){return this.withFile({placeholder:e})}typeField(e){return this.withFile({typeField:e})}sizeField(e){return this.withFile({sizeField:e})}variants(e,t={}){return this.withFile({variants:{...this.meta.file.variants,...et(e)},...t.original&&{original:z(`The original`,t.original)}})}externalUrls(){return this.withFile({external:!0})}optional(){return this.with({nullable:!0})}readOnly(){return this.with({readOnly:!0})}column(e){return this.with({column:e})}access(e){return this.with({access:{...this.meta.access,...e}})}with(t){return new e(this.def,{...this.meta,...t})}withFile(e){return this.with({file:{...this.meta.file,...e}})}},B=e=>({type:e.type,nullable:!1,readOnly:!1,filterable:!1,sortable:!1,aliases:[],hasDefault:!1}),V=(e,t={})=>new P(e,{...B(e),...t}),H={text:()=>V(Re),integer:()=>V(Fe),bigint:()=>V(De),decimal:e=>V(Ne,e),boolean:()=>V(Oe),date:()=>V(je),timestamp:()=>V(ze),uuid:()=>V(Be),enum:e=>V(Pe,{enumValues:[...e]}),json:()=>V(Le),relation:e=>new Ge(j,{...B(j),relation:{resource:e}}),file:()=>new tt(A,{...B(A),file:{accept:[],maxSize:Ke,provider:`private`}}),currency:()=>V(Ae),country:()=>V(ke)},nt=e=>/^(https?:\/\/|mailto:)/i.test(e),rt=(e,t)=>[...typeof e.filter==`string`&&e.filter.trim()!==``?v(t,e.filter).map(e=>`filter: ${e.message}`):[`needs a filter that finds the record`],...e.orderBy===void 0?[]:m(t,e.orderBy).map(e=>`orderBy: ${e.message}`)],it=e=>e.when===void 0?e.otherwise!==void 0||e.reason!==void 0?`"otherwise" and "reason" need a "when" condition`:void 0:e.when.trim()===``?`"when" is empty`:e.otherwise===`disable`?e.reason?void 0:`a button disabled by "when" needs a "reason"`:e.reason===void 0?void 0:`"reason" shows only with otherwise: 'disable'`,U=(e,t)=>{let n=it(t);if(n)throw Error(`Action "${e}": ${n}`);return{name:e,label:t.label,bulk:t.bulk??!1,...t.icon!==void 0&&{icon:t.icon},...t.confirm!==void 0&&{confirm:t.confirm},...t.when!==void 0&&{when:t.when},...t.otherwise===`disable`&&{otherwise:t.otherwise,reason:t.reason},...t.variant!==void 0&&{variant:t.variant}}},W=(e,t)=>{if(!t)return{};let n=t(pe),r=me(n);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{inputs:n}},at={action:(e,t)=>({...U(e,t),...W(e,t.inputs),...t.mailbox&&{mailbox:!0}}),update:(e,t)=>{let n=W(e,t.inputs),r=he(t.set,n.inputs);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{...U(e,t),...n,run:{kind:`update`,values:t.set}}},remove:(e,t)=>({...U(e,t),run:{kind:`delete`}}),link:(e,t)=>{let n=i(t.label,t);if(n)throw Error(`Action "${e}": ${n}`);return`to`in t?{...U(e,t),run:{kind:`link`,to:structuredClone(t.to)}}:{...U(e,t),run:{kind:`link`,href:t.href}}},ai:(e,t)=>{let n=M(t.prompt)??(t.writes===``?`it writes no field`:void 0);if(n)throw Error(`Action "${e}": ${n}`);return{...U(e,t),run:{kind:`ai`,prompt:t.prompt,writes:t.writes}}}},ot=e=>{let{name:t,title:n,fields:r,thanks:i}=e;if(!g.test(t))throw Error(`A form's name goes in its address, so it takes lowercase letters, digits, - and _, not "${t}"`);if(r.length===0)throw Error(`Form "${t}" has no fields`);let a=r.map(e=>e.name),o=a.find((e,t)=>a.indexOf(e)!==t);if(o!==void 0)throw Error(`Form "${t}" lists the field "${o}" twice`);if(i.trim()===``)throw Error(`Form "${t}" needs a thanks text, shown once a visitor sends it`);if(n!==void 0&&n.trim()===``)throw Error(`Form "${t}" has an empty title; leave it out for the view's name`);let s=e.perMinute??5;if(!Number.isInteger(s)||s<1)throw Error(`Form "${t}" takes perMinute as a positive whole number, not ${s}`);return{name:t,...n!==void 0&&{title:n},fields:a,thanks:i,perMinute:s}},st=e=>typeof e==`object`&&!!e&&e.kind===`related`,ct={related:(e,t)=>({kind:`related`,name:e,...structuredClone(t)})},lt=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,ut=/^[A-Z]{3}$/,dt=class e{name;props;constructor(e,t={}){this.name=e,this.props=t}label(e){return this.with({label:e})}help(e,t={}){return this.with({help:e,...t.when!==void 0&&{helpWhen:t.when}})}when(e){return this.with({when:e})}notOnCreate(){return this.with({notOnCreate:!0})}confirm(e){if(e.trim()===``)throw Error(`Field "${this.name}": .confirm() needs the question to ask`);return this.with({confirm:e})}format(t,n={}){if(n.text===void 0&&t===`url`)return this.with({format:t});if(n.text===void 0){let{linkText:n,...r}=this.props;return new e(this.name,{...r,format:t})}if(t!==`url`)throw Error(`Field "${this.name}": only format('url') takes a link text`);if(n.text.trim()===``)throw Error(`Field "${this.name}": format('url') needs a link text that is not empty`);return this.with({format:t,linkText:n.text})}multiline(){return this.with({multiline:!0})}markdown(){return this.with({markdown:!0})}prefix(e){return this.with({prefix:e})}currency(e){if(!ut.test(e))throw Error(`Field "${this.name}": currency "${e}" is not an ISO 4217 code such as EUR`);return this.with({currency:e})}suffix(e){return this.with({suffix:e})}decimals(e){return this.with({decimals:e})}valueLabels(e){return this.with({valueLabels:{...this.props.valueLabels,...e}})}valueColors(e){let t=Object.entries(e),n=t.find(([,e])=>!x(e)&&!lt.test(e));if(n)throw Error(`Field "${this.name}": value colour "${n[1]}" of "${n[0]}" is not a tone (${ne.join(`, `)}) or a hex colour such as #00a651`);return this.with({valueColors:{...this.props.valueColors,...Object.fromEntries(t)}})}waitingValues(e){return this.with({waitingValues:[...e]})}badgeShape(e){return this.with({badgeShape:e})}icon(e){return this.with({icon:e})}widget(e,t){return this.with({widget:{name:e,...t&&{props:t}}})}with(t){return new e(this.name,{...this.props,...t})}},ft={range:(e,t={})=>({kind:`range`,field:e.name,histogram:t.histogram??!1,...t.secondary&&{secondary:!0}}),facets:(e,t={})=>({kind:`facets`,field:e.name,search:t.search??!1,...t.secondary&&{secondary:!0}}),dateRange:(e,t={})=>({kind:`dateRange`,field:e.name,presets:t.presets??[],...t.secondary&&{secondary:!0}}),toggle:(e,t={})=>({kind:`toggle`,field:e.name,...t.secondary&&{secondary:!0}}),flags:(e,t)=>({kind:`flags`,fields:e.map(e=>e.name),label:t.label,...t.secondary&&{secondary:!0}})},pt=new Set([`resource`,`names`,`nav`,`help`,`list`,`filters`,`chart`]),mt=(e,t)=>{let n=(e,n,r)=>n===void 0||t.fields[n]?.type===r?[]:[`${e} "${n}" is not a ${r} field of the resource`];return[...n(`filter`,e.filter,`text`),...n(`name`,e.name,`text`),...n(`unseen.seenAt`,e.unseen?.seenAt,`timestamp`),...(e.controls??[]).flatMap(e=>[`enum`,`boolean`].includes(t.fields[e]?.type??``)?[]:[`control "${e}" is not an enum or boolean field of the resource`]),...e.limit===void 0||Number.isInteger(e.limit)&&e.limit>0?[]:[`limit must be a positive whole number`]]},ht=class e{state;constructor(e){this.state=e}names(e){return this.next({names:e})}icon(e){return this.next({icon:e})}forRoles(e){return this.next({roles:e})}title(e){return this.next({title:e(this.refs()).name})}titleFrom(e,t){let n=t(this.refs()).map(e=>e.name);if(e===``)throw Error(`View "${this.state.resource}": titleFrom needs the name of a rule`);if(n.length===0)throw Error(`View "${this.state.resource}": titleFrom "${e}" reads no fields`);return this.next({titleFrom:{rule:e,fields:n}})}searchResult(e){let{title:t,subtitle:n}=e(this.refs()),r=t===void 0?[]:Array.isArray(t)?t:[t];return this.next({searchResult:{...r.length>0&&{title:r.map(e=>e.name)},...n&&{subtitle:n.name}}})}nav(e){return this.next({nav:e})}help(e){return this.next({help:e})}fields(e){let t=e(y(e=>new dt(e))),n=Object.fromEntries(Object.values(t).map(e=>[e.name,e.props]));return this.next({fields:{...this.state.fields,...n}})}list(e){let{columns:t,sort:n,search:r,filter:i,editable:a,displays:s=[],default:c,drag:l}=e(this.refs(),o,ct),u=t.filter(st).map(({kind:e,...t})=>t),d=t.map(e=>e.name),f=d.find((e,t)=>d.indexOf(e)!==t);if(f!==void 0)throw Error(`View "${this.state.resource}": the list has two columns named "${f}"`);let p=a?.find(e=>!d.includes(e.name));if(p)throw Error(`View "${this.state.resource}": editable field "${p.name}" is not among the list's columns`);let m={columns:d,...u.length>0&&{relatedColumns:u},...n&&{sort:n.map(([e,t])=>[e.name,t])},...r&&{search:r.map(e=>e.name)},...i!==void 0&&i!==``&&{filter:i},...a&&a.length>0&&{editable:a.map(e=>e.name)},...s.length>0&&{displays:s},...c!==void 0&&{default:c},...l&&{drag:{...l}}},h=ce(m);if(h.length>0)throw Error(`View "${this.state.resource}": ${h.join(`; `)}`);return this.next({list:m})}filters(e){return this.next({filters:e(this.refs(),ft)})}namedList(e,t){let n=`View "${this.state.resource}": named list "${e}"`;if(!g.test(e))throw Error(`${n}: its name goes in its address, so it takes lowercase letters, digits, - and _`);if(this.state.lists?.some(t=>t.name===e))throw Error(`${n} is declared twice`);let r=G(this.state.resource),{state:i}=t(r),a=Object.keys(i).filter(e=>!pt.has(e)&&i[e]!==r.state[e]);if(a.length>0)throw Error(`${n} sets ${a.join(`, `)}; a named list takes names, nav, help, list, filters and chart`);if(!i.names)throw Error(`${n} needs .names(...), its sidebar entry`);if(i.nav?.recent)throw Error(`${n}: recent records are the view's own, not a named list's`);let o={name:e,names:i.names,filters:i.filters,...i.nav&&{nav:i.nav},...i.help!==void 0&&{help:i.help},...i.list&&{list:i.list},...i.chart&&{chart:i.chart}};return this.next({lists:[...this.state.lists??[],o]})}layout(e){return this.next({layout:e(this.refs())})}chart(e){return this.next({chart:T(e(this.refs()))})}form(e){return this.next({forms:[...this.state.forms??[],ot(e(this.refs()))]})}recordMode(e){return this.next({recordMode:e})}helpWhen(e){return this.next({helpWhen:e})}saveFeedback(e){return this.next({saveFeedback:e})}recordWidth(e){return this.next({recordWidth:e})}titleBadge(e){return this.next({titleBadge:e(this.refs()).name})}import(e){return this.next({import:e})}actions(e){return this.next({actions:e(at)})}listOf(e){return this.next({listOf:e(this.refs()).name})}signIn(e){if(e.signUp&&!nt(e.signUp.href))throw Error(`View "${this.state.resource}": signIn signUp.href must start with https://, http:// or mailto:`);return this.next({signIn:structuredClone(e)})}saveSearch(e){return this.next({saveSearch:{...e}})}export(e){if(e&&e.maxRows!==void 0&&!(Number.isInteger(e.maxRows)&&e.maxRows>0))throw Error(`View "${this.state.resource}": export maxRows must be a positive whole number`);return this.next({export:e&&{...e}})}create(e){return this.next({create:{...e}})}record(e){let t=typeof e==`function`?{surface:e(this.refs()).surface.name}:{component:u(e.component,`record component`),...e.focus&&{focus:!0}};return this.next({record:t})}recordOpens(e){let t=Array.isArray(e)?[...e]:[e];if(t.length===0)throw Error(`View "${this.state.resource}": recordOpens needs at least one address`);return this.next({recordOpens:structuredClone(t)})}createOpens(e){return this.next({createOpens:structuredClone(e)})}searchesOf(e){let{resource:t,filter:n,name:r,controls:i,unseen:a,limit:o}=e(this.refs()),s={resource:t,filter:n.name,...r&&{name:r.name},...i&&{controls:i.map(e=>e.name)},...a&&{unseen:{seenAt:a.seenAt.name,field:a.field}},...o!==void 0&&{limit:o}};return this.next({searchesOf:s})}toModel(t){let{title:n,titleFrom:r,titleBadge:i,nav:o,searchResult:s,list:c,listOf:l}=this.state;if(t&&n!==void 0&&!Object.hasOwn(t.fields,n))throw Error(`View "${this.state.resource}": title field "${n}" does not exist on the resource`);if(t&&i!==void 0&&!Object.hasOwn(t.fields,i))throw Error(`View "${this.state.resource}": title badge field "${i}" does not exist on the resource`);if(t&&i!==void 0&&t.fields[i].type!==`enum`&&this.state.fields[i]?.format!==`badge`)throw Error(`View "${this.state.resource}": title badge field "${i}" is no enum and has no .format('badge'), so it would not fit a badge`);let u=t?r?.fields.find(e=>!Object.hasOwn(t.fields,e)):void 0;if(u!==void 0)throw Error(`View "${this.state.resource}": titleFrom field "${u}" does not exist on the resource`);let f=t?[...s?.title??[],...s?.subtitle?[s.subtitle]:[]].filter(e=>!Object.hasOwn(t.fields,e)):[];if(f.length>0)throw Error(`View "${this.state.resource}": search result field "${f[0]}" does not exist on the resource`);for(let e of t?c?.displays??[]:[]){let n=d(e).find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" names field "${n}", which the resource does not have`);if(e.kind===`cards`&&e.image!==void 0&&t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${e.image}" as its image, which is not a file field`);let r=e.kind===`cards`?e.flags?.find(e=>t.fields[e].type!==`boolean`):void 0;if(r!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${r}" as a flag, which is not a boolean field`);let i=e.kind===`board`?le(e,t):[];if(i.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${i.join(`; `)}`);let o=e.kind===`calendar`||e.kind===`timeline`?a(e,t):[];if(o.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${o.join(`; `)}`)}let p=t?c?.relatedColumns?.find(e=>Object.hasOwn(t.fields,e.name)):void 0;if(p)throw Error(`View "${this.state.resource}": related column "${p.name}" has the name of a field of the resource`);let m=new Set,h=this.state.layout.flatMap((e,t)=>e.kind===`tab`?[{item:e,index:t}]:[]),g=h.find((e,t)=>t>0&&e.index!==h[t-1].index+1);if(g)throw Error(`View "${this.state.resource}": tabs stand together, and "${g.item.title}" is apart from the others`);let _=new Set;for(let{item:e}of h){if(_.has(e.title))throw Error(`View "${this.state.resource}": two tabs are titled "${e.title}"`);_.add(e.title)}for(let e of this.state.layout.flatMap(e=>e.kind===`tab`?e.items:[e]))if(e.kind===`group`){if(m.has(e.title))throw Error(`View "${this.state.resource}": two groups are titled "${e.title}"`);m.add(e.title)}for(let e of t?ue(this.state.layout):[])if(e.kind===`gallery`&&e.image!==void 0){if(!Object.hasOwn(t.fields,e.image))throw Error(`View "${this.state.resource}": gallery "${e.title}" names field "${e.image}", which the resource does not have`);if(t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": gallery "${e.title}" shows "${e.image}" as its image, which is not a file field`)}if(t&&l!==void 0&&(!Object.hasOwn(t.fields,l)||t.fields[l].type!==`relation`))throw Error(`View "${this.state.resource}": listOf names "${l}", which is not a relation field of the resource`);let v=t&&this.state.searchesOf?mt(this.state.searchesOf,t):[];if(v.length>0)throw Error(`View "${this.state.resource}": searchesOf ${v.join(`; `)}`);for(let e of t?this.state.forms??[]:[]){let n=e.fields.find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": form "${e.name}" names field "${n}", which the resource does not have`)}if(o?.tenant===`current`&&!c)throw Error(`View "${this.state.resource}": nav.tenant narrows the opening filter of the list, so the view needs .list(...)`);let y=t?.tenant===void 0?void 0:t.fields[t.tenant];if(t&&o?.tenant===`current`&&!y?.filterable)throw Error(`View "${this.state.resource}": nav.tenant opens the list on the current tenant, so the resource needs .tenant() on a .filterable() field`);if(typeof o?.create==`object`&&o.create.label.trim()===``)throw Error(`View "${this.state.resource}": nav.create needs a label, or true for "New <singular>"`);let b=t&&o?.recent?ee(o.recent,t):[];if(b.length>0)throw Error(`View "${this.state.resource}": nav.recent ${b.join(`; `)}`);let x=t&&o?.start?rt(o.start,t):[];if(x.length>0)throw Error(`View "${this.state.resource}": nav.start ${x.join(`; `)}`);let S=t?(this.state.recordOpens??[]).flatMap(te).find(e=>!Object.hasOwn(t.fields,e)):void 0;if(S!==void 0)throw Error(`View "${this.state.resource}": recordOpens names field "${S}", which the resource does not have`);if(this.state.lists?.length&&(l!==void 0||this.state.searchesOf))throw Error(`View "${this.state.resource}": named lists cannot go with listOf or searchesOf, which replace the list page`);for(let n of this.state.lists??[])new e(ae(this.state,n.name)).toModel(t);return structuredClone(this.state)}refs(){return y(r)}next(t){return new e({...this.state,...t})}},G=e=>new ht({resource:e,fields:{},filters:[],layout:[],actions:[]}),K=[`failing`,`unresolved`,`healthy`,`no_runs`,`resolved`,`new_version`],gt={failing:`danger`,unresolved:`warning`,healthy:`success`},_t=[`failing`,`unresolved`],q={read:e=>e.holds?.(`workflow_runs.read`)??!1};H.enum(K).readOnly().dbDefault().access(q),H.relation(`workflow_runs`).optional().readOnly().access(q),H.timestamp().optional().readOnly().access(q),H.integer().readOnly().dbDefault().access(q),H.timestamp().optional().readOnly(),H.text().optional().readOnly(),G(`workflow_resolutions`).names({singular:`Workflow resolution`,plural:`Workflow resolutions`}).icon(`check`).nav({hidden:!0}).title(e=>e.resolved_at).fields(e=>({workflow_id:e.workflow_id.label(`Workflow`),resolved_by:e.resolved_by.label(`Resolved by`),resolved_at:e.resolved_at.label(`Resolved`)})).list(e=>({columns:[e.workflow_id,e.resolved_by,e.resolved_at],sort:[[e.resolved_at,`desc`]]}));var J=f(`app/field-types/workflow-status`),Y=e(n(),1),vt=({id:e})=>(0,Y.jsx)(Y.Fragment,{children:de().member(e)?.name??e}),yt=({by:e,at:t})=>{let n=_(),r=n?.state.kind===`signed-in`&&e!==null&&String(n.state.user.id)===e?J(`you`):e===null?`?`:n?.organizations?(0,Y.jsx)(vt,{id:e}):e;return(0,Y.jsx)(`p`,{className:`text-body text-muted-foreground`,children:J.rich(`resolvedBy`,{who:r,when:p(Date.parse(t))})})},X=e=>K.includes(e),Z=e=>gt[e]??`neutral`,bt=e=>{if(X(e))return{tone:Z(e),words:J(`label`,{status:e})}},Q=e=>p(Date.parse(String(e))),xt=e=>{let t=e.run_status;if(!X(t))return;let n={status:t,tone:Z(t),resolvable:_t.includes(t)},r=e.status_run_id==null?void 0:String(e.status_run_id);return t===`failing`||t===`healthy`?{...n,words:J(t,{when:Q(e.status_run_at),runs:10}),...r&&{run:r}}:t===`unresolved`?{...n,words:J(t,{count:Number(e.unresolved_failures),runs:10,when:Q(e.status_run_at)}),...r&&{run:r}}:{...n,words:J(t)}},St=e(t(),1),$=`workflow_resolutions`,Ct=(e,t)=>{let n=b(),r=oe(),i=c(),a=se(re(`workflow_resolutions`),`create`)&&t,[o,s]=(0,St.useState)(!1);return{permitted:a,busy:o,resolve:async()=>{s(!0),await n.create($,{workflow_id:e}).then(async()=>{await Promise.all([r(`workflows`),r($)]),i.show({state:`success`,title:J(`resolveDone`)})},()=>i.show({state:`error`,title:J(`resolveFailed`)})),s(!1)}}},wt=({workflow:e,value:t})=>{let n=l(O,e).data,r=n?.record,i=Ct(e,n?.permissions?.update!==!1),a=r&&xt({...r,run_status:t});return!r||!a?null:(0,Y.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,Y.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-body`,"data-status":a.status,children:[(0,Y.jsx)(h,{tone:a.tone}),a.run?(0,Y.jsx)(s,{to:D({workflow:e,run:a.run}),className:`font-medium text-primary-text hover:underline`,children:a.words}):(0,Y.jsx)(`span`,{children:a.words})]}),a.resolvable&&i.permitted&&(0,Y.jsx)(ie,{size:`sm`,loading:i.busy,onClick:()=>void i.resolve(),children:J(`resolve`)})]}),r.resolved_at!=null&&(0,Y.jsx)(yt,{by:r.resolved_by==null?null:String(r.resolved_by),at:String(r.resolved_at)})]})},Tt=({value:e})=>{let t=E();return e===null||!t?null:(0,Y.jsx)(wt,{workflow:t.workflow,value:e})},Et=({value:e})=>{let t=bt(e);return t?(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Y.jsx)(h,{tone:t.tone}),t.words]}):null},Dt={of:[...S.workflow_status],display:Tt,cell:Et};export{Dt as workflowStatusField};
|
|
2
|
-
//# debugId=
|
|
1
|
+
(function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Al as r,Bl as i,Cl as a,El as o,Lr as s,Pa as c,Ra as l,Sl as u,Tl as d,Xc as f,Yi as p,_l as m,_o as h,bl as g,bs as _,gl as ee,hl as v,jl as te,kl as y,ls as b,ml as x,nl as S,pl as ne,rs as re,sc as ie,vl as ae,vn as oe,wa as se,wl as ce,xl as le,yl as ue,zi as de,zl as fe}from"./app-D3BCcbgE.js";import{i as pe,r as me,t as he}from"./update-set-BYNQUWVp.js";import{a as C,c as w,d as ge,i as _e,l as ve,n as ye,o as be,r as xe,s as Se,t as Ce,u as we}from"./lib-zod-B92j-KH2.js";import{t as T}from"./view-chart-ChBtewKd.js";import{n as E,o as D,s as O}from"./use-workflow-page-DsD276W-.js";var k=/^-?\d+$/,Te=-(2n**63n),Ee=2n**63n-1n,De={type:`bigint`,constraints:[],build:()=>w().refine(e=>k.test(e)&&BigInt(e)>=Te&&BigInt(e)<=Ee,{message:`Expected a 64-bit integer as a string`})},Oe={type:`boolean`,constraints:[],build:()=>_e()},ke={type:`country`,constraints:[],build:()=>w().regex(/^[A-Z]{2}$/,`Expected an ISO 3166-1 alpha-2 country code`)},Ae={type:`currency`,constraints:[],build:()=>w().regex(/^[A-Z]{3}$/,`Expected an ISO 4217 currency code`)},je={type:`date`,constraints:[],build:()=>Ce()},Me=/^-?(\d*)(?:\.(\d+))?$/,Ne={type:`decimal`,constraints:[],build:e=>{if(e.precision===void 0||e.scale===void 0)throw Error(`f.decimal requires precision and scale`);let t=e.precision-e.scale,n=e.scale;return w().refine(e=>{let r=Me.exec(e);if(!r)return!1;let i=(r[1]??``).replace(/^0+/,``),a=r[2]??``;return r[1]||a?i.length<=t&&a.length<=n:!1},{message:`Expected a decimal string with at most ${e.precision} digits, ${e.scale} after the point`,params:{precision:e.precision,scale:e.scale}})}},Pe={type:`enum`,constraints:[],build:e=>{if(!e.enumValues?.length)throw Error(`f.enum requires at least one value`);return xe(e.enumValues)}},A={type:`file`,constraints:[],build:()=>w().min(1).max(4096)},Fe={type:`integer`,constraints:[`min`,`max`],build:e=>{let t=C();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),t}},Ie=(e,t=256)=>{let n=[[e,0]];for(;n.length>0;){let[e,r]=n.pop();if(typeof e==`object`&&e){if(r+1>t)return!1;for(let t of Object.values(e))n.push([t,r+1])}}return!0},Le={type:`json`,constraints:[],build:()=>Se((e,t)=>(Ie(e)||t.addIssue({code:`custom`,message:`Nested deeper than 256 levels`,params:{max_depth:256}}),e),be())},j={type:`relation`,constraints:[],build:()=>ve([w(),C()])},Re={type:`text`,constraints:[`min`,`max`,`regex`],build:e=>{let t=w();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),e.regex&&(t=t.regex(e.regex.re,e.regex.message)),t}},ze={type:`timestamp`,constraints:[],build:()=>ye({offset:!0})},Be={type:`uuid`,constraints:[],build:()=>we()},Ve=e=>fe(e),M=e=>Ve(e).length===0?`its prompt must name at least one {{field}} of the record`:void 0,N=/\s*(?:(\d+(?:\.\d+)?)|([A-Za-z_][A-Za-z0-9_]*)|([-+*/(),]))/y,He=e=>{let t=[];for(N.lastIndex=0;N.lastIndex<e.length;){let n=N.lastIndex,r=N.exec(e);if(!r){let t=e.slice(n);if(t.trim()===``)break;let r=t.length-t.trimStart().length;throw Error(`Formula "${e}": unexpected "${t[r]}" at ${n+r+1}`)}let[i,a,o,s]=r,c=a??o??s;t.push({kind:a===void 0?o===void 0?`symbol`:`name`:`number`,text:c,at:n+i.length-c.length})}return t},Ue=e=>{let t=He(e),n=0,r=r=>{let i=t[n];throw Error(`Formula "${e}": ${r}${i?` at ${i.at+1}, found "${i.text}"`:` at the end`}`)},i=e=>t[n]?.kind===`symbol`&&t[n].text===e,a=e=>{i(e)||r(`expected "${e}"`),n+=1},o=()=>{a(`(`);let e=[u()];for(;i(`,`);)n+=1,e.push(u());return a(`)`),e},s=e=>{if(e===`coalesce`){let e=o();return e.length<2&&r(`coalesce() takes at least two values`),{kind:`coalesce`,args:e}}let t=o(),[n,i]=t;return t.length>2&&r(`round() takes a value and at most a number of digits`),i===void 0?{kind:`round`,value:n}:((i.kind!==`number`||i.value.includes(`.`))&&r(`round()'s digits must be a whole number`),{kind:`round`,value:n,digits:Number(i.value)})},c=()=>{let e=t[n];if(!e)return r(`expected a number, a field or "("`);if(e.kind===`number`)return n+=1,{kind:`number`,value:e.text};if(e.kind===`name`)return n+=1,i(`(`)?e.text!==`coalesce`&&e.text!==`round`?(--n,r(`unknown function "${e.text}", only coalesce() and round()`)):s(e.text):{kind:`field`,name:e.text};if(e.text===`-`)return n+=1,{kind:`negate`,operand:c()};if(e.text===`(`){n+=1;let e=u();return a(`)`),e}return r(`expected a number, a field or "("`)},l=()=>{let e=c();for(;i(`*`)||i(`/`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:c()}}return e},u=()=>{let e=l();for(;i(`+`)||i(`-`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:l()}}return e},d=u();return n<t.length&&r(`expected an operator`),d},We=ge(),P=class e{def;meta;schema;constructor(e,t){this.def=e,this.meta=t;let n=e.build(t);t.nullable&&(n=n.nullable()),t.hasDefault&&(n=n.default(t.defaultValue)),this.schema=n.register(We,t)}column(e){return this.with({column:e})}readOnly(){return this.with({readOnly:!0})}optional(){return this.with({nullable:!0})}default(e){return this.with({hasDefault:!0,defaultValue:e})}access(e){return this.with({access:{...this.meta.access,...e}})}sensitive(){return this.with({sensitive:!0})}encrypted(){if(this.meta.type!==`text`)throw Error(`.encrypted() takes only f.text() fields`);return this.with({encrypted:!0,sensitive:!0})}strongSignIn(e={}){let t=e.minutes??15;if(!Number.isInteger(t)||t<1)throw Error(`.strongSignIn(): minutes must be a whole number of at least 1`);return this.with({strongSignIn:{minutes:t},sensitive:!0})}dbDefault(){return this.with({dbDefault:!0})}alias(...e){return this.with({aliases:[...this.meta.aliases,...e]})}filterable(){return this.with({filterable:!0})}sortable(){return this.with({sortable:!0})}regex(e,t){return this.constrain(`regex`,{regex:{re:e,message:t}})}min(e){return this.constrain(`min`,{min:e})}max(e){return this.constrain(`max`,{max:e})}ai(e){let t=M(e.prompt);if(t)throw Error(`.ai(): ${t}`);return this.with({ai:{prompt:e.prompt}})}rollup(e){return this.with({rollup:{...e},readOnly:!0})}formula(e){return Ue(e),this.with({formula:e,readOnly:!0})}lookup(e){return this.with({lookup:{...e},readOnly:!0,nullable:!0})}with(t){return new e(this.def,{...this.meta,...t})}constrain(e,t){if(!this.def.constraints.includes(e))throw Error(`f.${this.def.type} does not support .${e}()`);return this.with(t)}},Ge=class extends P{columns(e){return this.with({relation:{resource:this.meta.relation.resource,columns:e}})}},F=[`webp`,`avif`,`jpeg`,`png`],Ke=5e7,qe={b:1,kb:1e3,mb:1e6,gb:1e9,kib:1024,mib:1024**2,gib:1024**3},I=e=>{if(typeof e==`number`){if(!Number.isSafeInteger(e)||e<=0)throw Error(`A file size must be a positive whole number of bytes, not ${e}`);return e}let t=/^\s*(\d+(?:\.\d+)?)\s*([a-z]+)?\s*$/i.exec(e),n=qe[(t?.[2]??`b`).toLowerCase()];if(!t||!n)throw Error(`"${e}" is not a size; write it like "10 MB" or "512 KiB"`);return I(Math.round(Number(t[1])*n))},Je=/^(?:\*\/\*|[a-z0-9][a-z0-9!#$&^_.+-]*\/(?:\*|[a-z0-9][a-z0-9!#$&^_.+-]*))$/,L=e=>e.map(e=>{let t=e.trim().toLowerCase();if(!Je.test(t))throw Error(`"${e}" is not a media type or a type/* wildcard`);return t}),Ye=/^[a-z][a-z0-9-]{0,31}$/,Xe=new Set([`http`,`https`,`data`,`blob`,`file`,`javascript`,`mailto`]),Ze=e=>{if(!Ye.test(e))throw Error(`"${e}" is not a file provider name: lowercase letters, digits and dashes, starting with a letter`);if(Xe.has(e))throw Error(`"${e}" cannot name a file provider: stored values would read as ${e}: links`);return e},Qe=/^[a-z][a-z0-9_]{0,31}$/,$e=[`inside`,`cover`],R=(e,t)=>{if(t!==void 0&&(!Number.isSafeInteger(t)||t<1||t>16384))throw Error(`${e} must be a whole number of pixels from 1 to 16384, not ${t}`)},z=(e,t)=>{if(!F.includes(t.format))throw Error(`${e}: "${t.format}" is not an image format; use ${F.join(`, `)}`);if(t.fit!==void 0&&!$e.includes(t.fit))throw Error(`${e}: fit is "inside" or "cover", not "${t.fit}"`);if(t.fit===`cover`&&(t.width===void 0||t.height===void 0))throw Error(`${e}: fit "cover" needs both a width and a height`);if(R(`${e}: width`,t.width),R(`${e}: height`,t.height),t.quality!==void 0&&(!Number.isSafeInteger(t.quality)||t.quality<1||t.quality>100))throw Error(`${e}: quality must be a whole number from 1 to 100, not ${t.quality}`);return{...t}},et=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>{if(!Qe.test(e))throw Error(`"${e}" cannot name an image variant: lowercase letters, digits and underscores, starting with a letter`);return[e,z(`Image variant "${e}"`,t)]})),tt=class e extends P{accept(e){return this.withFile({accept:L(e)})}maxSize(e){return this.withFile({maxSize:I(e)})}public(){return this.storage(`public`)}storage(e){return this.withFile({provider:Ze(e)})}derive(e){return this.withFile({derive:{...this.meta.file.derive,...e}})}placeholder(e){return this.withFile({placeholder:e})}typeField(e){return this.withFile({typeField:e})}sizeField(e){return this.withFile({sizeField:e})}variants(e,t={}){return this.withFile({variants:{...this.meta.file.variants,...et(e)},...t.original&&{original:z(`The original`,t.original)}})}externalUrls(){return this.withFile({external:!0})}optional(){return this.with({nullable:!0})}readOnly(){return this.with({readOnly:!0})}column(e){return this.with({column:e})}access(e){return this.with({access:{...this.meta.access,...e}})}with(t){return new e(this.def,{...this.meta,...t})}withFile(e){return this.with({file:{...this.meta.file,...e}})}},B=e=>({type:e.type,nullable:!1,readOnly:!1,filterable:!1,sortable:!1,aliases:[],hasDefault:!1}),V=(e,t={})=>new P(e,{...B(e),...t}),H={text:()=>V(Re),integer:()=>V(Fe),bigint:()=>V(De),decimal:e=>V(Ne,e),boolean:()=>V(Oe),date:()=>V(je),timestamp:()=>V(ze),uuid:()=>V(Be),enum:e=>V(Pe,{enumValues:[...e]}),json:()=>V(Le),relation:e=>new Ge(j,{...B(j),relation:{resource:e}}),file:()=>new tt(A,{...B(A),file:{accept:[],maxSize:Ke,provider:`private`}}),currency:()=>V(Ae),country:()=>V(ke)},nt=e=>/^(https?:\/\/|mailto:)/i.test(e),rt=(e,t)=>[...typeof e.filter==`string`&&e.filter.trim()!==``?v(t,e.filter).map(e=>`filter: ${e.message}`):[`needs a filter that finds the record`],...e.orderBy===void 0?[]:m(t,e.orderBy).map(e=>`orderBy: ${e.message}`)],it=e=>e.when===void 0?e.otherwise!==void 0||e.reason!==void 0?`"otherwise" and "reason" need a "when" condition`:void 0:e.when.trim()===``?`"when" is empty`:e.otherwise===`disable`?e.reason?void 0:`a button disabled by "when" needs a "reason"`:e.reason===void 0?void 0:`"reason" shows only with otherwise: 'disable'`,U=(e,t)=>{let n=it(t);if(n)throw Error(`Action "${e}": ${n}`);return{name:e,label:t.label,bulk:t.bulk??!1,...t.icon!==void 0&&{icon:t.icon},...t.confirm!==void 0&&{confirm:t.confirm},...t.when!==void 0&&{when:t.when},...t.otherwise===`disable`&&{otherwise:t.otherwise,reason:t.reason},...t.variant!==void 0&&{variant:t.variant}}},W=(e,t)=>{if(!t)return{};let n=t(pe),r=me(n);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{inputs:n}},at={action:(e,t)=>({...U(e,t),...W(e,t.inputs),...t.mailbox&&{mailbox:!0}}),update:(e,t)=>{let n=W(e,t.inputs),r=he(t.set,n.inputs);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{...U(e,t),...n,run:{kind:`update`,values:t.set}}},remove:(e,t)=>({...U(e,t),run:{kind:`delete`}}),link:(e,t)=>{let n=i(t.label,t);if(n)throw Error(`Action "${e}": ${n}`);return`to`in t?{...U(e,t),run:{kind:`link`,to:structuredClone(t.to)}}:{...U(e,t),run:{kind:`link`,href:t.href}}},ai:(e,t)=>{let n=M(t.prompt)??(t.writes===``?`it writes no field`:void 0);if(n)throw Error(`Action "${e}": ${n}`);return{...U(e,t),run:{kind:`ai`,prompt:t.prompt,writes:t.writes}}}},ot=e=>{let{name:t,title:n,fields:r,thanks:i}=e;if(!g.test(t))throw Error(`A form's name goes in its address, so it takes lowercase letters, digits, - and _, not "${t}"`);if(r.length===0)throw Error(`Form "${t}" has no fields`);let a=r.map(e=>e.name),o=a.find((e,t)=>a.indexOf(e)!==t);if(o!==void 0)throw Error(`Form "${t}" lists the field "${o}" twice`);if(i.trim()===``)throw Error(`Form "${t}" needs a thanks text, shown once a visitor sends it`);if(n!==void 0&&n.trim()===``)throw Error(`Form "${t}" has an empty title; leave it out for the view's name`);let s=e.perMinute??5;if(!Number.isInteger(s)||s<1)throw Error(`Form "${t}" takes perMinute as a positive whole number, not ${s}`);return{name:t,...n!==void 0&&{title:n},fields:a,thanks:i,perMinute:s}},st=e=>typeof e==`object`&&!!e&&e.kind===`related`,ct={related:(e,t)=>({kind:`related`,name:e,...structuredClone(t)})},lt=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,ut=/^[A-Z]{3}$/,dt=class e{name;props;constructor(e,t={}){this.name=e,this.props=t}label(e){return this.with({label:e})}help(e,t={}){return this.with({help:e,...t.when!==void 0&&{helpWhen:t.when}})}when(e){return this.with({when:e})}notOnCreate(){return this.with({notOnCreate:!0})}confirm(e){if(e.trim()===``)throw Error(`Field "${this.name}": .confirm() needs the question to ask`);return this.with({confirm:e})}format(t,n={}){if(n.text===void 0&&t===`url`)return this.with({format:t});if(n.text===void 0){let{linkText:n,...r}=this.props;return new e(this.name,{...r,format:t})}if(t!==`url`)throw Error(`Field "${this.name}": only format('url') takes a link text`);if(n.text.trim()===``)throw Error(`Field "${this.name}": format('url') needs a link text that is not empty`);return this.with({format:t,linkText:n.text})}multiline(){return this.with({multiline:!0})}markdown(){return this.with({markdown:!0})}prefix(e){return this.with({prefix:e})}currency(e){if(!ut.test(e))throw Error(`Field "${this.name}": currency "${e}" is not an ISO 4217 code such as EUR`);return this.with({currency:e})}suffix(e){return this.with({suffix:e})}decimals(e){return this.with({decimals:e})}valueLabels(e){return this.with({valueLabels:{...this.props.valueLabels,...e}})}valueColors(e){let t=Object.entries(e),n=t.find(([,e])=>!x(e)&&!lt.test(e));if(n)throw Error(`Field "${this.name}": value colour "${n[1]}" of "${n[0]}" is not a tone (${ne.join(`, `)}) or a hex colour such as #00a651`);return this.with({valueColors:{...this.props.valueColors,...Object.fromEntries(t)}})}waitingValues(e){return this.with({waitingValues:[...e]})}badgeShape(e){return this.with({badgeShape:e})}icon(e){return this.with({icon:e})}widget(e,t){return this.with({widget:{name:e,...t&&{props:t}}})}with(t){return new e(this.name,{...this.props,...t})}},ft={range:(e,t={})=>({kind:`range`,field:e.name,histogram:t.histogram??!1,...t.secondary&&{secondary:!0}}),facets:(e,t={})=>({kind:`facets`,field:e.name,search:t.search??!1,...t.secondary&&{secondary:!0}}),dateRange:(e,t={})=>({kind:`dateRange`,field:e.name,presets:t.presets??[],...t.secondary&&{secondary:!0}}),toggle:(e,t={})=>({kind:`toggle`,field:e.name,...t.secondary&&{secondary:!0}}),flags:(e,t)=>({kind:`flags`,fields:e.map(e=>e.name),label:t.label,...t.secondary&&{secondary:!0}})},pt=new Set([`resource`,`names`,`nav`,`help`,`list`,`filters`,`chart`]),mt=(e,t)=>{let n=(e,n,r)=>n===void 0||t.fields[n]?.type===r?[]:[`${e} "${n}" is not a ${r} field of the resource`];return[...n(`filter`,e.filter,`text`),...n(`name`,e.name,`text`),...n(`unseen.seenAt`,e.unseen?.seenAt,`timestamp`),...(e.controls??[]).flatMap(e=>[`enum`,`boolean`].includes(t.fields[e]?.type??``)?[]:[`control "${e}" is not an enum or boolean field of the resource`]),...e.limit===void 0||Number.isInteger(e.limit)&&e.limit>0?[]:[`limit must be a positive whole number`]]},ht=class e{state;constructor(e){this.state=e}names(e){return this.next({names:e})}icon(e){return this.next({icon:e})}forRoles(e){return this.next({roles:e})}title(e){return this.next({title:e(this.refs()).name})}titleFrom(e,t){let n=t(this.refs()).map(e=>e.name);if(e===``)throw Error(`View "${this.state.resource}": titleFrom needs the name of a rule`);if(n.length===0)throw Error(`View "${this.state.resource}": titleFrom "${e}" reads no fields`);return this.next({titleFrom:{rule:e,fields:n}})}searchResult(e){let{title:t,subtitle:n}=e(this.refs()),r=t===void 0?[]:Array.isArray(t)?t:[t];return this.next({searchResult:{...r.length>0&&{title:r.map(e=>e.name)},...n&&{subtitle:n.name}}})}nav(e){return this.next({nav:e})}help(e){return this.next({help:e})}fields(e){let t=e(y(e=>new dt(e))),n=Object.fromEntries(Object.values(t).map(e=>[e.name,e.props]));return this.next({fields:{...this.state.fields,...n}})}list(e){let{columns:t,sort:n,search:r,filter:i,editable:a,displays:s=[],default:c,drag:l}=e(this.refs(),o,ct),u=t.filter(st).map(({kind:e,...t})=>t),d=t.map(e=>e.name),f=d.find((e,t)=>d.indexOf(e)!==t);if(f!==void 0)throw Error(`View "${this.state.resource}": the list has two columns named "${f}"`);let p=a?.find(e=>!d.includes(e.name));if(p)throw Error(`View "${this.state.resource}": editable field "${p.name}" is not among the list's columns`);let m={columns:d,...u.length>0&&{relatedColumns:u},...n&&{sort:n.map(([e,t])=>[e.name,t])},...r&&{search:r.map(e=>e.name)},...i!==void 0&&i!==``&&{filter:i},...a&&a.length>0&&{editable:a.map(e=>e.name)},...s.length>0&&{displays:s},...c!==void 0&&{default:c},...l&&{drag:{...l}}},h=ce(m);if(h.length>0)throw Error(`View "${this.state.resource}": ${h.join(`; `)}`);return this.next({list:m})}filters(e){return this.next({filters:e(this.refs(),ft)})}namedList(e,t){let n=`View "${this.state.resource}": named list "${e}"`;if(!g.test(e))throw Error(`${n}: its name goes in its address, so it takes lowercase letters, digits, - and _`);if(this.state.lists?.some(t=>t.name===e))throw Error(`${n} is declared twice`);let r=G(this.state.resource),{state:i}=t(r),a=Object.keys(i).filter(e=>!pt.has(e)&&i[e]!==r.state[e]);if(a.length>0)throw Error(`${n} sets ${a.join(`, `)}; a named list takes names, nav, help, list, filters and chart`);if(!i.names)throw Error(`${n} needs .names(...), its sidebar entry`);if(i.nav?.recent)throw Error(`${n}: recent records are the view's own, not a named list's`);let o={name:e,names:i.names,filters:i.filters,...i.nav&&{nav:i.nav},...i.help!==void 0&&{help:i.help},...i.list&&{list:i.list},...i.chart&&{chart:i.chart}};return this.next({lists:[...this.state.lists??[],o]})}layout(e){return this.next({layout:e(this.refs())})}chart(e){return this.next({chart:T(e(this.refs()))})}form(e){return this.next({forms:[...this.state.forms??[],ot(e(this.refs()))]})}recordMode(e){return this.next({recordMode:e})}helpWhen(e){return this.next({helpWhen:e})}saveFeedback(e){return this.next({saveFeedback:e})}recordWidth(e){return this.next({recordWidth:e})}titleBadge(e){return this.next({titleBadge:e(this.refs()).name})}import(e){return this.next({import:e})}actions(e){return this.next({actions:e(at)})}listOf(e){return this.next({listOf:e(this.refs()).name})}signIn(e){if(e.signUp&&!nt(e.signUp.href))throw Error(`View "${this.state.resource}": signIn signUp.href must start with https://, http:// or mailto:`);return this.next({signIn:structuredClone(e)})}saveSearch(e){return this.next({saveSearch:{...e}})}export(e){if(e&&e.maxRows!==void 0&&!(Number.isInteger(e.maxRows)&&e.maxRows>0))throw Error(`View "${this.state.resource}": export maxRows must be a positive whole number`);return this.next({export:e&&{...e}})}create(e){return this.next({create:{...e}})}record(e){let t=typeof e==`function`?{surface:e(this.refs()).surface.name}:{component:u(e.component,`record component`),...e.focus&&{focus:!0}};return this.next({record:t})}recordOpens(e){let t=Array.isArray(e)?[...e]:[e];if(t.length===0)throw Error(`View "${this.state.resource}": recordOpens needs at least one address`);return this.next({recordOpens:structuredClone(t)})}createOpens(e){return this.next({createOpens:structuredClone(e)})}searchesOf(e){let{resource:t,filter:n,name:r,controls:i,unseen:a,limit:o}=e(this.refs()),s={resource:t,filter:n.name,...r&&{name:r.name},...i&&{controls:i.map(e=>e.name)},...a&&{unseen:{seenAt:a.seenAt.name,field:a.field}},...o!==void 0&&{limit:o}};return this.next({searchesOf:s})}toModel(t){let{title:n,titleFrom:r,titleBadge:i,nav:o,searchResult:s,list:c,listOf:l}=this.state;if(t&&n!==void 0&&!Object.hasOwn(t.fields,n))throw Error(`View "${this.state.resource}": title field "${n}" does not exist on the resource`);if(t&&i!==void 0&&!Object.hasOwn(t.fields,i))throw Error(`View "${this.state.resource}": title badge field "${i}" does not exist on the resource`);if(t&&i!==void 0&&t.fields[i].type!==`enum`&&this.state.fields[i]?.format!==`badge`)throw Error(`View "${this.state.resource}": title badge field "${i}" is no enum and has no .format('badge'), so it would not fit a badge`);let u=t?r?.fields.find(e=>!Object.hasOwn(t.fields,e)):void 0;if(u!==void 0)throw Error(`View "${this.state.resource}": titleFrom field "${u}" does not exist on the resource`);let f=t?[...s?.title??[],...s?.subtitle?[s.subtitle]:[]].filter(e=>!Object.hasOwn(t.fields,e)):[];if(f.length>0)throw Error(`View "${this.state.resource}": search result field "${f[0]}" does not exist on the resource`);for(let e of t?c?.displays??[]:[]){let n=d(e).find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" names field "${n}", which the resource does not have`);if(e.kind===`cards`&&e.image!==void 0&&t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${e.image}" as its image, which is not a file field`);let r=e.kind===`cards`?e.flags?.find(e=>t.fields[e].type!==`boolean`):void 0;if(r!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${r}" as a flag, which is not a boolean field`);let i=e.kind===`board`?le(e,t):[];if(i.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${i.join(`; `)}`);let o=e.kind===`calendar`||e.kind===`timeline`?a(e,t):[];if(o.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${o.join(`; `)}`)}let p=t?c?.relatedColumns?.find(e=>Object.hasOwn(t.fields,e.name)):void 0;if(p)throw Error(`View "${this.state.resource}": related column "${p.name}" has the name of a field of the resource`);let m=new Set,h=this.state.layout.flatMap((e,t)=>e.kind===`tab`?[{item:e,index:t}]:[]),g=h.find((e,t)=>t>0&&e.index!==h[t-1].index+1);if(g)throw Error(`View "${this.state.resource}": tabs stand together, and "${g.item.title}" is apart from the others`);let _=new Set;for(let{item:e}of h){if(_.has(e.title))throw Error(`View "${this.state.resource}": two tabs are titled "${e.title}"`);_.add(e.title)}for(let e of this.state.layout.flatMap(e=>e.kind===`tab`?e.items:[e]))if(e.kind===`group`){if(m.has(e.title))throw Error(`View "${this.state.resource}": two groups are titled "${e.title}"`);m.add(e.title)}for(let e of t?ue(this.state.layout):[])if(e.kind===`gallery`&&e.image!==void 0){if(!Object.hasOwn(t.fields,e.image))throw Error(`View "${this.state.resource}": gallery "${e.title}" names field "${e.image}", which the resource does not have`);if(t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": gallery "${e.title}" shows "${e.image}" as its image, which is not a file field`)}if(t&&l!==void 0&&(!Object.hasOwn(t.fields,l)||t.fields[l].type!==`relation`))throw Error(`View "${this.state.resource}": listOf names "${l}", which is not a relation field of the resource`);let v=t&&this.state.searchesOf?mt(this.state.searchesOf,t):[];if(v.length>0)throw Error(`View "${this.state.resource}": searchesOf ${v.join(`; `)}`);for(let e of t?this.state.forms??[]:[]){let n=e.fields.find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": form "${e.name}" names field "${n}", which the resource does not have`)}if(o?.tenant===`current`&&!c)throw Error(`View "${this.state.resource}": nav.tenant narrows the opening filter of the list, so the view needs .list(...)`);let y=t?.tenant===void 0?void 0:t.fields[t.tenant];if(t&&o?.tenant===`current`&&!y?.filterable)throw Error(`View "${this.state.resource}": nav.tenant opens the list on the current tenant, so the resource needs .tenant() on a .filterable() field`);if(typeof o?.create==`object`&&o.create.label.trim()===``)throw Error(`View "${this.state.resource}": nav.create needs a label, or true for "New <singular>"`);let b=t&&o?.recent?ee(o.recent,t):[];if(b.length>0)throw Error(`View "${this.state.resource}": nav.recent ${b.join(`; `)}`);let x=t&&o?.start?rt(o.start,t):[];if(x.length>0)throw Error(`View "${this.state.resource}": nav.start ${x.join(`; `)}`);let S=t?(this.state.recordOpens??[]).flatMap(te).find(e=>!Object.hasOwn(t.fields,e)):void 0;if(S!==void 0)throw Error(`View "${this.state.resource}": recordOpens names field "${S}", which the resource does not have`);if(this.state.lists?.length&&(l!==void 0||this.state.searchesOf))throw Error(`View "${this.state.resource}": named lists cannot go with listOf or searchesOf, which replace the list page`);for(let n of this.state.lists??[])new e(ae(this.state,n.name)).toModel(t);return structuredClone(this.state)}refs(){return y(r)}next(t){return new e({...this.state,...t})}},G=e=>new ht({resource:e,fields:{},filters:[],layout:[],actions:[]}),K=[`failing`,`unresolved`,`healthy`,`no_runs`,`resolved`,`new_version`],gt={failing:`danger`,unresolved:`warning`,healthy:`success`},_t=[`failing`,`unresolved`],q={read:e=>e.holds?.(`workflow_runs.read`)??!1};H.enum(K).readOnly().dbDefault().access(q),H.relation(`workflow_runs`).optional().readOnly().access(q),H.timestamp().optional().readOnly().access(q),H.integer().readOnly().dbDefault().access(q),H.timestamp().optional().readOnly(),H.text().optional().readOnly(),G(`workflow_resolutions`).names({singular:`Workflow resolution`,plural:`Workflow resolutions`}).icon(`check`).nav({hidden:!0}).title(e=>e.resolved_at).fields(e=>({workflow_id:e.workflow_id.label(`Workflow`),resolved_by:e.resolved_by.label(`Resolved by`),resolved_at:e.resolved_at.label(`Resolved`)})).list(e=>({columns:[e.workflow_id,e.resolved_by,e.resolved_at],sort:[[e.resolved_at,`desc`]]}));var J=f(`app/field-types/workflow-status`),Y=e(n(),1),vt=({id:e})=>(0,Y.jsx)(Y.Fragment,{children:de().member(e)?.name??e}),yt=({by:e,at:t})=>{let n=_(),r=n?.state.kind===`signed-in`&&e!==null&&String(n.state.user.id)===e?J(`you`):e===null?`?`:n?.organizations?(0,Y.jsx)(vt,{id:e}):e;return(0,Y.jsx)(`p`,{className:`text-body text-muted-foreground`,children:J.rich(`resolvedBy`,{who:r,when:p(Date.parse(t))})})},X=e=>K.includes(e),Z=e=>gt[e]??`neutral`,bt=e=>{if(X(e))return{tone:Z(e),words:J(`label`,{status:e})}},Q=e=>p(Date.parse(String(e))),xt=e=>{let t=e.run_status;if(!X(t))return;let n={status:t,tone:Z(t),resolvable:_t.includes(t)},r=e.status_run_id==null?void 0:String(e.status_run_id);return t===`failing`||t===`healthy`?{...n,words:J(t,{when:Q(e.status_run_at),runs:10}),...r&&{run:r}}:t===`unresolved`?{...n,words:J(t,{count:Number(e.unresolved_failures),runs:10,when:Q(e.status_run_at)}),...r&&{run:r}}:{...n,words:J(t)}},St=e(t(),1),$=`workflow_resolutions`,Ct=(e,t)=>{let n=b(),r=oe(),i=c(),a=se(re(`workflow_resolutions`),`create`)&&t,[o,s]=(0,St.useState)(!1);return{permitted:a,busy:o,resolve:async()=>{s(!0),await n.create($,{workflow_id:e}).then(async()=>{await Promise.all([r(`workflows`),r($)]),i.show({state:`success`,title:J(`resolveDone`)})},()=>i.show({state:`error`,title:J(`resolveFailed`)})),s(!1)}}},wt=({workflow:e,value:t})=>{let n=l(O,e).data,r=n?.record,i=Ct(e,n?.permissions?.update!==!1),a=r&&xt({...r,run_status:t});return!r||!a?null:(0,Y.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,Y.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-body`,"data-status":a.status,children:[(0,Y.jsx)(h,{tone:a.tone}),a.run?(0,Y.jsx)(s,{to:D({workflow:e,run:a.run}),className:`font-medium text-primary-text hover:underline`,children:a.words}):(0,Y.jsx)(`span`,{children:a.words})]}),a.resolvable&&i.permitted&&(0,Y.jsx)(ie,{size:`sm`,loading:i.busy,onClick:()=>void i.resolve(),children:J(`resolve`)})]}),r.resolved_at!=null&&(0,Y.jsx)(yt,{by:r.resolved_by==null?null:String(r.resolved_by),at:String(r.resolved_at)})]})},Tt=({value:e})=>{let t=E();return e===null||!t?null:(0,Y.jsx)(wt,{workflow:t.workflow,value:e})},Et=({value:e})=>{let t=bt(e);return t?(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Y.jsx)(h,{tone:t.tone}),t.words]}):null},Dt={of:[...S.workflow_status],display:Tt,cell:Et};export{Dt as workflowStatusField};
|
|
2
|
+
//# debugId=3fba680d-8cae-4d1b-a06c-f46362658e1e
|