@igo2/core 1.15.4 → 16.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_index.scss +8 -0
- package/assets/icons/mdi.svg +1 -1
- package/core-theme.scss +5 -0
- package/{esm2020 → esm2022}/igo2-core.mjs +4 -4
- package/{esm2020 → esm2022}/lib/activity/activity.interceptor.mjs +32 -30
- package/{esm2020 → esm2022}/lib/activity/activity.module.mjs +30 -30
- package/esm2022/lib/activity/activity.service.mjs +32 -0
- package/{esm2020 → esm2022}/lib/activity/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/analytics/index.mjs +2 -2
- package/{esm2020 → esm2022}/lib/analytics/shared/analytics.interface.mjs +2 -2
- package/esm2022/lib/analytics/shared/analytics.service.mjs +84 -0
- package/{esm2020 → esm2022}/lib/analytics/shared/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/compression/compressedData.interface.mjs +2 -2
- package/esm2022/lib/compression/compression.service.mjs +142 -0
- package/{esm2020 → esm2022}/lib/compression/index.mjs +3 -3
- package/esm2022/lib/config/config-deprecated.mjs +19 -0
- package/{esm2020 → esm2022}/lib/config/config.interface.mjs +2 -2
- package/{esm2020 → esm2022}/lib/config/config.module.mjs +23 -23
- package/{esm2020 → esm2022}/lib/config/config.provider.mjs +21 -21
- package/esm2022/lib/config/config.service.mjs +81 -0
- package/{esm2020 → esm2022}/lib/config/index.mjs +4 -4
- package/esm2022/lib/config/version.mjs +5 -0
- package/esm2022/lib/core.module.mjs +104 -0
- package/{esm2020 → esm2022}/lib/gesture/gesture.module.mjs +30 -30
- package/{esm2020 → esm2022}/lib/gesture/gesture.provider.mjs +16 -16
- package/{esm2020 → esm2022}/lib/language/index.mjs +2 -2
- package/esm2022/lib/language/language.module.mjs +39 -0
- package/{esm2020 → esm2022}/lib/language/shared/index.mjs +5 -5
- package/{esm2020 → esm2022}/lib/language/shared/language.interface.mjs +2 -2
- package/esm2022/lib/language/shared/language.loader.mjs +31 -0
- package/esm2022/lib/language/shared/language.provider.mjs +22 -0
- package/esm2022/lib/language/shared/language.service.mjs +38 -0
- package/{esm2020 → esm2022}/lib/language/shared/missing-translation.guard.mjs +16 -16
- package/{esm2020 → esm2022}/lib/media/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/media/media.enum.mjs +12 -12
- package/esm2022/lib/media/media.service.mjs +82 -0
- package/{esm2020 → esm2022}/lib/message/index.mjs +2 -2
- package/esm2022/lib/message/message.module.mjs +60 -0
- package/{esm2020 → esm2022}/lib/message/shared/index.mjs +4 -4
- package/{esm2020 → esm2022}/lib/message/shared/message.enum.mjs +10 -10
- package/esm2022/lib/message/shared/message.interface.mjs +2 -0
- package/esm2022/lib/message/shared/message.service.mjs +218 -0
- package/{esm2020 → esm2022}/lib/network/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/network/network.interfaces.mjs +2 -2
- package/esm2022/lib/network/network.service.mjs +66 -0
- package/{esm2020 → esm2022}/lib/regex/index.mjs +3 -3
- package/{esm2020 → esm2022}/lib/regex/regex.interface.mjs +2 -2
- package/esm2022/lib/regex/regex.service.mjs +30 -0
- package/esm2022/lib/request/error.interceptor.mjs +67 -0
- package/esm2022/lib/request/error.module.mjs +39 -0
- package/{esm2020 → esm2022}/lib/request/index.mjs +3 -3
- package/esm2022/lib/request/logging.interceptor.mjs +29 -0
- package/{esm2020 → esm2022}/lib/request/logging.module.mjs +30 -30
- package/esm2022/lib/route/route.interface.mjs +2 -0
- package/esm2022/lib/route/route.service.mjs +75 -0
- package/esm2022/lib/storage/index.mjs +4 -0
- package/{esm2020 → esm2022}/lib/storage/storage.interface.mjs +13 -13
- package/esm2022/lib/storage/storage.mjs +76 -0
- package/esm2022/lib/storage/storage.service.mjs +21 -0
- package/{esm2020 → esm2022}/public_api.mjs +28 -28
- package/{fesm2020 → fesm2022}/igo2-core.mjs +1411 -1289
- package/fesm2022/igo2-core.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/activity/activity.interceptor.d.ts +11 -11
- package/lib/activity/activity.module.d.ts +8 -8
- package/lib/activity/activity.service.d.ts +11 -11
- package/lib/activity/index.d.ts +2 -2
- package/lib/analytics/index.d.ts +1 -1
- package/lib/analytics/shared/analytics.interface.d.ts +6 -6
- package/lib/analytics/shared/analytics.service.d.ts +23 -23
- package/lib/analytics/shared/index.d.ts +2 -2
- package/lib/compression/compressedData.interface.d.ts +5 -5
- package/lib/compression/compression.service.d.ts +15 -15
- package/lib/compression/index.d.ts +2 -2
- package/lib/config/config-deprecated.d.ts +5 -0
- package/lib/config/config.interface.d.ts +13 -6
- package/lib/config/config.module.d.ts +8 -8
- package/lib/config/config.provider.d.ts +15 -15
- package/lib/config/config.service.d.ts +21 -18
- package/lib/config/index.d.ts +3 -3
- package/lib/config/version.d.ts +5 -5
- package/lib/core.module.d.ts +19 -19
- package/lib/gesture/gesture.module.d.ts +9 -9
- package/lib/gesture/gesture.provider.d.ts +7 -7
- package/lib/language/index.d.ts +1 -1
- package/lib/language/language.module.d.ts +9 -9
- package/lib/language/shared/index.d.ts +4 -4
- package/lib/language/shared/language.interface.d.ts +3 -3
- package/lib/language/shared/language.loader.d.ts +11 -11
- package/lib/language/shared/language.provider.d.ts +15 -15
- package/lib/language/shared/language.service.d.ts +13 -13
- package/lib/language/shared/missing-translation.guard.d.ts +4 -4
- package/lib/media/index.d.ts +2 -2
- package/lib/media/media.enum.d.ts +9 -9
- package/lib/media/media.service.d.ts +16 -16
- package/lib/message/index.d.ts +1 -1
- package/lib/message/message.module.d.ts +10 -10
- package/lib/message/message.theming.scss +26 -0
- package/lib/message/shared/index.d.ts +4 -4
- package/lib/message/shared/message.enum.d.ts +8 -8
- package/lib/message/shared/message.interface.d.ts +21 -21
- package/lib/message/shared/message.service.d.ts +31 -31
- package/lib/network/index.d.ts +2 -2
- package/lib/network/network.interfaces.d.ts +3 -3
- package/lib/network/network.service.d.ts +21 -21
- package/lib/regex/index.d.ts +2 -2
- package/lib/regex/regex.interface.d.ts +3 -3
- package/lib/regex/regex.service.d.ts +12 -12
- package/lib/request/error.interceptor.d.ts +14 -14
- package/lib/request/error.module.d.ts +9 -9
- package/lib/request/index.d.ts +2 -2
- package/lib/request/logging.interceptor.d.ts +8 -8
- package/lib/request/logging.module.d.ts +8 -8
- package/lib/route/route.interface.d.ts +23 -23
- package/lib/route/route.service.d.ts +19 -19
- package/lib/storage/index.d.ts +3 -2
- package/lib/storage/storage.d.ts +15 -0
- package/lib/storage/storage.interface.d.ts +20 -20
- package/lib/storage/storage.service.d.ts +10 -19
- package/locale/en.core.json +28 -29
- package/locale/en.json +1 -1205
- package/locale/fr.core.json +28 -29
- package/locale/fr.json +1 -1210
- package/package.json +40 -30
- package/packages.import.scss +4 -0
- package/public_api.d.ts +24 -24
- package/style/all-style.css +793 -0
- package/style/all-style.scss +3 -0
- package/style/layout.scss +163 -0
- package/style/partial/core-utils.scss +5 -0
- package/style/partial/core.variables.scss +5 -5
- package/style/partial/media.scss +80 -80
- package/style/style.css +237 -0
- package/style/style.scss +19 -0
- package/theming/all-theme.scss +14 -0
- package/theming/material-theme-override.scss +39 -0
- package/theming/prebuilt-themes/blue-theme.css +2982 -0
- package/theming/prebuilt-themes/blue-theme.scss +34 -0
- package/theming/prebuilt-themes/bluedark-theme.css +2982 -0
- package/theming/prebuilt-themes/bluedark-theme.scss +67 -0
- package/theming/prebuilt-themes/bluedq-theme.css +2982 -0
- package/theming/prebuilt-themes/bluedq-theme.scss +66 -0
- package/theming/prebuilt-themes/bluegrey-theme.css +2982 -0
- package/theming/prebuilt-themes/bluegrey-theme.scss +25 -0
- package/theming/prebuilt-themes/dark-theme.css +2989 -0
- package/theming/prebuilt-themes/dark-theme.scss +25 -0
- package/theming/prebuilt-themes/deeppurple-theme.css +2982 -0
- package/theming/prebuilt-themes/deeppurple-theme.scss +25 -0
- package/theming/prebuilt-themes/indigo-theme.css +2982 -0
- package/theming/prebuilt-themes/indigo-theme.scss +25 -0
- package/theming/prebuilt-themes/orange-theme.css +2982 -0
- package/theming/prebuilt-themes/orange-theme.scss +25 -0
- package/theming/prebuilt-themes/qcca/_index.scss +2 -0
- package/theming/prebuilt-themes/qcca/base/_index.scss +4 -0
- package/theming/prebuilt-themes/qcca/base/breakpoints.scss +57 -0
- package/theming/prebuilt-themes/qcca/base/colors.scss +40 -0
- package/theming/prebuilt-themes/qcca/base/palette.scss +50 -0
- package/theming/prebuilt-themes/qcca/base/typography/_index.scss +2 -0
- package/theming/prebuilt-themes/qcca/base/typography/typography.scss +138 -0
- package/theming/prebuilt-themes/qcca/base/typography/typography.utils.scss +18 -0
- package/theming/prebuilt-themes/qcca/components/_index.scss +10 -0
- package/theming/prebuilt-themes/qcca/components/_index.theme.scss +5 -0
- package/theming/prebuilt-themes/qcca/components/button.scss +24 -0
- package/theming/prebuilt-themes/qcca/components/dialog.scss +36 -0
- package/theming/prebuilt-themes/qcca/components/form-field.scss +5 -0
- package/theming/prebuilt-themes/qcca/components/input.scss +6 -0
- package/theming/prebuilt-themes/qcca/components/list.scss +24 -0
- package/theming/prebuilt-themes/qcca/components/panel.scss +8 -0
- package/theming/prebuilt-themes/qcca/components/scrollbar.scss +15 -0
- package/theming/prebuilt-themes/qcca/components/search-bar.scss +41 -0
- package/theming/prebuilt-themes/qcca/components/search-bar.theme.scss +29 -0
- package/theming/prebuilt-themes/qcca-theme.css +3383 -0
- package/theming/prebuilt-themes/qcca-theme.scss +47 -0
- package/theming/prebuilt-themes/teal-theme.css +2982 -0
- package/theming/prebuilt-themes/teal-theme.scss +25 -0
- package/theming/typography.scss +28 -0
- package/theming/utils/_foreground.scss +22 -0
- package/__ivy_ngcc__/locale/en.auth.json +0 -29
- package/__ivy_ngcc__/locale/en.common.json +0 -43
- package/__ivy_ngcc__/locale/en.context.json +0 -199
- package/__ivy_ngcc__/locale/en.core.json +0 -29
- package/__ivy_ngcc__/locale/en.geo.json +0 -805
- package/__ivy_ngcc__/locale/en.integration.json +0 -124
- package/__ivy_ngcc__/locale/en.json +0 -1205
- package/__ivy_ngcc__/locale/fr.auth.json +0 -32
- package/__ivy_ngcc__/locale/fr.common.json +0 -43
- package/__ivy_ngcc__/locale/fr.context.json +0 -199
- package/__ivy_ngcc__/locale/fr.core.json +0 -29
- package/__ivy_ngcc__/locale/fr.geo.json +0 -805
- package/__ivy_ngcc__/locale/fr.integration.json +0 -125
- package/__ivy_ngcc__/locale/fr.json +0 -1210
- package/esm2020/lib/activity/activity.service.mjs +0 -33
- package/esm2020/lib/analytics/shared/analytics.service.mjs +0 -81
- package/esm2020/lib/compression/compression.service.mjs +0 -140
- package/esm2020/lib/config/config.service.mjs +0 -52
- package/esm2020/lib/config/version.mjs +0 -5
- package/esm2020/lib/core.module.mjs +0 -92
- package/esm2020/lib/language/language.module.mjs +0 -39
- package/esm2020/lib/language/shared/language.loader.mjs +0 -26
- package/esm2020/lib/language/shared/language.provider.mjs +0 -22
- package/esm2020/lib/language/shared/language.service.mjs +0 -32
- package/esm2020/lib/media/media.service.mjs +0 -76
- package/esm2020/lib/message/message.module.mjs +0 -56
- package/esm2020/lib/message/shared/message.interface.mjs +0 -2
- package/esm2020/lib/message/shared/message.service.mjs +0 -201
- package/esm2020/lib/network/network.service.mjs +0 -60
- package/esm2020/lib/regex/regex.service.mjs +0 -27
- package/esm2020/lib/request/error.interceptor.mjs +0 -66
- package/esm2020/lib/request/error.module.mjs +0 -39
- package/esm2020/lib/request/logging.interceptor.mjs +0 -29
- package/esm2020/lib/route/route.interface.mjs +0 -2
- package/esm2020/lib/route/route.service.mjs +0 -71
- package/esm2020/lib/storage/index.mjs +0 -3
- package/esm2020/lib/storage/storage.service.mjs +0 -79
- package/fesm2015/igo2-core.mjs +0 -1418
- package/fesm2015/igo2-core.mjs.map +0 -1
- package/fesm2020/igo2-core.mjs.map +0 -1
- package/locale/en.auth.json +0 -29
- package/locale/en.common.json +0 -43
- package/locale/en.context.json +0 -199
- package/locale/en.geo.json +0 -805
- package/locale/en.integration.json +0 -124
- package/locale/fr.auth.json +0 -32
- package/locale/fr.common.json +0 -43
- package/locale/fr.context.json +0 -199
- package/locale/fr.geo.json +0 -805
- package/locale/fr.integration.json +0 -125
- package/style/all.theming.scss +0 -5
- package/style/core.theming.scss +0 -9
- package/style/foreground.scss +0 -20
- package/style/index.theming.scss +0 -1465
- package/style/material.font.scss +0 -10
- package/style/setup.scss +0 -2
- package/style/themes/blue.theme.scss +0 -19
- package/style/themes/bluedark.theme.scss +0 -52
- package/style/themes/bluedq.theme.scss +0 -52
- package/style/themes/bluegrey.theme.scss +0 -16
- package/style/themes/dark.theme.scss +0 -16
- package/style/themes/deeppurple.theme.scss +0 -16
- package/style/themes/indigo.theme.scss +0 -16
- package/style/themes/orange.theme.scss +0 -16
- package/style/themes/qcca.theme.scss +0 -98
- package/style/themes/teal.theme.scss +0 -16
- package/style/theming.scss +0 -5
- package/style/typography.scss +0 -17
|
@@ -1,1363 +1,1485 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Injector, Inject, Optional, SkipSelf, EventEmitter } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import
|
|
4
|
+
import * as i1 from '@angular/common/http';
|
|
5
|
+
import { HTTP_INTERCEPTORS, HttpClient, HttpBackend, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
|
|
6
|
+
import * as i2 from '@angular/platform-browser';
|
|
7
|
+
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
8
|
+
import * as i1$3 from '@angular/material/icon';
|
|
5
9
|
import { finalize, catchError, debounceTime, first, tap, startWith } from 'rxjs/operators';
|
|
6
10
|
import { BehaviorSubject, throwError, forkJoin, map, combineLatest, Observable, fromEvent } from 'rxjs';
|
|
7
11
|
import { uuid, ObjectUtils } from '@igo2/utils';
|
|
8
|
-
import * as i1 from '@ngx-translate/core';
|
|
12
|
+
import * as i1$1 from '@ngx-translate/core';
|
|
9
13
|
import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
|
|
10
|
-
import * as i1$
|
|
14
|
+
import * as i1$2 from 'ngx-toastr';
|
|
11
15
|
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
|
12
16
|
import * as i8 from 'ngx-indexed-db';
|
|
13
17
|
import { NgxIndexedDBModule } from 'ngx-indexed-db';
|
|
14
|
-
import * as i1$
|
|
15
|
-
import * as
|
|
16
|
-
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
|
|
17
|
-
import * as i1$3 from '@angular/router';
|
|
18
|
-
import * as i1$4 from '@angular/cdk/layout';
|
|
18
|
+
import * as i1$4 from '@angular/router';
|
|
19
|
+
import * as i1$5 from '@angular/cdk/layout';
|
|
19
20
|
import { Breakpoints } from '@angular/cdk/layout';
|
|
20
21
|
|
|
21
|
-
class ActivityService {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.ids.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.ids.
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}]
|
|
22
|
+
class ActivityService {
|
|
23
|
+
counter$ = new BehaviorSubject(0);
|
|
24
|
+
ids = [];
|
|
25
|
+
constructor() { }
|
|
26
|
+
register() {
|
|
27
|
+
const id = uuid();
|
|
28
|
+
this.ids.push(id);
|
|
29
|
+
this.counter$.next(this.ids.length);
|
|
30
|
+
return id;
|
|
31
|
+
}
|
|
32
|
+
unregister(id) {
|
|
33
|
+
const index = this.ids.indexOf(id);
|
|
34
|
+
if (index === -1) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.ids.splice(index, 1);
|
|
38
|
+
this.counter$.next(this.ids.length);
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = function ActivityService_Factory(t) { return new (t || ActivityService)(); };
|
|
41
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac, providedIn: 'root' });
|
|
42
|
+
}
|
|
43
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{
|
|
46
|
+
providedIn: 'root'
|
|
47
|
+
}]
|
|
48
48
|
}], function () { return []; }, null); })();
|
|
49
49
|
|
|
50
|
-
class ActivityInterceptor {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
50
|
+
class ActivityInterceptor {
|
|
51
|
+
activityService;
|
|
52
|
+
constructor(activityService) {
|
|
53
|
+
this.activityService = activityService;
|
|
54
|
+
}
|
|
55
|
+
intercept(req, next) {
|
|
56
|
+
const activity = req.headers.get('activityInterceptor');
|
|
57
|
+
if (activity) {
|
|
58
|
+
const actReq = req.clone({
|
|
59
|
+
headers: req.headers.delete('activityInterceptor')
|
|
60
|
+
});
|
|
61
|
+
if (activity === 'false') {
|
|
62
|
+
return next.handle(actReq);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const id = this.activityService.register();
|
|
66
|
+
return next.handle(req).pipe(finalize(() => {
|
|
67
|
+
this.activityService.unregister(id);
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
static ɵfac = function ActivityInterceptor_Factory(t) { return new (t || ActivityInterceptor)(i0.ɵɵinject(ActivityService)); };
|
|
71
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityInterceptor, factory: ActivityInterceptor.ɵfac });
|
|
72
|
+
}
|
|
73
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityInterceptor, [{
|
|
74
|
+
type: Injectable
|
|
74
75
|
}], function () { return [{ type: ActivityService }]; }, null); })();
|
|
75
76
|
|
|
76
|
-
class IgoActivityModule {
|
|
77
|
-
static forRoot() {
|
|
78
|
-
return {
|
|
79
|
-
ngModule: IgoActivityModule,
|
|
80
|
-
providers: [
|
|
81
|
-
{
|
|
82
|
-
provide: HTTP_INTERCEPTORS,
|
|
83
|
-
useClass: ActivityInterceptor,
|
|
84
|
-
multi: true
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoActivityModule, [{
|
|
94
|
-
type: NgModule,
|
|
95
|
-
args: [{
|
|
96
|
-
imports: [],
|
|
97
|
-
declarations: [],
|
|
98
|
-
exports: []
|
|
99
|
-
}]
|
|
77
|
+
class IgoActivityModule {
|
|
78
|
+
static forRoot() {
|
|
79
|
+
return {
|
|
80
|
+
ngModule: IgoActivityModule,
|
|
81
|
+
providers: [
|
|
82
|
+
{
|
|
83
|
+
provide: HTTP_INTERCEPTORS,
|
|
84
|
+
useClass: ActivityInterceptor,
|
|
85
|
+
multi: true
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static ɵfac = function IgoActivityModule_Factory(t) { return new (t || IgoActivityModule)(); };
|
|
91
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoActivityModule });
|
|
92
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
93
|
+
}
|
|
94
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoActivityModule, [{
|
|
95
|
+
type: NgModule,
|
|
96
|
+
args: [{
|
|
97
|
+
imports: [],
|
|
98
|
+
declarations: [],
|
|
99
|
+
exports: []
|
|
100
|
+
}]
|
|
100
101
|
}], null, null); })();
|
|
101
102
|
|
|
102
|
-
const version = {
|
|
103
|
-
lib: '
|
|
104
|
-
releaseDate:
|
|
103
|
+
const version = {
|
|
104
|
+
lib: '16.0.0-rc.1',
|
|
105
|
+
releaseDate: 1695395320530
|
|
105
106
|
};
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
const http = this.injector.get(HttpClient);
|
|
128
|
-
return new Promise((resolve, _reject) => {
|
|
129
|
-
http
|
|
130
|
-
.get(options.path)
|
|
131
|
-
.pipe(catchError((error) => {
|
|
132
|
-
console.log(`Configuration file ${options.path} could not be read`);
|
|
133
|
-
resolve(true);
|
|
134
|
-
return throwError(error.error || 'Server error');
|
|
135
|
-
}))
|
|
136
|
-
.subscribe((configResponse) => {
|
|
137
|
-
this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
|
|
138
|
-
resolve(true);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
ConfigService.ɵfac = function ConfigService_Factory(t) { return new (t || ConfigService)(i0.ɵɵinject(i0.Injector)); };
|
|
144
|
-
ConfigService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConfigService, factory: ConfigService.ɵfac, providedIn: 'root' });
|
|
145
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfigService, [{
|
|
146
|
-
type: Injectable,
|
|
147
|
-
args: [{
|
|
148
|
-
providedIn: 'root'
|
|
149
|
-
}]
|
|
150
|
-
}], function () { return [{ type: i0.Injector }]; }, null); })();
|
|
108
|
+
const CONFIG_DEPRECATED = {
|
|
109
|
+
showMenuButton: {
|
|
110
|
+
alternativeKey: 'menu.button.visible',
|
|
111
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
112
|
+
},
|
|
113
|
+
menuButtonReverseColor: {
|
|
114
|
+
alternativeKey: 'menu.button.useThemeColor',
|
|
115
|
+
mayBeRemoveIn: new Date('2024-06-06')
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const ALTERNATE_CONFIG_FROM_DEPRECATION = new Map(Object.entries(CONFIG_DEPRECATED)
|
|
119
|
+
.filter(([_, options]) => options.alternativeKey)
|
|
120
|
+
.map(([key, options]) => [
|
|
121
|
+
options.alternativeKey,
|
|
122
|
+
{
|
|
123
|
+
deprecatedKey: key
|
|
124
|
+
}
|
|
125
|
+
]));
|
|
151
126
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
127
|
+
class ConfigService {
|
|
128
|
+
config = {};
|
|
129
|
+
httpClient;
|
|
130
|
+
configDeprecated = new Map(Object.entries(CONFIG_DEPRECATED));
|
|
131
|
+
constructor(handler) {
|
|
132
|
+
this.httpClient = new HttpClient(handler);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Use to get the data found in config file
|
|
136
|
+
*/
|
|
137
|
+
getConfig(key) {
|
|
138
|
+
const value = ObjectUtils.resolve(this.config, key);
|
|
139
|
+
const isDeprecated = this.configDeprecated.get(key);
|
|
140
|
+
if (isDeprecated) {
|
|
141
|
+
this.handleDeprecatedConfig(key);
|
|
142
|
+
}
|
|
143
|
+
else if (value === undefined) {
|
|
144
|
+
return this.handleDeprecationPossibility(key);
|
|
145
|
+
}
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
handleDeprecatedConfig(key) {
|
|
149
|
+
const options = this.configDeprecated.get(key);
|
|
150
|
+
let message = `This config (${key}) is deprecated and will be removed shortly`;
|
|
151
|
+
if (options.alternativeKey) {
|
|
152
|
+
message += ` You should use this key (${options.alternativeKey}) as an alternate solution`;
|
|
153
|
+
}
|
|
154
|
+
const currentDate = new Date();
|
|
155
|
+
currentDate >= options.mayBeRemoveIn
|
|
156
|
+
? console.error(message)
|
|
157
|
+
: console.warn(message);
|
|
158
|
+
}
|
|
159
|
+
handleDeprecationPossibility(key) {
|
|
160
|
+
const options = ALTERNATE_CONFIG_FROM_DEPRECATION.get(key);
|
|
161
|
+
if (!options) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
return this.getConfig(options.deprecatedKey);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* This method loads "[path]" to get all config's variables
|
|
168
|
+
*/
|
|
169
|
+
load(options) {
|
|
170
|
+
const baseConfig = options.default || {};
|
|
171
|
+
if (!options.path) {
|
|
172
|
+
this.config = baseConfig;
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return new Promise((resolve, _reject) => {
|
|
176
|
+
this.httpClient
|
|
177
|
+
.get(options.path)
|
|
178
|
+
.pipe(catchError((error) => {
|
|
179
|
+
console.log(`Configuration file ${options.path} could not be read`);
|
|
180
|
+
resolve(true);
|
|
181
|
+
return throwError(error.error || 'Server error');
|
|
182
|
+
}))
|
|
183
|
+
.subscribe((configResponse) => {
|
|
184
|
+
this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
|
|
185
|
+
resolve(true);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
static ɵfac = function ConfigService_Factory(t) { return new (t || ConfigService)(i0.ɵɵinject(i1.HttpBackend)); };
|
|
190
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConfigService, factory: ConfigService.ɵfac, providedIn: 'root' });
|
|
169
191
|
}
|
|
192
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfigService, [{
|
|
193
|
+
type: Injectable,
|
|
194
|
+
args: [{
|
|
195
|
+
providedIn: 'root'
|
|
196
|
+
}]
|
|
197
|
+
}], function () { return [{ type: i1.HttpBackend }]; }, null); })();
|
|
170
198
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
let CONFIG_OPTIONS = new InjectionToken('configOptions');
|
|
200
|
+
function provideConfigOptions(options) {
|
|
201
|
+
return {
|
|
202
|
+
provide: CONFIG_OPTIONS,
|
|
203
|
+
useValue: options
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function configFactory(configService, options) {
|
|
207
|
+
return () => configService.load(options);
|
|
208
|
+
}
|
|
209
|
+
function provideConfigLoader() {
|
|
210
|
+
return {
|
|
211
|
+
provide: APP_INITIALIZER,
|
|
212
|
+
useFactory: configFactory,
|
|
213
|
+
multi: true,
|
|
214
|
+
deps: [ConfigService, CONFIG_OPTIONS]
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
class IgoConfigModule {
|
|
219
|
+
static forRoot() {
|
|
220
|
+
return {
|
|
221
|
+
ngModule: IgoConfigModule,
|
|
222
|
+
providers: [provideConfigOptions({}), provideConfigLoader()]
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
static ɵfac = function IgoConfigModule_Factory(t) { return new (t || IgoConfigModule)(); };
|
|
226
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoConfigModule });
|
|
227
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
228
|
+
}
|
|
229
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoConfigModule, [{
|
|
230
|
+
type: NgModule,
|
|
231
|
+
args: [{
|
|
232
|
+
imports: [],
|
|
233
|
+
declarations: [],
|
|
234
|
+
exports: []
|
|
235
|
+
}]
|
|
189
236
|
}], null, null); })();
|
|
190
237
|
|
|
191
|
-
class LanguageLoader {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}));
|
|
212
|
-
|
|
238
|
+
class LanguageLoader {
|
|
239
|
+
prefix;
|
|
240
|
+
suffix;
|
|
241
|
+
config;
|
|
242
|
+
httpClient;
|
|
243
|
+
constructor(handler, prefix, suffix = '.json', config) {
|
|
244
|
+
this.prefix = prefix;
|
|
245
|
+
this.suffix = suffix;
|
|
246
|
+
this.config = config;
|
|
247
|
+
this.httpClient = new HttpClient(handler);
|
|
248
|
+
}
|
|
249
|
+
getTranslation(lang) {
|
|
250
|
+
const igoLocale$ = this.httpClient.get(`locale/libs_locale/${lang}.json`);
|
|
251
|
+
if (this.config && !this.prefix) {
|
|
252
|
+
const prefix = this.config.getConfig('language.prefix');
|
|
253
|
+
this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
|
|
254
|
+
}
|
|
255
|
+
if (!this.prefix || this.prefix.length === 0) {
|
|
256
|
+
return igoLocale$;
|
|
257
|
+
}
|
|
258
|
+
const appLocale$ = this.prefix.map((prefix) => this.httpClient.get(`${prefix}${lang}${this.suffix}`));
|
|
259
|
+
const locale$ = forkJoin([igoLocale$, ...appLocale$]);
|
|
260
|
+
return locale$.pipe(map((translations) => {
|
|
261
|
+
return translations.reduce((acc, current) => ObjectUtils.mergeDeep(acc, current), {});
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
213
264
|
}
|
|
214
265
|
|
|
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: [
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
function provideDefaultLanguageLoader(loader) {
|
|
226
|
-
return {
|
|
227
|
-
provide: TranslateLoader,
|
|
228
|
-
useFactory: loader || defaultLanguageLoader,
|
|
229
|
-
deps: [
|
|
230
|
-
};
|
|
266
|
+
function defaultLanguageLoader(http, config) {
|
|
267
|
+
return new LanguageLoader(http, undefined, undefined, config);
|
|
268
|
+
}
|
|
269
|
+
function provideLanguageLoader(loader) {
|
|
270
|
+
return {
|
|
271
|
+
provide: TranslateLoader,
|
|
272
|
+
useFactory: loader || defaultLanguageLoader,
|
|
273
|
+
deps: [HttpBackend]
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function provideDefaultLanguageLoader(loader) {
|
|
277
|
+
return {
|
|
278
|
+
provide: TranslateLoader,
|
|
279
|
+
useFactory: loader || defaultLanguageLoader,
|
|
280
|
+
deps: [HttpBackend, ConfigService]
|
|
281
|
+
};
|
|
231
282
|
}
|
|
232
283
|
|
|
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
|
-
}
|
|
284
|
+
class IgoMissingTranslationHandler {
|
|
285
|
+
handle(params) {
|
|
286
|
+
if (!params.translateService.langs.length) {
|
|
287
|
+
const error = 'Translations are not yet loaded. \
|
|
288
|
+
Check that the LanguageService is injected.';
|
|
289
|
+
throw new Error(error);
|
|
290
|
+
}
|
|
291
|
+
if (params.key.substr(0, 4) === 'igo.') {
|
|
292
|
+
throw new Error(`The Key "${params.key}" is missing in locale file.`);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
return params.key;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
247
298
|
}
|
|
248
299
|
|
|
249
|
-
class IgoLanguageModule {
|
|
250
|
-
static forRoot() {
|
|
251
|
-
return {
|
|
252
|
-
ngModule: IgoLanguageModule,
|
|
253
|
-
providers: [provideDefaultLanguageLoader()]
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLanguageModule, [{
|
|
266
|
-
type: NgModule,
|
|
267
|
-
args: [{
|
|
268
|
-
imports: [
|
|
269
|
-
TranslateModule.forRoot({
|
|
270
|
-
missingTranslationHandler: {
|
|
271
|
-
provide: MissingTranslationHandler,
|
|
272
|
-
useClass: IgoMissingTranslationHandler
|
|
273
|
-
}
|
|
274
|
-
})
|
|
275
|
-
],
|
|
276
|
-
declarations: [],
|
|
277
|
-
exports: [TranslateModule]
|
|
278
|
-
}]
|
|
279
|
-
}], null, null); })();
|
|
280
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [i1.TranslateModule], exports: [TranslateModule] }); })();
|
|
300
|
+
class IgoLanguageModule {
|
|
301
|
+
static forRoot() {
|
|
302
|
+
return {
|
|
303
|
+
ngModule: IgoLanguageModule,
|
|
304
|
+
providers: [provideDefaultLanguageLoader()]
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
static ɵfac = function IgoLanguageModule_Factory(t) { return new (t || IgoLanguageModule)(); };
|
|
308
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLanguageModule });
|
|
309
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [TranslateModule.forRoot({
|
|
310
|
+
missingTranslationHandler: {
|
|
311
|
+
provide: MissingTranslationHandler,
|
|
312
|
+
useClass: IgoMissingTranslationHandler
|
|
313
|
+
}
|
|
314
|
+
}), TranslateModule] });
|
|
315
|
+
}
|
|
316
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLanguageModule, [{
|
|
317
|
+
type: NgModule,
|
|
318
|
+
args: [{
|
|
319
|
+
imports: [
|
|
320
|
+
TranslateModule.forRoot({
|
|
321
|
+
missingTranslationHandler: {
|
|
322
|
+
provide: MissingTranslationHandler,
|
|
323
|
+
useClass: IgoMissingTranslationHandler
|
|
324
|
+
}
|
|
325
|
+
})
|
|
326
|
+
],
|
|
327
|
+
declarations: [],
|
|
328
|
+
exports: [TranslateModule]
|
|
329
|
+
}]
|
|
330
|
+
}], null, null); })();
|
|
331
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [i1$1.TranslateModule], exports: [TranslateModule] }); })();
|
|
281
332
|
|
|
282
|
-
class IgoMessageModule {
|
|
283
|
-
static forRoot() {
|
|
284
|
-
return {
|
|
285
|
-
ngModule: IgoMessageModule,
|
|
286
|
-
providers: []
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
333
|
+
class IgoMessageModule {
|
|
334
|
+
static forRoot() {
|
|
335
|
+
return {
|
|
336
|
+
ngModule: IgoMessageModule,
|
|
337
|
+
providers: []
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
static ɵfac = function IgoMessageModule_Factory(t) { return new (t || IgoMessageModule)(); };
|
|
341
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoMessageModule });
|
|
342
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
343
|
+
ToastrModule.forRoot({
|
|
344
|
+
positionClass: 'toast-bottom-right',
|
|
345
|
+
timeOut: 10000,
|
|
346
|
+
extendedTimeOut: 10000,
|
|
347
|
+
titleClass: 'mat-subtitle-2',
|
|
348
|
+
messageClass: 'toast-message',
|
|
349
|
+
closeButton: true,
|
|
350
|
+
progressBar: true,
|
|
351
|
+
enableHtml: true,
|
|
352
|
+
tapToDismiss: true,
|
|
353
|
+
maxOpened: 4,
|
|
354
|
+
preventDuplicates: true,
|
|
355
|
+
resetTimeoutOnDuplicate: true,
|
|
356
|
+
countDuplicates: false,
|
|
357
|
+
includeTitleDuplicates: true
|
|
358
|
+
})] });
|
|
359
|
+
}
|
|
360
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoMessageModule, [{
|
|
361
|
+
type: NgModule,
|
|
362
|
+
args: [{
|
|
363
|
+
imports: [
|
|
364
|
+
CommonModule,
|
|
365
|
+
ToastrModule.forRoot({
|
|
366
|
+
positionClass: 'toast-bottom-right',
|
|
367
|
+
timeOut: 10000,
|
|
368
|
+
extendedTimeOut: 10000,
|
|
369
|
+
titleClass: 'mat-subtitle-2',
|
|
370
|
+
messageClass: 'toast-message',
|
|
371
|
+
closeButton: true,
|
|
372
|
+
progressBar: true,
|
|
373
|
+
enableHtml: true,
|
|
374
|
+
tapToDismiss: true,
|
|
375
|
+
maxOpened: 4,
|
|
376
|
+
preventDuplicates: true,
|
|
377
|
+
resetTimeoutOnDuplicate: true,
|
|
378
|
+
countDuplicates: false,
|
|
379
|
+
includeTitleDuplicates: true
|
|
380
|
+
})
|
|
381
|
+
],
|
|
382
|
+
declarations: [],
|
|
383
|
+
exports: []
|
|
384
|
+
}]
|
|
385
|
+
}], null, null); })();
|
|
386
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { imports: [CommonModule, i1$2.ToastrModule] }); })();
|
|
332
387
|
|
|
333
|
-
var MessageType;
|
|
334
|
-
(function (MessageType) {
|
|
335
|
-
MessageType["ERROR"] = "error";
|
|
336
|
-
MessageType["ALERT"] = "warning";
|
|
337
|
-
MessageType["WARNING"] = "warning";
|
|
338
|
-
MessageType["INFO"] = "info";
|
|
339
|
-
MessageType["SUCCESS"] = "success";
|
|
340
|
-
MessageType["SHOW"] = "show";
|
|
388
|
+
var MessageType;
|
|
389
|
+
(function (MessageType) {
|
|
390
|
+
MessageType["ERROR"] = "error";
|
|
391
|
+
MessageType["ALERT"] = "warning";
|
|
392
|
+
MessageType["WARNING"] = "warning";
|
|
393
|
+
MessageType["INFO"] = "info";
|
|
394
|
+
MessageType["SUCCESS"] = "success";
|
|
395
|
+
MessageType["SHOW"] = "show";
|
|
341
396
|
})(MessageType || (MessageType = {}));
|
|
342
397
|
|
|
343
|
-
class LanguageService {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
this.translate.
|
|
350
|
-
this.
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
398
|
+
class LanguageService {
|
|
399
|
+
translate;
|
|
400
|
+
language;
|
|
401
|
+
language$ = new BehaviorSubject(undefined);
|
|
402
|
+
constructor(translate) {
|
|
403
|
+
this.translate = translate;
|
|
404
|
+
this.language = this.translate.getBrowserLang();
|
|
405
|
+
const lang = this.getLanguage();
|
|
406
|
+
this.translate.setDefaultLang(lang);
|
|
407
|
+
this.language$.next(lang);
|
|
408
|
+
}
|
|
409
|
+
getLanguage() {
|
|
410
|
+
return this.language.match(/en|fr/) ? this.language : 'en';
|
|
411
|
+
}
|
|
412
|
+
setLanguage(language) {
|
|
413
|
+
this.language = language.match(/en|fr/) ? language : 'en';
|
|
414
|
+
combineLatest([
|
|
415
|
+
this.translate.use(this.language),
|
|
416
|
+
this.translate.reloadLang(this.language)
|
|
417
|
+
]).subscribe(() => {
|
|
418
|
+
this.language$.next(this.language);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
static ɵfac = function LanguageService_Factory(t) { return new (t || LanguageService)(i0.ɵɵinject(i1$1.TranslateService)); };
|
|
422
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LanguageService, factory: LanguageService.ɵfac, providedIn: 'root' });
|
|
423
|
+
}
|
|
424
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageService, [{
|
|
425
|
+
type: Injectable,
|
|
426
|
+
args: [{
|
|
427
|
+
providedIn: 'root'
|
|
428
|
+
}]
|
|
429
|
+
}], function () { return [{ type: i1$1.TranslateService }]; }, null); })();
|
|
370
430
|
|
|
371
|
-
class MessageService {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
396
|
-
if (activeMessageTranslation.
|
|
397
|
-
Object.keys(activeMessageTranslation.
|
|
398
|
-
if (k) {
|
|
399
|
-
|
|
400
|
-
this.languageService.translate.instant(activeMessageTranslation.
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
431
|
+
class MessageService {
|
|
432
|
+
injector;
|
|
433
|
+
configService;
|
|
434
|
+
languageService;
|
|
435
|
+
messages$ = new BehaviorSubject([]);
|
|
436
|
+
options;
|
|
437
|
+
activeMessageTranslations = [];
|
|
438
|
+
constructor(injector, configService, languageService) {
|
|
439
|
+
this.injector = injector;
|
|
440
|
+
this.configService = configService;
|
|
441
|
+
this.languageService = languageService;
|
|
442
|
+
this.options = this.configService.getConfig('message');
|
|
443
|
+
this.languageService.language$.pipe(debounceTime(500)).subscribe((r) => {
|
|
444
|
+
if (this.toastr.toasts.length === 0) {
|
|
445
|
+
this.activeMessageTranslations = [];
|
|
446
|
+
}
|
|
447
|
+
this.toastr.toasts.map((toast) => {
|
|
448
|
+
const activeMessageTranslation = this.activeMessageTranslations.find((amt) => amt.id === toast.toastId);
|
|
449
|
+
if (activeMessageTranslation) {
|
|
450
|
+
const translatedTextInterpolateParams = {
|
|
451
|
+
...activeMessageTranslation.textInterpolateParams
|
|
452
|
+
};
|
|
453
|
+
const translatedTitleInterpolateParams = {
|
|
454
|
+
...activeMessageTranslation.titleInterpolateParams
|
|
455
|
+
};
|
|
456
|
+
if (activeMessageTranslation.textInterpolateParams) {
|
|
457
|
+
Object.keys(activeMessageTranslation.textInterpolateParams).map((k) => {
|
|
458
|
+
if (k) {
|
|
459
|
+
translatedTextInterpolateParams[k] =
|
|
460
|
+
this.languageService.translate.instant(activeMessageTranslation.textInterpolateParams[k]);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
if (activeMessageTranslation.titleInterpolateParams) {
|
|
465
|
+
Object.keys(activeMessageTranslation.titleInterpolateParams).map((k) => {
|
|
466
|
+
if (k) {
|
|
467
|
+
translatedTitleInterpolateParams[k] =
|
|
468
|
+
this.languageService.translate.instant(activeMessageTranslation.titleInterpolateParams[k]);
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
forkJoin([
|
|
473
|
+
this.languageService.translate.get(activeMessageTranslation.textKey, translatedTextInterpolateParams),
|
|
474
|
+
this.languageService.translate.get(activeMessageTranslation.titleKey, translatedTitleInterpolateParams)
|
|
475
|
+
])
|
|
476
|
+
.pipe(first())
|
|
477
|
+
.subscribe((res) => {
|
|
478
|
+
toast.toastRef.componentInstance.message = res[0];
|
|
479
|
+
toast.toastRef.componentInstance.title = res[1];
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
get toastr() {
|
|
486
|
+
return this.injector.get(ToastrService);
|
|
487
|
+
}
|
|
488
|
+
showError(httpError) {
|
|
489
|
+
httpError.error.caught = true;
|
|
490
|
+
return this.error(httpError.error.message, httpError.error.title);
|
|
491
|
+
}
|
|
492
|
+
message(message) {
|
|
493
|
+
const messageType = message.type;
|
|
494
|
+
this.toastr.toastrConfig.iconClasses[messageType] = `toast-${messageType}`;
|
|
495
|
+
this.messages$.next(this.messages$.value.concat([message]));
|
|
496
|
+
message.options = message.options || {};
|
|
497
|
+
const currentDate = new Date();
|
|
498
|
+
message.options.from = message.options.from
|
|
499
|
+
? message.options.from
|
|
500
|
+
: new Date('1 jan 1900');
|
|
501
|
+
message.options.to = message.options.to
|
|
502
|
+
? message.options.to
|
|
503
|
+
: new Date('1 jan 3000');
|
|
504
|
+
if (typeof message.options.from === 'string') {
|
|
505
|
+
message.options.from = new Date(Date.parse(message.options.from.replace(/-/g, ' ')));
|
|
506
|
+
}
|
|
507
|
+
if (typeof message.options.to === 'string') {
|
|
508
|
+
message.options.to = new Date(Date.parse(message.options.to.replace(/-/g, ' ')));
|
|
509
|
+
}
|
|
510
|
+
if (currentDate > message.options.from &&
|
|
511
|
+
currentDate < message.options.to) {
|
|
512
|
+
if (message.showIcon === false) {
|
|
513
|
+
this.toastr.toastrConfig.iconClasses[messageType] = `toast-${messageType} toast-no-icon`;
|
|
514
|
+
}
|
|
515
|
+
message = this.handleTemplate(message);
|
|
516
|
+
if (message.text) {
|
|
517
|
+
let messageShown;
|
|
518
|
+
switch (message.type) {
|
|
519
|
+
case MessageType.SUCCESS:
|
|
520
|
+
messageShown = this.success(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
521
|
+
break;
|
|
522
|
+
case MessageType.ERROR:
|
|
523
|
+
messageShown = this.error(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
524
|
+
break;
|
|
525
|
+
case MessageType.INFO:
|
|
526
|
+
messageShown = this.info(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
527
|
+
break;
|
|
528
|
+
case MessageType.SHOW:
|
|
529
|
+
messageShown = this.show(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
530
|
+
break;
|
|
531
|
+
case MessageType.ALERT:
|
|
532
|
+
case MessageType.WARNING:
|
|
533
|
+
messageShown = this.alert(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
534
|
+
break;
|
|
535
|
+
default:
|
|
536
|
+
messageShown = this.info(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
message.options.id = messageShown.toastId;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
success(text, title = 'igo.core.message.success', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
544
|
+
return this.handleNgxToastr('success', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
545
|
+
}
|
|
546
|
+
error(text, title = 'igo.core.message.error', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
547
|
+
return this.handleNgxToastr('error', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
548
|
+
}
|
|
549
|
+
info(text, title = 'igo.core.message.info', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
550
|
+
return this.handleNgxToastr('info', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
551
|
+
}
|
|
552
|
+
alert(text, title = 'igo.core.message.alert', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
553
|
+
return this.handleNgxToastr('alert', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
554
|
+
}
|
|
555
|
+
show(text, title = 'igo.core.message.info', options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
556
|
+
return this.handleNgxToastr('show', text, title, options, textInterpolateParams, titleInterpolateParams);
|
|
557
|
+
}
|
|
558
|
+
handleNgxToastr(type, text, title, options = {}, textInterpolateParams, titleInterpolateParams) {
|
|
559
|
+
const translatedTextInterpolateParams = { ...textInterpolateParams };
|
|
560
|
+
const translatedTitlenterpolateParams = { ...titleInterpolateParams };
|
|
561
|
+
if (textInterpolateParams) {
|
|
562
|
+
Object.keys(textInterpolateParams).map((k) => {
|
|
563
|
+
if (textInterpolateParams[k]) {
|
|
564
|
+
translatedTextInterpolateParams[k] =
|
|
565
|
+
this.languageService.translate.instant(textInterpolateParams[k]);
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
if (titleInterpolateParams) {
|
|
570
|
+
Object.keys(titleInterpolateParams).map((k) => {
|
|
571
|
+
if (k) {
|
|
572
|
+
translatedTitlenterpolateParams[k] =
|
|
573
|
+
this.languageService.translate.instant(titleInterpolateParams[k]);
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
const message = this.languageService.translate.instant(text, translatedTextInterpolateParams);
|
|
578
|
+
const translatedTitle = this.languageService.translate.instant(title, translatedTitlenterpolateParams);
|
|
579
|
+
let activeToast;
|
|
580
|
+
switch (type) {
|
|
581
|
+
case 'success':
|
|
582
|
+
activeToast = this.toastr.success(message, translatedTitle, options);
|
|
583
|
+
break;
|
|
584
|
+
case 'error':
|
|
585
|
+
activeToast = this.toastr.error(message, translatedTitle, options);
|
|
586
|
+
break;
|
|
587
|
+
case 'show':
|
|
588
|
+
case 'info':
|
|
589
|
+
activeToast = this.toastr.info(message, translatedTitle, options);
|
|
590
|
+
break;
|
|
591
|
+
case 'alert':
|
|
592
|
+
activeToast = this.toastr.warning(message, translatedTitle, options);
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
this.activeMessageTranslations.push({
|
|
596
|
+
id: activeToast.toastId,
|
|
597
|
+
titleKey: title,
|
|
598
|
+
textKey: text,
|
|
599
|
+
textInterpolateParams,
|
|
600
|
+
titleInterpolateParams
|
|
601
|
+
});
|
|
602
|
+
return activeToast;
|
|
603
|
+
}
|
|
604
|
+
remove(id) {
|
|
605
|
+
this.toastr.remove(id);
|
|
606
|
+
}
|
|
607
|
+
removeAllAreNotError() {
|
|
608
|
+
for (const mess of this.messages$.value) {
|
|
609
|
+
if (mess.type !== MessageType.ERROR) {
|
|
610
|
+
this.remove(mess.options.id);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
handleTemplate(message) {
|
|
615
|
+
if (!this.options?.template || message.html) {
|
|
616
|
+
return message;
|
|
617
|
+
}
|
|
618
|
+
let html = this.options?.template;
|
|
619
|
+
html = html.replace('${text}', message.text);
|
|
620
|
+
html = html.replace('${title}', message.title);
|
|
621
|
+
message.html = undefined;
|
|
622
|
+
message.text = html;
|
|
623
|
+
message.title = undefined;
|
|
624
|
+
return message;
|
|
625
|
+
}
|
|
626
|
+
static ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(Injector), i0.ɵɵinject(ConfigService), i0.ɵɵinject(LanguageService)); };
|
|
627
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
|
|
628
|
+
}
|
|
629
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageService, [{
|
|
630
|
+
type: Injectable,
|
|
631
|
+
args: [{
|
|
632
|
+
providedIn: 'root'
|
|
633
|
+
}]
|
|
634
|
+
}], function () { return [{ type: i0.Injector, decorators: [{
|
|
635
|
+
type: Inject,
|
|
636
|
+
args: [Injector]
|
|
562
637
|
}] }, { type: ConfigService }, { type: LanguageService }]; }, null); })();
|
|
563
638
|
|
|
564
|
-
class ErrorInterceptor {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
this.
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
errorObj
|
|
586
|
-
errorObj.
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
messageService
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
639
|
+
class ErrorInterceptor {
|
|
640
|
+
injector;
|
|
641
|
+
constructor(injector) {
|
|
642
|
+
this.injector = injector;
|
|
643
|
+
}
|
|
644
|
+
intercept(originalReq, next) {
|
|
645
|
+
const interceptError = originalReq.headers.get('interceptError');
|
|
646
|
+
const req = originalReq.clone({
|
|
647
|
+
headers: originalReq.headers.delete('interceptError')
|
|
648
|
+
});
|
|
649
|
+
if (interceptError === 'false') {
|
|
650
|
+
return next.handle(req);
|
|
651
|
+
}
|
|
652
|
+
const errorContainer = { httpError: undefined };
|
|
653
|
+
return next.handle(req).pipe(catchError((error) => this.handleError(error, errorContainer)), finalize(() => {
|
|
654
|
+
this.handleCaughtError(errorContainer);
|
|
655
|
+
this.handleUncaughtError(errorContainer);
|
|
656
|
+
}));
|
|
657
|
+
}
|
|
658
|
+
handleError(httpError, errorContainer) {
|
|
659
|
+
if (httpError instanceof HttpErrorResponse) {
|
|
660
|
+
const errorObj = httpError.error === 'object' ? httpError.error : {};
|
|
661
|
+
errorObj.message = httpError.error?.message || httpError.statusText;
|
|
662
|
+
errorObj.caught = false;
|
|
663
|
+
httpError = new HttpErrorResponse({
|
|
664
|
+
error: errorObj,
|
|
665
|
+
headers: httpError.headers,
|
|
666
|
+
status: httpError.status,
|
|
667
|
+
statusText: httpError.statusText,
|
|
668
|
+
url: httpError.url
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
errorContainer.httpError = httpError;
|
|
672
|
+
return throwError(httpError);
|
|
673
|
+
}
|
|
674
|
+
handleCaughtError(errorContainer) {
|
|
675
|
+
const httpError = errorContainer.httpError;
|
|
676
|
+
if (httpError && httpError.error.toDisplay) {
|
|
677
|
+
httpError.error.caught = true;
|
|
678
|
+
const messageService = this.injector.get(MessageService);
|
|
679
|
+
messageService.error(httpError.error.message, httpError.error.title);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
handleUncaughtError(errorContainer) {
|
|
683
|
+
const httpError = errorContainer.httpError;
|
|
684
|
+
if (httpError && !httpError.error.caught) {
|
|
685
|
+
const messageService = this.injector.get(MessageService);
|
|
686
|
+
httpError.error.caught = true;
|
|
687
|
+
messageService.error('igo.core.errors.uncaught.message', 'igo.core.errors.uncaught.title');
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
static ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(i0.Injector)); };
|
|
691
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
|
|
692
|
+
}
|
|
693
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorInterceptor, [{
|
|
694
|
+
type: Injectable,
|
|
695
|
+
args: [{
|
|
696
|
+
providedIn: 'root'
|
|
697
|
+
}]
|
|
622
698
|
}], function () { return [{ type: i0.Injector }]; }, null); })();
|
|
623
699
|
|
|
624
|
-
class IgoErrorModule {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoErrorModule, [{
|
|
647
|
-
type: NgModule,
|
|
648
|
-
args: [{
|
|
649
|
-
imports: [],
|
|
650
|
-
declarations: [],
|
|
651
|
-
exports: []
|
|
652
|
-
}]
|
|
653
|
-
}], function () { return [{ type: IgoErrorModule, decorators: [{
|
|
654
|
-
type: Optional
|
|
655
|
-
}, {
|
|
656
|
-
type: SkipSelf
|
|
700
|
+
class IgoErrorModule {
|
|
701
|
+
static forRoot() {
|
|
702
|
+
return {
|
|
703
|
+
ngModule: IgoErrorModule,
|
|
704
|
+
providers: [
|
|
705
|
+
{
|
|
706
|
+
provide: HTTP_INTERCEPTORS,
|
|
707
|
+
useClass: ErrorInterceptor,
|
|
708
|
+
multi: true
|
|
709
|
+
}
|
|
710
|
+
]
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
constructor(parentModule) {
|
|
714
|
+
if (parentModule) {
|
|
715
|
+
throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
static ɵfac = function IgoErrorModule_Factory(t) { return new (t || IgoErrorModule)(i0.ɵɵinject(IgoErrorModule, 12)); };
|
|
719
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoErrorModule });
|
|
720
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
721
|
+
}
|
|
722
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoErrorModule, [{
|
|
723
|
+
type: NgModule,
|
|
724
|
+
args: [{
|
|
725
|
+
imports: [],
|
|
726
|
+
declarations: [],
|
|
727
|
+
exports: []
|
|
728
|
+
}]
|
|
729
|
+
}], function () { return [{ type: IgoErrorModule, decorators: [{
|
|
730
|
+
type: Optional
|
|
731
|
+
}, {
|
|
732
|
+
type: SkipSelf
|
|
657
733
|
}] }]; }, null); })();
|
|
658
734
|
|
|
659
|
-
const dbConfig = {
|
|
660
|
-
name: 'igo2DB',
|
|
661
|
-
version: 2,
|
|
662
|
-
objectStoresMeta: [
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
{
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
735
|
+
const dbConfig = {
|
|
736
|
+
name: 'igo2DB',
|
|
737
|
+
version: 2,
|
|
738
|
+
objectStoresMeta: [
|
|
739
|
+
{
|
|
740
|
+
store: 'geoData',
|
|
741
|
+
storeConfig: { keyPath: 'url', autoIncrement: false },
|
|
742
|
+
storeSchema: [
|
|
743
|
+
{ name: 'regionID', keypath: 'regionID', options: { unique: false } }
|
|
744
|
+
]
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
store: 'layerData',
|
|
748
|
+
storeConfig: { keyPath: 'layerId', autoIncrement: false },
|
|
749
|
+
storeSchema: [
|
|
750
|
+
{
|
|
751
|
+
name: 'layerOptions',
|
|
752
|
+
keypath: 'layerOptions',
|
|
753
|
+
options: { unique: false }
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: 'sourceOptions',
|
|
757
|
+
keypath: 'sourceOptions',
|
|
758
|
+
options: { unique: false }
|
|
759
|
+
}
|
|
760
|
+
]
|
|
761
|
+
}
|
|
762
|
+
]
|
|
763
|
+
};
|
|
764
|
+
class IgoCoreModule {
|
|
765
|
+
static forRoot() {
|
|
766
|
+
return {
|
|
767
|
+
ngModule: IgoCoreModule,
|
|
768
|
+
providers: []
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
constructor(matIconRegistry, domSanitizer) {
|
|
772
|
+
matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
|
|
773
|
+
}
|
|
774
|
+
static ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$3.MatIconRegistry), i0.ɵɵinject(i2.DomSanitizer)); };
|
|
775
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoCoreModule });
|
|
776
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
777
|
+
HttpClientModule,
|
|
778
|
+
IgoActivityModule.forRoot(),
|
|
779
|
+
IgoConfigModule.forRoot(),
|
|
780
|
+
IgoErrorModule.forRoot(),
|
|
781
|
+
IgoLanguageModule.forRoot(),
|
|
782
|
+
IgoMessageModule.forRoot(),
|
|
783
|
+
NgxIndexedDBModule.forRoot(dbConfig), IgoActivityModule,
|
|
784
|
+
IgoConfigModule,
|
|
785
|
+
IgoErrorModule,
|
|
786
|
+
IgoLanguageModule,
|
|
787
|
+
IgoMessageModule] });
|
|
788
|
+
}
|
|
789
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoCoreModule, [{
|
|
790
|
+
type: NgModule,
|
|
791
|
+
args: [{
|
|
792
|
+
imports: [
|
|
793
|
+
CommonModule,
|
|
794
|
+
HttpClientModule,
|
|
795
|
+
IgoActivityModule.forRoot(),
|
|
796
|
+
IgoConfigModule.forRoot(),
|
|
797
|
+
IgoErrorModule.forRoot(),
|
|
798
|
+
IgoLanguageModule.forRoot(),
|
|
799
|
+
IgoMessageModule.forRoot(),
|
|
800
|
+
NgxIndexedDBModule.forRoot(dbConfig)
|
|
801
|
+
],
|
|
802
|
+
declarations: [],
|
|
803
|
+
exports: [
|
|
804
|
+
IgoActivityModule,
|
|
805
|
+
IgoConfigModule,
|
|
806
|
+
IgoErrorModule,
|
|
807
|
+
IgoLanguageModule,
|
|
808
|
+
IgoMessageModule
|
|
809
|
+
]
|
|
810
|
+
}]
|
|
811
|
+
}], function () { return [{ type: i1$3.MatIconRegistry }, { type: i2.DomSanitizer }]; }, null); })();
|
|
812
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
|
|
813
|
+
HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule, i8.NgxIndexedDBModule], exports: [IgoActivityModule,
|
|
814
|
+
IgoConfigModule,
|
|
815
|
+
IgoErrorModule,
|
|
816
|
+
IgoLanguageModule,
|
|
731
817
|
IgoMessageModule] }); })();
|
|
732
818
|
|
|
733
|
-
class IgoGestureConfig extends HammerGestureConfig {
|
|
734
|
-
buildHammer(element) {
|
|
735
|
-
const mc = super.buildHammer(element);
|
|
736
|
-
mc.set({ touchAction: 'pan-y' });
|
|
737
|
-
return mc;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureConfig, [{
|
|
743
|
-
type: Injectable
|
|
819
|
+
class IgoGestureConfig extends HammerGestureConfig {
|
|
820
|
+
buildHammer(element) {
|
|
821
|
+
const mc = super.buildHammer(element);
|
|
822
|
+
mc.set({ touchAction: 'pan-y' });
|
|
823
|
+
return mc;
|
|
824
|
+
}
|
|
825
|
+
static ɵfac = /*@__PURE__*/ function () { let ɵIgoGestureConfig_BaseFactory; return function IgoGestureConfig_Factory(t) { return (ɵIgoGestureConfig_BaseFactory || (ɵIgoGestureConfig_BaseFactory = i0.ɵɵgetInheritedFactory(IgoGestureConfig)))(t || IgoGestureConfig); }; }();
|
|
826
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: IgoGestureConfig, factory: IgoGestureConfig.ɵfac });
|
|
827
|
+
}
|
|
828
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureConfig, [{
|
|
829
|
+
type: Injectable
|
|
744
830
|
}], null, null); })();
|
|
745
831
|
|
|
746
|
-
class IgoGestureModule {
|
|
747
|
-
static forRoot() {
|
|
748
|
-
return {
|
|
749
|
-
ngModule: IgoGestureModule,
|
|
750
|
-
providers: [
|
|
751
|
-
{
|
|
752
|
-
provide: HAMMER_GESTURE_CONFIG,
|
|
753
|
-
useClass: IgoGestureConfig
|
|
754
|
-
}
|
|
755
|
-
]
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureModule, [{
|
|
763
|
-
type: NgModule,
|
|
764
|
-
args: [{
|
|
765
|
-
imports: [HammerModule],
|
|
766
|
-
declarations: [],
|
|
767
|
-
exports: []
|
|
768
|
-
}]
|
|
769
|
-
}], null, null); })();
|
|
832
|
+
class IgoGestureModule {
|
|
833
|
+
static forRoot() {
|
|
834
|
+
return {
|
|
835
|
+
ngModule: IgoGestureModule,
|
|
836
|
+
providers: [
|
|
837
|
+
{
|
|
838
|
+
provide: HAMMER_GESTURE_CONFIG,
|
|
839
|
+
useClass: IgoGestureConfig
|
|
840
|
+
}
|
|
841
|
+
]
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
static ɵfac = function IgoGestureModule_Factory(t) { return new (t || IgoGestureModule)(); };
|
|
845
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoGestureModule });
|
|
846
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [HammerModule] });
|
|
847
|
+
}
|
|
848
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureModule, [{
|
|
849
|
+
type: NgModule,
|
|
850
|
+
args: [{
|
|
851
|
+
imports: [HammerModule],
|
|
852
|
+
declarations: [],
|
|
853
|
+
exports: []
|
|
854
|
+
}]
|
|
855
|
+
}], null, null); })();
|
|
770
856
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoGestureModule, { imports: [HammerModule] }); })();
|
|
771
857
|
|
|
772
|
-
class LoggingInterceptor {
|
|
773
|
-
intercept(req, next) {
|
|
774
|
-
const started = Date.now();
|
|
775
|
-
let ok;
|
|
776
|
-
// extend server response observable with logging
|
|
777
|
-
return next.handle(req).pipe(tap(
|
|
778
|
-
// Succeeds when there is a response; ignore other events
|
|
779
|
-
event => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
|
|
780
|
-
// Operation failed; error is an HttpErrorResponse
|
|
781
|
-
error => (ok = 'failed')),
|
|
782
|
-
// Log when response observable either completes or errors
|
|
783
|
-
finalize(() => {
|
|
784
|
-
const elapsed = Date.now() - started;
|
|
785
|
-
const msg = `${req.method} "${req.urlWithParams}"
|
|
786
|
-
${ok} in ${elapsed} ms.`;
|
|
787
|
-
console.log(msg);
|
|
788
|
-
}));
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggingInterceptor, [{
|
|
794
|
-
type: Injectable
|
|
858
|
+
class LoggingInterceptor {
|
|
859
|
+
intercept(req, next) {
|
|
860
|
+
const started = Date.now();
|
|
861
|
+
let ok;
|
|
862
|
+
// extend server response observable with logging
|
|
863
|
+
return next.handle(req).pipe(tap(
|
|
864
|
+
// Succeeds when there is a response; ignore other events
|
|
865
|
+
(event) => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
|
|
866
|
+
// Operation failed; error is an HttpErrorResponse
|
|
867
|
+
(error) => (ok = 'failed')),
|
|
868
|
+
// Log when response observable either completes or errors
|
|
869
|
+
finalize(() => {
|
|
870
|
+
const elapsed = Date.now() - started;
|
|
871
|
+
const msg = `${req.method} "${req.urlWithParams}"
|
|
872
|
+
${ok} in ${elapsed} ms.`;
|
|
873
|
+
console.log(msg);
|
|
874
|
+
}));
|
|
875
|
+
}
|
|
876
|
+
static ɵfac = function LoggingInterceptor_Factory(t) { return new (t || LoggingInterceptor)(); };
|
|
877
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoggingInterceptor, factory: LoggingInterceptor.ɵfac });
|
|
878
|
+
}
|
|
879
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggingInterceptor, [{
|
|
880
|
+
type: Injectable
|
|
795
881
|
}], null, null); })();
|
|
796
882
|
|
|
797
|
-
class IgoLoggingModule {
|
|
798
|
-
static forRoot() {
|
|
799
|
-
return {
|
|
800
|
-
ngModule: IgoLoggingModule,
|
|
801
|
-
providers: [
|
|
802
|
-
{
|
|
803
|
-
provide: HTTP_INTERCEPTORS,
|
|
804
|
-
useClass: LoggingInterceptor,
|
|
805
|
-
multi: true
|
|
806
|
-
}
|
|
807
|
-
]
|
|
808
|
-
};
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLoggingModule, [{
|
|
815
|
-
type: NgModule,
|
|
816
|
-
args: [{
|
|
817
|
-
imports: [],
|
|
818
|
-
declarations: [],
|
|
819
|
-
exports: []
|
|
820
|
-
}]
|
|
883
|
+
class IgoLoggingModule {
|
|
884
|
+
static forRoot() {
|
|
885
|
+
return {
|
|
886
|
+
ngModule: IgoLoggingModule,
|
|
887
|
+
providers: [
|
|
888
|
+
{
|
|
889
|
+
provide: HTTP_INTERCEPTORS,
|
|
890
|
+
useClass: LoggingInterceptor,
|
|
891
|
+
multi: true
|
|
892
|
+
}
|
|
893
|
+
]
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
static ɵfac = function IgoLoggingModule_Factory(t) { return new (t || IgoLoggingModule)(); };
|
|
897
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLoggingModule });
|
|
898
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({});
|
|
899
|
+
}
|
|
900
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLoggingModule, [{
|
|
901
|
+
type: NgModule,
|
|
902
|
+
args: [{
|
|
903
|
+
imports: [],
|
|
904
|
+
declarations: [],
|
|
905
|
+
exports: []
|
|
906
|
+
}]
|
|
821
907
|
}], null, null); })();
|
|
822
908
|
|
|
823
|
-
let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
|
|
824
|
-
function provideRouteServiceOptions(options) {
|
|
825
|
-
return {
|
|
826
|
-
provide: ROUTE_SERVICE_OPTIONS,
|
|
827
|
-
useValue: options
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
class RouteService {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
.
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
type:
|
|
909
|
+
let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
|
|
910
|
+
function provideRouteServiceOptions(options) {
|
|
911
|
+
return {
|
|
912
|
+
provide: ROUTE_SERVICE_OPTIONS,
|
|
913
|
+
useValue: options
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
class RouteService {
|
|
917
|
+
router;
|
|
918
|
+
route;
|
|
919
|
+
options;
|
|
920
|
+
constructor(router, route, options) {
|
|
921
|
+
this.router = router;
|
|
922
|
+
this.route = route;
|
|
923
|
+
const defaultOptions = {
|
|
924
|
+
centerKey: 'center',
|
|
925
|
+
zoomKey: 'zoom',
|
|
926
|
+
projectionKey: 'projection',
|
|
927
|
+
contextKey: 'context',
|
|
928
|
+
searchKey: 'search',
|
|
929
|
+
visibleOnLayersKey: 'visiblelayers',
|
|
930
|
+
visibleOffLayersKey: 'invisiblelayers',
|
|
931
|
+
directionsCoordKey: 'routing',
|
|
932
|
+
directionsOptionsKey: 'routingOptions',
|
|
933
|
+
toolKey: 'tool',
|
|
934
|
+
wmsUrlKey: 'wmsUrl',
|
|
935
|
+
wmsLayersKey: 'wmsLayers',
|
|
936
|
+
wmtsUrlKey: 'wmtsUrl',
|
|
937
|
+
wmtsLayersKey: 'wmtsLayers',
|
|
938
|
+
arcgisUrlKey: 'arcgisUrl',
|
|
939
|
+
arcgisLayersKey: 'arcgisLayers',
|
|
940
|
+
iarcgisUrlKey: 'iarcgisUrl',
|
|
941
|
+
iarcgisLayersKey: 'iarcgisLayers',
|
|
942
|
+
tarcgisUrlKey: 'tarcgisUrl',
|
|
943
|
+
tarcgisLayersKey: 'tarcgisLayers',
|
|
944
|
+
vectorKey: 'vector'
|
|
945
|
+
};
|
|
946
|
+
this.options = Object.assign({}, defaultOptions, options);
|
|
947
|
+
}
|
|
948
|
+
get queryParams() {
|
|
949
|
+
let url = decodeURIComponent(location.search);
|
|
950
|
+
if (url.includes('¢er=')) {
|
|
951
|
+
url = url.replace('¢er', '¢er');
|
|
952
|
+
const queryParams = url
|
|
953
|
+
.slice(1)
|
|
954
|
+
.split('&')
|
|
955
|
+
.map((p) => p.split('='))
|
|
956
|
+
.reduce((obj, pair) => {
|
|
957
|
+
const [key, value] = pair.map(decodeURIComponent);
|
|
958
|
+
obj[key] = value;
|
|
959
|
+
return obj;
|
|
960
|
+
}, {});
|
|
961
|
+
this.router.navigate([], { queryParams });
|
|
962
|
+
}
|
|
963
|
+
return this.route.queryParams;
|
|
964
|
+
}
|
|
965
|
+
static ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$4.Router), i0.ɵɵinject(i1$4.ActivatedRoute), i0.ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
|
|
966
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
|
|
967
|
+
}
|
|
968
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouteService, [{
|
|
969
|
+
type: Injectable,
|
|
970
|
+
args: [{
|
|
971
|
+
providedIn: 'root'
|
|
972
|
+
}]
|
|
973
|
+
}], function () { return [{ type: i1$4.Router }, { type: i1$4.ActivatedRoute }, { type: undefined, decorators: [{
|
|
974
|
+
type: Inject,
|
|
975
|
+
args: [ROUTE_SERVICE_OPTIONS]
|
|
976
|
+
}, {
|
|
977
|
+
type: Optional
|
|
889
978
|
}] }]; }, null); })();
|
|
890
979
|
|
|
891
|
-
class AnalyticsService {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
(
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
g
|
|
917
|
-
|
|
918
|
-
g.
|
|
919
|
-
g.
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
this.paq.push(['
|
|
929
|
-
this.paq.push(['deleteCustomVariable',
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
this.paq.push(['
|
|
935
|
-
|
|
936
|
-
this.paq.push(['setCustomVariable',
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
980
|
+
class AnalyticsService {
|
|
981
|
+
config;
|
|
982
|
+
options;
|
|
983
|
+
get paq() {
|
|
984
|
+
return (window._paq = window._paq || []);
|
|
985
|
+
}
|
|
986
|
+
constructor(config) {
|
|
987
|
+
this.config = config;
|
|
988
|
+
this.options = this.config.getConfig('analytics') || {};
|
|
989
|
+
if (this.options.provider === 'matomo') {
|
|
990
|
+
this.initMatomo();
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
initMatomo() {
|
|
994
|
+
if (!this.options.url || !this.options.id) {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
const url = this.options.url.substr(-1) === '/'
|
|
998
|
+
? this.options.url + 'matomo'
|
|
999
|
+
: this.options.url;
|
|
1000
|
+
// this.paq.push(['trackPageView']);
|
|
1001
|
+
// this.paq.push(['enableLinkTracking']);
|
|
1002
|
+
(() => {
|
|
1003
|
+
this.paq.push(['setTrackerUrl', url + '.php']);
|
|
1004
|
+
this.paq.push(['setSiteId', this.options.id]);
|
|
1005
|
+
const g = document.createElement('script');
|
|
1006
|
+
const s = document.getElementsByTagName('script')[0];
|
|
1007
|
+
g.type = 'text/javascript';
|
|
1008
|
+
g.async = true;
|
|
1009
|
+
g.defer = true;
|
|
1010
|
+
g.src = url + '.js';
|
|
1011
|
+
s.parentNode.insertBefore(g, s);
|
|
1012
|
+
})();
|
|
1013
|
+
}
|
|
1014
|
+
setUser(user, profils) {
|
|
1015
|
+
if (this.options.provider === 'matomo') {
|
|
1016
|
+
if (!user) {
|
|
1017
|
+
this.paq.push(['resetUserId']);
|
|
1018
|
+
this.paq.push(['deleteCustomVariable', 1, 'user']);
|
|
1019
|
+
this.paq.push(['deleteCustomVariable', 2, 'name']);
|
|
1020
|
+
this.paq.push(['deleteCustomVariable', 3, 'profils']);
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
this.paq.push(['setUserId', user.id]);
|
|
1024
|
+
const name = `${user.firstName} ${user.lastName}`;
|
|
1025
|
+
this.paq.push(['setCustomVariable', 1, 'user', user.sourceId, 'visit']);
|
|
1026
|
+
this.paq.push(['setCustomVariable', 2, 'name', name, 'visit']);
|
|
1027
|
+
this.paq.push(['setCustomVariable', 3, 'profils', profils, 'visit']);
|
|
1028
|
+
}
|
|
1029
|
+
this.paq.push(['trackPageView']);
|
|
1030
|
+
this.paq.push(['enableLinkTracking']);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
trackSearch(term, nbResults) {
|
|
1034
|
+
if (this.options.provider === 'matomo') {
|
|
1035
|
+
this.paq.push(['trackSiteSearch', term, false, nbResults]);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
trackEvent(category, action, name) {
|
|
1039
|
+
if (this.options.provider === 'matomo') {
|
|
1040
|
+
this.paq.push(['trackEvent', category, action, name]);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Function that tracks layers added to the map
|
|
1045
|
+
*/
|
|
1046
|
+
trackLayer(category, action, parameters) {
|
|
1047
|
+
if (this.options.provider === 'matomo')
|
|
1048
|
+
this.paq.push(['trackEvent', category, action, parameters]);
|
|
1049
|
+
}
|
|
1050
|
+
static ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(i0.ɵɵinject(ConfigService)); };
|
|
1051
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' });
|
|
1052
|
+
}
|
|
1053
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnalyticsService, [{
|
|
1054
|
+
type: Injectable,
|
|
1055
|
+
args: [{
|
|
1056
|
+
providedIn: 'root'
|
|
1057
|
+
}]
|
|
967
1058
|
}], function () { return [{ type: ConfigService }]; }, null); })();
|
|
968
1059
|
|
|
969
|
-
var Media;
|
|
970
|
-
(function (Media) {
|
|
971
|
-
Media["Mobile"] = "mobile";
|
|
972
|
-
Media["Tablet"] = "tablet";
|
|
973
|
-
Media["Desktop"] = "desktop";
|
|
974
|
-
})(Media || (Media = {}));
|
|
975
|
-
var MediaOrientation;
|
|
976
|
-
(function (MediaOrientation) {
|
|
977
|
-
MediaOrientation["Portrait"] = "portrait";
|
|
978
|
-
MediaOrientation["Landscape"] = "landscape";
|
|
1060
|
+
var Media;
|
|
1061
|
+
(function (Media) {
|
|
1062
|
+
Media["Mobile"] = "mobile";
|
|
1063
|
+
Media["Tablet"] = "tablet";
|
|
1064
|
+
Media["Desktop"] = "desktop";
|
|
1065
|
+
})(Media || (Media = {}));
|
|
1066
|
+
var MediaOrientation;
|
|
1067
|
+
(function (MediaOrientation) {
|
|
1068
|
+
MediaOrientation["Portrait"] = "portrait";
|
|
1069
|
+
MediaOrientation["Landscape"] = "landscape";
|
|
979
1070
|
})(MediaOrientation || (MediaOrientation = {}));
|
|
980
1071
|
|
|
981
|
-
class MediaService {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
breakpointObserver
|
|
986
|
-
.observe([Breakpoints.HandsetLandscape])
|
|
987
|
-
.subscribe(res => {
|
|
988
|
-
if (res.matches) {
|
|
989
|
-
this.media$.next(Media.Mobile);
|
|
990
|
-
this.orientation$.next(MediaOrientation.Landscape);
|
|
991
|
-
}
|
|
992
|
-
});
|
|
993
|
-
breakpointObserver
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
if (res.matches) {
|
|
1013
|
-
this.media$.next(Media.
|
|
1014
|
-
this.orientation$.next(MediaOrientation.
|
|
1015
|
-
}
|
|
1016
|
-
});
|
|
1017
|
-
breakpointObserver.observe([Breakpoints.
|
|
1018
|
-
if (res.matches) {
|
|
1019
|
-
this.media$.next(Media.Desktop);
|
|
1020
|
-
this.orientation$.next(MediaOrientation.
|
|
1021
|
-
}
|
|
1022
|
-
});
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
return
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1072
|
+
class MediaService {
|
|
1073
|
+
media$ = new BehaviorSubject(undefined);
|
|
1074
|
+
orientation$ = new BehaviorSubject(undefined);
|
|
1075
|
+
constructor(breakpointObserver) {
|
|
1076
|
+
breakpointObserver
|
|
1077
|
+
.observe([Breakpoints.HandsetLandscape])
|
|
1078
|
+
.subscribe((res) => {
|
|
1079
|
+
if (res.matches) {
|
|
1080
|
+
this.media$.next(Media.Mobile);
|
|
1081
|
+
this.orientation$.next(MediaOrientation.Landscape);
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
breakpointObserver
|
|
1085
|
+
.observe([Breakpoints.HandsetPortrait])
|
|
1086
|
+
.subscribe((res) => {
|
|
1087
|
+
if (res.matches) {
|
|
1088
|
+
this.media$.next(Media.Mobile);
|
|
1089
|
+
this.orientation$.next(MediaOrientation.Portrait);
|
|
1090
|
+
}
|
|
1091
|
+
});
|
|
1092
|
+
breakpointObserver
|
|
1093
|
+
.observe([Breakpoints.TabletLandscape])
|
|
1094
|
+
.subscribe((res) => {
|
|
1095
|
+
if (res.matches) {
|
|
1096
|
+
this.media$.next(Media.Tablet);
|
|
1097
|
+
this.orientation$.next(MediaOrientation.Landscape);
|
|
1098
|
+
}
|
|
1099
|
+
});
|
|
1100
|
+
breakpointObserver
|
|
1101
|
+
.observe([Breakpoints.TabletPortrait])
|
|
1102
|
+
.subscribe((res) => {
|
|
1103
|
+
if (res.matches) {
|
|
1104
|
+
this.media$.next(Media.Tablet);
|
|
1105
|
+
this.orientation$.next(MediaOrientation.Portrait);
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
breakpointObserver.observe([Breakpoints.WebLandscape]).subscribe((res) => {
|
|
1109
|
+
if (res.matches) {
|
|
1110
|
+
this.media$.next(Media.Desktop);
|
|
1111
|
+
this.orientation$.next(MediaOrientation.Landscape);
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
breakpointObserver.observe([Breakpoints.WebPortrait]).subscribe((res) => {
|
|
1115
|
+
if (res.matches) {
|
|
1116
|
+
this.media$.next(Media.Desktop);
|
|
1117
|
+
this.orientation$.next(MediaOrientation.Portrait);
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
getMedia() {
|
|
1122
|
+
return this.media$.value;
|
|
1123
|
+
}
|
|
1124
|
+
getOrientation() {
|
|
1125
|
+
return this.orientation$.value;
|
|
1126
|
+
}
|
|
1127
|
+
isTouchScreen() {
|
|
1128
|
+
return 'ontouchstart' in document.documentElement ? true : false;
|
|
1129
|
+
}
|
|
1130
|
+
isMobile() {
|
|
1131
|
+
const media = this.getMedia();
|
|
1132
|
+
return media === 'mobile';
|
|
1133
|
+
}
|
|
1134
|
+
isDesktop() {
|
|
1135
|
+
const media = this.getMedia();
|
|
1136
|
+
return media === 'desktop';
|
|
1137
|
+
}
|
|
1138
|
+
static ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(i0.ɵɵinject(i1$5.BreakpointObserver)); };
|
|
1139
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MediaService, factory: MediaService.ɵfac, providedIn: 'root' });
|
|
1140
|
+
}
|
|
1141
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MediaService, [{
|
|
1142
|
+
type: Injectable,
|
|
1143
|
+
args: [{
|
|
1144
|
+
providedIn: 'root'
|
|
1145
|
+
}]
|
|
1146
|
+
}], function () { return [{ type: i1$5.BreakpointObserver }]; }, null); })();
|
|
1050
1147
|
|
|
1051
|
-
var StorageScope;
|
|
1052
|
-
(function (StorageScope) {
|
|
1053
|
-
StorageScope["SESSION"] = "Session";
|
|
1054
|
-
StorageScope["LOCAL"] = "Local";
|
|
1055
|
-
})(StorageScope || (StorageScope = {}));
|
|
1056
|
-
var StorageServiceEventEnum;
|
|
1057
|
-
(function (StorageServiceEventEnum) {
|
|
1058
|
-
StorageServiceEventEnum["ADDED"] = "Added";
|
|
1059
|
-
StorageServiceEventEnum["MODIFIED"] = "Modified";
|
|
1060
|
-
StorageServiceEventEnum["REMOVED"] = "Removed";
|
|
1061
|
-
StorageServiceEventEnum["CLEARED"] = "Cleared";
|
|
1148
|
+
var StorageScope;
|
|
1149
|
+
(function (StorageScope) {
|
|
1150
|
+
StorageScope["SESSION"] = "Session";
|
|
1151
|
+
StorageScope["LOCAL"] = "Local";
|
|
1152
|
+
})(StorageScope || (StorageScope = {}));
|
|
1153
|
+
var StorageServiceEventEnum;
|
|
1154
|
+
(function (StorageServiceEventEnum) {
|
|
1155
|
+
StorageServiceEventEnum["ADDED"] = "Added";
|
|
1156
|
+
StorageServiceEventEnum["MODIFIED"] = "Modified";
|
|
1157
|
+
StorageServiceEventEnum["REMOVED"] = "Removed";
|
|
1158
|
+
StorageServiceEventEnum["CLEARED"] = "Cleared";
|
|
1062
1159
|
})(StorageServiceEventEnum || (StorageServiceEventEnum = {}));
|
|
1063
1160
|
|
|
1064
|
-
class
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
this.options =
|
|
1069
|
-
}
|
|
1070
|
-
/**
|
|
1071
|
-
* Use to get the data found in storage file
|
|
1072
|
-
*/
|
|
1073
|
-
get(key, scope) {
|
|
1074
|
-
let value;
|
|
1075
|
-
if (!scope || scope === StorageScope.SESSION) {
|
|
1076
|
-
value = sessionStorage.getItem(`${this.options.key}.${key}`);
|
|
1077
|
-
}
|
|
1078
|
-
if (scope === StorageScope.LOCAL || (!value && !scope)) {
|
|
1079
|
-
value = localStorage.getItem(`${this.options.key}.${key}`);
|
|
1080
|
-
}
|
|
1081
|
-
if (value) {
|
|
1082
|
-
try {
|
|
1083
|
-
value = JSON.parse(value);
|
|
1084
|
-
}
|
|
1085
|
-
catch {
|
|
1086
|
-
value = value;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
return value;
|
|
1090
|
-
}
|
|
1091
|
-
set(key, value, scope = StorageScope.LOCAL) {
|
|
1092
|
-
const previousValue = this.get(key, scope);
|
|
1093
|
-
if (scope === StorageScope.SESSION) {
|
|
1094
|
-
sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1095
|
-
}
|
|
1096
|
-
else {
|
|
1097
|
-
localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1098
|
-
}
|
|
1099
|
-
const currentValue = this.get(key, scope);
|
|
1100
|
-
if (currentValue !== previousValue) {
|
|
1101
|
-
this.storageChange$.next({
|
|
1102
|
-
key,
|
|
1103
|
-
|
|
1104
|
-
previousValue
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1161
|
+
class BaseStorage {
|
|
1162
|
+
options;
|
|
1163
|
+
storageChange$ = new BehaviorSubject(undefined);
|
|
1164
|
+
constructor(config) {
|
|
1165
|
+
this.options = config.getConfig('storage') || { key: 'igo' };
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* Use to get the data found in storage file
|
|
1169
|
+
*/
|
|
1170
|
+
get(key, scope) {
|
|
1171
|
+
let value;
|
|
1172
|
+
if (!scope || scope === StorageScope.SESSION) {
|
|
1173
|
+
value = sessionStorage.getItem(`${this.options.key}.${key}`);
|
|
1174
|
+
}
|
|
1175
|
+
if (scope === StorageScope.LOCAL || (!value && !scope)) {
|
|
1176
|
+
value = localStorage.getItem(`${this.options.key}.${key}`);
|
|
1177
|
+
}
|
|
1178
|
+
if (value) {
|
|
1179
|
+
try {
|
|
1180
|
+
value = JSON.parse(value);
|
|
1181
|
+
}
|
|
1182
|
+
catch {
|
|
1183
|
+
value = value;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
return value;
|
|
1187
|
+
}
|
|
1188
|
+
set(key, value, scope = StorageScope.LOCAL) {
|
|
1189
|
+
const previousValue = this.get(key, scope);
|
|
1190
|
+
if (scope === StorageScope.SESSION) {
|
|
1191
|
+
sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1192
|
+
}
|
|
1193
|
+
else {
|
|
1194
|
+
localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
|
|
1195
|
+
}
|
|
1196
|
+
const currentValue = this.get(key, scope);
|
|
1197
|
+
if (currentValue !== previousValue) {
|
|
1198
|
+
this.storageChange$.next({
|
|
1199
|
+
key,
|
|
1200
|
+
scope,
|
|
1201
|
+
event: previousValue !== undefined
|
|
1202
|
+
? StorageServiceEventEnum.MODIFIED
|
|
1203
|
+
: StorageServiceEventEnum.ADDED,
|
|
1204
|
+
previousValue,
|
|
1205
|
+
currentValue
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
remove(key, scope = StorageScope.LOCAL) {
|
|
1210
|
+
const previousValue = this.get(key, scope);
|
|
1211
|
+
if (scope === StorageScope.SESSION) {
|
|
1212
|
+
sessionStorage.removeItem(`${this.options.key}.${key}`);
|
|
1213
|
+
}
|
|
1214
|
+
else {
|
|
1215
|
+
localStorage.removeItem(`${this.options.key}.${key}`);
|
|
1216
|
+
}
|
|
1217
|
+
this.storageChange$.next({
|
|
1218
|
+
key,
|
|
1219
|
+
scope,
|
|
1220
|
+
event: StorageServiceEventEnum.REMOVED,
|
|
1221
|
+
previousValue
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
clear(scope = StorageScope.LOCAL) {
|
|
1225
|
+
if (scope === StorageScope.SESSION) {
|
|
1226
|
+
sessionStorage.clear();
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
localStorage.clear();
|
|
1230
|
+
}
|
|
1231
|
+
this.storageChange$.next({ scope, event: StorageServiceEventEnum.CLEARED });
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
class StorageService extends BaseStorage {
|
|
1236
|
+
config;
|
|
1237
|
+
constructor(config) {
|
|
1238
|
+
super(config);
|
|
1239
|
+
this.config = config;
|
|
1240
|
+
}
|
|
1241
|
+
static ɵfac = function StorageService_Factory(t) { return new (t || StorageService)(i0.ɵɵinject(ConfigService)); };
|
|
1242
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: StorageService, factory: StorageService.ɵfac, providedIn: 'root' });
|
|
1243
|
+
}
|
|
1244
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StorageService, [{
|
|
1245
|
+
type: Injectable,
|
|
1246
|
+
args: [{
|
|
1247
|
+
providedIn: 'root'
|
|
1248
|
+
}]
|
|
1136
1249
|
}], function () { return [{ type: ConfigService }]; }, null); })();
|
|
1137
1250
|
|
|
1138
|
-
function getNumber(v, endposition, length) {
|
|
1139
|
-
/* tslint:disable:no-bitwise*/
|
|
1140
|
-
const mask = (
|
|
1141
|
-
return (v >> endposition) & mask;
|
|
1142
|
-
/* tslint:enable:no-bitwise*/
|
|
1143
|
-
}
|
|
1144
|
-
class CompressionService {
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
this.generateBase64Index();
|
|
1149
|
-
}
|
|
1150
|
-
generateBase64Index() {
|
|
1151
|
-
// https://fr.wikipedia.org/wiki/Base64
|
|
1152
|
-
// A-Z => [0, 25]
|
|
1153
|
-
for (let i = 0; i < 26; i++) {
|
|
1154
|
-
this.base64Index.set(String.fromCharCode('A'.charCodeAt(0) + i), i);
|
|
1155
|
-
this.indexBase64.set(i, String.fromCharCode('A'.charCodeAt(0) + i));
|
|
1156
|
-
}
|
|
1157
|
-
// a-z => [26, 51]
|
|
1158
|
-
for (let i = 0; i < 26; i++) {
|
|
1159
|
-
this.base64Index.set(String.fromCharCode('a'.charCodeAt(0) + i), i + 26);
|
|
1160
|
-
this.indexBase64.set(i + 26, String.fromCharCode('a'.charCodeAt(0) + i));
|
|
1161
|
-
}
|
|
1162
|
-
// 0-9 => [52, 61]
|
|
1163
|
-
for (let i = 0; i < 10; i++) {
|
|
1164
|
-
this.base64Index.set(String.fromCharCode('0'.charCodeAt(0) + i), i + 52);
|
|
1165
|
-
this.indexBase64.set(i + 52, String.fromCharCode('0'.charCodeAt(0) + i));
|
|
1166
|
-
}
|
|
1167
|
-
// + / => [62, 63]
|
|
1168
|
-
this.base64Index.set('+', 62);
|
|
1169
|
-
this.base64Index.set('/', 63);
|
|
1170
|
-
this.indexBase64.set(62, '+');
|
|
1171
|
-
this.indexBase64.set(63, '/');
|
|
1172
|
-
}
|
|
1173
|
-
compressBlob(blob) {
|
|
1174
|
-
if (!blob) {
|
|
1175
|
-
return;
|
|
1176
|
-
}
|
|
1177
|
-
const observable = new Observable((observer) => {
|
|
1178
|
-
const reader = new FileReader();
|
|
1179
|
-
reader.readAsDataURL(blob);
|
|
1180
|
-
reader.onload = () => {
|
|
1181
|
-
const base64 = reader.result.valueOf();
|
|
1182
|
-
const text64 = base64.substr(base64.indexOf(',') + 1);
|
|
1183
|
-
const compressed = this.compressStringBase64(text64);
|
|
1184
|
-
const compressedData = {
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
const
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
let
|
|
1212
|
-
let
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
chr
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
let
|
|
1244
|
-
let
|
|
1245
|
-
let
|
|
1246
|
-
let
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
chr
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1251
|
+
function getNumber(v, endposition, length) {
|
|
1252
|
+
/* tslint:disable:no-bitwise*/
|
|
1253
|
+
const mask = (1 << length) - 1;
|
|
1254
|
+
return (v >> endposition) & mask;
|
|
1255
|
+
/* tslint:enable:no-bitwise*/
|
|
1256
|
+
}
|
|
1257
|
+
class CompressionService {
|
|
1258
|
+
base64Index = new Map();
|
|
1259
|
+
indexBase64 = new Map();
|
|
1260
|
+
constructor() {
|
|
1261
|
+
this.generateBase64Index();
|
|
1262
|
+
}
|
|
1263
|
+
generateBase64Index() {
|
|
1264
|
+
// https://fr.wikipedia.org/wiki/Base64
|
|
1265
|
+
// A-Z => [0, 25]
|
|
1266
|
+
for (let i = 0; i < 26; i++) {
|
|
1267
|
+
this.base64Index.set(String.fromCharCode('A'.charCodeAt(0) + i), i);
|
|
1268
|
+
this.indexBase64.set(i, String.fromCharCode('A'.charCodeAt(0) + i));
|
|
1269
|
+
}
|
|
1270
|
+
// a-z => [26, 51]
|
|
1271
|
+
for (let i = 0; i < 26; i++) {
|
|
1272
|
+
this.base64Index.set(String.fromCharCode('a'.charCodeAt(0) + i), i + 26);
|
|
1273
|
+
this.indexBase64.set(i + 26, String.fromCharCode('a'.charCodeAt(0) + i));
|
|
1274
|
+
}
|
|
1275
|
+
// 0-9 => [52, 61]
|
|
1276
|
+
for (let i = 0; i < 10; i++) {
|
|
1277
|
+
this.base64Index.set(String.fromCharCode('0'.charCodeAt(0) + i), i + 52);
|
|
1278
|
+
this.indexBase64.set(i + 52, String.fromCharCode('0'.charCodeAt(0) + i));
|
|
1279
|
+
}
|
|
1280
|
+
// + / => [62, 63]
|
|
1281
|
+
this.base64Index.set('+', 62);
|
|
1282
|
+
this.base64Index.set('/', 63);
|
|
1283
|
+
this.indexBase64.set(62, '+');
|
|
1284
|
+
this.indexBase64.set(63, '/');
|
|
1285
|
+
}
|
|
1286
|
+
compressBlob(blob) {
|
|
1287
|
+
if (!blob) {
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1290
|
+
const observable = new Observable((observer) => {
|
|
1291
|
+
const reader = new FileReader();
|
|
1292
|
+
reader.readAsDataURL(blob);
|
|
1293
|
+
reader.onload = () => {
|
|
1294
|
+
const base64 = reader.result.valueOf();
|
|
1295
|
+
const text64 = base64.substr(base64.indexOf(',') + 1);
|
|
1296
|
+
const compressed = this.compressStringBase64(text64);
|
|
1297
|
+
const compressedData = {
|
|
1298
|
+
length: text64.length,
|
|
1299
|
+
type: blob.type,
|
|
1300
|
+
object: compressed
|
|
1301
|
+
};
|
|
1302
|
+
observer.next(compressedData);
|
|
1303
|
+
};
|
|
1304
|
+
});
|
|
1305
|
+
return observable;
|
|
1306
|
+
}
|
|
1307
|
+
decompressBlob(compressedData) {
|
|
1308
|
+
/* tslint:disable:no-bitwise*/
|
|
1309
|
+
const object = compressedData.object;
|
|
1310
|
+
const length = compressedData.length;
|
|
1311
|
+
const decompressed = this.decompressStringBase64(object, length);
|
|
1312
|
+
const byteCharacters = atob(decompressed);
|
|
1313
|
+
const byteNumbers = new Array(byteCharacters.length);
|
|
1314
|
+
for (let i = 0; i < byteCharacters.length; i++) {
|
|
1315
|
+
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
|
1316
|
+
}
|
|
1317
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
1318
|
+
const blob = new Blob([byteArray], { type: compressedData.type });
|
|
1319
|
+
/* tslint:enable:no-bitwise*/
|
|
1320
|
+
return blob;
|
|
1321
|
+
}
|
|
1322
|
+
compressStringBase64(s) {
|
|
1323
|
+
/* tslint:disable:no-bitwise*/
|
|
1324
|
+
let out = '';
|
|
1325
|
+
let bits = 16;
|
|
1326
|
+
let chr = 0;
|
|
1327
|
+
let rem = 0;
|
|
1328
|
+
for (const c of s) {
|
|
1329
|
+
const value = this.base64Index.get(c);
|
|
1330
|
+
if (bits > 6) {
|
|
1331
|
+
bits -= 6;
|
|
1332
|
+
chr += value << bits;
|
|
1333
|
+
}
|
|
1334
|
+
else {
|
|
1335
|
+
rem = 6 - bits;
|
|
1336
|
+
chr += value >> rem;
|
|
1337
|
+
out += String.fromCharCode(chr);
|
|
1338
|
+
chr = value << (16 - rem);
|
|
1339
|
+
bits = 16 - rem;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
if (s.length % 8 !== 0) {
|
|
1343
|
+
out += String.fromCharCode(chr);
|
|
1344
|
+
}
|
|
1345
|
+
/* tslint:enable:no-bitwise*/
|
|
1346
|
+
return String.fromCharCode(9731) + out;
|
|
1347
|
+
}
|
|
1348
|
+
decompressStringBase64(c, length) {
|
|
1349
|
+
/* tslint:disable:no-bitwise*/
|
|
1350
|
+
if (!c) {
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
if (c.charCodeAt(0) !== 9731) {
|
|
1354
|
+
return c;
|
|
1355
|
+
}
|
|
1356
|
+
let chr = 0;
|
|
1357
|
+
let rem = 0;
|
|
1358
|
+
let bits = 16;
|
|
1359
|
+
let out = '';
|
|
1360
|
+
let j = 1;
|
|
1361
|
+
let value = c.charCodeAt(j);
|
|
1362
|
+
for (let i = 0; i < length; i++) {
|
|
1363
|
+
if (bits > 6) {
|
|
1364
|
+
bits -= 6;
|
|
1365
|
+
chr = getNumber(value, bits, 6);
|
|
1366
|
+
out += this.indexBase64.get(chr);
|
|
1367
|
+
}
|
|
1368
|
+
else {
|
|
1369
|
+
rem = 6 - bits;
|
|
1370
|
+
chr = getNumber(value, 0, bits) << rem;
|
|
1371
|
+
value = c.charCodeAt(++j);
|
|
1372
|
+
chr += getNumber(value, 16 - rem, rem);
|
|
1373
|
+
out += this.indexBase64.get(chr);
|
|
1374
|
+
bits = 16 - rem;
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
return out;
|
|
1378
|
+
/* tslint:enable:no-bitwise*/
|
|
1379
|
+
}
|
|
1380
|
+
static ɵfac = function CompressionService_Factory(t) { return new (t || CompressionService)(); };
|
|
1381
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CompressionService, factory: CompressionService.ɵfac, providedIn: 'root' });
|
|
1382
|
+
}
|
|
1383
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CompressionService, [{
|
|
1384
|
+
type: Injectable,
|
|
1385
|
+
args: [{
|
|
1386
|
+
providedIn: 'root'
|
|
1387
|
+
}]
|
|
1273
1388
|
}], function () { return []; }, null); })();
|
|
1274
1389
|
|
|
1275
|
-
class NetworkService {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
this.
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
this.
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
this.
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1390
|
+
class NetworkService {
|
|
1391
|
+
messageService;
|
|
1392
|
+
injector;
|
|
1393
|
+
stateChangeEventEmitter = new EventEmitter();
|
|
1394
|
+
onlineSubscription;
|
|
1395
|
+
offlineSubscription;
|
|
1396
|
+
previousMessageId;
|
|
1397
|
+
state = {
|
|
1398
|
+
connection: window.navigator.onLine
|
|
1399
|
+
};
|
|
1400
|
+
constructor(messageService, injector) {
|
|
1401
|
+
this.messageService = messageService;
|
|
1402
|
+
this.injector = injector;
|
|
1403
|
+
this.checkNetworkState();
|
|
1404
|
+
}
|
|
1405
|
+
checkNetworkState() {
|
|
1406
|
+
this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
|
|
1407
|
+
if (this.previousMessageId) {
|
|
1408
|
+
this.messageService.remove(this.previousMessageId);
|
|
1409
|
+
}
|
|
1410
|
+
const messageObj = this.messageService.info('igo.core.network.online.message', 'igo.core.network.online.title');
|
|
1411
|
+
this.previousMessageId = messageObj.toastId;
|
|
1412
|
+
this.state.connection = true;
|
|
1413
|
+
this.emitEvent();
|
|
1414
|
+
});
|
|
1415
|
+
this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
|
|
1416
|
+
if (this.previousMessageId) {
|
|
1417
|
+
this.messageService.remove(this.previousMessageId);
|
|
1418
|
+
}
|
|
1419
|
+
const messageObj = this.messageService.info('igo.core.network.offline.message', 'igo.core.network.offline.title');
|
|
1420
|
+
this.previousMessageId = messageObj.toastId;
|
|
1421
|
+
this.state.connection = false;
|
|
1422
|
+
this.emitEvent();
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
emitEvent() {
|
|
1426
|
+
this.stateChangeEventEmitter.emit(this.state);
|
|
1427
|
+
}
|
|
1428
|
+
ngOnDestroy() {
|
|
1429
|
+
try {
|
|
1430
|
+
this.offlineSubscription.unsubscribe();
|
|
1431
|
+
this.onlineSubscription.unsubscribe();
|
|
1432
|
+
}
|
|
1433
|
+
catch (e) { }
|
|
1434
|
+
}
|
|
1435
|
+
currentState(reportState = true) {
|
|
1436
|
+
return reportState
|
|
1437
|
+
? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
|
|
1438
|
+
: this.stateChangeEventEmitter.pipe(debounceTime(300));
|
|
1439
|
+
}
|
|
1440
|
+
static ɵfac = function NetworkService_Factory(t) { return new (t || NetworkService)(i0.ɵɵinject(MessageService), i0.ɵɵinject(i0.Injector)); };
|
|
1441
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NetworkService, factory: NetworkService.ɵfac, providedIn: 'root' });
|
|
1442
|
+
}
|
|
1443
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NetworkService, [{
|
|
1444
|
+
type: Injectable,
|
|
1445
|
+
args: [{
|
|
1446
|
+
providedIn: 'root'
|
|
1447
|
+
}]
|
|
1328
1448
|
}], function () { return [{ type: MessageService }, { type: i0.Injector }]; }, null); })();
|
|
1329
1449
|
|
|
1330
|
-
class RegexService {
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1450
|
+
class RegexService {
|
|
1451
|
+
config;
|
|
1452
|
+
options;
|
|
1453
|
+
constructor(config) {
|
|
1454
|
+
this.config = config;
|
|
1455
|
+
this.options = this.config.getConfig('regex');
|
|
1456
|
+
}
|
|
1457
|
+
getAll() {
|
|
1458
|
+
return this.options;
|
|
1459
|
+
}
|
|
1460
|
+
get(key) {
|
|
1461
|
+
if (this.options) {
|
|
1462
|
+
return this.options[key];
|
|
1463
|
+
}
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
static ɵfac = function RegexService_Factory(t) { return new (t || RegexService)(i0.ɵɵinject(ConfigService)); };
|
|
1467
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RegexService, factory: RegexService.ɵfac, providedIn: 'root' });
|
|
1468
|
+
}
|
|
1469
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RegexService, [{
|
|
1470
|
+
type: Injectable,
|
|
1471
|
+
args: [{
|
|
1472
|
+
providedIn: 'root'
|
|
1473
|
+
}]
|
|
1352
1474
|
}], function () { return [{ type: ConfigService }]; }, null); })();
|
|
1353
1475
|
|
|
1354
|
-
/*
|
|
1355
|
-
* Public API Surface of core
|
|
1476
|
+
/*
|
|
1477
|
+
* Public API Surface of core
|
|
1356
1478
|
*/
|
|
1357
1479
|
|
|
1358
|
-
/**
|
|
1359
|
-
* Generated bundle index. Do not edit.
|
|
1480
|
+
/**
|
|
1481
|
+
* Generated bundle index. Do not edit.
|
|
1360
1482
|
*/
|
|
1361
1483
|
|
|
1362
|
-
export { ActivityInterceptor, ActivityService, AnalyticsService, CONFIG_OPTIONS, CompressionService, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RegexService, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };
|
|
1484
|
+
export { ActivityInterceptor, ActivityService, AnalyticsService, BaseStorage, CONFIG_OPTIONS, CompressionService, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RegexService, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };
|
|
1363
1485
|
//# sourceMappingURL=igo2-core.mjs.map
|