var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, Input } from '@angular/core';
import { ComponentHelper } from '../../../classes/component-helper';
import { ProductsService } from '../../../services/products/products.service';
var PriceEcComponent = /** @class */ (function (_super) {
    __extends(PriceEcComponent, _super);
    function PriceEcComponent(productsService) {
        var _this = _super.call(this) || this;
        _this.productsService = productsService;
        _this.priceSize = true;
        _this.ecOnConstruct();
        return _this;
    }
    PriceEcComponent.prototype.ngOnInit = function () {
        this.ecOnInit();
    };
    PriceEcComponent.ctorParameters = function () { return [
        { type: ProductsService }
    ]; };
    __decorate([
        Input()
    ], PriceEcComponent.prototype, "price", void 0);
    __decorate([
        Input()
    ], PriceEcComponent.prototype, "saleprice", void 0);
    __decorate([
        Input()
    ], PriceEcComponent.prototype, "priceSize", void 0);
    __decorate([
        Input()
    ], PriceEcComponent.prototype, "classStrSpacing", void 0);
    PriceEcComponent = __decorate([
        Component({
            selector: 'app-price-ec',
            template: "<div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\n     <div [class]=\"(priceSize ? 'price-sm':'price')\" *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\n          <del class=\"tachado\">\n              {{ price.split(' - ')[0] | currency:productsService?.currency:'symbol' }}\n              {{ price.split(' - ')[1] | currency:productsService?.currency:'symbol' }}\n          </del>\n     </div>\n     <div [class]=\"(priceSize ? 'price-sm':'price')\" *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\n          {{ saleprice.split(' - ')[0] | currency:productsService?.currency:'symbol' }}\n          {{ saleprice.split(' - ')[1] | currency:productsService?.currency:'symbol' }}\n     </div>\n</div>\n\n<ng-template #onlyprice>\n     <div [class]=\"(priceSize ? 'price-sm':'price')\" *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\n         {{ price.split(' - ')[0] | currency:productsService?.currency:'symbol' }} - \n         {{ price.split(' - ')[1] | currency:productsService?.currency:'symbol' }}\n     </div>\n</ng-template>\n\n<ng-template #simplePrice>\n     <div  [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm':'price')\" >{{ price | currency:productsService?.currency:'symbol' }}  </div>\n</ng-template>\n\n<ng-template #simplePriceDel>\n     <div  [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm':'price')\" ><span class=\"lnth\">{{ price | currency:productsService?.currency:'symbol' }}</span></div>\n</ng-template>\n\n<ng-template #simpleSalePrice>\n     <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm':'price')\" >{{ saleprice | currency:productsService?.currency:'symbol' }} </div>\n</ng-template>",
            styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}"]
        })
    ], PriceEcComponent);
    return PriceEcComponent;
}(ComponentHelper));
export { PriceEcComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpY2UtZWMuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctZWFzeWNvbW1lcmNlLyIsInNvdXJjZXMiOlsibGliL2VjLWNvbXBvbmVudC93aWRnZXRzLWVjL3Bya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