@objectstack/console 17.0.0 → 17.2.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/CHANGELOG.md +452 -0
- package/dist/.objectstack-injection.json +13 -0
- package/dist/.objectui-sha +1 -1
- package/dist/assets/AdapterProvider-gULVLpjV.js +3 -0
- package/dist/assets/AiPendingActionsPage-CyG11hX9.js +1 -0
- package/dist/assets/ApiConsolePage-DYuOp_W4.js +1 -0
- package/dist/assets/AppDocsIndex-BXkNskk1.js +1 -0
- package/dist/assets/AppManagementPage-BvSxDdA_.js +1 -0
- package/dist/assets/ApprovalsInboxPage-oep3a-Ek.js +1 -0
- package/dist/assets/AuditLogPage-BZZ6tzHu.js +1 -0
- package/dist/assets/ComponentNavView-Cq4wkNUa.js +1 -0
- package/dist/assets/DashboardView-C23ZCS2S.js +1 -0
- package/dist/assets/{DeveloperHubPage-DVKVm5k0.js → DeveloperHubPage-KEpKc45V.js} +1 -1
- package/dist/assets/DocPage-Y4rWCZ3E.js +1 -0
- package/dist/assets/{DocShell-C1VQpTIJ.js → DocShell-DMJHUgE5.js} +1 -1
- package/dist/assets/DocsIndex-Bb5OtPb3.js +1 -0
- package/dist/assets/DocsLayout-CoIVTMH_.js +1 -0
- package/dist/assets/DocsSlug-BARWHmXg.js +1 -0
- package/dist/assets/{ExpressionProvider-qmd0nVCn.js → ExpressionProvider-vGLngw8h.js} +1 -1
- package/dist/assets/FlowRunsPage-BeGa9_ge.js +1 -0
- package/dist/assets/{IntegrationsPage-Cq4mWRFh.js → IntegrationsPage-DTXA-Nne.js} +2 -2
- package/dist/assets/InterfaceListPage-BMvedZyV.js +1 -0
- package/dist/assets/{ManagedByBadge-DgsrLolr.js → ManagedByBadge-mKmG0hP7.js} +1 -1
- package/dist/assets/MarketplaceAccessDenied-BBMyNu2w.js +1 -0
- package/dist/assets/{MarketplaceInstalledPage-CRe2BiM2.js → MarketplaceInstalledPage-B4qrvb7w.js} +1 -1
- package/dist/assets/MarketplacePackagePage-BuVfVeBj.js +4 -0
- package/dist/assets/MarketplacePage-Cmltk5nG.js +1 -0
- package/dist/assets/{MetadataInspector-qQ85bFun.js → MetadataInspector-kVAu8vlh.js} +1 -1
- package/dist/assets/MetadataProvider-DyFZSNqq.js +1 -0
- package/dist/assets/{MonacoImpl-DStuouLX.js → MonacoImpl-Cu_-ISwm.js} +1 -1
- package/dist/assets/ObjectDataPage-BKHEYwXA.js +1 -0
- package/dist/assets/PageView-CTqS-VD9.js +1 -0
- package/dist/assets/ProfilePage-CBUxXn5a.js +1 -0
- package/dist/assets/PublicFormsPage-B8Dk8fky.js +1 -0
- package/dist/assets/RecordDetailView-BBNqsNy9.js +11 -0
- package/dist/assets/RecordFormPage-CeUmmc_n.js +1 -0
- package/dist/assets/ReportDefaultInspector-CRjDi2Er.js +3 -0
- package/dist/assets/ReportView-Cwi_Po4H.js +2 -0
- package/dist/assets/SearchResultsPage-Cg0oq2by.js +1 -0
- package/dist/assets/SettingsHub-B5_S9YgI.js +1 -0
- package/dist/assets/SettingsView-Csi1awf-.js +1 -0
- package/dist/assets/SystemHubPage-CnDri9oU.js +1 -0
- package/dist/assets/{abnfDiagram-N423BO3Z-Ck9FUrgJ.js → abnfDiagram-N423BO3Z-DfpQlDUF.js} +1 -1
- package/dist/assets/{architectureDiagram-T3A2C74G-DJbnVK1q.js → architectureDiagram-T3A2C74G-Ej_4n3NG.js} +1 -1
- package/dist/assets/{assistantBus-DNogw1P-.js → assistantBus-DNH-fDWN.js} +1 -1
- package/dist/assets/{blockDiagram-VBNYF7ZC-Qtci47Jq.js → blockDiagram-VBNYF7ZC-l_P_W7_Y.js} +1 -1
- package/dist/assets/{c4Diagram-5PPSVZJV-DC9Uk9FW.js → c4Diagram-5PPSVZJV-CE82HAlO.js} +1 -1
- package/dist/assets/channel-DowAYf9b.js +1 -0
- package/dist/assets/{chunk-2GRJ4B5K-C6KsYuNR.js → chunk-2GRJ4B5K-D1if-ThW.js} +1 -1
- package/dist/assets/chunk-3NCLNEKW-Z5ckM4mG.js +1 -0
- package/dist/assets/{chunk-4I5QYGJK-CPsvNPUx.js → chunk-4I5QYGJK-DlrWrdEa.js} +1 -1
- package/dist/assets/{chunk-5RXB4S5H-CU_v2umt.js → chunk-5RXB4S5H-JwFhdddt.js} +1 -1
- package/dist/assets/{chunk-6Q2QTUOP-C_q0JPmG.js → chunk-6Q2QTUOP-C2vvuHlO.js} +1 -1
- package/dist/assets/{chunk-7Z6QIM7H-jM3JGv9o.js → chunk-7Z6QIM7H-m6s_oalL.js} +1 -1
- package/dist/assets/{chunk-GF5L2VYU-Dp_0e4Vj.js → chunk-GF5L2VYU-Dgjjn2FR.js} +1 -1
- package/dist/assets/{chunk-I66GZJ75-CLtbCU_E.js → chunk-I66GZJ75-BsY3mBMx.js} +1 -1
- package/dist/assets/{chunk-J7OUQ5F2-C4uAdkrD.js → chunk-J7OUQ5F2-Cl4FNR_k.js} +1 -1
- package/dist/assets/{chunk-JQJVKLGR-BlTMFaN6.js → chunk-JQJVKLGR-BApWxqMA.js} +1 -1
- package/dist/assets/{chunk-KBJHAD2P-BJzwVqKy.js → chunk-KBJHAD2P-DI4-lUt-.js} +1 -1
- package/dist/assets/{chunk-NSK5VX7P-B7tNpEbR.js → chunk-NSK5VX7P-BBTxIP6Z.js} +1 -1
- package/dist/assets/{chunk-QR6OTTB3-B3mQWEI2.js → chunk-QR6OTTB3-DJcD7xr-.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-B3DAS_Q-.js → chunk-RYQCIY6F-CnMsR_qh.js} +1 -1
- package/dist/assets/{chunk-UBXNYLIW-Cqb7MpFH.js → chunk-UBXNYLIW-B7z1tp3V.js} +1 -1
- package/dist/assets/{chunk-W5SLKNZC-DWOVkEVc.js → chunk-W5SLKNZC-BnMc5i0B.js} +1 -1
- package/dist/assets/{chunk-WRU74C26-DR5g8owc.js → chunk-WRU74C26-MrzCPX2E.js} +1 -1
- package/dist/assets/chunk-XXDRQBXY-NKBlW2Dm.js +1 -0
- package/dist/assets/classDiagram-JCYQIIEL-C4ADaKBz.js +1 -0
- package/dist/assets/classDiagram-v2-OCEON4UE-C4ADaKBz.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-CcXrYRrs.js → cose-bilkent-JH36ORCC-XP-DnSP5.js} +1 -1
- package/dist/assets/{createDerive-C1PaRnFZ.js → createDerive-B3AGnDaY.js} +1 -1
- package/dist/assets/{cynefinDiagram-MW4NZA55-DuPIOMPB.js → cynefinDiagram-MW4NZA55-B8MvpqXe.js} +1 -1
- package/dist/assets/{dagre-VZM6K2ZE-CHbs07zF.js → dagre-VZM6K2ZE-B5E8-xuM.js} +1 -1
- package/dist/assets/{diagram-7IWD3JNH-sPS-Y-CP.js → diagram-7IWD3JNH-Xj62y5BF.js} +1 -1
- package/dist/assets/{diagram-B4RE2ZJO-C4Essr7L.js → diagram-B4RE2ZJO-mI-iOCGl.js} +1 -1
- package/dist/assets/{diagram-LBJQPF4R-CluEJ_Yg.js → diagram-LBJQPF4R-BMTSoZch.js} +1 -1
- package/dist/assets/{diagram-Q27KOJAE-D4lem9jQ.js → diagram-Q27KOJAE-B98Knrnh.js} +1 -1
- package/dist/assets/{diagram-UB23O5K3-Bfj6mHJD.js → diagram-UB23O5K3-bseKIzhv.js} +1 -1
- package/dist/assets/{dist-D3VfqzjO.js → dist-BK-OswHQ.js} +1 -1
- package/dist/assets/dist-Ck19TqqJ.js +5 -0
- package/dist/assets/{ebnfDiagram-BXEA7PRR-BKXyHLd_.js → ebnfDiagram-BXEA7PRR-Bgo10FP1.js} +1 -1
- package/dist/assets/{erDiagram-JOGREHBK-B6_uGYAF.js → erDiagram-JOGREHBK-BU4b8mUv.js} +1 -1
- package/dist/assets/flowDiagram-UKHOOZJN-BDHHPApJ.js +1 -0
- package/dist/assets/framework-BwfIhdyz.js +55 -0
- package/dist/assets/{ganttDiagram-PKOTCBZU-Cip5kKH4.js → ganttDiagram-PKOTCBZU-CrmKcYGt.js} +1 -1
- package/dist/assets/{getIcon-QmYxLBSb.js → getIcon-1ZXs1v-a.js} +1 -1
- package/dist/assets/{gitGraphDiagram-DS77QQ5N-CF75OjHf.js → gitGraphDiagram-DS77QQ5N-COu0mOui.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-BPV_Giyg.js → highlighted-body-OFNGDK62-CnGKNo0r.js} +1 -1
- package/dist/assets/i18n-rra-09wp.js +9 -0
- package/dist/assets/index-BLepsDd_.js +19 -0
- package/dist/assets/index-D26gl3rg.css +2 -0
- package/dist/assets/{infoDiagram-6WML65LV-IbyJxsv4.js → infoDiagram-6WML65LV-BT0Q6MIs.js} +1 -1
- package/dist/assets/infrastructure-BCTDJsqi.js +3 -0
- package/dist/assets/{ishikawaDiagram-WSZJBQD7-D8FhFMwb.js → ishikawaDiagram-WSZJBQD7-kvPjMvBP.js} +1 -1
- package/dist/assets/{journeyDiagram-NVQOT4AX-C1y_DqRe.js → journeyDiagram-NVQOT4AX-DhXy7wxt.js} +1 -1
- package/dist/assets/{kanban-definition-27J2QSJJ-DIUOavva.js → kanban-definition-27J2QSJJ-CFDavpZY.js} +1 -1
- package/dist/assets/maplibre-gl-CrDadnl3.js +801 -0
- package/dist/assets/maplibre-gl-shared.mjs +2 -2
- package/dist/assets/maplibre-gl-worker.mjs +2 -2
- package/dist/assets/mermaid-GHXKKRXX-CR9PcY0X.js +1 -0
- package/dist/assets/{mermaid-parser.core-BbBeSajF.js → mermaid-parser.core-Dd2B8Ckv.js} +1 -1
- package/dist/assets/{mermaid.core-Dc9p2r4P.js → mermaid.core-BwiBFu_S.js} +2 -2
- package/dist/assets/metadata-admin-BE9_-F_f.js +25 -0
- package/dist/assets/{mindmap-definition-FAOFIHXS-TIsZfgu-.js → mindmap-definition-FAOFIHXS-ITGoV4nW.js} +1 -1
- package/dist/assets/{pegDiagram-VL7TDLO6-BrUvPfjL.js → pegDiagram-VL7TDLO6-BoRu9yvl.js} +1 -1
- package/dist/assets/{pieDiagram-7S7Q4E2Y-BNPIri0N.js → pieDiagram-7S7Q4E2Y-DVsM9krU.js} +1 -1
- package/dist/assets/plugin-calendar-BfY9ZunQ.js +1 -0
- package/dist/assets/plugin-charts-CmWL7Og-.js +7 -0
- package/dist/assets/plugin-chatbot-mxoQfkdx.js +120 -0
- package/dist/assets/plugin-dashboard-CzbAW1Rz.js +6 -0
- package/dist/assets/plugin-form-ItAwTFz-.js +1 -0
- package/dist/assets/plugin-gantt-DF5W5xkN.js +64 -0
- package/dist/assets/plugin-grid-B42Photo.js +9 -0
- package/dist/assets/plugin-kanban-Dh3HIJIm.js +1 -0
- package/dist/assets/plugin-map-C1wSLqlB.js +1 -0
- package/dist/assets/plugin-map-DSnsEFKn.css +1 -0
- package/dist/assets/{plugin-markdown-CbQeAjXv.js → plugin-markdown-DNllWgPM.js} +1 -1
- package/dist/assets/plugin-report-yfOfZPQg.js +59 -0
- package/dist/assets/plugin-timeline-BpuaaqBd.js +1 -0
- package/dist/assets/plugin-tree-BrXE50se.js +1 -0
- package/dist/assets/plugin-view-Jc0rkk7A.js +1 -0
- package/dist/assets/plugins-views-cOiN-mPq.js +4 -0
- package/dist/assets/{quadrantDiagram-CIZ2JOQS-BpL1Kl6d.js → quadrantDiagram-CIZ2JOQS-C4VzXHnp.js} +1 -1
- package/dist/assets/{railroadDiagram-AXF67PYL-CY1JovP6.js → railroadDiagram-AXF67PYL-DqZ3yKWv.js} +1 -1
- package/dist/assets/{requirementDiagram-LRYGKXZP-TRTGy9-6.js → requirementDiagram-LRYGKXZP-BeH0P3vD.js} +1 -1
- package/dist/assets/{runtime-metadata-persistence-DDZN-tZg.js → runtime-metadata-persistence-DTOJpVmd.js} +1 -1
- package/dist/assets/{sankeyDiagram-W5VNT64P-Hj-Un0bp.js → sankeyDiagram-W5VNT64P-Bu_tPh-A.js} +1 -1
- package/dist/assets/{sequenceDiagram-SI44F4Z6-iGYyf5AF.js → sequenceDiagram-SI44F4Z6-BWEuLn1a.js} +1 -1
- package/dist/assets/{skeletons-BWrJAbfN.js → skeletons-BwA1TSR2.js} +1 -1
- package/dist/assets/src-BLbFBP_B.js +1 -0
- package/dist/assets/{src-DwpgXgLE.js → src-CY2xhbXR.js} +1 -1
- package/dist/assets/{src-0qbDl74X.js → src-CvicUdp3.js} +1 -1
- package/dist/assets/src-DhAd4aY4.js +2 -0
- package/dist/assets/{stateDiagram-OKZ733FA-B-kn5M6g.js → stateDiagram-OKZ733FA-Cp7aDYsZ.js} +1 -1
- package/dist/assets/stateDiagram-v2-UEYNNEHI-DaTg8C5m.js +1 -0
- package/dist/assets/{swimlanes-SLNWSIFB-sV1QkjXA.js → swimlanes-SLNWSIFB-wrx1JN6o.js} +1 -1
- package/dist/assets/swimlanesDiagram-ULZ7WXOC-Bqz9GVuM.js +8 -0
- package/dist/assets/{timeline-definition-Z64GVDOM-DMClsS2j.js → timeline-definition-Z64GVDOM-BcUiJfLU.js} +1 -1
- package/dist/assets/ui-components-Dwq5utCl.js +42 -0
- package/dist/assets/ui-layout-DPFlQaQp.js +1 -0
- package/dist/assets/use-book-data-CZc8MJsb.js +1 -0
- package/dist/assets/useActionModal-DYiSBx1G.js +1 -0
- package/dist/assets/useOpenRecordList-DOZu_JZX.js +1 -0
- package/dist/assets/usePackageL10n-D91-102Q.js +1 -0
- package/dist/assets/{useSettingsLabel-Bl5L3RqQ.js → useSettingsLabel-CeZ36S4g.js} +1 -1
- package/dist/assets/{utils-L-_x2yPF.js → utils-CJ4UwXMF.js} +1 -1
- package/dist/assets/{vendor-charts-DAI87uet.js → vendor-charts-BEGSmcjR.js} +3 -3
- package/dist/assets/{vendor-dndkit-CQdzTF9d.js → vendor-dndkit-CkJ59XFL.js} +1 -1
- package/dist/assets/{vendor-i18n-DeMInx63.js → vendor-i18n-Cpia2wlg.js} +1 -1
- package/dist/assets/{vendor-icons-core-B25E_7o5.js → vendor-icons-core-Bi9GWsvI.js} +1 -1
- package/dist/assets/{vendor-markdown-DjBjpmKk.js → vendor-markdown-C_Ip9E_I.js} +2 -2
- package/dist/assets/vendor-objectstack-B1R3ym-9.js +264 -0
- package/dist/assets/{vendor-radix-D1dussIM.js → vendor-radix-DFmVRiEf.js} +1 -1
- package/dist/assets/{vendor-react-BgOXCBVK.js → vendor-react-CsWFRkED.js} +1 -1
- package/dist/assets/vendor-sentry-B2ojA7qm.js +501 -0
- package/dist/assets/vendor-ui-utils-BFw4cGI6.js +1 -0
- package/dist/assets/vendor-zod-r9lyeyrU.js +64 -0
- package/dist/assets/{vennDiagram-T6HMQDX7-CrP23lgd.js → vennDiagram-T6HMQDX7-BKJsL5fS.js} +1 -1
- package/dist/assets/{wardleyDiagram-T6FBY63Y-DSw6poZ6.js → wardleyDiagram-T6FBY63Y-CZ0aMbYX.js} +1 -1
- package/dist/assets/{xychartDiagram-ELKLHX3M-BVUFqBDL.js → xychartDiagram-ELKLHX3M-BpK2RmQ_.js} +1 -1
- package/dist/eager-closure.json +277 -0
- package/dist/index.html +56 -16
- package/package.json +1 -1
- package/dist/assets/AdapterProvider-BpWMSLQH.js +0 -3
- package/dist/assets/AiPendingActionsPage-DAJUEqyC.js +0 -1
- package/dist/assets/ApiConsolePage-CgXbOsFC.js +0 -1
- package/dist/assets/AppDocsIndex-BgaIthca.js +0 -1
- package/dist/assets/AppManagementPage-BvGPskyf.js +0 -1
- package/dist/assets/ApprovalsInboxPage-CxmrNrwP.js +0 -1
- package/dist/assets/AuditLogPage-JahfQFnX.js +0 -1
- package/dist/assets/ComponentNavView-DjiNAGys.js +0 -1
- package/dist/assets/CreateViewDialog-CUvjCA1o.js +0 -1
- package/dist/assets/DashboardView-Cr-Q-16_.js +0 -1
- package/dist/assets/FlowRunsPage-DL7MhL_U.js +0 -1
- package/dist/assets/InterfaceListPage-CfhSyYAw.js +0 -1
- package/dist/assets/MarketplaceAccessDenied-t8A0k9OX.js +0 -1
- package/dist/assets/MarketplacePackagePage-XSdk80Dd.js +0 -4
- package/dist/assets/MarketplacePage-CZjDbg5G.js +0 -1
- package/dist/assets/MetadataProvider-CnYsadFP.js +0 -1
- package/dist/assets/ObjectDataPage-D9kCSxvN.js +0 -1
- package/dist/assets/PageView-q1XSwpVo.js +0 -1
- package/dist/assets/ProfilePage-DeDhni58.js +0 -1
- package/dist/assets/PublicFormsPage-BX6YXY8w.js +0 -1
- package/dist/assets/RecordDetailView-DrVbrbaN.js +0 -9
- package/dist/assets/RecordFormPage-Bs9wX-M6.js +0 -1
- package/dist/assets/ReportDefaultInspector-BbbhDn34.js +0 -3
- package/dist/assets/ReportView-D_soBKL6.js +0 -2
- package/dist/assets/SearchResultsPage--Beqyte8.js +0 -1
- package/dist/assets/SettingsHub-BozLt7dt.js +0 -1
- package/dist/assets/SettingsView-CC3o9IGe.js +0 -1
- package/dist/assets/SystemHubPage-CBdrX4bx.js +0 -1
- package/dist/assets/channel-dlPH8oK4.js +0 -1
- package/dist/assets/chunk-3NCLNEKW-CHvXlKAW.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-BLRqgrvV.js +0 -1
- package/dist/assets/classDiagram-JCYQIIEL-ghx-FrtR.js +0 -1
- package/dist/assets/classDiagram-v2-OCEON4UE-ghx-FrtR.js +0 -1
- package/dist/assets/componentRegistry-ByxoJqMW.js +0 -1
- package/dist/assets/data-adapter-yS4exRPT.js +0 -24
- package/dist/assets/flowDiagram-UKHOOZJN-6YBsanbO.js +0 -1
- package/dist/assets/framework-B8ndNKrd.js +0 -38
- package/dist/assets/i18n-DLOdKEiB.js +0 -9
- package/dist/assets/index-DaeqUnH6.js +0 -2
- package/dist/assets/index-gaeYmjTV.css +0 -2
- package/dist/assets/infrastructure-ChmEYj6c.js +0 -3
- package/dist/assets/maplibre-gl-DPzMTNDD.js +0 -801
- package/dist/assets/mermaid-GHXKKRXX-BrwYiPsC.js +0 -1
- package/dist/assets/metadata-admin-DqAvOmNf.js +0 -25
- package/dist/assets/plugin-calendar-CQVTjox_.js +0 -1
- package/dist/assets/plugin-charts-CBUIhVeW.js +0 -7
- package/dist/assets/plugin-chatbot-DsLGdfGx.js +0 -120
- package/dist/assets/plugin-dashboard-fdM1jm2j.js +0 -6
- package/dist/assets/plugin-form-Bv0Hi0E6.js +0 -1
- package/dist/assets/plugin-gantt-CRJpVrrP.js +0 -63
- package/dist/assets/plugin-grid-gHcTrjs3.js +0 -8
- package/dist/assets/plugin-kanban-CNm7DssD.js +0 -1
- package/dist/assets/plugin-map-5lRITB8H.css +0 -1
- package/dist/assets/plugin-map-TrYBEx8q.js +0 -1
- package/dist/assets/plugin-report-Bg1oh9SG.js +0 -59
- package/dist/assets/plugin-timeline-B30kCAGi.js +0 -1
- package/dist/assets/plugin-tree-Br5XanqO.js +0 -1
- package/dist/assets/plugin-view-CgDs-8T5.js +0 -1
- package/dist/assets/plugins-views-BxwTmeut.js +0 -4
- package/dist/assets/src-BBKXMp-o.js +0 -19
- package/dist/assets/src-CVuJHohL.js +0 -1
- package/dist/assets/src-leh_hyM1.js +0 -2
- package/dist/assets/stateDiagram-v2-UEYNNEHI-CHYANMPw.js +0 -1
- package/dist/assets/swimlanesDiagram-ULZ7WXOC-CBFvMN71.js +0 -8
- package/dist/assets/ui-components-mPgY5chB.js +0 -42
- package/dist/assets/ui-layout-CRcyxP_X.js +0 -1
- package/dist/assets/use-book-data-B2KPEJjv.js +0 -1
- package/dist/assets/useOpenRecordList-ovuRzPa2.js +0 -1
- package/dist/assets/usePackageL10n-9fP2GgDK.js +0 -1
- package/dist/assets/vendor-objectstack-DneBps14.js +0 -155
- package/dist/assets/vendor-sentry-DlmtNsBO.js +0 -501
- package/dist/assets/vendor-ui-utils-BGw4RtYu.js +0 -1
- package/dist/assets/vendor-zod-CBDIIwrA.js +0 -65
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ui-components-BL3SEdAz.css","./plugin-dashboard-DnNKJB60.css","./plugin-map-5lRITB8H.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,r as f,s as p,u as m,y as h}from"./vendor-react-BgOXCBVK.js";import{a as g,b as _,f as v,g as y,h as b,i as x,m as S,p as C,r as w,v as T,y as E}from"./infrastructure-ChmEYj6c.js";import{Ar as D,C as ee,Fn as te,In as ne,Ln as re,Pn as ie,Q as ae,Rn as oe,S as se,T as O,Z as ce,lt as le,w as ue,x as de,yt as fe}from"./framework-B8ndNKrd.js";import{Dr as k,Er as A,Fc as pe,Ln as j,Mo as me,Nn as M,Or as N,Ss as he,T as ge,Tr as P,_a as _e,_i as ve,_o as F,ac as ye,ei as be,el as xe,fs as Se,il as Ce,jr as we,kr as I,lo as Te,mc as Ee,mo as De,nc as Oe,oo as ke,pc as Ae,qr as L,qs as je,tt as Me,w as Ne,wo as Pe,x as Fe}from"./ui-components-mPgY5chB.js";import{r as R}from"./vendor-ui-utils-BGw4RtYu.js";import{C as Ie,D as Le,O as Re,S as ze,_ as Be,a as Ve,b as He,c as Ue,d as We,f as Ge,g as Ke,h as qe,i as Je,k as z,l as Ye,m as Xe,n as Ze,o as Qe,p as $e,r as et,s as tt,u as nt,v as rt,w as it,x as at,y as ot}from"./src-BBKXMp-o.js";import"./plugin-form-Bv0Hi0E6.js";import{I as st,S as ct}from"./RecordDetailView-DrVbrbaN.js";import{o as lt}from"./utils-L-_x2yPF.js";import{r as ut}from"./plugin-chatbot-DsLGdfGx.js";import{C as B,E as dt,O as ft,T as pt,b as mt,w as ht,x as gt}from"./MarketplaceAccessDenied-t8A0k9OX.js";import{a as _t,i as vt,o as yt}from"./plugin-grid-gHcTrjs3.js";import"./plugins-views-BxwTmeut.js";import"./plugin-view-CgDs-8T5.js";import{n as V}from"./componentRegistry-ByxoJqMW.js";import{r as bt,t as xt}from"./plugin-markdown-CbQeAjXv.js";import{t as H}from"./DocShell-C1VQpTIJ.js";import{a as St,i as U,l as Ct,n as W,o as wt,r as Tt,s as Et,t as Dt,u as Ot}from"./use-book-data-B2KPEJjv.js";var G=e(h(),1),kt=e(n(),1),K=f(),At={type:`object-master-detail-form`,objectName:`expense_claim`,mode:`create`,formType:`simple`,title:`New Expense Claim`,submitText:`Create Claim`,fields:[`title`,`applicant`,`department`,`reason`,`currency`,`claim_status`,`payment_status`,`remarks`],details:[{title:`Expense Lines`,childObject:`expense_line`,relationshipField:`expense_claim`,amountField:`amount`,totalField:`total_amount`,columns:[{field:`expense_date`,label:`Date`,type:`date`},{field:`category`,label:`Category`,type:`select`,options:[{label:`Travel & Transport`,value:`travel_transport`},{label:`Lodging`,value:`lodging`},{label:`Meals & Entertainment`,value:`meals_entertainment`},{label:`Office Supplies`,value:`office_supplies`},{label:`Communications`,value:`communications`},{label:`Training & Conference`,value:`training_conference`},{label:`Client / Project`,value:`client_project`},{label:`Other`,value:`other`}]},{field:`description`,label:`Description`,type:`text`},{field:`merchant_vendor`,label:`Merchant`,type:`text`},{field:`amount`,label:`Amount`,type:`currency`}]}]},jt=()=>(0,K.jsxs)(`div`,{className:`mx-auto max-w-3xl p-6`,children:[(0,K.jsx)(`h1`,{className:`mb-4 text-lg font-semibold`,children:`Dev · Master-Detail Form (ADR-0001)`}),(0,K.jsx)(fe,{schema:At})]}),Mt={type:`element:definition-list`,properties:{columns:2,items:[{term:`Status`,description:`Active`},{term:`Owner`,description:`Ada Lovelace`},{term:`Plan`,description:`Enterprise`},{term:`Renewal`,description:`2026-12-01`}]}},Nt={type:`element:repeater`,properties:{object:`showcase_category`,titleField:`name`,fields:[`color`],limit:10,emptyText:`No categories`}},Pt=()=>(0,K.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-8 p-6`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`mb-3 text-lg font-semibold`,children:`Dev · element:definition-list`}),(0,K.jsx)(`div`,{className:`rounded-lg border p-4`,children:(0,K.jsx)(fe,{schema:Mt})})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`mb-3 text-lg font-semibold`,children:`Dev · element:repeater (showcase_category)`}),(0,K.jsx)(`div`,{className:`rounded-lg border p-4`,children:(0,K.jsx)(fe,{schema:Nt})})]})]}),q={type:`element:definition-list`,properties:{columns:2,items:[{term:`Status`,description:`Active`},{term:`Owner`,description:`Ada Lovelace`},{term:`Plan`,description:`Enterprise`},{term:`Renewal`,description:`2026-12-01`}]}},Ft=()=>{let{modalHandler:e,modalElement:t}=st();return(0,K.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Dev · Action modal transport`}),(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`One `,(0,K.jsx)(`code`,{children:`onModal`}),` handler, four placements, arbitrary SchemaNode content.`]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(L,{"data-testid":`open-center`,onClick:()=>e({placement:`center`,size:`lg`,title:`Center modal`,content:q}),children:`Center`}),(0,K.jsx)(L,{"data-testid":`open-side`,variant:`outline`,onClick:()=>e({placement:`side`,title:`Side drawer`,content:q}),children:`Side drawer`}),(0,K.jsx)(L,{"data-testid":`open-bottom`,variant:`outline`,onClick:()=>e({placement:`bottom`,title:`Bottom sheet`,content:q}),children:`Bottom sheet`}),(0,K.jsx)(L,{"data-testid":`open-fullscreen`,variant:`outline`,onClick:()=>e({placement:`fullscreen`,title:`Fullscreen`,content:q}),children:`Fullscreen`})]}),t]})},It=()=>{let[e,t]=G.useState([{},{}]);return(0,K.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-4 p-6`,children:[(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Dev · Line-item grid with a lookup cell`}),(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`The `,(0,K.jsx)(`code`,{children:`Account`}),` column is a real lookup picker bound to live `,(0,K.jsx)(`code`,{children:`showcase_account`}),`.`]}),(0,K.jsx)(Fe,{value:e,onChange:t,field:{columns:[{field:`account`,label:`Account`,type:`lookup`,reference:`showcase_account`,displayField:`name`},{field:`note`,label:`Note`,type:`text`},{field:`amount`,label:`Amount`,type:`currency`}],total_field:`amount`}}),(0,K.jsx)(`pre`,{className:`rounded bg-muted p-3 text-xs`,"data-testid":`rows-json`,children:JSON.stringify(e)})]})},Lt=[{id:`1`,name:`hotcrm-fix-verify`,org:`hotcrm-fix-verify`,type:`production`,status:`running`,host:`os-05ayzz.objectos.app`},{id:`2`,name:`Objectstack`,org:`Objectstack`,type:`production`,status:`running`,host:`os-0zpadn.objectos.app`},{id:`3`,name:`hotcrm`,org:`JIANGUO Zhuang's Workspace`,type:`production`,status:`running`,host:`os-48f50e60.objectos.app`}],Rt=[{name:`open`,label:`Open`,variant:`primary`},{name:`upgrade`,label:`Upgrade Plan`,variant:`primary`},{name:`rename`,label:`Rename`,variant:`secondary`},{name:`archive`,label:`Archive`,variant:`secondary`}],zt=[{field:`name`,label:`名称`},{field:`org`,label:`所属组织`},{field:`type`,label:`类型`},{field:`status`,label:`状态`},{field:`host`,label:`公开主机名`}];function Bt({maxInlineRowActions:e}){let t={type:`object-grid`,objectName:`showcase_environment`,columns:zt,data:{provider:`value`,items:Lt},rowActionDefs:Rt,...e==null?{}:{maxInlineRowActions:e}};return(0,K.jsx)(le,{children:(0,K.jsx)(vt,{schema:t})})}var Vt=()=>(0,K.jsxs)(`div`,{className:`mx-auto max-w-none space-y-8 p-6`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Dev · Row-action overflow (default)`}),(0,K.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[`Two `,(0,K.jsx)(`code`,{children:`variant:'primary'`}),` row actions. Only `,(0,K.jsx)(`strong`,{children:`Open`}),` stays inline;`,(0,K.jsx)(`strong`,{children:` Upgrade Plan`}),` + the secondaries fold into the `,(0,K.jsx)(`code`,{children:`⋮`}),` menu. The actions column hugs its content and must never clip the inline button.`]}),(0,K.jsx)(`div`,{className:`rounded-lg border`,"data-testid":`grid-default`,children:(0,K.jsx)(Bt,{})})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Dev · Row-action overflow (maxInlineRowActions: 2)`}),(0,K.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[`Same data, author opts into two inline primaries — both `,(0,K.jsx)(`strong`,{children:`Open`}),` and`,(0,K.jsx)(`strong`,{children:` Upgrade Plan`}),` render inline and the column grows to fit them.`]}),(0,K.jsx)(`div`,{className:`rounded-lg border`,"data-testid":`grid-wide`,children:(0,K.jsx)(Bt,{maxInlineRowActions:2})})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Dev · Row-action sticky-right (narrow / horizontal scroll)`}),(0,K.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[`A deliberately narrow container so the table scrolls horizontally. The`,(0,K.jsx)(`strong`,{children:` 操作`}),` column stays pinned to the right edge (always reachable), while the first `,(0,K.jsx)(`strong`,{children:`名称`}),` column stays frozen on the left. Scroll the grid sideways to check both edges hold.`]}),(0,K.jsx)(`div`,{className:`max-w-md overflow-hidden rounded-lg border`,"data-testid":`grid-scroll`,children:(0,K.jsx)(Bt,{})})]})]}),Ht=4,Ut=1e3;function Wt({endpoint:e,children:t}){let[n,r]=(0,G.useState)({});return(0,G.useEffect)(()=>{let t=!1;return(async()=>{for(let n=0;n<=Ht;n++)try{let n=await fetch(e,{credentials:`include`,headers:{Accept:`application/json`}});if(!n.ok)throw new ie(n.status,re(n));let i=await n.json();if(i.authenticated!==!1&&se(i.locale),t)return;r({currency:i.currency??void 0,locale:i.locale??void 0});return}catch(e){if(!ne(e)||n===Ht)return;let r=e instanceof ie?e.retryAfterMs:void 0;if(await oe(te(n,Ut,r)),t)return}})(),()=>{t=!0}},[e]),(0,K.jsx)(Ce,{value:n,children:t})}var Gt=(0,G.lazy)(()=>s(()=>import(`./SystemHubPage-CBdrX4bx.js`).then(e=>({default:e.SystemHubPage})),__vite__mapDeps([0,1]),import.meta.url)),Kt=(0,G.lazy)(()=>s(()=>import(`./AppManagementPage-BvGPskyf.js`).then(e=>({default:e.AppManagementPage})),__vite__mapDeps([0,1]),import.meta.url)),qt=(0,G.lazy)(()=>s(()=>import(`./ProfilePage-DeDhni58.js`).then(e=>({default:e.ProfilePage})),__vite__mapDeps([0]),import.meta.url)),Jt=(0,G.lazy)(()=>s(()=>import(`./ApprovalsInboxPage-CxmrNrwP.js`).then(e=>({default:e.ApprovalsInboxPage})),__vite__mapDeps([0,1]),import.meta.url)),Yt=(0,G.lazy)(()=>s(()=>import(`./AiPendingActionsPage-DAJUEqyC.js`).then(e=>({default:e.AiPendingActionsPage})),__vite__mapDeps([0]),import.meta.url)),Xt=(0,G.lazy)(()=>s(()=>import(`./AuditLogPage-JahfQFnX.js`).then(e=>({default:e.AuditLogPage})),__vite__mapDeps([0]),import.meta.url)),Zt=(0,G.lazy)(()=>s(()=>import(`./SettingsHub-BozLt7dt.js`).then(e=>({default:e.SettingsHub})),__vite__mapDeps([0]),import.meta.url)),Qt=(0,G.lazy)(()=>s(()=>import(`./SettingsView-CC3o9IGe.js`).then(e=>({default:e.SettingsView})),__vite__mapDeps([0]),import.meta.url)),$t=(0,G.lazy)(()=>s(()=>import(`./DeveloperHubPage-DVKVm5k0.js`).then(e=>({default:e.DeveloperHubPage})),__vite__mapDeps([0]),import.meta.url)),en=(0,G.lazy)(()=>s(()=>import(`./ApiConsolePage-CgXbOsFC.js`).then(e=>({default:e.ApiConsolePage})),__vite__mapDeps([0,1]),import.meta.url)),tn=(0,G.lazy)(()=>s(()=>import(`./FlowRunsPage-DL7MhL_U.js`).then(e=>({default:e.FlowRunsPage})),__vite__mapDeps([0,1]),import.meta.url)),nn=(0,G.lazy)(()=>s(()=>import(`./PublicFormsPage-BX6YXY8w.js`).then(e=>({default:e.PublicFormsPage})),__vite__mapDeps([0,1]),import.meta.url)),rn=(0,G.lazy)(()=>s(()=>import(`./IntegrationsPage-Cq4mWRFh.js`).then(e=>({default:e.IntegrationsPage})),__vite__mapDeps([0]),import.meta.url)),an=(0,G.lazy)(()=>s(()=>Promise.resolve().then(()=>or),void 0,import.meta.url)),on=(0,G.lazy)(()=>s(()=>import(`./AppDocsIndex-BgaIthca.js`),__vite__mapDeps([0,1]),import.meta.url)),sn=(0,G.lazy)(()=>s(()=>Promise.resolve().then(()=>ur),void 0,import.meta.url)),cn=(0,G.lazy)(()=>s(()=>Promise.resolve().then(()=>fr),void 0,import.meta.url));function ln(){let{objectName:e}=d(),t=a().pathname.replace(/\/(system\/)?objects(\/.*)?$/,``),n=e?`${t}/metadata/object/${e}`:`${t}/metadata/object`;return(0,K.jsx)(p,{to:n,replace:!0})}function un(){let{metadataType:e,itemName:t}=d(),n=`${a().pathname.replace(/\/(system\/)?metadata(\/.*)?$/,``)}/metadata`,r=e?t?`${n}/${encodeURIComponent(e)}/${t}`:`${n}/${encodeURIComponent(e)}`:n;return(0,K.jsx)(p,{to:r,replace:!0})}function J({objectName:e}){let t=a().pathname.replace(/\/system\/[^/]+\/?$/,``);return(0,K.jsx)(p,{to:`${t}/${e}`,replace:!0})}var dn=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(u,{path:`system`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(Gt,{})})}),(0,K.jsx)(u,{path:`system/apps`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(Kt,{})})}),(0,K.jsx)(u,{path:`system/profile`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(qt,{})})}),(0,K.jsx)(u,{path:`system/approvals`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(Jt,{})})}),(0,K.jsx)(u,{path:`system/ai-approvals`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(Yt,{})})}),(0,K.jsx)(u,{path:`system/audit-log`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(Xt,{})})}),(0,K.jsx)(u,{path:`system/settings`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(Zt,{})})}),(0,K.jsx)(u,{path:`system/settings/:namespace`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(Qt,{})})}),(0,K.jsx)(u,{path:`developer`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)($t,{})})}),(0,K.jsx)(u,{path:`developer/api-console`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(en,{})})}),(0,K.jsx)(u,{path:`developer/flow-runs`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(tn,{})})}),(0,K.jsx)(u,{path:`developer/public-forms`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(nn,{})})}),(0,K.jsx)(u,{path:`developer/integrations`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(rn,{})})}),(0,K.jsxs)(u,{path:`docs`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(cn,{})}),children:[(0,K.jsx)(u,{index:!0,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(on,{})})}),(0,K.jsx)(u,{path:`:slug`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(sn,{})})}),(0,K.jsx)(u,{path:`:slug/:name`,element:(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(z,{}),children:(0,K.jsx)(an,{})})})]}),(0,K.jsx)(u,{path:`system/objects`,element:(0,K.jsx)(ln,{})}),(0,K.jsx)(u,{path:`system/objects/:objectName`,element:(0,K.jsx)(ln,{})}),(0,K.jsx)(u,{path:`system/metadata`,element:(0,K.jsx)(un,{})}),(0,K.jsx)(u,{path:`system/metadata/:metadataType`,element:(0,K.jsx)(un,{})}),(0,K.jsx)(u,{path:`system/metadata/:metadataType/:itemName`,element:(0,K.jsx)(un,{})}),(0,K.jsx)(u,{path:`system/users`,element:(0,K.jsx)(J,{objectName:`sys_user`})}),(0,K.jsx)(u,{path:`system/organizations`,element:(0,K.jsx)(J,{objectName:`sys_organization`})}),(0,K.jsx)(u,{path:`system/roles`,element:(0,K.jsx)(J,{objectName:`sys_position`})}),(0,K.jsx)(u,{path:`system/positions`,element:(0,K.jsx)(J,{objectName:`sys_position`})}),(0,K.jsx)(u,{path:`system/permissions`,element:(0,K.jsx)(J,{objectName:`sys_permission_set`})})]});function fn(){let e=(0,G.useMemo)(()=>ge({baseUrl:``}),[``]),t=(0,G.useMemo)(()=>_(),[]);return(0,K.jsx)(w,{endpoint:`/api/v1/auth/me/permissions`,fetcher:t,loadingFallback:(0,K.jsx)(z,{}),errorFallback:(e,t)=>(0,K.jsx)(z,{error:e.message,onRetry:t}),children:(0,K.jsx)(Wt,{endpoint:`/api/v1/auth/me/localization`,children:(0,K.jsx)(Ne,{adapter:e,children:(0,K.jsx)($e,{extraRoutes:dn,extraRoutesNoApp:dn})})})})}function pn(e){return e._packageId===`com.objectstack.setup`||e.name===`setup`}function mn(e){let t=(e??[]).filter(e=>!!e?.name),n=t.find(e=>e.isDefault===!0);if(n)return`/apps/${n.name}`;let r=t.filter(e=>e.active!==!1&&e.hidden!==!0);return r.length===1&&!pn(r[0])?`/apps/${r[0].name}`:`/home`}function hn(e){return e===void 0||e===`ready`}var gn=1500;function _n(){let{apps:e,loading:t,getTypeStatus:n,refresh:r}=ae(),i=!t&&!hn(n?.(`app`)),a=(0,G.useRef)(!1);return(0,G.useEffect)(()=>{if(!i||a.current)return;a.current=!0;let e=setTimeout(()=>{r?.(`app`)},gn);return()=>clearTimeout(e)},[i,r]),t||i?(0,K.jsx)(ze,{}):(0,K.jsx)(p,{to:mn(e),replace:!0})}function vn(){let e=a(),t=e.pathname+e.search,n=t&&t!==`/`?`?redirect=${encodeURIComponent(t)}`:``;return(0,K.jsx)(p,{to:`/login${n}`,replace:!0})}function Y({children:e,requireOrganization:t=!0}){return(0,K.jsx)(y,{fallback:(0,K.jsx)(vn,{}),loadingFallback:(0,K.jsx)(ze,{}),children:(0,K.jsx)(He,{children:t?(0,K.jsx)(it,{children:e}):e})})}var yn=`/api/v1/auth`;function bn(e,t){return e===`fresh`?`first-run`:t.isLoading?`pending`:t.isAuthenticated?`settings`:e===`unknown`?`pending`:`settings`}function xn(e){let[t,n]=(0,G.useState)(`unknown`);return(0,G.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let e=await fetch(`${yn}/bootstrap-status`,{credentials:`include`}),r=e.ok?await e.json().catch(()=>({})):{};t||n(r.hasOwner===!0?`bootstrapped`:`fresh`)}catch{t||n(`fresh`)}})(),()=>{t=!0}},[e]),t}function Sn(){let{isAuthenticated:e,isLoading:t}=T();return bn(xn(!t&&!e),{isAuthenticated:e,isLoading:t})}function X(e){return e.startsWith(`/_`)?e:`./`.replace(/\/$/,``)+(e.startsWith(`/`)?e:`/${e}`)}var Cn=`/api/v1/auth`,wn=`/`;function Tn(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function En(){let{t:e}=O(),t=o(),{user:n,signUp:r,refreshOrganizations:i,updateOrganization:a,createOrganization:s,switchOrganization:c}=T(),[l,u]=(0,G.useState)(``),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(``),[h,g]=(0,G.useState)(``),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)(null);return(0,G.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch(`${Cn}/bootstrap-status`,{credentials:`include`}),n=t.ok?await t.json().catch(()=>({})):{};e||b(n.hasOwner===!0)}catch{e||b(!1)}})(),()=>{e=!0}},[]),(0,G.useEffect)(()=>{y===!0&&!n&&t(`/login`,{replace:!0})},[y,n,t]),(0,G.useEffect)(()=>{n&&!_&&window.location.assign(X(wn))},[n,_]),y===null?(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted`,children:(0,K.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-4 border-muted-foreground/20 border-t-primary`})}):(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center bg-muted p-6`,children:(0,K.jsx)(`div`,{className:`flex w-full max-w-md flex-col gap-6`,children:(0,K.jsxs)(P,{children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{children:e(`auth.setup.welcomeTitle`,{defaultValue:`Welcome to ObjectStack`})}),(0,K.jsx)(k,{children:e(`auth.setup.description`,{defaultValue:`Create the first owner account to finish setting up this deployment.`})})]}),(0,K.jsx)(A,{children:(0,K.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),v(!0);try{await r(l,d,p);let e=h.trim();if(e)try{let t;for(let e=0;e<4&&!t?.id;e++)e>0&&await new Promise(e=>setTimeout(e,500)),t=(await i())?.[0];let n=Tn(e),r;t?.id?(await a(t.id,{name:e,...n?{slug:n}:{}}),r=t.id):r=(await s({name:e,slug:n||`org-${Date.now().toString(36)}`}))?.id,r&&await c(r).catch(()=>void 0)}catch(e){console.warn(`[setup] organization rename/create failed`,e)}window.location.assign(X(wn))}catch(t){R.error(e(`auth.setup.failed`,{defaultValue:`Setup failed`}),{description:t.message})}finally{v(!1)}},className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`name`,children:e(`auth.setup.yourName`,{defaultValue:`Your name`})}),(0,K.jsx)(M,{id:`name`,autoComplete:`name`,required:!0,value:l,onChange:e=>u(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`orgName`,children:e(`auth.setup.orgName`,{defaultValue:`Organization name`})}),(0,K.jsx)(M,{id:`orgName`,required:!0,placeholder:e(`auth.setup.orgNamePlaceholder`,{defaultValue:`Acme Inc.`}),value:h,onChange:e=>g(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`email`,children:e(`auth.setup.emailLabel`,{defaultValue:`Email`})}),(0,K.jsx)(M,{id:`email`,type:`email`,placeholder:e(`auth.setup.emailPlaceholder`,{defaultValue:`name@example.com`}),autoComplete:`email`,required:!0,value:d,onChange:e=>f(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`password`,children:e(`auth.setup.passwordLabel`,{defaultValue:`Password`})}),(0,K.jsx)(M,{id:`password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,placeholder:e(`auth.setup.passwordHint`,{defaultValue:`Minimum 8 characters`}),value:p,onChange:e=>m(e.target.value)})]}),(0,K.jsx)(L,{type:`submit`,className:`mt-2 w-full`,disabled:_,children:_?e(`auth.setup.submitting`,{defaultValue:`Setting up…`}):e(`auth.setup.submit`,{defaultValue:`Create owner account`})})]})})]})})})}function Dn(){let e=Sn();return e===`pending`?(0,K.jsx)(ze,{}):e===`first-run`?(0,K.jsx)(En,{}):(0,K.jsx)(Y,{requireOrganization:!1,children:(0,K.jsx)(Le,{})})}var On=`/api/v1`,kn=new Set([`simple`,`tabbed`,`wizard`,`split`,`drawer`,`modal`]),An=`recordId`;function jn(e,t){if(e!==`internal`)return{kind:`create`};let n=t.get(An);if(n===null)return{kind:`create`};let r=n.trim();return r?{kind:`edit`,recordId:r,recordObject:(t.get(`recordObject`)??``).trim()||null}:{kind:`refuse`,reason:`This form was opened to edit a record (?${An}=), but no record id was supplied. Re-open it from the record, or drop the parameter to create a new one.`}}function Mn(e){let t=typeof e==`string`?parseInt(e,10):e;return t===1||t===2||t===3||t===4?t:2}function Nn(e){if(Array.isArray(e))return e.map(e=>{if(typeof e==`string`)return{value:e,label:e};if(e&&typeof e==`object`){let t=String(e.value??e.id??``);return{value:t,label:String(e.label??e.name??t)}}return{value:String(e),label:String(e)}})}function Pn(e,t){let n=e.sections??e.groups??[],r=t?.fields??{};return n.map(e=>{let t=Mn(e.columns),n=[];for(let t of e.fields??[]){let e=typeof t==`string`?{field:t}:{...t},i=r[e.field]??{type:`text`};n.push({name:e.field,label:e.label??i.label??e.field,type:i.type??`text`,required:e.required??i.required??!1,readonly:e.readonly??!1,hidden:e.hidden??!1,placeholder:e.placeholder??i.placeholder,helpText:e.helpText??i.helpText,defaultValue:i.defaultValue,options:Nn(i.options),maxLength:i.maxLength,colSpan:e.colSpan??1})}return{label:e.label,columns:t,collapsible:!!e.collapsible,collapsed:!!e.collapsed,fields:n}})}function Fn(e,t){return t||(e===`internal`?{kind:`created-record`}:{kind:`thank-you`})}function In(e){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.success==`boolean`&&`data`in t?t.data:t;return!n||typeof n!=`object`?null:n}function Ln(e){let t=In(e);if(!t)return null;let n=t.id;return typeof n==`string`?n===``?null:n:typeof n==`number`&&Number.isFinite(n)?String(n):null}function Rn(e,t,n){let r=In(e);if(!r)throw Error(`Could not read record "${n}" of ${t}: the server returned no record payload.`);let i=r.object;if(typeof i==`string`&&i&&i!==t)throw Error(`Record "${n}" belongs to ${i}, but this form edits ${t}. Refusing to open it — check the action that linked here.`);let a=r.record;if(!a||typeof a!=`object`||Array.isArray(a))throw Error(`Could not read record "${n}" of ${t}: the response carried no "record".`);return a}function zn(e,t,n){let r={};for(let i of e){i.defaultValue!==void 0&&(r[i.name]=i.defaultValue),n&&Object.prototype.hasOwnProperty.call(n,i.name)&&(r[i.name]=n[i.name]);let e=t.get(`prefill_${i.name}`);e!==null&&(r[i.name]=e)}return r}async function Z(e,t){return fetch(`${On}${e}`,{credentials:`include`,headers:{"Content-Type":`application/json`,...t?.headers??{}},...t})}async function Bn(e){let t=await Z(`/forms/${encodeURIComponent(e)}`);if(!t.ok){let e=await t.text().catch(()=>``);throw Error(`Failed to load form (${t.status}): ${e||t.statusText}`)}let n=await t.json();return{label:n.label??n.form?.label??n.object,object:n.object,form:n.form,objectSchema:n.objectSchema,record:null}}function Vn(e,t){let n=t,r=n?.item??n,i=r?.spec??r,a=i&&typeof i==`object`&&i.config&&typeof i.config==`object`&&(`viewKind`in i||`object`in i),o=i&&typeof i==`object`?i.viewKind:void 0;if(o&&o!==`form`)throw Error(`View "${e}" is a ${o} view, not a form view — check the action or link that targets it.`);let s=a?i.config:i;if(!o&&s&&typeof s==`object`&&typeof s.type==`string`&&!kn.has(s.type))throw Error(`View "${e}" is a ${s.type} view, not a form view — check the action or link that targets it.`);return{label:(a?i.label:void 0)??s?.label??e,object:(a?i.object:void 0)??s?.data?.object??i?.object,form:s}}async function Hn(e,t,n){let r=await Z(`/meta/view/${encodeURIComponent(e)}`);if(!r.ok)throw Error(`Form metadata not found: view/${e}`);let{label:i,object:a,form:o}=Vn(e,await r.json());if(!a)throw Error(`FormView "${e}" is missing an "object" target`);if(n&&n!==a)throw Error(`This form edits ${a}, but the link says record "${t}" belongs to ${n}. Refusing to open it — check the action that linked here.`);let s=null;try{let e=await Z(`/meta/object/${encodeURIComponent(a)}`);if(e.ok){let t=await e.json(),n=t?.item??t,r=n?.spec??n;r?.fields&&typeof r.fields==`object`&&(s={name:r.name??a,label:r.label,fields:r.fields})}}catch{}let c=null;if(t){let e=await Z(`/data/${encodeURIComponent(a)}/${encodeURIComponent(t)}`);if(!e.ok){let n=await e.text().catch(()=>``);throw Error(`Could not open record "${t}" of ${a} for editing (${e.status})${n?`: ${n}`:e.statusText?`: ${e.statusText}`:``}`)}c=Rn(await e.json(),a,t)}return{label:i,object:a,form:o,objectSchema:s,record:c}}async function Un(e,t){let n=await Z(`/forms/${encodeURIComponent(e)}/submit`,{method:`POST`,body:JSON.stringify(t)});if(!n.ok){let e=await n.text().catch(()=>``);throw Error(`Submit failed (${n.status}): ${e||n.statusText}`)}return n.json().catch(()=>({}))}async function Wn(e,t,n){let r=await Z(n?`/data/${encodeURIComponent(e)}/${encodeURIComponent(n)}`:`/data/${encodeURIComponent(e)}`,{method:n?`PATCH`:`POST`,body:JSON.stringify(t)});if(!r.ok){let e=await r.text().catch(()=>``);throw Error(`${n?`Update`:`Create`} failed (${r.status}): ${e||r.statusText}`)}return r.json().catch(()=>({}))}var Gn=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50`;function Kn({field:e,value:t,onChange:n}){let r={id:`f_${e.name}`,name:e.name,required:e.required,disabled:e.readonly,placeholder:e.placeholder,className:Gn},i=t??``;switch(e.type){case`textarea`:case`paragraph`:case`long_text`:return(0,K.jsx)(`textarea`,{...r,rows:5,maxLength:e.maxLength,value:String(i),onChange:e=>n(e.target.value)});case`number`:case`integer`:case`decimal`:case`currency`:return(0,K.jsx)(`input`,{...r,type:`number`,value:i===``?``:Number(i),onChange:e=>n(e.target.value===``?null:Number(e.target.value))});case`email`:return(0,K.jsx)(`input`,{...r,type:`email`,value:String(i),onChange:e=>n(e.target.value)});case`url`:return(0,K.jsx)(`input`,{...r,type:`url`,value:String(i),onChange:e=>n(e.target.value)});case`password`:return(0,K.jsx)(`input`,{...r,type:`password`,value:String(i),onChange:e=>n(e.target.value)});case`date`:return(0,K.jsx)(`input`,{...r,type:`date`,value:String(i),onChange:e=>n(e.target.value)});case`time`:return(0,K.jsx)(`input`,{...r,type:`time`,value:String(i),onChange:e=>n(e.target.value)});case`datetime`:case`timestamp`:return(0,K.jsx)(`input`,{...r,type:`datetime-local`,value:String(i),onChange:e=>n(e.target.value)});case`boolean`:case`toggle`:case`checkbox`:return(0,K.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm`,children:[(0,K.jsx)(`input`,{id:r.id,name:r.name,type:`checkbox`,disabled:e.readonly,checked:!!i,onChange:e=>n(e.target.checked),className:`h-4 w-4 rounded border-input`}),(0,K.jsx)(`span`,{children:e.placeholder??e.label})]});case`select`:case`picklist`:case`enum`:{let t=e.options??[];return(0,K.jsxs)(`select`,{...r,value:String(i),onChange:e=>n(e.target.value),children:[(0,K.jsx)(`option`,{value:``,disabled:e.required,children:e.placeholder??`— Select —`}),t.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.label},e.value))]})}case`radio`:{let t=e.options??[];return(0,K.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:t.map(t=>(0,K.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,K.jsx)(`input`,{type:`radio`,name:e.name,value:t.value,checked:String(i)===t.value,disabled:e.readonly,onChange:()=>n(t.value)}),(0,K.jsx)(`span`,{children:t.label})]},t.value))})}default:return(0,K.jsx)(`input`,{...r,type:`text`,maxLength:e.maxLength,value:String(i),onChange:e=>n(e.target.value)})}}function qn({mode:e,recordPath:t}){let n=d(),[r]=c(),i=o(),a=(e===`public`?n.slug:n.name)??``,s=jn(e,r),l=s.kind===`edit`?s.recordId:null,u=s.kind===`edit`?s.recordObject:null,[f,p]=(0,G.useState)(!0),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(null),[v,y]=(0,G.useState)({}),[b,x]=(0,G.useState)(!1),[S,C]=(0,G.useState)(!1);(0,G.useEffect)(()=>{let t=!1;return p(!0),h(null),(s.kind===`refuse`?Promise.reject(Error(s.reason)):e===`public`?Bn(a):Hn(a,l,u)).then(e=>{if(t)return;_(e);let n=Pn(e.form,e.objectSchema).flatMap(e=>e.fields);y(zn(n,r,e.record))}).catch(e=>{t||(_(null),h(e?.message??String(e)))}).finally(()=>{t||p(!1)}),()=>{t=!0}},[e,a,r]);let w=(0,G.useMemo)(()=>g?Pn(g.form,g.objectSchema):[],[g]),T=Fn(e,g?.form?.submitBehavior),E=async n=>{if(n.preventDefault(),g){x(!0),h(null);try{let n=e===`public`?await Un(a,v):await Wn(g.object,v,l);switch(R.success(`Submitted`),T.kind){case`created-record`:{let e=l??Ln(n),r=e?t?.(g.object,e):null;if(r){i(r);break}C(!0);break}case`redirect`:{let e=T.delayMs??0;setTimeout(()=>window.location.assign(T.url),e),C(!0);break}case`continue`:{let e=w.flatMap(e=>e.fields);y(zn(e,r,g.record));break}default:C(!0)}}catch(e){let t=e?.message??String(e);h(t),R.error(t)}finally{x(!1)}}};if(f)return(0,K.jsx)(`div`,{className:`flex min-h-[60vh] items-center justify-center`,children:(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading…`})});if(m&&!g)return(0,K.jsx)(`div`,{className:`mx-auto max-w-2xl p-6`,children:(0,K.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 p-4 text-sm text-destructive`,children:m})});if(!g)return null;if(S&&(T.kind===`thank-you`||T.kind===`created-record`)){let e=T.kind===`thank-you`?T.title:void 0,t=T.kind===`thank-you`?T.message:void 0;return(0,K.jsx)(`div`,{className:`mx-auto max-w-2xl p-6`,children:(0,K.jsxs)(`div`,{className:`rounded-md border bg-card p-6 text-center`,children:[(0,K.jsx)(`h2`,{className:`mb-2 text-lg font-semibold`,children:e??`Thanks!`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t??`Your submission has been received.`})]})})}return S&&T.kind===`redirect`?(0,K.jsx)(`div`,{className:`mx-auto max-w-2xl p-6 text-center text-sm text-muted-foreground`,children:`Redirecting…`}):(0,K.jsxs)(`div`,{className:`mx-auto max-w-2xl p-4 sm:p-6`,children:[(0,K.jsxs)(`header`,{className:`mb-6`,children:[(0,K.jsx)(`h1`,{className:`text-xl font-semibold`,children:g.label}),g.form?.label&&g.form.label!==g.label&&(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:g.form.label})]}),(0,K.jsxs)(`form`,{onSubmit:E,className:`space-y-6`,children:[w.map((e,t)=>(0,K.jsxs)(`section`,{className:`rounded-md border bg-card p-4 sm:p-5`,children:[e.label&&(0,K.jsx)(`h2`,{className:`mb-3 text-sm font-medium`,children:e.label}),(0,K.jsx)(`div`,{className:e.columns===1?`grid grid-cols-1 gap-4`:e.columns===2?`grid grid-cols-1 gap-4 sm:grid-cols-2`:e.columns===3?`grid grid-cols-1 gap-4 sm:grid-cols-3`:`grid grid-cols-1 gap-4 sm:grid-cols-4`,children:e.fields.filter(e=>!e.hidden).map(e=>(0,K.jsxs)(`div`,{className:e.colSpan===2?`sm:col-span-2`:e.colSpan===3?`sm:col-span-3`:e.colSpan===4?`sm:col-span-4`:``,children:[(0,K.jsxs)(`label`,{htmlFor:`f_${e.name}`,className:`mb-1 block text-xs font-medium text-foreground`,children:[e.label,e.required&&(0,K.jsx)(`span`,{className:`ml-0.5 text-destructive`,children:`*`})]}),(0,K.jsx)(Kn,{field:e,value:v[e.name],onChange:t=>y(n=>({...n,[e.name]:t}))}),e.helpText&&(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.helpText})]},e.name))})]},t)),m&&(0,K.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:m}),(0,K.jsx)(`div`,{className:`flex justify-end gap-2`,children:(0,K.jsx)(`button`,{type:`submit`,disabled:b,className:`rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 disabled:opacity-50`,children:b?`Submitting…`:`Submit`})})]})]})}function Jn(e,t,n,r){if(!n||!r)return null;let i=lt(e,t);return`/apps/${encodeURIComponent(i)}/${encodeURIComponent(n)}/record/${encodeURIComponent(r)}`}function Yn(){let{apps:e}=ae(),{currentAppName:t}=ct(),{user:n}=T(),r=(0,G.useMemo)(()=>(n,r)=>Jn(e,t,n,r),[e,t]);return(0,K.jsx)(Ge,{userId:n?.id,children:(0,K.jsx)(qn,{mode:`internal`,recordPath:r})})}function Xn({enabled:e=!1,url:t=`/api/v1/dev/metadata-events`,debounceMs:n=400,reconnectDelayMs:r=2e3}){let i=(0,G.useRef)(null);return(0,G.useEffect)(()=>{if(!e||typeof window>`u`||typeof EventSource>`u`)return;let a=null,o=null,s=!1,c=e=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{try{R.info(`Metadata changed (${e}) — reloading…`,{duration:800})}catch{}setTimeout(()=>{try{window.location.reload()}catch{}},150)},n)},l=e=>{try{let t=JSON.parse(e.data),n=t?.name?`${t.metadataType??`metadata`}:${t.name}`:`metadata`;c(n)}catch{c(`change`)}},u=e=>{let t=`rebuild`;try{t=JSON.parse(e.data)?.reason??t}catch{}c(t)},d=()=>{if(!s)try{a=new EventSource(t),a.addEventListener(`metadata-change`,l),a.addEventListener(`reload`,u),a.addEventListener(`error`,()=>{s||a?.readyState===EventSource.CLOSED&&(a=null,o=setTimeout(d,r))})}catch{o=setTimeout(d,r)}};return d(),()=>{if(s=!0,o&&clearTimeout(o),i.current&&clearTimeout(i.current),a)try{a.close()}catch{}}},[e,t,n,r]),null}function Zn(e){let t=e.data??e;return{record:t.record??{},link:t.link,redactedFields:t.redactFields}}function Qn(){let e={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_SENTRY_DSN:`https://1373a588ceb9da150b11e64bf85f583d@o4510356161757184.ingest.us.sentry.io/4511439670673408`,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_SEND_DEFAULT_PII:`true`,VITE_SERVER_URL:``,VITE_USE_MOCK_SERVER:`false`}.VITE_SERVER_URL??``;return e?e.replace(/\/$/,``):typeof window<`u`?window.location.origin:``}function $n(){let{token:e}=d(),t=`${(0,G.useMemo)(()=>Qn(),[])}/api/v1`,[n,r]=(0,G.useState)(null),[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(!0),[c,l]=(0,G.useState)(!1),[u,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(null),h=(0,G.useCallback)(async n=>{if(e){s(!0),a(null);try{let i=new URL(`${t}/share-links/${encodeURIComponent(e)}/resolve`);n&&i.searchParams.set(`password`,n);let o=await fetch(i.toString(),{headers:{Accept:`application/json`}});if(o.status===401){l(!0),a(n?`Wrong password.`:null),s(!1);return}if(o.status===404){a(`This link is invalid or no longer available.`),s(!1);return}if(o.status===410){a(`This link has expired or was revoked.`),s(!1);return}if(!o.ok){let e=await o.json().catch(()=>null);a(e?.error?.message??`Failed to load (HTTP ${o.status}).`),s(!1);return}r(Zn(await o.json())),l(!1)}catch(e){a(e?.message??`Failed to load shared content.`)}finally{s(!1)}}},[t,e]);(0,G.useEffect)(()=>{h()},[h]),(0,G.useEffect)(()=>{if(!n||n.link.object_name!==`ai_conversations`)return;let e=`${t}/share-links/${encodeURIComponent(n.link.token)}/messages`;fetch(e,{headers:{Accept:`application/json`}}).then(e=>e.ok?e.json():null).then(e=>m(e?.data??[])).catch(()=>m([]))},[t,n]);let g=(0,G.useMemo)(()=>p?Be(ot(rt(p))):[],[p]);if(o)return(0,K.jsxs)(`div`,{className:`flex h-svh w-full items-center justify-center bg-background text-muted-foreground`,children:[(0,K.jsx)(F,{className:`mr-2 h-4 w-4 animate-spin`}),`Loading…`]});if(c)return(0,K.jsxs)(`div`,{className:`mx-auto flex h-svh max-w-md flex-col items-center justify-center gap-4 px-4 text-center`,children:[(0,K.jsx)(Pe,{className:`h-8 w-8 text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Password required`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The owner protected this link with a password.`}),(0,K.jsxs)(`form`,{className:`flex w-full flex-col gap-2`,onSubmit:e=>{e.preventDefault(),h(u)},children:[(0,K.jsx)(j,{htmlFor:`share-pw`,className:`sr-only`,children:`Password`}),(0,K.jsx)(M,{id:`share-pw`,type:`password`,value:u,onChange:e=>f(e.target.value),autoFocus:!0,placeholder:`Enter password`}),i&&(0,K.jsx)(`p`,{className:`text-xs text-destructive`,children:i}),(0,K.jsx)(L,{type:`submit`,size:`sm`,children:`Continue`})]})]});if(i)return(0,K.jsxs)(`div`,{className:`mx-auto flex h-svh max-w-md flex-col items-center justify-center gap-3 px-4 text-center`,children:[(0,K.jsx)(ve,{className:`h-8 w-8 text-amber-500`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Can't open this link`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i})]});if(!n)return null;if(n.link.object_name===`ai_conversations`){let e=n.record;return(0,K.jsxs)(`div`,{className:`mx-auto flex h-svh max-w-3xl flex-col bg-background`,children:[(0,K.jsxs)(`header`,{className:`sticky top-0 z-10 flex items-center gap-2 border-b bg-background px-4 py-3`,children:[(0,K.jsx)(ke,{className:`h-5 w-5 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h1`,{className:`truncate text-sm font-semibold`,children:e.title??`Shared conversation`}),(0,K.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,children:`Read-only · Shared via ObjectStack`})]}),(0,K.jsx)(we,{variant:`outline`,className:`text-[10px] capitalize`,children:n.link.permission})]}),(0,K.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col`,children:p==null?(0,K.jsxs)(`div`,{className:`flex flex-1 items-center justify-center py-12 text-sm text-muted-foreground`,children:[(0,K.jsx)(F,{className:`mr-2 h-4 w-4 animate-spin`}),`Loading messages…`]}):p.length===0?(0,K.jsx)(`p`,{className:`py-12 text-center text-sm text-muted-foreground`,children:`This conversation has no messages yet.`}):(0,K.jsx)(ut,{readOnly:!0,surface:`plain`,messages:g,showAvatars:!0,maxHeight:`100%`,className:`flex-1`})}),(0,K.jsx)(`footer`,{className:`border-t bg-muted/30 px-4 py-2 text-center text-[11px] text-muted-foreground`,children:`Powered by ObjectStack`})]})}return(0,K.jsxs)(`div`,{className:`mx-auto flex h-svh max-w-3xl flex-col bg-background`,children:[(0,K.jsx)(`header`,{className:`border-b px-4 py-3`,children:(0,K.jsxs)(`h1`,{className:`text-sm font-semibold`,children:[`Shared `,n.link.object_name]})}),(0,K.jsxs)(`main`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,K.jsx)(`pre`,{className:`overflow-x-auto rounded-md border bg-muted/30 p-3 text-[12px]`,children:JSON.stringify(n.record,null,2)}),n.redactedFields&&n.redactedFields.length>0&&(0,K.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:[`Some fields are hidden by the owner: `,n.redactedFields.join(`, `)]})]})]})}var er=/(^```[^\n]*\n[\s\S]*?\n```[ \t]*$|^~~~[^\n]*\n[\s\S]*?\n~~~[ \t]*$)/m,tr=/(`[^`\n]+`)/,nr=/\]\((?:\.\/)?([a-z][a-z0-9_]*)\.md(#[^)\s]*)?\)/g;function rr(e){return e.split(tr).map((e,t)=>t%2==1?e:e.replace(nr,`](/docs/$1$2)`)).join(``)}function ir(e){let t=[],n=e;for(;;){let e=er.exec(n);if(!e||e.index===void 0)return t.push(rr(n)),t.join(``);t.push(rr(n.slice(0,e.index)),e[0]),n=n.slice(e.index+e[0].length)}}function ar({book:e,activeDoc:t,docHref:n}){return(0,K.jsxs)(`nav`,{"aria-label":e.label??e.name,className:`text-sm`,children:[e.label?(0,K.jsx)(`div`,{className:`mb-3 px-2 text-sm font-semibold text-foreground`,children:e.label}):null,(0,K.jsx)(`div`,{className:`space-y-5`,children:e.groups.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e.label}),(0,K.jsx)(`ul`,{className:`space-y-0.5`,children:e.entries.map((e,i)=>{if(e.separator)return(0,K.jsx)(`li`,{className:`my-1.5 border-t border-border/60`,"aria-hidden":!0},`sep-${i}`);if(e.href)return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1.5 rounded px-2 py-1 text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.label??e.href}),(0,K.jsx)(he,{className:`h-3 w-3 shrink-0 opacity-60`})]})},`ext-${i}`);if(!e.doc)return null;let a=e.doc===t;return(0,K.jsx)(`li`,{children:(0,K.jsx)(r,{to:n(e.doc),"aria-current":a?`page`:void 0,className:`block truncate rounded px-2 py-1 transition ${a?`bg-primary/10 font-medium text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:e.label??e.doc})},e.doc)})})]},e.key))})]})}var or=t({default:()=>sr});function sr(){let{slug:e,name:t,appName:n}=d(),r=o(),i=ce(),{t:a}=O(),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(`loading`),[f,p]=(0,G.useState)(``);(0,G.useEffect)(()=>{let e=!1;async function r(){if(!(!t||!i)){u(`loading`);try{let r=await i.getClient().meta.getItem(`doc`,t,n?{packageId:n}:void 0),a=r?.item??r?.data??r;if(e)return;a&&typeof a.content==`string`?(c({name:t,label:a.label,content:a.content}),u(`ready`)):u(`missing`)}catch(t){if(e)return;(t?.status??t?.response?.status)===404||/not found/i.test(t?.message??``)?u(`missing`):(p(t?.message??`Failed to load documentation`),u(`error`))}}}return r(),()=>{e=!0}},[t,n,i]);let m=(0,G.useCallback)(e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`}),window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${e}`)},[]),h=(0,G.useCallback)(e=>{if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;let t=e.target.closest(`a`)?.getAttribute(`href`);t&&(t.startsWith(`/docs/`)?(e.preventDefault(),r(t)):t.startsWith(`#`)&&(e.preventDefault(),m(decodeURIComponent(t.slice(1)))))},[r,m]),g=(0,G.useCallback)((e,t)=>{e.defaultPrevented||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),m(t))},[m]),_=(0,G.useMemo)(()=>bt(s?.content??``),[s?.content]),v=a(`help.onThisPage`,{defaultValue:`On this page`}),{books:y,docs:b}=W(),x=n?`/apps/${n}/docs`:`/docs`,S=(0,G.useMemo)(()=>{let t=y.find(t=>U(t)===e);return t?Ct(t,Ot(t,b)):null},[y,b,e]),C=(0,G.useCallback)(t=>`${x}/${e}/${t}`,[x,e]);return l===`loading`?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,K.jsx)(F,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):l===`missing`?(0,K.jsx)(H,{breadcrumb:t,children:(0,K.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,K.jsx)(Se,{className:`h-10 w-10 text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Documentation not found`}),(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No document named `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:t}),` is installed. It may belong to a package that is not installed, or it was removed in a newer version.`]})]})}):l===`error`?(0,K.jsx)(H,{breadcrumb:t,children:(0,K.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,K.jsx)(ye,{className:`h-10 w-10 text-destructive`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Failed to load documentation`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f})]})}):(0,K.jsxs)(H,{breadcrumb:s?.label??t,children:[S?(0,K.jsxs)(`details`,{className:`group mx-auto max-w-6xl px-4 pt-4 sm:px-6 lg:hidden`,children:[(0,K.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm font-medium [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(Te,{className:`h-4 w-4 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`truncate`,children:S.label??`Contents`}),(0,K.jsx)(Ae,{className:`ml-auto h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,K.jsx)(`div`,{className:`mt-2 rounded-md border p-3`,children:(0,K.jsx)(ar,{book:S,activeDoc:t,docHref:C})})]}):null,(0,K.jsxs)(`div`,{className:`mx-auto flex gap-8 p-4 sm:p-6 ${S?`max-w-6xl`:`max-w-5xl`}`,children:[S?(0,K.jsx)(`aside`,{className:`hidden w-56 shrink-0 lg:block`,children:(0,K.jsx)(`nav`,{className:`sticky top-20 max-h-[calc(100vh-6rem)] overflow-auto pr-1`,children:(0,K.jsx)(ar,{book:S,activeDoc:t,docHref:C})})}):null,(0,K.jsx)(`article`,{className:`min-w-0 max-w-3xl flex-1 [&_h1]:scroll-mt-24 [&_h2]:scroll-mt-24 [&_h3]:scroll-mt-24`,onClick:h,children:(0,K.jsx)(xt,{schema:{type:`markdown`,content:ir(s?.content??``)}})}),_.length>=3?(0,K.jsx)(`aside`,{className:`hidden xl:block w-56 shrink-0`,children:(0,K.jsxs)(`nav`,{"aria-label":v,className:`sticky top-20 max-h-[calc(100vh-6rem)] overflow-auto`,children:[(0,K.jsx)(`div`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:v}),(0,K.jsx)(`ul`,{className:`border-l border-border text-sm`,children:_.map(e=>(0,K.jsx)(`li`,{style:{paddingLeft:(e.depth-2)*12},children:(0,K.jsx)(`a`,{href:`#${e.id}`,onClick:t=>g(t,e.id),className:`-ml-px block border-l border-transparent py-0.5 pl-3 text-muted-foreground hover:border-primary hover:text-foreground`,children:e.text})},e.id))})]})}):null]})]})}function cr(){let{books:e,docs:t,state:n,error:i}=W(),a=(0,G.useMemo)(()=>St(e,t),[e,t]);return n===`loading`?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,K.jsx)(F,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):n===`error`?(0,K.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,K.jsx)(ye,{className:`h-10 w-10 text-destructive`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Failed to load documentation`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i})]}):(0,K.jsx)(H,{children:(0,K.jsxs)(`div`,{className:`mx-auto max-w-4xl p-4 sm:p-6`,children:[(0,K.jsxs)(`header`,{className:`mb-6`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:`Documentation`}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Books and guides from your installed packages.`})]}),a.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-16 text-center text-muted-foreground`,children:[(0,K.jsx)(pe,{className:`h-10 w-10`}),(0,K.jsxs)(`p`,{className:`text-sm`,children:[`No documentation is installed. Packages ship docs as flat`,(0,K.jsx)(`code`,{className:`mx-1 rounded bg-muted px-1 py-0.5`,children:`src/docs/*.md`}),`files, organised by a `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`book`}),` (ADR-0046).`]})]}):(0,K.jsx)(`ul`,{className:`grid items-stretch gap-3 sm:grid-cols-2`,children:a.map(e=>(0,K.jsx)(`li`,{className:`h-full`,children:(0,K.jsxs)(r,{to:`/docs/${e.slug}`,className:`flex h-full items-start gap-3 rounded-md border border-border p-3 hover:bg-muted/50`,children:[(0,K.jsx)(pe,{className:`mt-0.5 h-5 w-5 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold`,children:e.label}),e.description?(0,K.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.description}):e.subtitle?(0,K.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/70`,children:e.subtitle}):null,(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground/80`,children:[e.docCount,` `,e.docCount===1?`article`:`articles`]})]})]})},e.name))})]})})}function lr(){let{slug:e,appName:t}=d(),{books:n,docs:r,state:i}=W(),a=(0,G.useMemo)(()=>n.find(t=>U(t)===e),[n,e]),o=(0,G.useMemo)(()=>a?wt(Ct(a,Ot(a,r))):void 0,[a,r]);if(i===`loading`)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,K.jsx)(F,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})});if(a&&o){let n=t?`/apps/${t}/docs`:`/docs`;return(0,K.jsx)(p,{to:`${n}/${e}/${o}`,replace:!0})}return(0,K.jsx)(H,{breadcrumb:a?a.label??e:e,children:(0,K.jsx)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:a?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(pe,{className:`h-10 w-10 text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:a.label??e}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This book has no documents yet.`})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Se,{className:`h-10 w-10 text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Book not found`}),(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No book named `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:e}),` is installed.`]})]})})})}var ur=t({default:()=>dr});function dr(){let{slug:e,appName:t}=d(),{books:n,docs:r,state:i}=W();if(i===`loading`)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,K.jsx)(F,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})});if(e&&n.some(t=>U(t)===e))return(0,K.jsx)(lr,{});let a=t?`/apps/${t}/docs`:`/docs`,o=e?Et(e,n,r):null;return o&&e?(0,K.jsx)(p,{to:`${a}/${U(o)}/${e}`,replace:!0}):(0,K.jsx)(H,{breadcrumb:e,children:(0,K.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,K.jsx)(Se,{className:`h-10 w-10 text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Documentation not found`}),(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No book or document named `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:e}),` is installed.`]})]})})}var fr=t({default:()=>pr});function pr(){let e=Tt();return(0,K.jsx)(Dt.Provider,{value:e,children:(0,K.jsx)(i,{})})}function mr(e){let t=e.split(`:`)[0].toLowerCase();return/^cloud\./.test(t)}function hr(e){let t=e.split(`:`)[0].toLowerCase();return t===`localhost`||t===`127.0.0.1`||t===`[::1]`||t.endsWith(`.local`)}function gr(){return typeof window>`u`?null:window.location.host||null}function _r(){let e=B(),t=gt();return(0,K.jsxs)(`div`,{className:`flex items-center justify-center gap-2.5 select-none`,children:[(0,K.jsx)(`span`,{className:`inline-flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-indigo-500 to-indigo-600 text-white shadow-sm shadow-indigo-500/30 overflow-hidden`,children:t?(0,K.jsx)(`img`,{src:t,alt:e,className:`h-full w-full object-contain`}):(0,K.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,K.jsx)(`path`,{d:`M12 2 2 7l10 5 10-5-10-5Z`}),(0,K.jsx)(`path`,{d:`m2 17 10 5 10-5`}),(0,K.jsx)(`path`,{d:`m2 12 10 5 10-5`})]})}),(0,K.jsx)(`span`,{className:`text-lg font-semibold tracking-tight text-foreground`,children:e})]})}function Q({children:e,formWidth:t=`sm`}){let{t:n}=O(),r=t===`md`?`max-w-md`:`max-w-sm`,i=gr(),a=!!i&&!mr(i)&&!hr(i);return(0,G.useEffect)(()=>{if(typeof document>`u`||!i)return;let e=document.title;return a&&(document.title=i),()=>{document.title=e}},[i,a]),(0,K.jsxs)(`div`,{className:`relative flex min-h-svh w-full items-center justify-center overflow-hidden bg-background p-6`,children:[(0,K.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 -z-10`,children:[(0,K.jsx)(`div`,{className:`absolute inset-0 opacity-[0.35] dark:opacity-[0.25] [mask-image:radial-gradient(ellipse_at_center,black,transparent_72%)] [-webkit-mask-image:radial-gradient(ellipse_at_center,black,transparent_72%)]`,style:{backgroundImage:`radial-gradient(hsl(var(--border)) 1px, transparent 1px)`,backgroundSize:`22px 22px`}}),(0,K.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-[34rem] w-[34rem] -translate-x-1/2 -translate-y-1/2 rounded-full bg-gradient-to-br from-indigo-500/10 to-indigo-600/10 blur-3xl dark:from-indigo-500/10 dark:to-indigo-600/10`})]}),(0,K.jsxs)(`div`,{className:xe(`flex w-full flex-col gap-5`,r),children:[(0,K.jsx)(_r,{}),a?(0,K.jsx)(`div`,{className:`flex justify-center`,children:(0,K.jsx)(`span`,{className:`rounded-full border border-border/60 bg-background/60 px-2 py-0.5 font-mono text-[10px] uppercase tracking-wide text-muted-foreground`,title:n(`auth.shell.tenantHostHint`,{defaultValue:`You are signing in to this workspace`}),children:i})}):null,e]})]})}function vr(e){let t=`/api/v1/auth/oauth2/authorize${e}`,n=()=>window.location.assign(t);fetch(t,{credentials:`include`,redirect:`manual`,headers:{accept:`application/json`}}).then(async e=>{let t=await e.json().catch(()=>null),r=t?.url??t?.redirect_uri??t?.redirectURI;if(e.ok&&r){window.location.href=r;return}n()}).catch(n)}function yr(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}var br=`os.console.devAdminHintDismissed`;function xr(e){return(0,K.jsx)(r,{to:e.href,className:e.className,children:e.children})}function Sr(){let{t:e}=O(),[t]=c(),n=t.get(`redirect`),{user:r,isLoading:i,organizations:a,isOrganizationsLoading:o,activeOrganization:s,switchOrganization:l,getAuthConfig:u}=T(),[d,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(()=>{try{return window.localStorage.getItem(br)===`1`}catch{return!1}}),_=()=>{g(!0);try{window.localStorage.setItem(br,`1`)}catch{}},[v,y]=(0,G.useState)(!1),x=(0,G.useRef)(!1),[S,C]=(0,G.useState)(!1);(0,G.useLayoutEffect)(()=>{i||C(!0)},[i]);let w=(0,G.useMemo)(()=>{if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search),t=e.get(`redirect_uri`);if(!e.has(`client_id`)||!t)return null;try{return new URL(t).host}catch{return null}},[]),E=(0,G.useMemo)(()=>{let e=t.get(`error`);return e?{code:e,description:t.get(`error_description`)}:null},[]);if((0,G.useEffect)(()=>{let e=!1;return u().then(t=>{if(e)return;f(t?.emailPassword?.disableSignUp===!0);let n=t?.devSeedAdmin;m(n&&typeof n.email==`string`?{email:n.email,password:typeof n.password==`string`?n.password:void 0}:null)}).catch(()=>{}),()=>{e=!0}},[u]),(0,G.useEffect)(()=>{if(r){if(typeof window<`u`){let e=new URLSearchParams(window.location.search);if(e.has(`client_id`)&&e.has(`redirect_uri`)){x.current||(x.current=!0,vr(window.location.search));return}}if(!s){if(o||v)return;if(a.length===1){y(!0),l(a[0].id).catch(()=>void 0).finally(()=>y(!1));return}if(a.length===0){window.location.assign(X(yr(n)?n:`/`));return}window.location.assign(X(`/organizations`));return}v||window.location.assign(X(yr(n)?n:`/`))}},[r,s,a,o,v,n,l]),i&&!S||r)return(0,K.jsx)(Q,{children:(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm text-muted-foreground`,children:[(0,K.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`}),(0,K.jsx)(`span`,{children:e(`auth.login.signingIn`,{defaultValue:`Signing you in…`})})]})});let D=n?`/register?redirect=${encodeURIComponent(n)}`:`/register`;return(0,K.jsx)(Q,{formWidth:`md`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[E?(0,K.jsx)(b,{message:e(`auth.login.errors.oauthCallbackFailed`,{defaultValue:`Single sign-on could not be completed — the sign-in link expired or was already used. Please try again.`})+(E.description?` (${E.description})`:` (${E.code})`)}):null,w?(0,K.jsxs)(`div`,{role:`status`,className:`flex items-start gap-3 rounded-md border border-primary/30 bg-primary/5 px-4 py-3 text-sm text-foreground`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 inline-block size-2 shrink-0 rounded-full bg-primary`}),(0,K.jsx)(`span`,{children:e(`auth.login.ssoHandoff`,{target:w,defaultValue:`Continue to ${w}`})})]}):null,p&&!h?(0,K.jsxs)(`div`,{role:`status`,"data-testid":`dev-admin-hint`,className:`flex items-start gap-3 rounded-md border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-sm text-foreground`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 inline-block size-2 shrink-0 rounded-full bg-amber-500`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`font-medium`,children:e(`auth.login.devAdminHint.title`,{defaultValue:`Development instance`})}),(0,K.jsxs)(`div`,{className:`text-muted-foreground`,children:[e(`auth.login.devAdminHint.body`,{defaultValue:`Sign in with the seeded dev admin:`}),` `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`,children:p.email}),p.password?(0,K.jsxs)(K.Fragment,{children:[` / `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`,children:p.password})]}):null]})]}),(0,K.jsx)(`button`,{type:`button`,onClick:_,"aria-label":e(`auth.login.devAdminHint.dismiss`,{defaultValue:`Dismiss`}),className:`shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,K.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`size-3.5 fill-current`,children:(0,K.jsx)(`path`,{d:`M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z`})})})]}):null,(0,K.jsx)(P,{className:`border-border/60 px-4 py-8 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:(0,K.jsx)(Cr,{registerUrl:d?void 0:D,redirect:n})})]})})}function Cr({registerUrl:e,redirect:t}){let{t:n}=O(),r=o(),i=(0,G.useRef)(``);return(0,G.useEffect)(()=>{let e=e=>{let t=e.target;t?.id===`login-email`&&(i.current=t.value)};return document.addEventListener(`input`,e,!0),()=>document.removeEventListener(`input`,e,!0)},[]),(0,K.jsx)(S,{onError:e=>{let n=e.message||``,a=e.code,o=n.toLowerCase();if(a===`EMAIL_NOT_VERIFIED`||o.includes(`email`)&&(o.includes(`verif`)||o.includes(`not verified`))){let e=new URLSearchParams;i.current&&e.set(`email`,i.current),t&&e.set(`redirect`,t),r(`/verify-email-prompt?${e.toString()}`)}},title:n(`auth.login.title`,{defaultValue:`Sign in to your account`}),description:n(`auth.login.description`,{defaultValue:`Enter your email and password to continue`}),registerUrl:e,forgotPasswordUrl:`/forgot-password`,linkComponent:xr,errorMessages:{INVALID_EMAIL_OR_PASSWORD:n(`auth.login.errors.invalidCredentials`,{defaultValue:`Invalid email or password. Please try again.`}),EMAIL_NOT_VERIFIED:n(`auth.login.errors.emailNotVerified`,{defaultValue:`Please verify your email address before signing in.`})},labels:{emailLabel:n(`auth.login.emailLabel`,{defaultValue:`Email`}),emailPlaceholder:n(`auth.login.emailPlaceholder`,{defaultValue:`name@example.com`}),emailOrPhoneLabel:n(`auth.login.emailOrPhoneLabel`,{defaultValue:`Email or phone number`}),emailOrPhonePlaceholder:n(`auth.login.emailOrPhonePlaceholder`,{defaultValue:`name@example.com or +1 555 000 0000`}),passwordLabel:n(`auth.login.passwordLabel`,{defaultValue:`Password`}),passwordPlaceholder:n(`auth.login.passwordPlaceholder`,{defaultValue:`Enter your password`}),forgotPasswordText:n(`auth.login.forgotPasswordText`,{defaultValue:`Forgot password?`}),submitButton:n(`auth.login.submitButton`,{defaultValue:`Sign In`}),submittingButton:n(`auth.login.submittingButton`,{defaultValue:`Signing in…`}),noAccountText:n(`auth.login.noAccountText`,{defaultValue:`Don't have an account?`}),signUpText:n(`auth.login.signUpText`,{defaultValue:`Sign up`}),phoneLabel:n(`auth.login.phoneLabel`,{defaultValue:`Phone number`}),phonePlaceholder:n(`auth.login.phonePlaceholder`,{defaultValue:`+1 555 000 0000`}),otpCodeLabel:n(`auth.login.otpCodeLabel`,{defaultValue:`Verification code`}),otpCodePlaceholder:n(`auth.login.otpCodePlaceholder`,{defaultValue:`6-digit code`}),sendOtpButton:n(`auth.login.sendOtpButton`,{defaultValue:`Get code`}),resendOtpCountdownText:n(`auth.login.resendOtpCountdownText`,{defaultValue:`Resend in {seconds}s`}),usePhoneOtpText:n(`auth.login.usePhoneOtpText`,{defaultValue:`Sign in with verification code`}),usePasswordSignInText:n(`auth.login.usePasswordSignInText`,{defaultValue:`Sign in with password instead`})}})}function wr(e){return!!e&&e.startsWith(`/`)&&!e.startsWith(`//`)}function Tr(e){return(0,K.jsx)(r,{to:e.href,className:e.className,children:e.children})}function Er(){let{t:e}=O(),t=o(),[n]=c(),r=n.get(`redirect`),{user:i,isLoading:a,organizations:s,isOrganizationsLoading:l,activeOrganization:u,switchOrganization:d,getAuthConfig:f}=T(),[p,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(!1),_=(0,G.useRef)(!1),[v,y]=(0,G.useState)(!1);if((0,G.useLayoutEffect)(()=>{a||y(!0)},[a]),(0,G.useEffect)(()=>{let e=!1;return f().then(n=>{if(e)return;let i=n?.emailPassword?.disableSignUp===!0;if(m(i),i){let e=r?`?redirect=${encodeURIComponent(r)}`:``;t(`/login${e}`,{replace:!0})}}).catch(()=>{e||m(!1)}),()=>{e=!0}},[f,t,r]),(0,G.useEffect)(()=>{if(i){if(typeof window<`u`){let e=new URLSearchParams(window.location.search);if(e.has(`client_id`)&&e.has(`redirect_uri`)){_.current||(_.current=!0,vr(window.location.search));return}}if(!u){if(l||h)return;if(s.length===1){g(!0),d(s[0].id).catch(()=>void 0).finally(()=>g(!1));return}if(s.length===0){window.location.assign(X(wr(r)?r:`/`));return}window.location.assign(X(`/organizations`));return}h||window.location.assign(X(wr(r)?r:`/`))}},[i,u,s,l,h,r,d]),p===null||a&&!v||i)return(0,K.jsx)(Q,{children:(0,K.jsx)(`div`,{className:`flex flex-col items-center gap-3 py-10 text-sm text-muted-foreground`,children:(0,K.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent`})})});let b=r?`/login?redirect=${encodeURIComponent(r)}`:`/login`;return(0,K.jsx)(Q,{formWidth:`md`,children:(0,K.jsx)(P,{className:`border-border/60 px-4 py-8 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:(0,K.jsx)(C,{title:e(`auth.register.title`,{defaultValue:`Create an account`}),description:e(`auth.register.description`,{defaultValue:`Create your account to start building.`}),loginUrl:b,linkComponent:Tr,errorMessages:{USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:e(`auth.register.errors.userExists`,{defaultValue:`An account with this email already exists. Try signing in instead.`}),USER_ALREADY_EXISTS:e(`auth.register.errors.userExists`,{defaultValue:`An account with this email already exists. Try signing in instead.`})},onVerificationRequired:e=>{let n=new URLSearchParams;n.set(`email`,e),r&&n.set(`redirect`,r),t(`/verify-email-prompt?${n.toString()}`,{replace:!0})},labels:{nameLabel:e(`auth.register.nameLabel`,{defaultValue:`Name`}),namePlaceholder:e(`auth.register.namePlaceholder`,{defaultValue:`John Doe`}),emailLabel:e(`auth.register.emailLabel`,{defaultValue:`Email`}),emailPlaceholder:e(`auth.register.emailPlaceholder`,{defaultValue:`name@example.com`}),passwordLabel:e(`auth.register.passwordLabel`,{defaultValue:`Password`}),passwordPlaceholder:e(`auth.register.passwordPlaceholder`,{defaultValue:`Create a password (min. 8 characters)`}),confirmPasswordLabel:e(`auth.register.confirmPasswordLabel`,{defaultValue:`Confirm Password`}),confirmPasswordPlaceholder:e(`auth.register.confirmPasswordPlaceholder`,{defaultValue:`Confirm your password`}),passwordMismatchError:e(`auth.register.passwordMismatchError`,{defaultValue:`Passwords do not match`}),passwordTooShortError:e(`auth.register.passwordTooShortError`,{defaultValue:`Password must be at least 8 characters`}),submitButton:e(`auth.register.submitButton`,{defaultValue:`Create Account`}),submittingButton:e(`auth.register.submittingButton`,{defaultValue:`Creating account…`}),hasAccountText:e(`auth.register.hasAccountText`,{defaultValue:`Already have an account?`}),signInText:e(`auth.register.signInText`,{defaultValue:`Sign in`})}})})})}function Dr(e){return(0,K.jsx)(r,{to:e.href,className:e.className,children:e.children})}function Or(){let{t:e}=O();return(0,K.jsx)(Q,{formWidth:`md`,children:(0,K.jsx)(P,{className:`border-border/60 px-4 py-8 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:(0,K.jsx)(v,{loginUrl:`/login`,linkComponent:Dr,title:e(`auth.forgotPassword.title`,{defaultValue:`Reset your password`}),description:e(`auth.forgotPassword.description`,{defaultValue:`Enter your email address and we'll send you a link to reset your password`}),labels:{emailLabel:e(`auth.forgotPassword.emailLabel`,{defaultValue:`Email`}),emailPlaceholder:e(`auth.forgotPassword.emailPlaceholder`,{defaultValue:`name@example.com`}),submitButton:e(`auth.forgotPassword.submitButton`,{defaultValue:`Send Reset Link`}),submittingButton:e(`auth.forgotPassword.submittingButton`,{defaultValue:`Sending…`}),successTitle:e(`auth.forgotPassword.successTitle`,{defaultValue:`Check your email`}),successDescription:e(`auth.forgotPassword.successDescription`,{defaultValue:`We've sent a password reset link to {{email}}. Please check your inbox.`}),backToSignInText:e(`auth.forgotPassword.backToSignInText`,{defaultValue:`Back to sign in`}),phoneLabel:e(`auth.forgotPassword.phoneLabel`,{defaultValue:`Phone number`}),phonePlaceholder:e(`auth.forgotPassword.phonePlaceholder`,{defaultValue:`+1 555 000 0000`}),otpCodeLabel:e(`auth.forgotPassword.otpCodeLabel`,{defaultValue:`Verification code`}),otpCodePlaceholder:e(`auth.forgotPassword.otpCodePlaceholder`,{defaultValue:`6-digit code`}),sendOtpButton:e(`auth.forgotPassword.sendOtpButton`,{defaultValue:`Get code`}),resendOtpCountdownText:e(`auth.forgotPassword.resendOtpCountdownText`,{defaultValue:`Resend in {seconds}s`}),newPasswordLabel:e(`auth.forgotPassword.newPasswordLabel`,{defaultValue:`New password`}),newPasswordPlaceholder:e(`auth.forgotPassword.newPasswordPlaceholder`,{defaultValue:`Enter a new password`}),resetButton:e(`auth.forgotPassword.resetButton`,{defaultValue:`Reset Password`}),usePhoneResetText:e(`auth.forgotPassword.usePhoneResetText`,{defaultValue:`Reset via SMS code`}),useEmailResetText:e(`auth.forgotPassword.useEmailResetText`,{defaultValue:`Reset via email instead`}),phoneSuccessTitle:e(`auth.forgotPassword.phoneSuccessTitle`,{defaultValue:`Password reset`}),phoneSuccessDescription:e(`auth.forgotPassword.phoneSuccessDescription`,{defaultValue:`Your password has been reset. You can now sign in with your new password.`}),rememberPasswordText:e(`auth.forgotPassword.rememberPasswordText`,{defaultValue:`Remember your password?`}),signInText:e(`auth.forgotPassword.signInText`,{defaultValue:`Sign in`})}})})})}function kr(){let{t:e}=O(),t=o(),[n]=c(),i=n.get(`token`),{resetPassword:a}=T(),[s,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(!1);return(0,K.jsx)(Q,{children:(0,K.jsxs)(P,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{className:`text-xl tracking-tight`,children:e(`auth.resetPassword.title`,{defaultValue:`Set a new password`})}),(0,K.jsx)(k,{children:e(`auth.resetPassword.description`,{defaultValue:`Choose a password you have not used before.`})})]}),(0,K.jsx)(A,{children:i?(0,K.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),s!==u){R.error(e(`auth.resetPassword.passwordsMismatch`,{defaultValue:`Passwords do not match`}));return}if(!i){R.error(e(`auth.resetPassword.missingToken`,{defaultValue:`Reset link is missing or expired`}));return}p(!0);try{await a(i,s),R.success(e(`auth.resetPassword.success`,{defaultValue:`Password updated`})),t(`/login`)}catch(t){R.error(e(`auth.resetPassword.failed`,{defaultValue:`Reset failed`}),{description:t.message})}finally{p(!1)}},className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`new-password`,children:e(`auth.resetPassword.newPassword`,{defaultValue:`New password`})}),(0,K.jsx)(M,{id:`new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:s,onChange:e=>l(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`confirm-password`,children:e(`auth.resetPassword.confirmPassword`,{defaultValue:`Confirm password`})}),(0,K.jsx)(M,{id:`confirm-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:u,onChange:e=>d(e.target.value)})]}),(0,K.jsx)(L,{type:`submit`,className:`w-full`,disabled:f,children:f?e(`auth.resetPassword.submitting`,{defaultValue:`Updating…`}):e(`auth.resetPassword.submit`,{defaultValue:`Update password`})})]}):(0,K.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.resetPassword.invalidToken`,{defaultValue:`This reset link is invalid or has expired.`}),` `,(0,K.jsx)(r,{to:`/forgot-password`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.resetPassword.requestNewLink`,{defaultValue:`Request a new link`})})]})})]})})}function Ar(e){return e&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:`/`}function jr(){let{t:e}=O(),t=o(),[n]=c(),i=Ar(n.get(`next`)),{user:a,isLoading:s,setInitialPassword:l}=T(),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(!1);return(0,K.jsx)(Q,{children:(0,K.jsxs)(P,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{className:`text-xl tracking-tight`,children:e(`auth.setPassword.title`)}),(0,K.jsx)(k,{children:e(`auth.setPassword.description`)})]}),(0,K.jsx)(A,{children:!s&&!a?(0,K.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.setPassword.noSession`),` `,(0,K.jsx)(r,{to:`/login`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.setPassword.backToSignIn`)})]}):(0,K.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),u!==f){R.error(e(`auth.setPassword.passwordsMismatch`));return}h(!0);try{await l(u),R.success(e(`auth.setPassword.success`)),t(i)}catch(t){R.error(e(`auth.setPassword.failed`),{description:t.message})}finally{h(!1)}},className:`flex flex-col gap-4`,children:[a?.email?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`set-password-email`,children:e(`auth.setPassword.email`)}),(0,K.jsx)(M,{id:`set-password-email`,type:`email`,autoComplete:`username`,value:a.email,disabled:!0,className:`bg-muted text-muted-foreground`})]}):null,(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`new-password`,children:e(`auth.setPassword.newPassword`)}),(0,K.jsx)(M,{id:`new-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:u,onChange:e=>d(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(j,{htmlFor:`confirm-password`,children:e(`auth.setPassword.confirmPassword`)}),(0,K.jsx)(M,{id:`confirm-password`,type:`password`,autoComplete:`new-password`,required:!0,minLength:8,value:f,onChange:e=>p(e.target.value)})]}),(0,K.jsx)(L,{type:`submit`,className:`w-full`,disabled:m,children:e(m?`auth.setPassword.submitting`:`auth.setPassword.submit`)})]})})]})})}var Mr=`/api/v1/auth`;function Nr(){let{t:e}=O(),[t]=c(),n=t.get(`token`),[i,a]=(0,G.useState)(`loading`),[o,s]=(0,G.useState)(``);return(0,G.useEffect)(()=>{if(!n){a(`error`),s(e(`auth.verifyEmail.missingToken`,{defaultValue:`Verification link is missing a token.`}));return}let t=!1;return(async()=>{try{let e=await fetch(`${Mr}/verify-email`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({token:n})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t?.message||`Verification failed: ${e.status}`)}t||a(`success`)}catch(n){t||(a(`error`),s(n.message||e(`auth.verifyEmail.errorDescription`,{defaultValue:`Verification failed. Please request a new link.`})))}})(),()=>{t=!0}},[n,e]),(0,K.jsx)(Q,{children:(0,K.jsxs)(P,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[i===`loading`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.verifyingTitle`,{defaultValue:`Verifying…`})}),(0,K.jsx)(k,{children:e(`auth.verifyEmail.verifyingDescription`,{defaultValue:`Hang tight while we confirm your email.`})})]}),(0,K.jsx)(A,{className:`flex justify-center py-6`,children:(0,K.jsx)(`div`,{className:`h-10 w-10 animate-spin rounded-full border-4 border-muted border-t-primary`})})]}),i===`success`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(`div`,{className:`mx-auto mb-2 flex size-12 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-500 ring-1 ring-emerald-500/30`,children:(0,K.jsx)(Oe,{className:`size-6`})}),(0,K.jsx)(I,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.successTitle`,{defaultValue:`Email verified`})}),(0,K.jsx)(k,{children:e(`auth.verifyEmail.successDescription`,{defaultValue:`Your email is confirmed. You can now sign in.`})})]}),(0,K.jsx)(A,{className:`text-center`,children:(0,K.jsx)(r,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.verifyEmail.signInLink`,{defaultValue:`Go to sign in`})})})]}),i===`error`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(`div`,{className:`mx-auto mb-2 flex size-12 items-center justify-center rounded-full bg-destructive/10 text-destructive ring-1 ring-destructive/30`,children:(0,K.jsx)(je,{className:`size-6`})}),(0,K.jsx)(I,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.errorTitle`,{defaultValue:`Verification failed`})}),(0,K.jsx)(k,{children:o||e(`auth.verifyEmail.errorDescription`,{defaultValue:`Verification failed. Please request a new link.`})})]}),(0,K.jsx)(A,{className:`text-center`,children:(0,K.jsx)(r,{to:`/login`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`auth.verifyEmail.backToSignIn`,{defaultValue:`Back to sign in`})})})]})]})})}function Pr(){let{t:e}=O(),t=o(),[n]=c(),r=n.get(`email`)??``,i=n.get(`redirect`)??``,{sendVerificationEmail:a}=T(),[s,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(!1),[f,p]=(0,G.useState)(null);return(0,K.jsx)(Q,{children:(0,K.jsxs)(P,{className:`border-border/60 shadow-sm shadow-primary/5 backdrop-blur supports-[backdrop-filter]:bg-card/95`,children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(`div`,{className:`mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-primary/10`,children:(0,K.jsx)(De,{className:`size-8 text-primary`})}),(0,K.jsx)(I,{className:`text-xl tracking-tight`,children:e(`auth.verifyEmail.title`,{defaultValue:`Verify your email address`})}),(0,K.jsx)(k,{children:e(`auth.verifyEmail.description`,{defaultValue:`We sent a verification link to your email address. Please click the link to verify your account.`})})]}),(0,K.jsx)(A,{children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[r?(0,K.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[e(`auth.verifyEmail.sentTo`,{defaultValue:`Sent to:`}),` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:r})]}):null,f?(0,K.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[(0,K.jsx)(`p`,{className:`font-medium`,children:e(`auth.verifyEmail.resendFailed`,{defaultValue:`Cannot resend verification email`})}),(0,K.jsx)(`p`,{className:`mt-1 text-destructive/90`,children:f})]}):null,(0,K.jsx)(L,{onClick:async()=>{if(!r){R.error(e(`auth.verifyEmail.resendFailed`,{defaultValue:`Cannot resend verification email`}),{description:e(`auth.verifyEmail.emailMissing`,{defaultValue:`Email address is missing`})});return}l(!0),p(null);try{await a(r,i||`/`),d(!0),R.success(e(`auth.verifyEmail.resentSuccess`,{defaultValue:`Verification email sent!`}),{description:e(`auth.verifyEmail.resentDescription`,{defaultValue:`Please check your inbox and click the verification link.`})})}catch(t){let n=t?.message?.trim()||e(`auth.verifyEmail.resendUnavailable`,{defaultValue:`Email delivery may not be configured for this environment. Contact support if this persists.`});d(!1),p(n),R.error(e(`auth.verifyEmail.resendFailed`,{defaultValue:`Cannot resend verification email`}),{description:n})}finally{l(!1)}},disabled:s||u,className:`w-full`,variant:u?`outline`:`default`,children:s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_e,{className:`mr-2 size-4 animate-spin`}),e(`auth.verifyEmail.resending`,{defaultValue:`Sending…`})]}):u?e(`auth.verifyEmail.resent`,{defaultValue:`Email sent! Check your inbox`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_e,{className:`mr-2 size-4`}),e(`auth.verifyEmail.resendButton`,{defaultValue:`Resend verification email`})]})}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,K.jsx)(`span`,{className:`w-full border-t`})}),(0,K.jsx)(`div`,{className:`relative flex justify-center text-xs uppercase`,children:(0,K.jsx)(`span`,{className:`bg-card px-2 text-muted-foreground`,children:e(`auth.verifyEmail.or`,{defaultValue:`Or`})})})]}),(0,K.jsx)(L,{onClick:()=>{let e=i?`?redirect=${encodeURIComponent(i)}`:``;t(`/login${e}`)},variant:`ghost`,className:`w-full`,children:e(`auth.verifyEmail.backToLogin`,{defaultValue:`Back to login`})}),(0,K.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:e(`auth.verifyEmail.checkSpam`,{defaultValue:`Didn't receive the email? Check your spam folder or contact support.`})})]})})]})})}var Fr=`/api/v1/auth`;function Ir(){let{t:e}=O(),t=o(),{user:n,isLoading:r}=T(),[i,a]=(0,G.useState)(!1),[s,c]=(0,G.useState)(null),l=typeof window<`u`?window.location.search:``,u=l.startsWith(`?`)?l.slice(1):l,d=new URLSearchParams(u),f=d.get(`client_id`)??void 0,p=d.get(`scope`)??``;(0,G.useEffect)(()=>{if(!r&&!n){let e=window.location.pathname+window.location.search;t(`/login?redirect=${encodeURIComponent(e)}`,{replace:!0})}},[n,r,t]),(0,G.useEffect)(()=>{if(!f)return;let e=!1;return fetch(`${Fr}/oauth2/applications/${encodeURIComponent(f)}/public`,{credentials:`include`}).then(async t=>{if(!t.ok)return;let n=await t.json().catch(()=>({}));if(e)return;let r=n?.data??n;c(r)}).catch(()=>{}),()=>{e=!0}},[f]);let m=p.split(/\s+/).filter(Boolean),h=async t=>{a(!0);try{let n=await fetch(`${Fr}/oauth2/consent`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({accept:t,oauth_query:u})}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.message||`Consent failed: ${n.status}`);let i=r.redirect_uri??r.redirectURI??r.url;if(i){window.location.href=i;return}let a=t?e(`oauth.consent.granted`,{defaultValue:`Access granted`}):e(`oauth.consent.denied`,{defaultValue:`Access denied`});R(a,{description:e(`oauth.consent.noRedirect`,{defaultValue:`No redirect URL returned by the server.`})})}catch(t){R.error(e(`oauth.consent.failed`,{defaultValue:`Consent failed`}),{description:t.message})}finally{a(!1)}},g=s?.name??s?.client_name??f??e(`oauth.consent.unknownApp`,{defaultValue:`an application`});return(0,K.jsx)(`div`,{className:`flex min-h-svh w-full flex-1 items-center justify-center bg-background px-4`,children:(0,K.jsxs)(P,{className:`w-full max-w-md`,children:[(0,K.jsxs)(N,{className:`items-center text-center`,children:[(0,K.jsx)(`div`,{className:`mb-3 rounded-full border bg-muted p-3`,children:s?.icon||s?.logo_uri?(0,K.jsx)(`img`,{src:s.icon||s.logo_uri,alt:``,className:`h-8 w-8 rounded`,onError:e=>{e.currentTarget.style.display=`none`}}):(0,K.jsx)(me,{className:`h-7 w-7 text-muted-foreground`})}),(0,K.jsx)(I,{className:`text-xl`,children:e(`oauth.consent.title`,{appName:g,defaultValue:`${g} wants to access your account`})}),(0,K.jsx)(k,{children:e(`oauth.consent.request`,{appName:g,suffix:n?.email?` (${n.email})`:``,defaultValue:`${g} is requesting permission${n?.email?` for ${n.email}`:``}.`})})]}),(0,K.jsxs)(A,{className:`space-y-4`,children:[m.length>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`mb-2 text-sm font-medium`,children:e(`oauth.consent.willAllow`,{defaultValue:`This app will be able to:`})}),(0,K.jsx)(`ul`,{className:`space-y-1.5 rounded-md border bg-muted/40 p-3 text-sm`,children:m.map(t=>(0,K.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(Ee,{className:`mt-0.5 h-4 w-4 text-green-600 dark:text-green-400`}),(0,K.jsx)(`span`,{children:Lr(t,e)})]},t))})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pt-2`,children:[(0,K.jsxs)(L,{variant:`outline`,onClick:()=>h(!1),disabled:i,children:[(0,K.jsx)(be,{className:`mr-2 h-4 w-4`}),e(`oauth.consent.deny`,{defaultValue:`Deny`})]}),(0,K.jsxs)(L,{onClick:()=>h(!0),disabled:i,children:[(0,K.jsx)(Ee,{className:`mr-2 h-4 w-4`}),i?e(`oauth.consent.submitting`,{defaultValue:`Authorizing…`}):e(`oauth.consent.authorize`,{defaultValue:`Authorize`})]})]}),(0,K.jsx)(`p`,{className:`pt-2 text-center text-xs text-muted-foreground`,children:e(`oauth.consent.footer`,{defaultValue:`You can revoke access at any time from your account settings.`})})]})]})})}function Lr(e,t){switch(e){case`openid`:return t(`oauth.consent.scope.openid`,{defaultValue:`Confirm your identity`});case`profile`:return t(`oauth.consent.scope.profile`,{defaultValue:`Read your basic profile (name, picture)`});case`email`:return t(`oauth.consent.scope.email`,{defaultValue:`Read your email address`});case`offline_access`:return t(`oauth.consent.scope.offlineAccess`,{defaultValue:`Stay signed in (refresh access)`});default:return e}}var Rr=`/api/v1/auth`;function $({children:e}){return(0,K.jsx)(`div`,{className:`flex min-h-svh w-full flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10`,children:(0,K.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-6`,children:[(0,K.jsxs)(`a`,{href:`#`,className:`flex items-center gap-2 self-center font-medium`,children:[(0,K.jsx)(`div`,{className:`flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground overflow-hidden`,children:gt()?(0,K.jsx)(`img`,{src:gt(),alt:B(),className:`h-full w-full object-contain`}):(0,K.jsx)(Oe,{className:`size-4`})}),B()]}),(0,K.jsx)(`div`,{className:`flex flex-col gap-6`,children:e})]})})}function zr(){let{t:e}=O(),t=a(),[n]=c(),r=n.get(`user_code`)??n.get(`code`)??``,i=n.get(`runtime_name`)??``,s=n.get(`runtime_version`)??``,{user:l,isLoading:u,getAuthConfig:d}=T(),f=o(),[m,h]=(0,G.useState)(!1),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(!1),[S,C]=(0,G.useState)(``),[w,E]=(0,G.useState)(null);if((0,G.useEffect)(()=>{let e=!0;return d().then(t=>{e&&E(t?.features?.deviceAuthorization===!0)}).catch(()=>{e&&E(!0)}),()=>{e=!1}},[d]),!r)return(0,K.jsx)($,{children:(0,K.jsx)(P,{children:(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{children:e(`auth.device.invalidTitle`,{defaultValue:`Invalid device link`})}),(0,K.jsx)(k,{children:e(`auth.device.invalidDescription`,{defaultValue:`No device code was provided in the URL.`})})]})})});if(w===!1)return(0,K.jsx)($,{children:(0,K.jsx)(P,{children:(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{children:e(`auth.device.disabledTitle`,{defaultValue:`Device authorization not enabled`})}),(0,K.jsx)(k,{children:e(`auth.device.disabledDescription`,{defaultValue:`This deployment does not have device authorization enabled, so this device cannot be approved here.`})})]})})});if(u||w===null)return(0,K.jsx)($,{children:(0,K.jsx)(P,{children:(0,K.jsx)(N,{className:`text-center`,children:(0,K.jsx)(k,{children:e(`auth.device.loading`,{defaultValue:`Loading…`})})})})});if(!l)return(0,K.jsx)(p,{to:`/login?redirect=${encodeURIComponent(`/auth/device${t.search}`)}`,replace:!0});if(v)return(0,K.jsx)($,{children:(0,K.jsx)(P,{children:(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(Oe,{className:`mx-auto mb-2 h-10 w-10 text-green-500`}),(0,K.jsx)(I,{children:e(`auth.device.approvedTitle`,{defaultValue:`Device authorized`})}),(0,K.jsx)(k,{children:e(`auth.device.approvedDescription`,{defaultValue:`You can return to the device — it should sign in shortly.`})})]})})});if(b)return(0,K.jsx)($,{children:(0,K.jsx)(P,{children:(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{children:e(`auth.device.deniedTitle`,{defaultValue:`Access denied`})}),(0,K.jsx)(k,{children:e(`auth.device.deniedDescription`,{defaultValue:`The device will not be granted access.`})})]})})});let D=async()=>{await fetch(`${Rr}/device?user_code=${encodeURIComponent(r)}`,{credentials:`include`}).catch(()=>{})};return(0,K.jsx)($,{children:(0,K.jsxs)(P,{children:[(0,K.jsxs)(N,{className:`text-center`,children:[(0,K.jsx)(I,{children:e(`auth.device.title`,{defaultValue:`Authorize new device`})}),(0,K.jsx)(k,{children:e(`auth.device.subtitle`,{email:l.email,defaultValue:`Approve this device to sign in as ${l.email}.`})})]}),(0,K.jsxs)(A,{className:`space-y-4`,children:[i?(0,K.jsxs)(`div`,{className:`rounded-md border bg-background px-4 py-3 text-center`,children:[(0,K.jsx)(`p`,{className:`mb-1 text-xs text-muted-foreground`,children:e(`auth.device.requesterLabel`,{defaultValue:`Connection request from`})}),(0,K.jsx)(`p`,{className:`font-medium`,children:i}),s?(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[B().toLowerCase(),` `,s]}):null]}):null,(0,K.jsxs)(`div`,{className:`rounded-md border bg-background px-4 py-3 text-center`,children:[(0,K.jsx)(`p`,{className:`mb-1 text-xs text-muted-foreground`,children:e(`auth.device.userCodeLabel`,{defaultValue:`Device code`})}),(0,K.jsx)(`p`,{className:`font-mono text-lg font-semibold tracking-widest`,children:r})]}),(0,K.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:e(`auth.device.approveWarning`,{defaultValue:`Only approve if you started this connection yourself a moment ago. Once approved, this runtime can access your organization's private packages.`})}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(`p`,{className:`text-center text-sm text-muted-foreground`,children:e(`auth.device.loggedInAs`,{email:l.email,defaultValue:`Signed in as ${l.email}`})}),S&&(0,K.jsx)(`p`,{className:`text-center text-sm text-destructive`,children:S}),(0,K.jsx)(L,{onClick:async()=>{C(``),h(!0);try{await D();let t=await fetch(`${Rr}/device/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({userCode:r})});if(!t.ok){let n=await t.json().catch(()=>({}));throw Error(n?.message??n?.error?.message??e(`auth.device.approveFailed`,{defaultValue:`Approval failed`}))}y(!0),R.success(e(`auth.device.approveSuccess`,{defaultValue:`Device authorized`}),{description:e(`auth.device.approveSuccessDescription`,{defaultValue:`You can close this window.`})})}catch(t){C(t?.message??e(`auth.device.approveFailed`,{defaultValue:`Approval failed`}))}finally{h(!1)}},className:`w-full`,disabled:m||g,children:m?e(`auth.device.approving`,{defaultValue:`Approving…`}):e(`auth.device.approve`,{defaultValue:`Approve device`})}),(0,K.jsx)(L,{onClick:async()=>{C(``),_(!0);try{await D(),await fetch(`${Rr}/device/deny`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({userCode:r})}),x(!0)}catch(t){C(t?.message??e(`auth.device.denyFailed`,{defaultValue:`Failed to deny request`}))}finally{_(!1)}},variant:`outline`,className:`w-full`,disabled:m||g,children:g?e(`auth.device.denying`,{defaultValue:`Denying…`}):e(`auth.device.deny`,{defaultValue:`Deny request`})}),(0,K.jsx)(`div`,{className:`text-center`,children:(0,K.jsx)(`button`,{type:`button`,className:`text-sm text-muted-foreground underline-offset-4 hover:underline`,onClick:()=>f(`/`),children:e(`auth.device.cancel`,{defaultValue:`Cancel`})})})]})]})]})})}var Br=`/api/v1/auth`;function Vr(){try{if(typeof document>`u`)return`/`;let e=document.querySelector(`base`)?.getAttribute(`href`);return e&&new URL(e,window.location.origin).pathname.replace(/\/$/,``)||`/`}catch{return`/`}}var Hr=Vr();function Ur(){let{user:e}=T();return(0,K.jsx)(Ge,{userId:e?.id,children:(0,K.jsx)(We,{})})}function Wr(){let e=a();return(0,G.useEffect)(()=>{document.title=B();let e=mt();if(e){let t=document.getElementById(`favicon`);t&&(t.href=e,t.type=e.endsWith(`.svg`)?`image/svg+xml`:`image/png`)}},[e]),null}function Gr(){return(0,K.jsxs)(E,{authUrl:Br,children:[(0,K.jsx)(qe,{position:`bottom-right`}),(0,K.jsx)(Xn,{}),(0,K.jsxs)(l,{basename:Hr,children:[(0,K.jsx)(Wr,{}),(0,K.jsx)(at,{children:(0,K.jsxs)(m,{children:[(0,K.jsx)(u,{path:`/login`,element:(0,K.jsx)(Sr,{})}),(0,K.jsx)(u,{path:`/register`,element:(0,K.jsx)(Er,{})}),(0,K.jsx)(u,{path:`/forgot-password`,element:(0,K.jsx)(Or,{})}),(0,K.jsx)(u,{path:`/reset-password`,element:(0,K.jsx)(kr,{})}),(0,K.jsx)(u,{path:`/set-password`,element:(0,K.jsx)(jr,{})}),(0,K.jsx)(u,{path:`/verify-email`,element:(0,K.jsx)(Nr,{})}),(0,K.jsx)(u,{path:`/verify-email-prompt`,element:(0,K.jsx)(Pr,{})}),(0,K.jsx)(u,{path:`/setup`,element:(0,K.jsx)(Dn,{})}),(0,K.jsx)(u,{path:`/oauth/consent`,element:(0,K.jsx)(Ir,{})}),(0,K.jsx)(u,{path:`/auth/device`,element:(0,K.jsx)(zr,{})}),(0,K.jsx)(u,{path:`/accept-invitation/:invitationId`,element:(0,K.jsx)(Je,{})}),(0,K.jsx)(u,{path:`/f/:slug`,element:(0,K.jsx)(qn,{mode:`public`})}),(0,K.jsx)(u,{path:`/s/:token`,element:(0,K.jsx)($n,{})}),(0,K.jsx)(u,{path:`/studio`,element:(0,K.jsx)(Y,{children:(0,K.jsxs)(`div`,{className:`flex min-h-screen flex-col bg-background text-foreground`,children:[(0,K.jsx)(`header`,{className:`flex shrink-0 items-center border-b px-3 py-2`,children:(0,K.jsx)(r,{to:`/home`,title:`返回主页`,className:`inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-[13px] font-semibold hover:bg-muted`,children:B()})}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,K.jsx)(Ze,{})})]})})}),(0,K.jsx)(u,{path:`/studio/:packageId`,element:(0,K.jsx)(p,{to:`data`,replace:!0})}),(0,K.jsx)(u,{path:`/studio/:packageId/:tab`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(et,{})})}),(0,K.jsx)(u,{path:`/forms/:name`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Yn,{})})}),(0,K.jsxs)(u,{path:`/docs`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(pr,{})}),children:[(0,K.jsx)(u,{index:!0,element:(0,K.jsx)(cr,{})}),(0,K.jsx)(u,{path:`:slug`,element:(0,K.jsx)(dr,{})}),(0,K.jsx)(u,{path:`:slug/:name`,element:(0,K.jsx)(sr,{})})]}),(0,K.jsx)(u,{path:`/home`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Ur,{})})}),(0,K.jsx)(u,{path:`/dev/master-detail`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(jt,{})})}),(0,K.jsx)(u,{path:`/dev/lists`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Pt,{})})}),(0,K.jsx)(u,{path:`/dev/modal`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Ft,{})})}),(0,K.jsx)(u,{path:`/dev/lookup`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(It,{})})}),(0,K.jsx)(u,{path:`/dev/row-actions`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Vt,{})})}),(0,K.jsx)(u,{path:`/organizations`,element:(0,K.jsx)(Y,{requireOrganization:!1,children:(0,K.jsx)(nt,{children:(0,K.jsx)(Ye,{})})})}),(0,K.jsxs)(u,{path:`/organizations/:slug`,element:(0,K.jsx)(Y,{requireOrganization:!1,children:(0,K.jsx)(Ue,{})}),children:[(0,K.jsx)(u,{index:!0,element:(0,K.jsx)(p,{to:`members`,replace:!0})}),(0,K.jsx)(u,{path:`members`,element:(0,K.jsx)(tt,{})}),(0,K.jsx)(u,{path:`invitations`,element:(0,K.jsx)(Qe,{})}),(0,K.jsx)(u,{path:`settings`,element:(0,K.jsx)(Ve,{})})]}),(0,K.jsx)(u,{path:`/system/*`,element:(0,K.jsx)(Re,{})}),(0,K.jsx)(u,{path:`/ai`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Ie,{children:(0,K.jsx)(Ke,{})})})}),(0,K.jsx)(u,{path:`/ai/:agent`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Ie,{children:(0,K.jsx)(Ke,{})})})}),(0,K.jsx)(u,{path:`/ai/:agent/:conversationId`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(Ie,{children:(0,K.jsx)(Ke,{})})})}),(0,K.jsx)(u,{path:`/apps/:appName/*`,element:(0,K.jsx)(Y,{children:(0,K.jsx)(fn,{})})}),(0,K.jsx)(u,{path:`/`,element:(0,K.jsx)(Y,{requireOrganization:!1,children:(0,K.jsx)(_n,{})})}),(0,K.jsx)(u,{path:`*`,element:(0,K.jsx)(p,{to:`/`,replace:!0})})]})})]})]})}async function Kr(e){try{let t=await fetch(`/api/v1/i18n/translations/${e}`);if(!t.ok)return console.warn(`[i18n] Failed to load translations for '${e}': HTTP ${t.status}`),{};let n=await t.json(),r;return r=n?.data?.translations&&typeof n.data.translations==`object`?n.data.translations:n,x(r)?g(r):r}catch(t){return console.warn(`[i18n] Failed to load translations for '${e}':`,t),{}}}async function qr(){try{let e=await fetch(`/api/v1/i18n/locales`);if(!e.ok)return console.warn(`[i18n] Failed to load the app locale list: HTTP ${e.status}`),[];let t=await e.json(),n=t?.data?.locales??t?.locales??t;if(!Array.isArray(n))return console.warn(`[i18n] Unexpected /i18n/locales payload; ignoring.`),[];let r=[];for(let e of n){let t=typeof e==`string`?e:e?.code;typeof t==`string`&&t.length>0&&!r.includes(t)&&r.push(t)}return r}catch(e){return console.warn(`[i18n] Failed to load the app locale list:`,e),[]}}async function Jr(e){try{let t=await fetch(`${e}/api/v1/auth/me/localization`,{credentials:`include`,headers:{Accept:`application/json`}});if(!t.ok)return;let n=await t.json();if(n?.authenticated===!1)return;se(n?.locale)}catch{}}async function Yr(e,t=500){if(ue()||ee())return;let n=Jr(e);await Promise.race([n,new Promise(e=>setTimeout(e,t))])}var Xr=`auth-session-token`,Zr=`auth-active-organization-id`;async function Qr(e){if(typeof window>`u`)return;let t;try{t=localStorage.getItem(Xr)}catch{return}if(t)try{let n=await fetch(`${e}/get-session`,{method:`GET`,credentials:`omit`,headers:{Authorization:`Bearer ${t}`,Accept:`application/json`}});if(n.ok){let e=await n.json().catch(()=>null);if(e?.user??e?.data?.user??null)return}localStorage.removeItem(Xr),localStorage.removeItem(Zr)}catch{}}D.registerLazy(`object-map`,()=>s(()=>import(`./plugin-map-TrYBEx8q.js`).then(e=>e.t),__vite__mapDeps([0,2]),import.meta.url),{namespace:`plugin-map`,category:`view`}),D.registerLazy(`map`,()=>s(()=>import(`./plugin-map-TrYBEx8q.js`).then(e=>e.t),__vite__mapDeps([0,2]),import.meta.url),{namespace:`view`,category:`view`}),D.registerLazy(`object-tree`,()=>s(()=>import(`./plugin-tree-Br5XanqO.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-tree`,category:`view`}),D.registerLazy(`tree`,()=>s(()=>import(`./plugin-tree-Br5XanqO.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`view`,category:`view`});for(let e of[`dashboard`,`metric`,`metric-card`,`object-metric`,`pivot`,`object-pivot`,`dashboard-grid`,`object-data-table`])D.registerLazy(e,()=>s(()=>import(`./plugin-dashboard-fdM1jm2j.js`).then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url),{namespace:`plugin-dashboard`,category:`view`});D.registerLazy(`chart`,()=>s(()=>import(`./plugin-charts-CBUIhVeW.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-charts`,category:`chart`});for(let e of[`object-chart`,`bar-chart`,`pie-chart`,`donut-chart`,`radar-chart`,`scatter-chart`,`line-chart`,`area-chart`,`advanced-chart`,`chart:bar`])D.registerLazy(e,()=>s(()=>import(`./plugin-charts-CBUIhVeW.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-charts`,category:`chart`});D.registerLazy(`object-gantt`,()=>s(()=>import(`./plugin-gantt-CRJpVrrP.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-gantt`,category:`view`}),D.registerLazy(`gantt`,()=>s(()=>import(`./plugin-gantt-CRJpVrrP.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`view`,category:`view`}),D.registerLazy(`markdown`,()=>s(()=>import(`./plugin-markdown-CbQeAjXv.js`).then(e=>e.n),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-markdown`,category:`display`}),D.registerLazy(`object-timeline`,()=>s(()=>import(`./plugin-timeline-B30kCAGi.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-timeline`,category:`view`}),D.registerLazy(`timeline`,()=>s(()=>import(`./plugin-timeline-B30kCAGi.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`view`,category:`view`}),D.registerLazy(`object-calendar`,()=>s(()=>import(`./plugin-calendar-CQVTjox_.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-calendar`,category:`view`}),D.registerLazy(`calendar`,()=>s(()=>import(`./plugin-calendar-CQVTjox_.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`view`,category:`view`}),D.registerLazy(`calendar-view`,()=>s(()=>import(`./plugin-calendar-CQVTjox_.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-calendar`,category:`view`}),D.registerLazy(`object-kanban`,()=>s(()=>import(`./plugin-kanban-CNm7DssD.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-kanban`,category:`view`}),D.registerLazy(`kanban`,()=>s(()=>import(`./plugin-kanban-CNm7DssD.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`view`,category:`view`});for(let e of[`kanban-ui`,`kanban-enhanced`])D.registerLazy(e,()=>s(()=>import(`./plugin-kanban-CNm7DssD.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-kanban`,category:`view`});D.registerLazy(`report`,()=>s(()=>import(`./plugin-report-Bg1oh9SG.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-report`,category:`view`});for(let e of[`report-viewer`,`spec-report`])D.registerLazy(e,()=>s(()=>import(`./plugin-report-Bg1oh9SG.js`).then(e=>e.t),__vite__mapDeps([0]),import.meta.url),{namespace:`plugin-report`,category:`view`});var $r=(0,G.lazy)(()=>s(()=>import(`./ApiConsolePage-CgXbOsFC.js`).then(e=>({default:e.ApiConsolePage})),__vite__mapDeps([0,1]),import.meta.url)),ei=(0,G.lazy)(()=>s(()=>import(`./FlowRunsPage-DL7MhL_U.js`).then(e=>({default:e.FlowRunsPage})),__vite__mapDeps([0,1]),import.meta.url)),ti=(0,G.lazy)(()=>s(()=>import(`./PublicFormsPage-BX6YXY8w.js`).then(e=>({default:e.PublicFormsPage})),__vite__mapDeps([0,1]),import.meta.url));function ni({label:e}){return(0,K.jsxs)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:[`Loading `,e,`…`]})}V({ref:`developer:api-console`,label:`API Console`,source:`@object-ui/console`,component:e=>(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(ni,{label:`API console`}),children:(0,K.jsx)($r,{...e})})}),V({ref:`developer:flow-runs`,label:`Flow Runs`,source:`@object-ui/console`,component:e=>(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(ni,{label:`flow runs`}),children:(0,K.jsx)(ei,{...e})})}),V({ref:`developer:public-forms`,label:`Public Forms`,source:`@object-ui/console`,component:e=>(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(ni,{label:`public forms`}),children:(0,K.jsx)(ti,{...e})})});var ri=(0,G.lazy)(()=>s(()=>import(`./src-BBKXMp-o.js`).then(e=>e.t).then(e=>({default:e.BuilderLanding})),__vite__mapDeps([0,1]),import.meta.url));V({ref:`studio:builder`,label:`应用构建`,source:`@object-ui/console`,component:e=>(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:`加载应用构建器…`}),children:(0,K.jsx)(ri,{...e})})});var ii=(0,G.lazy)(()=>s(()=>import(`./ProfilePage-DeDhni58.js`).then(e=>({default:e.ProfilePage})),__vite__mapDeps([0]),import.meta.url));function ai(){let{t:e}=O();return(0,K.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:e(`common.loading`,{defaultValue:`Loading…`})})}V({ref:`account:profile_card`,label:`My Profile`,source:`@object-ui/console`,component:e=>(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(ai,{}),children:(0,K.jsx)(ii,{...e})})});var oi=(0,G.lazy)(()=>s(()=>import(`./ApprovalsInboxPage-CxmrNrwP.js`).then(e=>({default:e.ApprovalsInboxPage})),__vite__mapDeps([0,1]),import.meta.url));function si(){let{t:e}=O();return(0,K.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:e(`common.loading`,{defaultValue:`Loading…`})})}V({ref:`approvals:inbox`,label:`Approvals Inbox`,source:`@object-ui/console`,component:e=>(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(si,{}),children:(0,K.jsx)(oi,{...e})})});var ci=`/api/v1/auth`;Xe(),Me();var li=``.replace(/\/+$/,``);Promise.all([ft(li),Qr(ci),Yr(li)]).finally(()=>{document.title=B();let e=mt();if(e){let t=document.getElementById(`favicon`);t&&(t.href=e,t.type=e.endsWith(`.svg`)?`image/svg+xml`:`image/png`)}let t=_t({enabled:!0,name:B(),shortName:ht(),description:pt(),themeColor:dt(),backgroundColor:`#ffffff`,display:`standalone`,startUrl:`./`,scope:`./`,orientation:`any`,icons:[{src:e||`./favicon.svg`,sizes:`any`,type:`image/svg+xml`,purpose:`any`}]}),n=new Blob([JSON.stringify(t)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.querySelector(`link[rel="manifest"]`);i&&i.remove();let a=document.createElement(`link`);a.rel=`manifest`,a.href=r,document.head.appendChild(a),kt.createRoot(document.getElementById(`root`)).render((0,K.jsx)(G.StrictMode,{children:(0,K.jsx)(yt,{pwa:{enabled:!0,name:B(),shortName:ht()},children:(0,K.jsx)(de,{loadLanguage:Kr,loadLocales:qr,children:(0,K.jsx)(Gr,{})})})}))});
|