ngx-t-forms 3.1.6 → 3.1.8
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.
- package/fesm2022/{ngx-t-forms-api-endpoint-config.component-Di79aHfa.mjs → ngx-t-forms-api-endpoint-config.component-B4a-L4Eq.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-api-endpoint-config.component-Di79aHfa.mjs.map → ngx-t-forms-api-endpoint-config.component-B4a-L4Eq.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DJ84laIO.mjs → ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DJ84laIO.mjs.map → ngx-t-forms-auto-complete-input-element.component-DqRunUz4.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-1wixvEKK.mjs → ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs} +14 -6
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-t8bTUgZ1.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs +603 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-PcjMdAKu.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-D2LhKaem.mjs → ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-D2LhKaem.mjs.map → ngx-t-forms-chip-options-creator-editor.component-Ca4rim_J.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-DSyIhkWf.mjs → ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-DSyIhkWf.mjs.map → ngx-t-forms-conditional-display-config.component-Di7p76_n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DSUAcg8R.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DSUAcg8R.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-CXMmDwKS.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-data-source-picker.component-h_e5wDIJ.mjs → ngx-t-forms-data-source-picker.component-DioXvLi3.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-data-source-picker.component-h_e5wDIJ.mjs.map → ngx-t-forms-data-source-picker.component-DioXvLi3.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-BPoqT0as.mjs → ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs} +6 -6
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-h0S6qZDT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-DLeCZF3n.mjs → ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs} +6 -6
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-8c1ErbgP.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-D2kj-knT.mjs → ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs} +7 -6
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-BgjGlXeq.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-BvQoKyeP.mjs → ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-BvQoKyeP.mjs.map → ngx-t-forms-document-list-label-config-editor.component-BhVM8PFR.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-document-picker.component-D0hW0jUu.mjs → ngx-t-forms-document-picker.component-DYpsBHxT.mjs} +6 -254
- package/fesm2022/ngx-t-forms-document-picker.component-DYpsBHxT.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-editor-input-element.component-DlIfYjsU.mjs → ngx-t-forms-editor-input-element.component-CzNSb79n.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-editor-input-element.component-DlIfYjsU.mjs.map → ngx-t-forms-editor-input-element.component-CzNSb79n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-Dv21OQ8v.mjs → ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-Dv21OQ8v.mjs.map → ngx-t-forms-file-upload-input-element.component-FPxHxAwF.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-input-selector.component-HjtfeAew.mjs → ngx-t-forms-form-input-selector.component-B3ES53R-.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-input-selector.component-HjtfeAew.mjs.map → ngx-t-forms-form-input-selector.component-B3ES53R-.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-json-view.component-XsTfLIOP.mjs → ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-form-json-view.component-XsTfLIOP.mjs.map → ngx-t-forms-form-json-view.component-Cu_ZEw1V.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DF3-s7Ou.mjs → ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-DF3-s7Ou.mjs.map → ngx-t-forms-form-section-stepper.component-DmTGnRgi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-D_As34Ib.mjs → ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-D_As34Ib.mjs.map → ngx-t-forms-forms-builder-menu.component-6m2BM9e9.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs +187 -0
- package/fesm2022/ngx-t-forms-forms-native-date-adapter-CCJT5ep1.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-geo-location.component-BGg8uGQV.mjs → ngx-t-forms-geo-location.component-DgXSaH0t.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-geo-location.component-BGg8uGQV.mjs.map → ngx-t-forms-geo-location.component-DgXSaH0t.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-header-template-editor.component-D78_YC80.mjs → ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-header-template-editor.component-D78_YC80.mjs.map → ngx-t-forms-header-template-editor.component-NJLm6jkA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-B2ldh1-n.mjs → ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-image-capture-input-element.component-B2ldh1-n.mjs.map → ngx-t-forms-image-capture-input-element.component-iqPS9cPK.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-index-zLon09cE.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-zLon09cE.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-BrZ59sIz.mjs → ngx-t-forms-input-custom.component-BOy_3JqU.mjs} +78 -23
- package/fesm2022/ngx-t-forms-input-custom.component-BOy_3JqU.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-editor.component-B5eMJWrz.mjs → ngx-t-forms-input-editor.component-IUrZNmA5.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-input-editor.component-B5eMJWrz.mjs.map → ngx-t-forms-input-editor.component-IUrZNmA5.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-BOX1dYlB.mjs → ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-BOX1dYlB.mjs.map → ngx-t-forms-map-mat-options-keys-CtTAw9jk.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-lv4MlFT8.mjs → ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-lv4MlFT8.mjs.map → ngx-t-forms-mat-chip-list-editor.component-C9bxVpQ1.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DV55dGC2.mjs → ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-DV55dGC2.mjs.map → ngx-t-forms-missing-form-configs.component-BpiCchqY.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C9hD1Cnq.mjs → ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C9hD1Cnq.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-CjUf0zTA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-config.component-BqgTVHRS.mjs → ngx-t-forms-mscoa-config.component-soUwIbVA.mjs} +15 -10
- package/fesm2022/ngx-t-forms-mscoa-config.component-soUwIbVA.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs +520 -0
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component--3DvQm1K.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs +2472 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-XLA9yzak.mjs → ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs} +4104 -441
- package/fesm2022/ngx-t-forms-ngx-t-forms-CaVyRedJ.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-paginated-selection-table-DisWM3sL.mjs → ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs} +8 -6
- package/fesm2022/ngx-t-forms-paginated-selection-table-DzZE-Zde.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-DM4-3jzA.mjs → ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-DM4-3jzA.mjs.map → ngx-t-forms-payload-template-editor.component-CVj-G4MC.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-Bc8En673.mjs → ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-Bc8En673.mjs.map → ngx-t-forms-pipeline-generator.component-BMyZKOXv.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-quill-input.component-CN3aorpW.mjs → ngx-t-forms-quill-input.component-oUnmMDGi.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-quill-input.component-CN3aorpW.mjs.map → ngx-t-forms-quill-input.component-oUnmMDGi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CpyrWNo5.mjs → ngx-t-forms-record-list-manager.component-CdQU6loA.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-record-list-manager.component-CpyrWNo5.mjs.map → ngx-t-forms-record-list-manager.component-CdQU6loA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-required-inputs.component-CtUXVAvg.mjs → ngx-t-forms-required-inputs.component-BtfEsmva.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-required-inputs.component-CtUXVAvg.mjs.map → ngx-t-forms-required-inputs.component-BtfEsmva.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-a4z2V-a1.mjs → ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-a4z2V-a1.mjs.map → ngx-t-forms-rest-api-call-setup.component-B5w1Lvfo.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-section-report.component-D-FE0aL3.mjs → ngx-t-forms-section-report.component-CocLNrN5.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-section-report.component-D-FE0aL3.mjs.map → ngx-t-forms-section-report.component-CocLNrN5.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-select-input-element.component-Bwlqr26x.mjs → ngx-t-forms-select-input-element.component-B03O4cAK.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-select-input-element.component-Bwlqr26x.mjs.map → ngx-t-forms-select-input-element.component-B03O4cAK.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BfaTlXQU.mjs → ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-BfaTlXQU.mjs.map → ngx-t-forms-selection-options-editor.component-CBdC0WCz.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-B35jrn-j.mjs → ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-textarea-input-element.component-B35jrn-j.mjs.map → ngx-t-forms-textarea-input-element.component-GXiLEsTp.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-Cku3HoDl.mjs → ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-toggle-input-element.component-Cku3HoDl.mjs.map → ngx-t-forms-toggle-input-element.component-WErP0SsA.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-token-text-input.component-B1I95sk3.mjs → ngx-t-forms-token-text-input.component-BMzPBtY_.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-token-text-input.component-B1I95sk3.mjs.map → ngx-t-forms-token-text-input.component-BMzPBtY_.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-yq3EGgU2.mjs → ngx-t-forms-validators-config.component-DWDBsV6a.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-validators-config.component-yq3EGgU2.mjs.map → ngx-t-forms-validators-config.component-DWDBsV6a.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CZZX1hYU.mjs → ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs} +76 -17
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-DxObFakZ.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/types/ngx-t-forms.d.ts +463 -99
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-1wixvEKK.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CMOyxJ4K.mjs +0 -603
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-CMOyxJ4K.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-BPoqT0as.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-DLeCZF3n.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-D2kj-knT.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-picker.component-D0hW0jUu.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-CerXcX5U.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-CerXcX5U.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-custom.component-BrZ59sIz.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-config.component-BqgTVHRS.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-7w9J1RgE.mjs +0 -447
- package/fesm2022/ngx-t-forms-mscoa-segment-config.component-7w9J1RgE.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BbbRpwPw.mjs +0 -2336
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-BbbRpwPw.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-XLA9yzak.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-paginated-selection-table-DisWM3sL.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-CZZX1hYU.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-multiple-input-input-element.component-BZxpJRxJ.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/functions/spreadsheetImport.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/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/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 { FormatDataPipe } from '../../../../../../../lib/shared/pipes/format-Data.pipe';\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';\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 `FormatDataPipe` accepts for a cell. */\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/** 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 FormatDataPipe,\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 },\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 `formatData` 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 base = this.colConfig().displayedColumnsInOrder;\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 /** 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 return type === 'number' || type === 'currency' || type === 'percent';\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 <section class=\"mit-shell\" [class.mit-shell--fullscreen]=\"fullscreen()\">\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 >\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 [style.background]=\"returnBackground(row, columnsConfig()[col])\"\n >\n @if (isIndexColumn(col)) {\n <span class=\"mit-index\">{{ rowNumber(row, rowIndex) }}</span>\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 @let text = row[col] | formatData: columnDataType(col) : columnPipe(col) : l10n();\n <span class=\"mit-cell-text\" [attr.title]=\"text\">{{ text }}</span>\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 <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 </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","/**\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 { 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 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(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 return errorKeys ? { ...withTyped, error: formatErrorKeys(errorKeys) } : withTyped;\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 const column = columns.find((c) => c.key === key)?.label ?? 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 parts = keys.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[] = [];\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\nfunction plainText(value: unknown): string {\n if (value === null || value === undefined) return '';\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? '' : value.toISOString().slice(0, 10);\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 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","import { NgTemplateOutlet, isPlatformBrowser } 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 type { FormColumnInputs, ImportOptionChoice, ImportProgress, ImportRowState } from 'ngx-t-forms-types';\n\nimport type { SpreadsheetSheet } from '../../../../../../domain/spreadsheet-import.model';\nimport { TFormImportController, type ImportRunState } from '../../../../../../services/core/t-form-import-controller/t-form-import-controller';\nimport { applyOptionChoice, isMultiSelectInput } from '../../../../../../services/core/t-form-import-controller/functions/optionValueResolution';\nimport {\n TEMPLATE_GUIDE_SHEET,\n describeImportColumns,\n type ImportColumn,\n} from '../../../../../../services/core/t-form-import-controller/functions/importTemplate';\nimport { SPREADSHEET_PARSER } from '../../../../../../tokens/spreadsheet-parser.token';\nimport { mapSpreadsheetRows, type SpreadsheetRowMapping } from '../../functions/spreadsheetImport';\nimport { SpreadsheetTemplateService } from '../spreadsheet-template/spreadsheet-template.service';\nimport {\n buildCell,\n childrenById,\n choiceKeys,\n reviewStatus,\n rowIssues,\n type ChildColumn,\n type ReviewCell,\n type ReviewIssue,\n type ReviewStatus,\n} from './import-review';\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 dialog is in its one-way flow. */\ntype Stage = 'idle' | 'reading' | 'validating' | 'reviewed';\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 ReviewCell[];\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 /** 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/** 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.\n *\n * One dense surface, three steps. The setup: the file (a picker, a sheet\n * chooser when the workbook has several), the template to download when the\n * host bound a writer — otherwise the list of columns — and the columns a\n * row must be unique on, so a row repeating an earlier one is set aside as a\n * duplicate. Once rows are being checked, the setup folds into a single strip\n * so the review owns the dialog; either half re-opens on a click. A run can\n * be paused, resumed and stopped; rows a stopped run never reached read\n * *Not checked*, and what did settle can still be added.\n *\n * The review is a data-mapping tool, not a log: one line per row so a long\n * sheet is scanned at once, with a verdict pill, the counts by outcome, a\n * filter to the rows that still need the user, a filter that hides the\n * duplicates, and a column chooser that can narrow the table to the columns\n * something failed on. Every cell shows the value the row will carry; a\n * choice cell whose text was matched to an option also says what was typed;\n * a text that fits several options gets a picker in place, and a pick\n * re-checks that row alone. A row opens into a panel listing every issue in\n * words, against its column.\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-fullscreen]': 'isFullscreen() ? \"true\" : null',\n },\n imports: [NgTemplateOutlet, MatDialogModule, MatButtonModule, MatIconModule, MatMenuModule, MatProgressBarModule, MatTooltipModule],\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\n /** The columns the sheet should carry — frozen for the dialog's lifetime. */\n protected readonly columns: readonly ImportColumn[] = describeImportColumns(this.#data.input);\n\n /** The field's label, for the subtitle. */\n protected readonly fieldLabel: string = this.#data.input.label || this.#data.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 /** The columns a row may be required to be unique on: the field's own importable children. */\n protected readonly keyOptions: readonly ChildColumn[] = (() => {\n const children = new Set([...childrenById(this.#data.input).values()].map((child) => child.key));\n return this.columns.filter((column) => column.importable && children.has(column.key)).map(({ key, label }) => ({ key, label }));\n })();\n\n readonly #choiceKeys = choiceKeys(this.#data.input);\n readonly #children = childrenById(this.#data.input);\n\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 sheets = signal<readonly SpreadsheetSheet[]>([]);\n protected readonly activeSheet = signal<string | undefined>(undefined);\n protected readonly mapping = signal<SpreadsheetRowMapping | undefined>(undefined);\n protected readonly downloadingTemplate = signal(false);\n protected readonly templateError = signal<string | undefined>(undefined);\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 /** Whether the setup is shown in full, or folded into the strip. */\n protected readonly setupOpen = signal(true);\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; their pickers 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 /** 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 and the sheet chooser wait. */\n protected readonly busy = computed(() => this.stage() === 'reading' || this.stage() === 'validating');\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 the sheet has been mapped. */\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 a header fed, plus any that carry an error somewhere. */\n protected readonly reviewColumns = computed<readonly ImportColumn[]>(() => {\n const matched = new Set(this.mapping()?.matched ?? []);\n const withErrors = new Set(this.#states().flatMap((s) => Object.keys(s.colErrors ?? {})));\n return this.columns.filter((c) => matched.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 stopped = this.stopped();\n return this.#states().map((state) => {\n const status = reviewStatus(state);\n const meta = status === 'pending' && stopped ? NOT_CHECKED : STATUS_META[status];\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) => buildCell(state, column, this.#choiceKeys.has(column.key))),\n issues: rowIssues(state, this.columns, this.#children),\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 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 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 /** 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 /** 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.#data.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 /** Switches to another sheet of the loaded workbook and validates it. */\n protected async chooseSheet(sheet: SpreadsheetSheet): Promise<void> {\n if (this.busy() || sheet.name === this.activeSheet()) return;\n await this.#useSheet(sheet);\n }\n\n /** True when rows must be unique on this child. */\n protected isKey(key: string): boolean {\n return this.distinctKeys().includes(key);\n }\n\n /**\n * Adds or removes a child from the unique keys. Rows already checked are\n * checked again with the new keys, so the duplicates change in place.\n */\n protected async toggleKey(key: string): Promise<void> {\n if (this.busy()) return;\n this.distinctKeys.update((keys) => (keys.includes(key) ? keys.filter((k) => k !== key) : [...keys, key]));\n const rows = this.mapping()?.rows;\n if (this.stage() === 'reviewed' && rows?.length) await this.#run(rows);\n }\n\n /** Unfolds the setup strip back into the setup section. */\n protected openSetup(): void {\n this.setupOpen.set(true);\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 const rows = this.mapping()?.rows;\n if (this.busy() || !rows?.length) return;\n await this.#run(rows);\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 /**\n * Opens the row a duplicate repeats and scrolls it into view — clearing the\n * attention filter first, since the original is a ready row that filter hides.\n */\n protected jumpToRow(index: number): void {\n this.onlyAttention.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 * 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.\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.#data.input.formInputs ?? []).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\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 this.error.set(undefined);\n this.mapping.set(undefined);\n this.sheets.set([]);\n this.activeSheet.set(undefined);\n this.fileName.set(file.name);\n this.stage.set('reading');\n\n let sheets: readonly SpreadsheetSheet[];\n try {\n const data = await readAsArrayBuffer(file);\n sheets = 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 usable = (sheets ?? []).filter((sheet) => !!sheet && Array.isArray(sheet.rows));\n if (usable.length === 0) {\n this.#fail('The spreadsheet has no sheets.');\n return;\n }\n this.sheets.set(usable);\n await this.#useSheet(this.#preferredSheet(usable));\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 SpreadsheetSheet[]): SpreadsheetSheet {\n const wanted = (this.#data.input.formControlName ?? '').trim().toLowerCase();\n const first = sheets[0] as SpreadsheetSheet;\n if (!wanted) return first;\n return sheets.find((sheet) => sheet.name.trim().toLowerCase() === wanted) ?? first;\n }\n\n async #useSheet(sheet: SpreadsheetSheet): Promise<void> {\n this.error.set(undefined);\n this.activeSheet.set(sheet.name);\n const mapping = mapSpreadsheetRows(this.columns, sheet.rows);\n this.mapping.set(mapping);\n\n if (mapping.rows.length === 0) {\n this.#fail(\n sheet.rows.length === 0\n ? `\"${sheet.name}\" has no rows below its headers.`\n : mapping.matched.length === 0\n ? `No header in \"${sheet.name}\" matches a column of ${this.fieldLabel}.`\n : `\"${sheet.name}\" has no rows with a value in a recognised column.`,\n );\n return;\n }\n await this.#run(mapping.rows);\n }\n\n /** Checks the mapped rows with the current unique keys; the setup folds into its strip meanwhile. */\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.setupOpen.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.#data.input, rows, { distinctKeys: this.distinctKeys() });\n } catch (e) {\n this.#fail(messageOf(e, 'The rows could not be checked.'));\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.setupOpen.set(true);\n }\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 }} · every row is checked the way the form checks it, and only rows that pass 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<mat-dialog-content class=\"mii__content\">\n <!-- The native input stays in the tree for keyboard and assistive access; the pick zone and the strip both 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 <ng-template #sheetChips>\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 </ng-template>\n\n @if (setupOpen()) {\n <!-- 1 · Setup: the file and the template on one line; the sheet and the unique keys as aligned rows -->\n <section class=\"mii-section mii-setup\" aria-labelledby=\"mii-setup-label\">\n <span class=\"mii-section__label\" id=\"mii-setup-label\">Setup</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 (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\">A workbook or CSV, with the headers in row 1</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 Other columns are ignored.\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 the sheet should carry\" 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 Row 1 holds the headers. A header may be the column name above or the field's label; other columns are ignored.\n </p>\n }\n\n @if (sheets().length > 1 || keyOptions.length > 0) {\n <dl class=\"mii-fields\">\n @if (sheets().length > 1) {\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 <ng-container *ngTemplateOutlet=\"sheetChips\" />\n </dd>\n </div>\n }\n @if (keyOptions.length > 0) {\n <div class=\"mii-field\">\n <dt class=\"mii-field__label\">Unique keys</dt>\n <dd class=\"mii-field__value\" role=\"group\" aria-label=\"Unique keys\" aria-describedby=\"mii-keys-hint\">\n @for (option of keyOptions; track option.key) {\n <button\n type=\"button\"\n class=\"mii-sheet mii-key\"\n [class.mii-sheet--active]=\"isKey(option.key)\"\n [attr.aria-pressed]=\"isKey(option.key)\"\n [disabled]=\"busy()\"\n (click)=\"toggleKey(option.key)\"\n >\n <mat-icon aria-hidden=\"true\">{{ isKey(option.key) ? 'check' : 'add' }}</mat-icon>\n {{ option.label }}\n </button>\n }\n <span class=\"mii-field__hint\" id=\"mii-keys-hint\">\n A row repeating an earlier row on every chosen column is set aside as a duplicate.\n </span>\n </dd>\n </div>\n }\n </dl>\n }\n </section>\n } @else {\n <!-- Once rows are being checked the setup folds into one line so the review owns the dialog. -->\n <div class=\"mii-strip\" role=\"group\" aria-label=\"Import setup\">\n <button type=\"button\" class=\"mii-strip__item\" aria-expanded=\"false\" (click)=\"openSetup()\">\n <mat-icon aria-hidden=\"true\">description</mat-icon>\n <span class=\"mii-strip__label\">File</span>\n <span class=\"mii-strip__value\">{{ fileName() }}</span>\n <mat-icon aria-hidden=\"true\" class=\"mii-strip__chevron\">expand_more</mat-icon>\n </button>\n @if (sheets().length > 1) {\n <div class=\"mii-sheets\" role=\"group\" aria-label=\"Sheet to import\">\n <span class=\"mii-sheets__label\">Sheet</span>\n <ng-container *ngTemplateOutlet=\"sheetChips\" />\n </div>\n }\n @if (keyOptions.length > 0) {\n <button type=\"button\" class=\"mii-strip__item\" aria-expanded=\"false\" (click)=\"openSetup()\">\n <mat-icon aria-hidden=\"true\">key</mat-icon>\n <span class=\"mii-strip__label\">Unique keys</span>\n <span class=\"mii-strip__value\">\n {{ distinctKeys().length ? distinctKeys().length + ' chosen' : 'None' }}\n </span>\n <mat-icon aria-hidden=\"true\" class=\"mii-strip__chevron\">expand_more</mat-icon>\n </button>\n }\n <span class=\"mii-strip__spacer\"></span>\n @if (canDownloadTemplate) {\n <button type=\"button\" class=\"mii-tool\" [disabled]=\"downloadingTemplate()\" (click)=\"downloadTemplate()\">\n <mat-icon aria-hidden=\"true\">download</mat-icon>\n <span>Template</span>\n </button>\n }\n <button type=\"button\" class=\"mii-tool mii-tool--reupload\" [disabled]=\"busy()\" (click)=\"openFilePicker(uploader)\">\n <mat-icon aria-hidden=\"true\">refresh</mat-icon>\n <span>Re-upload</span>\n </button>\n </div>\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\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 @if (mapping(); as m) {\n @if (m.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 No column for the required {{ m.missingRequired.length === 1 ? 'field' : 'fields' }}\n {{ m.missingRequired.join(', ') }}. Rows will not pass until the sheet carries\n {{ m.missingRequired.length === 1 ? 'it' : 'them' }}.\n </span>\n </p>\n }\n @if (m.ignored.length > 0) {\n <p class=\"mii-note\" role=\"status\">\n Ignored {{ m.ignored.length === 1 ? 'column' : 'columns' }}: {{ m.ignored.join(', ') }}\n </p>\n }\n }\n\n <!-- 2 · Review -->\n @if (stage() === 'validating' || stage() === 'reviewed') {\n <section class=\"mii-section mii-section--review\" aria-labelledby=\"mii-review-label\">\n <span class=\"mii-section__label\" id=\"mii-review-label\">Review</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 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 @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\"> ({{ 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\">{{ 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.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 </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 <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 </span>\n </p>\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</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 <button type=\"button\" mat-flat-button color=\"primary\" class=\"mii__add\" [disabled]=\"!canAdd()\" (click)=\"add()\">\n {{ addLabel() }}\n </button>\n</mat-dialog-actions>\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 { 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 formInputs = (this.inputConfig() as IMultiple)?.formInputs;\r\n if (!Array.isArray(formInputs) || !Array.isArray(this.value)) return [];\r\n\r\n const requiredFields = formInputs.filter(i => i.required);\r\n if (requiredFields.length === 0) return [];\r\n\r\n const configId = this.inputConfig().id;\r\n const missing: Array<{ row: number; fields: string[] }> = [];\r\n this.value.forEach((item, index) => {\r\n const fields = requiredFields\r\n .filter(f => this._isNilOrEmpty(item?.[`${configId}.${f.id}`]))\r\n .map(f => f.label || f.id);\r\n if (fields.length > 0) {\r\n missing.push({ row: index + 1, fields });\r\n }\r\n });\r\n return missing;\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/** Wraps a multi-row input table inside a `mat-form-field`. */\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 readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly editorMode = input<boolean>(false);\r\n readonly formBuilderFunctions = input<FormBuilderFunctions | undefined>(undefined);\r\n readonly reload = output<void>();\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 <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</form>\r\n"],"names":["i1","i2","i3","i4","i5","i6","i7","i8","i9","uuidv4"],"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,CAAC,CAAC,SAAS,KACzC,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,CAC7B;IACH;AAEA,IAAA,QAAQ,CAAC,KAAa,EAAA;AACpB,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM;AAC9C,QAAA,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG;AAAE,YAAA,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;AAC/C,QAAA,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,GAAG,CAAC,CAAC;QAEjE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG;QAEjC,IAAI,MAAM,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,KAAK;QACvC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAC7B,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,e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