@acorex-platform/module-workplacesafety-management-client 0.0.33 → 0.0.38

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 (102) hide show
  1. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-mzaaZ6T3.mjs → acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Ds0Fkspp.mjs} +20 -12
  2. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-mzaaZ6T3.mjs.map → acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Ds0Fkspp.mjs.map} +1 -1
  3. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-hierarchy-levels.mjs.map +1 -1
  4. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-measure.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs +1 -1
  6. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-register.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-risk.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs +71 -88
  10. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-ppe-item.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs +35 -1
  13. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs +35 -1
  15. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs +70 -11
  19. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs.map +1 -1
  20. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs +3 -3
  21. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs.map +1 -1
  22. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-section-type.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs +35 -1
  24. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs.map +1 -1
  25. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-CeTmhod5.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-BI4TLvSE.mjs} +16 -16
  26. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-CeTmhod5.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-BI4TLvSE.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-Dae2kkZe.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-COlCNnyK.mjs} +2 -2
  28. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-Dae2kkZe.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-COlCNnyK.mjs.map} +1 -1
  29. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-CpNcN6Pf.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BrXGzqZU.mjs} +2 -2
  30. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-CpNcN6Pf.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BrXGzqZU.mjs.map} +1 -1
  31. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-BcsAnO9h.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DHJus7OP.mjs} +3 -3
  32. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DHJus7OP.mjs.map +1 -0
  33. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-C9wGZ3hB.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-CogjoDox.mjs} +2 -2
  34. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-C9wGZ3hB.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-CogjoDox.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-AUr2GVLU.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-9UWHmIXV.mjs} +2 -2
  36. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-AUr2GVLU.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-9UWHmIXV.mjs.map} +1 -1
  37. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-J6fveZKA.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-CNPbxULL.mjs} +12 -29
  38. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-CNPbxULL.mjs.map +1 -0
  39. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-3fQPlBBf.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-D5iOBl3P.mjs} +2 -2
  40. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-3fQPlBBf.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-D5iOBl3P.mjs.map} +1 -1
  41. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-BRGcQo7H.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-TdIMIkM7.mjs} +37 -3
  42. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-TdIMIkM7.mjs.map +1 -0
  43. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BPx-3rYX.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-DJAI-7lB.mjs} +3 -3
  44. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BPx-3rYX.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-DJAI-7lB.mjs.map} +1 -1
  45. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-_nG09ZpE.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BGZ1VAW3.mjs} +3 -3
  46. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-_nG09ZpE.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BGZ1VAW3.mjs.map} +1 -1
  47. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-CIH7W9R7.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-B6NYL4xi.mjs} +2 -2
  48. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-CIH7W9R7.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-B6NYL4xi.mjs.map} +1 -1
  49. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-DmFYsBhI.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs} +2 -2
  50. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-DmFYsBhI.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs.map} +1 -1
  51. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-CUDh_ZfQ.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-BSUR9jqs.mjs} +72 -13
  52. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-BSUR9jqs.mjs.map +1 -0
  53. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-BxNUXvae.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-CIHy_hLh.mjs} +5 -5
  54. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-CIHy_hLh.mjs.map +1 -0
  55. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-73MUyaIk.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-Cs4nIHou.mjs} +2 -2
  56. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-73MUyaIk.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-Cs4nIHou.mjs.map} +1 -1
  57. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-Ujxum2GY.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-CJFWDOoh.mjs} +3 -3
  58. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-Ujxum2GY.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-CJFWDOoh.mjs.map} +1 -1
  59. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog.mjs +1 -1
  60. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs +38 -3
  61. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs.map +1 -1
  62. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-CnTEwf_l.mjs → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-eDWG-sJ7.mjs} +2 -2
  63. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-CnTEwf_l.mjs.map → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-eDWG-sJ7.mjs.map} +1 -1
  64. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-BI9VkzNw.mjs → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-CfxHwZtH.mjs} +3 -3
  65. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-BI9VkzNw.mjs.map → acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.component-CfxHwZtH.mjs.map} +1 -1
  66. package/fesm2022/acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-tMrUDnCb.mjs.map +1 -1
  67. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-o4bAwYcq.mjs → acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-6ZWaO5DG.mjs} +3 -3
  68. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-6ZWaO5DG.mjs.map +1 -0
  69. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-B6IkRYbW.mjs.map +1 -1
  70. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-index-LxP1eZLY.mjs → acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs} +316 -375
  71. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs.map +1 -0
  72. package/fesm2022/acorex-platform-module-workplacesafety-management-client-local-entities.mjs.map +1 -1
  73. package/fesm2022/acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-column.component-D2Mmow12.mjs.map +1 -1
  74. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-CQtVhCgw.mjs → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-BqHXrGn9.mjs} +2 -2
  75. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-CQtVhCgw.mjs.map → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer-widget-edit.component-BqHXrGn9.mjs.map} +1 -1
  76. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-YS8FHiRu.mjs → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-BxcGph1I.mjs} +3 -3
  77. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-YS8FHiRu.mjs.map → acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.service-BxcGph1I.mjs.map} +1 -1
  78. package/fesm2022/acorex-platform-module-workplacesafety-management-client-ppe-item-viewer.util-2Kl3_3sg.mjs.map +1 -1
  79. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-Dd9xdo_y.mjs.map +1 -1
  80. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs +254 -0
  81. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs.map +1 -0
  82. package/fesm2022/acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-Ci-zcrmO.mjs.map +1 -1
  83. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-6i0RkG3L.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs} +10 -10
  84. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-6i0RkG3L.mjs.map → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs.map} +1 -1
  85. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs +36 -0
  86. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs.map +1 -0
  87. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs +204 -0
  88. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs.map +1 -0
  89. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BpWx3gIf.mjs.map +1 -1
  90. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BlPzzCc2.mjs → acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CLj3y_JD.mjs} +4 -209
  91. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CLj3y_JD.mjs.map +1 -0
  92. package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs +1 -1
  93. package/package.json +2 -2
  94. package/types/acorex-platform-module-workplacesafety-management-client-contracts.d.ts +26 -3
  95. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-BcsAnO9h.mjs.map +0 -1
  96. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-J6fveZKA.mjs.map +0 -1
  97. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-BRGcQo7H.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-CUDh_ZfQ.mjs.map +0 -1
  99. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-BxNUXvae.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-o4bAwYcq.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-LxP1eZLY.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BlPzzCc2.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"acorex-platform-module-workplacesafety-management-client-index-LxP1eZLY.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-section-widget-options.util.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-section-widget-options.service.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-section-builder.component.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-section-builder.component.html","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-preview/safety-plan-preview.service.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-sections-page.component.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-sections-page-component.provider.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport type {\n AXPBuilderSection,\n AXPWidgetPropertyInjection,\n} from '@acorex-platform/framework-client/layout/components';\nimport { AXP_BEHAVIOR_PROPERTY_GROUP } from '@acorex-platform/framework-client/layout/widgets';\nimport { AXPWidgetsList, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';\nimport { createBooleanProperty } from '@acorex-platform/framework-shared/widget-core';\nimport {\n asSafetyPlanDisplayText,\n resolveEntityRefId,\n resolveSectionTypeKey,\n type AXMSafetyPlanSectionWidgetOptions,\n type AXMSectionTypeCode,\n type AXMSectionTypeSnapshot,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\nimport { PPE_ITEM_VIEWER_WIDGET_NAME } from '../ppe-item-viewer/ppe-item-viewer.types';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport type AXMSafetyPlanConfigurableWidgetType =\n | typeof PPE_ITEM_VIEWER_WIDGET_NAME\n | typeof AXPWidgetsList.Editors.ControlHierarchyDiagram;\n\n//#endregion\n\n//#region ----- Constants -----\n\nexport const SAFETY_PLAN_PPE_WIDGET_PROPERTY_EXCLUDE = [\n 'name',\n 'path',\n 'ppeItems',\n 'readonly',\n 'disabled',\n 'triggers',\n 'requiredValidation',\n] as const;\n\nexport const SAFETY_PLAN_HIERARCHY_WIDGET_PROPERTY_EXCLUDE = ['name', 'path'] as const;\n\nconst PPE_OPTION_KEYS = ['layout'] as const;\nconst HIERARCHY_OPTION_KEYS = ['viewType', 'showTitle', 'showViewTypeSelector'] as const;\n\n//#endregion\n\n//#region ----- Resolve -----\n\nexport function resolveSafetyPlanSectionConfigurableWidgetType(\n sectionTypeId: string | undefined,\n snapshot?: AXMSectionTypeSnapshot,\n sectionTitle?: unknown,\n sectionDescription?: unknown,\n): AXMSafetyPlanConfigurableWidgetType | null {\n const resolvedKeys = [\n resolveSectionTypeKey(sectionTypeId, snapshot),\n resolveSectionTypeKeyFromCode(snapshot?.code),\n resolveSectionTypeKeyFromTitle(sectionTitle),\n resolveSectionTypeKeyFromTitle(snapshot?.title),\n resolveSectionTypeKeyFromDescription(sectionDescription),\n resolveSectionTypeKeyFromDescription(snapshot?.description),\n ];\n if (resolvedKeys.includes('Ppe')) {\n return PPE_ITEM_VIEWER_WIDGET_NAME;\n }\n if (resolvedKeys.includes('HierarchyLevel')) {\n return AXPWidgetsList.Editors.ControlHierarchyDiagram;\n }\n return null;\n}\n\nfunction resolveSectionTypeKeyFromCode(code: string | undefined): AXMSectionTypeCode | undefined {\n const compact = asSafetyPlanDisplayText(code).replace(/\\s+/g, '').toLowerCase();\n if (!compact) {\n return undefined;\n }\n if (compact === 'hierarchylevel' || compact === 'hierarchy') {\n return 'HierarchyLevel';\n }\n if (compact === 'ppe') {\n return 'Ppe';\n }\n return undefined;\n}\n\nfunction resolveSectionTypeKeyFromTitle(title: unknown): AXMSectionTypeCode | undefined {\n const compact = asSafetyPlanDisplayText(title).replace(/\\s+/g, '').toLowerCase();\n if (!compact) {\n return undefined;\n }\n if (compact === 'hierarchylevel' || compact.includes('hierarchy')) {\n return 'HierarchyLevel';\n }\n if (compact === 'ppe' || compact === 'ppeitem' || compact === 'ppeitems') {\n return 'Ppe';\n }\n return undefined;\n}\n\nfunction resolveSectionTypeKeyFromDescription(description: unknown): AXMSectionTypeCode | undefined {\n const text = asSafetyPlanDisplayText(description).toLowerCase();\n if (!text) {\n return undefined;\n }\n if (text.includes('control hierarchy')) {\n return 'HierarchyLevel';\n }\n if (text.includes('personal protective equipment')) {\n return 'Ppe';\n }\n return undefined;\n}\n\nfunction readBuilderSectionTypeId(section: AXPBuilderSection): string | undefined {\n return resolveEntityRefId(section['sectionTypeId']) ?? resolveEntityRefId(section['sectionType']) ?? undefined;\n}\n\nexport function resolveConfigurableWidgetTypeForSection(\n section: AXPBuilderSection,\n): AXMSafetyPlanConfigurableWidgetType | null {\n return resolveSafetyPlanSectionConfigurableWidgetType(\n readBuilderSectionTypeId(section),\n section['sectionType'] as AXMSectionTypeSnapshot | undefined,\n section['title'],\n section['description'],\n );\n}\n\nexport function canConfigureSafetyPlanSectionWidget(section: AXPBuilderSection): boolean {\n return resolveConfigurableWidgetTypeForSection(section) != null;\n}\n\nexport function widgetTitleKeyForConfigurableType(widgetType: AXMSafetyPlanConfigurableWidgetType): string {\n if (widgetType === PPE_ITEM_VIEWER_WIDGET_NAME) {\n return '@workplacesafety-management:ppe-items.components.ppe-item-viewer.widget-title';\n }\n return '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.widget-title';\n}\n\n//#endregion\n\n//#region ----- Options -----\n\nexport function readSectionWidgetOptions(section: AXPBuilderSection): AXMSafetyPlanSectionWidgetOptions {\n const raw = section['widgetOptions'];\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {\n return {};\n }\n return { ...(raw as AXMSafetyPlanSectionWidgetOptions) };\n}\n\nexport function pickSavedWidgetOptions(\n widgetType: AXMSafetyPlanConfigurableWidgetType,\n existing: AXMSafetyPlanSectionWidgetOptions,\n incoming: Record<string, unknown>,\n): AXMSafetyPlanSectionWidgetOptions {\n const merged = { ...existing, ...incoming };\n const keys = widgetType === PPE_ITEM_VIEWER_WIDGET_NAME ? PPE_OPTION_KEYS : HIERARCHY_OPTION_KEYS;\n const next: AXMSafetyPlanSectionWidgetOptions = {};\n for (const key of keys) {\n const value = merged[key];\n if (value !== undefined && value !== null) {\n (next as Record<string, unknown>)[key] = value;\n }\n }\n return next;\n}\n\nexport function buildSafetyPlanSectionWidgetNode(\n widgetType: AXMSafetyPlanConfigurableWidgetType,\n options: AXMSafetyPlanSectionWidgetOptions,\n): AXPWidgetNode {\n return {\n type: widgetType,\n options: { ...options },\n };\n}\n\nexport function hierarchyWidgetCustomProperties(): AXPWidgetPropertyInjection[] {\n return [\n {\n property: createBooleanProperty({\n name: 'showTitle',\n title:\n '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.fields.show-title.title',\n path: 'options.showTitle',\n group: AXP_BEHAVIOR_PROPERTY_GROUP,\n defaultValue: false,\n }),\n },\n {\n property: createBooleanProperty({\n name: 'showViewTypeSelector',\n title:\n '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.fields.show-view-type-selector.title',\n path: 'options.showViewTypeSelector',\n group: AXP_BEHAVIOR_PROPERTY_GROUP,\n defaultValue: true,\n }),\n },\n ];\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport {\n AXPWidgetPropertyViewerService,\n type AXPBuilderSection,\n type AXPBuilderValue,\n} from '@acorex-platform/framework-client/layout/components';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { Injectable, inject } from '@angular/core';\n\nimport { PPE_ITEM_VIEWER_WIDGET_NAME } from '../ppe-item-viewer/ppe-item-viewer.types';\nimport {\n buildSafetyPlanSectionWidgetNode,\n canConfigureSafetyPlanSectionWidget,\n hierarchyWidgetCustomProperties,\n pickSavedWidgetOptions,\n readSectionWidgetOptions,\n resolveConfigurableWidgetTypeForSection,\n SAFETY_PLAN_HIERARCHY_WIDGET_PROPERTY_EXCLUDE,\n SAFETY_PLAN_PPE_WIDGET_PROPERTY_EXCLUDE,\n widgetTitleKeyForConfigurableType,\n type AXMSafetyPlanConfigurableWidgetType,\n} from './safety-plan-section-widget-options.util';\n\n//#endregion\n\n//#region ----- Service -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMSafetyPlanSectionWidgetOptionsService {\n //#region ----- Services & Dependencies -----\n\n private readonly widgetPropertyViewer = inject(AXPWidgetPropertyViewerService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Public API -----\n\n canConfigure(section: AXPBuilderSection): boolean {\n return canConfigureSafetyPlanSectionWidget(section);\n }\n\n async prompt(\n section: AXPBuilderSection,\n _value: AXPBuilderValue,\n ): Promise<Record<string, unknown> | null> {\n const widgetType = resolveConfigurableWidgetTypeForSection(section);\n if (!widgetType) {\n return null;\n }\n\n const existing = readSectionWidgetOptions(section);\n const title =\n (await this.translationService.translateAsync(widgetTitleKeyForConfigurableType(widgetType))) ||\n (await this.translationService.translateAsync('@general:actions.edit.title')) ||\n 'Edit';\n\n const result = await this.widgetPropertyViewer\n .create()\n .dialog((dialog) => {\n dialog\n .setTitle(title)\n .setMode('simple')\n .setWidget(buildSafetyPlanSectionWidgetNode(widgetType, existing))\n .setExclude([...this.excludeFor(widgetType)]);\n if (widgetType !== PPE_ITEM_VIEWER_WIDGET_NAME) {\n dialog.setCustom({ properties: hierarchyWidgetCustomProperties() });\n }\n })\n .show();\n\n if (!result?.values) {\n return null;\n }\n\n const incoming = (result.values.options as Record<string, unknown> | undefined) ?? {};\n return {\n widgetOptions: pickSavedWidgetOptions(widgetType, existing, incoming),\n };\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private excludeFor(widgetType: AXMSafetyPlanConfigurableWidgetType): readonly string[] {\n return widgetType === PPE_ITEM_VIEWER_WIDGET_NAME\n ? SAFETY_PLAN_PPE_WIDGET_PROPERTY_EXCLUDE\n : SAFETY_PLAN_HIERARCHY_WIDGET_PROPERTY_EXCLUDE;\n }\n\n //#endregion\n}\n\n//#endregion\n","import { AXPDataGenerator } from '@acorex-platform/framework-client/core';\nimport { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';\nimport {\n AXPDynamicFormDefinition,\n AXPDynamicFormGroupDefinition,\n AXPLayoutBuilderService,\n} from '@acorex-platform/framework-client/layout/builder';\nimport {\n AXPEntityDataSelectorService,\n AXPEntityDefinitionRegistryService,\n AXPEntityService,\n} from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXPBuilderItem,\n AXPBuilderItemViewModel,\n AXPBuilderSection,\n AXPBuilderValue,\n AXPStandardSectionItemsBuilderComponent,\n AXPStandardSectionItemsBuilderConfig,\n} from '@acorex-platform/framework-client/layout/components';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport type { AXMSectionTypeSnapshot } from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport {\n RootConfig,\n WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS,\n clearDependentItemsOnParentChange,\n dedupeSafetyPlanSectionItemSelection,\n enrichSectionTypeSnapshot,\n isStepTableColumnMultiLookup,\n isStepTableSectionType,\n mapSafetyPlanSectionSelectedItems,\n normalizeStepTableColumns,\n normalizeStepTableRows,\n resolveSafetyPlanSectionItemColumns,\n resolveSafetyPlanSectionItemEntityKey,\n resolveSafetyPlanSectionItemFilterAsync,\n resolveStepTableColumnLookupEntity,\n sortStepTableColumns,\n stepTableColumnKey,\n stepTableColumnTitle,\n asSafetyPlanDisplayText,\n type AXMStepTableCellValue,\n type AXMStepTableColumnDef,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport {\n AXMSafetyPlanSectionBuilderItemValue,\n AXMSafetyPlanSectionBuilderValue,\n AXMSafetyPlanStepTableRowBuilderPayload,\n normalizeSafetyPlanSectionBuilderValue,\n summarizeStepTableRow,\n} from './safety-plan-section-builder.types';\nimport { AXMSafetyPlanSectionWidgetOptionsService } from './safety-plan-section-widget-options.service';\n\n//#region ----- Types -----\n\ninterface SafetyPlanSectionDialogValue {\n sectionTypeId: string;\n sectionType?: AXMSectionTypeSnapshot;\n /** Synced from the selected Section Type (display-only in the dialog). */\n sectionTypeDescription?: string;\n /** Derived from Section Type title; not shown in the dialog. */\n title: string;\n /** Optional section description copied from the type description on create/edit. */\n description?: string;\n}\n\ninterface SafetyPlanSectionItemDialogValue {\n itemIds: string[];\n items?: { id: string; title?: string; code?: string }[];\n}\n\ninterface SafetyPlanStepTableRowDialogValue {\n [key: string]: unknown;\n}\n\ninterface SectionBuilderContext {\n sectionTypeId: string;\n sectionType?: AXMSectionTypeSnapshot;\n workStepTypeId?: string;\n workStepType?: { id: string; title?: string; code?: string };\n columns: AXMStepTableColumnDef[];\n}\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-safety-plan-section-builder',\n templateUrl: './safety-plan-section-builder.component.html',\n styleUrl: './safety-plan-section-builder.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXButtonModule, AXDecoratorModule, AXTranslationModule, AXPStandardSectionItemsBuilderComponent],\n})\nexport class AXMSafetyPlanSectionBuilderComponent {\n //#region ----- Inputs / Outputs -----\n\n readonly value = input<AXMSafetyPlanSectionBuilderValue | null | undefined>(null);\n readonly safetyPlanId = input<string | undefined>(undefined);\n readonly options = input<Record<string, unknown>>({});\n\n readonly valueChange = output<AXMSafetyPlanSectionBuilderValue>();\n\n //#endregion\n\n //#region ----- Services & Dependencies -----\n\n private readonly standardRef = viewChild(AXPStandardSectionItemsBuilderComponent);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n private readonly toastService = inject(AXToastService);\n private readonly entityDataSelector = inject(AXPEntityDataSelectorService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly entityService = inject(AXPEntityService);\n private readonly widgetOptionsService = inject(AXMSafetyPlanSectionWidgetOptionsService);\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly builderValue = signal<AXPBuilderValue>({ sections: [] });\n\n /** Applied on the next builder commit so section header title survives item add/edit. */\n private readonly pendingSectionTitles = new Map<string, string>();\n\n protected readonly standardConfig = computed<AXPStandardSectionItemsBuilderConfig>(() => ({\n mapItemToView: (item) => this.mapItemToView(item),\n promptAddSection: this.allowAddSection() ? (value) => this.promptAddSection(value) : async () => null,\n promptEditSection: (section, value) => this.promptSectionHeaderEdit(section, value),\n promptAddItems: this.allowAddItems() ? (sectionId, value) => this.promptAddItems(sectionId, value) : undefined,\n promptEditItem: (item, sectionId, value) => this.promptEditItem(item, sectionId, value),\n showSectionTechnicalName: false,\n allowReorderSections: this.allowReorderSections(),\n minSectionCount: this.allowAddSection() ? 0 : Number.MAX_SAFE_INTEGER,\n texts: {\n addSection: '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.add-section.title',\n addItem: '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.add-item.title',\n },\n }));\n\n protected readonly hideHeaderActions = computed(() => (this.options()['hideHeaderActions'] as boolean) === true);\n protected readonly allowAddSection = computed(() => (this.options()['allowAddSection'] as boolean) !== false);\n protected readonly allowEditSection = computed(() => (this.options()['allowEditSection'] as boolean) === true);\n protected readonly allowEditItem = computed(() => (this.options()['allowEditItem'] as boolean) === true);\n protected readonly allowAddItems = computed(() => (this.options()['allowAddItems'] as boolean) !== false);\n protected readonly allowReorderSections = computed(() => {\n const option = this.options()['allowReorderSections'];\n return typeof option === 'boolean' ? option : true;\n });\n protected readonly readonly = computed(() => (this.options()['readonly'] as boolean) === true);\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n #syncValueToBuilder = effect(() => {\n const normalized = normalizeSafetyPlanSectionBuilderValue(this.value());\n this.builderValue.set(this.toBuilderValue(normalized));\n });\n\n //#endregion\n\n //#region ----- Public API -----\n\n async addSection(): Promise<void> {\n await this.standardRef()?.addSection();\n }\n\n syncAfterSave(value: AXMSafetyPlanSectionBuilderValue): void {\n const normalized = normalizeSafetyPlanSectionBuilderValue(value);\n this.builderValue.set(this.toBuilderValue(normalized));\n queueMicrotask(() => this.standardRef()?.markClean());\n }\n\n resetAfterDiscard(): void {\n const normalized = normalizeSafetyPlanSectionBuilderValue(this.value());\n this.builderValue.set(this.toBuilderValue(normalized));\n queueMicrotask(() => this.standardRef()?.markClean());\n }\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected onBuilderValueChange(next: AXPBuilderValue): void {\n const previous = this.fromBuilderValue(this.builderValue());\n let nextValue = clearDependentItemsOnParentChange(previous, this.fromBuilderValue(next));\n if (this.pendingSectionTitles.size > 0) {\n nextValue = {\n sections: nextValue.sections.map((section) => {\n const title = this.pendingSectionTitles.get(section.id);\n return title ? { ...section, title } : section;\n }),\n };\n this.pendingSectionTitles.clear();\n }\n this.builderValue.set(this.toBuilderValue(nextValue));\n this.valueChange.emit(nextValue);\n }\n\n //#endregion\n\n //#region ----- Section prompts -----\n\n private async promptAddSection(value: AXPBuilderValue): Promise<Record<string, unknown> | null> {\n const dialogValue = await this.promptSectionForm('create', {\n sectionTypeId: '',\n sectionTypeDescription: '',\n title: '',\n description: '',\n });\n if (!dialogValue) return null;\n\n const sectionId = AXPDataGenerator.uuid();\n return {\n id: sectionId,\n name: sectionId,\n sectionTypeId: dialogValue.sectionTypeId,\n sectionType: dialogValue.sectionType,\n title: dialogValue.title,\n description: dialogValue.description ?? '',\n safetyPlanId: this.safetyPlanId() ?? '',\n sortOrder: (value.sections?.length ?? 0) + 1,\n items: [],\n };\n }\n\n private async promptSectionHeaderEdit(\n section: AXPBuilderSection,\n value: AXPBuilderValue,\n ): Promise<Record<string, unknown> | null> {\n if (this.widgetOptionsService.canConfigure(section)) {\n return this.widgetOptionsService.prompt(section, value);\n }\n if (!this.allowEditSection()) {\n return null;\n }\n return this.promptEditSection(section, value);\n }\n\n private async promptEditSection(\n section: AXPBuilderSection,\n value: AXPBuilderValue,\n ): Promise<Record<string, unknown> | null> {\n const previousSectionTypeId = String(section['sectionTypeId'] ?? '');\n const sectionTypeSnapshot = section['sectionType'] as AXMSectionTypeSnapshot | undefined;\n const dialogValue = await this.promptSectionForm('edit', {\n sectionTypeId: previousSectionTypeId,\n sectionType: sectionTypeSnapshot,\n sectionTypeDescription:\n enrichSectionTypeSnapshot(previousSectionTypeId, sectionTypeSnapshot)?.description ??\n String(section['description'] ?? ''),\n title: String(section['title'] ?? ''),\n description: String(section['description'] ?? ''),\n });\n if (!dialogValue) return null;\n\n const sectionTypeChanged = previousSectionTypeId !== dialogValue.sectionTypeId;\n const isStepTable = isStepTableSectionType(dialogValue.sectionTypeId, dialogValue.sectionType);\n const keepWorkStep =\n isStepTable && !sectionTypeChanged\n ? {\n workStepTypeId: section['workStepTypeId'],\n workStepType: section['workStepType'],\n columns: section['columns'],\n }\n : {\n workStepTypeId: undefined,\n workStepType: undefined,\n columns: [],\n };\n\n return {\n ...section,\n sectionTypeId: dialogValue.sectionTypeId,\n sectionType: dialogValue.sectionType,\n title: dialogValue.title,\n description: dialogValue.description ?? '',\n ...keepWorkStep,\n ...(sectionTypeChanged ? { items: [] } : {}),\n };\n }\n\n private async promptSectionForm(\n mode: 'create' | 'edit',\n seed: SafetyPlanSectionDialogValue,\n ): Promise<SafetyPlanSectionDialogValue | null> {\n const titleKey =\n mode === 'create'\n ? '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.add-section.title'\n : '@general:actions.edit.title';\n const title = (await this.translationService.translateAsync(titleKey)) || (mode === 'create' ? 'Add Section' : 'Edit');\n\n const result = await this.layoutBuilder\n .create()\n .dialog<{ success: boolean; value?: SafetyPlanSectionDialogValue }>((dialog) => {\n dialog\n .setTitle(title)\n .setSize('md')\n .setCloseButton(true)\n .setContext({ ...seed })\n .content((layout) => {\n layout.mode('edit');\n layout.dynamicForm(this.buildSectionFormDefinition());\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title').submit('@general:actions.save.title');\n })\n .onAction((dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n const context = dialogRef.context() as Partial<SafetyPlanSectionDialogValue>;\n const sectionTypeId = String(context.sectionTypeId ?? '').trim();\n if (!sectionTypeId) {\n return { success: false };\n }\n\n const sectionType = enrichSectionTypeSnapshot(sectionTypeId, context.sectionType);\n const titleValue =\n String(context.title ?? '').trim() ||\n String(sectionType?.title ?? '').trim() ||\n String(sectionType?.code ?? '').trim();\n if (!titleValue) {\n return { success: false };\n }\n\n const description =\n String(context.sectionTypeDescription ?? '').trim() ||\n String(context.description ?? '').trim() ||\n String(sectionType?.description ?? '').trim();\n\n return {\n success: true,\n kind: 'object',\n value: {\n sectionTypeId,\n sectionType,\n title: titleValue,\n description,\n sectionTypeDescription: description,\n },\n };\n });\n })\n .show();\n\n return result?.success && result.value ? result.value : null;\n }\n\n private buildSectionFormDefinition(): AXPDynamicFormDefinition {\n const group: AXPDynamicFormGroupDefinition = {\n name: 'section',\n title: '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.title',\n parameters: [\n {\n path: 'sectionTypeId',\n title: '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.section-type.title',\n widget: {\n path: 'sectionTypeId',\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`,\n ...WORKPLACE_SAFETY_SECTION_TYPE_LOOKUP_WIDGET_OPTIONS,\n },\n },\n },\n {\n path: 'sectionTypeDescription',\n title:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.description.title',\n widget: {\n path: 'sectionTypeDescription',\n type: AXPWidgetsCatalog.largeText,\n options: {\n readonly: true,\n rows: 2,\n },\n },\n },\n ],\n };\n return { groups: [group] };\n }\n\n //#endregion\n\n //#region ----- Item prompts -----\n\n private async promptAddItems(sectionId: string, value: AXPBuilderValue): Promise<AXPBuilderItem[] | null> {\n const section = value.sections.find((s) => s.id === sectionId);\n if (!section || !this.sectionContextFromBuilderSection(section)) {\n return null;\n }\n\n let sectionContext = this.sectionContextFromBuilderSection(section)!;\n if (isStepTableSectionType(sectionContext.sectionTypeId, sectionContext.sectionType)) {\n if (!sectionContext.workStepTypeId || sectionContext.columns.length === 0) {\n const assigned = await this.ensureStepTableWorkStep(sectionId);\n if (!assigned) {\n return null;\n }\n const updatedSection = this.builderValue().sections.find((entry) => entry.id === sectionId);\n const nextContext = updatedSection ? this.sectionContextFromBuilderSection(updatedSection) : null;\n if (!nextContext?.workStepTypeId || nextContext.columns.length === 0) {\n return null;\n }\n sectionContext = nextContext;\n }\n\n const currentSection = this.builderValue().sections.find((entry) => entry.id === sectionId) ?? section;\n const sectionTitle = String(currentSection['title'] ?? '').trim();\n const sectionTypeTitle = String(sectionContext.sectionType?.title ?? '').trim();\n const applyTitleToSection =\n (currentSection.items?.length ?? 0) === 0 ||\n !sectionTitle ||\n sectionTitle === sectionTypeTitle ||\n sectionTitle === sectionContext.sectionTypeId;\n\n const row = await this.promptStepTableRowForm(\n 'create',\n sectionContext,\n {\n title: applyTitleToSection\n ? sectionTitle && sectionTitle !== sectionTypeTitle\n ? sectionTitle\n : String(sectionContext.workStepType?.title ?? '').trim()\n : '',\n },\n { requireTitle: true, applyTitleToSection },\n );\n if (!row) {\n return null;\n }\n\n if (applyTitleToSection && row.title?.trim()) {\n this.patchSectionTitle(sectionId, row.title.trim());\n }\n\n const itemCount =\n this.builderValue().sections.find((entry) => entry.id === sectionId)?.items.length ??\n currentSection.items.length;\n return [this.toBuilderItemFromStepTableRow(row, itemCount)];\n }\n\n const existingIds = this.collectEntityIdsFromBuilderItems(section.items);\n const dialogValue = await this.openItemDataSelector('create', undefined, sectionId, value, section, true);\n if (!dialogValue) return null;\n\n const selected = this.expandDialogSelectionToLinkedEntities(dialogValue).filter(\n (entry) => !existingIds.has(entry.id),\n );\n if (!selected.length) {\n return null;\n }\n\n const startOrder = section.items.length;\n return selected.map((entry, index) =>\n this.toBuilderItemFromEntity(sectionId, entry, startOrder + index),\n );\n }\n\n private async promptEditItem(\n item: AXPBuilderItem,\n sectionId: string,\n value: AXPBuilderValue,\n ): Promise<AXPBuilderItem | null> {\n const section = value.sections.find((s) => s.id === sectionId);\n if (!section || !this.sectionContextFromBuilderSection(section)) {\n return null;\n }\n\n const sectionContext = this.sectionContextFromBuilderSection(section)!;\n if (isStepTableSectionType(sectionContext.sectionTypeId, sectionContext.sectionType)) {\n const existing = item['stepTableRow'] as AXMSafetyPlanStepTableRowBuilderPayload | undefined;\n if (!existing || sectionContext.columns.length === 0) {\n return null;\n }\n const seed = {\n ...this.cellsToDialogValue(existing.cells ?? [], sectionContext.columns),\n title: String(existing.title ?? item['title'] ?? '').trim(),\n };\n const isPrimaryRow = (item.order ?? 0) === 0;\n const row = await this.promptStepTableRowForm('edit', sectionContext, seed, {\n requireTitle: true,\n applyTitleToSection: isPrimaryRow,\n });\n if (!row) {\n return null;\n }\n if (isPrimaryRow && row.title?.trim()) {\n this.patchSectionTitle(sectionId, row.title.trim());\n }\n return this.toBuilderItemFromStepTableRow(\n {\n ...row,\n code: existing.code,\n },\n item.order ?? 0,\n String(item.id),\n );\n }\n\n if (!this.allowEditItem()) {\n return null;\n }\n\n const currentEntityId = this.resolveBuilderItemEntityId(item);\n const seed: SafetyPlanSectionItemDialogValue | undefined = currentEntityId\n ? {\n itemIds: [currentEntityId],\n items: Array.isArray(item['items'])\n ? (item['items'] as AXMSafetyPlanSectionBuilderItemValue['items'])\n : [],\n }\n : undefined;\n\n const dialogValue = await this.openItemDataSelector('edit', seed, sectionId, value, section, false);\n if (!dialogValue) return null;\n\n const selected = this.expandDialogSelectionToLinkedEntities(dialogValue);\n if (!selected.length) {\n return null;\n }\n\n const otherIds = this.collectEntityIdsFromBuilderItems(\n section.items.filter((row) => String(row.id) !== String(item.id)),\n );\n const replacement = selected.find((entry) => !otherIds.has(entry.id)) ?? selected[0];\n\n return this.toBuilderItemFromEntity(sectionId, replacement, item.order ?? 0);\n }\n\n private async toastWorkStepRequired(): Promise<void> {\n this.toastService.show({\n color: 'warning',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: await this.translationService.translateAsync(\n '@workplacesafety-management:safety-plan-sections.messages.work-step-required.message',\n ),\n });\n }\n\n /** Prompts for Work Step and patches the Step Table section before rows can be added. */\n private async ensureStepTableWorkStep(sectionId: string): Promise<boolean> {\n const picked = await this.promptWorkStepPicker();\n if (!picked) {\n return false;\n }\n\n const current = this.fromBuilderValue(this.builderValue());\n const next: AXMSafetyPlanSectionBuilderValue = {\n sections: current.sections.map((section) => {\n if (section.id !== sectionId) {\n return section;\n }\n return {\n ...section,\n workStepTypeId: picked.id,\n workStepType: { id: picked.id, title: picked.title, code: picked.code },\n columns: picked.columns,\n };\n }),\n };\n this.builderValue.set(this.toBuilderValue(next));\n this.valueChange.emit(next);\n return true;\n }\n\n private patchSectionTitle(sectionId: string, title: string): void {\n const trimmed = title.trim();\n if (!trimmed) {\n return;\n }\n this.pendingSectionTitles.set(sectionId, trimmed);\n }\n\n private async promptWorkStepPicker(): Promise<{\n id: string;\n title?: string;\n code?: string;\n columns: AXMStepTableColumnDef[];\n } | null> {\n const title =\n (await this.translationService.translateAsync(\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.work-step.title',\n )) || 'Work Step';\n\n const result = await this.layoutBuilder\n .create()\n .dialog<{\n success: boolean;\n value?: { workStepTypeId: string; workStepType?: { id: string; title?: string; code?: string } };\n }>((dialog) => {\n dialog\n .setTitle(title)\n .setSize('md')\n .setCloseButton(true)\n .setContext({ workStepTypeId: '' })\n .content((layout) => {\n layout.mode('edit');\n layout.dynamicForm({\n groups: [\n {\n name: 'work-step',\n title:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.work-step.title',\n parameters: [\n {\n path: 'workStepTypeId',\n title:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.work-step.title',\n widget: {\n path: 'workStepTypeId',\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `${RootConfig.module.name}.${RootConfig.entities.workStepType.name}`,\n look: 'select',\n textField: 'title',\n valueField: 'id',\n columns: ['code', 'title'],\n expose: [\n { source: 'id', target: 'workStepType.id' },\n { source: 'title', target: 'workStepType.title' },\n { source: 'code', target: 'workStepType.code' },\n ],\n },\n },\n },\n ],\n },\n ],\n });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title').submit('@general:actions.save.title');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n const context = dialogRef.context() as {\n workStepTypeId?: string;\n workStepType?: { id: string; title?: string; code?: string };\n };\n const workStepTypeId = String(context.workStepTypeId ?? '').trim();\n if (!workStepTypeId) {\n return { success: false };\n }\n return {\n success: true,\n kind: 'object',\n value: {\n workStepTypeId,\n workStepType: context.workStepType,\n },\n };\n });\n })\n .show();\n\n if (!result?.success || !result.value?.workStepTypeId) {\n return null;\n }\n\n const loaded = await this.loadWorkStepType(result.value.workStepTypeId);\n if (!loaded) {\n await this.toastWorkStepRequired();\n return null;\n }\n return loaded;\n }\n\n private sectionContextFromBuilderSection(section: AXPBuilderSection): SectionBuilderContext | null {\n const sectionTypeId = String(section['sectionTypeId'] ?? '').trim();\n if (!sectionTypeId) {\n return null;\n }\n return {\n sectionTypeId,\n sectionType: enrichSectionTypeSnapshot(\n sectionTypeId,\n section['sectionType'] as AXMSectionTypeSnapshot | undefined,\n ),\n workStepTypeId: typeof section['workStepTypeId'] === 'string' ? section['workStepTypeId'].trim() : undefined,\n workStepType: section['workStepType'] as SectionBuilderContext['workStepType'],\n columns: normalizeStepTableColumns(section['columns'] as AXMStepTableColumnDef[] | undefined),\n };\n }\n\n //#endregion\n\n //#region ----- Catalog item selector -----\n\n private resolveSectionIndex(sectionId: string, builderValue: AXPBuilderValue): number {\n const orderedSections = [...builderValue.sections].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n return orderedSections.findIndex((section) => section.id === sectionId);\n }\n\n private async loadHazardRiskRecords(hazardRiskIds: string[]): Promise<Record<string, unknown>[]> {\n if (!hazardRiskIds.length) {\n return [];\n }\n const entityKey = `${RootConfig.module.name}.${RootConfig.entities.hazardRisk.name}`;\n const accessor = this.entityService.withEntity(entityKey);\n const results = await Promise.all(\n hazardRiskIds.map((id) => accessor.data().byKey(id).catch(() => null)),\n );\n return results\n .filter((record): record is NonNullable<(typeof results)[number]> => record != null)\n .map((record) => record as unknown as Record<string, unknown>);\n }\n\n private async resolveItemFilterForSection(\n sectionTypeId: string,\n sectionId: string,\n builderValue: AXPBuilderValue,\n ): Promise<Record<string, unknown> | null> {\n const orderedSections = [...builderValue.sections].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n const sectionIndex = this.resolveSectionIndex(sectionId, builderValue);\n if (sectionIndex < 0) {\n return null;\n }\n const sections = this.fromBuilderValue({ sections: orderedSections }).sections;\n return resolveSafetyPlanSectionItemFilterAsync(\n sectionTypeId,\n sections,\n sectionIndex,\n (ids) => this.loadHazardRiskRecords(ids),\n );\n }\n\n private async openItemDataSelector(\n mode: 'create' | 'edit',\n seed: SafetyPlanSectionItemDialogValue | undefined,\n sectionId: string,\n builderValue: AXPBuilderValue,\n section: AXPBuilderSection,\n allowMultiple: boolean,\n ): Promise<SafetyPlanSectionItemDialogValue | null> {\n const sectionContext = this.sectionContextFromBuilderSection(section);\n if (!sectionContext) {\n return null;\n }\n\n const entityKey = resolveSafetyPlanSectionItemEntityKey(\n sectionContext.sectionTypeId,\n sectionContext.sectionType,\n );\n if (!entityKey) {\n return null;\n }\n\n const dotIndex = entityKey.indexOf('.');\n if (dotIndex <= 0) {\n return null;\n }\n\n const entity = await this.entityRegistry.resolve(\n entityKey.substring(0, dotIndex),\n entityKey.substring(dotIndex + 1),\n );\n if (!entity) {\n return null;\n }\n\n const filter = await this.resolveItemFilterForSection(\n sectionContext.sectionTypeId,\n sectionId,\n builderValue,\n );\n const columns = resolveSafetyPlanSectionItemColumns(sectionContext.sectionTypeId);\n const selectedItemIds = (seed?.itemIds ?? []).filter((id): id is string => typeof id === 'string' && id.length > 0);\n\n const titleKey =\n mode === 'create'\n ? '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.add-item.title'\n : '@general:actions.edit.title';\n const title = (await this.translationService.translateAsync(titleKey)) || (mode === 'create' ? 'Add Item' : 'Edit');\n\n const result = await this.entityDataSelector.open({\n entity,\n title,\n allowMultiple,\n selectedItemIds: selectedItemIds.length > 0 ? selectedItemIds : undefined,\n columns,\n filters: filter ?? undefined,\n allowCreate: 'none',\n showCategoryFilter: false,\n });\n\n if (!result) {\n return null;\n }\n\n if (!result.items?.length) {\n return mode === 'edit' ? { itemIds: [], items: [] } : null;\n }\n\n const items = mapSafetyPlanSectionSelectedItems(sectionContext.sectionTypeId, result.items);\n return dedupeSafetyPlanSectionItemSelection({\n id: `${sectionId}__item_1`,\n itemIds: items.map((item) => item.id),\n items,\n });\n }\n\n //#endregion\n\n //#region ----- Builder value mapping -----\n\n private mapItemToView(item: AXPBuilderItem): AXPBuilderItemViewModel {\n const stepTableRow = item['stepTableRow'] as AXMSafetyPlanStepTableRowBuilderPayload | undefined;\n if (stepTableRow) {\n const code = String(stepTableRow.code ?? '').trim();\n return {\n icon: 'fa-light fa-table-rows',\n title: String(stepTableRow.title ?? item['title'] ?? '').trim() || 'Row',\n name: code || undefined,\n badges: [],\n };\n }\n\n const snapshot = Array.isArray(item['items'])\n ? (item['items'] as { title?: string; code?: string }[])[0]\n : undefined;\n const title =\n asSafetyPlanDisplayText(item['title']) || asSafetyPlanDisplayText(snapshot?.title);\n const code = asSafetyPlanDisplayText(item['name']) || asSafetyPlanDisplayText(snapshot?.code);\n\n return {\n icon: 'fa-light fa-list-check',\n title,\n name: code || undefined,\n badges: [],\n };\n }\n\n private toBuilderValue(value: AXMSafetyPlanSectionBuilderValue): AXPBuilderValue {\n return {\n sections: value.sections.map((section, sectionIndex) => ({\n id: section.id,\n order: sectionIndex,\n name: section.id,\n sectionTypeId: section.sectionTypeId,\n sectionType: enrichSectionTypeSnapshot(section.sectionTypeId, section.sectionType),\n title: section.title,\n description: section.description ?? '',\n code: section.code,\n safetyPlanId: section.safetyPlanId ?? this.safetyPlanId() ?? '',\n sourceSafetyPlanTypeSectionId: section.sourceSafetyPlanTypeSectionId,\n sortOrder: section.sortOrder ?? sectionIndex + 1,\n required: section.required === true,\n workStepTypeId: section.workStepTypeId,\n workStepType: section.workStepType,\n columns: normalizeStepTableColumns(section.columns),\n widgetOptions: section.widgetOptions,\n items: this.expandSectionItemsToBuilderRows(section.id, section.items, section),\n })),\n } as AXPBuilderValue;\n }\n\n private fromBuilderValue(value: AXPBuilderValue): AXMSafetyPlanSectionBuilderValue {\n return normalizeSafetyPlanSectionBuilderValue({\n sections: value.sections.map((section, sectionIndex) => ({\n id: section.id,\n sectionTypeId: String(section['sectionTypeId'] ?? ''),\n sectionType: enrichSectionTypeSnapshot(\n String(section['sectionTypeId'] ?? ''),\n section['sectionType'] as AXMSectionTypeSnapshot | undefined,\n ),\n title: String(section['title'] ?? ''),\n description: String(section['description'] ?? ''),\n code: typeof section['code'] === 'string' ? section['code'] : undefined,\n safetyPlanId: String(section['safetyPlanId'] ?? this.safetyPlanId() ?? ''),\n sourceSafetyPlanTypeSectionId:\n typeof section['sourceSafetyPlanTypeSectionId'] === 'string'\n ? section['sourceSafetyPlanTypeSectionId']\n : undefined,\n sortOrder:\n typeof section['sortOrder'] === 'number' ? section['sortOrder'] : sectionIndex + 1,\n required: section['required'] === true,\n workStepTypeId:\n typeof section['workStepTypeId'] === 'string' ? section['workStepTypeId'] : undefined,\n workStepType: section['workStepType'] as AXMSafetyPlanSectionBuilderValue['sections'][number]['workStepType'],\n columns: normalizeStepTableColumns(section['columns'] as AXMStepTableColumnDef[] | undefined),\n widgetOptions:\n section['widgetOptions'] && typeof section['widgetOptions'] === 'object' && !Array.isArray(section['widgetOptions'])\n ? { ...(section['widgetOptions'] as Record<string, unknown>) }\n : undefined,\n items: this.collapseBuilderRowsToStorageItems(section.id, section.items, section),\n })),\n });\n }\n\n private expandSectionItemsToBuilderRows(\n sectionId: string,\n items: AXMSafetyPlanSectionBuilderItemValue[],\n section: {\n sectionTypeId?: string;\n sectionType?: AXMSectionTypeSnapshot;\n columns?: AXMStepTableColumnDef[];\n },\n ): AXPBuilderItem[] {\n if (\n isStepTableSectionType(section.sectionTypeId, section.sectionType) ||\n items.some((item) => item.stepTableRow)\n ) {\n const columns = normalizeStepTableColumns(section.columns);\n return items\n .filter((item) => item.stepTableRow)\n .map((item, order) =>\n this.toBuilderItemFromStepTableRow(\n {\n ...item.stepTableRow!,\n title:\n item.stepTableRow!.title ||\n summarizeStepTableRow(item.stepTableRow!.cells ?? [], columns),\n },\n order,\n item.id,\n ),\n );\n }\n const linked = this.flattenLinkedEntities(items);\n return linked.map((entry, order) => this.toBuilderItemFromEntity(sectionId, entry, order));\n }\n\n private collapseBuilderRowsToStorageItems(\n sectionId: string,\n items: AXPBuilderItem[],\n section: AXPBuilderSection,\n ): AXMSafetyPlanSectionBuilderItemValue[] {\n const ordered = [...items].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n const sectionTypeId = String(section['sectionTypeId'] ?? '');\n const sectionType = section['sectionType'] as AXMSectionTypeSnapshot | undefined;\n\n if (isStepTableSectionType(sectionTypeId, sectionType) || ordered.some((item) => item['stepTableRow'])) {\n const columns = normalizeStepTableColumns(section['columns'] as AXMStepTableColumnDef[] | undefined);\n const stepItems: AXMSafetyPlanSectionBuilderItemValue[] = [];\n ordered.forEach((item, index) => {\n const stepTableRow = item['stepTableRow'] as AXMSafetyPlanStepTableRowBuilderPayload | undefined;\n if (!stepTableRow) {\n return;\n }\n const stepId =\n typeof item.id === 'string' && item.id && !String(item.id).includes('__entity_')\n ? String(item.id)\n : AXPDataGenerator.uuid();\n const title =\n stepTableRow.title?.trim() ||\n summarizeStepTableRow(stepTableRow.cells ?? [], columns) ||\n 'Row';\n stepItems.push({\n id: stepId,\n itemIds: [stepId],\n items: [{ id: stepId, title, code: stepTableRow.code }],\n stepTableRow: {\n ...stepTableRow,\n title,\n sortOrder: index + 1,\n },\n });\n });\n return stepItems;\n }\n\n const itemIds: string[] = [];\n const snapshots: NonNullable<AXMSafetyPlanSectionBuilderItemValue['items']> = [];\n\n for (const item of ordered) {\n const entityId = this.resolveBuilderItemEntityId(item);\n if (!entityId || itemIds.includes(entityId)) {\n continue;\n }\n itemIds.push(entityId);\n const snapshot = Array.isArray(item['items'])\n ? (item['items'] as NonNullable<AXMSafetyPlanSectionBuilderItemValue['items']>)[0]\n : undefined;\n snapshots.push({\n id: entityId,\n title:\n asSafetyPlanDisplayText(snapshot?.title) ||\n asSafetyPlanDisplayText(item['title']) ||\n undefined,\n code:\n asSafetyPlanDisplayText(snapshot?.code) ||\n asSafetyPlanDisplayText(item['name']) ||\n undefined,\n });\n }\n\n if (!itemIds.length) {\n return [];\n }\n\n return [\n dedupeSafetyPlanSectionItemSelection({\n id: `${sectionId}__item_1`,\n itemIds,\n items: snapshots,\n }),\n ];\n }\n\n private flattenLinkedEntities(\n items: AXMSafetyPlanSectionBuilderItemValue[],\n ): Array<{ id: string; title?: string; code?: string }> {\n const linked: Array<{ id: string; title?: string; code?: string }> = [];\n const seen = new Set<string>();\n\n for (const slot of items) {\n const ids = Array.isArray(slot.itemIds) ? slot.itemIds : [];\n const snapshots = Array.isArray(slot.items) ? slot.items : [];\n for (let index = 0; index < ids.length; index += 1) {\n const id = String(ids[index] ?? '').trim();\n if (!id || seen.has(id)) {\n continue;\n }\n seen.add(id);\n const snapshot = snapshots.find((entry) => entry?.id === id) ?? snapshots[index];\n linked.push({\n id,\n title: asSafetyPlanDisplayText(snapshot?.title) || undefined,\n code: asSafetyPlanDisplayText(snapshot?.code) || undefined,\n });\n }\n }\n\n return linked;\n }\n\n private expandDialogSelectionToLinkedEntities(\n dialogValue: SafetyPlanSectionItemDialogValue,\n ): Array<{ id: string; title?: string; code?: string }> {\n return this.flattenLinkedEntities([\n {\n id: 'dialog',\n itemIds: [...(dialogValue.itemIds ?? [])],\n items: dialogValue.items ? [...dialogValue.items] : [],\n },\n ]);\n }\n\n private collectEntityIdsFromBuilderItems(items: AXPBuilderItem[]): Set<string> {\n const ids = new Set<string>();\n for (const item of items) {\n const entityId = this.resolveBuilderItemEntityId(item);\n if (entityId) {\n ids.add(entityId);\n }\n }\n return ids;\n }\n\n private resolveBuilderItemEntityId(item: AXPBuilderItem): string | null {\n if (typeof item['entityId'] === 'string' && item['entityId'].trim()) {\n return item['entityId'].trim();\n }\n if (Array.isArray(item['itemIds']) && typeof item['itemIds'][0] === 'string' && item['itemIds'][0].trim()) {\n return item['itemIds'][0].trim();\n }\n const snapshot = Array.isArray(item['items'])\n ? (item['items'] as { id?: string }[])[0]\n : undefined;\n if (typeof snapshot?.id === 'string' && snapshot.id.trim()) {\n return snapshot.id.trim();\n }\n return null;\n }\n\n private toBuilderItemFromEntity(\n sectionId: string,\n entry: { id: string; title?: string; code?: string },\n order: number,\n ): AXPBuilderItem {\n const title = asSafetyPlanDisplayText(entry.title);\n const code = asSafetyPlanDisplayText(entry.code);\n return {\n id: `${sectionId}__entity_${entry.id}`,\n order,\n entityId: entry.id,\n itemIds: [entry.id],\n items: [{ id: entry.id, title: title || undefined, code: code || undefined }],\n title,\n name: code,\n };\n }\n\n private toBuilderItemFromStepTableRow(\n row: AXMSafetyPlanStepTableRowBuilderPayload,\n order: number,\n id?: string,\n ): AXPBuilderItem {\n const stepId =\n typeof id === 'string' && id.trim() && !id.includes('__item_') && !id.includes('__entity_')\n ? id.trim()\n : AXPDataGenerator.uuid();\n const title = String(row.title ?? '').trim() || 'Row';\n const code = String(row.code ?? '').trim();\n return {\n id: stepId,\n order,\n entityId: stepId,\n itemIds: [stepId],\n items: [{ id: stepId, title, code: code || undefined }],\n title,\n name: code,\n stepTableRow: {\n ...row,\n title,\n sortOrder: order + 1,\n },\n };\n }\n\n //#endregion\n\n //#region ----- Step Table row dialog -----\n\n private async promptStepTableRowForm(\n mode: 'create' | 'edit',\n sectionContext: SectionBuilderContext,\n seed: SafetyPlanStepTableRowDialogValue,\n options?: { requireTitle?: boolean; applyTitleToSection?: boolean },\n ): Promise<AXMSafetyPlanStepTableRowBuilderPayload | null> {\n const columns = sortStepTableColumns(sectionContext.columns);\n const requireTitle = options?.requireTitle === true;\n const titleKey =\n mode === 'create'\n ? '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.add-row.title'\n : '@general:actions.edit.title';\n const dialogTitle =\n (await this.translationService.translateAsync(titleKey)) ||\n (mode === 'create' ? 'Add Row' : 'Edit');\n\n const result = await this.layoutBuilder\n .create()\n .dialog<{ success: boolean; value?: AXMSafetyPlanStepTableRowBuilderPayload }>((dialog) => {\n dialog\n .setTitle(dialogTitle)\n .setSize('lg')\n .setCloseButton(true)\n .setContext({ ...seed })\n .content((layout) => {\n layout.mode('edit');\n layout.dynamicForm(this.buildStepTableRowFormDefinition(columns, { includeTitle: requireTitle }));\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title').submit('@general:actions.save.title');\n })\n .onAction((dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n const context = dialogRef.context() as SafetyPlanStepTableRowDialogValue;\n const customTitle = String(context['title'] ?? '').trim();\n if (requireTitle && !customTitle) {\n return { success: false };\n }\n const cells = this.dialogValueToCells(context, columns);\n if (!this.validateRequiredStepTableCells(cells, columns)) {\n return { success: false };\n }\n return {\n success: true,\n kind: 'object',\n value: {\n cells,\n title: customTitle || summarizeStepTableRow(cells, columns),\n } satisfies AXMSafetyPlanStepTableRowBuilderPayload,\n };\n });\n })\n .show();\n\n return result?.success && result.value ? result.value : null;\n }\n\n private buildStepTableRowFormDefinition(\n columns: AXMStepTableColumnDef[],\n options?: { includeTitle?: boolean },\n ): AXPDynamicFormDefinition {\n const ordered = sortStepTableColumns(columns);\n const parameters: AXPDynamicFormDefinition['groups'][number]['parameters'] = [];\n\n if (options?.includeTitle) {\n parameters.push({\n path: 'title',\n title: '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.title.title',\n widget: {\n path: 'title',\n type: AXPWidgetsCatalog.text,\n options: {\n placeholder:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.fields.title.placeholder',\n },\n },\n });\n }\n\n for (const column of ordered) {\n const key = stepTableColumnKey(column);\n const lookupEntity = resolveStepTableColumnLookupEntity(column);\n const multi = isStepTableColumnMultiLookup(column);\n parameters.push({\n path: key,\n title: stepTableColumnTitle(column),\n widget: lookupEntity\n ? {\n path: key,\n type: AXPWidgetsCatalog.lookup,\n options: {\n look: multi ? 'lookup' : 'select',\n entity: lookupEntity,\n textField: 'title',\n valueField: 'id',\n columns: ['code', 'title'],\n ...(multi ? { multiple: true } : {}),\n expose: multi\n ? [\n { source: 'id', target: `${key}Refs.{id}` },\n { source: 'title', target: `${key}Refs.{title}` },\n { source: 'code', target: `${key}Refs.{code}` },\n ]\n : [\n { source: 'id', target: `${key}Ref.id` },\n { source: 'title', target: `${key}Ref.title` },\n { source: 'code', target: `${key}Ref.code` },\n ],\n },\n }\n : {\n path: key,\n type: AXPWidgetsCatalog.text,\n },\n });\n }\n\n return {\n groups: [\n {\n name: 'step-table-row',\n title: '@workplacesafety-management:safety-plan-work-steps.entities.safety-plan-work-step.groups.table-content',\n parameters,\n },\n ],\n };\n }\n\n private validateRequiredStepTableCells(\n cells: AXMStepTableCellValue[],\n columns: AXMStepTableColumnDef[],\n ): boolean {\n for (const column of columns) {\n if (column.required !== true) {\n continue;\n }\n const key = stepTableColumnKey(column);\n const cell = cells.find((entry) => entry.columnKey === key);\n if (!cell) {\n return false;\n }\n const lookupEntity = resolveStepTableColumnLookupEntity(column);\n if (lookupEntity) {\n if (!(cell.refIds?.length)) {\n return false;\n }\n } else if (!cell.textValue?.trim()) {\n return false;\n }\n }\n return true;\n }\n\n private cellsToDialogValue(\n cells: AXMStepTableCellValue[],\n columns: AXMStepTableColumnDef[],\n ): SafetyPlanStepTableRowDialogValue {\n const ordered = sortStepTableColumns(columns);\n const normalized = normalizeStepTableRows(\n [{ id: 'row', sortOrder: 1, cells }],\n ordered,\n )[0];\n const dialogRow: SafetyPlanStepTableRowDialogValue = {};\n for (const column of ordered) {\n const key = stepTableColumnKey(column);\n const cell = normalized?.cells.find((entry) => entry.columnKey === key);\n if (!cell) {\n continue;\n }\n const lookupEntity = resolveStepTableColumnLookupEntity(column);\n if (!lookupEntity) {\n dialogRow[key] = cell.textValue ?? '';\n continue;\n }\n if (isStepTableColumnMultiLookup(column)) {\n dialogRow[key] = cell.refIds ?? [];\n dialogRow[`${key}Refs`] = cell.refs ?? [];\n } else {\n dialogRow[key] = cell.refIds?.[0];\n dialogRow[`${key}Ref`] = cell.refs?.[0];\n }\n }\n return dialogRow;\n }\n\n private dialogValueToCells(\n row: SafetyPlanStepTableRowDialogValue,\n columns: AXMStepTableColumnDef[],\n ): AXMStepTableCellValue[] {\n const ordered = sortStepTableColumns(columns);\n return ordered.map((column) => {\n const key = stepTableColumnKey(column);\n const lookupEntity = resolveStepTableColumnLookupEntity(column);\n if (!lookupEntity) {\n return {\n columnKey: key,\n textValue: typeof row[key] === 'string' ? String(row[key]) : '',\n };\n }\n if (isStepTableColumnMultiLookup(column)) {\n const refs = Array.isArray(row[`${key}Refs`])\n ? (row[`${key}Refs`] as { id?: string; title?: string; code?: string }[])\n : [];\n const ids = Array.isArray(row[key])\n ? (row[key] as unknown[]).filter((value): value is string => typeof value === 'string')\n : refs\n .map((ref) => (typeof ref?.id === 'string' ? ref.id : ''))\n .filter(Boolean);\n return {\n columnKey: key,\n refIds: ids,\n refs: ids.map((idValue) => {\n const ref = refs.find((entry) => entry?.id === idValue);\n return { id: idValue, title: ref?.title, code: ref?.code };\n }),\n };\n }\n const ref = row[`${key}Ref`] as { id?: string; title?: string; code?: string } | undefined;\n const idValue =\n (typeof row[key] === 'string' && String(row[key])) ||\n (typeof ref?.id === 'string' ? ref.id : '');\n return {\n columnKey: key,\n refIds: idValue ? [idValue] : [],\n refs: idValue ? [{ id: idValue, title: ref?.title, code: ref?.code }] : [],\n };\n });\n }\n\n private async loadWorkStepType(workStepTypeId: string): Promise<{\n id: string;\n title?: string;\n code?: string;\n columns: AXMStepTableColumnDef[];\n } | null> {\n try {\n const entityKey = `${RootConfig.module.name}.${RootConfig.entities.workStepType.name}`;\n const row = await this.entityService.withEntity(entityKey).data().byKey(workStepTypeId);\n if (!row) {\n return null;\n }\n const record = row as {\n id?: string;\n title?: string;\n code?: string;\n columns?: AXMStepTableColumnDef[];\n };\n return {\n id: String(record.id ?? workStepTypeId),\n title: record.title,\n code: record.code,\n columns: normalizeStepTableColumns(record.columns),\n };\n } catch {\n return null;\n }\n }\n\n //#endregion\n}\n\n//#endregion\n","<div class=\"axm-safety-plan-section-builder\">\n @if (!readonly() && !hideHeaderActions() && allowAddSection()) {\n <div class=\"__header\">\n <div class=\"__header-left\"></div>\n <div class=\"__header-right\">\n <ax-button\n class=\"ax-sm\"\n [text]=\"\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.add-section.title'\n | translate\n | async\n \"\n [color]=\"'primary'\"\n (onClick)=\"addSection()\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-layer-group\"></ax-icon>\n </ax-prefix>\n </ax-button>\n </div>\n </div>\n }\n\n <axp-standard-section-items-builder\n class=\"block min-h-[200px]\"\n [value]=\"builderValue()\"\n [config]=\"standardConfig()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"onBuilderValueChange($event)\"\n />\n</div>\n","//#region ----- Imports -----\n\nimport { Injectable, inject } from '@angular/core';\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXPDeviceService } from '@acorex-platform/framework-client/core';\n\nimport type { AXMSafetyPlanPreviewOpenOptions } from './safety-plan-preview.types';\n\n//#endregion\n\n//#region ----- Service -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMSafetyPlanPreviewService {\n //#region ----- Services & Dependencies -----\n\n private readonly popupService = inject(AXPopupService);\n private readonly deviceService = inject(AXPDeviceService);\n\n //#endregion\n\n //#region ----- Public API -----\n\n async open(options: AXMSafetyPlanPreviewOpenOptions): Promise<void> {\n const { AXMSafetyPlanPreviewModalComponent } = await import('./safety-plan-preview-modal.component');\n await this.popupService.open(AXMSafetyPlanPreviewModalComponent, {\n title: options.title,\n size: this.deviceService.isSmall() ? 'full' : 'lg',\n data: {\n structure: options.structure,\n },\n });\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemStatusType } from '@acorex-platform/framework-shared/core';\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\nimport { AXPDataGenerator } from '@acorex-platform/framework-client/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService, AXPRuntimeRemoteHookKeys, type AXPRuntimeCommandExecuteHookPayload } from '@acorex-platform/framework-client/runtime';\nimport { AXPHookService } from '@acorex-platform/framework-client/core';\nimport { AXPLayoutBuilderService, resolveLayoutBuilderDialogResult } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPPageLayoutBase, AXPPageLayoutBaseComponent } from '@acorex-platform/framework-client/layout/views';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport type {\n AXMSafetyPlanSectionBuilderValue,\n AXMWorkplaceSafetyManagementSafetyPlanTypeSectionEntityModel,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport {\n AXMWorkplaceSafetyManagementCommandKeys,\n RootConfig,\n buildSectionStructureFromTypeSections,\n collectBuiltInRepeatableSectionTypeIds,\n dedupeSafetyPlanSectionStructure,\n normalizeStepTableColumns,\n resolveEntityRefId,\n resolveSectionItemEntityName,\n isStepTableSectionType,\n toBuilderValueFromStructure,\n asSafetyPlanDisplayText,\n type AXMStepTableColumnDef,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXMSafetyPlanSectionBuilderComponent } from './safety-plan-section-builder.component';\nimport {\n normalizeSafetyPlanSectionBuilderValue,\n hydrateStepTableSectionsWithWorkSteps,\n safetyPlanSectionsToBuilderValue,\n} from './safety-plan-section-builder.types';\nimport { SAFETY_PLAN_SECTIONS_SAVE_COMMAND } from './save-safety-plan-sections.command';\nimport { AXMSafetyPlanPreviewService } from '../safety-plan-preview/safety-plan-preview.service';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AsyncPipe } from '@angular/common';\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst SAFETY_PLAN_SECTIONS_ADD_SECTION_COMMAND = 'SafetyPlan:Sections:AddSection';\nconst SAFETY_PLAN_SECTIONS_PREVIEW_COMMAND = 'SafetyPlan:Sections:Preview';\nconst SAFETY_PLAN_SECTIONS_DISCARD_COMMAND = 'SafetyPlan:Sections:Discard';\nconst SAFETY_PLAN_SECTIONS_CHANGE_PLAN_TYPE_COMMAND = 'SafetyPlan:Sections:ChangePlanType';\n\nconst SAFETY_PLAN_SECTION_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanSection.name}`;\nconst SAFETY_PLAN_WORK_STEP_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanWorkStep.name}`;\nconst SAFETY_PLAN_TYPE_SECTION_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanTypeSection.name}`;\nconst SAFETY_PLAN_TYPE_ENTITY = RootConfig.entities.safetyPlanType.source;\nconst SECTION_TYPE_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`;\n\n//#endregion\n\n//#region ---- Types ----\n\ninterface ChangePlanTypeDialogValue {\n safetyPlanTypeId: string;\n safetyPlanType?: { id: string; title?: string; code?: string };\n}\n\ninterface ChangePlanTypeSelection {\n safetyPlanTypeId: string;\n safetyPlanType?: { id: string; title?: string; code?: string };\n}\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-safety-plan-sections-page',\n standalone: true,\n imports: [AXMSafetyPlanSectionBuilderComponent, AXTranslationModule, AsyncPipe],\n template: `\n @if (isLoadingStructure()) {\n <p class=\"text-muted p-4\">\n {{\n '@workplacesafety-management:safety-plans.entities.safety-plan.pages.sections.loading'\n | translate\n | async\n }}\n </p>\n } @else if (safetyPlanId() || hasPlanType()) {\n <axm-safety-plan-section-builder\n #builderRef\n [value]=\"committedValue()\"\n [safetyPlanId]=\"safetyPlanId() ?? undefined\"\n [options]=\"builderOptions()\"\n (valueChange)=\"onValueChange($event)\"\n />\n } @else {\n <p class=\"text-muted p-4\">\n {{\n '@workplacesafety-management:safety-plans.entities.safety-plan.pages.sections.select-plan-type-first'\n | translate\n | async\n }}\n </p>\n }\n `,\n host: {\n class: 'block w-full min-h-0',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMSafetyPlanSectionsPageComponent,\n },\n ],\n})\nexport class AXMSafetyPlanSectionsPageComponent extends AXPPageLayoutBaseComponent {\n rootContext = input<Record<string, unknown>>({});\n pageConfig = input<Record<string, unknown>>();\n options = input<Record<string, unknown>>({});\n\n protected readonly builderRef = viewChild<AXMSafetyPlanSectionBuilderComponent>('builderRef');\n\n private readonly commandService = inject(AXPCommandService);\n private readonly entityService = inject(AXPEntityService);\n private readonly dialogService = inject(AXDialogService);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly hooks = inject(AXPHookService);\n private readonly hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n private readonly previewService = inject(AXMSafetyPlanPreviewService);\n\n private readonly baselineValue = signal<AXMSafetyPlanSectionBuilderValue | null>(null);\n protected readonly committedValue = signal<AXMSafetyPlanSectionBuilderValue | null>(null);\n protected readonly isLoadingStructure = signal(false);\n /** Prevents re-entrant sync loops when applyStructure mutates shared form context. */\n private readonly lastSyncedKey = signal<string | null>(null);\n /** In-flight sync key — blocks concurrent loads for the same pair without blocking retries after cancel. */\n private readonly inflightSyncKey = signal<string | null>(null);\n private readonly appliedPlanTypeId = signal<string | null>(null);\n /** Keeps plan type in sync after Change Plan Type when parent form context is mutated in place. */\n private readonly planTypeOverride = signal<string | null>(null);\n\n protected readonly safetyPlanId = computed((): string | null => {\n const raw = this.rootContext()?.['id'];\n return typeof raw === 'string' && raw.length > 0 ? raw : null;\n });\n\n protected readonly planTypeId = computed((): string | null => {\n const override = this.planTypeOverride();\n if (override) {\n return override;\n }\n const ctx = this.rootContext() ?? {};\n return (\n resolveEntityRefId(ctx['safetyPlanTypeId']) ??\n resolveEntityRefId((ctx['safetyPlanType'] as { id?: unknown } | undefined)?.id) ??\n resolveEntityRefId(ctx['safetyPlanType'])\n );\n });\n\n protected readonly hasPlanType = computed(() => !!this.planTypeId());\n\n protected readonly isDraftPlan = computed((): boolean => {\n const status = this.rootContext()?.['status'];\n return !status || status === AXPSystemStatusType.Draft;\n });\n\n protected readonly builderOptions = computed(() => ({\n hideHeaderActions: true,\n readonly: !this.isDraftPlan() || this.isLoadingStructure(),\n allowAddSection: this.isDraftPlan() && !this.isLoadingStructure(),\n allowAddItems: this.isDraftPlan() && !this.isLoadingStructure(),\n allowReorderSections: this.isDraftPlan() && !this.isLoadingStructure(),\n ...((this.pageConfig() ?? {}) as Record<string, unknown>),\n ...((this.options() ?? {}) as Record<string, unknown>),\n allowEditSection: false,\n allowEditItem: false,\n }));\n\n protected readonly isDirty = computed(() => {\n return !isEqual(this.baselineValue() ?? { sections: [] }, this.committedValue() ?? { sections: [] });\n });\n\n #syncFromContext = effect((onCleanup) => {\n const planId = this.safetyPlanId();\n const typeId = this.planTypeId();\n const syncKey = `${planId ?? ''}|${typeId ?? ''}`;\n\n // Already applied or already loading for this plan/type pair.\n if (\n untracked(() => this.lastSyncedKey()) === syncKey ||\n untracked(() => this.inflightSyncKey()) === syncKey\n ) {\n return;\n }\n\n this.inflightSyncKey.set(syncKey);\n\n let cancelled = false;\n\n const clearInflight = (): void => {\n if (untracked(() => this.inflightSyncKey()) === syncKey) {\n this.inflightSyncKey.set(null);\n }\n };\n\n const markSynced = (): void => {\n this.lastSyncedKey.set(syncKey);\n clearInflight();\n };\n\n const run = async (): Promise<void> => {\n if (cancelled) {\n return;\n }\n\n const repeatableSectionTypeIds = await this.loadRepeatableSectionTypeIds();\n if (cancelled) {\n return;\n }\n\n // Edit: load independent saved sections once — never append type defaults on top.\n if (planId) {\n this.isLoadingStructure.set(true);\n try {\n const loaded = await this.fetchSectionsFromBackend(planId, repeatableSectionTypeIds);\n if (cancelled) return;\n\n if (loaded.sections.length > 0) {\n // Replace UI from backend (deduped). Never append defaults on top of saved rows.\n this.applyStructure(loaded, { asBaseline: true });\n this.appliedPlanTypeId.set(typeId);\n markSynced();\n return;\n }\n\n // No saved rows yet — fall through to type defaults when type is known.\n } catch {\n if (cancelled) return;\n clearInflight();\n await this.showStructureLoadError();\n return;\n } finally {\n if (!cancelled) {\n this.isLoadingStructure.set(false);\n }\n }\n\n if (cancelled) {\n return;\n }\n }\n\n if (!typeId) {\n this.appliedPlanTypeId.set(null);\n this.applyStructure({ sections: [] }, { asBaseline: true });\n markSynced();\n return;\n }\n\n const previousTypeId = untracked(() => this.appliedPlanTypeId());\n const currentSections = untracked(() => this.committedValue()?.sections ?? []);\n\n if (previousTypeId && previousTypeId !== typeId && currentSections.length > 0) {\n const confirmed = await this.confirmReplaceStructure();\n if (cancelled) return;\n if (!confirmed) {\n // Keep previous structure; mark new type as handled so we do not loop.\n this.appliedPlanTypeId.set(typeId);\n markSynced();\n return;\n }\n }\n\n this.isLoadingStructure.set(true);\n try {\n const defaults = await this.loadDefaultsForPlanType(typeId, repeatableSectionTypeIds);\n if (cancelled) return;\n // Replace (never append) the current collection with type defaults.\n this.applyStructure(defaults, { asBaseline: true });\n this.appliedPlanTypeId.set(typeId);\n markSynced();\n } catch {\n if (cancelled) return;\n clearInflight();\n await this.showStructureLoadError();\n } finally {\n if (!cancelled) {\n this.isLoadingStructure.set(false);\n }\n }\n };\n\n void run();\n\n onCleanup(() => {\n cancelled = true;\n clearInflight();\n });\n });\n\n protected onValueChange(value: AXMSafetyPlanSectionBuilderValue): void {\n const withOrder = normalizeSafetyPlanSectionBuilderValue({\n sections: value.sections.map((section, index) => ({\n ...section,\n sortOrder: index + 1,\n })),\n });\n this.committedValue.set(withOrder);\n this.updateRootContextField('sectionStructure', withOrder);\n this.updateRootContextField('sections', withOrder);\n this.recompute();\n }\n\n override getWizardStepContext(): Record<string, unknown> | null {\n const value = this.committedValue();\n if (!value) {\n return null;\n }\n const cloned = cloneDeep(value);\n return { sectionStructure: cloned, sections: cloned };\n }\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n override async getPrimaryMenuItems(): Promise<AXPLayoutDetailsViewAction[]> {\n const actions: AXPLayoutDetailsViewAction[] = [];\n const canPreview =\n !this.isLoadingStructure() &&\n (!!this.hasPlanType() || !!this.safetyPlanId() || (this.committedValue()?.sections.length ?? 0) > 0);\n\n if (this.isDraftPlan() && !this.isLoadingStructure()) {\n actions.push({\n title:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.add-section.title',\n icon: 'fa-light fa-layer-group',\n zone: 'header' as const,\n priority: 'primary' as const,\n color: 'primary' as const,\n command: { name: SAFETY_PLAN_SECTIONS_ADD_SECTION_COMMAND, options: {} },\n });\n }\n\n if (canPreview) {\n actions.push({\n title:\n '@workplacesafety-management:safety-plan-sections.entities.safety-plan-section.actions.preview.title',\n icon: 'fa-light fa-eye',\n zone: 'header' as const,\n priority: 'secondary' as const,\n color: 'default' as const,\n command: { name: SAFETY_PLAN_SECTIONS_PREVIEW_COMMAND, options: {} },\n });\n }\n\n if (!this.isDraftPlan() || this.isLoadingStructure()) {\n return actions;\n }\n\n actions.push({\n title: '@workplacesafety-management:safety-plans.actions.change-plan-type.title',\n icon: 'fa-light fa-arrow-right-arrow-left',\n zone: 'header' as const,\n priority: 'secondary' as const,\n color: 'default' as const,\n visible: this.isDraftPlan() && (!!this.planTypeId() || !!this.safetyPlanId()),\n command: { name: SAFETY_PLAN_SECTIONS_CHANGE_PLAN_TYPE_COMMAND, options: {} },\n });\n\n if (this.safetyPlanId()) {\n actions.push(\n {\n title: '@general:actions.discard.title',\n icon: 'fa-light fa-rotate-left',\n zone: 'footer' as const,\n priority: 'secondary',\n color: 'default',\n visible: this.isDirty(),\n command: { name: SAFETY_PLAN_SECTIONS_DISCARD_COMMAND, options: {} },\n },\n {\n title: '@general:actions.save.title',\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer' as const,\n priority: 'primary',\n color: 'primary',\n visible: this.isDirty(),\n command: { name: SAFETY_PLAN_SECTIONS_SAVE_COMMAND, options: {} },\n },\n );\n }\n\n return actions;\n }\n\n override async execute(command: { name: string; options?: unknown }): Promise<void> {\n if (command.name === SAFETY_PLAN_SECTIONS_ADD_SECTION_COMMAND) {\n await this.builderRef()?.addSection();\n return;\n }\n\n if (command.name === SAFETY_PLAN_SECTIONS_PREVIEW_COMMAND) {\n await this.handlePreview();\n return;\n }\n\n if (command.name === SAFETY_PLAN_SECTIONS_CHANGE_PLAN_TYPE_COMMAND) {\n await this.handleChangePlanType();\n return;\n }\n\n if (command.name === SAFETY_PLAN_SECTIONS_DISCARD_COMMAND) {\n this.handleDiscard();\n return;\n }\n\n if (command.name !== SAFETY_PLAN_SECTIONS_SAVE_COMMAND) return;\n\n await this.handleSave({ silent: false });\n }\n\n private async handlePreview(): Promise<void> {\n const previewLabel =\n (await this.translateService.translateAsync('@general:actions.preview.title')) || 'Preview';\n const locale = this.translateService.getActiveLang?.() ?? 'en-US';\n const planTitle = resolveEntityRowDisplayText(this.rootContext()?.['title'], locale);\n const title = planTitle ? `${previewLabel}: ${planTitle}` : previewLabel;\n await this.previewService.open({\n title,\n structure: cloneDeep(this.committedValue() ?? { sections: [] }),\n });\n }\n\n private async handleChangePlanType(): Promise<void> {\n if (!this.isDraftPlan()) {\n this.toastService.show({\n color: 'warning',\n title: await this.translateService.translateAsync('@general:messages.generic.error.title'),\n content: await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.draft-only',\n ),\n });\n return;\n }\n\n const selection = await this.promptChangePlanTypeDialog();\n if (!selection) {\n return;\n }\n\n const currentTypeId = this.planTypeId();\n if (currentTypeId && currentTypeId === selection.safetyPlanTypeId) {\n this.toastService.show({\n color: 'warning',\n title: await this.translateService.translateAsync('@general:messages.generic.error.title'),\n content: await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.same-plan-type',\n ),\n });\n return;\n }\n\n const confirmed = await this.confirmChangePlanType();\n if (!confirmed) {\n return;\n }\n\n const planId = this.safetyPlanId();\n this.isLoadingStructure.set(true);\n try {\n if (planId) {\n await this.applyPersistedPlanTypeChange(planId, selection);\n } else {\n await this.applyWizardPlanTypeChange(selection);\n }\n } catch {\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.generic.error.title'),\n content: await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.change-plan-type-failed',\n ),\n });\n } finally {\n this.isLoadingStructure.set(false);\n }\n }\n\n private async promptChangePlanTypeDialog(): Promise<ChangePlanTypeSelection | null> {\n const ctx = this.rootContext() ?? {};\n const currentType = (ctx['safetyPlanType'] as { id?: string; title?: string; code?: string } | undefined) ?? {};\n const currentTypeId = this.planTypeId() ?? '';\n\n const result = await this.layoutBuilder\n .create()\n .dialog<ChangePlanTypeSelection | null>((dialog) => {\n dialog\n .setTitle('@workplacesafety-management:safety-plans.actions.change-plan-type.dialog.title')\n .setSize('md')\n .setCloseButton(true)\n .setContext({\n safetyPlanTypeId: currentTypeId,\n safetyPlanType: currentTypeId\n ? {\n id: currentTypeId,\n title: typeof currentType.title === 'string' ? currentType.title : undefined,\n code: typeof currentType.code === 'string' ? currentType.code : undefined,\n }\n : undefined,\n } satisfies ChangePlanTypeDialogValue)\n .content((flex) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .formField(\n '@workplacesafety-management:safety-plans.actions.change-plan-type.dialog.fields.plan-type.title',\n (field) => {\n field.path('safetyPlanTypeId');\n field.lookupBox({\n entity: SAFETY_PLAN_TYPE_ENTITY,\n look: 'select',\n searchable: true,\n textField: 'title',\n valueField: 'id',\n columns: ['code', 'title'],\n expose: [\n { source: 'id', target: 'safetyPlanType.id' },\n { source: 'title', target: 'safetyPlanType.title' },\n { source: 'code', target: 'safetyPlanType.code' },\n ],\n validations: [{ rule: 'required' }],\n });\n },\n );\n })\n .setActions((actions) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit('@workplacesafety-management:safety-plans.actions.change-plan-type.dialog.actions.continue');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return null;\n }\n const context = dialogRef.context() as ChangePlanTypeDialogValue;\n const safetyPlanTypeId = resolveEntityRefId(context.safetyPlanTypeId);\n if (!safetyPlanTypeId) {\n throw new Error(\n (await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.actions.change-plan-type.dialog.fields.plan-type.placeholder',\n )) || 'Select a Plan Type',\n );\n }\n return {\n safetyPlanTypeId,\n safetyPlanType: context.safetyPlanType?.id\n ? context.safetyPlanType\n : { id: safetyPlanTypeId },\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<ChangePlanTypeSelection>(result);\n }\n\n private async confirmChangePlanType(): Promise<boolean> {\n const title =\n (await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.confirm-change-plan-type.title',\n )) || 'Change Plan Type?';\n const message =\n (await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.confirm-change-plan-type.message',\n )) ||\n 'Changing the Plan Type will discard all existing sections and their selected values. The default sections for the new Plan Type will be loaded. Do you want to continue?';\n\n const dialogResult = await this.dialogService.confirm(title, message, 'danger', 'horizontal');\n return dialogResult.result === true;\n }\n\n private async applyPersistedPlanTypeChange(planId: string, selection: ChangePlanTypeSelection): Promise<void> {\n const payload = await this.hooks.runAsync<AXPRuntimeCommandExecuteHookPayload>(\n AXPRuntimeRemoteHookKeys.CommandExecute,\n {\n name: AXMWorkplaceSafetyManagementCommandKeys.SafetyPlan.ChangeType,\n input: {\n id: planId,\n safetyPlanTypeId: selection.safetyPlanTypeId,\n safetyPlanType: selection.safetyPlanType,\n },\n },\n );\n\n if (!payload.handled || !payload.result?.success) {\n const text = payload.result?.message?.text;\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.generic.error.title'),\n content:\n typeof text === 'string' && text.startsWith('@')\n ? await this.translateService.translateAsync(text)\n : await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.change-plan-type-failed',\n ),\n });\n return;\n }\n\n const data = payload.result.data as\n | {\n safetyPlanTypeId?: string;\n safetyPlanType?: { id: string; title?: string; code?: string };\n sections?: unknown[];\n }\n | undefined;\n\n const nextTypeId = data?.safetyPlanTypeId ?? selection.safetyPlanTypeId;\n const nextType = data?.safetyPlanType ?? selection.safetyPlanType ?? { id: nextTypeId };\n const repeatableSectionTypeIds = await this.loadRepeatableSectionTypeIds();\n const saved = dedupeSafetyPlanSectionStructure(\n safetyPlanSectionsToBuilderValue(\n (data?.sections ?? []) as Parameters<typeof safetyPlanSectionsToBuilderValue>[0],\n ),\n { repeatableSectionTypeIds },\n );\n\n this.planTypeOverride.set(nextTypeId);\n this.updateRootContextField('safetyPlanTypeId', nextTypeId);\n this.updateRootContextField('safetyPlanType', nextType);\n this.appliedPlanTypeId.set(nextTypeId);\n this.lastSyncedKey.set(`${planId}|${nextTypeId}`);\n this.inflightSyncKey.set(null);\n this.applyStructure(saved, { asBaseline: true });\n this.builderRef()?.syncAfterSave(saved);\n this.recompute();\n\n this.toastService.show({\n color: 'success',\n title: await this.translateService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.actions.change-plan-type.dialog.success',\n ),\n });\n }\n\n private async applyWizardPlanTypeChange(selection: ChangePlanTypeSelection): Promise<void> {\n const repeatableSectionTypeIds = await this.loadRepeatableSectionTypeIds();\n const defaults = await this.loadDefaultsForPlanType(\n selection.safetyPlanTypeId,\n repeatableSectionTypeIds,\n );\n\n this.planTypeOverride.set(selection.safetyPlanTypeId);\n this.updateRootContextField('safetyPlanTypeId', selection.safetyPlanTypeId);\n this.updateRootContextField('safetyPlanType', selection.safetyPlanType ?? { id: selection.safetyPlanTypeId });\n this.appliedPlanTypeId.set(selection.safetyPlanTypeId);\n this.lastSyncedKey.set(`|${selection.safetyPlanTypeId}`);\n this.inflightSyncKey.set(null);\n this.applyStructure(defaults, { asBaseline: true });\n this.builderRef()?.syncAfterSave(defaults);\n this.recompute();\n\n this.toastService.show({\n color: 'success',\n title: await this.translateService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.actions.change-plan-type.dialog.success',\n ),\n });\n }\n\n private async handleSave(options?: { silent?: boolean }): Promise<void> {\n const silent = options?.silent === true;\n const id = this.safetyPlanId();\n const value = this.committedValue() ?? { sections: [] };\n\n if (!id) {\n if (!silent) {\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.generic.error.title'),\n content: await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.entities.safety-plan.pages.sections.save-plan-first',\n ),\n });\n }\n return;\n }\n\n const result = await this.commandService.execute(SAFETY_PLAN_SECTIONS_SAVE_COMMAND, { id, value });\n\n if (result?.success) {\n // Always reload from backend after save so UI never keeps a stale/appended local list.\n const repeatableSectionTypeIds = await this.loadRepeatableSectionTypeIds();\n const saved = await this.fetchSectionsFromBackend(id, repeatableSectionTypeIds);\n this.applyStructure(saved, { asBaseline: true });\n this.lastSyncedKey.set(`${id}|${this.planTypeId() ?? ''}`);\n this.inflightSyncKey.set(null);\n this.builderRef()?.syncAfterSave(saved);\n this.recompute();\n if (!silent) {\n this.toastService.show({\n color: 'success',\n title: await this.translateService.translateAsync('@general:messages.generic.success.title'),\n content: await this.translateService.translateAsync('@general:messages.generic.success.description'),\n });\n }\n return;\n }\n\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.generic.error.title'),\n content:\n typeof result?.message?.text === 'string' && result.message.text.startsWith('@')\n ? await this.translateService.translateAsync(result.message.text)\n : await this.translateService.translateAsync('@general:messages.entity.update-failed'),\n });\n }\n\n protected override recompute(): void {\n super.recompute();\n const layout = this.hostPageLayout as unknown as { recompute?: () => void } | null | undefined;\n layout?.recompute?.();\n }\n\n private handleDiscard(): void {\n const baseline = this.baselineValue() ?? { sections: [] };\n this.committedValue.set(baseline);\n this.updateRootContextField('sectionStructure', baseline);\n this.updateRootContextField('sections', baseline);\n this.builderRef()?.resetAfterDiscard();\n this.recompute();\n }\n\n private applyStructure(\n value: AXMSafetyPlanSectionBuilderValue,\n options: { asBaseline: boolean },\n ): void {\n const normalized = normalizeSafetyPlanSectionBuilderValue(value);\n if (options.asBaseline) {\n this.baselineValue.set(normalized);\n }\n this.committedValue.set(normalized);\n // Keep both form fields in sync with the same replaced value (never merge/append).\n this.updateRootContextField('sectionStructure', normalized);\n this.updateRootContextField('sections', normalized);\n // Defer host recompute so it cannot re-enter the sync effect synchronously.\n queueMicrotask(() => {\n untracked(() => this.recompute());\n });\n }\n\n /** Query plan sections from storage and return a deduped builder value (replace, never append). */\n private async fetchSectionsFromBackend(\n planId: string,\n repeatableSectionTypeIds: readonly string[] = [],\n ): Promise<AXMSafetyPlanSectionBuilderValue> {\n const result = await this.entityService.withEntity(SAFETY_PLAN_SECTION_ENTITY).data().query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanId', operator: { type: 'equal' }, value: planId }],\n },\n } as never);\n\n const rawLoaded = safetyPlanSectionsToBuilderValue(\n (result.items ?? []) as Parameters<typeof safetyPlanSectionsToBuilderValue>[0],\n );\n const deduped = dedupeSafetyPlanSectionStructure(rawLoaded, { repeatableSectionTypeIds });\n\n const workStepsResult = await this.entityService.withEntity(SAFETY_PLAN_WORK_STEP_ENTITY).data().query({\n skip: 0,\n take: 2000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanId', operator: { type: 'equal' }, value: planId }],\n },\n } as never);\n\n const columnsByWorkStepTypeId = await this.loadWorkStepTypeColumns(\n deduped.sections\n .map((section) => section.workStepTypeId)\n .filter((id): id is string => typeof id === 'string' && id.length > 0),\n );\n\n return this.hydrateCatalogItemSnapshots(\n hydrateStepTableSectionsWithWorkSteps(\n deduped,\n (workStepsResult.items ?? []) as Parameters<typeof hydrateStepTableSectionsWithWorkSteps>[1],\n columnsByWorkStepTypeId,\n ),\n );\n }\n\n /**\n * Repeater lookups are not joined on query. Fill missing catalog item titles from\n * Hazard / HazardRisk / PPE / Control records so seeded item cards are not blank.\n */\n private async hydrateCatalogItemSnapshots(\n value: AXMSafetyPlanSectionBuilderValue,\n ): Promise<AXMSafetyPlanSectionBuilderValue> {\n const locale = this.translateService.getActiveLang?.() ?? 'en-US';\n const missingByEntity = new Map<string, Set<string>>();\n\n for (const section of value.sections) {\n if (isStepTableSectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n const entityName = resolveSectionItemEntityName(section.sectionTypeId, section.sectionType);\n if (!entityName) {\n continue;\n }\n for (const slot of section.items) {\n for (const id of slot.itemIds ?? []) {\n const snapshot = slot.items?.find((entry) => entry.id === id);\n if (asSafetyPlanDisplayText(snapshot?.title) || asSafetyPlanDisplayText(snapshot?.code)) {\n continue;\n }\n const ids = missingByEntity.get(entityName) ?? new Set<string>();\n ids.add(id);\n missingByEntity.set(entityName, ids);\n }\n }\n }\n\n if (missingByEntity.size === 0) {\n return value;\n }\n\n const loadedById = new Map<string, { title?: string; code?: string }>();\n await Promise.all(\n [...missingByEntity.entries()].map(async ([entityName, ids]) => {\n const idList = [...ids];\n try {\n const result = await this.entityService.withEntity(entityName).data().query({\n skip: 0,\n take: Math.max(idList.length, 1),\n filter:\n idList.length === 1\n ? { field: 'id', operator: { type: 'equal' }, value: idList[0] }\n : { field: 'id', operator: { type: 'in' }, value: idList },\n } as never);\n for (const row of result.items ?? []) {\n const record = row as unknown as Record<string, unknown>;\n const id = resolveEntityRefId(record['id']);\n if (!id) {\n continue;\n }\n loadedById.set(id, {\n title: resolveEntityRowDisplayText(record['title'], locale) || undefined,\n code: asSafetyPlanDisplayText(record['code']) || undefined,\n });\n }\n } catch {\n /* skip entities the session cannot read */\n }\n }),\n );\n\n if (loadedById.size === 0) {\n return value;\n }\n\n return {\n sections: value.sections.map((section) => ({\n ...section,\n items: section.items.map((slot) => ({\n ...slot,\n items: (slot.itemIds ?? []).map((id, index) => {\n const existing = slot.items?.find((entry) => entry.id === id) ?? slot.items?.[index];\n const loaded = loadedById.get(id);\n return {\n id,\n title: asSafetyPlanDisplayText(existing?.title) || loaded?.title,\n code: asSafetyPlanDisplayText(existing?.code) || loaded?.code,\n };\n }),\n })),\n })),\n };\n }\n\n private async loadWorkStepTypeColumns(\n workStepTypeIds: readonly string[],\n ): Promise<Map<string, AXMStepTableColumnDef[]>> {\n const uniqueIds = [...new Set(workStepTypeIds)];\n const columnsById = new Map<string, AXMStepTableColumnDef[]>();\n if (!uniqueIds.length) {\n return columnsById;\n }\n\n const entityKey = `${RootConfig.module.name}.${RootConfig.entities.workStepType.name}`;\n const accessor = this.entityService.withEntity(entityKey);\n await Promise.all(\n uniqueIds.map(async (id) => {\n try {\n const row = await accessor.data().byKey(id);\n if (!row) {\n return;\n }\n const record = row as { columns?: AXMStepTableColumnDef[] };\n columnsById.set(id, normalizeStepTableColumns(record.columns));\n } catch {\n // Leave missing types without columns; hydrate falls back to row snapshots.\n }\n }),\n );\n return columnsById;\n }\n\n private async loadRepeatableSectionTypeIds(): Promise<string[]> {\n const builtIn = collectBuiltInRepeatableSectionTypeIds();\n try {\n const result = await this.entityService.withEntity(SECTION_TYPE_ENTITY).data().query({\n skip: 0,\n take: 1000,\n } as never);\n const fromQuery = (result.items ?? [])\n .filter((row) => (row as { isRepeatable?: unknown }).isRepeatable === true)\n .map((row) => resolveEntityRefId((row as { id?: unknown }).id))\n .filter((id): id is string => !!id);\n return [...new Set([...fromQuery, ...builtIn])];\n } catch {\n return builtIn;\n }\n }\n\n private async loadDefaultsForPlanType(\n typeId: string,\n repeatableSectionTypeIds: readonly string[] = [],\n ): Promise<AXMSafetyPlanSectionBuilderValue> {\n const result = await this.entityService.withEntity(SAFETY_PLAN_TYPE_SECTION_ENTITY).data().query({\n skip: 0,\n take: 1000,\n sort: [{ field: 'sortOrder', dir: 'asc' }],\n filter: {\n logic: 'and',\n filters: [\n { field: 'safetyPlanTypeId', operator: { type: 'equal' }, value: typeId },\n { field: 'isArchived', operator: { type: 'equal' }, value: false },\n ],\n },\n } as never);\n\n const typeSections = ((result.items ?? []) as AXMWorkplaceSafetyManagementSafetyPlanTypeSectionEntityModel[]).filter(\n (row) => resolveEntityRefId(row.safetyPlanTypeId) === typeId,\n );\n\n const structure = dedupeSafetyPlanSectionStructure(\n buildSectionStructureFromTypeSections(typeSections, {\n createId: () => AXPDataGenerator.uuid(),\n }),\n { repeatableSectionTypeIds },\n );\n\n return toBuilderValueFromStructure(await this.enrichSectionTitlesFromSectionTypes(structure));\n }\n\n /**\n * Fills missing section titles from SectionType records when type-section snapshots omit them.\n */\n private async enrichSectionTitlesFromSectionTypes(\n structure: ReturnType<typeof buildSectionStructureFromTypeSections>,\n ): Promise<ReturnType<typeof buildSectionStructureFromTypeSections>> {\n const missingIds = [\n ...new Set(\n structure.sections\n .filter((section) => !section.sectionType?.title || section.title === section.sectionTypeId)\n .map((section) => section.sectionTypeId)\n .filter((id) => !!id),\n ),\n ];\n if (!missingIds.length) {\n return structure;\n }\n\n const sectionTypeEntity = `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`;\n const result = await this.entityService.withEntity(sectionTypeEntity).data().query({\n skip: 0,\n take: Math.max(missingIds.length, 1),\n filter: {\n logic: 'or',\n filters: missingIds.map((id) => ({\n field: 'id',\n operator: { type: 'equal' },\n value: id,\n })),\n },\n } as never);\n\n const byId = new Map<string, { title?: string; code?: string }>();\n for (const row of result.items ?? []) {\n const record = row as unknown as Record<string, unknown>;\n const id = resolveEntityRefId(record['id']);\n if (!id) continue;\n const title = record['title'];\n const code = record['code'];\n byId.set(id, {\n title: typeof title === 'string' ? title : undefined,\n code: typeof code === 'string' ? code : undefined,\n });\n }\n\n return {\n sections: structure.sections.map((section) => {\n const meta = byId.get(section.sectionTypeId);\n if (!meta?.title && !meta?.code) {\n return section;\n }\n const title = (meta.title ?? meta.code ?? section.title).trim();\n return {\n ...section,\n title,\n sectionType: {\n id: section.sectionTypeId,\n title: meta.title ?? section.sectionType?.title,\n code: meta.code ?? section.sectionType?.code,\n },\n };\n }),\n };\n }\n\n private async confirmReplaceStructure(): Promise<boolean> {\n const title =\n (await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.confirm-change-plan-type.title',\n )) || 'Change Plan Type?';\n const message =\n (await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.confirm-change-plan-type.message',\n )) ||\n 'Changing the Plan Type will discard all existing sections and their selected values. The default sections for the new Plan Type will be loaded. Do you want to continue?';\n\n const dialogResult = await this.dialogService.confirm(title, message, 'danger', 'horizontal');\n return dialogResult.result === true;\n }\n\n private async showStructureLoadError(): Promise<void> {\n this.toastService.show({\n color: 'danger',\n title: await this.translateService.translateAsync('@general:messages.generic.error.title'),\n content: await this.translateService.translateAsync(\n '@workplacesafety-management:safety-plans.messages.section-structure.load-failed',\n ),\n });\n }\n\n private updateRootContextField(field: string, value: unknown): void {\n const ctx = this.rootContext() as Record<string, unknown> | undefined;\n if (!ctx || typeof ctx !== 'object') {\n return;\n }\n ctx[field] = cloneDeep(value);\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport {\n AXPPageComponentDefinition,\n AXPPageComponentProvider,\n} from '@acorex-platform/framework-client/layout/components';\nimport { Injectable } from '@angular/core';\nimport { SAFETY_PLAN_SECTIONS_PAGE_COMPONENT_KEY } from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\n//#endregion\n\n//#region ---- Safety plan sections page provider ----\n\n@Injectable()\nexport class AXMSafetyPlanSectionsPageComponentProvider implements AXPPageComponentProvider {\n async components(): Promise<AXPPageComponentDefinition[]> {\n return [\n {\n key: SAFETY_PLAN_SECTIONS_PAGE_COMPONENT_KEY,\n loader: () =>\n import('./safety-plan-sections-page.component').then((m) => m.AXMSafetyPlanSectionsPageComponent),\n },\n ];\n }\n}\n\n//#endregion\n"],"names":["i4","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AA4BA;AAEA;AAEO,MAAM,uCAAuC,GAAG;IACrD,MAAM;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,oBAAoB;CACZ;AAEH,MAAM,6CAA6C,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU;AAEtF,MAAM,eAAe,GAAG,CAAC,QAAQ,CAAU;AAC3C,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,sBAAsB,CAAU;AAExF;AAEA;AAEM,SAAU,8CAA8C,CAC5D,aAAiC,EACjC,QAAiC,EACjC,YAAsB,EACtB,kBAA4B,EAAA;AAE5B,IAAA,MAAM,YAAY,GAAG;AACnB,QAAA,qBAAqB,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC9C,QAAA,6BAA6B,CAAC,QAAQ,EAAE,IAAI,CAAC;QAC7C,8BAA8B,CAAC,YAAY,CAAC;AAC5C,QAAA,8BAA8B,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC/C,oCAAoC,CAAC,kBAAkB,CAAC;AACxD,QAAA,oCAAoC,CAAC,QAAQ,EAAE,WAAW,CAAC;KAC5D;AACD,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAChC,QAAA,OAAO,2BAA2B;IACpC;AACA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;AAC3C,QAAA,OAAO,cAAc,CAAC,OAAO,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AA,UAAA,EAAA,CAAA;kBADtD;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BlPzzCc2.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-section-builder.types.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/save-safety-plan-sections.command.ts"],"sourcesContent":["import { AXPDataGenerator } from '@acorex-platform/framework-client/core';\nimport {\n enrichSectionTypeSnapshot,\n isStepTableSectionType,\n normalizeStepTableColumns,\n normalizeStepTableRows,\n resolveEntityRefId,\n stepTableColumnTitle,\n type AXMSafetyPlanSectionBuilderItemValue,\n type AXMSafetyPlanSectionBuilderSectionValue,\n type AXMSafetyPlanSectionBuilderValue,\n type AXMSafetyPlanStepTableRowBuilderPayload,\n type AXMStepTableCellValue,\n type AXMStepTableColumnDef,\n type AXMWorkplaceSafetyManagementSafetyPlanSectionEntityModel,\n type AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\nexport function createSafetyPlanSectionBuilderDefaultValue(): AXMSafetyPlanSectionBuilderValue {\n return { sections: [] };\n}\n\nexport function normalizeSafetyPlanSectionBuilderValue(\n value: AXMSafetyPlanSectionBuilderValue | null | undefined,\n): AXMSafetyPlanSectionBuilderValue {\n if (!value || !Array.isArray(value.sections)) {\n return createSafetyPlanSectionBuilderDefaultValue();\n }\n\n return {\n sections: value.sections.map((section, index) => normalizeSection(section, index)),\n };\n}\n\nexport function safetyPlanSectionsToBuilderValue(\n rows: AXMWorkplaceSafetyManagementSafetyPlanSectionEntityModel[],\n): AXMSafetyPlanSectionBuilderValue {\n const ordered = [...rows].sort(\n (a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0) || String(a.code ?? '').localeCompare(String(b.code ?? '')),\n );\n return {\n sections: ordered.map((row, index) => {\n const legacyItem = row.items?.[0];\n const sectionTypeId =\n resolveEntityRefId(legacyItem?.sectionTypeId) ??\n resolveEntityRefId(legacyItem?.sectionType) ??\n '';\n const workStepTypeId =\n resolveEntityRefId(legacyItem?.workStepTypeId) ??\n resolveEntityRefId(legacyItem?.workStepType) ??\n undefined;\n return {\n id: row.id,\n sectionTypeId,\n sectionType: enrichSectionTypeSnapshot(sectionTypeId, legacyItem?.sectionType),\n title: row.title,\n description: row.description ?? '',\n safetyPlanId: row.safetyPlanId,\n code: row.code,\n sourceSafetyPlanTypeSectionId: row.sourceSafetyPlanTypeSectionId,\n sortOrder: row.sortOrder ?? index + 1,\n workStepTypeId,\n workStepType: legacyItem?.workStepType,\n widgetOptions: normalizeWidgetOptions(row.widgetOptions),\n columns: [],\n items: (row.items ?? []).map((item, itemIndex) => ({\n id: `${row.id}__item_${itemIndex + 1}`,\n itemIds: [...(item.itemIds ?? [])],\n items: item.items ? [...item.items] : [],\n })),\n };\n }),\n };\n}\n\n/** Merges SafetyPlanWorkStep row entities into Step Table sections. */\nexport function hydrateStepTableSectionsWithWorkSteps(\n value: AXMSafetyPlanSectionBuilderValue,\n workSteps: AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel[],\n columnsByWorkStepTypeId?: ReadonlyMap<string, AXMStepTableColumnDef[]>,\n): AXMSafetyPlanSectionBuilderValue {\n const bySection = new Map<string, AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel[]>();\n for (const step of workSteps) {\n const sectionId = resolveEntityRefId(step.safetyPlanSectionId) ?? '';\n if (!sectionId) {\n continue;\n }\n const list = bySection.get(sectionId) ?? [];\n list.push(step);\n bySection.set(sectionId, list);\n }\n\n return {\n sections: value.sections.map((section) => {\n if (!isStepTableSectionType(section.sectionTypeId, section.sectionType)) {\n return section;\n }\n const steps = [...(bySection.get(section.id) ?? [])].sort(\n (a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0) || String(a.code ?? '').localeCompare(String(b.code ?? '')),\n );\n const workStepTypeId =\n section.workStepTypeId ||\n (steps[0] ? resolveEntityRefId(steps[0].workStepTypeId) ?? undefined : undefined);\n const columns =\n (workStepTypeId && columnsByWorkStepTypeId?.get(workStepTypeId)) ||\n normalizeStepTableColumns(steps[0]?.columns) ||\n section.columns ||\n [];\n return {\n ...section,\n workStepTypeId,\n workStepType: section.workStepType ?? steps[0]?.workStepType,\n columns,\n items: steps.map((step) => toBuilderItemFromWorkStepRow(step, columns)),\n };\n }),\n };\n}\n\nexport function builderValueToSafetyPlanSectionPayloads(\n value: AXMSafetyPlanSectionBuilderValue,\n safetyPlanId: string,\n): Array<{\n id: string;\n safetyPlanId: string;\n title: string;\n description?: string;\n sectionTypeId: string;\n sectionType?: AXMSafetyPlanSectionBuilderSectionValue['sectionType'];\n sourceSafetyPlanTypeSectionId?: string;\n sortOrder: number;\n workStepTypeId?: string;\n workStepType?: AXMSafetyPlanSectionBuilderSectionValue['workStepType'];\n columns?: AXMStepTableColumnDef[];\n widgetOptions?: AXMSafetyPlanSectionBuilderSectionValue['widgetOptions'];\n items: AXMSafetyPlanSectionBuilderItemValue[];\n}> {\n return value.sections.map((section, index) => ({\n id: section.id,\n safetyPlanId,\n title: section.title,\n description: section.description?.trim() ? section.description.trim() : undefined,\n sectionTypeId: section.sectionTypeId,\n sectionType: section.sectionType,\n sourceSafetyPlanTypeSectionId: section.sourceSafetyPlanTypeSectionId,\n sortOrder: typeof section.sortOrder === 'number' ? section.sortOrder : index + 1,\n workStepTypeId: section.workStepTypeId,\n workStepType: section.workStepType,\n columns: section.columns,\n widgetOptions: section.widgetOptions,\n items: section.items.map((item) => ({\n ...item,\n itemIds: [...(item.itemIds ?? [])],\n items: item.items ? [...item.items] : [],\n stepTableRow: item.stepTableRow ? normalizeStepTableRowPayload(item.stepTableRow) : undefined,\n })),\n }));\n}\n\nfunction toBuilderItemFromWorkStepRow(\n step: AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel,\n columns: AXMStepTableColumnDef[],\n): AXMSafetyPlanSectionBuilderItemValue {\n const normalizedColumns = normalizeStepTableColumns(columns.length ? columns : step.columns);\n const cells =\n normalizeStepTableRows(\n [{ id: step.id, sortOrder: step.sortOrder ?? 1, cells: step.cells ?? [] }],\n normalizedColumns,\n )[0]?.cells ??\n step.cells ??\n [];\n const title = step.title?.trim() || summarizeStepTableRow(cells, normalizedColumns);\n return {\n id: step.id,\n itemIds: [step.id],\n items: [{ id: step.id, title, code: step.code }],\n stepTableRow: {\n cells,\n code: step.code,\n sortOrder: step.sortOrder,\n title,\n },\n };\n}\n\nexport function summarizeStepTableRow(\n cells: AXMStepTableCellValue[],\n columns: AXMStepTableColumnDef[],\n): string {\n for (const column of columns) {\n const key = column.sectionTypeId;\n const cell = cells.find((entry) => entry.columnKey === key);\n if (!cell) {\n continue;\n }\n const fromRefs = cell.refs?.[0]?.title || cell.refs?.[0]?.code;\n if (fromRefs) {\n return fromRefs;\n }\n if (cell.textValue?.trim()) {\n return cell.textValue.trim();\n }\n }\n return columns[0] ? stepTableColumnTitle(columns[0]) : 'Row';\n}\n\nfunction normalizeSection(\n section: Partial<AXMSafetyPlanSectionBuilderSectionValue>,\n index: number,\n): AXMSafetyPlanSectionBuilderSectionValue {\n const id = typeof section.id === 'string' && section.id ? section.id : AXPDataGenerator.uuid();\n const sectionTypeId = resolveEntityRefId(section.sectionTypeId) ?? '';\n const workStepTypeId = resolveEntityRefId(section.workStepTypeId) ?? undefined;\n return {\n id,\n sectionTypeId,\n sectionType: enrichSectionTypeSnapshot(sectionTypeId, section.sectionType),\n title: typeof section.title === 'string' ? section.title : '',\n description: typeof section.description === 'string' ? section.description : '',\n safetyPlanId: typeof section.safetyPlanId === 'string' ? section.safetyPlanId : undefined,\n code: typeof section.code === 'string' ? section.code : undefined,\n sourceSafetyPlanTypeSectionId:\n typeof section.sourceSafetyPlanTypeSectionId === 'string'\n ? section.sourceSafetyPlanTypeSectionId\n : undefined,\n sortOrder: typeof section.sortOrder === 'number' ? section.sortOrder : index + 1,\n required: section.required === true,\n workStepTypeId,\n workStepType: section.workStepType,\n columns: normalizeStepTableColumns(section.columns),\n widgetOptions: normalizeWidgetOptions(section.widgetOptions),\n items: Array.isArray(section.items)\n ? section.items.map((item) => normalizeItem(item, id, sectionTypeId, section.sectionType))\n : [],\n };\n}\n\nfunction normalizeWidgetOptions(\n value: AXMSafetyPlanSectionBuilderSectionValue['widgetOptions'] | unknown,\n): AXMSafetyPlanSectionBuilderSectionValue['widgetOptions'] | undefined {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n return undefined;\n }\n return { ...(value as NonNullable<AXMSafetyPlanSectionBuilderSectionValue['widgetOptions']>) };\n}\n\nfunction normalizeItem(\n item: Partial<AXMSafetyPlanSectionBuilderItemValue>,\n sectionId: string,\n sectionTypeId: string,\n sectionType: AXMSafetyPlanSectionBuilderSectionValue['sectionType'],\n): AXMSafetyPlanSectionBuilderItemValue {\n const isStepTable = isStepTableSectionType(sectionTypeId, sectionType);\n if (isStepTable && item.stepTableRow) {\n const stepTableRow = normalizeStepTableRowPayload(item.stepTableRow);\n const stepId =\n typeof item.id === 'string' && item.id && !item.id.includes('__item_') && !item.id.includes('__entity_')\n ? item.id\n : AXPDataGenerator.uuid();\n const title = stepTableRow.title?.trim() || 'Row';\n return {\n id: stepId,\n itemIds: [stepId],\n items: [{ id: stepId, title, code: stepTableRow.code }],\n stepTableRow,\n };\n }\n\n const id = typeof item.id === 'string' && item.id ? item.id : AXPDataGenerator.uuid();\n return {\n id: id.includes('__item_') || id.includes('__entity_') ? id : `${sectionId}__item_${id}`,\n itemIds: Array.isArray(item.itemIds) ? item.itemIds.filter((x): x is string => typeof x === 'string') : [],\n items: Array.isArray(item.items) ? item.items : [],\n };\n}\n\nfunction normalizeStepTableRowPayload(\n payload: AXMSafetyPlanStepTableRowBuilderPayload,\n): AXMSafetyPlanStepTableRowBuilderPayload {\n return {\n cells: Array.isArray(payload.cells) ? payload.cells : [],\n code: typeof payload.code === 'string' ? payload.code : undefined,\n sortOrder: typeof payload.sortOrder === 'number' ? payload.sortOrder : undefined,\n title: typeof payload.title === 'string' ? payload.title : undefined,\n };\n}\n\nexport type {\n AXMSafetyPlanSectionBuilderItemValue,\n AXMSafetyPlanSectionBuilderSectionValue,\n AXMSafetyPlanSectionBuilderValue,\n AXMSafetyPlanStepTableRowBuilderPayload,\n};\n","import {\n AXPEntityService,\n isAXPMiddlewareAbortError,\n mapEntityStorageErrorToCommandResult,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { extractRequestErrorInfo } from '@acorex-platform/framework-client/common';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { inject, Injectable } from '@angular/core';\nimport {\n AXMSafetyPlanSectionBuilderValue,\n RootConfig,\n collectBuiltInRepeatableSectionTypeIds,\n dedupeSafetyPlanSectionStructure,\n isStepTableSectionType,\n normalizeStepTableColumns,\n resolveEntityRefId,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport {\n builderValueToSafetyPlanSectionPayloads,\n safetyPlanSectionsToBuilderValue,\n summarizeStepTableRow,\n} from './safety-plan-section-builder.types';\n\nexport const SAFETY_PLAN_SECTIONS_SAVE_COMMAND = 'SafetyPlan:Sections:Save';\n\nexport interface SaveSafetyPlanSectionsInput {\n id: string;\n value: AXMSafetyPlanSectionBuilderValue;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXMSaveSafetyPlanSectionsCommand implements AXPCommand<SaveSafetyPlanSectionsInput, unknown> {\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: SaveSafetyPlanSectionsInput): AXPCommandExecuteResultPromise<unknown> {\n const safetyPlanId = input?.id;\n const rawValue = input?.value ?? { sections: [] };\n\n if (!safetyPlanId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const sectionEntityRef = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanSection.name}`;\n const sectionTypeEntityRef = `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`;\n const workStepEntityRef = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanWorkStep.name}`;\n const sectionData = this.entityService.withEntity(sectionEntityRef).data();\n const workStepData = this.entityService.withEntity(workStepEntityRef).data();\n\n try {\n const repeatableSectionTypeIds = await this.loadRepeatableSectionTypeIds(sectionTypeEntityRef);\n\n // Dedupe accidental ghost rows (same type-section source materialized twice).\n const value = dedupeSafetyPlanSectionStructure(rawValue, { repeatableSectionTypeIds });\n\n const existing = await this.queryPlanSections(sectionData, safetyPlanId);\n const existingRows = existing.items ?? [];\n const existingIds = new Set(existingRows.map((row) => String((row as { id?: string }).id ?? '')));\n const nextIds = new Set(value.sections.map((section) => section.id));\n\n for (const row of existingRows) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId && !nextIds.has(rowId)) {\n await this.deleteWorkStepsForSection(workStepData, rowId);\n await sectionData.delete(rowId);\n }\n }\n\n const payloads = builderValueToSafetyPlanSectionPayloads(value, safetyPlanId);\n for (const payload of payloads) {\n const isStepTable = isStepTableSectionType(payload.sectionTypeId, payload.sectionType);\n const columns = normalizeStepTableColumns(payload.columns);\n\n if (isStepTable) {\n await this.syncWorkStepsForSection(\n workStepData,\n safetyPlanId,\n payload.id,\n payload.workStepTypeId,\n payload.workStepType,\n columns,\n payload.items,\n );\n }\n\n const itemRows = isStepTable\n ? [\n {\n sectionTypeId: payload.sectionTypeId,\n sectionType: payload.sectionType,\n workStepTypeId: payload.workStepTypeId,\n workStepType: payload.workStepType,\n itemIds: payload.items\n .map((item) => item.id)\n .filter((id): id is string => typeof id === 'string' && id.length > 0),\n items: payload.items.map((item) => ({\n id: item.id,\n title:\n item.stepTableRow?.title ??\n summarizeStepTableRow(item.stepTableRow?.cells ?? [], columns) ??\n item.items?.[0]?.title,\n code: item.stepTableRow?.code ?? item.items?.[0]?.code,\n })),\n },\n ]\n : payload.items.length > 0\n ? payload.items.map(({ itemIds, items }) => ({\n sectionTypeId: payload.sectionTypeId,\n sectionType: payload.sectionType,\n itemIds,\n items,\n }))\n : [\n {\n sectionTypeId: payload.sectionTypeId,\n sectionType: payload.sectionType,\n itemIds: [] as string[],\n items: [] as { id: string; title?: string; code?: string }[],\n },\n ];\n\n const entityPayload = {\n safetyPlanId: payload.safetyPlanId,\n title: payload.title,\n description: payload.description,\n sourceSafetyPlanTypeSectionId: payload.sourceSafetyPlanTypeSectionId,\n sortOrder: payload.sortOrder,\n items: itemRows,\n ...(payload.widgetOptions !== undefined ? { widgetOptions: payload.widgetOptions } : {}),\n };\n\n if (existingIds.has(payload.id)) {\n await sectionData.update(payload.id, entityPayload as never);\n } else {\n await sectionData.create({ ...entityPayload, id: payload.id } as never);\n }\n }\n\n const refreshed = await this.queryPlanSections(sectionData, safetyPlanId);\n const deduped = dedupeSafetyPlanSectionStructure(\n safetyPlanSectionsToBuilderValue(\n (refreshed.items ?? []) as Parameters<typeof safetyPlanSectionsToBuilderValue>[0],\n ),\n { repeatableSectionTypeIds },\n );\n const keepIds = new Set(deduped.sections.map((section) => section.id));\n\n for (const row of refreshed.items ?? []) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId && !keepIds.has(rowId)) {\n await this.deleteWorkStepsForSection(workStepData, rowId);\n await sectionData.delete(rowId);\n }\n }\n\n const cleaned =\n keepIds.size === (refreshed.items ?? []).length\n ? refreshed\n : await this.queryPlanSections(sectionData, safetyPlanId);\n\n const sections = (cleaned.items ?? []).filter((row) =>\n keepIds.has(String((row as { id?: string }).id ?? '')),\n );\n\n return {\n success: true,\n kind: 'object',\n data: { id: safetyPlanId, value, sections },\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n };\n } catch (error) {\n if (isAXPMiddlewareAbortError(error)) {\n return mapEntityStorageErrorToCommandResult(error);\n }\n\n const httpInfo = extractRequestErrorInfo(error);\n const text =\n (typeof httpInfo?.message === 'string' && httpInfo.message.startsWith('@')\n ? httpInfo.message\n : null) ??\n (error instanceof Error && error.message.startsWith('@') ? error.message : null) ??\n (await this.translationService.translateAsync('@general:messages.generic.error.description'));\n\n return {\n success: false,\n message: { type: 'error', text },\n };\n }\n }\n\n private async syncWorkStepsForSection(\n workStepData: ReturnType<ReturnType<AXPEntityService['withEntity']>['data']>,\n safetyPlanId: string,\n sectionId: string,\n workStepTypeId: string | undefined,\n workStepType: { id: string; title?: string; code?: string } | undefined,\n columns: ReturnType<typeof normalizeStepTableColumns>,\n items: ReturnType<typeof builderValueToSafetyPlanSectionPayloads>[number]['items'],\n ): Promise<void> {\n const existing = await workStepData.query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanSectionId', operator: { type: 'equal' }, value: sectionId }],\n },\n } as never);\n\n const existingRows = existing.items ?? [];\n const existingIds = new Set(existingRows.map((row) => String((row as { id?: string }).id ?? '')));\n const nextIds = new Set(\n items.map((item) => item.id).filter((id): id is string => typeof id === 'string' && id.length > 0),\n );\n\n for (const row of existingRows) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId && !nextIds.has(rowId)) {\n await workStepData.delete(rowId);\n }\n }\n\n if (!workStepTypeId) {\n return;\n }\n\n for (const [index, item] of items.entries()) {\n const stepTableRow = item.stepTableRow;\n if (!stepTableRow || !item.id) {\n continue;\n }\n const title =\n stepTableRow.title?.trim() ||\n summarizeStepTableRow(stepTableRow.cells ?? [], columns) ||\n item.items?.[0]?.title;\n const entityPayload = {\n safetyPlanId,\n safetyPlanSectionId: sectionId,\n workStepTypeId,\n workStepType: workStepType ?? { id: workStepTypeId },\n title,\n columns,\n cells: stepTableRow.cells ?? [],\n sortOrder: stepTableRow.sortOrder ?? index + 1,\n };\n\n if (existingIds.has(item.id)) {\n await workStepData.update(item.id, entityPayload as never);\n } else {\n await workStepData.create({ ...entityPayload, id: item.id } as never);\n }\n }\n }\n\n private async deleteWorkStepsForSection(\n workStepData: ReturnType<ReturnType<AXPEntityService['withEntity']>['data']>,\n sectionId: string,\n ): Promise<void> {\n const existing = await workStepData.query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanSectionId', operator: { type: 'equal' }, value: sectionId }],\n },\n } as never);\n for (const row of existing.items ?? []) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId) {\n await workStepData.delete(rowId);\n }\n }\n }\n\n private async loadRepeatableSectionTypeIds(sectionTypeEntityRef: string): Promise<string[]> {\n const builtIn = collectBuiltInRepeatableSectionTypeIds();\n try {\n // Prefer client-side filtering — boolean equality filters can miss stored values.\n const result = await this.entityService.withEntity(sectionTypeEntityRef).data().query({\n skip: 0,\n take: 1000,\n } as never);\n const fromQuery = (result.items ?? [])\n .filter((row) => (row as { isRepeatable?: unknown }).isRepeatable === true)\n .map((row) => resolveEntityRefId((row as { id?: unknown }).id))\n .filter((id): id is string => !!id);\n return [...new Set([...fromQuery, ...builtIn])];\n } catch {\n return builtIn;\n }\n }\n\n private queryPlanSections(\n sectionData: ReturnType<ReturnType<AXPEntityService['withEntity']>['data']>,\n safetyPlanId: string,\n ) {\n return sectionData.query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanId', operator: { type: 'equal' }, value: safetyPlanId }],\n },\n } as never);\n }\n}\n"],"names":[],"mappings":";;;;;;;;SAkBgB,0CAA0C,GAAA;AACxD,IAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;AACzB;AAEM,SAAU,sCAAsC,CACpD,KAA0D,EAAA;AAE1D,IAAA,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;QAC5C,OAAO,0CAA0C,EAAE;IACrD;IAEA,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACnF;AAC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