@objectstack/console 17.5.0 → 17.7.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.
Files changed (282) hide show
  1. package/CHANGELOG.md +806 -0
  2. package/dist/.objectstack-injection.json +2 -2
  3. package/dist/.objectui-sha +1 -1
  4. package/dist/assets/{ActionResultDialog-CLdIyOW6.js → ActionResultDialog-ChYnuROr.js} +3 -3
  5. package/dist/assets/{AiPendingActionsPage-OKYz66yR.js → AiPendingActionsPage-Dh3-i4BB.js} +1 -1
  6. package/dist/assets/{ApiConsolePage-CcrKovu8.js → ApiConsolePage-CKYEqlMs.js} +1 -1
  7. package/dist/assets/AppDocsIndex-B5Tky2xg.js +1 -0
  8. package/dist/assets/{AppManagementPage-D_xz8cTZ.js → AppManagementPage-ZwyvnHpM.js} +1 -1
  9. package/dist/assets/ApprovalsInboxPage-DD4fe0Em.js +1 -0
  10. package/dist/assets/{AuditLogPage-CoghqsZb.js → AuditLogPage-Sed6iMqP.js} +1 -1
  11. package/dist/assets/BookPage-DYjUsQIc.js +1 -0
  12. package/dist/assets/{ComponentNavView-BxsixSU9.js → ComponentNavView-DrlxM4SY.js} +1 -1
  13. package/dist/assets/CreateViewDialog-Cp72x_O7.js +1 -0
  14. package/dist/assets/DashboardView-juicRxcP.js +1 -0
  15. package/dist/assets/DocPage-CxJaQ-pC.js +1 -0
  16. package/dist/assets/{DocsIndex-B2zw_HAp.js → DocsIndex-LALVtIVR.js} +1 -1
  17. package/dist/assets/{DocsLayout-DezZ8x7_.js → DocsLayout-BAwlJQQf.js} +1 -1
  18. package/dist/assets/DocsSlug-CkF1E-Zs.js +1 -0
  19. package/dist/assets/ExpressionProvider-Dr0e99r1.js +1 -0
  20. package/dist/assets/FlowRunsPage-R3W3t2s4.js +1 -0
  21. package/dist/assets/{IntegrationsPage-2leVkVDH.js → IntegrationsPage-DIuFLEbF.js} +2 -2
  22. package/dist/assets/InterfaceListPage-BfoCldGu.js +1 -0
  23. package/dist/assets/{MarketplaceInstalledPage-EPPHSitW.js → MarketplaceInstalledPage-DyjhcUNB.js} +1 -1
  24. package/dist/assets/MarketplacePackagePage-BbO27Pgs.js +4 -0
  25. package/dist/assets/{MarketplacePage-BnQKykgv.js → MarketplacePage-DO2_b64U.js} +1 -1
  26. package/dist/assets/{MetadataInspector-BWxLkr0O.js → MetadataInspector-BQyu9pOE.js} +1 -1
  27. package/dist/assets/ObjectDataPage-DIY-yefK.js +1 -0
  28. package/dist/assets/PageView-C-qWu3Jw.js +1 -0
  29. package/dist/assets/ProfilePage-Qp8DL8CF.js +1 -0
  30. package/dist/assets/{PublicFormsPage-DlE6tck_.js → PublicFormsPage-D3AT2EH9.js} +1 -1
  31. package/dist/assets/RecordDetailView-B3XBEgk2.js +3 -0
  32. package/dist/assets/RecordFormPage-CcoZfUJ3.js +1 -0
  33. package/dist/assets/ReportDefaultInspector-DVcWM6sh.js +1 -0
  34. package/dist/assets/ReportView-pJCFptzp.js +2 -0
  35. package/dist/assets/RuntimeDraftBar-DObTyFu2.js +1 -0
  36. package/dist/assets/SchemaForm-BWSWYMLE.js +3 -0
  37. package/dist/assets/SearchResultsPage-ChVIzFob.js +1 -0
  38. package/dist/assets/{SettingsHub-BGKIj-Zq.js → SettingsHub-CPP9FDe8.js} +1 -1
  39. package/dist/assets/SettingsView-CrHAROu9.js +1 -0
  40. package/dist/assets/{SkeletonDetail-C8fMI-Mu.js → SkeletonDetail-CP-35B8x.js} +1 -1
  41. package/dist/assets/{af-BfSmLD34.js → af-Bhbso4Pg.js} +1 -1
  42. package/dist/assets/ai-BAPiCsNk.js +3 -0
  43. package/dist/assets/app-shell-eager-leaves-D9tgfJOe.js +1 -0
  44. package/dist/assets/{ar-B9ttrM75.js → ar-DG8TAFtm.js} +1 -1
  45. package/dist/assets/{ar-DZ-C1rn-cyl.js → ar-DZ-BtSien-d.js} +1 -1
  46. package/dist/assets/{ar-EG-BaDxKP_o.js → ar-EG-DpXC0zoY.js} +1 -1
  47. package/dist/assets/{ar-MA-DbxNEcmd.js → ar-MA-D1qVJLyE.js} +1 -1
  48. package/dist/assets/{ar-SA-DeC5LXcX.js → ar-SA-BIYKNgv8.js} +1 -1
  49. package/dist/assets/{ar-TN-C9KpTFJz.js → ar-TN-mUR5Mq3s.js} +1 -1
  50. package/dist/assets/{az-cMerDwRO.js → az-B7IqwHGK.js} +1 -1
  51. package/dist/assets/{be-ZTSbszQh.js → be-CnZyPaSX.js} +1 -1
  52. package/dist/assets/{be-tarask-BXZEUrgX.js → be-tarask--uMMCC7l.js} +1 -1
  53. package/dist/assets/{bg-BDogpmn5.js → bg-CZwuirtY.js} +1 -1
  54. package/dist/assets/{bn-Cz04uxmh.js → bn-BbOX0r-z.js} +1 -1
  55. package/dist/assets/{bs-CpFnCl-j.js → bs-B5W75cYR.js} +1 -1
  56. package/dist/assets/{ca-CHC4M52Z.js → ca-Be69LdIM.js} +1 -1
  57. package/dist/assets/{ckb-Dxw-RNm8.js → ckb-B-nKM1Vn.js} +1 -1
  58. package/dist/assets/contracts-DieHW666.js +1 -0
  59. package/dist/assets/{createDerive-DvA_JGNq.js → createDerive-CynsXU-B.js} +1 -1
  60. package/dist/assets/{cs-DsFaJ5Z7.js → cs-qHngxH7l.js} +1 -1
  61. package/dist/assets/{cy-FH4JFDTs.js → cy-DscO2Pgf.js} +1 -1
  62. package/dist/assets/{da-D1pVjaAq.js → da-vibkaLMF.js} +1 -1
  63. package/dist/assets/data-adapter-BDsrq0TX.js +2 -0
  64. package/dist/assets/{de-AT-DUMQCisj.js → de-AT--JneEuBw.js} +1 -1
  65. package/dist/assets/{de-DKrxSvnP.js → de-BCT78XYW.js} +1 -1
  66. package/dist/assets/default-inspector-registry-Dktr6x_q.js +1 -0
  67. package/dist/assets/dist-yh3dYtHt.js +14 -0
  68. package/dist/assets/drillUrlFilters-N0RngQg6.js +1 -0
  69. package/dist/assets/{el-l3-bHySV.js → el-Cl0y9T2b.js} +1 -1
  70. package/dist/assets/en-AU-By42tTB7.js +1 -0
  71. package/dist/assets/{en-CA-DGH5NF0a.js → en-CA-BqEEoj-Y.js} +1 -1
  72. package/dist/assets/en-GB-Cx8B9nkB.js +1 -0
  73. package/dist/assets/en-IE-CX9nv6uO.js +1 -0
  74. package/dist/assets/en-IN-ByGSBHa4.js +1 -0
  75. package/dist/assets/en-NZ-BPMwa2ZN.js +1 -0
  76. package/dist/assets/en-ZA-lj_N4R6c.js +1 -0
  77. package/dist/assets/{eo-CL6CXHZx.js → eo-oOXROuhF.js} +1 -1
  78. package/dist/assets/{es-BIJ0rksI.js → es-EudscwjH.js} +1 -1
  79. package/dist/assets/{et-BGgMzjm1.js → et-CB-5LLh6.js} +1 -1
  80. package/dist/assets/{eu-CqvAoRrX.js → eu-B4-hcseX.js} +1 -1
  81. package/dist/assets/{fa-IR-DNz3oA1-.js → fa-IR-CogavcMJ.js} +1 -1
  82. package/dist/assets/{fi-DNSfKWuW.js → fi-CIBE0mYa.js} +1 -1
  83. package/dist/assets/{formatLong-CHb9WA3O.js → formatLong-qqgm7lV1.js} +1 -1
  84. package/dist/assets/{fr-CA-CotiswPx.js → fr-CA-BugXMutW.js} +1 -1
  85. package/dist/assets/{fr-DYRJCirJ.js → fr-CDReXYWW.js} +1 -1
  86. package/dist/assets/{fr-CH-CpiEYWpc.js → fr-CH-fiTiB6X1.js} +1 -1
  87. package/dist/assets/framework-CAuH4h0L.js +35 -0
  88. package/dist/assets/{fy-B69yM3FE.js → fy-t_GzIAg_.js} +1 -1
  89. package/dist/assets/{gd-BAy8AsX6.js → gd-CSncIxtN.js} +1 -1
  90. package/dist/assets/{getIcon-BEVyC4y3.js → getIcon-BDkBRQFw.js} +1 -1
  91. package/dist/assets/{gl-soLn_weL.js → gl-_138Mj2S.js} +1 -1
  92. package/dist/assets/{gu-B19Yo9yC.js → gu-COfH-YUT.js} +1 -1
  93. package/dist/assets/{he-DYTPo33p.js → he-BXL4lOKY.js} +1 -1
  94. package/dist/assets/{hi-D2dIK7Oy.js → hi-kXuYI0TJ.js} +1 -1
  95. package/dist/assets/{highlighted-body-OFNGDK62-CExufvVt.js → highlighted-body-OFNGDK62-CK7x7Gzm.js} +1 -1
  96. package/dist/assets/{hr-BV-VOPMu.js → hr-DAOsQWzI.js} +1 -1
  97. package/dist/assets/{ht-C7MM4qkS.js → ht-Ch8SKz8p.js} +1 -1
  98. package/dist/assets/{hu-Rha1m2Ym.js → hu-q6W_rWPT.js} +1 -1
  99. package/dist/assets/{hy-CiTNgbdV.js → hy-0M8OmwnM.js} +1 -1
  100. package/dist/assets/i18n-DTfZonAM.js +17 -0
  101. package/dist/assets/i18n-locale-ar-O6rs-Cir.js +4 -0
  102. package/dist/assets/i18n-locale-de-CMc1jk4a.js +4 -0
  103. package/dist/assets/i18n-locale-en-CbRQO81h.js +4 -0
  104. package/dist/assets/i18n-locale-es-t47nyoCX.js +4 -0
  105. package/dist/assets/i18n-locale-fr-E425EqJM.js +4 -0
  106. package/dist/assets/i18n-locale-ja-y_fk77fz.js +4 -0
  107. package/dist/assets/i18n-locale-ko-CdnY2uCg.js +4 -0
  108. package/dist/assets/i18n-locale-pt-BaUOXS6y.js +4 -0
  109. package/dist/assets/i18n-locale-ru-pFlhX9wg.js +4 -0
  110. package/dist/assets/i18n-locale-zh-Dkj4ROTN.js +4 -0
  111. package/dist/assets/i18n-runtime-CdWyaiOD.js +1 -0
  112. package/dist/assets/{id-Cijsfjt-.js → id-BM_H1_jv.js} +1 -1
  113. package/dist/assets/index-ocmkyCt6.js +19 -0
  114. package/dist/assets/index-v2Ijn9Gr.css +2 -0
  115. package/dist/assets/{infrastructure-BHSync5f.js → infrastructure-CSnL6ntj.js} +2 -2
  116. package/dist/assets/integration-7NqwVHuJ.js +1 -0
  117. package/dist/assets/{is-xS1WTyeC.js → is-B_7jXZfS.js} +1 -1
  118. package/dist/assets/isSameWeek-D90tBsli.js +1 -0
  119. package/dist/assets/{it-C2i_c9sd.js → it-CBM0J9cD.js} +1 -1
  120. package/dist/assets/{it-CH-l516ZNXj.js → it-CH-BQltCNsR.js} +1 -1
  121. package/dist/assets/{ja-D9_ewLny.js → ja-DBjnsx21.js} +1 -1
  122. package/dist/assets/{ja-Hira-D_6ExgHw.js → ja-Hira-BZfSmj1i.js} +1 -1
  123. package/dist/assets/{ka-BYHGyees.js → ka-HwpuKgUY.js} +1 -1
  124. package/dist/assets/{kk-CbTFtuqb.js → kk-DLKA9paj.js} +1 -1
  125. package/dist/assets/{km-Dr2gwhIn.js → km-BU5kermq.js} +1 -1
  126. package/dist/assets/{kn-CprH8JD7.js → kn-BNFqbCoi.js} +1 -1
  127. package/dist/assets/{ko-CsFS2u5i.js → ko-D8n4uMqQ.js} +1 -1
  128. package/dist/assets/{lb-CbFKN7Ob.js → lb-B1empQ7m.js} +1 -1
  129. package/dist/assets/{lt-Bq0xkLp0.js → lt-gMukpK3G.js} +1 -1
  130. package/dist/assets/{lv-Cj6vg6Qo.js → lv-D2O5AnsZ.js} +1 -1
  131. package/dist/assets/{match-CiPp9BME.js → match-BTF6WqJh.js} +1 -1
  132. package/dist/assets/{match-C_jFGO9e.js → match-Cyum2eeW.js} +1 -1
  133. package/dist/assets/{match-Co4ivumx.js → match-ScHH8kYk.js} +1 -1
  134. package/dist/assets/mermaid-GHXKKRXX-D4H6EVJQ.js +1 -0
  135. package/dist/assets/metadata-admin-CEhVmXFv.js +9 -0
  136. package/dist/assets/{mk-MXFM99YL.js → mk-D-Zl0xVN.js} +1 -1
  137. package/dist/assets/{mn-D5Q9B6Jt.js → mn-jJbTslgD.js} +1 -1
  138. package/dist/assets/{ms-CCzPRldx.js → ms-CUuJHLA4.js} +1 -1
  139. package/dist/assets/{mt-mjJpN6xW.js → mt-yIcbfxKY.js} +1 -1
  140. package/dist/assets/{nb-BIlNqdEb.js → nb-D9WNypoj.js} +1 -1
  141. package/dist/assets/{nl-BE-FwXjQsmV.js → nl-BE-B1vKiw2h.js} +1 -1
  142. package/dist/assets/{nl-D2uBtIxG.js → nl-DC7b5e90.js} +1 -1
  143. package/dist/assets/{nn-B0loJ7SV.js → nn-uP4yJ9s0.js} +1 -1
  144. package/dist/assets/{oc-U7-yH1sO.js → oc-DHTqadJI.js} +1 -1
  145. package/dist/assets/{pl-mTy0JYgi.js → pl-Bxnnizf5.js} +1 -1
  146. package/dist/assets/plugin-calendar-b7C35ANT.js +1 -0
  147. package/dist/assets/plugin-charts-b-yVtmdI.js +7 -0
  148. package/dist/assets/plugin-chatbot-D1KW_oIO.js +122 -0
  149. package/dist/assets/plugin-dashboard-DTkPoPEb.js +6 -0
  150. package/dist/assets/plugin-form-UIRm-FpQ.js +1 -0
  151. package/dist/assets/plugin-gantt-9dtc8zzX.js +63 -0
  152. package/dist/assets/plugin-grid-Cp4RKtMJ.js +10 -0
  153. package/dist/assets/plugin-kanban-B2JOPZIJ.js +1 -0
  154. package/dist/assets/plugin-map-CBJcVJYk.js +1 -0
  155. package/dist/assets/{plugin-markdown-D1nTQc1T.js → plugin-markdown-CNlDzqP-.js} +1 -1
  156. package/dist/assets/plugin-report-IZzgQb-Q.js +59 -0
  157. package/dist/assets/plugin-timeline-DsmtjcJ3.js +1 -0
  158. package/dist/assets/plugin-tree-DTRPBdhe.js +1 -0
  159. package/dist/assets/plugin-view-D9ixsNDG.js +1 -0
  160. package/dist/assets/plugins-views-CnvkdSJK.js +3 -0
  161. package/dist/assets/{pt-BR-2KtO5Js1.js → pt-BR-D416seHT.js} +1 -1
  162. package/dist/assets/{pt-Bet5OOQf.js → pt-DwHBy9_c.js} +1 -1
  163. package/dist/assets/{ro-37U6sgzi.js → ro-DDf1X3Np.js} +1 -1
  164. package/dist/assets/{ru-CyuAY-5E.js → ru-8eM3mcgK.js} +1 -1
  165. package/dist/assets/{runtime-metadata-persistence-afAW-MeD.js → runtime-metadata-persistence-DX29lQ62.js} +1 -1
  166. package/dist/assets/{se-DeJabuC6.js → se-D4JvQeRX.js} +1 -1
  167. package/dist/assets/{sk-DWEpjfkR.js → sk-DvpgttGI.js} +1 -1
  168. package/dist/assets/{sl-4oSvNhIR.js → sl-B3gCZ-_a.js} +1 -1
  169. package/dist/assets/{sq-BjkBCaXW.js → sq-CVaTmL0V.js} +1 -1
  170. package/dist/assets/{sr-Dxm1DsRS.js → sr-CnH5Ffyz.js} +1 -1
  171. package/dist/assets/{sr-Latn-Dawg6oP2.js → sr-Latn-Dw9w61q6.js} +1 -1
  172. package/dist/assets/src-BUry7633.js +2 -0
  173. package/dist/assets/{src-C8NYjdVm.js → src-DMDT5a27.js} +1 -1
  174. package/dist/assets/src-ZxH3AOCu.js +16 -0
  175. package/dist/assets/{studioEntry-nXQP3iL0.js → studioEntry-DAqcBFtr.js} +1 -1
  176. package/dist/assets/{submitRedirect-jK-cEIbP.js → submitRedirect-iy0oOi7I.js} +1 -1
  177. package/dist/assets/{sv-CROOGJGz.js → sv-CU7wdxyK.js} +1 -1
  178. package/dist/assets/{ta-BZnTmFI_.js → ta-DPH6q0HR.js} +1 -1
  179. package/dist/assets/{te-BN0v0x5t.js → te-BSaThkGV.js} +1 -1
  180. package/dist/assets/{th-CBjKhp_U.js → th-NXP8_Qb8.js} +1 -1
  181. package/dist/assets/{tr-x0Ne4N4H.js → tr-DDXoH663.js} +1 -1
  182. package/dist/assets/types-zod-ChJ30y25.js +1 -0
  183. package/dist/assets/{ug-sgzNhsKo.js → ug-Guus6pPe.js} +1 -1
  184. package/dist/assets/ui-components-D8wcRNrt.js +37 -0
  185. package/dist/assets/ui-layout-BYO3rRIl.js +1 -0
  186. package/dist/assets/{uk-o_DQ5VHJ.js → uk-uiy4vsp8.js} +1 -1
  187. package/dist/assets/use-book-data-DFTswcKm.js +1 -0
  188. package/dist/assets/{useActionModal-CSvbHkQ7.js → useActionModal-h52Z5Pkl.js} +1 -1
  189. package/dist/assets/useCanAuthorMetadata-TDrVrYGB.js +1 -0
  190. package/dist/assets/useDatasetCatalog-BOd0Ybr1.js +1 -0
  191. package/dist/assets/useNavSelDeepLink-67Y4qCNO.js +1 -0
  192. package/dist/assets/useNavTargetLabel-D8lRdb6O.js +1 -0
  193. package/dist/assets/useOpenRecordList-C7oqUD3F.js +1 -0
  194. package/dist/assets/{usePackageL10n-CMx66am-.js → usePackageL10n-Jl2XiF2F.js} +1 -1
  195. package/dist/assets/{useSettingsLabel-Kkr2q0Oo.js → useSettingsLabel-CSpBDTdy.js} +1 -1
  196. package/dist/assets/{uz-Cyrl-DbtkQtz_.js → uz-Cyrl-Cmb5bvbf.js} +1 -1
  197. package/dist/assets/{uz-Be41d4jl.js → uz-DJWxoTz4.js} +1 -1
  198. package/dist/assets/vendor-objectstack-C4eD5dbT.js +139 -0
  199. package/dist/assets/{vi-84mZmklk.js → vi-Bb3QoIJC.js} +1 -1
  200. package/dist/assets/{zh-CN-DD1reegJ.js → zh-CN-C-Hts1ZR.js} +1 -1
  201. package/dist/assets/{zh-HK-B05u30WI.js → zh-HK-CtBAZ_ZS.js} +1 -1
  202. package/dist/assets/{zh-TW-Bb-WimPD.js → zh-TW-B7DDahD-.js} +1 -1
  203. package/dist/chunk-membership.json +116 -104
  204. package/dist/eager-closure.json +126 -120
  205. package/dist/index.html +4 -4
  206. package/dist/sdui.manifest.json +998 -115
  207. package/package.json +1 -1
  208. package/dist/assets/AppDocsIndex-F4zDq2zz.js +0 -1
  209. package/dist/assets/ApprovalsInboxPage-DrEUmaDb.js +0 -1
  210. package/dist/assets/CreateViewDialog-xyKlpLEW.js +0 -1
  211. package/dist/assets/DashboardView-CGC-_Om8.js +0 -1
  212. package/dist/assets/DocPage-CIZE5kdj.js +0 -1
  213. package/dist/assets/DocsSlug-DXdFdwlS.js +0 -1
  214. package/dist/assets/ExpressionProvider-DZfMwyMs.js +0 -1
  215. package/dist/assets/FlowRunsPage-CvY3nJMF.js +0 -1
  216. package/dist/assets/InterfaceListPage-BdECC_i3.js +0 -1
  217. package/dist/assets/MarketplacePackagePage-C7NOu2Ir.js +0 -4
  218. package/dist/assets/ObjectDataPage-BIzp65Mo.js +0 -1
  219. package/dist/assets/PageView-CVLgCRSF.js +0 -1
  220. package/dist/assets/ProfilePage-D2qGgxPK.js +0 -1
  221. package/dist/assets/RecordDetailView-DQKydU7X.js +0 -3
  222. package/dist/assets/RecordFormPage-BTjwxJIA.js +0 -1
  223. package/dist/assets/ReportDefaultInspector-DdsQAkd7.js +0 -1
  224. package/dist/assets/ReportView-GIdKJdOt.js +0 -2
  225. package/dist/assets/RuntimeDraftBar-BbMdi3Kp.js +0 -1
  226. package/dist/assets/SchemaForm-C8X1ve4p.js +0 -3
  227. package/dist/assets/SearchResultsPage-Jwhqsdyo.js +0 -1
  228. package/dist/assets/SettingsView-D8SMKdrc.js +0 -1
  229. package/dist/assets/app-shell-eager-leaves-CDVclng4.js +0 -1
  230. package/dist/assets/appRoute-DbnWDEa1.js +0 -1
  231. package/dist/assets/data-adapter-DMbe6Njk.js +0 -1
  232. package/dist/assets/default-inspector-registry-CpL3fFhl.js +0 -1
  233. package/dist/assets/dist-BXrEV1ag.js +0 -13
  234. package/dist/assets/drillUrlFilters-hi-2d3DW.js +0 -1
  235. package/dist/assets/en-AU-C6x7mDhH.js +0 -1
  236. package/dist/assets/en-GB-0-nho2eK.js +0 -1
  237. package/dist/assets/en-IE-2fC3BkfV.js +0 -1
  238. package/dist/assets/en-IN-C1QcFhxn.js +0 -1
  239. package/dist/assets/en-NZ-C80ptZT7.js +0 -1
  240. package/dist/assets/en-ZA-ByZDrjeb.js +0 -1
  241. package/dist/assets/framework-DcWkeiND.js +0 -35
  242. package/dist/assets/i18n-CEKxYdmD.js +0 -9
  243. package/dist/assets/i18n-locale-ar-DN7sl3GF.js +0 -4
  244. package/dist/assets/i18n-locale-de-C40JErvb.js +0 -4
  245. package/dist/assets/i18n-locale-en-CITPDIHy.js +0 -4
  246. package/dist/assets/i18n-locale-es-C8DdWN6c.js +0 -4
  247. package/dist/assets/i18n-locale-fr-COIdEZZl.js +0 -4
  248. package/dist/assets/i18n-locale-ja-DYF_rU_s.js +0 -4
  249. package/dist/assets/i18n-locale-ko-B-ODYAtX.js +0 -4
  250. package/dist/assets/i18n-locale-pt-CK1SyBIm.js +0 -4
  251. package/dist/assets/i18n-locale-ru-jLzvShMO.js +0 -4
  252. package/dist/assets/i18n-locale-zh-Bf9Gbbvl.js +0 -4
  253. package/dist/assets/i18n-runtime-CTgAQF4N.js +0 -1
  254. package/dist/assets/index-CLyvpiGc.css +0 -2
  255. package/dist/assets/index-CfnfGw5W.js +0 -20
  256. package/dist/assets/isSameWeek-DWYeNyh8.js +0 -1
  257. package/dist/assets/mermaid-GHXKKRXX-DVLc_uym.js +0 -1
  258. package/dist/assets/metadata-admin-CybaOCdO.js +0 -9
  259. package/dist/assets/nav-selection-Dzm_mA3C.js +0 -1
  260. package/dist/assets/plugin-calendar-CKRBcML7.js +0 -1
  261. package/dist/assets/plugin-charts-DGTJxXCB.js +0 -7
  262. package/dist/assets/plugin-chatbot-DwtwNA-y.js +0 -122
  263. package/dist/assets/plugin-dashboard-C1AYKmGX.js +0 -6
  264. package/dist/assets/plugin-form-CV8ZY04-.js +0 -1
  265. package/dist/assets/plugin-gantt-BRIb2_8G.js +0 -63
  266. package/dist/assets/plugin-grid-C9h7mRVv.js +0 -11
  267. package/dist/assets/plugin-kanban-BcJ0Dhys.js +0 -1
  268. package/dist/assets/plugin-map-D24ZUOUj.js +0 -1
  269. package/dist/assets/plugin-report-BfGintAq.js +0 -59
  270. package/dist/assets/plugin-timeline-CbBRq_qt.js +0 -1
  271. package/dist/assets/plugin-tree-BNX2A5J5.js +0 -1
  272. package/dist/assets/plugin-view-DzWQWYyH.js +0 -1
  273. package/dist/assets/plugins-views-DraK4xz0.js +0 -3
  274. package/dist/assets/src-B8lv0plz.js +0 -18
  275. package/dist/assets/src-DoDvT77T.js +0 -1
  276. package/dist/assets/types-zod-Y2RwUUeJ.js +0 -1
  277. package/dist/assets/ui-components-BTB1NkUW.js +0 -37
  278. package/dist/assets/ui-layout-bZfafwJa.js +0 -1
  279. package/dist/assets/use-book-data-C3eyZJSG.js +0 -1
  280. package/dist/assets/useOpenRecordList-B5-qaFUx.js +0 -1
  281. package/dist/assets/vendor-objectstack-XuWC71M9.js +0 -266
  282. 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{$t as i,Ai as a,Bn as o,Bt as s,Cn as c,Fn as l,Ft as u,Ii as d,Mi as f,Mn as p,Nn as m,On as h,Pn as g,Qn as _,Ri as v,Tn as y,Ut as b,Wt as x,Yt as S,Zi as C,br as w,cn as ee,in as te,jt as ne,ki as re,pt as ie,qi as ae,qn as oe,st as se,ta as ce,ut as le,xn as T,yr as ue}from"./vendor-objectstack-C4eD5dbT.js";import{t as de}from"./i18n-locale-en-CbRQO81h.js";import{f as fe,o as pe,p as me,w as E}from"./i18n-runtime-CdWyaiOD.js";import{n as he}from"./data-adapter-BDsrq0TX.js";T();function ge(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}T();var D=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 D(`[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 D(`[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 D(`[ObjectUI] The ${_(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 D(`[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[i,a]of Object.entries(e)){if(a==null){r+=1;continue}let e=be[i];if(e){let r=xe(i,e,a);r===void 0?n+=1:t.push(r);continue}if(i===`$not`)throw new D(`[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(a)}.`,{operator:`$not`});if(Array.isArray(a))throw new D(`[ObjectUI] The filter on field '${i}' carries a bare ARRAY as its equality comparand: ${JSON.stringify(a)}. It cannot be lowered: the ObjectQL filter AST has no array-equality node, so the lowered node [${i}, '=', [...]] 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: { ${i}: [...] } and { ${i}: { $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 { ${i}: { $in: [...] } }, its negation as { ${i}: { $nin: [...] } }, or a range as { ${i}: { $between: [min, max] } }.`,{field:i});if(typeof a==`object`&&!Array.isArray(a)){if(c(a)){t.push([i,`=`,a]);continue}if(!Ce(a))throw new D(`[ObjectUI] The filter on field '${i}' carries ${we(a)} in comparand position. '@objectstack/spec' does not accept it: a comparison value must be ${ne} (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 '${i}' condition was dropped from the filter entirely, silently WIDENING the result set. Spell a text match as { ${i}: { $contains: '...' } } ($startsWith / $endsWith; a pattern itself has no operator here, see the $regex refusal), a membership test as { ${i}: { $in: [...] } }, and a date bound as { ${i}: { $gte: new Date(...) } }.`,{field:i});let e=Object.entries(a);e.length===0&&Ee(i);for(let[n,r]of e){if(n===`$regex`)throw new D(`[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: '${i}', Value: ${JSON.stringify(r)}. Use $contains for a case-sensitive substring, $icontains for a case-insensitive one, or $startsWith / $endsWith.`,{operator:`$regex`,field:i});if(n===`$null`){t.push([i,r?`is_null`:`is_not_null`,!0]);continue}if(n===`$exists`){t.push([i,r?`is_not_null`:`is_null`,!0]);continue}if(n===`$empty`){if(r!==!0&&r!==!1)throw new D(`[ObjectUI] The '$empty' filter operator on field '${i}' takes a boolean flag (true or false); received ${JSON.stringify(r)??String(r)}. Write { ${i}: { $empty: true } } for an empty value, or { ${i}: { $empty: false } } for a non-empty one.`,{operator:`$empty`,field:i});t.push([i,r?`is_empty`:`is_not_empty`,!0]);continue}let e=ye(n);if(e)e===`icontains`&&g(r)&&Te(i,n,r),t.push([i,e,r]);else{let e=ve[n];throw e?new D(`[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: '${i}', 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:i}):new D(`[ObjectUI] Unknown filter operator '${n}' for field '${i}'. Supported operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $between, $contains, $notContains, $startsWith, $endsWith, $icontains, $null, $exists, $empty. If you need exact object matching, use the value directly without an operator.`,{operator:n,field:i})}}}else t.push([i,`=`,a])}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([...re,...f]),Ae=new Set([`is_empty`,`is_not_empty`,`is_null`,`is_not_null`]),je=new Set(a);function Me(e){let t=C(e.operator);if(Array.isArray(e.value)&&typeof t==`string`&&je.has(t)&&!ke.has(t)&&!Ae.has(t))throw new D(`[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&&g(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 D(`[ObjectUI] The ${_(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 D)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 O=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)}},k=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 l(e)||ct(e)}function ut(e,t){return t?lt(e?.field?.defaultValue):!1}function dt(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)=>dt(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 ft(e){return/^[a-z][a-z0-9]*(_[a-z0-9]+)*$/.test(e)}function pt(e){return{name:e.name,label:e.title,description:e.description,icon:e.icon,branding:e.branding,navigation:e.navigation}}function mt(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 ht(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 gt(e){if(!e||typeof e!=`object`)return e;let t=e.defaultValue;return ht(t)?{...e,defaultValue:t.preset}:e}function _t(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=gt(e);return t!==e&&(n=!0),t});return n?{...e,globalFilters:r}:e}function vt(e){return{x:e%4*3,y:Math.floor(e/4)*4,w:3,h:4}}function yt(e,t,n){return{x:t.x??e?.x??n.x,y:t.y??e?.y??n.y,w:t.w??e?.w??n.w,h:t.h??e?.h??n.h}}var A=e=>Object.freeze({path:e}),bt=e=>Object.freeze({path:e,retired:!0}),j=(e,t)=>Object.freeze({types:Object.freeze([...e]),slots:Object.freeze([...t])}),M=[A(`trigger`),A(`content`)],xt=Object.freeze([j([`alert-dialog`,`ui:alert-dialog`],M),j([`context-menu`,`ui:context-menu`],[A(`trigger`)]),j([`dialog`,`ui:dialog`],[...M,A(`footer`)]),j([`drawer`,`ui:drawer`],M),j([`dropdown-menu`,`ui:dropdown-menu`],[A(`trigger`)]),j([`hover-card`,`ui:hover-card`],M),j([`popover`,`ui:popover`],M),j([`sheet`,`ui:sheet`],[...M,A(`footer`)]),j([`tooltip`,`ui:tooltip`],[A(`trigger`)]),j([`collapsible`,`ui:collapsible`],M),j([`card`,`ui:card`],[A(`header`),A(`footer`)]),j([`table`,`ui:table`],[A(`footer`)]),j([`data-table`,`ui:data-table`],[A(`emptyAction`)]),j([`empty`,`ui:empty`],[A(`action`)]),j([`header-bar`,`ui:header-bar`],[A(`actions`),A(`rightContent`)]),j([`tabs`,`ui:tabs`],[A(`items[].content`)]),j([`accordion`,`ui:accordion`],[A(`items[].content`)]),j([`list`,`ui:list`],[A(`items[].content`)]),j([`resizable`,`ui:resizable`],[A(`panels[].content`)]),j([`carousel`,`ui:carousel`],[A(`items[]`)]),j([`page`,`ui:page`,`app`,`ui:app`,`utility`,`ui:utility`,`home`,`ui:home`,`record`,`ui:record`],[A(`regions[].components`)]),j([`page:tabs`],[A(`items[].children`)]),j([`page:accordion`],[A(`items[].children`)]),j([`page:card`],[A(`footer`),bt(`body`)]),j([`page:section`],[bt(`body`)]),j([`page:footer`],[bt(`body`)]),j([`page:sidebar`],[bt(`body`)]),j([`detail`,`view:detail`,`detail-view`,`plugin-detail:detail-view`],[A(`header`),A(`footer`),A(`actions`),A(`tabs[].content`),A(`sections[].fields[].render`),A(`fields[].render`)]),j([`detail-section`,`plugin-detail:detail-section`],[A(`fields[].render`)]),j([`report-viewer`,`plugin-report:report-viewer`],[A(`report.sections[].content`)]),j([`plugin-timeline:timeline`],[A(`items[].content`)]),j([`view-switcher`,`view:view-switcher`],[A(`views[].schema`)]),j([`dashboard`,`plugin-dashboard:dashboard`],[A(`widgets[].component`)])]),St=Object.freeze([]),Ct=(()=>{let e=new Map;for(let t of xt)for(let n of t.types){if(e.has(n))throw Error(`NODE_SLOT_DECLARATIONS lists \`${n}\` twice`);e.set(n,t.slots)}return e})();function wt(e){return Ct.get(e)??St}var Tt=`[]`;function Et(e){return e.split(`.`).map(t=>{let n=t.endsWith(Tt),r=n?t.slice(0,-2):t;if(r.length===0)throw Error(`Malformed node-slot path \`${e}\``);return{key:r,each:n}})}var Dt=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Ot(e,t){let n=[{segments:[],value:e}];for(let{key:e,each:r}of Et(t)){let t=[];for(let i of n){if(!Dt(i.value))continue;let n=i.value[e];r?Array.isArray(n)&&n.forEach((n,r)=>{t.push({segments:[...i.segments,e,r],value:n})}):t.push({segments:[...i.segments,e],value:n})}n=t}let r=[];for(let e of n)Array.isArray(e.value)?e.value.forEach((t,n)=>{r.push({segments:[...e.segments,n],value:t})}):e.value!==void 0&&r.push(e);return r}var kt=[`text`,`number`,`date`,`datetime`,`currency`,`percent`,`boolean`,`action`],At={int:`number`,integer:`number`,float:`number`,double:`number`,"datetime-local":`datetime`};function jt(e){if(typeof e==`string`)return kt.includes(e)?e:At[e]}var Mt=[`metric-card`],Nt=[`list`,`custom`],Pt={min_rows:`minRows`,max_rows:`maxRows`,allow_add:`allowAdd`,allow_delete:`allowDelete`,allow_reorder:`allowReorder`,total_field:`totalField`,add_label:`addLabel`,sort_field:`sortField`},Ft=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(`.`)),It={createdAt:`created_at`,createdBy:`created_by`,updatedAt:`updated_at`,updatedBy:`updated_by`},Lt=new Set(Object.values(It));function Rt(e,t){return t?.system===!0||Ft.has(e)}var zt=[`default`,`blue`,`teal`,`orange`,`purple`,`success`,`warning`,`danger`],Bt=[`metric`,`bar`,`horizontal-bar`,`line`,`pie`,`donut`,`area`,`scatter`,`funnel`,`table`,`pivot`,`list`,`custom`],Vt=`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 Ht(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 Ut(e){let t=(e.values??[]).map(e=>({name:e,label:Ht(void 0,e)})),n=(e.rows??[]).map(e=>({field:e,sort:`asc`}));return{type:`report`,title:Ht(e.label,e.name),description:e.description?Ht(e.description,``):void 0,fields:t,groupBy:n.length>0?n:void 0}}function Wt(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 Gt(e,t){if(!t)return!0;let n=e?.locations;return Array.isArray(n)&&n.includes(t)}var Kt=`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 qt(e){return e===null?`null`:Array.isArray(e)?`an array`:`a ${typeof e}`}function Jt(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 ${qt(i)}, which is neither an action id (a string) nor an inline action object; ${Kt}`};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 Yt(e,t){let n=Jt(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 Xt=x.options,Zt=[`checkbox`,`reference`,`datetime-local`];function Qt(e,t){let n=e?.code;return typeof n!=`string`||n.length===0?!1:n.toUpperCase()===t.toUpperCase()}function $t(e,t){return t.some(t=>Qt(e,t))}var en=3e4,tn=new Set([408,425,429,502,503,504]),nn=class extends Error{status;retryAfterMs;constructor(e,t,n){super(n??`Endpoint returned ${e}`),this.status=e,this.retryAfterMs=t,this.name=`HttpFetchError`}};function rn(e){return e instanceof nn?tn.has(e.status):!0}function an(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,en)}function on(e,t,n){return n===void 0?Math.min(t*2**e,en):n}var sn=e=>new Promise(t=>setTimeout(t,e));function cn(e){return an(e.headers?.get?.(`Retry-After`),Date.now())}var ln=Symbol.for(`objectui.inflightGet`);function un(){let e=globalThis,t=e[ln];if(t)return t;let n=new Map;return e[ln]=n,n}function dn(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 fn(e,t){return`GET\n${t?.credentials??`same-origin`}\n${e}\n${dn(t?.headers)}`}function pn(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}var mn=(e,t)=>fetch(e,t);async function hn(e,t,n=mn){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 nn(r.status,cn(r));return await r.json()}let i=fn(e,t),a=un(),o=a.get(i);if(o)return pn(await o);let s=(async()=>{let r=await n(e,{...t,method:`GET`});if(!r.ok)throw new nn(r.status,cn(r));return await r.json()})();a.set(i,s);let c=()=>{a.get(i)===s&&a.delete(i)};return s.then(c,c),pn(await s)}function gn(e){return e==null||typeof e==`boolean`||typeof e==`string`?!1:typeof e!=`object`||typeof e.source!=`string`}var _n="[unevaluable] the gate is declared but has no `source` to evaluate (an `ast`-only envelope, a number, an object or an array) — it fails in the direction its key fails on any fault",vn=Object.freeze({dialect:`cel`});function yn(e){return e.includes("${")?e:`\${${e}}`}function bn(e){if(e!=null&&e!==``){if(typeof e==`boolean`)return e;if(typeof e==`string`)return yn(e);if(gn(e))return vn;if(typeof e==`object`&&typeof e.source==`string`){let t=e.source;return t?e.dialect===`cel`?{dialect:`cel`,source:t}:yn(t):void 0}}}var xn=Symbol.for(`@object-ui/core:subject-permissions`);function Sn(e,t){if(t===void 0){if(!Object.prototype.hasOwnProperty.call(e,xn))return e;let t={...e};return delete t[xn],t}return{...e,[xn]:t}}function Cn(e){if(typeof e==`object`&&e)return e[xn]}function wn(e){return typeof e==`string`?{dialect:`cel`,source:e}:{dialect:e.dialect??`cel`,source:e.source}}var Tn=new Set,En=`[blank] the predicate is declared but empty — nothing to evaluate`;function Dn(e,t,n,r){let i=e.source?.trim()?JSON.stringify([e.dialect,e.source]):JSON.stringify([e.dialect,e.source,r??``]);Tn.has(i)||(Tn.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 N(e,t,n,r,i,a){if(e==null)return n;let o=wn(e),s,c=n;if(Fn(e))s=En;else if(gn(e))s=_n;else try{let e=Cn(i?.current_user),n=se.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&&Dn(o,n,s,a?.context),a?.onFault?.(s),n)}var On=!0,kn=!1,An=!1,jn=!0,Mn=!1,Nn=!1;function Pn(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?jn:N(e.visibleWhen,t,On,r,i,s(`visibleWhen`)),readonly:n.readonly===!0||(e.readonlyWhen==null?Mn:N(e.readonlyWhen,t,kn,r,i,s(`readonlyWhen`))),required:n.serverOwnedValue===!0?!1:n.required===!0||(e.requiredWhen==null?Nn:N(e.requiredWhen,t,An,r,i,s(`requiredWhen`))),faults:o}}function Fn(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 P(e){return Fn(e)?(In(e),!1):bn(e)!==void 0}function In(e){N(e,{},!1,void 0,void 0,{context:`a declared gate, read as no gate`})}function Ln(e){return{required:!1,validate:e=>typeof e==`boolean`||!gn(e)&&P(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 Rn={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:Ln(`visible`),disabled:Ln(`disabled`)};function zn(e){return!!e&&typeof e==`object`}function Bn(e,t=`schema`){let n=[];return Object.entries(Rn).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 Vn=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 Hn(e,t=`schema`){let n=e.type;return typeof n!=`string`||!Object.prototype.hasOwnProperty.call(Vn,n)?[]:[{path:`${t}.type`,message:Vn[n],type:`error`,code:`RETIRED_TYPE`}]}var Un=`field:`;function Wn(e){let t=e.widget??e.type;return typeof t==`string`?t:void 0}function Gn(e,t){let n=Wn(e);if(n&&n.includes(`:`)&&!n.startsWith(Un))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 Kn(e,t=`schema`){let n=[];if(e.type===`form`){let r=e.fields;Array.isArray(r)&&r.forEach((e,i)=>{let a=zn(e)?e:{};a.name||n.push({path:`${t}.fields[${i}]`,message:`Form field requires name property`,type:`error`,code:`MISSING_FIELD_NAME`});let o=Gn(a,`${t}.fields[${i}]`);o&&n.push(o),r.filter(e=>(zn(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 qn(e,t){return t.reduce((e,t)=>typeof t==`number`?`${e}[${t}]`:`${e}.${t}`,e)}function Jn(e,t=`schema`){let n=[],r=e.children;if(r){if(Array.isArray(r))r.forEach((e,r)=>{if(zn(e)){let i=Yn(e,`${t}.children[${r}]`);n.push(...i.errors,...i.warnings)}});else if(zn(r)){let e=Yn(r,`${t}.children`);n.push(...e.errors,...e.warnings)}}if(typeof e.type==`string`)for(let r of wt(e.type))for(let{segments:i,value:a}of Ot(e,r.path)){if(!zn(a))continue;let e=Yn(a,qn(t,i));n.push(...e.errors,...e.warnings)}return n}function Yn(e,t=`schema`){let n=[];zn(e)?(n.push(...Bn(e,t)),n.push(...Hn(e,t)),n.push(...Kn(e,t)),n.push(...Jn(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 Xn=[`id`,`className`,`role`,`tabIndex`,`autoFocus`,`onClick`,`onBlur`,`onFocus`];function Zn(e){return e.startsWith(`data-`)||e.startsWith(`aria-`)}function Qn(e,t){let n=new Set(t),r={};for(let t of Object.keys(e))(n.has(t)||Zn(t))&&(r[t]=e[t]);return r}function $n(e){return Qn(e,Xn)}T();function er(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 tr(e){return er(e,!1).predicates}var nr={create:`create`,import:`import`,edit:`update`,delete:`delete`,exportCsv:`export`};function rr(e,t){let n=oe({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(nr))n[t]&&!e.has(r)&&(n[t]=!1)}return n}function ir(e,t){return rr(e,t).edit}function ar(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 or=2e3;function sr(){return{$top:2001}}function cr(e){let t=ar(e),n=e&&typeof e==`object`&&typeof e.total==`number`?e.total:void 0,r=t.length>or;return{rows:r?t.slice(0,or):t,total:n,truncated:r}}function lr(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var F=`field`,ur=[`name`,`fieldName`],dr=e=>!!e&&typeof e==`object`&&!Array.isArray(e),fr=e=>typeof e==`string`&&e.length>0?e:void 0;function pr(e){if(typeof e==`string`)return fr(e);if(!dr(e))return;let t=fr(e[F]);if(t)return t;for(let t of ur){let n=fr(e[t]);if(n)return n}}var mr=new Set,hr=()=>!1;function gr(e,t,n){if(hr()&&n.length!==0)for(let r of n){let n=`${t}:${r}:${String(e[r])}`;mr.has(n)||(mr.add(n),console.warn(`[ObjectUI] Column carries two identities: \`${F}: '${t}'\` and \`${r}: '${String(e[r])}'\`. \`${F}\` 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 \`${F}\` only. (objectui#3104)`))}}function _r(e){if(typeof e==`string`||!dr(e))return e;let t=pr(e);if(!t)return e;let n=e[F]!==t,r=ur.filter(n=>e[n]!==void 0&&e[n]!==t);if(!n&&r.length===0)return e;gr(e,t,r);let i={...e};i[F]=t;for(let e of r)i[e]=t;return i}function vr(e){if(!Array.isArray(e))return e;let t=!1,n=e.map(e=>{let n=_r(e);return n!==e&&(t=!0),n});return t?n:e}var yr=`label`,br=`header`;function xr(e){if(dr(e))return fr(e.header)??fr(e.label)}var Sr=new Set([`lookup`,`master_detail`,`tree`,`user`]);function Cr(e){return!!e&&typeof e==`object`&&Sr.has(e.type)}function wr(e,t){if(!e||typeof e!=`object`)return[];let n=[];for(let[t,r]of Object.entries(e))Cr(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=pr(n);t&&e.add(t)}return n.filter(t=>e.has(t))}return n}var Tr=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 Er(e){return typeof e!=`string`||!e?!1:Object.prototype.hasOwnProperty.call(Tr,e)}var Dr=new Set;function Or(e){let t=Er(e)?Tr[e]:void 0;return t?(Dr.has(e)||(Dr.add(e),console.error(t)),!0):!1}T();var kr=i;function Ar(e){return!!e&&typeof e==`object`&&kr.has(e.type)}var jr=Symbol.for(`objectui.objectSortability`);function Mr(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 Nr(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=Mr(r);t&&(n[e]=t)}return{fields:n}}function Pr(e,t){let n=Nr(t);return!n||!e||typeof e!=`object`||Object.defineProperty(e,jr,{value:n,enumerable:!1,configurable:!0,writable:!0}),e}function Fr(e){if(!e||typeof e!=`object`)return;let t=e[jr];if(!t||typeof t!=`object`)return;let n=t.fields;if(n&&typeof n==`object`&&!Array.isArray(n))return t}function Ir(e,t){if(typeof t!=`string`||t.length===0)return!1;let n=e.fields?.[t];return Mr(n)?.sortable===!0}function Lr(e,t){return Array.isArray(e)?e.filter(e=>Ir(t,e?.field)):[]}var Rr=`\0`,zr=`[-\\u2013\\u2014|/·,:]`,Br=[`name`,`title`,`subject`,`label`,`full_name`,`display_name`],Vr=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`]),Hr=new Set([`text`,`string`,`textarea`,`html`]);function Ur(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 Wr(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=ei(a);return o===void 0?Rr:(r=!0,o)});if(!r)return``;let a=RegExp(`\\s*${zr}\\s*${Rr}`,`g`),o=RegExp(`${Rr}\\s*${zr}\\s*`,`g`);return i=i.replace(a,``).replace(o,``).replace(new RegExp(Rr,`g`),``).replace(/\s+/g,` `).trim(),i}function Gr(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 Hr.has(t)}return!Vr.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 qr=new WeakMap;function Jr(e){let t=Kr(e?.fields).filter(([,e])=>Gr(e));if(t.length===0)return;for(let e of Br){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 Yr(e){if(typeof e!=`object`||!e)return Jr(e);if(qr.has(e))return qr.get(e);let t=Jr(e);return qr.set(e,t),t}function Xr(e){return e?.nameField??e?.displayNameField??e?.NAME_FIELD_KEY}function Zr(e){let t=Xr(e);return typeof t==`string`&&t.length>0?t:Yr(e)}function Qr(e,t){let n=Xr(e),r=typeof n==`string`&&n.length>0,i=r?n:Yr(e),a=i?e?.fields?.[i]:void 0;return!i||!a||a.hidden||!r&&Rt(i,a)?t:[i,...t.filter(e=>e!==i)]}var $r=[`name`,`full_name`,`fullName`,`display_name`,`displayName`,`title`,`subject`,`label`];function I(e,t){if(t&&e&&typeof e==`object`)return ei(e[t])}function ei(e){let t=e;if(t&&typeof t==`object`&&(t=Ur(t)),t==null)return;let n=typeof t==`string`?t.trim():String(t);return n===``?void 0:n}function ti(e,t,n){let r=I(t,n?.titleField);if(r)return r;let i=I(t,Xr(e));if(i)return i;if(e?.titleFormat){let n=Wr(e.titleFormat,t);if(n)return n}let a=I(t,Yr(e));if(a)return a;if(n?.deriveFromRecordKeys!==!1&&t&&typeof t==`object`){for(let e of $r){let n=I(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=I(t,e);if(n)return n}}}let o=t?.id??t?._id;return o!=null&&String(o).trim()!==``?`Record #${o}`:n?.fallback??`Untitled`}function ni(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=>ni(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=ti(void 0,t,{fallback:``});return i===``?null:i}return String(e)}function ri(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 ii=`[{ field: 'name', order: 'desc' }]`,ai=new Set;function oi(e,t){return`${e}\n${t}`}function si(e){let t=oi(`scalar`,e);ai.has(t)||(ai.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: ${ii} — 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 ci(e){let t=oi(`entry`,e);ai.has(t)||(ai.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: ${ii} — 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 li(e){if(e){if(typeof e==`string`){si(e);return}if(Array.isArray(e)){let t=[];for(let n of e){if(typeof n==`string`){let e=n;e!==``&&ci(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 ui(e){let t=li(e);if(!t)return;let n={};for(let e of t)n[e.field]=e.order;return n}var di=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}},fi={Math,JSON,parseInt,parseFloat,isNaN,isFinite},pi=new Set([`constructor`,`__proto__`,`prototype`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),mi=class e{source=``;pos=0;context={};_evaluating=!0;evaluate(e,t){this.source=e.trim(),this.pos=0,this.context={...fi,...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`&&pi.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}},hi=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 mi;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)}}},gi=/^\d{4}-\d{2}-\d{2}$/,_i=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function L(e){if(!gi.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 R(e){let t=e instanceof Date?e:new Date(e);if(typeof e==`string`&&_i.test(e)&&!L(e.slice(0,10)))return new Date(NaN);if(typeof e!=`string`||!gi.test(e)||isNaN(t.getTime()))return t;if(!L(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 vi(e){let t=R(e);return typeof e!=`string`||!L(e)?t:(t.setDate(t.getDate()+1),t.setHours(0,0,0,0),t)}function yi(e){let t=new Date(e.getTime()-1);return t.setHours(0,0,0,0),t}function bi(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 xi(e){return e===void 0||e.style===void 0?e:{...e,style:void 0}}function Si(e,t){if(e==null||e===``)return`—`;let n=R(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 Ci(n,void 0,xi(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 bi(o,t?.locale)}function Ci(e,t,n){if(e==null||e===``)return`—`;let r=R(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 Si(r,n);let a=r.getFullYear()===new Date().getFullYear();return r.toLocaleDateString(n?.locale,{year:a?void 0:`numeric`,month:`short`,day:`numeric`})}function wi(e,t){if(e==null||e===``)return null;let n=R(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 Ti(e,t){if(e==null||e===``)return`—`;let n=R(e);if(!(n instanceof Date)||isNaN(n.getTime()))return`—`;if(t?.style===`compact`){let e=wi(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 Ei(e,t){let n=new Date(t);if(isNaN(n.getTime()))throw Error(`${e}: Invalid date "${t}"`);return{date:n,day:typeof t==`string`&&L(t)}}function Di({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 Oi(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 ki(e,t,n){switch(n){case`day`:case`days`:e.setUTCDate(e.getUTCDate()+t);break;case`month`:case`months`:Oi(e,t);break;case`year`:case`years`:Oi(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 Ai=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)=>z(e).reduce((e,t)=>e+t,0)),this.register(`AVG`,(...e)=>{let t=z(e);return t.length===0?0:t.reduce((e,t)=>e+t,0)/t.length}),this.register(`COUNT`,(...e)=>ji(e).filter(e=>e!=null).length),this.register(`MIN`,(...e)=>{let t=z(e);return t.length===0?0:Math.min(...t)}),this.register(`MAX`,(...e)=>{let t=z(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}=Ei(`DATEADD`,e),a=String(n).toLowerCase();if(i){let e=ki(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=Ei(`DATEDIFF`,e),i=Ei(`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=Di(r),t=Di(i);return(t.year-e.year)*12+(t.month-e.month)}case`year`:case`years`:return Di(i).year-Di(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=Di(Ei(`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=z(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=z(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=z(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=z(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 z(e){let t=[];for(let n of e)if(Array.isArray(n))t.push(...z(n));else{let e=Number(n);isNaN(e)||t.push(e)}return t}function ji(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...ji(n)):t.push(n);return t}var Mi=new Set;function Ni(e,t,n,r){let i=r instanceof Error?r.message:String(r);if(e){e(i);return}let a=JSON.stringify([t,n]);Mi.has(a)||(Mi.add(a),console.warn(t===`template-part`?`Expression evaluation failed for: ${n}`:`Failed to evaluate expression: ${n}`,r))}var B=class e{context;cache;formulas;constructor(e,t,n){this.context=e instanceof di?e:new di(e||{}),this.cache=t||new hi,this.formulas=n||new Ai}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 Ni(a,`template-part`,t,n),e}})}catch(t){if(r)throw t;return Ni(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(gn(e))return this.answerUnevaluableGate(e,t);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),Fn(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(Fn(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 N(e,i,!0,void 0,n,t.onFault?{warn:!1,onFault:t.onFault}:void 0);let a=N(e,i,!0,void 0,n,{warn:!1});if(a!==N(e,i,!1,void 0,n,{warn:!1}))throw Error(`CEL predicate failed to evaluate: ${e}`);return a}answerBlankGate(e,t){return N(e,{},!0,void 0,void 0,t.onFault?{warn:!1,onFault:t.onFault}:{context:`a CEL gate predicate, read as no gate`}),!0}answerUnevaluableGate(e,t){if(t.throwOnError)throw Error(`Gate predicate cannot be evaluated: ${_n}`);return N(e,{},!0,void 0,void 0,t.onFault?{warn:!1,onFault:t.onFault}:{context:`a declared gate with nothing to evaluate`})}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 hi,new Ai;var Pi=`record`,Fi=`data`;function Ii(e,t,n){if(typeof e!=`string`||!e.trim())return null;let r=le(e);if(!r||r.ok!==!0)return null;let i=ie(e);return typeof i==`string`&&typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(t,i)?{kind:`bare-shorthand`,identifier:i,canonical:`${Pi}.${i}`}:n&&Array.isArray(r.roots)&&r.roots.includes(Fi)?{kind:`metadata-layer-root`,identifier:Fi,canonical:Pi}:null}function Li(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`&&Sr.has(r)&&t.add(e)}else for(let[n,r]of Object.entries(e)){let e=r?.type;Sr.has(e)&&t.add(n)}return t.size>0?t:null}function Ri(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 zi(e,t){if(!e||typeof e!=`object`)return e;let n=Li(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=>Ri(e)!==void 0))continue;i(t,n.map(e=>Ri(e)??e));continue}let r=Ri(n);r!==void 0&&i(t,r)}return r??e}var Bi=/\$\{|===|!==|\?\.|\?\?|\.(?:includes|indexOf|toUpperCase|toLowerCase|startsWith|endsWith|trim|split|map|filter|reduce|find|some|every|join|slice|charAt|padStart|padEnd|replace|match|test)\s*\(/;function Vi(e){return Bi.test(e)}var Hi=new Set;function Ui(e){Hi.has(e)||(Hi.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 Wi=new Set;function Gi(e,t,n){let r=JSON.stringify([t??``,e]);Wi.has(r)||(Wi.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=N(e,t,!0,void 0,n,i);return a===N(e,t,!1,void 0,n,i)?{ok:!0,value:a}:{ok:!1,value:!1,reason:r}}function qi(e,t,n={}){let r=n.fallback??!1;if(e==null)return r;let i=typeof e==`string`?e:void 0,a=n.rowless?{}:zi(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&&Vi(i)){Ui(i);try{return new B(o).evaluateCondition(i,{throwOnError:!0})}catch(e){return n.warnOnError&&Gi(i,n.label,`[legacy] ${e instanceof Error?e.message:String(e)}`),r}}if(!n.warnOnError)return N(e,a,r,void 0,o,{context:n.label});let c=Ki(e,a,o);return c.ok?c.value:(Gi(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=>qi(e,t,{...n,warnOnError:n.warnOnError??!0,fallback:!1}));return{eligible:r,skipped:t.length-r.length}}function V(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(V).join(`, `)}]`:JSON.stringify(String(e))}function Yi(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} == ${V(r)}`;case`not_equals`:return`${i} != ${V(r)}`;case`greater_than`:return`${i} > ${V(r)}`;case`less_than`:return`${i} < ${V(r)}`;case`contains`:return`${i}.contains(${V(r)})`;case`in`:return`${i} in ${V(Array.isArray(r)?r:[r])}`;default:return null}}function Xi(e){return e.condition==null?typeof e.expression==`string`&&e.expression.trim()?e.expression:Yi(e):e.condition}function Zi(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 Qi(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=Xi(a);if(o!=null&&qi(o,i,{fallback:!1,scope:n,fields:r,label:`conditionalFormatting[${e}]`}))return Zi(a)}return{}}function $i(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 ea(e,t){return $i(e).some(e=>lr(t[e]))}function ta(e,t,n){return!e||e.length===0?[]:e.filter(e=>e?.visibleWhen==null||N(e.visibleWhen,t,!0,void 0,n,{context:`visibleWhen of option '${String(e.value)}'`}))}function na(e){let{label:t}=e;return typeof t==`string`&&t.trim()!==``?t:String(e.value)}function ra(e,t){return lr(e)?!0:Array.isArray(e)?e.every(e=>t.some(t=>t.value===e)):t.some(t=>t.value===e)}function ia(e,t,n,r){let i=$i(n),a=i.length>0&&ea(n,t);return{options:a?[]:ta(e,t,r),gated:a,dependsOnFields:i}}var aa=new Set([`select`,`multiselect`,`radio`,`checkboxes`]);function oa(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 sa=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(oa)),Array.isArray(n.redoStack)&&(this.redoStack=n.redoStack.filter(oa)),this.undoStack.length>this.maxHistory&&this.undoStack.splice(0,this.undoStack.length-this.maxHistory),this.notify()}catch{}}notify(){this.listeners.forEach(e=>e())}},H=new sa,ca=`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.outcomeMessages.shortcut.bulkEnabled`.split(`.`),la=`_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.outcomeMessages.params.patch.recordIdField.recordIdParam.refreshAfter.requiredPermissions.requiresFeature.resultDialog.shortcut.successMessage.target.type.undoable.variant.visible`.split(`.`),ua=[`to`,`external`,`newTab`,`replace`],da=[`overrideNotice`],fa={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."},pa=new Set([...ca,...la,...ua,...da].filter(e=>!(e in fa)));function ma(e){let t=[],n=[];if(!e||typeof e!=`object`)return{unknown:t,retired:n};for(let r of Object.keys(e))r in fa?n.push(r):pa.has(r)||t.push(r);return{unknown:t,retired:n}}var ha=new Set,ga=()=>!1;function _a(e,t=`ActionRunner`){if(!ga())return;let{unknown:n,retired:r}=ma(e),i=e?.name??e?.type??`(unnamed)`;for(let e of r){let n=`retired:${String(i)}:${e}`;ha.has(n)||(ha.add(n),console.warn(`[${t}] action "${String(i)}" carries the retired key \`${e}\`. ${fa[e]}`))}if(n.length===0)return;let a=`unknown:${String(i)}:${n.slice().sort().join(`,`)}`;ha.has(a)||(ha.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 va=new Set([`recordId`]),ya=e=>!e.startsWith(`_`)&&!va.has(e);function ba(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(ya)}function xa(e,t=`ActionRunner`){if(!ga()||!ba(e))return;let n=e?.name??`(unnamed)`,r=`deprecated-object-params:${String(n)}`;ha.has(r)||(ha.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 Sa(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 Ca(e){return Ta(e)?e.data:e}var wa=new Set([`success`,`data`,`error`,`code`,`fields`]);function Ta(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.success==`boolean`&&Object.keys(e).every(e=>wa.has(e))}function Ea(e,t,n){let r=t?.data,i=Ta(r)&&r.success===!1;return!e.ok||t&&t.success===!1||i?{ok:!1,error:i?Sa(r,`${n} failed`):Sa(t,`${n} failed (HTTP ${e.status})`)}:{ok:!0,envelope:r,payload:Ca(r)}}var Da={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 Oa(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 ka=`recordId`,Aa=`recordObject`;function ja(e){let t=e.objectName;return typeof t==`string`&&t.trim()!==``?t.trim():void 0}function Ma(e,t){if(ja(e)!==t)return;let n=e.objectFields;return n&&typeof n==`object`?n:void 0}function Na(e,t){return!t||!e.includes(`.`)?!1:!e.startsWith(`${t}.`)}function Pa(e){return e.operation===`update`}function Fa(e,t,n){if(!e.every(e=>Ia(t,e)))return;let r=zi(t,n);return Object.fromEntries(e.map(e=>[e,r[e]]))}function Ia(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}var La=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=Oa(e),this.evaluator=new B(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{_a(e),xa(e);let t=e.type||e.actionType||e.name||``;if(P(e.condition)&&!this.evaluator.evaluateCondition(e.condition))return{success:!1,error:`Action condition not met`};if(P(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(Pa(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(Da.parallelFailed)};let n=t[t.length-1];return n.status===`fulfilled`?n.value:{success:!1,error:this.runnerText(Da.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}composeSuccessMessage(e,t){let n=Ca(t.data),r=n&&typeof n==`object`?n.outcome:void 0,i=e.outcomeMessages,a=typeof r==`string`&&i&&typeof i==`object`&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:void 0;for(let t of[a,e.successMessage])if(typeof t==`string`&&t.trim()!==``)return za(t,{result:n},e=>e);return this.runnerText(Da.completedSuccessfully)}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=this.composeSuccessMessage(e,t);if(t.undo)try{H.push(t.undo)}catch{}this.toastHandler(n,{type:`success`,duration:i,undo:t.undo?{label:this.runnerText(Da.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(Da.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=Ra(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,Ca(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||ja(this.context),s=n.recordId??i.id;if(t&&s!=null){let n=Fa(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=>!Ia(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=ja(this.context),a=n==null||Na(t,i)?r:`${r}?${ka}=${encodeURIComponent(String(n))}`+(i?`&${Aa}=${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()};return n!==void 0&&(r.result=n),za(e,r,encodeURIComponent)}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=Oa({...this.context,...e}),this.evaluator.updateContext(this.context)}getContext(){return this.context}getEvaluator(){return this.evaluator}};function Ra(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.navigate;return typeof t!=`string`||t===``?null:e}function za(e,t,n){if(typeof e!=`string`||e.indexOf("${")===-1)return e;let r=RegExp(`\\$\\{(${Object.keys(t).join(`|`)})\\.([\\w.]+)\\}`,`g`);return e.replace(r,(e,r,i)=>{let a=Ba(t[r],i);return a==null?``:n(String(a))})}function Ba(e,t){if(e!=null)return t.split(`.`).reduce((e,t)=>{if(e!=null)return e[t]},e)}function Va(e){return e.toLowerCase().split(`+`).map(e=>e.trim()).sort().join(`+`)}var Ha=new Set;function Ua(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(Ha.has(i))return;Ha.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 La?e:new La(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(Va(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(Va(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(!P(n))return!0;let r=bn(n);try{return t.evaluateCondition(r,{throwOnError:!0})}catch(t){return Ua(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(Va(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 Ga(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 Ka(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 qa(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(Ka(e))return{error:`This action runs on a single record — select a row first.`}}return{recordId:a??void 0}}function Ja(e){let{fetch:t,resolveObject:n,onRefresh:r}=e,i=e.resolveRecordId??qa,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=Ea(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 Ya(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 Xa=`sys_permission_set`;function Za(e){return e?.managed_by===`package`}var Qa=Object.freeze({confirmText(e,t){let{objectName:n,t:r}=e;return n===Xa&&Za(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===Xa)try{d=Za(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 $a(e){if(e!=null)return e.id??e._id??e.recordId}function eo(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=$a(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 to(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,eo(i.data??{},n));n.push(t);let a=$a(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,eo(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 no(e,t){return typeof e.batchTransaction==`function`?e.batchTransaction(t):to(e,t)}function ro(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 io(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 ao(e,t){return{...e,...t}}var oo=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=ro(e.url,t.pathSuffix,r),a=ao(ao(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=io(t),r=await this.request(this.readConfig,{method:`GET`,queryParams:n});return this.normalizeQueryResult(r)}async findOne(e,t,n){try{let e=io(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 to(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 so(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 co(e){return`filter rule refused as it is lowered: ${e.message.replace(/^\[ObjectUI\]\s*/,``).replace(/\.\s*$/,``)}`}var lo=new Set([`$in`,`$nin`,`$between`]),uo=new Set([`in`,`nin`,`between`]),fo=new Set([`is_null`,`is_not_null`,`is_empty`,`is_not_empty`]);function po(e){return h(e)}function mo(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 ho(e,t,n,r){return U(e,_(t,n,r))}var go=new Set([`$eq`,`$ne`,`$gt`,`$gte`,`$lt`,`$lte`]),_o=new Set([`=`,`!=`,`>`,`>=`,`<`,`<=`]),vo=Symbol(`ValueDataSource:refused-comparand`);function yo(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&`$field`in e}function bo(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`),vo):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`),vo):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`),vo):(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`),vo)}function xo(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 So(e,t,n){let r=t[0],i=t[1],a=i===`not in`?`nin`:ee(i),o=e[r],s=t[2];if(Array.isArray(s)&&!uo.has(a)&&!fo.has(a))return mo(n,r,String(i));if(Array.isArray(s)&&s.some(yo))return xo(n,r,String(i));let c=yo(s)?bo(e,s,a,String(i),r,_o,n):s;if(c===vo)return!1;switch(a){case`is_null`:return o==null;case`is_not_null`:return o!=null;case`is_empty`:return po(o);case`is_not_empty`:return!po(o);case`=`:return W(o,c);case`!=`:return!W(o,c);case`>`:return o>c;case`>=`:return o>=c;case`<`:return o<c;case`<=`:return o<=c;case`in`:return Array.isArray(c)&&c.some(e=>W(o,e));case`nin`:return Array.isArray(c)&&!c.some(e=>W(o,e));case`contains`:return typeof o==`string`&&o.includes(String(c));case`icontains`:return g(c)?ho(n,r,String(i),c):typeof o==`string`&&te(o,c);case`not_contains`:return!(typeof o==`string`&&o.includes(String(c)));case`starts_with`:return typeof o==`string`&&o.startsWith(String(c));case`ends_with`:return typeof o==`string`&&o.endsWith(String(c));case`between`:return Array.isArray(c)&&c.length===2&&o>=c[0]&&o<=c[1];default:return U(n,`filter operator '${String(i)}' is not implemented by the in-memory matcher`)}}function Co(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=>Co(e,t,n)):r.some(t=>Co(e,t,n))}}return Array.isArray(r)?t.every(t=>Co(e,t,n)):typeof r==`string`&&typeof t[1]==`string`&&t.length<=3?So(e,t,n):U(n,`filter node ${JSON.stringify(t)} is not a shape the matcher reads`)}function wo(e,t,n,r,i,a){if(Array.isArray(r)&&!lo.has(n))return mo(a,i,n);if(Array.isArray(r)&&r.some(yo))return xo(a,i,n);let o=yo(r)?bo(e,r,n,n,i,go,a):r;if(o===vo)return!1;switch(n){case`$eq`:return W(t,o);case`$ne`:return!W(t,o);case`$gt`:return t>o;case`$gte`:return t>=o;case`$lt`:return t<o;case`$lte`:return t<=o;case`$in`:return Array.isArray(o)&&o.some(e=>W(t,e));case`$nin`:return Array.isArray(o)&&!o.some(e=>W(t,e));case`$between`:return Array.isArray(o)&&o.length===2&&t>=o[0]&&t<=o[1];case`$contains`:return typeof t==`string`&&t.includes(String(o));case`$icontains`:return g(o)?ho(a,i,n,o):typeof t==`string`&&te(t,o);case`$notContains`:return!(typeof t==`string`&&t.includes(String(o)));case`$startsWith`:return typeof t==`string`&&t.startsWith(String(o));case`$endsWith`:return typeof t==`string`&&t.endsWith(String(o));case`$null`:return o?t==null:t!=null;case`$exists`:return o?t!=null:t==null;case`$empty`:return o===!0?po(t):o===!1?!po(t):U(a,`filter operator '$empty' on field '${i}' takes a boolean flag (true or false); received ${ge(o)}`);case`$field`:return U(a,`field '${i}' carries a bare { $field } object, which reads as an operator named '$field' rather than as a comparand. Write the explicit comparison { ${i}: { $eq: { $field: ${JSON.stringify(String(r))} } } }`);default:{let e=S[n];return e?U(a,`filter operator '${n}' on field '${i}' is retired. ${e.why}`):n.startsWith(`$`)?U(a,`filter operator '${n}' on field '${i}' is not implemented by the in-memory matcher`):U(a,`filter condition on field '${i}' carries the non-operator key '${n}'; the in-memory matcher does not descend into a nested relation constraint`)}}}function To(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=>Eo(e,t,r)):n.some(t=>Eo(e,t,r))}function Eo(e,t,n){for(let[r,i]of Object.entries(t)){if(r===`$and`||r===`$or`){if(!To(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)&&!c(i)){for(let[a,o]of Object.entries(i))if(!wo(e,t,a,o,r,n))return!1}else if(Array.isArray(i))return mo(n,r,`implicit equality`);else if(!W(t,i))return!1}return!0}function Do(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=Do(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 Oo(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 ko(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 Ao=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,co(r.refusal)),n=[];else if(Array.isArray(r.node)&&r.node.length>0){let t=r.node;n=n.filter(n=>Co(n,t,e))}}else if(Object.keys(t.$filter).length>0){let r=t.$filter,i=Do(r);i?(U(e,co(i)),n=[]):n=n.filter(t=>Eo(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=Oo(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=>ko(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(so(e,this.idField))===String(t));return r?n?.$select?.length?ko(r,n.$select):{...r}:null}async create(e,t){let n={...t};if(!so(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(so(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(so(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=so(i,this.idField);t!==void 0&&r.push(await this.update(e,t,i));break}case`delete`:{let t=so(i,this.idField);t!==void 0&&await this.delete(e,t);break}}return r}batchTransaction(e){return to(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 jo(e,t,n){if(!e)return t??null;switch(e.provider){case`object`:return t??null;case`api`:return new oo({read:e.read,write:e.write,fetch:n?.fetch,defaultHeaders:n?.defaultHeaders});case`value`:return new Ao({items:e.items??[],idField:n?.idField});default:return t??null}}var G=`https://objectui.dev/docs/errors`,Mo={"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`}},No=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 Po(e){return e instanceof No}var K=`__debug`;function Fo(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 Io(){try{if(typeof window<`u`)try{if(Fo(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 Lo(e,t,n){Io()&&(n===void 0?console.log(`[ObjectUI Debug][${e}] ${t}`):console.log(`[ObjectUI Debug][${e}] ${t}`,n))}var Ro=new Map;function zo(e){Io()&&Ro.set(e,performance.now())}function Bo(e){if(!Io())return;let t=Ro.get(e);if(t!==void 0){let n=(performance.now()-t).toFixed(2);console.log(`[ObjectUI Debug][perf] ${e}: ${n}ms`),Ro.delete(e)}}var Vo=200,Ho=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>Vo&&(this.entries=this.entries.slice(-200));for(let t of this.subscribers)try{t(e)}catch{}}},Uo={medium:991,small:640,xsmall:479},Wo=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Go=e=>Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,t])=>`${Wo(e)}: ${typeof t==`number`?String(t):t} !important;`).join(` `);function Ko(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!(t.large||t.medium||t.small||t.xsmall)}function qo(e){return`os-s-${String(e).replace(/[^a-zA-Z0-9_-]/g,`-`)}`}function Jo(e,t){let n=[];if(t.large){let r=Go(t.large);r&&n.push(`${e} { ${r} }`)}for(let r of[`medium`,`small`,`xsmall`]){let i=t[r];if(!i)continue;let a=Go(i);a&&n.push(`@media (max-width: ${Uo[r]}px) { ${e} { ${a} } }`)}return n.join(`
3
+ `)}var Yo={"react-pages":!0},Xo=new Map,Zo=!1;function Qo(){if(Zo)return;Zo=!0;let e=globalThis;if(Array.isArray(e.__OBJECTUI_CAPABILITIES__))for(let t of e.__OBJECTUI_CAPABILITIES__)typeof t==`string`&&!Xo.has(t)&&Xo.set(t,!0);if(Array.isArray(e.__OBJECTUI_CAPABILITIES_DISABLED__))for(let t of e.__OBJECTUI_CAPABILITIES_DISABLED__)typeof t==`string`&&Xo.set(t,!1)}function $o(e){Qo();let t=Xo.get(e);return t===void 0?Yo[e]??!1:t}var es=`react-pages`;T();var ts=/\$\{event\.([a-zA-Z0-9_]+)\}/g;function ns(e,t){return typeof e!=`string`||e.indexOf("${event.")===-1?e:e.replace(ts,(e,n)=>{let r=t[n];return r==null?``:String(r)})}function rs(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 ns(e,t)}if(Array.isArray(e))return e.map(e=>rs(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=rs(i,t);return n}return e}function is(e,t,n={}){if(e?.filter)return rs(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 as(e,t,n=`Details`){if(e?.title){let n=ns(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 os(e){return e?e.enabled!==!1:!1}function ss(e,t){let n=Fe(e,t);try{return o(n)}catch(e){throw e?.code===`INVALID_FILTER`?new D(e.message):e}}function cs(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 ls=/^\$?\{([a-zA-Z0-9_]+)\}$/,us=Object.assign(Object.create(null),u);function ds(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(ls);if(!t)return e;let n=t[1];if(y(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(m(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=us[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 fs(e,t={},n=new Date){return e==null?e:ds(cs(e,n),t)}var ps=`dateRange`,ms=`created_at`,hs;function gs(){return hs===void 0&&(hs=w.shape.dateRange.parse({})?.defaultRange),hs}var _s={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 vs(e){return _s[e]}var ys=/^\d{4}-\d{2}-\d{2}(?:[T ][\d:.]+(?:Z|[+-]\d{2}:?\d{2})?)?$/;function bs(e){return cs(e)!==e||ys.test(e)&&!Number.isNaN(Date.parse(e))}function xs(){return ue.join(`, `)}function Ss(e){typeof console<`u`&&console.warn(`[dashboard-filters] ${e}`)}var Cs=()=>!1,ws=new Set;function Ts(e){let t=gt(e);if(t===e)return e;let n=e?.name??e?.field??`?`,r=t?.defaultValue;return Ss(`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 Es(e,t){return e!==`date`&&e!==`dateRange`||typeof t!=`string`?t:t in _s?{preset:t}:t}function Ds(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(!Cs())return;let n=t.map(e=>typeof e==`string`?JSON.stringify(e):String(e)),r=`${e}:${n.join(`,`)}`;if(ws.has(r))return;ws.add(r);let i=t.map(e=>`{ value: ${JSON.stringify(String(e))}, label: ${JSON.stringify(String(e))} }`).join(`, `);Ss(`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 ks(e){let t=new Map;if(e.dateRange){let n=e.dateRange.defaultRange===void 0?gs():e.dateRange.defaultRange;t.set(ps,{name:ps,field:e.dateRange.field||ms,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=Ts(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:Ds(e.options,r),optionsFrom:e.optionsFrom,defaultValue:Es(i,e.defaultValue),targetWidgets:e.targetWidgets})}return Array.from(t.values())}function As(e){return e.map(e=>({name:e.name,type:e.type===`dateRange`?`object`:`string`,defaultValue:e.defaultValue}))}function js(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 Ms(e,t){if(!js(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?vs(t):void 0,i=r?.from??n.from,a=r?.to??n.to;return t&&!r&&Ss(i||a?`filter "${e.name}": ignoring unknown date range preset "${t}" — using the explicit from/to bounds instead; known presets: ${xs()}`:`skipping filter "${e.name}": unknown date range preset "${t}" — expected one of: ${xs()}`),!i&&!a?void 0:{...i?{$gte:i}:{},...a?{$lte:a}:{}}}if(typeof n==`string`&&!bs(n)){Ss(`skipping filter "${e.name}": value "${n}" is neither a known date range preset nor an ISO date — expected one of: ${xs()}, 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 Ns(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 Ps(e,t,n,r){let i=[];for(let a of t){let t=n[a.name];if(js(a,t))continue;let o=Ns(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=Ms(a,t);s!==void 0&&i.push({[o]:s})}if(i.length!==0)return i.length===1?i[0]:{$and:i}}function Fs(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 Is={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 Ls(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=>Ls(e,t));if(typeof e==`object`){let n={};for(let r of Object.keys(e))n[r]=Ls(e[r],t);return n}return e}function Rs(e,t,n=new Date){return t.kind===`previousYear`?cs(e,new Date(n.getFullYear()-1,n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds())):cs(Ls(e,Is),n)}function zs(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 Bs=e=>e==null?null:String(e),Vs=e=>JSON.stringify(e),Hs=(e,t)=>JSON.stringify([e,t]),Us=[`count`,`sum`,`avg`,`min`,`max`,`count_distinct`];function Ws(e){return typeof e==`string`&&Us.includes(e)}function Gs(e,t){let n=e.builtinAggregate;if(Ws(n)){let e=t?.[n];if(typeof e==`string`&&e!==``)return e}return e.label??e.name}var Ks=`(None)`;function q(e){return Vs([Bs(e)])}var qs=`__bucketId`;function Js(e){if(!e||typeof e!=`object`)return;let t=e[qs];return typeof t==`string`&&t!==``?t:void 0}function Ys(e,t){return J(e,t)&&e[t]==null}function J(e,t){return!!e&&typeof e==`object`&&t in e}function Xs(e){return e==null?``:String(e)}function Zs(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 Qs(e,t,n){let r=e=>Ys(e,t)?n:e[t],i=Zs(e.filter(e=>J(e,t)).map(e=>({id:q(e[t]),display:Xs(r(e))}))),a=!1,o=e.map(e=>{if(!J(e,t))return e;let o=Ys(e,t),s=i.has(Xs(r(e)));return!o&&!s?e:(a=!0,{...e,...o?{[t]:n}:{},...s?{[qs]:q(e[t])}:{}})});return a?o:e}function $s(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:Ys(r,t)?n:String(r[t])})}let a=Array.from(i.values()),o=Zs(a.map(({id:e,label:t})=>({id:e,display:t}))),s=new Set([r,qs]),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 ec(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?Gs(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=$s(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]=Ys(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=Zs(Array.from(u.entries()).map(([t,n])=>({id:t,display:Xs(n[e])})));return{data:Array.from(u.entries()).map(([t,n])=>d.has(Xs(n[e]))?{...n,[qs]:t}:n),xAxisKey:e,series:c.map(({dataKey:e,label:t})=>({dataKey:e,label:t}))}}let l=a[0];return{data:l?Qs(s,l,i?.nullCategoryLabel??`(None)`):s,xAxisKey:l,series:o.map(e=>({dataKey:e,label:c(e)}))}}function tc(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 nc(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=$s(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 rc(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 ic(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 ac(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 oc(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 sc(e,t){if(!t||!Array.isArray(e)||e.length===0)return e;let n=!1,r=e.map(e=>{let r=oc(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 cc(e,t){if(!Array.isArray(e)||e.length===0)return null;let n={},r={};for(let i of e){let e=oc(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 lc=new Set([`lookup`,`master_detail`,`masterdetail`,`master-detail`]);function uc(e){let t=e?.fields;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function dc(e){if(!e||typeof e!=`object`)return;let t=e,n=typeof t.type==`string`?t.type.toLowerCase():``;if(!lc.has(n))return;let r=t.reference;return typeof r==`string`&&r?r:void 0}async function fc(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=dc(uc(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=uc(i)?.[l];u?.options!==void 0&&(r[t]={object:a,field:l,options:u.options})}return r}function pc(e,t){let n=e?.object;if(!n||!t)return;let r=e.field;return(e,i)=>t(n,r,e,i)}function mc(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=cc(t?.options,pc(t,n));o&&(r[i]=o)}return Object.keys(r).length>0?r:null}async function hc(e,t,n){return fc(await e(t),n,e)}function gc(e,t){return v(e)??t}function _c(e,t){return d(e)??t}function vc(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function yc(e,t,n){let r=e.function,i={function:r,alias:gc(e,r||`count`)};return r!==`count`&&e.field&&(i.field=e.field),{groupBy:[t],aggregations:[i],where:n}}var bc=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function xc(e){if(typeof e==`string`&&e)return e;if(bc(e))return Object.values(e).find(e=>typeof e==`string`&&e)}function Sc(e){if(typeof e==`string`)return e||void 0;if(bc(e)&&Object.values(e).some(e=>typeof e==`string`&&e))return e}function Cc(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=xc(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 wc(e,t){let n=new Map;for(let e of Array.isArray(t)?t:[]){if(!bc(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,...Cc(t)}:e})}function Tc(e,t){let n=bc(e)?e:{},r={};typeof n.showLegend==`boolean`&&(r.showLegend=n.showLegend),typeof n.showDataLabels==`boolean`&&(r.showDataLabels=n.showDataLabels);let i=Sc(n.title);i&&(r.title=i);let a=Sc(n.subtitle);a&&(r.subtitle=a);let o=Sc(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 Ec=new Set([`pie`,`donut`,`funnel`,`scatter`]);function Dc(e){return typeof e==`string`&&Ec.has(e)}function Oc(e,t,n){return typeof n==`boolean`?n:t?!0:e!==0}function kc(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),Oc(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 Ac(e){return String(e).padStart(2,`0`)}function jc(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()}-${Ac(t.getMonth()+1)}-${Ac(t.getDate())}`}function Mc(e){if(e==null||e===``||Pc(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()}-${Ac(t.getMonth()+1)}-${Ac(t.getDate())}T${Ac(t.getHours())}:${Ac(t.getMinutes())}`}function Nc(e){if(!e)return``;if(Pc(e))return e;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()}function Pc(e){if(typeof e!=`string`)return!1;let t=e.match(/^(\d{4}-\d{2}-\d{2})(?:$|T)/);return t!=null&&!L(t[1])}function Fc(e,t){if(t===`fraction`)return e*100;if(t===`whole`)return e;throw TypeError(`percentDisplayValue: percentScale must be 'fraction' or 'whole' (the spec's PercentScale), got ${String(t)}`)}function Ic(e,t,n){return kc(e,{...n,locale:t})}var Lc=/^\d{4}-\d{2}-\d{2}$/,Rc=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function zc(e,t,n){if(typeof e==`string`){if(Lc.test(e))return Number.isNaN(Date.parse(e))?void 0:Ci(e,t,{locale:n});if(Rc.test(e))return Number.isNaN(Date.parse(e))?void 0:t===`relative`?Si(e,{locale:n}):t===`short`?Ti(e,{locale:n,style:`compact`}):Ti(e,{locale:n})}}function Bc(e,t,n,r,i){if(e==null)return`—`;if(typeof e!=`number`)return zc(e,t,i)??String(e);let a=t?t.split(`.`)[1]?.match(/0/g)?.length??0:void 0;if(n)try{return Ic(e,i,{currency:n,minimumFractionDigits:a??0,maximumFractionDigits:a??2})}catch{}if(!t)return Number.isInteger(e)?String(e):Ic(e,i,{maximumFractionDigits:2});let o=t.includes(`%`);return`${t.includes(`$`)?`$`:``}${Ic(o?Fc(e,r??`fraction`):e,i,{style:o?`percentPoints`:`decimal`,minimumFractionDigits:a??0,maximumFractionDigits:a??0})}`}function Vc(e,t){return e==null?`—`:typeof e==`number`?Number.isInteger(e)?String(e):Ic(e,t,{maximumFractionDigits:2}):String(e)}function Hc(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?Gs(i,r):e;return t&&n?n(t,e,o):o}}}function Uc(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?ss(r,a)??{}:a}var Wc=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function Gc(e){return Wc.test(e)||e.startsWith(`rgb`)||e.startsWith(`hsl`)}function Kc(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 qc(e){let t=Kc(e);return e=>{if(e==null||e===``)return;let n=String(e);return t[n]||(Gc(n)?n:void 0)}}var Jc=/[\\/:*?"<>|\u0000-\u001f]+/g,Yc=80;function Xc(e){return e?String(e).replace(Jc,`_`).replace(/\s+/g,` `).replace(/_{2,}/g,`_`).replace(/^[\s._-]+|[\s._-]+$/g,``).slice(0,Yc):``}function Zc(e,t={},n=new Date){let r=Xc(t.prefix),i=r||Xc(t.label)||Xc(t.objectName)||`export`,a=Xc(t.viewLabel);!r&&a&&a.toLowerCase()!==i.toLowerCase()&&(i=`${i}-${a}`.slice(0,Yc));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 Qc=e=>e.toLowerCase().replace(/[_\-\s]/g,``),$c=null,el=null,tl=null;function nl(){if(el)return el;let e=Object.keys(b.shape),t=new Map;for(let n of e){let e=Qc(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 $c=new Set(e),tl=r,el=n,n}var rl=new Set,il=new Set;function al(e,t,n,r,i,a){if(!cl())return;let o=r??(typeof a.name==`string`?a.name:`(unnamed field)`),c=i??`(unknown object)`,l=`${c}:${o}:${t}:${e}`;if(il.has(l))return;let u=e===`no-declared-twin`&&t===`id_field`?` \`@objectstack/spec\`'s \`FIELD_KEY_GUIDANCE\` gives the reason: ${s.id_field.why}`:``;il.add(l),console.warn(`[ObjectUI] Object \`${c}\`, field \`${o}\`: the ingestion choke point CANNOT canonicalize the retired spelling \`${t}\`. ${n}${u} 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 ol(e,t,n){let r=nl();for(let i of Object.keys(e)){if($c.has(i))continue;let a=e[i];if(a===void 0||ul.has(i))continue;let o=Qc(i),s=r.get(o);if(s===void 0){let r=tl.get(o);r?al(`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):al(`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&&al(`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,!cl())continue;let c=t??(typeof e.name==`string`?e.name:`(unnamed field)`),l=n??`(unknown object)`,u=`${l}:${c}:${i}:${s}`;rl.has(u)||(rl.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 sl=new Set,cl=()=>!1,ll=[`reference_to`,`referenceTo`],ul=new Set(ll);function dl(e,t,n){if(!cl()||e.reference!==void 0)return;let r=ll.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])}`;sl.has(n)||(sl.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 fl(e,t,n){if(!e||typeof e!=`object`)return e;let r=e;if(ol(r,t,n),r.reference!==void 0)return e;let i=r.reference_to??r.referenceTo;return i==null||i===``?e:(dl(r,t,n),r.reference=i,e)}function pl(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)fl(e,void 0,n);else for(let[e,r]of Object.entries(t))fl(r,e,n);return e}function ml(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 hl(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 gl(e,t){let n=hl(e,t);return n!==void 0&&p(n)}function _l(e,t,n){let r=gl(n,e);return{[e]:r?{$contains:t}:t}}var vl=new Set([`id`,`created_at`,`created_by`,`updated_at`,`updated_by`,`owner_id`,`organization_id`,`owning_business_unit_id`]);function yl(e,t){return vl.has(e)?!0:!!t&&typeof t==`object`&&e in t}var bl=/\b(?:record|data)\.([A-Za-z_][A-Za-z0-9_]*)/g,xl=/^[A-Za-z_][A-Za-z0-9_]*$/,Sl=/\{([a-z_][a-z0-9_]*)\}/gi;function Cl(e){if(!e||typeof e!=`object`)return;let t=e;if(t.defaultFromRow)return t.field??t.name}function wl(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 Tl(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 El(e){let t=[],n=new Set;for(let r of e){let e=Tl(r);if(e){bl.lastIndex=0;for(let r=bl.exec(e);r;r=bl.exec(e)){let e=r[1];n.has(e)||(n.add(e),t.push(e))}}}return t}function Dl(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`&&xl.test(n.recordIdField)&&t.push(`record.${n.recordIdField}`),Array.isArray(n.params))for(let e of n.params){let n=Cl(e);typeof n==`string`&&xl.test(n)&&t.push(`record.${n}`)}if(typeof n.target==`string`){Sl.lastIndex=0;for(let e=Sl.exec(n.target);e;e=Sl.exec(n.target))t.push(`record.${e[1]}`)}if(n.undoable)for(let e of wl(n))typeof e==`string`&&xl.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 Ol(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 kl={compact:`compact`,comfortable:`medium`,spacious:`tall`},Al={compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`};function jl(e){if(typeof e==`string`&&Object.prototype.hasOwnProperty.call(Al,e))return Al[e]}var Ml=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Nl={showSearch:`search`,showSort:`sort`,showFilters:`filter`,showDensity:`rowHeight`,showGroup:`group`,showHideFields:`hideFields`,showColor:`rowColor`},Pl={private:`personal`,team:`collaborative`,organization:`collaborative`,public:`collaborative`},Fl={label:`ariaLabel`,describedBy:`ariaDescribedBy`},Il={grid:!0,kanban:!0,gallery:!0,calendar:!0,timeline:!0,gantt:!0,map:!0,chart:!0,tree:!0},Ll={list:null,detail:null},Rl=new Set;function zl(e){let t=Object.prototype.hasOwnProperty.call(Ll,e)?Ll[e]:null;t===null||Rl.has(e)||(Rl.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(Il,e)}function Vl(e){if(typeof e==`string`){if(Bl(e))return e;zl(e)}}var Hl={kanban:{groupField:`groupByField`,cardFields:`columns`},gallery:{imageField:`coverField`},timeline:{dateField:`startDateField`}};function Ul(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(kl,i),o=t.filters,s=Array.isArray(o),c=Object.keys(Nl).filter(e=>typeof t[e]==`boolean`),l=typeof t.showDescription==`boolean`,u=Ml(t.aria)?t.aria:void 0,d=!!u&&Object.keys(Fl).some(e=>u[e]!==void 0),f=Ml(t.sharing)?t.sharing:void 0,p=!!f&&(f.visibility!==void 0||f.enabled!==void 0),m=Ml(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=Vl(t.specType)??Vl(t.type),y=!_||_===`list`,b=Array.isArray(t.columns)?t.columns:r?n:void 0,x=vr(b),S=x!==b,C=Object.entries(Hl).map(([e,n])=>{let r=Ml(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=kl[i]),delete w.densityMode),s&&(Array.isArray(w.filter)||(w.filter=o),delete w.filters),c.length){let e={...Ml(w.userActions)?w.userActions:{}};for(let n of c){let r=Nl[n];typeof e[r]!=`boolean`&&(e[r]=t[n]),delete w[n]}w.userActions=e}if(l){let e={...Ml(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(Fl))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?Pl[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 Gl(e,t){return e?t===`array`?Array.isArray(e):t!==`view-data`||!Array.isArray(e):!1}function Kl(e,t){return Gl(e.data,t)?e.data:e.staticData?{provider:`value`,items:e.staticData}:e.objectName?{provider:`object`,object:e.objectName}:null}var ql=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`,"object-calendar":`array`,"plugin-calendar:object-calendar":`array`,"view:calendar":`array`,calendar:`array`});function Jl(e){return typeof e==`string`?ql[e]??`undeclared`:`undeclared`}function Yl(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}var Xl=t({ACTION_DEF_KEYS:()=>ca,ActionEngine:()=>Wa,ActionRunner:()=>La,BUILTIN_AGGREGATES:()=>Us,CANONICAL_COLUMN_IDENTITY_KEY:()=>F,CANONICAL_COLUMN_LABEL_KEY:()=>yr,CAP_REACT_PAGES:()=>es,CASCADE_OPTION_WIDGET_TYPES:()=>aa,CHART_BUCKET_ID_KEY:()=>qs,ComponentRegistry:()=>k,DATE_RANGE_FILTER_NAME:()=>ps,DATE_RANGE_PRESETS:()=>ue,DENSITY_MODE_TO_ROW_HEIGHT:()=>kl,DebugCollector:()=>Ho,ELEMENT_DATA_SOURCE_KEY:()=>Ze,ERROR_CODES:()=>Mo,EXPANDABLE_FIELD_TYPES:()=>Sr,ExpressionCache:()=>hi,ExpressionContext:()=>di,ExpressionEvaluator:()=>B,FIELD_SORTABLE_UNPROVISIONED_ANCHOR:()=>FIELD_SORTABLE_UNPROVISIONED_ANCHOR,FIELD_UNSORTABLE_VIRTUAL_TYPE:()=>FIELD_UNSORTABLE_VIRTUAL_TYPE,FilterOperatorError:()=>D,FormulaFunctions:()=>Ai,HOST_DISPATCH_ACTION_KEYS:()=>da,HTML_TIER_INTRINSICS:()=>rt,KNOWN_ACTION_KEYS:()=>pa,LEGACY_COLUMN_IDENTITY_KEYS:()=>ur,NAVIGATION_ALIAS_KEYS:()=>ua,NON_GRID_ROW_CEILING:()=>or,NULL_CATEGORY_LABEL:()=>Ks,OBJECT_SORTABILITY_KEY:()=>jr,ObjectUIError:()=>No,PLATFORM_RECORD_COLUMNS:()=>vl,PUBLIC_BLOCKS:()=>nt,RETIRED_ACTION_KEYS:()=>fa,RETIRED_FIELD_TYPES:()=>Tr,ROW_HEIGHT_TO_DENSITY_MODE:()=>Al,ROW_PREDICATE_CANONICAL_ROOT:()=>Pi,Registry:()=>ot,SDUI_DOM_PASS_THROUGH_KEYS:()=>Xn,SPEC_ACTION_KEYS:()=>la,STYLE_BREAKPOINTS:()=>Uo,SUBJECT_PERMISSIONS:()=>xn,SafeExpressionParser:()=>mi,TABLE_ADAPTER_COLUMN_KEY:()=>TABLE_ADAPTER_COLUMN_KEY,TABLE_ADAPTER_HEADER_KEY:()=>br,UNMATERIALIZED_FIELD_TYPES:()=>kr,UndoManager:()=>sa,actionErrorDetail:()=>Sa,applyNonGridRowCeiling:()=>cr,attachObjectSortability:()=>Pr,bindSubjectPermissions:()=>Sn,buildCategoryOrder:()=>ic,buildCategoryRank:()=>ac,buildChartSeries:()=>ec,buildDatasetDrillFilter:()=>Uc,buildDatasetFieldHelpers:()=>Hc,buildDimensionLabelMap:()=>cc,buildExpandFields:()=>wr,buildExportFileName:()=>Zc,buildFieldColorMap:()=>Kc,buildFilterCondition:()=>Ms,buildOptionColorMap:()=>rc,buildWidgetScopedFilter:()=>Ps,captureUpdateUndoData:()=>Fa,chartBucketId:()=>q,chartCategoryKey:()=>_c,chartConfigPresentation:()=>Tc,chartMeasureKey:()=>gc,chartRowBucketId:()=>Js,chartTypeIgnoresCompareTo:()=>Dc,classifyActionKeys:()=>ma,collectGroupingFieldRefs:()=>Ol,collectPredicateFieldRefs:()=>El,columnHeader:()=>xr,columnIdentity:()=>pr,compareSortValues:()=>ri,compareToTrendLabelKey:()=>zs,compileScopedStyles:()=>Jo,composeDrillFilter:()=>ss,composeParentScopeFilter:()=>_l,computeDrillFilter:()=>is,convertFiltersToAST:()=>De,convertOperatorToAST:()=>ye,convertSortToQueryParams:()=>ui,createFieldColorResolver:()=>qc,createServerActionHandler:()=>Ja,dashboardFilterVariableDefs:()=>As,debugLog:()=>Lo,debugTime:()=>zo,debugTimeEnd:()=>Bo,declaredNameField:()=>Xr,deriveDimensionLabelMaps:()=>mc,deriveTitleField:()=>Yr,detectNonCanonicalRowSpelling:()=>Ii,dimensionOptionTranslator:()=>pc,evalFieldPredicate:()=>N,evalRowPredicate:()=>qi,executeBulkBatch:()=>Ga,extractRecords:()=>ar,filterPlatformSortableSort:()=>Lr,filterRefusalSubject:()=>_e,findChartSeriesRow:()=>nc,formatDate:()=>Ci,formatDateTime:()=>Ti,formatDateTimeCompactParts:()=>wi,formatDimensionValue:()=>Vc,formatDisplayNumber:()=>kc,formatMeasure:()=>Bc,formatRelativeDate:()=>Si,formatTitleTemplate:()=>Wr,fromDateTimeInputValue:()=>Nc,getRecordDisplayName:()=>ti,getSortValue:()=>ni,globalUndoManager:()=>H,hasDeclaredPredicate:()=>P,hasDeprecatedObjectParams:()=>ba,hasResponsiveStyles:()=>Ko,humanizeLabel:()=>Yl,interpolate:()=>ns,interpretActionResponse:()=>Ea,isBlankPredicateText:()=>Fn,isBuiltinAggregate:()=>Ws,isCapabilityEnabled:()=>$o,isColorLiteral:()=>Gc,isDebugEnabled:()=>Io,isDrillEnabled:()=>os,isEmptyValue:()=>lr,isExpandableFieldType:()=>Cr,isImpossibleStoredDay:()=>Pc,isLegacyActionEnvelope:()=>Ta,isLegacyDialectSource:()=>Vi,isListViewVisualization:()=>Bl,isMissingForRequired:()=>st,isMultiValueRelationship:()=>gl,isObjectInlineEditable:()=>ir,isObjectUIError:()=>Po,isOpenDomAttributeFamily:()=>Zn,isOptionGroupGated:()=>ea,isPlatformSortableField:()=>Ir,isProjectableField:()=>yl,isRealCalendarDate:()=>L,isRecordScopedAction:()=>Ka,isRetiredFieldType:()=>Er,isRuntimeDefault:()=>lt,isServerOwnedValue:()=>ut,isStructuredGroupBy:()=>vc,isTitleEligibleField:()=>Gr,isUnmaterializedFieldType:()=>Ar,isValueStillOffered:()=>ra,leadWithNameField:()=>Qr,listViewPredicates:()=>Dl,loadDimensionFieldMeta:()=>hc,localizeFieldOptions:()=>sc,mergeAuthoredSeries:()=>wc,mergeFilterNodes:()=>Fe,mergeFilters:()=>Fs,nonGridRowCeilingQuery:()=>sr,normalizeColumnIdentities:()=>vr,normalizeColumnIdentity:()=>_r,normalizeFieldReferenceKeys:()=>fl,normalizeListViewSchema:()=>Ul,normalizeObjectSortability:()=>Nr,normalizeSchemaReferenceKeys:()=>pl,normalizeSortEntries:()=>li,normalizeUserAction:()=>er,objectAggregateSpecQuery:()=>yc,optionDisplayLabel:()=>na,parentRelationshipFieldDef:()=>hl,parseDebugFlags:()=>Fo,partitionRowsByPredicate:()=>Ji,percentDisplayValue:()=>Fc,pickDomProps:()=>Qn,pivotBucketId:()=>Vs,pivotCellKey:()=>Hs,pivotDimensionValue:()=>Bs,readActionPayload:()=>Ca,readObjectSortability:()=>Fr,readOnSuccessNavigation:()=>Ra,recordDelete:()=>Qa,recordDisplayValueAt:()=>I,recordSourceDataArmForType:()=>Jl,relabelDimensions:()=>tc,reportRetiredFieldType:()=>Or,resolveCascadingOptions:()=>ia,resolveConditionalFormatting:()=>Qi,resolveContextTokens:()=>ds,resolveDashboardFilterDefs:()=>ks,resolveDateMacros:()=>cs,resolveDependsOnFields:()=>$i,resolveDimensionFieldMeta:()=>fc,resolveDrillTitle:()=>as,resolveEffectiveCrudAffordances:()=>rr,resolveFieldRuleState:()=>Pn,resolveFilterPlaceholders:()=>fs,resolveMeasureLabel:()=>Gs,resolveNameField:()=>Zr,resolveRecordIdParamSeed:()=>Ya,resolveRecordSourceConfig:()=>Kl,resolveRecordSourceObjectName:()=>Wl,resolveRelationshipTarget:()=>dc,resolveServerActionRecordId:()=>qa,resolveViewId:()=>Ie,resolveVisibleOptions:()=>ta,rowHeightToDensityMode:()=>jl,sanitizeFileNameBase:()=>Xc,scopeClassFor:()=>qo,seriesPresentation:()=>Cc,shiftFilterByCompareTo:()=>Rs,shouldGroupDisplayNumber:()=>Oc,subjectPermissionsOf:()=>Cn,toDateInputValue:()=>jc,toDateTimeInputValue:()=>Mc,toDisplayDate:()=>R,toDisplayEndDate:()=>vi,toDomProps:()=>$n,toFilterNode:()=>Ne,toFilterNodeSafely:()=>Pe,toInclusiveEndDay:()=>yi,toPredicateInput:()=>bn,toPredicateRecord:()=>zi,userActionPredicates:()=>tr,validateSchema:()=>Yn,warnOnDeprecatedObjectParams:()=>xa,warnOnUnknownActionKeys:()=>_a,withElementDataSourceInput:()=>at,withoutDeniedFields:()=>ml}),Zl=(0,O.createContext)({});function Ql({scope:e,children:t}){return(0,O.createElement)(Zl.Provider,{value:e},t)}function Y(){return(0,O.useContext)(Zl)}function $l(e){return(0,O.useMemo)(()=>typeof e!=`object`||!e||Array.isArray(e)?{}:{record:e},[e])}var eu=new Set;function tu(e,t={},n){let r=Y();return(0,O.useMemo)(()=>{let i=new B({...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(!eu.has(i)){eu.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 nu(e,t,n){let r=Y(),i=n?.fallback??!0,a=n?.fields;return(0,O.useMemo)(()=>typeof e==`boolean`?e:e==null||e===``?i:qi(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,O.createContext)(null),ru=({children:e,dataSource:t,debug:n,debugFlags:r,apiFetch:i})=>{let a=(0,O.useContext)(Z),o=i??a?.apiFetch,s=(0,O.useMemo)(()=>({dataSource:t,debug:n,debugFlags:r,apiFetch:o}),[t,n,r,o]);return(0,X.jsx)(Z.Provider,{value:s,children:e})},iu=()=>{let e=(0,O.useContext)(Z);if(!e)throw Error(`useSchemaContext must be used within a SchemaRendererProvider`);return e},au=e=>{let t=Y();if(e&&t)return e.split(`.`).reduce((e,t)=>e&&e[t],t)},ou=O.createContext(null),su=({children:e})=>{let t=O.useMemo(()=>{let e=new Map,t=fu,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)(ou.Provider,{value:t,children:e})};function cu(){let e=O.useContext(ou);return O.useSyncExternalStore(e?e.subscribe:uu,e?e.getNames:du,e?e.getNames:du)}function lu(e,t){let n=O.useContext(ou),r=t.join(`|`);O.useEffect(()=>{if(n)return n.register(e,r.length===0?[]:r.split(`|`)),()=>n.unregister(e)},[n,e,r])}var uu=e=>()=>{},du=()=>fu,fu=new Set,pu=O.createContext(null),mu=({children:e,recordId:t,...n})=>{let r={...n,recordId:typeof t==`number`?String(t):t},i=O.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)(pu.Provider,{value:i,children:e})};function hu(){return O.useContext(pu)}var gu=(0,O.createContext)(null);function _u(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 vu=({definitions:e,children:t})=>{let n=(0,O.useContext)(gu),[r,i]=(0,O.useState)(()=>_u(e)),a=(0,O.useMemo)(()=>e??[],[e]),o=(0,O.useMemo)(()=>new Set(a.map(e=>e.name)),[a]),s=(0,O.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,O.useCallback)(e=>{for(let[t,n]of Object.entries(e))s(t,n)},[s]),l=(0,O.useCallback)(()=>{i(_u(e))},[e]),u=(0,O.useMemo)(()=>n?{...n.variables,...r}:r,[n,r]),d=(0,O.useMemo)(()=>n?[...n.definitions.filter(e=>!o.has(e.name)),...a]:a,[n,a,o]),f=(0,O.useMemo)(()=>({variables:u,definitions:d,setVariable:s,setVariables:c,resetVariables:l}),[u,d,s,c,l]);return(0,X.jsx)(gu.Provider,{value:f,children:t})};vu.displayName=`PageVariablesProvider`;function yu(){return(0,O.useContext)(gu)??bu}var bu=Object.freeze({variables:Object.freeze({}),definitions:Object.freeze([]),setVariable:()=>{},setVariables:()=>{},resetVariables:()=>{}});function xu(e){let{variables:t,definitions:n,setVariable:r}=yu();return(0,O.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 Su(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 Cu=`params`;function wu(e){if(!Q(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Tu(e){return wu(e)}function Eu(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=Eu(e[a],t+`[`+a+`]`,n,r);o!==e[a]&&(i||=e.slice(),i[a]=o)}return r.delete(e),i??e}if(wu(e)){if(r.has(e))return e;r.add(e);let i;for(let a of Object.keys(e)){let o=e[a],s=Eu(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 Du(e,t,n=Cu){return Eu(e,n,t,new Set)}var Ou=/\$\{([^}]+)\}/g;function ku(e){let t=[];Ou.lastIndex=0;let n=Ou.exec(e);for(;n!==null;)t.push(n[0]),n=Ou.exec(e);return t}function Au(e,t,n,r){let i=ku(n);i.length>0&&r.push({key:e,channel:t,value:n,expressions:i})}function ju(e,t,n,r){if(Q(e)){for(let[i,a]of Object.entries(e))if(!r?.(i,a)){if(i===`params`&&Tu(a)){Du(a,(e,r)=>(Au(r,t,e,n),e));continue}typeof a==`string`&&Au(i,t,a,n)}}}function Mu(e,t,n){let r=[];ju(t,`properties`,r);let i=Q(t)?t:void 0;return ju(e,`schema`,r,(e,t)=>i?.[e]===t),ju(n,`props`,r),r}function Nu(e){switch(e.channel){case`properties`:return`properties.`+e.key;case`props`:return`props.`+e.key;default:return e.key}}function Pu(e,t,n){let r=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,i=typeof t==`string`&&t?` (id: "`+t+`")`:``,a=n.map(e=>` - `+Nu(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 Fu=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function Iu(e,t,n,r,i,a){let o=Mu(r,i,a);if(o.length===0)return o;if(e&&typeof e==`object`){if(Fu.has(e))return o;Fu.add(e)}return console.error(Pu(t,n,o)),o}var Lu=`element:`,Ru=new Set([`view:simple`]);function zu(e){return typeof e!=`string`||e.length===0?!1:e.startsWith(Lu)?!0:Ru.has(e)}var Bu="[ObjectUI] A `props` config bag was not read";function Vu(e,t){return`${typeof e==`string`&&e?`\`${e}\``:`(untyped node)`}${typeof t==`string`&&t?` (id: '${t}')`:``}`}function Hu(e,t,n){let r=n.map(e=>`\`${e}\``).join(`, `),i=n.length===1;return`${Bu} - node ${Vu(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 Uu=new Set;function Wu(e,t,n){if(zu(e)||!Q(t)||!Q(n))return null;let r=Object.keys(n);return r.length>0?r:null}function Gu(e,t,n,r){let i=Wu(e,n,r);if(!i)return null;let a=Hu(e,t,i);return Uu.has(a)?null:(Uu.add(a),console.warn(a),a)}var Ku="[ObjectUI] A node-gate predicate under `props` is REFUSED",qu=new Set([`disabled`]);function Ju(e,t,n){let r=n.map(e=>`\`${e}\``).join(`, `),i=n.length===1;return`${Ku} - node ${Vu(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 Yu(e,t,n){if(!Q(n))return null;let r=zu(e),i=Object.keys(n).filter(e=>t.has(e)&&!(r&&qu.has(e)));return i.length>0?i:null}var Xu=new Set;function Zu(e,t,n,r){let i=Yu(e,n,r);if(!i)return null;let a=Ju(e,t,i);return Xu.has(a)?null:(Xu.add(a),console.error(a),a)}var Qu=new Set;function $u(e,t){let n=t===void 0?e:`${e}#${t}`;Qu.has(n)||(Qu.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 ed=`[ObjectUI] A visibility predicate could not be evaluated`,td=`[ObjectUI] An enablement predicate could not be evaluated`;function nd(e){if(e&&typeof e==`object`){let t=e.source;if(typeof t==`string`)return t}return typeof e==`string`?e:String(e)}var rd={"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."},id={visibility:{prefix:ed,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:ed,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:td,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 ad(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=id[o];return l.prefix+` - node `+s+c+`
29
+ `+n+`: `+JSON.stringify(nd(r))+`
30
+ Reason: `+i+`
31
+ `+l.consequence+rd[a]}var od=new Set;function sd(e,t,n,r,i,a=`page-component`,o=`visibility`){let s=i instanceof Error?i.message:String(i),c=JSON.stringify([e,n,nd(r)]);od.has(c)||(od.add(c),console.warn(ad(e,t,n,r,s,a,o)))}var cd={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 ld(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,`''`)}var ud=/(^|[^A-Za-z0-9_$.])data\.([A-Za-z_$][A-Za-z0-9_$]*(?:\.[A-Za-z_$][A-Za-z0-9_$]*)*)/g;function dd(e,t){let n=ld(e),r=[];ud.lastIndex=0;let i;for(;(i=ud.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 fd(e,t,n,r,i,a=`visibility`){let o=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,s=typeof t==`string`&&t?` (id: "`+t+`")`:``,c=cd[a];return c.prefix+` - node `+o+s+`
32
+ `+n+`: `+JSON.stringify(nd(r))+"\n Unanswered by the bound `data`: "+i.join(`, `)+`
33
+ `+c.consequence}function pd(e,t,n,r,i,a=`visibility`){let o=nd(r);if(o.indexOf(`data.`)===-1)return;let s=dd(o,i);if(s.length===0)return;let c=JSON.stringify([`adapter-only-data`,e,n,o]);od.has(c)||(od.add(c),console.warn(fd(e,t,n,r,s,a)))}var $=(()=>{try{return!1}catch{return!0}})(),md=typeof WeakMap<`u`?new WeakMap:{set(){},get(){},has(){return!1}},hd=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function gd(e){if(!$||!e||typeof e!=`object`)return{valid:!0,messages:[]};let t=md.get(e);if(t)return t;let n={valid:!0,messages:[]};try{let t=Yn(e);if(!t.valid){let r=t.errors.map(e=>`${e.path}: ${e.message}`);n={valid:!1,messages:r},hd.has(e)||(hd.add(e),console.warn(`[ObjectUI] Invalid schema detected:
34
+ `+r.join(`
35
+ `),e))}}catch(t){hd.has(e)||(hd.add(e),console.warn(`[ObjectUI] Schema validator threw:`,t))}return md.set(e,n),n}function _d(e){let t={};return e.ariaLabel&&(t[`aria-label`]=Su(e.ariaLabel)),e.ariaDescribedBy&&(t[`aria-describedby`]=e.ariaDescribedBy),e.role&&(t.role=e.role),t}var vd=new Set([`type`,`id`]);function yd(e,t){if(!Q(e))return{};if(!Q(t))return e;let n=null;for(let r of Object.keys(t))vd.has(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n||={...e},delete n[r]);return n??e}var bd=[`visibleWhen`,`visible`,`visibleOn`,`visibility`],xd=[`hidden`,`hiddenOn`],Sd=new Set([...bd,...xd]),Cd=[`disabled`,`disabledOn`],wd=[`enabled`],Td=new Set([...Sd,...Cd,...wd]),Ed=new Set([...Sd,...Cd]),Dd=e=>Q(e)&&e.dialect===`cel`&&typeof e.source==`string`,Od=(e,t,n)=>Td.has(e)&&Dd(t)?t:n(t),kd=e=>Q(e)&&typeof e.dialect==`string`&&typeof e.source==`string`,Ad=(e,t)=>!Td.has(e)&&Q(t)&&!kd(t),jd=(e,t,n)=>({...e,current_user:e?.user,...t&&typeof t==`object`&&!Array.isArray(t)?{record:t}:null,page:n}),Md=(e,t,n)=>t===`params`&&Tu(n)?Du(n,t=>e.evaluate(t)):Ad(t,n)?n:Od(t,n,t=>e.evaluate(t)),Nd=(e,t)=>{let n={...t};for(let[t,r]of Object.entries(n))n[t]=Md(e,t,r);return n};function Pd(e,t,n,r){return Q(e)?Nd(new B(jd(t,n,r)),e):e}var Fd=e=>xd.includes(e)?`concealment`:`visibility`;function Id(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 bd)if(r(e)!==void 0)return e;for(let e of xd)if(P(r(e)))return e}function Ld(e){if(typeof e!=`string`||e===``)return;let t=e.toLowerCase();for(let n of k.getKnownTypes())if(n!==e&&n.toLowerCase()===t)return n}var Rd=class extends O.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 Po(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}},zd={};function Bd(e,t){if(!t||!(`data`in e))return e;let{data:n,...r}=e;return r}function Vd(e){if(!(`objectFields`in e))return e;let{objectFields:t,...n}=e;return n}var Hd=(0,O.forwardRef)(({schema:e,...t},n)=>{let r=(0,O.useContext)(Z),i=r?.dataSource||zd,a=Y(),o=hu()?.data,{variables:s}=yu(),[,c]=(0,O.useReducer)(e=>e+1,0);(0,O.useEffect)(()=>{let e=k.subscribe(c);return c(),e},[]);let[l,u]=(0,O.useState)(null),d=O.useId(),f=(0,O.useMemo)(()=>{if(!e||typeof e!=`object`)return e;let t=new B(jd(a,o,s)),n={...e},r=(e,r)=>{let i=Fd(r);if(!$)return t.evaluateCondition(e,{onFault:t=>sd(n.type,n.id,r,e,t,`page-component`,i)});try{let i=t.evaluateCondition(e,{throwOnError:!0});return pd(n.type,n.id,r,e,a?.data),i}catch(t){return sd(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,sd(n.type,n.id,r,e,t,`page-component`,`enablement`)}});return $&&!i&&pd(n.type,n.id,r,e,a?.data,`enablement`),o},c=(e,n)=>Md(t,e,n);Tu(n.params)&&(n[Cu]=c(Cu,n[Cu]));let l=Q(n.properties)?n.properties:void 0;if(l&&(n.properties=Nd(t,l)),$){let e=Id(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 ae(typeof n.type==`string`?n.type:``)){let r=n[e];typeof r==`string`&&(n[e]=t.evaluate(r))}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 Zu(n.type,n.id,Ed,yd(n.props,n.properties)),(n.visibleWhen===void 0?n.visible===void 0?n.visibleOn===void 0?n.visibility===void 0?P(n.hidden)?r(n.hidden,`hidden`):P(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),(P(n.disabled)?i(n.disabled,`disabled`):P(n.disabledOn)&&i(n.disabledOn,`disabledOn`))&&(n._disabled=!0),n},[e,i,a,s,o]),p=(0,O.useMemo)(()=>{let e=f;if(!e||typeof e!=`object`)return{scopeClass:``,scopedCss:``,mergedClassName:void 0,schemaForComponent:e};let t=e.responsiveStyles;if(!Ko(t))return{scopeClass:``,scopedCss:``,mergedClassName:e.className,schemaForComponent:e};let n=qo(e.id??d),r=[e.className,n].filter(Boolean).join(` `);return{scopeClass:n,scopedCss:Jo(`.${n}`,t),mergedClassName:r,schemaForComponent:{...e,className:r}}},[f,d]);if(!f)return null;if(typeof f==`string`)return(0,X.jsx)(X.Fragment,{children:f});if(typeof f!=`object`)return(0,X.jsx)(X.Fragment,{children:String(f)});if(f._hidden)return null;let m=$?gd(e):{valid:!0,messages:[]};Lo(`schema`,`Rendering schema node`,{type:f.type,id:f.id});let h=k.get(f.type);if(!h){if(!l&&k.hasLazy(f.type)){let e=k.loadLazy(f.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":f.type,children:[`Loading `,(0,X.jsx)(`code`,{children:f.type}),`…`]})}Lo(`schema`,`Component not found in registry`,{type:f.type}),Mo[`OBJUI-001`];let e=Ld(f.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:f.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(f,null,2)})]})}let{type:g,children:_,body:v,schema:y,visible:b,visibleWhen:x,visibleOn:S,visibility:C,hidden:w,hiddenOn:ee,disabled:te,disabledOn:ne,dataSource:re,testId:ie,objectFields:oe,_hidden:se,_disabled:ce,responsiveStyles:le,...T}=f;$&&Iu(e,f.type,f.id,ie===void 0?T:{...T,testId:ie},f.properties,f.props);let ue=Jl(f.type)===`view-data`,de=Vd(yd(f.props,f.properties)),fe=Bd(de,ue);$&&fe!==de&&$u(f.type,f.id),$&&Gu(f.type,f.id,e?.props,fe);let pe=Bd(T,ue);$&&pe!==T&&$u(f.type,f.id);let{scopeClass:me,scopedCss:E,mergedClassName:he,schemaForComponent:ge}=p,D=_d(f),_e=r?.debug||r?.debugFlags?.enabled,ve={};_e&&(ve[`data-debug-type`]=f.type,f.id&&(ve[`data-debug-id`]=f.id)),zo(`render:${f.type}:${f.id??`anon`}`);let ye=_e?performance.now():0,be=(0,X.jsxs)(Rd,{componentType:f.type,resetKey:f.id??null,children:[E?(0,X.jsx)(`style`,{"data-os-scope":me,dangerouslySetInnerHTML:{__html:E}}):null,O.createElement(h,{schema:ge,...pe,...fe,...D,...ve,disabled:ce||void 0,className:he,"data-obj-id":f.id,"data-obj-type":f.type,...ie===void 0?{}:{"data-testid":ie},...$&&!m.valid?{"data-obj-schema-invalid":`true`}:{},...t})]});if(Bo(`render:${f.type}:${f.id??`anon`}`),_e&&ye){let e=performance.now()-ye;Ho.getInstance().addPerf({type:f.type,id:f.id,durationMs:e,timestamp:Date.now()})}return be});Hd.displayName=`SchemaRenderer`;function Ud(e){return typeof e==`number`||typeof e==`boolean`?e?String(e):void 0:e}var Wd=(0,O.createContext)({});function Gd({currentUserId:e,currentOrgId:t,children:n}){let r=(0,O.useMemo)(()=>({currentUserId:e,currentOrgId:t}),[e,t]);return(0,O.createElement)(Wd.Provider,{value:r},n)}function Kd(){let e=(0,O.useContext)(Wd),t=hu()?.recordId;return(0,O.useMemo)(()=>t==null?e:{...e,recordId:t},[e,t])}function qd(e,t){let n=fs(e,t);return{authored:e,currentUserId:t.currentUserId,currentOrgId:t.currentOrgId,recordId:t.recordId,onUnresolved:t.onUnresolved,resolved:Xd(n,e)?e:n}}var Jd=12;function Yd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Xd(e,t,n=0){if(Object.is(e,t))return!0;if(n>=Jd)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)=>Xd(e,t[r],n+1));if(Yd(e)&&Yd(t)){let r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&Xd(e[r],t[r],n+1))}return!1}function Zd(e,t){let[n,r]=O.useState(()=>qd(e,t));if(n.currentUserId!==t.currentUserId||n.currentOrgId!==t.currentOrgId||n.recordId!==t.recordId||n.onUnresolved!==t.onUnresolved||!Xd(n.authored,e)){let n=qd(e,t);return r(n),n.resolved}return n.resolved}function Qd(){let{t:e}=E(),t=(0,O.useRef)(e);(0,O.useEffect)(()=>{t.current=e});let[n]=(0,O.useState)(()=>(e,n)=>String(t.current(e,n)));return n}function $d(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,O.useState)(!1),[u,d]=(0,O.useState)(null),[f,p]=(0,O.useState)(null),m=Qd(),h=(0,O.useMemo)(()=>{let e=new La(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,O.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,O.useCallback)(e=>{h.updateContext(e)},[h]),runner:h}}var ef=(0,O.createContext)(null),tf=({value:e,children:t})=>(0,X.jsx)(ef.Provider,{value:e,children:t});function nf(){return(0,O.useContext)(ef)}var rf={sm:`min(92vw, 480px)`,md:`min(92vw, 720px)`,lg:`min(92vw, 960px)`,xl:`min(92vw, 1200px)`,full:`min(92vw, 1600px)`};function af(e){if(!e)return;if(e.width!==void 0)return e.width;let t=e.size;if(t&&t!==`auto`)return rf[t]}function of(e){let{navigation:t,objectName:n,onNavigate:r,onRowClick:i}=e,a=nf()?.openRecord,[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),u=t?.mode??`page`,d=af(t),f=u===`drawer`||u===`modal`||u===`split`||u===`popover`,p=(0,O.useCallback)(()=>{s(!1),l(null)},[]),m=(0,O.useCallback)(e=>{l(e),s(!0)},[]),h=(0,O.useCallback)((e,o)=>{if(i){i(e,o);return}if(o&&(o.metaKey||o.ctrlKey||o.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(!(u===`none`||t.preventNavigation)){if(u===`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(u===`page`){let t=e.id||e._id;if(t==null)return;if(r){r(t,`view`);return}n&&a&&a(n,t);return}if(f){l(e),s(!0);return}}},[i,t,u,n,r,a,f]);return(0,O.useMemo)(()=>({isOpen:o,selectedRecord:c,mode:u,close:p,open:m,setIsOpen:s,handleClick:h,width:d,isOverlay:f}),[o,c,u,p,m,h,d,f])}var sf=(0,O.createContext)(!1),cf=({value:e=!0,children:t})=>(0,X.jsx)(sf.Provider,{value:e,children:t}),lf=()=>(0,O.useContext)(sf),uf=(0,O.createContext)(null),df=({children:e,context:t={},onConfirm:n,onToast:r,onModal:i,onNavigate:a,onParamCollection:o,onResultDialog:s,handlers:c})=>{let[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)(null),h=Qd(),g=(0,O.useMemo)(()=>{let e=new La({...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=Cn(_);(0,O.useMemo)(()=>{_!==void 0&&g.updateContext({current_user:_})},[g,v,y]);let b=(0,O.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,O.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,O.useCallback)(e=>{g.updateContext(e)},[g]),C=(0,O.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)(uf.Provider,{value:C,children:e})};df.displayName=`ActionProvider`;function ff(){let e=(0,O.useContext)(uf);if(!e){let e=new La;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 pf(){return(0,O.useContext)(uf)!==null}(0,O.createContext)(null);var mf={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 hf(e){return e===`modal`?`alert`:e&&e in mf?e:`toast`}new Set(Object.keys(mf));var gf=new Set([`top_left`,`top_center`,`top_right`,`bottom_left`,`bottom_center`,`bottom_right`]);function _f(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 vf=0,yf=(()=>{try{return!1}catch{return!0}})(),bf={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`},xf=(0,O.createContext)(null),Sf=({children:e,config:t={},onToast:n})=>{let r=(0,O.useMemo)(()=>_f(t),[JSON.stringify(t)]),[i,a]=(0,O.useState)([]),o=(0,O.useRef)(new Map),s=(0,O.useRef)(new Map),c=(0,O.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,O.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,O.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),c(e,t.left))},[c]);(0,O.useEffect)(()=>()=>{for(let{handle:e}of s.current.values())clearTimeout(e);s.current.clear()},[]);let d=(0,O.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,O.useCallback)(e=>{let t=`notification-${++vf}`,i=hf(e.displayType),{surface:s,transient:l}=mf[i],u={...e,displayType:i,id:t,createdAt:new Date,read:!1};a(e=>[u,...e]),s===`delegate`&&n?.(u,r),yf&&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, ${bf[s]}.`);let d=e.duration??(l?r.defaultDuration:0);return d>0&&c(t,d),t},[r,n,c]),p=(0,O.useCallback)((e,t)=>f({title:e,message:t,severity:`info`}),[f]),m=(0,O.useCallback)((e,t)=>f({title:e,message:t,severity:`success`}),[f]),h=(0,O.useCallback)((e,t)=>f({title:e,message:t,severity:`warning`}),[f]),g=(0,O.useCallback)((e,t)=>f({title:e,message:t,severity:`error`}),[f]),_=(0,O.useCallback)(e=>{a(t=>t.map(t=>t.id===e?{...t,read:!0}:t))},[]),v=(0,O.useCallback)(()=>{a(e=>e.map(e=>({...e,read:!0})))},[]),y=(0,O.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,O.useCallback)(()=>{a([])},[]),x=(0,O.useMemo)(()=>i.filter(e=>!e.read).length,[i]),S=(0,O.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)(xf.Provider,{value:S,children:e})};Sf.displayName=`NotificationProvider`;function Cf(){let e=(0,O.useContext)(xf);if(!e)throw Error(`useNotifications must be used within a <NotificationProvider>. Wrap your app with <NotificationProvider> to use the notification system.`);return e}function wf(){return(0,O.useContext)(xf)!==null}function Tf(e,t){let n=t.maxVisible>0?e.slice(0,t.maxVisible):e;return t.stackDirection===`up`?n:[...n].reverse()}function Ef(e,t){let n=e.position??t?.defaultPosition;if(!n)return;let r=n.replace(/-/g,`_`);return gf.has(r)?r:void 0}function Df(e,t){let{notifications:n,registerSurface:r}=Cf(),{surface:i}=mf[e];return(0,O.useEffect)(()=>r(i),[r,i]),(0,O.useMemo)(()=>n.filter(n=>hf(n.displayType)===e&&(e!==`inline`||(n.scope??void 0)===t)),[n,e,t])}var Of=(0,O.createContext)(null);function kf(){let e=(0,O.useContext)(Of);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 Af(){return(0,O.useContext)(Of)!==null}var jf=(0,O.createContext)(null);function Mf(){return(0,O.useContext)(jf)}var Nf=(0,O.createContext)(null),Pf=Object.freeze([]),Ff=Object.freeze({apps:Pf,objects:Pf,dashboards:Pf,reports:Pf,pages:Pf,loading:!1,error:null,refresh:async()=>{},invalidate:()=>{},ensureType:async()=>[],getItem:async()=>null,getItemsByType:()=>[],getTypeStatus:()=>`ready`});function If(){return(0,O.useContext)(Nf)??Ff}function Lf(e,t){let{getItem:n}=If(),[r,i]=(0,O.useState)({item:null,loading:!!t,error:null});return(0,O.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 Rf=O.createContext(null),zf=({canEdit:e=!0,locked:t=!1,approvalPending:n,approvalProgress:r,approvalIsSubmitter:i,lockedReason:a,children:o})=>{let s=n??t,[c,l]=O.useState(!1),[u,d]=O.useState({}),[f,p]=O.useState(null),[m,h]=O.useState(!1),[g,_]=O.useState(null),[v,y]=O.useState(null),b=O.useCallback(t=>{e&&(p(t??null),l(!0),_(null),y(null))},[e]),x=O.useCallback((e,t)=>{d(n=>({...n,[e]:t}))},[]),S=O.useCallback(()=>{d({}),l(!1),p(null),h(!1),_(null),y(null)},[]),C=O.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)(Rf.Provider,{value:C,children:o})};function Bf(){return O.useContext(Rf)}var Vf=O.createContext(null),Hf=({children:e,...t})=>{let n=O.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 Uf(){return O.useContext(Vf)}var Wf=(0,O.createContext)({}),Gf=({value:e,children:t})=>(0,X.jsx)(Wf.Provider,{value:e,children:t});function Kf(){return(0,O.useContext)(Wf)}var qf=(0,O.createContext)({}),Jf=({value:e,children:t})=>(0,X.jsx)(qf.Provider,{value:e,children:t});function Yf(){return(0,O.useContext)(qf)}function Xf(){let{variables:e}=yu(),{updateContext:t}=ff();return O.useEffect(()=>(t({pageVariables:e}),()=>{t({pageVariables:{}})}),[e,t]),null}Xf.displayName=`PageVariableActionBridge`;var Zf=e=>!!e&&typeof e==`object`;async function Qf(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=>Zf(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 $f(e,t){let n=(0,O.useContext)(Z),r=t??n?.dataSource??null,i=(0,O.useMemo)(()=>{let t=Zf(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,O.useState)(null);return(0,O.useEffect)(()=>{if(!a||!o)return;let e=!1;return Qf(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,O.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 D))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 ep(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 tp={compact:32,comfortable:40,spacious:52},np={compact:`py-1 px-2`,comfortable:`py-2 px-3`,spacious:`py-3 px-4`},rp={compact:`text-xs`,comfortable:`text-sm`,spacious:`text-base`},ip=[`compact`,`comfortable`,`spacious`];function ap(e=`comfortable`,t){let[n,r]=(0,O.useState)(e),i=t?.rowHeights??tp,a=t?.paddingClasses??np,o=t?.fontSizeClasses??rp,s=(0,O.useRef)(t?.onChange);(0,O.useEffect)(()=>{s.current=t?.onChange},[t?.onChange]);let c=(0,O.useRef)(e);(0,O.useEffect)(()=>{e!==c.current&&(c.current=e,r(e))},[e]);let l=(0,O.useCallback)(e=>{r(t=>t===e?t:(queueMicrotask(()=>s.current?.(e)),e))},[]),u=(0,O.useCallback)(()=>{r(e=>{let t=ip[(ip.indexOf(e)+1)%ip.length];return queueMicrotask(()=>s.current?.(t)),t})},[]);return(0,O.useMemo)(()=>({mode:n,setMode:l,cycle:u,rowHeight:i[n],paddingClass:a[n],fontSizeClass:o[n]}),[n,l,u,i,a,o])}function op(e){return typeof window>`u`?()=>{}:(window.addEventListener(`online`,e),window.addEventListener(`offline`,e),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,e)})}function sp(){return typeof navigator<`u`?navigator.onLine:!0}function cp(){return!0}var lp=`objectui-offline-queue`;function up(){if(typeof localStorage>`u`)return[];try{let e=localStorage.getItem(lp);return e?JSON.parse(e):[]}catch{return[]}}function dp(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(lp,JSON.stringify(e))}catch{}}var fp=0;function pp(){return fp+=1,`mut_${Date.now()}_${fp}`}var mp={enabled:!0,strategy:`network_first`,offlineIndicator:!0,offlineMessage:`You are currently offline. Changes will be synced when reconnected.`,queueMaxSize:100};function hp(e={}){let{enabled:t=mp.enabled,strategy:n=mp.strategy,offlineIndicator:r=mp.offlineIndicator,offlineMessage:i=mp.offlineMessage,queueMaxSize:a=mp.queueMaxSize,sync:o}=e,s=(0,O.useSyncExternalStore)(op,sp,cp),[c,l]=(0,O.useState)(up),[u,d]=(0,O.useState)(`idle`),f=(0,O.useRef)(o);(0,O.useInsertionEffect)(()=>{f.current=o});let p=(0,O.useRef)(c);(0,O.useInsertionEffect)(()=>{p.current=c}),(0,O.useEffect)(()=>{dp(c)},[c]),(0,O.useEffect)(()=>{t&&(s?u===`offline`&&d(`idle`):d(`offline`))},[s,t,u]);let m=(0,O.useCallback)(e=>{t&&l(t=>{let n={...e,id:pp(),timestamp:Date.now()},r=[...t,n];return r.length>a?r.slice(r.length-a):r})},[t,a]),h=(0,O.useCallback)(()=>{l([])},[]),g=(0,O.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,O.useEffect)(()=>{if(!t||!s||!_)return;let e=setTimeout(()=>{g()},100);return()=>clearTimeout(e)},[s,t,_,g]),(0,O.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 gp(){return{canUndo:H.canUndo,canRedo:H.canRedo,undoDescription:H.peekUndo()?.description,redoDescription:H.peekRedo()?.description,history:H.getHistory()}}function _p(){return{canUndo:!1,canRedo:!1,undoDescription:void 0,redoDescription:void 0,history:[]}}var vp=gp();function yp(e){return H.subscribe(()=>{vp=gp(),e()})}function bp(){return vp}async function xp(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 Sp(e){let t=H.popUndo();t&&(await xp(e,t,t.undoData,`undo`),e.current.onUndo?.(t))}async function Cp(e){let t=H.popRedo();t&&(await xp(e,t,t.redoData,`redo`),e.current.onRedo?.(t))}var wp=new Set;function Tp(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 Ep(e){if(!(e.ctrlKey||e.metaKey)||e.key.toLowerCase()!==`z`||Tp(e.target))return;let t=wp.values().next().value;t&&(e.preventDefault(),e.shiftKey?Cp(t):Sp(t))}function Dp(e){return wp.add(e),wp.size===1&&window.addEventListener(`keydown`,Ep),()=>{wp.delete(e),wp.size===0&&window.removeEventListener(`keydown`,Ep)}}function Op(e={}){let t=(0,O.useRef)(e);(0,O.useInsertionEffect)(()=>{t.current=e});let n=(0,O.useSyncExternalStore)(yp,bp,_p),r=(0,O.useCallback)(()=>Sp(t),[]),i=(0,O.useCallback)(()=>Cp(t),[]);return(0,O.useEffect)(()=>Dp(t),[]),(0,O.useMemo)(()=>({...n,undo:r,redo:i}),[n,r,i])}function kp(e={}){let{actions:t=[],context:n={}}=e,r=(0,O.useContext)(uf)?.runner??null,i=Y().current_user,a=i===void 0?``:JSON.stringify(i),o=Cn(i),s=(0,O.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,O.useCallback)(e=>s.getActionsForLocation(e),[s]),getBulkActions:(0,O.useCallback)(()=>s.getBulkActions(),[s]),executeAction:(0,O.useCallback)((e,t)=>s.executeAction(e,t),[s]),handleShortcut:(0,O.useCallback)(e=>s.handleShortcut(e),[s]),engine:s}}function Ap(){let{actionLabel:e,actionConfirm:t,actionSuccess:n,actionOutcome:r}=fe(),{language:i}=E();return(0,O.useMemo)(()=>((a,o,s)=>{if(!o||typeof o!=`object`)return o;let c=pe(o.label,i),l=typeof o.name==`string`&&o.name?o.name:void 0,u=c||l||s?.fallbackLabel||``;if(!l)return u===o.label?o:{...o,label:u};let d={...o,label:e(a,l,u)};o.confirmText!==void 0&&(d.confirmText=t(a,l,o.confirmText)),o.successMessage!==void 0&&(d.successMessage=n(a,l,pe(o.successMessage,i)));let f=o.outcomeMessages;if(Q(f)){let e={};for(let[t,n]of Object.entries(f)){let o=r(a,l,t,pe(n,i));o!==void 0&&(e[t]=o)}d.outcomeMessages=e}return d}),[e,t,n,r,i])}function jp(){let e=(0,O.useContext)(uf),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 Mp(){let e=jp();return(0,O.useCallback)(t=>!Array.isArray(t)||t.length===0||!Array.isArray(e)||t.every(t=>typeof t==`string`&&e.includes(t)),[e])}function Np(){let e=Y(),t=hu()?.data,{variables:n}=yu();return r=>Pd(r,e,t,n)}function Pp(e,t,n,r){let i=(0,O.useContext)(Z)?.apiFetch,a=r?.enabled??!0,[o,s]=(0,O.useState)(null),c=(n??[]).filter(Boolean),l=[a?`1`:`0`,e??``,c.join(`,`),JSON.stringify(t??null)].join(`|`);return(0,O.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 hc(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 Fp(e,t,n,r){let{fieldOptionLabel:i}=me(),a=Pp(e,t,n,r);return(0,O.useMemo)(()=>mc(a?.metaByPath,a?.relabel,i),[a,i])}function Ip(e,t){return!0}function Lp(e,t={}){let n=If(),[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(null);(0,O.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,O.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:Ip(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,O.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 Rp(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 zp(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=ti,fieldReadPolicy:d}=e,f=d?.isLoaded===!0,[p,m]=(0,O.useState)([]),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(void 0),y=(0,O.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,O.useMemo)(()=>y.map(e=>String(e?.name)).join(`|`),[y]),x=(0,O.useRef)(0),S=(0,O.useRef)(u),C=(0,O.useRef)(d);return(0,O.useEffect)(()=>{S.current=u,C.current=d}),(0,O.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,ml(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:Rp(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||Qt(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,ml(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:Rp(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 Vp(e,t){let[n,r]=(0,O.useState)(null);(0,O.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 Hp=new Set,Up=`objectui:related-changed`;function Wp(e){for(let t of Array.from(Hp))try{t(e)}catch{}typeof window<`u`&&window.dispatchEvent(new CustomEvent(Up,{detail:{objectName:e.objectName,recordId:e.recordId}}))}function Gp(e){return Hp.add(e),()=>Hp.delete(e)}function Kp(e,t,n){return e.objectName===`*`?!0:e.objectName===t?n===void 0||e.recordId===void 0||e.recordId===n:!1}function qp(e,t){let[n,r]=(0,O.useState)(0);return(0,O.useEffect)(()=>{if(e)return Gp(n=>{Kp(n,e,t)&&r(e=>e+1)})},[e,t]),n}function Jp(e){(0,O.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 Yp(e){return typeof e==`number`&&Number.isInteger(e)&&e>0}var Xp=(e,t,n,r,i)=>{if(e==null||Yp(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.`},Zp=(e,t,n)=>!t||Yp(n)?null:Ke(e,t.view,t.object,t),Qp=(e,t)=>t?Ke(e,t.view,t.object,t,`binding`):null,$p=(e,t)=>t===`pagination.pageSize`?e.pagination?.pageSize:e[t],em=(e,t,n,r)=>{if(n===`pagination.pageSize`){e.pagination={...t.pagination??{},pageSize:r};return}e[n]=r};function tm(e,t={},n){let r=$f(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}=O.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=!Yp(r.config?.limit),i=$p(n,c);(!e||!Yp(i))&&(em(u,n,c,t.limit),d=Xp(i,c,t.limit,n.type,t.object))}return c&&(f=Zp(r.view,r.config,$p(n,c)),p=Qp(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]);O.useEffect(()=>{d&&console.warn(d)},[d]),O.useEffect(()=>{f&&console.warn(f)},[f]),O.useEffect(()=>{p&&console.warn(p)},[p]);let h=r.filterRefusal??m;return O.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 nm({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 rm({testId:e,refusal:t}){let{t:n}=E();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 im({testId:e,property:t}){let{t:n}=E();return(0,X.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground my-2`,"data-testid":`${e}-no-object`,children:n(`view.noObject`,{property:t,defaultValue:`No object named: set {{property}} or dataSource.object.`})})}var am=(e,t)=>{let n=e?.[t];return typeof n==`string`&&n.trim().length>0};function om({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 sm(e){let t=O.useContext(Z);return(Re(e)?void 0:e)??t?.dataSource??void 0}function cm(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 lm({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 um({schema:e,mapping:t,dataSource:n,testId:r,errorTitle:i,requiresDataSource:a,noDataSourceMessage:o,requiresObject:s,children:c}){let l=tm(e,t,n),u=sm(n);if(a&&u==null)return(0,X.jsx)(lm,{testId:r,message:o});if(l.filterRefusal)return(0,X.jsx)(rm,{testId:r,refusal:l.filterRefusal});if(l.status===`missing`)return(0,X.jsx)(nm,{testId:r,title:i,message:l.error});if(l.status===`loading`)return(0,X.jsx)(om,{testId:r});let d=t?.object??`objectName`;return s&&d!==!1&&!am(l.schema,d)?(0,X.jsx)(im,{testId:r,property:d}):c(l.schema)}function dm(e,t){if(!e||typeof e!=`object`)return{};let n={},r=ce(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 fm(...e){for(let t of e)if(typeof t==`string`&&t.trim())return t;return null}function pm(e){let t=e,n=t&&typeof t==`object`?fm(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=fm(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 mm(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 hm(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=fm(t.field,t.name,t.path);if(!n)continue;let i=fm(t.message,t.error,t.code)??``;r.push({field:n,message:i})}return r.length>0?r:null}function gm(e){let t=e;if(!t||typeof t!=`object`)return!1;if((t.httpStatus??t.status??t.statusCode)===403)return!0;let n=fm(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 _m=new Set([`INVALID_FILTER`,`UNSUPPORTED_QUERY_PARAM`,`INVALID_QUERY`]);function vm(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||_m.has(r)?`rejected`:`network`}function ym({result:e}){let{t}=E();if(!e.truncated)return null;let n=e.rows.length,r=typeof e.total==`number`?t(`common.rowCeilingNote`,{shown:n,total:e.total,defaultValue:de.common.rowCeilingNote}):t(`common.rowCeilingNoteUnknownTotal`,{shown:n,defaultValue:de.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 bm=[{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 xm(e){return bm.filter(t=>t.sites[e]).map(e=>e.key)}export{Df as $,et as $i,to as $n,lr as $r,hl as $t,ap as A,Bt as Ai,hc as An,ri as Ar,au as At,zf as B,jt as Bi,As as Bn,Lr as Br,Wl as Bt,Pp as C,Xt as Ci,ac as Cn,Si as Cr,su as Ct,kp as D,Wt as Di,mc as Dn,yi as Dr,lu as Dt,Ap as E,Yt as Ei,Js as En,vi as Er,hu as Et,Yf as F,Rt as Fi,Bs as Fn,ti as Fr,Y as Ft,If as G,mt as Gi,is as Gn,Tr as Gr,jl as Gt,jf as H,yt as Hi,ds as Hn,Fr as Hr,Al as Ht,Gf as I,Pt as Ii,zs as In,Qr as Ir,nu as It,Af as J,pt as Ji,es as Jn,Sr as Jr,El as Jt,Lf as K,ft as Ki,os as Kn,Er as Kr,Ol as Kt,Kf as L,Mt as Li,Rs as Ln,I as Lr,Xl as Lt,$f as M,It as Mi,tc as Mn,Xr as Mr,Ql as Mt,Xf as N,Lt as Ni,Vs as Nn,Yr as Nr,tu as Nt,Op as O,Ut as Oi,pc as On,ui as Or,Z as Ot,Jf as P,Ft as Pi,Hs as Pn,Wr as Pr,$l as Pt,Cf as Q,k as Qi,Ao as Qn,pr as Qr,gl as Qt,Hf as R,Nt as Ri,Fs as Rn,Zr as Rr,Yl as Rt,Fp as S,$t as Si,ic as Sn,wi as Sr,yu as St,Mp as T,Gt as Ti,rc as Tn,R as Tr,cu as Tt,Nf as U,vt as Ui,fs as Un,kr as Ur,Bl as Ut,Bf as V,wt as Vi,ks as Vn,Ir as Vr,kl as Vt,Mf as W,_t as Wi,ss as Wn,Ar as Wr,Ul as Wt,Ef as X,ut as Xi,Fo as Xn,Cr as Xr,Dl as Xt,Sf as Y,lt as Yi,$o as Yn,wr as Yr,yl as Yt,wf as Z,st as Zi,jo as Zn,xr as Zr,_l as Zt,qp as _,on as _i,wc as _n,Qi as _r,sd as _t,hm as a,Fe as aa,tr as ai,Uc as an,qa as ar,cf as at,zp as b,sn as bi,_c as bn,Ci as br,vu as bt,dm as c,$n as ci,Bc as cn,Ra as cr,tf as ct,om as d,N as di,Pc as dn,aa as dr,Zd as dt,Re as ea,cr as ei,ml as en,no as er,Tf as et,cm as f,Pn as fi,jc as fn,ra as fr,Gd as ft,Gp as g,nn as gi,Dc as gn,Ji as gr,Hd as gt,Wp as h,hn as hi,Tc as hn,qi as hr,Rd as ht,mm as i,_e as ia,rr as ii,qc as in,Ka as ir,pf as it,ep as j,Vt as ji,sc as jn,ni as jr,iu as jt,hp as k,zt as ki,nc as kn,li as kr,ru as kt,nm as l,P as li,Fc as ln,Ca as lr,nf as lt,Kp as m,bn as mi,kc as mn,ia as mr,Ud as mt,ym as n,D as na,ar as ni,Zc as nn,Ya as nr,df as nt,pm as o,Ne as oa,Xn as oi,Hc as on,Ga as or,lf as ot,sm as p,Sn as pi,Mc as pn,na as pr,Kd as pt,kf as q,dt as qi,as as qn,Or as qr,vl as qt,vm as r,De as ra,ir as ri,Xc as rn,Ja as rr,ff as rt,gm as s,Pe as sa,Qn as si,Vc as sn,Fa as sr,of as st,xm as t,Ie as ta,sr as ti,pl as tn,Qa as tr,uf as tt,um as u,Fn as ui,Nc as un,Sa as ur,$d as ut,Jp as v,rn as vi,vc as vn,zi as vr,Q as vt,Np as w,Zt as wi,ec as wn,L as wr,mu as wt,Lp as x,Qt as xi,gc as xn,Ti as xr,xu as xt,Vp as y,cn as yi,yc as yn,B as yr,Su as yt,Uf as z,kt as zi,Ps as zn,Pr as zr,Kl as zt};