@objectstack/console 17.1.0 → 17.3.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 +731 -0
- package/README.md +26 -10
- package/dist/.objectstack-injection.json +2 -2
- package/dist/.objectui-sha +1 -1
- package/dist/assets/ActionResultDialog-CQwenjVA.js +9 -0
- package/dist/assets/AiPendingActionsPage-7gZ8zlOy.js +1 -0
- package/dist/assets/ApiConsolePage-DUF0ysH7.js +1 -0
- package/dist/assets/{AppDocsIndex-DVrJTsbv.js → AppDocsIndex-CP_AVG4X.js} +1 -1
- package/dist/assets/AppManagementPage-BJktnoa5.js +1 -0
- package/dist/assets/ApprovalsInboxPage-DlnxY-uy.js +1 -0
- package/dist/assets/{AuditLogPage-B-2e1YhN.js → AuditLogPage-DIJPRjji.js} +1 -1
- package/dist/assets/{ComponentNavView-BVbkfJfE.js → ComponentNavView-C84QByT7.js} +1 -1
- package/dist/assets/CreateViewDialog-Zbd9Cagm.js +1 -0
- package/dist/assets/DashboardView-UyKHklBx.js +1 -0
- package/dist/assets/{DeveloperHubPage-CWq2uYpr.js → DeveloperHubPage-BRyNdrCJ.js} +1 -1
- package/dist/assets/DocPage-Bx8ZXCYt.js +1 -0
- package/dist/assets/{DocShell-UFsFTSr-.js → DocShell-Ipy_IDvh.js} +1 -1
- package/dist/assets/DocsIndex-CmY-7OQR.js +1 -0
- package/dist/assets/DocsLayout-BNsSvaz2.js +1 -0
- package/dist/assets/DocsSlug-Cb_NMM1k.js +1 -0
- package/dist/assets/ExpressionProvider-DqGWVuxV.js +1 -0
- package/dist/assets/FlowRunsPage-B6ustUgi.js +1 -0
- package/dist/assets/{IntegrationsPage-DdKbqwGE.js → IntegrationsPage-chOxmiyU.js} +2 -2
- package/dist/assets/InterfaceListPage-DVETnQm5.js +1 -0
- package/dist/assets/MarketplaceInstalledPage-DA5pjhAz.js +1 -0
- package/dist/assets/MarketplacePackagePage-dCIVHBFi.js +4 -0
- package/dist/assets/MarketplacePage-wJb6g1p7.js +1 -0
- package/dist/assets/MetadataInspector-Cu-n1FYz.js +1 -0
- package/dist/assets/ObjectDataPage-CP-YSZYQ.js +1 -0
- package/dist/assets/PageView-B1_ibRuM.js +1 -0
- package/dist/assets/ProfilePage-DEr5iZVB.js +1 -0
- package/dist/assets/PublicFormsPage-CBcKQbNl.js +1 -0
- package/dist/assets/RecordDetailView-A8bbPnkK.js +3 -0
- package/dist/assets/RecordFormPage-CGQlYWDk.js +1 -0
- package/dist/assets/ReportDefaultInspector-R_p6YStL.js +1 -0
- package/dist/assets/ReportView-BTMrtcGH.js +2 -0
- package/dist/assets/RuntimeDraftBar-agGU39FL.js +1 -0
- package/dist/assets/SchemaForm-DJbupOno.js +3 -0
- package/dist/assets/SearchResultsPage-CHhZUc6L.js +1 -0
- package/dist/assets/SettingsHub-BGLR_gS7.js +1 -0
- package/dist/assets/SettingsView-Bq-7Zkzs.js +1 -0
- package/dist/assets/SkeletonDetail-B4-UKxai.js +1 -0
- package/dist/assets/SystemHubPage-CVZVag1e.js +1 -0
- package/dist/assets/{abnfDiagram-N423BO3Z-DfpQlDUF.js → abnfDiagram-VCTEODGH-DUS5D5dU.js} +1 -1
- package/dist/assets/app-shell-eager-leaves-BB0oaPx6.js +1 -0
- package/dist/assets/{utils-CJ4UwXMF.js → appRoute-DEVGXLLH.js} +1 -1
- package/dist/assets/architecture-7GRP2DOG-kzM7RUjO.js +1 -0
- package/dist/assets/{architectureDiagram-T3A2C74G-Ej_4n3NG.js → architectureDiagram-5GKGNRK7-mGW8P1lC.js} +1 -1
- package/dist/assets/blockDiagram-OSKFZWR5-Bz2hnVmp.js +129 -0
- package/dist/assets/c4Diagram-7LVT6UL2-DU3u1Y6c.js +38 -0
- package/dist/assets/channel-FD4s9EIH.js +1 -0
- package/dist/assets/{chunk-U6XO7XAA-D-dXvZaW.js → chunk-2ZTRR5NV-DXmA5XXf.js} +1 -1
- package/dist/assets/chunk-3NF5O7KM-B8Q7HUio.js +168 -0
- package/dist/assets/{chunk-YOTPTUD7-CDtXQZ13.js → chunk-3Z5EZCMW-D3OlaP15.js} +1 -1
- package/dist/assets/chunk-4HAMMTFA-BPKwX4iB.js +62 -0
- package/dist/assets/{chunk-BIQX33UG-DMScvo0C.js → chunk-5V3GS4D5-sE73jHoi.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-DG70Besp.js → chunk-6AZGARVD-dsTIs5yl.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-BrKM6vC-.js → chunk-6EIED4P4-BB4xaK3K.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-DsJHM8am.js → chunk-6K3QC6MW-DaG1LefG.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-Dch_xyhf.js → chunk-6TQVIW2G-DL8WEcT0.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-lCTbN-f1.js → chunk-747NJXEK-Bdie6H1T.js} +1 -1
- package/dist/assets/chunk-75Z2AOVW-CkSdnmiC.js +2 -0
- package/dist/assets/chunk-CLGD4ZFX-BTkDISwp.js +1 -0
- package/dist/assets/chunk-DU6HZSFF-BkY4hAzc.js +127 -0
- package/dist/assets/{chunk-2GRJ4B5K-D1if-ThW.js → chunk-F27PBJKO-DUKg0YWV.js} +1 -1
- package/dist/assets/{chunk-KEIR6QF5-ydf36Hye.js → chunk-FOHPRMQF-C65HoZVt.js} +2 -2
- package/dist/assets/chunk-GMAD6QVW-DZo_NykZ.js +72 -0
- package/dist/assets/chunk-GVQU2GXP-9ELY9S6X.js +1 -0
- package/dist/assets/chunk-H2I77ZZE-vCr_buP7.js +1 -0
- package/dist/assets/{chunk-GF5L2VYU-Dgjjn2FR.js → chunk-HLEWEB6X-iPkY2ESt.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-CzQYydMJ.js → chunk-I5DQTOEV-Cz6Y6T9y.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-BuOxxvKk.js → chunk-ICYGCRZG-DdtFYQ2l.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-CCth14ZS.js → chunk-IH6LHLGP-DybuHD8B.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-DIigEFGo.js → chunk-KI3K4JFJ-CB_CI00L.js} +1 -1
- package/dist/assets/chunk-L3NEJ4N5-Bzz35TZJ.js +1 -0
- package/dist/assets/chunk-LNGE3PJU-DWpGwHrW.js +34 -0
- package/dist/assets/chunk-LQGUR6SS-iVI0GACK.js +1 -0
- package/dist/assets/chunk-OSK3NFVY-DcRwXCQD.js +10 -0
- package/dist/assets/{chunk-5TONJI2A-Bdh0MHqz.js → chunk-OUJLGHUK-TbeyE6CA.js} +1 -1
- package/dist/assets/chunk-P2QGCYS3-nx2-dM5t.js +1 -0
- package/dist/assets/{chunk-KBJHAD2P-DI4-lUt-.js → chunk-POPQ4Y6H-BxLOacOG.js} +1 -1
- package/dist/assets/{chunk-4I5QYGJK-DlrWrdEa.js → chunk-PWAF6VOD-2mst9kZu.js} +1 -1
- package/dist/assets/{chunk-6Q2QTUOP-C2vvuHlO.js → chunk-SVP7TREG-C3BMpr4x.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-B4CrDa5p.js → chunk-UY3FDG6J-CDAtW6MI.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-T_shrJhj.js → chunk-XHIXRSVI-CqmtoxrP.js} +1 -1
- package/dist/assets/chunk-XXDRQBXY-iNC8aYmk.js +1 -0
- package/dist/assets/{chunk-5RXB4S5H-JwFhdddt.js → chunk-ZLD2IHE6-ZFqtFJbj.js} +2 -2
- package/dist/assets/classDiagram-CYGNFDIV-D5Pd2TCl.js +1 -0
- package/dist/assets/classDiagram-v2-TLXNO2FR-D5Pd2TCl.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-XP-DnSP5.js → cose-bilkent-JH36ORCC-CPQv9aQH.js} +1 -1
- package/dist/assets/createDerive-Best2JCj.js +2 -0
- package/dist/assets/cynefin-OW5HDTMX-Dtvf1C60.js +1 -0
- package/dist/assets/{cynefinDiagram-MW4NZA55-B8MvpqXe.js → cynefinDiagram-5FMLGOSQ-Lnly8IJd.js} +1 -1
- package/dist/assets/cytoscape.esm-CGd-uY3x.js +321 -0
- package/dist/assets/dagre-OS7QT2EB-CdXLxmTK.js +4 -0
- package/dist/assets/dagre-PrKaheQc.js +1 -0
- package/dist/assets/data-adapter-DL25qpAe.js +5 -0
- package/dist/assets/default-inspector-registry-DeEG98bO.js +1 -0
- package/dist/assets/{diagram-7IWD3JNH-Xj62y5BF.js → diagram-S7CK7UJ4-DE8I3gxQ.js} +4 -4
- package/dist/assets/{diagram-UB23O5K3-bseKIzhv.js → diagram-UQ7AKVKN-D2xQpbEq.js} +1 -1
- package/dist/assets/{diagram-B4RE2ZJO-mI-iOCGl.js → diagram-VSXAHHWV-DnttDSlO.js} +1 -1
- package/dist/assets/{diagram-Q27KOJAE-B98Knrnh.js → diagram-VX7I27RA-BSEwkn7K.js} +1 -1
- package/dist/assets/{diagram-LBJQPF4R-BMTSoZch.js → diagram-Z3DM3KII-BgB9f0Nv.js} +1 -1
- package/dist/assets/dist-BpPy7hlB.js +5 -0
- package/dist/assets/{ebnfDiagram-BXEA7PRR-Bgo10FP1.js → ebnfDiagram-PWID7BFC-32WvKbS2.js} +1 -1
- package/dist/assets/erDiagram-2YWLMYGG-Dwf8uAdl.js +99 -0
- package/dist/assets/eventmodeling-NTZA5JFV-CSwP2CpK.js +1 -0
- package/dist/assets/expressionUser-CASszt1z.js +1 -0
- package/dist/assets/flowDiagram-T62WH6J4-CqVSNJ8T.js +1 -0
- package/dist/assets/framework-BfSv4Kb0.js +36 -0
- package/dist/assets/{ganttDiagram-PKOTCBZU-CrmKcYGt.js → ganttDiagram-EL5Y4UJY-DqYIE0Cu.js} +2 -2
- package/dist/assets/getIcon-CgyYxSEC.js +1 -0
- package/dist/assets/gitGraph-4MIJSDKK--Dc33TN5.js +1 -0
- package/dist/assets/{gitGraphDiagram-DS77QQ5N-COu0mOui.js → gitGraphDiagram-WWUBYQGX-D1dYmoGu.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-DUQut-ZU.js → highlighted-body-OFNGDK62-BxO9mjPI.js} +1 -1
- package/dist/assets/i18n-Cfqor-xb.js +9 -0
- package/dist/assets/i18n-locales-Bz4c8KXc.js +31 -0
- package/dist/assets/index-BU-FzlQ6.js +20 -0
- package/dist/assets/index-_VyGO4ms.css +2 -0
- package/dist/assets/info-A6RAGUB7-DBa3mCQO.js +1 -0
- package/dist/assets/{infoDiagram-6WML65LV-BT0Q6MIs.js → infoDiagram-FKFFQAWI-Cr1-5_Am.js} +1 -1
- package/dist/assets/infrastructure-CIpDEFyQ.js +3 -0
- package/dist/assets/{ishikawaDiagram-WSZJBQD7-kvPjMvBP.js → ishikawaDiagram-5VMMS53U-Bsjx7BsE.js} +1 -1
- package/dist/assets/{journeyDiagram-NVQOT4AX-DhXy7wxt.js → journeyDiagram-EYS64GPL-1scn5Z5c.js} +2 -2
- package/dist/assets/{kanban-definition-27J2QSJJ-CFDavpZY.js → kanban-definition-UXKFOSKX-DjLQAv5U.js} +2 -2
- package/dist/assets/mermaid-GHXKKRXX-NzEcDxBh.js +1 -0
- package/dist/assets/{mermaid-parser.core-Dd2B8Ckv.js → mermaid-parser.core-DUt1FNlO.js} +1 -1
- package/dist/assets/mermaid.core-pW40dd4u.js +10 -0
- package/dist/assets/metadata-admin-pawEBYI9.js +9 -0
- package/dist/assets/{mindmap-definition-FAOFIHXS-ITGoV4nW.js → mindmap-definition-THT77NOG-CUcYMB9H.js} +1 -1
- package/dist/assets/nav-selection-Dzm_mA3C.js +1 -0
- package/dist/assets/packet-AYTQ26CC-CPP93DZD.js +1 -0
- package/dist/assets/{pegDiagram-VL7TDLO6-BoRu9yvl.js → pegDiagram-XKGWAZYB-CT1r3sRa.js} +1 -1
- package/dist/assets/pie-WAS4IAKB-B-zzBvuc.js +1 -0
- package/dist/assets/{pieDiagram-7S7Q4E2Y-DVsM9krU.js → pieDiagram-E7YTZNPT-CSi-V1LQ.js} +3 -3
- package/dist/assets/plugin-calendar-BwiiCIjv.js +1 -0
- package/dist/assets/plugin-charts-CDGkx7z5.js +7 -0
- package/dist/assets/plugin-chatbot-BGnkLzFS.js +122 -0
- package/dist/assets/plugin-dashboard-Bj4ldCX6.js +6 -0
- package/dist/assets/plugin-form-_fjHxKTV.js +1 -0
- package/dist/assets/plugin-gantt-zR8DkpEg.js +63 -0
- package/dist/assets/plugin-grid-kkbz4uec.js +9 -0
- package/dist/assets/plugin-kanban-DA0eW6yj.js +1 -0
- package/dist/assets/plugin-map-DukneTNg.js +1 -0
- package/dist/assets/{plugin-markdown-7fyNN0UM.js → plugin-markdown-B7zwZHmn.js} +1 -1
- package/dist/assets/plugin-report-DaPtlsJr.js +59 -0
- package/dist/assets/plugin-timeline-B6rsNNAK.js +1 -0
- package/dist/assets/plugin-tree-DauauLFc.js +1 -0
- package/dist/assets/plugin-view-5qxxRyZZ.js +1 -0
- package/dist/assets/plugins-views-iYcMmImr.js +4 -0
- package/dist/assets/{quadrantDiagram-CIZ2JOQS-C4VzXHnp.js → quadrantDiagram-AXDQQJYC-DUJ_94hm.js} +1 -1
- package/dist/assets/radar-RG4KPBEZ-DWmbpYEk.js +1 -0
- package/dist/assets/railroad-74A4TZTK-xJ7dMu2F.js +1 -0
- package/dist/assets/railroad-abnf-HS5TGJTU-Cw4KG_nE.js +1 -0
- package/dist/assets/railroad-ebnf-LZEXJU2U-C0cgrfTl.js +1 -0
- package/dist/assets/railroad-peg-WCYAUIDC-DOEGG9oQ.js +1 -0
- package/dist/assets/{railroadDiagram-AXF67PYL-DqZ3yKWv.js → railroadDiagram-O6MQD6OU-CEyfAhzM.js} +1 -1
- package/dist/assets/{requirementDiagram-LRYGKXZP-BeH0P3vD.js → requirementDiagram-IS5BZ75X-CAK7hvBg.js} +2 -2
- package/dist/assets/{runtime-metadata-persistence-DpS5GXuQ.js → runtime-metadata-persistence-DYPxFzHI.js} +1 -1
- package/dist/assets/{sankeyDiagram-W5VNT64P-Bu_tPh-A.js → sankeyDiagram-P5KCCOFB-DgYJh7uz.js} +2 -2
- package/dist/assets/{sequenceDiagram-SI44F4Z6-BWEuLn1a.js → sequenceDiagram-WJ2MYXX4-DsQerPtC.js} +1 -1
- package/dist/assets/{src-CY2xhbXR.js → src-CVJP2nIc.js} +1 -1
- package/dist/assets/src-JX1BkhmR.js +17 -0
- package/dist/assets/{src-ClOOPIkS.js → src-S6pzKItc.js} +1 -1
- package/dist/assets/src-_DxAIBqo.js +1 -0
- package/dist/assets/{stateDiagram-OKZ733FA-Cp7aDYsZ.js → stateDiagram-XQSTLZYL-BJndPKik.js} +1 -1
- package/dist/assets/stateDiagram-v2-IH3M54BS-Bi94bTLl.js +1 -0
- package/dist/assets/studioEntry-C6G8U-LG.js +1 -0
- package/dist/assets/submitRedirect-UXd9NsjL.js +1 -0
- package/dist/assets/swimlanes-V6O3JKXN-BiKyiEJr.js +1 -0
- package/dist/assets/swimlanesDiagram-JKAHXJPX-DKIR852g.js +8 -0
- package/dist/assets/{timeline-definition-Z64GVDOM-BcUiJfLU.js → timeline-definition-24CTP7MA-CW5rY3PX.js} +2 -2
- package/dist/assets/treeView-Q6P3EWNA-BcWCBGcU.js +1 -0
- package/dist/assets/treemap-WGGIJYW6-DMTEJzXV.js +1 -0
- package/dist/assets/ui-components-D2lrjG-t.js +43 -0
- package/dist/assets/ui-layout-UUTFXV6S.js +1 -0
- package/dist/assets/use-book-data-qUZAxIs0.js +1 -0
- package/dist/assets/useActionModal-CkM-zGdy.js +1 -0
- package/dist/assets/usePackageL10n-F9isJ9pn.js +1 -0
- package/dist/assets/useSettingsLabel-CSZBfUiw.js +1 -0
- package/dist/assets/utils-MjUhYVsx.js +1 -0
- package/dist/assets/{vendor-charts-BEGSmcjR.js → vendor-charts-CY9WhhzX.js} +1 -1
- package/dist/assets/vendor-i18n-C1AQDWux.js +1 -0
- package/dist/assets/{vendor-markdown-C_Ip9E_I.js → vendor-markdown-BW_XFZ_b.js} +25 -25
- package/dist/assets/vendor-objectstack-BeKUVjuj.js +270 -0
- package/dist/assets/{vennDiagram-T6HMQDX7-BKJsL5fS.js → vennDiagram-4TSXK5OY-C79cMc25.js} +1 -1
- package/dist/assets/wardley-WFR3VGLG-BRyRizpT.js +1 -0
- package/dist/assets/{wardleyDiagram-T6FBY63Y-CZ0aMbYX.js → wardleyDiagram-VM6X3IG4-BAO0_jUk.js} +1 -1
- package/dist/assets/{xychartDiagram-ELKLHX3M-BpK2RmQ_.js → xychartDiagram-S5SC5T6Z-BIRd7YRo.js} +3 -3
- package/dist/eager-closure.json +318 -0
- package/dist/index.html +271 -15
- package/package.json +2 -2
- package/dist/assets/AdapterProvider-3zTVoQKF.js +0 -3
- package/dist/assets/AiPendingActionsPage-DD5DLXIK.js +0 -1
- package/dist/assets/ApiConsolePage-CSQNdOPN.js +0 -1
- package/dist/assets/AppManagementPage-vRCBT69X.js +0 -1
- package/dist/assets/ApprovalsInboxPage-Bft5QF0I.js +0 -1
- package/dist/assets/CreateViewDialog-CW0w7Nxc.js +0 -1
- package/dist/assets/DashboardView-CTBV4_tx.js +0 -1
- package/dist/assets/ExpressionProvider-X1OAB_O-.js +0 -1
- package/dist/assets/FlowRunsPage-CUhBLwm-.js +0 -1
- package/dist/assets/InterfaceListPage-FCdy-_Q-.js +0 -1
- package/dist/assets/ManagedByBadge-Bap9_dqR.js +0 -1
- package/dist/assets/MarketplaceAccessDenied-CrK7hygV.js +0 -1
- package/dist/assets/MarketplaceInstalledPage-Cv-qDRNA.js +0 -1
- package/dist/assets/MarketplacePackagePage-CMS--SE2.js +0 -4
- package/dist/assets/MarketplacePage-njErv-tN.js +0 -1
- package/dist/assets/MetadataInspector-CNeJqkLQ.js +0 -1
- package/dist/assets/MetadataProvider-DwMR1SMR.js +0 -1
- package/dist/assets/ObjectDataPage-BVV4yksz.js +0 -1
- package/dist/assets/PageView-XUBdr6tb.js +0 -1
- package/dist/assets/ProfilePage-ClU0WVRr.js +0 -1
- package/dist/assets/PublicFormsPage-a_MNzdQw.js +0 -1
- package/dist/assets/RecordDetailView-uf81gH3J.js +0 -11
- package/dist/assets/RecordFormPage-CLZcT8Z0.js +0 -1
- package/dist/assets/ReportDefaultInspector-DU2azDYd.js +0 -3
- package/dist/assets/ReportView-oFhBKNBE.js +0 -2
- package/dist/assets/SearchResultsPage-lgNcs7l7.js +0 -1
- package/dist/assets/SettingsHub-TQOc7wH3.js +0 -1
- package/dist/assets/SettingsView-DAje5pDB.js +0 -1
- package/dist/assets/SystemHubPage-DUE-2-vc.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-B8Ln-u1a.js +0 -1
- package/dist/assets/blockDiagram-VBNYF7ZC-l_P_W7_Y.js +0 -132
- package/dist/assets/c4Diagram-5PPSVZJV-CE82HAlO.js +0 -10
- package/dist/assets/channel-DowAYf9b.js +0 -1
- package/dist/assets/chunk-3NCLNEKW-Z5ckM4mG.js +0 -1
- package/dist/assets/chunk-7BUUIJ7U-Bb538aSH.js +0 -1
- package/dist/assets/chunk-7Z6QIM7H-m6s_oalL.js +0 -10
- package/dist/assets/chunk-I66GZJ75-BsY3mBMx.js +0 -127
- package/dist/assets/chunk-J7OUQ5F2-Cl4FNR_k.js +0 -1
- package/dist/assets/chunk-JQJVKLGR-BApWxqMA.js +0 -156
- package/dist/assets/chunk-NSK5VX7P-BBTxIP6Z.js +0 -2
- package/dist/assets/chunk-QR6OTTB3-DJcD7xr-.js +0 -62
- package/dist/assets/chunk-RYQCIY6F-CnMsR_qh.js +0 -1
- package/dist/assets/chunk-UBXNYLIW-B7z1tp3V.js +0 -1
- package/dist/assets/chunk-W5SLKNZC-BnMc5i0B.js +0 -1
- package/dist/assets/chunk-WRU74C26-MrzCPX2E.js +0 -70
- package/dist/assets/chunk-XXDRQBXY-NKBlW2Dm.js +0 -1
- package/dist/assets/chunk-ZIRB5QZD-O39ZBUk3.js +0 -32
- package/dist/assets/classDiagram-JCYQIIEL-C4ADaKBz.js +0 -1
- package/dist/assets/classDiagram-v2-OCEON4UE-C4ADaKBz.js +0 -1
- package/dist/assets/createDerive-xZXxMz1g.js +0 -1
- package/dist/assets/cynefin-VYW2F7L2-exAq6djZ.js +0 -1
- package/dist/assets/cytoscape.esm-B-NFISlW.js +0 -321
- package/dist/assets/dagre-Buvkdvvj.js +0 -1
- package/dist/assets/dagre-VZM6K2ZE-B5E8-xuM.js +0 -4
- package/dist/assets/dist-jor1XT9f.js +0 -5
- package/dist/assets/erDiagram-JOGREHBK-BU4b8mUv.js +0 -85
- package/dist/assets/eventmodeling-45OFAUF4-DVTVIsGT.js +0 -1
- package/dist/assets/flowDiagram-UKHOOZJN-BDHHPApJ.js +0 -1
- package/dist/assets/framework-LCCQTTcs.js +0 -47
- package/dist/assets/getIcon-Bnm_i39L.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-DizXBl0d.js +0 -1
- package/dist/assets/i18n-DGSduXFT.js +0 -9
- package/dist/assets/index-ZtYnn1PE.css +0 -2
- package/dist/assets/index-mpVXni3j.js +0 -2
- package/dist/assets/info-DKCQHKI2-CfAGND28.js +0 -1
- package/dist/assets/infrastructure-CerjT_c2.js +0 -3
- package/dist/assets/map-BaFkSB1l.js +0 -1
- package/dist/assets/mermaid-GHXKKRXX-DQTMu5TJ.js +0 -1
- package/dist/assets/mermaid.core-BwiBFu_S.js +0 -10
- package/dist/assets/metadata-admin-C_DEFfDE.js +0 -25
- package/dist/assets/packet-7NZHBO7P-DeymwuCa.js +0 -1
- package/dist/assets/pie-RZYD4A2V-C2S5u8nr.js +0 -1
- package/dist/assets/plugin-calendar-ClpbcK3u.js +0 -1
- package/dist/assets/plugin-charts-Cq0LpABN.js +0 -7
- package/dist/assets/plugin-chatbot-Cq7rZtnW.js +0 -120
- package/dist/assets/plugin-dashboard-C8Ohdrxi.js +0 -6
- package/dist/assets/plugin-form-B7CBtYvZ.js +0 -1
- package/dist/assets/plugin-gantt-ChkG9_UG.js +0 -64
- package/dist/assets/plugin-grid-D49BBhCX.js +0 -8
- package/dist/assets/plugin-kanban-BsTsRjoP.js +0 -1
- package/dist/assets/plugin-map-CQAe4Yh6.js +0 -1
- package/dist/assets/plugin-report-01bEGHuR.js +0 -59
- package/dist/assets/plugin-timeline-Dw4Lj2Rz.js +0 -1
- package/dist/assets/plugin-tree-DW0XC55y.js +0 -1
- package/dist/assets/plugin-view-B9yCVdSX.js +0 -1
- package/dist/assets/plugins-views-BaBStVok.js +0 -4
- package/dist/assets/radar-I7S5WNFK-DzcfTC8k.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-DT2-gzup.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-BvCkhVdg.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-rvjxEE4k.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-BIzZt1tD.js +0 -1
- package/dist/assets/skeletons-DVwGbFUS.js +0 -1
- package/dist/assets/src-BA9h8a8o.js +0 -1
- package/dist/assets/src-Ctj_ivDh.js +0 -19
- package/dist/assets/stateDiagram-v2-UEYNNEHI-DaTg8C5m.js +0 -1
- package/dist/assets/swimlanes-SLNWSIFB-wrx1JN6o.js +0 -1
- package/dist/assets/swimlanesDiagram-ULZ7WXOC-Bqz9GVuM.js +0 -8
- package/dist/assets/treeView-QDETBFTQ-DKZwqlNb.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-Bqsldamv.js +0 -1
- package/dist/assets/ui-components-3mb69z8L.js +0 -42
- package/dist/assets/ui-layout-DpuFph25.js +0 -1
- package/dist/assets/use-book-data-BZg_051K.js +0 -1
- package/dist/assets/useActionModal-Z2yDiihK.js +0 -1
- package/dist/assets/usePackageL10n-Cy-u65Zo.js +0 -1
- package/dist/assets/useSettingsLabel-CvZKl8CQ.js +0 -1
- package/dist/assets/vendor-i18n-Cpia2wlg.js +0 -1
- package/dist/assets/vendor-objectstack-DGpW4oR-.js +0 -158
- package/dist/assets/wardley-OPB4EBWU-C_U_bbc2.js +0 -1
- /package/dist/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{_ as n,b as r,r as i,y as a}from"./vendor-react-CsWFRkED.js";import{$r as o,Ft as s,Ir as c,Qr as l,a as ee,er as te,i as ne,ir as re,o as u,p as d,r as f,t as p,ut as ie}from"./framework-BfSv4Kb0.js";import{_n as ae,dt as oe,il as m}from"./ui-components-D2lrjG-t.js";var h=e(r(),1),g=h.createContext(null);function se(e,t){let n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,a=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===a}function _(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!_(e[n],t[n]))return!1;return!0}if(Array.isArray(t))return!1;if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!t.hasOwnProperty(r)||!_(e[r],t[r]))return!1;return!0}return!1}function v(e){return{center:e.getCenter(),zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),elevation:e.getCenterElevation?.()??0,padding:e.getPadding()}}function y(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function b(e,t){let n=t.viewState||t,r={};if(`longitude`in n&&`latitude`in n&&(n.longitude!==e.center.lng||n.latitude!==e.center.lat)){let t=e.center.constructor;r.center=new t(n.longitude,n.latitude)}return`zoom`in n&&n.zoom!==e.zoom&&(r.zoom=n.zoom),`bearing`in n&&n.bearing!==e.bearing&&(r.bearing=n.bearing),`pitch`in n&&n.pitch!==e.pitch&&(r.pitch=n.pitch),n.padding&&e.padding&&!_(n.padding,e.padding)&&(r.padding=n.padding),r}function x(e,t,n,r){return e.min===t.min&&e.max===t.max?!1:(e.min>=t.min?(e.max!==t.max&&r(e.max),e.min!==t.min&&n(e.min)):(e.min!==t.min&&n(e.min),e.max!==t.max&&r(e.max)),!0)}function S(e,t,n){return x(t,n,t=>e.setMinZoom(t),t=>e.setMaxZoom(t))}function ce(e,t,n){return x(t,n,t=>e.setMinPitch(t),t=>e.setMaxPitch(t))}var C=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function w(e){if(!e)return null;if(typeof e==`string`||(`toJS`in e&&(e=e.toJS()),!e.layers))return e;let t={};for(let n of e.layers)t[n.id]=n;let n=e.layers.map(e=>{let n=null;`interactive`in e&&(n=Object.assign({},e),delete n.interactive);let r=t[e.ref];if(r){n||=Object.assign({},e),delete n.ref;for(let e of C)e in r&&(n[e]=r[e])}return n||e});return{...e,layers:n}}var T={version:8,sources:{},layers:[]},E={minZoom:0,maxZoom:22,minPitch:0,maxPitch:85,maxBounds:[-180,-85.051129,180,85.051129],projection:`mercator`,renderWorldCopies:!0},D={mousedown:`onMouseDown`,mouseup:`onMouseUp`,mouseover:`onMouseOver`,mousemove:`onMouseMove`,click:`onClick`,dblclick:`onDblClick`,mouseenter:`onMouseEnter`,mouseleave:`onMouseLeave`,mouseout:`onMouseOut`,contextmenu:`onContextMenu`,touchstart:`onTouchStart`,touchend:`onTouchEnd`,touchmove:`onTouchMove`,touchcancel:`onTouchCancel`},O={movestart:`onMoveStart`,move:`onMove`,moveend:`onMoveEnd`,dragstart:`onDragStart`,drag:`onDrag`,dragend:`onDragEnd`,zoomstart:`onZoomStart`,zoom:`onZoom`,zoomend:`onZoomEnd`,rotatestart:`onRotateStart`,rotate:`onRotate`,rotateend:`onRotateEnd`,pitchstart:`onPitchStart`,pitch:`onPitch`,pitchend:`onPitchEnd`},k={wheel:`onWheel`,boxzoomstart:`onBoxZoomStart`,boxzoomend:`onBoxZoomEnd`,boxzoomcancel:`onBoxZoomCancel`,resize:`onResize`,load:`onLoad`,render:`onRender`,idle:`onIdle`,remove:`onRemove`,data:`onData`,styledata:`onStyleData`,sourcedata:`onSourceData`,error:`onError`},le=[`maxBounds`,`projection`,`renderWorldCopies`],A=[`scrollZoom`,`boxZoom`,`dragRotate`,`dragPan`,`keyboard`,`doubleClickZoom`,`touchZoomRotate`,`touchPitch`],j=class e{constructor(e,t,n){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=e=>{let t=this.props[k[e.type]];t?t(e):e.type===`error`&&console.error(e.error)},this._onCameraEvent=e=>{if(this._internalUpdate)return;e.viewState=this._propsedCameraUpdate||y(v(this._map));let t=this.props[O[e.type]];t&&t(e)},this._onCameraUpdate=e=>this._internalUpdate?e:(this._propsedCameraUpdate=y(e),b(e,this.props)),this._onPointerEvent=e=>{(e.type===`mousemove`||e.type===`mouseout`)&&this._updateHover(e);let t=this.props[D[e.type]];t&&(this.props.interactiveLayerIds&&e.type!==`mouseover`&&e.type!==`mouseout`&&(e.features=this._hoveredFeatures||this._queryRenderedFeatures(e.point)),t(e),delete e.features)},this._MapClass=e,this.props=t,this._initialize(n)}get map(){return this._map}setProps(e){let t=this.props;this.props=e;let n=this._updateSettings(e,t),r=this._updateSize(e),i=this._updateViewState(e);this._updateStyle(e,t),this._updateStyleComponents(e),this._updateHandlers(e,t),(n||r||i&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){let r=e.savedMaps.pop();if(!r)return null;let i=r.map,a=i.getContainer();for(n.className=a.className;a.childNodes.length>0;)n.appendChild(a.childNodes[0]);i._container=n;let o=i._resizeObserver;o&&(o.disconnect(),o.observe(n)),r.setProps({...t,styleDiffing:!1}),i.resize();let{initialViewState:s}=t;return s&&(s.bounds?i.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):r._updateViewState(s)),i.isStyleLoaded()?i.fire(`load`):i.once(`style.load`,()=>i.fire(`load`)),i._update(),r}_initialize(e){let{props:t}=this,{mapStyle:n=T}=t,r={...t,...t.initialViewState,container:e,style:w(n)},i=r.initialViewState||r.viewState||r;if(Object.assign(r,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),t.gl){let e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=e,t.gl)}let a=new this._MapClass(r);i.padding&&a.setPadding(i.padding),t.cursor&&(a.getCanvas().style.cursor=t.cursor);let o=a;typeof o.setTransformCameraUpdate==`function`?o.setTransformCameraUpdate(this._onCameraUpdate):o.transformCameraUpdate=this._onCameraUpdate,a.on(`style.load`,()=>{this._styleComponents={light:a.getLight(),sky:a.getSky(),projection:a.getProjection?.(),terrain:a.getTerrain()},this._updateStyleComponents(this.props)}),a.on(`sourcedata`,()=>{this._updateStyleComponents(this.props)});for(let e in D)a.on(e,this._onPointerEvent);for(let e in O)a.on(e,this._onCameraEvent);for(let e in k)a.on(e,this._onEvent);this._map=a}recycle(){this.map.getContainer().querySelector(`[mapboxgl-children]`)?.remove(),e.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){let e=this._map;e.style&&(e._frame&&=(e._frame.cancel(),null),e._render())}_updateSize(e){let{viewState:t}=e;if(t){let e=this._map,n=e.getCanvas();if(t.width!==n.clientWidth||t.height!==n.clientHeight)return e.resize(),!0}return!1}_updateViewState(e){let t=this._map,n=v(t);if(!t.isMoving()){let r=b(n,e);if(Object.keys(r).length>0)return this._internalUpdate=!0,t.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateConstraints(e,t){let n=S(this._map,{min:e.minZoom??E.minZoom,max:e.maxZoom??E.maxZoom},{min:t.minZoom??E.minZoom,max:t.maxZoom??E.maxZoom}),r=ce(this._map,{min:e.minPitch??E.minPitch,max:e.maxPitch??E.maxPitch},{min:t.minPitch??E.minPitch,max:t.maxPitch??E.maxPitch});return n||r}_updateSettings(e,t){let n=this._map,r=!1;for(let i of le)if((i in e||i in t)&&!_(e[i],t[i])){r=!0;let t=i in e?e[i]:E[i];n[`set${i[0].toUpperCase()}${i.slice(1)}`]?.call(n,t)}let i=this._updateConstraints(e,t);return r||i}_updateStyle(e,t){if(e.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=e.cursor||``),e.mapStyle!==t.mapStyle){let{mapStyle:t=T,styleDiffing:n=!0}=e,r={diff:n};`localIdeographFontFamily`in e&&(r.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(w(t),r)}}_updateStyleComponents({light:e,projection:t,sky:n,terrain:r}){let i=this._map,a=this._styleComponents;i.style?._loaded&&(e&&!_(e,a.light)&&(a.light=e,i.setLight(e)),t&&!_(t,a.projection)&&t!==a.projection?.type&&(a.projection=typeof t==`string`?{type:t}:t,i.setProjection?.(a.projection)),n&&!_(n,a.sky)&&(a.sky=n,i.setSky(n)),r!==void 0&&!_(r,a.terrain)&&(!r||i.getSource(r.source))&&(a.terrain=r,i.setTerrain(r)))}_updateHandlers(e,t){let n=this._map;for(let r of A){let i=e[r]??!0;_(i,t[r]??!0)||(i?n[r].enable(i):n[r].disable())}}_queryRenderedFeatures(e){let t=this._map,{interactiveLayerIds:n=[]}=this.props;try{return t.queryRenderedFeatures(e,{layers:n.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(e){let{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){let t=e.type,n=this._hoveredFeatures?.length>0,r=this._queryRenderedFeatures(e.point),i=r.length>0;!i&&n&&(e.type=`mouseleave`,this._onPointerEvent(e)),this._hoveredFeatures=r,i&&!n&&(e.type=`mouseenter`,this._onPointerEvent(e)),e.type=t}else this._hoveredFeatures=null}};j.savedMaps=[];var M=[`setMaxBounds`,`setMinZoom`,`setMaxZoom`,`setMinPitch`,`setMaxPitch`,`setRenderWorldCopies`,`setProjection`,`setStyle`,`addSource`,`removeSource`,`addLayer`,`removeLayer`,`setLayerZoomRange`,`setFilter`,`setPaintProperty`,`setLayoutProperty`,`setLight`,`setTerrain`,`setFog`,`remove`];function N(e){if(!e)return null;let t=e.map,n={getMap:()=>t};for(let e of ue(t))!(e in n)&&!M.includes(e)&&(n[e]=t[e].bind(t));return n}function ue(e){let t=new Set,n=e;for(;n;){for(let r of Object.getOwnPropertyNames(n))r[0]!==`_`&&typeof e[r]==`function`&&r!==`fire`&&r!==`setEventedParent`&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}var de=typeof document<`u`?h.useLayoutEffect:h.useEffect;function fe(e,t){let{RTLTextPlugin:n,maxParallelImageRequests:r,workerCount:i,workerUrl:a}=t;if(n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()===`unavailable`){let{pluginUrl:t,lazy:r=!0}=typeof n==`string`?{pluginUrl:n}:n;e.setRTLTextPlugin(t,e=>{e&&console.error(e)},r)}r!==void 0&&e.setMaxParallelImageRequests(r),i!==void 0&&e.setWorkerCount(i),a!==void 0&&e.setWorkerUrl(a)}var P=h.createContext(null);function F(e,t){let r=(0,h.useContext)(g),[i,a]=(0,h.useState)(null),o=(0,h.useRef)(),{current:s}=(0,h.useRef)({mapLib:null,map:null});(0,h.useEffect)(()=>{let t=e.mapLib,i=!0,c;return Promise.resolve(t||n(()=>import(`./maplibre-gl-CrDadnl3.js`),[],import.meta.url)).then(t=>{if(!i)return;if(!t)throw Error(`Invalid mapLib`);let n=`Map`in t?t:t.default;if(!n.Map)throw Error(`Invalid mapLib`);fe(n,e),e.reuseMaps&&(c=j.reuse(e,o.current)),c||=new j(n.Map,e,o.current),s.map=N(c),s.mapLib=n,a(c),r?.onMapMount(s.map,e.id)}).catch(t=>{let{onError:n}=e;n?n({type:`error`,target:null,originalEvent:null,error:t}):console.error(t)}),()=>{i=!1,c&&(r?.onMapUnmount(e.id),e.reuseMaps?c.recycle():c.destroy())}},[]),de(()=>{i&&i.setProps(e)}),(0,h.useImperativeHandle)(t,()=>s.map,[i]);let c=(0,h.useMemo)(()=>({position:`relative`,width:`100%`,height:`100%`,...e.style}),[e.style]);return h.createElement(`div`,{id:e.id,ref:o,style:c},i&&h.createElement(P.Provider,{value:s},h.createElement(`div`,{"mapboxgl-children":``,style:{height:`100%`}},e.children)))}var pe=h.forwardRef(F),I=e(a(),1),L=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function R(e,t){if(!e||!t)return;let n=e.style;for(let e in t){let r=t[e];n[e]=Number.isFinite(r)&&!L.test(e)?`${r}px`:r}}function z(e,t){if(e===t)return null;let n=B(e),r=B(t),i=[];for(let e of r)n.has(e)||i.push(e);for(let e of n)r.has(e)||i.push(e);return i.length===0?null:i}function B(e){return new Set(e?e.trim().split(/\s+/):[])}var V=(0,h.memo)((0,h.forwardRef)((e,t)=>{let{map:n,mapLib:r}=(0,h.useContext)(P),i=(0,h.useRef)({props:e}),a=(0,h.useMemo)(()=>{let t=!1;h.Children.forEach(e.children,e=>{e&&(t=!0)});let n={...e,element:t?document.createElement(`div`):void 0},o=new r.Marker(n);return o.setLngLat([e.longitude,e.latitude]),o.getElement().addEventListener(`click`,e=>{i.current.props.onClick?.({type:`click`,target:o,originalEvent:e})}),o.on(`dragstart`,e=>{let t=e;t.lngLat=a.getLngLat(),i.current.props.onDragStart?.(t)}),o.on(`drag`,e=>{let t=e;t.lngLat=a.getLngLat(),i.current.props.onDrag?.(t)}),o.on(`dragend`,e=>{let t=e;t.lngLat=a.getLngLat(),i.current.props.onDragEnd?.(t)}),o},[]);(0,h.useEffect)(()=>(a.addTo(n.getMap()),()=>{a.remove()}),[]);let{longitude:o,latitude:s,offset:c,style:l,draggable:ee=!1,popup:te=null,rotation:ne=0,rotationAlignment:re=`auto`,pitchAlignment:u=`auto`}=e;(0,h.useEffect)(()=>{R(a.getElement(),l)},[l]),(0,h.useImperativeHandle)(t,()=>a,[]);let d=i.current.props;(a.getLngLat().lng!==o||a.getLngLat().lat!==s)&&a.setLngLat([o,s]),c&&!se(a.getOffset(),c)&&a.setOffset(c),a.isDraggable()!==ee&&a.setDraggable(ee),a.getRotation()!==ne&&a.setRotation(ne),a.getRotationAlignment()!==re&&a.setRotationAlignment(re),a.getPitchAlignment()!==u&&a.setPitchAlignment(u),a.getPopup()!==te&&a.setPopup(te);let f=z(d.className,e.className);if(f)for(let e of f)a.toggleClassName(e);return i.current.props=e,(0,I.createPortal)(e.children,a.getElement())})),me=(0,h.memo)((0,h.forwardRef)((e,t)=>{let{map:n,mapLib:r}=(0,h.useContext)(P),i=(0,h.useMemo)(()=>document.createElement(`div`),[]),a=(0,h.useRef)({props:e}),o=(0,h.useMemo)(()=>{let t={...e},n=new r.Popup(t);return n.setLngLat([e.longitude,e.latitude]),n.once(`open`,e=>{a.current.props.onOpen?.(e)}),n},[]);if((0,h.useEffect)(()=>{let e=e=>{a.current.props.onClose?.(e)};return o.on(`close`,e),o.setDOMContent(i).addTo(n.getMap()),()=>{o.off(`close`,e),o.isOpen()&&o.remove()}},[]),(0,h.useEffect)(()=>{R(o.getElement(),e.style)},[e.style]),(0,h.useImperativeHandle)(t,()=>o,[]),o.isOpen()){let t=a.current.props;(o.getLngLat().lng!==e.longitude||o.getLngLat().lat!==e.latitude)&&o.setLngLat([e.longitude,e.latitude]),e.offset&&!_(t.offset,e.offset)&&o.setOffset(e.offset),(t.anchor!==e.anchor||t.maxWidth!==e.maxWidth)&&(o.options.anchor=e.anchor,o.setMaxWidth(e.maxWidth));let n=z(t.className,e.className);if(n)for(let e of n)o.toggleClassName(e);a.current.props=e}return(0,I.createPortal)(e.children,i)}));function H(e,t,n,r){let i=(0,h.useContext)(P),a=(0,h.useMemo)(()=>e(i),[]);return(0,h.useEffect)(()=>{let e=r||n||t,o=typeof t==`function`&&typeof n==`function`?t:null,s=typeof n==`function`?n:typeof t==`function`?t:null,{map:c}=i;return c.hasControl(a)||(c.addControl(a,e?.position),o&&o(i)),()=>{s&&s(i),c.hasControl(a)&&c.removeControl(a)}},[]),a}function U(e){let t=H(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return(0,h.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}(0,h.memo)(U);function W(e){let t=H(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return(0,h.useEffect)(()=>{R(t._controlContainer,e.style)},[e.style]),null}(0,h.memo)(W);function G(e,t){let n=(0,h.useRef)({props:e}),r=H(({mapLib:t})=>{let r=new t.GeolocateControl(e),i=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||i()},r.on(`geolocate`,e=>{n.current.props.onGeolocate?.(e)}),r.on(`error`,e=>{n.current.props.onError?.(e)}),r.on(`outofmaxbounds`,e=>{n.current.props.onOutOfMaxBounds?.(e)}),r.on(`trackuserlocationstart`,e=>{n.current.props.onTrackUserLocationStart?.(e)}),r.on(`trackuserlocationend`,e=>{n.current.props.onTrackUserLocationEnd?.(e)}),r},{position:e.position});return n.current.props=e,(0,h.useImperativeHandle)(t,()=>r,[]),(0,h.useEffect)(()=>{R(r._container,e.style)},[e.style]),null}(0,h.memo)((0,h.forwardRef)(G));function he(e){let t=H(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return(0,h.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}var ge=(0,h.memo)(he);function _e(e){let t=H(({mapLib:t})=>new t.ScaleControl(e),{position:e.position}),n=(0,h.useRef)(e),r=n.current;n.current=e;let{style:i}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),(0,h.useEffect)(()=>{R(t._container,i)},[i]),null}(0,h.memo)(_e);function K(e){let t=H(({mapLib:t})=>new t.TerrainControl(e),{position:e.position});return(0,h.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}(0,h.memo)(K);function q(e){let t=H(({mapLib:t})=>new t.LogoControl(e),{position:e.position});return(0,h.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}(0,h.memo)(q);function ve(e){let t=H(({mapLib:t})=>{let n=t.GlobeControl;if(!n)throw Error(`GlobeControl is not supported by this version of MapLibre GL JS`);return new n(e)},{position:e.position});return(0,h.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}(0,h.memo)(ve);function J(e){return e>=-180&&e<180?e:((e+180)%360+360)%360-180}var Y=e=>Math.min(85,Math.max(-85,e));function ye(e){if(e.length===0)return null;let t=e.map(([e])=>J(e)).sort((e,t)=>e-t),n=e.map(([,e])=>Y(e)),r=t.length,i=t[0]+360-t[r-1],a=0;for(let e=1;e<r;e++){let n=t[e]-t[e-1];n>i&&(i=n,a=e)}let o=t[a],s=t[(a+r-1)%r],c=a===0?s:s+360;return[[o,Math.min(...n)],[c,Math.max(...n)]]}function be(e){let[[t,n],[r,i]]=e;return{longitude:J((t+r)/2),latitude:(n+i)/2}}var X=i(),xe=`https://demotiles.maplibre.org/style.json`,Z=Object.keys(p.shape).filter(e=>e!==`style`);function Se(e){if(e.data){let t=e.data;return Array.isArray(t)?{provider:`value`,items:t}:e.data}return e.staticData?{provider:`value`,items:e.staticData}:e.objectName?{provider:`object`,object:e.objectName}:null}var Q=()=>!1,$=new Set;function Ce(e){if(!Q())return;let t=e.filter;if(!t||typeof t!=`object`||Array.isArray(t)||!Object.prototype.hasOwnProperty.call(t,`map`))return;let n=t.map;if(!n||typeof n!=`object`)return;let r;try{r=`${e.type??`map`}::${e.objectName??``}::${JSON.stringify(n)}`}catch{r=`${e.type??`map`}::${e.objectName??``}::<unserializable>`}$.has(r)||($.add(r),console.warn("[ObjectMap] `filter.map` is no longer read as map configuration, so this map is rendering with the DEFAULT field names (`latitude` / `longitude` / `name`). `filter` is the query filter; the map config belongs under the declared `map` input — move it to `schema.map` (`{ type: 'object-map', map: { latitudeField, longitudeField, titleField } }`). The old spelling was never documented and could not survive a `dataSource` binding, whose merged filter is an `and` node with no `map` key at all (objectstack#7121). If `map` is genuinely a field you are filtering on, ignore this — the filter itself is passed through untouched. objectui#4034."))}var we=new Set;function Te(e){if(!Q())return;let t=e.style;if(typeof t!=`string`||t===``)return;let n=`${e.type??`map`}::${e.objectName??``}::${t}`;we.has(n)||(we.add(n),console.warn(`[ObjectMap] A top-level \`style\` is NOT read as a map style, so this map is rendering with the DEFAULT public demo tiles and \`${t}\` was dropped. \`style\` is the base schema's INLINE CSS key (a record of CSS properties), which every node may carry; the map style is \`mapStyle\` — named that way precisely to avoid this collision. Write \`mapStyle: '${t}'\` at the top level, or \`map: { style: '${t}' }\` in the declared config block. On a view, note that \`options.map\` is FLATTENED into the top level, so its \`style\` lands here as this same top-level key — spell it \`map: { mapStyle }\` there. objectui#5017.`))}var Ee=new Set;function De(e){if(!Q())return;let t=Z.filter(t=>e[t]!==void 0);if(t.length===0)return;let n=`${e.type??`map`}::${e.objectName??``}::${t.join(`,`)}`;Ee.has(n)||(Ee.add(n),console.warn(`[ObjectMap] The \`map\` block configures this map, so these top-level keys are IGNORED: ${t.map(e=>`\`${e}\``).join(`, `)}. The \`map\` block is the authoring shape; the flat top-level spelling is the internal form ObjectView/ListView produce when they flatten \`options.map\`, and what the author wrote outranks it. Move anything you still need into \`map\`, or drop the \`map\` block. objectui#5018.`))}function Oe(e){Ce(e),Te(e);let t=e.mapStyle||e.map?.style,n=e.map??null;if(n){let r=p.safeParse(n);return r.success||console.warn(`[ObjectMap] Invalid map configuration:`,r.error.format()),De(e),{...n,style:n.style||t}}return e.locationField||e.latitudeField?{locationField:e.locationField,latitudeField:e.latitudeField,longitudeField:e.longitudeField,titleField:e.titleField,descriptionField:e.descriptionField,zoom:e.zoom,center:e.center,style:t}:{latitudeField:`latitude`,longitudeField:`longitude`,locationField:`location`,descriptionField:`description`,style:t}}function ke(e,t){if(t.latitudeField&&t.longitudeField){let n=e[t.latitudeField],r=e[t.longitudeField];if(typeof n==`number`&&typeof r==`number`)return[n,r]}if(t.locationField){let n=e[t.locationField];if(typeof n==`object`&&n){let e=n.lat||n.latitude,t=n.lng||n.lon||n.longitude;if(typeof e==`number`&&typeof t==`number`)return[e,t]}if(typeof n==`string`){let e=n.split(`,`).map(e=>parseFloat(e.trim()));if(e.length===2&&!isNaN(e[0])&&!isNaN(e[1]))return[e[0],e[1]]}if(Array.isArray(n)&&n.length===2){let e=parseFloat(n[0]),t=parseFloat(n[1]);if(!isNaN(e)&&!isNaN(t))return[e,t]}}return null}function Ae(e,t,n=50){if(e.length<=1||t>=15)return e.map(e=>({id:e.id,coordinates:e.coordinates,markers:[e],isCluster:!1}));let r=n/2**t,i=new Map;e.forEach(e=>{let t=`${Math.floor(e.coordinates[0]/r)}:${Math.floor(e.coordinates[1]/r)}`;i.has(t)||i.set(t,[]),i.get(t).push(e)});let a=[];return i.forEach((e,t)=>{if(e.length===1)a.push({id:e[0].id,coordinates:e[0].coordinates,markers:e,isCluster:!1});else{let n=e.reduce((e,t)=>e+t.coordinates[0],0)/e.length,r=e.reduce((e,t)=>e+t.coordinates[1],0)/e.length;a.push({id:`cluster-${t}`,coordinates:[n,r],markers:e,isCluster:!0})}}),a}var je=({schema:e,dataSource:t,className:n,data:r,onMarkerClick:i,onRowClick:a,onEdit:o,onDelete:s,enableClustering:l,clusterRadius:d=50})=>{let[p,g]=(0,h.useState)([]),[se,_]=(0,h.useState)(!0),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)({truncated:!1}),[S,ce]=(0,h.useState)(null),[C,w]=(0,h.useState)(null),[T,E]=(0,h.useState)(``),D=ae(),O=(0,h.useRef)(null),[k,le]=(0,h.useState)(null),[A,j]=(0,h.useState)(null),[M,N]=(0,h.useState)(!1),[ue,de]=(0,h.useState)(null),fe=(0,h.useCallback)(e=>{de(e?.error?.message||`Failed to load the map style/tiles.`)},[]),P=(0,h.useCallback)(()=>{if(typeof navigator>`u`||!navigator.geolocation){j(`Geolocation is not available in this browser.`);return}N(!0),j(null),navigator.geolocation.getCurrentPosition(e=>{let{longitude:t,latitude:n}=e.coords;le({lng:t,lat:n}),N(!1);try{O.current?.flyTo({center:[t,n],zoom:12,duration:800})}catch{}},e=>{N(!1),j(e.message||`Unable to retrieve location.`)},{enableHighAccuracy:!1,timeout:8e3,maximumAge:6e4})},[]),F=(0,h.useMemo)(()=>Se(e),[e]),I=(0,h.useMemo)(()=>Oe(e),[e]),L=F?.provider===`value`,R=F?.provider,z=F?.provider===`object`?F.object:void 0,B=F?.provider===`value`?F.items:void 0;(0,h.useEffect)(()=>{(async()=>{try{if(_(!0),Array.isArray(r)){g(r),x({truncated:!1}),_(!1);return}if(L&&R===`value`){g(B),x({truncated:!1}),_(!1);return}if(!t||typeof t.find!=`function`)throw Error(`DataSource required for object/api providers`);if(R===`object`){let n=z,r=c(S?.fields),i=await t.find(n,{$filter:e.filter,$orderby:te(e.sort),$top:ne,...r.length>0?{$expand:r}:{}}),a=u(i);g(a.rows),x({truncated:a.truncated,total:a.total})}else R===`api`&&(console.warn(`API provider not yet implemented for ObjectMap`),g([]));_(!1)}catch(e){y(e),_(!1)}})()},[r,R,z,B,t,L,e.filter,e.sort,S]),(0,h.useEffect)(()=>{!L&&t&&(async()=>{try{if(!t)return;let n=R===`object`?z:e.objectName;if(!n)return;let r=await t.getObjectSchema(n);ce(r)}catch(e){console.error(`Failed to fetch object schema:`,e)}})()},[e.objectName,t,L,R,z]);let{markers:H,invalidCount:U}=(0,h.useMemo)(()=>{let e=0;return{markers:p.map((t,n)=>{let r=ke(t,I);if(!r)return e++,null;let i=re(S,t,{titleField:I.titleField,fallback:`Marker`}),a=I.descriptionField?t[I.descriptionField]:void 0,[o,s]=r;return!isFinite(o)||!isFinite(s)||o<-90||o>90||s<-180||s>180?(e++,null):{id:t.id||t._id||`marker-${n}`,title:i,description:a,coordinates:[s,o],data:t}}).filter(e=>e!==null),invalidCount:e}},[p,I,S]),W=(0,h.useMemo)(()=>H.find(e=>e.id===C),[H,C]),[G,he]=(0,h.useState)(I.zoom||3),_e=(0,h.useCallback)(e=>{try{let t=e?.target?.getZoom?.();typeof t==`number`&&Number.isFinite(t)&&he(Math.round(t))}catch{}},[]),K=ie({navigation:e.navigation,objectName:e.objectName,onRowClick:a}),q=(0,h.useMemo)(()=>{if(!T.trim())return H;let e=T.toLowerCase();return H.filter(t=>t.title?.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))},[H,T]),ve=(0,h.useMemo)(()=>l??(e.enableClustering||q.length>100)?Ae(q,G,d):q.map(e=>({id:e.id,coordinates:e.coordinates,markers:[e],isCluster:!1})),[q,G,l,d,e]),J=(0,h.useMemo)(()=>ye(q.map(e=>e.coordinates)),[q]),Y=typeof I.center?.[0]==`number`?I.center[0]:void 0,Z=typeof I.center?.[1]==`number`?I.center[1]:void 0,Q=typeof I.zoom==`number`?I.zoom:void 0,$=Y!==void 0||Z!==void 0||Q!==void 0,Ce=(0,h.useMemo)(()=>{if(J&&!$)return{bounds:J,fitBoundsOptions:{padding:48,maxZoom:12}};let e=J?be(J):{longitude:0,latitude:0};return{longitude:Z??e.longitude,latitude:Y??e.latitude,zoom:Q??(J?3:2)}},[J,$,Z,Y,Q]);return se?(0,X.jsx)(`div`,{className:m(`min-w-0 overflow-hidden`,n),children:(0,X.jsx)(`div`,{className:`flex items-center justify-center h-96 bg-muted rounded-lg border`,children:(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:`Loading map...`})})}):v?(0,X.jsx)(`div`,{className:m(`min-w-0 overflow-hidden`,n),children:(0,X.jsx)(`div`,{className:`flex items-center justify-center h-96 bg-muted rounded-lg border`,children:(0,X.jsxs)(`div`,{className:`text-destructive`,children:[`Error: `,v.message]})})}):(0,X.jsxs)(`div`,{className:m(`min-w-0 overflow-hidden`,n),children:[U>0&&(0,X.jsx)(`div`,{className:`mb-2 p-2 text-sm text-yellow-800 bg-yellow-50 border border-yellow-200 rounded`,children:`${U} record${U===1?``:`s`} with missing or invalid coordinates excluded from the map.`}),H.length>0&&(0,X.jsx)(`div`,{className:`mb-2`,children:(0,X.jsx)(`input`,{type:`text`,value:T,onChange:e=>E(e.target.value),placeholder:`Search locations…`,className:`w-full px-3 py-2 text-sm border rounded-md bg-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring`})}),(0,X.jsxs)(`div`,{className:`relative border rounded-lg overflow-hidden bg-muted h-[300px] sm:h-[400px] md:h-[500px] lg:h-[600px] w-full`,children:[(0,X.jsxs)(pe,{ref:e=>{O.current=e},initialViewState:Ce,style:{width:`100%`,height:`100%`},mapStyle:I.style||xe,touchZoomRotate:!0,dragRotate:!0,touchPitch:!0,onLoad:_e,onZoom:e=>he(Math.round(e.viewState.zoom)),onError:fe,children:[ue&&(0,X.jsxs)(`div`,{role:`alert`,className:`absolute inset-x-0 top-0 z-20 p-2 text-sm text-center text-amber-900 bg-amber-50 border-b border-amber-200`,children:[`Map failed to load (`,ue,`). Markers below are still listed in the search box;`,` `,I.style?`check the configured map style URL.`:`configure a custom map style for production use.`]}),(0,X.jsx)(ge,{position:`top-right`,showCompass:!0,showZoom:!0}),(0,X.jsx)(`button`,{type:`button`,onClick:P,disabled:M,className:`absolute top-2 left-2 z-10 inline-flex items-center justify-center size-9 rounded-md bg-background/95 border shadow-sm hover:bg-background disabled:opacity-50`,"aria-label":`Show my location`,"data-testid":`map-geolocate`,children:(0,X.jsx)(`span`,{"aria-hidden":`true`,children:M?`⏳`:`🧭`})}),k&&(0,X.jsx)(V,{longitude:k.lng,latitude:k.lat,anchor:`center`,children:(0,X.jsx)(`div`,{className:`size-3 rounded-full bg-blue-500 ring-4 ring-blue-500/30 shadow`,"aria-label":`Your location`,"data-testid":`map-user-location`})}),ve.map(e=>e.isCluster?(0,X.jsx)(V,{longitude:e.coordinates[0],latitude:e.coordinates[1],anchor:`center`,onClick:t=>{t.originalEvent.stopPropagation();try{let t=Math.min(20,Math.max(G+2,8));O.current?.flyTo({center:[e.coordinates[0],e.coordinates[1]],zoom:t,duration:600})}catch{}},children:(0,X.jsx)(`div`,{className:`flex items-center justify-center rounded-full bg-primary text-primary-foreground font-bold text-xs cursor-pointer hover:scale-110 transition-transform shadow-md`,style:{width:Math.min(48,24+e.markers.length*2),height:Math.min(48,24+e.markers.length*2)},title:`${e.markers.length} markers`,"data-testid":`map-cluster`,children:e.markers.length})},e.id):(0,X.jsx)(V,{longitude:e.coordinates[0],latitude:e.coordinates[1],anchor:`bottom`,onClick:t=>{t.originalEvent.stopPropagation();let n=e.markers[0];w(n.id),K.handleClick(n.data),i?.(n.data)},children:(0,X.jsx)(`div`,{className:`text-2xl cursor-pointer hover:scale-110 transition-transform`,children:`📍`})},e.id)),W&&!D&&(0,X.jsx)(me,{longitude:W.coordinates[0],latitude:W.coordinates[1],anchor:`top`,onClose:()=>w(null),closeOnClick:!1,children:(0,X.jsxs)(`div`,{className:`p-2 min-w-[150px] sm:min-w-[200px]`,children:[(0,X.jsx)(`h3`,{className:`font-bold text-sm mb-1`,children:W.title}),W.description&&(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:W.description}),(0,X.jsxs)(`div`,{className:`mt-2 text-xs flex gap-2`,children:[o&&(0,X.jsx)(`button`,{type:`button`,className:`text-blue-500 hover:underline`,onClick:()=>o(W.data),children:`Edit`}),s&&(0,X.jsx)(`button`,{type:`button`,className:`text-red-500 hover:underline`,onClick:()=>s(W.data),children:`Delete`})]})]})})]}),W&&D&&(0,X.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 z-30 bg-background border-t shadow-lg rounded-t-2xl p-4 pb-[max(env(safe-area-inset-bottom),1rem)]`,role:`dialog`,"aria-label":`Location details`,"data-testid":`map-mobile-record-sheet`,children:[(0,X.jsx)(`div`,{className:`mx-auto mb-2 h-1 w-10 rounded-full bg-muted`,"aria-hidden":`true`}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:W.title}),W.description&&(0,X.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground line-clamp-3`,children:W.description})]}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>w(null),className:`text-muted-foreground hover:text-foreground text-lg leading-none px-2`,"aria-label":`Close details`,"data-testid":`map-mobile-record-close`,children:`×`})]}),(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[o&&(0,X.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 rounded-md border bg-card hover:bg-accent`,onClick:()=>o(W.data),children:`Edit`}),s&&(0,X.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 rounded-md border border-destructive/30 text-destructive hover:bg-destructive/10`,onClick:()=>s(W.data),children:`Delete`})]})]}),A&&(0,X.jsx)(`div`,{className:`absolute top-2 left-14 right-2 z-10 text-xs px-3 py-1.5 rounded-md bg-destructive/10 text-destructive border border-destructive/30`,children:A})]}),(0,X.jsx)(ee,{drawn:f,total:b.total,truncated:b.truncated}),K.isOverlay&&(0,X.jsx)(oe,{...K,title:`Location Details`,children:e=>(0,X.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,X.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})},Me=t({ObjectMap:()=>je,ObjectMapRenderer:()=>Pe}),Ne={filter:!0,sort:!0},Pe=o(({schema:e,...t})=>{let{dataSource:n}=s()||{};return(0,X.jsx)(d,{schema:e,mapping:Ne,dataSource:n,testId:`object-map`,errorTitle:`This map’s data source could not be resolved`,children:e=>(0,X.jsx)(je,{schema:e,dataSource:n,...t})})});l.register(`object-map`,Pe,{namespace:`plugin-map`,label:`Object Map`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`map`,type:`object`,label:`Map Config`,description:`latitudeField, longitudeField, titleField`}]}),l.register(`map`,Pe,{namespace:`view`,label:`Map View`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`map`,type:`object`,label:`Map Config`,description:`latitudeField, longitudeField, titleField`}]});export{Me as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{_ as n,b as r,r as i}from"./vendor-react-CsWFRkED.js";import{
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{_ as n,b as r,r as i}from"./vendor-react-CsWFRkED.js";import{Qr as a}from"./framework-BfSv4Kb0.js";import{gn as o}from"./ui-components-D2lrjG-t.js";import{a as s,h as c,i as l,m as u,n as d,o as f,p,r as m,t as h}from"./vendor-markdown-BW_XFZ_b.js";var g=e(r(),1),_=i();function v(e){return e.replace(/!\[[^\]]*\]\([^)]*\)/g,``).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/(\*\*|__)(.*?)\1/g,`$2`).replace(/(\*|_)(.*?)\1/g,`$2`).replace(/<[^>]+>/g,``).trim()}function y(e,t){let n=t?.minDepth??2,r=t?.maxDepth??3,i=new f,a=[],o=null;for(let t of(e??``).split(/\r?\n/)){let e=t.match(/^\s{0,3}(`{3,}|~{3,})/);if(e){let t=e[1][0];o===null?o=t:t===o&&(o=null);continue}if(o!==null)continue;let s=t.match(/^(#{1,6})\s+(.+?)\s*#*\s*$/);if(!s)continue;let c=s[1].length,l=v(s[2]);if(!l)continue;let u=i.slug(l);c>=n&&c<=r&&a.push({depth:c,text:l,id:u})}return a}var b=null;function x(){return b||=n(()=>import(`./mermaid.core-pW40dd4u.js`).then(e=>e.default),[],import.meta.url),b}var S=0;function C(){return typeof document<`u`&&document.documentElement.classList.contains(`dark`)}function w({chart:e}){let[t,n]=g.useState(``),[r,i]=g.useState(null),[a,o]=g.useState(C);return g.useEffect(()=>{if(typeof document>`u`)return;let e=document.documentElement,t=new MutationObserver(()=>o(C()));return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]),g.useEffect(()=>{let t=!1,r=e.trim();if(!r){n(``),i(null);return}return x().then(async e=>{e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:a?`dark`:`default`});let o=`os-mermaid-${S+=1}`,{svg:s}=await e.render(o,r);t||(n(s),i(null))}).catch(e=>{t||i(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e,a]),r?(0,_.jsx)(`pre`,{"data-mermaid":!0,"data-mermaid-error":!0,className:`my-4 overflow-auto rounded border border-destructive/40 bg-muted p-3 text-xs`,children:(0,_.jsx)(`code`,{children:e})}):t?(0,_.jsx)(`div`,{"data-mermaid":!0,role:`img`,className:`my-4 flex justify-center overflow-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:t}}):(0,_.jsx)(`div`,{"data-mermaid":!0,"data-mermaid-pending":!0,className:`my-4 text-sm text-muted-foreground`,children:(0,_.jsx)(`pre`,{className:`sr-only`,children:e})})}var T=t({MarkdownRenderer:()=>D,Mermaid:()=>w,extractToc:()=>y,markdownComponents:()=>O}),E=g.lazy(()=>n(()=>Promise.resolve().then(()=>M),void 0,import.meta.url)),D=({schema:e})=>(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(o,{className:`w-full h-[200px]`}),children:(0,_.jsx)(E,{content:e.content||``,className:e.className})});a.register(`markdown`,D,{namespace:`plugin-markdown`,label:`Markdown`,category:`plugin`,inputs:[{name:`content`,type:`string`,label:`Markdown Content`,required:!0,inputType:`textarea`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{content:`# Hello World
|
|
2
2
|
|
|
3
3
|
This is a **markdown** component with *formatting* support.
|
|
4
4
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{b as n,r}from"./vendor-react-CsWFRkED.js";import{Mt as i,Qr as a,Qt as o,Sn as s,T as c,Xt as l,Yt as u,Zt as d,_n as f,_r as p,an as m,cn as h,dn as g,fn as _,gn as v,hn as y,ht as b,ln as x,mt as S,on as C,rn as ee,vn as w,vr as T,w as E,yn as D}from"./framework-BfSv4Kb0.js";import{a as O,d as te,f as k,m as A,t as j,y as ne}from"./i18n-locales-Bz4c8KXc.js";import{Ar as M,Mr as N,Ni as P,Or as F,Os as I,Pr as re,Xr as L,f as ie,g as ae,gn as R,jr as z,kr as B,va as oe,vo as se,wa as ce,yi as le}from"./ui-components-D2lrjG-t.js";var V=e(n(),1),H=r(),ue=({schema:e})=>{let{title:t,description:n,data:r,columns:i}=e;e.chart?.type;let o=!!e.chart;return(0,H.jsxs)(F,{className:`h-full flex flex-col ${e.className||``}`,children:[(0,H.jsxs)(z,{children:[t&&(0,H.jsx)(N,{children:t}),n&&(0,H.jsx)(M,{children:n})]}),(0,H.jsxs)(B,{className:`flex-1 overflow-auto space-y-4`,children:[o&&(()=>{let t=e.chart?.type,n=t?a.get(t):null;return n||=a.get(`chart`),n?(0,H.jsx)(`div`,{className:`min-h-[300px] border rounded-lg p-4 bg-background/50`,children:(0,H.jsx)(n,{schema:{...e.chart,data:e.chart.data||r}})}):(0,H.jsxs)(`div`,{className:`min-h-[100px] border rounded-md p-4 bg-muted/20 text-muted-foreground flex items-center justify-center`,children:[`Unknown component type: `,t||`chart`]})})(),r&&r.length>0&&(0,H.jsx)(`div`,{className:`border rounded-lg`,children:(()=>{let e=a.get(`grid`)||a.get(`table`);return e?(0,H.jsx)(e,{schema:{type:`grid`,rowData:r,columnDefs:i,domLayout:`autoHeight`}}):(0,H.jsx)(`div`,{className:`overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm text-left`,children:[(0,H.jsx)(`thead`,{className:`text-xs uppercase bg-muted`,children:(0,H.jsx)(`tr`,{children:i?.map(e=>(0,H.jsx)(`th`,{className:`px-6 py-3`,children:e.headerName||e.label||e.field},e.field))})}),(0,H.jsx)(`tbody`,{children:r.map((e,t)=>(0,H.jsx)(`tr`,{className:`bg-background border-b`,children:i?.map(t=>(0,H.jsx)(`td`,{className:`px-6 py-4`,children:e[t.field]},t.field))},t))})]})})})()})]})]})};function de(e,t,n){let r=e.fields||[],i=r.map(e=>e.label||e.name),a=t.map(e=>r.map(t=>{let n=e[t.name];return n=he(n),typeof n==`string`&&(n.includes(`,`)||n.includes(`"`)||n.includes(`
|
|
2
|
+
`))?`"${n.replace(/"/g,`""`)}"`:n??``}));K([...n?.includeHeaders===!1?[]:[i.join(`,`)],...a.map(e=>e.join(`,`))].join(`
|
|
3
|
+
`),n?.filename||`${e.title||`report`}.csv`,`text/csv`)}function fe(e,t,n){let r={title:e.title,description:e.description,generatedAt:new Date().toISOString(),data:t};K(JSON.stringify(r,null,2),n?.filename||`${e.title||`report`}.json`,`application/json`)}function U(e,t,n){let r=e.fields||[],i=_e(n?.orientation),a=ge(n?.pageSize);K(`<!DOCTYPE html>
|
|
4
|
+
<html>
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<title>${G(e.title||`Report`)}</title>
|
|
8
|
+
<style>
|
|
9
|
+
@page { size: ${a} ${i}; margin: 20mm; }
|
|
10
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #333; }
|
|
11
|
+
h1 { font-size: 24px; margin-bottom: 8px; }
|
|
12
|
+
.description { color: #666; margin-bottom: 24px; }
|
|
13
|
+
.meta { color: #999; font-size: 12px; margin-bottom: 16px; }
|
|
14
|
+
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
|
|
15
|
+
th { background: #f5f5f5; text-align: left; padding: 8px 12px; border: 1px solid #ddd; font-weight: 600; }
|
|
16
|
+
td { padding: 8px 12px; border: 1px solid #ddd; }
|
|
17
|
+
tr:nth-child(even) { background: #fafafa; }
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<h1>${G(e.title||`Report`)}</h1>
|
|
22
|
+
${e.description?`<p class="description">${G(e.description)}</p>`:``}
|
|
23
|
+
<p class="meta">Generated: ${new Date().toLocaleString()}</p>
|
|
24
|
+
<table>
|
|
25
|
+
<thead><tr>${r.map(e=>`<th>${G(e.label||e.name)}</th>`).join(``)}</tr></thead>
|
|
26
|
+
<tbody>${t.map(e=>`<tr>${r.map(t=>`<td>${G(String(e[t.name]??``))}</td>`).join(``)}</tr>`).join(``)}</tbody>
|
|
27
|
+
</table>
|
|
28
|
+
</body>
|
|
29
|
+
</html>`,n?.filename||`${e.title||`report`}.html`,`text/html`)}function pe(e,t,n){let r=e.fields||[],i=_e(n?.orientation),a=ge(n?.pageSize),o=window.open(``,`_blank`);if(!o){U(e,t,{...n,format:`html`,filename:n?.filename?.replace(/\.pdf$/,`.html`)||`${e.title||`report`}.html`});return}o.document.write(`<!DOCTYPE html>
|
|
30
|
+
<html>
|
|
31
|
+
<head>
|
|
32
|
+
<meta charset="utf-8">
|
|
33
|
+
<title>${G(e.title||`Report`)}</title>
|
|
34
|
+
<style>
|
|
35
|
+
@page { size: ${a} ${i}; margin: 20mm; }
|
|
36
|
+
@media print { .no-print { display: none; } }
|
|
37
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #333; }
|
|
38
|
+
h1 { font-size: 24px; margin-bottom: 8px; }
|
|
39
|
+
.description { color: #666; margin-bottom: 24px; }
|
|
40
|
+
.meta { color: #999; font-size: 12px; margin-bottom: 16px; }
|
|
41
|
+
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
|
|
42
|
+
th { background: #f5f5f5; text-align: left; padding: 8px 12px; border: 1px solid #ddd; font-weight: 600; }
|
|
43
|
+
td { padding: 8px 12px; border: 1px solid #ddd; }
|
|
44
|
+
tr:nth-child(even) { background: #fafafa; }
|
|
45
|
+
</style>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
<h1>${G(e.title||`Report`)}</h1>
|
|
49
|
+
${e.description?`<p class="description">${G(e.description)}</p>`:``}
|
|
50
|
+
<p class="meta">Generated: ${new Date().toLocaleString()}</p>
|
|
51
|
+
<table>
|
|
52
|
+
<thead><tr>${r.map(e=>`<th>${G(e.label||e.name)}</th>`).join(``)}</tr></thead>
|
|
53
|
+
<tbody>${t.map(e=>`<tr>${r.map(t=>`<td>${G(String(e[t.name]??``))}</td>`).join(``)}</tr>`).join(``)}</tbody>
|
|
54
|
+
</table>
|
|
55
|
+
</body>
|
|
56
|
+
</html>`),o.document.close(),o.onload=()=>{o.print()}}function me(e,t,n){let r=e.fields||[],i=r.map(e=>e.label||e.name),a=t.map(e=>r.map(t=>{let n=e[t.name];return n=he(n),typeof n==`string`&&(n.includes(`,`)||n.includes(`"`)||n.includes(`
|
|
57
|
+
`)||n.includes(` `))?`"${n.replace(/"/g,`""`)}"`:n??``}));K(``+[...n?.includeHeaders===!1?[]:[i.join(` `)],...a.map(e=>e.join(` `))].join(`
|
|
58
|
+
`),n?.filename||`${e.title||`report`}.tsv`,`text/tab-separated-values`)}function W(e,t,n,r){switch(e){case`csv`:de(t,n,r);break;case`json`:fe(t,n,r);break;case`html`:U(t,n,r);break;case`pdf`:pe(t,n,r);break;case`excel`:me(t,n,r);break;default:console.warn(`Unsupported export format: ${e}`)}}function G(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function he(e){if(typeof e==`string`&&e.length>0){let t=e.charAt(0);if(t===`=`||t===`+`||t===`-`||t===`@`||t===`|`)return`\t${e}`}return e}function ge(e){return[`A4`,`A3`,`Letter`,`Legal`].includes(e||``)?e:`A4`}function _e(e){return e===`landscape`?`landscape`:`portrait`}function K(e,t,n){let r=new Blob([e],{type:`${n};charset=utf-8`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function q(e,t){if(e==null||e===``)return``;let n=t?.type,r=t?.format;if(n===`date`||r===`date`||ve(e))return ye(e);if(n===`number`||typeof e==`number`){let t=typeof e==`number`?e:Number(e);return isNaN(t)?String(e):r===`currency`||r===`currency_cny`?`¥${t.toLocaleString(`en-US`,{minimumFractionDigits:0,maximumFractionDigits:0})}`:r===`currency_usd`?`$${t.toLocaleString(`en-US`,{minimumFractionDigits:0,maximumFractionDigits:0})}`:r===`percent`?`${t.toLocaleString(`en-US`,{minimumFractionDigits:1,maximumFractionDigits:1})}%`:t.toLocaleString(`en-US`)}return String(e)}function ve(e){return typeof e==`string`&&/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?/.test(e)}function ye(e){try{let t=new Date(e);return isNaN(t.getTime())?String(e):`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}catch{return String(e)}}function be(e,t){if(!t||t.length===0||!e||e.length===0)return null;let n=t[0],r=n.field,i=new Map;for(let t of e){let e=String(t[r]??`(empty)`);i.has(e)||i.set(e,[]),i.get(e).push(t)}let a=[];for(let[e,t]of i)a.push({key:e,label:`${n.label||r}: ${e}`,rows:t});let o=n.sort===`desc`?-1:1;return a.sort((e,t)=>e.key.localeCompare(t.key)*o),a}function xe(e,t,n){if(!e)return 0;let r=e.map(e=>Number(e[t])||0);switch(n){case`count`:return e.length;case`sum`:return r.reduce((e,t)=>e+t,0);case`avg`:return r.length>0?(r.reduce((e,t)=>e+t,0)/r.length).toFixed(2):0;case`min`:return r.length>0?Math.min(...r):0;case`max`:return r.length>0?Math.max(...r):0;case`distinct`:return new Set(e.map(e=>e[t])).size;default:return``}}var J=({schema:e,onRefresh:t})=>{let{report:n,data:r,showToolbar:i=!0,allowExport:a=!0,allowPrint:o=!0,loading:s=!1}=e,c=A(),l=e=>{if(!n){console.warn(`ReportViewer: Cannot export, no report defined`);return}W(e,n,r||[],n.exportConfigs?.[e])},u=c(`common.printDialogHint`,`Opens your browser’s print dialog (not a PDF export)`),d=()=>{window.print()},f=()=>{t?.()},p=(e,t)=>xe(r,e,t),m=(e,t)=>{let r=n?.conditionalFormatting;if(!(!r||!Array.isArray(r)))for(let n of r){if(n.field!==e)continue;let r=String(t??``),i=String(n.value??``),a=!1;switch(n.operator){case`equals`:a=r===i;break;case`not_equals`:a=r!==i;break;case`contains`:a=r.includes(i);break;case`greater_than`:a=Number(t)>Number(n.value);break;case`less_than`:a=Number(t)<Number(n.value)}if(a){let e={};return n.backgroundColor&&(e.backgroundColor=n.backgroundColor),n.textColor&&(e.color=n.textColor),e}}},h=(e,t)=>{if(e==null||e===``)return``;if(t.renderAs===`badge`&&(!t.type||t.type===`string`||t.type===`text`)){let n=t.colorMap?.[String(e)]||``;return(0,H.jsx)(re,{className:n,children:String(e)})}if(t.aggregation)return q(e,t);if(t.type){let n={...t};t.colorMap&&!n.options&&(n.options=Object.entries(t.colorMap).map(([e,t])=>({value:e,label:e,color:t})));let r=ie(ae(n));return(0,H.jsx)(r,{value:e,field:n})}return q(e,t)};return n?(0,H.jsxs)(`div`,{className:`space-y-4`,children:[i&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2 p-4 bg-card rounded-lg border`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-lg font-semibold`,children:n.title}),n.description&&(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.description})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,"data-print-hide":!0,children:[n.refreshInterval&&(0,H.jsxs)(L,{variant:`outline`,size:`sm`,onClick:f,children:[(0,H.jsx)(oe,{className:`h-4 w-4 mr-2`}),`Refresh`]}),o&&(0,H.jsxs)(L,{variant:`outline`,size:`sm`,onClick:d,"aria-label":`Print: ${u}`,title:u,children:[(0,H.jsx)(ce,{className:`h-4 w-4 mr-2`}),`Print`]}),a&&n.showExportButtons&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsxs)(L,{variant:`outline`,size:`sm`,onClick:()=>l(`pdf`),children:[(0,H.jsx)(I,{className:`h-4 w-4 mr-2`}),`PDF`]}),(0,H.jsxs)(L,{variant:`outline`,size:`sm`,onClick:()=>l(`excel`),children:[(0,H.jsx)(I,{className:`h-4 w-4 mr-2`}),`Excel`]}),(0,H.jsxs)(L,{variant:`outline`,size:`sm`,onClick:()=>l(`csv`),children:[(0,H.jsx)(I,{className:`h-4 w-4 mr-2`}),`CSV`]})]})]})]}),(0,H.jsxs)(F,{children:[(0,H.jsxs)(z,{children:[!i&&n.title&&(0,H.jsx)(N,{children:n.title}),!i&&n.description&&(0,H.jsx)(M,{children:n.description})]}),(0,H.jsxs)(B,{className:`space-y-6`,children:[s&&(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[1,2,3].map(e=>(0,H.jsx)(F,{children:(0,H.jsxs)(B,{className:`p-4 space-y-2`,children:[(0,H.jsx)(R,{className:`h-4 w-20`}),(0,H.jsx)(R,{className:`h-8 w-28`})]})},e))}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(R,{className:`h-10 w-full`}),[1,2,3,4,5].map(e=>(0,H.jsx)(R,{className:`h-8 w-full`},e))]})]}),!s&&n.sections?.map((e,t)=>e.visible===!1?null:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[e.title&&e.type!==`header`&&(0,H.jsx)(`h3`,{className:`text-lg font-semibold border-b pb-2`,children:e.title}),e.type===`header`&&e.title&&(0,H.jsx)(`div`,{className:`text-2xl font-bold py-4`,children:e.title}),e.type===`summary`&&(0,H.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:n.fields?.filter(e=>e.showInSummary).map((e,t)=>(0,H.jsx)(F,{children:(0,H.jsxs)(B,{className:`p-4`,children:[(0,H.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e.label||e.name}),(0,H.jsx)(`div`,{className:`text-2xl font-bold`,children:q(p(e.name,e.aggregation),e)})]})},t))}),e.type===`table`&&(0,H.jsx)(`div`,{className:`border rounded-lg overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm min-w-[600px]`,children:[(0,H.jsx)(`thead`,{className:`bg-muted`,children:(0,H.jsx)(`tr`,{children:e.columns?.map((e,t)=>(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium ${e.type===`number`?`text-right`:`text-left`}`,children:e.label||e.name},t))})}),(0,H.jsx)(`tbody`,{children:(()=>{let t=be(r||[],n.groupBy||[]);return t?t.map(t=>(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(`tr`,{className:`bg-muted/60`,children:(0,H.jsxs)(`td`,{colSpan:e.columns?.length||1,className:`px-4 py-2 font-semibold text-sm`,children:[t.label,` (`,t.rows.length,`)`]})}),t.rows.map((t,n)=>(0,H.jsx)(`tr`,{className:`border-t hover:bg-muted/50 even:bg-muted/20`,children:e.columns?.map((e,n)=>(0,H.jsx)(`td`,{className:`px-4 py-2 ${e.type===`number`?`text-right tabular-nums`:``}`,style:m(e.name,t[e.name]),children:h(t[e.name],e)},n))},n))]},t.key)):r?.map((t,n)=>(0,H.jsx)(`tr`,{className:`border-t hover:bg-muted/50 even:bg-muted/20`,children:e.columns?.map((e,n)=>(0,H.jsx)(`td`,{className:`px-4 py-2 ${e.type===`number`?`text-right tabular-nums`:``}`,style:m(e.name,t[e.name]),children:h(t[e.name],e)},n))},n))})()})]})}),e.type===`text`&&e.text&&(0,H.jsx)(`div`,{className:`prose max-w-none`,children:(0,H.jsx)(`p`,{children:e.text})}),e.type===`page-break`&&(0,H.jsx)(`div`,{className:`border-t-2 border-dashed my-8 print:page-break-after-always`}),Array.isArray(e.content)?e.content.map((e,t)=>(0,H.jsx)(b,{schema:S(e)},t)):e.content&&(0,H.jsx)(b,{schema:S(e.content)})]},t)),!n.sections&&r&&r.length>0&&(0,H.jsx)(`div`,{className:`border rounded-lg overflow-x-auto`,children:(0,H.jsxs)(`table`,{className:`w-full text-sm min-w-[600px]`,children:[(0,H.jsx)(`thead`,{className:`bg-muted`,children:(0,H.jsx)(`tr`,{children:n.fields?.map((e,t)=>(0,H.jsx)(`th`,{className:`px-4 py-2 font-medium ${e.type===`number`?`text-right`:`text-left`}`,children:e.label||e.name},t))})}),(0,H.jsx)(`tbody`,{children:r.map((e,t)=>(0,H.jsx)(`tr`,{className:`border-t hover:bg-muted/50 even:bg-muted/20`,children:n.fields?.map((t,n)=>(0,H.jsx)(`td`,{className:`px-4 py-2 ${t.type===`number`?`text-right tabular-nums`:``}`,style:m(t.name,e[t.name]),children:h(e[t.name],t)},n))},t))})]})})]})]})]}):(0,H.jsx)(F,{children:(0,H.jsx)(B,{className:`p-8 text-center text-muted-foreground`,children:`No report to display`})})};function Se(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.dataset==`string`&&t.dataset.length>0||t.type===`joined`&&Array.isArray(t.blocks)&&t.blocks.some(e=>typeof e?.dataset==`string`)}var Ce=new Set,we=()=>!1;function Te(e,t){if(!we())return;let n=e.filter;if(n===void 0)return;let r=`${t}:${n&&typeof n==`object`?Object.keys(n).sort().join(`,`):String(n)}`;Ce.has(r)||(Ce.add(r),console.warn(`[ObjectUI] ${t} carries \`filter\`, which is not an authorable key. Did you mean \`filter\` → \`runtimeFilter\`? NO filter was applied — it renders UNFILTERED, showing rows the report was scoped to exclude. \`ReportSchema\` (\`@objectstack/spec\`) is strict and rejects \`filter\`, so this document did not come through the validated path; the renderer no longer reads it either. Fix the producer: rename \`filter\` to \`runtimeFilter\`. (objectui#5137)`))}function Ee(e){return`Report \`${e.name??`(unnamed)`}\``}function De(e,t){return e?typeof e==`string`?e:typeof e==`object`&&typeof e.default==`string`?e.default:t:t}function Y(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&!!e):[]}function Oe(e){if(!Array.isArray(e))return;let t={};for(let n of e){let e=n&&typeof n==`object`?n.by:void 0;typeof e!=`string`||!e||(t[e]=n.direction===`desc`?`desc`:`asc`)}return Object.keys(t).length>0?t:void 0}function ke(e,t,n){if(!e)return;let r=new Set([...t,...n]),i={};for(let[t,n]of Object.entries(e))r.has(t)&&(i[t]=n);return Object.keys(i).length>0?i:void 0}function X(e,t,n,r,i,a,o){let[s,c]=V.useState({status:`idle`,rows:[]}),l=ke(o,t,n),u=JSON.stringify(r??null),d=JSON.stringify(a??null),f=JSON.stringify(l??null),p=`${e}|${t.join(`,`)}|${n.join(`,`)}|${u}|${d}|${f}`;return V.useEffect(()=>{let o=i;if(!o||typeof o.queryDataset!=`function`){c({status:`error`,rows:[],error:`This data source does not support dataset queries.`});return}if(!e||n.length===0){c({status:`idle`,rows:[]});return}let s=!1;return c({status:`loading`,rows:[]}),o.queryDataset(e,{dimensions:t,measures:n,...r&&Object.keys(r).length>0?{runtimeFilter:r}:{},...a?{totals:{groupings:a}}:{},...l?{order:l}:{}}).then(e=>{s||c({status:`ok`,rows:Array.isArray(e?.rows)?e.rows:[],fields:Array.isArray(e?.fields)?e.fields:[],object:e?.object,dimensionFields:e?.dimensionFields,drillRawRows:Array.isArray(e?.drillRawRows)?e.drillRawRows:void 0,drillRanges:Array.isArray(e?.drillRanges)?e.drillRanges:void 0,totals:Array.isArray(e?.totals)?e.totals:void 0})}).catch(e=>{s||c({status:`error`,rows:[],error:String(e?.message??e)})}),()=>{s=!0}},[p]),s}function Ae({dataset:e}){return(0,H.jsxs)(`div`,{className:`flex items-center justify-center rounded-md border border-dashed bg-muted/20 p-4 text-xs text-muted-foreground`,children:[`This report binds the “`,e,`” dataset — choose at least one measure (values) to render.`]})}function Z({status:e,error:t}){return e===`error`?(0,H.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:[(0,H.jsx)(le,{className:`h-3.5 w-3.5 mt-0.5 shrink-0`}),(0,H.jsx)(`span`,{className:`break-words`,children:t})]}):(0,H.jsxs)(`div`,{className:`flex items-center gap-2 p-4 text-xs text-muted-foreground`,children:[(0,H.jsx)(se,{className:`h-4 w-4 animate-spin`}),` Running report…`]})}function je(){return(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-md border border-dashed bg-muted/20 p-6 text-xs text-muted-foreground`,children:[(0,H.jsx)(P,{className:`h-6 w-6`}),` The dataset returned no rows for this report’s scope.`]})}var Me=`cursor-pointer hover:bg-accent/40`;function Ne({dataset:e,rows:t,values:n,runtimeFilter:r,dataSource:i,onDrill:a,order:s,withTotals:c}){let f=X(e,t,n,r,i,c&&t.length>0?[[]]:void 0,s),{fieldLabel:p}=te(),m=A(),h=j(),g=E(f.object,f.dimensionFields,t);if(n.length===0)return(0,H.jsx)(Ae,{dataset:e});if(f.status===`loading`||f.status===`idle`)return(0,H.jsx)(Z,{status:f.status});if(f.status===`error`)return(0,H.jsx)(Z,{status:`error`,error:f.error});if(f.rows.length===0)return(0,H.jsx)(je,{});let _=!!a&&t.length>0,y=f.dimensionFields?t.filter(e=>e in f.dimensionFields):[],b=(n,i)=>{let o={};for(let e of t)o[e]=n[e];let s=f.drillRanges?.[i],c=!!s&&Object.keys(s).length>0,l=f.object&&(y.length>0||c)?u(f.drillRawRows?.[i],y,f.dimensionFields??{},r,s):void 0;a({dataset:e,groupKey:o,runtimeFilter:r,object:f.object,objectFilter:l})},{measureField:x,headerLabel:S}=l(f.fields,f.object,p),C=[...t,...n],ee=v(f.rows,g),w=c?f.totals?.find(e=>Array.isArray(e.dimensions)&&e.dimensions.length===0)?.rows?.[0]:void 0,T=m(`report.total`,`Total`);return(0,H.jsx)(`div`,{className:`overflow-auto max-h-[70vh] rounded-md border`,children:(0,H.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/40`,children:(0,H.jsx)(`tr`,{children:C.map(e=>(0,H.jsx)(`th`,{className:`px-2 py-1.5 text-left font-medium whitespace-nowrap`,children:S(e)},e))})}),(0,H.jsxs)(`tbody`,{children:[ee.map((e,t)=>(0,H.jsx)(`tr`,{className:`border-t${_?` ${Me}`:``}`,"data-testid":_?`dataset-drill-row`:void 0,onClick:_?()=>b(f.rows[t],t):void 0,children:C.map(t=>(0,H.jsx)(`td`,{className:`px-2 py-1 tabular-nums whitespace-nowrap`,children:n.includes(t)?o(e[t],x(t)?.format,x(t)?.currency,x(t)?.percentScale,h):d(e[t],h)},t))},t)),w&&(0,H.jsxs)(`tr`,{className:`border-t bg-muted/30 font-medium`,"data-testid":`dataset-report-total-row`,children:[t.length>0&&(0,H.jsx)(`td`,{colSpan:t.length,className:`px-2 py-1 whitespace-nowrap`,children:T}),n.map(e=>(0,H.jsx)(`td`,{className:`px-2 py-1 tabular-nums whitespace-nowrap`,children:o(w[e],x(e)?.format,x(e)?.currency,x(e)?.percentScale,h)},e))]})]})]})})}function Pe(e){switch(e){case`summary`:return`summary`;case`matrix`:return`matrix`;case`joined`:return`joined`;default:return`tabular`}}function Fe(e){switch(e){case`bar`:case`column`:case`horizontal-bar`:case`line`:case`area`:case`pie`:case`donut`:case`funnel`:case`scatter`:case`treemap`:case`sankey`:case`radar`:case`combo`:return{kind:`series`,chartType:e};case`gauge`:case`solid-gauge`:case`metric`:case`kpi`:case`bullet`:return{kind:`single_value`};case`table`:case`pivot`:return{kind:`tabular`};default:return{kind:`unsupported`,type:String(e)}}}function Ie(e){let[,t]=V.useReducer(e=>e+1,0);return V.useEffect(()=>{if(a.get(e))return;let n=typeof a.subscribe==`function`?a.subscribe(()=>{a.get(e)&&t()}):void 0,r=a.loadLazy?.(e);return r&&typeof r.then==`function`&&r.then(()=>t()).catch(()=>{}),n},[e]),a.get(e)}function Le(e,t,n){if(!(!Array.isArray(e)||!t))for(let r of e){if(!r||typeof r!=`object`)continue;let{name:e,label:i}=r;if(e===t)return O(i,n)||void 0}}function Re({dataset:e,chart:t,runtimeFilter:n,dataSource:r,order:i}){let a=typeof t.xAxis==`string`?t.xAxis:``,s=typeof t.yAxis==`string`?t.yAxis:``,u=Fe(t.type),d=u.kind===`series`||u.kind===`single_value`,f=X(e,u.kind===`series`&&a?[a]:[],d&&s?[s]:[],n,r,void 0,i),p=Ie(`chart`),{fieldLabel:b,fieldOptionLabel:S}=te(),w=A(),T=j(),{language:E}=ne(),D=V.useMemo(()=>a?[a]:[],[a]),O=c(f.object,f.dimensionFields,D),{categoryColors:M,dimensionLabels:N,categoryOrder:P}=V.useMemo(()=>{if(!O)return{categoryColors:null,dimensionLabels:null,categoryOrder:null};let{metaByPath:e,relabel:t}=O,n=t[0]?.path,r=n?e[n]:void 0,i=n?y(r?.options,_(r,S)):void 0;return{categoryColors:x(i),dimensionLabels:g(e,t,S),categoryOrder:C(i)}},[O,S]),F=typeof t.title==`string`?t.title:void 0;if(u.kind===`tabular`)return null;if(u.kind===`unsupported`)return(0,H.jsxs)(`div`,{className:`rounded-md border border-dashed bg-muted/20 px-3 py-2 text-xs text-muted-foreground`,"data-testid":`dataset-report-chart-unsupported`,children:[`Chart type “`,u.type,`” is not a spec chart type — the grouped table below carries this report’s numbers.`]});if(u.kind===`series`&&!a||!s)return null;if(f.status===`loading`||f.status===`idle`)return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 p-4 text-xs text-muted-foreground`,children:[(0,H.jsx)(se,{className:`h-4 w-4 animate-spin`}),` Loading chart…`]});if(f.status===`error`||f.rows.length===0)return null;let{measureField:I,headerLabel:re}=l(f.fields,f.object,b),L=Le(t.series,s,E)??re(s);if(u.kind===`single_value`){let e=I(s);return(0,H.jsxs)(`div`,{className:`rounded-md border bg-card p-3`,"data-testid":`dataset-report-metric`,children:[F?(0,H.jsx)(`h3`,{className:`mb-2 text-sm font-semibold`,children:F}):null,(0,H.jsxs)(`div`,{className:`flex flex-col gap-0.5 py-2`,children:[(0,H.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums`,children:o(f.rows[0]?.[s],e?.format,e?.currency,e?.percentScale,T)}),(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:L})]})]})}if(!p)return null;let{data:ie,xAxisKey:ae,series:R}=h(v(f.rows,N),[a],[s],f.fields,{nullCategoryLabel:w(`chart.nullCategory`,`(None)`),builtinAggregateLabels:k(w)}),z=m(R,t.series).map(e=>e.dataKey===s?{...e,label:L}:e),{title:B,...oe}=ee(t,M);return(0,H.jsxs)(`div`,{className:`rounded-md border bg-card p-3`,"data-testid":`dataset-report-chart`,children:[F?(0,H.jsx)(`h3`,{className:`mb-2 text-sm font-semibold`,children:F}):null,(0,H.jsx)(p,{schema:{chartType:u.chartType,data:ie,xAxisKey:ae,series:z,height:280,isAnimationActive:!1,...oe,...P?{categoryOrder:P}:{}}})]})}function Q(e,t){return f(e.map(e=>D(t[e])))}function ze(e,t,n){return e.map(e=>d(t[e],n)).join(` / `)}function Be({dataset:e,rows:t,columnsAcross:n,values:r,runtimeFilter:i,dataSource:a,onDrill:s,order:c}){let f=X(e,[...t,...n],r,i,a,[t,n,[]],c),p=A(),{fieldLabel:m}=te(),h=j(),g=E(f.object,f.dimensionFields,[...t,...n]),_=V.useMemo(()=>{if(f.status!==`ok`)return null;let e=[],r=[],i=new Set,a=new Set,o=new Map;return v(f.rows,g).forEach((s,c)=>{let l=f.rows[c],u=Q(t,s),d=Q(n,s);if(!i.has(u)){i.add(u);let n={},r={};for(let e of t)n[e]=l[e],r[e]=s[e];e.push({id:u,label:ze(t,s,h),key:n,display:r})}if(!a.has(d)){a.add(d);let e={},t={};for(let r of n)e[r]=l[r],t[r]=s[r];r.push({id:d,label:ze(n,s,h),key:e,display:t})}o.set(w(u,d),{row:l,index:c})}),{rowHeaders:e,colHeaders:r,cells:o}},[f,t,n,g,h]);if(r.length===0)return(0,H.jsx)(Ae,{dataset:e});if(f.status===`loading`||f.status===`idle`)return(0,H.jsx)(Z,{status:f.status});if(f.status===`error`)return(0,H.jsx)(Z,{status:`error`,error:f.error});if(!_||_.rowHeaders.length===0)return(0,H.jsx)(je,{});let{measureField:y,headerLabel:b}=l(f.fields,f.object,m),x=p(`report.total`,`Total`),S=!!s,C=f.dimensionFields?[...t,...n].filter(e=>e in f.dimensionFields):[],ee=(t,n,r)=>{let a=f.drillRanges?.[r],o=!!a&&Object.keys(a).length>0,c=f.object&&(C.length>0||o)?u(f.drillRawRows?.[r],C,f.dimensionFields??{},i,a):void 0;s({dataset:e,groupKey:{...t,...n},runtimeFilter:i,object:f.object,objectFilter:c})},T=_.colHeaders.flatMap(e=>r.map(t=>({col:e,measure:t,header:r.length===1?e.label:`${e.label} · ${b(t)}`}))),D=e=>{let t=f.totals?.find(t=>Array.isArray(t.dimensions)&&t.dimensions.join(`,`)===e.join(`,`))?.rows;return t&&v(t,g)},O=new Map;for(let e of D(t)??[])O.set(Q(t,e),e);let k=new Map;for(let e of D(n)??[])k.set(Q(n,e),e);let ne=D([])?.[0],M=O.size>0,N=k.size>0;return(0,H.jsx)(`div`,{className:`overflow-auto max-h-[70vh] rounded-md border`,"data-testid":`dataset-matrix`,children:(0,H.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,H.jsx)(`thead`,{className:`bg-muted/40`,children:(0,H.jsxs)(`tr`,{children:[t.map(e=>(0,H.jsx)(`th`,{className:`px-2 py-1.5 text-left font-medium whitespace-nowrap`,children:b(e)},e)),T.map(e=>(0,H.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium whitespace-nowrap`,children:e.header},`${e.col.id}-${e.measure}`)),M&&r.map(e=>(0,H.jsx)(`th`,{className:`px-2 py-1.5 text-right font-medium whitespace-nowrap`,"data-testid":`matrix-total-col-header`,children:r.length===1?x:`${x} · ${b(e)}`},`total-${e}`))]})}),(0,H.jsxs)(`tbody`,{children:[_.rowHeaders.map(e=>(0,H.jsxs)(`tr`,{className:`border-t`,children:[t.map(t=>(0,H.jsx)(`td`,{className:`px-2 py-1 whitespace-nowrap font-medium`,children:d(e.display[t],h)},t)),T.map(t=>{let n=_.cells.get(w(e.id,t.col.id)),r=n?.row[t.measure],i=S&&n!=null;return(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums whitespace-nowrap${i?` ${Me}`:``}`,"data-testid":i?`dataset-drill-cell`:void 0,onClick:i?()=>ee(e.key,t.col.key,n.index):void 0,children:o(r,y(t.measure)?.format,y(t.measure)?.currency,y(t.measure)?.percentScale,h)},`${t.col.id}-${t.measure}`)}),M&&r.map(t=>(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums whitespace-nowrap font-medium`,"data-testid":`matrix-row-total`,children:o(O.get(e.id)?.[t],y(t)?.format,y(t)?.currency,y(t)?.percentScale,h)},`total-${t}`))]},e.id)),N&&(0,H.jsxs)(`tr`,{className:`border-t bg-muted/30 font-medium`,"data-testid":`matrix-total-row`,children:[t.length>0&&(0,H.jsx)(`td`,{colSpan:t.length,className:`px-2 py-1 whitespace-nowrap`,children:x}),T.map(e=>(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums whitespace-nowrap`,children:o(k.get(e.col.id)?.[e.measure],y(e.measure)?.format,y(e.measure)?.currency,y(e.measure)?.percentScale,h)},`${e.col.id}-${e.measure}`)),M&&r.map(e=>(0,H.jsx)(`td`,{className:`px-2 py-1 text-right tabular-nums whitespace-nowrap`,"data-testid":`matrix-grand-total`,children:o(ne?.[e],y(e)?.format,y(e)?.currency,y(e)?.percentScale,h)},`grand-${e}`))]})]})]})})}var Ve=({report:e,dataSource:t,runtimeFilter:n,onDrill:r,className:i})=>{let a=Ee(e);Te(e,a);let o=s(e.runtimeFilter,n),c=e.drilldown===!1?void 0:r,l=Pe(e.type);if(l===`joined`&&Array.isArray(e.blocks))return(0,H.jsx)(`div`,{className:i,"data-testid":`dataset-joined-report`,"data-report-name":e.name,style:{display:`flex`,flexDirection:`column`,gap:24},children:e.blocks.map((e,n)=>{Te(e,`${a} block \`${e.name??n}\``);let r=s(o,e.runtimeFilter),i=Y(e.columns),l=Oe(e.order),u=Pe(e.type),d=u===`matrix`&&i.length>0?(0,H.jsx)(Be,{dataset:String(e.dataset??``),rows:Y(e.rows),columnsAcross:i,values:Y(e.values),runtimeFilter:r,dataSource:t,onDrill:c,order:l}):(0,H.jsx)(Ne,{dataset:String(e.dataset??``),rows:Y(e.rows),values:Y(e.values),runtimeFilter:r,dataSource:t,onDrill:c,order:l,withTotals:u===`summary`||u===`matrix`});return(0,H.jsxs)(`section`,{"data-testid":`dataset-report-block`,"data-block-id":e.name??`block-${n}`,className:`flex flex-col gap-2 rounded-lg border bg-card p-4`,children:[(0,H.jsxs)(`header`,{className:`flex flex-col gap-0.5`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold`,children:De(e.label,e.name??`Block ${n+1}`)}),e.description?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:De(e.description,``)}):null]}),d]},e.name??`block-${n}`)})});let u=Y(e.columns),d=Oe(e.order);if(l===`matrix`&&u.length>0)return(0,H.jsx)(`div`,{className:i,"data-testid":`dataset-report`,"data-report-name":e.name,children:(0,H.jsx)(Be,{dataset:String(e.dataset??``),rows:Y(e.rows),columnsAcross:u,values:Y(e.values),runtimeFilter:o,dataSource:t,onDrill:c,order:d})});let f=e.chart&&typeof e.chart==`object`&&e.chart.type?e.chart:null;return(0,H.jsxs)(`div`,{className:`${i??``} flex flex-col gap-3`,"data-testid":`dataset-report`,"data-report-name":e.name,"data-report-presentation":l,children:[f?(0,H.jsx)(Re,{dataset:String(e.dataset??``),chart:f,runtimeFilter:o,dataSource:t,order:d}):null,(0,H.jsx)(Ne,{dataset:String(e.dataset??``),rows:Y(e.rows),values:Y(e.values),runtimeFilter:o,dataSource:t,onDrill:c,order:d,withTotals:l===`summary`||l===`matrix`})]})},$=e=>{let{dataSource:t,rows:n,runtimeFilter:r,onDrill:a,className:o}=e,s=V.useContext(i),c=t??s?.dataSource,l=e.schema;if(l&&typeof l==`object`&&l.type===`spec-report`&&l.report&&typeof l.report==`object`&&(l=l.report),Se(l))return(0,H.jsx)(Ve,{report:l,dataSource:c,runtimeFilter:r,onDrill:a,className:o});if(p(l)){let e={type:`report-viewer`,report:T(l),data:n??[],showToolbar:!1};return(0,H.jsx)(`div`,{className:o,"data-testid":`report-presentation-bridge`,children:(0,H.jsx)(J,{schema:e})})}return(0,H.jsx)(ue,{schema:l})};async function He(e,t){let{dataSource:n,resource:r,queryParams:i,format:a,exportConfig:o}=t,s=a||e.defaultExportFormat||`pdf`;try{let t=(await n.find(r,i)).data||[];return W(s,e,t,{format:s,...e.exportConfigs?.[s],...o}),{success:!0,recordCount:t.length,format:s}}catch(e){return{success:!1,recordCount:0,format:s,error:e.message}}}function Ue(e,t,n={}){let{columns:r,filename:i,includeAggregationRow:a=!1}=n,o=r||(e.fields||[]).map(Ge),s=o.map(e=>e.header),c=t.map((e,t)=>o.map(n=>{if(n.formula)return n.formula.replace(/\{ROW\}/g,String(t+2));let r=e[n.name];return Ke(r,n.numberFormat)}));if(a&&t.length>0){let n=o.map((n,r)=>{let i=(e.fields||[]).find(e=>e.name===n.name);if(i?.aggregation){let e=Je(r),n=t.length+1;switch(i.aggregation){case`sum`:return`=SUM(${e}2:${e}${n})`;case`avg`:return`=AVERAGE(${e}2:${e}${n})`;case`count`:return`=COUNTA(${e}2:${e}${n})`;case`min`:return`=MIN(${e}2:${e}${n})`;case`max`:return`=MAX(${e}2:${e}${n})`;default:return``}}return``});c.push(n)}Xe(``+[s.join(` `),...c.map(e=>e.join(` `))].join(`
|
|
59
|
+
`),i||`${e.title||`report`}.tsv`,`text/tab-separated-values`)}function We(e,t,n,r){return async()=>{let i=e.schedule;if(!i?.enabled)return[];let a=i.formats||[e.defaultExportFormat||`pdf`],o=[];for(let r of a){let i=await He(e,{dataSource:t,resource:n,format:r});o.push(i)}return r(e,i),o}}function Ge(e){return{name:e.name,header:e.label||e.name}}function Ke(e,t){return e==null?``:typeof e==`number`&&t?e.toLocaleString(`en-US`,qe(t)):Ye(String(e))}function qe(e){if(e.includes(`%`))return{style:`percent`,minimumFractionDigits:0};let t=(e.match(/0/g)||[]).length;return{minimumFractionDigits:Math.max(0,t-1),maximumFractionDigits:Math.max(0,t-1)}}function Je(e){let t=``,n=e;for(;n>=0;)t=String.fromCharCode(n%26+65)+t,n=Math.floor(n/26)-1;return t}function Ye(e){if(e.length>0){let t=e.charAt(0);if(t===`=`||t===`+`||t===`-`||t===`@`||t===`|`)return`'${e}`}return e}function Xe(e,t,n){let r=new Blob([e],{type:`${n};charset=utf-8`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}var Ze=t({DatasetReportRenderer:()=>Ve,LegacyReportRenderer:()=>ue,ReportRenderer:()=>$,ReportViewer:()=>J,createScheduleTrigger:()=>We,exportAsCSV:()=>de,exportAsExcel:()=>me,exportAsHTML:()=>U,exportAsJSON:()=>fe,exportAsPDF:()=>pe,exportExcelWithFormulas:()=>Ue,exportReport:()=>W,exportWithLiveData:()=>He,formatValue:()=>q,isDatasetReport:()=>Se,mergeFilters:()=>s});a.register(`report`,$,{namespace:`plugin-report`,label:`Report`,category:`Report`,inputs:[{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`chart`,type:`code`,label:`Chart Configuration`}]}),a.register(`spec-report`,$,{namespace:`plugin-report`,label:`Spec Report`,category:`Report`,inputs:[{name:`dataset`,type:`string`,label:`Dataset`},{name:`type`,type:`string`,label:`Report Type`}]}),a.register(`report-viewer`,J,{namespace:`plugin-report`,label:`Report Viewer`,category:`Report`,inputs:[{name:`report`,type:`code`,label:`Report Definition`},{name:`showToolbar`,type:`boolean`,label:`Show Toolbar`}]});export{Ze as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{b as n,r}from"./vendor-react-CsWFRkED.js";import{$r as i,Br as a,Ft as o,Ir as s,Jt as c,Pt as l,Qr as u,er as d,p as f,ut as p}from"./framework-BfSv4Kb0.js";import{d as m,p as h,t as g}from"./i18n-locales-Bz4c8KXc.js";import{al as _,dt as ee,il as v}from"./ui-components-D2lrjG-t.js";import{i as y}from"./vendor-ui-utils-BFw4cGI6.js";import{g as b,t as x,v as S}from"./vendor-zod-r9lyeyrU.js";import{s as te}from"./plugin-grid-kkbz4uec.js";var C={"timeline.bucket.overdue":`Overdue`,"timeline.bucket.today":`Today`,"timeline.bucket.tomorrow":`Tomorrow`,"timeline.bucket.thisWeek":`This week`,"timeline.bucket.nextWeek":`Next week`,"timeline.bucket.later":`Later`,"timeline.bucket.noDate":`No date`,"timeline.bucket.unassigned":`Unassigned`,"timeline.relative.today":`Today`,"timeline.relative.tomorrow":`Tomorrow`,"timeline.relative.yesterday":`Yesterday`,"timeline.relative.inDays":`In {{n}} days`,"timeline.relative.daysAgo":`{{n}} days ago`,"timeline.scale.week":`Week {{n}}`,"timeline.scale.quarter":`Q{{quarter}} {{year}}`,"timeline.gantt.rowLabel":`Items`,"timeline.gantt.unusableRange.malformedDate":`Unusable gantt date range — {{path}} is {{value}}, which is not a valid date. Every gantt date has to parse: the startDate and endDate on every row item, plus any minDate / maxDate pinned on the schema.`,"timeline.gantt.unusableRange.inverted":`Unusable gantt date range — minDate {{minDate}} is after maxDate {{maxDate}}. A pinned minDate / maxDate overrides the range computed from the rows, so this axis has no columns and no bar can be placed on it; swap the two values.`,"timeline.gantt.unusableRange.malformedRow":`Unusable gantt rows — {{path}} is {{value}}, which is not a row shape. A gantt draws items as a list of rows, every row as an object with a label and its own items, and every row's items as a list of bars; a null, a number, a string or a plain object in any of those places cannot be drawn.`,"timeline.unsupported.objectBoundGantt":`Unsupported variant "gantt" — an object-bound timeline renders the feed variants ({{variants}}). Gantt needs literal rows, each with its own nested items, so the gantt axis (scale) has no effect here.`,"timeline.unconfigured.noDateAxis":`Timeline date axis required — this view declares no date field, and an object-bound timeline will not invent one. Declare one of: {{fields}}. The first is the spec spelling; the rest are legacy aliases.`},w=`timeline.bucket.today`,ne=(e,t)=>Object.entries(t??{}).reduce((e,[t,n])=>e.split(`{{${t}}}`).join(String(n)),C[e]||e),re=h(C,w),T=e(n(),1),E=r(),D=new Set([`hour`,`day`,`week`,`month`,`quarter`,`year`]);function O(e){let t=e.scale;return typeof t==`string`&&D.has(t)?t:`month`}function k(e,t,n,r=`en`,i=ne){let a=[],o=new Date(t),s=new Date(n);if(Number.isNaN(o.getTime())||Number.isNaN(s.getTime())||o>s)return a;let c=new Date(o);switch(e){case`hour`:for(;c<=s;)a.push(c.toLocaleString(r,{month:`short`,day:`numeric`,hour:`numeric`})),c.setHours(c.getHours()+1);break;case`day`:for(;c<=s;)a.push(c.toLocaleDateString(r,{month:`short`,day:`numeric`})),c.setDate(c.getDate()+1);break;case`week`:{let e=1;for(;c<=s;)a.push(i(`timeline.scale.week`,{n:e++})),c.setDate(c.getDate()+7);break}case`quarter`:for(c.setMonth(Math.floor(c.getMonth()/3)*3,1);c<=s;)a.push(i(`timeline.scale.quarter`,{quarter:Math.floor(c.getMonth()/3)+1,year:c.getFullYear()})),c.setMonth(c.getMonth()+3);break;case`year`:for(c.setMonth(0,1);c<=s;)a.push(String(c.getFullYear())),c.setFullYear(c.getFullYear()+1);break;default:for(;c<=s;)a.push(c.toLocaleDateString(r,{month:`short`,year:`numeric`})),c.setMonth(c.getMonth()+1)}return a}function A(){let e=new Date().toISOString().split(`T`)[0];return{minDate:e,maxDate:e}}function j(e){if(!Array.isArray(e))return{ok:!1,path:`items`,value:e};let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r==null)return{ok:!1,path:`items[${n}]`,value:r};let i=r.items;if(i&&!Array.isArray(i))return{ok:!1,path:`items[${n}].items`,value:i};t.push({authored:r,label:r.label,items:i||[]})}return{ok:!0,rows:t}}function M(e){let t=e.flatMap(e=>e.items.flatMap(e=>[e.startDate,e.endDate]));if(t.length===0)return A();let n=Math.min(...t.map(e=>new Date(e).getTime())),r=Math.max(...t.map(e=>new Date(e).getTime()));return{minDate:new Date(n).toISOString().split(`T`)[0],maxDate:new Date(r).toISOString().split(`T`)[0]}}var N=e=>{try{return Date.prototype.getTime.call(e),!0}catch{return!1}};function P(e){return typeof e==`string`?JSON.stringify(e):e===void 0?`undefined`:e===null?`null`:typeof e==`symbol`?e.toString():typeof e==`bigint`?`${e}n`:typeof e==`number`||typeof e==`boolean`?String(e):N(e)?Date.prototype.toString.call(e):Array.isArray(e)?`an array`:typeof e==`function`?`a function`:`an object`}var F=e=>typeof e==`string`||typeof e==`number`&&Number.isFinite(e)||N(e);function I(e,t,n){let r=e=>!F(e)||Number.isNaN(new Date(e).getTime());for(let t=0;t<e.length;t++){let n=e[t].items;for(let e=0;e<n.length;e++)for(let i of[`startDate`,`endDate`]){let a=n[e]?.[i];if(r(a))return{path:`items[${t}].items[${e}].${i}`,value:a}}}for(let[e,i]of[[`minDate`,t],[`maxDate`,n]])if(i&&r(i))return{path:e,value:i}}function L(e,t,n,r){let i=new Date(e).getTime(),a=new Date(t).getTime(),o=new Date(n).getTime(),s=new Date(r).getTime()-o,c=i-o,l=a-i;return s===0?{start:0,width:100}:{start:c/s*100,width:l/s*100}}function R(e,t,n){let r=new Date(e);return t===`short`?r.toLocaleDateString(n):t===`long`?r.toLocaleDateString(n,{year:`numeric`,month:`long`,day:`numeric`}):r.toISOString().split(`T`)[0]}function ie({label:e,color:t}){let n=t?{backgroundColor:`${t}22`,color:t,borderColor:`${t}55`}:void 0;return(0,E.jsx)(`span`,{className:v(`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium`,!t&&`bg-muted text-muted-foreground border-transparent`),style:n,children:e})}function ae(e){let t=[];for(let n of e){let e=n.group==null?``:String(n.group),r=t[t.length-1];r&&r.key===e?r.items.push(n):t.push({key:e,items:[n]})}return t}var oe=({schema:e,className:t,...n})=>{let{variant:r=`vertical`,items:i=[],dateFormat:a=`short`,onItemClick:o}=e,s=g(),{t:c}=re();if(r===`vertical`){let e=ae(i),r=e.some(e=>e.key!==``),c=(e,t)=>{let n=e.color?{backgroundColor:`${e.color}33`,borderColor:e.color}:void 0,r=e.time?R(e.time,a,s):e.startDate?R(e.startDate,a,s):``,i=e.endDate&&e.endDate!==e.startDate?R(e.endDate,a,s):``,c=Array.isArray(e.meta)?e.meta:[];return(0,E.jsxs)(U,{density:`compact`,className:v(e.className,o&&`cursor-pointer`),onClick:()=>o?.(e),children:[(0,E.jsx)(W,{variant:e.color?`default`:e.variant||`default`,style:n,children:e.icon&&(0,E.jsx)(`span`,{className:`text-xs`,children:e.icon})}),(0,E.jsxs)(G,{children:[(r||i)&&(0,E.jsxs)(q,{dateTime:e.time||e.startDate,className:`!mb-1 text-xs`,children:[r,i&&(0,E.jsxs)(`span`,{className:`text-muted-foreground/70`,children:[` → `,i]})]}),e.title&&(0,E.jsx)(K,{className:`text-sm sm:text-base mb-1`,children:e.title}),c.length>0&&(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1 mb-1`,children:c.map(e=>(0,E.jsx)(ie,{label:e.label,color:e.color},e.key))}),e.description&&(0,E.jsx)(J,{className:`text-sm text-muted-foreground line-clamp-2 sm:line-clamp-none`,children:e.description}),e.content&&_(e.content)]})]},t)};return r?(0,E.jsx)(`div`,{className:v(`px-4 sm:px-6 py-2`,t),...n,children:e.map((e,t)=>(0,E.jsxs)(`section`,{className:`mb-4`,children:[(0,E.jsxs)(`header`,{className:`sticky top-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-1.5 backdrop-blur bg-background/90 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-b`,children:[(0,E.jsx)(`span`,{children:e.key}),(0,E.jsx)(`span`,{className:`ml-2 text-muted-foreground/60 font-normal normal-case`,children:e.items.length})]}),(0,E.jsx)(V,{className:`mt-3`,children:e.items.map((e,n)=>c(e,`${t}-${n}`))})]},`${e.key}-${t}`))}):(0,E.jsx)(V,{className:t,...n,children:i.map((e,t)=>c(e,t))})}if(r===`horizontal`)return(0,E.jsx)(Y,{className:v(`overflow-x-auto [-webkit-overflow-scrolling:touch]`,t),...n,children:i.map((e,t)=>(0,E.jsxs)(X,{className:v(e.className,o&&`cursor-pointer`),onClick:()=>o?.(e),children:[(0,E.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,E.jsx)(W,{variant:e.variant||`default`,children:e.icon&&(0,E.jsx)(`span`,{className:`text-xs`,children:e.icon})}),(0,E.jsxs)(`div`,{className:`mt-4 text-center`,children:[e.time&&(0,E.jsx)(q,{dateTime:e.time,children:R(e.time,a,s)}),e.title&&(0,E.jsx)(K,{children:e.title}),e.description&&(0,E.jsx)(J,{className:`text-center line-clamp-2 sm:line-clamp-none`,children:e.description}),e.content&&_(e.content)]})]}),t<i.length-1&&(0,E.jsx)(`div`,{className:`absolute left-full w-16 border-t-2 border-gray-200 top-3`})]},t))});if(r===`gantt`){let r=j(i);if(!r.ok)return(0,E.jsx)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-unusable-date-range`,role:`alert`,children:c(`timeline.gantt.unusableRange.malformedRow`,{path:r.path,value:P(r.value)})});let l=r.rows,u=I(l,e.minDate,e.maxDate);if(u)return(0,E.jsx)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-unusable-date-range`,role:`alert`,children:c(`timeline.gantt.unusableRange.malformedDate`,{path:u.path,value:P(u.value)})});let d=M(l),f=e.minDate||d.minDate,p=e.maxDate||d.maxDate;if(new Date(f).getTime()>new Date(p).getTime())return(0,E.jsx)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-unusable-date-range`,role:`alert`,children:c(`timeline.gantt.unusableRange.inverted`,{minDate:P(f),maxDate:P(p)})});let m=k(O(e),f,p,s,c);return(0,E.jsxs)(fe,{className:v(`overflow-x-auto [-webkit-overflow-scrolling:touch]`,t),...n,children:[(0,E.jsxs)(pe,{children:[(0,E.jsx)(Z,{className:`flex items-center px-2 sm:px-4 py-2 sm:py-3`,children:(0,E.jsx)(`span`,{className:`font-semibold text-xs sm:text-sm`,children:e.rowLabel||c(`timeline.gantt.rowLabel`)})}),(0,E.jsx)(Q,{children:(0,E.jsx)(`div`,{className:`flex h-full`,children:m.map((e,t)=>(0,E.jsx)(`div`,{className:`flex-1 px-1 sm:px-2 py-2 sm:py-3 border-r text-xs font-medium text-center`,children:e},t))})})]}),(0,E.jsx)(`div`,{children:(0,E.jsxs)(`div`,{className:`flex`,children:[(0,E.jsx)(Z,{children:l.map((e,t)=>(0,E.jsx)($,{children:(0,E.jsx)(me,{title:e.label,className:`truncate`,children:e.label})},t))}),(0,E.jsx)(Q,{className:`relative`,children:l.map((e,t)=>(0,E.jsx)($,{className:`relative`,children:e.items.map((n,r)=>{let i=L(n.startDate,n.endDate,f,p);return(0,E.jsx)(he,{start:i.start,width:i.width,variant:n.variant||`default`,onClick:()=>o?.(n,e.authored,t,r),title:`${n.title||``}\n${R(n.startDate,a,s)} - ${R(n.endDate,a,s)}`,children:(0,E.jsx)(ge,{children:n.title})},r)})},t))})]})})]})}return null};u.register(`timeline`,oe,{namespace:`plugin-timeline`,skipFallback:!0,label:`Timeline`,category:`data-display`,inputs:[{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],label:`Timeline Variant`,defaultValue:`vertical`},{name:`items`,type:`array`,label:`Timeline Items`,description:`For vertical/horizontal: Array of { time, title, description, variant, icon, content }. For gantt: Array of { label, items: [{ title, startDate, endDate, variant }] }`},{name:`dateFormat`,type:`enum`,enum:[`short`,`long`,`iso`],label:`Date Format`,defaultValue:`short`},{name:`scale`,type:`enum`,enum:[...D],label:`Time Scale (Gantt only)`,defaultValue:`month`},{name:`rowLabel`,type:`string`,label:`Row Label (Gantt only)`,defaultValue:`Items`},{name:`minDate`,type:`string`,label:`Min Date (Gantt only)`,description:`Override auto-calculated min date (YYYY-MM-DD)`},{name:`maxDate`,type:`string`,label:`Max Date (Gantt only)`,description:`Override auto-calculated max date (YYYY-MM-DD)`},{name:`className`,type:`string`,label:`CSS Class`}],defaultProps:{variant:`vertical`,dateFormat:`short`,items:[{time:`2024-01-15`,title:`Project Started`,description:`Kickoff meeting and initial planning`,variant:`success`,icon:`🚀`},{time:`2024-02-01`,title:`First Milestone`,description:`Completed initial design phase`,variant:`info`,icon:`🎨`},{time:`2024-03-15`,title:`Beta Release`,description:`Released beta version to testers`,variant:`warning`,icon:`⚡`},{time:`2024-04-01`,title:`Launch`,description:`Official product launch`,variant:`success`,icon:`🎉`}]},examples:{vertical:{variant:`vertical`,dateFormat:`long`,items:[{time:`2024-01-15`,title:`Project Started`,description:`Kickoff meeting and initial planning`,variant:`success`},{time:`2024-02-01`,title:`First Milestone`,description:`Completed initial design phase`,variant:`info`}]},horizontal:{variant:`horizontal`,dateFormat:`short`,items:[{time:`2024-01-01`,title:`Q1`,description:`First quarter`,variant:`default`},{time:`2024-04-01`,title:`Q2`,description:`Second quarter`,variant:`info`},{time:`2024-07-01`,title:`Q3`,description:`Third quarter`,variant:`warning`},{time:`2024-10-01`,title:`Q4`,description:`Fourth quarter`,variant:`success`}]},gantt:{variant:`gantt`,dateFormat:`short`,scale:`month`,rowLabel:`Projects`,items:[{label:`Backend Development`,items:[{title:`API Design`,startDate:`2024-01-01`,endDate:`2024-01-31`,variant:`success`},{title:`Implementation`,startDate:`2024-02-01`,endDate:`2024-03-31`,variant:`info`}]},{label:`Frontend Development`,items:[{title:`UI Design`,startDate:`2024-01-15`,endDate:`2024-02-15`,variant:`warning`},{title:`Component Dev`,startDate:`2024-02-15`,endDate:`2024-04-15`,variant:`default`}]},{label:`Testing`,items:[{title:`QA Phase`,startDate:`2024-03-01`,endDate:`2024-04-30`,variant:`danger`}]}]}}});var se=[`vertical`,`horizontal`],ce=[`timeline.startDateField`,`timeline.dateField`,`mapping.date`,`startDateField`,`dateField`],le=b({title:S().optional(),date:S().optional(),description:S().optional(),variant:S().optional()}),ue=b({mapping:le.optional(),objectName:S().optional(),titleField:S().optional(),dateField:S().optional(),startDateField:S().optional(),endDateField:S().optional(),descriptionField:S().optional(),groupByField:S().optional(),colorField:S().optional(),scale:x([`hour`,`day`,`week`,`month`,`quarter`,`year`]).optional()}),z=({schema:e,dataSource:t,className:n,onRowClick:r,onItemClick:i,...o})=>{let[u,f]=(0,T.useState)([]),[h,g]=(0,T.useState)(()=>{let t=Array.isArray(e.items)&&e.items.length>0,n=Array.isArray(o.data)&&o.data.length>0;return!t&&!n&&!!e.objectName}),[_,v]=(0,T.useState)(null),[y,b]=(0,T.useState)(0),[x,S]=(0,T.useState)(null),C=e.timeline;(0,T.useEffect)(()=>{let t=ue.safeParse(e);t.success||console.warn(`[ObjectTimeline] Invalid timeline configuration:`,t.error.format())},[e]);let w=l(e.bind);(0,T.useEffect)(()=>{let n=!0;return(async()=>{if(!(!t||typeof t.getObjectSchema!=`function`||!e.objectName))try{let r=await t.getObjectSchema(e.objectName);n&&S(r)}catch(e){console.warn(`Failed to fetch object def for ObjectTimeline`,e)}})(),()=>{n=!1}},[e.objectName,t]);let ne=JSON.stringify(e.filter??null),D=JSON.stringify(e.sort??null);(0,T.useEffect)(()=>{e.objectName&&!w&&!e.items&&!o.data?(async()=>{if(!t||typeof t.find!=`function`||!e.objectName){g(!1);return}g(!0);try{let n=s(x?.fields),r=await t.find(e.objectName,{$filter:e.filter,$orderby:d(e.sort),$top:e.limit??100,...n.length>0?{$expand:n}:{}}),i=a(r);f(i)}catch(e){console.error(e),v(e)}finally{g(!1)}})():g(!1)},[e.objectName,t,w,e.items,o.data,y,x,ne,D,e.limit]);let O=o.data||w||u,{t:k}=re(),{fieldOptionLabel:A}=m(),j=C?.titleField??e.mapping?.title??e.titleField??`name`,M=C?.startDateField??C?.dateField??e.mapping?.date??e.startDateField??e.dateField,N=C?.endDateField??e.endDateField??M,P=e.mapping?.description??e.descriptionField??`description`,F=e.mapping?.variant??`variant`,I=C?.groupByField??e.groupByField,L=C?.colorField??e.colorField,R=(0,T.useMemo)(()=>{if(e.items)return e.items;if(!O||!Array.isArray(O)||!M)return[];let t=M,n=N??M,r=x?.fields??{},i=e.objectName||``,a=e=>{if(!e||!r[e]?.options)return{};let t={};for(let n of r[e].options)n&&n.value!=null&&(t[String(n.value)]=n);return t},o=Array.isArray(C?.metaFields)?C.metaFields.filter(e=>typeof e==`string`&&e):[`status`,`priority`].filter(e=>r[e]),s={};for(let e of o)s[e]=a(e);let l=c(r[L??``]),u=(e,t,n)=>{if(t==null||t===``)return null;let r=n[String(t)];return{label:r?.label?A(i,e,String(t),r.label):String(t),color:r?.color}},d=O.map(e=>{let r=e[t],a=e[n],c=L?e[L]:void 0,d=I?e[I]:void 0,f=[];if(i)for(let t of o){let n=u(t,e[t],s[t]||{});n&&f.push({key:t,label:n.label,color:n.color})}return{title:e[j],time:r,startDate:r,endDate:a,description:e[P],variant:e[F]||`default`,color:l(c),group:d,meta:f,_data:e}});d.sort((e,t)=>(e.startDate?new Date(e.startDate).getTime():1/0)-(t.startDate?new Date(t.startDate).getTime():1/0));let f=new Date,p=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),m=p(f),h=864e5,g=m-(f.getDay()+6)%7*h+7*h,_=g+7*h,ee=e=>{if(!e)return k(`timeline.bucket.noDate`);let t=p(new Date(e));return Number.isNaN(t)?k(`timeline.bucket.noDate`):t<m?k(`timeline.bucket.overdue`):t===m?k(`timeline.bucket.today`):t===m+h?k(`timeline.bucket.tomorrow`):k(t<g?`timeline.bucket.thisWeek`:t<_?`timeline.bucket.nextWeek`:`timeline.bucket.later`)};if(I&&!d.every(e=>e.group==null||e.group===``)){let e=a(I);return d.map(t=>{let n=u(I,t.group,e);return{...t,group:n?n.label:t.group!=null&&t.group!==``?String(t.group):k(`timeline.bucket.unassigned`)}})}return d.map(e=>({...e,group:ee(e.startDate)}))},[e.items,O,x,e.objectName,j,M,N,P,F,L,I,k,A]),ie=(0,T.useCallback)(async()=>{b(e=>e+1)},[]),{ref:ae,isRefreshing:le,pullDistance:z}=te({onRefresh:ie,enabled:!!e.objectName&&!!t}),B=p({navigation:e.navigation,objectName:e.objectName,onRowClick:r??i}),V=C?.scale??e.scale,H=!!e.items;if(!H&&e.variant===`gantt`)return(0,E.jsx)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-unsupported-variant`,role:`alert`,children:k(`timeline.unsupported.objectBoundGantt`,{variants:se.join(`, `)})});if(!H&&!M)return(0,E.jsx)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-missing-date-axis`,role:`alert`,children:k(`timeline.unconfigured.noDateAxis`,{fields:ce.join(`, `)})});let U={...e,items:R||[],className:n||e.className,...V?{scale:V}:{},onItemClick:e=>{let t=e._data||e;B.handleClick(t),i?.(t)}};return _?(0,E.jsxs)(`div`,{className:`p-4 text-destructive`,"data-testid":`timeline-error`,role:`alert`,children:[`Error loading timeline: `,_.message]}):h&&(!R||R.length===0)?(0,E.jsxs)(`div`,{className:`flex flex-col h-full min-h-[200px] p-4 gap-3`,"data-testid":`timeline-loading`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,E.jsx)(`span`,{className:`sr-only`,children:`Loading timeline…`}),[0,1,2,3].map(e=>(0,E.jsxs)(`div`,{className:`flex items-start gap-3`,style:{opacity:Math.max(.3,1-e*.18)},children:[(0,E.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-muted/70 animate-pulse mt-1.5 shrink-0`}),(0,E.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,E.jsx)(`div`,{className:`h-4 w-1/3 rounded bg-muted/70 animate-pulse`}),(0,E.jsx)(`div`,{className:`h-3 w-2/3 rounded bg-muted/50 animate-pulse`})]})]},e))]}):(0,E.jsxs)(`div`,{ref:ae,className:`relative overflow-auto h-full min-w-0`,"data-testid":`timeline-canvas`,children:[z>0&&(0,E.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:z},children:le?`Refreshing…`:`Pull to refresh`}),(0,E.jsx)(oe,{schema:U}),B.isOverlay&&(0,E.jsx)(ee,{...B,title:`Timeline Item`,children:e=>(0,E.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,E.jsxs)(`div`,{className:`flex flex-col`,children:[(0,E.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,E.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})},B=t({ObjectTimeline:()=>z,ObjectTimelineRenderer:()=>ve,TIMELINE_SCALES:()=>D,Timeline:()=>V,TimelineContent:()=>G,TimelineDescription:()=>J,TimelineGantt:()=>fe,TimelineGanttBar:()=>he,TimelineGanttBarContent:()=>ge,TimelineGanttGrid:()=>Q,TimelineGanttHeader:()=>pe,TimelineGanttLabel:()=>me,TimelineGanttRow:()=>$,TimelineGanttRowLabels:()=>Z,TimelineHorizontal:()=>Y,TimelineHorizontalItem:()=>X,TimelineItem:()=>U,TimelineMarker:()=>W,TimelineRenderer:()=>oe,TimelineTime:()=>q,TimelineTitle:()=>K,generateTimeScaleHeaders:()=>k,resolveTimelineScale:()=>O,timelineItemVariants:()=>H,timelineMarkerVariants:()=>de}),V=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`ol`,{ref:n,className:v(`relative ml-3 border-l border-gray-200`,e),...t}));V.displayName=`Timeline`;var H=y(`ml-6`,{variants:{density:{default:`mb-10`,compact:`mb-3`,comfortable:`mb-6`}},defaultVariants:{density:`default`}}),U=T.forwardRef(({className:e,density:t,...n},r)=>(0,E.jsx)(`li`,{ref:r,className:v(H({density:t}),e),...n}));U.displayName=`TimelineItem`;var de=y(`absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center`,{variants:{variant:{default:`bg-blue-200 border-blue-400`,success:`bg-emerald-200 border-emerald-500`,warning:`bg-amber-200 border-amber-500`,danger:`bg-red-200 border-red-500`,info:`bg-purple-200 border-purple-500`,todo:`bg-slate-200 border-slate-400`,"in-progress":`bg-blue-200 border-blue-500`,done:`bg-emerald-200 border-emerald-500`}},defaultVariants:{variant:`default`}}),W=T.forwardRef(({className:e,variant:t=`default`,...n},r)=>(0,E.jsx)(`div`,{ref:r,className:v(de({variant:t}),e),...n}));W.displayName=`TimelineMarker`;var G=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:e,...t}));G.displayName=`TimelineContent`;var K=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`h3`,{ref:n,className:v(`font-semibold text-lg mb-1`,e),...t}));K.displayName=`TimelineTitle`;var q=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`time`,{ref:n,className:v(`text-sm font-normal text-gray-500 mb-2 block`,e),...t}));q.displayName=`TimelineTime`;var J=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`p`,{ref:n,className:v(`text-base text-gray-700`,e),...t}));J.displayName=`TimelineDescription`;var Y=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`relative flex overflow-x-auto py-8`,e),...t}));Y.displayName=`TimelineHorizontal`;var X=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`shrink-0 w-64 relative`,e),...t}));X.displayName=`TimelineHorizontalItem`;var fe=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`relative w-full border rounded-lg overflow-hidden`,e),...t}));fe.displayName=`TimelineGantt`;var pe=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`flex border-b bg-gray-50`,e),...t}));pe.displayName=`TimelineGanttHeader`;var Z=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`w-48 border-r bg-white`,e),...t}));Z.displayName=`TimelineGanttRowLabels`;var Q=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`flex-1 overflow-x-auto`,e),...t}));Q.displayName=`TimelineGanttGrid`;var $=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`flex items-center border-b min-h-12`,e),...t}));$.displayName=`TimelineGanttRow`;var me=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`px-4 py-2 font-medium text-sm truncate`,e),...t}));me.displayName=`TimelineGanttLabel`;var he=T.forwardRef(({className:e,start:t=0,width:n=100,variant:r=`default`,...i},a)=>(0,E.jsx)(`div`,{ref:a,className:v(`absolute h-8 rounded-md transition-colors cursor-pointer`,{default:`bg-blue-500 hover:bg-blue-600`,success:`bg-green-500 hover:bg-green-600`,warning:`bg-yellow-500 hover:bg-yellow-600`,danger:`bg-red-500 hover:bg-red-600`,info:`bg-purple-500 hover:bg-purple-600`}[r],e),style:{left:`${t}%`,width:`${n}%`},...i}));he.displayName=`TimelineGanttBar`;var ge=T.forwardRef(({className:e,...t},n)=>(0,E.jsx)(`div`,{ref:n,className:v(`px-2 py-1 text-white text-xs font-medium truncate`,e),...t}));ge.displayName=`TimelineGanttBarContent`;var _e={filter:!0,sort:!0,limit:`limit`},ve=i(({schema:e,...t})=>{let{dataSource:n}=o()||{};return(0,E.jsx)(f,{schema:e,mapping:_e,dataSource:n,testId:`object-timeline`,errorTitle:`This timeline’s data source could not be resolved`,children:e=>(0,E.jsx)(z,{schema:e,dataSource:n,...t})})});u.register(`object-timeline`,ve,{namespace:`plugin-timeline`,label:`Object Timeline`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],defaultValue:`vertical`}]}),u.register(`timeline`,ve,{namespace:`view`,label:`Timeline View`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`variant`,type:`enum`,enum:[`vertical`,`horizontal`,`gantt`],defaultValue:`vertical`}]});export{B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{b as n,r}from"./vendor-react-CsWFRkED.js";import{Ft as i,Ir as a,It as o,Lr as s,Qr as c,a as l,i as u,ir as d,o as f,r as p,ut as m,x as h,zr as g}from"./framework-BfSv4Kb0.js";import{d as _,p as v}from"./i18n-locales-Bz4c8KXc.js";import{dt as y,hc as b,il as x,pc as S}from"./ui-components-D2lrjG-t.js";var C=e(n(),1),w=r(),T=v({"detail.recordDetail":`Record Detail`},`detail.recordDetail`);function E(e){return e.data?e.data:e.staticData?{provider:`value`,items:e.staticData}:e.objectName?{provider:`object`,object:e.objectName}:null}function D(e){return g(e)||(e&&typeof e==`object`?e.key:void 0)||void 0}function O(e){let t=e.tree||e.filter?.tree||{},n=Array.isArray(e.fields)?e.fields:Array.isArray(t.fields)?t.fields:[];return{parentField:D(e.parentField??t.parentField),labelField:D(e.labelField??t.labelField??e.titleField)??`name`,fields:n.map(D).filter(e=>!!e),defaultExpandedDepth:e.defaultExpandedDepth??t.defaultExpandedDepth}}function k(e,t){let n=e?.fields;if(!n||typeof n!=`object`)return;let r;for(let[e,i]of Object.entries(n)){if(i?.type===`tree`)return e;let n=i?.reference;!r&&(i?.type===`lookup`||i?.type===`master_detail`)&&n&&t&&n===t&&(r=e)}return r}function A(e){let t=e?.id??e?._id;return t==null?void 0:String(t)}function j(e,t){if(!t)return;let n=e?.[t];if(n!=null){if(typeof n==`object`){let e=n.id??n._id;return e==null?void 0:String(e)}return String(n)}}function M(e,t){let n=new Map,r=[];for(let t of e){let e=A(t);e!=null&&(n.set(e,{id:e,record:t,depth:0,children:[]}),r.push(e))}let i=[];for(let e of r){let r=n.get(e),a=j(r.record,t),o=a==null?void 0:n.get(a);o&&o!==r?o.children.push(r):i.push(r)}let a=(e,t)=>{for(let n of e)n.depth=t,a(n.children,t+1)};return a(i,0),i}function N(e,t){let n=[],r=e=>{for(let i of e)n.push(i),i.children.length>0&&t.has(i.id)&&r(i.children)};return r(e),n}function P(e,t){let n=new Set,r=e=>{for(let i of e)i.children.length!==0&&(t==null||i.depth<t)&&(n.add(i.id),r(i.children))};return r(e),n}function F(e,t){if(e==null)return``;let n=Array.isArray(t?.fieldDef?.options)?t.fieldDef.options:null;if(n&&n.length>0){let r=t.objectName?t.translateOptions(t.objectName,t.fieldName,n):n,i=e=>{let t=r.find(t=>t?.value===e);if(t)return String(t.label??e);let n=String(e).toLowerCase(),i=r.find(e=>String(e?.value).toLowerCase()===n);return i?String(i.label??e):o(String(e))};return Array.isArray(e)?e.filter(e=>e!=null).map(i).join(`, `):i(e)}return typeof e==`object`&&s(t?.fieldDef)?d(void 0,e):String(typeof e==`object`?e.name??e.label??e.id??e._id??``:e)}var I=({schema:e,dataSource:t,className:n,onRowClick:r,...i})=>{let[o,s]=(0,C.useState)([]),[c,d]=(0,C.useState)({truncated:!1}),[g,v]=(0,C.useState)(!0),[D,A]=(0,C.useState)(null),j=(0,C.useMemo)(()=>E(e),[e]),I=(j?.provider===`object`?j.object:e.objectName)??``,{ready:L,def:R}=h(I,t),z=j?.provider,B=j?.provider===`object`?j.object:void 0,V=j?.provider===`value`?j.items:void 0;(0,C.useEffect)(()=>{let n=!1;return(async()=>{try{if(v(!0),A(null),z===`object`&&t&&typeof t.find==`function`){if(!L)return;let r=a(R?.fields),i=await t.find(B,{$filter:e.filter,$top:u,...r.length>0?{$expand:r}:{}}),o=f(i);n||(s(o.rows),d({truncated:o.truncated,total:o.total}),v(!1));return}let r=i.data??e.data;if(Array.isArray(r)){n||(s(r),d({truncated:!1}),v(!1));return}if(z===`value`){n||(s(V??[]),d({truncated:!1}),v(!1));return}n||(s([]),v(!1))}catch(e){n||(A(e),v(!1))}})(),()=>{n=!0}},[z,B,V,t,e.filter,R,L,i.data]);let H=(0,C.useMemo)(()=>O(e),[e]),U=(0,C.useMemo)(()=>H.parentField??k(R,e.objectName),[H.parentField,R,e.objectName]),W=(0,C.useMemo)(()=>M(o,U),[o,U]),[G,K]=(0,C.useState)(new Set);(0,C.useEffect)(()=>{K(P(W,H.defaultExpandedDepth))},[W,H.defaultExpandedDepth]);let q=e=>K(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),J=(0,C.useMemo)(()=>N(W,G),[W,G]),Y=_(),X=(j?.provider===`object`?j.object:void 0)??e.objectName,Z=e=>{let t=R?.fields?.[e]?.label||e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase());return X?Y.fieldLabel(X,e,t):t},Q=e=>({fieldDef:R?.fields?.[e],fieldName:e,objectName:X,translateOptions:Y.translateOptions}),$=m({navigation:e.navigation,objectName:e.objectName,onRowClick:r}),{t:ee}=T();return D?(0,w.jsx)(`div`,{className:x(`flex items-center justify-center h-40 text-destructive`,n),children:(0,w.jsxs)(`p`,{children:[`Failed to load tree: `,D.message]})}):g?(0,w.jsx)(`div`,{className:x(`flex items-center justify-center h-40 text-muted-foreground`,n),children:(0,w.jsx)(`p`,{children:`Loading…`})}):o.length===0?(0,w.jsx)(`div`,{className:x(`flex items-center justify-center h-40 text-muted-foreground`,n),children:(0,w.jsx)(`p`,{children:`No records`})}):(0,w.jsxs)(`div`,{className:x(`w-full overflow-auto`,n),"data-testid":`object-tree`,children:[(0,w.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,w.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:Z(H.labelField)}),H.fields.filter(e=>e!==H.labelField).map(e=>(0,w.jsx)(`th`,{className:`px-3 py-2 font-medium`,children:Z(e)},e))]})}),(0,w.jsx)(`tbody`,{children:J.map(e=>{let t=e.children.length>0,n=G.has(e.id);return(0,w.jsxs)(`tr`,{className:`border-b hover:bg-accent/50 cursor-pointer`,"data-testid":`object-tree-row`,"data-depth":e.depth,onClick:t=>$.handleClick(e.record,t),children:[(0,w.jsx)(`td`,{className:`px-3 py-2`,children:(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,style:{paddingLeft:`${e.depth*20}px`},children:[t?(0,w.jsx)(`button`,{type:`button`,"aria-label":n?`Collapse`:`Expand`,className:`flex h-5 w-5 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted`,onClick:t=>{t.stopPropagation(),q(e.id)},children:n?(0,w.jsx)(b,{className:`h-4 w-4`}):(0,w.jsx)(S,{className:`h-4 w-4`})}):(0,w.jsx)(`span`,{className:`inline-block h-5 w-5`}),(0,w.jsx)(`span`,{className:`truncate`,children:F(e.record[H.labelField],Q(H.labelField))||`—`})]})}),H.fields.filter(e=>e!==H.labelField).map(t=>(0,w.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:F(e.record[t],Q(t))},t))]},e.id)})})]}),(0,w.jsx)(l,{drawn:p,total:c.total,truncated:c.truncated}),$.isOverlay&&(0,w.jsx)(y,{...$,title:ee(`detail.recordDetail`),children:e=>(0,w.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,w.jsxs)(`div`,{className:`flex flex-col`,children:[(0,w.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,w.jsx)(`span`,{className:`text-sm`,children:F(t,Q(e))||`—`})]},e))})})]})},L=t({ObjectTree:()=>I,ObjectTreeRenderer:()=>R}),R=({schema:e,...t})=>{let{dataSource:n}=i()||{};return(0,w.jsx)(I,{schema:e,dataSource:n,...t})},z=[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`tree`,type:`object`,label:`Tree Config`,description:`parentField, labelField, fields, defaultExpandedDepth`}];c.register(`object-tree`,R,{namespace:`plugin-tree`,label:`Object Tree`,category:`view`,inputs:z}),c.register(`tree`,R,{namespace:`view`,label:`Tree View`,category:`view`,inputs:z});export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{b as t,r as n}from"./vendor-react-CsWFRkED.js";import{Et as r,Ot as i,St as a,bn as o,xn as s}from"./vendor-objectstack-BeKUVjuj.js";import{h as c}from"./data-adapter-DL25qpAe.js";import{Ir as l,Mt as u,Nr as d,Pr as f,Qr as p,er as m,ht as h,mt as g,x as _,zr as v,zt as y}from"./framework-BfSv4Kb0.js";import{p as b,y as x}from"./i18n-locales-Bz4c8KXc.js";import{$n as S,$o as C,Aa as w,Bn as T,Cr as ee,Da as te,Dc as E,Dn as D,Do as O,Dr as k,En as A,Fn as j,Fs as M,Hn as ne,Ht as N,In as P,Jn as re,Jo as ie,Kn as F,Ko as ae,Lt as I,Mi as oe,Nn as L,On as R,Pa as se,Pn as ce,Pr as z,Qn as le,Ri as B,Ro as V,Si as H,Sr as ue,Tc as de,Tn as U,Ts as W,Vn as fe,Vt as pe,Wn as G,Xn as me,Xr as K,Yc as he,Yn as ge,Zn as _e,_n as ve,_o as ye,aa as be,ar as q,bo as xe,br as Se,cr as Ce,dt as we,er as Te,fn as Ee,fo as De,gc as Oe,hc as ke,hn as J,il as Y,ir as X,ja as Ae,lr as je,mn as Me,na as Ne,ni as Pe,nr as Fe,or as Ie,pn as Z,qc as Le,qi as Re,qn as ze,qo as Be,ra as Ve,rl as He,rr as Ue,sa as We,sr as Ge,ta as Ke,tr as qe,us as Je,vr as Ye,wc as Xe,wn as Ze,xo as Qe,xr as $e,xt as et,yo as tt,yr as nt,zt as rt}from"./ui-components-D2lrjG-t.js";import{i as it}from"./vendor-ui-utils-BFw4cGI6.js";import{t as at}from"./plugin-form-_fjHxKTV.js";import{_ as ot,a as st,c as ct,d as lt,n as ut,o as dt,p as ft,r as pt,s as mt,t as ht,u as gt,v as _t,y as vt}from"./vendor-dndkit-CkJ59XFL.js";import{i as yt}from"./plugin-grid-kkbz4uec.js";var Q=e(t(),1),$=n(),bt={list:`List`,detail:`Detail`,grid:`Grid`,kanban:`Kanban`,calendar:`Calendar`,timeline:`Timeline`,map:`Map`,gallery:`Gallery`,gantt:`Gantt`,chart:`Chart`,tree:`Tree`},xt={list:tt,detail:Je,grid:Be,kanban:O,calendar:E,timeline:He,map:De,gallery:V,gantt:Xe,chart:de,tree:xe},St=it(`flex gap-4`,{variants:{position:{top:`flex-col`,bottom:`flex-col-reverse`,left:`flex-row`,right:`flex-row-reverse`}},defaultVariants:{position:`top`}}),Ct=it(`w-full`,{variants:{orientation:{horizontal:`w-full`,vertical:`w-48`}},defaultVariants:{orientation:`horizontal`}}),wt=it(`flex gap-2`,{variants:{orientation:{horizontal:`flex-row flex-wrap`,vertical:`flex-col`}},defaultVariants:{orientation:`horizontal`}}),Tt=it(``,{variants:{orientation:{horizontal:``,vertical:`flex h-auto flex-col items-stretch`}},defaultVariants:{orientation:`horizontal`}});function Et(e){return e.label?e.label:bt[e.type]||e.type}function Dt(e){return e.icon?I(e.icon):xt[e.type]||null}function Ot(e){return e.activeView?e.activeView:e.defaultView?e.defaultView:e.views?.[0]?.type}var kt={share:Ke,settings:Ne,duplicate:M,delete:H},At={share:`Share`,settings:`Settings`,duplicate:`Duplicate`,delete:`Delete`},jt=({schema:e,className:t,onViewChange:n,onCreateView:r,onViewAction:i,createViewLabel:a=`Create view`,...o})=>{let s=Q.useMemo(()=>e.storageKey?e.storageKey:`view-switcher${e.id?`-${e.id}`:``}`,[e.id,e.storageKey]),[c,l]=Q.useState(()=>Ot(e));Q.useEffect(()=>{if(e.activeView){l(e.activeView);return}if(e.persistPreference)try{let t=localStorage.getItem(s);if(t){let n=e.views.find(e=>e.type===t)?.type;n&&l(n)}}catch{}},[e.activeView,e.persistPreference,e.views,s]),Q.useEffect(()=>{if(!(!e.persistPreference||!c||e.activeView))try{localStorage.setItem(s,c)}catch{}},[c,e.activeView,e.persistPreference,s]);let u=Q.useCallback(t=>{n?.(t),e.onViewChange&&typeof window<`u`&&window.dispatchEvent(new CustomEvent(e.onViewChange,{detail:{view:t}}))},[n,e.onViewChange]),d=Q.useCallback(e=>{l(e),u(e)},[u]),f=c||e.views?.[0]?.type,p=f||``,m=e.views.find(e=>e.type===f)||e.views?.[0],_=e.variant||`tabs`,v=e.position||`top`,y=v===`left`||v===`right`,b=y?`vertical`:`horizontal`,x=e.viewActions&&e.viewActions.length>0?(0,$.jsx)(`div`,{className:`flex items-center gap-1`,children:e.viewActions.map((e,t)=>{let n=e.icon&&I(e.icon)||kt[e.type];return(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>i?.(e.type,f),title:At[e.type]||e.type,children:n?(0,$.jsx)(n,{className:`h-3.5 w-3.5`}):null},`action-${e.type}-${t}`)})}):null,S=e.allowCreateView?(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>r?.(),title:a,children:(0,$.jsx)(te,{className:`h-3.5 w-3.5`})}):null,C=(0,$.jsxs)(`div`,{className:Y(Ct({orientation:b}),`flex items-center gap-1`),children:[_===`dropdown`&&(0,$.jsxs)(Ze,{value:p,onValueChange:e=>d(e),children:[(0,$.jsx)(D,{className:Y(`w-full`,y?`h-10`:`h-9`),children:(0,$.jsx)(R,{placeholder:`Select view`})}),(0,$.jsx)(U,{children:e.views.map((e,t)=>(0,$.jsx)(A,{value:e.type,children:Et(e)},`${e.type}-${t}`))})]}),_===`buttons`&&(0,$.jsx)(`div`,{className:Y(wt({orientation:b})),children:e.views.map((e,t)=>{let n=e.type===f,r=Dt(e);return(0,$.jsxs)(K,{type:`button`,size:`sm`,variant:n?`secondary`:`ghost`,className:Y(`justify-start gap-2`,y?`w-full`:``),onClick:()=>d(e.type),children:[r?(0,$.jsx)(r,{className:`h-4 w-4`}):null,(0,$.jsx)(`span`,{children:Et(e)})]},`${e.type}-${t}`)})}),_===`tabs`&&(0,$.jsx)(rt,{value:p,onValueChange:e=>d(e),children:(0,$.jsx)(pe,{className:Y(Tt({orientation:b})),children:e.views.map((e,t)=>{let n=Dt(e);return(0,$.jsxs)(N,{value:e.type,className:Y(`gap-2`,y?`justify-start`:``),children:[n?(0,$.jsx)(n,{className:`h-4 w-4`}):null,(0,$.jsx)(`span`,{children:Et(e)})]},`${e.type}-${t}`)})})}),x,S]}),w=m?.schema?Array.isArray(m.schema)?(0,$.jsx)(`div`,{className:`space-y-4`,children:m.schema.map((e,t)=>(0,$.jsx)(h,{schema:e,...o},`${m.type}-${t}`))}):(0,$.jsx)(h,{schema:g(m.schema),...o}):null;return(0,$.jsxs)(`div`,{className:Y(St({position:v}),t),children:[(0,$.jsx)(`div`,{className:Y(`shrink-0`,y?`flex flex-col`:`flex`),children:C}),(0,$.jsx)(`div`,{className:`flex-1 min-w-0`,children:w})]})};i();var Mt={sm:480,md:720,lg:960,xl:1200,full:1600};function Nt(e){let t=a(e);return t<=3?`sm`:t<=8?`md`:t<=15?`lg`:`xl`}function Pt(e,t){return`min(92vw, ${Mt[!e||e===`auto`?Nt(t):e]}px)`}var Ft=12;function It(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Lt(e,t,n=0){if(Object.is(e,t))return!0;if(n>=Ft)return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Lt(e[r],t[r],n+1))return!1;return!0}if(It(e)&&It(t)){let r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let i of r)if(!Object.prototype.hasOwnProperty.call(t,i)||!Lt(e[i],t[i],n+1))return!1;return!0}return!1}function Rt(e){let t=(0,Q.useRef)(e),n=Lt(t.current,e)?t.current:e;return t.current=n,n}var zt=h,Bt=[`latitudeField`,`longitudeField`,`locationField`,`titleField`,`descriptionField`,`zoom`,`center`];function Vt(e){if(!e||typeof e!=`object`)return{};let t=e;return Object.fromEntries(Bt.filter(e=>e in t).map(e=>[e,t[e]]))}function Ht(e){if(!Array.isArray(e)||e.length===0)return;let t=e.map(v).filter(e=>!!e);return t.length>0?t:void 0}function Ut(){let{t:e}=x(),t=e(`console.objectView.new`);return t===`console.objectView.new`?`New`:t}var Wt=b({"detail.recordDetailWithLabel":`{{label}} Detail`,"form.createTitle":`Create {{object}}`,"form.editTitle":`Edit {{object}}`,"form.viewTitle":`View {{object}}`},`detail.recordDetailWithLabel`),Gt=({schema:e,dataSource:t,className:n,views:i,activeViewId:a,onViewChange:o,onRowClick:s,onEdit:u,renderListView:d,hideNamedViewTabs:f,toolbarAddon:p,onCreateView:h,onViewAction:g})=>{let v=Ut(),{t:b}=Wt(),x=e.objectName??``,{ready:C,def:w}=_(x,t),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(`create`),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(0);(0,Q.useEffect)(()=>{if(!(!t?.onMutation||!e.objectName)&&!d)return t.onMutation(t=>{t.resource===e.objectName&&M(e=>e+1)})},[t,e.objectName,d]);let[ne,P]=(0,Q.useState)([]),[re,ie]=(0,Q.useState)(!1),F=e.listViews,ae=F!=null&&Object.keys(F).length>0,[I,oe]=(0,Q.useState)(()=>e.defaultListView&&F?.[e.defaultListView]?e.defaultListView:F&&Object.keys(F)[0]||``),L=(0,Q.useMemo)(()=>!ae||!I?null:F[I]||null,[ae,I,F]),R=(0,Q.useMemo)(()=>i&&i.length>0?i:null,[i]),se=R!=null&&R.length>0,ce=a||R?.[0]?.id,z=R?.find(e=>e.id===ce)||R?.[0],B=Rt(z?{id:z.id,filter:z.filter,sort:z.sort}:void 0),V=(0,Q.useMemo)(()=>L?.type?L.type:z?.type?z.type:e.defaultViewType||`grid`,[L,z,e.defaultViewType]),H=e.navigation;(0,Q.useEffect)(()=>{let n=!0;return(async()=>{if(!d&&V!==`grid`&&!(!t||!e.objectName)&&C){ie(!0);try{let r=c(L?.filter||B?.filter||e.table?.filter||e.table?.defaultFilters),i=L?.sort||B?.sort||e.table?.sort||(e.table?.defaultSort?[e.table.defaultSort]:void 0),a=l(w?.fields),o=await t.find(e.objectName,{$filter:r,$orderby:m(i),$top:100,...a.length>0?{$expand:a}:{}}),s=[];Array.isArray(o)?s=o:o&&typeof o==`object`&&Array.isArray(o.data)&&(s=o.data),n&&P(s)}catch(e){console.error(`ObjectView data fetch error:`,e)}finally{n&&ie(!1)}}})(),()=>{n=!1}},[e.objectName,t,V,j,L,B,d,C,w]);let de=ve(),U=e.layout||r(w,{viewport:de?`mobile`:`desktop`}),W=e.operations||e.table?.operations||{create:!0,read:!0,update:!0,delete:!0},fe=(0,Q.useCallback)(()=>{U===`page`&&e.onNavigate?e.onNavigate(`new`,`edit`):(O(`create`),A(null),E(!0))},[U,e]),G=(0,Q.useCallback)(t=>{if(u){u(t);return}if(U===`page`&&e.onNavigate){let n=t.id||t._id;e.onNavigate(n,`edit`)}else O(`edit`),A(t),E(!0)},[U,e,u]),me=(0,Q.useCallback)(t=>{if(U===`page`&&e.onNavigate){let n=t.id||t._id;e.onNavigate(n,`view`)}else O(`view`),A(t),E(!0)},[U,e]),he=(0,Q.useCallback)(t=>{if(s){s(t);return}if(H){if(H.mode===`none`||H.preventNavigation)return;if(H.mode===`new_window`||H.openNewTab){let n=t.id||t._id,r=`/${e.objectName}/${encodeURIComponent(String(n))}`;window.open(r,`_blank`);return}if(H.mode===`drawer`){O(`view`),A(t),E(!0);return}if(H.mode===`modal`){O(`view`),A(t),E(!0);return}if(H.mode===`page`){let n=t.id||t._id;e.onNavigate&&e.onNavigate(n,`view`);return}if(H.mode===`split`||H.mode===`popover`){O(`view`),A(t),E(!0);return}}W.read!==!1&&me(t)},[s,H,W.read,me,e]),ge=(0,Q.useCallback)(e=>{M(e=>e+1)},[]),ye=(0,Q.useCallback)(e=>{M(e=>e+1)},[]),be=(0,Q.useCallback)(()=>{E(!1),A(null),M(e=>e+1)},[]),q=(0,Q.useCallback)(()=>{E(!1),A(null)},[]),xe=(0,Q.useMemo)(()=>!se||!R||R.length<=1?null:{type:`view-switcher`,variant:`tabs`,position:`top`,persistPreference:!0,storageKey:`view-pref-${e.objectName}`,defaultView:z?.type||`grid`,activeView:z?.type||`grid`,views:R.map(e=>({type:e.type,label:e.label,icon:{kanban:`kanban`,calendar:`calendar`,map:`map`,gallery:`layout-grid`,timeline:`activity`,gantt:`chart-gantt`,grid:`table`,list:`list`,detail:`file-text`,chart:`chart-column`,tree:`list-tree`}[e.type]||`table`})),allowCreateView:e.allowCreateView,viewActions:e.viewActions},[se,R,z,e.objectName,e.allowCreateView,e.viewActions]),Ce=(0,Q.useCallback)(e=>{if(!R)return;let t=R.find(t=>t.type===e);t&&o&&o(t.id)},[R,o]),Ee=(0,Q.useCallback)(e=>{oe(e)},[]),De=(0,Q.useCallback)(t=>{let n={objectName:e.objectName,fields:L?.columns||z?.columns||Ht(e.table?.columns)||e.table?.fields,className:`h-full w-full`,showSearch:z?.showSearch??e.showSearch??!1,showSort:z?.showSort??e.showSort??!1,showFilters:z?.showFilters??e.showFilters??!1,color:z?.color},r=L?.options||z||{};switch(t){case`kanban`:{let e=r.kanban||{},t=e.groupByField||e.groupField||`status`,i=(Array.isArray(e.columns)&&e.columns.length>0?e.columns:n.fields)||[],{columns:a,groupByField:o,groupField:s,titleField:c,conditionalFormatting:l,...u}=e,d=e.conditionalFormatting??z?.conditionalFormatting;return{type:`object-kanban`,...n,groupBy:t,groupField:t,titleField:e.titleField||`name`,cardFields:i,...u,...d?{conditionalFormatting:d}:{}}}case`calendar`:return{type:`object-calendar`,...n,...r.calendar?.startDateField?{startDateField:r.calendar.startDateField}:{},...r.calendar?.endDateField?{endDateField:r.calendar.endDateField}:{},...r.calendar?.titleField?{titleField:r.calendar.titleField}:{},...r.calendar||{}};case`gallery`:return{type:`object-gallery`,...n,imageField:r.gallery?.coverField||r.gallery?.imageField,titleField:r.gallery?.titleField||`name`,...r.gallery||{}};case`timeline`:{let e=r.timeline?.startDateField||r.timeline?.dateField;return{type:`object-timeline`,...n,...e?{startDateField:e}:{},titleField:r.timeline?.titleField||`name`,...r.timeline||{}}}case`gantt`:return{type:`object-gantt`,...n,...r.gantt?.startDateField?{startDateField:r.gantt.startDateField}:{},...r.gantt?.endDateField?{endDateField:r.gantt.endDateField}:{},progressField:r.gantt?.progressField||`progress`,dependenciesField:r.gantt?.dependenciesField||`dependencies`,...r.gantt||{}};case`map`:return{type:`object-map`,...n,locationField:r.map?.locationField||`location`,...Vt(r.map)};case`tree`:return{type:`object-tree`,...n,parentField:r.tree?.parentField,labelField:r.tree?.labelField||r.tree?.titleField||`name`,fields:r.tree?.fields||n.fields,defaultExpandedDepth:r.tree?.defaultExpandedDepth,...r.tree||{}};case`chart`:{let t=r.chart||{};if(t.dataset){let e=Array.isArray(t.dimensions)?t.dimensions:[],n=Array.isArray(t.values)?t.values:[];return{type:`object-chart`,dataset:t.dataset,dimensions:e,values:n,chartType:t.chartType||`bar`,xAxisKey:e[0],series:n.map(e=>({dataKey:e,label:e})),className:`h-[400px] w-full`}}let n=Array.isArray(t.yAxisFields)&&t.yAxisFields[0]||t.valueField||`value`,i=t.xAxisField||t.categoryField||`name`;return{type:`object-chart`,objectName:e.objectName,chartType:t.chartType||`bar`,aggregate:{field:n,function:t.aggregation||`count`,groupBy:i},xAxisKey:i,series:[{dataKey:n,label:n}],className:`h-[400px] w-full`}}default:return null}},[e.objectName,e.table?.columns,e.table?.fields,L,z]),Oe=(0,Q.useMemo)(()=>{let t=L?.filter||z?.filter,n=L?.sort||z?.sort;return{type:`object-grid`,objectName:e.objectName,title:e.table?.title,description:e.table?.description,fields:L?.columns||z?.columns||e.table?.fields,columns:L?.columns||z?.columns||e.table?.columns,operations:{...W,create:!1},defaultFilters:t||e.table?.defaultFilters,defaultSort:e.table?.defaultSort,filter:t?void 0:e.table?.filter,sort:n||e.table?.sort,pagination:e.table?.pagination,selection:e.table?.selection,pageSize:e.table?.pageSize,selectable:e.table?.selectable,className:e.table?.className}},[e,W,L,z]),ke=()=>{let t=k?k.id||k._id:void 0;return{type:`object-form`,objectName:e.objectName,mode:D,recordId:t,title:e.form?.title,description:e.form?.description,fields:e.form?.fields,customFields:e.form?.customFields,sections:e.form?.sections,groups:e.form?.groups,layout:e.form?.layout,columns:e.form?.columns,showSubmit:e.form?.showSubmit,submitText:e.form?.submitText,showCancel:e.form?.showCancel,cancelText:e.form?.cancelText,showReset:e.form?.showReset,initialValues:e.form?.initialValues,buttons:e.form?.buttons,defaults:e.form?.defaults,readOnly:e.form?.readOnly||D===`view`,className:e.form?.className,subforms:e.form?.subforms,onSuccess:be,onCancel:q}},J=()=>{if(e.form?.title)return e.form.title;let t=w?.label||e.objectName;switch(D){case`create`:return b(`form.createTitle`,{object:t});case`edit`:return b(`form.editTitle`,{object:t});case`view`:return b(`form.viewTitle`,{object:t});default:return t}},X=(0,Q.useMemo)(()=>{let e=H?.width;return e?typeof e==`number`?`max-w-[${e}px]`:`max-w-[${e}]`:``},[H]),Ae=()=>(0,$.jsx)(_e,{open:T,onOpenChange:E,direction:`right`,children:(0,$.jsxs)(le,{className:Y(`w-full sm:max-w-2xl`,X),children:[(0,$.jsxs)(Te,{children:[(0,$.jsx)(qe,{children:J()}),e.form?.description&&(0,$.jsx)(S,{children:e.form.description})]}),(0,$.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 pb-4`,children:(0,$.jsx)(at,{schema:ke(),dataSource:t})})]})}),je=()=>(0,$.jsx)(Ye,{open:T,onOpenChange:E,children:(0,$.jsxs)(nt,{className:Y(`max-w-2xl max-h-[90vh] overflow-y-auto`,X),children:[(0,$.jsxs)(ue,{children:[(0,$.jsx)(ee,{children:J()}),e.form?.description&&(0,$.jsx)(Se,{children:e.form.description})]}),(0,$.jsx)(at,{schema:ke(),dataSource:t})]})}),Me=L?.filter||z?.filter||e.table?.filter||e.table?.defaultFilters,Ne=L?.sort||z?.sort||e.table?.sort||(e.table?.defaultSort?[e.table.defaultSort]:void 0),Pe=()=>{let n=`${e.objectName}-${I||z?.id||`default`}-${V}-${j}`;if(d)return d({schema:{type:`list-view`,objectName:e.objectName,viewType:V,label:L?.label??z?.label,columns:L?.columns||z?.columns||e.table?.columns||e.table?.fields,filter:Me,sort:Ne,rowHeight:z?.rowHeight,densityMode:z?.densityMode,groupBy:z?.groupBy,groupBy2:z?.groupBy2,grouping:z?.grouping,options:L?.options||z,userActions:{...y(e??{}).userActions,...y(z??{}).userActions},compactToolbar:z?.compactToolbar??e.compactToolbar,allowExport:z?.allowExport??e.allowExport,color:z?.color??e.color,rowColor:z?.rowColor,inlineEdit:z?.inlineEdit??e.inlineEdit,wrapHeaders:z?.wrapHeaders??e.wrapHeaders,clickIntoRecordDetails:z?.clickIntoRecordDetails??e.clickIntoRecordDetails,addRecordViaForm:z?.addRecordViaForm??e.addRecordViaForm,addDeleteRecordsInline:z?.addDeleteRecordsInline??e.addDeleteRecordsInline,collapseAllByDefault:z?.collapseAllByDefault??e.collapseAllByDefault,fieldTextColor:z?.fieldTextColor??e.fieldTextColor,prefixField:z?.prefixField??e.prefixField,showDescription:z?.showDescription??e.showDescription,data:L?.data??z?.data??e.data,navigation:z?.navigation??e.navigation,selection:z?.selection??e.selection,pagination:z?.pagination??e.pagination,searchableFields:z?.searchableFields??e.searchableFields,filterableFields:z?.filterableFields??e.filterableFields,resizable:z?.resizable??e.resizable,hiddenFields:z?.hiddenFields??e.hiddenFields,rowActions:z?.rowActions??e.rowActions,rowActionDefs:z?.rowActionDefs??e.rowActionDefs,bulkActions:z?.bulkActions??e.bulkActions,sharing:z?.sharing??e.sharing,addRecord:z?.addRecord??e.addRecord,conditionalFormatting:z?.conditionalFormatting??e.conditionalFormatting,userFilters:z?.userFilters??e.userFilters,showRecordCount:z?.showRecordCount??e.showRecordCount,allowPrinting:z?.allowPrinting??e.allowPrinting,emptyState:z?.emptyState??e.emptyState,aria:z?.aria??e.aria,refreshTrigger:j},dataSource:t,onEdit:G,onRowClick:he,className:`h-full`,refreshKey:j,onAddRecord:fe});if(V!==`grid`){let e=De(V);if(e&&zt)return(0,$.jsx)(zt,{schema:e,dataSource:t,data:ne,loading:re},n);if(!zt)return(0,$.jsx)(`div`,{className:`flex items-center justify-center h-40 text-muted-foreground`,children:(0,$.jsxs)(`p`,{children:[`SchemaRenderer not available. Install @object-ui/react to render `,V,` views.`]})})}return(0,$.jsx)(yt,{schema:Oe,dataSource:t,onRowClick:he,onEdit:W.update===!1?void 0:G,onDelete:W.delete===!1?void 0:ge,onBulkDelete:W.delete===!1?void 0:ye},n)},Fe=()=>{if(f||!ae)return null;let e=Object.entries(F);return e.length<=1?null:(0,$.jsx)(rt,{value:I,onValueChange:Ee,className:`w-full`,children:(0,$.jsx)(pe,{className:`w-auto`,children:e.map(([e,t])=>(0,$.jsx)(N,{value:e,className:`text-sm`,children:t.label||e},e))})})},Ie=()=>{let t=e.showCreate!==!1&&W.create!==!1,n=e.showViewSwitcher===!0,r=Fe();return!r&&!n&&!t&&!p?null:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[r,(n||t||p)&&(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:n&&xe&&(0,$.jsx)(jt,{schema:xe,onViewChange:Ce,onCreateView:h,onViewAction:g,className:`overflow-x-auto`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,t&&(0,$.jsxs)(K,{size:`sm`,onClick:fe,children:[(0,$.jsx)(te,{className:`h-4 w-4`}),v]})]})]})]})},Z=H?.mode===`modal`?`modal`:H?.mode===`drawer`?`drawer`:H?.mode===`split`?`split`:H?.mode===`popover`?`popover`:U,Le=e=>(0,$.jsx)(`div`,{className:`space-y-3`,children:(0,$.jsx)(at,{schema:ke(),dataSource:t})}),Re=(0,Q.useCallback)(e=>{e||q()},[q]),ze=Ie();if(Z===`split`){let t=w?.label||e.objectName;return(0,$.jsxs)(`div`,{className:Y(`flex flex-col h-full min-w-0 overflow-hidden`,n),children:[(e.title||e.description)&&(0,$.jsxs)(`div`,{className:`mb-4 shrink-0`,children:[e.title&&(0,$.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:e.title}),e.description&&(0,$.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:e.description})]}),ze&&(0,$.jsx)(`div`,{className:`mb-4 shrink-0`,children:ze}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 min-w-0 overflow-hidden`,children:T&&k?(0,$.jsx)(we,{isOpen:T,selectedRecord:k,mode:`split`,close:q,setIsOpen:Re,width:H?.width,isOverlay:!0,title:b(`detail.recordDetailWithLabel`,{label:t}),mainContent:(0,$.jsx)(`div`,{className:`h-full overflow-auto`,children:Pe()}),children:Le}):Pe()})]})}return(0,$.jsxs)(`div`,{className:Y(`flex flex-col h-full min-w-0 overflow-hidden`,n),children:[(e.title||e.description)&&(0,$.jsxs)(`div`,{className:`mb-4 shrink-0`,children:[e.title&&(0,$.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:e.title}),e.description&&(0,$.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:e.description})]}),ze&&(0,$.jsx)(`div`,{className:`mb-4 shrink-0`,children:ze}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 min-w-0 overflow-hidden`,children:Pe()}),Z===`drawer`&&Ae(),Z===`modal`&&je(),Z===`popover`&&T&&k&&(0,$.jsx)(we,{isOpen:T,selectedRecord:k,mode:`popover`,close:q,setIsOpen:Re,width:H?.width,isOverlay:!0,title:J(),children:Le})]})},Kt=it(`flex`,{variants:{layout:{inline:`flex-col space-y-4`,popover:`items-center`,drawer:`items-center`}},defaultVariants:{layout:`inline`}}),qt=e=>e==null||e===``?!0:Array.isArray(e)?e.length===0:typeof e==`object`&&Object.values(e).every(e=>e==null||e===``),Jt=e=>Array.isArray(e)?{start:e[0]||``,end:e[1]||``}:e&&typeof e==`object`?{start:e.start||``,end:e.end||``}:{start:``,end:``},Yt=({schema:e,className:t,onChange:n})=>{let[r,i]=Q.useState(e.values||{}),[a,o]=Q.useState(!1);Q.useEffect(()=>{e.values&&i(e.values)},[e.values]);let s=Q.useCallback(t=>{n?.(t),e.onChange&&typeof window<`u`&&window.dispatchEvent(new CustomEvent(e.onChange,{detail:{values:t}}))},[n,e.onChange]),c=Q.useCallback((t,n)=>{let a={...r,[t]:n};i(a),e.showApply||s(a)},[s,e.showApply,r]),l=Q.useCallback(()=>{let t={};if(i(t),e.showApply){s(t);return}s(t)},[s,e.showApply]),u=Q.useCallback(()=>{s(r),o(!1)},[s,r]),d=Q.useMemo(()=>Object.values(r).filter(e=>!qt(e)).length,[r]),f=e=>{let t=e.label||e.field,n=e.placeholder||`Filter by ${t}`;switch(e.type){case`number`:return(0,$.jsx)(P,{type:`number`,value:r[e.field]??``,placeholder:n,onChange:t=>{let n=t.target.value,r=n===``?``:Number(n);c(e.field,r)}});case`select`:return(0,$.jsxs)(Ze,{value:r[e.field]===void 0?``:String(r[e.field]),onValueChange:t=>{let n=e.options?.find(e=>String(e.value)===t);c(e.field,n?n.value:t)},children:[(0,$.jsx)(D,{children:(0,$.jsx)(R,{placeholder:n})}),(0,$.jsx)(U,{children:e.options?.map(e=>(0,$.jsx)(A,{value:String(e.value),children:e.label},String(e.value)))})]});case`multi-select`:{let t=r[e.field],n=Array.isArray(t)?t:t?[t]:[];return(0,$.jsx)(`div`,{className:`max-h-40 overflow-y-auto space-y-0.5 border rounded-md p-2`,children:e.options?.map(t=>{let r=n.map(String).includes(String(t.value));return(0,$.jsxs)(`label`,{className:Y(`flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer`,r?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,$.jsx)(k,{checked:r,onCheckedChange:r=>{let i=r?[...n,t.value]:n.filter(e=>String(e)!==String(t.value));c(e.field,i)}}),(0,$.jsx)(`span`,{className:`truncate`,children:t.label})]},String(t.value))})})}case`date`:return(0,$.jsx)(P,{type:`date`,value:r[e.field]??``,onChange:t=>c(e.field,t.target.value)});case`date-range`:{let t=Jt(r[e.field]);return(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(P,{type:`date`,value:t.start??``,onChange:n=>{c(e.field,{...t,start:n.target.value})}}),(0,$.jsx)(P,{type:`date`,value:t.end??``,onChange:n=>{c(e.field,{...t,end:n.target.value})}})]})}case`boolean`:return(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(k,{checked:!!r[e.field],onCheckedChange:t=>c(e.field,!!t)}),(0,$.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Enabled`})]});default:return(0,$.jsx)(P,{value:r[e.field]??``,placeholder:n,onChange:t=>c(e.field,t.target.value)})}},p=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:e.filters.map(e=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(T,{className:`text-xs text-muted-foreground`,children:e.label||e.field}),f(e)]},e.field))}),(e.showApply||e.showClear)&&(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t pt-3`,children:[e.showClear&&(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:l,children:`Clear`}),e.showApply&&(0,$.jsx)(K,{type:`button`,size:`sm`,onClick:u,children:`Apply`})]})]}),m=e.layout||`inline`;return m===`popover`?(0,$.jsx)(`div`,{className:Y(Kt({layout:m}),t),children:(0,$.jsxs)(L,{open:a,onOpenChange:o,children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(K,{type:`button`,variant:d>0?`secondary`:`outline`,size:`sm`,className:`gap-2`,children:[(0,$.jsx)(Re,{className:`h-4 w-4`}),`Filters`,d>0&&(0,$.jsx)(`span`,{className:`inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-primary`,children:d})]})}),(0,$.jsx)(ce,{align:`start`,className:`w-[520px] p-4`,children:p})]})}):m===`drawer`?(0,$.jsxs)(`div`,{className:Y(Kt({layout:m}),t),children:[(0,$.jsxs)(K,{type:`button`,variant:d>0?`secondary`:`outline`,size:`sm`,className:`gap-2`,onClick:()=>o(!0),children:[(0,$.jsx)(Re,{className:`h-4 w-4`}),`Filters`,d>0&&(0,$.jsx)(`span`,{className:`inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-primary`,children:d})]}),(0,$.jsx)(_e,{open:a,onOpenChange:o,children:(0,$.jsxs)(le,{children:[(0,$.jsxs)(Te,{children:[(0,$.jsx)(qe,{children:`Filters`}),(0,$.jsx)(S,{children:`Refine the data with advanced filters.`})]}),(0,$.jsx)(`div`,{className:`px-4 pb-6`,children:p})]})})]}):(0,$.jsxs)(`div`,{className:Y(Kt({layout:m}),t),children:[p,!e.showApply&&e.showClear&&(0,$.jsxs)(K,{type:`button`,variant:`ghost`,size:`sm`,className:`gap-2`,onClick:l,children:[(0,$.jsx)(Pe,{className:`h-3.5 w-3.5`}),`Clear filters`]})]})},Xt=it(``,{variants:{variant:{buttons:`flex flex-wrap gap-2`,dropdown:`flex flex-wrap items-center gap-3`,builder:`space-y-3`}},defaultVariants:{variant:`dropdown`}}),Zt=e=>e?e.map(e=>({field:e.field,direction:e.direction})):[],Qt=e=>e.map(e=>({id:`${e.field}-${e.direction}`,field:e.field,order:e.direction})),$t=e=>e.filter(e=>e.field).map(e=>({field:e.field,direction:e.order})),en=({schema:e,className:t,onChange:n})=>{let[r,i]=Q.useState(()=>Zt(e.sort)),[a,o]=Q.useState(()=>Qt(Zt(e.sort)));Q.useEffect(()=>{let t=Zt(e.sort);i(t),o(Qt(t))},[e.sort]);let s=Q.useCallback(t=>{i(t),n?.(t),e.onChange&&typeof window<`u`&&window.dispatchEvent(new CustomEvent(e.onChange,{detail:{sort:t}}))},[n,e.onChange]),c=Q.useCallback(t=>{let n=r.find(e=>e.field===t),i=!!e.multiple;if(!n){let e=i?[...r,{field:t,direction:`asc`}]:[{field:t,direction:`asc`}];s(e);return}if(n.direction===`asc`){let e=r.map(e=>e.field===t?{...e,direction:`desc`}:e);s(e);return}let a=r.filter(e=>e.field!==t);s(a)},[s,e.multiple,r]);if((e.variant||`dropdown`)===`buttons`)return(0,$.jsx)(`div`,{className:Y(Xt({variant:`buttons`}),t),children:e.fields.map(e=>{let t=r.find(t=>t.field===e.field);return(0,$.jsxs)(K,{type:`button`,variant:t?`secondary`:`outline`,size:`sm`,onClick:()=>c(e.field),className:`gap-2`,children:[(0,$.jsx)(`span`,{children:e.label||e.field}),t&&(0,$.jsx)(Le,{className:Y(`h-3.5 w-3.5 motion-safe:transition-transform motion-safe:duration-200`,t.direction===`desc`&&`rotate-180`),"aria-label":t.direction===`asc`?`ascending`:`descending`})]},e.field)})});if(e.multiple)return(0,$.jsx)(`div`,{className:Y(Xt({variant:`builder`}),t),children:(0,$.jsx)(et,{fields:e.fields.map(e=>({value:e.field,label:e.label||e.field})),value:a,onChange:e=>{o(e),s($t(e))}})});let l=r[0];return(0,$.jsxs)(`div`,{className:Y(Xt({variant:`dropdown`}),t),children:[(0,$.jsxs)(Ze,{value:l?.field||``,onValueChange:e=>{if(!e){s([]);return}s([{field:e,direction:l?.direction||`asc`}])},children:[(0,$.jsx)(D,{className:`w-56`,children:(0,$.jsx)(R,{placeholder:`Select field`})}),(0,$.jsx)(U,{children:e.fields.map(e=>(0,$.jsx)(A,{value:e.field,children:e.label||e.field},e.field))})]}),(0,$.jsxs)(Ze,{value:l?.direction||`asc`,onValueChange:e=>{l?.field&&s([{field:l.field,direction:e}])},children:[(0,$.jsx)(D,{className:`w-36`,children:(0,$.jsx)(R,{})}),(0,$.jsxs)(U,{children:[(0,$.jsx)(A,{value:`asc`,children:`Ascending`}),(0,$.jsx)(A,{value:`desc`,children:`Descending`})]})]})]})};function tn(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)}function nn(e,t,n,r){return`${e}/share/${t}/${n}?mode=readonly&token=${r}`}var rn=({objectName:e,viewId:t=`default`,baseUrl:n,onShare:r,className:i})=>{let[a,o]=Q.useState(null),[s,c]=Q.useState(!1),[l,u]=Q.useState(!1),[d,f]=Q.useState(``),[p,m]=Q.useState(``),h=n??(typeof window<`u`?window.location.origin:``),g=Q.useCallback(()=>{let n=tn(),i=nn(h,e,t,n);o(i),c(!1);let a=p?new Date(Date.now()+parseInt(p,10)*864e5).toISOString():void 0;r?.(i,{password:d||void 0,expiresAt:a})},[h,e,t,r,d,p]),_=Q.useCallback(async()=>{if(a)try{await navigator.clipboard.writeText(a),c(!0),setTimeout(()=>c(!1),2e3)}catch{let e=document.createElement(`textarea`);e.value=a,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),c(!0),setTimeout(()=>c(!1),2e3)}},[a]);return(0,$.jsxs)(L,{open:l,onOpenChange:u,children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(K,{variant:`outline`,size:`sm`,className:Y(`gap-2`,i),children:[(0,$.jsx)(Ke,{className:`h-4 w-4`}),`Share`]})}),(0,$.jsxs)(ce,{className:`w-96 space-y-4`,align:`end`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-medium`,children:`Share View`}),(0,$.jsx)(z,{variant:`secondary`,className:`text-xs`,children:`Read-only`})]}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Generate a public link to share this view. Recipients can view data without logging in.`})]}),a?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(P,{value:a,readOnly:!0,className:`h-8 text-xs`,onClick:e=>e.target.select()}),(0,$.jsx)(K,{variant:`outline`,size:`sm`,onClick:_,className:`shrink-0 gap-1`,children:s?(0,$.jsx)(Oe,{className:`h-4 w-4 text-green-500`}):(0,$.jsx)(M,{className:`h-4 w-4`})})]}),(d||p)&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[d&&(0,$.jsxs)(z,{variant:`outline`,className:`text-xs gap-1`,children:[(0,$.jsx)(ye,{className:`h-3 w-3`}),`Password protected`]}),p&&(0,$.jsxs)(z,{variant:`outline`,className:`text-xs gap-1`,children:[(0,$.jsx)(E,{className:`h-3 w-3`}),`Expires in `,p,` day`,p===`1`?``:`s`]})]})]}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,$.jsx)(ye,{className:`h-3.5 w-3.5`}),`Password protection (optional)`]}),(0,$.jsx)(P,{type:`password`,value:d,onChange:e=>f(e.target.value),placeholder:`Enter password...`,className:`h-8 text-xs`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,$.jsx)(E,{className:`h-3.5 w-3.5`}),`Expires after (optional)`]}),(0,$.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),className:`w-full h-8 text-xs rounded-md border border-input bg-background px-3`,children:[(0,$.jsx)(`option`,{value:``,children:`Never`}),(0,$.jsx)(`option`,{value:`1`,children:`1 day`}),(0,$.jsx)(`option`,{value:`7`,children:`7 days`}),(0,$.jsx)(`option`,{value:`30`,children:`30 days`}),(0,$.jsx)(`option`,{value:`90`,children:`90 days`})]})]}),(0,$.jsxs)(K,{onClick:g,className:`w-full gap-2`,size:`sm`,children:[(0,$.jsx)(Ke,{className:`h-4 w-4`}),`Generate Link`]})]})]})]})};function an(){let{t:e}=x();return(t,n,r)=>{let i=e(t,r);return!i||i===t?n:String(i)}}var on={private:0,team:1,organization:2,public:3},sn=8,cn=({id:e,disabled:t,children:n})=>{let{attributes:r,listeners:i,setNodeRef:a,transform:o,transition:s,isDragging:c}=dt({id:e,disabled:t,attributes:{role:`tab`,roleDescription:`view tab`,tabIndex:0}}),l={transform:vt.Transform.toString(o),transition:s,zIndex:c?10:void 0,opacity:c?.5:void 0};return(0,$.jsx)($.Fragment,{children:n({setNodeRef:a,style:l,listeners:i,attributes:r,isDragging:c})})},ln=({views:e,activeViewId:t,onViewChange:n,viewTypeIcons:r={},config:i={},onAddView:a,onRenameView:o,onDuplicateView:s,onDeleteView:c,onSetDefaultView:l,onShareView:u,onSaveAsView:d,onPinView:f,onReorderViews:p,onChangeViewType:m,onConfigView:h,onManageViews:g,availableViewTypes:_,hasUnsavedChanges:v=!1,onResetChanges:y,className:b})=>{let{showAddButton:x=!0,inlineRename:S=!0,contextMenu:T=!0,reorderable:ee=!1,maxVisibleTabs:E=4,showIndicators:D=!0,showSaveAsView:k=!0,showPinnedSection:A=!0,showVisibilityGroups:j=!1}=i,N=an(),[I,L]=(0,Q.useState)(null),[R,ce]=(0,Q.useState)(``),z=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{I&&z.current&&(z.current.focus(),z.current.select())},[I]);let le=(0,Q.useCallback)(t=>{if(!S||!o)return;let n=e.find(e=>e.id===t);n&&(n.readonly||(L(t),ce(n.label)))},[S,o,e]),V=(0,Q.useCallback)(()=>{I&&R.trim()&&o&&o(I,R.trim()),L(null),ce(``)},[I,R,o]),ue=(0,Q.useCallback)(()=>{L(null),ce(``)},[]),de=(0,Q.useMemo)(()=>e.length>0&&e.every(e=>!!e.readonly),[e]),U=(0,Q.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{if(A){let n=+!!e.isPinned,r=+!!t.isPinned;if(n!==r)return r-n}if(j){let n=on[e.visibility||`public`]??on.public,r=on[t.visibility||`public`]??on.public;if(n!==r)return n-r}return 0}),t},[e,A,j]),{visibleViews:pe,overflowViews:_e}=(0,Q.useMemo)(()=>{let e=U.slice(0,E),n=U.slice(E),r=n.findIndex(e=>e.id===t);if(r===-1)return{visibleViews:e,overflowViews:n};let i=n[r],a=e.length>0?[...e.slice(0,-1),i]:[i],o=e.length>0?e[e.length-1]:null,s=n.filter((e,t)=>t!==r);return o&&s.unshift(o),{visibleViews:a,overflowViews:s}},[U,E,t]),ve=_t(ot(lt,{activationConstraint:{distance:sn}}),ot(gt)),be=(0,Q.useCallback)(e=>{let{active:t,over:n}=e;if(!n||t.id===n.id||!p)return;let r=U.findIndex(e=>e.id===t.id),i=U.findIndex(e=>e.id===n.id);r!==-1&&i!==-1&&p(ut(U,r,i).map(e=>e.id))},[U,p]),xe=oe,Se=(0,Q.useCallback)(e=>{if(!j||e===0)return!1;let t=pe[e-1],n=pe[e],r=e=>e.visibility===`private`;return r(t)&&!r(n)},[j,pe]),we=(e,i)=>{let a=e.id===t,d=r[e.type]||xe,v=I===e.id,y=D&&(e.hasActiveFilters||e.hasActiveSort),b=Se(i),x=!!e.readonly,S=(e=>j?e.visibility===`private`?(0,$.jsx)(ye,{"data-testid":`view-tab-visibility-${e.id}`,className:`h-3 w-3 text-muted-foreground shrink-0`}):e.visibility?(0,$.jsx)(ie,{"data-testid":`view-tab-visibility-${e.id}`,className:`h-3 w-3 text-muted-foreground shrink-0`}):null:null)(e),te=t=>(0,$.jsxs)(`div`,{"data-testid":`view-tab-${e.id}`,role:`tab`,tabIndex:0,"aria-selected":a,onClick:()=>!v&&n(e.id),onDoubleClick:()=>le(e.id),onKeyDown:t=>{!v&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id))},...t?.listeners??{},...t?.attributes??{},className:Y(`group/tab inline-flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap relative outline-none focus-visible:ring-2 focus-visible:ring-ring`,t?.isDragging?`cursor-grabbing`:`cursor-pointer`,a?`border-primary text-primary`:`border-transparent text-muted-foreground hover:text-foreground hover:border-border`),children:[ee&&p&&(0,$.jsx)(`span`,{"data-testid":`view-tab-drag-handle-${e.id}`,"aria-hidden":`true`,className:Y(`text-muted-foreground transition-opacity pointer-events-none`,`opacity-0 group-hover/tab:opacity-100`,t?.isDragging&&`opacity-100`),children:(0,$.jsx)(ae,{className:`h-3 w-3`})}),A&&e.isPinned&&(0,$.jsx)(w,{"data-testid":`view-tab-pin-indicator-${e.id}`,className:`h-3 w-3 text-primary shrink-0`}),S,(0,$.jsx)(d,{className:`h-3.5 w-3.5`}),v?(0,$.jsx)(P,{ref:z,"data-testid":`view-tab-rename-input-${e.id}`,value:R,onChange:e=>ce(e.target.value),onBlur:V,onKeyDown:e=>{e.key===`Enter`&&V(),e.key===`Escape`&&ue()},className:`h-5 w-24 px-1 py-0 text-sm border-none focus-visible:ring-1`,onClick:e=>e.stopPropagation()}):(0,$.jsx)(`span`,{children:e.label}),x&&!de&&(0,$.jsxs)(Ee,{children:[(0,$.jsx)(J,{asChild:!0,children:(0,$.jsx)(ye,{"data-testid":`view-tab-readonly-${e.id}`,"aria-label":N(`view.readonlyAriaLabel`,`Read-only view`),className:`h-3 w-3 text-muted-foreground shrink-0`})}),(0,$.jsx)(Z,{side:`bottom`,className:`text-xs`,children:e.readonlyReason||N(`view.readonlyTooltip`,`System view — defined in code, read-only.`)})]}),y&&(0,$.jsxs)(Ee,{children:[(0,$.jsx)(J,{asChild:!0,children:(0,$.jsxs)(`span`,{"data-testid":`view-tab-indicator-${e.id}`,className:`ml-1 inline-flex items-center gap-0.5 h-4 px-1 rounded-full bg-primary/10 text-primary shrink-0`,children:[e.hasActiveFilters&&(0,$.jsx)(C,{className:`h-2.5 w-2.5`}),e.hasActiveSort&&(0,$.jsx)(he,{className:`h-2.5 w-2.5`})]})}),(0,$.jsx)(Z,{side:`bottom`,className:`text-xs`,children:[e.hasActiveFilters&&`Active filters`,e.hasActiveSort&&`Active sort`].filter(Boolean).join(`, `)})]}),e.isDefault&&(0,$.jsx)(B,{className:`h-3 w-3 text-amber-500 fill-amber-500 shrink-0`}),a&&(h||o||s||c)&&(0,$.jsxs)(fe,{children:[(0,$.jsx)(me,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"data-testid":`view-tab-actions-${e.id}`,className:`ml-0.5 h-4 w-4 flex items-center justify-center rounded hover:bg-accent shrink-0 opacity-70 hover:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),"aria-label":N(`view.tabActionsFor`,`View actions for ${e.label}`,{name:e.label}),children:(0,$.jsx)(ke,{className:`h-3 w-3`})})}),(0,$.jsxs)(ne,{align:`start`,className:`min-w-[180px]`,onClick:e=>e.stopPropagation(),children:[h&&!x&&(0,$.jsxs)(G,{"data-testid":`view-tab-menu-config-${e.id}`,onClick:()=>h(e.id),children:[(0,$.jsx)(Ve,{className:`h-4 w-4 mr-2`}),` `,N(`view.editViewConfig`,`Edit view config`)]}),o&&!x&&(0,$.jsxs)(G,{"data-testid":`view-tab-menu-rename-${e.id}`,onClick:()=>le(e.id),children:[(0,$.jsx)(se,{className:`h-4 w-4 mr-2`}),` `,N(`view.rename`,`Rename`)]}),s&&(0,$.jsxs)(G,{"data-testid":`view-tab-menu-duplicate-${e.id}`,onClick:()=>s(e.id),children:[(0,$.jsx)(M,{className:`h-4 w-4 mr-2`}),` `,N(`view.duplicateView`,`Duplicate view`)]}),u&&(0,$.jsxs)(G,{"data-testid":`view-tab-menu-share-${e.id}`,onClick:()=>u(e.id),children:[(0,$.jsx)(Ke,{className:`h-4 w-4 mr-2`}),` `,N(`view.shareView`,`Share view`)]}),l&&!x&&(0,$.jsxs)(G,{"data-testid":`view-tab-menu-default-${e.id}`,onClick:()=>l(e.id),children:[(0,$.jsx)(B,{className:`h-4 w-4 mr-2`}),` `,N(`view.setAsDefault`,`Set as default`)]}),f&&!x&&(0,$.jsx)(G,{"data-testid":`view-tab-menu-pin-${e.id}`,onClick:()=>f(e.id,!e.isPinned),children:e.isPinned?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ae,{className:`h-4 w-4 mr-2`}),` `,N(`view.unpinView`,`Unpin view`)]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w,{className:`h-4 w-4 mr-2`}),` `,N(`view.pinView`,`Pin view`)]})}),m&&!x&&_&&_.length>0&&(0,$.jsxs)(ze,{children:[(0,$.jsxs)(ge,{"data-testid":`view-tab-menu-change-type-${e.id}`,children:[(0,$.jsx)(O,{className:`h-4 w-4 mr-2`}),` `,N(`view.changeViewType`,`Change view type`)]}),(0,$.jsx)(re,{children:_.map(t=>{let n=r[t.type]||xe;return(0,$.jsxs)(G,{"data-testid":`view-tab-menu-type-${e.id}-${t.type}`,disabled:t.type===e.type,onClick:()=>m(e.id,t.type),children:[(0,$.jsx)(n,{className:`h-4 w-4 mr-2`}),(0,$.jsx)(`span`,{children:t.label})]},t.type)})})]}),c&&!x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(F,{}),(0,$.jsxs)(G,{"data-testid":`view-tab-menu-delete-${e.id}`,onClick:()=>c(e.id),className:`text-destructive focus:text-destructive`,children:[(0,$.jsx)(H,{className:`h-4 w-4 mr-2`}),` `,N(`view.deleteView`,`Delete view`)]})]}),g&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(F,{}),(0,$.jsxs)(G,{"data-testid":`view-tab-menu-manage-${e.id}`,onClick:g,children:[(0,$.jsx)(Qe,{className:`h-4 w-4 mr-2`}),` `,N(`view.manageAllViews`,`Manage all views…`)]})]})]})]})]}),E=t=>!T||v?t:(0,$.jsxs)(Fe,{children:[(0,$.jsx)(je,{asChild:!0,children:t}),(0,$.jsxs)(Ue,{children:[o&&!x&&(0,$.jsxs)(X,{"data-testid":`context-menu-rename-${e.id}`,onClick:()=>le(e.id),children:[(0,$.jsx)(se,{className:`h-4 w-4 mr-2`}),` `,N(`view.rename`,`Rename`)]}),s&&(0,$.jsxs)(X,{"data-testid":`context-menu-duplicate-${e.id}`,onClick:()=>s(e.id),children:[(0,$.jsx)(M,{className:`h-4 w-4 mr-2`}),` `,N(`view.duplicateView`,`Duplicate view`)]}),u&&(0,$.jsxs)(X,{"data-testid":`context-menu-share-${e.id}`,onClick:()=>u(e.id),children:[(0,$.jsx)(Ke,{className:`h-4 w-4 mr-2`}),` `,N(`view.shareView`,`Share view`)]}),l&&!x&&(0,$.jsxs)(X,{"data-testid":`context-menu-default-${e.id}`,onClick:()=>l(e.id),children:[(0,$.jsx)(B,{className:`h-4 w-4 mr-2`}),` `,N(`view.setAsDefault`,`Set as default`)]}),f&&!x&&(0,$.jsx)(X,{"data-testid":`context-menu-pin-${e.id}`,onClick:()=>f(e.id,!e.isPinned),children:e.isPinned?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ae,{className:`h-4 w-4 mr-2`}),` `,N(`view.unpinView`,`Unpin view`)]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w,{className:`h-4 w-4 mr-2`}),` `,N(`view.pinView`,`Pin view`)]})}),m&&!x&&_&&_.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{}),(0,$.jsxs)(Ie,{children:[(0,$.jsxs)(Ce,{"data-testid":`context-menu-change-type-${e.id}`,children:[(0,$.jsx)(O,{className:`h-4 w-4 mr-2`}),` `,N(`view.changeViewType`,`Change view type`)]}),(0,$.jsx)(Ge,{"data-testid":`context-menu-type-submenu-${e.id}`,children:_.map(t=>{let n=r[t.type]||xe;return(0,$.jsxs)(X,{"data-testid":`context-menu-type-${e.id}-${t.type}`,disabled:t.type===e.type,onClick:()=>m(e.id,t.type),children:[(0,$.jsx)(n,{className:`h-4 w-4 mr-2`}),(0,$.jsxs)(`div`,{className:`flex flex-col`,children:[(0,$.jsx)(`span`,{children:t.label}),t.description&&(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.description})]})]},t.type)})})]})]}),c&&!x&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{}),(0,$.jsxs)(X,{"data-testid":`context-menu-delete-${e.id}`,onClick:()=>c(e.id),className:`text-destructive focus:text-destructive`,children:[(0,$.jsx)(H,{className:`h-4 w-4 mr-2`}),` `,N(`view.deleteView`,`Delete view`)]})]}),g&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{}),(0,$.jsxs)(X,{"data-testid":`context-menu-manage-${e.id}`,onClick:g,children:[(0,$.jsx)(Qe,{className:`h-4 w-4 mr-2`}),` `,N(`view.manageAllViews`,`Manage all views…`)]})]})]})]});return ee&&p?(0,$.jsxs)(Q.Fragment,{children:[b&&(0,$.jsx)(`div`,{"data-testid":`view-tab-visibility-separator`,className:`w-px h-5 bg-border mx-1 self-center shrink-0`}),(0,$.jsx)(cn,{id:e.id,children:({setNodeRef:e,style:t,listeners:n,attributes:r,isDragging:i})=>(0,$.jsx)(`div`,{ref:e,style:t,className:Y(`flex`,i&&`z-10`),children:E(te({listeners:n,attributes:r,isDragging:i}))})})]},e.id):(0,$.jsxs)(Q.Fragment,{children:[b&&(0,$.jsx)(`div`,{"data-testid":`view-tab-visibility-separator`,className:`w-px h-5 bg-border mx-1 self-center shrink-0`}),E(te())]},e.id)},Te=(0,$.jsx)($.Fragment,{children:pe.map((e,t)=>we(e,t))});return(0,$.jsx)(Me,{children:(0,$.jsxs)(`div`,{"data-testid":`view-tab-bar`,className:Y(`flex items-center gap-0.5 -mb-px`,b),children:[ee&&p?(0,$.jsx)(ct,{sensors:ve,collisionDetection:ft,onDragEnd:be,children:(0,$.jsx)(ht,{items:pe.map(e=>e.id),strategy:pt,children:(0,$.jsx)(`div`,{"data-testid":`view-tab-sortable-container`,className:`flex items-center gap-0.5`,children:Te})})}):Te,_e.length>0&&(0,$.jsxs)(fe,{children:[(0,$.jsx)(me,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,"data-testid":`view-tab-overflow`,className:`inline-flex items-center gap-1 px-2 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors`,children:[(0,$.jsx)(W,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`text-xs`,children:N(`view.moreViews`,`${_e.length} more`,{count:_e.length})})]})}),(0,$.jsxs)(ne,{align:`end`,children:[g&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(G,{"data-testid":`view-tab-overflow-manage`,onClick:g,className:`font-medium`,children:[(0,$.jsx)(Qe,{className:`h-4 w-4 mr-2`}),` `,N(`view.manageAllViews`,`Manage all views…`)]}),(0,$.jsx)(F,{})]}),_e.map(e=>{let t=r[e.type]||xe;return(0,$.jsxs)(G,{"data-testid":`view-tab-overflow-${e.id}`,onClick:()=>n(e.id),children:[e.isPinned&&(0,$.jsx)(w,{className:`h-3 w-3 mr-1 text-primary shrink-0`}),(0,$.jsx)(t,{className:`h-4 w-4 mr-2`}),e.label,D&&(e.hasActiveFilters||e.hasActiveSort)&&(0,$.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-0.5 h-4 px-1 rounded-full bg-primary/10 text-primary`,children:[e.hasActiveFilters&&(0,$.jsx)(C,{className:`h-2.5 w-2.5`}),e.hasActiveSort&&(0,$.jsx)(he,{className:`h-2.5 w-2.5`})]})]},e.id)})]})]}),x&&a&&(0,$.jsxs)(Ee,{children:[(0,$.jsx)(J,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"data-testid":`view-tab-add`,onClick:a,className:`inline-flex items-center px-2 py-2 text-muted-foreground hover:text-foreground transition-colors`,children:(0,$.jsx)(te,{className:`h-4 w-4`})})}),(0,$.jsx)(Z,{children:`Add View`})]}),k&&v&&(0,$.jsxs)(`div`,{"data-testid":`view-tab-save-as`,className:`flex items-center gap-1 ml-2 text-xs text-amber-600 dark:text-amber-400`,children:[(0,$.jsx)(We,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:`Unsaved changes`}),d&&(0,$.jsx)(K,{variant:`ghost`,size:`sm`,"data-testid":`view-tab-save-as-btn`,className:`h-6 px-2 text-xs`,onClick:d,children:`Save as View`}),y&&(0,$.jsx)(K,{variant:`ghost`,size:`sm`,"data-testid":`view-tab-reset-btn`,className:`h-6 px-2 text-xs`,onClick:y,children:`Reset`})]})]})})};function un(){let{t:e}=x();return(t,n,r)=>{let i=e(t,r);return!i||i===t?n:String(i)}}var dn=oe,fn=({view:e,isActive:t,Icon:n,isRenaming:r,onStartRename:i,onCommitRename:a,onCancelRename:o,onRowClick:s,onDelete:c,onDuplicate:l,onSetDefault:u,onSetPinned:d,onConfigView:f})=>{let p=un(),{attributes:m,listeners:h,setNodeRef:g,transform:_,transition:v,isDragging:y}=dt({id:e.id}),b={transform:vt.Transform.toString(_),transition:v,opacity:y?.5:1},x=(0,Q.useRef)(null),[S,C]=(0,Q.useState)(e.label),T=!!e.readonly;(0,Q.useEffect)(()=>{r&&(C(e.label),requestAnimationFrame(()=>{x.current?.focus(),x.current?.select()}))},[r,e.label]);let ee=(0,Q.useCallback)(()=>{let t=S.trim();t&&t!==e.label?a(e.id,t):o()},[S,e.id,e.label,a,o]);return(0,$.jsxs)(`li`,{ref:g,style:b,"data-testid":`manage-views-row-${e.id}`,className:Y(`group/row flex items-center gap-2 px-2 py-2 rounded-md border border-transparent`,`hover:bg-accent/50 transition-colors`,t&&`bg-accent/40 border-border`,y&&`shadow-md bg-background border-border z-10`),children:[(0,$.jsx)(`button`,{type:`button`,...m,...h,"aria-label":p(`view.dragToReorder`,`Drag to reorder`),"data-testid":`manage-views-drag-${e.id}`,className:`shrink-0 h-6 w-5 flex items-center justify-center text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing rounded hover:bg-accent`,onClick:e=>e.stopPropagation(),children:(0,$.jsx)(ae,{className:`h-4 w-4`})}),(0,$.jsx)(n,{className:`shrink-0 h-4 w-4 text-muted-foreground`}),(0,$.jsx)(`div`,{className:`flex-1 min-w-0`,onClick:()=>{r||s?.(e.id)},children:r?(0,$.jsx)(P,{ref:x,value:S,onChange:e=>C(e.target.value),onBlur:ee,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),ee()):e.key===`Escape`&&(e.preventDefault(),o())},onClick:e=>e.stopPropagation(),className:`h-7 text-sm`,"data-testid":`manage-views-rename-input-${e.id}`}):(0,$.jsxs)(`button`,{type:`button`,className:`w-full text-left text-sm font-medium truncate cursor-pointer flex items-center gap-1.5`,onDoubleClick:t=>{t.stopPropagation(),T||i(e.id)},title:e.label,children:[(0,$.jsx)(`span`,{className:`truncate`,children:e.label}),T&&(0,$.jsx)(ye,{"aria-label":p(`view.readonlyAriaLabel`,`Read-only view`),"data-testid":`manage-views-readonly-${e.id}`,className:`h-3 w-3 text-muted-foreground shrink-0`}),e.isDefault&&(0,$.jsxs)(`span`,{className:`ml-1 inline-flex items-center text-[10px] uppercase tracking-wide text-muted-foreground`,title:p(`view.defaultView`,`Default view`),children:[(0,$.jsx)(B,{className:`h-3 w-3 mr-0.5 fill-current`}),` `,p(`view.defaultBadge`,`default`)]})]})}),d&&!r&&!T&&(0,$.jsx)(Me,{delayDuration:300,children:(0,$.jsxs)(Ee,{children:[(0,$.jsx)(J,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":e.isPinned?p(`view.unpinView`,`Unpin View`):p(`view.pinView`,`Pin View`),"data-testid":`manage-views-pin-${e.id}`,onClick:t=>{t.stopPropagation(),d(e.id,!e.isPinned)},className:Y(`shrink-0 h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent transition-colors`,e.isPinned?`text-amber-500`:`text-muted-foreground/40 opacity-0 group-hover/row:opacity-100`),children:e.isPinned?(0,$.jsx)(w,{className:`h-4 w-4 fill-current`}):(0,$.jsx)(w,{className:`h-4 w-4`})})}),(0,$.jsx)(Z,{side:`top`,children:e.isPinned?p(`view.unpinView`,`Unpin View`):p(`view.pinView`,`Pin View`)})]})}),u&&!r&&!e.isDefault&&!T&&(0,$.jsx)(Me,{delayDuration:300,children:(0,$.jsxs)(Ee,{children:[(0,$.jsx)(J,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":p(`view.setAsDefault`,`Set as Default`),"data-testid":`manage-views-default-${e.id}`,onClick:t=>{t.stopPropagation(),u(e.id)},className:`shrink-0 h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-muted-foreground/40 hover:text-foreground opacity-0 group-hover/row:opacity-100 transition-colors`,children:(0,$.jsx)(B,{className:`h-4 w-4`})})}),(0,$.jsx)(Z,{side:`top`,children:p(`view.setAsDefault`,`Set as Default`)})]})}),!r&&(c||l||f||u)&&(0,$.jsxs)(fe,{children:[(0,$.jsx)(me,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":p(`view.tabActionsFor`,`View actions for ${e.label}`,{name:e.label}),"data-testid":`manage-views-actions-${e.id}`,onClick:e=>e.stopPropagation(),className:`shrink-0 h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-muted-foreground opacity-60 group-hover/row:opacity-100 transition-opacity`,children:(0,$.jsx)(W,{className:`h-4 w-4`})})}),(0,$.jsxs)(ne,{align:`end`,className:`min-w-[180px]`,children:[!T&&(0,$.jsxs)(G,{"data-testid":`manage-views-action-rename-${e.id}`,onClick:()=>i(e.id),children:[(0,$.jsx)(se,{className:`h-4 w-4 mr-2`}),` `,p(`view.rename`,`Rename`)]}),l&&(0,$.jsxs)(G,{"data-testid":`manage-views-action-duplicate-${e.id}`,onClick:()=>l(e.id),children:[(0,$.jsx)(M,{className:`h-4 w-4 mr-2`}),` `,p(`view.duplicateView`,`Duplicate View`)]}),f&&!T&&(0,$.jsxs)(G,{"data-testid":`manage-views-action-config-${e.id}`,onClick:()=>f(e.id),children:[(0,$.jsx)(se,{className:`h-4 w-4 mr-2`}),` `,p(`view.editViewConfig`,`Edit view config`)]}),u&&!e.isDefault&&!T&&(0,$.jsxs)(G,{"data-testid":`manage-views-action-default-${e.id}`,onClick:()=>u(e.id),children:[(0,$.jsx)(B,{className:`h-4 w-4 mr-2`}),` `,p(`view.setAsDefault`,`Set as Default`)]}),d&&!T&&(0,$.jsx)(G,{"data-testid":`manage-views-action-pin-${e.id}`,onClick:()=>d(e.id,!e.isPinned),children:e.isPinned?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ae,{className:`h-4 w-4 mr-2`}),` `,p(`view.unpinView`,`Unpin View`)]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(w,{className:`h-4 w-4 mr-2`}),` `,p(`view.pinView`,`Pin View`)]})}),c&&!T&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(F,{}),(0,$.jsxs)(G,{"data-testid":`manage-views-action-delete-${e.id}`,onClick:()=>c(e.id),className:`text-destructive focus:text-destructive`,children:[(0,$.jsx)(H,{className:`h-4 w-4 mr-2`}),` `,p(`view.deleteView`,`Delete View`)]})]})]})]}),r&&(0,$.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":p(`common.save`,`Save`),onMouseDown:e=>e.preventDefault(),onClick:ee,className:`h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-emerald-600`,children:(0,$.jsx)(Oe,{className:`h-4 w-4`})}),(0,$.jsx)(`button`,{type:`button`,"aria-label":p(`common.cancel`,`Cancel`),onMouseDown:e=>e.preventDefault(),onClick:o,className:`h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-muted-foreground`,children:(0,$.jsx)(Pe,{className:`h-4 w-4`})})]})]})},pn=({open:e,onOpenChange:t,views:n,activeViewId:r,viewTypeIcons:i={},onRename:a,onDelete:o,onDuplicate:s,onSetDefault:c,onSetPinned:l,onReorder:u,onAddView:d,onConfigView:f})=>{let p=un(),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(()=>n.map(e=>e.id));(0,Q.useEffect)(()=>{y(n.map(e=>e.id))},[n]),(0,Q.useEffect)(()=>{e||(_(null),h(``))},[e]);let b=(0,Q.useMemo)(()=>{let e=new Map(n.map(e=>[e.id,e]));return v.map(t=>e.get(t)).filter(Boolean)},[v,n]),x=(0,Q.useMemo)(()=>{if(!m.trim())return b;let e=m.toLowerCase();return b.filter(t=>t.label.toLowerCase().includes(e))},[b,m]),S=_t(ot(lt,{activationConstraint:{distance:5}}),ot(gt,{coordinateGetter:st})),C=e=>{let{active:t,over:n}=e;if(!n||t.id===n.id)return;let r=v.indexOf(String(t.id)),i=v.indexOf(String(n.id));if(r<0||i<0)return;let a=ut(v,r,i);y(a),u?.(a)},w=e=>{t(!1),requestAnimationFrame(()=>f?.(e))};return(0,$.jsx)(Ye,{open:e,onOpenChange:t,children:(0,$.jsxs)(nt,{className:`sm:max-w-[560px] p-0 gap-0 overflow-hidden`,"data-testid":`manage-views-dialog`,children:[(0,$.jsxs)(ue,{className:`px-5 pt-5 pb-3`,children:[(0,$.jsx)(ee,{className:`text-base`,children:p(`view.manageViews`,`Manage views`)}),(0,$.jsx)(Se,{className:`text-xs`,children:p(`view.manageViewsDescription`,`Reorder, rename, pin, or delete every view in this object.`)})]}),(0,$.jsx)(`div`,{className:`px-5 pb-3`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(be,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none`}),(0,$.jsx)(P,{value:m,onChange:e=>h(e.target.value),placeholder:p(`view.searchViews`,`Search views`),className:`pl-8 h-9`,"data-testid":`manage-views-search`})]})}),(0,$.jsx)(`div`,{className:`px-3 pb-3 max-h-[55vh] overflow-y-auto`,"data-testid":`manage-views-list`,children:x.length===0?(0,$.jsx)(`div`,{className:`text-center text-sm text-muted-foreground py-10`,children:p(`view.noViewsFound`,`No views match your search.`)}):(0,$.jsx)(ct,{sensors:S,collisionDetection:ft,onDragEnd:C,children:(0,$.jsx)(ht,{items:x.map(e=>e.id),strategy:mt,children:(0,$.jsx)(`ul`,{className:`space-y-0.5`,children:x.map(e=>{let t=i[e.type]||dn;return(0,$.jsx)(fn,{view:e,Icon:t,isActive:e.id===r,isRenaming:g===e.id,onStartRename:e=>_(e),onCancelRename:()=>_(null),onCommitRename:(e,t)=>{_(null),a?.(e,t)},onDelete:o,onDuplicate:s,onSetDefault:c,onSetPinned:l,onConfigView:f?w:void 0},e.id)})})})})}),(0,$.jsxs)($e,{className:`border-t bg-muted/30 px-5 py-3 flex sm:justify-between gap-2`,children:[d?(0,$.jsxs)(K,{variant:`ghost`,size:`sm`,onClick:()=>{t(!1),requestAnimationFrame(()=>d())},"data-testid":`manage-views-add`,className:`text-sm`,children:[(0,$.jsx)(te,{className:`h-4 w-4 mr-1.5`}),` `,p(`view.addNewView`,`Add new view`)]}):(0,$.jsx)(`span`,{}),(0,$.jsx)(K,{size:`sm`,onClick:()=>t(!1),"data-testid":`manage-views-done`,children:p(`view.done`,`Done`)})]})]})})},mn=e=>e.toLowerCase().replace(/[\s_-]+/g,``);new Map([...o.map(e=>[mn(e),e]),...Object.entries(s).map(([e,t])=>[mn(e),t])]);function hn(e){let t=(e||``).toLowerCase();return d(t)?(f(t),`text`):[`integer`,`int`,`float`,`double`,`number`,`currency`,`money`,`percent`,`rating`].includes(t)?`number`:[`date`,`datetime`,`datetime_tz`,`timestamp`,`time`].includes(t)?`date`:[`boolean`,`bool`,`checkbox`,`switch`].includes(t)?`boolean`:[`select`,`picklist`,`single_select`,`multi_select`,`enum`,`status`,`lookup`,`master_detail`,`user`].includes(t)?`select`:`text`}function gn(e){return e.fields?Object.entries(e.fields).filter(([e,t])=>!(e.startsWith(`_`)||t?.hidden)).map(([e,t])=>({value:e,label:t.label||e,type:hn(t.type),options:t.options,rawType:t.type,rawName:e})):[]}var _n=new Set([`image`,`image_url`,`photo`,`picture`,`avatar`,`file`,`attachment`,`attachments`,`media`,`url`,`link`]),vn=[`image`,`photo`,`picture`,`avatar`,`thumbnail`,`thumb`,`logo`,`cover`,`banner`,`icon`,`attachment`];function yn(e){if(!e)return!1;let t=(e.rawType||e.type||``).toLowerCase();if(_n.has(t))return!0;let n=(e.rawName||e.name||e.key||e.value||``).toLowerCase();return n?vn.some(e=>n.includes(e)):!1}var bn=new Set([`geolocation`,`geo`,`geo_point`,`geopoint`,`location`,`latlng`,`lnglat`]);function xn(e,t){if(!e)return!1;let n=(e.rawType||e.type||``).toLowerCase();if(bn.has(n))return!0;let r=(e.rawName||e.name||e.key||e.value||``).toLowerCase();return r?t===`latitude`?/(^|[_-])lat([^a-z]|itude)?($|[_-])/.test(r)||r===`lat`:/(^|[_-])(lng|lon|long)([^a-z]|gitude)?($|[_-])/.test(r)||r===`lng`||r===`lon`:!1}function Sn(e,t){if(e.length!==0){for(let n of t){let t=e.find(e=>e.value.toLowerCase().includes(n));if(t)return t.value}return e[0]?.value}}var Cn=[`status`,`stage`,`state`,`priority`,`category`,`type`],wn=[`start_date`,`startdate`,`due_date`,`duedate`,`event_date`,`date`,`created_at`,`createdat`,`created`],Tn=[`end_date`,`enddate`,`finish_date`,`completion_date`,`closed_at`],En=u,Dn=({schema:e})=>{let t=(0,Q.useContext)(En)?.dataSource??null;return(0,$.jsx)(Gt,{schema:e,dataSource:t})};p.register(`object-view`,Dn,{namespace:`plugin-view`,label:`Object View`,category:`view`,icon:`LayoutDashboard`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`title`,type:`string`,label:`Title`},{name:`description`,type:`string`,label:`Description`},{name:`layout`,type:`enum`,label:`Form Layout`,enum:[`drawer`,`modal`,`page`]},{name:`defaultViewType`,type:`enum`,label:`Default View Type`,enum:[`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`]},{name:`defaultListView`,type:`string`,label:`Default Named View`},{name:`showSearch`,type:`boolean`,label:`Show Search`},{name:`showFilters`,type:`boolean`,label:`Show Filters`},{name:`showCreate`,type:`boolean`,label:`Show Create Button`},{name:`showViewSwitcher`,type:`boolean`,label:`Show View Switcher`},{name:`listViews`,type:`object`,label:`Named List Views`},{name:`navigation`,type:`object`,label:`Navigation Config`},{name:`searchableFields`,type:`array`,label:`Searchable Fields`},{name:`filterableFields`,type:`array`,label:`Filterable Fields`}],defaultProps:{layout:`drawer`,defaultViewType:`grid`,showSearch:!0,showFilters:!0,showCreate:!0,showViewSwitcher:!0}}),p.register(`view`,Dn,{namespace:`plugin-view`,label:`View`,category:`view`}),p.register(`view-switcher`,jt,{namespace:`view`,label:`View Switcher`,category:`view`,icon:`LayoutGrid`,inputs:[{name:`views`,type:`array`,label:`Views`,required:!0},{name:`defaultView`,type:`string`,label:`Default View`},{name:`activeView`,type:`string`,label:`Active View`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`tabs`,`buttons`,`dropdown`]},{name:`position`,type:`enum`,label:`Position`,enum:[`top`,`bottom`,`left`,`right`]},{name:`persistPreference`,type:`boolean`,label:`Persist Preference`},{name:`storageKey`,type:`string`,label:`Storage Key`},{name:`onViewChange`,type:`string`,label:`On View Change Event`}],defaultProps:{variant:`tabs`,position:`top`,defaultView:`grid`,views:[{type:`grid`,label:`Grid`,schema:{type:`text`,content:`Grid view`}},{type:`list`,label:`List`,schema:{type:`text`,content:`List view`}}]}}),p.register(`filter-ui`,Yt,{namespace:`view`,label:`Filter UI`,category:`view`,icon:`SlidersHorizontal`,inputs:[{name:`filters`,type:`array`,label:`Filters`,required:!0},{name:`values`,type:`object`,label:`Values`},{name:`onChange`,type:`string`,label:`On Change Event`},{name:`showClear`,type:`boolean`,label:`Show Clear Button`},{name:`showApply`,type:`boolean`,label:`Show Apply Button`},{name:`layout`,type:`enum`,label:`Layout`,enum:[`inline`,`popover`,`drawer`]}],defaultProps:{layout:`inline`,showApply:!1,showClear:!0,filters:[{field:`name`,label:`Name`,type:`text`,placeholder:`Search name`},{field:`status`,label:`Status`,type:`select`,options:[{label:`Open`,value:`open`},{label:`Closed`,value:`closed`}]},{field:`created_at`,label:`Created`,type:`date`}]}}),p.register(`sort-ui`,en,{namespace:`view`,label:`Sort UI`,category:`view`,icon:`ArrowUpDown`,inputs:[{name:`fields`,type:`array`,label:`Fields`,required:!0},{name:`sort`,type:`array`,label:`Sort`},{name:`onChange`,type:`string`,label:`On Change Event`},{name:`multiple`,type:`boolean`,label:`Allow Multiple`},{name:`variant`,type:`enum`,label:`Variant`,enum:[`dropdown`,`buttons`]}],defaultProps:{variant:`dropdown`,multiple:!0,fields:[{field:`name`,label:`Name`},{field:`created_at`,label:`Created At`}],sort:[{field:`name`,direction:`asc`}]}}),p.register(`shared-view-link`,rn,{namespace:`view`,label:`Shared View Link`,category:`view`,icon:`Share2`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewId`,type:`string`,label:`View ID`},{name:`baseUrl`,type:`string`,label:`Base URL`}],defaultProps:{objectName:`objects`,viewId:`default`}}),p.register(`view:simple`,({schema:e,className:t,children:n,dataSource:r,...i})=>{let a=e.props?.columns?{display:`grid`,gridTemplateColumns:`repeat(${e.props.columns}, 1fr)`,gap:`1rem`}:void 0;return(0,$.jsx)(`div`,{className:t,style:a,...i,children:n})},{namespace:`plugin-view`,label:`Simple View`,category:`view`});export{xn as a,pn as c,Pt as d,gn as i,ln as l,Cn as n,yn as o,wn as r,Sn as s,Tn as t,Gt as u};
|