ng-easycommerce-v18 0.3.13 → 0.3.14-beta.2

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.
Files changed (28) hide show
  1. package/README.md +4 -7
  2. package/esm2022/lib/classes/filters/filter.mjs +27 -2
  3. package/esm2022/lib/constants/api.constants.service.mjs +41 -44
  4. package/esm2022/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.mjs +1 -5
  5. package/esm2022/lib/ec-components/auth-ec/register-form-ec/register-form-ec.component.mjs +1 -5
  6. package/esm2022/lib/ec-components/blocks-ec/block-products-ec/block-products-ec.component.mjs +5 -3
  7. package/esm2022/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.mjs +2 -6
  8. package/esm2022/lib/ec-components/header-ec/header-ec.component.mjs +34 -45
  9. package/esm2022/lib/ec-components/product-ec/product-ec.component.mjs +5 -95
  10. package/esm2022/lib/ec-components/related-products-ec/related-products-ec.component.mjs +6 -4
  11. package/esm2022/lib/ec-components/widgets-ec/index.mjs +1 -2
  12. package/esm2022/lib/ec-components/widgets-ec/magnizoom-ec/magnizoom-ec.component.mjs +4 -2
  13. package/esm2022/lib/ec-services/analytics/facebook-pixel.service.mjs +4 -2
  14. package/esm2022/lib/ec-services/analytics/google-analytics.service.mjs +4 -2
  15. package/esm2022/lib/ec-services/options.service.mjs +27 -3
  16. package/fesm2022/ng-easycommerce-v18.mjs +165 -350
  17. package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
  18. package/lib/constants/api.constants.service.d.ts +13 -24
  19. package/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.d.ts +0 -2
  20. package/lib/ec-components/auth-ec/register-form-ec/register-form-ec.component.d.ts +0 -2
  21. package/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.d.ts +0 -5
  22. package/lib/ec-components/header-ec/header-ec.component.d.ts +1 -5
  23. package/lib/ec-components/product-ec/product-ec.component.d.ts +1 -10
  24. package/lib/ec-components/widgets-ec/index.d.ts +0 -1
  25. package/lib/ec-services/options.service.d.ts +4 -0
  26. package/package.json +1 -1
  27. package/esm2022/lib/ec-components/widgets-ec/redsys-catch-ec/redsys-catch-ec.component.mjs +0 -138
  28. package/lib/ec-components/widgets-ec/redsys-catch-ec/redsys-catch-ec.component.d.ts +0 -26
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, inject, Injectable, PLATFORM_ID, RendererFactory2, afterNextRender, signal, EnvironmentInjector, runInInjectionContext, Component, ChangeDetectorRef, HostListener, CUSTOM_ELEMENTS_SCHEMA, Input, Pipe, Injector, EventEmitter, Output, forwardRef, afterRender, ViewChild, Inject, computed, Renderer2, ChangeDetectionStrategy, Directive } from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, inject, PLATFORM_ID, Injectable, Inject, RendererFactory2, afterNextRender, signal, EnvironmentInjector, runInInjectionContext, Component, ChangeDetectorRef, HostListener, CUSTOM_ELEMENTS_SCHEMA, Input, Pipe, Injector, EventEmitter, Output, forwardRef, afterRender, ViewChild, computed, Renderer2, ChangeDetectionStrategy, Directive } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
- import { DOCUMENT, isPlatformBrowser, AsyncPipe, CommonModule, TitleCasePipe, JsonPipe, UpperCasePipe, Location } from '@angular/common';
4
+ import { isPlatformServer, DOCUMENT, isPlatformBrowser, AsyncPipe, CommonModule, TitleCasePipe, JsonPipe, UpperCasePipe, Location } from '@angular/common';
5
5
  import { take, BehaviorSubject, shareReplay, map, catchError, of, filter, ReplaySubject, firstValueFrom, concatMap, throwError, switchMap, combineLatest } from 'rxjs';
6
6
  import { HttpClient, HttpHeaders } from '@angular/common/http';
7
7
  import * as i1$1 from '@ngx-translate/core';
@@ -14,7 +14,7 @@ import { ToastrService } from 'ngx-toastr';
14
14
  import moment from 'moment';
15
15
  import { StorageMap } from '@ngx-pwa/local-storage';
16
16
  import * as i1$3 from '@angular/forms';
17
- import { Validators, FormsModule, FormBuilder, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
17
+ import { Validators, FormBuilder, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
18
18
  import { register } from 'swiper/element/bundle';
19
19
  import { register as register$1 } from 'swiper/element';
20
20
  import * as i1$4 from '@angular/platform-browser';
@@ -44,89 +44,82 @@ const provideEnvironment = (environment) => {
44
44
  };
45
45
 
46
46
  /**
47
- * Servicio que provee de datos que estan relacionado con las peticiones a la API
48
- * @export
49
- * @class ApiConstantsService
47
+ * Servicio que provee de datos relacionados con las peticiones a la API
50
48
  */
51
49
  class ApiConstantsService {
50
+ ssrApiUrl;
52
51
  _localStorage = inject(LocalStorageService);
53
52
  _translate = inject(TranslateService);
54
- /**
55
- * Contiene los datos provisto por el frontend en el archivo environment.ts
56
- */
57
53
  environment = inject(ENVIRONMENT_TOKEN);
54
+ platformId = inject(PLATFORM_ID);
55
+ _channel;
56
+ LOCALE;
57
+ SHOP_API_URL = 'shop-api/';
58
+ CMS_URL = 'cms/';
59
+ constructor(ssrApiUrl) {
60
+ this.ssrApiUrl = ssrApiUrl;
61
+ this._channel = this.environment.channel;
62
+ this.LOCALE = this.environment.locale;
63
+ }
58
64
  /**
59
65
  * Canal actual del frontend
60
66
  */
61
67
  get CHANNEL() {
62
- // Verificar si estamos en el navegador (no en SSR)
63
68
  if (typeof window !== 'undefined') {
64
- // Primero intenta leer de window.__env (configurado por Docker)
65
69
  const windowEnv = window.__env;
66
- if (windowEnv?.channel) {
70
+ if (windowEnv?.channel)
67
71
  return windowEnv.channel;
68
- }
69
72
  }
70
- // Fallback al environment
71
73
  return this._channel;
72
74
  }
73
75
  set CHANNEL(value) {
74
76
  this._channel = value;
75
77
  }
76
- _channel;
77
- /**
78
- * Locale actual del frontend
79
- */
80
- LOCALE;
81
- /**
82
- * URL para las peticiones a shop-api
83
- */
84
- SHOP_API_URL = 'shop-api/';
85
- /**
86
- * URL para las peticiones a cms
87
- */
88
- CMS_URL = 'cms/';
89
- constructor() {
90
- this._channel = this.environment.channel;
91
- this.LOCALE = this.environment.locale;
92
- }
93
78
  /**
94
79
  * URL del backend para realizar las peticiones
95
80
  */
96
81
  get API_URL() {
97
- // Verificar si estamos en el navegador (no en SSR)
82
+ // Browser runtime-config
98
83
  if (typeof window !== 'undefined') {
99
- // Primero intenta leer de window.__env (configurado por Docker)
100
84
  const windowEnv = window.__env;
101
- if (windowEnv?.apiUrl) {
102
- return windowEnv.apiUrl;
103
- }
85
+ if (windowEnv?.apiBaseUrl)
86
+ return windowEnv.apiBaseUrl;
104
87
  }
105
- // Fallback al environment (para SSR y como backup)
88
+ // SSR
89
+ if (isPlatformServer(this.platformId)) {
90
+ return this.ssrApiUrl;
91
+ }
92
+ // Fallback environment
106
93
  return this.environment.apiUrl ?? '';
107
94
  }
108
95
  /**
109
- * Retorna la url base
110
- * @returns {string}
96
+ * URL base completa para shop-api con channel y locale
97
+ */
98
+ getShopApiBase() {
99
+ const channel = this.CHANNEL || 'undefined';
100
+ const locale = this.LOCALE || 'undefined';
101
+ return `${this.API_URL}/${this.SHOP_API_URL}${channel}/?locale=${locale}`;
102
+ }
103
+ /**
104
+ * Retorna la url base general (sin shop-api)
111
105
  */
112
106
  getUrlBase() {
113
107
  return this.API_URL;
114
108
  }
115
109
  /**
116
110
  * Cambia el canal actual
117
- * @param code
118
- * @returns
119
111
  */
120
- setChannel(code) { this.CHANNEL = code; }
112
+ setChannel(code) {
113
+ this.CHANNEL = code;
114
+ }
121
115
  setLocale(locale) {
122
116
  this._localStorage.setItem(this.LOCALE_KEY, locale);
123
117
  this._translate.use(locale.split('_')[0]);
124
118
  this.LOCALE = locale;
125
119
  }
126
- //Storage key
127
120
  LOCALE_KEY = 'LOCALE';
128
121
  CHANNEL_KEY = 'CHANNEL';
129
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiConstantsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
122
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiConstantsService, deps: [{ token: 'API_URL' }], target: i0.ɵɵFactoryTarget.Injectable });
130
123
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiConstantsService, providedIn: 'root' });
131
124
  }
132
125
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiConstantsService, decorators: [{
@@ -134,7 +127,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
134
127
  args: [{
135
128
  providedIn: 'root'
136
129
  }]
137
- }], ctorParameters: () => [] });
130
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
131
+ type: Inject,
132
+ args: ['API_URL']
133
+ }] }] });
138
134
 
139
135
  /**
140
136
  * Servicio que funciona como abstracción para manejar la conexión con la API
@@ -533,6 +529,10 @@ class OptionsService {
533
529
  * Maneja las peticiones a la API
534
530
  */
535
531
  connection = inject(ConnectionService);
532
+ /**
533
+ * Platform ID para verificar si estamos en el navegador
534
+ */
535
+ platformId = inject(PLATFORM_ID);
536
536
  /**
537
537
  * Constantes del core
538
538
  */
@@ -643,7 +643,26 @@ class OptionsService {
643
643
  * @returns
644
644
  */
645
645
  removeAccents(str) {
646
- return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
646
+ if (isPlatformBrowser(this.platformId) && typeof String.prototype.normalize === 'function') {
647
+ return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
648
+ }
649
+ // Fallback para SSR - remover acentos manualmente
650
+ return str.replace(/[àáâãäå]/g, 'a')
651
+ .replace(/[èéêë]/g, 'e')
652
+ .replace(/[ìíîï]/g, 'i')
653
+ .replace(/[òóôõö]/g, 'o')
654
+ .replace(/[ùúûü]/g, 'u')
655
+ .replace(/[ýÿ]/g, 'y')
656
+ .replace(/[ñ]/g, 'n')
657
+ .replace(/[ç]/g, 'c')
658
+ .replace(/[ÀÁÂÃÄÅ]/g, 'A')
659
+ .replace(/[ÈÉÊË]/g, 'E')
660
+ .replace(/[ÌÍÎÏ]/g, 'I')
661
+ .replace(/[ÒÓÔÕÖ]/g, 'O')
662
+ .replace(/[ÙÚÛÜ]/g, 'U')
663
+ .replace(/[ÝŸ]/g, 'Y')
664
+ .replace(/[Ñ]/g, 'N')
665
+ .replace(/[Ç]/g, 'C');
647
666
  }
648
667
  /**
649
668
  * Realiza un mapeo de los datos para darle un formato mas entendible a la
@@ -1026,7 +1045,9 @@ class FacebookPixelService {
1026
1045
  this.renderer.appendChild(this.document?.body, new_analityc_script);
1027
1046
  this.enabled = true;
1028
1047
  }
1029
- setTimeout(() => this.callEvent('initialize'), 1000);
1048
+ if (isPlatformBrowser(this.platformId)) {
1049
+ setTimeout(() => this.callEvent('initialize'), 1000);
1050
+ }
1030
1051
  }
1031
1052
  /**
1032
1053
  * Ejecuta el evento pasado por parametro.
@@ -1243,7 +1264,9 @@ class GoogleAnalyticsService {
1243
1264
  this.renderer.appendChild(this.document?.head, declaration);
1244
1265
  this.enabled = true;
1245
1266
  }
1246
- setTimeout(() => this.startListeningPageViews(gtm_id), 1000);
1267
+ if (isPlatformBrowser(this.platformId)) {
1268
+ setTimeout(() => this.startListeningPageViews(gtm_id), 1000);
1269
+ }
1247
1270
  }
1248
1271
  /**
1249
1272
  *
@@ -2644,6 +2667,31 @@ class User {
2644
2667
  }
2645
2668
  }
2646
2669
 
2670
+ /**
2671
+ * Función auxiliar para remover acentos de forma segura para SSR
2672
+ */
2673
+ function safeRemoveAccents(str) {
2674
+ if (typeof window !== 'undefined' && typeof String.prototype.normalize === 'function') {
2675
+ return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
2676
+ }
2677
+ // Fallback para SSR - remover acentos manualmente
2678
+ return str.replace(/[àáâãäå]/g, 'a')
2679
+ .replace(/[èéêë]/g, 'e')
2680
+ .replace(/[ìíîï]/g, 'i')
2681
+ .replace(/[òóôõö]/g, 'o')
2682
+ .replace(/[ùúûü]/g, 'u')
2683
+ .replace(/[ýÿ]/g, 'y')
2684
+ .replace(/[ñ]/g, 'n')
2685
+ .replace(/[ç]/g, 'c')
2686
+ .replace(/[ÀÁÂÃÄÅ]/g, 'A')
2687
+ .replace(/[ÈÉÊË]/g, 'E')
2688
+ .replace(/[ÌÍÎÏ]/g, 'I')
2689
+ .replace(/[ÒÓÔÕÖ]/g, 'O')
2690
+ .replace(/[ÙÚÛÜ]/g, 'U')
2691
+ .replace(/[ÝŸ]/g, 'Y')
2692
+ .replace(/[Ñ]/g, 'N')
2693
+ .replace(/[Ç]/g, 'C');
2694
+ }
2647
2695
  class Filter {
2648
2696
  data = [];
2649
2697
  multi = false;
@@ -2663,7 +2711,7 @@ class Filter {
2663
2711
  throw new Error("Method not implemented.");
2664
2712
  }
2665
2713
  removeAccents = (str) => {
2666
- return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
2714
+ return safeRemoveAccents(str);
2667
2715
  };
2668
2716
  setSelected(element, value) {
2669
2717
  //console.log(element, value);
@@ -6154,11 +6202,6 @@ class HeaderEcComponent extends MenuEcComponent {
6154
6202
  hidePrices = false;
6155
6203
  __authService = inject(AuthService);
6156
6204
  _channelService = inject(ChannelService);
6157
- changeDetector = inject(ChangeDetectorRef);
6158
- appRouter = inject(Router);
6159
- platformId = inject(PLATFORM_ID);
6160
- // Observable del estado de autenticación
6161
- logged$;
6162
6205
  isAuthenticated$ = this.__authService.isAuthenticated();
6163
6206
  constructor() {
6164
6207
  super();
@@ -6172,26 +6215,11 @@ class HeaderEcComponent extends MenuEcComponent {
6172
6215
  coreConstantsService = inject(CoreConstantsService);
6173
6216
  router = inject(Router);
6174
6217
  cdr = inject(ChangeDetectorRef); // Inyectamos ChangeDetectorRef para forzar la actualización
6218
+ platformId = inject(PLATFORM_ID);
6175
6219
  ngOnInit() {
6176
6220
  this.channel = this.coreConstantsService.getChannel();
6177
6221
  this.onWindowScroll();
6178
6222
  this.detectRouteChange(); // Llamamos a la función que detecta el cambio de ruta
6179
- // Usar el Observable del AuthService
6180
- this.logged$ = this.__authService.loggedIn$;
6181
- // Suscribirse al Observable y forzar detección de cambios cuando sea necesario
6182
- this.logged$.subscribe(isLoggedIn => {
6183
- this.changeDetector.detectChanges();
6184
- });
6185
- if (isPlatformBrowser(this.platformId)) {
6186
- this.appRouter.events.subscribe(evt => {
6187
- if (evt instanceof NavigationEnd) {
6188
- // Forzar detección de cambios después de navegación
6189
- setTimeout(() => {
6190
- this.changeDetector.detectChanges();
6191
- }, 100);
6192
- }
6193
- });
6194
- }
6195
6223
  }
6196
6224
  ngAfterViewInit() {
6197
6225
  this.setupMobileMenu(); // Inicializamos el menú móvil
@@ -6210,17 +6238,21 @@ class HeaderEcComponent extends MenuEcComponent {
6210
6238
  });
6211
6239
  }
6212
6240
  onWindowScroll() {
6213
- const scrollTop = window.scrollY;
6214
- this.isScrolled = scrollTop > 80;
6241
+ if (isPlatformBrowser(this.platformId)) {
6242
+ const scrollTop = window.scrollY;
6243
+ this.isScrolled = scrollTop > 80;
6244
+ }
6215
6245
  }
6216
6246
  isHomeFunction() {
6217
- const headerElement = document.querySelector('header');
6218
- if (headerElement) {
6219
- if (this.router.url !== '/home') {
6220
- headerElement.classList.add('show-menu');
6221
- }
6222
- else {
6223
- headerElement.classList.remove('show-menu');
6247
+ if (isPlatformBrowser(this.platformId)) {
6248
+ const headerElement = document.querySelector('header');
6249
+ if (headerElement) {
6250
+ if (this.router.url !== '/home') {
6251
+ headerElement.classList.add('show-menu');
6252
+ }
6253
+ else {
6254
+ headerElement.classList.remove('show-menu');
6255
+ }
6224
6256
  }
6225
6257
  }
6226
6258
  }
@@ -6244,26 +6276,30 @@ class HeaderEcComponent extends MenuEcComponent {
6244
6276
  }
6245
6277
  };
6246
6278
  borrarInput(inputId) {
6247
- if (inputId) {
6248
- const input = document.getElementById(inputId);
6249
- if (input) {
6250
- input.value = '';
6251
- }
6252
- }
6253
- else {
6254
- const inputs = ['searchInput1'];
6255
- inputs.forEach((id) => {
6256
- const input = document.getElementById(id);
6279
+ if (isPlatformBrowser(this.platformId)) {
6280
+ if (inputId) {
6281
+ const input = document.getElementById(inputId);
6257
6282
  if (input) {
6258
6283
  input.value = '';
6259
6284
  }
6260
- });
6285
+ }
6286
+ else {
6287
+ const inputs = ['searchInput1'];
6288
+ inputs.forEach((id) => {
6289
+ const input = document.getElementById(id);
6290
+ if (input) {
6291
+ input.value = '';
6292
+ }
6293
+ });
6294
+ }
6261
6295
  }
6262
6296
  this.searchValue = '';
6263
6297
  this.coreConstantsService.searchValue = '';
6264
6298
  this.getCollectionSearch();
6265
6299
  }
6266
6300
  setupMobileMenu() {
6301
+ if (!isPlatformBrowser(this.platformId))
6302
+ return;
6267
6303
  // console.log('setupMobileMenu called');
6268
6304
  const menuMobile = document.querySelector('.menuMobile');
6269
6305
  if (!(menuMobile instanceof HTMLElement))
@@ -6299,6 +6335,8 @@ class HeaderEcComponent extends MenuEcComponent {
6299
6335
  });
6300
6336
  }
6301
6337
  setupSearchInputs() {
6338
+ if (!isPlatformBrowser(this.platformId))
6339
+ return;
6302
6340
  const inputs = ['searchInput1', 'searchInput2'];
6303
6341
  inputs.forEach(id => {
6304
6342
  const input = document.getElementById(id);
@@ -6895,10 +6933,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
6895
6933
  class ProductEcComponent {
6896
6934
  injector = inject(Injector);
6897
6935
  routerService = inject(Router);
6898
- _cartService = inject(CartService);
6899
- _toastService = inject(ToastService);
6900
- isAddingToCart = signal(false);
6901
- quantity = signal(1);
6902
6936
  /**
6903
6937
  * Navega al detalle del producto y sube al inicio de la página
6904
6938
  * @param productId ID del producto
@@ -6971,97 +7005,12 @@ class ProductEcComponent {
6971
7005
  const discount = ((originalPrice - salePrice) / originalPrice) * 100;
6972
7006
  return Math.round(discount);
6973
7007
  }
6974
- plus(stock, multipleQuantity) {
6975
- console.log('Aumentando cantidad');
6976
- const current = Number(this.quantity()); // <-- fuerza a número
6977
- if (multipleQuantity && multipleQuantity > 0) {
6978
- stock
6979
- ? (current < stock
6980
- ? this.quantity.set(current + multipleQuantity)
6981
- : this._toastService.show('out-of-stock-actually'))
6982
- : this.quantity.set(current + multipleQuantity);
6983
- }
6984
- else {
6985
- stock
6986
- ? (current < stock
6987
- ? this.quantity.set(current + 1)
6988
- : this._toastService.show('out-of-stock-actually'))
6989
- : this.quantity.set(current + 1);
6990
- }
6991
- }
6992
- less(multipleQuantity) {
6993
- console.log('Disminuyendo cantidad');
6994
- const current = Number(this.quantity()); // <-- fuerza a número
6995
- if (multipleQuantity && multipleQuantity > 0) {
6996
- current > multipleQuantity
6997
- ? this.quantity.set(current - multipleQuantity)
6998
- : null;
6999
- }
7000
- else {
7001
- current > 1 ? this.quantity.set(current - 1) : null;
7002
- }
7003
- }
7004
- addToCart() {
7005
- console.log('Añadiendo al carrito');
7006
- if (this.isAddingToCart() || this.quantity() <= 0)
7007
- return;
7008
- // Verificar que tenemos el producto y sus variantes
7009
- if (!this.product || !this.product.variants || this.product.variants.length === 0) {
7010
- this._toastService.show('cant-buy');
7011
- return;
7012
- }
7013
- // Verificar stock
7014
- const firstVariant = this.product.variants[0];
7015
- if (!firstVariant.stock || firstVariant.stock <= 0) {
7016
- this._toastService.show('out-of-stock');
7017
- return;
7018
- }
7019
- // Verificar que no se supere el stock disponible
7020
- if (this.quantity() > firstVariant.stock) {
7021
- this._toastService.show('out-of-stock-actually');
7022
- return;
7023
- }
7024
- this.isAddingToCart.set(true);
7025
- try {
7026
- // Agregar al carrito usando CartService directamente
7027
- this._cartService.addToCart(this.product, this.quantity(), firstVariant.code);
7028
- console.log('Producto agregado al carrito exitosamente');
7029
- // Resetear cantidad a 1 después de agregar al carrito
7030
- this.quantity.set(1);
7031
- }
7032
- catch (error) {
7033
- console.error('Error al agregar al carrito:', error);
7034
- this._toastService.show('cant-buy');
7035
- }
7036
- setTimeout(() => {
7037
- this.isAddingToCart.set(false);
7038
- }, 2000);
7039
- }
7040
- checkStock(stock) {
7041
- if (this.quantity() >= stock)
7042
- this.quantity.set(stock);
7043
- }
7044
- onQuantityChange(event) {
7045
- const target = event.target;
7046
- const value = +target.value;
7047
- // Validar que el valor sea mayor a 0
7048
- if (value > 0) {
7049
- this.quantity.set(value);
7050
- // Validar contra el stock disponible
7051
- const maxStock = this.product?.variants?.[0]?.stock || this.product?.stock || 0;
7052
- this.checkStock(maxStock);
7053
- }
7054
- else {
7055
- // Si el valor es 0 o negativo, resetear a 1
7056
- this.quantity.set(1);
7057
- }
7058
- }
7059
7008
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7060
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ProductEcComponent, isStandalone: true, selector: "app-product-ec", inputs: { product: "product", isProductBox: "isProductBox", isCollection: "isCollection" }, outputs: { loaded: "loaded" }, ngImport: i0, template: "<a [routerLink]=\"['/product', product.id]\" class=\"text-decoration-none producto\">\r\n <!-- Marca especial y descuento -->\r\n <!-- <div *ngIf=\"product.saleprice || (product.special_mark && product.special_mark !== null && product.special_mark !== undefined && product.special_mark.length >0)\"\r\n class=\"marcas\">\r\n <div *ecProductStock=\"product\" [ecProductMini]=\"product.special_mark\"></div>\r\n <ng-container *ngIf=\"shouldShowPrice\">\r\n <div *ecProductStock=\"product\" [ngClass]=\"{'tag-dsc float-right': product.saleprice}\"\r\n [ecProductOff]=\"product\">\r\n </div>\r\n </ng-container>\r\n </div> -->\r\n\r\n <!-- Imagen del producto -->\r\n <div class=\"foto\">\r\n @if(product.picturesdefault){\r\n @if (product.picturesdefault && product.picturesdefault.length > 1 ) {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n <img [src]=\"mediaUrl + product.picturesdefault[1]\" alt=\"Imagen secundaria\" class=\"w-100 pic02\" />\r\n } @else {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n }\r\n }\r\n </div>\r\n <!-- Precio -->\r\n\r\n\r\n <!-- Nombre del producto -->\r\n <h6 class=\"title\">{{ product.name | titlecase }}</h6>\r\n\r\n <div class=\"sku\" [innerHTML]=\"product.shortdetails\"></div>\r\n\r\n @if (shouldShowPrice) {\r\n <app-price-ec [price]=\"product.price\" [saleprice]=\"product.saleprice\" class=\"\" />\r\n }\r\n @if(!hidePrices){\r\n @if(!showPricesOnlyToLoggedUsers || isAuthenticated$){\r\n\r\n <div class=\"fixBottom\">\r\n\r\n <!-- Bot\u00F3n de acciones -->\r\n <!-- <ng-container *ecProductStock=\"product; else noStock\"> -->\r\n <!-- Cuando no tiene marca especial o es de tipo 'standard' -->\r\n @if (!product.special_mark || product.special_mark.length === 0 || product.special_mark[0]?.type ===\r\n 'standard') {\r\n <button class=\"btn standard\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span> {{(\"buy\" | translate) | uppercase}} </span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"buy\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n }@else {\r\n <!-- Caso 1: Agotado o Disponible muy pronto -->\r\n @if (product.special_mark[0]?.type === 'out_of_stock' || product.special_mark[0]?.type === 'coming_soon') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0].name | uppercase }} </span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>}\r\n <!-- Caso 2: Contacto por WhatsApp -->\r\n @if (product.special_mark[0].type === 'whatsapp_contact') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\"\r\n (click)=\"openWhatsApp(product.special_mark[0]?.whatsappContact)\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n\r\n </button>\r\n }\r\n <!-- Caso 3: Solicitar m\u00E1s informaci\u00F3n -->\r\n @if (product.special_mark[0]?.type === 'more_info') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>\r\n }\r\n }\r\n </div>\r\n }}\r\n</a>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "component", type: PriceEcComponent, selector: "app-price-ec", inputs: ["price", "saleprice", "basePrice", "taxeAmount", "taxes", "priceSize", "showTaxLegendOnly", "disableTaxInfo", "customPriceTemplate", "customSalePriceTemplate", "customSimplePriceTemplate", "customSimpleSalePriceTemplate", "customTaxTemplate", "customOnlyTaxLabelTemplate"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FormsModule }] });
7009
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ProductEcComponent, isStandalone: true, selector: "app-product-ec", inputs: { product: "product", isProductBox: "isProductBox", isCollection: "isCollection" }, outputs: { loaded: "loaded" }, ngImport: i0, template: "<a [routerLink]=\"['/product', product.id]\" class=\"text-decoration-none producto\">\r\n <!-- Marca especial y descuento -->\r\n <!-- <div *ngIf=\"product.saleprice || (product.special_mark && product.special_mark !== null && product.special_mark !== undefined && product.special_mark.length >0)\"\r\n class=\"marcas\">\r\n <div *ecProductStock=\"product\" [ecProductMini]=\"product.special_mark\"></div>\r\n <ng-container *ngIf=\"shouldShowPrice\">\r\n <div *ecProductStock=\"product\" [ngClass]=\"{'tag-dsc float-right': product.saleprice}\"\r\n [ecProductOff]=\"product\">\r\n </div>\r\n </ng-container>\r\n </div> -->\r\n\r\n <!-- Imagen del producto -->\r\n <div class=\"foto\">\r\n @if(product.picturesdefault){\r\n @if (product.picturesdefault && product.picturesdefault.length > 1 ) {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n <img [src]=\"mediaUrl + product.picturesdefault[1]\" alt=\"Imagen secundaria\" class=\"w-100 pic02\" />\r\n } @else {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n }\r\n }\r\n </div>\r\n <!-- Precio -->\r\n\r\n\r\n <!-- Nombre del producto -->\r\n <h6 class=\"title\">{{ product.name | titlecase }}</h6>\r\n\r\n <div class=\"sku\" [innerHTML]=\"product.shortdetails\"></div>\r\n\r\n @if (shouldShowPrice) {\r\n <app-price-ec [price]=\"product.price\" [saleprice]=\"product.saleprice\" class=\"\" />\r\n }\r\n @if(!hidePrices){\r\n @if(!showPricesOnlyToLoggedUsers || isAuthenticated$){\r\n\r\n <div class=\"fixBottom\">\r\n\r\n <!-- Bot\u00F3n de acciones -->\r\n <!-- <ng-container *ecProductStock=\"product; else noStock\"> -->\r\n <!-- Cuando no tiene marca especial o es de tipo 'standard' -->\r\n @if (!product.special_mark || product.special_mark.length === 0 || product.special_mark[0]?.type ===\r\n 'standard') {\r\n <button class=\"btn standard\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span> {{(\"buy\" | translate) | uppercase}} </span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"buy\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n }@else {\r\n <!-- Caso 1: Agotado o Disponible muy pronto -->\r\n @if (product.special_mark[0]?.type === 'out_of_stock' || product.special_mark[0]?.type === 'coming_soon') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0].name | uppercase }} </span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>}\r\n <!-- Caso 2: Contacto por WhatsApp -->\r\n @if (product.special_mark[0].type === 'whatsapp_contact') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\"\r\n (click)=\"openWhatsApp(product.special_mark[0]?.whatsappContact)\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n\r\n </button>\r\n }\r\n <!-- Caso 3: Solicitar m\u00E1s informaci\u00F3n -->\r\n @if (product.special_mark[0]?.type === 'more_info') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>\r\n }\r\n }\r\n </div>\r\n }}\r\n</a>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "component", type: PriceEcComponent, selector: "app-price-ec", inputs: ["price", "saleprice", "basePrice", "taxeAmount", "taxes", "priceSize", "showTaxLegendOnly", "disableTaxInfo", "customPriceTemplate", "customSalePriceTemplate", "customSimplePriceTemplate", "customSimpleSalePriceTemplate", "customTaxTemplate", "customOnlyTaxLabelTemplate"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
7061
7010
  }
7062
7011
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductEcComponent, decorators: [{
7063
7012
  type: Component,
7064
- args: [{ selector: 'app-product-ec', standalone: true, imports: [CommonModule, PriceEcComponent, RouterLink, TranslateModule, FormsModule], template: "<a [routerLink]=\"['/product', product.id]\" class=\"text-decoration-none producto\">\r\n <!-- Marca especial y descuento -->\r\n <!-- <div *ngIf=\"product.saleprice || (product.special_mark && product.special_mark !== null && product.special_mark !== undefined && product.special_mark.length >0)\"\r\n class=\"marcas\">\r\n <div *ecProductStock=\"product\" [ecProductMini]=\"product.special_mark\"></div>\r\n <ng-container *ngIf=\"shouldShowPrice\">\r\n <div *ecProductStock=\"product\" [ngClass]=\"{'tag-dsc float-right': product.saleprice}\"\r\n [ecProductOff]=\"product\">\r\n </div>\r\n </ng-container>\r\n </div> -->\r\n\r\n <!-- Imagen del producto -->\r\n <div class=\"foto\">\r\n @if(product.picturesdefault){\r\n @if (product.picturesdefault && product.picturesdefault.length > 1 ) {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n <img [src]=\"mediaUrl + product.picturesdefault[1]\" alt=\"Imagen secundaria\" class=\"w-100 pic02\" />\r\n } @else {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n }\r\n }\r\n </div>\r\n <!-- Precio -->\r\n\r\n\r\n <!-- Nombre del producto -->\r\n <h6 class=\"title\">{{ product.name | titlecase }}</h6>\r\n\r\n <div class=\"sku\" [innerHTML]=\"product.shortdetails\"></div>\r\n\r\n @if (shouldShowPrice) {\r\n <app-price-ec [price]=\"product.price\" [saleprice]=\"product.saleprice\" class=\"\" />\r\n }\r\n @if(!hidePrices){\r\n @if(!showPricesOnlyToLoggedUsers || isAuthenticated$){\r\n\r\n <div class=\"fixBottom\">\r\n\r\n <!-- Bot\u00F3n de acciones -->\r\n <!-- <ng-container *ecProductStock=\"product; else noStock\"> -->\r\n <!-- Cuando no tiene marca especial o es de tipo 'standard' -->\r\n @if (!product.special_mark || product.special_mark.length === 0 || product.special_mark[0]?.type ===\r\n 'standard') {\r\n <button class=\"btn standard\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span> {{(\"buy\" | translate) | uppercase}} </span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"buy\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n }@else {\r\n <!-- Caso 1: Agotado o Disponible muy pronto -->\r\n @if (product.special_mark[0]?.type === 'out_of_stock' || product.special_mark[0]?.type === 'coming_soon') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0].name | uppercase }} </span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>}\r\n <!-- Caso 2: Contacto por WhatsApp -->\r\n @if (product.special_mark[0].type === 'whatsapp_contact') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\"\r\n (click)=\"openWhatsApp(product.special_mark[0]?.whatsappContact)\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n\r\n </button>\r\n }\r\n <!-- Caso 3: Solicitar m\u00E1s informaci\u00F3n -->\r\n @if (product.special_mark[0]?.type === 'more_info') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>\r\n }\r\n }\r\n </div>\r\n }}\r\n</a>" }]
7013
+ args: [{ selector: 'app-product-ec', standalone: true, imports: [CommonModule, PriceEcComponent, RouterLink, TranslateModule], template: "<a [routerLink]=\"['/product', product.id]\" class=\"text-decoration-none producto\">\r\n <!-- Marca especial y descuento -->\r\n <!-- <div *ngIf=\"product.saleprice || (product.special_mark && product.special_mark !== null && product.special_mark !== undefined && product.special_mark.length >0)\"\r\n class=\"marcas\">\r\n <div *ecProductStock=\"product\" [ecProductMini]=\"product.special_mark\"></div>\r\n <ng-container *ngIf=\"shouldShowPrice\">\r\n <div *ecProductStock=\"product\" [ngClass]=\"{'tag-dsc float-right': product.saleprice}\"\r\n [ecProductOff]=\"product\">\r\n </div>\r\n </ng-container>\r\n </div> -->\r\n\r\n <!-- Imagen del producto -->\r\n <div class=\"foto\">\r\n @if(product.picturesdefault){\r\n @if (product.picturesdefault && product.picturesdefault.length > 1 ) {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n <img [src]=\"mediaUrl + product.picturesdefault[1]\" alt=\"Imagen secundaria\" class=\"w-100 pic02\" />\r\n } @else {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n }\r\n }\r\n </div>\r\n <!-- Precio -->\r\n\r\n\r\n <!-- Nombre del producto -->\r\n <h6 class=\"title\">{{ product.name | titlecase }}</h6>\r\n\r\n <div class=\"sku\" [innerHTML]=\"product.shortdetails\"></div>\r\n\r\n @if (shouldShowPrice) {\r\n <app-price-ec [price]=\"product.price\" [saleprice]=\"product.saleprice\" class=\"\" />\r\n }\r\n @if(!hidePrices){\r\n @if(!showPricesOnlyToLoggedUsers || isAuthenticated$){\r\n\r\n <div class=\"fixBottom\">\r\n\r\n <!-- Bot\u00F3n de acciones -->\r\n <!-- <ng-container *ecProductStock=\"product; else noStock\"> -->\r\n <!-- Cuando no tiene marca especial o es de tipo 'standard' -->\r\n @if (!product.special_mark || product.special_mark.length === 0 || product.special_mark[0]?.type ===\r\n 'standard') {\r\n <button class=\"btn standard\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span> {{(\"buy\" | translate) | uppercase}} </span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"buy\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n }@else {\r\n <!-- Caso 1: Agotado o Disponible muy pronto -->\r\n @if (product.special_mark[0]?.type === 'out_of_stock' || product.special_mark[0]?.type === 'coming_soon') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0].name | uppercase }} </span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>}\r\n <!-- Caso 2: Contacto por WhatsApp -->\r\n @if (product.special_mark[0].type === 'whatsapp_contact') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\"\r\n (click)=\"openWhatsApp(product.special_mark[0]?.whatsappContact)\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n\r\n </button>\r\n }\r\n <!-- Caso 3: Solicitar m\u00E1s informaci\u00F3n -->\r\n @if (product.special_mark[0]?.type === 'more_info') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ product.special_mark[0]?.name | uppercase }}</span>\r\n }@else {\r\n {{ product.special_mark[0]?.name | uppercase }}\r\n }\r\n </button>\r\n }\r\n }\r\n </div>\r\n }}\r\n</a>" }]
7065
7014
  }], ctorParameters: () => [], propDecorators: { product: [{
7066
7015
  type: Input,
7067
7016
  args: [{
@@ -7134,7 +7083,7 @@ class BlockProductsEcComponent extends BlockEcComponent {
7134
7083
  * Permite personalización de las imágenes de las flechas mediante @Input.
7135
7084
  */
7136
7085
  setupSwiperNavigation() {
7137
- if (this.meta?.styles?.carrousel !== false) {
7086
+ if (this.meta?.styles?.carrousel !== false && isPlatformBrowser(this.platformId)) {
7138
7087
  // Usar setTimeout para asegurar que el swiper esté inicializado
7139
7088
  setTimeout(() => {
7140
7089
  this.initializeSwiperWithCustomNavigation();
@@ -7146,6 +7095,8 @@ class BlockProductsEcComponent extends BlockEcComponent {
7146
7095
  * Esta función puede ser movida al componente base para reutilización.
7147
7096
  */
7148
7097
  initializeSwiperWithCustomNavigation() {
7098
+ if (!isPlatformBrowser(this.platformId))
7099
+ return;
7149
7100
  const prevButton = document.getElementById(`${this.meta?.code}-prev`);
7150
7101
  const nextButton = document.getElementById(`${this.meta?.code}-next`);
7151
7102
  const swiperElement = document.getElementById(this.meta?.code);
@@ -7505,7 +7456,9 @@ class MagnizoomEcComponent {
7505
7456
  this.image = this.document.createElement('img');
7506
7457
  this.image.onload = () => {
7507
7458
  this.lensSize = { width: this.image.width / 2, height: this.image.height / 2 };
7508
- setTimeout(() => this.render());
7459
+ if (isPlatformBrowser(this.platformId)) {
7460
+ setTimeout(() => this.render());
7461
+ }
7509
7462
  };
7510
7463
  this.image.src = src;
7511
7464
  }
@@ -7635,157 +7588,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7635
7588
  args: ['mainCanvas', { static: true }]
7636
7589
  }] } });
7637
7590
 
7638
- class ComponentHelper {
7639
- constructor() {
7640
- this.ecOnConstruct();
7641
- }
7642
- ecOnInit = (params = {}) => {
7643
- };
7644
- ecOnConstruct = (params = {}) => {
7645
- };
7646
- hasParams = (params, searched) => {
7647
- if (!params || !searched)
7648
- return false;
7649
- const q = searched.trim().toLowerCase();
7650
- return params.some(p => {
7651
- const code = p?.['code']?.toString().toLowerCase() ?? '';
7652
- // Primero chequeo exacto, y si no, parcial
7653
- return code === q || code.includes(q);
7654
- });
7655
- };
7656
- navigateOnRouter(router, url) {
7657
- router.navigateByUrl(`/${url}`);
7658
- }
7659
- }
7660
-
7661
- class RedsysCatchEcComponent extends ComponentHelper {
7662
- activedRoute;
7663
- router;
7664
- checkoutService;
7665
- renderer;
7666
- elementRef;
7667
- document;
7668
- message = '';
7669
- subscription = null;
7670
- constructor(activedRoute, router, checkoutService, renderer, elementRef, document) {
7671
- super();
7672
- this.activedRoute = activedRoute;
7673
- this.router = router;
7674
- this.checkoutService = checkoutService;
7675
- this.renderer = renderer;
7676
- this.elementRef = elementRef;
7677
- this.document = document;
7678
- this.hideHeaderFooter();
7679
- this.ecOnConstruct();
7680
- }
7681
- ngOnInit() {
7682
- this.subscription = combineLatest([
7683
- this.activedRoute.params,
7684
- this.activedRoute.queryParams
7685
- ]).subscribe(([queryRouter, queryParams]) => {
7686
- let state;
7687
- state = queryRouter['state'];
7688
- if (state && state === 'statuspayment') {
7689
- state = queryParams['status'];
7690
- }
7691
- console.log('PARAMETROS STATE -> ', state);
7692
- this.handlePaymentState(state, queryParams);
7693
- });
7694
- this.ecOnInit();
7695
- }
7696
- ngOnDestroy() {
7697
- if (this.subscription) {
7698
- this.subscription.unsubscribe();
7699
- }
7700
- this.showHeaderFooter();
7701
- // this.ecOnDestroy(); // Removido si no existe en ComponentHelper
7702
- }
7703
- hideHeaderFooter() {
7704
- // Usar Renderer2 en lugar de jQuery para manipular el DOM
7705
- const header = this.document.querySelector('header');
7706
- const footer = this.document.querySelector('footer');
7707
- if (header) {
7708
- this.renderer.setStyle(header, 'display', 'none');
7709
- }
7710
- if (footer) {
7711
- this.renderer.setStyle(footer, 'display', 'none');
7712
- }
7713
- }
7714
- showHeaderFooter() {
7715
- // Restaurar la visibilidad al destruir el componente
7716
- const header = this.document.querySelector('header');
7717
- const footer = this.document.querySelector('footer');
7718
- if (header) {
7719
- this.renderer.removeStyle(header, 'display');
7720
- }
7721
- if (footer) {
7722
- this.renderer.removeStyle(footer, 'display');
7723
- }
7724
- }
7725
- handlePaymentState(state, queryParams) {
7726
- switch (state) {
7727
- case '200':
7728
- this.setStateInLocal('Su pago fue procesado con éxito.', 'success');
7729
- this.storeTotalAmount(queryParams);
7730
- break;
7731
- case 'success':
7732
- this.setStateInLocal('Su pago fue procesado con éxito.', state);
7733
- this.storeTotalAmount(queryParams);
7734
- break;
7735
- case 'pending':
7736
- this.setStateInLocal('Su pago fue procesado con éxito.', state);
7737
- break;
7738
- case 'failure':
7739
- this.setStateInLocal('Se ha cancelado el proceso de pago.', state);
7740
- this.storeTotalAmount(queryParams);
7741
- break;
7742
- case 'cancel':
7743
- this.setStateInLocal('Se ha cancelado el proceso de pago.', state);
7744
- break;
7745
- case 'ok':
7746
- this.setStateInSesion('Su pago fue procesado con éxito.', state);
7747
- break;
7748
- case 'challenge':
7749
- this.setStateInSesion('Redirigiendo a autenticación del banco emisor.', state);
7750
- break;
7751
- case 'error':
7752
- this.setStateInSesion('Algo no salio bien en la validación de sus datos.', state);
7753
- break;
7754
- case '0':
7755
- this.setStateInLocal('Se ha cancelado el proceso de pago.', 'failure');
7756
- break;
7757
- default:
7758
- break;
7759
- }
7760
- }
7761
- storeTotalAmount(queryParams) {
7762
- const totalAmount = queryParams['total_amount'];
7763
- if (totalAmount) {
7764
- localStorage.setItem('total_amount', totalAmount);
7765
- }
7766
- }
7767
- setStateInLocal = (mensaje, state) => {
7768
- this.message = mensaje;
7769
- localStorage.setItem('state', state);
7770
- sessionStorage.setItem('modalnews', 'false');
7771
- };
7772
- setStateInSesion = (mensaje, state) => {
7773
- this.message = mensaje;
7774
- sessionStorage.setItem('state', state);
7775
- localStorage.setItem('state', state);
7776
- sessionStorage.setItem('modalnews', 'false');
7777
- };
7778
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RedsysCatchEcComponent, deps: [{ token: i2.ActivatedRoute }, { token: i2.Router }, { token: CheckoutService }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
7779
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RedsysCatchEcComponent, isStandalone: true, selector: "app-redsys-catch-ec", usesInheritance: true, ngImport: i0, template: "<div id=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col align-self-center\">\r\n <h4 class=\"titpage center-block text-center font-nexa font-lg my-3\">{{ message | uppercase }}</h4>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col align-self-center\">\r\n <h5 class=\"center-block text-center font-nexa my-3\">Redirigiendo en segundos...</h5>\r\n <br>\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>", styles: [".loader{border:16px solid #f3f3f3;border-top:16px solid #dc3545;border-radius:50%;width:50px;height:50px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.flex-container{display:flex;justify-content:center;align-items:center;height:80vh;width:100%}.flex-container>div{width:90%;height:100px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "component", type: LoadingFullEcComponent, selector: "app-loading-full-ec" }] });
7780
- }
7781
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RedsysCatchEcComponent, decorators: [{
7782
- type: Component,
7783
- args: [{ selector: 'app-redsys-catch-ec', standalone: true, imports: [CommonModule, LoadingFullEcComponent], template: "<div id=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col align-self-center\">\r\n <h4 class=\"titpage center-block text-center font-nexa font-lg my-3\">{{ message | uppercase }}</h4>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col align-self-center\">\r\n <h5 class=\"center-block text-center font-nexa my-3\">Redirigiendo en segundos...</h5>\r\n <br>\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>", styles: [".loader{border:16px solid #f3f3f3;border-top:16px solid #dc3545;border-radius:50%;width:50px;height:50px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.flex-container{display:flex;justify-content:center;align-items:center;height:80vh;width:100%}.flex-container>div{width:90%;height:100px}\n"] }]
7784
- }], ctorParameters: () => [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: CheckoutService }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: Document, decorators: [{
7785
- type: Inject,
7786
- args: [DOCUMENT]
7787
- }] }] });
7788
-
7789
7591
  // export * from './rating-ec/rating-ec.component';
7790
7592
 
7791
7593
  class BlockFormContactEcComponent extends BlockEcComponent {
@@ -8061,7 +7863,6 @@ class LoginFormEcComponent {
8061
7863
  _formBuilder = inject(FormBuilder);
8062
7864
  _toastService = inject(ToastService);
8063
7865
  _router = inject(Router);
8064
- showPassword = false;
8065
7866
  /**
8066
7867
  * Parametro para indicar si tras loguear
8067
7868
  * debe redireccionar o no.
@@ -8150,9 +7951,6 @@ class LoginFormEcComponent {
8150
7951
  ? resolverFunction()
8151
7952
  : this._router.navigateByUrl(this.redirectTo);
8152
7953
  }
8153
- togglePassword() {
8154
- this.showPassword = !this.showPassword;
8155
- }
8156
7954
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginFormEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8157
7955
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LoginFormEcComponent, isStandalone: true, selector: "app-login-form-ec", inputs: { redirect: "redirect", redirectTo: "redirectTo", inCart: "inCart" }, outputs: { ready: "ready" }, ngImport: i0, template: "<div class=\"d-flex flex-column position-relative\">\r\n <h1 class=\"right-line ff-ubuntu-light mb-4\"><span>Ingresar</span></h1>\r\n <p class=\"ff-ubuntu-light font-sm pr-4 mb-4\">\r\n Si ya est\u00E1s registrado. Ingresa en tu cuenta con tu email y la\r\n contrase\u00F1a adecuada.\r\n </p>\r\n <div class=\"w-md-50 w-100 text-center\">\r\n <form [formGroup]=\"loginForm()\" (submit)=\"login($event)\">\r\n <input class=\"form-control mb-4 radius-0\" type=\"email\" formControlName=\"username\"\r\n placeholder=\"Correo Electr\u00F3nico\">\r\n <input class=\"form-control mb-4 radius-0\" type=\"password\" formControlName=\"password\"\r\n placeholder=\"Contrase\u00F1a\">\r\n\r\n <div class=\"row d-flex flex-column\">\r\n <div class=\"col-12 mb-4\">\r\n <button type=\"submit\"\r\n class=\"bg-gray border-0 px-4 py-2 color-white ff-ubuntu-light\">INGRESAR</button>\r\n </div>\r\n <div class=\"col-12 d-flex justify-content-center align-items-center\">\r\n <a [routerLink]=\"'/auth/forgot-password'\" class=\"font-md ff-ubuntu-light\">\r\n \u00BFOlvid\u00F3 su contrase\u00F1a?\r\n </a>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n @if(loading){\r\n <app-loading-section-ec></app-loading-section-ec>\r\n }\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: LoadingSectionEcComponent, selector: "app-loading-section-ec" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
8158
7956
  }
@@ -8252,7 +8050,6 @@ class RegisterFormEcComponent {
8252
8050
  _analyticsService = inject(AnalyticsService);
8253
8051
  _formBuilder = inject(FormBuilder);
8254
8052
  channelConfigService = inject(ChannelService);
8255
- showPassword = false;
8256
8053
  /**
8257
8054
  * Indica si debe redireccionar o se queda en la misma pantalla
8258
8055
  */
@@ -8368,9 +8165,6 @@ class RegisterFormEcComponent {
8368
8165
  this.register_loading = false;
8369
8166
  }
8370
8167
  }
8371
- togglePassword() {
8372
- this.showPassword = !this.showPassword;
8373
- }
8374
8168
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RegisterFormEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8375
8169
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: RegisterFormEcComponent, isStandalone: true, selector: "app-register-form-ec", inputs: { redirect: "redirect" }, outputs: { ready: "ready" }, ngImport: i0, template: "<div class=\"w-100 pl-md-5 position-relative\" id=\"register\">\r\n <div class=\"py-2\">\r\n <h5>CREAR CUENTA</h5>\r\n </div>\r\n <form id=\"registro\" [formGroup]=\"registerForm\" (submit)=\"register($event)\">\r\n <div class=\"form-group\">\r\n <label for=\"\" class=\"form-label\">NOMBRE</label>\r\n <input formControlName=\"firstName\" class=\"form-control rounded-0\" type=\"text\" placeholder=\"Nombre\">\r\n </div>\r\n <div class=\"form-group\">\r\n <label for=\"\" class=\"form-label\">APELLIDO</label>\r\n <input formControlName=\"lastName\" class=\"form-control rounded-0\" type=\"text\" placeholder=\"Apellido\">\r\n </div>\r\n <div class=\"form-group\">\r\n <label for=\"\" class=\"\">CORREO ELECTRONICO</label>\r\n <input formControlName=\"email\" email required class=\"form-control rounded-0\" type=\"email\"\r\n placeholder=\"Correo electr\u00F3nico\">\r\n </div>\r\n <div class=\"form-group\">\r\n <label for=\"\" class=\"form-label\">CONTRASE\u00D1A</label>\r\n <input formControlName=\"plainPassword\" required class=\"form-control rounded-0\" type=\"password\"\r\n placeholder=\"Contrase\u00F1a\">\r\n </div>\r\n <div class=\"form-group\">\r\n <label for=\"\" class=\"form-label\">REPETIR CONTRASE\u00D1A</label>\r\n <input formControlName=\"plainPassword2\" required class=\"form-control rounded-0\" type=\"password\"\r\n placeholder=\"Repetir contrase\u00F1a\">\r\n </div>\r\n\r\n <div class=\"custom-control d-flex flex-row form-check custom-checkbox mr-sm-2 mt-4 mb-2\">\r\n <input type=\"checkbox\" formControlName=\"terms\" required class=\"custom-control-input form-check-input\" name=\"Color2\"\r\n id=\"Color2\">\r\n <label class=\"custom-control-label ff-ubuntu-light font-sm form-check-label\" for=\"Color2\"> He\r\n le\u00EDdo y acepto las pol\u00EDticas de privacidad y los t\u00E9rminos y\r\n condiciones</label>\r\n </div>\r\n\r\n <div class=\"custom-control d-flex flex-row form-check custom-checkbox mr-sm-2 mb-4\">\r\n <input type=\"checkbox\" formControlName=\"newsletter\" class=\"custom-control-input form-check-input\" name=\"Color3\" id=\"Color3\">\r\n <label class=\"custom-control-label form-check-label ff-ubuntu-light font-sm\" for=\"Color3\">\r\n Suscripci\u00F3n al Newsletter</label>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <button [disabled]=\"registerForm.invalid\" type=\"submit\"\r\n class=\"btn btn-primary px-5 py-2 h-fit\">CREAR</button>\r\n </div>\r\n </div>\r\n </form>\r\n @if(loading){\r\n <app-loading-section-ec />\r\n }\r\n \r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$3.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1$3.EmailValidator, selector: "[email][formControlName],[email][formControl],[email][ngModel]", inputs: ["email"] }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: LoadingSectionEcComponent, selector: "app-loading-section-ec" }] });
8376
8170
  }
@@ -8525,6 +8319,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
8525
8319
  type: Output
8526
8320
  }] } });
8527
8321
 
8322
+ class ComponentHelper {
8323
+ constructor() {
8324
+ this.ecOnConstruct();
8325
+ }
8326
+ ecOnInit = (params = {}) => {
8327
+ };
8328
+ ecOnConstruct = (params = {}) => {
8329
+ };
8330
+ hasParams = (params, searched) => {
8331
+ if (!params || !searched)
8332
+ return false;
8333
+ const q = searched.trim().toLowerCase();
8334
+ return params.some(p => {
8335
+ const code = p?.['code']?.toString().toLowerCase() ?? '';
8336
+ // Primero chequeo exacto, y si no, parcial
8337
+ return code === q || code.includes(q);
8338
+ });
8339
+ };
8340
+ navigateOnRouter(router, url) {
8341
+ router.navigateByUrl(`/${url}`);
8342
+ }
8343
+ }
8344
+
8528
8345
  class PasswordResetEcComponent extends ComponentHelper {
8529
8346
  authService;
8530
8347
  toastr;
@@ -9125,7 +8942,6 @@ class CartItemEcComponent {
9125
8942
  _cartService = inject(CartService);
9126
8943
  _toastService = inject(ToastService);
9127
8944
  _constants = inject(CoreConstantsService);
9128
- parametersService = inject(ParametersService);
9129
8945
  mediaUrl = this._constants.mediaUrl();
9130
8946
  quantity = 0;
9131
8947
  variantsToShow = ['TALLA', 'COLOR'];
@@ -9212,9 +9028,6 @@ class CartItemEcComponent {
9212
9028
  }
9213
9029
  return false; // Solo se ejecuta si no se cumple la condición
9214
9030
  }
9215
- // PARAMETROS
9216
- parameters$ = this.parametersService.getParameters();
9217
- hasParams = this.parametersService.hasParams;
9218
9031
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CartItemEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9219
9032
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CartItemEcComponent, isStandalone: true, selector: "app-cart-item-ec", inputs: { item: "item", inSidebar: "inSidebar" }, ngImport: i0, template: "@if(!inSidebar){\r\n<p>cart-item-ec works!</p>\r\n}@else{\r\n\r\n<div class=\"row\">\r\n <div class=\"col-3\">\r\n @let product= item.product;\r\n @if(item.variant_id && product.variants.length>0){\r\n <img [src]=\"mediaUrl + product.variants[0].images[0]\" alt=\"\" class=\"img-fluid\">\r\n }@else{\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"\" class=\"img-fluid\">\r\n }\r\n </div>\r\n <div class=\"col-7\">\r\n <div class=\"info d-flex flex-column align-items-start\">\r\n @if (item.product.special_mark?.length > 0 || item.product.saleprice) {\r\n <div class=\"marcas\">\r\n <img [src]=\"mediaUrl + (item.product.special_mark?.[0]?.images[0] || '')\" alt=\"\">\r\n\r\n @if (item.product.saleprice) {\r\n <div class=\"tag-dsc\">\r\n {{\r\n createDiscountMessage(item.product.saleprice,\r\n item.product.price)\r\n }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n <a class=\"title text-dark text-decoration-none m-0 p-0 h6 mb-0\"\r\n [routerLink]=\"['/product', item.variant_id]\">{{\r\n item.product.name | titlecase\r\n }}</a>\r\n <div class=\"qty1\">\r\n <span>{{ item.product.id}}</span>\r\n </div>\r\n <div class=\"price h6 fw-bold mb-0 pb-0\">{{ item.product.price | ecCurrencySymbol\r\n }}</div>\r\n @if(getVariants(item); as options){\r\n <div class=\"d-flex align-items-center p-0\">\r\n @for(option of options; track $index){\r\n <span class=\"me-1\"> {{option.name | titlecase}}:</span>\r\n @if(option.name == 'COLOR'){\r\n <div class=\"p-2 rounded\" [style.background]=\"'#' + option.value\"></div>\r\n }@else{\r\n <b>{{option.value}}</b>\r\n }\r\n }\r\n </div>\r\n }\r\n <div class=\"campoCantidad mt-2\">\r\n <div class=\"numero\">\r\n <button (click)=\"less(item.product.variants[0]?.stock)\" class=\"btn btn-outline-secondary\"\r\n type=\"button\" id=\"button-addon1\">\r\n <i class=\"fa fa-minus\" aria-hidden=\"true\"></i>\r\n </button>\r\n <input type=\"text\" class=\"form-control text-center\" placeholder=\"\"\r\n aria-label=\"Example text with button addon\" aria-describedby=\"button-addon1\"\r\n [value]=\"item.quantity\" min=\"1\" step=\"1\" [(ngModel)]=\"quantity\"\r\n (change)=\"updateQuantity(item.product.variants[0]?.stock)\">\r\n <button (click)=\"plus(item.product.variants[0]?.stock)\" class=\"btn btn-outline-secondary\"\r\n type=\"button\" id=\"button-addon1\">\r\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-2\">\r\n <a (click)=\"deleteCartItem()\" class=\"btn botBorrar\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></a>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n}", styles: [""], dependencies: [{ kind: "pipe", type: TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: EcCurrencySymbolPipe, name: "ecCurrencySymbol" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
9220
9033
  }
@@ -10691,9 +10504,11 @@ class RelatedProductsEcComponent extends BlockEcComponent {
10691
10504
  this._relatedProductsSubject.next(relatedProducts);
10692
10505
  res.map((products) => this._analyticsService.callEvent('view_item_list', { products: products.items, item_list_name: products.title || 'Related Products', item_list_id: products.id || 'related-products' }));
10693
10506
  // Inicializar swiper después de que los datos estén disponibles
10694
- setTimeout(() => {
10695
- this.initSwiper();
10696
- }, 100);
10507
+ if (isPlatformBrowser(this.platformId)) {
10508
+ setTimeout(() => {
10509
+ this.initSwiper();
10510
+ }, 100);
10511
+ }
10697
10512
  });
10698
10513
  }
10699
10514
  initSwiper() {
@@ -11945,5 +11760,5 @@ const directives = [
11945
11760
  * Generated bundle index. Do not edit.
11946
11761
  */
11947
11762
 
11948
- export { AccountEcComponent, AddressingService, AnalyticsService, AuthEcComponent, AuthService, AuthStorageService, BlockBannerBoxEcComponent, BlockBannerFullEcComponent, BlockFormContactEcComponent, BlockHtmlEcComponent, BlockNewsletterEcComponent, BlockProductsEcComponent, BlocksEcComponent, BlocksRepositoryService, BlocksService, BreadcrumbEcComponent, CartEcComponent, CartItemEcComponent, CartService, ChannelService, CheckoutEcComponent, CheckoutService, CollectionEcComponent, ConfirmAccountEcComponent, ContactEcComponent, CoreConstantsService, CouponEcComponent, CurrencyService, DopplerService, ENVIRONMENT_TOKEN, EcCurrencySymbolPipe, EcSafeHtmlPipe, FacebookPixelService, FaqsEcComponent, FiltersEcComponent, FiltersService, FiltersSortEcComponent, FooterEcComponent, ForgotPasswordEcComponent, FormService, GTMService, GoogleAnalyticsService, HeaderEcComponent, HomeEcComponent, LoadingFullEcComponent, LoadingInlineEcComponent, LoadingSectionEcComponent, LocalStorageService, LoginFormEcComponent, MagnizoomEcComponent, MetricoolPixelService, NgxLocalStorageService, OptionsService, OrderEcComponent, OrderUtilityService, OrdersListEcComponent, OrdersService, PaginationService, ParametersService, ParamsContext, PasswordResetEcComponent, PaymentService, PriceEcComponent, PriceRangeFilterComponent, ProductDetailEcComponent, ProductDetailService, ProductEcComponent, ProductOffDirective, ProductStockDirective, ProductsService, ReCaptchaEcComponent, ReCaptchaService, RedsysCatchEcComponent, RegisterFormEcComponent, RegisterWholesalerFormEcComponent, RelatedProductsEcComponent, ReviewsEcComponent, ReviewsFormEcComponent, SectionContainerEcComponent, ShareEcComponent, ShipmentService, SidebarEcComponent, StoresEcComponent, SuccessEcComponent, TestService, ToastService, VariantsEcComponent, authGuard, authInterceptor, directives, provideEnvironment };
11763
+ export { AccountEcComponent, AddressingService, AnalyticsService, AuthEcComponent, AuthService, AuthStorageService, BlockBannerBoxEcComponent, BlockBannerFullEcComponent, BlockFormContactEcComponent, BlockHtmlEcComponent, BlockNewsletterEcComponent, BlockProductsEcComponent, BlocksEcComponent, BlocksRepositoryService, BlocksService, BreadcrumbEcComponent, CartEcComponent, CartItemEcComponent, CartService, ChannelService, CheckoutEcComponent, CheckoutService, CollectionEcComponent, ConfirmAccountEcComponent, ContactEcComponent, CoreConstantsService, CouponEcComponent, CurrencyService, DopplerService, ENVIRONMENT_TOKEN, EcCurrencySymbolPipe, EcSafeHtmlPipe, FacebookPixelService, FaqsEcComponent, FiltersEcComponent, FiltersService, FiltersSortEcComponent, FooterEcComponent, ForgotPasswordEcComponent, FormService, GTMService, GoogleAnalyticsService, HeaderEcComponent, HomeEcComponent, LoadingFullEcComponent, LoadingInlineEcComponent, LoadingSectionEcComponent, LocalStorageService, LoginFormEcComponent, MagnizoomEcComponent, MetricoolPixelService, NgxLocalStorageService, OptionsService, OrderEcComponent, OrderUtilityService, OrdersListEcComponent, OrdersService, PaginationService, ParametersService, ParamsContext, PasswordResetEcComponent, PaymentService, PriceEcComponent, PriceRangeFilterComponent, ProductDetailEcComponent, ProductDetailService, ProductEcComponent, ProductOffDirective, ProductStockDirective, ProductsService, ReCaptchaEcComponent, ReCaptchaService, RegisterFormEcComponent, RegisterWholesalerFormEcComponent, RelatedProductsEcComponent, ReviewsEcComponent, ReviewsFormEcComponent, SectionContainerEcComponent, ShareEcComponent, ShipmentService, SidebarEcComponent, StoresEcComponent, SuccessEcComponent, TestService, ToastService, VariantsEcComponent, authGuard, authInterceptor, directives, provideEnvironment };
11949
11764
  //# sourceMappingURL=ng-easycommerce-v18.mjs.map