import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ngbracket/ngx-layout/flex";
import * as i3 from "@ngx-translate/core";
export class TldDictionaryComponent {
    set dictionary(data) {
        this.groupDictionariesByDomain(data);
    }
    dictionaryGroups = {};
    groupDictionariesByDomain(data) {
        if (!data?.length) {
            this.dictionaryGroups = null;
            return;
        }
        this.dictionaryGroups = data.reduce((acc, dictionary) => {
            const domain = dictionary.sourceLabel ?? dictionary.dictionaryDomainUrl;
            if (!acc[domain]) {
                acc[domain] = [];
            }
            acc[domain].push(dictionary);
            return acc;
        }, {});
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TldDictionaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TldDictionaryComponent, selector: "tld-dictionary", inputs: { dictionary: "dictionary" }, ngImport: i0, template: "<div *ngFor=\"let domain of dictionaryGroups | keyvalue\">\r\n\t<div fxFlex fxLayout=\"column\" class=\"dictionary-area\">\r\n\t\t<div fxFlex fxLayout=\"column\">\r\n\t\t\t<p class=\"dictionary-source\">{{ 'DICTIONARY.SOURCE' | translate: { src: domain.key | titlecase } }}</p>\r\n\r\n\t\t\t<div *ngFor=\"let dictionary of domain.value\" class=\"dictionary-target-wrapper\">\r\n\t\t\t\t<a [href]=\"dictionary.collectionUrl\" target=\"_blank\" class=\"dictionary-target-word\">{{ dictionary.targetWord }}</a>\r\n\r\n\t\t\t\t<div class=\"dictionary-word-source\">{{ dictionary.termSource }}</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n", styles: [".dictionary-area{margin-top:1rem}.dictionary-source{font-size:16px}.dictionary-source{font-weight:600}.dictionary-target-wrapper{margin-bottom:.75rem}.dictionary-target-word{font-size:16px;font-weight:500;text-decoration:underline;color:inherit}.dictionary-word-source{font-size:12px;font-style:italic;color:var(--primary);margin-top:.25rem}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: "  [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md],  [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md],  [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm],  [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: "  [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md],  [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md],  [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm],  [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i1.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TldDictionaryComponent, decorators: [{
            type: Component,
            args: [{ selector: 'tld-dictionary', template: "<div *ngFor=\"let domain of dictionaryGroups | keyvalue\">\r\n\t<div fxFlex fxLayout=\"column\" class=\"dictionary-area\">\r\n\t\t<div fxFlex fxLayout=\"column\">\r\n\t\t\t<p class=\"dictionary-source\">{{ 'DICTIONARY.SOURCE' | translate: { src: domain.key | titlecase } }}</p>\r\n\r\n\t\t\t<div *ngFor=\"let dictionary of domain.value\" class=\"dictionary-target-wrapper\">\r\n\t\t\t\t<a [href]=\"dictionary.collectionUrl\" target=\"_blank\" class=\"dictionary-target-word\">{{ dictionary.targetWord }}</a>\r\n\r\n\t\t\t\t<div class=\"dictionary-word-source\">{{ dictionary.termSource }}</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n", styles: [".dictionary-area{margin-top:1rem}.dictionary-source{font-size:16px}.dictionary-source{font-weight:600}.dictionary-target-wrapper{margin-bottom:.75rem}.dictionary-target-word{font-size:16px;font-weight:500;text-decoration:underline;color:inherit}.dictionary-word-source{font-size:12px;font-style:italic;color:var(--primary);margin-top:.25rem}\n"] }]
        }], propDecorators: { dictionary: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGxkLWRpY3Rpb25hcnkuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdGxkLXRyYW5zbGF0ZS9zcmMvbGliL21vZHVsZXMvdGxkLXRleHQvY29tcG9uZW50cy90bGQtZGljdGlvbmFyeS90bGQtZGljdGlvbmFyeS5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90bGQtdHJhbnNsYXRlL3NyYy9saWIvbW9kdWxlcy90bGQtdGV4dC9jb21wb25lbnRzL3RsZC1kaWN0aW9uYXJ5L3RsZC1kaWN0aW9uYXJ5LmNvbXBvbmVudC5odG1sIl0sIm5hbWV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