@rxap/ngx-user 16.1.0-dev.4 → 16.1.0-dev.6

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.
@@ -1,63 +1,38 @@
1
1
  import { inject, Injectable, } from '@angular/core';
2
- import { DarkModeControllerDisableRemoteMethod } from './openapi/remote-methods/dark-mode-controller-disable.remote-method';
3
- import { DarkModeControllerEnableRemoteMethod } from './openapi/remote-methods/dark-mode-controller-enable.remote-method';
4
- import { DarkModeControllerGetRemoteMethod } from './openapi/remote-methods/dark-mode-controller-get.remote-method';
5
- import { DarkModeControllerToggleRemoteMethod } from './openapi/remote-methods/dark-mode-controller-toggle.remote-method';
6
- import { LanguageControllerGetRemoteMethod } from './openapi/remote-methods/language-controller-get.remote-method';
7
- import { LanguageControllerSetRemoteMethod } from './openapi/remote-methods/language-controller-set.remote-method';
2
+ import { BaseUserSettingsService } from './base-user-settings.service';
8
3
  import { SettingsControllerGetRemoteMethod } from './openapi/remote-methods/settings-controller-get.remote-method';
9
4
  import { SettingsControllerSetRemoteMethod } from './openapi/remote-methods/settings-controller-set.remote-method';
5
+ import { UserSettingsOfflineService } from './user-settings-offline.service';
10
6
  import { UserSettingsDataSource } from './user-settings.data-source';
11
7
  import * as i0 from "@angular/core";
12
- export class UserSettingsService {
8
+ export class UserSettingsService extends BaseUserSettingsService {
13
9
  constructor() {
10
+ super(...arguments);
14
11
  this.userSettingsDataSource = inject(UserSettingsDataSource);
15
12
  this.setUserSettingsMethod = inject(SettingsControllerSetRemoteMethod);
16
13
  this.getUserSettingsMethod = inject(SettingsControllerGetRemoteMethod);
17
- this.getUserSettingsLanguageMethod = inject(LanguageControllerGetRemoteMethod);
18
- this.setUserSettingsLanguageMethod = inject(LanguageControllerSetRemoteMethod);
19
- this.getUserSettingsDarkModeMethod = inject(DarkModeControllerGetRemoteMethod);
20
- this.toggleUserSettingsDarkModeMethod = inject(DarkModeControllerToggleRemoteMethod);
21
- this.disableUserSettingsDarkModeMethod = inject(DarkModeControllerDisableRemoteMethod);
22
- this.enableUserSettingsDarkModeMethod = inject(DarkModeControllerEnableRemoteMethod);
14
+ this.offline = inject(UserSettingsOfflineService);
23
15
  }
24
16
  async set(settings) {
25
- await this.setUserSettingsMethod.call({ requestBody: settings });
17
+ if (!await this.waitUntilAuthenticated()) {
18
+ this.offline.set(settings);
19
+ }
20
+ else {
21
+ await this.setUserSettingsMethod.call({ requestBody: settings });
22
+ }
26
23
  this.userSettingsDataSource.refresh();
27
24
  }
28
25
  async get() {
26
+ if (!await this.waitUntilAuthenticated()) {
27
+ return this.offline.get();
28
+ }
29
29
  return this.getUserSettingsMethod.call();
30
30
  }
31
- async getLanguage() {
32
- return this.getUserSettingsLanguageMethod.call();
33
- }
34
- async setLanguage(language) {
35
- await this.setUserSettingsLanguageMethod.call({ parameters: { language } });
36
- this.userSettingsDataSource.refresh();
37
- }
38
- async getDarkMode() {
39
- return this.getUserSettingsDarkModeMethod.call();
40
- }
41
- async toggleDarkMode() {
42
- const result = await this.toggleUserSettingsDarkModeMethod.call();
43
- this.userSettingsDataSource.refresh();
44
- return result;
45
- }
46
- async disableDarkMode() {
47
- const result = await this.disableUserSettingsDarkModeMethod.call();
48
- this.userSettingsDataSource.refresh();
49
- return result;
50
- }
51
- async enableDarkMode() {
52
- const result = await this.enableUserSettingsDarkModeMethod.call();
53
- this.userSettingsDataSource.refresh();
54
- return result;
55
- }
56
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
57
32
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, providedIn: 'root' }); }
58
33
  }
59
34
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, decorators: [{
60
35
  type: Injectable,
61
36
  args: [{ providedIn: 'root' }]
62
37
  }] });
63
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1zZXR0aW5ncy5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci91c2VyL3NyYy9saWIvdXNlci1zZXR0aW5ncy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxNQUFNLEVBQ04sVUFBVSxHQUNYLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxxQ0FBcUMsRUFBRSxNQUFNLHFFQUFxRSxDQUFDO0FBQzVILE9BQU8sRUFBRSxvQ0FBb0MsRUFBRSxNQUFNLG9FQUFvRSxDQUFDO0FBQzFILE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLGlFQUFpRSxDQUFDO0FBQ3BILE9BQU8sRUFBRSxvQ0FBb0MsRUFBRSxNQUFNLG9FQUFvRSxDQUFDO0FBQzFILE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLGdFQUFnRSxDQUFDO0FBQ25ILE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLGdFQUFnRSxDQUFDO0FBQ25ILE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLGdFQUFnRSxDQUFDO0FBQ25ILE9BQU8sRUFBRSxpQ0FBaUMsRUFBRSxNQUFNLGdFQUFnRSxDQUFDO0FBR25ILE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDZCQUE2QixDQUFDOztBQUdyRSxNQUFNLE9BQU8sbUJBQW1CO0lBRGhDO1FBR3FCL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xuICBwcm90ZWN0ZWQgcmVhZG9ubHkgc2V0VXNlclNldHRpbmdzTWV0aG9kID0gaW5qZWN0KFNldHRpbmdzQ29udHJvbGxlclNldFJlbW90ZU1ldGhvZCk7XG4gIHByb3RlY3RlZCByZWFkb25seSBnZXRVc2VyU2V0dGluZ3NNZXRob2QgPSBpbmplY3QoU2V0dGluZ3NDb250cm9sbGVyR2V0UmVtb3RlTWV0aG9kKTtcblxuICBwcm90ZWN0ZWQgcmVhZG9ubHkgb2ZmbGluZSA9IGluamVjdChVc2VyU2V0dGluZ3NPZmZsaW5lU2VydmljZSk7XG5cbiAgYXN5bmMgc2V0KHNldHRpbmdzOiBVc2VyU2V0dGluZ3M8VVM+KTogUHJvbWlzZTx2b2lkPiB7XG4gICAgaWYgKCFhd2FpdCB0aGlzLndhaXRVbnRpbEF1dGhlbnRpY2F0ZWQoKSkge1xuICAgICAgdGhpcy5vZmZsaW5lLnNldChzZXR0aW5ncyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGF3YWl0IHRoaXMuc2V0VXNlclNldHRpbmdzTWV0aG9kLmNhbGwoeyByZXF1ZXN0Qm9keTogc2V0dGluZ3MgfSk7XG4gICAgfVxuICAgIHRoaXMudXNlclNldHRpbmdzRGF0YVNvdXJjZS5yZWZyZXNoKCk7XG4gIH1cblxuICBhc3luYyBnZXQoKTogUHJvbWlzZTxVc2VyU2V0dGluZ3M8VVM+PiB7XG4gICAgaWYgKCFhd2FpdCB0aGlzLndhaXRVbnRpbEF1dGhlbnRpY2F0ZWQoKSkge1xuICAgICAgcmV0dXJuIHRoaXMub2ZmbGluZS5nZXQoKTtcbiAgICB9XG4gICAgcmV0dXJuIHRoaXMuZ2V0VXNlclNldHRpbmdzTWV0aG9kLmNhbGwoKTtcbiAgfVxuXG59XG4iXX0=
@@ -1,9 +1,11 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, Inject, inject } from '@angular/core';
3
+ import { Injectable, inject, Inject, LOCALE_ID } from '@angular/core';
4
4
  import { OpenApiRemoteMethod, RxapOpenApiRemoteMethod } from '@rxap/open-api/remote-method';
5
+ import { RxapAuthenticationService } from '@rxap/authentication';
6
+ import { firstValueFrom, filter, timeout, of, BehaviorSubject, map, Subscription, debounceTime, tap } from 'rxjs';
5
7
  import { MethodDataSource, RxapDataSource, PipeDataSource, RxapPipeDataSource } from '@rxap/data-source';
6
- import { map, Subscription, debounceTime, tap } from 'rxjs';
8
+ import { clone, deepMerge } from '@rxap/utilities';
7
9
  import { PubSubService } from '@rxap/ngx-pub-sub';
8
10
 
9
11
  let DarkModeControllerDisableRemoteMethod = class DarkModeControllerDisableRemoteMethod extends OpenApiRemoteMethod {
@@ -1145,9 +1147,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
1145
1147
  }]
1146
1148
  }] });
1147
1149
 
1150
+ class BaseUserSettingsService {
1151
+ constructor() {
1152
+ this.auth = inject(RxapAuthenticationService);
1153
+ this.waitForAuthenticationTimeout = 10000;
1154
+ }
1155
+ waitUntilAuthenticated() {
1156
+ return firstValueFrom(this.auth.isAuthenticated$.pipe(filter((isAuthenticated) => isAuthenticated === true), timeout({ each: this.waitForAuthenticationTimeout, with: () => of(false) })));
1157
+ }
1158
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: BaseUserSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1159
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: BaseUserSettingsService }); }
1160
+ }
1161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: BaseUserSettingsService, decorators: [{
1162
+ type: Injectable
1163
+ }] });
1164
+
1148
1165
  let UserProfileDataSource = class UserProfileDataSource extends MethodDataSource {
1149
1166
  constructor(method) {
1150
1167
  super(method, true);
1168
+ this.auth = inject(RxapAuthenticationService);
1169
+ this.waitForAuthenticationTimeout = 10000;
1170
+ }
1171
+ waitUntilAuthenticated() {
1172
+ return firstValueFrom(this.auth.isAuthenticated$.pipe(filter((isAuthenticated) => isAuthenticated === true), timeout({ each: this.waitForAuthenticationTimeout, with: () => of(false) })));
1173
+ }
1174
+ async execute(parameters) {
1175
+ if (await this.waitUntilAuthenticated()) {
1176
+ return super.execute(parameters);
1177
+ }
1178
+ return {};
1151
1179
  }
1152
1180
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserProfileDataSource, deps: [{ token: ProfileControllerGetRemoteMethod }], target: i0.ɵɵFactoryTarget.Injectable }); }
1153
1181
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserProfileDataSource, providedIn: 'root' }); }
@@ -1164,9 +1192,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
1164
1192
  args: [ProfileControllerGetRemoteMethod]
1165
1193
  }] }]; } });
1166
1194
 
1195
+ class UserSettingsOfflineService {
1196
+ constructor() {
1197
+ this.userSettings$ = new BehaviorSubject({
1198
+ darkMode: false,
1199
+ language: inject(LOCALE_ID),
1200
+ theme: {
1201
+ preset: 'default',
1202
+ },
1203
+ });
1204
+ }
1205
+ get() {
1206
+ return clone(this.userSettings$.value);
1207
+ }
1208
+ set(settings) {
1209
+ this.userSettings$.next(settings);
1210
+ }
1211
+ update(settings) {
1212
+ this.userSettings$.next(deepMerge(this.userSettings$.value, settings));
1213
+ }
1214
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsOfflineService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1215
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsOfflineService, providedIn: 'root' }); }
1216
+ }
1217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsOfflineService, decorators: [{
1218
+ type: Injectable,
1219
+ args: [{ providedIn: 'root' }]
1220
+ }] });
1221
+
1167
1222
  let UserSettingsDataSource = class UserSettingsDataSource extends MethodDataSource {
1168
1223
  constructor(method) {
1169
1224
  super(method, true);
1225
+ this.auth = inject(RxapAuthenticationService);
1226
+ this.offline = inject(UserSettingsOfflineService);
1227
+ this.waitForAuthenticationTimeout = 10000;
1228
+ }
1229
+ waitUntilAuthenticated() {
1230
+ return firstValueFrom(this.auth.isAuthenticated$.pipe(filter((isAuthenticated) => isAuthenticated === true), timeout({ each: this.waitForAuthenticationTimeout, with: () => of(false) })));
1231
+ }
1232
+ async execute(parameters) {
1233
+ if (await this.waitUntilAuthenticated()) {
1234
+ return super.execute(parameters);
1235
+ }
1236
+ return this.offline.get();
1170
1237
  }
1171
1238
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsDataSource, deps: [{ token: SettingsControllerGetRemoteMethod }], target: i0.ɵɵFactoryTarget.Injectable }); }
1172
1239
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsDataSource, providedIn: 'root' }); }
@@ -1208,6 +1275,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
1208
1275
  args: [UserSettingsDataSource]
1209
1276
  }] }]; } });
1210
1277
 
1278
+ class UserSettingsDarkModeService extends BaseUserSettingsService {
1279
+ constructor() {
1280
+ super(...arguments);
1281
+ this.getUserSettingsDarkModeMethod = inject(DarkModeControllerGetRemoteMethod);
1282
+ this.toggleUserSettingsDarkModeMethod = inject(DarkModeControllerToggleRemoteMethod);
1283
+ this.disableUserSettingsDarkModeMethod = inject(DarkModeControllerDisableRemoteMethod);
1284
+ this.enableUserSettingsDarkModeMethod = inject(DarkModeControllerEnableRemoteMethod);
1285
+ this.userSettingsDarkModeDataSource = inject(UserSettingsDarkModeDataSource);
1286
+ this.offline = inject(UserSettingsOfflineService);
1287
+ }
1288
+ async getDarkMode() {
1289
+ if (!await this.waitUntilAuthenticated()) {
1290
+ return this.offline.get().darkMode;
1291
+ }
1292
+ return this.getUserSettingsDarkModeMethod.call();
1293
+ }
1294
+ async toggleDarkMode() {
1295
+ if (!await this.waitUntilAuthenticated()) {
1296
+ const settings = this.offline.get();
1297
+ settings.darkMode = !settings.darkMode;
1298
+ this.offline.set(settings);
1299
+ }
1300
+ else {
1301
+ await this.toggleUserSettingsDarkModeMethod.call();
1302
+ }
1303
+ this.userSettingsDarkModeDataSource.refresh();
1304
+ }
1305
+ async disableDarkMode() {
1306
+ if (!await this.waitUntilAuthenticated()) {
1307
+ const settings = this.offline.get();
1308
+ settings.darkMode = false;
1309
+ this.offline.set(settings);
1310
+ }
1311
+ else {
1312
+ await this.disableUserSettingsDarkModeMethod.call();
1313
+ }
1314
+ this.userSettingsDarkModeDataSource.refresh();
1315
+ }
1316
+ async enableDarkMode() {
1317
+ if (!await this.waitUntilAuthenticated()) {
1318
+ const settings = this.offline.get();
1319
+ settings.darkMode = true;
1320
+ this.offline.set(settings);
1321
+ }
1322
+ else {
1323
+ await this.enableUserSettingsDarkModeMethod.call();
1324
+ }
1325
+ this.userSettingsDarkModeDataSource.refresh();
1326
+ }
1327
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsDarkModeService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1328
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsDarkModeService, providedIn: 'root' }); }
1329
+ }
1330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsDarkModeService, decorators: [{
1331
+ type: Injectable,
1332
+ args: [{ providedIn: 'root' }]
1333
+ }] });
1334
+
1211
1335
  let UserSettingsLanguageDataSource = class UserSettingsLanguageDataSource extends PipeDataSource {
1212
1336
  constructor(dataSource) {
1213
1337
  super(dataSource, map((settings) => settings.language));
@@ -1230,20 +1354,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
1230
1354
  args: [UserSettingsDataSource]
1231
1355
  }] }]; } });
1232
1356
 
1233
- class UserSettingsLanguageService {
1357
+ class UserSettingsLanguageService extends BaseUserSettingsService {
1234
1358
  constructor() {
1359
+ super(...arguments);
1235
1360
  this.userSettingsLanguageDataSource = inject(UserSettingsLanguageDataSource);
1236
1361
  this.getUserSettingsLanguageMethod = inject(LanguageControllerGetRemoteMethod);
1237
1362
  this.setUserSettingsLanguageMethod = inject(LanguageControllerSetRemoteMethod);
1363
+ this.offline = inject(UserSettingsOfflineService);
1238
1364
  }
1239
1365
  async getLanguage() {
1366
+ if (!await this.waitUntilAuthenticated()) {
1367
+ return this.offline.get().language;
1368
+ }
1240
1369
  return this.getUserSettingsLanguageMethod.call();
1241
1370
  }
1242
1371
  async setLanguage(language) {
1243
- await this.setUserSettingsLanguageMethod.call({ parameters: { language } });
1372
+ if (!await this.waitUntilAuthenticated()) {
1373
+ const settings = this.offline.get();
1374
+ settings.language = language;
1375
+ this.offline.set(settings);
1376
+ }
1377
+ else {
1378
+ await this.setUserSettingsLanguageMethod.call({ parameters: { language } });
1379
+ }
1244
1380
  this.userSettingsLanguageDataSource.refresh();
1245
1381
  }
1246
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsLanguageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1382
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsLanguageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1247
1383
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsLanguageService, providedIn: 'root' }); }
1248
1384
  }
1249
1385
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsLanguageService, decorators: [{
@@ -1283,8 +1419,9 @@ var ThemeDensity;
1283
1419
  function IsThemeDensity(value) {
1284
1420
  return Object.values(ThemeDensity).includes(value);
1285
1421
  }
1286
- class UserSettingsThemeService {
1422
+ class UserSettingsThemeService extends BaseUserSettingsService {
1287
1423
  constructor() {
1424
+ super(...arguments);
1288
1425
  this.getThemeMethod = inject(ThemeControllerGetRemoteMethod);
1289
1426
  this.setThemeMethod = inject(ThemeControllerSetRemoteMethod);
1290
1427
  this.setDensityMethod = inject(ThemeControllerSetDensityRemoteMethod);
@@ -1292,27 +1429,61 @@ class UserSettingsThemeService {
1292
1429
  this.setTypographyMethod = inject(ThemeControllerSetTypographyRemoteMethod);
1293
1430
  this.userSettingsThemeDataSource = inject(UserSettingsThemeDataSource);
1294
1431
  this.pubSub = inject(PubSubService);
1432
+ this.offline = inject(UserSettingsOfflineService);
1295
1433
  }
1296
1434
  async get() {
1435
+ if (!await this.waitUntilAuthenticated()) {
1436
+ return this.offline.get().theme;
1437
+ }
1297
1438
  return this.getThemeMethod.call();
1298
1439
  }
1299
1440
  async set(themeSettings) {
1441
+ if (!await this.waitUntilAuthenticated()) {
1442
+ const settings = this.offline.get();
1443
+ settings.theme = themeSettings;
1444
+ this.offline.set(settings);
1445
+ return;
1446
+ }
1300
1447
  await this.setThemeMethod.call({ requestBody: themeSettings });
1301
1448
  this.userSettingsThemeDataSource.refresh();
1302
1449
  }
1303
1450
  async setDensity(density) {
1304
- await this.setDensityMethod.call({ requestBody: { value: density } });
1451
+ if (!await this.waitUntilAuthenticated()) {
1452
+ const settings = this.offline.get();
1453
+ settings.theme.density = density;
1454
+ this.offline.set(settings);
1455
+ }
1456
+ else {
1457
+ await this.setDensityMethod.call({ requestBody: { value: density } });
1458
+ }
1305
1459
  this.userSettingsThemeDataSource.refresh();
1306
1460
  }
1307
1461
  async setPreset(preset) {
1308
- await this.setPresetMethod.call({ requestBody: { value: preset } });
1462
+ if (!await this.waitUntilAuthenticated()) {
1463
+ const settings = this.offline.get();
1464
+ settings.theme.preset = preset;
1465
+ this.offline.set(settings);
1466
+ }
1467
+ else {
1468
+ await this.setPresetMethod.call({ requestBody: { value: preset } });
1469
+ }
1309
1470
  this.userSettingsThemeDataSource.refresh();
1310
1471
  }
1311
1472
  async setTypography(typography) {
1312
- await this.setTypographyMethod.call({ requestBody: { value: typography } });
1473
+ if (!await this.waitUntilAuthenticated()) {
1474
+ const settings = this.offline.get();
1475
+ settings.theme.typography = typography;
1476
+ this.offline.set(settings);
1477
+ }
1478
+ else {
1479
+ await this.setTypographyMethod.call({ requestBody: { value: typography } });
1480
+ }
1313
1481
  this.userSettingsThemeDataSource.refresh();
1314
1482
  }
1315
- startSync() {
1483
+ async startSync() {
1484
+ if (!await this.waitUntilAuthenticated()) {
1485
+ return;
1486
+ }
1316
1487
  if (this.syncSubscription) {
1317
1488
  return;
1318
1489
  }
@@ -1336,7 +1507,7 @@ class UserSettingsThemeService {
1336
1507
  stopSync() {
1337
1508
  this.syncSubscription?.unsubscribe();
1338
1509
  }
1339
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1510
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsThemeService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1340
1511
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsThemeService, providedIn: 'root' }); }
1341
1512
  }
1342
1513
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsThemeService, decorators: [{
@@ -1344,51 +1515,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
1344
1515
  args: [{ providedIn: 'root' }]
1345
1516
  }] });
1346
1517
 
1347
- class UserSettingsService {
1518
+ class UserSettingsService extends BaseUserSettingsService {
1348
1519
  constructor() {
1520
+ super(...arguments);
1349
1521
  this.userSettingsDataSource = inject(UserSettingsDataSource);
1350
1522
  this.setUserSettingsMethod = inject(SettingsControllerSetRemoteMethod);
1351
1523
  this.getUserSettingsMethod = inject(SettingsControllerGetRemoteMethod);
1352
- this.getUserSettingsLanguageMethod = inject(LanguageControllerGetRemoteMethod);
1353
- this.setUserSettingsLanguageMethod = inject(LanguageControllerSetRemoteMethod);
1354
- this.getUserSettingsDarkModeMethod = inject(DarkModeControllerGetRemoteMethod);
1355
- this.toggleUserSettingsDarkModeMethod = inject(DarkModeControllerToggleRemoteMethod);
1356
- this.disableUserSettingsDarkModeMethod = inject(DarkModeControllerDisableRemoteMethod);
1357
- this.enableUserSettingsDarkModeMethod = inject(DarkModeControllerEnableRemoteMethod);
1524
+ this.offline = inject(UserSettingsOfflineService);
1358
1525
  }
1359
1526
  async set(settings) {
1360
- await this.setUserSettingsMethod.call({ requestBody: settings });
1527
+ if (!await this.waitUntilAuthenticated()) {
1528
+ this.offline.set(settings);
1529
+ }
1530
+ else {
1531
+ await this.setUserSettingsMethod.call({ requestBody: settings });
1532
+ }
1361
1533
  this.userSettingsDataSource.refresh();
1362
1534
  }
1363
1535
  async get() {
1536
+ if (!await this.waitUntilAuthenticated()) {
1537
+ return this.offline.get();
1538
+ }
1364
1539
  return this.getUserSettingsMethod.call();
1365
1540
  }
1366
- async getLanguage() {
1367
- return this.getUserSettingsLanguageMethod.call();
1368
- }
1369
- async setLanguage(language) {
1370
- await this.setUserSettingsLanguageMethod.call({ parameters: { language } });
1371
- this.userSettingsDataSource.refresh();
1372
- }
1373
- async getDarkMode() {
1374
- return this.getUserSettingsDarkModeMethod.call();
1375
- }
1376
- async toggleDarkMode() {
1377
- const result = await this.toggleUserSettingsDarkModeMethod.call();
1378
- this.userSettingsDataSource.refresh();
1379
- return result;
1380
- }
1381
- async disableDarkMode() {
1382
- const result = await this.disableUserSettingsDarkModeMethod.call();
1383
- this.userSettingsDataSource.refresh();
1384
- return result;
1385
- }
1386
- async enableDarkMode() {
1387
- const result = await this.enableUserSettingsDarkModeMethod.call();
1388
- this.userSettingsDataSource.refresh();
1389
- return result;
1390
- }
1391
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1541
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1392
1542
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, providedIn: 'root' }); }
1393
1543
  }
1394
1544
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UserSettingsService, decorators: [{
@@ -1403,5 +1553,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
1403
1553
  * Generated bundle index. Do not edit.
1404
1554
  */
1405
1555
 
1406
- export { DarkModeControllerDisableRemoteMethod, DarkModeControllerEnableRemoteMethod, DarkModeControllerGetRemoteMethod, DarkModeControllerToggleRemoteMethod, IsThemeDensity, LanguageControllerGetRemoteMethod, LanguageControllerSetRemoteMethod, ProfileControllerGetRemoteMethod, SettingsControllerClearPropertyRemoteMethod, SettingsControllerDecrementPropertyRemoteMethod, SettingsControllerGetPropertyRemoteMethod, SettingsControllerGetRemoteMethod, SettingsControllerIncrementPropertyRemoteMethod, SettingsControllerPopPropertyRemoteMethod, SettingsControllerPushPropertyRemoteMethod, SettingsControllerRemoveAtPropertyRemoteMethod, SettingsControllerRemovePropertyRemoteMethod, SettingsControllerSetPropertyRemoteMethod, SettingsControllerSetRemoteMethod, SettingsControllerShiftPropertyRemoteMethod, SettingsControllerTogglePropertyRemoteMethod, SettingsControllerUnshiftPropertyRemoteMethod, ThemeControllerGetRemoteMethod, ThemeControllerSetDensityRemoteMethod, ThemeControllerSetPresetRemoteMethod, ThemeControllerSetRemoteMethod, ThemeControllerSetTypographyRemoteMethod, ThemeDensity, UserProfileDataSource, UserSettingsDarkModeDataSource, UserSettingsDataSource, UserSettingsLanguageDataSource, UserSettingsLanguageService, UserSettingsService, UserSettingsThemeDataSource, UserSettingsThemeService };
1556
+ export { BaseUserSettingsService, DarkModeControllerDisableRemoteMethod, DarkModeControllerEnableRemoteMethod, DarkModeControllerGetRemoteMethod, DarkModeControllerToggleRemoteMethod, IsThemeDensity, LanguageControllerGetRemoteMethod, LanguageControllerSetRemoteMethod, ProfileControllerGetRemoteMethod, SettingsControllerClearPropertyRemoteMethod, SettingsControllerDecrementPropertyRemoteMethod, SettingsControllerGetPropertyRemoteMethod, SettingsControllerGetRemoteMethod, SettingsControllerIncrementPropertyRemoteMethod, SettingsControllerPopPropertyRemoteMethod, SettingsControllerPushPropertyRemoteMethod, SettingsControllerRemoveAtPropertyRemoteMethod, SettingsControllerRemovePropertyRemoteMethod, SettingsControllerSetPropertyRemoteMethod, SettingsControllerSetRemoteMethod, SettingsControllerShiftPropertyRemoteMethod, SettingsControllerTogglePropertyRemoteMethod, SettingsControllerUnshiftPropertyRemoteMethod, ThemeControllerGetRemoteMethod, ThemeControllerSetDensityRemoteMethod, ThemeControllerSetPresetRemoteMethod, ThemeControllerSetRemoteMethod, ThemeControllerSetTypographyRemoteMethod, ThemeDensity, UserProfileDataSource, UserSettingsDarkModeDataSource, UserSettingsDarkModeService, UserSettingsDataSource, UserSettingsLanguageDataSource, UserSettingsLanguageService, UserSettingsOfflineService, UserSettingsService, UserSettingsThemeDataSource, UserSettingsThemeService };
1407
1557
  //# sourceMappingURL=rxap-ngx-user.mjs.map