@esolve/ng-esolve-connect 0.38.0 → 0.39.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 (100) hide show
  1. package/esm2020/index.mjs +3 -3
  2. package/esm2020/lib/account/esolve-account.service.mjs +11 -13
  3. package/esm2020/lib/auth/esolve-auth-interceptor.service.mjs +8 -10
  4. package/esm2020/lib/auth/esolve-auth.service.mjs +5 -5
  5. package/esm2020/lib/banners/esolve-banner.service.mjs +7 -9
  6. package/esm2020/lib/cart/esolve-cart.service.mjs +2 -2
  7. package/esm2020/lib/category-tree/esolve-category-tree.service.mjs +7 -9
  8. package/esm2020/lib/core/esolve-config.service.mjs +51 -0
  9. package/esm2020/lib/core/esolve-connect-config.constant.mjs +3 -0
  10. package/esm2020/lib/core/esolve-connect.config.mjs +2 -0
  11. package/esm2020/lib/core/index.mjs +4 -0
  12. package/esm2020/lib/coupons/esolve-coupons.service.mjs +2 -2
  13. package/esm2020/lib/enquiry/esolve-enquiry.service.mjs +9 -11
  14. package/esm2020/lib/images/directives/cdn-src.directive.mjs +72 -0
  15. package/esm2020/lib/images/directives/index.mjs +2 -0
  16. package/esm2020/lib/images/esolve-image-loader.provider.mjs +13 -0
  17. package/esm2020/lib/images/functions/index.mjs +4 -0
  18. package/esm2020/lib/images/functions/is-esolve-cdn-path.function.mjs +5 -0
  19. package/esm2020/lib/images/functions/is-legacy-esolve-cdn-path.function.mjs +5 -0
  20. package/esm2020/lib/images/functions/process-image-src.function.mjs +33 -0
  21. package/esm2020/lib/images/index.mjs +4 -0
  22. package/esm2020/lib/locations/esolve-locations.service.mjs +2 -2
  23. package/esm2020/lib/manufacturers/esolve-manufacturers.service.mjs +7 -9
  24. package/esm2020/lib/menu/classes/esolve-menu-item.model.mjs +3 -1
  25. package/esm2020/lib/menu/esolve-menu.service.mjs +7 -9
  26. package/esm2020/lib/news/esolve-news-article.model.mjs +2 -2
  27. package/esm2020/lib/news/esolve-news-group-record.interface.mjs +1 -1
  28. package/esm2020/lib/news/esolve-news-group.model.mjs +22 -6
  29. package/esm2020/lib/news/esolve-news.service.mjs +14 -12
  30. package/esm2020/lib/ng-esolve-connect.module.mjs +2 -2
  31. package/esm2020/lib/payment/esolve-payment.service.mjs +2 -2
  32. package/esm2020/lib/ranges/esolve-ranges.service.mjs +2 -2
  33. package/esm2020/lib/session/esolve-session-metadata.service.mjs +2 -2
  34. package/esm2020/lib/session/esolve-session.service.mjs +2 -2
  35. package/esm2020/lib/shared/assets/esolve-assets.service.mjs +2 -2
  36. package/esm2020/lib/shared/filters/classes/esolve-range-filter.model.mjs +1 -1
  37. package/esm2020/lib/shared/filters/esolve-filter-factory.mjs +1 -1
  38. package/esm2020/lib/shared/geocoder/esolve-geocoder.service.mjs +2 -2
  39. package/esm2020/lib/shared/seo/esolve-seo.service.mjs +24 -38
  40. package/esm2020/lib/shipping/classes/esolve-shipping-cost.model.mjs +1 -1
  41. package/esm2020/lib/shipping/esolve-shipping.service.mjs +2 -2
  42. package/esm2020/lib/specials/esolve-specials.service.mjs +2 -2
  43. package/esm2020/lib/stock/esolve-stock.service.mjs +2 -2
  44. package/esm2020/lib/suppliers/esolve-suppliers.service.mjs +2 -2
  45. package/esm2020/lib/tags/esolve-tags.service.mjs +2 -2
  46. package/esm2020/lib/topics/esolve-topic.service.mjs +2 -2
  47. package/esm2020/lib/transactions/esolve-transactions.service.mjs +2 -2
  48. package/esm2020/lib/wishlist/esolve-wishlist.service.mjs +2 -2
  49. package/fesm2015/esolve-ng-esolve-connect.mjs +565 -431
  50. package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
  51. package/fesm2020/esolve-ng-esolve-connect.mjs +695 -546
  52. package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
  53. package/index.d.ts +2 -2
  54. package/lib/account/esolve-account.service.d.ts +2 -2
  55. package/lib/auth/esolve-auth-interceptor.service.d.ts +3 -3
  56. package/lib/auth/esolve-auth.service.d.ts +1 -1
  57. package/lib/banners/esolve-banner.service.d.ts +2 -2
  58. package/lib/cart/esolve-cart.service.d.ts +1 -1
  59. package/lib/category-tree/esolve-category-tree.service.d.ts +2 -2
  60. package/lib/core/esolve-config.service.d.ts +22 -0
  61. package/lib/core/esolve-connect.config.d.ts +73 -0
  62. package/lib/core/index.d.ts +3 -0
  63. package/lib/coupons/esolve-coupons.service.d.ts +1 -1
  64. package/lib/enquiry/esolve-enquiry.service.d.ts +2 -2
  65. package/lib/images/directives/cdn-src.directive.d.ts +22 -0
  66. package/lib/images/directives/index.d.ts +1 -0
  67. package/lib/images/esolve-image-loader.provider.d.ts +2 -0
  68. package/lib/images/functions/index.d.ts +3 -0
  69. package/lib/images/functions/is-esolve-cdn-path.function.d.ts +1 -0
  70. package/lib/images/functions/is-legacy-esolve-cdn-path.function.d.ts +1 -0
  71. package/lib/images/functions/process-image-src.function.d.ts +1 -0
  72. package/lib/images/index.d.ts +3 -0
  73. package/lib/locations/esolve-locations.service.d.ts +1 -1
  74. package/lib/manufacturers/esolve-manufacturers.service.d.ts +2 -2
  75. package/lib/menu/classes/esolve-menu-item.model.d.ts +1 -0
  76. package/lib/menu/esolve-menu.service.d.ts +2 -2
  77. package/lib/news/esolve-news-group-record.interface.d.ts +1 -0
  78. package/lib/news/esolve-news-group.model.d.ts +5 -1
  79. package/lib/news/esolve-news.service.d.ts +3 -3
  80. package/lib/ng-esolve-connect.module.d.ts +1 -1
  81. package/lib/payment/esolve-payment.service.d.ts +1 -1
  82. package/lib/ranges/esolve-ranges.service.d.ts +1 -1
  83. package/lib/session/esolve-session-metadata.service.d.ts +1 -1
  84. package/lib/session/esolve-session.service.d.ts +1 -1
  85. package/lib/shared/assets/esolve-assets.service.d.ts +1 -1
  86. package/lib/shared/geocoder/esolve-geocoder.service.d.ts +1 -1
  87. package/lib/shared/seo/esolve-seo.service.d.ts +2 -2
  88. package/lib/shipping/esolve-shipping.service.d.ts +1 -1
  89. package/lib/specials/esolve-specials.service.d.ts +1 -1
  90. package/lib/stock/esolve-stock.service.d.ts +1 -1
  91. package/lib/suppliers/esolve-suppliers.service.d.ts +1 -1
  92. package/lib/tags/esolve-tags.service.d.ts +1 -1
  93. package/lib/topics/esolve-topic.service.d.ts +1 -1
  94. package/lib/transactions/esolve-transactions.service.d.ts +1 -1
  95. package/lib/wishlist/esolve-wishlist.service.d.ts +2 -3
  96. package/package.json +1 -1
  97. package/esm2020/lib/esolve-connect-config.constant.mjs +0 -3
  98. package/esm2020/lib/esolve-connect.config.mjs +0 -2
  99. package/lib/esolve-connect.config.d.ts +0 -55
  100. /package/lib/{esolve-connect-config.constant.d.ts → core/esolve-connect-config.constant.d.ts} +0 -0
@@ -1,16 +1,126 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, PLATFORM_ID, Injectable, Inject, Optional, NgModule } from '@angular/core';
3
- import { isPlatformBrowser, CommonModule } from '@angular/common';
4
- import * as i1$2 from '@angular/common/http';
5
- import { HTTP_INTERCEPTORS, HttpClientModule, HttpErrorResponse, HttpParams, HttpHeaders } from '@angular/common/http';
2
+ import { InjectionToken, Injectable, Inject, PLATFORM_ID, Optional, NgModule, Directive, Input, HostListener } from '@angular/core';
3
+ import { isPlatformBrowser, CommonModule, IMAGE_LOADER } from '@angular/common';
4
+ import * as i1$1 from '@angular/common/http';
5
+ import { HttpErrorResponse, HTTP_INTERCEPTORS, HttpClientModule, HttpParams, HttpHeaders } from '@angular/common/http';
6
6
  import * as i1 from 'ngx-cookie-service';
7
7
  import { CookieService } from 'ngx-cookie-service';
8
8
  import { BehaviorSubject, throwError, of, firstValueFrom, map as map$1, Subject, iif } from 'rxjs';
9
- import * as i1$1 from '@angular/platform-browser';
10
9
  import { map, catchError, tap, switchMap } from 'rxjs/operators';
10
+ import * as i2 from '@angular/platform-browser';
11
11
 
12
12
  const ESOLVE_CONNECT_CONFIG = new InjectionToken('esolve.connect.config');
13
13
 
14
+ class EsolveConfigService {
15
+ constructor(config) {
16
+ this.api_url = '';
17
+ this.wsid = '';
18
+ this.title_separator = '|';
19
+ this.user_session_storage_key = 'ngEslvUserSession';
20
+ this.coupon_storage_key = '_ng_eslv_coupons';
21
+ this.device_designation = 'web';
22
+ if (config.api_url === '' || config.wsid === '') {
23
+ throw new Error('Invalid eSolve Eurus config');
24
+ }
25
+ this.api_url = config.api_url;
26
+ this.wsid = config.wsid;
27
+ this.title_prefix = config.title_prefix ?? '';
28
+ this.title_suffix = config.title_suffix ?? '';
29
+ this.default_seo_title = config.default_seo_title ?? '';
30
+ this.default_seo_description = config.default_seo_description ?? '';
31
+ this.default_seo_keywords = config.default_seo_keywords ?? '';
32
+ this.native = config.native ?? false;
33
+ if (config.user_session_storage_key) {
34
+ this.user_session_storage_key = config.user_session_storage_key;
35
+ }
36
+ if (config.title_separator) {
37
+ this.title_separator = config.title_separator;
38
+ }
39
+ if (config.coupon_storage_key) {
40
+ this.coupon_storage_key = config.coupon_storage_key;
41
+ }
42
+ if (this.native && config.device_designation) {
43
+ this.device_designation = config.device_designation;
44
+ }
45
+ this.legacy_cdn = config.legacy_cdn;
46
+ this.cdn = config.cdn;
47
+ this.error_image_path = config.error_image_path;
48
+ }
49
+ }
50
+ EsolveConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveConfigService, deps: [{ token: ESOLVE_CONNECT_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
51
+ EsolveConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveConfigService, providedIn: 'root' });
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveConfigService, decorators: [{
53
+ type: Injectable,
54
+ args: [{
55
+ providedIn: 'root',
56
+ }]
57
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
58
+ type: Inject,
59
+ args: [ESOLVE_CONNECT_CONFIG]
60
+ }] }]; } });
61
+
62
+ /**
63
+ * Generates a short hexadecimal hash that will be used to indicate a change in
64
+ * state.
65
+ *
66
+ * NOTE: Not to be confused with an actual hash checksum, like MD5 or SHA256.
67
+ * It should only be used to indicate that a state has changed. It should not be
68
+ * used for encryption.
69
+ *
70
+ * @param values Raw strings and numbers to hash
71
+ *
72
+ * @returns Hexadecimal hash value
73
+ */
74
+ function esolveHexHash(...values) {
75
+ // Add an extra value to pad out hash
76
+ values.push('esolve_eurus');
77
+ // Create a string from the values
78
+ const string = values.join('::');
79
+ let hash = 0;
80
+ for (let x = 0; x < string.length; x++) {
81
+ const ch = string.charCodeAt(x);
82
+ hash = (hash << 5) - hash + ch;
83
+ hash = hash & hash;
84
+ }
85
+ return Math.abs(hash).toString(16);
86
+ }
87
+
88
+ class EsolveSession {
89
+ constructor(id = -1, location_id = 0, key = '', expiration_date) {
90
+ this.id = id;
91
+ this.location_id = location_id;
92
+ this.key = key;
93
+ this.expiration_date = expiration_date;
94
+ }
95
+ get expired() {
96
+ const current_date = new Date();
97
+ return (this.expiration_date === undefined ||
98
+ current_date >= this.expiration_date);
99
+ }
100
+ get authenticated() {
101
+ return this.id > 0;
102
+ }
103
+ get valid() {
104
+ return (this.key !== '' &&
105
+ this.expiration_date !== undefined &&
106
+ this.id >= 0);
107
+ }
108
+ updateUser(user_id) {
109
+ this.id = user_id;
110
+ this.state_hash = undefined;
111
+ }
112
+ updateLocation(location_id) {
113
+ this.location_id = location_id;
114
+ this.state_hash = undefined;
115
+ }
116
+ getStateHash() {
117
+ if (!this.state_hash) {
118
+ this.state_hash = esolveHexHash(this.id, this.location_id, this.key);
119
+ }
120
+ return this.state_hash;
121
+ }
122
+ }
123
+
14
124
  class EsolveCookieService {
15
125
  constructor(ngxCookies, platformId, request, response) {
16
126
  this.ngxCookies = ngxCookies;
@@ -117,68 +227,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
117
227
  args: ['RESPONSE']
118
228
  }] }]; } });
119
229
 
120
- /**
121
- * Generates a short hexadecimal hash that will be used to indicate a change in
122
- * state.
123
- *
124
- * NOTE: Not to be confused with an actual hash checksum, like MD5 or SHA256.
125
- * It should only be used to indicate that a state has changed. It should not be
126
- * used for encryption.
127
- *
128
- * @param values Raw strings and numbers to hash
129
- *
130
- * @returns Hexadecimal hash value
131
- */
132
- function esolveHexHash(...values) {
133
- // Add an extra value to pad out hash
134
- values.push('esolve_eurus');
135
- // Create a string from the values
136
- const string = values.join('::');
137
- let hash = 0;
138
- for (let x = 0; x < string.length; x++) {
139
- const ch = string.charCodeAt(x);
140
- hash = (hash << 5) - hash + ch;
141
- hash = hash & hash;
142
- }
143
- return Math.abs(hash).toString(16);
144
- }
145
-
146
- class EsolveSession {
147
- constructor(id = -1, location_id = 0, key = '', expiration_date) {
148
- this.id = id;
149
- this.location_id = location_id;
150
- this.key = key;
151
- this.expiration_date = expiration_date;
152
- }
153
- get expired() {
154
- const current_date = new Date();
155
- return (this.expiration_date === undefined ||
156
- current_date >= this.expiration_date);
157
- }
158
- get authenticated() {
159
- return this.id > 0;
160
- }
161
- get valid() {
162
- return (this.key !== '' &&
163
- this.expiration_date !== undefined &&
164
- this.id >= 0);
165
- }
166
- updateUser(user_id) {
167
- this.id = user_id;
168
- this.state_hash = undefined;
169
- }
170
- updateLocation(location_id) {
171
- this.location_id = location_id;
172
- this.state_hash = undefined;
173
- }
174
- getStateHash() {
175
- if (!this.state_hash) {
176
- this.state_hash = esolveHexHash(this.id, this.location_id, this.key);
177
- }
178
- return this.state_hash;
179
- }
180
- }
181
-
182
230
  class EsolveSessionService {
183
231
  get currentSession() {
184
232
  return this._session.value;
@@ -328,95 +376,420 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
328
376
  args: [ESOLVE_CONNECT_CONFIG]
329
377
  }] }, { type: EsolveCookieService }]; } });
330
378
 
331
- class EsolveAuthInterceptorService {
332
- constructor(config, session) {
333
- this.config = config;
334
- this.session = session;
335
- }
336
- intercept(req, next) {
337
- if (req.url.startsWith(`${this.config.api_url}/`)) {
338
- const service_identifier = req.url.replace(`${this.config.api_url}/`, '');
339
- const modified_url = req.url;
340
- let params = req.params;
341
- let headers = req.headers;
342
- const session = this.session.currentSession;
343
- if (session.valid) {
344
- if (service_identifier !== 'get-access-token.php') {
345
- params = params.set('key', session.key);
346
- }
347
- const state_hash = session.getStateHash();
348
- headers = headers.set('X-Esolve-State-Hash', state_hash);
349
- }
350
- params = params.set('ws_id', this.config.wsid);
351
- if (this.config.native && this.config.device_designation) {
352
- headers = headers.set('X-Device-Designation', this.config.device_designation);
353
- }
354
- const modified_req = req.clone({
355
- url: modified_url,
356
- params,
357
- headers,
358
- });
359
- return next.handle(modified_req);
360
- }
361
- return next.handle(req);
379
+ class EsolveResponseResult {
380
+ constructor(response) {
381
+ this.success_log = [];
382
+ this.error_log = [];
383
+ this.error_log.push(...response.log.filter((log_item) => log_item.type === 'error'));
384
+ this.success_log.push(...response.log.filter((log_item) => log_item.type === 'success'));
362
385
  }
363
- }
364
- EsolveAuthInterceptorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthInterceptorService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: EsolveSessionService }], target: i0.ɵɵFactoryTarget.Injectable });
365
- EsolveAuthInterceptorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthInterceptorService });
366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthInterceptorService, decorators: [{
367
- type: Injectable
368
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
369
- type: Inject,
370
- args: [ESOLVE_CONNECT_CONFIG]
371
- }] }, { type: EsolveSessionService }]; } });
386
+ }
372
387
 
373
- class NgEsolveConnectModule {
374
- static forRoot(config) {
375
- return {
376
- ngModule: NgEsolveConnectModule,
377
- providers: [
378
- {
379
- provide: ESOLVE_CONNECT_CONFIG,
380
- useValue: config,
381
- },
382
- {
383
- provide: HTTP_INTERCEPTORS,
384
- useClass: EsolveAuthInterceptorService,
385
- multi: true,
386
- },
387
- ],
388
- };
388
+ class EsolveResponseHandlerService {
389
+ /**
390
+ * Parse single HTTP response
391
+ *
392
+ * @param http_response HTTP Response to eSolve service
393
+ * @param resultHandler Function to parse response to a result
394
+ *
395
+ * @returns Parsed result of response
396
+ */
397
+ validateSingleHttpResponse(http_response, resultHandler) {
398
+ if (http_response.responses === undefined ||
399
+ http_response.responses.length <= 0) {
400
+ throw http_response;
401
+ }
402
+ const response = http_response.responses[0];
403
+ if (response.status.state === 'error' ||
404
+ response.status.state === 'none') {
405
+ throw response;
406
+ }
407
+ return resultHandler(response);
389
408
  }
390
409
  }
391
- NgEsolveConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
392
- NgEsolveConnectModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule, HttpClientModule] });
393
- NgEsolveConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, providers: [CookieService], imports: [CommonModule, HttpClientModule] });
394
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, decorators: [{
395
- type: NgModule,
410
+ EsolveResponseHandlerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveResponseHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
411
+ EsolveResponseHandlerServiceprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveResponseHandlerService, providedIn: 'root' });
412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveResponseHandlerService, decorators: [{
413
+ type: Injectable,
396
414
  args: [{
397
- declarations: [],
398
- imports: [CommonModule, HttpClientModule],
399
- providers: [CookieService],
400
- exports: [],
415
+ providedIn: 'root',
401
416
  }]
402
417
  }] });
403
418
 
404
- class EsolveList {
405
- constructor(items = [], page = 0, rows = 0, total = 0) {
406
- this.items = items;
407
- this.page = page;
408
- this.rows = rows;
409
- this.total = total;
419
+ class EsolveHttpError extends Error {
420
+ constructor(type, code, message, ...params) {
421
+ // Pass remaining arguments (including vendor specific ones) to parent constructor
422
+ super(...[message, ...params]);
423
+ this.http_error = true;
424
+ // Maintains proper stack trace for where our error was thrown (only available on V8)
425
+ if (Error.captureStackTrace) {
426
+ Error.captureStackTrace(this, EsolveHttpError);
427
+ }
428
+ this.name = 'EsolveHttpError';
429
+ this.type = type;
430
+ this.error_code = code;
410
431
  }
411
432
  }
412
433
 
413
- class EsolveResult {
414
- constructor(status, code, message) {
415
- this.status = status;
416
- this.code = code;
417
- this.message = message;
418
- }
419
- }
434
+ class EsolveErrorHandlerService {
435
+ throwError(code, message) {
436
+ throw new EsolveHttpError('error', code, message);
437
+ }
438
+ emitError(code, message) {
439
+ return throwError(() => new EsolveHttpError('error', code, message));
440
+ }
441
+ handleHttpPostError(service_type, errorRes) {
442
+ if (!(errorRes instanceof HttpErrorResponse) &&
443
+ !('service_type' in errorRes) &&
444
+ 'id' in errorRes &&
445
+ 'esolve_id' in errorRes &&
446
+ 'transaction_type' in errorRes &&
447
+ 'status' in errorRes &&
448
+ 'log' in errorRes) {
449
+ return throwError(() => this.parsePostErrors(errorRes));
450
+ }
451
+ return this.handleHttpError(service_type, errorRes);
452
+ }
453
+ handleHttpDeleteError(service_type, errorRes) {
454
+ const is_not_base = !(errorRes instanceof HttpErrorResponse) &&
455
+ !('service_type' in errorRes) &&
456
+ 'id' in errorRes &&
457
+ 'status' in errorRes &&
458
+ 'message' in errorRes &&
459
+ 'code' in errorRes;
460
+ if (is_not_base) {
461
+ return throwError(() => this.parseDeleteError(errorRes));
462
+ }
463
+ return this.handleHttpError(service_type, errorRes);
464
+ }
465
+ handleHttpError(service_type, error_response) {
466
+ if (error_response instanceof HttpErrorResponse) {
467
+ if (error_response.status === 500) {
468
+ const server_error = error_response.error;
469
+ if ('service_type' in server_error &&
470
+ server_error.service_type === service_type) {
471
+ return throwError(() => this.parseException(server_error));
472
+ }
473
+ }
474
+ }
475
+ else {
476
+ if ('service_type' in error_response &&
477
+ error_response.service_type === service_type) {
478
+ if (error_response.type === 'exception') {
479
+ return throwError(() => this.parseException(error_response));
480
+ }
481
+ else if (error_response.type === 'error') {
482
+ return throwError(() => this.parseResponseError(error_response));
483
+ }
484
+ }
485
+ }
486
+ return throwError(() => error_response);
487
+ }
488
+ parseException(exception) {
489
+ const error = new EsolveHttpError('exception', exception.additional_data.exception_type || 'unknown', exception.message || 'Unknown exception has occurred');
490
+ return error;
491
+ }
492
+ parseResponseError(exception) {
493
+ const error = new EsolveHttpError('error', exception.code || 'unknown', exception.message || 'Unknown error has occurred');
494
+ return error;
495
+ }
496
+ parsePostErrors(response) {
497
+ let error_code = 'unknown';
498
+ let message = 'Unknown error has occurred';
499
+ if (response.status.state === 'none' && response.log.length > 0) {
500
+ error_code = 'no_response';
501
+ message = 'Response was provided';
502
+ }
503
+ else if (response.status.state === 'error') {
504
+ const login_error_log = response.log[0];
505
+ error_code = login_error_log.message_code;
506
+ message = login_error_log.message;
507
+ }
508
+ return new EsolveHttpError('error', error_code, message);
509
+ }
510
+ parseDeleteError(result) {
511
+ return new EsolveHttpError('error', result.code, result.message);
512
+ }
513
+ }
514
+ EsolveErrorHandlerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
515
+ EsolveErrorHandlerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveErrorHandlerService, providedIn: 'root' });
516
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveErrorHandlerService, decorators: [{
517
+ type: Injectable,
518
+ args: [{
519
+ providedIn: 'root',
520
+ }]
521
+ }] });
522
+
523
+ class EsolveResult {
524
+ constructor(status, code, message) {
525
+ this.status = status;
526
+ this.code = code;
527
+ this.message = message;
528
+ }
529
+ }
530
+
531
+ class EsolveSessionMetadataService {
532
+ constructor(config, http, errorHandler, responseHandler) {
533
+ this.config = config;
534
+ this.http = http;
535
+ this.errorHandler = errorHandler;
536
+ this.responseHandler = responseHandler;
537
+ }
538
+ set(type, metadata) {
539
+ return this.http
540
+ .post(`${this.config.api_url}/set-sessions-metadata.php`, metadata, {
541
+ headers: {
542
+ 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;',
543
+ },
544
+ responseType: 'json',
545
+ observe: 'body',
546
+ params: { type },
547
+ })
548
+ .pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveResponseResult(response))), catchError((errorRes) => {
549
+ return this.errorHandler.handleHttpPostError('set-sessions-metadata', errorRes);
550
+ }));
551
+ }
552
+ get(type) {
553
+ return this.http
554
+ .get(`${this.config.api_url}/get-sessions-metadata.php`, {
555
+ params: { type },
556
+ })
557
+ .pipe(map((response) => {
558
+ if (response.records === undefined ||
559
+ (Array.isArray(response.records) &&
560
+ response.records.length === 0)) {
561
+ throw response;
562
+ }
563
+ return response.records;
564
+ }));
565
+ }
566
+ delete(type) {
567
+ return this.http
568
+ .delete(`${this.config.api_url}/delete-sessions-metadata.php`, {
569
+ params: { type },
570
+ responseType: 'json',
571
+ observe: 'body',
572
+ })
573
+ .pipe(map((http_response) => {
574
+ if (http_response.result === undefined ||
575
+ http_response.result === null ||
576
+ http_response.result.status !== 'success') {
577
+ throw http_response;
578
+ }
579
+ return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
580
+ }), catchError((errorRes) => {
581
+ return this.errorHandler.handleHttpDeleteError('delete-sessions-metadata', errorRes);
582
+ }));
583
+ }
584
+ }
585
+ EsolveSessionMetadataService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSessionMetadataService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
586
+ EsolveSessionMetadataService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSessionMetadataService, providedIn: 'root' });
587
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSessionMetadataService, decorators: [{
588
+ type: Injectable,
589
+ args: [{
590
+ providedIn: 'root',
591
+ }]
592
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
593
+ type: Inject,
594
+ args: [ESOLVE_CONNECT_CONFIG]
595
+ }] }, { type: i1$1.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
596
+
597
+ class EsolveAuthInterceptorService {
598
+ constructor(config, session) {
599
+ this.config = config;
600
+ this.session = session;
601
+ }
602
+ intercept(req, next) {
603
+ if (req.url.startsWith(`${this.config.api_url}/`)) {
604
+ const service_identifier = req.url.replace(`${this.config.api_url}/`, '');
605
+ const modified_url = req.url;
606
+ let params = req.params;
607
+ let headers = req.headers;
608
+ const session = this.session.currentSession;
609
+ if (session.valid) {
610
+ if (service_identifier !== 'get-access-token.php') {
611
+ params = params.set('key', session.key);
612
+ }
613
+ const state_hash = session.getStateHash();
614
+ headers = headers.set('X-Esolve-State-Hash', state_hash);
615
+ }
616
+ params = params.set('ws_id', this.config.wsid);
617
+ if (this.config.native && this.config.device_designation) {
618
+ headers = headers.set('X-Device-Designation', this.config.device_designation);
619
+ }
620
+ const modified_req = req.clone({
621
+ url: modified_url,
622
+ params,
623
+ headers,
624
+ });
625
+ return next.handle(modified_req);
626
+ }
627
+ return next.handle(req);
628
+ }
629
+ }
630
+ EsolveAuthInterceptorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthInterceptorService, deps: [{ token: EsolveConfigService }, { token: EsolveSessionService }], target: i0.ɵɵFactoryTarget.Injectable });
631
+ EsolveAuthInterceptorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthInterceptorService });
632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthInterceptorService, decorators: [{
633
+ type: Injectable
634
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: EsolveSessionService }]; } });
635
+
636
+ class NgEsolveConnectModule {
637
+ static forRoot(config) {
638
+ return {
639
+ ngModule: NgEsolveConnectModule,
640
+ providers: [
641
+ {
642
+ provide: ESOLVE_CONNECT_CONFIG,
643
+ useValue: config,
644
+ },
645
+ {
646
+ provide: HTTP_INTERCEPTORS,
647
+ useClass: EsolveAuthInterceptorService,
648
+ multi: true,
649
+ },
650
+ ],
651
+ };
652
+ }
653
+ }
654
+ NgEsolveConnectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
655
+ NgEsolveConnectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, imports: [CommonModule, HttpClientModule] });
656
+ NgEsolveConnectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, providers: [CookieService], imports: [CommonModule, HttpClientModule] });
657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: NgEsolveConnectModule, decorators: [{
658
+ type: NgModule,
659
+ args: [{
660
+ declarations: [],
661
+ imports: [CommonModule, HttpClientModule],
662
+ providers: [CookieService],
663
+ exports: [],
664
+ }]
665
+ }] });
666
+
667
+ function isEsolveCdnPath(path) {
668
+ const cdn_regex = /^\/?images\/(?:stock|media|news|assets|banners|documents|manufacturers|ranges|categories|subcategories|tags)\//;
669
+ return cdn_regex.test(path);
670
+ }
671
+
672
+ function isLegacyEsolveCdnPath(path) {
673
+ const cdn_regex = /^\/?images\/(?:media|news|assets|banners|documents|manufacturers|ranges|categories|subcategories|tags)\//;
674
+ return cdn_regex.test(path);
675
+ }
676
+
677
+ function isAbsoluteUrl(src) {
678
+ return /^https?:\/\//.test(src);
679
+ }
680
+ function normalizePath(path) {
681
+ return path.endsWith('/') ? path.slice(0, -1) : path;
682
+ }
683
+ function normalizeSrc(src) {
684
+ return src.startsWith('/') ? src.slice(1) : src;
685
+ }
686
+ function processEsolveImageSrc(src, cdn_url = '', legacy_cdn_url = '') {
687
+ if (isAbsoluteUrl(src)) {
688
+ return src;
689
+ }
690
+ cdn_url = normalizePath(cdn_url);
691
+ legacy_cdn_url = normalizePath(legacy_cdn_url);
692
+ if (cdn_url === '') {
693
+ return src;
694
+ }
695
+ if (legacy_cdn_url === '') {
696
+ legacy_cdn_url = cdn_url;
697
+ }
698
+ if (!isEsolveCdnPath(src)) {
699
+ return src;
700
+ }
701
+ src = normalizeSrc(src);
702
+ if (isLegacyEsolveCdnPath(src)) {
703
+ return `${legacy_cdn_url}/${src}`;
704
+ }
705
+ return `${cdn_url}/${src}`;
706
+ }
707
+
708
+ const ESOLVE_IMAGE_LOADER_PROVIDER = {
709
+ provide: IMAGE_LOADER,
710
+ useFactory: (esolveConfig) => {
711
+ return (config) => {
712
+ return processEsolveImageSrc(config.src, esolveConfig.cdn, esolveConfig.legacy_cdn);
713
+ };
714
+ },
715
+ deps: [EsolveConfigService],
716
+ };
717
+
718
+ /**
719
+ * An alternative to optimised images to load a new image
720
+ */
721
+ class EsolveCdnSrcDirective {
722
+ constructor(el, config) {
723
+ this.el = el;
724
+ this.config = config;
725
+ this.src = '';
726
+ this.no_image = false;
727
+ this.error_image_path = '/assets/no_image.jpg';
728
+ if (this.config.error_image_path) {
729
+ this.error_image_path = this.config.error_image_path;
730
+ }
731
+ if (this.isImage(this.el.nativeElement)) {
732
+ this.el.nativeElement.loading = 'lazy';
733
+ }
734
+ }
735
+ ngOnChanges() {
736
+ this.init();
737
+ }
738
+ onError() {
739
+ this.setErrorImage();
740
+ }
741
+ init() {
742
+ this.no_image = false;
743
+ if (this.src === '') {
744
+ this.setErrorImage();
745
+ return;
746
+ }
747
+ const image_src = processEsolveImageSrc(this.src, this.config.cdn, this.config.legacy_cdn);
748
+ this.setSrc(image_src);
749
+ }
750
+ setSrc(src) {
751
+ if (this.isImage(this.el.nativeElement)) {
752
+ this.el.nativeElement.src = src;
753
+ }
754
+ else {
755
+ this.el.nativeElement.srcset = src;
756
+ }
757
+ }
758
+ setErrorImage() {
759
+ if (this.no_image) {
760
+ return;
761
+ }
762
+ this.setSrc(this.error_image_path);
763
+ this.no_image = true;
764
+ }
765
+ isImage(el) {
766
+ return 'loading' in this.el.nativeElement;
767
+ }
768
+ }
769
+ EsolveCdnSrcDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCdnSrcDirective, deps: [{ token: i0.ElementRef }, { token: EsolveConfigService }], target: i0.ɵɵFactoryTarget.Directive });
770
+ EsolveCdnSrcDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: EsolveCdnSrcDirective, isStandalone: true, selector: "[eslvCdnSrc]", inputs: { src: ["eslvCdnSrc", "src"] }, host: { listeners: { "error": "onError()" } }, usesOnChanges: true, ngImport: i0 });
771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCdnSrcDirective, decorators: [{
772
+ type: Directive,
773
+ args: [{
774
+ selector: '[eslvCdnSrc]',
775
+ standalone: true,
776
+ }]
777
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: EsolveConfigService }]; }, propDecorators: { src: [{
778
+ type: Input,
779
+ args: ['eslvCdnSrc']
780
+ }], onError: [{
781
+ type: HostListener,
782
+ args: ['error']
783
+ }] } });
784
+
785
+ class EsolveList {
786
+ constructor(items = [], page = 0, rows = 0, total = 0) {
787
+ this.items = items;
788
+ this.page = page;
789
+ this.rows = rows;
790
+ this.total = total;
791
+ }
792
+ }
420
793
 
421
794
  class EsolveMultipleSelectFilter {
422
795
  constructor(field, options) {
@@ -534,236 +907,92 @@ class EsolveToggleFilter {
534
907
  }
535
908
  toHttpParams(http_params) {
536
909
  const base_property = `filter[${this.field}]`;
537
- const type_property = base_property + '[type]';
538
- const values_property = base_property + '[value]';
539
- const params = {
540
- [type_property]: this.type,
541
- [values_property]: this.value ? 1 : 0,
542
- };
543
- if (http_params) {
544
- return http_params.appendAll(params);
545
- }
546
- return params;
547
- }
548
- }
549
-
550
- // Classes
551
-
552
- // Interfaces
553
-
554
- // Types
555
-
556
- function createRangeWithValue(field, min = 0, max = 0) {
557
- const filter = new EsolveRangeFilter(field);
558
- filter.setValue(min, max);
559
- return filter;
560
- }
561
- function createSingleSelectWithValue(field, value) {
562
- const filter = new EsolveSingleSelectFilter(field, value);
563
- return filter;
564
- }
565
- function createToggleSelectWithValue(field, value) {
566
- const filter = new EsolveToggleFilter(field, value);
567
- return filter;
568
- }
569
- function createMultipleSelectWithValue(field, value) {
570
- const filter = new EsolveMultipleSelectFilter(field);
571
- filter.setValue(value);
572
- return filter;
573
- }
574
- function covertFromObj(obj) {
575
- const filters = [];
576
- for (const field in obj) {
577
- const value = obj[field];
578
- let filter = null;
579
- if (Array.isArray(value)) {
580
- filter = createMultipleSelectWithValue(field, value);
581
- }
582
- else if (typeof value === 'object') {
583
- filter = createRangeWithValue(field, value.min, value.max);
584
- }
585
- else if (typeof value === 'boolean') {
586
- filter = createToggleSelectWithValue(field, value);
587
- }
588
- else {
589
- filter = createSingleSelectWithValue(field, value);
590
- }
591
- if (filter) {
592
- filters.push(filter);
593
- }
594
- }
595
- return filters;
596
- }
597
- function convertToHttpParams(filters, http_params) {
598
- if (http_params) {
599
- for (const filter of filters) {
600
- http_params = filter.toHttpParams(http_params);
601
- }
602
- return http_params;
603
- }
604
- let params = {};
605
- for (const filter of filters) {
606
- params = {
607
- ...params,
608
- ...filter.toHttpParams(),
609
- };
610
- }
611
- return params;
612
- }
613
-
614
- var esolveFilterFactory = /*#__PURE__*/Object.freeze({
615
- __proto__: null,
616
- convertToHttpParams: convertToHttpParams,
617
- covertFromObj: covertFromObj,
618
- createMultipleSelectWithValue: createMultipleSelectWithValue,
619
- createRangeWithValue: createRangeWithValue,
620
- createSingleSelectWithValue: createSingleSelectWithValue,
621
- createToggleSelectWithValue: createToggleSelectWithValue
622
- });
623
-
624
- class EsolveResponseResult {
625
- constructor(response) {
626
- this.success_log = [];
627
- this.error_log = [];
628
- this.error_log.push(...response.log.filter((log_item) => log_item.type === 'error'));
629
- this.success_log.push(...response.log.filter((log_item) => log_item.type === 'success'));
630
- }
631
- }
632
-
633
- class EsolveResponseHandlerService {
634
- /**
635
- * Parse single HTTP response
636
- *
637
- * @param http_response HTTP Response to eSolve service
638
- * @param resultHandler Function to parse response to a result
639
- *
640
- * @returns Parsed result of response
641
- */
642
- validateSingleHttpResponse(http_response, resultHandler) {
643
- if (http_response.responses === undefined ||
644
- http_response.responses.length <= 0) {
645
- throw http_response;
646
- }
647
- const response = http_response.responses[0];
648
- if (response.status.state === 'error' ||
649
- response.status.state === 'none') {
650
- throw response;
651
- }
652
- return resultHandler(response);
653
- }
654
- }
655
- EsolveResponseHandlerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveResponseHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
656
- EsolveResponseHandlerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveResponseHandlerService, providedIn: 'root' });
657
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveResponseHandlerService, decorators: [{
658
- type: Injectable,
659
- args: [{
660
- providedIn: 'root',
661
- }]
662
- }] });
663
-
664
- class EsolveHttpError extends Error {
665
- constructor(type, code, message, ...params) {
666
- // Pass remaining arguments (including vendor specific ones) to parent constructor
667
- super(...[message, ...params]);
668
- this.http_error = true;
669
- // Maintains proper stack trace for where our error was thrown (only available on V8)
670
- if (Error.captureStackTrace) {
671
- Error.captureStackTrace(this, EsolveHttpError);
672
- }
673
- this.name = 'EsolveHttpError';
674
- this.type = type;
675
- this.error_code = code;
676
- }
677
- }
678
-
679
- class EsolveErrorHandlerService {
680
- throwError(code, message) {
681
- throw new EsolveHttpError('error', code, message);
682
- }
683
- emitError(code, message) {
684
- return throwError(() => new EsolveHttpError('error', code, message));
685
- }
686
- handleHttpPostError(service_type, errorRes) {
687
- if (!(errorRes instanceof HttpErrorResponse) &&
688
- !('service_type' in errorRes) &&
689
- 'id' in errorRes &&
690
- 'esolve_id' in errorRes &&
691
- 'transaction_type' in errorRes &&
692
- 'status' in errorRes &&
693
- 'log' in errorRes) {
694
- return throwError(() => this.parsePostErrors(errorRes));
910
+ const type_property = base_property + '[type]';
911
+ const values_property = base_property + '[value]';
912
+ const params = {
913
+ [type_property]: this.type,
914
+ [values_property]: this.value ? 1 : 0,
915
+ };
916
+ if (http_params) {
917
+ return http_params.appendAll(params);
695
918
  }
696
- return this.handleHttpError(service_type, errorRes);
919
+ return params;
697
920
  }
698
- handleHttpDeleteError(service_type, errorRes) {
699
- const is_not_base = !(errorRes instanceof HttpErrorResponse) &&
700
- !('service_type' in errorRes) &&
701
- 'id' in errorRes &&
702
- 'status' in errorRes &&
703
- 'message' in errorRes &&
704
- 'code' in errorRes;
705
- if (is_not_base) {
706
- return throwError(() => this.parseDeleteError(errorRes));
921
+ }
922
+
923
+ // Classes
924
+
925
+ // Interfaces
926
+
927
+ // Types
928
+
929
+ function createRangeWithValue(field, min = 0, max = 0) {
930
+ const filter = new EsolveRangeFilter(field);
931
+ filter.setValue(min, max);
932
+ return filter;
933
+ }
934
+ function createSingleSelectWithValue(field, value) {
935
+ const filter = new EsolveSingleSelectFilter(field, value);
936
+ return filter;
937
+ }
938
+ function createToggleSelectWithValue(field, value) {
939
+ const filter = new EsolveToggleFilter(field, value);
940
+ return filter;
941
+ }
942
+ function createMultipleSelectWithValue(field, value) {
943
+ const filter = new EsolveMultipleSelectFilter(field);
944
+ filter.setValue(value);
945
+ return filter;
946
+ }
947
+ function covertFromObj(obj) {
948
+ const filters = [];
949
+ for (const field in obj) {
950
+ const value = obj[field];
951
+ let filter = null;
952
+ if (Array.isArray(value)) {
953
+ filter = createMultipleSelectWithValue(field, value);
707
954
  }
708
- return this.handleHttpError(service_type, errorRes);
709
- }
710
- handleHttpError(service_type, error_response) {
711
- if (error_response instanceof HttpErrorResponse) {
712
- if (error_response.status === 500) {
713
- const server_error = error_response.error;
714
- if ('service_type' in server_error &&
715
- server_error.service_type === service_type) {
716
- return throwError(() => this.parseException(server_error));
717
- }
718
- }
955
+ else if (typeof value === 'object') {
956
+ filter = createRangeWithValue(field, value.min, value.max);
957
+ }
958
+ else if (typeof value === 'boolean') {
959
+ filter = createToggleSelectWithValue(field, value);
719
960
  }
720
961
  else {
721
- if ('service_type' in error_response &&
722
- error_response.service_type === service_type) {
723
- if (error_response.type === 'exception') {
724
- return throwError(() => this.parseException(error_response));
725
- }
726
- else if (error_response.type === 'error') {
727
- return throwError(() => this.parseResponseError(error_response));
728
- }
729
- }
962
+ filter = createSingleSelectWithValue(field, value);
730
963
  }
731
- return throwError(() => error_response);
732
- }
733
- parseException(exception) {
734
- const error = new EsolveHttpError('exception', exception.additional_data.exception_type || 'unknown', exception.message || 'Unknown exception has occurred');
735
- return error;
736
- }
737
- parseResponseError(exception) {
738
- const error = new EsolveHttpError('error', exception.code || 'unknown', exception.message || 'Unknown error has occurred');
739
- return error;
740
- }
741
- parsePostErrors(response) {
742
- let error_code = 'unknown';
743
- let message = 'Unknown error has occurred';
744
- if (response.status.state === 'none' && response.log.length > 0) {
745
- error_code = 'no_response';
746
- message = 'Response was provided';
964
+ if (filter) {
965
+ filters.push(filter);
747
966
  }
748
- else if (response.status.state === 'error') {
749
- const login_error_log = response.log[0];
750
- error_code = login_error_log.message_code;
751
- message = login_error_log.message;
967
+ }
968
+ return filters;
969
+ }
970
+ function convertToHttpParams(filters, http_params) {
971
+ if (http_params) {
972
+ for (const filter of filters) {
973
+ http_params = filter.toHttpParams(http_params);
752
974
  }
753
- return new EsolveHttpError('error', error_code, message);
975
+ return http_params;
754
976
  }
755
- parseDeleteError(result) {
756
- return new EsolveHttpError('error', result.code, result.message);
977
+ let params = {};
978
+ for (const filter of filters) {
979
+ params = {
980
+ ...params,
981
+ ...filter.toHttpParams(),
982
+ };
757
983
  }
758
- }
759
- EsolveErrorHandlerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
760
- EsolveErrorHandlerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveErrorHandlerService, providedIn: 'root' });
761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveErrorHandlerService, decorators: [{
762
- type: Injectable,
763
- args: [{
764
- providedIn: 'root',
765
- }]
766
- }] });
984
+ return params;
985
+ }
986
+
987
+ var esolveFilterFactory = /*#__PURE__*/Object.freeze({
988
+ __proto__: null,
989
+ convertToHttpParams: convertToHttpParams,
990
+ covertFromObj: covertFromObj,
991
+ createMultipleSelectWithValue: createMultipleSelectWithValue,
992
+ createRangeWithValue: createRangeWithValue,
993
+ createSingleSelectWithValue: createSingleSelectWithValue,
994
+ createToggleSelectWithValue: createToggleSelectWithValue
995
+ });
767
996
 
768
997
  // Types
769
998
 
@@ -802,24 +1031,12 @@ class EsolveSeoService {
802
1031
  this.setPageKeywordsTags(seoInfo.keywords);
803
1032
  }
804
1033
  init() {
805
- if (typeof this.config.title_prefix !== 'undefined') {
806
- this.title_prefix = this.config.title_prefix;
807
- }
808
- if (typeof this.config.title_suffix !== 'undefined') {
809
- this.title_suffix = this.config.title_suffix;
810
- }
811
- if (typeof this.config.title_separator !== 'undefined') {
812
- this.title_separator = this.config.title_separator;
813
- }
814
- if (typeof this.config.default_seo_title !== 'undefined') {
815
- this.default_seo_title = this.config.default_seo_title;
816
- }
817
- if (typeof this.config.default_seo_description !== 'undefined') {
818
- this.default_seo_description = this.config.default_seo_description;
819
- }
820
- if (typeof this.config.default_seo_keywords !== 'undefined') {
821
- this.default_seo_keywords = this.config.default_seo_keywords;
822
- }
1034
+ this.title_prefix = this.config.title_prefix;
1035
+ this.title_suffix = this.config.title_suffix;
1036
+ this.title_separator = this.config.title_separator;
1037
+ this.default_seo_title = this.config.default_seo_title;
1038
+ this.default_seo_description = this.config.default_seo_description;
1039
+ this.default_seo_keywords = this.config.default_seo_keywords;
823
1040
  }
824
1041
  setPageTitleTags(title) {
825
1042
  this.title.setTitle(title);
@@ -835,12 +1052,12 @@ class EsolveSeoService {
835
1052
  setPageKeywordsTags(keywords) {
836
1053
  this.meta.updateTag({ name: 'keywords', content: keywords });
837
1054
  }
838
- validateAndSanitizeSeoInfo(seoInfo) {
1055
+ validateAndSanitizeSeoInfo(seo_info) {
839
1056
  const pageSeo = new EsolveSeoInfo(this.default_seo_title, this.default_seo_description, this.default_seo_keywords);
840
- if (seoInfo.description.trim() !== '') {
841
- pageSeo.description = seoInfo.description;
1057
+ if (seo_info.description.trim() !== '') {
1058
+ pageSeo.description = seo_info.description;
842
1059
  }
843
- if (seoInfo.title.trim() !== '') {
1060
+ if (seo_info.title.trim() !== '') {
844
1061
  const titlePartsArray = [];
845
1062
  if (this.title_prefix !== '') {
846
1063
  titlePartsArray.push(this.title_prefix);
@@ -848,7 +1065,7 @@ class EsolveSeoService {
848
1065
  titlePartsArray.push(this.title_separator);
849
1066
  }
850
1067
  }
851
- titlePartsArray.push(seoInfo.title);
1068
+ titlePartsArray.push(seo_info.title);
852
1069
  if (this.title_suffix !== '') {
853
1070
  if (this.title_separator !== '') {
854
1071
  titlePartsArray.push(this.title_separator);
@@ -856,9 +1073,9 @@ class EsolveSeoService {
856
1073
  titlePartsArray.push(this.title_suffix);
857
1074
  }
858
1075
  pageSeo.title = titlePartsArray.join(' ');
859
- if (seoInfo.keywords.trim() === '') {
860
- const clean_title = seoInfo.title
861
- .replace(/[^a-zA-Z0-9. ]+/gi, '')
1076
+ if (seo_info.keywords.trim() === '') {
1077
+ const clean_title = seo_info.title
1078
+ .replace(/[^a-z0-9. ]+/gi, '')
862
1079
  .trim();
863
1080
  const keywords = clean_title.split(' ');
864
1081
  const clean_keywords = [];
@@ -871,26 +1088,23 @@ class EsolveSeoService {
871
1088
  }
872
1089
  }
873
1090
  }
874
- seoInfo.keywords = clean_keywords.join(',');
1091
+ seo_info.keywords = clean_keywords.join(',');
875
1092
  }
876
1093
  }
877
- if (seoInfo.keywords.trim() !== '') {
878
- pageSeo.keywords = seoInfo.keywords;
1094
+ if (seo_info.keywords.trim() !== '') {
1095
+ pageSeo.keywords = seo_info.keywords;
879
1096
  }
880
1097
  return pageSeo;
881
1098
  }
882
1099
  }
883
- EsolveSeoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSeoService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.Title }, { token: i1$1.Meta }], target: i0.ɵɵFactoryTarget.Injectable });
1100
+ EsolveSeoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSeoService, deps: [{ token: EsolveConfigService }, { token: i2.Title }, { token: i2.Meta }], target: i0.ɵɵFactoryTarget.Injectable });
884
1101
  EsolveSeoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSeoService, providedIn: 'root' });
885
1102
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSeoService, decorators: [{
886
1103
  type: Injectable,
887
1104
  args: [{
888
1105
  providedIn: 'root',
889
1106
  }]
890
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
891
- type: Inject,
892
- args: [ESOLVE_CONNECT_CONFIG]
893
- }] }, { type: i1$1.Title }, { type: i1$1.Meta }]; } });
1107
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i2.Title }, { type: i2.Meta }]; } });
894
1108
 
895
1109
  class EsolveGeocodeAddressResult {
896
1110
  constructor(street_number, street, suburb, city, province, country, postal_code) {
@@ -973,7 +1187,7 @@ class EsolveGeocoderService {
973
1187
  return geocode_result;
974
1188
  }
975
1189
  }
976
- EsolveGeocoderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveGeocoderService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1190
+ EsolveGeocoderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveGeocoderService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
977
1191
  EsolveGeocoderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveGeocoderService, providedIn: 'root' });
978
1192
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveGeocoderService, decorators: [{
979
1193
  type: Injectable,
@@ -983,7 +1197,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
983
1197
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
984
1198
  type: Inject,
985
1199
  args: [ESOLVE_CONNECT_CONFIG]
986
- }] }, { type: i1$2.HttpClient }]; } });
1200
+ }] }, { type: i1$1.HttpClient }]; } });
987
1201
 
988
1202
  class EsolveLinkedAsset {
989
1203
  constructor(record) {
@@ -1177,17 +1391,14 @@ class EsolveCategoryTreeService {
1177
1391
  return null;
1178
1392
  }
1179
1393
  }
1180
- EsolveCategoryTreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCategoryTreeService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1394
+ EsolveCategoryTreeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCategoryTreeService, deps: [{ token: EsolveConfigService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1181
1395
  EsolveCategoryTreeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCategoryTreeService, providedIn: 'root' });
1182
1396
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCategoryTreeService, decorators: [{
1183
1397
  type: Injectable,
1184
1398
  args: [{
1185
1399
  providedIn: 'root',
1186
1400
  }]
1187
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1188
- type: Inject,
1189
- args: [ESOLVE_CONNECT_CONFIG]
1190
- }] }, { type: i1$2.HttpClient }]; } });
1401
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i1$1.HttpClient }]; } });
1191
1402
 
1192
1403
  class EsolveManufacturer {
1193
1404
  get original_image_src() {
@@ -1302,17 +1513,14 @@ class EsolveManufacturersService {
1302
1513
  return new EsolveManufacturer(record);
1303
1514
  }
1304
1515
  }
1305
- EsolveManufacturersService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveManufacturersService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1516
+ EsolveManufacturersService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveManufacturersService, deps: [{ token: EsolveConfigService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1306
1517
  EsolveManufacturersService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveManufacturersService, providedIn: 'root' });
1307
1518
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveManufacturersService, decorators: [{
1308
1519
  type: Injectable,
1309
1520
  args: [{
1310
1521
  providedIn: 'root',
1311
1522
  }]
1312
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1313
- type: Inject,
1314
- args: [ESOLVE_CONNECT_CONFIG]
1315
- }] }, { type: i1$2.HttpClient }]; } });
1523
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i1$1.HttpClient }]; } });
1316
1524
 
1317
1525
  // Types
1318
1526
 
@@ -1425,7 +1633,7 @@ class EsolveRangesService {
1425
1633
  return new EsolveRange(record);
1426
1634
  }
1427
1635
  }
1428
- EsolveRangesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveRangesService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1636
+ EsolveRangesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveRangesService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1429
1637
  EsolveRangesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveRangesService, providedIn: 'root' });
1430
1638
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveRangesService, decorators: [{
1431
1639
  type: Injectable,
@@ -1435,7 +1643,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1435
1643
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1436
1644
  type: Inject,
1437
1645
  args: [ESOLVE_CONNECT_CONFIG]
1438
- }] }, { type: i1$2.HttpClient }]; } });
1646
+ }] }, { type: i1$1.HttpClient }]; } });
1439
1647
 
1440
1648
  class EsolveTag {
1441
1649
  /**
@@ -1531,7 +1739,7 @@ class EsolveTagsService {
1531
1739
  return tags;
1532
1740
  }
1533
1741
  }
1534
- EsolveTagsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTagsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1742
+ EsolveTagsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTagsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1535
1743
  EsolveTagsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTagsService, providedIn: 'root' });
1536
1744
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTagsService, decorators: [{
1537
1745
  type: Injectable,
@@ -1541,7 +1749,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1541
1749
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1542
1750
  type: Inject,
1543
1751
  args: [ESOLVE_CONNECT_CONFIG]
1544
- }] }, { type: i1$2.HttpClient }]; } });
1752
+ }] }, { type: i1$1.HttpClient }]; } });
1545
1753
 
1546
1754
  // Types
1547
1755
 
@@ -1596,7 +1804,7 @@ class EsolveTopicService {
1596
1804
  return topics;
1597
1805
  }
1598
1806
  }
1599
- EsolveTopicService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTopicService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1807
+ EsolveTopicService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTopicService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1600
1808
  EsolveTopicService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTopicService, providedIn: 'root' });
1601
1809
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTopicService, decorators: [{
1602
1810
  type: Injectable,
@@ -1606,7 +1814,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1606
1814
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1607
1815
  type: Inject,
1608
1816
  args: [ESOLVE_CONNECT_CONFIG]
1609
- }] }, { type: i1$2.HttpClient }]; } });
1817
+ }] }, { type: i1$1.HttpClient }]; } });
1610
1818
 
1611
1819
  class EsolveAsset {
1612
1820
  /**
@@ -1762,7 +1970,7 @@ class EsolveAssetsService {
1762
1970
  return params;
1763
1971
  }
1764
1972
  }
1765
- EsolveAssetsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAssetsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1973
+ EsolveAssetsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAssetsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1766
1974
  EsolveAssetsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAssetsService, providedIn: 'root' });
1767
1975
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAssetsService, decorators: [{
1768
1976
  type: Injectable,
@@ -1772,76 +1980,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
1772
1980
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1773
1981
  type: Inject,
1774
1982
  args: [ESOLVE_CONNECT_CONFIG]
1775
- }] }, { type: i1$2.HttpClient }]; } });
1983
+ }] }, { type: i1$1.HttpClient }]; } });
1776
1984
 
1777
1985
  // Types
1778
1986
 
1779
- class EsolveSessionMetadataService {
1780
- constructor(config, http, errorHandler, responseHandler) {
1781
- this.config = config;
1782
- this.http = http;
1783
- this.errorHandler = errorHandler;
1784
- this.responseHandler = responseHandler;
1785
- }
1786
- set(type, metadata) {
1787
- return this.http
1788
- .post(`${this.config.api_url}/set-sessions-metadata.php`, metadata, {
1789
- headers: {
1790
- 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;',
1791
- },
1792
- responseType: 'json',
1793
- observe: 'body',
1794
- params: { type },
1795
- })
1796
- .pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => new EsolveResponseResult(response))), catchError((errorRes) => {
1797
- return this.errorHandler.handleHttpPostError('set-sessions-metadata', errorRes);
1798
- }));
1799
- }
1800
- get(type) {
1801
- return this.http
1802
- .get(`${this.config.api_url}/get-sessions-metadata.php`, {
1803
- params: { type },
1804
- })
1805
- .pipe(map((response) => {
1806
- if (response.records === undefined ||
1807
- (Array.isArray(response.records) &&
1808
- response.records.length === 0)) {
1809
- throw response;
1810
- }
1811
- return response.records;
1812
- }));
1813
- }
1814
- delete(type) {
1815
- return this.http
1816
- .delete(`${this.config.api_url}/delete-sessions-metadata.php`, {
1817
- params: { type },
1818
- responseType: 'json',
1819
- observe: 'body',
1820
- })
1821
- .pipe(map((http_response) => {
1822
- if (http_response.result === undefined ||
1823
- http_response.result === null ||
1824
- http_response.result.status !== 'success') {
1825
- throw http_response;
1826
- }
1827
- return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
1828
- }), catchError((errorRes) => {
1829
- return this.errorHandler.handleHttpDeleteError('delete-sessions-metadata', errorRes);
1830
- }));
1831
- }
1832
- }
1833
- EsolveSessionMetadataService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSessionMetadataService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
1834
- EsolveSessionMetadataService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSessionMetadataService, providedIn: 'root' });
1835
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSessionMetadataService, decorators: [{
1836
- type: Injectable,
1837
- args: [{
1838
- providedIn: 'root',
1839
- }]
1840
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1841
- type: Inject,
1842
- args: [ESOLVE_CONNECT_CONFIG]
1843
- }] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
1844
-
1845
1987
  class EsolveAuthService {
1846
1988
  constructor(config, http, session, errorHandler, cookieService) {
1847
1989
  this.config = config;
@@ -1949,14 +2091,14 @@ class EsolveAuthService {
1949
2091
  try {
1950
2092
  const session = this.session.getCachedSession();
1951
2093
  if (!session) {
1952
- throw null;
2094
+ throw new Error('Invalid session');
1953
2095
  }
1954
2096
  const result = await firstValueFrom(this.checkAccessToken(session));
1955
2097
  if (!result.key) {
1956
- throw null;
2098
+ throw new Error('Invalid key');
1957
2099
  }
1958
2100
  if (session.id !== result.user_id) {
1959
- throw null;
2101
+ throw new Error('Invalid authentication');
1960
2102
  }
1961
2103
  valid = true;
1962
2104
  }
@@ -2027,7 +2169,7 @@ class EsolveAuthService {
2027
2169
  return throwError(() => error);
2028
2170
  }
2029
2171
  }
2030
- EsolveAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable });
2172
+ EsolveAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable });
2031
2173
  EsolveAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthService, providedIn: 'root' });
2032
2174
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAuthService, decorators: [{
2033
2175
  type: Injectable,
@@ -2037,7 +2179,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2037
2179
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2038
2180
  type: Inject,
2039
2181
  args: [ESOLVE_CONNECT_CONFIG]
2040
- }] }, { type: i1$2.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveCookieService }]; } });
2182
+ }] }, { type: i1$1.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveCookieService }]; } });
2041
2183
 
2042
2184
  class EsolveAddress {
2043
2185
  constructor(id, recipient, address_type, pobox, place_name, street_number, street, suburb, city, province, country, postal_code, latitude, longitude) {
@@ -2564,7 +2706,7 @@ class EsolveLocationsService {
2564
2706
  return stock_locations;
2565
2707
  }
2566
2708
  }
2567
- EsolveLocationsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveLocationsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2709
+ EsolveLocationsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveLocationsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2568
2710
  EsolveLocationsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveLocationsService, providedIn: 'root' });
2569
2711
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveLocationsService, decorators: [{
2570
2712
  type: Injectable,
@@ -2574,7 +2716,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2574
2716
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2575
2717
  type: Inject,
2576
2718
  args: [ESOLVE_CONNECT_CONFIG]
2577
- }] }, { type: i1$2.HttpClient }]; } });
2719
+ }] }, { type: i1$1.HttpClient }]; } });
2578
2720
 
2579
2721
  class EsolveTransactionLocation extends EsolveLocation {
2580
2722
  }
@@ -2771,7 +2913,7 @@ class EsolveTransactionsService {
2771
2913
  return transactions;
2772
2914
  }
2773
2915
  }
2774
- EsolveTransactionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTransactionsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
2916
+ EsolveTransactionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTransactionsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
2775
2917
  EsolveTransactionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTransactionsService, providedIn: 'root' });
2776
2918
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveTransactionsService, decorators: [{
2777
2919
  type: Injectable,
@@ -2781,7 +2923,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2781
2923
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2782
2924
  type: Inject,
2783
2925
  args: [ESOLVE_CONNECT_CONFIG]
2784
- }] }, { type: i1$2.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
2926
+ }] }, { type: i1$1.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
2785
2927
 
2786
2928
  class EsolveEmptyCartResult extends EsolveResponseResult {
2787
2929
  }
@@ -3157,7 +3299,7 @@ class EsolveCouponsService {
3157
3299
  return coupons;
3158
3300
  }
3159
3301
  }
3160
- EsolveCouponsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCouponsService, deps: [{ token: PLATFORM_ID }, { token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable });
3302
+ EsolveCouponsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCouponsService, deps: [{ token: PLATFORM_ID }, { token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable });
3161
3303
  EsolveCouponsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCouponsService, providedIn: 'root' });
3162
3304
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCouponsService, decorators: [{
3163
3305
  type: Injectable,
@@ -3170,7 +3312,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
3170
3312
  }] }, { type: undefined, decorators: [{
3171
3313
  type: Inject,
3172
3314
  args: [ESOLVE_CONNECT_CONFIG]
3173
- }] }, { type: i1$2.HttpClient }, { type: EsolveCookieService }]; } });
3315
+ }] }, { type: i1$1.HttpClient }, { type: EsolveCookieService }]; } });
3174
3316
 
3175
3317
  // Classes
3176
3318
 
@@ -3381,7 +3523,7 @@ class EsolveCartService {
3381
3523
  return cart_totals;
3382
3524
  }
3383
3525
  }
3384
- EsolveCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCartService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }, { token: EsolveCouponsService }], target: i0.ɵɵFactoryTarget.Injectable });
3526
+ EsolveCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCartService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }, { token: EsolveCouponsService }], target: i0.ɵɵFactoryTarget.Injectable });
3385
3527
  EsolveCartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCartService, providedIn: 'root' });
3386
3528
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveCartService, decorators: [{
3387
3529
  type: Injectable,
@@ -3391,7 +3533,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
3391
3533
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
3392
3534
  type: Inject,
3393
3535
  args: [ESOLVE_CONNECT_CONFIG]
3394
- }] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }, { type: EsolveCouponsService }]; } });
3536
+ }] }, { type: i1$1.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }, { type: EsolveCouponsService }]; } });
3395
3537
 
3396
3538
  class EsolveAccountService {
3397
3539
  get user_id() {
@@ -3755,7 +3897,7 @@ class EsolveAccountService {
3755
3897
  }
3756
3898
  processClientBalances(records) {
3757
3899
  for (const record of records) {
3758
- if (!(+record.clients_id > 0)) {
3900
+ if (+record.clients_id <= 0) {
3759
3901
  return undefined;
3760
3902
  }
3761
3903
  const cart_totals = new EsolveCartTotals(record.cart_totals.records, +record.cart_totals.items, +record.cart_totals.total, +record.cart_totals.vat, +record.cart_totals.discount);
@@ -3788,17 +3930,14 @@ class EsolveAccountService {
3788
3930
  })));
3789
3931
  }
3790
3932
  }
3791
- EsolveAccountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAccountService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
3933
+ EsolveAccountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAccountService, deps: [{ token: EsolveConfigService }, { token: i1$1.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
3792
3934
  EsolveAccountService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAccountService, providedIn: 'root' });
3793
3935
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveAccountService, decorators: [{
3794
3936
  type: Injectable,
3795
3937
  args: [{
3796
3938
  providedIn: 'root',
3797
3939
  }]
3798
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
3799
- type: Inject,
3800
- args: [ESOLVE_CONNECT_CONFIG]
3801
- }] }, { type: i1$2.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
3940
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i1$1.HttpClient }, { type: EsolveSessionService }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
3802
3941
 
3803
3942
  class EsolveBanner {
3804
3943
  constructor(id, banner_display_container, identifier, type, title, article, sort_priority, link, images) {
@@ -3930,17 +4069,14 @@ class EsolveBannerService {
3930
4069
  return banners;
3931
4070
  }
3932
4071
  }
3933
- EsolveBannerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveBannerService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
4072
+ EsolveBannerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveBannerService, deps: [{ token: EsolveConfigService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3934
4073
  EsolveBannerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveBannerService, providedIn: 'root' });
3935
4074
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveBannerService, decorators: [{
3936
4075
  type: Injectable,
3937
4076
  args: [{
3938
4077
  providedIn: 'root',
3939
4078
  }]
3940
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
3941
- type: Inject,
3942
- args: [ESOLVE_CONNECT_CONFIG]
3943
- }] }, { type: i1$2.HttpClient }]; } });
4079
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i1$1.HttpClient }]; } });
3944
4080
 
3945
4081
  // Types
3946
4082
 
@@ -3951,6 +4087,7 @@ class EsolveMenuItem {
3951
4087
  this.url = '';
3952
4088
  this.name = '';
3953
4089
  this.module = '';
4090
+ this.sort_priority = 0;
3954
4091
  this.target = '_self';
3955
4092
  this.children = [];
3956
4093
  if (record) {
@@ -3959,6 +4096,7 @@ class EsolveMenuItem {
3959
4096
  this.url = record.sef_url ?? '';
3960
4097
  this.name = record.name ?? '';
3961
4098
  this.module = record.module ?? '';
4099
+ this.sort_priority = +(record.sort_priority ?? 0);
3962
4100
  if (record.target &&
3963
4101
  (record.target === '_self' || record.target === '_blank')) {
3964
4102
  this.target = record.target;
@@ -4001,24 +4139,37 @@ class EsolveMenuService {
4001
4139
  return menu;
4002
4140
  }
4003
4141
  }
4004
- EsolveMenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveMenuService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
4142
+ EsolveMenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveMenuService, deps: [{ token: EsolveConfigService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
4005
4143
  EsolveMenuService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveMenuService, providedIn: 'root' });
4006
4144
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveMenuService, decorators: [{
4007
4145
  type: Injectable,
4008
4146
  args: [{
4009
4147
  providedIn: 'root',
4010
4148
  }]
4011
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
4012
- type: Inject,
4013
- args: [ESOLVE_CONNECT_CONFIG]
4014
- }] }, { type: i1$2.HttpClient }]; } });
4149
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i1$1.HttpClient }]; } });
4015
4150
 
4016
4151
  class EsolveNewsGroup {
4017
- constructor(id, name, description, sef_name) {
4018
- this.id = id;
4019
- this.name = name;
4020
- this.description = description;
4021
- this.sef_name = sef_name;
4152
+ get image_src() {
4153
+ return this.getImagePath();
4154
+ }
4155
+ constructor(record) {
4156
+ this.id = 0;
4157
+ this.name = '';
4158
+ this.description = '';
4159
+ this.sef_name = '';
4160
+ this.id = +record.id;
4161
+ this.name = record.name;
4162
+ this.description = record.description;
4163
+ this.sef_name = record.sef_name;
4164
+ if (record.image && record.image !== '') {
4165
+ this.image = record.image;
4166
+ }
4167
+ }
4168
+ getImagePath() {
4169
+ if (!this.image) {
4170
+ return '';
4171
+ }
4172
+ return `/images/assets/${this.image}`;
4022
4173
  }
4023
4174
  }
4024
4175
 
@@ -4066,7 +4217,7 @@ class EsolveNewsArticle {
4066
4217
  seo_keywords = record.seo_keywords ?? '';
4067
4218
  if (record.news_group) {
4068
4219
  const group_record = record.news_group;
4069
- this.group = new EsolveNewsGroup(+group_record.id, group_record.name, group_record.description, group_record.sef_name);
4220
+ this.group = new EsolveNewsGroup(group_record);
4070
4221
  }
4071
4222
  if (record.user) {
4072
4223
  this.author = new EsolveNewsArticleAuthor(record.user.userid, record.user.email, record.user.firstname, record.user.surname);
@@ -4141,16 +4292,20 @@ class EsolveNewsService {
4141
4292
  return new EsolveNewsArticleList(news_articles, total_records, page);
4142
4293
  }));
4143
4294
  }
4144
- getNewsGroups() {
4295
+ getNewsGroups(enable_images = false) {
4145
4296
  return this.http
4146
- .get(`${this.config.api_url}/get-news-groups.php`)
4297
+ .get(`${this.config.api_url}/get-news-groups.php`, {
4298
+ params: {
4299
+ enable_images,
4300
+ },
4301
+ })
4147
4302
  .pipe(map((response) => {
4148
4303
  if (response.records === undefined) {
4149
4304
  throw response;
4150
4305
  }
4151
4306
  const news_groups = [];
4152
4307
  for (const record of response.records) {
4153
- news_groups.push(new EsolveNewsGroup(record.id, record.name, record.description, record.sef_name));
4308
+ news_groups.push(new EsolveNewsGroup(record));
4154
4309
  }
4155
4310
  return news_groups;
4156
4311
  }));
@@ -4199,17 +4354,14 @@ class EsolveNewsService {
4199
4354
  return params;
4200
4355
  }
4201
4356
  }
4202
- EsolveNewsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveNewsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
4357
+ EsolveNewsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveNewsService, deps: [{ token: EsolveConfigService }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
4203
4358
  EsolveNewsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveNewsService, providedIn: 'root' });
4204
4359
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveNewsService, decorators: [{
4205
4360
  type: Injectable,
4206
4361
  args: [{
4207
4362
  providedIn: 'root',
4208
4363
  }]
4209
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
4210
- type: Inject,
4211
- args: [ESOLVE_CONNECT_CONFIG]
4212
- }] }, { type: i1$2.HttpClient }]; } });
4364
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i1$1.HttpClient }]; } });
4213
4365
 
4214
4366
  // Types
4215
4367
 
@@ -5178,7 +5330,7 @@ class EsolveStockService {
5178
5330
  return this.http.get(`${this.config.api_url}/get-items-transaction-history.php`, { params });
5179
5331
  }
5180
5332
  }
5181
- EsolveStockService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveStockService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
5333
+ EsolveStockService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveStockService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
5182
5334
  EsolveStockService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveStockService, providedIn: 'root' });
5183
5335
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveStockService, decorators: [{
5184
5336
  type: Injectable,
@@ -5188,7 +5340,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
5188
5340
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
5189
5341
  type: Inject,
5190
5342
  args: [ESOLVE_CONNECT_CONFIG]
5191
- }] }, { type: i1$2.HttpClient }]; } });
5343
+ }] }, { type: i1$1.HttpClient }]; } });
5192
5344
 
5193
5345
  class EsolveSpecialImage {
5194
5346
  constructor(record) {
@@ -5328,7 +5480,7 @@ class EsolveSpecialsService {
5328
5480
  return new EsolveSpecial(record);
5329
5481
  }
5330
5482
  }
5331
- EsolveSpecialsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSpecialsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
5483
+ EsolveSpecialsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSpecialsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
5332
5484
  EsolveSpecialsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSpecialsService, providedIn: 'root' });
5333
5485
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSpecialsService, decorators: [{
5334
5486
  type: Injectable,
@@ -5338,7 +5490,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
5338
5490
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
5339
5491
  type: Inject,
5340
5492
  args: [ESOLVE_CONNECT_CONFIG]
5341
- }] }, { type: i1$2.HttpClient }]; } });
5493
+ }] }, { type: i1$1.HttpClient }]; } });
5342
5494
 
5343
5495
  // Only export the types that are accessible to the public API
5344
5496
 
@@ -5674,7 +5826,7 @@ class EsolvePaymentService {
5674
5826
  return `${month_string}${year_string}`;
5675
5827
  }
5676
5828
  }
5677
- EsolvePaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolvePaymentService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
5829
+ EsolvePaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolvePaymentService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
5678
5830
  EsolvePaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolvePaymentService, providedIn: 'root' });
5679
5831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolvePaymentService, decorators: [{
5680
5832
  type: Injectable,
@@ -5684,7 +5836,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
5684
5836
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
5685
5837
  type: Inject,
5686
5838
  args: [ESOLVE_CONNECT_CONFIG]
5687
- }] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
5839
+ }] }, { type: i1$1.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
5688
5840
 
5689
5841
  class EsolveShippingTotals {
5690
5842
  constructor(total, vat, savings) {
@@ -5946,7 +6098,7 @@ class EsolveShippingService {
5946
6098
  return shipping_cost;
5947
6099
  }
5948
6100
  }
5949
- EsolveShippingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveShippingService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
6101
+ EsolveShippingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveShippingService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
5950
6102
  EsolveShippingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveShippingService, providedIn: 'root' });
5951
6103
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveShippingService, decorators: [{
5952
6104
  type: Injectable,
@@ -5956,7 +6108,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
5956
6108
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
5957
6109
  type: Inject,
5958
6110
  args: [ESOLVE_CONNECT_CONFIG]
5959
- }] }, { type: i1$2.HttpClient }]; } });
6111
+ }] }, { type: i1$1.HttpClient }]; } });
5960
6112
 
5961
6113
  class EsolveEnquiryResult extends EsolveResponseResult {
5962
6114
  constructor(response) {
@@ -5987,17 +6139,14 @@ class EsolveEnquiryService {
5987
6139
  }));
5988
6140
  }
5989
6141
  }
5990
- EsolveEnquiryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveEnquiryService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
6142
+ EsolveEnquiryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveEnquiryService, deps: [{ token: EsolveConfigService }, { token: i1$1.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
5991
6143
  EsolveEnquiryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveEnquiryService, providedIn: 'root' });
5992
6144
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveEnquiryService, decorators: [{
5993
6145
  type: Injectable,
5994
6146
  args: [{
5995
6147
  providedIn: 'root',
5996
6148
  }]
5997
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
5998
- type: Inject,
5999
- args: [ESOLVE_CONNECT_CONFIG]
6000
- }] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
6149
+ }], ctorParameters: function () { return [{ type: EsolveConfigService }, { type: i1$1.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
6001
6150
 
6002
6151
  class EsolveWishlistItem {
6003
6152
  constructor(id, qty, vat_rate, price, price_incl, vat_total, total, total_incl, stock_item) {
@@ -6111,7 +6260,7 @@ class EsolveWishlistService {
6111
6260
  return this.http.get(`${this.config.api_url}/get-wishlist.php`, { params });
6112
6261
  }
6113
6262
  }
6114
- EsolveWishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveWishlistService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
6263
+ EsolveWishlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveWishlistService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
6115
6264
  EsolveWishlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveWishlistService, providedIn: 'root' });
6116
6265
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveWishlistService, decorators: [{
6117
6266
  type: Injectable,
@@ -6121,7 +6270,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
6121
6270
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
6122
6271
  type: Inject,
6123
6272
  args: [ESOLVE_CONNECT_CONFIG]
6124
- }] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
6273
+ }] }, { type: i1$1.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }]; } });
6125
6274
 
6126
6275
  class EsolveSupplier {
6127
6276
  constructor(record) {
@@ -6188,7 +6337,7 @@ class EsolveSuppliersService {
6188
6337
  return new EsolveSupplier(record);
6189
6338
  }
6190
6339
  }
6191
- EsolveSuppliersService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSuppliersService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
6340
+ EsolveSuppliersService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSuppliersService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
6192
6341
  EsolveSuppliersService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSuppliersService, providedIn: 'root' });
6193
6342
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: EsolveSuppliersService, decorators: [{
6194
6343
  type: Injectable,
@@ -6198,7 +6347,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
6198
6347
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
6199
6348
  type: Inject,
6200
6349
  args: [ESOLVE_CONNECT_CONFIG]
6201
- }] }, { type: i1$2.HttpClient }]; } });
6350
+ }] }, { type: i1$1.HttpClient }]; } });
6202
6351
 
6203
6352
  /*
6204
6353
  * Public API Surface of ng-esolve-connect
@@ -6208,5 +6357,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
6208
6357
  * Generated bundle index. Do not edit.
6209
6358
  */
6210
6359
 
6211
- export { ESOLVE_CONNECT_CONFIG, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, 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, EsolveSession, 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 };
6360
+ export { ESOLVE_CONNECT_CONFIG, ESOLVE_IMAGE_LOADER_PROVIDER, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, 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, EsolveSession, 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, isLegacyEsolveCdnPath, processEsolveImageSrc };
6212
6361
  //# sourceMappingURL=esolve-ng-esolve-connect.mjs.map