ng-easycommerce-v18 0.3.13 → 0.3.14-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.
Files changed (28) hide show
  1. package/README.md +2 -7
  2. package/esm2022/lib/classes/filters/filter.mjs +27 -2
  3. package/esm2022/lib/constants/api.constants.service.mjs +28 -42
  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 +152 -348
  17. package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
  18. package/lib/constants/api.constants.service.d.ts +8 -23
  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,71 @@ 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)
98
82
  if (typeof window !== 'undefined') {
99
- // Primero intenta leer de window.__env (configurado por Docker)
100
83
  const windowEnv = window.__env;
101
- if (windowEnv?.apiUrl) {
84
+ if (windowEnv?.apiUrl)
102
85
  return windowEnv.apiUrl;
103
- }
104
86
  }
105
- // Fallback al environment (para SSR y como backup)
87
+ if (isPlatformServer(this.platformId)) {
88
+ return this.ssrApiUrl; // ⚡ URL inyectada desde server.ts
89
+ }
106
90
  return this.environment.apiUrl ?? '';
107
91
  }
108
92
  /**
109
93
  * Retorna la url base
110
- * @returns {string}
111
94
  */
112
95
  getUrlBase() {
113
96
  return this.API_URL;
114
97
  }
115
98
  /**
116
99
  * Cambia el canal actual
117
- * @param code
118
- * @returns
119
100
  */
120
- setChannel(code) { this.CHANNEL = code; }
101
+ setChannel(code) {
102
+ this.CHANNEL = code;
103
+ }
121
104
  setLocale(locale) {
122
105
  this._localStorage.setItem(this.LOCALE_KEY, locale);
123
106
  this._translate.use(locale.split('_')[0]);
124
107
  this.LOCALE = locale;
125
108
  }
126
- //Storage key
127
109
  LOCALE_KEY = 'LOCALE';
128
110
  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 });
111
+ 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
112
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiConstantsService, providedIn: 'root' });
131
113
  }
132
114
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiConstantsService, decorators: [{
@@ -134,7 +116,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
134
116
  args: [{
135
117
  providedIn: 'root'
136
118
  }]
137
- }], ctorParameters: () => [] });
119
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
120
+ type: Inject,
121
+ args: ['API_URL']
122
+ }] }] });
138
123
 
139
124
  /**
140
125
  * Servicio que funciona como abstracción para manejar la conexión con la API
@@ -533,6 +518,10 @@ class OptionsService {
533
518
  * Maneja las peticiones a la API
534
519
  */
535
520
  connection = inject(ConnectionService);
521
+ /**
522
+ * Platform ID para verificar si estamos en el navegador
523
+ */
524
+ platformId = inject(PLATFORM_ID);
536
525
  /**
537
526
  * Constantes del core
538
527
  */
@@ -643,7 +632,26 @@ class OptionsService {
643
632
  * @returns
644
633
  */
645
634
  removeAccents(str) {
646
- return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
635
+ if (isPlatformBrowser(this.platformId) && typeof String.prototype.normalize === 'function') {
636
+ return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
637
+ }
638
+ // Fallback para SSR - remover acentos manualmente
639
+ return str.replace(/[àáâãäå]/g, 'a')
640
+ .replace(/[èéêë]/g, 'e')
641
+ .replace(/[ìíîï]/g, 'i')
642
+ .replace(/[òóôõö]/g, 'o')
643
+ .replace(/[ùúûü]/g, 'u')
644
+ .replace(/[ýÿ]/g, 'y')
645
+ .replace(/[ñ]/g, 'n')
646
+ .replace(/[ç]/g, 'c')
647
+ .replace(/[ÀÁÂÃÄÅ]/g, 'A')
648
+ .replace(/[ÈÉÊË]/g, 'E')
649
+ .replace(/[ÌÍÎÏ]/g, 'I')
650
+ .replace(/[ÒÓÔÕÖ]/g, 'O')
651
+ .replace(/[ÙÚÛÜ]/g, 'U')
652
+ .replace(/[ÝŸ]/g, 'Y')
653
+ .replace(/[Ñ]/g, 'N')
654
+ .replace(/[Ç]/g, 'C');
647
655
  }
648
656
  /**
649
657
  * Realiza un mapeo de los datos para darle un formato mas entendible a la
@@ -1026,7 +1034,9 @@ class FacebookPixelService {
1026
1034
  this.renderer.appendChild(this.document?.body, new_analityc_script);
1027
1035
  this.enabled = true;
1028
1036
  }
1029
- setTimeout(() => this.callEvent('initialize'), 1000);
1037
+ if (isPlatformBrowser(this.platformId)) {
1038
+ setTimeout(() => this.callEvent('initialize'), 1000);
1039
+ }
1030
1040
  }
1031
1041
  /**
1032
1042
  * Ejecuta el evento pasado por parametro.
@@ -1243,7 +1253,9 @@ class GoogleAnalyticsService {
1243
1253
  this.renderer.appendChild(this.document?.head, declaration);
1244
1254
  this.enabled = true;
1245
1255
  }
1246
- setTimeout(() => this.startListeningPageViews(gtm_id), 1000);
1256
+ if (isPlatformBrowser(this.platformId)) {
1257
+ setTimeout(() => this.startListeningPageViews(gtm_id), 1000);
1258
+ }
1247
1259
  }
1248
1260
  /**
1249
1261
  *
@@ -2644,6 +2656,31 @@ class User {
2644
2656
  }
2645
2657
  }
2646
2658
 
2659
+ /**
2660
+ * Función auxiliar para remover acentos de forma segura para SSR
2661
+ */
2662
+ function safeRemoveAccents(str) {
2663
+ if (typeof window !== 'undefined' && typeof String.prototype.normalize === 'function') {
2664
+ return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
2665
+ }
2666
+ // Fallback para SSR - remover acentos manualmente
2667
+ return str.replace(/[àáâãäå]/g, 'a')
2668
+ .replace(/[èéêë]/g, 'e')
2669
+ .replace(/[ìíîï]/g, 'i')
2670
+ .replace(/[òóôõö]/g, 'o')
2671
+ .replace(/[ùúûü]/g, 'u')
2672
+ .replace(/[ýÿ]/g, 'y')
2673
+ .replace(/[ñ]/g, 'n')
2674
+ .replace(/[ç]/g, 'c')
2675
+ .replace(/[ÀÁÂÃÄÅ]/g, 'A')
2676
+ .replace(/[ÈÉÊË]/g, 'E')
2677
+ .replace(/[ÌÍÎÏ]/g, 'I')
2678
+ .replace(/[ÒÓÔÕÖ]/g, 'O')
2679
+ .replace(/[ÙÚÛÜ]/g, 'U')
2680
+ .replace(/[ÝŸ]/g, 'Y')
2681
+ .replace(/[Ñ]/g, 'N')
2682
+ .replace(/[Ç]/g, 'C');
2683
+ }
2647
2684
  class Filter {
2648
2685
  data = [];
2649
2686
  multi = false;
@@ -2663,7 +2700,7 @@ class Filter {
2663
2700
  throw new Error("Method not implemented.");
2664
2701
  }
2665
2702
  removeAccents = (str) => {
2666
- return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
2703
+ return safeRemoveAccents(str);
2667
2704
  };
2668
2705
  setSelected(element, value) {
2669
2706
  //console.log(element, value);
@@ -6154,11 +6191,6 @@ class HeaderEcComponent extends MenuEcComponent {
6154
6191
  hidePrices = false;
6155
6192
  __authService = inject(AuthService);
6156
6193
  _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
6194
  isAuthenticated$ = this.__authService.isAuthenticated();
6163
6195
  constructor() {
6164
6196
  super();
@@ -6172,26 +6204,11 @@ class HeaderEcComponent extends MenuEcComponent {
6172
6204
  coreConstantsService = inject(CoreConstantsService);
6173
6205
  router = inject(Router);
6174
6206
  cdr = inject(ChangeDetectorRef); // Inyectamos ChangeDetectorRef para forzar la actualización
6207
+ platformId = inject(PLATFORM_ID);
6175
6208
  ngOnInit() {
6176
6209
  this.channel = this.coreConstantsService.getChannel();
6177
6210
  this.onWindowScroll();
6178
6211
  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
6212
  }
6196
6213
  ngAfterViewInit() {
6197
6214
  this.setupMobileMenu(); // Inicializamos el menú móvil
@@ -6210,17 +6227,21 @@ class HeaderEcComponent extends MenuEcComponent {
6210
6227
  });
6211
6228
  }
6212
6229
  onWindowScroll() {
6213
- const scrollTop = window.scrollY;
6214
- this.isScrolled = scrollTop > 80;
6230
+ if (isPlatformBrowser(this.platformId)) {
6231
+ const scrollTop = window.scrollY;
6232
+ this.isScrolled = scrollTop > 80;
6233
+ }
6215
6234
  }
6216
6235
  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');
6236
+ if (isPlatformBrowser(this.platformId)) {
6237
+ const headerElement = document.querySelector('header');
6238
+ if (headerElement) {
6239
+ if (this.router.url !== '/home') {
6240
+ headerElement.classList.add('show-menu');
6241
+ }
6242
+ else {
6243
+ headerElement.classList.remove('show-menu');
6244
+ }
6224
6245
  }
6225
6246
  }
6226
6247
  }
@@ -6244,26 +6265,30 @@ class HeaderEcComponent extends MenuEcComponent {
6244
6265
  }
6245
6266
  };
6246
6267
  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);
6268
+ if (isPlatformBrowser(this.platformId)) {
6269
+ if (inputId) {
6270
+ const input = document.getElementById(inputId);
6257
6271
  if (input) {
6258
6272
  input.value = '';
6259
6273
  }
6260
- });
6274
+ }
6275
+ else {
6276
+ const inputs = ['searchInput1'];
6277
+ inputs.forEach((id) => {
6278
+ const input = document.getElementById(id);
6279
+ if (input) {
6280
+ input.value = '';
6281
+ }
6282
+ });
6283
+ }
6261
6284
  }
6262
6285
  this.searchValue = '';
6263
6286
  this.coreConstantsService.searchValue = '';
6264
6287
  this.getCollectionSearch();
6265
6288
  }
6266
6289
  setupMobileMenu() {
6290
+ if (!isPlatformBrowser(this.platformId))
6291
+ return;
6267
6292
  // console.log('setupMobileMenu called');
6268
6293
  const menuMobile = document.querySelector('.menuMobile');
6269
6294
  if (!(menuMobile instanceof HTMLElement))
@@ -6299,6 +6324,8 @@ class HeaderEcComponent extends MenuEcComponent {
6299
6324
  });
6300
6325
  }
6301
6326
  setupSearchInputs() {
6327
+ if (!isPlatformBrowser(this.platformId))
6328
+ return;
6302
6329
  const inputs = ['searchInput1', 'searchInput2'];
6303
6330
  inputs.forEach(id => {
6304
6331
  const input = document.getElementById(id);
@@ -6895,10 +6922,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
6895
6922
  class ProductEcComponent {
6896
6923
  injector = inject(Injector);
6897
6924
  routerService = inject(Router);
6898
- _cartService = inject(CartService);
6899
- _toastService = inject(ToastService);
6900
- isAddingToCart = signal(false);
6901
- quantity = signal(1);
6902
6925
  /**
6903
6926
  * Navega al detalle del producto y sube al inicio de la página
6904
6927
  * @param productId ID del producto
@@ -6971,97 +6994,12 @@ class ProductEcComponent {
6971
6994
  const discount = ((originalPrice - salePrice) / originalPrice) * 100;
6972
6995
  return Math.round(discount);
6973
6996
  }
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
6997
  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 }] });
6998
+ 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
6999
  }
7062
7000
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProductEcComponent, decorators: [{
7063
7001
  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>" }]
7002
+ 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
7003
  }], ctorParameters: () => [], propDecorators: { product: [{
7066
7004
  type: Input,
7067
7005
  args: [{
@@ -7134,7 +7072,7 @@ class BlockProductsEcComponent extends BlockEcComponent {
7134
7072
  * Permite personalización de las imágenes de las flechas mediante @Input.
7135
7073
  */
7136
7074
  setupSwiperNavigation() {
7137
- if (this.meta?.styles?.carrousel !== false) {
7075
+ if (this.meta?.styles?.carrousel !== false && isPlatformBrowser(this.platformId)) {
7138
7076
  // Usar setTimeout para asegurar que el swiper esté inicializado
7139
7077
  setTimeout(() => {
7140
7078
  this.initializeSwiperWithCustomNavigation();
@@ -7146,6 +7084,8 @@ class BlockProductsEcComponent extends BlockEcComponent {
7146
7084
  * Esta función puede ser movida al componente base para reutilización.
7147
7085
  */
7148
7086
  initializeSwiperWithCustomNavigation() {
7087
+ if (!isPlatformBrowser(this.platformId))
7088
+ return;
7149
7089
  const prevButton = document.getElementById(`${this.meta?.code}-prev`);
7150
7090
  const nextButton = document.getElementById(`${this.meta?.code}-next`);
7151
7091
  const swiperElement = document.getElementById(this.meta?.code);
@@ -7505,7 +7445,9 @@ class MagnizoomEcComponent {
7505
7445
  this.image = this.document.createElement('img');
7506
7446
  this.image.onload = () => {
7507
7447
  this.lensSize = { width: this.image.width / 2, height: this.image.height / 2 };
7508
- setTimeout(() => this.render());
7448
+ if (isPlatformBrowser(this.platformId)) {
7449
+ setTimeout(() => this.render());
7450
+ }
7509
7451
  };
7510
7452
  this.image.src = src;
7511
7453
  }
@@ -7635,157 +7577,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7635
7577
  args: ['mainCanvas', { static: true }]
7636
7578
  }] } });
7637
7579
 
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
7580
  // export * from './rating-ec/rating-ec.component';
7790
7581
 
7791
7582
  class BlockFormContactEcComponent extends BlockEcComponent {
@@ -8061,7 +7852,6 @@ class LoginFormEcComponent {
8061
7852
  _formBuilder = inject(FormBuilder);
8062
7853
  _toastService = inject(ToastService);
8063
7854
  _router = inject(Router);
8064
- showPassword = false;
8065
7855
  /**
8066
7856
  * Parametro para indicar si tras loguear
8067
7857
  * debe redireccionar o no.
@@ -8150,9 +7940,6 @@ class LoginFormEcComponent {
8150
7940
  ? resolverFunction()
8151
7941
  : this._router.navigateByUrl(this.redirectTo);
8152
7942
  }
8153
- togglePassword() {
8154
- this.showPassword = !this.showPassword;
8155
- }
8156
7943
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoginFormEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8157
7944
  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
7945
  }
@@ -8252,7 +8039,6 @@ class RegisterFormEcComponent {
8252
8039
  _analyticsService = inject(AnalyticsService);
8253
8040
  _formBuilder = inject(FormBuilder);
8254
8041
  channelConfigService = inject(ChannelService);
8255
- showPassword = false;
8256
8042
  /**
8257
8043
  * Indica si debe redireccionar o se queda en la misma pantalla
8258
8044
  */
@@ -8368,9 +8154,6 @@ class RegisterFormEcComponent {
8368
8154
  this.register_loading = false;
8369
8155
  }
8370
8156
  }
8371
- togglePassword() {
8372
- this.showPassword = !this.showPassword;
8373
- }
8374
8157
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RegisterFormEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
8375
8158
  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
8159
  }
@@ -8525,6 +8308,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
8525
8308
  type: Output
8526
8309
  }] } });
8527
8310
 
8311
+ class ComponentHelper {
8312
+ constructor() {
8313
+ this.ecOnConstruct();
8314
+ }
8315
+ ecOnInit = (params = {}) => {
8316
+ };
8317
+ ecOnConstruct = (params = {}) => {
8318
+ };
8319
+ hasParams = (params, searched) => {
8320
+ if (!params || !searched)
8321
+ return false;
8322
+ const q = searched.trim().toLowerCase();
8323
+ return params.some(p => {
8324
+ const code = p?.['code']?.toString().toLowerCase() ?? '';
8325
+ // Primero chequeo exacto, y si no, parcial
8326
+ return code === q || code.includes(q);
8327
+ });
8328
+ };
8329
+ navigateOnRouter(router, url) {
8330
+ router.navigateByUrl(`/${url}`);
8331
+ }
8332
+ }
8333
+
8528
8334
  class PasswordResetEcComponent extends ComponentHelper {
8529
8335
  authService;
8530
8336
  toastr;
@@ -9125,7 +8931,6 @@ class CartItemEcComponent {
9125
8931
  _cartService = inject(CartService);
9126
8932
  _toastService = inject(ToastService);
9127
8933
  _constants = inject(CoreConstantsService);
9128
- parametersService = inject(ParametersService);
9129
8934
  mediaUrl = this._constants.mediaUrl();
9130
8935
  quantity = 0;
9131
8936
  variantsToShow = ['TALLA', 'COLOR'];
@@ -9212,9 +9017,6 @@ class CartItemEcComponent {
9212
9017
  }
9213
9018
  return false; // Solo se ejecuta si no se cumple la condición
9214
9019
  }
9215
- // PARAMETROS
9216
- parameters$ = this.parametersService.getParameters();
9217
- hasParams = this.parametersService.hasParams;
9218
9020
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CartItemEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9219
9021
  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
9022
  }
@@ -10691,9 +10493,11 @@ class RelatedProductsEcComponent extends BlockEcComponent {
10691
10493
  this._relatedProductsSubject.next(relatedProducts);
10692
10494
  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
10495
  // Inicializar swiper después de que los datos estén disponibles
10694
- setTimeout(() => {
10695
- this.initSwiper();
10696
- }, 100);
10496
+ if (isPlatformBrowser(this.platformId)) {
10497
+ setTimeout(() => {
10498
+ this.initSwiper();
10499
+ }, 100);
10500
+ }
10697
10501
  });
10698
10502
  }
10699
10503
  initSwiper() {
@@ -11945,5 +11749,5 @@ const directives = [
11945
11749
  * Generated bundle index. Do not edit.
11946
11750
  */
11947
11751
 
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 };
11752
+ 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
11753
  //# sourceMappingURL=ng-easycommerce-v18.mjs.map