import { Component, Input } from '@angular/core';
import { AbstractFieldReadComponent } from '../base-field/abstract-field-read.component';
import { PaletteContext } from '../base-field/palette-context.enum';
import * as i0 from "@angular/core";
function ReadOrganisationFieldComponent_ccd_read_organisation_field_raw_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-read-organisation-field-raw", 4);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("caseField", ctx_r0.caseField)("context", ctx_r0.context);
} }
function ReadOrganisationFieldComponent_ccd_read_organisation_field_table_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-read-organisation-field-table", 5);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("caseField", ctx_r0.caseField)("caseFields", ctx_r0.caseFields)("context", ctx_r0.context);
} }
function ReadOrganisationFieldComponent_ccd_read_organisation_field_table_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-read-organisation-field-table", 5);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("caseField", ctx_r0.caseField)("caseFields", ctx_r0.caseFields)("context", ctx_r0.context);
} }
export class ReadOrganisationFieldComponent extends AbstractFieldReadComponent {
    caseFields = [];
    paletteContext = PaletteContext;
    ngOnInit() {
        super.ngOnInit();
        if (this.caseField.display_context_parameter) {
            this.context = PaletteContext.TABLE_VIEW;
        }
    }
    static ɵfac = /*@__PURE__*/ (() => { let ɵReadOrganisationFieldComponent_BaseFactory; return function ReadOrganisationFieldComponent_Factory(__ngFactoryType__) { return (ɵReadOrganisationFieldComponent_BaseFactory || (ɵReadOrganisationFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadOrganisationFieldComponent)))(__ngFactoryType__ || ReadOrganisationFieldComponent); }; })();
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadOrganisationFieldComponent, selectors: [["ccd-read-organisation-field"]], inputs: { caseFields: "caseFields" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 3, consts: [[3, "ngSwitch"], [3, "caseField", "context", 4, "ngSwitchCase"], [3, "caseField", "caseFields", "context", 4, "ngSwitchCase"], [3, "caseField", "caseFields", "context", 4, "ngSwitchDefault"], [3, "caseField", "context"], [3, "caseField", "caseFields", "context"]], template: function ReadOrganisationFieldComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementContainerStart(0, 0);
            i0.ɵɵtemplate(1, ReadOrganisationFieldComponent_ccd_read_organisation_field_raw_1_Template, 1, 2, "ccd-read-organisation-field-raw", 1)(2, ReadOrganisationFieldComponent_ccd_read_organisation_field_table_2_Template, 1, 3, "ccd-read-organisation-field-table", 2)(3, ReadOrganisationFieldComponent_ccd_read_organisation_field_table_3_Template, 1, 3, "ccd-read-organisation-field-table", 3);
            i0.ɵɵelementContainerEnd();
        } if (rf & 2) {
            i0.ɵɵproperty("ngSwitch", ctx.context);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", ctx.paletteContext.CHECK_YOUR_ANSWER);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngSwitchCase", ctx.paletteContext.TABLE_VIEW);
        } }, encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadOrganisationFieldComponent, [{
        type: Component,
        args: [{ selector: 'ccd-read-organisation-field', template: "<ng-container [ngSwitch]=\"context\">\n  <ccd-read-organisation-field-raw\n    *ngSwitchCase=\"paletteContext.CHECK_YOUR_ANSWER\"\n    [caseField]=\"caseField\"\n    [context]=\"context\"\n  ></ccd-read-organisation-field-raw>\n  <ccd-read-organisation-field-table\n    *ngSwitchCase=\"paletteContext.TABLE_VIEW\"\n    [caseField]=\"caseField\"\n    [caseFields]=\"caseFields\"\n    [context]=\"context\"\n  ></ccd-read-organisation-field-table>\n  <ccd-read-organisation-field-table\n    *ngSwitchDefault\n    [caseField]=\"caseField\"\n    [caseFields]=\"caseFields\"\n    [context]=\"context\"\n  ></ccd-read-organisation-field-table>\n</ng-container>\n" }]
    }], null, { caseFields: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadOrganisationFieldComponent, { className: "ReadOrganisationFieldComponent", filePath: "lib/shared/components/palette/organisation/read-organisation-field.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVhZC1vcmdhbmlzYXRpb24tZmllbGQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NkLWNhc2UtdWktdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9jb21wb25lbnRzL3BhbGV0dGUvb3JnYW5pc2F0aW9uL3JlYWQtb3JnYW5pc2F0aW9uLWZpZWxkLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZC1jYXNlLXVpLXRvb2xraXQvc3JjL2xpYi9zaGFyZWQvY29tcG9uZW50cy9wYWxldHRlL29yZ2FuaXNhdGlvbi9yZWFkLW9yZ2FuaXNhdGlvbi1maWVsZC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBRXpELE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLDZDQUE2QyxDQUFDO0FBQ3pGLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQzs7O0lDRmxFLHFEQUltQzs7O0lBRGpDLEFBREEsNENBQXVCLDJCQUNKOzs7SUFFckIsdURBS3FDOzs7SUFEbkMsQUFEQSxBQURBLDRDQUF1QixpQ0FDRSwyQkFDTjs7O0lB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