ngx-t-forms 3.1.8 → 3.1.9

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 (137) hide show
  1. package/fesm2022/{ngx-t-forms-api-endpoint-config.component-B4a-L4Eq.mjs → ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs} +10 -10
  2. package/fesm2022/ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs.map +1 -0
  3. package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs → ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs} +8 -8
  4. package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs.map → ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs.map} +1 -1
  5. package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs +189 -0
  6. package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs.map +1 -0
  7. package/fesm2022/{ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs → ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs} +6 -6
  8. package/fesm2022/{ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs.map → ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs.map} +1 -1
  9. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs → ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs} +7 -7
  10. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs.map → ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs.map} +1 -1
  11. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs → ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs} +2 -2
  12. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs.map → ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs.map} +1 -1
  13. package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs +99 -0
  14. package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs.map +1 -0
  15. package/fesm2022/{ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs} +2 -2
  16. package/fesm2022/{ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs.map → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs.map} +1 -1
  17. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DKb3E9gA.mjs} +4 -4
  18. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DKb3E9gA.mjs.map} +1 -1
  19. package/fesm2022/{ngx-t-forms-data-source-picker.component-DioXvLi3.mjs → ngx-t-forms-data-source-picker.component-BG_sr5VH.mjs} +8 -8
  20. package/fesm2022/{ngx-t-forms-data-source-picker.component-DioXvLi3.mjs.map → ngx-t-forms-data-source-picker.component-BG_sr5VH.mjs.map} +1 -1
  21. package/fesm2022/{ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs → ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs} +8 -8
  22. package/fesm2022/{ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs.map → ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs.map} +1 -1
  23. package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs → ngx-t-forms-date-range-picker-input-element.component-YVE_s-7Y.mjs} +5 -5
  24. package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs.map → ngx-t-forms-date-range-picker-input-element.component-YVE_s-7Y.mjs.map} +1 -1
  25. package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs → ngx-t-forms-date-time-picker-input-element.component-BlOS8NdF.mjs} +8 -8
  26. package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs.map → ngx-t-forms-date-time-picker-input-element.component-BlOS8NdF.mjs.map} +1 -1
  27. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs +623 -0
  28. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs.map +1 -0
  29. package/fesm2022/{ngx-t-forms-document-picker.component-DYpsBHxT.mjs → ngx-t-forms-document-picker.component-DOYyRgh4.mjs} +41 -11
  30. package/fesm2022/{ngx-t-forms-document-picker.component-DYpsBHxT.mjs.map → ngx-t-forms-document-picker.component-DOYyRgh4.mjs.map} +1 -1
  31. package/fesm2022/{ngx-t-forms-editor-input-element.component-CzNSb79n.mjs → ngx-t-forms-editor-input-element.component-BvZPNjQX.mjs} +5 -5
  32. package/fesm2022/{ngx-t-forms-editor-input-element.component-CzNSb79n.mjs.map → ngx-t-forms-editor-input-element.component-BvZPNjQX.mjs.map} +1 -1
  33. package/fesm2022/{ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs → ngx-t-forms-file-upload-input-element.component-CONELqoi.mjs} +8 -8
  34. package/fesm2022/{ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs.map → ngx-t-forms-file-upload-input-element.component-CONELqoi.mjs.map} +1 -1
  35. package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs +248 -0
  36. package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs.map +1 -0
  37. package/fesm2022/{ngx-t-forms-form-input-selector.component-B3ES53R-.mjs → ngx-t-forms-form-input-selector.component-Bdkuzw0R.mjs} +2 -2
  38. package/fesm2022/{ngx-t-forms-form-input-selector.component-B3ES53R-.mjs.map → ngx-t-forms-form-input-selector.component-Bdkuzw0R.mjs.map} +1 -1
  39. package/fesm2022/{ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs → ngx-t-forms-form-json-view.component-CDcbgWgN.mjs} +2 -2
  40. package/fesm2022/{ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs.map → ngx-t-forms-form-json-view.component-CDcbgWgN.mjs.map} +1 -1
  41. package/fesm2022/{ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs} +7 -7
  42. package/fesm2022/{ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs.map → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs.map} +1 -1
  43. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs → ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs} +185 -15
  44. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs.map +1 -0
  45. package/fesm2022/{ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs → ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs} +2 -2
  46. package/fesm2022/{ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs.map → ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs.map} +1 -1
  47. package/fesm2022/{ngx-t-forms-geo-location.component-DgXSaH0t.mjs → ngx-t-forms-geo-location.component-DA3ATrvw.mjs} +7 -7
  48. package/fesm2022/{ngx-t-forms-geo-location.component-DgXSaH0t.mjs.map → ngx-t-forms-geo-location.component-DA3ATrvw.mjs.map} +1 -1
  49. package/fesm2022/{ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs → ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs} +13 -5
  50. package/fesm2022/ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs.map +1 -0
  51. package/fesm2022/{ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs → ngx-t-forms-image-capture-input-element.component-C9oz_ZjA.mjs} +7 -7
  52. package/fesm2022/{ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs.map → ngx-t-forms-image-capture-input-element.component-C9oz_ZjA.mjs.map} +1 -1
  53. package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs +2 -0
  54. package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs.map +1 -0
  55. package/fesm2022/{ngx-t-forms-input-custom.component-BOy_3JqU.mjs → ngx-t-forms-input-custom.component-CqIr5wpy.mjs} +91 -25
  56. package/fesm2022/ngx-t-forms-input-custom.component-CqIr5wpy.mjs.map +1 -0
  57. package/fesm2022/{ngx-t-forms-input-editor.component-IUrZNmA5.mjs → ngx-t-forms-input-editor.component-DU2sgo4i.mjs} +9 -9
  58. package/fesm2022/{ngx-t-forms-input-editor.component-IUrZNmA5.mjs.map → ngx-t-forms-input-editor.component-DU2sgo4i.mjs.map} +1 -1
  59. package/fesm2022/{ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs → ngx-t-forms-map-mat-options-keys-WfFq_0tS.mjs} +2 -2
  60. package/fesm2022/{ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs.map → ngx-t-forms-map-mat-options-keys-WfFq_0tS.mjs.map} +1 -1
  61. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs → ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs} +2 -2
  62. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs.map → ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs.map} +1 -1
  63. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs} +4 -4
  64. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs.map → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs.map} +1 -1
  65. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs +37 -0
  66. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs.map +1 -0
  67. package/fesm2022/{ngx-t-forms-mscoa-config.component-soUwIbVA.mjs → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs} +10 -10
  68. package/fesm2022/{ngx-t-forms-mscoa-config.component-soUwIbVA.mjs.map → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs.map} +1 -1
  69. package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs} +4 -4
  70. package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs.map → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs.map} +1 -1
  71. package/fesm2022/{ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs} +9 -9
  72. package/fesm2022/{ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs.map → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs.map} +1 -1
  73. package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs → ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs} +3 -3
  74. package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs.map → ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs.map} +1 -1
  75. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs +3592 -0
  76. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs.map +1 -0
  77. package/fesm2022/{ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs → ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs} +9303 -2202
  78. package/fesm2022/ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs.map +1 -0
  79. package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs +596 -0
  80. package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs.map +1 -0
  81. package/fesm2022/{ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs → ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs} +13 -5
  82. package/fesm2022/ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs.map +1 -0
  83. package/fesm2022/{ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs} +15 -15
  84. package/fesm2022/{ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs.map → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs.map} +1 -1
  85. package/fesm2022/{ngx-t-forms-quill-input.component-oUnmMDGi.mjs → ngx-t-forms-quill-input.component-x9CHGOJy.mjs} +2 -2
  86. package/fesm2022/{ngx-t-forms-quill-input.component-oUnmMDGi.mjs.map → ngx-t-forms-quill-input.component-x9CHGOJy.mjs.map} +1 -1
  87. package/fesm2022/{ngx-t-forms-record-list-manager.component-CdQU6loA.mjs → ngx-t-forms-record-list-manager.component-BGg86NER.mjs} +7 -7
  88. package/fesm2022/{ngx-t-forms-record-list-manager.component-CdQU6loA.mjs.map → ngx-t-forms-record-list-manager.component-BGg86NER.mjs.map} +1 -1
  89. package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs +281 -0
  90. package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs.map +1 -0
  91. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs → ngx-t-forms-rest-api-call-setup.component-B4LzPwxg.mjs} +5 -5
  92. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs.map → ngx-t-forms-rest-api-call-setup.component-B4LzPwxg.mjs.map} +1 -1
  93. package/fesm2022/{ngx-t-forms-section-report.component-CocLNrN5.mjs → ngx-t-forms-section-report.component-BS2CV_xl.mjs} +4 -4
  94. package/fesm2022/{ngx-t-forms-section-report.component-CocLNrN5.mjs.map → ngx-t-forms-section-report.component-BS2CV_xl.mjs.map} +1 -1
  95. package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs +281 -0
  96. package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs.map +1 -0
  97. package/fesm2022/{ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs} +6 -6
  98. package/fesm2022/{ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs.map → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs.map} +1 -1
  99. package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs} +3 -3
  100. package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs.map → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs.map} +1 -1
  101. package/fesm2022/{ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs → ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs} +77 -11
  102. package/fesm2022/ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs.map +1 -0
  103. package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs +124 -0
  104. package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs.map +1 -0
  105. package/fesm2022/{ngx-t-forms-token-text-input.component-BMzPBtY_.mjs → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs} +4 -4
  106. package/fesm2022/{ngx-t-forms-token-text-input.component-BMzPBtY_.mjs.map → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs.map} +1 -1
  107. package/fesm2022/{ngx-t-forms-validators-config.component-DWDBsV6a.mjs → ngx-t-forms-validators-config.component-DEm9M5s9.mjs} +5 -5
  108. package/fesm2022/{ngx-t-forms-validators-config.component-DWDBsV6a.mjs.map → ngx-t-forms-validators-config.component-DEm9M5s9.mjs.map} +1 -1
  109. package/fesm2022/{ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs → ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs} +28 -26
  110. package/fesm2022/ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs.map +1 -0
  111. package/fesm2022/ngx-t-forms.mjs +1 -1
  112. package/package.json +2 -2
  113. package/types/ngx-t-forms.d.ts +2370 -38
  114. package/fesm2022/ngx-t-forms-api-endpoint-config.component-B4a-L4Eq.mjs.map +0 -1
  115. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs +0 -373
  116. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs.map +0 -1
  117. package/fesm2022/ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs.map +0 -1
  118. package/fesm2022/ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs.map +0 -1
  119. package/fesm2022/ngx-t-forms-index-zLon09cE.mjs +0 -2
  120. package/fesm2022/ngx-t-forms-index-zLon09cE.mjs.map +0 -1
  121. package/fesm2022/ngx-t-forms-input-custom.component-BOy_3JqU.mjs.map +0 -1
  122. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs +0 -38
  123. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs.map +0 -1
  124. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs +0 -2472
  125. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs.map +0 -1
  126. package/fesm2022/ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs.map +0 -1
  127. package/fesm2022/ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs +0 -557
  128. package/fesm2022/ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs.map +0 -1
  129. package/fesm2022/ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs.map +0 -1
  130. package/fesm2022/ngx-t-forms-required-inputs.component-BtfEsmva.mjs +0 -271
  131. package/fesm2022/ngx-t-forms-required-inputs.component-BtfEsmva.mjs.map +0 -1
  132. package/fesm2022/ngx-t-forms-select-input-element.component-B03O4cAK.mjs +0 -160
  133. package/fesm2022/ngx-t-forms-select-input-element.component-B03O4cAK.mjs.map +0 -1
  134. package/fesm2022/ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs.map +0 -1
  135. package/fesm2022/ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs +0 -93
  136. package/fesm2022/ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs.map +0 -1
  137. package/fesm2022/ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs","sources":["../../../projects/ngx-t-forms/src/lib/services/core/t-input-controller/functions/colorCoding.ts","../../../projects/ngx-t-forms/src/lib/services/core/t-input-controller/functions/configureCols.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/functions/openedAgo.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-view/multiple-input-table-view.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-view/multiple-input-table-view.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-edit/multiple-input-table-edit.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-edit/multiple-input-table-edit.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/functions/getListCalculated.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/spreadsheet-template/spreadsheet-template.service.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-import-dialog/import-review.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-import-dialog/import-setup.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-import-dialog/multiple-input-import-dialog.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-import-dialog/multiple-input-import-dialog.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/functions/spreadsheetImport.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table/multiple-input-table.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table/multiple-input-table.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/multiple-input-input-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/multiple-input-input-element.component.html"],"sourcesContent":["export class ColorScale {\r\n private min: number;\r\n private max: number;\r\n private alpha: number;\r\n private colorStops: Color[];\r\n\r\n constructor(\r\n min: number,\r\n max: number,\r\n colorStops: string[],\r\n alpha: number = 1\r\n ) {\r\n validateMinMaxValues(min, max);\r\n validateColorStops(colorStops);\r\n validateAlphaValue(alpha);\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.alpha = alpha;\r\n this.colorStops = colorStops.map((colorStop) =>\r\n hexToColor(colorStop, alpha)\r\n );\r\n }\r\n\r\n getColor(value: number) {\r\n const numOfColorStops = this.colorStops.length;\r\n if (value < this.min) return this.colorStops[0];\r\n if (value > this.max) return this.colorStops[numOfColorStops - 1];\r\n\r\n const range = this.max - this.min;\r\n\r\n let weight = (value - this.min) / range;\r\n const colorStopIndex = Math.max(\r\n Math.ceil(weight * (numOfColorStops - 1)),\r\n 1\r\n );\r\n\r\n const minColor = this.colorStops[colorStopIndex - 1];\r\n const maxColor = this.colorStops[colorStopIndex];\r\n if(maxColor === undefined) return minColor;\r\n if(minColor === undefined) return maxColor;\r\n\r\n weight = weight * (numOfColorStops - 1) - (colorStopIndex - 1);\r\n\r\n const r = Math.floor(weight * maxColor.r + (1 - weight) * minColor.r);\r\n const g = Math.floor(weight * maxColor.g + (1 - weight) * minColor.g);\r\n const b = Math.floor(weight * maxColor.b + (1 - weight) * minColor.b);\r\n\r\n return new Color(r, g, b, this.alpha);\r\n }\r\n}\r\n\r\nexport function validateMinMaxValues(min: number, max: number) {\r\n if (min > max) {\r\n throw new Error('The minimum value must be less than the maximum value.');\r\n }\r\n}\r\n\r\nexport function validateColorStops(colorStops: string[]) {\r\n if (colorStops.length < 2) {\r\n throw new Error('At least two colors must be provided.');\r\n }\r\n\r\n colorStops.forEach((str) => {\r\n if (!isValidHexColor(str)) {\r\n throw new Error(`${str} is not a valid hex color.`);\r\n }\r\n });\r\n}\r\n\r\nexport function validateAlphaValue(alpha: number) {\r\n if (alpha < 0 || alpha > 1) {\r\n throw new Error('The alpha value must be between 0 and 1.');\r\n }\r\n}\r\n\r\nexport function hexToColor(hex: string, alpha: number) {\r\n if (isValid3DigitHexColor(hex)) {\r\n hex = convertTo6DigitHexColor(hex);\r\n }\r\n\r\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n if (!!result?.[1] && !!result?.[2] && !!result?.[3]) {\r\n return new Color(\r\n parseInt(result[1], 16),\r\n parseInt(result[2], 16),\r\n parseInt(result[3], 16),\r\n alpha\r\n );\r\n } else {\r\n throw new Error(`${hex} is not a valid hex color.`);\r\n }\r\n}\r\n\r\nexport function isValidHexColor(colorString: string) {\r\n return (\r\n isValid3DigitHexColor(colorString) || isValid6DigitHexColor(colorString)\r\n );\r\n}\r\n\r\nfunction isValid3DigitHexColor(colorString: string) {\r\n const hexColorRegex = /^#(?:[0-9a-fA-F]{3})$/;\r\n return colorString.match(hexColorRegex);\r\n}\r\n\r\nfunction isValid6DigitHexColor(colorString: string) {\r\n const hexColorRegex = /^#(?:[0-9a-fA-F]{6})$/;\r\n return colorString.match(hexColorRegex);\r\n}\r\n\r\nfunction convertTo6DigitHexColor(threeDigitHex: string) {\r\n return threeDigitHex\r\n .substring(1)\r\n .split('')\r\n .map((char) => {\r\n return char + char;\r\n })\r\n .join('');\r\n}\r\n\r\nfunction componentToHex(c: number) {\r\n const hex = c.toString(16);\r\n return hex.length === 1 ? '0' + hex : hex;\r\n}\r\n\r\nexport function rgbaToHex(color: Color) {\r\n const r = Math.floor(color.r * color.a);\r\n const g = Math.floor(color.g * color.a);\r\n const b = Math.floor(color.b * color.a);\r\n return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;\r\n}\r\n\r\nexport class Color {\r\n public r: number;\r\n public g: number;\r\n public b: number;\r\n public a: number;\r\n\r\n constructor(r: number, g: number, b: number, a: number = 1) {\r\n validateAlphaValue(a);\r\n\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n }\r\n\r\n toRGBString() {\r\n return `rgb(${Math.floor(this.r * this.a)},${Math.floor(\r\n this.g * this.a\r\n )},${Math.floor(this.b * this.a)})`;\r\n }\r\n\r\n toRGBAString() {\r\n return `rgba(${this.r},${this.g},${this.b},${this.a})`;\r\n }\r\n\r\n toHexString() {\r\n return rgbaToHex(this);\r\n }\r\n}\r\n","\r\n\r\n\r\nimport { DocumentLitsLabelConfigInterfaceValueType, FormColumnInputs, InputDataTypes, InputPipeTypes } from \"ngx-t-forms-types\";\r\n\r\n/** Column metadata used by the multi-row table view. */\r\nexport interface ColumnConfigEntry {\r\n property: string;\r\n formControlName?: string;\r\n label?: string;\r\n dataType?: DocumentLitsLabelConfigInterfaceValueType | InputPipeTypes | InputDataTypes | string;\r\n type?: string;\r\n /** The sub-column's number pipe, so the cell formatter rounds and formats at the stored precision. */\r\n pipe?: FormColumnInputs['pipe'];\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport function configureCols(inputConfig:FormColumnInputs,tempLabels:string[]):{displayedColumnsInOrder:string[],columnsConfig:Record<string, any>}\r\n{\r\n try {\r\n\r\n const labelInputs = ((inputConfig?.formInputs || []) as FormColumnInputs[]).filter(input=>input.showAsLabel || tempLabels.includes(input.formControlName) )\r\n const cols = [];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const colConfigs: Record<string, any> = {};\r\n for (\r\n let index = 0;\r\n index < ( labelInputs).length;\r\n index++\r\n ) {\r\n const c = labelInputs [index]\r\n const col = {...c} as FormColumnInputs;\r\n cols.push(`${inputConfig.id}.${col.id}`);\r\n if(!col.id){\r\n continue\r\n }\r\n colConfigs[`${inputConfig.id}.${col.id}`]={\r\n property :`${inputConfig.id}.${col.id}`,\r\n formControlName: col.formControlName,\r\n label: col.label,\r\n dataType: getDataType(col),\r\n pipe: col.pipe\r\n }\r\n\r\n }\r\n \r\n //add remove section config\r\n cols.push('itemRemovalButton');\r\n colConfigs['itemRemovalButton'] = {\r\n property: 'itemRemovalButton',\r\n label: '',\r\n type: 'removal',\r\n };\r\n // end\r\n return {\r\n displayedColumnsInOrder : cols.filter((c) => !!c ) as string[],\r\n columnsConfig : colConfigs}\r\n } catch (error) {\r\n const message = error instanceof Error ? error.message : 'Failed to configure columns';\r\n throw new Error(message)\r\n \r\n }\r\n \r\n}\r\n\r\nfunction getDataType(input:FormColumnInputs):DocumentLitsLabelConfigInterfaceValueType|InputPipeTypes | InputDataTypes{\r\n try {\r\n if(input.pipe?.pipeType){\r\n return input.pipe.pipeType\r\n }\r\n const inputDataType = input.dataType;\r\n switch (inputDataType) {\r\n\r\n\r\n case InputDataTypes.Number:\r\n\r\n return DocumentLitsLabelConfigInterfaceValueType.number\r\n\r\n case InputDataTypes.Date:\r\n \r\n return DocumentLitsLabelConfigInterfaceValueType.date\r\n case InputDataTypes.Array:\r\n return InputDataTypes.Array\r\n case InputDataTypes.Boolean:\r\n return InputDataTypes.Boolean\r\n case InputDataTypes.Object:\r\n return InputDataTypes.Object\r\n\r\n\r\n \r\n \r\n\r\n default:\r\n return DocumentLitsLabelConfigInterfaceValueType.string\r\n \r\n }\r\n \r\n } catch (error) {\r\n const msg = error instanceof Error ? error.message : 'Failed to get data type'\r\n throw new Error(msg)\r\n }\r\n}","/**\n * Relative-age labels for the table's \"opened\" column.\n *\n * A long list is edited row by row, and the single question the author keeps asking is *have I\n * already been in this one?* The column answers it in the smallest amount of ink that can:\n * a two-or-three character token in the row, and the full sentence in its tooltip.\n *\n * Pure and Angular-free so the thresholds can be tested directly — the component only supplies\n * the elapsed milliseconds.\n */\n\n/** A row's age since it was last opened, in the two lengths the table renders. */\nexport interface OpenedAgo {\n /** Column token — at most three characters, e.g. `now`, `7m`, `3h`, `2d`. */\n readonly short: string;\n /** Tooltip sentence, e.g. `Opened 7 minutes ago`. */\n readonly long: string;\n}\n\nconst SECOND = 1000;\nconst MINUTE = 60 * SECOND;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\nconst YEAR = 365 * DAY;\n\n/**\n * Anything fresher than this reads as \"now\". A whole minute exactly, so the minutes branch below\n * can never produce a bare `0m` — the first token after \"now\" is always `1m`.\n */\nconst JUST_NOW = MINUTE;\n\n/** `1 minute` / `4 minutes` — the tooltip is a sentence, so it agrees in number. */\nfunction plural(count: number, unit: string): string {\n return `${count} ${unit}${count === 1 ? '' : 's'} ago`;\n}\n\n/**\n * Formats how long ago a row was opened.\n *\n * @param elapsedMs milliseconds since the row was last opened. A negative value (a clock that\n * moved backwards) is treated as zero rather than rendering a future age.\n *\n * @example\n * openedAgo(0); // { short: 'now', long: 'Opened just now' }\n * openedAgo(7 * 60_000); // { short: '7m', long: 'Opened 7 minutes ago' }\n */\nexport function openedAgo(elapsedMs: number): OpenedAgo {\n const elapsed = Number.isFinite(elapsedMs) ? Math.max(elapsedMs, 0) : 0;\n\n if (elapsed < JUST_NOW) {\n return { short: 'now', long: 'Opened just now' };\n }\n if (elapsed < HOUR) {\n const minutes = Math.floor(elapsed / MINUTE);\n return { short: `${minutes}m`, long: `Opened ${plural(minutes, 'minute')}` };\n }\n if (elapsed < DAY) {\n const hours = Math.floor(elapsed / HOUR);\n return { short: `${hours}h`, long: `Opened ${plural(hours, 'hour')}` };\n }\n if (elapsed < WEEK) {\n const days = Math.floor(elapsed / DAY);\n return { short: `${days}d`, long: `Opened ${plural(days, 'day')}` };\n }\n if (elapsed < YEAR) {\n const weeks = Math.floor(elapsed / WEEK);\n return { short: `${weeks}w`, long: `Opened ${plural(weeks, 'week')}` };\n }\n const years = Math.floor(elapsed / YEAR);\n return { short: `${years}y`, long: `Opened ${plural(years, 'year')}` };\n}\n","import { CdkConnectedOverlay } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n OnDestroy,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormGroup } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatPaginator, MatPaginatorModule, PageEvent } from '@angular/material/paginator';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatTableDataSource, MatTableModule } from '@angular/material/table';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport {\n CalculationFunctions,\n DocumentLitsLabelConfigInterfaceValueType,\n FormColumnInputs,\n IMultiple,\n InputDataTypes,\n InputPipeTypes,\n ITowerStepColumn,\n MultipleInputAvailableOperations,\n} from 'ngx-t-forms-types';\n\nimport { ColorScale } from '../../../../../../services/core/t-input-controller/functions/colorCoding';\nimport { configureCols } from '../../../../../../services/core/t-input-controller/functions/configureCols';\nimport { FieldDisplayValuePipe } from '../../../../../../shared/pipes/field-display-value.pipe';\nimport { FormatDataPipe } from '../../../../../../shared/pipes/format-Data.pipe';\nimport type { FieldDisplaySource } from '../../../../../../shared/functions/formatFieldDisplayValue';\nimport { injectFormsLocalization } from '../../../../../../services/core/t-form-localization/inject-forms-localization';\nimport { TDynamicDataViewComponent } from '../../../../../t-dynamic-data-view/t-dynamic-data-view.component';\nimport { openedAgo } from '../../functions/openedAgo';\nimport { ClampProbeDirective } from './clamp-probe.directive';\n\n/**\n * Row of a multiple-input data source. Each row is a heterogeneous record indexed by composite\n * column keys (`${parentId}.${inputId}`) plus the calculation-function system key. Cell values\n * are dynamic — narrowed at usage sites.\n */\ntype MultipleInputRow = Record<string, unknown> & { id?: string };\n\n/** The display type a column declares (`configureCols`), used for alignment and structure. */\ntype CellDataType = DocumentLitsLabelConfigInterfaceValueType | InputDataTypes | InputPipeTypes | undefined;\n\n/** Column config emitted by `configureCols`. */\ninterface ColumnConfig {\n property?: string;\n formControlName?: string;\n label?: string;\n dataType?: CellDataType;\n type?: string;\n key?: string;\n colorScale?: string;\n pipe?: FormColumnInputs['pipe'];\n}\n\n/** Column key `configureCols` appends for the row-actions cell. */\nconst ACTIONS_COLUMN = 'itemRemovalButton';\n\n/**\n * Column key for the leading row-number column. Data columns are always `${parentId}.${inputId}`,\n * so a key with no dot in it can never collide with one.\n */\nconst INDEX_COLUMN = 'mitRowNumber';\n\n/** Column key for the trailing \"last opened\" column. Same collision argument as {@link INDEX_COLUMN}. */\nconst OPENED_COLUMN = 'mitLastOpened';\n\n/**\n * How often the relative \"opened\" labels are re-rendered. Half a minute keeps `now` -> `1m` honest\n * without the table repainting for no reason; the interval only runs once a row has been opened.\n */\nconst OPENED_TICK_MS = 30_000;\n\n/** Row key marking a calculation (total / average / …) row appended by `getCaluculatedTableData`. */\nconst CALCULATION_KEY = 'SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION';\n\n/** Row key a host may set to flag the row currently open in the editor. */\nconst IN_EDIT_KEY = 'SYSTEM_KEY_IN_EDIT';\n\n/** Page sizes offered by the paginator. */\nconst PAGE_SIZE_OPTIONS = [5, 10, 25, 50] as const;\n\n/** Rows per page before the user picks otherwise. */\nconst DEFAULT_PAGE_SIZE = 10;\n\n/**\n * The paginator is only worth its space once the rows outgrow the smallest page. Below this the\n * table shows everything and the toolbar count is the whole story.\n */\nconst PAGINATION_THRESHOLD: number = PAGE_SIZE_OPTIONS[0];\n\n/** Pipe types whose cells are amounts: right-aligned, tabular figures. */\nconst NUMERIC_PIPE_TYPES: ReadonlySet<string> = new Set<string>([\n InputPipeTypes.Currency,\n InputPipeTypes.Decimal,\n InputPipeTypes.Integer,\n InputPipeTypes.Number,\n InputPipeTypes.Percent,\n]);\n\n/**\n * A read-only text column whose longest stored value runs past this many\n * characters is a descriptive column: it gets the wide floor (14rem, about two\n * 28-character lines at 14px) while every other text column keeps the narrow\n * one (8rem), so a five- or six-column line-items table still fits the System\n * Doc column without scrolling sideways.\n */\nconst WIDE_COLUMN_FROM = 40;\n\n/** The rows a wide-column verdict was computed from, and the verdict. */\ninterface WideColumnsMemo {\n readonly data: readonly MultipleInputRow[];\n readonly length: number;\n readonly columns: readonly string[];\n readonly wide: ReadonlySet<string>;\n}\n\n/** Two-step delete: the row is removed this long after arming unless the user cancels. */\nconst DELETE_COUNTDOWN_MS = 3000;\n\n/**\n * Read-only table of a multiple-input field's rows, with per-row actions.\n *\n * Columns come from the field's `showAsLabel` inner inputs plus any the user toggles on from the\n * toolbar's column chooser. Rows page client-side through the shared `MatTableDataSource`, the\n * actions column stays pinned to the right edge when the table overflows, and the whole table can\n * be opened full screen. Full screen is a full-viewport Material dialog rather than the Fullscreen\n * API: this table's menus, tooltips and the paginator's page-size select all live in the CDK\n * overlay container, which native full screen (and top-layer popovers) would paint over.\n *\n * Two columns are the view's own rather than the field's: a leading row number, pinned to the\n * start so a row keeps its identity while a wide table scrolls, and a trailing \"opened\" age that\n * appears once the author has opened their first row — in a seventy-row list, knowing which rows\n * you have already been into is most of the navigation problem.\n *\n * Editing, duplicating and deleting are delegated to the parent through outputs — this component\n * owns no row state beyond which rows the author has opened in this session.\n *\n * @example\n * <lib-multiple-input-table-view\n * [inputConfig]=\"inputConfig()\"\n * [dataSource]=\"dataSource\"\n * (onEditItem)=\"editRow($event)\"\n * (onDeleteItem)=\"removeRow($event)\"\n * />\n */\n@Component({\n selector: 'lib-multiple-input-table-view',\n templateUrl: './multiple-input-table-view.component.html',\n styleUrl: './multiple-input-table-view.component.css',\n imports: [\n CdkConnectedOverlay,\n NgTemplateOutlet,\n MatButtonModule,\n MatChipsModule,\n MatIconModule,\n MatMenuModule,\n MatPaginatorModule,\n MatProgressBarModule,\n MatProgressSpinnerModule,\n MatTableModule,\n MatTooltipModule,\n FieldDisplayValuePipe,\n FormatDataPipe,\n ClampProbeDirective,\n TDynamicDataViewComponent,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n 'class': 'lib-multiple-input-table-view',\n '[class.lib-multiple-input-table-view--fullscreen]': 'fullscreen()',\n '[class.lib-multiple-input-table-view--readonly]': 'readOnlyView()',\n },\n})\nexport class MultipleInputTableViewComponent implements OnDestroy {\n /** The multiple-input field whose rows are shown. Drives columns, permissions and labels. */\n readonly inputConfig = input<ITowerStepColumn | undefined>(undefined);\n\n /** Shared data source; the parent owns its `data`, this view owns its `paginator`. */\n readonly dataSource = input<MatTableDataSource<MultipleInputRow> | undefined>(\n new MatTableDataSource<MultipleInputRow>(),\n );\n\n /** Row the parent is currently applying an action to (kept for the parent's bookkeeping). */\n readonly applyOptionsTo = input<MultipleInputRow | undefined>(undefined);\n\n /** Parent form group, used to spot the row currently open in the editor. */\n readonly formGroup = input<FormGroup | null>(null);\n\n /** Emits the id of the row to open in the editor. */\n readonly onEditItem = output<string>();\n\n /** Emits the row to delete once its countdown has run out. */\n readonly onDeleteItem = output<MultipleInputRow>();\n\n /** Emits the id of the row to duplicate. */\n readonly onCopy = output<string>();\n\n /** Emits the row whose action menu was opened, so the parent can target it. */\n readonly onApplyOptionsTo = output<MultipleInputRow>();\n\n /** Reserved for the parent's label toggle; never emitted by this view. */\n readonly showItemAsLabel = output<void>();\n\n readonly #destroyRef = inject(DestroyRef);\n readonly #dialog = inject(MatDialog);\n readonly #viewContainerRef = inject(ViewContainerRef);\n readonly #injector = inject(Injector);\n /** The consumer's localization, handed to `fieldDisplayValue` so a cell follows the organisation. */\n protected readonly l10n = injectFormsLocalization();\n\n // ── Columns ─────────────────────────────────────────────────────────────────\n /** Inner inputs the user has switched on from the column chooser, by `formControlName`. */\n readonly #tempLabels = signal<readonly string[]>([]);\n\n protected readonly colConfig = computed(() => {\n const cfg = this.inputConfig();\n if (!cfg) {\n return {\n columnsConfig: {} as Record<string, ColumnConfig>,\n displayedColumnsInOrder: [] as string[],\n };\n }\n return configureCols(cfg, [...this.#tempLabels()]);\n });\n\n protected readonly columnsConfig = computed<Record<string, ColumnConfig>>(\n () => this.colConfig().columnsConfig,\n );\n\n /**\n * Render order: the row number, then the field's own columns, then — once anything has been\n * opened — the \"opened\" column immediately before the actions column. Both of those are\n * `stickyEnd`, and Material requires pinned columns to be contiguous at the end.\n */\n protected readonly displayedColumnsInOrderSig = computed(() => {\n const configured = this.colConfig().displayedColumnsInOrder;\n // Read-only offers no row actions, so the actions column would be an empty pinned strip\n // eating the width the data needs; its one read-only job — naming a total row — moves into\n // the row-number cell.\n const base = this.readOnlyView() ? configured.filter((col) => col !== ACTIONS_COLUMN) : configured;\n if (!this.anyRowOpened()) {\n return [INDEX_COLUMN, ...base];\n }\n // `configureCols` always appends the actions column last; guard anyway, so a future column\n // order cannot silently break the sticky group.\n const insertAt = base[base.length - 1] === ACTIONS_COLUMN ? base.length - 1 : base.length;\n return [INDEX_COLUMN, ...base.slice(0, insertAt), OPENED_COLUMN, ...base.slice(insertAt)];\n });\n\n protected readonly allPossibleLabels = computed(() => {\n const cfg = this.inputConfig();\n const displayed = this.displayedColumnsInOrderSig();\n return (\n cfg?.formInputs?.map((inp) => ({\n label: inp.label,\n selected: displayed.includes(`${cfg?.id}.${inp.id}`),\n formControlName: inp.formControlName,\n })) || []\n );\n });\n\n // ── Permissions ─────────────────────────────────────────────────────────────\n protected readonly userCanEdit = computed(() => {\n const cfg = this.inputConfig();\n if (!cfg) return false;\n if (!cfg.multipleInputAvailableOperations) return true;\n return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Update);\n });\n\n protected readonly userCanRemove = computed(() => {\n const cfg = this.inputConfig();\n if (!cfg) return false;\n if (!cfg.multipleInputAvailableOperations) return true;\n return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Remove);\n });\n\n protected readonly userCanAdd = computed(() => {\n const cfg = this.inputConfig();\n if (!cfg) return false;\n if (!cfg.multipleInputAvailableOperations) return true;\n return cfg.multipleInputAvailableOperations.includes(MultipleInputAvailableOperations.Add);\n });\n\n protected readonly userCanApplyOptionsTo = computed(() => {\n return this.userCanEdit() || this.userCanRemove() || this.userCanAdd();\n });\n\n /** A read-only or disabled field shows its rows but offers no actions at all. */\n protected readonly isEditable = computed(() => {\n const cfg = this.inputConfig();\n return !!cfg && !cfg.readonly && !cfg.disabled;\n });\n\n protected readonly showRowActions = computed(() => this.isEditable() && this.userCanApplyOptionsTo());\n\n /**\n * The table is a read-only view of the rows: full width on the host's surface, no frame, no\n * actions column, wrapped descriptions and sentence-case headers. Keyed on `readonly` only —\n * matching the field wrapper and the document picker — so a field merely disabled in a live\n * form keeps its framed table and its actions column exactly as before.\n */\n protected readonly readOnlyView = computed(() => this.inputConfig()?.readonly === true);\n\n\n /**\n * Each data column's inner input, as the read-only display formatter reads it, so a read-only cell\n * prints a choice by its label, a person by name, money in the organisation's format and a\n * date as `14 Oct 2026`. Identity-stable per configuration, which keeps the pure pipe cached.\n */\n readonly #columnFields = computed<Readonly<Record<string, FieldDisplaySource>>>(() => {\n const cfg = this.inputConfig();\n const fields: Record<string, FieldDisplaySource> = {};\n for (const [col, column] of Object.entries(this.columnsConfig())) {\n const inner = cfg?.formInputs?.find((input) => `${cfg.id}.${input.id}` === col);\n const source: FieldDisplaySource | undefined = inner;\n fields[col] = source ?? { dataType: column.dataType, pipe: column.pipe };\n }\n return fields;\n });\n\n /** Edit is the everyday action, so it gets its own button instead of hiding in the menu. */\n protected readonly showRowEdit = computed(() => this.isEditable() && this.userCanEdit());\n\n /** The overflow menu holds duplicate and delete; it is dropped when neither is allowed. */\n protected readonly showRowMenu = computed(\n () => this.isEditable() && (this.userCanAdd() || this.userCanRemove()),\n );\n\n // ── Pagination ──────────────────────────────────────────────────────────────\n protected readonly pageSizeOptions: readonly number[] = PAGE_SIZE_OPTIONS;\n protected readonly pageIndex = signal(0);\n protected readonly pageSize = signal<number>(DEFAULT_PAGE_SIZE);\n\n /**\n * The live paginator. It is re-created when the table moves between its inline slot and the\n * full-screen dialog, so it is read reactively rather than captured once.\n */\n protected readonly paginator = viewChild(MatPaginator);\n\n // ── Full screen ─────────────────────────────────────────────────────────────\n protected readonly fullscreen = signal(false);\n\n /**\n * Height the inline slot keeps while the table is in the dialog, so the surrounding form does not\n * collapse and the page does not jump when full screen is left.\n */\n protected readonly reservedHeight = signal<number | null>(null);\n\n protected readonly shellTemplate = viewChild<TemplateRef<unknown>>('shell');\n protected readonly inlineHost = viewChild<ElementRef<HTMLElement>>('inlineHost');\n // `read: ElementRef` — the ref sits on a `mat-icon-button`, which would otherwise resolve to\n // the button component rather than its element.\n protected readonly fullscreenToggle = viewChild<unknown, ElementRef<HTMLButtonElement>>(\n 'fullscreenToggle',\n { read: ElementRef },\n );\n\n #dialogRef: MatDialogRef<unknown> | undefined;\n\n constructor() {\n // The data source pages whatever paginator is currently rendered — inline, in the dialog, or\n // none while the rows fit on one page.\n effect(() => {\n const ds = this.dataSource();\n const paginator = this.paginator() ?? null;\n if (ds && ds.paginator !== paginator) {\n ds.paginator = paginator;\n }\n });\n }\n\n ngOnDestroy(): void {\n // An armed delete must not fire from a component that no longer exists.\n for (const handle of Object.values(this.#deletionTimers)) {\n clearTimeout(handle);\n }\n this.#deletionTimers = {};\n if (this.#openedTicker !== undefined) {\n clearInterval(this.#openedTicker);\n this.#openedTicker = undefined;\n }\n this.#dialogRef?.close();\n }\n\n // ── Column helpers (template) ───────────────────────────────────────────────\n protected isActionsColumn(col: string): boolean {\n return col === ACTIONS_COLUMN;\n }\n\n protected isIndexColumn(col: string): boolean {\n return col === INDEX_COLUMN;\n }\n\n protected isOpenedColumn(col: string): boolean {\n return col === OPENED_COLUMN;\n }\n\n protected columnLabel(col: string): string {\n if (this.isActionsColumn(col)) {\n return this.showRowActions() ? 'Actions' : '';\n }\n if (this.isOpenedColumn(col)) {\n return 'Opened';\n }\n return this.columnsConfig()[col]?.label ?? '';\n }\n\n protected columnDataType(col: string): CellDataType {\n return this.columnsConfig()[col]?.dataType;\n }\n\n /** The sub-column's number pipe, so a cell rounds and formats at the precision it is stored at. */\n protected columnPipe(col: string): FormColumnInputs['pipe'] | undefined {\n return this.columnsConfig()[col]?.pipe;\n }\n\n protected isNumericColumn(col: string): boolean {\n const type = this.columnDataType(col);\n if (type === 'number' || type === 'currency' || type === 'percent') return true;\n const pipeType = this.columnPipe(col)?.pipeType;\n return !!pipeType && NUMERIC_PIPE_TYPES.has(pipeType);\n }\n\n /** The descriptor a data cell is formatted from; see {@link MultipleInputTableViewComponent.#columnFields}. */\n protected columnField(col: string): FieldDisplaySource | undefined {\n return this.#columnFields()[col];\n }\n\n /** Last wide-column verdict; the data source's rows are not a signal, so this memo stands in for `computed`. */\n #wideMemo: WideColumnsMemo | null = null;\n\n /**\n * True for a read-only text column holding descriptions (any value over\n * {@link WIDE_COLUMN_FROM} characters): it gets the wide floor, the rest the narrow one.\n * Re-derived only when the rows or the columns change.\n */\n protected isWideColumn(col: string): boolean {\n const data = this.dataSource()?.data ?? [];\n const columns = this.displayedColumnsInOrderSig();\n const memo = this.#wideMemo;\n if (memo && memo.data === data && memo.length === data.length && memo.columns === columns) {\n return memo.wide.has(col);\n }\n const wide = new Set<string>();\n for (const candidate of columns) {\n if (this.isNumericColumn(candidate) || this.isStructuredColumn(candidate)) continue;\n if (data.some((row) => typeof row[candidate] === 'string' && (row[candidate] as string).length > WIDE_COLUMN_FROM)) {\n wide.add(candidate);\n }\n }\n this.#wideMemo = { data, length: data.length, columns, wide };\n return wide.has(col);\n }\n\n protected isStructuredColumn(col: string): boolean {\n const type = this.columnDataType(col);\n return type === 'array' || type === 'object';\n }\n\n // ── Row helpers (template) ──────────────────────────────────────────────────\n protected isCalculationRow(row: MultipleInputRow): boolean {\n return !!row[CALCULATION_KEY];\n }\n\n protected rowIsFlaggedInEdit(row: MultipleInputRow): boolean {\n return !!row[IN_EDIT_KEY];\n }\n\n protected rowHasActions(row: MultipleInputRow): boolean {\n // `row[''] !== 'true'` is a legacy host marker for rows that must not be acted on.\n return this.showRowActions() && !this.isCalculationRow(row) && row[''] !== 'true';\n }\n\n /** A calculation row is labelled unless it is the one the editor currently has open. */\n protected showsCalculationLabel(row: MultipleInputRow): boolean {\n if (!this.isCalculationRow(row)) return false;\n const inEditId = this.inputConfig()?.multipleInputInEditId;\n return inEditId ? inEditId !== row['id'] : !row['id'];\n }\n\n /**\n * The row's position in the whole list rather than in the page: the page offset plus the index\n * Material hands the cell. A calculation row is a total, not an entry, so it carries no number.\n */\n protected rowNumber(row: MultipleInputRow, indexInPage: number): string {\n if (this.isCalculationRow(row)) {\n return '';\n }\n // Without a paginator every row is rendered, and a stale `pageIndex` from a larger data set\n // would otherwise offset the numbering.\n const offset = this.showPaginator() ? this.pageIndex() * this.pageSize() : 0;\n return String(offset + indexInPage + 1);\n }\n\n protected totalRows(): number {\n return this.dataSource()?.data.length ?? 0;\n }\n\n protected isEmpty(): boolean {\n return this.totalRows() === 0;\n }\n\n protected showPaginator(): boolean {\n return this.totalRows() > PAGINATION_THRESHOLD;\n }\n\n /** \"3 items\" — calculation rows are totals, not items, so they are left out of the count. */\n protected rowSummary(): string {\n const count = (this.dataSource()?.data ?? []).filter((row) => !this.isCalculationRow(row)).length;\n return `${count} ${count === 1 ? 'item' : 'items'}`;\n }\n\n // ── Refresh ─────────────────────────────────────────────────────────────────\n /**\n * The host may offer a reload of the field's data. It used to hang off the form field as a\n * `matSuffix`, which both floated it away from the table it refreshes and stole the width the\n * table needed; it belongs with the table's own chrome.\n */\n protected readonly canReload = computed(() => !!this.inputConfig()?.canReload?.canReload);\n\n protected reload(): void {\n this.inputConfig()?.canReload?.emit();\n }\n\n // ── \"Opened\" tracking ───────────────────────────────────────────────────────\n /*\n * A long list is edited row by row, and the question the author keeps asking is \"have I already\n * been in this one?\". Every open stamps the row, and the column reports the age of that stamp.\n *\n * In memory, deliberately: LIB-05 forbids the library reaching for `localStorage`, and the state\n * answers a question about THIS editing session anyway. It costs one Map and one interval.\n */\n /** When each row was last opened, by row id. */\n readonly #openedAt = signal<ReadonlyMap<string, number>>(new Map());\n\n /** The clock the relative labels render against. Ticks only while something has been opened. */\n readonly #nowMs = signal(Date.now());\n\n #openedTicker: ReturnType<typeof setInterval> | undefined;\n\n /** The column materialises on the first open, so an untouched table carries no extra ink. */\n protected readonly anyRowOpened = computed(() => this.#openedAt().size > 0);\n\n /** Column token for a row that has been opened, `''` for one that has not. */\n protected openedShort(row: MultipleInputRow): string {\n const at = this.#openedAtFor(row);\n return at === undefined ? '' : openedAgo(this.#nowMs() - at).short;\n }\n\n /** The same age as a sentence, for the cell's tooltip. */\n protected openedLong(row: MultipleInputRow): string {\n const at = this.#openedAtFor(row);\n return at === undefined ? '' : openedAgo(this.#nowMs() - at).long;\n }\n\n #openedAtFor(row: MultipleInputRow): number | undefined {\n const id = this.#rowId(row);\n return id ? this.#openedAt().get(id) : undefined;\n }\n\n /**\n * Stamps a row as opened. Every open re-stamps it, so the column reads as \"what I touched last\"\n * rather than \"what I touched first\".\n */\n #markOpened(row: MultipleInputRow): void {\n const id = this.#rowId(row);\n if (!id) {\n return;\n }\n const next = new Map(this.#openedAt());\n next.set(id, Date.now());\n this.#openedAt.set(next);\n this.#startOpenedTicker();\n }\n\n /** One interval for the whole table, started on the first open and stopped with the component. */\n #startOpenedTicker(): void {\n if (this.#openedTicker !== undefined) {\n return;\n }\n this.#nowMs.set(Date.now());\n this.#openedTicker = setInterval(() => this.#nowMs.set(Date.now()), OPENED_TICK_MS);\n }\n\n protected onPage(event: PageEvent): void {\n this.pageIndex.set(event.pageIndex);\n this.pageSize.set(event.pageSize);\n }\n\n // ── Full screen ─────────────────────────────────────────────────────────────\n protected toggleFullscreen(): void {\n if (this.fullscreen()) {\n this.#dialogRef?.close();\n return;\n }\n const shell = this.shellTemplate();\n if (!shell) return;\n\n this.reservedHeight.set(this.inlineHost()?.nativeElement.offsetHeight ?? null);\n this.fullscreen.set(true);\n\n const label = this.inputConfig()?.label;\n const ref = this.#dialog.open(shell, {\n viewContainerRef: this.#viewContainerRef,\n width: 'calc(100vw - 3rem)',\n height: 'calc(100vh - 3rem)',\n maxWidth: '100vw',\n maxHeight: '100vh',\n panelClass: 'lib-multiple-input-table-view__dialog',\n ariaLabel: label ? `${label} full screen` : 'Table full screen',\n autoFocus: 'dialog',\n // The inline toggle is re-created after the dialog closes, so focus is restored by hand.\n restoreFocus: false,\n });\n this.#dialogRef = ref;\n\n ref\n .afterClosed()\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(() => {\n if (this.#dialogRef === ref) this.#dialogRef = undefined;\n this.fullscreen.set(false);\n this.reservedHeight.set(null);\n afterNextRender(\n () => this.fullscreenToggle()?.nativeElement.focus({ preventScroll: true }),\n { injector: this.#injector },\n );\n });\n }\n\n /** The editor opens in the form behind the dialog, so leave full screen before handing over. */\n #leaveFullscreen(): void {\n this.#dialogRef?.close();\n }\n\n // ── Actions ─────────────────────────────────────────────────────────────────\n #rowId(row: MultipleInputRow): string {\n return row[`${this.inputConfig()?.id}.id`] as string;\n }\n\n protected applyOptionsToFn(item: MultipleInputRow): void {\n this.onApplyOptionsTo.emit(item);\n }\n\n protected editItem(row: MultipleInputRow): void {\n this.#markOpened(row);\n this.#leaveFullscreen();\n this.onEditItem.emit(this.#rowId(row));\n }\n\n protected copy(row: MultipleInputRow): void {\n this.#leaveFullscreen();\n this.onCopy.emit(this.#rowId(row));\n }\n\n // ── Two-step delete ─────────────────────────────────────────────────────────\n #armedDeletions: Record<string, boolean> = {};\n #deletionTimers: Record<string, ReturnType<typeof setTimeout>> = {};\n #countDownDate: Date = new Date();\n\n protected isAboutToDeleteRow(row: MultipleInputRow): boolean {\n return !!this.#armedDeletions[this.#rowId(row)];\n }\n\n protected getCountdownSeconds(): number {\n const now = new Date();\n const timeElapsed = (now.getTime() - this.#countDownDate.getTime()) / 1000;\n return Math.min(Math.round((timeElapsed / (DELETE_COUNTDOWN_MS / 1000)) * 100), 100);\n }\n\n protected secondsCountDown(): string {\n const total = DELETE_COUNTDOWN_MS / 1000;\n return (total - (this.getCountdownSeconds() / 100) * total).toFixed(1);\n }\n\n protected multipleInputRemoveItem(event: Event, row: MultipleInputRow): void {\n const rowId = this.#rowId(row);\n\n if (this.#armedDeletions[rowId]) {\n const handle = this.#deletionTimers[rowId];\n if (handle) {\n clearTimeout(handle);\n delete this.#deletionTimers[rowId];\n }\n delete this.#armedDeletions[rowId];\n } else {\n this.#armedDeletions[rowId] = true;\n this.#countDownDate = new Date();\n\n this.#deletionTimers[rowId] = setTimeout(() => {\n if (this.#armedDeletions[rowId]) {\n this.onDeleteItem.emit(row);\n delete this.#armedDeletions[rowId];\n delete this.#deletionTimers[rowId];\n }\n }, DELETE_COUNTDOWN_MS);\n }\n\n event.preventDefault();\n event.stopPropagation();\n }\n\n // ── Cell presentation ───────────────────────────────────────────────────────\n protected returnBackground(row: MultipleInputRow, columnsConfig?: ColumnConfig): string | undefined {\n let background = '';\n const ds = this.dataSource();\n if (\n ds\n ? ds.data.length > 1\n ? columnsConfig?.['colorScale']\n : false\n : false\n ) {\n const inputCfg = this.inputConfig() as IMultiple;\n const colKey = columnsConfig?.['key'] ?? '';\n const point = Number(row[colKey]);\n const inputIsGrouped = inputCfg.groupBy;\n const groupKey = inputCfg.groupBy?.[0] || '';\n const dataSet = inputIsGrouped\n ? ds?.data.filter(\n (s) => (s as MultipleInputRow)[groupKey] === row[groupKey],\n )\n : new Array(ds?.data||[]);\n const arrayValues: number[] = dataSet?.map((vr) => Number((vr as MultipleInputRow)[colKey]))||[];\n const max = Math.max(...arrayValues);\n const min = Math.min(...arrayValues);\n const hasNun = isNaN(max) || isNaN(min);\n if (!hasNun && Number(max) !== Number(min)) {\n const colorScale = new ColorScale(\n min,\n max,\n ['#2fdf75', '#FFA500', '#ff4961'],\n 0.8,\n );\n\n const color: string | undefined = colorScale.getColor(point)?.toRGBAString();\n background = color ?? '';\n }\n }\n return background;\n }\n\n protected hasTopBorder(row: MultipleInputRow): boolean {\n const inputCfg = this.inputConfig() as IMultiple;\n const inputIsGrouped = inputCfg?.groupBy;\n const ds = this.dataSource();\n if (inputIsGrouped && ds) {\n const indexOfRow = ds.data.indexOf(row);\n const rowIsFirstInTable = indexOfRow === 0;\n\n if (!inputCfg.groupBy) {\n return false;\n }\n const groupKey = inputCfg.groupBy?.[0] ?? '';\n const isFirstInGroup = rowIsFirstInTable\n ? true\n : (ds.data[indexOfRow - 1] as MultipleInputRow)[groupKey] !==\n row[groupKey];\n\n return isFirstInGroup;\n } else {\n return false;\n }\n }\n\n protected getCalculationFunction(row: MultipleInputRow): string {\n const func = row[CALCULATION_KEY] as CalculationFunctions;\n\n switch (func) {\n case CalculationFunctions.Sum:\n return 'Total';\n case CalculationFunctions.Avg:\n return 'Average';\n case CalculationFunctions.Max:\n return 'Max';\n case CalculationFunctions.Min:\n return 'Min';\n default:\n return func;\n }\n }\n\n // ── Column chooser ──────────────────────────────────────────────────────────\n protected toggleTempLabel(event: Event, label: string): void {\n this.#tempLabels.update((labels) =>\n labels.includes(label) ? labels.filter((l) => l !== label) : [...labels, label],\n );\n\n // Keep the menu open so several columns can be toggled in one go.\n event.stopPropagation();\n event.preventDefault();\n }\n\n /** Column keys in display order — the removal column is always last. */\n get displayedColumnsInOrder(): string[] {\n return this.displayedColumnsInOrderSig();\n }\n\n protected rowIsInEdit(row: MultipleInputRow): boolean {\n const cfg = this.inputConfig();\n const fg = this.formGroup();\n return (\n !!cfg?.formIsOpen &&\n fg?.controls[`${cfg?.id}.id`]?.value === row[`${cfg?.id}.id`]\n );\n }\n\n // ── Structured-value popover ────────────────────────────────────────────────\n protected readonly overlayOpen = signal(false);\n protected readonly overlayData = signal<unknown>(null);\n protected readonly overlayOrigin = signal<HTMLElement | null>(null);\n\n protected openDataOverlay(event: MouseEvent, data: unknown): void {\n event.stopPropagation();\n this.overlayOrigin.set(event.currentTarget as HTMLElement);\n this.overlayData.set(data);\n this.overlayOpen.set(true);\n }\n\n protected closeDataOverlay(): void {\n this.overlayOpen.set(false);\n this.overlayData.set(null);\n this.overlayOrigin.set(null);\n }\n}\n","@defer (on viewport) {\n <!--\n The table shell is a template so the same markup renders in two places: inline in the form,\n or inside the full-screen dialog. Only one instance exists at a time — the inline slot empties\n while the dialog is open — so the shared data source always pages through a single paginator.\n -->\n <ng-template #shell>\n <!-- The read-only state sits on the shell, not the host: the full-screen copy of this template\n renders inside a dialog overlay, outside the host element, and must look the same. -->\n <section class=\"mit-shell\" [class.mit-shell--fullscreen]=\"fullscreen()\" [class.mit-shell--readonly]=\"readOnlyView()\">\n <header class=\"mit-toolbar\">\n <div class=\"mit-toolbar__lead\">\n @if (fullscreen()) {\n <h2 class=\"mit-toolbar__title\">{{ inputConfig()?.label }}</h2>\n }\n <span class=\"mit-toolbar__summary\">{{ rowSummary() }}</span>\n </div>\n <div class=\"mit-toolbar__actions\">\n @if (canReload()) {\n <button\n type=\"button\"\n mat-icon-button\n class=\"mit-icon-button mit-reload\"\n matTooltip=\"Refresh this list\"\n aria-label=\"Refresh this list\"\n (click)=\"reload()\"\n >\n <mat-icon>sync</mat-icon>\n </button>\n }\n @if (allPossibleLabels().length > 0) {\n <button\n type=\"button\"\n mat-icon-button\n class=\"mit-icon-button mit-columns-trigger\"\n matTooltip=\"Choose columns\"\n aria-label=\"Choose columns\"\n [matMenuTriggerFor]=\"colOptions\"\n >\n <mat-icon>view_column</mat-icon>\n </button>\n }\n <button\n #fullscreenToggle\n type=\"button\"\n mat-icon-button\n class=\"mit-icon-button mit-fullscreen-toggle\"\n [matTooltip]=\"fullscreen() ? 'Exit full screen' : 'Full screen'\"\n [attr.aria-label]=\"fullscreen() ? 'Exit full screen' : 'Full screen'\"\n [attr.aria-pressed]=\"fullscreen()\"\n (click)=\"toggleFullscreen()\"\n >\n <mat-icon>{{ fullscreen() ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>\n </button>\n </div>\n </header>\n\n @if (displayedColumnsInOrder.length === 0) {\n <div class=\"mit-state\">No columns</div>\n }\n\n <div class=\"mit-scroll\">\n <table mat-table [dataSource]=\"dataSource() ?? []\" class=\"mit-table\">\n @for (col of displayedColumnsInOrder; track col) {\n <!--\n The row number is pinned to the start and the \"opened\" age and actions to the end, so\n a row keeps its identity and stays actionable however far a wide table is scrolled.\n Material needs each pinned group contiguous at its edge, which is why the \"opened\"\n column is inserted before the actions column rather than appended after it.\n -->\n <ng-container\n [matColumnDef]=\"col\"\n [sticky]=\"isIndexColumn(col)\"\n [stickyEnd]=\"isActionsColumn(col) || isOpenedColumn(col)\"\n >\n <th\n mat-header-cell\n *matHeaderCellDef\n scope=\"col\"\n [attr.aria-label]=\"isIndexColumn(col) ? 'Row number' : null\"\n [class.mit-th--index]=\"isIndexColumn(col)\"\n [class.mit-th--opened]=\"isOpenedColumn(col)\"\n [class.mit-th--numeric]=\"isNumericColumn(col)\"\n [class.mit-th--actions]=\"isActionsColumn(col)\"\n [class.mit-th--wide]=\"readOnlyView() && isWideColumn(col)\"\n >\n @if (isIndexColumn(col)) {\n <span class=\"mit-th-hash\" aria-hidden=\"true\">#</span>\n } @else {\n <span class=\"mit-th-label\">{{ columnLabel(col) }}</span>\n }\n </th>\n <td\n mat-cell\n *matCellDef=\"let row; let rowIndex = index\"\n [class.mit-td--calc]=\"isCalculationRow(row)\"\n [class.mit-td--index]=\"isIndexColumn(col)\"\n [class.mit-td--opened]=\"isOpenedColumn(col)\"\n [class.mit-td--actions]=\"isActionsColumn(col)\"\n [class.mit-td--numeric]=\"isNumericColumn(col)\"\n [class.mit-td--wide]=\"readOnlyView() && isWideColumn(col)\"\n [style.background]=\"returnBackground(row, columnsConfig()[col])\"\n >\n @if (isIndexColumn(col)) {\n @if (readOnlyView() && showsCalculationLabel(row)) {\n <!-- Read-only has no actions column, so a total row is named where its number would be. -->\n <span class=\"mit-calc-label\">{{ getCalculationFunction(row) }}</span>\n } @else {\n <span class=\"mit-index\">{{ rowNumber(row, rowIndex) }}</span>\n }\n } @else if (isOpenedColumn(col)) {\n <!-- Blank for a row nobody has been into: the column is a record of what the\n author touched, so an empty cell is the honest reading of \"not yet\". -->\n @let opened = openedShort(row);\n @if (opened) {\n <span class=\"mit-opened\" [matTooltip]=\"openedLong(row)\">{{ opened }}</span>\n }\n } @else if (isActionsColumn(col)) {\n <div class=\"mit-actions\">\n @if (showsCalculationLabel(row)) {\n <span class=\"mit-calc-label\">{{ getCalculationFunction(row) }}</span>\n }\n @if (rowIsFlaggedInEdit(row)) {\n <mat-chip class=\"mit-chip\">In {{ inputConfig()?.readonly ? 'View' : 'Edit' }}</mat-chip>\n }\n @if (rowHasActions(row)) {\n @if (showRowEdit()) {\n <button\n type=\"button\"\n mat-icon-button\n class=\"mit-icon-button mit-row-edit\"\n [class.mit-icon-button--active]=\"rowIsInEdit(row)\"\n matTooltip=\"Edit\"\n aria-label=\"Edit row\"\n (click)=\"editItem(row)\"\n >\n <mat-icon>edit</mat-icon>\n </button>\n }\n @if (showRowMenu()) {\n <button\n type=\"button\"\n mat-icon-button\n class=\"mit-icon-button mit-row-trigger\"\n [class.mit-icon-button--active]=\"t.menuOpen\"\n matTooltip=\"More actions\"\n aria-label=\"More row actions\"\n [matMenuTriggerFor]=\"rowOptions\"\n [matMenuTriggerData]=\"{ row: row }\"\n #t=\"matMenuTrigger\"\n (click)=\"applyOptionsToFn(row)\"\n >\n <mat-icon>{{ t.menuOpen ? 'close' : 'more_horiz' }}</mat-icon>\n </button>\n }\n }\n </div>\n } @else if (isStructuredColumn(col)) {\n <button\n type=\"button\"\n mat-icon-button\n class=\"mit-icon-button mit-data-button\"\n matTooltip=\"View data\"\n aria-label=\"View data\"\n (click)=\"openDataOverlay($event, row[col])\"\n >\n <mat-icon>data_object</mat-icon>\n </button>\n } @else {\n @if (readOnlyView()) {\n <!-- Read-only prints through the one display pipeline (labels, names, org money\n and dates). The cell wraps to two lines; a cell that actually clamps offers\n its full text as a tooltip on hover and keyboard focus. Its aria-label equals\n the tooltip, which stops the tooltip re-announcing the same text as a\n description; role=note makes that focus stop a named, permitted target\n (aria-label is prohibited on a role-less span). -->\n @let text = row[col] | fieldDisplayValue: columnField(col) : l10n();\n <span\n class=\"mit-cell-text mit-cell-text--wrap\"\n libClampProbe\n #probe=\"libClampProbe\"\n [matTooltip]=\"text\"\n [matTooltipDisabled]=\"!probe.clamped()\"\n [attr.role]=\"probe.clamped() ? 'note' : null\"\n [attr.aria-label]=\"probe.clamped() ? text : null\"\n [attr.tabindex]=\"probe.clamped() ? 0 : null\"\n >{{ text }}</span>\n } @else {\n @let text = row[col] | formatData: columnDataType(col) : columnPipe(col) : l10n();\n <span class=\"mit-cell-text\" [attr.title]=\"text\">{{ text }}</span>\n }\n }\n </td>\n </ng-container>\n }\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumnsInOrder; sticky: true\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: displayedColumnsInOrder\"\n class=\"mit-row\"\n [class.mit-row--group-start]=\"hasTopBorder(row)\"\n [class.mit-row--calc]=\"isCalculationRow(row)\"\n [class.mit-row--in-edit]=\"rowIsInEdit(row)\"\n ></tr>\n </table>\n\n @if (isEmpty()) {\n <div class=\"mit-empty\">\n @if (readOnlyView()) {\n <!-- Read-only: state the fact; there is no add button to point at. -->\n <strong class=\"mit-empty-title\">No items recorded</strong>\n } @else {\n <strong class=\"mit-empty-title\">No items yet</strong>\n <p class=\"mit-empty-text\">\n Use the add button below to create a row. Each saved entry appears here.\n </p>\n }\n </div>\n }\n </div>\n\n @if (showPaginator()) {\n <mat-paginator\n class=\"mit-paginator\"\n [pageIndex]=\"pageIndex()\"\n [pageSize]=\"pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n aria-label=\"Table pagination\"\n (page)=\"onPage($event)\"\n />\n }\n </section>\n </ng-template>\n\n <div class=\"mit-inline\" #inlineHost [style.min-height.px]=\"reservedHeight()\">\n @if (!fullscreen()) {\n <ng-container [ngTemplateOutlet]=\"shell\" />\n }\n </div>\n} @placeholder {\n <div class=\"mit-placeholder\">\n <mat-spinner diameter=\"32\" />\n </div>\n}\n\n<!--\n Structured (array / object) cell values open in a CDK overlay anchored to the button that was\n clicked. An overlay, rather than a fixed-position panel, so it stacks correctly above the\n full-screen dialog and is never clipped by a transformed ancestor.\n-->\n@if (overlayOrigin(); as origin) {\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"overlayOpen()\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPush]=\"true\"\n (backdropClick)=\"closeDataOverlay()\"\n (detach)=\"closeDataOverlay()\"\n >\n <div class=\"mit-data-panel\" role=\"dialog\" aria-label=\"Cell data\">\n <div class=\"mit-data-panel__header\">\n <span class=\"mit-data-panel__title\">Data</span>\n <button\n type=\"button\"\n mat-icon-button\n class=\"mit-icon-button mit-data-close\"\n aria-label=\"Close\"\n (click)=\"closeDataOverlay()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n <div class=\"mit-data-panel__body\">\n <lib-t-dynamic-data-view [data]=\"overlayData()\" />\n </div>\n </div>\n </ng-template>\n}\n\n<mat-menu #colOptions=\"matMenu\">\n <ng-template matMenuContent>\n @for (label of allPossibleLabels(); track label.formControlName) {\n <button\n mat-menu-item\n role=\"menuitemcheckbox\"\n [attr.aria-checked]=\"label.selected\"\n (click)=\"toggleTempLabel($event, label.formControlName)\"\n >\n <mat-icon>{{ label.selected ? 'check_box' : 'check_box_outline_blank' }}</mat-icon>\n {{ label.label }}\n </button>\n }\n </ng-template>\n</mat-menu>\n\n<mat-menu #rowOptions=\"matMenu\">\n <ng-template matMenuContent let-row=\"row\">\n @if (isEditable()) {\n @if (userCanAdd()) {\n <button mat-menu-item (click)=\"copy(row)\">\n <mat-icon>content_copy</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Duplicate</div>\n <div class=\"option-sub-text\">Create a copy with the same values</div>\n </div>\n </button>\n }\n\n @if (userCanRemove()) {\n @if (isAboutToDeleteRow(row)) {\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event, row)\">\n <mat-icon color=\"accent\">cancel</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text option-main-text--cancel\">Cancel Deletion</div>\n <div class=\"option-sub-text\">Auto-deleting in {{ secondsCountDown() }} seconds...</div>\n </div>\n </button>\n <div class=\"deletion-progress-container\">\n <mat-progress-bar color=\"warn\" mode=\"determinate\" [value]=\"getCountdownSeconds()\"></mat-progress-bar>\n @if (getCountdownSeconds() > 75) {\n <div class=\"deletion-message\">Deleting soon...</div>\n }\n </div>\n } @else {\n <button mat-menu-item (click)=\"multipleInputRemoveItem($event, row)\">\n <mat-icon color=\"warn\">delete_outline</mat-icon>\n <div class=\"option-text\">\n <div class=\"option-main-text\">Delete</div>\n <div class=\"option-sub-text\">Removes after 3 seconds. Click again to cancel</div>\n </div>\n </button>\n }\n }\n }\n </ng-template>\n</mat-menu>\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n OnDestroy,\r\n ViewEncapsulation,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatDividerModule } from '@angular/material/divider';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatMenuModule } from '@angular/material/menu';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\nimport { TFormInputComponent } from '../../../../t-form-input.component';\r\nimport { CdkDragDrop, DragDropModule } from '@angular/cdk/drag-drop';\r\n\r\nimport { Subject, takeUntil, tap, timer } from 'rxjs';\r\nimport { CalculationFunctions, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { IMultipleInputCal } from 'ngx-t-forms-types';\r\nimport { FormBuilderFunctions } from 'ngx-t-forms-types';\r\nimport { AbstractControl, FormGroup } from '@angular/forms';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\n\r\n@Component({\r\n selector: 'lib-multiple-input-table-edit',\r\n imports: [\r\n CommonModule,\r\n DragDropModule,\r\n MatButtonModule,\r\n MatCardModule,\r\n MatDividerModule,\r\n MatIconModule,\r\n MatMenuModule,\r\n MatProgressSpinnerModule,\r\n MatTooltipModule,\r\n ],\r\n templateUrl: './multiple-input-table-edit.component.html',\r\n styleUrl: './multiple-input-table-edit.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n})\r\nexport class MultipleInputTableEditComponent implements OnDestroy {\r\n protected readonly InputComponent = TFormInputComponent;\r\n\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly editorMode = input<boolean>(false);\r\n readonly formGroup = input<FormGroup | null>(null);\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n\r\n readonly onSaveMultipleInputForm = output<void>();\r\n readonly editMultipleInput = output<ITowerStepColumn>();\r\n readonly deleteInput = output<ITowerStepColumn>();\r\n readonly showItemAsLabel = output<ITowerStepColumn>();\r\n readonly addFunction = output<IMultipleInputCal>();\r\n readonly reorderItems = output<CdkDragDrop<ITowerStepColumn[], unknown, unknown>>();\r\n\r\n protected readonly calculationFunctions = Object.values(CalculationFunctions);\r\n\r\n protected activeInput: string = '';\r\n protected dragging: boolean = false;\r\n protected overId: string | null = null;\r\n protected areYouSure: boolean = false;\r\n\r\n protected countdownSeconds: {\r\n [key: string]: {\r\n count: number | null;\r\n stop$: Subject<void>;\r\n };\r\n } = {};\r\n\r\n protected readonly innerInputs = computed(() => {\r\n const cfg = this.inputConfig();\r\n return (\r\n cfg?.formInputs?.map(\r\n (input) =>\r\n ({\r\n ...input,\r\n originalId: input.id,\r\n id: `${cfg?.id}.${input.id}`,\r\n } as ITowerStepColumn),\r\n ) || []\r\n );\r\n });\r\n\r\n protected readonly rowInUpdate = computed(() => {\r\n const cfg = this.inputConfig();\r\n const fg = this.formGroup();\r\n return !!cfg?.formIsOpen && !!fg?.controls[`${cfg?.id}.id`]?.value;\r\n });\r\n\r\n protected readonly formInvalid = computed(() => {\r\n const cfg = this.inputConfig();\r\n const fg = this.formGroup();\r\n const allControls: AbstractControl<unknown, unknown>[] = [];\r\n cfg?.formInputs?.forEach((input) => {\r\n const control = fg?.controls[`${cfg?.id}.${input.id}`];\r\n if (control) {\r\n allControls.push(control);\r\n }\r\n });\r\n return allControls.some((control) => control?.invalid || !control);\r\n });\r\n\r\n readonly #destroyRef = inject(DestroyRef);\r\n\r\n ngOnDestroy(): void {\r\n Object.values(this.countdownSeconds).forEach(({ stop$ }) => stop$.complete());\r\n }\r\n\r\n protected saveMultipleInputForm(): void {\r\n this.onSaveMultipleInputForm.emit();\r\n }\r\n\r\n protected inputWillBeRemovedIn(id: string): number | null | undefined {\r\n return this.countdownSeconds[id]?.count;\r\n }\r\n\r\n protected removeInput(item: ITowerStepColumn): void {\r\n if (this.countdownSeconds[item.id]) {\r\n this.stopDeletion(item.id);\r\n return;\r\n }\r\n\r\n this.countdownSeconds[item.id] = {\r\n count: 5,\r\n stop$: new Subject<void>(),\r\n };\r\n\r\n const countdown$ = timer(0, 1000).pipe(\r\n tap((secondsElapsed) => {\r\n const data = this.countdownSeconds[item.id];\r\n if (!data) {\r\n return;\r\n }\r\n\r\n const remainingTime = 5 - secondsElapsed;\r\n if (remainingTime <= 0) {\r\n this.formDeleteInput(item);\r\n this.stopDeletion(item.id);\r\n } else {\r\n data.count = remainingTime;\r\n }\r\n }),\r\n takeUntil(this.countdownSeconds[item.id]!.stop$),\r\n takeUntilDestroyed(this.#destroyRef),\r\n );\r\n\r\n countdown$.subscribe({\r\n complete: () => {},\r\n });\r\n }\r\n\r\n protected stopDeletion(id: string): void {\r\n if (this.countdownSeconds[id]) {\r\n this.countdownSeconds[id]?.stop$.next();\r\n delete this.countdownSeconds[id];\r\n }\r\n }\r\n\r\n protected formDeleteInput(item: ITowerStepColumn): void {\r\n this.deleteInput.emit(item);\r\n }\r\n\r\n protected dropItems(event: CdkDragDrop<ITowerStepColumn[], unknown, unknown>): void {\r\n this.reorderItems.emit(event);\r\n }\r\n\r\n protected editInput(input: ITowerStepColumn): void {\r\n this.editMultipleInput.emit(input);\r\n }\r\n\r\n protected toggleLabel(item: ITowerStepColumn): void {\r\n this.showItemAsLabel.emit(item);\r\n }\r\n\r\n protected toggleFunction(func: CalculationFunctions, _inputId: string): void {\r\n const addFunction: IMultipleInputCal = {\r\n id: uuidv4(),\r\n inputId: this.activeInput,\r\n func,\r\n } as IMultipleInputCal;\r\n this.addFunction.emit(addFunction);\r\n }\r\n\r\n protected selectedFunction(func: CalculationFunctions): IMultipleInputCal | undefined {\r\n return this.inputConfig()?.calculateListFunctions?.find(\r\n (f) => f.inputId === this.activeInput && f.func === func,\r\n );\r\n }\r\n\r\n protected closeMultipleInput(): void {\r\n if (this.areYouSure) {\r\n this.formBuilderFunctions()?.multipleInputToggleForm(this.inputConfig().id, false);\r\n this.areYouSure = false;\r\n return;\r\n }\r\n this.areYouSure = true;\r\n }\r\n}\r\n","<mat-card appearance=\"outlined\" class=\"edit-card mat-elevation-z4\">\r\n <mat-card-content>\r\n <div class=\"list row\" (cdkDropListDropped)=\"dropItems($event)\"\r\n [cdkDropListData]=\"innerInputs()\" cdkDropList #InputList=\"cdkDropList\">\r\n @for (innerInput of innerInputs(); track innerInput.id) {\r\n <ng-container>\r\n @if (editorMode()) {\r\n @if (!!formGroup()) {\r\n <mat-card (mouseover)=\"activeInput = innerInput.id\" cdkDrag\r\n (cdkDragStarted)=\"dragging = true\" (cdkDragReleased)=\"dragging = false\"\r\n [class.inputCardElevated]=\"activeInput === innerInput.id\"\r\n [class.inputCard]=\"activeInput !== innerInput.id\"\r\n [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\r\n <ng-container *ngComponentOutlet=\"InputComponent;\r\n inputs: {\r\n inputConfig: innerInput,\r\n formGroup: formGroup(),\r\n formBuilderFunctions: formBuilderFunctions(),\r\n }\">\r\n </ng-container>\r\n @if (activeInput === innerInput.id) {\r\n <mat-card-actions class=\"input-actions\">\r\n <span class=\"spacer\"></span>\r\n <button [matTooltip]=\"'Edit Input: ' + innerInput.label\"\r\n (click)=\"editInput(innerInput)\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n @if (!!inputWillBeRemovedIn(innerInput.id)) {\r\n <button (mouseover)=\"overId = innerInput.id\" (mouseout)=\"overId = null\"\r\n (click)=\"removeInput(innerInput)\" color=\"warn\" mat-stroked-button>\r\n <div class=\"countdown-button\">\r\n <mat-progress-spinner class=\"cancelProgress\" color=\"primary\"\r\n [value]=\"((inputWillBeRemovedIn(innerInput.id) || 0) / 5) * 100\">\r\n </mat-progress-spinner>\r\n {{ overId === innerInput.id ? 'Click to cancel' : 'Deleting in' }}\r\n {{ inputWillBeRemovedIn(innerInput.id) }}\r\n </div>\r\n </button>\r\n } @else if (inputConfig().systemDefault !== true && innerInput.systemDefault !== true) {\r\n <button [matTooltip]=\"'Delete input ' + innerInput.label\"\r\n (click)=\"removeInput(innerInput)\" mat-icon-button>\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n }\r\n <span class=\"action-divider\"></span>\r\n @if (!!innerInput.showAsLabel && innerInput.dataType === 'number' || !!innerInput.showAsLabel && innerInput.type === 'number') {\r\n <button\r\n [matMenuTriggerFor]=\"calculationMenu\"\r\n [matMenuTriggerData]=\"{inputId:innerInput.originalId || innerInput.id}\"\r\n [matTooltip]=\"'calculate sum,avg,min,max'\"\r\n mat-icon-button>\r\n <mat-icon>calculate</mat-icon>\r\n </button>\r\n }\r\n <button [color]=\"innerInput.showAsLabel ? 'primary' : ''\"\r\n (click)=\"toggleLabel(innerInput)\"\r\n [matTooltip]=\"innerInput.showAsLabel ? 'Hide as label' : 'Show as label'\"\r\n mat-icon-button>\r\n <mat-icon>label</mat-icon>\r\n </button>\r\n <span class=\"spacer\"></span>\r\n </mat-card-actions>\r\n }\r\n </mat-card>\r\n }\r\n } @else {\r\n <div [class]=\"'col-md-' + (dragging ? '12' : innerInput.colSize)\" class=\"box\">\r\n <ng-container *ngComponentOutlet=\"InputComponent;\r\n inputs: {\r\n inputConfig: innerInput,\r\n formGroup: formGroup(),\r\n formBuilderFunctions: formBuilderFunctions(),\r\n }\">\r\n </ng-container>\r\n </div>\r\n }\r\n </ng-container>\r\n }\r\n @if (!!editorMode() && innerInputs().length === 0) {\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n <strong>Add Form Input</strong>\r\n <br>\r\n Manage your list by adding, editing, or removing items. Each item is customizable through a form.\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n </mat-card-content>\r\n @if (innerInputs().length !== 0) {\r\n <mat-divider></mat-divider>\r\n <mat-card-actions align=\"end\" class=\"edit-card-actions\">\r\n <button [color]=\"areYouSure ? 'warn' : ''\"\r\n [class.confirm-leave]=\"areYouSure\" mat-button\r\n (click)=\"closeMultipleInput()\">\r\n {{ areYouSure ? \"leave without saving\" : \"cancel\" }}\r\n </button>\r\n @if (!inputConfig().readonly) {\r\n <button [disabled]=\"!!formInvalid()\" class=\"save-button\" color=\"primary\"\r\n (click)=\"saveMultipleInputForm()\" mat-raised-button>\r\n {{ rowInUpdate() ? \"Update\" : \"Save\" }}\r\n </button>\r\n }\r\n </mat-card-actions>\r\n }\r\n</mat-card>\r\n\r\n\r\n<mat-menu #calculationMenu=\"matMenu\">\r\n <ng-template matMenuContent let-inputId=\"sectionId\">\r\n @for (func of calculationFunctions; track func) {\r\n <button (click)=\"toggleFunction(func, inputId)\" mat-menu-item>\r\n {{ func }}\r\n @if (selectedFunction(func)) {\r\n <mat-icon color=\"primary\">check_circle</mat-icon>\r\n }\r\n </button>\r\n }\r\n </ng-template>\r\n</mat-menu>\r\n","\nimport { calculateListOveralFunctions } from \"../../../../../services/core/t-form-controller/function/calculateInputValue\";\nimport {\n LIBRARY_CURRENCY_DEFAULTS,\n childRoundingRule,\n roundValueByRule,\n type CurrencyRoundingDefaults,\n} from \"../../../../../shared/functions/numberRounding\";\nimport { CalculationFunctions, FormColumnInputs } from \"ngx-t-forms-types\";\n\ntype CalculatedRow = Record<string, unknown> & {\n SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION?: CalculationFunctions;\n};\n\n/**\n * Appends one summary row per list function (total, average, …) to `data`.\n *\n * Each aggregate is rounded with the rule of the sub-column it summarises\n * (`numberRounding.ts`), so a column of cents never shows a total of\n * `0.30000000000000004` and the summary row agrees with the rows above it.\n * A column without a rule keeps the raw aggregate, as before. `currencyDefaults`\n * is the consumer's currency, for a sub-column that names none.\n */\nexport function getCaluculatedTableData(\n inputConfig: FormColumnInputs | undefined,\n data: Record<string, unknown>[],\n currencyDefaults: CurrencyRoundingDefaults = LIBRARY_CURRENCY_DEFAULTS,\n): Record<string, unknown>[] {\n try {\n if (!Array.isArray(data) || !inputConfig) return data;\n const input: FormColumnInputs = inputConfig;\n const funcs = (input?.calculateListFunctions || []);\n const allUniqueFunctionNames = [\n ...new Set(funcs.map((f: { inputId: string; func: CalculationFunctions }) => f.func)),\n ];\n const calculatedData: CalculatedRow[] = allUniqueFunctionNames.map((func) => {\n const newCalculatedData: CalculatedRow = {\n SYSTEM_KEY_PROPERTY_FOR_MULTIPLE_INPUTS_CALCULATION_FUNCTION: func,\n };\n funcs.filter((f) => f.func === func).forEach((f) => {\n const arrayValues = data.map((d) => Number(d[f.inputId]));\n const aggregate = calculateListOveralFunctions(func, arrayValues);\n newCalculatedData[f.inputId] = roundValueByRule(aggregate, childRoundingRule(input, f.inputId, currencyDefaults));\n });\n return newCalculatedData;\n });\n return [...data, ...calculatedData];\n } catch (error) {\n return data;\n }\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { ErrorHandler, Injectable, PLATFORM_ID, inject } from '@angular/core';\nimport type { FormColumnInputs } from 'ngx-t-forms-types';\n\nimport type { SpreadsheetSource } from '../../../../../../domain/spreadsheet-import.model';\nimport {\n buildImportTemplate,\n type ImportOptionLists,\n} from '../../../../../../services/core/t-form-import-controller/functions/importTemplate';\nimport { TFormImportController } from '../../../../../../services/core/t-form-import-controller/t-form-import-controller';\nimport { SPREADSHEET_WRITER } from '../../../../../../tokens/spreadsheet-writer.token';\n\n/** Type offered to the browser when the writer reported none. */\nconst FALLBACK_MIME_TYPE = 'application/octet-stream';\n\n/**\n * Offers the import template of a multiple-input field for download.\n *\n * Builds the template the library defines for the field (a data sheet with\n * the headers the import matches, a `Guide` sheet, and an `Options` sheet\n * listing the allowed options of its choice columns), has the host's writer\n * serialise it, and hands the file to the browser. The option lists are\n * loaded through {@link TFormImportController.loadMultipleInputOptions} — a\n * settled headless row — so a fetched list is spelled out, not just named;\n * when that load fails the template still downloads without the fetched\n * lists, and the failure goes to the application's `ErrorHandler`. Only\n * reachable when the host bound a writer through\n * `withSpreadsheetImport(parser, { writer })`; the add-row menu and the import\n * dialog both ask {@link available} before offering the download. Config-free,\n * so root-provided.\n */\n@Injectable({ providedIn: 'root' })\nexport class SpreadsheetTemplateService {\n readonly #writer = inject(SPREADSHEET_WRITER, { optional: true });\n readonly #platformId = inject(PLATFORM_ID);\n readonly #document = inject(DOCUMENT);\n readonly #importCtrl = inject(TFormImportController);\n readonly #errorHandler = inject(ErrorHandler);\n\n /** Whether the host bound a writer, so a template can be offered at all. */\n get available(): boolean {\n return this.#writer !== null;\n }\n\n /**\n * Builds the template for `input` — its option lists loaded — has the\n * writer serialise it and offers the file for download. Rejects with the\n * writer's error verbatim (its message is meant for the user) and does\n * nothing outside a browser.\n */\n async download(input: FormColumnInputs): Promise<void> {\n if (!this.#writer) {\n throw new Error('No spreadsheet writer is bound — pass one to withSpreadsheetImport().');\n }\n if (!isPlatformBrowser(this.#platformId)) return;\n const options = await this.#loadOptions(input);\n const file = await this.#writer(buildImportTemplate(input, { options }));\n saveFile(this.#document, file);\n }\n\n /**\n * The field's option lists, or `undefined` when they could not be loaded —\n * reported, not swallowed, and the template goes out without them.\n */\n async #loadOptions(input: FormColumnInputs): Promise<ImportOptionLists | undefined> {\n try {\n return await this.#importCtrl.loadMultipleInputOptions(input);\n } catch (error: unknown) {\n this.#errorHandler.handleError(error);\n return undefined;\n }\n }\n}\n\n/** Hands `file` to the browser as a download, through a transient anchor. */\nfunction saveFile(document: Document, file: SpreadsheetSource): void {\n const win = document.defaultView;\n if (!win) return;\n const blob = new Blob([file.data], { type: file.mimeType || FALLBACK_MIME_TYPE });\n const url = win.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = file.fileName;\n link.rel = 'noopener';\n document.body.appendChild(link);\n link.click();\n link.remove();\n win.URL.revokeObjectURL(url);\n}\n","/**\n * @file Pure helpers behind the multiple-input import dialog's review.\n *\n * Turn an `ImportRowState` into what a dense review table shows — one line\n * per row: each cell as text, what the sheet said when the import swapped it\n * for an option's stored value, the cell's own error caption, the picker for\n * a text that fits several options — and, for the row's detail panel, every\n * issue in words, addressed to the column it has to be fixed in. Angular-free\n * so the dialog stays a thin renderer and this can be tested directly.\n */\nimport type { FormColumnInputs, ImportOptionChoice, ImportRowState, ImportRowStatus } from 'ngx-t-forms-types';\n\nimport type { ImportColumn } from '../../../../../../services/core/t-form-import-controller/functions/importTemplate';\nimport { normaliseOptionText, optionInputKind } from '../../../../../../services/core/t-form-import-controller/functions/optionValueResolution';\n\n/** How a review row is shown: its import status, or `choice` while an option pick is what it waits for. */\nexport type ReviewStatus = ImportRowStatus | 'choice';\n\n/** One thing wrong with a row, addressed to the column it has to be fixed in. */\nexport interface ReviewIssue {\n /** Column key the issue belongs to — empty for a failure of the row itself. */\n readonly key: string;\n /** Column label as the table shows it. */\n readonly column: string;\n readonly message: string;\n /** `warning` for an overridable validation, which the row editor lets through with a reason. */\n readonly kind: 'error' | 'warning';\n}\n\n/** One cell of the review table. */\nexport interface ReviewCell {\n /** The column's key — the child's `formControlName` — for a pick. */\n readonly key: string;\n /** The column's label, for the picker's accessible name. */\n readonly label: string;\n /** The settled value as one line of text; the raw cell until the row settles. */\n readonly text: string;\n /** What the sheet said, when the import matched it to an option and stored that option's value instead. */\n readonly typed?: string;\n /** The cell's error caption — never the tie itself, which the picker answers. */\n readonly error?: string;\n /** Texts of this cell that fit several options — the user picks one per text. */\n readonly choices?: readonly ImportOptionChoice[];\n}\n\n/** A child column a unique key may be picked from, or an issue counted against. */\nexport interface ChildColumn {\n readonly key: string;\n readonly label: string;\n}\n\n/** Error key prefix of a choice cell whose text fits several options; shown as a picker, not as an error. */\nexport const AMBIGUOUS_OPTION_KEY = 'ambiguousOption:';\n\n/** Longest cell text rendered before it is cut with an ellipsis. */\nexport const MAX_CELL_TEXT = 80;\n\n/** Short, user-facing wording for the validator keys the tower reports. */\nconst ERROR_LABELS: Record<string, string> = {\n required: 'Required',\n min: 'Too low',\n max: 'Too high',\n minlength: 'Too short',\n maxlength: 'Too long',\n pattern: 'Wrong format',\n email: 'Not an email',\n invalidDate: 'Not a date',\n invalidOption: 'Not an option',\n ambiguousOption: 'Several matches',\n optionsUnavailable: 'Options did not load',\n documentLookupFailed: 'Could not look up the transaction',\n invalidRichText: 'Not a rich-text document',\n};\n\n/** `'required.min'` → `'Required, Too low'`. Unknown keys are shown as they are. */\nexport function formatErrorKeys(keys: string): string {\n return keys\n .split('.')\n .filter(Boolean)\n .map((key) => {\n const [head, ...rest] = key.split(':');\n const label = ERROR_LABELS[head ?? ''] ?? key;\n return rest.length ? `${label} (${rest.join(':')})` : label;\n })\n .join(', ');\n}\n\n/** The cell's error caption with the tie's own keys dropped — the picker answers those. */\nexport function plainCellError(state: ImportRowState, key: string): string | undefined {\n const others = (state.colErrors?.[key] ?? '')\n .split('.')\n .filter((k) => k && !k.startsWith(AMBIGUOUS_OPTION_KEY))\n .join('.');\n return others ? formatErrorKeys(others) : undefined;\n}\n\n/** `true` while a row waits on the user to settle a choice cell (its only route out of `invalid` is a pick). */\nexport function awaitsPick(state: ImportRowState): boolean {\n return state.status === 'invalid' && Object.values(state.optionChoices ?? {}).some((choices) => choices.length > 0);\n}\n\n/** How the row reads in the review: a repeat of an earlier row, a pick to make, or its status. */\nexport function reviewStatus(state: ImportRowState): ReviewStatus {\n if (state.duplicateOf !== undefined) return 'duplicate';\n return awaitsPick(state) ? 'choice' : state.status;\n}\n\n/** Keys of the children whose cell the import may rewrite — it accepts the option as the user sees it. */\nexport function choiceKeys(input: Pick<FormColumnInputs, 'formInputs'>): ReadonlySet<string> {\n return new Set(\n (input.formInputs ?? [])\n .filter((child): child is FormColumnInputs => !!child?.formControlName && optionInputKind(child) !== undefined)\n .map((child) => child.formControlName),\n );\n}\n\n/** The field's children by id, as columns — overridable validations are reported by input id. */\nexport function childrenById(input: Pick<FormColumnInputs, 'formInputs'>): ReadonlyMap<string, ChildColumn> {\n return new Map(\n (input.formInputs ?? [])\n .filter((child): child is FormColumnInputs => !!child?.id && !!child.formControlName)\n .map((child) => [child.id, { key: child.formControlName, label: child.label || child.formControlName }]),\n );\n}\n\n/**\n * A cell as one line of text: a linked transaction by its reference, a list\n * of primitives joined, a list of rows by its size, any other object as JSON.\n */\nexport function cellText(value: unknown): string {\n const text = plainText(value);\n return text.length > MAX_CELL_TEXT ? `${text.slice(0, MAX_CELL_TEXT - 1)}…` : text;\n}\n\n/**\n * What the sheet said for a choice cell, when it differs from the value the\n * import stored — a sheet that said \"Acme Ltd\" reads back as `sup-1`, which is\n * right but not what the user recognises, so both are shown.\n */\nexport function typedText(state: ImportRowState, key: string): string | undefined {\n const typed = state.originalData?.[key];\n if (typed === null || typed === undefined || typeof typed === 'object') return undefined;\n const text = String(typed).trim();\n if (!text) return undefined;\n const stored = state.settledValue?.[key];\n if (stored === null || stored === undefined) return undefined;\n return normaliseOptionText(text) === normaliseOptionText(plainText(stored)) ? undefined : text;\n}\n\n/** One review cell: the settled text, what was typed, the caption, the picker. */\nexport function buildCell(state: ImportRowState, column: ImportColumn, isChoice: boolean): ReviewCell {\n const source = state.settledValue ?? state.originalData;\n const base: ReviewCell = { key: column.key, label: column.label, text: cellText(valueAt(source, column.key)) };\n const typed = isChoice ? typedText(state, column.key) : undefined;\n const withTyped = typed ? { ...base, typed } : base;\n\n const choices = state.optionChoices?.[column.key];\n if (choices?.length) {\n const error = plainCellError(state, column.key);\n return { ...withTyped, ...(error ? { error } : {}), choices: choices.map(tellApart) };\n }\n const errorKeys = state.colErrors?.[column.key];\n if (errorKeys) return { ...withTyped, error: formatErrorKeys(errorKeys) };\n const account = accountCellError(state, column.key);\n return account ? { ...withTyped, error: account } : withTyped;\n}\n\n/**\n * A cell's value by its column key: the key itself, else — for an mSCOA\n * column like `fund.accrual.FUND.debit` — the member down that path, which is\n * where a settled row holds the account it resolved.\n */\nfunction valueAt(source: Record<string, unknown> | undefined, key: string): unknown {\n if (!source || key in source) return source?.[key];\n let node: unknown = source;\n for (const part of key.split('.')) {\n if (node === null || typeof node !== 'object') return undefined;\n node = (node as Record<string, unknown>)[part];\n }\n return node;\n}\n\n/** `accrual.FUND.debitNotFound` and its kin — an mSCOA lookup failure, reported on the mSCOA field. */\nconst ACCOUNT_ERROR = /^(accrual|cash)\\.([^.]+)\\.(debit|credit)(NotFound|Missing)$/;\n\n/**\n * The caption of an mSCOA account column (`<field>.<basis>.<SEGMENT>.<side>`):\n * the import reports a failed lookup on the field as a whole, so the caption\n * is picked out of the field's errors by basis, segment and side.\n */\nfunction accountCellError(state: ImportRowState, key: string): string | undefined {\n const [field, basis, segment, side] = key.split('.');\n if (!field || !side) return undefined;\n for (const error of accountErrors(state.colErrors?.[field] ?? '')) {\n if (error.basis === basis && error.segment === segment && error.side === side) return error.missing ? 'Missing' : 'Not an account';\n }\n return undefined;\n}\n\n/** The mSCOA lookup failures among a field's error keys, which join their own dots into the list. */\nfunction accountErrors(keys: string): { basis: string; segment: string; side: string; missing: boolean; text: string }[] {\n const parts = keys.split('.');\n const found: { basis: string; segment: string; side: string; missing: boolean; text: string }[] = [];\n for (let i = 0; i + 2 < parts.length; i++) {\n const match = ACCOUNT_ERROR.exec(parts.slice(i, i + 3).join('.'));\n if (!match) continue;\n const [, basis = '', segment = '', side = '', kind] = match;\n const missing = kind === 'Missing';\n const where = `${basis === 'cash' ? 'Cash' : 'Accrual'} ${segment} ${side}`;\n found.push({ basis, segment, side, missing, text: missing ? `${where} account is missing` : `${where} account was not found` });\n i += 2;\n }\n return found;\n}\n\n/**\n * Everything wrong with a row, as a flat list addressed to the place it has\n * to be fixed: a failure of the row itself first, then each column's errors\n * (a tie as \"pick one in the cell\"), then the overridable warnings.\n */\nexport function rowIssues(\n state: ImportRowState,\n columns: readonly ImportColumn[],\n children: ReadonlyMap<string, ChildColumn>,\n): ReviewIssue[] {\n const issues: ReviewIssue[] = [];\n if (state.errorMessage) issues.push({ key: '', column: 'Row', message: state.errorMessage, kind: 'error' });\n\n for (const [key, keys] of Object.entries(state.colErrors ?? {})) {\n if (!keys) continue;\n // An mSCOA field's errors belong to its account columns, labelled \"<field> · <segment> <basis> <side>\".\n const column =\n columns.find((c) => c.key === key)?.label ??\n columns.find((c) => c.key.startsWith(`${key}.`))?.label.split(' · ')[0] ??\n key;\n issues.push({ key, column, message: issueMessage(keys), kind: 'error' });\n }\n for (const [inputId, messages] of Object.entries(state.overridableErrors ?? {})) {\n const child = children.get(inputId);\n for (const message of messages) {\n issues.push({ key: child?.key ?? inputId, column: child?.label ?? inputId, message, kind: 'warning' });\n }\n }\n return issues;\n}\n\n/**\n * Makes a choice's candidates tell apart in a picker: two candidates that read\n * the same (two options labelled \"Beta\") show their stored value as well.\n */\nexport function tellApart(choice: ImportOptionChoice): ImportOptionChoice {\n const labels = choice.candidates.map((candidate) => normaliseOptionText(candidate.label));\n return {\n text: choice.text,\n candidates: choice.candidates.map((candidate, index) => {\n const clashes = labels.some((label, other) => other !== index && label === labels[index]);\n const label = clashes ? `${candidate.label} (${String(candidate.value)})` : candidate.label;\n return { value: candidate.value, label: label.length > MAX_CELL_TEXT ? `${label.slice(0, MAX_CELL_TEXT - 1)}…` : label };\n }),\n };\n}\n\n/** A column's error keys in words, the tie spelled out as the pick it waits for. */\nfunction issueMessage(keys: string): string {\n const accounts = accountErrors(keys);\n let remaining = keys;\n for (const account of accounts) {\n remaining = remaining.replace(`${account.basis}.${account.segment}.${account.side}${account.missing ? 'Missing' : 'NotFound'}`, '');\n }\n const parts = remaining.split('.').filter(Boolean);\n const ties = parts.filter((k) => k.startsWith(AMBIGUOUS_OPTION_KEY)).map((k) => k.slice(AMBIGUOUS_OPTION_KEY.length));\n const rest = parts.filter((k) => !k.startsWith(AMBIGUOUS_OPTION_KEY));\n const out: string[] = accounts.map((account) => account.text);\n if (ties.length) out.push(`Several matches for ${ties.map((tie) => `“${tie}”`).join(', ')} — pick one in the cell`);\n if (rest.length) out.push(formatErrorKeys(rest.join('.')));\n return out.join('. ');\n}\n\n/** A cell as one line of text, uncut — {@link cellText} without the length limit. */\nexport function plainText(value: unknown): string {\n if (value === null || value === undefined) return '';\n // The local calendar day: the import settles a date to local midnight, which in UTC is the day before east of Greenwich.\n if (value instanceof Date) {\n if (Number.isNaN(value.getTime())) return '';\n return `${value.getFullYear()}-${String(value.getMonth() + 1).padStart(2, '0')}-${String(value.getDate()).padStart(2, '0')}`;\n }\n if (Array.isArray(value)) {\n if (value.every((entry) => entry === null || typeof entry !== 'object')) {\n return value.map((entry) => plainText(entry)).filter(Boolean).join(', ');\n }\n return `${value.length} ${value.length === 1 ? 'row' : 'rows'}`;\n }\n if (typeof value === 'object') {\n const linked = documentText(value as Record<string, unknown>);\n if (linked !== undefined) return linked;\n // An mSCOA account reads as the code the sheet names it by.\n const account = (value as Record<string, unknown>)['SCOAAccount'];\n if (typeof account === 'string' && account.trim()) return account;\n try {\n return JSON.stringify(value);\n } catch {\n return '';\n }\n }\n return String(value);\n}\n\n/** A stored transaction link as the picker shows it: its reference, else its label, else its identifier. */\nfunction documentText(value: Record<string, unknown>): string | undefined {\n if (typeof value['id'] !== 'string' || typeof value['workflowId'] !== 'string') return undefined;\n const reference = value['reference'];\n const label = value['label'];\n if (typeof reference === 'string' && reference.trim()) return reference;\n if (typeof label === 'string' && label.trim()) return label;\n return value['id'] as string;\n}\n","/**\n * @file Pure helpers behind the multiple-input import dialog's setup: the\n * uploaded file as grids the mapper reads, and the duplicate settings — which\n * children can rank or combine a repeated row, what the chosen keys do to the\n * file before anything is checked, and where a combined value came from.\n * Angular-free so the dialog stays a thin renderer and this can be tested\n * directly.\n */\nimport { ElementTypes, InputDataTypes, InputTypes } from 'ngx-t-forms-types';\nimport type { FormColumnInputs, ImportCombineOp, ImportCombinedValue, SourceSheet } from 'ngx-t-forms-types';\n\nimport type { SpreadsheetSheet } from '../../../../../../domain/spreadsheet-import.model';\nimport { collectableRows, joinableTexts } from '../../../../../../services/core/t-form-import-controller/functions/combineDuplicates';\nimport { TEMPLATE_GUIDE_SHEET, TEMPLATE_OPTIONS_SHEET } from '../../../../../../services/core/t-form-import-controller/functions/importTemplate';\nimport { normaliseOptionText } from '../../../../../../services/core/t-form-import-controller/functions/optionValueResolution';\nimport { rowIdentityKey } from '../../../../../../services/core/t-form-import-controller/functions/rowIdentity';\nimport { plainText } from './import-review';\n\n/** Which row a group of repeated rows keeps. */\nexport type KeepChoice = 'first' | 'last' | 'latest';\n\n/** How a repeated row's field is filled — the kept row's own value, or the group's combined one. */\nexport type CombineChoice = 'kept' | ImportCombineOp;\n\n/** What a field holds, as far as combining its repeats goes: a number to add up, text to collect, or list rows to gather. */\nexport type CombineKind = 'number' | 'text' | 'list';\n\n/** One way a field of a repeated row can be filled, as the picker lists it. */\nexport interface CombineChoiceOption {\n readonly value: CombineChoice;\n readonly label: string;\n}\n\n/** The ways a number field of a repeated row can be filled, in the order the picker lists them. */\nexport const COMBINE_CHOICES: readonly CombineChoiceOption[] = [\n { value: 'kept', label: \"Kept row's value\" },\n { value: 'sum', label: 'Add up (sum)' },\n { value: 'avg', label: 'Average' },\n { value: 'max', label: 'Highest' },\n { value: 'min', label: 'Lowest' },\n];\n\n/** The ways a text or multi-select field of a repeated row can be filled. */\nexport const TEXT_COMBINE_CHOICES: readonly CombineChoiceOption[] = [\n { value: 'kept', label: \"Kept row's value\" },\n { value: 'join', label: 'Collect every value (comma-separated)' },\n];\n\n/** The ways a list field of a repeated row can be filled. */\nexport const LIST_COMBINE_CHOICES: readonly CombineChoiceOption[] = [\n { value: 'kept', label: \"Kept row's rows\" },\n { value: 'collect', label: 'Gather the rows of every repeat' },\n];\n\n/** The choices the combine picker of `child` lists, by what the child holds. */\nexport function combineChoicesFor(child: FormColumnInputs): readonly CombineChoiceOption[] {\n const kind = combineKind(child);\n return kind === 'list' ? LIST_COMBINE_CHOICES : kind === 'text' ? TEXT_COMBINE_CHOICES : COMBINE_CHOICES;\n}\n\n/** \"Sum\" — the word for a combined value's op. */\nexport const COMBINE_VERBS: Readonly<Record<ImportCombineOp, string>> = {\n sum: 'Sum',\n avg: 'Average',\n max: 'Highest',\n min: 'Lowest',\n join: 'Every value',\n collect: 'Every row',\n};\n\n/** What the chosen keys do to the file, counted before any row is checked. */\nexport interface RepeatPreview {\n /** Rows the mapping makes. */\n readonly records: number;\n /** Rows left once repeats are set aside. */\n readonly unique: number;\n /** Rows set aside as repeats. */\n readonly repeats: number;\n /**\n * Fields whose value differs between the rows of a repeat, with what keeping\n * one row leaves out: an amount for a number, a count of values for text, a\n * count of rows for a list.\n */\n readonly differing: readonly {\n readonly key: string;\n readonly label: string;\n readonly kind: CombineKind;\n readonly records: number;\n readonly leftOut: string;\n }[];\n}\n\n/** The template's sheets that hold no data. */\nconst INFO_SHEETS: ReadonlySet<string> = new Set([TEMPLATE_GUIDE_SHEET, TEMPLATE_OPTIONS_SHEET]);\n\n/** Pickers whose value is a date. */\nconst DATE_ELEMENTS: ReadonlySet<ElementTypes> = new Set([ElementTypes.DatePicker, ElementTypes.DateTimePicker]);\n\n/** Input types that hold a number or a date. */\nconst ORDERED_INPUT_TYPES: ReadonlySet<InputTypes> = new Set([InputTypes.Number, InputTypes.Date, InputTypes.DateTimeLocal]);\n\nconst AMOUNT = new Intl.NumberFormat(undefined, { maximumFractionDigits: 2 });\n\n/**\n * The data sheets of a parsed workbook as grids of cell texts — the parser's\n * own grid when it gave one, else row 1 rebuilt from the headers its rows\n * carry. The template's `Guide` and `Options` sheets are left out.\n */\nexport function toSourceSheets(sheets: readonly SpreadsheetSheet[]): SourceSheet[] {\n return sheets\n .filter((sheet) => !!sheet && Array.isArray(sheet.rows) && !INFO_SHEETS.has(sheet.name))\n .map((sheet) => ({ name: sheet.name, grid: sheet.grid ? sheet.grid.map((row) => row.map(sourceText)) : gridOf(sheet.rows) }));\n}\n\n/** Header-keyed rows as a grid: the headers in first-seen order, then one line per row. */\nfunction gridOf(rows: readonly Record<string, unknown>[]): string[][] {\n const headers = [...new Set(rows.flatMap((row) => (row && typeof row === 'object' ? Object.keys(row) : [])))];\n return [headers, ...rows.map((row) => headers.map((header) => sourceText(row?.[header])))];\n}\n\n/**\n * A parsed cell as the mapper reads it: trimmed text, a date as its local\n * calendar day (with the time when it has one), a number as written.\n */\nfunction sourceText(value: unknown): string {\n if (value instanceof Date) {\n if (Number.isNaN(value.getTime())) return '';\n const day = `${value.getFullYear()}-${pad(value.getMonth() + 1)}-${pad(value.getDate())}`;\n const midnight = value.getHours() === 0 && value.getMinutes() === 0 && value.getSeconds() === 0;\n return midnight ? day : `${day}T${pad(value.getHours())}:${pad(value.getMinutes())}`;\n }\n return plainText(value).trim();\n}\n\nfunction pad(n: number): string {\n return String(n).padStart(2, '0');\n}\n\n/** Whether a child's values have an order a \"latest\" row can be picked by: a date or a number. */\nexport function isOrderedChild(child: FormColumnInputs): boolean {\n if (DATE_ELEMENTS.has(child.element)) return true;\n if (child.element !== ElementTypes.Input) return false;\n return (\n child.dataType === InputDataTypes.Number ||\n child.dataType === InputDataTypes.Date ||\n (child.type !== undefined && ORDERED_INPUT_TYPES.has(child.type))\n );\n}\n\n/** Input types whose cell is text a `join` can collect. */\nconst TEXT_INPUT_TYPES: ReadonlySet<InputTypes> = new Set([\n InputTypes.Text,\n InputTypes.Email,\n InputTypes.Tel,\n InputTypes.Url,\n InputTypes.Search,\n]);\n\n/**\n * What a repeated row can take from its whole group for `child`: a `number`\n * to add up or average, `text` to collect every value of — typed text, or a\n * choice the user may pick several of, whose cell lists them — or the rows\n * of a `list`. `undefined` for a child that cannot be combined: a calculated\n * one is worked out again from the combined inputs, so combining it would be\n * overwritten; a single choice, a date or a file has one value, not several.\n */\nexport function combineKind(child: FormColumnInputs): CombineKind | undefined {\n if (child.isCalculatedField) return undefined;\n switch (child.element) {\n case ElementTypes.MultipleInput:\n return 'list';\n case ElementTypes.Textarea:\n return 'text';\n case ElementTypes.Input:\n if (child.dataType === InputDataTypes.Number || child.type === InputTypes.Number) return 'number';\n if (child.dataType === InputDataTypes.Date || (child.type !== undefined && !TEXT_INPUT_TYPES.has(child.type))) return undefined;\n return 'text';\n case ElementTypes.Select:\n case ElementTypes.IconSelect:\n case ElementTypes.AutoCompleteInput:\n case ElementTypes.PaginatedSelectionTable:\n return child.allowMultipleSelection === true ? 'text' : undefined;\n default:\n return undefined;\n }\n}\n\n/** Whether a repeated row can take a child's value from its whole group — see {@link combineKind}. */\nexport function isCombinableChild(child: FormColumnInputs): boolean {\n return combineKind(child) !== undefined;\n}\n\n/** A cell as a number, or `undefined` for a blank or a non-number. */\nexport function numberOf(value: unknown): number | undefined {\n if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;\n const text = plainText(value).replace(/[\\s,]/g, '');\n if (text === '') return undefined;\n const parsed = Number(text);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n\n/**\n * What `keys` do to `records`, counted on the mapped rows themselves — the\n * way the import compares them before any row settles — before any is checked: how many repeat, and for each number field not already\n * combined whose value differs between a repeat's rows, how much the kept row\n * alone would leave out — so \"keep one row\" never silently drops an amount.\n * `undefined` without keys or rows.\n *\n * @param records The mapped rows.\n * @param keys The unique keys.\n * @param keep Which row of a repeat is kept; `latest` is counted as `first`.\n * @param candidates The children a repeat can combine — numbers, texts and lists.\n * @param combined The children already combined.\n */\nexport function repeatPreview(\n records: readonly Record<string, unknown>[],\n keys: readonly string[],\n keep: KeepChoice,\n candidates: readonly FormColumnInputs[],\n combined: Readonly<Record<string, ImportCombineOp>>,\n): RepeatPreview | undefined {\n if (keys.length === 0 || records.length === 0) return undefined;\n\n const groups = new Map<string, Record<string, unknown>[]>();\n let blank = 0;\n for (const record of records) {\n // The controller's own raw identity, so the count is the one the check will reach before any row settles.\n const id = rowIdentityKey(record, keys);\n if (id === undefined) {\n blank++;\n continue;\n }\n const group = groups.get(id);\n if (group) group.push(record);\n else groups.set(id, [record]);\n }\n const unique = groups.size + blank;\n\n const differing = candidates\n .filter((child) => !combined[child.formControlName])\n .map((child) => {\n const kind = combineKind(child) ?? 'number';\n let count = 0;\n let leftOut = 0;\n for (const group of groups.values()) {\n if (group.length < 2) continue;\n const keptAt = keep === 'last' ? group.length - 1 : 0;\n const missed = leftOutOf(\n group.map((record) => record[child.formControlName]),\n keptAt,\n kind,\n );\n if (missed === undefined) continue;\n count++;\n leftOut += missed;\n }\n return {\n key: child.formControlName,\n label: child.label || child.formControlName,\n kind,\n records: count,\n leftOut: leftOutText(leftOut, kind),\n };\n })\n .filter((field) => field.records > 0);\n\n return { records: records.length, unique, repeats: records.length - unique, differing };\n}\n\n/**\n * What keeping the row at `keptAt` leaves out of `cells`, one group's cells of\n * a field: the other rows' numbers added up (when the numbers differ), the\n * distinct values the kept cell lacks, or the other rows' list rows — or\n * `undefined` when nothing is lost.\n */\nfunction leftOutOf(cells: readonly unknown[], keptAt: number, kind: CombineKind): number | undefined {\n if (kind === 'number') {\n const values = cells.map((cell) => numberOf(cell) ?? 0);\n if (new Set(values).size < 2) return undefined;\n return values.reduce((sum, value, i) => (i === keptAt ? sum : sum + value), 0);\n }\n if (kind === 'list') {\n const rows = cells.reduce<number>((sum, cell, i) => (i === keptAt ? sum : sum + (collectableRows(cell)?.length ?? 0)), 0);\n return rows > 0 ? rows : undefined;\n }\n const kept = new Set((joinableTexts(cells[keptAt]) ?? []).map(normaliseOptionText));\n const missed = new Set<string>();\n cells.forEach((cell, i) => {\n if (i === keptAt) return;\n for (const text of joinableTexts(cell) ?? []) {\n const key = normaliseOptionText(text);\n if (key !== '' && !kept.has(key)) missed.add(key);\n }\n });\n return missed.size > 0 ? missed.size : undefined;\n}\n\n/** \"1 500\", \"3 values\", \"5 rows\" — what keeping one row leaves out, said for the kind of field. */\nfunction leftOutText(amount: number, kind: CombineKind): string {\n if (kind === 'number') return AMOUNT.format(amount);\n const noun = kind === 'list' ? 'row' : 'value';\n return `${amount} ${amount === 1 ? noun : `${noun}s`}`;\n}\n\n/** \"row 3\", \"rows 3, 5 and 9\" — rows by one-based number, from `rowIndex`es. */\nexport function rowsPhrase(indexes: readonly number[], capital = false): string {\n const numbers = indexes.map((index) => index + 1);\n const word = `${capital ? 'R' : 'r'}ow${numbers.length === 1 ? '' : 's'}`;\n const list = numbers.length === 1 ? `${numbers[0]}` : `${numbers.slice(0, -1).join(', ')} and ${numbers[numbers.length - 1]}`;\n return `${word} ${list}`;\n}\n\n/**\n * \"Amount: sum of rows 3, 5 and 9. Row 7 is blank and left out.\" — where a\n * combined value came from; for `join`, \"every value of rows …,\n * comma-separated\"; for `collect`, \"the rows of rows …, gathered (12 rows)\".\n */\nexport function combineNote(label: string, value: ImportCombinedValue): string {\n if (value.rejected.length) {\n const verb = value.rejected.length === 1 ? 'holds' : 'hold';\n const what =\n value.op === 'join' ? 'a value that is not text' : value.op === 'collect' ? 'something that is not a list of rows' : 'text that is not a number';\n return `${label}: not combined — ${rowsPhrase(value.rejected)} ${verb} ${what}. Fix the sheet and upload it again.`;\n }\n if (!value.counted.length) return `${label}: blank in every row, so there is nothing to combine.`;\n const blank = value.rows.filter((index) => !value.counted.includes(index));\n const tail = blank.length ? ` ${rowsPhrase(blank, true)} ${blank.length === 1 ? 'is' : 'are'} blank and left out.` : '';\n if (value.op === 'join') return `${label}: every value of ${rowsPhrase(value.counted)}, comma-separated.${tail}`;\n if (value.op === 'collect') {\n const items = value.items === undefined ? '' : ` (${value.items} ${value.items === 1 ? 'row' : 'rows'})`;\n return `${label}: the rows of ${rowsPhrase(value.counted)}, gathered${items}.${tail}`;\n }\n return `${label}: ${COMBINE_VERBS[value.op].toLowerCase()} of ${rowsPhrase(value.counted)}.${tail}`;\n}\n","import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n inject,\n signal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { firstValueFrom, type Observable } from 'rxjs';\nimport { v4 as uuidv4 } from 'uuid';\nimport { SOURCE_ROWS_KEY } from 'ngx-t-forms-types';\nimport type {\n FormColumnInputs,\n ImportCombineOp,\n ImportIdentity,\n ImportOptionChoice,\n ImportProgress,\n ImportRecipe,\n ImportRowState,\n SavedRecipeMatch,\n SourceSheet,\n SourceTable,\n} from 'ngx-t-forms-types';\n\nimport { ImportChoiceMapperComponent } from '../../../../../import-mapper/choice-mapper/choice-mapper.component';\nimport { ImportColumnMapperComponent } from '../../../../../import-mapper/column-mapper/column-mapper.component';\nimport { ImportRecipeSaveComponent } from '../../../../../import-mapper/recipe-save/recipe-save.component';\nimport { ImportRowRulesComponent } from '../../../../../import-mapper/row-rules/row-rules.component';\nimport { ImportSavedMappingsComponent, type OtherSavedMapping } from '../../../../../import-mapper/saved-mappings/saved-mappings.component';\nimport { buildSourceIndex, describeSourceRows, type SourceIndex } from '../../../../../import-mapper/source-mapper.model';\nimport type { ImportRecipeConflict, ImportRecipeStore, ImportRecipeWriteResult } from '../../../../../../domain/import-recipe-store.model';\nimport type { SpreadsheetSheet } from '../../../../../../domain/spreadsheet-import.model';\nimport { TFormImportController, type ImportRunState } from '../../../../../../services/core/t-form-import-controller/t-form-import-controller';\nimport {\n applyOptionChoice,\n isMultiSelectInput,\n normaliseOptionText,\n} from '../../../../../../services/core/t-form-import-controller/functions/optionValueResolution';\nimport {\n TEMPLATE_GUIDE_SHEET,\n describeImportColumns,\n type ImportColumn,\n type ImportOptionLists,\n} from '../../../../../../services/core/t-form-import-controller/functions/importTemplate';\nimport { applyFieldRecipe } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/applyRecipe';\nimport { checkFieldRecipe } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/checkRecipe';\nimport { columnCellText } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/columnCell';\nimport { fieldRecipeScope, matchSavedFieldRecipes } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/fieldRecipe';\nimport { headerSignature, headerSimilarity } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/headerMatching';\nimport { recipeSettingsOf, withRecipeSettings } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/recipeSettings';\nimport { guessHeaderRow, toSourceTable } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/sourceTable';\nimport { suggestFieldRecipe } from '../../../../../../services/core/t-form-import-controller/functions/sourceMapping/suggestRecipe';\nimport { buildUniqueKeyOptions, type UniqueKeyOption } from '../../../../../../shared/functions/uniqueKeyOptions';\nimport { IMPORT_RECIPE_STORE } from '../../../../../../tokens/import-recipe-store.token';\nimport { SPREADSHEET_PARSER } from '../../../../../../tokens/spreadsheet-parser.token';\nimport { SpreadsheetTemplateService } from '../spreadsheet-template/spreadsheet-template.service';\nimport {\n buildCell,\n childrenById,\n choiceKeys,\n reviewStatus,\n rowIssues,\n type ReviewCell,\n type ReviewIssue,\n type ReviewStatus,\n} from './import-review';\nimport {\n COMBINE_VERBS,\n combineChoicesFor,\n combineKind,\n combineNote,\n isCombinableChild,\n isOrderedChild,\n repeatPreview,\n rowsPhrase,\n toSourceSheets,\n type CombineChoice,\n type KeepChoice,\n type RepeatPreview,\n} from './import-setup';\n\n/** Data handed to {@link MultipleInputImportDialogComponent} via `MAT_DIALOG_DATA`. */\nexport interface MultipleInputImportDialogData {\n /** The multiple-input field being filled. Its `formInputs` define the columns. */\n readonly input: FormColumnInputs;\n /** Rows already in the table, for the summary line. */\n readonly existingRowCount: number;\n}\n\n/**\n * What the dialog resolves with: the settled, valid rows keyed by child\n * `formControlName` (plus `id`), or `undefined` when nothing is to be added.\n */\nexport type MultipleInputImportDialogResult = Record<string, unknown>[] | undefined;\n\n/** The width the dialog opens at — and returns to when full screen is left. */\nexport const MULTIPLE_INPUT_IMPORT_DIALOG_WIDTH = 'min(72rem, 94vw)';\n\n/** Panel class carried while the dialog fills the viewport. */\nconst FULLSCREEN_PANEL_CLASS = 'lib-multiple-input-import-dialog__panel--fullscreen';\n\n/** Where the rows are in their check: none run yet, the file being read, rows being checked, or checked. */\ntype Stage = 'idle' | 'reading' | 'validating' | 'reviewed';\n\n/** The dialog's four steps, in order. */\ntype Step = 'upload' | 'match' | 'duplicates' | 'review';\n\n/** What the side panel of the Match step shows. */\ntype Panel = 'rows' | 'saved' | 'save';\n\nconst STEPS: readonly { readonly id: Step; readonly label: string }[] = [\n { id: 'upload', label: 'Upload' },\n { id: 'match', label: 'Match columns' },\n { id: 'duplicates', label: 'Duplicates' },\n { id: 'review', label: 'Check & add' },\n];\n\n/** One review cell, with where a combined value came from. */\ninterface ReviewRowCell extends ReviewCell {\n /** How the value was combined from the row's repeats, in words. */\n readonly combined?: string;\n}\n\n/** One row of the review table. */\ninterface ReviewRow {\n readonly index: number;\n readonly status: ReviewStatus;\n readonly label: string;\n readonly icon: string;\n /** `true` when the row is set aside or waits on the user — tinted in the table. */\n readonly held: boolean;\n readonly cells: readonly ReviewRowCell[];\n /** Everything wrong with the row, for its detail panel. */\n readonly issues: readonly ReviewIssue[];\n /** The row this one repeats, when it was set aside as a duplicate. */\n readonly duplicateOf?: number;\n /** The rows that repeat this one and are left out in its favour. */\n readonly repeatedBy: readonly number[];\n /** Where the row came from in the file — \"Sheet Lines · row 12\". */\n readonly source: string;\n /** How each combined value was worked out, in words. */\n readonly combinedNotes: readonly string[];\n /** A failure of the check itself, not of the sheet. */\n readonly systemError?: string;\n}\n\n/** The run's rows by outcome, for the verdict, the counts and the add button. */\ninterface ReviewStats {\n readonly total: number;\n /** Rows that will be added. */\n readonly ready: number;\n /** Rows set aside as a repeat of an earlier row. */\n readonly duplicates: number;\n /** Rows waiting on a match the user picks. */\n readonly picking: number;\n /** Rows with a warning to review. */\n readonly overridable: number;\n /** Rows the sheet has to fix. */\n readonly blocked: number;\n /** Rows the check itself failed on. */\n readonly failed: number;\n /** Rows still queued or checking — or, after a stop, never checked. */\n readonly queued: number;\n /** Every row that still wants something from the user. */\n readonly needsAttention: number;\n}\n\n/** What the toolbar's verdict pill says. */\ninterface Verdict {\n readonly kind: 'busy' | 'paused' | 'stopped' | 'warn' | 'ok';\n readonly icon: string;\n readonly text: string;\n}\n\n/** An option picked in the review, written into the row again whenever the rows are checked again. */\ninterface OptionPick {\n readonly key: string;\n readonly text: string;\n readonly value: unknown;\n readonly multi: boolean;\n}\n\n/** Chip label + icon per row status. Colour is never the only signal (GDP §2c). */\nconst STATUS_META: Record<ReviewStatus, { label: string; icon: string }> = {\n pending: { label: 'Queued', icon: 'schedule' },\n processing: { label: 'Checking', icon: 'hourglass_top' },\n valid: { label: 'Ready', icon: 'check_circle' },\n overridable: { label: 'Needs attention', icon: 'flag' },\n invalid: { label: 'Invalid', icon: 'error' },\n error: { label: 'Failed', icon: 'report' },\n duplicate: { label: 'Duplicate', icon: 'content_copy' },\n choice: { label: 'Pick a match', icon: 'rule' },\n};\n\n/** How a row never checked reads once the run was stopped. */\nconst NOT_CHECKED = { label: 'Not checked', icon: 'block' };\n\n/** Statuses that still want something from the user before the row can be added. */\nconst ATTENTION_STATUSES: ReadonlySet<ReviewStatus> = new Set(['choice', 'overridable', 'invalid', 'error']);\n\nconst EMPTY_PROGRESS: ImportProgress = {\n total: 0,\n pending: 0,\n processing: 0,\n complete: 0,\n valid: 0,\n overridable: 0,\n invalid: 0,\n error: 0,\n duplicate: 0,\n rows: [],\n};\n\n/**\n * Modal that fills a multiple-input table from a spreadsheet, in four steps.\n *\n * 1. **Upload** — the file (a sheet chooser when the workbook has several),\n * and the template to download when the host bound a writer, otherwise the\n * list of columns.\n * 2. **Match columns** — any file, the template or the user's own export, is\n * read through an import recipe: the dialog suggests which column feeds\n * which field, and the shared mapper lets the user fill a field from\n * another column, a fixed value or several columns joined, clean a column\n * with typed transforms, match its texts to options, and leave source rows\n * out by rule. A parser that returns grids lets the header row be picked.\n * With an {@link IMPORT_RECIPE_STORE} bound, a mapping can be saved for the\n * field and is offered — or, when it fits the file exactly, applied — the\n * next time a file of the same shape is uploaded.\n * 3. **Duplicates** — the columns a row must be unique on (an mSCOA child as\n * one dot-path key per account it captures), which row of a repeat is kept\n * (first, last, or the latest by a date or number), and, per number child,\n * whether the kept row takes its own value or the repeat's sum, average,\n * highest or lowest — counted on the file before anything is checked, so\n * keeping one row never silently drops an amount.\n * 4. **Check & add** — the review: one line per row, a verdict pill, the\n * counts by outcome, filters, a column chooser, per-cell pickers for a text\n * that fits several options, and a detail panel per row that also names the\n * rows a kept row stands for, how its values were combined, and offers to\n * keep a duplicate instead.\n *\n * Only rows that settle `valid` are added — the same bar the row editor's\n * Save button applies — so the dialog never puts a row in the table that the\n * form would have refused. The parser comes from {@link SPREADSHEET_PARSER};\n * this component is only reachable when one is bound. Internal to the\n * multiple-input element; not part of the public API.\n */\n@Component({\n selector: 'lib-multiple-input-import-dialog',\n templateUrl: './multiple-input-import-dialog.component.html',\n styleUrl: './multiple-input-import-dialog.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n host: {\n 'class': 'lib-multiple-input-import-dialog',\n '[attr.data-stage]': 'stage()',\n '[attr.data-step]': 'step()',\n '[attr.data-fullscreen]': 'isFullscreen() ? \"true\" : null',\n },\n imports: [\n ImportChoiceMapperComponent,\n ImportColumnMapperComponent,\n ImportRecipeSaveComponent,\n ImportRowRulesComponent,\n ImportSavedMappingsComponent,\n MatDialogModule,\n MatButtonModule,\n MatIconModule,\n MatMenuModule,\n MatProgressBarModule,\n MatTooltipModule,\n NgTemplateOutlet,\n ],\n})\nexport class MultipleInputImportDialogComponent {\n readonly #platformId = inject(PLATFORM_ID);\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #data = inject<MultipleInputImportDialogData>(MAT_DIALOG_DATA);\n readonly #dialogRef = inject<MatDialogRef<MultipleInputImportDialogComponent, MultipleInputImportDialogResult>>(MatDialogRef);\n readonly #parser = inject(SPREADSHEET_PARSER);\n readonly #importCtrl = inject(TFormImportController);\n readonly #templates = inject(SpreadsheetTemplateService);\n readonly #store = inject(IMPORT_RECIPE_STORE, { optional: true });\n\n readonly #input = this.#data.input;\n readonly #scope = fieldRecipeScope(this.#input);\n readonly #children: readonly FormColumnInputs[] = (this.#input.formInputs ?? []).filter(\n (child): child is FormColumnInputs => !!child?.formControlName,\n );\n\n /** The field's label, for the subtitle. */\n protected readonly fieldLabel: string = this.#input.label || this.#input.formControlName || 'this list';\n\n /** File types offered by the picker. The host's parser decides what it actually reads. */\n protected readonly accept = '.xlsx,.xlsm,.xls,.csv';\n\n /**\n * Whether a template can be downloaded (the host bound a writer). When it\n * can, the template stands in for the column list: the workbook carries the\n * headers and a guide, so there is nothing left to read off the dialog.\n */\n protected readonly canDownloadTemplate: boolean = this.#templates.available;\n\n /** Name of the template's guide sheet, for the wording beside the download. */\n protected readonly guideSheet: string = TEMPLATE_GUIDE_SHEET;\n\n /** Whether mappings can be saved and offered again — the host bound a store. */\n protected readonly canSaveMappings = !!this.#store;\n\n protected readonly steps = STEPS;\n\n /** The choices a child's combine picker lists — by what the child holds: a number, text or list rows. */\n protected readonly combineChoicesFor = combineChoicesFor;\n\n /**\n * The columns a row may be required to be unique on: each child as itself,\n * an mSCOA child as one dot path per account it captures — the options a\n * workflow's own unique-keys picker offers — leaving out children a cell\n * cannot fill, which every row would hold blank.\n */\n protected readonly keyOptions: readonly UniqueKeyOption[] = (() => {\n const importable = new Set(describeImportColumns(this.#input).filter((column) => column.importable).map((column) => column.key.split('.')[0]));\n return buildUniqueKeyOptions(this.#children).filter((option) => importable.has(option.value.split('.')[0]));\n })();\n\n /** The date and number children the latest row of a repeat can be told by. */\n protected readonly latestCandidates: readonly FormColumnInputs[] = this.#children.filter(isOrderedChild);\n\n readonly #choiceKeys = choiceKeys(this.#input);\n readonly #childrenById = childrenById(this.#input);\n\n protected readonly step = signal<Step>('upload');\n protected readonly stage = signal<Stage>('idle');\n protected readonly fileName = signal<string | undefined>(undefined);\n protected readonly error = signal<string | undefined>(undefined);\n protected readonly downloadingTemplate = signal(false);\n protected readonly templateError = signal<string | undefined>(undefined);\n\n /** The data sheets of the file, as grids. */\n protected readonly sheets = signal<readonly SourceSheet[]>([]);\n /** The sheet the rows are read from. */\n protected readonly activeSheet = signal<string | undefined>(undefined);\n /** 1-based row that holds the headers. */\n protected readonly headerRow = signal(1);\n /** Whether the parser gave grids, so the header row can be picked. */\n protected readonly headerRowPickable = signal(false);\n\n /** Option lists of the children, once loaded — they let texts be matched to options while mapping. */\n readonly #options = signal<ImportOptionLists | undefined>(undefined);\n /** True when the option lists could not be loaded; texts are then matched when the rows are checked. */\n protected readonly optionsFailed = signal(false);\n\n /** The mapping in use. */\n protected readonly recipe = signal<ImportRecipe | undefined>(undefined);\n /** True while the mapping is the dialog's own suggestion, untouched — it is re-suggested when the option lists arrive. */\n readonly #suggested = signal(false);\n /** The saved mapping applied on its own because it fits the file exactly; `null` once undone or edited away. */\n protected readonly autoSaved = signal<ImportRecipe | null>(null);\n\n /** The field's saved mappings, as last loaded or written. */\n protected readonly storedRecipes = signal<readonly ImportRecipe[]>([]);\n protected readonly recipeSaving = signal(false);\n protected readonly recipeConflict = signal<ImportRecipeConflict | null>(null);\n /** A failure to load or write saved mappings, in words. */\n protected readonly storeError = signal<string | undefined>(undefined);\n\n /** What the Match step's side panel shows; `null` when it is closed. */\n protected readonly panel = signal<Panel | null>(null);\n /** The choice field whose values are being matched to options; `null` shows the field list. */\n protected readonly choiceKey = signal<string | null>(null);\n\n /** Children a row must be unique on; a row repeating an earlier row's values on all of them is set aside. */\n protected readonly distinctKeys = signal<readonly string[]>([]);\n /** Which row of a repeat is kept. */\n protected readonly keep = signal<KeepChoice>('first');\n /** The date or number child \"the latest\" reads; `null` until one is picked. */\n protected readonly latestField = signal<string | null>(null);\n /** Number children whose value a repeat takes from all its rows rather than the kept row alone. */\n protected readonly combine = signal<Readonly<Record<string, ImportCombineOp>>>({});\n\n /** True while the dialog fills the viewport. */\n protected readonly isFullscreen = signal(false);\n /** True once a run was stopped with rows never checked. */\n protected readonly stopped = signal(false);\n /** Rows being re-checked after an option pick or a keep; their controls and the add button wait. */\n protected readonly rechecking = signal<ReadonlySet<number>>(new Set());\n /** True while the table is narrowed to the rows that still need the user. */\n protected readonly onlyAttention = signal(false);\n /** True while the table hides the rows set aside as duplicates. */\n protected readonly hideDuplicates = signal(false);\n /** Column keys the user has hidden to get the ones that matter side by side. */\n protected readonly hiddenColumns = signal<ReadonlySet<string>>(new Set());\n /** The one row whose detail panel is open, by index; `null` when none is. */\n protected readonly expandedRow = signal<number | null>(null);\n\n /** What the rows under review were checked with, so a step back that changes nothing does not check them again. */\n #runKey = '';\n /** The mapping the picks below were made under; a new mapping makes new rows, so they are dropped. */\n #picksKey = '';\n /** Options picked in the review, by row index. */\n readonly #picks = new Map<number, OptionPick[]>();\n\n /** Live per-row states from the controller; only read while a run belongs to this dialog. */\n protected readonly progress = toSignal(this.#importCtrl.progress$, { initialValue: EMPTY_PROGRESS });\n\n /** Where the controller's run stands — drives the pause / resume / stop controls. */\n protected readonly runState = toSignal(this.#importCtrl.runState$, { initialValue: 'idle' as ImportRunState });\n\n protected readonly paused = computed(() => this.runState() === 'paused');\n\n /** Reading the file or validating its rows — the picker, the steps and the sheet chooser wait. */\n protected readonly busy = computed(() => this.stage() === 'reading' || this.stage() === 'validating');\n\n /** The columns the sheet should carry, with the options of each choice child once loaded. */\n protected readonly columns = computed<readonly ImportColumn[]>(() => describeImportColumns(this.#input, this.#options()));\n\n /** The file's sheet the rows come from, as a grid. */\n readonly #sheet = computed(() => this.sheets().find((sheet) => sheet.name === this.activeSheet()));\n\n /** The active sheet read under the header row; new source row ids each time either changes. */\n protected readonly table = computed<SourceTable | undefined>(() => {\n const sheet = this.#sheet();\n return sheet ? toSourceTable(sheet, this.headerRow()) : undefined;\n });\n\n /** Source row id → where it sits in the file. */\n readonly #sourceIndex = computed<SourceIndex>(() => {\n const table = this.table();\n return table ? buildSourceIndex(table) : new Map();\n });\n\n /** The table's rows by source row id, to read back what the file said. */\n readonly #sourceRowsById = computed(() => new Map((this.table()?.rows ?? []).map((row) => [row.id, row])));\n\n /** The header rows the picker offers: the first rows of the sheet. */\n protected readonly headerRowChoices = computed<readonly number[]>(() => {\n const rows = Math.min(this.#sheet()?.grid.length ?? 1, 20);\n return Array.from({ length: Math.max(rows, 1) }, (_, i) => i + 1);\n });\n\n /** What is wrong with the mapping against this file. */\n protected readonly check = computed(() => {\n const recipe = this.recipe();\n const table = this.table();\n return recipe && table ? checkFieldRecipe(recipe, { input: this.#input, table, options: this.#options() }) : undefined;\n });\n\n /** The rows the mapping makes of the file, keyed by child `formControlName` and carrying their source row ids. */\n protected readonly mapped = computed(() => {\n const recipe = this.recipe();\n const table = this.table();\n return recipe && table ? applyFieldRecipe(table, recipe, this.#input, this.#options()) : undefined;\n });\n\n /** Labels of the required fields nothing fills. */\n protected readonly missingRequired = computed(() =>\n (this.check()?.issues ?? [])\n .filter((issue) => issue.blocking && issue.kind === 'requiredUnmapped')\n .map((issue) => this.columns().find((column) => column.key === issue.target)?.label ?? issue.target ?? issue.detail),\n );\n\n /** Every other blocking problem of the mapping, in words. */\n protected readonly mappingProblems = computed(() =>\n (this.check()?.issues ?? []).filter((issue) => issue.blocking && issue.kind !== 'requiredUnmapped').map((issue) => issue.detail),\n );\n\n /** True when the rows can be checked: nothing blocks and the mapping makes at least one row. */\n protected readonly mappingReady = computed(() => !!this.check()?.ok && (this.mapped()?.rows.length ?? 0) > 0);\n\n /** The Match step's one-line account of the mapping. */\n protected readonly mappingSummary = computed(() => {\n const mapped = this.mapped();\n const table = this.table();\n if (!mapped || !table) return '';\n const { requiredMapped, requiredTotal, filteredOut } = mapped.stats;\n const parts = [\n `${requiredMapped} of ${requiredTotal} required ${requiredTotal === 1 ? 'field' : 'fields'} filled`,\n `${mapped.rows.length} of ${table.rows.length} ${table.rows.length === 1 ? 'row' : 'rows'} to check`,\n ];\n if (filteredOut > 0) parts.push(`${filteredOut} left out by row rules`);\n const unmatched = Object.values(mapped.stats.unmatchedValues).reduce((sum, n) => sum + n, 0);\n if (unmatched > 0) parts.push(`${unmatched} ${unmatched === 1 ? 'value' : 'values'} to match when checked`);\n return parts.join(' · ');\n });\n\n /** The choice field whose values are matched to options in the panel, or `undefined`. */\n protected readonly choiceColumn = computed(() => {\n const key = this.choiceKey();\n return key === null ? undefined : this.columns().find((column) => column.key === key);\n });\n\n /** The saved mappings whose columns fit the file, each checked against it. */\n protected readonly savedFits = computed<readonly SavedRecipeMatch[]>(() => {\n const table = this.table();\n return table ? matchSavedFieldRecipes(this.sheets(), table, this.storedRecipes(), this.#input, this.#options()) : [];\n });\n\n /** The field's other saved mappings, closest first. */\n protected readonly otherSaved = computed<readonly OtherSavedMapping[]>(() => {\n const fitting = new Set(this.savedFits().map((match) => match.recipe.id));\n const headers = this.table()?.headers ?? [];\n return this.storedRecipes()\n .filter((recipe) => !fitting.has(recipe.id))\n .map((recipe) => ({ recipe, similarity: headerSimilarity(recipe.source.headerSignature, headers) }))\n .sort((a, b) => b.similarity - a.similarity);\n });\n\n /** Ids of the saved mappings the user may remove. */\n protected readonly removableRecipes = computed<ReadonlySet<string>>(() => {\n const store = this.#store;\n return new Set(this.storedRecipes().filter((recipe) => store?.canRemove?.(recipe) ?? true).map((recipe) => recipe.id));\n });\n\n /** The stored version of the mapping in use, when it is a saved one. */\n readonly #storedVersion = computed(() => {\n const recipe = this.recipe();\n return recipe && recipe.revision > 0 ? this.storedRecipes().find((other) => other.id === recipe.id) : undefined;\n });\n\n /**\n * The mapping as a save would store it: its matches and filters, with the\n * Duplicates step's choices as they stand — so a saved mapping brings the\n * same duplicate check back for whoever uses it next.\n */\n protected readonly recipeToSave = computed<ImportRecipe | undefined>(() => {\n const recipe = this.recipe();\n return recipe ? withRecipeSettings(recipe, recipeSettingsOf(this.#identity())) : undefined;\n });\n\n /** False only while the mapping in use is a saved one with nothing changed since — its duplicate settings included. */\n protected readonly savedEdited = computed(() => {\n const recipe = this.recipeToSave();\n const stored = this.#storedVersion();\n return !recipe || recipe.revision === 0 || !stored || stableJson(stored) !== stableJson(recipe);\n });\n\n /** The name of the saved mapping in use, for the Match step's source chip; `null` for one of the dialog's own. */\n protected readonly savedName = computed(() => (this.recipe()?.revision ?? 0) > 0 ? (this.recipe()?.name ?? null) : null);\n\n /** Why the mapping cannot be saved yet, in words; `null` when it can. */\n protected readonly saveBlockedReason = computed<string | null>(() => {\n const problems = this.mappingProblems();\n if (problems.length === 0) return null;\n return problems.length === 1 ? (problems[0] ?? null) : `${problems.length} problems with the mapping need fixing first.`;\n });\n\n /** How many required fields the mapping leaves unfilled — said beside Save, which still works. */\n protected readonly saveUnfinished = computed(() => this.missingRequired().length);\n\n /** The children a repeat can combine — numbers, texts, lists: never a key, nor the field \"the latest\" ranks by. */\n protected readonly combineCandidates = computed<readonly FormColumnInputs[]>(() => {\n const keyFields = new Set(this.distinctKeys().map((key) => key.split('.')[0]));\n const latest = this.keep() === 'latest' ? this.latestField() : null;\n return this.#children.filter(\n (child) => isCombinableChild(child) && !keyFields.has(child.formControlName) && child.formControlName !== latest,\n );\n });\n\n /** {@link combine} narrowed to the current {@link combineCandidates} — what the next run is given. */\n readonly #combineRules = computed<Readonly<Record<string, ImportCombineOp>>>(() => {\n const allowed = new Set(this.combineCandidates().map((child) => child.formControlName));\n return Object.fromEntries(Object.entries(this.combine()).filter(([field]) => allowed.has(field)));\n });\n\n /** The identity the next run is given; `undefined` without keys, so every row stands on its own. */\n readonly #identity = computed<ImportIdentity | undefined>(() => {\n const distinctKeys = [...this.distinctKeys()];\n if (distinctKeys.length === 0) return undefined;\n const keep = this.keep();\n const latest = this.latestField();\n const rules = this.#combineRules();\n return {\n distinctKeys,\n ...(keep === 'last' ? { keep: 'last' as const } : keep === 'latest' && latest ? { keep: { latest } } : {}),\n ...(Object.keys(rules).length > 0 ? { combine: rules } : {}),\n };\n });\n\n /** The rule the chosen keys make, read back as a sentence. */\n protected readonly keysSentence = computed(() => {\n const keys = this.distinctKeys();\n if (keys.length === 0) return 'No keys are picked, so every row is added as its own row — repeats included.';\n const labels = keys.map((key) => this.keyOptions.find((option) => option.value === key)?.label ?? key);\n const list = labels.length === 1 ? labels[0] : `${labels.slice(0, -1).join(', ')} and ${labels[labels.length - 1]}`;\n return `A row counts as a repeat when it has the same ${list} as an earlier row.`;\n });\n\n /** What the chosen keys do to the file, before any row is checked. */\n protected readonly preview = computed<RepeatPreview | undefined>(() =>\n repeatPreview(this.mapped()?.rows ?? [], this.distinctKeys(), this.keep(), this.combineCandidates(), this.#combineRules()),\n );\n\n protected readonly progressPct = computed(() => {\n const p = this.progress();\n return p.total ? Math.round(((p.complete + p.error) / p.total) * 100) : 0;\n });\n\n /** Row states of the current run, or none until rows have been checked. */\n readonly #states = computed<readonly ImportRowState[]>(() =>\n this.stage() === 'validating' || this.stage() === 'reviewed' ? this.progress().rows : [],\n );\n\n protected readonly stats = computed<ReviewStats>(() => {\n let ready = 0;\n let duplicates = 0;\n let picking = 0;\n let overridable = 0;\n let blocked = 0;\n let failed = 0;\n let queued = 0;\n for (const state of this.#states()) {\n switch (reviewStatus(state)) {\n case 'valid':\n ready++;\n break;\n case 'duplicate':\n duplicates++;\n break;\n case 'choice':\n picking++;\n break;\n case 'overridable':\n overridable++;\n break;\n case 'invalid':\n blocked++;\n break;\n case 'error':\n failed++;\n break;\n default:\n queued++;\n }\n }\n return {\n total: this.#states().length,\n ready,\n duplicates,\n picking,\n overridable,\n blocked,\n failed,\n queued,\n needsAttention: picking + overridable + blocked + failed,\n };\n });\n\n /** Columns in the review: those the mapping fills, plus any that carry an error somewhere. */\n protected readonly reviewColumns = computed<readonly ImportColumn[]>(() => {\n const recipe = this.recipe();\n const filled = new Set(Object.entries(recipe?.columns ?? {}).filter(([, source]) => source.kind !== 'skip').map(([key]) => key));\n const withErrors = new Set(this.#states().flatMap((s) => Object.keys(s.colErrors ?? {})));\n return this.columns().filter((c) => filled.has(c.key) || withErrors.has(c.key));\n });\n\n /** The review columns the user has not hidden. */\n protected readonly visibleColumns = computed<readonly ImportColumn[]>(() => {\n const hidden = this.hiddenColumns();\n return this.reviewColumns().filter((column) => !hidden.has(column.key));\n });\n\n protected readonly hiddenCount = computed(() => this.reviewColumns().length - this.visibleColumns().length);\n\n protected readonly reviewRows = computed<readonly ReviewRow[]>(() => {\n const columns = this.visibleColumns();\n const allColumns = this.columns();\n const stopped = this.stopped();\n const states = this.#states();\n const index = this.#sourceIndex();\n const repeatedBy = new Map<number, number[]>();\n for (const state of states) {\n if (state.duplicateOf === undefined) continue;\n const list = repeatedBy.get(state.duplicateOf) ?? [];\n list.push(state.rowIndex);\n repeatedBy.set(state.duplicateOf, list);\n }\n return states.map((state) => {\n const status = reviewStatus(state);\n const meta = status === 'pending' && stopped ? NOT_CHECKED : STATUS_META[status];\n // A duplicate's own combination is stale: only the kept row's says where its values came from,\n // and a row that was kept before shows its own number again, not the total it was checked with.\n const combined = state.duplicateOf === undefined ? (state.combined ?? {}) : {};\n const stale = state.duplicateOf !== undefined && state.combined && state.settledValue;\n const shown: ImportRowState = stale\n ? { ...state, settledValue: { ...state.settledValue, ...pick(state.originalData, Object.keys(state.combined ?? {})) } }\n : state;\n const labelOf = (key: string): string => allColumns.find((column) => column.key === key)?.label ?? key;\n return {\n index: state.rowIndex,\n status,\n label: meta.label,\n icon: meta.icon,\n held: status !== 'valid' && status !== 'pending' && status !== 'processing',\n cells: columns.map((column) => {\n const isChoice = this.#choiceKeys.has(column.key);\n const built = buildCell(shown, column, isChoice);\n const typed = isChoice && !built.typed && !built.choices ? this.#typedInFile(state, column.key, built.text) : undefined;\n const cell = typed ? { ...built, typed } : built;\n const value = combined[column.key];\n return value ? { ...cell, combined: combineNote(column.label, value) } : cell;\n }),\n issues: rowIssues(state, allColumns, this.#childrenById),\n repeatedBy: repeatedBy.get(state.rowIndex) ?? [],\n source: describeSourceRows(sourceRowsOf(state), index),\n combinedNotes: Object.entries(combined).map(([key, value]) => combineNote(labelOf(key), value)),\n ...(state.duplicateOf === undefined ? {} : { duplicateOf: state.duplicateOf }),\n ...(state.errorMessage ? { systemError: state.errorMessage } : {}),\n };\n });\n });\n\n /** How many rows each column failed on — shown in the column chooser. */\n protected readonly columnIssueCounts = computed<ReadonlyMap<string, number>>(() => {\n const counts = new Map<string, number>();\n for (const row of this.reviewRows()) {\n for (const key of new Set(row.issues.map((issue) => issue.key).filter(Boolean))) {\n counts.set(key, (counts.get(key) ?? 0) + 1);\n }\n }\n return counts;\n });\n\n /** The rows the table shows: every row, narrowed by whichever filters are on. */\n protected readonly visibleRows = computed<readonly ReviewRow[]>(() => {\n let rows = this.reviewRows();\n if (this.onlyAttention()) rows = rows.filter((row) => ATTENTION_STATUSES.has(row.status));\n if (this.hideDuplicates()) rows = rows.filter((row) => row.status !== 'duplicate');\n return rows;\n });\n\n protected readonly verdict = computed<Verdict>(() => {\n if (this.stage() === 'validating') {\n const state = this.runState();\n if (state === 'paused') return { kind: 'paused', icon: 'pause_circle', text: `Paused at ${this.progressPct()}%` };\n if (state === 'stopping') return { kind: 'busy', icon: 'hourglass_top', text: 'Stopping…' };\n return { kind: 'busy', icon: 'hourglass_top', text: `${this.progressPct()}%` };\n }\n const { needsAttention, queued } = this.stats();\n if (this.stopped() && queued > 0) {\n return { kind: 'stopped', icon: 'block', text: `Stopped — ${queued} not checked` };\n }\n if (needsAttention > 0) {\n return { kind: 'warn', icon: 'warning_amber', text: `${needsAttention} ${needsAttention === 1 ? 'needs' : 'need'} you` };\n }\n return { kind: 'ok', icon: 'check_circle', text: 'Ready' };\n });\n\n /** The rows that can be added: settled with no error of any kind, and not a repeat of an earlier row. */\n readonly #ready = computed(() =>\n this.#states()\n .filter((s) => reviewStatus(s) === 'valid' && !!s.settledValue)\n .map((s) => s.settledValue as Record<string, unknown>),\n );\n\n /** A different row of a repeat can be kept: the run is over and every row was reached. */\n protected readonly canKeepRows = computed(\n () => this.stage() === 'reviewed' && this.rechecking().size === 0 && !(this.stopped() && this.stats().queued > 0),\n );\n\n protected readonly canAdd = computed(\n () => this.stage() === 'reviewed' && this.rechecking().size === 0 && this.#ready().length > 0,\n );\n\n protected readonly addLabel = computed(() => {\n if (this.stage() !== 'reviewed' && this.stage() !== 'validating') return 'Add rows';\n const { ready, picking } = this.stats();\n if (ready > 0) return ready === 1 ? 'Add 1 row' : `Add ${ready} rows`;\n if (picking > 0) return picking === 1 ? 'Pick 1 match to continue' : `Pick ${picking} matches to continue`;\n return 'Nothing to add';\n });\n\n /** The primary button of the steps before the review: what it does, and whether it can. */\n protected readonly nextAction = computed<{ label: string; enabled: boolean }>(() => {\n const rows = this.mapped()?.rows.length ?? 0;\n const check = `Check ${rows} ${rows === 1 ? 'row' : 'rows'}`;\n switch (this.step()) {\n case 'upload':\n return { label: 'Continue', enabled: !this.busy() && !!this.table() };\n case 'match':\n return { label: 'Continue', enabled: this.mappingReady() };\n default:\n return { label: check, enabled: this.mappingReady() && !this.busy() };\n }\n });\n\n protected readonly summary = computed(() => {\n const p = this.progress();\n const stage = this.stage();\n if (stage === 'validating') {\n const checked = p.complete + p.error;\n return this.paused()\n ? `Paused — ${checked} of ${p.total} ${p.total === 1 ? 'row' : 'rows'} checked.`\n : `Checking row ${Math.min(checked + 1, p.total)} of ${p.total}…`;\n }\n if (stage !== 'reviewed') return '';\n const { total, ready, picking, duplicates, queued } = this.stats();\n const held = total - ready - picking - duplicates - queued;\n const existing = this.#data.existingRowCount;\n const parts = [`${ready} of ${total} ${total === 1 ? 'row' : 'rows'} can be added`];\n if (picking > 0) parts.push(`${picking} ${picking === 1 ? 'needs' : 'need'} a match picked`);\n if (duplicates > 0) parts.push(`${duplicates} ${duplicates === 1 ? 'repeats' : 'repeat'} an earlier row and will be left out`);\n if (held > 0) parts.push(`${held} ${held === 1 ? 'needs' : 'need'} attention and will be left out`);\n if (queued > 0) parts.push(`${queued} ${queued === 1 ? 'was' : 'were'} not checked — the run was stopped`);\n if (ready > 0 && existing > 0) parts.push(`the table already holds ${existing}`);\n return `${parts.join(' · ')}.`;\n });\n\n /** The duplicate settings in one line, for the Duplicates step header and the review strip. */\n protected readonly duplicateSummary = computed(() => {\n const keys = this.distinctKeys();\n if (keys.length === 0) return 'Off';\n const keep = this.keep();\n const latestLabel = this.latestCandidates.find((child) => child.formControlName === this.latestField())?.label;\n const kept = keep === 'latest' && latestLabel ? `latest ${latestLabel}` : keep === 'last' ? 'last' : 'first';\n const combined = Object.entries(this.#combineRules()).map(\n ([field, op]) => `${COMBINE_VERBS[op].toLowerCase()} ${this.#children.find((child) => child.formControlName === field)?.label ?? field}`,\n );\n return [`${keys.length} ${keys.length === 1 ? 'key' : 'keys'}`, `keep ${kept}`, ...combined].join(', ');\n });\n\n constructor() {\n void this.#loadOptions();\n void this.#loadStored();\n }\n\n /** Tooltip for an expected column: what to type, and whether it is required. */\n protected columnTooltip(column: ImportColumn): string {\n if (!column.importable) return `${column.label} cannot be imported from a cell — add it in the row editor.`;\n return `${column.label} — ${column.required ? 'required' : 'optional'}. ${column.hint}`;\n }\n\n /** Whether a step can be opened from the step bar. */\n protected canOpenStep(step: Step): boolean {\n if (this.stage() === 'validating' || this.stage() === 'reading') return step === this.step();\n switch (step) {\n case 'upload':\n return true;\n case 'match':\n return !!this.table();\n case 'duplicates':\n return this.mappingReady();\n default:\n return this.mappingReady() || this.stage() === 'reviewed';\n }\n }\n\n /** Opens a step; the review checks the rows when what they would be checked with has changed. */\n protected async goTo(step: Step): Promise<void> {\n if (!this.canOpenStep(step) || step === this.step()) return;\n this.step.set(step);\n if (step === 'review') await this.#checkIfStale();\n }\n\n /** The primary button before the review: the next step, or — from Duplicates — the check. */\n protected async next(): Promise<void> {\n if (!this.nextAction().enabled) return;\n const at = STEPS.findIndex((entry) => entry.id === this.step());\n const target = STEPS[at + 1]?.id;\n if (target) await this.goTo(target);\n }\n\n /** The step before this one. */\n protected back(): void {\n const at = STEPS.findIndex((entry) => entry.id === this.step());\n const target = STEPS[at - 1]?.id;\n if (target && !this.busy()) this.step.set(target);\n }\n\n /** Downloads the field's import template; the writer's failure is shown beside the button. */\n protected async downloadTemplate(): Promise<void> {\n if (!this.canDownloadTemplate || this.downloadingTemplate()) return;\n this.templateError.set(undefined);\n this.downloadingTemplate.set(true);\n try {\n await this.#templates.download(this.#input);\n } catch (e) {\n this.templateError.set(messageOf(e, 'The template could not be created.'));\n } finally {\n this.downloadingTemplate.set(false);\n }\n }\n\n /** Opens the native picker. The input is cleared so choosing the same file again still fires `(change)`. */\n protected openFilePicker(uploader: HTMLInputElement): void {\n if (this.busy()) return;\n uploader.value = '';\n uploader.click();\n }\n\n /** Reads the picked file. */\n protected async onFileSelected(event: Event): Promise<void> {\n const target = event.target instanceof HTMLInputElement ? event.target : null;\n const file = target?.files?.[0];\n if (target) target.value = '';\n if (!file || this.busy()) return;\n await this.#load(file);\n }\n\n /** Reads another sheet of the workbook, under its own guessed header row, and maps it afresh. */\n protected chooseSheet(sheet: SourceSheet): void {\n if (this.busy() || sheet.name === this.activeSheet()) return;\n this.activeSheet.set(sheet.name);\n this.headerRow.set(this.headerRowPickable() ? guessHeaderRow(sheet) : 1);\n this.#suggest();\n }\n\n /** {@link chooseSheet} by the sheet's name, for the Match step's picker. */\n protected chooseSheetNamed(name: string): void {\n const sheet = this.sheets().find((candidate) => candidate.name === name);\n if (sheet) this.chooseSheet(sheet);\n }\n\n /** Reads the sheet under another header row and maps it afresh. */\n protected chooseHeaderRow(value: string): void {\n const row = Number.parseInt(value, 10);\n if (this.busy() || !Number.isInteger(row) || row < 1 || row === this.headerRow()) return;\n this.headerRow.set(row);\n this.#suggest();\n }\n\n /** Takes the mapper's edit of the recipe. */\n protected setRecipe(recipe: ImportRecipe): void {\n this.recipe.set(recipe);\n this.#suggested.set(false);\n this.recipeConflict.set(null);\n }\n\n /** Throws the edits away and matches the columns automatically again. */\n protected resetMatches(): void {\n if (this.busy()) return;\n this.autoSaved.set(null);\n this.#suggest();\n }\n\n /** Opens or closes one of the Match step's side panels. */\n protected togglePanel(panel: Panel): void {\n this.choiceKey.set(null);\n this.panel.set(this.panel() === panel ? null : panel);\n }\n\n protected closePanel(): void {\n this.panel.set(null);\n this.choiceKey.set(null);\n }\n\n /** Opens the value matcher of one choice field. */\n protected editChoices(key: string): void {\n this.panel.set(null);\n this.choiceKey.set(key);\n }\n\n /** Back from the value matcher to the field list. */\n protected closeChoices(): void {\n this.choiceKey.set(null);\n }\n\n /** Uses a saved mapping: its sheet and header row, its connections and its duplicate settings. */\n protected useRecipe(recipe: ImportRecipe): void {\n const sheet = this.sheets().find((candidate) => candidate.name === recipe.source.sheet);\n if (sheet) this.activeSheet.set(sheet.name);\n if (this.headerRowPickable()) this.headerRow.set(recipe.source.headerRow);\n this.recipe.set(recipe);\n this.#applySettings(recipe);\n this.#suggested.set(false);\n this.recipeConflict.set(null);\n this.closePanel();\n }\n\n /** Saves the mapping in use as a new one under `name`. */\n protected async saveRecipeAsNew(name: string): Promise<void> {\n const recipe = this.recipe();\n if (!recipe || this.saveBlockedReason() !== null) return;\n const fresh: ImportRecipe = { ...this.#recipeForSave(recipe), id: uuidv4(), revision: 0, name };\n await this.#write((store) => store.create(this.#scope, fresh), fresh.id);\n }\n\n /** Updates the stored mapping in use; its revision as loaded is the guard. */\n protected async updateRecipe(): Promise<void> {\n const recipe = this.recipe();\n if (!recipe || recipe.revision === 0 || this.saveBlockedReason() !== null) return;\n await this.#write((store) => store.update(this.#scope, this.#recipeForSave(recipe)), recipe.id);\n }\n\n /** Removes a saved mapping, once the list has had it confirmed. */\n protected async removeRecipe(recipe: ImportRecipe): Promise<void> {\n if (!this.removableRecipes().has(recipe.id)) return;\n await this.#write((store) => store.remove(this.#scope, recipe.id), null);\n }\n\n /** True when rows must be unique on this key. */\n protected isKey(key: string): boolean {\n return this.distinctKeys().includes(key);\n }\n\n /** Adds or removes a unique key. The rows are checked with the new keys when the review is opened again. */\n protected toggleKey(key: string): void {\n if (this.busy()) return;\n this.distinctKeys.update((keys) => (keys.includes(key) ? keys.filter((k) => k !== key) : [...keys, key]));\n }\n\n /** Which row of a repeat is kept; \"the latest\" starts on the first date or number child. */\n protected setKeep(choice: KeepChoice): void {\n this.keep.set(choice);\n if (choice === 'latest' && !this.latestField()) {\n this.latestField.set(this.latestCandidates[0]?.formControlName ?? null);\n }\n }\n\n protected setLatestField(field: string): void {\n this.latestField.set(field || null);\n }\n\n /** How a repeat fills one child: the kept row's own value, or the group's combined one. */\n protected setCombine(field: string, choice: string): void {\n this.combine.update((rules) => {\n const next = { ...rules };\n if (choice === 'kept') delete next[field];\n else next[field] = choice as ImportCombineOp;\n return next;\n });\n }\n\n protected combineFor(field: string): CombineChoice {\n return this.#combineRules()[field] ?? 'kept';\n }\n\n /** The preview's one-click answer to what keeping one row would drop: add up the numbers, collect the values, gather the rows. */\n protected addUp(field: string): void {\n const child = this.#children.find((candidate) => candidate.formControlName === field);\n const kind = child ? combineKind(child) : undefined;\n this.setCombine(field, kind === 'list' ? 'collect' : kind === 'text' ? 'join' : 'sum');\n }\n\n /** Holds the run after the row being checked; the queue waits for {@link resumeRun}. */\n protected pauseRun(): void {\n if (this.stage() === 'validating') this.#importCtrl.pause();\n }\n\n protected resumeRun(): void {\n if (this.stage() === 'validating') this.#importCtrl.resume();\n }\n\n /** Ends the run after the row being checked; rows never reached read *Not checked*. */\n protected stopRun(): void {\n if (this.stage() === 'validating') this.#importCtrl.stop();\n }\n\n /** Checks every mapped row again — the way out of a stopped run. */\n protected async checkAgain(): Promise<void> {\n if (this.busy()) return;\n this.#runKey = '';\n await this.#checkIfStale();\n }\n\n /**\n * Toggles the dialog between its opening size and the full viewport. Done\n * through the dialog reference, so the overlay pane itself resizes; the\n * host attribute lets the content grow into the space.\n */\n protected toggleFullscreen(): void {\n const next = !this.isFullscreen();\n this.isFullscreen.set(next);\n if (next) {\n this.#dialogRef.updateSize('100vw', '100vh');\n this.#dialogRef.addPanelClass(FULLSCREEN_PANEL_CLASS);\n } else {\n this.#dialogRef.updateSize(MULTIPLE_INPUT_IMPORT_DIALOG_WIDTH, '');\n this.#dialogRef.removePanelClass(FULLSCREEN_PANEL_CLASS);\n }\n }\n\n /** Narrows the table to the rows that still need the user, and back again. */\n protected toggleAttentionFilter(): void {\n this.onlyAttention.update((only) => !only);\n }\n\n /** Hides the rows set aside as duplicates — the rows that will be added are what is left — and back again. */\n protected toggleHideDuplicates(): void {\n this.hideDuplicates.update((hide) => !hide);\n }\n\n /** Shows or hides one column of the review. */\n protected toggleColumn(key: string): void {\n this.hiddenColumns.update((hidden) => {\n const next = new Set(hidden);\n if (!next.delete(key)) next.add(key);\n return next;\n });\n }\n\n /** Brings every column back into view. */\n protected showAllColumns(): void {\n this.hiddenColumns.set(new Set());\n }\n\n /**\n * Hides every column nothing failed on, so the columns that need mapping sit\n * side by side. A no-op when nothing failed, so it can never blank the table.\n */\n protected showOnlyIssueColumns(): void {\n const counts = this.columnIssueCounts();\n if (counts.size === 0) return;\n this.hiddenColumns.set(new Set(this.reviewColumns().map((column) => column.key).filter((key) => !counts.has(key))));\n }\n\n protected isColumnVisible(key: string): boolean {\n return !this.hiddenColumns().has(key);\n }\n\n /** Opens the row's detail panel, closing whichever was open; a second click closes it. */\n protected toggleRow(index: number): void {\n this.expandedRow.set(this.expandedRow() === index ? null : index);\n }\n\n protected isRowOpen(index: number): boolean {\n return this.expandedRow() === index;\n }\n\n /** \"Kept for row 4, which repeats it and is left out.\" — the rows a kept row stands for, for its detail and badge. */\n protected keptFor(indexes: readonly number[]): string {\n const one = indexes.length === 1;\n return `Kept for ${rowsPhrase(indexes)}, which ${one ? 'repeats it and is' : 'repeat it and are'} left out.`;\n }\n\n /**\n * Opens a row and scrolls it into view — clearing the filters first, since\n * the row a duplicate repeats is a ready row the attention filter hides, and\n * a duplicate is what the other filter hides.\n */\n protected jumpToRow(index: number): void {\n this.onlyAttention.set(false);\n this.hideDuplicates.set(false);\n this.expandedRow.set(index);\n if (!isPlatformBrowser(this.#platformId)) return;\n setTimeout(() => {\n this.#host.nativeElement.querySelector(`#mii-row-${index}`)?.scrollIntoView?.({ behavior: 'smooth', block: 'center' });\n });\n }\n\n /**\n * Keeps a duplicate instead of the row its repeat kept. The row it replaces\n * becomes the duplicate, keeping its own verdict; under combine the kept\n * row is checked with its group's numbers.\n */\n protected async keepRow(index: number): Promise<void> {\n if (!this.canKeepRows()) return;\n this.error.set(undefined);\n this.rechecking.update((set) => new Set([...set, index]));\n try {\n await this.#importCtrl.keepRow(index);\n this.expandedRow.set(index);\n } catch (e) {\n this.error.set(messageOf(e, 'The row could not be kept.'));\n } finally {\n this.rechecking.update((set) => {\n const next = new Set(set);\n next.delete(index);\n return next;\n });\n }\n }\n\n /**\n * Applies the user's pick for a choice cell whose text fits several options\n * and re-checks that row alone. The pick goes into the row's raw data under\n * the column's key — the whole cell of a single select, the one matching\n * entry of a multi-select — so the re-run resolves it by stored value while\n * every other row stands. It is remembered, so checking the rows again with\n * other duplicate settings keeps it.\n */\n protected async pickOption(rowIndex: number, cell: ReviewCell, choice: ImportOptionChoice, event: Event): Promise<void> {\n const select = event.target instanceof HTMLSelectElement ? event.target : null;\n const candidate = select && select.value !== '' ? choice.candidates[Number(select.value)] : undefined;\n const state = this.#states().find((s) => s.rowIndex === rowIndex);\n if (!candidate || !state || this.rechecking().has(rowIndex)) return;\n\n const child = this.#children.find((c) => c.formControlName === cell.key);\n const multi = !!child && isMultiSelectInput(child);\n const row = applyOptionChoice(state.originalData, cell.key, choice.text, candidate.value, multi);\n this.#picks.set(rowIndex, [...(this.#picks.get(rowIndex) ?? []), { key: cell.key, text: choice.text, value: candidate.value, multi }]);\n\n this.error.set(undefined);\n this.rechecking.update((set) => new Set([...set, rowIndex]));\n try {\n await this.#importCtrl.rerunMultipleInputRow(rowIndex, row);\n } catch (e) {\n this.error.set(messageOf(e, 'The row could not be re-checked.'));\n } finally {\n this.rechecking.update((set) => {\n const next = new Set(set);\n next.delete(rowIndex);\n return next;\n });\n }\n }\n\n protected cancel(): void {\n if (this.busy()) return;\n this.#dialogRef.close(undefined);\n }\n\n protected add(): void {\n if (!this.canAdd()) return;\n this.#dialogRef.close(this.#ready());\n }\n\n async #load(file: File): Promise<void> {\n if (!isPlatformBrowser(this.#platformId)) return;\n // A corrected copy of the same file keeps the mapping the user made for it.\n const previous = this.recipe();\n const previousSuggested = this.#suggested();\n this.error.set(undefined);\n this.sheets.set([]);\n this.activeSheet.set(undefined);\n this.recipe.set(undefined);\n this.autoSaved.set(null);\n this.closePanel();\n this.fileName.set(file.name);\n this.stage.set('reading');\n this.#runKey = '';\n\n let parsed: readonly SpreadsheetSheet[];\n try {\n const data = await readAsArrayBuffer(file);\n parsed = await this.#parser({ fileName: file.name, mimeType: file.type || '', data });\n } catch (e) {\n this.#fail(messageOf(e, 'Could not read the spreadsheet.'));\n return;\n }\n\n const sheets = toSourceSheets(parsed ?? []);\n if (sheets.length === 0) {\n this.#fail('The spreadsheet has no sheets.');\n return;\n }\n const pickable = (parsed ?? []).some((sheet) => !!sheet?.grid);\n const sheet = this.#preferredSheet(sheets);\n this.sheets.set(sheets);\n this.headerRowPickable.set(pickable);\n this.activeSheet.set(sheet.name);\n this.headerRow.set(pickable ? guessHeaderRow(sheet) : 1);\n this.stage.set('idle');\n\n if ((this.table()?.rows.length ?? 0) === 0) {\n this.error.set(`\"${sheet.name}\" has no rows below its headers.`);\n return;\n }\n const headers = this.table()?.headers ?? [];\n if (previous && !previousSuggested && headerSimilarity(previous.source.headerSignature, headers) === 1) {\n this.recipe.set(previous);\n this.#suggested.set(false);\n } else if (!this.#applyExactSaved()) {\n this.#suggest();\n }\n this.step.set('match');\n }\n\n /**\n * The sheet named after the field's `formControlName` when there is one —\n * the template's data sheet, or a bulk-import template's detail sheet —\n * otherwise the first.\n */\n #preferredSheet(sheets: readonly SourceSheet[]): SourceSheet {\n const wanted = (this.#input.formControlName ?? '').trim().toLowerCase();\n const first = sheets[0] as SourceSheet;\n if (!wanted) return first;\n return sheets.find((sheet) => sheet.name.trim().toLowerCase() === wanted) ?? first;\n }\n\n /**\n * What the file said for a choice cell the mapping already matched to an\n * option — read from the row's source row through the column's source —\n * when it differs from what the row carries; `undefined` otherwise.\n */\n #typedInFile(state: ImportRowState, key: string, shown: string): string | undefined {\n const source = this.recipe()?.columns[key];\n const id = sourceRowsOf(state)[0];\n const row = id === undefined ? undefined : this.#sourceRowsById().get(id);\n // A random draw is not what the file said; it can also differ from the row's draw among dependent options.\n if (!source || source.kind === 'skip' || source.kind === 'random' || !row) return undefined;\n const text = columnCellText(source, row).trim();\n return text && normaliseOptionText(text) !== normaliseOptionText(shown) ? text : undefined;\n }\n\n /** Matches the columns automatically. */\n #suggest(): void {\n const table = this.table();\n if (!table) return;\n this.recipe.set(suggestFieldRecipe(table, this.#input, this.#scope, this.#options()));\n this.#suggested.set(true);\n this.recipeConflict.set(null);\n }\n\n /**\n * Applies, on its own, the saved mapping that fits the file exactly — every\n * header the same, on the same sheet and header row, nothing to fix.\n * Returns whether one did.\n */\n #applyExactSaved(): boolean {\n const exact = this.savedFits().find(\n (match) =>\n match.similarity === 1 &&\n match.check.ok &&\n match.recipe.source.sheet === this.activeSheet() &&\n match.recipe.source.headerRow === this.headerRow(),\n );\n if (!exact) return false;\n this.recipe.set(exact.recipe);\n this.#applySettings(exact.recipe);\n this.#suggested.set(false);\n this.autoSaved.set(exact.recipe);\n return true;\n }\n\n /**\n * Takes the duplicate settings a saved mapping carries — keys, which row a\n * repeat keeps, what it combines — dropping any the field no longer has. A\n * mapping saved without settings leaves the current choices as they are.\n */\n #applySettings(recipe: ImportRecipe): void {\n const identity = recipe.settings?.identity;\n if (!identity) return;\n const offered = new Set(this.keyOptions.map((option) => option.value));\n const children = new Set(this.#children.map((child) => child.formControlName));\n const ranked = new Set(this.latestCandidates.map((child) => child.formControlName));\n this.distinctKeys.set(identity.distinctKeys.filter((key) => offered.has(key)));\n const keep = identity.keep;\n if (keep === 'last') {\n this.keep.set('last');\n } else if (keep && typeof keep === 'object' && ranked.has(keep.latest)) {\n this.keep.set('latest');\n this.latestField.set(keep.latest);\n } else {\n this.keep.set('first');\n }\n this.combine.set(Object.fromEntries(Object.entries(identity.combine ?? {}).filter(([field]) => children.has(field))));\n }\n\n /**\n * Checks the mapped rows with the current duplicate settings — unless the\n * rows under review were checked with exactly these, so stepping back and\n * forth costs nothing.\n */\n async #checkIfStale(): Promise<void> {\n const mapped = this.mapped();\n const table = this.table();\n if (!mapped || !table || this.busy()) return;\n const mappingKey = `${table.sheet}\\u0000${table.headerRow}\\u0000${stableJson(this.recipe())}`;\n if (mappingKey !== this.#picksKey) {\n this.#picks.clear();\n this.#picksKey = mappingKey;\n }\n const runKey = `${mappingKey}\\u0000${stableJson(this.#identity())}`;\n if (runKey === this.#runKey && (this.stage() === 'reviewed' || this.stage() === 'validating')) return;\n this.#runKey = runKey;\n await this.#run(mapped.rows.map((row, index) => withPicks(row, this.#picks.get(index))));\n }\n\n /** Checks the mapped rows with the current duplicate settings. */\n async #run(rows: Record<string, unknown>[]): Promise<void> {\n this.error.set(undefined);\n this.stage.set('validating');\n this.stopped.set(false);\n this.expandedRow.set(null);\n this.onlyAttention.set(false);\n this.hideDuplicates.set(false);\n this.hiddenColumns.set(new Set());\n this.#importCtrl.reset();\n try {\n await this.#importCtrl.runMultipleInputImport(this.#input, rows, this.#identity());\n } catch (e) {\n this.#runKey = '';\n this.error.set(messageOf(e, 'The rows could not be checked.'));\n this.stage.set('idle');\n return;\n }\n // Rows still pending once the run has ended were never reached: the run was stopped.\n this.stopped.set(this.progress().pending > 0);\n this.stage.set('reviewed');\n }\n\n #fail(message: string): void {\n this.error.set(message);\n this.stage.set('idle');\n this.step.set('upload');\n }\n\n /** Loads the children's option lists, so texts can be matched to options while mapping. */\n async #loadOptions(): Promise<void> {\n try {\n const options = await this.#importCtrl.loadMultipleInputOptions(this.#input);\n this.#options.set(options);\n // Matching by values needs the options: an untouched suggestion is made again with them.\n if (this.#suggested()) this.#suggest();\n } catch {\n this.optionsFailed.set(true);\n }\n }\n\n /** Loads the field's saved mappings, when the host stores them. */\n async #loadStored(): Promise<void> {\n const store = this.#store;\n if (!store) return;\n try {\n this.storedRecipes.set(await firstValueFrom(store.list(this.#scope)));\n // A file read before the list arrived still gets its exact saved mapping.\n if (this.#suggested() && this.#applyExactSaved()) this.recipeConflict.set(null);\n } catch (e) {\n this.storeError.set(messageOf(e, 'The saved mappings could not be loaded.'));\n }\n }\n\n /**\n * Writes through the store and takes its answer: the recipes as now stored —\n * the one just written (`savedId`) becoming the mapping in use — or the\n * conflict that refused the write.\n */\n async #write(write: (store: ImportRecipeStore) => Observable<ImportRecipeWriteResult>, savedId: string | null): Promise<void> {\n const store = this.#store;\n if (!store || this.recipeSaving()) return;\n this.recipeSaving.set(true);\n this.storeError.set(undefined);\n try {\n const result: ImportRecipeWriteResult = await firstValueFrom(write(store));\n if (result.kind === 'conflict') {\n this.recipeConflict.set(result.conflict);\n return;\n }\n this.recipeConflict.set(null);\n this.storedRecipes.set(result.recipes);\n const saved = savedId === null ? undefined : result.recipes.find((recipe) => recipe.id === savedId);\n if (saved) {\n this.recipe.set(saved);\n this.#suggested.set(false);\n this.panel.set(null);\n }\n } catch (e) {\n this.storeError.set(messageOf(e, 'The mapping could not be saved.'));\n } finally {\n this.recipeSaving.set(false);\n }\n }\n\n /** The recipe as stored: what it reads now, keys the field no longer has dropped, the duplicate settings as they stand. */\n #recipeForSave(mapping: ImportRecipe): ImportRecipe {\n const recipe = withRecipeSettings(mapping, recipeSettingsOf(this.#identity()));\n const stale = new Set((this.check()?.issues ?? []).filter((issue) => issue.kind === 'targetMissing').map((issue) => issue.target));\n const keep = <T>(record: Readonly<Record<string, T>>): Record<string, T> =>\n Object.fromEntries(Object.entries(record).filter(([key]) => !stale.has(key)));\n const table = this.table();\n return {\n ...recipe,\n workflowId: this.#scope,\n source: table ? { sheet: table.sheet, headerRow: table.headerRow, headerSignature: headerSignature(table.headers) } : recipe.source,\n columns: keep(recipe.columns),\n choices: keep(recipe.choices),\n };\n }\n}\n\n/** The members of `record` named by `keys` that it has. */\nfunction pick(record: Record<string, unknown> | undefined, keys: readonly string[]): Record<string, unknown> {\n return Object.fromEntries(keys.filter((key) => record && key in record).map((key) => [key, record?.[key]]));\n}\n\n/** The source row ids a mapped row carries. */\nfunction sourceRowsOf(state: ImportRowState): readonly string[] {\n const ids = state.originalData?.[SOURCE_ROWS_KEY];\n return Array.isArray(ids) ? ids.filter((id): id is string => typeof id === 'string') : [];\n}\n\n/** `row` with the review's picks written back — each only where the cell still holds the text it was picked for. */\nfunction withPicks(row: Record<string, unknown>, picks: readonly OptionPick[] | undefined): Record<string, unknown> {\n let next = row;\n for (const pick of picks ?? []) {\n if (!pick.multi && normaliseOptionText(next[pick.key]) !== normaliseOptionText(pick.text)) continue;\n next = applyOptionChoice(next, pick.key, pick.text, pick.value, pick.multi);\n }\n return next;\n}\n\n/** JSON with object keys sorted, so two equal values compare equal whatever order their keys were written in. */\nfunction stableJson(value: unknown): string {\n if (Array.isArray(value)) return `[${value.map(stableJson).join(',')}]`;\n if (value !== null && typeof value === 'object') {\n const record = value as Record<string, unknown>;\n const entries = Object.keys(record)\n .filter((key) => record[key] !== undefined)\n .sort()\n .map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`);\n return `{${entries.join(',')}}`;\n }\n return JSON.stringify(value) ?? 'null';\n}\n\n/** Reads a file's bytes through `FileReader`, the API the rest of the library already relies on. */\nfunction readAsArrayBuffer(file: File): Promise<ArrayBuffer> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n const result = reader.result;\n if (result instanceof ArrayBuffer) resolve(result);\n else reject(new Error('Could not read the file.'));\n };\n reader.onerror = () => reject(reader.error ?? new Error('Could not read the file.'));\n reader.readAsArrayBuffer(file);\n });\n}\n\nfunction messageOf(error: unknown, fallback: string): string {\n return error instanceof Error && error.message ? error.message : fallback;\n}\n","<div mat-dialog-title class=\"mii__header\">\n <div class=\"mii__heading\">\n <span class=\"mii__title\">Import rows from a spreadsheet</span>\n <span class=\"mii__subtitle\">\n {{ fieldLabel }} · match your file's columns, decide what counts as a repeat, and only rows the form accepts are added.\n </span>\n </div>\n <button\n type=\"button\"\n mat-icon-button\n class=\"mii__fullscreen\"\n [matTooltip]=\"isFullscreen() ? 'Exit full screen' : 'Full screen'\"\n matTooltipPosition=\"left\"\n [attr.aria-label]=\"isFullscreen() ? 'Exit full screen' : 'Enter full screen'\"\n [attr.aria-pressed]=\"isFullscreen()\"\n (click)=\"toggleFullscreen()\"\n >\n <mat-icon aria-hidden=\"true\">{{ isFullscreen() ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>\n </button>\n</div>\n\n<nav class=\"mii-steps\" aria-label=\"Import steps\">\n <ol class=\"mii-steps__list\">\n @for (entry of steps; track entry.id; let at = $index) {\n <li class=\"mii-steps__item\">\n <button\n type=\"button\"\n class=\"mii-steps__button\"\n [class.mii-steps__button--current]=\"step() === entry.id\"\n [attr.aria-current]=\"step() === entry.id ? 'step' : null\"\n [disabled]=\"!canOpenStep(entry.id)\"\n (click)=\"goTo(entry.id)\"\n >\n <span class=\"mii-steps__number\" aria-hidden=\"true\">{{ at + 1 }}</span>\n <span class=\"mii-steps__label\">{{ entry.label }}</span>\n @if (entry.id === 'duplicates' && step() !== 'duplicates' && canOpenStep('duplicates')) {\n <span class=\"mii-steps__meta\">{{ duplicateSummary() }}</span>\n }\n </button>\n </li>\n }\n </ol>\n</nav>\n\n<mat-dialog-content class=\"mii__content\">\n <!-- The native input stays in the tree for keyboard and assistive access; the pick zone and the re-upload button open it. -->\n <input\n #uploader\n type=\"file\"\n class=\"mii-upload-input\"\n [accept]=\"accept\"\n [disabled]=\"busy()\"\n (change)=\"onFileSelected($event)\"\n aria-label=\"Choose a spreadsheet file\"\n />\n\n @if (error(); as message) {\n <p class=\"mii-alert mii-alert--error\" role=\"alert\">\n <mat-icon aria-hidden=\"true\">error</mat-icon>\n <span>{{ message }}</span>\n </p>\n }\n\n @switch (step()) {\n @case ('upload') {\n <!-- 1 · Upload: the file and the template on one line; the sheet as a row of chips -->\n <section class=\"mii-section mii-setup\" aria-labelledby=\"mii-setup-label\">\n <span class=\"mii-section__label\" id=\"mii-setup-label\">Your file</span>\n\n <div class=\"mii-setup__row\">\n <button type=\"button\" class=\"mii-pick\" [class.mii-pick--busy]=\"busy()\" [disabled]=\"busy()\" (click)=\"openFilePicker(uploader)\">\n <mat-icon class=\"mii-pick__icon\" aria-hidden=\"true\">upload_file</mat-icon>\n <span class=\"mii-pick__text\">\n @if (stage() === 'reading') {\n <span class=\"mii-pick__name\">Reading {{ fileName() }}…</span>\n <span class=\"mii-pick__hint\">This takes a moment for a large workbook</span>\n } @else if (fileName(); as name) {\n <span class=\"mii-pick__name\">{{ name }}</span>\n <span class=\"mii-pick__hint\">Choose another file to start over</span>\n } @else {\n <span class=\"mii-pick__name\">Choose a file</span>\n <span class=\"mii-pick__hint\">The template, or any workbook or CSV of your own — you match its columns next</span>\n }\n </span>\n </button>\n\n @if (canDownloadTemplate) {\n <div class=\"mii-template\">\n <button\n type=\"button\"\n mat-stroked-button\n class=\"mii-template__button\"\n [disabled]=\"downloadingTemplate()\"\n (click)=\"downloadTemplate()\"\n >\n <mat-icon aria-hidden=\"true\">download</mat-icon>\n Download template\n </button>\n <span class=\"mii-template__hint\">\n Its first sheet carries the headers to fill in; the {{ guideSheet }} sheet says what goes in each column.\n </span>\n </div>\n }\n </div>\n\n @if (templateError(); as message) {\n <p class=\"mii-alert mii-alert--error mii-template__error\" role=\"alert\">\n <mat-icon aria-hidden=\"true\">error</mat-icon>\n <span>{{ message }}</span>\n </p>\n }\n\n @if (!canDownloadTemplate) {\n <ul class=\"mii-columns\" aria-label=\"Columns this list takes\" aria-describedby=\"mii-columns-hint\">\n @for (column of columns(); track column.key) {\n <li\n class=\"mii-column\"\n [class.mii-column--required]=\"column.required && column.importable\"\n [class.mii-column--skipped]=\"!column.importable\"\n [matTooltip]=\"columnTooltip(column)\"\n >\n <span class=\"mii-column__key\">{{ column.key }}</span>\n @if (column.label !== column.key) {\n <span class=\"mii-column__label\">{{ column.label }}</span>\n }\n @if (column.required && column.importable) {\n <span class=\"mii-column__flag\">required</span>\n } @else if (!column.importable) {\n <span class=\"mii-column__flag\">not importable</span>\n }\n </li>\n }\n </ul>\n <p class=\"mii-section__hint\" id=\"mii-columns-hint\">\n A file with these headers is matched on its own; any other file's columns are matched in the next step.\n </p>\n }\n\n @if (sheets().length > 1) {\n <dl class=\"mii-fields\">\n <div class=\"mii-field\">\n <dt class=\"mii-field__label\">Sheet</dt>\n <dd class=\"mii-field__value\" role=\"group\" aria-label=\"Sheet to import\">\n @for (sheet of sheets(); track sheet.name) {\n <button\n type=\"button\"\n class=\"mii-sheet\"\n [class.mii-sheet--active]=\"sheet.name === activeSheet()\"\n [attr.aria-pressed]=\"sheet.name === activeSheet()\"\n [disabled]=\"busy()\"\n (click)=\"chooseSheet(sheet)\"\n >\n {{ sheet.name }}\n </button>\n }\n </dd>\n </div>\n </dl>\n }\n </section>\n }\n\n @case ('match') {\n <!-- 2 · Match columns: where each field comes from -->\n <section class=\"mii-section mii-match\" aria-labelledby=\"mii-match-label\">\n <span class=\"mii-section__label\" id=\"mii-match-label\">Match columns</span>\n\n <div class=\"mii-match__bar\">\n <div class=\"mii-match__file\" role=\"group\" aria-label=\"How the file is read\">\n <button type=\"button\" class=\"mii-tool\" [disabled]=\"busy()\" matTooltip=\"Choose another file\" (click)=\"openFilePicker(uploader)\">\n <mat-icon aria-hidden=\"true\">description</mat-icon>\n <span class=\"mii-match__name\">{{ fileName() }}</span>\n </button>\n @if (sheets().length > 1) {\n <label class=\"mii-inline\">\n <span class=\"mii-inline__label\">Sheet</span>\n <select class=\"mii-inline__select\" [disabled]=\"busy()\" (change)=\"chooseSheetNamed(sheetSelect.value)\" #sheetSelect>\n @for (sheet of sheets(); track sheet.name) {\n <option [value]=\"sheet.name\" [selected]=\"sheet.name === activeSheet()\">{{ sheet.name }}</option>\n }\n </select>\n </label>\n }\n @if (headerRowPickable()) {\n <label class=\"mii-inline\">\n <span class=\"mii-inline__label\">Headers in row</span>\n <select class=\"mii-inline__select\" [disabled]=\"busy()\" (change)=\"chooseHeaderRow(rowSelect.value)\" #rowSelect>\n @for (row of headerRowChoices(); track row) {\n <option [value]=\"row\" [selected]=\"row === headerRow()\">{{ row }}</option>\n }\n </select>\n </label>\n }\n @if (savedName(); as name) {\n <span class=\"mii-saved-chip\" role=\"status\">\n <mat-icon aria-hidden=\"true\">bookmark</mat-icon>\n {{ autoSaved() ? 'Applied your saved mapping' : 'Saved mapping' }} “{{ name }}”{{ savedEdited() ? ' — edited' : '' }}\n </span>\n }\n </div>\n <div class=\"mii-match__tools\">\n <button\n type=\"button\"\n class=\"mii-tool\"\n [class.mii-tool--on]=\"panel() === 'rows'\"\n [attr.aria-expanded]=\"panel() === 'rows'\"\n (click)=\"togglePanel('rows')\"\n >\n <mat-icon aria-hidden=\"true\">filter_list</mat-icon>\n <span>Which rows</span>\n </button>\n @if (canSaveMappings) {\n <button\n type=\"button\"\n class=\"mii-tool\"\n [class.mii-tool--on]=\"panel() === 'saved'\"\n [attr.aria-expanded]=\"panel() === 'saved'\"\n (click)=\"togglePanel('saved')\"\n >\n <mat-icon aria-hidden=\"true\">bookmarks</mat-icon>\n <span>Saved ({{ storedRecipes().length }})</span>\n </button>\n <button\n type=\"button\"\n class=\"mii-tool\"\n [class.mii-tool--on]=\"panel() === 'save'\"\n [attr.aria-expanded]=\"panel() === 'save'\"\n [disabled]=\"!recipe()\"\n (click)=\"togglePanel('save')\"\n >\n <mat-icon aria-hidden=\"true\">bookmark_add</mat-icon>\n <span>Save mapping</span>\n </button>\n }\n <button type=\"button\" class=\"mii-tool\" matTooltip=\"Throw the edits away and match automatically again\" (click)=\"resetMatches()\">\n <mat-icon aria-hidden=\"true\">restart_alt</mat-icon>\n <span>Start over</span>\n </button>\n </div>\n </div>\n\n <p class=\"mii-summary\" role=\"status\" aria-live=\"polite\">{{ mappingSummary() }}</p>\n\n @if (missingRequired().length > 0) {\n <p class=\"mii-alert mii-alert--warn\" role=\"status\">\n <mat-icon aria-hidden=\"true\">warning</mat-icon>\n <span>\n Nothing fills the required {{ missingRequired().length === 1 ? 'field' : 'fields' }}\n {{ missingRequired().join(', ') }} — pick a column, a fixed value or several columns joined below.\n </span>\n </p>\n }\n @for (problem of mappingProblems(); track problem) {\n <p class=\"mii-alert mii-alert--error\" role=\"alert\">\n <mat-icon aria-hidden=\"true\">error_outline</mat-icon>\n <span>{{ problem }}</span>\n </p>\n }\n @if (optionsFailed()) {\n <p class=\"mii-note\" role=\"status\">The option lists could not be loaded, so choice values are matched when the rows are checked.</p>\n }\n @if (storeError(); as message) {\n <p class=\"mii-alert mii-alert--error\" role=\"alert\">\n <mat-icon aria-hidden=\"true\">error</mat-icon>\n <span>{{ message }}</span>\n </p>\n }\n\n @let working = recipe();\n @let source = table();\n @let checked = check();\n @if (working && source && checked) {\n <div class=\"mii-match__work\" [class.mii-match__work--panel]=\"!!panel() || !!choiceColumn()\">\n <lib-import-column-mapper\n class=\"mii-match__mapper\"\n [columns]=\"columns()\"\n [table]=\"source\"\n [recipe]=\"working\"\n [check]=\"checked\"\n (recipeChange)=\"setRecipe($event)\"\n (editChoices)=\"editChoices($event)\"\n />\n\n @if (choiceColumn() || panel()) {\n <aside class=\"mii-panel\" aria-labelledby=\"mii-panel-title\">\n <header class=\"mii-panel__head\">\n <h3 class=\"mii-panel__title\" id=\"mii-panel-title\">\n @if (choiceColumn(); as column) {\n Match the values of {{ column.label }}\n } @else {\n @switch (panel()) {\n @case ('rows') { Which rows to import }\n @case ('saved') { Saved mappings }\n @case ('save') { Save this mapping }\n }\n }\n </h3>\n <button type=\"button\" mat-icon-button aria-label=\"Close the panel\" (click)=\"closePanel()\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n </header>\n <div class=\"mii-panel__body\">\n @if (choiceColumn(); as column) {\n <button type=\"button\" mat-button class=\"mii-panel__crumb\" (click)=\"closeChoices()\">\n <mat-icon aria-hidden=\"true\">arrow_back</mat-icon>\n Back to the fields\n </button>\n <lib-import-choice-mapper [column]=\"column\" [table]=\"source\" [recipe]=\"working\" [check]=\"checked\" (recipeChange)=\"setRecipe($event)\" />\n } @else {\n @switch (panel()) {\n @case ('rows') {\n <lib-import-row-rules\n [recipe]=\"working\"\n [table]=\"source\"\n [showTitle]=\"false\"\n [savedAs]=\"savedEdited() ? null : savedName()\"\n [canSave]=\"!saveBlockedReason()\"\n (recipeChange)=\"setRecipe($event)\"\n (saveRequested)=\"panel.set('save')\" />\n }\n @case ('saved') {\n <lib-import-saved-mappings\n [fits]=\"savedFits()\"\n [others]=\"otherSaved()\"\n [activeId]=\"working.revision > 0 ? working.id : null\"\n [active]=\"working\"\n [removable]=\"removableRecipes()\"\n [busy]=\"recipeSaving()\"\n (useMapping)=\"useRecipe($event)\"\n (removeMapping)=\"removeRecipe($event)\"\n />\n }\n @case ('save') {\n <ng-container [ngTemplateOutlet]=\"saveForm\" />\n }\n }\n }\n </div>\n </aside>\n }\n </div>\n }\n </section>\n }\n\n @case ('duplicates') {\n <!-- 3 · Duplicates: what makes two rows the same, and what a repeat keeps -->\n <section class=\"mii-section mii-dup\" aria-labelledby=\"mii-dup-title\">\n <span class=\"mii-section__label\">Duplicates · optional</span>\n <div class=\"mii-dup__head\">\n <h3 class=\"mii-dup__title\" id=\"mii-dup-title\">Duplicate check</h3>\n <p class=\"mii-dup__lede\">{{ keysSentence() }}</p>\n </div>\n\n @if (keyOptions.length === 0) {\n <p class=\"mii-note\">This list has no column a row could be told apart by, so every row is added.</p>\n } @else {\n <div class=\"mii-dup__group\" role=\"group\" aria-labelledby=\"mii-keys-label\">\n <span class=\"mii-dup__group-label\" id=\"mii-keys-label\">Treat rows as the same when these match</span>\n <div class=\"mii-dup__chips\">\n @for (option of keyOptions; track option.value) {\n <button\n type=\"button\"\n class=\"mii-sheet mii-key\"\n [class.mii-sheet--active]=\"isKey(option.value)\"\n [attr.aria-pressed]=\"isKey(option.value)\"\n [disabled]=\"busy()\"\n (click)=\"toggleKey(option.value)\"\n >\n <mat-icon aria-hidden=\"true\">{{ isKey(option.value) ? 'check' : 'add' }}</mat-icon>\n {{ option.label }}\n </button>\n }\n </div>\n </div>\n }\n\n @if (preview(); as p) {\n <div class=\"mii-preview\" role=\"status\">\n <p class=\"mii-preview__count\">\n <mat-icon aria-hidden=\"true\">insights</mat-icon>\n @if (p.repeats > 0) {\n <span>\n With these keys: {{ p.records }} rows make {{ p.unique }} — {{ p.repeats }}\n {{ p.repeats === 1 ? 'row repeats' : 'rows repeat' }} an earlier one and\n {{ p.repeats === 1 ? 'is' : 'are' }} left out.\n </span>\n } @else {\n <span>With these keys: no row of the file repeats another — all {{ p.records }} are checked.</span>\n }\n </p>\n @for (field of p.differing; track field.key) {\n <div class=\"mii-preview__money\">\n <mat-icon aria-hidden=\"true\">warning_amber</mat-icon>\n <p>\n On {{ field.records }} {{ field.records === 1 ? 'repeat' : 'repeats' }} the rows have a different\n <strong>{{ field.label }}</strong> — keeping one row leaves out <strong>{{ field.leftOut }}</strong>.\n </p>\n <button type=\"button\" mat-stroked-button (click)=\"addUp(field.key)\">\n {{ field.kind === 'list' ? 'Gather the rows' : field.kind === 'text' ? 'Collect them' : 'Add them up' }}\n </button>\n </div>\n }\n </div>\n }\n\n @if (distinctKeys().length > 0) {\n <fieldset class=\"mii-dup__group mii-keep\" [disabled]=\"busy()\">\n <legend class=\"mii-dup__group-label\">When rows repeat, keep</legend>\n <div class=\"mii-keep__choices\">\n <label class=\"mii-keep__choice\">\n <input type=\"radio\" name=\"mii-keep\" [checked]=\"keep() === 'first'\" (change)=\"setKeep('first')\" />\n the first one\n </label>\n <label class=\"mii-keep__choice\">\n <input type=\"radio\" name=\"mii-keep\" [checked]=\"keep() === 'last'\" (change)=\"setKeep('last')\" />\n the last one\n </label>\n @if (latestCandidates.length > 0) {\n <!-- The radio and its field picker read as one phrase, so they wrap together. -->\n <span class=\"mii-keep__latest\">\n <label class=\"mii-keep__choice\">\n <input type=\"radio\" name=\"mii-keep\" [checked]=\"keep() === 'latest'\" (change)=\"setKeep('latest')\" />\n the latest by\n </label>\n <select\n class=\"mii-inline__select\"\n aria-label=\"Field the latest row is told by\"\n [disabled]=\"keep() !== 'latest'\"\n (change)=\"setLatestField(latestSelect.value)\"\n #latestSelect\n >\n @for (child of latestCandidates; track child.formControlName) {\n <option [value]=\"child.formControlName\" [selected]=\"child.formControlName === latestField()\">{{ child.label || child.formControlName }}</option>\n }\n </select>\n </span>\n }\n </div>\n </fieldset>\n\n @if (combineCandidates().length > 0) {\n <fieldset class=\"mii-dup__group mii-combine\" [disabled]=\"busy()\">\n <legend class=\"mii-dup__group-label\">Fields of the kept row</legend>\n <p class=\"mii-section__hint mii-combine__hint\">\n Take the kept row's own value, or combine every row that repeats it: add up its numbers, collect its text\n values comma-separated, gather its list rows. Blank cells are left out. The combined value is checked against\n the form's rules, and calculated fields are worked out from it.\n </p>\n <ul class=\"mii-combine__list\">\n @for (child of combineCandidates(); track child.formControlName) {\n <li class=\"mii-combine__row\" [class.mii-combine__row--on]=\"combineFor(child.formControlName) !== 'kept'\">\n <label class=\"mii-combine__label\" [for]=\"'mii-combine-' + child.formControlName\">{{ child.label || child.formControlName }}</label>\n <select\n class=\"mii-inline__select\"\n [id]=\"'mii-combine-' + child.formControlName\"\n (change)=\"setCombine(child.formControlName, combineSelect.value)\"\n #combineSelect\n >\n @for (choice of combineChoicesFor(child); track choice.value) {\n <option [value]=\"choice.value\" [selected]=\"combineFor(child.formControlName) === choice.value\">{{ choice.label }}</option>\n }\n </select>\n </li>\n }\n </ul>\n </fieldset>\n }\n\n <p class=\"mii-section__hint mii-dup__note\">\n <mat-icon aria-hidden=\"true\">info</mat-icon>\n You can keep a different row of any repeat once the rows are checked.\n </p>\n }\n\n @if (canSaveMappings && recipe()) {\n <!-- The duplicate check is made here, so it can be saved with the mapping here too. -->\n <details class=\"mii-dup__save\" [open]=\"savedName() !== null && savedEdited()\">\n <summary class=\"mii-dup__save-summary\">\n <mat-icon aria-hidden=\"true\">bookmark_add</mat-icon>\n {{ savedName() ? 'Save these settings with “' + savedName() + '”' : 'Save the mapping with these settings' }}\n </summary>\n <ng-container [ngTemplateOutlet]=\"saveForm\" />\n </details>\n }\n </section>\n }\n\n @case ('review') {\n <!-- 4 · Check & add -->\n <section class=\"mii-section mii-section--review\" aria-labelledby=\"mii-review-label\">\n <span class=\"mii-section__label\" id=\"mii-review-label\">Check &amp; add</span>\n\n @let s = stats();\n <!-- One compact bar: verdict, summary, counts by outcome, run and table controls -->\n <div class=\"mii-toolbar\">\n <div class=\"mii-toolbar__verdict\">\n @let v = verdict();\n <span class=\"mii-pill\" [attr.data-kind]=\"v.kind\">\n <mat-icon aria-hidden=\"true\">{{ v.icon }}</mat-icon>\n <span>{{ v.text }}</span>\n </span>\n <span class=\"mii-summary\" role=\"status\" aria-live=\"polite\">{{ summary() }}</span>\n </div>\n\n <div class=\"mii-toolbar__stats\" aria-label=\"Rows by outcome\">\n <span class=\"mii-status mii-status--count\" data-status=\"valid\" matTooltip=\"Rows that will be added\">\n <mat-icon aria-hidden=\"true\">check_circle</mat-icon><span>{{ s.ready }}</span>\n </span>\n @if (s.duplicates > 0) {\n <span class=\"mii-status mii-status--count\" data-status=\"duplicate\" matTooltip=\"Rows that repeat an earlier row — left out\">\n <mat-icon aria-hidden=\"true\">content_copy</mat-icon><span>{{ s.duplicates }}</span>\n </span>\n }\n @if (s.picking > 0) {\n <span class=\"mii-status mii-status--count\" data-status=\"choice\" matTooltip=\"Rows waiting on a match you pick\">\n <mat-icon aria-hidden=\"true\">rule</mat-icon><span>{{ s.picking }}</span>\n </span>\n }\n @if (s.overridable > 0) {\n <span class=\"mii-status mii-status--count\" data-status=\"overridable\" matTooltip=\"Rows with a warning to review\">\n <mat-icon aria-hidden=\"true\">flag</mat-icon><span>{{ s.overridable }}</span>\n </span>\n }\n @if (s.blocked > 0) {\n <span class=\"mii-status mii-status--count\" data-status=\"invalid\" matTooltip=\"Rows the sheet has to fix\">\n <mat-icon aria-hidden=\"true\">error</mat-icon><span>{{ s.blocked }}</span>\n </span>\n }\n @if (s.failed > 0) {\n <span class=\"mii-status mii-status--count\" data-status=\"error\" matTooltip=\"Rows that failed to check\">\n <mat-icon aria-hidden=\"true\">report</mat-icon><span>{{ s.failed }}</span>\n </span>\n }\n @if (s.queued > 0) {\n <span class=\"mii-status mii-status--count\" data-status=\"pending\" [matTooltip]=\"stopped() ? 'Rows never checked — the run was stopped' : 'Rows still queued'\">\n <mat-icon aria-hidden=\"true\">{{ stopped() ? 'block' : 'schedule' }}</mat-icon><span>{{ s.queued }}</span>\n </span>\n }\n </div>\n\n <div class=\"mii-toolbar__tools\">\n @if (stage() === 'validating') {\n <!-- The run itself: hold it between rows, or end it and keep what settled -->\n @if (paused()) {\n <button type=\"button\" class=\"mii-tool mii-tool--pause mii-tool--on\" matTooltip=\"Carry on checking the remaining rows\" (click)=\"resumeRun()\">\n <mat-icon aria-hidden=\"true\">play_arrow</mat-icon>\n <span>Resume</span>\n </button>\n } @else {\n <button type=\"button\" class=\"mii-tool mii-tool--pause\" [disabled]=\"runState() !== 'running'\" matTooltip=\"Hold the run after the row being checked\" (click)=\"pauseRun()\">\n <mat-icon aria-hidden=\"true\">pause</mat-icon>\n <span>Pause</span>\n </button>\n }\n <button type=\"button\" class=\"mii-tool mii-tool--stop\" [disabled]=\"runState() === 'stopping'\" matTooltip=\"End the run — rows checked so far stay; the rest are left unchecked\" (click)=\"stopRun()\">\n <mat-icon aria-hidden=\"true\">stop</mat-icon>\n <span>{{ runState() === 'stopping' ? 'Stopping…' : 'Stop' }}</span>\n </button>\n } @else {\n @if (stopped()) {\n <button type=\"button\" class=\"mii-tool mii-tool--again\" matTooltip=\"Check every row again from the start\" (click)=\"checkAgain()\">\n <mat-icon aria-hidden=\"true\">replay</mat-icon>\n <span>Check again</span>\n </button>\n }\n <button type=\"button\" class=\"mii-tool mii-tool--mapping\" matTooltip=\"Change which column fills which field\" (click)=\"goTo('match')\">\n <mat-icon aria-hidden=\"true\">tune</mat-icon>\n <span>Edit mapping</span>\n </button>\n }\n @if (s.needsAttention > 0) {\n <button\n type=\"button\"\n class=\"mii-tool mii-tool--attention\"\n [class.mii-tool--on]=\"onlyAttention()\"\n [attr.aria-pressed]=\"onlyAttention()\"\n [matTooltip]=\"onlyAttention() ? 'Show every row again' : 'Hide the rows that are already ready'\"\n (click)=\"toggleAttentionFilter()\"\n >\n <mat-icon aria-hidden=\"true\">filter_alt</mat-icon>\n <span>{{ onlyAttention() ? 'Needs me' : 'All rows' }}</span>\n </button>\n }\n @if (s.duplicates > 0) {\n <button\n type=\"button\"\n class=\"mii-tool mii-tool--duplicates\"\n [class.mii-tool--on]=\"hideDuplicates()\"\n [attr.aria-pressed]=\"hideDuplicates()\"\n [matTooltip]=\"hideDuplicates() ? 'Show the duplicate rows again' : 'Hide the duplicate rows — what is left is what gets added'\"\n (click)=\"toggleHideDuplicates()\"\n >\n <mat-icon aria-hidden=\"true\">content_copy</mat-icon>\n <span>{{ hideDuplicates() ? 'Duplicates hidden' : 'Hide duplicates' }}</span>\n </button>\n }\n <button\n type=\"button\"\n class=\"mii-tool mii-tool--columns\"\n [class.mii-tool--on]=\"hiddenCount() > 0\"\n [matMenuTriggerFor]=\"columnMenu\"\n matTooltip=\"Choose which columns the table shows\"\n aria-label=\"Choose columns\"\n >\n <mat-icon aria-hidden=\"true\">view_column</mat-icon>\n <span>{{ hiddenCount() > 0 ? hiddenCount() + ' hidden' : 'Columns' }}</span>\n </button>\n </div>\n </div>\n\n <mat-menu #columnMenu=\"matMenu\">\n <button type=\"button\" mat-menu-item class=\"mii-col-menu__all\" (click)=\"showAllColumns()\">\n <mat-icon aria-hidden=\"true\">select_all</mat-icon>\n <span>Show all columns</span>\n </button>\n <button type=\"button\" mat-menu-item class=\"mii-col-menu__issues\" [disabled]=\"columnIssueCounts().size === 0\" (click)=\"showOnlyIssueColumns()\">\n <mat-icon aria-hidden=\"true\">filter_alt</mat-icon>\n <span>Only columns with issues</span>\n </button>\n @for (column of reviewColumns(); track column.key) {\n <button type=\"button\" mat-menu-item class=\"mii-col-menu__item\" (click)=\"toggleColumn(column.key); $event.stopPropagation()\">\n <mat-icon aria-hidden=\"true\">{{ isColumnVisible(column.key) ? 'check_box' : 'check_box_outline_blank' }}</mat-icon>\n <span>{{ column.label }}</span>\n @if (columnIssueCounts().get(column.key); as count) {\n <span class=\"mii-col-menu__count\">&nbsp;({{ count }})</span>\n }\n </button>\n }\n </mat-menu>\n\n @if (stage() === 'validating') {\n <mat-progress-bar class=\"mii-progress\" mode=\"determinate\" [value]=\"progressPct()\" aria-label=\"Validation progress\" />\n }\n\n <!-- The one thing the reviewer can fix here and now, spelled out -->\n @if (stage() === 'reviewed' && s.picking > 0) {\n <p class=\"mii-guide\" role=\"status\">\n <mat-icon aria-hidden=\"true\">rule</mat-icon>\n <span>\n <strong>{{ s.picking }} {{ s.picking === 1 ? 'row matches' : 'rows match' }} more than one option.</strong>\n Pick the one you meant in the amber cell — that row is re-checked on its own.\n </span>\n </p>\n }\n\n <div class=\"mii-scroll\">\n <table class=\"mii-table\">\n <thead>\n <tr>\n <th scope=\"col\" class=\"mii-th mii-th--expand\">\n <span class=\"mii-sr-only\">Details</span>\n </th>\n <th scope=\"col\" class=\"mii-th mii-th--index\">\n <span aria-hidden=\"true\">#</span>\n <span class=\"mii-sr-only\">Row</span>\n </th>\n <th scope=\"col\" class=\"mii-th\">Status</th>\n @for (column of visibleColumns(); track column.key) {\n <th scope=\"col\" class=\"mii-th\">{{ column.label }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of visibleRows(); track row.index) {\n <tr\n class=\"mii-row\"\n [class.mii-row--held]=\"row.held\"\n [class.mii-row--open]=\"isRowOpen(row.index)\"\n [attr.data-status]=\"row.status\"\n [attr.id]=\"'mii-row-' + row.index\"\n >\n <td class=\"mii-td mii-td--expand\">\n <button\n type=\"button\"\n class=\"mii-expand\"\n [class.mii-expand--open]=\"isRowOpen(row.index)\"\n [attr.aria-expanded]=\"isRowOpen(row.index)\"\n [attr.aria-label]=\"(isRowOpen(row.index) ? 'Hide' : 'Show') + ' details for row ' + (row.index + 1)\"\n (click)=\"toggleRow(row.index)\"\n >\n <mat-icon aria-hidden=\"true\">chevron_right</mat-icon>\n </button>\n </td>\n <td class=\"mii-td mii-td--index\" [attr.title]=\"row.source || null\">{{ row.index + 1 }}</td>\n <td class=\"mii-td mii-td--status\">\n <span class=\"mii-status-cell\">\n <span class=\"mii-status\" [attr.data-status]=\"row.status\">\n <mat-icon aria-hidden=\"true\">{{ rechecking().has(row.index) ? 'hourglass_top' : row.icon }}</mat-icon>\n <span>{{ rechecking().has(row.index) ? 'Checking' : row.label }}</span>\n </span>\n @if (row.repeatedBy.length > 0) {\n <span class=\"mii-badge mii-badge--group\" [matTooltip]=\"keptFor(row.repeatedBy)\">\n +{{ row.repeatedBy.length }}\n </span>\n }\n @if (row.issues.length > 0) {\n <span class=\"mii-badge\" [matTooltip]=\"row.issues.length + (row.issues.length === 1 ? ' issue' : ' issues') + ' — open the row to see them'\">\n {{ row.issues.length }}\n </span>\n }\n </span>\n </td>\n @for (cell of row.cells; track cell.key) {\n <td class=\"mii-td\" [class.mii-td--error]=\"!!cell.error\" [class.mii-td--choice]=\"!!cell.choices\">\n @if (cell.choices; as choices) {\n <!--\n The text fits several options. The pick is the whole\n cell of a single select, or the one matching entry of a\n multi-select; the row is re-checked as soon as it lands.\n -->\n <div class=\"mii-choice\" role=\"group\" [attr.aria-label]=\"'Pick a match for ' + cell.label\">\n @for (choice of choices; track choice.text) {\n <label class=\"mii-choice__item\">\n <span class=\"mii-choice__text\">“{{ choice.text }}”</span>\n <span class=\"mii-choice__field\">\n <select\n class=\"mii-choice__select\"\n [disabled]=\"rechecking().has(row.index)\"\n (change)=\"pickOption(row.index, cell, choice, $event)\"\n >\n <option value=\"\" selected disabled>{{ choice.candidates.length }} matches — pick one</option>\n @for (candidate of choice.candidates; track $index) {\n <option [value]=\"$index\">{{ candidate.label }}</option>\n }\n </select>\n <mat-icon class=\"mii-choice__chevron\" aria-hidden=\"true\">expand_more</mat-icon>\n </span>\n </label>\n }\n </div>\n } @else {\n <span class=\"mii-cell-line\">\n @if (cell.text) {\n <span class=\"mii-cell\" [attr.title]=\"cell.text\">{{ cell.text }}</span>\n } @else {\n <span class=\"mii-cell mii-cell--empty\" aria-hidden=\"true\">—</span>\n }\n @if (cell.typed; as typed) {\n <!-- The import swapped what was typed for the option's stored value -->\n <mat-icon\n class=\"mii-cell__swap\"\n [matTooltip]=\"'Typed as “' + typed + '” — matched to ' + cell.text\"\n [attr.aria-label]=\"'Typed as ' + typed + ', matched to ' + cell.text\"\n >swap_horiz</mat-icon>\n }\n @if (cell.combined; as note) {\n <!-- The value was combined from every row that repeats this one -->\n <mat-icon class=\"mii-cell__swap mii-cell__combined\" [matTooltip]=\"note\" [attr.aria-label]=\"note\">functions</mat-icon>\n }\n </span>\n }\n @if (cell.error) {\n <span class=\"mii-cell-error\">\n <mat-icon aria-hidden=\"true\">error</mat-icon>\n <span>{{ cell.error }}</span>\n </span>\n }\n </td>\n }\n </tr>\n @if (isRowOpen(row.index)) {\n <!-- Detail panel: everything about one row, in one place -->\n <tr class=\"mii-detail-row\">\n <td class=\"mii-td mii-td--detail\" [attr.colspan]=\"visibleColumns().length + 3\">\n <div class=\"mii-detail\">\n <div class=\"mii-detail__head\">\n <span class=\"mii-detail__title\">Row {{ row.index + 1 }}</span>\n @if (row.source) {\n <span class=\"mii-detail__source\">{{ row.source }}</span>\n }\n <span class=\"mii-status\" [attr.data-status]=\"row.status\">\n <mat-icon aria-hidden=\"true\">{{ row.icon }}</mat-icon>\n <span>{{ row.label }}</span>\n </span>\n <span class=\"mii-detail__spacer\"></span>\n <button type=\"button\" class=\"mii-detail__close\" aria-label=\"Hide row details\" (click)=\"toggleRow(row.index)\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n </div>\n\n @if (row.systemError; as sys) {\n <p class=\"mii-detail__line mii-detail__line--sys\">\n <mat-icon aria-hidden=\"true\">bug_report</mat-icon>\n <span>{{ sys }}</span>\n </p>\n }\n\n @if (row.duplicateOf !== undefined) {\n <p class=\"mii-detail__line mii-detail__dup\">\n <mat-icon aria-hidden=\"true\">content_copy</mat-icon>\n <span>\n Same record as row {{ row.duplicateOf + 1 }} — left out.\n <button type=\"button\" class=\"mii-detail__link\" (click)=\"jumpToRow(row.duplicateOf)\">\n Go to row {{ row.duplicateOf + 1 }}\n </button>\n <button type=\"button\" class=\"mii-detail__link\" [disabled]=\"!canKeepRows()\" (click)=\"keepRow(row.index)\">\n Keep this row instead\n </button>\n </span>\n </p>\n }\n\n @if (row.repeatedBy.length > 0) {\n <p class=\"mii-detail__line mii-detail__dup\">\n <mat-icon aria-hidden=\"true\">layers</mat-icon>\n <span>{{ keptFor(row.repeatedBy) }}</span>\n </p>\n @for (note of row.combinedNotes; track $index) {\n <p class=\"mii-detail__line mii-detail__combined\">\n <mat-icon aria-hidden=\"true\">functions</mat-icon>\n <span>{{ note }}</span>\n </p>\n }\n }\n\n @if (row.status === 'pending' && stopped()) {\n <p class=\"mii-detail__line mii-detail__dup\">\n <mat-icon aria-hidden=\"true\">block</mat-icon>\n <span>The run was stopped before this row was checked.</span>\n </p>\n } @else if (row.issues.length > 0) {\n <span class=\"mii-detail__label\">\n {{ row.issues.length }} {{ row.issues.length === 1 ? 'issue' : 'issues' }}\n </span>\n <ul class=\"mii-issues\">\n @for (issue of row.issues; track $index) {\n <li class=\"mii-issue\" [attr.data-kind]=\"issue.kind\">\n <mat-icon aria-hidden=\"true\">{{ issue.kind === 'warning' ? 'flag' : 'error_outline' }}</mat-icon>\n <span class=\"mii-issue__column\">{{ issue.column }}</span>\n <span class=\"mii-issue__message\">{{ issue.message }}</span>\n </li>\n }\n </ul>\n } @else if (!row.systemError && row.duplicateOf === undefined) {\n <p class=\"mii-detail__line mii-detail__clean\">\n <mat-icon aria-hidden=\"true\">check_circle</mat-icon>\n <span>Nothing wrong with this row — it will be added as shown.</span>\n </p>\n }\n </div>\n </td>\n </tr>\n }\n }\n </tbody>\n </table>\n\n @if (visibleRows().length === 0 && reviewRows().length > 0) {\n <p class=\"mii-empty\">No rows match the filters — everything else is ready.</p>\n }\n </div>\n </section>\n }\n }\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"mii__actions\">\n <button type=\"button\" mat-button class=\"mii__cancel\" [disabled]=\"busy()\" (click)=\"cancel()\">Cancel</button>\n <span class=\"mii__actions-spacer\"></span>\n @if (step() !== 'upload') {\n <button type=\"button\" mat-stroked-button class=\"mii__back\" [disabled]=\"busy()\" (click)=\"back()\">Back</button>\n }\n @if (step() === 'review') {\n <button type=\"button\" mat-flat-button color=\"primary\" class=\"mii__add\" [disabled]=\"!canAdd()\" (click)=\"add()\">\n {{ addLabel() }}\n </button>\n } @else {\n <button type=\"button\" mat-flat-button color=\"primary\" class=\"mii__next\" [disabled]=\"!nextAction().enabled\" (click)=\"next()\">\n {{ nextAction().label }}\n </button>\n }\n</mat-dialog-actions>\n\n<!-- One save form, shown on the Match step's panel and under the Duplicates step: it saves the matches, the row filters and the duplicate check together. -->\n<ng-template #saveForm>\n @if (recipeToSave(); as toSave) {\n <lib-import-recipe-save\n [recipe]=\"toSave\"\n [existing]=\"storedRecipes()\"\n [conflict]=\"recipeConflict()\"\n [saving]=\"recipeSaving()\"\n [blockedReason]=\"saveBlockedReason()\"\n [unfinished]=\"saveUnfinished()\"\n [edited]=\"savedEdited()\"\n (saveNew)=\"saveRecipeAsNew($event)\"\n (update)=\"updateRecipe()\"\n (saveCopy)=\"saveRecipeAsNew($event)\"\n />\n }\n</ng-template>\n","/**\n * Pure helpers behind the multiple-input spreadsheet import.\n *\n * Two concerns, both Angular-free so they can be tested directly:\n *\n * 1. {@link mapSpreadsheetRows} — matches a sheet's headers to the columns a\n * field expects (see `describeImportColumns` in the import controller's\n * `importTemplate.ts`, which also builds the template those columns are\n * offered in) and re-keys the rows by `formControlName`, the shape\n * `TFormImportController` validates.\n * 2. {@link coerceImportedRow} + {@link toMultipleInputRow} — turn a settled,\n * valid row into the composite-keyed record the table stores, with cells\n * coerced to the child's declared data type.\n */\nimport { InputDataTypes } from 'ngx-t-forms-types';\nimport type { FormColumnInputs } from 'ngx-t-forms-types';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport type { ImportColumn } from '../../../../../services/core/t-form-import-controller/functions/importTemplate';\nimport { multipleInputRowIdKey } from '../../../../../services/core/t-form-tower-controller/functions/ensureMultipleInputRowIds';\n\n/** Result of matching a sheet against a field's {@link ImportColumn}s. */\nexport interface SpreadsheetRowMapping {\n /** Rows re-keyed by column key, ready for the import controller. Blank rows are dropped. */\n readonly rows: Record<string, unknown>[];\n /** Keys of the columns that found a header, in column order. */\n readonly matched: readonly string[];\n /** Sheet headers that fed no column, in sheet order. */\n readonly ignored: readonly string[];\n /** Labels of required, importable columns no header matched. */\n readonly missingRequired: readonly string[];\n}\n\n/** The subset of a MultipleInput column the row helpers read. */\ntype MultipleInputColumn = Pick<FormColumnInputs, 'id' | 'formInputs'>;\n\n/** Header comparison key: trimmed and case-folded. */\nconst normalise = (header: string): string => header.trim().toLowerCase();\n\nconst isBlank = (value: unknown): boolean =>\n value === null || value === undefined || (typeof value === 'string' && value.trim() === '');\n\nconst hasUsableId = (candidate: unknown): boolean =>\n candidate !== undefined &&\n candidate !== null &&\n !(typeof candidate === 'string' && candidate.trim().length === 0);\n\n/**\n * Matches a sheet's headers to `columns` and re-keys every row by column key.\n *\n * A header is claimed by the first column it matches — by exact key, then by\n * key or alias case-insensitively — and never by a second one. Headers that\n * claim nothing are reported as ignored rather than carried along, so an `id`\n * column or a bulk template's `$index` can never leak into a row. Cells that are\n * `null` / `undefined` are omitted (the field keeps its default); empty strings\n * are passed through, exactly as the bulk import receives them. A row whose\n * every mapped cell is blank is dropped.\n */\nexport function mapSpreadsheetRows(\n columns: readonly ImportColumn[],\n rawRows: readonly Record<string, unknown>[],\n): SpreadsheetRowMapping {\n const headers = [...new Set(rawRows.flatMap((row) => (row && typeof row === 'object' ? Object.keys(row) : [])))];\n const headerByNorm = new Map<string, string>();\n for (const header of headers) {\n const key = normalise(header);\n if (key && !headerByNorm.has(key)) headerByNorm.set(key, header);\n }\n\n const claimed = new Set<string>();\n const headerFor = new Map<string, string>();\n for (const column of columns) {\n if (!column.importable) continue;\n let header: string | undefined;\n if (headers.includes(column.key) && !claimed.has(column.key)) {\n header = column.key;\n } else {\n for (const candidate of [column.key, ...column.aliases]) {\n const found = headerByNorm.get(normalise(candidate));\n if (found && !claimed.has(found)) {\n header = found;\n break;\n }\n }\n }\n if (header) {\n claimed.add(header);\n headerFor.set(column.key, header);\n }\n }\n\n const rows: Record<string, unknown>[] = [];\n for (const raw of rawRows) {\n if (!raw || typeof raw !== 'object') continue;\n const row: Record<string, unknown> = {};\n let hasValue = false;\n for (const [key, header] of headerFor) {\n const value = raw[header];\n if (value === null || value === undefined) continue;\n if (!isBlank(value)) hasValue = true;\n row[key] = value;\n }\n if (hasValue) rows.push(row);\n }\n\n return {\n rows,\n matched: [...headerFor.keys()],\n ignored: headers.filter((header) => !claimed.has(header)),\n missingRequired: columns\n .filter((column) => column.importable && column.required && !headerFor.has(column.key))\n .map((column) => column.label),\n };\n}\n\n/**\n * Coerces one settled cell to the child's declared data type.\n *\n * Spreadsheet cells arrive as text; the form stores what its own inputs would\n * have produced — a number input a number, a toggle a boolean, a structured\n * input a parsed object. Anything that does not parse is returned unchanged\n * rather than blanked, and dates are left as the tower settled them (the\n * tower already accepts the string forms an export produces).\n */\nexport function coerceCell(value: unknown, dataType: InputDataTypes | undefined): unknown {\n if (value === null || value === undefined) return value;\n\n switch (dataType) {\n case InputDataTypes.Number: {\n if (typeof value !== 'string') return value;\n const text = value.trim();\n if (text === '') return value;\n const parsed = Number(text);\n return Number.isFinite(parsed) ? parsed : value;\n }\n case InputDataTypes.Boolean: {\n if (typeof value === 'boolean') return value;\n if (typeof value === 'number') return value !== 0;\n if (typeof value !== 'string') return value;\n const text = value.trim().toLowerCase();\n if (['true', 'yes', 'y', '1'].includes(text)) return true;\n if (['false', 'no', 'n', '0'].includes(text)) return false;\n return value;\n }\n case InputDataTypes.Array:\n case InputDataTypes.Object: {\n if (typeof value !== 'string') return value;\n const text = value.trim();\n const looksStructured =\n (text.startsWith('[') && text.endsWith(']')) || (text.startsWith('{') && text.endsWith('}'));\n if (!looksStructured) return value;\n try {\n return JSON.parse(text);\n } catch {\n return value;\n }\n }\n default:\n return value;\n }\n}\n\n/** Applies {@link coerceCell} to every cell of a settled row, by the matching child's `dataType`. */\nexport function coerceImportedRow(\n input: MultipleInputColumn,\n settled: Record<string, unknown>,\n): Record<string, unknown> {\n const byKey = childrenByFormControlName(input);\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(settled)) {\n out[key] = coerceCell(value, byKey.get(key)?.dataType);\n }\n return out;\n}\n\n/**\n * Converts a settled row (keyed by child `formControlName`, plus `id`) into the\n * composite-keyed record the multiple-input table stores:\n * `{ \"<inputId>.id\": …, \"<inputId>.<childId>\": … }` — the same rewrite the tower\n * applies in `initializeFormValues`. A key that matches no child is kept\n * verbatim so nothing the tower produced is silently lost; a row without a\n * usable id is given a fresh one.\n */\nexport function toMultipleInputRow(\n input: MultipleInputColumn,\n settled: Record<string, unknown>,\n): Record<string, unknown> {\n const byKey = childrenByFormControlName(input);\n const row: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(settled)) {\n if (key === 'id') continue;\n const child = byKey.get(key);\n row[child ? `${input.id}.${child.id}` : key] = value;\n }\n const id = settled['id'];\n row[multipleInputRowIdKey(input.id)] = hasUsableId(id) ? id : uuidv4();\n return row;\n}\n\nfunction childrenByFormControlName(input: MultipleInputColumn): Map<string, FormColumnInputs> {\n return new Map(\n (input.formInputs ?? [])\n .filter((child): child is FormColumnInputs => !!child?.formControlName && !!child.id)\n .map((child) => [child.formControlName, child]),\n );\n}\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n ErrorHandler,\r\n ViewEncapsulation,\r\n inject,\r\n input,\r\n untracked,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FormGroup, NgControl } from '@angular/forms';\r\nimport { MatTableDataSource } from '@angular/material/table';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { MatMenuModule } from '@angular/material/menu';\r\n\r\nimport { IMultiple, IMultipleInputCal, ITowerStepColumn, MultipleInputAvailableOperations } from 'ngx-t-forms-types';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\n\r\nimport { MultipleInputTableViewComponent } from '../multiple-input-table-view/multiple-input-table-view.component';\r\nimport { MultipleInputTableEditComponent } from '../multiple-input-table-edit/multiple-input-table-edit.component';\r\n\r\nimport { FormBuilderFunctions } from 'ngx-t-forms-types';\r\nimport { getCaluculatedTableData } from '../../functions/getListCalculated';\r\nimport { missingRequiredFields } from '../../functions/missingRequiredFields';\r\nimport { injectCurrencyRoundingDefaults } from '../../../../../../services/core/t-form-localization/inject-forms-localization';\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\nimport { CdkDragDrop } from '@angular/cdk/drag-drop';\r\n\r\nimport { _isEqual } from '../../../../../../shared/functions/isEqual';\r\nimport { SPREADSHEET_PARSER } from '../../../../../../tokens/spreadsheet-parser.token';\r\nimport {\r\n MULTIPLE_INPUT_IMPORT_DIALOG_WIDTH,\r\n MultipleInputImportDialogComponent,\r\n type MultipleInputImportDialogData,\r\n type MultipleInputImportDialogResult,\r\n} from '../multiple-input-import-dialog/multiple-input-import-dialog.component';\r\nimport { coerceImportedRow, toMultipleInputRow } from '../../functions/spreadsheetImport';\r\nimport { SpreadsheetTemplateService } from '../spreadsheet-template/spreadsheet-template.service';\r\n\r\n/**\r\n * A single row inside a multiple-input table. Keys are dynamic — composed from the input\r\n * config id plus child input ids — so values are typed as `unknown`. Narrow at access sites.\r\n */\r\ntype MultipleInputRow = Record<string, unknown> & { id?: string };\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n controlType: 'app-multiple-input-table',\r\n nextId: 0,\r\n};\r\n\r\n@Component({\r\n selector: 'lib-multiple-input-table',\r\n templateUrl: './multiple-input-table.component.html',\r\n styleUrls: ['./multiple-input-table.component.css'],\r\n imports: [\r\n MatButtonModule,\r\n MatIconModule,\r\n MatMenuModule,\r\n MultipleInputTableEditComponent,\r\n MultipleInputTableViewComponent,\r\n ],\r\n providers: [{ provide: MatFormFieldControl, useExisting: MultipleInputTableComponent }],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n})\r\nexport class MultipleInputTableComponent extends BaseCustomInput<MultipleInputRow[] | null> {\r\n readonly editorMode = input<boolean>(false);\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n\r\n readonly #destroyRef = inject(DestroyRef);\r\n readonly #dialog = inject(MatDialog);\r\n /** The host's spreadsheet parser, when it opted in through `withSpreadsheetImport()`. */\r\n readonly #spreadsheetParser = inject(SPREADSHEET_PARSER, { optional: true });\r\n readonly #templates = inject(SpreadsheetTemplateService);\r\n readonly #errorHandler = inject(ErrorHandler);\r\n /** The consumer's currency defaults, so a summary row rounds like its column. */\r\n readonly #currencyDefaults = injectCurrencyRoundingDefaults();\r\n\r\n constructor() {\r\n super(\r\n inject(NgControl, { self: true, optional: true })!,\r\n inject<ElementRef<HTMLElement>>(ElementRef),\r\n customInputConfig,\r\n );\r\n this.listenToValueChanges();\r\n }\r\n\r\n /**\r\n * Manages custom validation errors on the form control.\r\n * Intended to be called from the ngDoCheck lifecycle hook.\r\n * This function handles both the 'required' error and the new\r\n * 'multipleInputListMissingSomeFields' custom error.\r\n */\r\n override checkValidationsAnErrors() {\r\n const control = this.ngControl?.control;\r\n\r\n // 1. Early exit if there's no form control to work with.\r\n if (!control) {\r\n return;\r\n }\r\n\r\n // --- DEFINE THE DESIRED ERROR STATE ---\r\n\r\n // 2. Determine if the custom \"multiple fields\" error should exist.\r\n const missingFields = this.#missingRequiredFields();\r\n\r\n // 3. Determine if the standard 'required' error should exist.\r\n const shouldHaveRequiredError = this.required && this._isNilOrEmpty(this.value);\r\n\r\n\r\n // --- APPLY THE ERROR STATE TO THE CONTROL ---\r\n\r\n // 4. Preserve other errors that might be on the control (e.g., minlength, pattern).\r\n const newErrors = { ...control.errors };\r\n delete newErrors['required'];\r\n delete newErrors['multipleInputListMissingSomeFields'];\r\n\r\n\r\n // 5. Add our managed errors back if their conditions are met.\r\n if (shouldHaveRequiredError) {\r\n newErrors['required'] = true;\r\n }\r\n if (missingFields.length > 0) {\r\n // `missing` names the offending rows/fields so the rendered message can\r\n // tell the user exactly what to fix — see inputErrorMessage.ts.\r\n newErrors['multipleInputListMissingSomeFields'] = { value: true, missing: missingFields };\r\n }\r\n\r\n // 6. Finalize the error object. If no errors, it must be null.\r\n const finalErrors = Object.keys(newErrors).length > 0 ? newErrors : null;\r\n\r\n // 7. IMPORTANT: Only update the control if the errors have actually changed.\r\n // This prevents infinite loops within ngDoCheck. A simple stringify is a\r\n // dependency-free way to compare the error objects.\r\n if (JSON.stringify(control.errors) !== JSON.stringify(finalErrors)) {\r\n control.setErrors(finalErrors);\r\n }\r\n }\r\n\r\n\r\n override get empty() {\r\n return !this.value;\r\n }\r\n\r\n override get shouldLabelFloat() {\r\n return this.focused || !this.empty;\r\n }\r\n\r\n override get errorState(): boolean {\r\n // 1. Check for standard validation errors from Angular's Forms API.\r\n const hasStandardError = !!this.ngControl?.errors;\r\n\r\n // 2. Check for custom validation errors specific to 'IMultiple' type.\r\n const hasCustomError = this.#missingRequiredFields().length > 0;\r\n\r\n // 3. The final error state is true if *any* validation fails,\r\n // AND the control has been \"touched\" by the user.\r\n return (hasStandardError || hasCustomError) && this.touched;\r\n }\r\n\r\n private _isNilOrEmpty(value: unknown): boolean {\r\n return value === null || value === undefined || value === '';\r\n }\r\n\r\n /**\r\n * Rows (1-based, in value order) whose required child inputs are empty,\r\n * each with the labels of the inputs still missing. Drives both `errorState`\r\n * and the `multipleInputListMissingSomeFields` error payload.\r\n */\r\n #missingRequiredFields(): Array<{ row: number; fields: string[] }> {\r\n const configId = this.inputConfig().id;\r\n return missingRequiredFields(\r\n (this.inputConfig() as IMultiple)?.formInputs,\r\n this.value,\r\n (row, f) => row[`${configId}.${f.id}`],\r\n ).map(({ index, inputs }) => ({ row: index + 1, fields: inputs.map(f => f.label || f.id) }));\r\n }\r\n\r\n\r\n /// En of implementations of MatFormFieldControl\r\n applyOptionsTo: MultipleInputRow | undefined;\r\n dataSource!: MatTableDataSource<MultipleInputRow>;\r\n\r\n listenToValueChanges(): void {\r\n this.stateChanges\r\n .pipe(takeUntilDestroyed(this.#destroyRef))\r\n .subscribe(() => {\r\n this.checkItemList();\r\n });\r\n }\r\n\r\n checkItemList(): boolean {\r\n try {\r\n if (this.value) {\r\n const config = this.inputConfig();\r\n const TableData: MultipleInputRow[] = ((config as IMultiple).groupBy?.length ?? 0) > 0\r\n ? addGroups(\r\n this.value,\r\n (config as IMultiple).groupBy,\r\n )\r\n : this.value;\r\n const data = getCaluculatedTableData(config, TableData, untracked(this.#currencyDefaults)) as MultipleInputRow[];\r\n\r\n if (!this.dataSource) {\r\n this.dataSource = new MatTableDataSource<MultipleInputRow>(data);\r\n this.dataSource;\r\n } else {\r\n this.dataSource.data = data;\r\n }\r\n }\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n }\r\n\r\n multipleInputRemoveItem(item: MultipleInputRow | undefined): void {\r\n if (!item) return;\r\n if (!this.value) return;\r\n this.value = this.value.filter((i) => !_isEqual(i, item));\r\n\r\n this.applyOptionsTo = undefined;\r\n this.onChange(this.value);\r\n this.stateChanges.next();\r\n }\r\n\r\n\r\n generateMultipleInputForm(): void {\r\n const id = this.inputConfig()?.id;\r\n if (!id) return;\r\n this.formBuilderFunctions()?.multipleInputToggleForm(id, true);\r\n }\r\n\r\n rowInViewOnly: string | undefined = undefined;\r\n\r\n editRow(rowId: string): void {\r\n if (!rowId) {\r\n throw new Error('Row id not provided');\r\n }\r\n\r\n const config = this.inputConfig();\r\n const fbf = this.formBuilderFunctions();\r\n if (!fbf || !config) return;\r\n\r\n fbf.multipleInputEditRow(config.id, rowId);\r\n\r\n // if( !this.inputConfig?.multipleInputController){\r\n // return\r\n // }\r\n // this.inputConfig.multipleInputInEditId = this.applyOptionsTo.id;\r\n // this.inputConfig.applyMultipleInputValuesToForm(\r\n // this.applyOptionsTo\r\n // );\r\n }\r\n\r\n copy(rowId: string): void {\r\n const config = this.inputConfig();\r\n const fbf = this.formBuilderFunctions();\r\n if (!fbf || !config) return;\r\n fbf.multipleInputDuplicateRow(config.id, rowId);\r\n // this.generateMultipleInputForm();\r\n // this.inputConfig?.applyMultipleInputValuesToForm(\r\n // this.applyOptionsTo\r\n // );\r\n // this.applyOptionsTo = undefined;\r\n }\r\n\r\n protected get handleLabel(): string | undefined {\r\n return (this.inputConfig() as IMultiple)?.handleLabel;\r\n }\r\n\r\n handleIcon(): string {\r\n // NOTE(phase-4): `handleIcon` is declared on `IBasicFormInput` but not on `IMultiple` directly;\r\n // narrow through `ITowerStepColumn` (which extends FormColumnInputs) and provide a string fallback.\r\n const cfg = this.inputConfig() as ITowerStepColumn & { handleIcon?: string };\r\n return cfg?.handleIcon || 'add';\r\n }\r\n\r\n saveMultipleInputForm(): void {\r\n this.formBuilderFunctions()?.multipleInputSaveForm(this.inputConfig().id);\r\n\r\n // const value: any = this.inputConfig?.multipleInputFormValue();\r\n\r\n // value['id'] = uuidv4();\r\n\r\n // if (!this.inputConfig) {\r\n // return\r\n // }\r\n\r\n // const previousValue = this.value\r\n // if (!previousValue) {\r\n // this.value = [value];\r\n // this.inputConfig.multipleInputController = undefined;\r\n\r\n // } else {\r\n // if (this.inputConfig?.multipleInputInEditId) {\r\n // let inEdit = previousValue.find(\r\n // (i: { id: any }) =>\r\n // i.id === this.inputConfig?.multipleInputInEditId\r\n // );\r\n // Object.keys(inEdit).every((s) => {\r\n // s;\r\n // inEdit[s] = value[s];\r\n // return !!inEdit[s];\r\n // });\r\n\r\n // this.value = [...previousValue],\r\n // this.inputConfig.multipleInputController = undefined;\r\n\r\n // } else {\r\n\r\n\r\n // this.value = [...previousValue, value];\r\n // this.inputConfig.multipleInputController = undefined;\r\n\r\n // }\r\n // }\r\n // this.onChange(this.value);\r\n // this.stateChanges.next();\r\n // this.checkItemList(this.value || []);\r\n // return\r\n\r\n\r\n }\r\n\r\n editInput(input: ITowerStepColumn): void {\r\n const fbf = this.formBuilderFunctions();\r\n if (typeof fbf?.editInput !== 'function') {\r\n throw new Error('editInput function not defined in formBuilderFunctions');\r\n }\r\n fbf.editInput(input);\r\n }\r\n\r\n deleteItemInput(input: ITowerStepColumn): void {\r\n this.formBuilderFunctions()?.deleteInput(input);\r\n }\r\n\r\n showItemAsLabel(input: ITowerStepColumn): void {\r\n this.formBuilderFunctions()?.multipleInputToggleLabel(input);\r\n }\r\n\r\n addFunction(func: IMultipleInputCal): void {\r\n this.formBuilderFunctions()?.addFunction(func, this.inputConfig()?.id);\r\n }\r\n\r\n // `FormBuilderFunctions.reorderItems` is now generic over the row shape; the\r\n // container/data slots stay `unknown` (opaque drag payload).\r\n reorderItems(event: CdkDragDrop<ITowerStepColumn[], unknown, unknown>): void {\r\n const config = this.inputConfig();\r\n const fbf = this.formBuilderFunctions();\r\n if (!fbf || !config) return;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Phase-4 TODO: deduplicate @angular/cdk peer dep in typings package; CdkDragDrop types are nominally distinct across copies.\r\n (fbf.reorderItems as any)(event, config.id);\r\n }\r\n\r\n /**\r\n * Whether the add button carries its menu (with \"Import from spreadsheet\"):\r\n * the host bound a parser and the field allows adding rows. The template\r\n * additionally hides the whole add-row bar for readonly / disabled /\r\n * open-form fields.\r\n */\r\n protected get canImportRows(): boolean {\r\n return this.#spreadsheetParser !== null && this.canAddRecords;\r\n }\r\n\r\n /**\r\n * Whether the menu also offers \"Download import template\": the host bound a\r\n * writer beside its parser. Never true without the import itself.\r\n */\r\n protected get canDownloadTemplate(): boolean {\r\n return this.canImportRows && this.#templates.available;\r\n }\r\n\r\n /**\r\n * Downloads the import template for this field: a workbook with the headers\r\n * the import matches and a guide to each column. The writer's failure, if\r\n * any, goes to the app's `ErrorHandler` — the menu has no surface of its own.\r\n */\r\n downloadImportTemplate(): void {\r\n const config = this.inputConfig();\r\n if (!this.canDownloadTemplate || !config) return;\r\n void this.#templates.download(config).catch((error: unknown) => this.#errorHandler.handleError(error));\r\n }\r\n\r\n /**\r\n * Opens the spreadsheet import for this field and appends the rows that\r\n * validate. Each row is checked by the same per-row tower the bulk import\r\n * uses for this field's sub-rows; only rows that settle valid come back.\r\n */\r\n importRowsFromSpreadsheet(): void {\r\n const config = this.inputConfig();\r\n if (!this.canImportRows || !config) return;\r\n\r\n this.#dialog\r\n .open<MultipleInputImportDialogComponent, MultipleInputImportDialogData, MultipleInputImportDialogResult>(\r\n MultipleInputImportDialogComponent,\r\n {\r\n data: { input: config, existingRowCount: this.value?.length ?? 0 },\r\n width: MULTIPLE_INPUT_IMPORT_DIALOG_WIDTH,\r\n // The pane may grow to the whole viewport: the dialog's full-screen toggle resizes it.\r\n maxWidth: '100vw',\r\n maxHeight: '100vh',\r\n autoFocus: 'first-tabbable',\r\n restoreFocus: true,\r\n // The dialog owns its own close paths; a stray Escape mid-validation\r\n // must not orphan a running session.\r\n disableClose: true,\r\n panelClass: 'lib-multiple-input-import-dialog__panel',\r\n },\r\n )\r\n .afterClosed()\r\n .pipe(takeUntilDestroyed(this.#destroyRef))\r\n .subscribe((rows) => this.#appendImportedRows(rows));\r\n }\r\n\r\n /**\r\n * Appends settled rows (keyed by child `formControlName`) to the value in the\r\n * composite shape the table stores, cells coerced to the child's data type.\r\n * Goes through the same value path as delete, so the tower sees one change.\r\n */\r\n #appendImportedRows(rows: MultipleInputImportDialogResult): void {\r\n if (!rows?.length) return;\r\n const config = this.inputConfig();\r\n const converted: MultipleInputRow[] = rows.map((row) =>\r\n toMultipleInputRow(config, coerceImportedRow(config, row)),\r\n );\r\n this.value = [...(this.value ?? []), ...converted];\r\n this.markAsTouched();\r\n }\r\n\r\n protected get parentFormGroup(): FormGroup | null {\r\n return this.ngControl?.control?.parent as FormGroup;\r\n }\r\n\r\n protected get canAddRecords() {\r\n const config = this.inputConfig();\r\n if (!config) return false;\r\n //NOTE: Temporary backward compatibility for older versions of the config that might not have the new property\r\n if (!config.multipleInputAvailableOperations) return true;\r\n return config.multipleInputAvailableOperations?.includes(MultipleInputAvailableOperations.Add);\r\n }\r\n}\r\n\r\n\r\n\r\nfunction addGroups(tableValue: MultipleInputRow[], groupBy: string[] | undefined): MultipleInputRow[] {\r\n throw new Error('Function not implemented.');\r\n}\r\n","<lib-multiple-input-table-view\n [inputConfig]=\"inputConfig()\"\n [dataSource]=\"dataSource\"\n [applyOptionsTo]=\"applyOptionsTo\"\n [formGroup]=\"parentFormGroup\"\n (onEditItem)=\"editRow($event)\"\n (showItemAsLabel)=\"showItemAsLabel(inputConfig())\"\n (onDeleteItem)=\"multipleInputRemoveItem(applyOptionsTo)\"\n (onCopy)=\"copy($event)\"\n (onApplyOptionsTo)=\"applyOptionsTo = $event\"\n></lib-multiple-input-table-view>\n\n@if (!!inputConfig().formIsOpen || !!rowInViewOnly) {\n <lib-multiple-input-table-edit\n [editorMode]=\"editorMode()\"\n (editMultipleInput)=\"editInput($event)\"\n (deleteInput)=\"deleteItemInput($event)\"\n (addFunction)=\"addFunction($event)\"\n (showItemAsLabel)=\"showItemAsLabel($event)\"\n (onSaveMultipleInputForm)=\"saveMultipleInputForm()\"\n (reorderItems)=\"reorderItems($event)\"\n [formBuilderFunctions]=\"formBuilderFunctions()\"\n [formGroup]=\"parentFormGroup\"\n [inputConfig]=\"inputConfig()\"\n ></lib-multiple-input-table-edit>\n}\n\n@if (!inputConfig().readonly && !inputConfig().disabled && !inputConfig().formIsOpen && canAddRecords) {\n <section class=\"add-row-bar\">\n <!--\n One dashed pill. The add button is the everyday action; once the host has\n bound a spreadsheet parser a narrow chevron segment joins it, opening the\n menu of other ways to add rows. Without a parser the pill is exactly the\n add button it always was.\n -->\n <div class=\"add-row-group\" [class.add-row-group--split]=\"canImportRows\">\n <button class=\"add-row-button\" (click)=\"generateMultipleInputForm()\" mat-stroked-button>\n <mat-icon class=\"add-row-icon\">{{ handleIcon() }}</mat-icon>\n <span class=\"add-row-label\">{{ handleLabel }}</span>\n </button>\n @if (canImportRows) {\n <button\n type=\"button\"\n class=\"add-row-more\"\n mat-stroked-button\n aria-label=\"More ways to add rows\"\n [attr.aria-expanded]=\"addRowMenuTrigger.menuOpen\"\n [matMenuTriggerFor]=\"addRowMenu\"\n #addRowMenuTrigger=\"matMenuTrigger\"\n >\n <mat-icon class=\"add-row-more-icon\">arrow_drop_down</mat-icon>\n </button>\n }\n </div>\n </section>\n}\n\n<mat-menu #addRowMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button\n type=\"button\"\n mat-menu-item\n class=\"add-row-menu-item add-row-menu-item--import\"\n (click)=\"importRowsFromSpreadsheet()\"\n >\n <mat-icon>upload_file</mat-icon>\n <div class=\"add-row-menu__text\">\n <div class=\"add-row-menu__main\">Import from spreadsheet</div>\n <div class=\"add-row-menu__sub\">Check the rows of a workbook and add the ones that pass</div>\n </div>\n </button>\n @if (canDownloadTemplate) {\n <button\n type=\"button\"\n mat-menu-item\n class=\"add-row-menu-item add-row-menu-item--template\"\n (click)=\"downloadImportTemplate()\"\n >\n <mat-icon>download</mat-icon>\n <div class=\"add-row-menu__text\">\n <div class=\"add-row-menu__main\">Download import template</div>\n <div class=\"add-row-menu__sub\">A workbook with the headers to fill in and a guide to each column</div>\n </div>\n </button>\n }\n </ng-template>\n</mat-menu>\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport type { FormBuilderFunctions, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { MultipleInputTableComponent } from './core/multiple-input-table/multiple-input-table.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/** Per-instance suffix for the read-only label id, so two tables never share one. */\r\nlet nextReadOnlyLabelId = 0;\r\n\r\n/**\r\n * Wraps a multi-row input table inside a `mat-form-field` — or, for a read-only\r\n * view, renders the table on the page's own surface with no field frame.\r\n */\r\n@Component({\r\n selector: 'lib-multiple-input-input-element',\r\n templateUrl: './multiple-input-input-element.component.html',\r\n styleUrl: './multiple-input-input-element.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n TFormInputStatusComponent,\r\n MultipleInputTableComponent,\r\n ],\r\n})\r\nexport class MultipleInputInputElementComponent {\r\n /** The list field being rendered. */\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n /** Form group holding the field's array control. */\r\n readonly formGroup = input.required<FormGroup>();\r\n /** `true` inside the form builder; forwarded to the row table. */\r\n readonly editorMode = input<boolean>(false);\r\n /** Builder callbacks forwarded to the row table. */\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n /** Reserved reload signal; the table's toolbar owns the reload action. */\r\n readonly reload = output<void>();\r\n\r\n /**\r\n * `true` when the field is a read-only view (System Doc, review). The table then\r\n * renders full width without the fill/outline well; keyed on `readonly` only so a\r\n * field merely disabled in a live form keeps its frame exactly as before.\r\n */\r\n protected readonly readOnlyView = computed<boolean>(() => this.inputConfig()?.readonly === true);\r\n\r\n /**\r\n * Id of the visible read-only label; the group names itself from it\r\n * (`aria-labelledby`) so a screen reader announces the label once, not twice.\r\n */\r\n protected readonly readOnlyLabelId = `lib-multiple-input-label-${nextReadOnlyLabelId++}`;\r\n\r\n protected readonly errorMessage = computed(() =>\r\n getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n}\r\n","<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n @if (readOnlyView()) {\r\n <!--\r\n Read-only: the rows are the value. They render full width on the page's own\r\n surface — no fill well or outline around the table, which keeps a single\r\n surface instead of a box inside a box inside a card.\r\n -->\r\n <div class=\"multiple-input-readonly\" role=\"group\" [attr.aria-labelledby]=\"inputConfig.label ? readOnlyLabelId : null\">\r\n @if (inputConfig.label) {\r\n <span class=\"multiple-input-readonly__label\" [id]=\"readOnlyLabelId\">{{ inputConfig.label }}</span>\r\n }\r\n @if (inputConfig.id) {\r\n <lib-multiple-input-table\r\n [editorMode]=\"editorMode()\"\r\n [formGroup]=\"formGroup()\"\r\n [formBuilderFunctions]=\"formBuilderFunctions()\"\r\n [formControlName]=\"inputConfig.id\"\r\n [inputConfig]=\"inputConfig\"\r\n ></lib-multiple-input-table>\r\n }\r\n </div>\r\n } @else {\r\n <mat-form-field\r\n class=\"multiple-input-field\"\r\n [appearance]=\"inputConfig.appearance || 'fill'\"\r\n subscriptSizing=\"dynamic\"\r\n floatLabel=\"always\"\r\n >\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n @if (inputConfig.id) {\r\n <lib-multiple-input-table\r\n [editorMode]=\"editorMode()\"\r\n [required]=\"inputConfig.required\"\r\n [formGroup]=\"formGroup()\"\r\n [formBuilderFunctions]=\"formBuilderFunctions()\"\r\n [formControlName]=\"inputConfig.id\"\r\n [inputConfig]=\"inputConfig\"\r\n ></lib-multiple-input-table>\r\n }\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span class=\"affix-text\" matPrefix>{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span class=\"affix-text affix-text--suffix\" matSuffix>{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n }\r\n</form>\r\n"],"names":["i2","i3","i4","i5","i6","i8","i9","uuidv4","i1","i7"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAa,UAAU,CAAA;AAMrB,IAAA,WAAA,CACE,GAAW,EACX,GAAW,EACX,UAAoB,EACpB,QAAgB,CAAC,EAAA;AAEjB,QAAA,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC;QAC9B,kBAAkB,CAAC,UAAU,CAAC;QAC9B,kBAAkB,CAAC,KAAK,CAAC;AAEzB,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;AACd,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;AACd,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,CA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