import { Component, Input } from '@angular/core';
import { ProposalRepresentation } from '@aztrix/sdk';
import { AbstractSelectSearch } from '../abstract-select-search';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../select-search/select-search.component";
import * as i3 from "@aztrix/components/row-cell-view";
import * as i4 from "@aztrix/helpers";
export class AgreementSelectSearchComponent extends AbstractSelectSearch {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AgreementSelectSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AgreementSelectSearchComponent, selector: "ax-agreement-select-search", inputs: { proposal: "proposal", agreements: "agreements" }, usesInheritance: true, ngImport: i0, template: "<ng-template #option let-result>\n  <ax-agreement-cell-view *ngIf=\"result\" [agreement]=\"result\" [proposal]=\"proposal\">\n    <div class=\"status\" *ngIf=\"result.agreementData?.confirmed\">\n      <span>\n        {{ result.active ? ('agreement.active' | translate) : ('agreement.expired' | translate) }}\n      </span>\n      <div class=\"status-indicator\" [ngClass]=\"{'is-expired': result.expirationTimestamp}\"></div>\n    </div>\n    <div class=\"status\" *ngIf=\"!result.agreementData?.confirmed\">\n      <span>{{ 'agreement.status.not-confirmed' | translate }}</span>\n      <div class=\"status-indicator is-pending\"></div>\n    </div>\n  </ax-agreement-cell-view>\n</ng-template>\n\n<ng-template #selectedViewTemplate let-result>\n  <ax-agreement-cell-view\n    class=\"selected\"\n    *ngIf=\"result\"\n    [agreement]=\"result\"\n    [noAvatar]=\"true\"\n    [proposal]=\"proposal\"\n  ></ax-agreement-cell-view>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"agreements\"\n  [placeholder]=\"(multiple ? 'label.agreements' : 'label.agreement') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.agreements' : 'label.agreement') | translate)\"\n></ax-select-search>\n", styles: [".status{display:flex;align-items:center}.status-indicator{background-color:var(--primary-color-500);width:8px;height:8px;border-radius:6px;margin:0 6px}.status-indicator.is-pending{background-color:#e67e22}.status-indicator.is-expired{background-color:var(--warn-color-500)}.selected{height:38px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.SelectSearchComponent, selector: "ax-select-search", inputs: ["form", "options", "placeholder", "optionTemplate", "selectedValueTemplate", "multiple", "label", "keys", "canAddNew", "required", "appearance", "errorsTemplate", "prefixTemplate", "disabled", "valueCallback", "searchCallback$"], outputs: ["addNewValue"] }, { kind: "component", type: i3.AgreementCellViewComponent, selector: "ax-agreement-cell-view", inputs: ["proposal", "agreement", "noAvatar"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AgreementSelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-agreement-select-search', template: "<ng-template #option let-result>\n  <ax-agreement-cell-view *ngIf=\"result\" [agreement]=\"result\" [proposal]=\"proposal\">\n    <div class=\"status\" *ngIf=\"result.agreementData?.confirmed\">\n      <span>\n        {{ result.active ? ('agreement.active' | translate) : ('agreement.expired' | translate) }}\n      </span>\n      <div class=\"status-indicator\" [ngClass]=\"{'is-expired': result.expirationTimestamp}\"></div>\n    </div>\n    <div class=\"status\" *ngIf=\"!result.agreementData?.confirmed\">\n      <span>{{ 'agreement.status.not-confirmed' | translate }}</span>\n      <div class=\"status-indicator is-pending\"></div>\n    </div>\n  </ax-agreement-cell-view>\n</ng-template>\n\n<ng-template #selectedViewTemplate let-result>\n  <ax-agreement-cell-view\n    class=\"selected\"\n    *ngIf=\"result\"\n    [agreement]=\"result\"\n    [noAvatar]=\"true\"\n    [proposal]=\"proposal\"\n  ></ax-agreement-cell-view>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"agreements\"\n  [placeholder]=\"(multiple ? 'label.agreements' : 'label.agreement') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.agreements' : 'label.agreement') | translate)\"\n></ax-select-search>\n", styles: [".status{display:flex;align-items:center}.status-indicator{background-color:var(--primary-color-500);width:8px;height:8px;border-radius:6px;margin:0 6px}.status-indicator.is-pending{background-color:#e67e22}.status-indicator.is-expired{background-color:var(--warn-color-500)}.selected{height:38px}\n"] }]
        }], propDecorators: { proposal: [{
                type: Input
            }], agreements: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdyZWVtZW50LXNlbGVjdC1zZWFyY2guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3NlbGVjdC1zZWFyY2gvYWdyZWVtZW50LXNlbGVjdC1zZWFyY2gvYWdyZWVtZW50LXNlbGVjdC1zZWFyY2guY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3NlbGVjdC1zZWFyY2gvYWdyZWVtZW50LXNlbGVjdC1zZWFyY2gvYWdyZWVtZW50LXNlbGVjdC1zZWFyY2guY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFNBQVMsRUFBRSxLQUFLLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFL0MsT0FBTyxFQUFDLHNCQUFzQixFQUFDLE1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