ng-easycommerce 0.0.658-beta.1 → 0.0.660-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -22
- package/assets/ec-i18n/en.json +1 -3
- package/assets/ec-i18n/es.json +1 -3
- package/bundles/ng-easycommerce.umd.js +515 -181
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/core.consts.js +1 -6
- package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
- package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
- package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +450 -14
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -30
- package/esm2015/lib/ec-component/product-ec/product-ec.component.js +2 -1
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
- package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
- package/esm2015/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm2015/lib/ec-pipe/ec-currency-symbol.pipe.js +1 -2
- package/esm2015/lib/services/cart.service.js +12 -27
- package/esm2015/lib/services/currency.service.js +7 -43
- package/esm5/lib/core.consts.js +1 -6
- package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
- package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
- package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +458 -13
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -48
- package/esm5/lib/ec-component/product-ec/product-ec.component.js +2 -1
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
- package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
- package/esm5/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm5/lib/ec-pipe/ec-currency-symbol.pipe.js +1 -2
- package/esm5/lib/services/cart.service.js +12 -27
- package/esm5/lib/services/currency.service.js +7 -43
- package/fesm2015/ng-easycommerce.js +502 -159
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +516 -182
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/core.consts.d.ts +0 -5
- package/lib/ec-component/account-ec/order-ec/order-ec.component.d.ts +0 -1
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +0 -1
- package/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.d.ts +1 -1
- package/lib/ec-component/collection-ec/collection-ec.component.d.ts +34 -4
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +0 -3
- package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +0 -1
- package/lib/services/cart.service.d.ts +2 -2
- package/lib/services/currency.service.d.ts +2 -14
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -499,11 +499,6 @@
|
|
|
499
499
|
* @example ['AR','ES','GB']
|
|
500
500
|
*/
|
|
501
501
|
this.countries = [];
|
|
502
|
-
/**
|
|
503
|
-
* @description contiene un arreglo de string cuyo contenido son los codigos de los paises a excluir.
|
|
504
|
-
* @example ['GB']
|
|
505
|
-
*/
|
|
506
|
-
this.excludedCountries = [];
|
|
507
502
|
/**
|
|
508
503
|
*
|
|
509
504
|
* @param countries debe contener los codigos de los paises que se quiere mostrar
|
|
@@ -4749,22 +4744,12 @@
|
|
|
4749
4744
|
_this.updateLocalCart();
|
|
4750
4745
|
_this.requestInProcess.next(false);
|
|
4751
4746
|
};
|
|
4752
|
-
this.updateCartItemQuantity = function (variant_id, quantity
|
|
4753
|
-
var
|
|
4754
|
-
var newItems = _this.items.map(function (it) {
|
|
4755
|
-
if (it.variant_id !== variant_id)
|
|
4756
|
-
return it;
|
|
4757
|
-
var updated = __assign$a(__assign$a({}, it), { quantity: Number(quantity) });
|
|
4758
|
-
if (normalizedComments !== undefined) {
|
|
4759
|
-
updated.comments = normalizedComments;
|
|
4760
|
-
}
|
|
4761
|
-
return updated;
|
|
4762
|
-
});
|
|
4763
|
-
_this.items = newItems;
|
|
4747
|
+
this.updateCartItemQuantity = function (variant_id, quantity) {
|
|
4748
|
+
var newQuantity = _this.items.find(function (item) { return item.variant_id == variant_id; }).quantity = quantity;
|
|
4764
4749
|
_this.cartItemsSubject.next(_this.items);
|
|
4765
4750
|
_this.requestInProcess.next(false);
|
|
4766
4751
|
_this.updateLocalCart();
|
|
4767
|
-
_this.toastrService.show('product-updated', { quantity:
|
|
4752
|
+
_this.toastrService.show('product-updated', { quantity: newQuantity });
|
|
4768
4753
|
};
|
|
4769
4754
|
this.appendToCart = function (cart) {
|
|
4770
4755
|
_this.updateCartObj(cart);
|
|
@@ -4786,11 +4771,11 @@
|
|
|
4786
4771
|
// this.googleAnalytics.removeFromCart(product);
|
|
4787
4772
|
_this.analyticsService.callEvent('remove_from_cart', __assign$a(__assign$a({}, product), { currency: _this.consts.currency.code }));
|
|
4788
4773
|
};
|
|
4789
|
-
this.addIfAllreadyExists = function (product, variant_id, quantityAdd
|
|
4774
|
+
this.addIfAllreadyExists = function (product, variant_id, quantityAdd) {
|
|
4790
4775
|
if (quantityAdd === void 0) { quantityAdd = 1; }
|
|
4791
4776
|
return _this.items.find(function (item, index) {
|
|
4792
4777
|
if (item.product.id == product.id && item.variant_id == variant_id) {
|
|
4793
|
-
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd
|
|
4778
|
+
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd);
|
|
4794
4779
|
return true;
|
|
4795
4780
|
}
|
|
4796
4781
|
return false;
|
|
@@ -4844,7 +4829,7 @@
|
|
|
4844
4829
|
return;
|
|
4845
4830
|
}
|
|
4846
4831
|
_this.requestInProcess.next(true);
|
|
4847
|
-
var added = _this.addIfAllreadyExists(product, variant_id, quantity
|
|
4832
|
+
var added = _this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4848
4833
|
if (!added) {
|
|
4849
4834
|
var payload = {
|
|
4850
4835
|
productCode: product.id,
|
|
@@ -4884,7 +4869,7 @@
|
|
|
4884
4869
|
!added && _this.connection.post(_this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id, id: id || '', order_item_id: order_item_id || '', lot_quantity: lot_quantity || '', unit_price: unit_price || '', unit_total: unit_total || '', ajustement_total: ajustement_total || '', total_lot: total_lot || '', lot_status: lot_status || '', date_request: date_request || '', notes: notes || '', shipping_address_id: shipping_address_id || '', shipping_address_name: shipping_address_name || '', action: action || 'newlot' })
|
|
4885
4870
|
.subscribe(function (res) { return _this.appendToCart(res); }, function (err) { return _this.handleError(err); });
|
|
4886
4871
|
};
|
|
4887
|
-
this.addToCartPromise = function (product, quantity, variant_id
|
|
4872
|
+
this.addToCartPromise = function (product, quantity, variant_id) { return __awaiter$5(_this, void 0, void 0, function () {
|
|
4888
4873
|
var added, result;
|
|
4889
4874
|
return __generator$5(this, function (_a) {
|
|
4890
4875
|
switch (_a.label) {
|
|
@@ -4894,7 +4879,7 @@
|
|
|
4894
4879
|
return [2 /*return*/];
|
|
4895
4880
|
}
|
|
4896
4881
|
this.requestInProcess.next(true);
|
|
4897
|
-
added = this.addIfAllreadyExists(product, variant_id, quantity
|
|
4882
|
+
added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4898
4883
|
if (!!added) return [3 /*break*/, 2];
|
|
4899
4884
|
return [4 /*yield*/, (this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id }).toPromise())];
|
|
4900
4885
|
case 1:
|
|
@@ -4940,18 +4925,13 @@
|
|
|
4940
4925
|
items = items.filter(function (itemParam) { return !_this.items.find(function (item) { return itemParam.variantCode == item.variant_id; }); });
|
|
4941
4926
|
return __spread$3(items, paramsMerge);
|
|
4942
4927
|
};
|
|
4943
|
-
this.updateItemQuantity = function (item, quantity
|
|
4928
|
+
this.updateItemQuantity = function (item, quantity) {
|
|
4944
4929
|
if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
|
|
4945
4930
|
_this.requestInProcess.next(true);
|
|
4946
|
-
var payload = { quantity: Number(quantity) };
|
|
4947
|
-
if (comments !== undefined) {
|
|
4948
|
-
var cleaned = ((comments !== null && comments !== void 0 ? comments : '')).trim();
|
|
4949
|
-
payload.comments = cleaned;
|
|
4950
|
-
}
|
|
4951
4931
|
_this.connection
|
|
4952
|
-
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)),
|
|
4932
|
+
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) })
|
|
4953
4933
|
.pipe(operators.finalize(function () { return _this.requestInProcess.next(false); }))
|
|
4954
|
-
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)
|
|
4934
|
+
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
|
|
4955
4935
|
}
|
|
4956
4936
|
};
|
|
4957
4937
|
this.validateQuantity = function (item, quantity) {
|
|
@@ -7514,7 +7494,6 @@
|
|
|
7514
7494
|
_this.creditAccountShowPrices = null;
|
|
7515
7495
|
_this.showTaxLegend = false;
|
|
7516
7496
|
_this.cartLoading = false;
|
|
7517
|
-
_this.enableFieldNotesInArticleFile = false;
|
|
7518
7497
|
_this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
|
|
7519
7498
|
_this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
|
|
7520
7499
|
_this.getVariants = function (product) {
|
|
@@ -7578,12 +7557,11 @@
|
|
|
7578
7557
|
this.cartService.promotions.subscribe(function (promotions) { return _this.promotions = promotions; });
|
|
7579
7558
|
// console.log(this.cartService.getTaxes());
|
|
7580
7559
|
this.channelConfigService.channelConfig$.subscribe(function (channel) {
|
|
7581
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
7560
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7582
7561
|
_this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
7583
7562
|
_this.hideDiscounts = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
7584
7563
|
_this.hideTaxes = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
7585
7564
|
_this.showTaxLegend = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.showTaxLegend, (_h !== null && _h !== void 0 ? _h : false));
|
|
7586
|
-
_this.enableFieldNotesInArticleFile = (_k = (_j = channel) === null || _j === void 0 ? void 0 : _j.enableFieldNotesInArticleFile, (_k !== null && _k !== void 0 ? _k : false));
|
|
7587
7565
|
if (_this.hidePrices) {
|
|
7588
7566
|
_this.router.navigate(['/']);
|
|
7589
7567
|
}
|
|
@@ -7598,7 +7576,7 @@
|
|
|
7598
7576
|
};
|
|
7599
7577
|
CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
7600
7578
|
var _this = this;
|
|
7601
|
-
var _a
|
|
7579
|
+
var _a;
|
|
7602
7580
|
if (this.cartLoading) {
|
|
7603
7581
|
return;
|
|
7604
7582
|
}
|
|
@@ -7618,11 +7596,10 @@
|
|
|
7618
7596
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
7619
7597
|
}
|
|
7620
7598
|
}
|
|
7621
|
-
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
7622
7599
|
if (id) {
|
|
7623
7600
|
this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
|
|
7624
7601
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7625
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
7602
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7626
7603
|
}
|
|
7627
7604
|
else {
|
|
7628
7605
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -7633,7 +7610,7 @@
|
|
|
7633
7610
|
}
|
|
7634
7611
|
else {
|
|
7635
7612
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7636
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
7613
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7637
7614
|
}
|
|
7638
7615
|
else {
|
|
7639
7616
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -8189,7 +8166,6 @@
|
|
|
8189
8166
|
_this.postalCodeErrorMessageFacturacion = "";
|
|
8190
8167
|
_this.documentErrorMessage = "";
|
|
8191
8168
|
_this.documentErrorMessageFacturacion = "";
|
|
8192
|
-
_this.customerHasCustomerTaxRate = false;
|
|
8193
8169
|
/**
|
|
8194
8170
|
* @description filtra los paises de acuerdo al a los codigos retornados en la funcion getCountries.
|
|
8195
8171
|
* Casos de usos: Si getCountries es vacio, retorna el arreglo que ingresa por parametro.
|
|
@@ -8199,24 +8175,18 @@
|
|
|
8199
8175
|
* @returns un arreglo de countries.
|
|
8200
8176
|
*/
|
|
8201
8177
|
_this.filterCountryByCode = function (countries) {
|
|
8202
|
-
// 1. Si hay países EXCLUIDOS, quítalos siempre
|
|
8203
|
-
var filtered = countries;
|
|
8204
|
-
if (_this.consts.excludedCountries && _this.consts.excludedCountries.length > 0) {
|
|
8205
|
-
filtered = filtered.filter(function (elem) { return !_this.consts.excludedCountries.includes(elem.code); });
|
|
8206
|
-
}
|
|
8207
|
-
// 2. Si hay países INCLUIDOS, aplica el filtro de inclusión
|
|
8208
8178
|
if (_this.consts.getCountries().length > 0) {
|
|
8209
|
-
var countriesFiltered =
|
|
8179
|
+
var countriesFiltered = countries.filter(function (elem) { return _this.consts.getCountries().includes(elem.code); });
|
|
8210
8180
|
if (countriesFiltered.length > 0) {
|
|
8211
8181
|
return countriesFiltered;
|
|
8212
8182
|
}
|
|
8213
8183
|
else {
|
|
8214
8184
|
console.error('El/los codigo/s ingresado/s no coinciden con los provistos desde el backend');
|
|
8215
|
-
return
|
|
8185
|
+
return countries;
|
|
8216
8186
|
}
|
|
8217
8187
|
}
|
|
8218
8188
|
else {
|
|
8219
|
-
return
|
|
8189
|
+
return countries;
|
|
8220
8190
|
}
|
|
8221
8191
|
};
|
|
8222
8192
|
_this.showFormFacturacion = function () {
|
|
@@ -8475,7 +8445,6 @@
|
|
|
8475
8445
|
this.paramsService.parameters.subscribe(function (res) { return _this.params = res; });
|
|
8476
8446
|
this.addressingService.initialize(this.step_id);
|
|
8477
8447
|
var localEmail = localStorage.getItem('mail');
|
|
8478
|
-
this.cartService.cart.subscribe(function (cart) { var _a; return _this.customerHasCustomerTaxRate = (_a = cart) === null || _a === void 0 ? void 0 : _a.customerHasCustomerTaxRate; });
|
|
8479
8448
|
this.authService.isAuthenticated() && this.checkoutForm.controls['email'].setValue(((_a = this.authService.getCustomer()) === null || _a === void 0 ? void 0 : _a.email) || localEmail);
|
|
8480
8449
|
this.authService.isAuthenticated() && this.checkoutForm.get('email').disable({ onlySelf: true });
|
|
8481
8450
|
this.addressingService.getAddressingData().then(function (res) {
|
|
@@ -8556,6 +8525,9 @@
|
|
|
8556
8525
|
DataFormEcComponent.prototype.updateDocumentValidationFacturacion = function (selectedDocumentType) {
|
|
8557
8526
|
this.updateValidation(selectedDocumentType, 'documentNumber', this.checkoutFormFacturacion, 'documentErrorMessageFacturacion', 'isNumeric', 'document-pattern-error');
|
|
8558
8527
|
};
|
|
8528
|
+
DataFormEcComponent.prototype.prueba = function (x) {
|
|
8529
|
+
console.log(x);
|
|
8530
|
+
};
|
|
8559
8531
|
DataFormEcComponent.ctorParameters = function () { return [
|
|
8560
8532
|
{ type: AuthService },
|
|
8561
8533
|
{ type: forms.FormBuilder },
|
|
@@ -8579,7 +8551,7 @@
|
|
|
8579
8551
|
DataFormEcComponent = __decorate$Q([
|
|
8580
8552
|
core.Component({
|
|
8581
8553
|
selector: 'app-dataform-ec',
|
|
8582
|
-
template: "<ng-container\r\n *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n <ng-container\r\n *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\"\r\n *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_') && customerHasCustomerTaxRate\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\"\r\n *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span>\r\n <span class=\"char-count ms-2\" style=\"font-size: 0.9em; color: #888;\">\r\n {{ 50 - (checkoutForm.controls['street'].value?.length || 0) }} {{'remainingCharacters'|translate}}\r\n </span>\r\n </label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this'\r\n |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\"\r\n [id]=\"i\" [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\"\r\n (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong>\r\n {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong>\r\n {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"postcode\" [formControl]=\"checkoutFormFacturacion.controls['postcode']\"\r\n value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">\r\n {{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\"\r\n name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\"\r\n *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}aaa <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\"> Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
8554
|
+
template: "<ng-container *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n<ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\" *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_')\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\" *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n<!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n --> <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n<!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n --> <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this' |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\" [id]=\"i\"\r\n [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\" (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong> {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong> {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n<!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"> \r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\"\r\n *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\"> \r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['postcode']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option\r\n *ngFor=\"let item of documentTypes\"\r\n [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}aaa <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\" > Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
8583
8555
|
providers: [modal.BsModalService],
|
|
8584
8556
|
styles: [".mt-df{margin:10px auto 0}.btn.btn-outline-secondary.active,.btn.btn-outline-secondary:hover{color:#fff!important}.required{color:red}.field-label{color:#000}.btn.valid-btn{background-color:#000;color:#fff;margin-right:-3px;margin-bottom:10px}label{color:#000}.input-size-lg{width:1.8rem;height:1.8rem}"]
|
|
8585
8557
|
})
|
|
@@ -9221,6 +9193,9 @@
|
|
|
9221
9193
|
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;
|
|
9222
9194
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9223
9195
|
};
|
|
9196
|
+
var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
|
|
9197
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9198
|
+
};
|
|
9224
9199
|
var __read$5 = (this && this.__read) || function (o, n) {
|
|
9225
9200
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
9226
9201
|
if (!m) return o;
|
|
@@ -9243,7 +9218,7 @@
|
|
|
9243
9218
|
};
|
|
9244
9219
|
var CollectionEcComponent = /** @class */ (function (_super) {
|
|
9245
9220
|
__extends$n(CollectionEcComponent, _super);
|
|
9246
|
-
function CollectionEcComponent(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService) {
|
|
9221
|
+
function CollectionEcComponent(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService, router, platformId) {
|
|
9247
9222
|
var _this = _super.call(this) || this;
|
|
9248
9223
|
_this.productsService = productsService;
|
|
9249
9224
|
_this.paramsSrv = paramsSrv;
|
|
@@ -9254,12 +9229,21 @@
|
|
|
9254
9229
|
_this.cartService = cartService;
|
|
9255
9230
|
_this.consts = consts;
|
|
9256
9231
|
_this.filtersService = filtersService;
|
|
9232
|
+
_this.router = router;
|
|
9257
9233
|
_this.filters = [];
|
|
9258
9234
|
_this.filtersConfig = { filters: [] };
|
|
9259
9235
|
_this.finished = false;
|
|
9260
9236
|
_this.loading = true;
|
|
9261
9237
|
_this.breadcrumb = [];
|
|
9262
9238
|
_this.isCollection = true;
|
|
9239
|
+
_this.usingCachedProducts = false;
|
|
9240
|
+
_this.allCachedProducts = [];
|
|
9241
|
+
_this.subscriptionsConfigured = false;
|
|
9242
|
+
_this.isScrolling = false;
|
|
9243
|
+
_this.pendingScrollPosition = null;
|
|
9244
|
+
_this.expectedProductCount = 0;
|
|
9245
|
+
_this.filtersFromCache = false; // Flag para indicar si los filtros vienen del cache
|
|
9246
|
+
_this.isCategoryChange = false; // Flag para indicar si es un cambio de categoría
|
|
9263
9247
|
_this.productsWithUniqueVariant = false;
|
|
9264
9248
|
_this.optionsFilters = ['all'];
|
|
9265
9249
|
/**
|
|
@@ -9330,26 +9314,117 @@
|
|
|
9330
9314
|
_this.getObjectWithVariant = function () {
|
|
9331
9315
|
return _this.consts.getParamsProductsWithUniqueVariant();
|
|
9332
9316
|
};
|
|
9317
|
+
// Método personalizado para manejar selección de filtros que invalidará cache
|
|
9318
|
+
_this.customSetFilterSelected = function (filter, filterElement) {
|
|
9319
|
+
// Invalidar cache completamente cuando se selecciona un filtro
|
|
9320
|
+
_this.usingCachedProducts = false;
|
|
9321
|
+
_this.allCachedProducts = [];
|
|
9322
|
+
_this.filtersFromCache = false; // Ya no usamos filtros del cache
|
|
9323
|
+
_this.isCategoryChange = true; // Marcar como cambio para reemplazar productos
|
|
9324
|
+
CollectionEcComponent_1.stateCache.delete(_this.stateKey);
|
|
9325
|
+
console.log('🔄 Filtro seleccionado, invalidando cache y recargando desde endpoint para:', _this.stateKey);
|
|
9326
|
+
// Solo limpiar productos, NO limpiar filtros para que no desaparezcan
|
|
9327
|
+
_this.products = [];
|
|
9328
|
+
_this.loading = true;
|
|
9329
|
+
// Llamar al método original del ProductsService que iniciará una carga completa
|
|
9330
|
+
var result = _this.productsService.setFilterSelected(filter, filterElement);
|
|
9331
|
+
// La suscripción principal automáticamente actualizará los filtros
|
|
9332
|
+
// porque filtersFromCache = false y usingCachedProducts = false
|
|
9333
|
+
return result;
|
|
9334
|
+
};
|
|
9333
9335
|
_this.paramsSrv.parameters.subscribe(function (param) { return _this.params = param; });
|
|
9334
9336
|
_this.defaultFilters = _this.consts.getDefaultFilters();
|
|
9335
9337
|
_this.filtersConfig.filters = _this.consts.getFilterConfig();
|
|
9336
9338
|
_this.productsService.filtersInView$.subscribe(function (res) { return _this.filterInView = res; });
|
|
9339
|
+
// Inicializar propiedades de scroll y cache
|
|
9340
|
+
_this.platformId = platformId;
|
|
9341
|
+
_this.isRestoringState = false;
|
|
9342
|
+
_this.usingCachedProducts = false;
|
|
9343
|
+
_this.allCachedProducts = [];
|
|
9344
|
+
_this.subscriptionsConfigured = false;
|
|
9345
|
+
_this.isScrolling = false;
|
|
9346
|
+
_this.pendingScrollPosition = null;
|
|
9347
|
+
_this.expectedProductCount = 0;
|
|
9348
|
+
_this.filtersFromCache = false;
|
|
9337
9349
|
_this.ecOnConstruct();
|
|
9338
9350
|
return _this;
|
|
9339
9351
|
}
|
|
9352
|
+
CollectionEcComponent_1 = CollectionEcComponent;
|
|
9340
9353
|
CollectionEcComponent.prototype.ngOnInit = function () {
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
this.
|
|
9344
|
-
|
|
9354
|
+
this.stateKey = this.router.url.split('?')[0];
|
|
9355
|
+
// Verificar si hay estado guardado ANTES de scroll(0,0)
|
|
9356
|
+
var savedState = CollectionEcComponent_1.stateCache.get(this.stateKey);
|
|
9357
|
+
if (savedState && savedState.products.length > 0) {
|
|
9358
|
+
// NO llamar window.scroll(0, 0) para preservar posición
|
|
9359
|
+
this.products = [];
|
|
9360
|
+
this.ecOnInit();
|
|
9361
|
+
this.getProductsAndSubscribe(); // Llamar directamente
|
|
9362
|
+
}
|
|
9363
|
+
else {
|
|
9364
|
+
// Comportamiento normal con scroll al inicio
|
|
9365
|
+
window.scroll(0, 0);
|
|
9366
|
+
this.products = [];
|
|
9367
|
+
this.ecOnInit();
|
|
9368
|
+
this.getProductsAndSubscribe();
|
|
9369
|
+
}
|
|
9370
|
+
// Configurar manejo de estado
|
|
9371
|
+
this.setupBeforeUnloadHandler();
|
|
9345
9372
|
};
|
|
9346
9373
|
CollectionEcComponent.prototype.getProductsAndSubscribe = function () {
|
|
9374
|
+
// Verificar PRIMERO si hay estado guardado
|
|
9375
|
+
var savedState = CollectionEcComponent_1.stateCache.get(this.stateKey);
|
|
9376
|
+
if (savedState && savedState.products.length > 0) {
|
|
9377
|
+
console.log('📦 Restaurando desde cache:', savedState.products.length, 'productos');
|
|
9378
|
+
// Configurar modo cache ANTES de restaurar
|
|
9379
|
+
this.usingCachedProducts = true;
|
|
9380
|
+
this.allCachedProducts = __spread$4(savedState.products);
|
|
9381
|
+
this.isRestoringState = true;
|
|
9382
|
+
// Restaurar productos inmediatamente
|
|
9383
|
+
this.products = __spread$4(savedState.products);
|
|
9384
|
+
this.finished = savedState.finished;
|
|
9385
|
+
this.loading = false;
|
|
9386
|
+
// Restaurar filtros si están disponibles
|
|
9387
|
+
if (savedState.filters) {
|
|
9388
|
+
this.filters = __spread$4(savedState.filters);
|
|
9389
|
+
this.filtersFromCache = true; // Marcar que estos filtros vienen del cache
|
|
9390
|
+
console.log('📦 Filtros restaurados desde cache:', this.filters.length);
|
|
9391
|
+
}
|
|
9392
|
+
if (savedState.filters_top) {
|
|
9393
|
+
this.filters_top = __spread$4(savedState.filters_top);
|
|
9394
|
+
console.log('📦 Filtros top restaurados desde cache:', this.filters_top.length);
|
|
9395
|
+
}
|
|
9396
|
+
if (savedState.breadcrumb) {
|
|
9397
|
+
this.breadcrumb = __spread$4(savedState.breadcrumb);
|
|
9398
|
+
console.log('📦 Breadcrumb restaurado desde cache:', this.breadcrumb);
|
|
9399
|
+
}
|
|
9400
|
+
// IMPORTANTE: Configurar TODAS las suscripciones del padre (filtros, breadcrumb, etc.)
|
|
9401
|
+
// pero SIN resetear productos ni hacer petición inicial
|
|
9402
|
+
this.setupParentSubscriptionsOnly();
|
|
9403
|
+
// Configurar suscripción personalizada para detectar cambios de categoría
|
|
9404
|
+
this.setupCustomSubscription();
|
|
9405
|
+
this.subscriptionsConfigured = true;
|
|
9406
|
+
// Restaurar scroll después de que los productos se rendericen
|
|
9407
|
+
this.waitForProductRendering(savedState.scrollPosition);
|
|
9408
|
+
return;
|
|
9409
|
+
}
|
|
9410
|
+
console.log('🔄 No hay cache, carga normal');
|
|
9411
|
+
// Si no hay estado guardado, comportamiento normal
|
|
9412
|
+
this.usingCachedProducts = false;
|
|
9413
|
+
this.allCachedProducts = [];
|
|
9414
|
+
this.filtersFromCache = false; // No hay filtros del cache
|
|
9415
|
+
// Llamar al comportamiento original
|
|
9416
|
+
this.originalGetProductsAndSubscribe();
|
|
9417
|
+
this.subscriptionsConfigured = true;
|
|
9418
|
+
};
|
|
9419
|
+
CollectionEcComponent.prototype.originalGetProductsAndSubscribe = function () {
|
|
9347
9420
|
var _this = this;
|
|
9348
9421
|
rxjs.combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(function (_a) {
|
|
9349
9422
|
var _b = __read$5(_a, 3), params = _b[0], ready = _b[1], queryParams = _b[2];
|
|
9350
9423
|
if (ready.readyAll) {
|
|
9351
9424
|
var cambio_1 = false;
|
|
9352
9425
|
_this.products = [];
|
|
9426
|
+
// Marcar como cambio de categoría para la carga inicial
|
|
9427
|
+
_this.isCategoryChange = true;
|
|
9353
9428
|
if (!params['type'] || !params['value']) {
|
|
9354
9429
|
_this.productsService.getProductsForFilter({ latest: true, limit: 10 }, _this.optionsFilters, queryParams.search, _this.defaultFilters);
|
|
9355
9430
|
}
|
|
@@ -9380,7 +9455,16 @@
|
|
|
9380
9455
|
}
|
|
9381
9456
|
else {
|
|
9382
9457
|
res = _this.productsService.getProductsWithUniqueVariant(res, _this.getObjectWithVariant());
|
|
9383
|
-
|
|
9458
|
+
// Filtrar productos duplicados antes de agregar
|
|
9459
|
+
var existingIds_1 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9460
|
+
var uniqueProducts = res.filter(function (p) { return !existingIds_1.has(p.id); });
|
|
9461
|
+
if (uniqueProducts.length > 0) {
|
|
9462
|
+
console.log('➕ CollectionEC (variants): Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
9463
|
+
(_a = _this.products).push.apply(_a, __spread$4(uniqueProducts));
|
|
9464
|
+
}
|
|
9465
|
+
else {
|
|
9466
|
+
console.log('⚠️ CollectionEC (variants): Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
9467
|
+
}
|
|
9384
9468
|
_this.applyFiltersInView();
|
|
9385
9469
|
}
|
|
9386
9470
|
;
|
|
@@ -9392,7 +9476,16 @@
|
|
|
9392
9476
|
cambio_1 = false;
|
|
9393
9477
|
}
|
|
9394
9478
|
else {
|
|
9395
|
-
|
|
9479
|
+
// Filtrar productos duplicados antes de agregar
|
|
9480
|
+
var existingIds_2 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9481
|
+
var uniqueProducts = res.filter(function (p) { return !existingIds_2.has(p.id); });
|
|
9482
|
+
if (uniqueProducts.length > 0) {
|
|
9483
|
+
console.log('➕ CollectionEC: Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
9484
|
+
(_b = _this.products).push.apply(_b, __spread$4(uniqueProducts));
|
|
9485
|
+
}
|
|
9486
|
+
else {
|
|
9487
|
+
console.log('⚠️ CollectionEC: Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
9488
|
+
}
|
|
9396
9489
|
_this.applyFiltersInView();
|
|
9397
9490
|
}
|
|
9398
9491
|
}
|
|
@@ -9409,6 +9502,145 @@
|
|
|
9409
9502
|
}
|
|
9410
9503
|
});
|
|
9411
9504
|
};
|
|
9505
|
+
CollectionEcComponent.prototype.setupParentSubscriptionsOnly = function () {
|
|
9506
|
+
var _this = this;
|
|
9507
|
+
var _a;
|
|
9508
|
+
// Desuscribir cualquier suscripción anterior
|
|
9509
|
+
try {
|
|
9510
|
+
(_a = this.suscripcion) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
9511
|
+
}
|
|
9512
|
+
catch (e) { }
|
|
9513
|
+
// IMPORTANTE: Configurar suscripción a productos para navegación posterior
|
|
9514
|
+
this.suscripcion = this.productsService.products$.subscribe(function (res) {
|
|
9515
|
+
var _a, _b;
|
|
9516
|
+
var _c;
|
|
9517
|
+
console.log('📦 Suscripción products$ (desde cache):', (_c = res) === null || _c === void 0 ? void 0 : _c.length, 'productos');
|
|
9518
|
+
_this.loading = false;
|
|
9519
|
+
if (res && res.length > 0) {
|
|
9520
|
+
// Si estamos usando cache, agregar solo productos nuevos únicos
|
|
9521
|
+
if (_this.usingCachedProducts) {
|
|
9522
|
+
var existingIds_3 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9523
|
+
var uniqueProducts = res.filter(function (p) { return !existingIds_3.has(p.id); });
|
|
9524
|
+
if (uniqueProducts.length > 0) {
|
|
9525
|
+
console.log('➕ Cache: Agregando', uniqueProducts.length, 'productos adicionales');
|
|
9526
|
+
(_a = _this.products).push.apply(_a, __spread$4(uniqueProducts));
|
|
9527
|
+
_this.usingCachedProducts = false; // Ya no solo cache
|
|
9528
|
+
}
|
|
9529
|
+
}
|
|
9530
|
+
else {
|
|
9531
|
+
// Determinar si es cambio de categoría o scroll infinito
|
|
9532
|
+
if (_this.isCategoryChange) {
|
|
9533
|
+
// Cambio de categoría: reemplazar completamente
|
|
9534
|
+
console.log('🔄 Cambio de categoría: Reemplazando productos completamente');
|
|
9535
|
+
if (_this.productsWithUniqueVariant) {
|
|
9536
|
+
_this.products = _this.productsService.getProductsWithUniqueVariant(res, _this.getObjectWithVariant());
|
|
9537
|
+
}
|
|
9538
|
+
else {
|
|
9539
|
+
_this.products = res;
|
|
9540
|
+
}
|
|
9541
|
+
_this.applyFiltersInView();
|
|
9542
|
+
_this.isCategoryChange = false; // Resetear bandera
|
|
9543
|
+
}
|
|
9544
|
+
else {
|
|
9545
|
+
// Scroll infinito: agregar productos únicos
|
|
9546
|
+
console.log('📜 Scroll infinito: Agregando productos únicos');
|
|
9547
|
+
var existingIds_4 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9548
|
+
var newProducts = res;
|
|
9549
|
+
if (_this.productsWithUniqueVariant) {
|
|
9550
|
+
newProducts = _this.productsService.getProductsWithUniqueVariant(res, _this.getObjectWithVariant());
|
|
9551
|
+
}
|
|
9552
|
+
var uniqueProducts = newProducts.filter(function (p) { return !existingIds_4.has(p.id); });
|
|
9553
|
+
if (uniqueProducts.length > 0) {
|
|
9554
|
+
console.log('➕ Agregando', uniqueProducts.length, 'productos únicos por scroll');
|
|
9555
|
+
(_b = _this.products).push.apply(_b, __spread$4(uniqueProducts));
|
|
9556
|
+
}
|
|
9557
|
+
else {
|
|
9558
|
+
console.log('⚠️ Todos los productos del scroll ya existen');
|
|
9559
|
+
}
|
|
9560
|
+
_this.applyFiltersInView();
|
|
9561
|
+
}
|
|
9562
|
+
}
|
|
9563
|
+
}
|
|
9564
|
+
else if (res && res.length === 0) {
|
|
9565
|
+
// Si recibimos array vacío y no estamos usando cache, limpiar productos
|
|
9566
|
+
if (!_this.usingCachedProducts) {
|
|
9567
|
+
_this.products = [];
|
|
9568
|
+
}
|
|
9569
|
+
}
|
|
9570
|
+
_this.finished = _this.productsService.isFinished();
|
|
9571
|
+
_this.analyticsService.callEvent('view_item_list', { products: _this.products, item_list_name: 'Collection', item_list_id: 0 });
|
|
9572
|
+
});
|
|
9573
|
+
// Configurar suscripciones de filtros
|
|
9574
|
+
this.productsService.filters$.subscribe(function (res) {
|
|
9575
|
+
// IMPORTANTE: Solo actualizar filtros si NO vienen del cache
|
|
9576
|
+
if (!_this.filtersFromCache) {
|
|
9577
|
+
console.log('🔄 Actualizando filtros desde server');
|
|
9578
|
+
_this.breadcrumb = _this.optionsService.getBreadcrumbByFilters(res);
|
|
9579
|
+
_this.filters = _this.getSpecificFilters(res, _this.filtersConfig.filters);
|
|
9580
|
+
_this.filters_top = _this.getSpecificFilters(res, ['sort']);
|
|
9581
|
+
}
|
|
9582
|
+
else {
|
|
9583
|
+
console.log('🚫 Saltando actualización de filtros (usando cache)');
|
|
9584
|
+
// Una vez que han sido utilizados, resetear el flag
|
|
9585
|
+
_this.filtersFromCache = false;
|
|
9586
|
+
}
|
|
9587
|
+
});
|
|
9588
|
+
this.productsService.finished().subscribe(function (res) { return _this.finished = res; });
|
|
9589
|
+
};
|
|
9590
|
+
CollectionEcComponent.prototype.setupCustomSubscription = function () {
|
|
9591
|
+
var _this = this;
|
|
9592
|
+
// Suscripción personalizada para detectar cambios de categoría/búsqueda
|
|
9593
|
+
rxjs.combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(function (_a) {
|
|
9594
|
+
var _b = __read$5(_a, 3), params = _b[0], ready = _b[1], queryParams = _b[2];
|
|
9595
|
+
if (ready.readyAll && _this.subscriptionsConfigured) {
|
|
9596
|
+
var currentKey = _this.generateStateKey();
|
|
9597
|
+
// Si la clave cambió, significa que navegamos a una categoría diferente
|
|
9598
|
+
if (currentKey !== _this.stateKey) {
|
|
9599
|
+
console.log('🔄 Cambio de categoría detectado, invalidando cache y recargando');
|
|
9600
|
+
_this.stateKey = currentKey;
|
|
9601
|
+
// Limpiar cache y recargar normalmente
|
|
9602
|
+
_this.invalidateCache();
|
|
9603
|
+
_this.usingCachedProducts = false;
|
|
9604
|
+
_this.allCachedProducts = [];
|
|
9605
|
+
_this.filtersFromCache = false;
|
|
9606
|
+
// IMPORTANTE: Marcar que es cambio de categoría y resetear estado
|
|
9607
|
+
_this.isCategoryChange = true;
|
|
9608
|
+
_this.loading = true;
|
|
9609
|
+
_this.products = [];
|
|
9610
|
+
// Recargar normalmente - pero solo la petición, no reconfigurar suscripciones
|
|
9611
|
+
_this.loadNewCategory(params, queryParams);
|
|
9612
|
+
}
|
|
9613
|
+
}
|
|
9614
|
+
});
|
|
9615
|
+
};
|
|
9616
|
+
CollectionEcComponent.prototype.loadNewCategory = function (params, queryParams) {
|
|
9617
|
+
// Hacer solo la petición de productos sin reconfigurar todas las suscripciones
|
|
9618
|
+
var cambio = false;
|
|
9619
|
+
if (!params['type'] || !params['value']) {
|
|
9620
|
+
this.productsService.getProductsForFilter({ latest: true, limit: 10 }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
9621
|
+
}
|
|
9622
|
+
else {
|
|
9623
|
+
this.productsService.getProductsForFilter({ type: params.type, value: params.value }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
9624
|
+
cambio = true;
|
|
9625
|
+
this.type = params['type'];
|
|
9626
|
+
this.value = params['value'];
|
|
9627
|
+
}
|
|
9628
|
+
console.log('🔄 Nueva petición enviada para categoría:', params.type, params.value);
|
|
9629
|
+
};
|
|
9630
|
+
CollectionEcComponent.prototype.generateStateKey = function () {
|
|
9631
|
+
// Incluir ruta y parámetros para generar clave única
|
|
9632
|
+
var route = this.router.url.split('?')[0]; // Sin query params
|
|
9633
|
+
var params = this.activeRoute.snapshot.params;
|
|
9634
|
+
return route + "_" + JSON.stringify(params);
|
|
9635
|
+
};
|
|
9636
|
+
CollectionEcComponent.prototype.invalidateCache = function () {
|
|
9637
|
+
// Limpiar cache específico y sessionStorage
|
|
9638
|
+
console.log('🗑️ Invalidando cache para:', this.stateKey);
|
|
9639
|
+
CollectionEcComponent_1.stateCache.delete(this.stateKey);
|
|
9640
|
+
if (common.isPlatformBrowser(this.platformId)) {
|
|
9641
|
+
sessionStorage.removeItem("collection_scroll_" + this.stateKey);
|
|
9642
|
+
}
|
|
9643
|
+
};
|
|
9412
9644
|
CollectionEcComponent.prototype.onScroll = function () {
|
|
9413
9645
|
this.loading = true;
|
|
9414
9646
|
if (!this.productsService.isWaiting() && !this.productsService.getNext()) {
|
|
@@ -9416,6 +9648,187 @@
|
|
|
9416
9648
|
this.loading = false;
|
|
9417
9649
|
}
|
|
9418
9650
|
};
|
|
9651
|
+
// Métodos de ciclo de vida requeridos
|
|
9652
|
+
CollectionEcComponent.prototype.ngAfterViewChecked = function () {
|
|
9653
|
+
var _this = this;
|
|
9654
|
+
// Solo verificar si hay un scroll pendiente
|
|
9655
|
+
if (this.pendingScrollPosition !== null && common.isPlatformBrowser(this.platformId)) {
|
|
9656
|
+
var productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
9657
|
+
var currentProductCount = productElements.length;
|
|
9658
|
+
// Verificar si se han renderizado suficientes productos
|
|
9659
|
+
if (currentProductCount >= Math.min(this.expectedProductCount, 10)) {
|
|
9660
|
+
var targetPosition_1 = this.pendingScrollPosition;
|
|
9661
|
+
this.pendingScrollPosition = null; // Limpiar para evitar loops
|
|
9662
|
+
// Usar requestAnimationFrame para asegurar que el rendering esté completo
|
|
9663
|
+
requestAnimationFrame(function () {
|
|
9664
|
+
requestAnimationFrame(function () {
|
|
9665
|
+
_this.restoreScrollWithRetries(targetPosition_1);
|
|
9666
|
+
_this.isRestoringState = false;
|
|
9667
|
+
});
|
|
9668
|
+
});
|
|
9669
|
+
}
|
|
9670
|
+
}
|
|
9671
|
+
};
|
|
9672
|
+
CollectionEcComponent.prototype.ngOnDestroy = function () {
|
|
9673
|
+
var _a;
|
|
9674
|
+
(_a = this.routerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
9675
|
+
this.saveCurrentState();
|
|
9676
|
+
// Limpiar scroll pendiente
|
|
9677
|
+
this.pendingScrollPosition = null;
|
|
9678
|
+
// Limpiar event listeners
|
|
9679
|
+
if (this.clickHandler) {
|
|
9680
|
+
document.removeEventListener('click', this.clickHandler);
|
|
9681
|
+
}
|
|
9682
|
+
};
|
|
9683
|
+
// Métodos de manejo de scroll y cache
|
|
9684
|
+
CollectionEcComponent.prototype.setupBeforeUnloadHandler = function () {
|
|
9685
|
+
var _this = this;
|
|
9686
|
+
if (common.isPlatformBrowser(this.platformId)) {
|
|
9687
|
+
// Interceptar clics en productos para guardar estado
|
|
9688
|
+
this.clickHandler = function (event) {
|
|
9689
|
+
var target = event.target;
|
|
9690
|
+
// Buscar si el clic es en un enlace a producto
|
|
9691
|
+
var link = target.closest('a[href*="/product/"]');
|
|
9692
|
+
if (link && _this.router.url.includes('/collection/')) {
|
|
9693
|
+
console.log('🎯 Clic en producto detectado, guardando estado');
|
|
9694
|
+
_this.saveCurrentState();
|
|
9695
|
+
}
|
|
9696
|
+
};
|
|
9697
|
+
document.addEventListener('click', this.clickHandler);
|
|
9698
|
+
// Guardar durante scroll en la página de colección
|
|
9699
|
+
var scrollTimer_1;
|
|
9700
|
+
window.addEventListener('scroll', function () {
|
|
9701
|
+
// Solo guardar si estamos en una página de colección
|
|
9702
|
+
if (_this.router.url.includes('/collection/')) {
|
|
9703
|
+
clearTimeout(scrollTimer_1);
|
|
9704
|
+
scrollTimer_1 = setTimeout(function () { return _this.saveCurrentState(); }, 300);
|
|
9705
|
+
}
|
|
9706
|
+
});
|
|
9707
|
+
// Guardar antes de que el usuario salga de la página
|
|
9708
|
+
window.addEventListener('beforeunload', function () {
|
|
9709
|
+
if (_this.router.url.includes('/collection/')) {
|
|
9710
|
+
_this.saveCurrentState();
|
|
9711
|
+
}
|
|
9712
|
+
});
|
|
9713
|
+
}
|
|
9714
|
+
};
|
|
9715
|
+
CollectionEcComponent.prototype.saveCurrentState = function () {
|
|
9716
|
+
if (common.isPlatformBrowser(this.platformId) && this.products && this.products.length > 0) {
|
|
9717
|
+
// Obtener posición de scroll de múltiples fuentes
|
|
9718
|
+
var scrollPos = Math.max(window.pageYOffset || 0, document.documentElement.scrollTop || 0, document.body.scrollTop || 0);
|
|
9719
|
+
// Solo guardar si tenemos una posición significativa o productos suficientes
|
|
9720
|
+
if (scrollPos > 10 || this.products.length > 10) {
|
|
9721
|
+
var state = {
|
|
9722
|
+
products: __spread$4(this.products),
|
|
9723
|
+
scrollPosition: scrollPos,
|
|
9724
|
+
finished: this.finished,
|
|
9725
|
+
loading: this.loading,
|
|
9726
|
+
page: Math.ceil(this.products.length / 10),
|
|
9727
|
+
allCachedProducts: this.usingCachedProducts ? __spread$4(this.allCachedProducts) : __spread$4(this.products),
|
|
9728
|
+
filters: this.filters ? __spread$4(this.filters) : undefined,
|
|
9729
|
+
filters_top: this.filters_top ? __spread$4(this.filters_top) : undefined,
|
|
9730
|
+
breadcrumb: this.breadcrumb ? __spread$4(this.breadcrumb) : undefined
|
|
9731
|
+
};
|
|
9732
|
+
CollectionEcComponent_1.stateCache.set(this.stateKey, state);
|
|
9733
|
+
// También guardar en sessionStorage como backup
|
|
9734
|
+
try {
|
|
9735
|
+
sessionStorage.setItem("collection_scroll_" + this.stateKey, scrollPos.toString());
|
|
9736
|
+
sessionStorage.setItem("collection_products_" + this.stateKey, this.products.length.toString());
|
|
9737
|
+
}
|
|
9738
|
+
catch (e) { }
|
|
9739
|
+
}
|
|
9740
|
+
}
|
|
9741
|
+
};
|
|
9742
|
+
CollectionEcComponent.prototype.restoreScrollWithRetries = function (targetPosition) {
|
|
9743
|
+
var _this = this;
|
|
9744
|
+
if (this.isScrolling) {
|
|
9745
|
+
return;
|
|
9746
|
+
}
|
|
9747
|
+
// Verificar si el target es mayor que la altura del documento
|
|
9748
|
+
var documentHeight = document.documentElement.scrollHeight;
|
|
9749
|
+
if (targetPosition > documentHeight) {
|
|
9750
|
+
targetPosition = Math.max(0, documentHeight - window.innerHeight);
|
|
9751
|
+
}
|
|
9752
|
+
// Solo verificar si el usuario ha hecho scroll muy lejos
|
|
9753
|
+
var currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
9754
|
+
if (currentPos > 500 && Math.abs(currentPos - targetPosition) > 1000) {
|
|
9755
|
+
return;
|
|
9756
|
+
}
|
|
9757
|
+
this.isScrolling = true;
|
|
9758
|
+
// Intentar encontrar una posición más precisa basada en elementos del DOM
|
|
9759
|
+
var improvedPosition = this.tryScrollToProductByIndex(targetPosition);
|
|
9760
|
+
if (improvedPosition !== targetPosition) {
|
|
9761
|
+
targetPosition = improvedPosition;
|
|
9762
|
+
}
|
|
9763
|
+
var attempts = 0;
|
|
9764
|
+
var maxAttempts = 15;
|
|
9765
|
+
var tryScroll = function () {
|
|
9766
|
+
attempts++;
|
|
9767
|
+
// Usar scroll más agresivo si es necesario
|
|
9768
|
+
if (attempts < 3) {
|
|
9769
|
+
// Primeros intentos con smooth
|
|
9770
|
+
window.scrollTo({
|
|
9771
|
+
top: targetPosition,
|
|
9772
|
+
behavior: 'smooth'
|
|
9773
|
+
});
|
|
9774
|
+
}
|
|
9775
|
+
else {
|
|
9776
|
+
// Intentos posteriores más directos
|
|
9777
|
+
window.scrollTo(0, targetPosition);
|
|
9778
|
+
document.documentElement.scrollTop = targetPosition;
|
|
9779
|
+
document.body.scrollTop = targetPosition;
|
|
9780
|
+
}
|
|
9781
|
+
// Verificar después de un momento
|
|
9782
|
+
setTimeout(function () {
|
|
9783
|
+
var currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
9784
|
+
var difference = Math.abs(currentPos - targetPosition);
|
|
9785
|
+
if (difference > 50 && attempts < maxAttempts) {
|
|
9786
|
+
var delay = attempts < 5 ? 100 : attempts < 10 ? 200 : 300;
|
|
9787
|
+
setTimeout(tryScroll, delay);
|
|
9788
|
+
}
|
|
9789
|
+
else {
|
|
9790
|
+
_this.isScrolling = false; // Liberar flag cuando termine
|
|
9791
|
+
}
|
|
9792
|
+
}, 100);
|
|
9793
|
+
};
|
|
9794
|
+
// Intentar solo una vez inicialmente
|
|
9795
|
+
tryScroll();
|
|
9796
|
+
};
|
|
9797
|
+
CollectionEcComponent.prototype.tryScrollToProductByIndex = function (targetPosition) {
|
|
9798
|
+
// Intentar calcular a qué producto corresponde la posición
|
|
9799
|
+
var approximateIndex = Math.floor(targetPosition / 400); // Asumiendo ~400px por producto
|
|
9800
|
+
// Buscar elementos de producto
|
|
9801
|
+
var productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
9802
|
+
if (productElements.length > approximateIndex && approximateIndex >= 0) {
|
|
9803
|
+
var targetElement = productElements[approximateIndex];
|
|
9804
|
+
var elementPosition = targetElement.offsetTop;
|
|
9805
|
+
// Usar la posición del elemento si es razonable
|
|
9806
|
+
if (Math.abs(elementPosition - targetPosition) < 800) {
|
|
9807
|
+
return elementPosition;
|
|
9808
|
+
}
|
|
9809
|
+
}
|
|
9810
|
+
return targetPosition; // Usar posición original si no encuentra elemento adecuado
|
|
9811
|
+
};
|
|
9812
|
+
CollectionEcComponent.prototype.waitForProductRendering = function (targetPosition) {
|
|
9813
|
+
var _this = this;
|
|
9814
|
+
var _a;
|
|
9815
|
+
// Configurar el scroll pendiente para que ngAfterViewChecked lo maneje
|
|
9816
|
+
this.pendingScrollPosition = targetPosition;
|
|
9817
|
+
this.expectedProductCount = ((_a = this.products) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
9818
|
+
// Timeout de seguridad en caso de que ngAfterViewChecked no se ejecute
|
|
9819
|
+
setTimeout(function () {
|
|
9820
|
+
if (_this.pendingScrollPosition !== null) {
|
|
9821
|
+
var targetPos = _this.pendingScrollPosition;
|
|
9822
|
+
_this.pendingScrollPosition = null;
|
|
9823
|
+
_this.restoreScrollWithRetries(targetPos);
|
|
9824
|
+
_this.isRestoringState = false;
|
|
9825
|
+
}
|
|
9826
|
+
}, 2000);
|
|
9827
|
+
};
|
|
9828
|
+
var CollectionEcComponent_1;
|
|
9829
|
+
// Propiedades para scroll y cache
|
|
9830
|
+
CollectionEcComponent.stateCache = new Map();
|
|
9831
|
+
CollectionEcComponent.maxCacheSize = 10;
|
|
9419
9832
|
CollectionEcComponent.ctorParameters = function () { return [
|
|
9420
9833
|
{ type: ProductsService },
|
|
9421
9834
|
{ type: ParametersService },
|
|
@@ -9425,7 +9838,9 @@
|
|
|
9425
9838
|
{ type: AnalyticsService },
|
|
9426
9839
|
{ type: CartService },
|
|
9427
9840
|
{ type: Constants },
|
|
9428
|
-
{ type: FiltersService }
|
|
9841
|
+
{ type: FiltersService },
|
|
9842
|
+
{ type: router.Router },
|
|
9843
|
+
{ type: Object, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }
|
|
9429
9844
|
]; };
|
|
9430
9845
|
__decorate$V([
|
|
9431
9846
|
core.Input()
|
|
@@ -9439,12 +9854,13 @@
|
|
|
9439
9854
|
__decorate$V([
|
|
9440
9855
|
core.Input()
|
|
9441
9856
|
], CollectionEcComponent.prototype, "optionsFilters", void 0);
|
|
9442
|
-
CollectionEcComponent = __decorate$V([
|
|
9857
|
+
CollectionEcComponent = CollectionEcComponent_1 = __decorate$V([
|
|
9443
9858
|
core.Component({
|
|
9444
9859
|
selector: 'app-collection-ec',
|
|
9445
9860
|
template: "\r\n<div>\r\n <div class=\"collection\">\r\n <ng-content select=\"[collection]\"> </ng-content>\r\n </div>\r\n\r\n <div class=\"all\">\r\n <ng-content select=\"[all]\"> </ng-content>\r\n </div>\r\n</div>\r\n\r\n<app-blocks-ec [section]=\"'collection'\"></app-blocks-ec>",
|
|
9446
9861
|
styles: [".h1-custom{color:#00f}"]
|
|
9447
|
-
})
|
|
9862
|
+
}),
|
|
9863
|
+
__param$7(10, core.Inject(core.PLATFORM_ID))
|
|
9448
9864
|
], CollectionEcComponent);
|
|
9449
9865
|
return CollectionEcComponent;
|
|
9450
9866
|
}(ComponentHelper));
|
|
@@ -9595,7 +10011,7 @@
|
|
|
9595
10011
|
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;
|
|
9596
10012
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9597
10013
|
};
|
|
9598
|
-
var __param$
|
|
10014
|
+
var __param$8 = (this && this.__param) || function (paramIndex, decorator) {
|
|
9599
10015
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9600
10016
|
};
|
|
9601
10017
|
/** @dynamic */
|
|
@@ -9796,7 +10212,7 @@
|
|
|
9796
10212
|
template: "",
|
|
9797
10213
|
styles: [""]
|
|
9798
10214
|
}),
|
|
9799
|
-
__param$
|
|
10215
|
+
__param$8(1, core.Inject(common.DOCUMENT))
|
|
9800
10216
|
], FiltersEcComponent);
|
|
9801
10217
|
return FiltersEcComponent;
|
|
9802
10218
|
}(ComponentHelper));
|
|
@@ -9820,7 +10236,7 @@
|
|
|
9820
10236
|
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;
|
|
9821
10237
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9822
10238
|
};
|
|
9823
|
-
var __param$
|
|
10239
|
+
var __param$9 = (this && this.__param) || function (paramIndex, decorator) {
|
|
9824
10240
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9825
10241
|
};
|
|
9826
10242
|
/** @dynamic */
|
|
@@ -9909,7 +10325,7 @@
|
|
|
9909
10325
|
template: "",
|
|
9910
10326
|
styles: [".min-width-large{min-width:150px}"]
|
|
9911
10327
|
}),
|
|
9912
|
-
__param$
|
|
10328
|
+
__param$9(1, core.Inject(common.DOCUMENT))
|
|
9913
10329
|
], FiltersTopEcComponent);
|
|
9914
10330
|
return FiltersTopEcComponent;
|
|
9915
10331
|
}(ComponentHelper));
|
|
@@ -10486,28 +10902,11 @@
|
|
|
10486
10902
|
this.getCurrencyListApi = function () { return 'shop-api/currencies'; };
|
|
10487
10903
|
this.getConvertibilityApi = function (baseCurrency, targetCurrency) { return 'shop-api/currencies?baseCurrency=' + baseCurrency + '&targetCurrency=' + targetCurrency; };
|
|
10488
10904
|
/**
|
|
10489
|
-
* @description Se carga la moneda por defecto
|
|
10905
|
+
* @description Se carga la moneda por defecto.
|
|
10490
10906
|
*/
|
|
10491
|
-
this.loadDefaultCurrency = function (
|
|
10492
|
-
|
|
10493
|
-
_this.
|
|
10494
|
-
var _a;
|
|
10495
|
-
_this.currencyListSubject.next(list);
|
|
10496
|
-
_this.consts.setCurrencyTypeConfig(list);
|
|
10497
|
-
var cfg = (_a = list) === null || _a === void 0 ? void 0 : _a.find(function (c) { return c.code === currencyCode; });
|
|
10498
|
-
if (cfg) {
|
|
10499
|
-
// Setea moneda activa con su configuración completa
|
|
10500
|
-
_this.consts.setCurrency(cfg.code, cfg);
|
|
10501
|
-
}
|
|
10502
|
-
else {
|
|
10503
|
-
_this.consts.setCurrency(currencyCode);
|
|
10504
|
-
}
|
|
10505
|
-
_this.load();
|
|
10506
|
-
}).catch(function () {
|
|
10507
|
-
// En caso de error, al menos fijá el código para no romper el flujo
|
|
10508
|
-
_this.consts.setCurrency(currencyCode);
|
|
10509
|
-
_this.load();
|
|
10510
|
-
});
|
|
10907
|
+
this.loadDefaultCurrency = function (currency) {
|
|
10908
|
+
_this.consts.setCurrency(currency);
|
|
10909
|
+
_this.load();
|
|
10511
10910
|
};
|
|
10512
10911
|
/**
|
|
10513
10912
|
* @description calcula la convetibilidad del precio pasado por paramentro segun esta formula:
|
|
@@ -10529,32 +10928,12 @@
|
|
|
10529
10928
|
});
|
|
10530
10929
|
}); };
|
|
10531
10930
|
/**
|
|
10532
|
-
* Carga la lista de monedas
|
|
10533
|
-
*
|
|
10534
|
-
* Si no existe una moneda activa guardada en `localStorage`, inicializa la moneda activa
|
|
10535
|
-
* tomando la moneda base del canal (`ChannelConfigService.baseCurrency`) y sus metadatos
|
|
10536
|
-
* obtenidos de la lista (símbolo, posición, decimales). Si no se encuentra la base en la
|
|
10537
|
-
* lista, usa la primera disponible.
|
|
10538
|
-
*
|
|
10539
|
-
* Finalmente, llama a `load()` para propagar la configuración a los observables y (si aplica)
|
|
10540
|
-
* actualizar `localStorage`.
|
|
10541
|
-
*
|
|
10542
|
-
* @sideEffect Actualiza `currencyList$`, `Constants.setCurrencyTypeConfig` y potencialmente
|
|
10543
|
-
* `Constants.setCurrency`.
|
|
10544
|
-
* @returns void
|
|
10931
|
+
* @description Carga la lista de monedas/currencies.
|
|
10545
10932
|
*/
|
|
10546
10933
|
this.loadCurrencyList = function () {
|
|
10547
10934
|
_this.connection.get(_this.getCurrencyListApi()).toPromise().then(function (res) {
|
|
10548
|
-
var _a, _b, _c, _d;
|
|
10549
10935
|
_this.currencyListSubject.next(res);
|
|
10550
10936
|
_this.consts.setCurrencyTypeConfig(res);
|
|
10551
|
-
var stored = localStorage.getItem('currency');
|
|
10552
|
-
if (!stored) {
|
|
10553
|
-
var base_1 = (_a = _this.injector.get(ChannelConfigService).getActiveChannel()) === null || _a === void 0 ? void 0 : _a.baseCurrency;
|
|
10554
|
-
var cfg = (_c = (_b = res) === null || _b === void 0 ? void 0 : _b.find(function (c) { return c.code === base_1; }), (_c !== null && _c !== void 0 ? _c : (_d = res) === null || _d === void 0 ? void 0 : _d[0]));
|
|
10555
|
-
if (cfg)
|
|
10556
|
-
_this.consts.setCurrency(cfg.code, cfg);
|
|
10557
|
-
}
|
|
10558
10937
|
_this.load();
|
|
10559
10938
|
});
|
|
10560
10939
|
};
|
|
@@ -10640,6 +11019,7 @@
|
|
|
10640
11019
|
}
|
|
10641
11020
|
};
|
|
10642
11021
|
this.injector.get(ChannelConfigService).channelConfig$.subscribe(function (channel) {
|
|
11022
|
+
console.log(channel);
|
|
10643
11023
|
channel.applyCurrencyExchange ? _this.loadCurrencyList() : _this.loadDefaultCurrency(channel.baseCurrency);
|
|
10644
11024
|
console.log(_this.enableApplyCurrencyExchange);
|
|
10645
11025
|
});
|
|
@@ -11207,22 +11587,6 @@
|
|
|
11207
11587
|
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;
|
|
11208
11588
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11209
11589
|
};
|
|
11210
|
-
var __read$7 = (this && this.__read) || function (o, n) {
|
|
11211
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
11212
|
-
if (!m) return o;
|
|
11213
|
-
var i = m.call(o), r, ar = [], e;
|
|
11214
|
-
try {
|
|
11215
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
11216
|
-
}
|
|
11217
|
-
catch (error) { e = { error: error }; }
|
|
11218
|
-
finally {
|
|
11219
|
-
try {
|
|
11220
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
11221
|
-
}
|
|
11222
|
-
finally { if (e) throw e.error; }
|
|
11223
|
-
}
|
|
11224
|
-
return ar;
|
|
11225
|
-
};
|
|
11226
11590
|
var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
11227
11591
|
__extends$w(ProductDetailEcComponent, _super);
|
|
11228
11592
|
function ProductDetailEcComponent(productService, consts, activedRoute, cartService, optionsService, productsService, analyticsService, router, toastrService, meta, injector) {
|
|
@@ -11248,11 +11612,9 @@
|
|
|
11248
11612
|
_this.showReviews = false;
|
|
11249
11613
|
_this.hidePrices = false;
|
|
11250
11614
|
_this.creditAccountShowPrices = null;
|
|
11251
|
-
_this.enableFieldNotesInArticleFile = false;
|
|
11252
11615
|
_this.addToCart = function () {
|
|
11253
11616
|
var _a;
|
|
11254
|
-
|
|
11255
|
-
_this.quantity > 0 && _this.productService.addToCart(_this.quantity, undefined, note);
|
|
11617
|
+
_this.quantity > 0 && _this.productService.addToCart(_this.quantity, undefined, ((_a = _this.comments) === null || _a === void 0 ? void 0 : _a.trim()) || null);
|
|
11256
11618
|
};
|
|
11257
11619
|
_this.addAllProductosToCart = function () {
|
|
11258
11620
|
var _a, _b;
|
|
@@ -11358,10 +11720,9 @@
|
|
|
11358
11720
|
_this.changeImgFocus(productParam.picturesdefault[0]);
|
|
11359
11721
|
});
|
|
11360
11722
|
_this.injector.get(ChannelConfigService).channelConfig$.subscribe(function (channel) {
|
|
11361
|
-
var _a, _b
|
|
11723
|
+
var _a, _b;
|
|
11362
11724
|
_this.showReviews = channel.showReviews;
|
|
11363
11725
|
_this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
11364
|
-
_this.enableFieldNotesInArticleFile = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.enableFieldNotesInArticleFile, (_d !== null && _d !== void 0 ? _d : false));
|
|
11365
11726
|
});
|
|
11366
11727
|
_this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
11367
11728
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -11376,31 +11737,7 @@
|
|
|
11376
11737
|
return cadena.replace(expresionRegular, '');
|
|
11377
11738
|
};
|
|
11378
11739
|
ProductDetailEcComponent.prototype.ngOnInit = function () {
|
|
11379
|
-
var _this = this;
|
|
11380
11740
|
this.ecOnInit();
|
|
11381
|
-
// Prellenar comentarios cuando:
|
|
11382
|
-
// - cargue el producto
|
|
11383
|
-
// - cambie la variante seleccionada (asociatedData$)
|
|
11384
|
-
// - cambien los ítems del carrito
|
|
11385
|
-
this.prefillSub = rxjs.combineLatest([
|
|
11386
|
-
this.productService.product$.pipe(operators.filter(function (p) { return !!p && !!p.id; })),
|
|
11387
|
-
this.productService.asociatedData$.pipe(operators.startWith(null)),
|
|
11388
|
-
this.cartService.cartItems.pipe(operators.startWith([])),
|
|
11389
|
-
]).subscribe(function (_a) {
|
|
11390
|
-
var _b = __read$7(_a, 3), product = _b[0], data = _b[1], items = _b[2];
|
|
11391
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
11392
|
-
var variantId = (_k = (_f = (_d = (_c = data) === null || _c === void 0 ? void 0 : _c.variantCode, (_d !== null && _d !== void 0 ? _d : (_e = data) === null || _e === void 0 ? void 0 : _e.variant_id)), (_f !== null && _f !== void 0 ? _f : (_j = (_h = (_g = product) === null || _g === void 0 ? void 0 : _g.variants) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.code)), (_k !== null && _k !== void 0 ? _k : null));
|
|
11393
|
-
var match = (_l = items) === null || _l === void 0 ? void 0 : _l.find(function (it) {
|
|
11394
|
-
var _a, _b, _c, _d;
|
|
11395
|
-
return ((_b = (_a = it) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.id) === ((_c = product) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
11396
|
-
(variantId ? ((_d = it) === null || _d === void 0 ? void 0 : _d.variant_id) === variantId : true);
|
|
11397
|
-
});
|
|
11398
|
-
_this.comments = (_o = (_m = match) === null || _m === void 0 ? void 0 : _m.comments, (_o !== null && _o !== void 0 ? _o : ''));
|
|
11399
|
-
});
|
|
11400
|
-
};
|
|
11401
|
-
ProductDetailEcComponent.prototype.ngOnDestroy = function () {
|
|
11402
|
-
var _a;
|
|
11403
|
-
(_a = this.prefillSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
11404
11741
|
};
|
|
11405
11742
|
ProductDetailEcComponent.prototype.scroll = function () {
|
|
11406
11743
|
var el = this.contact.nativeElement;
|
|
@@ -11549,6 +11886,7 @@
|
|
|
11549
11886
|
ProductEcComponent.prototype.ngOnChanges = function () {
|
|
11550
11887
|
};
|
|
11551
11888
|
ProductEcComponent.prototype.selectItem = function (product) {
|
|
11889
|
+
console.log('entro');
|
|
11552
11890
|
this.analyticsService.callEvent('select_item', product);
|
|
11553
11891
|
};
|
|
11554
11892
|
ProductEcComponent.ctorParameters = function () { return [
|
|
@@ -12069,7 +12407,7 @@
|
|
|
12069
12407
|
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;
|
|
12070
12408
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12071
12409
|
};
|
|
12072
|
-
var __param$
|
|
12410
|
+
var __param$a = (this && this.__param) || function (paramIndex, decorator) {
|
|
12073
12411
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12074
12412
|
};
|
|
12075
12413
|
var SellerDashboardContainerEcComponent = /** @class */ (function (_super) {
|
|
@@ -12186,7 +12524,7 @@
|
|
|
12186
12524
|
template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\r\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\r\n <div class=\"container-xl\">\r\n <div class=\"row\">\r\n <main class=\"col-md-12\">\r\n\r\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\r\n <li class=\"nav-item col-12 col-lg-2\">\r\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\"\r\n aria-current=\"page\">\r\n {{ 'my-clients' | translate }}\r\n </a>\r\n </li>\r\n <li class=\"ms-auto row\">\r\n <div\r\n class=\"d-flex justify-content-end justify-content-lg-end justify-content-xl-end col-12 col-md-12 col-lg-auto\">\r\n <ng-container *ngIf=\"hasUIComponent('GENERATE_BUDGET_BTN') \">\r\n <a *ngIf=\"authService.getCustomer()?.id; else withoutCustomer\"\r\n [routerLink]=\"'/collection'\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"><i\r\n class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate }}\r\n </a>\r\n <ng-template #withoutCustomer>\r\n <a class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"\r\n (click)=\"toastrService.show('must-select-customer')\">\r\n <i class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate\r\n }}\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <a *ngIf=\"hasUIComponent('MANAGE_ORDERS_BTN')\"\r\n (click)=\"navigateExternal(constants.getUrlBase())\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center me- me-lg-4 mr- mr-lg-4\"><i\r\n class=\"bi bi-archive-fill me-2 mr-2\"></i>{{ 'manage-orders' | translate }}</a>\r\n </div>\r\n <div class=\"d-flex camposVendedores col-12 col-md-12 col-lg-auto justify-content-end\">\r\n <select *ngIf=\"hasUIComponent('SORT_SELECT')\" id=\"customerSort\" name=\"customerSort\"\r\n (change)=\"sortCustomers($event.target.value)\" class=\"mb-1 ordenarVendedores form-select\">\r\n <option selected hidden disabled>{{ 'order-by' | translate }}</option>\r\n <option value='asc_firstName'>{{ 'client' | translate }} (A-Z)</option>\r\n <option value='desc_firstName'>{{ 'client' | translate }} (Z-A)</option>\r\n <option value='asc_id'>Menor a Mayor c\u00F3digo</option>\r\n <option value='desc_id'>Mayor a Menor c\u00F3digo</option>\r\n </select>\r\n <form *ngIf=\"hasUIComponent('SEARCH_FORM')\"\r\n class=\"col-lg-auto mb-lg-0 d-flex ms-3 ml-3 d-flex buscadorVendedores\">\r\n <input type=\"text\" name=\"searchInput\" class=\"form-control\"\r\n placeholder=\"{{ 'search' | translate }}\" [(ngModel)]=\"searchInput\"\r\n (keyup.enter)=\"updateCustomers()\">\r\n <button class=\"btn btn-primary ms-1 ml-1 bg-white border-dark btnSearch\"><i\r\n class=\"bi bi-search text-dark\" (click)=\"updateCustomers()\"></i></button>\r\n </form>\r\n </div>\r\n </li>\r\n </ul>\r\n\r\n <ng-container *ngIf=\"user.customers?.length; else noCustomers\">\r\n\r\n <article class=\"card card-body mb-1 carritoProductoHeader m-0 py-0 mt-4\">\r\n <div class=\"row align-items-center font-bold border-bottom\">\r\n <div class=\"col-3 col-md-2 text-left\">\r\n <small>{{ 'code' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-5 col-md-3 mb-md-0\">\r\n <small>{{ 'client' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <small>{{ 'user' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left\">\r\n <small>{{ 'new-orders' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-2 col-md-2 text-left d-none d-md-block\">\r\n <small></small>\r\n </div>\r\n\r\n </div>\r\n </article>\r\n\r\n <article *ngFor=\"let customer of filteredCustomers\" [class]=\"'card card-body mb-3 cadaVendedor ' + (isActive(customer) ? 'activo':'')\">\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-3 col-md-2 text-left ps-2 pl-2\">\r\n <div class=\"price h6 pb-0 mb-0 ps-3 pl-1\">\r\n {{ customer.managementSystemInternalCode || 'n/a' }}\r\n </div>\r\n </div>\r\n <div class=\"col-5 col-md-3 text-left\">\r\n <div class=\"price h6 fw-normal ps-2 pl-2 pb-0 mb-0\">\r\n {{ customer.firstName }} {{ customer.lastName }}\r\n <p class=\"d-block d-md-none fs-6 mt-1 mb-0 p-0 userMobile\">\r\n {{ customer.email }}\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <div class=\"price h6 fw-normal pb-0 mb-0 ps-2 pl-2\">\r\n {{ customer.email }}\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left ps-2 pl-2\">\r\n <div *ngIf=\"true\" class=\"contNumero\">\r\n {{ customer.ordersNotApproved }}\r\n </div>\r\n </div>\r\n <div class=\"col-12 col-md-2 btnIngresar\">\r\n\r\n <ng-container\r\n *ngIf=\"authService.getCustomer()?.id == customer.id; else noActiveCustomer\">\r\n <a (click)=\"changeCustomer(null)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-left me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'exit' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-container>\r\n <ng-template #noActiveCustomer>\r\n <a (click)=\"changeCustomer(customer)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-in-right me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'operate-as' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </article>\r\n\r\n </ng-container>\r\n\r\n </main>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n\r\n<ng-template #noCustomers>\r\n <h4 class=\"text-center p-5\">{{ 'no-customers' | translate }}</h4>\r\n</ng-template>",
|
|
12187
12525
|
styles: ["#seller-dashboard{--seller-dashboard-primary-color:0,0,0}.btn-seller-primary{color:#fff!important;background-color:rgba(var(--seller-dashboard-primary-color),1)!important;border-color:rgba(var(--seller-dashboard-primary-color),1)!important}.btn-seller-primary:hover{background-color:rgba(var(--seller-dashboard-primary-color),.9)!important}.btn-seller-primary:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)!important}.btnGestionar{padding:6px 12px!important;height:36px;display:flex;align-items:center;justify-content:center;margin-left:10px}.ordenarVendedores{width:150px!important;color:#8b8b8b!important;background-color:#fff;border:1px solid #b6b6b6!important;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px}.buscadorVendedores{margin-bottom:4px!important}.buscadorVendedores input{border:1px solid #b6b6b6!important;width:200px}.buscadorVendedores .btnSearch{border:1px solid #b6b6b6!important;padding:.375rem .75rem;font-size:1rem}.buscadorVendedores .btnSearch:focus{background-color:#fff!important}.carritoProductoHeader{border:none!important}.carritoProductoHeader small{font-size:13px}.cadaVendedor{padding:5px 0;margin-bottom:0!important;border:none!important;border-bottom:1px solid #ccc!important;border-radius:0!important;-webkit-border-radius:0}.cadaVendedor .btnIngresar a{padding:10px!important;border-width:1px!important;border-style:solid!important;display:flex;align-items:center;width:100%!important;margin-left:auto;color:#fff}.cadaVendedor .btnIngresar .contNumero{background-color:#eee;width:20px;height:20px;color:#000;font-size:13px;display:flex;align-items:center;justify-content:center;font-weight:600;border-radius:20px;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px}.userMobile{font-size:14px!important;font-style:italic!important}.cadaVendedor .btnIngresar a:hover{background-color:rgba(var(--seller-dashboard-primary-color),.85)}.cadaVendedor .btnIngresar a:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.border-bottom{border-bottom:1px solid #000!important}@media screen and (max-width:1200px){.btnGestionar{font-size:12px}}@media screen and (max-width:992px){.camposVendedores{justify-content:flex-end;margin-top:8px;margin-bottom:4px}}@media all and (max-width:768px){.ordenarVendedores{width:140px!important}.buscadorVendedores input{width:140px}.cadaVendedor .btnIngresar a{width:70px!important}}@media all and (max-width:576px){.tablaVendedores .nav-tabs .nav-link{font-size:13px;padding:6px!important}.btnGestionar{padding:6px 8px!important;font-size:13px;height:36px;display:flex;align-items:center;justify-content:center;margin-top:3px;margin-left:10px}.buscadorVendedores input,.ordenarVendedores{font-size:13px}}.fs-6{font-size:1rem!important}.cadaVendedor.activo{background-color:#eee}"]
|
|
12188
12526
|
}),
|
|
12189
|
-
__param$
|
|
12527
|
+
__param$a(3, core.Inject('env'))
|
|
12190
12528
|
], SellerDashboardContainerEcComponent);
|
|
12191
12529
|
return SellerDashboardContainerEcComponent;
|
|
12192
12530
|
}(ComponentHelper));
|
|
@@ -12793,8 +13131,8 @@
|
|
|
12793
13131
|
PriceEcComponent = __decorate$1f([
|
|
12794
13132
|
core.Component({
|
|
12795
13133
|
selector: 'app-price-ec',
|
|
12796
|
-
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}:
|
|
12797
|
-
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}
|
|
13134
|
+
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: {{ basePrice | ecCurrencySymbol }}\r\n </p>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-template #detailedTaxBlock>\r\n <ng-container *ngIf=\"customTaxTemplate; else defaultTaxBlock\">\r\n <ng-container *ngTemplateOutlet=\"customTaxTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #defaultTaxBlock>\r\n <div class=\"taxes-section\">\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: {{ basePrice | ecCurrencySymbol }}</p>\r\n <ul class=\"taxes-list\">\r\n <li>\r\n {{ taxes.Name }}: {{ taxeAmount | ecCurrencySymbol }}\r\n </li>\r\n </ul>\r\n </div>\r\n</ng-template>",
|
|
13135
|
+
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}"]
|
|
12798
13136
|
})
|
|
12799
13137
|
], PriceEcComponent);
|
|
12800
13138
|
return PriceEcComponent;
|
|
@@ -12819,7 +13157,7 @@
|
|
|
12819
13157
|
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;
|
|
12820
13158
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12821
13159
|
};
|
|
12822
|
-
var __read$
|
|
13160
|
+
var __read$7 = (this && this.__read) || function (o, n) {
|
|
12823
13161
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
12824
13162
|
if (!m) return o;
|
|
12825
13163
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -12863,7 +13201,7 @@
|
|
|
12863
13201
|
var _this = this;
|
|
12864
13202
|
var state;
|
|
12865
13203
|
rxjs.combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
12866
|
-
var _b = __read$
|
|
13204
|
+
var _b = __read$7(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
12867
13205
|
state = queryRouter.state;
|
|
12868
13206
|
state && state == 'statuspayment' && (state = queryParams.status);
|
|
12869
13207
|
console.log('PARAMETROS STATE -> ', state);
|
|
@@ -12946,7 +13284,7 @@
|
|
|
12946
13284
|
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;
|
|
12947
13285
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12948
13286
|
};
|
|
12949
|
-
var __param$
|
|
13287
|
+
var __param$b = (this && this.__param) || function (paramIndex, decorator) {
|
|
12950
13288
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12951
13289
|
};
|
|
12952
13290
|
/** @dynamic */
|
|
@@ -13071,7 +13409,7 @@
|
|
|
13071
13409
|
providers: [modal.BsModalService],
|
|
13072
13410
|
styles: [".half-width{width:49%!important}.ml-1{margin-left:1%}#card-form{height:450px}.iframeStyle{height:800px;width:100%;max-height:800px}"]
|
|
13073
13411
|
}),
|
|
13074
|
-
__param$
|
|
13412
|
+
__param$b(6, core.Inject(common.DOCUMENT))
|
|
13075
13413
|
], RedSysProEcComponent);
|
|
13076
13414
|
return RedSysProEcComponent;
|
|
13077
13415
|
}(ComponentHelper));
|
|
@@ -13624,7 +13962,6 @@
|
|
|
13624
13962
|
_this.hidePrices = false;
|
|
13625
13963
|
_this.hideDiscounts = false;
|
|
13626
13964
|
_this.hideTaxes = false;
|
|
13627
|
-
_this.enableFieldNotesInArticleFile = false;
|
|
13628
13965
|
_this.toDate = function (date, format) { return moment(date).format(!format && 'DD/MM/YYYY, h:mm:ss a' || format); };
|
|
13629
13966
|
_this.callError = function () {
|
|
13630
13967
|
_this.error = '?';
|
|
@@ -13667,7 +14004,7 @@
|
|
|
13667
14004
|
_this.callError();
|
|
13668
14005
|
};
|
|
13669
14006
|
this.channelConfigService.channelConfig$.subscribe(function (config) {
|
|
13670
|
-
var _a, _b, _c, _d, _e, _f
|
|
14007
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13671
14008
|
if (config && config.allowRepeatOrders !== undefined) {
|
|
13672
14009
|
_this.allowRepeatOrders = config.allowRepeatOrders;
|
|
13673
14010
|
}
|
|
@@ -13677,7 +14014,6 @@
|
|
|
13677
14014
|
_this.hidePrices = (_b = (_a = config) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
13678
14015
|
_this.hideDiscounts = (_d = (_c = config) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
13679
14016
|
_this.hideTaxes = (_f = (_e = config) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
13680
|
-
_this.enableFieldNotesInArticleFile = (_h = (_g = config) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
13681
14017
|
});
|
|
13682
14018
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
13683
14019
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -13703,7 +14039,7 @@
|
|
|
13703
14039
|
OrderEcComponent = __decorate$1l([
|
|
13704
14040
|
core.Component({
|
|
13705
14041
|
selector: 'app-order-ec',
|
|
13706
|
-
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"enableFieldNotesInArticleFile && item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
14042
|
+
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
13707
14043
|
styles: [".maxwidth{max-width:100px}.comment-truncated{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-height:3em}"]
|
|
13708
14044
|
})
|
|
13709
14045
|
], OrderEcComponent);
|
|
@@ -15486,10 +15822,12 @@
|
|
|
15486
15822
|
_this.loading = false;
|
|
15487
15823
|
}
|
|
15488
15824
|
else {
|
|
15825
|
+
/* console.log('Entro al else'); */
|
|
15489
15826
|
_this.renderPayPal();
|
|
15490
15827
|
}
|
|
15491
15828
|
}
|
|
15492
15829
|
catch (error) {
|
|
15830
|
+
/* console.log('Entro al catch'); */
|
|
15493
15831
|
_this.renderPayPal();
|
|
15494
15832
|
}
|
|
15495
15833
|
}, 1000);
|
|
@@ -16162,7 +16500,7 @@
|
|
|
16162
16500
|
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;
|
|
16163
16501
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16164
16502
|
};
|
|
16165
|
-
var __read$
|
|
16503
|
+
var __read$8 = (this && this.__read) || function (o, n) {
|
|
16166
16504
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
16167
16505
|
if (!m) return o;
|
|
16168
16506
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -16194,7 +16532,7 @@
|
|
|
16194
16532
|
var _this = this;
|
|
16195
16533
|
var token;
|
|
16196
16534
|
rxjs.combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
16197
|
-
var _b = __read$
|
|
16535
|
+
var _b = __read$8(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
16198
16536
|
token = queryRouter.token;
|
|
16199
16537
|
console.log('PARAMETROS token -> ', token);
|
|
16200
16538
|
_this.cartService.loadCartByToken(token).then(function (res) {
|
|
@@ -19276,7 +19614,6 @@
|
|
|
19276
19614
|
this.creditAccountShowPrices = null;
|
|
19277
19615
|
this.showTaxLegend = false;
|
|
19278
19616
|
this.cartLoading = false;
|
|
19279
|
-
this.enableFieldNotesInArticleFile = false;
|
|
19280
19617
|
this.getVariants = function (product) {
|
|
19281
19618
|
var item = product.product;
|
|
19282
19619
|
if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
|
|
@@ -19326,11 +19663,10 @@
|
|
|
19326
19663
|
_this.user = u;
|
|
19327
19664
|
});
|
|
19328
19665
|
this.channelConfigService.channelConfig$.subscribe(function (channel) {
|
|
19329
|
-
var _a, _b, _c, _d, _e, _f
|
|
19666
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19330
19667
|
_this.hideDiscounts = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hideDiscounts, (_b !== null && _b !== void 0 ? _b : false));
|
|
19331
19668
|
_this.hideTaxes = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideTaxes, (_d !== null && _d !== void 0 ? _d : false));
|
|
19332
19669
|
_this.showTaxLegend = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.showTaxLegend, (_f !== null && _f !== void 0 ? _f : false));
|
|
19333
|
-
_this.enableFieldNotesInArticleFile = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
19334
19670
|
});
|
|
19335
19671
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
19336
19672
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -19340,7 +19676,7 @@
|
|
|
19340
19676
|
});
|
|
19341
19677
|
};
|
|
19342
19678
|
SidebarEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
19343
|
-
var _a
|
|
19679
|
+
var _a;
|
|
19344
19680
|
if (this.cartLoading) {
|
|
19345
19681
|
return;
|
|
19346
19682
|
}
|
|
@@ -19360,14 +19696,13 @@
|
|
|
19360
19696
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
19361
19697
|
}
|
|
19362
19698
|
}
|
|
19363
|
-
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
19364
19699
|
if (id) {
|
|
19365
19700
|
var elem_1 = document.getElementById(id);
|
|
19366
19701
|
if (elem_1) {
|
|
19367
19702
|
elem_1.disabled = true;
|
|
19368
19703
|
}
|
|
19369
19704
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19370
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
19705
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19371
19706
|
}
|
|
19372
19707
|
else {
|
|
19373
19708
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -19380,7 +19715,7 @@
|
|
|
19380
19715
|
}
|
|
19381
19716
|
else {
|
|
19382
19717
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19383
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
19718
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19384
19719
|
}
|
|
19385
19720
|
}
|
|
19386
19721
|
};
|
|
@@ -19669,7 +20004,7 @@
|
|
|
19669
20004
|
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;
|
|
19670
20005
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19671
20006
|
};
|
|
19672
|
-
var __param$
|
|
20007
|
+
var __param$c = (this && this.__param) || function (paramIndex, decorator) {
|
|
19673
20008
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
19674
20009
|
};
|
|
19675
20010
|
var ParamsContext = /** @class */ (function () {
|
|
@@ -19756,7 +20091,7 @@
|
|
|
19756
20091
|
core.Directive({
|
|
19757
20092
|
selector: "[ecAddActionRedirect]",
|
|
19758
20093
|
}),
|
|
19759
|
-
__param$
|
|
20094
|
+
__param$c(0, core.Inject(common.DOCUMENT))
|
|
19760
20095
|
], AddActionRedirectDirective);
|
|
19761
20096
|
return AddActionRedirectDirective;
|
|
19762
20097
|
}());
|
|
@@ -19846,7 +20181,7 @@
|
|
|
19846
20181
|
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;
|
|
19847
20182
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19848
20183
|
};
|
|
19849
|
-
var __param$
|
|
20184
|
+
var __param$d = (this && this.__param) || function (paramIndex, decorator) {
|
|
19850
20185
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
19851
20186
|
};
|
|
19852
20187
|
var ParamsContext$1 = /** @class */ (function () {
|
|
@@ -19994,7 +20329,7 @@
|
|
|
19994
20329
|
core.Directive({
|
|
19995
20330
|
selector: "[ecProductOff]",
|
|
19996
20331
|
}),
|
|
19997
|
-
__param$
|
|
20332
|
+
__param$d(0, core.Inject(common.DOCUMENT))
|
|
19998
20333
|
], ProductOffDirective);
|
|
19999
20334
|
return ProductOffDirective;
|
|
20000
20335
|
}());
|
|
@@ -20179,7 +20514,7 @@
|
|
|
20179
20514
|
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;
|
|
20180
20515
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20181
20516
|
};
|
|
20182
|
-
var __read$
|
|
20517
|
+
var __read$9 = (this && this.__read) || function (o, n) {
|
|
20183
20518
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
20184
20519
|
if (!m) return o;
|
|
20185
20520
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -20245,7 +20580,7 @@
|
|
|
20245
20580
|
var forceShow = mode === 'alwaysShowDecimals';
|
|
20246
20581
|
var forceHide = mode === 'alwaysHideDecimals';
|
|
20247
20582
|
var showDecimals = forceShow ? true : forceHide ? false : !withoutDecimalGlobal;
|
|
20248
|
-
var _b = __read$
|
|
20583
|
+
var _b = __read$9((value || '').split(','), 2), ent = _b[0], _c = _b[1], dec = _c === void 0 ? '00' : _c;
|
|
20249
20584
|
if (showDecimals) {
|
|
20250
20585
|
if (dec.length > 2)
|
|
20251
20586
|
dec = dec.slice(0, 2);
|
|
@@ -20265,7 +20600,6 @@
|
|
|
20265
20600
|
ecCurrencySymbolPipe = __decorate$27([
|
|
20266
20601
|
core.Pipe({
|
|
20267
20602
|
name: 'ecCurrencySymbol',
|
|
20268
|
-
pure: false
|
|
20269
20603
|
})
|
|
20270
20604
|
], ecCurrencySymbolPipe);
|
|
20271
20605
|
return ecCurrencySymbolPipe;
|
|
@@ -20577,7 +20911,7 @@
|
|
|
20577
20911
|
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;
|
|
20578
20912
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20579
20913
|
};
|
|
20580
|
-
var __param$
|
|
20914
|
+
var __param$e = (this && this.__param) || function (paramIndex, decorator) {
|
|
20581
20915
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
20582
20916
|
};
|
|
20583
20917
|
var StandardReuseStrategy = /** @class */ (function () {
|
|
@@ -20608,7 +20942,7 @@
|
|
|
20608
20942
|
]; };
|
|
20609
20943
|
StandardReuseStrategy = __decorate$2d([
|
|
20610
20944
|
core.Injectable(),
|
|
20611
|
-
__param$
|
|
20945
|
+
__param$e(0, core.Inject('env'))
|
|
20612
20946
|
], StandardReuseStrategy);
|
|
20613
20947
|
return StandardReuseStrategy;
|
|
20614
20948
|
}());
|