@esolve/ng-esolve-connect 0.46.2 → 0.47.0

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 (113) hide show
  1. package/esm2022/index.mjs +3 -1
  2. package/esm2022/lib/account/esolve-account.service.mjs +12 -17
  3. package/esm2022/lib/auth/esolve-auth-interceptor.service.mjs +9 -11
  4. package/esm2022/lib/auth/esolve-auth.service.mjs +11 -15
  5. package/esm2022/lib/banners/esolve-banner.service.mjs +9 -11
  6. package/esm2022/lib/cart/classes/esolve-cart-totals.model.mjs +11 -3
  7. package/esm2022/lib/cart/esolve-cart.service.mjs +28 -22
  8. package/esm2022/lib/cart/interfaces/esolve-cart-totals-record.interface.mjs +1 -1
  9. package/esm2022/lib/cart/interfaces/esolve-checkout-body.interface.mjs +2 -0
  10. package/esm2022/lib/cart/interfaces/index.mjs +2 -1
  11. package/esm2022/lib/category-tree/esolve-category-tree.service.mjs +9 -11
  12. package/esm2022/lib/core/esolve-config.service.mjs +12 -10
  13. package/esm2022/lib/core/esolve-connect-config.interface.mjs +1 -1
  14. package/esm2022/lib/coupons/esolve-coupons.service.mjs +21 -28
  15. package/esm2022/lib/enquiry/esolve-enquiry.service.mjs +11 -15
  16. package/esm2022/lib/images/directives/cdn-src.directive.mjs +9 -10
  17. package/esm2022/lib/locations/esolve-locations.service.mjs +9 -11
  18. package/esm2022/lib/manufacturers/esolve-manufacturers.service.mjs +9 -11
  19. package/esm2022/lib/menu/esolve-menu.service.mjs +9 -11
  20. package/esm2022/lib/news/esolve-news.service.mjs +9 -11
  21. package/esm2022/lib/ng-esolve-connect.module.mjs +4 -4
  22. package/esm2022/lib/payment/esolve-payment.service.mjs +11 -15
  23. package/esm2022/lib/ranges/esolve-ranges.service.mjs +9 -11
  24. package/esm2022/lib/session/esolve-session-metadata.service.mjs +11 -15
  25. package/esm2022/lib/session/esolve-session.service.mjs +16 -19
  26. package/esm2022/lib/shared/assets/esolve-assets.service.mjs +9 -11
  27. package/esm2022/lib/shared/cookie/esolve-cookie.service.mjs +3 -3
  28. package/esm2022/lib/shared/errors/esolve-error-handler.service.mjs +3 -3
  29. package/esm2022/lib/shared/geocoder/esolve-geocoder.service.mjs +9 -11
  30. package/esm2022/lib/shared/response/esolve-response-handler.service.mjs +3 -3
  31. package/esm2022/lib/shared/seo/esolve-seo.service.mjs +9 -11
  32. package/esm2022/lib/shipping/esolve-shipping.service.mjs +9 -11
  33. package/esm2022/lib/specials/esolve-specials.service.mjs +9 -11
  34. package/esm2022/lib/stock/esolve-stock.service.mjs +9 -11
  35. package/esm2022/lib/suppliers/esolve-suppliers.service.mjs +9 -11
  36. package/esm2022/lib/tags/esolve-tags.service.mjs +9 -11
  37. package/esm2022/lib/topics/esolve-topic.service.mjs +9 -11
  38. package/esm2022/lib/transactions/esolve-transactions.service.mjs +11 -15
  39. package/esm2022/lib/vouchers/classes/esolve-voucher.model.mjs +18 -0
  40. package/esm2022/lib/vouchers/classes/index.mjs +2 -0
  41. package/esm2022/lib/vouchers/esolve-vouchers.service.mjs +221 -0
  42. package/esm2022/lib/vouchers/index.mjs +9 -0
  43. package/esm2022/lib/vouchers/interfaces/esolve-voucher-record.interface.mjs +2 -0
  44. package/esm2022/lib/vouchers/interfaces/esolve-voucher-validation-error.interface.mjs +2 -0
  45. package/esm2022/lib/vouchers/interfaces/esolve-voucher-validation-result.interface.mjs +2 -0
  46. package/esm2022/lib/vouchers/interfaces/esolve-voucher-validation.interface.mjs +2 -0
  47. package/esm2022/lib/vouchers/interfaces/index.mjs +5 -0
  48. package/esm2022/lib/vouchers/types/esolve-vouchers-cache.type.mjs +2 -0
  49. package/esm2022/lib/vouchers/types/index.mjs +2 -0
  50. package/esm2022/lib/wishlist/esolve-wishlist.service.mjs +11 -15
  51. package/esm2022/media/lib/components/media-layout/esolve-media-layout.component.mjs +3 -3
  52. package/esm2022/media/lib/components/media-section/esolve-media-section.component.mjs +3 -3
  53. package/esm2022/media/lib/ng-esolve-connect-media.module.mjs +4 -4
  54. package/esm2022/media/lib/services/esolve-media-layout.service.mjs +3 -3
  55. package/esm2022/media/lib/services/esolve-media.service.mjs +3 -3
  56. package/esm2022/notifications/lib/services/esolve-notifications.service.mjs +10 -14
  57. package/esm2022/survey/lib/services/esolve-survey.service.mjs +12 -17
  58. package/fesm2022/esolve-ng-esolve-connect-media.mjs +16 -16
  59. package/fesm2022/esolve-ng-esolve-connect-notifications.mjs +10 -14
  60. package/fesm2022/esolve-ng-esolve-connect-notifications.mjs.map +1 -1
  61. package/fesm2022/esolve-ng-esolve-connect-survey.mjs +12 -17
  62. package/fesm2022/esolve-ng-esolve-connect-survey.mjs.map +1 -1
  63. package/fesm2022/esolve-ng-esolve-connect.mjs +518 -272
  64. package/fesm2022/esolve-ng-esolve-connect.mjs.map +1 -1
  65. package/index.d.ts +1 -0
  66. package/lib/account/esolve-account.service.d.ts +6 -11
  67. package/lib/auth/esolve-auth-interceptor.service.d.ts +2 -5
  68. package/lib/auth/esolve-auth.service.d.ts +5 -9
  69. package/lib/banners/esolve-banner.service.d.ts +2 -5
  70. package/lib/cart/classes/esolve-cart-totals.model.d.ts +9 -1
  71. package/lib/cart/esolve-cart.service.d.ts +7 -12
  72. package/lib/cart/interfaces/esolve-cart-totals-record.interface.d.ts +2 -0
  73. package/lib/cart/interfaces/esolve-checkout-body.interface.d.ts +13 -0
  74. package/lib/cart/interfaces/index.d.ts +1 -0
  75. package/lib/category-tree/esolve-category-tree.service.d.ts +2 -5
  76. package/lib/core/esolve-config.service.d.ts +2 -1
  77. package/lib/core/esolve-connect-config.interface.d.ts +4 -0
  78. package/lib/coupons/esolve-coupons.service.d.ts +6 -10
  79. package/lib/enquiry/esolve-enquiry.service.d.ts +4 -9
  80. package/lib/images/directives/cdn-src.directive.d.ts +4 -5
  81. package/lib/locations/esolve-locations.service.d.ts +2 -5
  82. package/lib/manufacturers/esolve-manufacturers.service.d.ts +2 -5
  83. package/lib/menu/esolve-menu.service.d.ts +2 -5
  84. package/lib/news/esolve-news.service.d.ts +2 -5
  85. package/lib/payment/esolve-payment.service.d.ts +4 -9
  86. package/lib/ranges/esolve-ranges.service.d.ts +2 -5
  87. package/lib/session/esolve-session-metadata.service.d.ts +5 -9
  88. package/lib/session/esolve-session.service.d.ts +4 -7
  89. package/lib/shared/assets/esolve-assets.service.d.ts +2 -5
  90. package/lib/shared/geocoder/esolve-geocoder.service.d.ts +2 -5
  91. package/lib/shared/seo/esolve-seo.service.d.ts +5 -7
  92. package/lib/shipping/esolve-shipping.service.d.ts +2 -5
  93. package/lib/specials/esolve-specials.service.d.ts +2 -5
  94. package/lib/stock/esolve-stock.service.d.ts +2 -5
  95. package/lib/suppliers/esolve-suppliers.service.d.ts +2 -5
  96. package/lib/tags/esolve-tags.service.d.ts +2 -5
  97. package/lib/topics/esolve-topic.service.d.ts +2 -5
  98. package/lib/transactions/esolve-transactions.service.d.ts +5 -9
  99. package/lib/vouchers/classes/esolve-voucher.model.d.ts +11 -0
  100. package/lib/vouchers/classes/index.d.ts +1 -0
  101. package/lib/vouchers/esolve-vouchers.service.d.ts +36 -0
  102. package/lib/vouchers/index.d.ts +4 -0
  103. package/lib/vouchers/interfaces/esolve-voucher-record.interface.d.ts +6 -0
  104. package/lib/vouchers/interfaces/esolve-voucher-validation-error.interface.d.ts +4 -0
  105. package/lib/vouchers/interfaces/esolve-voucher-validation-result.interface.d.ts +4 -0
  106. package/lib/vouchers/interfaces/esolve-voucher-validation.interface.d.ts +6 -0
  107. package/lib/vouchers/interfaces/index.d.ts +4 -0
  108. package/lib/vouchers/types/esolve-vouchers-cache.type.d.ts +1 -0
  109. package/lib/vouchers/types/index.d.ts +1 -0
  110. package/lib/wishlist/esolve-wishlist.service.d.ts +4 -9
  111. package/notifications/lib/services/esolve-notifications.service.d.ts +2 -5
  112. package/package.json +1 -1
  113. package/survey/lib/services/esolve-survey.service.d.ts +4 -7
@@ -1,26 +1,27 @@
1
1
  import { isPlatformBrowser, CommonModule, IMAGE_LOADER, DOCUMENT } from '@angular/common';
2
- import * as i2 from '@angular/common/http';
3
- import { HttpErrorResponse, HttpParams, HttpHeaders, HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi, HttpClientModule } from '@angular/common/http';
2
+ import { HttpErrorResponse, HttpClient, HttpParams, HttpHeaders, HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi, HttpClientModule } from '@angular/common/http';
4
3
  import * as i0 from '@angular/core';
5
- import { InjectionToken, Injectable, Inject, PLATFORM_ID, APP_INITIALIZER, NgModule, Directive, Input, HostListener, inject } from '@angular/core';
4
+ import { InjectionToken, inject, Injectable, PLATFORM_ID, APP_INITIALIZER, NgModule, ElementRef, Directive, Input, HostListener } from '@angular/core';
6
5
  import * as i1 from 'ngx-cookie-service-ssr';
7
6
  import { SsrCookieService } from 'ngx-cookie-service-ssr';
8
- import { throwError, BehaviorSubject, Subject, map, switchMap, timer, takeUntil, combineLatest, shareReplay, filter, distinctUntilChanged, of, firstValueFrom, iif } from 'rxjs';
7
+ import { throwError, BehaviorSubject, Subject, map, switchMap, timer, takeUntil, combineLatest, debounceTime, shareReplay, filter, distinctUntilChanged, of, firstValueFrom, iif } from 'rxjs';
9
8
  import { map as map$1, catchError, switchMap as switchMap$1, tap } from 'rxjs/operators';
10
9
  import { fromUnixTime } from 'date-fns';
11
- import * as i2$1 from '@angular/platform-browser';
10
+ import { Title, Meta } from '@angular/platform-browser';
12
11
 
13
12
  const ESOLVE_CONNECT_CONFIG = new InjectionToken('esolve.connect.config');
14
13
 
15
14
  class EsolveConfigService {
16
- constructor(config) {
15
+ constructor() {
17
16
  this.api_url = '';
18
17
  this.site_url = '';
19
18
  this.wsid = '';
20
19
  this.title_separator = '|';
21
20
  this.session_storage_key = '_ng_eslv_token';
22
21
  this.coupon_storage_key = '_ng_eslv_coupons';
22
+ this.voucher_storage_key = '_ng_eslv_vouchers';
23
23
  this.device_designation = 'web';
24
+ const config = inject(ESOLVE_CONNECT_CONFIG);
24
25
  if (config.api_url === '' || config.wsid === '') {
25
26
  throw new Error('Invalid eSolve Eurus config');
26
27
  }
@@ -42,6 +43,9 @@ class EsolveConfigService {
42
43
  if (config.coupon_storage_key) {
43
44
  this.coupon_storage_key = config.coupon_storage_key;
44
45
  }
46
+ if (config.voucher_storage_key) {
47
+ this.voucher_storage_key = config.voucher_storage_key;
48
+ }
45
49
  if (this.native && config.device_designation) {
46
50
  this.device_designation = config.device_designation;
47
51
  }
@@ -52,18 +56,15 @@ class EsolveConfigService {
52
56
  }
53
57
  this.error_image_path = config.error_image_path;
54
58
  }
55
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveConfigService, deps: [{ token: ESOLVE_CONNECT_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
56
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveConfigService, providedIn: 'root' }); }
59
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
60
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveConfigService, providedIn: 'root' }); }
57
61
  }
58
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveConfigService, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveConfigService, decorators: [{
59
63
  type: Injectable,
60
64
  args: [{
61
65
  providedIn: 'root',
62
66
  }]
63
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
64
- type: Inject,
65
- args: [ESOLVE_CONNECT_CONFIG]
66
- }] }]; } });
67
+ }], ctorParameters: function () { return []; } });
67
68
 
68
69
  class EsolveHttpError extends Error {
69
70
  constructor(type, code, message) {
@@ -159,10 +160,10 @@ class EsolveErrorHandlerService {
159
160
  parseDeleteError(result) {
160
161
  return new EsolveHttpError('error', result.code, result.message);
161
162
  }
162
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
163
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveErrorHandlerService, providedIn: 'root' }); }
163
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
164
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveErrorHandlerService, providedIn: 'root' }); }
164
165
  }
165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveErrorHandlerService, decorators: [{
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveErrorHandlerService, decorators: [{
166
167
  type: Injectable,
167
168
  args: [{
168
169
  providedIn: 'root',
@@ -185,10 +186,10 @@ class EsolveCookieService {
185
186
  delete(name, path, domain, secure) {
186
187
  this.cookieService.delete(name, path, domain, secure);
187
188
  }
188
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCookieService, deps: [{ token: i1.SsrCookieService }], target: i0.ɵɵFactoryTarget.Injectable }); }
189
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCookieService, providedIn: 'root' }); }
189
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCookieService, deps: [{ token: i1.SsrCookieService }], target: i0.ɵɵFactoryTarget.Injectable }); }
190
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCookieService, providedIn: 'root' }); }
190
191
  }
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCookieService, decorators: [{
192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCookieService, decorators: [{
192
193
  type: Injectable,
193
194
  args: [{
194
195
  providedIn: 'root',
@@ -222,10 +223,10 @@ function esolveHexHash(...values) {
222
223
  }
223
224
 
224
225
  class EsolveSessionService {
225
- constructor(platformId, config, cookieService) {
226
- this.platformId = platformId;
227
- this.config = config;
228
- this.cookieService = cookieService;
226
+ constructor() {
227
+ this.is_browser = isPlatformBrowser(inject(PLATFORM_ID));
228
+ this.config = inject(EsolveConfigService);
229
+ this.cookieService = inject(EsolveCookieService);
229
230
  this.token$ = new BehaviorSubject('');
230
231
  this.user_id$ = new BehaviorSubject(0);
231
232
  this.location_id$ = new BehaviorSubject(0);
@@ -238,7 +239,6 @@ class EsolveSessionService {
238
239
  this.session_end = new Subject();
239
240
  this.setStorageKey();
240
241
  this._session = this.initSession();
241
- this.is_browser = isPlatformBrowser(this.platformId);
242
242
  this.getSession()
243
243
  .pipe(map(({ token, user_id, location_id }) => {
244
244
  return esolveHexHash(token, user_id, location_id);
@@ -265,7 +265,9 @@ class EsolveSessionService {
265
265
  user_id: this.onUserIdUpdate(),
266
266
  location_id: this.onLocationIdUpdate(),
267
267
  };
268
- return combineLatest(session).pipe(shareReplay(1));
268
+ return combineLatest(session).pipe(
269
+ // Delays the emit only slightly incase multiple values are set
270
+ debounceTime(10), shareReplay(1));
269
271
  }
270
272
  isValid() {
271
273
  return this.getToken() !== '';
@@ -336,9 +338,10 @@ class EsolveSessionService {
336
338
  const expiry_date = fromUnixTime(expiry_date_unix);
337
339
  const grace_expiry_date = fromUnixTime(expiry_date_unix + grace_unix);
338
340
  this.setCache(session.token, grace_expiry_date);
339
- this.updateToken(session.token);
340
341
  this.updateUserId(session.user_id);
341
342
  this.updateLocationId(session.location_id);
343
+ // Update token last to make sure session is correctly checked
344
+ this.updateToken(session.token);
342
345
  this.startTimer(expiry_date);
343
346
  }
344
347
  handleUpdateSession({ user_id, location_id, }) {
@@ -379,18 +382,15 @@ class EsolveSessionService {
379
382
  }
380
383
  localStorage.removeItem(this.storage_key);
381
384
  }
382
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSessionService, deps: [{ token: PLATFORM_ID }, { token: EsolveConfigService }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable }); }
383
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSessionService, providedIn: 'root' }); }
385
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
386
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSessionService, providedIn: 'root' }); }
384
387
  }
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSessionService, decorators: [{
388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSessionService, decorators: [{
386
389
  type: Injectable,
387
390
  args: [{
388
391
  providedIn: 'root',
389
392
  }]
390
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
391
- type: Inject,
392
- args: [PLATFORM_ID]
393
- }] }, { type: EsolveConfigService }, { type: EsolveCookieService }]; } });
393
+ }], ctorParameters: function () { return []; } });
394
394
 
395
395
  class EsolveResult {
396
396
  constructor(status, code, message) {
@@ -430,10 +430,10 @@ class EsolveResponseHandlerService {
430
430
  }
431
431
  return resultHandler(response);
432
432
  }
433
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveResponseHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
434
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveResponseHandlerService, providedIn: 'root' }); }
433
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveResponseHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
434
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveResponseHandlerService, providedIn: 'root' }); }
435
435
  }
436
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveResponseHandlerService, decorators: [{
436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveResponseHandlerService, decorators: [{
437
437
  type: Injectable,
438
438
  args: [{
439
439
  providedIn: 'root',
@@ -441,11 +441,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImpor
441
441
  }] });
442
442
 
443
443
  class EsolveSessionMetadataService {
444
- constructor(config, http, errorHandler, responseHandler) {
445
- this.config = config;
446
- this.http = http;
447
- this.errorHandler = errorHandler;
448
- this.responseHandler = responseHandler;
444
+ constructor() {
445
+ this.config = inject(EsolveConfigService);
446
+ this.http = inject(HttpClient);
447
+ this.errorHandler = inject(EsolveErrorHandlerService);
448
+ this.responseHandler = inject(EsolveResponseHandlerService);
449
449
  }
450
450
  set(type, metadata) {
451
451
  return this.http
@@ -493,22 +493,22 @@ class EsolveSessionMetadataService {
493
493
  return this.errorHandler.handleHttpDeleteError('delete-sessions-metadata', errorRes);
494
494
  }));
495
495
  }
496
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSessionMetadataService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
497
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSessionMetadataService, providedIn: 'root' }); }
496
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSessionMetadataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
497
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSessionMetadataService, providedIn: 'root' }); }
498
498
  }
499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSessionMetadataService, decorators: [{
499
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSessionMetadataService, decorators: [{
500
500
  type: Injectable,
501
501
  args: [{
502
502
  providedIn: 'root',
503
503
  }]
504
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
504
+ }] });
505
505
 
506
506
  class EsolveAuthService {
507
- constructor(config, http, session, errorHandler) {
508
- this.config = config;
509
- this.http = http;
510
- this.session = session;
511
- this.errorHandler = errorHandler;
507
+ constructor() {
508
+ this.config = inject(EsolveConfigService);
509
+ this.http = inject(HttpClient);
510
+ this.session = inject(EsolveSessionService);
511
+ this.errorHandler = inject(EsolveErrorHandlerService);
512
512
  this.session
513
513
  .onSessionEnd()
514
514
  .pipe(switchMap$1(() => this.checkAccessToken()), catchError(() => of(null)))
@@ -716,20 +716,20 @@ class EsolveAuthService {
716
716
  }
717
717
  return throwError(() => error);
718
718
  }
719
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAuthService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
720
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAuthService, providedIn: 'root' }); }
719
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
720
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAuthService, providedIn: 'root' }); }
721
721
  }
722
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAuthService, decorators: [{
722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAuthService, decorators: [{
723
723
  type: Injectable,
724
724
  args: [{
725
725
  providedIn: 'root',
726
726
  }]
727
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }]; } });
727
+ }], ctorParameters: function () { return []; } });
728
728
 
729
729
  class EsolveAuthInterceptorService {
730
- constructor(config, session) {
731
- this.config = config;
732
- this.session = session;
730
+ constructor() {
731
+ this.config = inject(EsolveConfigService);
732
+ this.session = inject(EsolveSessionService);
733
733
  }
734
734
  intercept(req, next) {
735
735
  if (req.url.startsWith(`${this.config.api_url}/`)) {
@@ -757,12 +757,12 @@ class EsolveAuthInterceptorService {
757
757
  }
758
758
  return next.handle(req);
759
759
  }
760
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAuthInterceptorService, deps: [{ token: EsolveConfigService }, { token: EsolveSessionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
761
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAuthInterceptorService }); }
760
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAuthInterceptorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
761
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAuthInterceptorService }); }
762
762
  }
763
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAuthInterceptorService, decorators: [{
763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAuthInterceptorService, decorators: [{
764
764
  type: Injectable
765
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: EsolveSessionService }]; } });
765
+ }] });
766
766
 
767
767
  const ESOLVE_EURUS_AUTO_LOGIN = {
768
768
  provide: APP_INITIALIZER,
@@ -801,11 +801,11 @@ class NgEsolveConnectModule {
801
801
  providers: provideNgEsolveConnect(config, auto_login),
802
802
  };
803
803
  }
804
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: NgEsolveConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
805
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.3", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule, HttpClientModule] }); }
806
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule, HttpClientModule] }); }
804
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: NgEsolveConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
805
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.8", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule, HttpClientModule] }); }
806
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule, HttpClientModule] }); }
807
807
  }
808
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: NgEsolveConnectModule, decorators: [{
808
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: NgEsolveConnectModule, decorators: [{
809
809
  type: NgModule,
810
810
  args: [{
811
811
  imports: [CommonModule, HttpClientModule],
@@ -879,9 +879,9 @@ function provideEsolveImageLoader() {
879
879
  * An alternative to optimised images to load a new image
880
880
  */
881
881
  class EsolveCdnSrcDirective {
882
- constructor(el, config) {
883
- this.el = el;
884
- this.config = config;
882
+ constructor() {
883
+ this.el = inject((ElementRef));
884
+ this.config = inject(EsolveConfigService);
885
885
  this.src = '';
886
886
  this.no_image = false;
887
887
  this.error_image_path = '/assets/no_image.jpg';
@@ -925,16 +925,16 @@ class EsolveCdnSrcDirective {
925
925
  isImage(el) {
926
926
  return 'loading' in this.el.nativeElement;
927
927
  }
928
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCdnSrcDirective, deps: [{ token: i0.ElementRef }, { token: EsolveConfigService }], target: i0.ɵɵFactoryTarget.Directive }); }
929
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.3", type: EsolveCdnSrcDirective, isStandalone: true, selector: "[eslvCdnSrc]", inputs: { src: ["eslvCdnSrc", "src"] }, host: { listeners: { "error": "onError()" } }, usesOnChanges: true, ngImport: i0 }); }
928
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCdnSrcDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
929
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.8", type: EsolveCdnSrcDirective, isStandalone: true, selector: "[eslvCdnSrc]", inputs: { src: ["eslvCdnSrc", "src"] }, host: { listeners: { "error": "onError()" } }, usesOnChanges: true, ngImport: i0 }); }
930
930
  }
931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCdnSrcDirective, decorators: [{
931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCdnSrcDirective, decorators: [{
932
932
  type: Directive,
933
933
  args: [{
934
934
  selector: '[eslvCdnSrc]',
935
935
  standalone: true,
936
936
  }]
937
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: EsolveConfigService }]; }, propDecorators: { src: [{
937
+ }], ctorParameters: function () { return []; }, propDecorators: { src: [{
938
938
  type: Input,
939
939
  args: ['eslvCdnSrc']
940
940
  }], onError: [{
@@ -1169,10 +1169,10 @@ class EsolveSeoInfo {
1169
1169
  }
1170
1170
 
1171
1171
  class EsolveSeoService {
1172
- constructor(config, title, meta) {
1173
- this.config = config;
1174
- this.title = title;
1175
- this.meta = meta;
1172
+ constructor() {
1173
+ this.config = inject(EsolveConfigService);
1174
+ this.title = inject(Title);
1175
+ this.meta = inject(Meta);
1176
1176
  this.dom = inject(DOCUMENT);
1177
1177
  this.title_prefix = '';
1178
1178
  this.title_suffix = '';
@@ -1274,15 +1274,15 @@ class EsolveSeoService {
1274
1274
  }
1275
1275
  return pageSeo;
1276
1276
  }
1277
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSeoService, deps: [{ token: EsolveConfigService }, { token: i2$1.Title }, { token: i2$1.Meta }], target: i0.ɵɵFactoryTarget.Injectable }); }
1278
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSeoService, providedIn: 'root' }); }
1277
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSeoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1278
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSeoService, providedIn: 'root' }); }
1279
1279
  }
1280
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSeoService, decorators: [{
1280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSeoService, decorators: [{
1281
1281
  type: Injectable,
1282
1282
  args: [{
1283
1283
  providedIn: 'root',
1284
1284
  }]
1285
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2$1.Title }, { type: i2$1.Meta }]; } });
1285
+ }], ctorParameters: function () { return []; } });
1286
1286
 
1287
1287
  class EsolveGeocodeAddressResult {
1288
1288
  constructor(street_number, street, suburb, city, province, country, postal_code) {
@@ -1315,9 +1315,9 @@ class EsolveGeocodeResult {
1315
1315
  }
1316
1316
 
1317
1317
  class EsolveGeocoderService {
1318
- constructor(config, http) {
1319
- this.config = config;
1320
- this.http = http;
1318
+ constructor() {
1319
+ this.config = inject(EsolveConfigService);
1320
+ this.http = inject(HttpClient);
1321
1321
  }
1322
1322
  geocode(street_number, street, suburb, city, province, country, postal_code) {
1323
1323
  return this.http
@@ -1364,15 +1364,15 @@ class EsolveGeocoderService {
1364
1364
  const geocode_result = new EsolveGeocodeResult(record.formatted_address, geocode_address, geocode_coords, record.status, record.checksum, record.cached);
1365
1365
  return geocode_result;
1366
1366
  }
1367
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveGeocoderService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1368
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveGeocoderService, providedIn: 'root' }); }
1367
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveGeocoderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1368
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveGeocoderService, providedIn: 'root' }); }
1369
1369
  }
1370
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveGeocoderService, decorators: [{
1370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveGeocoderService, decorators: [{
1371
1371
  type: Injectable,
1372
1372
  args: [{
1373
1373
  providedIn: 'root',
1374
1374
  }]
1375
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
1375
+ }] });
1376
1376
 
1377
1377
  class EsolveLinkedAsset {
1378
1378
  constructor(record) {
@@ -1432,9 +1432,9 @@ class EsolveCategoryTreeItem {
1432
1432
  }
1433
1433
 
1434
1434
  class EsolveCategoryTreeService {
1435
- constructor(config, http) {
1436
- this.config = config;
1437
- this.http = http;
1435
+ constructor() {
1436
+ this.config = inject(EsolveConfigService);
1437
+ this.http = inject(HttpClient);
1438
1438
  }
1439
1439
  /**
1440
1440
  * Retrieves the category tree from eSolve instance and coverts it to the correct format.
@@ -1565,15 +1565,15 @@ class EsolveCategoryTreeService {
1565
1565
  }
1566
1566
  return null;
1567
1567
  }
1568
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCategoryTreeService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1569
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCategoryTreeService, providedIn: 'root' }); }
1568
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCategoryTreeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1569
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCategoryTreeService, providedIn: 'root' }); }
1570
1570
  }
1571
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCategoryTreeService, decorators: [{
1571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCategoryTreeService, decorators: [{
1572
1572
  type: Injectable,
1573
1573
  args: [{
1574
1574
  providedIn: 'root',
1575
1575
  }]
1576
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
1576
+ }] });
1577
1577
 
1578
1578
  class EsolveManufacturer {
1579
1579
  get original_image_src() {
@@ -1636,9 +1636,9 @@ class EsolveManufacturer {
1636
1636
  }
1637
1637
 
1638
1638
  class EsolveManufacturersService {
1639
- constructor(config, http) {
1640
- this.config = config;
1641
- this.http = http;
1639
+ constructor() {
1640
+ this.config = inject(EsolveConfigService);
1641
+ this.http = inject(HttpClient);
1642
1642
  }
1643
1643
  getManufacturer(id) {
1644
1644
  const params = new HttpParams({
@@ -1687,15 +1687,15 @@ class EsolveManufacturersService {
1687
1687
  processManufacturer(record) {
1688
1688
  return new EsolveManufacturer(record);
1689
1689
  }
1690
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveManufacturersService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1691
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveManufacturersService, providedIn: 'root' }); }
1690
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveManufacturersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1691
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveManufacturersService, providedIn: 'root' }); }
1692
1692
  }
1693
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveManufacturersService, decorators: [{
1693
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveManufacturersService, decorators: [{
1694
1694
  type: Injectable,
1695
1695
  args: [{
1696
1696
  providedIn: 'root',
1697
1697
  }]
1698
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
1698
+ }] });
1699
1699
 
1700
1700
  // Types
1701
1701
 
@@ -1753,9 +1753,9 @@ class EsolveRange {
1753
1753
  }
1754
1754
 
1755
1755
  class EsolveRangesService {
1756
- constructor(config, http) {
1757
- this.config = config;
1758
- this.http = http;
1756
+ constructor() {
1757
+ this.config = inject(EsolveConfigService);
1758
+ this.http = inject(HttpClient);
1759
1759
  }
1760
1760
  getRange(id) {
1761
1761
  const params = new HttpParams({
@@ -1807,15 +1807,15 @@ class EsolveRangesService {
1807
1807
  processRange(record) {
1808
1808
  return new EsolveRange(record);
1809
1809
  }
1810
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveRangesService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1811
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveRangesService, providedIn: 'root' }); }
1810
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveRangesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1811
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveRangesService, providedIn: 'root' }); }
1812
1812
  }
1813
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveRangesService, decorators: [{
1813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveRangesService, decorators: [{
1814
1814
  type: Injectable,
1815
1815
  args: [{
1816
1816
  providedIn: 'root',
1817
1817
  }]
1818
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
1818
+ }] });
1819
1819
 
1820
1820
  class EsolveTag {
1821
1821
  /**
@@ -1853,9 +1853,9 @@ class EsolveTag {
1853
1853
  }
1854
1854
 
1855
1855
  class EsolveTagsService {
1856
- constructor(config, http) {
1857
- this.config = config;
1858
- this.http = http;
1856
+ constructor() {
1857
+ this.config = inject(EsolveConfigService);
1858
+ this.http = inject(HttpClient);
1859
1859
  }
1860
1860
  /**
1861
1861
  * Retrieves active topics from the list of topic ID's. Note that inactive or expired
@@ -1910,15 +1910,15 @@ class EsolveTagsService {
1910
1910
  }
1911
1911
  return tags;
1912
1912
  }
1913
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTagsService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1914
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTagsService, providedIn: 'root' }); }
1913
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTagsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1914
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTagsService, providedIn: 'root' }); }
1915
1915
  }
1916
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTagsService, decorators: [{
1916
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTagsService, decorators: [{
1917
1917
  type: Injectable,
1918
1918
  args: [{
1919
1919
  providedIn: 'root',
1920
1920
  }]
1921
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
1921
+ }] });
1922
1922
 
1923
1923
  // Types
1924
1924
 
@@ -1938,9 +1938,9 @@ class EsolveTopic {
1938
1938
  }
1939
1939
 
1940
1940
  class EsolveTopicService {
1941
- constructor(config, http) {
1942
- this.config = config;
1943
- this.http = http;
1941
+ constructor() {
1942
+ this.config = inject(EsolveConfigService);
1943
+ this.http = inject(HttpClient);
1944
1944
  }
1945
1945
  /**
1946
1946
  * Retrieves active topics from the list of topic ID's. Note that inactive or expired
@@ -1972,15 +1972,15 @@ class EsolveTopicService {
1972
1972
  }
1973
1973
  return topics;
1974
1974
  }
1975
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTopicService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1976
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTopicService, providedIn: 'root' }); }
1975
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTopicService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1976
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTopicService, providedIn: 'root' }); }
1977
1977
  }
1978
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTopicService, decorators: [{
1978
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTopicService, decorators: [{
1979
1979
  type: Injectable,
1980
1980
  args: [{
1981
1981
  providedIn: 'root',
1982
1982
  }]
1983
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
1983
+ }] });
1984
1984
 
1985
1985
  class EsolveAsset {
1986
1986
  /**
@@ -2055,9 +2055,9 @@ class EsolveAsset {
2055
2055
  }
2056
2056
 
2057
2057
  class EsolveAssetsService {
2058
- constructor(config, http) {
2059
- this.config = config;
2060
- this.http = http;
2058
+ constructor() {
2059
+ this.config = inject(EsolveConfigService);
2060
+ this.http = inject(HttpClient);
2061
2061
  }
2062
2062
  getAsset(id) {
2063
2063
  const params = new HttpParams({ fromObject: { assets_id: id } });
@@ -2165,15 +2165,15 @@ class EsolveAssetsService {
2165
2165
  const total = total_records;
2166
2166
  return new EsolveList(assets, page, rows, total);
2167
2167
  }
2168
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAssetsService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
2169
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAssetsService, providedIn: 'root' }); }
2168
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAssetsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2169
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAssetsService, providedIn: 'root' }); }
2170
2170
  }
2171
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAssetsService, decorators: [{
2171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAssetsService, decorators: [{
2172
2172
  type: Injectable,
2173
2173
  args: [{
2174
2174
  providedIn: 'root',
2175
2175
  }]
2176
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
2176
+ }] });
2177
2177
 
2178
2178
  // Types
2179
2179
 
@@ -2645,9 +2645,9 @@ class EsolveLocation {
2645
2645
  // Classes
2646
2646
 
2647
2647
  class EsolveLocationsService {
2648
- constructor(config, http) {
2649
- this.config = config;
2650
- this.http = http;
2648
+ constructor() {
2649
+ this.config = inject(EsolveConfigService);
2650
+ this.http = inject(HttpClient);
2651
2651
  }
2652
2652
  /**
2653
2653
  * Retrieves a list of stock locations
@@ -2706,15 +2706,15 @@ class EsolveLocationsService {
2706
2706
  }
2707
2707
  return stock_locations;
2708
2708
  }
2709
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveLocationsService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
2710
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveLocationsService, providedIn: 'root' }); }
2709
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveLocationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2710
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveLocationsService, providedIn: 'root' }); }
2711
2711
  }
2712
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveLocationsService, decorators: [{
2712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveLocationsService, decorators: [{
2713
2713
  type: Injectable,
2714
2714
  args: [{
2715
2715
  providedIn: 'root',
2716
2716
  }]
2717
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
2717
+ }] });
2718
2718
 
2719
2719
  class EsolveTransactionLocation extends EsolveLocation {
2720
2720
  }
@@ -2810,11 +2810,11 @@ class EsolveTransactionsService {
2810
2810
  this._user_id = value;
2811
2811
  }
2812
2812
  }
2813
- constructor(config, http, sessionService, errorHandler) {
2814
- this.config = config;
2815
- this.http = http;
2816
- this.sessionService = sessionService;
2817
- this.errorHandler = errorHandler;
2813
+ constructor() {
2814
+ this.config = inject(EsolveConfigService);
2815
+ this.http = inject(HttpClient);
2816
+ this.sessionService = inject(EsolveSessionService);
2817
+ this.errorHandler = inject(EsolveErrorHandlerService);
2818
2818
  this._user_id = 0;
2819
2819
  this.sessionService.getSession().subscribe((session) => {
2820
2820
  if (session.token !== '') {
@@ -2909,15 +2909,15 @@ class EsolveTransactionsService {
2909
2909
  }
2910
2910
  return transactions;
2911
2911
  }
2912
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTransactionsService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2913
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTransactionsService, providedIn: 'root' }); }
2912
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTransactionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2913
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTransactionsService, providedIn: 'root' }); }
2914
2914
  }
2915
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveTransactionsService, decorators: [{
2915
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveTransactionsService, decorators: [{
2916
2916
  type: Injectable,
2917
2917
  args: [{
2918
2918
  providedIn: 'root',
2919
2919
  }]
2920
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }]; } });
2920
+ }], ctorParameters: function () { return []; } });
2921
2921
 
2922
2922
  class EsolveEmptyCartResult extends EsolveResponseResult {
2923
2923
  }
@@ -3016,7 +3016,10 @@ class EsolveCartTotals {
3016
3016
  * Grand total of cart which includes discount and VAT (NOTE: shipping and insurance is not included)
3017
3017
  */
3018
3018
  get total() {
3019
- return this.sub_total + this.vat_total - this.discount_total;
3019
+ return (this.sub_total +
3020
+ this.vat_total -
3021
+ this.discount_total -
3022
+ this.voucher_total);
3020
3023
  }
3021
3024
  constructor(
3022
3025
  /**
@@ -3038,12 +3041,17 @@ class EsolveCartTotals {
3038
3041
  /**
3039
3042
  * Total discount of all the item in the cart
3040
3043
  */
3041
- discount_total = 0) {
3044
+ discount_total = 0,
3045
+ /**
3046
+ * Total of all vouchers used
3047
+ */
3048
+ voucher_total = 0) {
3042
3049
  this.records = records;
3043
3050
  this.items = items;
3044
3051
  this.sub_total = sub_total;
3045
3052
  this.vat_total = vat_total;
3046
3053
  this.discount_total = discount_total;
3054
+ this.voucher_total = voucher_total;
3047
3055
  }
3048
3056
  }
3049
3057
 
@@ -3091,18 +3099,17 @@ class EsolveCoupon {
3091
3099
  }
3092
3100
 
3093
3101
  class EsolveCouponsService {
3094
- constructor(platformId, config, http, cookieService) {
3095
- this.platformId = platformId;
3096
- this.config = config;
3097
- this.http = http;
3098
- this.cookieService = cookieService;
3102
+ constructor() {
3103
+ this.is_browser = isPlatformBrowser(inject(PLATFORM_ID));
3104
+ this.http = inject(HttpClient);
3105
+ this.config = inject(EsolveConfigService);
3106
+ this.cookieService = inject(EsolveCookieService);
3099
3107
  this.storage_key = '_ng_eslv_coupons';
3100
- this.coupons_cache = new Map();
3108
+ this.cache = new Map();
3101
3109
  this.applied = new BehaviorSubject(undefined);
3102
3110
  this.validation_error = new Subject();
3103
3111
  this.setStorageKey();
3104
- this.coupons_cache = this.retrieveCache();
3105
- this.is_browser = isPlatformBrowser(this.platformId);
3112
+ this.cache = this.retrieveCache();
3106
3113
  }
3107
3114
  onValidationError() {
3108
3115
  return this.validation_error.asObservable();
@@ -3155,15 +3162,15 @@ class EsolveCouponsService {
3155
3162
  }
3156
3163
  }
3157
3164
  removeCoupon(id) {
3158
- this.coupons_cache.delete(id);
3165
+ this.cache.delete(id);
3159
3166
  this.cacheCoupons();
3160
3167
  this.applied.next();
3161
3168
  }
3162
3169
  getAppliedCouponKeys() {
3163
- return [...this.coupons_cache.values()];
3170
+ return [...this.cache.values()];
3164
3171
  }
3165
3172
  getAppliedCoupons() {
3166
- const coupon_ids = [...this.coupons_cache.keys()];
3173
+ const coupon_ids = [...this.cache.keys()];
3167
3174
  return this.http
3168
3175
  .get(`${this.config.api_url}/get-applied-coupons.php`, {
3169
3176
  params: {
@@ -3199,8 +3206,8 @@ class EsolveCouponsService {
3199
3206
  return new Map();
3200
3207
  }
3201
3208
  cacheCoupons() {
3202
- if (this.coupons_cache.size > 0) {
3203
- const coupons_json = this.jsonEncodeMap(this.coupons_cache);
3209
+ if (this.cache.size > 0) {
3210
+ const coupons_json = this.jsonEncodeMap(this.cache);
3204
3211
  this.cookieService.set(this.storage_key, coupons_json, undefined, '/');
3205
3212
  this.setBackup(coupons_json);
3206
3213
  }
@@ -3209,7 +3216,7 @@ class EsolveCouponsService {
3209
3216
  }
3210
3217
  }
3211
3218
  deleteCoupons() {
3212
- this.coupons_cache.clear();
3219
+ this.cache.clear();
3213
3220
  this.cookieService.delete(this.storage_key, '/');
3214
3221
  this.removeBackup();
3215
3222
  }
@@ -3241,8 +3248,8 @@ class EsolveCouponsService {
3241
3248
  localStorage.removeItem(this.storage_key);
3242
3249
  }
3243
3250
  addCoupon(id, key) {
3244
- if (!this.coupons_cache.has(id)) {
3245
- this.coupons_cache.set(id, key);
3251
+ if (!this.cache.has(id)) {
3252
+ this.cache.set(id, key);
3246
3253
  this.cacheCoupons();
3247
3254
  }
3248
3255
  this.applied.next();
@@ -3293,28 +3300,258 @@ class EsolveCouponsService {
3293
3300
  }
3294
3301
  return coupons;
3295
3302
  }
3296
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCouponsService, deps: [{ token: PLATFORM_ID }, { token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3297
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCouponsService, providedIn: 'root' }); }
3303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCouponsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3304
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCouponsService, providedIn: 'root' }); }
3298
3305
  }
3299
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCouponsService, decorators: [{
3306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCouponsService, decorators: [{
3300
3307
  type: Injectable,
3301
3308
  args: [{
3302
3309
  providedIn: 'root',
3303
3310
  }]
3304
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
3305
- type: Inject,
3306
- args: [PLATFORM_ID]
3307
- }] }, { type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveCookieService }]; } });
3311
+ }], ctorParameters: function () { return []; } });
3312
+
3313
+ // Classes
3314
+
3315
+ class EsolveVoucher {
3316
+ constructor(record) {
3317
+ this.id = 0;
3318
+ this.identifier = '';
3319
+ this.value = 0;
3320
+ /**
3321
+ * Shows either the short code or the coupon key (if short code is not set)
3322
+ */
3323
+ this.voucher_code = '';
3324
+ if (record) {
3325
+ this.id = +record.id;
3326
+ this.identifier = record.identifier;
3327
+ this.value = +record.value;
3328
+ this.voucher_code = record.voucher_code;
3329
+ }
3330
+ }
3331
+ }
3332
+
3333
+ class EsolveVouchersService {
3334
+ constructor() {
3335
+ this.is_browser = isPlatformBrowser(inject(PLATFORM_ID));
3336
+ this.http = inject(HttpClient);
3337
+ this.config = inject(EsolveConfigService);
3338
+ this.cookieService = inject(EsolveCookieService);
3339
+ this.storage_key = '_ng_eslv_vouchers';
3340
+ this.cache = new Map();
3341
+ this.applied = new BehaviorSubject(undefined);
3342
+ this.validation_error = new Subject();
3343
+ this.setStorageKey();
3344
+ this.cache = this.retrieveCache();
3345
+ }
3346
+ onValidationError() {
3347
+ return this.validation_error.asObservable();
3348
+ }
3349
+ onApplied() {
3350
+ return this.applied.asObservable();
3351
+ }
3352
+ validate(voucher_key) {
3353
+ return this.http
3354
+ .get(`${this.config.api_url}/get-validate-voucher.php`, {
3355
+ params: {
3356
+ voucher_key,
3357
+ },
3358
+ })
3359
+ .pipe(map$1((response) => {
3360
+ if (response.records === undefined ||
3361
+ Array.isArray(response.records)) {
3362
+ throw response;
3363
+ }
3364
+ const valid = response.records.valid;
3365
+ const result = {
3366
+ valid,
3367
+ };
3368
+ if (!valid) {
3369
+ const error = response.records.error;
3370
+ this.validation_error.next(error);
3371
+ }
3372
+ else if (valid) {
3373
+ result.id = response.records.id;
3374
+ }
3375
+ return result;
3376
+ }), catchError(() => {
3377
+ this.validation_error.next(undefined);
3378
+ return [{ valid: false }];
3379
+ }));
3380
+ }
3381
+ async applyVoucher(voucher_key) {
3382
+ try {
3383
+ if (voucher_key.trim() === '') {
3384
+ return false;
3385
+ }
3386
+ const result = await firstValueFrom(this.validate(voucher_key));
3387
+ if (result.valid && result.id) {
3388
+ this.addVoucher(result.id, voucher_key);
3389
+ }
3390
+ return result.valid;
3391
+ }
3392
+ catch (error) {
3393
+ return false;
3394
+ }
3395
+ }
3396
+ removeVoucher(id) {
3397
+ this.cache.delete(id);
3398
+ this.cacheVouchers();
3399
+ this.applied.next();
3400
+ }
3401
+ getAppliedVoucherKeys() {
3402
+ return [...this.cache.values()];
3403
+ }
3404
+ getAppliedVouchers() {
3405
+ const voucher_ids = [...this.cache.keys()];
3406
+ return this.http
3407
+ .get(`${this.config.api_url}/get-applied-vouchers.php`, {
3408
+ params: {
3409
+ vouchers: voucher_ids.join(','),
3410
+ },
3411
+ })
3412
+ .pipe(map$1((response) => {
3413
+ if (response.records === undefined) {
3414
+ throw response;
3415
+ }
3416
+ return this.processVouchers(response.records);
3417
+ }));
3418
+ }
3419
+ reset() {
3420
+ this.deleteVouchers();
3421
+ }
3422
+ retrieveCache() {
3423
+ if (this.cookieService.check(this.storage_key) || this.getBackup()) {
3424
+ let vouchers_json = this.cookieService.get(this.storage_key);
3425
+ if (vouchers_json === '') {
3426
+ const local_store_data = this.getBackup();
3427
+ if (local_store_data) {
3428
+ vouchers_json = local_store_data;
3429
+ }
3430
+ }
3431
+ try {
3432
+ return this.jsonDecodeMap(vouchers_json);
3433
+ }
3434
+ catch (error) {
3435
+ // soft error
3436
+ }
3437
+ }
3438
+ return new Map();
3439
+ }
3440
+ cacheVouchers() {
3441
+ if (this.cache.size > 0) {
3442
+ const vouchers_json = this.jsonEncodeMap(this.cache);
3443
+ this.cookieService.set(this.storage_key, vouchers_json, undefined, '/');
3444
+ this.setBackup(vouchers_json);
3445
+ }
3446
+ else {
3447
+ this.deleteVouchers();
3448
+ }
3449
+ }
3450
+ deleteVouchers() {
3451
+ this.cache.clear();
3452
+ this.cookieService.delete(this.storage_key, '/');
3453
+ this.removeBackup();
3454
+ }
3455
+ getBackup() {
3456
+ if (!this.is_browser) {
3457
+ return null;
3458
+ }
3459
+ if (!localStorage) {
3460
+ return null;
3461
+ }
3462
+ return localStorage.getItem(this.storage_key);
3463
+ }
3464
+ setBackup(data) {
3465
+ if (!this.is_browser) {
3466
+ return;
3467
+ }
3468
+ if (!localStorage) {
3469
+ return;
3470
+ }
3471
+ localStorage.setItem(this.storage_key, data);
3472
+ }
3473
+ removeBackup() {
3474
+ if (!this.is_browser) {
3475
+ return;
3476
+ }
3477
+ if (!localStorage) {
3478
+ return;
3479
+ }
3480
+ localStorage.removeItem(this.storage_key);
3481
+ }
3482
+ addVoucher(id, key) {
3483
+ if (!this.cache.has(id)) {
3484
+ this.cache.set(id, key);
3485
+ this.cacheVouchers();
3486
+ }
3487
+ this.applied.next();
3488
+ }
3489
+ setStorageKey() {
3490
+ if (typeof this.config.voucher_storage_key === 'string' &&
3491
+ this.config.voucher_storage_key !== '') {
3492
+ this.storage_key = this.config.voucher_storage_key;
3493
+ }
3494
+ }
3495
+ jsonEncodeMap(data) {
3496
+ if (!(data instanceof Map)) {
3497
+ throw new Error('Invalid map type');
3498
+ }
3499
+ return JSON.stringify(data, (key, value) => {
3500
+ if (value instanceof Map) {
3501
+ return {
3502
+ dataType: 'Map',
3503
+ value: [...value],
3504
+ };
3505
+ }
3506
+ else {
3507
+ return value;
3508
+ }
3509
+ });
3510
+ }
3511
+ jsonDecodeMap(json_data) {
3512
+ const data = JSON.parse(json_data, (key, value) => {
3513
+ if (typeof value === 'object' && value !== null) {
3514
+ if (value.dataType === 'Map') {
3515
+ return new Map(value.value);
3516
+ }
3517
+ }
3518
+ return value;
3519
+ });
3520
+ if (data instanceof Map) {
3521
+ return data;
3522
+ }
3523
+ throw new Error('Invalid map type');
3524
+ }
3525
+ processVouchers(records) {
3526
+ const vouchers = [];
3527
+ if (records) {
3528
+ for (const record of records) {
3529
+ const voucher = new EsolveVoucher(record);
3530
+ vouchers.push(voucher);
3531
+ }
3532
+ }
3533
+ return vouchers;
3534
+ }
3535
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveVouchersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3536
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveVouchersService, providedIn: 'root' }); }
3537
+ }
3538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveVouchersService, decorators: [{
3539
+ type: Injectable,
3540
+ args: [{
3541
+ providedIn: 'root',
3542
+ }]
3543
+ }], ctorParameters: function () { return []; } });
3308
3544
 
3309
3545
  // Classes
3310
3546
 
3311
3547
  class EsolveCartService {
3312
- constructor(config, http, errorHandler, responseHandler, coupons) {
3313
- this.config = config;
3314
- this.http = http;
3315
- this.errorHandler = errorHandler;
3316
- this.responseHandler = responseHandler;
3317
- this.coupons = coupons;
3548
+ constructor() {
3549
+ this.config = inject(EsolveConfigService);
3550
+ this.http = inject(HttpClient);
3551
+ this.errorHandler = inject(EsolveErrorHandlerService);
3552
+ this.responseHandler = inject(EsolveResponseHandlerService);
3553
+ this.coupons = inject(EsolveCouponsService);
3554
+ this.vouchers = inject(EsolveVouchersService);
3318
3555
  this._cached_tracking = 0;
3319
3556
  }
3320
3557
  /**
@@ -3391,12 +3628,17 @@ class EsolveCartService {
3391
3628
  * @returns An `Observable` with an object containing cart totals
3392
3629
  */
3393
3630
  getTotals(type) {
3394
- return this.http
3395
- .get(`${this.config.api_url}/get-cart-totals.php`, {
3396
- params: {
3631
+ let params = new HttpParams({
3632
+ fromObject: {
3397
3633
  type: type ?? '',
3398
3634
  },
3399
- })
3635
+ });
3636
+ const vouchers = this.vouchers.getAppliedVoucherKeys();
3637
+ if (vouchers.length > 0) {
3638
+ params = params.set('vouchers', vouchers.join(','));
3639
+ }
3640
+ return this.http
3641
+ .get(`${this.config.api_url}/get-cart-totals.php`, { params })
3400
3642
  .pipe(map$1((response) => {
3401
3643
  if (response.records === undefined ||
3402
3644
  Array.isArray(response.records)) {
@@ -3472,6 +3714,10 @@ class EsolveCartService {
3472
3714
  throw tracking;
3473
3715
  }
3474
3716
  body.tracking = tracking;
3717
+ const voucher_keys = this.vouchers.getAppliedVoucherKeys();
3718
+ if (voucher_keys.length > 0) {
3719
+ body.vouchers = voucher_keys;
3720
+ }
3475
3721
  return this.http
3476
3722
  .post(`${this.config.api_url}/set-checkout.php`, body, {
3477
3723
  headers: {
@@ -3511,18 +3757,18 @@ class EsolveCartService {
3511
3757
  * @returns Processed cart totals
3512
3758
  */
3513
3759
  processCartTotals(record) {
3514
- const cart_totals = new EsolveCartTotals(+record.records, +record.items, +record.total, +record.vat, +record.discount);
3760
+ const cart_totals = new EsolveCartTotals(+record.records, +record.items, +record.total, +record.vat, +record.discount, +record.vouchers);
3515
3761
  return cart_totals;
3516
3762
  }
3517
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCartService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }, { token: EsolveCouponsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3518
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCartService, providedIn: 'root' }); }
3763
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3764
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCartService, providedIn: 'root' }); }
3519
3765
  }
3520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveCartService, decorators: [{
3766
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveCartService, decorators: [{
3521
3767
  type: Injectable,
3522
3768
  args: [{
3523
3769
  providedIn: 'root',
3524
3770
  }]
3525
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }, { type: EsolveCouponsService }]; } });
3771
+ }] });
3526
3772
 
3527
3773
  class EsolveAccountService {
3528
3774
  get user_id() {
@@ -3534,12 +3780,12 @@ class EsolveAccountService {
3534
3780
  this._user_id = value;
3535
3781
  }
3536
3782
  }
3537
- constructor(config, http, sessionService, errorHandler, responseHandler) {
3538
- this.config = config;
3539
- this.http = http;
3540
- this.sessionService = sessionService;
3541
- this.errorHandler = errorHandler;
3542
- this.responseHandler = responseHandler;
3783
+ constructor() {
3784
+ this.config = inject(EsolveConfigService);
3785
+ this.http = inject(HttpClient);
3786
+ this.sessionService = inject(EsolveSessionService);
3787
+ this.errorHandler = inject(EsolveErrorHandlerService);
3788
+ this.responseHandler = inject(EsolveResponseHandlerService);
3543
3789
  this._user_id = 0;
3544
3790
  this.sessionService.getSession().subscribe((session) => {
3545
3791
  if (session.token !== '') {
@@ -3918,15 +4164,15 @@ class EsolveAccountService {
3918
4164
  return new EsolveLocationUpdateResult(response);
3919
4165
  })));
3920
4166
  }
3921
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAccountService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3922
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAccountService, providedIn: 'root' }); }
4167
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAccountService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4168
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAccountService, providedIn: 'root' }); }
3923
4169
  }
3924
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveAccountService, decorators: [{
4170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveAccountService, decorators: [{
3925
4171
  type: Injectable,
3926
4172
  args: [{
3927
4173
  providedIn: 'root',
3928
4174
  }]
3929
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
4175
+ }], ctorParameters: function () { return []; } });
3930
4176
 
3931
4177
  class EsolveBanner {
3932
4178
  constructor(id, banner_display_container, identifier, type, title, article, sort_priority, link, images) {
@@ -3977,9 +4223,9 @@ class EsolveBannerImageHotspot {
3977
4223
  }
3978
4224
 
3979
4225
  class EsolveBannerService {
3980
- constructor(config, http) {
3981
- this.config = config;
3982
- this.http = http;
4226
+ constructor() {
4227
+ this.config = inject(EsolveConfigService);
4228
+ this.http = inject(HttpClient);
3983
4229
  }
3984
4230
  /**
3985
4231
  * Retrieves banners records from eSolve instance
@@ -4057,15 +4303,15 @@ class EsolveBannerService {
4057
4303
  }
4058
4304
  return banners;
4059
4305
  }
4060
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveBannerService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
4061
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveBannerService, providedIn: 'root' }); }
4306
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveBannerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4307
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveBannerService, providedIn: 'root' }); }
4062
4308
  }
4063
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveBannerService, decorators: [{
4309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveBannerService, decorators: [{
4064
4310
  type: Injectable,
4065
4311
  args: [{
4066
4312
  providedIn: 'root',
4067
4313
  }]
4068
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
4314
+ }] });
4069
4315
 
4070
4316
  // Types
4071
4317
 
@@ -4101,9 +4347,9 @@ class EsolveMenuItem {
4101
4347
  }
4102
4348
 
4103
4349
  class EsolveMenuService {
4104
- constructor(config, http) {
4105
- this.config = config;
4106
- this.http = http;
4350
+ constructor() {
4351
+ this.config = inject(EsolveConfigService);
4352
+ this.http = inject(HttpClient);
4107
4353
  }
4108
4354
  getMenuTree(identifier) {
4109
4355
  return this.http
@@ -4127,15 +4373,15 @@ class EsolveMenuService {
4127
4373
  }
4128
4374
  return menu;
4129
4375
  }
4130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveMenuService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
4131
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveMenuService, providedIn: 'root' }); }
4376
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4377
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveMenuService, providedIn: 'root' }); }
4132
4378
  }
4133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveMenuService, decorators: [{
4379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveMenuService, decorators: [{
4134
4380
  type: Injectable,
4135
4381
  args: [{
4136
4382
  providedIn: 'root',
4137
4383
  }]
4138
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
4384
+ }] });
4139
4385
 
4140
4386
  class EsolveNewsGroup {
4141
4387
  get image_src() {
@@ -4246,9 +4492,9 @@ class EsolveNewsArticleList {
4246
4492
  }
4247
4493
 
4248
4494
  class EsolveNewsService {
4249
- constructor(config, http) {
4250
- this.config = config;
4251
- this.http = http;
4495
+ constructor() {
4496
+ this.config = inject(EsolveConfigService);
4497
+ this.http = inject(HttpClient);
4252
4498
  }
4253
4499
  getNewsArticle(identifier) {
4254
4500
  const params = new HttpParams({
@@ -4342,15 +4588,15 @@ class EsolveNewsService {
4342
4588
  }
4343
4589
  return params;
4344
4590
  }
4345
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveNewsService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
4346
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveNewsService, providedIn: 'root' }); }
4591
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveNewsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4592
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveNewsService, providedIn: 'root' }); }
4347
4593
  }
4348
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveNewsService, decorators: [{
4594
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveNewsService, decorators: [{
4349
4595
  type: Injectable,
4350
4596
  args: [{
4351
4597
  providedIn: 'root',
4352
4598
  }]
4353
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
4599
+ }] });
4354
4600
 
4355
4601
  // Types
4356
4602
 
@@ -4940,9 +5186,9 @@ class EsolveStockImageCollection {
4940
5186
  // Interfaces
4941
5187
 
4942
5188
  class EsolveStockService {
4943
- constructor(config, http) {
4944
- this.config = config;
4945
- this.http = http;
5189
+ constructor() {
5190
+ this.config = inject(EsolveConfigService);
5191
+ this.http = inject(HttpClient);
4946
5192
  }
4947
5193
  /**
4948
5194
  * Retrieves the stock record from the eSolve instance using the code.
@@ -5335,15 +5581,15 @@ class EsolveStockService {
5335
5581
  getStockHistoryRecords(params) {
5336
5582
  return this.http.get(`${this.config.api_url}/get-items-transaction-history.php`, { params });
5337
5583
  }
5338
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveStockService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
5339
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveStockService, providedIn: 'root' }); }
5584
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveStockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5585
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveStockService, providedIn: 'root' }); }
5340
5586
  }
5341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveStockService, decorators: [{
5587
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveStockService, decorators: [{
5342
5588
  type: Injectable,
5343
5589
  args: [{
5344
5590
  providedIn: 'root',
5345
5591
  }]
5346
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
5592
+ }] });
5347
5593
 
5348
5594
  class EsolveSpecialImage {
5349
5595
  constructor(record) {
@@ -5422,9 +5668,9 @@ class EsolveSpecial {
5422
5668
  }
5423
5669
 
5424
5670
  class EsolveSpecialsService {
5425
- constructor(config, http) {
5426
- this.config = config;
5427
- this.http = http;
5671
+ constructor() {
5672
+ this.config = inject(EsolveConfigService);
5673
+ this.http = inject(HttpClient);
5428
5674
  }
5429
5675
  getSpecial(specials_id) {
5430
5676
  const params = new HttpParams({
@@ -5482,15 +5728,15 @@ class EsolveSpecialsService {
5482
5728
  processSpecial(record) {
5483
5729
  return new EsolveSpecial(record);
5484
5730
  }
5485
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSpecialsService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
5486
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSpecialsService, providedIn: 'root' }); }
5731
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSpecialsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5732
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSpecialsService, providedIn: 'root' }); }
5487
5733
  }
5488
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSpecialsService, decorators: [{
5734
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSpecialsService, decorators: [{
5489
5735
  type: Injectable,
5490
5736
  args: [{
5491
5737
  providedIn: 'root',
5492
5738
  }]
5493
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
5739
+ }] });
5494
5740
 
5495
5741
  class EsolveBankingDetails {
5496
5742
  constructor(bank_name, account_holder, account, account_type, swift_number, branch_code) {
@@ -5615,11 +5861,11 @@ class EsolveVaultItem {
5615
5861
  }
5616
5862
 
5617
5863
  class EsolvePaymentService {
5618
- constructor(config, http, errorHandler, responseHandler) {
5619
- this.config = config;
5620
- this.http = http;
5621
- this.errorHandler = errorHandler;
5622
- this.responseHandler = responseHandler;
5864
+ constructor() {
5865
+ this.config = inject(EsolveConfigService);
5866
+ this.http = inject(HttpClient);
5867
+ this.errorHandler = inject(EsolveErrorHandlerService);
5868
+ this.responseHandler = inject(EsolveResponseHandlerService);
5623
5869
  }
5624
5870
  /**
5625
5871
  * Retrieves a list of payment methods.
@@ -5823,15 +6069,15 @@ class EsolvePaymentService {
5823
6069
  const year_string = card_data.expiry_year.padStart(4, '0');
5824
6070
  return `${month_string}${year_string}`;
5825
6071
  }
5826
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolvePaymentService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5827
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolvePaymentService, providedIn: 'root' }); }
6072
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolvePaymentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6073
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolvePaymentService, providedIn: 'root' }); }
5828
6074
  }
5829
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolvePaymentService, decorators: [{
6075
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolvePaymentService, decorators: [{
5830
6076
  type: Injectable,
5831
6077
  args: [{
5832
6078
  providedIn: 'root',
5833
6079
  }]
5834
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
6080
+ }] });
5835
6081
 
5836
6082
  class EsolveShippingTotals {
5837
6083
  constructor(total, vat, savings) {
@@ -5964,9 +6210,9 @@ class EsolveTimeSlotConfig {
5964
6210
  }
5965
6211
 
5966
6212
  class EsolveShippingService {
5967
- constructor(config, http) {
5968
- this.config = config;
5969
- this.http = http;
6213
+ constructor() {
6214
+ this.config = inject(EsolveConfigService);
6215
+ this.http = inject(HttpClient);
5970
6216
  }
5971
6217
  /**
5972
6218
  * Retrieves a list of shipping methods
@@ -6093,15 +6339,15 @@ class EsolveShippingService {
6093
6339
  const shipping_cost = new EsolveShippingCost(+record.shipping_total, +record.vat_on_shipping, +record.total_saving_on_shipping, +record.insurance_total, +record.vat_on_insurance, +record.total_saving_on_insurance);
6094
6340
  return shipping_cost;
6095
6341
  }
6096
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveShippingService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
6097
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveShippingService, providedIn: 'root' }); }
6342
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveShippingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6343
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveShippingService, providedIn: 'root' }); }
6098
6344
  }
6099
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveShippingService, decorators: [{
6345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveShippingService, decorators: [{
6100
6346
  type: Injectable,
6101
6347
  args: [{
6102
6348
  providedIn: 'root',
6103
6349
  }]
6104
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
6350
+ }] });
6105
6351
 
6106
6352
  class EsolveEnquiryResult extends EsolveResponseResult {
6107
6353
  constructor(response) {
@@ -6112,11 +6358,11 @@ class EsolveEnquiryResult extends EsolveResponseResult {
6112
6358
  }
6113
6359
 
6114
6360
  class EsolveEnquiryService {
6115
- constructor(config, http, errorHandler, responseHandler) {
6116
- this.config = config;
6117
- this.http = http;
6118
- this.errorHandler = errorHandler;
6119
- this.responseHandler = responseHandler;
6361
+ constructor() {
6362
+ this.config = inject(EsolveConfigService);
6363
+ this.http = inject(HttpClient);
6364
+ this.errorHandler = inject(EsolveErrorHandlerService);
6365
+ this.responseHandler = inject(EsolveResponseHandlerService);
6120
6366
  }
6121
6367
  send(form_data) {
6122
6368
  if (!form_data.has('email')) {
@@ -6131,15 +6377,15 @@ class EsolveEnquiryService {
6131
6377
  return this.errorHandler.handleHttpPostError('set-enquiry', errorRes);
6132
6378
  }));
6133
6379
  }
6134
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveEnquiryService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
6135
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveEnquiryService, providedIn: 'root' }); }
6380
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveEnquiryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6381
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveEnquiryService, providedIn: 'root' }); }
6136
6382
  }
6137
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveEnquiryService, decorators: [{
6383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveEnquiryService, decorators: [{
6138
6384
  type: Injectable,
6139
6385
  args: [{
6140
6386
  providedIn: 'root',
6141
6387
  }]
6142
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
6388
+ }] });
6143
6389
 
6144
6390
  class EsolveWishlistItem {
6145
6391
  constructor(id, qty, vat_rate, price, price_incl, vat_total, total, total_incl, stock_item) {
@@ -6159,11 +6405,11 @@ class EsolveEmptyWishlistResult extends EsolveResponseResult {
6159
6405
  }
6160
6406
 
6161
6407
  class EsolveWishlistService {
6162
- constructor(config, http, errorHandler, responseHandler) {
6163
- this.config = config;
6164
- this.http = http;
6165
- this.errorHandler = errorHandler;
6166
- this.responseHandler = responseHandler;
6408
+ constructor() {
6409
+ this.config = inject(EsolveConfigService);
6410
+ this.http = inject(HttpClient);
6411
+ this.errorHandler = inject(EsolveErrorHandlerService);
6412
+ this.responseHandler = inject(EsolveResponseHandlerService);
6167
6413
  }
6168
6414
  /**
6169
6415
  * Retrieves the current wishlist
@@ -6252,15 +6498,15 @@ class EsolveWishlistService {
6252
6498
  getWishlistRecords(params) {
6253
6499
  return this.http.get(`${this.config.api_url}/get-wishlist.php`, { params });
6254
6500
  }
6255
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveWishlistService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
6256
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveWishlistService, providedIn: 'root' }); }
6501
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveWishlistService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6502
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveWishlistService, providedIn: 'root' }); }
6257
6503
  }
6258
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveWishlistService, decorators: [{
6504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveWishlistService, decorators: [{
6259
6505
  type: Injectable,
6260
6506
  args: [{
6261
6507
  providedIn: 'root',
6262
6508
  }]
6263
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
6509
+ }] });
6264
6510
 
6265
6511
  class EsolveSupplier {
6266
6512
  constructor(record) {
@@ -6290,9 +6536,9 @@ class EsolveSupplier {
6290
6536
  }
6291
6537
 
6292
6538
  class EsolveSuppliersService {
6293
- constructor(config, http) {
6294
- this.config = config;
6295
- this.http = http;
6539
+ constructor() {
6540
+ this.config = inject(EsolveConfigService);
6541
+ this.http = inject(HttpClient);
6296
6542
  }
6297
6543
  getSuppliers(options) {
6298
6544
  let params = new HttpParams();
@@ -6326,15 +6572,15 @@ class EsolveSuppliersService {
6326
6572
  processSuppliers(record) {
6327
6573
  return new EsolveSupplier(record);
6328
6574
  }
6329
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSuppliersService, deps: [{ token: EsolveConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
6330
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSuppliersService, providedIn: 'root' }); }
6575
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSuppliersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
6576
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSuppliersService, providedIn: 'root' }); }
6331
6577
  }
6332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: EsolveSuppliersService, decorators: [{
6578
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: EsolveSuppliersService, decorators: [{
6333
6579
  type: Injectable,
6334
6580
  args: [{
6335
6581
  providedIn: 'root',
6336
6582
  }]
6337
- }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.HttpClient }]; } });
6583
+ }] });
6338
6584
 
6339
6585
  /*
6340
6586
  * Public API Surface of ng-esolve-connect
@@ -6344,5 +6590,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImpor
6344
6590
  * Generated bundle index. Do not edit.
6345
6591
  */
6346
6592
 
6347
- export { ESOLVE_CONNECT_CONFIG, ESOLVE_EURUS_AUTO_LOGIN, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthInterceptorService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveCdnSrcDirective, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveConfigService, EsolveCookieService, EsolveCoupon, EsolveCouponsService, EsolveDependantItem, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErrorHandlerService, esolveFilterFactory as EsolveFilterFactory, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationUpdateResult, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSeoInfo, EsolveSeoService, EsolveSessionMetadataService, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStatement, EsolveStatementAgeing, EsolveStatementBalances, EsolveStatementTransaction, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockService, EsolveSupplier, EsolveSuppliersService, EsolveTag, EsolveTagsService, EsolveTimeSlot, EsolveTimeSlotConfig, EsolveTimeSlotDate, EsolveTimeSlotDays, EsolveTimeSlotTimes, EsolveToggleFilter, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionClient, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionShippingMethod, EsolveTransactionUser, EsolveTransactionsService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveVaultItem, EsolveVaultItemResult, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule, esolveHexHash, isEsolveCdnPath, isFtgCdnPath, isLegacyEsolveCdnPath, processEsolveImageSrc, provideEsolveImageLoader, provideNgEsolveConnect };
6593
+ export { ESOLVE_CONNECT_CONFIG, ESOLVE_EURUS_AUTO_LOGIN, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthInterceptorService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveCdnSrcDirective, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveConfigService, EsolveCookieService, EsolveCoupon, EsolveCouponsService, EsolveDependantItem, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErrorHandlerService, esolveFilterFactory as EsolveFilterFactory, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationUpdateResult, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSeoInfo, EsolveSeoService, EsolveSessionMetadataService, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStatement, EsolveStatementAgeing, EsolveStatementBalances, EsolveStatementTransaction, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockService, EsolveSupplier, EsolveSuppliersService, EsolveTag, EsolveTagsService, EsolveTimeSlot, EsolveTimeSlotConfig, EsolveTimeSlotDate, EsolveTimeSlotDays, EsolveTimeSlotTimes, EsolveToggleFilter, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionClient, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionShippingMethod, EsolveTransactionUser, EsolveTransactionsService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveVaultItem, EsolveVaultItemResult, EsolveVoucher, EsolveVouchersService, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule, esolveHexHash, isEsolveCdnPath, isFtgCdnPath, isLegacyEsolveCdnPath, processEsolveImageSrc, provideEsolveImageLoader, provideNgEsolveConnect };
6348
6594
  //# sourceMappingURL=esolve-ng-esolve-connect.mjs.map