@lobu/runtime-server 24.11.0 → 24.12.0
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/catalogs/connectors.json +1113 -107
- package/dist/catalogs/skills.json +2 -2
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +2 -2
- package/dist/connectors/chat-transport-actions.ts +50 -0
- package/dist/connectors/discord.ts +2 -0
- package/dist/connectors/gchat.ts +2 -0
- package/dist/connectors/github.ts +4 -4
- package/dist/connectors/google_drive.ts +20 -0
- package/dist/connectors/google_gmail.ts +49 -8
- package/dist/connectors/herdr.ts +1 -1
- package/dist/connectors/imessage.ts +1 -0
- package/dist/connectors/linkedin-browser-script.ts +11 -0
- package/dist/connectors/linkedin-draft-page.js +24 -8
- package/dist/connectors/linkedin-inbox-adapter.js +209 -19
- package/dist/connectors/linkedin-inbox.ts +152 -4
- package/dist/connectors/linkedin-network.ts +788 -0
- package/dist/connectors/linkedin-search.ts +1284 -0
- package/dist/connectors/linkedin.ts +892 -27
- package/dist/connectors/microsoft_outlook.ts +57 -19
- package/dist/connectors/rss.ts +179 -33
- package/dist/connectors/slack.ts +2 -0
- package/dist/connectors/source-file-attachment.ts +46 -0
- package/dist/connectors/teams.ts +2 -0
- package/dist/connectors/telegram.ts +2 -0
- package/dist/connectors/tiktok_web.ts +1 -1
- package/dist/connectors/whatsapp.ts +2 -0
- package/dist/connectors/whatsapp_web.ts +3 -3
- package/dist/connectors/x-dm-adapter.js +8 -10
- package/dist/connectors/x.ts +8 -9
- package/dist/db/migrations/20261115040000_account_two_factor.sql +20 -0
- package/dist/db/migrations/20261115120000_events_unbound_tool_audit_without_bridge.sql +40 -0
- package/dist/db/migrations/20261115120001_events_unbound_tool_audit_validate.sql +19 -0
- package/dist/db/migrations/20261115120002_drop_events_linked_org_ids.sql +119 -0
- package/dist/db/migrations/20261115130000_entities_retired_type_idx.sql +34 -0
- package/dist/db/migrations/20261115140000_entity_identities_personal_owner_idx.sql +34 -0
- package/dist/db/migrations/20261117090000_write_policy_kind_note.sql +65 -0
- package/dist/db/migrations/20261117120000_app_policy_principal.sql +48 -0
- package/dist/db/migrations/20261117170000_personal_org_connector_auto_policy_backfill.sql +57 -0
- package/dist/db/migrations/20261117190000_org_slug_reserved_paths.sql +29 -0
- package/dist/db/migrations/20261118120000_workspace_view_top_level_paths.sql +69 -0
- package/dist/db/migrations/preconditions/20261117190000_org_slug_reserved_paths.sql +14 -0
- package/dist/db/migrations/preconditions/20261118120000_workspace_view_top_level_paths.sql +21 -0
- package/dist/dependencies.bun.lock +51 -46
- package/dist/guest.bundle.js +11 -2
- package/dist/owletto/dist/assets/_-BC9j6MkU.js +2 -0
- package/dist/owletto/dist/assets/_-Z1u1cIe6.js +3 -0
- package/dist/owletto/dist/assets/_agentId-B-TFq9TP.js +2 -0
- package/dist/owletto/dist/assets/{_agentId-CGScf8z_.js → _agentId-BGatZWsd.js} +2 -2
- package/dist/owletto/dist/assets/_automationId-CMUrWPvr.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CUoAoP0_.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-Bs49QGGH.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-CszP1den.js +2 -0
- package/dist/owletto/dist/assets/_eventId-C0AZUBnD.js +2 -0
- package/dist/owletto/dist/assets/_owner-B4ydA75k.js +3 -0
- package/dist/owletto/dist/assets/_shape-C4-ikE70.js +2 -0
- package/dist/owletto/dist/assets/_slug-DE5J3KVu.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-Dkcd8JQC.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-BKeIzZXE.js → accept-invitation-DmrQQu_W.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-location-sLvKaSCa.js → activity-route-location-Bec6fW-t.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-DCSNBKZU.js +2 -0
- package/dist/owletto/dist/assets/agent-client-connections-xvabPpi6.js +4 -0
- package/dist/owletto/dist/assets/agent-connect-pages-DDPtkcmq.js +6 -0
- package/dist/owletto/dist/assets/{agent-editor-form-DVFyyMyd.js → agent-editor-form-BrhQbHZg.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-BLNHIy-r.js → agent-loading-shells-D3y98xuO.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-UBKRR5vs.js → agent-permissions-matrix-jQJjSa9i.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-fqedKd0D.js → agent-skill-context-CCcknBYE.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-BUCoY2Nf.js → agent-subpage-shell-6f_53cSf.js} +2 -2
- package/dist/owletto/dist/assets/agent-thread-v_lSSnJi.js +6 -0
- package/dist/owletto/dist/assets/{app._appId-ByIypCL9.js → app._appId-CKWzZ2ic.js} +2 -2
- package/dist/owletto/dist/assets/assist-composer-Q9ZJjAta.js +2 -0
- package/dist/owletto/dist/assets/automation-run-now-Dl0MKx3N.js +2 -0
- package/dist/owletto/dist/assets/{callback-Pz5uS-k7.js → callback-Bentv78L.js} +2 -2
- package/dist/owletto/dist/assets/{card-CAPpY9P5.js → card-C4oPCVh6.js} +2 -2
- package/dist/owletto/dist/assets/{claim-DgWWK0KI.js → claim-B3C4qIi2.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-DqaFEyir.js +2 -0
- package/dist/owletto/dist/assets/{client-rows-Dd5YV8vn.js → client-rows-rse9thnk.js} +2 -2
- package/dist/owletto/dist/assets/{clients-Bf7ZgGro.js → clients-BhPMbxHi.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-z1Sy_hiX.js → code-editor-CTdKUDPY.js} +2 -2
- package/dist/owletto/dist/assets/connect-D8o7HBlo.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D5EZvSHb.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-Dbagcg9L.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DALW9S2K.js +2 -0
- package/dist/owletto/dist/assets/connection-DyxzSqVE.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-LqpxUCdy.js +2 -0
- package/dist/owletto/dist/assets/{connector-page-shell-an3SYLim.js → connector-page-shell-DZjKv9zQ.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-mSZCOud-.js → connector-provenance-DtTJn1Nk.js} +2 -2
- package/dist/owletto/dist/assets/connectors-BVl-AR33.js +2 -0
- package/dist/owletto/dist/assets/{consent-1ulwyJ3k.js → consent-XCqsHLxS.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-Ctg_pXLe.js → core.esm-B1du4Zwy.js} +3 -3
- package/dist/owletto/dist/assets/create-BYKCtGL4.js +2 -0
- package/dist/owletto/dist/assets/create-D6Mmuxcq.js +2 -0
- package/dist/owletto/dist/assets/{create-CGuoqPh8.js → create-GHTb6wKX.js} +2 -2
- package/dist/owletto/dist/assets/{create-automation-form-CD6jSlWL.js → create-automation-form-CTiy_S9G.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-DMH97KkK.js +2 -0
- package/dist/owletto/dist/assets/custom-guardrail-edits-DZy66ucV.js +2 -0
- package/dist/owletto/dist/assets/definition-comparison-C2mPfIMD.js +2 -0
- package/dist/owletto/dist/assets/detail-page-skeleton-DNBL7nyk.js +2 -0
- package/dist/owletto/dist/assets/device-CwP1PY8q.js +2 -0
- package/dist/owletto/dist/assets/{device-pin-tombstone-Dkj7hrBE.js → device-pin-tombstone-DYTt7kU5.js} +2 -2
- package/dist/owletto/dist/assets/device._deviceId-DZ2kqI4Y.js +2 -0
- package/dist/owletto/dist/assets/{entity-options-D4t-NAcg.js → entity-options-D9K_5Lcs.js} +2 -2
- package/dist/owletto/dist/assets/entity-page-DggKXrcE.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-C6M6yKFf.js +2 -0
- package/dist/owletto/dist/assets/{entity-schema-graph-Cq96SJ3c.js → entity-schema-graph-B255NKjF.js} +2 -2
- package/dist/owletto/dist/assets/entity-type-page-CGBAP2wt.js +2 -0
- package/dist/owletto/dist/assets/event-attachments-D8Z8uwv9.js +2 -0
- package/dist/owletto/dist/assets/event-detail-CgG3pDLA.js +2 -0
- package/dist/owletto/dist/assets/events-feed-ClhEywwV.js +2 -0
- package/dist/owletto/dist/assets/{filter-editors-DGVl9U4D.js → filter-editors-D_Sfn0dv.js} +3 -3
- package/dist/owletto/dist/assets/{full-page-spinner-CtVlF8GQ.js → full-page-spinner-C1clibUY.js} +2 -2
- package/dist/owletto/dist/assets/{index-CK5GDX4B.js → index-04B26s6E.js} +2 -2
- package/dist/owletto/dist/assets/index-2HrEO-nl.js +2 -0
- package/dist/owletto/dist/assets/index-BU3k9wpw.js +2 -0
- package/dist/owletto/dist/assets/{index-DvuJ_S_o.js → index-BXHqp23o.js} +2 -2
- package/dist/owletto/dist/assets/index-BdLRUDIR.js +2 -0
- package/dist/owletto/dist/assets/index-C2FrGwYN.js +2 -0
- package/dist/owletto/dist/assets/index-CB9wGfUm.js +2 -0
- package/dist/owletto/dist/assets/index-Caihaftb.js +2 -0
- package/dist/owletto/dist/assets/index-CwH59DJV.js +2 -0
- package/dist/owletto/dist/assets/index-DB2lVKuV.js +7908 -0
- package/dist/owletto/dist/assets/{index-DbjbHlDe.js → index-DTvJRjrM.js} +2 -2
- package/dist/owletto/dist/assets/index-SF2ni1Rs.css +1 -0
- package/dist/owletto/dist/assets/{index-BifR-LE9.js → index-mSrdbx3C.js} +9 -9
- package/dist/owletto/dist/assets/index-uFn-Ilrx.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-OjtREegr.js → json-diff-Ce6YAXzY.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-CH0qQBYk.js → list-skeleton-DLPBTnbR.js} +2 -2
- package/dist/owletto/dist/assets/login-DeWlvogD.js +2 -0
- package/dist/owletto/dist/assets/{logout-DfdgOLoM.js → logout-CJY0ceN9.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-Cxg2zGQT.js → member-scope-gate-CBPMprXu.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-D5kj1RaR.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-D2OpDkwH.js → model-selector-CjkBPpjN.js} +2 -2
- package/dist/owletto/dist/assets/new-BKrNkOQD.js +2 -0
- package/dist/owletto/dist/assets/new-BetiMuDq.js +2 -0
- package/dist/owletto/dist/assets/new-dk_-eXqU.js +2 -0
- package/dist/owletto/dist/assets/new-efN--4Wx.js +2 -0
- package/dist/owletto/dist/assets/organization-C3rpwx_d.js +2 -0
- package/dist/owletto/dist/assets/pdf-document--AN-oCKj.css +1 -0
- package/dist/owletto/dist/assets/pdf-document-2W1q0sRA.js +56 -0
- package/dist/owletto/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
- package/dist/owletto/dist/assets/peek-pane-content-ChsBWO0P.js +3 -0
- package/dist/owletto/dist/assets/{pending-seed-BBACroge.js → pending-seed-CTKYdA4X.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-EyGWEYwQ.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-_KWdfzEM.js +2 -0
- package/dist/owletto/dist/assets/record-session-D27VNxP_.js +2 -0
- package/dist/owletto/dist/assets/{renderer-CTKNMcXP.js → renderer-B8yZ5lql.js} +34 -33
- package/dist/owletto/dist/assets/{reset-password-DKBEneyR.js → reset-password-BGVJIh2I.js} +2 -2
- package/dist/owletto/dist/assets/run-initiator-C0sur8lU.js +2 -0
- package/dist/owletto/dist/assets/runs-list-CJOFMgpk.js +2 -0
- package/dist/owletto/dist/assets/schema-value-DDNHANGs.js +3 -0
- package/dist/owletto/dist/assets/{scoped-feed-bar-DNFL0sYX.js → scoped-feed-bar-BTv9mPcR.js} +2 -2
- package/dist/owletto/dist/assets/settings-Ponr5XbS.js +3 -0
- package/dist/owletto/dist/assets/{status-variants-SzXYYedJ.js → status-variants-mLqVhg5O.js} +2 -2
- package/dist/owletto/dist/assets/subDays-BGA_fkig.js +2 -0
- package/dist/owletto/dist/assets/two-factor-pqoxGSgL.js +2 -0
- package/dist/owletto/dist/assets/{use-automations-DfBtVzGa.js → use-automations-DcdlmVuX.js} +2 -2
- package/dist/owletto/dist/assets/{use-login-redirect-BDiS3eyl.js → use-login-redirect-D7HW5Ed6.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-khySpz_V.js → use-mention-search-BniE-K2d.js} +3 -3
- package/dist/owletto/dist/assets/view-card-Cg6PeEiV.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-CvrKw0mZ.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +5766 -2999
- package/npm-shrinkwrap.json +195 -172
- package/package.json +2 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +20 -0
- package/vendor/connector-sdk/dist/define-connector.js +2 -0
- package/vendor/connector-sdk/dist/extension-dom-scrape.d.ts +2 -0
- package/vendor/connector-sdk/dist/extension-dom-scrape.js +5 -0
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +20 -0
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/entity-reference.d.ts +2 -0
- package/vendor/core/dist/contracts/entity-reference.js +4 -3
- package/vendor/core/dist/contracts/tools/entity-list-sort.d.ts +18 -0
- package/vendor/core/dist/contracts/tools/entity-list-sort.js +64 -0
- package/vendor/core/dist/contracts/tools/manage-agents.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/manage-agents.js +3 -3
- package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +11 -1
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +29 -3
- package/vendor/core/dist/contracts/tools/manage-operations.js +24 -2
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +36 -0
- package/vendor/core/dist/contracts/tools/manage-views.js +15 -2
- package/vendor/core/dist/contracts/tools/view-definition.js +7 -2
- package/vendor/core/dist/contracts/tools/view-host.js +5 -0
- package/vendor/core/dist/contracts/tools/view-path.d.ts +8 -1
- package/vendor/core/dist/contracts/tools/view-path.js +11 -1
- package/vendor/core/dist/reserved.d.ts +7 -1
- package/vendor/core/dist/reserved.js +17 -0
- package/vendor/core/package.json +6 -1
- package/vendor/views/dist/api.d.ts +19 -3
- package/vendor/views/dist/api.js +53 -5
- package/vendor/views/dist/components.d.ts +7 -0
- package/vendor/views/dist/components.js +223 -2
- package/vendor/views/dist/embed.js +13 -2
- package/vendor/views/dist/live-gate.d.ts +34 -0
- package/vendor/views/dist/live-gate.js +100 -0
- package/vendor/views/dist/native.d.ts +43 -1
- package/vendor/views/dist/native.js +1 -0
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-BDMUN9XZ.js +0 -2
- package/dist/owletto/dist/assets/_-CF5X4ANe.js +0 -3
- package/dist/owletto/dist/assets/_agentId-EQU2aUP0.js +0 -2
- package/dist/owletto/dist/assets/_automationId-PXZ33jsF.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DcI29kGy.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-Cr2NDJWX.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-CnmLYlVS.js +0 -2
- package/dist/owletto/dist/assets/_eventId-w5sDz5oa.js +0 -2
- package/dist/owletto/dist/assets/_owner-CkOZR4n0.js +0 -3
- package/dist/owletto/dist/assets/_shape-C_FmSf9G.js +0 -2
- package/dist/owletto/dist/assets/_slug-COPpRXLt.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BVdJiilV.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-mxxpqjtC.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-msesKUwn.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-DVq9nAR7.js +0 -4
- package/dist/owletto/dist/assets/agent-thread-Cqf9ITrT.js +0 -6
- package/dist/owletto/dist/assets/assist-composer-kG_heHXo.js +0 -2
- package/dist/owletto/dist/assets/automation-run-now-C5XTS00o.js +0 -2
- package/dist/owletto/dist/assets/client-activity-scopes-Aqdo6Pdr.js +0 -2
- package/dist/owletto/dist/assets/connect-BFNp1y_s.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-BWrAhMqO.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-CSPfwYIN.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CuOeHafK.js +0 -2
- package/dist/owletto/dist/assets/connection-CVeHmDLs.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-BYo7zdVD.js +0 -2
- package/dist/owletto/dist/assets/connectors-DBEM9QQz.js +0 -2
- package/dist/owletto/dist/assets/copy-button-Xhh7ZnjO.js +0 -2
- package/dist/owletto/dist/assets/create-Ccb5R-S4.js +0 -2
- package/dist/owletto/dist/assets/create-DmhbacIa.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-CZsAqj1p.js +0 -2
- package/dist/owletto/dist/assets/custom-guardrail-edits-Ce_BwiwD.js +0 -2
- package/dist/owletto/dist/assets/definition-comparison-D_qP25jR.js +0 -2
- package/dist/owletto/dist/assets/detail-page-skeleton-CPAfZLG0.js +0 -2
- package/dist/owletto/dist/assets/device-DDl5XKvt.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-bNhTcops.js +0 -2
- package/dist/owletto/dist/assets/dynamic-schema-form-CRyUchXo.js +0 -2
- package/dist/owletto/dist/assets/entity-page-BOOL_vy3.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-_nuesgnp.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-CkCSbkBx.js +0 -2
- package/dist/owletto/dist/assets/event-detail-DUvlqn9b.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DcKTkJVe.js +0 -2
- package/dist/owletto/dist/assets/index-BUlkNJzX.js +0 -2
- package/dist/owletto/dist/assets/index-BoqrvLHQ.js +0 -7906
- package/dist/owletto/dist/assets/index-CA9mW_ZM.js +0 -2
- package/dist/owletto/dist/assets/index-CH0GzG4i.js +0 -2
- package/dist/owletto/dist/assets/index-CtI5Eomq.js +0 -2
- package/dist/owletto/dist/assets/index-DmtQ0bds.js +0 -2
- package/dist/owletto/dist/assets/index-Du_J8hnx.js +0 -2
- package/dist/owletto/dist/assets/index-Pae_f9LM.css +0 -1
- package/dist/owletto/dist/assets/index-XETZnN7L.js +0 -2
- package/dist/owletto/dist/assets/login-DG0b9uSC.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-qEDQ9Z18.js +0 -74
- package/dist/owletto/dist/assets/missing-view-xT0B-f5z.js +0 -2
- package/dist/owletto/dist/assets/needs-you-list-3uMsWcDv.js +0 -2
- package/dist/owletto/dist/assets/new-AdGV6a8R.js +0 -2
- package/dist/owletto/dist/assets/new-BdtIhBpo.js +0 -2
- package/dist/owletto/dist/assets/new-BjGwX6s6.js +0 -2
- package/dist/owletto/dist/assets/new-D-iMjV74.js +0 -2
- package/dist/owletto/dist/assets/organization-qaIpEiQg.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-CEsDVScl.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-C8ZfIAYn.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-K2R8iXSI.js +0 -2
- package/dist/owletto/dist/assets/record-session-BrM9cdXu.js +0 -2
- package/dist/owletto/dist/assets/run-initiator-BKSgI1o0.js +0 -2
- package/dist/owletto/dist/assets/runs-k2NpbZm8.js +0 -2
- package/dist/owletto/dist/assets/runs-list-DUXRMkWN.js +0 -2
- package/dist/owletto/dist/assets/schema-value-wjqGxXhv.js +0 -3
- package/dist/owletto/dist/assets/settings-V0m5Om5j.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BMut9YIA.js +0 -2
- package/dist/owletto/dist/assets/subDays-9s9OEl5t.js +0 -2
- package/dist/owletto/dist/assets/table-ZuYMOjVR.js +0 -2
- package/dist/owletto/dist/assets/view-card-DiHWlypr.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-DGKxSr7r.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-HA-PiOwA.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{eA as h,eB as mn,c as Ht,r as w,j as S,ac as yn,eC as gn,w as vn,z as St,eD as _n,dm as xn,eE as bn,eF as kn,dl as wn,eG as Sn,dL as En,K as Tn,u as On,H as Cn,af as Oe,a4 as Ce,eH as Nn,eI as Rn,p as In,eJ as jn,i as An,eK as $n,eL as Zn,L as Mn}from"./index-BoqrvLHQ.js";import{D as Ln,E as Vn}from"./app-bridge-B-L0rGz9.js";import{l as Pn}from"./renderer-CTKNMcXP.js";var x;(function(n){n.assertEqual=s=>{};function e(s){}n.assertIs=e;function t(s){throw new Error}n.assertNever=t,n.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},n.getValidEnumValues=s=>{const a=n.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return n.objectValues(i)},n.objectValues=s=>n.objectKeys(s).map(function(a){return s[a]}),n.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},n.find=(s,a)=>{for(const i of s)if(a(i))return i},n.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}n.joinValues=r,n.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var Et;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Et||(Et={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Y=n=>{switch(typeof n){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(n)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(n)?f.array:n===null?f.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?f.promise:typeof Map<"u"&&n instanceof Map?f.map:typeof Set<"u"&&n instanceof Set?f.set:typeof Date<"u"&&n instanceof Date?f.date:f.object;default:return f.unknown}},d=x.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class J extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,u=0;for(;u<i.path.length;){const c=i.path[u];u===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return s(this),r}static assert(e){if(!(e instanceof J))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];t[a]=t[a]||[],t[a].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}J.create=n=>new J(n);const tt=(n,e)=>{let t;switch(n.code){case d.invalid_type:n.received===f.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,x.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(n.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(n.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(n.options)}, received '${n.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:x.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case d.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case d.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(n)}return{message:t}};let Dn=tt;function zn(){return Dn}const Un=n=>{const{data:e,path:t,errorMaps:r,issueData:s}=n,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)o=c(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};function l(n,e){const t=zn(),r=Un({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===tt?void 0:tt].filter(s=>!!s)});n.common.issues.push(r)}class A{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const s of t){const a=await s.key,i=await s.value;r.push({key:a,value:i})}return A.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return y;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const y=Object.freeze({status:"aborted"}),Ee=n=>({status:"dirty",value:n}),V=n=>({status:"valid",value:n}),Tt=n=>n.status==="aborted",Ot=n=>n.status==="dirty",me=n=>n.status==="valid",Ve=n=>typeof Promise<"u"&&n instanceof Promise;var p;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(p||(p={}));class W{constructor(e,t,r,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ct=(n,e)=>{if(me(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new J(n.common.issues);return this._error=t,this._error}}};function v(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:s}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:u}=n;return i.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:u??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:u??t??o.defaultError}},description:s}}class _{get description(){return this._def.description}_getType(e){return Y(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Y(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:Y(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ve(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Y(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Ct(r,s)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Y(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return me(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>me(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Y(e)},s=this._parse({data:e,path:r.path,parent:r}),a=await(Ve(s)?s:Promise.resolve(s));return Ct(r,a)}refine(e,t){const r=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:d.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof t=="function"?t(r,s):t),!1))}_refinement(e){return new ve({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Q.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this)}promise(){return Fe.create(this,this._def)}or(e){return De.create([this,e],this._def)}and(e){return ze.create(this,e,this._def)}transform(e){return new ve({...v(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new it({...v(this._def),innerType:this,defaultValue:t,typeName:g.ZodDefault})}brand(){return new lr({typeName:g.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ot({...v(this._def),innerType:this,catchValue:t,typeName:g.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return dt.create(this,e)}readonly(){return ct.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Fn=/^c[^\s-]{8,}$/i,Bn=/^[0-9a-z]+$/,qn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Wn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hn=/^[a-z0-9_-]{21}$/i,Jn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Kn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ke;const Gn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,er=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sr=new RegExp(`^${Jt}$`);function Xt(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ar(n){return new RegExp(`^${Xt(n)}$`)}function ir(n){let e=`${Jt}T${Xt(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function or(n,e){return!!((e==="v4"||!e)&&Gn.test(n)||(e==="v6"||!e)&&er.test(n))}function cr(n,e){if(!Jn.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function dr(n,e){return!!((e==="v4"||!e)&&Qn.test(n)||(e==="v6"||!e)&&tr.test(n))}class H extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.string,received:a.parsedType}),y}const r=new A;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Kn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ke||(Ke=new RegExp(Yn,"u")),Ke.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Wn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")Hn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Fn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")Bn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")qn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:d.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:d.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:d.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?ir(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?sr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?ar(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?Xn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?or(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?cr(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"jwt",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?dr(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cidr",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?nr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:d.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?rr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64url",code:d.invalid_string,message:a.message}),r.dirty()):x.assertNever(a);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(s=>e.test(s),{validation:t,code:d.invalid_string,...p.errToObj(r)})}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...p.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...p.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...p.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...p.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...p.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...p.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...p.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...p.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...p.errToObj(t)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new H({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new H({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new H({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}H.create=n=>new H({checks:[],typeName:g.ZodString,coerce:n?.coerce??!1,...v(n)});function ur(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=t>r?t:r,a=Number.parseInt(n.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}class ye extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.number,received:a.parsedType}),y}let r;const s=new A;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?ur(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:d.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,r,s){return new ye({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:p.toString(s)}]})}_addCheck(e){return new ye({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ye.create=n=>new ye({checks:[],typeName:g.ZodNumber,coerce:n?.coerce||!1,...v(n)});class Ne extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let r;const s=new A;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),l(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit("min",e,!0,p.toString(t))}gt(e,t){return this.setLimit("min",e,!1,p.toString(t))}lte(e,t){return this.setLimit("max",e,!0,p.toString(t))}lt(e,t){return this.setLimit("max",e,!1,p.toString(t))}setLimit(e,t,r,s){return new Ne({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:p.toString(s)}]})}_addCheck(e){return new Ne({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ne.create=n=>new Ne({checks:[],typeName:g.ZodBigInt,coerce:n?.coerce??!1,...v(n)});class nt extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.boolean,received:r.parsedType}),y}return V(e.data)}}nt.create=n=>new nt({typeName:g.ZodBoolean,coerce:n?.coerce||!1,...v(n)});class Pe extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:f.date,received:a.parsedType}),y}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),y}const r=new A;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):x.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Pe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Pe.create=n=>new Pe({checks:[],coerce:n?.coerce||!1,typeName:g.ZodDate,...v(n)});class Nt extends _{_parse(e){if(this._getType(e)!==f.symbol){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.symbol,received:r.parsedType}),y}return V(e.data)}}Nt.create=n=>new Nt({typeName:g.ZodSymbol,...v(n)});class Rt extends _{_parse(e){if(this._getType(e)!==f.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.undefined,received:r.parsedType}),y}return V(e.data)}}Rt.create=n=>new Rt({typeName:g.ZodUndefined,...v(n)});class It extends _{_parse(e){if(this._getType(e)!==f.null){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.null,received:r.parsedType}),y}return V(e.data)}}It.create=n=>new It({typeName:g.ZodNull,...v(n)});class jt extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return V(e.data)}}jt.create=n=>new jt({typeName:g.ZodAny,...v(n)});class rt extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return V(e.data)}}rt.create=n=>new rt({typeName:g.ZodUnknown,...v(n)});class ee extends _{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),y}}ee.create=n=>new ee({typeName:g.ZodNever,...v(n)});class At extends _{_parse(e){if(this._getType(e)!==f.undefined){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.void,received:r.parsedType}),y}return V(e.data)}}At.create=n=>new At({typeName:g.ZodVoid,...v(n)});class B extends _{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),s=this._def;if(t.parsedType!==f.array)return l(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),y;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new W(t,i,t.path,o)))).then(i=>A.mergeArray(r,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new W(t,i,t.path,o)));return A.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new B({...this._def,minLength:{value:e,message:p.toString(t)}})}max(e,t){return new B({...this._def,maxLength:{value:e,message:p.toString(t)}})}length(e,t){return new B({...this._def,exactLength:{value:e,message:p.toString(t)}})}nonempty(e){return this.min(1,e)}}B.create=(n,e)=>new B({type:n,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...v(e)});function he(n){if(n instanceof I){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Q.create(he(r))}return new I({...n._def,shape:()=>e})}else return n instanceof B?new B({...n._def,type:he(n.element)}):n instanceof Q?Q.create(he(n.unwrap())):n instanceof _e?_e.create(he(n.unwrap())):n instanceof ae?ae.create(n.items.map(e=>he(e))):n}class I extends _{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=x.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){const c=this._getOrReturnCtx(e);return l(c,{code:d.invalid_type,expected:f.object,received:c.parsedType}),y}const{status:r,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ee&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||o.push(c);const u=[];for(const c of i){const m=a[c],N=s.data[c];u.push({key:{status:"valid",value:c},value:m._parse(new W(s,N,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof ee){const c=this._def.unknownKeys;if(c==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(c==="strict")o.length>0&&(l(s,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const m of o){const N=s.data[m];u.push({key:{status:"valid",value:m},value:c._parse(new W(s,N,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const m of u){const N=await m.key,j=await m.value;c.push({key:N,value:j,alwaysSet:m.alwaysSet})}return c}).then(c=>A.mergeObjectSync(r,c)):A.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new I({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{const s=this._def.errorMap?.(t,r).message??r.defaultError;return t.code==="unrecognized_keys"?{message:p.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new I({...this._def,unknownKeys:"strip"})}passthrough(){return new I({...this._def,unknownKeys:"passthrough"})}extend(e){return new I({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new I({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:g.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new I({...this._def,catchall:e})}pick(e){const t={};for(const r of x.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new I({...this._def,shape:()=>t})}omit(e){const t={};for(const r of x.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new I({...this._def,shape:()=>t})}deepPartial(){return he(this)}partial(e){const t={};for(const r of x.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?t[r]=s:t[r]=s.optional()}return new I({...this._def,shape:()=>t})}required(e){const t={};for(const r of x.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Q;)a=a._def.innerType;t[r]=a}return new I({...this._def,shape:()=>t})}keyof(){return Kt(x.objectKeys(this.shape))}}I.create=(n,e)=>new I({shape:()=>n,unknownKeys:"strip",catchall:ee.create(),typeName:g.ZodObject,...v(e)});I.strictCreate=(n,e)=>new I({shape:()=>n,unknownKeys:"strict",catchall:ee.create(),typeName:g.ZodObject,...v(e)});I.lazycreate=(n,e)=>new I({shape:n,unknownKeys:"strip",catchall:ee.create(),typeName:g.ZodObject,...v(e)});class De extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new J(o.ctx.common.issues));return l(t,{code:d.invalid_union,unionErrors:i}),y}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const u of r){const c={...t,common:{...t.common,issues:[]},parent:null},m=u._parseSync({data:t.data,path:t.path,parent:c});if(m.status==="valid")return m;m.status==="dirty"&&!a&&(a={result:m,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(u=>new J(u));return l(t,{code:d.invalid_union,unionErrors:o}),y}}get options(){return this._def.options}}De.create=(n,e)=>new De({options:n,typeName:g.ZodUnion,...v(e)});function st(n,e){const t=Y(n),r=Y(e);if(n===e)return{valid:!0,data:n};if(t===f.object&&r===f.object){const s=x.objectKeys(e),a=x.objectKeys(n).filter(o=>s.indexOf(o)!==-1),i={...n,...e};for(const o of a){const u=st(n[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===f.array&&r===f.array){if(n.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<n.length;a++){const i=n[a],o=e[a],u=st(i,o);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return t===f.date&&r===f.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class ze extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=(a,i)=>{if(Tt(a)||Tt(i))return y;const o=st(a.value,i.value);return o.valid?((Ot(a)||Ot(i))&&t.dirty(),{status:t.value,value:o.data}):(l(r,{code:d.invalid_intersection_types}),y)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ze.create=(n,e,t)=>new ze({left:n,right:e,typeName:g.ZodIntersection,...v(t)});class ae extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.array)return l(r,{code:d.invalid_type,expected:f.array,received:r.parsedType}),y;if(r.data.length<this._def.items.length)return l(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&r.data.length>this._def.items.length&&(l(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new W(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>A.mergeArray(t,i)):A.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new ae({...this._def,rest:e})}}ae.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ae({items:n,typeName:g.ZodTuple,rest:null,...v(e)})};class Ue extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.object)return l(r,{code:d.invalid_type,expected:f.object,received:r.parsedType}),y;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)s.push({key:a._parse(new W(r,o,r.path,o)),value:i._parse(new W(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?A.mergeObjectAsync(t,s):A.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof _?new Ue({keyType:e,valueType:t,typeName:g.ZodRecord,...v(r)}):new Ue({keyType:H.create(),valueType:e,typeName:g.ZodRecord,...v(t)})}}class $t extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.map)return l(r,{code:d.invalid_type,expected:f.map,received:r.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,u],c)=>({key:s._parse(new W(r,o,r.path,[c,"key"])),value:a._parse(new W(r,u,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of i){const c=await u.key,m=await u.value;if(c.status==="aborted"||m.status==="aborted")return y;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const u of i){const c=u.key,m=u.value;if(c.status==="aborted"||m.status==="aborted")return y;(c.status==="dirty"||m.status==="dirty")&&t.dirty(),o.set(c.value,m.value)}return{status:t.value,value:o}}}}$t.create=(n,e,t)=>new $t({valueType:e,keyType:n,typeName:g.ZodMap,...v(t)});class Re extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==f.set)return l(r,{code:d.invalid_type,expected:f.set,received:r.parsedType}),y;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(l(r,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(l(r,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(u){const c=new Set;for(const m of u){if(m.status==="aborted")return y;m.status==="dirty"&&t.dirty(),c.add(m.value)}return{status:t.value,value:c}}const o=[...r.data.values()].map((u,c)=>a._parse(new W(r,u,r.path,c)));return r.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new Re({...this._def,minSize:{value:e,message:p.toString(t)}})}max(e,t){return new Re({...this._def,maxSize:{value:e,message:p.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Re.create=(n,e)=>new Re({valueType:n,minSize:null,maxSize:null,typeName:g.ZodSet,...v(e)});class Zt extends _{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Zt.create=(n,e)=>new Zt({getter:n,typeName:g.ZodLazy,...v(e)});class at extends _{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}at.create=(n,e)=>new at({value:n,typeName:g.ZodLiteral,...v(e)});function Kt(n,e){return new ge({values:n,typeName:g.ZodEnum,...v(e)})}class ge extends _{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return l(t,{expected:x.joinValues(r),received:t.parsedType,code:d.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:r}),y}return V(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ge.create(e,{...this._def,...t})}exclude(e,t=this._def){return ge.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}ge.create=Kt;class Mt extends _{_parse(e){const t=x.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==f.string&&r.parsedType!==f.number){const s=x.objectValues(t);return l(r,{expected:x.joinValues(s),received:r.parsedType,code:d.invalid_type}),y}if(this._cache||(this._cache=new Set(x.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=x.objectValues(t);return l(r,{received:r.data,code:d.invalid_enum_value,options:s}),y}return V(e.data)}get enum(){return this._def.values}}Mt.create=(n,e)=>new Mt({values:n,typeName:g.ZodNativeEnum,...v(e)});class Fe extends _{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return l(t,{code:d.invalid_type,expected:f.promise,received:t.parsedType}),y;const r=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return V(r.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Fe.create=(n,e)=>new Fe({type:n,typeName:g.ZodPromise,...v(e)});class ve extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?Ee(u.value):u});{if(t.value==="aborted")return y;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?y:o.status==="dirty"||t.value==="dirty"?Ee(o.value):o}}if(s.type==="refinement"){const i=o=>{const u=s.refinement(o,a);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!me(i))return y;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>me(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):y);x.assertNever(s)}}ve.create=(n,e,t)=>new ve({schema:n,typeName:g.ZodEffects,effect:e,...v(t)});ve.createWithPreprocess=(n,e,t)=>new ve({schema:e,effect:{type:"preprocess",transform:n},typeName:g.ZodEffects,...v(t)});class Q extends _{_parse(e){return this._getType(e)===f.undefined?V(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Q.create=(n,e)=>new Q({innerType:n,typeName:g.ZodOptional,...v(e)});class _e extends _{_parse(e){return this._getType(e)===f.null?V(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_e.create=(n,e)=>new _e({innerType:n,typeName:g.ZodNullable,...v(e)});class it extends _{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===f.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}it.create=(n,e)=>new it({innerType:n,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class ot extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ve(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new J(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new J(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ot.create=(n,e)=>new ot({innerType:n,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class Lt extends _{_parse(e){if(this._getType(e)!==f.nan){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:f.nan,received:r.parsedType}),y}return{status:"valid",value:e.data}}}Lt.create=n=>new Lt({typeName:g.ZodNaN,...v(n)});class lr extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class dt extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),Ee(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,t){return new dt({in:e,out:t,typeName:g.ZodPipeline})}}class ct extends _{_parse(e){const t=this._def.innerType._parse(e),r=s=>(me(s)&&(s.value=Object.freeze(s.value)),s);return Ve(t)?t.then(s=>r(s)):r(t)}unwrap(){return this._def.innerType}}ct.create=(n,e)=>new ct({innerType:n,typeName:g.ZodReadonly,...v(e)});var g;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(g||(g={}));const G=H.create,Ie=ye.create,fr=nt.create,Yt=rt.create;ee.create;const hr=B.create,q=I.create,Be=De.create;ze.create;ae.create;const pr=Ue.create,ut=at.create,Gt=ge.create;Fe.create;Q.create;_e.create;const Ye=y,mr=h.String({pattern:"^[a-z0-9][a-z0-9-]{0,63}$",minLength:1,maxLength:64,description:"View key, e.g. 'pipeline'."}),yr=h.Object({collection:h.Optional(mn),type:h.Optional(h.String({minLength:1,description:"Entity-type slug the view opens for."})),entity:h.Optional(h.Integer({description:"Entity id the view opens for."})),event:h.Optional(h.Integer({description:"Event id the view opens for. It names the event's supersede lineage, so the view shows the current version, and it opens at /events/<id>/-/views/<key>."}))},{description:"Required unless the view is attached to the workspace. Pass scope.type, scope.entity, or scope.event to select its subject."});function gr(n){return n.collection!==void 0&&(!n.type||n.entity!==void 0||n.event!==void 0)?"Collection selection requires scope.type without entity or event":n.event!==void 0&&(n.type!==void 0||n.entity!==void 0)?"scope.event names the view's subject on its own; drop scope.type and scope.entity":null}const vr=100,Qt=h.String({pattern:"^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$",description:"Stable id, unique across the whole document (sections and items). It names the menu entry, not its destination: two entries may open the same page."}),en=h.String({minLength:1,maxLength:80}),_r=h.String({pattern:"^[a-z0-9-]{1,40}$",description:"A Lucide icon name in kebab-case (https://lucide.dev/icons), e.g. 'building-2'; former Lucide names resolve too. Unknown names render the default icon."}),xr=h.Union([h.String({maxLength:500}),h.Number(),h.Boolean()]),br=h.Union([h.Object({kind:h.Literal("view"),key:mr,scope:h.Optional(h.Object(yr.properties,{additionalProperties:!1})),params:h.Optional(h.Record(h.String({maxLength:64}),xr,{maxProperties:20,description:"Declared view params; validated against the view when resolved."}))},{additionalProperties:!1}),h.Object({kind:h.Literal("collection"),entityType:h.String({minLength:1,maxLength:120})},{additionalProperties:!1}),h.Object({kind:h.Literal("record"),entityId:h.Integer({minimum:1})},{additionalProperties:!1}),h.Object({kind:h.Literal("link"),href:h.String({minLength:1,maxLength:2048,description:"Workspace-root-relative path (e.g. 'deal?stage=won', resolved under /<workspace>/) or an absolute https:// URL."})},{additionalProperties:!1})],{description:"{ kind: 'view', key, scope?, params? } | { kind: 'collection', entityType } | { kind: 'record', entityId } | { kind: 'link', href }"}),kr=h.Object({id:Qt,label:h.Optional(en),icon:h.Optional(_r),target:h.Optional(br),children:h.Optional(h.Array(h.Unknown(),{description:"Nested items, each the same shape as this one."}))},{additionalProperties:!1}),wr=h.Object({id:Qt,label:h.Optional(en),items:h.Array(kr)},{additionalProperties:!1});h.Object({schemaVersion:h.Literal(1),sections:h.Array(wr,{maxItems:vr})},{additionalProperties:!1,description:"{ schemaVersion: 1, sections: [{ id, label?, items: [{ id, label?, icon?, target?, children? }] }] }. An item without a target is a labeled group; with both, the label opens the target and a separate control expands the children."});const Sr=h.Object({id:h.String(),label:h.String(),icon:h.Optional(h.String()),href:h.Optional(h.String()),external:h.Optional(h.Boolean()),children:h.Array(h.Unknown(),{description:"Nested items, each the same shape as this one."})});h.Object({id:h.String(),label:h.Optional(h.String()),items:h.Array(Sr)});function Er(n,e,t){let r;try{r=new URL(n,`${e}/${encodeURIComponent(t)}/`)}catch{return null}if(r.username||r.password)return null;if(r.origin===e){const s=`/${encodeURIComponent(t)}`;return r.pathname!==s&&!r.pathname.startsWith(`${s}/`)?null:{kind:"internal",path:r.pathname+r.search+r.hash}}return r.protocol!=="https:"?null:{kind:"external",href:r.href}}const Tr="lobu/open-record";function Or(n,e){return n==="read_knowledge"?!0:n==="manage_entity"?e?.action==="list"||e?.action==="get"||e?.action==="list_links":n==="manage_automations"?e?.action==="list":n==="manage_agents"?e?.action==="get":n==="manage_connections"?e?.action==="list":n==="manage_catalog"?e?.action==="list_installed":n==="manage_entity_schema"&&e?.schema_type==="entity_type"&&(e.action==="list"||e.action==="get")}const Cr="lobu/embeds/sync",Nr="lobu/embeds/focus",Rr="lobu/notifications/embed-size",Ir="lobu/notifications/embed-focus",jr="lobu/notifications/focus-enter",Ar=8,$r=2,Zr=20,Vt=q({method:ut(Cr),params:q({embeds:hr(Yt()).max(64)})}),Pt=q({method:ut(Nr),params:q({id:G().min(1).max(64),direction:Gt(["forward","backward"]).optional()})}),Ge="lobu:embed-focus-enter",Te=Ie().finite(),Dt=q({x:Te,y:Te,width:Te.nonnegative(),height:Te.nonnegative()}),Mr=q({id:G().regex(/^[A-Za-z0-9_-]{1,64}$/),view:G().regex(/^[a-z0-9][a-z0-9-]{0,63}$/),scope:q({type:G().min(1).max(128).optional(),entity:Be([Ie().int().positive(),G().min(1).max(1024)]).optional(),event:Ie().int().positive().optional(),collection:Yt().optional()}).strict().transform((n,e)=>{const t=gr(n);if(t)return e.addIssue({code:d.custom,message:t}),Ye;if(typeof n.entity=="string"&&!n.type)return e.addIssue({code:d.custom,message:"type"}),Ye;if(n.collection===void 0)return n;try{return{...n,collection:gn(n.collection)}}catch(r){return e.addIssue({code:d.custom,message:String(r)}),Ye}}),params:pr(Be([G().max(2e3),Te,fr()])).refine(n=>Object.keys(n).length<=Zr),rect:Dt.extend({clip:Dt.optional()})});function Lr(n){const{clip:e}=n;if(!e)return{};if(e.width<=0||e.height<=0)return{visibility:"hidden",pointerEvents:"none"};const t=Math.max(0,e.y-n.y),r=Math.max(0,e.x-n.x),s=Math.max(0,n.y+n.height-(e.y+e.height)),a=Math.max(0,n.x+n.width-(e.x+e.width));return t||r||s||a?{clipPath:`inset(${t}px ${a}px ${s}px ${r}px)`}:{}}function Vr(n,e){const t=[],r=[],s=new Set;for(const a of n){const i=Mr.safeParse(a),o=i.success?i.data.id:typeof a?.id=="string"?a.id.slice(0,64):null;if(o===null)continue;if(!i.success||s.has(o)){r.push({id:o,status:"refused",reason:"invalid"});continue}s.add(o);const u=i.data;e.includes(u.view)?r.push({id:o,status:"refused",reason:"cycle"}):e.length>$r?r.push({id:o,status:"refused",reason:"depth"}):t.length>=Ar?r.push({id:o,status:"refused",reason:"limit"}):(t.push(u),r.push({id:o,status:"mounted"}))}return{instances:t,statuses:r}}function tn(n){return JSON.stringify([n.id,n.view,n.scope])}const Pr=n=>n instanceof Tn&&[400,401,403,404].includes(n.status);function Dr(n,e,t){const r=vn({slug:n}),s=r.data?.find(c=>c.key===t.view),{scope:a}=t,i=St({queryKey:["embed-record",e,n,a.type??null,a.entity??null],enabled:!!s&&a.entity!==void 0,staleTime:6e4,retry:!1,queryFn:async()=>{try{const m=(await En("manage_entity",{action:"get",entity_id:a.entity,...typeof a.entity=="string"?{entity_type:a.type}:{}},{slug:n})).entity;return typeof m?.entity_type!="string"||typeof m.view_url!="string"||typeof m.id!="number"&&typeof m.id!="string"?null:{type:m.entity_type,id:m.id,path:new URL(m.view_url,window.location.origin).pathname}}catch(c){if(Pr(c))return null;throw c}}}),o=St({..._n(n,s??{key:t.view,content_hash:null},a.event??0),enabled:!!s&&a.event!==void 0,retry:!1});if(!r.data)return r.isError?{kind:"failed",retry:()=>void r.refetch()}:{kind:"pending"};if(!s)return{kind:"missing"};const u=xn(s.key);if(a.event!==void 0)return o.isError?{kind:"failed",retry:()=>void o.refetch()}:o.data===void 0?{kind:"pending"}:o.data===null?{kind:"unattached"}:{kind:"ready",view:s,scope:{event:o.data},path:`/${n}/events/${o.data}${u}`};if(a.entity!==void 0){if(i.isError)return{kind:"failed",retry:()=>void i.refetch()};if(i.data===void 0)return{kind:"pending"};const c=i.data;return c===null?{kind:"unavailable"}:a.type!==void 0&&c.type!==a.type?{kind:"unattached"}:bn([s],{type:c.type,id:c.id}).length===0?{kind:"unattached"}:{kind:"ready",view:s,scope:{type:c.type,entity:a.entity},path:`${c.path}${u}`}}return a.type!==void 0?kn([s],a.type,a.collection).length===0?{kind:"unattached"}:{kind:"ready",view:s,scope:{type:a.type,...a.collection===void 0?{}:{collection:a.collection}},path:`/${n}/${encodeURIComponent(a.type)}${u}`}:wn([s]).length===0?{kind:"unattached"}:{kind:"ready",view:s,scope:{},path:`/${n}/data${u}`}}function zr(n,e){const t=new URLSearchParams;n.scope.collection!==void 0&&t.set(Sn,JSON.stringify(n.scope.collection));for(const[s,a]of Object.entries(e))n.view.params?.[s]?.default!==a&&t.set(s,String(a));const r=t.toString();return`${n.path}${r?`?${r}`:""}`}const Ur={pending:"Loading…",failed:"This view could not be loaded.",missing:"This view is no longer available.",unattached:"This view cannot be shown for what this slot names.",unavailable:"What this view shows is not available to you."},zt=28,Fr=64,pe=new Map;function Br(n,e){if(pe.delete(n),pe.set(n,e),pe.size>Fr){const t=pe.keys().next().value;t!==void 0&&pe.delete(t)}}const qr=({org:n,principal:e,home:t,ancestry:r,instance:s,onHeight:a,onFocusExit:i,renderFrame:o})=>{const u=Ht(),c=Dr(n,e,s),m=JSON.stringify(s.params),N=JSON.stringify([t,tn(s)]),[j,$]=w.useState(()=>{const E=pe.get(N);return E?.seed===m?E:{seed:m,params:s.params}}),P=E=>{Br(N,E),$(E)},je=j.seed===m?j.params:s.params;j.seed!==m&&P({seed:m,params:s.params});const te=c.kind==="ready"?zr(c,je):null,[qe,xe]=w.useState(!1),ie=qe?0:-1,X=E=>{te&&(E&&(E.defaultPrevented||E.button!==0||E.metaKey||E.ctrlKey||E.shiftKey||E.altKey)||(E?.preventDefault(),u({href:te})))},oe=(c.kind==="ready"?c.view.name:null)??s.view;return S.jsxs("section",{"aria-label":oe,"aria-busy":c.kind==="pending"||void 0,"data-embed-id":s.id,"data-embed-state":c.kind,className:"pointer-events-auto absolute flex flex-col overflow-hidden rounded-md border border-border bg-background",style:{left:s.rect.x,top:s.rect.y,width:s.rect.width,height:s.rect.height,...Lr(s.rect)},onFocus:()=>xe(!0),onBlur:E=>{E.currentTarget.contains(E.relatedTarget)||xe(!1)},children:[S.jsx("span",{tabIndex:ie,"data-embed-trap":"start",onFocus:()=>i(s.id,"backward")}),S.jsx("div",{className:"min-h-0 flex-1",children:c.kind==="ready"?o({viewKey:s.view,scope:c.scope,params:je,onParamsChange:E=>P({seed:m,params:E}),view:c.view,ancestry:r,onHeightChange:E=>a(s.id,E+zt),onRequestDisplayMode:E=>{E==="fullscreen"&&X()}}):S.jsxs("div",{role:c.kind==="pending"?void 0:"note",className:"flex h-full min-h-16 flex-col items-center justify-center gap-2 p-3 text-center text-xs text-muted-foreground",children:[S.jsx("span",{children:Ur[c.kind]}),c.kind==="failed"?S.jsx("button",{type:"button",onClick:c.retry,className:"rounded border border-border px-2 py-0.5 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:"Retry"}):null]})}),S.jsxs("div",{className:"order-first flex shrink-0 items-center justify-between gap-2 border-b border-border px-2 text-xs text-muted-foreground",style:{height:zt},children:[S.jsx("span",{className:"truncate",children:oe}),te?S.jsxs("a",{href:te,tabIndex:ie,onClick:X,className:"inline-flex items-center gap-1 rounded px-1 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:["Open",S.jsx(yn,{"aria-hidden":!0,className:"h-3 w-3"})]}):null]}),S.jsx("span",{tabIndex:ie,"data-embed-trap":"end",onFocus:()=>i(s.id,"forward")})]})},Wr=64,Hr=2e6,Jr=10*6e4,re=new Map;let Ut=null;function Xr(n,e,t,r){const{title:s,...a}=r&&typeof r=="object"?r:{};return[n,e,t,JSON.stringify(a)].join("\0")}function Ft(n){return JSON.stringify(n.result)}function Bt(n,e,t){if(re.delete(n),!(!e.ok||t===void 0||t.length>Hr))for(re.set(n,{text:t,result:e.result,at:Date.now()});re.size>Wr;){const r=re.keys().next().value;if(r===void 0)break;re.delete(r)}}function Kr(n){return{ok:!1,result:{content:[{type:"text",text:String(n)}],isError:!0}}}function Yr(n,e){Ut!==n&&(re.clear(),Ut=n);let t=0;const r=new Set,s=new Map;return{invalidate(){t+=1,s.clear()},async read(a,i){const o=s.get(a);if(o)return s.delete(a),o;const u=!r.has(a);r.add(a);const c=re.get(a);if(u&&c&&Date.now()-c.at<=Jr){const N=t,j=$=>{if(t!==N)return;const P=Ft($);Bt(a,$,P),!($.ok&&P===c.text)&&(s.set(a,$),e())};return i().then(j,$=>j(Kr($))),{ok:!0,result:c.result}}const m=await i();return Bt(a,m,Ft(m)),m}}}const qt=q({method:ut(Tr),params:q({record:q({entity_id:Be([Ie().int().positive().max(Number.MAX_SAFE_INTEGER),G().min(1).max(1024)]),entity_type:Be([G().min(1),Ie().int().positive()]).optional()}),mode:Gt(["peek","page"])})}),Gr=new Set(["query_sql","query_sdk"]),Qr=200;function es(n,e){const t=n?.title;return typeof t=="string"&&t.trim()?n??{}:{...n,title:e.slice(0,Qr)}}const Qe=new Map;function ts(n,e){const t=`${e}\0${n}`,r=Qe.get(t);if(r)return r;const s=Oe(`${Ce}/api/${n}/tools`,{method:"GET",credentials:"include",timeoutMs:15e3}).then(async a=>{if(!a.ok)throw new Error(`tool list failed: ${a.status}`);const i=await a.json();return new Set((i.tools??[]).flatMap(o=>typeof o.name=="string"&&o.annotations?.readOnlyHint===!0?[o.name]:[]))});return Qe.set(t,s),s.catch(()=>Qe.delete(t)),s}const ns=[["--color-background-primary","--background"],["--color-background-secondary","--card"],["--color-background-tertiary","--muted"],["--color-background-inverse","--foreground"],["--color-text-primary","--foreground"],["--color-text-secondary","--muted-foreground"],["--color-text-inverse","--background"],["--color-text-info","--primary"],["--color-text-danger","--destructive"],["--color-border-primary","--border"],["--color-border-secondary","--input"],["--color-border-danger","--destructive"],["--color-ring-primary","--ring"],["--font-mono","--font-mono"],["--border-radius-sm","--radius-sm"],["--border-radius-md","--radius-md"],["--border-radius-lg","--radius-lg"],["--border-radius-xl","--radius-xl"]];function et(n){const e=document.documentElement,t=getComputedStyle(e),r={};for(const[a,i]of ns){const o=t.getPropertyValue(i).trim();o&&(r[a]=o)}const s=document.body?getComputedStyle(document.body).fontFamily:"";return s&&(r["--font-sans"]=s),{theme:e.classList.contains("dark")?"dark":"light",displayMode:n.displayMode,availableDisplayModes:n.expandable?["inline","fullscreen"]:[n.displayMode],containerDimensions:{...n.width?{width:n.width}:{},...n.maxHeight?{maxHeight:n.maxHeight}:{}},platform:"web",styles:{variables:r}}}async function rs(n,e,t,r,s,a,i,o){if(i!=="invoke_view_action"){const P=Gr.has(i);return!P&&!Or(i,o)&&!(await ts(n,e)).has(i)?{error:`Views can only call read tools and their declared actions; "${i}" is neither`}:{url:`${Ce}/api/${n}/${encodeURIComponent(i)}`,body:P?es(o,s):o??{}}}const{view:u,action:c,value:m,interaction_id:N,scope:j,expected:$}=o??{};return j!==void 0&&(typeof j!="object"||j===null||j.event!==a.event)?{error:"The event context changed. Reopen the event before submitting."}:u!==t?{error:`This frame hosts "${t}", not "${String(u)}"`}:typeof c!="string"||!c?{error:"action is required"}:{url:`${Ce}/api/${n}/views/${encodeURIComponent(t)}/actions/${encodeURIComponent(c)}`,body:{value:m??null,interaction_id:N,...$===void 0?{}:{expected:$},...r===null?{}:{expected_content_hash:r},...a.event===void 0?{}:{scope:{event:a.event}}}}}const Wt=24,F=new Map,se=new Map;function ss(n,e){const t=`${n}\0${e}`,r=F.get(t);return r!==void 0&&(F.delete(t),F.set(t,r)),r}function as(n,e,t){se.delete(n),se.set(n,{hash:e,html:t});for(const s of se.keys()){if(se.size<=Wt)break;se.delete(s)}if(e===null)return;const r=`${n}\0${e}`;F.delete(r),F.set(r,t);for(const s of F.keys()){if(F.size<=Wt)break;F.delete(s)}}const Le=new Map;function is(n,e,t,r){const s=Le.get(n);if(s)return s;const a=Oe(e,{credentials:"include"}).then(async i=>r&&(i.status===401||i.status===403)?Oe(t,{credentials:"include"}):i).then(async i=>{if(!i.ok)throw new nn(i.status);return{html:await i.text(),hash:i.headers.get("X-Lobu-View-Hash")}});return Le.set(n,a),a.then(()=>Le.delete(n),()=>Le.delete(n)),a}class nn extends Error{constructor(e){super(`shell ${e}`),this.status=e}}function os(n){se.delete(n);for(const e of F.keys())e.startsWith(`${n}\0`)&&F.delete(e)}const cs=({orgSlug:n,viewKey:e,scope:t,params:r,onParamsChange:s,paramDecls:a,contentHash:i,title:o,minHeight:u=96,fixedHeight:c,displayMode:m="fullscreen",maxHeight:N,onRequestDisplayMode:j,className:$,onLoadError:P,embedAncestry:je,onHeightChange:te,frameTabIndex:qe})=>{const xe=Ht(),ie=On(),X=w.useRef(ie);X.current=ie;const oe=w.useRef(xe);oe.current=xe;const{session:E,isReady:rn}=Cn(),We=rn&&!E,be=E?.user.id??"anonymous",Ae=w.useRef(null),$e=w.useRef(null),[ce,He]=w.useState(null),[Ze,Je]=w.useState(null),[Xe,sn]=w.useState(u),de=w.useRef(null),ue=w.useRef(null),lt=w.useRef(u);lt.current=u;const ft=w.useRef(c);ft.current=c;const L=w.useRef({scope:t,params:r,paramDecls:a,onParamsChange:s,onLoadError:P,onRequestDisplayMode:j,onHeightChange:te,title:o});L.current={scope:t,params:r,paramDecls:a,onParamsChange:s,onLoadError:P,onRequestDisplayMode:j,onHeightChange:te,title:o};const[ht,pt]=w.useState([]),ke=w.useRef(null),we=[...je??[],e],an=we.join("\0"),on=JSON.stringify([be,n,we,t]),mt=w.useRef(we);mt.current=we;const yt=w.useRef(null),cn=w.useCallback((C,b)=>{ke.current?.(Rr,{id:C,height:b})},[]),dn=w.useCallback((C,b)=>{Ae.current?.focus(),ke.current?.(Ir,{id:C,direction:b})},[]),[gt,un]=w.useState(void 0),Se=w.useRef({displayMode:m,expandable:!1});Se.current={displayMode:m,maxHeight:N,width:gt,expandable:j!==void 0};const D=`${be}\0${$n(n,e)}`;w.useEffect(()=>{let C=!1;if(D!==ue.current&&(He(null),ue.current=null,de.current=null),Je(null),i!=null&&i===de.current&&D===ue.current)return()=>{C=!0};const b=i==null?se.get(D):(()=>{const R=ss(D,i);return R===void 0?void 0:{hash:i,html:R}})();if(b!==void 0)return de.current=b.hash??i??null,ue.current=D,He(b.html),()=>{C=!0};const ne=R=>`${Ce}/api/${n}${R?"/public":""}/views/${encodeURIComponent(e)}/shell`;return is(D,ne(We),ne(!0),!We).then(({html:R,hash:le})=>{as(D,le,R),!C&&(le!==null&&le===de.current&&D===ue.current||(de.current=le,ue.current=D,Je(null),He(R)))}).catch(R=>{R instanceof nn&&[401,403,404,410].includes(R.status)&&os(D),C||(Je(R instanceof Error?R.message:String(R)),L.current.onLoadError?.())}),()=>{C=!0}},[D,n,e,i,We]);const ln=j!==void 0;w.useEffect(()=>{$e.current?.setHostContext(et(Se.current))},[m,N,gt,ln]),w.useEffect(()=>{const C=Ae.current;if(!C||typeof ResizeObserver>"u")return;const b=new ResizeObserver(([ne])=>{const R=Math.round(ne.contentRect.width);R>0&&un(R)});return b.observe(C),()=>b.disconnect()},[ce]);const fn=JSON.stringify(r),hn=JSON.stringify(t);if(w.useEffect(()=>{$e.current?.sendToolInput({arguments:{scope:L.current.scope,params:L.current.params}})},[hn,fn]),w.useEffect(()=>{if(!ce||Ze)return;const C=Ae.current;if(!C?.contentWindow)return;const b=n,ne=e,R=be,le=de.current;let Z=!1;const _t=Yr(R,()=>{Z||bt()}),M=new Ln(null,{name:"Lobu",version:"1.0.0"},{openLinks:{},serverTools:{},updateModelContext:{structuredContent:{}}},{hostContext:et(Se.current)});M.addEventListener("sizechange",({height:k})=>{ft.current||typeof k=="number"&&(sn(Math.max(lt.current,Math.ceil(k))),L.current.onHeightChange?.(Math.ceil(k)))}),M.setRequestHandler(qt,async k=>{const{params:T}=qt.parse(k);if(Z)throw new Error("View unmounted");if(typeof T.record.entity_id=="string"&&!T.record.entity_type)throw new Error("String record keys require entity_type");const O=await Oe(`${Ce}/api/${b}/manage_entity`,{method:"POST",credentials:"include",timeoutMs:15e3,headers:{"Content-Type":"application/json"},body:JSON.stringify({...T.record,action:"get"})});if(!O.ok)throw new Error(`Could not open record (${O.status})`);const z=(await O.json()).entity;if(Z)throw new Error("View unmounted");if(!z?.view_url)throw new Error("Record is unavailable");if(T.mode==="peek"&&X.current){const K={ownerSlug:b,orgContext:{slug:b},name:z.name};return X.current.open(Pn(typeof z.id=="number"?{...K,entityId:z.id}:{...K,record:{type:z.entity_type,key:z.slug}})),{mode:"peek"}}return await oe.current({href:z.view_url}),{mode:"page"}}),M.setRequestHandler(Vt,async k=>{const{params:T}=Vt.parse(k);if(Z)throw new Error("View unmounted");const O=Vr(T.embeds,mt.current);return pt(O.instances),{embeds:O.statuses}}),M.setRequestHandler(Pt,async k=>{const{params:T}=Pt.parse(k);if(Z)throw new Error("View unmounted");const U=[...yt.current?.querySelectorAll("[data-embed-id]")??[]].find(z=>z.dataset.embedId===T.id)?.querySelector("iframe");if(!U)throw new Error("No such embedded view");return U.focus(),U.dispatchEvent(new CustomEvent(Ge,{detail:T.direction??"forward"})),{}}),M.oncalltool=async({name:k,arguments:T})=>{if(Z)return{content:[{type:"text",text:"view unmounted"}],isError:!0};let O;try{O=await rs(b,R,ne,le,L.current.title??ne,L.current.scope,k,T)}catch(K){return{content:[{type:"text",text:String(K)}],isError:!0}}if(Z)return{content:[{type:"text",text:"view unmounted"}],isError:!0};if("error"in O)return{content:[{type:"text",text:O.error}],isError:!0};const U=async()=>{const K=await Oe(O.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(O.body),timeoutMs:3e4}),fe=await K.json().catch(()=>null);if(!K.ok){const wt=fe&&typeof fe.error=="string"&&fe.error||`API error: ${K.status}`;return{ok:!1,result:{content:[{type:"text",text:wt}],isError:!0,structuredContent:{error:{message:wt,code:fe?.code}}}}}return{ok:!0,result:{content:[{type:"text",text:JSON.stringify(fe)}],structuredContent:fe??{}}}};return(k==="invoke_view_action"?await U():await _t.read(Xr(R,b,k,T),U)).result},M.onupdatemodelcontext=async({structuredContent:k})=>{if(Z)return{};const T=Nn(k?.params,L.current.paramDecls);return T&&L.current.onParamsChange(T),{}},M.onopenlink=async({url:k})=>{if(Z)return{};const T=Er(k,window.location.origin,b);if(!T)return{isError:!0};if(T.kind==="external")return window.open(T.href,"_blank","noopener,noreferrer"),{};const O=new URL(T.path,window.location.origin);O.pathname=Rn(O.pathname);const U=O.pathname+O.search+O.hash;return In(O.href)?.owner===b&&X.current?X.current.open({href:U,title:"Details"}):await oe.current({href:U}),{}},M.onrequestdisplaymode=async({mode:k})=>{const T=Se.current.displayMode,O=L.current.onRequestDisplayMode;return!Z&&O&&k!==T&&(k==="inline"||k==="fullscreen")&&O(k),{mode:T}},M.addEventListener("initialized",()=>{M.sendToolInput({arguments:{scope:L.current.scope,params:L.current.params}})});const Me=new Vn(C.contentWindow,C.contentWindow);ke.current=(k,T)=>{Z||Me.send({jsonrpc:"2.0",method:k,params:T}).catch(()=>{})};const xt=k=>{ke.current?.(jr,{direction:k.detail==="backward"?"backward":"forward"})};C.addEventListener(Ge,xt),M.connect(Me).catch(k=>{console.error("[view-frame] failed to initialize",k)}),$e.current=M;const bt=()=>{Me.send({jsonrpc:"2.0",method:"lobu/notifications/data-changed",params:{}}).catch(()=>{})},pn=jn(()=>{Z||(_t.invalidate(),bt())}),kt=new MutationObserver(()=>{M.setHostContext(et(Se.current))});return kt.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{Z=!0,ke.current=null,C.removeEventListener(Ge,xt),pt([]),pn(),kt.disconnect(),$e.current=null,Me.close()}},[ce,Ze,n,e,be]),Ze)return S.jsxs("div",{"data-testid":"view-frame-error",className:"text-sm text-destructive",children:["View failed to load: ",Ze]});const vt=!c&&N!==void 0&&Xe>N;return S.jsxs("div",{className:An("relative",N!==void 0&&"overflow-hidden",$),style:N!==void 0?{maxHeight:N}:void 0,"data-testid":"view-frame","data-view":e,"data-clipped":vt||void 0,children:[ce?S.jsx("iframe",{ref:Ae,title:o??e,srcDoc:ce,sandbox:"allow-scripts",tabIndex:qe,style:{width:"100%",height:c??Xe,border:"none",display:"block"}}):S.jsx("div",{className:"animate-pulse rounded-md bg-muted/40",style:{height:u}}),ht.length>0&&ce?S.jsx("div",{ref:yt,"data-testid":"view-embeds",className:"pointer-events-none absolute inset-x-0 top-0 overflow-hidden",style:{height:c??Xe},children:ht.map(C=>S.jsx(qr,{org:n,principal:be,home:on,ancestry:we,instance:C,onHeight:cn,onFocusExit:dn,renderFrame:b=>S.jsx(cs,{orgSlug:n,viewKey:b.viewKey,scope:b.scope,params:b.params,onParamsChange:b.onParamsChange,paramDecls:b.view.params,contentHash:b.view.content_hash,title:b.view.name,displayMode:"inline",minHeight:64,onRequestDisplayMode:b.onRequestDisplayMode,embedAncestry:b.ancestry,onHeightChange:b.onHeightChange,frameTabIndex:-1})},tn(C)))},an):null,vt?S.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-background to-transparent"}):null]})};function fs({viewKey:n,backTo:e,backLabel:t}){return S.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center","data-testid":"missing-view",children:[S.jsxs("h2",{className:"text-lg font-semibold",children:["No view named “",n,"” here"]}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"It may have been renamed or detached from this page."}),S.jsx(Mn,{to:e,className:"mt-4 text-sm font-medium underline underline-offset-4",children:t})]})}function hs({error:n,onRetry:e}){const t=Zn(n,{subject:"Views"});return S.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center","data-testid":"views-unavailable",children:[S.jsx("h2",{className:"text-lg font-semibold",children:t.title}),S.jsx("p",{className:"text-muted-foreground mt-2 max-w-md text-sm",children:t.body}),t.retryable?S.jsx("button",{type:"button",onClick:e,className:"mt-4 text-sm font-medium underline underline-offset-4",children:"Try again"}):null]})}export{fs as M,hs as V,cs as a};
|
|
2
|
-
//# sourceMappingURL=missing-view-xT0B-f5z.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as N,j as e,et as I,eu as $,ev as B,ew as b,M as S,ex as E,ey as _,ez as f,B as O,a9 as P,by as j}from"./index-BoqrvLHQ.js";const T=5,Y=5;function z({entries:s,onMarkRead:t,disabled:o=!1}){const n=s.filter(r=>r.unreadIds.length>0);return n.length===0?null:e.jsxs("button",{type:"button",disabled:o,className:"ml-auto inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>t(n.flatMap(r=>r.unreadIds)),children:[e.jsx($,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Mark ",n.length," read"]})}function F({owner:s,entries:t,pageIds:o,onMarkRead:n,markPending:r}){const[u,x]=N.useState(!1);if(t.length===0)return null;const a=u?t:t.slice(0,Y),d=t.length-a.length,p=i=>{const c=o.has(i.item.id)?"This page":w(i);return c?`Needs you · ${c}`:"Needs you"};return e.jsxs("ul",{"aria-label":"Needs you",className:"mb-4 divide-y overflow-hidden rounded-lg border",children:[t.length>1?e.jsxs("li",{className:"flex flex-wrap items-center gap-2 px-3 py-1.5",children:[e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[t.length," need you"]}),e.jsx(z,{entries:t,onMarkRead:n,disabled:r}),e.jsx(I,{owner:s,showMarkRead:!1})]}):null,e.jsx(y,{owner:s,entries:a,tag:p}),d>0?e.jsx("li",{children:e.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-xs text-muted-foreground hover:bg-muted/40 hover:text-foreground",onClick:()=>x(!0),children:["Show all ",t.length]})}):null]})}function G({owner:s,entries:t}){return t.length===0?null:e.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:e.jsx(y,{owner:s,entries:t,tag:w})})}const w=s=>s.repeats>1?`${s.repeats}×`:void 0;function y({owner:s,entries:t,tag:o}){return B(t).map(n=>e.jsx("li",{children:n.entries.length>1?e.jsx(D,{owner:s,group:n}):e.jsx(b,{owner:s,item:n.entries[0].item,variant:"row",tag:o(n.entries[0])})},n.key))}function D({owner:s,group:t}){const[o,n]=N.useState(!1),{orgContext:r}=S(),u=E(),x=_(r),{entries:a}=t,d=a[0],p=a[a.length-1],i=new Set(a.map(({card:l})=>l.run_id)).size,c=o?a:a.slice(0,T),g=a.length-c.length,m=a.flatMap(({item:l})=>l.approvalRunId!=null?[l.approvalRunId]:[]),k=u.isPending||x.isPending,R=d.card.automation_name?.trim(),A=d.card.at===p.card.at?f(d.card.at):`${f(p.card.at)} – ${f(d.card.at)}`,M=async()=>{const l=await u.mutateAsync({decision:"approve",runIds:m}),C=new Set(l.failedRunIds),v=a.flatMap(({item:h})=>h.approvalRunId!=null&&!C.has(h.approvalRunId)&&h.notificationId!=null?[h.notificationId]:[]);v.length>0&&await x.mutateAsync(v),l.failed>0?j.error(`${l.succeeded} approved; ${l.failed} failed.`):j.success(`${l.succeeded} approved.`)};return e.jsxs("section",{"aria-label":`${a.length} approvals`,className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-3 pt-2.5 pb-1.5",children:[e.jsxs("h3",{className:"text-sm font-medium",children:[a.length," approvals waiting"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Proposed by ",R??"this Automation"," ·"," ",i===1?"1 run":`${i} runs`," · ",A]})]}),e.jsx("ul",{className:"divide-y border-t",children:c.map(l=>e.jsx("li",{children:e.jsx(b,{owner:s,item:l.item,variant:"row",showMark:!1})},l.item.id))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-t px-3 py-2 text-xs",children:[g>0?e.jsxs("button",{type:"button",className:"text-muted-foreground hover:text-foreground",onClick:()=>n(!0),children:[g," more · Review all"]}):null,m.length>1?e.jsxs(O,{type:"button",size:"sm",className:"ml-auto h-7 text-xs",disabled:k,onClick:()=>void M(),children:[e.jsx(P,{className:"mr-1 h-3 w-3"}),"Approve all ",m.length]}):null]})]})}export{z as M,F as N,G as a};
|
|
2
|
-
//# sourceMappingURL=needs-you-list-3uMsWcDv.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as z,H as F,Y as L,r,j as e,Z as v,$ as S,B as U,a0 as N,a1 as E}from"./index-BoqrvLHQ.js";import{C as A,a as I,b as T,c as $}from"./card-CAPpY9P5.js";import{F as k}from"./full-page-spinner-CtVlF8GQ.js";function c(l){return l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function q(){const l=z(),{session:u,isReady:d}=F(),{slug:n,name:i}=L.useSearch(),[m,y]=r.useState(i||n||""),[g,h]=r.useState(n||(i?c(i):"")),[b,C]=r.useState(!!n),[x,o]=r.useState(null),[f,p]=r.useState(!1),j=r.useRef(!1);if(r.useEffect(()=>{if(!d||u||j.current)return;j.current=!0;const a=new URL("/orgs/new",window.location.origin);n&&a.searchParams.set("slug",n),i&&a.searchParams.set("name",i);const s=new URL("/auth/login",window.location.origin);s.searchParams.set("callbackUrl",`${a.pathname}${a.search}`),window.location.assign(s.toString())},[d,u,n,i]),!d||!u)return e.jsx(k,{});const P=a=>{const s=E(a);if(s.kind==="cross-host"){window.location.assign(s.href);return}l({to:s.to})},R=async a=>{a.preventDefault(),o(null);const s=m.trim(),w=(g.trim()||c(s)).trim();if(!s){o("Name is required");return}if(!w){o("Slug is required");return}p(!0);try{const t=await N.create({name:s,slug:w});if(t.error){o(t.error.message||"Failed to create organization");return}t.data&&(await N.setActive({organizationId:t.data.id}),P(t.data.slug))}catch(t){o(t instanceof Error?t.message:"An error occurred")}finally{p(!1)}};return e.jsx("div",{className:"container mx-auto max-w-md px-4 py-10",children:e.jsxs(A,{children:[e.jsx(I,{children:e.jsx(T,{children:"Create organization"})}),e.jsx($,{children:e.jsxs("form",{onSubmit:R,className:"space-y-4",children:[x&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-name",children:["Name",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-name",value:m,onChange:a=>{y(a.target.value),b||h(c(a.target.value))},placeholder:"Acme Inc.",autoFocus:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-slug",children:["Slug",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-slug",value:g,onChange:a=>{C(!0),h(c(a.target.value))},placeholder:"acme"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in URLs and as the org id in ",e.jsx("code",{children:"lobu.toml"}),". Lowercase letters, numbers, and hyphens."]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(U,{type:"submit",disabled:f,children:f?"Creating…":"Create organization"})})]})})]})})}export{q as component};
|
|
2
|
-
//# sourceMappingURL=new-AdGV6a8R.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{dq as s,M as n,c as r,j as t,at as p,au as i}from"./index-BoqrvLHQ.js";import{E as m}from"./entity-type-page-CkCSbkBx.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";function y(){const{owner:e}=s.useParams(),{orgContext:a}=n(),o=r();return t.jsx(p,{className:"gap-4 pt-2.5 pb-8",children:t.jsx(i,{children:t.jsx(m,{entityType:null,orgContext:a,onClose:()=>{o({to:"/$owner",params:{owner:e},search:{layout:"graph"}})}})})})}export{y as component};
|
|
2
|
-
//# sourceMappingURL=new-BdtIhBpo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i0 as o,c as l,y as x,H as h,n as b,s as w,j as a,at as j,au as A,dt as L,bd as f,du as C,L as N,dv as S,dx as y,bc as k,c6 as E}from"./index-BoqrvLHQ.js";import{A as O}from"./agent-editor-form-DVFyyMyd.js";import"./definition-comparison-D_qP25jR.js";import"./json-diff-OjtREegr.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";import"./schema-value-wjqGxXhv.js";import"./model-selector-D2OpDkwH.js";function W(){const{owner:e}=o.useParams(),t=o.useSearch(),r=l(),i=x(),{isAuthenticated:c}=h(),{isMember:m,isLoading:g}=b(),n=c&&m,{data:u=[],isLoading:d}=w({enabled:n});return a.jsx(j,{className:"gap-3 pt-2.5 pb-8",children:a.jsxs(A,{className:"flex flex-1 flex-col gap-6",children:[a.jsx(L,{breadcrumb:a.jsx(C,{crumbs:[a.jsx(N,{to:"/$owner",params:{owner:e},search:{section:"agent"},className:S,children:"Agents"},"agents")]}),icon:a.jsx(f.agents.icon,{className:"h-6 w-6"}),title:"Build a managed agent",caption:"Create an agent that Lobu runs and manages for this workspace."}),g||n&&d?a.jsx(y,{rows:1}):n?a.jsx(O,{mode:{kind:"create"},existingAgentIds:u.map(s=>s.agentId),onCreated:async s=>{const p=["agents",e];if(await i.refetchQueries({queryKey:p,exact:!0}),t.platform&&t.listen){await r({to:"/$owner/automations/new",params:{owner:e},search:{...t,agent:s}});return}await r({to:"/$owner/agents/$agentId",params:{owner:e,agentId:s}})}}):a.jsx(k,{icon:E,title:"Workspace membership required",description:"Only workspace members can build managed agents."})]})})}export{W as component};
|
|
2
|
-
//# sourceMappingURL=new-BjGwX6s6.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as S,n as w,cK as k,aU as A,s as T,r as g,j as e,at as L,au as P,du as B,L as b,dv as R,dj as $,m as f,dC as p,aS as I}from"./index-BoqrvLHQ.js";import{C as O,A as D}from"./create-automation-form-CD6jSlWL.js";import"./entity-options-D4t-NAcg.js";import"./use-automations-DfBtVzGa.js";import"./device-automation-Dp3faMvp.js";import"./model-selector-D2OpDkwH.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";import"./json-diff-OjtREegr.js";import"./use-mention-search-khySpz_V.js";function E(n){return n.includes(":")?n.slice(n.indexOf(":")+1):n}function F({prefillAgentId:n,onCancel:t,initialTriggers:l,conversationSetup:h}){const{org:a}=w(),[i,d]=g.useState({ready:!1,triggers:[]}),[u,j]=g.useState(),o=g.useCallback(s=>{d(m=>JSON.stringify(m)===JSON.stringify(s)?m:s)},[]),r=u??l;return e.jsx(O,{startFromScratch:!!l,organizationId:a?.id??"",prefillAgentId:n,conversationSetup:h,onClose:t,onPrefillTriggers:s=>j(s.length>0?s:void 0),onSuccess:t,hideHeader:!0,hideCancel:!0,submitLabel:"Create Automation",submitDisabled:!i.ready,createFields:{triggers:i.triggers},triggerFields:e.jsx(D,{organizationId:a?.id??null,initialTriggers:r,onChange:o},JSON.stringify(r??"new"))})}function J({owner:n,prefilled:t}){const l=S(),{org:h}=w(),a=k(h?.id??null,{status:"active",limit:500}),i=A(h?.id??null),{data:d=[]}=T(),u=!!(t?.platform&&(t.listen||t.resource)),j=u&&(a.isLoading||i.isLoading),o=g.useMemo(()=>{if(!t?.platform||!t.listen&&!t.resource)return;const x=a.data??[],v=t.connection?x.find(c=>c.slug===t.connection):(()=>{const c=x.filter(N=>N.connector_key!==t.platform?!1:t.resource?!0:N.facets.chat&&(N.external_tenant_id??"")===(t.team??""));return c.length===1?c[0]:void 0})();if(t.connection&&!v)return;const C=t.events?.split(",").map(c=>c.trim()).filter(Boolean)??[];return[{kind:"event",source:"connector",connector_key:t.platform,...v?{connection_id:v.id}:{},event_types:C.length>0?C:t.listen?["message.created"]:[],match:t.resource?{resource_ref:t.resource,...t.resource_type?{resource_type:t.resource_type}:{}}:{channel_id:E(t.listen??"")},execution:"turn",active_run:t.listen?"steer":"queue",output:t.listen?"reply_to_source":"silent",skip_if_unchanged:!t.listen}]},[a.data,t]),r=i.data?.find(x=>x.key===t?.platform)?.name,s=t?.label??t?.listen,m=g.useMemo(()=>t?.listen&&o&&s?{name:r?`${r}: ${s}`:s}:void 0,[s,r,o,t?.listen]),y=()=>void l({to:"/$owner",params:{owner:n},search:{section:"automation"}}),_=o?t?.resource?`React to changes on ${t.label??t.resource}.`:`React to messages in ${t?.label??t?.listen}.`:u&&!a.isLoading?"Choose the matching connection and event, then define the reaction.":"Start from a template, from scratch, or clone an existing Automation.";return e.jsx(L,{className:"gap-6 pt-2.5 pb-8",children:e.jsxs(P,{className:"flex min-w-0 flex-col gap-4",children:[e.jsx(B,{crumbs:[e.jsx(b,{to:"/$owner",params:{owner:n},search:{section:"automation"},className:R,children:"Automations"},"automations")],current:"New automation"}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:e.jsx("div",{className:"flex min-w-0 items-center gap-2",children:e.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[e.jsx($,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),"New automation"]})})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:_}),m&&!t?.agent?e.jsxs("p",{className:"text-sm text-muted-foreground",children:[d.length===0?"This workspace has no agents yet. ":"Choose the agent that answers here, or ",e.jsx(b,{to:"/$owner/agents/new",params:{owner:n},search:t,className:"underline underline-offset-4",children:d.length===0?"Create an agent":"create an agent"})," ","and come back to finish this setup."]}):null,j?e.jsxs("div",{className:"space-y-3",children:[e.jsx(f,{className:"h-10 w-full"}),e.jsx(f,{className:"h-32 w-full"})]}):u&&t?.connection&&!o?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"This connection is no longer available. Reopen setup from your conversation."}):e.jsx(F,{prefillAgentId:t?.agent,onCancel:y,initialTriggers:o,conversationSetup:m})]})})}function Z(){const{owner:n}=p.useParams(),t=p.useSearch();return e.jsx(I,{owner:n,children:()=>e.jsx(J,{owner:n,prefilled:t})})}export{Z as component};
|
|
2
|
-
//# sourceMappingURL=new-D-iMjV74.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{y as ge,r as v,bM as Ie,bN as Be,bO as Ke,bP as Me,K as be,j as e,bQ as Y,B as N,bR as Ve,bc as Ue,bS as Ge,bT as He,bU as Ye,bV as Ze,bW as Je,bX as Xe,bY as es,E as ve,by as ie,bZ as ss,b_ as ts,b$ as ns,c0 as me,c1 as is,c2 as as,c as os,ad as We,M as rs,c3 as cs,c4 as ne,c5 as ls,Z as je,$ as Ne,c6 as ds,c7 as us,c8 as ms,al as Ce,c9 as hs,m as P,a0 as le,ca as ps,cb as _e,cc as ke,cd as gs,a1 as xs,ce as Se,at as fs,au as ys,S as bs,i as vs,cf as js}from"./index-BoqrvLHQ.js";import{P as he,a as De,A as Ns}from"./agent-permissions-matrix-UBKRR5vs.js";import{C as we,a as Ae,b as Oe,c as Pe}from"./card-CAPpY9P5.js";const ze=["auto","approval","deny"],Cs={matched_rule:"Matching policy rules apply.",default_approval:"No rule matches; approval is required.",unresolved_principal:"The requesting agent or Automation could not be identified.",parent_approval:"Approval is inherited from the parent action.",unavailable_operation:"This action is unavailable on the connection."},Le={read:"Reads",write:"Writes",destructive:"Destructive writes",non_destructive:"Non-destructive writes",unknown:"Unclassified writes"};function pe(s){return{operation_key:s.operation_key??null,connector_key:s.connector_key??null,connection_id:s.connection_id??null,operation_category:s.operation_category??null}}const de=s=>JSON.stringify(pe(s)),$e=s=>({...s,effect:s.effects.execute??"approval"});function F({label:s,value:n,onChange:a,children:c,disabled:h}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),e.jsx("select",{"aria-label":s,value:n,onChange:r=>a(r.target.value),disabled:h,className:"h-9 w-full rounded-lg border bg-background px-2 text-foreground",children:c})]})}function _s(s,n){const a=n.connections?.find(c=>c.id===s.connection_id);return s.connection_id?`Connection: ${a?.display_name||a?.connector_key||"Unavailable"} (#${s.connection_id})`:s.connector_key?`Connector: ${n.connectors?.find(c=>c.key===s.connector_key)?.name||s.connector_key}`:"All connectors"}function ks(s,n){return s.operation_key?n.connector_operations.find(a=>a.operation_key===s.operation_key)?.name||s.operation_key:s.operation_category?Le[s.operation_category]:"All actions"}function ue(s,n){return`${_s(s,n)} · ${ks(s,n)}`}function Ee(s){return s.connection_id?`connection:${s.connection_id}`:s.connector_key?`connector:${s.connector_key}`:"all"}function Te({catalog:s}){return e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"all",children:"All connectors"}),e.jsx("optgroup",{label:"Connectors",children:s.connectors?.map(n=>e.jsx("option",{value:`connector:${n.key}`,children:n.name},n.key))}),e.jsx("optgroup",{label:"Connections",children:s.connections?.map(n=>e.jsxs("option",{value:`connection:${n.id}`,children:[n.display_name||n.connector_key," (#",n.id,")"]},n.id))})]})}function Ss({label:s,ariaLabel:n,disabled:a,onRemove:c}){const[h,r]=v.useState(!1);return h?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(N,{type:"button",variant:"destructive",size:"sm",disabled:a,"aria-label":"Confirm removal",onClick:async()=>{await c()&&r(!1)},children:"Confirm"}),e.jsx(N,{type:"button",variant:"ghost",size:"sm",disabled:a,onClick:()=>r(!1),children:"Cancel"})]}):e.jsx(N,{type:"button",variant:"ghost",size:"sm",disabled:a,"aria-label":n,onClick:()=>r(!0),children:s})}function ws({owner:s,connector:n,connection:a,agent:c}){const h=ge(),[r,y]=v.useState(c??""),C=Ie(s),l=C.data,u=l?.agents.some(t=>t.id===r)?r:"",m=Be(s,u),i=Ke(s,!u),[z,_]=v.useState(a?`connection:${a}`:n?`connector:${n}`:"all"),[M,Z]=v.useState(z),[I,W]=v.useState(!1),[k,D]=v.useState(""),[A,V]=v.useState("all"),[J,E]=v.useState("approval"),[g,S]=v.useState(!1),[L,T]=v.useState(null),[U,X]=v.useState(a?String(a):""),[G,Q]=v.useState(""),R=l?.connections?.some(t=>String(t.id)===U)?U:"",w=Me(s,R?Number(R):void 0,G,u||void 0);async function H(t,f){S(!0),T(null);try{if(u){const d={resource_class:"connector_action",...pe(t)};f?await Ye(s,u,{...d,effects:{execute:f}}):await Ze(s,u,d)||T("This rule was already removed. The list has been refreshed.")}else{const d=i.data;if(!d)return;const K=d.rules.filter(qe=>de(qe)!==de(t));f&&K.push({...pe(t),effect:f});const ce=await Je(s,{revision:d.revision,rules:K});h.setQueryData(Xe(s),ce)}return await Promise.all(["write-permissions","agent-permissions","available-operations","connector-operations","policy-explanation"].map(d=>h.invalidateQueries({queryKey:[d]}))),t}catch(d){d instanceof be&&d.status===409?(T("Policies changed in another session. Review the refreshed rules before saving again."),await i.refetch()):T(d instanceof Error?d.message:"Could not save policy.")}finally{S(!1)}}const q=C.error||(u?m.error:i.error);if(q instanceof be&&q.status===403)return e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Only organization owners and admins can manage policies."});if(q)return e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not load policies. ",String(q)]});if(!l||(u?!m.data:!i.data))return e.jsx(Y,{label:"policies",rows:2});const b=t=>t==="all"||l.connectors?.some(f=>`connector:${f.key}`===t)||l.connections?.some(f=>`connection:${f.id}`===t)?t:"all",o=b(z),p=b(M),j=l.connections?.find(t=>`connection:${t.id}`===p),$=j?.connector_key??(p.startsWith("connector:")?p.slice(10):void 0),x=t=>p==="all"||Ee(t)==="all"?!0:t.connection_id?j?t.connection_id===j.id:l.connections?.some(f=>f.id===t.connection_id&&f.connector_key===$):t.connector_key===$;function B(t){return u?t.principal_kind==="agent"&&t.principal_id===u:!t.principal_kind}const ee=o.startsWith("connector:")?o.slice(10):o.startsWith("connection:")?l.connections?.find(t=>t.id===Number(o.slice(11)))?.connector_key:void 0,O=l.connector_operations.filter(t=>!ee||t.connector_key===ee),se=l.connections?.find(t=>t.id===Number(R))?.connector_key,ae=l.connector_operations.filter(t=>t.connector_key===se),oe=u?(m.data?.agent??[]).filter(t=>t.resource_class==="connector_action").map($e):i.data?.rules??[],te=(m.data?.floor??[]).filter(t=>t.resource_class==="connector_action"&&x(t)).map($e),Qe={connector_key:o.startsWith("connector:")?o.slice(10):o==="all"&&A==="specific"?O.find(t=>t.operation_key===k)?.connector_key??null:null,connection_id:o.startsWith("connection:")?Number(o.slice(11)):null,operation_key:A==="specific"?k:null,operation_category:A.startsWith("category:")?A.slice(9):null},re=oe.filter(x);function fe(){_(p),V("all"),D(""),E("approval"),W(!0)}const ye=(t,f=!1)=>e.jsx("div",{className:"divide-y rounded-lg border",children:t.map(d=>{const K=!f&&B(d);return e.jsxs(De,{controls:e.jsxs(e.Fragment,{children:[e.jsx(he,{options:ze,value:d.effect,floor:"auto",compact:!0,disabled:g||!K,ariaLabel:`Policy for ${ue(d,l)}`,onChange:ce=>void H(d,ce)}),K&&e.jsx(Ss,{label:"Remove",disabled:g,ariaLabel:`Remove rule: ${ue(d,l)}`,onRemove:()=>H(d)})]}),children:[e.jsx("p",{className:"text-sm break-words",children:ue(d,l)}),!K&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d.principal_kind==="agent"&&!d.principal_id?"All agents":"Inherited restriction"})]},JSON.stringify([d.principal_kind,d.principal_id,de(d)]))})});return e.jsxs("div",{className:"space-y-4",children:[(p!==M||u!==r)&&e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"The requested scope is unavailable. Showing organization rules; install the connector or choose an available scope."}),e.jsxs("div",{className:"space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Auto runs immediately. Ask waits for human approval. Block prevents execution and hides the action from agents. Authentication and guardrails still apply."}),e.jsxs("details",{className:"space-y-2",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium text-foreground",children:"How rules combine"}),e.jsx("p",{children:"A rule overrides another when it is narrower in target or actions and at least as narrow in the other. When rules are narrower in different ways, or use different categories, the stricter choice wins: Block, then Ask, then Auto. With no matching rule, the result is Ask. Impact categories apply only to writes."}),e.jsx("p",{children:"A connection-wide Auto does not override an organization-wide destructive Block. Add a destructive rule for that connection to make an exception."}),e.jsx("p",{children:"Agents and their Automations can only tighten organization policy. Internal browser steps inherit the parent approval; an explicit browser Block still wins."})]})]}),e.jsxs(F,{label:"Policy owner",value:u,onChange:y,disabled:g,children:[e.jsx("option",{value:"",children:"Organization"}),l.agents.map(t=>e.jsxs("option",{value:t.id,children:["Agent: ",t.name]},t.id))]}),u&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto adds no restriction for this agent. It inherits organization policy and cannot bypass Ask or Block."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Without a matching restriction, this agent inherits organization policy.":"Without a matching rule, actions require approval (Ask)."}),e.jsx(F,{label:"Show rules for",value:p,onChange:Z,disabled:g,children:e.jsx(Te,{catalog:l})}),u&&te.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Inherited organization rules"}),ye(te,!0)]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:u?"Saved restrictions":"Saved rules"}),!I&&re.length>0&&e.jsx(N,{variant:"outline",size:"sm",disabled:g,onClick:fe,children:"Add rule"})]}),I&&e.jsxs("form",{className:"space-y-3 border-t pt-4",onSubmit:t=>{t.preventDefault(),!g&&(A!=="specific"||k)&&H(Qe,J).then(f=>{f&&(W(!1),Z(Ee(f)))})},children:[e.jsx("h3",{className:"text-sm font-medium",children:"Add rule"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(F,{label:"Applies to",value:o,onChange:t=>{_(t),V("all"),D("")},disabled:g,children:e.jsx(Te,{catalog:l})}),e.jsxs(F,{label:"Actions",value:A,onChange:V,disabled:g,children:[e.jsx("option",{value:"all",children:"All actions"}),e.jsx("optgroup",{label:"Categories",children:l.operation_categories?.map(t=>e.jsx("option",{value:`category:${t}`,children:Le[t]},t))}),e.jsx("option",{value:"specific",children:"Specific action"})]})]}),A==="specific"&&e.jsxs(F,{label:"Specific action",value:k,onChange:D,disabled:g,children:[e.jsx("option",{value:"",children:"Choose action"}),O.map(t=>e.jsxs("option",{value:t.operation_key,children:[t.connector_name,": ",t.name]},t.operation_key))]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(he,{options:ze,value:J,floor:"auto",compact:!0,disabled:g,ariaLabel:"New rule decision",onChange:E}),e.jsx(Ve,{onCancel:()=>W(!1),cancelDisabled:g,children:e.jsx(N,{type:"submit",disabled:g||A==="specific"&&!k,children:g?"Saving…":"Save rule"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving an existing scope replaces its decision. Removing a rule reveals the next matching rule."})]}),re.length?ye(re):!I&&e.jsx(Ue,{icon:Ge,title:"No saved rules in this scope",description:"Add a rule for all actions, a category, or a specific action.",actionLabel:"Add rule",onAction:fe})]}),L&&e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:L}),e.jsxs("details",{className:"space-y-3 border-t pt-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Check an action"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs(F,{label:"Check connection",value:R,onChange:t=>{X(t),Q("")},children:[e.jsx("option",{value:"",children:"Choose connection"}),l.connections?.map(t=>e.jsxs("option",{value:String(t.id),children:[t.display_name||t.connector_key," (#",t.id,")"]},t.id))]}),e.jsxs(F,{label:"Check action",value:G,onChange:Q,disabled:!R,children:[e.jsx("option",{value:"",children:"Choose action"}),ae.map(t=>e.jsx("option",{value:t.operation_key.slice(t.connector_key.length+2),children:t.name},t.operation_key))]})]}),w.error?e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not check policy. ",String(w.error)]}):e.jsx("p",{"aria-live":"polite",className:"text-sm",children:G?w.isPending?"Checking…":w.data?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:He[w.data.effect]})," ·"," ",Cs[w.data.reason]??"The server evaluated this action.",w.data.rule_ids.length>0?` · Rules ${w.data.rule_ids.map(t=>`#${t}`).join(", ")}`:""]}):"":""})]})]})}const As=[{action:"create_type",label:"Create entity types",description:"Add a new type and its initial fields."},{action:"update_type",label:"Edit entity types",description:"Change fields, write rules, event kinds, or type metadata."},{action:"delete_type",label:"Delete entity types",description:"Remove an entity-type definition."}],Os=[{action:"create_relationship_type",label:"Create relationship types",description:"Add a new kind of link between entity types."},{action:"update_relationship_type",label:"Edit relationship types",description:"Change a definition, or which types it may connect."},{action:"delete_relationship_type",label:"Delete relationship types",description:"Remove a relationship-type definition."}];function xe(s){return s.resource_class==="entity_schema"&&s.principal_kind===null&&s.entity_type_slug===null&&s.operation_key===null&&s.target_agent_id===null}function Ps(s){return s.agent.find(xe)}function zs(s,n){return{...s,agent:[...s.agent.filter(a=>!xe(a)),n]}}function $s(s){return{...s,agent:s.agent.filter(n=>!xe(n))}}function Es({label:s,description:n,action:a,value:c,pending:h,onChange:r}){return e.jsxs(De,{controls:e.jsx(he,{options:as("entity_schema",a),value:c,floor:"auto",disabled:h,compact:!0,ariaLabel:s,onChange:r}),children:[e.jsx("p",{children:s}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:n})]})}function Re({title:s,actions:n,effects:a,pending:c,onChange:h}){return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:s}),e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:n.map(({action:r,label:y,description:C})=>e.jsx(Es,{action:r,label:y,description:C,value:a[r]??me.entity_schema[r]??"deny",pending:c,onChange:l=>h(r,l)},r))})]})}function Ts({owner:s}){const n=ge(),a=es(s),c=Ie(s),h=ve({mutationFn:m=>ss(s,{resource_class:"entity_schema",effects:m}),onSuccess:m=>{n.setQueryData(a,i=>i&&zs(i,m)),n.invalidateQueries({queryKey:a})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to save schema policy")}}),r=ve({mutationFn:()=>ts(s,{resource_class:"entity_schema"}),onSuccess:()=>{n.setQueryData(a,m=>m&&$s(m)),n.invalidateQueries({queryKey:a})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to reset schema policy")}});if(c.isLoading)return e.jsx(Y,{label:"schema policy",variant:"cards",cards:1});if(c.isError||!c.data)return e.jsx(ns,{label:"schema policy"});const y=Ps(c.data),C=y?.effects??me.entity_schema,l=h.isPending||r.isPending,u=(m,i)=>{h.mutate({...y?.effects??me.entity_schema,[m]:i})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:y?"Custom policy":"Workspace defaults"}),y?e.jsxs(N,{type:"button",variant:"outline",size:"sm",disabled:l,onClick:()=>r.mutate(),children:[e.jsx(is,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove custom policy"]}):null]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Re,{title:"Entity types",actions:As,effects:C,pending:l,onChange:u}),e.jsx(Re,{title:"Relationship types",actions:Os,effects:C,pending:l,onChange:u})]})]})}function Fe(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Rs(s,n,a){const c=s.split("/");return c[1]===n?(c[1]=a,c.join("/")||"/"):`/${a}`}function Fs({section:s}){return s==="policies"?e.jsx(Y,{label:"policies",rows:2}):s==="governance"?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx(Y,{label:"agent write defaults",variant:"table",rows:3})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx(Y,{label:"schema governance",rows:3})]})]}):e.jsxs("div",{role:"status","aria-label":"Loading general settings","aria-busy":"true",className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{"aria-hidden":"true",className:"space-y-4",children:[["name","slug"].map(n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(P,{className:"h-3.5 w-12 rounded-none"}),e.jsx("div",{className:"flex h-9 items-center border border-input bg-background px-3",children:e.jsx(P,{className:"h-4 w-32 rounded-none"})})]},n)),e.jsx(P,{className:"h-3 w-4/5 rounded-none"})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsx("div",{"aria-hidden":"true",className:"grid gap-2 sm:grid-cols-2",children:["private","public"].map(n=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-3",children:[e.jsx(P,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(P,{className:"h-4 w-16 rounded-none"}),e.jsx(P,{className:"h-3 w-full rounded-none"}),e.jsx(P,{className:"h-3 w-2/3 rounded-none"})]})]},n))})]}),e.jsxs("div",{"aria-hidden":"true",className:"flex justify-end gap-2",children:[e.jsx(P,{className:"h-9 w-20 rounded-none"}),e.jsx(P,{className:"h-9 w-28 rounded-none"})]})]})}function Is({owner:s,section:n="general",connector:a,connection:c,agent:h}){const r=os(),y=ge(),{data:C,error:l}=We(),{activeOrg:u,urlOrgSlug:m}=rs(),i=(C??[]).find(o=>o.slug===s&&o.is_member)??null,z=i?.id??s,_=cs(z,{name:i?.name??"",slug:i?.slug??"",visibility:i?.visibility??"private"}),[M,Z]=_.field("name"),[I,W]=_.field("slug"),[k,D]=_.field("visibility"),[A,V]=ne(z,!!i),[J,E]=ne(z,!1),[g,S]=ne(z,null),[L,T]=v.useState(!1),[U,X]=v.useState(!1),[G,Q]=ne(z,!1);if(ls(l)&&C===void 0)return e.jsxs(we,{role:"alert",children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Couldn't load organizations"})}),e.jsx(Pe,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please try again in a moment."})})]});if(C===void 0)return e.jsx(Fs,{section:n});if(!i)return e.jsxs(we,{children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Organization not found"})}),e.jsx(Pe,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You aren't a member of an organization at"," ",e.jsx("span",{className:"font-mono",children:s}),", or it has been deleted."]})})]});if(n==="policies")return e.jsx("div",{className:"space-y-6",children:e.jsxs("section",{id:"policies",className:"scroll-mt-6 space-y-4",children:[e.jsx("div",{className:"space-y-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control connector actions across the organization. Changes to existing rules save automatically."})}),e.jsx(ws,{owner:s,connector:a,connection:c,agent:h},`${s}:${h??""}:${a??""}:${c??""}`)]})});if(n==="governance")return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set the defaults agents inherit for entities and agents. Changes save automatically; agents can only tighten them."})]}),e.jsx(Ns,{owner:s,variant:"org-floor"})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control structural changes by agents and connected AI clients. Changes save automatically."})]}),e.jsx(Ts,{owner:s})]})]});const R=o=>{const p=xs(o);if(p.kind==="cross-host"){window.location.assign(p.href);return}r({to:p.to})},w=o=>{if(o==="public"&&i.visibility!=="public"){E(!0);return}D(o),E(!1)},H=async()=>{if(!_.canSubmit)return;const o=M.trim();if(!o){S("Name is required");return}const p=I.trim()||Fe(o);if(!p){S("Slug is required");return}T(!0),S(null);try{const j=o!==i.name||p!==i.slug,$=k!==i.visibility;let x=i.slug;if(j){const O=await le.update({organizationId:i.id,data:{name:o,slug:p}});if(O.error){S(O.error.message||"Failed to update organization");return}x=O.data?.slug??p}$&&(x=(await ps(x,k)).slug),(j||$)&&(_.accept(_.values,{name:o,slug:x,visibility:k}),await y.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization updated"));const B=u?.id===i.id||m===i.slug,ee=x!==i.slug;if(B&&ee){const O=_e(),se=ke();if(O===i.slug&&se){const oe=gs(window.location.pathname,i.slug)||"/",te=`${window.location.protocol}//${x}.${se}${oe}${window.location.search}${window.location.hash}`;window.location.assign(te);return}const ae=Rs(window.location.pathname,i.slug,x);r({to:`${ae}${window.location.search}${window.location.hash}`});return}}catch(j){S(j instanceof Error?j.message:"Failed to update organization")}finally{T(!1)}},q=async()=>{X(!0),S(null);try{const o=await le.delete({organizationId:i.id});if(o.error){S(o.error.message||"Failed to delete organization");return}await y.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization deleted");const j=(C??[]).filter(x=>x.is_member).find(x=>x.id!==i.id)??null,$=u?.id===i.id||m===i.slug;if($&&j){await le.setActive({organizationId:j.id}),R(j.slug);return}if($){const x=_e(),B=ke();if(x===i.slug&&B){window.location.assign(`${window.location.protocol}//app.${B}/`);return}r({to:"/"});return}r({to:"/"})}catch(o){S(o instanceof Error?o.message:"Failed to delete organization")}finally{X(!1),Q(!1)}},b=L||U;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-name",children:"Name"}),e.jsx(Ne,{id:"org-name",value:M,onChange:o=>{Z(o.target.value),A||W(Fe(o.target.value))},placeholder:"e.g. My Team",disabled:b})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-slug",children:"Slug"}),e.jsx(Ne,{id:"org-slug",value:I,onChange:o=>{V(!0),W(o.target.value)},placeholder:"e.g. my-team",disabled:b}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Changing the slug rewrites this workspace's URL. Existing links to"," ",e.jsxs("span",{className:"font-mono",children:["/",i.slug]})," redirect for a grace period."]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>w("private"),disabled:b,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="private"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Private"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only members can access this workspace."})]})]}),e.jsxs("button",{type:"button",onClick:()=>w("public"),disabled:b,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="public"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(us,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Public"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone can browse public pages for this workspace."})]})]})]}),J&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm",children:[e.jsx("p",{className:"text-foreground",children:"Make this workspace public? Catalog-style content may become visible outside the membership."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(N,{type:"button",size:"sm",onClick:()=>{D("public"),E(!1)},disabled:b,children:"Confirm public"}),e.jsx(N,{type:"button",size:"sm",variant:"ghost",onClick:()=>E(!1),disabled:b,children:"Cancel"})]})]})]}),g&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:g}),e.jsx(ms,{visible:_.hasConflict,onReload:_.reset}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(N,{variant:"outline",onClick:()=>void r({to:`/${s}`}),disabled:b,children:"Cancel"}),e.jsxs(N,{onClick:H,disabled:b||!_.canSubmit,children:[L?e.jsx(Ce,{size:"lg",className:"mr-1.5"}):null,L?"Saving...":"Save changes"]})]}),e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:i.is_personal?"Personal workspace":"Delete this organization"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.is_personal?"Your personal workspace can't be deleted — your devices and personal connections are bound to it.":"Permanently removes the organization and all members' workspace access. This cannot be undone."}),!i.is_personal&&e.jsx("div",{className:"mt-3",children:G?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(N,{variant:"destructive",size:"sm",onClick:q,disabled:b,children:[U?e.jsx(Ce,{className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>Q(!1),disabled:b,children:"Cancel"})]}):e.jsxs(N,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>Q(!0),disabled:b,children:[e.jsx(hs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete organization"]})})]})]})}function Qs(){const{owner:s}=Se.useParams(),n=Se.useSearch(),a=n.section??"general",c={general:"General",policies:"Policies",governance:"Governance"}[a],{data:h}=We(),r=(h??[]).find(y=>y.slug===s&&y.is_member)?.name;return e.jsx(fs,{className:"pt-2.5 pb-8",children:e.jsxs(ys,{className:vs("flex flex-1 flex-col gap-6",js(a)),children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(bs,{className:"h-7 w-7"}),e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:c})]}),r?e.jsx("p",{className:"text-base font-medium text-foreground",children:r}):null]}),e.jsx(Is,{owner:s,...n,section:a})]})})}export{Qs as component};
|
|
2
|
-
//# sourceMappingURL=organization-qaIpEiQg.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,em as de,jO as z,jP as ue,jQ as ee,jR as me,jS as pe,r as g,jT as xe,u as D,aU as he,cK as fe,m as $,iv as ge,jj as je,B as k,jU as ye,jV as K,jW as ve,d_ as Ne,jX as we,G as L,al as P,aw as te,cq as se,M as ne,ds as ke,bQ as be,b$ as Ae,cY as Ce,cJ as Se,x as Ie,gt as $e,P as Le,L as H,jY as Pe,cO as Re,gw as Te,d8 as _e,jZ as Ee,gC as G,fB as Oe,aS as ze,j_ as De,n as Me,w as Be,eE as Fe,fa as Ke,fz as He,fC as Ue,fI as E,p as Ve,j$ as We,k0 as qe,ez as Ge,k1 as Qe,fg as Ye,ac as Ze,k2 as Je,A as Xe,k3 as et}from"./index-BoqrvLHQ.js";import{b as re,u as tt,a as st,A as nt}from"./automation-run-now-C5XTS00o.js";import{A as rt}from"./agent-loading-shells-BLNHIy-r.js";import{s as it,h as at,R as ot,A as ct}from"./agent-thread-Cqf9ITrT.js";import{C as lt,a as dt,c as ut,A as mt}from"./connection-feed-detail-BYo7zdVD.js";import{O as pt}from"./connect-menu-BWrAhMqO.js";import{E as R,R as xt,b as ht,s as Q,p as Y,e as ft,f as gt}from"./events-feed-DcKTkJVe.js";import{S as jt}from"./source-record-panels-BMut9YIA.js";import{E as Z}from"./entity-type-page-CkCSbkBx.js";import{c as yt,s as vt,m as Nt}from"./renderer-CTKNMcXP.js";import{E as wt}from"./event-detail-DUvlqn9b.js";import{V as kt,R as bt}from"./views-access-required-HA-PiOwA.js";import{V as At,a as Ct}from"./missing-view-xT0B-f5z.js";import{S as St,g as It}from"./status-variants-SzXYYedJ.js";import{a as $t}from"./runs-k2NpbZm8.js";import{a as ie}from"./use-automations-DfBtVzGa.js";import"./needs-you-list-3uMsWcDv.js";import"./scoped-feed-bar-DNFL0sYX.js";import"./event-kind-options-fHAIXu24.js";import"./filter-editors-DGVl9U4D.js";import"./subDays-9s9OEl5t.js";import"./create-automation-form-CD6jSlWL.js";import"./entity-options-D4t-NAcg.js";import"./device-automation-Dp3faMvp.js";import"./model-selector-D2OpDkwH.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";import"./json-diff-OjtREegr.js";import"./use-mention-search-khySpz_V.js";import"./proposal-review-shell-C8ZfIAYn.js";import"./definition-comparison-D_qP25jR.js";import"./schema-value-wjqGxXhv.js";import"./runs-list-DUXRMkWN.js";import"./run-initiator-BKSgI1o0.js";import"./list-skeleton-CH0qQBYk.js";import"./clients-Bf7ZgGro.js";import"./app-bridge-B-L0rGz9.js";import"./pending-seed-BBACroge.js";import"./feed-event-kinds-BYuZCoU4.js";import"./copy-button-Xhh7ZnjO.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./view-param-filters-DGKxSr7r.js";import"./dynamic-schema-form-CRyUchXo.js";import"./record-session-BrM9cdXu.js";function Lt(t){if(!t||typeof t!="object")return[];const s=t.properties;if(!s)return[];const r=Array.isArray(t.required)?new Set(t.required.map(String)):new Set;return Object.entries(s).map(([n,i])=>({name:n,type:String(i.type??"any"),required:r.has(n),description:typeof i.description=="string"?i.description:void 0}))}function Pt({fields:t}){return t.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No fields."}):e.jsx("ul",{className:"space-y-2",children:t.map(s=>e.jsxs("li",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("code",{className:"text-xs font-medium text-foreground",children:s.name}),e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground/70",children:s.type}),s.required?e.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",children:"required"}):null]}),s.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}):null]},s.name))})}function M({item:t,hideHeading:s=!1}){const r=t.schemaSections;return r?e.jsxs("article",{className:s?"space-y-4":"space-y-4 px-5 py-5",children:[!s&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(de,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("h2",{className:"text-base font-medium text-foreground",children:t.title}),r.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:r.description}):null]})]}),r.sections.map(n=>{const i=Lt(n.schema);return e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:n.title}),n.description?e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:n.description}):null]}),e.jsx(Pt,{fields:i})]},n.title)})]}):null}function Rt({actions:t}){const s=Object.entries(t).map(([r,n])=>{const i=n;return{id:r,name:i.name??r,description:i.description,action:i}});return e.jsx(z,{entries:s,label:"actions",renderDetail:({name:r,action:n})=>e.jsx(M,{hideHeading:!0,item:{href:"",title:r,schemaSections:ee(n)}})})}function Tt({feeds:t}){const s=Object.entries(t).map(([r,n])=>{const i=n;return{id:r,name:i.name??r,description:i.description,feed:i}});return e.jsx(z,{entries:s,label:"feed types",renderDetail:({name:r,feed:n})=>e.jsx(M,{hideHeading:!0,item:{href:"",title:r,schemaSections:ue(n)}})})}function _t(t){const s=[];return t.forEach((r,n)=>{s.push({id:`sep:${r.runId}`,role:"system",parts:[{type:"text",text:Et(r,n)}],createdAt:r.completedAt?new Date(r.completedAt).getTime():void 0});for(const i of r.messages)s.push({...i,id:`r${r.runId}:${i.id}`})}),s}function Et(t,s){const r=(t.pendingActionCount??0)>0?`Waiting for you (${t.pendingActionCount})`:t.status==="completed"?"Completed":t.status??"Completed",n=(t.autoAppliedCount??0)>0?` · ${t.autoAppliedCount} applied automatically`:"",i=t.completedAt?new Date(t.completedAt).toLocaleString():null;return i?`Run ${s+1} · ${r}${n} · ${i}`:`Run ${s+1} · ${r}${n}`}const ae=Symbol("trusted-automation-interaction");function Ot(t){return Object.defineProperty(t,ae,{value:!0}),t}function zt(t){return{title:`${t} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${t} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${t} proposals.`},{id:"reject-all",label:"Reject all",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${t} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${t} proposals.`}]}}const Dt=new Set(["automation-approval-batch"]);function Mt(t){return new Promise(s=>{t({onSettled:(r,n)=>s(!!n)})})}function Bt(){const t=me(),s=pe();return g.useMemo(()=>({toolNames:Dt,resolve:(r,n)=>{if(!n||typeof n!="object"||n[ae]!==!0)return null;const i=n;if(r==="automation-approval-batch"){const o=typeof i.runId=="number"&&Number.isSafeInteger(i.runId)&&i.runId>0?i.runId:null,c=typeof i.count=="number"&&Number.isSafeInteger(i.count)&&i.count>1?i.count:null,a=Array.isArray(i.runIds)?i.runIds.filter(d=>typeof d=="number"&&Number.isSafeInteger(d)&&d>0):[];return o===null||c===null||a.length!==c||new Set(a).size!==c?null:{view:zt(c),handlers:{manage_operations:d=>d.action!=="approve"&&d.action!=="reject"?Promise.resolve(!0):Mt(p=>d.action==="approve"?t.mutate({run_id:o,run_ids:a},p):s.mutate({run_id:o,run_ids:a},p))}}}return null}}),[t,s])}const Ft=/(?:^|\n)Run this Automation now/;function Kt(t){return t.role==="user"&&t.parts.some(s=>s.type==="text"&&Ft.test(s.text))}function Ht(t){return`history-interaction:${t.runId}:${t.eventId??"error"}`}function Ut({agentId:t,automationId:s,ownerSlug:r,runId:n}){const{data:i,isLoading:o}=xe(t,s,{orgSlug:r,...n!=null?{runId:n}:{}}),c=Bt(),a=D(),d=g.useCallback(m=>{a?.open({href:`/${r}/automations/${s}?view=activity&run_id=${m}`,title:`Automation run #${m}`,runId:m})},[a,r,s]),p=g.useMemo(()=>{const m=i?.runs??[],b=(n!=null?m.filter(x=>x.runId===n):m).slice().reverse();return _t(b.map(x=>{const j=x.messages.map(u=>it(u,{showToolCalls:!0})).filter(u=>u!==null&&!Kt(u));x.task?.trim()&&j.unshift({id:"task",role:"user",parts:[{type:"text",text:x.task.trim()}]});const N=x.actions??[],y=N.filter(u=>u.status==="pending");if(y.length>1){const u=y.map(h=>h.runId).sort((h,C)=>h-C);j.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${x.runId}`,toolName:"automation-approval-batch",args:Ot({runId:x.runId,count:y.length,runIds:u})}]})}for(const u of N){const h=at([u],{workspaceSlug:r,agentId:t,webOrigin:typeof window>"u"?null:window.location.origin});h&&j.push({...h,id:Ht(u)})}return{runId:x.runId,completedAt:x.completedAt,status:x.status,pendingActionCount:x.pendingActionCount,autoAppliedCount:x.autoAppliedCount,messages:j}}))},[t,i,r,n]);return o?e.jsx(rt,{readOnly:!0}):p.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):e.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:e.jsx(ot,{messages:p,workspaceSlug:r,children:e.jsx(ct,{readOnly:!0,readerPositionMode:"runs",interactionExtension:c,onRunSelect:n==null&&a?d:void 0})})})}function Vt({panel:t}){const s=he(t.organizationId),r=t.section==="connections"||!!t.connectionId,n=fe(t.organizationId,{connectorKey:t.connectorKey,connectionIds:t.connectionId?[t.connectionId]:void 0,enabled:r}),i=s.data?.find(c=>c.key===t.connectorKey),o=n.data?.find(c=>c.id===t.connectionId&&c.connector_key===t.connectorKey);return s.isLoading||r&&n.isLoading?e.jsx("div",{className:"p-5",children:e.jsx($,{className:"h-28 w-full"})}):s.isError||r&&n.isError?e.jsx("p",{role:"alert",className:"p-5 text-sm",children:"Could not load this connector. Close the pane and try again."}):t.connectionId&&!o||!i&&!o&&t.section!=="connections"?e.jsx("p",{className:"p-5 text-sm",children:"This connection is no longer available."}):e.jsx("div",{className:"p-5",children:t.section==="connections"?e.jsx(ge,{connections:n.data??[],connector:i,connectorKey:t.connectorKey,ownerSlug:t.ownerSlug}):o&&t.section==="data"?e.jsx(lt,{connection:o,ownerSlug:t.ownerSlug}):o?e.jsx(Gt,{connection:o,connector:i,panel:t}):i?t.section==="oauth-apps"?e.jsx(pt,{connector:i,organizationId:t.organizationId,newApp:!!t.newApp}):t.section==="feeds"?e.jsx(Wt,{connector:i}):i.installed===!1?e.jsx(qt,{connector:i,ownerSlug:t.ownerSlug}):e.jsx(Yt,{connector:i,ownerSlug:t.ownerSlug}):null},`${t.connectorKey}:${t.connectionId??"connector"}:${t.section}`)}function Wt({connector:t}){return e.jsx(Tt,{feeds:t.feeds_schema??{}})}function qt({connector:t,ownerSlug:s}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection."," ",e.jsx(K,{ownerSlug:s,connectorKey:t.key})]}),e.jsx(Rt,{actions:t.actions_schema??{}})]})}function Gt({connection:t,connector:s,panel:r}){const[n,i]=g.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:n,children:r.section==="feeds"?e.jsx(Qt,{connection:t,connector:s,ownerSlug:r.ownerSlug}):e.jsx(je,{connection:t,ownerSlug:r.ownerSlug,inPeek:!0,onReviewPermissions:s?()=>i(!0):void 0})}),n&&s&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(k,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Back to actions"}),e.jsx("h2",{className:"text-base font-semibold",children:"Provider permissions"}),e.jsx(ye,{connection:t,connectorDef:s})]})]})}function Qt({connection:t,connector:s,ownerSlug:r}){const{data:n=[],isLoading:i,isError:o}=Ne(t.id),[c,a]=g.useState(!1),d=t.facets?.chat??!1;if(i)return e.jsx($,{className:"h-28 w-full"});if(o)return e.jsx("p",{role:"alert",children:"Could not load sources. Close the pane and try again."});const p=n.map(m=>({id:String(m.id),name:m.display_name||m.feed_key,status:we(m)??(m.operations.includes("sync")?"Sync enabled":"Live access"),feed:m}));return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:c,children:e.jsx(z,{entries:p,label:d?"channels":"feeds",action:Object.keys(s?.feeds_schema??{}).length>0?e.jsx(k,{size:"sm",variant:"outline",onClick:()=>a(!0),children:d?"Add channel":"Add feed"}):void 0,renderDetail:({feed:m})=>m.store==="channel_messages"?e.jsx(dt,{feed:m,hideHeader:!0}):e.jsx(ut,{feed:m,connectorDef:s,ownerSlug:r})})}),c&&s&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:d?"Add channel":"Add feed"}),e.jsx(mt,{organizationId:t.organization_id,connections:[t],connectorDefinitions:[s],onClose:()=>a(!1)})]})]})}function Yt({connector:t,ownerSlug:s}){const{data:r=[],isLoading:n,isError:i}=ve(t.key);if(n)return e.jsx($,{className:"h-28 w-full"});if(i)return e.jsx("p",{role:"alert",children:"Could not load actions. Close the pane and try again."});const o=t.actions_schema??{},c=r.map(a=>({id:a.operation_key,name:a.name??a.operation_key,description:a.description,operation:a}));return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection. Click an action to inspect its inputs."," ",e.jsx(K,{ownerSlug:s,connectorKey:t.key})]}),e.jsx(z,{entries:c,label:"actions",renderControl:()=>e.jsx(K,{ownerSlug:s,connectorKey:t.key}),renderDetail:({operation:a,name:d})=>o[a.operation_key]?e.jsx(M,{hideHeading:!0,item:{href:"",title:d,schemaSections:ee(o[a.operation_key])}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No input fields."})})]})}function Zt({owner:t,name:s,agentId:r,clientIds:n}){const{data:i,isLoading:o}=L(t==="me"?null:t,{slug:t}),c=i?.workspace,a=t!=="me"&&c?.type==="organization"?c.id:null,d=n?.join(",")??"",p=g.useMemo(()=>({sortBy:"date",sortOrder:"desc",...r?{agentId:r}:{clientIds:d.split(",").filter(Boolean)}}),[r,d]);return t!=="me"&&o?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(P,{className:"mr-2"})," Loading…"]}):e.jsx("div",{className:"space-y-3 px-4 py-4",children:e.jsx(R,{organizationId:a,ownerSlug:t,filters:p,hideOriginator:!0,groupStretches:!0,emptyState:e.jsxs("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:["No activity from ",s," yet."]})})})}function Jt({owner:t,path:s}){const{data:r,isLoading:n}=L(t,{slug:t}),i=r?.workspace,o=i?.type==="organization"?i.id:null,c=o?{slug:t}:void 0,{data:a,isLoading:d}=te(`/${t}/${se(s)}`,c),p=a?.entity,m=p?.id;return n||d?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(P,{className:"mr-2"})," Loading…"]}):o?m==null?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't find this record. It may have been deleted, or it may live in a workspace you can't access."}):p?.is_derived?e.jsx(jt,{record:{type:p.entity_type,key:p.slug},orgContext:c}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{organizationId:o,ownerSlug:t,entityId:typeof m=="number"?m:void 0,filters:{sortBy:"date",sortOrder:"desc"},emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to this record yet."})})}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."})}function Xt({slug:t,onClose:s}){const{orgContext:r}=ne(),{data:n=[],isLoading:i,isError:o}=ke(r);if(t===null)return e.jsx(Z,{entityType:null,orgContext:r,onClose:s,compact:!0});if(i)return e.jsx(be,{label:"entity type",variant:"panel"});if(o)return e.jsx(Ae,{label:"entity type"});const c=n.find(a=>a.slug===t)??null;return c?e.jsx(Z,{entityType:c,orgContext:r,hideDelete:Ce(c),onClose:s,compact:!0}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Entity type not found."})}function es(t){if(Array.isArray(t.enum))return`One of ${t.enum.length}`;if(t.format==="date"||t.format==="date-time")return"Date";if(t.format==="uri")return"Link";if(t.format==="email")return"Email";const s=Array.isArray(t.type)?t.type[0]:t.type;return s==="array"?"List":s==="object"?"Group":s==="integer"||s==="number"?"Number":s==="boolean"?"Yes / no":"Text"}function ts({owner:t,typeSlug:s,view:r}){const{data:n,isLoading:i}=L(t,{slug:t}),o=n?.workspace,c=o?.type==="organization"?o.id:null,{isAdmin:a}=Se(c??void 0),{orgContext:d}=ne(),{data:p,isSuccess:m}=Ie(d),v=(p??[]).find(A=>A.slug===s),b=m&&!v,x=`/${t}/${$e(s)}`,{pathname:j}=Le(),N=j===x||j===`${x}/`||j.startsWith(`${x}/-/`),y=g.useMemo(()=>yt(v?.metadata_schema),[v?.metadata_schema]),u=D(),h=u?.close;g.useEffect(()=>{b&&h?.()},[b,h]);const C=g.useMemo(()=>({entityTypes:[s],sortBy:"date",sortOrder:"desc"}),[s]);if(i)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(P,{className:"mr-2"})," Loading…"]});if(b)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This entity type no longer exists."});if(!c)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."});const T=v?.name??s;return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5",children:[N?null:e.jsx(k,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(H,{...Re(t,s),children:[e.jsx(Pe,{className:"mr-1.5 h-3.5 w-3.5"}),"Browse records"]})}),v&&!N&&!Te(v)&&v.entity_count!==0?e.jsx(k,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(H,{to:"/$owner/$entityType/-/$shape",params:{owner:t,entityType:s,shape:"graph"},search:Ee(G(t,s)),children:[e.jsx(_e,{className:"mr-1.5 h-3.5 w-3.5"}),"Graph"]})}):null,r!=="activity"&&u?e.jsxs(k,{type:"button",variant:"ghost",size:"sm",className:"ml-auto h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>u.open({href:G(t,s,"activity"),title:`${T} activity`}),children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),"Activity"]}):null]}),r==="activity"?e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{organizationId:c,ownerSlug:t,filters:C,showEntityLinks:!0,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to these records yet."})})}):a?e.jsx("div",{className:"p-4",children:e.jsx(Xt,{slug:s,onClose:()=>h?.()})}):y.length>0?e.jsxs("section",{"aria-labelledby":"entity-type-peek-fields",className:"px-4 py-4",children:[e.jsx("h3",{id:"entity-type-peek-fields",className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Fields"}),e.jsx("dl",{className:"divide-y divide-border/60 text-sm",children:y.map(A=>e.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",title:A.prop.description,children:[e.jsx("dt",{className:"min-w-0 truncate",children:vt(A)}),e.jsx("dd",{className:"shrink-0 text-xs text-muted-foreground",children:es(A.prop)})]},A.key))})]}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This type has no fields yet."})]})}function ss({owner:t,eventId:s,viewKey:r}){const n=D(),i=(o,c)=>e.jsx(wt,{owner:c,organizationId:o,eventId:s,viewKey:r,dense:!0,onSelectView:n?a=>n.retarget(a):void 0},`${c}/${s}/${r??""}`);return e.jsx("div",{className:"px-4 py-4",children:t==="me"?i(null,t):e.jsx(ze,{owner:t,children:({organizationId:o,ownerSlug:c})=>o?i(o,c):e.jsx("div",{className:"h-40 animate-pulse rounded-md bg-muted/40"})})})}function ns({owner:t,feedId:s,semanticTypes:r}){const{data:n,isLoading:i}=L(t==="me"?null:t,{slug:t}),o=n?.workspace,c=t!=="me"&&o?.type==="organization"?o.id:null,a=g.useMemo(()=>({feedIds:[s],...r?.length?{semanticTypes:r}:{},sortBy:"date",sortOrder:"desc"}),[s,r]);return t!=="me"&&i?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(P,{className:"mr-2"})," Loading…"]}):c==null?e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{organizationId:c,ownerSlug:t,filters:a,showEntityLinks:!0,hideOriginator:!0,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:r?.length===1?`No ${r[0]} events from this feed yet.`:"No matching events from this feed yet."})})})}function O({owner:t,runId:s,runIds:r,contentIds:n}){const{data:i,isLoading:o}=L(t==="me"?null:t,{slug:t}),c=i?.workspace,a=t!=="me"&&c?.type==="organization"?c.id:null,d=g.useMemo(()=>{if(t==="me")return n?.length?{contentIds:n,sortBy:"date",sortOrder:"desc"}:void 0;const m=r??(s!=null?[s]:void 0);if(!(!m?.length&&!n?.length))return{...m?.length?{runIds:m}:{},...n?.length?{contentIds:n}:{}}},[t,n,s,r]),p=d!=null;return t!=="me"&&o?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(P,{className:"mr-2"})," Loading…"]}):t!=="me"&&a==null?e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."}):p?e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{presentation:"detail",organizationId:a,ownerSlug:t,filters:d,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:s!=null||r?.length?"No matching events from this run yet.":"No matching events yet."})})}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing to preview."})}const B=25;function rs({target:t}){const[s,r]=g.useState(0),{data:n,isLoading:i,isError:o,refetch:c}=De(t.entityId,t.orgContext,{relationshipType:t.relationshipType,limit:B,offset:s}),a=n?.total;return e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.label," · ",t.entityName,a!==void 0?` · ${a} current ${a===1?"link":"links"}`:n?` · ${n.rows.length} shown`:""]}),e.jsx(xt,{count:n?.failures?.length??0,onRetry:()=>void c()}),i?e.jsxs("div",{className:"space-y-2",children:[e.jsx($,{className:"h-6 w-full"}),e.jsx($,{className:"h-6 w-full"})]}):o||!n?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Could not load these links."," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>void c(),children:"Retry"})]}):n.rows.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No links on this page."}):e.jsx("ul",{className:"divide-y divide-border",children:n.rows.map(d=>e.jsx("li",{className:"flex items-center justify-between gap-3 py-1.5",children:e.jsx(ht,{row:d,entityId:t.entityId,ownerSlug:t.ownerSlug,orgContext:t.orgContext})},d.id))}),n&&(s>0||n.hasMore)?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(k,{type:"button",variant:"outline",size:"sm",disabled:s===0,onClick:()=>r(Math.max(0,s-B)),children:"Previous"}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[n.rows.length," shown",a===void 0?"":` of ${a}`]}),e.jsx(k,{type:"button",variant:"outline",size:"sm",disabled:!n.hasMore,onClick:()=>r(s+B),children:"Next"})]}):null]})}function is({owner:t,path:s,viewKey:r}){const[n,i]=g.useState({}),{data:o,isLoading:c}=L(t,{slug:t}),a=o?.workspace,d=a?.type==="organization"?a.id:null,p=d?{slug:t,organizationId:d}:void 0,{data:m,isLoading:v}=te(`/${t}/${se(s)}`,p),{isMember:b,isPublic:x,isLoading:j}=Me(t),N=b||x,y=Be({slug:t,organizationId:b?d:null}),u=m?.entity;if(c||v||j||N&&y.isLoading)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(P,{className:"mr-2"})," Loading…"]});if(!N)return e.jsx(kt,{});if(y.isError)return e.jsx(At,{onRetry:()=>void y.refetch()});const h=u?Fe(y.data??[],{type:u.entity_type,id:u.id??u.slug}).find(C=>C.key===r):void 0;return!d||!u||!h?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This view isn't attached to this record any more."}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(Ct,{orgSlug:t,viewKey:h.key,scope:{type:u.entity_type,entity:u.is_derived?u.slug:u.id??u.slug},params:n,onParamsChange:i,paramDecls:h.params,contentHash:h.content_hash,title:h.name,minHeight:320})})}function oe({owner:t,runId:s}){const r=$t(t,s);if(t==="me")return null;if(r.isLoading)return e.jsx("p",{role:"status",className:"px-4 pt-4 text-xs text-muted-foreground",children:"Loading run…"});if(!r.data)return e.jsx("p",{role:"alert",className:"px-4 pt-4 text-sm text-destructive",children:"Could not load this run."});const n=r.data;return e.jsxs("section",{"aria-label":"Run outcome",className:"space-y-2 border-b px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(St,{status:It(n.status),children:n.status}),e.jsx("time",{dateTime:n.created_at,className:"text-xs text-muted-foreground",children:Ke(n.created_at)})]}),n.connection_display_name?e.jsx("p",{className:"text-sm",children:n.connection_display_name}):null,n.error_message?e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm text-destructive",children:n.error_message}):null,r.isError?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Could not refresh this run. Showing its last known outcome."}):null]})}const J=30;function I({label:t,children:s}){return e.jsxs("section",{className:"border-t px-4 py-3 first:border-t-0",children:[e.jsx("h3",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t}),s]})}function F({label:t,detail:s}){return e.jsxs("div",{className:"flex items-baseline gap-3 py-0.5 text-sm",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),e.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:s})]})}function as({stretch:t,ownerSlug:s,connectorDefinitions:r,connectionName:n,sourceConnection:i,showEntity:o}){const c=D(),a=g.useMemo(()=>He(t),[t]),d=g.useMemo(()=>Ue(t),[t]),[p,m]=g.useState(!1),[v,b]=g.useState(new Set),x=l=>e.jsx("li",{children:e.jsx(gt,{content:l,ownerSlug:s,connectorDefinitions:r,connectionName:n,showEntity:o})},l.id),j=l=>e.jsx("ul",{className:"-mx-1 divide-y overflow-hidden rounded-lg border",children:l.map(x)}),N=[...a.failedCalls.map(l=>l.content),...a.failedOperations.flatMap(l=>E(l)??[])],y=t.changes.flatMap(l=>E(l)??[]),u=[...t.calls.map(l=>l.content),...t.operations.flatMap(l=>E(l)??[])].sort((l,f)=>new Date(f.occurred_at).getTime()-new Date(l.occurred_at).getTime()),h=p?u:u.slice(0,J),C=(l,f)=>e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-2",onClick:f,children:["Show all ",l]});if(t.source){const{source:l}=t,f=t.flagged.flatMap(w=>E(w)??[]),le=d.reduce((w,W)=>w+W.items.length,0),_=i?.(l.connectionId)??null;return e.jsxs("div",{className:"pb-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 px-4 pt-3 pb-1 text-xs text-muted-foreground",children:[e.jsx("span",{children:l.name}),e.jsxs("span",{children:["· ",Q(t)]}),e.jsxs("span",{children:["· ",Y(le,"item")]}),f.length>0?e.jsxs("span",{children:["· ",f.length," failed"]}):null,_&&c?e.jsxs(k,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>c.open({href:`/${s}/connectors/${encodeURIComponent(_.connectorKey)}/${l.connectionId}`,key:`connection:${l.connectionId}`,title:l.name,connectorPanel:{section:"data",connectorKey:_.connectorKey,connectionId:l.connectionId,organizationId:_.organizationId,ownerSlug:s}}),children:["All data from ",l.name]}):null]}),f.length>0?e.jsx(I,{label:`Failed · ${f.length}`,children:j(f)}):null,d.map(w=>{const q=v.has(w.type)?w.items:w.items.slice(0,J);return e.jsxs(I,{label:w.label,children:[j(q),w.items.length>q.length?C(w.items.length,()=>b(new Set([...v,w.type]))):null]},w.type)})]})}const T=a.did.reduce((l,f)=>l+f.count,0),A=a.lookedAt.reduce((l,f)=>l+f.count,0),S=t.apps.length===1?t.apps[0]:null,V=S?.key.startsWith("client:")?`/${s}/events?client_ids=${encodeURIComponent(S.key.slice(7))}`:S?.key.startsWith("agent:")?`/${s}/events?agent=${encodeURIComponent(S.key.slice(6))}`:null;return e.jsxs("div",{className:"pb-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 px-4 pt-3 pb-1 text-xs text-muted-foreground",children:[e.jsx("span",{children:ft(t)}),e.jsxs("span",{children:["· ",Q(t)]}),e.jsxs("span",{children:["· ",Y(t.calls.length,"call")]}),e.jsxs("span",{children:["· ",N.length," failed"]}),V&&S&&c?e.jsxs(k,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>c.open({href:V,title:S.name}),children:["All activity from ",S.name]}):null]}),N.length>0?e.jsx(I,{label:`Failed · ${N.length}`,children:j(N)}):null,t.kind==="background"?null:e.jsxs(I,{label:`Changed · ${y.length||a.changeSteps.reduce((l,f)=>l+f.count,0)}`,children:[y.length>0?j(y):null,a.changeSteps.map(l=>e.jsx(F,{label:l.title,detail:`${l.methods.join(" · ")} · ${l.count}`},l.title)),y.length===0&&a.changeSteps.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing changed."}):null]}),T>0?e.jsx(I,{label:`Did · ${T}`,children:a.did.map(l=>e.jsx(F,{label:l.group,detail:l.items.length>0?l.items.slice(0,5).map(f=>`${f.item} ${f.count}`).join(" · ")+(l.items.length>5?` · ${l.items.length-5} more`:""):String(l.count)},l.group))}):null,A>0?e.jsx(I,{label:`Looked at · ${A}`,children:a.lookedAt.map(l=>e.jsx(F,{label:l.title,detail:`${l.methods.join(" · ")} · ${l.count}`},l.title))}):null,e.jsxs(I,{label:`Raw calls · ${u.length}`,children:[j(h),u.length>h.length?C(u.length,()=>m(!0)):null]})]})}function tn({item:t}){if(t.connectorPanel)return e.jsx(Vt,{panel:t.connectorPanel});if(t.schemaSections)return e.jsx(M,{item:t});if(t.recordField)return e.jsx(bt,{target:t.recordField});if(t.recordPeer)return e.jsx(Nt,{target:t.recordPeer});if(t.recordLinks)return e.jsx(rs,{target:t.recordLinks});if(t.workStretch)return e.jsx(as,{...t.workStretch});if(typeof t.browserUrl=="string"&&t.browserUrl.length>0)return e.jsx(X,{item:t});const s=t.href?Ve(t.href):null;return s?s.kind==="memory"?"runId"in s?e.jsxs(e.Fragment,{children:[e.jsx(oe,{owner:s.owner,runId:s.runId}),e.jsx(U,{title:"What it produced",children:e.jsx(O,{owner:s.owner,runId:s.runId})}),e.jsx(ce,{owner:s.owner,runId:s.runId})]}):"runIds"in s?e.jsx(O,{owner:s.owner,runIds:s.runIds}):e.jsx(O,{owner:s.owner,contentIds:s.contentIds}):s.kind==="entity"?e.jsx(Jt,{owner:s.owner,path:s.path}):s.kind==="entity-type"?e.jsx(ts,{owner:s.owner,typeSlug:s.typeSlug,view:s.view}):s.kind==="record-view"?e.jsx(is,{owner:s.owner,path:s.path,viewKey:s.viewKey}):s.kind==="event"?e.jsx(ss,{owner:s.owner,eventId:s.eventId,viewKey:s.viewKey}):s.kind==="feed"?e.jsx(ns,{owner:s.owner,feedId:s.feedId,semanticTypes:s.semanticTypes}):s.kind==="agent"?e.jsx(Zt,{owner:s.owner,name:t.title,agentId:s.agentId,clientIds:s.clientIds}):t.runId?e.jsx(os,{owner:s.owner,automationId:s.automationId,runId:t.runId}):e.jsx(cs,{owner:s.owner,automationId:s.automationId}):e.jsx(X,{item:t})}function X({item:t}){const s=t.body,r=t.notificationType??"generic",n=t.createdAt,i=t.browserUrl??null,o=t.browserHandoff??null;return e.jsxs("article",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(We,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:qe(r)}),n?e.jsx("span",{children:Ge(n)}):null]})]}),s?e.jsx("div",{className:"text-sm leading-6 text-foreground/90",children:e.jsx(Qe,{text:s,linkPolicy:r==="action_approval_needed"?"app-links":"strip"})}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No additional details were provided."}),t.owner&&t.sourceAttribution?e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground/80",children:"Generated from"}),e.jsx(Ye,{owner:t.owner,source:t.sourceAttribution,className:"text-xs"})]}):null,i?e.jsx("div",{className:"space-y-2",children:o?.state==="expired"?e.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:o.error_message??"This draft expired before the page was opened."}):o?.state==="completed"||o?.state==="preparing"?e.jsx("p",{className:"text-sm text-muted-foreground",children:o.state==="preparing"?"Preparing draft — keep your browser tab open.":"Draft prepared — review and post in your browser."}):e.jsxs(k,{type:"button",size:"sm",className:"h-8 text-sm",onClick:()=>{Je(i)},children:[e.jsx(Ze,{className:"mr-1.5 h-3.5 w-3.5"}),"Open post"]})}):null]})}function U({title:t,children:s}){return e.jsxs("section",{"aria-label":t,className:"border-b",children:[e.jsx("h2",{className:"px-4 pt-4 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t}),s]})}function ce({owner:t,runId:s}){return t==="me"?null:e.jsx("div",{className:"px-4 py-3",children:e.jsxs(H,{to:"/$owner/events",params:{owner:t},search:{run_ids:String(s)},className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Open in Activity",e.jsx(Xe,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]})})}function os({owner:t,automationId:s,runId:r}){const{organizationId:n}=re(t),i=ie(s,void 0,n),o=et(i.data?.automation);return e.jsxs(e.Fragment,{children:[e.jsx(oe,{owner:t,runId:r}),e.jsx(U,{title:"What it produced",children:e.jsx(O,{owner:t,runId:r})}),o?e.jsx(U,{title:"How it ran",children:e.jsx(Ut,{agentId:o,automationId:s,ownerSlug:t,runId:r})}):i.isLoading?e.jsx($,{className:"m-4 h-24 rounded-lg"}):null,e.jsx(ce,{owner:t,runId:r})]})}function cs({owner:t,automationId:s}){const{organizationId:r}=re(t),n=ie(s,void 0,r),i=tt(t,s,n.data?.automation);return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[e.jsx(st,{runNow:i}),e.jsx(nt,{owner:t,agentId:null,automationId:s,view:"activity",onDone:()=>{}})]})}export{tn as PeekPaneContent};
|
|
2
|
-
//# sourceMappingURL=peek-pane-content-CEsDVScl.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{hU as f,hq as w,hr as y,r as C,j as e,a8 as N,B as d,Z as P,fj as k}from"./index-BoqrvLHQ.js";import{b as A}from"./runs-k2NpbZm8.js";function q({resource:g,runId:r,children:h,onDone:l}){const c=!!r,{data:a,isLoading:E,isError:u,refetch:v}=A(g,c?r:void 0),s=f({isReview:c,isError:u,status:a?.status}),m=a?.status==="pending"?a.proposal:null,n=w(),i=y(),[p,j]=C.useState(""),o=n.isPending||i.isPending,x=s==="active"||s==="loading"||s==="error",b=()=>{r&&n.mutate({run_id:r},{onSuccess:()=>l?.()})},R=()=>{if(!r)return;const t=p.trim();i.mutate({run_id:r,...t?{reason:t}:{}},{onSuccess:()=>l?.()})};return e.jsxs("div",{className:"grid content-start gap-4",children:[s==="active"?e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review the change the builder agent proposed. Compare Current and Proposed, then ",e.jsx("strong",{children:"Approve"})," to apply, or"," ",e.jsx("strong",{children:"Reject"}),"."]})]})}):null,s==="gone"?e.jsx("div",{className:"rounded-lg border bg-muted/30 p-3 text-sm text-muted-foreground",children:"This change is no longer pending (it may have been approved or rejected already)."}):null,s==="error"?e.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-destructive",children:"Couldn't load the proposed change to review. Editing is disabled until it loads — retry, or reopen the link."}),e.jsx(d,{type:"button",variant:"outline",size:"sm",onClick:()=>void v(),children:"Retry"})]})}):null,h({reviewMode:s,proposal:m,controlsDisabled:x}),s==="active"?e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"review-reject-reason",children:"Reason (optional)"}),e.jsx(k,{id:"review-reject-reason",rows:2,value:p,onChange:t=>j(t.target.value),placeholder:"Why you're rejecting — shared back to the requester.",disabled:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[e.jsx(d,{type:"button",variant:"outline",onClick:R,disabled:o,children:i.isPending?"Rejecting...":"Reject"}),e.jsx(d,{type:"button",onClick:b,disabled:o,children:n.isPending?"Approving...":"Approve"})]})]}):null]})}export{q as P};
|
|
2
|
-
//# sourceMappingURL=proposal-review-shell-C8ZfIAYn.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as s,j as c}from"./index-BoqrvLHQ.js";function u(){const o=new Map,e=new Set,n=()=>{for(const t of e)t()};return{get:t=>o.get(t),set:t=>{o.get(t.entity.id)!==t&&(o.set(t.entity.id,t),n())},remove:t=>{o.delete(t)&&n()},subscribe:t=>(e.add(t),()=>e.delete(t))}}const r=s.createContext(null);function d({children:o}){const[e]=s.useState(u);return c.jsx(r.Provider,{value:e,children:o})}function f(o){const e=s.useContext(r);s.useLayoutEffect(()=>{e?.set(o)});const n=o.entity.id;s.useEffect(()=>()=>e?.remove(n),[e,n])}const i=()=>()=>{};function S(o){const e=s.useContext(r);return s.useSyncExternalStore(e?.subscribe??i,()=>e?.get(o),()=>e?.get(o))}export{d as R,f as a,S as u};
|
|
2
|
-
//# sourceMappingURL=record-session-BrM9cdXu.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{fQ as M,fR as w,fS as k,fE as $,r as h,j as n,m as j,bc as S,em as A,al as E,B as I,ea as L,M as C,cJ as D,L as _,eY as T}from"./index-BoqrvLHQ.js";import{a as Y}from"./list-skeleton-CH0qQBYk.js";import{s as F}from"./subDays-9s9OEl5t.js";import{u as O}from"./use-automations-DfBtVzGa.js";import{u as z}from"./clients-Bf7ZgGro.js";function B(e,s){return M(k(e,e),w(e))}function V(e,s){return $(k(e,e),w(e))}function q(e,s){return $(k(e,e),F(w(e),1))}function J({onIntersect:e,onLeave:s,enabled:t,rootMargin:r="400px"}){const a=h.useRef(null),o=h.useRef(e);o.current=e;const u=h.useRef(s);return u.current=s,h.useEffect(()=>{const c=a.current;if(!c||!t)return;const f=new IntersectionObserver(l=>{l[0]?.isIntersecting?o.current():u.current?.()},{rootMargin:r});return f.observe(c),()=>f.disconnect()},[t,r]),a}function Q({groupByDate:e=!0}){return n.jsx("div",{role:"status","aria-label":"Loading activity","aria-busy":"true",children:n.jsxs("div",{"aria-hidden":"true",children:[e?n.jsx("div",{className:"px-3 pb-2",children:n.jsx(j,{className:"h-4 w-28 rounded-none"})}):null,["first","second","third","fourth","fifth"].map(s=>n.jsxs("div",{className:"flex items-start gap-3 px-3 py-3",children:[n.jsx(j,{className:"h-8 w-8 shrink-0 rounded-none"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[n.jsx(j,{className:"h-4 w-3/5 max-w-sm rounded-none"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx(j,{className:"h-3 w-20 rounded-none"}),n.jsx(j,{className:"h-3 w-12 rounded-none"})]})]})]},s))]})})}function R(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:L(s,"d MMMM yyyy")}function U(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:V(s)?"Today":q(s)?"Yesterday":L(s,B(s)?"d MMM":"d MMM yyyy")}function W({items:e}){const s=[];for(const t of e){const r=U(t.occurredAt)??"Undated",a=s.at(-1);a?.day===r?a.items.push(t):s.push({day:r,items:[t]})}return n.jsx(n.Fragment,{children:s.map(({day:t,items:r},a)=>n.jsxs("section",{"aria-label":t,className:"min-w-0",children:[n.jsx("div",{className:a===0?"px-1 pb-1.5":"px-1 pt-4 pb-1.5",children:n.jsx("h2",{className:"text-sm font-semibold",children:t})}),n.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:r.map(o=>n.jsx("li",{children:o.content},o.key))})]},`${t}:${a}`))})}const X=3;function se({items:e,isLoading:s,emptyState:t,hasNextPage:r,isFetching:a,isFetchingNextPage:o,onLoadMore:u,autoLoadMore:c=!0,groupByDate:f=!0,rows:l=!1}){const[y,x]=h.useState(0),g=y>=X,b=J({onIntersect:()=>{x(i=>i+1),u()},onLeave:()=>x(0),enabled:c&&r&&!a&&!g}),N=()=>{x(0),u()};return s&&e.length===0?l?n.jsx("div",{role:"status","aria-label":"Loading activity",className:"divide-y overflow-hidden rounded-lg border",children:[0,1,2,3].map(i=>n.jsx(Y,{},i))}):n.jsx(Q,{groupByDate:f}):n.jsxs("div",{children:[e.length===0?r?null:t!==void 0?t:n.jsx(S,{icon:A,title:"Nothing here yet",description:"No events match this view."}):l?n.jsx(W,{items:e}):e.map((i,m)=>{const p=R(i.occurredAt),v=m>0?R(e[m-1].occurredAt):null;return n.jsxs(h.Fragment,{children:[f&&p&&p!==v&&n.jsx("p",{className:"px-3 pb-2 pt-4 text-xs text-muted-foreground first:pt-0",children:p}),n.jsx("div",{className:"mb-1",children:i.content})]},i.key)}),n.jsx("div",{ref:b,className:"h-1"}),o?n.jsx("div",{role:"status","aria-label":"Loading earlier activity",className:"flex justify-center py-3",children:n.jsx(E,{className:"text-muted-foreground"})}):r?c?g?n.jsx("div",{className:"flex justify-center py-3",children:n.jsx(I,{variant:"link",size:"sm",className:"h-auto p-0 text-xs font-normal text-muted-foreground",disabled:a,onClick:N,children:"Show earlier activity"})}):null:n.jsx(I,{size:"sm",variant:"outline",className:l?"mt-3":void 0,disabled:a,onClick:N,children:"Load more"}):null]})}function G(e,s,t){return e?.kind==="agent_session"&&e.agent_id?e.client_id?`${e.agent_id} via ${e.client_id}`:e.agent_id:e?.kind==="user"?"a person":s==="agent"?"an agent":t?`Automation ${t}`:"an Automation"}function ne({ownerSlug:e,initiator:s,clientName:t,fallback:r}){const a=s?.client_id??t,{allOrgs:o,isAuthenticated:u}=C(),c=u&&o?.some(d=>d.slug===e),l=z(void 0,{ownerSlug:e,enabled:!!(a&&c)}).data?.find(d=>d.id===a)?.title,y=c?o.find(d=>d.slug===e)?.id:void 0,x=s?.kind==="automation"&&s.automation_id?String(s.automation_id):void 0,b=O(x?y:void 0,void 0,{includeDetails:!1}).data?.find(d=>d.automation_id===x)?.name,{members:N}=D(s?.kind==="user"&&s.user_id?y:void 0),i=N.find(d=>d.userId===s?.user_id)?.user.name,m=s&&s.kind!=="user"?b??G(s,void 0,s.automation_id===void 0?void 0:String(s.automation_id)):i??r,p="font-medium text-foreground",v=`${p} underline-offset-4 hover:underline`;return s?.kind==="automation"&&s.automation_id?n.jsx(_,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:String(s.automation_id)},search:{view:"definition",run_id:void 0},className:v,children:m}):s?.kind==="agent_session"&&s.agent_id?n.jsx(_,{to:"/$owner/agents/$agentId",params:{owner:e,agentId:String(s.agent_id)},className:v,children:m}):a?n.jsxs(_,{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:a},className:`${v} inline-flex items-center gap-1 align-middle`,children:[n.jsx(T,{name:l??t??a}),l??m]}):n.jsx("span",{className:p,children:m})}export{Q as E,ne as R,se as a,B as b,V as i,G as p};
|
|
2
|
-
//# sourceMappingURL=run-initiator-BKSgI1o0.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ge as l,dL as r,z as d,dM as g,af as f,gf as I}from"./index-BoqrvLHQ.js";const m=30,s=new Set(["running","pending","claimed"]);function y(n){return"workspace"in n?["workspace"]:"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function _(n){return"workspace"in n?{}:"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function T(n,e,t){return l({queryKey:["runs-infinite",t??null,n?y(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:a})=>{const i=a;return r("manage_operations",{action:"list_runs",..._(n),...e.runTypes&&e.runTypes.length>0?{run_types:e.runTypes}:{},...e.status?{status:e.status}:{},...e.automationIds?.length?{automation_ids:e.automationIds}:{},...e.connectionIds?.length?{connection_ids:e.connectionIds}:{},...e.feedIds?.length?{feed_ids:e.feedIds}:{},...i?{before_id:i.before_id,before_created_at:i.before_created_at}:{},limit:m},t?{slug:t}:void 0)},initialPageParam:null,getNextPageParam:a=>{if(!a.has_more)return;const i=a.runs[a.runs.length-1];if(i)return{before_id:i.id,before_created_at:i.created_at}},refetchInterval:a=>(a.state.data?.pages??[]).some(u=>u.runs.some(c=>s.has(c.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function h(n){return s.has(n??"")}function b(n,e){return d({queryKey:["run-outcome",n,e],queryFn:async()=>{const t=await r("manage_operations",{action:"get_run",run_id:e},{slug:n});if(!t.run)throw new Error(t.error||"Run not found");return t.run},enabled:n!=="me",staleTime:15e3,refetchInterval:t=>h(t.state.data?.status)?5e3:!1})}function p(n,e){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${e}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${e}`:null}function K(n,e){const{slug:t}=g(),a=e!=null?p(n,e):null,i=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return d({queryKey:["pending-proposal",t,...i,e],queryFn:async()=>{const o=await f(I(t,a),{credentials:"include"});if(o.status===404)return{status:"gone"};if(!o.ok)throw new Error(`Failed to fetch pending proposal: ${o.status}`);return{status:"pending",proposal:await o.json()}},enabled:!!t&&!!a&&!!e,staleTime:0,retry:!1})}export{b as a,K as b,h as i,T as u};
|
|
2
|
-
//# sourceMappingURL=runs-k2NpbZm8.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as t,B as k,L as v,d9 as B,i as h,dE as F,dF as D,dG as E,hV as M,hW as A,u as I,hX as p,hY as V,bf as y,bk as w,fa as K,r as x,aE as b,aF as N,aH as $,fe as P,as as z,al as O,hZ as U,h_ as G,h$ as _,bg as J,C as W,ea as X}from"./index-BoqrvLHQ.js";import{R as Y,a as q}from"./run-initiator-BKSgI1o0.js";function H(e,s){switch(s.kind){case"connection":return A(e,s.id);case"feed":return M(e,s.id);case"run":return{to:"/$owner/events",params:{owner:e},search:{run_ids:String(s.id)}}}}function Q({ownerSlug:e,scope:s,variant:n="outline",iconOnly:i=!1,label:o,className:c,title:a}){const l=H(e,s),r=a??o??"View in memory",u=t.jsx(k,{asChild:!0,variant:n,size:i?"icon":"sm",className:h(i&&"h-7 w-7",c),children:t.jsxs(v,{to:l.to,params:l.params,search:l.search,children:[t.jsx(B,{className:h("h-3.5 w-3.5",!i&&"mr-1.5")}),!i&&(o??"View in memory")]})});return i?t.jsxs(F,{children:[t.jsx(D,{asChild:!0,children:u}),t.jsx(E,{children:r})]}):u}function Z({status:e}){return e==="completed"?t.jsx(P,{className:"h-4 w-4 text-green-500"}):e==="failed"?t.jsx(z,{className:"h-4 w-4 text-destructive"}):e==="running"?t.jsx(O,{className:"text-blue-500"}):t.jsx(U,{className:"h-4 w-4 text-muted-foreground"})}const ee={completed:"Completed",failed:"Failed",running:"Running",pending:"Queued",claimed:"Starting",timeout:"Timed out",cancelled:"Cancelled"};function C(e){const s=e.split("_").join(" ");return s.charAt(0).toUpperCase()+s.slice(1)}function te({error:e}){const[s,n]=x.useState(!1);return e.length<=80?t.jsx("span",{className:"text-destructive",children:e}):t.jsxs(b,{open:s,onOpenChange:n,children:[t.jsx(N,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-left text-destructive hover:underline",children:e})}),t.jsx($,{className:"max-h-64 w-96 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs text-destructive",children:e})})]})}function se({checkpoint:e}){return t.jsxs(b,{children:[t.jsx(N,{asChild:!0,children:t.jsx(k,{variant:"ghost",size:"icon",title:"Checkpoint","aria-label":"Checkpoint",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground",children:t.jsx(G,{className:"h-4 w-4","aria-hidden":"true"})})}),t.jsx($,{className:"max-h-64 w-80 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs",children:JSON.stringify(e,null,2)})})]})}function R(e){if(e.initiator_kind)return{kind:e.initiator_kind,...e.initiator_ref};if(e.automation_id)return{kind:"automation",automation_id:e.automation_id};if(e.created_by_user_id)return{kind:"user",user_id:e.created_by_user_id}}function ne({run:e,ownerSlug:s}){const n=R(e);return n?n.kind==="system"?t.jsx(t.Fragment,{children:"by the system"}):t.jsxs(t.Fragment,{children:["by"," ",t.jsx(Y,{ownerSlug:s,initiator:n,clientName:void 0,fallback:"a person"})]}):null}function ae({parts:e}){return t.jsx(t.Fragment,{children:e.map(([s,n],i)=>t.jsxs(x.Fragment,{children:[i>0?" · ":"",n]},s))})}function j(e,s){return[e.run_type?C(e.run_type):"Run",s.connection?e.connection_display_name:null,s.feed?e.feed_display_name??e.feed_key:null].filter(Boolean).join(" · ")}const ie=3;function g(e,s){const n=p(e.created_at);return e.status==="completed"&&n!=null?`${j(e,s)}|${X(n,"yyyy-MM-dd")}`:null}function re(e,s){const n=new Map;for(const c of e){const a=g(c,s);a&&n.set(a,[...n.get(a)??[],c])}const i=[],o=new Set;for(const c of e){const a=g(c,s),l=a?n.get(a):void 0;!a||!l||l.length<ie?i.push({kind:"run",run:c}):o.has(a)||(o.add(a),i.push({kind:"group",name:j(c,s),runs:l}))}return i}function oe({name:e,runs:s,ownerSlug:n,columns:i}){const[o,c]=x.useState(!1),a=p(s[0].created_at),l=p(s[s.length-1].created_at),r=Date.now(),u=s.reduce((m,T)=>m+(T.items_collected??0),0),d=l!=null?_(l,r):null,f=a!=null?_(a,r):null,S=d&&f&&d!==f?`${d}–${f}`:f;return t.jsxs("div",{children:[t.jsx("button",{type:"button","aria-expanded":o,onClick:()=>c(m=>!m),className:h(w,"rounded-lg transition-colors hover:bg-accent/40"),children:t.jsx(y,{mark:t.jsx(W,{"aria-hidden":"true",className:h("h-4 w-4 text-muted-foreground transition-transform",o&&"rotate-90")}),name:e,details:t.jsx(J,{parts:[`${s.length} runs`,S,"all completed",u>0?`${u} ${u===1?"item":"items"}`:null]}),at:a})}),o?t.jsx("div",{className:"ml-6 border-l pl-2",children:s.map(m=>t.jsx("div",{className:"mb-1",children:t.jsx(L,{run:m,ownerSlug:n,columns:i})},m.id))}):null]})}function L({run:e,ownerSlug:s,columns:n={}}){const i=I(),o=p(e.created_at),c=p(e.completed_at),a=o!=null&&c!=null?Math.round((c-o)/1e3):null,l=j(e,n),r=n.startedBy&&R(e)?t.jsx(ne,{run:e,ownerSlug:s}):null,u=[["status",ee[e.status]??C(e.status)],e.error_message?["error",t.jsx(te,{error:e.error_message},"error")]:null,e.items_collected!=null&&(e.run_type==="sync"||e.items_collected>0)?["items",`${e.items_collected} ${e.items_collected===1?"item":"items"}`]:null,a!=null?["duration",V(a)]:null,r?["by",r]:null,e.connector_version?["version",`v${e.connector_version}`]:null,["id",`#${e.id}`]].filter(d=>d!==null);return t.jsxs("article",{"aria-label":`Run #${e.id}`,title:K(e.created_at),className:"group relative flex items-center rounded-lg transition-colors hover:bg-accent/40",children:[t.jsx("div",{className:h(w,"min-w-0 flex-1"),children:t.jsx(y,{mark:t.jsx(Z,{status:e.status}),name:t.jsx(v,{to:"/$owner/events",params:{owner:s},search:{run_ids:String(e.id)},"aria-label":`${l} · Run #${e.id}`,className:"hover:underline",onClick:d=>{!i||d.button!==0||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||(d.preventDefault(),i.open({href:e.run_type==="automation"&&e.automation_id!=null?`/${s}/automations/${e.automation_id}?view=activity&run_id=${e.id}`:`/${s}/events?run_ids=${e.id}`,title:`Run #${e.id}`,runId:e.id}))},children:l}),tone:e.status==="failed"||e.status==="timeout"?"destructive":null,details:t.jsx(ae,{parts:u}),at:o,atClassName:"group-hover:invisible group-focus-within:invisible"})}),t.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",children:[e.checkpoint?t.jsx(se,{checkpoint:e.checkpoint}):null,t.jsx(Q,{ownerSlug:s,scope:{kind:"run",id:e.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})]})]})}function de({runs:e,ownerSlug:s,columns:n={},emptyState:i,hasNextPage:o=!1,isFetching:c=!1,isFetchingNextPage:a=!1,onLoadMore:l=()=>{}}){return t.jsx(q,{items:re(e,n).map(r=>r.kind==="run"?{key:String(r.run.id),occurredAt:r.run.created_at,content:t.jsx(L,{run:r.run,ownerSlug:s,columns:n})}:{key:`group:${r.runs[0].id}`,occurredAt:r.runs[0].created_at,content:t.jsx(oe,{name:r.name,runs:r.runs,ownerSlug:s,columns:n})}),isLoading:!1,emptyState:i,hasNextPage:o,isFetching:c,isFetchingNextPage:a,onLoadMore:l})}export{L as R,Q as V,de as a};
|
|
2
|
-
//# sourceMappingURL=runs-list-DUXRMkWN.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as i,ea as w,i as L,L as A,gb as D,gc as $}from"./index-BoqrvLHQ.js";const U=/^\d{4}-\d{2}-\d{2}(?:[tT ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,O=/^\d{4}-\d{2}-\d{2}$/;function T(t){return U.test(t)}function S(t){if(!/^https?:\/\//i.test(t))return!1;try{const r=new URL(t);return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}}function N(t){return t.replace(/[-_]/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}function p(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:t>=1e3?"compact":"standard",maximumFractionDigits:t>=1e9?1:0}).format(t)}function g(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function h(t){const r=new Date(O.test(t)?`${t}T00:00:00`:t);return Number.isNaN(r.getTime())?t:r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function b(t){try{const r=new URL(t),n=r.hostname.replace(/^www\./i,""),e=r.pathname&&r.pathname!=="/"?r.pathname.replace(/\/$/,""):"";return`${n}${e}`}catch{return t}}function m(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(d(t)):Array.isArray(t)?t.some(r=>typeof r=="object"&&r!==null)?t.map((r,n)=>`${n+1}. ${m(r)}`).join(`
|
|
2
|
-
`):JSON.stringify(t):typeof t=="object"?Object.entries(t).filter(([,n])=>n!=null&&n!=="").map(([n,e])=>`${N(n)}: ${m(e)}`).join("; "):JSON.stringify(t)}function d(t,r){if(t==null)return"";if(typeof t=="boolean")return t?"Yes":"No";if(typeof t=="number")return r==="currency"?p(t):r===void 0||r==="text"?String(t):g(t);if(typeof t!="string")return m(t);switch(r){case"currency":return p(Number(t));case"date":return h(t);case"url":return b(t);case"enum":return N(t);case"number":return g(Number(t));case"auto":return S(t)?b(t):T(t)?h(t):t;default:return t}}function E(t){return t==null?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):null}function R(t,r){return typeof t!="string"||!t.startsWith("@")||t.length===1?null:{action:t.slice(1),value:E(r)}}function k(t){return i.jsx("a",{...t})}const F=/^\d{4}-\d{2}-\d{2}$/;function I(t){if(F.test(t)){const[r,n,e]=t.split("-").map(Number),s=new Date(0);return s.setHours(0,0,0,0),s.setFullYear(r,n-1,e),s}return new Date(t)}function C(t,r){const n=I(t);return Number.isNaN(n.getTime())?t:r?n.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):w(n,"LLL dd, y")}function x(t){return t?t["x-currency"]||t.format==="currency"?"currency":t.format==="uri"||t.format==="url"?"url":t.enum?.length?"enum":t.type==="number"||t.type==="integer"?"number":t.type==="boolean"?"boolean":"auto":"auto"}function j(t){return t==null||t===""||Array.isArray(t)&&t.length===0}function V(t){return Array.isArray(t)&&t.some(r=>typeof r=="object"&&r!==null)}function _(t,r,n){const e=$(r,t);return e!==void 0?e:typeof t=="string"&&(r?.format==="date"||r?.format==="date-time")?C(t,r.format==="date-time"):d(t,n)}function y(t,r){return!r||t===null||typeof t!="object"?t:Array.isArray(t)?t.map(n=>y(n,r.items)):Object.fromEntries(Object.entries(t).filter(([n])=>!D(r.properties?.[n])).map(([n,e])=>[n,y(e,r.properties?.[n])]))}function l({value:t,prop:r,format:n,resolveLink:e,className:s}){const c=String(t),o=e?.(c);if(o)return i.jsx(A,{to:o.to,className:"text-primary hover:underline",onClick:a=>a.stopPropagation(),children:o.label});const u=typeof t=="string"&&S(t),f=n==="url"&&!u?c:_(t,r,n);return u?i.jsx(k,{href:t,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline [overflow-wrap:anywhere]",onClick:a=>a.stopPropagation(),children:f}):i.jsx("span",{className:s,children:f})}function Y({value:t,prop:r,format:n,resolveLink:e,empty:s="-",className:c}){if(j(t))return i.jsx("span",{className:"text-muted-foreground",children:s});if(V(t)){const o=t.length;return i.jsxs("span",{className:c,children:[o," ",o===1?"item":"items"]})}if(Array.isArray(t)){const o=t.filter(f=>!j(f)),u=r?.items??r;return i.jsx("span",{className:L("inline-flex flex-wrap gap-x-1",c),children:o.map((f,a)=>i.jsxs("span",{children:[i.jsx(l,{value:f,prop:u,format:n??x(u),resolveLink:e}),a<o.length-1&&","]},`${a}:${String(f)}`))})}return typeof t=="object"?i.jsx("span",{className:c,children:d(y(t,r))}):i.jsx(l,{value:t,prop:r,format:n??x(r),resolveLink:e,className:c})}export{Y as S,C as a,d as f,S as i,I as p,R as t};
|
|
3
|
-
//# sourceMappingURL=schema-value-wjqGxXhv.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{H as l,j as e,B as t,L as i,T as c,at as o,au as d}from"./index-BoqrvLHQ.js";import{F as m}from"./full-page-spinner-CtVlF8GQ.js";function h(){const{session:a,isReady:n}=l();if(!n)return e.jsx(m,{});if(!a?.user)return e.jsxs("div",{className:"mx-auto w-full max-w-md space-y-4 px-4 py-8 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Account settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Sign in to view your profile and account details."}),e.jsx(t,{asChild:!0,children:e.jsx(i,{to:"/auth/login",search:c({intent:"sign-in",callbackUrl:"/account/settings"}),children:"Sign in"})})]});const{user:s}=a,r=s.name?.trim()||"User";return e.jsx(o,{className:"py-8",children:e.jsxs(d,{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Account settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your personal profile and sign-in details."})]}),e.jsxs("section",{"aria-labelledby":"account-profile-heading",className:"space-y-5 border-b border-border pb-8",children:[e.jsx("h2",{id:"account-profile-heading",className:"text-sm font-medium",children:"Profile"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[s.image?e.jsx("img",{src:s.image,alt:"",referrerPolicy:"no-referrer",className:"h-12 w-12 shrink-0 rounded-full object-cover"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-muted text-lg font-medium",children:(s.name?.trim()||s.email||"U").charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"break-words font-medium",children:r}),e.jsx("p",{className:"break-all text-sm text-muted-foreground",children:s.email})]})]}),e.jsxs("details",{className:"space-y-3",children:[e.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Account details"}),e.jsxs("dl",{className:"space-y-1 text-sm",children:[e.jsx("dt",{className:"text-muted-foreground",children:"User ID"}),e.jsx("dd",{className:"break-all font-mono text-xs",children:s.id})]})]})]}),e.jsxs("section",{"aria-labelledby":"account-session-heading",className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{id:"account-session-heading",className:"text-sm font-medium",children:"Session"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."})]}),e.jsx(t,{variant:"outline",asChild:!0,children:e.jsx(i,{to:"/auth/logout",children:"Sign out"})})]})]})})}export{h as component};
|
|
2
|
-
//# sourceMappingURL=settings-V0m5Om5j.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{M as j,z as _,f$ as C,j as e,B as N,g0 as F,m as L,K as E,L as $,fu as w,Q as S}from"./index-BoqrvLHQ.js";import{a as P,R as A,b as M}from"./events-feed-DcKTkJVe.js";import{a as k}from"./run-initiator-BKSgI1o0.js";function b(r){return{failed:r.filter(i=>i.code!=="withheld"),withheld:[...new Set(r.filter(i=>i.code==="withheld").map(i=>i.error))]}}function v({reasons:r}){return r.length===0?null:e.jsx("div",{className:"space-y-1",children:r.map(i=>e.jsx("p",{className:"text-xs text-muted-foreground",children:i},i))})}function y({failures:r,onRetry:i,isError:c=!1,isFetching:d=!1}){return r.length===0&&!c?null:e.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-3 rounded-md border border-destructive/40 px-3 py-2 text-xs",children:[e.jsxs("span",{children:[r.length<=1?"A source":`${r.length} sources`," could not be read, so some items may be missing."]}),e.jsx(N,{size:"sm",variant:"outline",className:"h-7",onClick:i,disabled:d,children:"Retry"})]})}function q({record:r,orgContext:i,filters:c}){const{orgContext:d}=j(),s=i??d,{data:m}=_({queryKey:["connector-definitions","source-record",s.organizationId,s.slug],queryFn:()=>S(s),enabled:!!(s.organizationId||s.slug),staleTime:6e4}),{data:n,isLoading:h,isError:a,refetch:g,fetchNextPage:l,hasNextPage:p,isFetching:x,isFetchingNextPage:u}=C(r,s,c),f=n?.pages.flatMap(o=>o.events)??[],{failed:t,withheld:R}=b(n?.pages.flatMap(o=>o.failures)??[]);return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(y,{failures:t,isError:a,isFetching:x,onRetry:()=>void g()}),e.jsx(v,{reasons:R}),e.jsx(k,{isLoading:h,hasNextPage:!!p&&!a,autoLoadMore:t.length===0,isFetching:x,isFetchingNextPage:u,onLoadMore:()=>void l(),emptyState:a||t.length>0||p?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:f.map(o=>({key:`${o.feed_id}:${o.origin_id}`,occurredAt:o.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx(P,{ownerSlug:s.slug,connectorDefinitions:m,content:{...o,title:o.title||o.origin_type||o.origin_id,text_content:o.payload_text??""}})})}))})]})}function K({record:r,ownerSlug:i,orgContext:c}){const{orgContext:d}=j(),{data:s,isLoading:m,isError:n,refetch:h,hasNextPage:a,fetchNextPage:g,isFetching:l,isFetchNextPageError:p,error:x}=F(r,c??d);if(m)return e.jsx(L,{className:"h-12 w-full rounded-lg"});if(!s)return e.jsx(y,{failures:[],isError:!0,isFetching:l,onRetry:()=>void h()});const{failed:u,withheld:f}=b(s.failures);return e.jsxs("div",{className:"space-y-2",children:[e.jsx(A,{count:s.relationshipFailures?.length??0,onRetry:()=>void h()}),e.jsx(y,{failures:u,isError:n,isFetching:l,onRetry:()=>{if(l)return;const t=x instanceof E&&x.status===400;p&&!t||!n&&a?g():h()}}),e.jsx(v,{reasons:f}),s.links.length===0&&(s.relationships?.length??0)===0&&u.length===0&&(s.relationshipFailures?.length??0)===0&&!a&&!n&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),s.links.length===0&&(s.relationships?.length??0)===0&&a&&!n&&u.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsxs("ul",{className:"space-y-1",children:[(s.relationships??[]).map(t=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx(M,{row:t,entityId:r.key,entityType:r.type,ownerSlug:i,orgContext:c??d})},`authored:${t.id}`)),s.links.map(t=>e.jsx("li",{children:e.jsx($,{to:w(i,[{entity_type:t.entity_type,slug:t.key}]),className:"flex items-center justify-between rounded-lg border px-3 py-2 text-sm hover:bg-muted/50",children:e.jsxs("span",{children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.relationship_type.replaceAll("_"," "),t.direction==="incoming"?" (from)":""," ·"," ",t.entity_type," ·"," "]}),t.name]})})},`${t.relationship_type}:${t.direction}:${t.entity_type}:${t.key}`))]}),a&&!n&&u.length===0&&e.jsx(N,{variant:"outline",size:"sm",disabled:l,onClick:()=>void g(),children:l?"Loading…":"Load more"})]})}export{q as S,K as a};
|
|
2
|
-
//# sourceMappingURL=source-record-panels-BMut9YIA.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,j as l,i as o}from"./index-BoqrvLHQ.js";const r=t.forwardRef(({className:e,...a},s)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:s,className:o("w-full caption-bottom text-sm",e),...a})}));r.displayName="Table";const d=t.forwardRef(({className:e,...a},s)=>l.jsx("thead",{ref:s,className:o("[&_tr]:border-b",e),...a}));d.displayName="TableHeader";const c=t.forwardRef(({className:e,...a},s)=>l.jsx("tbody",{ref:s,className:o("[&_tr:last-child]:border-0",e),...a}));c.displayName="TableBody";const b=t.forwardRef(({className:e,...a},s)=>l.jsx("tr",{ref:s,className:o("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));b.displayName="TableRow";const m=t.forwardRef(({className:e,...a},s)=>l.jsx("th",{ref:s,className:o("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));m.displayName="TableHead";const i=t.forwardRef(({className:e,...a},s)=>l.jsx("td",{ref:s,className:o("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));i.displayName="TableCell";export{r as T,d as a,b,m as c,c as d,i as e};
|
|
2
|
-
//# sourceMappingURL=table-ZuYMOjVR.js.map
|