@objectstack/console 17.5.0 → 17.6.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 +378 -0
- package/dist/.objectstack-injection.json +2 -2
- package/dist/.objectui-sha +1 -1
- package/dist/assets/{ActionResultDialog-CLdIyOW6.js → ActionResultDialog-4kHDGnT3.js} +3 -3
- package/dist/assets/{AiPendingActionsPage-OKYz66yR.js → AiPendingActionsPage-JjOddm0h.js} +1 -1
- package/dist/assets/{ApiConsolePage-CcrKovu8.js → ApiConsolePage-BgS26lbp.js} +1 -1
- package/dist/assets/AppDocsIndex-BDoH5ECM.js +1 -0
- package/dist/assets/{AppManagementPage-D_xz8cTZ.js → AppManagementPage-CCgKmNTj.js} +1 -1
- package/dist/assets/ApprovalsInboxPage-C6S1vk0X.js +1 -0
- package/dist/assets/AuditLogPage-v2dKXMuk.js +1 -0
- package/dist/assets/BookPage-DwFMcTSN.js +1 -0
- package/dist/assets/{ComponentNavView-BxsixSU9.js → ComponentNavView-B5g9c6fx.js} +1 -1
- package/dist/assets/{CreateViewDialog-xyKlpLEW.js → CreateViewDialog-D3l-tYHM.js} +1 -1
- package/dist/assets/DashboardView-BOcovpPd.js +1 -0
- package/dist/assets/DocPage-B6AkH5WI.js +1 -0
- package/dist/assets/{DocsIndex-B2zw_HAp.js → DocsIndex-DwW2QsYY.js} +1 -1
- package/dist/assets/{DocsLayout-DezZ8x7_.js → DocsLayout-D63StSgd.js} +1 -1
- package/dist/assets/DocsSlug-CP9fcabi.js +1 -0
- package/dist/assets/ExpressionProvider-CrL6jhVq.js +1 -0
- package/dist/assets/{FlowRunsPage-CvY3nJMF.js → FlowRunsPage-CxdaiUyk.js} +1 -1
- package/dist/assets/{IntegrationsPage-2leVkVDH.js → IntegrationsPage-DvG0x0Nb.js} +2 -2
- package/dist/assets/{InterfaceListPage-BdECC_i3.js → InterfaceListPage-C4wPYohR.js} +1 -1
- package/dist/assets/{MarketplaceInstalledPage-EPPHSitW.js → MarketplaceInstalledPage-B7KETQG2.js} +1 -1
- package/dist/assets/MarketplacePackagePage-CfgKDpNH.js +4 -0
- package/dist/assets/{MarketplacePage-BnQKykgv.js → MarketplacePage-DNEyU5AE.js} +1 -1
- package/dist/assets/{MetadataInspector-BWxLkr0O.js → MetadataInspector-EP0I3-Kq.js} +1 -1
- package/dist/assets/{ObjectDataPage-BIzp65Mo.js → ObjectDataPage-CykEm9MD.js} +1 -1
- package/dist/assets/PageView-C6u86tni.js +1 -0
- package/dist/assets/{ProfilePage-D2qGgxPK.js → ProfilePage-C3SjXMzi.js} +1 -1
- package/dist/assets/{PublicFormsPage-DlE6tck_.js → PublicFormsPage-D3uCTR-8.js} +1 -1
- package/dist/assets/RecordDetailView-DgR_zhP4.js +3 -0
- package/dist/assets/RecordFormPage-kiJI-ieF.js +1 -0
- package/dist/assets/ReportDefaultInspector-BIinF0EQ.js +1 -0
- package/dist/assets/{ReportView-GIdKJdOt.js → ReportView-BREO-ADE.js} +1 -1
- package/dist/assets/{RuntimeDraftBar-BbMdi3Kp.js → RuntimeDraftBar-BCWfd2yS.js} +1 -1
- package/dist/assets/SchemaForm-C4uMMZ13.js +3 -0
- package/dist/assets/SearchResultsPage-C6Hw_Lpn.js +1 -0
- package/dist/assets/{SettingsHub-BGKIj-Zq.js → SettingsHub-DP1mrzEN.js} +1 -1
- package/dist/assets/SettingsView-u7mc6pcc.js +1 -0
- package/dist/assets/{SkeletonDetail-C8fMI-Mu.js → SkeletonDetail-DIwlbHTr.js} +1 -1
- package/dist/assets/{af-BfSmLD34.js → af-DPUgkQl0.js} +1 -1
- package/dist/assets/ai-DPBykF2N.js +3 -0
- package/dist/assets/{app-shell-eager-leaves-CDVclng4.js → app-shell-eager-leaves-Cf2bM6uT.js} +1 -1
- package/dist/assets/{ar-B9ttrM75.js → ar-B-6GTIRU.js} +1 -1
- package/dist/assets/{ar-DZ-C1rn-cyl.js → ar-DZ-wEl298ti.js} +1 -1
- package/dist/assets/{ar-EG-BaDxKP_o.js → ar-EG-YBT90_S0.js} +1 -1
- package/dist/assets/{ar-MA-DbxNEcmd.js → ar-MA-3uT-EYh6.js} +1 -1
- package/dist/assets/{ar-SA-DeC5LXcX.js → ar-SA-SiQsjhhc.js} +1 -1
- package/dist/assets/{ar-TN-C9KpTFJz.js → ar-TN-CfzXjKzS.js} +1 -1
- package/dist/assets/{az-cMerDwRO.js → az-BqAfcNza.js} +1 -1
- package/dist/assets/{be-ZTSbszQh.js → be-CQgWXa9_.js} +1 -1
- package/dist/assets/{be-tarask-BXZEUrgX.js → be-tarask-BmNg0Sir.js} +1 -1
- package/dist/assets/{bg-BDogpmn5.js → bg-D3evgRuS.js} +1 -1
- package/dist/assets/{bn-Cz04uxmh.js → bn-uItkARwm.js} +1 -1
- package/dist/assets/{bs-CpFnCl-j.js → bs-DueReOpO.js} +1 -1
- package/dist/assets/{ca-CHC4M52Z.js → ca-Cr3AHktR.js} +1 -1
- package/dist/assets/{ckb-Dxw-RNm8.js → ckb-CTi5BET7.js} +1 -1
- package/dist/assets/contracts-DieHW666.js +1 -0
- package/dist/assets/{createDerive-DvA_JGNq.js → createDerive-CjN1i5vn.js} +1 -1
- package/dist/assets/{cs-DsFaJ5Z7.js → cs-43mFX9jr.js} +1 -1
- package/dist/assets/{cy-FH4JFDTs.js → cy-BBSkg3F8.js} +1 -1
- package/dist/assets/{da-D1pVjaAq.js → da-C5oA5qcs.js} +1 -1
- package/dist/assets/data-adapter-Cymvlczj.js +1 -0
- package/dist/assets/{de-AT-DUMQCisj.js → de-AT-CApxwJzu.js} +1 -1
- package/dist/assets/{de-DKrxSvnP.js → de-CPtbLlAf.js} +1 -1
- package/dist/assets/default-inspector-registry-Bs6GBn00.js +1 -0
- package/dist/assets/dist-BF-ssUpn.js +14 -0
- package/dist/assets/{el-l3-bHySV.js → el-Dto2xBQU.js} +1 -1
- package/dist/assets/en-AU-FVwCiDJO.js +1 -0
- package/dist/assets/{en-CA-DGH5NF0a.js → en-CA-DKuJPN1U.js} +1 -1
- package/dist/assets/en-GB-DQ_y5VbJ.js +1 -0
- package/dist/assets/en-IE-DaXOhsZW.js +1 -0
- package/dist/assets/en-IN-CnRZnAom.js +1 -0
- package/dist/assets/en-NZ-CBZLEToK.js +1 -0
- package/dist/assets/en-ZA-BE59v0wZ.js +1 -0
- package/dist/assets/{eo-CL6CXHZx.js → eo-BL8JXIWd.js} +1 -1
- package/dist/assets/{es-BIJ0rksI.js → es-BnoaNxsu.js} +1 -1
- package/dist/assets/{et-BGgMzjm1.js → et-tPYLNenO.js} +1 -1
- package/dist/assets/{eu-CqvAoRrX.js → eu-CUBG6bT0.js} +1 -1
- package/dist/assets/{fa-IR-DNz3oA1-.js → fa-IR-Rr2d9xSs.js} +1 -1
- package/dist/assets/{fi-DNSfKWuW.js → fi-B0NVIZsV.js} +1 -1
- package/dist/assets/{formatLong-CHb9WA3O.js → formatLong-1-gt9bpo.js} +1 -1
- package/dist/assets/{fr-DYRJCirJ.js → fr-BbhHek8e.js} +1 -1
- package/dist/assets/{fr-CA-CotiswPx.js → fr-CA-CBDvLXFg.js} +1 -1
- package/dist/assets/{fr-CH-CpiEYWpc.js → fr-CH-WPNmwPn7.js} +1 -1
- package/dist/assets/framework-DFR4HNtj.js +35 -0
- package/dist/assets/{fy-B69yM3FE.js → fy-DvOBbvEF.js} +1 -1
- package/dist/assets/{gd-BAy8AsX6.js → gd-BQPiTPX5.js} +1 -1
- package/dist/assets/getIcon-Cfwf-Egt.js +1 -0
- package/dist/assets/{gl-soLn_weL.js → gl-BJCXK8uO.js} +1 -1
- package/dist/assets/{gu-B19Yo9yC.js → gu-CctPRz3V.js} +1 -1
- package/dist/assets/{he-DYTPo33p.js → he-CVFMk6p2.js} +1 -1
- package/dist/assets/{hi-D2dIK7Oy.js → hi-Ba30-RwS.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CExufvVt.js → highlighted-body-OFNGDK62-BQ57IrBV.js} +1 -1
- package/dist/assets/{hr-BV-VOPMu.js → hr-BZUqTbZs.js} +1 -1
- package/dist/assets/{ht-C7MM4qkS.js → ht-BLe05tPx.js} +1 -1
- package/dist/assets/{hu-Rha1m2Ym.js → hu-2CQ_Mkww.js} +1 -1
- package/dist/assets/{hy-CiTNgbdV.js → hy-CclcPG4H.js} +1 -1
- package/dist/assets/i18n-BnUsCaSC.js +17 -0
- package/dist/assets/i18n-locale-ar-92O_xtDZ.js +4 -0
- package/dist/assets/i18n-locale-de-T5ic3yH9.js +4 -0
- package/dist/assets/i18n-locale-en-rxr7WJYl.js +4 -0
- package/dist/assets/i18n-locale-es-D_WOifJ_.js +4 -0
- package/dist/assets/i18n-locale-fr-3cvyjMkp.js +4 -0
- package/dist/assets/i18n-locale-ja-DXlIkB8I.js +4 -0
- package/dist/assets/i18n-locale-ko-DngRpS45.js +4 -0
- package/dist/assets/i18n-locale-pt-BkPaFCqZ.js +4 -0
- package/dist/assets/i18n-locale-ru-E5wLh-y6.js +4 -0
- package/dist/assets/i18n-locale-zh-BL4_Yand.js +4 -0
- package/dist/assets/{i18n-runtime-CTgAQF4N.js → i18n-runtime-97_bDVjP.js} +1 -1
- package/dist/assets/{id-Cijsfjt-.js → id-6JLB8s-f.js} +1 -1
- package/dist/assets/index-Cadlh4t_.css +2 -0
- package/dist/assets/index-D98sa5GF.js +20 -0
- package/dist/assets/{infrastructure-BHSync5f.js → infrastructure-Cc34lEqb.js} +2 -2
- package/dist/assets/integration-CeAF4JFT.js +1 -0
- package/dist/assets/{is-xS1WTyeC.js → is-to0CWzm1.js} +1 -1
- package/dist/assets/isSameWeek-DBXaA1Gd.js +1 -0
- package/dist/assets/{it-CH-l516ZNXj.js → it-CH-DhdfjP5Z.js} +1 -1
- package/dist/assets/{it-C2i_c9sd.js → it-ea0B8Ujp.js} +1 -1
- package/dist/assets/{ja-D9_ewLny.js → ja-B1bzkgDW.js} +1 -1
- package/dist/assets/{ja-Hira-D_6ExgHw.js → ja-Hira-CMrY5hXO.js} +1 -1
- package/dist/assets/{ka-BYHGyees.js → ka-DKSXLnXP.js} +1 -1
- package/dist/assets/{kk-CbTFtuqb.js → kk-DHwMv8Dn.js} +1 -1
- package/dist/assets/{km-Dr2gwhIn.js → km-tpLG1xNr.js} +1 -1
- package/dist/assets/{kn-CprH8JD7.js → kn-MLreVnHA.js} +1 -1
- package/dist/assets/{ko-CsFS2u5i.js → ko-CI0DBazn.js} +1 -1
- package/dist/assets/{lb-CbFKN7Ob.js → lb-CmL572Xe.js} +1 -1
- package/dist/assets/{lt-Bq0xkLp0.js → lt-DRtUOLdw.js} +1 -1
- package/dist/assets/{lv-Cj6vg6Qo.js → lv-COSHgkOP.js} +1 -1
- package/dist/assets/{match-C_jFGO9e.js → match-B-ergJQb.js} +1 -1
- package/dist/assets/{match-CiPp9BME.js → match-BQoOW8Cj.js} +1 -1
- package/dist/assets/{match-Co4ivumx.js → match-dfBS0YSQ.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-Bb17TtNP.js +1 -0
- package/dist/assets/metadata-admin-CABUxbJl.js +9 -0
- package/dist/assets/{mk-MXFM99YL.js → mk-B0IH_YL_.js} +1 -1
- package/dist/assets/{mn-D5Q9B6Jt.js → mn-P-QdQ2n3.js} +1 -1
- package/dist/assets/{ms-CCzPRldx.js → ms-CtyEOINy.js} +1 -1
- package/dist/assets/{mt-mjJpN6xW.js → mt-DfuZ2HRm.js} +1 -1
- package/dist/assets/{nb-BIlNqdEb.js → nb-2Hp-5Tnt.js} +1 -1
- package/dist/assets/{nl-BE-FwXjQsmV.js → nl-BE-mmxbfNoR.js} +1 -1
- package/dist/assets/{nl-D2uBtIxG.js → nl-CZ_nLREz.js} +1 -1
- package/dist/assets/{nn-B0loJ7SV.js → nn-ccWhYsNa.js} +1 -1
- package/dist/assets/{oc-U7-yH1sO.js → oc-z504BFRV.js} +1 -1
- package/dist/assets/{pl-mTy0JYgi.js → pl-DeQ7ASt-.js} +1 -1
- package/dist/assets/plugin-calendar-Cn5HaZU8.js +1 -0
- package/dist/assets/plugin-charts-B6RcFWbo.js +7 -0
- package/dist/assets/plugin-chatbot-Ck47EhDX.js +122 -0
- package/dist/assets/plugin-dashboard-DjEx8e5Y.js +6 -0
- package/dist/assets/plugin-form-CLDvL0up.js +1 -0
- package/dist/assets/plugin-gantt-CrVrxVdi.js +63 -0
- package/dist/assets/plugin-grid-D2rmQEW_.js +11 -0
- package/dist/assets/plugin-kanban-BUNHFfIC.js +1 -0
- package/dist/assets/plugin-map-y-7RQQC5.js +1 -0
- package/dist/assets/{plugin-markdown-D1nTQc1T.js → plugin-markdown-BOkHcir_.js} +1 -1
- package/dist/assets/plugin-report-mT3jpna0.js +59 -0
- package/dist/assets/plugin-timeline-B1EF83D3.js +1 -0
- package/dist/assets/plugin-tree-MTHUt3_S.js +1 -0
- package/dist/assets/plugin-view-DHJI-ahf.js +1 -0
- package/dist/assets/plugins-views-CfkgqD30.js +3 -0
- package/dist/assets/{pt-BR-2KtO5Js1.js → pt-BR-D80_lPYF.js} +1 -1
- package/dist/assets/{pt-Bet5OOQf.js → pt-CJJ1RmXd.js} +1 -1
- package/dist/assets/{ro-37U6sgzi.js → ro-EuFb2TCj.js} +1 -1
- package/dist/assets/{ru-CyuAY-5E.js → ru-CMaVQScp.js} +1 -1
- package/dist/assets/{runtime-metadata-persistence-afAW-MeD.js → runtime-metadata-persistence-ClOTznqa.js} +1 -1
- package/dist/assets/{se-DeJabuC6.js → se-DsfdKLdF.js} +1 -1
- package/dist/assets/{sk-DWEpjfkR.js → sk-BNV9omI8.js} +1 -1
- package/dist/assets/{sl-4oSvNhIR.js → sl-DJS_nINU.js} +1 -1
- package/dist/assets/{sq-BjkBCaXW.js → sq-HEgjcbHe.js} +1 -1
- package/dist/assets/{sr-Dxm1DsRS.js → sr-CO0CFu4X.js} +1 -1
- package/dist/assets/{sr-Latn-Dawg6oP2.js → sr-Latn-eE1Idzey.js} +1 -1
- package/dist/assets/{src-C8NYjdVm.js → src-BU7L2v4J.js} +1 -1
- package/dist/assets/src-BUtIBFDA.js +1 -0
- package/dist/assets/src-C0eXlKtx.js +16 -0
- package/dist/assets/{studioEntry-nXQP3iL0.js → studioEntry-WeMfaSGn.js} +1 -1
- package/dist/assets/{submitRedirect-jK-cEIbP.js → submitRedirect-C2lfZSHt.js} +1 -1
- package/dist/assets/{sv-CROOGJGz.js → sv-5uTzgQT3.js} +1 -1
- package/dist/assets/{ta-BZnTmFI_.js → ta-BzgdkBZG.js} +1 -1
- package/dist/assets/{te-BN0v0x5t.js → te-Ct_pl7ZJ.js} +1 -1
- package/dist/assets/{th-CBjKhp_U.js → th-DouAlk0-.js} +1 -1
- package/dist/assets/{tr-x0Ne4N4H.js → tr-3XNBsI40.js} +1 -1
- package/dist/assets/types-zod-DXpXw10W.js +1 -0
- package/dist/assets/{ug-sgzNhsKo.js → ug-B9n24h9G.js} +1 -1
- package/dist/assets/ui-components-D6cEVg0T.js +37 -0
- package/dist/assets/ui-layout-DgVDuPEM.js +1 -0
- package/dist/assets/{uk-o_DQ5VHJ.js → uk-DCAenByf.js} +1 -1
- package/dist/assets/use-book-data-CwRldFxP.js +1 -0
- package/dist/assets/{useActionModal-CSvbHkQ7.js → useActionModal-Blp4rhOk.js} +1 -1
- package/dist/assets/useCanAuthorMetadata-BxCMgFRf.js +1 -0
- package/dist/assets/useNavSelDeepLink-67Y4qCNO.js +1 -0
- package/dist/assets/useNavTargetLabel-BOJncjIb.js +1 -0
- package/dist/assets/{useOpenRecordList-B5-qaFUx.js → useOpenRecordList-BrwJFojQ.js} +1 -1
- package/dist/assets/{usePackageL10n-CMx66am-.js → usePackageL10n-Ci9uVkRZ.js} +1 -1
- package/dist/assets/{useSettingsLabel-Kkr2q0Oo.js → useSettingsLabel-CeMnMWsh.js} +1 -1
- package/dist/assets/{uz-Cyrl-DbtkQtz_.js → uz-Cyrl-JSeHEqu-.js} +1 -1
- package/dist/assets/{uz-Be41d4jl.js → uz-DT3s9bZS.js} +1 -1
- package/dist/assets/vendor-objectstack-DFqu45yM.js +138 -0
- package/dist/assets/{vi-84mZmklk.js → vi-D2p-h6bY.js} +1 -1
- package/dist/assets/{zh-CN-DD1reegJ.js → zh-CN-DHOKqAit.js} +1 -1
- package/dist/assets/{zh-HK-B05u30WI.js → zh-HK-D4iIPY7I.js} +1 -1
- package/dist/assets/{zh-TW-Bb-WimPD.js → zh-TW-gORQ_tZh.js} +1 -1
- package/dist/chunk-membership.json +100 -90
- package/dist/eager-closure.json +110 -110
- package/dist/index.html +4 -4
- package/dist/sdui.manifest.json +520 -60
- package/package.json +1 -1
- package/dist/assets/AppDocsIndex-F4zDq2zz.js +0 -1
- package/dist/assets/ApprovalsInboxPage-DrEUmaDb.js +0 -1
- package/dist/assets/AuditLogPage-CoghqsZb.js +0 -1
- package/dist/assets/DashboardView-CGC-_Om8.js +0 -1
- package/dist/assets/DocPage-CIZE5kdj.js +0 -1
- package/dist/assets/DocsSlug-DXdFdwlS.js +0 -1
- package/dist/assets/ExpressionProvider-DZfMwyMs.js +0 -1
- package/dist/assets/MarketplacePackagePage-C7NOu2Ir.js +0 -4
- package/dist/assets/PageView-CVLgCRSF.js +0 -1
- package/dist/assets/RecordDetailView-DQKydU7X.js +0 -3
- package/dist/assets/RecordFormPage-BTjwxJIA.js +0 -1
- package/dist/assets/ReportDefaultInspector-DdsQAkd7.js +0 -1
- package/dist/assets/SchemaForm-C8X1ve4p.js +0 -3
- package/dist/assets/SearchResultsPage-Jwhqsdyo.js +0 -1
- package/dist/assets/SettingsView-D8SMKdrc.js +0 -1
- package/dist/assets/appRoute-DbnWDEa1.js +0 -1
- package/dist/assets/data-adapter-DMbe6Njk.js +0 -1
- package/dist/assets/default-inspector-registry-CpL3fFhl.js +0 -1
- package/dist/assets/dist-BXrEV1ag.js +0 -13
- package/dist/assets/en-AU-C6x7mDhH.js +0 -1
- package/dist/assets/en-GB-0-nho2eK.js +0 -1
- package/dist/assets/en-IE-2fC3BkfV.js +0 -1
- package/dist/assets/en-IN-C1QcFhxn.js +0 -1
- package/dist/assets/en-NZ-C80ptZT7.js +0 -1
- package/dist/assets/en-ZA-ByZDrjeb.js +0 -1
- package/dist/assets/framework-DcWkeiND.js +0 -35
- package/dist/assets/getIcon-BEVyC4y3.js +0 -1
- package/dist/assets/i18n-CEKxYdmD.js +0 -9
- package/dist/assets/i18n-locale-ar-DN7sl3GF.js +0 -4
- package/dist/assets/i18n-locale-de-C40JErvb.js +0 -4
- package/dist/assets/i18n-locale-en-CITPDIHy.js +0 -4
- package/dist/assets/i18n-locale-es-C8DdWN6c.js +0 -4
- package/dist/assets/i18n-locale-fr-COIdEZZl.js +0 -4
- package/dist/assets/i18n-locale-ja-DYF_rU_s.js +0 -4
- package/dist/assets/i18n-locale-ko-B-ODYAtX.js +0 -4
- package/dist/assets/i18n-locale-pt-CK1SyBIm.js +0 -4
- package/dist/assets/i18n-locale-ru-jLzvShMO.js +0 -4
- package/dist/assets/i18n-locale-zh-Bf9Gbbvl.js +0 -4
- package/dist/assets/index-CLyvpiGc.css +0 -2
- package/dist/assets/index-CfnfGw5W.js +0 -20
- package/dist/assets/isSameWeek-DWYeNyh8.js +0 -1
- package/dist/assets/mermaid-GHXKKRXX-DVLc_uym.js +0 -1
- package/dist/assets/metadata-admin-CybaOCdO.js +0 -9
- package/dist/assets/nav-selection-Dzm_mA3C.js +0 -1
- package/dist/assets/plugin-calendar-CKRBcML7.js +0 -1
- package/dist/assets/plugin-charts-DGTJxXCB.js +0 -7
- package/dist/assets/plugin-chatbot-DwtwNA-y.js +0 -122
- package/dist/assets/plugin-dashboard-C1AYKmGX.js +0 -6
- package/dist/assets/plugin-form-CV8ZY04-.js +0 -1
- package/dist/assets/plugin-gantt-BRIb2_8G.js +0 -63
- package/dist/assets/plugin-grid-C9h7mRVv.js +0 -11
- package/dist/assets/plugin-kanban-BcJ0Dhys.js +0 -1
- package/dist/assets/plugin-map-D24ZUOUj.js +0 -1
- package/dist/assets/plugin-report-BfGintAq.js +0 -59
- package/dist/assets/plugin-timeline-CbBRq_qt.js +0 -1
- package/dist/assets/plugin-tree-BNX2A5J5.js +0 -1
- package/dist/assets/plugin-view-DzWQWYyH.js +0 -1
- package/dist/assets/plugins-views-DraK4xz0.js +0 -3
- package/dist/assets/src-B8lv0plz.js +0 -18
- package/dist/assets/src-DoDvT77T.js +0 -1
- package/dist/assets/types-zod-Y2RwUUeJ.js +0 -1
- package/dist/assets/ui-components-BTB1NkUW.js +0 -37
- package/dist/assets/ui-layout-bZfafwJa.js +0 -1
- package/dist/assets/use-book-data-C3eyZJSG.js +0 -1
- package/dist/assets/vendor-objectstack-XuWC71M9.js +0 -266
- package/dist/assets/vendor-zod-CHLW1iCr.js +0 -64
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n,v as r}from"./vendor-react-BggL7APJ.js";import{An as i,At as a,Ci as o,Hn as s,Ht as c,In as l,On as u,Pi as d,Pt as f,Ri as p,Sn as m,Ti as h,Ut as g,Vi as _,Zt as v,_i as y,bn as b,fr as x,ft as S,gi as C,jn as w,kn as ee,lt as te,nn as ne,on as re,ot as ie,pr as ae,qn as oe,qt as se,vn as T,yi as ce,zt as le}from"./vendor-objectstack-DFqu45yM.js";import{t as ue}from"./i18n-locale-en-rxr7WJYl.js";import{f as de,o as fe,p as pe,w as me}from"./i18n-runtime-97_bDVjP.js";import{n as he}from"./data-adapter-Cymvlczj.js";T();function ge(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}T();var E=class extends Error{code=`INVALID_FILTER`;httpStatus=400;operator;field;constructor(e,t){super(e),this.name=`FilterOperatorError`,this.operator=t?.operator,this.field=t?.field}};function _e(e){return e.operator??e.field??void 0}var ve={$notin:`$nin`,$notcontains:`$notContains`,$startswith:`$startsWith`,$endswith:`$endsWith`};function ye(e){return{$eq:`=`,$ne:`!=`,$gt:`>`,$gte:`>=`,$lt:`<`,$lte:`<=`,$in:`in`,$nin:`nin`,$between:`between`,$contains:`contains`,$notContains:`notcontains`,$startsWith:`startswith`,$endsWith:`endswith`,$icontains:`icontains`}[e]||null}var be={$and:`and`,$or:`or`};function xe(e,t,n){if(!Array.isArray(n))throw new E(`[ObjectUI] The '${e}' filter combinator takes an ARRAY of conditions. Received ${typeof n==`object`?`an object`:typeof n}: ${JSON.stringify(n)}. Spec: FilterCondition declares '${e}?: FilterCondition[]' (data/filter.zod.ts).`,{operator:e});if(n.length===0)return t===`and`?void 0:Se(e,n);let r=[],i=!1;for(let a of n){if(typeof a!=`object`||!a||Array.isArray(a))throw new E(`[ObjectUI] Every member of '${e}' must be a filter condition OBJECT. Received ${JSON.stringify(a)}. Spec: FilterCondition declares '${e}?: FilterCondition[]' (data/filter.zod.ts).`,{operator:e});let n=De(a);if(!Array.isArray(n)){t===`or`&&(i=!0);continue}r.push(n)}if(!i&&r.length!==0)return[t,...r]}function Se(e,t){return[e,`=`,t]}function Ce(e){let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function we(e){let t,n;try{t=Object.getPrototypeOf(e)?.constructor?.name}catch{t=void 0}if(typeof t!=`string`||t===``)return`an object of an unrecognised type`;try{n=String(e)}catch{n=void 0}return n&&n!==`[object ${t}]`?`a ${t} instance (${n})`:`a ${t} instance`}function Te(e,t,n){throw new E(`[ObjectUI] The ${oe(e,t,n)}. It is refused here rather than lowered onto the wire (objectui#9001; ported from ValueDataSource's refuseTextComparand, objectui#8748).`,{operator:t,field:e})}function Ee(e){throw new E(`[ObjectUI] The filter on field '${e}' is an EMPTY operator map — { ${e}: {} } names the field and no operator. It cannot be lowered: the ObjectQL filter AST has no node for a field with zero operators, and '@objectstack/spec' ruled the shape REJECTED wherever it appears (objectstack#5240, recorded on FilterConditionSchema). It is refused here rather than dropped: beside a key that lowers, the '${e}' condition used to vanish from the filter and silently WIDEN the result set (objectui#10788), and alone it was handed back as the caller's object, which reached the wire as ?${e}=[object Object] on one route and as a filter the server refuses on the other (objectui#9164). Choose an operator — { ${e}: { $eq: ... } }, { ${e}: { $in: [...] } }, { ${e}: { $null: true } } — or remove the key.`,{field:e})}function De(e){let t=[],n=0,r=0;for(let[o,s]of Object.entries(e)){if(s==null){r+=1;continue}let e=be[o];if(e){let r=xe(o,e,s);r===void 0?n+=1:t.push(r);continue}if(o===`$not`)throw new E(`[ObjectUI] The '\$not' filter combinator cannot be lowered to the ObjectQL filter AST. '@objectstack/spec' declares it on FilterCondition, but the AST this layer emits has no negation keyword (FILTER_ARRAY_LOGIC_KEYWORDS is ['and', 'or']), and rewriting the negation inward is not available either — 'startswith', 'endswith', 'between' and 'icontains' have no negated counterpart in VALID_AST_OPERATORS, so the rewrite would be silently partial. Express the negation with a negated operator instead (\$ne, \$nin, \$notContains); note those follow each operator's own answer for a missing value rather than \$not's NULL-safe rule (objectstack#5146). Value: ${JSON.stringify(s)}.`,{operator:`$not`});if(Array.isArray(s))throw new E(`[ObjectUI] The filter on field '${o}' carries a bare ARRAY as its equality comparand: ${JSON.stringify(s)}. It cannot be lowered: the ObjectQL filter AST has no array-equality node, so the lowered node [${o}, '=', [...]] is refused by @objectstack/driver-sql (400 INVALID_FILTER) and matches no row in the in-memory matchers — it can never select anything. It is deliberately NOT read as membership here: { ${o}: [...] } and { ${o}: { $in: [...] } } are different statements, and guessing the second from the first would silently change which rows a stored view returns (objectui#8530; the same ruling objectui#8514 applied one layer down). Spell membership as { ${o}: { $in: [...] } }, its negation as { ${o}: { $nin: [...] } }, or a range as { ${o}: { $between: [min, max] } }.`,{field:o});if(typeof s==`object`&&!Array.isArray(s)){if(b(s)){t.push([o,`=`,s]);continue}if(!Ce(s))throw new E(`[ObjectUI] The filter on field '${o}' carries ${we(s)} in comparand position. '@objectstack/spec' does not accept it: a comparison value must be ${a} (ACCEPTED_FILTER_COMPARAND_TYPES), so isAcceptedFilterComparand is false for it and normalizeFilterComparandTypes answers 400 INVALID_FILTER — "which no driver can compare". It is not an operator map either: only a plain object can be one, so until objectui#8567 this value was read as ZERO operators and the '${o}' condition was dropped from the filter entirely, silently WIDENING the result set. Spell a text match as { ${o}: { $contains: '...' } } ($startsWith / $endsWith; a pattern itself has no operator here, see the $regex refusal), a membership test as { ${o}: { $in: [...] } }, and a date bound as { ${o}: { $gte: new Date(...) } }.`,{field:o});let e=Object.entries(s);e.length===0&&Ee(o);for(let[n,r]of e){if(n===`$regex`)throw new E(`[ObjectUI] The '\$regex' filter operator is not supported. It used to be converted to 'contains', which matches a literal substring rather than a pattern — a different result, not a degraded one. Field: '${o}', Value: ${JSON.stringify(r)}. Use $contains for a case-sensitive substring, $icontains for a case-insensitive one, or $startsWith / $endsWith.`,{operator:`$regex`,field:o});if(n===`$null`){t.push([o,r?`is_null`:`is_not_null`,!0]);continue}if(n===`$exists`){t.push([o,r?`is_not_null`:`is_null`,!0]);continue}let e=ye(n);if(e)e===`icontains`&&i(r)&&Te(o,n,r),t.push([o,e,r]);else{let e=ve[n];throw e?new E(`[ObjectUI] The '${n}' filter operator is retired. Write '${e}' instead — the canonical spelling '@objectstack/spec' declares in FILTER_OPERATORS (data/filter.zod.ts). The operator itself is unchanged; only the key is renamed. Field: '${o}', Value: ${JSON.stringify(r)}. It used to be accepted here as a lowercase alias while the in-memory matcher refused it, so the same filter selected rows through one data source and none through the other (objectui#8568).`,{operator:n,field:o}):new E(`[ObjectUI] Unknown filter operator '${n}' for field '${o}'. Supported operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $between, $contains, $notContains, $startsWith, $endsWith, $icontains, $null, $exists. If you need exact object matching, use the value directly without an operator.`,{operator:n,field:o})}}}else t.push([o,`=`,s])}if(t.length===0){let t=Object.keys(e).length-r;return n>0&&n===t||r>0&&r===Object.keys(e).length?void 0:e}return t.length===1?t[0]:[`and`,...t]}function Oe(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e.field;return typeof t==`string`&&t!==``}var ke=new Set([...C,...ce]),Ae=new Set([`is_empty`,`is_not_empty`,`is_null`,`is_not_null`]),je=new Set(y);function Me(e){let t=p(e.operator);if(Array.isArray(e.value)&&typeof t==`string`&&je.has(t)&&!ke.has(t)&&!Ae.has(t))throw new E(`[ObjectUI] The stored view rule on field '${e.field}' carries an ARRAY as the comparand of '${t}', which takes a single value: ${JSON.stringify(e.value)}. It cannot be lowered: the ObjectQL filter AST has no array-equality node, so the lowered node [${e.field}, '${t}', [...]] is refused by @objectstack/driver-sql (400 INVALID_FILTER) and matches no row in the in-memory matchers — it can never select anything. It is deliberately NOT rewritten to 'in': that would change what the saved view means, and 'in' is already spellable in the rule itself. Spell membership as { field: '${e.field}', operator: 'in', value: [...] }, its negation as 'not_in', or a range as { operator: 'between', value: [min, max] } — the three operators the spec declares array-valued, which are untouched (objectui#8557; the same ruling objectui#8530 applied to the object arm).`,{operator:t,field:e.field});if(t===`icontains`&&e.value!==void 0&&i(e.value)){let n=typeof e.operator==`string`&&e.operator!==``?e.operator:t,r=`This is a STORED VIEW rule, so it is refused as the filter is BUILT rather than lowered onto the wire: the spelling @objectstack/spec's FILTER_TEXT_CASES uses for this operator is the \$-dialect '\$icontains', which this vocabulary spells '${n}'. Remove the condition from the view, or give it a non-empty string comparand (objectui#9048; the same refusal ValueDataSource and convertFiltersToAST already share).`;throw new E(`[ObjectUI] The ${oe(e.field,n,e.value)}. ${r}`,{operator:n,field:e.field})}return e.value===void 0?[e.field,t]:[e.field,t,e.value]}function Ne(e){if(e==null)return;if(Array.isArray(e))return e.length===0?void 0:e.some(Oe)?e.map(e=>Oe(e)?Me(e):e):e;if(typeof e!=`object`)return;let t=e;if(Object.keys(t).length!==0)return De(t)}function Pe(e){try{return{ok:!0,node:Ne(e)}}catch(e){if(e instanceof E)return{ok:!1,refusal:e};throw e}}function Fe(...e){let t=e.map(Ne).filter(e=>e!==void 0);if(t.length!==0)return t.length===1?t[0]:[`and`,...t]}var D=e(r(),1);function Ie(e,t,n){if(!e)return;let r=e=>t.includes(e);if(r(e))return e;let i=`${n}.`;if(!e.includes(`.`)&&r(i+e))return i+e;if(e.startsWith(i)&&r(e.slice(i.length)))return e.slice(i.length)}var Le=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function Re(e){if(!Le(e)||typeof e.find==`function`)return!1;let t=e.object;return typeof t==`string`&&t.length>0}function ze(...e){let t={};for(let n of e)if(Array.isArray(n))for(let e of n){if(!Le(e))continue;let n=e.name??e.id;typeof n==`string`&&n&&(t[n]=e)}else if(Le(n))for(let[e,r]of Object.entries(n))Le(r)&&(t[e]=r);return t}function Be(e,t,n){let r=Ie(t,Object.keys(e),n);return r===void 0?void 0:e[r]}function Ve(e){return typeof e==`number`&&Number.isInteger(e)&&e>0}function He(e){if(!e)return;let t=e.pagination;return Le(t)&&typeof t.pageSize==`number`?t.pageSize:typeof e.limit==`number`?e.limit:void 0}function Ue(e){let t=He(e);return Ve(t)?t:void 0}function We(e){return Ve(e.limit)?e.limit:void 0}function Ge(e,t,n){let r=e?.limit;return r==null||Ve(r)?null:`[ObjectUI] ElementDataSource: the ${t?`dataSource binding on ${n} (view "${t}")`:`dataSource binding on ${n}`} declares \`limit: ${String(typeof r==`number`?r:JSON.stringify(r))}\`, which is not a positive integer. A row cap must be a positive integer (the spec declares this binding’s \`limit\` positive), so the binding’s cap was treated as not authored and ignored, exactly as if the binding declared no \`limit\`: the cap comes from the next source that declares a usable one, or else from the consumer’s own default.`}function Ke(e,t,n,r,i=`view`){if(i===`binding`)return Ge(r,t,n);if(Ve(r?.limit))return null;let a=He(e);return a===void 0||Ve(a)?null:`[ObjectUI] ElementDataSource: ${t?`saved view "${t}" on ${n}`:`saved view on ${n}`} declares a row cap of ${String(a)}, which is not a positive integer. A row cap must be a positive integer (the spec declares this binding’s \`limit\` positive, and refuses a zero or negative \`pagination.pageSize\`), so the view’s cap was ignored and no cap was lowered from it — the consuming block uses its own default.`}function qe(e){if(!e)return;let t=e.type??e.viewType;return typeof t==`string`&&t?t:void 0}function Je(e){if(e){if(Array.isArray(e.columns))return e.columns;if(Array.isArray(e.fields))return e.fields}}function Ye(e,t){let n={object:e.object},r=Je(t);r!==void 0&&(n.columns=r);let i=t?.filter,a=i!==void 0&&e.filter!==void 0?Fe(i,e.filter):e.filter??i;a!==void 0&&(n.filter=a);let o=e.sort??t?.sort;o!==void 0&&(n.sort=o);let s=We(e)??Ue(t);s!==void 0&&(n.limit=s);let c=qe(t);return c!==void 0&&(n.viewType=c),n}function Xe(e,t,n){return`dataSource.view "${t}" was not found on object "${e}". ${n.length?`Known views: ${[...n].sort().join(`, `)}.`:`No saved views are known for this object. It may have none, or they could not be read.`}`}var Ze=`dataSource`,Qe={name:Ze,type:`object`,binding:`object`,description:"Per-element data binding: { object, view, filter, sort, limit }. Overrides the page-level object context for this block; `view` names a saved view of `object`, and `filter` is ANDed with the view’s own rather than replacing it."},$e=new WeakSet;function et(e){return e&&(typeof e==`object`||typeof e==`function`)&&$e.add(e),e}function tt(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&$e.has(e)}var nt=`object-grid.list-view.object-form.embeddable-form.object-master-detail-form.object-kanban.object-calendar.object-gantt.object-timeline.object-map.object-tree.object-metric.object-chart.dashboard.object-pivot.record:details.record:highlights.record:related_list.record:path.record:line_items.record:activity.record:discussion.record:history.record:quick_actions.record:reference_rail.record:alert.page:tabs.page:card.page:accordion.page:section.page:footer.page:sidebar.element:text.element:number.element:button.element:definition-list.element:repeater.action:button.action:group.action:menu.action:icon.flex.grid.stack.card.tabs.accordion.container.box.page:header.text.image.icon.markdown.element:divider.badge.alert.button.html`.split(`.`);new Set(nt);var rt=`h1.h2.h3.h4.h5.h6.p.a.blockquote.pre.code.strong.em.b.i.u.small.mark.sub.sup.del.ins.abbr.ul.ol.li.dl.dt.dd.figure.figcaption.img.hr.br.time.address.cite.q.span.table.label.aside.main.header.nav.footer.section.article`.split(`.`);new Set(rt);function it(e,t){return t.meta?.namespace?`${t.meta.namespace}:${e}`:e}function at(e,t){if(!tt(e))return t;let n=t?.inputs??[];if(n.some(e=>e?.name===Qe.name))return t;let r={...Qe};return{...t??{},inputs:[...n,r]}}var ot=class{components=new Map;lazyEntries=new Map;listeners=new Set;version=0;register(e,t,n){let r=n?.namespace?`${n.namespace}:${e}`:e,i=at(t,n);if(n?.namespace||console.warn(`Registering component "${e}" without a namespace is deprecated. Please provide a namespace in the meta parameter.\n\n Migration:\n // Before (deprecated):\n registry.register('${e}', MyComponent);\n\n // After:\n registry.register('${e}', MyComponent, { namespace: 'my-plugin' });\n\n See: https://www.objectui.org/docs/guide/plugin-development#namespaced-registration`),this.components.has(r),this.components.set(r,{type:r,component:t,...i}),n?.namespace&&!n?.skipFallback){let n=this.components.get(e);if(n&&n.component!==t&&n.type!==r)console.warn(`Component "${e}" bare-name fallback is being overwritten by "${r}". If this is intentional keep going; otherwise register "${r}" with { skipFallback: true } so it doesn't claim the bare "${e}" key.`);else if(!n){let t=this.lazyEntries.get(e),n=t?it(e,t):void 0;n&&n!==r&&console.warn(`Component "${e}" bare-name fallback is being overwritten by "${r}", which a pending lazy stub already claims for "${n}". Which one an authored "${e}" node resolves to depends on whether that chunk has loaded. If this is intentional keep going; otherwise register "${r}" with { skipFallback: true } so it doesn't claim the bare "${e}" key — that opt-out settles it, because the bare "${e}" key is then left with "${n}".`)}this.components.set(e,{type:r,component:t,...i}),this.lazyEntries.delete(e)}this.lazyEntries.delete(r),this.notify()}unregister(e,t){let n=t?`${t}:${e}`:e,r=this.components.delete(n);if(t){let t=this.components.get(e);t&&t.type===n&&this.components.delete(e)}if(this.lazyEntries.delete(n),t){let t=this.lazyEntries.get(e);t&&it(e,t)===n&&this.lazyEntries.delete(e)}return r&&this.notify(),r}registerLazy(e,t,n){let r=n?.namespace?`${n.namespace}:${e}`:e,i={loader:t,meta:n};if(this.lazyEntries.set(r,i),n?.namespace&&!n?.skipFallback){let t=this.components.get(e),n=t?void 0:this.lazyEntries.get(e),a=t?t.type:n?it(e,n):void 0;a&&a!==r&&console.warn(`Lazy component "${e}" bare-name fallback is being overwritten by "${r}", which ${t?`a loaded registration`:`another pending stub`} already claims for "${a}". If this is intentional keep going; otherwise register "${r}" with { skipFallback: true } so it doesn't claim the bare "${e}" key — that opt-out settles it, because the stub then claims only "${r}".`),this.lazyEntries.set(e,i)}this.version++}hasLazy(e,t){return t?this.lazyEntries.has(`${t}:${e}`):this.lazyEntries.has(e)}loadLazy(e,t){let n=t?`${t}:${e}`:e,r=this.lazyEntries.get(n);if(r)return r.pending||=r.loader().catch(e=>{throw r.pending=void 0,e}),r.pending}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){this.version++;for(let e of this.listeners)try{e()}catch(e){console.error(`[Registry] listener error`,e)}}getVersion(){return this.version}get(e,t){if(t){let n=`${t}:${e}`;return this.components.get(n)?.component}return this.components.get(e)?.component}getConfig(e,t){if(t){let n=`${t}:${e}`;return this.components.get(n)}return this.components.get(e)}has(e,t){if(t){let n=`${t}:${e}`;return this.components.has(n)}return this.components.has(e)}getAllTypes(){return Array.from(this.components.keys())}getKnownTypes(){return Array.from(new Set([...this.components.keys(),...this.lazyEntries.keys()]))}getMeta(e,t){let n=t?`${t}:${e}`:e;return this.components.get(n)??this.lazyEntries.get(n)?.meta}deprecationFor(e,t,n){let r=this.getMeta(e,n)?.deprecated;if(r)return r.surfaces.includes(t)?r:void 0}getAllConfigs(){return Array.from(this.components.values())}getContractConfig(e){let t=this.components.get(e);if(t)return t;let n=this.lazyEntries.get(e);if(!n)return;let r=n.meta?.namespace,i=r&&!e.startsWith(`${r}:`)?`${r}:${e}`:e;return{...n.meta,type:i,lazy:!0}}getPublicConfigs(){let e=new Set,t=[],n=(n,r)=>{r&&!e.has(r.type)&&(e.add(r.type),t.push({...r,type:n}))};for(let e of nt)n(e,this.getContractConfig(e));for(let[e,t]of this.components.entries())t.tier===`public`&&!e.includes(`:`)&&n(e,t);for(let[e,t]of this.lazyEntries.entries())t.meta?.tier===`public`&&!e.includes(`:`)&&n(e,this.getContractConfig(e));for(let e of rt){let t=this.getContractConfig(e);t&&n(e,{...t,tier:`html`})}return t}getNamespaceComponents(e){return Array.from(this.components.values()).filter(t=>t.namespace===e)}},O=new ot;function st(e){return e==null||typeof e==`string`&&e.trim()===``||Array.isArray(e)&&e.length===0}T();function ct(e){return typeof e==`object`&&!!e&&typeof e.dialect==`string`&&typeof e.source==`string`}function lt(e){return w(e)||ct(e)}function ut(e,t){return t?lt(e?.field?.defaultValue):!1}function dt(e){return e.includes("${")?e:`\${${e}}`}function ft(e){if(e!=null&&e!==``){if(typeof e==`boolean`)return e;if(typeof e==`string`)return dt(e);if(typeof e==`object`&&typeof e.source==`string`){let t=e.source;return t?e.dialect===`cel`?{dialect:`cel`,source:t}:dt(t):void 0}}}var pt=Symbol.for(`@object-ui/core:subject-permissions`);function mt(e,t){if(t===void 0){if(!Object.prototype.hasOwnProperty.call(e,pt))return e;let t={...e};return delete t[pt],t}return{...e,[pt]:t}}function ht(e){if(typeof e==`object`&&e)return e[pt]}function gt(e){return typeof e==`string`?{dialect:`cel`,source:e}:{dialect:e.dialect??`cel`,source:e.source}}var _t=new Set,vt=`[blank] the predicate is declared but empty — nothing to evaluate`;function yt(e,t,n,r){let i=e.source?.trim()?JSON.stringify([e.dialect,e.source]):JSON.stringify([e.dialect,e.source,r??``]);_t.has(i)||(_t.add(i),console.warn(`[object-ui] A conditional predicate failed to evaluate`+(r?` (${r})`:``)+` and was treated as its safe default (${String(t)}): `+JSON.stringify(e.source)+`. Reason: ${n}. Values are bound under 'record.' (e.g. record.status) — check the field names and CEL syntax.`))}function k(e,t,n,r,i,a){if(e==null)return n;let o=gt(e),s,c=n;if(A(e))s=vt;else try{let e=ht(i?.current_user),n=ie.evaluate(o,{record:t,previous:r,...i?{extra:i}:{},...e===void 0?{}:{permissions:e}});n.ok?c=n.value===!0:s=`[${n.error.kind}] ${n.error.message}`}catch(e){s=`[throw] ${e instanceof Error?e.message:String(e)}`}return s===void 0?c:(a?.warn!==!1&&yt(o,n,s,a?.context),a?.onFault?.(s),n)}var bt=!0,xt=!1,St=!1,Ct=!0,wt=!1,Tt=!1;function Et(e,t,n,r,i,a){let o={},s=e=>({context:a?`${e} of ${a}`:e,onFault:t=>{o[e]=t}});return{visible:e.visibleWhen==null?Ct:k(e.visibleWhen,t,bt,r,i,s(`visibleWhen`)),readonly:n.readonly===!0||(e.readonlyWhen==null?wt:k(e.readonlyWhen,t,xt,r,i,s(`readonlyWhen`))),required:n.serverOwnedValue===!0?!1:n.required===!0||(e.requiredWhen==null?Tt:k(e.requiredWhen,t,St,r,i,s(`requiredWhen`))),faults:o}}function A(e){if(typeof e==`string`)return e.trim()===``;if(typeof e==`object`&&e){let t=e.source;if(typeof t==`string`)return t.trim()===``}return!1}function j(e){return A(e)?(Dt(e),!1):ft(e)!==void 0}function Dt(e){k(e,{},!1,void 0,void 0,{context:`a declared gate, read as no gate`})}function Ot(e){return{required:!1,validate:e=>typeof e==`boolean`||j(e),message:`${e} must be a boolean or a declared predicate: an expression string (bare, e.g. "record.stage == 'closed'", or the "\${...}" template spelling), or a { dialect, source } expression envelope`}}var kt={type:{required:!0,validate:e=>typeof e==`string`&&e.length>0,message:`type must be a non-empty string`},id:{required:!1,validate:e=>typeof e==`string`,message:`id must be a string`},className:{required:!1,validate:e=>typeof e==`string`,message:`className must be a string`},visible:Ot(`visible`),disabled:Ot(`disabled`)};function At(e){return!!e&&typeof e==`object`}function jt(e,t=`schema`){let n=[];return Object.entries(kt).forEach(([r,i])=>{let a=e[r];i.required&&a===void 0&&n.push({path:`${t}.${r}`,message:`${r} is required`,type:`error`,code:`MISSING_REQUIRED`}),a!==void 0&&!i.validate(a)&&n.push({path:`${t}.${r}`,message:i.message,type:`error`,code:`INVALID_TYPE`})}),n}var Mt=Object.freeze({crud:'Node type `crud` was RETIRED (objectui#5373, ADR-0049 enforce-or-remove). `CRUDSchema` declared it in four places and no renderer ever registered it, so a node spelling it painted the OBJUI-001 "Unknown component type" panel. Compose the shapes that DO render instead: `object-grid` for the record table with its toolbar, filters, pagination and row/batch actions, `object-form` for the create/edit form, and `detail` for the record view.'});function Nt(e,t=`schema`){let n=e.type;return typeof n!=`string`||!Object.prototype.hasOwnProperty.call(Mt,n)?[]:[{path:`${t}.type`,message:Mt[n],type:`error`,code:`RETIRED_TYPE`}]}var Pt=`field:`;function Ft(e){let t=e.widget??e.type;return typeof t==`string`?t:void 0}function It(e,t){let n=Ft(e);if(n&&n.includes(`:`)&&!n.startsWith(Pt))return{path:`${t}.${typeof e.widget==`string`?`widget`:`type`}`,message:`'${n}' is not a form field widget: a namespaced field widget id must name the \`field:\` namespace (objectui#5254), so this id resolves NOTHING on the field path and the renderer would fall through to a plain text box — putting a secret on screen in clear text when the field holds one (objectui#5375). Write the built-in spelling (e.g. \`password\`), or the field widget id \`field:${n.slice(n.indexOf(`:`)+1)}\`. Resolving in the registry is not proof it resolves HERE — \`ui:password\` is a registered SDUI node renderer and still renders clear text as a field.`,type:`error`,code:`UNRESOLVABLE_FIELD_WIDGET_NAMESPACE`}}function Lt(e,t=`schema`){let n=[];if(e.type===`form`){let r=e.fields;Array.isArray(r)&&r.forEach((e,i)=>{let a=At(e)?e:{};a.name||n.push({path:`${t}.fields[${i}]`,message:`Form field requires name property`,type:`error`,code:`MISSING_FIELD_NAME`});let o=It(a,`${t}.fields[${i}]`);o&&n.push(o),r.filter(e=>(At(e)?e.name:void 0)===a.name).length>1&&n.push({path:`${t}.fields[${i}]`,message:`Duplicate field name: ${String(a.name)}`,type:`warning`,code:`DUPLICATE_FIELD_NAME`})})}return n}function Rt(e,t=`schema`){let n=[],r=e.children;if(r){if(Array.isArray(r))r.forEach((e,r)=>{if(At(e)){let i=zt(e,`${t}.children[${r}]`);n.push(...i.errors,...i.warnings)}});else if(At(r)){let e=zt(r,`${t}.children`);n.push(...e.errors,...e.warnings)}}return n}function zt(e,t=`schema`){let n=[];At(e)?(n.push(...jt(e,t)),n.push(...Nt(e,t)),n.push(...Lt(e,t)),n.push(...Rt(e,t))):n.push({path:t,message:`Schema must be an object`,type:`error`,code:`INVALID_SCHEMA`});let r=n.filter(e=>e.type===`error`),i=n.filter(e=>e.type===`warning`);return{valid:r.length===0,errors:r,warnings:i}}var Bt=[`id`,`className`,`role`,`tabIndex`,`autoFocus`,`onClick`,`onBlur`,`onFocus`];function Vt(e){return e.startsWith(`data-`)||e.startsWith(`aria-`)}function Ht(e,t){let n=new Set(t),r={};for(let t of Object.keys(e))(n.has(t)||Vt(t))&&(r[t]=e[t]);return r}function Ut(e){return Ht(e,Bt)}T();function Wt(e,t){if(e==null)return{enabled:t};if(typeof e==`boolean`)return{enabled:e};let n=e.enabled??t;if(e.visibleWhen==null&&e.disabledWhen==null)return{enabled:n};let r={};return e.visibleWhen!=null&&(r.visibleWhen=e.visibleWhen),e.disabledWhen!=null&&(r.disabledWhen=e.disabledWhen),{enabled:n,predicates:r}}function Gt(e){return Wt(e,!1).predicates}var Kt={create:`create`,import:`import`,edit:`update`,delete:`delete`,exportCsv:`export`};function qt(e,t){let n=s({managedBy:e?.managedBy??void 0,userActions:e?.userActions??void 0});if(Array.isArray(t)){let e=new Set(t);for(let[t,r]of Object.entries(Kt))n[t]&&!e.has(r)&&(n[t]=!1)}return n}function Jt(e,t){return qt(e,t).edit}function Yt(e){if(Array.isArray(e))return e;if(e&&typeof e==`object`){if(Array.isArray(e.data))return e.data;if(Array.isArray(e.value))return e.value}return[]}var Xt=2e3;function Zt(){return{$top:2001}}function Qt(e){let t=Yt(e),n=e&&typeof e==`object`&&typeof e.total==`number`?e.total:void 0,r=t.length>Xt;return{rows:r?t.slice(0,Xt):t,total:n,truncated:r}}function $t(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var M=`field`,en=[`name`,`fieldName`],tn=e=>!!e&&typeof e==`object`&&!Array.isArray(e),nn=e=>typeof e==`string`&&e.length>0?e:void 0;function rn(e){if(typeof e==`string`)return nn(e);if(!tn(e))return;let t=nn(e[M]);if(t)return t;for(let t of en){let n=nn(e[t]);if(n)return n}}var an=new Set,on=()=>!1;function sn(e,t,n){if(on()&&n.length!==0)for(let r of n){let n=`${t}:${r}:${String(e[r])}`;an.has(n)||(an.add(n),console.warn(`[ObjectUI] Column carries two identities: \`${M}: '${t}'\` and \`${r}: '${String(e[r])}'\`. \`${M}\` wins — it is the only key \`ListColumnSchema\` declares — and \`${r}\` has been rewritten to match, so the rendered column and the requested field agree. Fix the producer: drop \`${r}\` and author \`${M}\` only. (objectui#3104)`))}}function cn(e){if(typeof e==`string`||!tn(e))return e;let t=rn(e);if(!t)return e;let n=e[M]!==t,r=en.filter(n=>e[n]!==void 0&&e[n]!==t);if(!n&&r.length===0)return e;sn(e,t,r);let i={...e};i[M]=t;for(let e of r)i[e]=t;return i}function ln(e){if(!Array.isArray(e))return e;let t=!1,n=e.map(e=>{let n=cn(e);return n!==e&&(t=!0),n});return t?n:e}var un=`label`,dn=`header`;function fn(e){if(tn(e))return nn(e.header)??nn(e.label)}var pn=new Set([`lookup`,`master_detail`,`tree`,`user`]);function mn(e){return!!e&&typeof e==`object`&&pn.has(e.type)}function hn(e,t){if(!e||typeof e!=`object`)return[];let n=[];for(let[t,r]of Object.entries(e))mn(r)&&n.push(t);if(n.length===0)return[];if(t&&Array.isArray(t)&&t.length>0){let e=new Set;for(let n of t){let t=rn(n);t&&e.add(t)}return n.filter(t=>e.has(t))}return n}var gn=Object.freeze({owner:"[object-ui] Field type `owner` was RETIRED (objectui#4814). It was a synonym for `user` with no behavioral difference, and it is not a member of `@objectstack/spec`'s FieldType. Write the record-owner field as `{ type: 'user', name: 'owner' }` — the field NAME carries the ownership meaning, the type carries the widget. The `widget: 'field:owner'` spelling is retired with it."});function _n(e){return typeof e!=`string`||!e?!1:Object.prototype.hasOwnProperty.call(gn,e)}var vn=new Set;function yn(e){let t=_n(e)?gn[e]:void 0;return t?(vn.has(e)||(vn.add(e),console.error(t)),!0):!1}T();var bn=v;function xn(e){return!!e&&typeof e==`object`&&bn.has(e.type)}var Sn=Symbol.for(`objectui.objectSortability`);function Cn(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e.sortable;if(typeof t!=`boolean`)return;let n=e.reason,r=e.caveat;return{sortable:t,...typeof n==`string`?{reason:n}:{},...typeof r==`string`?{caveat:r}:{}}}function wn(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e.fields;if(!t||typeof t!=`object`||Array.isArray(t))return;let n={};for(let[e,r]of Object.entries(t)){let t=Cn(r);t&&(n[e]=t)}return{fields:n}}function Tn(e,t){let n=wn(t);return!n||!e||typeof e!=`object`||Object.defineProperty(e,Sn,{value:n,enumerable:!1,configurable:!0,writable:!0}),e}function En(e){if(!e||typeof e!=`object`)return;let t=e[Sn];if(!t||typeof t!=`object`)return;let n=t.fields;if(n&&typeof n==`object`&&!Array.isArray(n))return t}function Dn(e,t){if(typeof t!=`string`||t.length===0)return!1;let n=e.fields?.[t];return Cn(n)?.sortable===!0}function On(e,t){return Array.isArray(e)?e.filter(e=>Dn(t,e?.field)):[]}function kn(e,t=0){let n=`migrated_${t}`;return e.type===`separator`?{id:n,type:`separator`}:e.type===`group`?{id:n,type:`group`,...e.label?{label:e.label}:{},icon:e.icon,children:(e.children||[]).map((e,n)=>kn(e,t*100+n)),visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge,defaultOpen:!0}:e.href?{id:n,type:`url`,...e.label?{label:e.label}:{},icon:e.icon,url:e.href,target:`_blank`,visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge}:{id:n,type:`page`,...e.label?{label:e.label}:{},icon:e.icon,pageName:e.path||``,visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge}}function An(e){return/^[a-z][a-z0-9]*(_[a-z0-9]+)*$/.test(e)}function jn(e){return{name:e.name,label:e.title,description:e.description,icon:e.icon,branding:e.branding,navigation:e.navigation}}function Mn(e){if(!e)return null;let t=e.stageField;if(t===!1)return null;if(typeof t==`string`&&t)return t;let n=e.fields||{};for(let e of[`status`,`stage`,`state`,`phase`])if(e in n)return e;for(let[e,t]of Object.entries(n)){let n=(t?.type||``).toLowerCase();if(n===`status`||n===`stage`)return e}return null}function Nn(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=Object.keys(e);if(t.length!==1||t[0]!==`preset`)return!1;let n=e.preset;return typeof n==`string`&&n.length>0}function Pn(e){if(!e||typeof e!=`object`)return e;let t=e.defaultValue;return Nn(t)?{...e,defaultValue:t.preset}:e}function Fn(e){if(!e||typeof e!=`object`)return e;let t=e.globalFilters;if(!Array.isArray(t))return e;let n=!1,r=t.map(e=>{let t=Pn(e);return t!==e&&(n=!0),t});return n?{...e,globalFilters:r}:e}var In=[`text`,`number`,`date`,`datetime`,`currency`,`percent`,`boolean`,`action`],Ln={int:`number`,integer:`number`,float:`number`,double:`number`,"datetime-local":`datetime`};function Rn(e){if(typeof e==`string`)return In.includes(e)?e:Ln[e]}var zn=[`metric-card`],Bn=[`list`,`custom`],Vn=new Set(`id._id.__v._version._rev.created.created_at.createdAt.created_by.createdBy.modified.modified_by.updated_at.updatedAt.updated_by.updatedBy.deleted.deleted_at.deletedAt.is_deleted.instance_state.locked.owner_id.organization_id.tenant_id.company_id.space`.split(`.`)),Hn={createdAt:`created_at`,createdBy:`created_by`,updatedAt:`updated_at`,updatedBy:`updated_by`},Un=new Set(Object.values(Hn));function Wn(e,t){return t?.system===!0||Vn.has(e)}var Gn=[`default`,`blue`,`teal`,`orange`,`purple`,`success`,`warning`,`danger`],Kn=[`metric`,`bar`,`horizontal-bar`,`line`,`pie`,`donut`,`area`,`scatter`,`funnel`,`table`,`pivot`,`list`,`custom`],qn=`text.textarea.number.boolean.date.datetime.time.select.email.phone.url.password.currency.percent.lookup.formula.autonumber.file.image.markdown.html.color.code.location.address.rating.slider`.split(`.`);function Jn(e,t){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.default;if(typeof t==`string`)return t}return t}function Yn(e){let t=(e.values??[]).map(e=>({name:e,label:Jn(void 0,e)})),n=(e.rows??[]).map(e=>({field:e,sort:`asc`}));return{type:`report`,title:Jn(e.label,e.name),description:e.description?Jn(e.description,``):void 0,fields:t,groupBy:n.length>0?n:void 0}}function Xn(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.name!=`string`||t.type===`report`&&Array.isArray(t.fields)?!1:typeof t.dataset==`string`||Array.isArray(t.blocks)||typeof t.type==`string`&&[`tabular`,`summary`,`matrix`,`joined`].includes(t.type)}T();function Zn(e,t){if(!t)return!0;let n=e?.locations;return Array.isArray(n)&&n.includes(t)}var Qn=`an actions array is either all action ids or all inline action objects — mixed id/object action arrays are refused; use all ids or all objects`;function $n(e){return e===null?`null`:Array.isArray(e)?`an array`:`a ${typeof e}`}function er(e){let t=e=>typeof e==`string`?`id`:typeof e==`object`&&e&&!Array.isArray(e)?`object`:null;if(e.length===0)return{kind:`objects`,objects:[]};let n=t(e[0]);for(let r=0;r<e.length;r+=1){let i=e[r],a=t(i);if(a===null)return{kind:`refused`,index:r,message:`element ${r} is ${$n(i)}, which is neither an action id (a string) nor an inline action object; ${Qn}`};if(a!==n)return{kind:`refused`,index:r,message:`element ${r} is ${a===`id`?`an action id`:`an inline action object`} but element 0 is ${n===`id`?`an action id`:`an inline action object`}; an actions array is either all action ids or all inline action objects — mixed id/object action arrays are refused; use all ids or all objects`}}return n===`id`?{kind:`ids`,ids:e}:{kind:`objects`,objects:e}}function tr(e,t){let n=er(e);if(n.kind===`refused`)return n;if(n.kind===`objects`)return{kind:`objects`,actions:Array.from(n.objects)};let r=new Map;for(let e of t??[]){let t=typeof e?.name==`string`?e.name:``;t&&!r.has(t)&&r.set(t,e)}let i=[],a=[];return n.ids.forEach((e,t)=>{let n=r.get(e);n?i.push(n):a.push({index:t,id:e})}),{kind:`ids`,ids:n.ids,actions:i,unresolved:a}}var nr=g.options,rr=[`checkbox`,`reference`,`datetime-local`];function ir(e,t){let n=e?.code;return typeof n!=`string`||n.length===0?!1:n.toUpperCase()===t.toUpperCase()}function ar(e,t){return t.some(t=>ir(e,t))}var or=3e4,sr=new Set([408,425,429,502,503,504]),cr=class extends Error{status;retryAfterMs;constructor(e,t,n){super(n??`Endpoint returned ${e}`),this.status=e,this.retryAfterMs=t,this.name=`HttpFetchError`}};function lr(e){return e instanceof cr?sr.has(e.status):!0}function ur(e,t){if(!e)return;let n=e.trim();if(!n)return;let r;if(/^\d+$/.test(n))r=Number(n)*1e3;else{let e=Date.parse(n);if(Number.isNaN(e))return;r=e-t}if(!(!Number.isFinite(r)||r<0))return Math.min(r,or)}function dr(e,t,n){return n===void 0?Math.min(t*2**e,or):n}var fr=e=>new Promise(t=>setTimeout(t,e));function pr(e){return ur(e.headers?.get?.(`Retry-After`),Date.now())}var mr=Symbol.for(`objectui.inflightGet`);function hr(){let e=globalThis,t=e[mr];if(t)return t;let n=new Map;return e[mr]=n,n}function gr(e){if(!e)return``;let t=[];if(typeof Headers<`u`&&e instanceof Headers)e.forEach((e,n)=>t.push(`${n.toLowerCase()}=${e}`));else if(Array.isArray(e))for(let[n,r]of e)t.push(`${String(n).toLowerCase()}=${String(r)}`);else for(let[n,r]of Object.entries(e))t.push(`${n.toLowerCase()}=${String(r)}`);return t.sort().join(`,`)}function _r(e,t){return`GET\n${t?.credentials??`same-origin`}\n${e}\n${gr(t?.headers)}`}function vr(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}var yr=(e,t)=>fetch(e,t);async function br(e,t,n=yr){let r=t?.method;if(r!==void 0&&r.toUpperCase()!==`GET`)throw TypeError(`sharedGetJson is GET-only; refusing to share a ${r.toUpperCase()} request`);if(t?.signal){let r=await n(e,{...t,method:`GET`});if(!r.ok)throw new cr(r.status,pr(r));return await r.json()}let i=_r(e,t),a=hr(),o=a.get(i);if(o)return vr(await o);let s=(async()=>{let r=await n(e,{...t,method:`GET`});if(!r.ok)throw new cr(r.status,pr(r));return await r.json()})();a.set(i,s);let c=()=>{a.get(i)===s&&a.delete(i)};return s.then(c,c),vr(await s)}var xr=`\0`,Sr=`[-\\u2013\\u2014|/·,:]`,Cr=[`name`,`title`,`subject`,`label`,`full_name`,`display_name`],wr=new Set([`date`,`datetime`,`time`,`number`,`currency`,`percent`,`boolean`,`file`,`image`,`attachment`,`json`,`geolocation`,`select`,`multiselect`,`picklist`,`multipicklist`,`lookup`,`master_detail`,`reference`,`autonumber`,`auto_number`,`phone`]),Tr=new Set([`text`,`string`,`textarea`,`html`]);function Er(e){let t=e.name??e.full_name??e.display_name??e.label??e.title??e.subject??null;return t==null||typeof t==`string`&&!t.trim()?[e.salutation,e.first_name,e.last_name].filter(e=>typeof e==`string`&&e.trim()).map(e=>e.trim()).join(` `)||(typeof e.email==`string`&&e.email.trim()?e.email.trim():null):typeof t==`string`?t:String(t)}function Dr(e,t){let n=typeof e==`string`?e:e&&typeof e==`object`&&typeof e.source==`string`?e.source:void 0;if(!n||!t||typeof t!=`object`)return``;n=n.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,`{$1}`);let r=!1,i=n.replace(/\{([^{}]+)\}/g,(e,n)=>{let i=String(n).trim().split(`.`),a=t;for(let e of i){if(a==null)break;a=a[e]}let o=Lr(a);return o===void 0?xr:(r=!0,o)});if(!r)return``;let a=RegExp(`\\s*${Sr}\\s*${xr}`,`g`),o=RegExp(`${xr}\\s*${Sr}\\s*`,`g`);return i=i.replace(a,``).replace(o,``).replace(new RegExp(xr,`g`),``).replace(/\s+/g,` `).trim(),i}function Or(e){if(!e||typeof e!=`object`)return!1;let t=typeof e.type==`string`?e.type.toLowerCase():void 0;if(!t)return!0;if(t===`formula`){let t=String(e.data_type??e.dataType??e.returnType??e.result_type??``).toLowerCase();return Tr.has(t)}return!wr.has(t)}function kr(e){return e?Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&typeof e.name==`string`).map(e=>[e.name,e]):typeof e==`object`?Object.keys(e).map(t=>[t,e[t]]):[]:[]}var Ar=new WeakMap;function jr(e){let t=kr(e?.fields).filter(([,e])=>Or(e));if(t.length===0)return;for(let e of Cr){let n=t.find(([t])=>t.toLowerCase()===e);if(n)return n[0]}let n=t.find(([e])=>{let t=e.toLowerCase();return t.endsWith(`_name`)||t.endsWith(`_title`)||t.startsWith(`name_`)});return n?n[0]:t[0][0]}function Mr(e){if(typeof e!=`object`||!e)return jr(e);if(Ar.has(e))return Ar.get(e);let t=jr(e);return Ar.set(e,t),t}function Nr(e){return e?.nameField??e?.displayNameField??e?.NAME_FIELD_KEY}function Pr(e){let t=Nr(e);return typeof t==`string`&&t.length>0?t:Mr(e)}function Fr(e,t){let n=Nr(e),r=typeof n==`string`&&n.length>0,i=r?n:Mr(e),a=i?e?.fields?.[i]:void 0;return!i||!a||a.hidden||!r&&Wn(i,a)?t:[i,...t.filter(e=>e!==i)]}var Ir=[`name`,`full_name`,`fullName`,`display_name`,`displayName`,`title`,`subject`,`label`];function N(e,t){if(t&&e&&typeof e==`object`)return Lr(e[t])}function Lr(e){let t=e;if(t&&typeof t==`object`&&(t=Er(t)),t==null)return;let n=typeof t==`string`?t.trim():String(t);return n===``?void 0:n}function Rr(e,t,n){let r=N(t,n?.titleField);if(r)return r;let i=N(t,Nr(e));if(i)return i;if(e?.titleFormat){let n=Dr(e.titleFormat,t);if(n)return n}let a=N(t,Mr(e));if(a)return a;if(n?.deriveFromRecordKeys!==!1&&t&&typeof t==`object`){for(let e of Ir){let n=N(t,e);if(n)return n}for(let e of Object.keys(t)){let n=e.toLowerCase();if(!(n===`id`||n===`_id`||n.endsWith(`_id`)||n.startsWith(`_`))&&(n.endsWith(`_name`)||n.endsWith(`_title`)||n.startsWith(`name_`))){let n=N(t,e);if(n)return n}}}let o=t?.id??t?._id;return o!=null&&String(o).trim()!==``?`Record #${o}`:n?.fallback??`Untitled`}function zr(e,t){if(e==null||e===``)return null;let n=t?.labels;if(typeof e==`string`)return n?.[e]??e;if(typeof e==`number`)return Number.isFinite(e)?n?.[String(e)]??e:null;if(typeof e==`boolean`)return e;if(e instanceof Date){let t=e.getTime();return Number.isNaN(t)?null:t}if(Array.isArray(e)){let n=e.map(e=>zr(e,t)).filter(e=>e!==null).map(e=>String(e));return n.length>0?n.join(`, `):null}if(typeof e==`object`){let t=e,r=t.id??t._id;if(r!=null){let e=n?.[String(r)];if(e)return e}let i=Rr(void 0,t,{fallback:``});return i===``?null:i}return String(e)}function Br(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:typeof e==`number`&&typeof t==`number`?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0})}var Vr=`[{ field: 'name', order: 'desc' }]`,Hr=new Set;function Ur(e,t){return`${e}\n${t}`}function Wr(e){let t=Ur(`scalar`,e);Hr.has(t)||(Hr.add(t),console.error(`[object-ui] convertSortToQueryParams: the legacy string \`sort\` clause is retired (objectui#8221) and was REFUSED — received ${JSON.stringify(e)}, so this query carries no \`$orderby\`. Write the array form instead: sort: ${Vr} — both keys, on every entry. \`order\` is required: on \`SortConfig\`, on its zod counterpart, and on \`@objectstack/spec\`'s \`SortItemSchema\`, which refuses an entry without it. (A missing \`order\` is still read as \`'asc'\` here — that is a runtime tolerance, not permission to omit the key: metadata written that way is refused when it is published.) The array is the only spelling every \`sort\` input declares, and the only one \`@objectstack/spec\` accepts.`))}function Gr(e){let t=Ur(`entry`,e);Hr.has(t)||(Hr.add(t),console.error(`[object-ui] convertSortToQueryParams: a \`sort\` ARRAY ENTRY is the retired string clause (objectui#8221) and was REFUSED — received ${JSON.stringify(e)} as an entry of the \`sort\` array, so that entry orders nothing (and if it was the only usable entry, this query carries no \`$orderby\` at all). The retirement is about the SPELLING, not the container: wrapping the clause in an array does not revive it. Write entry OBJECTS instead: sort: ${Vr} — both keys, on every entry. \`order\` is required: on \`SortConfig\`, on its zod counterpart, and on \`@objectstack/spec\`'s \`SortItemSchema\`, which refuses an entry without it. (A missing \`order\` is still read as \`'asc'\` here — that is a runtime tolerance, not permission to omit the key: metadata written that way is refused when it is published.) The array OF OBJECTS is the only spelling every \`sort\` input declares, and the only one \`@objectstack/spec\` accepts.`))}function Kr(e){if(e){if(typeof e==`string`){Wr(e);return}if(Array.isArray(e)){let t=[];for(let n of e){if(typeof n==`string`){let e=n;e!==``&&Gr(e);continue}n&&typeof n.field==`string`&&n.field!==``&&t.push({field:n.field,order:n.order===`desc`?`desc`:`asc`})}return t.length>0?t:void 0}}}function qr(e){let t=Kr(e);if(!t)return;let n={};for(let e of t)n[e.field]=e.order;return n}var Jr=class e{scopes=[];constructor(e={}){this.scopes.push(new Map(Object.entries(e)))}pushScope(e){this.scopes.push(new Map(Object.entries(e)))}popScope(){this.scopes.length>1&&this.scopes.pop()}get(e){let t=e.split(`.`),n=t[0];for(let e=this.scopes.length-1;e>=0;e--)if(this.scopes[e].has(n)){let r=this.scopes[e].get(n);for(let e=1;e<t.length;e++)if(r&&typeof r==`object`)r=r[t[e]];else return;return r}}set(e,t){this.scopes.length>0&&this.scopes[this.scopes.length-1].set(e,t)}has(e){let t=e.split(`.`)[0];for(let e=this.scopes.length-1;e>=0;e--)if(this.scopes[e].has(t))return!0;return!1}toObject(){let e={};for(let t of this.scopes)for(let[n,r]of t.entries())e[n]=r;return e}createChild(t={}){let n=new e;return n.scopes=[...this.scopes,new Map(Object.entries(t))],n}},Yr={Math,JSON,parseInt,parseFloat,isNaN,isFinite},Xr=new Set([`constructor`,`__proto__`,`prototype`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),Zr=class e{source=``;pos=0;context={};_evaluating=!0;evaluate(e,t){this.source=e.trim(),this.pos=0,this.context={...Yr,...t};let n=this.parseTernary();if(this.skipWhitespace(),this.pos<this.source.length)throw SyntaxError(`Unexpected token "${this.source[this.pos]}" at position ${this.pos} in expression "${e}"`);return n}skipWhitespace(){for(;this.pos<this.source.length&&/\s/.test(this.source[this.pos]);)this.pos++}peek(e=0){return this.source[this.pos+e]??``}consume(){return this.source[this.pos++]??``}withEvaluation(e,t){let n=this._evaluating;this._evaluating=e;try{return t()}finally{this._evaluating=n}}assertSafeProp(e){if(typeof e==`string`&&Xr.has(e))throw TypeError(`Access to property "${e}" is not permitted in expressions`)}parseTernary(){let e=this.parseNullish();if(this.skipWhitespace(),this.peek()===`?`&&this.peek(1)!==`?`){if(this.pos++,this.skipWhitespace(),!this._evaluating){if(this.parseTernary(),this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);this.pos++,this.skipWhitespace(),this.parseTernary();return}if(e){let e=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);return this.pos++,this.skipWhitespace(),this.withEvaluation(!1,()=>this.parseTernary()),e}if(this.withEvaluation(!1,()=>this.parseTernary()),this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);return this.pos++,this.skipWhitespace(),this.parseTernary()}return e}parseNullish(){let e=this.parseOr();for(this.skipWhitespace();this.peek()===`?`&&this.peek(1)===`?`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&e!=null)this.withEvaluation(!1,()=>this.parseOr());else{let t=this.parseOr();this._evaluating&&(e??=t)}this.skipWhitespace()}return e}parseOr(){let e=this.parseAnd();for(this.skipWhitespace();this.peek()===`|`&&this.peek(1)===`|`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&e)this.withEvaluation(!1,()=>this.parseAnd());else{let t=this.parseAnd();this._evaluating&&(e||=t)}this.skipWhitespace()}return e}parseAnd(){let e=this.parseEquality();for(this.skipWhitespace();this.peek()===`&`&&this.peek(1)===`&`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&!e)this.withEvaluation(!1,()=>this.parseEquality());else{let t=this.parseEquality();this._evaluating&&(e&&=t)}this.skipWhitespace()}return e}parseEquality(){let e=this.parseAddition();for(this.skipWhitespace();;){let t;if(this.peek()===`=`&&this.peek(1)===`=`&&this.peek(2)===`=`)t=`===`,this.pos+=3;else if(this.peek()===`!`&&this.peek(1)===`=`&&this.peek(2)===`=`)t=`!==`,this.pos+=3;else if(this.peek()===`=`&&this.peek(1)===`=`)t=`==`,this.pos+=2;else if(this.peek()===`!`&&this.peek(1)===`=`)t=`!=`,this.pos+=2;else if(this.peek()===`>`&&this.peek(1)===`=`)t=`>=`,this.pos+=2;else if(this.peek()===`<`&&this.peek(1)===`=`)t=`<=`,this.pos+=2;else if(this.peek()===`>`&&this.peek(1)!==`>`)t=`>`,this.pos++;else if(this.peek()===`<`&&this.peek(1)!==`<`)t=`<`,this.pos++;else break;this.skipWhitespace();let n=this.parseAddition();switch(t){case`===`:e=e===n;break;case`!==`:e=e!==n;break;case`==`:e=e==n;break;case`!=`:e=e!=n;break;case`>`:e=e>n;break;case`<`:e=e<n;break;case`>=`:e=e>=n;break;case`<=`:e=e<=n}this.skipWhitespace()}return e}parseAddition(){let e=this.parseMultiplication();for(this.skipWhitespace();(this.peek()===`+`||this.peek()===`-`)&&this.peek(1)!==`=`;){let t=this.consume();this.skipWhitespace();let n=this.parseMultiplication();e=t===`+`?e+n:e-n,this.skipWhitespace()}return e}parseMultiplication(){let e=this.parseUnary();for(this.skipWhitespace();(this.peek()===`*`||this.peek()===`/`||this.peek()===`%`)&&this.peek(1)!==`=`;){let t=this.consume();this.skipWhitespace();let n=this.parseUnary();t===`*`?e*=n:t===`/`?e/=n:e%=n,this.skipWhitespace()}return e}parseUnary(){if(this.skipWhitespace(),this.source.startsWith(`typeof`,this.pos)&&!/[\w$]/.test(this.source[this.pos+6]??``)){this.pos+=6,this.skipWhitespace();try{return typeof this.parseUnary()}catch{return`undefined`}}return this.peek()===`!`?(this.pos++,!this.parseUnary()):this.peek()===`-`?(this.pos++,-this.parseUnary()):this.peek()===`+`?(this.pos++,+this.parseUnary()):this.parseMember()}parseMember(){let e=this.parsePrimary();for(;;){this.skipWhitespace();let t=this.peek()===`?`&&this.peek(1)===`.`;if(this.peek()===`.`&&this.peek(1)!==`.`||t){t&&this.pos++,this.pos++,this.skipWhitespace();let n=this.parseIdentifierName();if(!n)break;if(this.assertSafeProp(n),this.skipWhitespace(),this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating){e=void 0;continue}e=e!=null&&typeof e[n]==`function`?e[n](...t):void 0}else{if(!this._evaluating){e=void 0;continue}e=e?.[n]}continue}let n=this.peek()===`?`&&this.peek(1)===`[`;if(this.peek()===`[`||n){n&&this.pos++,this.pos++,this.skipWhitespace();let t=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`]`)throw SyntaxError(`Expected "]" after bracket expression at position ${this.pos}`);if(this.pos++,this.assertSafeProp(t),!this._evaluating){e=void 0;continue}e=e?.[t];continue}if(this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating){e=void 0;continue}if(typeof e==`function`)e=e(...t);else throw TypeError(`${String(e)} is not a function`);continue}break}return e}parsePrimary(){this.skipWhitespace();let e=this.peek();if(e===`(`){this.pos++;let e=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`)`)throw SyntaxError(`Expected ")" to close "(" expression at position ${this.pos}`);return this.pos++,e}if(e===`[`)return this.parseArrayLiteral();if(e===`"`||e===`'`)return this.parseString(e);if(/\d/.test(e)||e===`.`&&/\d/.test(this.peek(1)))return this.parseNumber();if(/[a-zA-Z_$]/.test(e))return this.parseIdentifierOrKeyword();throw SyntaxError(`Unexpected character "${e}" at position ${this.pos}`)}parseArrayLiteral(){this.pos++;let e=[];for(this.skipWhitespace();this.peek()!==`]`&&this.pos<this.source.length;)e.push(this.parseTernary()),this.skipWhitespace(),this.peek()===`,`&&(this.pos++,this.skipWhitespace());if(this.peek()!==`]`)throw SyntaxError(`Expected "]" to close array literal at position ${this.pos}`);return this.pos++,e}parseString(e){this.pos++;let t=``;for(;this.pos<this.source.length;){let n=this.source[this.pos];if(n===`\\`){this.pos++;let e=this.source[this.pos++]??``;switch(e){case`n`:t+=`
|
|
2
|
+
`;break;case`t`:t+=` `;break;case`r`:t+=`\r`;break;case`\\`:t+=`\\`;break;case`"`:t+=`"`;break;case`'`:t+=`'`;break;case"`":t+="`";break;default:t+=e}}else if(n===e){this.pos++;break}else t+=n,this.pos++}return t}parseNumber(){let e=this.pos,t=!1;for(;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t=!0,this.pos++;if(this.source[this.pos]===`.`)for(this.pos++;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t=!0,this.pos++;if(/[eE]/.test(this.source[this.pos]??``)){this.pos++,/[+-]/.test(this.source[this.pos]??``)&&this.pos++;let t=0;for(;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t++,this.pos++;if(t===0)throw SyntaxError(`Invalid numeric literal exponent at position ${e}`)}if(!t)throw SyntaxError(`Invalid numeric literal at position ${e}`);let n=this.source.slice(e,this.pos),r=Number(n);if(!Number.isFinite(r))throw SyntaxError(`Invalid numeric literal "${n}" at position ${e}`);return r}parseIdentifierName(){let e=this.pos;for(;this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]);)this.pos++;return this.source.slice(e,this.pos)}parseIdentifierOrKeyword(){let e=this.parseIdentifierName();switch(e){case`true`:return!0;case`false`:return!1;case`null`:return null;case`undefined`:return;case`NaN`:return NaN;case`Infinity`:return 1/0}if(e===`new`)return this.parseNewExpression();if(this.skipWhitespace(),this.peek()===`=`&&this.peek(1)===`>`)return this.parseArrowFunction(e);if(this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating)return;let n=this.context[e];if(typeof n==`function`)return n(...t);throw TypeError(`"${e}" is not a function`)}if(this._evaluating){if(!(e in this.context))throw ReferenceError(`${e} is not defined`);return this.context[e]}}parseNewExpression(){this.skipWhitespace();let e=this.parseIdentifierName();this.skipWhitespace();let t=[];if(this.peek()===`(`){if(this.pos++,t=this.parseArgList(),this.peek()!==`)`)throw SyntaxError(`Expected ")" after new ${e}() at position ${this.pos}`);this.pos++}if(this._evaluating)switch(e){case`Date`:return new Date(...t);case`RegExp`:return new RegExp(t[0],t[1]);default:throw TypeError(`new ${e}() is not supported in expressions`)}}parseArrowFunction(t){this.pos+=2,this.skipWhitespace();let n=this.pos,r=this.scanExpressionEnd(),i=this.source.slice(n,r).trim();this.pos=r;let a=this.context;return n=>new e().evaluate(i,{...a,[t]:n})}scanExpressionEnd(){let e=this.pos,t=0,n=!1,r=``;for(;e<this.source.length;){let i=this.source[e];if(n){if(i===`\\`){e+=2;continue}i===r&&(n=!1),e++;continue}if(i===`"`||i===`'`){n=!0,r=i,e++;continue}if(i===`(`||i===`[`)t++;else if(i===`)`||i===`]`){if(t===0)break;t--}else if(i===`,`&&t===0)break;e++}return e}parseArgList(){let e=[];for(this.skipWhitespace();this.peek()!==`)`&&this.pos<this.source.length;)e.push(this.parseTernary()),this.skipWhitespace(),this.peek()===`,`&&(this.pos++,this.skipWhitespace());return e}},Qr=class{cache=new Map;maxSize;constructor(e=1e3){this.maxSize=e}compile(e,t){let n=`${e}::${t.join(`,`)}`;if(this.cache.has(n)){let e=this.cache.get(n);return e.hitCount++,e}this.cache.size>=this.maxSize&&this.evictLFU();let r={fn:this.compileExpression(e,t),varNames:[...t],expression:e,compiledAt:Date.now(),hitCount:1};return this.cache.set(n,r),r}compileExpression(e,t){let n=new Zr;return(...r)=>{let i={};for(let e=0;e<t.length;e++)i[t[e]]=r[e];return n.evaluate(e,i)}}evictLFU(){let e=null,t=1/0,n=1/0;for(let[r,i]of this.cache.entries())(i.hitCount<n||i.hitCount===n&&i.compiledAt<t)&&(e=r,t=i.compiledAt,n=i.hitCount);e&&this.cache.delete(e)}has(e,t){let n=`${e}::${t.join(`,`)}`;return this.cache.has(n)}clear(){this.cache.clear()}getStats(){let e=0,t=[];for(let n of this.cache.values())e+=n.hitCount,t.push({expression:n.expression,hitCount:n.hitCount});return{size:this.cache.size,maxSize:this.maxSize,totalHits:e,entries:t.sort((e,t)=>t.hitCount-e.hitCount)}}},$r=/^\d{4}-\d{2}-\d{2}$/,ei=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function P(e){if(!$r.test(e))return!1;let[t,n,r]=e.split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r}function F(e){let t=e instanceof Date?e:new Date(e);if(typeof e==`string`&&ei.test(e)&&!P(e.slice(0,10)))return new Date(NaN);if(typeof e!=`string`||!$r.test(e)||isNaN(t.getTime()))return t;if(!P(e))return new Date(NaN);let[n,r,i]=e.split(`-`).map(Number),a=new Date(n,r-1,i);return a.setFullYear(n),a}function ti(e){let t=F(e);return typeof e!=`string`||!P(e)?t:(t.setDate(t.getDate()+1),t.setHours(0,0,0,0),t)}function ni(e){let t=new Date(e.getTime()-1);return t.setHours(0,0,0,0),t}function ri(e,t){try{let n=new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(e,`day`);return n.charAt(0).toUpperCase()+n.slice(1)}catch{return e===0?`Today`:e===1?`Tomorrow`:e===-1?`Yesterday`:e>0?`In ${e} days`:`${Math.abs(e)} days ago`}}function ii(e){return e===void 0||e.style===void 0?e:{...e,style:void 0}}function ai(e,t){if(e==null||e===``)return`—`;let n=F(e);if(!(n instanceof Date)||isNaN(n.getTime()))return`—`;let r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate()),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime()-i.getTime(),o=Math.round(a/864e5);if(o<-7||o>7)return oi(n,void 0,ii(t));if(o<-1&&t?.dueLike){let e=Math.abs(o),n=`fields.relativeDate.overdue`,r=t.t?.(n,{count:e});return r&&r!==n?r:`Overdue ${e}d`}return ri(o,t?.locale)}function oi(e,t,n){if(e==null||e===``)return`—`;let r=F(e);if(!(r instanceof Date)||isNaN(r.getTime()))return`—`;let i=t??n?.style;if(i===`short`)return`${r.toLocaleDateString(n?.locale,{month:`short`})} ${r.getDate()}, '${String(r.getFullYear()).slice(-2)}`;if(i===`relative`)return ai(r,n);let a=r.getFullYear()===new Date().getFullYear();return r.toLocaleDateString(n?.locale,{year:a?void 0:`numeric`,month:`short`,day:`numeric`})}function si(e,t){if(e==null||e===``)return null;let n=F(e);return!(n instanceof Date)||isNaN(n.getTime())?null:{date:n.toLocaleDateString(t?.locale,{month:`numeric`,day:`numeric`,year:`numeric`}),time:n.toLocaleTimeString(t?.locale,{hour:`numeric`,minute:`2-digit`,hour12:!0}).toLowerCase()}}function ci(e,t){if(e==null||e===``)return`—`;let n=F(e);if(!(n instanceof Date)||isNaN(n.getTime()))return`—`;if(t?.style===`compact`){let e=si(n,t);return e?`${e.date} ${e.time}`:`—`}return n.toLocaleDateString(t?.locale,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function li(e,t){let n=new Date(t);if(isNaN(n.getTime()))throw Error(`${e}: Invalid date "${t}"`);return{date:n,day:typeof t==`string`&&P(t)}}function ui({date:e,day:t}){return t?{year:e.getUTCFullYear(),month:e.getUTCMonth(),date:e.getUTCDate(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{year:e.getFullYear(),month:e.getMonth(),date:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function di(e,t){let n=e.getUTCDate();e.setUTCDate(1),e.setUTCMonth(e.getUTCMonth()+t);let r=new Date(e.getTime());r.setUTCMonth(r.getUTCMonth()+1,0),e.setUTCDate(Math.min(n,r.getUTCDate()))}function fi(e,t,n){switch(n){case`day`:case`days`:e.setUTCDate(e.getUTCDate()+t);break;case`month`:case`months`:di(e,t);break;case`year`:case`years`:di(e,t*12);break;case`hour`:case`hours`:return e.setUTCHours(e.getUTCHours()+t),e.toISOString();case`minute`:case`minutes`:return e.setUTCMinutes(e.getUTCMinutes()+t),e.toISOString();default:return}return e.toISOString().slice(0,10)}var pi=class{functions=new Map;constructor(){this.registerDefaults()}register(e,t){this.functions.set(e.toUpperCase(),t)}get(e){return this.functions.get(e.toUpperCase())}has(e){return this.functions.has(e.toUpperCase())}getNames(){return Array.from(this.functions.keys())}toObject(){let e={};for(let[t,n]of this.functions)e[t]=n;return e}registerDefaults(){this.registerAggregationFunctions(),this.registerDateFunctions(),this.registerLogicFunctions(),this.registerStringFunctions(),this.registerStringSearchFunctions(),this.registerStatisticalFunctions()}registerAggregationFunctions(){this.register(`SUM`,(...e)=>I(e).reduce((e,t)=>e+t,0)),this.register(`AVG`,(...e)=>{let t=I(e);return t.length===0?0:t.reduce((e,t)=>e+t,0)/t.length}),this.register(`COUNT`,(...e)=>mi(e).filter(e=>e!=null).length),this.register(`MIN`,(...e)=>{let t=I(e);return t.length===0?0:Math.min(...t)}),this.register(`MAX`,(...e)=>{let t=I(e);return t.length===0?0:Math.max(...t)})}registerDateFunctions(){this.register(`TODAY`,()=>new Date().toISOString().split(`T`)[0]),this.register(`NOW`,()=>new Date().toISOString()),this.register(`DATEADD`,(e,t,n)=>{let{date:r,day:i}=li(`DATEADD`,e),a=String(n).toLowerCase();if(i){let e=fi(r,t,a);if(e===void 0)throw Error(`DATEADD: Unsupported unit "${n}"`);return e}switch(a){case`day`:case`days`:r.setDate(r.getDate()+t);break;case`month`:case`months`:r.setMonth(r.getMonth()+t);break;case`year`:case`years`:r.setFullYear(r.getFullYear()+t);break;case`hour`:case`hours`:r.setHours(r.getHours()+t);break;case`minute`:case`minutes`:r.setMinutes(r.getMinutes()+t);break;default:throw Error(`DATEADD: Unsupported unit "${n}"`)}return r.toISOString()}),this.register(`DATEDIFF`,(e,t,n)=>{let r=li(`DATEDIFF`,e),i=li(`DATEDIFF`,t),a=i.date.getTime()-r.date.getTime();switch(String(n).toLowerCase()){case`day`:case`days`:return Math.floor(a/864e5);case`month`:case`months`:{let e=ui(r),t=ui(i);return(t.year-e.year)*12+(t.month-e.month)}case`year`:case`years`:return ui(i).year-ui(r).year;case`hour`:case`hours`:return Math.floor(a/36e5);case`minute`:case`minutes`:return Math.floor(a/6e4);default:throw Error(`DATEDIFF: Unsupported unit "${n}"`)}}),this.register(`DATEFORMAT`,(e,t)=>{let n=ui(li(`DATEFORMAT`,e)),r=(e,t=2)=>String(e).padStart(t,`0`);return t.replace(`YYYY`,String(n.year)).replace(`YY`,String(n.year).slice(-2)).replace(`MM`,r(n.month+1)).replace(`DD`,r(n.date)).replace(`HH`,r(n.hours)).replace(`mm`,r(n.minutes)).replace(`ss`,r(n.seconds))})}registerLogicFunctions(){this.register(`IF`,(e,t,n)=>e?t:n),this.register(`AND`,(...e)=>e.every(Boolean)),this.register(`OR`,(...e)=>e.some(Boolean)),this.register(`NOT`,e=>!e),this.register(`SWITCH`,(e,...t)=>{for(let n=0;n<t.length-1;n+=2)if(e===t[n])return t[n+1];if(t.length%2==1)return t[t.length-1]})}registerStringFunctions(){this.register(`CONCAT`,(...e)=>e.map(e=>String(e??``)).join(``)),this.register(`LEFT`,(e,t)=>String(e??``).substring(0,t)),this.register(`RIGHT`,(e,t)=>{let n=String(e??``);return n.substring(Math.max(0,n.length-t))}),this.register(`TRIM`,e=>String(e??``).trim()),this.register(`UPPER`,e=>String(e??``).toUpperCase()),this.register(`LOWER`,e=>String(e??``).toLowerCase())}registerStringSearchFunctions(){this.register(`FIND`,(e,t,n)=>String(t??``).indexOf(String(e??``),n??0)),this.register(`REPLACE`,(e,t,n)=>String(e??``).split(String(t??``)).join(String(n??``))),this.register(`SUBSTRING`,(e,t,n)=>{let r=String(e??``);return n===void 0?r.substring(t):r.substring(t,t+n)}),this.register(`REGEX`,(e,t,n)=>{let r=String(e??``);return new RegExp(t,n).test(r)}),this.register(`LEN`,e=>String(e??``).length)}registerStatisticalFunctions(){this.register(`MEDIAN`,(...e)=>{let t=I(e).sort((e,t)=>e-t);if(t.length===0)return 0;let n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}),this.register(`STDEV`,(...e)=>{let t=I(e);if(t.length<2)return 0;let n=t.reduce((e,t)=>e+t,0)/t.length,r=t.map(e=>(e-n)**2).reduce((e,t)=>e+t,0)/(t.length-1);return Math.sqrt(r)}),this.register(`VARIANCE`,(...e)=>{let t=I(e);if(t.length<2)return 0;let n=t.reduce((e,t)=>e+t,0)/t.length;return t.map(e=>(e-n)**2).reduce((e,t)=>e+t,0)/(t.length-1)}),this.register(`PERCENTILE`,(e,...t)=>{let n=I(t).sort((e,t)=>e-t);if(n.length===0)return 0;let r=Math.max(0,Math.min(100,e))/100*(n.length-1),i=Math.floor(r),a=Math.ceil(r);if(i===a)return n[i];let o=r-i;return n[i]+o*(n[a]-n[i])})}};function I(e){let t=[];for(let n of e)if(Array.isArray(n))t.push(...I(n));else{let e=Number(n);isNaN(e)||t.push(e)}return t}function mi(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...mi(n)):t.push(n);return t}var hi=new Set;function gi(e,t,n,r){let i=r instanceof Error?r.message:String(r);if(e){e(i);return}let a=JSON.stringify([t,n]);hi.has(a)||(hi.add(a),console.warn(t===`template-part`?`Expression evaluation failed for: ${n}`:`Failed to evaluate expression: ${n}`,r))}var L=class e{context;cache;formulas;constructor(e,t,n){this.context=e instanceof Jr?e:new Jr(e||{}),this.cache=t||new Qr,this.formulas=n||new pi}evaluate(e,t={}){if(e&&typeof e==`object`&&typeof e.source==`string`&&(e=e.source),typeof e!=`string`)return e;let{defaultValue:n,throwOnError:r=!1,sanitize:i=!0,onFault:a}=t;try{if(!e.includes("${"))return e;let t=e.match(/^\$\{([^}]+)\}$/);return t?this.evaluateExpression(t[1].trim(),{sanitize:i}):e.replace(/\$\{([^}]+)\}/g,(e,t)=>{try{let e=this.evaluateExpression(t.trim(),{sanitize:i});return String(e??``)}catch(n){if(r)throw n;return gi(a,`template-part`,t,n),e}})}catch(t){if(r)throw t;return gi(a,`whole-expression`,e,t),n??e}}evaluateExpression(e,t={}){let{sanitize:n=!0}=t;if(e&&e.trim()!==``){if(n&&this.isDangerous(e))throw Error(`Potentially dangerous expression detected: ${e}`);try{let t=this.context.toObject(),n={...this.formulas.toObject(),...t},r=Object.keys(n),i=Object.values(n);return this.cache.compile(e,r).fn(...i)}catch(t){throw Error(`Failed to evaluate expression "${e}": ${t.message}`)}}}isDangerous(e){return[/eval\s*\(/i,/Function\s*\(/i,/setTimeout\s*\(/i,/setInterval\s*\(/i,/import\s*\(/i,/require\s*\(/i,/process\./i,/global\./i,/window\./i,/document\./i,/__proto__/i,/constructor\s*\(/i,/prototype\./i].some(t=>t.test(e))}evaluateCondition(e,t={}){if(typeof e==`boolean`)return e;if(e&&typeof e==`object`&&e.dialect===`cel`&&typeof e.source==`string`)return this.evaluateCelCondition(e.source,t);if(e&&typeof e==`object`&&typeof e.source==`string`&&(e=e.source),A(e))return this.answerBlankGate(e,t);if(!e)return!0;if(typeof e!=`string`)return!!e;let n=e.trim();if(n.includes("${"))return!!this.evaluate(n,t);try{return!!this.evaluateExpression(n,{sanitize:t.sanitize!==!1})}catch(e){if(t.throwOnError)throw e;return t.onFault?.(e instanceof Error?e.message:String(e)),!0}}evaluateCelCondition(e,t){if(A(e))return this.answerBlankGate(e,t);let n=this.context.toObject(),r=n.record,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n;if(!t.throwOnError)return k(e,i,!0,void 0,n,t.onFault?{warn:!1,onFault:t.onFault}:void 0);let a=k(e,i,!0,void 0,n,{warn:!1});if(a!==k(e,i,!1,void 0,n,{warn:!1}))throw Error(`CEL predicate failed to evaluate: ${e}`);return a}answerBlankGate(e,t){return k(e,{},!0,void 0,void 0,t.onFault?{warn:!1,onFault:t.onFault}:{context:`a CEL gate predicate, read as no gate`}),!0}updateContext(e){Object.entries(e).forEach(([e,t])=>{this.context.set(e,t)})}getContext(){return this.context}withContext(t){return new e(this.context.createChild(t),this.cache,this.formulas)}getCacheStats(){return this.cache.getStats()}clearCache(){this.cache.clear()}getFormulas(){return this.formulas}registerFunction(e,t){this.formulas.register(e,t)}};new Qr,new pi;var _i=`record`,vi=`data`;function yi(e,t,n){if(typeof e!=`string`||!e.trim())return null;let r=te(e);if(!r||r.ok!==!0)return null;let i=S(e);return typeof i==`string`&&typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(t,i)?{kind:`bare-shorthand`,identifier:i,canonical:`${_i}.${i}`}:n&&Array.isArray(r.roots)&&r.roots.includes(vi)?{kind:`metadata-layer-root`,identifier:vi,canonical:_i}:null}function bi(e){if(!e||typeof e!=`object`)return null;let t=new Set;if(Array.isArray(e))for(let n of e){let e=n?.name,r=n?.type;typeof e==`string`&&pn.has(r)&&t.add(e)}else for(let[n,r]of Object.entries(e)){let e=r?.type;pn.has(e)&&t.add(n)}return t.size>0?t:null}function xi(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.id??t._id;return typeof n==`string`||typeof n==`number`?String(n):void 0}function Si(e,t){if(!e||typeof e!=`object`)return e;let n=bi(t);if(!n)return e;let r=null,i=(t,n)=>{r||={...e},r[t]=n};for(let t of n){if(!(t in e))continue;let n=e[t];if(Array.isArray(n)){if(!n.some(e=>xi(e)!==void 0))continue;i(t,n.map(e=>xi(e)??e));continue}let r=xi(n);r!==void 0&&i(t,r)}return r??e}var Ci=/\$\{|===|!==|\?\.|\?\?|\.(?:includes|indexOf|toUpperCase|toLowerCase|startsWith|endsWith|trim|split|map|filter|reduce|find|some|every|join|slice|charAt|padStart|padEnd|replace|match|test)\s*\(/;function wi(e){return Ci.test(e)}var Ti=new Set;function Ei(e){Ti.has(e)||(Ti.add(e),console.warn(`[object-ui] A conditional predicate uses the legacy expression dialect and is not portable to the server CEL engine: `+JSON.stringify(e)+`. Rewrite it as CEL (use "==" not "===", "x in [..]" for membership, ".contains()" not ".includes()", and drop template interpolation).`))}var Di=new Set;function Oi(e,t,n){let r=JSON.stringify([t??``,e]);Di.has(r)||(Di.add(r),console.warn(`[object-ui] A conditional predicate failed to evaluate`+(t?` (${t})`:``)+` and was treated as its safe default: `+JSON.stringify(e)+(n?`. Reason: ${n}`:``)+`. Check the field names and CEL syntax.`))}function ki(e,t,n){let r,i={warn:!1,onFault:e=>{r??=e}},a=k(e,t,!0,void 0,n,i);return a===k(e,t,!1,void 0,n,i)?{ok:!0,value:a}:{ok:!1,value:!1,reason:r}}function Ai(e,t,n={}){let r=n.fallback??!1;if(e==null)return r;let i=typeof e==`string`?e:void 0,a=n.rowless?{}:Si(t&&typeof t==`object`?t:{},n.fields),o=n.rowless?{...n.scope??{}}:{...n.scope??{},record:a},s=i??(e&&typeof e==`object`&&typeof e.source==`string`?e.source:`(expression)`);if(i!==void 0&&wi(i)){Ei(i);try{return new L(o).evaluateCondition(i,{throwOnError:!0})}catch(e){return n.warnOnError&&Oi(i,n.label,`[legacy] ${e instanceof Error?e.message:String(e)}`),r}}if(!n.warnOnError)return k(e,a,r,void 0,o,{context:n.label});let c=ki(e,a,o);return c.ok?c.value:(Oi(s,n.label,c.reason),r)}function ji(e,t,n={}){if(e==null||e===``)return{eligible:t,skipped:0};if(typeof e==`boolean`)return e?{eligible:t,skipped:0}:{eligible:[],skipped:t.length};let r=t.filter(t=>Ai(e,t,{...n,warnOnError:n.warnOnError??!0,fallback:!1}));return{eligible:r,skipped:t.length-r.length}}function R(e){if(e==null)return`null`;let t=typeof e;return t===`string`?JSON.stringify(e):t===`number`||t===`boolean`?String(e):Array.isArray(e)?`[${e.map(R).join(`, `)}]`:JSON.stringify(String(e))}function Mi(e){let{field:t,operator:n,value:r}=e;if(!t||!n)return null;let i=`record[${JSON.stringify(t)}]`;switch(n){case`equals`:return`${i} == ${R(r)}`;case`not_equals`:return`${i} != ${R(r)}`;case`greater_than`:return`${i} > ${R(r)}`;case`less_than`:return`${i} < ${R(r)}`;case`contains`:return`${i}.contains(${R(r)})`;case`in`:return`${i} in ${R(Array.isArray(r)?r:[r])}`;default:return null}}function Ni(e){return e.condition==null?typeof e.expression==`string`&&e.expression.trim()?e.expression:Mi(e):e.condition}function Pi(e){let t={};if(e.style&&typeof e.style==`object`)for(let[n,r]of Object.entries(e.style))r!=null&&(t[n]=String(r));return e.backgroundColor&&(t.backgroundColor=String(e.backgroundColor)),e.textColor&&(t.color=String(e.textColor)),e.borderColor&&(t.borderColor=String(e.borderColor)),t}function Fi(e,t,n,r){if(!t||t.length===0)return{};let i=e&&typeof e==`object`?e:{};for(let e=0;e<t.length;e++){let a=t[e];if(!a||typeof a!=`object`)continue;let o=Ni(a);if(o!=null&&Ai(o,i,{fallback:!1,scope:n,fields:r,label:`conditionalFormatting[${e}]`}))return Pi(a)}return{}}function Ii(e){return e?(Array.isArray(e)?e:[e]).map(e=>typeof e==`string`?e:e&&typeof e==`object`?e.field:null).filter(e=>typeof e==`string`&&e.length>0):[]}function Li(e,t){return Ii(e).some(e=>$t(t[e]))}function Ri(e,t,n){return!e||e.length===0?[]:e.filter(e=>e?.visibleWhen==null||k(e.visibleWhen,t,!0,void 0,n,{context:`visibleWhen of option '${String(e.value)}'`}))}function zi(e){let{label:t}=e;return typeof t==`string`&&t.trim()!==``?t:String(e.value)}function Bi(e,t){return $t(e)?!0:Array.isArray(e)?e.every(e=>t.some(t=>t.value===e)):t.some(t=>t.value===e)}function Vi(e,t,n,r){let i=Ii(n),a=i.length>0&&Li(n,t);return{options:a?[]:Ri(e,t,r),gated:a,dependsOnFields:i}}var Hi=new Set([`select`,`multiselect`,`radio`,`checkboxes`]);function Ui(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.type==`string`&&typeof t.objectName==`string`&&typeof t.recordId==`string`&&typeof t.timestamp==`number`}var Wi=class e{undoStack=[];redoStack=[];maxHistory;listeners=new Set;constructor(e){this.maxHistory=e?.maxHistory??50}push(e){this.undoStack.push(e),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack=[],this.notify()}peekUndo(){return this.undoStack[this.undoStack.length-1]}peekRedo(){return this.redoStack[this.redoStack.length-1]}popUndo(){let e=this.undoStack.pop();return e&&(this.redoStack.push(e),this.notify()),e}popRedo(){let e=this.redoStack.pop();return e&&(this.undoStack.push(e),this.notify()),e}clear(){this.undoStack=[],this.redoStack=[],this.notify()}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get undoCount(){return this.undoStack.length}get redoCount(){return this.redoStack.length}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}getHistory(){return[...this.undoStack]}getRedoHistory(){return[...this.redoStack]}pushBatch(e){e.length!==0&&(this.undoStack.push(...e),this.undoStack.length>this.maxHistory&&this.undoStack.splice(0,this.undoStack.length-this.maxHistory),this.redoStack=[],this.notify())}popUndoBatch(e){let t=Math.min(e,this.undoStack.length);if(t===0)return[];let n=this.undoStack.splice(this.undoStack.length-t,t);return this.redoStack.push(...n),this.notify(),n}popRedoBatch(e){let t=Math.min(e,this.redoStack.length);if(t===0)return[];let n=this.redoStack.splice(this.redoStack.length-t,t);return this.undoStack.push(...n),this.notify(),n}static STORAGE_KEY=`objectui:undo-history`;saveToStorage(){try{let t=JSON.stringify({undoStack:this.undoStack,redoStack:this.redoStack});localStorage.setItem(e.STORAGE_KEY,t)}catch{}}loadFromStorage(){try{if(typeof localStorage>`u`)return;let t=localStorage.getItem(e.STORAGE_KEY);if(!t)return;let n=JSON.parse(t);Array.isArray(n.undoStack)&&(this.undoStack=n.undoStack.filter(Ui)),Array.isArray(n.redoStack)&&(this.redoStack=n.redoStack.filter(Ui)),this.undoStack.length>this.maxHistory&&this.undoStack.splice(0,this.undoStack.length-this.maxHistory),this.notify()}catch{}}notify(){this.listeners.forEach(e=>e())}},z=new Wi,Gi=`type.actionType.name.label.description.confirmText.confirm.condition.disabled.api.endpoint.method.navigate.to.external.newTab.replace.onClick.reload.close.redirect.toast.successMessage.errorMessage.refreshAfter.undoable.params.actionParams.resultDialog.target.body.openIn.modal.chain.chainMode.onFailure.opensInNewTab.newTabUrl.locations.visible.requiredPermissions.icon.variant.order.component.objectName.ai.bodyExtra.bodyShape.operation.patch.mode.recordIdField.recordIdParam.requiresFeature.onSuccess.shortcut.bulkEnabled`.split(`.`),Ki=`_lock._lockDocsUrl._lockReason._lockSource._packageId._packageVersion._provenance.ai.aria.body.bodyExtra.bodyShape.bulkEnabled.component.confirmText.description.disabled.errorMessage.execute.execution.icon.label.locations.method.mode.name.newTabUrl.objectName.onSuccess.openIn.opensInNewTab.operation.order.params.patch.recordIdField.recordIdParam.refreshAfter.requiredPermissions.requiresFeature.resultDialog.shortcut.successMessage.target.type.undoable.variant.visible`.split(`.`),qi=[`to`,`external`,`newTab`,`replace`],Ji=[`overrideNotice`],Yi={execute:"`execute` was removed in @objectstack/spec 17 (objectstack-ai/objectstack#3855) — rename the key to `target`. The value (a script name or expression) is unchanged. Run `os migrate meta --from 16` to rewrite it automatically."},Xi=new Set([...Gi,...Ki,...qi,...Ji].filter(e=>!(e in Yi)));function Zi(e){let t=[],n=[];if(!e||typeof e!=`object`)return{unknown:t,retired:n};for(let r of Object.keys(e))r in Yi?n.push(r):Xi.has(r)||t.push(r);return{unknown:t,retired:n}}var B=new Set,Qi=()=>!1;function $i(e,t=`ActionRunner`){if(!Qi())return;let{unknown:n,retired:r}=Zi(e),i=e?.name??e?.type??`(unnamed)`;for(let e of r){let n=`retired:${String(i)}:${e}`;B.has(n)||(B.add(n),console.warn(`[${t}] action "${String(i)}" carries the retired key \`${e}\`. ${Yi[e]}`))}if(n.length===0)return;let a=`unknown:${String(i)}:${n.slice().sort().join(`,`)}`;B.has(a)||(B.add(a),console.warn(`[${t}] action "${String(i)}" carries ${n.length===1?`a key`:`keys`} no reader recognizes: \`${n.join("`, `")}\`. Nothing will read ${n.length===1?`it`:`them`} — check for a typo, or promote the key to an explicit field on \`ActionDef\` (packages/core/src/actions/ActionRunner.ts), adding it to \`ACTION_DEF_KEYS\` (packages/core/src/actions/actionKeys.ts) in the SAME commit — the pin test derives one from the other, so either edit alone goes red. Warned rather than rejected because \`tsc\` only sees actions authored in code: this one may have arrived as DATA, and stored \`sys_metadata\` rows reach the runner unparsed (objectstack#3903).`))}var ea=new Set([`recordId`]),ta=e=>!e.startsWith(`_`)&&!ea.has(e);function na(e){if(!e||typeof e!=`object`)return!1;let{type:t,actionType:n,params:r}=e;return(t??n)!==`api`||!r||typeof r!=`object`||Array.isArray(r)?!1:Object.keys(r).some(ta)}function ra(e,t=`ActionRunner`){if(!Qi()||!na(e))return;let n=e?.name??`(unnamed)`,r=`deprecated-object-params:${String(n)}`;B.has(r)||(B.add(r),console.warn(`[${t}] action "${String(n)}" carries a static request payload in \`params\`. \`params\` is the parameter DEFINITION array (fields collected from the user before the action runs), never a payload map — put the payload in \`bodyExtra\` instead (objectstack#5777). Still read as the payload for one version window; the arm is removed at 18. \`bodyExtra\` is merged LAST, so it overrides anything left here.`))}function ia(e,t){let n=e,r=n?.error;if(typeof r==`string`&&r.length>0)return r;let i=r?.message;return typeof i==`string`&&i.length>0?i:typeof n?.message==`string`&&n.message.length>0?n.message:t}function aa(e){return sa(e)?e.data:e}var oa=new Set([`success`,`data`,`error`,`code`,`fields`]);function sa(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.success==`boolean`&&Object.keys(e).every(e=>oa.has(e))}function ca(e,t,n){let r=t?.data,i=sa(r)&&r.success===!1;return!e.ok||t&&t.success===!1||i?{ok:!1,error:i?ia(r,`${n} failed`):ia(t,`${n} failed (HTTP ${e.status})`)}:{ok:!0,envelope:r,payload:aa(r)}}var la={completedSuccessfully:{key:`actions.completedSuccessfully`,defaultValue:`Action completed successfully`},failed:{key:`actions.failed`,defaultValue:`Action failed`},parallelFailed:{key:`actions.parallelFailed`,defaultValue:`One or more parallel actions failed`},undo:{key:`actions.undo`,defaultValue:`Undo`}};function ua(e){let t=e.user;if(t===void 0)return e;let n=e.os;return n&&typeof n==`object`&&n.user===t?e:{...e,os:{...n&&typeof n==`object`?n:{},user:t}}}var da=`recordId`,fa=`recordObject`;function pa(e){let t=e.objectName;return typeof t==`string`&&t.trim()!==``?t.trim():void 0}function ma(e,t){if(pa(e)!==t)return;let n=e.objectFields;return n&&typeof n==`object`?n:void 0}function ha(e,t){return!t||!e.includes(`.`)?!1:!e.startsWith(`${t}.`)}function ga(e){return e.operation===`update`}function _a(e,t,n){if(!e.every(e=>va(t,e)))return;let r=Si(t,n);return Object.fromEntries(e.map(e=>[e,r[e]]))}function va(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}var V=class{handlers=new Map;scripts=new Map;evaluator;context;confirmHandler;toastHandler;modalHandler;navigationHandler;paramCollectionHandler;resultDialogHandler;translate;builtinExecutors={script:e=>this.executeScript(e),url:e=>this.executeUrl(e),modal:e=>this.executeModal(e),flow:e=>this.executeFlow(e),api:e=>this.executeAPI(e),form:e=>this.executeForm(e),navigation:e=>this.executeNavigation(e)};constructor(e={}){this.context=ua(e),this.evaluator=new L(this.context),this.confirmHandler=async e=>window.confirm(e),this.toastHandler=null,this.modalHandler=null,this.navigationHandler=null,this.paramCollectionHandler=null,this.resultDialogHandler=null,this.translate=null}setTranslator(e){this.translate=e}setConfirmHandler(e){this.confirmHandler=e}setToastHandler(e){this.toastHandler=e}setModalHandler(e){this.modalHandler=e}setNavigationHandler(e){this.navigationHandler=e}setParamCollectionHandler(e){this.paramCollectionHandler=e}setResultDialogHandler(e){this.resultDialogHandler=e}registerHandler(e,t){this.handlers.set(e,t)}unregisterHandler(e){this.handlers.delete(e)}registerScript(e,t){this.scripts.set(e,t)}unregisterScript(e){this.scripts.delete(e)}async execute(e){try{$i(e),ra(e);let t=e.type||e.actionType||e.name||``;if(j(e.condition)&&!this.evaluator.evaluateCondition(e.condition))return{success:!1,error:`Action condition not met`};if(j(e.disabled)){let t=!1;try{t=this.evaluator.evaluateCondition(e.disabled)}catch{t=!1}if(t)return{success:!1,error:`Action is disabled`}}if(e.confirmText&&!await this.confirmHandler(this.evaluator.evaluate(e.confirmText)))return{success:!1,error:`Action cancelled by user`};let n=e.actionParams&&Array.isArray(e.actionParams)?e.actionParams:Array.isArray(e.params)?e.params:void 0;if(n&&n.length>0&&this.paramCollectionHandler){let t=await this.paramCollectionHandler(n,e);if(t===null)return{success:!1,error:`Action cancelled by user (params)`};let r=Array.isArray(e.params)?{}:e.params||{},i=r._rowRecord;e.params={...r,...t},i!==void 0&&(e.params._rowRecord=i)}if(ga(e)){let t=await this.executeUpdateOperation(e);return await this.handlePostExecution(e,t),t}if(t&&this.handlers.has(t)){let n=await this.handlers.get(t)(e,this.context);return await this.handlePostExecution(e,n),n}let r,i=t?this.builtinExecutors[t]:void 0;return i?r=await i(e):e.navigate?r=await this.executeNavigation(e):e.api||e.endpoint?r=await this.executeAPI(e):e.onClick?(await e.onClick(),r={success:!0}):r=await this.executeActionSchema(e),await this.handlePostExecution(e,r),r}catch(t){let n={success:!1,error:t.message};return await this.handlePostExecution(e,n),n}}async executeChain(e,t=`sequential`){if(e.length===0)return{success:!0};if(t===`parallel`){let t=await Promise.allSettled(e.map(e=>this.execute(e)));if(t.filter(e=>e.status===`rejected`||e.status===`fulfilled`&&!e.value.success).length>0)return{success:!1,error:t.find(e=>e.status===`fulfilled`&&!e.value.success)?.value?.error||this.runnerText(la.parallelFailed)};let n=t[t.length-1];return n.status===`fulfilled`?n.value:{success:!1,error:this.runnerText(la.failed)}}let n={success:!0};for(let t of e)if(n=await this.execute(t),!n.success)return n;return n}runnerText({key:e,defaultValue:t}){return this.translate?.(e,{defaultValue:t})||t}async handlePostExecution(e,t){let n=!!(e.resultDialog&&t.success);if(this.toastHandler){let r=e.toast??{showOnSuccess:!0,showOnError:!0},i=e.toast?.duration;if(t.success&&!n&&!t.silent&&r.showOnSuccess!==!1){let n=(t.data&&typeof t.data==`object`&&typeof t.data.message==`string`?String(t.data.message).trim():``)||e.successMessage||this.runnerText(la.completedSuccessfully);if(t.undo)try{z.push(t.undo)}catch{}this.toastHandler(n,{type:`success`,duration:i,undo:t.undo?{label:this.runnerText(la.undo)}:void 0})}if(!t.success&&r.showOnError!==!1&&t.error){let n=e.errorMessage||t.error,r=typeof n==`string`?n:n&&typeof n.message==`string`?n.message:this.runnerText(la.failed);this.toastHandler(r,{type:`error`,duration:i})}}if(n){if(this.resultDialogHandler)try{await this.resultDialogHandler(e.resultDialog,t.data,e)}catch(e){console.warn(`[ActionRunner] resultDialog handler rejected; treating as acknowledged`,e)}else console.warn(`[ActionRunner] action.resultDialog set but no resultDialogHandler registered — the response value will not be shown to the user.`,{action:e.name,data:t.data})}if(e.refreshAfter&&t.success&&(t.reload=!0),e.chain&&e.chain.length>0&&t.success){let n=await this.executeChain(e.chain,e.chainMode||`sequential`);n.success||(t.success=!1,t.error=n.error),n.data&&(t.data=n.data),n.redirect&&(t.redirect=n.redirect),n.reload&&(t.reload=!0)}if(t.success&&e.onSuccess){let n=ya(e.onSuccess);n&&this.navigateOnSuccess(n,e,t)}if(!t.success&&e.onFailure){let t=Array.isArray(e.onFailure)?e.onFailure:[e.onFailure];await this.executeChain(t,`sequential`)}}navigateOnSuccess(e,t,n){let r=this.interpolateTarget(e.navigate,t,aa(n.data));if(!this.isValidUrl(r)){console.warn(`[ActionRunner] onSuccess.navigate resolved to a URL this runner refuses to open (only http://, https:// and relative URLs are allowed) — no navigation performed.`,{action:t.name,navigate:e.navigate,resolved:r});return}let i=e.openIn===`newTab`,a=r.startsWith(`http://`)||r.startsWith(`https://`);if(this.navigationHandler){this.navigationHandler(r,{external:a,newTab:i});return}i?window.open(r,`_blank`,`noopener,noreferrer`):n.redirect=r}async executeUpdateOperation(e){let t=this.handlers.get(`script`);if(!t)return{success:!1,error:"An `operation: \"update\"` action is written by the platform action route, which this client runner cannot reach: no `script` handler is registered. The write is never performed client-side — a direct data-plane update bypasses the route's permission floor, the object's hooks and its validations. Register a handler that POSTs to /api/v1/actions/{object}/{action} — build one with createServerActionHandler from @object-ui/core."};let n=e.params&&!Array.isArray(e.params)?{...e.params}:{},r={...e.patch&&typeof e.patch==`object`&&!Array.isArray(e.patch)?{...e.patch}:{},...n},i=n._rowRecord&&typeof n._rowRecord==`object`?n._rowRecord:void 0,a=Object.keys(r).filter(e=>e!==`_rowRecord`&&e!==`recordId`),o=await t({...e,params:r},this.context);if(!o.success)return o;if(e.undoable&&i&&a.length>0){let t=e.objectName||pa(this.context),s=n.recordId??i.id;if(t&&s!=null){let n=_a(a,i,ma(this.context,t));n?o.undo={id:`undo-${t}-${String(s)}-${Date.now()}`,type:`update`,objectName:t,recordId:String(s),timestamp:Date.now(),description:e.label||t,undoData:n,redoData:Object.fromEntries(a.map(e=>[e,r[e]]))}:console.warn("[ActionRunner] `undoable` update succeeded but offers no Undo: the row it ran on does not carry every field it wrote, so their prior values are unknown and an Undo would overwrite stored data. A list row carries a written field when the object declares it and the principal may read it.",{action:e.name,missing:a.filter(e=>!va(i,e))})}}return o}async executeScript(e){let t=e.target;if(!t)return e.body==null?typeof e.execute==`string`?{success:!1,error:"`execute` was removed in @objectstack/spec 17 — rename the key to `target`. The value (a script name or expression) is unchanged. Run `os migrate meta --from 16` to rewrite it automatically."}:{success:!1,error:`No script provided for script action`}:{success:!1,error:"Action body must be executed server-side — this client runner does not interpret `body` (sandboxed JS needs an isolated VM; expression bodies use the formula engine). Register a `script` handler that POSTs to /api/v1/actions/{object}/{action} — build one with createServerActionHandler from @object-ui/core."};let n=this.scripts.get(t);if(n)try{return await n(e,this.context)}catch(e){return{success:!1,error:`Script execution failed: ${e.message}`}}try{let e=this.evaluator.evaluate(`\${${t}}`);return e!=null&&typeof e.then==`function`&&(e=await e),{success:!0,data:e}}catch(e){return{success:!1,error:`Script execution failed: ${e.message}`}}}async executeUrl(e){let t=e.target||e.redirect;return t?this.navigateTo(e,t,e):{success:!1,error:`No URL provided for url action`}}async navigateTo(e,t,n){let r=this.interpolateTarget(t,e),i=this.evaluator.evaluate(r);if(!this.isValidUrl(i))return{success:!1,error:`Invalid URL scheme. Only http://, https://, and relative URLs are allowed.`};let a=typeof this.context.apiBase==`string`?this.context.apiBase.replace(/\/+$/,``):``;a&&/^\/(api|_auth|_account)\//.test(i)&&(i=`${a}${i}`);let o=!!n.external||i.startsWith(`http://`)||i.startsWith(`https://`);if(/\/(api|_auth|_account)\//.test(i)&&(o||i.startsWith(`/`)))return window.location.href=i,{success:!0};let s=n.openIn??e.openIn,c=s===`new-tab`?!0:s===`self`?!1:n.newTab??o,l=n.replace??e.replace;if(this.navigationHandler)return this.navigationHandler(i,{external:o,newTab:c,...l===void 0?{}:{replace:!!l}}),{success:!0};if(c)window.open(i,`_blank`,`noopener,noreferrer`);else return{success:!0,redirect:i};return{success:!0}}async executeModal(e){let t=e.modal||e.target||e.params?.schema;return t?this.modalHandler?await this.modalHandler(t,this.context):{success:!0,modal:t}:{success:!1,error:`No modal schema or target provided for modal action`}}async executeFlow(e){let t=e.target||e.name;return t?this.handlers.has(`flow`)?await this.handlers.get(`flow`)(e,this.context):{success:!1,error:`Flow handler not registered. Cannot execute flow: ${t}`}:{success:!1,error:`No flow target provided for flow action`}}async executeActionSchema(e){let t=!!(e.api||e.endpoint);if(!(t||e.onClick||e.redirect||e.reload===!0||e.close===!0))return{success:!1,error:`Action "${e.name||e.type||e.actionType||`action`}" is not executable: no handler is registered under that name and it declares no api, endpoint, navigate, redirect or onClick.`};let n={success:!0};if(t){let t=await this.executeAPI(e);if(!t.success)return t;n.data=t.data}return e.onClick&&await e.onClick(),n.reload=e.reload!==!1,n.close=e.close!==!1,e.redirect&&(n.redirect=this.evaluator.evaluate(e.redirect)),n}async executeForm(e){let t=this.evaluator.evaluate(e.target);if(!t||typeof t!=`string`)return{success:!1,error:`No form target (FormView name) provided for form action`};let n=(this.context.record&&this.context.record.id)??(this.context.data&&this.context.data.id),r=`/forms/${t}`,i=pa(this.context),a=n==null||ha(t,i)?r:`${r}?${da}=${encodeURIComponent(String(n))}`+(i?`&${fa}=${encodeURIComponent(i)}`:``);return this.navigationHandler?(this.navigationHandler(a,{external:!1}),{success:!0}):{success:!0,redirect:a}}async executeNavigation(e){let t=e.navigate||e,n=t.to||t.target||t.redirect;return n?this.navigateTo(e,n,t):{success:!1,error:`No URL provided for navigation action`}}buildApiRequestBody(e){let t=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:void 0,n=t(e.bodyExtra),r=t(e.params)??this.context.data,i=e.bodyShape,a=i&&typeof i==`object`&&typeof i.wrap==`string`&&i.wrap?i.wrap:void 0;return a?{[a]:r??{},...n}:n?{...t(r),...n}:r??{}}async executeAPI(e){let t=e.api||e.endpoint||e.target;if(!t)return{success:!1,error:`No API endpoint provided`};try{let n,r,i={"Content-Type":`application/json`},a,o=`json`;if(typeof t==`string`)n=this.interpolateTarget(t,e),r=e.method||`POST`,a=JSON.stringify(this.buildApiRequestBody(e));else{let s=t;if(n=this.interpolateTarget(s.url,e),r=s.method||e.method||`POST`,i={...i,...s.headers},o=s.responseType||`json`,s.queryParams){let e=new URLSearchParams(s.queryParams);n=`${n}${n.includes(`?`)?`&`:`?`}${e.toString()}`}s.body?a=typeof s.body==`string`?s.body:JSON.stringify(s.body):r!==`GET`&&r!==`HEAD`&&(a=JSON.stringify(this.buildApiRequestBody(e)))}let s={method:r,headers:i};a&&r!==`GET`&&r!==`HEAD`&&(s.body=a);let c=await fetch(n,s);if(!c.ok)throw Error(`HTTP ${c.status}: ${c.statusText}`);let l;switch(o){case`text`:l=await c.text();break;case`blob`:l=await c.blob();break;default:l=await c.json()}return{success:!0,data:l}}catch(e){return{success:!1,error:e.message}}}isValidUrl(e){return typeof e==`string`&&(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)||e.startsWith(`./`))}interpolateTarget(e,t,n){if(typeof e!=`string`||e.indexOf("${")===-1)return e;let r={param:t.params&&typeof t.params==`object`&&!Array.isArray(t.params)?t.params:{},ctx:this.buildInterpolationContext()};n!==void 0&&(r.result=n);let i=RegExp(`\\$\\{(${Object.keys(r).join(`|`)})\\.([\\w.]+)\\}`,`g`);return e.replace(i,(e,t,n)=>{let i=ba(r[t],n);return i==null?``:encodeURIComponent(String(i))})}buildInterpolationContext(){let e={origin:typeof window<`u`?window.location.origin:``,apiBase:typeof this.context.apiBase==`string`?this.context.apiBase.replace(/\/+$/,``):``,user:this.context.user??{},org:this.context.org??this.context.organization??{},recordId:this.context.record?.id??this.context.recordId,selection:{ids:Array.isArray(this.context.selectedRecords)?this.context.selectedRecords.map(e=>e?.id).filter(e=>e!=null).map(String):[],count:Array.isArray(this.context.selectedRecords)?this.context.selectedRecords.length:0}};return this.context.ctx&&typeof this.context.ctx==`object`&&Object.assign(e,this.context.ctx),e}updateContext(e){this.context=ua({...this.context,...e}),this.evaluator.updateContext(this.context)}getContext(){return this.context}getEvaluator(){return this.evaluator}};function ya(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.navigate;return typeof t!=`string`||t===``?null:e}function ba(e,t){if(e!=null)return t.split(`.`).reduce((e,t)=>{if(e!=null)return e[t]},e)}function xa(e){return e.toLowerCase().split(`+`).map(e=>e.trim()).sort().join(`+`)}var Sa=new Set;function Ca(e,t,n){let r=typeof t==`string`?t:t&&typeof t==`object`&&typeof t.source==`string`?t.source:String(t),i=`${String(e)}::${r}`;if(Sa.has(i))return;Sa.add(i);let a=n instanceof Error?n.message:String(n);console.warn(`[ActionEngine] action "${String(e)}" hidden: its \`visible\` predicate threw — ${a}. Predicate: ${r}. Action predicates evaluate against { record, recordId, objectName, user, os.user, … }; use \`record.<field>\` (not a bare field).`)}var wa=class{actions=new Map;shortcuts=[];normalizedShortcutMap=new Map;runner;constructor(e={}){this.runner=e instanceof V?e:new V(e)}getRunner(){return this.runner}registerAction(e,t){let n=e.name||e.type||``;if(!n)throw Error(`Action must have a name or type`);this.actions.set(n,{action:e,locations:t?.locations||[],shortcut:t?.shortcut,bulkEnabled:t?.bulkEnabled??!1,priority:t?.priority??100}),t?.shortcut&&(this.shortcuts.push({keys:t.shortcut,actionName:n}),this.normalizedShortcutMap.set(xa(t.shortcut),n))}registerActions(e){for(let t of e)this.registerAction(t,{locations:t.locations})}unregisterAction(e){let t=this.actions.get(e);t?.shortcut&&this.normalizedShortcutMap.delete(xa(t.shortcut)),this.actions.delete(e),this.shortcuts=this.shortcuts.filter(t=>t.actionName!==e)}getActionsForLocation(e){let t=this.runner.getEvaluator();return Array.from(this.actions.values()).filter(t=>t.locations.includes(e)).filter(e=>{let t=e.action.requiredPermissions;if(!Array.isArray(t)||t.length===0)return!0;let n=this.runner.getContext()?.user?.systemPermissions;return!Array.isArray(n)||t.every(e=>n.includes(e))}).filter(e=>{let n=e.action.visible;if(!j(n))return!0;let r=ft(n);try{return t.evaluateCondition(r,{throwOnError:!0})}catch(t){return Ca(e.action.name,n,t),!1}}).sort((e,t)=>(e.priority??100)-(t.priority??100)).map(e=>e.action)}getBulkActions(){return Array.from(this.actions.values()).filter(e=>e.bulkEnabled).sort((e,t)=>(e.priority??100)-(t.priority??100)).map(e=>e.action)}getShortcuts(){return[...this.shortcuts]}getAction(e){return this.actions.get(e)?.action}async executeAction(e,t){let n=this.actions.get(e);return n?(t&&this.runner.updateContext(t),this.runner.execute(n.action)):{success:!1,error:`Action not found: ${e}`}}async handleShortcut(e,t){let n=this.normalizedShortcutMap.get(xa(e));return n?this.executeAction(n,t):null}async executeBulk(e,t,n){let r=this.actions.get(e);if(!r)return{total:0,succeeded:0,failed:0,results:[{success:!1,error:`Action not found: ${e}`}]};if(!r.bulkEnabled)return{total:0,succeeded:0,failed:0,results:[{success:!1,error:`Action ${e} does not support bulk operations`}]};let i=[],a=0,o=0;if(n?.parallel){let e=t.map(e=>(this.runner.updateContext({record:e,selectedRecords:t}),this.runner.execute(r.action))),n=await Promise.allSettled(e);for(let e of n)e.status===`fulfilled`?(i.push(e.value),e.value.success?a++:o++):(i.push({success:!1,error:e.reason?.message||`Unknown error`}),o++)}else for(let e of t){this.runner.updateContext({record:e,selectedRecords:t});let s=await this.runner.execute(r.action);if(i.push(s),s.success)a++;else if(o++,!n?.continueOnError)break}return{total:t.length,succeeded:a,failed:o,results:i}}updateContext(e){this.runner.updateContext(e)}clear(){this.actions.clear(),this.shortcuts=[],this.normalizedShortcutMap.clear()}};async function Ta(e,t){let{ids:n,allowBulk:r,offset:i,label:a=`bulk`}=e,o={succeeded:0,failed:0,errors:[]};if(r&&typeof t.bulkCall==`function`)try{let e=await t.bulkCall(n),r=Math.max(0,Math.min(e,n.length));o.succeeded+=r;let s=n.length-r;return s>0&&(o.failed+=s,o.errors.push({id:`batch_${i}`,error:`${s} record${s===1?``:`s`} failed in ${a}`})),o}catch{}return(await Promise.allSettled(n.map(e=>t.perRow(e)))).forEach((e,t)=>{e.status===`fulfilled`?o.succeeded+=1:(o.failed+=1,o.errors.push({id:n[t],error:e.reason instanceof Error?e.reason.message:String(e.reason)}))}),o}function Ea(e){let t=e.locations;return Array.isArray(t)?t.some(e=>e===`list_item`||e===`record_header`||e===`record_more`||e===`record_section`):!1}function Da(e,t){let n=e.params&&!Array.isArray(e.params)?e.params:{},r=n._rowRecord,i=e.recordIdField||`id`,a=n.recordId??r?.[i],o=Array.isArray(n._selectedIds);if(a==null&&!o){let n=Array.isArray(t?.selectedRecords)?t.selectedRecords:[];if(n.length===1)a=n[0]?.[i];else if(n.length>1)return{error:`This action runs on a single record — select exactly one row.`};else if(Ea(e))return{error:`This action runs on a single record — select a row first.`}}return{recordId:a??void 0}}function Oa(e){let{fetch:t,resolveObject:n,onRefresh:r}=e,i=e.resolveRecordId??Da,a=new Set;return async function(o,s){let c=o.name;if(!c)return{success:!1,error:`Action has no name — a server action must declare one`};let l=o.params&&!Array.isArray(o.params)?{...o.params}:{};delete l._rowRecord;let u=i(o,s);if(u.error)return{success:!1,error:u.error};let d=u.recordId,f=`${c}:${d??``}`;if(a.has(f))return{success:!1,error:`Action already in progress`};a.add(f);try{let i=typeof e.baseUrl==`function`?e.baseUrl():e.baseUrl??``,a=o.objectName||n?.(o,s)||`global`,u=await t(`${i}/api/v1/actions/${encodeURIComponent(a)}/${encodeURIComponent(c)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:d,params:l})}),f=ca(u,await u.json().catch(()=>null),`Action "${c}"`);if(!f.ok)return{success:!1,error:f.error};let p=o.refreshAfter!==!1;return p&&r?.(),{success:!0,data:f.envelope,reload:p}}catch(e){return{success:!1,error:e.message}}finally{a.delete(f)}}}function ka(e,t){let n=e?.recordIdParam;if(!n||!t||typeof t!=`object`)return{};let r=e?.recordIdField||`id`,i=e?.label||e?.name||n;if(!(r in t))return{error:`Action "${i}" identifies its record by "${r}", but that field is not present on the row. Add it to the view's columns, or check that it is readable — running without it would send a request that names no record.`};let a=t[r];return a==null?{error:`Action "${i}" identifies its record by "${r}", but this record has no value for it — running without it would send a request that names no record.`}:{value:a}}var Aa=`sys_permission_set`;function ja(e){return e?.managed_by===`package`}var Ma=Object.freeze({confirmText(e,t){let{objectName:n,t:r}=e;return n===Aa&&ja(t)?r(`objectActions.resetPackageSetConfirm`,{defaultValue:`This permission set ships with an installed package and cannot be removed. Deleting resets it to the shipped baseline and discards your environment customization. Continue?`}):r(`objectActions.deleteConfirm`)},async run(e,t){let{objectName:n,t:r,label:i,dataSource:a,toast:o,onRefresh:s}=e,c=t.params,l=Array.isArray(c?.records)?c.records.filter(e=>e?.id!=null):null;if(l&&l.length>1){let e=await Promise.allSettled(l.map(e=>a.delete(n,e.id))),t=e.filter(e=>e.status===`rejected`).length,c=e.length-t;return s?.(),t===0?(o.success(r(`objectActions.bulkDeleteSuccess`,{count:c,label:i,defaultValue:`Deleted ${c} ${i} records`})),{success:!0,reload:!0,silent:!0}):(o.error(r(`objectActions.bulkDeletePartial`,{succeeded:c,failed:t,defaultValue:`${c} deleted, ${t} failed`})),{success:!1})}let u=c?.recordId??c?.record?.id??l?.[0]?.id??t.recordId;if(!u)return{success:!1,error:r(`objectActions.noRecordId`)};let d=!1;if(n===Aa)try{d=ja(c?.record?.managed_by===void 0?await a.findOne(n,u):c.record)}catch{}try{return await a.delete(n,u),s?.(),o.success(d?r(`objectActions.resetPackageSetSuccess`,{defaultValue:`Permission set reset to its shipped baseline`}):r(`objectActions.deleteSuccess`,{label:i})),{success:!0,reload:!0,silent:!0}}catch(e){return o.error(r(`objectActions.deleteFailed`,{label:i}),{description:e.message}),{success:!1}}}});function Na(e){if(e!=null)return e.id??e._id??e.recordId}function Pa(e,t){let n={};for(let[r,i]of Object.entries(e))if(i&&typeof i==`object`&&!Array.isArray(i)&&typeof i.$ref==`number`){let e=i.$ref,a=Na(t[e]);if(a===void 0)throw Error(`batchTransaction: field "${r}" references operation ${e}, which has not produced an id (forward or invalid $ref)`);n[r]=a}else n[r]=i;return n}async function Fa(e,t){let n=[],r=[];try{for(let i of t){let t=i.action??`create`;if(t===`create`){let t=await e.create(i.object,Pa(i.data??{},n));n.push(t);let a=Na(t);a&&r.push({object:i.object,id:a})}else if(t===`update`){if(i.id==null)throw Error(`batchTransaction: update on "${i.object}" requires an id`);n.push(await e.update(i.object,i.id,Pa(i.data??{},n)))}else{if(i.id==null)throw Error(`batchTransaction: delete on "${i.object}" requires an id`);n.push(await e.delete(i.object,i.id))}}return{results:n}}catch(t){throw r.length>0&&await Promise.allSettled([...r].reverse().map(t=>e.delete(t.object,t.id))),t}}function Ia(e,t){return typeof e.batchTransaction==`function`?e.batchTransaction(t):Fa(e,t)}function La(e,t,n){let r=e;if(t&&(r=r.replace(/\/+$/,``)+`/`+t.replace(/^\/+/,``)),n&&Object.keys(n).length>0){let e=new URLSearchParams;for(let[t,r]of Object.entries(n))r!=null&&e.set(t,String(r));let t=e.toString();t&&(r+=(r.includes(`?`)?`&`:`?`)+t)}return r}function Ra(e){if(!e)return{};let t={};return e.$select?.length&&(t.$select=e.$select.join(`,`)),e.$filter&&Object.keys(e.$filter).length>0&&(t.$filter=JSON.stringify(e.$filter)),e.$orderby&&(t.$orderby=typeof e.$orderby==`string`?e.$orderby:Array.isArray(e.$orderby)?typeof e.$orderby[0]==`string`?e.$orderby.join(`,`):e.$orderby.map(e=>`${e.field} ${e.order||`asc`}`).join(`,`):Object.entries(e.$orderby).map(([e,t])=>`${e} ${t}`).join(`,`)),e.$skip!==void 0&&(t.$skip=e.$skip),e.$top!==void 0&&(t.$top=e.$top),e.$expand?.length&&(t.$expand=e.$expand.join(`,`)),e.$search&&(t.$search=e.$search),e.$count&&(t.$count=`true`),t}function za(e,t){return{...e,...t}}var Ba=class{readConfig;writeConfig;fetchFn;defaultHeaders;constructor(e){this.readConfig=e.read,this.writeConfig=e.write,this.fetchFn=e.fetch??globalThis.fetch.bind(globalThis),this.defaultHeaders=e.defaultHeaders??{}}async request(e,t={}){if(!e)throw Error(`ApiDataSource: No HTTP configuration provided for this operation. Ensure the ViewData has read/write configs.`);let n=t.method??e.method??`GET`,r={...e.params,...t.queryParams},i=La(e.url,t.pathSuffix,r),a=za(za(this.defaultHeaders,e.headers),t.headers),o={method:n,headers:a};t.body!==void 0&&n!==`GET`&&(t.body instanceof FormData||t.body instanceof Blob?o.body=t.body:typeof t.body==`string`?(o.body=t.body,a[`Content-Type`]||=`text/plain`):(o.body=JSON.stringify(t.body),a[`Content-Type`]||=`application/json`));let s=await this.fetchFn(i,o);if(!s.ok){let e=await s.text().catch(()=>``);throw Error(`ApiDataSource: HTTP ${s.status} ${s.statusText} — ${e}`)}return(s.headers.get(`content-type`)??``).includes(`application/json`)?s.json():await s.text()}async find(e,t){let n=Ra(t),r=await this.request(this.readConfig,{method:`GET`,queryParams:n});return this.normalizeQueryResult(r)}async findOne(e,t,n){try{let e=Ra(n);return await this.request(this.readConfig,{pathSuffix:String(t),method:`GET`,queryParams:e})??null}catch{return null}}async create(e,t){let n=this.writeConfig??this.readConfig;return this.request(n,{method:`POST`,body:t})}async update(e,t,n,r){let i=this.writeConfig??this.readConfig;return this.request(i,{pathSuffix:String(t),method:`PATCH`,body:n,...r?.ifMatch?{headers:{"If-Match":String(r.ifMatch)}}:{}})}async delete(e,t,n){let r=this.writeConfig??this.readConfig;try{return await this.request(r,{pathSuffix:String(t),method:`DELETE`,...n?.ifMatch?{headers:{"If-Match":String(n.ifMatch)}}:{}}),!0}catch{return!1}}batchTransaction(e){return Fa(this,e)}async getObjectSchema(e){return{name:e,fields:{}}}async getView(e,t){return null}async getApp(e){return null}async aggregate(e,t){let n={field:t.field,function:t.function,groupBy:t.groupBy};t.filter&&(n.filter=typeof t.filter==`string`?t.filter:JSON.stringify(t.filter));let r=await this.request(this.readConfig,{pathSuffix:`aggregate`,method:`GET`,queryParams:n});return Array.isArray(r)?r:r?.data&&Array.isArray(r.data)?r.data:r?.results&&Array.isArray(r.results)?r.results:[]}normalizeQueryResult(e){if(Array.isArray(e))return{data:e,total:e.length};if(e&&typeof e==`object`){if(Array.isArray(e.data)&&(`total`in e||`totalCount`in e))return{data:e.data,total:e.total??e.totalCount??e.data.length,hasMore:e.hasMore,cursor:e.cursor};for(let t of[`data`,`items`,`results`,`records`,`value`])if(Array.isArray(e[t]))return{data:e[t],total:e.total??e.totalCount??e.count??e[t].length,hasMore:e.hasMore??e.hasNextPage};return{data:[e],total:1}}return{data:[],total:0}}};T();function H(e,t){return t?e[t]:e.id??e._id}function U(e,t){return e.add(`[ObjectUI] ValueDataSource: ${t}. Rows are excluded rather than passed through.`),!1}function Va(e){return`filter rule refused as it is lowered: ${e.message.replace(/^\[ObjectUI\]\s*/,``).replace(/\.\s*$/,``)}`}var Ha=new Set([`$in`,`$nin`,`$between`]),Ua=new Set([`in`,`nin`,`between`]),Wa=new Set([`is_null`,`is_not_null`]);function Ga(e,t,n){return U(e,`filter comparand for field '${t}' on operator '${n}' is an ARRAY, which is a declared comparand only for $in / $nin / $between. The spec leaves an array in any other position unruled and the sibling in-memory matcher (@objectstack/formula) refuses it; express membership as { ${t}: { $in: [...] } } or its negation { ${t}: { $nin: [...] } }`)}function Ka(e,t,n,r){return U(e,oe(t,n,r))}var qa=new Set([`$eq`,`$ne`,`$gt`,`$gte`,`$lt`,`$lte`]),Ja=new Set([`=`,`!=`,`>`,`>=`,`<`,`<=`]),Ya=Symbol(`ValueDataSource:refused-comparand`);function Xa(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&`$field`in e}function Za(e,t,n,r,i,a,o){let s=t.$field;return typeof s==`string`?a.has(n)?`addDays`in t&&t.addDays!==void 0?(U(o,`the { $field } reference on field '${i}' carries an addDays offset, which is defined against the referenced column's temporal class; this matcher has no field types to read one from, and answering without the offset would compare against an unshifted column and return the wrong rows`),Ya):s.includes(`.`)?(U(o,`the { $field } reference on field '${i}' names the dotted path '${s}'; this matcher addresses a flat record, so a dotted reference would not mean the same thing as the dotted field name on the other side of the comparison`),Ya):e[s]:(U(o,`a { $field } reference is not a comparand for operator '${r}' on field '${i}'. It is declared only on the six scalar comparisons ($eq/$ne/$gt/$gte/$lt/$lte and their AST spellings); the spec removed it from $in / $nin members and $between endpoints because no backend resolves one there`),Ya):(U(o,`filter comparand for field '${i}' carries a non-string $field (${ge(s)}); a field reference declares $field as a string, so this is not one on any path`),Ya)}function Qa(e,t,n){return U(e,`a { $field } reference appears inside the list comparand of '${n}' on field '${t}'. A reference may be the WHOLE comparand of a scalar comparison, never a member of $in / $nin nor an endpoint of $between — the spec removed those positions because no evaluation path resolved them`)}function W(e,t){if(e instanceof Date&&t instanceof Date){let n=e.getTime();return!Number.isNaN(n)&&n===t.getTime()}return e===t}function $a(e,t,n){let r=t[0],a=t[1],o=a===`not in`?`nin`:re(a),s=e[r],c=t[2];if(Array.isArray(c)&&!Ua.has(o)&&!Wa.has(o))return Ga(n,r,String(a));if(Array.isArray(c)&&c.some(Xa))return Qa(n,r,String(a));let l=Xa(c)?Za(e,c,o,String(a),r,Ja,n):c;if(l===Ya)return!1;switch(o){case`is_null`:return s==null;case`is_not_null`:return s!=null;case`=`:return W(s,l);case`!=`:return!W(s,l);case`>`:return s>l;case`>=`:return s>=l;case`<`:return s<l;case`<=`:return s<=l;case`in`:return Array.isArray(l)&&l.some(e=>W(s,e));case`nin`:return Array.isArray(l)&&!l.some(e=>W(s,e));case`contains`:return typeof s==`string`&&s.includes(String(l));case`icontains`:return i(l)?Ka(n,r,String(a),l):typeof s==`string`&&ne(s,l);case`not_contains`:return!(typeof s==`string`&&s.includes(String(l)));case`starts_with`:return typeof s==`string`&&s.startsWith(String(l));case`ends_with`:return typeof s==`string`&&s.endsWith(String(l));case`between`:return Array.isArray(l)&&l.length===2&&s>=l[0]&&s<=l[1];default:return U(n,`filter operator '${String(a)}' is not implemented by the in-memory matcher`)}}function eo(e,t,n){if(!Array.isArray(t))return U(n,`filter node ${JSON.stringify(t)??String(t)} is not an array`);if(t.length===0)return!0;let r=t[0];if(typeof r==`string`){let i=r.toLowerCase();if(i===`and`||i===`or`){if(t.length<2)return U(n,`'${i}' group carries no conditions`);let r=t.slice(1);return i===`and`?r.every(t=>eo(e,t,n)):r.some(t=>eo(e,t,n))}}return Array.isArray(r)?t.every(t=>eo(e,t,n)):typeof r==`string`&&typeof t[1]==`string`&&t.length<=3?$a(e,t,n):U(n,`filter node ${JSON.stringify(t)} is not a shape the matcher reads`)}function to(e,t,n,r,a,o){if(Array.isArray(r)&&!Ha.has(n))return Ga(o,a,n);if(Array.isArray(r)&&r.some(Xa))return Qa(o,a,n);let s=Xa(r)?Za(e,r,n,n,a,qa,o):r;if(s===Ya)return!1;switch(n){case`$eq`:return W(t,s);case`$ne`:return!W(t,s);case`$gt`:return t>s;case`$gte`:return t>=s;case`$lt`:return t<s;case`$lte`:return t<=s;case`$in`:return Array.isArray(s)&&s.some(e=>W(t,e));case`$nin`:return Array.isArray(s)&&!s.some(e=>W(t,e));case`$between`:return Array.isArray(s)&&s.length===2&&t>=s[0]&&t<=s[1];case`$contains`:return typeof t==`string`&&t.includes(String(s));case`$icontains`:return i(s)?Ka(o,a,n,s):typeof t==`string`&&ne(t,s);case`$notContains`:return!(typeof t==`string`&&t.includes(String(s)));case`$startsWith`:return typeof t==`string`&&t.startsWith(String(s));case`$endsWith`:return typeof t==`string`&&t.endsWith(String(s));case`$null`:return s?t==null:t!=null;case`$exists`:return s?t!=null:t==null;case`$field`:return U(o,`field '${a}' carries a bare { $field } object, which reads as an operator named '$field' rather than as a comparand. Write the explicit comparison { ${a}: { $eq: { $field: ${JSON.stringify(String(r))} } } }`);default:{let e=se[n];return e?U(o,`filter operator '${n}' on field '${a}' is retired. ${e.why}`):n.startsWith(`$`)?U(o,`filter operator '${n}' on field '${a}' is not implemented by the in-memory matcher`):U(o,`filter condition on field '${a}' carries the non-operator key '${n}'; the in-memory matcher does not descend into a nested relation constraint`)}}}function no(e,t,n,r){if(!Array.isArray(n))return U(r,`filter combinator '${t}' takes an ARRAY of conditions; received ${typeof n==`object`&&n?`an object`:typeof n}: ${JSON.stringify(n)??String(n)}. The spec declares '${t}?: FilterCondition[]' (FilterConditionSchema, data/filter.zod.ts)`);for(let e of n)if(typeof e!=`object`||!e||Array.isArray(e))return U(r,`every member of filter combinator '${t}' must be a filter condition OBJECT; received ${JSON.stringify(e)??String(e)}. The spec declares '${t}?: FilterCondition[]' (FilterConditionSchema, data/filter.zod.ts)`);return t===`$and`?n.every(t=>ro(e,t,r)):n.some(t=>ro(e,t,r))}function ro(e,t,n){for(let[r,i]of Object.entries(t)){if(r===`$and`||r===`$or`){if(!no(e,r,i,n))return!1;continue}if(r===`$not`)return U(n,`filter combinator '$not' is not executed by the object-dialect matcher. Its NULL-safe semantics are ruled (objectstack#5146) but this repo's own lowering refuses it too: FILTER_ARRAY_LOGIC_KEYWORDS is ['and', 'or'], so the filter AST has no negation keyword, and rewriting the negation inward would be silently partial ('startswith', 'endswith', 'between' and 'icontains' have no negated counterpart). Express the negation with a negated operator instead ($ne, $nin, $notContains); note those follow each operator's own answer for a missing value rather than $not's NULL-safe rule`);if(r.startsWith(`$`))return U(n,`filter key '${r}' is not a field name and not one of the combinators this matcher executes ($and / $or). The spec's LOGICAL_OPERATORS are $and / $or / $not and nothing else`);let t=e[r];if(i&&typeof i==`object`&&!Array.isArray(i)&&!b(i)){for(let[a,o]of Object.entries(i))if(!to(e,t,a,o,r,n))return!1}else if(Array.isArray(i))return Ga(n,r,`implicit equality`);else if(!W(t,i))return!1}return!0}function io(e){for(let[t,n]of Object.entries(e)){if(t===`$and`||t===`$or`){if(!Array.isArray(n))continue;for(let e of n){if(typeof e!=`object`||!e||Array.isArray(e))continue;let t=io(e);if(t)return t}continue}if(t.startsWith(`$`)||typeof n!=`object`||!n||Array.isArray(n)||Object.keys(n).length>0)continue;let e=Pe({[t]:n});if(!e.ok)return e.refusal}}function ao(e,t){if(!t)return e;let n=[];return Array.isArray(t)?n=t.map(e=>typeof e==`string`?e.startsWith(`-`)?{field:e.slice(1),order:`desc`}:{field:e,order:`asc`}:{field:e.field,order:e.order??`asc`}):typeof t==`object`&&(n=Object.entries(t).map(([e,t])=>({field:e,order:t}))),n.length===0?e:[...e].sort((e,t)=>{for(let{field:r,order:i}of n){let n=e[r],a=t[r];if(n===a)continue;if(n==null)return i===`asc`?-1:1;if(a==null)return i===`asc`?1:-1;let o=n<a?-1:1;return i===`asc`?o:-o}return 0})}function oo(e,t){if(!t||t.length===0)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}var so=class{items;idField;mutationListeners=new Set;constructor(e){this.items=structuredClone(e.items),this.idField=e.idField}emitMutation(e){for(let t of this.mutationListeners)try{t(e)}catch(e){console.warn(`ValueDataSource: mutation listener error`,e)}}async find(e,t){let n=[...this.items];if(t?.$filter){let e=new Set;if(Array.isArray(t.$filter)){let r=Pe(t.$filter);if(!r.ok)U(e,Va(r.refusal)),n=[];else if(Array.isArray(r.node)&&r.node.length>0){let t=r.node;n=n.filter(n=>eo(n,t,e))}}else if(Object.keys(t.$filter).length>0){let r=t.$filter,i=io(r);i?(U(e,Va(i)),n=[]):n=n.filter(t=>ro(t,r,e))}for(let t of e)console.warn(t)}if(t?.$search){let e=t.$search.toLowerCase();n=n.filter(t=>Object.values(t).some(t=>typeof t==`string`&&t.toLowerCase().includes(e)))}let r=n.length;n=ao(n,t?.$orderby);let i=t?.$skip??0,a=t?.$top;return i>0&&(n=n.slice(i)),a!==void 0&&(n=n.slice(0,a)),t?.$select?.length&&(n=n.map(e=>oo(e,t.$select))),{data:n,total:r,hasMore:i+(a??n.length)<r}}async findOne(e,t,n){let r=this.items.find(e=>String(H(e,this.idField))===String(t));return r?n?.$select?.length?oo(r,n.$select):{...r}:null}async create(e,t){let n={...t};if(!H(n,this.idField)){let e=this.idField??`id`;n[e]=`auto_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}return this.items.push(n),this.emitMutation({type:`create`,resource:e,record:{...n}}),{...n}}async update(e,t,n){let r=this.items.findIndex(e=>String(H(e,this.idField))===String(t));if(r===-1)throw Error(`ValueDataSource: Record with id "${t}" not found`);return this.items[r]={...this.items[r],...n},this.emitMutation({type:`update`,resource:e,id:String(t),record:{...this.items[r]}}),{...this.items[r]}}async delete(e,t){let n=this.items.findIndex(e=>String(H(e,this.idField))===String(t));return n!==-1&&(this.items.splice(n,1),this.emitMutation({type:`delete`,resource:e,id:String(t)}),!0)}async bulk(e,t,n){let r=[];for(let i of n)switch(t){case`create`:r.push(await this.create(e,i));break;case`update`:{let t=H(i,this.idField);t!==void 0&&r.push(await this.update(e,t,i));break}case`delete`:{let t=H(i,this.idField);t!==void 0&&await this.delete(e,t);break}}return r}batchTransaction(e){return Fa(this,e)}async getObjectSchema(e){if(this.items.length===0)return{name:e,fields:{}};let t=this.items[0],n={};for(let[e,r]of Object.entries(t))n[e]={type:typeof r};return{name:e,fields:n}}async getView(e,t){return null}async getApp(e){return null}async aggregate(e,t){let{field:n,function:r,groupBy:i}=t,a={};for(let e of this.items){let t=String(e[i]??`Unknown`);a[t]||(a[t]=[]),a[t].push(e)}return Object.entries(a).map(([e,t])=>{let a=t.map(e=>Number(e[n])||0),o;switch(r){case`count`:o=t.length;break;case`avg`:o=a.length>0?a.reduce((e,t)=>e+t,0)/a.length:0;break;case`min`:o=a.length>0?Math.min(...a):0;break;case`max`:o=a.length>0?Math.max(...a):0;break;default:o=a.reduce((e,t)=>e+t,0)}return{[i]:e,[n]:o}})}onMutation(e){return this.mutationListeners.add(e),()=>{this.mutationListeners.delete(e)}}get count(){return this.items.length}getAll(){return structuredClone(this.items)}};function co(e,t,n){if(!e)return t??null;switch(e.provider){case`object`:return t??null;case`api`:return new Ba({read:e.read,write:e.write,fetch:n?.fetch,defaultHeaders:n?.defaultHeaders});case`value`:return new so({items:e.items??[],idField:n?.idField});default:return t??null}}var G=`https://objectui.dev/docs/errors`,lo={"OBJUI-001":{code:`OBJUI-001`,message:'Unknown component type: "${type}"',suggestion:`Ensure the component is registered via registry.register() before rendering. Check for typos in the component type name.`,docUrl:`${G}/OBJUI-001`},"OBJUI-002":{code:`OBJUI-002`,message:"Schema validation failed: ${reason}",suggestion:`Verify the schema against the ObjectUI JSON spec. Run the built-in schema validator for details.`,docUrl:`${G}/OBJUI-002`},"OBJUI-003":{code:`OBJUI-003`,message:"Expression evaluation failed: ${expression}",suggestion:`Check the expression syntax and ensure all referenced variables exist in the current data scope.`,docUrl:`${G}/OBJUI-003`},"OBJUI-004":{code:`OBJUI-004`,message:'Plugin dependency missing: "${dependency}"',suggestion:`Install the required dependency and register it before loading this plugin.`,docUrl:`${G}/OBJUI-004`},"OBJUI-005":{code:`OBJUI-005`,message:'Plugin already loaded: "${plugin}"',suggestion:`A plugin with the same name is already registered. Remove the duplicate or use a unique plugin name.`,docUrl:`${G}/OBJUI-005`},"OBJUI-006":{code:`OBJUI-006`,message:'Plugin not found: "${plugin}"',suggestion:`Verify the plugin name and ensure it has been registered before access.`,docUrl:`${G}/OBJUI-006`},"OBJUI-007":{code:`OBJUI-007`,message:'Registry namespace deprecated: "${namespace}"',suggestion:`Migrate to the new namespace format. See the migration guide for details.`,docUrl:`${G}/OBJUI-007`},"OBJUI-008":{code:`OBJUI-008`,message:'Read-only scope violation: "${scope}"',suggestion:`You are trying to mutate a read-only data scope. Use a writable scope or clone the data before modifying.`,docUrl:`${G}/OBJUI-008`},"OBJUI-009":{code:`OBJUI-009`,message:'Invalid field configuration: "${field}"',suggestion:`Check the field schema for required properties (type, name). Ensure the field widget is registered.`,docUrl:`${G}/OBJUI-009`},"OBJUI-010":{code:`OBJUI-010`,message:'Action execution failed: "${action}"',suggestion:`Verify the action handler is registered and that all required parameters are provided.`,docUrl:`${G}/OBJUI-010`}},uo=class extends Error{code;details;constructor(e,t,n){super(e),this.code=t,this.details=n,this.name=`ObjectUIError`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,details:this.details,stack:this.stack}}};function fo(e){return e instanceof uo}var K=`__debug`;function po(e){let t=e;if(t===void 0)try{t=typeof window<`u`?window.location.search:``}catch{t=``}let n=new URLSearchParams(t),r=n.has(K),i=n.has(`${K}_schema`),a=n.has(`${K}_perf`),o=n.has(`${K}_data`),s=n.has(`${K}_expr`),c=n.has(`${K}_events`),l=n.has(`${K}_registry`);return{enabled:r||i||a||o||s||c||l,...i&&{schema:i},...a&&{perf:a},...o&&{data:o},...s&&{expr:s},...c&&{events:c},...l&&{registry:l}}}function mo(){try{if(typeof window<`u`)try{if(po(window.location.search).enabled)return!0}catch{}let e=typeof globalThis<`u`&&globalThis.OBJECTUI_DEBUG;return e===!0||e===`true`||globalThis.process?.env?.OBJECTUI_DEBUG===`true`}catch{return!1}}function ho(e,t,n){mo()&&(n===void 0?console.log(`[ObjectUI Debug][${e}] ${t}`):console.log(`[ObjectUI Debug][${e}] ${t}`,n))}var go=new Map;function _o(e){mo()&&go.set(e,performance.now())}function vo(e){if(!mo())return;let t=go.get(e);if(t!==void 0){let n=(performance.now()-t).toFixed(2);console.log(`[ObjectUI Debug][perf] ${e}: ${n}ms`),go.delete(e)}}var yo=200,bo=class e{static instance=null;entries=[];subscribers=new Set;static getInstance(){return e.instance||=new e,e.instance}static resetInstance(){e.instance=null}addPerf(e){this.push({kind:`perf`,data:e})}addExpr(e){this.push({kind:`expr`,data:e})}addEvent(e){this.push({kind:`event`,data:e})}getEntries(e){return e?this.entries.filter(t=>t.kind===e):this.entries.slice()}clear(){this.entries=[]}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}push(e){this.entries.push(e),this.entries.length>yo&&(this.entries=this.entries.slice(-200));for(let t of this.subscribers)try{t(e)}catch{}}},xo={medium:991,small:640,xsmall:479},So=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Co=e=>Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,t])=>`${So(e)}: ${typeof t==`number`?String(t):t} !important;`).join(` `);function wo(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!(t.large||t.medium||t.small||t.xsmall)}function To(e){return`os-s-${String(e).replace(/[^a-zA-Z0-9_-]/g,`-`)}`}function Eo(e,t){let n=[];if(t.large){let r=Co(t.large);r&&n.push(`${e} { ${r} }`)}for(let r of[`medium`,`small`,`xsmall`]){let i=t[r];if(!i)continue;let a=Co(i);a&&n.push(`@media (max-width: ${xo[r]}px) { ${e} { ${a} } }`)}return n.join(`
|
|
3
|
+
`)}var Do={"react-pages":!0},Oo=new Map,ko=!1;function Ao(){if(ko)return;ko=!0;let e=globalThis;if(Array.isArray(e.__OBJECTUI_CAPABILITIES__))for(let t of e.__OBJECTUI_CAPABILITIES__)typeof t==`string`&&!Oo.has(t)&&Oo.set(t,!0);if(Array.isArray(e.__OBJECTUI_CAPABILITIES_DISABLED__))for(let t of e.__OBJECTUI_CAPABILITIES_DISABLED__)typeof t==`string`&&Oo.set(t,!1)}function jo(e){Ao();let t=Oo.get(e);return t===void 0?Do[e]??!1:t}var Mo=`react-pages`;T();var No=/\$\{event\.([a-zA-Z0-9_]+)\}/g;function Po(e,t){return typeof e!=`string`||e.indexOf("${event.")===-1?e:e.replace(No,(e,n)=>{let r=t[n];return r==null?``:String(r)})}function Fo(e,t){if(typeof e==`string`){let n=e.match(/^\$\{event\.([a-zA-Z0-9_]+)\}$/);if(n){let e=t[n[1]];return e===``||e===void 0?null:e}return Po(e,t)}if(Array.isArray(e))return e.map(e=>Fo(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=Fo(i,t);return n}return e}function Io(e,t,n={}){if(e?.filter)return Fo(e.filter,t);let r={},{rowField:i,columnField:a,groupByField:o}=n,s=t.scope??`cell`;return s===`total`?r:((s===`cell`||s===`row`)&&i&&`rowKey`in t&&(r[i]=t.rowKey===``?null:t.rowKey),(s===`cell`||s===`column`)&&a&&`colKey`in t&&(r[a]=t.colKey===``?null:t.colKey),o&&`category`in t&&(r[o]=t.category===``?null:t.category),r)}function Lo(e,t,n=`Details`){if(e?.title){let n=Po(e.title,t).trim();if(n)return n}let r=[];return t.rowLabel&&r.push(t.rowLabel),t.colLabel&&r.push(t.colLabel),t.categoryLabel?r.push(t.categoryLabel):t.category&&r.push(t.category),t.series&&r.push(t.series),r.length>0?r.join(` × `):n}function Ro(e){return e?e.enabled!==!1:!1}function zo(e,t){let n=Fe(e,t);try{return l(n)}catch(e){throw e?.code===`INVALID_FILTER`?new E(e.message):e}}function Bo(e,t=new Date){if(e==null)return e;let n=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t},r=e=>{let t=n(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`},i=e=>{let t=n(e),r=(t.getDay()+6)%7;return t.setDate(t.getDate()-r),t},a=e=>new Date(e.getFullYear(),e.getMonth(),1),o=e=>{let t=Math.floor(e.getMonth()/3);return new Date(e.getFullYear(),t*3,1)},s=e=>new Date(e.getFullYear(),0,1),c=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,1),l=(e,t)=>{let r=n(e);return r.setDate(r.getDate()+t),r},u=e=>l(c(a(e),1),-1),d=e=>l(i(e),6),f=e=>l(c(o(e),3),-1),p=e=>new Date(e.getFullYear(),11,31),m={today:()=>r(t),yesterday:()=>r(l(t,-1)),tomorrow:()=>r(l(t,1)),now:()=>t.toISOString(),current_week_start:()=>r(i(t)),current_week_end:()=>r(d(t)),current_month_start:()=>r(a(t)),current_month_end:()=>r(u(t)),current_quarter_start:()=>r(o(t)),current_quarter_end:()=>r(f(t)),current_year_start:()=>r(s(t)),current_year_end:()=>r(p(t)),last_week_start:()=>r(l(i(t),-7)),last_week_end:()=>r(l(i(t),-1)),last_month_start:()=>r(c(a(t),-1)),last_month_end:()=>r(l(a(t),-1)),last_quarter_start:()=>r(c(o(t),-3)),last_quarter_end:()=>r(l(o(t),-1)),last_year_start:()=>r(new Date(t.getFullYear()-1,0,1)),last_year_end:()=>r(new Date(t.getFullYear()-1,11,31)),next_week_start:()=>r(l(i(t),7)),next_month_start:()=>r(c(a(t),1)),next_quarter_start:()=>r(c(o(t),3)),next_year_start:()=>r(new Date(t.getFullYear()+1,0,1))};for(let[e,t]of Object.entries({week_start:`current_week_start`,week_end:`current_week_end`,month_start:`current_month_start`,month_end:`current_month_end`,quarter_start:`current_quarter_start`,quarter_end:`current_quarter_end`,year_start:`current_year_start`,year_end:`current_year_end`}))m[e]=m[t];let h=/^(\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/,g=e=>{let n=e.match(h);if(!n)return null;let i=parseInt(n[1],10);if(!Number.isFinite(i))return null;let a=n[3]===`ago`?-1:1,o=n[2].replace(/s$/,``);if(o===`minute`)return new Date(t.getTime()+a*i*60*1e3).toISOString();if(o===`hour`)return new Date(t.getTime()+a*i*60*60*1e3).toISOString();if(o===`day`)return r(l(t,a*i));if(o===`week`)return r(l(t,a*i*7));if(o===`month`){let e=new Date(t.getFullYear(),t.getMonth()+a*i,t.getDate());return r(e)}if(o===`year`){let e=new Date(t.getFullYear()+a*i,t.getMonth(),t.getDate());return r(e)}return null},_=/\$?\{([a-zA-Z0-9_]+)\}/g,v=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.match(/^\$?\{([a-zA-Z0-9_]+)\}$/);if(t){let e=t[1];if(m[e])return m[e]();let n=g(e);if(n!=null)return n}let n=!1,r=e.replace(_,(e,t)=>{if(m[t])return n=!0,m[t]();let r=g(t);return r==null?e:(n=!0,r)});return n?r:e}if(Array.isArray(e))return e.map(v);if(typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n={};for(let t of Object.keys(e))n[t]=v(e[t]);return n}return e};return v(e)}T();var Vo=/^\$?\{([a-zA-Z0-9_]+)\}$/,Ho=Object.assign(Object.create(null),f);function Uo(e,t={}){if(e==null)return e;let{currentUserId:n,currentOrgId:r,recordId:i}=t,a=t.onUnresolved===null?()=>{}:t.onUnresolved??(e=>{console.warn(`[object-ui] ${e}`)}),o={current_user_id:n,current_org_id:r},s={record_id:i},c=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.match(Vo);if(!t)return e;let n=t[1];if(m(n)){let t=o[n];return t!=null&&t!==``?t:(a(`Filter placeholder "{${n}}" could not be resolved — no ${n===`current_user_id`?`signed-in user`:`active organization`} in scope. The filter will match no records.`),e)}if(ee(n)){let t=s[n];return t!=null&&t!==``?t:(a(`Filter placeholder "{${n}}" could not be resolved — no record in context on this surface. It resolves only on a component of a \`type: 'record'\` page, to the id of the record that page shows. It is left as written, so the filter never widens: the server refuses it by name, and a backend with no resolver matches no records.`),e)}let r=Ho[n.toLowerCase()];return r&&a(`Filter placeholder "{${n}}" is not a recognised token — did you mean "{${r}}"? It is sent to the server as a literal string and will match no records.`),e}if(Array.isArray(e))return e.map(c);if(typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n={};for(let t of Object.keys(e))n[t]=c(e[t]);return n}return e};return c(e)}function Wo(e,t={},n=new Date){return e==null?e:Uo(Bo(e,n),t)}var Go=`dateRange`,Ko=`created_at`,qo;function Jo(){return qo===void 0&&(qo=ae.shape.dateRange.parse({})?.defaultRange),qo}var Yo={today:{from:`{today}`,to:`{today}`},yesterday:{from:`{yesterday}`,to:`{yesterday}`},this_week:{from:`{current_week_start}`,to:`{current_week_end}`},last_week:{from:`{last_week_start}`,to:`{last_week_end}`},this_month:{from:`{current_month_start}`,to:`{current_month_end}`},last_month:{from:`{last_month_start}`,to:`{last_month_end}`},this_quarter:{from:`{current_quarter_start}`,to:`{current_quarter_end}`},last_quarter:{from:`{last_quarter_start}`,to:`{last_quarter_end}`},this_year:{from:`{current_year_start}`,to:`{current_year_end}`},last_year:{from:`{last_year_start}`,to:`{last_year_end}`},last_7_days:{from:`{7_days_ago}`,to:`{today}`},last_30_days:{from:`{30_days_ago}`,to:`{today}`},last_90_days:{from:`{90_days_ago}`,to:`{today}`}};function Xo(e){return Yo[e]}var Zo=/^\d{4}-\d{2}-\d{2}(?:[T ][\d:.]+(?:Z|[+-]\d{2}:?\d{2})?)?$/;function Qo(e){return Bo(e)!==e||Zo.test(e)&&!Number.isNaN(Date.parse(e))}function $o(){return x.join(`, `)}function es(e){typeof console<`u`&&console.warn(`[dashboard-filters] ${e}`)}var ts=()=>!1,ns=new Set;function rs(e){let t=Pn(e);if(t===e)return e;let n=e?.name??e?.field??`?`,r=t?.defaultValue;return es(`filter "${n}": \`defaultValue: { preset: ${JSON.stringify(r)} }\` is a LEGACY spelling (objectui#4165) and was lifted to the canonical bare preset name ${JSON.stringify(r)}. Rewrite the stored dashboard — the object form is refused by @objectstack/spec and its acceptance here ends with @object-ui/types 18.`),t}function is(e,t){return e!==`date`&&e!==`dateRange`||typeof t!=`string`?t:t in Yo?{preset:t}:t}function as(e,t){if(!Array.isArray(e)||e.length===0)return;let n=[],r=[];for(let t of e)if(t!=null){if(typeof t==`object`){let e=t.value;if(e==null)continue;let r=t.label,i=typeof r==`object`&&!!r&&!Array.isArray(r);n.push({value:String(e),label:typeof r==`string`&&r||i?r:String(e)})}else r.push(t)}return r.length>0&&os(t,r),n.length>0?n:void 0}function os(e,t){if(!ts())return;let n=t.map(e=>typeof e==`string`?JSON.stringify(e):String(e)),r=`${e}:${n.join(`,`)}`;if(ns.has(r))return;ns.add(r);let i=t.map(e=>`{ value: ${JSON.stringify(String(e))}, label: ${JSON.stringify(String(e))} }`).join(`, `);es(`filter "${e}": \`options\` members ${n.join(`, `)} are not \`{ value, label }\` objects and were DROPPED — the bare-string shorthand is no longer lifted (objectui#4356), so the filter renders without them. Rewrite the stored dashboard to @objectstack/spec's pair form: [${i}].`)}function ss(e){let t=new Map;if(e.dateRange){let n=e.dateRange.defaultRange===void 0?Jo():e.dateRange.defaultRange;t.set(Go,{name:Go,field:e.dateRange.field||Ko,type:`dateRange`,defaultValue:n&&n!==`custom`?{preset:n}:void 0,allowCustomRange:e.dateRange.allowCustomRange})}for(let n of e.globalFilters??[]){if(!n?.field)continue;let e=rs(n),r=e.name||e.field;t.has(r)&&typeof console<`u`&&console.warn(`[dashboard-filters] duplicate filter name "${r}" — the later definition wins`);let i=e.type??`text`;t.set(r,{name:r,field:e.field,...typeof e.object==`string`&&e.object?{object:e.object}:{},label:e.label,type:i,options:as(e.options,r),optionsFrom:e.optionsFrom,defaultValue:is(i,e.defaultValue),targetWidgets:e.targetWidgets})}return Array.from(t.values())}function cs(e){return e.map(e=>({name:e.name,type:e.type===`dateRange`?`object`:`string`,defaultValue:e.defaultValue}))}function ls(e,t){if(t==null||t===``)return!0;if(Array.isArray(t))return t.length===0;if(e.type===`dateRange`||e.type===`date`){let e=t;return typeof e==`object`&&!e.preset&&!e.from&&!e.to}return typeof t==`object`&&Object.keys(t).length===0}function us(e,t){if(!ls(e,t)){if(e.type===`dateRange`||e.type===`date`){let n=t;if(typeof n==`object`){let t=typeof n.preset==`string`&&n.preset?n.preset:void 0,r=t?Xo(t):void 0,i=r?.from??n.from,a=r?.to??n.to;return t&&!r&&es(i||a?`filter "${e.name}": ignoring unknown date range preset "${t}" — using the explicit from/to bounds instead; known presets: ${$o()}`:`skipping filter "${e.name}": unknown date range preset "${t}" — expected one of: ${$o()}`),!i&&!a?void 0:{...i?{$gte:i}:{},...a?{$lte:a}:{}}}if(typeof n==`string`&&!Qo(n)){es(`skipping filter "${e.name}": value "${n}" is neither a known date range preset nor an ISO date — expected one of: ${$o()}, an ISO date (YYYY-MM-DD), or a date macro such as {today}`);return}return t}return e.type===`select`||e.type===`lookup`?Array.isArray(t)?{$in:t}:t:e.type===`text`?{$contains:t}:t}}function ds(e,t){let n=e.filterBindings?.[t.name];if(n!==!1){if(typeof n==`string`&&n)return n;if(!(t.targetWidgets&&t.targetWidgets.length>0&&(!e.id||!t.targetWidgets.includes(e.id))))return t.field}}function fs(e,t,n,r){let i=[];for(let a of t){let t=n[a.name];if(ls(a,t))continue;let o=ds(e,a);if(!o)continue;if(typeof e.filterBindings?.[a.name]!=`string`&&r&&!r.has(o)){typeof console<`u`&&console.warn(`[dashboard-filters] skipping filter "${a.name}" on widget "${e.id??`?`}": default field "${o}" does not exist on the widget's object — map it with filterBindings: { "${a.name}": "<field>" } or opt out with false`);continue}let s=us(a,t);s!==void 0&&i.push({[o]:s})}if(i.length!==0)return i.length===1?i[0]:{$and:i}}function ps(e,t){let n=e&&Object.keys(e).length>0,r=t&&Object.keys(t).length>0;if(n&&r)return{$and:[e,t]};if(n)return e;if(r)return t}var ms={current_week_start:`last_week_start`,current_week_end:`last_week_end`,current_month_start:`last_month_start`,current_month_end:`last_month_end`,current_quarter_start:`last_quarter_start`,current_quarter_end:`last_quarter_end`,current_year_start:`last_year_start`,current_year_end:`last_year_end`,week_start:`last_week_start`,week_end:`last_week_end`,month_start:`last_month_start`,month_end:`last_month_end`,quarter_start:`last_quarter_start`,quarter_end:`last_quarter_end`,year_start:`last_year_start`,year_end:`last_year_end`,today:`yesterday`};function hs(e,t){if(e==null)return e;if(typeof e==`string`)return e.replace(/\$?\{([a-zA-Z0-9_]+)\}/g,(e,n)=>{let r=t[n];return r?`{${r}}`:e});if(Array.isArray(e))return e.map(e=>hs(e,t));if(typeof e==`object`){let n={};for(let r of Object.keys(e))n[r]=hs(e[r],t);return n}return e}function gs(e,t,n=new Date){return t.kind===`previousYear`?Bo(e,new Date(n.getFullYear()-1,n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds())):Bo(hs(e,ms),n)}function _s(e,t){if(e.kind===`previousYear`)return`vsLastYear`;let n=t?JSON.stringify(t):``;return/current_year_|year_start|year_end/.test(n)?`vsLastYear`:/current_quarter_|quarter_start|quarter_end/.test(n)?`vsLastQuarter`:/current_month_|month_start|month_end/.test(n)?`vsLastMonth`:/current_week_|week_start|week_end/.test(n)?`vsLastWeek`:/\btoday\b/.test(n)?`vsYesterday`:`vsPreviousPeriod`}var vs=e=>e==null?null:String(e),ys=e=>JSON.stringify(e),bs=(e,t)=>JSON.stringify([e,t]),xs=[`count`,`sum`,`avg`,`min`,`max`,`count_distinct`];function Ss(e){return typeof e==`string`&&xs.includes(e)}function Cs(e,t){let n=e.builtinAggregate;if(Ss(n)){let e=t?.[n];if(typeof e==`string`&&e!==``)return e}return e.label??e.name}var ws=`(None)`;function q(e){return ys([vs(e)])}var Ts=`__bucketId`;function Es(e){if(!e||typeof e!=`object`)return;let t=e[Ts];return typeof t==`string`&&t!==``?t:void 0}function Ds(e,t){return J(e,t)&&e[t]==null}function J(e,t){return!!e&&typeof e==`object`&&t in e}function Os(e){return e==null?``:String(e)}function ks(e){let t=new Map;for(let{id:n,display:r}of e){let e=t.get(r);e||t.set(r,e=new Set),e.add(n)}let n=new Set;for(let[e,r]of t)r.size>1&&n.add(e);return n}function As(e,t,n){let r=e=>Ds(e,t)?n:e[t],i=ks(e.filter(e=>J(e,t)).map(e=>({id:q(e[t]),display:Os(r(e))}))),a=!1,o=e.map(e=>{if(!J(e,t))return e;let o=Ds(e,t),s=i.has(Os(r(e)));return!o&&!s?e:(a=!0,{...e,...o?{[t]:n}:{},...s?{[Ts]:q(e[t])}:{}})});return a?o:e}function js(e,t,n,r){let i=new Map;for(let r of e){if(!J(r,t))continue;let e=q(r[t]);i.has(e)||i.set(e,{id:e,label:Ds(r,t)?n:String(r[t])})}let a=Array.from(i.values()),o=ks(a.map(({id:e,label:t})=>({id:e,display:t}))),s=new Set([r,Ts]),c=new Set(a.map(({id:e})=>e));return a.map(({id:e,label:t})=>({id:e,label:t,dataKey:o.has(t)||s.has(t)||c.has(t)?e:t}))}function Ms(e,t,n,r,i){let a=(t??[]).filter(Boolean),o=(n??[]).filter(Boolean),s=Array.isArray(e)?e:[],c=e=>{let t=(r??[]).find(t=>t.name===e);return t?Cs(t,i?.builtinAggregateLabels):e};if(a.length>=2&&o.length===1){let e=a[0],t=a[1],n=o[0],r=i?.nullCategoryLabel??`(None)`,c=js(s,t,r,e),l=new Map(c.map(({id:e,dataKey:t})=>[e,t])),u=new Map;for(let i of s){let a=i[e],o=q(a),s=u.get(o);s||u.set(o,s={}),J(i,e)&&!J(s,e)&&(s[e]=Ds(i,e)?r:a);let c=J(i,t)?l.get(q(i[t])):void 0;c!==void 0&&(s[c]=i[n])}let d=ks(Array.from(u.entries()).map(([t,n])=>({id:t,display:Os(n[e])})));return{data:Array.from(u.entries()).map(([t,n])=>d.has(Os(n[e]))?{...n,[Ts]:t}:n),xAxisKey:e,series:c.map(({dataKey:e,label:t})=>({dataKey:e,label:t}))}}let l=a[0];return{data:l?As(s,l,i?.nullCategoryLabel??`(None)`):s,xAxisKey:l,series:o.map(e=>({dataKey:e,label:c(e)}))}}function Ns(e,t){let n=Array.isArray(e)?e:[];if(!t)return n;let r=Object.keys(t).filter(e=>t[e]&&Object.keys(t[e]).length>0);return r.length===0?n:n.map(e=>{let n=null;for(let i of r){let r=e[i];if(r==null)continue;let a=t[i][String(r)];a!=null&&a!==r&&(n||={...e},n[i]=a)}return n??e})}function Ps(e,t,n,r,i,a){let o=(t??[]).filter(Boolean),s=(n??[]).filter(Boolean),c=Array.isArray(e)?e:[],l=o[0];if(!l)return-1;let u=String(r??``),d=a?.nullCategoryLabel??`(None)`,f=a?.bucketId,p=typeof f==`string`&&f!==``?e=>q(e[l])===f:e=>(e[l]==null?d:String(e[l]))===u;if(o.length>=2&&s.length===1){let e=o[1],t=js(c,e,d,l).find(({dataKey:e})=>e===String(i??``))?.id;return t===void 0?-1:c.findIndex(n=>p(n)&&J(n,e)&&q(n[e])===t)}return c.findIndex(e=>p(e))}function Fs(e){if(!Array.isArray(e)||e.length===0)return null;let t={};for(let n of e)if(n&&typeof n==`object`){let e=n;typeof e.color==`string`&&e.color&&(e.value!=null&&(t[String(e.value)]=e.color),e.label!=null&&(t[String(e.label)]=e.color))}return Object.keys(t).length>0?t:null}function Is(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){if(typeof n==`string`||typeof n==`number`||typeof n==`boolean`){t.push(String(n));continue}if(n&&typeof n==`object`){let e=n;e.value!=null&&t.push(String(e.value)),e.label!=null&&String(e.label)!==String(e.value)&&t.push(String(e.label))}}return t.length>0?t:null}function Ls(e){if(!Array.isArray(e)||e.length===0)return null;let t=new Map;return e.forEach((e,n)=>{t.has(e)||t.set(e,n)}),t.size>0?t:null}function Rs(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return{value:String(e),label:String(e)};if(e&&typeof e==`object`){let t=e;if(t.value!=null&&t.label!=null)return{value:String(t.value),label:String(t.label)}}return null}function zs(e,t){if(!t||!Array.isArray(e)||e.length===0)return e;let n=!1,r=e.map(e=>{let r=Rs(e);if(!r)return e;let i=t(r.value,r.label);return i===r.label?e:(n=!0,e&&typeof e==`object`?{...e,label:i}:{value:r.value,label:i})});return n?r:e}function Bs(e,t){if(!Array.isArray(e)||e.length===0)return null;let n={},r={};for(let i of e){let e=Rs(i);if(!e)continue;let a=t?t(e.value,e.label):e.label;a!==e.value&&(n[e.value]=a),a!==e.label&&(r[e.label]=a)}let i={...r,...n};return Object.keys(i).length>0?i:null}var Vs=new Set([`lookup`,`master_detail`,`masterdetail`,`master-detail`]);function Hs(e){let t=e?.fields;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function Us(e){if(!e||typeof e!=`object`)return;let t=e,n=typeof t.type==`string`?t.type.toLowerCase():``;if(!Vs.has(n))return;let r=t.reference;return typeof r==`string`&&r?r:void 0}async function Ws(e,t,n){let r={},i=Array.from(new Set((t??[]).filter(e=>!!e)));if(i.length===0)return r;let a=new Map,o=e?.name;typeof o==`string`&&o&&a.set(o,Promise.resolve(e));let s=e=>{let t=a.get(e);return t||(t=Promise.resolve().then(()=>n(e)).catch(()=>null),a.set(e,t)),t};for(let t of i){let n=t.split(`.`),i=e,a=typeof o==`string`&&o?o:void 0,c=!0;for(let e=0;e<n.length-1;e+=1){let t=Us(Hs(i)?.[n[e]]);if(!t){c=!1;break}if(i=await s(t),!i){c=!1;break}let r=i.name;a=typeof r==`string`&&r?r:t}if(!c)continue;let l=n[n.length-1],u=Hs(i)?.[l];u?.options!==void 0&&(r[t]={object:a,field:l,options:u.options})}return r}function Gs(e,t){let n=e?.object;if(!n||!t)return;let r=e.field;return(e,i)=>t(n,r,e,i)}function Ks(e,t,n){if(!e||!t||t.length===0)return null;let r={};for(let{dim:i,path:a}of t){let t=e[a],o=Bs(t?.options,Gs(t,n));o&&(r[i]=o)}return Object.keys(r).length>0?r:null}async function qs(e,t,n){return Ws(await e(t),n,e)}function Js(e,t){return h(e)??t}function Ys(e,t){return o(e)??t}function Xs(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Zs(e,t,n){let r=e.function,i={function:r,alias:Js(e,r||`count`)};return r!==`count`&&e.field&&(i.field=e.field),{groupBy:[t],aggregations:[i],where:n}}var Qs=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function $s(e){if(typeof e==`string`&&e)return e;if(Qs(e))return Object.values(e).find(e=>typeof e==`string`&&e)}function ec(e){if(typeof e==`string`)return e||void 0;if(Qs(e)&&Object.values(e).some(e=>typeof e==`string`&&e))return e}function tc(e){let t={},n=e.type;(n===`bar`||n===`line`||n===`area`)&&(t.chartType=n),(e.yAxis===`left`||e.yAxis===`right`)&&(t.yAxis=e.yAxis);let r=$s(e.label);return r&&(t.label=r),typeof e.color==`string`&&e.color&&(t.color=e.color),typeof e.stack==`string`&&e.stack&&(t.stack=e.stack),(e.variant===`primary`||e.variant===`comparison`)&&(t.variant=e.variant),typeof e.dashArray==`string`&&e.dashArray&&(t.dashArray=e.dashArray),typeof e.opacity==`number`&&Number.isFinite(e.opacity)&&(t.opacity=e.opacity),t}function nc(e){let t={};if(!Qs(e))return t;let n=ec(e.title);return n&&(t.title=n),typeof e.format==`string`&&e.format&&(t.format=e.format),typeof e.min==`number`&&Number.isFinite(e.min)&&(t.min=e.min),typeof e.max==`number`&&Number.isFinite(e.max)&&(t.max=e.max),typeof e.stepSize==`number`&&Number.isFinite(e.stepSize)&&e.stepSize>0&&(t.stepSize=e.stepSize),typeof e.showGridLines==`boolean`&&(t.showGridLines=e.showGridLines),(e.position===`left`||e.position===`right`||e.position===`top`||e.position===`bottom`)&&(t.position=e.position),typeof e.logarithmic==`boolean`&&(t.logarithmic=e.logarithmic),t}function rc(e,t){let n=new Map;for(let e of Array.isArray(t)?t:[]){if(!Qs(e))continue;let t=typeof e.name==`string`?e.name:void 0;t&&!n.has(t)&&n.set(t,e)}return e.map(e=>{let t=n.get(e.dataKey);return t?{...e,...tc(t)}:e})}function ic(e,t){let n=Qs(t)?t:{},r=rc(e,n.series),i={},a=nc(n.xAxis);Object.keys(a).length>0&&(i.xAxis=a);let o=Array.isArray(n.yAxis)?n.yAxis:n.yAxis===void 0?[]:[n.yAxis];return o.length>0&&(i.yAxis=o.map(nc)),{series:r,axes:i}}function ac(e,t){let n=Qs(e)?e:{},r={};typeof n.showLegend==`boolean`&&(r.showLegend=n.showLegend),typeof n.showDataLabels==`boolean`&&(r.showDataLabels=n.showDataLabels);let i=ec(n.title);i&&(r.title=i);let a=ec(n.subtitle);a&&(r.subtitle=a);let o=ec(n.description);o&&(r.description=o),typeof n.height==`number`&&Number.isFinite(n.height)&&n.height>0&&(r.height=n.height),Array.isArray(n.annotations)&&n.annotations.length>0&&(r.annotations=n.annotations),n.interaction&&typeof n.interaction==`object`&&!Array.isArray(n.interaction)&&(r.interaction=n.interaction);let s=Array.isArray(n.colors)?n.colors.filter(e=>typeof e==`string`&&!!e):void 0;s?.length&&(r.colors=s);let c=n.colors&&typeof n.colors==`object`&&!Array.isArray(n.colors)?n.colors:void 0;return(t||c)&&(r.categoryColors={...t??{},...c??{}}),r}var oc=new Set([`pie`,`donut`,`funnel`,`scatter`]);function sc(e){return typeof e==`string`&&oc.has(e)}function cc(e,t,n){return typeof n==`boolean`?n:t?!0:e!==0}function lc(e,t={}){let{locale:n,currency:r,scale:i,useGrouping:a,style:o,...s}=t,c={...s};o===`percentPoints`?(c.style=`unit`,c.unit=`percent`,c.unitDisplay=`narrow`):o&&(c.style=o),r&&(c.style=`currency`,c.currency=r,delete c.unit,delete c.unitDisplay),cc(i,r,a)?a===!0&&(c.useGrouping=!0):c.useGrouping=!1;try{return new Intl.NumberFormat(n,c).format(e)}catch{return new Intl.NumberFormat(void 0,c).format(e)}}function uc(e){return String(e).padStart(2,`0`)}function dc(e){if(e==null||e===``)return``;if(typeof e==`string`){let t=e.match(/^(\d{4}-\d{2}-\d{2})/);if(t)return t[1]}let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?``:`${t.getFullYear()}-${uc(t.getMonth()+1)}-${uc(t.getDate())}`}function fc(e){if(e==null||e===``||mc(e))return``;if(typeof e==`string`){let t=e.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})(?::\d{2}(?:\.\d+)?)?$/);if(t)return`${t[1]}T${t[2]}`}let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?``:`${t.getFullYear()}-${uc(t.getMonth()+1)}-${uc(t.getDate())}T${uc(t.getHours())}:${uc(t.getMinutes())}`}function pc(e){if(!e)return``;if(mc(e))return e;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()}function mc(e){if(typeof e!=`string`)return!1;let t=e.match(/^(\d{4}-\d{2}-\d{2})(?:$|T)/);return t!=null&&!P(t[1])}function hc(e){return e>-1&&e<1?e*100:e}function gc(e,t,n){return lc(e,{...n,locale:t})}var _c=/^\d{4}-\d{2}-\d{2}$/,vc=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function yc(e,t,n){if(typeof e==`string`){if(_c.test(e))return Number.isNaN(Date.parse(e))?void 0:oi(e,t,{locale:n});if(vc.test(e))return Number.isNaN(Date.parse(e))?void 0:t===`relative`?ai(e,{locale:n}):t===`short`?ci(e,{locale:n,style:`compact`}):ci(e,{locale:n})}}function bc(e,t,n,r,i){if(e==null)return`—`;if(typeof e!=`number`)return yc(e,t,i)??String(e);let a=t?t.split(`.`)[1]?.match(/0/g)?.length??0:void 0;if(n)try{return gc(e,i,{currency:n,minimumFractionDigits:a??0,maximumFractionDigits:a??2})}catch{}if(!t)return Number.isInteger(e)?String(e):gc(e,i,{maximumFractionDigits:2});let o=t.includes(`%`);return`${t.includes(`$`)?`$`:``}${gc(o?r?r===`fraction`?e*100:e:hc(e):e,i,{style:o?`percentPoints`:`decimal`,minimumFractionDigits:a??0,maximumFractionDigits:a??0})}`}function xc(e,t){return e==null?`—`:typeof e==`number`?Number.isInteger(e)?String(e):gc(e,t,{maximumFractionDigits:2}):String(e)}function Sc(e,t,n,r){let i=new Map((e??[]).map(e=>[e.name,e])),a=e=>i.get(e);return{measureField:a,headerLabel:e=>{let i=a(e),o=i?Cs(i,r):e;return t&&n?n(t,e,o):o}}}function Cc(e,t,n,r,i){let a={};for(let r of t){let t=e?.[r];a[n[r]]=t===``||t==null?{$null:!0}:t}if(i)for(let e of Object.values(i))e&&e.field&&(a[e.field]={$gte:e.gte,$lt:e.lt});return r?zo(r,a)??{}:a}var wc=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function Tc(e){return wc.test(e)||e.startsWith(`rgb`)||e.startsWith(`hsl`)}function Ec(e){let t=e?.options;if(!Array.isArray(t))return{};let n={};for(let e of t)e&&typeof e==`object`&&e.value!=null&&typeof e.color==`string`&&e.color&&(n[String(e.value)]=e.color);return n}function Dc(e){let t=Ec(e);return e=>{if(e==null||e===``)return;let n=String(e);return t[n]||(Tc(n)?n:void 0)}}var Oc=/[\\/:*?"<>|\u0000-\u001f]+/g,kc=80;function Ac(e){return e?String(e).replace(Oc,`_`).replace(/\s+/g,` `).replace(/_{2,}/g,`_`).replace(/^[\s._-]+|[\s._-]+$/g,``).slice(0,kc):``}function jc(e,t={},n=new Date){let r=Ac(t.prefix),i=r||Ac(t.label)||Ac(t.objectName)||`export`,a=Ac(t.viewLabel);!r&&a&&a.toLowerCase()!==i.toLowerCase()&&(i=`${i}-${a}`.slice(0,kc));let o=e=>String(e).padStart(2,`0`),s=`${n.getFullYear()}${o(n.getMonth()+1)}${o(n.getDate())}-${o(n.getHours())}${o(n.getMinutes())}${o(n.getSeconds())}`;return`${i}-${s}.${e}`}T();var Mc=e=>e.toLowerCase().replace(/[_\-\s]/g,``),Nc=null,Pc=null,Fc=null;function Ic(){if(Pc)return Pc;let e=Object.keys(c.shape),t=new Map;for(let n of e){let e=Mc(n);t.set(e,[...t.get(e)??[],n])}let n=new Map,r=new Map;for(let[e,i]of t)i.length===1?n.set(e,i[0]):r.set(e,i);return Nc=new Set(e),Fc=r,Pc=n,n}var Lc=new Set,Rc=new Set;function zc(e,t,n,r,i,a){if(!Hc())return;let o=r??(typeof a.name==`string`?a.name:`(unnamed field)`),s=i??`(unknown object)`,c=`${s}:${o}:${t}:${e}`;if(Rc.has(c))return;let l=e===`no-declared-twin`&&t===`id_field`?` \`@objectstack/spec\`'s \`FIELD_KEY_GUIDANCE\` gives the reason: ${le.id_field.why}`:``;Rc.add(c),console.warn(`[ObjectUI] Object \`${s}\`, field \`${o}\`: the ingestion choke point CANNOT canonicalize the retired spelling \`${t}\`. ${n}${l} The key and its value are LEFT on the def exactly as served — nothing is dropped here — but a consumer that reads only the spellings \`@objectstack/spec\`'s \`FieldSchema\` declares will not see this value. Fix the PRODUCER, or migrate the stored document. (maintainer ruling item 3 on objectui#7650; objectui#8938)`)}function Bc(e,t,n){let r=Ic();for(let i of Object.keys(e)){if(Nc.has(i))continue;let a=e[i];if(a===void 0||Wc.has(i))continue;let o=Mc(i),s=r.get(o);if(s===void 0){let r=Fc.get(o);r?zc(`ambiguous-probe`,i,`Its alias spelling is shared by MORE THAN ONE key \`FieldSchema\` declares (${r.map(e=>`\`${e}\``).join(`, `)}), so the fold refuses to choose between them rather than picking one.`,t,n,e):zc(`no-declared-twin`,i,`\`FieldSchema\` declares neither \`${i}\` nor any key sharing its alias spelling (lowercased, with \`_\`, \`-\` and spaces removed), so there is no canonical key to fold it onto — and this path deliberately does not guess a near match.`,t,n,e);continue}if(e[s]!==void 0){e[s]!==a&&zc(`canonical-occupied`,i,`\`FieldSchema\` declares \`${s}\`, and this def already carries a DIFFERENT value under it; the producer's value stands, because this choke point never overwrites one.`,t,n,e);continue}if(e[s]=a,!Hc())continue;let c=t??(typeof e.name==`string`?e.name:`(unnamed field)`),l=n??`(unknown object)`,u=`${l}:${c}:${i}:${s}`;Lc.has(u)||(Lc.add(u),console.warn(`[ObjectUI] Object \`${l}\`, field \`${c}\` carries the retired spelling \`${i}\`. \`@objectstack/spec\`'s \`FieldSchema\` declares \`${s}\` and does not declare \`${i}\`, so a producer emitting it would be refused at the metadata write door. ObjectUI stamps \`${s}\` here so this stored def still renders, but the consumers no longer carry a \`${i}\` fallback of their own — fix the PRODUCER, or migrate the stored document. (objectui#7650)`))}}var Vc=new Set,Hc=()=>!1,Uc=[`reference_to`,`referenceTo`],Wc=new Set(Uc);function Gc(e,t,n){if(!Hc()||e.reference!==void 0)return;let r=Uc.filter(t=>e[t]!==void 0&&e[t]!==``);if(r.length===0)return;let i=t??(typeof e.name==`string`?e.name:`(unnamed field)`),a=n??`(unknown object)`;for(let t of r){let n=`${a}:${i}:${t}:${String(e[t])}`;Vc.has(n)||(Vc.add(n),console.warn(`[ObjectUI] Object \`${a}\`, field \`${i}\` declares its relationship target as \`${t}: '${String(e[t])}'\` and does NOT carry \`reference\`. \`reference\` is the only spelling the protocol declares: \`@objectstack/spec\`'s \`FieldSchema\` refuses \`${t}\` by name with \`unrecognized_keys\` ("Did you mean \`${t}\` -> \`reference\`?"). ObjectUI stamps \`reference\` here so this def still renders, but the readers no longer carry a \`${t}\` fallback of their own — fix the PRODUCER to emit \`reference\`, or serve the def through a backend that normalizes it (objectstack#13847 does this on the serve path and in \`os migrate meta\`). Maintainer ruling 2026-08-31: protocol normalization belongs on the server, the front end just executes the protocol. (objectui#6837)`))}}function Kc(e,t,n){if(!e||typeof e!=`object`)return e;let r=e;if(Bc(r,t,n),r.reference!==void 0)return e;let i=r.reference_to??r.referenceTo;return i==null||i===``?e:(Gc(r,t,n),r.reference=i,e)}function qc(e){let t=e&&typeof e==`object`?e.fields:null;if(!t||typeof t!=`object`)return e;let n=typeof e.name==`string`?e.name:void 0;if(Array.isArray(t))for(let e of t)Kc(e,void 0,n);else for(let[e,r]of Object.entries(t))Kc(r,e,n);return e}function Jc(e,t,n,r){if(!t?.isLoaded||!n||!e||typeof e!=`object`)return e;let i={},a=!1;for(let[o,s]of Object.entries(e))o===`id`||o===`_id`||r?.includes(o)||t.checkField(n,o,`read`)?i[o]=s:a=!0;return a?i:e}T();function Yc(e,t){if(!t||!e||typeof e!=`object`)return;let n=Array.isArray(e)?e.find(e=>e?.name===t):e[t];if(n&&typeof n==`object`)return n}function Xc(e,t){let n=Yc(e,t);return n!==void 0&&u(n)}function Zc(e,t,n){let r=Xc(n,e);return{[e]:r?{$contains:t}:t}}var Qc=new Set([`id`,`created_at`,`created_by`,`updated_at`,`updated_by`,`owner_id`,`organization_id`,`owning_business_unit_id`]);function $c(e,t){return Qc.has(e)?!0:!!t&&typeof t==`object`&&e in t}var el=/\b(?:record|data)\.([A-Za-z_][A-Za-z0-9_]*)/g,tl=/^[A-Za-z_][A-Za-z0-9_]*$/,nl=/\{([a-z_][a-z0-9_]*)\}/gi;function rl(e){if(!e||typeof e!=`object`)return;let t=e;if(t.defaultFromRow)return t.field??t.name}function il(e){let t=[];for(let n of[e.patch,e.bodyExtra])n&&typeof n==`object`&&!Array.isArray(n)&&t.push(...Object.keys(n));if(Array.isArray(e.params))for(let n of e.params){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.name??e.field)}return t.filter(e=>e!==`recordId`)}function al(e){if(typeof e==`string`)return e.trim()||null;if(e&&typeof e==`object`){let t=e.source;if(typeof t==`string`)return t.trim()||null}return null}function ol(e){let t=[],n=new Set;for(let r of e){let e=al(r);if(e){el.lastIndex=0;for(let r=el.exec(e);r;r=el.exec(e)){let e=r[1];n.has(e)||(n.add(e),t.push(e))}}}return t}function sl(e){let t=[];for(let n of e.conditionalFormatting??[]){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.condition,e.expression),typeof e.field==`string`&&e.field&&t.push(`record.${e.field}`)}for(let n of[e.rowActionDefs,e.bulkActionDefs,e.objectActions])for(let e of n??[]){if(!e||typeof e!=`object`)continue;let n=e;if(t.push(n.visible,n.disabled),typeof n.recordIdField==`string`&&tl.test(n.recordIdField)&&t.push(`record.${n.recordIdField}`),Array.isArray(n.params))for(let e of n.params){let n=rl(e);typeof n==`string`&&tl.test(n)&&t.push(`record.${n}`)}if(typeof n.target==`string`){nl.lastIndex=0;for(let e=nl.exec(n.target);e;e=nl.exec(n.target))t.push(`record.${e[1]}`)}if(n.undoable)for(let e of il(n))typeof e==`string`&&tl.test(e)&&t.push(`record.${e}`)}for(let n of Object.values(e.userActions??{})){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.visibleWhen,e.disabledWhen)}return t}function cl(e){let t=e?.fields;if(!Array.isArray(t))return[];let n=[],r=new Set;for(let e of t){let t=e?.field;if(typeof t!=`string`)continue;let i=t.trim();i&&!r.has(i)&&(r.add(i),n.push(i))}return n}var ll={compact:`compact`,comfortable:`medium`,spacious:`tall`},ul={compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`};function dl(e){if(typeof e==`string`&&Object.prototype.hasOwnProperty.call(ul,e))return ul[e]}var fl=e=>!!e&&typeof e==`object`&&!Array.isArray(e),pl={showSearch:`search`,showSort:`sort`,showFilters:`filter`,showDensity:`rowHeight`,showGroup:`group`,showHideFields:`hideFields`,showColor:`rowColor`},ml={private:`personal`,team:`collaborative`,organization:`collaborative`,public:`collaborative`},hl={label:`ariaLabel`,describedBy:`ariaDescribedBy`},gl={grid:!0,kanban:!0,gallery:!0,calendar:!0,timeline:!0,gantt:!0,map:!0,chart:!0,tree:!0},_l={list:null,detail:null},vl=new Set;function yl(e){let t=Object.prototype.hasOwnProperty.call(_l,e)?_l[e]:null;t===null||vl.has(e)||(vl.add(e),console.warn(`[object-ui] This build accepts a ${JSON.stringify(e)} list view but cannot draw one: ${t}. The view falls back to a grid. Author a visualization this renderer draws, or render the page through the surface that owns it.`))}function bl(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(gl,e)}function xl(e){if(typeof e==`string`){if(bl(e))return e;yl(e)}}var Sl={kanban:{groupField:`groupByField`,cardFields:`columns`},gallery:{imageField:`coverField`},timeline:{dateField:`startDateField`}};function Cl(e){if(!e||typeof e!=`object`)return e;let t=e,n=t.fields,r=Array.isArray(n),i=t.densityMode,a=typeof i==`string`&&Object.prototype.hasOwnProperty.call(ll,i),o=t.filters,s=Array.isArray(o),c=Object.keys(pl).filter(e=>typeof t[e]==`boolean`),l=typeof t.showDescription==`boolean`,u=fl(t.aria)?t.aria:void 0,d=!!u&&Object.keys(hl).some(e=>u[e]!==void 0),f=fl(t.sharing)?t.sharing:void 0,p=!!f&&(f.visibility!==void 0||f.enabled!==void 0),m=fl(t.data)?t.data:void 0,h=m?.provider===`object`&&typeof m.object==`string`&&m.object?m.object:void 0,g=h!==void 0&&!(typeof t.objectName==`string`&&t.objectName),_=t.viewType,v=xl(t.specType)??xl(t.type),y=!_||_===`list`,b=Array.isArray(t.columns)?t.columns:r?n:void 0,x=ln(b),S=x!==b,C=Object.entries(Sl).map(([e,n])=>{let r=fl(t[e])?t[e]:void 0;if(!r)return;let i=Object.keys(n).filter(e=>r[e]!==void 0);return i.length?{viewKey:e,aliases:n,cfg:r,legacyKeys:i}:void 0}).filter(e=>e!==void 0);if(!r&&!a&&!s&&!c.length&&!l&&!d&&!p&&!y&&!S&&!C.length&&!g)return e;let w={...t};if(r&&(Array.isArray(w.columns)||(w.columns=n),delete w.fields),S&&(w.columns=x),a&&(typeof w.rowHeight!=`string`&&(w.rowHeight=ll[i]),delete w.densityMode),s&&(Array.isArray(w.filter)||(w.filter=o),delete w.filters),c.length){let e={...fl(w.userActions)?w.userActions:{}};for(let n of c){let r=pl[n];typeof e[r]!=`boolean`&&(e[r]=t[n]),delete w[n]}w.userActions=e}if(l){let e={...fl(w.appearance)?w.appearance:{}};typeof e.showDescription!=`boolean`&&(e.showDescription=t.showDescription),delete w.showDescription,w.appearance=e}if(d&&u){let e={...u};for(let[t,n]of Object.entries(hl))e[n]===void 0&&u[t]!==void 0&&(e[n]=u[t]),delete e[t];w.aria=e}if(p&&f){let e={...f};if(e.type===void 0){let t=typeof f.visibility==`string`?f.visibility:void 0,n=t?ml[t]:f.enabled===!0?`personal`:void 0;n&&(e.type=n)}delete e.visibility,delete e.enabled,w.sharing=e}for(let{viewKey:e,aliases:t,cfg:n,legacyKeys:r}of C){let i={...n};for(let e of r){let r=t[e];i[r]===void 0&&(i[r]=n[e]),delete i[e]}w[e]=i}return g&&(w.objectName=h),y&&(w.viewType=v??`grid`),w}function wl(e,t){return t?.provider===`object`?t.object:e?.objectName}function Tl(e,t){return e?t===`array`?Array.isArray(e):t!==`view-data`||!Array.isArray(e):!1}function El(e,t){return Tl(e.data,t)?e.data:e.staticData?{provider:`value`,items:e.staticData}:e.objectName?{provider:`object`,object:e.objectName}:null}var Dl=Object.freeze({"object-grid":`view-data`,"plugin-grid:object-grid":`view-data`,"view:grid":`view-data`,"object-map":`view-data`,"plugin-map:object-map":`view-data`,"object-gantt":`view-data`,"plugin-gantt:object-gantt":`view-data`,"object-tree":`view-data`,"plugin-tree:object-tree":`view-data`,"view:tree":`view-data`,tree:`view-data`,"object-calendar":`array`,"plugin-calendar:object-calendar":`array`,"view:calendar":`array`,calendar:`array`});function Ol(e){return typeof e==`string`?Dl[e]??`undeclared`:`undeclared`}function kl(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}var Al=t({ACTION_DEF_KEYS:()=>Gi,ActionEngine:()=>wa,ActionRunner:()=>V,BUILTIN_AGGREGATES:()=>xs,CANONICAL_COLUMN_IDENTITY_KEY:()=>M,CANONICAL_COLUMN_LABEL_KEY:()=>un,CAP_REACT_PAGES:()=>Mo,CASCADE_OPTION_WIDGET_TYPES:()=>Hi,CHART_BUCKET_ID_KEY:()=>Ts,ComponentRegistry:()=>O,DATE_RANGE_FILTER_NAME:()=>Go,DATE_RANGE_PRESETS:()=>x,DENSITY_MODE_TO_ROW_HEIGHT:()=>ll,DebugCollector:()=>bo,ELEMENT_DATA_SOURCE_KEY:()=>Ze,ERROR_CODES:()=>lo,EXPANDABLE_FIELD_TYPES:()=>pn,ExpressionCache:()=>Qr,ExpressionContext:()=>Jr,ExpressionEvaluator:()=>L,FIELD_SORTABLE_UNPROVISIONED_ANCHOR:()=>FIELD_SORTABLE_UNPROVISIONED_ANCHOR,FIELD_UNSORTABLE_VIRTUAL_TYPE:()=>FIELD_UNSORTABLE_VIRTUAL_TYPE,FilterOperatorError:()=>E,FormulaFunctions:()=>pi,HOST_DISPATCH_ACTION_KEYS:()=>Ji,HTML_TIER_INTRINSICS:()=>rt,KNOWN_ACTION_KEYS:()=>Xi,LEGACY_COLUMN_IDENTITY_KEYS:()=>en,NAVIGATION_ALIAS_KEYS:()=>qi,NON_GRID_ROW_CEILING:()=>Xt,NULL_CATEGORY_LABEL:()=>ws,OBJECT_SORTABILITY_KEY:()=>Sn,ObjectUIError:()=>uo,PLATFORM_RECORD_COLUMNS:()=>Qc,PUBLIC_BLOCKS:()=>nt,RETIRED_ACTION_KEYS:()=>Yi,RETIRED_FIELD_TYPES:()=>gn,ROW_HEIGHT_TO_DENSITY_MODE:()=>ul,ROW_PREDICATE_CANONICAL_ROOT:()=>_i,Registry:()=>ot,SDUI_DOM_PASS_THROUGH_KEYS:()=>Bt,SPEC_ACTION_KEYS:()=>Ki,STYLE_BREAKPOINTS:()=>xo,SUBJECT_PERMISSIONS:()=>pt,SafeExpressionParser:()=>Zr,TABLE_ADAPTER_COLUMN_KEY:()=>TABLE_ADAPTER_COLUMN_KEY,TABLE_ADAPTER_HEADER_KEY:()=>dn,UNMATERIALIZED_FIELD_TYPES:()=>bn,UndoManager:()=>Wi,actionErrorDetail:()=>ia,applyNonGridRowCeiling:()=>Qt,attachObjectSortability:()=>Tn,axisPresentation:()=>nc,bindSubjectPermissions:()=>mt,buildCategoryOrder:()=>Is,buildCategoryRank:()=>Ls,buildChartSeries:()=>Ms,buildDatasetDrillFilter:()=>Cc,buildDatasetFieldHelpers:()=>Sc,buildDimensionLabelMap:()=>Bs,buildExpandFields:()=>hn,buildExportFileName:()=>jc,buildFieldColorMap:()=>Ec,buildFilterCondition:()=>us,buildOptionColorMap:()=>Fs,buildWidgetScopedFilter:()=>fs,captureUpdateUndoData:()=>_a,chartBucketId:()=>q,chartCategoryKey:()=>Ys,chartConfigPresentation:()=>ac,chartMeasureKey:()=>Js,chartRowBucketId:()=>Es,chartTypeIgnoresCompareTo:()=>sc,classifyActionKeys:()=>Zi,collectGroupingFieldRefs:()=>cl,collectPredicateFieldRefs:()=>ol,columnHeader:()=>fn,columnIdentity:()=>rn,compareSortValues:()=>Br,compareToTrendLabelKey:()=>_s,compileScopedStyles:()=>Eo,composeDrillFilter:()=>zo,composeParentScopeFilter:()=>Zc,computeDrillFilter:()=>Io,convertFiltersToAST:()=>De,convertOperatorToAST:()=>ye,convertSortToQueryParams:()=>qr,createFieldColorResolver:()=>Dc,createServerActionHandler:()=>Oa,dashboardFilterVariableDefs:()=>cs,debugLog:()=>ho,debugTime:()=>_o,debugTimeEnd:()=>vo,declaredNameField:()=>Nr,deriveDimensionLabelMaps:()=>Ks,deriveTitleField:()=>Mr,detectNonCanonicalRowSpelling:()=>yi,dimensionOptionTranslator:()=>Gs,evalFieldPredicate:()=>k,evalRowPredicate:()=>Ai,executeBulkBatch:()=>Ta,extractRecords:()=>Yt,filterPlatformSortableSort:()=>On,filterRefusalSubject:()=>_e,findChartSeriesRow:()=>Ps,formatDate:()=>oi,formatDateTime:()=>ci,formatDateTimeCompactParts:()=>si,formatDimensionValue:()=>xc,formatDisplayNumber:()=>lc,formatMeasure:()=>bc,formatRelativeDate:()=>ai,formatTitleTemplate:()=>Dr,fromDateTimeInputValue:()=>pc,getRecordDisplayName:()=>Rr,getSortValue:()=>zr,globalUndoManager:()=>z,hasDeclaredPredicate:()=>j,hasDeprecatedObjectParams:()=>na,hasResponsiveStyles:()=>wo,humanizeLabel:()=>kl,interpolate:()=>Po,interpretActionResponse:()=>ca,isBlankPredicateText:()=>A,isBuiltinAggregate:()=>Ss,isCapabilityEnabled:()=>jo,isColorLiteral:()=>Tc,isDebugEnabled:()=>mo,isDrillEnabled:()=>Ro,isEmptyValue:()=>$t,isExpandableFieldType:()=>mn,isImpossibleStoredDay:()=>mc,isLegacyActionEnvelope:()=>sa,isLegacyDialectSource:()=>wi,isListViewVisualization:()=>bl,isMissingForRequired:()=>st,isMultiValueRelationship:()=>Xc,isObjectInlineEditable:()=>Jt,isObjectUIError:()=>fo,isOpenDomAttributeFamily:()=>Vt,isOptionGroupGated:()=>Li,isPlatformSortableField:()=>Dn,isProjectableField:()=>$c,isRealCalendarDate:()=>P,isRecordScopedAction:()=>Ea,isRetiredFieldType:()=>_n,isRuntimeDefault:()=>lt,isServerOwnedValue:()=>ut,isStructuredGroupBy:()=>Xs,isTitleEligibleField:()=>Or,isUnmaterializedFieldType:()=>xn,isValueStillOffered:()=>Bi,leadWithNameField:()=>Fr,listViewPredicates:()=>sl,loadDimensionFieldMeta:()=>qs,localizeFieldOptions:()=>zs,mergeAuthoredPresentation:()=>ic,mergeAuthoredSeries:()=>rc,mergeFilterNodes:()=>Fe,mergeFilters:()=>ps,nonGridRowCeilingQuery:()=>Zt,normalizeColumnIdentities:()=>ln,normalizeColumnIdentity:()=>cn,normalizeFieldReferenceKeys:()=>Kc,normalizeListViewSchema:()=>Cl,normalizeObjectSortability:()=>wn,normalizeSchemaReferenceKeys:()=>qc,normalizeSortEntries:()=>Kr,normalizeUserAction:()=>Wt,objectAggregateSpecQuery:()=>Zs,optionDisplayLabel:()=>zi,parentRelationshipFieldDef:()=>Yc,parseDebugFlags:()=>po,partitionRowsByPredicate:()=>ji,percentDisplayValue:()=>hc,pickDomProps:()=>Ht,pivotBucketId:()=>ys,pivotCellKey:()=>bs,pivotDimensionValue:()=>vs,readActionPayload:()=>aa,readObjectSortability:()=>En,readOnSuccessNavigation:()=>ya,recordDelete:()=>Ma,recordDisplayValueAt:()=>N,recordSourceDataArmForType:()=>Ol,relabelDimensions:()=>Ns,reportRetiredFieldType:()=>yn,resolveCascadingOptions:()=>Vi,resolveConditionalFormatting:()=>Fi,resolveContextTokens:()=>Uo,resolveDashboardFilterDefs:()=>ss,resolveDateMacros:()=>Bo,resolveDependsOnFields:()=>Ii,resolveDimensionFieldMeta:()=>Ws,resolveDrillTitle:()=>Lo,resolveEffectiveCrudAffordances:()=>qt,resolveFieldRuleState:()=>Et,resolveFilterPlaceholders:()=>Wo,resolveMeasureLabel:()=>Cs,resolveNameField:()=>Pr,resolveRecordIdParamSeed:()=>ka,resolveRecordSourceConfig:()=>El,resolveRecordSourceObjectName:()=>wl,resolveRelationshipTarget:()=>Us,resolveServerActionRecordId:()=>Da,resolveViewId:()=>Ie,resolveVisibleOptions:()=>Ri,rowHeightToDensityMode:()=>dl,sanitizeFileNameBase:()=>Ac,scopeClassFor:()=>To,seriesPresentation:()=>tc,shiftFilterByCompareTo:()=>gs,shouldGroupDisplayNumber:()=>cc,subjectPermissionsOf:()=>ht,toDateInputValue:()=>dc,toDateTimeInputValue:()=>fc,toDisplayDate:()=>F,toDisplayEndDate:()=>ti,toDomProps:()=>Ut,toFilterNode:()=>Ne,toFilterNodeSafely:()=>Pe,toInclusiveEndDay:()=>ni,toPredicateInput:()=>ft,toPredicateRecord:()=>Si,userActionPredicates:()=>Gt,validateSchema:()=>zt,warnOnDeprecatedObjectParams:()=>ra,warnOnUnknownActionKeys:()=>$i,withElementDataSourceInput:()=>at,withoutDeniedFields:()=>Jc}),jl=(0,D.createContext)({});function Ml({scope:e,children:t}){return(0,D.createElement)(jl.Provider,{value:e},t)}function Y(){return(0,D.useContext)(jl)}function Nl(e){return(0,D.useMemo)(()=>typeof e!=`object`||!e||Array.isArray(e)?{}:{record:e},[e])}var Pl=new Set;function Fl(e,t={},n){let r=Y();return(0,D.useMemo)(()=>{let i=new L({...r,...t});if(n?.throwOnError)try{return i.evaluateCondition(e,{throwOnError:!0})}catch(t){let r=typeof e==`string`?e:String(e),i=`${n?.label??``}::${r}`;if(!Pl.has(i)){Pl.add(i);let e=t instanceof Error?t.message:String(t);console.warn(`[object-ui] ${n?.label??`a component`} was hidden/disabled: its predicate threw — ${e}. Predicate: ${r}.`)}return!1}return i.evaluateCondition(e)},[e,t,r,n?.throwOnError,n?.label])}function Il(e,t,n){let r=Y(),i=n?.fallback??!0,a=n?.fields;return(0,D.useMemo)(()=>typeof e==`boolean`?e:e==null||e===``?i:Ai(e,t??{},{fallback:i,scope:r,warnOnError:n?.warnOnError,label:n?.label,fields:a}),[e,t,r,i,n?.warnOnError,n?.label,a])}var X=n(),Z=(0,D.createContext)(null),Ll=({children:e,dataSource:t,debug:n,debugFlags:r,apiFetch:i})=>{let a=(0,D.useContext)(Z),o=i??a?.apiFetch,s=(0,D.useMemo)(()=>({dataSource:t,debug:n,debugFlags:r,apiFetch:o}),[t,n,r,o]);return(0,X.jsx)(Z.Provider,{value:s,children:e})},Rl=()=>{let e=(0,D.useContext)(Z);if(!e)throw Error(`useSchemaContext must be used within a SchemaRendererProvider`);return e},zl=e=>{let t=Y();if(e&&t)return e.split(`.`).reduce((e,t)=>e&&e[t],t)},Bl=D.createContext(null),Vl=({children:e})=>{let t=D.useMemo(()=>{let e=new Map,t=Kl,n=new Set,r=()=>{let r=new Set;for(let t of e.values())for(let e of t)r.add(e);if(r.size===t.size){let e=!0;for(let n of r)if(!t.has(n)){e=!1;break}if(e)return}t=r,n.forEach(e=>e())};return{getNames:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),register:(t,n)=>{let i=e.get(t);i&&i.length===n.length&&i.every((e,t)=>e===n[t])||(e.set(t,[...n]),r())},unregister:t=>{e.delete(t)&&r()}}},[]);return(0,X.jsx)(Bl.Provider,{value:t,children:e})};function Hl(){let e=D.useContext(Bl);return D.useSyncExternalStore(e?e.subscribe:Wl,e?e.getNames:Gl,e?e.getNames:Gl)}function Ul(e,t){let n=D.useContext(Bl),r=t.join(`|`);D.useEffect(()=>{if(n)return n.register(e,r.length===0?[]:r.split(`|`)),()=>n.unregister(e)},[n,e,r])}var Wl=e=>()=>{},Gl=()=>Kl,Kl=new Set,ql=D.createContext(null),Jl=({children:e,recordId:t,...n})=>{let r={...n,recordId:typeof t==`number`?String(t):t},i=D.useMemo(()=>r,[r.objectName,r.recordId,r.dataSource,r.data,r.objectSchema,r.refresh,r.embedded,r.headerSystemActions,r.isFavorite,r.onToggleFavorite]);return(0,X.jsx)(ql.Provider,{value:i,children:e})};function Yl(){return D.useContext(ql)}var Xl=(0,D.createContext)(null);function Zl(e){if(!e||e.length===0)return{};let t={};for(let n of e)if(n.defaultValue!==void 0)t[n.name]=n.defaultValue;else switch(n.type){case`number`:t[n.name]=0;break;case`boolean`:t[n.name]=!1;break;case`object`:t[n.name]={};break;case`array`:t[n.name]=[];break;default:t[n.name]=``}return t}var Ql=({definitions:e,children:t})=>{let n=(0,D.useContext)(Xl),[r,i]=(0,D.useState)(()=>Zl(e)),a=(0,D.useMemo)(()=>e??[],[e]),o=(0,D.useMemo)(()=>new Set(a.map(e=>e.name)),[a]),s=(0,D.useCallback)((e,t)=>{if(!o.has(e)&&n&&n.definitions.some(t=>t.name===e)){n.setVariable(e,t);return}i(n=>({...n,[e]:t}))},[o,n]),c=(0,D.useCallback)(e=>{for(let[t,n]of Object.entries(e))s(t,n)},[s]),l=(0,D.useCallback)(()=>{i(Zl(e))},[e]),u=(0,D.useMemo)(()=>n?{...n.variables,...r}:r,[n,r]),d=(0,D.useMemo)(()=>n?[...n.definitions.filter(e=>!o.has(e.name)),...a]:a,[n,a,o]),f=(0,D.useMemo)(()=>({variables:u,definitions:d,setVariable:s,setVariables:c,resetVariables:l}),[u,d,s,c,l]);return(0,X.jsx)(Xl.Provider,{value:f,children:t})};Ql.displayName=`PageVariablesProvider`;function $l(){return(0,D.useContext)(Xl)??eu}var eu=Object.freeze({variables:Object.freeze({}),definitions:Object.freeze([]),setVariable:()=>{},setVariables:()=>{},resetVariables:()=>{}});function tu(e){let{variables:t,definitions:n,setVariable:r}=$l();return(0,D.useMemo)(()=>{if(!e)return null;let i=n.find(t=>t.source===e);return i?{name:i.name,value:t[i.name],setValue:e=>r(i.name,e)}:null},[e,n,t,r])}function nu(e){if(e!=null)return typeof e==`string`?e:e.defaultValue||e.key}function Q(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}var ru=`params`;function iu(e){if(!Q(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function au(e){return iu(e)}function ou(e,t,n,r){if(typeof e==`string`)return n(e,t);if(Array.isArray(e)){if(r.has(e))return e;r.add(e);let i;for(let a=0;a<e.length;a++){let o=ou(e[a],t+`[`+a+`]`,n,r);o!==e[a]&&(i||=e.slice(),i[a]=o)}return r.delete(e),i??e}if(iu(e)){if(r.has(e))return e;r.add(e);let i;for(let a of Object.keys(e)){let o=e[a],s=ou(o,t+`.`+a,n,r);s!==o&&(i||={...e},Object.defineProperty(i,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))}return r.delete(e),i??e}return e}function su(e,t,n=ru){return ou(e,n,t,new Set)}var cu=/\$\{([^}]+)\}/g;function lu(e){let t=[];cu.lastIndex=0;let n=cu.exec(e);for(;n!==null;)t.push(n[0]),n=cu.exec(e);return t}function uu(e,t,n,r){let i=lu(n);i.length>0&&r.push({key:e,channel:t,value:n,expressions:i})}function du(e,t,n,r){if(Q(e)){for(let[i,a]of Object.entries(e))if(!r?.(i,a)){if(i===`params`&&au(a)){su(a,(e,r)=>(uu(r,t,e,n),e));continue}typeof a==`string`&&uu(i,t,a,n)}}}function fu(e,t,n){let r=[];du(t,`properties`,r);let i=Q(t)?t:void 0;return du(e,`schema`,r,(e,t)=>i?.[e]===t),du(n,`props`,r),r}function pu(e){switch(e.channel){case`properties`:return`properties.`+e.key;case`props`:return`props.`+e.key;default:return e.key}}function mu(e,t,n){let r=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,i=typeof t==`string`&&t?` (id: "`+t+`")`:``,a=n.map(e=>` - `+pu(e)+`: `+JSON.stringify(e.value)+` [`+e.expressions.join(`, `)+`]`);return`[ObjectUI] Unevaluated expression reached the DOM - node `+r+i+`
|
|
4
|
+
`+a.join(`
|
|
5
|
+
`)+"\nThe value above is placed VERBATIM: it is handed to the renderer, and spread\nto the DOM, with its source text intact. Either SchemaRenderer does not\nevaluate this key, or the expression threw and the evaluator returned the\nsource unchanged.\nChannels that do evaluate and read back today: `content`; `properties.*`,\nwhich is evaluated and then HOISTED onto the node, so a renderer declared\nas `({ schema })` reads it back as `schema.<key>`; every string leaf of a\n`params` bag, at any depth, node-level or under `properties`; or resolve\nthe value in the host before handing the schema to SchemaRenderer."}var hu=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function gu(e,t,n,r,i,a){let o=fu(r,i,a);if(o.length===0)return o;if(e&&typeof e==`object`){if(hu.has(e))return o;hu.add(e)}return console.error(mu(t,n,o)),o}var _u=`element:`,vu=new Set([`view:simple`]);function yu(e){return typeof e!=`string`||e.length===0?!1:e.startsWith(_u)?!0:vu.has(e)}var bu="[ObjectUI] A `props` config bag was not read";function xu(e,t){return`${typeof e==`string`&&e?`\`${e}\``:`(untyped node)`}${typeof t==`string`&&t?` (id: '${t}')`:``}`}function Su(e,t,n){let r=n.map(e=>`\`${e}\``).join(`, `),i=n.length===1;return`${bu} - node ${xu(e,t)}\n ${i?`Key`:`Keys`} under \`props\`: ${r}\n\`props\` is NOT hoisted onto the node — only \`properties.*\` is. It is spread as
|
|
6
|
+
React props on the created element, so \`schema.${n[0]}\` is undefined and a\nrenderer declared as \`({ schema })\` never sees ${i?`this key`:`these keys`}. Nothing throws and\nnothing is logged by the renderer: the node renders as if the bag were empty.
|
|
7
|
+
Write ${i?`it`:`them`} under \`properties\` instead (or at node level, where the node's\nschema declares the key). The \`element:*\` renderers merge both bags via
|
|
8
|
+
\`readProps()\`; every other renderer reads \`schema\`. (objectui#6708)`}var Cu=new Set;function wu(e,t,n){if(yu(e)||!Q(t)||!Q(n))return null;let r=Object.keys(n);return r.length>0?r:null}function Tu(e,t,n,r){let i=wu(e,n,r);if(!i)return null;let a=Su(e,t,i);return Cu.has(a)?null:(Cu.add(a),console.warn(a),a)}var Eu="[ObjectUI] A node-gate predicate under `props` is REFUSED",Du=new Set([`disabled`]);function Ou(e,t,n){let r=n.map(e=>`\`${e}\``).join(`, `),i=n.length===1;return`${Eu} - node ${xu(e,t)}\n ${i?`Key`:`Keys`} parked under \`props\`: ${r}\n\`props\` is NOT an authoring surface for the node gates. \`SchemaRenderer\`
|
|
9
|
+
hoists \`properties.*\` onto the node and reads its visibility / enablement
|
|
10
|
+
gates from there; nothing copies \`props.*\`, so this predicate is never a key
|
|
11
|
+
either gate can see. ${i?`It gates`:`They gate`} nothing - the node renders and stays enabled\nexactly as if the predicate said yes, which is why nothing on screen says so.
|
|
12
|
+
MIGRATION: move ${i?`it`:`them`} out of \`props\` - onto the node itself\n(\`{ "type": "card", "visibleWhen": ... }\`, the spelling the spec declares), or
|
|
13
|
+
into the \`properties\` bag, which IS hoisted. The worked pair is in
|
|
14
|
+
\`skills/objectui/rules/protocol.md\`. (objectui#9108)`}function ku(e,t,n){if(!Q(n))return null;let r=yu(e),i=Object.keys(n).filter(e=>t.has(e)&&!(r&&Du.has(e)));return i.length>0?i:null}var Au=new Set;function ju(e,t,n,r){let i=ku(e,n,r);if(!i)return null;let a=Ou(e,t,i);return Au.has(a)?null:(Au.add(a),console.error(a),a)}var Mu=new Set;function Nu(e,t){let n=t===void 0?e:`${e}#${t}`;Mu.has(n)||(Mu.add(n),console.warn(`[ObjectUI] SchemaRenderer: the authored \`data\` key on <${e}${t===void 0?``:` id="${t}"`}> was NOT passed to the component as a React prop. This block's published \`data\` row is the \`ViewData\` OBJECT arm, so \`data\` is read from the schema and judged by that row (objectui#8348). Inline rows go at \`data: { provider: "value", items: [...] }\`; a bare array under \`data\` is refused. A HOST passing rows down as a React \`data\` prop is unaffected.`))}var Pu=`[ObjectUI] A visibility predicate could not be evaluated`,Fu=`[ObjectUI] An enablement predicate could not be evaluated`;function Iu(e){if(e&&typeof e==`object`){let t=e.source;if(typeof t==`string`)return t}return typeof e==`string`?e:String(e)}var Lu={"page-component":"Page-component predicates bind `record` (the row on a record page),\n`current_user`, and page state as `page.<var>`. Check those roots and the\nCEL syntax.","app-shell":"App-shell predicates bind `current_user` - also spelled `user`, `ctx.user`\nand `os.user` - plus `features` (the deployment flags).\nNeither `record` nor `page.<var>` exists at this tier.\nCheck those roots and the CEL syntax."},Ru={visibility:{prefix:Pu,consequence:`The node was treated as its safe default, which on this surface means the
|
|
15
|
+
gate did NOT bite - a predicate that cannot be evaluated reads on screen
|
|
16
|
+
exactly like one that said yes.
|
|
17
|
+
`},concealment:{prefix:Pu,consequence:`The node was treated as its safe default, which on THIS leg is the one
|
|
18
|
+
that BITES: \`hidden\` / \`hiddenOn\` are NOT negated, so that default
|
|
19
|
+
REMOVED the node - it is not on the page at all, and an absent node is
|
|
20
|
+
indistinguishable from metadata that meant to hide it. Nothing is broken
|
|
21
|
+
in the renderer: the block is missing because the predicate above could
|
|
22
|
+
not be evaluated.
|
|
23
|
+
`},enablement:{prefix:Fu,consequence:`The node was treated as its safe default, which on THIS gate is the one
|
|
24
|
+
that BITES: the node renders DISABLED - on screen, greyed out, refusing
|
|
25
|
+
input - and that is indistinguishable from a gate the author meant to
|
|
26
|
+
close. No pixel says a predicate failed, so this line is the only thing
|
|
27
|
+
that will ever name the one that did it.
|
|
28
|
+
`}};function zu(e,t,n,r,i,a=`page-component`,o=`visibility`){let s=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,c=typeof t==`string`&&t?` (id: "`+t+`")`:``,l=Ru[o];return l.prefix+` - node `+s+c+`
|
|
29
|
+
`+n+`: `+JSON.stringify(Iu(r))+`
|
|
30
|
+
Reason: `+i+`
|
|
31
|
+
`+l.consequence+Lu[a]}var Bu=new Set;function Vu(e,t,n,r,i,a=`page-component`,o=`visibility`){let s=i instanceof Error?i.message:String(i),c=JSON.stringify([e,n,Iu(r)]);Bu.has(c)||(Bu.add(c),console.warn(zu(e,t,n,r,s,a,o)))}var Hu={visibility:{prefix:"[ObjectUI] A visibility predicate read `data.*` that the bound `data` does not answer",consequence:"At the node tier `data` is whatever the HOST published under that name\nin the ambient predicate scope, and it is NOT the row. Since\nobjectui#9308 it is not the data-source adapter either - the renderer\nbinds no `data` of its own. The reads above are undefined on it, so\nthis predicate is a CONSTANT: it does not\ndepend on the row at all, and on this surface a constant `false` hides the\nnode on every row while looking exactly like a gate that said no.\nWrite the row as `record.*` (e.g. `record.status`), which page-component\npredicates bind alongside `current_user` and page state as `page.<var>`.\n`data.*` as a spelling for the row is deprecated (objectui#5330) and was\nnever bound to the row on this tier."},enablement:{prefix:"[ObjectUI] An enablement predicate read `data.*` that the bound `data` does not answer",consequence:"At the node tier `data` is whatever the HOST published under that name\nin the ambient predicate scope, and it is NOT the row. Since\nobjectui#9308 it is not the data-source adapter either - the renderer\nbinds no `data` of its own. The reads above are undefined on it, so\nthis predicate is a CONSTANT: it does not\ndepend on the row at all, and on THIS gate the dangerous polarity is a\nconstant `true`: the node renders DISABLED - on screen, greyed out,\nrefusing input - on every row, in every build, while looking exactly\nlike a gate that said no. No pixel says the predicate is a constant, so\nthis line is the only thing that will ever name it.\nWrite the row as `record.*` (e.g. `record.status`), which page-component\npredicates bind alongside `current_user` and page state as `page.<var>`.\n`data.*` as a spelling for the row is deprecated (objectui#5330) and was\nnever bound to the row on this tier."}};function Uu(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,`''`)}var Wu=/(^|[^A-Za-z0-9_$.])data\.([A-Za-z_$][A-Za-z0-9_$]*(?:\.[A-Za-z_$][A-Za-z0-9_$]*)*)/g;function Gu(e,t){let n=Uu(e),r=[];Wu.lastIndex=0;let i;for(;(i=Wu.exec(n))!==null;){let e=i[2],n=t;try{for(let t of e.split(`.`)){if(n==null){n=void 0;break}n=n[t]}}catch{return[]}let a=`data.`+e;n===void 0&&r.indexOf(a)===-1&&r.push(a)}return r}function Ku(e,t,n,r,i,a=`visibility`){let o=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,s=typeof t==`string`&&t?` (id: "`+t+`")`:``,c=Hu[a];return c.prefix+` - node `+o+s+`
|
|
32
|
+
`+n+`: `+JSON.stringify(Iu(r))+"\n Unanswered by the bound `data`: "+i.join(`, `)+`
|
|
33
|
+
`+c.consequence}function qu(e,t,n,r,i,a=`visibility`){let o=Iu(r);if(o.indexOf(`data.`)===-1)return;let s=Gu(o,i);if(s.length===0)return;let c=JSON.stringify([`adapter-only-data`,e,n,o]);Bu.has(c)||(Bu.add(c),console.warn(Ku(e,t,n,r,s,a)))}var $=(()=>{try{return!1}catch{return!0}})(),Ju=typeof WeakMap<`u`?new WeakMap:{set(){},get(){},has(){return!1}},Yu=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function Xu(e){if(!$||!e||typeof e!=`object`)return{valid:!0,messages:[]};let t=Ju.get(e);if(t)return t;let n={valid:!0,messages:[]};try{let t=zt(e);if(!t.valid){let r=t.errors.map(e=>`${e.path}: ${e.message}`);n={valid:!1,messages:r},Yu.has(e)||(Yu.add(e),console.warn(`[ObjectUI] Invalid schema detected:
|
|
34
|
+
`+r.join(`
|
|
35
|
+
`),e))}}catch(t){Yu.has(e)||(Yu.add(e),console.warn(`[ObjectUI] Schema validator threw:`,t))}return Ju.set(e,n),n}function Zu(e){let t={};return e.ariaLabel&&(t[`aria-label`]=nu(e.ariaLabel)),e.ariaDescribedBy&&(t[`aria-describedby`]=e.ariaDescribedBy),e.role&&(t.role=e.role),t}var Qu=new Set([`type`,`id`]);function $u(e,t){if(!Q(e))return{};if(!Q(t))return e;let n=null;for(let r of Object.keys(t))Qu.has(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n||={...e},delete n[r]);return n??e}var ed=[`visibleWhen`,`visible`,`visibleOn`,`visibility`],td=[`hidden`,`hiddenOn`],nd=new Set([...ed,...td]),rd=[`disabled`,`disabledOn`],id=[`enabled`],ad=new Set([...nd,...rd,...id]),od=new Set([...nd,...rd]),sd=e=>Q(e)&&e.dialect===`cel`&&typeof e.source==`string`,cd=(e,t,n)=>ad.has(e)&&sd(t)?t:n(t),ld=e=>Q(e)&&typeof e.dialect==`string`&&typeof e.source==`string`,ud=(e,t)=>!ad.has(e)&&Q(t)&&!ld(t),dd=(e,t,n)=>({...e,current_user:e?.user,...t&&typeof t==`object`&&!Array.isArray(t)?{record:t}:null,page:n}),fd=(e,t,n)=>t===`params`&&au(n)?su(n,t=>e.evaluate(t)):ud(t,n)?n:cd(t,n,t=>e.evaluate(t)),pd=(e,t)=>{let n={...t};for(let[t,r]of Object.entries(n))n[t]=fd(e,t,r);return n};function md(e,t,n,r){return Q(e)?pd(new L(dd(t,n,r)),e):e}var hd=e=>td.includes(e)?`concealment`:`visibility`;function gd(e){let t=e.properties,n=Q(t),r=r=>n&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:e[r];for(let e of ed)if(r(e)!==void 0)return e;for(let e of td)if(j(r(e)))return e}function _d(e){if(typeof e!=`string`||e===``)return;let t=e.toLowerCase();for(let n of O.getKnownTypes())if(n!==e&&n.toLowerCase()===t)return n}var vd=class extends D.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidUpdate(e){this.state.hasError&&(e.componentType!==this.props.componentType||e.resetKey!==this.props.resetKey)&&this.setState({hasError:!1,error:null})}handleRetry=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError&&this.state.error){let e=this.state.error;return fo(e),(0,X.jsxs)(`div`,{className:`p-4 border border-orange-400 rounded bg-orange-50 text-orange-700 my-2`,role:`alert`,children:[(0,X.jsxs)(`p`,{className:`font-medium`,children:[`Component`,this.props.componentType?` "${this.props.componentType}"`:``,` failed to render`]}),(0,X.jsx)(`p`,{className:`text-sm mt-1`,children:e.message}),!1,(0,X.jsx)(`button`,{type:`button`,onClick:this.handleRetry,className:`mt-2 text-sm underline hover:no-underline`,children:`Retry`})]})}return this.props.children}},yd={};function bd(e,t){if(!t||!(`data`in e))return e;let{data:n,...r}=e;return r}function xd(e){if(!(`objectFields`in e))return e;let{objectFields:t,...n}=e;return n}var Sd=(0,D.forwardRef)(({schema:e,...t},n)=>{let r=(0,D.useContext)(Z),i=r?.dataSource||yd,a=Y(),o=Yl()?.data,{variables:s}=$l(),[,c]=(0,D.useReducer)(e=>e+1,0);(0,D.useEffect)(()=>{let e=O.subscribe(c);return c(),e},[]);let[l,u]=(0,D.useState)(null),f=D.useId(),p=(0,D.useMemo)(()=>{if(!e||typeof e!=`object`)return e;let t=new L(dd(a,o,s)),n={...e},r=(e,r)=>{let i=hd(r);if(!$)return t.evaluateCondition(e,{onFault:t=>Vu(n.type,n.id,r,e,t,`page-component`,i)});try{let i=t.evaluateCondition(e,{throwOnError:!0});return qu(n.type,n.id,r,e,a?.data),i}catch(t){return Vu(n.type,n.id,r,e,t,`page-component`,i),!0}},i=(e,r)=>{let i=!1,o=t.evaluateCondition(e,{onFault:t=>{i=!0,Vu(n.type,n.id,r,e,t,`page-component`,`enablement`)}});return $&&!i&&qu(n.type,n.id,r,e,a?.data,`enablement`),o},c=(e,n)=>fd(t,e,n);au(n.params)&&(n[ru]=c(ru,n[ru]));let l=Q(n.properties)?n.properties:void 0;if(l&&(n.properties=pd(t,l)),$){let e=gd(n);if(e&&l&&Object.prototype.hasOwnProperty.call(l,e)){let t=l[e];typeof t==`string`&&t.includes("${")&&r(t,e)}}if(Q(n.properties)){let e=n.type,t=n.id,r=n.properties;for(let[e,t]of Object.entries(r))e!==`type`&&e!==`id`&&(n[e]=t);e!==void 0&&(n.type=e),t!==void 0&&(n.id=t),n.properties=r}typeof n.content==`string`&&(n.content=t.evaluate(n.content));for(let e of d(typeof n.type==`string`?n.type:``))typeof n[e]==`string`&&(n[e]=t.evaluate(n[e]));if(Q(n.props)){let e={...n.props};for(let[t,n]of Object.entries(e))e[t]=c(t,n);n.props=e}return ju(n.type,n.id,od,$u(n.props,n.properties)),(n.visibleWhen===void 0?n.visible===void 0?n.visibleOn===void 0?n.visibility===void 0?j(n.hidden)?r(n.hidden,`hidden`):j(n.hiddenOn)&&r(n.hiddenOn,`hiddenOn`):!r(n.visibility,`visibility`):!r(n.visibleOn,`visibleOn`):!r(n.visible,`visible`):!r(n.visibleWhen,`visibleWhen`))&&(n._hidden=!0),(j(n.disabled)?i(n.disabled,`disabled`):j(n.disabledOn)&&i(n.disabledOn,`disabledOn`))&&(n._disabled=!0),n},[e,i,a,s,o]),m=(0,D.useMemo)(()=>{let e=p;if(!e||typeof e!=`object`)return{scopeClass:``,scopedCss:``,mergedClassName:void 0,schemaForComponent:e};let t=e.responsiveStyles;if(!wo(t))return{scopeClass:``,scopedCss:``,mergedClassName:e.className,schemaForComponent:e};let n=To(e.id??f),r=[e.className,n].filter(Boolean).join(` `);return{scopeClass:n,scopedCss:Eo(`.${n}`,t),mergedClassName:r,schemaForComponent:{...e,className:r}}},[p,f]);if(!p)return null;if(typeof p==`string`)return(0,X.jsx)(X.Fragment,{children:p});if(typeof p!=`object`)return(0,X.jsx)(X.Fragment,{children:String(p)});if(p._hidden)return null;let h=$?Xu(e):{valid:!0,messages:[]};ho(`schema`,`Rendering schema node`,{type:p.type,id:p.id});let g=O.get(p.type);if(!g){if(!l&&O.hasLazy(p.type)){let e=O.loadLazy(p.type);if(e)return e.catch(e=>{u(e instanceof Error?e:Error(String(e)))}),(0,X.jsxs)(`div`,{className:`p-2 text-sm text-muted-foreground animate-pulse`,role:`status`,"aria-live":`polite`,"data-lazy-loading":p.type,children:[`Loading `,(0,X.jsx)(`code`,{children:p.type}),`…`]})}ho(`schema`,`Component not found in registry`,{type:p.type}),lo[`OBJUI-001`];let e=_d(p.type);return(0,X.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,children:[(0,X.jsxs)(`p`,{className:`font-medium`,children:[`Unknown component type: `,(0,X.jsx)(`strong`,{children:p.type}),e===void 0?null:(0,X.jsxs)(X.Fragment,{children:[` — did you mean '`,(0,X.jsx)(`strong`,{children:e}),`'?`]})]}),l&&(0,X.jsxs)(`p`,{className:`text-xs mt-1`,children:[`Failed to load plugin: `,l.message]}),!1,(0,X.jsx)(`pre`,{className:`text-xs mt-2 overflow-auto`,children:JSON.stringify(p,null,2)})]})}let{type:_,children:v,body:y,schema:b,visible:x,visibleWhen:S,visibleOn:C,visibility:w,hidden:ee,hiddenOn:te,disabled:ne,disabledOn:re,dataSource:ie,testId:ae,objectFields:oe,_hidden:se,_disabled:T,responsiveStyles:ce,...le}=p;$&&gu(e,p.type,p.id,ae===void 0?le:{...le,testId:ae},p.properties,p.props);let ue=Ol(p.type)===`view-data`,de=xd($u(p.props,p.properties)),fe=bd(de,ue);$&&fe!==de&&Nu(p.type,p.id),$&&Tu(p.type,p.id,e?.props,fe);let pe=bd(le,ue);$&&pe!==le&&Nu(p.type,p.id);let{scopeClass:me,scopedCss:he,mergedClassName:ge,schemaForComponent:E}=m,_e=Zu(p),ve=r?.debug||r?.debugFlags?.enabled,ye={};ve&&(ye[`data-debug-type`]=p.type,p.id&&(ye[`data-debug-id`]=p.id)),_o(`render:${p.type}:${p.id??`anon`}`);let be=ve?performance.now():0,xe=(0,X.jsxs)(vd,{componentType:p.type,resetKey:p.id??null,children:[he?(0,X.jsx)(`style`,{"data-os-scope":me,dangerouslySetInnerHTML:{__html:he}}):null,D.createElement(g,{schema:E,...pe,...fe,..._e,...ye,disabled:T||void 0,className:ge,"data-obj-id":p.id,"data-obj-type":p.type,...ae===void 0?{}:{"data-testid":ae},...$&&!h.valid?{"data-obj-schema-invalid":`true`}:{},...t})]});if(vo(`render:${p.type}:${p.id??`anon`}`),ve&&be){let e=performance.now()-be;bo.getInstance().addPerf({type:p.type,id:p.id,durationMs:e,timestamp:Date.now()})}return xe});Sd.displayName=`SchemaRenderer`;function Cd(e){return typeof e==`number`||typeof e==`boolean`?e?String(e):void 0:e}var wd=(0,D.createContext)({});function Td({currentUserId:e,currentOrgId:t,children:n}){let r=(0,D.useMemo)(()=>({currentUserId:e,currentOrgId:t}),[e,t]);return(0,D.createElement)(wd.Provider,{value:r},n)}function Ed(){let e=(0,D.useContext)(wd),t=Yl()?.recordId;return(0,D.useMemo)(()=>t==null?e:{...e,recordId:t},[e,t])}function Dd(e,t){let n=Wo(e,t);return{authored:e,currentUserId:t.currentUserId,currentOrgId:t.currentOrgId,recordId:t.recordId,onUnresolved:t.onUnresolved,resolved:Ad(n,e)?e:n}}var Od=12;function kd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ad(e,t,n=0){if(Object.is(e,t))return!0;if(n>=Od)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))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,r)=>Ad(e,t[r],n+1));if(kd(e)&&kd(t)){let r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&Ad(e[r],t[r],n+1))}return!1}function jd(e,t){let[n,r]=D.useState(()=>Dd(e,t));if(n.currentUserId!==t.currentUserId||n.currentOrgId!==t.currentOrgId||n.recordId!==t.recordId||n.onUnresolved!==t.onUnresolved||!Ad(n.authored,e)){let n=Dd(e,t);return r(n),n.resolved}return n.resolved}function Md(){let{t:e}=me(),t=(0,D.useRef)(e);(0,D.useEffect)(()=>{t.current=e});let[n]=(0,D.useState)(()=>(e,n)=>String(t.current(e,n)));return n}function Nd(e={}){let{context:t={},onConfirm:n,onToast:r,onModal:i,onNavigate:a,onParamCollection:o,onResultDialog:s}=`context`in e?e:{context:e},[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(null),[f,p]=(0,D.useState)(null),m=Md(),h=(0,D.useMemo)(()=>{let e=new V(t);return e.setTranslator(m),n&&e.setConfirmHandler(n),r&&e.setToastHandler(r),i&&e.setModalHandler(i),a&&e.setNavigationHandler(a),o&&e.setParamCollectionHandler(o),s&&e.setResultDialogHandler(s),e},[JSON.stringify(t)]);return{execute:(0,D.useCallback)(async e=>{l(!0),d(null),p(null);try{let t=await h.execute(e);return p(t),t.success||d(t.error||`Action failed`),t}catch(e){let t=e.message;d(t);let n={success:!1,error:t};return p(n),n}finally{l(!1)}},[h]),loading:c,error:u,result:f,updateContext:(0,D.useCallback)(e=>{h.updateContext(e)},[h]),runner:h}}var Pd={sm:`min(92vw, 480px)`,md:`min(92vw, 720px)`,lg:`min(92vw, 960px)`,xl:`min(92vw, 1200px)`,full:`min(92vw, 1600px)`};function Fd(e){if(!e)return;if(e.width!==void 0)return e.width;let t=e.size;if(t&&t!==`auto`)return Pd[t]}function Id(e){let{navigation:t,objectName:n,onNavigate:r,onRowClick:i}=e,[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(null),l=t?.mode??`page`,u=Fd(t),d=l===`drawer`||l===`modal`||l===`split`||l===`popover`,f=(0,D.useCallback)(()=>{o(!1),c(null)},[]),p=(0,D.useCallback)(e=>{c(e),o(!0)},[]),m=(0,D.useCallback)((e,a)=>{if(i){i(e,a);return}if(a&&(a.metaKey||a.ctrlKey||a.button===1)){let t=e.id||e._id;if(r&&t!=null){r(t,`new_window`);return}}if(!t){let t=e.id||e._id;r&&t!=null&&r(t,`view`);return}if(!(l===`none`||t.preventNavigation)){if(l===`new_window`||t.openNewTab){let t=e.id||e._id;if(r&&t!=null){r(t,`new_window`);return}let i=encodeURIComponent(String(t)),a=n?`/${n}/record/${i}`:`/${i}`;window.open(a,`_blank`);return}if(l===`page`){let t=e.id||e._id;r&&t!=null&&r(t,`view`);return}if(d){c(e),o(!0);return}}},[i,t,l,n,r,d]);return(0,D.useMemo)(()=>({isOpen:a,selectedRecord:s,mode:l,close:f,open:p,setIsOpen:o,handleClick:m,width:u,isOverlay:d}),[a,s,l,f,p,m,u,d])}var Ld=(0,D.createContext)(!1),Rd=({value:e=!0,children:t})=>(0,X.jsx)(Ld.Provider,{value:e,children:t}),zd=()=>(0,D.useContext)(Ld),Bd=(0,D.createContext)(null),Vd=({children:e,context:t={},onConfirm:n,onToast:r,onModal:i,onNavigate:a,onParamCollection:o,onResultDialog:s,handlers:c})=>{let[l,u]=(0,D.useState)(!1),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)(null),h=Md(),g=(0,D.useMemo)(()=>{let e=new V({...t,ctx:t&&typeof t.ctx==`object`?{...t,...t.ctx}:{...t}});return e.setTranslator(h),n&&e.setConfirmHandler(n),r&&e.setToastHandler(r),i&&e.setModalHandler(i),a&&e.setNavigationHandler(a),o&&e.setParamCollectionHandler(o),s&&e.setResultDialogHandler(s),c&&Object.entries(c).forEach(([t,n])=>{e.registerHandler(t,n)}),e},[JSON.stringify(t)]),_=Y().current_user,v=_===void 0?``:JSON.stringify(_),y=ht(_);(0,D.useMemo)(()=>{_!==void 0&&g.updateContext({current_user:_})},[g,v,y]);let b=(0,D.useCallback)(async e=>{u(!0),f(null),m(null);try{let t=await g.execute(e);return m(t),t.success||f(t.error||`Action failed`),t}catch(e){let t=e.message;f(t);let n={success:!1,error:t};return m(n),n}finally{u(!1)}},[g]),x=(0,D.useCallback)(async(e,t)=>{u(!0),f(null),m(null);try{let n=await g.executeChain(e,t);return m(n),n.success||f(n.error||`Chain failed`),n}catch(e){let t=e.message;f(t);let n={success:!1,error:t};return m(n),n}finally{u(!1)}},[g]),S=(0,D.useCallback)(e=>{g.updateContext(e)},[g]),C=(0,D.useMemo)(()=>({execute:b,executeChain:x,loading:l,error:d,result:p,runner:g,updateContext:S}),[b,x,l,d,p,g,S]);return(0,X.jsx)(Bd.Provider,{value:C,children:e})};Vd.displayName=`ActionProvider`;function Hd(){let e=(0,D.useContext)(Bd);if(!e){let e=new V;return{execute:t=>e.execute(t),executeChain:(t,n)=>e.executeChain(t,n),loading:!1,error:null,result:null,runner:e,updateContext:t=>e.updateContext(t)}}return e}function Ud(){return(0,D.useContext)(Bd)!==null}(0,D.createContext)(null);var Wd={toast:{surface:`delegate`,transient:!0},snackbar:{surface:`snackbar`,transient:!0},banner:{surface:`banner`,transient:!1},alert:{surface:`alert`,transient:!1},inline:{surface:`inline`,transient:!1}};function Gd(e){return e===`modal`?`alert`:e&&e in Wd?e:`toast`}new Set(Object.keys(Wd));var Kd=new Set([`top_left`,`top_center`,`top_right`,`bottom_left`,`bottom_center`,`bottom_right`]);function qd(e={}){return{defaultPosition:e.defaultPosition??e.position,defaultDuration:e.defaultDuration??5e3,maxVisible:e.stacking===!1?1:e.maxVisible??5,stackDirection:e.stackDirection??`down`,pauseOnHover:e.pauseOnHover??!0}}var Jd=0,Yd=(()=>{try{return!1}catch{return!0}})(),Xd={delegate:"pass `onToast` to <NotificationProvider>",snackbar:`mount <NotificationSnackbar /> from @object-ui/components`,banner:`mount <NotificationBanners /> from @object-ui/components`,alert:`mount <NotificationAlerts /> from @object-ui/components`,inline:`mount <NotificationInline /> from @object-ui/components at the raising surface`},Zd=(0,D.createContext)(null),Qd=({children:e,config:t={},onToast:n})=>{let r=(0,D.useMemo)(()=>qd(t),[JSON.stringify(t)]),[i,a]=(0,D.useState)([]),o=(0,D.useRef)(new Map),s=(0,D.useRef)(new Map),c=(0,D.useCallback)((e,t)=>{let n=setTimeout(()=>{s.current.delete(e),a(t=>t.filter(t=>t.id!==e))},t);s.current.set(e,{handle:n,endsAt:Date.now()+t,left:t})},[]),l=(0,D.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),s.current.set(e,{...t,left:Math.max(0,t.endsAt-Date.now())}))},[]),u=(0,D.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),c(e,t.left))},[c]);(0,D.useEffect)(()=>()=>{for(let{handle:e}of s.current.values())clearTimeout(e);s.current.clear()},[]);let d=(0,D.useCallback)(e=>{let t=o.current;return t.set(e,(t.get(e)??0)+1),()=>{let n=(t.get(e)??1)-1;n>0?t.set(e,n):t.delete(e)}},[]),f=(0,D.useCallback)(e=>{let t=`notification-${++Jd}`,i=Gd(e.displayType),{surface:s,transient:l}=Wd[i],u={...e,displayType:i,id:t,createdAt:new Date,read:!1};a(e=>[u,...e]),s===`delegate`&&n?.(u,r),Yd&&s!==`delegate`&&(o.current.get(s)??0)===0&&console.warn(`[NotificationProvider] "${u.title}" declares displayType '${i}' but no ${i} surface is mounted, so it will not be shown. To present it, ${Xd[s]}.`);let d=e.duration??(l?r.defaultDuration:0);return d>0&&c(t,d),t},[r,n,c]),p=(0,D.useCallback)((e,t)=>f({title:e,message:t,severity:`info`}),[f]),m=(0,D.useCallback)((e,t)=>f({title:e,message:t,severity:`success`}),[f]),h=(0,D.useCallback)((e,t)=>f({title:e,message:t,severity:`warning`}),[f]),g=(0,D.useCallback)((e,t)=>f({title:e,message:t,severity:`error`}),[f]),_=(0,D.useCallback)(e=>{a(t=>t.map(t=>t.id===e?{...t,read:!0}:t))},[]),v=(0,D.useCallback)(()=>{a(e=>e.map(e=>({...e,read:!0})))},[]),y=(0,D.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),s.current.delete(e)),a(t=>t.filter(t=>t.id!==e))},[]),b=(0,D.useCallback)(()=>{a([])},[]),x=(0,D.useMemo)(()=>i.filter(e=>!e.read).length,[i]),S=(0,D.useMemo)(()=>({notifications:i,unreadCount:x,notify:f,info:p,success:m,warning:h,error:g,markAsRead:_,markAllAsRead:v,dismiss:y,clearAll:b,config:r,pauseAutoDismiss:l,resumeAutoDismiss:u,registerSurface:d}),[i,x,f,p,m,h,g,_,v,y,b,r,l,u,d]);return(0,X.jsx)(Zd.Provider,{value:S,children:e})};Qd.displayName=`NotificationProvider`;function $d(){let e=(0,D.useContext)(Zd);if(!e)throw Error(`useNotifications must be used within a <NotificationProvider>. Wrap your app with <NotificationProvider> to use the notification system.`);return e}function ef(){return(0,D.useContext)(Zd)!==null}function tf(e,t){let n=t.maxVisible>0?e.slice(0,t.maxVisible):e;return t.stackDirection===`up`?n:[...n].reverse()}function nf(e,t){let n=e.position??t?.defaultPosition;if(!n)return;let r=n.replace(/-/g,`_`);return Kd.has(r)?r:void 0}function rf(e,t){let{notifications:n,registerSurface:r}=$d(),{surface:i}=Wd[e];return(0,D.useEffect)(()=>r(i),[r,i]),(0,D.useMemo)(()=>n.filter(n=>Gd(n.displayType)===e&&(e!==`inline`||(n.scope??void 0)===t)),[n,e,t])}var af=(0,D.createContext)(null);function of(){let e=(0,D.useContext)(af);if(!e)throw Error(`useDnd must be used within a <DndProvider>. Wrap your app with <DndProvider> to use the drag and drop system.`);return e}function sf(){return(0,D.useContext)(af)!==null}var cf=(0,D.createContext)(null);function lf(){return(0,D.useContext)(cf)}var uf=(0,D.createContext)(null),df=Object.freeze([]),ff=Object.freeze({apps:df,objects:df,dashboards:df,reports:df,pages:df,loading:!1,error:null,refresh:async()=>{},invalidate:()=>{},ensureType:async()=>[],getItem:async()=>null,getItemsByType:()=>[],getTypeStatus:()=>`ready`});function pf(){return(0,D.useContext)(uf)??ff}function mf(e,t){let{getItem:n}=pf(),[r,i]=(0,D.useState)({item:null,loading:!!t,error:null});return(0,D.useEffect)(()=>{if(!t){i(e=>e.item===null&&!e.loading&&e.error===null?e:{item:null,loading:!1,error:null});return}let r=!1;return i(e=>({...e,loading:!0,error:null})),n(e,t).then(e=>{r||i({item:e,loading:!1,error:null})}).catch(e=>{r||i({item:null,loading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{r=!0}},[e,t,n]),r}var hf=D.createContext(null),gf=({canEdit:e=!0,locked:t=!1,approvalPending:n,approvalProgress:r,approvalIsSubmitter:i,lockedReason:a,children:o})=>{let s=n??t,[c,l]=D.useState(!1),[u,d]=D.useState({}),[f,p]=D.useState(null),[m,h]=D.useState(!1),[g,_]=D.useState(null),[v,y]=D.useState(null),b=D.useCallback(t=>{e&&(p(t??null),l(!0),_(null),y(null))},[e]),x=D.useCallback((e,t)=>{d(n=>({...n,[e]:t}))},[]),S=D.useCallback(()=>{d({}),l(!1),p(null),h(!1),_(null),y(null)},[]),C=D.useMemo(()=>({editing:c,canEdit:e,locked:t,approvalPending:s,approvalProgress:r,approvalIsSubmitter:i,lockedReason:a,draft:u,autoFocusField:f,saving:m,error:g,fieldErrors:v,enter:b,setField:x,cancel:S,reset:S,setSaving:h,setError:_,setFieldErrors:y}),[c,e,t,s,r,i,a,u,f,m,g,v,b,x,S]);return(0,X.jsx)(hf.Provider,{value:C,children:o})};function _f(){return D.useContext(hf)}var vf=D.createContext(null),yf=({children:e,...t})=>{let n=D.useMemo(()=>t,[t.items,t.onAddComment,t.onAddReply,t.onToggleReaction,t.mentionSuggestions,t.onUploadAttachments,t.loading,t.error,t.activityDenied,t.commentsDenied]);return(0,X.jsx)(vf.Provider,{value:n,children:e})};function bf(){return D.useContext(vf)}var xf=(0,D.createContext)({}),Sf=({value:e,children:t})=>(0,X.jsx)(xf.Provider,{value:e,children:t});function Cf(){return(0,D.useContext)(xf)}var wf=(0,D.createContext)({}),Tf=({value:e,children:t})=>(0,X.jsx)(wf.Provider,{value:e,children:t});function Ef(){return(0,D.useContext)(wf)}var Df=(0,D.createContext)(null),Of=({value:e,children:t})=>(0,X.jsx)(Df.Provider,{value:e,children:t});function kf(){return(0,D.useContext)(Df)}function Af(){let{variables:e}=$l(),{updateContext:t}=Hd();return D.useEffect(()=>(t({pageVariables:e}),()=>{t({pageVariables:{}})}),[e,t]),null}Af.displayName=`PageVariableActionBridge`;var jf=e=>!!e&&typeof e==`object`;async function Mf(e,t){let n=typeof e?.getObjectSchema==`function`,r=typeof e?.listViews==`function`;if(!n&&!r)return{capable:!1,views:{}};let i=n?e.getObjectSchema(t).then(e=>jf(e)?e.listViews??e.list_views:void 0,()=>void 0):Promise.resolve(void 0),a=r?e.listViews(t).then(e=>e,()=>void 0):Promise.resolve(void 0),[o,s]=await Promise.all([i,a]);return{capable:!0,views:ze(o,s)}}function Nf(e,t){let n=(0,D.useContext)(Z),r=t??n?.dataSource??null,i=(0,D.useMemo)(()=>{let t=jf(e)?e.dataSource:void 0;return Re(t)?t:void 0},[e]),a=i?.object,o=i?.view,s=a&&o?JSON.stringify([a,o]):``,[c,l]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(!a||!o)return;let e=!1;return Mf(r,a).then(({capable:t,views:n})=>{if(e)return;if(!t){l({key:s,view:null,error:`dataSource.view "${o}" cannot be resolved: this data source cannot list the saved views of object "${a}".`});return}let r=Be(n,o,a);l(r?{key:s,view:r}:{key:s,view:null,error:Xe(a,o,Object.keys(n))})}),()=>{e=!0}},[r,a,o,s]),(0,D.useMemo)(()=>{if(!i)return{status:`absent`};if(!i.view)return{status:`ready`,config:i,composed:Ye(i)};if(c?.key!==s)return{status:`loading`,config:i};if(c.view===null)return{status:`missing`,config:i,error:c.error};let e;try{e=Ye(i,c.view)}catch(e){if(!(e instanceof E))throw e;return{status:`missing`,config:i,error:e.message,filterRefusal:e}}return{status:`resolved`,config:i,view:c.view,composed:e}},[i,c,s])}function Pf(e){return!e||e.enabled!==!1&&e.handlerReady!==!1&&e.status!==`stub`&&e.status!==`unavailable`}[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);var Ff={compact:32,comfortable:40,spacious:52},If={compact:`py-1 px-2`,comfortable:`py-2 px-3`,spacious:`py-3 px-4`},Lf={compact:`text-xs`,comfortable:`text-sm`,spacious:`text-base`},Rf=[`compact`,`comfortable`,`spacious`];function zf(e=`comfortable`,t){let[n,r]=(0,D.useState)(e),i=t?.rowHeights??Ff,a=t?.paddingClasses??If,o=t?.fontSizeClasses??Lf,s=(0,D.useRef)(t?.onChange);(0,D.useEffect)(()=>{s.current=t?.onChange},[t?.onChange]);let c=(0,D.useRef)(e);(0,D.useEffect)(()=>{e!==c.current&&(c.current=e,r(e))},[e]);let l=(0,D.useCallback)(e=>{r(t=>t===e?t:(queueMicrotask(()=>s.current?.(e)),e))},[]),u=(0,D.useCallback)(()=>{r(e=>{let t=Rf[(Rf.indexOf(e)+1)%Rf.length];return queueMicrotask(()=>s.current?.(t)),t})},[]);return(0,D.useMemo)(()=>({mode:n,setMode:l,cycle:u,rowHeight:i[n],paddingClass:a[n],fontSizeClass:o[n]}),[n,l,u,i,a,o])}function Bf(e){return typeof window>`u`?()=>{}:(window.addEventListener(`online`,e),window.addEventListener(`offline`,e),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,e)})}function Vf(){return typeof navigator<`u`?navigator.onLine:!0}function Hf(){return!0}var Uf=`objectui-offline-queue`;function Wf(){if(typeof localStorage>`u`)return[];try{let e=localStorage.getItem(Uf);return e?JSON.parse(e):[]}catch{return[]}}function Gf(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(Uf,JSON.stringify(e))}catch{}}var Kf=0;function qf(){return Kf+=1,`mut_${Date.now()}_${Kf}`}var Jf={enabled:!0,strategy:`network_first`,offlineIndicator:!0,offlineMessage:`You are currently offline. Changes will be synced when reconnected.`,queueMaxSize:100};function Yf(e={}){let{enabled:t=Jf.enabled,strategy:n=Jf.strategy,offlineIndicator:r=Jf.offlineIndicator,offlineMessage:i=Jf.offlineMessage,queueMaxSize:a=Jf.queueMaxSize,sync:o}=e,s=(0,D.useSyncExternalStore)(Bf,Vf,Hf),[c,l]=(0,D.useState)(Wf),[u,d]=(0,D.useState)(`idle`),f=(0,D.useRef)(o);(0,D.useInsertionEffect)(()=>{f.current=o});let p=(0,D.useRef)(c);(0,D.useInsertionEffect)(()=>{p.current=c}),(0,D.useEffect)(()=>{Gf(c)},[c]),(0,D.useEffect)(()=>{t&&(s?u===`offline`&&d(`idle`):d(`offline`))},[s,t,u]);let m=(0,D.useCallback)(e=>{t&&l(t=>{let n={...e,id:qf(),timestamp:Date.now()},r=[...t,n];return r.length>a?r.slice(r.length-a):r})},[t,a]),h=(0,D.useCallback)(()=>{l([])},[]),g=(0,D.useCallback)(async()=>{let e=p.current;if(t&&e.length!==0){d(`syncing`);try{let t=f.current?.batchSize??e.length,n=e.slice(0,t);await new Promise(e=>setTimeout(e,0)),l(e=>e.filter(e=>!n.some(t=>t.id===e.id))),d(`idle`)}catch{d(`error`)}}},[t]),_=c.length>0;return(0,D.useEffect)(()=>{if(!t||!s||!_)return;let e=setTimeout(()=>{g()},100);return()=>clearTimeout(e)},[s,t,_,g]),(0,D.useMemo)(()=>({isOnline:s,enabled:t,syncState:u,strategy:n,pendingCount:c.length,queueMutation:m,sync:g,clearQueue:h,showIndicator:r&&!s,offlineMessage:i}),[s,t,u,n,c.length,m,g,h,r,i])}function Xf(){return{canUndo:z.canUndo,canRedo:z.canRedo,undoDescription:z.peekUndo()?.description,redoDescription:z.peekRedo()?.description,history:z.getHistory()}}function Zf(){return{canUndo:!1,canRedo:!1,undoDescription:void 0,redoDescription:void 0,history:[]}}var Qf=Xf();function $f(e){return z.subscribe(()=>{Qf=Xf(),e()})}function ep(){return Qf}async function tp(e,t,n,r){let i=e.current.dataSource;if(!i)return;let a=r===`undo`?{create:`delete`,update:`update`,delete:`create`}[t.type]:t.type;a===`delete`?await i.delete(t.objectName,t.recordId):a===`update`?await i.update(t.objectName,t.recordId,n):await i.create(t.objectName,n)}async function np(e){let t=z.popUndo();t&&(await tp(e,t,t.undoData,`undo`),e.current.onUndo?.(t))}async function rp(e){let t=z.popRedo();t&&(await tp(e,t,t.redoData,`redo`),e.current.onRedo?.(t))}var ip=new Set;function ap(e){let t=e;if(!t||typeof t.tagName!=`string`)return!1;if(t.isContentEditable)return!0;let n=t.tagName.toUpperCase();return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`}function op(e){if(!(e.ctrlKey||e.metaKey)||e.key.toLowerCase()!==`z`||ap(e.target))return;let t=ip.values().next().value;t&&(e.preventDefault(),e.shiftKey?rp(t):np(t))}function sp(e){return ip.add(e),ip.size===1&&window.addEventListener(`keydown`,op),()=>{ip.delete(e),ip.size===0&&window.removeEventListener(`keydown`,op)}}function cp(e={}){let t=(0,D.useRef)(e);(0,D.useInsertionEffect)(()=>{t.current=e});let n=(0,D.useSyncExternalStore)($f,ep,Zf),r=(0,D.useCallback)(()=>np(t),[]),i=(0,D.useCallback)(()=>rp(t),[]);return(0,D.useEffect)(()=>sp(t),[]),(0,D.useMemo)(()=>({...n,undo:r,redo:i}),[n,r,i])}function lp(e={}){let{actions:t=[],context:n={}}=e,r=(0,D.useContext)(Bd)?.runner??null,i=Y().current_user,a=i===void 0?``:JSON.stringify(i),o=ht(i),s=(0,D.useMemo)(()=>{let e=i===void 0?{}:{current_user:i},a=n&&Object.keys(n).length>0?{...n,ctx:n.ctx&&typeof n.ctx==`object`?{...n,...n.ctx}:{...n},...e}:{...n,...e},o=r?new wa(r):new wa(a);if(r&&n&&Object.keys(n).length>0){let t=o.getRunner(),r=t.getEvaluator().getContext().toObject(),i=r&&typeof r.ctx==`object`?r.ctx:{},a=n.ctx&&typeof n.ctx==`object`?n.ctx:n,s={...n,ctx:{...i,...a},...e};t.updateContext(s)}else r&&i!==void 0&&o.getRunner().updateContext(e);return o.registerActions(t),o},[r,JSON.stringify(t),JSON.stringify(n),a,o]);return{getActionsForLocation:(0,D.useCallback)(e=>s.getActionsForLocation(e),[s]),getBulkActions:(0,D.useCallback)(()=>s.getBulkActions(),[s]),executeAction:(0,D.useCallback)((e,t)=>s.executeAction(e,t),[s]),handleShortcut:(0,D.useCallback)(e=>s.handleShortcut(e),[s]),engine:s}}function up(){let{actionLabel:e,actionConfirm:t,actionSuccess:n}=de(),{language:r}=me();return(0,D.useMemo)(()=>((i,a,o)=>{if(!a||typeof a!=`object`)return a;let s=fe(a.label,r),c=typeof a.name==`string`&&a.name?a.name:void 0,l=s||c||o?.fallbackLabel||``;if(!c)return l===a.label?a:{...a,label:l};let u={...a,label:e(i,c,l)};return a.confirmText!==void 0&&(u.confirmText=t(i,c,a.confirmText)),a.successMessage!==void 0&&(u.successMessage=n(i,c,a.successMessage)),u}),[e,t,n,r])}function dp(){let e=(0,D.useContext)(Bd),t=Y(),n=e?.runner?.getContext?.()?.user;if(Array.isArray(n?.systemPermissions))return n.systemPermissions;let r=t?.user;if(Array.isArray(r?.systemPermissions))return r.systemPermissions}function fp(){let e=dp();return(0,D.useCallback)(t=>!Array.isArray(t)||t.length===0||!Array.isArray(e)||t.every(t=>typeof t==`string`&&e.includes(t)),[e])}function pp(){let e=Y(),t=Yl()?.data,{variables:n}=$l();return r=>md(r,e,t,n)}function mp(e,t,n,r){let i=(0,D.useContext)(Z)?.apiFetch,a=r?.enabled??!0,[o,s]=(0,D.useState)(null),c=(n??[]).filter(Boolean),l=[a?`1`:`0`,e??``,c.join(`,`),JSON.stringify(t??null)].join(`|`);return(0,D.useEffect)(()=>{if(!a||!e||c.length===0){s(null);return}let n=e=>t&&t[e]||e,r=!1;return(async()=>{try{let t=i??fetch,a=await qs(async e=>{let n=await(await t(`/api/v1/meta/object/${encodeURIComponent(e)}`,{headers:{accept:`application/json`},credentials:`include`})).json().catch(()=>null);return n?.item??n?.data??n},e,c.map(n));r||s({metaByPath:a,relabel:c.map(e=>({dim:e,path:n(e)}))})}catch{r||s(null)}})(),()=>{r=!0}},[l,i]),o}function hp(e,t,n,r){let{fieldOptionLabel:i}=pe(),a=mp(e,t,n,r);return(0,D.useMemo)(()=>Ks(a?.metaByPath,a?.relabel,i),[a,i])}function gp(e,t){return!0}function _p(e,t={}){let n=pf(),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null);(0,D.useEffect)(()=>{let e=!1;if(!n.ensureType){i(!0);return}return n.ensureType(`page`).then(()=>{e||(i(!0),o(null))}).catch(t=>{e||(o(t instanceof Error?t:Error(String(t))),i(!0))}),()=>{e=!0}},[n]);let s=(0,D.useMemo)(()=>{if(!e&&!t.pageName)return null;let r=Array.isArray(n.pages)?n.pages:[];if(!r.length)return null;if(t.pageName)return r.find(e=>e?.name===t.pageName)??null;let i=r.filter(n=>!n||n.type!==`record`||n.object!==e?!1:gp(n,t));return i.length?i[0]:null},[n.pages,e,t.pageName,t.recordType,t.profile,t.app,t.formFactor]),{page:c,slots:l}=(0,D.useMemo)(()=>s?s.kind===`slotted`?{page:null,slots:s.slots??{}}:{page:s,slots:null}:{page:null,slots:null},[s]);return{page:c,slots:l,loading:n.loading||!r,error:a??n.error??null}}function vp(e,t,n){if(!e)return 0;let r=e.toLowerCase(),i=(t||``).toLowerCase();return(n||``).toLowerCase()===r?110:i===r?100:i.startsWith(r)?80:i.split(/[\s_\-/.,:;()[\]]+/).filter(Boolean).some(e=>e.startsWith(r))?60:i.includes(r)?40:0}function yp(e){let{query:t,objects:n,dataSource:r,objectNames:i,maxObjectsQueried:a=8,topPerObject:o=3,minLength:s=2,debounceMs:c=250,enabled:l=!0,getDisplayName:u=Rr,fieldReadPolicy:d}=e,f=d?.isLoaded===!0,[p,m]=(0,D.useState)([]),[h,g]=(0,D.useState)(!1),[_,v]=(0,D.useState)(void 0),y=(0,D.useMemo)(()=>{if(!Array.isArray(n)||n.length===0)return[];let e;if(Array.isArray(i)&&i.length>0){let t=new Map;for(let e of n){let n=e?.name;typeof n==`string`&&t.set(n,e)}e=i.map(e=>t.get(e)).filter(e=>e!=null)}else e=n.filter(e=>e?.searchable!==!1);return e},[n,i]),b=(0,D.useMemo)(()=>y.map(e=>String(e?.name)).join(`|`),[y]),x=(0,D.useRef)(0),S=(0,D.useRef)(u),C=(0,D.useRef)(d);return(0,D.useEffect)(()=>{S.current=u,C.current=d}),(0,D.useEffect)(()=>{if(!l||!r||y.length===0){m([]),g(!1),v(void 0);return}let e=(t??``).trim();if(e.length<s){m([]),g(!1),v(void 0);return}let n=++x.current;g(!0),v(void 0);let i=setTimeout(()=>{if(x.current!==n)return;let t=r.searchAll;if(typeof t==`function`){let i=new Map;for(let e of y)typeof e?.name==`string`&&i.set(e.name,e);Promise.resolve().then(()=>t.call(r,e,{limit:a*o,objects:Array.from(i.keys())})).then(t=>{if(x.current!==n)return;let r=Array.isArray(t?.hits)?t.hits:Array.isArray(t)?t:[],a=[];for(let t of r){let n=t?.object??t?.objectName;if(typeof n!=`string`||i.size>0&&!i.has(n))continue;let r=t?.id??t?.record?.id??t?.record?._id;if(r==null)continue;let o=i.get(n)??{name:n},s=(typeof t?.title==`string`&&t.title.trim()!==``?t.title.trim():``)||S.current(o,Jc(t?.record??{},C.current,n))||`Record #${r}`,c=typeof t?.snippet==`string`?t.snippet.trim():``;a.push({objectName:n,objectLabel:typeof o.label==`string`&&o.label.length>0?o.label:n,recordId:String(r),display:s,subtitle:c&&c!==s?c:void 0,icon:o?.icon,score:vp(e,s,String(r)),raw:t?.record??t})}a.sort((e,t)=>+(t.score===110)-(e.score===110)),m(a),g(!1),v(void 0)}).catch(e=>{x.current===n&&(m([]),g(!1),v(e instanceof Error?e:Error(String(e))))});return}let i=y.slice(0,a).map(t=>Promise.resolve().then(()=>r.find(t.name,{$search:e,$top:o})).then(e=>({obj:t,res:e,err:null})).catch(e=>({obj:t,res:null,err:e})));Promise.allSettled(i).then(t=>{if(x.current!==n)return;let r=[],i;for(let n of t){if(n.status!==`fulfilled`)continue;let{obj:t,res:a,err:s}=n.value;if(s){let e=s?.httpStatus??s?.status;if(s?.code,e===404||ir(s,`OBJECT_NOT_FOUND`))continue;i=s instanceof Error?s:Error(String(s));continue}let c=Array.isArray(a?.data)?a.data:Array.isArray(a)?a:[];for(let n of c.slice(0,o)){let i=n?.id??n?._id;if(i==null)continue;let a=S.current(t,Jc(n,C.current,t.name));r.push({objectName:t.name,objectLabel:typeof t.label==`string`&&t.label.length>0?t.label:t.name,recordId:String(i),display:a,icon:t?.icon,score:vp(e,a,String(i)),raw:n})}}r.sort((e,t)=>t.score-e.score),m(r),g(!1),v(i)})},c);return()=>{clearTimeout(i)}},[t,l,r,b,o,a,s,c,f]),{results:p,isSearching:h,error:_}}function bp(e,t){if(Object.is(e,t))return!0;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function xp(e,t){let[n,r]=(0,D.useState)(null);(0,D.useEffect)(()=>{let n=!0,i=e,a=e=>{r(t=>t&&t.key===i&&bp(t.def,e)?t:{key:i,def:e})};return(async()=>{if(!t||!i||typeof t.getObjectSchema!=`function`){n&&a(null);return}try{let e=await t.getObjectSchema(i);n&&a(e)}catch(e){console.error(`[useSettledSchema] getObjectSchema failed for`,i,e),n&&a(null)}})(),()=>{n=!1}},[e,t]);let i=n!==null&&n.key===e;return{ready:i,def:i?n.def:null}}var Sp=new Set,Cp=`objectui:related-changed`;function wp(e){for(let t of Array.from(Sp))try{t(e)}catch{}typeof window<`u`&&window.dispatchEvent(new CustomEvent(Cp,{detail:{objectName:e.objectName,recordId:e.recordId}}))}function Tp(e){return Sp.add(e),()=>Sp.delete(e)}function Ep(e,t,n){return e.objectName===`*`?!0:e.objectName===t?n===void 0||e.recordId===void 0||e.recordId===n:!1}function Dp(e,t){let[n,r]=(0,D.useState)(0);return(0,D.useEffect)(()=>{if(e)return Tp(n=>{Ep(n,e,t)&&r(e=>e+1)})},[e,t]),n}function Op(e){(0,D.useEffect)(()=>{let t=e;if(t?.onMutation)return t.onMutation(e=>{e?.resource&&wp({objectName:e.resource,recordId:e.id==null?void 0:String(e.id)})})},[e])}function kp(e){return typeof e==`number`&&Number.isInteger(e)&&e>0}var Ap=(e,t,n,r,i)=>{if(e==null||kp(e))return null;let a=typeof r==`string`&&r?r:`component`;return`[ObjectUI] ElementDataSourceGate row cap: ${typeof i==`string`&&i?`${a} on ${i}`:a} declared ${t}: ${String(e)}, which is not a positive integer. A row cap must be a positive integer (the spec refuses zero and negative values), so it was ignored and the cap from this component's bound data source (${n}) was used instead.`},jp=(e,t,n)=>!t||kp(n)?null:Ke(e,t.view,t.object,t),Mp=(e,t)=>t?Ke(e,t.view,t.object,t,`binding`):null,Np=(e,t)=>t===`pagination.pageSize`?e.pagination?.pageSize:e[t],Pp=(e,t,n,r)=>{if(n===`pagination.pageSize`){e.pagination={...t.pagination??{},pageSize:r};return}e[n]=r};function Fp(e,t={},n){let r=Nf(e,Re(n)?void 0:n),{object:i=`objectName`,columns:a,filter:o,sort:s,limit:c,viewType:l}=t,{schema:u,capMessage:d,viewCapMessage:f,bindingCapMessage:p,filterRefusal:m}=D.useMemo(()=>{let t=r.composed;if(!t)return{schema:e,capMessage:null,viewCapMessage:null,bindingCapMessage:null};let n=e??{},u={...n},d=null,f=null,p=null;if(i!==!1&&(u[i]=t.object),a&&!(Array.isArray(n.columns)&&n.columns.length>0)&&t.columns!==void 0&&(u.columns=t.columns),o){let r=Pe(n.filter);if(!r.ok)return{schema:e,capMessage:null,viewCapMessage:null,bindingCapMessage:null,filterRefusal:r.refusal};let i=Pe(t.filter);if(!i.ok)return{schema:e,capMessage:null,viewCapMessage:null,bindingCapMessage:null,filterRefusal:i.refusal};let a=Fe(r.node,i.node);a===void 0?delete u.filter:u.filter=a}if(s&&t.sort!==void 0&&(r.config?.sort!==void 0||n.sort===void 0)&&(u.sort=t.sort),c&&t.limit!==void 0){let e=!kp(r.config?.limit),i=Np(n,c);(!e||!kp(i))&&(Pp(u,n,c,t.limit),d=Ap(i,c,t.limit,n.type,t.object))}return c&&(f=jp(r.view,r.config,Np(n,c)),p=Mp(r.view,r.config)),l&&t.viewType!==void 0&&n.viewType===void 0&&(u.viewType=t.viewType),{schema:u,capMessage:d,viewCapMessage:f,bindingCapMessage:p}},[e,r.composed,r.config,r.view,i,a,o,s,c,l]);D.useEffect(()=>{d&&console.warn(d)},[d]),D.useEffect(()=>{f&&console.warn(f)},[f]),D.useEffect(()=>{p&&console.warn(p)},[p]);let h=r.filterRefusal??m;return D.useMemo(()=>h?{status:`missing`,schema:u,config:r.config,error:h.message,filterRefusal:h}:{status:r.status,schema:u,config:r.config,error:r.error},[r.status,r.config,r.error,u,h])}function Ip({testId:e,title:t=`This component’s data source could not be resolved`,message:n}){return(0,X.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,"data-testid":`${e}-datasource-error`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:t}),n?(0,X.jsx)(`p`,{className:`text-sm mt-1`,children:n}):null]})}function Lp({testId:e,refusal:t}){let{t:n}=me();return(0,X.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 p-3 my-2 text-sm text-amber-800`,"data-testid":`${e}-malformed-filter`,children:[(0,X.jsx)(`p`,{className:`font-medium`,"data-testid":`${e}-malformed-filter-subject`,children:n(`view.malformedFilter`,{subject:_e(t)??``,defaultValue:`This view’s filter is malformed, so no records are shown: the {{subject}} condition cannot be applied.`})}),(0,X.jsx)(`p`,{className:`mt-1 text-xs opacity-80`,children:t.message})]})}function Rp({testId:e}){return(0,X.jsx)(`div`,{className:`p-2 text-sm text-muted-foreground animate-pulse`,role:`status`,"aria-live":`polite`,"data-testid":`${e}-resolving-view`,children:`Loading view…`})}function zp(e){let t=D.useContext(Z);return(Re(e)?void 0:e)??t?.dataSource??void 0}function Bp(e,t){return`“${e}” has no data source, so it cannot read ${typeof t==`string`&&t.trim().length>0?`“${t}”`:`its object`}. Inject one from an ancestor — <SchemaRendererProvider dataSource={…}> from @object-ui/react — or hand this block a dataSource of its own.`}function Vp({testId:e,title:t=`No data source resolved`,message:n}){return(0,X.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,"data-testid":`${e}-no-data-source`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:t}),n?(0,X.jsx)(`p`,{className:`text-sm mt-1`,children:n}):null]})}function Hp({schema:e,mapping:t,dataSource:n,testId:r,errorTitle:i,requiresDataSource:a,noDataSourceMessage:o,children:s}){let c=Fp(e,t,n),l=zp(n);return a&&l==null?(0,X.jsx)(Vp,{testId:r,message:o}):c.filterRefusal?(0,X.jsx)(Lp,{testId:r,refusal:c.filterRefusal}):c.status===`missing`?(0,X.jsx)(Ip,{testId:r,title:i,message:c.error}):c.status===`loading`?(0,X.jsx)(Rp,{testId:r}):s(c.schema)}function Up(e,t){if(!e||typeof e!=`object`)return{};let n={},r=_(e.ariaLabel,t);return r&&(n[`aria-label`]=r),typeof e.ariaDescribedBy==`string`&&e.ariaDescribedBy&&(n[`aria-describedby`]=e.ariaDescribedBy),typeof e.role==`string`&&e.role&&(n.role=e.role),n}function Wp(...e){for(let t of e)if(typeof t==`string`&&t.trim())return t;return null}function Gp(e){let t=e,n=t&&typeof t==`object`?Wp(t.details?.error,t.details?.message,t.error):null;if(!n){let r=e instanceof Error?e.message:typeof e==`string`?e:typeof t?.message==`string`?t.message:``,i=r.indexOf(`{`);if(i>=0)try{let e=JSON.parse(r.slice(i));n=Wp(e?.error,e?.message)}catch{}!n&&r.trim()&&(n=r)}return n&&n.replace(/^\[[^\]]+\]\s*/,``).replace(/^[A-Z][A-Z0-9_]+:\s*/,``).trim()||null}function Kp(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.userMessage==`string`&&t.userMessage.trim())return t.userMessage;let n=t.details;return n&&typeof n==`object`&&typeof n.userMessage==`string`&&n.userMessage.trim()?n.userMessage:null}function qp(e){let t=e;if(!t||typeof t!=`object`)return null;let n=Array.isArray(t.validationErrors)&&t.validationErrors||Array.isArray(t.details?.fields)&&t.details.fields||Array.isArray(t.fields)&&t.fields||null;if(!n||!Array.isArray(n))return null;let r=[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=e,n=Wp(t.field,t.name,t.path);if(!n)continue;let i=Wp(t.message,t.error,t.code)??``;r.push({field:n,message:i})}return r.length>0?r:null}function Jp(e){let t=e;if(!t||typeof t!=`object`)return!1;if((t.httpStatus??t.status??t.statusCode)===403)return!0;let n=Wp(t.code,t.details?.code)??``;if(n===`PERMISSION_DENIED`||n===`FORBIDDEN`)return!0;let r=`${typeof t.message==`string`?t.message:``} ${t.details?.error??t.error??``}`;return/row-level security|access denied|permission denied|not permitted/i.test(r)}var Yp=new Set([`INVALID_FILTER`,`UNSUPPORTED_QUERY_PARAM`,`INVALID_QUERY`]);function Xp(e){let t=e,n=[t?.httpStatus,t?.status,t?.statusCode].find(e=>typeof e==`number`);if(n===void 0){let e=/HTTP (\d{3})\b/.exec(String(t?.message??``));e&&(n=Number(e[1]))}let r=typeof t?.code==`string`?t.code.toUpperCase():``;return he(e)?`api-disabled`:n===403||r===`PERMISSION_DENIED`||r===`FORBIDDEN`?`forbidden`:n===401||r===`UNAUTHORIZED`||r===`UNAUTHENTICATED`?`unauthorized`:n===400||Yp.has(r)?`rejected`:`network`}function Zp({result:e}){let{t}=me();if(!e.truncated)return null;let n=e.rows.length,r=typeof e.total==`number`?t(`common.rowCeilingNote`,{shown:n,total:e.total,defaultValue:ue.common.rowCeilingNote}):t(`common.rowCeilingNoteUnknownTotal`,{shown:n,defaultValue:ue.common.rowCeilingNoteUnknownTotal});return(0,X.jsx)(`p`,{role:`note`,"data-row-ceiling-note":`non-grid`,className:`shrink-0 px-1 py-1 text-xs text-muted-foreground`,children:r})}var Qp=[{key:`indexed`,retiredBy:`objectui#4644`,specEquivalent:null,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`referenceTo`,retiredBy:`objectui#6041`,specEquivalent:`reference`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`formula`,retiredBy:`objectui#6043`,specEquivalent:`expression`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!1,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`isSystem`,retiredBy:`objectui#6044`,specEquivalent:`system`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`sortOrder`,retiredBy:`objectui#6045`,specEquivalent:null,defensive:!0,sites:{metadataAdminFieldsReadDoor:!1,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!1}}];function $p(e){return Qp.filter(t=>t.sites[e]).map(e=>e.key)}export{ef as $,E as $i,so as $n,Yn as $r,Yc as $t,zf as A,$t as Ai,Ps as An,Kr as Ar,zl as At,yf as B,j as Bi,fs as Bn,br as Br,wl as Bt,mp as C,_n as Ci,Is as Cn,si as Cr,Vl as Ct,lp as D,mn as Di,Es as Dn,ti as Dr,Ul as Dt,up as E,hn as Ei,Fs as En,F as Er,Yl as Et,kf as F,qt as Fi,bs as Fn,Dr as Fr,Y as Ft,uf as G,ft as Gi,zo as Gn,fr as Gr,dl as Gt,gf as H,k as Hi,ss as Hn,dr as Hr,ul as Ht,Tf as I,Gt as Ii,vs as In,Rr as Ir,Il as It,mf as J,st as Ji,Lo as Jn,nr as Jr,ol as Jt,lf as K,lt as Ki,Io as Kn,ir as Kr,cl as Kt,Ef as L,Bt as Li,_s as Ln,Fr as Lr,Al as Lt,Nf as M,Zt as Mi,zs as Mn,zr as Mr,Ml as Mt,Af as N,Yt as Ni,Ns as Nn,Nr,Fl as Nt,cp as O,fn as Oi,Ks as On,ni as Or,Z as Ot,Of as P,Jt as Pi,ys as Pn,Mr as Pr,Nl as Pt,nf as Q,Ie as Qi,co as Qn,Xn as Qr,Xc as Qt,Sf as R,Ht as Ri,gs as Rn,N as Rr,kl as Rt,hp as S,gn as Si,Js as Sn,ci as Sr,$l as St,fp as T,pn as Ti,Ms as Tn,P as Tr,Hl as Tt,_f as U,Et as Ui,Uo as Un,lr as Ur,bl as Ut,bf as V,A as Vi,cs as Vn,cr as Vr,ll as Vt,cf as W,mt as Wi,Wo as Wn,pr as Wr,Cl as Wt,sf as X,et as Xi,jo as Xn,Zn as Xr,sl as Xt,of as Y,O as Yi,Mo as Yn,rr as Yr,$c as Yt,Qd as Z,Re as Zi,po as Zn,tr as Zr,Zc as Zt,Dp as _,On as _i,ic as _n,ji as _r,Vu as _t,qp as a,Vn as ai,Cc as an,Ea as ar,Hd as at,yp as b,bn as bi,Zs as bn,L as br,Ql as bt,Up as c,Bn as ci,bc as cn,_a as cr,zd as ct,Rp as d,Fn as di,mc as dn,ia as dr,jd as dt,De as ea,Gn as ei,Jc as en,Fa as er,$d as et,Bp as f,Mn as fi,dc as fn,Hi as fr,Td as ft,Tp as g,Tn as gi,sc as gn,Ai as gr,Sd as gt,wp as h,jn as hi,ac as hn,Vi as hr,vd as ht,Kp as i,Pe as ia,Un as ii,Dc as in,Oa as ir,Vd as it,Pf as j,Qt as ji,qs as jn,Br as jr,Rl as jt,Yf as k,rn as ki,Gs as kn,qr as kr,Ll as kt,Ip as l,In as li,hc as ln,ya as lr,Id as lt,Ep as m,kn as mi,lc as mn,zi as mr,Cd as mt,Zp as n,Fe as na,qn as ni,jc as nn,Ma as nr,tf as nt,Gp as o,Wn as oi,Sc as on,Da as or,Ud as ot,zp as p,An as pi,fc as pn,Bi as pr,Ed as pt,pf as q,ut as qi,Ro as qn,ar as qr,Qc as qt,Xp as r,Ne as ra,Hn as ri,Ac as rn,ka as rr,Bd as rt,Jp as s,zn as si,xc as sn,Ta as sr,Rd as st,$p as t,_e as ta,Kn as ti,qc as tn,Ia as tr,rf as tt,Hp as u,Rn as ui,pc as un,aa as ur,Nd as ut,Op as v,Dn as vi,rc as vn,Fi as vr,Q as vt,pp as w,yn as wi,Ls as wn,ai as wr,Jl as wt,_p as x,xn as xi,Ys as xn,oi as xr,tu as xt,xp as y,En as yi,Xs as yn,Si as yr,nu as yt,Cf as z,Ut as zi,ps as zn,Pr as zr,El as zt};
|