@declarion/react 0.61.1 → 0.63.1

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 (487) hide show
  1. package/dist-lib/ActionDialog-uiuse5W8.js +374 -0
  2. package/dist-lib/ActionResultDialog.impl-BUBm9Ck3.js +273 -0
  3. package/dist-lib/ActionRunner-DAxgnKB3.js +1440 -0
  4. package/dist-lib/AdminCatalogPage.impl-BJGn7EvA.js +441 -0
  5. package/dist-lib/{AgentChatPanel.impl-rgkewyMl.js → AgentChatPanel.impl-8bw8J-xV.js} +358 -319
  6. package/dist-lib/AgentOpenFollower.impl-Cga1q7_e.js +81 -0
  7. package/dist-lib/AssociatedBlock-D6qDYmRO.js +1515 -0
  8. package/dist-lib/AuthShell-DdiughRT.js +361 -0
  9. package/dist-lib/ChangePasswordDialog-DFe7lVQg.js +12 -0
  10. package/dist-lib/ChangePasswordDialog.impl-DtSIaP-A.js +194 -0
  11. package/dist-lib/CommandPalette.impl-Db3AFA5w.js +383 -0
  12. package/dist-lib/CopyButton-C0iEvaT1.js +119 -0
  13. package/dist-lib/DirtyTabsCloseDialog.impl-DWaFaWKn.js +191 -0
  14. package/dist-lib/{DraggableChildrenTable-DruYOxKm.js → DraggableChildrenTable-Cy8uevS_.js} +45 -44
  15. package/dist-lib/DynamicIcon-DuBSz6TZ.js +133 -0
  16. package/dist-lib/FieldRow-BXBBFOZh.js +157 -0
  17. package/dist-lib/FilterChips-8fMDBXHp.js +1031 -0
  18. package/dist-lib/Forgot.impl-CmT5A__V.js +105 -0
  19. package/dist-lib/{Grid-Dsf3I0xG.js → Grid-Cg29k0jv.js} +98 -99
  20. package/dist-lib/Icons-Dzl-AkD_.d.ts +159 -0
  21. package/dist-lib/Icons-lt-7lhYR.js +151 -0
  22. package/dist-lib/ImpersonationBanner.impl-CBJJx6an.js +76 -0
  23. package/dist-lib/ImpersonationStartModal.impl-RaZcsJpG.js +158 -0
  24. package/dist-lib/Kbd-CNttVu0z.js +23 -0
  25. package/dist-lib/{LayoutRenderer-QN7Wp2W6.js → LayoutRenderer-DEHtYtzV.js} +965 -942
  26. package/dist-lib/{ListCardsBody-CNaZ0xwz.js → ListCardsBody-BAwFR3yO.js} +46 -52
  27. package/dist-lib/{MarkdownRenderer-BuO5hYJh.js → MarkdownRenderer-kNEMr6K_.js} +15 -16
  28. package/dist-lib/MenuItem-CfkVXPvC.js +140 -0
  29. package/dist-lib/NotFoundPage.impl-ZSBn4WWb.js +68 -0
  30. package/dist-lib/PageHeader-tw4pX3lI.js +71 -0
  31. package/dist-lib/PageShell-tI-mm0C5.js +47 -0
  32. package/dist-lib/Pill-D-wsfRhx.js +42 -0
  33. package/dist-lib/Preferences.impl-BG9XBZDf.js +162 -0
  34. package/dist-lib/Profile.impl-CbzSzxyG.js +527 -0
  35. package/dist-lib/PropertyGridEditor-BTjscqfz.js +4378 -0
  36. package/dist-lib/RecordHeader-Bv9nJXnG.js +217 -0
  37. package/dist-lib/RecordIdBadge-C3MgoZvt.js +25 -0
  38. package/dist-lib/RefreshControl-Ce-T_wSQ.js +195 -0
  39. package/dist-lib/Reset.impl-Cesyqt5p.js +168 -0
  40. package/dist-lib/SSOCallbackPage.impl-BC_W9nQA.js +31 -0
  41. package/dist-lib/SectionCard-VonaiLrx.js +150 -0
  42. package/dist-lib/SignUp.impl-C1KCQbfZ.js +212 -0
  43. package/dist-lib/SmartDetailPage.impl-8iOAMYQh.js +1609 -0
  44. package/dist-lib/SmartListPage.impl-Cc4Zwz5f.js +2818 -0
  45. package/dist-lib/SmartRecordListPage.impl-xTSohkqG.js +795 -0
  46. package/dist-lib/{SortHeaderMenu-BV-aQbPy.js → SortHeaderMenu-BKTrq0Wb.js} +23 -23
  47. package/dist-lib/TenantParamsPage.impl-DMuSs3eP.js +306 -0
  48. package/dist-lib/TwoFA.impl-BClZ3ndk.js +125 -0
  49. package/dist-lib/{cardProjection-BnmWukxk.js → cardProjection-Cr7fG6wJ.js} +134 -133
  50. package/dist-lib/declarion-react.css +1 -1
  51. package/dist-lib/format-count-CSEFw2ht.js +943 -0
  52. package/dist-lib/headerActionZone-bef-tZZ7.js +14 -0
  53. package/dist-lib/{stores/icon-registry.d.ts → icon-registry-CUT4eF63.d.ts} +14 -11
  54. package/dist-lib/icons.d.ts +20 -4
  55. package/dist-lib/icons.js +3 -2
  56. package/dist-lib/index.d.ts +2516 -150
  57. package/dist-lib/index.js +1588 -5117
  58. package/dist-lib/page-inset-D_kkVwwN.js +9 -0
  59. package/dist-lib/page-state-eA6J_KIR.js +124 -0
  60. package/dist-lib/param-editors-9yJr7xmN.js +201 -0
  61. package/dist-lib/payload-B2wODLAX.js +86 -0
  62. package/dist-lib/{peekDraftStore-Dk1Ha5u3.js → peekDraftStore-D4GRsRKW.js} +44 -43
  63. package/dist-lib/registry-BpzE8-h8.js +119 -0
  64. package/dist-lib/screen-back-Cs4kzeqD.js +44 -0
  65. package/dist-lib/testing.d.ts +53 -56
  66. package/dist-lib/testing.js +54 -55
  67. package/dist-lib/use-filter-value-labels-DuqvAIVG.js +413 -0
  68. package/dist-lib/{useAgentConversation-nT5UypJX.js → useAgentConversation-D210VDCQ.js} +158 -169
  69. package/dist-lib/useAuth-CR2YKKXb.js +49 -0
  70. package/dist-lib/useBranding-Ckp_AuJb.js +41 -0
  71. package/dist-lib/useBrandingChrome-bKTXXDLy.js +170 -0
  72. package/dist-lib/useCurrentLocation-BdngVeQv.js +22 -0
  73. package/dist-lib/useCurrentScreen--UovgvRj.js +2511 -0
  74. package/dist-lib/useImpersonation-DNV23Ks1.js +35 -0
  75. package/dist-lib/useObject-1OCeV34A.js +26 -0
  76. package/dist-lib/useOwnRefresh-DkOuM4yo.js +435 -0
  77. package/dist-lib/useParams-ei6w4I7w.js +133 -0
  78. package/dist-lib/useProperties-CbdhlhZd.js +81 -0
  79. package/dist-lib/useResponsiveMode-DIR1bZfo.d.ts +1786 -0
  80. package/dist-lib/useScreenBack-J861tbwn.js +71 -0
  81. package/dist-lib/useTabNavigate-BZiW4q3M.js +78 -0
  82. package/dist-lib/useTabTitle-CZZnWIQi.js +22 -0
  83. package/dist-lib/utils-D_QDpB8_.js +11 -0
  84. package/dist-lib/{value-Dwfyghtj.js → value-CDCeHgOv.js} +8 -22
  85. package/dist-lib/{action-dispatch-gWmOYjOP.js → variants-CbAwl3Mn.js} +734 -740
  86. package/dist-lib/vite/index.d.ts +42 -16
  87. package/dist-lib/window-election-CHIvIZwx.js +45 -0
  88. package/package.json +16 -23
  89. package/dist-lib/DetailAuditStrip-CSXZoy7v.js +0 -288
  90. package/dist-lib/DynamicIcon-DW5krHuX.js +0 -280
  91. package/dist-lib/RefreshControl-DO9rYcdq.js +0 -399
  92. package/dist-lib/SmartDetailPage.impl-DFIIx80b.js +0 -1565
  93. package/dist-lib/SmartListPage.impl-D694R32H.js +0 -3051
  94. package/dist-lib/SmartRecordListPage.impl-CB5cuQJV.js +0 -780
  95. package/dist-lib/api/agents.d.ts +0 -140
  96. package/dist-lib/api/auth-redirect.d.ts +0 -3
  97. package/dist-lib/api/auth.d.ts +0 -26
  98. package/dist-lib/api/batch.d.ts +0 -25
  99. package/dist-lib/api/client.d.ts +0 -51
  100. package/dist-lib/api/data.d.ts +0 -153
  101. package/dist-lib/api/entities.d.ts +0 -149
  102. package/dist-lib/api/events.d.ts +0 -91
  103. package/dist-lib/api/params.d.ts +0 -28
  104. package/dist-lib/api/properties.d.ts +0 -3
  105. package/dist-lib/api/schema.d.ts +0 -2
  106. package/dist-lib/api/status.d.ts +0 -2
  107. package/dist-lib/app.d.ts +0 -1
  108. package/dist-lib/components/actions/ActionButton.d.ts +0 -18
  109. package/dist-lib/components/actions/ActionDialog.d.ts +0 -20
  110. package/dist-lib/components/actions/ActionResultDialog.d.ts +0 -22
  111. package/dist-lib/components/actions/ActionRunner.d.ts +0 -62
  112. package/dist-lib/components/actions/ObjectActionBar.d.ts +0 -29
  113. package/dist-lib/components/actions/PropertyGridEditor.d.ts +0 -20
  114. package/dist-lib/components/actions/ResponsiveActionBar.d.ts +0 -259
  115. package/dist-lib/components/actions/RowActionsKebab.d.ts +0 -20
  116. package/dist-lib/components/agents/AgentChatPanel.d.ts +0 -3
  117. package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +0 -14
  118. package/dist-lib/components/agents/AgentConversationDrawer.d.ts +0 -11
  119. package/dist-lib/components/agents/AgentElicitForm.d.ts +0 -27
  120. package/dist-lib/components/agents/AgentPicker.d.ts +0 -8
  121. package/dist-lib/components/agents/transcript-runs.d.ts +0 -29
  122. package/dist-lib/components/chrome/AssociationTabs.d.ts +0 -9
  123. package/dist-lib/components/chrome/AuditMetaStrip.d.ts +0 -11
  124. package/dist-lib/components/chrome/Breadcrumbs.d.ts +0 -14
  125. package/dist-lib/components/chrome/HighlightsStrip.d.ts +0 -10
  126. package/dist-lib/components/chrome/PageHeader.d.ts +0 -16
  127. package/dist-lib/components/chrome/PageShell.d.ts +0 -7
  128. package/dist-lib/components/chrome/RecordHeader.d.ts +0 -17
  129. package/dist-lib/components/chrome/headerActionZone.d.ts +0 -27
  130. package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +0 -20
  131. package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +0 -13
  132. package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +0 -16
  133. package/dist-lib/components/detail-layout/ChildrenCards.d.ts +0 -2
  134. package/dist-lib/components/detail-layout/ChildrenList.d.ts +0 -2
  135. package/dist-lib/components/detail-layout/ChildrenTable.d.ts +0 -2
  136. package/dist-lib/components/detail-layout/ChildrenTimeline.d.ts +0 -2
  137. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +0 -12
  138. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +0 -14
  139. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +0 -16
  140. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +0 -16
  141. package/dist-lib/components/detail-layout/ErrorSummary.d.ts +0 -11
  142. package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +0 -6
  143. package/dist-lib/components/detail-layout/FieldRow.d.ts +0 -23
  144. package/dist-lib/components/detail-layout/FieldsBlock.d.ts +0 -8
  145. package/dist-lib/components/detail-layout/LayoutColumn.d.ts +0 -9
  146. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +0 -46
  147. package/dist-lib/components/detail-layout/LayoutRow.d.ts +0 -8
  148. package/dist-lib/components/detail-layout/LayoutTabs.d.ts +0 -8
  149. package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +0 -8
  150. package/dist-lib/components/detail-layout/QuickAddForm.d.ts +0 -10
  151. package/dist-lib/components/detail-layout/SectionBlock.d.ts +0 -8
  152. package/dist-lib/components/detail-layout/StatusesBlock.d.ts +0 -8
  153. package/dist-lib/components/detail-layout/TimelineComposer.d.ts +0 -10
  154. package/dist-lib/components/detail-layout/blockMeta.d.ts +0 -5
  155. package/dist-lib/components/detail-layout/index.d.ts +0 -21
  156. package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +0 -25
  157. package/dist-lib/components/detail-layout/useQuickAdd.d.ts +0 -16
  158. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.d.ts +0 -2
  159. package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.d.ts +0 -2
  160. package/dist-lib/components/detail-layout/widgets/MonacoJson.d.ts +0 -9
  161. package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +0 -9
  162. package/dist-lib/components/detail-layout/widgets/builtins.d.ts +0 -1
  163. package/dist-lib/components/detail-layout/widgets/canonicalizeJson.d.ts +0 -1
  164. package/dist-lib/components/detail-layout/widgets/monacoBootstrap.d.ts +0 -1
  165. package/dist-lib/components/detail-layout/widgets/registry.d.ts +0 -14
  166. package/dist-lib/components/fields/BoolField.d.ts +0 -2
  167. package/dist-lib/components/fields/EmailField.d.ts +0 -2
  168. package/dist-lib/components/fields/EnumField.d.ts +0 -2
  169. package/dist-lib/components/fields/IntArrayField.d.ts +0 -2
  170. package/dist-lib/components/fields/JsonEditor.d.ts +0 -10
  171. package/dist-lib/components/fields/JsonField.d.ts +0 -3
  172. package/dist-lib/components/fields/MultilangArrayField.d.ts +0 -2
  173. package/dist-lib/components/fields/MultilangField.d.ts +0 -2
  174. package/dist-lib/components/fields/MultilangTextField.d.ts +0 -2
  175. package/dist-lib/components/fields/NumberField.d.ts +0 -2
  176. package/dist-lib/components/fields/PasswordField.d.ts +0 -2
  177. package/dist-lib/components/fields/PhoneField.d.ts +0 -2
  178. package/dist-lib/components/fields/RefCombobox.d.ts +0 -45
  179. package/dist-lib/components/fields/RefField.d.ts +0 -2
  180. package/dist-lib/components/fields/RichTextField.d.ts +0 -2
  181. package/dist-lib/components/fields/SecretField.d.ts +0 -2
  182. package/dist-lib/components/fields/StringArrayField.d.ts +0 -2
  183. package/dist-lib/components/fields/StringField.d.ts +0 -2
  184. package/dist-lib/components/fields/StructureField.d.ts +0 -2
  185. package/dist-lib/components/fields/TextField.d.ts +0 -2
  186. package/dist-lib/components/fields/TimestampField.d.ts +0 -2
  187. package/dist-lib/components/fields/UrlField.d.ts +0 -2
  188. package/dist-lib/components/fields/cells/factories/badge.d.ts +0 -2
  189. package/dist-lib/components/fields/cells/factories/boolPill.d.ts +0 -2
  190. package/dist-lib/components/fields/cells/factories/code.d.ts +0 -2
  191. package/dist-lib/components/fields/cells/factories/date.d.ts +0 -2
  192. package/dist-lib/components/fields/cells/factories/email.d.ts +0 -2
  193. package/dist-lib/components/fields/cells/factories/emptyCell.d.ts +0 -2
  194. package/dist-lib/components/fields/cells/factories/host-icons.d.ts +0 -17
  195. package/dist-lib/components/fields/cells/factories/json.d.ts +0 -2
  196. package/dist-lib/components/fields/cells/factories/link.d.ts +0 -2
  197. package/dist-lib/components/fields/cells/factories/markdown.d.ts +0 -2
  198. package/dist-lib/components/fields/cells/factories/markdownPreview.d.ts +0 -9
  199. package/dist-lib/components/fields/cells/factories/money.d.ts +0 -2
  200. package/dist-lib/components/fields/cells/factories/multilangInline.d.ts +0 -2
  201. package/dist-lib/components/fields/cells/factories/nextRun.d.ts +0 -2
  202. package/dist-lib/components/fields/cells/factories/number.d.ts +0 -2
  203. package/dist-lib/components/fields/cells/factories/passwordMask.d.ts +0 -2
  204. package/dist-lib/components/fields/cells/factories/phone.d.ts +0 -2
  205. package/dist-lib/components/fields/cells/factories/refLink.d.ts +0 -2
  206. package/dist-lib/components/fields/cells/factories/richTextPreview.d.ts +0 -2
  207. package/dist-lib/components/fields/cells/factories/statusPill.d.ts +0 -2
  208. package/dist-lib/components/fields/cells/factories/tagList.d.ts +0 -2
  209. package/dist-lib/components/fields/cells/factories/text.d.ts +0 -2
  210. package/dist-lib/components/fields/cells/factories/timestamp.d.ts +0 -3
  211. package/dist-lib/components/fields/cells/factories/url-helpers.d.ts +0 -12
  212. package/dist-lib/components/fields/cells/factories/url.d.ts +0 -2
  213. package/dist-lib/components/fields/cells/registry.d.ts +0 -21
  214. package/dist-lib/components/fields/index.d.ts +0 -28
  215. package/dist-lib/components/fields/langMap.d.ts +0 -2
  216. package/dist-lib/components/fields/secretValue.d.ts +0 -2
  217. package/dist-lib/components/file-widgets/CircleImage.d.ts +0 -2
  218. package/dist-lib/components/file-widgets/DocumentCard.d.ts +0 -2
  219. package/dist-lib/components/file-widgets/FileList.d.ts +0 -2
  220. package/dist-lib/components/file-widgets/Grid.d.ts +0 -2
  221. package/dist-lib/components/file-widgets/GridLazy.d.ts +0 -2
  222. package/dist-lib/components/file-widgets/ImageWidget.d.ts +0 -12
  223. package/dist-lib/components/file-widgets/LabeledSlots.d.ts +0 -2
  224. package/dist-lib/components/file-widgets/SquareImage.d.ts +0 -2
  225. package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +0 -3
  226. package/dist-lib/components/file-widgets/UploadFailureText.d.ts +0 -4
  227. package/dist-lib/components/file-widgets/WideBanner.d.ts +0 -2
  228. package/dist-lib/components/file-widgets/builtins.d.ts +0 -1
  229. package/dist-lib/components/file-widgets/cropper.d.ts +0 -14
  230. package/dist-lib/components/file-widgets/draft-scope.d.ts +0 -22
  231. package/dist-lib/components/file-widgets/helpers.d.ts +0 -15
  232. package/dist-lib/components/file-widgets/host.d.ts +0 -28
  233. package/dist-lib/components/file-widgets/index.d.ts +0 -16
  234. package/dist-lib/components/file-widgets/payload.d.ts +0 -21
  235. package/dist-lib/components/file-widgets/registry.d.ts +0 -5
  236. package/dist-lib/components/file-widgets/types.d.ts +0 -17
  237. package/dist-lib/components/file-widgets/upload.d.ts +0 -45
  238. package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +0 -42
  239. package/dist-lib/components/file-widgets/value.d.ts +0 -4
  240. package/dist-lib/components/filters/FilterChips.d.ts +0 -14
  241. package/dist-lib/components/filters/FilterDrawer.d.ts +0 -32
  242. package/dist-lib/components/filters/filter-op-label.d.ts +0 -3
  243. package/dist-lib/components/layout/CommandPalette.d.ts +0 -21
  244. package/dist-lib/components/layout/DirtyTabsCloseDialog.d.ts +0 -9
  245. package/dist-lib/components/layout/ImpersonationBanner.d.ts +0 -11
  246. package/dist-lib/components/layout/ImpersonationFrame.d.ts +0 -11
  247. package/dist-lib/components/layout/ImpersonationStartModal.d.ts +0 -22
  248. package/dist-lib/components/layout/Layout.d.ts +0 -6
  249. package/dist-lib/components/layout/Rail.d.ts +0 -22
  250. package/dist-lib/components/layout/Sidebar.d.ts +0 -12
  251. package/dist-lib/components/layout/TabStrip.d.ts +0 -6
  252. package/dist-lib/components/layout/TenantChip.d.ts +0 -26
  253. package/dist-lib/components/layout/TopBar.d.ts +0 -22
  254. package/dist-lib/components/layout/tab-close.d.ts +0 -13
  255. package/dist-lib/components/list/ColumnPicker.d.ts +0 -20
  256. package/dist-lib/components/list/InlineEditCell.d.ts +0 -15
  257. package/dist-lib/components/list/PeekFieldCell.d.ts +0 -16
  258. package/dist-lib/components/list/QuickPeek.d.ts +0 -59
  259. package/dist-lib/components/list/ViewSwitcher.d.ts +0 -24
  260. package/dist-lib/components/list/peekDraftStore.d.ts +0 -6
  261. package/dist-lib/components/pages/AdminCatalogPage.d.ts +0 -1
  262. package/dist-lib/components/pages/DocumentsMenu.d.ts +0 -21
  263. package/dist-lib/components/pages/ExportMenu.d.ts +0 -30
  264. package/dist-lib/components/pages/NotFoundPage.d.ts +0 -1
  265. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +0 -41
  266. package/dist-lib/components/pages/SSOCallbackPage.d.ts +0 -1
  267. package/dist-lib/components/pages/SmartDetailPage.d.ts +0 -2
  268. package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +0 -4
  269. package/dist-lib/components/pages/SmartListPage.d.ts +0 -2
  270. package/dist-lib/components/pages/SmartListPage.impl.d.ts +0 -4
  271. package/dist-lib/components/pages/SmartRecordListPage.d.ts +0 -2
  272. package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +0 -4
  273. package/dist-lib/components/pages/auth/AuthShell.d.ts +0 -18
  274. package/dist-lib/components/pages/auth/Forgot.d.ts +0 -1
  275. package/dist-lib/components/pages/auth/Reset.d.ts +0 -1
  276. package/dist-lib/components/pages/auth/SignIn.d.ts +0 -1
  277. package/dist-lib/components/pages/auth/SignUp.d.ts +0 -1
  278. package/dist-lib/components/pages/auth/TwoFA.d.ts +0 -1
  279. package/dist-lib/components/pages/auth/icons.d.ts +0 -6
  280. package/dist-lib/components/pages/exportRequest.d.ts +0 -69
  281. package/dist-lib/components/pages/list/DataCell.d.ts +0 -4
  282. package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +0 -8
  283. package/dist-lib/components/pages/list/ListCardRow.d.ts +0 -39
  284. package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -33
  285. package/dist-lib/components/pages/list/ListFloatbar.d.ts +0 -29
  286. package/dist-lib/components/pages/list/ListFooter.d.ts +0 -26
  287. package/dist-lib/components/pages/list/ListHeader.d.ts +0 -26
  288. package/dist-lib/components/pages/list/ListNoRows.d.ts +0 -31
  289. package/dist-lib/components/pages/list/ListTable.d.ts +0 -33
  290. package/dist-lib/components/pages/list/ListTableRow.d.ts +0 -17
  291. package/dist-lib/components/pages/list/ListToolbar.d.ts +0 -46
  292. package/dist-lib/components/pages/list/ListUrlBanner.d.ts +0 -10
  293. package/dist-lib/components/pages/list/RowActionsCell.d.ts +0 -34
  294. package/dist-lib/components/pages/list/RowContextMenu.d.ts +0 -28
  295. package/dist-lib/components/pages/list/SaveViewDialog.d.ts +0 -10
  296. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +0 -14
  297. package/dist-lib/components/pages/list/cardProjection.d.ts +0 -67
  298. package/dist-lib/components/pages/list/column-sizing.d.ts +0 -14
  299. package/dist-lib/components/pages/list/columns.d.ts +0 -46
  300. package/dist-lib/components/pages/list/filter-meta.d.ts +0 -25
  301. package/dist-lib/components/pages/list/page-size.d.ts +0 -3
  302. package/dist-lib/components/pages/list/sortable-header.d.ts +0 -2
  303. package/dist-lib/components/pages/list/table-features.d.ts +0 -14
  304. package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +0 -24
  305. package/dist-lib/components/pages/list/useActiveView.d.ts +0 -45
  306. package/dist-lib/components/pages/list/useHeaderReorder.d.ts +0 -26
  307. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +0 -38
  308. package/dist-lib/components/pages/list/useListQuery.d.ts +0 -67
  309. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +0 -61
  310. package/dist-lib/components/pages/list/useListSelection.d.ts +0 -31
  311. package/dist-lib/components/pages/list/useListSort.d.ts +0 -46
  312. package/dist-lib/components/pages/list/useListViews.d.ts +0 -57
  313. package/dist-lib/components/pages/list/useRowMenu.d.ts +0 -46
  314. package/dist-lib/components/pages/profile/Preferences.d.ts +0 -1
  315. package/dist-lib/components/pages/profile/Profile.d.ts +0 -7
  316. package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +0 -2
  317. package/dist-lib/components/params/ParamsBlock.d.ts +0 -13
  318. package/dist-lib/components/params/param-editors.d.ts +0 -20
  319. package/dist-lib/components/primitives/Avatar.d.ts +0 -6
  320. package/dist-lib/components/primitives/BoolToggle.d.ts +0 -7
  321. package/dist-lib/components/primitives/BrandGlyph.d.ts +0 -8
  322. package/dist-lib/components/primitives/BrandLogo.d.ts +0 -12
  323. package/dist-lib/components/primitives/Btn.d.ts +0 -19
  324. package/dist-lib/components/primitives/Check.d.ts +0 -7
  325. package/dist-lib/components/primitives/Chip.d.ts +0 -9
  326. package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +0 -9
  327. package/dist-lib/components/primitives/Dropdown.d.ts +0 -20
  328. package/dist-lib/components/primitives/Fields.d.ts +0 -111
  329. package/dist-lib/components/primitives/HoverCard.d.ts +0 -15
  330. package/dist-lib/components/primitives/IconBtn.d.ts +0 -11
  331. package/dist-lib/components/primitives/Icons.d.ts +0 -136
  332. package/dist-lib/components/primitives/Kbd.d.ts +0 -4
  333. package/dist-lib/components/primitives/MenuItem.d.ts +0 -14
  334. package/dist-lib/components/primitives/Pill.d.ts +0 -11
  335. package/dist-lib/components/primitives/RecordIdBadge.d.ts +0 -8
  336. package/dist-lib/components/primitives/RowField.d.ts +0 -10
  337. package/dist-lib/components/primitives/SectionCard.d.ts +0 -24
  338. package/dist-lib/components/primitives/Spinner.d.ts +0 -3
  339. package/dist-lib/components/primitives/Tooltip.d.ts +0 -34
  340. package/dist-lib/components/primitives/dataTableStyles.d.ts +0 -4
  341. package/dist-lib/components/primitives/index.d.ts +0 -37
  342. package/dist-lib/components/shared/ChangePasswordDialog.d.ts +0 -9
  343. package/dist-lib/components/shared/ConfirmDialog.d.ts +0 -11
  344. package/dist-lib/components/shared/CopyButton.d.ts +0 -8
  345. package/dist-lib/components/shared/DynamicIcon.d.ts +0 -20
  346. package/dist-lib/components/shared/EmptyState.d.ts +0 -9
  347. package/dist-lib/components/shared/ErrorBoundary.d.ts +0 -17
  348. package/dist-lib/components/shared/LoadingSkeleton.d.ts +0 -6
  349. package/dist-lib/components/shared/LucideIcon.d.ts +0 -16
  350. package/dist-lib/components/shared/Markdown.d.ts +0 -3
  351. package/dist-lib/components/shared/MarkdownRenderer.d.ts +0 -11
  352. package/dist-lib/components/shared/RefreshControl.d.ts +0 -25
  353. package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +0 -11
  354. package/dist-lib/components/shared/StatusStepper.d.ts +0 -13
  355. package/dist-lib/components/shared/toast/DeclarionToast.d.ts +0 -31
  356. package/dist-lib/components/shared/useOwnRefresh.d.ts +0 -9
  357. package/dist-lib/embed/EmbedAuthBootstrap.d.ts +0 -8
  358. package/dist-lib/embed/EmbedContext.d.ts +0 -50
  359. package/dist-lib/embed/EmbedDirtyReporter.d.ts +0 -10
  360. package/dist-lib/embed/EmbedHistoryTracker.d.ts +0 -1
  361. package/dist-lib/embed/EmbedLocationReporter.d.ts +0 -8
  362. package/dist-lib/embed/EmbedResizeReporter.d.ts +0 -6
  363. package/dist-lib/embed/EmbedUnsavedGuard.d.ts +0 -7
  364. package/dist-lib/embed/embed-dirty.d.ts +0 -24
  365. package/dist-lib/embed/embed-history.d.ts +0 -19
  366. package/dist-lib/embed/embed-nav-guard.d.ts +0 -20
  367. package/dist-lib/embed/file-src.d.ts +0 -63
  368. package/dist-lib/embed/handshake.d.ts +0 -57
  369. package/dist-lib/embed/index.d.ts +0 -19
  370. package/dist-lib/embed/params.d.ts +0 -75
  371. package/dist-lib/embed/protocol.d.ts +0 -165
  372. package/dist-lib/embed/screen-location.d.ts +0 -50
  373. package/dist-lib/embed/theme.d.ts +0 -34
  374. package/dist-lib/embed/token.d.ts +0 -57
  375. package/dist-lib/embed/useEmbedNavigate.d.ts +0 -48
  376. package/dist-lib/embed/useGlobalLinkInterceptor.d.ts +0 -66
  377. package/dist-lib/failure-BUxXuP4c.js +0 -158
  378. package/dist-lib/format-count-bXVfHzbI.js +0 -1771
  379. package/dist-lib/hooks/useActionData.d.ts +0 -61
  380. package/dist-lib/hooks/useAgentConversation.d.ts +0 -24
  381. package/dist-lib/hooks/useAllEntityData.d.ts +0 -16
  382. package/dist-lib/hooks/useAssociatedData.d.ts +0 -10
  383. package/dist-lib/hooks/useAuth.d.ts +0 -22
  384. package/dist-lib/hooks/useBranding.d.ts +0 -8
  385. package/dist-lib/hooks/useBrandingChrome.d.ts +0 -59
  386. package/dist-lib/hooks/useChildrenData.d.ts +0 -3
  387. package/dist-lib/hooks/useColumns.d.ts +0 -13
  388. package/dist-lib/hooks/useCurrentScreen.d.ts +0 -34
  389. package/dist-lib/hooks/useCursorEntityData.d.ts +0 -79
  390. package/dist-lib/hooks/useDebounce.d.ts +0 -1
  391. package/dist-lib/hooks/useEntity.d.ts +0 -2
  392. package/dist-lib/hooks/useEntityData.d.ts +0 -41
  393. package/dist-lib/hooks/useFilters.d.ts +0 -14
  394. package/dist-lib/hooks/useImpersonation.d.ts +0 -23
  395. package/dist-lib/hooks/useLanguage.d.ts +0 -4
  396. package/dist-lib/hooks/useLiveObject.d.ts +0 -9
  397. package/dist-lib/hooks/useLongPress.d.ts +0 -29
  398. package/dist-lib/hooks/useMutations.d.ts +0 -13
  399. package/dist-lib/hooks/useObject.d.ts +0 -11
  400. package/dist-lib/hooks/useObjectStatus.d.ts +0 -5
  401. package/dist-lib/hooks/usePageState.d.ts +0 -32
  402. package/dist-lib/hooks/usePageStateRuntime.d.ts +0 -27
  403. package/dist-lib/hooks/usePageStateTtl.d.ts +0 -11
  404. package/dist-lib/hooks/useParams.d.ts +0 -49
  405. package/dist-lib/hooks/useProperties.d.ts +0 -5
  406. package/dist-lib/hooks/useRealtimeThresholds.d.ts +0 -1
  407. package/dist-lib/hooks/useRegisterScreenTab.d.ts +0 -11
  408. package/dist-lib/hooks/useResponsiveMode.d.ts +0 -27
  409. package/dist-lib/hooks/useSSE.d.ts +0 -31
  410. package/dist-lib/hooks/useSchema.d.ts +0 -1
  411. package/dist-lib/hooks/useScreen.d.ts +0 -2
  412. package/dist-lib/hooks/useScreenBack.d.ts +0 -21
  413. package/dist-lib/hooks/useScreenTab.d.ts +0 -10
  414. package/dist-lib/hooks/useTabNavigate.d.ts +0 -34
  415. package/dist-lib/hooks/useTabSearchMirror.d.ts +0 -1
  416. package/dist-lib/hooks/useTabTitle.d.ts +0 -2
  417. package/dist-lib/hooks/useText.d.ts +0 -3
  418. package/dist-lib/hooks/useTimelineData.d.ts +0 -10
  419. package/dist-lib/hooks/useVersionWatcher.d.ts +0 -30
  420. package/dist-lib/hooks/useViews.d.ts +0 -26
  421. package/dist-lib/lib/action-dispatch.d.ts +0 -8
  422. package/dist-lib/lib/actions.d.ts +0 -254
  423. package/dist-lib/lib/anchor.d.ts +0 -36
  424. package/dist-lib/lib/brand-tokens.d.ts +0 -43
  425. package/dist-lib/lib/branding.d.ts +0 -20
  426. package/dist-lib/lib/canonical-url.d.ts +0 -27
  427. package/dist-lib/lib/capabilityPrefetch.d.ts +0 -6
  428. package/dist-lib/lib/child-config.d.ts +0 -24
  429. package/dist-lib/lib/children-validation.d.ts +0 -5
  430. package/dist-lib/lib/decimal-text.d.ts +0 -1
  431. package/dist-lib/lib/display-value.d.ts +0 -1
  432. package/dist-lib/lib/document-templates.d.ts +0 -11
  433. package/dist-lib/lib/download.d.ts +0 -21
  434. package/dist-lib/lib/evidence-verdict.d.ts +0 -11
  435. package/dist-lib/lib/failure.d.ts +0 -2
  436. package/dist-lib/lib/field-classification.d.ts +0 -61
  437. package/dist-lib/lib/field-regions.d.ts +0 -8
  438. package/dist-lib/lib/filter-evaluator.d.ts +0 -16
  439. package/dist-lib/lib/filters.d.ts +0 -93
  440. package/dist-lib/lib/format-count.d.ts +0 -41
  441. package/dist-lib/lib/html-state.d.ts +0 -11
  442. package/dist-lib/lib/language.d.ts +0 -19
  443. package/dist-lib/lib/longPressGesture.d.ts +0 -55
  444. package/dist-lib/lib/mass-edit.d.ts +0 -32
  445. package/dist-lib/lib/page-inset.d.ts +0 -3
  446. package/dist-lib/lib/quick-add.d.ts +0 -2
  447. package/dist-lib/lib/realtime-query-keys.d.ts +0 -22
  448. package/dist-lib/lib/realtime-reconcile.d.ts +0 -33
  449. package/dist-lib/lib/realtime-resync.d.ts +0 -23
  450. package/dist-lib/lib/record-documents-key.d.ts +0 -1
  451. package/dist-lib/lib/rich-text.d.ts +0 -14
  452. package/dist-lib/lib/rowClickGesture.d.ts +0 -26
  453. package/dist-lib/lib/safe-url.d.ts +0 -15
  454. package/dist-lib/lib/schema-routing.d.ts +0 -3
  455. package/dist-lib/lib/screen-back.d.ts +0 -70
  456. package/dist-lib/lib/scroll-restoration.d.ts +0 -90
  457. package/dist-lib/lib/size-value.d.ts +0 -16
  458. package/dist-lib/lib/sort.d.ts +0 -72
  459. package/dist-lib/lib/timestamp.d.ts +0 -53
  460. package/dist-lib/lib/toast.d.ts +0 -49
  461. package/dist-lib/lib/ui-actions.d.ts +0 -12
  462. package/dist-lib/lib/utils.d.ts +0 -9
  463. package/dist-lib/lib/variants.d.ts +0 -7
  464. package/dist-lib/lib/versionTracker.d.ts +0 -72
  465. package/dist-lib/lib/viewport-category.d.ts +0 -44
  466. package/dist-lib/main.d.ts +0 -1
  467. package/dist-lib/registry-nSeHd5si.js +0 -1956
  468. package/dist-lib/safe-url-oSJw5pzO.js +0 -34
  469. package/dist-lib/stores/auth.d.ts +0 -16
  470. package/dist-lib/stores/list-layout.d.ts +0 -85
  471. package/dist-lib/stores/page-state.d.ts +0 -61
  472. package/dist-lib/stores/preferences.d.ts +0 -37
  473. package/dist-lib/stores/realtime.d.ts +0 -96
  474. package/dist-lib/stores/screen-registry.d.ts +0 -17
  475. package/dist-lib/stores/tabs.d.ts +0 -73
  476. package/dist-lib/types/api.d.ts +0 -579
  477. package/dist-lib/types/fieldType.d.ts +0 -2
  478. package/dist-lib/types/files.d.ts +0 -79
  479. package/dist-lib/types/ordmap.d.ts +0 -39
  480. package/dist-lib/types/schema.d.ts +0 -1089
  481. package/dist-lib/useCurrentScreen-0WBj7wT6.js +0 -7860
  482. package/dist-lib/useListQuery-C7dq_sEo.js +0 -103
  483. package/dist-lib/useOwnRefresh-q80kCMMh.js +0 -1167
  484. package/dist-lib/useProperties-CeGKtq7Q.js +0 -83
  485. package/dist-lib/useTabSearchMirror-CzNAj82Q.js +0 -175
  486. package/dist-lib/useText-BsedsJ-J.js +0 -952
  487. package/dist-lib/vite/fingerprint-plugin.d.ts +0 -44
@@ -0,0 +1,1609 @@
1
+ import { $ as e, A as t, B as n, Cn as r, Ft as i, I as a, It as o, Nt as s, Q as c, W as l, Xt as u, Z as d, an as f, at as p, cn as m, et as h, fn as g, in as _, mn as v, mt as y, on as ee, pt as b, qn as x, rn as te, sn as S, ut as C, wn as w, wt as T, xn as ne, xt as re } from "./useCurrentScreen--UovgvRj.js";
2
+ import { t as E } from "./Icons-lt-7lhYR.js";
3
+ import { n as ie, r as D, t as O } from "./CopyButton-C0iEvaT1.js";
4
+ import { t as k } from "./Pill-D-wsfRhx.js";
5
+ import { L as ae, Q as A, _ as j, f as oe, h as se, o as ce, y as le } from "./PropertyGridEditor-BTjscqfz.js";
6
+ import { n as M } from "./useBrandingChrome-bKTXXDLy.js";
7
+ import { t as N } from "./SectionCard-VonaiLrx.js";
8
+ import { t as P } from "./DynamicIcon-DuBSz6TZ.js";
9
+ import { t as ue } from "./useScreenBack-J861tbwn.js";
10
+ import { n as F } from "./useTabNavigate-BZiW4q3M.js";
11
+ import { r as de } from "./page-state-eA6J_KIR.js";
12
+ import { _ as fe, n as pe, v as me } from "./ActionRunner-DAxgnKB3.js";
13
+ import { a as he, c as ge, d as _e, h as ve, n as ye, s as be } from "./useOwnRefresh-DkOuM4yo.js";
14
+ import { n as xe, t as Se } from "./useObject-1OCeV34A.js";
15
+ import { a as Ce, f as we, g as Te, l as Ee, m as De, n as Oe, p as ke, s as Ae, u as je } from "./variants-CbAwl3Mn.js";
16
+ import { n as Me, t as Ne } from "./payload-B2wODLAX.js";
17
+ import { r as Pe, t as Fe } from "./RefreshControl-Ce-T_wSQ.js";
18
+ import { n as Ie, r as Le, t as Re } from "./dataTableStyles-vwD1mVOP.js";
19
+ import { a as ze, i as Be, o as Ve, r as He, s as Ue } from "./peekDraftStore-D4GRsRKW.js";
20
+ import { n as We, t as Ge } from "./LayoutRenderer-DEHtYtzV.js";
21
+ import { i as Ke } from "./FieldRow-BXBBFOZh.js";
22
+ import { n as qe, t as Je } from "./RecordHeader-Bv9nJXnG.js";
23
+ import { t as Ye } from "./PageShell-tI-mm0C5.js";
24
+ import { t as Xe } from "./cardProjection-Cr7fG6wJ.js";
25
+ import { Fragment as I, useCallback as L, useEffect as R, useMemo as z, useRef as Ze, useState as B } from "react";
26
+ import { useQuery as Qe, useQueryClient as V } from "@tanstack/react-query";
27
+ import { Fragment as $e, jsx as H, jsxs as U } from "react/jsx-runtime";
28
+ import { useLocation as et, useParams as tt, useSearchParams as nt } from "react-router";
29
+ //#region src/components/chrome/AssociationTabs.tsx
30
+ function rt({ entityCode: e, recordId: t, associations: n, schema: r }) {
31
+ let i = T(), a = z(() => Object.entries(n), [n]), [o, s] = B(0);
32
+ if (a.length === 0) return null;
33
+ let [c, l] = a[o];
34
+ return /* @__PURE__ */ H(N, {
35
+ title: /* @__PURE__ */ H("div", {
36
+ style: {
37
+ display: "flex",
38
+ alignItems: "center",
39
+ gap: 4,
40
+ borderBottom: "1px solid var(--divider)",
41
+ margin: "-10px -14px 0 -14px",
42
+ padding: "0 14px"
43
+ },
44
+ children: a.map(([e, t], n) => {
45
+ let r = n === o;
46
+ return /* @__PURE__ */ U("button", {
47
+ onClick: (e) => {
48
+ e.stopPropagation(), s(n);
49
+ },
50
+ style: {
51
+ display: "inline-flex",
52
+ alignItems: "center",
53
+ gap: 6,
54
+ padding: "10px 12px",
55
+ fontSize: 12.5,
56
+ background: "transparent",
57
+ border: 0,
58
+ borderBottom: `2px solid ${r ? "var(--accent)" : "transparent"}`,
59
+ marginBottom: -1,
60
+ color: r ? "var(--text)" : "var(--text-3)",
61
+ cursor: "pointer",
62
+ fontWeight: r ? 600 : 500
63
+ },
64
+ children: [t.display?.icon && /* @__PURE__ */ H(P, {
65
+ name: t.display.icon,
66
+ size: 13
67
+ }), i(t.display?.name) || e]
68
+ }, e);
69
+ })
70
+ }),
71
+ collapsible: !1,
72
+ padding: "0",
73
+ children: /* @__PURE__ */ H(it, {
74
+ entityCode: e,
75
+ recordId: t,
76
+ assocKey: c,
77
+ association: l,
78
+ schema: r
79
+ })
80
+ });
81
+ }
82
+ function it({ entityCode: e, recordId: t, assocKey: n, association: r, schema: i }) {
83
+ let o = T(), s = T("errors"), c = F(), l = `${e}.${n}`, { data: u, isLoading: d } = Qe({
84
+ queryKey: [
85
+ "association",
86
+ l,
87
+ t
88
+ ],
89
+ queryFn: () => y(l, [t])
90
+ }), f = u?.target_entity ?? r.target, p = i.entities[f], m = z(() => u?.ids ?? [], [u?.ids]), h = z(() => p?.fields.names().find((e) => p.fields.get(e)?.primary) ?? "id", [p]), g = z(() => m.slice(0, 50), [m]), { data: _, isLoading: v } = Qe({
91
+ queryKey: [
92
+ "association-records",
93
+ f,
94
+ g
95
+ ],
96
+ queryFn: () => b(f, {
97
+ per_page: 50,
98
+ filters: [{
99
+ field: h,
100
+ op: "in",
101
+ value: g
102
+ }]
103
+ }),
104
+ enabled: g.length > 0 && !!p
105
+ }), x = _?.data ?? [], te = _?.$refs, S = z(() => p ? p.fields.names().filter((e) => {
106
+ let t = p.fields.get(e);
107
+ return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
108
+ }).slice(0, 6) : [], [p]), C = () => {
109
+ let e = a(i, f);
110
+ if (!e) return;
111
+ let t = o(r.display?.name) || n, s = new URLSearchParams();
112
+ s.set("filters", JSON.stringify([{
113
+ field: h,
114
+ op: "in",
115
+ value: m
116
+ }])), c(e.route, {
117
+ title: t,
118
+ icon: r.display?.icon || e.icon,
119
+ search: s.toString()
120
+ });
121
+ }, w = {
122
+ fontSize: 12.5,
123
+ color: "var(--text-3)",
124
+ padding: "14px 16px"
125
+ };
126
+ if (d || v) return /* @__PURE__ */ H("div", {
127
+ style: w,
128
+ children: o("shell.loading", "Loading…")
129
+ });
130
+ if (!p) return /* @__PURE__ */ H("div", {
131
+ style: w,
132
+ children: s("record.related_entity_not_found", "The related record type is not declared in this deployment.")
133
+ });
134
+ if (m.length === 0) return /* @__PURE__ */ H("div", {
135
+ style: w,
136
+ children: o("shell.association.empty", "No related records.")
137
+ });
138
+ let ne = a(i, f);
139
+ return /* @__PURE__ */ U("div", {
140
+ style: { padding: "8px 0" },
141
+ children: [
142
+ /* @__PURE__ */ U("table", {
143
+ style: Le,
144
+ children: [/* @__PURE__ */ H("thead", { children: /* @__PURE__ */ H("tr", { children: S.map((e) => /* @__PURE__ */ H("th", {
145
+ style: Ie,
146
+ children: ee(o, p.fields.get(e), e, i.entities)
147
+ }, e)) }) }), /* @__PURE__ */ H("tbody", { children: x.map((e, t) => /* @__PURE__ */ H("tr", { children: S.map((t) => {
148
+ let n = p.fields.get(t);
149
+ return n ? /* @__PURE__ */ H("td", {
150
+ style: Re,
151
+ children: oe({
152
+ field: n,
153
+ fieldName: t,
154
+ value: e[t],
155
+ mode: "display",
156
+ record: e,
157
+ refs: te,
158
+ t: o
159
+ })
160
+ }, t) : /* @__PURE__ */ H("td", {}, t);
161
+ }) }, t)) })]
162
+ }),
163
+ ne && u && u.count > x.length && /* @__PURE__ */ H("div", {
164
+ style: {
165
+ padding: "10px 16px",
166
+ textAlign: "center"
167
+ },
168
+ children: /* @__PURE__ */ H(D, {
169
+ icon: /* @__PURE__ */ H(E.external, { size: 12 }),
170
+ onClick: C,
171
+ children: o("shell.association.view_all", "View all {count} records", { count: u.count })
172
+ })
173
+ }),
174
+ ne && x.length > 0 && u && u.count <= x.length && /* @__PURE__ */ H("div", {
175
+ style: {
176
+ padding: "10px 16px",
177
+ textAlign: "center"
178
+ },
179
+ children: /* @__PURE__ */ H(D, {
180
+ kind: "ghost",
181
+ icon: /* @__PURE__ */ H(E.external, { size: 12 }),
182
+ onClick: C,
183
+ children: o("shell.association.open_list", "Open in list view")
184
+ })
185
+ })
186
+ ]
187
+ });
188
+ }
189
+ //#endregion
190
+ //#region src/components/pages/RecordDocumentsPanel.tsx
191
+ var W = 4e3, at = "pdf";
192
+ function G(e) {
193
+ return e?.some((e) => e.status === "pending") ? W : !1;
194
+ }
195
+ function ot({ entityCode: e, objectId: t, canGenerateOne: n, canManageTemplates: r }) {
196
+ let i = T(), a = T("errors"), { data: o, isLoading: s, error: l } = Qe({
197
+ queryKey: [
198
+ fe,
199
+ e,
200
+ t
201
+ ],
202
+ queryFn: async () => (await C("document.object_links", {
203
+ entity: e,
204
+ object_id: t
205
+ })).result?.documents ?? [],
206
+ enabled: !!(e && t) && (!!n || !!r),
207
+ refetchInterval: (e) => G(e.state.data)
208
+ }), u = (o?.length ?? 0) > 0;
209
+ return !n && !u ? null : /* @__PURE__ */ U(N, {
210
+ title: /* @__PURE__ */ H(K, {}),
211
+ collapsible: !1,
212
+ padding: "0",
213
+ children: [
214
+ s && /* @__PURE__ */ H(ct, {
215
+ icon: /* @__PURE__ */ H(E.loader, { size: 14 }),
216
+ text: i("document.panel.loading", "Loading documents...")
217
+ }),
218
+ l && /* @__PURE__ */ H(ct, {
219
+ icon: /* @__PURE__ */ H(E.warning, { size: 14 }),
220
+ text: c(a, l)
221
+ }),
222
+ !s && !l && (o?.length ?? 0) === 0 && /* @__PURE__ */ H(ct, {
223
+ icon: /* @__PURE__ */ H(E.file, { size: 14 }),
224
+ text: i("document.panel.empty", "No generated documents")
225
+ }),
226
+ !s && !l && o && o.length > 0 && /* @__PURE__ */ H("div", {
227
+ style: {
228
+ display: "flex",
229
+ flexDirection: "column"
230
+ },
231
+ children: o.map((n) => /* @__PURE__ */ H(st, {
232
+ entityCode: e,
233
+ objectId: t,
234
+ doc: n
235
+ }, n.generated_document_id))
236
+ })
237
+ ]
238
+ });
239
+ }
240
+ function K() {
241
+ let e = T();
242
+ return /* @__PURE__ */ U("div", {
243
+ style: {
244
+ display: "flex",
245
+ alignItems: "center",
246
+ gap: 6,
247
+ margin: "-10px -14px 0 -14px",
248
+ padding: "10px 14px",
249
+ fontSize: 12.5,
250
+ fontWeight: 600,
251
+ color: "var(--text)"
252
+ },
253
+ children: [/* @__PURE__ */ H(E.file, { size: 13 }), e("document.panel.title", "Documents")]
254
+ });
255
+ }
256
+ function st({ entityCode: t, objectId: n, doc: r }) {
257
+ let a = T(), { data: o } = i(), s = a(o?.entities?.generated_document?.fields.get("status")?.values?.find((e) => e.code === r.status)?.name) || r.status, l = T("errors"), u = V(), [d, f] = B(!1), [p, m] = B(!1), [g, _] = B(!1), [v, y] = B(!1), [ee, b] = B(null), x = a(r.title) || r.filename || r.template_code, te = r.status === "ready" && r.download_url && !v;
258
+ async function S() {
259
+ f(!0), b(null);
260
+ try {
261
+ let t = (await C("document.download_format", {
262
+ generated_document_id: r.generated_document_id,
263
+ format: at
264
+ })).result;
265
+ t?.download_url && await e(l, t.download_url, t.filename);
266
+ } catch (e) {
267
+ h(e) ? (y(!0), b(l("document.artifact_unavailable", "This generated file is not available."))) : b(c(l, e));
268
+ } finally {
269
+ f(!1);
270
+ }
271
+ }
272
+ async function w() {
273
+ if (r.download_url) {
274
+ m(!0), b(null);
275
+ try {
276
+ await e(l, r.download_url, r.filename);
277
+ } catch (e) {
278
+ h(e) ? (y(!0), b(l("document.artifact_unavailable", "This generated file is not available."))) : b(c(l, e));
279
+ } finally {
280
+ m(!1);
281
+ }
282
+ }
283
+ }
284
+ async function ne() {
285
+ _(!0), b(null);
286
+ try {
287
+ await C("document.generate", {
288
+ ...r.input ?? {},
289
+ template_code: r.template_code,
290
+ template_source: r.template_source,
291
+ output_format: r.output_format
292
+ }), await u.invalidateQueries({ queryKey: [
293
+ fe,
294
+ t,
295
+ n
296
+ ] });
297
+ } catch (e) {
298
+ b(c(l, e));
299
+ } finally {
300
+ _(!1);
301
+ }
302
+ }
303
+ return /* @__PURE__ */ U("div", {
304
+ style: {
305
+ display: "grid",
306
+ gridTemplateColumns: "minmax(0, 1fr) auto",
307
+ gap: 12,
308
+ alignItems: "center",
309
+ padding: "11px 14px",
310
+ borderTop: "1px solid var(--divider)"
311
+ },
312
+ children: [/* @__PURE__ */ U("div", {
313
+ style: { minWidth: 0 },
314
+ children: [
315
+ /* @__PURE__ */ H("div", {
316
+ style: {
317
+ fontSize: 13,
318
+ fontWeight: 600,
319
+ color: "var(--text)",
320
+ overflow: "hidden",
321
+ textOverflow: "ellipsis",
322
+ whiteSpace: "nowrap"
323
+ },
324
+ children: x
325
+ }),
326
+ /* @__PURE__ */ U("div", {
327
+ style: {
328
+ marginTop: 3,
329
+ display: "flex",
330
+ gap: 8,
331
+ alignItems: "center",
332
+ color: "var(--text-3)",
333
+ fontSize: 11.5
334
+ },
335
+ children: [
336
+ /* @__PURE__ */ H("span", { children: r.output_format.toUpperCase() }),
337
+ /* @__PURE__ */ H("span", { children: v ? a("document.row.artifact_missing", "artifact unavailable") : s }),
338
+ /* @__PURE__ */ H("span", { children: r.ready_at || r.created_at })
339
+ ]
340
+ }),
341
+ r.status === "failed" && r.error_text && /* @__PURE__ */ H("div", {
342
+ style: {
343
+ marginTop: 5,
344
+ color: "var(--danger)",
345
+ fontSize: 12
346
+ },
347
+ children: r.error_text
348
+ }),
349
+ ee && /* @__PURE__ */ H("div", {
350
+ style: {
351
+ marginTop: 5,
352
+ color: "var(--danger)",
353
+ fontSize: 12
354
+ },
355
+ children: ee
356
+ })
357
+ ]
358
+ }), te ? /* @__PURE__ */ U("div", {
359
+ style: {
360
+ display: "flex",
361
+ gap: 6
362
+ },
363
+ children: [/* @__PURE__ */ H(D, {
364
+ kind: "ghost",
365
+ size: "sm",
366
+ icon: H(d ? E.loader : E.file, { size: 12 }),
367
+ onClick: S,
368
+ disabled: d,
369
+ children: at.toUpperCase()
370
+ }), /* @__PURE__ */ H(D, {
371
+ kind: "default",
372
+ size: "sm",
373
+ icon: H(p ? E.loader : E.download, { size: 12 }),
374
+ onClick: w,
375
+ disabled: p,
376
+ children: a("document.result.download", "Download")
377
+ })]
378
+ }) : v ? /* @__PURE__ */ H(D, {
379
+ kind: "ghost",
380
+ size: "sm",
381
+ icon: H(g ? E.loader : E.file, { size: 12 }),
382
+ onClick: ne,
383
+ disabled: g,
384
+ children: a("document.row.regenerate", "Regenerate")
385
+ }) : /* @__PURE__ */ H(D, {
386
+ kind: "ghost",
387
+ size: "sm",
388
+ disabled: !0,
389
+ children: r.status === "pending" ? a("document.row.pending", "Pending") : a("document.not_available", "Unavailable")
390
+ })]
391
+ });
392
+ }
393
+ function ct({ icon: e, text: t }) {
394
+ return /* @__PURE__ */ U("div", {
395
+ style: {
396
+ display: "flex",
397
+ alignItems: "center",
398
+ gap: 8,
399
+ padding: "14px",
400
+ color: "var(--text-3)",
401
+ fontSize: 12.5
402
+ },
403
+ children: [e, t]
404
+ });
405
+ }
406
+ //#endregion
407
+ //#region src/components/detail-layout/ErrorSummary.tsx
408
+ function lt({ errors: e, onJump: t }) {
409
+ let n = T();
410
+ return e.length === 0 ? null : /* @__PURE__ */ U("div", {
411
+ role: "alert",
412
+ style: {
413
+ display: "flex",
414
+ gap: 10,
415
+ padding: "10px 12px",
416
+ marginBottom: 12,
417
+ borderRadius: 8,
418
+ background: "var(--danger-soft)",
419
+ border: "1px solid var(--danger-border)",
420
+ color: "var(--text)"
421
+ },
422
+ children: [/* @__PURE__ */ H("span", {
423
+ style: {
424
+ color: "var(--danger)",
425
+ marginTop: 1,
426
+ display: "flex"
427
+ },
428
+ children: /* @__PURE__ */ H(E.warning, { size: 14 })
429
+ }), /* @__PURE__ */ U("div", {
430
+ style: {
431
+ flex: 1,
432
+ minWidth: 0
433
+ },
434
+ children: [/* @__PURE__ */ H("div", {
435
+ style: {
436
+ fontSize: 12.5,
437
+ fontWeight: 600,
438
+ marginBottom: 4
439
+ },
440
+ children: s(n, "record.errors.summary", e.length, {
441
+ one: "{count} field needs attention",
442
+ other: "{count} fields need attention"
443
+ })
444
+ }), /* @__PURE__ */ H("ul", {
445
+ style: {
446
+ margin: 0,
447
+ padding: 0,
448
+ listStyle: "none",
449
+ display: "flex",
450
+ flexDirection: "column",
451
+ gap: 2
452
+ },
453
+ children: e.map((e) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ U("button", {
454
+ type: "button",
455
+ onClick: t ? () => t(e.name) : void 0,
456
+ style: {
457
+ background: "transparent",
458
+ border: 0,
459
+ padding: 0,
460
+ cursor: t ? "pointer" : "default",
461
+ fontSize: 12,
462
+ textAlign: "left",
463
+ fontFamily: "inherit"
464
+ },
465
+ children: [
466
+ /* @__PURE__ */ H("span", {
467
+ style: {
468
+ color: "var(--danger)",
469
+ marginRight: 6
470
+ },
471
+ children: "•"
472
+ }),
473
+ /* @__PURE__ */ H("span", {
474
+ style: {
475
+ fontWeight: 500,
476
+ color: "var(--text-2)"
477
+ },
478
+ children: e.label
479
+ }),
480
+ /* @__PURE__ */ U("span", {
481
+ style: { color: "var(--text-3)" },
482
+ children: [" - ", e.message]
483
+ })
484
+ ]
485
+ }) }, e.name))
486
+ })]
487
+ })]
488
+ });
489
+ }
490
+ //#endregion
491
+ //#region src/components/chrome/HighlightsStrip.tsx
492
+ function ut({ items: e }) {
493
+ return e.length === 0 ? null : /* @__PURE__ */ H("div", {
494
+ style: {
495
+ display: "flex",
496
+ alignItems: "center",
497
+ flexWrap: "wrap",
498
+ gap: "6px 0",
499
+ fontSize: 12
500
+ },
501
+ children: e.map((e, t) => /* @__PURE__ */ U(I, { children: [t > 0 && /* @__PURE__ */ H("span", { style: {
502
+ width: 1,
503
+ height: 12,
504
+ background: "var(--divider)",
505
+ marginInline: 12
506
+ } }), /* @__PURE__ */ U("span", {
507
+ style: {
508
+ display: "inline-flex",
509
+ alignItems: "center",
510
+ gap: 6,
511
+ lineHeight: 1.3
512
+ },
513
+ children: [/* @__PURE__ */ H("span", {
514
+ style: {
515
+ color: "var(--text-3)",
516
+ fontSize: 11.5
517
+ },
518
+ children: e.label
519
+ }), /* @__PURE__ */ H("span", {
520
+ style: { color: "var(--text)" },
521
+ children: e.value
522
+ })]
523
+ })] }, t))
524
+ });
525
+ }
526
+ //#endregion
527
+ //#region src/components/detail-layout/DetailHighlights.tsx
528
+ function dt({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o }) {
529
+ let s = T(), c = e.highlights;
530
+ if (!c || c.length === 0) return null;
531
+ let l = [];
532
+ for (let e of c) {
533
+ let c = t.status_groups?.[e];
534
+ if (c) {
535
+ let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
536
+ l.push({
537
+ label: s(c.name),
538
+ value: n ? /* @__PURE__ */ H(k, {
539
+ tone: n.color ?? "slate",
540
+ size: "xs",
541
+ children: s(n.name)
542
+ }) : /* @__PURE__ */ H("span", {
543
+ style: { color: "var(--text-4)" },
544
+ children: "—"
545
+ })
546
+ });
547
+ } else if (t.fields.get(e) || t.files?.get(e)) {
548
+ let a = ke({
549
+ entity: t,
550
+ entityCode: n,
551
+ fieldName: e,
552
+ record: r,
553
+ mode: "display",
554
+ refs: i,
555
+ entities: o.entities,
556
+ screens: o.screens,
557
+ surface: "list",
558
+ t: s
559
+ }), c = Ke(t.fields.get(e), r[e]);
560
+ l.push({
561
+ label: De(s, t, e, o.entities),
562
+ value: c ? /* @__PURE__ */ U($e, { children: [a, /* @__PURE__ */ H(O, {
563
+ value: c,
564
+ size: "sm",
565
+ title: s("record.field.copy_value", "Copy value")
566
+ })] }) : a
567
+ });
568
+ }
569
+ }
570
+ return l.length === 0 ? null : /* @__PURE__ */ H(ut, { items: l });
571
+ }
572
+ //#endregion
573
+ //#region src/components/detail-layout/EvidenceBlock.tsx
574
+ function q(e, t) {
575
+ if (!e) return;
576
+ let n = new Date(e);
577
+ if (!Number.isNaN(n.getTime())) return n.toLocaleString(t);
578
+ }
579
+ function ft({ evidence: e }) {
580
+ let t = T(), n = e?.verdict ?? "unverified", r = q(e?.verified_at, t.language), i = [];
581
+ return e?.seq && i.push(t("record.evidence.chain", "chain #{seq}", { seq: e.seq })), e?.generation && i.push(t("record.evidence.generation", "generation {number}", { number: e.generation })), /* @__PURE__ */ U("div", {
582
+ style: {
583
+ display: "flex",
584
+ flexDirection: "column",
585
+ gap: 6
586
+ },
587
+ children: [/* @__PURE__ */ U("div", {
588
+ style: {
589
+ display: "flex",
590
+ alignItems: "center",
591
+ gap: 10,
592
+ flexWrap: "wrap"
593
+ },
594
+ children: [
595
+ /* @__PURE__ */ H("span", {
596
+ style: {
597
+ fontSize: 12,
598
+ fontWeight: 600,
599
+ color: "var(--muted-foreground)"
600
+ },
601
+ children: t("record.evidence.title", "Evidence")
602
+ }),
603
+ i.length > 0 && /* @__PURE__ */ H("span", {
604
+ style: {
605
+ fontSize: 12,
606
+ color: "var(--muted-foreground)"
607
+ },
608
+ children: i.join(" · ")
609
+ }),
610
+ /* @__PURE__ */ H(k, {
611
+ tone: ze(n),
612
+ size: "sm",
613
+ dot: !0,
614
+ children: Be(t, n)
615
+ }),
616
+ r && /* @__PURE__ */ H("span", {
617
+ style: {
618
+ fontSize: 12,
619
+ color: "var(--muted-foreground)"
620
+ },
621
+ children: t("record.evidence.verified", "Verified {when}", { when: r })
622
+ })
623
+ ]
624
+ }), e?.reason && /* @__PURE__ */ H("span", {
625
+ style: {
626
+ fontSize: 12,
627
+ color: "var(--destructive)"
628
+ },
629
+ children: e.reason
630
+ })]
631
+ });
632
+ }
633
+ //#endregion
634
+ //#region src/lib/children-validation.ts
635
+ function pt(e, t, n) {
636
+ let r = [];
637
+ for (let [i, a] of e.fields) {
638
+ if (!a.required || a.auto || n && a.primary || e.tenant_key && i === e.tenant_key || a.default !== void 0 && a.default !== null) continue;
639
+ let o = t[i];
640
+ (o == null || o === "") && r.push(i);
641
+ }
642
+ return r;
643
+ }
644
+ var mt = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
645
+ function ht(e, t) {
646
+ let n = [];
647
+ for (let [r, i] of e.fields) {
648
+ if (i.type !== "email") continue;
649
+ let e = t[r];
650
+ typeof e == "string" && e !== "" && !mt.test(e) && n.push(r);
651
+ }
652
+ return n;
653
+ }
654
+ function gt(e, t) {
655
+ let n = /* @__PURE__ */ new Set();
656
+ for (let r of Object.values(t.entities)) if (r.children) {
657
+ for (let t of r.children) if (t.entity === e && t.foreign_key) {
658
+ let e = Array.isArray(t.foreign_key) ? t.foreign_key : [t.foreign_key];
659
+ for (let t of e) n.add(t);
660
+ }
661
+ }
662
+ return n;
663
+ }
664
+ function _t(e, t) {
665
+ if (!e || !t) return {};
666
+ let n = {};
667
+ for (let [r, i] of Object.entries(e)) {
668
+ let e = t.entities[r];
669
+ if (!e) continue;
670
+ let a = gt(r, t), o = [];
671
+ for (let [t, n] of e.fields) e.tenant_key && t === e.tenant_key || n.required && !n.auto && !n.primary && !a.has(t) && o.push(t);
672
+ if (o.length !== 0) for (let e of i) {
673
+ if (e._deleted) continue;
674
+ let t = [];
675
+ for (let n of o) {
676
+ let r = e[n];
677
+ (r == null || r === "") && t.push(n);
678
+ }
679
+ t.length > 0 && (n[r] || (n[r] = {}), n[r][e._key] = t);
680
+ }
681
+ }
682
+ return n;
683
+ }
684
+ //#endregion
685
+ //#region src/components/pages/SmartDetailPage.impl.tsx
686
+ var vt = () => {}, yt = { expand: ["evidence"] };
687
+ function bt(e, t) {
688
+ return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
689
+ }
690
+ function xt({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, pendingProperties: a, pendingChildren: o, childrenSnapshot: s }) {
691
+ let c = {}, l = Ne({
692
+ entity: e,
693
+ formData: t,
694
+ record: n,
695
+ isNew: r
696
+ }), u = Me(l);
697
+ if (r) for (let [n, r] of Object.entries(t)) {
698
+ if (e.files?.has(n)) continue;
699
+ let t = Te(e, n, r);
700
+ t !== "" && t != null && (c[n] = t);
701
+ }
702
+ else for (let [r, i] of Object.entries(t)) {
703
+ if (e.files?.has(r)) continue;
704
+ let t = n ? we(e, n, r) : void 0, a = Te(e, r, i), o = Te(e, r, t);
705
+ (a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (c[r] = a);
706
+ }
707
+ if (Object.keys(l).length > 0 && (c.$files = l), Object.keys(i).length > 0 && (c.$statuses = Object.entries(i).map(([e, t]) => ({
708
+ status_group_code: e,
709
+ status_code: t
710
+ }))), Object.keys(a).length > 0 && (c.$properties = Object.entries(a).map(([e, t]) => ({
711
+ property_code: e,
712
+ value: t
713
+ }))), o) {
714
+ let e = {};
715
+ for (let [t, n] of Object.entries(o)) {
716
+ let i = n.filter((e) => !e._deleted).map((e) => {
717
+ let { _key: t, _deleted: n, _dirty: r, ...i } = e;
718
+ return i;
719
+ }), a = s?.[t] ?? [];
720
+ (r || !bt(i, a)) && (e[t] = i);
721
+ }
722
+ Object.keys(e).length > 0 && (c.$children = e);
723
+ }
724
+ return {
725
+ payload: c,
726
+ committedFileIds: u
727
+ };
728
+ }
729
+ function St(e, t) {
730
+ if (e) {
731
+ let n = f(e, t), r = v(n);
732
+ if (r.replace(/^\|+|\|+$/g, "")) return r;
733
+ }
734
+ return t.id == null ? crypto.randomUUID() : w(t.id);
735
+ }
736
+ function J({ screenCode: e }) {
737
+ return /* @__PURE__ */ H(se, { children: /* @__PURE__ */ H(Ct, { screenCode: e }) });
738
+ }
739
+ function Ct({ screenCode: e }) {
740
+ let t = T(), n = T("errors"), { id: a } = tt(), s = l(), [c, p] = nt(), { data: h } = i(), y = o((e) => e.user), b = j(), C = re(), w = h?.screens[e], D = w?.entity ? h?.entities[w.entity] : void 0, O = w?.entity, k = _(D, "create"), A = _(D, "update"), oe = _(D, "restore"), se = (() => {
741
+ if (!D || !D.singleton || !D.prefilter) return;
742
+ let e = m(D);
743
+ if (e.length !== 1) return;
744
+ let t = D.prefilter[e[0]];
745
+ if (t === "$caller.user_id") return y?.id;
746
+ if (t === "$caller.tenant_id") return y?.tenant?.id;
747
+ })(), M = se !== void 0, N = M ? se : a, P = !M && N === "new", F = z(() => {
748
+ if (!N || P) return;
749
+ if (!D) return N;
750
+ let e = m(D);
751
+ if (e.length === 1) return { [e[0]]: N };
752
+ let t = g(N, e.length);
753
+ if (!t) return;
754
+ let n = {};
755
+ for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
756
+ return n;
757
+ }, [
758
+ N,
759
+ P,
760
+ D
761
+ ]), fe = z(() => {
762
+ if (F) return typeof F == "string" ? F : v(F);
763
+ }, [F]), pe = xe(O, F, yt), { data: Ce, isLoading: Te, error: Ee } = pe, De = me(D?.realtime, O ?? ""), ke = O ? De : !1;
764
+ _e(Se(O, F, yt), !P);
765
+ let Ae = he(O ?? ""), Fe = ge(O ?? ""), Ie = be(O ?? ""), Le = Object.keys(D?.status_groups ?? {}).length > 0, Re = Ce?.data, ze = Re?.$statuses, Be = Re?.$properties, Ue = c.get("edit") === "true", [Ke, Je] = B(P || Ue), [I, Qe] = B({}), [V, it] = B({}), [W, at] = B({}), [G, K] = B(void 0), [st, ct] = B(!1), [ut, q] = B(void 0), [mt, gt] = B(!1), bt = P ? k : A, J = Ke && bt, Ct = u();
766
+ d(J && !P, Ct.enabled);
767
+ let [Tt, Et] = B(() => {
768
+ let e = parseInt(w?.sidebar_width || "380", 10);
769
+ return isNaN(e) ? 380 : e;
770
+ }), Ot = Ze(null), Y = Ze(null), kt = L((e) => {
771
+ e.preventDefault();
772
+ let t = Ot.current;
773
+ if (!t) return;
774
+ let n = t.offsetWidth;
775
+ Y.current = {
776
+ startX: e.clientX,
777
+ startW: n
778
+ };
779
+ let r = (e) => {
780
+ if (!Y.current) return;
781
+ let n = Y.current.startX - e.clientX, r = Math.max(280, Math.min(800, Y.current.startW + n));
782
+ t.style.width = `${r}px`;
783
+ }, i = () => {
784
+ Y.current && t && Et(parseInt(t.style.width, 10) || Y.current.startW), Y.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
785
+ };
786
+ document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
787
+ }, []), X = Ce?.data, Z = Oe(D, w, X ?? {});
788
+ R(() => {
789
+ let e = parseInt(Z?.sidebar_width || "380", 10);
790
+ Et(Number.isNaN(e) ? 380 : e);
791
+ }, [Z?.sidebar_width]);
792
+ let Q = typeof X?.$row_version == "string" ? X.$row_version : void 0, At = X?.$refs, jt = Ze(Q);
793
+ R(() => {
794
+ if (!Q) return;
795
+ let e = jt.current;
796
+ jt.current = Q, e && e !== Q && Ke && ct(!0);
797
+ }, [Ke, Q]);
798
+ let Mt = !!D?.soft_delete && X != null && X[D.soft_delete] != null, Nt = et(), Pt = Ze(null);
799
+ Pe({ scrollElementRef: Pt });
800
+ let Ft = !P && Ee instanceof x && Ee.status === 404, It = P && !te(D), Lt = Ze(null);
801
+ R(() => {
802
+ if (!Ft) return;
803
+ let e = ve(Nt);
804
+ Lt.current !== e && (Lt.current = e, de.getState().kill(e));
805
+ }, [Ft, Nt]);
806
+ let { openTab: Rt, updateTabTitle: zt, findTabByPathname: Bt } = ae();
807
+ R(() => {
808
+ if (!D || M || Ct.enabled) return;
809
+ let e = Nt.pathname, n = t(Z?.display?.name) || t(D.display.name), r = Z?.display?.icon || D.display.icon;
810
+ Rt({
811
+ pathname: e,
812
+ search: "",
813
+ title: P ? t("record.new_title", "New {name}", { name: n }) : n,
814
+ derivedTitle: !P,
815
+ icon: r,
816
+ closable: !0
817
+ });
818
+ }, [
819
+ Nt.pathname,
820
+ t,
821
+ Z?.display?.icon,
822
+ D?.display.icon,
823
+ P,
824
+ M,
825
+ Ct.enabled
826
+ ]), R(() => {
827
+ if (!X || !D || M || Ct.enabled) return;
828
+ let e = Bt(Nt.pathname);
829
+ if (e) {
830
+ let n = t(Z?.display?.name) || t(D.display.name), r = S(t, X, D), i = r && !String(r).startsWith("/") ? String(r) : n;
831
+ zt(e.id, i, i === n);
832
+ }
833
+ }, [
834
+ X,
835
+ t,
836
+ D?.display.display_field,
837
+ Nt.pathname,
838
+ M,
839
+ Ct.enabled
840
+ ]);
841
+ let Vt = z(() => {
842
+ if (!D || !bt) return /* @__PURE__ */ new Set();
843
+ let e = /* @__PURE__ */ new Set();
844
+ for (let [t, n] of D.fields) !n.auto && !n.primary && e.add(t);
845
+ for (let [t] of D.files ?? []) e.add(t);
846
+ return e;
847
+ }, [D, bt]);
848
+ R(() => {
849
+ if (Ue && X && D && A) {
850
+ if (Ke || Je(!0), Object.keys(I).length === 0) {
851
+ let e = N ? He(N) : null;
852
+ if (e) {
853
+ let t = Ne({
854
+ entity: D,
855
+ formData: e,
856
+ record: void 0,
857
+ isNew: !0
858
+ });
859
+ Me(t).forEach((e) => {
860
+ b.registerDraft({
861
+ fileId: e,
862
+ discard: () => le(e)
863
+ });
864
+ });
865
+ }
866
+ let t = {};
867
+ Vt.forEach((n) => {
868
+ let r = e ? e[n] : void 0;
869
+ if (r !== void 0) {
870
+ t[n] = r;
871
+ return;
872
+ }
873
+ let i = we(D, X, n);
874
+ t[n] = je(D, n) ? i ?? null : i ?? "";
875
+ }), Qe(t);
876
+ }
877
+ if (D.children !== void 0 && D.children.length > 0 && G === void 0) {
878
+ let e = X.$children;
879
+ if (e && Object.keys(e).length > 0) {
880
+ let t = {};
881
+ for (let [n, r] of Object.entries(e)) {
882
+ let e = h?.entities[n];
883
+ t[n] = r.map((t) => ({
884
+ ...t,
885
+ _key: St(e, t)
886
+ }));
887
+ }
888
+ K(t), q(e);
889
+ } else K({}), q({});
890
+ }
891
+ p((e) => {
892
+ let t = new URLSearchParams(e);
893
+ return t.delete("edit"), t;
894
+ }, { replace: !0 });
895
+ }
896
+ }, [
897
+ Ue,
898
+ X,
899
+ Vt,
900
+ A,
901
+ D,
902
+ G,
903
+ h
904
+ ]), R(() => {
905
+ P && k && D?.children && D.children.length !== 0 && G === void 0 && (K({}), q({}));
906
+ }, [
907
+ P,
908
+ k,
909
+ D?.children
910
+ ]);
911
+ let Ht = L(async () => {
912
+ if (await b.flushAllDrafts(), P) {
913
+ let e = Z?.route?.replace("/:id", "") ?? "/";
914
+ s(e);
915
+ } else Je(!1), Qe({}), it({}), at({}), K(void 0), q(void 0), gt(!1);
916
+ }, [
917
+ b,
918
+ P,
919
+ Z,
920
+ s
921
+ ]), Ut = L((e, t) => {
922
+ Qe((n) => ({
923
+ ...n,
924
+ [e]: t
925
+ }));
926
+ }, []), $ = z(() => {
927
+ if (!Z?.route) return "/";
928
+ let e = Z.route.split("/");
929
+ return e.pop(), e.join("/") || "/";
930
+ }, [Z]), Wt = z(() => !h?.screens || !$ || $ === "/" ? !1 : Object.values(h.screens).some((e) => e.route === $), [h, $]), Gt = L(() => {
931
+ if (!Wt) {
932
+ s("/");
933
+ return;
934
+ }
935
+ let e = Bt($)?.search ?? "";
936
+ s(e ? `${$}?${e}` : $);
937
+ }, [
938
+ Wt,
939
+ $,
940
+ Bt,
941
+ s
942
+ ]), Kt = ue({ fallback: Gt }), qt = !M && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Wt), Jt = z(() => {
943
+ if (!D) return {};
944
+ let e = {};
945
+ for (let n of pt(D, I, P)) Vt.has(n) && (e[n] = t("record.field.required", "Required"));
946
+ for (let t of ht(D, I)) Vt.has(t) && (e[t] = n("record.email_invalid", "This is not a valid email address."));
947
+ return e;
948
+ }, [
949
+ t,
950
+ n,
951
+ D,
952
+ I,
953
+ P,
954
+ Vt
955
+ ]), Yt = Object.keys(Jt).length > 0, Xt = z(() => D ? xt({
956
+ entity: D,
957
+ formData: I,
958
+ record: X,
959
+ isNew: P,
960
+ pendingStatuses: V,
961
+ pendingProperties: W,
962
+ pendingChildren: G,
963
+ childrenSnapshot: ut
964
+ }) : {
965
+ payload: {},
966
+ committedFileIds: []
967
+ }, [
968
+ D,
969
+ I,
970
+ X,
971
+ P,
972
+ V,
973
+ W,
974
+ G,
975
+ ut
976
+ ]), Zt = Object.keys(Xt.payload).length > 0, Qt = J && (P || Zt);
977
+ ce(Qt);
978
+ let $t = L(() => {
979
+ if (!O || !D || P && !k || !P && !A || (gt(!0), Yt)) return;
980
+ let e = { ...Xt.payload }, { committedFileIds: t } = Xt;
981
+ if (!P && !Zt) {
982
+ Je(!1), it({}), at({}), K(void 0), q(void 0), gt(!1);
983
+ return;
984
+ }
985
+ !P && Q && (e.$row_version = Q);
986
+ let n = () => {
987
+ Je(!1), ct(!1), gt(!1), it({}), at({}), K(void 0), q(void 0);
988
+ };
989
+ P ? Ae.mutate(e, { onSuccess: (e) => {
990
+ t.forEach((e) => b.markCommitted(e));
991
+ let r = e.data, i = D ? f(D, r) : {}, a = v(i);
992
+ s(a ? `${$}/${encodeURIComponent(a)}` : $, { replace: !0 }), n();
993
+ } }) : F && Fe.mutate({
994
+ pkValues: F,
995
+ data: e
996
+ }, {
997
+ onSuccess: () => {
998
+ t.forEach((e) => b.markCommitted(e)), n();
999
+ },
1000
+ onError: (e) => {
1001
+ e instanceof x && e.code === "entity.stale_object" && ct(!0);
1002
+ }
1003
+ });
1004
+ }, [
1005
+ b,
1006
+ P,
1007
+ k,
1008
+ A,
1009
+ O,
1010
+ Yt,
1011
+ Xt,
1012
+ Zt,
1013
+ Ae,
1014
+ Fe,
1015
+ D,
1016
+ s,
1017
+ $,
1018
+ Q,
1019
+ F
1020
+ ]), en = L((e, t) => {
1021
+ K((n) => ({
1022
+ ...n ?? {},
1023
+ [e]: t
1024
+ }));
1025
+ }, []), tn = L(() => {
1026
+ F && !P && oe && Ie.mutate(F);
1027
+ }, [
1028
+ F,
1029
+ P,
1030
+ oe,
1031
+ Ie
1032
+ ]), nn = z(() => _t(G, h), [G, h]), rn = Object.keys(nn).length > 0;
1033
+ if (!Z || !D) return null;
1034
+ if (!P && Te) return /* @__PURE__ */ H(ye, {});
1035
+ if (It) return /* @__PURE__ */ U("div", {
1036
+ style: { padding: 24 },
1037
+ children: [/* @__PURE__ */ U("div", {
1038
+ style: {
1039
+ display: "flex",
1040
+ alignItems: "center",
1041
+ gap: 8,
1042
+ marginBottom: 8
1043
+ },
1044
+ children: [qt && /* @__PURE__ */ H(ie, {
1045
+ icon: /* @__PURE__ */ H(E.back, { size: 14 }),
1046
+ onClick: Kt.goBack,
1047
+ title: t("record.back", "Back")
1048
+ }), /* @__PURE__ */ H("h1", {
1049
+ style: {
1050
+ margin: 0,
1051
+ fontSize: 18,
1052
+ fontWeight: 600,
1053
+ color: "var(--text)"
1054
+ },
1055
+ children: t("record.create_closed.title", "Not Available")
1056
+ })]
1057
+ }), /* @__PURE__ */ H("p", {
1058
+ style: { color: "var(--text-3)" },
1059
+ children: t("record.create_closed.body", "This record type is not created from a form.")
1060
+ })]
1061
+ });
1062
+ if (!P && !X || Ft) return /* @__PURE__ */ U("div", {
1063
+ style: { padding: 24 },
1064
+ children: [/* @__PURE__ */ U("div", {
1065
+ style: {
1066
+ display: "flex",
1067
+ alignItems: "center",
1068
+ gap: 8,
1069
+ marginBottom: 8
1070
+ },
1071
+ children: [qt && /* @__PURE__ */ H(ie, {
1072
+ icon: /* @__PURE__ */ H(E.back, { size: 14 }),
1073
+ onClick: Kt.goBack,
1074
+ title: t("record.back", "Back")
1075
+ }), /* @__PURE__ */ H("h1", {
1076
+ style: {
1077
+ margin: 0,
1078
+ fontSize: 18,
1079
+ fontWeight: 600,
1080
+ color: "var(--text)"
1081
+ },
1082
+ children: t("record.missing.title", "Not Found")
1083
+ })]
1084
+ }), /* @__PURE__ */ H("p", {
1085
+ style: { color: "var(--text-3)" },
1086
+ children: n("entity.not_found", "This record does not exist.")
1087
+ })]
1088
+ });
1089
+ let an = D.display, on = t(Z.display?.name) || t(an.name), sn = S(t, X, D), cn = P ? t("record.new_title", "New {name}", { name: on }) : sn ? String(sn) : on, ln = Ae.isPending || Fe.isPending, un = Z.responsive?.[C.category]?.layout, dn = un?.tabs ?? (C.isPhone ? "sections" : void 0), fn = un?.header_card === !0 ? Xe({
1090
+ entity: D,
1091
+ screen: Z
1092
+ }) : void 0, pn = {
1093
+ schema: h,
1094
+ entity: D,
1095
+ entityCode: O,
1096
+ recordId: fe ?? N ?? "",
1097
+ record: J ? {
1098
+ ...X ?? {},
1099
+ ...I
1100
+ } : X ?? {},
1101
+ isNew: P,
1102
+ mode: J ? "edit" : "display",
1103
+ onFieldChange: J ? Ut : void 0,
1104
+ refs: At,
1105
+ objectProperties: (() => {
1106
+ let e = Be ?? [];
1107
+ if (!J || Object.keys(W).length === 0) return e.length > 0 ? e : void 0;
1108
+ let t = e.map((e) => W[e.property_code] === void 0 ? e : {
1109
+ ...e,
1110
+ value: W[e.property_code]
1111
+ });
1112
+ for (let [n, r] of Object.entries(W)) e.some((e) => e.property_code === n) || t.push({
1113
+ property_code: n,
1114
+ name: {},
1115
+ type: "string",
1116
+ value: r
1117
+ });
1118
+ return t;
1119
+ })(),
1120
+ onSetProperty: P || !A ? void 0 : J ? (e, t) => at((n) => ({
1121
+ ...n,
1122
+ [e]: t
1123
+ })) : void 0,
1124
+ isPropertyPending: !1,
1125
+ objectStatuses: (() => {
1126
+ let e = ze ?? [];
1127
+ if (!J || Object.keys(V).length === 0) return e.length > 0 ? e : void 0;
1128
+ let t = e.map((e) => V[e.group_code] === void 0 ? e : {
1129
+ ...e,
1130
+ status_code: V[e.group_code]
1131
+ });
1132
+ for (let [n, i] of Object.entries(V)) e.some((e) => e.group_code === n) || t.push({
1133
+ group_code: n,
1134
+ status_code: i,
1135
+ status_name: {},
1136
+ set_at: r()
1137
+ });
1138
+ return t;
1139
+ })(),
1140
+ onSetStatus: P || !A ? void 0 : J ? (e, t) => it((n) => ({
1141
+ ...n,
1142
+ [e]: t
1143
+ })) : void 0,
1144
+ isStatusPending: !1,
1145
+ pendingChildren: J ? G : void 0,
1146
+ onChildrenChange: J ? en : void 0,
1147
+ childValidationErrors: J ? nn : void 0,
1148
+ fieldErrors: J && mt ? Jt : void 0,
1149
+ detailTabsPresentation: dn,
1150
+ relatedRecordsPresentation: un?.related_records
1151
+ }, mn = !!Z.sidebar && Z.sidebar.length > 0, hn = un?.sidebar === "hidden", gn = mn && !hn && !C.isDesktop, _n = mn && !hn && C.isDesktop, vn = !P && X ? /* @__PURE__ */ H(dt, {
1152
+ screen: Z,
1153
+ entity: D,
1154
+ entityCode: O,
1155
+ record: X,
1156
+ refs: At,
1157
+ objectStatuses: ze,
1158
+ schema: h
1159
+ }) : void 0, yn = /* @__PURE__ */ H(Dt, {
1160
+ title: cn,
1161
+ recordId: N,
1162
+ editing: J,
1163
+ isNew: P,
1164
+ isRecordDeleted: Mt,
1165
+ dirty: Qt,
1166
+ isSaving: ln,
1167
+ hasChildErrors: rn,
1168
+ hasFieldErrors: mt && Yt,
1169
+ canRestore: oe,
1170
+ entity: D,
1171
+ screen: Z,
1172
+ globalActions: h?.actions,
1173
+ entityCode: O,
1174
+ record: X,
1175
+ id: N,
1176
+ listRoute: $,
1177
+ listRouteExists: !!Wt,
1178
+ highlights: vn,
1179
+ showBack: qt,
1180
+ onBack: Kt.goBack,
1181
+ onCancelEdit: Ht,
1182
+ onSave: $t,
1183
+ onRestore: tn,
1184
+ isRestoring: Ie.isPending,
1185
+ refreshControl: {
1186
+ refetch: pe.refetch,
1187
+ isLoading: pe.isLoading,
1188
+ isLive: ke
1189
+ },
1190
+ isRealtimeEntity: D?.realtime === !0,
1191
+ canManageTemplates: Ve(h)
1192
+ }), bn = Mt && /* @__PURE__ */ U("div", {
1193
+ style: {
1194
+ display: "flex",
1195
+ alignItems: "center",
1196
+ gap: 8,
1197
+ padding: "10px 14px",
1198
+ marginBottom: 12,
1199
+ borderRadius: 8,
1200
+ border: "1px solid var(--danger)",
1201
+ background: "var(--danger-soft)",
1202
+ color: "var(--danger)",
1203
+ fontSize: 12.5
1204
+ },
1205
+ children: [/* @__PURE__ */ H(E.warning, { size: 14 }), /* @__PURE__ */ H("span", { children: t("record.deleted_banner", "This record was deleted on {date}", { date: ne(String(X[D.soft_delete])) }) })]
1206
+ }), xn = st && /* @__PURE__ */ U("div", {
1207
+ style: {
1208
+ display: "flex",
1209
+ alignItems: "center",
1210
+ gap: 8,
1211
+ padding: "10px 14px",
1212
+ marginBottom: 12,
1213
+ borderRadius: 8,
1214
+ border: "1px solid var(--warn)",
1215
+ background: "var(--warn-soft)",
1216
+ color: "var(--warn)",
1217
+ fontSize: 12.5
1218
+ },
1219
+ children: [/* @__PURE__ */ H(E.warning, { size: 14 }), /* @__PURE__ */ H("span", { children: t("record.changed_on_server", "This record changed on the server while you were viewing or editing it.") })]
1220
+ }), Sn = J && mt && Yt && /* @__PURE__ */ H(lt, {
1221
+ errors: Object.entries(Jt).map(([e, n]) => {
1222
+ let r = D.fields.get(e);
1223
+ return {
1224
+ name: e,
1225
+ label: r ? ee(t, r, e, h?.entities) : e,
1226
+ message: n
1227
+ };
1228
+ }),
1229
+ onJump: (e) => {
1230
+ let t = document.getElementById(`${O}-${e}`);
1231
+ t && (t.scrollIntoView({
1232
+ block: "center",
1233
+ behavior: "smooth"
1234
+ }), t.focus?.());
1235
+ }
1236
+ }), Cn = Le && !P && !(Z.items && Z.items.length > 0) && /* @__PURE__ */ H("div", {
1237
+ className: "mb-4",
1238
+ children: /* @__PURE__ */ H(We, {
1239
+ statusGroups: D.status_groups ?? {},
1240
+ objectStatuses: pn.objectStatuses,
1241
+ onSetStatus: A && J ? (e, t) => it((n) => ({
1242
+ ...n,
1243
+ [e]: t
1244
+ })) : vt,
1245
+ isPending: !1,
1246
+ mode: J ? "edit" : "display"
1247
+ })
1248
+ }), wn = D.evidence_covered && !P && X && /* @__PURE__ */ H("div", {
1249
+ className: "mb-4",
1250
+ children: /* @__PURE__ */ H(ft, { evidence: X.$evidence })
1251
+ }), Tn = /* @__PURE__ */ U($e, { children: [
1252
+ fn && (X || P) && /* @__PURE__ */ H(wt, {
1253
+ card: fn,
1254
+ entity: D,
1255
+ record: pn.record,
1256
+ objectStatuses: pn.objectStatuses,
1257
+ objectProperties: pn.objectProperties
1258
+ }),
1259
+ Z.items && Z.items.length > 0 && (X || P) && h && /* @__PURE__ */ H(Ge, {
1260
+ nodes: Z.items,
1261
+ ctx: pn
1262
+ }),
1263
+ !P && N && O && D.associations && Object.keys(D.associations).length > 0 && h && /* @__PURE__ */ H(rt, {
1264
+ entityCode: O,
1265
+ recordId: fe ?? N ?? "",
1266
+ associations: D.associations,
1267
+ schema: h
1268
+ }),
1269
+ !P && N && O && /* @__PURE__ */ H(ot, {
1270
+ entityCode: O,
1271
+ objectId: fe ?? N,
1272
+ canGenerateOne: !!D?.documents?.generate_one,
1273
+ canManageTemplates: Ve(h)
1274
+ }),
1275
+ !P && X && h && /* @__PURE__ */ H(qe, {
1276
+ screen: Z,
1277
+ entity: D,
1278
+ entityCode: O,
1279
+ record: X,
1280
+ refs: At,
1281
+ schema: h
1282
+ })
1283
+ ] }), En = /* @__PURE__ */ U($e, { children: [
1284
+ yn,
1285
+ xn,
1286
+ bn,
1287
+ Sn,
1288
+ Cn,
1289
+ wn
1290
+ ] });
1291
+ return _n ? /* @__PURE__ */ U("div", {
1292
+ style: {
1293
+ height: "100%",
1294
+ display: "flex",
1295
+ overflow: "hidden",
1296
+ background: "var(--background)"
1297
+ },
1298
+ children: [
1299
+ /* @__PURE__ */ H("div", {
1300
+ style: {
1301
+ flex: 1,
1302
+ minWidth: 0,
1303
+ height: "100%"
1304
+ },
1305
+ children: /* @__PURE__ */ H(Ye, {
1306
+ scrollRef: Pt,
1307
+ header: En,
1308
+ children: Tn
1309
+ })
1310
+ }),
1311
+ /* @__PURE__ */ H("div", {
1312
+ className: "detail-resize-handle",
1313
+ onMouseDown: kt,
1314
+ title: t("record.layout.drag_to_resize", "Drag to resize"),
1315
+ children: /* @__PURE__ */ H("div", { style: {
1316
+ position: "absolute",
1317
+ top: 0,
1318
+ bottom: 0,
1319
+ left: "50%",
1320
+ transform: "translateX(-50%)",
1321
+ width: 1,
1322
+ background: "var(--border)"
1323
+ } })
1324
+ }),
1325
+ /* @__PURE__ */ H("div", {
1326
+ ref: Ot,
1327
+ style: {
1328
+ flexShrink: 0,
1329
+ height: "100%",
1330
+ width: `${Tt}px`
1331
+ },
1332
+ children: (X || P) && h && /* @__PURE__ */ H(Ge, {
1333
+ nodes: Z.sidebar,
1334
+ ctx: pn
1335
+ })
1336
+ })
1337
+ ]
1338
+ }) : /* @__PURE__ */ U(Ye, {
1339
+ scrollRef: Pt,
1340
+ header: En,
1341
+ children: [Tn, gn && (X || P) && h && /* @__PURE__ */ H("div", {
1342
+ "data-testid": "detail-sidebar-inline",
1343
+ style: {
1344
+ display: "flex",
1345
+ flexDirection: "column",
1346
+ gap: 16,
1347
+ minWidth: 0
1348
+ },
1349
+ children: /* @__PURE__ */ H(Ge, {
1350
+ nodes: Z.sidebar,
1351
+ ctx: pn
1352
+ })
1353
+ })]
1354
+ });
1355
+ }
1356
+ function wt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1357
+ let a = T(), o = (e) => {
1358
+ let o = Tt(a, t, e, n, r, i);
1359
+ return o != null && w(o) !== "";
1360
+ }, s = (e) => {
1361
+ let o = Tt(a, t, e, n, r, i);
1362
+ return w(o) || /* @__PURE__ */ H("span", {
1363
+ style: { color: "var(--text-3)" },
1364
+ children: "-"
1365
+ });
1366
+ }, c = e.titleUsesDisplay ? S(a, n, t) : e.titleField ? Tt(a, t, e.titleField, n, r, i) : void 0, l = w(c) || a(t.display?.name) || a("record.fallback_title", "Record"), u = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), d = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), f = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
1367
+ return /* @__PURE__ */ U("section", {
1368
+ "data-testid": "detail-header-card",
1369
+ style: {
1370
+ width: "100%",
1371
+ minWidth: 0,
1372
+ border: "1px solid var(--border)",
1373
+ borderRadius: 8,
1374
+ background: "var(--surface)",
1375
+ boxShadow: "var(--shadow-xs)",
1376
+ padding: 14,
1377
+ boxSizing: "border-box"
1378
+ },
1379
+ children: [
1380
+ /* @__PURE__ */ U("div", {
1381
+ style: { minWidth: 0 },
1382
+ children: [/* @__PURE__ */ H("div", {
1383
+ style: {
1384
+ fontSize: 15,
1385
+ lineHeight: 1.25,
1386
+ fontWeight: 700,
1387
+ color: "var(--text)",
1388
+ overflowWrap: "anywhere"
1389
+ },
1390
+ children: l
1391
+ }), e.subtitleField && /* @__PURE__ */ H("div", {
1392
+ style: {
1393
+ marginTop: 4,
1394
+ fontSize: 12.5,
1395
+ lineHeight: 1.35,
1396
+ color: "var(--text-3)",
1397
+ overflowWrap: "anywhere"
1398
+ },
1399
+ children: s(e.subtitleField)
1400
+ })]
1401
+ }),
1402
+ u.length > 0 && /* @__PURE__ */ H("div", {
1403
+ style: {
1404
+ display: "flex",
1405
+ flexWrap: "wrap",
1406
+ gap: 6,
1407
+ marginTop: 10
1408
+ },
1409
+ children: u.map((e) => /* @__PURE__ */ H("span", {
1410
+ style: {
1411
+ minWidth: 0,
1412
+ maxWidth: "100%",
1413
+ borderRadius: 999,
1414
+ background: "var(--surface-2)",
1415
+ color: "var(--text-2)",
1416
+ padding: "2px 8px",
1417
+ fontSize: 12,
1418
+ lineHeight: 1.4,
1419
+ overflowWrap: "anywhere"
1420
+ },
1421
+ children: s(e)
1422
+ }, e))
1423
+ }),
1424
+ d.length > 0 && /* @__PURE__ */ H("dl", {
1425
+ style: {
1426
+ display: "grid",
1427
+ gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
1428
+ gap: "6px 10px",
1429
+ margin: "12px 0 0",
1430
+ fontSize: 12.5,
1431
+ lineHeight: 1.35
1432
+ },
1433
+ children: d.map((e) => /* @__PURE__ */ U("div", {
1434
+ style: { display: "contents" },
1435
+ children: [/* @__PURE__ */ H("dt", {
1436
+ style: { color: "var(--text-3)" },
1437
+ children: Et(a, t, e)
1438
+ }), /* @__PURE__ */ H("dd", {
1439
+ style: {
1440
+ margin: 0,
1441
+ color: "var(--text-2)",
1442
+ minWidth: 0,
1443
+ overflowWrap: "anywhere"
1444
+ },
1445
+ children: s(e)
1446
+ })]
1447
+ }, e))
1448
+ }),
1449
+ f.length > 0 && /* @__PURE__ */ H("div", {
1450
+ style: {
1451
+ display: "flex",
1452
+ flexWrap: "wrap",
1453
+ gap: 10,
1454
+ marginTop: 10,
1455
+ color: "var(--text-3)",
1456
+ fontSize: 11.5
1457
+ },
1458
+ children: f.map((e) => /* @__PURE__ */ U("span", {
1459
+ style: {
1460
+ minWidth: 0,
1461
+ overflowWrap: "anywhere"
1462
+ },
1463
+ children: [
1464
+ Et(a, t, e),
1465
+ ": ",
1466
+ s(e)
1467
+ ]
1468
+ }, e))
1469
+ })
1470
+ ]
1471
+ });
1472
+ }
1473
+ function Tt(e, t, n, r, i, a) {
1474
+ if (n.startsWith("$status.")) {
1475
+ let t = n.slice(8), r = i?.find((e) => e.group_code === t);
1476
+ return e(r?.status_name) || r?.status_code;
1477
+ }
1478
+ if (n.startsWith("$property.")) {
1479
+ let e = n.slice(10);
1480
+ return a?.find((t) => t.property_code === e)?.value;
1481
+ }
1482
+ return we(t, r, n);
1483
+ }
1484
+ function Et(e, t, n) {
1485
+ if (n.startsWith("$status.")) return n.slice(8);
1486
+ if (n.startsWith("$property.")) return n.slice(10);
1487
+ let r = t.fields.get(n);
1488
+ return r ? ee(e, r, n) : n;
1489
+ }
1490
+ function Dt({ title: e, recordId: r, editing: i, isNew: a, isRecordDeleted: o, dirty: s, isSaving: c, hasChildErrors: u, hasFieldErrors: d, canRestore: f, entity: m, screen: h, globalActions: g, entityCode: _, record: v, id: y, listRoute: ee, listRouteExists: b, highlights: x, showBack: te, onBack: S, onCancelEdit: w, onSave: ne, onRestore: re, isRestoring: ie, refreshControl: O, isRealtimeEntity: k, canManageTemplates: ae }) {
1491
+ let j = T(), oe = T("errors"), { run: se } = pe(), ce = M("detail"), le = F(), N = l(), ue = n(h?.action_layout, m?.action_layout, m?.actions, g, "detail_toolbar"), fe = n(h?.action_layout, m?.action_layout, m?.actions, g, "detail"), me = t(j, fe, m?.actions, g, v ?? {}, [], Ce(m, v ?? {})), he = t(j, ue, m?.actions, g, v ?? {}, [], Ce(m, v ?? {})), ge = z(() => {
1492
+ if (!m) return;
1493
+ let e = y ? [y] : [];
1494
+ return {
1495
+ entity: m,
1496
+ entityCode: _ ?? "",
1497
+ screen: h,
1498
+ screenRoute: h?.route ?? "",
1499
+ selectedRows: v ? [v] : [],
1500
+ selectedIds: e,
1501
+ t: j,
1502
+ tabNavigate: (e, t) => le(e, {
1503
+ title: t?.title,
1504
+ icon: t?.icon,
1505
+ search: t?.search
1506
+ }),
1507
+ runActionApi: (e, t) => C(e, t),
1508
+ recordHref: (e) => e === y && h?.route ? h.route.replace(":id", encodeURIComponent(e)) : null
1509
+ };
1510
+ }, [
1511
+ m,
1512
+ _,
1513
+ h,
1514
+ y,
1515
+ v,
1516
+ j,
1517
+ le
1518
+ ]), _e = (e, t) => {
1519
+ let n = Ee(oe, e, t, { row: v ?? void 0 });
1520
+ if (n === null) return;
1521
+ let r = y ? [y] : [], i = e === "__delete" && b ? ee : null;
1522
+ return se({
1523
+ action: t,
1524
+ title: j(t.display?.name) || e,
1525
+ row: v ?? void 0,
1526
+ execute: (e) => C(n, p(e, r)),
1527
+ onSuccess: i ? () => {
1528
+ de.getState().kill(ve(location)), N(i, { replace: !0 });
1529
+ } : void 0
1530
+ });
1531
+ }, ye = ce.isVisible("show_actions") && !a && y && me.length > 0 ? /* @__PURE__ */ H(Ae, {
1532
+ layout: me,
1533
+ row: v,
1534
+ onRun: _e,
1535
+ kind: "detail",
1536
+ entityActions: m?.actions,
1537
+ globalActions: g,
1538
+ reservedRightWidth: 0,
1539
+ widgetContext: ge
1540
+ }) : null, be = !a && y ? /* @__PURE__ */ H(Fe, {
1541
+ liveObject: O,
1542
+ realtime: k
1543
+ }) : null, xe = ce.isVisible("show_actions") && !a && y && he.length > 0 ? /* @__PURE__ */ U("div", {
1544
+ style: {
1545
+ display: "flex",
1546
+ justifyContent: "flex-end",
1547
+ alignItems: "center",
1548
+ gap: 8,
1549
+ marginTop: 10
1550
+ },
1551
+ children: [ye ? null : be, /* @__PURE__ */ H(Ae, {
1552
+ layout: he,
1553
+ row: v,
1554
+ onRun: _e,
1555
+ kind: "detail",
1556
+ entityActions: m?.actions,
1557
+ globalActions: g,
1558
+ reservedRightWidth: 0,
1559
+ widgetContext: ge,
1560
+ ariaLabel: ye ? j("record.toolbar_actions", "Detail toolbar actions") : j("record.page_actions", "Page actions")
1561
+ })]
1562
+ }) : null, Se = ce.isVisible("show_actions") && !a && y && _ ? /* @__PURE__ */ H(Ue, {
1563
+ entityCode: _,
1564
+ scope: "detail",
1565
+ objectIds: [y],
1566
+ capability: m?.documents,
1567
+ canManageTemplates: ae
1568
+ }) : null, we = o ? f ? /* @__PURE__ */ H(D, {
1569
+ kind: "primary",
1570
+ icon: H(ie ? A : E.refresh, { size: 13 }),
1571
+ onClick: re,
1572
+ disabled: ie,
1573
+ children: ie ? j("record.restoring", "Restoring…") : j("record.restore", "Restore")
1574
+ }) : null : i ? /* @__PURE__ */ U($e, { children: [/* @__PURE__ */ H(D, {
1575
+ icon: /* @__PURE__ */ H(E.x, { size: 13 }),
1576
+ onClick: w,
1577
+ disabled: c,
1578
+ children: j("dialog.cancel", "Cancel")
1579
+ }), /* @__PURE__ */ H(D, {
1580
+ kind: "primary",
1581
+ icon: H(c ? A : E.save, { size: 13 }),
1582
+ onClick: ne,
1583
+ disabled: c || u || d,
1584
+ title: u ? j("record.save.fix_child_rows", "Fix errors in child rows") : d ? j("record.save.fix_fields", "Fix the highlighted fields") : void 0,
1585
+ children: c ? j("dialog.saving", "Saving…") : j("dialog.save", "Save")
1586
+ })] }) : !a && y ? ye ? /* @__PURE__ */ U("span", {
1587
+ style: { display: "contents" },
1588
+ children: [Se, ye]
1589
+ }) : Se : null;
1590
+ return /* @__PURE__ */ U($e, { children: [/* @__PURE__ */ H(Je, {
1591
+ icon: m?.display.icon ? /* @__PURE__ */ H(P, {
1592
+ name: m.display.icon,
1593
+ size: 16
1594
+ }) : void 0,
1595
+ title: e,
1596
+ description: j(h?.display?.description) || j(m?.display?.description),
1597
+ recordId: r,
1598
+ highlights: x,
1599
+ identityControls: !o && !i && !a ? be : null,
1600
+ mode: a ? "create" : i ? "edit" : "display",
1601
+ dirty: s,
1602
+ showBack: te,
1603
+ onBack: S,
1604
+ right: we,
1605
+ showTitle: ce.isVisible("show_title")
1606
+ }), xe] });
1607
+ }
1608
+ //#endregion
1609
+ export { J as SmartDetailPage };