@objectstack/console 17.5.0 → 17.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/CHANGELOG.md +378 -0
  2. package/dist/.objectstack-injection.json +2 -2
  3. package/dist/.objectui-sha +1 -1
  4. package/dist/assets/{ActionResultDialog-CLdIyOW6.js → ActionResultDialog-4kHDGnT3.js} +3 -3
  5. package/dist/assets/{AiPendingActionsPage-OKYz66yR.js → AiPendingActionsPage-JjOddm0h.js} +1 -1
  6. package/dist/assets/{ApiConsolePage-CcrKovu8.js → ApiConsolePage-BgS26lbp.js} +1 -1
  7. package/dist/assets/AppDocsIndex-BDoH5ECM.js +1 -0
  8. package/dist/assets/{AppManagementPage-D_xz8cTZ.js → AppManagementPage-CCgKmNTj.js} +1 -1
  9. package/dist/assets/ApprovalsInboxPage-C6S1vk0X.js +1 -0
  10. package/dist/assets/AuditLogPage-v2dKXMuk.js +1 -0
  11. package/dist/assets/BookPage-DwFMcTSN.js +1 -0
  12. package/dist/assets/{ComponentNavView-BxsixSU9.js → ComponentNavView-B5g9c6fx.js} +1 -1
  13. package/dist/assets/{CreateViewDialog-xyKlpLEW.js → CreateViewDialog-D3l-tYHM.js} +1 -1
  14. package/dist/assets/DashboardView-BOcovpPd.js +1 -0
  15. package/dist/assets/DocPage-B6AkH5WI.js +1 -0
  16. package/dist/assets/{DocsIndex-B2zw_HAp.js → DocsIndex-DwW2QsYY.js} +1 -1
  17. package/dist/assets/{DocsLayout-DezZ8x7_.js → DocsLayout-D63StSgd.js} +1 -1
  18. package/dist/assets/DocsSlug-CP9fcabi.js +1 -0
  19. package/dist/assets/ExpressionProvider-CrL6jhVq.js +1 -0
  20. package/dist/assets/{FlowRunsPage-CvY3nJMF.js → FlowRunsPage-CxdaiUyk.js} +1 -1
  21. package/dist/assets/{IntegrationsPage-2leVkVDH.js → IntegrationsPage-DvG0x0Nb.js} +2 -2
  22. package/dist/assets/{InterfaceListPage-BdECC_i3.js → InterfaceListPage-C4wPYohR.js} +1 -1
  23. package/dist/assets/{MarketplaceInstalledPage-EPPHSitW.js → MarketplaceInstalledPage-B7KETQG2.js} +1 -1
  24. package/dist/assets/MarketplacePackagePage-CfgKDpNH.js +4 -0
  25. package/dist/assets/{MarketplacePage-BnQKykgv.js → MarketplacePage-DNEyU5AE.js} +1 -1
  26. package/dist/assets/{MetadataInspector-BWxLkr0O.js → MetadataInspector-EP0I3-Kq.js} +1 -1
  27. package/dist/assets/{ObjectDataPage-BIzp65Mo.js → ObjectDataPage-CykEm9MD.js} +1 -1
  28. package/dist/assets/PageView-C6u86tni.js +1 -0
  29. package/dist/assets/{ProfilePage-D2qGgxPK.js → ProfilePage-C3SjXMzi.js} +1 -1
  30. package/dist/assets/{PublicFormsPage-DlE6tck_.js → PublicFormsPage-D3uCTR-8.js} +1 -1
  31. package/dist/assets/RecordDetailView-DgR_zhP4.js +3 -0
  32. package/dist/assets/RecordFormPage-kiJI-ieF.js +1 -0
  33. package/dist/assets/ReportDefaultInspector-BIinF0EQ.js +1 -0
  34. package/dist/assets/{ReportView-GIdKJdOt.js → ReportView-BREO-ADE.js} +1 -1
  35. package/dist/assets/{RuntimeDraftBar-BbMdi3Kp.js → RuntimeDraftBar-BCWfd2yS.js} +1 -1
  36. package/dist/assets/SchemaForm-C4uMMZ13.js +3 -0
  37. package/dist/assets/SearchResultsPage-C6Hw_Lpn.js +1 -0
  38. package/dist/assets/{SettingsHub-BGKIj-Zq.js → SettingsHub-DP1mrzEN.js} +1 -1
  39. package/dist/assets/SettingsView-u7mc6pcc.js +1 -0
  40. package/dist/assets/{SkeletonDetail-C8fMI-Mu.js → SkeletonDetail-DIwlbHTr.js} +1 -1
  41. package/dist/assets/{af-BfSmLD34.js → af-DPUgkQl0.js} +1 -1
  42. package/dist/assets/ai-DPBykF2N.js +3 -0
  43. package/dist/assets/{app-shell-eager-leaves-CDVclng4.js → app-shell-eager-leaves-Cf2bM6uT.js} +1 -1
  44. package/dist/assets/{ar-B9ttrM75.js → ar-B-6GTIRU.js} +1 -1
  45. package/dist/assets/{ar-DZ-C1rn-cyl.js → ar-DZ-wEl298ti.js} +1 -1
  46. package/dist/assets/{ar-EG-BaDxKP_o.js → ar-EG-YBT90_S0.js} +1 -1
  47. package/dist/assets/{ar-MA-DbxNEcmd.js → ar-MA-3uT-EYh6.js} +1 -1
  48. package/dist/assets/{ar-SA-DeC5LXcX.js → ar-SA-SiQsjhhc.js} +1 -1
  49. package/dist/assets/{ar-TN-C9KpTFJz.js → ar-TN-CfzXjKzS.js} +1 -1
  50. package/dist/assets/{az-cMerDwRO.js → az-BqAfcNza.js} +1 -1
  51. package/dist/assets/{be-ZTSbszQh.js → be-CQgWXa9_.js} +1 -1
  52. package/dist/assets/{be-tarask-BXZEUrgX.js → be-tarask-BmNg0Sir.js} +1 -1
  53. package/dist/assets/{bg-BDogpmn5.js → bg-D3evgRuS.js} +1 -1
  54. package/dist/assets/{bn-Cz04uxmh.js → bn-uItkARwm.js} +1 -1
  55. package/dist/assets/{bs-CpFnCl-j.js → bs-DueReOpO.js} +1 -1
  56. package/dist/assets/{ca-CHC4M52Z.js → ca-Cr3AHktR.js} +1 -1
  57. package/dist/assets/{ckb-Dxw-RNm8.js → ckb-CTi5BET7.js} +1 -1
  58. package/dist/assets/contracts-DieHW666.js +1 -0
  59. package/dist/assets/{createDerive-DvA_JGNq.js → createDerive-CjN1i5vn.js} +1 -1
  60. package/dist/assets/{cs-DsFaJ5Z7.js → cs-43mFX9jr.js} +1 -1
  61. package/dist/assets/{cy-FH4JFDTs.js → cy-BBSkg3F8.js} +1 -1
  62. package/dist/assets/{da-D1pVjaAq.js → da-C5oA5qcs.js} +1 -1
  63. package/dist/assets/data-adapter-Cymvlczj.js +1 -0
  64. package/dist/assets/{de-AT-DUMQCisj.js → de-AT-CApxwJzu.js} +1 -1
  65. package/dist/assets/{de-DKrxSvnP.js → de-CPtbLlAf.js} +1 -1
  66. package/dist/assets/default-inspector-registry-Bs6GBn00.js +1 -0
  67. package/dist/assets/dist-BF-ssUpn.js +14 -0
  68. package/dist/assets/{el-l3-bHySV.js → el-Dto2xBQU.js} +1 -1
  69. package/dist/assets/en-AU-FVwCiDJO.js +1 -0
  70. package/dist/assets/{en-CA-DGH5NF0a.js → en-CA-DKuJPN1U.js} +1 -1
  71. package/dist/assets/en-GB-DQ_y5VbJ.js +1 -0
  72. package/dist/assets/en-IE-DaXOhsZW.js +1 -0
  73. package/dist/assets/en-IN-CnRZnAom.js +1 -0
  74. package/dist/assets/en-NZ-CBZLEToK.js +1 -0
  75. package/dist/assets/en-ZA-BE59v0wZ.js +1 -0
  76. package/dist/assets/{eo-CL6CXHZx.js → eo-BL8JXIWd.js} +1 -1
  77. package/dist/assets/{es-BIJ0rksI.js → es-BnoaNxsu.js} +1 -1
  78. package/dist/assets/{et-BGgMzjm1.js → et-tPYLNenO.js} +1 -1
  79. package/dist/assets/{eu-CqvAoRrX.js → eu-CUBG6bT0.js} +1 -1
  80. package/dist/assets/{fa-IR-DNz3oA1-.js → fa-IR-Rr2d9xSs.js} +1 -1
  81. package/dist/assets/{fi-DNSfKWuW.js → fi-B0NVIZsV.js} +1 -1
  82. package/dist/assets/{formatLong-CHb9WA3O.js → formatLong-1-gt9bpo.js} +1 -1
  83. package/dist/assets/{fr-DYRJCirJ.js → fr-BbhHek8e.js} +1 -1
  84. package/dist/assets/{fr-CA-CotiswPx.js → fr-CA-CBDvLXFg.js} +1 -1
  85. package/dist/assets/{fr-CH-CpiEYWpc.js → fr-CH-WPNmwPn7.js} +1 -1
  86. package/dist/assets/framework-DFR4HNtj.js +35 -0
  87. package/dist/assets/{fy-B69yM3FE.js → fy-DvOBbvEF.js} +1 -1
  88. package/dist/assets/{gd-BAy8AsX6.js → gd-BQPiTPX5.js} +1 -1
  89. package/dist/assets/getIcon-Cfwf-Egt.js +1 -0
  90. package/dist/assets/{gl-soLn_weL.js → gl-BJCXK8uO.js} +1 -1
  91. package/dist/assets/{gu-B19Yo9yC.js → gu-CctPRz3V.js} +1 -1
  92. package/dist/assets/{he-DYTPo33p.js → he-CVFMk6p2.js} +1 -1
  93. package/dist/assets/{hi-D2dIK7Oy.js → hi-Ba30-RwS.js} +1 -1
  94. package/dist/assets/{highlighted-body-OFNGDK62-CExufvVt.js → highlighted-body-OFNGDK62-BQ57IrBV.js} +1 -1
  95. package/dist/assets/{hr-BV-VOPMu.js → hr-BZUqTbZs.js} +1 -1
  96. package/dist/assets/{ht-C7MM4qkS.js → ht-BLe05tPx.js} +1 -1
  97. package/dist/assets/{hu-Rha1m2Ym.js → hu-2CQ_Mkww.js} +1 -1
  98. package/dist/assets/{hy-CiTNgbdV.js → hy-CclcPG4H.js} +1 -1
  99. package/dist/assets/i18n-BnUsCaSC.js +17 -0
  100. package/dist/assets/i18n-locale-ar-92O_xtDZ.js +4 -0
  101. package/dist/assets/i18n-locale-de-T5ic3yH9.js +4 -0
  102. package/dist/assets/i18n-locale-en-rxr7WJYl.js +4 -0
  103. package/dist/assets/i18n-locale-es-D_WOifJ_.js +4 -0
  104. package/dist/assets/i18n-locale-fr-3cvyjMkp.js +4 -0
  105. package/dist/assets/i18n-locale-ja-DXlIkB8I.js +4 -0
  106. package/dist/assets/i18n-locale-ko-DngRpS45.js +4 -0
  107. package/dist/assets/i18n-locale-pt-BkPaFCqZ.js +4 -0
  108. package/dist/assets/i18n-locale-ru-E5wLh-y6.js +4 -0
  109. package/dist/assets/i18n-locale-zh-BL4_Yand.js +4 -0
  110. package/dist/assets/{i18n-runtime-CTgAQF4N.js → i18n-runtime-97_bDVjP.js} +1 -1
  111. package/dist/assets/{id-Cijsfjt-.js → id-6JLB8s-f.js} +1 -1
  112. package/dist/assets/index-Cadlh4t_.css +2 -0
  113. package/dist/assets/index-D98sa5GF.js +20 -0
  114. package/dist/assets/{infrastructure-BHSync5f.js → infrastructure-Cc34lEqb.js} +2 -2
  115. package/dist/assets/integration-CeAF4JFT.js +1 -0
  116. package/dist/assets/{is-xS1WTyeC.js → is-to0CWzm1.js} +1 -1
  117. package/dist/assets/isSameWeek-DBXaA1Gd.js +1 -0
  118. package/dist/assets/{it-CH-l516ZNXj.js → it-CH-DhdfjP5Z.js} +1 -1
  119. package/dist/assets/{it-C2i_c9sd.js → it-ea0B8Ujp.js} +1 -1
  120. package/dist/assets/{ja-D9_ewLny.js → ja-B1bzkgDW.js} +1 -1
  121. package/dist/assets/{ja-Hira-D_6ExgHw.js → ja-Hira-CMrY5hXO.js} +1 -1
  122. package/dist/assets/{ka-BYHGyees.js → ka-DKSXLnXP.js} +1 -1
  123. package/dist/assets/{kk-CbTFtuqb.js → kk-DHwMv8Dn.js} +1 -1
  124. package/dist/assets/{km-Dr2gwhIn.js → km-tpLG1xNr.js} +1 -1
  125. package/dist/assets/{kn-CprH8JD7.js → kn-MLreVnHA.js} +1 -1
  126. package/dist/assets/{ko-CsFS2u5i.js → ko-CI0DBazn.js} +1 -1
  127. package/dist/assets/{lb-CbFKN7Ob.js → lb-CmL572Xe.js} +1 -1
  128. package/dist/assets/{lt-Bq0xkLp0.js → lt-DRtUOLdw.js} +1 -1
  129. package/dist/assets/{lv-Cj6vg6Qo.js → lv-COSHgkOP.js} +1 -1
  130. package/dist/assets/{match-C_jFGO9e.js → match-B-ergJQb.js} +1 -1
  131. package/dist/assets/{match-CiPp9BME.js → match-BQoOW8Cj.js} +1 -1
  132. package/dist/assets/{match-Co4ivumx.js → match-dfBS0YSQ.js} +1 -1
  133. package/dist/assets/mermaid-GHXKKRXX-Bb17TtNP.js +1 -0
  134. package/dist/assets/metadata-admin-CABUxbJl.js +9 -0
  135. package/dist/assets/{mk-MXFM99YL.js → mk-B0IH_YL_.js} +1 -1
  136. package/dist/assets/{mn-D5Q9B6Jt.js → mn-P-QdQ2n3.js} +1 -1
  137. package/dist/assets/{ms-CCzPRldx.js → ms-CtyEOINy.js} +1 -1
  138. package/dist/assets/{mt-mjJpN6xW.js → mt-DfuZ2HRm.js} +1 -1
  139. package/dist/assets/{nb-BIlNqdEb.js → nb-2Hp-5Tnt.js} +1 -1
  140. package/dist/assets/{nl-BE-FwXjQsmV.js → nl-BE-mmxbfNoR.js} +1 -1
  141. package/dist/assets/{nl-D2uBtIxG.js → nl-CZ_nLREz.js} +1 -1
  142. package/dist/assets/{nn-B0loJ7SV.js → nn-ccWhYsNa.js} +1 -1
  143. package/dist/assets/{oc-U7-yH1sO.js → oc-z504BFRV.js} +1 -1
  144. package/dist/assets/{pl-mTy0JYgi.js → pl-DeQ7ASt-.js} +1 -1
  145. package/dist/assets/plugin-calendar-Cn5HaZU8.js +1 -0
  146. package/dist/assets/plugin-charts-B6RcFWbo.js +7 -0
  147. package/dist/assets/plugin-chatbot-Ck47EhDX.js +122 -0
  148. package/dist/assets/plugin-dashboard-DjEx8e5Y.js +6 -0
  149. package/dist/assets/plugin-form-CLDvL0up.js +1 -0
  150. package/dist/assets/plugin-gantt-CrVrxVdi.js +63 -0
  151. package/dist/assets/plugin-grid-D2rmQEW_.js +11 -0
  152. package/dist/assets/plugin-kanban-BUNHFfIC.js +1 -0
  153. package/dist/assets/plugin-map-y-7RQQC5.js +1 -0
  154. package/dist/assets/{plugin-markdown-D1nTQc1T.js → plugin-markdown-BOkHcir_.js} +1 -1
  155. package/dist/assets/plugin-report-mT3jpna0.js +59 -0
  156. package/dist/assets/plugin-timeline-B1EF83D3.js +1 -0
  157. package/dist/assets/plugin-tree-MTHUt3_S.js +1 -0
  158. package/dist/assets/plugin-view-DHJI-ahf.js +1 -0
  159. package/dist/assets/plugins-views-CfkgqD30.js +3 -0
  160. package/dist/assets/{pt-BR-2KtO5Js1.js → pt-BR-D80_lPYF.js} +1 -1
  161. package/dist/assets/{pt-Bet5OOQf.js → pt-CJJ1RmXd.js} +1 -1
  162. package/dist/assets/{ro-37U6sgzi.js → ro-EuFb2TCj.js} +1 -1
  163. package/dist/assets/{ru-CyuAY-5E.js → ru-CMaVQScp.js} +1 -1
  164. package/dist/assets/{runtime-metadata-persistence-afAW-MeD.js → runtime-metadata-persistence-ClOTznqa.js} +1 -1
  165. package/dist/assets/{se-DeJabuC6.js → se-DsfdKLdF.js} +1 -1
  166. package/dist/assets/{sk-DWEpjfkR.js → sk-BNV9omI8.js} +1 -1
  167. package/dist/assets/{sl-4oSvNhIR.js → sl-DJS_nINU.js} +1 -1
  168. package/dist/assets/{sq-BjkBCaXW.js → sq-HEgjcbHe.js} +1 -1
  169. package/dist/assets/{sr-Dxm1DsRS.js → sr-CO0CFu4X.js} +1 -1
  170. package/dist/assets/{sr-Latn-Dawg6oP2.js → sr-Latn-eE1Idzey.js} +1 -1
  171. package/dist/assets/{src-C8NYjdVm.js → src-BU7L2v4J.js} +1 -1
  172. package/dist/assets/src-BUtIBFDA.js +1 -0
  173. package/dist/assets/src-C0eXlKtx.js +16 -0
  174. package/dist/assets/{studioEntry-nXQP3iL0.js → studioEntry-WeMfaSGn.js} +1 -1
  175. package/dist/assets/{submitRedirect-jK-cEIbP.js → submitRedirect-C2lfZSHt.js} +1 -1
  176. package/dist/assets/{sv-CROOGJGz.js → sv-5uTzgQT3.js} +1 -1
  177. package/dist/assets/{ta-BZnTmFI_.js → ta-BzgdkBZG.js} +1 -1
  178. package/dist/assets/{te-BN0v0x5t.js → te-Ct_pl7ZJ.js} +1 -1
  179. package/dist/assets/{th-CBjKhp_U.js → th-DouAlk0-.js} +1 -1
  180. package/dist/assets/{tr-x0Ne4N4H.js → tr-3XNBsI40.js} +1 -1
  181. package/dist/assets/types-zod-DXpXw10W.js +1 -0
  182. package/dist/assets/{ug-sgzNhsKo.js → ug-B9n24h9G.js} +1 -1
  183. package/dist/assets/ui-components-D6cEVg0T.js +37 -0
  184. package/dist/assets/ui-layout-DgVDuPEM.js +1 -0
  185. package/dist/assets/{uk-o_DQ5VHJ.js → uk-DCAenByf.js} +1 -1
  186. package/dist/assets/use-book-data-CwRldFxP.js +1 -0
  187. package/dist/assets/{useActionModal-CSvbHkQ7.js → useActionModal-Blp4rhOk.js} +1 -1
  188. package/dist/assets/useCanAuthorMetadata-BxCMgFRf.js +1 -0
  189. package/dist/assets/useNavSelDeepLink-67Y4qCNO.js +1 -0
  190. package/dist/assets/useNavTargetLabel-BOJncjIb.js +1 -0
  191. package/dist/assets/{useOpenRecordList-B5-qaFUx.js → useOpenRecordList-BrwJFojQ.js} +1 -1
  192. package/dist/assets/{usePackageL10n-CMx66am-.js → usePackageL10n-Ci9uVkRZ.js} +1 -1
  193. package/dist/assets/{useSettingsLabel-Kkr2q0Oo.js → useSettingsLabel-CeMnMWsh.js} +1 -1
  194. package/dist/assets/{uz-Cyrl-DbtkQtz_.js → uz-Cyrl-JSeHEqu-.js} +1 -1
  195. package/dist/assets/{uz-Be41d4jl.js → uz-DT3s9bZS.js} +1 -1
  196. package/dist/assets/vendor-objectstack-DFqu45yM.js +138 -0
  197. package/dist/assets/{vi-84mZmklk.js → vi-D2p-h6bY.js} +1 -1
  198. package/dist/assets/{zh-CN-DD1reegJ.js → zh-CN-DHOKqAit.js} +1 -1
  199. package/dist/assets/{zh-HK-B05u30WI.js → zh-HK-D4iIPY7I.js} +1 -1
  200. package/dist/assets/{zh-TW-Bb-WimPD.js → zh-TW-gORQ_tZh.js} +1 -1
  201. package/dist/chunk-membership.json +100 -90
  202. package/dist/eager-closure.json +110 -110
  203. package/dist/index.html +4 -4
  204. package/dist/sdui.manifest.json +520 -60
  205. package/package.json +1 -1
  206. package/dist/assets/AppDocsIndex-F4zDq2zz.js +0 -1
  207. package/dist/assets/ApprovalsInboxPage-DrEUmaDb.js +0 -1
  208. package/dist/assets/AuditLogPage-CoghqsZb.js +0 -1
  209. package/dist/assets/DashboardView-CGC-_Om8.js +0 -1
  210. package/dist/assets/DocPage-CIZE5kdj.js +0 -1
  211. package/dist/assets/DocsSlug-DXdFdwlS.js +0 -1
  212. package/dist/assets/ExpressionProvider-DZfMwyMs.js +0 -1
  213. package/dist/assets/MarketplacePackagePage-C7NOu2Ir.js +0 -4
  214. package/dist/assets/PageView-CVLgCRSF.js +0 -1
  215. package/dist/assets/RecordDetailView-DQKydU7X.js +0 -3
  216. package/dist/assets/RecordFormPage-BTjwxJIA.js +0 -1
  217. package/dist/assets/ReportDefaultInspector-DdsQAkd7.js +0 -1
  218. package/dist/assets/SchemaForm-C8X1ve4p.js +0 -3
  219. package/dist/assets/SearchResultsPage-Jwhqsdyo.js +0 -1
  220. package/dist/assets/SettingsView-D8SMKdrc.js +0 -1
  221. package/dist/assets/appRoute-DbnWDEa1.js +0 -1
  222. package/dist/assets/data-adapter-DMbe6Njk.js +0 -1
  223. package/dist/assets/default-inspector-registry-CpL3fFhl.js +0 -1
  224. package/dist/assets/dist-BXrEV1ag.js +0 -13
  225. package/dist/assets/en-AU-C6x7mDhH.js +0 -1
  226. package/dist/assets/en-GB-0-nho2eK.js +0 -1
  227. package/dist/assets/en-IE-2fC3BkfV.js +0 -1
  228. package/dist/assets/en-IN-C1QcFhxn.js +0 -1
  229. package/dist/assets/en-NZ-C80ptZT7.js +0 -1
  230. package/dist/assets/en-ZA-ByZDrjeb.js +0 -1
  231. package/dist/assets/framework-DcWkeiND.js +0 -35
  232. package/dist/assets/getIcon-BEVyC4y3.js +0 -1
  233. package/dist/assets/i18n-CEKxYdmD.js +0 -9
  234. package/dist/assets/i18n-locale-ar-DN7sl3GF.js +0 -4
  235. package/dist/assets/i18n-locale-de-C40JErvb.js +0 -4
  236. package/dist/assets/i18n-locale-en-CITPDIHy.js +0 -4
  237. package/dist/assets/i18n-locale-es-C8DdWN6c.js +0 -4
  238. package/dist/assets/i18n-locale-fr-COIdEZZl.js +0 -4
  239. package/dist/assets/i18n-locale-ja-DYF_rU_s.js +0 -4
  240. package/dist/assets/i18n-locale-ko-B-ODYAtX.js +0 -4
  241. package/dist/assets/i18n-locale-pt-CK1SyBIm.js +0 -4
  242. package/dist/assets/i18n-locale-ru-jLzvShMO.js +0 -4
  243. package/dist/assets/i18n-locale-zh-Bf9Gbbvl.js +0 -4
  244. package/dist/assets/index-CLyvpiGc.css +0 -2
  245. package/dist/assets/index-CfnfGw5W.js +0 -20
  246. package/dist/assets/isSameWeek-DWYeNyh8.js +0 -1
  247. package/dist/assets/mermaid-GHXKKRXX-DVLc_uym.js +0 -1
  248. package/dist/assets/metadata-admin-CybaOCdO.js +0 -9
  249. package/dist/assets/nav-selection-Dzm_mA3C.js +0 -1
  250. package/dist/assets/plugin-calendar-CKRBcML7.js +0 -1
  251. package/dist/assets/plugin-charts-DGTJxXCB.js +0 -7
  252. package/dist/assets/plugin-chatbot-DwtwNA-y.js +0 -122
  253. package/dist/assets/plugin-dashboard-C1AYKmGX.js +0 -6
  254. package/dist/assets/plugin-form-CV8ZY04-.js +0 -1
  255. package/dist/assets/plugin-gantt-BRIb2_8G.js +0 -63
  256. package/dist/assets/plugin-grid-C9h7mRVv.js +0 -11
  257. package/dist/assets/plugin-kanban-BcJ0Dhys.js +0 -1
  258. package/dist/assets/plugin-map-D24ZUOUj.js +0 -1
  259. package/dist/assets/plugin-report-BfGintAq.js +0 -59
  260. package/dist/assets/plugin-timeline-CbBRq_qt.js +0 -1
  261. package/dist/assets/plugin-tree-BNX2A5J5.js +0 -1
  262. package/dist/assets/plugin-view-DzWQWYyH.js +0 -1
  263. package/dist/assets/plugins-views-DraK4xz0.js +0 -3
  264. package/dist/assets/src-B8lv0plz.js +0 -18
  265. package/dist/assets/src-DoDvT77T.js +0 -1
  266. package/dist/assets/types-zod-Y2RwUUeJ.js +0 -1
  267. package/dist/assets/ui-components-BTB1NkUW.js +0 -37
  268. package/dist/assets/ui-layout-bZfafwJa.js +0 -1
  269. package/dist/assets/use-book-data-C3eyZJSG.js +0 -1
  270. package/dist/assets/vendor-objectstack-XuWC71M9.js +0 -266
  271. package/dist/assets/vendor-zod-CHLW1iCr.js +0 -64
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{Ar as r,Mr as i,Nr as a,Pr as o,bi as s,jr as c,kr as l,qn as u,vi as d}from"./ui-components-BTB1NkUW.js";import{w as f}from"./i18n-runtime-CTgAQF4N.js";import{t as p}from"./vendor-icon-calendar-BsoUBIef.js";import{t as m}from"./vendor-icon-chart-column-DicJIApF.js";import{t as ee}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as h}from"./vendor-icon-clock-CTLnah0r.js";import{t as g}from"./vendor-icon-image-D2YAsa8l.js";import{t as _}from"./vendor-icon-layout-grid-B3quJ1GF.js";import{t as v}from"./vendor-icon-list-tree-Br55vyL9.js";import{t as y}from"./vendor-icon-map-DsFP3Vmp.js";import{t as b}from"./vendor-icon-square-chart-gantt-D3I-7xgm.js";import{t as x}from"./vendor-icon-square-kanban-ZFRnbY0T.js";import{n as S}from"./createDerive-DvA_JGNq.js";import{a as C,i as w,n as T,o as E,r as D,s as O,t as k}from"./plugin-view-DzWQWYyH.js";var A=e(n(),1),j=t();function M({title:e,subtitle:t,icon:n,actions:r,accentColor:i,sticky:a=!1,className:o,"data-testid":c}){return(0,j.jsxs)(`div`,{style:{"--page-header-accent":i||`hsl(var(--primary))`},className:s(`relative shrink-0 border-b bg-background z-10`,a&&`sticky top-0 bg-background/85 backdrop-blur supports-[backdrop-filter]:bg-background/75`,o),"data-testid":c??`page-header`,children:[(0,j.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 top-0 h-[2px] opacity-80`,style:{background:`linear-gradient(90deg, transparent, var(--page-header-accent), transparent)`}}),(0,j.jsxs)(`div`,{className:`flex justify-between items-center gap-3 py-2.5 sm:py-3 px-4 sm:px-6`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[n&&(0,j.jsx)(`div`,{className:s(`shrink-0 inline-flex items-center justify-center rounded-lg`,`h-9 w-9 sm:h-10 sm:w-10`,`[&_svg]:h-[18px] [&_svg]:w-[18px] sm:[&_svg]:h-5 sm:[&_svg]:w-5`),style:{color:`var(--page-header-accent)`,background:`linear-gradient(135deg, color-mix(in srgb, var(--page-header-accent) 18%, transparent), color-mix(in srgb, var(--page-header-accent) 6%, transparent))`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, var(--page-header-accent) 22%, transparent)`},children:n}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`h1`,{className:`text-base sm:text-lg lg:text-xl font-semibold tracking-tight text-foreground truncate leading-tight`,children:e}),t&&(0,j.jsx)(`p`,{className:`text-xs sm:text-sm text-muted-foreground truncate hidden sm:block max-w-xl mt-0.5`,children:t})]})]}),r&&(0,j.jsx)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 shrink-0`,children:r})]})]})}function te(e){let t={grid:{icon:_,label:e(`console.objectView.viewTypeGrid`),description:e(`console.objectView.viewTypeGridDesc`)},kanban:{icon:x,label:e(`console.objectView.viewTypeKanban`),description:e(`console.objectView.viewTypeKanbanDesc`)},calendar:{icon:p,label:e(`console.objectView.viewTypeCalendar`),description:e(`console.objectView.viewTypeCalendarDesc`)},gallery:{icon:g,label:e(`console.objectView.viewTypeGallery`),description:e(`console.objectView.viewTypeGalleryDesc`)},timeline:{icon:h,label:e(`console.objectView.viewTypeTimeline`),description:e(`console.objectView.viewTypeTimelineDesc`)},gantt:{icon:b,label:e(`console.objectView.viewTypeGantt`),description:e(`console.objectView.viewTypeGanttDesc`)},map:{icon:y,label:e(`console.objectView.viewTypeMap`),description:e(`console.objectView.viewTypeMapDesc`)},chart:{icon:m,label:e(`console.objectView.viewTypeChart`),description:e(`console.objectView.viewTypeChartDesc`)},tree:{icon:v,label:e(`console.objectView.viewTypeTree`),description:e(`console.objectView.viewTypeTreeDesc`)}};return Object.entries(t).map(([e,t])=>({type:e,...t}))}function N(e,t){for(let n=1;n<1e3;n++){let r=`${e} ${n}`;if(!t.has(r))return r}return e}var P={kanban:[{key:`groupByField`,i18nKey:`console.objectView.groupByField`,helpI18nKey:`console.objectView.groupByFieldHelp`,filter:e=>e.type===`select`||e.type===`boolean`,preferred:T}],calendar:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.startDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],timeline:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.timelineDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],gantt:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.ganttStartDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`endDateField`,i18nKey:`console.objectView.endDateField`,helpI18nKey:`console.objectView.ganttEndDateFieldHelp`,filter:e=>e.type===`date`,preferred:k},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],gallery:[{key:`coverField`,i18nKey:`console.objectView.imageField`,helpI18nKey:`console.objectView.imageFieldHelp`,filter:e=>E(e)}],map:[{key:`latitudeField`,i18nKey:`console.objectView.latitudeField`,helpI18nKey:`console.objectView.latitudeFieldHelp`,filter:e=>e.type===`number`&&C(e,`latitude`)},{key:`longitudeField`,i18nKey:`console.objectView.longitudeField`,helpI18nKey:`console.objectView.longitudeFieldHelp`,filter:e=>e.type===`number`&&C(e,`longitude`)}],chart:[{key:`chartType`,i18nKey:`console.objectView.chartType`,helpI18nKey:`console.objectView.chartTypeHelp`,kind:`enum`,enumOptions:[{value:`bar`,i18nKey:`console.objectView.chartTypeBar`},{value:`line`,i18nKey:`console.objectView.chartTypeLine`},{value:`pie`,i18nKey:`console.objectView.chartTypePie`},{value:`area`,i18nKey:`console.objectView.chartTypeArea`},{value:`scatter`,i18nKey:`console.objectView.chartTypeScatter`}],defaultValue:`bar`},{key:`xAxisField`,i18nKey:`console.objectView.xAxisField`,helpI18nKey:`console.objectView.xAxisFieldHelp`,filter:e=>e.type===`select`||e.type===`boolean`||e.type===`date`||e.type===`text`,preferred:T},{key:`yAxisFields`,i18nKey:`console.objectView.yAxisField`,helpI18nKey:`console.objectView.yAxisFieldHelp`,filter:e=>e.type===`number`}],tree:[{key:`parentField`,i18nKey:`console.objectView.parentField`,helpI18nKey:`console.objectView.parentFieldHelp`,filter:e=>e.rawType===`tree`||e.rawType===`lookup`||e.rawType===`master_detail`}]};function F({open:e,onOpenChange:t,onCreate:n,existingLabels:p,availableTypes:m,objectDef:h}){let{t:g}=f(),_=(0,A.useMemo)(()=>te(g),[g]),v=(0,A.useMemo)(()=>m&&m.length>0?_.filter(e=>m.includes(e.type)):_,[_,m]),y=(p??[]).join(`\0`),b=(0,A.useMemo)(()=>new Set(p??[]),[y]),x=(0,A.useMemo)(()=>h?w(h):[],[h]),[C,T]=(0,A.useState)(v[0]?.type??`grid`),[E,D]=(0,A.useState)(``),[k,M]=(0,A.useState)(!1),[F,I]=(0,A.useState)(``),[L,R]=(0,A.useState)(!1),[z,B]=(0,A.useState)({});(0,A.useEffect)(()=>{e&&(T(v[0]?.type??`grid`),M(!1),R(!1),B({}))},[e,v]),(0,A.useEffect)(()=>{if(!k){let e=v.find(e=>e.type===C);D(N(e?.label??`View`,b))}},[C,k,v,b]),(0,A.useEffect)(()=>{L||I(S(E))},[E,L]);let V=P[C]??[],ne=e=>e.kind===`enum`?(e.enumOptions?.length??0)>0:!h||(e.filter?x.filter(e.filter):x).length>0,H=(0,A.useMemo)(()=>{let e={};return v.forEach(t=>{let n=(P[t.type]??[]).find(e=>!ne(e));e[t.type]=n??null}),e},[v,x,h]),U=e=>z[`${C}.${e}`]??``,W=(e,t)=>B(n=>({...n,[`${C}.${e}`]:t})),G=E.trim(),K=G.length>0&&b.has(G),q=V.every(e=>U(e.key).length>0),J=/^[a-z_][a-z0-9_]*$/,Y=F.trim(),X=Y.length===0,Z=Y.length>0&&!J.test(Y),Q=G.length>0&&!K&&q&&!X&&!Z;(0,A.useEffect)(()=>{V.length!==0&&V.forEach(e=>{if(U(e.key).length>0)return;if(e.kind===`enum`){e.defaultValue&&W(e.key,e.defaultValue);return}let t=e.filter?x.filter(e.filter):x;if(t.length===0)return;if(t.length===1){W(e.key,t[0].value);return}let n=O(t,e.preferred??[]);n&&W(e.key,n)})},[C,x]);let $=()=>{if(!Q)return;let e={};V.forEach(t=>{let n=U(t.key);n&&(e[t.key]=t.key===`yAxisFields`?[n]:n)});let r={type:C,label:G,name:Y};Object.keys(e).length>0&&(r[C]=e),n(r),t(!1)};return(0,j.jsx)(l,{open:e,onOpenChange:t,children:(0,j.jsxs)(r,{className:`sm:max-w-[560px]`,"data-testid":`create-view-dialog`,children:[(0,j.jsxs)(a,{children:[(0,j.jsx)(o,{children:g(`console.objectView.createView`)}),(0,j.jsx)(c,{children:g(`console.objectView.createViewDesc`)})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-4 gap-2 py-2`,"data-testid":`create-view-type-grid`,children:v.map(({type:e,label:t,description:n,icon:r})=>{let i=e===C,a=H[e],o=!!a,c=o?g(`console.objectView.viewTypeUnavailable`,{field:g(a.i18nKey)}):void 0;return(0,j.jsxs)(`button`,{type:`button`,"data-testid":`create-view-type-${e}`,"aria-pressed":i,"aria-disabled":o,disabled:o,title:c,onClick:()=>{o||T(e)},className:s(`group flex flex-col items-start gap-1 rounded-lg border bg-background p-3 text-left transition-colors`,!o&&`hover:border-primary/60 hover:bg-accent/40`,i&&!o?`border-primary ring-2 ring-primary/30 bg-accent/40`:`border-border`,o&&`opacity-50 cursor-not-allowed`),children:[(0,j.jsx)(r,{className:s(`h-5 w-5`,i&&!o?`text-primary`:`text-muted-foreground group-hover:text-foreground`)}),(0,j.jsx)(`div`,{className:`text-xs font-medium leading-tight`,children:t}),(0,j.jsx)(`div`,{className:`text-[10px] leading-tight text-muted-foreground line-clamp-2`,children:o?g(`console.objectView.viewTypeUnavailableShort`):n})]},e)})}),V.length>0&&(0,j.jsx)(`div`,{className:`space-y-3 rounded-md border border-dashed bg-muted/30 p-3`,"data-testid":`create-view-required-fields`,children:V.map(e=>{let t=U(e.key),n=e.kind===`enum`,r=n?[]:e.filter?x.filter(e.filter):x,i=!n&&x.length>0&&r.length===0;return(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-required-${e.key}`,className:`text-xs font-medium`,children:[g(e.i18nKey),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,j.jsxs)(`select`,{id:`create-view-required-${e.key}`,"aria-required":`true`,"data-testid":`create-view-required-${e.key}`,value:t,onChange:t=>W(e.key,t.target.value),disabled:i,className:s(`h-9 w-full rounded-md border bg-background px-2 text-xs`,`border-input`),children:[(0,j.jsx)(`option`,{value:``,children:g(n?`console.objectView.selectOption`:`console.objectView.selectField`)}),n?e.enumOptions.map(e=>(0,j.jsx)(`option`,{value:e.value,children:g(e.i18nKey)},e.value)):r.map(e=>(0,j.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),e.helpI18nKey&&!i&&(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:g(e.helpI18nKey)}),i&&(0,j.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] text-destructive`,"data-testid":`create-view-error-no-field-${e.key}`,children:[(0,j.jsx)(ee,{className:`h-3 w-3`}),g(`console.objectView.noEligibleFieldForType`)]})]},e.key)})}),(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-name-input`,className:`text-xs font-medium`,children:[g(`console.objectView.title`),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,j.jsx)(u,{id:`create-view-name-input`,"aria-required":`true`,"data-testid":`create-view-name-input`,autoFocus:!0,value:E,onChange:e=>{D(e.target.value),M(!0)},onKeyDown:e=>{e.key===`Enter`&&Q&&$()},placeholder:g(`console.objectView.newView`),className:`h-9`}),K&&(0,j.jsx)(`p`,{className:`text-[11px] text-destructive`,"data-testid":`create-view-error-duplicate`,children:g(`console.objectView.duplicateViewName`)})]}),(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-machine-name-input`,className:`text-xs font-medium`,children:[g(`console.objectView.viewName`),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,j.jsx)(u,{id:`create-view-machine-name-input`,"aria-required":`true`,"data-testid":`create-view-machine-name-input`,value:F,onChange:e=>{I(e.target.value),R(!0)},onKeyDown:e=>{e.key===`Enter`&&Q&&$()},placeholder:`grid_1`,className:`h-9 font-mono`}),X?(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-testid":`create-view-machine-name-help`,children:g(`console.objectView.viewNameRequired`)}):Z?(0,j.jsx)(`p`,{className:`text-[11px] text-destructive`,"data-testid":`create-view-error-machine-name`,children:g(`console.objectView.viewNameInvalid`)}):(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-testid":`create-view-machine-name-help`,children:g(`console.objectView.viewNameHelp`)})]}),(0,j.jsxs)(i,{className:`mt-2`,children:[(0,j.jsx)(d,{type:`button`,variant:`outline`,onClick:()=>t(!1),"data-testid":`create-view-cancel`,children:g(`console.objectView.cancel`)}),(0,j.jsx)(d,{type:`button`,disabled:!Q,onClick:$,"data-testid":`create-view-submit`,children:g(`console.objectView.create`)})]})]})})}export{M as n,F as t};
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{Ar as r,Fr as i,Jn as a,Mr as o,Nr as s,Pr as c,jr as l,xi as u,yi as d}from"./ui-components-D6cEVg0T.js";import{w as f}from"./i18n-runtime-97_bDVjP.js";import{t as p}from"./vendor-icon-calendar-BsoUBIef.js";import{t as m}from"./vendor-icon-chart-column-DicJIApF.js";import{t as h}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as g}from"./vendor-icon-clock-CTLnah0r.js";import{t as _}from"./vendor-icon-image-D2YAsa8l.js";import{t as v}from"./vendor-icon-layout-grid-B3quJ1GF.js";import{t as y}from"./vendor-icon-list-tree-Br55vyL9.js";import{t as b}from"./vendor-icon-map-DsFP3Vmp.js";import{t as x}from"./vendor-icon-square-chart-gantt-D3I-7xgm.js";import{t as S}from"./vendor-icon-square-kanban-ZFRnbY0T.js";import{n as ee}from"./createDerive-CjN1i5vn.js";import{a as C,i as w,n as T,o as E,r as D,s as O,t as k}from"./plugin-view-DHJI-ahf.js";var A=e(n(),1),j=t();function M({title:e,subtitle:t,icon:n,actions:r,accentColor:i,sticky:a=!1,className:o,"data-testid":s}){return(0,j.jsxs)(`div`,{style:{"--page-header-accent":i||`hsl(var(--primary))`},className:u(`relative shrink-0 border-b bg-background z-10`,a&&`sticky top-0 bg-background/85 backdrop-blur supports-[backdrop-filter]:bg-background/75`,o),"data-testid":s??`page-header`,children:[(0,j.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 top-0 h-[2px] opacity-80`,style:{background:`linear-gradient(90deg, transparent, var(--page-header-accent), transparent)`}}),(0,j.jsxs)(`div`,{className:`flex justify-between items-center gap-3 py-2.5 sm:py-3 px-4 sm:px-6`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[n&&(0,j.jsx)(`div`,{className:u(`shrink-0 inline-flex items-center justify-center rounded-lg`,`h-9 w-9 sm:h-10 sm:w-10`,`[&_svg]:h-[18px] [&_svg]:w-[18px] sm:[&_svg]:h-5 sm:[&_svg]:w-5`),style:{color:`var(--page-header-accent)`,background:`linear-gradient(135deg, color-mix(in srgb, var(--page-header-accent) 18%, transparent), color-mix(in srgb, var(--page-header-accent) 6%, transparent))`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, var(--page-header-accent) 22%, transparent)`},children:n}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`h1`,{className:`text-base sm:text-lg lg:text-xl font-semibold tracking-tight text-foreground truncate leading-tight`,children:e}),t&&(0,j.jsx)(`p`,{className:`text-xs sm:text-sm text-muted-foreground truncate hidden sm:block max-w-xl mt-0.5`,children:t})]})]}),r&&(0,j.jsx)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 shrink-0`,children:r})]})]})}function te(e){let t={grid:{icon:v,label:e(`console.objectView.viewTypeGrid`),description:e(`console.objectView.viewTypeGridDesc`)},kanban:{icon:S,label:e(`console.objectView.viewTypeKanban`),description:e(`console.objectView.viewTypeKanbanDesc`)},calendar:{icon:p,label:e(`console.objectView.viewTypeCalendar`),description:e(`console.objectView.viewTypeCalendarDesc`)},gallery:{icon:_,label:e(`console.objectView.viewTypeGallery`),description:e(`console.objectView.viewTypeGalleryDesc`)},timeline:{icon:g,label:e(`console.objectView.viewTypeTimeline`),description:e(`console.objectView.viewTypeTimelineDesc`)},gantt:{icon:x,label:e(`console.objectView.viewTypeGantt`),description:e(`console.objectView.viewTypeGanttDesc`)},map:{icon:b,label:e(`console.objectView.viewTypeMap`),description:e(`console.objectView.viewTypeMapDesc`)},chart:{icon:m,label:e(`console.objectView.viewTypeChart`),description:e(`console.objectView.viewTypeChartDesc`)},tree:{icon:y,label:e(`console.objectView.viewTypeTree`),description:e(`console.objectView.viewTypeTreeDesc`)}};return Object.entries(t).map(([e,t])=>({type:e,...t}))}function N(e,t){for(let n=1;n<1e3;n++){let r=`${e} ${n}`;if(!t.has(r))return r}return e}var P={kanban:[{key:`groupByField`,i18nKey:`console.objectView.groupByField`,helpI18nKey:`console.objectView.groupByFieldHelp`,filter:e=>e.type===`select`||e.type===`boolean`,preferred:T}],calendar:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.startDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],timeline:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.timelineDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],gantt:[{key:`startDateField`,i18nKey:`console.objectView.startDateField`,helpI18nKey:`console.objectView.ganttStartDateFieldHelp`,filter:e=>e.type===`date`,preferred:D},{key:`endDateField`,i18nKey:`console.objectView.endDateField`,helpI18nKey:`console.objectView.ganttEndDateFieldHelp`,filter:e=>e.type===`date`,preferred:k},{key:`titleField`,i18nKey:`console.objectView.titleField`,helpI18nKey:`console.objectView.titleFieldHelp`,filter:e=>e.type===`text`}],gallery:[{key:`coverField`,i18nKey:`console.objectView.imageField`,helpI18nKey:`console.objectView.imageFieldHelp`,filter:e=>E(e)}],map:[{key:`latitudeField`,i18nKey:`console.objectView.latitudeField`,helpI18nKey:`console.objectView.latitudeFieldHelp`,filter:e=>e.type===`number`&&C(e,`latitude`)},{key:`longitudeField`,i18nKey:`console.objectView.longitudeField`,helpI18nKey:`console.objectView.longitudeFieldHelp`,filter:e=>e.type===`number`&&C(e,`longitude`)}],chart:[{key:`chartType`,i18nKey:`console.objectView.chartType`,helpI18nKey:`console.objectView.chartTypeHelp`,kind:`enum`,enumOptions:[{value:`bar`,i18nKey:`console.objectView.chartTypeBar`},{value:`line`,i18nKey:`console.objectView.chartTypeLine`},{value:`pie`,i18nKey:`console.objectView.chartTypePie`},{value:`area`,i18nKey:`console.objectView.chartTypeArea`},{value:`scatter`,i18nKey:`console.objectView.chartTypeScatter`}],defaultValue:`bar`},{key:`xAxisField`,i18nKey:`console.objectView.xAxisField`,helpI18nKey:`console.objectView.xAxisFieldHelp`,filter:e=>e.type===`select`||e.type===`boolean`||e.type===`date`||e.type===`text`,preferred:T},{key:`yAxisFields`,i18nKey:`console.objectView.yAxisField`,helpI18nKey:`console.objectView.yAxisFieldHelp`,filter:e=>e.type===`number`}],tree:[{key:`parentField`,i18nKey:`console.objectView.parentField`,helpI18nKey:`console.objectView.parentFieldHelp`,filter:e=>e.rawType===`tree`||e.rawType===`lookup`||e.rawType===`master_detail`}]};function F({open:e,onOpenChange:t,onCreate:n,existingLabels:p,availableTypes:m,objectDef:g}){let{t:_}=f(),v=(0,A.useMemo)(()=>te(_),[_]),y=(0,A.useMemo)(()=>m&&m.length>0?v.filter(e=>m.includes(e.type)):v,[v,m]),b=(p??[]).join(`\0`),x=(0,A.useMemo)(()=>new Set(p??[]),[b]),S=(0,A.useMemo)(()=>g?w(g):[],[g]),[C,T]=(0,A.useState)(y[0]?.type??`grid`),[E,D]=(0,A.useState)(``),[k,M]=(0,A.useState)(!1),[F,I]=(0,A.useState)(``),[L,R]=(0,A.useState)(!1),[ne,z]=(0,A.useState)({});(0,A.useEffect)(()=>{e&&(T(y[0]?.type??`grid`),M(!1),R(!1),z({}))},[e,y]),(0,A.useEffect)(()=>{if(!k){let e=y.find(e=>e.type===C);D(N(e?.label??`View`,x))}},[C,k,y,x]),(0,A.useEffect)(()=>{L||I(ee(E))},[E,L]);let B=P[C]??[],V=e=>e.kind===`enum`?(e.enumOptions?.length??0)>0:!g||(e.filter?S.filter(e.filter):S).length>0,H=(0,A.useMemo)(()=>{let e={};return y.forEach(t=>{let n=(P[t.type]??[]).find(e=>!V(e));e[t.type]=n??null}),e},[y,S,g]),U=e=>ne[`${C}.${e}`]??``,W=(e,t)=>z(n=>({...n,[`${C}.${e}`]:t})),G=E.trim(),K=G.length>0&&x.has(G),q=B.every(e=>U(e.key).length>0),J=/^[a-z_][a-z0-9_]*$/,Y=F.trim(),X=Y.length===0,Z=Y.length>0&&!J.test(Y),Q=G.length>0&&!K&&q&&!X&&!Z;(0,A.useEffect)(()=>{B.length!==0&&B.forEach(e=>{if(U(e.key).length>0)return;if(e.kind===`enum`){e.defaultValue&&W(e.key,e.defaultValue);return}let t=e.filter?S.filter(e.filter):S;if(t.length===0)return;if(t.length===1){W(e.key,t[0].value);return}let n=O(t,e.preferred??[]);n&&W(e.key,n)})},[C,S]);let $=()=>{if(!Q)return;let e={};B.forEach(t=>{let n=U(t.key);n&&(e[t.key]=t.key===`yAxisFields`?[n]:n)});let r={type:C,label:G,name:Y};Object.keys(e).length>0&&(r[C]=e),n(r),t(!1)};return(0,j.jsx)(r,{open:e,onOpenChange:t,children:(0,j.jsxs)(l,{className:`sm:max-w-[560px]`,"data-testid":`create-view-dialog`,children:[(0,j.jsxs)(c,{children:[(0,j.jsx)(i,{children:_(`console.objectView.createView`)}),(0,j.jsx)(o,{children:_(`console.objectView.createViewDesc`)})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-4 gap-2 py-2`,"data-testid":`create-view-type-grid`,children:y.map(({type:e,label:t,description:n,icon:r})=>{let i=e===C,a=H[e],o=!!a,s=o?_(`console.objectView.viewTypeUnavailable`,{field:_(a.i18nKey)}):void 0;return(0,j.jsxs)(`button`,{type:`button`,"data-testid":`create-view-type-${e}`,"aria-pressed":i,"aria-disabled":o,disabled:o,title:s,onClick:()=>{o||T(e)},className:u(`group flex flex-col items-start gap-1 rounded-lg border bg-background p-3 text-left transition-colors`,!o&&`hover:border-primary/60 hover:bg-accent/40`,i&&!o?`border-primary ring-2 ring-primary/30 bg-accent/40`:`border-border`,o&&`opacity-50 cursor-not-allowed`),children:[(0,j.jsx)(r,{className:u(`h-5 w-5`,i&&!o?`text-primary`:`text-muted-foreground group-hover:text-foreground`)}),(0,j.jsx)(`div`,{className:`text-xs font-medium leading-tight`,children:t}),(0,j.jsx)(`div`,{className:`text-[10px] leading-tight text-muted-foreground line-clamp-2`,children:o?_(`console.objectView.viewTypeUnavailableShort`):n})]},e)})}),B.length>0&&(0,j.jsx)(`div`,{className:`space-y-3 rounded-md border border-dashed bg-muted/30 p-3`,"data-testid":`create-view-required-fields`,children:B.map(e=>{let t=U(e.key),n=e.kind===`enum`,r=n?[]:e.filter?S.filter(e.filter):S,i=!n&&S.length>0&&r.length===0;return(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-required-${e.key}`,className:`text-xs font-medium`,children:[_(e.i18nKey),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,j.jsxs)(`select`,{id:`create-view-required-${e.key}`,"aria-required":`true`,"data-testid":`create-view-required-${e.key}`,value:t,onChange:t=>W(e.key,t.target.value),disabled:i,className:u(`h-9 w-full rounded-md border bg-background px-2 text-xs`,`border-input`),children:[(0,j.jsx)(`option`,{value:``,children:_(n?`console.objectView.selectOption`:`console.objectView.selectField`)}),n?e.enumOptions.map(e=>(0,j.jsx)(`option`,{value:e.value,children:_(e.i18nKey)},e.value)):r.map(e=>(0,j.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),e.helpI18nKey&&!i&&(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:_(e.helpI18nKey)}),i&&(0,j.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] text-destructive`,"data-testid":`create-view-error-no-field-${e.key}`,children:[(0,j.jsx)(h,{className:`h-3 w-3`}),_(`console.objectView.noEligibleFieldForType`)]})]},e.key)})}),(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-name-input`,className:`text-xs font-medium`,children:[_(`console.objectView.title`),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,j.jsx)(a,{id:`create-view-name-input`,"aria-required":`true`,"data-testid":`create-view-name-input`,autoFocus:!0,value:E,onChange:e=>{D(e.target.value),M(!0)},onKeyDown:e=>{e.key===`Enter`&&Q&&$()},placeholder:_(`console.objectView.newView`),className:`h-9`}),K&&(0,j.jsx)(`p`,{className:`text-[11px] text-destructive`,"data-testid":`create-view-error-duplicate`,children:_(`console.objectView.duplicateViewName`)})]}),(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`label`,{htmlFor:`create-view-machine-name-input`,className:`text-xs font-medium`,children:[_(`console.objectView.viewName`),(0,j.jsx)(`span`,{className:`ml-1 text-destructive`,"aria-hidden":`true`,children:`*`})]}),(0,j.jsx)(a,{id:`create-view-machine-name-input`,"aria-required":`true`,"data-testid":`create-view-machine-name-input`,value:F,onChange:e=>{I(e.target.value),R(!0)},onKeyDown:e=>{e.key===`Enter`&&Q&&$()},placeholder:`grid_1`,className:`h-9 font-mono`}),X?(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-testid":`create-view-machine-name-help`,children:_(`console.objectView.viewNameRequired`)}):Z?(0,j.jsx)(`p`,{className:`text-[11px] text-destructive`,"data-testid":`create-view-error-machine-name`,children:_(`console.objectView.viewNameInvalid`)}):(0,j.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,"data-testid":`create-view-machine-name-help`,children:_(`console.objectView.viewNameHelp`)})]}),(0,j.jsxs)(s,{className:`mt-2`,children:[(0,j.jsx)(d,{type:`button`,variant:`outline`,onClick:()=>t(!1),"data-testid":`create-view-cancel`,children:_(`console.objectView.cancel`)}),(0,j.jsx)(d,{type:`button`,disabled:!Q,onClick:$,"data-testid":`create-view-submit`,children:_(`console.objectView.create`)})]})]})})}export{M as n,F as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{p as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{Et as i,On as a,Tt as o,kt as s}from"./ui-components-D6cEVg0T.js";import{K as c,R as l,h as u,q as d}from"./framework-DFR4HNtj.js";import{w as f}from"./i18n-runtime-97_bDVjP.js";import{r as p}from"./vendor-ui-utils-DIUdEYii.js";import{t as m}from"./vendor-icon-layout-dashboard-wba2hvZp.js";import{a as h}from"./ExpressionProvider-CrL6jhVq.js";import{t as g}from"./useActionModal-Blp4rhOk.js";import{t as _}from"./preferLocal-DEJV3KIq.js";import{n as v}from"./utils-MjUhYVsx.js";import{n as y,t as b}from"./MetadataInspector-EP0I3-Kq.js";import{n as x}from"./plugin-dashboard-DjEx8e5Y.js";import{t as S}from"./useOpenRecordList-BrwJFojQ.js";var C=n();function w({cards:e=6}){return(0,C.jsxs)(`div`,{className:`w-full space-y-6 p-4 sm:p-6`,children:[(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(a,{className:`h-7 w-56`}),(0,C.jsx)(a,{className:`h-4 w-80`})]}),(0,C.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:Array.from({length:4}).map((e,t)=>(0,C.jsxs)(`div`,{className:`rounded-lg border p-4 space-y-2`,children:[(0,C.jsx)(a,{className:`h-4 w-20`}),(0,C.jsx)(a,{className:`h-8 w-24`}),(0,C.jsx)(a,{className:`h-3 w-16`})]},`stat-${t}`))}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Array.from({length:e}).map((e,t)=>(0,C.jsxs)(`div`,{className:`rounded-lg border p-4 space-y-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsx)(a,{className:`h-5 w-32`}),(0,C.jsx)(a,{className:`h-5 w-5 rounded-full`})]}),(0,C.jsx)(a,{className:`h-40 w-full`}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(a,{className:`h-3 w-16`}),(0,C.jsx)(a,{className:`h-3 w-12`})]})]},`widget-${t}`))})]})}var T=e(r(),1);function E(){u({objectName:`*`})}function D({dataSource:e}){let n=S(),{dashboardName:r}=t(),{showDebug:a}=y(),u=c(),{t:D}=f(),[O,k]=(0,T.useState)(!0),{modalHandler:A,modalElement:j}=g(u),M=(0,T.useMemo)(()=>({export_dashboard_pdf:async()=>{p.info(D(`dashboardActions.printDialogOpening`));try{return window.print(),{success:!0}}catch(e){return p.error(D(`dashboardActions.exportFailed`,{message:e?.message||String(e)})),{success:!1,error:e?.message||String(e)}}},forecast_dashboard:async()=>(p.info(D(`dashboardActions.forecastSoon`)),{success:!0})}),[D]);(0,T.useEffect)(()=>{k(!0),queueMicrotask(()=>k(!1))},[r]);let{dashboards:N,objects:P}=d(),{app:F}=h(),I=_(N,r,F?._packageId),L=(0,T.useMemo)(()=>new Set((P||[]).map(e=>e?.name).filter(Boolean)),[P]),R=(0,T.useMemo)(()=>{if(!I||L.size===0)return I;let e=I.widgets;if(!Array.isArray(e)||e.length===0)return I;let t=e.filter(e=>{let t=e?.requiresObject??e?.object;return!t||L.has(t)});return t.length===e.length?I:{...I,widgets:t}},[I,L]);return O?(0,C.jsx)(w,{}):I?(0,C.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,C.jsx)(`div`,{className:`flex flex-col sm:flex-row justify-between sm:items-center gap-3 sm:gap-4 p-4 sm:p-6 border-b shrink-0`,children:(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(()=>{let e=v(I.label,D)||I.name;return(0,C.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:e})})(),(()=>{let e=(R||I).description??I.description,t=v(e,D);return t?(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:t}):null})()]})}),(0,C.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,C.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-2 sm:p-4 md:p-6`,children:(0,C.jsx)(l,{value:{openRecordList:n},children:(0,C.jsx)(x,{schema:R,localized:!0,dataSource:e,modalHandler:A,scriptHandlers:M,onRefresh:E,hideHeaderText:!0})})}),(0,C.jsx)(b,{open:a,sections:[{title:`Dashboard Configuration`,data:R}]})]}),j]}):(0,C.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,C.jsxs)(o,{children:[(0,C.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,C.jsx)(m,{className:`h-6 w-6 text-muted-foreground`})}),(0,C.jsx)(s,{children:D(`empty.dashboardNotFound`)}),(0,C.jsx)(i,{children:D(`empty.dashboardNotFoundDescription`,{name:r})})]})})}export{D as DashboardView};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t,d as n,p as r,r as i,t as a,v as o}from"./vendor-react-BggL7APJ.js";import{K as s}from"./framework-DFR4HNtj.js";import{w as c}from"./i18n-runtime-97_bDVjP.js";import{t as l}from"./vendor-icon-chevron-down-BEf_jTEE.js";import{t as u}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as d}from"./vendor-icon-external-link-SBKz5x6R.js";import{t as f}from"./vendor-icon-file-question-mark-CDRVvH3W.js";import{t as p}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as m}from"./vendor-icon-menu-9YHQR0RT.js";import"./src-C0eXlKtx.js";import{t as h}from"./DocShell-Bzl3QS30.js";import{a as g,d as _,i as v,n as y,u as b}from"./use-book-data-CwRldFxP.js";import{r as x,t as S}from"./plugin-markdown-BOkHcir_.js";import{n as C}from"./BookPage-DwFMcTSN.js";var w=e(o(),1),T=/(^```[^\n]*\n[\s\S]*?\n```[ \t]*$|^~~~[^\n]*\n[\s\S]*?\n~~~[ \t]*$)/m,E=/(`[^`\n]+`)/,D=/\]\((?:\.\/)?([a-z][a-z0-9_]*)\.md(#[^)\s]*)?\)/g;function O(e){return e.split(E).map((e,t)=>t%2==1?e:e.replace(D,`](/docs/$1$2)`)).join(``)}function k(e){let t=[],n=e;for(;;){let e=T.exec(n);if(!e||e.index===void 0)return t.push(O(n)),t.join(``);t.push(O(n.slice(0,e.index)),e[0]),n=n.slice(e.index+e[0].length)}}var A=a();function j({book:e,activeDoc:t,docHref:n}){return(0,A.jsxs)(`nav`,{"aria-label":e.label??e.name,className:`text-sm`,children:[e.label?(0,A.jsx)(`div`,{className:`mb-3 px-2 text-sm font-semibold text-foreground`,children:e.label}):null,(0,A.jsx)(`div`,{className:`space-y-5`,children:e.groups.map(e=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e.label}),(0,A.jsx)(`ul`,{className:`space-y-0.5`,children:e.entries.map((e,r)=>{if(e.separator)return(0,A.jsx)(`li`,{className:`my-1.5 border-t border-border/60`,"aria-hidden":!0},`sep-${r}`);if(e.href)return(0,A.jsx)(`li`,{children:(0,A.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1.5 rounded px-2 py-1 text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:e.label??e.href}),(0,A.jsx)(d,{className:`h-3 w-3 shrink-0 opacity-60`})]})},`ext-${r}`);if(!e.doc)return null;let a=e.doc===t;return(0,A.jsx)(`li`,{children:(0,A.jsx)(i,{to:n(e.doc),"aria-current":a?`page`:void 0,className:`block truncate rounded px-2 py-1 transition ${a?`bg-primary/10 font-medium text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:e.label??e.doc})},e.doc)})})]},e.key))})]})}function M(){let{slug:e,name:i,appName:a}=r(),o=n(),d=s(),{t:T}=c(),[E,D]=(0,w.useState)(null),[O,M]=(0,w.useState)(`loading`),[N,P]=(0,w.useState)(``);(0,w.useEffect)(()=>{let e=!1;async function t(){if(i&&d){M(`loading`);try{let t=await d.getClient().meta.getItem(`doc`,i,a?{packageId:a}:void 0),n=t?.item??t?.data??t;if(e)return;n&&typeof n.content==`string`?(D({name:i,label:n.label,content:n.content}),M(`ready`)):M(`missing`)}catch(t){if(e)return;let n=t?.httpStatus;if(n===401||n===403){P(t?.message??``),M(`refused`);return}n===404||/not found/i.test(t?.message??``)?M(`missing`):(P(t?.message??`Failed to load documentation`),M(`error`))}}}return t(),()=>{e=!0}},[i,a,d]);let F=(0,w.useCallback)(e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`}),window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${e}`)},[]),I=(0,w.useCallback)(e=>{if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;let t=e.target.closest(`a`)?.getAttribute(`href`);t&&(t.startsWith(`/docs/`)?(e.preventDefault(),o(t)):t.startsWith(`#`)&&(e.preventDefault(),F(decodeURIComponent(t.slice(1)))))},[o,F]),L=(0,w.useCallback)((e,t)=>{e.defaultPrevented||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),F(t))},[F]),R=(0,w.useMemo)(()=>x(E?.content??``),[E?.content]),z=T(`help.onThisPage`,{defaultValue:`On this page`}),{books:B,docs:V}=y(),H=a?`/apps/${a}/docs`:`/docs`,U=(0,w.useMemo)(()=>{let t=B.find(t=>g(t)===e);return t?b(t,_(t,V)):null},[B,V,e]),W=(0,w.useCallback)(t=>`${H}/${e}/${t}`,[H,e]),G=(0,w.useMemo)(()=>e&&!U?v(e,B):null,[e,U,B]);return G&&i?(0,A.jsx)(t,{to:`${H}/${g(G)}/${i}`,replace:!0}):O===`loading`?(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,A.jsx)(p,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):O===`missing`?(0,A.jsx)(h,{breadcrumb:i,children:(0,A.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,A.jsx)(f,{className:`h-10 w-10 text-muted-foreground`}),(0,A.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Documentation not found`}),(0,A.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No document named `,(0,A.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:i}),` is installed. It may belong to a package that is not installed, or it was removed in a newer version.`]})]})}):O===`refused`?(0,A.jsx)(C,{name:i,message:N}):O===`error`?(0,A.jsx)(h,{breadcrumb:i,children:(0,A.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,A.jsx)(u,{className:`h-10 w-10 text-destructive`}),(0,A.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Failed to load documentation`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:N})]})}):(0,A.jsxs)(h,{breadcrumb:E?.label??i,children:[U?(0,A.jsxs)(`details`,{className:`group mx-auto max-w-6xl px-4 pt-4 sm:px-6 lg:hidden`,children:[(0,A.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm font-medium [&::-webkit-details-marker]:hidden`,children:[(0,A.jsx)(m,{className:`h-4 w-4 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`truncate`,children:U.label??`Contents`}),(0,A.jsx)(l,{className:`ml-auto h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,A.jsx)(`div`,{className:`mt-2 rounded-md border p-3`,children:(0,A.jsx)(j,{book:U,activeDoc:i,docHref:W})})]}):null,(0,A.jsxs)(`div`,{className:`mx-auto flex gap-8 p-4 sm:p-6 ${U?`max-w-6xl`:`max-w-5xl`}`,children:[U?(0,A.jsx)(`aside`,{className:`hidden w-56 shrink-0 lg:block`,children:(0,A.jsx)(`nav`,{className:`sticky top-20 max-h-[calc(100vh-6rem)] overflow-auto pr-1`,children:(0,A.jsx)(j,{book:U,activeDoc:i,docHref:W})})}):null,(0,A.jsx)(`article`,{className:`min-w-0 max-w-3xl flex-1 [&_h1]:scroll-mt-24 [&_h2]:scroll-mt-24 [&_h3]:scroll-mt-24`,onClick:I,children:(0,A.jsx)(S,{schema:{type:`markdown`,content:k(E?.content??``)}})}),R.length>=3?(0,A.jsx)(`aside`,{className:`hidden xl:block w-56 shrink-0`,children:(0,A.jsxs)(`nav`,{"aria-label":z,className:`sticky top-20 max-h-[calc(100vh-6rem)] overflow-auto`,children:[(0,A.jsx)(`div`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:z}),(0,A.jsx)(`ul`,{className:`border-l border-border text-sm`,children:R.map(e=>(0,A.jsx)(`li`,{style:{paddingLeft:(e.depth-2)*12},children:(0,A.jsx)(`a`,{href:`#${e.id}`,onClick:t=>L(t,e.id),className:`-ml-px block border-l border-transparent py-0.5 pl-3 text-muted-foreground hover:border-primary hover:text-foreground`,children:e.text})},e.id))})]})}):null]})]})}export{M as default};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{r as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{t as i}from"./vendor-icon-book-open-DKPXYwQK.js";import{t as a}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as o}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as s}from"./DocShell-Bzl3QS30.js";import{a as c,n as l}from"./use-book-data-C3eyZJSG.js";var u=e(r(),1),d=n();function f(){let{books:e,docs:n,state:r,error:f}=l(),p=(0,u.useMemo)(()=>c(e,n),[e,n]);return r===`loading`?(0,d.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,d.jsx)(o,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):r===`error`?(0,d.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,d.jsx)(a,{className:`h-10 w-10 text-destructive`}),(0,d.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Failed to load documentation`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f})]}):(0,d.jsx)(s,{children:(0,d.jsxs)(`div`,{className:`mx-auto max-w-4xl p-4 sm:p-6`,children:[(0,d.jsxs)(`header`,{className:`mb-6`,children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:`Documentation`}),(0,d.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Books and guides from your installed packages.`})]}),p.length===0?(0,d.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-16 text-center text-muted-foreground`,children:[(0,d.jsx)(i,{className:`h-10 w-10`}),(0,d.jsxs)(`p`,{className:`text-sm`,children:[`No documentation is installed. Packages ship docs as flat`,(0,d.jsx)(`code`,{className:`mx-1 rounded bg-muted px-1 py-0.5`,children:`src/docs/*.md`}),`files, organised by a `,(0,d.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`book`}),` (ADR-0046).`]})]}):(0,d.jsx)(`ul`,{className:`grid items-stretch gap-3 sm:grid-cols-2`,children:p.map(e=>(0,d.jsx)(`li`,{className:`h-full`,children:(0,d.jsxs)(t,{to:`/docs/${e.slug}`,className:`flex h-full items-start gap-3 rounded-md border border-border p-3 hover:bg-muted/50`,children:[(0,d.jsx)(i,{className:`mt-0.5 h-5 w-5 shrink-0 text-muted-foreground`}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`div`,{className:`text-sm font-semibold`,children:e.label}),e.description?(0,d.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.description}):e.subtitle?(0,d.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/70`,children:e.subtitle}):null,(0,d.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground/80`,children:[e.docCount,` `,e.docCount===1?`article`:`articles`]})]})]})},e.name))})]})})}export{f as default};
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{r as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{t as i}from"./vendor-icon-book-open-DKPXYwQK.js";import{t as a}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as o}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as s}from"./DocShell-Bzl3QS30.js";import{n as c,o as l}from"./use-book-data-CwRldFxP.js";var u=e(r(),1),d=n();function f(){let{books:e,docs:n,state:r,error:f}=c(),p=(0,u.useMemo)(()=>l(e,n),[e,n]);return r===`loading`?(0,d.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,d.jsx)(o,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):r===`error`?(0,d.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,d.jsx)(a,{className:`h-10 w-10 text-destructive`}),(0,d.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Failed to load documentation`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f})]}):(0,d.jsx)(s,{children:(0,d.jsxs)(`div`,{className:`mx-auto max-w-4xl p-4 sm:p-6`,children:[(0,d.jsxs)(`header`,{className:`mb-6`,children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:`Documentation`}),(0,d.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Books and guides from your installed packages.`})]}),p.length===0?(0,d.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-16 text-center text-muted-foreground`,children:[(0,d.jsx)(i,{className:`h-10 w-10`}),(0,d.jsxs)(`p`,{className:`text-sm`,children:[`No documentation is installed. Packages ship docs as flat`,(0,d.jsx)(`code`,{className:`mx-1 rounded bg-muted px-1 py-0.5`,children:`src/docs/*.md`}),`files, organised by a `,(0,d.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`book`}),` (ADR-0046).`]})]}):(0,d.jsx)(`ul`,{className:`grid items-stretch gap-3 sm:grid-cols-2`,children:p.map(e=>(0,d.jsx)(`li`,{className:`h-full`,children:(0,d.jsxs)(t,{to:`/docs/${e.slug}`,className:`flex h-full items-start gap-3 rounded-md border border-border p-3 hover:bg-muted/50`,children:[(0,d.jsx)(i,{className:`mt-0.5 h-5 w-5 shrink-0 text-muted-foreground`}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`div`,{className:`text-sm font-semibold`,children:e.label}),e.description?(0,d.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.description}):e.subtitle?(0,d.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/70`,children:e.subtitle}):null,(0,d.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground/80`,children:[e.docCount,` `,e.docCount===1?`article`:`articles`]})]})]})},e.name))})]})})}export{f as default};
@@ -1 +1 @@
1
- import{o as e,t}from"./vendor-react-BggL7APJ.js";import{r as n,t as r}from"./use-book-data-C3eyZJSG.js";var i=t();function a(){let t=n();return(0,i.jsx)(r.Provider,{value:t,children:(0,i.jsx)(e,{})})}export{a as default};
1
+ import{o as e,t}from"./vendor-react-BggL7APJ.js";import{r as n,t as r}from"./use-book-data-CwRldFxP.js";var i=t();function a(){let t=n();return(0,i.jsx)(r.Provider,{value:t,children:(0,i.jsx)(e,{})})}export{a as default};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{K as a}from"./framework-DFR4HNtj.js";import{t as o}from"./vendor-icon-file-question-mark-CDRVvH3W.js";import{t as s}from"./vendor-icon-loader-circle-D3PsuVaD.js";import"./src-C0eXlKtx.js";import{t as c}from"./DocShell-Bzl3QS30.js";import{a as l,c as u,i as d,n as f}from"./use-book-data-CwRldFxP.js";import{n as p,t as m}from"./BookPage-DwFMcTSN.js";var h=e(i(),1),g=r();async function _(e,t,n){for(let r of[`doc`,`book`])try{return await e.meta.getItem(r,t,n),null}catch(e){let t=e?.httpStatus;if(t===401||t===403)return e?.message??``;if(t!==404)return null}return null}function v(){let{slug:e,appName:r}=n(),{books:i,docs:v,state:y}=f(),b=a(),x=y===`ready`&&!!e&&!i.some(t=>l(t)===e)&&!v.some(t=>t.name===e)&&!d(e,i),[S,C]=(0,h.useState)(null);if((0,h.useEffect)(()=>{if(!x||!e||!b)return;let t=!1;return _(b.getClient(),e,r?{packageId:r}:void 0).then(n=>{t||C({slug:e,refusal:n})}),()=>{t=!0}},[x,e,r,b]),y===`loading`||x&&b&&S?.slug!==e)return(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,g.jsx)(s,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})});if(e&&i.some(t=>l(t)===e))return(0,g.jsx)(m,{});let w=r?`/apps/${r}/docs`:`/docs`,T=e?u(e,i,v):null;if(T&&e&&v.some(t=>t.name===e))return(0,g.jsx)(t,{to:`${w}/${l(T)}/${e}`,replace:!0});let E=e?d(e,i):null;if(E)return(0,g.jsx)(t,{to:`${w}/${l(E)}`,replace:!0});let D=S!==null&&S.slug===e?S.refusal:null;return D===null?T&&e?(0,g.jsx)(t,{to:`${w}/${l(T)}/${e}`,replace:!0}):(0,g.jsx)(c,{breadcrumb:e,children:(0,g.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,g.jsx)(o,{className:`h-10 w-10 text-muted-foreground`}),(0,g.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Documentation not found`}),(0,g.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No book or document named `,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:e}),` is installed.`]})]})}):(0,g.jsx)(p,{name:e,message:D})}export{v as default};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{bt as r}from"./vendor-objectstack-DFqu45yM.js";import{$ as i}from"./ui-components-D6cEVg0T.js";import{Mt as a,Wi as o,_t as s,br as c}from"./framework-DFR4HNtj.js";var l=e(n(),1),u=t(),d=(0,l.createContext)(null);function f({user:e={},features:t={},permissions:n}={}){let r=o(e,n);return{current_user:r,user:r,ctx:{user:r},os:{user:r},features:t}}var p=new WeakMap;function m(e){let t=p.get(e);if(t===void 0){try{t=r(e)}catch(e){console.error(`[object-ui] current_user.can(object, verb) is not bound: the permissions payload was refused — ${e instanceof Error?e.message:String(e)}`),t=null}p.set(e,t)}return t??void 0}function h(){let{isLoaded:e,effectiveObjects:t}=i();return e&&t?m(t):void 0}function g(e={}){return new c(f(e))}function _({children:e,user:t={},app:n={},data:r={},features:i={}}){let o=h(),s=(0,l.useMemo)(()=>({user:t,app:n,data:r,features:i,evaluator:g({user:t,features:i,permissions:o})}),[t,n,r,i,o]),c=(0,l.useMemo)(()=>f({user:t,features:i,permissions:o}),[t,i,o]);return(0,u.jsx)(d.Provider,{value:s,children:(0,u.jsx)(a,{scope:c,children:e})})}function v(){let e=(0,l.useContext)(d);if(!e){let e={user:{},features:{}};return{...e,app:{},data:{},evaluator:g(e)}}return e}var y=`app-shell:visible`;function b(e,t,n=`visible`){if(e==null||e===!0||e===`true`)return!0;if(e===!1||e===`false`)return!1;let r=t=>s(y,void 0,n,e,t,`app-shell`);try{return t.evaluateCondition(e,{onFault:r})}catch(e){return r(e),!0}}function x(e,t){return e?.hidden!==!0&&b(e?.visibleWhen,t,`visibleWhen`)}export{v as a,x as i,g as n,h as o,b as r,_ as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{a as r}from"./infrastructure-BHSync5f.js";import{An as i,Bn as a,Br as o,Dn as s,Hr as c,Mn as l,Nn as u,Ur as d,Vr as f,Yt as p,Zn as m,an as h,en as g,in as _,jn as v,kn as y,ni as b,nn as x,on as S,qn as C,rn as w,tn as T,vi as E,zr as D}from"./ui-components-BTB1NkUW.js";import{G as O,K as k}from"./framework-DcWkeiND.js";import{t as A}from"./i18n-runtime-CTgAQF4N.js";import{t as j}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as M}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as N}from"./vendor-icon-circle-x-Nkh1Yr7N.js";import{t as P}from"./vendor-icon-clock-CTLnah0r.js";import{t as F}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as I}from"./vendor-icon-play-BfFoh-7G.js";import{t as L}from"./vendor-icon-refresh-cw-BGjSPEfJ.js";import{t as R}from"./vendor-icon-workflow-B9ASq0nN.js";import"./src-B8lv0plz.js";import{O as z}from"./RecordDetailView-DQKydU7X.js";var B=e(n(),1),V=t();function H({status:e}){let t={success:{icon:M,cls:`text-emerald-600 border-emerald-300`},completed:{icon:M,cls:`text-emerald-600 border-emerald-300`},failed:{icon:N,cls:`text-red-600 border-red-300`},error:{icon:N,cls:`text-red-600 border-red-300`},running:{icon:F,cls:`text-blue-600 border-blue-300 animate-pulse`},pending:{icon:P,cls:`text-amber-600 border-amber-300`},paused:{icon:P,cls:`text-amber-600 border-amber-300`},skipped:{icon:j,cls:`text-muted-foreground`}}[e]??{icon:j,cls:`text-muted-foreground`},n=t.icon;return(0,V.jsxs)(b,{variant:`outline`,className:`text-[10px] font-mono inline-flex items-center gap-1 ${t.cls}`,children:[(0,V.jsx)(n,{className:`h-3 w-3`}),e]})}function U(e,t){if(!e)return`—`;try{return new Date(e).toLocaleString(t)}catch{return e}}function W(e,t){switch(t){case`number`:{if(e===``)return;let t=Number(e);return Number.isNaN(t)?e:t}case`boolean`:return e===`true`;case`object`:case`list`:case`array`:if(e.trim()===``)return;try{return JSON.parse(e)}catch{return e}default:return e}}function G({data:e}){return(0,V.jsx)(`pre`,{className:`rounded border bg-muted/30 p-2 text-xs font-mono overflow-auto whitespace-pre-wrap break-all max-h-96`,children:JSON.stringify(e,null,2)})}function K(){let e=O()?.getClient?.(),[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(!0),[a,l]=(0,B.useState)(null),[u,p]=(0,B.useState)(``),[m,h]=(0,B.useState)(0),g=(0,B.useCallback)(async()=>{if(!e?.meta?.getItems){l(`meta.getItems is not available on this client`),i(!1);return}i(!0),l(null);try{let t=await e.meta.getItems(`flow`),r=(Array.isArray(t)?t:Array.isArray(t?.items)?t.items:[]).map(e=>({name:e?.spec?.name??e?.name,label:e?.spec?.label,spec:e?.spec??e,updatedAt:e?.updatedAt??e?.updated_at})).filter(e=>e.name);n(r),!u&&r.length>0&&p(r[0].name)}catch(e){l(e?.message??String(e))}finally{i(!1)}},[e,u]);(0,B.useEffect)(()=>{g()},[g]);let _=(0,B.useMemo)(()=>t.find(e=>e.name===u)??null,[t,u]);return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,V.jsx)(R,{className:`h-5 w-5`}),`Flow Runs`]}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Pick a flow, trigger a test run with sample inputs, and inspect recent run history`})]}),(0,V.jsxs)(D,{children:[(0,V.jsx)(c,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(d,{className:`text-base`,children:`Flow`}),(0,V.jsx)(f,{children:`Select a flow definition to test`})]}),(0,V.jsxs)(E,{variant:`outline`,size:`sm`,onClick:g,disabled:r,children:[(0,V.jsx)(L,{className:`h-3.5 w-3.5 mr-2 ${r?`animate-spin`:``}`}),`Refresh`]})]})}),(0,V.jsxs)(o,{children:[r&&(0,V.jsx)(s,{className:`h-9 w-72`}),a&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:a}),!r&&!a&&t.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No flow definitions found.`}),!r&&!a&&t.length>0&&(0,V.jsx)(`select`,{value:u,onChange:e=>p(e.target.value),className:`flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring`,children:t.map(e=>(0,V.jsx)(`option`,{value:e.name,children:e.label?`${e.label} (${e.name})`:e.name},e.name))})]})]}),_&&(0,V.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,V.jsx)(q,{client:e,flow:_.spec,onExecuted:()=>h(e=>e+1)}),(0,V.jsx)(J,{client:e,flowName:_.name,refreshKey:m})]})]})}function q({client:e,flow:t,onExecuted:n}){let i=(0,B.useMemo)(()=>(t?.variables??[]).filter(e=>e?.isInput),[t]),a=O(),{objects:s}=k(),l=(0,B.useMemo)(()=>r(),[]),[u,h]=(0,B.useState)({}),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(null),[x,w]=(0,B.useState)(null),[T,A]=(0,B.useState)(null);(0,B.useEffect)(()=>{h({}),y(null),w(null),A(null)},[t?.name]);let j=(e,t)=>h(n=>({...n,[e]:t}));return(0,V.jsxs)(D,{children:[(0,V.jsxs)(c,{className:`pb-3`,children:[(0,V.jsx)(d,{className:`text-base`,children:`Test Run`}),(0,V.jsx)(f,{children:`Provide input values and invoke the flow`})]}),(0,V.jsxs)(o,{className:`space-y-3`,children:[i.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This flow declares no input variables. Click Run to invoke with no parameters.`}),i.map(e=>(0,V.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,V.jsxs)(m,{htmlFor:`var-${e.name}`,className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`font-mono text-xs`,children:e.name}),(0,V.jsx)(b,{variant:`outline`,className:`text-[10px] font-mono`,children:e.type})]}),e.type===`boolean`?(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(S,{id:`var-${e.name}`,checked:u[e.name]===`true`,onCheckedChange:t=>j(e.name,t?`true`:`false`)}),(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:u[e.name]===`true`?`true`:`false`})]}):e.type===`object`||e.type===`list`||e.type===`array`?(0,V.jsx)(p,{id:`var-${e.name}`,placeholder:`JSON ${e.type}`,value:u[e.name]??``,onChange:t=>j(e.name,t.target.value),className:`font-mono text-xs min-h-[80px]`}):(0,V.jsx)(C,{id:`var-${e.name}`,type:e.type===`number`?`number`:`text`,value:u[e.name]??``,onChange:t=>j(e.name,t.target.value)})]},e.name)),(0,V.jsx)(`div`,{className:`pt-1`,children:(0,V.jsxs)(E,{onClick:async()=>{if(!e?.automation?.execute){w(`automation.execute is not available on this client`);return}_(!0),w(null),y(null),A(null);try{let r={};for(let e of i){let t=u[e.name];t!==void 0&&(r[e.name]=W(t,e.type))}let a=await e.automation.execute(t.name,{params:r});y(a),a?.status===`paused`&&a?.screen&&a?.runId&&A({flowName:t.name,runId:a.runId,screen:a.screen}),n?.()}catch(e){w(e?.message??String(e))}finally{_(!1)}},disabled:g,size:`sm`,children:[g?(0,V.jsx)(F,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,V.jsx)(I,{className:`h-3.5 w-3.5 mr-2`}),g?`Running…`:`Run Flow`]})}),(v||x)&&(0,V.jsxs)(`div`,{className:`pt-2 border-t mt-2 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[x||v?.success===!1?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(N,{className:`h-4 w-4 text-red-500`}),` Failed`]}):v?.status===`paused`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(P,{className:`h-4 w-4 text-amber-500`}),` Waiting for input`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(M,{className:`h-4 w-4 text-emerald-500`}),` Result`]}),typeof v?.durationMs==`number`&&(0,V.jsxs)(b,{variant:`secondary`,className:`text-[10px] font-mono`,children:[v.durationMs,` ms`]})]}),x&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:x}),v?.status===`paused`&&v?.screen&&v?.runId&&!T&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This run is paused at screen `,(0,V.jsx)(`span`,{className:`font-mono`,children:v.screen.nodeId}),`.`]}),(0,V.jsx)(E,{size:`sm`,variant:`outline`,onClick:()=>A({flowName:t.name,runId:v.runId,screen:v.screen}),children:`Continue run`})]}),v&&(0,V.jsx)(G,{data:v})]})]}),(0,V.jsx)(z,{state:T,authFetch:l,baseUrl:``,dataSource:a,objects:s,onClose:()=>{A(null),n?.()},onComplete:()=>{A(null),n?.()}})]})}function J({client:e,flowName:t,refreshKey:n}){let r=A(),[p,m]=(0,B.useState)([]),[S,C]=(0,B.useState)(!0),[O,k]=(0,B.useState)(null),[j,M]=(0,B.useState)(null),[N,P]=(0,B.useState)(null),[I,R]=(0,B.useState)(!1),[z,W]=(0,B.useState)(null),K=(0,B.useCallback)(async()=>{if(!e?.automation?.listRuns){k(`automation.listRuns is not available on this client`),C(!1);return}C(!0),k(null);try{let n=await e.automation.listRuns(t,{limit:20}),r=Array.isArray(n)?n:n?.items??n?.runs??[];m(r)}catch(e){k(e?.message??String(e))}finally{C(!1)}},[e,t]);(0,B.useEffect)(()=>{K()},[K,n]);let q=async n=>{M(n),P(null),W(null),R(!0);try{let r=await e.automation.getRun(t,n);P(r?.run??r)}catch(e){W(e?.message??String(e))}finally{R(!1)}};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(D,{children:[(0,V.jsx)(c,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(d,{className:`text-base`,children:`Recent Runs`}),(0,V.jsx)(f,{className:`font-mono text-xs`,children:t})]}),(0,V.jsxs)(E,{variant:`outline`,size:`sm`,onClick:K,disabled:S,children:[S?(0,V.jsx)(F,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,V.jsx)(L,{className:`h-3.5 w-3.5 mr-2`}),`Refresh`]})]})}),(0,V.jsxs)(o,{children:[S&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(s,{className:`h-8 w-full`}),(0,V.jsx)(s,{className:`h-8 w-full`}),(0,V.jsx)(s,{className:`h-8 w-full`})]}),!S&&O&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:O}),!S&&!O&&p.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground py-6 text-center`,children:`No runs yet. Use the Test Run panel to invoke this flow.`}),!S&&!O&&p.length>0&&(0,V.jsxs)(g,{children:[(0,V.jsx)(_,{children:(0,V.jsxs)(h,{children:[(0,V.jsx)(w,{children:`Run`}),(0,V.jsx)(w,{children:`Status`}),(0,V.jsx)(w,{children:`Started`}),(0,V.jsx)(w,{className:`text-right`,children:`Duration`})]})}),(0,V.jsx)(T,{children:p.map(e=>(0,V.jsxs)(h,{className:`cursor-pointer`,onClick:()=>q(e.id),children:[(0,V.jsxs)(x,{className:`font-mono text-xs`,children:[e.id.slice(0,12),`…`]}),(0,V.jsx)(x,{children:(0,V.jsx)(H,{status:e.status})}),(0,V.jsx)(x,{className:`text-xs text-muted-foreground`,children:U(e.startedAt,r)}),(0,V.jsx)(x,{className:`text-right font-mono text-xs`,children:typeof e.durationMs==`number`?`${e.durationMs} ms`:`—`})]},e.id))})]})]})]}),(0,V.jsx)(y,{open:!!j,onOpenChange:e=>{e||(M(null),P(null))},children:(0,V.jsxs)(i,{side:`right`,className:`w-full sm:max-w-2xl p-0 flex flex-col`,children:[(0,V.jsxs)(l,{className:`p-4 border-b`,children:[(0,V.jsxs)(u,{className:`font-mono text-sm break-all`,children:[`Run `,j]}),(0,V.jsx)(v,{children:N&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(H,{status:N.status}),typeof N.durationMs==`number`&&(0,V.jsxs)(b,{variant:`secondary`,className:`text-[10px] font-mono`,children:[N.durationMs,` ms`]}),(0,V.jsx)(`span`,{className:`text-xs`,children:U(N.startedAt,r)})]})})]}),(0,V.jsxs)(a,{className:`flex-1 p-4`,children:[I&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(s,{className:`h-16 w-full`}),(0,V.jsx)(s,{className:`h-16 w-full`}),(0,V.jsx)(s,{className:`h-16 w-full`})]}),z&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:z}),!I&&N&&(0,V.jsx)(`div`,{className:`space-y-3`,children:Array.isArray(N.steps)&&N.steps.length>0?N.steps.map((e,t)=>(0,V.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:[`#`,t+1]}),(0,V.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.nodeLabel||e.nodeId}),e.nodeType&&(0,V.jsx)(b,{variant:`outline`,className:`text-[10px] font-mono`,children:e.nodeType}),(0,V.jsx)(H,{status:e.status}),typeof e.durationMs==`number`&&(0,V.jsxs)(b,{variant:`secondary`,className:`text-[10px] font-mono ml-auto`,children:[e.durationMs,` ms`]})]}),e.input!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Input`}),(0,V.jsx)(G,{data:e.input})]}),e.output!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Output`}),(0,V.jsx)(G,{data:e.output})]}),e.error&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-red-500 mb-1`,children:`Error`}),(0,V.jsx)(G,{data:e.error})]})]},`${e.nodeId}-${t}`)):(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Run`}),(0,V.jsx)(G,{data:N})]})})]})]})})]})}export{K as FlowRunsPage};
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{a as r}from"./infrastructure-Cc34lEqb.js";import{An as i,Br as a,Hr as o,Jn as s,Mn as c,Nn as l,On as u,Pn as d,Qn as f,Ur as p,Vn as m,Vr as h,Wr as g,Xt as _,an as v,in as y,jn as b,nn as x,on as S,ri as C,rn as w,sn as T,tn as E,yi as D}from"./ui-components-D6cEVg0T.js";import{K as O,q as k}from"./framework-DFR4HNtj.js";import{t as A}from"./i18n-runtime-97_bDVjP.js";import{t as j}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as M}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as N}from"./vendor-icon-circle-x-Nkh1Yr7N.js";import{t as P}from"./vendor-icon-clock-CTLnah0r.js";import{t as F}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as I}from"./vendor-icon-play-BfFoh-7G.js";import{t as L}from"./vendor-icon-refresh-cw-BGjSPEfJ.js";import{t as R}from"./vendor-icon-workflow-B9ASq0nN.js";import"./src-C0eXlKtx.js";import{O as z}from"./RecordDetailView-DgR_zhP4.js";var B=e(n(),1),V=t();function H({status:e}){let t={success:{icon:M,cls:`text-emerald-600 border-emerald-300`},completed:{icon:M,cls:`text-emerald-600 border-emerald-300`},failed:{icon:N,cls:`text-red-600 border-red-300`},error:{icon:N,cls:`text-red-600 border-red-300`},running:{icon:F,cls:`text-blue-600 border-blue-300 animate-pulse`},pending:{icon:P,cls:`text-amber-600 border-amber-300`},paused:{icon:P,cls:`text-amber-600 border-amber-300`},skipped:{icon:j,cls:`text-muted-foreground`}}[e]??{icon:j,cls:`text-muted-foreground`},n=t.icon;return(0,V.jsxs)(C,{variant:`outline`,className:`text-[10px] font-mono inline-flex items-center gap-1 ${t.cls}`,children:[(0,V.jsx)(n,{className:`h-3 w-3`}),e]})}function U(e,t){if(!e)return`—`;try{return new Date(e).toLocaleString(t)}catch{return e}}function W(e,t){switch(t){case`number`:{if(e===``)return;let t=Number(e);return Number.isNaN(t)?e:t}case`boolean`:return e===`true`;case`object`:case`list`:case`array`:if(e.trim()===``)return;try{return JSON.parse(e)}catch{return e}default:return e}}function G({data:e}){return(0,V.jsx)(`pre`,{className:`rounded border bg-muted/30 p-2 text-xs font-mono overflow-auto whitespace-pre-wrap break-all max-h-96`,children:JSON.stringify(e,null,2)})}function K(){let e=O()?.getClient?.(),[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(!0),[s,c]=(0,B.useState)(null),[l,d]=(0,B.useState)(``),[f,m]=(0,B.useState)(0),_=(0,B.useCallback)(async()=>{if(!e?.meta?.getItems){c(`meta.getItems is not available on this client`),i(!1);return}i(!0),c(null);try{let t=await e.meta.getItems(`flow`),r=(Array.isArray(t)?t:Array.isArray(t?.items)?t.items:[]).map(e=>({name:e?.spec?.name??e?.name,label:e?.spec?.label,spec:e?.spec??e,updatedAt:e?.updatedAt??e?.updated_at})).filter(e=>e.name);n(r),!l&&r.length>0&&d(r[0].name)}catch(e){c(e?.message??String(e))}finally{i(!1)}},[e,l]);(0,B.useEffect)(()=>{_()},[_]);let v=(0,B.useMemo)(()=>t.find(e=>e.name===l)??null,[t,l]);return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,V.jsx)(R,{className:`h-5 w-5`}),`Flow Runs`]}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Pick a flow, trigger a test run with sample inputs, and inspect recent run history`})]}),(0,V.jsxs)(a,{children:[(0,V.jsx)(p,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(g,{className:`text-base`,children:`Flow`}),(0,V.jsx)(o,{children:`Select a flow definition to test`})]}),(0,V.jsxs)(D,{variant:`outline`,size:`sm`,onClick:_,disabled:r,children:[(0,V.jsx)(L,{className:`h-3.5 w-3.5 mr-2 ${r?`animate-spin`:``}`}),`Refresh`]})]})}),(0,V.jsxs)(h,{children:[r&&(0,V.jsx)(u,{className:`h-9 w-72`}),s&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:s}),!r&&!s&&t.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No flow definitions found.`}),!r&&!s&&t.length>0&&(0,V.jsx)(`select`,{value:l,onChange:e=>d(e.target.value),className:`flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring`,children:t.map(e=>(0,V.jsx)(`option`,{value:e.name,children:e.label?`${e.label} (${e.name})`:e.name},e.name))})]})]}),v&&(0,V.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,V.jsx)(q,{client:e,flow:v.spec,onExecuted:()=>m(e=>e+1)}),(0,V.jsx)(J,{client:e,flowName:v.name,refreshKey:f})]})]})}function q({client:e,flow:t,onExecuted:n}){let i=(0,B.useMemo)(()=>(t?.variables??[]).filter(e=>e?.isInput),[t]),c=O(),{objects:l}=k(),u=(0,B.useMemo)(()=>r(),[]),[d,m]=(0,B.useState)({}),[v,y]=(0,B.useState)(!1),[b,x]=(0,B.useState)(null),[S,w]=(0,B.useState)(null),[E,A]=(0,B.useState)(null);(0,B.useEffect)(()=>{m({}),x(null),w(null),A(null)},[t?.name]);let j=(e,t)=>m(n=>({...n,[e]:t}));return(0,V.jsxs)(a,{children:[(0,V.jsxs)(p,{className:`pb-3`,children:[(0,V.jsx)(g,{className:`text-base`,children:`Test Run`}),(0,V.jsx)(o,{children:`Provide input values and invoke the flow`})]}),(0,V.jsxs)(h,{className:`space-y-3`,children:[i.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This flow declares no input variables. Click Run to invoke with no parameters.`}),i.map(e=>(0,V.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,V.jsxs)(f,{htmlFor:`var-${e.name}`,className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`font-mono text-xs`,children:e.name}),(0,V.jsx)(C,{variant:`outline`,className:`text-[10px] font-mono`,children:e.type})]}),e.type===`boolean`?(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(T,{id:`var-${e.name}`,checked:d[e.name]===`true`,onCheckedChange:t=>j(e.name,t?`true`:`false`)}),(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d[e.name]===`true`?`true`:`false`})]}):e.type===`object`||e.type===`list`||e.type===`array`?(0,V.jsx)(_,{id:`var-${e.name}`,placeholder:`JSON ${e.type}`,value:d[e.name]??``,onChange:t=>j(e.name,t.target.value),className:`font-mono text-xs min-h-[80px]`}):(0,V.jsx)(s,{id:`var-${e.name}`,type:e.type===`number`?`number`:`text`,value:d[e.name]??``,onChange:t=>j(e.name,t.target.value)})]},e.name)),(0,V.jsx)(`div`,{className:`pt-1`,children:(0,V.jsxs)(D,{onClick:async()=>{if(!e?.automation?.execute){w(`automation.execute is not available on this client`);return}y(!0),w(null),x(null),A(null);try{let r={};for(let e of i){let t=d[e.name];t!==void 0&&(r[e.name]=W(t,e.type))}let a=await e.automation.execute(t.name,{params:r});x(a),a?.status===`paused`&&a?.screen&&a?.runId&&A({flowName:t.name,runId:a.runId,screen:a.screen}),n?.()}catch(e){w(e?.message??String(e))}finally{y(!1)}},disabled:v,size:`sm`,children:[v?(0,V.jsx)(F,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,V.jsx)(I,{className:`h-3.5 w-3.5 mr-2`}),v?`Running…`:`Run Flow`]})}),(b||S)&&(0,V.jsxs)(`div`,{className:`pt-2 border-t mt-2 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[S||b?.success===!1?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(N,{className:`h-4 w-4 text-red-500`}),` Failed`]}):b?.status===`paused`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(P,{className:`h-4 w-4 text-amber-500`}),` Waiting for input`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(M,{className:`h-4 w-4 text-emerald-500`}),` Result`]}),typeof b?.durationMs==`number`&&(0,V.jsxs)(C,{variant:`secondary`,className:`text-[10px] font-mono`,children:[b.durationMs,` ms`]})]}),S&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:S}),b?.status===`paused`&&b?.screen&&b?.runId&&!E&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This run is paused at screen `,(0,V.jsx)(`span`,{className:`font-mono`,children:b.screen.nodeId}),`.`]}),(0,V.jsx)(D,{size:`sm`,variant:`outline`,onClick:()=>A({flowName:t.name,runId:b.runId,screen:b.screen}),children:`Continue run`})]}),b&&(0,V.jsx)(G,{data:b})]})]}),(0,V.jsx)(z,{state:E,authFetch:u,baseUrl:``,dataSource:c,objects:l,onClose:()=>{A(null),n?.()},onComplete:()=>{A(null),n?.()}})]})}function J({client:e,flowName:t,refreshKey:n}){let r=A(),[s,f]=(0,B.useState)([]),[_,T]=(0,B.useState)(!0),[O,k]=(0,B.useState)(null),[j,M]=(0,B.useState)(null),[N,P]=(0,B.useState)(null),[I,R]=(0,B.useState)(!1),[z,W]=(0,B.useState)(null),K=(0,B.useCallback)(async()=>{if(!e?.automation?.listRuns){k(`automation.listRuns is not available on this client`),T(!1);return}T(!0),k(null);try{let n=await e.automation.listRuns(t,{limit:20}),r=Array.isArray(n)?n:n?.items??n?.runs??[];f(r)}catch(e){k(e?.message??String(e))}finally{T(!1)}},[e,t]);(0,B.useEffect)(()=>{K()},[K,n]);let q=async n=>{M(n),P(null),W(null),R(!0);try{let r=await e.automation.getRun(t,n);P(r?.run??r)}catch(e){W(e?.message??String(e))}finally{R(!1)}};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(a,{children:[(0,V.jsx)(p,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(g,{className:`text-base`,children:`Recent Runs`}),(0,V.jsx)(o,{className:`font-mono text-xs`,children:t})]}),(0,V.jsxs)(D,{variant:`outline`,size:`sm`,onClick:K,disabled:_,children:[_?(0,V.jsx)(F,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,V.jsx)(L,{className:`h-3.5 w-3.5 mr-2`}),`Refresh`]})]})}),(0,V.jsxs)(h,{children:[_&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(u,{className:`h-8 w-full`}),(0,V.jsx)(u,{className:`h-8 w-full`}),(0,V.jsx)(u,{className:`h-8 w-full`})]}),!_&&O&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:O}),!_&&!O&&s.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground py-6 text-center`,children:`No runs yet. Use the Test Run panel to invoke this flow.`}),!_&&!O&&s.length>0&&(0,V.jsxs)(E,{children:[(0,V.jsx)(v,{children:(0,V.jsxs)(S,{children:[(0,V.jsx)(y,{children:`Run`}),(0,V.jsx)(y,{children:`Status`}),(0,V.jsx)(y,{children:`Started`}),(0,V.jsx)(y,{className:`text-right`,children:`Duration`})]})}),(0,V.jsx)(x,{children:s.map(e=>(0,V.jsxs)(S,{className:`cursor-pointer`,onClick:()=>q(e.id),children:[(0,V.jsxs)(w,{className:`font-mono text-xs`,children:[e.id.slice(0,12),`…`]}),(0,V.jsx)(w,{children:(0,V.jsx)(H,{status:e.status})}),(0,V.jsx)(w,{className:`text-xs text-muted-foreground`,children:U(e.startedAt,r)}),(0,V.jsx)(w,{className:`text-right font-mono text-xs`,children:typeof e.durationMs==`number`?`${e.durationMs} ms`:`—`})]},e.id))})]})]})]}),(0,V.jsx)(i,{open:!!j,onOpenChange:e=>{e||(M(null),P(null))},children:(0,V.jsxs)(b,{side:`right`,className:`w-full sm:max-w-2xl p-0 flex flex-col`,children:[(0,V.jsxs)(l,{className:`p-4 border-b`,children:[(0,V.jsxs)(d,{className:`font-mono text-sm break-all`,children:[`Run `,j]}),(0,V.jsx)(c,{children:N&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(H,{status:N.status}),typeof N.durationMs==`number`&&(0,V.jsxs)(C,{variant:`secondary`,className:`text-[10px] font-mono`,children:[N.durationMs,` ms`]}),(0,V.jsx)(`span`,{className:`text-xs`,children:U(N.startedAt,r)})]})})]}),(0,V.jsxs)(m,{className:`flex-1 p-4`,children:[I&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(u,{className:`h-16 w-full`}),(0,V.jsx)(u,{className:`h-16 w-full`}),(0,V.jsx)(u,{className:`h-16 w-full`})]}),z&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:z}),!I&&N&&(0,V.jsx)(`div`,{className:`space-y-3`,children:Array.isArray(N.steps)&&N.steps.length>0?N.steps.map((e,t)=>(0,V.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:[`#`,t+1]}),(0,V.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.nodeLabel||e.nodeId}),e.nodeType&&(0,V.jsx)(C,{variant:`outline`,className:`text-[10px] font-mono`,children:e.nodeType}),(0,V.jsx)(H,{status:e.status}),typeof e.durationMs==`number`&&(0,V.jsxs)(C,{variant:`secondary`,className:`text-[10px] font-mono ml-auto`,children:[e.durationMs,` ms`]})]}),e.input!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Input`}),(0,V.jsx)(G,{data:e.input})]}),e.output!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Output`}),(0,V.jsx)(G,{data:e.output})]}),e.error&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-red-500 mb-1`,children:`Error`}),(0,V.jsx)(G,{data:e.error})]})]},`${e.nodeId}-${t}`)):(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Run`}),(0,V.jsx)(G,{data:N})]})})]})]})})]})}export{K as FlowRunsPage};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{Ar as a,Br as o,Hr as s,Mr as c,Nr as l,Pr as u,Ur as d,Vr as f,ci as p,jr as m,kr as h,ni as g,oi as _,qn as v,si as y,vi as b,zr as x}from"./ui-components-BTB1NkUW.js";import{t as S}from"./vendor-icon-bot-B9KkwkON.js";import{t as C}from"./vendor-icon-check-vpu9Zukp.js";import{t as w}from"./vendor-icon-copy-B5M-KdZo.js";import{t as T}from"./vendor-icon-database-C8JGjSkn.js";import{t as E}from"./vendor-icon-download-C3csYSaD.js";import{t as D}from"./vendor-icon-key-round-hQwGYgPA.js";import{t as O}from"./vendor-icon-plug-CL1O_4J3.js";import{t as k}from"./vendor-icon-shield-alert-CJYtPI9w.js";import{t as A}from"./vendor-icon-terminal-Cgjziqoo.js";import"./src-B8lv0plz.js";import{D as j}from"./default-inspector-registry-CpL3fFhl.js";var M=e(i(),1),N=`objectstack`,P=`Query and modify data in an ObjectStack app over MCP — discover objects, read and filter records, and create/update/delete under your own permissions and row-level security. Use when the user wants to inspect or change data in their ObjectStack environment.`,F=`<YOUR_ENV_MCP_URL>`;function I(e={}){let t=e.mcpUrl?.trim()||F,n=e.envName?.trim();return`---
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{Ar as a,Br as o,Fr as s,Hr as c,Jn as l,Mr as u,Nr as d,Pr as f,Ur as p,Vr as m,Wr as h,ci as g,jr as _,li as v,ri as y,si as b,yi as x}from"./ui-components-D6cEVg0T.js";import{t as S}from"./vendor-icon-bot-B9KkwkON.js";import{t as C}from"./vendor-icon-check-vpu9Zukp.js";import{t as w}from"./vendor-icon-copy-B5M-KdZo.js";import{t as T}from"./vendor-icon-database-C8JGjSkn.js";import{t as E}from"./vendor-icon-download-C3csYSaD.js";import{t as D}from"./vendor-icon-key-round-hQwGYgPA.js";import{t as O}from"./vendor-icon-plug-CL1O_4J3.js";import{t as k}from"./vendor-icon-shield-alert-CJYtPI9w.js";import{t as A}from"./vendor-icon-terminal-Cgjziqoo.js";import"./src-C0eXlKtx.js";import{D as j}from"./default-inspector-registry-Bs6GBn00.js";var M=e(i(),1),N=`objectstack`,P=`Query and modify data in an ObjectStack app over MCP — discover objects, read and filter records, and create/update/delete under your own permissions and row-level security. Use when the user wants to inspect or change data in their ObjectStack environment.`,F=`<YOUR_ENV_MCP_URL>`;function I(e={}){let t=e.mcpUrl?.trim()||F,n=e.envName?.trim();return`---
2
2
  name: ${N}
3
3
  description: ${P}
4
4
  ---
@@ -79,4 +79,4 @@ create/update payload.
79
79
  3. \`query_records\` to read / verify current state.
80
80
  4. \`create_record\` / \`update_record\` / \`delete_record\` to make changes,
81
81
  confirming destructive steps with the user.
82
- `}var L=r();function R(){let[e,t]=(0,M.useState)(!1);return[e,e=>{navigator.clipboard?.writeText(e),t(!0),setTimeout(()=>t(!1),1500)}]}function z({value:e,label:t}){let[n,r]=R();return(0,L.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>r(e),"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function B(){let e=typeof window<`u`?window.location.origin:``,[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)(null),[g,T]=(0,M.useState)(`Agent key`),[O,A]=(0,M.useState)(!1),[N,P]=(0,M.useState)(null),[F,B]=(0,M.useState)(null),[V,H]=(0,M.useState)(!1),[U,W]=R();(0,M.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await(await fetch(`/api/v1/discovery`,{credentials:`include`})).json().catch(()=>({})),a=r?.data?.routes?.mcp??r?.routes?.mcp;if(t)return;a?(n(a.startsWith(`http`)?a:`${e}${a}`),i(!0)):i(!1)}catch{t||i(!1)}})(),()=>{t=!0}},[e]);let G=async()=>{A(!0),P(null);try{let e=await fetch(`/api/v1/keys`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({name:g.trim()||`Agent key`})}),t=await e.json().catch(()=>({})),n=t?.data;if(!e.ok)throw Error(j(t)??`Request failed (${e.status})`);if(!n?.key)throw Error(`The request succeeded but the response carried no API key. Nothing failed in transit — inspect the response body of POST /api/v1/keys.`);B(n),H(!0)}catch(e){P(e?.message??`Failed to generate key`)}finally{A(!1)}},K=()=>{let e=I({mcpUrl:t??void 0}),n=new Blob([e],{type:`text/markdown;charset=utf-8`}),r=document.createElement(`a`);r.href=URL.createObjectURL(n),r.download=`SKILL.md`,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(r.href),1e3)},q=t??`${e}/api/v1/mcp`;return(0,L.jsxs)(x,{children:[(0,L.jsxs)(s,{className:`pb-2`,children:[(0,L.jsxs)(d,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(S,{className:`size-4`}),` Connect an AI agent (MCP)`]}),(0,L.jsx)(f,{className:`text-xs`,children:`Every app in this environment is an agent-ready toolset. Connect Claude, Cursor, Codex or any MCP client — one connection covers all your apps (new ones appear automatically).`})]}),(0,L.jsxs)(o,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`MCP endpoint`}),r===!1?(0,L.jsxs)(_,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsx)(p,{children:`MCP is not enabled for this environment`}),(0,L.jsxs)(y,{className:`text-xs`,children:[`Connecting agents is opt-in. An admin can enable it by setting`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`OS_MCP_SERVER_ENABLED=true`}),`. You can still generate a key and download the skill below.`]})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:q}),(0,L.jsx)(z,{value:q,label:`MCP URL`})]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,L.jsx)(D,{className:`size-3.5`}),` API key`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(v,{value:g,onChange:e=>T(e.target.value),placeholder:`Key name (e.g. Claude desktop)`,className:`h-8 max-w-xs text-sm`}),(0,L.jsx)(b,{type:`button`,size:`sm`,onClick:G,disabled:O,children:O?`Generating…`:`Generate key`})]}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`The key acts as you (your permissions + row-level security). Shown once — copy it immediately. Revoke anytime from the API Keys list.`}),N&&(0,L.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:N})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`Agent skill (portable)`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(b,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:K,children:[(0,L.jsx)(E,{className:`size-4`}),` Download SKILL.md`]}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Works with any skills-capable agent (Claude, Codex, Gemini, Cursor…).`})]})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-3 text-xs leading-relaxed`,children:[(0,L.jsx)(`div`,{className:`mb-1 font-medium`,children:`Connect in 3 steps`}),(0,L.jsxs)(`ol`,{className:`list-decimal space-y-0.5 pl-4 text-muted-foreground`,children:[(0,L.jsx)(`li`,{children:`Add a remote MCP server pointing at the endpoint above.`}),(0,L.jsxs)(`li`,{children:[`Set the header `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key: <your key>`}),` (a session Bearer is `,(0,L.jsx)(`em`,{children:`not`}),` an API key).`]}),(0,L.jsxs)(`li`,{children:[`Drop in `,(0,L.jsx)(`code`,{className:`font-mono`,children:`SKILL.md`}),` so the agent knows how to drive your data.`]})]})]})]}),(0,L.jsx)(h,{open:V,onOpenChange:H,children:(0,L.jsxs)(a,{children:[(0,L.jsxs)(l,{children:[(0,L.jsxs)(u,{className:`flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Your new API key`]}),(0,L.jsxs)(m,{children:[`Copy this now — for your security it will `,(0,L.jsx)(`strong`,{children:`not be shown again`}),`.`]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 break-all rounded bg-muted px-2 py-2 font-mono text-xs`,children:F?.key}),(0,L.jsxs)(b,{type:`button`,variant:`secondary`,size:`sm`,className:`gap-1.5`,onClick:()=>F&&W(F.key),children:[U?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),U?`Copied`:`Copy`]})]}),(0,L.jsxs)(_,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsxs)(y,{className:`text-xs`,children:[`Send it as `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key`}),`. It carries your permissions — store it like a password and revoke it if leaked.`]})]})]}),(0,L.jsx)(c,{children:(0,L.jsx)(b,{type:`button`,onClick:()=>H(!1),children:`Done`})})]})})]})}var V={GET:`bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`,POST:`bg-blue-500/10 text-blue-700 dark:text-blue-400`,PATCH:`bg-amber-500/10 text-amber-700 dark:text-amber-400`,DELETE:`bg-red-500/10 text-red-700 dark:text-red-400`};function H({value:e,label:t}){let[n,r]=(0,M.useState)(!1);return(0,L.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>{navigator.clipboard?.writeText(e),r(!0),setTimeout(()=>r(!1),1500)},"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function U(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,a=typeof window<`u`?window.location.origin:``,[c,l]=(0,M.useState)([]),[u,p]=(0,M.useState)(!0),[m,h]=(0,M.useState)(null);(0,M.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch(`/api/v1/meta/object`,{credentials:`include`});if(!t.ok)throw Error(`meta/object ${t.status}`);let n=await t.json(),r=n?.data??n?.items??n??[],i=(Array.isArray(r)?r:[]).map(e=>({name:String(e.name??``),label:e.label||void 0})).filter(e=>e.name&&!e.name.startsWith(`sys_`));e||l(i)}catch(t){e||h(t?.message??`failed to load objects`)}finally{e||p(!1)}})(),()=>{e=!0}},[]);let _=c[0]?.name??`your_object`,v=(0,M.useMemo)(()=>`# List ${_} records\ncurl "${a}/api/v1/data/${_}?$top=10" \\\n -H "x-api-key: <YOUR_API_KEY>"`,[a,_]),y=e=>[{method:`GET`,path:`/api/v1/data/${e}`,desc:`List / query`},{method:`POST`,path:`/api/v1/data/${e}`,desc:`Create`},{method:`GET`,path:`/api/v1/data/${e}/:id`,desc:`Read one`},{method:`PATCH`,path:`/api/v1/data/${e}/:id`,desc:`Update`},{method:`DELETE`,path:`/api/v1/data/${e}/:id`,desc:`Delete`}];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,L.jsx)(O,{className:`size-5 text-primary`}),` Integrations & APIs`]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Every object you build is instantly a REST API. Drive your app from code or an agent.`})]}),(0,L.jsxs)(x,{children:[(0,L.jsxs)(s,{className:`pb-2`,children:[(0,L.jsx)(d,{className:`text-base`,children:`Base URL`}),(0,L.jsx)(f,{className:`text-xs`,children:`This environment's API root.`})]}),(0,L.jsxs)(o,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:[a,`/api/v1`]}),(0,L.jsx)(H,{value:`${a}/api/v1`,label:`base URL`})]})]}),(0,L.jsx)(B,{}),(0,L.jsxs)(x,{children:[(0,L.jsxs)(s,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(d,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(T,{className:`size-4`}),` REST endpoints`]}),(0,L.jsx)(f,{className:`text-xs`,children:`Auto-generated CRUD for every published object (OData query params on list).`})]}),(0,L.jsxs)(b,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:()=>e(`${i}/developer/api-console`),children:[(0,L.jsx)(A,{className:`size-4`}),` Open API Console`]})]}),(0,L.jsxs)(o,{className:`flex flex-col gap-4`,children:[u&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading objects…`}),m&&(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Couldn't load objects: `,m]}),!u&&!m&&c.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No business objects yet — build one with the AI assistant, publish it, and it appears here as an API.`}),c.map(e=>(0,L.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`font-medium text-sm`,children:e.label||e.name}),(0,L.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:e.name})]}),(0,L.jsx)(`div`,{className:`divide-y`,children:y(e.name).map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5`,children:[(0,L.jsx)(g,{className:`w-16 justify-center font-mono text-[10px] ${V[e.method]??``}`,children:e.method}),(0,L.jsx)(`code`,{className:`flex-1 truncate font-mono text-xs`,children:e.path}),(0,L.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground sm:inline`,children:e.desc})]},e.method+e.path))})]},e.name))]})]}),(0,L.jsxs)(x,{children:[(0,L.jsx)(s,{className:`pb-2`,children:(0,L.jsxs)(d,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Authentication`]})}),(0,L.jsxs)(o,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`p`,{children:[`In the console you're already authenticated — use `,(0,L.jsx)(`strong`,{children:`Open API Console`}),` above to call these endpoints now.`]}),(0,L.jsxs)(`p`,{children:[`For external programs and AI agents, generate a `,(0,L.jsx)(`strong`,{children:`self-serve API key`}),` in the `,(0,L.jsx)(`strong`,{children:`Connect an AI agent`}),` section above. Send it as the`,` `,(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:`x-api-key`}),` header; it runs under your permissions and row-level security, and is revocable.`]})]})]}),(0,L.jsxs)(x,{children:[(0,L.jsxs)(s,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsx)(d,{className:`text-base`,children:`Sample (cURL)`}),(0,L.jsx)(H,{value:v,label:`cURL sample`})]}),(0,L.jsx)(o,{children:(0,L.jsx)(`pre`,{className:`overflow-x-auto rounded bg-muted p-3 font-mono text-xs leading-relaxed`,children:v})})]})]})}export{U as IntegrationsPage};
82
+ `}var L=r();function R(){let[e,t]=(0,M.useState)(!1);return[e,e=>{navigator.clipboard?.writeText(e),t(!0),setTimeout(()=>t(!1),1500)}]}function z({value:e,label:t}){let[n,r]=R();return(0,L.jsxs)(x,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>r(e),"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function B(){let e=typeof window<`u`?window.location.origin:``,[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)(null),[y,T]=(0,M.useState)(`Agent key`),[O,A]=(0,M.useState)(!1),[N,P]=(0,M.useState)(null),[F,B]=(0,M.useState)(null),[V,H]=(0,M.useState)(!1),[U,W]=R();(0,M.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await(await fetch(`/api/v1/discovery`,{credentials:`include`})).json().catch(()=>({})),a=r?.data?.routes?.mcp??r?.routes?.mcp;if(t)return;a?(n(a.startsWith(`http`)?a:`${e}${a}`),i(!0)):i(!1)}catch{t||i(!1)}})(),()=>{t=!0}},[e]);let G=async()=>{A(!0),P(null);try{let e=await fetch(`/api/v1/keys`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({name:y.trim()||`Agent key`})}),t=await e.json().catch(()=>({})),n=t?.data;if(!e.ok)throw Error(j(t)??`Request failed (${e.status})`);if(!n?.key)throw Error(`The request succeeded but the response carried no API key. Nothing failed in transit — inspect the response body of POST /api/v1/keys.`);B(n),H(!0)}catch(e){P(e?.message??`Failed to generate key`)}finally{A(!1)}},K=()=>{let e=I({mcpUrl:t??void 0}),n=new Blob([e],{type:`text/markdown;charset=utf-8`}),r=document.createElement(`a`);r.href=URL.createObjectURL(n),r.download=`SKILL.md`,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(r.href),1e3)},q=t??`${e}/api/v1/mcp`;return(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2`,children:[(0,L.jsxs)(h,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(S,{className:`size-4`}),` Connect an AI agent (MCP)`]}),(0,L.jsx)(c,{className:`text-xs`,children:`Every app in this environment is an agent-ready toolset. Connect Claude, Cursor, Codex or any MCP client — one connection covers all your apps (new ones appear automatically).`})]}),(0,L.jsxs)(m,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`MCP endpoint`}),r===!1?(0,L.jsxs)(b,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsx)(v,{children:`MCP is not enabled for this environment`}),(0,L.jsxs)(g,{className:`text-xs`,children:[`Connecting agents is opt-in. An admin can enable it by setting`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`OS_MCP_SERVER_ENABLED=true`}),`. You can still generate a key and download the skill below.`]})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:q}),(0,L.jsx)(z,{value:q,label:`MCP URL`})]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,L.jsx)(D,{className:`size-3.5`}),` API key`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(l,{value:y,onChange:e=>T(e.target.value),placeholder:`Key name (e.g. Claude desktop)`,className:`h-8 max-w-xs text-sm`}),(0,L.jsx)(x,{type:`button`,size:`sm`,onClick:G,disabled:O,children:O?`Generating…`:`Generate key`})]}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`The key acts as you (your permissions + row-level security). Shown once — copy it immediately. Revoke anytime from the API Keys list.`}),N&&(0,L.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:N})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`Agent skill (portable)`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:K,children:[(0,L.jsx)(E,{className:`size-4`}),` Download SKILL.md`]}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Works with any skills-capable agent (Claude, Codex, Gemini, Cursor…).`})]})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-3 text-xs leading-relaxed`,children:[(0,L.jsx)(`div`,{className:`mb-1 font-medium`,children:`Connect in 3 steps`}),(0,L.jsxs)(`ol`,{className:`list-decimal space-y-0.5 pl-4 text-muted-foreground`,children:[(0,L.jsx)(`li`,{children:`Add a remote MCP server pointing at the endpoint above.`}),(0,L.jsxs)(`li`,{children:[`Set the header `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key: <your key>`}),` (a session Bearer is `,(0,L.jsx)(`em`,{children:`not`}),` an API key).`]}),(0,L.jsxs)(`li`,{children:[`Drop in `,(0,L.jsx)(`code`,{className:`font-mono`,children:`SKILL.md`}),` so the agent knows how to drive your data.`]})]})]})]}),(0,L.jsx)(a,{open:V,onOpenChange:H,children:(0,L.jsxs)(_,{children:[(0,L.jsxs)(f,{children:[(0,L.jsxs)(s,{className:`flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Your new API key`]}),(0,L.jsxs)(u,{children:[`Copy this now — for your security it will `,(0,L.jsx)(`strong`,{children:`not be shown again`}),`.`]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 break-all rounded bg-muted px-2 py-2 font-mono text-xs`,children:F?.key}),(0,L.jsxs)(x,{type:`button`,variant:`secondary`,size:`sm`,className:`gap-1.5`,onClick:()=>F&&W(F.key),children:[U?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),U?`Copied`:`Copy`]})]}),(0,L.jsxs)(b,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsxs)(g,{className:`text-xs`,children:[`Send it as `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key`}),`. It carries your permissions — store it like a password and revoke it if leaked.`]})]})]}),(0,L.jsx)(d,{children:(0,L.jsx)(x,{type:`button`,onClick:()=>H(!1),children:`Done`})})]})})]})}var V={GET:`bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`,POST:`bg-blue-500/10 text-blue-700 dark:text-blue-400`,PATCH:`bg-amber-500/10 text-amber-700 dark:text-amber-400`,DELETE:`bg-red-500/10 text-red-700 dark:text-red-400`};function H({value:e,label:t}){let[n,r]=(0,M.useState)(!1);return(0,L.jsxs)(x,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>{navigator.clipboard?.writeText(e),r(!0),setTimeout(()=>r(!1),1500)},"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function U(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,a=typeof window<`u`?window.location.origin:``,[s,l]=(0,M.useState)([]),[u,d]=(0,M.useState)(!0),[f,g]=(0,M.useState)(null);(0,M.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch(`/api/v1/meta/object`,{credentials:`include`});if(!t.ok)throw Error(`meta/object ${t.status}`);let n=await t.json(),r=n?.data??n?.items??n??[],i=(Array.isArray(r)?r:[]).map(e=>({name:String(e.name??``),label:e.label||void 0})).filter(e=>e.name&&!e.name.startsWith(`sys_`));e||l(i)}catch(t){e||g(t?.message??`failed to load objects`)}finally{e||d(!1)}})(),()=>{e=!0}},[]);let _=s[0]?.name??`your_object`,v=(0,M.useMemo)(()=>`# List ${_} records\ncurl "${a}/api/v1/data/${_}?$top=10" \\\n -H "x-api-key: <YOUR_API_KEY>"`,[a,_]),b=e=>[{method:`GET`,path:`/api/v1/data/${e}`,desc:`List / query`},{method:`POST`,path:`/api/v1/data/${e}`,desc:`Create`},{method:`GET`,path:`/api/v1/data/${e}/:id`,desc:`Read one`},{method:`PATCH`,path:`/api/v1/data/${e}/:id`,desc:`Update`},{method:`DELETE`,path:`/api/v1/data/${e}/:id`,desc:`Delete`}];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,L.jsx)(O,{className:`size-5 text-primary`}),` Integrations & APIs`]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Every object you build is instantly a REST API. Drive your app from code or an agent.`})]}),(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2`,children:[(0,L.jsx)(h,{className:`text-base`,children:`Base URL`}),(0,L.jsx)(c,{className:`text-xs`,children:`This environment's API root.`})]}),(0,L.jsxs)(m,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:[a,`/api/v1`]}),(0,L.jsx)(H,{value:`${a}/api/v1`,label:`base URL`})]})]}),(0,L.jsx)(B,{}),(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(h,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(T,{className:`size-4`}),` REST endpoints`]}),(0,L.jsx)(c,{className:`text-xs`,children:`Auto-generated CRUD for every published object (OData query params on list).`})]}),(0,L.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:()=>e(`${i}/developer/api-console`),children:[(0,L.jsx)(A,{className:`size-4`}),` Open API Console`]})]}),(0,L.jsxs)(m,{className:`flex flex-col gap-4`,children:[u&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading objects…`}),f&&(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Couldn't load objects: `,f]}),!u&&!f&&s.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No business objects yet — build one with the AI assistant, publish it, and it appears here as an API.`}),s.map(e=>(0,L.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`font-medium text-sm`,children:e.label||e.name}),(0,L.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:e.name})]}),(0,L.jsx)(`div`,{className:`divide-y`,children:b(e.name).map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5`,children:[(0,L.jsx)(y,{className:`w-16 justify-center font-mono text-[10px] ${V[e.method]??``}`,children:e.method}),(0,L.jsx)(`code`,{className:`flex-1 truncate font-mono text-xs`,children:e.path}),(0,L.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground sm:inline`,children:e.desc})]},e.method+e.path))})]},e.name))]})]}),(0,L.jsxs)(o,{children:[(0,L.jsx)(p,{className:`pb-2`,children:(0,L.jsxs)(h,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Authentication`]})}),(0,L.jsxs)(m,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`p`,{children:[`In the console you're already authenticated — use `,(0,L.jsx)(`strong`,{children:`Open API Console`}),` above to call these endpoints now.`]}),(0,L.jsxs)(`p`,{children:[`For external programs and AI agents, generate a `,(0,L.jsx)(`strong`,{children:`self-serve API key`}),` in the `,(0,L.jsx)(`strong`,{children:`Connect an AI agent`}),` section above. Send it as the`,` `,(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:`x-api-key`}),` header; it runs under your permissions and row-level security, and is revocable.`]})]})]}),(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsx)(h,{className:`text-base`,children:`Sample (cURL)`}),(0,L.jsx)(H,{value:v,label:`cURL sample`})]}),(0,L.jsx)(m,{children:(0,L.jsx)(`pre`,{className:`overflow-x-auto rounded bg-muted p-3 font-mono text-xs leading-relaxed`,children:v})})]})]})}export{U as IntegrationsPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,m as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{p as a}from"./infrastructure-BHSync5f.js";import{Ot as o,Tt as s,vt as c,wt as l}from"./ui-components-BTB1NkUW.js";import{Fr as u,G as d,K as f,ct as p,ht as m,ii as h}from"./framework-DcWkeiND.js";import{w as g}from"./i18n-runtime-CTgAQF4N.js";import{t as _}from"./vendor-icon-database-C8JGjSkn.js";import{t as v}from"./RecordDetailView-DQKydU7X.js";import{t as y}from"./plugins-views-DraK4xz0.js";var b=e(i(),1),x=[`single`,`group`,`isolated`];function S(e){return e===`group`||e===`isolated`}function C(){let{getAuthConfig:e}=a(),[t,n]=(0,b.useState)(void 0);return(0,b.useEffect)(()=>{let t=!1;return e?.().then(e=>{if(t)return;let r=e?.features?.tenancyPosture;r&&x.includes(r)&&n(r)}).catch(()=>{}),()=>{t=!0}},[e]),t}var w=`uf_`;function T(e){let t={};return e.forEach((e,n)=>{if(n.startsWith(w)&&e!==``){let r=n.slice(3);t[r]=e.split(`,`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}}),Object.keys(t).length>0?t:void 0}function E(e,t){let n=new URLSearchParams(e);for(let[e,r]of Object.entries(t)){let t=w+e;r&&r.length>0?n.set(t,r.map(e=>encodeURIComponent(String(e))).join(`,`)):n.delete(t)}return n}var D=r();function O(e){return Array.isArray(e?.columns)&&e.columns.length>0}function ee(e,t){let n=e?.listViews||e?.list_views||{},r=(t?[n[`${e?.name}.${t}`],n[t],...t==="default"||t===`list`?[e?.list]:[]]:[e?.list,...Object.values(n)]).filter(Boolean);return r.find(O)??r[0]}function k(e,t){let n=n=>t?.orgAttribution&&e?.fields?.organization_id&&!n.includes(`organization_id`)?[...n,`organization_id`]:n,r=e?.highlightFields;if(Array.isArray(r)&&r.length>0)return n(u(e,r.filter(t=>e.fields?.[t])));let i=e?.fields;return i&&typeof i==`object`?n(u(e,Object.entries(i).filter(([e,t])=>t&&!t.hidden&&!h(e,t)).map(([e])=>e)).slice(0,6)):[]}function A(e,t){let n=e?.fields;if(n&&typeof n==`object`)return Object.entries(n).find(([e,n])=>n&&!n.hidden&&!h(e,n)&&t(e,n))?.[0]}var j=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),M=new Set([`date`,`datetime`,`time`]),N=new Set([`image`,`file`,`attachment`,`avatar`,`photo`]);function P(e){let t=A(e,(e,t)=>j.has(t.type))??A(e,e=>/status|stage|state|priority|category|kind/i.test(e));return t?{groupByField:t}:void 0}function F(e){return A(e,(e,t)=>M.has(t.type))??A(e,e=>/date|due|start|end|deadline|schedule/i.test(e))}function I(e){let t=F(e);return t?{startDateField:t}:void 0}function L(e){let t=A(e,(e,t)=>N.has(t.type));return t?{coverField:t}:void 0}var R=new Set([`location`,`geo`,`geolocation`,`geopoint`,`point`]);function z(e){let t=A(e,(e,t)=>M.has(t.type)&&/start|begin|kickoff/i.test(e))??A(e,(e,t)=>M.has(t.type));if(!t)return;let n=A(e,(e,n)=>M.has(n.type)&&e!==t&&/end|due|finish|deadline|close/i.test(e))??A(e,(e,n)=>M.has(n.type)&&e!==t);if(!n)return;let r=A(e,(e,t)=>(t.type===`number`||t.type===`percent`)&&/progress|percent|complete/i.test(e));return{startDateField:t,endDateField:n,...r?{progressField:r}:{}}}function B(e){let t=A(e,(e,t)=>R.has(t.type))??A(e,e=>/location|address|geo|coords?|place|venue/i.test(e));if(t)return{locationField:t}}function V({page:e,className:r,onConfigChange:i,reserveEditAffordance:a}){let{t:u}=g(),{objects:h}=f(),x=d(),S=t(),[w,A]=n(),j=C()===`group`,[M]=b.useState(()=>T(new URLSearchParams(window.location.search))),N=b.useCallback(e=>{A(t=>E(t,e),{replace:!0})},[A]),F=e?.interfaceConfig||{},R=b.useMemo(()=>(h||[]).find(e=>e.name===F.source),[h,F.source]),V=b.useMemo(()=>ee(R,F.sourceView),[R,F.sourceView]),H=F.recordAction===`page`||F.recordAction===`modal`||F.recordAction===`none`?F.recordAction:`drawer`,U=b.useCallback(e=>`/apps/${window.location.pathname.split(`/`)[2]||``}/${F.source}/record/${encodeURIComponent(String(e))}`,[F.source]),W=p({navigation:{mode:H===`none`?`none`:H},objectName:F.source,onNavigate:e=>S(U(e))}),G=w.get(`recordId`),te=b.useCallback((e,t)=>{if(H===`none`)return;let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(U(n),`_blank`);return}if((H===`drawer`||H===`modal`)&&n!=null){A(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t});return}W.handleClick(e,t)},[H,U,W,A]),ne=b.useCallback(()=>{A(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[A]);b.useEffect(()=>{G&&!W.isOpen?W.open({id:G}):!G&&W.isOpen&&W.close()},[G]);let K=R?.name,q=!!V&&!O(V),J=V?.name??(F.sourceView?`${F.source}.${F.sourceView}`:void 0),[Y,X]=b.useState(null);b.useEffect(()=>{let e=!1;if(X(null),K&&F.source&&q&&J)return(async()=>{try{let t=x,n=null;if(typeof t?.listViewOverrides==`function`)try{n=(await t.listViewOverrides(F.source))?.[J]??null}catch{}!O(n)&&typeof t?.getView==`function`&&(n=await t.getView(F.source,J)),!e&&n&&typeof n==`object`&&X(n)}catch{}})(),()=>{e=!0}},[K,F.source,F.sourceView,q,J,x]);let Z=b.useMemo(()=>Y?{...V,...Y}:V,[V,Y]),re=JSON.stringify(Z??null),Q=b.useMemo(()=>{if(!R)return;let e=Z||{},t=F.appearance??e.appearance,n=t?.allowedVisualizations||[],r=new Set(n),i=F.userActions||{},a=e.kanban??(r.has(`kanban`)?P(R):void 0),o=e.calendar??(r.has(`calendar`)?I(R):void 0),s=e.timeline??(r.has(`timeline`)?I(R):void 0),c=e.gallery??(r.has(`gallery`)?L(R):void 0),l=e.gantt??(r.has(`gantt`)?z(R):void 0),u=e.options?.map??(r.has(`map`)?B(R):void 0),d=[...Array.isArray(e.filter)?e.filter:[],...Array.isArray(F.filterBy)?F.filterBy:[]],f=!O(F)&&O(e),p=O(F)?F.columns:f?e.columns:k(R,{orgAttribution:j}),m=Array.isArray(F.sort)&&F.sort.length?F.sort:e.sort;return{type:`list-view`,objectName:R.name,viewType:n[0]??e.type??`grid`,columns:p,...f&&e.hiddenFields!==void 0?{hiddenFields:e.hiddenFields}:{},...f&&e.fieldOrder!==void 0?{fieldOrder:e.fieldOrder}:{},...d.length?{filter:d}:{},...m?.length?{sort:m}:{},grouping:e.grouping,rowColor:e.rowColor,pagination:e.pagination,searchableFields:e.searchableFields,emptyState:e.emptyState,kanban:a,calendar:o,gallery:c,timeline:s,gantt:l,...e.map?{map:e.map}:{},...u||e.options?{options:{...e.options??{},...u?{map:u}:{}}}:{},userFilters:F.userFilters??e.userFilters,appearance:t,showViewSwitcher:n.length>1,showRecordCount:F.showRecordCount,addRecord:F.addRecord,userActions:{search:i.search!==!1,sort:i.sort!==!1,filter:i.filter===!0,rowHeight:i.rowHeight===!0,group:i.group===!0,hideFields:i.hideFields===!0,rowColor:i.rowColor===!0},allowExport:!1,inlineEdit:i.editInline===!0}},[K,re,F,j]);if(!R||!Q)return(0,D.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,D.jsxs)(l,{children:[(0,D.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,D.jsx)(_,{className:`h-6 w-6 text-muted-foreground`})}),(0,D.jsx)(o,{children:u(`empty.objectNotFound`,{defaultValue:`Object Not Found`})}),(0,D.jsx)(s,{children:u(`empty.interfacePageSourceMissing`,{defaultValue:`This interface page references "{{name}}", which is not available.`,name:F.source||`?`})})]})});let $=Array.isArray(F.buttons)&&F.buttons.length?F.buttons.map(e=>(R.actions||[]).find(t=>t?.name===e)).filter(Boolean).map(e=>({...e,locations:[`list_toolbar`]})):[];return(0,D.jsxs)(`div`,{className:r??`h-full flex flex-col`,"data-testid":`interface-list-page`,children:[(0,D.jsxs)(`div`,{className:`pl-4 pt-4 pb-2 shrink-0 flex items-start justify-between gap-3 ${a?`pr-12`:`pr-4`}`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold leading-tight`,children:typeof e.label==`string`?e.label:e.name}),typeof e.description==`string`&&e.description&&(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:e.description})]}),$.length>0&&(0,D.jsx)(`div`,{className:`shrink-0`,"data-testid":`interface-page-buttons`,children:(0,D.jsx)(m,{schema:{type:`action:bar`,location:`list_toolbar`,actions:$,size:`sm`,variant:`outline`}})})]}),(0,D.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:(0,D.jsx)(y,{schema:Q,dataSource:x,userFilterSelections:M,onUserFilterSelectionsChange:N,onSortChange:i?e=>i({sort:e}):void 0,onColumnStateChange:i?e=>{e?.order?.length&&i({columns:e.order})}:void 0,onRowClick:H===`none`?void 0:te})}),W.isOverlay&&(0,D.jsx)(c,{...W,setIsOpen:e=>{e||ne()},title:typeof e.label==`string`?e.label:F.source||`Record`,children:e=>(0,D.jsx)(v,{objectNameOverride:F.source,recordIdOverride:String(e?.id??e?._id??G??``),embedded:!0,dataSource:x,objects:h,onEdit:()=>{}})})]})}export{P as a,S as c,L as i,C as l,I as n,E as o,k as r,T as s,V as t};
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,m as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{p as a}from"./infrastructure-Cc34lEqb.js";import{Et as o,Tt as s,kt as c,yt as l}from"./ui-components-D6cEVg0T.js";import{K as u,Lr as d,gt as f,lt as p,oi as m,q as h}from"./framework-DFR4HNtj.js";import{w as g}from"./i18n-runtime-97_bDVjP.js";import{t as _}from"./vendor-icon-database-C8JGjSkn.js";import{t as v}from"./RecordDetailView-DgR_zhP4.js";import{t as y}from"./plugins-views-CfkgqD30.js";var b=e(i(),1),x=[`single`,`group`,`isolated`];function S(e){return e===`group`||e===`isolated`}function C(){let{getAuthConfig:e}=a(),[t,n]=(0,b.useState)(void 0);return(0,b.useEffect)(()=>{let t=!1;return e?.().then(e=>{if(t)return;let r=e?.features?.tenancyPosture;r&&x.includes(r)&&n(r)}).catch(()=>{}),()=>{t=!0}},[e]),t}var w=`uf_`;function T(e){let t={};return e.forEach((e,n)=>{if(n.startsWith(w)&&e!==``){let r=n.slice(3);t[r]=e.split(`,`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}}),Object.keys(t).length>0?t:void 0}function E(e,t){let n=new URLSearchParams(e);for(let[e,r]of Object.entries(t)){let t=w+e;r&&r.length>0?n.set(t,r.map(e=>encodeURIComponent(String(e))).join(`,`)):n.delete(t)}return n}var D=r();function O(e){return Array.isArray(e?.columns)&&e.columns.length>0}function ee(e,t){let n=e?.listViews||e?.list_views||{},r=(t?[n[`${e?.name}.${t}`],n[t],...t==="default"||t===`list`?[e?.list]:[]]:[e?.list,...Object.values(n)]).filter(Boolean);return r.find(O)??r[0]}function k(e,t){let n=n=>t?.orgAttribution&&e?.fields?.organization_id&&!n.includes(`organization_id`)?[...n,`organization_id`]:n,r=e?.highlightFields;if(Array.isArray(r)&&r.length>0)return n(d(e,r.filter(t=>e.fields?.[t])));let i=e?.fields;return i&&typeof i==`object`?n(d(e,Object.entries(i).filter(([e,t])=>t&&!t.hidden&&!m(e,t)).map(([e])=>e)).slice(0,6)):[]}function A(e,t){let n=e?.fields;if(n&&typeof n==`object`)return Object.entries(n).find(([e,n])=>n&&!n.hidden&&!m(e,n)&&t(e,n))?.[0]}var j=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),M=new Set([`date`,`datetime`,`time`]),N=new Set([`image`,`file`,`attachment`,`avatar`,`photo`]);function P(e){let t=A(e,(e,t)=>j.has(t.type))??A(e,e=>/status|stage|state|priority|category|kind/i.test(e));return t?{groupByField:t}:void 0}function F(e){return A(e,(e,t)=>M.has(t.type))??A(e,e=>/date|due|start|end|deadline|schedule/i.test(e))}function I(e){let t=F(e);return t?{startDateField:t}:void 0}function L(e){let t=A(e,(e,t)=>N.has(t.type));return t?{coverField:t}:void 0}var R=new Set([`location`,`geo`,`geolocation`,`geopoint`,`point`]);function z(e){let t=A(e,(e,t)=>M.has(t.type)&&/start|begin|kickoff/i.test(e))??A(e,(e,t)=>M.has(t.type));if(!t)return;let n=A(e,(e,n)=>M.has(n.type)&&e!==t&&/end|due|finish|deadline|close/i.test(e))??A(e,(e,n)=>M.has(n.type)&&e!==t);if(!n)return;let r=A(e,(e,t)=>(t.type===`number`||t.type===`percent`)&&/progress|percent|complete/i.test(e));return{startDateField:t,endDateField:n,...r?{progressField:r}:{}}}function B(e){let t=A(e,(e,t)=>R.has(t.type))??A(e,e=>/location|address|geo|coords?|place|venue/i.test(e));if(t)return{locationField:t}}function V({page:e,className:r,onConfigChange:i,reserveEditAffordance:a}){let{t:d}=g(),{objects:m}=h(),x=u(),S=t(),[w,A]=n(),j=C()===`group`,[M]=b.useState(()=>T(new URLSearchParams(window.location.search))),N=b.useCallback(e=>{A(t=>E(t,e),{replace:!0})},[A]),F=e?.interfaceConfig||{},R=b.useMemo(()=>(m||[]).find(e=>e.name===F.source),[m,F.source]),V=b.useMemo(()=>ee(R,F.sourceView),[R,F.sourceView]),H=F.recordAction===`page`||F.recordAction===`modal`||F.recordAction===`none`?F.recordAction:`drawer`,U=b.useCallback(e=>`/apps/${window.location.pathname.split(`/`)[2]||``}/${F.source}/record/${encodeURIComponent(String(e))}`,[F.source]),W=p({navigation:{mode:H===`none`?`none`:H},objectName:F.source,onNavigate:e=>S(U(e))}),G=w.get(`recordId`),te=b.useCallback((e,t)=>{if(H===`none`)return;let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(U(n),`_blank`);return}if((H===`drawer`||H===`modal`)&&n!=null){A(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t});return}W.handleClick(e,t)},[H,U,W,A]),ne=b.useCallback(()=>{A(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[A]);b.useEffect(()=>{G&&!W.isOpen?W.open({id:G}):!G&&W.isOpen&&W.close()},[G]);let K=R?.name,q=!!V&&!O(V),J=V?.name??(F.sourceView?`${F.source}.${F.sourceView}`:void 0),[Y,X]=b.useState(null);b.useEffect(()=>{let e=!1;if(X(null),K&&F.source&&q&&J)return(async()=>{try{let t=x,n=null;if(typeof t?.listViewOverrides==`function`)try{n=(await t.listViewOverrides(F.source))?.[J]??null}catch{}!O(n)&&typeof t?.getView==`function`&&(n=await t.getView(F.source,J)),!e&&n&&typeof n==`object`&&X(n)}catch{}})(),()=>{e=!0}},[K,F.source,F.sourceView,q,J,x]);let Z=b.useMemo(()=>Y?{...V,...Y}:V,[V,Y]),re=JSON.stringify(Z??null),Q=b.useMemo(()=>{if(!R)return;let e=Z||{},t=F.appearance??e.appearance,n=t?.allowedVisualizations||[],r=new Set(n),i=F.userActions||{},a=e.kanban??(r.has(`kanban`)?P(R):void 0),o=e.calendar??(r.has(`calendar`)?I(R):void 0),s=e.timeline??(r.has(`timeline`)?I(R):void 0),c=e.gallery??(r.has(`gallery`)?L(R):void 0),l=e.gantt??(r.has(`gantt`)?z(R):void 0),u=e.options?.map??(r.has(`map`)?B(R):void 0),d=[...Array.isArray(e.filter)?e.filter:[],...Array.isArray(F.filterBy)?F.filterBy:[]],f=!O(F)&&O(e),p=O(F)?F.columns:f?e.columns:k(R,{orgAttribution:j}),m=Array.isArray(F.sort)&&F.sort.length?F.sort:e.sort;return{type:`list-view`,objectName:R.name,viewType:n[0]??e.type??`grid`,columns:p,...f&&e.hiddenFields!==void 0?{hiddenFields:e.hiddenFields}:{},...f&&e.fieldOrder!==void 0?{fieldOrder:e.fieldOrder}:{},...d.length?{filter:d}:{},...m?.length?{sort:m}:{},grouping:e.grouping,rowColor:e.rowColor,pagination:e.pagination,searchableFields:e.searchableFields,emptyState:e.emptyState,kanban:a,calendar:o,gallery:c,timeline:s,gantt:l,...e.map?{map:e.map}:{},...u||e.options?{options:{...e.options??{},...u?{map:u}:{}}}:{},userFilters:F.userFilters??e.userFilters,appearance:t,showViewSwitcher:n.length>1,showRecordCount:F.showRecordCount,addRecord:F.addRecord,userActions:{search:i.search!==!1,sort:i.sort!==!1,filter:i.filter===!0,rowHeight:i.rowHeight===!0,group:i.group===!0,hideFields:i.hideFields===!0,rowColor:i.rowColor===!0},allowExport:!1,inlineEdit:i.editInline===!0}},[K,re,F,j]);if(!R||!Q)return(0,D.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,D.jsxs)(s,{children:[(0,D.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,D.jsx)(_,{className:`h-6 w-6 text-muted-foreground`})}),(0,D.jsx)(c,{children:d(`empty.objectNotFound`,{defaultValue:`Object Not Found`})}),(0,D.jsx)(o,{children:d(`empty.interfacePageSourceMissing`,{defaultValue:`This interface page references "{{name}}", which is not available.`,name:F.source||`?`})})]})});let $=Array.isArray(F.buttons)&&F.buttons.length?F.buttons.map(e=>(R.actions||[]).find(t=>t?.name===e)).filter(Boolean).map(e=>({...e,locations:[`list_toolbar`]})):[];return(0,D.jsxs)(`div`,{className:r??`h-full flex flex-col`,"data-testid":`interface-list-page`,children:[(0,D.jsxs)(`div`,{className:`pl-4 pt-4 pb-2 shrink-0 flex items-start justify-between gap-3 ${a?`pr-12`:`pr-4`}`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold leading-tight`,children:typeof e.label==`string`?e.label:e.name}),typeof e.description==`string`&&e.description&&(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:e.description})]}),$.length>0&&(0,D.jsx)(`div`,{className:`shrink-0`,"data-testid":`interface-page-buttons`,children:(0,D.jsx)(f,{schema:{type:`action:bar`,location:`list_toolbar`,actions:$,size:`sm`,variant:`outline`}})})]}),(0,D.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:(0,D.jsx)(y,{schema:Q,dataSource:x,userFilterSelections:M,onUserFilterSelectionsChange:N,onSortChange:i?e=>i({sort:e}):void 0,onColumnStateChange:i?e=>{e?.order?.length&&i({columns:e.order})}:void 0,onRowClick:H===`none`?void 0:te})}),W.isOverlay&&(0,D.jsx)(l,{...W,setIsOpen:e=>{e||ne()},title:typeof e.label==`string`?e.label:F.source||`Record`,children:e=>(0,D.jsx)(v,{objectNameOverride:F.source,recordIdOverride:String(e?.id??e?._id??G??``),embedded:!0,dataSource:x,objects:m,onEdit:()=>{}})})]})}export{P as a,S as c,L as i,C as l,I as n,E as o,k as r,T as s,V as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r}from"./vendor-react-BggL7APJ.js";import{vi as i}from"./ui-components-BTB1NkUW.js";import{w as a}from"./i18n-runtime-CTgAQF4N.js";import{t as o}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as s}from"./vendor-icon-store-CwiX9Ffi.js";import{t as c}from"./app-shell-eager-leaves-CDVclng4.js";var l=e({MarketplaceInstalledPage:()=>d}),u=r();function d(){let e=t(),{appName:r}=n(),{t:l}=a(),d=r?`/apps/${r}`:``;return(0,u.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6 max-w-5xl`,children:[(0,u.jsxs)(i,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>e(`${d}/system/marketplace`),children:[(0,u.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),l(`marketplace.back`)]}),(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(s,{className:`h-6 w-6 text-primary`,"aria-hidden":`true`}),(0,u.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:l(`marketplace.installedTitle`)})]}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,dangerouslySetInnerHTML:{__html:l(`marketplace.installedSubtitle`)}})]}),(0,u.jsx)(c,{})]})}export{l as t};
1
+ import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r}from"./vendor-react-BggL7APJ.js";import{yi as i}from"./ui-components-D6cEVg0T.js";import{w as a}from"./i18n-runtime-97_bDVjP.js";import{t as o}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as s}from"./vendor-icon-store-CwiX9Ffi.js";import{t as c}from"./app-shell-eager-leaves-Cf2bM6uT.js";var l=e({MarketplaceInstalledPage:()=>d}),u=r();function d(){let e=t(),{appName:r}=n(),{t:l}=a(),d=r?`/apps/${r}`:``;return(0,u.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6 max-w-5xl`,children:[(0,u.jsxs)(i,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>e(`${d}/system/marketplace`),children:[(0,u.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),l(`marketplace.back`)]}),(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(s,{className:`h-6 w-6 text-primary`,"aria-hidden":`true`}),(0,u.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:l(`marketplace.installedTitle`)})]}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,dangerouslySetInnerHTML:{__html:l(`marketplace.installedSubtitle`)}})]}),(0,u.jsx)(c,{})]})}export{l as t};
@@ -0,0 +1,4 @@
1
+ import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{d as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as ee}from"./infrastructure-Cc34lEqb.js";import{$n as te,Ar as ne,Bn as re,Br as ie,Fr as ae,In as oe,Ln as se,Mr as ce,Nr as le,On as o,Pr as ue,Qn as s,Rn as de,Ur as fe,Vr as pe,Wr as me,cr as he,er as ge,jr as _e,nr as c,ri as l,yi as u,zn as ve,zr as ye}from"./ui-components-D6cEVg0T.js";import{Kr as d,q as be}from"./framework-DFR4HNtj.js";import{t as xe,w as Se}from"./i18n-runtime-97_bDVjP.js";import{t as Ce}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as we}from"./vendor-icon-boxes-D-Ov3dJw.js";import{t as f}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as Te}from"./vendor-icon-circle-arrow-up-bx9jlxK3.js";import{t as p}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as m}from"./vendor-icon-code-xml-C9EWHSC8.js";import{t as Ee}from"./vendor-icon-database-C8JGjSkn.js";import{t as De}from"./vendor-icon-download-C3csYSaD.js";import{t as Oe}from"./vendor-icon-ellipsis-BjiiCS3N.js";import{t as ke}from"./vendor-icon-external-link-SBKz5x6R.js";import{t as Ae}from"./vendor-icon-folder-tree-BQ1wv9bt.js";import{t as h}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as je}from"./vendor-icon-network-6ADGC5P5.js";import{t as Me}from"./vendor-icon-package-B6zAlWd3.js";import{t as g}from"./vendor-icon-shield-alert-CJYtPI9w.js";import{t as _}from"./vendor-icon-shield-check-CdDzbial.js";import{t as v}from"./vendor-icon-trash-BLsWkwB9.js";import{t as y}from"./vendor-icon-webhook-B43SyK1w.js";import{t as Ne}from"./assistantBus-DoNtw1Tf.js";import{M as Pe,_ as Fe,a as Ie,c as Le,f as Re,g as ze,h as Be,i as Ve,k as b,l as He,n as Ue,o as We,r as Ge,s as Ke,u as qe,v as Je,y as Ye}from"./app-shell-eager-leaves-Cf2bM6uT.js";import{i as Xe,n as Ze,r as Qe,t as $e}from"./usePackageL10n-Ci9uVkRZ.js";var x=e(a(),1),S=i();function C(e){let t=e.replace(/\r\n/g,`
2
+ `).split(`
3
+ `),n=[],r=0;for(;r<t.length;){let e=t[r];if(e.startsWith("```")){let i=e.slice(3).trim();r++;let a=[];for(;r<t.length&&!t[r].startsWith("```");)a.push(t[r]),r++;r++,n.push({type:`code`,text:a.join(`
4
+ `),lang:i});continue}let i=/^(#{1,3})\s+(.*)$/.exec(e);if(i){let e=i[1].length;n.push({type:`h${e}`,text:i[2].trim()}),r++;continue}if(/^[-*]\s+/.test(e)){let e=[];for(;r<t.length&&/^[-*]\s+/.test(t[r]);)e.push(t[r].replace(/^[-*]\s+/,``)),r++;n.push({type:`ul`,items:e});continue}if(/^\d+\.\s+/.test(e)){let e=[];for(;r<t.length&&/^\d+\.\s+/.test(t[r]);)e.push(t[r].replace(/^\d+\.\s+/,``)),r++;n.push({type:`ol`,items:e});continue}if(!e.trim()){r++;continue}let a=[];for(;r<t.length&&t[r].trim()&&!/^#{1,3}\s+/.test(t[r])&&!/^[-*]\s+/.test(t[r])&&!/^\d+\.\s+/.test(t[r])&&!t[r].startsWith("```");)a.push(t[r]),r++;n.push({type:`p`,text:a.join(` `)})}return n}function w(e){let t=[],n=e,r=0,i=[{re:/`([^`]+)`/,render:e=>(0,S.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[0.85em]`,children:e[1]},`k${r++}`)},{re:/\*\*([^*]+)\*\*/,render:e=>(0,S.jsx)(`strong`,{className:`font-semibold text-foreground`,children:e[1]},`k${r++}`)},{re:/\*([^*]+)\*/,render:e=>(0,S.jsx)(`em`,{children:e[1]},`k${r++}`)},{re:/\[([^\]]+)\]\(([^)]+)\)/,render:e=>(0,S.jsx)(`a`,{href:e[2],target:`_blank`,rel:`noopener noreferrer`,className:`text-violet-600 underline-offset-2 hover:underline dark:text-violet-400`,children:e[1]},`k${r++}`)}];for(;n;){let e=-1,r=null,a=null;for(let t of i){let i=t.re.exec(n);i&&(e===-1||i.index<e)&&(e=i.index,r=i,a=t)}if(!r||!a){t.push(n);break}e>0&&t.push(n.slice(0,e)),t.push(a.render(r)),n=n.slice(e+r[0].length)}return(0,S.jsx)(S.Fragment,{children:t.map((e,t)=>(0,S.jsx)(x.Fragment,{children:e},t))})}function et({source:e,className:t}){let n=C(e);return(0,S.jsx)(`div`,{className:`flex flex-col gap-4 text-sm leading-relaxed text-foreground/90 ${t??``}`,children:n.map((e,t)=>{switch(e.type){case`h1`:return(0,S.jsx)(`h2`,{className:`mt-2 text-xl font-bold tracking-tight`,children:w(e.text??``)},t);case`h2`:return(0,S.jsx)(`h3`,{className:`mt-3 text-base font-semibold tracking-tight`,children:w(e.text??``)},t);case`h3`:return(0,S.jsx)(`h4`,{className:`mt-2 text-sm font-semibold tracking-tight text-foreground/80`,children:w(e.text??``)},t);case`p`:return(0,S.jsx)(`p`,{children:w(e.text??``)},t);case`ul`:return(0,S.jsx)(`ul`,{className:`ml-1 flex list-none flex-col gap-1.5`,children:(e.items??[]).map((e,t)=>(0,S.jsxs)(`li`,{className:`flex gap-2`,children:[(0,S.jsx)(`span`,{"aria-hidden":`true`,className:`mt-1.5 inline-block h-1.5 w-1.5 shrink-0 rounded-full bg-violet-500/70`}),(0,S.jsx)(`span`,{children:w(e)})]},t))},t);case`ol`:return(0,S.jsx)(`ol`,{className:`ml-5 flex list-decimal flex-col gap-1.5 marker:text-muted-foreground`,children:(e.items??[]).map((e,t)=>(0,S.jsx)(`li`,{className:`pl-1`,children:w(e)},t))},t);case`code`:return(0,S.jsx)(`pre`,{className:`overflow-x-auto rounded-lg border bg-muted/40 p-3 text-xs leading-relaxed`,children:(0,S.jsx)(`code`,{className:`font-mono`,children:e.text})},t)}return null})})}var tt={node:`In-process · full trust`,sandbox:`Sandboxed`,worker:`Out-of-process`};function T({icon:e,label:t,items:n}){return!n||n.length===0?null:(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,S.jsx)(e,{className:`h-3.5 w-3.5 mt-0.5 text-muted-foreground shrink-0`,"aria-hidden":`true`}),(0,S.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,S.jsx)(`div`,{className:`text-xs font-medium`,children:t}),(0,S.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-0.5`,children:n.map(e=>(0,S.jsx)(`code`,{className:`font-mono text-[11px] px-1 py-0.5 rounded bg-muted break-all`,children:e},e))})]})]})}function nt({version:e}){let{t}=Se();if(!e?.contains_code)return null;let n=e.permissions??{},r=(n.services?.length??0)+(n.hooks?.length??0)+(n.network?.length??0)+(n.fs?.length??0)>0;return(0,S.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 p-3 space-y-3 text-sm`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,S.jsx)(m,{className:`h-4 w-4 text-amber-600 shrink-0`,"aria-hidden":`true`}),t(`marketplace.disclosure.containsCode`,{defaultValue:`This package contains code`})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[e.runtime&&(0,S.jsx)(l,{variant:`outline`,children:t(`marketplace.disclosure.runtime.${e.runtime}`,{defaultValue:tt[e.runtime]})}),e.platform_verified?(0,S.jsxs)(l,{variant:`outline`,className:`gap-1 border-green-500/40 text-green-700 dark:text-green-400`,children:[(0,S.jsx)(_,{className:`h-3 w-3`,"aria-hidden":`true`}),t(`marketplace.disclosure.reviewed`,{defaultValue:`Reviewed & approved`})]}):(0,S.jsxs)(l,{variant:`outline`,className:`gap-1 border-amber-500/40 text-amber-700 dark:text-amber-400`,children:[(0,S.jsx)(g,{className:`h-3 w-3`,"aria-hidden":`true`}),t(`marketplace.disclosure.unreviewed`,{defaultValue:`Not yet reviewed`})]}),e.signed&&(0,S.jsxs)(l,{variant:`outline`,className:`gap-1`,children:[(0,S.jsx)(p,{className:`h-3 w-3`,"aria-hidden":`true`}),t(`marketplace.disclosure.signed`,{defaultValue:`Signed`})]})]}),r?(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t(`marketplace.disclosure.grantsIntro`,{defaultValue:`This package requests:`})}),(0,S.jsx)(T,{icon:we,label:t(`marketplace.disclosure.services`,{defaultValue:`Platform services`}),items:n.services??void 0}),(0,S.jsx)(T,{icon:y,label:t(`marketplace.disclosure.hooks`,{defaultValue:`Lifecycle hooks`}),items:n.hooks??void 0}),(0,S.jsx)(T,{icon:je,label:t(`marketplace.disclosure.network`,{defaultValue:`Network access`}),items:n.network??void 0}),(0,S.jsx)(T,{icon:Ae,label:t(`marketplace.disclosure.fs`,{defaultValue:`Filesystem access`}),items:n.fs??void 0}),(0,S.jsx)(`div`,{className:`text-[11px] text-muted-foreground/80 leading-snug`,children:t(`marketplace.disclosure.notEnforced`,{defaultValue:`Recorded at install, and re-confirmed if a later version asks for more — but the runtime does not yet restrict the package to this list.`})})]}):(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t(`marketplace.disclosure.noPermissions`,{defaultValue:`Requests no special permissions.`})})]})}var E=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function D(e){let t=E.exec(e.trim());return t?{core:[Number(t[1]),Number(t[2]),Number(t[3])],prerelease:t[4]?t[4].split(`.`):[]}:null}var O=/^\d+$/;function rt(e,t){let n=O.test(e),r=O.test(t);return n&&r?Math.sign(Number(e)-Number(t)):n?-1:r?1:e<t?-1:+(e>t)}function k(e,t){let n=D(e),r=D(t);if(!n||!r)return null;for(let e=0;e<3;e+=1)if(n.core[e]!==r.core[e])return n.core[e]<r.core[e]?-1:1;if(n.prerelease.length===0||r.prerelease.length===0)return n.prerelease.length===r.prerelease.length?0:n.prerelease.length===0?1:-1;let i=Math.min(n.prerelease.length,r.prerelease.length);for(let e=0;e<i;e+=1){let t=rt(n.prerelease[e],r.prerelease[e]);if(t!==0)return t}return n.prerelease.length===r.prerelease.length?0:n.prerelease.length<r.prerelease.length?-1:1}function it(e,t){return k(e,t)===1}var A=t({MarketplacePackagePage:()=>j});function j(){let e=n(),{packageId:t,appName:i}=r(),{isAdmin:a,isResolved:we}=ee(),{t:m,language:Ae}=Se(),je=xe(),g={describe:e=>m(e.anchor===`guest`?`marketplace.suggestedBindings.promptGuest`:`marketplace.suggestedBindings.promptEveryone`,{set:e.permission_set_name}),confirm:m(`marketplace.suggestedBindings.confirm`),confirming:m(`marketplace.suggestedBindings.confirming`),dismiss:m(`marketplace.suggestedBindings.dismiss`),confirmedToast:e=>m(`marketplace.suggestedBindings.confirmedToast`,{set:e.permission_set_name,anchor:e.anchor}),dismissedToast:e=>m(`marketplace.suggestedBindings.dismissedToast`,{set:e.permission_set_name})},_=i?`/apps/${i}`:``,{refresh:y}=be(),C=Pe(),[w,tt]=(0,x.useState)(null),[T,E]=(0,x.useState)(C),[D,O]=(0,x.useState)(null),[rt,k]=(0,x.useState)(!1),[A,j]=(0,x.useState)([]),[at,M]=(0,x.useState)(!1),[N,P]=(0,x.useState)(null),[F,ot]=(0,x.useState)(``),[st,ct]=(0,x.useState)({}),[lt,ut]=(0,x.useState)(!1),[dt,ft]=(0,x.useState)(!1),[I,pt]=(0,x.useState)(!1),[L,R]=(0,x.useState)(null),[z,mt]=(0,x.useState)(null),[B,V]=(0,x.useState)(null),[H,U]=(0,x.useState)(null),[W,G]=(0,x.useState)(null),[ht,gt]=(0,x.useState)(!1),[_t,vt]=(0,x.useState)([]),[yt,K]=(0,x.useState)(!1),[q,J]=(0,x.useState)(null);(0,x.useEffect)(()=>{if(!b().features.installLocal||!C||!a)return;let e=!1;return(async()=>{let t=await Re();e||vt(t)})(),()=>{e=!0}},[t,q,C,a]),(0,x.useEffect)(()=>{if(!t||!C||!a)return;let e=b().defaultEnvironmentId??``,n=!1;return(async()=>{let r=await Ie(t,e);!n&&r&&(V(r),mt(r.version))})(),()=>{n=!0}},[t,C,a]),(0,x.useEffect)(()=>{let e=!1;return(async()=>{if(t&&C&&a){E(!0),O(null);try{let n=await We(t);e||tt(n)}catch(t){e||O(t?.message??String(t))}finally{e||E(!1)}}})(),()=>{e=!0}},[t,C,a]);let bt=async()=>{k(!0),R(null),P(null);let e=b().defaultEnvironmentId;if(e){M(!1),ot(e),j([]);return}M(!0);try{let[e,n]=await Promise.all([He(),qe()]),r=e.filter(e=>{let t=e.organization_id;return t?n.has(String(t)):!1});j(r),ct({});let i=t;i&&Promise.all(r.map(async e=>{try{let t=await Ie(i,e.id);return t?[e.id,t.version]:null}catch{return null}})).then(e=>{let t={};for(let n of e)n&&(t[n[0]]=n[1]);ct(t)}),e.length>0&&r.length===0?P(m(`marketplace.install.noPermission`)):r.length===1&&ot(r[0].id)}catch(e){let t=e?.status;P(t===401||t===403?m(`marketplace.install.signInFirst`):e?.message??String(e))}finally{M(!1)}},xt=async()=>{if(t&&F){pt(!0),R(null);try{let e=(await Le({packageId:t,environmentId:F,seedSampleData:lt}))?.installation?.version??w?.package?.latest_version?.version??w?.versions?.[0]?.version??``;mt(e||`installed`);try{let e=b().defaultEnvironmentId||F;if(e){let n=await Ie(t,e);n&&V(n)}}catch{}let n=b().defaultEnvironmentId;if(!n||n===F)try{if(typeof sessionStorage<`u`)for(let e of Object.keys(sessionStorage))e.startsWith(`objectui:metadata:`)&&sessionStorage.removeItem(e);await y()}catch{}R({ok:!0,message:m(`marketplace.install.success`)}),Ne()}catch(e){R({ok:!1,message:e?.message??String(e)})}finally{pt(!1)}}},St=async()=>{if(t){K(!0),J(null);try{let e=await Ke({packageId:t});try{await y(`app`)}catch{}J({ok:!0,message:m(`marketplace.install.localSuccess`,{version:e.version,name:w?.package?$e(w.package,Ae).displayName:e.manifestId})}),Ne()}catch(e){e?.code;let t=e?.message??String(e);d(e,`MANIFEST_CONFLICT`)?t=m(`marketplace.install.localManifestConflict`,{message:t}):d(e,`UNAUTHENTICATED`)?t=m(`marketplace.install.localUnauthorized`):d(e,`MARKETPLACE_UNAVAILABLE`)&&(t=m(`marketplace.install.localMarketplaceUnavailable`)),J({ok:!1,message:t})}finally{K(!1)}}},Ct=async()=>{if(Q&&confirm(m(`marketplace.uninstall.confirm`,{manifestId:Q.manifestId,version:Q.version}))){K(!0),J(null);try{await Ye(Q.manifestId);try{await y(`app`)}catch{}J({ok:!0,message:m(`marketplace.uninstall.successInDetail`,{manifestId:Q.manifestId})})}catch(e){J({ok:!1,message:e?.message??String(e)})}finally{K(!1)}}},wt=async()=>{if(B){U(`reseed`),G(null);try{let e=await Je(B.installationId);e.ok?(V({...B,withSampleData:!0}),G({ok:!0,text:m(`marketplace.detail.reseedQueued`)})):d(e,`ENVIRONMENT_KERNEL_UNAVAILABLE`)?(gt(!0),G({ok:!1,text:m(`marketplace.detail.sampleDataKernelUnavailable`)})):G({ok:!1,text:e.error||`Re-seed failed`})}finally{U(null)}}},Tt=async()=>{if(B&&confirm(m(`marketplace.detail.purgeConfirm`))){U(`purge`),G(null);try{let e=await ze(B.installationId);if(e.ok){V({...B,withSampleData:!1});let t=e.deleted??0;G({ok:!0,text:t>0?m(`marketplace.detail.purgeSuccess`,{count:t}):m(`marketplace.detail.purgeNoData`)})}else d(e,`ENVIRONMENT_KERNEL_UNAVAILABLE`)?(gt(!0),G({ok:!1,text:m(`marketplace.detail.sampleDataKernelUnavailable`)})):G({ok:!1,text:e.error||`Purge failed`})}finally{U(null)}}},Et=async()=>{if(Q){U(`reseed`),G(null);try{let e=await Fe(Q.manifestId);vt(e=>e.map(e=>e.manifestId===Q.manifestId?{...e,withSampleData:!0}:e));let t=e.inserted??0,n=e.updated??0,r=e.errors??0,i=m(`marketplace.detail.reseedLocalSuccess`,{inserted:t,updated:n});G(r>0?{ok:!1,text:`${i} ${m(`marketplace.detail.reseedPartialErrors`,{count:r})}`}:{ok:!0,text:i})}catch(e){G({ok:!1,text:e?.message||`Re-seed failed`})}finally{U(null)}}},Dt=async()=>{if(Q&&confirm(m(`marketplace.detail.purgeConfirm`))){U(`purge`),G(null);try{let e=await Be(Q.manifestId);vt(e=>e.map(e=>e.manifestId===Q.manifestId?{...e,withSampleData:!1}:e));let t=e.deleted??0;G({ok:!0,text:t>0?m(`marketplace.detail.purgeSuccess`,{count:t}):m(`marketplace.detail.purgeNoData`)})}catch(e){G({ok:!1,text:e?.message||`Purge failed`})}finally{U(null)}}};if(!C)return(0,S.jsx)(Ze,{});if(!we)return(0,S.jsx)(Qe,{});if(!a)return(0,S.jsx)(Ge,{});if(T)return(0,S.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex flex-col gap-6 p-4 sm:p-6`,children:[(0,S.jsx)(o,{className:`h-8 w-32`}),(0,S.jsx)(o,{className:`h-16 w-full`}),(0,S.jsx)(o,{className:`h-64 w-full`})]});if(D||!w)return(0,S.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex flex-col gap-6 p-4 sm:p-6`,children:[(0,S.jsxs)(u,{variant:`ghost`,size:`sm`,onClick:()=>e(`${_}/system/marketplace`),children:[(0,S.jsx)(Ce,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),m(`marketplace.back`)]}),(0,S.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-destructive/30 bg-destructive/5 p-4 text-sm`,children:[(0,S.jsx)(f,{className:`h-4 w-4 mt-0.5 text-destructive`,"aria-hidden":`true`}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`font-medium text-destructive`,children:m(`marketplace.load.packageFailed`)}),(0,S.jsx)(`div`,{className:`text-muted-foreground mt-1`,children:D??m(`marketplace.load.notFound`)})]})]})]});let Y=w.package,X=$e(Y,Ae),Z=Y.latest_version?.version??w.versions[0]?.version??null,Q=_t.find(e=>e.manifestId===Y.manifest_id)??null,Ot=!!Y.latest_version?.contains_code,$=!!z&&!!Z&&it(Z,z),kt=b().features.installLocal,At=!Z||yt||I||!kt&&!!z&&!$,jt=kt?{label:m(yt?`marketplace.action.working`:Q?`marketplace.action.reinstall`:`marketplace.action.install`),onClick:St}:{label:I?m(`marketplace.action.installing`):z?$?m(`marketplace.action.updateTo`,{defaultValue:`Update`}):m(`marketplace.action.installed`,{defaultValue:`Installed`}):m(`marketplace.action.installToCloud`),onClick:bt},Mt=Y.category?m(`marketplace.category.${Y.category}`,{defaultValue:Y.category}):null;return(0,S.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex flex-col gap-6 p-4 sm:p-6`,children:[(0,S.jsxs)(u,{variant:`ghost`,size:`sm`,className:`self-start -ml-2 text-muted-foreground hover:text-foreground`,onClick:()=>e(`${_}/system/marketplace`),children:[(0,S.jsx)(Ce,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),m(`marketplace.back`)]}),(0,S.jsxs)(`div`,{className:`flex items-start gap-5 flex-wrap sm:flex-nowrap rounded-2xl border bg-gradient-to-br from-primary/5 via-background to-background p-6 sm:p-8`,children:[(0,S.jsx)(Xe,{iconUrl:Y.icon_url,displayName:X.displayName,manifestId:Y.manifest_id,className:`h-20 w-20 rounded-2xl shadow-sm ring-1 ring-border shrink-0`,initialClassName:`text-3xl font-bold`}),(0,S.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,S.jsx)(`h1`,{className:`text-2xl sm:text-3xl font-bold tracking-tight truncate`,children:X.displayName||Y.manifest_id}),Y.homepage_url&&(0,S.jsxs)(`a`,{href:Y.homepage_url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:m(`marketplace.detail.homepage`),children:[(0,S.jsx)(ke,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),(0,S.jsx)(`span`,{className:`hidden sm:inline`,children:m(`marketplace.detail.homepage`)})]})]}),(0,S.jsxs)(`div`,{className:`text-sm text-muted-foreground mt-2 flex flex-wrap items-center gap-1.5`,children:[(0,S.jsx)(`code`,{className:`font-mono text-xs px-1.5 py-0.5 rounded bg-muted`,children:Y.manifest_id}),Z&&(0,S.jsx)(l,{variant:`outline`,children:m(`marketplace.versionBadge`,{version:Z})}),Y.publisher&&Y.publisher!==`private`&&(0,S.jsx)(l,{variant:Y.publisher===`objectstack`?`default`:`secondary`,children:Y.publisher}),Mt&&(0,S.jsx)(l,{variant:`outline`,children:Mt}),Y.license&&(0,S.jsx)(l,{variant:`outline`,className:`font-normal`,children:Y.license}),Q&&(0,S.jsxs)(l,{variant:`default`,className:`bg-green-600 hover:bg-green-600 gap-1`,children:[(0,S.jsx)(p,{className:`h-3 w-3`,"aria-hidden":`true`}),m(`marketplace.detail.installedV`,{version:Q.version})]}),!Q&&z&&(0,S.jsxs)(l,{variant:`default`,className:`bg-green-600 hover:bg-green-600 gap-1`,children:[(0,S.jsx)(p,{className:`h-3 w-3`,"aria-hidden":`true`}),m(`marketplace.detail.installedV`,{version:z})]}),$&&(0,S.jsxs)(l,{variant:`default`,className:`bg-amber-500 hover:bg-amber-500 gap-1`,children:[(0,S.jsx)(Te,{className:`h-3 w-3`,"aria-hidden":`true`}),m(`marketplace.detail.updateAvailable`,{defaultValue:`Update available`}),` → v`,Z]})]}),X.description&&(0,S.jsx)(`p`,{className:`text-sm sm:text-base text-foreground/80 mt-3 max-w-2xl leading-relaxed`,children:X.description})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 self-start`,children:[(0,S.jsxs)(u,{onClick:jt.onClick,disabled:At,size:`lg`,className:`min-w-[8rem]`,children:[(0,S.jsx)(De,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),jt.label]}),Q&&(0,S.jsxs)(te,{children:[(0,S.jsx)(he,{asChild:!0,children:(0,S.jsx)(u,{variant:`outline`,size:`lg`,className:`px-2.5`,"aria-label":m(`marketplace.detail.moreOptions`),children:(0,S.jsx)(Oe,{className:`h-4 w-4`,"aria-hidden":`true`})})}),(0,S.jsxs)(ge,{align:`end`,className:`w-56`,children:[(0,S.jsxs)(c,{onSelect:Et,disabled:H!==null,children:[H===`reseed`?(0,S.jsx)(h,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,S.jsx)(Ee,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),Q.withSampleData?m(`marketplace.detail.reseedAgain`):m(`marketplace.detail.addSampleData`)]}),(0,S.jsxs)(c,{onSelect:Dt,disabled:H!==null||!Q.withSampleData,className:`text-destructive focus:text-destructive`,children:[H===`purge`?(0,S.jsx)(h,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,S.jsx)(v,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),m(`marketplace.detail.purgeSampleData`)]}),(0,S.jsxs)(c,{onSelect:Ct,disabled:yt,className:`text-destructive focus:text-destructive`,children:[(0,S.jsx)(v,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),m(`marketplace.detail.uninstallFromRuntime`)]})]})]}),!Q&&B&&!b().cloudUrl&&(0,S.jsxs)(te,{children:[(0,S.jsx)(he,{asChild:!0,children:(0,S.jsx)(u,{variant:`outline`,size:`lg`,className:`px-2.5`,"aria-label":m(`marketplace.detail.moreOptions`),children:(0,S.jsx)(Oe,{className:`h-4 w-4`,"aria-hidden":`true`})})}),(0,S.jsxs)(ge,{align:`end`,className:`w-56`,children:[(0,S.jsxs)(c,{onSelect:wt,disabled:H!==null||ht,children:[H===`reseed`?(0,S.jsx)(h,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,S.jsx)(Ee,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),B.withSampleData?m(`marketplace.detail.reseedAgain`):m(`marketplace.detail.addSampleData`)]}),(0,S.jsxs)(c,{onSelect:Tt,disabled:H!==null||ht||!B.withSampleData,className:`text-destructive focus:text-destructive`,children:[H===`purge`?(0,S.jsx)(h,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,S.jsx)(v,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),m(`marketplace.detail.purgeSampleData`)]})]})]})]})]}),W&&(0,S.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border p-3 text-sm ${W.ok?`border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:[W.ok?(0,S.jsx)(p,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}):(0,S.jsx)(f,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}),(0,S.jsx)(`div`,{className:`flex-1`,children:W.text}),(0,S.jsx)(`button`,{type:`button`,className:`text-xs underline opacity-60 hover:opacity-100`,onClick:()=>G(null),children:m(`marketplace.action.dismiss`)})]}),q&&(0,S.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border p-3 text-sm whitespace-pre-wrap ${q.ok?`border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:[q.ok?(0,S.jsx)(p,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}):(0,S.jsx)(f,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}),(0,S.jsxs)(`div`,{className:`flex-1`,children:[q.message,q.ok&&(0,S.jsx)(Ue,{packageId:Y.manifest_id,strings:g,className:`mt-2`})]}),(0,S.jsx)(`button`,{type:`button`,className:`text-xs underline opacity-60 hover:opacity-100`,onClick:()=>J(null),children:m(`marketplace.action.dismiss`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,S.jsx)(`div`,{className:`lg:col-span-2 space-y-4`,children:(0,S.jsxs)(ie,{children:[(0,S.jsx)(fe,{children:(0,S.jsx)(me,{className:`text-base`,children:m(`marketplace.detail.about`)})}),(0,S.jsx)(pe,{children:X.readme?(0,S.jsx)(et,{source:X.readme}):(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(`marketplace.detail.noReadme`)})})]})}),(0,S.jsx)(`div`,{className:`space-y-4`,children:(0,S.jsxs)(ie,{children:[(0,S.jsx)(fe,{children:(0,S.jsx)(me,{className:`text-base`,children:m(`marketplace.detail.versions`)})}),(0,S.jsx)(pe,{children:w.versions.length===0?(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(`marketplace.detail.noApprovedVersions`)}):(0,S.jsx)(`ul`,{className:`space-y-3`,children:w.versions.map(e=>(0,S.jsxs)(`li`,{className:`space-y-1 text-sm`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(Me,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),(0,S.jsxs)(`code`,{className:`font-mono`,children:[`v`,e.version]}),e.is_prerelease&&(0,S.jsx)(l,{variant:`outline`,className:`text-xs`,children:m(`marketplace.detail.prerelease`)})]}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.published_at?new Date(e.published_at).toLocaleDateString(je):`—`})]}),e.release_notes&&e.release_notes.trim()&&(0,S.jsx)(`p`,{className:`whitespace-pre-line pl-5 text-xs text-muted-foreground`,children:e.release_notes.trim()})]},e.id))})})]})})]}),(0,S.jsx)(ne,{open:rt,onOpenChange:e=>{k(e),e||(R(null),ft(!1))},children:(0,S.jsxs)(_e,{children:[(0,S.jsxs)(ue,{children:[(0,S.jsx)(ae,{children:m(`marketplace.install.dialogTitle`,{name:X.displayName||Y.manifest_id})}),(0,S.jsx)(ce,{children:b().defaultEnvironmentId?m(`marketplace.install.dialogDescCurrent`,{host:typeof window<`u`?window.location.host:``}):m(`marketplace.install.dialogDescPicker`)})]}),at?(0,S.jsx)(o,{className:`h-10 w-full`}):N?(0,S.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 p-3 text-sm space-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,S.jsx)(f,{className:`h-4 w-4 mt-0.5 text-amber-600`,"aria-hidden":`true`}),(0,S.jsx)(`div`,{className:`flex-1`,children:N})]}),Ve()?(0,S.jsx)(`a`,{href:Ve(),target:`_blank`,rel:`noopener noreferrer`,children:(0,S.jsxs)(u,{variant:`outline`,size:`sm`,className:`w-full`,children:[(0,S.jsx)(ke,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),m(`marketplace.action.openOnCloud`)]})}):null]}):b().defaultEnvironmentId?(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ye,{id:`seed`,checked:lt,onCheckedChange:e=>ut(e===!0)}),(0,S.jsx)(s,{htmlFor:`seed`,className:`text-sm font-normal cursor-pointer`,children:m(`marketplace.install.includeSampleData`)})]}):A.length===0?(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:m(`marketplace.install.noEnvs`)}):(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(s,{htmlFor:`env-select`,children:m(`marketplace.install.environment`)}),(0,S.jsxs)(oe,{value:F,onValueChange:ot,children:[(0,S.jsx)(ve,{id:`env-select`,children:(0,S.jsx)(re,{placeholder:m(`marketplace.install.environmentPlaceholder`)})}),(0,S.jsx)(se,{children:A.map(e=>{let t=st[e.id],n=!!t&&!!Z&&it(Z,t);return(0,S.jsxs)(de,{value:e.id,children:[e.display_name||e.hostname||e.id,e.plan&&(0,S.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.plan]}),t&&(n?(0,S.jsxs)(`span`,{className:`text-amber-600`,children:[` · `,m(`marketplace.install.updateTo`,{defaultValue:`Update → v{{version}}`,version:Z})]}):(0,S.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,m(`marketplace.install.installedVersion`,{defaultValue:`Installed v{{version}}`,version:t})]}))]},e.id)})})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ye,{id:`seed`,checked:lt,onCheckedChange:e=>ut(e===!0)}),(0,S.jsx)(s,{htmlFor:`seed`,className:`text-sm font-normal cursor-pointer`,children:m(`marketplace.install.includeSampleData`)})]})]}),Ot&&!N&&(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsx)(nt,{version:Y.latest_version}),(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,S.jsx)(ye,{id:`ack-perms`,checked:dt,onCheckedChange:e=>ft(e===!0)}),(0,S.jsx)(s,{htmlFor:`ack-perms`,className:`text-sm font-normal cursor-pointer leading-snug`,children:m(`marketplace.disclosure.acknowledge`,{defaultValue:`I understand this package runs code and grants the permissions above.`})})]})]}),L&&(0,S.jsx)(`div`,{className:`rounded-md border p-3 text-sm ${L.ok?`border-green-500/30 bg-green-500/5 text-green-700`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:L.message}),L?.ok===!0&&b().defaultEnvironmentId&&b().defaultEnvironmentId===F&&(0,S.jsx)(Ue,{packageId:Y.manifest_id,strings:g}),(0,S.jsxs)(le,{children:[(0,S.jsx)(u,{variant:`outline`,onClick:()=>k(!1),children:m(`marketplace.action.close`)}),!N&&(0,S.jsx)(u,{onClick:xt,disabled:!F||I||L?.ok===!0||Ot&&!dt,children:m(I?`marketplace.action.installing`:`marketplace.action.install`)})]})]})})]})}export{A as t};
@@ -1 +1 @@
1
- import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{d as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as o}from"./infrastructure-BHSync5f.js";import{Br as s,Dn as c,Hr as l,Ur as u,Vr as d,ni as f,qn as ee,vi as p,zr as m}from"./ui-components-BTB1NkUW.js";import{t as h,w as g}from"./i18n-runtime-CTgAQF4N.js";import{t as te}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as _}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as v}from"./vendor-icon-package-B6zAlWd3.js";import{t as ne}from"./vendor-icon-refresh-ccw-QRCaXN-I.js";import{t as re}from"./vendor-icon-search-B2Uqtp_W.js";import{t as ie}from"./vendor-icon-settings-CYQ7xc_F.js";import{t as y}from"./vendor-icon-store-CwiX9Ffi.js";import{t as ae}from"./assistantBus-DoNtw1Tf.js";import{M as oe,c as b,d as x,f as se,k as ce,m as le,p as ue,r as de,s as fe,x as S}from"./app-shell-eager-leaves-CDVclng4.js";import{i as C,n as w,r as T,t as E}from"./usePackageL10n-CMx66am-.js";var D=t({MarketplacePage:()=>A}),O=e(a(),1),k=i();function pe(){let{t:e}=g(),t=h();return n=>{if(!n)return``;let r=new Date(n);if(Number.isNaN(r.getTime()))return``;let i=Math.floor((Date.now()-r.getTime())/864e5);if(i<1)return e(`marketplace.relativeTime.today`);try{let e=new Intl.RelativeTimeFormat(t,{numeric:`auto`});return i<30?e.format(-i,`day`):i<365?e.format(-Math.floor(i/30),`month`):e.format(-Math.floor(i/365),`year`)}catch{return i<30?e(`marketplace.relativeTime.daysAgo`,{count:i}):i<365?e(`marketplace.relativeTime.monthsAgo`,{count:Math.floor(i/30)}):e(`marketplace.relativeTime.yearsAgo`,{count:Math.floor(i/365)})}}}function A(){let e=n(),{appName:t}=r(),{isAdmin:i,isResolved:a}=o(),{t:h,language:D}=g(),A=pe(),j=t?`/apps/${t}`:``,M=oe(),N=S(),[P,F]=(0,O.useState)([]),[I,L]=(0,O.useState)(M),[R,z]=(0,O.useState)(null),[B,me]=(0,O.useState)(``),[V,H]=(0,O.useState)(``),[U,he]=(0,O.useState)([]),[W,ge]=(0,O.useState)([]),[G,K]=(0,O.useState)(null),[q,J]=(0,O.useState)(null),[_e,ve]=(0,O.useState)(new Set),Y=(0,O.useMemo)(()=>{let e=new Map;for(let t of U)e.set(t.manifestId,t);return e},[U]),X=async()=>{L(!0),z(null);try{let[e,t,n,r]=await Promise.all([ue({limit:100}),se(),le(),x()]);F(e.items??[]),he(t),ge(n.items??[]);let i=new Set;for(let e of t)i.add(e.manifestId);for(let e of r.items)i.add(e.manifestId);ve(i)}catch(e){z(e?.message??String(e)),F([])}finally{L(!1)}};(0,O.useEffect)(()=>{M&&X()},[M]);let ye=async e=>{K(e.id),J(null);try{ce().features.installLocal?await fe({packageId:e.manifest_id||e.id,versionId:`latest`}):await b({packageId:e.id,environmentId:``,seedSampleData:!0}),J({ok:!0,text:h(`marketplace.org.installed`,{defaultValue:`Installed ${e.display_name}`,name:e.display_name})}),await X(),ae()}catch(e){J({ok:!1,text:e?.message??String(e)})}finally{K(null)}},Z=(0,O.useMemo)(()=>{let e=new Set;for(let t of P)t.category&&e.add(t.category);return Array.from(e).sort()},[P]),Q=e=>{let t=`marketplace.category.${e}`,n=h(t,{defaultValue:e});return n===t?e:n},$=(0,O.useMemo)(()=>{let e=B.trim().toLowerCase();return P.filter(t=>{if(V&&t.category!==V)return!1;if(!e)return!0;let n=E(t,D);return`${n.displayName} ${t.manifest_id} ${n.description??``}`.toLowerCase().includes(e)})},[P,B,V,D]);return M?a?i?(0,k.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4 flex-wrap`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(y,{className:`h-6 w-6 text-primary`,"aria-hidden":`true`}),(0,k.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:h(`marketplace.title`)})]}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:h(`marketplace.subtitle`)})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(p,{variant:`outline`,size:`sm`,onClick:()=>e(`${j}/system/marketplace/installed`),children:[(0,k.jsx)(ie,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),U.length>0?h(`marketplace.installedCount`,{count:U.length}):h(`marketplace.installed`)]}),(0,k.jsxs)(p,{variant:`outline`,size:`sm`,onClick:()=>void X(),disabled:I,children:[(0,k.jsx)(ne,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),h(`marketplace.refresh`)]})]})]}),(0,k.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3`,children:[(0,k.jsxs)(`div`,{className:`relative flex-1`,children:[(0,k.jsx)(re,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),(0,k.jsx)(ee,{value:B,onChange:e=>me(e.target.value),placeholder:h(`marketplace.searchPlaceholder`),className:`pl-9`,"aria-label":h(`marketplace.searchAria`)})]}),Z.length>0&&(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,k.jsx)(p,{size:`sm`,variant:V===``?`default`:`outline`,onClick:()=>H(``),children:h(`marketplace.all`)}),Z.map(e=>(0,k.jsx)(p,{size:`sm`,variant:V===e?`default`:`outline`,onClick:()=>H(e),children:Q(e)},e))]})]}),R&&(0,k.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-destructive/30 bg-destructive/5 p-4 text-sm`,children:[(0,k.jsx)(te,{className:`h-4 w-4 mt-0.5 text-destructive`,"aria-hidden":`true`}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-medium text-destructive`,children:h(`marketplace.load.failed`)}),(0,k.jsx)(`div`,{className:`text-muted-foreground mt-1`,children:R}),(0,k.jsx)(`div`,{className:`text-xs text-muted-foreground mt-2`,"data-testid":`marketplace-load-hint`,children:N?h(`marketplace.load.failedHintConfigured`,{url:N}):h(`marketplace.load.failedHintSameOrigin`)})]})]}),W.length>0&&(0,k.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(y,{className:`h-5 w-5 text-primary`,"aria-hidden":`true`}),(0,k.jsx)(`h2`,{className:`text-sm font-semibold`,children:h(`marketplace.org.heading`,{defaultValue:`Your organization`})}),(0,k.jsx)(f,{variant:`secondary`,className:`text-xs`,children:W.length})]}),q&&(0,k.jsx)(`div`,{className:`rounded-md border p-3 text-sm ${q.ok?`border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:q.text}),(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:W.map(e=>{let t=_e.has(e.manifest_id);return(0,k.jsxs)(m,{className:`flex flex-col`,"data-testid":`org-card-${e.manifest_id}`,children:[(0,k.jsxs)(l,{className:`flex flex-row items-start gap-3 pb-2`,children:[(0,k.jsx)(C,{iconUrl:e.icon_url,displayName:e.display_name,manifestId:e.manifest_id}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(u,{className:`text-base truncate`,children:e.display_name}),(0,k.jsx)(d,{className:`text-xs truncate`,children:(0,k.jsx)(`code`,{className:`font-mono`,children:e.manifest_id})})]}),e.visibility&&(0,k.jsx)(f,{variant:`outline`,className:`shrink-0 text-xs`,children:e.visibility})]}),(0,k.jsxs)(s,{className:`flex-1 flex flex-col gap-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:e.description||h(`marketplace.noDescription`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 mt-auto pt-2 flex-wrap`,children:[e.latest_version&&(0,k.jsxs)(f,{variant:`outline`,className:`text-xs`,children:[(0,k.jsx)(v,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.versionBadge`,{version:e.latest_version})]}),(0,k.jsx)(`div`,{className:`ml-auto`,children:t?(0,k.jsxs)(f,{variant:`default`,className:`text-xs bg-green-600 hover:bg-green-600`,children:[(0,k.jsx)(_,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.org.installedBadge`,{defaultValue:`Installed`})]}):(0,k.jsx)(p,{size:`sm`,onClick:()=>void ye(e),disabled:G===e.id,children:G===e.id?h(`marketplace.org.installing`,{defaultValue:`Installing…`}):h(`marketplace.org.install`,{defaultValue:`Install`})})})]})]})]},e.id)})}),(0,k.jsx)(`div`,{className:`border-b pt-2`})]}),I&&P.length===0?(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,k.jsxs)(m,{children:[(0,k.jsxs)(l,{className:`pb-2`,children:[(0,k.jsx)(c,{className:`h-10 w-10 rounded-lg mb-2`}),(0,k.jsx)(c,{className:`h-5 w-3/4`}),(0,k.jsx)(c,{className:`h-4 w-1/2 mt-1`})]}),(0,k.jsx)(s,{children:(0,k.jsx)(c,{className:`h-12 w-full`})})]},t))}):$.length===0?(0,k.jsx)(`div`,{className:`text-center py-12 text-sm text-muted-foreground`,children:P.length===0?h(`marketplace.noApprovedYet`):h(`marketplace.noMatchFilters`)}):(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:$.map(t=>{let n=Y.get(t.manifest_id),r=E(t,D);return(0,k.jsxs)(m,{className:`cursor-pointer transition-colors hover:bg-accent/50 flex flex-col`,onClick:()=>e(`${j}/system/marketplace/${t.id}`),role:`link`,tabIndex:0,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e(`${j}/system/marketplace/${t.id}`))},"data-testid":`marketplace-card-${t.manifest_id}`,children:[(0,k.jsxs)(l,{className:`flex flex-row items-start gap-3 pb-2`,children:[(0,k.jsx)(C,{iconUrl:t.icon_url,displayName:r.displayName,manifestId:t.manifest_id}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(u,{className:`text-base truncate`,children:r.displayName}),(0,k.jsx)(d,{className:`text-xs truncate`,children:(0,k.jsx)(`code`,{className:`font-mono`,children:t.manifest_id})})]}),t.publisher&&t.publisher!==`private`&&(0,k.jsx)(f,{variant:t.publisher===`objectstack`?`default`:`secondary`,className:`shrink-0`,children:t.publisher})]}),(0,k.jsxs)(s,{className:`flex-1 flex flex-col gap-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:r.description||h(`marketplace.noDescription`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 mt-auto pt-2 flex-wrap`,children:[n&&(0,k.jsxs)(f,{variant:`default`,className:`text-xs bg-green-600 hover:bg-green-600`,children:[(0,k.jsx)(_,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.installedBadge`,{version:n.version})]}),t.latest_version?.version&&(0,k.jsxs)(f,{variant:`outline`,className:`text-xs`,children:[(0,k.jsx)(v,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.versionBadge`,{version:t.latest_version.version})]}),t.category&&(0,k.jsx)(f,{variant:`outline`,className:`text-xs`,children:Q(t.category)}),t.latest_version?.published_at&&(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:A(t.latest_version.published_at)})]})]})]},t.id)})})]}):(0,k.jsx)(de,{}):(0,k.jsx)(T,{}):(0,k.jsx)(w,{})}export{D as t};
1
+ import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{d as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as ee}from"./infrastructure-Cc34lEqb.js";import{Br as o,Hr as s,Jn as te,On as c,Ur as l,Vr as u,Wr as d,ri as f,yi as p}from"./ui-components-D6cEVg0T.js";import{t as m,w as h}from"./i18n-runtime-97_bDVjP.js";import{t as ne}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as g}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as _}from"./vendor-icon-package-B6zAlWd3.js";import{t as re}from"./vendor-icon-refresh-ccw-QRCaXN-I.js";import{t as ie}from"./vendor-icon-search-B2Uqtp_W.js";import{t as ae}from"./vendor-icon-settings-CYQ7xc_F.js";import{t as v}from"./vendor-icon-store-CwiX9Ffi.js";import{t as oe}from"./assistantBus-DoNtw1Tf.js";import{M as se,c as y,d as b,f as x,k as ce,m as le,p as ue,r as de,s as fe,x as S}from"./app-shell-eager-leaves-Cf2bM6uT.js";import{i as C,n as w,r as T,t as E}from"./usePackageL10n-Ci9uVkRZ.js";var D=t({MarketplacePage:()=>A}),O=e(a(),1),k=i();function pe(){let{t:e}=h(),t=m();return n=>{if(!n)return``;let r=new Date(n);if(Number.isNaN(r.getTime()))return``;let i=Math.floor((Date.now()-r.getTime())/864e5);if(i<1)return e(`marketplace.relativeTime.today`);try{let e=new Intl.RelativeTimeFormat(t,{numeric:`auto`});return i<30?e.format(-i,`day`):i<365?e.format(-Math.floor(i/30),`month`):e.format(-Math.floor(i/365),`year`)}catch{return i<30?e(`marketplace.relativeTime.daysAgo`,{count:i}):i<365?e(`marketplace.relativeTime.monthsAgo`,{count:Math.floor(i/30)}):e(`marketplace.relativeTime.yearsAgo`,{count:Math.floor(i/365)})}}}function A(){let e=n(),{appName:t}=r(),{isAdmin:i,isResolved:a}=ee(),{t:m,language:D}=h(),A=pe(),j=t?`/apps/${t}`:``,M=se(),N=S(),[P,F]=(0,O.useState)([]),[I,L]=(0,O.useState)(M),[R,z]=(0,O.useState)(null),[B,me]=(0,O.useState)(``),[V,H]=(0,O.useState)(``),[U,he]=(0,O.useState)([]),[W,ge]=(0,O.useState)([]),[G,K]=(0,O.useState)(null),[q,J]=(0,O.useState)(null),[_e,ve]=(0,O.useState)(new Set),Y=(0,O.useMemo)(()=>{let e=new Map;for(let t of U)e.set(t.manifestId,t);return e},[U]),X=async()=>{L(!0),z(null);try{let[e,t,n,r]=await Promise.all([ue({limit:100}),x(),le(),b()]);F(e.items??[]),he(t),ge(n.items??[]);let i=new Set;for(let e of t)i.add(e.manifestId);for(let e of r.items)i.add(e.manifestId);ve(i)}catch(e){z(e?.message??String(e)),F([])}finally{L(!1)}};(0,O.useEffect)(()=>{M&&X()},[M]);let ye=async e=>{K(e.id),J(null);try{ce().features.installLocal?await fe({packageId:e.manifest_id||e.id,versionId:`latest`}):await y({packageId:e.id,environmentId:``,seedSampleData:!0}),J({ok:!0,text:m(`marketplace.org.installed`,{defaultValue:`Installed ${e.display_name}`,name:e.display_name})}),await X(),oe()}catch(e){J({ok:!1,text:e?.message??String(e)})}finally{K(null)}},Z=(0,O.useMemo)(()=>{let e=new Set;for(let t of P)t.category&&e.add(t.category);return Array.from(e).sort()},[P]),Q=e=>{let t=`marketplace.category.${e}`,n=m(t,{defaultValue:e});return n===t?e:n},$=(0,O.useMemo)(()=>{let e=B.trim().toLowerCase();return P.filter(t=>{if(V&&t.category!==V)return!1;if(!e)return!0;let n=E(t,D);return`${n.displayName} ${t.manifest_id} ${n.description??``}`.toLowerCase().includes(e)})},[P,B,V,D]);return M?a?i?(0,k.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4 flex-wrap`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(v,{className:`h-6 w-6 text-primary`,"aria-hidden":`true`}),(0,k.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:m(`marketplace.title`)})]}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:m(`marketplace.subtitle`)})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(p,{variant:`outline`,size:`sm`,onClick:()=>e(`${j}/system/marketplace/installed`),children:[(0,k.jsx)(ae,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),U.length>0?m(`marketplace.installedCount`,{count:U.length}):m(`marketplace.installed`)]}),(0,k.jsxs)(p,{variant:`outline`,size:`sm`,onClick:()=>void X(),disabled:I,children:[(0,k.jsx)(re,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),m(`marketplace.refresh`)]})]})]}),(0,k.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3`,children:[(0,k.jsxs)(`div`,{className:`relative flex-1`,children:[(0,k.jsx)(ie,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),(0,k.jsx)(te,{value:B,onChange:e=>me(e.target.value),placeholder:m(`marketplace.searchPlaceholder`),className:`pl-9`,"aria-label":m(`marketplace.searchAria`)})]}),Z.length>0&&(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,k.jsx)(p,{size:`sm`,variant:V===``?`default`:`outline`,onClick:()=>H(``),children:m(`marketplace.all`)}),Z.map(e=>(0,k.jsx)(p,{size:`sm`,variant:V===e?`default`:`outline`,onClick:()=>H(e),children:Q(e)},e))]})]}),R&&(0,k.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-destructive/30 bg-destructive/5 p-4 text-sm`,children:[(0,k.jsx)(ne,{className:`h-4 w-4 mt-0.5 text-destructive`,"aria-hidden":`true`}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-medium text-destructive`,children:m(`marketplace.load.failed`)}),(0,k.jsx)(`div`,{className:`text-muted-foreground mt-1`,children:R}),(0,k.jsx)(`div`,{className:`text-xs text-muted-foreground mt-2`,"data-testid":`marketplace-load-hint`,children:N?m(`marketplace.load.failedHintConfigured`,{url:N}):m(`marketplace.load.failedHintSameOrigin`)})]})]}),W.length>0&&(0,k.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(v,{className:`h-5 w-5 text-primary`,"aria-hidden":`true`}),(0,k.jsx)(`h2`,{className:`text-sm font-semibold`,children:m(`marketplace.org.heading`,{defaultValue:`Your organization`})}),(0,k.jsx)(f,{variant:`secondary`,className:`text-xs`,children:W.length})]}),q&&(0,k.jsx)(`div`,{className:`rounded-md border p-3 text-sm ${q.ok?`border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:q.text}),(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:W.map(e=>{let t=_e.has(e.manifest_id);return(0,k.jsxs)(o,{className:`flex flex-col`,"data-testid":`org-card-${e.manifest_id}`,children:[(0,k.jsxs)(l,{className:`flex flex-row items-start gap-3 pb-2`,children:[(0,k.jsx)(C,{iconUrl:e.icon_url,displayName:e.display_name,manifestId:e.manifest_id}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(d,{className:`text-base truncate`,children:e.display_name}),(0,k.jsx)(s,{className:`text-xs truncate`,children:(0,k.jsx)(`code`,{className:`font-mono`,children:e.manifest_id})})]}),e.visibility&&(0,k.jsx)(f,{variant:`outline`,className:`shrink-0 text-xs`,children:e.visibility})]}),(0,k.jsxs)(u,{className:`flex-1 flex flex-col gap-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:e.description||m(`marketplace.noDescription`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 mt-auto pt-2 flex-wrap`,children:[e.latest_version&&(0,k.jsxs)(f,{variant:`outline`,className:`text-xs`,children:[(0,k.jsx)(_,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),m(`marketplace.versionBadge`,{version:e.latest_version})]}),(0,k.jsx)(`div`,{className:`ml-auto`,children:t?(0,k.jsxs)(f,{variant:`default`,className:`text-xs bg-green-600 hover:bg-green-600`,children:[(0,k.jsx)(g,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),m(`marketplace.org.installedBadge`,{defaultValue:`Installed`})]}):(0,k.jsx)(p,{size:`sm`,onClick:()=>void ye(e),disabled:G===e.id,children:G===e.id?m(`marketplace.org.installing`,{defaultValue:`Installing…`}):m(`marketplace.org.install`,{defaultValue:`Install`})})})]})]})]},e.id)})}),(0,k.jsx)(`div`,{className:`border-b pt-2`})]}),I&&P.length===0?(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,k.jsxs)(o,{children:[(0,k.jsxs)(l,{className:`pb-2`,children:[(0,k.jsx)(c,{className:`h-10 w-10 rounded-lg mb-2`}),(0,k.jsx)(c,{className:`h-5 w-3/4`}),(0,k.jsx)(c,{className:`h-4 w-1/2 mt-1`})]}),(0,k.jsx)(u,{children:(0,k.jsx)(c,{className:`h-12 w-full`})})]},t))}):$.length===0?(0,k.jsx)(`div`,{className:`text-center py-12 text-sm text-muted-foreground`,children:P.length===0?m(`marketplace.noApprovedYet`):m(`marketplace.noMatchFilters`)}):(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:$.map(t=>{let n=Y.get(t.manifest_id),r=E(t,D);return(0,k.jsxs)(o,{className:`cursor-pointer transition-colors hover:bg-accent/50 flex flex-col`,onClick:()=>e(`${j}/system/marketplace/${t.id}`),role:`link`,tabIndex:0,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e(`${j}/system/marketplace/${t.id}`))},"data-testid":`marketplace-card-${t.manifest_id}`,children:[(0,k.jsxs)(l,{className:`flex flex-row items-start gap-3 pb-2`,children:[(0,k.jsx)(C,{iconUrl:t.icon_url,displayName:r.displayName,manifestId:t.manifest_id}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(d,{className:`text-base truncate`,children:r.displayName}),(0,k.jsx)(s,{className:`text-xs truncate`,children:(0,k.jsx)(`code`,{className:`font-mono`,children:t.manifest_id})})]}),t.publisher&&t.publisher!==`private`&&(0,k.jsx)(f,{variant:t.publisher===`objectstack`?`default`:`secondary`,className:`shrink-0`,children:t.publisher})]}),(0,k.jsxs)(u,{className:`flex-1 flex flex-col gap-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:r.description||m(`marketplace.noDescription`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 mt-auto pt-2 flex-wrap`,children:[n&&(0,k.jsxs)(f,{variant:`default`,className:`text-xs bg-green-600 hover:bg-green-600`,children:[(0,k.jsx)(g,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),m(`marketplace.installedBadge`,{version:n.version})]}),t.latest_version?.version&&(0,k.jsxs)(f,{variant:`outline`,className:`text-xs`,children:[(0,k.jsx)(_,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),m(`marketplace.versionBadge`,{version:t.latest_version.version})]}),t.category&&(0,k.jsx)(f,{variant:`outline`,className:`text-xs`,children:Q(t.category)}),t.latest_version?.published_at&&(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:A(t.latest_version.published_at)})]})]})]},t.id)})})]}):(0,k.jsx)(de,{}):(0,k.jsx)(T,{}):(0,k.jsx)(w,{})}export{D as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import"./ui-components-BTB1NkUW.js";import{nr as r}from"./framework-DcWkeiND.js";import{w as i}from"./i18n-runtime-CTgAQF4N.js";import{t as a}from"./vendor-icon-check-vpu9Zukp.js";import{t as o}from"./vendor-icon-chevron-down-BEf_jTEE.js";import{t as s}from"./vendor-icon-chevron-right-DbnKwHYQ.js";import{t as c}from"./vendor-icon-copy-B5M-KdZo.js";var l=e(n(),1),u=t();function d({sections:e,open:t}){let{t:n}=i(),[r,d]=(0,l.useState)([`0`]),[f,p]=(0,l.useState)(null);if(!t)return null;let m=async(e,t)=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),p(t),setTimeout(()=>p(null),2e3)}catch(e){console.error(`Failed to copy:`,e)}},h=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,u.jsxs)(`div`,{className:`w-80 border-l bg-background p-0 overflow-hidden flex flex-col shrink-0 z-20 transition-all`,children:[(0,u.jsxs)(`div`,{className:`px-4 py-3 border-b bg-muted/5 flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:n(`layout.metadata.panelTitle`)}),(0,u.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:n(`layout.metadata.jsonBadge`)})]}),(0,u.jsx)(`div`,{className:`flex-1 overflow-auto`,children:e.map((e,t)=>{let i=String(t),l=r.includes(i),d=f===t;return(0,u.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 hover:bg-muted/5 transition-colors`,children:[(0,u.jsxs)(`button`,{type:`button`,onClick:()=>h(i),className:`flex-1 flex items-center justify-between text-left`,children:[(0,u.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:e.title}),l?(0,u.jsx)(o,{className:`h-3 w-3 text-muted-foreground ml-2`}):(0,u.jsx)(s,{className:`h-3 w-3 text-muted-foreground ml-2`})]}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>m(e.data,t),className:`p-1 hover:bg-muted rounded transition-colors ml-2`,title:n(`layout.metadata.copyJson`),children:d?(0,u.jsx)(a,{className:`h-3 w-3 text-green-600`}):(0,u.jsx)(c,{className:`h-3 w-3 text-muted-foreground`})})]}),l&&(0,u.jsx)(`div`,{className:`px-4 pb-4`,children:(0,u.jsx)(`div`,{className:`relative rounded-md border border-border/50 bg-muted/5 overflow-hidden`,children:(0,u.jsx)(`pre`,{className:`text-[11px] leading-relaxed p-3 overflow-auto max-h-96 font-mono text-foreground/90`,children:JSON.stringify(e.data,null,2)})})})]},t)})})]})}function f(){let e=(0,l.useMemo)(()=>{try{return typeof window<`u`&&r(window.location.search).enabled}catch{return!1}},[]),[t,n]=(0,l.useState)(e);return{showDebug:t,toggleDebug:()=>n(e=>!e)}}export{f as n,d as t};
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import"./ui-components-D6cEVg0T.js";import{Zn as r}from"./framework-DFR4HNtj.js";import{w as i}from"./i18n-runtime-97_bDVjP.js";import{t as a}from"./vendor-icon-check-vpu9Zukp.js";import{t as o}from"./vendor-icon-chevron-down-BEf_jTEE.js";import{t as s}from"./vendor-icon-chevron-right-DbnKwHYQ.js";import{t as c}from"./vendor-icon-copy-B5M-KdZo.js";var l=e(n(),1),u=t();function d({sections:e,open:t}){let{t:n}=i(),[r,d]=(0,l.useState)([`0`]),[f,p]=(0,l.useState)(null);if(!t)return null;let m=async(e,t)=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),p(t),setTimeout(()=>p(null),2e3)}catch(e){console.error(`Failed to copy:`,e)}},h=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,u.jsxs)(`div`,{className:`w-80 border-l bg-background p-0 overflow-hidden flex flex-col shrink-0 z-20 transition-all`,children:[(0,u.jsxs)(`div`,{className:`px-4 py-3 border-b bg-muted/5 flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:n(`layout.metadata.panelTitle`)}),(0,u.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:n(`layout.metadata.jsonBadge`)})]}),(0,u.jsx)(`div`,{className:`flex-1 overflow-auto`,children:e.map((e,t)=>{let i=String(t),l=r.includes(i),d=f===t;return(0,u.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 hover:bg-muted/5 transition-colors`,children:[(0,u.jsxs)(`button`,{type:`button`,onClick:()=>h(i),className:`flex-1 flex items-center justify-between text-left`,children:[(0,u.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:e.title}),l?(0,u.jsx)(o,{className:`h-3 w-3 text-muted-foreground ml-2`}):(0,u.jsx)(s,{className:`h-3 w-3 text-muted-foreground ml-2`})]}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>m(e.data,t),className:`p-1 hover:bg-muted rounded transition-colors ml-2`,title:n(`layout.metadata.copyJson`),children:d?(0,u.jsx)(a,{className:`h-3 w-3 text-green-600`}):(0,u.jsx)(c,{className:`h-3 w-3 text-muted-foreground`})})]}),l&&(0,u.jsx)(`div`,{className:`px-4 pb-4`,children:(0,u.jsx)(`div`,{className:`relative rounded-md border border-border/50 bg-muted/5 overflow-hidden`,children:(0,u.jsx)(`pre`,{className:`text-[11px] leading-relaxed p-3 overflow-auto max-h-96 font-mono text-foreground/90`,children:JSON.stringify(e.data,null,2)})})})]},t)})})]})}function f(){let e=(0,l.useMemo)(()=>{try{return typeof window<`u`&&r(window.location.search).enabled}catch{return!1}},[]),[t,n]=(0,l.useState)(e);return{showDebug:t,toggleDebug:()=>n(e=>!e)}}export{f as n,d as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,m as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as ee,p as o}from"./infrastructure-BHSync5f.js";import{Ar as s,hr as c}from"./vendor-objectstack-XuWC71M9.js";import{$ as l,Ot as u,Q as te,Tt as d,vi as f,vt as ne,wt as p}from"./ui-components-BTB1NkUW.js";import{Ft as m,Ni as re,Yn as ie,ct as ae}from"./framework-DcWkeiND.js";import{f as oe,w as se}from"./i18n-runtime-CTgAQF4N.js";import{t as ce}from"./vendor-icon-database-C8JGjSkn.js";import{t as h}from"./vendor-icon-lock-B_psRnly.js";import{t as le}from"./vendor-icon-plus-BlfcDDsa.js";import{t as ue}from"./vendor-icon-save-CuavGNuU.js";import{t as de}from"./vendor-icon-x-CcLtgRNL.js";import{l as fe,o as g,p as pe,u as me}from"./createDerive-DvA_JGNq.js";import{t as he}from"./RecordDetailView-DQKydU7X.js";import{a as ge,i as _e,l as ve,n as ye,o as be,r as xe,s as Se}from"./InterfaceListPage-BdECC_i3.js";import{t as Ce}from"./getIcon-BEVyC4y3.js";import{n as we,t as Te}from"./CreateViewDialog-xyKlpLEW.js";import{a as Ee,n as De,r as Oe,t as _}from"./drillUrlFilters-hi-2d3DW.js";import{t as ke}from"./plugins-views-DraK4xz0.js";import{o as v,t as y}from"./runtime-metadata-persistence-afAW-MeD.js";var b=e(a(),1),x=i(),S=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),C=4,w={"=":`eq`,...Object.fromEntries(Object.entries(_).map(([e,t])=>[t,e]))};function T(e){let t=[];for(let[n,r,i]of e){let e={field:n,operator:s(w[r]??r)};i!==void 0&&(e.value=i);let a=c.safeParse(e);if(!a.success){console.warn(`[ObjectDataPage] Dropped URL filter on "${n}" from the saved view: operator "${r}" has no canonical ViewFilterRule form.`);continue}t.push(a.data)}return t}function Ae(e,t,n){let r=T(n);return{...e,columns:Array.isArray(e.columns)&&e.columns.length>0?e.columns:t,...r.length?{filter:r}:{}}}function E({dataSource:e,objects:i}){let{appName:a,objectName:s}=r(),{t:c}=se(),{objectLabel:_,fieldLabel:w}=oe(),T=t(),[E,D]=n(),{can:O,getObjectApiOperations:k}=l(),{canRead:A}=te(s??``),{user:j,activeOrganization:M}=o(),{isAdmin:N}=ee(),P=g(),F=ve()===`group`,I=pe(),[je,L]=b.useState(!1),R=b.useMemo(()=>(i||[]).find(e=>e.name===s),[i,s]),[Me]=b.useState(()=>Se(new URLSearchParams(window.location.search))),Ne=b.useCallback(e=>{D(t=>be(t,e),{replace:!0})},[D]),z=Array.from(E.entries()).filter(([e])=>e.startsWith(`filter[`)).map(([e,t])=>`${e}=${t}`).join(`&`),B=b.useMemo(()=>{let e=Ee(new URLSearchParams(z)),t=e.filter(([e])=>A(e));if(t.length<e.length){let t=e.filter(([e])=>!A(e)).map(([e])=>e);console.warn(`[ObjectDataPage] Dropped URL filter(s) on unreadable field(s): ${t.join(`, `)}`)}return ie(t,{currentUserId:j?.id??null,currentOrgId:M?.id??null})},[z,A,j?.id,M?.id]),Pe=b.useMemo(()=>Oe(B),[B]),Fe=b.useCallback(e=>{D(t=>De(new URLSearchParams(t),e))},[D]),V=b.useMemo(()=>xe(R,{orgAttribution:F}).filter(e=>A(e)),[R,A,F]),H=b.useMemo(()=>{let e=R?.fields;if(!e||typeof e!=`object`)return;let t=Object.entries(e).filter(([e,t])=>t&&!t.hidden&&S.has(t.type)&&A(e)).slice(0,C).map(([e])=>({field:e}));return t.length>0?{element:`dropdown`,fields:t}:void 0},[R,A]),U=b.useCallback(e=>`/apps/${a}/${s}/record/${encodeURIComponent(String(e))}`,[a,s]),W=ae({navigation:{mode:`drawer`},objectName:s??``,onNavigate:e=>T(U(e))}),G=E.get(`recordId`),Ie=b.useCallback((e,t)=>{let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(U(n),`_blank`);return}n!=null&&D(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t})},[U,D]),Le=b.useCallback(()=>{D(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[D]);b.useEffect(()=>{G&&!W.isOpen?W.open({id:G}):!G&&W.isOpen&&W.close()},[G]);let K=b.useMemo(()=>ge(R),[R]),q=b.useMemo(()=>ye(R),[R]),J=b.useMemo(()=>_e(R),[R]),Y=b.useMemo(()=>{let e=[`grid`];return K&&e.push(`kanban`),q&&e.push(`calendar`),J&&e.push(`gallery`),e},[K,q,J]),X=b.useMemo(()=>{if(R)return{type:`list-view`,objectName:R.name,viewType:`grid`,columns:V,...B.length?{filter:B}:{},kanban:K,calendar:q,gallery:J,userFilters:H,appearance:{allowedVisualizations:Y},showViewSwitcher:Y.length>1,userActions:{search:!0,sort:!0,filter:!0,rowHeight:!0,group:!0,hideFields:!0},showRecordCount:!0}},[R,V,B,K,q,J,H,Y]),Re=b.useCallback(async t=>{try{let n=Ae(t,V,B),r=v(s??``,n,{name:t.name,label:t.label}),i=await y(`view`,r.name,r,{metadataClient:P,dataSource:e,objectName:s});if(i){let e=I?``:`?${fe}=${me}`;T(`../view/${i}${e}`,{relative:`path`})}}catch(e){console.error(`[ObjectDataPage] Failed to save view:`,e)}},[V,B,P,e,T,s,I]),Z=b.useMemo(()=>re(R,R?k(R.name):void 0),[R,k]),Q=!!R&&Z.create&&O(R.name,`create`),$=Q?Z.createPredicates:void 0,ze=m($?.visibleWhen??!0,null,{fallback:!1,warnOnError:!0,label:`builtin:create:visibleWhen`}),Be=m($?.disabledWhen,null,{fallback:!1,warnOnError:!0,label:`builtin:create:disabledWhen`}),Ve=$?.disabledWhen!=null&&Be;return R?O(R.name,`read`)?(0,x.jsxs)(`div`,{className:`h-full flex flex-col bg-background min-w-0 overflow-hidden`,"data-testid":`object-data-page`,children:[(0,x.jsx)(`div`,{className:`hidden sm:block`,children:(0,x.jsx)(we,{title:(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:_(R)}),(0,x.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:c(`console.objectData.badge`,{defaultValue:`Data`})})]}),subtitle:c(`console.objectData.description`,{defaultValue:`URL-defined data slice — not bound to any saved view.`}),icon:b.createElement(Ce(R?.icon),{className:`h-4 w-4`}),actions:(0,x.jsxs)(x.Fragment,{children:[Q&&ze&&(0,x.jsxs)(f,{size:`sm`,onClick:()=>T(`../new`,{relative:`path`}),disabled:Ve,className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-new-button`,children:[(0,x.jsx)(le,{className:`h-4 w-4`}),(0,x.jsx)(`span`,{className:`hidden sm:inline`,children:c(`console.objectView.new`)})]}),N&&(0,x.jsxs)(f,{size:`sm`,variant:`outline`,onClick:()=>L(!0),className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-save-as-view`,children:[(0,x.jsx)(ue,{className:`h-4 w-4`}),(0,x.jsx)(`span`,{className:`hidden sm:inline`,children:c(`console.objectData.saveAsView`,{defaultValue:`Save as view`})})]})]})})}),B.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b px-3 sm:px-4 py-2 shrink-0`,"data-testid":`object-data-filter-chips`,children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c(`console.objectData.filteredBy`,{defaultValue:`Filtered by`})}),Pe.map(({field:e,text:t,textKey:n})=>(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-muted/40 px-2 py-0.5 text-xs`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:w(R.name,e,e)}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:n?c(n):t}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>Fe(e),className:`ml-0.5 rounded-full hover:bg-muted p-0.5`,"aria-label":c(`console.objectData.removeFilter`,{defaultValue:`Remove filter {{field}}`,field:e}),"data-testid":`object-data-remove-filter-${e}`,children:(0,x.jsx)(de,{className:`h-3 w-3`})})]},e))]}),(0,x.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:X&&(0,x.jsx)(ke,{schema:X,dataSource:e,userFilterSelections:Me,onUserFilterSelectionsChange:Ne,onRowClick:Ie})}),W.isOverlay&&(0,x.jsx)(ne,{...W,setIsOpen:e=>{e||Le()},title:_(R),children:t=>(0,x.jsx)(he,{objectNameOverride:R.name,recordIdOverride:String(t?.id??t?._id??G??``),embedded:!0,dataSource:e,objects:i,onEdit:()=>{}})}),N&&(0,x.jsx)(Te,{open:je,onOpenChange:L,onCreate:Re,objectDef:R})]}):(0,x.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,"data-testid":`object-data-403`,children:(0,x.jsxs)(p,{children:[(0,x.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,x.jsx)(h,{className:`h-6 w-6 text-muted-foreground`})}),(0,x.jsx)(u,{children:c(`console.objectData.noAccessTitle`,{defaultValue:`Access denied`})}),(0,x.jsx)(d,{children:c(`console.objectData.noAccess`,{defaultValue:`You do not have permission to view this data.`})})]})}):(0,x.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,x.jsxs)(p,{children:[(0,x.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,x.jsx)(ce,{className:`h-6 w-6 text-muted-foreground`})}),(0,x.jsx)(u,{children:c(`console.objectView.objectNotFound`)}),(0,x.jsx)(d,{children:c(`console.objectView.objectNotFoundDescription`,{objectName:s})})]})})}export{E as ObjectDataPage};
1
+ import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,m as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as ee,p as o}from"./infrastructure-Cc34lEqb.js";import{Ri as s,xi as c}from"./vendor-objectstack-DFqu45yM.js";import{$ as l,Et as u,Q as te,Tt as d,kt as f,yi as p,yt as ne}from"./ui-components-D6cEVg0T.js";import{Fi as re,It as m,Wn as ie,lt as ae}from"./framework-DFR4HNtj.js";import{f as oe,w as se}from"./i18n-runtime-97_bDVjP.js";import{t as ce}from"./vendor-icon-database-C8JGjSkn.js";import{t as h}from"./vendor-icon-lock-B_psRnly.js";import{t as le}from"./vendor-icon-plus-BlfcDDsa.js";import{t as ue}from"./vendor-icon-save-CuavGNuU.js";import{t as de}from"./vendor-icon-x-CcLtgRNL.js";import{l as fe,o as g,p as pe,u as me}from"./createDerive-CjN1i5vn.js";import{t as he}from"./RecordDetailView-DgR_zhP4.js";import{a as ge,i as _e,l as ve,n as ye,o as be,r as xe,s as Se}from"./InterfaceListPage-C4wPYohR.js";import{t as Ce}from"./getIcon-Cfwf-Egt.js";import{n as we,t as Te}from"./CreateViewDialog-D3l-tYHM.js";import{a as Ee,n as De,r as Oe,t as _}from"./drillUrlFilters-hi-2d3DW.js";import{t as ke}from"./plugins-views-CfkgqD30.js";import{o as v,t as y}from"./runtime-metadata-persistence-ClOTznqa.js";var b=e(a(),1),x=i(),S=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),C=4,w={"=":`eq`,...Object.fromEntries(Object.entries(_).map(([e,t])=>[t,e]))};function T(e){let t=[];for(let[n,r,i]of e){let e={field:n,operator:s(w[r]??r)};i!==void 0&&(e.value=i);let a=c.safeParse(e);if(!a.success){console.warn(`[ObjectDataPage] Dropped URL filter on "${n}" from the saved view: operator "${r}" has no canonical ViewFilterRule form.`);continue}t.push(a.data)}return t}function Ae(e,t,n){let r=T(n);return{...e,columns:Array.isArray(e.columns)&&e.columns.length>0?e.columns:t,...r.length?{filter:r}:{}}}function E({dataSource:e,objects:i}){let{appName:a,objectName:s}=r(),{t:c}=se(),{objectLabel:_,fieldLabel:w}=oe(),T=t(),[E,D]=n(),{can:O,getObjectApiOperations:k}=l(),{canRead:A}=te(s??``),{user:j,activeOrganization:M}=o(),{isAdmin:N}=ee(),P=g(),F=ve()===`group`,I=pe(),[je,L]=b.useState(!1),R=b.useMemo(()=>(i||[]).find(e=>e.name===s),[i,s]),[Me]=b.useState(()=>Se(new URLSearchParams(window.location.search))),Ne=b.useCallback(e=>{D(t=>be(t,e),{replace:!0})},[D]),z=Array.from(E.entries()).filter(([e])=>e.startsWith(`filter[`)).map(([e,t])=>`${e}=${t}`).join(`&`),B=b.useMemo(()=>{let e=Ee(new URLSearchParams(z)),t=e.filter(([e])=>A(e));if(t.length<e.length){let t=e.filter(([e])=>!A(e)).map(([e])=>e);console.warn(`[ObjectDataPage] Dropped URL filter(s) on unreadable field(s): ${t.join(`, `)}`)}return ie(t,{currentUserId:j?.id??null,currentOrgId:M?.id??null})},[z,A,j?.id,M?.id]),Pe=b.useMemo(()=>Oe(B),[B]),Fe=b.useCallback(e=>{D(t=>De(new URLSearchParams(t),e))},[D]),V=b.useMemo(()=>xe(R,{orgAttribution:F}).filter(e=>A(e)),[R,A,F]),H=b.useMemo(()=>{let e=R?.fields;if(!e||typeof e!=`object`)return;let t=Object.entries(e).filter(([e,t])=>t&&!t.hidden&&S.has(t.type)&&A(e)).slice(0,C).map(([e])=>({field:e}));return t.length>0?{element:`dropdown`,fields:t}:void 0},[R,A]),U=b.useCallback(e=>`/apps/${a}/${s}/record/${encodeURIComponent(String(e))}`,[a,s]),W=ae({navigation:{mode:`drawer`},objectName:s??``,onNavigate:e=>T(U(e))}),G=E.get(`recordId`),Ie=b.useCallback((e,t)=>{let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(U(n),`_blank`);return}n!=null&&D(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t})},[U,D]),Le=b.useCallback(()=>{D(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[D]);b.useEffect(()=>{G&&!W.isOpen?W.open({id:G}):!G&&W.isOpen&&W.close()},[G]);let K=b.useMemo(()=>ge(R),[R]),q=b.useMemo(()=>ye(R),[R]),J=b.useMemo(()=>_e(R),[R]),Y=b.useMemo(()=>{let e=[`grid`];return K&&e.push(`kanban`),q&&e.push(`calendar`),J&&e.push(`gallery`),e},[K,q,J]),X=b.useMemo(()=>{if(R)return{type:`list-view`,objectName:R.name,viewType:`grid`,columns:V,...B.length?{filter:B}:{},kanban:K,calendar:q,gallery:J,userFilters:H,appearance:{allowedVisualizations:Y},showViewSwitcher:Y.length>1,userActions:{search:!0,sort:!0,filter:!0,rowHeight:!0,group:!0,hideFields:!0},showRecordCount:!0}},[R,V,B,K,q,J,H,Y]),Re=b.useCallback(async t=>{try{let n=Ae(t,V,B),r=v(s??``,n,{name:t.name,label:t.label}),i=await y(`view`,r.name,r,{metadataClient:P,dataSource:e,objectName:s});if(i){let e=I?``:`?${fe}=${me}`;T(`../view/${i}${e}`,{relative:`path`})}}catch(e){console.error(`[ObjectDataPage] Failed to save view:`,e)}},[V,B,P,e,T,s,I]),Z=b.useMemo(()=>re(R,R?k(R.name):void 0),[R,k]),Q=!!R&&Z.create&&O(R.name,`create`),$=Q?Z.createPredicates:void 0,ze=m($?.visibleWhen??!0,null,{fallback:!1,warnOnError:!0,label:`builtin:create:visibleWhen`}),Be=m($?.disabledWhen,null,{fallback:!1,warnOnError:!0,label:`builtin:create:disabledWhen`}),Ve=$?.disabledWhen!=null&&Be;return R?O(R.name,`read`)?(0,x.jsxs)(`div`,{className:`h-full flex flex-col bg-background min-w-0 overflow-hidden`,"data-testid":`object-data-page`,children:[(0,x.jsx)(`div`,{className:`hidden sm:block`,children:(0,x.jsx)(we,{title:(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:_(R)}),(0,x.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:c(`console.objectData.badge`,{defaultValue:`Data`})})]}),subtitle:c(`console.objectData.description`,{defaultValue:`URL-defined data slice — not bound to any saved view.`}),icon:b.createElement(Ce(R?.icon),{className:`h-4 w-4`}),actions:(0,x.jsxs)(x.Fragment,{children:[Q&&ze&&(0,x.jsxs)(p,{size:`sm`,onClick:()=>T(`../new`,{relative:`path`}),disabled:Ve,className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-new-button`,children:[(0,x.jsx)(le,{className:`h-4 w-4`}),(0,x.jsx)(`span`,{className:`hidden sm:inline`,children:c(`console.objectView.new`)})]}),N&&(0,x.jsxs)(p,{size:`sm`,variant:`outline`,onClick:()=>L(!0),className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-save-as-view`,children:[(0,x.jsx)(ue,{className:`h-4 w-4`}),(0,x.jsx)(`span`,{className:`hidden sm:inline`,children:c(`console.objectData.saveAsView`,{defaultValue:`Save as view`})})]})]})})}),B.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b px-3 sm:px-4 py-2 shrink-0`,"data-testid":`object-data-filter-chips`,children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c(`console.objectData.filteredBy`,{defaultValue:`Filtered by`})}),Pe.map(({field:e,text:t,textKey:n})=>(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-muted/40 px-2 py-0.5 text-xs`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:w(R.name,e,e)}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:n?c(n):t}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>Fe(e),className:`ml-0.5 rounded-full hover:bg-muted p-0.5`,"aria-label":c(`console.objectData.removeFilter`,{defaultValue:`Remove filter {{field}}`,field:e}),"data-testid":`object-data-remove-filter-${e}`,children:(0,x.jsx)(de,{className:`h-3 w-3`})})]},e))]}),(0,x.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:X&&(0,x.jsx)(ke,{schema:X,dataSource:e,userFilterSelections:Me,onUserFilterSelectionsChange:Ne,onRowClick:Ie})}),W.isOverlay&&(0,x.jsx)(ne,{...W,setIsOpen:e=>{e||Le()},title:_(R),children:t=>(0,x.jsx)(he,{objectNameOverride:R.name,recordIdOverride:String(t?.id??t?._id??G??``),embedded:!0,dataSource:e,objects:i,onEdit:()=>{}})}),N&&(0,x.jsx)(Te,{open:je,onOpenChange:L,onCreate:Re,objectDef:R})]}):(0,x.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,"data-testid":`object-data-403`,children:(0,x.jsxs)(d,{children:[(0,x.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,x.jsx)(h,{className:`h-6 w-6 text-muted-foreground`})}),(0,x.jsx)(f,{children:c(`console.objectData.noAccessTitle`,{defaultValue:`Access denied`})}),(0,x.jsx)(u,{children:c(`console.objectData.noAccess`,{defaultValue:`You do not have permission to view this data.`})})]})}):(0,x.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,x.jsxs)(d,{children:[(0,x.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,x.jsx)(ce,{className:`h-6 w-6 text-muted-foreground`})}),(0,x.jsx)(f,{children:c(`console.objectView.objectNotFound`)}),(0,x.jsx)(u,{children:c(`console.objectView.objectNotFoundDescription`,{objectName:s})})]})})}export{E as ObjectDataPage};
@@ -0,0 +1 @@
1
+ import{d as e,m as t,p as n,t as r,u as i}from"./vendor-react-BggL7APJ.js";import{f as a}from"./infrastructure-Cc34lEqb.js";import{Et as o,Tt as s,kt as c,vt as l}from"./ui-components-D6cEVg0T.js";import{K as u,gt as d,h as f,q as p}from"./framework-DFR4HNtj.js";import{w as m}from"./i18n-runtime-97_bDVjP.js";import{t as h}from"./vendor-icon-file-text-7BKAVNof.js";import{t as g}from"./vendor-icon-pencil-CMubUBjW.js";import{a as _}from"./ExpressionProvider-CrL6jhVq.js";import{w as v}from"./RecordDetailView-DgR_zhP4.js";import{t as y}from"./preferLocal-DEJV3KIq.js";import{t as b}from"./InterfaceListPage-C4wPYohR.js";import{t as x}from"./useCanAuthorMetadata-BxCMgFRf.js";import{n as S,t as C}from"./MetadataInspector-EP0I3-Kq.js";var w=r();function T(){f({objectName:`*`})}function E(){let{t:r}=m(),{pageName:f}=n(),[E]=t(),{showDebug:D}=S(),O=e(),k=i(),{isAdmin:A}=a(),j=x(),{pages:M,objects:N,getTypeStatus:P}=p(),{app:F}=_(),I=u(),L=y(M,f,F?._packageId);if(!L){let e=P?.(`page`);return e===`idle`||e===`loading`?(0,w.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,"data-testid":`page-loading`,children:(0,w.jsx)(l,{className:`h-5 w-5 text-muted-foreground`})}):(0,w.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,w.jsxs)(s,{children:[(0,w.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,w.jsx)(h,{className:`h-6 w-6 text-muted-foreground`})}),(0,w.jsx)(c,{children:r(`empty.pageNotFound`)}),(0,w.jsx)(o,{children:r(`empty.pageNotFoundDescription`,{name:f})})]})})}let R=Object.fromEntries(E.entries()),z=k.pathname.match(/\/apps\/([^/]+)/)?.[1],B=A&&j&&!!z&&!!f;return(0,w.jsx)(v,{dataSource:I,objects:N,onRefresh:T,children:(0,w.jsxs)(`div`,{className:`flex flex-row h-full w-full overflow-hidden relative`,children:[(0,w.jsxs)(`div`,{className:`flex-1 overflow-auto h-full relative`,children:[B&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>{B&&O(`/apps/${z}/metadata/page/${encodeURIComponent(f)}`)},className:`absolute right-3 top-3 z-30 inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background/90 text-muted-foreground shadow-sm backdrop-blur hover:bg-accent hover:text-accent-foreground`,"data-testid":`page-edit-in-studio-button`,title:r(`common.editInStudio`,{defaultValue:`Edit in studio`}),"aria-label":r(`common.editInStudio`,{defaultValue:`Edit in studio`}),children:(0,w.jsx)(g,{className:`h-3.5 w-3.5`})}),L.interfaceConfig?.source?(0,w.jsx)(b,{page:L,reserveEditAffordance:B}):(0,w.jsx)(d,{schema:{...L,type:L.type||`page`,pageType:L.type,context:{params:R}}})]}),(0,w.jsx)(C,{open:D,sections:[{title:`Page Configuration`,data:L}]})]})})}export{E as PageView};