@igo2/core 1.8.2 → 1.9.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 (147) hide show
  1. package/__ivy_ngcc__/locale/en.common.json +43 -43
  2. package/__ivy_ngcc__/locale/en.core.json +23 -23
  3. package/__ivy_ngcc__/locale/en.geo.json +15 -3
  4. package/__ivy_ngcc__/locale/en.integration.json +31 -3
  5. package/__ivy_ngcc__/locale/en.json +45 -5
  6. package/__ivy_ngcc__/locale/fr.common.json +43 -43
  7. package/__ivy_ngcc__/locale/fr.core.json +23 -23
  8. package/__ivy_ngcc__/locale/fr.geo.json +16 -4
  9. package/__ivy_ngcc__/locale/fr.integration.json +33 -4
  10. package/__ivy_ngcc__/locale/fr.json +46 -6
  11. package/bundles/igo2-core.umd.js +1492 -1441
  12. package/bundles/igo2-core.umd.js.map +1 -1
  13. package/esm2015/igo2-core.js +5 -5
  14. package/esm2015/lib/activity/activity.interceptor.js +30 -31
  15. package/esm2015/lib/activity/activity.module.js +30 -29
  16. package/esm2015/lib/activity/activity.service.js +33 -33
  17. package/esm2015/lib/activity/index.js +3 -3
  18. package/esm2015/lib/analytics/index.js +2 -2
  19. package/esm2015/lib/analytics/shared/analytics.interface.js +2 -1
  20. package/esm2015/lib/analytics/shared/analytics.service.js +74 -75
  21. package/esm2015/lib/analytics/shared/index.js +3 -3
  22. package/esm2015/lib/config/config.interface.js +2 -1
  23. package/esm2015/lib/config/config.module.js +23 -22
  24. package/esm2015/lib/config/config.provider.js +21 -21
  25. package/esm2015/lib/config/config.service.js +52 -52
  26. package/esm2015/lib/config/index.js +4 -4
  27. package/esm2015/lib/config/version.js +5 -5
  28. package/esm2015/lib/core.module.js +71 -72
  29. package/esm2015/lib/gesture/gesture.module.js +30 -29
  30. package/esm2015/lib/gesture/gesture.provider.js +16 -17
  31. package/esm2015/lib/language/index.js +2 -2
  32. package/esm2015/lib/language/language.module.js +41 -40
  33. package/esm2015/lib/language/shared/index.js +5 -5
  34. package/esm2015/lib/language/shared/language.interface.js +2 -1
  35. package/esm2015/lib/language/shared/language.loader.js +28 -28
  36. package/esm2015/lib/language/shared/language.provider.js +22 -22
  37. package/esm2015/lib/language/shared/language.service.js +28 -29
  38. package/esm2015/lib/language/shared/missing-translation.guard.js +16 -16
  39. package/esm2015/lib/media/index.js +3 -3
  40. package/esm2015/lib/media/media.enum.js +12 -12
  41. package/esm2015/lib/media/media.service.js +76 -76
  42. package/esm2015/lib/message/index.js +3 -3
  43. package/esm2015/lib/message/message-center/index.js +2 -2
  44. package/esm2015/lib/message/message-center/message-center.component.js +43 -43
  45. package/esm2015/lib/message/message.module.js +27 -26
  46. package/esm2015/lib/message/shared/index.js +4 -4
  47. package/esm2015/lib/message/shared/message.enum.js +8 -8
  48. package/esm2015/lib/message/shared/message.interface.js +2 -1
  49. package/esm2015/lib/message/shared/message.service.js +130 -132
  50. package/esm2015/lib/network/index.js +3 -3
  51. package/esm2015/lib/network/network.interfaces.js +2 -1
  52. package/esm2015/lib/network/network.service.js +59 -60
  53. package/esm2015/lib/request/error.interceptor.js +62 -63
  54. package/esm2015/lib/request/error.module.js +39 -38
  55. package/esm2015/lib/request/index.js +3 -3
  56. package/esm2015/lib/request/logging.interceptor.js +29 -29
  57. package/esm2015/lib/request/logging.module.js +30 -29
  58. package/esm2015/lib/route/route.interface.js +2 -1
  59. package/esm2015/lib/route/route.service.js +55 -56
  60. package/esm2015/lib/storage/index.js +3 -3
  61. package/esm2015/lib/storage/storage.interface.js +13 -13
  62. package/esm2015/lib/storage/storage.service.js +79 -80
  63. package/esm2015/public_api.js +26 -26
  64. package/fesm2015/igo2-core.js +1029 -1016
  65. package/fesm2015/igo2-core.js.map +1 -1
  66. package/igo2-core.d.ts +5 -5
  67. package/lib/activity/activity.interceptor.d.ts +11 -11
  68. package/lib/activity/activity.module.d.ts +8 -7
  69. package/lib/activity/activity.service.d.ts +11 -11
  70. package/lib/activity/index.d.ts +2 -2
  71. package/lib/analytics/index.d.ts +1 -1
  72. package/lib/analytics/shared/analytics.interface.d.ts +6 -6
  73. package/lib/analytics/shared/analytics.service.d.ts +19 -19
  74. package/lib/analytics/shared/index.d.ts +2 -2
  75. package/lib/config/config.interface.d.ts +6 -6
  76. package/lib/config/config.module.d.ts +8 -7
  77. package/lib/config/config.provider.d.ts +15 -15
  78. package/lib/config/config.service.d.ts +18 -18
  79. package/lib/config/index.d.ts +3 -3
  80. package/lib/config/version.d.ts +5 -5
  81. package/lib/core.module.d.ts +18 -17
  82. package/lib/gesture/gesture.module.d.ts +9 -8
  83. package/lib/gesture/gesture.provider.d.ts +7 -7
  84. package/lib/language/index.d.ts +1 -1
  85. package/lib/language/language.module.d.ts +9 -8
  86. package/lib/language/shared/index.d.ts +4 -4
  87. package/lib/language/shared/language.interface.d.ts +3 -3
  88. package/lib/language/shared/language.loader.d.ts +11 -11
  89. package/lib/language/shared/language.provider.d.ts +15 -15
  90. package/lib/language/shared/language.service.d.ts +11 -11
  91. package/lib/language/shared/missing-translation.guard.d.ts +4 -4
  92. package/lib/media/index.d.ts +2 -2
  93. package/lib/media/media.enum.d.ts +9 -9
  94. package/lib/media/media.service.d.ts +16 -16
  95. package/lib/message/index.d.ts +2 -2
  96. package/lib/message/message-center/index.d.ts +1 -1
  97. package/lib/message/message-center/message-center.component.d.ts +19 -19
  98. package/lib/message/message.module.d.ts +11 -10
  99. package/lib/message/shared/index.d.ts +4 -4
  100. package/lib/message/shared/message.enum.d.ts +6 -6
  101. package/lib/message/shared/message.interface.d.ts +18 -18
  102. package/lib/message/shared/message.service.d.ts +25 -25
  103. package/lib/network/index.d.ts +2 -2
  104. package/lib/network/network.interfaces.d.ts +3 -3
  105. package/lib/network/network.service.d.ts +20 -20
  106. package/lib/request/error.interceptor.d.ts +16 -16
  107. package/lib/request/error.module.d.ts +9 -8
  108. package/lib/request/index.d.ts +2 -2
  109. package/lib/request/logging.interceptor.d.ts +8 -8
  110. package/lib/request/logging.module.d.ts +8 -7
  111. package/lib/route/route.interface.d.ts +22 -22
  112. package/lib/route/route.service.d.ts +18 -18
  113. package/lib/storage/index.d.ts +2 -2
  114. package/lib/storage/storage.interface.d.ts +20 -20
  115. package/lib/storage/storage.service.d.ts +19 -19
  116. package/locale/en.common.json +43 -43
  117. package/locale/en.core.json +23 -23
  118. package/locale/en.geo.json +15 -3
  119. package/locale/en.integration.json +31 -3
  120. package/locale/en.json +45 -5
  121. package/locale/fr.common.json +43 -43
  122. package/locale/fr.core.json +23 -23
  123. package/locale/fr.geo.json +16 -4
  124. package/locale/fr.integration.json +33 -4
  125. package/locale/fr.json +46 -6
  126. package/package.json +8 -8
  127. package/public_api.d.ts +22 -22
  128. package/style/all.theming.scss +0 -7655
  129. package/style/core.theming.scss +0 -43
  130. package/style/foreground.scss +1 -1
  131. package/style/index.theming.scss +1006 -0
  132. package/style/material.font.scss +9 -9
  133. package/style/partial/core.variables.scss +3 -3
  134. package/style/partial/media.scss +80 -80
  135. package/style/setup.scss +1 -0
  136. package/style/themes/blue.theme.scss +16 -11
  137. package/style/themes/bluedq.theme.scss +49 -43
  138. package/style/themes/bluegrey.theme.scss +15 -8
  139. package/style/themes/dark.theme.scss +15 -8
  140. package/style/themes/deeppurple.theme.scss +15 -8
  141. package/style/themes/indigo.theme.scss +15 -8
  142. package/style/themes/orange.theme.scss +15 -8
  143. package/style/themes/teal.theme.scss +15 -8
  144. package/style/theming.scss +2 -7180
  145. package/style/typography.scss +14 -14
  146. package/bundles/igo2-core.umd.min.js +0 -17
  147. package/bundles/igo2-core.umd.min.js.map +0 -1
@@ -1,1078 +1,1091 @@
1
- import { ɵɵdefineInjectable, ɵsetClassMetadata, Injectable, ɵɵinject, ɵɵdefineNgModule, ɵɵdefineInjector, NgModule, Injector, InjectionToken, APP_INITIALIZER, ɵɵsetNgModuleScope, ɵɵdefineComponent, ɵɵelement, ɵɵproperty, ɵɵpureFunction1, Component, Input, Optional, SkipSelf, ɵɵgetInheritedFactory, Inject, EventEmitter } from '@angular/core';
2
- import { NgClass, CommonModule } from '@angular/common';
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Component, Input, Optional, SkipSelf, Inject, EventEmitter } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
3
5
  import { HTTP_INTERCEPTORS, HttpClient, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
4
- import { DomSanitizer, HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
5
- import { MatIconRegistry } from '@angular/material/icon';
6
6
  import { finalize, catchError, map, tap, debounceTime, startWith } from 'rxjs/operators';
7
7
  import { BehaviorSubject, throwError, of, combineLatest, fromEvent } from 'rxjs';
8
8
  import { uuid, ObjectUtils } from '@igo2/utils';
9
- import { TranslateLoader, TranslateModule, MissingTranslationHandler, TranslateService } from '@ngx-translate/core';
10
- import { SimpleNotificationsComponent, SimpleNotificationsModule, NotificationsService } from 'angular2-notifications';
11
- import { ActivatedRoute } from '@angular/router';
12
- import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
9
+ import * as i1 from '@ngx-translate/core';
10
+ import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
11
+ import * as i1$1 from '@igo2/angular2-notifications';
12
+ import { SimpleNotificationsModule } from '@igo2/angular2-notifications';
13
+ import * as i1$2 from '@angular/material/icon';
14
+ import * as i2$1 from '@angular/platform-browser';
15
+ import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
16
+ import * as i1$3 from '@angular/router';
17
+ import * as i1$4 from '@angular/cdk/layout';
18
+ import { Breakpoints } from '@angular/cdk/layout';
13
19
 
14
- class ActivityService {
15
- constructor() {
16
- this.counter$ = new BehaviorSubject(0);
17
- this.ids = [];
18
- }
19
- register() {
20
- const id = uuid();
21
- this.ids.push(id);
22
- this.counter$.next(this.ids.length);
23
- return id;
24
- }
25
- unregister(id) {
26
- const index = this.ids.indexOf(id);
27
- if (index === -1) {
28
- return;
29
- }
30
- this.ids.splice(index, 1);
31
- this.counter$.next(this.ids.length);
32
- }
33
- }
34
- ActivityService.ɵfac = function ActivityService_Factory(t) { return new (t || ActivityService)(); };
35
- ActivityService.ɵprov = ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac, providedIn: 'root' });
36
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ActivityService, [{
37
- type: Injectable,
38
- args: [{
39
- providedIn: 'root'
40
- }]
20
+ class ActivityService {
21
+ constructor() {
22
+ this.counter$ = new BehaviorSubject(0);
23
+ this.ids = [];
24
+ }
25
+ register() {
26
+ const id = uuid();
27
+ this.ids.push(id);
28
+ this.counter$.next(this.ids.length);
29
+ return id;
30
+ }
31
+ unregister(id) {
32
+ const index = this.ids.indexOf(id);
33
+ if (index === -1) {
34
+ return;
35
+ }
36
+ this.ids.splice(index, 1);
37
+ this.counter$.next(this.ids.length);
38
+ }
39
+ }
40
+ ActivityService.ɵfac = function ActivityService_Factory(t) { return new (t || ActivityService)(); };
41
+ ActivityService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac, providedIn: 'root' });
42
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
43
+ type: Injectable,
44
+ args: [{
45
+ providedIn: 'root'
46
+ }]
41
47
  }], function () { return []; }, null); })();
42
48
 
43
- class ActivityInterceptor {
44
- constructor(activityService) {
45
- this.activityService = activityService;
46
- }
47
- intercept(req, next) {
48
- const activity = req.headers.get('activityInterceptor');
49
- if (activity) {
50
- const actReq = req.clone({
51
- headers: req.headers.delete('activityInterceptor')
52
- });
53
- if (activity === 'false') {
54
- return next.handle(actReq);
55
- }
56
- }
57
- const id = this.activityService.register();
58
- return next.handle(req).pipe(finalize(() => {
59
- this.activityService.unregister(id);
60
- }));
61
- }
62
- }
63
- ActivityInterceptor.ɵfac = function ActivityInterceptor_Factory(t) { return new (t || ActivityInterceptor)(ɵɵinject(ActivityService)); };
64
- ActivityInterceptor.ɵprov = ɵɵdefineInjectable({ token: ActivityInterceptor, factory: ActivityInterceptor.ɵfac });
65
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ActivityInterceptor, [{
66
- type: Injectable
49
+ class ActivityInterceptor {
50
+ constructor(activityService) {
51
+ this.activityService = activityService;
52
+ }
53
+ intercept(req, next) {
54
+ const activity = req.headers.get('activityInterceptor');
55
+ if (activity) {
56
+ const actReq = req.clone({
57
+ headers: req.headers.delete('activityInterceptor')
58
+ });
59
+ if (activity === 'false') {
60
+ return next.handle(actReq);
61
+ }
62
+ }
63
+ const id = this.activityService.register();
64
+ return next.handle(req).pipe(finalize(() => {
65
+ this.activityService.unregister(id);
66
+ }));
67
+ }
68
+ }
69
+ ActivityInterceptor.ɵfac = function ActivityInterceptor_Factory(t) { return new (t || ActivityInterceptor)(i0.ɵɵinject(ActivityService)); };
70
+ ActivityInterceptor.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityInterceptor, factory: ActivityInterceptor.ɵfac });
71
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityInterceptor, [{
72
+ type: Injectable
67
73
  }], function () { return [{ type: ActivityService }]; }, null); })();
68
74
 
69
- class IgoActivityModule {
70
- static forRoot() {
71
- return {
72
- ngModule: IgoActivityModule,
73
- providers: [
74
- {
75
- provide: HTTP_INTERCEPTORS,
76
- useClass: ActivityInterceptor,
77
- multi: true
78
- }
79
- ]
80
- };
81
- }
82
- }
83
- IgoActivityModule.ɵmod = ɵɵdefineNgModule({ type: IgoActivityModule });
84
- IgoActivityModule.ɵinj = ɵɵdefineInjector({ factory: function IgoActivityModule_Factory(t) { return new (t || IgoActivityModule)(); }, imports: [[]] });
85
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoActivityModule, [{
86
- type: NgModule,
87
- args: [{
88
- imports: [],
89
- declarations: [],
90
- exports: []
91
- }]
75
+ class IgoActivityModule {
76
+ static forRoot() {
77
+ return {
78
+ ngModule: IgoActivityModule,
79
+ providers: [
80
+ {
81
+ provide: HTTP_INTERCEPTORS,
82
+ useClass: ActivityInterceptor,
83
+ multi: true
84
+ }
85
+ ]
86
+ };
87
+ }
88
+ }
89
+ IgoActivityModule.ɵfac = function IgoActivityModule_Factory(t) { return new (t || IgoActivityModule)(); };
90
+ IgoActivityModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoActivityModule });
91
+ IgoActivityModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
92
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoActivityModule, [{
93
+ type: NgModule,
94
+ args: [{
95
+ imports: [],
96
+ declarations: [],
97
+ exports: []
98
+ }]
92
99
  }], null, null); })();
93
100
 
94
- const version = {
95
- lib: '1.8.2',
96
- releaseDate: 1628779296901
101
+ const version = {
102
+ lib: '1.9.0',
103
+ releaseDate: 1632149524409
97
104
  };
98
105
 
99
- class ConfigService {
100
- constructor(injector) {
101
- this.injector = injector;
102
- this.config = {};
103
- }
104
- /**
105
- * Use to get the data found in config file
106
- */
107
- getConfig(key) {
108
- return ObjectUtils.resolve(this.config, key);
109
- }
110
- /**
111
- * This method loads "[path]" to get all config's variables
112
- */
113
- load(options) {
114
- const baseConfig = options.default || {};
115
- if (!options.path) {
116
- this.config = baseConfig;
117
- return true;
118
- }
119
- const http = this.injector.get(HttpClient);
120
- return new Promise((resolve, _reject) => {
121
- http
122
- .get(options.path)
123
- .pipe(catchError((error) => {
124
- console.log(`Configuration file ${options.path} could not be read`);
125
- resolve(true);
126
- return throwError(error.error || 'Server error');
127
- }))
128
- .subscribe((configResponse) => {
129
- this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
130
- resolve(true);
131
- });
132
- });
133
- }
134
- }
135
- ConfigService.ɵfac = function ConfigService_Factory(t) { return new (t || ConfigService)(ɵɵinject(Injector)); };
136
- ConfigService.ɵprov = ɵɵdefineInjectable({ token: ConfigService, factory: ConfigService.ɵfac, providedIn: 'root' });
137
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ConfigService, [{
138
- type: Injectable,
139
- args: [{
140
- providedIn: 'root'
141
- }]
142
- }], function () { return [{ type: Injector }]; }, null); })();
106
+ class ConfigService {
107
+ constructor(injector) {
108
+ this.injector = injector;
109
+ this.config = {};
110
+ }
111
+ /**
112
+ * Use to get the data found in config file
113
+ */
114
+ getConfig(key) {
115
+ return ObjectUtils.resolve(this.config, key);
116
+ }
117
+ /**
118
+ * This method loads "[path]" to get all config's variables
119
+ */
120
+ load(options) {
121
+ const baseConfig = options.default || {};
122
+ if (!options.path) {
123
+ this.config = baseConfig;
124
+ return true;
125
+ }
126
+ const http = this.injector.get(HttpClient);
127
+ return new Promise((resolve, _reject) => {
128
+ http
129
+ .get(options.path)
130
+ .pipe(catchError((error) => {
131
+ console.log(`Configuration file ${options.path} could not be read`);
132
+ resolve(true);
133
+ return throwError(error.error || 'Server error');
134
+ }))
135
+ .subscribe((configResponse) => {
136
+ this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
137
+ resolve(true);
138
+ });
139
+ });
140
+ }
141
+ }
142
+ ConfigService.ɵfac = function ConfigService_Factory(t) { return new (t || ConfigService)(i0.ɵɵinject(i0.Injector)); };
143
+ ConfigService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConfigService, factory: ConfigService.ɵfac, providedIn: 'root' });
144
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfigService, [{
145
+ type: Injectable,
146
+ args: [{
147
+ providedIn: 'root'
148
+ }]
149
+ }], function () { return [{ type: i0.Injector }]; }, null); })();
143
150
 
144
- let CONFIG_OPTIONS = new InjectionToken('configOptions');
145
- function provideConfigOptions(options) {
146
- return {
147
- provide: CONFIG_OPTIONS,
148
- useValue: options
149
- };
150
- }
151
- function configFactory(configService, options) {
152
- return () => configService.load(options);
153
- }
154
- function provideConfigLoader() {
155
- return {
156
- provide: APP_INITIALIZER,
157
- useFactory: configFactory,
158
- multi: true,
159
- deps: [ConfigService, CONFIG_OPTIONS]
160
- };
151
+ let CONFIG_OPTIONS = new InjectionToken('configOptions');
152
+ function provideConfigOptions(options) {
153
+ return {
154
+ provide: CONFIG_OPTIONS,
155
+ useValue: options
156
+ };
157
+ }
158
+ function configFactory(configService, options) {
159
+ return () => configService.load(options);
160
+ }
161
+ function provideConfigLoader() {
162
+ return {
163
+ provide: APP_INITIALIZER,
164
+ useFactory: configFactory,
165
+ multi: true,
166
+ deps: [ConfigService, CONFIG_OPTIONS]
167
+ };
161
168
  }
162
169
 
163
- class IgoConfigModule {
164
- static forRoot() {
165
- return {
166
- ngModule: IgoConfigModule,
167
- providers: [provideConfigOptions({}), provideConfigLoader()]
168
- };
169
- }
170
- }
171
- IgoConfigModule.ɵmod = ɵɵdefineNgModule({ type: IgoConfigModule });
172
- IgoConfigModule.ɵinj = ɵɵdefineInjector({ factory: function IgoConfigModule_Factory(t) { return new (t || IgoConfigModule)(); }, imports: [[]] });
173
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoConfigModule, [{
174
- type: NgModule,
175
- args: [{
176
- imports: [],
177
- declarations: [],
178
- exports: []
179
- }]
170
+ class IgoConfigModule {
171
+ static forRoot() {
172
+ return {
173
+ ngModule: IgoConfigModule,
174
+ providers: [provideConfigOptions({}), provideConfigLoader()]
175
+ };
176
+ }
177
+ }
178
+ IgoConfigModule.ɵfac = function IgoConfigModule_Factory(t) { return new (t || IgoConfigModule)(); };
179
+ IgoConfigModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoConfigModule });
180
+ IgoConfigModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
181
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoConfigModule, [{
182
+ type: NgModule,
183
+ args: [{
184
+ imports: [],
185
+ declarations: [],
186
+ exports: []
187
+ }]
180
188
  }], null, null); })();
181
189
 
182
- class LanguageLoader {
183
- constructor(http, prefix, suffix = '.json', config) {
184
- this.http = http;
185
- this.prefix = prefix;
186
- this.suffix = suffix;
187
- this.config = config;
188
- }
189
- getTranslation(lang) {
190
- const translation = require(`../locale/${lang}.json`);
191
- const igoLocale$ = of(translation);
192
- if (this.config && !this.prefix) {
193
- const prefix = this.config.getConfig('language.prefix');
194
- this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
195
- }
196
- if (!this.prefix || this.prefix.length === 0) {
197
- return igoLocale$;
198
- }
199
- const appLocale$ = this.prefix.map((prefix) => this.http.get(`${prefix}${lang}${this.suffix}`));
200
- const locale$ = combineLatest([igoLocale$, ...appLocale$]);
201
- return locale$.pipe(map((translations) => {
202
- return translations.reduce((acc, current) => ObjectUtils.mergeDeep(acc, current), {});
203
- }));
204
- }
190
+ class LanguageLoader {
191
+ constructor(http, prefix, suffix = '.json', config) {
192
+ this.http = http;
193
+ this.prefix = prefix;
194
+ this.suffix = suffix;
195
+ this.config = config;
196
+ }
197
+ getTranslation(lang) {
198
+ const translation = require(`../locale/${lang}.json`);
199
+ const igoLocale$ = of(translation);
200
+ if (this.config && !this.prefix) {
201
+ const prefix = this.config.getConfig('language.prefix');
202
+ this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
203
+ }
204
+ if (!this.prefix || this.prefix.length === 0) {
205
+ return igoLocale$;
206
+ }
207
+ const appLocale$ = this.prefix.map((prefix) => this.http.get(`${prefix}${lang}${this.suffix}`));
208
+ const locale$ = combineLatest([igoLocale$, ...appLocale$]);
209
+ return locale$.pipe(map((translations) => {
210
+ return translations.reduce((acc, current) => ObjectUtils.mergeDeep(acc, current), {});
211
+ }));
212
+ }
205
213
  }
206
214
 
207
- function defaultLanguageLoader(http, config) {
208
- return new LanguageLoader(http, undefined, undefined, config);
209
- }
210
- function provideLanguageLoader(loader) {
211
- return {
212
- provide: TranslateLoader,
213
- useFactory: loader || defaultLanguageLoader,
214
- deps: [HttpClient]
215
- };
216
- }
217
- function provideDefaultLanguageLoader(loader) {
218
- return {
219
- provide: TranslateLoader,
220
- useFactory: loader || defaultLanguageLoader,
221
- deps: [HttpClient, ConfigService]
222
- };
215
+ function defaultLanguageLoader(http, config) {
216
+ return new LanguageLoader(http, undefined, undefined, config);
217
+ }
218
+ function provideLanguageLoader(loader) {
219
+ return {
220
+ provide: TranslateLoader,
221
+ useFactory: loader || defaultLanguageLoader,
222
+ deps: [HttpClient]
223
+ };
224
+ }
225
+ function provideDefaultLanguageLoader(loader) {
226
+ return {
227
+ provide: TranslateLoader,
228
+ useFactory: loader || defaultLanguageLoader,
229
+ deps: [HttpClient, ConfigService]
230
+ };
223
231
  }
224
232
 
225
- class IgoMissingTranslationHandler {
226
- handle(params) {
227
- if (!params.translateService.langs.length) {
228
- const error = 'Translations are not yet loaded. \
229
- Check that the LanguageService is injected.';
230
- throw new Error(error);
231
- }
232
- if (params.key.substr(0, 4) === 'igo.') {
233
- throw new Error(`The Key "${params.key}" is missing in locale file.`);
234
- }
235
- else {
236
- return params.key;
237
- }
238
- }
233
+ class IgoMissingTranslationHandler {
234
+ handle(params) {
235
+ if (!params.translateService.langs.length) {
236
+ const error = 'Translations are not yet loaded. \
237
+ Check that the LanguageService is injected.';
238
+ throw new Error(error);
239
+ }
240
+ if (params.key.substr(0, 4) === 'igo.') {
241
+ throw new Error(`The Key "${params.key}" is missing in locale file.`);
242
+ }
243
+ else {
244
+ return params.key;
245
+ }
246
+ }
239
247
  }
240
248
 
241
- class IgoLanguageModule {
242
- static forRoot() {
243
- return {
244
- ngModule: IgoLanguageModule,
245
- providers: [provideDefaultLanguageLoader()]
246
- };
247
- }
248
- }
249
- IgoLanguageModule.ɵmod = ɵɵdefineNgModule({ type: IgoLanguageModule });
250
- IgoLanguageModule.ɵinj = ɵɵdefineInjector({ factory: function IgoLanguageModule_Factory(t) { return new (t || IgoLanguageModule)(); }, imports: [[
251
- TranslateModule.forRoot({
252
- missingTranslationHandler: {
253
- provide: MissingTranslationHandler,
254
- useClass: IgoMissingTranslationHandler
255
- }
256
- })
257
- ], TranslateModule] });
258
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [TranslateModule], exports: [TranslateModule] }); })();
259
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoLanguageModule, [{
260
- type: NgModule,
261
- args: [{
262
- imports: [
263
- TranslateModule.forRoot({
264
- missingTranslationHandler: {
265
- provide: MissingTranslationHandler,
266
- useClass: IgoMissingTranslationHandler
267
- }
268
- })
269
- ],
270
- declarations: [],
271
- exports: [TranslateModule]
272
- }]
273
- }], null, null); })();
249
+ class IgoLanguageModule {
250
+ static forRoot() {
251
+ return {
252
+ ngModule: IgoLanguageModule,
253
+ providers: [provideDefaultLanguageLoader()]
254
+ };
255
+ }
256
+ }
257
+ IgoLanguageModule.ɵfac = function IgoLanguageModule_Factory(t) { return new (t || IgoLanguageModule)(); };
258
+ IgoLanguageModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLanguageModule });
259
+ IgoLanguageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
260
+ TranslateModule.forRoot({
261
+ missingTranslationHandler: {
262
+ provide: MissingTranslationHandler,
263
+ useClass: IgoMissingTranslationHandler
264
+ }
265
+ })
266
+ ], TranslateModule] });
267
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLanguageModule, [{
268
+ type: NgModule,
269
+ args: [{
270
+ imports: [
271
+ TranslateModule.forRoot({
272
+ missingTranslationHandler: {
273
+ provide: MissingTranslationHandler,
274
+ useClass: IgoMissingTranslationHandler
275
+ }
276
+ })
277
+ ],
278
+ declarations: [],
279
+ exports: [TranslateModule]
280
+ }]
281
+ }], null, null); })();
282
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [i1.TranslateModule], exports: [TranslateModule] }); })();
274
283
 
275
- const _c0 = function (a0) { return { closeIcon: a0 }; };
276
- class MessageCenterComponent {
277
- constructor() {
278
- this._options = {};
279
- }
280
- get options() {
281
- return Object.assign({}, MessageCenterComponent.defaultOptions, this._options);
282
- }
283
- set options(value) {
284
- this._options = value;
285
- }
286
- }
287
- MessageCenterComponent.defaultOptions = {
288
- timeOut: 5000,
289
- hasCloseIcon: false,
290
- showProgressBar: true,
291
- pauseOnHover: true,
292
- clickToClose: true,
293
- maxLength: 100,
294
- maxStack: 3,
295
- preventDuplicates: true
296
- };
297
- MessageCenterComponent.ɵfac = function MessageCenterComponent_Factory(t) { return new (t || MessageCenterComponent)(); };
298
- MessageCenterComponent.ɵcmp = ɵɵdefineComponent({ type: MessageCenterComponent, selectors: [["igo-message-center"]], inputs: { options: "options" }, decls: 1, vars: 4, consts: [[1, "mat-typography", 3, "ngClass", "options"]], template: function MessageCenterComponent_Template(rf, ctx) { if (rf & 1) {
299
- ɵɵelement(0, "simple-notifications", 0);
300
- } if (rf & 2) {
301
- ɵɵproperty("ngClass", ɵɵpureFunction1(2, _c0, ctx.options.hasCloseIcon))("options", ctx.options);
302
- } }, directives: [SimpleNotificationsComponent, NgClass], styles: ["@charset \"UTF-8\";[_nghost-%COMP%] div.simple-notification-wrapper{bottom:0;right:calc(50% - 150px)}@media only screen and (orientation:landscape) and (max-width:959px),only screen and (orientation:portrait) and (max-width:599px){[_nghost-%COMP%] div.simple-notification-wrapper{left:0;right:0;width:100%}}[_nghost-%COMP%] div.simple-notification{margin-bottom:5px;min-height:50px;padding-left:45px;padding-right:25px}[_nghost-%COMP%] div.simple-notification.noIcon{padding-left:25px}@media only screen and (orientation:landscape) and (max-width:959px),only screen and (orientation:portrait) and (max-width:599px){[_nghost-%COMP%] div.simple-notification{margin-bottom:0}}[_nghost-%COMP%] div.simple-notification .sn-title{font-size:15px;font-weight:700;line-height:23px}[_nghost-%COMP%] div.simple-notification .sn-content{font-size:15px;line-height:18px}[_nghost-%COMP%] div.simple-notification .icon{height:100%;left:0;padding:7px;top:0;width:45px}[_nghost-%COMP%] div.simple-notification .icon\u00A0 mat-icon{align-items:center;display:flex;font-size:32px;height:100%}[_nghost-%COMP%] .closeIcon .sn-title:after{content:\"close\";font-family:Material Icons;font-feature-settings:\"liga\" 1;font-size:24px;font-weight:400;position:absolute;right:5px;top:5px}"] });
303
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MessageCenterComponent, [{
304
- type: Component,
305
- args: [{
306
- selector: 'igo-message-center',
307
- templateUrl: './message-center.component.html',
308
- styleUrls: ['./message-center.component.scss']
309
- }]
310
- }], function () { return []; }, { options: [{
311
- type: Input
284
+ const _c0 = function (a0) { return { closeIcon: a0 }; };
285
+ class MessageCenterComponent {
286
+ constructor() {
287
+ this._options = {};
288
+ }
289
+ get options() {
290
+ return Object.assign({}, MessageCenterComponent.defaultOptions, this._options);
291
+ }
292
+ set options(value) {
293
+ this._options = value;
294
+ }
295
+ }
296
+ MessageCenterComponent.defaultOptions = {
297
+ timeOut: 5000,
298
+ hasCloseIcon: false,
299
+ showProgressBar: true,
300
+ pauseOnHover: true,
301
+ clickToClose: true,
302
+ maxLength: 100,
303
+ maxStack: 3,
304
+ preventDuplicates: true
305
+ };
306
+ MessageCenterComponent.ɵfac = function MessageCenterComponent_Factory(t) { return new (t || MessageCenterComponent)(); };
307
+ MessageCenterComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MessageCenterComponent, selectors: [["igo-message-center"]], inputs: { options: "options" }, decls: 1, vars: 4, consts: [[1, "mat-typography", 3, "ngClass", "options"]], template: function MessageCenterComponent_Template(rf, ctx) { if (rf & 1) {
308
+ i0.ɵɵelement(0, "simple-notifications", 0);
309
+ } if (rf & 2) {
310
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0, ctx.options.hasCloseIcon))("options", ctx.options);
311
+ } }, directives: [i1$1.SimpleNotificationsComponent, i2.NgClass], styles: ["[_nghost-%COMP%] div.simple-notification-wrapper{bottom:0;right:calc(50% - 150px)}@media only screen and (orientation:portrait) and (max-width: 599px),only screen and (orientation:landscape) and (max-width: 959px){[_nghost-%COMP%] div.simple-notification-wrapper{right:0;left:0;width:100%}}[_nghost-%COMP%] .closeIcon .sn-title:after{content:\"close\";font-family:\"Material Icons\";font-feature-settings:\"liga\" 1;font-size:24px;font-weight:normal;right:5px;top:5px;position:absolute}[_nghost-%COMP%] .simple-notification .icon{top:0;left:0;width:45px;height:45px;height:100%;padding:7px}[_nghost-%COMP%] .simple-notification .icon mat-icon{display:flex;align-items:center;height:100%;font-size:32px}[_nghost-%COMP%] div.simple-notification{min-height:50px;margin-bottom:5px;padding-left:45px;padding-right:25px}[_nghost-%COMP%] div.simple-notification.noIcon{padding-left:25px}@media only screen and (orientation:portrait) and (max-width: 599px),only screen and (orientation:landscape) and (max-width: 959px){[_nghost-%COMP%] div.simple-notification{margin-bottom:0}}[_nghost-%COMP%] div.simple-notification .sn-title{line-height:23px;font-size:15px;font-weight:bold}[_nghost-%COMP%] div.simple-notification .sn-content{line-height:18px;font-size:15px}"] });
312
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageCenterComponent, [{
313
+ type: Component,
314
+ args: [{
315
+ selector: 'igo-message-center',
316
+ templateUrl: './message-center.component.html',
317
+ styleUrls: ['./message-center.component.scss']
318
+ }]
319
+ }], function () { return []; }, { options: [{
320
+ type: Input
312
321
  }] }); })();
313
322
 
314
- class IgoMessageModule {
315
- static forRoot() {
316
- return {
317
- ngModule: IgoMessageModule,
318
- providers: []
319
- };
320
- }
321
- }
322
- IgoMessageModule.ɵmod = ɵɵdefineNgModule({ type: IgoMessageModule });
323
- IgoMessageModule.ɵinj = ɵɵdefineInjector({ factory: function IgoMessageModule_Factory(t) { return new (t || IgoMessageModule)(); }, imports: [[CommonModule, SimpleNotificationsModule.forRoot()]] });
324
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoMessageModule, { declarations: [MessageCenterComponent], imports: [CommonModule, SimpleNotificationsModule], exports: [MessageCenterComponent] }); })();
325
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoMessageModule, [{
326
- type: NgModule,
327
- args: [{
328
- imports: [CommonModule, SimpleNotificationsModule.forRoot()],
329
- declarations: [MessageCenterComponent],
330
- exports: [MessageCenterComponent]
331
- }]
332
- }], null, null); })();
323
+ class IgoMessageModule {
324
+ static forRoot() {
325
+ return {
326
+ ngModule: IgoMessageModule,
327
+ providers: []
328
+ };
329
+ }
330
+ }
331
+ IgoMessageModule.ɵfac = function IgoMessageModule_Factory(t) { return new (t || IgoMessageModule)(); };
332
+ IgoMessageModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoMessageModule });
333
+ IgoMessageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[CommonModule, SimpleNotificationsModule.forRoot()]] });
334
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoMessageModule, [{
335
+ type: NgModule,
336
+ args: [{
337
+ imports: [CommonModule, SimpleNotificationsModule.forRoot()],
338
+ declarations: [MessageCenterComponent],
339
+ exports: [MessageCenterComponent]
340
+ }]
341
+ }], null, null); })();
342
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { declarations: [MessageCenterComponent], imports: [CommonModule, i1$1.SimpleNotificationsModule], exports: [MessageCenterComponent] }); })();
333
343
 
334
- var MessageType;
335
- (function (MessageType) {
336
- MessageType["ERROR"] = "error";
337
- MessageType["ALERT"] = "alert";
338
- MessageType["INFO"] = "info";
339
- MessageType["SUCCESS"] = "success";
344
+ class LanguageService {
345
+ constructor(translate) {
346
+ this.translate = translate;
347
+ this.language = this.translate.getBrowserLang();
348
+ const lang = this.getLanguage();
349
+ this.translate.setDefaultLang(lang);
350
+ }
351
+ getLanguage() {
352
+ return this.language.match(/en|fr/) ? this.language : 'en';
353
+ }
354
+ setLanguage(language) {
355
+ this.language = language.match(/en|fr/) ? language : 'en';
356
+ this.translate.use(this.language);
357
+ this.translate.reloadLang(this.language);
358
+ }
359
+ }
360
+ LanguageService.ɵfac = function LanguageService_Factory(t) { return new (t || LanguageService)(i0.ɵɵinject(i1.TranslateService)); };
361
+ LanguageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LanguageService, factory: LanguageService.ɵfac, providedIn: 'root' });
362
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageService, [{
363
+ type: Injectable,
364
+ args: [{
365
+ providedIn: 'root'
366
+ }]
367
+ }], function () { return [{ type: i1.TranslateService }]; }, null); })();
368
+
369
+ var MessageType;
370
+ (function (MessageType) {
371
+ MessageType["ERROR"] = "error";
372
+ MessageType["ALERT"] = "alert";
373
+ MessageType["INFO"] = "info";
374
+ MessageType["SUCCESS"] = "success";
340
375
  })(MessageType || (MessageType = {}));
341
376
 
342
- class MessageService {
343
- constructor(notificationService, configService) {
344
- this.notificationService = notificationService;
345
- this.configService = configService;
346
- this.messages$ = new BehaviorSubject([]);
347
- this.options = this.configService.getConfig('message') || {};
348
- }
349
- showError(httpError) {
350
- httpError.error.caught = true;
351
- return this.error(httpError.error.message, httpError.error.title);
352
- }
353
- message(message) {
354
- this.messages$.next(this.messages$.value.concat([message]));
355
- message.options = message.options || {};
356
- const currentDate = new Date();
357
- message.options.from = message.options.from ? message.options.from : new Date('1 jan 1900');
358
- message.options.to = message.options.to ? message.options.to : new Date('1 jan 3000');
359
- if (typeof message.options.from === 'string') {
360
- message.options.from = new Date(Date.parse(message.options.from.replace(/-/g, ' ')));
361
- }
362
- if (typeof message.options.to === 'string') {
363
- message.options.to = new Date(Date.parse(message.options.to.replace(/-/g, ' ')));
364
- }
365
- if (currentDate > message.options.from && currentDate < message.options.to) {
366
- message = this.handleTemplate(message);
367
- let notification;
368
- if (message.text) {
369
- notification = this.notificationService.create(message.title, message.text, message.type, message.options);
370
- }
371
- else if (message.html) {
372
- if (!message.icon) {
373
- message.options.theClass = message.options.theClass
374
- ? message.options.theClass + ' noIcon'
375
- : 'noIcon';
376
- }
377
- notification = this.notificationService.html(message.html, message.type, message.options);
378
- }
379
- else {
380
- return;
381
- }
382
- if (message.icon !== undefined) {
383
- this.addIcon(notification, message.icon);
384
- }
385
- message.options.id = notification.id;
386
- return notification;
387
- }
388
- return;
389
- }
390
- success(text, title, options = {}) {
391
- return this.message({
392
- text,
393
- title,
394
- icon: options.icon || 'check',
395
- options,
396
- type: MessageType.SUCCESS
397
- });
398
- }
399
- error(text, title, options = {}) {
400
- return this.message({
401
- text,
402
- title,
403
- icon: options.icon || 'error_outline',
404
- options,
405
- type: MessageType.ERROR
406
- });
407
- }
408
- info(text, title, options = {}) {
409
- return this.message({
410
- text,
411
- title,
412
- icon: options.icon || 'info_outline',
413
- options,
414
- type: MessageType.INFO
415
- });
416
- }
417
- alert(text, title, options = {}) {
418
- return this.message({
419
- text,
420
- title,
421
- icon: options.icon || 'access_alarm',
422
- options,
423
- type: MessageType.ALERT
424
- });
425
- }
426
- remove(id) {
427
- this.notificationService.remove(id);
428
- }
429
- removeAllAreNotError() {
430
- for (const mess of this.messages$.value) {
431
- if (mess.type !== 'error') {
432
- this.remove(mess.options.id);
433
- }
434
- }
435
- }
436
- addIcon(notification, icon) {
437
- // There is no way to add an icon to a notification when reating
438
- // it so we simply set it on the notification directly.
439
- // See https://github.com/flauc/angular2-notifications/issues/165
377
+ class MessageService {
378
+ constructor(notificationService, configService) {
379
+ this.notificationService = notificationService;
380
+ this.configService = configService;
381
+ this.messages$ = new BehaviorSubject([]);
382
+ this.options = this.configService.getConfig('message') || {};
383
+ }
384
+ showError(httpError) {
385
+ httpError.error.caught = true;
386
+ return this.error(httpError.error.message, httpError.error.title);
387
+ }
388
+ message(message) {
389
+ this.messages$.next(this.messages$.value.concat([message]));
390
+ message.options = message.options || {};
391
+ const currentDate = new Date();
392
+ message.options.from = message.options.from ? message.options.from : new Date('1 jan 1900');
393
+ message.options.to = message.options.to ? message.options.to : new Date('1 jan 3000');
394
+ if (typeof message.options.from === 'string') {
395
+ message.options.from = new Date(Date.parse(message.options.from.replace(/-/g, ' ')));
396
+ }
397
+ if (typeof message.options.to === 'string') {
398
+ message.options.to = new Date(Date.parse(message.options.to.replace(/-/g, ' ')));
399
+ }
400
+ if (currentDate > message.options.from && currentDate < message.options.to) {
401
+ message = this.handleTemplate(message);
402
+ let notification;
403
+ if (message.text) {
404
+ notification = this.notificationService.create(message.title, message.text, message.type, message.options);
405
+ }
406
+ else if (message.html) {
407
+ if (!message.icon) {
408
+ message.options.theClass = message.options.theClass
409
+ ? message.options.theClass + ' noIcon'
410
+ : 'noIcon';
411
+ }
412
+ notification = this.notificationService.html(message.html, message.type, message.options);
413
+ }
414
+ else {
415
+ return;
416
+ }
417
+ if (message.icon !== undefined) {
418
+ this.addIcon(notification, message.icon);
419
+ }
420
+ message.options.id = notification.id;
421
+ return notification;
422
+ }
423
+ return;
424
+ }
425
+ success(text, title, options = {}) {
426
+ return this.message({
427
+ text,
428
+ title,
429
+ icon: options.icon || 'check',
430
+ options,
431
+ type: MessageType.SUCCESS
432
+ });
433
+ }
434
+ error(text, title, options = {}) {
435
+ return this.message({
436
+ text,
437
+ title,
438
+ icon: options.icon || 'error_outline',
439
+ options,
440
+ type: MessageType.ERROR
441
+ });
442
+ }
443
+ info(text, title, options = {}) {
444
+ return this.message({
445
+ text,
446
+ title,
447
+ icon: options.icon || 'info_outline',
448
+ options,
449
+ type: MessageType.INFO
450
+ });
451
+ }
452
+ alert(text, title, options = {}) {
453
+ return this.message({
454
+ text,
455
+ title,
456
+ icon: options.icon || 'access_alarm',
457
+ options,
458
+ type: MessageType.ALERT
459
+ });
460
+ }
461
+ remove(id) {
462
+ this.notificationService.remove(id);
463
+ }
464
+ removeAllAreNotError() {
465
+ for (const mess of this.messages$.value) {
466
+ if (mess.type !== 'error') {
467
+ this.remove(mess.options.id);
468
+ }
469
+ }
470
+ }
471
+ addIcon(notification, icon) {
472
+ // There is no way to add an icon to a notification when reating
473
+ // it so we simply set it on the notification directly.
474
+ // See https://github.com/flauc/angular2-notifications/issues/165
440
475
  notification.icon = `
441
476
  <mat-icon class="material-icons mat-icon mat-list-avatar" svgIcon="${icon}">
442
- </mat-icon>`;
443
- }
444
- handleTemplate(message) {
445
- if (!this.options.template || message.html) {
446
- return message;
447
- }
448
- let html = this.options.template;
449
- html = html.replace('${text}', message.text);
450
- html = html.replace('${title}', message.title);
451
- html = html.replace('${icon}', message.icon);
452
- message.html = html;
453
- message.text = undefined;
454
- message.title = undefined;
455
- message.icon = undefined;
456
- return message;
457
- }
458
- }
459
- MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(ɵɵinject(NotificationsService), ɵɵinject(ConfigService)); };
460
- MessageService.ɵprov = ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
461
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MessageService, [{
462
- type: Injectable,
463
- args: [{
464
- providedIn: 'root'
465
- }]
466
- }], function () { return [{ type: NotificationsService }, { type: ConfigService }]; }, null); })();
477
+ </mat-icon>`;
478
+ }
479
+ handleTemplate(message) {
480
+ if (!this.options.template || message.html) {
481
+ return message;
482
+ }
483
+ let html = this.options.template;
484
+ html = html.replace('${text}', message.text);
485
+ html = html.replace('${title}', message.title);
486
+ html = html.replace('${icon}', message.icon);
487
+ message.html = html;
488
+ message.text = undefined;
489
+ message.title = undefined;
490
+ message.icon = undefined;
491
+ return message;
492
+ }
493
+ }
494
+ MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(i1$1.NotificationsService), i0.ɵɵinject(ConfigService)); };
495
+ MessageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
496
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageService, [{
497
+ type: Injectable,
498
+ args: [{
499
+ providedIn: 'root'
500
+ }]
501
+ }], function () { return [{ type: i1$1.NotificationsService }, { type: ConfigService }]; }, null); })();
467
502
 
468
- class LanguageService {
469
- constructor(translate) {
470
- this.translate = translate;
471
- this.language = this.translate.getBrowserLang();
472
- const lang = this.getLanguage();
473
- this.translate.setDefaultLang(lang);
474
- }
475
- getLanguage() {
476
- return this.language.match(/en|fr/) ? this.language : 'en';
477
- }
478
- setLanguage(language) {
479
- this.language = language.match(/en|fr/) ? language : 'en';
480
- this.translate.use(this.language);
481
- this.translate.reloadLang(this.language);
482
- }
483
- }
484
- LanguageService.ɵfac = function LanguageService_Factory(t) { return new (t || LanguageService)(ɵɵinject(TranslateService)); };
485
- LanguageService.ɵprov = ɵɵdefineInjectable({ token: LanguageService, factory: LanguageService.ɵfac, providedIn: 'root' });
486
- /*@__PURE__*/ (function () { ɵsetClassMetadata(LanguageService, [{
487
- type: Injectable,
488
- args: [{
489
- providedIn: 'root'
490
- }]
491
- }], function () { return [{ type: TranslateService }]; }, null); })();
492
-
493
- class ErrorInterceptor {
494
- constructor(messageService, injector) {
495
- this.messageService = messageService;
496
- this.injector = injector;
497
- }
498
- intercept(req, next) {
499
- const errorContainer = { httpError: undefined };
500
- return next.handle(req).pipe(catchError(error => this.handleError(error, errorContainer)), finalize(() => {
501
- this.handleCaughtError(errorContainer);
502
- this.handleUncaughtError(errorContainer);
503
- }));
504
- }
505
- handleError(httpError, errorContainer) {
506
- if (httpError instanceof HttpErrorResponse) {
507
- const errorObj = httpError.error === 'object' ? httpError.error : {};
508
- errorObj.message = httpError.error.message || httpError.statusText;
509
- errorObj.caught = false;
510
- httpError = new HttpErrorResponse({
511
- error: errorObj,
512
- headers: httpError.headers,
513
- status: httpError.status,
514
- statusText: httpError.statusText,
515
- url: httpError.url
516
- });
517
- }
518
- errorContainer.httpError = httpError;
519
- return throwError(httpError);
520
- }
521
- handleCaughtError(errorContainer) {
522
- const httpError = errorContainer.httpError;
523
- if (httpError && httpError.error.toDisplay) {
524
- httpError.error.caught = true;
525
- this.messageService.error(httpError.error.message, httpError.error.title);
526
- }
527
- }
528
- handleUncaughtError(errorContainer) {
529
- const httpError = errorContainer.httpError;
530
- if (httpError && !httpError.error.caught) {
531
- const translate = this.injector.get(LanguageService).translate;
532
- const message = translate.instant('igo.core.errors.uncaught.message');
533
- const title = translate.instant('igo.core.errors.uncaught.title');
534
- httpError.error.caught = true;
535
- this.messageService.error(message, title);
536
- }
537
- }
538
- }
539
- ErrorInterceptor.ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(ɵɵinject(MessageService), ɵɵinject(Injector)); };
540
- ErrorInterceptor.ɵprov = ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
541
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ErrorInterceptor, [{
542
- type: Injectable,
543
- args: [{
544
- providedIn: 'root'
545
- }]
546
- }], function () { return [{ type: MessageService }, { type: Injector }]; }, null); })();
503
+ class ErrorInterceptor {
504
+ constructor(messageService, injector) {
505
+ this.messageService = messageService;
506
+ this.injector = injector;
507
+ }
508
+ intercept(req, next) {
509
+ const errorContainer = { httpError: undefined };
510
+ return next.handle(req).pipe(catchError(error => this.handleError(error, errorContainer)), finalize(() => {
511
+ this.handleCaughtError(errorContainer);
512
+ this.handleUncaughtError(errorContainer);
513
+ }));
514
+ }
515
+ handleError(httpError, errorContainer) {
516
+ if (httpError instanceof HttpErrorResponse) {
517
+ const errorObj = httpError.error === 'object' ? httpError.error : {};
518
+ errorObj.message = httpError.error.message || httpError.statusText;
519
+ errorObj.caught = false;
520
+ httpError = new HttpErrorResponse({
521
+ error: errorObj,
522
+ headers: httpError.headers,
523
+ status: httpError.status,
524
+ statusText: httpError.statusText,
525
+ url: httpError.url
526
+ });
527
+ }
528
+ errorContainer.httpError = httpError;
529
+ return throwError(httpError);
530
+ }
531
+ handleCaughtError(errorContainer) {
532
+ const httpError = errorContainer.httpError;
533
+ if (httpError && httpError.error.toDisplay) {
534
+ httpError.error.caught = true;
535
+ this.messageService.error(httpError.error.message, httpError.error.title);
536
+ }
537
+ }
538
+ handleUncaughtError(errorContainer) {
539
+ const httpError = errorContainer.httpError;
540
+ if (httpError && !httpError.error.caught) {
541
+ const translate = this.injector.get(LanguageService).translate;
542
+ const message = translate.instant('igo.core.errors.uncaught.message');
543
+ const title = translate.instant('igo.core.errors.uncaught.title');
544
+ httpError.error.caught = true;
545
+ this.messageService.error(message, title);
546
+ }
547
+ }
548
+ }
549
+ ErrorInterceptor.ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(MessageService), i0.ɵɵinject(i0.Injector)); };
550
+ ErrorInterceptor.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
551
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorInterceptor, [{
552
+ type: Injectable,
553
+ args: [{
554
+ providedIn: 'root'
555
+ }]
556
+ }], function () { return [{ type: MessageService }, { type: i0.Injector }]; }, null); })();
547
557
 
548
- class IgoErrorModule {
549
- constructor(parentModule) {
550
- if (parentModule) {
551
- throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
552
- }
553
- }
554
- static forRoot() {
555
- return {
556
- ngModule: IgoErrorModule,
557
- providers: [
558
- {
559
- provide: HTTP_INTERCEPTORS,
560
- useClass: ErrorInterceptor,
561
- multi: true
562
- }
563
- ]
564
- };
565
- }
566
- }
567
- IgoErrorModule.ɵmod = ɵɵdefineNgModule({ type: IgoErrorModule });
568
- IgoErrorModule.ɵinj = ɵɵdefineInjector({ factory: function IgoErrorModule_Factory(t) { return new (t || IgoErrorModule)(ɵɵinject(IgoErrorModule, 12)); }, imports: [[]] });
569
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoErrorModule, [{
570
- type: NgModule,
571
- args: [{
572
- imports: [],
573
- declarations: [],
574
- exports: []
575
- }]
576
- }], function () { return [{ type: IgoErrorModule, decorators: [{
577
- type: Optional
578
- }, {
579
- type: SkipSelf
558
+ class IgoErrorModule {
559
+ constructor(parentModule) {
560
+ if (parentModule) {
561
+ throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
562
+ }
563
+ }
564
+ static forRoot() {
565
+ return {
566
+ ngModule: IgoErrorModule,
567
+ providers: [
568
+ {
569
+ provide: HTTP_INTERCEPTORS,
570
+ useClass: ErrorInterceptor,
571
+ multi: true
572
+ }
573
+ ]
574
+ };
575
+ }
576
+ }
577
+ IgoErrorModule.ɵfac = function IgoErrorModule_Factory(t) { return new (t || IgoErrorModule)(i0.ɵɵinject(IgoErrorModule, 12)); };
578
+ IgoErrorModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoErrorModule });
579
+ IgoErrorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
580
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoErrorModule, [{
581
+ type: NgModule,
582
+ args: [{
583
+ imports: [],
584
+ declarations: [],
585
+ exports: []
586
+ }]
587
+ }], function () { return [{ type: IgoErrorModule, decorators: [{
588
+ type: Optional
589
+ }, {
590
+ type: SkipSelf
580
591
  }] }]; }, null); })();
581
592
 
582
- class IgoCoreModule {
583
- constructor(matIconRegistry, domSanitizer) {
584
- matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
585
- }
586
- static forRoot() {
587
- return {
588
- ngModule: IgoCoreModule,
589
- providers: []
590
- };
591
- }
592
- }
593
- IgoCoreModule.ɵmod = ɵɵdefineNgModule({ type: IgoCoreModule });
594
- IgoCoreModule.ɵinj = ɵɵdefineInjector({ factory: function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(ɵɵinject(MatIconRegistry), ɵɵinject(DomSanitizer)); }, imports: [[
595
- CommonModule,
596
- HttpClientModule,
597
- IgoActivityModule.forRoot(),
598
- IgoConfigModule.forRoot(),
599
- IgoErrorModule.forRoot(),
600
- IgoLanguageModule.forRoot(),
601
- IgoMessageModule.forRoot()
602
- ], IgoActivityModule,
603
- IgoConfigModule,
604
- IgoErrorModule,
605
- IgoLanguageModule,
606
- IgoMessageModule] });
607
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
608
- HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule], exports: [IgoActivityModule,
609
- IgoConfigModule,
610
- IgoErrorModule,
611
- IgoLanguageModule,
593
+ class IgoCoreModule {
594
+ constructor(matIconRegistry, domSanitizer) {
595
+ matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
596
+ }
597
+ static forRoot() {
598
+ return {
599
+ ngModule: IgoCoreModule,
600
+ providers: []
601
+ };
602
+ }
603
+ }
604
+ IgoCoreModule.ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$2.MatIconRegistry), i0.ɵɵinject(i2$1.DomSanitizer)); };
605
+ IgoCoreModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoCoreModule });
606
+ IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
607
+ CommonModule,
608
+ HttpClientModule,
609
+ IgoActivityModule.forRoot(),
610
+ IgoConfigModule.forRoot(),
611
+ IgoErrorModule.forRoot(),
612
+ IgoLanguageModule.forRoot(),
613
+ IgoMessageModule.forRoot()
614
+ ], IgoActivityModule,
615
+ IgoConfigModule,
616
+ IgoErrorModule,
617
+ IgoLanguageModule,
618
+ IgoMessageModule] });
619
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoCoreModule, [{
620
+ type: NgModule,
621
+ args: [{
622
+ imports: [
623
+ CommonModule,
624
+ HttpClientModule,
625
+ IgoActivityModule.forRoot(),
626
+ IgoConfigModule.forRoot(),
627
+ IgoErrorModule.forRoot(),
628
+ IgoLanguageModule.forRoot(),
629
+ IgoMessageModule.forRoot()
630
+ ],
631
+ declarations: [],
632
+ exports: [
633
+ IgoActivityModule,
634
+ IgoConfigModule,
635
+ IgoErrorModule,
636
+ IgoLanguageModule,
637
+ IgoMessageModule
638
+ ]
639
+ }]
640
+ }], function () { return [{ type: i1$2.MatIconRegistry }, { type: i2$1.DomSanitizer }]; }, null); })();
641
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
642
+ HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule], exports: [IgoActivityModule,
643
+ IgoConfigModule,
644
+ IgoErrorModule,
645
+ IgoLanguageModule,
612
646
  IgoMessageModule] }); })();
613
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoCoreModule, [{
614
- type: NgModule,
615
- args: [{
616
- imports: [
617
- CommonModule,
618
- HttpClientModule,
619
- IgoActivityModule.forRoot(),
620
- IgoConfigModule.forRoot(),
621
- IgoErrorModule.forRoot(),
622
- IgoLanguageModule.forRoot(),
623
- IgoMessageModule.forRoot()
624
- ],
625
- declarations: [],
626
- exports: [
627
- IgoActivityModule,
628
- IgoConfigModule,
629
- IgoErrorModule,
630
- IgoLanguageModule,
631
- IgoMessageModule
632
- ]
633
- }]
634
- }], function () { return [{ type: MatIconRegistry }, { type: DomSanitizer }]; }, null); })();
635
647
 
636
- class IgoGestureConfig extends HammerGestureConfig {
637
- buildHammer(element) {
638
- const mc = super.buildHammer(element);
639
- mc.set({ touchAction: 'pan-y' });
640
- return mc;
641
- }
642
- }
643
- IgoGestureConfig.ɵfac = function IgoGestureConfig_Factory(t) { return ɵIgoGestureConfig_BaseFactory(t || IgoGestureConfig); };
644
- IgoGestureConfig.ɵprov = ɵɵdefineInjectable({ token: IgoGestureConfig, factory: IgoGestureConfig.ɵfac });
645
- const ɵIgoGestureConfig_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(IgoGestureConfig);
646
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoGestureConfig, [{
647
- type: Injectable
648
+ class IgoGestureConfig extends HammerGestureConfig {
649
+ buildHammer(element) {
650
+ const mc = super.buildHammer(element);
651
+ mc.set({ touchAction: 'pan-y' });
652
+ return mc;
653
+ }
654
+ }
655
+ IgoGestureConfig.ɵfac = /*@__PURE__*/ function () { let ɵIgoGestureConfig_BaseFactory; return function IgoGestureConfig_Factory(t) { return (ɵIgoGestureConfig_BaseFactory || (ɵIgoGestureConfig_BaseFactory = i0.ɵɵgetInheritedFactory(IgoGestureConfig)))(t || IgoGestureConfig); }; }();
656
+ IgoGestureConfig.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: IgoGestureConfig, factory: IgoGestureConfig.ɵfac });
657
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureConfig, [{
658
+ type: Injectable
648
659
  }], null, null); })();
649
660
 
650
- class IgoGestureModule {
651
- static forRoot() {
652
- return {
653
- ngModule: IgoGestureModule,
654
- providers: [
655
- {
656
- provide: HAMMER_GESTURE_CONFIG,
657
- useClass: IgoGestureConfig
658
- }
659
- ]
660
- };
661
- }
662
- }
663
- IgoGestureModule.ɵmod = ɵɵdefineNgModule({ type: IgoGestureModule });
664
- IgoGestureModule.ɵinj = ɵɵdefineInjector({ factory: function IgoGestureModule_Factory(t) { return new (t || IgoGestureModule)(); }, imports: [[HammerModule]] });
665
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoGestureModule, { imports: [HammerModule] }); })();
666
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoGestureModule, [{
667
- type: NgModule,
668
- args: [{
669
- imports: [HammerModule],
670
- declarations: [],
671
- exports: []
672
- }]
673
- }], null, null); })();
661
+ class IgoGestureModule {
662
+ static forRoot() {
663
+ return {
664
+ ngModule: IgoGestureModule,
665
+ providers: [
666
+ {
667
+ provide: HAMMER_GESTURE_CONFIG,
668
+ useClass: IgoGestureConfig
669
+ }
670
+ ]
671
+ };
672
+ }
673
+ }
674
+ IgoGestureModule.ɵfac = function IgoGestureModule_Factory(t) { return new (t || IgoGestureModule)(); };
675
+ IgoGestureModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoGestureModule });
676
+ IgoGestureModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[HammerModule]] });
677
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureModule, [{
678
+ type: NgModule,
679
+ args: [{
680
+ imports: [HammerModule],
681
+ declarations: [],
682
+ exports: []
683
+ }]
684
+ }], null, null); })();
685
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoGestureModule, { imports: [HammerModule] }); })();
674
686
 
675
- class LoggingInterceptor {
676
- intercept(req, next) {
677
- const started = Date.now();
678
- let ok;
679
- // extend server response observable with logging
680
- return next.handle(req).pipe(tap(
681
- // Succeeds when there is a response; ignore other events
682
- event => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
683
- // Operation failed; error is an HttpErrorResponse
684
- error => (ok = 'failed')),
685
- // Log when response observable either completes or errors
686
- finalize(() => {
687
- const elapsed = Date.now() - started;
688
- const msg = `${req.method} "${req.urlWithParams}"
689
- ${ok} in ${elapsed} ms.`;
690
- console.log(msg);
691
- }));
692
- }
693
- }
694
- LoggingInterceptor.ɵfac = function LoggingInterceptor_Factory(t) { return new (t || LoggingInterceptor)(); };
695
- LoggingInterceptor.ɵprov = ɵɵdefineInjectable({ token: LoggingInterceptor, factory: LoggingInterceptor.ɵfac });
696
- /*@__PURE__*/ (function () { ɵsetClassMetadata(LoggingInterceptor, [{
697
- type: Injectable
687
+ class LoggingInterceptor {
688
+ intercept(req, next) {
689
+ const started = Date.now();
690
+ let ok;
691
+ // extend server response observable with logging
692
+ return next.handle(req).pipe(tap(
693
+ // Succeeds when there is a response; ignore other events
694
+ event => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
695
+ // Operation failed; error is an HttpErrorResponse
696
+ error => (ok = 'failed')),
697
+ // Log when response observable either completes or errors
698
+ finalize(() => {
699
+ const elapsed = Date.now() - started;
700
+ const msg = `${req.method} "${req.urlWithParams}"
701
+ ${ok} in ${elapsed} ms.`;
702
+ console.log(msg);
703
+ }));
704
+ }
705
+ }
706
+ LoggingInterceptor.ɵfac = function LoggingInterceptor_Factory(t) { return new (t || LoggingInterceptor)(); };
707
+ LoggingInterceptor.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoggingInterceptor, factory: LoggingInterceptor.ɵfac });
708
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggingInterceptor, [{
709
+ type: Injectable
698
710
  }], null, null); })();
699
711
 
700
- class IgoLoggingModule {
701
- static forRoot() {
702
- return {
703
- ngModule: IgoLoggingModule,
704
- providers: [
705
- {
706
- provide: HTTP_INTERCEPTORS,
707
- useClass: LoggingInterceptor,
708
- multi: true
709
- }
710
- ]
711
- };
712
- }
713
- }
714
- IgoLoggingModule.ɵmod = ɵɵdefineNgModule({ type: IgoLoggingModule });
715
- IgoLoggingModule.ɵinj = ɵɵdefineInjector({ factory: function IgoLoggingModule_Factory(t) { return new (t || IgoLoggingModule)(); }, imports: [[]] });
716
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoLoggingModule, [{
717
- type: NgModule,
718
- args: [{
719
- imports: [],
720
- declarations: [],
721
- exports: []
722
- }]
712
+ class IgoLoggingModule {
713
+ static forRoot() {
714
+ return {
715
+ ngModule: IgoLoggingModule,
716
+ providers: [
717
+ {
718
+ provide: HTTP_INTERCEPTORS,
719
+ useClass: LoggingInterceptor,
720
+ multi: true
721
+ }
722
+ ]
723
+ };
724
+ }
725
+ }
726
+ IgoLoggingModule.ɵfac = function IgoLoggingModule_Factory(t) { return new (t || IgoLoggingModule)(); };
727
+ IgoLoggingModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLoggingModule });
728
+ IgoLoggingModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
729
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLoggingModule, [{
730
+ type: NgModule,
731
+ args: [{
732
+ imports: [],
733
+ declarations: [],
734
+ exports: []
735
+ }]
723
736
  }], null, null); })();
724
737
 
725
- let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
726
- function provideRouteServiceOptions(options) {
727
- return {
728
- provide: ROUTE_SERVICE_OPTIONS,
729
- useValue: options
730
- };
731
- }
732
- class RouteService {
733
- constructor(route, options) {
734
- this.route = route;
735
- const defaultOptions = {
736
- centerKey: 'center',
737
- zoomKey: 'zoom',
738
- projectionKey: 'projection',
739
- contextKey: 'context',
740
- searchKey: 'search',
741
- visibleOnLayersKey: 'visiblelayers',
742
- visibleOffLayersKey: 'invisiblelayers',
743
- directionsCoordKey: 'routing',
744
- toolKey: 'tool',
745
- wmsUrlKey: 'wmsUrl',
746
- wmsLayersKey: 'wmsLayers',
747
- wmtsUrlKey: 'wmtsUrl',
748
- wmtsLayersKey: 'wmtsLayers',
749
- arcgisUrlKey: 'arcgisUrl',
750
- arcgisLayersKey: 'arcgisLayers',
751
- iarcgisUrlKey: 'iarcgisUrl',
752
- iarcgisLayersKey: 'iarcgisLayers',
753
- tarcgisUrlKey: 'tarcgisUrl',
754
- tarcgisLayersKey: 'tarcgisLayers',
755
- vectorKey: 'vector'
756
- };
757
- this.options = Object.assign({}, defaultOptions, options);
758
- }
759
- get queryParams() {
760
- return this.route.queryParams;
761
- }
762
- }
763
- RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(ɵɵinject(ActivatedRoute), ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
764
- RouteService.ɵprov = ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
765
- /*@__PURE__*/ (function () { ɵsetClassMetadata(RouteService, [{
766
- type: Injectable,
767
- args: [{
768
- providedIn: 'root'
769
- }]
770
- }], function () { return [{ type: ActivatedRoute }, { type: undefined, decorators: [{
771
- type: Inject,
772
- args: [ROUTE_SERVICE_OPTIONS]
773
- }, {
774
- type: Optional
738
+ let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
739
+ function provideRouteServiceOptions(options) {
740
+ return {
741
+ provide: ROUTE_SERVICE_OPTIONS,
742
+ useValue: options
743
+ };
744
+ }
745
+ class RouteService {
746
+ constructor(route, options) {
747
+ this.route = route;
748
+ const defaultOptions = {
749
+ centerKey: 'center',
750
+ zoomKey: 'zoom',
751
+ projectionKey: 'projection',
752
+ contextKey: 'context',
753
+ searchKey: 'search',
754
+ visibleOnLayersKey: 'visiblelayers',
755
+ visibleOffLayersKey: 'invisiblelayers',
756
+ directionsCoordKey: 'routing',
757
+ toolKey: 'tool',
758
+ wmsUrlKey: 'wmsUrl',
759
+ wmsLayersKey: 'wmsLayers',
760
+ wmtsUrlKey: 'wmtsUrl',
761
+ wmtsLayersKey: 'wmtsLayers',
762
+ arcgisUrlKey: 'arcgisUrl',
763
+ arcgisLayersKey: 'arcgisLayers',
764
+ iarcgisUrlKey: 'iarcgisUrl',
765
+ iarcgisLayersKey: 'iarcgisLayers',
766
+ tarcgisUrlKey: 'tarcgisUrl',
767
+ tarcgisLayersKey: 'tarcgisLayers',
768
+ vectorKey: 'vector'
769
+ };
770
+ this.options = Object.assign({}, defaultOptions, options);
771
+ }
772
+ get queryParams() {
773
+ return this.route.queryParams;
774
+ }
775
+ }
776
+ RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$3.ActivatedRoute), i0.ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
777
+ RouteService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
778
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouteService, [{
779
+ type: Injectable,
780
+ args: [{
781
+ providedIn: 'root'
782
+ }]
783
+ }], function () { return [{ type: i1$3.ActivatedRoute }, { type: undefined, decorators: [{
784
+ type: Inject,
785
+ args: [ROUTE_SERVICE_OPTIONS]
786
+ }, {
787
+ type: Optional
775
788
  }] }]; }, null); })();
776
789
 
777
- class AnalyticsService {
778
- constructor(config) {
779
- this.config = config;
780
- this.options = this.config.getConfig('analytics') || {};
781
- if (this.options.provider === 'matomo') {
782
- this.initMatomo();
783
- }
784
- }
785
- get paq() {
786
- return (window._paq = window._paq || []);
787
- }
788
- initMatomo() {
789
- if (!this.options.url || !this.options.id) {
790
- return;
791
- }
792
- const url = this.options.url.substr(-1) === '/'
793
- ? this.options.url + 'matomo'
794
- : this.options.url;
795
- // this.paq.push(['trackPageView']);
796
- // this.paq.push(['enableLinkTracking']);
797
- (() => {
798
- this.paq.push(['setTrackerUrl', url + '.php']);
799
- this.paq.push(['setSiteId', this.options.id]);
800
- const g = document.createElement('script');
801
- const s = document.getElementsByTagName('script')[0];
802
- g.type = 'text/javascript';
803
- g.async = true;
804
- g.defer = true;
805
- g.src = url + '.js';
806
- s.parentNode.insertBefore(g, s);
807
- })();
808
- }
809
- setUser(user, profils) {
810
- if (this.options.provider === 'matomo') {
811
- if (!user) {
812
- this.paq.push(['resetUserId']);
813
- this.paq.push(['deleteCustomVariable', 1, 'user']);
814
- this.paq.push(['deleteCustomVariable', 2, 'name']);
815
- this.paq.push(['deleteCustomVariable', 3, 'profils']);
816
- }
817
- else {
818
- this.paq.push(['setUserId', user.id]);
819
- const name = `${user.firstName} ${user.lastName}`;
820
- this.paq.push(['setCustomVariable', 1, 'user', user.sourceId, 'visit']);
821
- this.paq.push(['setCustomVariable', 2, 'name', name, 'visit']);
822
- this.paq.push(['setCustomVariable', 3, 'profils', profils, 'visit']);
823
- }
824
- this.paq.push(['trackPageView']);
825
- this.paq.push(['enableLinkTracking']);
826
- }
827
- }
828
- trackSearch(term, nbResults) {
829
- if (this.options.provider === 'matomo') {
830
- this.paq.push(['trackSiteSearch', term, false, nbResults]);
831
- }
832
- }
833
- trackEvent(category, action, name) {
834
- if (this.options.provider === 'matomo') {
835
- this.paq.push(['trackEvent', category, action, name]);
836
- }
837
- }
838
- }
839
- AnalyticsService.ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(ɵɵinject(ConfigService)); };
840
- AnalyticsService.ɵprov = ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' });
841
- /*@__PURE__*/ (function () { ɵsetClassMetadata(AnalyticsService, [{
842
- type: Injectable,
843
- args: [{
844
- providedIn: 'root'
845
- }]
790
+ class AnalyticsService {
791
+ constructor(config) {
792
+ this.config = config;
793
+ this.options = this.config.getConfig('analytics') || {};
794
+ if (this.options.provider === 'matomo') {
795
+ this.initMatomo();
796
+ }
797
+ }
798
+ get paq() {
799
+ return (window._paq = window._paq || []);
800
+ }
801
+ initMatomo() {
802
+ if (!this.options.url || !this.options.id) {
803
+ return;
804
+ }
805
+ const url = this.options.url.substr(-1) === '/'
806
+ ? this.options.url + 'matomo'
807
+ : this.options.url;
808
+ // this.paq.push(['trackPageView']);
809
+ // this.paq.push(['enableLinkTracking']);
810
+ (() => {
811
+ this.paq.push(['setTrackerUrl', url + '.php']);
812
+ this.paq.push(['setSiteId', this.options.id]);
813
+ const g = document.createElement('script');
814
+ const s = document.getElementsByTagName('script')[0];
815
+ g.type = 'text/javascript';
816
+ g.async = true;
817
+ g.defer = true;
818
+ g.src = url + '.js';
819
+ s.parentNode.insertBefore(g, s);
820
+ })();
821
+ }
822
+ setUser(user, profils) {
823
+ if (this.options.provider === 'matomo') {
824
+ if (!user) {
825
+ this.paq.push(['resetUserId']);
826
+ this.paq.push(['deleteCustomVariable', 1, 'user']);
827
+ this.paq.push(['deleteCustomVariable', 2, 'name']);
828
+ this.paq.push(['deleteCustomVariable', 3, 'profils']);
829
+ }
830
+ else {
831
+ this.paq.push(['setUserId', user.id]);
832
+ const name = `${user.firstName} ${user.lastName}`;
833
+ this.paq.push(['setCustomVariable', 1, 'user', user.sourceId, 'visit']);
834
+ this.paq.push(['setCustomVariable', 2, 'name', name, 'visit']);
835
+ this.paq.push(['setCustomVariable', 3, 'profils', profils, 'visit']);
836
+ }
837
+ this.paq.push(['trackPageView']);
838
+ this.paq.push(['enableLinkTracking']);
839
+ }
840
+ }
841
+ trackSearch(term, nbResults) {
842
+ if (this.options.provider === 'matomo') {
843
+ this.paq.push(['trackSiteSearch', term, false, nbResults]);
844
+ }
845
+ }
846
+ trackEvent(category, action, name) {
847
+ if (this.options.provider === 'matomo') {
848
+ this.paq.push(['trackEvent', category, action, name]);
849
+ }
850
+ }
851
+ }
852
+ AnalyticsService.ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(i0.ɵɵinject(ConfigService)); };
853
+ AnalyticsService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' });
854
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnalyticsService, [{
855
+ type: Injectable,
856
+ args: [{
857
+ providedIn: 'root'
858
+ }]
846
859
  }], function () { return [{ type: ConfigService }]; }, null); })();
847
860
 
848
- var Media;
849
- (function (Media) {
850
- Media["Mobile"] = "mobile";
851
- Media["Tablet"] = "tablet";
852
- Media["Desktop"] = "desktop";
853
- })(Media || (Media = {}));
854
- var MediaOrientation;
855
- (function (MediaOrientation) {
856
- MediaOrientation["Portrait"] = "portrait";
857
- MediaOrientation["Landscape"] = "landscape";
861
+ var Media;
862
+ (function (Media) {
863
+ Media["Mobile"] = "mobile";
864
+ Media["Tablet"] = "tablet";
865
+ Media["Desktop"] = "desktop";
866
+ })(Media || (Media = {}));
867
+ var MediaOrientation;
868
+ (function (MediaOrientation) {
869
+ MediaOrientation["Portrait"] = "portrait";
870
+ MediaOrientation["Landscape"] = "landscape";
858
871
  })(MediaOrientation || (MediaOrientation = {}));
859
872
 
860
- class MediaService {
861
- constructor(breakpointObserver) {
862
- this.media$ = new BehaviorSubject(undefined);
863
- this.orientation$ = new BehaviorSubject(undefined);
864
- breakpointObserver
865
- .observe([Breakpoints.HandsetLandscape])
866
- .subscribe(res => {
867
- if (res.matches) {
868
- this.media$.next(Media.Mobile);
869
- this.orientation$.next(MediaOrientation.Landscape);
870
- }
871
- });
872
- breakpointObserver.observe([Breakpoints.HandsetPortrait]).subscribe(res => {
873
- if (res.matches) {
874
- this.media$.next(Media.Mobile);
875
- this.orientation$.next(MediaOrientation.Portrait);
876
- }
877
- });
878
- breakpointObserver.observe([Breakpoints.TabletLandscape]).subscribe(res => {
879
- if (res.matches) {
880
- this.media$.next(Media.Tablet);
881
- this.orientation$.next(MediaOrientation.Landscape);
882
- }
883
- });
884
- breakpointObserver.observe([Breakpoints.TabletPortrait]).subscribe(res => {
885
- if (res.matches) {
886
- this.media$.next(Media.Tablet);
887
- this.orientation$.next(MediaOrientation.Portrait);
888
- }
889
- });
890
- breakpointObserver.observe([Breakpoints.WebLandscape]).subscribe(res => {
891
- if (res.matches) {
892
- this.media$.next(Media.Desktop);
893
- this.orientation$.next(MediaOrientation.Landscape);
894
- }
895
- });
896
- breakpointObserver.observe([Breakpoints.WebPortrait]).subscribe(res => {
897
- if (res.matches) {
898
- this.media$.next(Media.Desktop);
899
- this.orientation$.next(MediaOrientation.Portrait);
900
- }
901
- });
902
- }
903
- getMedia() {
904
- return this.media$.value;
905
- }
906
- getOrientation() {
907
- return this.orientation$.value;
908
- }
909
- isTouchScreen() {
910
- return 'ontouchstart' in document.documentElement ? true : false;
911
- }
912
- isMobile() {
913
- const media = this.getMedia();
914
- return media === 'mobile';
915
- }
916
- isDesktop() {
917
- const media = this.getMedia();
918
- return media === 'desktop';
919
- }
920
- }
921
- MediaService.ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(ɵɵinject(BreakpointObserver)); };
922
- MediaService.ɵprov = ɵɵdefineInjectable({ token: MediaService, factory: MediaService.ɵfac, providedIn: 'root' });
923
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MediaService, [{
924
- type: Injectable,
925
- args: [{
926
- providedIn: 'root'
927
- }]
928
- }], function () { return [{ type: BreakpointObserver }]; }, null); })();
873
+ class MediaService {
874
+ constructor(breakpointObserver) {
875
+ this.media$ = new BehaviorSubject(undefined);
876
+ this.orientation$ = new BehaviorSubject(undefined);
877
+ breakpointObserver
878
+ .observe([Breakpoints.HandsetLandscape])
879
+ .subscribe(res => {
880
+ if (res.matches) {
881
+ this.media$.next(Media.Mobile);
882
+ this.orientation$.next(MediaOrientation.Landscape);
883
+ }
884
+ });
885
+ breakpointObserver.observe([Breakpoints.HandsetPortrait]).subscribe(res => {
886
+ if (res.matches) {
887
+ this.media$.next(Media.Mobile);
888
+ this.orientation$.next(MediaOrientation.Portrait);
889
+ }
890
+ });
891
+ breakpointObserver.observe([Breakpoints.TabletLandscape]).subscribe(res => {
892
+ if (res.matches) {
893
+ this.media$.next(Media.Tablet);
894
+ this.orientation$.next(MediaOrientation.Landscape);
895
+ }
896
+ });
897
+ breakpointObserver.observe([Breakpoints.TabletPortrait]).subscribe(res => {
898
+ if (res.matches) {
899
+ this.media$.next(Media.Tablet);
900
+ this.orientation$.next(MediaOrientation.Portrait);
901
+ }
902
+ });
903
+ breakpointObserver.observe([Breakpoints.WebLandscape]).subscribe(res => {
904
+ if (res.matches) {
905
+ this.media$.next(Media.Desktop);
906
+ this.orientation$.next(MediaOrientation.Landscape);
907
+ }
908
+ });
909
+ breakpointObserver.observe([Breakpoints.WebPortrait]).subscribe(res => {
910
+ if (res.matches) {
911
+ this.media$.next(Media.Desktop);
912
+ this.orientation$.next(MediaOrientation.Portrait);
913
+ }
914
+ });
915
+ }
916
+ getMedia() {
917
+ return this.media$.value;
918
+ }
919
+ getOrientation() {
920
+ return this.orientation$.value;
921
+ }
922
+ isTouchScreen() {
923
+ return 'ontouchstart' in document.documentElement ? true : false;
924
+ }
925
+ isMobile() {
926
+ const media = this.getMedia();
927
+ return media === 'mobile';
928
+ }
929
+ isDesktop() {
930
+ const media = this.getMedia();
931
+ return media === 'desktop';
932
+ }
933
+ }
934
+ MediaService.ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(i0.ɵɵinject(i1$4.BreakpointObserver)); };
935
+ MediaService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MediaService, factory: MediaService.ɵfac, providedIn: 'root' });
936
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MediaService, [{
937
+ type: Injectable,
938
+ args: [{
939
+ providedIn: 'root'
940
+ }]
941
+ }], function () { return [{ type: i1$4.BreakpointObserver }]; }, null); })();
929
942
 
930
- var StorageScope;
931
- (function (StorageScope) {
932
- StorageScope["SESSION"] = "Session";
933
- StorageScope["LOCAL"] = "Local";
934
- })(StorageScope || (StorageScope = {}));
935
- var StorageServiceEventEnum;
936
- (function (StorageServiceEventEnum) {
937
- StorageServiceEventEnum["ADDED"] = "Added";
938
- StorageServiceEventEnum["MODIFIED"] = "Modified";
939
- StorageServiceEventEnum["REMOVED"] = "Removed";
940
- StorageServiceEventEnum["CLEARED"] = "Cleared";
943
+ var StorageScope;
944
+ (function (StorageScope) {
945
+ StorageScope["SESSION"] = "Session";
946
+ StorageScope["LOCAL"] = "Local";
947
+ })(StorageScope || (StorageScope = {}));
948
+ var StorageServiceEventEnum;
949
+ (function (StorageServiceEventEnum) {
950
+ StorageServiceEventEnum["ADDED"] = "Added";
951
+ StorageServiceEventEnum["MODIFIED"] = "Modified";
952
+ StorageServiceEventEnum["REMOVED"] = "Removed";
953
+ StorageServiceEventEnum["CLEARED"] = "Cleared";
941
954
  })(StorageServiceEventEnum || (StorageServiceEventEnum = {}));
942
955
 
943
- class StorageService {
944
- constructor(config) {
945
- this.config = config;
946
- this.storageChange$ = new BehaviorSubject(undefined);
947
- this.options = this.config.getConfig('storage') || { key: 'igo' };
948
- }
949
- /**
950
- * Use to get the data found in storage file
951
- */
952
- get(key, scope) {
953
- let value;
954
- if (!scope || scope === StorageScope.SESSION) {
955
- value = sessionStorage.getItem(`${this.options.key}.${key}`);
956
- }
957
- if (scope === StorageScope.LOCAL || (!value && !scope)) {
958
- value = localStorage.getItem(`${this.options.key}.${key}`);
959
- }
960
- if (value) {
961
- try {
962
- value = JSON.parse(value);
963
- }
964
- catch (_a) {
965
- value = value;
966
- }
967
- }
968
- return value;
969
- }
970
- set(key, value, scope = StorageScope.LOCAL) {
971
- const previousValue = this.get(key, scope);
972
- if (scope === StorageScope.SESSION) {
973
- sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
974
- }
975
- else {
976
- localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
977
- }
978
- const currentValue = this.get(key, scope);
979
- if (currentValue !== previousValue) {
980
- this.storageChange$.next({
981
- key, scope,
982
- event: previousValue !== undefined ? StorageServiceEventEnum.MODIFIED : StorageServiceEventEnum.ADDED,
983
- previousValue,
984
- currentValue
985
- });
986
- }
987
- }
988
- remove(key, scope = StorageScope.LOCAL) {
989
- const previousValue = this.get(key, scope);
990
- if (scope === StorageScope.SESSION) {
991
- sessionStorage.removeItem(`${this.options.key}.${key}`);
992
- }
993
- else {
994
- localStorage.removeItem(`${this.options.key}.${key}`);
995
- }
996
- this.storageChange$.next({ key, scope, event: StorageServiceEventEnum.REMOVED, previousValue });
997
- }
998
- clear(scope = StorageScope.LOCAL) {
999
- if (scope === StorageScope.SESSION) {
1000
- sessionStorage.clear();
1001
- }
1002
- else {
1003
- localStorage.clear();
1004
- }
1005
- this.storageChange$.next({ scope, event: StorageServiceEventEnum.CLEARED });
1006
- }
1007
- }
1008
- StorageService.ɵfac = function StorageService_Factory(t) { return new (t || StorageService)(ɵɵinject(ConfigService)); };
1009
- StorageService.ɵprov = ɵɵdefineInjectable({ token: StorageService, factory: StorageService.ɵfac, providedIn: 'root' });
1010
- /*@__PURE__*/ (function () { ɵsetClassMetadata(StorageService, [{
1011
- type: Injectable,
1012
- args: [{
1013
- providedIn: 'root'
1014
- }]
956
+ class StorageService {
957
+ constructor(config) {
958
+ this.config = config;
959
+ this.storageChange$ = new BehaviorSubject(undefined);
960
+ this.options = this.config.getConfig('storage') || { key: 'igo' };
961
+ }
962
+ /**
963
+ * Use to get the data found in storage file
964
+ */
965
+ get(key, scope) {
966
+ let value;
967
+ if (!scope || scope === StorageScope.SESSION) {
968
+ value = sessionStorage.getItem(`${this.options.key}.${key}`);
969
+ }
970
+ if (scope === StorageScope.LOCAL || (!value && !scope)) {
971
+ value = localStorage.getItem(`${this.options.key}.${key}`);
972
+ }
973
+ if (value) {
974
+ try {
975
+ value = JSON.parse(value);
976
+ }
977
+ catch (_a) {
978
+ value = value;
979
+ }
980
+ }
981
+ return value;
982
+ }
983
+ set(key, value, scope = StorageScope.LOCAL) {
984
+ const previousValue = this.get(key, scope);
985
+ if (scope === StorageScope.SESSION) {
986
+ sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
987
+ }
988
+ else {
989
+ localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
990
+ }
991
+ const currentValue = this.get(key, scope);
992
+ if (currentValue !== previousValue) {
993
+ this.storageChange$.next({
994
+ key, scope,
995
+ event: previousValue !== undefined ? StorageServiceEventEnum.MODIFIED : StorageServiceEventEnum.ADDED,
996
+ previousValue,
997
+ currentValue
998
+ });
999
+ }
1000
+ }
1001
+ remove(key, scope = StorageScope.LOCAL) {
1002
+ const previousValue = this.get(key, scope);
1003
+ if (scope === StorageScope.SESSION) {
1004
+ sessionStorage.removeItem(`${this.options.key}.${key}`);
1005
+ }
1006
+ else {
1007
+ localStorage.removeItem(`${this.options.key}.${key}`);
1008
+ }
1009
+ this.storageChange$.next({ key, scope, event: StorageServiceEventEnum.REMOVED, previousValue });
1010
+ }
1011
+ clear(scope = StorageScope.LOCAL) {
1012
+ if (scope === StorageScope.SESSION) {
1013
+ sessionStorage.clear();
1014
+ }
1015
+ else {
1016
+ localStorage.clear();
1017
+ }
1018
+ this.storageChange$.next({ scope, event: StorageServiceEventEnum.CLEARED });
1019
+ }
1020
+ }
1021
+ StorageService.ɵfac = function StorageService_Factory(t) { return new (t || StorageService)(i0.ɵɵinject(ConfigService)); };
1022
+ StorageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: StorageService, factory: StorageService.ɵfac, providedIn: 'root' });
1023
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StorageService, [{
1024
+ type: Injectable,
1025
+ args: [{
1026
+ providedIn: 'root'
1027
+ }]
1015
1028
  }], function () { return [{ type: ConfigService }]; }, null); })();
1016
1029
 
1017
- class NetworkService {
1018
- constructor(messageService, injector) {
1019
- this.messageService = messageService;
1020
- this.injector = injector;
1021
- this.stateChangeEventEmitter = new EventEmitter();
1022
- this.state = {
1023
- connection: window.navigator.onLine
1024
- };
1025
- this.checkNetworkState();
1026
- }
1027
- checkNetworkState() {
1028
- this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
1029
- const translate = this.injector.get(LanguageService).translate;
1030
- const message = translate.instant('igo.core.network.online.message');
1031
- const title = translate.instant('igo.core.network.online.title');
1032
- this.messageService.info(message, title);
1033
- this.state.connection = true;
1034
- this.emitEvent();
1035
- });
1036
- this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
1037
- const translate = this.injector.get(LanguageService).translate;
1038
- const message = translate.instant('igo.core.network.offline.message');
1039
- const title = translate.instant('igo.core.network.offline.title');
1040
- this.messageService.info(message, title);
1041
- this.state.connection = false;
1042
- this.emitEvent();
1043
- });
1044
- }
1045
- emitEvent() {
1046
- this.stateChangeEventEmitter.emit(this.state);
1047
- }
1048
- ngOnDestroy() {
1049
- try {
1050
- this.offlineSubscription.unsubscribe();
1051
- this.onlineSubscription.unsubscribe();
1052
- }
1053
- catch (e) { }
1054
- }
1055
- currentState(reportState = true) {
1056
- return reportState
1057
- ? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
1058
- : this.stateChangeEventEmitter.pipe(debounceTime(300));
1059
- }
1060
- }
1061
- NetworkService.ɵfac = function NetworkService_Factory(t) { return new (t || NetworkService)(ɵɵinject(MessageService), ɵɵinject(Injector)); };
1062
- NetworkService.ɵprov = ɵɵdefineInjectable({ token: NetworkService, factory: NetworkService.ɵfac, providedIn: 'root' });
1063
- /*@__PURE__*/ (function () { ɵsetClassMetadata(NetworkService, [{
1064
- type: Injectable,
1065
- args: [{
1066
- providedIn: 'root'
1067
- }]
1068
- }], function () { return [{ type: MessageService }, { type: Injector }]; }, null); })();
1030
+ class NetworkService {
1031
+ constructor(messageService, injector) {
1032
+ this.messageService = messageService;
1033
+ this.injector = injector;
1034
+ this.stateChangeEventEmitter = new EventEmitter();
1035
+ this.state = {
1036
+ connection: window.navigator.onLine
1037
+ };
1038
+ this.checkNetworkState();
1039
+ }
1040
+ checkNetworkState() {
1041
+ this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
1042
+ const translate = this.injector.get(LanguageService).translate;
1043
+ const message = translate.instant('igo.core.network.online.message');
1044
+ const title = translate.instant('igo.core.network.online.title');
1045
+ this.messageService.info(message, title);
1046
+ this.state.connection = true;
1047
+ this.emitEvent();
1048
+ });
1049
+ this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
1050
+ const translate = this.injector.get(LanguageService).translate;
1051
+ const message = translate.instant('igo.core.network.offline.message');
1052
+ const title = translate.instant('igo.core.network.offline.title');
1053
+ this.messageService.info(message, title);
1054
+ this.state.connection = false;
1055
+ this.emitEvent();
1056
+ });
1057
+ }
1058
+ emitEvent() {
1059
+ this.stateChangeEventEmitter.emit(this.state);
1060
+ }
1061
+ ngOnDestroy() {
1062
+ try {
1063
+ this.offlineSubscription.unsubscribe();
1064
+ this.onlineSubscription.unsubscribe();
1065
+ }
1066
+ catch (e) { }
1067
+ }
1068
+ currentState(reportState = true) {
1069
+ return reportState
1070
+ ? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
1071
+ : this.stateChangeEventEmitter.pipe(debounceTime(300));
1072
+ }
1073
+ }
1074
+ NetworkService.ɵfac = function NetworkService_Factory(t) { return new (t || NetworkService)(i0.ɵɵinject(MessageService), i0.ɵɵinject(i0.Injector)); };
1075
+ NetworkService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NetworkService, factory: NetworkService.ɵfac, providedIn: 'root' });
1076
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NetworkService, [{
1077
+ type: Injectable,
1078
+ args: [{
1079
+ providedIn: 'root'
1080
+ }]
1081
+ }], function () { return [{ type: MessageService }, { type: i0.Injector }]; }, null); })();
1069
1082
 
1070
- /*
1071
- * Public API Surface of core
1083
+ /*
1084
+ * Public API Surface of core
1072
1085
  */
1073
1086
 
1074
- /**
1075
- * Generated bundle index. Do not edit.
1087
+ /**
1088
+ * Generated bundle index. Do not edit.
1076
1089
  */
1077
1090
 
1078
1091
  export { ActivityInterceptor, ActivityService, AnalyticsService, CONFIG_OPTIONS, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageCenterComponent, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };