import { Component } from '@angular/core';
import { AbstractFieldReadComponent } from '../base-field/abstract-field-read.component';
import * as i0 from "@angular/core";
import * as i1 from "rpx-xui-translation";
import * as i2 from "./dynamic-list.pipe";
export class ReadDynamicListFieldComponent extends AbstractFieldReadComponent {
    ngOnInit() {
        /**
         *
         * Reassigning list_items from formatted_list when list_items is empty
         */
        if (!this.caseField.list_items && this.caseField.formatted_value && this.caseField.formatted_value.list_items) {
            this.caseField.list_items = this.caseField.formatted_value.list_items;
        }
        super.ngOnInit();
    }
    static ɵfac = /*@__PURE__*/ (() => { let ɵReadDynamicListFieldComponent_BaseFactory; return function ReadDynamicListFieldComponent_Factory(__ngFactoryType__) { return (ɵReadDynamicListFieldComponent_BaseFactory || (ɵReadDynamicListFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadDynamicListFieldComponent)))(__ngFactoryType__ || ReadDynamicListFieldComponent); }; })();
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadDynamicListFieldComponent, selectors: [["ccd-read-dynamic-list-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 6, consts: [[1, "text-16"]], template: function ReadDynamicListFieldComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "span", 0);
            i0.ɵɵtext(1);
            i0.ɵɵpipe(2, "ccdDynamicList");
            i0.ɵɵpipe(3, "rpxTranslate");
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 4, i0.ɵɵpipeBind2(2, 1, ctx.caseField.value, ctx.caseField.list_items)));
        } }, dependencies: [i1.RpxTranslatePipe, i2.DynamicListPipe], encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadDynamicListFieldComponent, [{
        type: Component,
        args: [{
                selector: 'ccd-read-dynamic-list-field',
                template: '<span class="text-16">{{caseField.value | ccdDynamicList:caseField.list_items | rpxTranslate}}</span>',
            }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadDynamicListFieldComponent, { className: "ReadDynamicListFieldComponent", filePath: "lib/shared/components/palette/dynamic-list/read-dynamic-list-field.component.ts", lineNumber: 8 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVhZC1keW5hbWljLWxpc3QtZmllbGQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NkLWNhc2UtdWktdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9jb21wb25lbnRzL3BhbGV0dGUvZHluYW1pYy1saXN0L3JlYWQtZHluYW1pYy1saXN0LWZpZWxkLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLDZDQUE2QyxDQUFDOzs7O0FBTXpGLE1BQU0sT0FBTyw2QkFBOEIsU0FBUSwwQkFBMEI7SUFFcEUsUUFBUTtRQUNiOzs7V0FHRztRQUNILElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLFVBQVUsSUFBSSxJQUFJLENBQUMsU0FBUyxDQUFDLGVBQWUsSUFBSSxJQUFJLENBQUMsU0FBUyxDQUFDLGVBQWUsQ0FBQyxVQUFVLEVBQUUsQ0FBQztZQUM5RyxJQUFJLENBQUMsU0FBUyxDQUFDLFVBQVUsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLGVBQWUsQ0FBQyxVQUFVLENBQUM7UUFDeEUsQ0FBQztRQUNELEtBQUssQ0FBQyxRQUFRLEVBQUUsQ0FBQztJQUNuQixDQUFDO2lTQVhVLDZCQUE2Q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