import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { CurrencyCode } from '@ishop/admin-ui/core';
export class ShippingEligibilityTestResultComponent {
    constructor() {
        this.okToRun = false;
        this.testDataUpdated = false;
        this.runTest = new EventEmitter();
    }
}
ShippingEligibilityTestResultComponent.decorators = [
    { type: Component, args: [{
                selector: 'vdr-shipping-eligibility-test-result',
                template: "<div class=\"test-result card\">\r\n    <div class=\"card-header\">\r\n        {{ 'settings.test-result' | translate }}\r\n    </div>\r\n    <div class=\"card-block\" *ngFor=\"let quote of testResult\">\r\n        <div class=\"result-details\" [class.stale]=\"testDataUpdated\">\r\n            <vdr-labeled-data [label]=\"'settings.shipping-method' | translate\">\r\n                {{ quote.name }}\r\n            </vdr-labeled-data>\r\n            <div class=\"price-row\">\r\n                <vdr-labeled-data [label]=\"'common.price' | translate\">\r\n                    {{ quote.price | localeCurrency: currencyCode }}\r\n                </vdr-labeled-data>\r\n                <vdr-labeled-data [label]=\"'common.price-with-tax' | translate\">\r\n                    {{ quote.priceWithTax | localeCurrency: currencyCode }}\r\n                </vdr-labeled-data>\r\n            </div>\r\n            <vdr-object-tree *ngIf=\"quote.metadata\" [value]=\"quote.metadata\"></vdr-object-tree>\r\n        </div>\r\n    </div>\r\n    <div class=\"card-block\" *ngIf=\"testResult?.length === 0\">\r\n        <clr-icon shape=\"ban\" class=\"is-solid error\"></clr-icon>\r\n        {{ 'settings.no-eligible-shipping-methods' | translate }}\r\n    </div>\r\n    <div class=\"card-footer\">\r\n        <button class=\"btn btn-secondary\" (click)=\"runTest.emit()\" [disabled]=\"!okToRun\">\r\n            {{ 'settings.test-shipping-methods' | translate }}\r\n        </button>\r\n    </div>\r\n</div>\r\n",
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [".result-details{transition:opacity .2s}.result-details.stale{opacity:.5}.price-row{display:flex}.price-row>:not(:first-child){margin-left:24px}clr-icon.error{color:var(--color-error-500)}"]
            },] }
];
ShippingEligibilityTestResultComponent.propDecorators = {
    testResult: [{ type: Input }],
    okToRun: [{ type: Input }],
    testDataUpdated: [{ type: Input }],
    currencyCode: [{ type: Input }],
    runTest: [{ type: Output }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hpcHBpbmctZWxpZ2liaWxpdHktdGVzdC1yZXN1bHQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9zZXR0aW5ncy9zcmMvY29tcG9uZW50cy9zaGlwcGluZy1lbGlnaWJpbGl0eS10ZXN0LXJlc3VsdC9zaGlwcGluZy1lbGlnaWJpbGl0eS10ZXN0LXJlc3VsdC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUVoRyxPQUFPLEVBQUUsWUFBWSxFQUF1QixNQUFNLHNCQUFzQixDQUFDO0FBUXpFLE1BQU0sT0FBTyxzQ0FBc0M7SUFObkQ7UUFRYSxZQUFPLEdBQUcsS0FBSyxDQUFDO1FBQ2hCLG9CQUFlLEdBQUcsS0FBSyxDQUFDO1FBRXZCLFlBQU8sR0FBRyxJQUFJLFlBQVksRUFBUSxDQUFDO0lBQ2pELENBQUM7OztZQVpBLFNBQVMsU0FBQztnQkFDUCxRQUFRLEVBQUUsc0NBQXNDO2dCQUNoRCxxK0NBQWdFO2dCQUVoRSxlQUFlLEVBQUUsdUJBQXVCLENBQUMsTUFBTTs7YUFDbEQ7Ozt5QkFFSSxLQUFLO3NCQUNMLEtBQUs7OEJBQ0wsS0FBSzsyQkFDTCxLQUFLO3NCQUNMLE1BQU0iLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDaGFuZ2VEZXRlY3Rpb25TdHJ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