@dereekb/dbx-firebase 5.0.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/_index.scss +4 -4
  2. package/esm2020/lib/auth/appcheck/appcheck.interceptor.mjs +80 -0
  3. package/esm2020/lib/auth/appcheck/appcheck.mjs +11 -0
  4. package/esm2020/lib/auth/appcheck/index.mjs +3 -0
  5. package/esm2020/lib/auth/auth.mjs +1 -1
  6. package/esm2020/lib/auth/error.mjs +1 -1
  7. package/esm2020/lib/auth/firebase.auth.module.mjs +1 -1
  8. package/esm2020/lib/auth/index.mjs +2 -1
  9. package/esm2020/lib/auth/login/firebase.login.module.mjs +49 -57
  10. package/esm2020/lib/auth/login/login.anonymous.component.mjs +3 -3
  11. package/esm2020/lib/auth/login/login.apple.component.mjs +3 -3
  12. package/esm2020/lib/auth/login/login.button.component.mjs +34 -36
  13. package/esm2020/lib/auth/login/login.component.mjs +3 -3
  14. package/esm2020/lib/auth/login/login.context.back.component.mjs +4 -4
  15. package/esm2020/lib/auth/login/login.context.directive.mjs +13 -9
  16. package/esm2020/lib/auth/login/login.context.mjs +2 -2
  17. package/esm2020/lib/auth/login/login.email.component.mjs +4 -4
  18. package/esm2020/lib/auth/login/login.email.content.component.mjs +4 -4
  19. package/esm2020/lib/auth/login/login.email.form.component.mjs +11 -7
  20. package/esm2020/lib/auth/login/login.email.recovery.form.component.mjs +9 -5
  21. package/esm2020/lib/auth/login/login.facebook.component.mjs +3 -3
  22. package/esm2020/lib/auth/login/login.github.component.mjs +3 -3
  23. package/esm2020/lib/auth/login/login.google.component.mjs +3 -3
  24. package/esm2020/lib/auth/login/login.list.component.mjs +11 -13
  25. package/esm2020/lib/auth/login/login.microsoft.component.mjs +3 -3
  26. package/esm2020/lib/auth/login/login.mjs +1 -1
  27. package/esm2020/lib/auth/login/login.password.mjs +1 -1
  28. package/esm2020/lib/auth/login/login.service.mjs +8 -8
  29. package/esm2020/lib/auth/login/login.terms.component.mjs +10 -6
  30. package/esm2020/lib/auth/login/login.terms.mjs +1 -1
  31. package/esm2020/lib/auth/login/login.terms.simple.component.mjs +12 -12
  32. package/esm2020/lib/auth/login/login.twitter.component.mjs +3 -3
  33. package/esm2020/lib/auth/login/register.component.mjs +8 -4
  34. package/esm2020/lib/auth/login/register.email.component.mjs +4 -4
  35. package/esm2020/lib/auth/service/firebase.auth.rxjs.mjs +3 -3
  36. package/esm2020/lib/auth/service/firebase.auth.service.mjs +12 -12
  37. package/esm2020/lib/firebase/appcheck.mjs +2 -0
  38. package/esm2020/lib/firebase/emulators.mjs +1 -1
  39. package/esm2020/lib/firebase/firebase.emulator.module.mjs +6 -4
  40. package/esm2020/lib/firebase/firebase.module.mjs +106 -13
  41. package/esm2020/lib/firebase/index.mjs +2 -1
  42. package/esm2020/lib/firebase/options.mjs +3 -2
  43. package/esm2020/lib/firestore/firebase.firestore.context.service.mjs +1 -1
  44. package/esm2020/lib/firestore/firebase.firestore.module.mjs +11 -8
  45. package/esm2020/lib/function/firebase.function.module.mjs +8 -6
  46. package/esm2020/lib/model/error.mjs +2 -2
  47. package/esm2020/lib/model/loader/collection.loader.instance.mjs +9 -10
  48. package/esm2020/lib/model/loader/collection.loader.mjs +1 -1
  49. package/esm2020/lib/model/model.module.mjs +4 -6
  50. package/esm2020/lib/model/store/index.mjs +2 -1
  51. package/esm2020/lib/model/store/model.store.module.mjs +10 -30
  52. package/esm2020/lib/model/store/store.collection.change.directive.mjs +6 -4
  53. package/esm2020/lib/model/store/store.collection.change.if.directive.mjs +1 -1
  54. package/esm2020/lib/model/store/store.collection.directive.mjs +5 -3
  55. package/esm2020/lib/model/store/store.collection.list.directive.mjs +2 -2
  56. package/esm2020/lib/model/store/store.collection.mjs +8 -8
  57. package/esm2020/lib/model/store/store.document.auth.directive.mjs +4 -4
  58. package/esm2020/lib/model/store/store.document.directive.mjs +5 -3
  59. package/esm2020/lib/model/store/store.document.mjs +12 -12
  60. package/esm2020/lib/model/store/store.document.router.directive.mjs +1 -1
  61. package/esm2020/lib/model/store/store.subcollection.directive.mjs +30 -0
  62. package/esm2020/lib/model/store/store.subcollection.document.mjs +23 -6
  63. package/esm2020/lib/model/store/store.subcollection.mjs +53 -11
  64. package/esm2020/lib/model/store/store.subcollection.rxjs.mjs +4 -23
  65. package/esm2020/lib/module.mjs +4 -6
  66. package/fesm2015/dereekb-dbx-firebase.mjs +509 -263
  67. package/fesm2015/dereekb-dbx-firebase.mjs.map +1 -1
  68. package/fesm2020/dereekb-dbx-firebase.mjs +501 -263
  69. package/fesm2020/dereekb-dbx-firebase.mjs.map +1 -1
  70. package/lib/auth/appcheck/appcheck.d.ts +8 -0
  71. package/lib/auth/appcheck/appcheck.interceptor.d.ts +19 -0
  72. package/lib/auth/appcheck/index.d.ts +2 -0
  73. package/lib/auth/auth.d.ts +1 -1
  74. package/lib/auth/error.d.ts +1 -1
  75. package/lib/auth/index.d.ts +1 -0
  76. package/lib/auth/login/_login.scss +5 -5
  77. package/lib/auth/login/login.anonymous.component.d.ts +1 -1
  78. package/lib/auth/login/login.apple.component.d.ts +1 -1
  79. package/lib/auth/login/login.button.component.d.ts +5 -5
  80. package/lib/auth/login/login.context.back.component.d.ts +1 -1
  81. package/lib/auth/login/login.context.d.ts +1 -1
  82. package/lib/auth/login/login.context.directive.d.ts +2 -2
  83. package/lib/auth/login/login.email.component.d.ts +1 -1
  84. package/lib/auth/login/login.email.content.component.d.ts +2 -2
  85. package/lib/auth/login/login.email.form.component.d.ts +6 -6
  86. package/lib/auth/login/login.email.recovery.form.component.d.ts +2 -2
  87. package/lib/auth/login/login.facebook.component.d.ts +1 -1
  88. package/lib/auth/login/login.github.component.d.ts +1 -1
  89. package/lib/auth/login/login.google.component.d.ts +1 -1
  90. package/lib/auth/login/login.list.component.d.ts +1 -1
  91. package/lib/auth/login/login.microsoft.component.d.ts +1 -1
  92. package/lib/auth/login/login.password.d.ts +1 -1
  93. package/lib/auth/login/login.service.d.ts +4 -4
  94. package/lib/auth/login/login.terms.component.d.ts +1 -1
  95. package/lib/auth/login/login.twitter.component.d.ts +1 -1
  96. package/lib/auth/login/register.email.component.d.ts +1 -1
  97. package/lib/auth/service/firebase.auth.rxjs.d.ts +1 -1
  98. package/lib/auth/service/firebase.auth.service.d.ts +3 -3
  99. package/lib/firebase/appcheck.d.ts +21 -0
  100. package/lib/firebase/firebase.module.d.ts +20 -10
  101. package/lib/firebase/index.d.ts +1 -0
  102. package/lib/firebase/options.d.ts +10 -3
  103. package/lib/firestore/firebase.firestore.module.d.ts +3 -3
  104. package/lib/function/firebase.function.module.d.ts +4 -4
  105. package/lib/model/loader/collection.loader.d.ts +4 -4
  106. package/lib/model/loader/collection.loader.instance.d.ts +8 -8
  107. package/lib/model/store/index.d.ts +1 -0
  108. package/lib/model/store/store.collection.change.directive.d.ts +2 -2
  109. package/lib/model/store/store.collection.d.ts +7 -7
  110. package/lib/model/store/store.collection.directive.d.ts +3 -3
  111. package/lib/model/store/store.document.auth.directive.d.ts +4 -4
  112. package/lib/model/store/store.document.directive.d.ts +2 -2
  113. package/lib/model/store/store.subcollection.d.ts +29 -9
  114. package/lib/model/store/store.subcollection.directive.d.ts +23 -0
  115. package/lib/model/store/store.subcollection.document.d.ts +9 -8
  116. package/lib/model/store/store.subcollection.rxjs.d.ts +12 -11
  117. package/lib/style/_config.scss +8 -6
  118. package/lib/style/_core.scss +1 -1
  119. package/lib/style/_mixin.scss +1 -1
  120. package/lib/style/_theming.scss +2 -12
  121. package/lib/style/_variables.scss +1 -1
  122. package/package.json +8 -7
@@ -1,34 +1,126 @@
1
+ import { urlWithoutParameters, addToSet, removeFromSet, filterMaybeValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, forEachKeyValue, readableError, isMaybeSo } from '@dereekb/util';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, Injectable, Inject, Optional, Component, Input, Directive, EventEmitter, Output, NgModule, Injector, forwardRef, Host } from '@angular/core';
4
+ import { getToken, initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';
5
+ import { switchMap, from, first, map, of, shareReplay, timeout, startWith, distinctUntilChanged, BehaviorSubject, combineLatest, tap, firstValueFrom, Subject, throttleTime, NEVER, filter, take, exhaustMap } from 'rxjs';
6
+ import * as i1 from '@angular/fire/app-check';
7
+ import { provideAppCheck } from '@angular/fire/app-check';
1
8
  import * as i4 from '@angular/material/button';
2
9
  import { MatButtonModule } from '@angular/material/button';
3
10
  import * as i2 from '@angular/material/icon';
4
11
  import { MatIconModule } from '@angular/material/icon';
5
12
  import * as i6 from '@angular/common';
6
13
  import { CommonModule } from '@angular/common';
7
- import * as i0 from '@angular/core';
8
- import { Injectable, Optional, Component, InjectionToken, Inject, Input, Directive, EventEmitter, Output, NgModule, Injector, forwardRef, Host } from '@angular/core';
9
- import { of, switchMap, shareReplay, map, timeout, startWith, distinctUntilChanged, from, BehaviorSubject, combineLatest, tap, firstValueFrom, Subject, throttleTime, NEVER, filter, take, exhaustMap, first } from 'rxjs';
10
14
  import * as i3 from '@dereekb/dbx-web';
11
15
  import { DbxRouterAnchorModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';
12
16
  import * as i3$1 from '@dereekb/dbx-core';
13
17
  import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService, AbstractSubscriptionDirective, AbstractIfDirective, LockSetComponentStore } from '@dereekb/dbx-core';
14
18
  import { filterMaybe, isNot, SubscriptionObject, cleanupDestroyable, accumulatorFlattenPageListLoadingState, useFirst, successResult, beginLoading, loadingStateFromObs, errorResult, cleanup } from '@dereekb/rxjs';
15
- import * as i1 from '@angular/fire/auth';
19
+ import * as i1$1 from '@angular/fire/auth';
16
20
  import { authState, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
17
21
  import { sendPasswordResetEmail } from 'firebase/auth';
18
- import { addToSet, removeFromSet, filterMaybeValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, forEachKeyValue, readableError, isMaybeSo } from '@dereekb/util';
19
- import * as i1$1 from '@dereekb/dbx-form';
22
+ import * as i1$2 from '@dereekb/dbx-form';
20
23
  import { AbstractAsyncFormlyFormDirective, usernamePasswordLoginFields, provideFormlyContext, AbstractSyncFormlyFormDirective, emailField, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule } from '@dereekb/dbx-form';
21
24
  import { initializeApp } from 'firebase/app';
22
- import * as i5 from '@angular/fire/app';
25
+ import * as i6$1 from '@angular/fire/app';
23
26
  import { FirebaseApp, provideFirebaseApp } from '@angular/fire/app';
24
- import * as i3$2 from '@angular/fire/storage';
27
+ import * as i4$1 from '@angular/fire/storage';
25
28
  import { provideStorage, getStorage, connectStorageEmulator } from '@angular/fire/storage';
26
- import * as i4$1 from '@angular/fire/functions';
29
+ import * as i5 from '@angular/fire/functions';
27
30
  import { provideFunctions, getFunctions, connectFunctionsEmulator, Functions } from '@angular/fire/functions';
28
- import * as i1$2 from '@angular/fire/firestore';
31
+ import * as i1$3 from '@angular/fire/firestore';
29
32
  import { provideFirestore, getFirestore, connectFirestoreEmulator, enableIndexedDbPersistence, Firestore } from '@angular/fire/firestore';
33
+ import { HTTP_INTERCEPTORS } from '@angular/common/http';
30
34
  import { firebaseFirestoreContextFactory, iterationQueryDocChangeWatcher, firebaseQueryItemAccumulator, documentDataWithId } from '@dereekb/firebase';
31
35
 
36
+ /**
37
+ * Enables debug token generation for AppCheck by setting FIREBASE_APPCHECK_DEBUG_TOKEN in the browser's self/window.
38
+ *
39
+ * https://firebase.google.com/docs/app-check/web/debug-provider
40
+ *
41
+ * @param enable
42
+ */
43
+ function enableAppCheckDebugTokenGeneration(enable = true) {
44
+ self.FIREBASE_APPCHECK_DEBUG_TOKEN = enable;
45
+ }
46
+
47
+ const DBX_FIREBASE_OPTIONS_TOKEN = new InjectionToken('DbxFirebaseOptions');
48
+
49
+ /**
50
+ * HTTP Interceptor that sets the X-Firebase-AppCheck for any requests to the routes configured in DbxFirebaseOptions.
51
+ */
52
+ class DbxFirebaseAppCheckHttpInterceptor {
53
+ constructor(dbxFirebaseOptions, appCheck) {
54
+ var _a, _b;
55
+ this.dbxFirebaseOptions = dbxFirebaseOptions;
56
+ this.appCheck = appCheck;
57
+ let routes = [];
58
+ if (appCheck != null) {
59
+ routes = ((_b = (_a = this.dbxFirebaseOptions.appCheck) === null || _a === void 0 ? void 0 : _a.appCheckRoutes) !== null && _b !== void 0 ? _b : ['/api/*']).map((route) => {
60
+ const wildcardIndex = route.indexOf('*');
61
+ const isWildcard = wildcardIndex === route.length - 1;
62
+ const match = isWildcard ? route.substring(0, wildcardIndex) : route;
63
+ return {
64
+ isWildcard,
65
+ match
66
+ };
67
+ });
68
+ }
69
+ this._appCheckRoutes = routes;
70
+ this._isEnabled = routes.length > 0;
71
+ }
72
+ intercept(req, next) {
73
+ let obs;
74
+ if (this._isEnabled) {
75
+ obs = this.matchesAnyRoute(req.url).pipe(switchMap((isMatch) => {
76
+ let nextEvent;
77
+ if (isMatch) {
78
+ nextEvent = from(getToken(this.appCheck).then((appCheckTokenResponse) => {
79
+ const token = appCheckTokenResponse.token;
80
+ let nextRequest = req;
81
+ if (token) {
82
+ nextRequest = req.clone({
83
+ headers: req.headers.set('X-Firebase-AppCheck', token)
84
+ });
85
+ }
86
+ return nextRequest;
87
+ })).pipe(switchMap((nextRequest) => next.handle(nextRequest)));
88
+ }
89
+ else {
90
+ nextEvent = next.handle(req);
91
+ }
92
+ return nextEvent;
93
+ }));
94
+ }
95
+ else {
96
+ obs = next.handle(req);
97
+ }
98
+ return obs;
99
+ }
100
+ matchesAnyRoute(inputUrl) {
101
+ const url = urlWithoutParameters(inputUrl);
102
+ function isEnabledRouteMatch(enabledRoute) {
103
+ if (enabledRoute.isWildcard) {
104
+ return url.startsWith(enabledRoute.match);
105
+ }
106
+ else {
107
+ return url === enabledRoute.match;
108
+ }
109
+ }
110
+ return from(this._appCheckRoutes).pipe(first((route) => isEnabledRouteMatch(route), false), map((x) => Boolean(x)));
111
+ }
112
+ }
113
+ DbxFirebaseAppCheckHttpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor, deps: [{ token: DBX_FIREBASE_OPTIONS_TOKEN }, { token: i1.AppCheck }], target: i0.ɵɵFactoryTarget.Injectable });
114
+ DbxFirebaseAppCheckHttpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor });
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAppCheckHttpInterceptor, decorators: [{
116
+ type: Injectable
117
+ }], ctorParameters: function () {
118
+ return [{ type: undefined, decorators: [{
119
+ type: Inject,
120
+ args: [DBX_FIREBASE_OPTIONS_TOKEN]
121
+ }] }, { type: i1.AppCheck }];
122
+ } });
123
+
32
124
  /**
33
125
  * Derives a user state from the input firebase auth service.
34
126
  *
@@ -40,7 +132,7 @@ function authUserStateFromFirebaseAuthService(dbxFirebaseAuthService, stateForLo
40
132
  return dbxFirebaseAuthService.hasAuthUser$.pipe(switchMap((hasUser) => {
41
133
  let obs;
42
134
  if (hasUser) {
43
- obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => isAnon ? of('anon') : stateForLoggedInUser(dbxFirebaseAuthService)));
135
+ obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => (isAnon ? of('anon') : stateForLoggedInUser(dbxFirebaseAuthService))));
44
136
  }
45
137
  else {
46
138
  obs = of('none');
@@ -59,7 +151,7 @@ function authUserStateFromFirebaseAuthService(dbxFirebaseAuthService, stateForLo
59
151
  function readValueFromIdToken(dbxFirebaseAuthService, readBooleanFromIdToken, defaultValue) {
60
152
  return dbxFirebaseAuthService.currentAuthUserInfo$.pipe(switchMap((x) => {
61
153
  if (x) {
62
- return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap(x => readBooleanFromIdToken(x)));
154
+ return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap((x) => readBooleanFromIdToken(x)));
63
155
  }
64
156
  else {
65
157
  return of(defaultValue);
@@ -84,10 +176,10 @@ const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE = {
84
176
  return authUserStateFromFirebaseAuthService(dbxFirebaseAuthService);
85
177
  },
86
178
  authRolesObs(dbxFirebaseAuthService) {
87
- return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user' ? new Set(['user']) : new Set()));
179
+ return dbxFirebaseAuthService.authUserState$.pipe(map((x) => (x === 'user' ? new Set(['user']) : new Set())));
88
180
  },
89
181
  isOnboarded(dbxFirebaseAuthService) {
90
- return dbxFirebaseAuthService.authUserState$.pipe(map(x => x === 'user'));
182
+ return dbxFirebaseAuthService.authUserState$.pipe(map((x) => x === 'user'));
91
183
  }
92
184
  };
93
185
  class DbxFirebaseAuthService {
@@ -98,19 +190,19 @@ class DbxFirebaseAuthService {
98
190
  first: 1000,
99
191
  with: () => this._authState$.pipe(startWith(null))
100
192
  }), distinctUntilChanged(), shareReplay(1));
101
- this.currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x) ? authUserInfoFromAuthUser(x) : undefined));
193
+ this.currentAuthUserInfo$ = this.currentAuthUser$.pipe(map((x) => (x ? authUserInfoFromAuthUser(x) : undefined)));
102
194
  this.authUser$ = this.currentAuthUser$.pipe(filterMaybe());
103
195
  this.authUserInfo$ = this.authUser$.pipe(map(authUserInfoFromAuthUser));
104
- this.hasAuthUser$ = this.currentAuthUser$.pipe(map(x => Boolean(x)), distinctUntilChanged(), shareReplay(1));
105
- this.isAnonymousUser$ = this.authUser$.pipe(map(x => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
196
+ this.hasAuthUser$ = this.currentAuthUser$.pipe(map((x) => Boolean(x)), distinctUntilChanged(), shareReplay(1));
197
+ this.isAnonymousUser$ = this.authUser$.pipe(map((x) => x.isAnonymous), distinctUntilChanged(), shareReplay(1));
106
198
  this.isNotAnonymousUser$ = this.isAnonymousUser$.pipe(isNot());
107
199
  this.isLoggedIn$ = this.hasAuthUser$;
108
200
  this.isNotLoggedIn$ = this.isLoggedIn$.pipe(isNot());
109
201
  this.onLogIn$ = loggedInObsFromIsLoggedIn(this.isLoggedIn$);
110
202
  this.onLogOut$ = loggedOutObsFromIsLoggedIn(this.isLoggedIn$);
111
- this.userIdentifier$ = this.currentAuthUser$.pipe(map(x => authUserIdentifier(x === null || x === void 0 ? void 0 : x.uid)));
112
- this.idTokenResult$ = this.authUser$.pipe(switchMap(x => x.getIdTokenResult()));
113
- this.claims$ = this.idTokenResult$.pipe(map(x => x.claims));
203
+ this.userIdentifier$ = this.currentAuthUser$.pipe(map((x) => authUserIdentifier(x === null || x === void 0 ? void 0 : x.uid)));
204
+ this.idTokenResult$ = this.authUser$.pipe(switchMap((x) => x.getIdTokenResult()));
205
+ this.claims$ = this.idTokenResult$.pipe(map((x) => x.claims));
114
206
  delegate = delegate !== null && delegate !== void 0 ? delegate : DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE;
115
207
  this.authUserState$ = delegate.authUserStateObs(this).pipe(distinctUntilChanged(), shareReplay(1));
116
208
  this.authRoles$ = delegate.authRolesObs(this);
@@ -158,12 +250,12 @@ class DbxFirebaseAuthService {
158
250
  return this.firebaseAuth.signOut();
159
251
  }
160
252
  }
161
- DbxFirebaseAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, deps: [{ token: i1.Auth }, { token: DbxFirebaseAuthServiceDelegate, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
253
+ DbxFirebaseAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, deps: [{ token: i1$1.Auth }, { token: DbxFirebaseAuthServiceDelegate, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
162
254
  DbxFirebaseAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService });
163
255
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthService, decorators: [{
164
256
  type: Injectable
165
257
  }], ctorParameters: function () {
166
- return [{ type: i1.Auth }, { type: DbxFirebaseAuthServiceDelegate, decorators: [{
258
+ return [{ type: i1$1.Auth }, { type: DbxFirebaseAuthServiceDelegate, decorators: [{
167
259
  type: Optional
168
260
  }] }];
169
261
  } });
@@ -186,21 +278,21 @@ class DbxFirebaseLoginTermsSimpleComponent {
186
278
  }
187
279
  DbxFirebaseLoginTermsSimpleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, deps: [{ token: DbxFirebaseLoginTermsConfig }], target: i0.ɵɵFactoryTarget.Component });
188
280
  DbxFirebaseLoginTermsSimpleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsSimpleComponent, selector: "ng-component", ngImport: i0, template: `
189
- <div class="dbx-firebase-login-terms-view">
190
- <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
191
- <span class="dbx-link-spacer"></span>
192
- <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
193
- </div>
281
+ <div class="dbx-firebase-login-terms-view">
282
+ <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
283
+ <span class="dbx-link-spacer"></span>
284
+ <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
285
+ </div>
194
286
  `, isInline: true, components: [{ type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }] });
195
287
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsSimpleComponent, decorators: [{
196
288
  type: Component,
197
289
  args: [{
198
290
  template: `
199
- <div class="dbx-firebase-login-terms-view">
200
- <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
201
- <span class="dbx-link-spacer"></span>
202
- <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
203
- </div>
291
+ <div class="dbx-firebase-login-terms-view">
292
+ <dbx-link [anchor]="tosAnchor">Terms</dbx-link>
293
+ <span class="dbx-link-spacer"></span>
294
+ <dbx-link [anchor]="privacyAnchor">Privacy</dbx-link>
295
+ </div>
204
296
  `
205
297
  }]
206
298
  }], ctorParameters: function () { return [{ type: DbxFirebaseLoginTermsConfig }]; } });
@@ -287,7 +379,7 @@ class DbxFirebaseAuthLoginService {
287
379
  return Array.from(this._providers.keys());
288
380
  }
289
381
  getEnabledTypes() {
290
- return (this._enableAll) ? this.getRegisteredTypes() : Array.from(this._enabled);
382
+ return this._enableAll ? this.getRegisteredTypes() : Array.from(this._enabled);
291
383
  }
292
384
  getLoginProvider(type) {
293
385
  return this._providers.get(type);
@@ -299,7 +391,7 @@ class DbxFirebaseAuthLoginService {
299
391
  return this._providers.get(type);
300
392
  }
301
393
  getRegisterProviders(types) {
302
- return filterMaybeValues(mapIterable(types !== null && types !== void 0 ? types : [], (x) => this._providers.get(x))).filter(x => x.registrationComponentClass !== false);
394
+ return filterMaybeValues(mapIterable(types !== null && types !== void 0 ? types : [], (x) => this._providers.get(x))).filter((x) => x.registrationComponentClass !== false);
303
395
  }
304
396
  getProviderAssets(type) {
305
397
  return this._assets.get(type);
@@ -316,7 +408,7 @@ DbxFirebaseAuthLoginService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "1
316
408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseAuthLoginService, decorators: [{
317
409
  type: Injectable,
318
410
  args: [{
319
- providedIn: 'root',
411
+ providedIn: 'root'
320
412
  }]
321
413
  }], ctorParameters: function () {
322
414
  return [{ type: undefined, decorators: [{
@@ -379,39 +471,37 @@ class DbxFirebaseLoginButtonComponent {
379
471
  }
380
472
  DbxFirebaseLoginButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
381
473
  DbxFirebaseLoginButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonComponent, selector: "dbx-firebase-login-button", inputs: { config: "config" }, host: { classAttribute: "dbx-firebase-login-button" }, ngImport: i0, template: `
382
- <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue
383
- [dbxActionSuccessHandler]="onActionSuccess">
384
- <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
385
- <div class="dbx-firebase-login-button-content">
386
- <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
387
- <img *ngIf="iconUrl" [src]="iconUrl"/>
388
- <mat-icon *ngIf="icon">{{icon}}</mat-icon>
389
- </span>
390
- <span class="dbx-firebase-login-button-text">{{ text }}</span>
391
- </div>
392
- </dbx-button>
393
- </ng-container>
474
+ <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue [dbxActionSuccessHandler]="onActionSuccess">
475
+ <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
476
+ <div class="dbx-firebase-login-button-content">
477
+ <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
478
+ <img *ngIf="iconUrl" [src]="iconUrl" />
479
+ <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
480
+ </span>
481
+ <span class="dbx-firebase-login-button-text">{{ text }}</span>
482
+ </div>
483
+ </dbx-button>
484
+ </ng-container>
394
485
  `, isInline: true, components: [{ type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionValueDirective, selector: "[dbxActionValue]", inputs: ["dbxActionValue"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i3$1.DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: ["dbxActionSuccessHandler"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
395
486
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonComponent, decorators: [{
396
487
  type: Component,
397
488
  args: [{
398
489
  selector: 'dbx-firebase-login-button',
399
490
  template: `
400
- <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue
401
- [dbxActionSuccessHandler]="onActionSuccess">
402
- <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
403
- <div class="dbx-firebase-login-button-content">
404
- <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
405
- <img *ngIf="iconUrl" [src]="iconUrl"/>
406
- <mat-icon *ngIf="icon">{{icon}}</mat-icon>
407
- </span>
408
- <span class="dbx-firebase-login-button-text">{{ text }}</span>
409
- </div>
410
- </dbx-button>
411
- </ng-container>
491
+ <ng-container dbxAction [dbxActionHandler]="handleAction" dbxActionValue [dbxActionSuccessHandler]="onActionSuccess">
492
+ <dbx-button dbxActionButton [customTextColor]="buttonTextColor" [customButtonColor]="buttonColor" [raised]="true">
493
+ <div class="dbx-firebase-login-button-content">
494
+ <span class="dbx-firebase-login-button-icon dbx-icon-spacer">
495
+ <img *ngIf="iconUrl" [src]="iconUrl" />
496
+ <mat-icon *ngIf="icon">{{ icon }}</mat-icon>
497
+ </span>
498
+ <span class="dbx-firebase-login-button-text">{{ text }}</span>
499
+ </div>
500
+ </dbx-button>
501
+ </ng-container>
412
502
  `,
413
503
  host: {
414
- 'class': 'dbx-firebase-login-button'
504
+ class: 'dbx-firebase-login-button'
415
505
  }
416
506
  }]
417
507
  }], propDecorators: { config: [{
@@ -421,18 +511,18 @@ class DbxFirebaseLoginButtonContainerComponent {
421
511
  }
422
512
  DbxFirebaseLoginButtonContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
423
513
  DbxFirebaseLoginButtonContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginButtonContainerComponent, selector: "dbx-firebase-login-button-container", ngImport: i0, template: `
424
- <div class="dbx-firebase-login-button-container">
425
- <ng-content></ng-content>
426
- </div>
514
+ <div class="dbx-firebase-login-button-container">
515
+ <ng-content></ng-content>
516
+ </div>
427
517
  `, isInline: true });
428
518
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginButtonContainerComponent, decorators: [{
429
519
  type: Component,
430
520
  args: [{
431
521
  selector: 'dbx-firebase-login-button-container',
432
522
  template: `
433
- <div class="dbx-firebase-login-button-container">
434
- <ng-content></ng-content>
435
- </div>
523
+ <div class="dbx-firebase-login-button-container">
524
+ <ng-content></ng-content>
525
+ </div>
436
526
  `
437
527
  }]
438
528
  }] });
@@ -526,8 +616,8 @@ class DbxFirebaseLoginListComponent {
526
616
  this._omitProviderTypes = new BehaviorSubject(undefined);
527
617
  this._inputProviderTypes = new BehaviorSubject(undefined);
528
618
  this.providerTypes$ = combineLatest([this._inputProviderTypes, this._omitProviderTypes]).pipe(map(([providerTypes, omitProviderTypes]) => {
529
- const baseTypes = (providerTypes) ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();
530
- const types = (omitProviderTypes) ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;
619
+ const baseTypes = providerTypes ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();
620
+ const types = omitProviderTypes ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;
531
621
  return types;
532
622
  }), shareReplay(1));
533
623
  this.providers$ = combineLatest([this.providerTypes$, this._inputProviderCategories]).pipe(map(([x, inputProviderCategories]) => {
@@ -535,14 +625,12 @@ class DbxFirebaseLoginListComponent {
535
625
  let providers = this.dbxFirebaseAuthLoginService.getLoginProviders(x);
536
626
  if (providerCategories.length) {
537
627
  const categories = new Set(providerCategories);
538
- providers = providers.filter(x => { var _a; return containsStringAnyCase(categories, (_a = x.category) !== null && _a !== void 0 ? _a : ''); });
628
+ providers = providers.filter((x) => { var _a; return containsStringAnyCase(categories, (_a = x.category) !== null && _a !== void 0 ? _a : ''); });
539
629
  }
540
630
  return providers;
541
631
  }));
542
632
  this.providerInjectionConfigs$ = combineLatest([this._loginMode, this.providers$]).pipe(map(([mode, providers]) => {
543
- const mapFn = (mode === 'register') ?
544
- ((x) => { var _a; return ({ componentClass: (_a = x.registrationComponentClass) !== null && _a !== void 0 ? _a : x.componentClass }); }) :
545
- ((x) => ({ componentClass: x.componentClass }));
633
+ const mapFn = mode === 'register' ? (x) => { var _a; return ({ componentClass: (_a = x.registrationComponentClass) !== null && _a !== void 0 ? _a : x.componentClass }); } : (x) => ({ componentClass: x.componentClass });
546
634
  return providers.map(mapFn);
547
635
  }));
548
636
  }
@@ -567,21 +655,21 @@ class DbxFirebaseLoginListComponent {
567
655
  }
568
656
  DbxFirebaseLoginListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
569
657
  DbxFirebaseLoginListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginListComponent, selector: "dbx-firebase-login-list", inputs: { loginMode: "loginMode", providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, host: { classAttribute: "dbx-firebase-login-list" }, ngImport: i0, template: `
570
- <div class="dbx-firebase-login-item" *ngFor="let config of (providerInjectionConfigs$ | async)">
658
+ <div class="dbx-firebase-login-item" *ngFor="let config of providerInjectionConfigs$ | async">
571
659
  <dbx-injection [config]="config"></dbx-injection>
572
660
  </div>
573
- `, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe } });
661
+ `, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i6.AsyncPipe } });
574
662
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginListComponent, decorators: [{
575
663
  type: Component,
576
664
  args: [{
577
665
  selector: 'dbx-firebase-login-list',
578
666
  template: `
579
- <div class="dbx-firebase-login-item" *ngFor="let config of (providerInjectionConfigs$ | async)">
667
+ <div class="dbx-firebase-login-item" *ngFor="let config of providerInjectionConfigs$ | async">
580
668
  <dbx-injection [config]="config"></dbx-injection>
581
669
  </div>
582
- `,
670
+ `,
583
671
  host: {
584
- 'class': 'dbx-firebase-login-list'
672
+ class: 'dbx-firebase-login-list'
585
673
  }
586
674
  }]
587
675
  }], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; }, propDecorators: { loginMode: [{
@@ -600,18 +688,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
600
688
  class DbxFirebaseLoginContextDirective extends AbstractForwardDbxInjectionContextDirective {
601
689
  }
602
690
  DbxFirebaseLoginContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
603
- DbxFirebaseLoginContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [{
691
+ DbxFirebaseLoginContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginContextDirective, selector: "[dbxFirebaseLoginContext]", providers: [
692
+ {
604
693
  provide: DbxFirebaseLoginContext,
605
694
  useExisting: DbxFirebaseLoginContextDirective
606
- }], usesInheritance: true, ngImport: i0 });
695
+ }
696
+ ], usesInheritance: true, ngImport: i0 });
607
697
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextDirective, decorators: [{
608
698
  type: Directive,
609
699
  args: [{
610
- 'selector': '[dbxFirebaseLoginContext]',
611
- providers: [{
700
+ selector: '[dbxFirebaseLoginContext]',
701
+ providers: [
702
+ {
612
703
  provide: DbxFirebaseLoginContext,
613
704
  useExisting: DbxFirebaseLoginContextDirective
614
- }]
705
+ }
706
+ ]
615
707
  }]
616
708
  }] });
617
709
 
@@ -639,7 +731,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
639
731
  </ng-container>
640
732
  `,
641
733
  host: {
642
- 'class': 'd-block dbx-firebase-login',
734
+ class: 'd-block dbx-firebase-login',
643
735
  '[class]': '{ "dbx-firebase-register": loginMode === "register" }'
644
736
  }
645
737
  }]
@@ -686,7 +778,7 @@ class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
686
778
  super(...arguments);
687
779
  this._config = new BehaviorSubject({ loginMode: 'login' });
688
780
  this.fields$ = this._config.pipe(map(({ loginMode = 'login', passwordConfig }) => {
689
- const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: (loginMode === 'register') });
781
+ const fields = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: loginMode === 'register' });
690
782
  return fields;
691
783
  }));
692
784
  }
@@ -699,11 +791,15 @@ class DbxFirebaseEmailFormComponent extends AbstractAsyncFormlyFormDirective {
699
791
  }
700
792
  }
701
793
  DbxFirebaseEmailFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
702
- DbxFirebaseEmailFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `<dbx-formly></dbx-formly>`, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
794
+ DbxFirebaseEmailFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: { config: "config" }, providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
795
+ <dbx-formly></dbx-formly>
796
+ `, isInline: true, components: [{ type: i1$2.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
703
797
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailFormComponent, decorators: [{
704
798
  type: Component,
705
799
  args: [{
706
- template: `<dbx-formly></dbx-formly>`,
800
+ template: `
801
+ <dbx-formly></dbx-formly>
802
+ `,
707
803
  selector: 'dbx-firebase-email-form',
708
804
  providers: [provideFormlyContext()]
709
805
  }]
@@ -718,11 +814,15 @@ class DbxFirebaseEmailRecoveryFormComponent extends AbstractSyncFormlyFormDirect
718
814
  }
719
815
  }
720
816
  DbxFirebaseEmailRecoveryFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
721
- DbxFirebaseEmailRecoveryFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `<dbx-formly></dbx-formly>`, isInline: true, components: [{ type: i1$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
817
+ DbxFirebaseEmailRecoveryFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
818
+ <dbx-formly></dbx-formly>
819
+ `, isInline: true, components: [{ type: i1$2.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
722
820
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseEmailRecoveryFormComponent, decorators: [{
723
821
  type: Component,
724
822
  args: [{
725
- template: `<dbx-formly></dbx-formly>`,
823
+ template: `
824
+ <dbx-formly></dbx-formly>
825
+ `,
726
826
  selector: 'dbx-firebase-email-recovery-form',
727
827
  providers: [provideFormlyContext()]
728
828
  }]
@@ -810,10 +910,10 @@ class DbxFirebaseLoginEmailContentComponent {
810
910
  }
811
911
  }
812
912
  DbxFirebaseLoginEmailContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, deps: [{ token: DbxFirebaseAuthService }, { token: DBX_INJECTION_COMPONENT_DATA }], target: i0.ɵɵFactoryTarget.Component });
813
- DbxFirebaseLoginEmailContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailContentComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\">\n </dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\">\n </dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n", components: [{ type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: ["config"] }, { type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }, { type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.DbxReadableErrorComponent, selector: "dbx-error", inputs: ["error"] }, { type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form" }], directives: [{ type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i1$1.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { type: i1$1.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i3.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { type: i3.DbxActionErrorDirective, selector: "[dbxActionError]" }], pipes: { "async": i6.AsyncPipe } });
913
+ DbxFirebaseLoginEmailContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginEmailContentComponent, selector: "ng-component", ngImport: i0, template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"></dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n", components: [{ type: DbxFirebaseEmailFormComponent, selector: "dbx-firebase-email-form", inputs: ["config"] }, { type: i3.DbxAnchorLinkComponent, selector: "dbx-link", inputs: ["anchor", "ref", "href"] }, { type: i3.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i3.DbxReadableErrorComponent, selector: "dbx-error", inputs: ["error"] }, { type: DbxFirebaseEmailRecoveryFormComponent, selector: "dbx-firebase-email-recovery-form" }], directives: [{ type: i6.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i6.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { type: i1$2.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { type: i1$2.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.DbxActionButtonDirective, selector: "[dbxActionButton]" }, { type: i3.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { type: i3.DbxActionErrorDirective, selector: "[dbxActionError]" }], pipes: { "async": i6.AsyncPipe } });
814
914
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginEmailContentComponent, decorators: [{
815
915
  type: Component,
816
- args: [{ template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\">\n </dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\">\n </dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton>\n </dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n" }]
916
+ args: [{ template: "<div class=\"dbx-firebase-login-email-content\">\n <ng-container [ngSwitch]=\"emailMode$ | async\">\n <ng-container *ngSwitchCase=\"'login'\">\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'recover'\">\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<!-- Login View -->\n<ng-template #loginView>\n <ng-container dbxAction [dbxActionHandler]=\"handleLoginAction\">\n <dbx-firebase-email-form [config]=\"formConfig\" dbxActionForm [dbxFormSource]=\"emailFormValue\"></dbx-firebase-email-form>\n <div class=\"dbx-firebase-login-email-forgot-prompt\" *ngIf=\"isLoginMode\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" [text]=\"buttonText\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <dbx-button-spacer></dbx-button-spacer>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancel()\">Cancel</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n\n<!-- Reset Password View -->\n<ng-template #resetPassword>\n <ng-container dbxAction [dbxActionHandler]=\"handleRecoveryAction\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValue\"></dbx-firebase-email-recovery-form>\n <p class=\"dbx-hint\">An email will be sent to the above address to help you reset your password.</p>\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-wide-button\" text=\"Send Recovery Email\" [raised]=\"true\" color=\"primary\" dbxActionButton></dbx-button>\n <span class=\"dbx-spacer\"></span>\n <button mat-flat-button (click)=\"onCancelReset()\">Cancel Recovery</button>\n </div>\n <dbx-error dbxActionError></dbx-error>\n </ng-container>\n</ng-template>\n" }]
817
917
  }], ctorParameters: function () {
818
918
  return [{ type: DbxFirebaseAuthService }, { type: undefined, decorators: [{
819
919
  type: Inject,
@@ -881,12 +981,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
881
981
  class DbxFirebaseRegisterComponent {
882
982
  }
883
983
  DbxFirebaseRegisterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
884
- DbxFirebaseRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template: `<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>`, isInline: true, components: [{ type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
984
+ DbxFirebaseRegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseRegisterComponent, selector: "dbx-firebase-register", inputs: { providerTypes: "providerTypes", omitProviderTypes: "omitProviderTypes", providerCategories: "providerCategories" }, ngImport: i0, template: `
985
+ <dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>
986
+ `, isInline: true, components: [{ type: DbxFirebaseLoginComponent, selector: "dbx-firebase-login", inputs: ["loginMode", "providerTypes", "omitProviderTypes", "providerCategories"] }] });
885
987
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseRegisterComponent, decorators: [{
886
988
  type: Component,
887
989
  args: [{
888
990
  selector: 'dbx-firebase-register',
889
- template: `<dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>`
991
+ template: `
992
+ <dbx-firebase-login loginMode="register" [providerTypes]="providerTypes" [omitProviderTypes]="omitProviderTypes" [providerCategories]="providerCategories"></dbx-firebase-login>
993
+ `
890
994
  }]
891
995
  }], propDecorators: { providerTypes: [{
892
996
  type: Input
@@ -975,14 +1079,18 @@ class DbxFirebaseLoginTermsComponent {
975
1079
  }
976
1080
  }
977
1081
  DbxFirebaseLoginTermsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, deps: [{ token: DbxFirebaseAuthLoginService }], target: i0.ɵɵFactoryTarget.Component });
978
- DbxFirebaseLoginTermsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `<dbx-injection [config]="config"></dbx-injection>`, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
1082
+ DbxFirebaseLoginTermsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseLoginTermsComponent, selector: "dbx-firebase-login-terms", host: { classAttribute: "dbx-firebase-login-terms d-block" }, ngImport: i0, template: `
1083
+ <dbx-injection [config]="config"></dbx-injection>
1084
+ `, isInline: true, components: [{ type: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }] });
979
1085
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginTermsComponent, decorators: [{
980
1086
  type: Component,
981
1087
  args: [{
982
1088
  selector: 'dbx-firebase-login-terms',
983
- template: `<dbx-injection [config]="config"></dbx-injection>`,
1089
+ template: `
1090
+ <dbx-injection [config]="config"></dbx-injection>
1091
+ `,
984
1092
  host: {
985
- 'class': 'dbx-firebase-login-terms d-block',
1093
+ class: 'dbx-firebase-login-terms d-block'
986
1094
  }
987
1095
  }]
988
1096
  }], ctorParameters: function () { return [{ type: DbxFirebaseAuthLoginService }]; } });
@@ -1002,8 +1110,8 @@ DbxFirebaseLoginContextBackButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ m
1002
1110
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginContextBackButtonComponent, decorators: [{
1003
1111
  type: Component,
1004
1112
  args: [{
1005
- 'selector': 'dbx-firebase-login-context-back-button',
1006
- 'template': `
1113
+ selector: 'dbx-firebase-login-context-back-button',
1114
+ template: `
1007
1115
  <dbx-link [anchor]="anchor">Choose other login method.</dbx-link>
1008
1116
  `
1009
1117
  }]
@@ -1018,7 +1126,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1018
1126
  // https://firebase.google.com/docs/auth/web/firebaseui
1019
1127
  const baseFirebaseJSUrl = `https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth`;
1020
1128
  // NOTE: Colors are from https://brandcolors.net/
1021
- return [{
1129
+ return [
1130
+ {
1022
1131
  category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
1023
1132
  loginMethodType: 'email',
1024
1133
  componentClass: DbxFirebaseLoginEmailComponent,
@@ -1029,7 +1138,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1029
1138
  backgroundColor: '#ea4335',
1030
1139
  textColor: '#FFF'
1031
1140
  }
1032
- }, {
1141
+ },
1142
+ {
1033
1143
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1034
1144
  loginMethodType: 'google',
1035
1145
  componentClass: DbxFirebaseLoginGoogleComponent,
@@ -1039,7 +1149,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1039
1149
  backgroundColor: '#FFF',
1040
1150
  textColor: '#757575'
1041
1151
  }
1042
- }, {
1152
+ },
1153
+ {
1043
1154
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1044
1155
  loginMethodType: 'facebook',
1045
1156
  componentClass: DbxFirebaseLoginFacebookComponent,
@@ -1049,7 +1160,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1049
1160
  backgroundColor: '#4267B2',
1050
1161
  textColor: '#FFF'
1051
1162
  }
1052
- }, {
1163
+ },
1164
+ {
1053
1165
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1054
1166
  loginMethodType: 'twitter',
1055
1167
  componentClass: DbxFirebaseLoginTwitterComponent,
@@ -1059,7 +1171,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1059
1171
  backgroundColor: '#1da1f2',
1060
1172
  textColor: '#FFF'
1061
1173
  }
1062
- }, {
1174
+ },
1175
+ {
1063
1176
  category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1064
1177
  loginMethodType: 'github',
1065
1178
  componentClass: DbxFirebaseLoginGitHubComponent,
@@ -1070,7 +1183,27 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1070
1183
  textColor: '#FFF'
1071
1184
  }
1072
1185
  },
1073
- {
1186
+ /*{
1187
+ category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1188
+ loginMethodType: 'apple' as KnownFirebaseLoginMethodType,
1189
+ componentClass: DbxFirebaseLoginGitHubComponent,
1190
+ assets: {
1191
+ logoUrl: `${baseFirebaseJSUrl}/apple.svg`,
1192
+ loginText: 'Continue with Apple',
1193
+ backgroundColor: '#333',
1194
+ textColor: '#FFF'
1195
+ }
1196
+ }, {
1197
+ category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,
1198
+ loginMethodType: 'microsoft' as KnownFirebaseLoginMethodType,
1199
+ componentClass: DbxFirebaseLoginGitHubComponent,
1200
+ assets: {
1201
+ logoUrl: `${baseFirebaseJSUrl}/microsoft.svg`,
1202
+ loginText: 'Continue with Microsoft',
1203
+ backgroundColor: '#ea3e23',
1204
+ textColor: '#FFF'
1205
+ }
1206
+ },*/ {
1074
1207
  category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,
1075
1208
  loginMethodType: 'anonymous',
1076
1209
  componentClass: DbxFirebaseLoginAnonymousComponent,
@@ -1080,7 +1213,8 @@ function defaultFirebaseAuthLoginProvidersFactory() {
1080
1213
  backgroundColor: '#000',
1081
1214
  textColor: '#FFF'
1082
1215
  }
1083
- }];
1216
+ }
1217
+ ];
1084
1218
  }
1085
1219
  /**
1086
1220
  * Contains components related to logging in.
@@ -1097,22 +1231,28 @@ class DbxFirebaseLoginModule {
1097
1231
  static forRoot(config) {
1098
1232
  return {
1099
1233
  ngModule: DbxFirebaseLoginModule,
1100
- providers: [{
1234
+ providers: [
1235
+ {
1101
1236
  provide: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN,
1102
1237
  useFactory: defaultFirebaseAuthLoginProvidersFactory
1103
- }, {
1238
+ },
1239
+ {
1104
1240
  provide: DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN,
1105
1241
  useValue: config.termsComponentClass
1106
- }, {
1242
+ },
1243
+ {
1107
1244
  provide: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN,
1108
1245
  useValue: config.passwordConfig
1109
- }, {
1246
+ },
1247
+ {
1110
1248
  provide: DbxFirebaseLoginModuleRootConfig,
1111
1249
  useValue: config
1112
- }, {
1250
+ },
1251
+ {
1113
1252
  provide: DbxFirebaseLoginTermsConfig,
1114
1253
  useValue: config
1115
- }]
1254
+ }
1255
+ ]
1116
1256
  };
1117
1257
  }
1118
1258
  }
@@ -1137,19 +1277,7 @@ DbxFirebaseLoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
1137
1277
  DbxFirebaseLoginFacebookComponent,
1138
1278
  DbxFirebaseLoginAnonymousComponent,
1139
1279
  DbxFirebaseLoginTermsComponent,
1140
- DbxFirebaseLoginTermsSimpleComponent], imports: [CommonModule,
1141
- MatIconModule,
1142
- MatButtonModule,
1143
- DbxRouterAnchorModule,
1144
- DbxFormIoModule,
1145
- DbxFormModule,
1146
- DbxFormlyModule,
1147
- DbxFormActionModule,
1148
- DbxFormFormlyTextFieldModule,
1149
- DbxReadableErrorModule,
1150
- DbxActionModule,
1151
- DbxButtonModule,
1152
- DbxInjectionComponentModule], exports: [DbxFirebaseLoginComponent,
1280
+ DbxFirebaseLoginTermsSimpleComponent], imports: [CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule], exports: [DbxFirebaseLoginComponent,
1153
1281
  DbxFirebaseLoginContextDirective,
1154
1282
  DbxFirebaseLoginContextBackButtonComponent,
1155
1283
  DbxFirebaseRegisterComponent,
@@ -1170,39 +1298,11 @@ DbxFirebaseLoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
1170
1298
  DbxFirebaseLoginAnonymousComponent,
1171
1299
  DbxFirebaseLoginTermsComponent,
1172
1300
  DbxFirebaseLoginTermsSimpleComponent] });
1173
- DbxFirebaseLoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, providers: [], imports: [[
1174
- CommonModule,
1175
- MatIconModule,
1176
- MatButtonModule,
1177
- DbxRouterAnchorModule,
1178
- DbxFormIoModule,
1179
- DbxFormModule,
1180
- DbxFormlyModule,
1181
- DbxFormActionModule,
1182
- DbxFormFormlyTextFieldModule,
1183
- DbxReadableErrorModule,
1184
- DbxActionModule,
1185
- DbxButtonModule,
1186
- DbxInjectionComponentModule
1187
- ]] });
1301
+ DbxFirebaseLoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, providers: [], imports: [[CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule]] });
1188
1302
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseLoginModule, decorators: [{
1189
1303
  type: NgModule,
1190
1304
  args: [{
1191
- imports: [
1192
- CommonModule,
1193
- MatIconModule,
1194
- MatButtonModule,
1195
- DbxRouterAnchorModule,
1196
- DbxFormIoModule,
1197
- DbxFormModule,
1198
- DbxFormlyModule,
1199
- DbxFormActionModule,
1200
- DbxFormFormlyTextFieldModule,
1201
- DbxReadableErrorModule,
1202
- DbxActionModule,
1203
- DbxButtonModule,
1204
- DbxInjectionComponentModule
1205
- ],
1305
+ imports: [CommonModule, MatIconModule, MatButtonModule, DbxRouterAnchorModule, DbxFormIoModule, DbxFormModule, DbxFormlyModule, DbxFormActionModule, DbxFormFormlyTextFieldModule, DbxReadableErrorModule, DbxActionModule, DbxButtonModule, DbxInjectionComponentModule],
1206
1306
  declarations: [
1207
1307
  DbxFirebaseLoginComponent,
1208
1308
  DbxFirebaseLoginContextDirective,
@@ -1293,7 +1393,7 @@ class DbxFirebaseParsedEmulatorsConfig {
1293
1393
  class DbxFirebaseDefaultFirestoreProviderModule {
1294
1394
  }
1295
1395
  DbxFirebaseDefaultFirestoreProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1296
- DbxFirebaseDefaultFirestoreProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$2.FirestoreModule] });
1396
+ DbxFirebaseDefaultFirestoreProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$3.FirestoreModule] });
1297
1397
  DbxFirebaseDefaultFirestoreProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [[
1298
1398
  provideFirestore(((injector) => {
1299
1399
  const firebaseApp = injector.get(FirebaseApp);
@@ -1323,13 +1423,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1323
1423
  ]
1324
1424
  }]
1325
1425
  }] });
1426
+ /**
1427
+ * Default firebase app check provider module.
1428
+ *
1429
+ * Also configures the DbxFirebaseAppCheckHttpInterceptor with HTTP_INTERCEPTORS in order for appCheck to be appended to requests to the api.
1430
+ */
1431
+ class DbxFirebaseDefaultAppCheckProviderModule {
1432
+ }
1433
+ DbxFirebaseDefaultAppCheckProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1434
+ DbxFirebaseDefaultAppCheckProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, imports: [i1.AppCheckModule] });
1435
+ DbxFirebaseDefaultAppCheckProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, providers: [
1436
+ {
1437
+ provide: HTTP_INTERCEPTORS,
1438
+ useClass: DbxFirebaseAppCheckHttpInterceptor,
1439
+ multi: true
1440
+ }
1441
+ ], imports: [[
1442
+ provideAppCheck(((injector) => {
1443
+ var _a, _b, _c;
1444
+ const firebaseApp = injector.get(FirebaseApp);
1445
+ const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1446
+ const appCheckOptions = firebaseOptions.appCheck;
1447
+ const appCheckKnowinglyDisabled = (appCheckOptions === null || appCheckOptions === void 0 ? void 0 : appCheckOptions.disabled) === true || ((_a = firebaseOptions.emulators) === null || _a === void 0 ? void 0 : _a.useEmulators) === true;
1448
+ let appCheck;
1449
+ if (appCheckOptions && !appCheckKnowinglyDisabled) {
1450
+ // enable the debug tokens if not using emulators and allowDebugTokens is set true
1451
+ if (((_b = firebaseOptions.emulators) === null || _b === void 0 ? void 0 : _b.useEmulators) !== true && appCheckOptions.allowDebugTokens) {
1452
+ enableAppCheckDebugTokenGeneration(true);
1453
+ }
1454
+ // Only enabled outside of app-check environments. The emulators will not use appcheck.
1455
+ appCheck = initializeAppCheck(firebaseApp, {
1456
+ provider: new ReCaptchaV3Provider(appCheckOptions.reCaptchaV3),
1457
+ isTokenAutoRefreshEnabled: (_c = appCheckOptions.isTokenAutoRefreshEnabled) !== null && _c !== void 0 ? _c : true
1458
+ });
1459
+ console.debug('Enabled AppCheck.');
1460
+ }
1461
+ else {
1462
+ appCheck = undefined;
1463
+ if (!appCheckKnowinglyDisabled) {
1464
+ console.error('dbx-firebase: No appcheck configuration for the app, and not specifically disabled in config either.');
1465
+ }
1466
+ }
1467
+ return appCheck;
1468
+ }))
1469
+ ]] });
1470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAppCheckProviderModule, decorators: [{
1471
+ type: NgModule,
1472
+ args: [{
1473
+ imports: [
1474
+ provideAppCheck(((injector) => {
1475
+ var _a, _b, _c;
1476
+ const firebaseApp = injector.get(FirebaseApp);
1477
+ const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1478
+ const appCheckOptions = firebaseOptions.appCheck;
1479
+ const appCheckKnowinglyDisabled = (appCheckOptions === null || appCheckOptions === void 0 ? void 0 : appCheckOptions.disabled) === true || ((_a = firebaseOptions.emulators) === null || _a === void 0 ? void 0 : _a.useEmulators) === true;
1480
+ let appCheck;
1481
+ if (appCheckOptions && !appCheckKnowinglyDisabled) {
1482
+ // enable the debug tokens if not using emulators and allowDebugTokens is set true
1483
+ if (((_b = firebaseOptions.emulators) === null || _b === void 0 ? void 0 : _b.useEmulators) !== true && appCheckOptions.allowDebugTokens) {
1484
+ enableAppCheckDebugTokenGeneration(true);
1485
+ }
1486
+ // Only enabled outside of app-check environments. The emulators will not use appcheck.
1487
+ appCheck = initializeAppCheck(firebaseApp, {
1488
+ provider: new ReCaptchaV3Provider(appCheckOptions.reCaptchaV3),
1489
+ isTokenAutoRefreshEnabled: (_c = appCheckOptions.isTokenAutoRefreshEnabled) !== null && _c !== void 0 ? _c : true
1490
+ });
1491
+ console.debug('Enabled AppCheck.');
1492
+ }
1493
+ else {
1494
+ appCheck = undefined;
1495
+ if (!appCheckKnowinglyDisabled) {
1496
+ console.error('dbx-firebase: No appcheck configuration for the app, and not specifically disabled in config either.');
1497
+ }
1498
+ }
1499
+ return appCheck;
1500
+ }))
1501
+ ],
1502
+ providers: [
1503
+ {
1504
+ provide: HTTP_INTERCEPTORS,
1505
+ useClass: DbxFirebaseAppCheckHttpInterceptor,
1506
+ multi: true
1507
+ }
1508
+ ]
1509
+ }]
1510
+ }] });
1326
1511
  /**
1327
1512
  * Default firebase auth provider module.
1328
1513
  */
1329
1514
  class DbxFirebaseDefaultAuthProviderModule {
1330
1515
  }
1331
1516
  DbxFirebaseDefaultAuthProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1332
- DbxFirebaseDefaultAuthProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [i1.AuthModule] });
1517
+ DbxFirebaseDefaultAuthProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [i1$1.AuthModule] });
1333
1518
  DbxFirebaseDefaultAuthProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultAuthProviderModule, imports: [[
1334
1519
  provideAuth(((injector) => {
1335
1520
  const firebaseApp = injector.get(FirebaseApp);
@@ -1363,7 +1548,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1363
1548
  class DbxFirebaseDefaultStorageProviderModule {
1364
1549
  }
1365
1550
  DbxFirebaseDefaultStorageProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1366
- DbxFirebaseDefaultStorageProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [i3$2.StorageModule] });
1551
+ DbxFirebaseDefaultStorageProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [i4$1.StorageModule] });
1367
1552
  DbxFirebaseDefaultStorageProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultStorageProviderModule, imports: [[
1368
1553
  provideStorage(((injector) => {
1369
1554
  const firebaseApp = injector.get(FirebaseApp);
@@ -1397,7 +1582,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1397
1582
  class DbxFirebaseDefaultFunctionsProviderModule {
1398
1583
  }
1399
1584
  DbxFirebaseDefaultFunctionsProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1400
- DbxFirebaseDefaultFunctionsProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [i4$1.FunctionsModule] });
1585
+ DbxFirebaseDefaultFunctionsProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [i5.FunctionsModule] });
1401
1586
  DbxFirebaseDefaultFunctionsProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFunctionsProviderModule, imports: [[
1402
1587
  provideFunctions(((injector) => {
1403
1588
  const firebaseApp = injector.get(FirebaseApp);
@@ -1429,7 +1614,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1429
1614
  ]
1430
1615
  }]
1431
1616
  }] });
1432
- const DBX_FIREBASE_OPTIONS_TOKEN = new InjectionToken('DbxFirebaseOptions');
1433
1617
  /**
1434
1618
  * Default provider module.
1435
1619
  */
@@ -1437,20 +1621,23 @@ class DbxFirebaseDefaultFirebaseProvidersModule {
1437
1621
  static forRoot(firebaseOptions) {
1438
1622
  return {
1439
1623
  ngModule: DbxFirebaseDefaultFirebaseProvidersModule,
1440
- providers: [{
1624
+ providers: [
1625
+ {
1441
1626
  provide: DBX_FIREBASE_OPTIONS_TOKEN,
1442
1627
  useValue: firebaseOptions
1443
- }]
1628
+ }
1629
+ ]
1444
1630
  };
1445
1631
  }
1446
1632
  }
1447
1633
  DbxFirebaseDefaultFirebaseProvidersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1448
- DbxFirebaseDefaultFirebaseProvidersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [i5.FirebaseAppModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDefaultFunctionsProviderModule] });
1634
+ DbxFirebaseDefaultFirebaseProvidersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [i6$1.FirebaseAppModule, DbxFirebaseDefaultAppCheckProviderModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDefaultFunctionsProviderModule] });
1449
1635
  DbxFirebaseDefaultFirebaseProvidersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseDefaultFirebaseProvidersModule, imports: [[
1450
1636
  provideFirebaseApp(((injector) => {
1451
1637
  const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1452
1638
  return initializeApp(firebaseOptions);
1453
1639
  })),
1640
+ DbxFirebaseDefaultAppCheckProviderModule,
1454
1641
  DbxFirebaseDefaultFirestoreProviderModule,
1455
1642
  DbxFirebaseDefaultAuthProviderModule,
1456
1643
  DbxFirebaseDefaultStorageProviderModule,
@@ -1464,6 +1651,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1464
1651
  const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1465
1652
  return initializeApp(firebaseOptions);
1466
1653
  })),
1654
+ DbxFirebaseDefaultAppCheckProviderModule,
1467
1655
  DbxFirebaseDefaultFirestoreProviderModule,
1468
1656
  DbxFirebaseDefaultAuthProviderModule,
1469
1657
  DbxFirebaseDefaultStorageProviderModule,
@@ -1481,7 +1669,7 @@ class DbxFirebaseEmulatorModule {
1481
1669
  const defaultHost = (_a = config.host) !== null && _a !== void 0 ? _a : 'localhost';
1482
1670
  function emulatorConfig(emulator) {
1483
1671
  var _a;
1484
- return (emulator) ? { host: (_a = emulator.host) !== null && _a !== void 0 ? _a : defaultHost, port: emulator.port } : undefined;
1672
+ return emulator ? { host: (_a = emulator.host) !== null && _a !== void 0 ? _a : defaultHost, port: emulator.port } : undefined;
1485
1673
  }
1486
1674
  const finalConfig = {
1487
1675
  useEmulators: config.useEmulators !== false,
@@ -1493,10 +1681,12 @@ class DbxFirebaseEmulatorModule {
1493
1681
  };
1494
1682
  return {
1495
1683
  ngModule: DbxFirebaseEmulatorModule,
1496
- providers: [{
1684
+ providers: [
1685
+ {
1497
1686
  provide: DbxFirebaseParsedEmulatorsConfig,
1498
1687
  useValue: finalConfig
1499
- }]
1688
+ }
1689
+ ]
1500
1690
  };
1501
1691
  }
1502
1692
  }
@@ -1519,15 +1709,18 @@ class DbxFirebaseFirestoreCollectionModule {
1519
1709
  static forRoot(config) {
1520
1710
  return {
1521
1711
  ngModule: DbxFirebaseFirestoreCollectionModule,
1522
- providers: [{
1712
+ providers: [
1713
+ {
1523
1714
  provide: DBX_FIRESTORE_CONTEXT_TOKEN,
1524
1715
  useFactory: firebaseFirestoreContextFactory,
1525
1716
  deps: [Firestore]
1526
- }, {
1717
+ },
1718
+ {
1527
1719
  provide: config.appCollectionClass,
1528
1720
  useFactory: config.collectionFactory,
1529
1721
  deps: [DBX_FIRESTORE_CONTEXT_TOKEN]
1530
- }]
1722
+ }
1723
+ ]
1531
1724
  };
1532
1725
  }
1533
1726
  }
@@ -1565,11 +1758,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1565
1758
  */
1566
1759
  class DbxFirebaseFunctionsModule {
1567
1760
  static forRoot(config) {
1568
- const providers = [{
1761
+ const providers = [
1762
+ {
1569
1763
  provide: config.functionsGetterToken,
1570
1764
  useFactory: config.functionsGetterFactory,
1571
1765
  deps: [Functions]
1572
- }];
1766
+ }
1767
+ ];
1573
1768
  if (config.functionsConfigMap) {
1574
1769
  forEachKeyValue(config.functionsConfigMap, {
1575
1770
  forEach: ([key, entry]) => {
@@ -1618,10 +1813,7 @@ class DbxFirebaseCollectionLoaderInstance {
1618
1813
  this._maxPagesSub = new SubscriptionObject();
1619
1814
  this.collection$ = this._collection.pipe(distinctUntilChanged());
1620
1815
  this.constraints$ = this._constraints.pipe(distinctUntilChanged());
1621
- this.iteratorFilter$ = combineLatest([
1622
- this._itemsPerPage.pipe(distinctUntilChanged()),
1623
- this.constraints$
1624
- ]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
1816
+ this.iteratorFilter$ = combineLatest([this._itemsPerPage.pipe(distinctUntilChanged()), this.constraints$]).pipe(map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages })), shareReplay(1));
1625
1817
  this.firestoreIteration$ = this.collection$.pipe(switchMap((collection) => {
1626
1818
  if (collection) {
1627
1819
  return combineLatest([this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.
@@ -1633,16 +1825,18 @@ class DbxFirebaseCollectionLoaderInstance {
1633
1825
  }
1634
1826
  }), cleanupDestroyable(), // cleanup the iteration
1635
1827
  shareReplay(1));
1636
- this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map(instance => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
1637
- this.accumulator$ = this.firestoreIteration$.pipe(map(x => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
1638
- this.pageLoadingState$ = this.accumulator$.pipe(switchMap(x => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
1828
+ this.queryChangeWatcher$ = this.firestoreIteration$.pipe(map((instance) => iterationQueryDocChangeWatcher({ instance })), shareReplay(1));
1829
+ this.accumulator$ = this.firestoreIteration$.pipe(map((x) => firebaseQueryItemAccumulator(x)), cleanupDestroyable(), shareReplay(1));
1830
+ this.pageLoadingState$ = this.accumulator$.pipe(switchMap((x) => accumulatorFlattenPageListLoadingState(x)), shareReplay(1));
1639
1831
  }
1640
1832
  init() {
1641
1833
  // When max pages changes, update the iteration's max page limit.
1642
- this._maxPagesSub.subscription = this._maxPages.pipe(distinctUntilChanged(), filterMaybe(), // do not pass null/undefined values
1834
+ this._maxPagesSub.subscription = this._maxPages
1835
+ .pipe(distinctUntilChanged(), filterMaybe(), // do not pass null/undefined values
1643
1836
  switchMap((maxPageLoadLimit) => this.firestoreIteration$.pipe(tap((iteration) => {
1644
1837
  iteration.maxPageLoadLimit = maxPageLoadLimit;
1645
- })))).subscribe();
1838
+ }))))
1839
+ .subscribe();
1646
1840
  }
1647
1841
  destroy() {
1648
1842
  this._maxPages.complete();
@@ -1742,10 +1936,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1742
1936
  type: Input
1743
1937
  }] } });
1744
1938
  function provideDbxFirebaseCollectionStoreDirective(sourceType, storeType) {
1745
- const providers = [{
1939
+ const providers = [
1940
+ {
1746
1941
  provide: DbxFirebaseCollectionStoreDirective,
1747
1942
  useExisting: forwardRef(() => sourceType)
1748
- }];
1943
+ }
1944
+ ];
1749
1945
  if (storeType) {
1750
1946
  providers.push(storeType);
1751
1947
  }
@@ -1761,16 +1957,18 @@ class DbxFirebaseCollectionChangeDirective extends AbstractSubscriptionDirective
1761
1957
  this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
1762
1958
  this._mode = new BehaviorSubject('manual');
1763
1959
  this.mode$ = this._mode.pipe(distinctUntilChanged());
1764
- this.event$ = this.dbxFirebaseCollectionStoreDirective.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter(x => x.type !== 'none'), // do not share 'none' events.
1960
+ this.event$ = this.dbxFirebaseCollectionStoreDirective.store.queryChangeWatcher$.pipe(switchMap((x) => x.event$.pipe(filter((x) => x.type !== 'none'), // do not share 'none' events.
1765
1961
  take(1), // only need one event to mark as change is available.
1766
1962
  startWith({
1767
1963
  time: new Date(),
1768
1964
  type: 'none'
1769
1965
  }))), shareReplay(1));
1770
- this.hasChangeAvailable$ = this.event$.pipe(map(x => x.type !== 'none'), shareReplay(1));
1966
+ this.hasChangeAvailable$ = this.event$.pipe(map((x) => x.type !== 'none'), shareReplay(1));
1771
1967
  }
1772
1968
  ngOnInit() {
1773
- this.sub = combineLatest([this.mode$, this.hasChangeAvailable$]).pipe(filter(([mode, hasChange]) => mode === 'auto' && hasChange)).subscribe(() => {
1969
+ this.sub = combineLatest([this.mode$, this.hasChangeAvailable$])
1970
+ .pipe(filter(([mode, hasChange]) => mode === 'auto' && hasChange))
1971
+ .subscribe(() => {
1774
1972
  this.restart();
1775
1973
  });
1776
1974
  }
@@ -1908,10 +2106,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1908
2106
  type: Input
1909
2107
  }] } });
1910
2108
  function provideDbxFirebaseDocumentStoreDirective(sourceType, storeType) {
1911
- const providers = [{
2109
+ const providers = [
2110
+ {
1912
2111
  provide: DbxFirebaseDocumentStoreDirective,
1913
2112
  useExisting: forwardRef(() => sourceType)
1914
- }];
2113
+ }
2114
+ ];
1915
2115
  if (storeType) {
1916
2116
  providers.push(storeType);
1917
2117
  }
@@ -1996,34 +2196,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1996
2196
  class DbxFirebaseModelStoreModule {
1997
2197
  }
1998
2198
  DbxFirebaseModelStoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1999
- DbxFirebaseModelStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseCollectionListDirective,
2000
- DbxFirebaseCollectionChangeDirective,
2001
- DbxFirebaseCollectionHasChangeDirective,
2002
- DbxFirebaseDocumentStoreRouteIdDirective,
2003
- DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseCollectionListDirective,
2004
- DbxFirebaseCollectionChangeDirective,
2005
- DbxFirebaseCollectionHasChangeDirective,
2006
- DbxFirebaseDocumentStoreRouteIdDirective,
2007
- DbxFirebaseDocumentAuthIdDirective] });
2199
+ DbxFirebaseModelStoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, declarations: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective], exports: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective] });
2008
2200
  DbxFirebaseModelStoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, imports: [[]] });
2009
2201
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelStoreModule, decorators: [{
2010
2202
  type: NgModule,
2011
2203
  args: [{
2012
2204
  imports: [],
2013
- declarations: [
2014
- DbxFirebaseCollectionListDirective,
2015
- DbxFirebaseCollectionChangeDirective,
2016
- DbxFirebaseCollectionHasChangeDirective,
2017
- DbxFirebaseDocumentStoreRouteIdDirective,
2018
- DbxFirebaseDocumentAuthIdDirective
2019
- ],
2020
- exports: [
2021
- DbxFirebaseCollectionListDirective,
2022
- DbxFirebaseCollectionChangeDirective,
2023
- DbxFirebaseCollectionHasChangeDirective,
2024
- DbxFirebaseDocumentStoreRouteIdDirective,
2025
- DbxFirebaseDocumentAuthIdDirective
2026
- ]
2205
+ declarations: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective],
2206
+ exports: [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseDocumentAuthIdDirective]
2027
2207
  }]
2028
2208
  }] });
2029
2209
 
@@ -2035,10 +2215,10 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
2035
2215
  super(...arguments);
2036
2216
  // MARK: Effects
2037
2217
  this.setMaxPages = this.effect((input) => {
2038
- return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => x.maxPages = maxPages))));
2218
+ return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => (x.maxPages = maxPages)))));
2039
2219
  });
2040
2220
  this.setItemsPerPage = this.effect((input) => {
2041
- return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => x.itemsPerPage = itemsPerPage))));
2221
+ return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => (x.itemsPerPage = itemsPerPage)))));
2042
2222
  });
2043
2223
  this.setConstraints = this.effect((input) => {
2044
2224
  return input.pipe(switchMap((constraints) => this.loader$.pipe(tap((x) => x.setConstraints(constraints)))));
@@ -2052,16 +2232,16 @@ class AbstractDbxFirebaseCollectionStore extends LockSetComponentStore {
2052
2232
  // MARK: Accessors
2053
2233
  this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
2054
2234
  this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
2055
- this.loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map(x => dbxFirebaseCollectionLoaderInstance({
2235
+ this.loader$ = this.currentFirestoreCollection$.pipe(switchMap((collection) => this.state$.pipe(first(), map((x) => dbxFirebaseCollectionLoaderInstance({
2056
2236
  collection,
2057
2237
  maxPages: x.maxPages,
2058
2238
  itemsPerPage: x.itemsPerPage,
2059
2239
  constraints: x.constraints
2060
2240
  })))), cleanupDestroyable(), distinctUntilChanged(), shareReplay(1));
2061
- this.firestoreIteration$ = this.loader$.pipe(switchMap(x => x.firestoreIteration$));
2062
- this.queryChangeWatcher$ = this.loader$.pipe(switchMap(x => x.queryChangeWatcher$));
2063
- this.accumulator$ = this.loader$.pipe(switchMap(x => x.accumulator$));
2064
- this.pageLoadingState$ = this.loader$.pipe(switchMap(x => x.pageLoadingState$));
2241
+ this.firestoreIteration$ = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));
2242
+ this.queryChangeWatcher$ = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));
2243
+ this.accumulator$ = this.loader$.pipe(switchMap((x) => x.accumulator$));
2244
+ this.pageLoadingState$ = this.loader$.pipe(switchMap((x) => x.pageLoadingState$));
2065
2245
  this.setFirestoreCollection = this.updater((state, firestoreCollection) => (Object.assign(Object.assign({}, state), { firestoreCollection })));
2066
2246
  }
2067
2247
  }
@@ -2086,9 +2266,9 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
2086
2266
  // MARK: Accessors
2087
2267
  this.currentFirestoreCollection$ = this.state$.pipe(map((x) => x.firestoreCollection), distinctUntilChanged(), shareReplay(1));
2088
2268
  this.firestoreCollection$ = this.currentFirestoreCollection$.pipe(filterMaybe());
2089
- this.currentInputId$ = this.state$.pipe(map(x => x.id), distinctUntilChanged(), shareReplay(1));
2269
+ this.currentInputId$ = this.state$.pipe(map((x) => x.id), distinctUntilChanged(), shareReplay(1));
2090
2270
  this.inputId$ = this.currentInputId$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
2091
- this.currentInputRef$ = this.state$.pipe(map(x => x.ref), distinctUntilChanged(), shareReplay(1));
2271
+ this.currentInputRef$ = this.state$.pipe(map((x) => x.ref), distinctUntilChanged(), shareReplay(1));
2092
2272
  this.inputRef$ = this.currentInputRef$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
2093
2273
  this.currentDocument$ = combineLatest([this.currentFirestoreCollection$, this.currentInputId$, this.currentInputRef$]).pipe(map(([collection, id, ref]) => {
2094
2274
  let document;
@@ -2103,12 +2283,12 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
2103
2283
  return document;
2104
2284
  }), distinctUntilChanged(), shareReplay(1));
2105
2285
  this.document$ = this.currentDocument$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));
2106
- this.documentLoadingState$ = this.currentDocument$.pipe(map(x => (x) ? successResult(x) : beginLoading()), shareReplay(1));
2107
- this.id$ = this.document$.pipe(map(x => x.id), shareReplay());
2108
- this.ref$ = this.document$.pipe(map(x => x.documentRef), shareReplay());
2109
- this.snapshot$ = this.document$.pipe(switchMap(x => x.accessor.stream()), shareReplay(1));
2286
+ this.documentLoadingState$ = this.currentDocument$.pipe(map((x) => (x ? successResult(x) : beginLoading())), shareReplay(1));
2287
+ this.id$ = this.document$.pipe(map((x) => x.id), shareReplay());
2288
+ this.ref$ = this.document$.pipe(map((x) => x.documentRef), shareReplay());
2289
+ this.snapshot$ = this.document$.pipe(switchMap((x) => x.accessor.stream()), shareReplay(1));
2110
2290
  this.snapshotLoadingState$ = this.currentDocument$.pipe(switchMap(() => loadingStateFromObs(this.snapshot$)), shareReplay(1));
2111
- this.currentData$ = this.document$.pipe(switchMap(x => x.accessor.stream().pipe(map(y => documentDataWithId(y)))), shareReplay(1));
2291
+ this.currentData$ = this.document$.pipe(switchMap((x) => x.accessor.stream().pipe(map((y) => documentDataWithId(y)))), shareReplay(1));
2112
2292
  this.data$ = this.currentDocument$.pipe(switchMap(() => this.currentData$.pipe(filterMaybe())), shareReplay(1));
2113
2293
  this.dataLoadingState$ = this.snapshotLoadingState$.pipe(map((x) => {
2114
2294
  let result;
@@ -2126,17 +2306,17 @@ class AbstractDbxFirebaseDocumentStore extends LockSetComponentStore {
2126
2306
  }
2127
2307
  return result;
2128
2308
  }), shareReplay(1));
2129
- this.exists$ = this.currentData$.pipe(map(x => isMaybeSo(x)), shareReplay(1));
2130
- this.doesNotExist$ = this.exists$.pipe(map(x => !x), shareReplay(1));
2309
+ this.exists$ = this.currentData$.pipe(map((x) => isMaybeSo(x)), shareReplay(1));
2310
+ this.doesNotExist$ = this.exists$.pipe(map((x) => !x), shareReplay(1));
2131
2311
  // MARK: State Changes
2132
2312
  /**
2133
2313
  * Sets the id of the document to load.
2134
2314
  */
2135
- this.setId = this.updater((state, id) => (id) ? (Object.assign(Object.assign({}, state), { id, ref: undefined })) : (Object.assign(Object.assign({}, state), { id })));
2315
+ this.setId = this.updater((state, id) => (id ? Object.assign(Object.assign({}, state), { id, ref: undefined }) : Object.assign(Object.assign({}, state), { id })));
2136
2316
  /**
2137
2317
  * Sets the ref of the document to load.
2138
2318
  */
2139
- this.setRef = this.updater((state, ref) => (ref) ? (Object.assign(Object.assign({}, state), { id: undefined, ref })) : (Object.assign(Object.assign({}, state), { ref })));
2319
+ this.setRef = this.updater((state, ref) => (ref ? Object.assign(Object.assign({}, state), { id: undefined, ref }) : Object.assign(Object.assign({}, state), { ref })));
2140
2320
  this.setFirestoreCollection = this.updater((state, firestoreCollection) => (Object.assign(Object.assign({}, state), { firestoreCollection })));
2141
2321
  }
2142
2322
  }
@@ -2151,7 +2331,7 @@ function setParentStoreEffect(store) {
2151
2331
  return input.pipe(map((parentStore) => {
2152
2332
  let result;
2153
2333
  if (parentStore) {
2154
- result = store.setParent(parentStore.currentDocument$);
2334
+ result = store._setParent(parentStore.currentDocument$);
2155
2335
  }
2156
2336
  else {
2157
2337
  result = undefined;
@@ -2166,56 +2346,82 @@ function setParentStoreEffect(store) {
2166
2346
  }));
2167
2347
  });
2168
2348
  }
2169
- function setParentEffect(store) {
2170
- return store.effect((input) => {
2171
- return input.pipe(switchMap((parent) => {
2172
- store._setParentDocument(parent);
2173
- if (parent) {
2174
- return store.collectionFactory$.pipe(tap((collectionFactory) => {
2175
- const collection = collectionFactory(parent);
2176
- store.setFirestoreCollection(collection);
2177
- }));
2178
- }
2179
- else {
2180
- // clear the current collection
2181
- store.setFirestoreCollection(undefined);
2182
- // do nothing until a parent is returned.
2183
- return NEVER;
2184
- }
2185
- }));
2186
- });
2187
- }
2188
2349
 
2189
2350
  /**
2190
2351
  * Abstract DbxFirebaseCollectionStore that has a parent document from which is derives it's FiresbaseCollection from.
2191
2352
  */
2192
2353
  class AbstractDbxFirebaseCollectionWithParentStore extends AbstractDbxFirebaseCollectionStore {
2193
- constructor() {
2194
- super(...arguments);
2354
+ constructor(state, defaultSourceMode) {
2355
+ super(state);
2195
2356
  // MARK: Effects
2196
- this.setParent = setParentEffect(this);
2197
2357
  this.setParentStore = setParentStoreEffect(this);
2358
+ this.setSourceMode = this.effect((input) => {
2359
+ return input.pipe(distinctUntilChanged(), switchMap((inputMode) => {
2360
+ var _a;
2361
+ const mode = (_a = inputMode === null || inputMode === void 0 ? void 0 : inputMode.toLowerCase()) !== null && _a !== void 0 ? _a : 'parent'; // default to parent mode
2362
+ if (mode === 'group') {
2363
+ return this.currentCollectionGroup$.pipe(tap((collectionGroup) => {
2364
+ this.setFirestoreCollection(collectionGroup);
2365
+ }));
2366
+ }
2367
+ else {
2368
+ // parent document collection
2369
+ return this.currentParent$.pipe(switchMap((parent) => {
2370
+ if (parent) {
2371
+ return this.collectionFactory$.pipe(tap((collectionFactory) => {
2372
+ const collection = collectionFactory(parent);
2373
+ this.setFirestoreCollection(collection);
2374
+ }));
2375
+ }
2376
+ else {
2377
+ this.setFirestoreCollection(undefined);
2378
+ return NEVER;
2379
+ }
2380
+ }));
2381
+ }
2382
+ }));
2383
+ });
2198
2384
  // MARK: Accessors
2199
- this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
2385
+ this.currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
2200
2386
  this.parent$ = this.currentParent$.pipe(filterMaybe());
2201
- this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2387
+ this.currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2202
2388
  this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
2389
+ this.currentCollectionGroup$ = this.state$.pipe(map((x) => x.collectionGroup), distinctUntilChanged(), shareReplay(1));
2390
+ this.collectionGroup$ = this.currentCollectionGroup$.pipe(filterMaybe());
2203
2391
  // MARK: State Changes
2204
2392
  /**
2205
2393
  * Sets the collection factory function to use.
2206
2394
  */
2207
2395
  this.setCollectionFactory = this.updater((state, collectionFactory) => (Object.assign(Object.assign({}, state), { collectionFactory })));
2396
+ /**
2397
+ * Sets the collection group to use.
2398
+ */
2399
+ this.setCollectionGroup = this.updater((state, collectionGroup) => (Object.assign(Object.assign({}, state), { collectionGroup })));
2208
2400
  /**
2209
2401
  * Sets the parent on the current state.
2210
2402
  */
2211
2403
  this._setParentDocument = this.updater((state, parent) => (Object.assign(Object.assign({}, state), { parent })));
2404
+ this._setParent = this._setParentDocument;
2405
+ this.setSourceMode(defaultSourceMode || 'parent');
2212
2406
  }
2213
2407
  }
2214
- AbstractDbxFirebaseCollectionWithParentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2408
+ AbstractDbxFirebaseCollectionWithParentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, deps: [{ token: null, optional: true }, { token: null, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
2215
2409
  AbstractDbxFirebaseCollectionWithParentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore });
2216
2410
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFirebaseCollectionWithParentStore, decorators: [{
2217
2411
  type: Injectable
2218
- }] });
2412
+ }], ctorParameters: function () {
2413
+ return [{ type: undefined, decorators: [{
2414
+ type: Inject,
2415
+ args: [null]
2416
+ }, {
2417
+ type: Optional
2418
+ }] }, { type: undefined, decorators: [{
2419
+ type: Inject,
2420
+ args: [null]
2421
+ }, {
2422
+ type: Optional
2423
+ }] }];
2424
+ } });
2219
2425
 
2220
2426
  /**
2221
2427
  * Abstract DbxFirebaseDocumentStore that has a parent document from which is derives it's FiresbaseCollection from.
@@ -2224,12 +2430,29 @@ class AbstractDbxFirebaseDocumentWithParentStore extends AbstractDbxFirebaseDocu
2224
2430
  constructor() {
2225
2431
  super(...arguments);
2226
2432
  // MARK: Effects
2227
- this.setParent = setParentEffect(this);
2228
2433
  this.setParentStore = setParentStoreEffect(this);
2434
+ this.setParent = this.effect((input) => {
2435
+ return input.pipe(switchMap((parent) => {
2436
+ this._setParentDocument(parent);
2437
+ if (parent) {
2438
+ return this.collectionFactory$.pipe(tap((collectionFactory) => {
2439
+ const collection = collectionFactory(parent);
2440
+ this.setFirestoreCollection(collection);
2441
+ }));
2442
+ }
2443
+ else {
2444
+ // clear the current collection
2445
+ this.setFirestoreCollection(undefined);
2446
+ // do nothing until a parent is returned.
2447
+ return NEVER;
2448
+ }
2449
+ }));
2450
+ });
2451
+ this._setParent = this.setParent;
2229
2452
  // MARK: Accessors
2230
- this.currentParent$ = this.state$.pipe(map(x => x.parent), distinctUntilChanged(), shareReplay(1));
2453
+ this.currentParent$ = this.state$.pipe(map((x) => x.parent), distinctUntilChanged(), shareReplay(1));
2231
2454
  this.parent$ = this.currentParent$.pipe(filterMaybe());
2232
- this.currentCollectionFactory$ = this.state$.pipe(map(x => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2455
+ this.currentCollectionFactory$ = this.state$.pipe(map((x) => x.collectionFactory), distinctUntilChanged(), shareReplay(1));
2233
2456
  this.collectionFactory$ = this.currentCollectionFactory$.pipe(filterMaybe());
2234
2457
  // MARK: State Changes
2235
2458
  /**
@@ -2248,6 +2471,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
2248
2471
  type: Injectable
2249
2472
  }] });
2250
2473
 
2474
+ /**
2475
+ * Abstract directive that contains a DbxFirebaseCollectionWithParentStore and provides an interface for communicating with other directives.
2476
+ */
2477
+ class DbxFirebaseCollectionWithParentStoreDirective extends DbxFirebaseCollectionStoreDirective {
2478
+ // MARK: Inputs
2479
+ set sourceMode(sourceMode) {
2480
+ this.store.setSourceMode(sourceMode);
2481
+ }
2482
+ }
2483
+ DbxFirebaseCollectionWithParentStoreDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionWithParentStoreDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2484
+ DbxFirebaseCollectionWithParentStoreDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFirebaseCollectionWithParentStoreDirective, inputs: { sourceMode: "sourceMode" }, usesInheritance: true, ngImport: i0 });
2485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseCollectionWithParentStoreDirective, decorators: [{
2486
+ type: Directive
2487
+ }], propDecorators: { sourceMode: [{
2488
+ type: Input
2489
+ }] } });
2490
+ function provideDbxFirebaseCollectionWithParentStoreDirective(sourceType, storeType) {
2491
+ const providers = [
2492
+ ...provideDbxFirebaseCollectionStoreDirective(sourceType, storeType),
2493
+ {
2494
+ provide: DbxFirebaseCollectionWithParentStoreDirective,
2495
+ useExisting: forwardRef(() => sourceType)
2496
+ }
2497
+ ];
2498
+ return providers;
2499
+ }
2500
+
2251
2501
  class DbxFirebaseModelModule {
2252
2502
  }
2253
2503
  DbxFirebaseModelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -2256,9 +2506,7 @@ DbxFirebaseModelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
2256
2506
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModelModule, decorators: [{
2257
2507
  type: NgModule,
2258
2508
  args: [{
2259
- exports: [
2260
- DbxFirebaseModelStoreModule
2261
- ]
2509
+ exports: [DbxFirebaseModelStoreModule]
2262
2510
  }]
2263
2511
  }] });
2264
2512
 
@@ -2270,9 +2518,7 @@ DbxFirebaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
2270
2518
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFirebaseModule, decorators: [{
2271
2519
  type: NgModule,
2272
2520
  args: [{
2273
- exports: [
2274
- DbxFirebaseModelModule
2275
- ]
2521
+ exports: [DbxFirebaseModelModule]
2276
2522
  }]
2277
2523
  }] });
2278
2524
 
@@ -2280,5 +2526,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
2280
2526
  * Generated bundle index. Do not edit.
2281
2527
  */
2282
2528
 
2283
- export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultFirebaseProvidersModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultFunctionsProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDocumentAuthIdDirective, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFirebaseEmulatorModule, DbxFirebaseFirestoreCollectionModule, DbxFirebaseFunctionsModule, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginModule, DbxFirebaseLoginModuleRootConfig, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModule, DbxFirebaseParsedEmulatorsConfig, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirestoreContextService, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthService, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, defaultFirebaseAuthLoginProvidersFactory, firebaseAuthErrorToReadableError, modelDoesNotExistError, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseDocumentStoreDirective, readValueFromIdToken, setParentEffect, setParentStoreEffect };
2529
+ export { AbstractConfiguredDbxFirebaseLoginButtonDirective, AbstractDbxFirebaseCollectionStore, AbstractDbxFirebaseCollectionWithParentStore, AbstractDbxFirebaseDocumentStore, AbstractDbxFirebaseDocumentWithParentStore, DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, DBX_FIREBASE_OPTIONS_TOKEN, DBX_FIREBASE_ROUTER_SYNC_DEFAULT_ID_PARAM_KEY, DBX_FIRESTORE_CONTEXT_TOKEN, DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, DbxFirebaseAppCheckHttpInterceptor, DbxFirebaseAuthLoginService, DbxFirebaseAuthModule, DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseCollectionListDirective, DbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionStoreDirective, DbxFirebaseCollectionWithParentStoreDirective, DbxFirebaseDefaultAppCheckProviderModule, DbxFirebaseDefaultAuthProviderModule, DbxFirebaseDefaultFirebaseProvidersModule, DbxFirebaseDefaultFirestoreProviderModule, DbxFirebaseDefaultFunctionsProviderModule, DbxFirebaseDefaultStorageProviderModule, DbxFirebaseDocumentAuthIdDirective, DbxFirebaseDocumentStoreDirective, DbxFirebaseDocumentStoreRouteIdDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFirebaseEmulatorModule, DbxFirebaseFirestoreCollectionModule, DbxFirebaseFunctionsModule, DbxFirebaseLoginAnonymousComponent, DbxFirebaseLoginAppleComponent, DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent, DbxFirebaseLoginComponent, DbxFirebaseLoginContext, DbxFirebaseLoginContextBackButtonComponent, DbxFirebaseLoginContextDirective, DbxFirebaseLoginEmailComponent, DbxFirebaseLoginEmailContentComponent, DbxFirebaseLoginFacebookComponent, DbxFirebaseLoginGitHubComponent, DbxFirebaseLoginGoogleComponent, DbxFirebaseLoginListComponent, DbxFirebaseLoginMicrosoftComponent, DbxFirebaseLoginModule, DbxFirebaseLoginModuleRootConfig, DbxFirebaseLoginTermsComponent, DbxFirebaseLoginTermsSimpleComponent, DbxFirebaseLoginTwitterComponent, DbxFirebaseModelModule, DbxFirebaseModelStoreModule, DbxFirebaseModule, DbxFirebaseParsedEmulatorsConfig, DbxFirebaseRegisterComponent, DbxFirebaseRegisterEmailComponent, DbxFirestoreContextService, FIREBASE_AUTH_NETWORK_REQUEST_ERROR, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY, authUserInfoFromAuthUser, authUserStateFromFirebaseAuthService, dbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstanceWithCollection, defaultFirebaseAuthLoginProvidersFactory, enableAppCheckDebugTokenGeneration, firebaseAuthErrorToReadableError, modelDoesNotExistError, provideDbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseDocumentStoreDirective, readValueFromIdToken, setParentStoreEffect };
2284
2530
  //# sourceMappingURL=dereekb-dbx-firebase.mjs.map