@open-rlb/ng-app 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/fesm2022/open-rlb-ng-app.mjs +3034 -0
- package/fesm2022/open-rlb-ng-app.mjs.map +1 -0
- package/index.d.ts +1156 -0
- package/package.json +34 -0
|
@@ -0,0 +1,3034 @@
|
|
|
1
|
+
import * as i1$3 from '@angular/common/http';
|
|
2
|
+
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, Injectable, Inject, Optional, EventEmitter, importProvidersFrom, makeStateKey, makeEnvironmentProviders, Pipe, Input, Component, PLATFORM_ID, NgModule, Directive, inject, isDevMode } from '@angular/core';
|
|
5
|
+
import * as i2 from '@angular/router';
|
|
6
|
+
import { NavigationEnd, RoutesRecognized, RouterModule, Router, provideRouter } from '@angular/router';
|
|
7
|
+
import * as i1$4 from '@angular/service-worker';
|
|
8
|
+
import { provideServiceWorker } from '@angular/service-worker';
|
|
9
|
+
import * as i1$8 from '@ngrx/effects';
|
|
10
|
+
import { createEffect, ofType, provideEffects } from '@ngrx/effects';
|
|
11
|
+
import * as i1$1 from '@ngrx/store';
|
|
12
|
+
import { createActionGroup, props, emptyProps, createFeature, createReducer, on, provideStore, provideState } from '@ngrx/store';
|
|
13
|
+
import * as i6 from '@open-rlb/ng-bootstrap';
|
|
14
|
+
import { RLB_TRANSLATION_SERVICE, RlbBootstrapModule, ModalDirective, ToastDirective, provideRlbBootstrap, ModalRegistryOptions, ToastRegistryOptions } from '@open-rlb/ng-bootstrap';
|
|
15
|
+
import * as i1$5 from 'angular-auth-oidc-client';
|
|
16
|
+
import { AbstractLoggerService, AuthModule, provideAuth, AuthInterceptor, AbstractSecurityStorage } from 'angular-auth-oidc-client';
|
|
17
|
+
import * as i1 from 'ngx-cookie-service-ssr';
|
|
18
|
+
import { filter, switchMap, of, map, BehaviorSubject, share, lastValueFrom, from, zip, EMPTY, catchError, Observable, tap, shareReplay, distinctUntilChanged, take } from 'rxjs';
|
|
19
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
20
|
+
import * as i1$2 from '@ngx-translate/core';
|
|
21
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
22
|
+
import { provideTranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
23
|
+
import * as i1$6 from '@angular/common';
|
|
24
|
+
import { isPlatformServer, CommonModule } from '@angular/common';
|
|
25
|
+
import * as i3 from '@angular/forms';
|
|
26
|
+
import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
27
|
+
import * as i1$7 from '@angular/cdk/layout';
|
|
28
|
+
import { Breakpoints } from '@angular/cdk/layout';
|
|
29
|
+
import { tap as tap$1, map as map$1, switchMap as switchMap$1 } from 'rxjs/operators';
|
|
30
|
+
|
|
31
|
+
const RLB_CFG = 'rlb.options';
|
|
32
|
+
const RLB_CFG_CMS = new InjectionToken(`${RLB_CFG}:cms`);
|
|
33
|
+
const RLB_CFG_I18N = new InjectionToken(`${RLB_CFG}:i18n`);
|
|
34
|
+
const RLB_CFG_PAGES = new InjectionToken(`${RLB_CFG}:pages`);
|
|
35
|
+
const RLB_CFG_ENV = new InjectionToken(`${RLB_CFG}:env`);
|
|
36
|
+
const RLB_CFG_AUTH = new InjectionToken(`${RLB_CFG}:auth`);
|
|
37
|
+
const RLB_APP_NAVCOMP = new InjectionToken(`rlb.app.navcomp`);
|
|
38
|
+
|
|
39
|
+
class TokenCookiesService {
|
|
40
|
+
constructor(cookies) {
|
|
41
|
+
this.cookies = cookies;
|
|
42
|
+
}
|
|
43
|
+
read(key) {
|
|
44
|
+
return this.cookies.get(key);
|
|
45
|
+
}
|
|
46
|
+
remove(key) {
|
|
47
|
+
this.cookies.delete(key);
|
|
48
|
+
}
|
|
49
|
+
write(key, data) {
|
|
50
|
+
this.cookies.set(key, data);
|
|
51
|
+
}
|
|
52
|
+
clear() {
|
|
53
|
+
}
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenCookiesService, deps: [{ token: i1.SsrCookieService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
55
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenCookiesService, providedIn: 'root' }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenCookiesService, decorators: [{
|
|
58
|
+
type: Injectable,
|
|
59
|
+
args: [{
|
|
60
|
+
providedIn: 'root'
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: () => [{ type: i1.SsrCookieService }] });
|
|
63
|
+
|
|
64
|
+
class AppStorageService {
|
|
65
|
+
readLocal(key) {
|
|
66
|
+
return localStorage.getItem(key);
|
|
67
|
+
}
|
|
68
|
+
writeLocal(key, value) {
|
|
69
|
+
localStorage.setItem(key, value);
|
|
70
|
+
}
|
|
71
|
+
removeLocal(key) {
|
|
72
|
+
localStorage.removeItem(key);
|
|
73
|
+
}
|
|
74
|
+
clearLocal() {
|
|
75
|
+
localStorage.clear();
|
|
76
|
+
}
|
|
77
|
+
readSession(key) {
|
|
78
|
+
return sessionStorage.getItem(key);
|
|
79
|
+
}
|
|
80
|
+
writeSession(key, value) {
|
|
81
|
+
localStorage.setItem(key, value);
|
|
82
|
+
}
|
|
83
|
+
removeSession(key) {
|
|
84
|
+
sessionStorage.removeItem(key);
|
|
85
|
+
}
|
|
86
|
+
clearSession() {
|
|
87
|
+
sessionStorage.clear();
|
|
88
|
+
}
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
90
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppStorageService, providedIn: 'root' }); }
|
|
91
|
+
}
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppStorageService, decorators: [{
|
|
93
|
+
type: Injectable,
|
|
94
|
+
args: [{
|
|
95
|
+
providedIn: 'root'
|
|
96
|
+
}]
|
|
97
|
+
}] });
|
|
98
|
+
|
|
99
|
+
class TokenSessionService {
|
|
100
|
+
constructor(store) {
|
|
101
|
+
this.store = store;
|
|
102
|
+
}
|
|
103
|
+
read(key) {
|
|
104
|
+
return this.store.readSession(key);
|
|
105
|
+
}
|
|
106
|
+
write(key, value) {
|
|
107
|
+
this.store.writeSession(key, value);
|
|
108
|
+
}
|
|
109
|
+
remove(key) {
|
|
110
|
+
this.store.readSession(key);
|
|
111
|
+
}
|
|
112
|
+
clear() {
|
|
113
|
+
this.store.clearSession();
|
|
114
|
+
}
|
|
115
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenSessionService, deps: [{ token: AppStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
116
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenSessionService, providedIn: 'root' }); }
|
|
117
|
+
}
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenSessionService, decorators: [{
|
|
119
|
+
type: Injectable,
|
|
120
|
+
args: [{
|
|
121
|
+
providedIn: 'root'
|
|
122
|
+
}]
|
|
123
|
+
}], ctorParameters: () => [{ type: AppStorageService }] });
|
|
124
|
+
|
|
125
|
+
class TokenStoreService {
|
|
126
|
+
constructor(store) {
|
|
127
|
+
this.store = store;
|
|
128
|
+
}
|
|
129
|
+
read(key) {
|
|
130
|
+
return this.store.readLocal(key);
|
|
131
|
+
}
|
|
132
|
+
write(key, value) {
|
|
133
|
+
this.store.writeLocal(key, value);
|
|
134
|
+
}
|
|
135
|
+
remove(key) {
|
|
136
|
+
this.store.removeLocal(key);
|
|
137
|
+
}
|
|
138
|
+
clear() {
|
|
139
|
+
this.store.clearLocal();
|
|
140
|
+
}
|
|
141
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenStoreService, deps: [{ token: AppStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
142
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenStoreService, providedIn: 'root' }); }
|
|
143
|
+
}
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenStoreService, decorators: [{
|
|
145
|
+
type: Injectable,
|
|
146
|
+
args: [{
|
|
147
|
+
providedIn: 'root'
|
|
148
|
+
}]
|
|
149
|
+
}], ctorParameters: () => [{ type: AppStorageService }] });
|
|
150
|
+
|
|
151
|
+
const LEVEL_PRIORITIES = {
|
|
152
|
+
off: 0,
|
|
153
|
+
error: 1,
|
|
154
|
+
warn: 2,
|
|
155
|
+
info: 3,
|
|
156
|
+
debug: 4,
|
|
157
|
+
log: 5,
|
|
158
|
+
};
|
|
159
|
+
class AppLoggerService extends AbstractLoggerService {
|
|
160
|
+
constructor() {
|
|
161
|
+
super();
|
|
162
|
+
this.currentLevel = 'off';
|
|
163
|
+
this.timestamps = true;
|
|
164
|
+
}
|
|
165
|
+
setLogLevel(level) {
|
|
166
|
+
if (!(level in LEVEL_PRIORITIES)) {
|
|
167
|
+
throw new Error(`Unknown log level: ${level}`);
|
|
168
|
+
}
|
|
169
|
+
this.currentLevel = level;
|
|
170
|
+
}
|
|
171
|
+
getLogLevel() {
|
|
172
|
+
return this.currentLevel;
|
|
173
|
+
}
|
|
174
|
+
enableTimestamps(enabled) {
|
|
175
|
+
this.timestamps = enabled;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* returns logger with context / class name
|
|
179
|
+
*/
|
|
180
|
+
for(context) {
|
|
181
|
+
return {
|
|
182
|
+
error: (...args) => this.logError(context, ...args),
|
|
183
|
+
warn: (...args) => this.logWarning(context, ...args),
|
|
184
|
+
info: (...args) => this.logInfo(context, ...args),
|
|
185
|
+
debug: (...args) => this.logDebug(context, ...args),
|
|
186
|
+
log: (...args) => this.log(context, ...args),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
logError(contextOrMessage, ...args) {
|
|
190
|
+
this.print('error', contextOrMessage, args);
|
|
191
|
+
}
|
|
192
|
+
logWarning(contextOrMessage, ...args) {
|
|
193
|
+
this.print('warn', contextOrMessage, args);
|
|
194
|
+
}
|
|
195
|
+
logDebug(contextOrMessage, ...args) {
|
|
196
|
+
this.print('debug', contextOrMessage, args);
|
|
197
|
+
}
|
|
198
|
+
logInfo(contextOrMessage, ...args) {
|
|
199
|
+
this.print('info', contextOrMessage, args);
|
|
200
|
+
}
|
|
201
|
+
log(contextOrMessage, ...args) {
|
|
202
|
+
this.print('log', contextOrMessage, args);
|
|
203
|
+
}
|
|
204
|
+
print(level, contextOrMessage, args) {
|
|
205
|
+
if (LEVEL_PRIORITIES[level] > LEVEL_PRIORITIES[this.currentLevel]) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const colors = {
|
|
209
|
+
error: 'color:#e57373;',
|
|
210
|
+
warn: 'color:#ffb74d;',
|
|
211
|
+
info: 'color:#64b5f6;',
|
|
212
|
+
debug: 'color:#90a4ae;',
|
|
213
|
+
log: 'color:#757575;',
|
|
214
|
+
off: 'color:inherit;',
|
|
215
|
+
};
|
|
216
|
+
let context = 'GLOBAL';
|
|
217
|
+
let messageArgs = [];
|
|
218
|
+
if (args.length > 0) {
|
|
219
|
+
context = contextOrMessage;
|
|
220
|
+
messageArgs = args;
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
messageArgs = [contextOrMessage];
|
|
224
|
+
}
|
|
225
|
+
const timePrefix = this.timestamps ? `[${new Date().toISOString()}]` : '';
|
|
226
|
+
const prefix = `[${level.toUpperCase()}][${context}]${timePrefix} -`;
|
|
227
|
+
switch (level) {
|
|
228
|
+
case 'error':
|
|
229
|
+
console.error(`%c${prefix}`, colors.error, ...messageArgs);
|
|
230
|
+
break;
|
|
231
|
+
case 'warn':
|
|
232
|
+
console.warn(`%c${prefix}`, colors.warn, ...messageArgs);
|
|
233
|
+
break;
|
|
234
|
+
case 'info':
|
|
235
|
+
console.info(`%c${prefix}`, colors.info, ...messageArgs);
|
|
236
|
+
break;
|
|
237
|
+
case 'debug':
|
|
238
|
+
console.debug(`%c${prefix}`, colors.debug, ...messageArgs);
|
|
239
|
+
break;
|
|
240
|
+
default:
|
|
241
|
+
console.log(`%c${prefix}`, colors.log, ...messageArgs);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppLoggerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
245
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppLoggerService, providedIn: 'root' }); }
|
|
246
|
+
}
|
|
247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppLoggerService, decorators: [{
|
|
248
|
+
type: Injectable,
|
|
249
|
+
args: [{ providedIn: 'root' }]
|
|
250
|
+
}], ctorParameters: () => [] });
|
|
251
|
+
|
|
252
|
+
const AppContextActionsInternal = createActionGroup({
|
|
253
|
+
source: 'AppContext/Internal',
|
|
254
|
+
events: {
|
|
255
|
+
setLanguage: props(),
|
|
256
|
+
setCurrentApp: props(),
|
|
257
|
+
setSupportedLanguages: props(),
|
|
258
|
+
setTheme: props(),
|
|
259
|
+
addApp: props(),
|
|
260
|
+
setViewMode: props(),
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
const AppContextActions = createActionGroup({
|
|
264
|
+
source: 'AppContext/API',
|
|
265
|
+
events: {
|
|
266
|
+
setLanguage: props(),
|
|
267
|
+
setSupportedLanguages: props(),
|
|
268
|
+
setCurrentApp: props(),
|
|
269
|
+
removeApp: props(),
|
|
270
|
+
setTheme: props(),
|
|
271
|
+
finalizeApp: props(),
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
const appContextFeatureKey = 'app';
|
|
276
|
+
const RLB_APPS = new InjectionToken(`rlb.apps`);
|
|
277
|
+
const initialAppContextState = {
|
|
278
|
+
apps: [],
|
|
279
|
+
currentApp: null,
|
|
280
|
+
language: null,
|
|
281
|
+
supportedLanguages: ['en'],
|
|
282
|
+
theme: 'light',
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const AuthActionsInternal = createActionGroup({
|
|
286
|
+
source: 'Auth/Internal',
|
|
287
|
+
events: {
|
|
288
|
+
'SetCurrentProvider': props(),
|
|
289
|
+
'SetLoading': props(),
|
|
290
|
+
'Reset': emptyProps(),
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
const AuthActions = createActionGroup({
|
|
294
|
+
source: 'Auth/API',
|
|
295
|
+
events: {
|
|
296
|
+
'Login': emptyProps(),
|
|
297
|
+
'Logout': emptyProps(),
|
|
298
|
+
'SetCurrentProvider': props(),
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
class AuthFeatureService {
|
|
303
|
+
constructor(store) {
|
|
304
|
+
this.store = store;
|
|
305
|
+
}
|
|
306
|
+
login() {
|
|
307
|
+
this.store.dispatch(AuthActions.login());
|
|
308
|
+
}
|
|
309
|
+
logout() {
|
|
310
|
+
this.store.dispatch(AuthActions.logout());
|
|
311
|
+
}
|
|
312
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthFeatureService, deps: [{ token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
313
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthFeatureService, providedIn: 'root' }); }
|
|
314
|
+
}
|
|
315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthFeatureService, decorators: [{
|
|
316
|
+
type: Injectable,
|
|
317
|
+
args: [{
|
|
318
|
+
providedIn: 'root'
|
|
319
|
+
}]
|
|
320
|
+
}], ctorParameters: () => [{ type: i1$1.Store }] });
|
|
321
|
+
|
|
322
|
+
const authsFeatureKey = 'auth';
|
|
323
|
+
const initialAuthState = {
|
|
324
|
+
currentProvider: null,
|
|
325
|
+
loading: false,
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
const NavbarActionsInternal = createActionGroup({
|
|
329
|
+
source: 'Navbar/Internal',
|
|
330
|
+
events: {}
|
|
331
|
+
});
|
|
332
|
+
const NavbarActions = createActionGroup({
|
|
333
|
+
source: 'Navbar/API',
|
|
334
|
+
events: {
|
|
335
|
+
SetVisible: props(),
|
|
336
|
+
SetSearchVisible: props(),
|
|
337
|
+
SetHeader: props(),
|
|
338
|
+
SetSearchText: props(),
|
|
339
|
+
SetLeftItems: props(),
|
|
340
|
+
SetRightItems: props(),
|
|
341
|
+
SetLoginVisible: props(),
|
|
342
|
+
SetSettingsVisible: props(),
|
|
343
|
+
SetAppsVisible: props(),
|
|
344
|
+
SetSeparatorVisible: props(),
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
const navbarsFeatureKey = 'navbar';
|
|
349
|
+
const initialNavbarState = {
|
|
350
|
+
visible: true,
|
|
351
|
+
header: null,
|
|
352
|
+
searchVisible: true,
|
|
353
|
+
searchText: null,
|
|
354
|
+
leftItems: [],
|
|
355
|
+
rightItems: [],
|
|
356
|
+
loginVisible: false,
|
|
357
|
+
settingsVisible: false,
|
|
358
|
+
appsVisible: false,
|
|
359
|
+
separatorVisible: true,
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
const SidebarActionsInternal = createActionGroup({
|
|
363
|
+
source: 'Sidebar/Internal',
|
|
364
|
+
events: {}
|
|
365
|
+
});
|
|
366
|
+
const SidebarActions = createActionGroup({
|
|
367
|
+
source: 'Sidebar/API',
|
|
368
|
+
events: {
|
|
369
|
+
SetItems: props(),
|
|
370
|
+
SetVisible: props(),
|
|
371
|
+
SetLoginVisible: props(),
|
|
372
|
+
SetAppsVisible: props(),
|
|
373
|
+
SetSearchVisible: props(),
|
|
374
|
+
SetSettingsVisible: props(),
|
|
375
|
+
SetSearchText: props(),
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
const sidebarsFeatureKey = 'sidebar';
|
|
380
|
+
const initialSidebarState = {
|
|
381
|
+
items: [],
|
|
382
|
+
visible: true,
|
|
383
|
+
loginVisible: true,
|
|
384
|
+
searchVisible: true,
|
|
385
|
+
settingsVisible: true,
|
|
386
|
+
appsVisible: true,
|
|
387
|
+
searchText: null
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
class AbstractSupportService {
|
|
391
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AbstractSupportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
392
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AbstractSupportService }); }
|
|
393
|
+
}
|
|
394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AbstractSupportService, decorators: [{
|
|
395
|
+
type: Injectable
|
|
396
|
+
}] });
|
|
397
|
+
|
|
398
|
+
const DEFAULT_ROUTES_CONFIG = [
|
|
399
|
+
{ path: 'setting' },
|
|
400
|
+
{ path: 'setting/general' },
|
|
401
|
+
{ path: 'apps' },
|
|
402
|
+
{ path: 'profile' },
|
|
403
|
+
{ path: 'content', configKey: 'content' },
|
|
404
|
+
{ path: 'cookies', configKey: 'cookies' },
|
|
405
|
+
{ path: 'notFound', configKey: 'notFound' },
|
|
406
|
+
{ path: 'privacy', configKey: 'privacy' },
|
|
407
|
+
{ path: 'support', configKey: 'support' },
|
|
408
|
+
{ path: 'terms', configKey: 'terms' },
|
|
409
|
+
];
|
|
410
|
+
|
|
411
|
+
class AppsService {
|
|
412
|
+
constructor(store, activatedRoute, router, loggerService, confAuth) {
|
|
413
|
+
this.store = store;
|
|
414
|
+
this.activatedRoute = activatedRoute;
|
|
415
|
+
this.router = router;
|
|
416
|
+
this.loggerService = loggerService;
|
|
417
|
+
this.logger = this.loggerService.for(this.constructor.name);
|
|
418
|
+
this.logger.log('AppsService initialized');
|
|
419
|
+
this.initAuthProviders(store, confAuth);
|
|
420
|
+
this.initRouterListener();
|
|
421
|
+
}
|
|
422
|
+
get currentDomain() {
|
|
423
|
+
return window.location.hostname;
|
|
424
|
+
}
|
|
425
|
+
get apps() {
|
|
426
|
+
return this.store.selectSignal(state => state[appContextFeatureKey].apps)()
|
|
427
|
+
.filter(app => app.id && (app.domains === undefined || app.domains == null || app.domains.includes(this.currentDomain)));
|
|
428
|
+
}
|
|
429
|
+
get currentApp() {
|
|
430
|
+
const app = this.store.selectSignal(state => state[appContextFeatureKey].currentApp)();
|
|
431
|
+
this.logger.log('Current app from store:', app);
|
|
432
|
+
return app;
|
|
433
|
+
}
|
|
434
|
+
selectApp(app, viewMode, url) {
|
|
435
|
+
const currentApp = this.currentApp;
|
|
436
|
+
if (!app) {
|
|
437
|
+
this.logger.warn('Deselecting app (null).');
|
|
438
|
+
this.store.dispatch(AppContextActions.setCurrentApp({ app: null }));
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
if (currentApp && currentApp.id === app.id && currentApp.viewMode === viewMode) {
|
|
442
|
+
this.logger.info('App already selected with same id and viewMode. Skipping dispatch.');
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
this.logger.warn('Dispatching setCurrentApp with:', { app, mode: viewMode, url });
|
|
446
|
+
this.store.dispatch(AppContextActions.setCurrentApp({ app, mode: viewMode, url }));
|
|
447
|
+
}
|
|
448
|
+
initAuthProviders(store, confAuth) {
|
|
449
|
+
if (!confAuth?.providers?.length) {
|
|
450
|
+
this.logger.warn('No auth providers configured.');
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (confAuth?.providers && confAuth.providers.length === 1) {
|
|
454
|
+
this.logger.info('Single auth provider detected:', confAuth.providers[0]);
|
|
455
|
+
store.dispatch(AuthActions.setCurrentProvider({ currentProvider: confAuth.providers[0].configId }));
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
this.logger.info('Multiple auth providers detected, checking by domain:', this.currentDomain);
|
|
459
|
+
const authProvidersMatched = confAuth.providers.filter(provider => provider.domains?.includes(this.currentDomain));
|
|
460
|
+
if (authProvidersMatched && authProvidersMatched.length === 1) {
|
|
461
|
+
this.logger.info('Auth provider matched by domain:', authProvidersMatched[0]);
|
|
462
|
+
store.dispatch(AuthActions.setCurrentProvider({ currentProvider: authProvidersMatched[0].configId }));
|
|
463
|
+
}
|
|
464
|
+
else if (authProvidersMatched && authProvidersMatched.length > 1) {
|
|
465
|
+
this.logger.warn(`Multiple auth providers found for the current domain: ${this.currentDomain}. Please specify a single provider in the configuration.`);
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
this.logger.warn(`No auth provider found for the current domain: ${this.currentDomain}.`);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
initRouterListener() {
|
|
472
|
+
this.router.events
|
|
473
|
+
.pipe(filter(event => event instanceof NavigationEnd), switchMap(() => this.resolveRouteAndApps()), takeUntilDestroyed())
|
|
474
|
+
.subscribe(data => this.handleResolvedApps(data));
|
|
475
|
+
}
|
|
476
|
+
// Core logic
|
|
477
|
+
resolveRouteAndApps() {
|
|
478
|
+
const route = this.findDeepestChild(this.activatedRoute);
|
|
479
|
+
const fullPath = this.getFullPath(route);
|
|
480
|
+
this.logger.info('Full path for route resolution:', fullPath);
|
|
481
|
+
if (!fullPath) {
|
|
482
|
+
this.logger.warn('No valid path found, treating as default route:', route);
|
|
483
|
+
return of(null);
|
|
484
|
+
}
|
|
485
|
+
const appRoutes = this.apps?.map(app => ({
|
|
486
|
+
type: app.type,
|
|
487
|
+
routes: app.routes || [],
|
|
488
|
+
viewMode: app.viewMode,
|
|
489
|
+
enabled: app.enabled,
|
|
490
|
+
}));
|
|
491
|
+
let appRoutesMatched = [];
|
|
492
|
+
if (!this.isDefaultRoute(fullPath)) {
|
|
493
|
+
appRoutesMatched = appRoutes?.filter(app => app.routes?.some(r => r.includes(fullPath))) ?? [];
|
|
494
|
+
}
|
|
495
|
+
this.logger.info('Route fullPath:', fullPath, 'Matched appRoute:', appRoutesMatched);
|
|
496
|
+
return this.store.select(state => state[appContextFeatureKey].apps).pipe(map(apps => appRoutesMatched.length
|
|
497
|
+
? { route, appsConfig: appRoutesMatched, apps }
|
|
498
|
+
: null));
|
|
499
|
+
}
|
|
500
|
+
handleResolvedApps(data) {
|
|
501
|
+
const route = this.findDeepestChild(this.activatedRoute);
|
|
502
|
+
const storedId = this.getStoredAppId();
|
|
503
|
+
if (data?.apps?.some(app => !app.id)) {
|
|
504
|
+
this.logger.error('Some apps are not finalized. Please finalize apps before using AppsService.');
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
if (!data || !data.apps || data.apps.length === 0) {
|
|
508
|
+
this.logger.warn(`No unique app found for route: ${route.routeConfig?.path ? route.routeConfig?.path : "'/'"} - show core`);
|
|
509
|
+
// const globalDefaultApp = this.apps[0];
|
|
510
|
+
this.selectApp(undefined);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const matchedApps = data.apps
|
|
514
|
+
// domain filter in case apps have similar routes path
|
|
515
|
+
.filter(app => app.domains?.some((domain) => domain.includes(this.currentDomain)))
|
|
516
|
+
.filter(app => app.routes?.some(r => r.includes(route.routeConfig?.path)) ||
|
|
517
|
+
app.core?.url === '/' + route.routeConfig?.path);
|
|
518
|
+
let appToSelect;
|
|
519
|
+
if (matchedApps.length === 1) {
|
|
520
|
+
appToSelect = matchedApps[0];
|
|
521
|
+
this.logger.info('Single app matched route:', appToSelect);
|
|
522
|
+
}
|
|
523
|
+
else if (matchedApps.length > 1) {
|
|
524
|
+
appToSelect = matchedApps.find(a => a.id === storedId) || matchedApps[0];
|
|
525
|
+
this.logger.info('Multiple apps matched route, selected:', appToSelect);
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
appToSelect = data.apps[0];
|
|
529
|
+
this.logger.info('No app matched route. Falling back to default app:', appToSelect);
|
|
530
|
+
}
|
|
531
|
+
const qp = new URLSearchParams(route.snapshot.queryParams).toString();
|
|
532
|
+
const url = route.snapshot.url.map(segment => segment.path).join('/') + (qp ? `?${qp}` : '');
|
|
533
|
+
const viewMode = this.isSettingsRoute(route) ? 'settings' : 'app';
|
|
534
|
+
this.selectApp(appToSelect, viewMode, url);
|
|
535
|
+
}
|
|
536
|
+
findDeepestChild(route) {
|
|
537
|
+
while (route.firstChild)
|
|
538
|
+
route = route.firstChild;
|
|
539
|
+
this.logger.info('Activated deepest child route:', route);
|
|
540
|
+
return route;
|
|
541
|
+
}
|
|
542
|
+
getStoredAppId() {
|
|
543
|
+
try {
|
|
544
|
+
return localStorage.getItem('c-app-id');
|
|
545
|
+
}
|
|
546
|
+
catch (e) {
|
|
547
|
+
this.logger.warn('LocalStorage not available:', e);
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
isSettingsRoute(route) {
|
|
552
|
+
return route.routeConfig?.path?.includes('settings') ?? false;
|
|
553
|
+
}
|
|
554
|
+
isDefaultRoute(route) {
|
|
555
|
+
return DEFAULT_ROUTES_CONFIG
|
|
556
|
+
.some(r => r.path.includes(route));
|
|
557
|
+
}
|
|
558
|
+
getFullPath(route) {
|
|
559
|
+
const segments = [];
|
|
560
|
+
let current = route.root;
|
|
561
|
+
while (current) {
|
|
562
|
+
const path = current.routeConfig?.path;
|
|
563
|
+
if (path && path !== '')
|
|
564
|
+
segments.push(path);
|
|
565
|
+
current = current.firstChild ?? null;
|
|
566
|
+
}
|
|
567
|
+
return segments.join('/');
|
|
568
|
+
}
|
|
569
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppsService, deps: [{ token: i1$1.Store }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: AppLoggerService }, { token: RLB_CFG_AUTH, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
570
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppsService, providedIn: 'root' }); }
|
|
571
|
+
}
|
|
572
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppsService, decorators: [{
|
|
573
|
+
type: Injectable,
|
|
574
|
+
args: [{
|
|
575
|
+
providedIn: 'root'
|
|
576
|
+
}]
|
|
577
|
+
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: AppLoggerService }, { type: undefined, decorators: [{
|
|
578
|
+
type: Inject,
|
|
579
|
+
args: [RLB_CFG_AUTH]
|
|
580
|
+
}, {
|
|
581
|
+
type: Optional
|
|
582
|
+
}] }] });
|
|
583
|
+
|
|
584
|
+
class LanguageService {
|
|
585
|
+
constructor(translateService, cookiesService, i18nOptions) {
|
|
586
|
+
this.translateService = translateService;
|
|
587
|
+
this.cookiesService = cookiesService;
|
|
588
|
+
this.i18nOptions = i18nOptions;
|
|
589
|
+
this.contentLanguageChanged$ = new EventEmitter();
|
|
590
|
+
if (this.i18nOptions) {
|
|
591
|
+
translateService.addLangs(this.i18nOptions.availableLangs);
|
|
592
|
+
const languageUI = this.cookiesService.getCookie('ui-locale') || this.defaultLanguage || this.browserLanguage;
|
|
593
|
+
const languageContent = this.cookiesService.getCookie('content-locale') || this.defaultLanguage;
|
|
594
|
+
translateService.use(languageUI);
|
|
595
|
+
this.contentLanguage = languageContent;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
get language() {
|
|
599
|
+
return this.translateService.getCurrentLang() || this.i18nOptions.defaultLanguage;
|
|
600
|
+
}
|
|
601
|
+
set language(value) {
|
|
602
|
+
if (!value)
|
|
603
|
+
return;
|
|
604
|
+
this.cookiesService.setCookie('ui-locale', value);
|
|
605
|
+
this.translateService.use(value);
|
|
606
|
+
}
|
|
607
|
+
get contentLanguage() {
|
|
608
|
+
return this._contentLanguage;
|
|
609
|
+
}
|
|
610
|
+
set contentLanguage(value) {
|
|
611
|
+
this.cookiesService.setCookie('content-locale', value || this.defaultLanguage);
|
|
612
|
+
this._contentLanguage = value;
|
|
613
|
+
this.contentLanguageChanged$.emit(value);
|
|
614
|
+
}
|
|
615
|
+
get languages() {
|
|
616
|
+
return this.translateService.getLangs();
|
|
617
|
+
}
|
|
618
|
+
set languages(value) {
|
|
619
|
+
this.translateService.addLangs(value);
|
|
620
|
+
}
|
|
621
|
+
get defaultLanguage() {
|
|
622
|
+
return this.translateService.getFallbackLang() || 'en';
|
|
623
|
+
}
|
|
624
|
+
get browserLanguage() {
|
|
625
|
+
return this.translateService.getBrowserLang() || 'en';
|
|
626
|
+
}
|
|
627
|
+
translate(key, interpolateParams) {
|
|
628
|
+
return this.translateService.instant(key, interpolateParams);
|
|
629
|
+
}
|
|
630
|
+
translateAsync(key, interpolateParams) {
|
|
631
|
+
return this.translateService.get(key, interpolateParams);
|
|
632
|
+
}
|
|
633
|
+
get languageChanged$() {
|
|
634
|
+
return this.translateService.onLangChange;
|
|
635
|
+
}
|
|
636
|
+
getLanguageName(l) {
|
|
637
|
+
switch (l) {
|
|
638
|
+
case 'it': return 'Italiano';
|
|
639
|
+
case 'en': return 'English';
|
|
640
|
+
case 'es': return 'Español';
|
|
641
|
+
case 'fr': return 'Francés';
|
|
642
|
+
case 'ja': return '日本語';
|
|
643
|
+
default: return '';
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LanguageService, deps: [{ token: i1$2.TranslateService }, { token: CookiesService }, { token: RLB_CFG_I18N, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
647
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LanguageService, providedIn: 'root' }); }
|
|
648
|
+
}
|
|
649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LanguageService, decorators: [{
|
|
650
|
+
type: Injectable,
|
|
651
|
+
args: [{ providedIn: 'root' }]
|
|
652
|
+
}], ctorParameters: () => [{ type: i1$2.TranslateService }, { type: CookiesService }, { type: undefined, decorators: [{
|
|
653
|
+
type: Inject,
|
|
654
|
+
args: [RLB_CFG_I18N]
|
|
655
|
+
}, {
|
|
656
|
+
type: Optional
|
|
657
|
+
}] }] });
|
|
658
|
+
|
|
659
|
+
class AppBreadcrumbService {
|
|
660
|
+
constructor(router, route, loggerService, languageService) {
|
|
661
|
+
this.router = router;
|
|
662
|
+
this.route = route;
|
|
663
|
+
this.loggerService = loggerService;
|
|
664
|
+
this.languageService = languageService;
|
|
665
|
+
this._breadcrumbs$ = new BehaviorSubject([]);
|
|
666
|
+
this.breadcrumbs$ = this._breadcrumbs$.asObservable();
|
|
667
|
+
this.logger = this.loggerService.for(this.constructor.name);
|
|
668
|
+
this.logger.info('Service initialized');
|
|
669
|
+
this.router.events
|
|
670
|
+
.pipe(filter((event) => event instanceof NavigationEnd))
|
|
671
|
+
.subscribe(() => this.updateBreadcrumbs());
|
|
672
|
+
this.languageService.languageChanged$
|
|
673
|
+
.subscribe(() => this.updateBreadcrumbs());
|
|
674
|
+
// init construct
|
|
675
|
+
this.updateBreadcrumbs();
|
|
676
|
+
}
|
|
677
|
+
updateBreadcrumbs() {
|
|
678
|
+
const crumbs = this.buildBreadcrumbFromRoot(this.route);
|
|
679
|
+
this._breadcrumbs$.next(crumbs);
|
|
680
|
+
this.logger.info('Breadcrumbs updated', crumbs);
|
|
681
|
+
}
|
|
682
|
+
buildBreadcrumbFromRoot(route) {
|
|
683
|
+
const breadcrumbs = [];
|
|
684
|
+
let accumulatedLink = '';
|
|
685
|
+
let currentRoute = route.root;
|
|
686
|
+
while (currentRoute) {
|
|
687
|
+
const urlPart = currentRoute.snapshot.url.map(s => s.path).join('/');
|
|
688
|
+
if (urlPart)
|
|
689
|
+
accumulatedLink += `/${urlPart}`;
|
|
690
|
+
const label = currentRoute.snapshot.data['breadcrumb'];
|
|
691
|
+
if (label && (urlPart || breadcrumbs.length === 0)) {
|
|
692
|
+
breadcrumbs.push({
|
|
693
|
+
label: this.languageService.translate(label),
|
|
694
|
+
link: accumulatedLink || '/'
|
|
695
|
+
});
|
|
696
|
+
this.logger.debug('Pushed breadcrumb', { label, link: accumulatedLink });
|
|
697
|
+
}
|
|
698
|
+
if (!currentRoute.firstChild)
|
|
699
|
+
break;
|
|
700
|
+
currentRoute = currentRoute.firstChild;
|
|
701
|
+
}
|
|
702
|
+
return breadcrumbs;
|
|
703
|
+
}
|
|
704
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppBreadcrumbService, deps: [{ token: i2.Router }, { token: i2.ActivatedRoute }, { token: AppLoggerService }, { token: LanguageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
705
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppBreadcrumbService, providedIn: 'root' }); }
|
|
706
|
+
}
|
|
707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppBreadcrumbService, decorators: [{
|
|
708
|
+
type: Injectable,
|
|
709
|
+
args: [{ providedIn: 'root' }]
|
|
710
|
+
}], ctorParameters: () => [{ type: i2.Router }, { type: i2.ActivatedRoute }, { type: AppLoggerService }, { type: LanguageService }] });
|
|
711
|
+
|
|
712
|
+
class LocalCacheService {
|
|
713
|
+
constructor(options) {
|
|
714
|
+
this.options = options;
|
|
715
|
+
this.clear();
|
|
716
|
+
}
|
|
717
|
+
clear() {
|
|
718
|
+
if (typeof localStorage !== 'undefined') {
|
|
719
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
720
|
+
const key = localStorage.key(i) || '';
|
|
721
|
+
const val = localStorage.getItem(key);
|
|
722
|
+
if (!val)
|
|
723
|
+
continue;
|
|
724
|
+
try {
|
|
725
|
+
const exp = JSON.parse(val);
|
|
726
|
+
if (Date.now() > exp?.expire) {
|
|
727
|
+
localStorage.removeItem(key);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
catch (e) { }
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
readData(key) {
|
|
735
|
+
if (typeof localStorage !== 'undefined') {
|
|
736
|
+
const val = localStorage.getItem(key);
|
|
737
|
+
if (!val)
|
|
738
|
+
return null;
|
|
739
|
+
return JSON.parse(key);
|
|
740
|
+
}
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
storeData(key, data) {
|
|
744
|
+
if (typeof localStorage !== 'undefined') {
|
|
745
|
+
localStorage.setItem(key, JSON.stringify(data));
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
getData(ob, cacheKey, expirationSec) {
|
|
749
|
+
const cachedValue = this.readData(cacheKey);
|
|
750
|
+
return of(cachedValue).pipe(switchMap(cache => {
|
|
751
|
+
if (cache && cache.expire >= Date.now()) {
|
|
752
|
+
if (!this.options.production) {
|
|
753
|
+
console.info("%c Cache: " + cacheKey, 'background: #e5edff; color: #000');
|
|
754
|
+
}
|
|
755
|
+
return of(cache.data);
|
|
756
|
+
}
|
|
757
|
+
else {
|
|
758
|
+
if (!this.options.production) {
|
|
759
|
+
console.info("%c Cached: " + cacheKey, 'background: #e5edff; color: #000');
|
|
760
|
+
}
|
|
761
|
+
return ob.pipe(share(), switchMap(data => {
|
|
762
|
+
this.storeData(cacheKey, {
|
|
763
|
+
data,
|
|
764
|
+
expire: Date.now() + (expirationSec || 60) * 1000
|
|
765
|
+
});
|
|
766
|
+
return of(data);
|
|
767
|
+
}));
|
|
768
|
+
}
|
|
769
|
+
}), share());
|
|
770
|
+
}
|
|
771
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LocalCacheService, deps: [{ token: RLB_CFG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
772
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LocalCacheService, providedIn: 'root' }); }
|
|
773
|
+
}
|
|
774
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LocalCacheService, decorators: [{
|
|
775
|
+
type: Injectable,
|
|
776
|
+
args: [{
|
|
777
|
+
providedIn: 'root'
|
|
778
|
+
}]
|
|
779
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
780
|
+
type: Inject,
|
|
781
|
+
args: [RLB_CFG]
|
|
782
|
+
}, {
|
|
783
|
+
type: Optional
|
|
784
|
+
}] }] });
|
|
785
|
+
|
|
786
|
+
class AbstractMdService {
|
|
787
|
+
constructor() { }
|
|
788
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AbstractMdService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
789
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AbstractMdService, providedIn: 'root' }); }
|
|
790
|
+
}
|
|
791
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AbstractMdService, decorators: [{
|
|
792
|
+
type: Injectable,
|
|
793
|
+
args: [{
|
|
794
|
+
providedIn: 'root'
|
|
795
|
+
}]
|
|
796
|
+
}], ctorParameters: () => [] });
|
|
797
|
+
|
|
798
|
+
class StrapiService {
|
|
799
|
+
constructor(http, cache, cmsOptions) {
|
|
800
|
+
this.http = http;
|
|
801
|
+
this.cache = cache;
|
|
802
|
+
this.cmsOptions = cmsOptions;
|
|
803
|
+
}
|
|
804
|
+
fetchHome(lang, cid) {
|
|
805
|
+
const __r = this.http.get(`${this.cmsOptions.endpoint}/homes/${lang}/${cid}`);
|
|
806
|
+
return this.cache.getData(__r, `strapiHome/${lang}/${cid}`, this.cmsOptions.chacheDuration || 3600);
|
|
807
|
+
}
|
|
808
|
+
fetchTopic(id) {
|
|
809
|
+
return this.http.get(`${this.cmsOptions.endpoint}/topics/${id}`);
|
|
810
|
+
}
|
|
811
|
+
fetchTab(id) {
|
|
812
|
+
return this.http.get(`${this.cmsOptions.endpoint}/tabs/${id}`);
|
|
813
|
+
}
|
|
814
|
+
fetchFaqGroup(lang, cid) {
|
|
815
|
+
return this.http.get(`${this.cmsOptions.endpoint}/faq-groups/${lang}/${cid}`);
|
|
816
|
+
}
|
|
817
|
+
async _getGuideMenuPromise(lang, cid) {
|
|
818
|
+
const resp = (await lastValueFrom(this.http.get(`${this.cmsOptions.endpoint}/menu-items/${lang}/${cid}`)));
|
|
819
|
+
resp.menu_items = resp.menu_items.sort((a, b) => ((a.Order || Math.max()) > (b.Order || Math.max())) ? 1 : (((b.Order || Math.max()) > (a.Order || Math.max())) ? -1 : 0));
|
|
820
|
+
const t = await Promise.all(resp.menu_items.map((o) => this._getGuideMenuPromise(lang, o.ContentId)));
|
|
821
|
+
resp.menu_items = t.sort((a, b) => (a.Order || Math.max() > b.Order || Math.max()) ? 1 : ((b.Order || Math.max() > a.Order || Math.max()) ? -1 : 0));
|
|
822
|
+
return resp;
|
|
823
|
+
}
|
|
824
|
+
getGuideMenu(lang, cid) {
|
|
825
|
+
return this.cache.getData(from(this._getGuideMenuPromise(lang, cid)), `strapiMenu/${lang}/${cid}`, this.cmsOptions.chacheDuration || 3600);
|
|
826
|
+
}
|
|
827
|
+
// public getGuideMenu2(lang: string, cid: string): Observable<MenuItem> {
|
|
828
|
+
// var __r = this.http.get<MenuItem>(`${this.cmsOptions.endpoint}/menu-items/${lang}/${cid}`)
|
|
829
|
+
// .pipe(
|
|
830
|
+
// switchMap(menuItem => {
|
|
831
|
+
// if (menuItem.menu_items.length == 0)
|
|
832
|
+
// return of(menuItem)
|
|
833
|
+
// menuItem.menu_items = menuItem.menu_items
|
|
834
|
+
// .sort((a, b) => ((a.Order || Math.max()) > (b.Order || Math.max())) ? 1 : (((b.Order || Math.max()) > (a.Order || Math.max())) ? -1 : 0))
|
|
835
|
+
// return zip(menuItem.menu_items.map(menuSub => this.getGuideMenu(lang, menuSub.ContentId)))
|
|
836
|
+
// .pipe(map(menuSubItems => {
|
|
837
|
+
// menuItem.menu_items = menuSubItems
|
|
838
|
+
// return menuItem
|
|
839
|
+
// }))
|
|
840
|
+
// }))
|
|
841
|
+
// return this.cache.getData(__r, `strapiMenu/${lang}/${cid}`, this.cmsOptions.chacheDuration)
|
|
842
|
+
// }
|
|
843
|
+
fetchPage(lang, cid) {
|
|
844
|
+
const __r = this.http.get(`${this.cmsOptions.endpoint}/pages/${lang}/${cid}`)
|
|
845
|
+
.pipe(switchMap(page => {
|
|
846
|
+
const tabs$ = zip(page.page_tabs.map((o) => this.fetchTab(o.id)));
|
|
847
|
+
const topics$ = zip(page.topics.map((o) => this.fetchTopic(o.id)));
|
|
848
|
+
return zip(tabs$, topics$).pipe(map(([tabs, topics]) => {
|
|
849
|
+
page.page_tabs = tabs;
|
|
850
|
+
page.topics = topics;
|
|
851
|
+
return page;
|
|
852
|
+
}));
|
|
853
|
+
}));
|
|
854
|
+
return this.cache.getData(__r, `strapiPage/${lang}/${cid}`, this.cmsOptions.chacheDuration || 3600);
|
|
855
|
+
}
|
|
856
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: StrapiService, deps: [{ token: i1$3.HttpClient }, { token: LocalCacheService }, { token: RLB_CFG_CMS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
857
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: StrapiService, providedIn: 'root' }); }
|
|
858
|
+
}
|
|
859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: StrapiService, decorators: [{
|
|
860
|
+
type: Injectable,
|
|
861
|
+
args: [{
|
|
862
|
+
providedIn: 'root'
|
|
863
|
+
}]
|
|
864
|
+
}], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: LocalCacheService }, { type: undefined, decorators: [{
|
|
865
|
+
type: Inject,
|
|
866
|
+
args: [RLB_CFG_CMS]
|
|
867
|
+
}, {
|
|
868
|
+
type: Optional
|
|
869
|
+
}] }] });
|
|
870
|
+
|
|
871
|
+
class ErrorManagementService {
|
|
872
|
+
constructor(dialogService, toastService, languageService, options) {
|
|
873
|
+
this.dialogService = dialogService;
|
|
874
|
+
this.toastService = toastService;
|
|
875
|
+
this.languageService = languageService;
|
|
876
|
+
this.options = options;
|
|
877
|
+
}
|
|
878
|
+
showError(type = 'error', out = 'dialog', error) {
|
|
879
|
+
if (out === 'dialog') {
|
|
880
|
+
return this.showDialog(type, error);
|
|
881
|
+
}
|
|
882
|
+
if (out === 'toast') {
|
|
883
|
+
return this.showToast(type, error);
|
|
884
|
+
}
|
|
885
|
+
if (out === 'console') {
|
|
886
|
+
if (!this.options.production) {
|
|
887
|
+
console.info("%c Error service: ShowToast", 'background: #ffcdc9; color: #000', error);
|
|
888
|
+
}
|
|
889
|
+
return of({ reason: 'console' });
|
|
890
|
+
}
|
|
891
|
+
return EMPTY;
|
|
892
|
+
}
|
|
893
|
+
showDialog(type, error) {
|
|
894
|
+
if (!this.options.production) {
|
|
895
|
+
console.info("%c Error service: ShowDialog", 'background: #ffcdc9; color: #000', error);
|
|
896
|
+
}
|
|
897
|
+
return this.dialogService.openModal(this.options?.environment?.errorDialogName || 'error-modal-component', {
|
|
898
|
+
content: error?.message || '',
|
|
899
|
+
title: error?.name || '',
|
|
900
|
+
ok: this.languageService.translate('common.ok'),
|
|
901
|
+
type,
|
|
902
|
+
}, {
|
|
903
|
+
animation: true,
|
|
904
|
+
backdrop: true,
|
|
905
|
+
keyboard: true,
|
|
906
|
+
size: this.options?.environment?.errorDialogSize || 'md',
|
|
907
|
+
scrollable: true,
|
|
908
|
+
focus: true,
|
|
909
|
+
fullscreen: false,
|
|
910
|
+
verticalcentered: true,
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
showToast(type, error) {
|
|
914
|
+
if (!this.options.production) {
|
|
915
|
+
console.info("%c Error service: ShowToast", 'background: #ffcdc9; color: #000', error);
|
|
916
|
+
}
|
|
917
|
+
return this.toastService.openToast(this.options?.environment?.errorToastContainer || 'error-toast-container', this.options?.environment?.errorToastName || 'error-toast', {
|
|
918
|
+
content: error?.message || '',
|
|
919
|
+
title: error?.name || '',
|
|
920
|
+
ok: this.languageService.translate('common.ok'),
|
|
921
|
+
type: 'error'
|
|
922
|
+
}, {
|
|
923
|
+
animation: true,
|
|
924
|
+
autohide: true,
|
|
925
|
+
delay: 5000,
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
manageUI(type = 'error', out = 'dialog') {
|
|
929
|
+
return (source) => {
|
|
930
|
+
return source.pipe(catchError((error, k) => {
|
|
931
|
+
if (error.name && error.name === 'HttpErrorResponse' && error.error) {
|
|
932
|
+
error.message = `${error.error.status}: ${error.error.message}`;
|
|
933
|
+
}
|
|
934
|
+
this.showError(type, out, error);
|
|
935
|
+
return EMPTY;
|
|
936
|
+
}));
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ErrorManagementService, deps: [{ token: i6.ModalService }, { token: i6.ToastService }, { token: LanguageService }, { token: RLB_CFG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
940
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ErrorManagementService, providedIn: 'root' }); }
|
|
941
|
+
}
|
|
942
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ErrorManagementService, decorators: [{
|
|
943
|
+
type: Injectable,
|
|
944
|
+
args: [{
|
|
945
|
+
providedIn: 'root'
|
|
946
|
+
}]
|
|
947
|
+
}], ctorParameters: () => [{ type: i6.ModalService }, { type: i6.ToastService }, { type: LanguageService }, { type: undefined, decorators: [{
|
|
948
|
+
type: Inject,
|
|
949
|
+
args: [RLB_CFG]
|
|
950
|
+
}, {
|
|
951
|
+
type: Optional
|
|
952
|
+
}] }] });
|
|
953
|
+
|
|
954
|
+
class RlbTranslateAdapterService {
|
|
955
|
+
constructor(translateService, service) {
|
|
956
|
+
this.translateService = translateService;
|
|
957
|
+
this.service = service;
|
|
958
|
+
}
|
|
959
|
+
instant(key, params) {
|
|
960
|
+
return this.translateService.instant(key, params);
|
|
961
|
+
}
|
|
962
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbTranslateAdapterService, deps: [{ token: i1$2.TranslateService }, { token: i6.UniqueIdService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
963
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbTranslateAdapterService, providedIn: 'root' }); }
|
|
964
|
+
}
|
|
965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbTranslateAdapterService, decorators: [{
|
|
966
|
+
type: Injectable,
|
|
967
|
+
args: [{ providedIn: 'root' }]
|
|
968
|
+
}], ctorParameters: () => [{ type: i1$2.TranslateService }, { type: i6.UniqueIdService }] });
|
|
969
|
+
|
|
970
|
+
function provideRlbI18n(i18n) {
|
|
971
|
+
if (!i18n)
|
|
972
|
+
return [];
|
|
973
|
+
const prefix = './assets/i18n/';
|
|
974
|
+
const suffix = '.json';
|
|
975
|
+
return [
|
|
976
|
+
importProvidersFrom([
|
|
977
|
+
TranslateModule.forRoot({
|
|
978
|
+
loader: provideTranslateHttpLoader({
|
|
979
|
+
prefix,
|
|
980
|
+
suffix,
|
|
981
|
+
// enforceLoading: true, // Adds cache-busting timestamp
|
|
982
|
+
// useHttpBackend: true // Bypasses HTTP interceptors
|
|
983
|
+
}),
|
|
984
|
+
fallbackLang: i18n.defaultLanguage
|
|
985
|
+
})
|
|
986
|
+
]),
|
|
987
|
+
{ provide: RLB_CFG_I18N, useValue: i18n },
|
|
988
|
+
{
|
|
989
|
+
provide: RLB_TRANSLATION_SERVICE,
|
|
990
|
+
useClass: RlbTranslateAdapterService
|
|
991
|
+
},
|
|
992
|
+
];
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
class TranslateBrowserLoader {
|
|
996
|
+
constructor(http, transferState, prefix = './assets/i18n/', suffix = '.json') {
|
|
997
|
+
this.http = http;
|
|
998
|
+
this.transferState = transferState;
|
|
999
|
+
this.prefix = prefix;
|
|
1000
|
+
this.suffix = suffix;
|
|
1001
|
+
}
|
|
1002
|
+
getTranslation(lang) {
|
|
1003
|
+
const key = makeStateKey('transfer-translate-' + lang);
|
|
1004
|
+
const data = this.transferState.get(key, null);
|
|
1005
|
+
// First we are looking for the translations in transfer-state,
|
|
1006
|
+
// if none found, http load as fallback
|
|
1007
|
+
if (data) {
|
|
1008
|
+
return new Observable((observer) => {
|
|
1009
|
+
observer.next(data);
|
|
1010
|
+
observer.complete();
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
return this.http.get(`${this.prefix}${lang}${this.suffix}`);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function translateBrowserLoaderFactory(httpClient, transferState) {
|
|
1019
|
+
return new TranslateBrowserLoader(httpClient, transferState);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
class CookiesService {
|
|
1023
|
+
getCookie(name) {
|
|
1024
|
+
let ca = document.cookie.split(';');
|
|
1025
|
+
let caLen = ca.length;
|
|
1026
|
+
let cookieName = `${name}=`;
|
|
1027
|
+
let c;
|
|
1028
|
+
for (let i = 0; i < caLen; i += 1) {
|
|
1029
|
+
c = ca[i].replace(/^\s+/g, '');
|
|
1030
|
+
if (c.indexOf(cookieName) == 0) {
|
|
1031
|
+
return c.substring(cookieName.length, c.length);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
return undefined;
|
|
1035
|
+
}
|
|
1036
|
+
deleteCookie(name) {
|
|
1037
|
+
this.setCookie(name, '', -1);
|
|
1038
|
+
}
|
|
1039
|
+
setCookie(name, value, expireDays, path = '') {
|
|
1040
|
+
let cookie = `${name}=${value};`;
|
|
1041
|
+
if (expireDays) {
|
|
1042
|
+
let d = new Date();
|
|
1043
|
+
d.setTime(d.getTime() + expireDays * 24 * 60 * 60 * 1000);
|
|
1044
|
+
let expires = `expires=${d.toUTCString()};`;
|
|
1045
|
+
cookie += `${expires}`;
|
|
1046
|
+
}
|
|
1047
|
+
if (path) {
|
|
1048
|
+
cookie += `path=${path};`;
|
|
1049
|
+
}
|
|
1050
|
+
document.cookie = cookie;
|
|
1051
|
+
}
|
|
1052
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CookiesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1053
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CookiesService, providedIn: 'root' }); }
|
|
1054
|
+
}
|
|
1055
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CookiesService, decorators: [{
|
|
1056
|
+
type: Injectable,
|
|
1057
|
+
args: [{
|
|
1058
|
+
providedIn: 'root'
|
|
1059
|
+
}]
|
|
1060
|
+
}] });
|
|
1061
|
+
|
|
1062
|
+
class PwaUpdaterService {
|
|
1063
|
+
get newVersionAvailable$() {
|
|
1064
|
+
return this._newVersionAvailable$.asObservable();
|
|
1065
|
+
}
|
|
1066
|
+
constructor(updates, modalService, languageService) {
|
|
1067
|
+
this.updates = updates;
|
|
1068
|
+
this.modalService = modalService;
|
|
1069
|
+
this.languageService = languageService;
|
|
1070
|
+
this._newVersionAvailable$ = new EventEmitter();
|
|
1071
|
+
this.updates.versionUpdates
|
|
1072
|
+
.pipe(filter((evt) => (evt.type === 'VERSION_READY'))).subscribe(() => this._newVersionAvailable$.emit());
|
|
1073
|
+
}
|
|
1074
|
+
update() {
|
|
1075
|
+
this.updates.activateUpdate()
|
|
1076
|
+
.then(() => document.location.reload());
|
|
1077
|
+
}
|
|
1078
|
+
async checkForUpdates() {
|
|
1079
|
+
return await this.updates.checkForUpdate();
|
|
1080
|
+
}
|
|
1081
|
+
checkWithDialog() {
|
|
1082
|
+
return this.updates.versionUpdates
|
|
1083
|
+
.pipe(filter((evt) => {
|
|
1084
|
+
const result = evt.type === 'VERSION_READY';
|
|
1085
|
+
return result;
|
|
1086
|
+
}), switchMap(() => this.modalService.openSimpleModal(this.languageService.translate('core.pwa.newVersionAvailable'), this.languageService.translate('core.pwa.updateMessage'), this.languageService.translate('core.pwa.updateNow'), this.languageService.translate('core.pwa.update'), this.languageService.translate('core.pwa.later'))), filter((res) => res?.reason === 'ok'), //si ferma se l'evento non è una action
|
|
1087
|
+
map(() => this.updates.activateUpdate().then(() => location.reload())));
|
|
1088
|
+
}
|
|
1089
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PwaUpdaterService, deps: [{ token: i1$4.SwUpdate }, { token: i6.ModalService }, { token: LanguageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1090
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PwaUpdaterService, providedIn: 'root' }); }
|
|
1091
|
+
}
|
|
1092
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PwaUpdaterService, decorators: [{
|
|
1093
|
+
type: Injectable,
|
|
1094
|
+
args: [{
|
|
1095
|
+
providedIn: 'root'
|
|
1096
|
+
}]
|
|
1097
|
+
}], ctorParameters: () => [{ type: i1$4.SwUpdate }, { type: i6.ModalService }, { type: LanguageService }] });
|
|
1098
|
+
|
|
1099
|
+
class UtilsService {
|
|
1100
|
+
isNumber(evt) {
|
|
1101
|
+
evt = evt || window.event;
|
|
1102
|
+
const charCode = evt.which ? evt.which : evt.keyCode;
|
|
1103
|
+
if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode !== 46) {
|
|
1104
|
+
evt.preventDefault();
|
|
1105
|
+
return false;
|
|
1106
|
+
}
|
|
1107
|
+
else {
|
|
1108
|
+
return true;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
toPlainDataObject(o) {
|
|
1112
|
+
if (o !== null && o != undefined) {
|
|
1113
|
+
if (Array.isArray(o)) {
|
|
1114
|
+
return o.map(j => this.toPlainDataObject(j));
|
|
1115
|
+
}
|
|
1116
|
+
else if (typeof o === 'object') {
|
|
1117
|
+
return Object.getOwnPropertyNames(o).reduce((result, name) => {
|
|
1118
|
+
if (name !== '__ob__')
|
|
1119
|
+
result[name] = this.toPlainDataObject(o[name]);
|
|
1120
|
+
return result;
|
|
1121
|
+
}, {});
|
|
1122
|
+
}
|
|
1123
|
+
else if (typeof o === 'function' || typeof o === 'undefined') {
|
|
1124
|
+
return undefined;
|
|
1125
|
+
}
|
|
1126
|
+
else {
|
|
1127
|
+
return o;
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
groupBy(xs, predicate) {
|
|
1132
|
+
return xs.reduce((rv, x) => {
|
|
1133
|
+
;
|
|
1134
|
+
(rv[predicate(x)] = rv[predicate(x)] || []).push(x);
|
|
1135
|
+
return rv;
|
|
1136
|
+
}, {});
|
|
1137
|
+
}
|
|
1138
|
+
s(x, y) {
|
|
1139
|
+
var pre = ['string', 'number', 'bool'];
|
|
1140
|
+
if (typeof x !== typeof y)
|
|
1141
|
+
return pre.indexOf(typeof y) - pre.indexOf(typeof x);
|
|
1142
|
+
if (x === y)
|
|
1143
|
+
return 0;
|
|
1144
|
+
else
|
|
1145
|
+
return x > y ? 1 : -1;
|
|
1146
|
+
}
|
|
1147
|
+
compareArrayUnsort(a1, a2) {
|
|
1148
|
+
if (!Array.isArray(a1))
|
|
1149
|
+
return false;
|
|
1150
|
+
if (!Array.isArray(a2))
|
|
1151
|
+
return false;
|
|
1152
|
+
if (a1.length != a2.length)
|
|
1153
|
+
return false;
|
|
1154
|
+
a1 = a1.sort(this.s);
|
|
1155
|
+
a2 = a2.sort(this.s);
|
|
1156
|
+
for (var i = 0, l = a1.length; i < l; i++) {
|
|
1157
|
+
if (Array.isArray(a1[i]) && Array.isArray(a2[i])) {
|
|
1158
|
+
if (!this.compareArrayUnsort(a1[i], a2[i]))
|
|
1159
|
+
return false;
|
|
1160
|
+
}
|
|
1161
|
+
else if (a1[i] != a2[i]) {
|
|
1162
|
+
// Warning - two different object instances will never be equal: {x:20} != {x:20}
|
|
1163
|
+
return false;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
return true;
|
|
1167
|
+
}
|
|
1168
|
+
removeMD(md, options) {
|
|
1169
|
+
options = options || {};
|
|
1170
|
+
options.listUnicodeChar = options.hasOwnProperty('listUnicodeChar') ? options.listUnicodeChar : undefined;
|
|
1171
|
+
options.stripListLeaders = options.hasOwnProperty('stripListLeaders') ? options.stripListLeaders : true;
|
|
1172
|
+
options.gfm = options.hasOwnProperty('gfm') ? options.gfm : true;
|
|
1173
|
+
options.useImgAltText = options.hasOwnProperty('useImgAltText') ? options.useImgAltText : true;
|
|
1174
|
+
var output = md || '';
|
|
1175
|
+
// Remove horizontal rules (stripListHeaders conflict with this rule, which is why it has been moved to the top)
|
|
1176
|
+
output = output.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm, '');
|
|
1177
|
+
try {
|
|
1178
|
+
if (options.stripListLeaders) {
|
|
1179
|
+
if (options.listUnicodeChar)
|
|
1180
|
+
output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, options.listUnicodeChar + ' $1');
|
|
1181
|
+
else
|
|
1182
|
+
output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, '$1');
|
|
1183
|
+
}
|
|
1184
|
+
if (options.gfm) {
|
|
1185
|
+
output = output
|
|
1186
|
+
// Header
|
|
1187
|
+
.replace(/\n={2,}/g, '\n')
|
|
1188
|
+
// Fenced codeblocks
|
|
1189
|
+
.replace(/~{3}.*\n/g, '')
|
|
1190
|
+
// Strikethrough
|
|
1191
|
+
.replace(/~~/g, '')
|
|
1192
|
+
// Fenced codeblocks
|
|
1193
|
+
.replace(/`{3}.*\n/g, '');
|
|
1194
|
+
}
|
|
1195
|
+
output = output
|
|
1196
|
+
// Remove HTML tags
|
|
1197
|
+
.replace(/<[^>]*>/g, '')
|
|
1198
|
+
// Remove setext-style headers
|
|
1199
|
+
.replace(/^[=\-]{2,}\s*$/g, '')
|
|
1200
|
+
// Remove footnotes?
|
|
1201
|
+
.replace(/\[\^.+?\](\: .*?$)?/g, '')
|
|
1202
|
+
.replace(/\s{0,2}\[.*?\]: .*?$/g, '')
|
|
1203
|
+
// Remove images
|
|
1204
|
+
.replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, options.useImgAltText ? '$1' : '')
|
|
1205
|
+
// Remove inline links
|
|
1206
|
+
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
|
|
1207
|
+
// Remove blockquotes
|
|
1208
|
+
.replace(/^\s{0,3}>\s?/g, '')
|
|
1209
|
+
// Remove reference-style links?
|
|
1210
|
+
.replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '')
|
|
1211
|
+
// Remove atx-style headers
|
|
1212
|
+
.replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm, '$1$2$3')
|
|
1213
|
+
// Remove emphasis (repeat the line to remove double emphasis)
|
|
1214
|
+
.replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g, '$2')
|
|
1215
|
+
.replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g, '$2')
|
|
1216
|
+
// Remove code blocks
|
|
1217
|
+
.replace(/(`{3,})(.*?)\1/gm, '$2')
|
|
1218
|
+
// Remove inline code
|
|
1219
|
+
.replace(/`(.+?)`/g, '$1')
|
|
1220
|
+
// Replace two or more newlines with exactly two? Not entirely sure this belongs here...
|
|
1221
|
+
.replace(/\n{2,}/g, '\n\n');
|
|
1222
|
+
}
|
|
1223
|
+
catch (e) {
|
|
1224
|
+
console.error(e);
|
|
1225
|
+
return md;
|
|
1226
|
+
}
|
|
1227
|
+
return output;
|
|
1228
|
+
}
|
|
1229
|
+
floatStr(input) {
|
|
1230
|
+
if (input) {
|
|
1231
|
+
if (typeof input === 'number') {
|
|
1232
|
+
input = input.toString();
|
|
1233
|
+
}
|
|
1234
|
+
return parseFloat(input.replace(',', '.')).toFixed(2);
|
|
1235
|
+
}
|
|
1236
|
+
return '0.00';
|
|
1237
|
+
}
|
|
1238
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1239
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UtilsService, providedIn: 'root' }); }
|
|
1240
|
+
}
|
|
1241
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UtilsService, decorators: [{
|
|
1242
|
+
type: Injectable,
|
|
1243
|
+
args: [{
|
|
1244
|
+
providedIn: 'root'
|
|
1245
|
+
}]
|
|
1246
|
+
}] });
|
|
1247
|
+
|
|
1248
|
+
class ParseJwtService {
|
|
1249
|
+
_atob(string) {
|
|
1250
|
+
return Buffer.from(string, 'base64').toString("binary"); // atob(string)
|
|
1251
|
+
}
|
|
1252
|
+
parseJwt(token) {
|
|
1253
|
+
if (token !== undefined && token !== null && token !== "") {
|
|
1254
|
+
var base64Url = token.split(".")[1];
|
|
1255
|
+
var base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
1256
|
+
var jsonPayload = decodeURIComponent(this._atob(base64)
|
|
1257
|
+
.split("")
|
|
1258
|
+
.map(c => ("%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2)))
|
|
1259
|
+
.join(""));
|
|
1260
|
+
return JSON.parse(jsonPayload);
|
|
1261
|
+
}
|
|
1262
|
+
else {
|
|
1263
|
+
return {};
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
;
|
|
1267
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ParseJwtService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1268
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ParseJwtService, providedIn: 'root' }); }
|
|
1269
|
+
}
|
|
1270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ParseJwtService, decorators: [{
|
|
1271
|
+
type: Injectable,
|
|
1272
|
+
args: [{
|
|
1273
|
+
providedIn: 'root'
|
|
1274
|
+
}]
|
|
1275
|
+
}] });
|
|
1276
|
+
|
|
1277
|
+
class AuthenticationService {
|
|
1278
|
+
constructor(oidcSecurityService, cookiesService, router, parseJwtService, store, envConfig, authConfig) {
|
|
1279
|
+
this.oidcSecurityService = oidcSecurityService;
|
|
1280
|
+
this.cookiesService = cookiesService;
|
|
1281
|
+
this.router = router;
|
|
1282
|
+
this.parseJwtService = parseJwtService;
|
|
1283
|
+
this.store = store;
|
|
1284
|
+
this.envConfig = envConfig;
|
|
1285
|
+
this.authConfig = authConfig;
|
|
1286
|
+
}
|
|
1287
|
+
get oidc() {
|
|
1288
|
+
return this.oidcSecurityService;
|
|
1289
|
+
}
|
|
1290
|
+
get config() {
|
|
1291
|
+
return this.authConfig;
|
|
1292
|
+
}
|
|
1293
|
+
get currentProvider() {
|
|
1294
|
+
const currentProvider = this.store.selectSignal((state) => state[authsFeatureKey].currentProvider)();
|
|
1295
|
+
return this.authConfig?.providers.find((provider) => provider.configId === currentProvider);
|
|
1296
|
+
}
|
|
1297
|
+
checkAuthMultiple(url) {
|
|
1298
|
+
// if (Capacitor.isNativePlatform()) {
|
|
1299
|
+
// console.log('Capacitor is native platform')
|
|
1300
|
+
// App.addListener('appUrlOpen', async ({ url }: { url: string }) => {
|
|
1301
|
+
// await this.zone.run(async () => {
|
|
1302
|
+
// const _url = `${environment.baseUrl}/${url.slice(url.indexOf('?'))}`
|
|
1303
|
+
// this.authorize(_url).subscribe();
|
|
1304
|
+
// })
|
|
1305
|
+
// });
|
|
1306
|
+
// } else {
|
|
1307
|
+
return this.oidc.checkAuthMultiple(url)
|
|
1308
|
+
.pipe(tap(data => {
|
|
1309
|
+
if (data.some(o => o.isAuthenticated)) {
|
|
1310
|
+
const redirect = this.cookiesService.getCookie('loginRedirectUrl');
|
|
1311
|
+
if (redirect) {
|
|
1312
|
+
this.cookiesService.deleteCookie('loginRedirectUrl');
|
|
1313
|
+
this.router.navigate([redirect]);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}));
|
|
1317
|
+
//}
|
|
1318
|
+
}
|
|
1319
|
+
login() {
|
|
1320
|
+
this.cookiesService.setCookie('loginRedirectUrl', this.router.url || '/', 1);
|
|
1321
|
+
// electron
|
|
1322
|
+
if (typeof (process) !== 'undefined' &&
|
|
1323
|
+
typeof (process?.version) !== 'undefined' &&
|
|
1324
|
+
typeof (process?.versions['electron']) !== undefined) {
|
|
1325
|
+
const urlHandler = (authUrl) => {
|
|
1326
|
+
console.log(authUrl);
|
|
1327
|
+
this.modal = window.open(authUrl, '_blank', 'nodeIntegration=no');
|
|
1328
|
+
};
|
|
1329
|
+
return this.oidc.authorize(this.currentProvider?.configId, { urlHandler });
|
|
1330
|
+
}
|
|
1331
|
+
// capacitor
|
|
1332
|
+
// else if (Capacitor.isNativePlatform()) {
|
|
1333
|
+
// const urlHandler = async (url: string) => {
|
|
1334
|
+
// console.log('opening', url);
|
|
1335
|
+
// await Browser.open({ url, windowName: '_self' })
|
|
1336
|
+
// };
|
|
1337
|
+
// this.oidc.authorize(config, { urlHandler });
|
|
1338
|
+
// }
|
|
1339
|
+
// browser
|
|
1340
|
+
else {
|
|
1341
|
+
return this.oidc.authorize(this.currentProvider?.configId);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
async logout() {
|
|
1345
|
+
await lastValueFrom(this.oidc.logoff(this.currentProvider?.configId));
|
|
1346
|
+
}
|
|
1347
|
+
logout$() {
|
|
1348
|
+
return this.oidc.logoff(this.currentProvider?.configId);
|
|
1349
|
+
}
|
|
1350
|
+
get userInfo$() {
|
|
1351
|
+
return this.oidc.userData$.pipe(map((userData) => {
|
|
1352
|
+
const user = userData.allUserData.find(o => o.configId === this.currentProvider?.configId);
|
|
1353
|
+
return user ? user.userData : null;
|
|
1354
|
+
}));
|
|
1355
|
+
}
|
|
1356
|
+
get isAuthenticated$() {
|
|
1357
|
+
return this.oidc.isAuthenticated$.pipe(map((isAuthenticated) => {
|
|
1358
|
+
return isAuthenticated.allConfigsAuthenticated.find(o => o.configId === this.currentProvider?.configId)?.isAuthenticated || false;
|
|
1359
|
+
}));
|
|
1360
|
+
}
|
|
1361
|
+
get accessToken$() {
|
|
1362
|
+
return this.oidc.getAccessToken(this.currentProvider?.configId);
|
|
1363
|
+
}
|
|
1364
|
+
get idToken$() {
|
|
1365
|
+
return this.oidc.getIdToken(this.currentProvider?.configId);
|
|
1366
|
+
}
|
|
1367
|
+
get refreshToken$() {
|
|
1368
|
+
return this.oidc.getRefreshToken(this.currentProvider?.configId);
|
|
1369
|
+
}
|
|
1370
|
+
get roles$() {
|
|
1371
|
+
return this.accessToken$.pipe(map((token) => (this.parseJwtService.parseJwt(token))), map((payload) => payload['roles']));
|
|
1372
|
+
}
|
|
1373
|
+
matchRoles(roles) {
|
|
1374
|
+
return this.accessToken$.pipe(map(token => this.parseJwtService.parseJwt(token)), map(payload => payload['roles']), map(userRoles => roles.some(role => userRoles.includes(role))));
|
|
1375
|
+
}
|
|
1376
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthenticationService, deps: [{ token: i1$5.OidcSecurityService }, { token: CookiesService }, { token: i2.Router }, { token: ParseJwtService }, { token: i1$1.Store }, { token: RLB_CFG_ENV, optional: true }, { token: RLB_CFG_AUTH, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1377
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthenticationService, providedIn: 'root' }); }
|
|
1378
|
+
}
|
|
1379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthenticationService, decorators: [{
|
|
1380
|
+
type: Injectable,
|
|
1381
|
+
args: [{
|
|
1382
|
+
providedIn: 'root'
|
|
1383
|
+
}]
|
|
1384
|
+
}], ctorParameters: () => [{ type: i1$5.OidcSecurityService }, { type: CookiesService }, { type: i2.Router }, { type: ParseJwtService }, { type: i1$1.Store }, { type: undefined, decorators: [{
|
|
1385
|
+
type: Optional
|
|
1386
|
+
}, {
|
|
1387
|
+
type: Inject,
|
|
1388
|
+
args: [RLB_CFG_ENV]
|
|
1389
|
+
}] }, { type: undefined, decorators: [{
|
|
1390
|
+
type: Optional
|
|
1391
|
+
}, {
|
|
1392
|
+
type: Inject,
|
|
1393
|
+
args: [RLB_CFG_AUTH]
|
|
1394
|
+
}] }] });
|
|
1395
|
+
|
|
1396
|
+
class TokenOauthInterceptor {
|
|
1397
|
+
constructor(authenticationService, appconfig) {
|
|
1398
|
+
this.authenticationService = authenticationService;
|
|
1399
|
+
this.appconfig = appconfig;
|
|
1400
|
+
}
|
|
1401
|
+
intercept(request, next) {
|
|
1402
|
+
const endpoints = !this.appconfig.endpoints ? [] : Object.values(this.appconfig.endpoints).filter(e => e.auth && !e.wss);
|
|
1403
|
+
if (!endpoints.some(e => request.url.includes(e.baseUrl))) {
|
|
1404
|
+
return next.handle(request);
|
|
1405
|
+
}
|
|
1406
|
+
return this.authenticationService.accessToken$.pipe(switchMap(token => {
|
|
1407
|
+
if (token) {
|
|
1408
|
+
const newRequest = request.clone({
|
|
1409
|
+
setHeaders: { Authorization: `Bearer ${token}` }
|
|
1410
|
+
});
|
|
1411
|
+
return next.handle(newRequest);
|
|
1412
|
+
}
|
|
1413
|
+
return next.handle(request);
|
|
1414
|
+
}));
|
|
1415
|
+
}
|
|
1416
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenOauthInterceptor, deps: [{ token: AuthenticationService }, { token: RLB_CFG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1417
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenOauthInterceptor }); }
|
|
1418
|
+
}
|
|
1419
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TokenOauthInterceptor, decorators: [{
|
|
1420
|
+
type: Injectable
|
|
1421
|
+
}], ctorParameters: () => [{ type: AuthenticationService }, { type: undefined, decorators: [{
|
|
1422
|
+
type: Inject,
|
|
1423
|
+
args: [RLB_CFG]
|
|
1424
|
+
}] }] });
|
|
1425
|
+
|
|
1426
|
+
function provideRlbCodeBrowserOAuth(auth) {
|
|
1427
|
+
if (!auth || auth.protocol !== 'oauth')
|
|
1428
|
+
return makeEnvironmentProviders([]);
|
|
1429
|
+
const providers = [
|
|
1430
|
+
{ provide: RLB_CFG_AUTH, useValue: auth },
|
|
1431
|
+
{ provide: AbstractLoggerService, useClass: AppLoggerService },
|
|
1432
|
+
AuthModule,
|
|
1433
|
+
provideAuth({
|
|
1434
|
+
config: auth.providers.map((_auth) => ({
|
|
1435
|
+
..._auth,
|
|
1436
|
+
secureRoutes: auth.allowedUrls,
|
|
1437
|
+
responseType: 'code',
|
|
1438
|
+
silentRenew: true,
|
|
1439
|
+
useRefreshToken: true,
|
|
1440
|
+
autoUserInfo: true,
|
|
1441
|
+
renewUserInfoAfterTokenRenew: true,
|
|
1442
|
+
ignoreNonceAfterRefresh: true,
|
|
1443
|
+
renewTimeBeforeTokenExpiresInSeconds: 30,
|
|
1444
|
+
}))
|
|
1445
|
+
}),
|
|
1446
|
+
];
|
|
1447
|
+
if (auth.interceptor === 'oauth-code-all') {
|
|
1448
|
+
providers.push({ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true });
|
|
1449
|
+
}
|
|
1450
|
+
if (auth.interceptor === 'oauth-code-ep') {
|
|
1451
|
+
providers.push({ provide: HTTP_INTERCEPTORS, useClass: TokenOauthInterceptor, multi: true });
|
|
1452
|
+
}
|
|
1453
|
+
if (auth.storage === 'cookies') {
|
|
1454
|
+
providers.push({ provide: AbstractSecurityStorage, useClass: TokenCookiesService });
|
|
1455
|
+
}
|
|
1456
|
+
if (auth.storage === 'localStorage') {
|
|
1457
|
+
providers.push({ provide: AbstractSecurityStorage, useClass: TokenStoreService });
|
|
1458
|
+
}
|
|
1459
|
+
if (auth.storage === 'sessionStorage') {
|
|
1460
|
+
providers.push({ provide: AbstractSecurityStorage, useClass: TokenSessionService });
|
|
1461
|
+
}
|
|
1462
|
+
return makeEnvironmentProviders(providers);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
class CmsPipe {
|
|
1466
|
+
constructor(cmsOptions) {
|
|
1467
|
+
this.cmsOptions = cmsOptions;
|
|
1468
|
+
}
|
|
1469
|
+
transform(value, ...args) {
|
|
1470
|
+
let cms = this.cmsOptions.endpoint;
|
|
1471
|
+
if (!cms) {
|
|
1472
|
+
return value;
|
|
1473
|
+
}
|
|
1474
|
+
if (cms.endsWith("/")) {
|
|
1475
|
+
cms = cms.substring(0, cms.length - 1);
|
|
1476
|
+
}
|
|
1477
|
+
if (value.startsWith("/")) {
|
|
1478
|
+
value = value.substring(1);
|
|
1479
|
+
}
|
|
1480
|
+
return `${cms}/${value}`;
|
|
1481
|
+
}
|
|
1482
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CmsPipe, deps: [{ token: RLB_CFG_CMS, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1483
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: CmsPipe, isStandalone: false, name: "cms" }); }
|
|
1484
|
+
}
|
|
1485
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CmsPipe, decorators: [{
|
|
1486
|
+
type: Pipe,
|
|
1487
|
+
args: [{
|
|
1488
|
+
name: 'cms',
|
|
1489
|
+
standalone: false
|
|
1490
|
+
}]
|
|
1491
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1492
|
+
type: Inject,
|
|
1493
|
+
args: [RLB_CFG_CMS]
|
|
1494
|
+
}, {
|
|
1495
|
+
type: Optional
|
|
1496
|
+
}] }] });
|
|
1497
|
+
|
|
1498
|
+
class CmsComponent {
|
|
1499
|
+
constructor(strapiService, languageService, cmsOptions, mdService) {
|
|
1500
|
+
this.strapiService = strapiService;
|
|
1501
|
+
this.languageService = languageService;
|
|
1502
|
+
this.cmsOptions = cmsOptions;
|
|
1503
|
+
this.mdService = mdService;
|
|
1504
|
+
}
|
|
1505
|
+
ngOnDestroy() {
|
|
1506
|
+
this.subscriptionLang?.unsubscribe();
|
|
1507
|
+
this.subscriptionPage?.unsubscribe();
|
|
1508
|
+
}
|
|
1509
|
+
ngOnInit() {
|
|
1510
|
+
const lang = this.cmsOptions.useAppLanguage ? this.languageService.language : this.languageService.contentLanguage;
|
|
1511
|
+
const page$ = this.strapiService.fetchPage(lang || this.languageService.defaultLanguage, this.contentId || '');
|
|
1512
|
+
this.subscriptionLang = this.languageService.languageChanged$.pipe(switchMap(langEvent => {
|
|
1513
|
+
if (langEvent.lang) {
|
|
1514
|
+
return page$;
|
|
1515
|
+
}
|
|
1516
|
+
return EMPTY;
|
|
1517
|
+
})).subscribe(p => this.page = p);
|
|
1518
|
+
this.subscriptionPage = page$.subscribe(p => this.page = p);
|
|
1519
|
+
}
|
|
1520
|
+
md(md) {
|
|
1521
|
+
if (this.cmsOptions.markdown === 'ignore') {
|
|
1522
|
+
return md;
|
|
1523
|
+
}
|
|
1524
|
+
else {
|
|
1525
|
+
if (!this.mdService) {
|
|
1526
|
+
throw new Error('No MdService provided');
|
|
1527
|
+
}
|
|
1528
|
+
else if (this.cmsOptions.markdown === 'text') {
|
|
1529
|
+
return this.mdService.md2text(md);
|
|
1530
|
+
}
|
|
1531
|
+
else if (this.cmsOptions.markdown === 'html') {
|
|
1532
|
+
return this.mdService.md2html(md);
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
return md;
|
|
1536
|
+
}
|
|
1537
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CmsComponent, deps: [{ token: StrapiService }, { token: LanguageService }, { token: RLB_CFG_CMS, optional: true }, { token: AbstractMdService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1538
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: CmsComponent, isStandalone: false, selector: "rlb-cms-template", inputs: { contentId: "contentId", breadcrumb: "breadcrumb" }, ngImport: i0, template: "<div>\n <div class=\"container\" *ngIf=\"page\">\n <div class=\"row my-4\" *ngIf=\"breadcrumb\">\n <div class=\"col-12\">\n <rlb-breadcrumb [items]=\"breadcrumb\"></rlb-breadcrumb>\n </div>\n </div>\n <div class=\"row my-4\">\n <div class=\"col-12\">\n <h1 class=\"text-center\">{{page.Title}}</h1>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"page.Content\">\n <div class=\"col-12\">\n <div [innerHTML]=\"page.Content \"></div>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"page.page_tabs.length>0\">\n <div class=\"col-12\">\n <rlb-tabs>\n <rlb-tab *ngFor=\"let tab of page.page_tabs; let i = index\" [target]=\"'cms-tab-'+i\">\n {{tab.Title}}\n </rlb-tab>\n </rlb-tabs>\n <rlb-tab-content>\n <rlb-tab-pane *ngFor=\"let tab of page.page_tabs; let i = index\" [id]=\"'cms-tab-'+i\">\n <div class=\"container-fluid\">\n <div class=\"row my-4\" *ngIf=\"tab.Content\">\n <div class=\"col-12\">\n <div [innerHTML]=\"tab.Content \"></div>\n </div>\n </div>\n <div class=\"row my-4 mx-auto card-steps\" *ngFor=\"let step of tab.steps; let i = index\"\n style=\"max-width: 350px; border-bottom: 1px solid rgb(192, 198, 204);\">\n <div class=\"col-8\">\n <div class=\"pb-2\">\n <div style=\"height: 54px; min-width: 54px; width: 54px; border: 5px solid rgb(192, 198, 204);\"\n class=\"round-counter\">\n <span class=\"red\">{{i+1}}</span>\n </div>\n </div>\n <div>\n <div [innerHTML]=\"step.Content \"></div>\n </div>\n </div>\n <div class=\"col-4 pb-2\">\n <img [src]=\"step.Picture.url|cms\">\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"tab.faqs.length>0\">\n <div class=\"col-12\">\n <h2 class=\"py-3\">{{tab.FaqTitle}}</h2>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"tab.faqs.length>0 && tab.FaqContent\">\n <div class=\"col-12\">\n <div [innerHTML]=\"tab.FaqContent \"></div>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"tab.faqs.length>0\">\n <div class=\"col-12\">\n <rlb-accordion>\n <div rlb-accordion-item [expanded]=\"true\" *ngFor=\"let faq of tab.faqs\">\n <rlb-accordion-header>\n {{faq.Title}}\n </rlb-accordion-header>\n <div rlb-accordion-body>\n <div [innerHTML]=\"faq.Content\"> </div>\n </div>\n </div>\n </rlb-accordion>\n </div>\n </div>\n <div class=\"row my-4\">\n <div class=\"col-12\">\n <span>\n <a routerLink=\"/support\">\n <i class=\"bi bi-info-circle-fill\" style=\"margin-bottom: -6px;margin-right: 6px;\"></i>\n <span>{{'pages.support.infoPage' | translate}}</span>\n </a>\n </span>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"page.topics.length>0\" style=\"padding: 4px\">\n <div class=\"col-lg-6 col-md-12 col-sm-12 col-xs-12\" *ngFor=\"let topic of page.topics\">\n <a [routerLink]=\"'/informations/'+topic.page.ContentId\" style=\"color: inherit;text-decoration: none;\">\n <div class=\"card mb-4\" style=\"min-height: 230px;\">\n <img [src]=\"topic.Picture.url | cms\" class=\"card-img-top\"\n style=\"height: 91px; margin: 16px -16px;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">{{topic.Title}}</h5>\n <div class=\"card-text\" [innerHTML]=\"topic.Content \"></div>\n </div>\n </div>\n </a>\n </div>\n </div>\n </div>\n </rlb-tab-pane>\n </rlb-tab-content>\n </div>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.BreadcrumbComponent, selector: "rlb-breadcrumb", inputs: ["divider", "items", "cssClasses"] }, { kind: "component", type: i6.AccordionComponent, selector: "rlb-accordion", inputs: ["flush", "always-open", "id"] }, { kind: "component", type: i6.AccordionItemComponent, selector: "div[rlb-accordion-item]", inputs: ["name", "expanded", "class", "style", "status"], outputs: ["statusChange"] }, { kind: "component", type: i6.AccordionHeaderComponent, selector: "rlb-accordion-header" }, { kind: "component", type: i6.AccordionBodyComponent, selector: "div[rlb-accordion-body]" }, { kind: "component", type: i6.TabsComponent, selector: "rlb-tabs", inputs: ["horizontal-alignment", "view", "vertical", "fill", "id", "class"] }, { kind: "component", type: i6.TabComponent, selector: "rlb-tab", inputs: ["active", "disabled", "target", "class"] }, { kind: "component", type: i6.TabContentComponent, selector: "rlb-tab-content" }, { kind: "component", type: i6.TabPaneComponent, selector: "rlb-tab-pane", inputs: ["id", "active", "fade"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: CmsPipe, name: "cms" }] }); }
|
|
1539
|
+
}
|
|
1540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CmsComponent, decorators: [{
|
|
1541
|
+
type: Component,
|
|
1542
|
+
args: [{ selector: 'rlb-cms-template', standalone: false, template: "<div>\n <div class=\"container\" *ngIf=\"page\">\n <div class=\"row my-4\" *ngIf=\"breadcrumb\">\n <div class=\"col-12\">\n <rlb-breadcrumb [items]=\"breadcrumb\"></rlb-breadcrumb>\n </div>\n </div>\n <div class=\"row my-4\">\n <div class=\"col-12\">\n <h1 class=\"text-center\">{{page.Title}}</h1>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"page.Content\">\n <div class=\"col-12\">\n <div [innerHTML]=\"page.Content \"></div>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"page.page_tabs.length>0\">\n <div class=\"col-12\">\n <rlb-tabs>\n <rlb-tab *ngFor=\"let tab of page.page_tabs; let i = index\" [target]=\"'cms-tab-'+i\">\n {{tab.Title}}\n </rlb-tab>\n </rlb-tabs>\n <rlb-tab-content>\n <rlb-tab-pane *ngFor=\"let tab of page.page_tabs; let i = index\" [id]=\"'cms-tab-'+i\">\n <div class=\"container-fluid\">\n <div class=\"row my-4\" *ngIf=\"tab.Content\">\n <div class=\"col-12\">\n <div [innerHTML]=\"tab.Content \"></div>\n </div>\n </div>\n <div class=\"row my-4 mx-auto card-steps\" *ngFor=\"let step of tab.steps; let i = index\"\n style=\"max-width: 350px; border-bottom: 1px solid rgb(192, 198, 204);\">\n <div class=\"col-8\">\n <div class=\"pb-2\">\n <div style=\"height: 54px; min-width: 54px; width: 54px; border: 5px solid rgb(192, 198, 204);\"\n class=\"round-counter\">\n <span class=\"red\">{{i+1}}</span>\n </div>\n </div>\n <div>\n <div [innerHTML]=\"step.Content \"></div>\n </div>\n </div>\n <div class=\"col-4 pb-2\">\n <img [src]=\"step.Picture.url|cms\">\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"tab.faqs.length>0\">\n <div class=\"col-12\">\n <h2 class=\"py-3\">{{tab.FaqTitle}}</h2>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"tab.faqs.length>0 && tab.FaqContent\">\n <div class=\"col-12\">\n <div [innerHTML]=\"tab.FaqContent \"></div>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"tab.faqs.length>0\">\n <div class=\"col-12\">\n <rlb-accordion>\n <div rlb-accordion-item [expanded]=\"true\" *ngFor=\"let faq of tab.faqs\">\n <rlb-accordion-header>\n {{faq.Title}}\n </rlb-accordion-header>\n <div rlb-accordion-body>\n <div [innerHTML]=\"faq.Content\"> </div>\n </div>\n </div>\n </rlb-accordion>\n </div>\n </div>\n <div class=\"row my-4\">\n <div class=\"col-12\">\n <span>\n <a routerLink=\"/support\">\n <i class=\"bi bi-info-circle-fill\" style=\"margin-bottom: -6px;margin-right: 6px;\"></i>\n <span>{{'pages.support.infoPage' | translate}}</span>\n </a>\n </span>\n </div>\n </div>\n <div class=\"row my-4\" *ngIf=\"page.topics.length>0\" style=\"padding: 4px\">\n <div class=\"col-lg-6 col-md-12 col-sm-12 col-xs-12\" *ngFor=\"let topic of page.topics\">\n <a [routerLink]=\"'/informations/'+topic.page.ContentId\" style=\"color: inherit;text-decoration: none;\">\n <div class=\"card mb-4\" style=\"min-height: 230px;\">\n <img [src]=\"topic.Picture.url | cms\" class=\"card-img-top\"\n style=\"height: 91px; margin: 16px -16px;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">{{topic.Title}}</h5>\n <div class=\"card-text\" [innerHTML]=\"topic.Content \"></div>\n </div>\n </div>\n </a>\n </div>\n </div>\n </div>\n </rlb-tab-pane>\n </rlb-tab-content>\n </div>\n </div>\n </div>\n</div>\n" }]
|
|
1543
|
+
}], ctorParameters: () => [{ type: StrapiService }, { type: LanguageService }, { type: undefined, decorators: [{
|
|
1544
|
+
type: Inject,
|
|
1545
|
+
args: [RLB_CFG_CMS]
|
|
1546
|
+
}, {
|
|
1547
|
+
type: Optional
|
|
1548
|
+
}] }, { type: AbstractMdService, decorators: [{
|
|
1549
|
+
type: Optional
|
|
1550
|
+
}] }], propDecorators: { contentId: [{
|
|
1551
|
+
type: Input
|
|
1552
|
+
}], breadcrumb: [{
|
|
1553
|
+
type: Input
|
|
1554
|
+
}] } });
|
|
1555
|
+
|
|
1556
|
+
class CmsContentComponent {
|
|
1557
|
+
constructor(route) {
|
|
1558
|
+
this.route = route;
|
|
1559
|
+
}
|
|
1560
|
+
get contentId() {
|
|
1561
|
+
return this.route.snapshot.params['id'];
|
|
1562
|
+
}
|
|
1563
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CmsContentComponent, deps: [{ token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1564
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: CmsContentComponent, isStandalone: false, selector: "rlb-cms-content", ngImport: i0, template: "<rlb-cms-template [contentId]=\"contentId\"></rlb-cms-template>", styles: [""], dependencies: [{ kind: "component", type: CmsComponent, selector: "rlb-cms-template", inputs: ["contentId", "breadcrumb"] }] }); }
|
|
1565
|
+
}
|
|
1566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CmsContentComponent, decorators: [{
|
|
1567
|
+
type: Component,
|
|
1568
|
+
args: [{ selector: 'rlb-cms-content', standalone: false, template: "<rlb-cms-template [contentId]=\"contentId\"></rlb-cms-template>" }]
|
|
1569
|
+
}], ctorParameters: () => [{ type: i2.ActivatedRoute }] });
|
|
1570
|
+
|
|
1571
|
+
class CookiesComponent {
|
|
1572
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CookiesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1573
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: CookiesComponent, isStandalone: false, selector: "rlb-cookies", ngImport: i0, template: "<rlb-cms-template contentId=\"adb_cookies\"></rlb-cms-template>", styles: [""], dependencies: [{ kind: "component", type: CmsComponent, selector: "rlb-cms-template", inputs: ["contentId", "breadcrumb"] }] }); }
|
|
1574
|
+
}
|
|
1575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CookiesComponent, decorators: [{
|
|
1576
|
+
type: Component,
|
|
1577
|
+
args: [{ selector: 'rlb-cookies', standalone: false, template: "<rlb-cms-template contentId=\"adb_cookies\"></rlb-cms-template>" }]
|
|
1578
|
+
}] });
|
|
1579
|
+
|
|
1580
|
+
class NotFoundComponent {
|
|
1581
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1582
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: NotFoundComponent, isStandalone: false, selector: "rlb-not-found", ngImport: i0, template: "<div class=\"container\" style=\"height:calc(100vh - 58px);\">\n <div class=\"align-center\">\n <div class=\"text-center\">\n <h1 class=\"text-primary\">\n {{ 'pages.notFound.title' | translate }}\n </h1>\n <p>{{ 'pages.notFound.content' | translate }}</p><a href=\"/\" class=\"btn btn-outline-primary\">\n <span>\n {{ 'pages.notFound.button' | translate }}\n </span></a>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] }); }
|
|
1583
|
+
}
|
|
1584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: NotFoundComponent, decorators: [{
|
|
1585
|
+
type: Component,
|
|
1586
|
+
args: [{ selector: 'rlb-not-found', standalone: false, template: "<div class=\"container\" style=\"height:calc(100vh - 58px);\">\n <div class=\"align-center\">\n <div class=\"text-center\">\n <h1 class=\"text-primary\">\n {{ 'pages.notFound.title' | translate }}\n </h1>\n <p>{{ 'pages.notFound.content' | translate }}</p><a href=\"/\" class=\"btn btn-outline-primary\">\n <span>\n {{ 'pages.notFound.button' | translate }}\n </span></a>\n </div>\n </div>\n</div>\n" }]
|
|
1587
|
+
}] });
|
|
1588
|
+
|
|
1589
|
+
class PrivacyComponent {
|
|
1590
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PrivacyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1591
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: PrivacyComponent, isStandalone: false, selector: "rlb-privacy", ngImport: i0, template: "<rlb-cms-template contentId=\"adb_privacy\"></rlb-cms-template>", styles: [""], dependencies: [{ kind: "component", type: CmsComponent, selector: "rlb-cms-template", inputs: ["contentId", "breadcrumb"] }] }); }
|
|
1592
|
+
}
|
|
1593
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PrivacyComponent, decorators: [{
|
|
1594
|
+
type: Component,
|
|
1595
|
+
args: [{ selector: 'rlb-privacy', standalone: false, template: "<rlb-cms-template contentId=\"adb_privacy\"></rlb-cms-template>" }]
|
|
1596
|
+
}] });
|
|
1597
|
+
|
|
1598
|
+
class SupportComponent {
|
|
1599
|
+
constructor(supportService, _location) {
|
|
1600
|
+
this.supportService = supportService;
|
|
1601
|
+
this._location = _location;
|
|
1602
|
+
this.supportForm = new FormGroup({
|
|
1603
|
+
name: new FormControl('', [Validators.required]),
|
|
1604
|
+
email: new FormControl('', [Validators.required, Validators.email]),
|
|
1605
|
+
subject: new FormControl('', [Validators.required]),
|
|
1606
|
+
message: new FormControl('', [Validators.required]),
|
|
1607
|
+
legal: new FormControl('', [Validators.required]),
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
hasError(form, controlName, errorName) {
|
|
1611
|
+
switch (form) {
|
|
1612
|
+
case 'supportForm':
|
|
1613
|
+
return this.supportForm.controls[controlName].hasError(errorName);
|
|
1614
|
+
default: return false;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
sendSupport(data) {
|
|
1618
|
+
if (this.supportForm.valid) {
|
|
1619
|
+
this.supportService.sendSupport(data);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
backClicked() {
|
|
1623
|
+
this._location.back();
|
|
1624
|
+
}
|
|
1625
|
+
ngOnInit() { }
|
|
1626
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SupportComponent, deps: [{ token: AbstractSupportService }, { token: i1$6.Location }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1627
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: SupportComponent, isStandalone: false, selector: "rlb-support", ngImport: i0, template: "<div class=\"container mt-2 mb-5\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'pages.support.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n style=\"font-size: 25px;font-weight: 600;\" (click)=\"backClicked()\"></i>\n </div>\n <form [formGroup]=\"supportForm\" class=\"needs-validation\" (ngSubmit)=\"sendSupport(supportForm.value)\">\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.name' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"name\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.email' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"email\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.subject' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"subject\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.message' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"message\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.legal' | translate}}</h6>\n <span>{{ 'pages.support.infoPage' | translate}}</span>\n </div>\n <div class=\"settings-control\">\n <rlb-switch size=\"small\" formControlName=\"legal\" />\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n </form>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6.InputComponent, selector: "rlb-input", inputs: ["disabled", "readonly", "before-text", "placeholder", "type", "size", "name", "max", "min", "step", "date-type", "timezone", "id", "extValidation", "enable-validation"] }, { kind: "component", type: i6.SwitchComponent, selector: "rlb-switch", inputs: ["disabled", "readonly", "size", "id"] }, { kind: "component", type: i6.ListComponent, selector: "rlb-list", inputs: ["disabled", "numbered", "flush", "horizontal"] }, { kind: "component", type: i6.ListItemComponent, selector: "rlb-list-item", inputs: ["active", "disabled", "action"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] }); }
|
|
1628
|
+
}
|
|
1629
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SupportComponent, decorators: [{
|
|
1630
|
+
type: Component,
|
|
1631
|
+
args: [{ selector: 'rlb-support', standalone: false, template: "<div class=\"container mt-2 mb-5\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'pages.support.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n style=\"font-size: 25px;font-weight: 600;\" (click)=\"backClicked()\"></i>\n </div>\n <form [formGroup]=\"supportForm\" class=\"needs-validation\" (ngSubmit)=\"sendSupport(supportForm.value)\">\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.name' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"name\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.email' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"email\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.subject' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"subject\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.message' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input type=\"text\" size=\"small\" formControlName=\"message\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'pages.support.legal' | translate}}</h6>\n <span>{{ 'pages.support.infoPage' | translate}}</span>\n </div>\n <div class=\"settings-control\">\n <rlb-switch size=\"small\" formControlName=\"legal\" />\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n </form>\n</div>\n" }]
|
|
1632
|
+
}], ctorParameters: () => [{ type: AbstractSupportService }, { type: i1$6.Location }] });
|
|
1633
|
+
|
|
1634
|
+
class TermsAndConditionsComponent {
|
|
1635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TermsAndConditionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1636
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: TermsAndConditionsComponent, isStandalone: false, selector: "rlb-terms-and-conditions", ngImport: i0, template: "<rlb-cms-template contentId=\"adb_terms\"></rlb-cms-template>", styles: [""], dependencies: [{ kind: "component", type: CmsComponent, selector: "rlb-cms-template", inputs: ["contentId", "breadcrumb"] }] }); }
|
|
1637
|
+
}
|
|
1638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TermsAndConditionsComponent, decorators: [{
|
|
1639
|
+
type: Component,
|
|
1640
|
+
args: [{ selector: 'rlb-terms-and-conditions', standalone: false, template: "<rlb-cms-template contentId=\"adb_terms\"></rlb-cms-template>" }]
|
|
1641
|
+
}] });
|
|
1642
|
+
|
|
1643
|
+
class AsMultiPipe {
|
|
1644
|
+
transform(value) {
|
|
1645
|
+
if (!Array.isArray(value)) {
|
|
1646
|
+
return [value];
|
|
1647
|
+
}
|
|
1648
|
+
return value;
|
|
1649
|
+
}
|
|
1650
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AsMultiPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1651
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AsMultiPipe, isStandalone: false, name: "asMulti" }); }
|
|
1652
|
+
}
|
|
1653
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AsMultiPipe, decorators: [{
|
|
1654
|
+
type: Pipe,
|
|
1655
|
+
args: [{
|
|
1656
|
+
name: 'asMulti',
|
|
1657
|
+
standalone: false
|
|
1658
|
+
}]
|
|
1659
|
+
}] });
|
|
1660
|
+
class AsSinglePipe {
|
|
1661
|
+
transform(value) {
|
|
1662
|
+
if (Array.isArray(value)) {
|
|
1663
|
+
return value[0];
|
|
1664
|
+
}
|
|
1665
|
+
return value;
|
|
1666
|
+
}
|
|
1667
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AsSinglePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1668
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AsSinglePipe, isStandalone: false, name: "asSingle" }); }
|
|
1669
|
+
}
|
|
1670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AsSinglePipe, decorators: [{
|
|
1671
|
+
type: Pipe,
|
|
1672
|
+
args: [{
|
|
1673
|
+
name: 'asSingle',
|
|
1674
|
+
standalone: false
|
|
1675
|
+
}]
|
|
1676
|
+
}] });
|
|
1677
|
+
|
|
1678
|
+
class LeftComponentPipe {
|
|
1679
|
+
constructor(config) {
|
|
1680
|
+
this.config = config;
|
|
1681
|
+
}
|
|
1682
|
+
transform(value) {
|
|
1683
|
+
const t = this.config.left.find(c => c.name === value)?.component;
|
|
1684
|
+
if (!t) {
|
|
1685
|
+
throw new Error(`No component found for name ${value}`);
|
|
1686
|
+
}
|
|
1687
|
+
return t;
|
|
1688
|
+
}
|
|
1689
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LeftComponentPipe, deps: [{ token: RLB_APP_NAVCOMP }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1690
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: LeftComponentPipe, isStandalone: false, name: "leftComponent" }); }
|
|
1691
|
+
}
|
|
1692
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: LeftComponentPipe, decorators: [{
|
|
1693
|
+
type: Pipe,
|
|
1694
|
+
args: [{
|
|
1695
|
+
name: 'leftComponent',
|
|
1696
|
+
standalone: false
|
|
1697
|
+
}]
|
|
1698
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1699
|
+
type: Inject,
|
|
1700
|
+
args: [RLB_APP_NAVCOMP]
|
|
1701
|
+
}] }] });
|
|
1702
|
+
|
|
1703
|
+
class RightComponentPipe {
|
|
1704
|
+
constructor(config) {
|
|
1705
|
+
this.config = config;
|
|
1706
|
+
}
|
|
1707
|
+
transform(value) {
|
|
1708
|
+
const t = this.config.right.find(c => c.name === value)?.component;
|
|
1709
|
+
if (!t) {
|
|
1710
|
+
throw new Error(`No component found for name ${value}`);
|
|
1711
|
+
}
|
|
1712
|
+
return t;
|
|
1713
|
+
}
|
|
1714
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RightComponentPipe, deps: [{ token: RLB_APP_NAVCOMP }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1715
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: RightComponentPipe, isStandalone: false, name: "rightComponent" }); }
|
|
1716
|
+
}
|
|
1717
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RightComponentPipe, decorators: [{
|
|
1718
|
+
type: Pipe,
|
|
1719
|
+
args: [{
|
|
1720
|
+
name: 'rightComponent',
|
|
1721
|
+
standalone: false
|
|
1722
|
+
}]
|
|
1723
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1724
|
+
type: Inject,
|
|
1725
|
+
args: [RLB_APP_NAVCOMP]
|
|
1726
|
+
}] }] });
|
|
1727
|
+
|
|
1728
|
+
class AppTemplateComponent {
|
|
1729
|
+
constructor(env, store, appsService, authService) {
|
|
1730
|
+
this.env = env;
|
|
1731
|
+
this.store = store;
|
|
1732
|
+
this.appsService = appsService;
|
|
1733
|
+
this.authService = authService;
|
|
1734
|
+
this.navSearchText = null;
|
|
1735
|
+
this.navbarItems = [];
|
|
1736
|
+
this.sidebarItems = [];
|
|
1737
|
+
this.sidebarFooterItems = [];
|
|
1738
|
+
}
|
|
1739
|
+
ngOnDestroy() {
|
|
1740
|
+
this.navbarItemsSubscription?.unsubscribe();
|
|
1741
|
+
this.sidebarItemsSubscription?.unsubscribe();
|
|
1742
|
+
this.sidebarFooterItemsSubscription?.unsubscribe();
|
|
1743
|
+
}
|
|
1744
|
+
get sidebarVisible$() {
|
|
1745
|
+
return this.store.select(state => state[sidebarsFeatureKey].visible);
|
|
1746
|
+
}
|
|
1747
|
+
get sidearHasLogin$() {
|
|
1748
|
+
return this.store.select(state => state[sidebarsFeatureKey].loginVisible);
|
|
1749
|
+
}
|
|
1750
|
+
get sidearHasSearch$() {
|
|
1751
|
+
return this.store.select(state => state[sidebarsFeatureKey].searchVisible);
|
|
1752
|
+
}
|
|
1753
|
+
get sidebarItems$() {
|
|
1754
|
+
return this.store.select(state => state[sidebarsFeatureKey].items);
|
|
1755
|
+
}
|
|
1756
|
+
setSidearSearchText(text) {
|
|
1757
|
+
this.store.dispatch(SidebarActions.setSearchText({ text }));
|
|
1758
|
+
}
|
|
1759
|
+
setNavbarSearchText(text) {
|
|
1760
|
+
this.store.dispatch(NavbarActions.setSearchText({ text }));
|
|
1761
|
+
}
|
|
1762
|
+
get sidearHasSettings$() {
|
|
1763
|
+
return this.store.select(state => state[sidebarsFeatureKey].settingsVisible);
|
|
1764
|
+
}
|
|
1765
|
+
get sidearAppsVisible$() {
|
|
1766
|
+
return this.store.select(state => state[sidebarsFeatureKey].appsVisible);
|
|
1767
|
+
}
|
|
1768
|
+
get navVisible$() {
|
|
1769
|
+
return this.store.select(state => state[navbarsFeatureKey].visible);
|
|
1770
|
+
}
|
|
1771
|
+
get navSearchVisible$() {
|
|
1772
|
+
return this.store.select(state => state[navbarsFeatureKey].searchVisible);
|
|
1773
|
+
}
|
|
1774
|
+
get navHeader$() {
|
|
1775
|
+
return this.store.select(state => state[navbarsFeatureKey].header);
|
|
1776
|
+
}
|
|
1777
|
+
get isAuth$() {
|
|
1778
|
+
return this.authService.isAuthenticated$;
|
|
1779
|
+
}
|
|
1780
|
+
get user$() {
|
|
1781
|
+
return this.authService.userInfo$;
|
|
1782
|
+
}
|
|
1783
|
+
get navLeftItems$() {
|
|
1784
|
+
return this.store.select(state => state[navbarsFeatureKey].leftItems);
|
|
1785
|
+
}
|
|
1786
|
+
get navRightItems$() {
|
|
1787
|
+
return this.store.select(state => state[navbarsFeatureKey].rightItems);
|
|
1788
|
+
}
|
|
1789
|
+
get theme() {
|
|
1790
|
+
return this.store.selectSignal(state => state[appContextFeatureKey].theme)();
|
|
1791
|
+
}
|
|
1792
|
+
get navbarHasLogin$() {
|
|
1793
|
+
return this.store.select(state => state[navbarsFeatureKey].loginVisible);
|
|
1794
|
+
}
|
|
1795
|
+
get navbarHasSettings$() {
|
|
1796
|
+
return this.store.select(state => state[navbarsFeatureKey].loginVisible);
|
|
1797
|
+
}
|
|
1798
|
+
get navbarHasApps$() {
|
|
1799
|
+
return this.store.select(state => state[navbarsFeatureKey].loginVisible);
|
|
1800
|
+
}
|
|
1801
|
+
get apps() {
|
|
1802
|
+
return this.appsService.apps;
|
|
1803
|
+
}
|
|
1804
|
+
get separatorVisible$() {
|
|
1805
|
+
return this.store.select(state => state[navbarsFeatureKey].separatorVisible);
|
|
1806
|
+
}
|
|
1807
|
+
loginNav(event) {
|
|
1808
|
+
event?.preventDefault();
|
|
1809
|
+
event?.stopPropagation();
|
|
1810
|
+
this.store.dispatch(AuthActions.login());
|
|
1811
|
+
}
|
|
1812
|
+
login() {
|
|
1813
|
+
this.store.dispatch(AuthActions.login());
|
|
1814
|
+
}
|
|
1815
|
+
onSideBarItemClick(item) {
|
|
1816
|
+
if (item.externalUrl) {
|
|
1817
|
+
window.open(item.externalUrl, '_blank')?.focus();
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppTemplateComponent, deps: [{ token: RLB_CFG_ENV }, { token: i1$1.Store }, { token: AppsService }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1821
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: AppTemplateComponent, isStandalone: false, selector: "rlb-app-template", inputs: { modalContainerId: ["modal-container-id", "modalContainerId"], toastContainerIds: ["toast-container-ids", "toastContainerIds"] }, ngImport: i0, template: "<div class=\"rlb-app\">\n <rlb-sidebar id=\"sidebar\" class=\"rlb-sidebar\" *ngIf=\"(sidebarVisible$ | async)\">\n <rlb-sidebar-item\n\t\t\t*ngFor=\"let item of (sidebarItems$ | async)\"\n\t\t\t[icon]=\"item.icon\" [link]=\"item.url\"\n [title]=\"item.title\" [label]=\"item.label\"\n\t\t\t[badgeCounter]=\"item.badgeCounter\"\n (click)=\"onSideBarItemClick(item)\"\n >\n\t\t\t{{item.label}}\n <rlb-sidebar-item\n\t\t\t\t*ngFor=\"let subitem of item.items || []\"\n\t\t\t\t[icon]=\"subitem.icon\"\n\t\t\t\t[link]=\"subitem.url\"\n [title]=\"subitem.title\"\n\t\t\t\t[label]=\"subitem.label\"\n\t\t\t\t[badgeCounter]=\"subitem.badgeCounter\"\n (click)=\"onSideBarItemClick(subitem)\"\n\t\t\t>\n\t\t\t\t{{subitem.label}}\n </rlb-sidebar-item>\n </rlb-sidebar-item>\n </rlb-sidebar>\n <ng-container *ngIf=\"navVisible$ | async\">\n <rlb-navbar expand=\"lg\" *ngIf=\"navVisible$ | async\" class=\"border-bottom py-1 rlb-navbar\">\n <a *ngIf=\"navHeader$ | async\" rlb-navbar-brand href=\"#\">{{ navHeader$ | async }}</a>\n <rlb-navbar-form *ngIf=\"navSearchVisible$ | async\">\n <rlb-input-group class=\"my-1 mx-3\" validate>\n <rlb-input type=\"search\" class=\"search-input\" placeholder=\"Search\" [(ngModel)]=\"navSearchText\"\n (keyup.enter)=\"setNavbarSearchText(navSearchText)\" name=\"search\" size=\"small\">\n <button after rlb-button outline type=\"submit\" (click)=\"setNavbarSearchText(navSearchText)\" size=\"sm\">\n <i class=\"bi bi-search\"></i>\n </button>\n </rlb-input>\n </rlb-input-group>\n </rlb-navbar-form>\n <rlb-navbar-items class=\"ms-lg-auto\">\n <ng-container ngProjectAs=\"rlb-navbar-item\" *ngFor=\"let navComponent of navLeftItems$ | async\">\n <ng-container *ngComponentOutlet=\"navComponent | leftComponent\"></ng-container>\n </ng-container>\n </rlb-navbar-items>\n <rlb-navbar-items>\n <ng-container ngProjectAs=\"rlb-navbar-item\" *ngFor=\"let navComponent of navRightItems$ | async\">\n <ng-container *ngComponentOutlet=\"navComponent | rightComponent\"></ng-container>\n </ng-container>\n <rlb-navbar-separator *ngIf=\"(separatorVisible$ | async)\" />\n <rlb-navbar-item *ngIf=\"(navbarHasLogin$ | async) && !(isAuth$ | async)\" (click)=\"loginNav($event)\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.account.login') |translate\">\n <i class=\" bi bi-box-arrow-in-left\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.account.login' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n <rlb-navbar-item *ngIf=\" (navbarHasLogin$ | async) && (isAuth$ | async)\" [router-link]=\"'/profile'\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.account.title') |translate\">\n <i class=\"bi bi-person\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.account.title' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n <rlb-navbar-item *ngIf=\"navbarHasSettings$ | async\" [router-link]=\"'/setting'\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.settings.title') |translate\">\n <i class=\"bi bi-gear\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.settings.title' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n <rlb-navbar-item *ngIf=\"(navbarHasApps$ | async) && apps.length > 1\" [router-link]=\"'/apps'\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.apps.button') |translate\">\n <i class=\"bi bi-grid-3x3-gap-fill\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.apps.button' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n </rlb-navbar-items>\n </rlb-navbar>\n </ng-container>\n <div class=\"rlb-content\" [class.rlb-sidebar-en]=\"(sidebarVisible$ | async)\">\n <ng-content></ng-content>\n </div>\n</div>\n\n<ng-container *ngIf=\"modalContainerId\">\n <rlb-modal-container [id]=\"modalContainerId\" />\n</ng-container>\n\n<ng-container *ngIf=\"toastContainerIds\">\n <ng-container *ngIf=\"toastContainerIds.constructor.name === 'Array'; else toastContainerIdsIsNotArray\">\n <rlb-toast-container *ngFor=\"let toastContainerId of toastContainerIds | asMulti\" [id]=\"toastContainerId\" />\n </ng-container>\n <ng-template #toastContainerIdsIsNotArray>\n <rlb-toast-container class=\"position-fixed bottom-0 end-0 p-3\" [id]=\"toastContainerIds | asSingle\" />\n </ng-template>\n</ng-container>\n", styles: [".separator{border-left:1px solid;padding:0 2px}\n"], dependencies: [{ kind: "directive", type: i1$6.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.InputComponent, selector: "rlb-input", inputs: ["disabled", "readonly", "before-text", "placeholder", "type", "size", "name", "max", "min", "step", "date-type", "timezone", "id", "extValidation", "enable-validation"] }, { kind: "component", type: i6.InputGroupComponent, selector: "rlb-input-group", inputs: ["text", "validate", "size"] }, { kind: "component", type: i6.ButtonComponent, selector: "button[rlb-button], a[rlb-button]", inputs: ["color", "size", "disabled", "outline", "isLink"] }, { kind: "directive", type: i6.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "tooltip-placement", "tooltip-class", "tooltip-html"] }, { kind: "directive", type: i6.NavbarBrandDirective, selector: "[rlb-navbar-brand]" }, { kind: "component", type: i6.NavbarComponent, selector: "rlb-navbar", inputs: ["dark", "color", "placement", "expand", "class", "enable-dropdown-toggler"] }, { kind: "component", type: i6.NavbarFormComponent, selector: "rlb-navbar-form", inputs: ["role", "class"] }, { kind: "component", type: i6.NavbarItemsComponent, selector: "rlb-navbar-items", inputs: ["scroll", "class"] }, { kind: "component", type: i6.NavbarItemComponent, selector: "rlb-navbar-item", inputs: ["disabled", "router-link", "class"], outputs: ["click"] }, { kind: "component", type: i6.NavbarSeparatorComponent, selector: "rlb-navbar-separator", inputs: ["class"] }, { kind: "component", type: i6.SidebarComponent, selector: "rlb-sidebar", inputs: ["rounded"] }, { kind: "component", type: i6.SidebarItemComponent, selector: "rlb-sidebar-item", inputs: ["title", "icon", "label", "link", "badgeCounter"], outputs: ["click"] }, { kind: "component", type: i6.ModalContainerComponent, selector: "rlb-modal-container", inputs: ["id"] }, { kind: "component", type: i6.ToastContainerComponent, selector: "rlb-toast-container", inputs: ["id"] }, { kind: "pipe", type: i1$6.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: AsMultiPipe, name: "asMulti" }, { kind: "pipe", type: AsSinglePipe, name: "asSingle" }, { kind: "pipe", type: LeftComponentPipe, name: "leftComponent" }, { kind: "pipe", type: RightComponentPipe, name: "rightComponent" }] }); }
|
|
1822
|
+
}
|
|
1823
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppTemplateComponent, decorators: [{
|
|
1824
|
+
type: Component,
|
|
1825
|
+
args: [{ selector: 'rlb-app-template', standalone: false, template: "<div class=\"rlb-app\">\n <rlb-sidebar id=\"sidebar\" class=\"rlb-sidebar\" *ngIf=\"(sidebarVisible$ | async)\">\n <rlb-sidebar-item\n\t\t\t*ngFor=\"let item of (sidebarItems$ | async)\"\n\t\t\t[icon]=\"item.icon\" [link]=\"item.url\"\n [title]=\"item.title\" [label]=\"item.label\"\n\t\t\t[badgeCounter]=\"item.badgeCounter\"\n (click)=\"onSideBarItemClick(item)\"\n >\n\t\t\t{{item.label}}\n <rlb-sidebar-item\n\t\t\t\t*ngFor=\"let subitem of item.items || []\"\n\t\t\t\t[icon]=\"subitem.icon\"\n\t\t\t\t[link]=\"subitem.url\"\n [title]=\"subitem.title\"\n\t\t\t\t[label]=\"subitem.label\"\n\t\t\t\t[badgeCounter]=\"subitem.badgeCounter\"\n (click)=\"onSideBarItemClick(subitem)\"\n\t\t\t>\n\t\t\t\t{{subitem.label}}\n </rlb-sidebar-item>\n </rlb-sidebar-item>\n </rlb-sidebar>\n <ng-container *ngIf=\"navVisible$ | async\">\n <rlb-navbar expand=\"lg\" *ngIf=\"navVisible$ | async\" class=\"border-bottom py-1 rlb-navbar\">\n <a *ngIf=\"navHeader$ | async\" rlb-navbar-brand href=\"#\">{{ navHeader$ | async }}</a>\n <rlb-navbar-form *ngIf=\"navSearchVisible$ | async\">\n <rlb-input-group class=\"my-1 mx-3\" validate>\n <rlb-input type=\"search\" class=\"search-input\" placeholder=\"Search\" [(ngModel)]=\"navSearchText\"\n (keyup.enter)=\"setNavbarSearchText(navSearchText)\" name=\"search\" size=\"small\">\n <button after rlb-button outline type=\"submit\" (click)=\"setNavbarSearchText(navSearchText)\" size=\"sm\">\n <i class=\"bi bi-search\"></i>\n </button>\n </rlb-input>\n </rlb-input-group>\n </rlb-navbar-form>\n <rlb-navbar-items class=\"ms-lg-auto\">\n <ng-container ngProjectAs=\"rlb-navbar-item\" *ngFor=\"let navComponent of navLeftItems$ | async\">\n <ng-container *ngComponentOutlet=\"navComponent | leftComponent\"></ng-container>\n </ng-container>\n </rlb-navbar-items>\n <rlb-navbar-items>\n <ng-container ngProjectAs=\"rlb-navbar-item\" *ngFor=\"let navComponent of navRightItems$ | async\">\n <ng-container *ngComponentOutlet=\"navComponent | rightComponent\"></ng-container>\n </ng-container>\n <rlb-navbar-separator *ngIf=\"(separatorVisible$ | async)\" />\n <rlb-navbar-item *ngIf=\"(navbarHasLogin$ | async) && !(isAuth$ | async)\" (click)=\"loginNav($event)\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.account.login') |translate\">\n <i class=\" bi bi-box-arrow-in-left\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.account.login' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n <rlb-navbar-item *ngIf=\" (navbarHasLogin$ | async) && (isAuth$ | async)\" [router-link]=\"'/profile'\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.account.title') |translate\">\n <i class=\"bi bi-person\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.account.title' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n <rlb-navbar-item *ngIf=\"navbarHasSettings$ | async\" [router-link]=\"'/setting'\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.settings.title') |translate\">\n <i class=\"bi bi-gear\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.settings.title' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n <rlb-navbar-item *ngIf=\"(navbarHasApps$ | async) && apps.length > 1\" [router-link]=\"'/apps'\">\n <span tooltip-placement=\"bottom\" [tooltip]=\"('core.apps.button') |translate\">\n <i class=\"bi bi-grid-3x3-gap-fill\"></i>\n </span>\n\t\t\t\t\t<span class=\"ms-1 d-lg-none\">{{'core.apps.button' | translate}}</span>\n\t\t\t\t</rlb-navbar-item>\n </rlb-navbar-items>\n </rlb-navbar>\n </ng-container>\n <div class=\"rlb-content\" [class.rlb-sidebar-en]=\"(sidebarVisible$ | async)\">\n <ng-content></ng-content>\n </div>\n</div>\n\n<ng-container *ngIf=\"modalContainerId\">\n <rlb-modal-container [id]=\"modalContainerId\" />\n</ng-container>\n\n<ng-container *ngIf=\"toastContainerIds\">\n <ng-container *ngIf=\"toastContainerIds.constructor.name === 'Array'; else toastContainerIdsIsNotArray\">\n <rlb-toast-container *ngFor=\"let toastContainerId of toastContainerIds | asMulti\" [id]=\"toastContainerId\" />\n </ng-container>\n <ng-template #toastContainerIdsIsNotArray>\n <rlb-toast-container class=\"position-fixed bottom-0 end-0 p-3\" [id]=\"toastContainerIds | asSingle\" />\n </ng-template>\n</ng-container>\n", styles: [".separator{border-left:1px solid;padding:0 2px}\n"] }]
|
|
1826
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1827
|
+
type: Inject,
|
|
1828
|
+
args: [RLB_CFG_ENV]
|
|
1829
|
+
}] }, { type: i1$1.Store }, { type: AppsService }, { type: AuthenticationService }], propDecorators: { modalContainerId: [{
|
|
1830
|
+
type: Input,
|
|
1831
|
+
args: ['modal-container-id']
|
|
1832
|
+
}], toastContainerIds: [{
|
|
1833
|
+
type: Input,
|
|
1834
|
+
args: ['toast-container-ids']
|
|
1835
|
+
}] } });
|
|
1836
|
+
|
|
1837
|
+
class BaseComponent {
|
|
1838
|
+
constructor(breakpointObserver, platformId) {
|
|
1839
|
+
this.breakpointObserver = breakpointObserver;
|
|
1840
|
+
this.platformId = platformId;
|
|
1841
|
+
}
|
|
1842
|
+
get isHandset$() {
|
|
1843
|
+
if (isPlatformServer(this.platformId)) {
|
|
1844
|
+
return of(true);
|
|
1845
|
+
}
|
|
1846
|
+
else {
|
|
1847
|
+
return this.breakpointObserver.observe(Breakpoints.Handset)
|
|
1848
|
+
.pipe(map(result => result.matches), shareReplay());
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
ngOnInit() { }
|
|
1852
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BaseComponent, deps: [{ token: i1$7.BreakpointObserver }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1853
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: BaseComponent, isStandalone: false, selector: "rlb-base-template", inputs: { breadcrumb: "breadcrumb", title: "title", subtitle: "subtitle" }, ngImport: i0, template: "<div class=\" mb-3\">\n <div class=\"container-fluid\" *ngIf=\"!(isHandset$ | async) else mobileMode\">\n <div class=\"row mt-1\">\n <div class=\"col-xl-8 col-lg-10 col-md-12 col-sm-12 col-xs-12 mx-auto\">\n <div class=\"row\">\n <div class=\"col-12 pb-0\">\n <rlb-breadcrumb *ngIf=\"breadcrumb\" [items]=\"breadcrumb\"></rlb-breadcrumb>\n <h1 class=\"pt-5 pb-0 text-center\">\n {{title}}\n </h1>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"subtitle\">\n <div class=\"col-12 pb-12\">\n <span class=\"d-block text-h6 text-center\">\n {{subtitle}}\n </span>\n </div>\n </div>\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"default\"></ng-container>\n </div>\n </div>\n </div>\n <ng-template class=\"container-fluid\" #mobileMode>\n <div class=\"row\">\n <div class=\"col-12 pb-0\">\n <h1 class=\"pt-5 pb-0 text-center\">\n {{title}}\n </h1>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"subtitle\">\n <div class=\"col-12 pb-7\">\n <div class=\"d-block text-h6 text-center\">\n {{subtitle}}\n </div>\n </div>\n </div>\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"mobile\"></ng-container>\n </ng-template>\n </div>\n \n <ng-template #all>\n <ng-content select=\"[all]\"></ng-content>\n </ng-template>\n \n <ng-template #default>\n <ng-content select=\"[default]\"></ng-content>\n </ng-template>\n \n <ng-template #mobile>\n <ng-content select=\"[mobile]\"></ng-content>\n </ng-template>", styles: [""], dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i6.BreadcrumbComponent, selector: "rlb-breadcrumb", inputs: ["divider", "items", "cssClasses"] }, { kind: "pipe", type: i1$6.AsyncPipe, name: "async" }] }); }
|
|
1854
|
+
}
|
|
1855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BaseComponent, decorators: [{
|
|
1856
|
+
type: Component,
|
|
1857
|
+
args: [{ selector: 'rlb-base-template', standalone: false, template: "<div class=\" mb-3\">\n <div class=\"container-fluid\" *ngIf=\"!(isHandset$ | async) else mobileMode\">\n <div class=\"row mt-1\">\n <div class=\"col-xl-8 col-lg-10 col-md-12 col-sm-12 col-xs-12 mx-auto\">\n <div class=\"row\">\n <div class=\"col-12 pb-0\">\n <rlb-breadcrumb *ngIf=\"breadcrumb\" [items]=\"breadcrumb\"></rlb-breadcrumb>\n <h1 class=\"pt-5 pb-0 text-center\">\n {{title}}\n </h1>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"subtitle\">\n <div class=\"col-12 pb-12\">\n <span class=\"d-block text-h6 text-center\">\n {{subtitle}}\n </span>\n </div>\n </div>\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"default\"></ng-container>\n </div>\n </div>\n </div>\n <ng-template class=\"container-fluid\" #mobileMode>\n <div class=\"row\">\n <div class=\"col-12 pb-0\">\n <h1 class=\"pt-5 pb-0 text-center\">\n {{title}}\n </h1>\n </div>\n </div>\n <div class=\"row\" *ngIf=\"subtitle\">\n <div class=\"col-12 pb-7\">\n <div class=\"d-block text-h6 text-center\">\n {{subtitle}}\n </div>\n </div>\n </div>\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"mobile\"></ng-container>\n </ng-template>\n </div>\n \n <ng-template #all>\n <ng-content select=\"[all]\"></ng-content>\n </ng-template>\n \n <ng-template #default>\n <ng-content select=\"[default]\"></ng-content>\n </ng-template>\n \n <ng-template #mobile>\n <ng-content select=\"[mobile]\"></ng-content>\n </ng-template>" }]
|
|
1858
|
+
}], ctorParameters: () => [{ type: i1$7.BreakpointObserver }, { type: Object, decorators: [{
|
|
1859
|
+
type: Inject,
|
|
1860
|
+
args: [PLATFORM_ID]
|
|
1861
|
+
}] }], propDecorators: { breadcrumb: [{
|
|
1862
|
+
type: Input
|
|
1863
|
+
}], title: [{
|
|
1864
|
+
type: Input
|
|
1865
|
+
}], subtitle: [{
|
|
1866
|
+
type: Input
|
|
1867
|
+
}] } });
|
|
1868
|
+
|
|
1869
|
+
class ContentComponent {
|
|
1870
|
+
constructor(breakpointObserver, platformId) {
|
|
1871
|
+
this.breakpointObserver = breakpointObserver;
|
|
1872
|
+
this.platformId = platformId;
|
|
1873
|
+
}
|
|
1874
|
+
get isHandset$() {
|
|
1875
|
+
if (isPlatformServer(this.platformId)) {
|
|
1876
|
+
return of(true);
|
|
1877
|
+
}
|
|
1878
|
+
else {
|
|
1879
|
+
return this.breakpointObserver.observe(Breakpoints.Handset)
|
|
1880
|
+
.pipe(map(result => result.matches), shareReplay());
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
ngOnInit() { }
|
|
1884
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ContentComponent, deps: [{ token: i1$7.BreakpointObserver }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1885
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: ContentComponent, isStandalone: false, selector: "rlb-content-template", ngImport: i0, template: "<div class=\" mb-3\">\n <div class=\"container-fluid\" *ngIf=\"!(isHandset$ | async) else mobileMode\">\n <div class=\"row mt-1\">\n <div class=\"mx-auto col-sm-12 col-md-8 col-lg-9 col-xl-8\">\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"default\"></ng-container>\n </div>\n </div>\n </div>\n <ng-template class=\"container-fluid\" #mobileMode>\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"mobile\"></ng-container>\n </ng-template>\n </div>\n \n <ng-template #all>\n <ng-content select=\"[all]\"></ng-content>\n </ng-template>\n \n <ng-template #default>\n <ng-content select=\"[default]\"></ng-content>\n </ng-template>\n \n <ng-template #mobile>\n <ng-content select=\"[mobile]\"></ng-content>\n </ng-template>", styles: [""], dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$6.AsyncPipe, name: "async" }] }); }
|
|
1886
|
+
}
|
|
1887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ContentComponent, decorators: [{
|
|
1888
|
+
type: Component,
|
|
1889
|
+
args: [{ selector: 'rlb-content-template', standalone: false, template: "<div class=\" mb-3\">\n <div class=\"container-fluid\" *ngIf=\"!(isHandset$ | async) else mobileMode\">\n <div class=\"row mt-1\">\n <div class=\"mx-auto col-sm-12 col-md-8 col-lg-9 col-xl-8\">\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"default\"></ng-container>\n </div>\n </div>\n </div>\n <ng-template class=\"container-fluid\" #mobileMode>\n <ng-container [ngTemplateOutlet]=\"all\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"mobile\"></ng-container>\n </ng-template>\n </div>\n \n <ng-template #all>\n <ng-content select=\"[all]\"></ng-content>\n </ng-template>\n \n <ng-template #default>\n <ng-content select=\"[default]\"></ng-content>\n </ng-template>\n \n <ng-template #mobile>\n <ng-content select=\"[mobile]\"></ng-content>\n </ng-template>" }]
|
|
1890
|
+
}], ctorParameters: () => [{ type: i1$7.BreakpointObserver }, { type: Object, decorators: [{
|
|
1891
|
+
type: Inject,
|
|
1892
|
+
args: [PLATFORM_ID]
|
|
1893
|
+
}] }] });
|
|
1894
|
+
|
|
1895
|
+
class TruncatePipe {
|
|
1896
|
+
transform(value, limit = 25, completeWords = false, ellipsis = '...') {
|
|
1897
|
+
if (!value)
|
|
1898
|
+
return value;
|
|
1899
|
+
if (completeWords) {
|
|
1900
|
+
limit = value.slice(0, limit).lastIndexOf(' ');
|
|
1901
|
+
}
|
|
1902
|
+
return value.length > limit ? value.slice(0, limit) + ellipsis : value;
|
|
1903
|
+
}
|
|
1904
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1905
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: TruncatePipe, isStandalone: false, name: "truncate" }); }
|
|
1906
|
+
}
|
|
1907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TruncatePipe, decorators: [{
|
|
1908
|
+
type: Pipe,
|
|
1909
|
+
args: [{
|
|
1910
|
+
name: 'truncate',
|
|
1911
|
+
standalone: false
|
|
1912
|
+
}]
|
|
1913
|
+
}] });
|
|
1914
|
+
|
|
1915
|
+
const pattern = /(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026\u2019@#\/%?=()~_|!:,.;]*[\-A-Z0-9+\u0026@#\/%=~()_|])/gi;
|
|
1916
|
+
class AutolinkPipe {
|
|
1917
|
+
transform(value, target, rel, id) {
|
|
1918
|
+
if (!value) {
|
|
1919
|
+
return '';
|
|
1920
|
+
}
|
|
1921
|
+
value = value
|
|
1922
|
+
.replace(/&/g, '&')
|
|
1923
|
+
.replace(/</g, '<')
|
|
1924
|
+
.replace(/>/g, '>')
|
|
1925
|
+
.replace(/"/g, '"')
|
|
1926
|
+
.replace(/'/g, ''');
|
|
1927
|
+
const _target = target ? `target="${target}"` : '';
|
|
1928
|
+
const _rel = rel ? `rel="${rel}"` : '';
|
|
1929
|
+
const _id = id ? `id="${id}"` : '';
|
|
1930
|
+
const linkAttributes = [_target, _rel, _id].join(' ').trim();
|
|
1931
|
+
return value.replace(pattern, function (match, space, url) {
|
|
1932
|
+
const link = "<a href='" + url + "'" + linkAttributes + '>' + url + '</a>';
|
|
1933
|
+
return '' + space + link;
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutolinkPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1937
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AutolinkPipe, isStandalone: false, name: "autolink" }); }
|
|
1938
|
+
}
|
|
1939
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutolinkPipe, decorators: [{
|
|
1940
|
+
type: Pipe,
|
|
1941
|
+
args: [{
|
|
1942
|
+
name: 'autolink',
|
|
1943
|
+
standalone: false
|
|
1944
|
+
}]
|
|
1945
|
+
}] });
|
|
1946
|
+
|
|
1947
|
+
class AppContainerComponent {
|
|
1948
|
+
constructor(env, store, router, storage, pwaUpdaterService, appsService, loggerService) {
|
|
1949
|
+
this.env = env;
|
|
1950
|
+
this.store = store;
|
|
1951
|
+
this.router = router;
|
|
1952
|
+
this.storage = storage;
|
|
1953
|
+
this.pwaUpdaterService = pwaUpdaterService;
|
|
1954
|
+
this.appsService = appsService;
|
|
1955
|
+
this.loggerService = loggerService;
|
|
1956
|
+
this.templateSubject = new BehaviorSubject('app');
|
|
1957
|
+
this.logger = this.loggerService.for(this.constructor.name);
|
|
1958
|
+
const theme = (this.storage.readLocal('theme') || 'dark');
|
|
1959
|
+
this.store.dispatch(AppContextActions.setTheme({ theme }));
|
|
1960
|
+
this.store.dispatch(AppContextActions.setLanguage({ language: this.storage.readLocal('locale') || 'en' }));
|
|
1961
|
+
this.store
|
|
1962
|
+
.select((state) => state[appContextFeatureKey].currentApp)
|
|
1963
|
+
.pipe(distinctUntilChanged())
|
|
1964
|
+
.subscribe(async (currentApp) => {
|
|
1965
|
+
this.logger.info('currentApp:', currentApp);
|
|
1966
|
+
if (!currentApp)
|
|
1967
|
+
return;
|
|
1968
|
+
const targetUrl = currentApp.navigationUrl ||
|
|
1969
|
+
(currentApp.viewMode === 'app'
|
|
1970
|
+
? currentApp.core?.url
|
|
1971
|
+
: currentApp.settings?.url);
|
|
1972
|
+
if (!targetUrl)
|
|
1973
|
+
return;
|
|
1974
|
+
const currentUrl = this.router.url;
|
|
1975
|
+
this.logger.info('currentUrl:', currentUrl);
|
|
1976
|
+
this.logger.info('targetUrl:', targetUrl);
|
|
1977
|
+
const normalize = (url) => url.replace(/\/+$/, '');
|
|
1978
|
+
const current = normalize(currentUrl);
|
|
1979
|
+
const target = normalize(targetUrl);
|
|
1980
|
+
if (current === target || current.startsWith(`${target}/`)) {
|
|
1981
|
+
this.logger.info('Already within target route, skipping navigation.');
|
|
1982
|
+
}
|
|
1983
|
+
else {
|
|
1984
|
+
this.logger.info('Navigating to app base URL:', target);
|
|
1985
|
+
await this.router.navigateByUrl(target);
|
|
1986
|
+
}
|
|
1987
|
+
});
|
|
1988
|
+
this.router.events
|
|
1989
|
+
.pipe(filter(event => event instanceof RoutesRecognized), map((event) => event?.state?.root?.firstChild?.data?.['template'] || 'app'), map(o => o), tap((template) => this.templateSubject.next(template))).subscribe();
|
|
1990
|
+
}
|
|
1991
|
+
get template$() {
|
|
1992
|
+
return this.templateSubject.asObservable();
|
|
1993
|
+
}
|
|
1994
|
+
ngOnDestroy() {
|
|
1995
|
+
this.swUpdateSubscription?.unsubscribe();
|
|
1996
|
+
}
|
|
1997
|
+
ngOnInit() {
|
|
1998
|
+
if (this.env.pwaUpdateEnabled) {
|
|
1999
|
+
this.swUpdateSubscription = this.pwaUpdaterService.checkWithDialog().subscribe();
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppContainerComponent, deps: [{ token: RLB_CFG_ENV }, { token: i1$1.Store }, { token: i2.Router }, { token: AppStorageService }, { token: PwaUpdaterService }, { token: AppsService }, { token: AppLoggerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2003
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: AppContainerComponent, isStandalone: false, selector: "rlb-app", inputs: { modalContainerId: ["modal-container-id", "modalContainerId"], toastContainerIds: ["toast-container-ids", "toastContainerIds"] }, ngImport: i0, template: "<ng-container *ngIf=\"(template$ | async) === 'app'\">\n <rlb-app-template>\n <router-outlet />\n </rlb-app-template>\n</ng-container>\n<ng-container *ngIf=\"(template$ | async) === 'basic'\">\n <router-outlet />\n</ng-container>\n\n\n<ng-container *ngIf=\"modalContainerId\">\n <rlb-modal-container [id]=\"modalContainerId\" />\n</ng-container>\n\n<ng-container *ngIf=\"toastContainerIds\">\n <ng-container *ngIf=\"toastContainerIds.constructor.name === 'Array'; else toastContainerIdsIsNotArray\">\n <rlb-toast-container *ngFor=\"let toastContainerId of toastContainerIds | asMulti\" [id]=\"toastContainerId\" />\n </ng-container>\n <ng-template #toastContainerIdsIsNotArray>\n <rlb-toast-container class=\"position-fixed bottom-0 end-0 p-3\" [id]=\"toastContainerIds | asSingle\" />\n </ng-template>\n</ng-container>", dependencies: [{ kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.ModalContainerComponent, selector: "rlb-modal-container", inputs: ["id"] }, { kind: "component", type: i6.ToastContainerComponent, selector: "rlb-toast-container", inputs: ["id"] }, { kind: "directive", type: i2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: AppTemplateComponent, selector: "rlb-app-template", inputs: ["modal-container-id", "toast-container-ids"] }, { kind: "pipe", type: i1$6.AsyncPipe, name: "async" }, { kind: "pipe", type: AsMultiPipe, name: "asMulti" }, { kind: "pipe", type: AsSinglePipe, name: "asSingle" }] }); }
|
|
2004
|
+
}
|
|
2005
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppContainerComponent, decorators: [{
|
|
2006
|
+
type: Component,
|
|
2007
|
+
args: [{ selector: 'rlb-app', standalone: false, template: "<ng-container *ngIf=\"(template$ | async) === 'app'\">\n <rlb-app-template>\n <router-outlet />\n </rlb-app-template>\n</ng-container>\n<ng-container *ngIf=\"(template$ | async) === 'basic'\">\n <router-outlet />\n</ng-container>\n\n\n<ng-container *ngIf=\"modalContainerId\">\n <rlb-modal-container [id]=\"modalContainerId\" />\n</ng-container>\n\n<ng-container *ngIf=\"toastContainerIds\">\n <ng-container *ngIf=\"toastContainerIds.constructor.name === 'Array'; else toastContainerIdsIsNotArray\">\n <rlb-toast-container *ngFor=\"let toastContainerId of toastContainerIds | asMulti\" [id]=\"toastContainerId\" />\n </ng-container>\n <ng-template #toastContainerIdsIsNotArray>\n <rlb-toast-container class=\"position-fixed bottom-0 end-0 p-3\" [id]=\"toastContainerIds | asSingle\" />\n </ng-template>\n</ng-container>" }]
|
|
2008
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2009
|
+
type: Inject,
|
|
2010
|
+
args: [RLB_CFG_ENV]
|
|
2011
|
+
}] }, { type: i1$1.Store }, { type: i2.Router }, { type: AppStorageService }, { type: PwaUpdaterService }, { type: AppsService }, { type: AppLoggerService }], propDecorators: { modalContainerId: [{
|
|
2012
|
+
type: Input,
|
|
2013
|
+
args: ['modal-container-id']
|
|
2014
|
+
}], toastContainerIds: [{
|
|
2015
|
+
type: Input,
|
|
2016
|
+
args: ['toast-container-ids']
|
|
2017
|
+
}] } });
|
|
2018
|
+
|
|
2019
|
+
class RlbAppModule {
|
|
2020
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbAppModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2021
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: RlbAppModule, declarations: [
|
|
2022
|
+
// pages
|
|
2023
|
+
CmsContentComponent,
|
|
2024
|
+
CookiesComponent,
|
|
2025
|
+
NotFoundComponent,
|
|
2026
|
+
PrivacyComponent,
|
|
2027
|
+
SupportComponent,
|
|
2028
|
+
TermsAndConditionsComponent,
|
|
2029
|
+
// pipes
|
|
2030
|
+
CmsPipe,
|
|
2031
|
+
AsMultiPipe,
|
|
2032
|
+
AsSinglePipe,
|
|
2033
|
+
LeftComponentPipe,
|
|
2034
|
+
RightComponentPipe,
|
|
2035
|
+
TruncatePipe,
|
|
2036
|
+
AutolinkPipe,
|
|
2037
|
+
// templates
|
|
2038
|
+
BaseComponent,
|
|
2039
|
+
CmsComponent,
|
|
2040
|
+
ContentComponent,
|
|
2041
|
+
AppTemplateComponent,
|
|
2042
|
+
AppContainerComponent], imports: [CommonModule,
|
|
2043
|
+
FormsModule,
|
|
2044
|
+
ReactiveFormsModule,
|
|
2045
|
+
TranslateModule,
|
|
2046
|
+
RlbBootstrapModule,
|
|
2047
|
+
RouterModule], exports: [
|
|
2048
|
+
// pipes
|
|
2049
|
+
CmsPipe,
|
|
2050
|
+
AsMultiPipe,
|
|
2051
|
+
AsSinglePipe,
|
|
2052
|
+
LeftComponentPipe,
|
|
2053
|
+
RightComponentPipe,
|
|
2054
|
+
TruncatePipe,
|
|
2055
|
+
AutolinkPipe,
|
|
2056
|
+
// templates
|
|
2057
|
+
BaseComponent,
|
|
2058
|
+
CmsComponent,
|
|
2059
|
+
ContentComponent,
|
|
2060
|
+
AppTemplateComponent,
|
|
2061
|
+
AppContainerComponent,
|
|
2062
|
+
// modules
|
|
2063
|
+
TranslateModule,
|
|
2064
|
+
RlbBootstrapModule,
|
|
2065
|
+
RouterModule,
|
|
2066
|
+
FormsModule] }); }
|
|
2067
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbAppModule, imports: [CommonModule,
|
|
2068
|
+
FormsModule,
|
|
2069
|
+
ReactiveFormsModule,
|
|
2070
|
+
TranslateModule,
|
|
2071
|
+
RlbBootstrapModule,
|
|
2072
|
+
RouterModule,
|
|
2073
|
+
// modules
|
|
2074
|
+
TranslateModule,
|
|
2075
|
+
RlbBootstrapModule,
|
|
2076
|
+
RouterModule,
|
|
2077
|
+
FormsModule] }); }
|
|
2078
|
+
}
|
|
2079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbAppModule, decorators: [{
|
|
2080
|
+
type: NgModule,
|
|
2081
|
+
args: [{
|
|
2082
|
+
declarations: [
|
|
2083
|
+
// pages
|
|
2084
|
+
CmsContentComponent,
|
|
2085
|
+
CookiesComponent,
|
|
2086
|
+
NotFoundComponent,
|
|
2087
|
+
PrivacyComponent,
|
|
2088
|
+
SupportComponent,
|
|
2089
|
+
TermsAndConditionsComponent,
|
|
2090
|
+
// pipes
|
|
2091
|
+
CmsPipe,
|
|
2092
|
+
AsMultiPipe,
|
|
2093
|
+
AsSinglePipe,
|
|
2094
|
+
LeftComponentPipe,
|
|
2095
|
+
RightComponentPipe,
|
|
2096
|
+
TruncatePipe,
|
|
2097
|
+
AutolinkPipe,
|
|
2098
|
+
// templates
|
|
2099
|
+
BaseComponent,
|
|
2100
|
+
CmsComponent,
|
|
2101
|
+
ContentComponent,
|
|
2102
|
+
AppTemplateComponent,
|
|
2103
|
+
AppContainerComponent
|
|
2104
|
+
],
|
|
2105
|
+
exports: [
|
|
2106
|
+
// pipes
|
|
2107
|
+
CmsPipe,
|
|
2108
|
+
AsMultiPipe,
|
|
2109
|
+
AsSinglePipe,
|
|
2110
|
+
LeftComponentPipe,
|
|
2111
|
+
RightComponentPipe,
|
|
2112
|
+
TruncatePipe,
|
|
2113
|
+
AutolinkPipe,
|
|
2114
|
+
// templates
|
|
2115
|
+
BaseComponent,
|
|
2116
|
+
CmsComponent,
|
|
2117
|
+
ContentComponent,
|
|
2118
|
+
AppTemplateComponent,
|
|
2119
|
+
AppContainerComponent,
|
|
2120
|
+
// modules
|
|
2121
|
+
TranslateModule,
|
|
2122
|
+
RlbBootstrapModule,
|
|
2123
|
+
RouterModule,
|
|
2124
|
+
FormsModule
|
|
2125
|
+
],
|
|
2126
|
+
imports: [
|
|
2127
|
+
CommonModule,
|
|
2128
|
+
FormsModule,
|
|
2129
|
+
ReactiveFormsModule,
|
|
2130
|
+
TranslateModule,
|
|
2131
|
+
RlbBootstrapModule,
|
|
2132
|
+
RouterModule
|
|
2133
|
+
]
|
|
2134
|
+
}]
|
|
2135
|
+
}] });
|
|
2136
|
+
|
|
2137
|
+
class ErrorModalComponent {
|
|
2138
|
+
onEnter() { }
|
|
2139
|
+
ngOnInit() { }
|
|
2140
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ErrorModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2141
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: ErrorModalComponent, isStandalone: true, selector: "ng-component", hostDirectives: [{ directive: i6.ModalDirective, inputs: ["id", "id", "data-instance", "data-instance", "data-options", "data-options"] }], ngImport: i0, template: ` <div class="modal-header">
|
|
2142
|
+
<h5 class="modal-title">{{ data.title }}</h5>
|
|
2143
|
+
<button
|
|
2144
|
+
type="button"
|
|
2145
|
+
class="btn-close"
|
|
2146
|
+
aria-label="Close"
|
|
2147
|
+
data-modal-reason="close"
|
|
2148
|
+
></button>
|
|
2149
|
+
</div>
|
|
2150
|
+
<div class="modal-body">
|
|
2151
|
+
<span>{{ data.content }}</span>
|
|
2152
|
+
</div>
|
|
2153
|
+
<div class="modal-footer">
|
|
2154
|
+
<button type="button" class="btn btn-primary" data-modal-reason="close">
|
|
2155
|
+
{{ data.ok }}
|
|
2156
|
+
</button>
|
|
2157
|
+
</div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: RlbAppModule }, { kind: "ngmodule", type: CommonModule }] }); }
|
|
2158
|
+
}
|
|
2159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ErrorModalComponent, decorators: [{
|
|
2160
|
+
type: Component,
|
|
2161
|
+
args: [{
|
|
2162
|
+
imports: [RlbAppModule, CommonModule],
|
|
2163
|
+
template: ` <div class="modal-header">
|
|
2164
|
+
<h5 class="modal-title">{{ data.title }}</h5>
|
|
2165
|
+
<button
|
|
2166
|
+
type="button"
|
|
2167
|
+
class="btn-close"
|
|
2168
|
+
aria-label="Close"
|
|
2169
|
+
data-modal-reason="close"
|
|
2170
|
+
></button>
|
|
2171
|
+
</div>
|
|
2172
|
+
<div class="modal-body">
|
|
2173
|
+
<span>{{ data.content }}</span>
|
|
2174
|
+
</div>
|
|
2175
|
+
<div class="modal-footer">
|
|
2176
|
+
<button type="button" class="btn btn-primary" data-modal-reason="close">
|
|
2177
|
+
{{ data.ok }}
|
|
2178
|
+
</button>
|
|
2179
|
+
</div>`,
|
|
2180
|
+
hostDirectives: [
|
|
2181
|
+
{
|
|
2182
|
+
directive: ModalDirective,
|
|
2183
|
+
inputs: ['id', 'data-instance', 'data-options'],
|
|
2184
|
+
},
|
|
2185
|
+
]
|
|
2186
|
+
}]
|
|
2187
|
+
}] });
|
|
2188
|
+
|
|
2189
|
+
class ModalAppsComponent {
|
|
2190
|
+
constructor() {
|
|
2191
|
+
this.valid = true;
|
|
2192
|
+
this.apps = [];
|
|
2193
|
+
}
|
|
2194
|
+
appSelected(app) {
|
|
2195
|
+
this.result = app;
|
|
2196
|
+
}
|
|
2197
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ModalAppsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2198
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: ModalAppsComponent, isStandalone: true, selector: "ng-component", hostDirectives: [{ directive: i6.ModalDirective, inputs: ["id", "id", "data-instance", "data-instance", "data-options", "data-options"] }], ngImport: i0, template: `
|
|
2199
|
+
<div class="modal-header">
|
|
2200
|
+
<h5 class="modal-title">{{ data.title }}</h5>
|
|
2201
|
+
<button type="button" class="btn-close" aria-label="Close" data-modal-reason="close"></button>
|
|
2202
|
+
</div>
|
|
2203
|
+
<div class="modal-body">
|
|
2204
|
+
<ul class="row row-cols-4 list-unstyled list">
|
|
2205
|
+
<li *ngFor="let app of data.content" class="col my-2" [tooltip]="app.description | translate">
|
|
2206
|
+
<a class="d-block text-body-emphasis text-decoration-none" (click)="appSelected(app)" [class.disabled]="!app.enabled" data-modal-reason="ok">
|
|
2207
|
+
<div class="px-3 py-4 mb-2 bg-body-secondary text-center rounded">
|
|
2208
|
+
<i [ngClass]="app.icon"></i>
|
|
2209
|
+
</div>
|
|
2210
|
+
<div class="name text-muted text-decoration-none text-center pt-1">{{app.name | translate}}</div>
|
|
2211
|
+
</a>
|
|
2212
|
+
</li>
|
|
2213
|
+
</ul>
|
|
2214
|
+
</div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: RlbAppModule }, { kind: "directive", type: i6.TooltipDirective, selector: "[tooltip]", inputs: ["tooltip", "tooltip-placement", "tooltip-class", "tooltip-html"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] }); }
|
|
2215
|
+
}
|
|
2216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ModalAppsComponent, decorators: [{
|
|
2217
|
+
type: Component,
|
|
2218
|
+
args: [{
|
|
2219
|
+
imports: [RlbAppModule, CommonModule],
|
|
2220
|
+
template: `
|
|
2221
|
+
<div class="modal-header">
|
|
2222
|
+
<h5 class="modal-title">{{ data.title }}</h5>
|
|
2223
|
+
<button type="button" class="btn-close" aria-label="Close" data-modal-reason="close"></button>
|
|
2224
|
+
</div>
|
|
2225
|
+
<div class="modal-body">
|
|
2226
|
+
<ul class="row row-cols-4 list-unstyled list">
|
|
2227
|
+
<li *ngFor="let app of data.content" class="col my-2" [tooltip]="app.description | translate">
|
|
2228
|
+
<a class="d-block text-body-emphasis text-decoration-none" (click)="appSelected(app)" [class.disabled]="!app.enabled" data-modal-reason="ok">
|
|
2229
|
+
<div class="px-3 py-4 mb-2 bg-body-secondary text-center rounded">
|
|
2230
|
+
<i [ngClass]="app.icon"></i>
|
|
2231
|
+
</div>
|
|
2232
|
+
<div class="name text-muted text-decoration-none text-center pt-1">{{app.name | translate}}</div>
|
|
2233
|
+
</a>
|
|
2234
|
+
</li>
|
|
2235
|
+
</ul>
|
|
2236
|
+
</div>`,
|
|
2237
|
+
hostDirectives: [{ directive: ModalDirective, inputs: ['id', 'data-instance', 'data-options'] }]
|
|
2238
|
+
}]
|
|
2239
|
+
}] });
|
|
2240
|
+
|
|
2241
|
+
class AppSelectorComponent {
|
|
2242
|
+
constructor(_location, appsService, authService) {
|
|
2243
|
+
this._location = _location;
|
|
2244
|
+
this.appsService = appsService;
|
|
2245
|
+
this.authService = authService;
|
|
2246
|
+
}
|
|
2247
|
+
get apps() {
|
|
2248
|
+
return this.appsService.apps;
|
|
2249
|
+
}
|
|
2250
|
+
backClicked() {
|
|
2251
|
+
this._location.back();
|
|
2252
|
+
}
|
|
2253
|
+
selectApp(app) {
|
|
2254
|
+
this.appsService.selectApp(app, 'app');
|
|
2255
|
+
}
|
|
2256
|
+
get auth$() {
|
|
2257
|
+
return this.authService.isAuthenticated$;
|
|
2258
|
+
}
|
|
2259
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppSelectorComponent, deps: [{ token: i1$6.Location }, { token: AppsService }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2260
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: AppSelectorComponent, isStandalone: true, selector: "rlb-app-selector", ngImport: i0, template: "<div class=\"container mt-2\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.apps.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y cur\"\n style=\"font-size: 25px;font-weight: 600;\" (click)=\"backClicked()\"></i>\n </div>\n <rlb-list>\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngFor=\"let app of apps\">\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngIf=\"app.core\">\n <rlb-list-item-image [icon]=\"app.core.icon\" [avatar-size]=\"35\"\n [line-1]=\"(app.core.title | translate) + (app.data?.appName ? ' - ' + app.data?.appName : '')\"\n [disabled]=\"!app.enabled && (app.core.auth && !(auth$ | async))\" [line-2]=\"app.core.description | translate\"\n (click)=\"selectApp(app)\">\n </rlb-list-item-image>\n </ng-container>\n </ng-container>\n </rlb-list>\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: RlbAppModule }, { kind: "component", type: i6.ListComponent, selector: "rlb-list", inputs: ["disabled", "numbered", "flush", "horizontal"] }, { kind: "component", type: i6.ListItemImageComponent, selector: "rlb-list-item-image", inputs: ["active", "disabled", "counter-empty", "counter-pill", "counter-border", "avatar-size", "username", "line-1", "line-2", "avatar", "counter", "counter-color", "icon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1$6.AsyncPipe, name: "async" }] }); }
|
|
2261
|
+
}
|
|
2262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppSelectorComponent, decorators: [{
|
|
2263
|
+
type: Component,
|
|
2264
|
+
args: [{ selector: 'rlb-app-selector', imports: [RlbAppModule, CommonModule], template: "<div class=\"container mt-2\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.apps.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y cur\"\n style=\"font-size: 25px;font-weight: 600;\" (click)=\"backClicked()\"></i>\n </div>\n <rlb-list>\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngFor=\"let app of apps\">\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngIf=\"app.core\">\n <rlb-list-item-image [icon]=\"app.core.icon\" [avatar-size]=\"35\"\n [line-1]=\"(app.core.title | translate) + (app.data?.appName ? ' - ' + app.data?.appName : '')\"\n [disabled]=\"!app.enabled && (app.core.auth && !(auth$ | async))\" [line-2]=\"app.core.description | translate\"\n (click)=\"selectApp(app)\">\n </rlb-list-item-image>\n </ng-container>\n </ng-container>\n </rlb-list>\n</div>" }]
|
|
2265
|
+
}], ctorParameters: () => [{ type: i1$6.Location }, { type: AppsService }, { type: AuthenticationService }] });
|
|
2266
|
+
|
|
2267
|
+
class RlbRole {
|
|
2268
|
+
constructor(templateRef, viewContainer, authenticationService, parseJwtService) {
|
|
2269
|
+
this.templateRef = templateRef;
|
|
2270
|
+
this.viewContainer = viewContainer;
|
|
2271
|
+
this.authenticationService = authenticationService;
|
|
2272
|
+
this.parseJwtService = parseJwtService;
|
|
2273
|
+
}
|
|
2274
|
+
set roles(roles) {
|
|
2275
|
+
if (typeof roles === 'string') {
|
|
2276
|
+
if (roles.includes(','))
|
|
2277
|
+
roles = roles.split(',').map(role => role.trim());
|
|
2278
|
+
else
|
|
2279
|
+
roles = [roles];
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
updateView() {
|
|
2283
|
+
return this.authenticationService.
|
|
2284
|
+
accessToken$.pipe(map(token => this.parseJwtService.parseJwt(token)),
|
|
2285
|
+
//map(payload => this.authenticationService.currentProvider.roleClaim?.(payload) || []),
|
|
2286
|
+
tap(roles => {
|
|
2287
|
+
let valid = true;
|
|
2288
|
+
for (const role of this.roles) {
|
|
2289
|
+
if (roles.includes(role))
|
|
2290
|
+
valid &&= true;
|
|
2291
|
+
}
|
|
2292
|
+
if (valid) {
|
|
2293
|
+
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
2294
|
+
}
|
|
2295
|
+
else {
|
|
2296
|
+
this.viewContainer.clear();
|
|
2297
|
+
}
|
|
2298
|
+
}));
|
|
2299
|
+
}
|
|
2300
|
+
ngOnInit() {
|
|
2301
|
+
this.updateView().subscribe();
|
|
2302
|
+
}
|
|
2303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbRole, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: AuthenticationService }, { token: ParseJwtService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2304
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: RlbRole, isStandalone: false, selector: "[roles]", inputs: { roles: "roles" }, ngImport: i0 }); }
|
|
2305
|
+
}
|
|
2306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: RlbRole, decorators: [{
|
|
2307
|
+
type: Directive,
|
|
2308
|
+
args: [{
|
|
2309
|
+
selector: '[roles]',
|
|
2310
|
+
standalone: false
|
|
2311
|
+
}]
|
|
2312
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: AuthenticationService }, { type: ParseJwtService }], propDecorators: { roles: [{
|
|
2313
|
+
type: Input
|
|
2314
|
+
}] } });
|
|
2315
|
+
|
|
2316
|
+
const oauthGuard = (route, state) => {
|
|
2317
|
+
const authService = inject(AuthenticationService);
|
|
2318
|
+
return authService.isAuthenticated$.pipe(take(1), map((isAuthenticated) => {
|
|
2319
|
+
if (!isAuthenticated) {
|
|
2320
|
+
authService.login();
|
|
2321
|
+
return false;
|
|
2322
|
+
}
|
|
2323
|
+
return true;
|
|
2324
|
+
}));
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2327
|
+
const SESSION_RT = 'RT';
|
|
2328
|
+
const SESSION_AT = 'AT';
|
|
2329
|
+
const TOKEN_URL = `protocol/openid-connect/token`;
|
|
2330
|
+
class OauthPasswordService {
|
|
2331
|
+
//private _user: User | null = null
|
|
2332
|
+
constructor(httpClient, authenticationService) {
|
|
2333
|
+
this.httpClient = httpClient;
|
|
2334
|
+
this.authenticationService = authenticationService;
|
|
2335
|
+
this.timer = null;
|
|
2336
|
+
this._onUpdateToken = null;
|
|
2337
|
+
this.initRefreshToken().catch(e => console.error("Error in refresh token", e));
|
|
2338
|
+
}
|
|
2339
|
+
intercept(req, next) {
|
|
2340
|
+
if (this.authenticationService.config.allowedUrls.some(o => req.url.includes(o))) {
|
|
2341
|
+
const token = this.access_token;
|
|
2342
|
+
if (token) {
|
|
2343
|
+
req = req.clone({
|
|
2344
|
+
setHeaders: {
|
|
2345
|
+
Authorization: `Bearer ${token}`
|
|
2346
|
+
}
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
return next.handle(req);
|
|
2351
|
+
}
|
|
2352
|
+
get access_token() {
|
|
2353
|
+
const r = sessionStorage.getItem(SESSION_AT);
|
|
2354
|
+
return typeof r === 'string' && r !== '' ? r : null;
|
|
2355
|
+
}
|
|
2356
|
+
set access_token(val) {
|
|
2357
|
+
if (val === undefined || val === null || val === '')
|
|
2358
|
+
sessionStorage.removeItem(SESSION_AT);
|
|
2359
|
+
else
|
|
2360
|
+
sessionStorage.setItem(SESSION_AT, val);
|
|
2361
|
+
}
|
|
2362
|
+
get refresh_token() {
|
|
2363
|
+
const r = sessionStorage.getItem(SESSION_RT);
|
|
2364
|
+
return typeof r === 'string' && r !== '' ? r : null;
|
|
2365
|
+
}
|
|
2366
|
+
set refresh_token(val) {
|
|
2367
|
+
if (val === undefined || val === null || val === '')
|
|
2368
|
+
sessionStorage.removeItem(SESSION_RT);
|
|
2369
|
+
else
|
|
2370
|
+
sessionStorage.setItem(SESSION_RT, val);
|
|
2371
|
+
}
|
|
2372
|
+
get accessToken() {
|
|
2373
|
+
return this.access_token;
|
|
2374
|
+
}
|
|
2375
|
+
// public get user() {
|
|
2376
|
+
// return this._user
|
|
2377
|
+
// }
|
|
2378
|
+
set onUpdateToken(v) {
|
|
2379
|
+
this._onUpdateToken = v;
|
|
2380
|
+
}
|
|
2381
|
+
async login(username, password) {
|
|
2382
|
+
const t = await this._login(username, password);
|
|
2383
|
+
this.refresh_token = t.refresh_token;
|
|
2384
|
+
this.access_token = t.access_token;
|
|
2385
|
+
if (typeof this._onUpdateToken === 'function') {
|
|
2386
|
+
this._onUpdateToken(this.access_token);
|
|
2387
|
+
}
|
|
2388
|
+
// if (this._user === null) {
|
|
2389
|
+
// this._user = await lastValueFrom(this.users.apiV1UsersGetSelfGet())
|
|
2390
|
+
// }
|
|
2391
|
+
if (this.timer !== null) {
|
|
2392
|
+
clearInterval(this.timer);
|
|
2393
|
+
this.timer = null;
|
|
2394
|
+
}
|
|
2395
|
+
this.timer = setInterval(async () => {
|
|
2396
|
+
try {
|
|
2397
|
+
var r = await this._refreshToken(this.refresh_token);
|
|
2398
|
+
this.refresh_token = r.refresh_token;
|
|
2399
|
+
this.access_token = r.access_token;
|
|
2400
|
+
if (typeof this._onUpdateToken === 'function') {
|
|
2401
|
+
this._onUpdateToken(this.access_token);
|
|
2402
|
+
}
|
|
2403
|
+
// if (this._user === null) {
|
|
2404
|
+
// this._user = await lastValueFrom(this.users.apiV1UsersGetSelfGet())
|
|
2405
|
+
// }
|
|
2406
|
+
}
|
|
2407
|
+
catch (e) {
|
|
2408
|
+
console.warn("Refresh token fail");
|
|
2409
|
+
}
|
|
2410
|
+
}, t.expires_in * 1000 - 60000);
|
|
2411
|
+
return t;
|
|
2412
|
+
}
|
|
2413
|
+
loggedIn() {
|
|
2414
|
+
return !!this.access_token;
|
|
2415
|
+
}
|
|
2416
|
+
logout() {
|
|
2417
|
+
this.refresh_token = null;
|
|
2418
|
+
this.access_token = null;
|
|
2419
|
+
if (this.timer !== null) {
|
|
2420
|
+
clearInterval(this.timer);
|
|
2421
|
+
this.timer = null;
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
async _login(username, password) {
|
|
2425
|
+
if (!this.authenticationService.currentProvider)
|
|
2426
|
+
throw new Error("No authentication provider configured");
|
|
2427
|
+
let body = new URLSearchParams();
|
|
2428
|
+
body.set('grant_type', 'password');
|
|
2429
|
+
body.set('client_id', 'addubby');
|
|
2430
|
+
body.set('scope', 'addubby-order');
|
|
2431
|
+
body.set('username', username);
|
|
2432
|
+
body.set('password', password);
|
|
2433
|
+
return await lastValueFrom(this.httpClient.post(`${this.authenticationService.currentProvider.authority}/${TOKEN_URL}`, body.toString(), {
|
|
2434
|
+
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
2435
|
+
}));
|
|
2436
|
+
}
|
|
2437
|
+
async _refreshToken(token) {
|
|
2438
|
+
if (!this.authenticationService.currentProvider)
|
|
2439
|
+
throw new Error("No authentication provider configured");
|
|
2440
|
+
let body = new URLSearchParams();
|
|
2441
|
+
body.set('grant_type', 'refresh_token');
|
|
2442
|
+
body.set('client_id', this.authenticationService.currentProvider.clientId);
|
|
2443
|
+
if (token)
|
|
2444
|
+
body.set('refresh_token', token);
|
|
2445
|
+
return await lastValueFrom(this.httpClient.post(`${this.authenticationService.currentProvider.authority}/${TOKEN_URL}`, body.toString(), {
|
|
2446
|
+
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
2447
|
+
}));
|
|
2448
|
+
}
|
|
2449
|
+
async initRefreshToken() {
|
|
2450
|
+
if (this.refresh_token) {
|
|
2451
|
+
var r = await this._refreshToken(this.refresh_token);
|
|
2452
|
+
this.refresh_token = r.refresh_token;
|
|
2453
|
+
this.access_token = r.access_token;
|
|
2454
|
+
// if (this._user === null) {
|
|
2455
|
+
// this._user = await lastValueFrom(this.users.apiV1UsersGetSelfGet())
|
|
2456
|
+
// }
|
|
2457
|
+
if (typeof this._onUpdateToken === 'function') {
|
|
2458
|
+
this._onUpdateToken(this.access_token);
|
|
2459
|
+
}
|
|
2460
|
+
this.timer = setInterval(async () => {
|
|
2461
|
+
try {
|
|
2462
|
+
var r = await this._refreshToken(this.refresh_token);
|
|
2463
|
+
this.refresh_token = r.refresh_token;
|
|
2464
|
+
this.access_token = r.access_token;
|
|
2465
|
+
// if (this._user === null) {
|
|
2466
|
+
// this._user = await lastValueFrom(this.users.apiV1UsersGetSelfGet())
|
|
2467
|
+
// }
|
|
2468
|
+
if (typeof this._onUpdateToken === 'function') {
|
|
2469
|
+
this._onUpdateToken(this.access_token);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
catch (e) {
|
|
2473
|
+
console.warn("Refresh token fail");
|
|
2474
|
+
}
|
|
2475
|
+
}, r.expires_in * 1000 - 60000);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: OauthPasswordService, deps: [{ token: i1$3.HttpClient }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2479
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: OauthPasswordService, providedIn: 'root' }); }
|
|
2480
|
+
}
|
|
2481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: OauthPasswordService, decorators: [{
|
|
2482
|
+
type: Injectable,
|
|
2483
|
+
args: [{
|
|
2484
|
+
providedIn: 'root'
|
|
2485
|
+
}]
|
|
2486
|
+
}], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: AuthenticationService }] });
|
|
2487
|
+
|
|
2488
|
+
const oauthPasswordGuard = (route, state) => {
|
|
2489
|
+
const auth = inject(OauthPasswordService);
|
|
2490
|
+
const router = inject(Router);
|
|
2491
|
+
return of(auth.loggedIn()).pipe(map(o => {
|
|
2492
|
+
if (!o) {
|
|
2493
|
+
router.navigate(['login']);
|
|
2494
|
+
return false;
|
|
2495
|
+
}
|
|
2496
|
+
return true;
|
|
2497
|
+
}));
|
|
2498
|
+
};
|
|
2499
|
+
|
|
2500
|
+
class KeycloakProfileService {
|
|
2501
|
+
constructor(http, authService, errorManagementService, oidcSecurityService) {
|
|
2502
|
+
this.http = http;
|
|
2503
|
+
this.authService = authService;
|
|
2504
|
+
this.errorManagementService = errorManagementService;
|
|
2505
|
+
this.oidcSecurityService = oidcSecurityService;
|
|
2506
|
+
}
|
|
2507
|
+
get baseUrl() {
|
|
2508
|
+
return `${this.authService.currentProvider?.authority}/account`;
|
|
2509
|
+
}
|
|
2510
|
+
getUserProfile() {
|
|
2511
|
+
return this.authService.isAuthenticated$.pipe(filter(isAuth => isAuth), switchMap(() => this.authService.accessToken$), switchMap(token => this.http.get(this.baseUrl, {
|
|
2512
|
+
headers: {
|
|
2513
|
+
Authorization: `Bearer ${token}`,
|
|
2514
|
+
},
|
|
2515
|
+
})), this.errorManagementService.manageUI('error', 'dialog'));
|
|
2516
|
+
}
|
|
2517
|
+
updateUserProfile(data) {
|
|
2518
|
+
return this.authService.isAuthenticated$.pipe(filter(isAuth => isAuth), switchMap(() => this.authService.accessToken$), switchMap(token => this.http.post(this.baseUrl, data, {
|
|
2519
|
+
headers: {
|
|
2520
|
+
Authorization: `Bearer ${token}`,
|
|
2521
|
+
},
|
|
2522
|
+
})), this.errorManagementService.manageUI('error', 'dialog'));
|
|
2523
|
+
}
|
|
2524
|
+
getDevices() {
|
|
2525
|
+
return this.authService.isAuthenticated$.pipe(filter(isAuth => isAuth), switchMap(() => this.authService.accessToken$), switchMap(token => this.http.get(`${this.baseUrl}/sessions/devices`, {
|
|
2526
|
+
headers: {
|
|
2527
|
+
Authorization: `Bearer ${token}`,
|
|
2528
|
+
},
|
|
2529
|
+
})), map((devices) => devices.map((device) => device.sessions.map((session) => {
|
|
2530
|
+
session.os = device.os;
|
|
2531
|
+
session.osVersion = device.osVersion;
|
|
2532
|
+
session.device = device.device;
|
|
2533
|
+
session.mobile = device.mobile;
|
|
2534
|
+
session.clientslist = session.clients.map((client) => client.clientName).join(', ');
|
|
2535
|
+
return session;
|
|
2536
|
+
})).flat()), this.errorManagementService.manageUI('error', 'dialog'));
|
|
2537
|
+
}
|
|
2538
|
+
getCredentials() {
|
|
2539
|
+
return this.authService.isAuthenticated$.pipe(filter(isAuth => isAuth), switchMap(() => this.authService.accessToken$), switchMap(token => this.http.get(`${this.baseUrl}/credentials`, {
|
|
2540
|
+
headers: {
|
|
2541
|
+
Authorization: `Bearer ${token}`,
|
|
2542
|
+
},
|
|
2543
|
+
})), this.errorManagementService.manageUI('error', 'dialog'));
|
|
2544
|
+
}
|
|
2545
|
+
removeCredential(id) {
|
|
2546
|
+
return this.authService.isAuthenticated$.pipe(filter(isAuth => isAuth), switchMap(() => this.authService.accessToken$), switchMap(token => {
|
|
2547
|
+
return this.http.delete(`${this.baseUrl}/credentials/${id}`, {
|
|
2548
|
+
headers: {
|
|
2549
|
+
Authorization: `Bearer ${token}`,
|
|
2550
|
+
},
|
|
2551
|
+
});
|
|
2552
|
+
}), this.errorManagementService.manageUI('error', 'dialog'));
|
|
2553
|
+
}
|
|
2554
|
+
configureOTP() {
|
|
2555
|
+
return this.oidcSecurityService.authorize(this.authService.currentProvider?.configId, {
|
|
2556
|
+
customParams: {
|
|
2557
|
+
kc_action: "CONFIGURE_TOTP"
|
|
2558
|
+
}
|
|
2559
|
+
});
|
|
2560
|
+
}
|
|
2561
|
+
updatePassword() {
|
|
2562
|
+
return this.oidcSecurityService.authorize(this.authService.currentProvider?.configId, {
|
|
2563
|
+
customParams: {
|
|
2564
|
+
kc_action: "UPDATE_PASSWORD"
|
|
2565
|
+
}
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: KeycloakProfileService, deps: [{ token: i1$3.HttpClient }, { token: AuthenticationService }, { token: ErrorManagementService }, { token: i1$5.OidcSecurityService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2569
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: KeycloakProfileService, providedIn: 'root' }); }
|
|
2570
|
+
}
|
|
2571
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: KeycloakProfileService, decorators: [{
|
|
2572
|
+
type: Injectable,
|
|
2573
|
+
args: [{
|
|
2574
|
+
providedIn: 'root',
|
|
2575
|
+
}]
|
|
2576
|
+
}], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: AuthenticationService }, { type: ErrorManagementService }, { type: i1$5.OidcSecurityService }] });
|
|
2577
|
+
|
|
2578
|
+
class UserAccountComponent {
|
|
2579
|
+
constructor(_location, store, keycloakProfileService, modalService, languageService, authService, router) {
|
|
2580
|
+
this._location = _location;
|
|
2581
|
+
this.store = store;
|
|
2582
|
+
this.keycloakProfileService = keycloakProfileService;
|
|
2583
|
+
this.modalService = modalService;
|
|
2584
|
+
this.languageService = languageService;
|
|
2585
|
+
this.authService = authService;
|
|
2586
|
+
this.router = router;
|
|
2587
|
+
this.subs = [];
|
|
2588
|
+
this.authService.isAuthenticated$.pipe(filter(isAuth => !isAuth), switchMap(() => this.router.navigate(['/']))).subscribe();
|
|
2589
|
+
}
|
|
2590
|
+
backClicked() {
|
|
2591
|
+
this._location.back();
|
|
2592
|
+
}
|
|
2593
|
+
ngOnInit() {
|
|
2594
|
+
this.subs.push(this.keycloakProfileService.getUserProfile().subscribe((user) => {
|
|
2595
|
+
this.keyCloakUser = user;
|
|
2596
|
+
}));
|
|
2597
|
+
this.subs.push(this.keycloakProfileService.getDevices().subscribe((devices) => {
|
|
2598
|
+
this.keyCloakDevices = devices;
|
|
2599
|
+
}));
|
|
2600
|
+
this.subs.push(this.keycloakProfileService.getCredentials().subscribe((credentials) => {
|
|
2601
|
+
this.keycloakCredentials = credentials;
|
|
2602
|
+
}));
|
|
2603
|
+
}
|
|
2604
|
+
ngOnDestroy() {
|
|
2605
|
+
while (this.subs.length) {
|
|
2606
|
+
this.subs.pop()?.unsubscribe();
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
logout() {
|
|
2610
|
+
this.store.dispatch(AuthActions.logout());
|
|
2611
|
+
}
|
|
2612
|
+
async removeCredential(type, id) {
|
|
2613
|
+
return await lastValueFrom(this.modalService.openConfirmModal(this.languageService.translate("core.account.credentials.deleteTitle"), this.languageService.translate("core.account.credentials.deleteMessage"), this.languageService.translate("core.account.credentials.deleteHeader"), this.languageService.translate("common.yes"), this.languageService.translate("common.cancel")).pipe(switchMap((result) => {
|
|
2614
|
+
if (result) {
|
|
2615
|
+
return this.keycloakProfileService.removeCredential(id).pipe(tap(() => {
|
|
2616
|
+
const meta = this.keycloakCredentials.find((c) => c.type === type)?.userCredentialMetadatas;
|
|
2617
|
+
const idx = meta?.findIndex((m) => m.credential.id === id);
|
|
2618
|
+
if (meta && idx !== undefined && idx !== -1) {
|
|
2619
|
+
meta.splice(idx, 1);
|
|
2620
|
+
}
|
|
2621
|
+
}));
|
|
2622
|
+
}
|
|
2623
|
+
return EMPTY;
|
|
2624
|
+
})));
|
|
2625
|
+
}
|
|
2626
|
+
async updateProfile() {
|
|
2627
|
+
return await lastValueFrom(this.keycloakProfileService.updateUserProfile(this.keyCloakUser));
|
|
2628
|
+
}
|
|
2629
|
+
updatePassword() {
|
|
2630
|
+
this.keycloakProfileService.updatePassword();
|
|
2631
|
+
}
|
|
2632
|
+
configureOTP() {
|
|
2633
|
+
this.keycloakProfileService.configureOTP();
|
|
2634
|
+
}
|
|
2635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserAccountComponent, deps: [{ token: i1$6.Location }, { token: i1$1.Store }, { token: KeycloakProfileService }, { token: i6.ModalService }, { token: LanguageService }, { token: AuthenticationService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2636
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: UserAccountComponent, isStandalone: true, selector: "rlb-user-account", ngImport: i0, template: "<div class=\"container mt-2 mb-5\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.account.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n style=\"font-size: 25px;font-weight: 600;\" (click)=\"backClicked()\"></i>\n <button rlb-button outline size=\"sm\" class=\"position-absolute end-0 top-50 translate-middle-y\"\n (click)=\"updateProfile()\">\n <i class=\"bi bi-floppy\"></i>\n </button>\n </div>\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.username' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.username\" disabled />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.email' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.email\" />\n <rlb-input *ngIf=\"!keyCloakUser\" size=\"small\" type=\"text\" readonly />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.firstName' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.firstName\" />\n <rlb-input *ngIf=\"!keyCloakUser\" size=\"small\" type=\"text\" readonly />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.lastName' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.lastName\" />\n <rlb-input *ngIf=\"!keyCloakUser\" size=\"small\" type=\"text\" readonly />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.logout' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <button size=\"sm\" rlb-button (click)=\"logout()\" class=\"w-100\">\n <i class=\"bi bi-box-arrow-right\"></i>\n {{ 'core.account.logout' | translate}}</button>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n <ng-container *ngIf=\"keyCloakUser\">\n <div class=\"container text-center position-relative mt-5 mb-2\">\n <h3>{{ 'core.account.credentials.title' | translate}}</h3>\n </div>\n <ng-container *ngFor=\"let type of keycloakCredentials\">\n <div class=\"container position-relative my-3\">\n <h6>{{ ('core.account.credentials.'+type?.type) | translate }}</h6>\n <button *ngIf=\"type.type === 'otp'\" rlb-button size=\"sm\"\n class=\"position-absolute end-0 top-50 translate-middle-y\" (click)=\"configureOTP()\">\n {{ 'core.account.credentials.addOTP' | translate}}\n </button>\n </div>\n <rlb-list class=\"settings mb-5\">\n <rlb-list-item class=\"settings-item\" *ngFor=\"let cred of type.userCredentialMetadatas\">\n <div class=\"row\">\n <div class=\"col-12\">\n <dl class=\"row signed-in-device-grid\">\n <div class=\"col-md-1\">\n <i class=\"bi bi-key\" style=\"font-size: 35px;\"></i>\n </div>\n <div class=\"col-md-5\">\n <dt>\n <span class=\"text-muted\">\n {{ 'core.account.credentials.name' | translate }}\n </span>\n </dt>\n <dd>{{cred.credential.userLabel || cred.credential.type}}</dd>\n </div>\n <div class=\"col-md-4\">\n <dt>\n <span class=\"text-muted\">\n {{'core.account.credentials.created' | translate}}\n </span>\n </dt>\n <dd>{{cred.credential.createdDate | date:'dd:MM:yyyy HH:mm' }}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.credentials.actions' |\n translate}}</span></dt>\n <dd>\n <button *ngIf=\"type.removeable\" size=\"sm\" rlb-button class=\"w-100\" color=\"danger\"\n (click)=\"removeCredential(type.type, cred.credential.id)\">\n <i class=\"bi bi-trash\"></i>\n {{ 'core.account.credentials.delete' | translate}}\n </button>\n <button *ngIf=\"!type.removeable\" size=\"sm\" rlb-button class=\"w-100\" outline\n (click)=\"updatePassword()\">\n <i class=\"bi bi-trash\"></i>\n {{ 'core.account.credentials.update' | translate}}\n </button>\n </dd>\n </div>\n </dl>\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item *ngIf=\"type.userCredentialMetadatas.length === 0\">\n <div class=\"d-flex justify-content-center\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.credentials.noCredentials' | translate}}</h6>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n </ng-container>\n <div class=\"container text-center position-relative mt-5 mb-3\">\n <h3>{{ 'core.account.session.title' | translate}}</h3>\n </div>\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\" *ngFor=\"let d of keyCloakDevices\">\n <div class=\"row mb-2\">\n <div class=\"col-1\">\n <i class=\"bi bi-laptop\" style=\"font-size: 35px;\"></i>\n </div>\n <div class=\"col-11\">\n <span class=\"session-title\">{{d.os}} {{d.osVersion}} - {{d.browser}}</span>\n <span *ngIf=\"d.current\" class=\"badge bg-success ms-3\">\n <span class=\"badge-content\">\n {{ 'core.account.session.current' | translate}}\n </span>\n </span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <dl class=\"row signed-in-device-grid\">\n <div class=\" col-md-1\">\n </div>\n <div class=\" col-md-2\">\n <dt><span class=\"text-muted\">{{ 'core.account.session.ip' | translate }}</span>\n </dt>\n <dd>{{d.ipAddress}}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt>\n <span class=\"text-muted\">\n {{'core.account.session.lastAccess' | translate}}\n </span>\n </dt>\n <dd>{{d.lastAccess*1000 | date:'dd/MM/yyyy - HH:mm'}}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.session.applications' |\n translate}}</span></dt>\n <dd>{{d.clientslist }} </dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.session.started' |\n translate}}</span></dt>\n <dd>{{d.started*1000 | date:'dd/MM/yyyy - HH:mm'}}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.session.expires' |\n translate}}</span></dt>\n <dd>{{d.expires*1000 | date:'dd/MM/yyyy - HH:mm'}}</dd>\n </div>\n </dl>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n </ng-container>\n</div>", styles: [".settings .settings-item .settings-control{width:40%}\n"], dependencies: [{ kind: "ngmodule", type: RlbAppModule }, { kind: "component", type: i6.InputComponent, selector: "rlb-input", inputs: ["disabled", "readonly", "before-text", "placeholder", "type", "size", "name", "max", "min", "step", "date-type", "timezone", "id", "extValidation", "enable-validation"] }, { kind: "component", type: i6.ButtonComponent, selector: "button[rlb-button], a[rlb-button]", inputs: ["color", "size", "disabled", "outline", "isLink"] }, { kind: "component", type: i6.ListComponent, selector: "rlb-list", inputs: ["disabled", "numbered", "flush", "horizontal"] }, { kind: "component", type: i6.ListItemComponent, selector: "rlb-list-item", inputs: ["active", "disabled", "action"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1$6.DatePipe, name: "date" }] }); }
|
|
2637
|
+
}
|
|
2638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserAccountComponent, decorators: [{
|
|
2639
|
+
type: Component,
|
|
2640
|
+
args: [{ selector: 'rlb-user-account', imports: [RlbAppModule, CommonModule], template: "<div class=\"container mt-2 mb-5\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.account.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n style=\"font-size: 25px;font-weight: 600;\" (click)=\"backClicked()\"></i>\n <button rlb-button outline size=\"sm\" class=\"position-absolute end-0 top-50 translate-middle-y\"\n (click)=\"updateProfile()\">\n <i class=\"bi bi-floppy\"></i>\n </button>\n </div>\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.username' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.username\" disabled />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.email' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.email\" />\n <rlb-input *ngIf=\"!keyCloakUser\" size=\"small\" type=\"text\" readonly />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.firstName' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.firstName\" />\n <rlb-input *ngIf=\"!keyCloakUser\" size=\"small\" type=\"text\" readonly />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.lastName' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-input *ngIf=\"keyCloakUser\" size=\"small\" type=\"text\" [(ngModel)]=\"keyCloakUser.lastName\" />\n <rlb-input *ngIf=\"!keyCloakUser\" size=\"small\" type=\"text\" readonly />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.logout' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <button size=\"sm\" rlb-button (click)=\"logout()\" class=\"w-100\">\n <i class=\"bi bi-box-arrow-right\"></i>\n {{ 'core.account.logout' | translate}}</button>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n <ng-container *ngIf=\"keyCloakUser\">\n <div class=\"container text-center position-relative mt-5 mb-2\">\n <h3>{{ 'core.account.credentials.title' | translate}}</h3>\n </div>\n <ng-container *ngFor=\"let type of keycloakCredentials\">\n <div class=\"container position-relative my-3\">\n <h6>{{ ('core.account.credentials.'+type?.type) | translate }}</h6>\n <button *ngIf=\"type.type === 'otp'\" rlb-button size=\"sm\"\n class=\"position-absolute end-0 top-50 translate-middle-y\" (click)=\"configureOTP()\">\n {{ 'core.account.credentials.addOTP' | translate}}\n </button>\n </div>\n <rlb-list class=\"settings mb-5\">\n <rlb-list-item class=\"settings-item\" *ngFor=\"let cred of type.userCredentialMetadatas\">\n <div class=\"row\">\n <div class=\"col-12\">\n <dl class=\"row signed-in-device-grid\">\n <div class=\"col-md-1\">\n <i class=\"bi bi-key\" style=\"font-size: 35px;\"></i>\n </div>\n <div class=\"col-md-5\">\n <dt>\n <span class=\"text-muted\">\n {{ 'core.account.credentials.name' | translate }}\n </span>\n </dt>\n <dd>{{cred.credential.userLabel || cred.credential.type}}</dd>\n </div>\n <div class=\"col-md-4\">\n <dt>\n <span class=\"text-muted\">\n {{'core.account.credentials.created' | translate}}\n </span>\n </dt>\n <dd>{{cred.credential.createdDate | date:'dd:MM:yyyy HH:mm' }}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.credentials.actions' |\n translate}}</span></dt>\n <dd>\n <button *ngIf=\"type.removeable\" size=\"sm\" rlb-button class=\"w-100\" color=\"danger\"\n (click)=\"removeCredential(type.type, cred.credential.id)\">\n <i class=\"bi bi-trash\"></i>\n {{ 'core.account.credentials.delete' | translate}}\n </button>\n <button *ngIf=\"!type.removeable\" size=\"sm\" rlb-button class=\"w-100\" outline\n (click)=\"updatePassword()\">\n <i class=\"bi bi-trash\"></i>\n {{ 'core.account.credentials.update' | translate}}\n </button>\n </dd>\n </div>\n </dl>\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item *ngIf=\"type.userCredentialMetadatas.length === 0\">\n <div class=\"d-flex justify-content-center\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.account.credentials.noCredentials' | translate}}</h6>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n </ng-container>\n <div class=\"container text-center position-relative mt-5 mb-3\">\n <h3>{{ 'core.account.session.title' | translate}}</h3>\n </div>\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\" *ngFor=\"let d of keyCloakDevices\">\n <div class=\"row mb-2\">\n <div class=\"col-1\">\n <i class=\"bi bi-laptop\" style=\"font-size: 35px;\"></i>\n </div>\n <div class=\"col-11\">\n <span class=\"session-title\">{{d.os}} {{d.osVersion}} - {{d.browser}}</span>\n <span *ngIf=\"d.current\" class=\"badge bg-success ms-3\">\n <span class=\"badge-content\">\n {{ 'core.account.session.current' | translate}}\n </span>\n </span>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <dl class=\"row signed-in-device-grid\">\n <div class=\" col-md-1\">\n </div>\n <div class=\" col-md-2\">\n <dt><span class=\"text-muted\">{{ 'core.account.session.ip' | translate }}</span>\n </dt>\n <dd>{{d.ipAddress}}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt>\n <span class=\"text-muted\">\n {{'core.account.session.lastAccess' | translate}}\n </span>\n </dt>\n <dd>{{d.lastAccess*1000 | date:'dd/MM/yyyy - HH:mm'}}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.session.applications' |\n translate}}</span></dt>\n <dd>{{d.clientslist }} </dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.session.started' |\n translate}}</span></dt>\n <dd>{{d.started*1000 | date:'dd/MM/yyyy - HH:mm'}}</dd>\n </div>\n <div class=\"col-md-2\">\n <dt><span class=\"text-muted\">{{'core.account.session.expires' |\n translate}}</span></dt>\n <dd>{{d.expires*1000 | date:'dd/MM/yyyy - HH:mm'}}</dd>\n </div>\n </dl>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n </ng-container>\n</div>", styles: [".settings .settings-item .settings-control{width:40%}\n"] }]
|
|
2641
|
+
}], ctorParameters: () => [{ type: i1$6.Location }, { type: i1$1.Store }, { type: KeycloakProfileService }, { type: i6.ModalService }, { type: LanguageService }, { type: AuthenticationService }, { type: i2.Router }] });
|
|
2642
|
+
|
|
2643
|
+
class SettingsCoreComponent {
|
|
2644
|
+
constructor(_location, toastService, languageService, store) {
|
|
2645
|
+
this._location = _location;
|
|
2646
|
+
this.toastService = toastService;
|
|
2647
|
+
this.languageService = languageService;
|
|
2648
|
+
this.store = store;
|
|
2649
|
+
}
|
|
2650
|
+
backClicked() {
|
|
2651
|
+
this._location.back();
|
|
2652
|
+
}
|
|
2653
|
+
get languages() {
|
|
2654
|
+
return this.store.selectSignal(o => o[appContextFeatureKey].supportedLanguages)().map((lang) => {
|
|
2655
|
+
return {
|
|
2656
|
+
value: lang,
|
|
2657
|
+
label: this.languageService.getLanguageName(lang)
|
|
2658
|
+
};
|
|
2659
|
+
});
|
|
2660
|
+
}
|
|
2661
|
+
get currentLanguage() {
|
|
2662
|
+
return this.store.selectSignal(o => o[appContextFeatureKey].language)();
|
|
2663
|
+
}
|
|
2664
|
+
set currentLanguage(value) {
|
|
2665
|
+
this.store.dispatch(AppContextActions.setLanguage({ language: value }));
|
|
2666
|
+
this.toastService.openToast('toast-c-1', 'toast-component', {
|
|
2667
|
+
title: this.languageService.translate('common.saved'),
|
|
2668
|
+
content: this.languageService.translate('common.savedSuccessfully'),
|
|
2669
|
+
type: 'success',
|
|
2670
|
+
ok: this.languageService.translate('ok'),
|
|
2671
|
+
});
|
|
2672
|
+
}
|
|
2673
|
+
get darkMode() {
|
|
2674
|
+
return this.store.selectSignal(o => o[appContextFeatureKey].theme)() === 'dark';
|
|
2675
|
+
}
|
|
2676
|
+
set darkMode(value) {
|
|
2677
|
+
this.store.dispatch(AppContextActions.setTheme({ theme: value ? 'dark' : 'light' }));
|
|
2678
|
+
this.toastService.openToast('toast-c-1', 'toast-component', {
|
|
2679
|
+
title: this.languageService.translate('common.saved'),
|
|
2680
|
+
content: this.languageService.translate('common.savedSuccessfully'),
|
|
2681
|
+
type: 'success',
|
|
2682
|
+
ok: this.languageService.translate('ok'),
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SettingsCoreComponent, deps: [{ token: i1$6.Location }, { token: i6.ToastService }, { token: LanguageService }, { token: i1$1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2686
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: SettingsCoreComponent, isStandalone: true, selector: "rlb-settings-core", ngImport: i0, template: "<div class=\"container mt-2\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.settings.generalTitle' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n (click)=\"backClicked()\" style=\"font-size: 25px;font-weight: 600;\"></i>\n </div>\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.settings.generalTheme' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-switch size=\"small\" [(ngModel)]=\"darkMode\" class=\"mt-2\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.settings.generalLanguage' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-select size=\"small\" [(ngModel)]=\"currentLanguage\">\n <rlb-option *ngFor=\"let l of languages\" [value]=\"l.value\">{{l.label}}</rlb-option>\n </rlb-select>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n</div>\n", styles: [".settings .settings-item .settings-control{width:40%}.settings .settings-item .settings-control ::ng-deep rlb-switch .form-check{display:block;margin-left:auto}\n"], dependencies: [{ kind: "ngmodule", type: RlbAppModule }, { kind: "component", type: i6.SwitchComponent, selector: "rlb-switch", inputs: ["disabled", "readonly", "size", "id"] }, { kind: "component", type: i6.SelectComponent, selector: "rlb-select", inputs: ["placeholder", "size", "disabled", "readonly", "multiple", "display", "id", "enable-validation"] }, { kind: "component", type: i6.OptionComponent, selector: "rlb-option", inputs: ["disabled", "value", "class"] }, { kind: "component", type: i6.ListComponent, selector: "rlb-list", inputs: ["disabled", "numbered", "flush", "horizontal"] }, { kind: "component", type: i6.ListItemComponent, selector: "rlb-list-item", inputs: ["active", "disabled", "action"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }] }); }
|
|
2687
|
+
}
|
|
2688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SettingsCoreComponent, decorators: [{
|
|
2689
|
+
type: Component,
|
|
2690
|
+
args: [{ selector: 'rlb-settings-core', imports: [RlbAppModule, CommonModule], template: "<div class=\"container mt-2\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.settings.generalTitle' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n (click)=\"backClicked()\" style=\"font-size: 25px;font-weight: 600;\"></i>\n </div>\n <rlb-list class=\"settings\">\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.settings.generalTheme' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-switch size=\"small\" [(ngModel)]=\"darkMode\" class=\"mt-2\" />\n </div>\n </div>\n </rlb-list-item>\n <rlb-list-item class=\"settings-item\">\n <div class=\"d-flex justify-content-between\">\n <div class=\"settings-text\">\n <h6 class=\"mt-1\">{{ 'core.settings.generalLanguage' | translate}}</h6>\n </div>\n <div class=\"settings-control\">\n <rlb-select size=\"small\" [(ngModel)]=\"currentLanguage\">\n <rlb-option *ngFor=\"let l of languages\" [value]=\"l.value\">{{l.label}}</rlb-option>\n </rlb-select>\n </div>\n </div>\n </rlb-list-item>\n </rlb-list>\n</div>\n", styles: [".settings .settings-item .settings-control{width:40%}.settings .settings-item .settings-control ::ng-deep rlb-switch .form-check{display:block;margin-left:auto}\n"] }]
|
|
2691
|
+
}], ctorParameters: () => [{ type: i1$6.Location }, { type: i6.ToastService }, { type: LanguageService }, { type: i1$1.Store }] });
|
|
2692
|
+
|
|
2693
|
+
class SettingsListComponent {
|
|
2694
|
+
constructor(_location, appsService, authService, pageOptions) {
|
|
2695
|
+
this._location = _location;
|
|
2696
|
+
this.appsService = appsService;
|
|
2697
|
+
this.authService = authService;
|
|
2698
|
+
this.pageOptions = pageOptions;
|
|
2699
|
+
}
|
|
2700
|
+
get apps() {
|
|
2701
|
+
return this.appsService.apps;
|
|
2702
|
+
}
|
|
2703
|
+
backClicked() {
|
|
2704
|
+
this._location.back();
|
|
2705
|
+
}
|
|
2706
|
+
selectApp(app) {
|
|
2707
|
+
this.appsService.selectApp(app, 'settings');
|
|
2708
|
+
}
|
|
2709
|
+
get pages() {
|
|
2710
|
+
return this.pageOptions;
|
|
2711
|
+
}
|
|
2712
|
+
get auth$() {
|
|
2713
|
+
return this.authService.isAuthenticated$;
|
|
2714
|
+
}
|
|
2715
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SettingsListComponent, deps: [{ token: i1$6.Location }, { token: AppsService }, { token: AuthenticationService }, { token: RLB_CFG_PAGES, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2716
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: SettingsListComponent, isStandalone: true, selector: "rlb-settings-list", ngImport: i0, template: "<div class=\"container mt-2\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.settings.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n (click)=\"backClicked()\" style=\"font-size: 25px;font-weight: 600;\"></i>\n </div>\n <rlb-list>\n <rlb-list-item-image icon=\"bi bi-gear\" [avatar-size]=\"35\" [line-1]=\" 'core.settings.generalTitle' | translate\"\n [routerLink]=\"'/setting/general'\" [line-2]=\" 'core.settings.generalDescription' | translate\">\n </rlb-list-item-image>\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngFor=\"let app of apps\">\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngIf=\"app.settings\">\n <rlb-list-item-image [icon]=\"app.settings.icon\" [avatar-size]=\"35\"\n [line-1]=\"(app.settings.title | translate) + (app.data?.appName ? ' - ' + app.data?.appName : '')\"\n [disabled]=\"!app.enabled && (app.settings.auth && !(auth$ | async))\"\n [line-2]=\"app.settings.description | translate\" (click)=\"selectApp(app)\">\n </rlb-list-item-image>\n </ng-container>\n </ng-container>\n </rlb-list>\n\n <rlb-list class=\"mt-5\" *ngIf=\"pages?.['status']?.path || pages?.['logger']?.path\">\n <rlb-list-item-image icon=\"bi bi-check2-circle\" *ngIf=\"pages?.['status']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.status' | translate\" [routerLink]=\"'/status'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi-file-text\" *ngIf=\"pages?.['logger']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.logger' | translate\" [routerLink]=\"'/logger'\">\n </rlb-list-item-image>\n </rlb-list>\n\n <rlb-list class=\"mt-4\"\n *ngIf=\"pages?.['privacy']?.path || pages?.['cookies']?.path || pages?.['terms']?.path || pages?.['support']?.path\">\n <rlb-list-item-image icon=\"bi bi-shield-check\" *ngIf=\"pages?.['privacy']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.privacy' | translate\" [routerLink]=\"'/privacy'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi bi-cookie\" *ngIf=\"pages?.['cookies']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.cookies' | translate\" [routerLink]=\"'/cookies'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi-vector-pen\" *ngIf=\"pages?.['terms']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.legal' | translate\" [routerLink]=\"'/terms'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi-chat-quote\" *ngIf=\"pages?.['support']?.path\" [avatar-size]=\"18\"\n [line-1]=\" 'core.settings.support' | translate\" [routerLink]=\"'/support'\">\n </rlb-list-item-image>\n </rlb-list>\n</div>", styles: [".settings .settings-item .settings-control{width:40%}\n"], dependencies: [{ kind: "ngmodule", type: RlbAppModule }, { kind: "component", type: i6.ListComponent, selector: "rlb-list", inputs: ["disabled", "numbered", "flush", "horizontal"] }, { kind: "component", type: i6.ListItemImageComponent, selector: "rlb-list-item-image", inputs: ["active", "disabled", "counter-empty", "counter-pill", "counter-border", "avatar-size", "username", "line-1", "line-2", "avatar", "counter", "counter-color", "icon"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1$6.AsyncPipe, name: "async" }] }); }
|
|
2717
|
+
}
|
|
2718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SettingsListComponent, decorators: [{
|
|
2719
|
+
type: Component,
|
|
2720
|
+
args: [{ selector: 'rlb-settings-list', imports: [RlbAppModule, CommonModule], template: "<div class=\"container mt-2\">\n <div class=\"container text-center position-relative my-3\">\n <h3>{{ 'core.settings.title' | translate}}</h3>\n <i role=\"button\" class=\"bi bi-chevron-left position-absolute start-0 top-50 translate-middle-y\"\n (click)=\"backClicked()\" style=\"font-size: 25px;font-weight: 600;\"></i>\n </div>\n <rlb-list>\n <rlb-list-item-image icon=\"bi bi-gear\" [avatar-size]=\"35\" [line-1]=\" 'core.settings.generalTitle' | translate\"\n [routerLink]=\"'/setting/general'\" [line-2]=\" 'core.settings.generalDescription' | translate\">\n </rlb-list-item-image>\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngFor=\"let app of apps\">\n <ng-container ngProjectAs=\"rlb-list-item-image\" *ngIf=\"app.settings\">\n <rlb-list-item-image [icon]=\"app.settings.icon\" [avatar-size]=\"35\"\n [line-1]=\"(app.settings.title | translate) + (app.data?.appName ? ' - ' + app.data?.appName : '')\"\n [disabled]=\"!app.enabled && (app.settings.auth && !(auth$ | async))\"\n [line-2]=\"app.settings.description | translate\" (click)=\"selectApp(app)\">\n </rlb-list-item-image>\n </ng-container>\n </ng-container>\n </rlb-list>\n\n <rlb-list class=\"mt-5\" *ngIf=\"pages?.['status']?.path || pages?.['logger']?.path\">\n <rlb-list-item-image icon=\"bi bi-check2-circle\" *ngIf=\"pages?.['status']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.status' | translate\" [routerLink]=\"'/status'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi-file-text\" *ngIf=\"pages?.['logger']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.logger' | translate\" [routerLink]=\"'/logger'\">\n </rlb-list-item-image>\n </rlb-list>\n\n <rlb-list class=\"mt-4\"\n *ngIf=\"pages?.['privacy']?.path || pages?.['cookies']?.path || pages?.['terms']?.path || pages?.['support']?.path\">\n <rlb-list-item-image icon=\"bi bi-shield-check\" *ngIf=\"pages?.['privacy']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.privacy' | translate\" [routerLink]=\"'/privacy'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi bi-cookie\" *ngIf=\"pages?.['cookies']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.cookies' | translate\" [routerLink]=\"'/cookies'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi-vector-pen\" *ngIf=\"pages?.['terms']?.path\" [avatar-size]=\"18\"\n [line-1]=\"'core.settings.legal' | translate\" [routerLink]=\"'/terms'\">\n </rlb-list-item-image>\n <rlb-list-item-image icon=\"bi bi-chat-quote\" *ngIf=\"pages?.['support']?.path\" [avatar-size]=\"18\"\n [line-1]=\" 'core.settings.support' | translate\" [routerLink]=\"'/support'\">\n </rlb-list-item-image>\n </rlb-list>\n</div>", styles: [".settings .settings-item .settings-control{width:40%}\n"] }]
|
|
2721
|
+
}], ctorParameters: () => [{ type: i1$6.Location }, { type: AppsService }, { type: AuthenticationService }, { type: undefined, decorators: [{
|
|
2722
|
+
type: Inject,
|
|
2723
|
+
args: [RLB_CFG_PAGES]
|
|
2724
|
+
}, {
|
|
2725
|
+
type: Optional
|
|
2726
|
+
}] }] });
|
|
2727
|
+
|
|
2728
|
+
function getDefaultRoutes(config) {
|
|
2729
|
+
const defaultRoutes = DEFAULT_ROUTES_CONFIG
|
|
2730
|
+
.filter(defaultRouteConfig => !defaultRouteConfig.configKey || (config && config[defaultRouteConfig.configKey]))
|
|
2731
|
+
.map(route => {
|
|
2732
|
+
switch (route.path) {
|
|
2733
|
+
case 'setting': return { path: 'setting', component: SettingsListComponent };
|
|
2734
|
+
case 'setting/general': return { path: 'setting/general', component: SettingsCoreComponent };
|
|
2735
|
+
case 'apps': return { path: 'apps', component: AppSelectorComponent };
|
|
2736
|
+
case 'profile': return { path: 'profile', component: UserAccountComponent };
|
|
2737
|
+
case 'content': return { path: 'content', component: CmsContentComponent };
|
|
2738
|
+
case 'cookies': return { path: 'cookies', component: CookiesComponent };
|
|
2739
|
+
case 'notFound': return { path: 'notFound', component: NotFoundComponent };
|
|
2740
|
+
case 'privacy': return { path: 'privacy', component: PrivacyComponent };
|
|
2741
|
+
case 'support': return { path: 'support', component: SupportComponent };
|
|
2742
|
+
case 'terms': return { path: 'terms', component: TermsAndConditionsComponent };
|
|
2743
|
+
default: throw new Error(`No component mapped for route ${route.path}`);
|
|
2744
|
+
}
|
|
2745
|
+
});
|
|
2746
|
+
return defaultRoutes;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
class AppContextEffects {
|
|
2750
|
+
constructor(actions$, languageService, rendererFactory, storage, store, router, loggerService, apps) {
|
|
2751
|
+
this.actions$ = actions$;
|
|
2752
|
+
this.languageService = languageService;
|
|
2753
|
+
this.rendererFactory = rendererFactory;
|
|
2754
|
+
this.storage = storage;
|
|
2755
|
+
this.store = store;
|
|
2756
|
+
this.router = router;
|
|
2757
|
+
this.loggerService = loggerService;
|
|
2758
|
+
this.apps = apps;
|
|
2759
|
+
this.setLanguage$ = createEffect(() => {
|
|
2760
|
+
return this.actions$.pipe(ofType(AppContextActions.setLanguage), tap$1(({ language }) => this.languageService.language = language), tap$1(({ language }) => {
|
|
2761
|
+
this.renderer.setAttribute(document.documentElement, 'lang', language);
|
|
2762
|
+
}), tap$1(({ language }) => { this.storage.writeLocal('locale', language); }), map$1(({ language }) => AppContextActionsInternal.setLanguage({ language })));
|
|
2763
|
+
});
|
|
2764
|
+
this.setLanguages$ = createEffect(() => {
|
|
2765
|
+
return this.actions$.pipe(ofType(AppContextActions.setSupportedLanguages), tap$1(({ supportedLanguages }) => this.languageService.languages = supportedLanguages), map$1(({ supportedLanguages }) => AppContextActionsInternal.setSupportedLanguages({ supportedLanguages })));
|
|
2766
|
+
});
|
|
2767
|
+
this.setTheme$ = createEffect(() => {
|
|
2768
|
+
return this.actions$.pipe(ofType(AppContextActions.setTheme), tap$1(({ theme }) => {
|
|
2769
|
+
this.renderer.setAttribute(document.documentElement, 'data-bs-theme', theme);
|
|
2770
|
+
}), tap$1(({ theme }) => { this.storage.writeLocal('theme', theme); }), map$1(({ theme }) => AppContextActionsInternal.setTheme({ theme })));
|
|
2771
|
+
});
|
|
2772
|
+
this.setApp$ = createEffect(() => {
|
|
2773
|
+
return this.actions$.pipe(ofType(AppContextActions.setCurrentApp), map$1(({ app, mode, url }) => {
|
|
2774
|
+
return AppContextActionsInternal.setCurrentApp({ app, mode, url });
|
|
2775
|
+
}), tap$1(({ app }) => {
|
|
2776
|
+
if (app) {
|
|
2777
|
+
this.logger.warn('setApp$ set c-app-id', app.id);
|
|
2778
|
+
localStorage.setItem('c-app-id', app.id);
|
|
2779
|
+
}
|
|
2780
|
+
else {
|
|
2781
|
+
this.logger.warn('setApp$ remove c-app-id');
|
|
2782
|
+
localStorage.removeItem('c-app-id');
|
|
2783
|
+
}
|
|
2784
|
+
}));
|
|
2785
|
+
});
|
|
2786
|
+
this.logger = this.loggerService.for(this.constructor.name);
|
|
2787
|
+
this.renderer = rendererFactory.createRenderer(null, null);
|
|
2788
|
+
if (this.apps && this.apps.length > 0) {
|
|
2789
|
+
for (const app of this.apps) {
|
|
2790
|
+
store.dispatch(AppContextActionsInternal.addApp({ app: app }));
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppContextEffects, deps: [{ token: i1$8.Actions }, { token: LanguageService }, { token: i0.RendererFactory2 }, { token: AppStorageService }, { token: i1$1.Store }, { token: i2.Router }, { token: AppLoggerService }, { token: RLB_APPS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2795
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppContextEffects }); }
|
|
2796
|
+
}
|
|
2797
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppContextEffects, decorators: [{
|
|
2798
|
+
type: Injectable
|
|
2799
|
+
}], ctorParameters: () => [{ type: i1$8.Actions }, { type: LanguageService }, { type: i0.RendererFactory2 }, { type: AppStorageService }, { type: i1$1.Store }, { type: i2.Router }, { type: AppLoggerService }, { type: undefined, decorators: [{
|
|
2800
|
+
type: Inject,
|
|
2801
|
+
args: [RLB_APPS]
|
|
2802
|
+
}, {
|
|
2803
|
+
type: Optional
|
|
2804
|
+
}] }] });
|
|
2805
|
+
|
|
2806
|
+
const appFeature = createFeature({
|
|
2807
|
+
name: appContextFeatureKey,
|
|
2808
|
+
reducer: createReducer(initialAppContextState, on(AppContextActionsInternal.setCurrentApp, (state, { app, mode, url }) => ({ ...state, currentApp: app ? { ...app, viewMode: mode, navigationUrl: url } : null })), on(AppContextActions.removeApp, (state, { appType }) => ({ ...state, apps: state.apps.filter(a => a.type !== appType) })), on(AppContextActions.finalizeApp, (state, { appType, data, appId }) => {
|
|
2809
|
+
const appsOfType = state.apps.filter(a => a.type === appType);
|
|
2810
|
+
if (appsOfType.length === 0)
|
|
2811
|
+
throw new Error(`App type: ${appType} not found. Cannot finalize app.`);
|
|
2812
|
+
let updatedAppsOfType;
|
|
2813
|
+
if (appsOfType.length === 1 && !appsOfType[0].id) {
|
|
2814
|
+
updatedAppsOfType = [{ ...appsOfType[0], data, id: appId, }];
|
|
2815
|
+
}
|
|
2816
|
+
else {
|
|
2817
|
+
updatedAppsOfType = [...appsOfType, { ...appsOfType[0], data, id: appId, }];
|
|
2818
|
+
}
|
|
2819
|
+
const remainingApps = state.apps.filter(a => a.type !== appType);
|
|
2820
|
+
return { ...state, apps: [...remainingApps, ...updatedAppsOfType], };
|
|
2821
|
+
}), on(AppContextActionsInternal.addApp, (state, { app }) => {
|
|
2822
|
+
if (!app)
|
|
2823
|
+
return state;
|
|
2824
|
+
const apps = state.apps.filter(a => a.type !== app.type);
|
|
2825
|
+
apps.push(app);
|
|
2826
|
+
return { ...state, apps };
|
|
2827
|
+
}), on(AppContextActionsInternal.setLanguage, (state, { language }) => ({ ...state, language })), on(AppContextActionsInternal.setSupportedLanguages, (state, { supportedLanguages }) => ({ ...state, supportedLanguages })), on(AppContextActionsInternal.setTheme, (state, { theme }) => ({ ...state, theme })), on(AppContextActionsInternal.setViewMode, (state, { viewMode }) => ({ ...state, viewMode })))
|
|
2828
|
+
});
|
|
2829
|
+
const appReducer = appFeature.reducer;
|
|
2830
|
+
const { selectAppState, selectApps, selectCurrentApp, selectSupportedLanguages } = appFeature;
|
|
2831
|
+
|
|
2832
|
+
class AuthEffects {
|
|
2833
|
+
constructor(actions$, auth, authConfig) {
|
|
2834
|
+
this.actions$ = actions$;
|
|
2835
|
+
this.auth = auth;
|
|
2836
|
+
this.login$ = createEffect(() => {
|
|
2837
|
+
return this.actions$.pipe(ofType(AuthActions.login), tap$1(() => this.auth.login()), map$1(() => AuthActionsInternal.setLoading({ loading: true })));
|
|
2838
|
+
});
|
|
2839
|
+
this.logout$ = createEffect(() => {
|
|
2840
|
+
return this.actions$.pipe(ofType(AuthActions.logout), switchMap$1(() => this.auth.logout$()), map$1(() => AuthActionsInternal.reset()));
|
|
2841
|
+
});
|
|
2842
|
+
this.setCurrentProvider$ = createEffect(() => {
|
|
2843
|
+
return this.actions$.pipe(ofType(AuthActions.setCurrentProvider), map$1(({ currentProvider }) => AuthActionsInternal.setCurrentProvider({ currentProvider })));
|
|
2844
|
+
});
|
|
2845
|
+
if (authConfig) {
|
|
2846
|
+
auth.checkAuthMultiple().subscribe();
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthEffects, deps: [{ token: i1$8.Actions }, { token: AuthenticationService }, { token: RLB_CFG_AUTH, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2850
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthEffects }); }
|
|
2851
|
+
}
|
|
2852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AuthEffects, decorators: [{
|
|
2853
|
+
type: Injectable
|
|
2854
|
+
}], ctorParameters: () => [{ type: i1$8.Actions }, { type: AuthenticationService }, { type: undefined, decorators: [{
|
|
2855
|
+
type: Inject,
|
|
2856
|
+
args: [RLB_CFG_AUTH]
|
|
2857
|
+
}, {
|
|
2858
|
+
type: Optional
|
|
2859
|
+
}] }] });
|
|
2860
|
+
|
|
2861
|
+
const authsFeature = createFeature({
|
|
2862
|
+
name: authsFeatureKey,
|
|
2863
|
+
reducer: createReducer(initialAuthState, on(AuthActionsInternal.setLoading, (state, action) => ({ ...state, loading: action.loading })), on(AuthActionsInternal.reset, () => ({ ...initialAuthState })), on(AuthActionsInternal.setCurrentProvider, (state, action) => {
|
|
2864
|
+
if (action.currentProvider && state.currentProvider !== action.currentProvider) {
|
|
2865
|
+
return { ...state, currentProvider: action.currentProvider };
|
|
2866
|
+
}
|
|
2867
|
+
return state;
|
|
2868
|
+
}))
|
|
2869
|
+
});
|
|
2870
|
+
const authReducer = authsFeature.reducer;
|
|
2871
|
+
const { selectAuthState, selectCurrentProvider, selectLoading } = authsFeature;
|
|
2872
|
+
|
|
2873
|
+
const navbarsFeature = createFeature({
|
|
2874
|
+
name: navbarsFeatureKey,
|
|
2875
|
+
reducer: createReducer(initialNavbarState, on(NavbarActions.setVisible, (state, { visible }) => ({ ...state, visible })), on(NavbarActions.setSearchVisible, (state, { visible }) => ({ ...state, searchVisible: visible })), on(NavbarActions.setHeader, (state, { header }) => ({ ...state, header })), on(NavbarActions.setSearchText, (state, { text }) => ({ ...state, searchText: text })), on(NavbarActions.setLeftItems, (state, { items }) => ({ ...state, leftItems: items })), on(NavbarActions.setRightItems, (state, { items }) => ({ ...state, rightItems: items })), on(NavbarActions.setLoginVisible, (state, { visible }) => ({ ...state, loginVisible: visible })), on(NavbarActions.setSettingsVisible, (state, { visible }) => ({ ...state, settingsVisible: visible })), on(NavbarActions.setAppsVisible, (state, { visible }) => ({ ...state, appsVisible: visible })), on(NavbarActions.setSeparatorVisible, (state, { visible }) => ({ ...state, separatorVisible: visible })))
|
|
2876
|
+
});
|
|
2877
|
+
const navbarReducer = navbarsFeature.reducer;
|
|
2878
|
+
const { selectNavbarState } = navbarsFeature;
|
|
2879
|
+
|
|
2880
|
+
const sidebarsFeature = createFeature({
|
|
2881
|
+
name: sidebarsFeatureKey,
|
|
2882
|
+
reducer: createReducer(initialSidebarState, on(SidebarActions.setItems, (state, { items }) => ({ ...state, items })), on(SidebarActions.setVisible, (state, { visible }) => ({ ...state, visible })), on(SidebarActions.setLoginVisible, (state, { visible }) => ({ ...state, loginVisible: visible })), on(SidebarActions.setSearchVisible, (state, { visible }) => ({ ...state, searchVisible: visible })), on(SidebarActions.setSettingsVisible, (state, { visible }) => ({ ...state, settingsVisible: visible })), on(SidebarActions.setSearchText, (state, { text }) => ({ ...state, searchText: text })), on(SidebarActions.setAppsVisible, (state, { visible }) => ({ ...state, appsVisible: visible })))
|
|
2883
|
+
});
|
|
2884
|
+
const sidebarReducer = sidebarsFeature.reducer;
|
|
2885
|
+
const { selectSidebarState } = sidebarsFeature;
|
|
2886
|
+
|
|
2887
|
+
class ToastComponent {
|
|
2888
|
+
constructor() {
|
|
2889
|
+
this.valid = true;
|
|
2890
|
+
}
|
|
2891
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2892
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: ToastComponent, isStandalone: true, selector: "ng-component", hostDirectives: [{ directive: i6.ToastDirective, inputs: ["id", "id", "data-instance", "data-instance", "data-options", "data-options"] }], ngImport: i0, template: `
|
|
2893
|
+
<div class="toast-header">
|
|
2894
|
+
<strong class="me-auto">
|
|
2895
|
+
<svg
|
|
2896
|
+
class="bd-placeholder-img rounded me-2"
|
|
2897
|
+
width="20"
|
|
2898
|
+
height="20"
|
|
2899
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2900
|
+
aria-hidden="true"
|
|
2901
|
+
preserveAspectRatio="xMidYMid slice"
|
|
2902
|
+
focusable="false"
|
|
2903
|
+
>
|
|
2904
|
+
<rect width="100%" height="100%" fill="#007aff"></rect>
|
|
2905
|
+
</svg>
|
|
2906
|
+
{{ data.title }}
|
|
2907
|
+
</strong>
|
|
2908
|
+
<small *ngIf="data.subtitle"> {{ data.subtitle }}</small>
|
|
2909
|
+
<button
|
|
2910
|
+
type="button"
|
|
2911
|
+
class="btn-close"
|
|
2912
|
+
data-bs-dismiss="toast"
|
|
2913
|
+
aria-label="Close"
|
|
2914
|
+
></button>
|
|
2915
|
+
</div>
|
|
2916
|
+
<div class="toast-body">{{ data.content }}</div>
|
|
2917
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: RlbAppModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
2918
|
+
}
|
|
2919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ToastComponent, decorators: [{
|
|
2920
|
+
type: Component,
|
|
2921
|
+
args: [{
|
|
2922
|
+
imports: [RlbAppModule, CommonModule],
|
|
2923
|
+
template: `
|
|
2924
|
+
<div class="toast-header">
|
|
2925
|
+
<strong class="me-auto">
|
|
2926
|
+
<svg
|
|
2927
|
+
class="bd-placeholder-img rounded me-2"
|
|
2928
|
+
width="20"
|
|
2929
|
+
height="20"
|
|
2930
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2931
|
+
aria-hidden="true"
|
|
2932
|
+
preserveAspectRatio="xMidYMid slice"
|
|
2933
|
+
focusable="false"
|
|
2934
|
+
>
|
|
2935
|
+
<rect width="100%" height="100%" fill="#007aff"></rect>
|
|
2936
|
+
</svg>
|
|
2937
|
+
{{ data.title }}
|
|
2938
|
+
</strong>
|
|
2939
|
+
<small *ngIf="data.subtitle"> {{ data.subtitle }}</small>
|
|
2940
|
+
<button
|
|
2941
|
+
type="button"
|
|
2942
|
+
class="btn-close"
|
|
2943
|
+
data-bs-dismiss="toast"
|
|
2944
|
+
aria-label="Close"
|
|
2945
|
+
></button>
|
|
2946
|
+
</div>
|
|
2947
|
+
<div class="toast-body">{{ data.content }}</div>
|
|
2948
|
+
`,
|
|
2949
|
+
hostDirectives: [
|
|
2950
|
+
{
|
|
2951
|
+
directive: ToastDirective,
|
|
2952
|
+
inputs: ['id', 'data-instance', 'data-options'],
|
|
2953
|
+
},
|
|
2954
|
+
]
|
|
2955
|
+
}]
|
|
2956
|
+
}] });
|
|
2957
|
+
|
|
2958
|
+
const verifyDeactivate = (component, currentRoute, currentState, nextState) => {
|
|
2959
|
+
return component.verifyDeactivate();
|
|
2960
|
+
};
|
|
2961
|
+
|
|
2962
|
+
function provideRlbConfig(env) {
|
|
2963
|
+
return [
|
|
2964
|
+
provideRlbBootstrap(),
|
|
2965
|
+
RlbAppModule,
|
|
2966
|
+
provideStore(),
|
|
2967
|
+
provideState(authsFeature),
|
|
2968
|
+
provideEffects(AuthEffects),
|
|
2969
|
+
provideState(navbarsFeature),
|
|
2970
|
+
provideState(sidebarsFeature),
|
|
2971
|
+
provideState(appFeature),
|
|
2972
|
+
provideEffects(AppContextEffects),
|
|
2973
|
+
provideRouter(getDefaultRoutes(env.pages)),
|
|
2974
|
+
provideRlbCodeBrowserOAuth(env.auth),
|
|
2975
|
+
provideRlbI18n(env.i18n),
|
|
2976
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
2977
|
+
provideServiceWorker('ngsw-worker.js', {
|
|
2978
|
+
enabled: !isDevMode(),
|
|
2979
|
+
registrationStrategy: 'registerWhenStable:15000',
|
|
2980
|
+
}),
|
|
2981
|
+
{ provide: RLB_CFG, useValue: env },
|
|
2982
|
+
{ provide: RLB_CFG_ENV, useValue: env.environment },
|
|
2983
|
+
{ provide: RLB_CFG_CMS, useValue: env.cms },
|
|
2984
|
+
{ provide: RLB_CFG_PAGES, useValue: env.pages },
|
|
2985
|
+
{ provide: RLB_CFG_I18N, useValue: env.i18n },
|
|
2986
|
+
{
|
|
2987
|
+
provide: ModalRegistryOptions, useValue: {
|
|
2988
|
+
modals: {
|
|
2989
|
+
"modal-apps-component": ModalAppsComponent,
|
|
2990
|
+
'error-modal-component': ErrorModalComponent,
|
|
2991
|
+
}
|
|
2992
|
+
}, multi: true
|
|
2993
|
+
},
|
|
2994
|
+
{
|
|
2995
|
+
provide: ToastRegistryOptions,
|
|
2996
|
+
useValue: {
|
|
2997
|
+
toasts: {
|
|
2998
|
+
'toast-component': ToastComponent,
|
|
2999
|
+
},
|
|
3000
|
+
},
|
|
3001
|
+
multi: true,
|
|
3002
|
+
},
|
|
3003
|
+
];
|
|
3004
|
+
}
|
|
3005
|
+
function provideApp(app) {
|
|
3006
|
+
const routesPaths = app.routes ? flattenRoutes(app.routes) : [];
|
|
3007
|
+
const providers = [{
|
|
3008
|
+
provide: RLB_APPS, useValue: {
|
|
3009
|
+
...app.info,
|
|
3010
|
+
routes: routesPaths,
|
|
3011
|
+
}, multi: true
|
|
3012
|
+
},];
|
|
3013
|
+
if (app.routes) {
|
|
3014
|
+
providers.push(provideRouter(app.routes));
|
|
3015
|
+
}
|
|
3016
|
+
if (app.providers) {
|
|
3017
|
+
providers.push(...app.providers);
|
|
3018
|
+
}
|
|
3019
|
+
return providers;
|
|
3020
|
+
}
|
|
3021
|
+
function flattenRoutes(routes, parentPath = '') {
|
|
3022
|
+
return routes.flatMap(route => {
|
|
3023
|
+
const fullPath = route.path ? `${parentPath}${parentPath && '/'}${route.path}` : parentPath;
|
|
3024
|
+
const childPaths = route.children ? flattenRoutes(route.children, fullPath) : [];
|
|
3025
|
+
return route.path ? [fullPath, ...childPaths] : childPaths;
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
/**
|
|
3030
|
+
* Generated bundle index. Do not edit.
|
|
3031
|
+
*/
|
|
3032
|
+
|
|
3033
|
+
export { AbstractMdService, AbstractSupportService, AppBreadcrumbService, AppContainerComponent, AppContextActions, AppContextActionsInternal, AppLoggerService, AppStorageService, AppTemplateComponent, AppsService, AsMultiPipe, AsSinglePipe, AuthActions, AuthActionsInternal, AuthFeatureService, AuthenticationService, AutolinkPipe, BaseComponent, CmsComponent, CmsPipe, ContentComponent, CookiesService, ErrorManagementService, ErrorModalComponent, KeycloakProfileService, LanguageService, LeftComponentPipe, LocalCacheService, ModalAppsComponent, NavbarActions, NavbarActionsInternal, OauthPasswordService, ParseJwtService, PwaUpdaterService, RLB_APPS, RLB_APP_NAVCOMP, RLB_CFG, RLB_CFG_AUTH, RLB_CFG_CMS, RLB_CFG_ENV, RLB_CFG_I18N, RLB_CFG_PAGES, RightComponentPipe, RlbAppModule, RlbRole, SidebarActions, SidebarActionsInternal, StrapiService, ToastComponent, TokenOauthInterceptor, TranslateBrowserLoader, TruncatePipe, UtilsService, appContextFeatureKey, authsFeatureKey, getDefaultRoutes, initialAppContextState, initialAuthState, initialNavbarState, initialSidebarState, navbarsFeatureKey, oauthGuard, oauthPasswordGuard, provideApp, provideRlbCodeBrowserOAuth, provideRlbConfig, provideRlbI18n, sidebarsFeatureKey, translateBrowserLoaderFactory, verifyDeactivate };
|
|
3034
|
+
//# sourceMappingURL=open-rlb-ng-app.mjs.map
|