@conduction/nextcloud-vue 2.165.0 → 2.166.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 (161) hide show
  1. package/dist/esm/components/CnActionButtons/CnActionButtons.vue.js +1 -1
  2. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js +7 -0
  3. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
  5. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
  6. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +10 -0
  7. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
  8. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js +1 -1
  9. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
  10. package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js +1 -1
  11. package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js.map +1 -1
  12. package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js.map +1 -1
  13. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  14. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +50 -7
  15. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  16. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  17. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +13 -0
  18. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  19. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +1 -0
  20. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  21. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +39 -4
  22. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  23. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +2 -1
  24. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  25. package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue.js +1 -1
  26. package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue2.js.map +1 -1
  27. package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue3.js.map +1 -1
  28. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js +9 -0
  29. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js.map +1 -0
  30. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js +232 -0
  31. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js.map +1 -0
  32. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js +61 -0
  33. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js.map +1 -0
  34. package/dist/esm/components/CnFieldGroupsWidget/index.js +28 -0
  35. package/dist/esm/components/CnFieldGroupsWidget/index.js.map +1 -0
  36. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
  37. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +80 -6
  38. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
  39. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +361 -289
  40. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
  41. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
  42. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +9 -0
  43. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
  44. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +2 -1
  45. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
  46. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue.js +1 -1
  47. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js +21 -0
  48. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js.map +1 -1
  49. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js +12 -2
  50. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js.map +1 -1
  51. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  52. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +17 -0
  53. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  54. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +6 -3
  55. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  56. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js +33 -2
  57. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js.map +1 -1
  58. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js +2 -2
  59. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js.map +1 -1
  60. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +83 -8
  61. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  62. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +2 -1
  63. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  64. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js +9 -0
  65. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js.map +1 -0
  66. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js +187 -0
  67. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js.map +1 -0
  68. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js +106 -0
  69. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js.map +1 -0
  70. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js +9 -0
  71. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js.map +1 -0
  72. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js +421 -0
  73. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js.map +1 -0
  74. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js +131 -0
  75. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js.map +1 -0
  76. package/dist/esm/components/CnObjectLinksWidget/index.js +29 -0
  77. package/dist/esm/components/CnObjectLinksWidget/index.js.map +1 -0
  78. package/dist/esm/components/CnObjectLinksWidget/objectLinks.js +22 -0
  79. package/dist/esm/components/CnObjectLinksWidget/objectLinks.js.map +1 -0
  80. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
  81. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +48 -13
  82. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
  83. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +44 -20
  84. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
  85. package/dist/esm/components/CnPagination/CnPagination.vue2.js +26 -0
  86. package/dist/esm/components/CnPagination/CnPagination.vue2.js.map +1 -1
  87. package/dist/esm/components/CnPagination/CnPagination.vue3.js +40 -37
  88. package/dist/esm/components/CnPagination/CnPagination.vue3.js.map +1 -1
  89. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
  90. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  91. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue.js +1 -1
  92. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +4 -0
  93. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
  94. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
  95. package/dist/esm/index.js +2 -0
  96. package/dist/esm/index.js.map +1 -1
  97. package/dist/esm/l10n/en.json.js +18 -1
  98. package/dist/esm/l10n/en.json.js.map +1 -1
  99. package/dist/esm/l10n/nl.json.js +18 -1
  100. package/dist/esm/l10n/nl.json.js.map +1 -1
  101. package/dist/esm/library-style.js +1 -1
  102. package/dist/esm/nextcloud-vue.css +635 -329
  103. package/dist/esm/utils/actionsDispatcher.js +9 -5
  104. package/dist/esm/utils/actionsDispatcher.js.map +1 -1
  105. package/dist/esm/utils/libraryWidgetKeys.js +2 -0
  106. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  107. package/dist/esm/utils/objectParties.js +68 -1
  108. package/dist/esm/utils/objectParties.js.map +1 -1
  109. package/dist/esm/utils/overlayInset.js +60 -0
  110. package/dist/esm/utils/overlayInset.js.map +1 -0
  111. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  112. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  113. package/dist/esm/utils/widgetDispatch.js +4 -1
  114. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  115. package/dist/nextcloud-vue.cjs.js +8444 -6584
  116. package/dist/nextcloud-vue.cjs.js.map +2 -2
  117. package/dist/nextcloud-vue.css +635 -329
  118. package/l10n/en.json +18 -1
  119. package/l10n/nl.json +18 -1
  120. package/package.json +1 -1
  121. package/src/components/CnActionButtons/CnActionButtons.vue +7 -0
  122. package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +11 -1
  123. package/src/components/CnChipListManager/CnChipListManager.vue +4 -1
  124. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +50 -7
  125. package/src/components/CnDataTable/CnDataTable.md +1 -0
  126. package/src/components/CnDataTable/CnDataTable.vue +14 -0
  127. package/src/components/CnDetailPage/CnDetailPage.md +1 -0
  128. package/src/components/CnDetailPage/CnDetailPage.vue +40 -4
  129. package/src/components/CnExpandableRow/CnExpandableRow.vue +7 -4
  130. package/src/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue +287 -0
  131. package/src/components/CnFieldGroupsWidget/index.js +27 -0
  132. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +162 -7
  133. package/src/components/CnFlowDetail/CnFlowDetail.vue +10 -0
  134. package/src/components/CnFlowDetail/CnFlowRunSummary.vue +26 -1
  135. package/src/components/CnFlowsPage/CnFlowBoard.vue +90 -4
  136. package/src/components/CnGraphCanvas/CnGraphCanvas.vue +35 -4
  137. package/src/components/CnIndexPage/CnIndexPage.md +1 -1
  138. package/src/components/CnIndexPage/CnIndexPage.vue +83 -7
  139. package/src/components/CnObjectLinksWidget/CnObjectLinkDialog.vue +267 -0
  140. package/src/components/CnObjectLinksWidget/CnObjectLinksWidget.vue +532 -0
  141. package/src/components/CnObjectLinksWidget/index.js +28 -0
  142. package/src/components/CnObjectLinksWidget/objectLinks.js +19 -0
  143. package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +65 -15
  144. package/src/components/CnPagination/CnPagination.md +1 -0
  145. package/src/components/CnPagination/CnPagination.vue +27 -1
  146. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
  147. package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +4 -0
  148. package/src/components/index.js +2 -0
  149. package/src/css/dialog.css +25 -3
  150. package/src/css/index-page.css +22 -8
  151. package/src/css/look-board-detail.css +41 -0
  152. package/src/css/look-board-index.css +52 -1
  153. package/src/css/look-board.css +17 -0
  154. package/src/index.js +2 -0
  155. package/src/schemas/app-manifest-v2.schema.json +3 -3
  156. package/src/utils/actionsDispatcher.js +9 -5
  157. package/src/utils/libraryWidgetKeys.js +2 -0
  158. package/src/utils/objectParties.js +67 -0
  159. package/src/utils/overlayInset.js +57 -0
  160. package/src/utils/validateManifestV2.compiled.js +2 -2
  161. package/src/utils/widgetDispatch.js +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CnActionButtons.vue3.js","sources":["../../../../src/components/CnActionButtons/CnActionButtons.vue?vue&type=template&id=0480b25e&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-action-buttons\"\n\t\t:class=\"{ 'cn-action-buttons--menu': display === 'menu' }\"\n\t\tdata-testid=\"cn-action-buttons\">\n\t\t<!-- `display: \"menu\"` keeps every dialog below but renders no buttons of\n\t\t its own: the host draws the entries as NcActionButtons inside an\n\t\t overflow menu instead, driven by the `entries` event. NcActions\n\t\t keeps only NcAction* vnodes out of its default slot, so this\n\t\t component cannot be placed in the menu itself.\n\t\t That mode is enforced in `barActions` / `overflowActions`, which\n\t\t both answer empty for it — so `inline` only means anything while\n\t\t this component is the one drawing. -->\n\t\t<template v-for=\"entry in barActions\">\n\t\t\t<!-- Toggle: a stateful two-way state button (GET on mount, write on\n\t\t\t click, optimistic + revert). Rendered inline, never dispatched. -->\n\t\t\t<NcButton\n\t\t\t\tv-if=\"entry.type === 'toggle'\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"toggleState[entry.id] ? 'primary' : 'secondary'\"\n\t\t\t\t:disabled=\"Boolean(togglePending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-toggle-${entry.id}`\"\n\t\t\t\t:aria-pressed=\"String(Boolean(toggleState[entry.id]))\"\n\t\t\t\t@click=\"onToggleClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(toggleState[entry.id] ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label)) }}\n\t\t\t</NcButton>\n\t\t\t<!-- An entry that goes to a URL is a LINK, not a button that calls\n\t\t\t the browser. NcButton renders an anchor when given `href`, so it\n\t\t\t keeps the cluster's styling while the browser supplies the\n\t\t\t pointer, the focus ring, middle-click and \"open in new tab\" —\n\t\t\t none of which a click handler can offer. -->\n\t\t\t<NcButton\n\t\t\t\tv-else-if=\"entry.href\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"buttonVariant(entry)\"\n\t\t\t\t:class=\"buttonClass(entry)\"\n\t\t\t\t:href=\"entry.href\"\n\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Everything else: a plain action button routed through the shared\n\t\t\t dispatcher (api-call / open-form / navigate / open-modal / refresh),\n\t\t\t confirm-gated first when the action asks for it. -->\n\t\t\t<!-- `variant`, NOT `type`. NcButton carries both: `type` is the\n\t\t\t native button type (default \"button\") and `variant` is the\n\t\t\t styling. Binding the descriptor's variant to `type` set an\n\t\t\t invalid native type and left `variant` at its \"secondary\"\n\t\t\t default, so `variant: \"primary\"` / `\"error\"` had never once\n\t\t\t rendered — silently, since an unknown native type is ignored. -->\n\t\t\t<NcButton\n\t\t\t\tv-else\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"buttonVariant(entry)\"\n\t\t\t\t:class=\"buttonClass(entry)\"\n\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Sub-actions. Its OWN chevron rather than entries folded into the\n\t\t\t overflow below, because NcActions cannot nest — and a grouped\n\t\t\t dropdown is the point of declaring children (a version list\n\t\t\t flattened into the page's one menu grows without bound). The\n\t\t\t parent's own button above still renders alongside this chevron —\n\t\t\t a parent meant only to group children needs a real `handler` (or\n\t\t\t `href`/other type) of its own, or its button dispatches nothing. -->\n\t\t\t<NcActions\n\t\t\t\tv-if=\"hasChildren(entry)\"\n\t\t\t\t:key=\"`${entry.id}-children`\"\n\t\t\t\t:menuName=\"childMenuName(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-children-${entry.id}`\">\n\t\t\t\t<template v-for=\"child in visibleChildren(entry)\">\n\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\tv-if=\"child.href\"\n\t\t\t\t\t\t:key=\"`${child.id}-link`\"\n\t\t\t\t\t\t:href=\"child.href\"\n\t\t\t\t\t\t:target=\"linkTargetOf(child)\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onLinkClick(child, $event)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:key=\"child.id\"\n\t\t\t\t\t\t:disabled=\"Boolean(actionPending[child.id])\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onActionClick(child)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcActions>\n\t\t</template>\n\n\t\t<!-- Overflow. Only ever rendered when `inline` is set, so a consumer\n\t\t that never asked for a limit keeps every action as a button. -->\n\t\t<NcActions\n\t\t\tv-if=\"overflowActions.length > 0\"\n\t\t\t:menuName=\"overflowOnly ? undefined : overflowMenuName\"\n\t\t\t:aria-label=\"overflowOnly ? overflowTriggerLabel : undefined\"\n\t\t\t:forceMenu=\"true\"\n\t\t\tdata-testid=\"cn-action-buttons-overflow\">\n\t\t\t<template v-for=\"entry in overflowActions\">\n\t\t\t\t<NcActionLink\n\t\t\t\t\tv-if=\"entry.href\"\n\t\t\t\t\t:key=\"`${entry.id}-link`\"\n\t\t\t\t\t:href=\"entry.href\"\n\t\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionLink>\n\t\t\t\t<NcActionButton\n\t\t\t\t\tv-else\n\t\t\t\t\t:key=\"entry.id\"\n\t\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionButton>\n\t\t\t</template>\n\t\t</NcActions>\n\n\t\t<!-- Confirm gate for a confirm:true action (reuses CnConfirmDialog). -->\n\t\t<CnConfirmDialog\n\t\t\tv-if=\"confirmEntry\"\n\t\t\tref=\"confirmDialog\"\n\t\t\t:dialogTitle=\"tr(confirmEntry.confirmTitle || confirmEntry.label)\"\n\t\t\t:message=\"tr(confirmEntry.confirmMessage) || defaultConfirmMessage\"\n\t\t\t:variant=\"confirmEntry.variant === 'error' ? 'error' : 'primary'\"\n\t\t\tv-bind=\"confirmButtonProps\"\n\t\t\t@confirm=\"onConfirmProceed\"\n\t\t\t@close=\"confirmEntry = null\" />\n\n\t\t<!-- Schema-driven create dialog for an open-form action. The plain\n\t\t form is the default: the properties/JSON table is a power-user\n\t\t surface, and a header button that says \"New case\" is aimed at\n\t\t someone filing one, not at someone inspecting the schema. Set\n\t\t `advanced: true` on the action to get the table back. -->\n\t\t<CnFormDialog\n\t\t\tv-if=\"formEntry && formSchema && !formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"formItem\"\n\t\t\t:register=\"formRegister\"\n\t\t\t:initialData=\"formInitialValues || {}\"\n\t\t\t:dialogTitle=\"tr(formEntry.formTitle) || ''\"\n\t\t\t:eyebrow=\"tr(formEntry.formEyebrow) || ''\"\n\t\t\t:subtitle=\"tr(formEntry.formSubtitle) || ''\"\n\t\t\t:confirmLabel=\"tr(formEntry.formConfirmLabel) || ''\"\n\t\t\t:includeFields=\"formEntry.includeFields || null\"\n\t\t\t:excludeFields=\"formEntry.excludeFields || []\"\n\t\t\t:fieldOverrides=\"formEntry.fieldOverrides || {}\"\n\t\t\t:size=\"formEntry.size || 'normal'\"\n\t\t\t:columns=\"formEntry.columns || 1\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\t\t<CnAdvancedFormDialog\n\t\t\tv-if=\"formEntry && formSchema && formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"null\"\n\t\t\t:initialValues=\"formInitialValues\"\n\t\t\t:confirmLabel=\"tr(formEntry.formConfirmLabel) || ''\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\n\t\t<!-- run-node's config dialog (manifest-run-node-action): only mounted\n\t\t when the target node declared at least one field AND that\n\t\t describe call succeeded — an empty/no form runs immediately with\n\t\t no dialog at all (openRunNode below), and a describe FAILURE also\n\t\t skips the dialog (toasts instead) rather than showing an empty,\n\t\t confusing one. -->\n\t\t<CnRunNodeDialog\n\t\t\tv-if=\"runNodeEntry && runNodeFields.length\"\n\t\t\t:title=\"tr(runNodeEntry.formTitle) || tr(runNodeEntry.label)\"\n\t\t\t:fields=\"runNodeFields\"\n\t\t\t:loading=\"Boolean(actionPending[runNodeEntry.id])\"\n\t\t\t:translate=\"effectiveTranslate\"\n\t\t\t@confirm=\"onRunNodeConfirm\"\n\t\t\t@close=\"closeRunNode\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionLink, NcActions, NcButton } from '@nextcloud/vue'\nimport { inject } from 'vue'\nimport CnConfirmDialog from '../../dialogs/CnConfirmDialog.vue'\nimport CnRunNodeDialog from '../../dialogs/CnRunNodeDialog.vue'\nimport { fetchEndpointSource } from '../../composables/useEndpointSource.js'\nimport { useObjectStore } from '../../store/useObjectStore.js'\nimport { actionLink, buildOnSuccessRoute, dispatchAction, interpolateActionTarget, isExternalActionTarget, postRunNode, resolveCreateOverrideHandler, resolveObjectOpType } from '../../utils/actionsDispatcher.js'\nimport { resolveObjectTokenContext } from '../../utils/detailObjectContext.js'\nimport { answersByArrayKey, mergeValueArray, usesArrayValues, valueRecordsFor } from '../../utils/dynamicProperties.js'\nimport { followLinkClick } from '../../utils/linkNavigation.js'\nimport { resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { evaluateVisibleWhen } from '../../utils/visibleWhen.js'\nimport { CnAdvancedFormDialog } from '../CnAdvancedFormDialog/index.js'\nimport { CnFormDialog } from '../CnFormDialog/index.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\n/**\n * CnActionButtons — declarative header-actions surface (#91 Wave 3).\n *\n * Renders a page's `headerActions[]` as buttons and owns the two action\n * behaviours that need STATE or a DIALOG the one-shot `dispatchAction`\n * can't provide on its own:\n *\n * - **`open-form`** — mounts the shared `CnAdvancedFormDialog` for the\n * action's `schema` (fetched through the object store), saves on\n * confirm, toasts, refreshes the page, and optionally navigates to\n * `onSuccessRoute`. Two optional keys cover the schemas a bare create\n * cannot satisfy: `props` seeds fixed field values into the create form\n * (so one schema can back several buttons, each fixing its own\n * discriminator), and `createOverride` names a registry handler that owns\n * the persist instead of `objectStore.saveObject` (for a schema requiring\n * a server-minted field the form cannot supply). `includeFields` /\n * `excludeFields` / `fieldOverrides` narrow what the button asks for, which\n * is how one schema serves both a full editor and a quick-create button.\n * `advanced: true` swaps in the properties/JSON table for a power user.\n * With `endpoint: { url, method?, loadUrl?, responsePath? }` and\n * `formProperties` (JSON-schema properties) it edits a record that is not a\n * register object instead: it reads the record from the endpoint, shows the\n * declared fields filled in, and sends them back with PATCH (or PUT). With\n * `method: \"POST\"` it creates one: an empty form, posted to the endpoint.\n * - **`toggle`** — a two-way state button: `GET`s `stateSource` on mount,\n * renders `labelOn` / `labelOff`, and on click `writes` the flipped\n * value OPTIMISTICALLY, reverting on failure.\n * - **`run-node`** (manifest-run-node-action) — GETs the target flow node's\n * describe endpoint (OpenRegister's `or-flow-run-node`); a node with\n * declared fields mounts `CnRunNodeDialog` (its own small field renderer —\n * see that component's docblock for why it is not `CnFlowNodeEditModal`'s),\n * a node with none runs immediately. Either way `postRunNode()`\n * (`actionsDispatcher.js`) makes the actual call, subject-token-resolved\n * exactly like `agent`.\n *\n * Every other type (`api-call`, `navigate`, `open-modal`, `open-page`,\n * `refresh`, `handler`) routes through the shared `dispatchAction` — with\n * a `CnConfirmDialog` gate first when the action sets `confirm: true`\n * (the object-op precedent: the dispatcher runs AFTER confirmation).\n *\n * Each action may carry a `visibleWhen` predicate (the shared banner\n * shape — `{ endpoint | source | field, op, value }`) evaluated against\n * the page / object context; a hidden action simply doesn't render.\n *\n * Placement: CnDashboardPage / CnDetailPage / CnPageRenderer mount this in\n * their header-actions area, passing the page's `headerActions[]`. The\n * object context (`{ objectId, object, register, schema }`) and the page\n * workspace / app-config bags are injected so tokens + local `visibleWhen`\n * resolve against the current record and page state.\n *\n * ```json\n * \"headerActions\": [\n * { \"id\": \"new-lead\", \"label\": \"New lead\", \"type\": \"open-form\",\n * \"register\": \"crm\", \"schema\": \"lead\", \"onSuccessRoute\": \"Leads\", \"variant\": \"primary\" },\n * { \"id\": \"approve\", \"label\": \"Approve\", \"type\": \"api-call\",\n * \"url\": \"/apps/shillinq/api/payment-runs/@objectId/approve\", \"confirm\": true,\n * \"visibleWhen\": { \"field\": \"state\", \"op\": \"eq\", \"value\": \"pending\" } },\n * { \"id\": \"toggle-open\", \"type\": \"toggle\", \"labelOn\": \"Open\", \"labelOff\": \"Closed\",\n * \"stateSource\": { \"url\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"responsePath\": \"open\" },\n * \"field\": \"open\", \"writeUrl\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"method\": \"PUT\" }\n * ]\n * ```\n */\nexport default {\n\tname: 'CnActionButtons',\n\n\tcomponents: { NcActions, NcActionButton, NcActionLink, NcButton, CnIcon, CnConfirmDialog, CnFormDialog, CnAdvancedFormDialog, CnRunNodeDialog },\n\n\tinject: {\n\t\t/** Detail-page object context (`{ objectId, object, register, schema }`). */\n\t\tcnObjectContext: { default: null },\n\t\t/** v2 slot-grid detail context holder (CnPageRenderer). */\n\t\tcnDetailObjectContext: { default: null },\n\t\t/** Page-level workspace context bag (reactive). */\n\t\tcnWorkspaceContext: { default: () => ({}) },\n\t\t/** Page-level app config bag (reactive). */\n\t\tcnAppConfig: { default: () => ({}) },\n\t\t/** Pre-bound dispatchAction from CnPageRenderer (router/registry/handlers/openModal wired). */\n\t\tcnDispatchAction: { default: null },\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored action labels, confirm copy and api-call toasts\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** v2 component registry, for resolving an `open-form` createOverride. */\n\t\tcnRegistry: { default: () => ({}) },\n\t\t/** Legacy customComponents map, same resolution fallback. */\n\t\tcnCustomComponents: { default: () => ({}) },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The page's declarative header actions. Each entry is a typed action\n\t\t * (`open-form` | `toggle` | `api-call` | `navigate` | `open-modal` |\n\t\t * `refresh` | `handler`) plus `id` / `label` and an optional\n\t\t * `visibleWhen` predicate, `icon`, `variant`, and `confirm`.\n\t\t *\n\t\t * An entry carrying `href` (with optional `target`) renders as a real\n\t\t * link instead — an anchor in the bar, an NcActionLink in a menu — and\n\t\t * is never dispatched. Use it for anything that ends in a URL, so the\n\t\t * browser keeps middle-click, \"open in new tab\" and the link semantics\n\t\t * assistive tech announces.\n\t\t *\n\t\t * `href` is used as given, so it must be a finished URL. A manifest\n\t\t * `headerActions[]` entry may carry `href` too: the page (CnDetailPage,\n\t\t * CnDashboardPage) resolves an instance path through `generateUrl()`\n\t\t * and sets `target` before the entry reaches this component.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tactions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * How many collapsible actions stay as buttons; the rest fall into a\n\t\t * single `···` overflow menu.\n\t\t *\n\t\t * `0` (the default) renders EVERY action as a button, which is what\n\t\t * every existing consumer already gets — the overflow only ever\n\t\t * appears once a host asks for a limit.\n\t\t *\n\t\t * A `variant: \"primary\"` action, an action carrying `children`, and a\n\t\t * `toggle` are never collapsed and never consume one of the N slots:\n\t\t * NcActions paints all of its inline actions with one shared variant\n\t\t * (so a lone primary among them is not expressible), it cannot nest\n\t\t * another NcActions, and a toggle's state lives in its button.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tinline: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow menu. Empty falls back to a translated\n\t\t * \"Actions\".\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\toverflowLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Every collapsible action in the `···` menu, none as a button: the\n\t\t * trigger is icon only and named by `overflowAriaLabel` (a card's\n\t\t * \"Actions for Volledigheid toetsen\").\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\toverflowOnly: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The accessible name of the icon-only trigger under `overflowOnly`.\n\t\t * Empty falls back to the overflow label.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\toverflowAriaLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Explicit Vue Router instance for `navigate` / `open-page` /\n\t\t * `onSuccessRoute`. Falls back to `this.$router`. Only needed for\n\t\t * standalone mounts outside a router tree.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\trouter: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where the actions are drawn. `buttons` (the default) puts one\n\t\t * NcButton per action in the host's header. `menu` draws none and\n\t\t * emits `entries` instead, so the host can render them inside an\n\t\t * overflow menu while this component keeps owning the dialogs.\n\t\t *\n\t\t * @type {'buttons'|'menu'}\n\t\t */\n\t\tdisplay: {\n\t\t\ttype: String,\n\t\t\tdefault: 'buttons',\n\t\t\tvalidator: (v) => ['buttons', 'menu'].includes(v),\n\t\t},\n\t},\n\n\temits: ['created', 'entries'],\n\n\tsetup() {\n\t\t// Read the two detail-surface injects once so the object token context\n\t\t// resolves identically to the endpoint-bound widgets (Wave 3).\n\t\tconst objectCtxRaw = inject('cnObjectContext', null)\n\t\tconst detailCtxRaw = inject('cnDetailObjectContext', null)\n\t\tconst workspaceRaw = inject('cnWorkspaceContext', null)\n\t\tconst appConfigRaw = inject('cnAppConfig', null)\n\t\treturn { objectCtxRaw, detailCtxRaw, workspaceRaw, appConfigRaw }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Evaluated visibleWhen outcome per action id (true when no predicate). */\n\t\t\tvisibility: {},\n\t\t\t/** Current boolean state per toggle action id. */\n\t\t\ttoggleState: {},\n\t\t\t/** In-flight flag per toggle action id (disables the button). */\n\t\t\ttogglePending: {},\n\t\t\t/** In-flight flag per non-toggle action id. */\n\t\t\tactionPending: {},\n\t\t\t/** The action awaiting confirmation (null = no dialog). */\n\t\t\tconfirmEntry: null,\n\t\t\t/** The open-form action currently showing its dialog (null = closed). */\n\t\t\tformEntry: null,\n\t\t\t/** The fetched schema object for the open-form dialog (null until loaded). */\n\t\t\tformSchema: null,\n\t\t\t/** The record an endpoint form edits (null for a create form). */\n\t\t\tformItem: null,\n\t\t\t/** The run-node action currently in flight / showing its dialog (null = closed). */\n\t\t\trunNodeEntry: null,\n\t\t\t/** The target node's declared config-form fields, from the describe GET. */\n\t\t\trunNodeFields: [],\n\t\t\t/** Default confirm-dialog message. */\n\t\t\tdefaultConfirmMessage: t('nextcloud-vue', 'Are you sure you want to continue?'),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The confirm button's words and icon from the action\n\t\t * (`confirmLabel`, `confirmIcon`); none set leaves the dialog's own.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tconfirmButtonProps() {\n\t\t\tconst entry = this.confirmEntry || {}\n\t\t\treturn {\n\t\t\t\t...(typeof entry.confirmLabel === 'string' && entry.confirmLabel !== '' ? { confirmLabel: this.tr(entry.confirmLabel) } : {}),\n\t\t\t\t...(typeof entry.confirmIcon === 'string' && entry.confirmIcon !== '' ? { confirmIcon: entry.confirmIcon } : {}),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/**\n\t\t * Create-form seed values for the open `open-form` action. An action\n\t\t * declares them as `props`, which is how a single schema backs several\n\t\t * buttons — \"New request\" and \"New complaint\" both open the `ticket`\n\t\t * form, each fixing its own `ticketType`.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tformInitialValues() {\n\t\t\tconst props = this.formEntry && this.formEntry.props\n\t\t\tif (!props || typeof props !== 'object' || Array.isArray(props)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\t// Seed values go through the SAME token grammar as filters, so an\n\t\t\t// action on a detail page can stamp the record it belongs to:\n\t\t\t// `{ \"domainObjectRef\": \"@objectId\" }`. Without this the literal\n\t\t\t// string \"@objectId\" is saved, and a foreign key pointing at nothing\n\t\t\t// is a defect that only shows up in whatever reads it later.\n\t\t\treturn resolveFilterTokens(props, this.tokenCtx)\n\t\t},\n\n\t\t/**\n\t\t * The register the open dialog reads and writes against. The plain\n\t\t * form needs it to resolve `$ref` pickers into real dropdowns; without\n\t\t * one a reference field renders as an empty select and the action is\n\t\t * unusable for exactly the schemas that need it most.\n\t\t *\n\t\t * @return {string} The register slug, '' when none is resolvable.\n\t\t */\n\t\tformRegister() {\n\t\t\treturn (this.formEntry && this.formEntry.register) || this.objectCtx.register || ''\n\t\t},\n\n\t\t/**\n\t\t * The actions whose visibleWhen evaluated true (or carry no predicate).\n\t\t *\n\t\t * A `navigate` action whose target leaves the app is turned into a link\n\t\t * entry here, so it takes the `href` branch above instead of being\n\t\t * dispatched. An absolute URL is not a route: pushing one at the router\n\t\t * matched nothing and landed on the fallback page, carrying the URL's\n\t\t * own query string with it. The action's `target` (the URL) is replaced\n\t\t * by the anchor's `target`, since the two fields share a name and the\n\t\t * URL now lives in `href`. An author's explicit `href` still wins.\n\t\t *\n\t\t * An in-app `navigate` or `open-page` becomes a link too (see\n\t\t * `toLinkEntry`), keeping its own `target` so a fallback dispatch works.\n\t\t */\n\t\tvisibleActions() {\n\t\t\treturn (this.actions || [])\n\t\t\t\t.filter((a) => a && a.id && this.visibility[a.id] !== false)\n\t\t\t\t.map((a) => this.toLinkEntry(a))\n\t\t},\n\n\t\t/**\n\t\t * The actions rendered in the bar itself: every non-collapsible one,\n\t\t * plus the first `inline` collapsible ones. Declaration order is kept,\n\t\t * so promoting an action never reshuffles the row.\n\t\t *\n\t\t * Empty in `display: \"menu\"` — the host draws the entries itself there,\n\t\t * so this component renders no buttons and has nothing to cap.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as buttons / chevrons.\n\t\t */\n\t\tbarActions() {\n\t\t\tif (this.display === 'menu') {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.overflowOnly) {\n\t\t\t\treturn this.visibleActions.filter((a) => !this.isCollapsible(a))\n\t\t\t}\n\t\t\tif (!(this.inline > 0)) {\n\t\t\t\treturn this.visibleActions\n\t\t\t}\n\t\t\tconst promoted = new Set(this.visibleActions\n\t\t\t\t.filter((a) => this.isCollapsible(a))\n\t\t\t\t.slice(0, this.inline)\n\t\t\t\t.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !this.isCollapsible(a) || promoted.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * The actions that did not fit, for the `···` menu. Always empty while\n\t\t * `inline` is 0, and in `display: \"menu\"` where the host owns the menu.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as menu items.\n\t\t */\n\t\toverflowActions() {\n\t\t\tif (this.display === 'menu' || !(this.inline > 0 || this.overflowOnly)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst shown = new Set(this.barActions.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !shown.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow trigger.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\toverflowMenuName() {\n\t\t\treturn this.tr(this.overflowLabel) || t('nextcloud-vue', 'Actions')\n\t\t},\n\n\t\t/**\n\t\t * Name of the icon-only trigger under `overflowOnly`.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\toverflowTriggerLabel() {\n\t\t\treturn this.overflowAriaLabel || this.overflowMenuName\n\t\t},\n\n\t\t/**\n\t\t * The visible actions flattened for a host that draws them as menu\n\t\t * items. Everything the item needs to render is resolved here — the\n\t\t * translated label a toggle currently shows, its pressed state, its\n\t\t * pending flag, and which of the two icon shapes applies — so the host\n\t\t * template stays a plain v-for and needs none of this component's\n\t\t * state. `run()` is pre-bound, the way CnIndexPage pre-binds a header\n\t\t * action's handler for the index bar, so the host dispatches without\n\t\t * reaching back through a ref.\n\t\t *\n\t\t * @return {Array<object>} One menu-ready descriptor per visible action.\n\t\t */\n\t\tmenuEntries() {\n\t\t\treturn this.visibleActions.map((entry) => {\n\t\t\t\tconst isToggle = entry.type === 'toggle'\n\t\t\t\tconst on = Boolean(this.toggleState[entry.id])\n\t\t\t\tconst label = isToggle\n\t\t\t\t\t? (on ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label))\n\t\t\t\t\t: entry.label\n\t\t\t\treturn {\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tlabel: this.tr(label),\n\t\t\t\t\t// An mdi name goes to CnIcon; a legacy `icon-*` class goes\n\t\t\t\t\t// on a bare span. Deciding it here keeps isMdiIconName from\n\t\t\t\t\t// having to be duplicated into every host.\n\t\t\t\t\ticonName: this.isMdiIconName(entry.icon) ? entry.icon : '',\n\t\t\t\t\ticonClass: (entry.icon && !this.isMdiIconName(entry.icon)) ? entry.icon : '',\n\t\t\t\t\tdisabled: Boolean(isToggle ? this.togglePending[entry.id] : this.actionPending[entry.id]),\n\t\t\t\t\t// null, not false: a non-toggle carries no pressed state at\n\t\t\t\t\t// all, and `aria-pressed=\"false\"` would announce every\n\t\t\t\t\t// action as an un-pressed toggle button.\n\t\t\t\t\tpressed: isToggle ? on : null,\n\t\t\t\t\ttestid: isToggle ? `cn-action-toggle-${entry.id}` : `cn-action-${entry.id}`,\n\t\t\t\t\t// A link entry, for a host to render as an anchor rather\n\t\t\t\t\t// than a button with a click handler. Named `linkTarget`\n\t\t\t\t\t// because an action's own `target` is its destination. An in-app\n\t\t\t\t\t// link (`linkTo`) is left to `run()`: a host anchor has no router.\n\t\t\t\t\thref: (!entry.linkTo && entry.href) || '',\n\t\t\t\t\tlinkTarget: (!entry.linkTo && entry.href) ? (entry.target || '_blank') : '',\n\t\t\t\t\trun: () => (isToggle ? this.onToggleClick(entry) : this.onActionClick(entry)),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** Unwrapped page workspace bag. */\n\t\tworkspaceCtx() {\n\t\t\tconst c = this.workspaceRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** Unwrapped app-config bag. */\n\t\tconfigCtx() {\n\t\t\tconst c = this.appConfigRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** The merged object token context (both detail-surface injects). */\n\t\tobjectCtx() {\n\t\t\treturn resolveObjectTokenContext(this.objectCtxRaw, this.detailCtxRaw) || {}\n\t\t},\n\n\t\t/** The full token context for url/param interpolation + local visibleWhen. */\n\t\ttokenCtx() {\n\t\t\treturn {\n\t\t\t\t...this.objectCtx,\n\t\t\t\tworkspace: this.workspaceCtx,\n\t\t\t\tconfig: this.configCtx,\n\t\t\t}\n\t\t},\n\n\t\t/** The effective router (explicit prop wins, else this.$router). */\n\t\teffectiveRouter() {\n\t\t\treturn this.router || this.$router || null\n\t\t},\n\t},\n\n\twatch: {\n\t\tactions: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.evaluateVisibility()\n\t\t\t\tthis.initToggles()\n\t\t\t},\n\t\t},\n\n\t\t// Re-evaluate local (object-context) visibleWhen when the record loads.\n\t\tobjectCtx: {\n\t\t\tdeep: true,\n\t\t\thandler() { this.evaluateVisibility() },\n\t\t},\n\n\t\t// Push the menu-ready descriptors at a `display: \"menu\"` host. It fires\n\t\t// immediately so the host has the list on first paint, and again on\n\t\t// every change of visibility, toggle state or pending flag — the three\n\t\t// things that would otherwise leave a stale item in an open menu.\n\t\tmenuEntries: {\n\t\t\timmediate: true,\n\t\t\thandler(entries) {\n\t\t\t\tif (this.display === 'menu') {\n\t\t\t\t\t/**\n\t\t\t\t\t * @event entries Emitted in `display: \"menu\"` only, whenever the visible actions, their toggle state or their pending flags change. Payload: one menu-ready descriptor per visible action, each carrying `id`, `label`, `iconName`, `iconClass`, `disabled`, `pressed`, `testid` and a pre-bound `run()`.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('entries', entries)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The NcButton variant of an entry. `error-outline` and `tonal` are\n\t\t * not NcButton variants: `error-outline` is a secondary button that\n\t\t * `buttonClass` outlines in red, `tonal` a tertiary one that\n\t\t * `buttonClass` draws as the tonal pill.\n\t\t *\n\t\t * @param {object} entry The action entry.\n\t\t * @return {string} The variant.\n\t\t * @spec openspec/changes/action-error-outline/specs/action-buttons/spec.md#requirement-an-action-can-be-an-outlined-red-button\n\t\t */\n\t\tbuttonVariant(entry) {\n\t\t\tif (!entry.variant || entry.variant === 'error-outline') {\n\t\t\t\treturn 'secondary'\n\t\t\t}\n\t\t\tif (entry.variant === 'tonal') {\n\t\t\t\treturn 'tertiary'\n\t\t\t}\n\t\t\treturn entry.variant\n\t\t},\n\n\t\t/**\n\t\t * The extra class of an entry's button: the red outline for\n\t\t * `variant: \"error-outline\"`, the tonal pill for `variant: \"tonal\"`.\n\t\t *\n\t\t * @param {object} entry The action entry.\n\t\t * @return {object} The class map.\n\t\t * @spec openspec/changes/action-error-outline/specs/action-buttons/spec.md#requirement-an-action-can-be-an-outlined-red-button\n\t\t */\n\t\tbuttonClass(entry) {\n\t\t\treturn {\n\t\t\t\t'cn-action-buttons__button--error-outline': entry.variant === 'error-outline',\n\t\t\t\t'cn-button--tonal': entry.variant === 'tonal',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Heuristic MDI-name check (an `icon-`-prefixed string is a CSS class).\n\t\t *\n\t\t * @param {string} name The icon string.\n\t\t * @return {boolean} True when it should render via CnIcon.\n\t\t */\n\t\tisMdiIconName(name) {\n\t\t\treturn typeof name === 'string' && name !== '' && !name.startsWith('icon-')\n\t\t},\n\n\t\t/**\n\t\t * Evaluate every action's `visibleWhen` against the current context.\n\t\t * Fail-safe (a broken predicate hides its action); actions without a\n\t\t * predicate are always visible.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync evaluateVisibility() {\n\t\t\t// Children are walked too: a sub-action whose predicate was never\n\t\t\t// evaluated would read as visible and render regardless.\n\t\t\tconst flat = []\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tflat.push(action)\n\t\t\t\tif (Array.isArray(action.children)) {\n\t\t\t\t\tflat.push(...action.children.filter((c) => c && c.id))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const action of flat) {\n\t\t\t\tif (!action.visibleWhen) {\n\t\t\t\t\tthis.visibility[action.id] = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst ok = await evaluateVisibleWhen(action.visibleWhen, this.tokenCtx)\n\t\t\t\tthis.visibility[action.id] = ok\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Seed each toggle action's state from its `stateSource` endpoint\n\t\t * (fetched through the shared endpoint engine so `@objectId` etc.\n\t\t * resolve). No-op for non-toggle actions.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync initToggles() {\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || action.type !== 'toggle' || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tthis.toggleState[action.id] = false\n\t\t\t\tif (!action.stateSource || !action.stateSource.url) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await fetchEndpointSource(action.stateSource, this.tokenCtx)\n\t\t\t\t\tconst value = action.field ? this.readField(payload, action.field) : payload\n\t\t\t\t\tthis.toggleState[action.id] = Boolean(value)\n\t\t\t\t} catch {\n\t\t\t\t\t// Leave the default (off); a failed state read never breaks the bar.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether an action may be pushed into the overflow menu. See the\n\t\t * `inline` prop for why these three shapes never can be.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it can collapse.\n\t\t */\n\t\tisCollapsible(entry) {\n\t\t\treturn !this.hasChildren(entry)\n\t\t\t\t&& entry.variant !== 'primary'\n\t\t\t\t&& entry.type !== 'toggle'\n\t\t},\n\n\t\t/**\n\t\t * Whether an action declares sub-actions worth a chevron.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it has at least one visible child.\n\t\t */\n\t\thasChildren(entry) {\n\t\t\treturn this.visibleChildren(entry).length > 0\n\t\t},\n\n\t\t/**\n\t\t * An action's sub-actions, minus any hidden by `visibleWhen`.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {Array<object>} The renderable children.\n\t\t */\n\t\tvisibleChildren(entry) {\n\t\t\tif (!Array.isArray(entry?.children)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn entry.children\n\t\t\t\t.filter((c) => c && c.id && this.visibility[c.id] !== false)\n\t\t\t\t.map((c) => this.toLinkEntry(c))\n\t\t},\n\n\t\t/**\n\t\t * Give a navigating action the `href` it renders as. An external\n\t\t * `navigate` target becomes the href with a `_blank` anchor target. An\n\t\t * in-app `navigate` / `open-page` gets the router-resolved href plus\n\t\t * `linkTo`, the location a plain click routes to; one with `confirm`,\n\t\t * an `onSelect` function, or an unresolvable route stays a button.\n\t\t *\n\t\t * @param {object} a The action descriptor.\n\t\t * @return {object} The descriptor, possibly with `href` / `linkTo` added.\n\t\t */\n\t\ttoLinkEntry(a) {\n\t\t\tif (a.href || (a.type !== 'navigate' && a.type !== 'open-page')) {\n\t\t\t\treturn a\n\t\t\t}\n\t\t\tlet entry = a\n\t\t\tif (a.type === 'navigate') {\n\t\t\t\t// Interpolated BEFORE the external test and before it becomes an\n\t\t\t\t// href, so the anchor carries the record's id rather than the token.\n\t\t\t\tconst target = interpolateActionTarget(a.target, this.tokenCtx)\n\t\t\t\tif (isExternalActionTarget(target)) {\n\t\t\t\t\treturn { ...a, href: target, target: '_blank' }\n\t\t\t\t}\n\t\t\t\tentry = target === a.target ? a : { ...a, target }\n\t\t\t}\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\treturn entry\n\t\t\t}\n\t\t\tconst link = actionLink(entry, { router: this.effectiveRouter })\n\t\t\treturn link ? { ...entry, href: link.href, linkTo: link.to } : entry\n\t\t},\n\n\t\t/**\n\t\t * The anchor `target` of a link entry. An in-app link opens in place;\n\t\t * its own `target` is the destination, not an anchor target.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @return {string|undefined} The anchor target.\n\t\t */\n\t\tlinkTargetOf(entry) {\n\t\t\treturn entry.linkTo ? undefined : (entry.target || undefined)\n\t\t},\n\n\t\t/**\n\t\t * Click on a link entry: a plain click on an in-app link routes in\n\t\t * place; a URL or a modified click is left to the browser.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @return {void}\n\t\t */\n\t\tonLinkClick(entry, event) {\n\t\t\tif (entry.linkTo) {\n\t\t\t\tfollowLinkClick(event, entry.linkTo, this.effectiveRouter)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name for a sub-action chevron. `childrenLabel` when set, else the\n\t\t * parent's own label, so the dropdown is never announced unlabelled.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {string} The menu name.\n\t\t */\n\t\tchildMenuName(entry) {\n\t\t\treturn this.tr(entry.childrenLabel) || this.tr(entry.label) || ''\n\t\t},\n\n\t\t/**\n\t\t * Read a dot-path off a payload (the toggle state field).\n\t\t *\n\t\t * @param {unknown} data The payload.\n\t\t * @param {string} field The dot-path.\n\t\t * @return {unknown} The value at the path.\n\t\t */\n\t\treadField(data, field) {\n\t\t\tif (!field) {\n\t\t\t\treturn data\n\t\t\t}\n\t\t\treturn String(field).split('.').reduce((o, k) => (o === null || o === undefined ? o : o[k]), data)\n\t\t},\n\n\t\t/**\n\t\t * Toggle click: flip the state OPTIMISTICALLY, write it, and revert on\n\t\t * failure. Success/error toast via the api-call dispatch path (which\n\t\t * also refreshes the page unless `refresh: false`).\n\t\t *\n\t\t * @param {object} entry The toggle action.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onToggleClick(entry) {\n\t\t\tif (this.togglePending[entry.id]) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = Boolean(this.toggleState[entry.id])\n\t\t\tconst next = !previous\n\t\t\tthis.toggleState[entry.id] = next\n\t\t\tthis.togglePending[entry.id] = true\n\t\t\tconst writeParams = { ...(entry.params || {}) }\n\t\t\tif (entry.field) {\n\t\t\t\twriteParams[entry.field] = next\n\t\t\t}\n\t\t\tconst result = await this.dispatch({\n\t\t\t\ttype: 'api-call',\n\t\t\t\turl: entry.writeUrl,\n\t\t\t\tmethod: entry.method || 'PUT',\n\t\t\t\tparams: writeParams,\n\t\t\t\tsuccessMessage: entry.successMessage,\n\t\t\t\terrorMessage: entry.errorMessage,\n\t\t\t\trefresh: entry.refresh,\n\t\t\t})\n\t\t\tif (!result || result.ok === false) {\n\t\t\t\t// Revert the optimistic flip.\n\t\t\t\tthis.toggleState[entry.id] = previous\n\t\t\t}\n\t\t\tthis.togglePending[entry.id] = false\n\t\t},\n\n\t\t/**\n\t\t * Non-toggle action click: gate on `confirm` first, else run.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {void}\n\t\t */\n\t\tonActionClick(entry) {\n\t\t\tif (entry.confirm === true) {\n\t\t\t\tthis.confirmEntry = entry\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.runAction(entry)\n\t\t},\n\n\t\t/**\n\t\t * The confirm dialog's proceed handler: run the pending action, then\n\t\t * report the outcome back to the dialog's result phase.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onConfirmProceed() {\n\t\t\tconst entry = this.confirmEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst result = await this.runAction(entry)\n\t\t\tconst dialog = this.$refs.confirmDialog\n\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\tconst ok = result === undefined || (result && result.ok !== false)\n\t\t\t\tdialog.setResult(ok ? { success: true } : { error: t('nextcloud-vue', 'Action failed.') })\n\t\t\t} else {\n\t\t\t\tthis.confirmEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run an action (post-confirmation). `open-form` opens the schema\n\t\t * dialog; everything else dispatches. Returns the dispatch result so\n\t\t * the confirm dialog can report success/failure.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {Promise<unknown>} The dispatch result (undefined for open-form).\n\t\t */\n\t\tasync runAction(entry) {\n\t\t\t// A function on the descriptor, for a PARENT COMPONENT composing\n\t\t\t// entries in JS (CnDetailPage folds its own Edit in this way).\n\t\t\t// Manifest JSON cannot carry one, so the declarative path is\n\t\t\t// untouched — and it runs after the confirm gate, like every\n\t\t\t// dispatched type.\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\tentry.onSelect(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'open-form') {\n\t\t\t\tawait this.openForm(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'run-node') {\n\t\t\t\tawait this.openRunNode(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tconst result = await this.dispatch(entry)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\treturn result\n\t\t},\n\n\t\t/**\n\t\t * Resolve a manifest-authored UI string through the host translate\n\t\t * function. A pure pass-through: an empty value, or a catalogue that\n\t\t * lacks the key, returns the input unchanged.\n\t\t *\n\t\t * @param {string} [value] The English source string.\n\t\t * @return {string|undefined} The translated (or source) string.\n\t\t */\n\t\ttr(value) {\n\t\t\treturn value ? this.effectiveTranslate(value) : value\n\t\t},\n\n\t\t/**\n\t\t * Route an action through the shared dispatcher — the pre-bound\n\t\t * `cnDispatchAction` (router/registry/handlers/openModal already\n\t\t * wired) when available, else a direct call with a minimal context.\n\t\t * The token context and the host translate function are always\n\t\t * merged in (the latter localises `api-call` success/error toasts).\n\t\t *\n\t\t * @param {object} action The action to dispatch.\n\t\t * @return {Promise<unknown>} The dispatch result.\n\t\t */\n\t\tdispatch(action) {\n\t\t\tconst extra = { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }\n\t\t\tif (typeof this.cnDispatchAction === 'function') {\n\t\t\t\treturn this.cnDispatchAction(action, extra)\n\t\t\t}\n\t\t\treturn dispatchAction(action, {\n\t\t\t\trouter: this.effectiveRouter,\n\t\t\t\topenForm: (a) => this.openForm(a),\n\t\t\t\topenRunNode: (a) => this.openRunNode(a),\n\t\t\t\t...extra,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Open the schema-driven create dialog for an `open-form` action:\n\t\t * fetch the schema object through the shared object store, then mount\n\t\t * CnAdvancedFormDialog. A failed schema load toasts and no-ops.\n\t\t *\n\t\t * @param {object} entry The open-form action (`register`, `schema`).\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openForm(entry) {\n\t\t\tthis.formEntry = entry\n\t\t\tthis.formSchema = null\n\t\t\tthis.formItem = null\n\t\t\tif (entry.endpoint && typeof entry.endpoint.url === 'string' && entry.endpoint.url !== '') {\n\t\t\t\tawait this.openEndpointForm(entry)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst register = entry.register || this.objectCtx.register || ''\n\t\t\tconst schema = entry.schema || ''\n\t\t\tif (!schema) {\n\t\t\t\tthis.formEntry = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\tthis.formSchema = await store.fetchSchema(type)\n\t\t\t} catch {\n\t\t\t\tthis.formSchema = null\n\t\t\t}\n\t\t\tif (!this.formSchema) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(t('nextcloud-vue', 'Could not open the form.'))\n\t\t\t\t}\n\t\t\t\tthis.formEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open an `open-form` action with an `endpoint` as an edit form over a\n\t\t * record that is not a register object (an OpenRegister organisation):\n\t\t * the fields are the action's `formProperties`, the values are read from\n\t\t * `endpoint.loadUrl` (else `endpoint.url`) at `endpoint.responsePath`,\n\t\t * and the save sends the changed fields to `endpoint.url`. A failed\n\t\t * read toasts and opens nothing.\n\t\t *\n\t\t * @param {object} entry The open-form action with `endpoint` and `formProperties`.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint\n\t\t */\n\t\tasync openEndpointForm(entry) {\n\t\t\tconst properties = entry.formProperties && typeof entry.formProperties === 'object' && !Array.isArray(entry.formProperties) ? entry.formProperties : {}\n\t\t\tif (String(entry.endpoint.method || '').toUpperCase() === 'POST') {\n\t\t\t\tthis.formSchema = { type: 'object', properties }\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst loadUrl = entry.endpoint.loadUrl || entry.endpoint.url\n\t\t\tconst record = await fetchEndpointSource({ url: loadUrl, responsePath: entry.endpoint.responsePath || '' }, this.tokenCtx, { force: true })\n\t\t\t\t.catch(() => null)\n\t\t\tif (!record || typeof record !== 'object') {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(t('nextcloud-vue', 'Could not open the form.'))\n\t\t\t\t}\n\t\t\t\tthis.formEntry = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.formItem = record\n\t\t\tthis.formSchema = { type: 'object', properties }\n\t\t},\n\n\t\t/**\n\t\t * Save an endpoint form: send the declared fields to `endpoint.url`\n\t\t * with `endpoint.method` (`PATCH` by default, or `PUT`), then toast and\n\t\t * refresh the page as an object save does.\n\t\t *\n\t\t * @param {object} entry The open-form action.\n\t\t * @param {object} formData The form's values.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint\n\t\t */\n\t\tasync saveEndpointForm(entry, formData) {\n\t\t\tconst dialog = this.$refs.formDialog\n\t\t\tconst keys = Object.keys(this.formSchema?.properties || {})\n\t\t\tconst body = Object.fromEntries(keys.filter((key) => key in formData).map((key) => [key, formData[key]]))\n\t\t\tconst verb = String(entry.endpoint.method || 'PATCH').toUpperCase()\n\t\t\tconst method = verb === 'PUT' ? 'put' : (verb === 'POST' ? 'post' : 'patch')\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = interpolateActionTarget(entry.endpoint.url, this.tokenCtx)\n\t\t\t\tconst response = await axios[method](/^https?:\\/\\//i.test(url) ? url : generateUrl(url), body)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ success: true })\n\t\t\t\t}\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showSuccess === 'function') {\n\t\t\t\t\tshowSuccess(this.tr(entry.successMessage) || t('nextcloud-vue', 'Saved.'))\n\t\t\t\t}\n\t\t\t\tconst { emit } = await import('@nextcloud/event-bus')\n\t\t\t\temit('cn:page:refresh', {})\n\t\t\t\tthis.$emit('created', response && response.data)\n\t\t\t} catch (error) {\n\t\t\t\tconst serverMessage = error && error.response && error.response.data\n\t\t\t\t\t&& (error.response.data.error || error.response.data.message)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ error: serverMessage || this.tr(entry.errorMessage) || t('nextcloud-vue', 'Save failed.') })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open (or skip) the `run-node` config dialog: GET the target node's\n\t\t * describe endpoint (`or-flow-run-node`'s `GET .../{flowId}/{nodeId}/run`),\n\t\t * and either mount `CnRunNodeDialog` with its declared fields, or —\n\t\t * for a node with none — run immediately with an empty config. A\n\t\t * failed describe call toasts and does neither (RN-4: this resolves\n\t\t * as soon as the decision is made, never waiting on the person).\n\t\t *\n\t\t * @param {object} entry The run-node action (`flowId`, `nodeId`, ...).\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-the-nodes-own-config-form-drives-the-dialog-not-a-new-token\n\t\t */\n\t\tasync openRunNode(entry) {\n\t\t\tconst flowId = entry.flowId\n\t\t\tconst nodeId = entry.nodeId\n\t\t\tif (!flowId || !nodeId) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnActionButtons] run-node requires flowId and nodeId.', entry)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// The try assigns it and the catch returns, so an initialiser here\n\t\t\t// would never be read.\n\t\t\tlet fields\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl(`/apps/openregister/api/flows/${encodeURIComponent(flowId)}/nodes/${encodeURIComponent(nodeId)}/run`)\n\t\t\t\tconst response = await axios.get(url)\n\t\t\t\tfields = Array.isArray(response.data && response.data.configForm) ? response.data.configForm : []\n\t\t\t} catch (error) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tconst serverMessage = error && error.response && error.response.data\n\t\t\t\t\t&& (error.response.data.error || error.response.data.message)\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(serverMessage || t('nextcloud-vue', 'Could not open this action.'))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!fields.length) {\n\t\t\t\t// Empty (or undeclared) form: the \"empty form is itself\n\t\t\t\t// information\" rule flow-node-config-forms already established\n\t\t\t\t// for the editor — run immediately, no dialog.\n\t\t\t\tthis.actionPending[entry.id] = true\n\t\t\t\tawait this.runNodePost(entry, {})\n\t\t\t\tthis.actionPending[entry.id] = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.runNodeFields = fields\n\t\t\tthis.runNodeEntry = entry\n\t\t},\n\n\t\t/**\n\t\t * The run-node dialog's confirm: POST the collected config, close the\n\t\t * dialog either way (success or failure both end the interaction —\n\t\t * a failure already toasted its own message).\n\t\t *\n\t\t * @param {object} config The dialog's collected field values.\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-a-run-node-action-invokes-one-flow-node-against-the-page-object\n\t\t */\n\t\tasync onRunNodeConfirm(config) {\n\t\t\tconst entry = this.runNodeEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tawait this.runNodePost(entry, config)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\tthis.closeRunNode()\n\t\t},\n\n\t\t/**\n\t\t * POST the run-node call through the shared dispatcher's `postRunNode`\n\t\t * (subject/register/schema resolution, fail-closed, toast + refresh —\n\t\t * see its own docblock in actionsDispatcher.js).\n\t\t *\n\t\t * @param {object} entry The run-node action.\n\t\t * @param {object} config The node's collected config.\n\t\t * @return {Promise<{ok: boolean}>}\n\t\t */\n\t\trunNodePost(entry, config) {\n\t\t\treturn postRunNode(entry, { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }, config)\n\t\t},\n\n\t\t/** Close the run-node dialog without running anything. */\n\t\tcloseRunNode() {\n\t\t\tthis.runNodeEntry = null\n\t\t\tthis.runNodeFields = []\n\t\t},\n\n\t\t/**\n\t\t * The create dialog's confirm: save the new object through the shared\n\t\t * object store, report the result phase, toast, refresh the page, and\n\t\t * navigate to `onSuccessRoute` when set — merging the saved object's id\n\t\t * into the route params (via `buildOnSuccessRoute`) so the navigation\n\t\t * can deep-link to the created object's detail page.\n\t\t *\n\t\t * @param {object} formData The dialog's form payload.\n\t\t * @param {object|null} [dynamic] The answers to the schema's data-driven questions (`{ answers, declarations }`), when it has any.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onFormConfirm(formData, dynamic = null) {\n\t\t\tconst entry = this.formEntry\n\t\t\tif (entry && entry.endpoint) {\n\t\t\t\tawait this.saveEndpointForm(entry, formData)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst dialog = this.$refs.formDialog\n\t\t\tconst register = this.formRegister\n\t\t\tconst schema = (entry && entry.schema) || ''\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\t// A schema can require a field the form cannot supply — a\n\t\t\t\t// server-minted foreign key, say — in which case a straight\n\t\t\t\t// saveObject 400s. `createOverride` names a registry handler\n\t\t\t\t// that owns the persist instead (the CnIndexPage precedent).\n\t\t\t\tconst override = resolveCreateOverrideHandler(\n\t\t\t\t\tentry && entry.createOverride,\n\t\t\t\t\tthis.cnRegistry,\n\t\t\t\t\tthis.cnCustomComponents,\n\t\t\t\t)\n\t\t\t\tconst payload = { ...formData }\n\t\t\t\t// Array-mode declarations fold their answers into the parent's\n\t\t\t\t// own payload, so the whole record saves in ONE write. The\n\t\t\t\t// child-record mode below cannot do that (the rows need the\n\t\t\t\t// parent's id), which is why it writes afterwards and can leave\n\t\t\t\t// answers behind if that second write fails.\n\t\t\t\tthis.foldArrayAnswers(payload, dynamic)\n\t\t\t\tconst saved = override\n\t\t\t\t\t? await override(payload, { register, schema, type })\n\t\t\t\t\t: await store.saveObject(type, payload)\n\t\t\t\tif (!saved) {\n\t\t\t\t\tthrow new Error('save rejected')\n\t\t\t\t}\n\t\t\t\tawait this.saveDynamicAnswers(store, register, dynamic, saved)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ success: true })\n\t\t\t\t}\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showSuccess === 'function') {\n\t\t\t\t\tshowSuccess((entry && entry.successMessage) || t('nextcloud-vue', 'Saved.'))\n\t\t\t\t}\n\t\t\t\tconst { emit } = await import('@nextcloud/event-bus')\n\t\t\t\temit('cn:page:refresh', {})\n\t\t\t\t/**\n\t\t\t\t * @event created Emitted after an open-form action saves. Payload: the created object.\n\t\t\t\t */\n\t\t\t\tthis.$emit('created', saved)\n\t\t\t\tif (entry && entry.onSuccessRoute && this.effectiveRouter) {\n\t\t\t\t\tconst location = buildOnSuccessRoute(entry.onSuccessRoute, saved)\n\t\t\t\t\tif (location) {\n\t\t\t\t\t\tthis.effectiveRouter.push(location).catch(() => {})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ error: (e && e.message) || t('nextcloud-vue', 'Save failed.') })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write the answers to a schema's data-driven questions, once the\n\t\t * object they belong to exists.\n\t\t *\n\t\t * This runs AFTER the parent save and deliberately does not roll it\n\t\t * back on failure: a case that exists without one of its custom values\n\t\t * is recoverable by editing it, whereas discarding a case the user\n\t\t * believes they filed is not. A failure here surfaces as the dialog's\n\t\t * error so it is never silent.\n\t\t *\n\t\t * @param {object} store The object store.\n\t\t * @param {string} register The register the object was saved in.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @param {object} saved The saved parent object.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveDynamicAnswers(store, register, dynamic, saved) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst objectId = saved && (saved.id || saved.uuid)\n\t\t\tif (!objectId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tconst values = config && config.values\n\t\t\t\tif (!values || !values.schema) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Already written as part of the parent payload.\n\t\t\t\tif (usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// An answer belongs to exactly one declaration. With a single\n\t\t\t\t// declaration every answer carries its key anyway; the filter\n\t\t\t\t// only matters once a schema has two, where writing an answer\n\t\t\t\t// to both value schemas would invent a row nobody entered.\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\tconst rows = valueRecordsFor(mine, config, objectId)\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst valueRegister = values.register || register\n\t\t\t\tconst type = resolveObjectOpType(store, { register: valueRegister, schema: values.schema })\n\t\t\t\tfor (const row of rows) {\n\t\t\t\t\tawait store.saveObject(type, row)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fold array-mode dynamic answers into the parent payload.\n\t\t *\n\t\t * @param {object} payload The parent object payload, mutated in place.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @return {void}\n\t\t */\n\t\tfoldArrayAnswers(payload, dynamic) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tif (!usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\t// Each answer goes to the array its definition is routed to\n\t\t\t\t// (`values.arrayKeyBy`), merged over what that array holds.\n\t\t\t\tfor (const [arrayKey, subset] of Object.entries(answersByArrayKey(mine, config, dynamic.definitions || []))) {\n\t\t\t\t\tconst entries = mergeValueArray(payload[arrayKey], subset, config, dynamic.definitions || [])\n\t\t\t\t\tif (entries.length || Array.isArray(payload[arrayKey])) {\n\t\t\t\t\t\tpayload[arrayKey] = entries\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close the create dialog.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcloseForm() {\n\t\t\tthis.formEntry = null\n\t\t\tthis.formSchema = null\n\t\t\tthis.formItem = null\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* A red action that does not shout: white, a red border and red text. */\n.cn-action-buttons__button--error-outline {\n\tborder-color: var(--color-error-text, #a30000) !important;\n\tcolor: var(--color-error-text, #a30000) !important;\n\tbackground-color: var(--color-main-background) !important;\n}\n\n.cn-action-buttons__button--error-outline:hover:not(:disabled) {\n\tbackground-color: var(--color-error-hover, #fcedec) !important;\n}\n\n.cn-action-buttons {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tflex-wrap: wrap;\n}\n\n/* In menu mode the only children are dialogs, so the wrapper must not be a\n box: an empty inline-flex child still eats one of the header's flex gaps\n and pushes the Actions menu away from the Edit button beside it. */\n.cn-action-buttons--menu {\n\tdisplay: contents;\n}\n</style>\n"],"names":["_normalizeClass","_createElementBlock","_Fragment","_renderList","_createBlock","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;SAYO,EAAAA,cAAA,CAAA,CAAC,mBAAmB,EAAA,EAAA,yBAAA,EACY,MAAO,CAAA,OAAA,KAAA,MAAA,EAAA,CAAA,CAAA;AACvC,IAAA,aAAM,EAAC,mBAAoB;;sBAS9BC,kBAoGS,CAAAC,QAAA,EAAA,IAAA,EAAAC,UAAA,CApGK,QAAA,CAAA,UAAA,EAAA,CAAA,KAAA,KAAA;;AAIR,QAAA,CAAA,KAAK,CAAC,IAAI,KAAA,QAAA;0BADhBC,WAaU,CAAA,mBAAA,EAAA;cAXT,GAAG,EAAE,KAAK,CAAC,EAAE;AACb,cAAA,OAAO,EAAE,KAAA,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A,CAAA,EAAA,CAAA,KAAA,CAAA,YAAA,CAAA,KAAA,CAAA;AACtB,UAAA,MAAE,EAAA,KAAA,CAAA,aAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnActionButtons.vue3.js","sources":["../../../../src/components/CnActionButtons/CnActionButtons.vue?vue&type=template&id=e8317daa&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-action-buttons\"\n\t\t:class=\"{ 'cn-action-buttons--menu': display === 'menu' }\"\n\t\tdata-testid=\"cn-action-buttons\">\n\t\t<!-- `display: \"menu\"` keeps every dialog below but renders no buttons of\n\t\t its own: the host draws the entries as NcActionButtons inside an\n\t\t overflow menu instead, driven by the `entries` event. NcActions\n\t\t keeps only NcAction* vnodes out of its default slot, so this\n\t\t component cannot be placed in the menu itself.\n\t\t That mode is enforced in `barActions` / `overflowActions`, which\n\t\t both answer empty for it — so `inline` only means anything while\n\t\t this component is the one drawing. -->\n\t\t<template v-for=\"entry in barActions\">\n\t\t\t<!-- Toggle: a stateful two-way state button (GET on mount, write on\n\t\t\t click, optimistic + revert). Rendered inline, never dispatched. -->\n\t\t\t<NcButton\n\t\t\t\tv-if=\"entry.type === 'toggle'\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"toggleState[entry.id] ? 'primary' : 'secondary'\"\n\t\t\t\t:disabled=\"Boolean(togglePending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-toggle-${entry.id}`\"\n\t\t\t\t:aria-pressed=\"String(Boolean(toggleState[entry.id]))\"\n\t\t\t\t@click=\"onToggleClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(toggleState[entry.id] ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label)) }}\n\t\t\t</NcButton>\n\t\t\t<!-- An entry that goes to a URL is a LINK, not a button that calls\n\t\t\t the browser. NcButton renders an anchor when given `href`, so it\n\t\t\t keeps the cluster's styling while the browser supplies the\n\t\t\t pointer, the focus ring, middle-click and \"open in new tab\" —\n\t\t\t none of which a click handler can offer. -->\n\t\t\t<NcButton\n\t\t\t\tv-else-if=\"entry.href\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"buttonVariant(entry)\"\n\t\t\t\t:class=\"buttonClass(entry)\"\n\t\t\t\t:href=\"entry.href\"\n\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Everything else: a plain action button routed through the shared\n\t\t\t dispatcher (api-call / open-form / navigate / open-modal / refresh),\n\t\t\t confirm-gated first when the action asks for it. -->\n\t\t\t<!-- `variant`, NOT `type`. NcButton carries both: `type` is the\n\t\t\t native button type (default \"button\") and `variant` is the\n\t\t\t styling. Binding the descriptor's variant to `type` set an\n\t\t\t invalid native type and left `variant` at its \"secondary\"\n\t\t\t default, so `variant: \"primary\"` / `\"error\"` had never once\n\t\t\t rendered — silently, since an unknown native type is ignored. -->\n\t\t\t<NcButton\n\t\t\t\tv-else\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"buttonVariant(entry)\"\n\t\t\t\t:class=\"buttonClass(entry)\"\n\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Sub-actions. Its OWN chevron rather than entries folded into the\n\t\t\t overflow below, because NcActions cannot nest — and a grouped\n\t\t\t dropdown is the point of declaring children (a version list\n\t\t\t flattened into the page's one menu grows without bound). The\n\t\t\t parent's own button above still renders alongside this chevron —\n\t\t\t a parent meant only to group children needs a real `handler` (or\n\t\t\t `href`/other type) of its own, or its button dispatches nothing. -->\n\t\t\t<NcActions\n\t\t\t\tv-if=\"hasChildren(entry)\"\n\t\t\t\t:key=\"`${entry.id}-children`\"\n\t\t\t\t:menuName=\"childMenuName(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-children-${entry.id}`\">\n\t\t\t\t<template v-for=\"child in visibleChildren(entry)\">\n\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\tv-if=\"child.href\"\n\t\t\t\t\t\t:key=\"`${child.id}-link`\"\n\t\t\t\t\t\t:href=\"child.href\"\n\t\t\t\t\t\t:target=\"linkTargetOf(child)\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onLinkClick(child, $event)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:key=\"child.id\"\n\t\t\t\t\t\t:disabled=\"Boolean(actionPending[child.id])\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onActionClick(child)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcActions>\n\t\t</template>\n\n\t\t<!-- Overflow. Only ever rendered when `inline` is set, so a consumer\n\t\t that never asked for a limit keeps every action as a button. -->\n\t\t<NcActions\n\t\t\tv-if=\"overflowActions.length > 0\"\n\t\t\t:menuName=\"overflowOnly ? undefined : overflowMenuName\"\n\t\t\t:aria-label=\"overflowOnly ? overflowTriggerLabel : undefined\"\n\t\t\t:forceMenu=\"true\"\n\t\t\tdata-testid=\"cn-action-buttons-overflow\">\n\t\t\t<template v-for=\"entry in overflowActions\">\n\t\t\t\t<NcActionLink\n\t\t\t\t\tv-if=\"entry.href\"\n\t\t\t\t\t:key=\"`${entry.id}-link`\"\n\t\t\t\t\t:href=\"entry.href\"\n\t\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionLink>\n\t\t\t\t<NcActionButton\n\t\t\t\t\tv-else\n\t\t\t\t\t:key=\"entry.id\"\n\t\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionButton>\n\t\t\t</template>\n\t\t</NcActions>\n\n\t\t<!-- Confirm gate for a confirm:true action (reuses CnConfirmDialog). -->\n\t\t<CnConfirmDialog\n\t\t\tv-if=\"confirmEntry\"\n\t\t\tref=\"confirmDialog\"\n\t\t\t:dialogTitle=\"tr(confirmEntry.confirmTitle || confirmEntry.label)\"\n\t\t\t:message=\"tr(confirmEntry.confirmMessage) || defaultConfirmMessage\"\n\t\t\t:variant=\"confirmEntry.variant === 'error' ? 'error' : 'primary'\"\n\t\t\tv-bind=\"confirmButtonProps\"\n\t\t\t@confirm=\"onConfirmProceed\"\n\t\t\t@close=\"confirmEntry = null\" />\n\n\t\t<!-- Schema-driven create dialog for an open-form action. The plain\n\t\t form is the default: the properties/JSON table is a power-user\n\t\t surface, and a header button that says \"New case\" is aimed at\n\t\t someone filing one, not at someone inspecting the schema. Set\n\t\t `advanced: true` on the action to get the table back. -->\n\t\t<CnFormDialog\n\t\t\tv-if=\"formEntry && formSchema && !formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"formItem\"\n\t\t\t:register=\"formRegister\"\n\t\t\t:initialData=\"formInitialValues || {}\"\n\t\t\t:dialogTitle=\"tr(formEntry.formTitle) || ''\"\n\t\t\t:eyebrow=\"tr(formEntry.formEyebrow) || ''\"\n\t\t\t:subtitle=\"tr(formEntry.formSubtitle) || ''\"\n\t\t\t:confirmLabel=\"tr(formEntry.formConfirmLabel) || ''\"\n\t\t\t:includeFields=\"formEntry.includeFields || null\"\n\t\t\t:excludeFields=\"formEntry.excludeFields || []\"\n\t\t\t:fieldOverrides=\"formEntry.fieldOverrides || {}\"\n\t\t\t:size=\"formEntry.size || 'normal'\"\n\t\t\t:columns=\"formEntry.columns || 1\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\t\t<CnAdvancedFormDialog\n\t\t\tv-if=\"formEntry && formSchema && formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"null\"\n\t\t\t:initialValues=\"formInitialValues\"\n\t\t\t:confirmLabel=\"tr(formEntry.formConfirmLabel) || ''\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\n\t\t<!-- run-node's config dialog (manifest-run-node-action): only mounted\n\t\t when the target node declared at least one field AND that\n\t\t describe call succeeded — an empty/no form runs immediately with\n\t\t no dialog at all (openRunNode below), and a describe FAILURE also\n\t\t skips the dialog (toasts instead) rather than showing an empty,\n\t\t confusing one. -->\n\t\t<CnRunNodeDialog\n\t\t\tv-if=\"runNodeEntry && runNodeFields.length\"\n\t\t\t:title=\"tr(runNodeEntry.formTitle) || tr(runNodeEntry.label)\"\n\t\t\t:fields=\"runNodeFields\"\n\t\t\t:loading=\"Boolean(actionPending[runNodeEntry.id])\"\n\t\t\t:translate=\"effectiveTranslate\"\n\t\t\t@confirm=\"onRunNodeConfirm\"\n\t\t\t@close=\"closeRunNode\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionLink, NcActions, NcButton } from '@nextcloud/vue'\nimport { inject } from 'vue'\nimport CnConfirmDialog from '../../dialogs/CnConfirmDialog.vue'\nimport CnRunNodeDialog from '../../dialogs/CnRunNodeDialog.vue'\nimport { fetchEndpointSource } from '../../composables/useEndpointSource.js'\nimport { useObjectStore } from '../../store/useObjectStore.js'\nimport { actionLink, buildOnSuccessRoute, dispatchAction, interpolateActionTarget, isExternalActionTarget, postRunNode, resolveCreateOverrideHandler, resolveObjectOpType } from '../../utils/actionsDispatcher.js'\nimport { resolveObjectTokenContext } from '../../utils/detailObjectContext.js'\nimport { answersByArrayKey, mergeValueArray, usesArrayValues, valueRecordsFor } from '../../utils/dynamicProperties.js'\nimport { followLinkClick } from '../../utils/linkNavigation.js'\nimport { resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { evaluateVisibleWhen } from '../../utils/visibleWhen.js'\nimport { CnAdvancedFormDialog } from '../CnAdvancedFormDialog/index.js'\nimport { CnFormDialog } from '../CnFormDialog/index.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\n/**\n * CnActionButtons — declarative header-actions surface (#91 Wave 3).\n *\n * Renders a page's `headerActions[]` as buttons and owns the two action\n * behaviours that need STATE or a DIALOG the one-shot `dispatchAction`\n * can't provide on its own:\n *\n * - **`open-form`** — mounts the shared `CnAdvancedFormDialog` for the\n * action's `schema` (fetched through the object store), saves on\n * confirm, toasts, refreshes the page, and optionally navigates to\n * `onSuccessRoute`. Two optional keys cover the schemas a bare create\n * cannot satisfy: `props` seeds fixed field values into the create form\n * (so one schema can back several buttons, each fixing its own\n * discriminator), and `createOverride` names a registry handler that owns\n * the persist instead of `objectStore.saveObject` (for a schema requiring\n * a server-minted field the form cannot supply). `includeFields` /\n * `excludeFields` / `fieldOverrides` narrow what the button asks for, which\n * is how one schema serves both a full editor and a quick-create button.\n * `advanced: true` swaps in the properties/JSON table for a power user.\n * With `endpoint: { url, method?, loadUrl?, responsePath? }` and\n * `formProperties` (JSON-schema properties) it edits a record that is not a\n * register object instead: it reads the record from the endpoint, shows the\n * declared fields filled in, and sends them back with PATCH (or PUT). With\n * `method: \"POST\"` it creates one: an empty form, posted to the endpoint.\n * - **`toggle`** — a two-way state button: `GET`s `stateSource` on mount,\n * renders `labelOn` / `labelOff`, and on click `writes` the flipped\n * value OPTIMISTICALLY, reverting on failure.\n * - **`run-node`** (manifest-run-node-action) — GETs the target flow node's\n * describe endpoint (OpenRegister's `or-flow-run-node`); a node with\n * declared fields mounts `CnRunNodeDialog` (its own small field renderer —\n * see that component's docblock for why it is not `CnFlowNodeEditModal`'s),\n * a node with none runs immediately. Either way `postRunNode()`\n * (`actionsDispatcher.js`) makes the actual call, subject-token-resolved\n * exactly like `agent`.\n *\n * Every other type (`api-call`, `navigate`, `open-modal`, `open-page`,\n * `refresh`, `handler`) routes through the shared `dispatchAction` — with\n * a `CnConfirmDialog` gate first when the action sets `confirm: true`\n * (the object-op precedent: the dispatcher runs AFTER confirmation).\n *\n * Each action may carry a `visibleWhen` predicate (the shared banner\n * shape — `{ endpoint | source | field, op, value }`) evaluated against\n * the page / object context; a hidden action simply doesn't render.\n *\n * Placement: CnDashboardPage / CnDetailPage / CnPageRenderer mount this in\n * their header-actions area, passing the page's `headerActions[]`. The\n * object context (`{ objectId, object, register, schema }`) and the page\n * workspace / app-config bags are injected so tokens + local `visibleWhen`\n * resolve against the current record and page state.\n *\n * ```json\n * \"headerActions\": [\n * { \"id\": \"new-lead\", \"label\": \"New lead\", \"type\": \"open-form\",\n * \"register\": \"crm\", \"schema\": \"lead\", \"onSuccessRoute\": \"Leads\", \"variant\": \"primary\" },\n * { \"id\": \"approve\", \"label\": \"Approve\", \"type\": \"api-call\",\n * \"url\": \"/apps/shillinq/api/payment-runs/@objectId/approve\", \"confirm\": true,\n * \"visibleWhen\": { \"field\": \"state\", \"op\": \"eq\", \"value\": \"pending\" } },\n * { \"id\": \"toggle-open\", \"type\": \"toggle\", \"labelOn\": \"Open\", \"labelOff\": \"Closed\",\n * \"stateSource\": { \"url\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"responsePath\": \"open\" },\n * \"field\": \"open\", \"writeUrl\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"method\": \"PUT\" }\n * ]\n * ```\n */\nexport default {\n\tname: 'CnActionButtons',\n\n\tcomponents: { NcActions, NcActionButton, NcActionLink, NcButton, CnIcon, CnConfirmDialog, CnFormDialog, CnAdvancedFormDialog, CnRunNodeDialog },\n\n\tinject: {\n\t\t/** Detail-page object context (`{ objectId, object, register, schema }`). */\n\t\tcnObjectContext: { default: null },\n\t\t/** v2 slot-grid detail context holder (CnPageRenderer). */\n\t\tcnDetailObjectContext: { default: null },\n\t\t/** Page-level workspace context bag (reactive). */\n\t\tcnWorkspaceContext: { default: () => ({}) },\n\t\t/** Page-level app config bag (reactive). */\n\t\tcnAppConfig: { default: () => ({}) },\n\t\t/** Pre-bound dispatchAction from CnPageRenderer (router/registry/handlers/openModal wired). */\n\t\tcnDispatchAction: { default: null },\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored action labels, confirm copy and api-call toasts\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** v2 component registry, for resolving an `open-form` createOverride. */\n\t\tcnRegistry: { default: () => ({}) },\n\t\t/** Legacy customComponents map, same resolution fallback. */\n\t\tcnCustomComponents: { default: () => ({}) },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The page's declarative header actions. Each entry is a typed action\n\t\t * (`open-form` | `toggle` | `api-call` | `navigate` | `open-modal` |\n\t\t * `refresh` | `handler`) plus `id` / `label` and an optional\n\t\t * `visibleWhen` predicate, `icon`, `variant`, and `confirm`.\n\t\t *\n\t\t * An entry carrying `href` (with optional `target`) renders as a real\n\t\t * link instead — an anchor in the bar, an NcActionLink in a menu — and\n\t\t * is never dispatched. Use it for anything that ends in a URL, so the\n\t\t * browser keeps middle-click, \"open in new tab\" and the link semantics\n\t\t * assistive tech announces.\n\t\t *\n\t\t * `href` is used as given, so it must be a finished URL. A manifest\n\t\t * `headerActions[]` entry may carry `href` too: the page (CnDetailPage,\n\t\t * CnDashboardPage) resolves an instance path through `generateUrl()`\n\t\t * and sets `target` before the entry reaches this component.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tactions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * How many collapsible actions stay as buttons; the rest fall into a\n\t\t * single `···` overflow menu.\n\t\t *\n\t\t * `0` (the default) renders EVERY action as a button, which is what\n\t\t * every existing consumer already gets — the overflow only ever\n\t\t * appears once a host asks for a limit.\n\t\t *\n\t\t * A `variant: \"primary\"` action, an action carrying `children`, and a\n\t\t * `toggle` are never collapsed and never consume one of the N slots:\n\t\t * NcActions paints all of its inline actions with one shared variant\n\t\t * (so a lone primary among them is not expressible), it cannot nest\n\t\t * another NcActions, and a toggle's state lives in its button.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tinline: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow menu. Empty falls back to a translated\n\t\t * \"Actions\".\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\toverflowLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Every collapsible action in the `···` menu, none as a button: the\n\t\t * trigger is icon only and named by `overflowAriaLabel` (a card's\n\t\t * \"Actions for Volledigheid toetsen\").\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\toverflowOnly: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The accessible name of the icon-only trigger under `overflowOnly`.\n\t\t * Empty falls back to the overflow label.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\toverflowAriaLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Explicit Vue Router instance for `navigate` / `open-page` /\n\t\t * `onSuccessRoute`. Falls back to `this.$router`. Only needed for\n\t\t * standalone mounts outside a router tree.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\trouter: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where the actions are drawn. `buttons` (the default) puts one\n\t\t * NcButton per action in the host's header. `menu` draws none and\n\t\t * emits `entries` instead, so the host can render them inside an\n\t\t * overflow menu while this component keeps owning the dialogs.\n\t\t *\n\t\t * @type {'buttons'|'menu'}\n\t\t */\n\t\tdisplay: {\n\t\t\ttype: String,\n\t\t\tdefault: 'buttons',\n\t\t\tvalidator: (v) => ['buttons', 'menu'].includes(v),\n\t\t},\n\t},\n\n\temits: ['created', 'entries'],\n\n\tsetup() {\n\t\t// Read the two detail-surface injects once so the object token context\n\t\t// resolves identically to the endpoint-bound widgets (Wave 3).\n\t\tconst objectCtxRaw = inject('cnObjectContext', null)\n\t\tconst detailCtxRaw = inject('cnDetailObjectContext', null)\n\t\tconst workspaceRaw = inject('cnWorkspaceContext', null)\n\t\tconst appConfigRaw = inject('cnAppConfig', null)\n\t\treturn { objectCtxRaw, detailCtxRaw, workspaceRaw, appConfigRaw }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Evaluated visibleWhen outcome per action id (true when no predicate). */\n\t\t\tvisibility: {},\n\t\t\t/** Current boolean state per toggle action id. */\n\t\t\ttoggleState: {},\n\t\t\t/** In-flight flag per toggle action id (disables the button). */\n\t\t\ttogglePending: {},\n\t\t\t/** In-flight flag per non-toggle action id. */\n\t\t\tactionPending: {},\n\t\t\t/** The action awaiting confirmation (null = no dialog). */\n\t\t\tconfirmEntry: null,\n\t\t\t/** The open-form action currently showing its dialog (null = closed). */\n\t\t\tformEntry: null,\n\t\t\t/** The fetched schema object for the open-form dialog (null until loaded). */\n\t\t\tformSchema: null,\n\t\t\t/** The record an endpoint form edits (null for a create form). */\n\t\t\tformItem: null,\n\t\t\t/** The run-node action currently in flight / showing its dialog (null = closed). */\n\t\t\trunNodeEntry: null,\n\t\t\t/** The target node's declared config-form fields, from the describe GET. */\n\t\t\trunNodeFields: [],\n\t\t\t/** Default confirm-dialog message. */\n\t\t\tdefaultConfirmMessage: t('nextcloud-vue', 'Are you sure you want to continue?'),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The confirm button's words and icon from the action\n\t\t * (`confirmLabel`, `confirmIcon`); none set leaves the dialog's own.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tconfirmButtonProps() {\n\t\t\tconst entry = this.confirmEntry || {}\n\t\t\treturn {\n\t\t\t\t...(typeof entry.confirmLabel === 'string' && entry.confirmLabel !== '' ? { confirmLabel: this.tr(entry.confirmLabel) } : {}),\n\t\t\t\t...(typeof entry.confirmIcon === 'string' && entry.confirmIcon !== '' ? { confirmIcon: entry.confirmIcon } : {}),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/**\n\t\t * Create-form seed values for the open `open-form` action. An action\n\t\t * declares them as `props`, which is how a single schema backs several\n\t\t * buttons — \"New request\" and \"New complaint\" both open the `ticket`\n\t\t * form, each fixing its own `ticketType`.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tformInitialValues() {\n\t\t\tconst props = this.formEntry && this.formEntry.props\n\t\t\tif (!props || typeof props !== 'object' || Array.isArray(props)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\t// Seed values go through the SAME token grammar as filters, so an\n\t\t\t// action on a detail page can stamp the record it belongs to:\n\t\t\t// `{ \"domainObjectRef\": \"@objectId\" }`. Without this the literal\n\t\t\t// string \"@objectId\" is saved, and a foreign key pointing at nothing\n\t\t\t// is a defect that only shows up in whatever reads it later.\n\t\t\treturn resolveFilterTokens(props, this.tokenCtx)\n\t\t},\n\n\t\t/**\n\t\t * The register the open dialog reads and writes against. The plain\n\t\t * form needs it to resolve `$ref` pickers into real dropdowns; without\n\t\t * one a reference field renders as an empty select and the action is\n\t\t * unusable for exactly the schemas that need it most.\n\t\t *\n\t\t * @return {string} The register slug, '' when none is resolvable.\n\t\t */\n\t\tformRegister() {\n\t\t\treturn (this.formEntry && this.formEntry.register) || this.objectCtx.register || ''\n\t\t},\n\n\t\t/**\n\t\t * The actions whose visibleWhen evaluated true (or carry no predicate).\n\t\t *\n\t\t * A `navigate` action whose target leaves the app is turned into a link\n\t\t * entry here, so it takes the `href` branch above instead of being\n\t\t * dispatched. An absolute URL is not a route: pushing one at the router\n\t\t * matched nothing and landed on the fallback page, carrying the URL's\n\t\t * own query string with it. The action's `target` (the URL) is replaced\n\t\t * by the anchor's `target`, since the two fields share a name and the\n\t\t * URL now lives in `href`. An author's explicit `href` still wins.\n\t\t *\n\t\t * An in-app `navigate` or `open-page` becomes a link too (see\n\t\t * `toLinkEntry`), keeping its own `target` so a fallback dispatch works.\n\t\t */\n\t\tvisibleActions() {\n\t\t\treturn (this.actions || [])\n\t\t\t\t.filter((a) => a && a.id && this.visibility[a.id] !== false)\n\t\t\t\t.map((a) => this.toLinkEntry(a))\n\t\t},\n\n\t\t/**\n\t\t * The actions rendered in the bar itself: every non-collapsible one,\n\t\t * plus the first `inline` collapsible ones. Declaration order is kept,\n\t\t * so promoting an action never reshuffles the row.\n\t\t *\n\t\t * Empty in `display: \"menu\"` — the host draws the entries itself there,\n\t\t * so this component renders no buttons and has nothing to cap.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as buttons / chevrons.\n\t\t */\n\t\tbarActions() {\n\t\t\tif (this.display === 'menu') {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.overflowOnly) {\n\t\t\t\treturn this.visibleActions.filter((a) => !this.isCollapsible(a))\n\t\t\t}\n\t\t\tif (!(this.inline > 0)) {\n\t\t\t\treturn this.visibleActions\n\t\t\t}\n\t\t\tconst promoted = new Set(this.visibleActions\n\t\t\t\t.filter((a) => this.isCollapsible(a))\n\t\t\t\t.slice(0, this.inline)\n\t\t\t\t.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !this.isCollapsible(a) || promoted.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * The actions that did not fit, for the `···` menu. Always empty while\n\t\t * `inline` is 0, and in `display: \"menu\"` where the host owns the menu.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as menu items.\n\t\t */\n\t\toverflowActions() {\n\t\t\tif (this.display === 'menu' || !(this.inline > 0 || this.overflowOnly)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst shown = new Set(this.barActions.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !shown.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow trigger.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\toverflowMenuName() {\n\t\t\treturn this.tr(this.overflowLabel) || t('nextcloud-vue', 'Actions')\n\t\t},\n\n\t\t/**\n\t\t * Name of the icon-only trigger under `overflowOnly`.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\toverflowTriggerLabel() {\n\t\t\treturn this.overflowAriaLabel || this.overflowMenuName\n\t\t},\n\n\t\t/**\n\t\t * The visible actions flattened for a host that draws them as menu\n\t\t * items. Everything the item needs to render is resolved here — the\n\t\t * translated label a toggle currently shows, its pressed state, its\n\t\t * pending flag, and which of the two icon shapes applies — so the host\n\t\t * template stays a plain v-for and needs none of this component's\n\t\t * state. `run()` is pre-bound, the way CnIndexPage pre-binds a header\n\t\t * action's handler for the index bar, so the host dispatches without\n\t\t * reaching back through a ref.\n\t\t *\n\t\t * @return {Array<object>} One menu-ready descriptor per visible action.\n\t\t */\n\t\tmenuEntries() {\n\t\t\treturn this.visibleActions.map((entry) => {\n\t\t\t\tconst isToggle = entry.type === 'toggle'\n\t\t\t\tconst on = Boolean(this.toggleState[entry.id])\n\t\t\t\tconst label = isToggle\n\t\t\t\t\t? (on ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label))\n\t\t\t\t\t: entry.label\n\t\t\t\treturn {\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tlabel: this.tr(label),\n\t\t\t\t\t// An mdi name goes to CnIcon; a legacy `icon-*` class goes\n\t\t\t\t\t// on a bare span. Deciding it here keeps isMdiIconName from\n\t\t\t\t\t// having to be duplicated into every host.\n\t\t\t\t\ticonName: this.isMdiIconName(entry.icon) ? entry.icon : '',\n\t\t\t\t\ticonClass: (entry.icon && !this.isMdiIconName(entry.icon)) ? entry.icon : '',\n\t\t\t\t\tdisabled: Boolean(isToggle ? this.togglePending[entry.id] : this.actionPending[entry.id]),\n\t\t\t\t\t// null, not false: a non-toggle carries no pressed state at\n\t\t\t\t\t// all, and `aria-pressed=\"false\"` would announce every\n\t\t\t\t\t// action as an un-pressed toggle button.\n\t\t\t\t\tpressed: isToggle ? on : null,\n\t\t\t\t\ttestid: isToggle ? `cn-action-toggle-${entry.id}` : `cn-action-${entry.id}`,\n\t\t\t\t\t// A link entry, for a host to render as an anchor rather\n\t\t\t\t\t// than a button with a click handler. Named `linkTarget`\n\t\t\t\t\t// because an action's own `target` is its destination. An in-app\n\t\t\t\t\t// link (`linkTo`) is left to `run()`: a host anchor has no router.\n\t\t\t\t\thref: (!entry.linkTo && entry.href) || '',\n\t\t\t\t\tlinkTarget: (!entry.linkTo && entry.href) ? (entry.target || '_blank') : '',\n\t\t\t\t\trun: () => (isToggle ? this.onToggleClick(entry) : this.onActionClick(entry)),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** Unwrapped page workspace bag. */\n\t\tworkspaceCtx() {\n\t\t\tconst c = this.workspaceRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** Unwrapped app-config bag. */\n\t\tconfigCtx() {\n\t\t\tconst c = this.appConfigRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** The merged object token context (both detail-surface injects). */\n\t\tobjectCtx() {\n\t\t\treturn resolveObjectTokenContext(this.objectCtxRaw, this.detailCtxRaw) || {}\n\t\t},\n\n\t\t/** The full token context for url/param interpolation + local visibleWhen. */\n\t\ttokenCtx() {\n\t\t\treturn {\n\t\t\t\t...this.objectCtx,\n\t\t\t\tworkspace: this.workspaceCtx,\n\t\t\t\tconfig: this.configCtx,\n\t\t\t}\n\t\t},\n\n\t\t/** The effective router (explicit prop wins, else this.$router). */\n\t\teffectiveRouter() {\n\t\t\treturn this.router || this.$router || null\n\t\t},\n\t},\n\n\twatch: {\n\t\tactions: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.evaluateVisibility()\n\t\t\t\tthis.initToggles()\n\t\t\t},\n\t\t},\n\n\t\t// Re-evaluate local (object-context) visibleWhen when the record loads.\n\t\tobjectCtx: {\n\t\t\tdeep: true,\n\t\t\thandler() { this.evaluateVisibility() },\n\t\t},\n\n\t\t// A workspace condition (`{ workspace: \"callActive\" }`) follows the\n\t\t// page's workspace, which a page control or a call may change after mount.\n\t\tworkspaceCtx: {\n\t\t\tdeep: true,\n\t\t\thandler() { this.evaluateVisibility() },\n\t\t},\n\n\t\t// Push the menu-ready descriptors at a `display: \"menu\"` host. It fires\n\t\t// immediately so the host has the list on first paint, and again on\n\t\t// every change of visibility, toggle state or pending flag — the three\n\t\t// things that would otherwise leave a stale item in an open menu.\n\t\tmenuEntries: {\n\t\t\timmediate: true,\n\t\t\thandler(entries) {\n\t\t\t\tif (this.display === 'menu') {\n\t\t\t\t\t/**\n\t\t\t\t\t * @event entries Emitted in `display: \"menu\"` only, whenever the visible actions, their toggle state or their pending flags change. Payload: one menu-ready descriptor per visible action, each carrying `id`, `label`, `iconName`, `iconClass`, `disabled`, `pressed`, `testid` and a pre-bound `run()`.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('entries', entries)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The NcButton variant of an entry. `error-outline` and `tonal` are\n\t\t * not NcButton variants: `error-outline` is a secondary button that\n\t\t * `buttonClass` outlines in red, `tonal` a tertiary one that\n\t\t * `buttonClass` draws as the tonal pill.\n\t\t *\n\t\t * @param {object} entry The action entry.\n\t\t * @return {string} The variant.\n\t\t * @spec openspec/changes/action-error-outline/specs/action-buttons/spec.md#requirement-an-action-can-be-an-outlined-red-button\n\t\t */\n\t\tbuttonVariant(entry) {\n\t\t\tif (!entry.variant || entry.variant === 'error-outline') {\n\t\t\t\treturn 'secondary'\n\t\t\t}\n\t\t\tif (entry.variant === 'tonal') {\n\t\t\t\treturn 'tertiary'\n\t\t\t}\n\t\t\treturn entry.variant\n\t\t},\n\n\t\t/**\n\t\t * The extra class of an entry's button: the red outline for\n\t\t * `variant: \"error-outline\"`, the tonal pill for `variant: \"tonal\"`.\n\t\t *\n\t\t * @param {object} entry The action entry.\n\t\t * @return {object} The class map.\n\t\t * @spec openspec/changes/action-error-outline/specs/action-buttons/spec.md#requirement-an-action-can-be-an-outlined-red-button\n\t\t */\n\t\tbuttonClass(entry) {\n\t\t\treturn {\n\t\t\t\t'cn-action-buttons__button--error-outline': entry.variant === 'error-outline',\n\t\t\t\t'cn-button--tonal': entry.variant === 'tonal',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Heuristic MDI-name check (an `icon-`-prefixed string is a CSS class).\n\t\t *\n\t\t * @param {string} name The icon string.\n\t\t * @return {boolean} True when it should render via CnIcon.\n\t\t */\n\t\tisMdiIconName(name) {\n\t\t\treturn typeof name === 'string' && name !== '' && !name.startsWith('icon-')\n\t\t},\n\n\t\t/**\n\t\t * Evaluate every action's `visibleWhen` against the current context.\n\t\t * Fail-safe (a broken predicate hides its action); actions without a\n\t\t * predicate are always visible.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync evaluateVisibility() {\n\t\t\t// Children are walked too: a sub-action whose predicate was never\n\t\t\t// evaluated would read as visible and render regardless.\n\t\t\tconst flat = []\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tflat.push(action)\n\t\t\t\tif (Array.isArray(action.children)) {\n\t\t\t\t\tflat.push(...action.children.filter((c) => c && c.id))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const action of flat) {\n\t\t\t\tif (!action.visibleWhen) {\n\t\t\t\t\tthis.visibility[action.id] = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst ok = await evaluateVisibleWhen(action.visibleWhen, this.tokenCtx)\n\t\t\t\tthis.visibility[action.id] = ok\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Seed each toggle action's state from its `stateSource` endpoint\n\t\t * (fetched through the shared endpoint engine so `@objectId` etc.\n\t\t * resolve). No-op for non-toggle actions.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync initToggles() {\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || action.type !== 'toggle' || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tthis.toggleState[action.id] = false\n\t\t\t\tif (!action.stateSource || !action.stateSource.url) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await fetchEndpointSource(action.stateSource, this.tokenCtx)\n\t\t\t\t\tconst value = action.field ? this.readField(payload, action.field) : payload\n\t\t\t\t\tthis.toggleState[action.id] = Boolean(value)\n\t\t\t\t} catch {\n\t\t\t\t\t// Leave the default (off); a failed state read never breaks the bar.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether an action may be pushed into the overflow menu. See the\n\t\t * `inline` prop for why these three shapes never can be.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it can collapse.\n\t\t */\n\t\tisCollapsible(entry) {\n\t\t\treturn !this.hasChildren(entry)\n\t\t\t\t&& entry.variant !== 'primary'\n\t\t\t\t&& entry.type !== 'toggle'\n\t\t},\n\n\t\t/**\n\t\t * Whether an action declares sub-actions worth a chevron.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it has at least one visible child.\n\t\t */\n\t\thasChildren(entry) {\n\t\t\treturn this.visibleChildren(entry).length > 0\n\t\t},\n\n\t\t/**\n\t\t * An action's sub-actions, minus any hidden by `visibleWhen`.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {Array<object>} The renderable children.\n\t\t */\n\t\tvisibleChildren(entry) {\n\t\t\tif (!Array.isArray(entry?.children)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn entry.children\n\t\t\t\t.filter((c) => c && c.id && this.visibility[c.id] !== false)\n\t\t\t\t.map((c) => this.toLinkEntry(c))\n\t\t},\n\n\t\t/**\n\t\t * Give a navigating action the `href` it renders as. An external\n\t\t * `navigate` target becomes the href with a `_blank` anchor target. An\n\t\t * in-app `navigate` / `open-page` gets the router-resolved href plus\n\t\t * `linkTo`, the location a plain click routes to; one with `confirm`,\n\t\t * an `onSelect` function, or an unresolvable route stays a button.\n\t\t *\n\t\t * @param {object} a The action descriptor.\n\t\t * @return {object} The descriptor, possibly with `href` / `linkTo` added.\n\t\t */\n\t\ttoLinkEntry(a) {\n\t\t\tif (a.href || (a.type !== 'navigate' && a.type !== 'open-page')) {\n\t\t\t\treturn a\n\t\t\t}\n\t\t\tlet entry = a\n\t\t\tif (a.type === 'navigate') {\n\t\t\t\t// Interpolated BEFORE the external test and before it becomes an\n\t\t\t\t// href, so the anchor carries the record's id rather than the token.\n\t\t\t\tconst target = interpolateActionTarget(a.target, this.tokenCtx)\n\t\t\t\tif (isExternalActionTarget(target)) {\n\t\t\t\t\treturn { ...a, href: target, target: '_blank' }\n\t\t\t\t}\n\t\t\t\tentry = target === a.target ? a : { ...a, target }\n\t\t\t}\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\treturn entry\n\t\t\t}\n\t\t\tconst link = actionLink(entry, { router: this.effectiveRouter })\n\t\t\treturn link ? { ...entry, href: link.href, linkTo: link.to } : entry\n\t\t},\n\n\t\t/**\n\t\t * The anchor `target` of a link entry. An in-app link opens in place;\n\t\t * its own `target` is the destination, not an anchor target.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @return {string|undefined} The anchor target.\n\t\t */\n\t\tlinkTargetOf(entry) {\n\t\t\treturn entry.linkTo ? undefined : (entry.target || undefined)\n\t\t},\n\n\t\t/**\n\t\t * Click on a link entry: a plain click on an in-app link routes in\n\t\t * place; a URL or a modified click is left to the browser.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @return {void}\n\t\t */\n\t\tonLinkClick(entry, event) {\n\t\t\tif (entry.linkTo) {\n\t\t\t\tfollowLinkClick(event, entry.linkTo, this.effectiveRouter)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name for a sub-action chevron. `childrenLabel` when set, else the\n\t\t * parent's own label, so the dropdown is never announced unlabelled.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {string} The menu name.\n\t\t */\n\t\tchildMenuName(entry) {\n\t\t\treturn this.tr(entry.childrenLabel) || this.tr(entry.label) || ''\n\t\t},\n\n\t\t/**\n\t\t * Read a dot-path off a payload (the toggle state field).\n\t\t *\n\t\t * @param {unknown} data The payload.\n\t\t * @param {string} field The dot-path.\n\t\t * @return {unknown} The value at the path.\n\t\t */\n\t\treadField(data, field) {\n\t\t\tif (!field) {\n\t\t\t\treturn data\n\t\t\t}\n\t\t\treturn String(field).split('.').reduce((o, k) => (o === null || o === undefined ? o : o[k]), data)\n\t\t},\n\n\t\t/**\n\t\t * Toggle click: flip the state OPTIMISTICALLY, write it, and revert on\n\t\t * failure. Success/error toast via the api-call dispatch path (which\n\t\t * also refreshes the page unless `refresh: false`).\n\t\t *\n\t\t * @param {object} entry The toggle action.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onToggleClick(entry) {\n\t\t\tif (this.togglePending[entry.id]) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = Boolean(this.toggleState[entry.id])\n\t\t\tconst next = !previous\n\t\t\tthis.toggleState[entry.id] = next\n\t\t\tthis.togglePending[entry.id] = true\n\t\t\tconst writeParams = { ...(entry.params || {}) }\n\t\t\tif (entry.field) {\n\t\t\t\twriteParams[entry.field] = next\n\t\t\t}\n\t\t\tconst result = await this.dispatch({\n\t\t\t\ttype: 'api-call',\n\t\t\t\turl: entry.writeUrl,\n\t\t\t\tmethod: entry.method || 'PUT',\n\t\t\t\tparams: writeParams,\n\t\t\t\tsuccessMessage: entry.successMessage,\n\t\t\t\terrorMessage: entry.errorMessage,\n\t\t\t\trefresh: entry.refresh,\n\t\t\t})\n\t\t\tif (!result || result.ok === false) {\n\t\t\t\t// Revert the optimistic flip.\n\t\t\t\tthis.toggleState[entry.id] = previous\n\t\t\t}\n\t\t\tthis.togglePending[entry.id] = false\n\t\t},\n\n\t\t/**\n\t\t * Non-toggle action click: gate on `confirm` first, else run.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {void}\n\t\t */\n\t\tonActionClick(entry) {\n\t\t\tif (entry.confirm === true) {\n\t\t\t\tthis.confirmEntry = entry\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.runAction(entry)\n\t\t},\n\n\t\t/**\n\t\t * The confirm dialog's proceed handler: run the pending action, then\n\t\t * report the outcome back to the dialog's result phase.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onConfirmProceed() {\n\t\t\tconst entry = this.confirmEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst result = await this.runAction(entry)\n\t\t\tconst dialog = this.$refs.confirmDialog\n\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\tconst ok = result === undefined || (result && result.ok !== false)\n\t\t\t\tdialog.setResult(ok ? { success: true } : { error: t('nextcloud-vue', 'Action failed.') })\n\t\t\t} else {\n\t\t\t\tthis.confirmEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run an action (post-confirmation). `open-form` opens the schema\n\t\t * dialog; everything else dispatches. Returns the dispatch result so\n\t\t * the confirm dialog can report success/failure.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {Promise<unknown>} The dispatch result (undefined for open-form).\n\t\t */\n\t\tasync runAction(entry) {\n\t\t\t// A function on the descriptor, for a PARENT COMPONENT composing\n\t\t\t// entries in JS (CnDetailPage folds its own Edit in this way).\n\t\t\t// Manifest JSON cannot carry one, so the declarative path is\n\t\t\t// untouched — and it runs after the confirm gate, like every\n\t\t\t// dispatched type.\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\tentry.onSelect(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'open-form') {\n\t\t\t\tawait this.openForm(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'run-node') {\n\t\t\t\tawait this.openRunNode(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tconst result = await this.dispatch(entry)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\treturn result\n\t\t},\n\n\t\t/**\n\t\t * Resolve a manifest-authored UI string through the host translate\n\t\t * function. A pure pass-through: an empty value, or a catalogue that\n\t\t * lacks the key, returns the input unchanged.\n\t\t *\n\t\t * @param {string} [value] The English source string.\n\t\t * @return {string|undefined} The translated (or source) string.\n\t\t */\n\t\ttr(value) {\n\t\t\treturn value ? this.effectiveTranslate(value) : value\n\t\t},\n\n\t\t/**\n\t\t * Route an action through the shared dispatcher — the pre-bound\n\t\t * `cnDispatchAction` (router/registry/handlers/openModal already\n\t\t * wired) when available, else a direct call with a minimal context.\n\t\t * The token context and the host translate function are always\n\t\t * merged in (the latter localises `api-call` success/error toasts).\n\t\t *\n\t\t * @param {object} action The action to dispatch.\n\t\t * @return {Promise<unknown>} The dispatch result.\n\t\t */\n\t\tdispatch(action) {\n\t\t\tconst extra = { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }\n\t\t\tif (typeof this.cnDispatchAction === 'function') {\n\t\t\t\treturn this.cnDispatchAction(action, extra)\n\t\t\t}\n\t\t\treturn dispatchAction(action, {\n\t\t\t\trouter: this.effectiveRouter,\n\t\t\t\topenForm: (a) => this.openForm(a),\n\t\t\t\topenRunNode: (a) => this.openRunNode(a),\n\t\t\t\t...extra,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Open the schema-driven create dialog for an `open-form` action:\n\t\t * fetch the schema object through the shared object store, then mount\n\t\t * CnAdvancedFormDialog. A failed schema load toasts and no-ops.\n\t\t *\n\t\t * @param {object} entry The open-form action (`register`, `schema`).\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openForm(entry) {\n\t\t\tthis.formEntry = entry\n\t\t\tthis.formSchema = null\n\t\t\tthis.formItem = null\n\t\t\tif (entry.endpoint && typeof entry.endpoint.url === 'string' && entry.endpoint.url !== '') {\n\t\t\t\tawait this.openEndpointForm(entry)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst register = entry.register || this.objectCtx.register || ''\n\t\t\tconst schema = entry.schema || ''\n\t\t\tif (!schema) {\n\t\t\t\tthis.formEntry = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\tthis.formSchema = await store.fetchSchema(type)\n\t\t\t} catch {\n\t\t\t\tthis.formSchema = null\n\t\t\t}\n\t\t\tif (!this.formSchema) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(t('nextcloud-vue', 'Could not open the form.'))\n\t\t\t\t}\n\t\t\t\tthis.formEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open an `open-form` action with an `endpoint` as an edit form over a\n\t\t * record that is not a register object (an OpenRegister organisation):\n\t\t * the fields are the action's `formProperties`, the values are read from\n\t\t * `endpoint.loadUrl` (else `endpoint.url`) at `endpoint.responsePath`,\n\t\t * and the save sends the changed fields to `endpoint.url`. A failed\n\t\t * read toasts and opens nothing.\n\t\t *\n\t\t * @param {object} entry The open-form action with `endpoint` and `formProperties`.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint\n\t\t */\n\t\tasync openEndpointForm(entry) {\n\t\t\tconst properties = entry.formProperties && typeof entry.formProperties === 'object' && !Array.isArray(entry.formProperties) ? entry.formProperties : {}\n\t\t\tif (String(entry.endpoint.method || '').toUpperCase() === 'POST') {\n\t\t\t\tthis.formSchema = { type: 'object', properties }\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst loadUrl = entry.endpoint.loadUrl || entry.endpoint.url\n\t\t\tconst record = await fetchEndpointSource({ url: loadUrl, responsePath: entry.endpoint.responsePath || '' }, this.tokenCtx, { force: true })\n\t\t\t\t.catch(() => null)\n\t\t\tif (!record || typeof record !== 'object') {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(t('nextcloud-vue', 'Could not open the form.'))\n\t\t\t\t}\n\t\t\t\tthis.formEntry = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.formItem = record\n\t\t\tthis.formSchema = { type: 'object', properties }\n\t\t},\n\n\t\t/**\n\t\t * Save an endpoint form: send the declared fields to `endpoint.url`\n\t\t * with `endpoint.method` (`PATCH` by default, or `PUT`), then toast and\n\t\t * refresh the page as an object save does.\n\t\t *\n\t\t * @param {object} entry The open-form action.\n\t\t * @param {object} formData The form's values.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint\n\t\t */\n\t\tasync saveEndpointForm(entry, formData) {\n\t\t\tconst dialog = this.$refs.formDialog\n\t\t\tconst keys = Object.keys(this.formSchema?.properties || {})\n\t\t\tconst body = Object.fromEntries(keys.filter((key) => key in formData).map((key) => [key, formData[key]]))\n\t\t\tconst verb = String(entry.endpoint.method || 'PATCH').toUpperCase()\n\t\t\tconst method = verb === 'PUT' ? 'put' : (verb === 'POST' ? 'post' : 'patch')\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = interpolateActionTarget(entry.endpoint.url, this.tokenCtx)\n\t\t\t\tconst response = await axios[method](/^https?:\\/\\//i.test(url) ? url : generateUrl(url), body)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ success: true })\n\t\t\t\t}\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showSuccess === 'function') {\n\t\t\t\t\tshowSuccess(this.tr(entry.successMessage) || t('nextcloud-vue', 'Saved.'))\n\t\t\t\t}\n\t\t\t\tconst { emit } = await import('@nextcloud/event-bus')\n\t\t\t\temit('cn:page:refresh', {})\n\t\t\t\tthis.$emit('created', response && response.data)\n\t\t\t} catch (error) {\n\t\t\t\tconst serverMessage = error && error.response && error.response.data\n\t\t\t\t\t&& (error.response.data.error || error.response.data.message)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ error: serverMessage || this.tr(entry.errorMessage) || t('nextcloud-vue', 'Save failed.') })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open (or skip) the `run-node` config dialog: GET the target node's\n\t\t * describe endpoint (`or-flow-run-node`'s `GET .../{flowId}/{nodeId}/run`),\n\t\t * and either mount `CnRunNodeDialog` with its declared fields, or —\n\t\t * for a node with none — run immediately with an empty config. A\n\t\t * failed describe call toasts and does neither (RN-4: this resolves\n\t\t * as soon as the decision is made, never waiting on the person).\n\t\t *\n\t\t * @param {object} entry The run-node action (`flowId`, `nodeId`, ...).\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-the-nodes-own-config-form-drives-the-dialog-not-a-new-token\n\t\t */\n\t\tasync openRunNode(entry) {\n\t\t\tconst flowId = entry.flowId\n\t\t\tconst nodeId = entry.nodeId\n\t\t\tif (!flowId || !nodeId) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnActionButtons] run-node requires flowId and nodeId.', entry)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// The try assigns it and the catch returns, so an initialiser here\n\t\t\t// would never be read.\n\t\t\tlet fields\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl(`/apps/openregister/api/flows/${encodeURIComponent(flowId)}/nodes/${encodeURIComponent(nodeId)}/run`)\n\t\t\t\tconst response = await axios.get(url)\n\t\t\t\tfields = Array.isArray(response.data && response.data.configForm) ? response.data.configForm : []\n\t\t\t} catch (error) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tconst serverMessage = error && error.response && error.response.data\n\t\t\t\t\t&& (error.response.data.error || error.response.data.message)\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(serverMessage || t('nextcloud-vue', 'Could not open this action.'))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!fields.length) {\n\t\t\t\t// Empty (or undeclared) form: the \"empty form is itself\n\t\t\t\t// information\" rule flow-node-config-forms already established\n\t\t\t\t// for the editor — run immediately, no dialog.\n\t\t\t\tthis.actionPending[entry.id] = true\n\t\t\t\tawait this.runNodePost(entry, {})\n\t\t\t\tthis.actionPending[entry.id] = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.runNodeFields = fields\n\t\t\tthis.runNodeEntry = entry\n\t\t},\n\n\t\t/**\n\t\t * The run-node dialog's confirm: POST the collected config, close the\n\t\t * dialog either way (success or failure both end the interaction —\n\t\t * a failure already toasted its own message).\n\t\t *\n\t\t * @param {object} config The dialog's collected field values.\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-a-run-node-action-invokes-one-flow-node-against-the-page-object\n\t\t */\n\t\tasync onRunNodeConfirm(config) {\n\t\t\tconst entry = this.runNodeEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tawait this.runNodePost(entry, config)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\tthis.closeRunNode()\n\t\t},\n\n\t\t/**\n\t\t * POST the run-node call through the shared dispatcher's `postRunNode`\n\t\t * (subject/register/schema resolution, fail-closed, toast + refresh —\n\t\t * see its own docblock in actionsDispatcher.js).\n\t\t *\n\t\t * @param {object} entry The run-node action.\n\t\t * @param {object} config The node's collected config.\n\t\t * @return {Promise<{ok: boolean}>}\n\t\t */\n\t\trunNodePost(entry, config) {\n\t\t\treturn postRunNode(entry, { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }, config)\n\t\t},\n\n\t\t/** Close the run-node dialog without running anything. */\n\t\tcloseRunNode() {\n\t\t\tthis.runNodeEntry = null\n\t\t\tthis.runNodeFields = []\n\t\t},\n\n\t\t/**\n\t\t * The create dialog's confirm: save the new object through the shared\n\t\t * object store, report the result phase, toast, refresh the page, and\n\t\t * navigate to `onSuccessRoute` when set — merging the saved object's id\n\t\t * into the route params (via `buildOnSuccessRoute`) so the navigation\n\t\t * can deep-link to the created object's detail page.\n\t\t *\n\t\t * @param {object} formData The dialog's form payload.\n\t\t * @param {object|null} [dynamic] The answers to the schema's data-driven questions (`{ answers, declarations }`), when it has any.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onFormConfirm(formData, dynamic = null) {\n\t\t\tconst entry = this.formEntry\n\t\t\tif (entry && entry.endpoint) {\n\t\t\t\tawait this.saveEndpointForm(entry, formData)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst dialog = this.$refs.formDialog\n\t\t\tconst register = this.formRegister\n\t\t\tconst schema = (entry && entry.schema) || ''\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\t// A schema can require a field the form cannot supply — a\n\t\t\t\t// server-minted foreign key, say — in which case a straight\n\t\t\t\t// saveObject 400s. `createOverride` names a registry handler\n\t\t\t\t// that owns the persist instead (the CnIndexPage precedent).\n\t\t\t\tconst override = resolveCreateOverrideHandler(\n\t\t\t\t\tentry && entry.createOverride,\n\t\t\t\t\tthis.cnRegistry,\n\t\t\t\t\tthis.cnCustomComponents,\n\t\t\t\t)\n\t\t\t\tconst payload = { ...formData }\n\t\t\t\t// Array-mode declarations fold their answers into the parent's\n\t\t\t\t// own payload, so the whole record saves in ONE write. The\n\t\t\t\t// child-record mode below cannot do that (the rows need the\n\t\t\t\t// parent's id), which is why it writes afterwards and can leave\n\t\t\t\t// answers behind if that second write fails.\n\t\t\t\tthis.foldArrayAnswers(payload, dynamic)\n\t\t\t\tconst saved = override\n\t\t\t\t\t? await override(payload, { register, schema, type })\n\t\t\t\t\t: await store.saveObject(type, payload)\n\t\t\t\tif (!saved) {\n\t\t\t\t\tthrow new Error('save rejected')\n\t\t\t\t}\n\t\t\t\tawait this.saveDynamicAnswers(store, register, dynamic, saved)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ success: true })\n\t\t\t\t}\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showSuccess === 'function') {\n\t\t\t\t\tshowSuccess((entry && entry.successMessage) || t('nextcloud-vue', 'Saved.'))\n\t\t\t\t}\n\t\t\t\tconst { emit } = await import('@nextcloud/event-bus')\n\t\t\t\temit('cn:page:refresh', {})\n\t\t\t\t/**\n\t\t\t\t * @event created Emitted after an open-form action saves. Payload: the created object.\n\t\t\t\t */\n\t\t\t\tthis.$emit('created', saved)\n\t\t\t\tif (entry && entry.onSuccessRoute && this.effectiveRouter) {\n\t\t\t\t\tconst location = buildOnSuccessRoute(entry.onSuccessRoute, saved)\n\t\t\t\t\tif (location) {\n\t\t\t\t\t\tthis.effectiveRouter.push(location).catch(() => {})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ error: (e && e.message) || t('nextcloud-vue', 'Save failed.') })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write the answers to a schema's data-driven questions, once the\n\t\t * object they belong to exists.\n\t\t *\n\t\t * This runs AFTER the parent save and deliberately does not roll it\n\t\t * back on failure: a case that exists without one of its custom values\n\t\t * is recoverable by editing it, whereas discarding a case the user\n\t\t * believes they filed is not. A failure here surfaces as the dialog's\n\t\t * error so it is never silent.\n\t\t *\n\t\t * @param {object} store The object store.\n\t\t * @param {string} register The register the object was saved in.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @param {object} saved The saved parent object.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveDynamicAnswers(store, register, dynamic, saved) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst objectId = saved && (saved.id || saved.uuid)\n\t\t\tif (!objectId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tconst values = config && config.values\n\t\t\t\tif (!values || !values.schema) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Already written as part of the parent payload.\n\t\t\t\tif (usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// An answer belongs to exactly one declaration. With a single\n\t\t\t\t// declaration every answer carries its key anyway; the filter\n\t\t\t\t// only matters once a schema has two, where writing an answer\n\t\t\t\t// to both value schemas would invent a row nobody entered.\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\tconst rows = valueRecordsFor(mine, config, objectId)\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst valueRegister = values.register || register\n\t\t\t\tconst type = resolveObjectOpType(store, { register: valueRegister, schema: values.schema })\n\t\t\t\tfor (const row of rows) {\n\t\t\t\t\tawait store.saveObject(type, row)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fold array-mode dynamic answers into the parent payload.\n\t\t *\n\t\t * @param {object} payload The parent object payload, mutated in place.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @return {void}\n\t\t */\n\t\tfoldArrayAnswers(payload, dynamic) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tif (!usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\t// Each answer goes to the array its definition is routed to\n\t\t\t\t// (`values.arrayKeyBy`), merged over what that array holds.\n\t\t\t\tfor (const [arrayKey, subset] of Object.entries(answersByArrayKey(mine, config, dynamic.definitions || []))) {\n\t\t\t\t\tconst entries = mergeValueArray(payload[arrayKey], subset, config, dynamic.definitions || [])\n\t\t\t\t\tif (entries.length || Array.isArray(payload[arrayKey])) {\n\t\t\t\t\t\tpayload[arrayKey] = entries\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close the create dialog.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcloseForm() {\n\t\t\tthis.formEntry = null\n\t\t\tthis.formSchema = null\n\t\t\tthis.formItem = null\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* A red action that does not shout: white, a red border and red text. */\n.cn-action-buttons__button--error-outline {\n\tborder-color: var(--color-error-text, #a30000) !important;\n\tcolor: var(--color-error-text, #a30000) !important;\n\tbackground-color: var(--color-main-background) !important;\n}\n\n.cn-action-buttons__button--error-outline:hover:not(:disabled) {\n\tbackground-color: var(--color-error-hover, #fcedec) !important;\n}\n\n.cn-action-buttons {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tflex-wrap: wrap;\n}\n\n/* In menu mode the only children are dialogs, so the wrapper must not be a\n box: an empty inline-flex child still eats one of the header's flex gaps\n and pushes the Actions menu away from the Edit button beside it. */\n.cn-action-buttons--menu {\n\tdisplay: contents;\n}\n</style>\n"],"names":["_normalizeClass","_createElementBlock","_Fragment","_renderList","_createBlock","_createTextVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;SAYO,EAAAA,cAAA,CAAA,CAAC,mBAAmB,EAAA,EAAA,yBAAA,EACY,MAAO,CAAA,OAAA,KAAA,MAAA,EAAA,CAAA,CAAA;AACvC,IAAA,aAAM,EAAC,mBAAoB;;sBAS9BC,kBAoGS,CAAAC,QAAA,EAAA,IAAA,EAAAC,UAAA,CApGK,QAAA,CAAA,UAAA,EAAA,CAAA,KAAA,KAAA;;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CAAA,YAAA,IAAI,KAAI,CAAA,aAAA,CAAA,MAAA;sBAD1BA;;UAEC,KAAK,EAAE,QAAE,CAAA,EAAA,CAAC,KAAY,CAAA,YAAA,CAAA,SAAA,CAAA,IAAA,QAAA,CAAA,EAAA,CAAA,KAAA,CAAA,YAAA,CAAA,KAAA,CAAA;AACtB,UAAA,MAAE,EAAA,KAAA,CAAA,aAAA;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnAuditTrailCard.vue2.js';
2
2
  import { render } from './CnAuditTrailCard.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-3b6d70f7";
5
+ script.__scopeId = "data-v-0a8bd434";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -206,6 +206,16 @@ var script = {
206
206
  return this.title || translate('nextcloud-vue', 'Audit trail')
207
207
  },
208
208
 
209
+ /**
210
+ * Whether the host listens for `show-all`. The audit-trail widget binds
211
+ * no listener, and a button that does nothing is not offered.
212
+ *
213
+ * @return {boolean}
214
+ */
215
+ offersShowAll() {
216
+ return typeof this.$.vnode.props?.onShowAll === 'function'
217
+ },
218
+
209
219
  /**
210
220
  * The entries without the excluded actions and actors, and without an
211
221
  * update that changed nothing: a re-save whose `changed` holds no field
@@ -1 +1 @@
1
- {"version":3,"file":"CnAuditTrailCard.vue2.js","sources":["../../../../src/components/CnAuditTrailCard/CnAuditTrailCard.vue"],"sourcesContent":["<!--\n CnAuditTrailCard — compact audit-trail widget for the integration\n registry.\n\n Surface-aware shell around the `audit-trail` integration: fetches\n the object's recent audit-trail entries (query-time storage strategy\n per AD-22) and renders them in a CnDetailCard.\n\n Per umbrella change `pluggable-integration-registry` AD-19 (surface\n fallback), one component handles all surfaces — `surface` is\n forwarded so the component can branch internally if desired.\n-->\n<template>\n\t<CnDetailCard\n\t\t:title=\"resolvedTitle\"\n\t\t:icon=\"History\"\n\t\t:collapsible=\"collapsible\"\n\t\t:data-surface=\"surface\">\n\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t<p v-else-if=\"failed\"\n\t\t\tclass=\"cn-audit-card__empty\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-audit-card-failed\">\n\t\t\t{{ failedLabel }}\n\t\t</p>\n\t\t<div v-else-if=\"shownEntries.length === 0\" class=\"cn-audit-card__empty\">\n\t\t\t{{ noEntriesLabel }}\n\t\t</div>\n\t\t<!-- `dated` (PqJourney \"Geschiedenis\"): the short date beside what\n\t\t happened, one line per entry. -->\n\t\t<dl v-else-if=\"layout === 'dated'\" class=\"cn-audit-card__dated\">\n\t\t\t<template v-for=\"entry in displayedEntries\" :key=\"entry.id\">\n\t\t\t\t<dt class=\"cn-audit-card__date\">\n\t\t\t\t\t{{ shortDate(entry) }}\n\t\t\t\t</dt>\n\t\t\t\t<dd class=\"cn-audit-card__dated-text\">\n\t\t\t\t\t{{ formatAction(entry) }}<span\n\t\t\t\t\t\tv-if=\"entry.authorized === false\"\n\t\t\t\t\t\tclass=\"cn-audit-card__refused\"\n\t\t\t\t\t\tdata-testid=\"cn-audit-card-refused\">{{ refusedLabel }}</span>\n\t\t\t\t</dd>\n\t\t\t</template>\n\t\t</dl>\n\t\t<ul v-else class=\"cn-audit-card__list\">\n\t\t\t<li\n\t\t\t\tv-for=\"entry in displayedEntries\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\tclass=\"cn-audit-card__row\"\n\t\t\t\t:class=\"{ 'cn-audit-card__row--stacked': layout === 'stacked', 'cn-audit-card__row--compact': density === 'compact' }\">\n\t\t\t\t<div class=\"cn-audit-card__row-head\">\n\t\t\t\t\t<strong class=\"cn-audit-card__action\">{{ formatAction(entry) }}</strong>\n\t\t\t\t\t<span v-if=\"layout !== 'stacked'\" class=\"cn-audit-card__when\">{{ formatWhen(entry) }}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-audit-card__row-body\">\n\t\t\t\t\t<span v-if=\"layout === 'stacked'\" class=\"cn-audit-card__when\" data-testid=\"cn-audit-card-when-below\">{{ stackedLine(entry) }}</span>\n\t\t\t\t\t<span v-else class=\"cn-audit-card__actor\">{{ formatActor(entry) }}</span>\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"entry.authorized === false\"\n\t\t\t\t\t\tclass=\"cn-audit-card__refused\"\n\t\t\t\t\t\tdata-testid=\"cn-audit-card-refused\">{{ refusedLabel }}</span>\n\t\t\t\t</div>\n\t\t\t\t<p v-if=\"entry.reason\" class=\"cn-audit-card__reason\">\n\t\t\t\t\t{{ entry.reason }}\n\t\t\t\t</p>\n\t\t\t</li>\n\t\t</ul>\n\t\t<p v-if=\"footnote\" class=\"cn-audit-card__footnote\" data-testid=\"cn-audit-trail-widget-footnote\">\n\t\t\t{{ footnote }}\n\t\t</p>\n\t\t<template v-if=\"shownEntries.length > maxDisplay\" #footer>\n\t\t\t<button class=\"cn-audit-card__show-all\" @click=\"$emit('show-all')\">\n\t\t\t\t{{ showAllLabel }} ({{ shownEntries.length }})\n\t\t\t</button>\n\t\t</template>\n\t</CnDetailCard>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon } from '@nextcloud/vue'\nimport { markRaw } from 'vue'\nimport History from 'vue-material-design-icons/History.vue'\nimport CnDetailCard from '../CnDetailCard/CnDetailCard.vue'\nimport { auditExclusionParams, keepAuditEntries } from '../../utils/auditEntries.js'\nimport { actionLabelFor, changedValue, changeLabelFor, fillAuditLabel } from '../../utils/auditLabels.js'\nimport { formatBoardDate, formatTimeOfDay } from '../../utils/boardDate.js'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { leafSourceUrl } from '../../utils/leafSourceUrl.js'\nimport { userDisplayName } from '../../utils/userDisplayName.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\n/**\n * @param {object} entry An audit entry.\n * @return {number} When it happened, in ms; 0 when unreadable.\n */\nfunction entryTime(entry) {\n\tconst time = new Date(entry.creationDateTime || entry.created || entry.timestamp || 0).getTime()\n\treturn Number.isNaN(time) ? 0 : time\n}\n\n/**\n * CnAuditTrailCard — compact audit-trail widget rendered by the\n * integration registry on dashboard and detail surfaces.\n *\n * Basic usage\n * ```vue\n * <CnAuditTrailCard\n * :register=\"registerId\"\n * :schema=\"schemaId\"\n * :object-id=\"objectId\"\n * surface=\"detail-page\" />\n * ```\n */\nexport default {\n\tname: 'CnAuditTrailCard',\n\n\tcomponents: { CnDetailCard, NcLoadingIcon },\n\n\tprops: {\n\t\t/**\n\t\t * A muted line under the trail, inside the card (\"Kenmerk ZT-OMV-REG\").\n\t\t *\n\t\t * @spec openspec/changes/audit-trail-footnote/specs/audit-trail/spec.md#requirement-a-history-card-can-end-in-a-line-about-the-record\n\t\t */\n\t\tfootnote: { type: String, default: '' },\n\t\t/** OpenRegister register id (slug or uuid). Optional for `scope: \"app\"`. */\n\t\tregister: { type: String, default: '' },\n\t\t/** OpenRegister schema id (slug or uuid). Optional for `scope: \"app\"`. */\n\t\tschema: { type: String, default: '' },\n\t\t/** Parent object id. Required for `scope: \"object\"` (the default); unused for `scope: \"app\"`. */\n\t\tobjectId: { type: String, default: '' },\n\t\t/**\n\t\t * What the card lists. `object` (the default) is one object's trail\n\t\t * and needs `register`, `schema` and `objectId`. `app` is the\n\t\t * app-wide feed: the entries of every object the caller may read\n\t\t * (OpenRegister's `/audit-trails/readable`), narrowed to `register`\n\t\t * and `schema` when those are set.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-the-audit-trail-widget-reads-the-app-wide-feed\n\t\t */\n\t\tscope: {\n\t\t\ttype: String,\n\t\t\tdefault: 'object',\n\t\t\tvalidator: (value) => ['object', 'app'].includes(value),\n\t\t},\n\n\t\t/** Rendering surface — passed for AD-19 surface fallback consumers. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'detail-page',\n\t\t\tvalidator: (value) => ['user-dashboard', 'app-dashboard', 'detail-page', 'single-entity'].includes(value),\n\t\t},\n\n\t\t/** Base API URL. */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\n\t\t/**\n\t\t * Read the trail of something that is not an OpenRegister object:\n\t\t * `{ kind: 'flow-task', id }` reads `${apiBase}/flow-tasks/{id}/audit`,\n\t\t * oldest first. `id` may be left out or written `@objectId`.\n\t\t *\n\t\t * @type {{kind: string, id?: (string|number)}|null}\n\t\t */\n\t\tsource: { type: Object, default: null },\n\n\t\t/** A trail URL that replaces the object's own; `{id}` is filled with the source's id or `objectId`. */\n\t\tendpoint: { type: String, default: '' },\n\n\t\t/** `newest` first (the object trail's order) or `oldest` first; empty takes `oldest` for a source and `newest` otherwise. */\n\t\torder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (value) => ['', 'newest', 'oldest'].includes(value),\n\t\t},\n\n\t\t/** Maximum rows to render. */\n\t\tmaxDisplay: { type: Number, default: 5 },\n\t\t/**\n\t\t * `stacked` (DqTaak \"Historie\"): the action, then one muted line under\n\t\t * it with the moment (\"6 okt 09:05\") and who, when the action does not\n\t\t * already name them. Default: the moment beside the action, who under it.\n\t\t * `dated` (PqJourney \"Geschiedenis\"): a two-column list, the short date\n\t\t * (\"2 okt\") beside what happened; who shows only where the action's\n\t\t * label names them (`{actor}`).\n\t\t */\n\t\tlayout: { type: String, default: '' },\n\t\t/**\n\t\t * `compact` draws the rows closer together: in the board look a\n\t\t * stacked row 10px above and below (DqZaaktype \"Historie\") instead of\n\t\t * 12px (DqTaak). Default: the layout's own spacing.\n\t\t *\n\t\t * @spec openspec/changes/audit-card-compact-stacked-rows/specs/audit-trail/spec.md#requirement-a-stacked-audit-card-can-draw-compact-rows\n\t\t */\n\t\tdensity: { type: String, default: '' },\n\t\t/**\n\t\t * Actions the card leaves out (case-insensitive), such as `['read']`\n\t\t * for a history of what changed. It then reads more entries than it\n\t\t * shows, so the rows it leaves out do not crowd the rest away.\n\t\t *\n\t\t * @spec openspec/changes/audit-trail-exclude-actions/specs/audit-trail/spec.md#requirement-a-history-card-can-leave-out-events-by-action\n\t\t */\n\t\texcludeActions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Actors the card leaves out by user id (case-insensitive), such as\n\t\t * `['System']` for a history of what people did: the bookkeeping a\n\t\t * background job writes is not shown.\n\t\t *\n\t\t * @spec openspec/changes/audit-card-exclude-actors/specs/audit-trail/spec.md#requirement-a-history-card-can-leave-out-entries-by-actor\n\t\t */\n\t\texcludeActors: { type: Array, default: () => [] },\n\t\t/** Whether the card collapses. */\n\t\tcollapsible: { type: Boolean, default: false },\n\t\t/** Override the card title (defaults to the translated label). */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Pre-translated empty label. */\n\t\tnoEntriesLabel: { type: String, default: () => t('nextcloud-vue', 'No audit entries yet') },\n\t\t/** Pre-translated overflow label. */\n\t\tshowAllLabel: { type: String, default: () => t('nextcloud-vue', 'Show all') },\n\t\t/** Pre-translated fallback action label. */\n\t\tactionLabel: { type: String, default: () => t('nextcloud-vue', 'Change') },\n\t\t/** Shown on an entry the server refused (`authorized: false`). */\n\t\trefusedLabel: { type: String, default: () => t('nextcloud-vue', '(refused)') },\n\t\t/**\n\t\t * What happened, in words, by action (`claim`) or by action and the\n\t\t * state it led to (`complete:completed`, tried first). `{actor}`,\n\t\t * `{state}` and `{changed.<key>}` (a value the entry recorded, a dotted key\n\t\t * reading into it such as `{changed.data.fileName}`, in the\n\t\t * words of `valueLabels`) are filled in; a label that names the actor leaves it off\n\t\t * the line under it. An action without a label shows as written.\n\t\t *\n\t\t * @type {Object<string, string>|null}\n\t\t */\n\t\tactionLabels: { type: Object, default: null },\n\t\t/**\n\t\t * Words for the values an action label quotes as `{changed.<key>}`:\n\t\t * `{ purpose: { handling: 'Handling' } }`. A value without an entry\n\t\t * shows as written.\n\t\t *\n\t\t * @type {{[key: string]: {[value: string]: string}}|null}\n\t\t */\n\t\tvalueLabels: { type: Object, default: null },\n\t\t/**\n\t\t * What happened, in words, by the field an entry changed: rules\n\t\t * `[{ action?, field, to?, label }]`, the first whose `field` the entry\n\t\t * changed (to `to`, when given) wins over `actionLabels`. A label fills\n\t\t * the same tokens, plus `{object.<path>}` from `object`\n\t\t * (\"Version {object.version} published\" for `isDraft` set to false).\n\t\t *\n\t\t * @type {Array<{action?: string, field: string, to?: unknown, label: string}>}\n\t\t */\n\t\tchangeLabels: { type: Array, default: () => [] },\n\t\t/** The audited record, for `{object.<path>}` in a label; null without one. */\n\t\tobject: { type: Object, default: null },\n\t\t/**\n\t\t * Records beside the object whose events belong in its history:\n\t\t * `[{ as, register, schema, filter, limit? }]`. The card lists the\n\t\t * objects matching `filter` (`@objectId` is this object; at most\n\t\t * `limit`, default 5), reads their trails and merges the entries with\n\t\t * the object's own, newest first. A related entry is labelled by\n\t\t * `actionLabels[\"<as>.<action>\"]` first. Object scope only.\n\t\t *\n\t\t * @type {Array<{as: string, register: string, schema: string, filter?: object, limit?: number}>}\n\t\t * @spec openspec/changes/audit-trail-related-sources/specs/audit-trail/spec.md#requirement-an-objects-history-can-include-the-events-of-records-beside-it\n\t\t */\n\t\trelatedSources: { type: Array, default: () => [] },\n\t\t/** Shown when a `source` or `endpoint` read failed. */\n\t\tfailedLabel: { type: String, default: () => t('nextcloud-vue', 'The history could not be loaded') },\n\t},\n\n\temits: ['show-all'],\n\n\tdata() {\n\t\treturn {\n\t\t\tHistory: markRaw(History),\n\t\t\tentries: [],\n\t\t\tloading: false,\n\t\t\t/** A `source` or `endpoint` read failed: said, rather than shown as an empty trail. */\n\t\t\tfailed: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tresolvedTitle() {\n\t\t\treturn this.title || t('nextcloud-vue', 'Audit trail')\n\t\t},\n\n\t\t/**\n\t\t * The entries without the excluded actions and actors, and without an\n\t\t * update that changed nothing: a re-save whose `changed` holds no field\n\t\t * whose old and new value differ (only `@self` bookkeeping) is not\n\t\t * something that happened to the record.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tshownEntries() {\n\t\t\treturn keepAuditEntries(this.entries, { excludeActions: this.excludeActions, excludeActors: this.excludeActors })\n\t\t},\n\n\t\t/** @return {boolean} Whether the card leaves entries out, and so reads more than it shows. */\n\t\tfiltersEntries() {\n\t\t\treturn this.excludeActions.length > 0 || this.excludeActors.length > 0\n\t\t},\n\n\t\tdisplayedEntries() {\n\t\t\tconst entries = this.oldestFirst ? [...this.shownEntries].sort((a, b) => entryTime(a) - entryTime(b)) : this.shownEntries\n\t\t\treturn entries.slice(0, this.maxDisplay)\n\t\t},\n\n\t\t/**\n\t\t * The trail URL a `source` or `endpoint` names, '' while its record id\n\t\t * is unknown, or null when the card reads an object.\n\t\t *\n\t\t * @return {string|null}\n\t\t * @spec openspec/changes/leaf-cards-read-a-source/specs/leaf-cards-read-a-source/spec.md#requirement-a-leaf-card-reads-a-source-or-an-endpoint\n\t\t */\n\t\tsourceUrl() {\n\t\t\treturn leafSourceUrl({ source: this.source, endpoint: this.endpoint, apiBase: this.apiBase, objectId: this.objectId }, 'audit')\n\t\t},\n\n\t\t/** @return {boolean} Whether the entries read oldest first. */\n\t\toldestFirst() {\n\t\t\treturn this.order === 'oldest' || (this.order === '' && this.sourceUrl !== null)\n\t\t},\n\n\t\t/**\n\t\t * The path the card reads (prefixed at fetch time), or '' when it has nothing to read: the\n\t\t * object's own trail, or the app-wide readable feed narrowed to the\n\t\t * register and schema when set.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-the-audit-trail-widget-reads-the-app-wide-feed\n\t\t * @return {string}\n\t\t */\n\t\tfetchUrl() {\n\t\t\tif (this.sourceUrl !== null) {\n\t\t\t\treturn this.sourceUrl\n\t\t\t}\n\t\t\tconst limit = this.filtersEntries ? Math.min(100, this.maxDisplay * 10) : this.maxDisplay\n\t\t\tconst params = new URLSearchParams({ limit: String(limit) })\n\t\t\tif (this.scope === 'app') {\n\t\t\t\tif (this.register) {\n\t\t\t\t\tparams.set('register', this.register)\n\t\t\t\t}\n\t\t\t\tif (this.schema) {\n\t\t\t\t\tparams.set('schema', this.schema)\n\t\t\t\t}\n\t\t\t\treturn `${this.apiBase}/audit-trails/readable?${params.toString()}`\n\t\t\t}\n\t\t\tif (!this.register || !this.schema || !this.objectId) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tthis.addExclusions(params)\n\t\t\treturn `${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/audit-trails?${params.toString()}`\n\t\t},\n\t},\n\n\twatch: {\n\t\tfetchUrl: {\n\t\t\timmediate: true,\n\t\t\thandler(url) {\n\t\t\t\tif (url) {\n\t\t\t\t\tthis.fetchEntries()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Ask an object trail to leave out the excluded actions and actors in\n\t\t * the query (`action[notIn]`, `user[notIn]`), so its pages hold what the\n\t\t * card shows. `keepAuditEntries` still filters what comes back.\n\t\t *\n\t\t * @param {URLSearchParams} params The trail query, changed in place.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/audit-card-exclusions-in-the-query/specs/audit-trail/spec.md#requirement-a-history-card-asks-the-trail-to-leave-out-what-it-hides\n\t\t */\n\t\taddExclusions(params) {\n\t\t\tfor (const [key, value] of Object.entries(auditExclusionParams({ excludeActions: this.excludeActions, excludeActors: this.excludeActors }))) {\n\t\t\t\tparams.set(key, value)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read the entries from `fetchUrl`. The readable feed answers\n\t\t * `{ rows, nextCursor }`, the object trail `{ results }`.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-the-audit-trail-widget-reads-the-app-wide-feed\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchEntries() {\n\t\t\tconst url = this.fetchUrl\n\t\t\tif (!url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.failed = false\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst list = data.results || data.rows || data\n\t\t\t\t\tconst own = await this.withFollowingPages(url, Array.isArray(list) ? list : [])\n\t\t\t\t\tconst related = await this.fetchRelatedEntries()\n\t\t\t\t\tthis.entries = related.length > 0\n\t\t\t\t\t\t? [...own, ...related].sort((a, b) => entryTime(b) - entryTime(a))\n\t\t\t\t\t\t: own\n\t\t\t\t} else {\n\t\t\t\t\tthis.entries = []\n\t\t\t\t\tthis.failed = this.sourceUrl !== null\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('[CnAuditTrailCard] failed to fetch audit trail', err)\n\t\t\t\tthis.entries = []\n\t\t\t\tthis.failed = this.sourceUrl !== null\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * An object's trail read on until it holds enough entries to show. The\n\t\t * card leaves entries out (reads, actors, empty re-saves) after\n\t\t * reading, and every page view writes a read, so the newest page alone\n\t\t * can be all reads (DqHandhaving Historie: \"no changes yet\"). Reads at\n\t\t * most four more pages.\n\t\t *\n\t\t * @param {string} url The first page's path.\n\t\t * @param {Array<object>} first The first page's entries.\n\t\t * @return {Promise<Array<object>>} The entries read.\n\t\t */\n\t\tasync withFollowingPages(url, first) {\n\t\t\tconst entries = [...first]\n\t\t\tif (!this.filtersEntries || this.scope !== 'object' || this.sourceUrl !== null) {\n\t\t\t\treturn entries\n\t\t\t}\n\t\t\tconst limit = Number(new URLSearchParams(url.split('?')[1] || '').get('limit')) || first.length\n\t\t\tlet page = first\n\t\t\tfor (let more = 0; more < 4 && page.length >= limit && limit > 0; more++) {\n\t\t\t\tthis.entries = [...entries]\n\t\t\t\tif (this.shownEntries.length >= this.maxDisplay) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tconst next = new URL(url, 'http://x')\n\t\t\t\tnext.searchParams.set('offset', String(entries.length))\n\t\t\t\tconst response = await fetch(prefixUrl(next.pathname + next.search), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = data.results || data.rows || data\n\t\t\t\tpage = Array.isArray(list) ? list : []\n\t\t\t\tentries.push(...page)\n\t\t\t}\n\t\t\treturn [...entries]\n\t\t},\n\n\t\t/**\n\t\t * The entries of the records beside the object (`relatedSources`),\n\t\t * each tagged with its source's `as`. A read that fails leaves that\n\t\t * source out.\n\t\t *\n\t\t * @return {Promise<Array<object>>} The entries.\n\t\t * @spec openspec/changes/audit-trail-related-sources/specs/audit-trail/spec.md#requirement-an-objects-history-can-include-the-events-of-records-beside-it\n\t\t */\n\t\tasync fetchRelatedEntries() {\n\t\t\tif (this.scope !== 'object' || this.sourceUrl !== null || !this.objectId || !Array.isArray(this.relatedSources)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst limit = this.filtersEntries ? Math.min(100, this.maxDisplay * 10) : this.maxDisplay\n\t\t\tconst read = async (url) => {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new Error(String(response.status))\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = data.results || data.rows || data\n\t\t\t\treturn Array.isArray(list) ? list : []\n\t\t\t}\n\t\t\tconst perSource = await Promise.all(this.relatedSources\n\t\t\t\t.filter((source) => source && source.register && source.schema)\n\t\t\t\t.map(async (source) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst params = new URLSearchParams({ _limit: String(Number(source.limit) > 0 ? Number(source.limit) : 5), _order: JSON.stringify({ '@self.created': 'DESC' }) })\n\t\t\t\t\t\tfor (const [key, value] of Object.entries(source.filter || {})) {\n\t\t\t\t\t\t\tparams.set(key, value === '@objectId' ? this.objectId : String(value))\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst objects = await read(`${this.apiBase}/objects/${source.register}/${source.schema}?${params.toString()}`)\n\t\t\t\t\t\tconst ids = objects.map((object) => object?.id || object?.['@self']?.id || object?.uuid).filter(Boolean)\n\t\t\t\t\t\tconst trailParams = new URLSearchParams({ limit: String(limit) })\n\t\t\t\t\t\tthis.addExclusions(trailParams)\n\t\t\t\t\t\tconst trails = await Promise.all(ids.map((id) => read(`${this.apiBase}/objects/${source.register}/${source.schema}/${id}/audit-trails?${trailParams.toString()}`).catch(() => [])))\n\t\t\t\t\t\treturn trails.flat().map((entry) => ({ ...entry, relatedAs: source.as || source.schema }))\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\treturn perSource.flat()\n\t\t},\n\n\t\t/**\n\t\t * What happened: the action, with the state it led to when the entry\n\t\t * names one (a flow task's `stateAfter`).\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The line.\n\t\t */\n\t\tformatAction(entry) {\n\t\t\tconst label = this.changeLabelFor(entry) ?? this.labelFor(entry)\n\t\t\tif (label !== null) {\n\t\t\t\treturn fillAuditLabel(label, entry, { actor: this.actorName(entry), object: this.object, valueLabels: this.valueLabels })\n\t\t\t}\n\t\t\tconst action = entry.action || entry.event || this.actionLabel\n\t\t\treturn entry.stateAfter ? `${action} (${entry.stateAfter})` : action\n\t\t},\n\n\t\t/**\n\t\t * A value the entry recorded under `changed` (an audit entry's context),\n\t\t * in the words of `valueLabels`; '' when it recorded none.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @param {string} key The recorded key.\n\t\t * @return {string} The value in words.\n\t\t * @spec openspec/changes/audit-label-changed-values/specs/audit-trail/spec.md#requirement-a-trail-label-can-quote-what-the-entry-recorded\n\t\t */\n\t\tchangedValue(entry, key) {\n\t\t\treturn changedValue(entry, key, this.valueLabels)\n\t\t},\n\n\t\t/**\n\t\t * The `changeLabels` rule an entry matches: the first whose field the\n\t\t * entry changed, for its action and to its value when the rule names them.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string|null} The label, or null when no rule matches.\n\t\t */\n\t\tchangeLabelFor(entry) {\n\t\t\treturn changeLabelFor(entry, this.changeLabels)\n\t\t},\n\n\t\t/**\n\t\t * The `actionLabels` entry for an entry: by action and state first,\n\t\t * then by action.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string|null} The label, or null when none is declared.\n\t\t * @spec openspec/changes/audit-trail-action-labels/specs/audit-trail/spec.md#requirement-a-trail-can-say-what-happened-in-words\n\t\t */\n\t\tlabelFor(entry) {\n\t\t\treturn actionLabelFor(entry, this.actionLabels, this.object)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} Who did it, by name where the entry carries one.\n\t\t */\n\t\tactorName(entry) {\n\t\t\tif (entry.actorDisplayName) {\n\t\t\t\treturn entry.actorDisplayName\n\t\t\t}\n\t\t\tconst id = entry.actor || entry.userId || entry.user || ''\n\t\t\t// A person's user id reads as their display name once it is known.\n\t\t\treturn (id && (!entry.performerType || entry.performerType === 'user') && userDisplayName(String(id))) || id\n\t\t},\n\n\t\t/**\n\t\t * The date of a dated list's entry in the board's short form (\"2 okt\").\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The date, or '' without one.\n\t\t * @spec openspec/changes/audit-card-dated-layout/specs/audit-trail/spec.md#requirement-an-audit-list-can-put-the-date-beside-what-happened\n\t\t */\n\t\tshortDate(entry) {\n\t\t\treturn formatBoardDate(entry.creationDateTime || entry.created || entry.timestamp)\n\t\t},\n\n\t\t/**\n\t\t * The muted line of a stacked row: the moment in the board's short\n\t\t * form (\"6 okt 09:05\") and who, unless the action names them already.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The line.\n\t\t * @spec openspec/changes/audit-card-stacked-rows/specs/audit-trail/spec.md#requirement-an-audit-row-can-put-its-moment-under-the-action\n\t\t */\n\t\tstackedLine(entry) {\n\t\t\tconst raw = entry.creationDateTime || entry.created || entry.timestamp\n\t\t\tconst date = raw ? new Date(raw) : null\n\t\t\tconst when = date && !Number.isNaN(date.getTime()) ? `${formatBoardDate(date)} ${formatTimeOfDay(date)}` : ''\n\t\t\treturn [when, this.formatActor(entry)].filter((part) => part !== '').join(' · ')\n\t\t},\n\n\t\t/**\n\t\t * Who did it: the actor, the kind of performer when it is not a\n\t\t * person (a flow, the system), and on whose behalf.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The line.\n\t\t */\n\t\tformatActor(entry) {\n\t\t\tconst named = (this.labelFor(entry) || '').includes('{actor}')\n\t\t\tconst parts = [named ? '' : this.actorName(entry)]\n\t\t\tif (entry.performerType && entry.performerType !== 'user') {\n\t\t\t\tparts.push(`(${entry.performerType})`)\n\t\t\t}\n\t\t\tif (entry.onBehalfOf) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'on behalf of {name}', { name: entry.onBehalfOf }))\n\t\t\t}\n\t\t\treturn parts.filter((part) => part !== '').join(' ')\n\t\t},\n\n\t\tformatWhen(entry) {\n\t\t\tconst raw = entry.creationDateTime || entry.created || entry.timestamp\n\t\t\tif (raw === undefined || raw === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst d = new Date(raw)\n\t\t\tif (Number.isNaN(d.getTime()) === true) {\n\t\t\t\treturn String(raw)\n\t\t\t}\n\t\t\treturn d.toLocaleString(userLocale())\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-audit-card__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n/* Nextcloud core pads and aligns `dt` / `dd`; the list resets both. */\n.cn-audit-card__dated {\n\tdisplay: grid;\n\tgrid-template-columns: max-content minmax(0, 1fr);\n\tgap: 8px 16px;\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 14px;\n}\n\n.cn-audit-card__dated .cn-audit-card__date {\n\twidth: auto;\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\twhite-space: nowrap;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-audit-card__dated .cn-audit-card__dated-text {\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\toverflow-wrap: anywhere;\n}\n\n.cn-audit-card__row {\n\tpadding: 6px 0;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-audit-card__row:last-child {\n\tborder-bottom: none;\n}\n\n.cn-audit-card__row-head {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 8px;\n}\n\n.cn-audit-card__action {\n\tcolor: var(--color-main-text);\n}\n\n.cn-audit-card__when {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\twhite-space: nowrap;\n}\n\n.cn-audit-card__row-body {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n}\n\n.cn-audit-card__refused {\n\tmargin-inline-start: 6px;\n\tfont-weight: 700;\n\tcolor: var(--color-error-text, var(--color-main-text));\n}\n\n.cn-audit-card__reason {\n\tmargin: 2px 0 0;\n\tfont-size: 0.9em;\n\toverflow-wrap: anywhere;\n}\n\n.cn-audit-card__empty {\n\tcolor: var(--color-text-maxcontrast);\n\ttext-align: center;\n\tpadding: 12px 0;\n}\n\n.cn-audit-card__footnote {\n\tmargin: 12px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-audit-card__show-all {\n\tbackground: none;\n\tborder: none;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tpadding: 4px 0;\n\tfont: inherit;\n}\n\n.cn-audit-card__show-all:hover {\n\ttext-decoration: underline;\n}\n</style>\n"],"names":["CnDetailCard","t"],"mappings":";;;;;;;;;;;;;AA2FA;AACC;;;AAGD,SAAS,SAAS,CAAC,KAAK,EAAE;AACzB,CAAA,MAAM,IAAG,GAAI,IAAI,IAAI,CAAC,KAAK,CAAC,o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AAa,CAAC,CAAC,CAAC,EAAA;AACtC,IAAA;AACA,GAAA,IAAI,KAAK,CAAC,UAAU,EAAE;AACrB,IAAA,KAAK,CAAC,IAAI,CAACA,SAAC,CAAC,eAAe,EAAE,qBAAqB,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,UAAS,EAAG,CAAC,EAAA;AACjF,IAAA;AACA,GAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAG,KAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAA;GACnD;;AAED,EAAA,UAAU,CAAC,KAAK,EAAE;AACjB,GAAA,MAAM,GAAI,GAAE,KAAK,CAAC,gBAAe,IAAK,KAAK,CAAC,OAAQ,IAAG,KAAK,CAAC,UAAQ;AACrE,GAAA,IAAI,GAAI,KAAI,SAAU,IAAG,GAAE,KAAM,IAAI,EAAE;AACtC,IAAA,OAAO,EAAC;AACT,IAAA;AACA,GAAA,MAAM,CAAA,GAAI,IAAI,IAAI,CAAC,GAAG,EAAA;AACtB,GAAA,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAE,KAAI,IAAI,EAAE;AACvC,IAAA,OAAO,MAAM,CAAC,GAAG,CAAA;AAClB,IAAA;AACA,GAAA,OAAO,CAAC,CAAC,cAAc,CAAC,UAAU,EAAE,CAAA;GACpC;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnAuditTrailCard.vue2.js","sources":["../../../../src/components/CnAuditTrailCard/CnAuditTrailCard.vue"],"sourcesContent":["<!--\n CnAuditTrailCard — compact audit-trail widget for the integration\n registry.\n\n Surface-aware shell around the `audit-trail` integration: fetches\n the object's recent audit-trail entries (query-time storage strategy\n per AD-22) and renders them in a CnDetailCard.\n\n Per umbrella change `pluggable-integration-registry` AD-19 (surface\n fallback), one component handles all surfaces — `surface` is\n forwarded so the component can branch internally if desired.\n-->\n<template>\n\t<CnDetailCard\n\t\t:title=\"resolvedTitle\"\n\t\t:icon=\"History\"\n\t\t:collapsible=\"collapsible\"\n\t\t:data-surface=\"surface\">\n\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t<p v-else-if=\"failed\"\n\t\t\tclass=\"cn-audit-card__empty\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-audit-card-failed\">\n\t\t\t{{ failedLabel }}\n\t\t</p>\n\t\t<div v-else-if=\"shownEntries.length === 0\" class=\"cn-audit-card__empty\">\n\t\t\t{{ noEntriesLabel }}\n\t\t</div>\n\t\t<!-- `dated` (PqJourney \"Geschiedenis\"): the short date beside what\n\t\t happened, one line per entry. -->\n\t\t<dl v-else-if=\"layout === 'dated'\" class=\"cn-audit-card__dated\">\n\t\t\t<template v-for=\"entry in displayedEntries\" :key=\"entry.id\">\n\t\t\t\t<dt class=\"cn-audit-card__date\">\n\t\t\t\t\t{{ shortDate(entry) }}\n\t\t\t\t</dt>\n\t\t\t\t<dd class=\"cn-audit-card__dated-text\">\n\t\t\t\t\t{{ formatAction(entry) }}<span\n\t\t\t\t\t\tv-if=\"entry.authorized === false\"\n\t\t\t\t\t\tclass=\"cn-audit-card__refused\"\n\t\t\t\t\t\tdata-testid=\"cn-audit-card-refused\">{{ refusedLabel }}</span>\n\t\t\t\t</dd>\n\t\t\t</template>\n\t\t</dl>\n\t\t<ul v-else class=\"cn-audit-card__list\">\n\t\t\t<li\n\t\t\t\tv-for=\"entry in displayedEntries\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\tclass=\"cn-audit-card__row\"\n\t\t\t\t:class=\"{ 'cn-audit-card__row--stacked': layout === 'stacked', 'cn-audit-card__row--compact': density === 'compact' }\">\n\t\t\t\t<div class=\"cn-audit-card__row-head\">\n\t\t\t\t\t<strong class=\"cn-audit-card__action\">{{ formatAction(entry) }}</strong>\n\t\t\t\t\t<span v-if=\"layout !== 'stacked'\" class=\"cn-audit-card__when\">{{ formatWhen(entry) }}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-audit-card__row-body\">\n\t\t\t\t\t<span v-if=\"layout === 'stacked'\" class=\"cn-audit-card__when\" data-testid=\"cn-audit-card-when-below\">{{ stackedLine(entry) }}</span>\n\t\t\t\t\t<span v-else class=\"cn-audit-card__actor\">{{ formatActor(entry) }}</span>\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"entry.authorized === false\"\n\t\t\t\t\t\tclass=\"cn-audit-card__refused\"\n\t\t\t\t\t\tdata-testid=\"cn-audit-card-refused\">{{ refusedLabel }}</span>\n\t\t\t\t</div>\n\t\t\t\t<p v-if=\"entry.reason\" class=\"cn-audit-card__reason\">\n\t\t\t\t\t{{ entry.reason }}\n\t\t\t\t</p>\n\t\t\t</li>\n\t\t</ul>\n\t\t<p v-if=\"footnote\" class=\"cn-audit-card__footnote\" data-testid=\"cn-audit-trail-widget-footnote\">\n\t\t\t{{ footnote }}\n\t\t</p>\n\t\t<template v-if=\"offersShowAll && shownEntries.length > maxDisplay\" #footer>\n\t\t\t<button class=\"cn-audit-card__show-all\" @click=\"$emit('show-all')\">\n\t\t\t\t{{ showAllLabel }} ({{ shownEntries.length }})\n\t\t\t</button>\n\t\t</template>\n\t</CnDetailCard>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon } from '@nextcloud/vue'\nimport { markRaw } from 'vue'\nimport History from 'vue-material-design-icons/History.vue'\nimport CnDetailCard from '../CnDetailCard/CnDetailCard.vue'\nimport { auditExclusionParams, keepAuditEntries } from '../../utils/auditEntries.js'\nimport { actionLabelFor, changedValue, changeLabelFor, fillAuditLabel } from '../../utils/auditLabels.js'\nimport { formatBoardDate, formatTimeOfDay } from '../../utils/boardDate.js'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { leafSourceUrl } from '../../utils/leafSourceUrl.js'\nimport { userDisplayName } from '../../utils/userDisplayName.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\n/**\n * @param {object} entry An audit entry.\n * @return {number} When it happened, in ms; 0 when unreadable.\n */\nfunction entryTime(entry) {\n\tconst time = new Date(entry.creationDateTime || entry.created || entry.timestamp || 0).getTime()\n\treturn Number.isNaN(time) ? 0 : time\n}\n\n/**\n * CnAuditTrailCard — compact audit-trail widget rendered by the\n * integration registry on dashboard and detail surfaces.\n *\n * Basic usage\n * ```vue\n * <CnAuditTrailCard\n * :register=\"registerId\"\n * :schema=\"schemaId\"\n * :object-id=\"objectId\"\n * surface=\"detail-page\" />\n * ```\n */\nexport default {\n\tname: 'CnAuditTrailCard',\n\n\tcomponents: { CnDetailCard, NcLoadingIcon },\n\n\tprops: {\n\t\t/**\n\t\t * A muted line under the trail, inside the card (\"Kenmerk ZT-OMV-REG\").\n\t\t *\n\t\t * @spec openspec/changes/audit-trail-footnote/specs/audit-trail/spec.md#requirement-a-history-card-can-end-in-a-line-about-the-record\n\t\t */\n\t\tfootnote: { type: String, default: '' },\n\t\t/** OpenRegister register id (slug or uuid). Optional for `scope: \"app\"`. */\n\t\tregister: { type: String, default: '' },\n\t\t/** OpenRegister schema id (slug or uuid). Optional for `scope: \"app\"`. */\n\t\tschema: { type: String, default: '' },\n\t\t/** Parent object id. Required for `scope: \"object\"` (the default); unused for `scope: \"app\"`. */\n\t\tobjectId: { type: String, default: '' },\n\t\t/**\n\t\t * What the card lists. `object` (the default) is one object's trail\n\t\t * and needs `register`, `schema` and `objectId`. `app` is the\n\t\t * app-wide feed: the entries of every object the caller may read\n\t\t * (OpenRegister's `/audit-trails/readable`), narrowed to `register`\n\t\t * and `schema` when those are set.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-the-audit-trail-widget-reads-the-app-wide-feed\n\t\t */\n\t\tscope: {\n\t\t\ttype: String,\n\t\t\tdefault: 'object',\n\t\t\tvalidator: (value) => ['object', 'app'].includes(value),\n\t\t},\n\n\t\t/** Rendering surface — passed for AD-19 surface fallback consumers. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'detail-page',\n\t\t\tvalidator: (value) => ['user-dashboard', 'app-dashboard', 'detail-page', 'single-entity'].includes(value),\n\t\t},\n\n\t\t/** Base API URL. */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\n\t\t/**\n\t\t * Read the trail of something that is not an OpenRegister object:\n\t\t * `{ kind: 'flow-task', id }` reads `${apiBase}/flow-tasks/{id}/audit`,\n\t\t * oldest first. `id` may be left out or written `@objectId`.\n\t\t *\n\t\t * @type {{kind: string, id?: (string|number)}|null}\n\t\t */\n\t\tsource: { type: Object, default: null },\n\n\t\t/** A trail URL that replaces the object's own; `{id}` is filled with the source's id or `objectId`. */\n\t\tendpoint: { type: String, default: '' },\n\n\t\t/** `newest` first (the object trail's order) or `oldest` first; empty takes `oldest` for a source and `newest` otherwise. */\n\t\torder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (value) => ['', 'newest', 'oldest'].includes(value),\n\t\t},\n\n\t\t/** Maximum rows to render. */\n\t\tmaxDisplay: { type: Number, default: 5 },\n\t\t/**\n\t\t * `stacked` (DqTaak \"Historie\"): the action, then one muted line under\n\t\t * it with the moment (\"6 okt 09:05\") and who, when the action does not\n\t\t * already name them. Default: the moment beside the action, who under it.\n\t\t * `dated` (PqJourney \"Geschiedenis\"): a two-column list, the short date\n\t\t * (\"2 okt\") beside what happened; who shows only where the action's\n\t\t * label names them (`{actor}`).\n\t\t */\n\t\tlayout: { type: String, default: '' },\n\t\t/**\n\t\t * `compact` draws the rows closer together: in the board look a\n\t\t * stacked row 10px above and below (DqZaaktype \"Historie\") instead of\n\t\t * 12px (DqTaak). Default: the layout's own spacing.\n\t\t *\n\t\t * @spec openspec/changes/audit-card-compact-stacked-rows/specs/audit-trail/spec.md#requirement-a-stacked-audit-card-can-draw-compact-rows\n\t\t */\n\t\tdensity: { type: String, default: '' },\n\t\t/**\n\t\t * Actions the card leaves out (case-insensitive), such as `['read']`\n\t\t * for a history of what changed. It then reads more entries than it\n\t\t * shows, so the rows it leaves out do not crowd the rest away.\n\t\t *\n\t\t * @spec openspec/changes/audit-trail-exclude-actions/specs/audit-trail/spec.md#requirement-a-history-card-can-leave-out-events-by-action\n\t\t */\n\t\texcludeActions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Actors the card leaves out by user id (case-insensitive), such as\n\t\t * `['System']` for a history of what people did: the bookkeeping a\n\t\t * background job writes is not shown.\n\t\t *\n\t\t * @spec openspec/changes/audit-card-exclude-actors/specs/audit-trail/spec.md#requirement-a-history-card-can-leave-out-entries-by-actor\n\t\t */\n\t\texcludeActors: { type: Array, default: () => [] },\n\t\t/** Whether the card collapses. */\n\t\tcollapsible: { type: Boolean, default: false },\n\t\t/** Override the card title (defaults to the translated label). */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Pre-translated empty label. */\n\t\tnoEntriesLabel: { type: String, default: () => t('nextcloud-vue', 'No audit entries yet') },\n\t\t/** Pre-translated overflow label. */\n\t\tshowAllLabel: { type: String, default: () => t('nextcloud-vue', 'Show all') },\n\t\t/** Pre-translated fallback action label. */\n\t\tactionLabel: { type: String, default: () => t('nextcloud-vue', 'Change') },\n\t\t/** Shown on an entry the server refused (`authorized: false`). */\n\t\trefusedLabel: { type: String, default: () => t('nextcloud-vue', '(refused)') },\n\t\t/**\n\t\t * What happened, in words, by action (`claim`) or by action and the\n\t\t * state it led to (`complete:completed`, tried first). `{actor}`,\n\t\t * `{state}` and `{changed.<key>}` (a value the entry recorded, a dotted key\n\t\t * reading into it such as `{changed.data.fileName}`, in the\n\t\t * words of `valueLabels`) are filled in; a label that names the actor leaves it off\n\t\t * the line under it. An action without a label shows as written.\n\t\t *\n\t\t * @type {Object<string, string>|null}\n\t\t */\n\t\tactionLabels: { type: Object, default: null },\n\t\t/**\n\t\t * Words for the values an action label quotes as `{changed.<key>}`:\n\t\t * `{ purpose: { handling: 'Handling' } }`. A value without an entry\n\t\t * shows as written.\n\t\t *\n\t\t * @type {{[key: string]: {[value: string]: string}}|null}\n\t\t */\n\t\tvalueLabels: { type: Object, default: null },\n\t\t/**\n\t\t * What happened, in words, by the field an entry changed: rules\n\t\t * `[{ action?, field, to?, label }]`, the first whose `field` the entry\n\t\t * changed (to `to`, when given) wins over `actionLabels`. A label fills\n\t\t * the same tokens, plus `{object.<path>}` from `object`\n\t\t * (\"Version {object.version} published\" for `isDraft` set to false).\n\t\t *\n\t\t * @type {Array<{action?: string, field: string, to?: unknown, label: string}>}\n\t\t */\n\t\tchangeLabels: { type: Array, default: () => [] },\n\t\t/** The audited record, for `{object.<path>}` in a label; null without one. */\n\t\tobject: { type: Object, default: null },\n\t\t/**\n\t\t * Records beside the object whose events belong in its history:\n\t\t * `[{ as, register, schema, filter, limit? }]`. The card lists the\n\t\t * objects matching `filter` (`@objectId` is this object; at most\n\t\t * `limit`, default 5), reads their trails and merges the entries with\n\t\t * the object's own, newest first. A related entry is labelled by\n\t\t * `actionLabels[\"<as>.<action>\"]` first. Object scope only.\n\t\t *\n\t\t * @type {Array<{as: string, register: string, schema: string, filter?: object, limit?: number}>}\n\t\t * @spec openspec/changes/audit-trail-related-sources/specs/audit-trail/spec.md#requirement-an-objects-history-can-include-the-events-of-records-beside-it\n\t\t */\n\t\trelatedSources: { type: Array, default: () => [] },\n\t\t/** Shown when a `source` or `endpoint` read failed. */\n\t\tfailedLabel: { type: String, default: () => t('nextcloud-vue', 'The history could not be loaded') },\n\t},\n\n\temits: ['show-all'],\n\n\tdata() {\n\t\treturn {\n\t\t\tHistory: markRaw(History),\n\t\t\tentries: [],\n\t\t\tloading: false,\n\t\t\t/** A `source` or `endpoint` read failed: said, rather than shown as an empty trail. */\n\t\t\tfailed: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tresolvedTitle() {\n\t\t\treturn this.title || t('nextcloud-vue', 'Audit trail')\n\t\t},\n\n\t\t/**\n\t\t * Whether the host listens for `show-all`. The audit-trail widget binds\n\t\t * no listener, and a button that does nothing is not offered.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\toffersShowAll() {\n\t\t\treturn typeof this.$.vnode.props?.onShowAll === 'function'\n\t\t},\n\n\t\t/**\n\t\t * The entries without the excluded actions and actors, and without an\n\t\t * update that changed nothing: a re-save whose `changed` holds no field\n\t\t * whose old and new value differ (only `@self` bookkeeping) is not\n\t\t * something that happened to the record.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tshownEntries() {\n\t\t\treturn keepAuditEntries(this.entries, { excludeActions: this.excludeActions, excludeActors: this.excludeActors })\n\t\t},\n\n\t\t/** @return {boolean} Whether the card leaves entries out, and so reads more than it shows. */\n\t\tfiltersEntries() {\n\t\t\treturn this.excludeActions.length > 0 || this.excludeActors.length > 0\n\t\t},\n\n\t\tdisplayedEntries() {\n\t\t\tconst entries = this.oldestFirst ? [...this.shownEntries].sort((a, b) => entryTime(a) - entryTime(b)) : this.shownEntries\n\t\t\treturn entries.slice(0, this.maxDisplay)\n\t\t},\n\n\t\t/**\n\t\t * The trail URL a `source` or `endpoint` names, '' while its record id\n\t\t * is unknown, or null when the card reads an object.\n\t\t *\n\t\t * @return {string|null}\n\t\t * @spec openspec/changes/leaf-cards-read-a-source/specs/leaf-cards-read-a-source/spec.md#requirement-a-leaf-card-reads-a-source-or-an-endpoint\n\t\t */\n\t\tsourceUrl() {\n\t\t\treturn leafSourceUrl({ source: this.source, endpoint: this.endpoint, apiBase: this.apiBase, objectId: this.objectId }, 'audit')\n\t\t},\n\n\t\t/** @return {boolean} Whether the entries read oldest first. */\n\t\toldestFirst() {\n\t\t\treturn this.order === 'oldest' || (this.order === '' && this.sourceUrl !== null)\n\t\t},\n\n\t\t/**\n\t\t * The path the card reads (prefixed at fetch time), or '' when it has nothing to read: the\n\t\t * object's own trail, or the app-wide readable feed narrowed to the\n\t\t * register and schema when set.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-the-audit-trail-widget-reads-the-app-wide-feed\n\t\t * @return {string}\n\t\t */\n\t\tfetchUrl() {\n\t\t\tif (this.sourceUrl !== null) {\n\t\t\t\treturn this.sourceUrl\n\t\t\t}\n\t\t\tconst limit = this.filtersEntries ? Math.min(100, this.maxDisplay * 10) : this.maxDisplay\n\t\t\tconst params = new URLSearchParams({ limit: String(limit) })\n\t\t\tif (this.scope === 'app') {\n\t\t\t\tif (this.register) {\n\t\t\t\t\tparams.set('register', this.register)\n\t\t\t\t}\n\t\t\t\tif (this.schema) {\n\t\t\t\t\tparams.set('schema', this.schema)\n\t\t\t\t}\n\t\t\t\treturn `${this.apiBase}/audit-trails/readable?${params.toString()}`\n\t\t\t}\n\t\t\tif (!this.register || !this.schema || !this.objectId) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tthis.addExclusions(params)\n\t\t\treturn `${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/audit-trails?${params.toString()}`\n\t\t},\n\t},\n\n\twatch: {\n\t\tfetchUrl: {\n\t\t\timmediate: true,\n\t\t\thandler(url) {\n\t\t\t\tif (url) {\n\t\t\t\t\tthis.fetchEntries()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Ask an object trail to leave out the excluded actions and actors in\n\t\t * the query (`action[notIn]`, `user[notIn]`), so its pages hold what the\n\t\t * card shows. `keepAuditEntries` still filters what comes back.\n\t\t *\n\t\t * @param {URLSearchParams} params The trail query, changed in place.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/audit-card-exclusions-in-the-query/specs/audit-trail/spec.md#requirement-a-history-card-asks-the-trail-to-leave-out-what-it-hides\n\t\t */\n\t\taddExclusions(params) {\n\t\t\tfor (const [key, value] of Object.entries(auditExclusionParams({ excludeActions: this.excludeActions, excludeActors: this.excludeActors }))) {\n\t\t\t\tparams.set(key, value)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read the entries from `fetchUrl`. The readable feed answers\n\t\t * `{ rows, nextCursor }`, the object trail `{ results }`.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-the-audit-trail-widget-reads-the-app-wide-feed\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchEntries() {\n\t\t\tconst url = this.fetchUrl\n\t\t\tif (!url) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.failed = false\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst list = data.results || data.rows || data\n\t\t\t\t\tconst own = await this.withFollowingPages(url, Array.isArray(list) ? list : [])\n\t\t\t\t\tconst related = await this.fetchRelatedEntries()\n\t\t\t\t\tthis.entries = related.length > 0\n\t\t\t\t\t\t? [...own, ...related].sort((a, b) => entryTime(b) - entryTime(a))\n\t\t\t\t\t\t: own\n\t\t\t\t} else {\n\t\t\t\t\tthis.entries = []\n\t\t\t\t\tthis.failed = this.sourceUrl !== null\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('[CnAuditTrailCard] failed to fetch audit trail', err)\n\t\t\t\tthis.entries = []\n\t\t\t\tthis.failed = this.sourceUrl !== null\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * An object's trail read on until it holds enough entries to show. The\n\t\t * card leaves entries out (reads, actors, empty re-saves) after\n\t\t * reading, and every page view writes a read, so the newest page alone\n\t\t * can be all reads (DqHandhaving Historie: \"no changes yet\"). Reads at\n\t\t * most four more pages.\n\t\t *\n\t\t * @param {string} url The first page's path.\n\t\t * @param {Array<object>} first The first page's entries.\n\t\t * @return {Promise<Array<object>>} The entries read.\n\t\t */\n\t\tasync withFollowingPages(url, first) {\n\t\t\tconst entries = [...first]\n\t\t\tif (!this.filtersEntries || this.scope !== 'object' || this.sourceUrl !== null) {\n\t\t\t\treturn entries\n\t\t\t}\n\t\t\tconst limit = Number(new URLSearchParams(url.split('?')[1] || '').get('limit')) || first.length\n\t\t\tlet page = first\n\t\t\tfor (let more = 0; more < 4 && page.length >= limit && limit > 0; more++) {\n\t\t\t\tthis.entries = [...entries]\n\t\t\t\tif (this.shownEntries.length >= this.maxDisplay) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tconst next = new URL(url, 'http://x')\n\t\t\t\tnext.searchParams.set('offset', String(entries.length))\n\t\t\t\tconst response = await fetch(prefixUrl(next.pathname + next.search), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = data.results || data.rows || data\n\t\t\t\tpage = Array.isArray(list) ? list : []\n\t\t\t\tentries.push(...page)\n\t\t\t}\n\t\t\treturn [...entries]\n\t\t},\n\n\t\t/**\n\t\t * The entries of the records beside the object (`relatedSources`),\n\t\t * each tagged with its source's `as`. A read that fails leaves that\n\t\t * source out.\n\t\t *\n\t\t * @return {Promise<Array<object>>} The entries.\n\t\t * @spec openspec/changes/audit-trail-related-sources/specs/audit-trail/spec.md#requirement-an-objects-history-can-include-the-events-of-records-beside-it\n\t\t */\n\t\tasync fetchRelatedEntries() {\n\t\t\tif (this.scope !== 'object' || this.sourceUrl !== null || !this.objectId || !Array.isArray(this.relatedSources)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst limit = this.filtersEntries ? Math.min(100, this.maxDisplay * 10) : this.maxDisplay\n\t\t\tconst read = async (url) => {\n\t\t\t\tconst response = await fetch(prefixUrl(url), { headers: buildHeaders() })\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new Error(String(response.status))\n\t\t\t\t}\n\t\t\t\tconst data = await response.json()\n\t\t\t\tconst list = data.results || data.rows || data\n\t\t\t\treturn Array.isArray(list) ? list : []\n\t\t\t}\n\t\t\tconst perSource = await Promise.all(this.relatedSources\n\t\t\t\t.filter((source) => source && source.register && source.schema)\n\t\t\t\t.map(async (source) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst params = new URLSearchParams({ _limit: String(Number(source.limit) > 0 ? Number(source.limit) : 5), _order: JSON.stringify({ '@self.created': 'DESC' }) })\n\t\t\t\t\t\tfor (const [key, value] of Object.entries(source.filter || {})) {\n\t\t\t\t\t\t\tparams.set(key, value === '@objectId' ? this.objectId : String(value))\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst objects = await read(`${this.apiBase}/objects/${source.register}/${source.schema}?${params.toString()}`)\n\t\t\t\t\t\tconst ids = objects.map((object) => object?.id || object?.['@self']?.id || object?.uuid).filter(Boolean)\n\t\t\t\t\t\tconst trailParams = new URLSearchParams({ limit: String(limit) })\n\t\t\t\t\t\tthis.addExclusions(trailParams)\n\t\t\t\t\t\tconst trails = await Promise.all(ids.map((id) => read(`${this.apiBase}/objects/${source.register}/${source.schema}/${id}/audit-trails?${trailParams.toString()}`).catch(() => [])))\n\t\t\t\t\t\treturn trails.flat().map((entry) => ({ ...entry, relatedAs: source.as || source.schema }))\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t\treturn perSource.flat()\n\t\t},\n\n\t\t/**\n\t\t * What happened: the action, with the state it led to when the entry\n\t\t * names one (a flow task's `stateAfter`).\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The line.\n\t\t */\n\t\tformatAction(entry) {\n\t\t\tconst label = this.changeLabelFor(entry) ?? this.labelFor(entry)\n\t\t\tif (label !== null) {\n\t\t\t\treturn fillAuditLabel(label, entry, { actor: this.actorName(entry), object: this.object, valueLabels: this.valueLabels })\n\t\t\t}\n\t\t\tconst action = entry.action || entry.event || this.actionLabel\n\t\t\treturn entry.stateAfter ? `${action} (${entry.stateAfter})` : action\n\t\t},\n\n\t\t/**\n\t\t * A value the entry recorded under `changed` (an audit entry's context),\n\t\t * in the words of `valueLabels`; '' when it recorded none.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @param {string} key The recorded key.\n\t\t * @return {string} The value in words.\n\t\t * @spec openspec/changes/audit-label-changed-values/specs/audit-trail/spec.md#requirement-a-trail-label-can-quote-what-the-entry-recorded\n\t\t */\n\t\tchangedValue(entry, key) {\n\t\t\treturn changedValue(entry, key, this.valueLabels)\n\t\t},\n\n\t\t/**\n\t\t * The `changeLabels` rule an entry matches: the first whose field the\n\t\t * entry changed, for its action and to its value when the rule names them.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string|null} The label, or null when no rule matches.\n\t\t */\n\t\tchangeLabelFor(entry) {\n\t\t\treturn changeLabelFor(entry, this.changeLabels)\n\t\t},\n\n\t\t/**\n\t\t * The `actionLabels` entry for an entry: by action and state first,\n\t\t * then by action.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string|null} The label, or null when none is declared.\n\t\t * @spec openspec/changes/audit-trail-action-labels/specs/audit-trail/spec.md#requirement-a-trail-can-say-what-happened-in-words\n\t\t */\n\t\tlabelFor(entry) {\n\t\t\treturn actionLabelFor(entry, this.actionLabels, this.object)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} Who did it, by name where the entry carries one.\n\t\t */\n\t\tactorName(entry) {\n\t\t\tif (entry.actorDisplayName) {\n\t\t\t\treturn entry.actorDisplayName\n\t\t\t}\n\t\t\tconst id = entry.actor || entry.userId || entry.user || ''\n\t\t\t// A person's user id reads as their display name once it is known.\n\t\t\treturn (id && (!entry.performerType || entry.performerType === 'user') && userDisplayName(String(id))) || id\n\t\t},\n\n\t\t/**\n\t\t * The date of a dated list's entry in the board's short form (\"2 okt\").\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The date, or '' without one.\n\t\t * @spec openspec/changes/audit-card-dated-layout/specs/audit-trail/spec.md#requirement-an-audit-list-can-put-the-date-beside-what-happened\n\t\t */\n\t\tshortDate(entry) {\n\t\t\treturn formatBoardDate(entry.creationDateTime || entry.created || entry.timestamp)\n\t\t},\n\n\t\t/**\n\t\t * The muted line of a stacked row: the moment in the board's short\n\t\t * form (\"6 okt 09:05\") and who, unless the action names them already.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The line.\n\t\t * @spec openspec/changes/audit-card-stacked-rows/specs/audit-trail/spec.md#requirement-an-audit-row-can-put-its-moment-under-the-action\n\t\t */\n\t\tstackedLine(entry) {\n\t\t\tconst raw = entry.creationDateTime || entry.created || entry.timestamp\n\t\t\tconst date = raw ? new Date(raw) : null\n\t\t\tconst when = date && !Number.isNaN(date.getTime()) ? `${formatBoardDate(date)} ${formatTimeOfDay(date)}` : ''\n\t\t\treturn [when, this.formatActor(entry)].filter((part) => part !== '').join(' · ')\n\t\t},\n\n\t\t/**\n\t\t * Who did it: the actor, the kind of performer when it is not a\n\t\t * person (a flow, the system), and on whose behalf.\n\t\t *\n\t\t * @param {object} entry The entry.\n\t\t * @return {string} The line.\n\t\t */\n\t\tformatActor(entry) {\n\t\t\tconst named = (this.labelFor(entry) || '').includes('{actor}')\n\t\t\tconst parts = [named ? '' : this.actorName(entry)]\n\t\t\tif (entry.performerType && entry.performerType !== 'user') {\n\t\t\t\tparts.push(`(${entry.performerType})`)\n\t\t\t}\n\t\t\tif (entry.onBehalfOf) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'on behalf of {name}', { name: entry.onBehalfOf }))\n\t\t\t}\n\t\t\treturn parts.filter((part) => part !== '').join(' ')\n\t\t},\n\n\t\tformatWhen(entry) {\n\t\t\tconst raw = entry.creationDateTime || entry.created || entry.timestamp\n\t\t\tif (raw === undefined || raw === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst d = new Date(raw)\n\t\t\tif (Number.isNaN(d.getTime()) === true) {\n\t\t\t\treturn String(raw)\n\t\t\t}\n\t\t\treturn d.toLocaleString(userLocale())\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-audit-card__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n/* Nextcloud core pads and aligns `dt` / `dd`; the list resets both. */\n.cn-audit-card__dated {\n\tdisplay: grid;\n\tgrid-template-columns: max-content minmax(0, 1fr);\n\tgap: 8px 16px;\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 14px;\n}\n\n.cn-audit-card__dated .cn-audit-card__date {\n\twidth: auto;\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\twhite-space: nowrap;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-audit-card__dated .cn-audit-card__dated-text {\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\toverflow-wrap: anywhere;\n}\n\n.cn-audit-card__row {\n\tpadding: 6px 0;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-audit-card__row:last-child {\n\tborder-bottom: none;\n}\n\n.cn-audit-card__row-head {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 8px;\n}\n\n.cn-audit-card__action {\n\tcolor: var(--color-main-text);\n}\n\n.cn-audit-card__when {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\twhite-space: nowrap;\n}\n\n.cn-audit-card__row-body {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n}\n\n.cn-audit-card__refused {\n\tmargin-inline-start: 6px;\n\tfont-weight: 700;\n\tcolor: var(--color-error-text, var(--color-main-text));\n}\n\n.cn-audit-card__reason {\n\tmargin: 2px 0 0;\n\tfont-size: 0.9em;\n\toverflow-wrap: anywhere;\n}\n\n.cn-audit-card__empty {\n\tcolor: var(--color-text-maxcontrast);\n\ttext-align: center;\n\tpadding: 12px 0;\n}\n\n.cn-audit-card__footnote {\n\tmargin: 12px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-audit-card__show-all {\n\tbackground: none;\n\tborder: none;\n\tcolor: var(--color-primary-element);\n\tcurs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