@dereekb/dbx-firebase 13.0.4 → 13.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dereekb-dbx-firebase.mjs","sources":["../../../../packages/dbx-firebase/src/lib/auth/auth.ts","../../../../packages/dbx-firebase/src/lib/auth/service/firebase.auth.rxjs.ts","../../../../packages/dbx-firebase/src/lib/auth/service/firebase.auth.service.ts","../../../../packages/dbx-firebase/src/lib/analytics/analytics.user.source.ts","../../../../packages/dbx-firebase/src/lib/analytics/analytics.user.events.service.ts","../../../../packages/dbx-firebase/src/lib/analytics/analytics.user.events.providers.ts","../../../../packages/dbx-firebase/src/lib/auth/appcheck/appcheck.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.options.ts","../../../../packages/dbx-firebase/src/lib/auth/appcheck/appcheck.interceptor.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.terms.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.terms.simple.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.password.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.service.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.context.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.button.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.anonymous.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.recovery.form.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.form.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.content.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.content.component.html","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.facebook.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.github.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.google.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.twitter.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/register.email.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/firebase.login.providers.default.ts","../../../../packages/dbx-firebase/src/lib/auth/login/firebase.login.providers.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.apple.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.list.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.context.directive.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.context.back.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.microsoft.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.terms.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/register.component.ts","../../../../packages/dbx-firebase/src/lib/auth/service/firebase.auth.service.delegate.ts","../../../../packages/dbx-firebase/src/lib/auth/firebase.auth.providers.ts","../../../../packages/dbx-firebase/src/lib/development/development.widget.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.scheduler.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.popup.content.form.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.scheduler.list.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.scheduler.widget.component.ts","../../../../packages/dbx-firebase/src/lib/firebase/emulators.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.emulator.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.popup.content.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.popup.content.component.html","../../../../packages/dbx-firebase/src/lib/development/development.popup.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.directive.ts","../../../../packages/dbx-firebase/src/lib/development/development.module.ts","../../../../packages/dbx-firebase/src/lib/development/development.providers.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.providers.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.emulator.providers.ts","../../../../packages/dbx-firebase/src/lib/firestore/firebase.firestore.ts","../../../../packages/dbx-firebase/src/lib/firestore/firebase.firestore.providers.ts","../../../../packages/dbx-firebase/src/lib/firestore/firebase.firestore.context.service.ts","../../../../packages/dbx-firebase/src/lib/function/firebase.function.providers.ts","../../../../packages/dbx-firebase/src/lib/model/loader/collection.change.watcher.ts","../../../../packages/dbx-firebase/src/lib/model/loader/collection.change.trigger.ts","../../../../packages/dbx-firebase/src/lib/model/loader/collection.loader.instance.ts","../../../../packages/dbx-firebase/src/lib/model/loader/document.loader.instance.ts","../../../../packages/dbx-firebase/src/lib/model/service/model.context.instance.ts","../../../../packages/dbx-firebase/src/lib/model/service/model.context.service.ts","../../../../packages/dbx-firebase/src/lib/model/service/model.context.providers.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.service.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.tracker.service.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.list.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.popover.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.popover.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.popover.button.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.sourceselect.history.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.service.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.entity.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.entity.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.popover.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.popover.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.popover.button.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.providers.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.context.store.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.source.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.entity.abstract.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.key.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.key.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.entity.debug.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.entity.debug.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.view.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.change.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.change.if.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.list.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.twoway.key.source.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.twoway.key.source.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.twoway.key.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/model.store.module.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.crud.ts","../../../../packages/dbx-firebase/src/lib/model/error.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.context.store.link.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.crud.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.rxjs.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.document.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.context.store.directive.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.collection.store.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.document.store.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.document.store.accessor.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/model/model.module.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/service/notification.template.service.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.list.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.content.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.content.component.html","../../../../packages/dbx-firebase/src/lib/modules/notification/service/notificationitem.widget.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/service/notificationitem.widget.service.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.view.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.view.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.view.default.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/container/notification.item.store.popover.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/container/notification.item.store.popover.component.html","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.item.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/container/notification.item.store.popover.button.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/notification.providers.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/service/storagefile.download.storage.service.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/service/storagefile.download.service.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.download.button.component.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.upload.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.handler.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.error.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.action.handler.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefilegroup.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefilegroup.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.initialize.document.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.sync.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/storagefile.upload.module.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/storagefile.providers.ts","../../../../packages/dbx-firebase/src/lib/pipe/key.flat.pipe.ts","../../../../packages/dbx-firebase/src/lib/pipe/key.twoway.pipe.ts","../../../../packages/dbx-firebase/src/lib/router/id.param.redirect.ts","../../../../packages/dbx-firebase/src/lib/storage/firebase.storage.ts","../../../../packages/dbx-firebase/src/lib/storage/firebase.storage.service.ts","../../../../packages/dbx-firebase/src/lib/storage/firebase.storage.providers.ts","../../../../packages/dbx-firebase/src/lib/module.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.providers.ts","../../../../packages/dbx-firebase/src/lib/providers.ts","../../../../packages/dbx-firebase/src/dereekb-dbx-firebase.ts"],"sourcesContent":["import { safeFormatToISO8601DateString } from '@dereekb/date';\nimport { type FirebaseAuthToken } from '@dereekb/firebase';\nimport { type ISO8601DateString, type Maybe } from '@dereekb/util';\nimport { type User, type UserInfo } from 'firebase/auth';\n\nexport type AuthUserInfo = Omit<UserInfo, 'providerId'> & {\n /**\n * The creation time of the user's account.\n */\n readonly creationTime?: Maybe<ISO8601DateString>;\n /**\n * The last time the user signed in and recieved a refresh token.\n */\n readonly lastSignInTime?: Maybe<ISO8601DateString>;\n};\n\nexport function authUserInfoFromAuthUser(user: User): AuthUserInfo {\n return {\n displayName: user?.displayName,\n email: user.email,\n phoneNumber: user.phoneNumber,\n photoURL: user.photoURL,\n uid: user.uid,\n creationTime: safeFormatToISO8601DateString(user.metadata.creationTime),\n lastSignInTime: safeFormatToISO8601DateString(user.metadata.lastSignInTime)\n };\n}\n\nexport function firebaseAuthTokenFromUser(user: User): FirebaseAuthToken {\n return {\n email: user.email,\n emailVerified: user.emailVerified,\n phoneNumber: user.phoneNumber,\n creationTime: safeFormatToISO8601DateString(user.metadata.creationTime),\n lastSignInTime: safeFormatToISO8601DateString(user.metadata.lastSignInTime)\n };\n}\n","import { type AuthUserState } from '@dereekb/dbx-core';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type IdTokenResult } from 'firebase/auth';\nimport { type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { type AuthUserStateObsFunction, type DbxFirebaseAuthService } from './firebase.auth.service';\n\n/**\n * Creates a AuthUserStateObsFunction that derives a user state from the input firebase auth service, and the optional stateForLoggedInUser input\n *\n * @param stateForLoggedInUser Optional function that returns an observable for the user's state if they are logged in and not an anonymous user.\n * @returns\n */\nexport function authUserStateFromFirebaseAuthServiceFunction(stateForLoggedInUser: AuthUserStateObsFunction = () => of('user')): AuthUserStateObsFunction {\n return (dbxFirebaseAuthService: DbxFirebaseAuthService) => {\n return dbxFirebaseAuthService.hasAuthUser$.pipe(\n switchMap((hasUser) => {\n let obs: Observable<AuthUserState>;\n\n if (hasUser) {\n obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => (isAnon ? of('anon' as AuthUserState) : stateForLoggedInUser(dbxFirebaseAuthService))));\n } else {\n obs = of('none');\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n };\n}\n\nexport type StateFromTokenFunction = (token: IdTokenResult) => ObservableOrValue<AuthUserState>;\n\nexport function stateFromTokenForLoggedInUserFunction(stateFromToken: StateFromTokenFunction, defaultState: AuthUserState = 'user'): AuthUserStateObsFunction {\n return (dbxFirebaseAuthService: DbxFirebaseAuthService) => {\n return readValueFromIdToken<AuthUserState>(dbxFirebaseAuthService, stateFromToken, defaultState);\n };\n}\n\n/**\n * Convenience function to read a value from an IdTokenResult off of the current user.\n *\n * @param dbxFirebaseAuthService\n * @param readValueFromIdToken\n * @param defaultValue\n * @returns\n */\nexport function readValueFromIdToken<T>(dbxFirebaseAuthService: DbxFirebaseAuthService, readValueFromIdToken: (idToken: IdTokenResult) => ObservableOrValue<T>, defaultValue: T): Observable<T> {\n return dbxFirebaseAuthService.currentAuthUserInfo$.pipe(\n switchMap((x) => {\n if (x) {\n return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap((x) => asObservable(readValueFromIdToken(x))));\n } else {\n return of(defaultValue);\n }\n })\n );\n}\n","import { filterMaybe, isNot, timeoutStartWith } from '@dereekb/rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { AuthUserState, DbxAuthService, loggedOutObsFromIsLoggedIn, loggedInObsFromIsLoggedIn, AuthUserIdentifier, authUserIdentifier, NoAuthUserIdentifier } from '@dereekb/dbx-core';\nimport { reauthenticateWithPopup, Auth, authState, idToken, User, IdTokenResult, ParsedToken, GoogleAuthProvider, signInWithPopup, AuthProvider, PopupRedirectResolver, signInAnonymously, signInWithEmailAndPassword, UserCredential, FacebookAuthProvider, GithubAuthProvider, TwitterAuthProvider, createUserWithEmailAndPassword } from '@angular/fire/auth';\nimport { of, Observable, distinctUntilChanged, shareReplay, map, switchMap, firstValueFrom, catchError, EMPTY } from 'rxjs';\nimport { AuthClaims, AuthClaimsObject, AuthRoleClaimsService, AuthRoleSet, AUTH_ADMIN_ROLE, cachedGetter, type Maybe } from '@dereekb/util';\nimport { AuthUserInfo, authUserInfoFromAuthUser, firebaseAuthTokenFromUser } from '../auth';\nimport { sendPasswordResetEmail } from 'firebase/auth';\nimport { authUserStateFromFirebaseAuthServiceFunction } from './firebase.auth.rxjs';\nimport { FirebaseAuthContextInfo } from '@dereekb/firebase';\n\n/**\n * Returns an observable that returns the state of the\n */\nexport type AuthUserStateObsFunction = (dbxFirebaseAuthService: DbxFirebaseAuthService) => Observable<AuthUserState>;\n\n// MARK: Delegate\nexport abstract class DbxFirebaseAuthServiceDelegate {\n readonly fullControlOfAuthUserState?: boolean = false;\n abstract authUserStateObs: AuthUserStateObsFunction;\n abstract authRolesObs(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<AuthRoleSet>;\n abstract isOnboarded(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<boolean>;\n /**\n * Whether or not the input roles imply the admin priviledges.\n */\n abstract isAdminInAuthRoleSet(authRoleSet: AuthRoleSet): boolean;\n abstract authRoleClaimsService?: Maybe<AuthRoleClaimsService<AuthClaimsObject>>;\n}\n\nexport const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE: DbxFirebaseAuthServiceDelegate = {\n authUserStateObs: authUserStateFromFirebaseAuthServiceFunction(),\n authRolesObs(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<AuthRoleSet> {\n return dbxFirebaseAuthService.authUserState$.pipe(map((x) => (x === 'user' ? new Set(['user']) : new Set())));\n },\n isOnboarded(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<boolean> {\n return dbxFirebaseAuthService.authUserState$.pipe(map((x) => x === 'user'));\n },\n isAdminInAuthRoleSet(authRoleSet: AuthRoleSet): boolean {\n return authRoleSet.has(AUTH_ADMIN_ROLE);\n }\n};\n\n// MARK: Service\n@Injectable()\nexport class DbxFirebaseAuthService implements DbxAuthService {\n readonly firebaseAuth = inject(Auth);\n readonly delegate = inject(DbxFirebaseAuthServiceDelegate, { optional: true }) ?? DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE;\n\n readonly _authState$: Observable<Maybe<User>> = authState(this.firebaseAuth);\n\n readonly currentAuthUser$: Observable<Maybe<User>> = this._authState$.pipe(timeoutStartWith(null as Maybe<User>, 1000), distinctUntilChanged(), shareReplay(1));\n readonly currentAuthUserInfo$: Observable<Maybe<AuthUserInfo>> = this.currentAuthUser$.pipe(map((x) => (x ? authUserInfoFromAuthUser(x) : undefined)));\n\n readonly authUser$: Observable<User> = this.currentAuthUser$.pipe(filterMaybe());\n readonly authUserInfo$: Observable<AuthUserInfo> = this.authUser$.pipe(map(authUserInfoFromAuthUser));\n\n readonly hasAuthUser$: Observable<boolean> = this.currentAuthUser$.pipe(\n map((x) => Boolean(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isAnonymousUser$: Observable<boolean> = this.authUser$.pipe(\n map((x) => x.isAnonymous),\n distinctUntilChanged(),\n shareReplay(1)\n );\n readonly isNotAnonymousUser$: Observable<boolean> = this.isAnonymousUser$.pipe(isNot(), distinctUntilChanged(), shareReplay(1));\n\n readonly isLoggedIn$: Observable<boolean> = this.hasAuthUser$;\n readonly isNotLoggedIn$: Observable<boolean> = this.isLoggedIn$.pipe(isNot());\n readonly onLogIn$: Observable<void> = loggedInObsFromIsLoggedIn(this.isLoggedIn$);\n readonly onLogOut$: Observable<void> = loggedOutObsFromIsLoggedIn(this.isLoggedIn$);\n\n readonly currentUid$: Observable<Maybe<AuthUserIdentifier>> = this.currentAuthUser$.pipe(\n map((x) => x?.uid),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly uid$: Observable<AuthUserIdentifier | NoAuthUserIdentifier> = this.currentUid$.pipe(map(authUserIdentifier), distinctUntilChanged(), shareReplay(1));\n /**\n * Alias for uid$\n */\n readonly userIdentifier$: Observable<AuthUserIdentifier | NoAuthUserIdentifier> = this.uid$;\n\n readonly currentIdTokenString$: Observable<Maybe<string>> = idToken(this.firebaseAuth).pipe(distinctUntilChanged(), shareReplay(1));\n readonly idTokenString$: Observable<string> = this.currentUid$.pipe(switchMap((x) => (x ? this.currentIdTokenString$.pipe(filterMaybe()) : EMPTY)));\n\n readonly currentIdTokenResult$: Observable<Maybe<IdTokenResult>> = this.currentAuthUser$.pipe(\n switchMap((x) => (x ? this.currentIdTokenString$.pipe(switchMap((y) => (y ? x.getIdTokenResult() : of(null)))) : of(null))),\n distinctUntilChanged(),\n shareReplay(1)\n );\n readonly idTokenResult$: Observable<IdTokenResult> = this.currentIdTokenResult$.pipe(filterMaybe());\n\n readonly currentClaims$: Observable<Maybe<ParsedToken>> = this.currentIdTokenResult$.pipe(\n map((x) => (x ? x.claims : null)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n readonly claims$: Observable<ParsedToken> = this.currentClaims$.pipe(filterMaybe());\n\n readonly currentAuthContextInfo$: Observable<Maybe<DbxFirebaseAuthContextInfo>> = this.currentAuthUser$.pipe(\n switchMap((x) => this.loadAuthContextInfoForUser(x)),\n shareReplay(1)\n );\n readonly authContextInfo$: Observable<Maybe<DbxFirebaseAuthContextInfo>> = this.currentAuthContextInfo$.pipe(filterMaybe());\n\n readonly authUserState$: Observable<AuthUserState> = (() => {\n const delegateAuthUserStateObs: Observable<AuthUserState> = this.delegate.authUserStateObs(this).pipe(\n catchError(() => of('error' as AuthUserState)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n let obs: Observable<AuthUserState>;\n\n if (this.delegate.fullControlOfAuthUserState) {\n obs = delegateAuthUserStateObs;\n } else {\n obs = this._authState$.pipe(\n distinctUntilChanged(),\n switchMap((x) => {\n if (x != null) {\n return delegateAuthUserStateObs;\n } else {\n return of('none' as AuthUserState);\n }\n })\n );\n }\n\n return obs;\n })();\n\n readonly authRoles$: Observable<AuthRoleSet> = this.delegate.authRolesObs(this);\n readonly isOnboarded$: Observable<boolean> = this.delegate.isOnboarded(this);\n\n private _authRoleClaimsService?: Maybe<AuthRoleClaimsService<AuthClaimsObject>> = this.delegate.authRoleClaimsService;\n readonly isAdminInAuthRoleSet: (authRoleSet: AuthRoleSet) => boolean = this.delegate.isAdminInAuthRoleSet;\n\n async refreshToken(): Promise<IdTokenResult> {\n const user = this.firebaseAuth.currentUser;\n\n if (!user) {\n throw new Error('no user to refresh the token for.');\n }\n\n return user.getIdTokenResult(true);\n }\n\n rolesForClaims<T extends AuthClaimsObject = AuthClaimsObject>(claims: AuthClaims<T>): AuthRoleSet {\n let result: AuthRoleSet;\n\n if (this._authRoleClaimsService) {\n return this._authRoleClaimsService.toRoles(claims);\n } else {\n console.warn('DbxFirebaseAuthService: rolesForClaims called with no authRoleClaimsService provided. An empty set is returned.');\n result = new Set();\n }\n\n return result;\n }\n\n getAuthContextInfo(): Promise<Maybe<DbxFirebaseAuthContextInfo>> {\n return firstValueFrom(this.authUser$).then((user) => this.loadAuthContextInfoForUser(user));\n }\n\n async loadAuthContextInfoForUser(user: Maybe<User>): Promise<Maybe<DbxFirebaseAuthContextInfo>> {\n let result: Maybe<DbxFirebaseAuthContextInfo>;\n\n if (user) {\n const jwtToken: IdTokenResult = await user.getIdTokenResult();\n result = dbxFirebaseAuthContextInfo(this, user, jwtToken);\n }\n\n return result;\n }\n\n logInWithGoogle(): Promise<UserCredential> {\n return this.logInWithPopup(new GoogleAuthProvider());\n }\n\n logInWithFacebook(): Promise<UserCredential> {\n return this.logInWithPopup(new FacebookAuthProvider());\n }\n\n logInWithTwitter(): Promise<UserCredential> {\n return this.logInWithPopup(new TwitterAuthProvider());\n }\n\n logInWithGithub(): Promise<UserCredential> {\n return this.logInWithPopup(new GithubAuthProvider());\n }\n\n logInWithApple(): Promise<UserCredential> {\n throw new Error('todo');\n }\n\n logInWithMicrosoft(): Promise<UserCredential> {\n // return this.logInWithPopup(new MicrosoftAuthProvider());\n throw new Error('todo');\n }\n\n logInWithPhone(): Promise<UserCredential> {\n throw new Error('todo');\n // return signInWithPhoneNumber(this.firebaseAuth, )\n }\n\n logInWithPopup(provider: AuthProvider, resolver?: PopupRedirectResolver): Promise<UserCredential> {\n return signInWithPopup(this.firebaseAuth, provider, resolver);\n }\n\n registerWithEmailAndPassword(email: string, password: string): Promise<UserCredential> {\n return createUserWithEmailAndPassword(this.firebaseAuth, email, password);\n }\n\n sendPasswordResetEmail(email: string): Promise<void> {\n return sendPasswordResetEmail(this.firebaseAuth, email);\n }\n\n logInWithEmailAndPassword(email: string, password: string): Promise<UserCredential> {\n return signInWithEmailAndPassword(this.firebaseAuth, email, password);\n }\n\n logInAsAnonymous(): Promise<UserCredential> {\n return signInAnonymously(this.firebaseAuth);\n }\n\n logOut(): Promise<void> {\n return this.firebaseAuth.signOut();\n }\n\n reauthenticateWithPopup(provider: AuthProvider, resolver?: PopupRedirectResolver): Promise<UserCredential> {\n return firstValueFrom(\n this.currentAuthUser$.pipe(\n switchMap((x: Maybe<User>) => {\n if (x) {\n return reauthenticateWithPopup(x, provider, resolver);\n } else {\n throw new Error('User is not logged in currently.');\n }\n })\n )\n );\n }\n}\n\n/**\n * FirebaseAuthContextInfo implementation from DbxFirebaseAuthService.\n */\nexport interface DbxFirebaseAuthContextInfo extends FirebaseAuthContextInfo {\n readonly service: DbxFirebaseAuthService;\n readonly user: User;\n readonly jwtToken: IdTokenResult;\n}\n\n/**\n * Creates a new DbxFirebaseAuthContextInfo instance.\n *\n * @param service\n * @param user\n * @param jwtToken\n * @returns\n */\nexport function dbxFirebaseAuthContextInfo(service: DbxFirebaseAuthService, user: User, jwtToken: IdTokenResult): DbxFirebaseAuthContextInfo {\n function getClaims<T extends AuthClaimsObject = AuthClaimsObject>(): AuthClaims<T> {\n return jwtToken.claims as AuthClaims<T>;\n }\n\n const { uid } = user;\n const token = firebaseAuthTokenFromUser(user);\n const getAuthRoles = cachedGetter(() => service.rolesForClaims(getClaims()));\n const isAdmin = cachedGetter(() => service.isAdminInAuthRoleSet(getAuthRoles()));\n\n const result: DbxFirebaseAuthContextInfo = {\n service,\n user,\n jwtToken,\n\n uid,\n\n isAdmin,\n getClaims,\n getAuthRoles,\n\n token\n };\n\n return result;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAnalyticsUser, DbxAnalyticsUserProperties, DbxAnalyticsUserSource } from '@dereekb/dbx-analytics';\nimport { FactoryWithRequiredInput, type Maybe } from '@dereekb/util';\nimport { BehaviorSubject, map, Observable, of, switchMap, shareReplay, combineLatest } from 'rxjs';\nimport { AuthUserInfo } from '../auth/auth';\nimport { DbxFirebaseAuthService } from '../auth/service/firebase.auth.service';\n\nexport type DbxFirebaseAnalyticsUserPropertiesFactory = FactoryWithRequiredInput<Observable<DbxAnalyticsUserProperties>, AuthUserInfo>;\n\nexport function readDbxAnalyticsUserPropertiesFromAuthUserInfo(user: AuthUserInfo): DbxAnalyticsUserProperties {\n const properties: DbxAnalyticsUserProperties = {\n name: user.displayName ?? '',\n email: user.email ?? '',\n createdAt: user.creationTime ?? ''\n };\n\n return properties;\n}\n\nexport const DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY: DbxFirebaseAnalyticsUserPropertiesFactory = (authUserInfo: AuthUserInfo) => of(readDbxAnalyticsUserPropertiesFromAuthUserInfo(authUserInfo));\n\n/**\n * DbxAnalyticsUserSource implementation that uses the DbxFirebaseAuthService.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirebaseAnalyticsUserSource implements DbxAnalyticsUserSource {\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n\n private _userPropertiesFactory = new BehaviorSubject<DbxFirebaseAnalyticsUserPropertiesFactory>(DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY);\n\n readonly analyticsUser$: Observable<Maybe<DbxAnalyticsUser>> = combineLatest([this._userPropertiesFactory, this.dbxFirebaseAuthService.currentAuthUserInfo$]).pipe(\n switchMap(([userPropertiesFactory, x]) => {\n let analyticsUser: Observable<Maybe<DbxAnalyticsUser>>;\n\n if (x != null) {\n analyticsUser = userPropertiesFactory(x).pipe(\n map((properties) => ({\n user: x.uid,\n properties\n }))\n );\n } else {\n analyticsUser = of(null);\n }\n\n return analyticsUser;\n }),\n shareReplay(1)\n );\n\n get userPropertiesFactory() {\n return this._userPropertiesFactory.value;\n }\n\n set userPropertiesFactory(userPropertiesFactory: DbxFirebaseAnalyticsUserPropertiesFactory) {\n this._userPropertiesFactory.next(userPropertiesFactory);\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { DbxAnalyticsService } from '@dereekb/dbx-analytics';\nimport { filterMaybe, SubscriptionObject } from '@dereekb/rxjs';\nimport { Destroyable, Initialized } from '@dereekb/util';\nimport { first } from 'rxjs';\nimport { DbxFirebaseAuthService } from '../auth/service/firebase.auth.service';\nimport { DbxFirebaseAnalyticsUserSource } from './analytics.user.source';\n\n/**\n * Service that listens for DbxFirebaseAuthService changes and emits them a user events.\n */\n@Injectable()\nexport class DbxFirebaseAnalyticsUserEventsListenerService implements Initialized, Destroyable {\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n readonly dbxFirebaseAnalyticsUserSource = inject(DbxFirebaseAnalyticsUserSource);\n readonly dbxAnalyticsService = inject(DbxAnalyticsService);\n\n private readonly _loginSub = new SubscriptionObject();\n private readonly _logoutSub = new SubscriptionObject();\n\n init(): void {\n this._loginSub.subscription = this.dbxFirebaseAuthService.onLogIn$.subscribe(() => {\n this.dbxFirebaseAnalyticsUserSource.analyticsUser$.pipe(filterMaybe(), first()).subscribe((analyticsUser) => {\n this.dbxAnalyticsService.sendUserLoginEvent(analyticsUser);\n });\n });\n\n this._logoutSub.subscription = this.dbxFirebaseAuthService.onLogOut$.subscribe(() => {\n this.dbxAnalyticsService.sendUserLogoutEvent(undefined, false); // do not clear user. Will be cleared by the analytics service\n });\n }\n\n destroy(): void {\n this._loginSub.destroy();\n this._logoutSub.destroy();\n }\n}\n","import { type EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer, type Provider } from '@angular/core';\nimport { DbxFirebaseAnalyticsUserEventsListenerService } from './analytics.user.events.service';\n\n/**\n * Creates a EnvironmentProviders that provides a DbxFirebaseAnalyticsUserEventsListenerService and initialize it when the app is initialized.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseAnalyticsUserEventsListenerService() {\n const providers: (EnvironmentProviders | Provider)[] = [\n DbxFirebaseAnalyticsUserEventsListenerService,\n // service initialization\n provideAppInitializer(() => {\n const service = inject(DbxFirebaseAnalyticsUserEventsListenerService);\n service.init();\n })\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","/**\n * Enables debug token generation for AppCheck by setting FIREBASE_APPCHECK_DEBUG_TOKEN in the browser's self/window.\n *\n * https://firebase.google.com/docs/app-check/web/debug-provider\n *\n * @param enable\n */\nexport function enableAppCheckDebugTokenGeneration(enable = true) {\n (self as unknown as { FIREBASE_APPCHECK_DEBUG_TOKEN: boolean }).FIREBASE_APPCHECK_DEBUG_TOKEN = enable;\n}\n","import { InjectionToken } from '@angular/core';\nimport { type PersistentCacheSettings } from 'firebase/firestore';\nimport { type FirebaseOptions } from 'firebase/app';\nimport { type DbxFirebaseAppCheckConfig } from './appcheck';\nimport { type DbxFirebaseEmulatorsConfig } from './emulators';\n\nexport const DBX_FIREBASE_APP_OPTIONS_TOKEN = new InjectionToken<DbxFirebaseAppOptions>('DbxFirebaseOptions');\n\n/**\n * Extends FirebaseOptions with additional properties for configuring the underlying client-side Firebase services.\n */\nexport interface DbxFirebaseAppOptions extends FirebaseOptions {\n readonly emulators: DbxFirebaseEmulatorsConfig;\n /**\n * Firebase AppCheck handling\n */\n readonly appCheck?: DbxFirebaseAppCheckConfig;\n /**\n * Passed to the Functions initialization to set the domain to use when sending requests.\n */\n readonly functionsRegionOrCustomDomain?: string | undefined;\n /**\n * Whether or not to call enableMultiTabIndexedDbPersistence() for firestore at setup time.\n *\n * True by default.\n */\n readonly enableMultiTabIndexedDbPersistence?: boolean;\n /**\n * Whether or not to call enableIndexedDbPersistence() for firestore at setup time.\n *\n * True by default if enableMultiTabIndexedDbPersistence is false.\n */\n readonly enableIndexedDbPersistence?: boolean;\n /**\n * Optional persistent cache setting to pass to the Firestore cache.\n */\n readonly persistentCacheSettings?: Omit<PersistentCacheSettings, 'tabManager'>;\n}\n","import { urlWithoutParameters } from '@dereekb/util';\nimport { DBX_FIREBASE_APP_OPTIONS_TOKEN, DbxFirebaseAppOptions } from '../../firebase/firebase.options';\nimport { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';\nimport { getToken } from 'firebase/app-check';\nimport { Observable, switchMap, first, map, from } from 'rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { AppCheck } from '@angular/fire/app-check';\n\ninterface EnabledAppCheckRoute {\n isWildcard: boolean;\n match: string;\n}\n\n/**\n * HTTP Interceptor that sets the X-Firebase-AppCheck for any requests to the routes configured in DbxFirebaseEnvironmentOptions.\n */\n@Injectable()\nexport class DbxFirebaseAppCheckHttpInterceptor implements HttpInterceptor {\n private appCheck = inject(AppCheck);\n\n private _appCheckRoutes: EnabledAppCheckRoute[] = ((dbxFirebaseOptions: DbxFirebaseAppOptions) => {\n const { appCheck } = dbxFirebaseOptions;\n\n let routes: EnabledAppCheckRoute[] = [];\n\n if (appCheck?.disabled !== false) {\n routes = (appCheck?.appCheckRoutes ?? ['/api/*']).map((route) => {\n const wildcardIndex = route.indexOf('*');\n const isWildcard = wildcardIndex === route.length - 1;\n const match = isWildcard ? route.substring(0, wildcardIndex) : route;\n\n return {\n isWildcard,\n match\n };\n });\n }\n\n return routes;\n })(inject<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN));\n\n private _isEnabled: boolean = this._appCheckRoutes.length > 0;\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n let obs: Observable<HttpEvent<unknown>>;\n\n if (this._isEnabled) {\n obs = this.matchesAnyRoute(req.url).pipe(\n switchMap((isMatch) => {\n let nextEvent: Observable<HttpEvent<unknown>>;\n\n if (isMatch) {\n nextEvent = from(\n getToken(this.appCheck).then((appCheckTokenResponse) => {\n const token = appCheckTokenResponse.token;\n let nextRequest: HttpRequest<unknown> = req;\n\n if (token) {\n nextRequest = req.clone({\n headers: req.headers.set('X-Firebase-AppCheck', token)\n });\n }\n\n return nextRequest;\n })\n ).pipe(switchMap((nextRequest) => next.handle(nextRequest)));\n } else {\n nextEvent = next.handle(req);\n }\n\n return nextEvent;\n })\n );\n } else {\n obs = next.handle(req);\n }\n\n return obs;\n }\n\n private matchesAnyRoute(inputUrl: string): Observable<boolean> {\n const url = urlWithoutParameters(inputUrl);\n\n function isEnabledRouteMatch(enabledRoute: EnabledAppCheckRoute): boolean {\n if (enabledRoute.isWildcard) {\n return url.startsWith(enabledRoute.match);\n } else {\n return url === enabledRoute.match;\n }\n }\n\n return from(this._appCheckRoutes).pipe(\n first((route) => isEnabledRouteMatch(route), false),\n map((x) => Boolean(x))\n );\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Configuration interface for DbxFirebaseLoginTermsSimpleComponent.\n */\nexport interface DbxFirebaseLoginTermsOfServiceUrlsConfig {\n /**\n * The Terms of Service URL.\n */\n readonly tosUrl: string;\n /**\n * The Privacy Policy URL.\n */\n readonly privacyUrl: string;\n}\n\n/**\n * Injection token for DbxFirebaseLoginTermsOfServiceUrlsConfig.\n */\nexport const DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG = new InjectionToken<DbxFirebaseLoginTermsOfServiceUrlsConfig>('DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG');\n","import { ClickableAnchor } from '@dereekb/dbx-core';\nimport { Component, inject } from '@angular/core';\nimport { DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG } from './login.terms';\nimport { DbxLinkComponent } from '@dereekb/dbx-web';\n\n@Component({\n template: `\n <div class=\"dbx-firebase-login-terms-view\">\n <dbx-link [anchor]=\"tosAnchor\">Terms</dbx-link>\n <span class=\"dbx-link-spacer\"></span>\n <dbx-link [anchor]=\"privacyAnchor\">Privacy</dbx-link>\n </div>\n `,\n standalone: true,\n imports: [DbxLinkComponent]\n})\nexport class DbxFirebaseLoginTermsSimpleComponent {\n readonly dbxFirebaseLoginTermsConfig = inject(DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG);\n\n readonly tosAnchor: ClickableAnchor = {\n url: this.dbxFirebaseLoginTermsConfig.tosUrl,\n target: '_blank'\n };\n\n readonly privacyAnchor: ClickableAnchor = {\n url: this.dbxFirebaseLoginTermsConfig.privacyUrl,\n target: '_blank'\n };\n}\n","import { type TextPasswordFieldPasswordParameters } from '@dereekb/dbx-form';\n\nexport type DbxFirebaseAuthLoginPasswordConfig = TextPasswordFieldPasswordParameters;\n\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG: DbxFirebaseAuthLoginPasswordConfig = {\n minLength: 6\n};\n","import { mapIterable, addToSet, removeFromSet, Maybe, ArrayOrValue, filterMaybeArrayValues } from '@dereekb/util';\nimport { Injectable, InjectionToken, Type, inject } from '@angular/core';\nimport { FirebaseLoginMethodCategory, FirebaseLoginMethodType, KnownFirebaseLoginMethodType } from './login';\nimport { DbxFirebaseLoginTermsSimpleComponent } from './login.terms.simple.component';\nimport { DbxFirebaseAuthLoginPasswordConfig, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG } from './login.password';\n\n/**\n * Default providers to inject.\n */\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN = new InjectionToken<DbxFirebaseAuthLoginProvider[]>('DefaultDbxFirebaseAuthLoginProviders');\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN = new InjectionToken<Type<unknown>>('DefaultDbxFirebaseAuthLoginTermsComponentClass');\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN = new InjectionToken<DbxFirebaseAuthLoginPasswordConfig>('DefaultDbxFirebaseAuthLoginPasswordConfig');\n\nexport interface DbxFirebaseAuthLoginProvider<D = unknown> {\n /**\n * Category for this login method.\n */\n readonly category?: FirebaseLoginMethodCategory;\n /**\n * Login method key for this type.\n */\n readonly loginMethodType: KnownFirebaseLoginMethodType | FirebaseLoginMethodType;\n /**\n * Login/Registration class to use.\n */\n readonly componentClass: Type<unknown>;\n /**\n * Custom registration type to use instead. If false, registration is not allowd for this type.\n */\n readonly registrationComponentClass?: Type<unknown> | false;\n /**\n * Custom data available to the components.\n *\n * Components are responsible for knowing the typing information of this data.\n */\n readonly componentData?: D;\n /**\n * Asset configuration for this type.\n */\n readonly assets: DbxFirebaseAuthLoginProviderAssets;\n}\n\n/**\n * Asset configurations for a provider.\n */\nexport interface DbxFirebaseAuthLoginProviderAssets {\n /**\n * URL of the logo to use.\n */\n readonly logoUrl?: string;\n /**\n * Icon to use in place of the logo.\n */\n readonly loginIcon?: string;\n /**\n * Log in text to display next to the logo.\n */\n readonly loginText?: string;\n /**\n * Optional background color to apply.\n */\n readonly backgroundColor?: string;\n /**\n * Optional background color to apply.\n */\n readonly textColor?: string;\n}\n\n/**\n * Service used for registering components used for logging in.\n *\n * Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.\n */\n@Injectable()\nexport class DbxFirebaseAuthLoginService {\n readonly loginTermsComponentClass = inject(DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, { optional: true }) ?? DbxFirebaseLoginTermsSimpleComponent;\n\n private readonly _providers = new Map<FirebaseLoginMethodType, DbxFirebaseAuthLoginProvider>();\n private readonly _assets = new Map<FirebaseLoginMethodType, DbxFirebaseAuthLoginProviderAssets>();\n\n private _enableAll = false;\n private _passwordConfig: DbxFirebaseAuthLoginPasswordConfig;\n private _enabled = new Set<FirebaseLoginMethodType>();\n\n constructor() {\n const defaultProviders = inject(DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, { optional: true });\n const passwordConfig = inject(DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, { optional: true });\n\n if (defaultProviders) {\n defaultProviders.forEach((x) => this.register(x, false));\n }\n\n this._passwordConfig = passwordConfig ?? DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG;\n }\n\n /**\n * Used to register a provider. If a provider is already registered, this will override it by default.\n *\n * @param provider\n * @param override\n */\n register(provider: DbxFirebaseAuthLoginProvider, override: boolean = true): boolean {\n if (override || !this._providers.has(provider.loginMethodType)) {\n this._providers.set(provider.loginMethodType, provider);\n\n if (provider.assets) {\n this.updateAssetsForProvider(provider.loginMethodType, provider.assets);\n }\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Updates the assets for a provider type.\n *\n * @param type\n * @param assets\n */\n updateAssetsForProvider(type: FirebaseLoginMethodType, assets: Partial<DbxFirebaseAuthLoginProviderAssets>): void {\n const current = this._assets.get(type);\n const update = {\n ...current,\n ...assets\n };\n\n this._assets.set(type, update);\n }\n\n // MARK: Enable/Disable\n /**\n * Enables all providers and any providers that will be registered.\n */\n setEnableAll(enableAll = true) {\n this._enableAll = enableAll;\n }\n\n clearEnabled(): void {\n this._enabled = new Set();\n }\n\n /**\n * Enables all of the specified types.\n *\n * @param types\n */\n enable(types: ArrayOrValue<FirebaseLoginMethodType>): void {\n addToSet(this._enabled, types);\n }\n\n disable(types: ArrayOrValue<FirebaseLoginMethodType>): void {\n removeFromSet(this._enabled, types);\n }\n\n // MARK: Get\n getRegisteredTypes(): FirebaseLoginMethodType[] {\n return Array.from(this._providers.keys());\n }\n\n getEnabledTypes(): FirebaseLoginMethodType[] {\n return this._enableAll ? this.getRegisteredTypes() : Array.from(this._enabled);\n }\n\n getLoginProvider(type: FirebaseLoginMethodType): Maybe<DbxFirebaseAuthLoginProvider> {\n return this._providers.get(type);\n }\n\n getLoginProviders(types: Iterable<FirebaseLoginMethodType>): DbxFirebaseAuthLoginProvider[] {\n return filterMaybeArrayValues(mapIterable(types ?? [], (x) => this._providers.get(x)));\n }\n\n getRegisterProvider(type: FirebaseLoginMethodType): Maybe<DbxFirebaseAuthLoginProvider> {\n return this._providers.get(type);\n }\n\n getRegisterProviders(types: Iterable<FirebaseLoginMethodType>): DbxFirebaseAuthLoginProvider[] {\n return filterMaybeArrayValues(mapIterable(types ?? [], (x) => this._providers.get(x))).filter((x) => x.registrationComponentClass !== false);\n }\n\n getProviderAssets(type: FirebaseLoginMethodType): Maybe<DbxFirebaseAuthLoginProviderAssets> {\n return this._assets.get(type);\n }\n\n getPasswordConfig() {\n return this._passwordConfig;\n }\n\n setPasswordConfig(passwordConfig: DbxFirebaseAuthLoginPasswordConfig) {\n this._passwordConfig = passwordConfig;\n }\n}\n","export type FirebaseLoginMethodType = string;\nexport type FirebaseLoginMethodCategory = string;\n\nexport type KnownFirebaseLoginMethodType = 'email' | 'phone' | 'google' | 'facebook' | 'github' | 'twitter' | 'apple' | 'microsoft' | 'anonymous'; // TODO: Add more\n\nexport const DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY = 'default';\nexport const OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY = 'oauth';\n\nexport type KnownFirebaseLoginMethodCategory = typeof DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY | typeof OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY;\n\nexport type DbxFirebaseLoginMode = 'login' | 'register';\n","import { DbxInjectionContext } from '@dereekb/dbx-core';\n\n/**\n * Injection token for a DbxInjectionContext for DbxFirebaseLoginContext.\n */\nexport abstract class DbxFirebaseLoginContext extends DbxInjectionContext {}\n","import { Component, Directive, OnInit, inject, signal, computed, ChangeDetectionStrategy, model } from '@angular/core';\nimport { WorkUsingContext } from '@dereekb/rxjs';\nimport { DbxFirebaseAuthService } from '../service/firebase.auth.service';\nimport { FirebaseLoginMethodType } from './login';\nimport { DbxFirebaseAuthLoginService } from './login.service';\nimport { DbxFirebaseLoginContext } from './login.context';\nimport { MatIconModule } from '@angular/material/icon';\nimport { DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';\nimport { Maybe } from '@dereekb/util';\n\nexport interface DbxFirebaseLoginButtonConfig {\n text: string;\n iconUrl?: string;\n icon?: string;\n buttonColor?: string;\n buttonTextColor?: string;\n handleLogin: () => Promise<unknown>;\n}\n\n/**\n * Login button and action.\n */\n@Component({\n selector: 'dbx-firebase-login-button',\n template: `\n <ng-container dbxAction [dbxActionHandler]=\"handleAction\" dbxActionValue [dbxActionSuccessHandler]=\"onActionSuccess\">\n <dbx-button dbxActionButton [customTextColor]=\"buttonTextColorSignal()\" [customButtonColor]=\"buttonColorSignal()\" [raised]=\"true\">\n <div class=\"dbx-firebase-login-button-content\">\n <span class=\"dbx-firebase-login-button-icon dbx-icon-spacer\">\n @if (iconUrlSignal()) {\n <img [src]=\"iconUrlSignal()\" />\n }\n @if (iconSignal()) {\n <mat-icon>{{ iconSignal() }}</mat-icon>\n }\n </span>\n <span class=\"dbx-firebase-login-button-text\">{{ textSignal() }}</span>\n </div>\n </dbx-button>\n </ng-container>\n `,\n host: {\n class: 'dbx-firebase-login-button'\n },\n standalone: true,\n imports: [MatIconModule, DbxActionModule, DbxButtonModule],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseLoginButtonComponent {\n readonly config = model<Maybe<DbxFirebaseLoginButtonConfig>>(null);\n\n readonly iconUrlSignal = computed(() => this.config()?.iconUrl);\n readonly iconSignal = computed(() => this.config()?.icon);\n readonly textSignal = computed(() => this.config()?.text ?? '');\n readonly buttonColorSignal = computed(() => this.config()?.buttonColor ?? 'transparent');\n readonly buttonTextColorSignal = computed(() => this.config()?.buttonTextColor);\n\n setConfig(config: Maybe<DbxFirebaseLoginButtonConfig>) {\n this.config.set(config);\n }\n\n readonly handleAction: WorkUsingContext = (_, context) => {\n const config = this.config();\n\n if (config != null) {\n const loginPromise = config.handleLogin();\n context.startWorkingWithPromise(loginPromise);\n } else {\n context.reject();\n }\n };\n\n onActionSuccess = () => {\n // todo: show checkmark on success?\n };\n}\n\n@Component({\n selector: 'dbx-firebase-login-button-container',\n template: `\n <div class=\"dbx-firebase-login-button-container\">\n <ng-content></ng-content>\n </div>\n `,\n standalone: true\n})\nexport class DbxFirebaseLoginButtonContainerComponent {}\n\nexport const DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE = `\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"configSignal()\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n`;\n\nexport const DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION: Pick<Component, 'template' | 'imports' | 'changeDetection'> = {\n template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE,\n imports: [DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n};\n\n@Directive()\nexport abstract class AbstractConfiguredDbxFirebaseLoginButtonDirective implements OnInit {\n abstract readonly loginProvider: FirebaseLoginMethodType;\n\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n readonly dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n readonly dbxFirebaseLoginContext = inject(DbxFirebaseLoginContext);\n\n // TODO: Consider updating these signals, etc.\n\n private readonly _config = signal<DbxFirebaseLoginButtonConfig | null>(null);\n readonly configSignal = computed(() => this._config());\n\n ngOnInit(): void {\n const assets = this.assetConfig;\n\n this._config.set({\n text: assets.loginText ?? `<loginText not configured>`,\n icon: assets.loginIcon,\n iconUrl: assets.logoUrl,\n buttonColor: assets.backgroundColor,\n buttonTextColor: assets.textColor,\n handleLogin: () => this.handleLogin()\n });\n }\n\n abstract handleLogin(): Promise<unknown>;\n\n get providerConfig() {\n return this.dbxFirebaseAuthLoginService.getLoginProvider(this.loginProvider);\n }\n\n get assetConfig() {\n return this.dbxFirebaseAuthLoginService.getProviderAssets(this.loginProvider) ?? {};\n }\n\n get config() {\n return this._config() as DbxFirebaseLoginButtonConfig;\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-anonymous',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginAnonymousComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'anonymous';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInAsAnonymous();\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { AbstractSyncFormlyFormDirective, DBX_FORMLY_FORM_COMPONENT_TEMPLATE, DbxFormlyFormComponentImportsModule, dbxFormlyFormComponentProviders, emailField } from '@dereekb/dbx-form';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\n\nexport interface DbxFirebaseEmailRecoveryFormValue {\n email: string;\n}\n\n@Component({\n selector: 'dbx-firebase-email-recovery-form',\n template: DBX_FORMLY_FORM_COMPONENT_TEMPLATE,\n imports: [DbxFormlyFormComponentImportsModule],\n providers: dbxFormlyFormComponentProviders(),\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseEmailRecoveryFormComponent extends AbstractSyncFormlyFormDirective<DbxFirebaseEmailRecoveryFormValue> {\n readonly fields: FormlyFieldConfig[] = [emailField({ required: true })];\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { TextPasswordFieldConfig, usernamePasswordLoginFields, DefaultUsernameLoginFieldsValue, AbstractConfigAsyncFormlyFormDirective, DBX_FORMLY_FORM_COMPONENT_TEMPLATE, DbxFormlyFormComponentImportsModule, dbxFormlyFormComponentProviders } from '@dereekb/dbx-form';\nimport { type Maybe } from '@dereekb/util';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\nimport { map, Observable } from 'rxjs';\nimport { DbxFirebaseLoginMode } from './login';\n\nexport type DbxFirebaseEmailFormValue = DefaultUsernameLoginFieldsValue;\n\nexport interface DbxFirebaseEmailFormConfig {\n readonly loginMode: DbxFirebaseLoginMode;\n readonly passwordConfig?: TextPasswordFieldConfig;\n}\n\n@Component({\n selector: 'dbx-firebase-email-form',\n template: DBX_FORMLY_FORM_COMPONENT_TEMPLATE,\n imports: [DbxFormlyFormComponentImportsModule],\n providers: dbxFormlyFormComponentProviders(),\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseEmailFormComponent extends AbstractConfigAsyncFormlyFormDirective<DbxFirebaseEmailFormValue, DbxFirebaseEmailFormConfig> {\n readonly fields$: Observable<Maybe<FormlyFieldConfig[]>> = this.currentConfig$.pipe(\n map((config) => {\n const loginMode = config?.loginMode ?? 'login';\n const passwordConfig = config?.passwordConfig;\n\n const fields: FormlyFieldConfig[] = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: loginMode === 'register' });\n return fields;\n })\n );\n}\n","import { DbxFirebaseEmailRecoveryFormValue, DbxFirebaseEmailRecoveryFormComponent } from './login.email.recovery.form.component';\nimport { DBX_INJECTION_COMPONENT_DATA, ClickableAnchor, DbxActionSuccessHandlerFunction } from '@dereekb/dbx-core';\nimport { WorkUsingObservable, WorkUsingContext } from '@dereekb/rxjs';\nimport { DbxFirebaseAuthService } from './../service/firebase.auth.service';\nimport { firstValueFrom, from, tap } from 'rxjs';\nimport { Component, EventEmitter, inject, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { DbxFirebaseLoginContext } from './login.context';\nimport { DbxFirebaseEmailFormValue, DbxFirebaseEmailFormConfig, DbxFirebaseEmailFormComponent } from './login.email.form.component';\nimport { DbxFirebaseLoginMode } from './login';\nimport { firebaseAuthErrorToReadableError } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { DbxActionErrorDirective, DbxActionModule, DbxLinkComponent, DbxButtonComponent, DbxButtonSpacerDirective, DbxErrorComponent } from '@dereekb/dbx-web';\nimport { DbxActionFormDirective, DbxFormSourceDirective } from '@dereekb/dbx-form';\n\nexport interface DbxFirebaseLoginEmailContentComponentConfig extends DbxFirebaseEmailFormConfig {\n readonly loginMode: DbxFirebaseLoginMode;\n}\n\nexport type DbxFirebaseLoginEmailContentMode = 'login' | 'recover' | 'recoversent';\n\n@Component({\n templateUrl: './login.email.content.component.html',\n imports: [NgTemplateOutlet, DbxErrorComponent, DbxLinkComponent, DbxActionErrorDirective, DbxActionFormDirective, MatButtonModule, DbxActionModule, DbxButtonComponent, DbxButtonSpacerDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFormSourceDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseLoginEmailContentComponent {\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n readonly config = inject<DbxFirebaseLoginEmailContentComponentConfig>(DBX_INJECTION_COMPONENT_DATA);\n\n readonly formConfig: DbxFirebaseEmailFormConfig = {\n loginMode: this.config.loginMode,\n passwordConfig: this.config.passwordConfig\n };\n\n private readonly _emailFormValueSignal = signal<Maybe<DbxFirebaseEmailFormValue>>(undefined);\n private readonly _recoveryFormValueSignal = signal<Maybe<DbxFirebaseEmailRecoveryFormValue>>(undefined);\n private readonly _emailModeSignal = signal<DbxFirebaseLoginEmailContentMode>('login');\n\n readonly emailFormValueSignal = this._emailFormValueSignal.asReadonly();\n readonly recoveryFormValueSignal = this._recoveryFormValueSignal.asReadonly();\n readonly emailModeSignal = this._emailModeSignal.asReadonly();\n\n readonly forgotAnchor: ClickableAnchor = {\n onClick: () => {\n this.openRecovery();\n }\n };\n\n readonly doneOrCancelled = new EventEmitter<boolean>();\n\n static openEmailLoginContext(dbxFirebaseLoginContext: DbxFirebaseLoginContext, config: DbxFirebaseLoginEmailContentComponentConfig): Promise<boolean> {\n return dbxFirebaseLoginContext.showContext({\n config: {\n componentClass: DbxFirebaseLoginEmailContentComponent,\n data: config\n },\n use: (instance) => firstValueFrom(instance.doneOrCancelled)\n });\n }\n\n get loginMode() {\n return this.config.loginMode;\n }\n\n get isLoginMode() {\n return this.loginMode === 'login';\n }\n\n get isRegisterMode() {\n return this.loginMode === 'register';\n }\n\n get buttonText() {\n return this.config.loginMode === 'register' ? 'Register' : 'Log In';\n }\n\n readonly handleLoginAction: WorkUsingObservable<DbxFirebaseEmailFormValue> = (value: DbxFirebaseEmailFormValue) => {\n // TODO(signals): double check that this performs as we want to.\n\n this._emailFormValueSignal.set(value);\n this._recoveryFormValueSignal.set({ email: value.username }); // cache value for recovery\n\n let result;\n\n if (this.loginMode === 'register') {\n result = this.dbxFirebaseAuthService.registerWithEmailAndPassword(value.username, value.password);\n } else {\n result = this.dbxFirebaseAuthService.logInWithEmailAndPassword(value.username, value.password).catch((error) => {\n throw firebaseAuthErrorToReadableError(error);\n });\n }\n\n return from(result).pipe(\n tap(() => {\n this.doneOrCancelled.next(true);\n })\n );\n };\n\n // MARK: Recovery\n openRecovery() {\n this._emailModeSignal.set('recover');\n }\n\n readonly handleRecoveryAction: WorkUsingContext<DbxFirebaseEmailRecoveryFormValue> = (value: DbxFirebaseEmailRecoveryFormValue, context) => {\n this._recoveryFormValueSignal.set(value);\n this._emailFormValueSignal.set({ username: value.email, password: '' });\n context.startWorkingWithPromise(this.dbxFirebaseAuthService.sendPasswordResetEmail(value.email));\n };\n\n // MARK: Recovering\n readonly handleRecoverySuccess: DbxActionSuccessHandlerFunction = (x) => {\n this._emailModeSignal.set('recoversent');\n };\n\n clickedRecoveryAcknowledged() {\n this._emailModeSignal.set('login');\n }\n\n // MARK: Cancel\n onCancel() {\n this.doneOrCancelled.next(false);\n }\n\n onCancelReset() {\n this.doneOrCancelled.next(false);\n }\n}\n","<div class=\"dbx-firebase-login-email-content\">\n @switch (emailModeSignal()) {\n @case ('login') {\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n }\n @case ('recover') {\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n }\n @case ('recoversent') {\n <ng-container *ngTemplateOutlet=\"resetPasswordSent\"></ng-container>\n }\n }\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]=\"emailFormValueSignal()\"></dbx-firebase-email-form>\n @if (isLoginMode) {\n <div class=\"dbx-firebase-login-email-forgot-prompt\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n }\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-button-wide\" [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 <div class=\"dbx-firebase-login-email-content-recovery\" dbxAction [dbxActionHandler]=\"handleRecoveryAction\" [dbxActionSuccessHandler]=\"handleRecoverySuccess\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValueSignal()\"></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-button-wide\" 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 </div>\n</ng-template>\n\n<!-- Reset Password Sent -->\n<ng-template #resetPasswordSent>\n <div class=\"dbx-firebase-login-email-content-recovery-sent\">\n <p class=\"dbx-hint\">A recovery email was sent to the specified address. Please check your email for next steps.</p>\n <button mat-raised-button (click)=\"clickedRecoveryAcknowledged()\">Ok</button>\n </div>\n</ng-template>\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\nimport { DbxFirebaseLoginEmailContentComponent } from './login.email.content.component';\n\n@Component({\n selector: 'dbx-firebase-login-email',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'email';\n\n handleLogin() {\n return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'login', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-facebook',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginFacebookComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'facebook';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithFacebook();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-github',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginGitHubComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'github';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithGithub();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-google',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginGoogleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'google';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithGoogle();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-twitter',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginTwitterComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'twitter';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithTwitter();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\nimport { DbxFirebaseLoginEmailContentComponent } from './login.email.content.component';\n\n@Component({\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseRegisterEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'email';\n\n handleLogin() {\n return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'register', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });\n }\n}\n","import { DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, type KnownFirebaseLoginMethodType, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY } from './login';\nimport { DbxFirebaseLoginAnonymousComponent } from './login.anonymous.component';\nimport { DbxFirebaseLoginEmailComponent } from './login.email.component';\nimport { DbxFirebaseLoginFacebookComponent } from './login.facebook.component';\nimport { DbxFirebaseLoginGitHubComponent } from './login.github.component';\nimport { DbxFirebaseLoginGoogleComponent } from './login.google.component';\nimport { type DbxFirebaseAuthLoginProvider } from './login.service';\nimport { DbxFirebaseLoginTwitterComponent } from './login.twitter.component';\nimport { DbxFirebaseRegisterEmailComponent } from './register.email.component';\n\n/**\n * Factory function for creating the default Firebase auth login providers.\n *\n * @returns Array of DbxFirebaseAuthLoginProvider\n */\nexport function defaultFirebaseAuthLoginProvidersFactory(): DbxFirebaseAuthLoginProvider[] {\n // NOTE: Asset URLS are from Firebase.\n // https://firebase.google.com/docs/auth/web/firebaseui\n const baseFirebaseJSUrl = `https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth`;\n\n // NOTE: Colors are from https://brandcolors.net/\n return [\n {\n category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'email' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginEmailComponent,\n registrationComponentClass: DbxFirebaseRegisterEmailComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/mail.svg`,\n loginText: 'Continue with Email',\n backgroundColor: '#ea4335', // gmail red color\n textColor: '#FFF'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'google' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGoogleComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/google.svg`,\n loginText: 'Continue with Google',\n backgroundColor: '#FFF',\n textColor: '#757575'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'facebook' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginFacebookComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/facebook.svg`,\n loginText: 'Continue with Facebook',\n backgroundColor: '#4267B2',\n textColor: '#FFF'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'twitter' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginTwitterComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/twitter.svg`,\n loginText: 'Continue with Twitter',\n backgroundColor: '#1da1f2',\n textColor: '#FFF'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'github' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGitHubComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/github.svg`,\n loginText: 'Continue with Github',\n backgroundColor: '#333',\n textColor: '#FFF'\n }\n },\n /*{\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'apple' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGitHubComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/apple.svg`,\n loginText: 'Continue with Apple',\n backgroundColor: '#333',\n textColor: '#FFF'\n }\n }, {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'microsoft' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGitHubComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/microsoft.svg`,\n loginText: 'Continue with Microsoft',\n backgroundColor: '#ea3e23',\n textColor: '#FFF'\n }\n },*/ {\n category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'anonymous' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginAnonymousComponent,\n assets: {\n loginIcon: 'account_circle',\n loginText: 'Continue as Guest',\n backgroundColor: '#000',\n textColor: '#FFF'\n }\n }\n ];\n}\n","import { inject, type EnvironmentProviders, makeEnvironmentProviders, provideAppInitializer, type Provider, type Type } from '@angular/core';\nimport { type FirebaseLoginMethodType } from './login';\nimport { type DbxFirebaseAuthLoginPasswordConfig } from './login.password';\nimport { DbxFirebaseAuthLoginService, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN } from './login.service';\nimport { DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG, type DbxFirebaseLoginTermsOfServiceUrlsConfig } from './login.terms';\nimport { defaultFirebaseAuthLoginProvidersFactory } from './firebase.login.providers.default';\n\n/**\n * Configuration for provideDbxFirebaseLogin().\n */\nexport interface ProvideDbxFirebaseLoginConfig {\n /**\n * DbxFirebaseLoginTermsOfServiceUrlsConfig configuration.\n */\n readonly termsOfServiceUrls: DbxFirebaseLoginTermsOfServiceUrlsConfig;\n\n /**\n * Enabled login methods. Set to true to enable all methods.\n */\n readonly enabledLoginMethods: FirebaseLoginMethodType[] | true;\n\n /**\n * Configures the default login terms component class via DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN.\n */\n readonly loginTermsComponentClass?: Type<unknown>;\n\n /**\n * Optional password configuration.\n */\n readonly passwordConfig?: DbxFirebaseAuthLoginPasswordConfig;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxFirebaseLogin configuration.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseLogin(config: ProvideDbxFirebaseLoginConfig): EnvironmentProviders {\n const { termsOfServiceUrls: loginTerms, enabledLoginMethods, loginTermsComponentClass, passwordConfig } = config;\n\n const providers: (EnvironmentProviders | Provider)[] = [\n // Default login providers\n {\n provide: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN,\n useFactory: defaultFirebaseAuthLoginProvidersFactory\n },\n // Config for terms\n {\n provide: DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG,\n useValue: loginTerms\n },\n DbxFirebaseAuthLoginService,\n // service initialization\n provideAppInitializer(() => {\n const dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n if (enabledLoginMethods === true) {\n dbxFirebaseAuthLoginService.setEnableAll();\n } else {\n dbxFirebaseAuthLoginService.enable(enabledLoginMethods);\n }\n })\n ];\n\n // Terms component\n if (loginTermsComponentClass) {\n providers.push({\n provide: DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN,\n useValue: loginTermsComponentClass\n });\n }\n\n // Password config\n if (passwordConfig) {\n providers.push({\n provide: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN,\n useValue: passwordConfig\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-apple',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginAppleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'apple';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithApple();\n }\n}\n","import { DbxFirebaseAuthLoginProvider, DbxFirebaseAuthLoginService } from './login.service';\nimport { DbxFirebaseLoginMode, FirebaseLoginMethodType, FirebaseLoginMethodCategory } from './login';\nimport { Component, Type, computed, inject, input } from '@angular/core';\nimport { containsStringAnyCase, Maybe, ArrayOrValue, excludeValuesFromArray, asArray } from '@dereekb/util';\nimport { DbxInjectionComponent, DbxInjectionComponentConfig } from '@dereekb/dbx-core';\n\nexport type DbxFirebaseLoginListItemInjectionComponentConfig = DbxInjectionComponentConfig & Pick<DbxFirebaseAuthLoginProvider, 'loginMethodType'>;\n\n/**\n * Pre-configured login component that displays all configured login types.\n */\n@Component({\n selector: 'dbx-firebase-login-list',\n template: `\n @for (config of providersInjectionConfigsSignal(); track config.loginMethodType) {\n <div class=\"dbx-firebase-login-item\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n `,\n host: {\n class: 'dbx-firebase-login-list'\n },\n standalone: true,\n imports: [DbxInjectionComponent]\n})\nexport class DbxFirebaseLoginListComponent {\n readonly dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n\n readonly loginMode = input<DbxFirebaseLoginMode>('login');\n readonly providerTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly omitProviderTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly providerCategories = input<Maybe<ArrayOrValue<FirebaseLoginMethodCategory>>>();\n\n readonly providerTypesSignal = computed(() => {\n const providerTypes = this.providerTypes();\n const omitProviderTypes = this.omitProviderTypes();\n\n const baseTypes = providerTypes ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();\n const types = omitProviderTypes ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;\n return types;\n });\n\n readonly providersSignal = computed(() => {\n const providerCategories = asArray(this.providerCategories());\n let providers = this.dbxFirebaseAuthLoginService.getLoginProviders(this.providerTypesSignal());\n\n if (providerCategories.length) {\n const categories = new Set(providerCategories);\n providers = providers.filter((x) => containsStringAnyCase(categories, x.category ?? ''));\n }\n\n return providers;\n });\n\n readonly providersInjectionConfigsSignal = computed<DbxFirebaseLoginListItemInjectionComponentConfig[]>(() => {\n let providers = this.providersSignal();\n let mapFn: (x: DbxFirebaseAuthLoginProvider) => DbxFirebaseLoginListItemInjectionComponentConfig;\n\n if (this.loginMode() === 'register') {\n providers = providers.filter((x) => x.registrationComponentClass !== false); // providers with \"registrationComponentClass\" set to false are not available for registration\n mapFn = (x: DbxFirebaseAuthLoginProvider) => ({ componentClass: (x.registrationComponentClass ?? x.componentClass) as Type<unknown>, loginMethodType: x.loginMethodType });\n } else {\n mapFn = (x: DbxFirebaseAuthLoginProvider) => ({ componentClass: x.componentClass as Type<unknown>, loginMethodType: x.loginMethodType });\n }\n\n const configs = providers.map(mapFn);\n return configs;\n });\n}\n","import { Directive } from '@angular/core';\nimport { AbstractForwardDbxInjectionContextDirective } from '@dereekb/dbx-core';\nimport { DbxFirebaseLoginContext } from './login.context';\n\n/**\n * DbxFirebaseLoginContext implementation.\n */\n@Directive({\n selector: '[dbxFirebaseLoginContext]',\n standalone: true,\n providers: [\n {\n provide: DbxFirebaseLoginContext,\n useExisting: DbxFirebaseLoginContextDirective\n }\n ]\n})\nexport class DbxFirebaseLoginContextDirective extends AbstractForwardDbxInjectionContextDirective implements DbxFirebaseLoginContext {}\n","import { DbxFirebaseLoginMode, FirebaseLoginMethodCategory, FirebaseLoginMethodType } from './login';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { DbxInjectionContextDirective } from '@dereekb/dbx-core';\nimport { DbxFirebaseLoginListComponent } from './login.list.component';\nimport { DbxFirebaseLoginContextDirective } from './login.context.directive';\n\n/**\n * Pre-configured login component that displays all configured login types.\n */\n@Component({\n selector: 'dbx-firebase-login',\n standalone: true,\n imports: [DbxInjectionContextDirective, DbxFirebaseLoginContextDirective, DbxFirebaseLoginListComponent],\n template: `\n <ng-container *dbxInjectionContext dbxFirebaseLoginContext>\n <dbx-firebase-login-list [providerTypes]=\"providerTypes()\" [omitProviderTypes]=\"omitProviderTypes()\" [providerCategories]=\"providerCategories()\" [loginMode]=\"loginMode()\"></dbx-firebase-login-list>\n </ng-container>\n `,\n host: {\n class: 'd-block dbx-firebase-login',\n '[class]': '{ \"dbx-firebase-register\": loginMode() === \"register\" }'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseLoginComponent {\n readonly loginMode = input<DbxFirebaseLoginMode>('login');\n readonly providerTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly omitProviderTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly providerCategories = input<Maybe<ArrayOrValue<FirebaseLoginMethodCategory>>>();\n}\n","import { ClickableAnchor } from '@dereekb/dbx-core';\nimport { Component, output } from '@angular/core';\nimport { DbxRouterAnchorModule } from '@dereekb/dbx-web';\n\n@Component({\n selector: 'dbx-firebase-login-context-back-button',\n standalone: true,\n imports: [DbxRouterAnchorModule],\n template: `\n <dbx-link [anchor]=\"anchor\">Choose other login method.</dbx-link>\n `\n})\nexport class DbxFirebaseLoginContextBackButtonComponent {\n readonly cancelLogin = output<void>();\n\n readonly anchor: ClickableAnchor = {\n onClick: () => this.cancelLogin.emit()\n };\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-microsoft',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginMicrosoftComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'microsoft';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithMicrosoft();\n }\n}\n","import { DbxInjectionComponent, DbxInjectionComponentConfig } from '@dereekb/dbx-core';\n\nimport { Component, inject } from '@angular/core';\nimport { DbxFirebaseAuthLoginService } from './login.service';\n\n@Component({\n selector: 'dbx-firebase-login-terms',\n template: `\n <dbx-injection [config]=\"config\"></dbx-injection>\n `,\n host: {\n class: 'dbx-firebase-login-terms d-block'\n },\n imports: [DbxInjectionComponent],\n standalone: true\n})\nexport class DbxFirebaseLoginTermsComponent {\n readonly dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n\n readonly config: DbxInjectionComponentConfig = {\n componentClass: this.dbxFirebaseAuthLoginService.loginTermsComponentClass\n };\n}\n","import { FirebaseLoginMethodCategory, FirebaseLoginMethodType } from './login';\nimport { Component, input } from '@angular/core';\nimport { ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { DbxFirebaseLoginComponent } from './login.component';\n\n/**\n * Pre-configured register component that displays all configured login types and their registration components.\n */\n@Component({\n selector: 'dbx-firebase-register',\n template: `\n <dbx-firebase-login loginMode=\"register\" [providerTypes]=\"providerTypes()\" [omitProviderTypes]=\"omitProviderTypes()\" [providerCategories]=\"providerCategories()\"></dbx-firebase-login>\n `,\n imports: [DbxFirebaseLoginComponent],\n standalone: true\n})\nexport class DbxFirebaseRegisterComponent {\n readonly providerTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly omitProviderTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly providerCategories = input<Maybe<ArrayOrValue<FirebaseLoginMethodCategory>>>();\n}\n","import { addToSetCopy, type AuthClaims, type AuthClaimsObject, type AuthRoleClaimsService, type AuthRoleSet, filterMaybeArrayValues } from '@dereekb/util';\nimport { map, type Observable, switchMap } from 'rxjs';\nimport { authUserStateFromFirebaseAuthServiceFunction, stateFromTokenForLoggedInUserFunction, type StateFromTokenFunction } from './firebase.auth.rxjs';\nimport { type AuthUserStateObsFunction, type DbxFirebaseAuthService, type DbxFirebaseAuthServiceDelegate, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE } from './firebase.auth.service';\n\nexport interface AuthRolesObsWithClaimsServiceConfig<T extends AuthClaimsObject> extends Partial<Pick<DbxFirebaseAuthServiceDelegate, 'isAdminInAuthRoleSet' | 'authUserStateObs'>> {\n /**\n * (Optional) alternative to supplying authUserStateObs. Is passed to authUserStateFromFirebaseAuthService.\n */\n readonly stateForLoggedInUser?: AuthUserStateObsFunction;\n /**\n * (Optional) alternative to supplying authUserStateObs.\n */\n readonly stateForLoggedInUserToken?: StateFromTokenFunction;\n /**\n * Claims service to use for decoding.\n */\n readonly claimsService: AuthRoleClaimsService<T>;\n /**\n * Whether or not to also add the current AuthUserState value to decoded roles.\n */\n readonly addAuthUserStateToRoles?: boolean;\n}\n\nexport function authRolesObsWithClaimsService<T extends AuthClaimsObject>(config: AuthRolesObsWithClaimsServiceConfig<T>): (dbxFirebaseAuthService: DbxFirebaseAuthService) => Observable<AuthRoleSet> {\n const { addAuthUserStateToRoles: addAuthUserState, claimsService } = config;\n\n return (dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<AuthRoleSet> => {\n let obs = dbxFirebaseAuthService.idTokenResult$.pipe(map((x) => claimsService.toRoles(x.claims as AuthClaims<T>)));\n\n if (addAuthUserState) {\n obs = obs.pipe(switchMap((authRoleSet: AuthRoleSet) => dbxFirebaseAuthService.authUserState$.pipe(map((userState) => addToSetCopy(authRoleSet, [userState])))));\n }\n\n return obs;\n };\n}\n\nexport type DefaultDbxFirebaseAuthServiceDelegateWithClaimsServiceConfig<T extends AuthClaimsObject> = AuthRolesObsWithClaimsServiceConfig<T>;\n\nexport function defaultDbxFirebaseAuthServiceDelegateWithClaimsService<T extends AuthClaimsObject>(config: DefaultDbxFirebaseAuthServiceDelegateWithClaimsServiceConfig<T>): DbxFirebaseAuthServiceDelegate {\n if (filterMaybeArrayValues([config.stateForLoggedInUser, config.stateForLoggedInUserToken, config.authUserStateObs]).length > 1) {\n throw new Error('Cannot specify a combination of \"stateForLoggedInUserToken\", \"stateForLoggedInUser\" and \"authUserStateObs\". Must specify one at max.');\n }\n\n const authUserStateObs = config.authUserStateObs ?? authUserStateFromFirebaseAuthServiceFunction(config.stateForLoggedInUserToken ? stateFromTokenForLoggedInUserFunction(config.stateForLoggedInUserToken) : config.stateForLoggedInUser);\n\n return {\n authUserStateObs,\n isAdminInAuthRoleSet: config.isAdminInAuthRoleSet ?? DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE.isAdminInAuthRoleSet,\n authRolesObs: authRolesObsWithClaimsService(config),\n isOnboarded: DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE.isOnboarded,\n authRoleClaimsService: config.claimsService as unknown as AuthRoleClaimsService<AuthClaimsObject>\n };\n}\n","import { type EnvironmentProviders, Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAuthService } from '@dereekb/dbx-core';\nimport { DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate } from './service/firebase.auth.service';\n\n/**\n * Configuration for provideDbxFirebaseAuth().\n */\nexport interface ProvideDbxFirebaseAuthConfig {\n /**\n * Optional custom delegate factory for the configured DbxFirebaseAuthService.\n *\n * @param injector\n * @returns\n */\n delegateFactory?: (injector: Injector) => DbxFirebaseAuthServiceDelegate;\n}\n\n/**\n * Creates EnvironmentProviders for the DbxFirebaseAuthService, and configures the DbxFirebaseAuthService to provide DbxAuthService.\n *\n * @param config\n * @returns\n */\nexport function provideDbxFirebaseAuth(config?: ProvideDbxFirebaseAuthConfig): EnvironmentProviders {\n const providers: Provider[] = [\n DbxFirebaseAuthService,\n {\n provide: DbxAuthService,\n useExisting: DbxFirebaseAuthService\n }\n ];\n\n if (config?.delegateFactory) {\n providers.push({\n provide: DbxFirebaseAuthServiceDelegate,\n useFactory: config.delegateFactory,\n deps: [Injector]\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { iterableToArray } from '@dereekb/util';\nimport { Inject, Injectable, InjectionToken, Optional, inject } from '@angular/core';\nimport { DbxWidgetService, DbxWidgetType } from '@dereekb/dbx-web';\nimport { DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\n\n/**\n * Default providers to inject.\n */\nexport const DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN = new InjectionToken<DbxFirebaseDevelopmentWidgetEntry[]>('DefaultDbxFirebaseDevelopmentWidgetEntries');\n\n/**\n * Service used for registering widgets used for development.\n *\n * Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.\n */\n@Injectable()\nexport class DbxFirebaseDevelopmentWidgetService {\n readonly dbxWidgetService = inject(DbxWidgetService);\n\n private readonly _entries = new Map<DbxWidgetType, DbxFirebaseDevelopmentWidgetEntry>();\n\n constructor(@Optional() @Inject(DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN) defaultEntries: DbxFirebaseDevelopmentWidgetEntry[]) {\n if (defaultEntries) {\n defaultEntries.forEach((x) => this.register(x, false));\n }\n }\n\n /**\n * Used to register a provider. If a provider is already registered, this will override it by default.\n *\n * @param provider\n * @param override\n */\n register(provider: DbxFirebaseDevelopmentWidgetEntry, override: boolean = true): boolean {\n const type = provider.widget.type;\n\n if (override || !this._entries.has(type)) {\n this._entries.set(type, provider);\n this.dbxWidgetService.register(provider.widget, override);\n return true;\n } else {\n return false;\n }\n }\n\n getEntryWidgetIdentifiers(): DbxWidgetType[] {\n return Array.from(this._entries.keys());\n }\n\n getEntries(): DbxFirebaseDevelopmentWidgetEntry[] {\n return iterableToArray(this._entries.values());\n }\n}\n","import { DbxAuthService } from '@dereekb/dbx-core';\nimport { tap, switchMap, BehaviorSubject, Observable, interval, combineLatest, map, exhaustMap, distinctUntilChanged, shareReplay } from 'rxjs';\nimport { Initialized, Milliseconds, runAsyncTasksForValues } from '@dereekb/util';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { lazyFrom, SubscriptionObject, switchMapWhileTrue } from '@dereekb/rxjs';\nimport { FirebaseDevelopmentFunctions, ScheduledFunctionDevelopmentFirebaseFunctionListEntry, ScheduledFunctionDevelopmentFirebaseFunctionListResult, ScheduledFunctionDevelopmentFunctionTypeEnum } from '@dereekb/firebase';\n\n/**\n * Whether or not the scheduler should be enabled.\n */\nexport const DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN = new InjectionToken('DefaultDbxFirebaseDevelopmentSchedulerEnabled');\n\n/**\n * Service used for hitting the scheduler in the development environment using the\n */\n@Injectable()\nexport class DbxFirebaseDevelopmentSchedulerService implements Initialized {\n readonly dbxAuthService = inject(DbxAuthService);\n readonly firebaseDevelopmentFunctions = inject(FirebaseDevelopmentFunctions);\n\n private readonly _sub = new SubscriptionObject();\n private readonly _enabled = new BehaviorSubject<boolean>(inject<boolean>(DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN, { optional: true }) !== false);\n\n private readonly _timerInterval = new BehaviorSubject<Milliseconds>(60 * 1000);\n private readonly _error = new BehaviorSubject<boolean>(false);\n\n readonly enabled$ = this._enabled.asObservable();\n readonly running$ = combineLatest([this._enabled, this.dbxAuthService.authUserState$.pipe(map((x) => x === 'user'))]).pipe(\n map(([enabled, userReady]) => enabled && userReady),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly timerInterval$ = this._timerInterval.asObservable();\n readonly error$ = this._error.pipe(distinctUntilChanged());\n\n readonly schedulerList$: Observable<ScheduledFunctionDevelopmentFirebaseFunctionListEntry[]> = lazyFrom(() => {\n return this.firebaseDevelopmentFunctions\n .scheduledFunction({ type: ScheduledFunctionDevelopmentFunctionTypeEnum.LIST })\n .then((result) => {\n const list = result as ScheduledFunctionDevelopmentFirebaseFunctionListResult;\n return list.list;\n })\n .catch((e) => {\n console.error('Failed to retrieve development schedule list from server.', e);\n throw e;\n });\n });\n\n init(): void {\n this._sub.subscription = this.running$\n .pipe(\n switchMapWhileTrue(() => {\n console.log('DbxFirebaseDevelopmentSchedulerService enabled.');\n return combineLatest([this._timerInterval, this.schedulerList$]).pipe(\n switchMap(([timerInterval, schedulerList]) => {\n const executionOrder: string[] = schedulerList.map((x) => x.name);\n\n return interval(timerInterval).pipe(\n exhaustMap(() => {\n console.log('Running scheduled tasks in order... ', executionOrder);\n\n return runAsyncTasksForValues(executionOrder, (taskName) => this.runScheduledFunction(taskName), { sequential: true, retriesAllowed: false })\n .then(() => true)\n .catch((e) => {\n console.log('Failed running scheduled task: ', e);\n this._error.next(true);\n return false;\n });\n }),\n tap((success) => {\n if (success) {\n console.log('Successfully finished running all scheduled tasks.');\n this._error.next(false);\n }\n })\n );\n })\n );\n })\n )\n .subscribe();\n }\n\n runScheduledFunction(taskName: string) {\n return this.firebaseDevelopmentFunctions.scheduledFunction({\n run: taskName,\n type: ScheduledFunctionDevelopmentFunctionTypeEnum.RUN\n });\n }\n\n setTimer(timerInterval: number) {\n this._timerInterval.next(timerInterval);\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { AbstractConfigAsyncFormlyFormDirective, pickableItemChipField, filterPickableItemFieldValuesByLabel, SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue, DBX_FORMLY_FORM_COMPONENT_TEMPLATE, dbxFormlyFormComponentProviders, DbxFormlyFormComponentImportsModule } from '@dereekb/dbx-form';\nimport { type Maybe } from '@dereekb/util';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\nimport { map, Observable, of } from 'rxjs';\nimport { DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\n\nexport interface DbxFirebaseDevelopmentPopupContentFormInput {\n readonly entries: DbxFirebaseDevelopmentWidgetEntry[];\n}\n\nexport interface DbxFirebaseDevelopmentPopupContentFormValue {\n readonly specifier?: Maybe<string>;\n}\n\nconst DISPLAY_FOR_DEVELOPMENT_POPUP_STRING_VALUE: SearchableValueFieldDisplayFn<string, DbxFirebaseDevelopmentWidgetEntry> = (values: SearchableValueFieldValue<string, DbxFirebaseDevelopmentWidgetEntry>[]) => {\n const displayValues: SearchableValueFieldDisplayValue<string, DbxFirebaseDevelopmentWidgetEntry>[] = values.map((x) => ({ ...x, label: x.meta?.label || x.value }));\n const obs: Observable<SearchableValueFieldDisplayValue<string, DbxFirebaseDevelopmentWidgetEntry>[]> = of(displayValues);\n return obs;\n};\n\n@Component({\n selector: 'dbx-firebase-development-popup-content-form',\n template: DBX_FORMLY_FORM_COMPONENT_TEMPLATE,\n imports: [DbxFormlyFormComponentImportsModule],\n providers: dbxFormlyFormComponentProviders(),\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseDevelopmentPopupContentFormComponent extends AbstractConfigAsyncFormlyFormDirective<DbxFirebaseDevelopmentPopupContentFormValue, DbxFirebaseDevelopmentPopupContentFormInput> {\n readonly fields$: Observable<FormlyFieldConfig[]> = this.config$.pipe(\n map((config: DbxFirebaseDevelopmentPopupContentFormInput) => {\n return [\n pickableItemChipField<string, DbxFirebaseDevelopmentWidgetEntry>({\n key: 'specifier',\n filterLabel: 'Tools',\n description: 'Pick a tool to get started.',\n filterValues: filterPickableItemFieldValuesByLabel,\n loadValues: () => of(config.entries.map((y) => ({ value: y.widget.type, meta: y }))),\n displayForValue: DISPLAY_FOR_DEVELOPMENT_POPUP_STRING_VALUE,\n asArrayValue: false\n })\n ];\n })\n );\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, provideDbxListView, DbxValueAsListItem, provideDbxListViewWrapper, DbxActionModule, DbxButtonComponent, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, DbxSelectionValueListViewComponentImportsModule, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE } from '@dereekb/dbx-web';\nimport { from, of } from 'rxjs';\nimport { ScheduledFunctionDevelopmentFirebaseFunctionListEntry } from '@dereekb/firebase';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { WorkUsingContext } from '@dereekb/rxjs';\nimport { DbxActionButtonDirective } from '@dereekb/dbx-core';\n\nexport type ScheduledFunctionDevelopmentFirebaseFunctionListEntryWithSelection = DbxValueAsListItem<ScheduledFunctionDevelopmentFirebaseFunctionListEntry>;\n\n@Component({\n selector: 'dbx-firebase-development-scheduler-list',\n template: DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxListWrapperComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListViewWrapper(DbxFirebaseDevelopmentSchedulerListComponent),\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerListComponent extends AbstractDbxSelectionListWrapperDirective<ScheduledFunctionDevelopmentFirebaseFunctionListEntry> {\n constructor() {\n super({\n componentClass: DbxFirebaseDevelopmentSchedulerListViewComponent,\n defaultSelectionMode: 'view'\n });\n }\n}\n\n@Component({\n selector: 'dbx-firebase-development-scheduler-list-view',\n template: DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxSelectionValueListViewComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListView(DbxFirebaseDevelopmentSchedulerListViewComponent),\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerListViewComponent extends AbstractDbxSelectionListViewDirective<ScheduledFunctionDevelopmentFirebaseFunctionListEntry> {\n readonly config: DbxSelectionValueListViewConfig<ScheduledFunctionDevelopmentFirebaseFunctionListEntryWithSelection> = {\n componentClass: DbxFirebaseDevelopmentSchedulerListViewItemComponent,\n mapValuesToItemValues: (x) => of(x.map((y) => ({ ...y, icon: y.icon, itemValue: y })))\n };\n}\n\n@Component({\n template: `\n <div dbxAction dbxActionValue useFastTriggerPreset [dbxActionHandler]=\"handleRun\">\n <dbx-button dbxActionButton [text]=\"'Run ' + name\"></dbx-button>\n <div *dbxActionHasSuccess=\"3000\" class=\"dbx-success\">Success</div>\n </div>\n `,\n imports: [DbxActionModule, DbxButtonComponent, DbxActionButtonDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerListViewItemComponent extends AbstractDbxValueListViewItemComponent<ScheduledFunctionDevelopmentFirebaseFunctionListEntry> {\n readonly dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);\n\n get name() {\n return this.itemValue.name;\n }\n\n readonly handleRun: WorkUsingContext<unknown, unknown> = (value, context) => {\n context.startWorkingWithObservable(from(this.dbxFirebaseDevelopmentSchedulerService.runScheduledFunction(this.name)));\n };\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { loadingStateFromObs } from '@dereekb/rxjs';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\nimport { DbxFirebaseDevelopmentSchedulerListComponent } from './development.scheduler.list.component';\n\nexport const DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY = 'DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET';\n\nexport function developmentFirebaseServerSchedulerWidgetEntry(): DbxFirebaseDevelopmentWidgetEntry {\n return {\n label: 'Run Scheduled Task',\n widget: {\n type: DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY,\n componentClass: DbxFirebaseDevelopmentSchedulerWidgetComponent\n }\n };\n}\n\n@Component({\n template: `\n <div>\n <dbx-firebase-development-scheduler-list [state]=\"state$\"></dbx-firebase-development-scheduler-list>\n </div>\n `,\n imports: [DbxFirebaseDevelopmentSchedulerListComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerWidgetComponent {\n readonly dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);\n readonly entries$ = this.dbxFirebaseDevelopmentSchedulerService.schedulerList$;\n readonly state$ = loadingStateFromObs(this.entries$);\n}\n","export interface DbxFirebaseEmulatorConfig {\n /**\n * Port to target.\n */\n readonly port: number;\n /**\n * Defaults to localhost if not provided.\n */\n readonly host?: string;\n}\n\nexport interface DbxFirebaseEmulatorsConfig {\n /**\n * Whether or not to enable the emulators.\n *\n * Defaults to false.\n */\n readonly useEmulators?: boolean;\n /**\n * Default host to target. Defaults to localhost if not provided.\n */\n readonly host?: string;\n /**\n * emulator UI configuration\n */\n readonly ui?: DbxFirebaseEmulatorConfig;\n /**\n * Auth emulator configuration\n */\n readonly auth?: DbxFirebaseEmulatorConfig;\n /**\n * Firestore emulator configuration\n */\n readonly firestore?: DbxFirebaseEmulatorConfig;\n /**\n * Firestore emulator configuration\n */\n readonly storage?: DbxFirebaseEmulatorConfig;\n /**\n * Functions emulator configuration\n */\n readonly functions?: DbxFirebaseEmulatorConfig;\n /**\n * Database emulator configuration\n */\n readonly database?: DbxFirebaseEmulatorConfig;\n}\n\nexport abstract class DbxFirebaseParsedEmulatorsConfig implements DbxFirebaseEmulatorsConfig {\n abstract readonly useEmulators: boolean;\n readonly host?: string;\n /**\n * Fix used by some components to allow changing 0.0.0.0 to localhost. Defaults to true.\n */\n readonly allow0000ToLocalhost?: boolean;\n readonly ui?: Required<DbxFirebaseEmulatorConfig>;\n readonly auth?: Required<DbxFirebaseEmulatorConfig>;\n readonly firestore?: Required<DbxFirebaseEmulatorConfig>;\n readonly storage?: Required<DbxFirebaseEmulatorConfig>;\n readonly functions?: Required<DbxFirebaseEmulatorConfig>;\n readonly database?: Required<DbxFirebaseEmulatorConfig>;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { ClickableUrl } from '@dereekb/dbx-core';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseParsedEmulatorsConfig } from './emulators';\n\n@Injectable()\nexport class DbxFirebaseEmulatorService {\n readonly emulatorsConfig = inject(DbxFirebaseParsedEmulatorsConfig);\n\n get useEmulators(): boolean {\n return this.emulatorsConfig.useEmulators || false;\n }\n\n get emulatorUIAnchor(): Maybe<ClickableUrl> {\n const ui = this.emulatorsConfig.ui;\n let host = this.emulatorsConfig.host;\n\n // Issue where sometimes 0.0.0.0 is not configured to handle transferring traffic properly, compared to localhost. This sets 0.0.0.0 to localhost unless disallowed.\n if (host === '0.0.0.0' && this.emulatorsConfig.allow0000ToLocalhost !== false) {\n host = 'localhost';\n }\n\n return ui\n ? {\n url: `http://${host ?? 'localhost'}:${ui.port}`,\n target: '_blank'\n }\n : undefined;\n }\n}\n","import { ClickableAnchor, DbxActionAutoTriggerDirective, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxAuthService, cleanSubscription, completeOnDestroy } from '@dereekb/dbx-core';\nimport { Component, computed, inject } from '@angular/core';\nimport { DbxAnchorComponent, DbxTwoBlockComponent, DbxTwoColumnComponent, DbxTwoColumnFullLeftDirective, DbxTwoColumnRightComponent, DbxWidgetDataPair, DbxWidgetViewComponent, TwoColumnsContextStore } from '@dereekb/dbx-web';\nimport { DevelopmentFirebaseFunctionSpecifier } from '@dereekb/firebase';\nimport { WorkUsingContext, IsModifiedFunction } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { first, BehaviorSubject, distinctUntilChanged, map, shareReplay, combineLatest, Observable } from 'rxjs';\nimport { DbxFirebaseDevelopmentWidgetService } from './development.widget.service';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { DbxFirebaseDevelopmentPopupContentFormComponent, DbxFirebaseDevelopmentPopupContentFormValue } from './development.popup.content.form.component';\nimport { msToSeconds } from '@dereekb/date';\nimport { DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY } from './development.scheduler.widget.component';\nimport { DbxFirebaseEmulatorService } from '../firebase/firebase.emulator.service';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { DbxActionFormDirective, DbxFormSourceDirective } from '@dereekb/dbx-form';\nimport { MatButtonModule } from '@angular/material/button';\n\n@Component({\n selector: 'dbx-firebase-development-popup-content',\n templateUrl: './development.popup.content.component.html',\n styleUrls: ['./development.popup.component.scss'],\n imports: [DbxAnchorComponent, DbxTwoColumnFullLeftDirective, DbxWidgetViewComponent, DbxTwoColumnComponent, DbxTwoBlockComponent, DbxTwoColumnRightComponent, DbxWidgetViewComponent, DbxFirebaseDevelopmentPopupContentFormComponent, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxActionFormDirective, DbxFormSourceDirective, DbxActionAutoTriggerDirective, MatButtonModule],\n providers: [TwoColumnsContextStore],\n standalone: true\n})\nexport class DbxFirebaseDevelopmentPopupContentComponent {\n readonly twoColumnsContextStore = inject(TwoColumnsContextStore);\n readonly dbxAuthService = inject(DbxAuthService);\n readonly dbxFirebaseDevelopmentWidgetService = inject(DbxFirebaseDevelopmentWidgetService);\n readonly dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);\n readonly dbxFirebaseEmulatorService = inject(DbxFirebaseEmulatorService);\n\n readonly showEmulatorButton = this.dbxFirebaseEmulatorService.useEmulators === true;\n readonly emulatorUIAnchor: ClickableAnchor = this.dbxFirebaseEmulatorService.emulatorUIAnchor ?? {};\n\n readonly entries = this.dbxFirebaseDevelopmentWidgetService.getEntries();\n\n private readonly _activeEntrySelector = completeOnDestroy(new BehaviorSubject<Maybe<DevelopmentFirebaseFunctionSpecifier>>(DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY));\n\n readonly isLoggedIn$ = this.dbxAuthService.isLoggedIn$;\n\n readonly entries$ = this.isLoggedIn$.pipe(\n distinctUntilChanged(),\n map((isLoggedIn) => this.entries),\n shareReplay(1)\n );\n\n readonly formConfig$ = this.entries$.pipe(map((entries) => ({ entries })));\n readonly activeEntrySelector$ = this._activeEntrySelector.pipe(distinctUntilChanged());\n readonly currentActiveEntry$ = combineLatest([this.entries$, this.activeEntrySelector$]).pipe(\n map(([entries, selector]) => (selector ? entries.find((e) => e.widget.type === selector) : undefined)),\n shareReplay(1)\n );\n\n readonly showRight$ = this.currentActiveEntry$.pipe(map((x) => x != null));\n readonly activeEntry$ = this.currentActiveEntry$.pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly schedulerRunning$ = this.dbxFirebaseDevelopmentSchedulerService.running$;\n readonly schedulerInterval$ = this.dbxFirebaseDevelopmentSchedulerService.timerInterval$.pipe(\n map((x) => msToSeconds(x)),\n shareReplay(1)\n );\n readonly schedulerError$ = this.dbxFirebaseDevelopmentSchedulerService.error$.pipe(\n map((x) => (x ? 'Error Occured' : 'Ok')),\n shareReplay(1)\n );\n\n readonly formData$: Observable<DbxFirebaseDevelopmentPopupContentFormValue> = this._activeEntrySelector.pipe(\n distinctUntilChanged(),\n map((specifier) => ({ specifier }))\n );\n\n readonly schedulerRunningSignal = toSignal(this.schedulerRunning$);\n readonly schedulerIntervalSignal = toSignal(this.schedulerInterval$);\n readonly schedulerErrorSignal = toSignal(this.schedulerError$);\n\n readonly activeEntrySignal = toSignal(this.activeEntry$);\n readonly rightTitleSignal = computed(() => this.activeEntrySignal()?.label);\n readonly widgetConfigSignal = computed<Maybe<DbxWidgetDataPair>>(() => {\n const widget = this.activeEntrySignal()?.widget;\n let widgetConfig: Maybe<DbxWidgetDataPair> = undefined;\n\n if (widget) {\n widgetConfig = { type: widget.type, data: undefined };\n }\n\n return widgetConfig;\n });\n\n constructor() {\n this.twoColumnsContextStore.setShowRight(this.showRight$);\n cleanSubscription(\n this.twoColumnsContextStore.back$.subscribe(() => {\n this.clearSelection();\n })\n );\n }\n\n readonly handleFormUpdate: WorkUsingContext<DbxFirebaseDevelopmentPopupContentFormValue, void> = (value, context) => {\n this._activeEntrySelector.next(value.specifier);\n context.success();\n };\n\n readonly isFormModified: IsModifiedFunction<DbxFirebaseDevelopmentPopupContentFormValue> = (value) => {\n return this._activeEntrySelector.pipe(\n map((currentSelector) => value.specifier !== currentSelector),\n first()\n );\n };\n\n clearSelection() {\n this._activeEntrySelector.next(undefined);\n }\n}\n","<dbx-two-column class=\"dbx-firebase-development-popup-content\" [dbxTwoColumnFullLeft]=\"true\">\n <dbx-two-block left>\n <div>\n <h4>Info</h4>\n <p>Scheduler (Running): {{ schedulerRunningSignal() }} : {{ schedulerIntervalSignal() }}s : {{ schedulerErrorSignal() }}</p>\n <div>\n @if (showEmulatorButton) {\n <dbx-anchor [anchor]=\"emulatorUIAnchor\">\n <button mat-flat-button color=\"accent\">Emulator Enabled</button>\n </dbx-anchor>\n }\n </div>\n </div>\n <div>\n <h4>Tools</h4>\n <div dbxAction dbxActionEnforceModified dbxActionAutoTrigger useInstantTriggerPreset [dbxActionHandler]=\"handleFormUpdate\">\n <dbx-firebase-development-popup-content-form [config]=\"formConfig$\" dbxActionForm [dbxActionFormIsModified]=\"isFormModified\" [dbxFormSource]=\"formData$\" dbxFormSourceMode=\"always\"></dbx-firebase-development-popup-content-form>\n </div>\n </div>\n </dbx-two-block>\n <dbx-two-column-right right [header]=\"rightTitleSignal()\">\n <dbx-widget-view [config]=\"widgetConfigSignal()\"></dbx-widget-view>\n </dbx-two-column-right>\n</dbx-two-column>\n","import { ChangeDetectionStrategy, Component, inject, viewChild } from '@angular/core';\nimport { DbxPopupKey, AbstractPopupDirective, DbxPopupService, DbxPopupContentComponent, DbxPopupControlsComponent } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseDevelopmentPopupContentComponent } from './development.popup.content.component';\n\nexport const DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY = 'devpopup';\n\n@Component({\n template: `\n <dbx-popup-content>\n <dbx-popup-controls [header]=\"header\" controls></dbx-popup-controls>\n <dbx-firebase-development-popup-content (shouldClose)=\"closePopup()\"></dbx-firebase-development-popup-content>\n </dbx-popup-content>\n `,\n imports: [DbxPopupContentComponent, DbxPopupControlsComponent, DbxFirebaseDevelopmentPopupContentComponent],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseDevelopmentPopupComponent extends AbstractPopupDirective {\n private readonly popupService = inject(DbxPopupService);\n\n readonly content = viewChild.required(DbxFirebaseDevelopmentPopupContentComponent);\n\n readonly header = 'Development Tools';\n\n static openPopup(popupService: DbxPopupService, popupKey?: DbxPopupKey): NgPopoverRef {\n return popupService.open({\n key: popupKey ?? DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY,\n componentClass: DbxFirebaseDevelopmentPopupComponent,\n closeOnTransition: false,\n isDraggable: true,\n position: 'center'\n });\n }\n\n reopen = () => {\n DbxFirebaseDevelopmentPopupComponent.openPopup(this.popupService, this.popup.key);\n };\n}\n","import { inject, Injectable, InjectionToken } from '@angular/core';\n\n/**\n * Corresponds to the enabled value on the DbxFirebaseDevelopmentService.\n */\nexport const DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN = new InjectionToken('DefaultDbxFirebaseDevelopmentEnabled');\n\n/**\n * Service used for registering widgets used for development.\n *\n * Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.\n */\n@Injectable()\nexport class DbxFirebaseDevelopmentService {\n readonly enabled = inject<boolean>(DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN, { optional: true }) ?? false;\n}\n","import { HostListener, AfterViewInit, Directive, inject } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { DbxPopupService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseDevelopmentPopupComponent } from './development.popup.component';\nimport { DbxFirebaseDevelopmentService } from './development.service';\nimport { clean } from '@dereekb/dbx-core';\n\n/**\n * Directive for showing the development tools snackbar when the app opens up and listening for keybindings for opening the popup.\n */\n@Directive({\n selector: '[dbxFirebaseDevelopment]',\n standalone: true\n})\nexport class DbxFirebaseDevelopmentDirective implements AfterViewInit {\n readonly popupService = inject(DbxPopupService);\n readonly matSnackBar = inject(MatSnackBar);\n readonly dbxFirebaseDevelopmentService = inject(DbxFirebaseDevelopmentService);\n\n ref?: NgPopoverRef<any, any>;\n\n get enabled() {\n return this.dbxFirebaseDevelopmentService.enabled;\n }\n\n constructor() {\n clean(() => this.closePopup());\n }\n\n @HostListener('window:keydown', ['$event'])\n handleKeyboardEvent(event: KeyboardEvent) {\n if (this.enabled && event.shiftKey && event.altKey && event.code === 'KeyD') {\n this.togglePopup();\n event.preventDefault();\n }\n }\n\n togglePopup() {\n if (this.ref) {\n this.closePopup();\n } else {\n this.openPopup();\n }\n }\n\n openPopup() {\n if (!this.ref) {\n const ref = DbxFirebaseDevelopmentPopupComponent.openPopup(this.popupService);\n ref.afterClosed$.subscribe(() => {\n if (this.ref === ref) {\n this.ref = undefined;\n }\n });\n\n this.ref = ref;\n }\n }\n\n closePopup() {\n if (this.ref != null) {\n this.ref.close();\n }\n }\n\n ngAfterViewInit(): void {\n if (this.enabled) {\n this.matSnackBar\n .open('Dev Tools: alt/option + shift + D', 'Open', {\n horizontalPosition: 'center',\n verticalPosition: 'bottom',\n duration: 8 * 1000\n })\n .onAction()\n .subscribe(() => {\n this.openPopup();\n });\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseDevelopmentPopupComponent } from './development.popup.component';\nimport { DbxFirebaseDevelopmentPopupContentComponent } from './development.popup.content.component';\nimport { DbxFirebaseDevelopmentDirective } from './development.directive';\nimport { DbxFirebaseDevelopmentPopupContentFormComponent } from './development.popup.content.form.component';\nimport { DbxFirebaseDevelopmentSchedulerListComponent, DbxFirebaseDevelopmentSchedulerListViewComponent, DbxFirebaseDevelopmentSchedulerListViewItemComponent } from './development.scheduler.list.component';\nimport { DbxFirebaseDevelopmentSchedulerWidgetComponent } from './development.scheduler.widget.component';\n\nconst importsAndExports = [\n //\n DbxFirebaseDevelopmentPopupContentFormComponent,\n DbxFirebaseDevelopmentDirective,\n DbxFirebaseDevelopmentPopupComponent,\n DbxFirebaseDevelopmentPopupContentComponent,\n DbxFirebaseDevelopmentSchedulerWidgetComponent,\n DbxFirebaseDevelopmentSchedulerListComponent,\n DbxFirebaseDevelopmentSchedulerListViewComponent,\n DbxFirebaseDevelopmentSchedulerListViewItemComponent\n];\n/**\n * Contains components related to logging in.\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxFirebaseDevelopmentModule {}\n","import { inject, type EnvironmentProviders, makeEnvironmentProviders, provideAppInitializer, type Provider } from '@angular/core';\nimport { DbxFirebaseDevelopmentWidgetService, DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN } from './development.widget.service';\nimport { DbxFirebaseDevelopmentService, DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN } from './development.service';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { type DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\nimport { developmentFirebaseServerSchedulerWidgetEntry } from './development.scheduler.widget.component';\n\n/**\n * Configuration for provideDbxFirebaseDevelopment().\n */\nexport interface ProvideDbxFirebaseDevelopmentConfig {\n /**\n * Whether or not to automatically add the developmentFirebaseServerSchedulerWidgetEntry() to the developmentWidgetEntries.\n *\n * Defaults to true.\n */\n readonly addDevelopmentSchedulerWidget?: boolean;\n /**\n * Widgets to add to the DbxFirebaseDevelopmentWidgetService module.\n *\n * Configured via the DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN.\n */\n readonly developmentWidgetEntries?: DbxFirebaseDevelopmentWidgetEntry[];\n /**\n * Whether or not the development module is currently enabled.\n *\n * Corresponds to DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN.\n */\n readonly enabled?: boolean;\n}\n\n/**\n * Creates providers for DbxFirebaseDevelopmentSchedulerService, DbxFirebaseDevelopmentWidgetService, and DbxFirebaseDevelopmentService.\n *\n * @param config\n * @returns\n */\nexport function provideDbxFirebaseDevelopment(config: ProvideDbxFirebaseDevelopmentConfig): EnvironmentProviders {\n const { developmentWidgetEntries: inputEntries, enabled, addDevelopmentSchedulerWidget } = config;\n const entries = [...(inputEntries ?? [])];\n\n if (addDevelopmentSchedulerWidget !== false) {\n entries.push(developmentFirebaseServerSchedulerWidgetEntry());\n }\n\n const providers: (EnvironmentProviders | Provider)[] = [\n // config\n {\n provide: DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN,\n useValue: entries\n },\n {\n provide: DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN,\n useValue: enabled\n },\n // services\n DbxFirebaseDevelopmentService,\n DbxFirebaseDevelopmentSchedulerService,\n DbxFirebaseDevelopmentWidgetService,\n // service initialization\n provideAppInitializer(() => {\n const scheduler = inject(DbxFirebaseDevelopmentSchedulerService);\n // initialize the scheduler\n scheduler.init();\n })\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type Injector, type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { initializeApp } from 'firebase/app';\nimport { initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';\nimport { FirebaseApp, provideFirebaseApp } from '@angular/fire/app';\nimport { provideStorage, getStorage, connectStorageEmulator } from '@angular/fire/storage';\nimport { provideFunctions, getFunctions, connectFunctionsEmulator } from '@angular/fire/functions';\nimport { provideFirestore, connectFirestoreEmulator, initializeFirestore, persistentLocalCache, persistentMultipleTabManager, type FirestoreSettings, persistentSingleTabManager } from '@angular/fire/firestore';\nimport { provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';\nimport { type AppCheck, provideAppCheck } from '@angular/fire/app-check';\nimport { DbxFirebaseParsedEmulatorsConfig } from './emulators';\nimport { type DbxFirebaseAppOptions, DBX_FIREBASE_APP_OPTIONS_TOKEN } from './firebase.options';\nimport { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { enableAppCheckDebugTokenGeneration } from '../auth/appcheck/appcheck';\nimport { DbxFirebaseAppCheckHttpInterceptor } from '../auth/appcheck/appcheck.interceptor';\nimport { type Maybe, pushArrayItemsIntoArray } from '@dereekb/util';\n\n/**\n * Configuration for provideDbxFirebaseApp().\n */\nexport interface ProvideDbxFirebaseAppConfig {\n /**\n * DbxFirebaseAppOptions for the app.\n *\n * Is automatically configured as a provider for the DBX_FIREBASE_APP_OPTIONS_TOKEN.\n */\n readonly dbxFirebaseAppOptions: DbxFirebaseAppOptions;\n /**\n * Whether or not to provide Firestore configuration.\n *\n * True by default.\n */\n readonly provideFirestore?: Maybe<boolean>;\n /**\n * Whether or not to provide App Check configuration.\n *\n * True by default.\n */\n readonly provideAppCheck?: Maybe<boolean>;\n /**\n * Whether or not to provide Auth configuration.\n *\n * True by default.\n */\n readonly provideAuth?: Maybe<boolean>;\n /**\n * Whether or not to provide Storage configuration.\n *\n * True by default.\n */\n readonly provideStorage?: Maybe<boolean>;\n /**\n * Whether or not to provide Functions configuration.\n *\n * True by default.\n */\n readonly provideFunctions?: Maybe<boolean>;\n}\n\n/**\n * Provides EnvironmentProviders for all Firebase services.\n *\n * @param config\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseApp(config: ProvideDbxFirebaseAppConfig): EnvironmentProviders {\n const { dbxFirebaseAppOptions: dbxFirebaseOptions } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n // options\n makeEnvironmentProviders([\n {\n provide: DBX_FIREBASE_APP_OPTIONS_TOKEN,\n useValue: dbxFirebaseOptions\n }\n ]),\n\n // app\n provideFirebaseApp((injector: Injector) => {\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n return initializeApp(firebaseOptions);\n })\n ];\n\n // firestore\n if (config.provideFirestore !== false) {\n const firestoreProvider = provideFirestore((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n\n const firestoreSettings: FirestoreSettings = {};\n\n const { enableMultiTabIndexedDbPersistence, enableIndexedDbPersistence } = firebaseOptions;\n const { persistentCacheSettings } = firebaseOptions;\n\n if (enableIndexedDbPersistence !== false) {\n let tabManager;\n\n if (enableMultiTabIndexedDbPersistence !== false) {\n tabManager = persistentMultipleTabManager();\n } else {\n tabManager = persistentSingleTabManager(undefined);\n }\n\n firestoreSettings.localCache = persistentLocalCache({\n tabManager,\n ...persistentCacheSettings\n });\n }\n\n const firestore = initializeFirestore(firebaseApp, firestoreSettings);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.firestore) {\n connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});\n }\n\n return firestore;\n });\n\n providers.push(firestoreProvider);\n }\n\n // app check\n if (config.provideAppCheck !== false) {\n const appCheckProviders = [\n provideAppCheck((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n const appCheckOptions = firebaseOptions.appCheck;\n const appCheckKnowinglyDisabled = appCheckOptions?.disabled === true || firebaseOptions.emulators?.useEmulators === true;\n\n let appCheck: AppCheck;\n\n if (appCheckOptions && !appCheckKnowinglyDisabled) {\n // enable the debug tokens if not using emulators and allowDebugTokens is set true\n if (!firebaseOptions.emulators?.useEmulators && appCheckOptions.allowDebugTokens) {\n enableAppCheckDebugTokenGeneration(true);\n }\n\n // Only enabled outside of app-check environments. The emulators will not use appcheck.\n appCheck = initializeAppCheck(firebaseApp, {\n provider: new ReCaptchaV3Provider(appCheckOptions.reCaptchaV3),\n isTokenAutoRefreshEnabled: appCheckOptions.isTokenAutoRefreshEnabled ?? true\n });\n\n console.log('Enabled AppCheck.');\n } else {\n appCheck = undefined as unknown as AppCheck;\n\n if (!appCheckKnowinglyDisabled) {\n console.error('dbx-firebase: No appcheck configuration for the app, and not specifically disabled in config either.');\n }\n }\n\n return appCheck;\n }),\n {\n provide: HTTP_INTERCEPTORS,\n useClass: DbxFirebaseAppCheckHttpInterceptor,\n multi: true\n }\n ];\n\n pushArrayItemsIntoArray(providers, appCheckProviders);\n }\n\n // auth\n if (config.provideAuth !== false) {\n const authProvider = provideAuth((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const auth = getAuth(firebaseApp);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.auth) {\n connectAuthEmulator(auth, `http://${emulators.auth.host}:${emulators.auth.port}`);\n }\n\n return auth;\n });\n\n providers.push(authProvider);\n }\n\n // storage\n if (config.provideStorage !== false) {\n const storageProvider = provideStorage((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const storage = getStorage(firebaseApp);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.storage) {\n connectStorageEmulator(storage, emulators.storage.host, emulators.storage.port, {});\n }\n\n return storage;\n });\n\n providers.push(storageProvider);\n }\n\n // functions\n if (config.provideFunctions !== false) {\n const functionsProvider = provideFunctions((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n const { functionsRegionOrCustomDomain } = firebaseOptions;\n\n const functions = getFunctions(firebaseApp, functionsRegionOrCustomDomain);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.functions) {\n connectFunctionsEmulator(functions, emulators.functions.host, emulators.functions.port);\n }\n\n return functions;\n });\n\n providers.push(functionsProvider);\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n// TODO: Providers now need to be initialized/registered in the bootstrap section as additional providers/config and not imported as modules this way\n","import { makeEnvironmentProviders, type EnvironmentProviders, type Provider } from '@angular/core';\nimport { type DbxFirebaseEmulatorConfig, type DbxFirebaseEmulatorsConfig, DbxFirebaseParsedEmulatorsConfig } from './emulators';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseEmulatorService } from './firebase.emulator.service';\n\n/**\n * Config for provideDbxFirebaseEmulator().\n */\nexport type ProvideDbxFirebaseEmulatorsConfig = DbxFirebaseEmulatorsConfig;\n\n/**\n * Creates EnvironmentProviders for the DbxFirebaseEmulatorService.\n *\n * @param config\n * @returns\n */\nexport function provideDbxFirebaseEmulator(config: ProvideDbxFirebaseEmulatorsConfig): EnvironmentProviders {\n const defaultHost = config.host ?? 'localhost';\n\n function emulatorConfig(emulator: Maybe<DbxFirebaseEmulatorConfig>): Required<DbxFirebaseEmulatorConfig> | undefined {\n return emulator ? { host: emulator.host ?? defaultHost, port: emulator.port } : undefined;\n }\n\n const finalConfig: DbxFirebaseParsedEmulatorsConfig = {\n useEmulators: config.useEmulators !== false,\n ui: emulatorConfig(config.ui),\n auth: emulatorConfig(config.auth),\n firestore: emulatorConfig(config.firestore),\n storage: emulatorConfig(config.storage),\n functions: emulatorConfig(config.functions),\n database: emulatorConfig(config.database)\n };\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseParsedEmulatorsConfig,\n useValue: finalConfig\n },\n DbxFirebaseEmulatorService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Token to access the FirestoreContext value.\n */\nexport const DBX_FIRESTORE_CONTEXT_TOKEN = new InjectionToken('DBX_FIRESTORE_CONTEXT_TOKEN');\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { clientFirebaseFirestoreContextFactory, type FirestoreContext, NotificationFirestoreCollections, StorageFileFirestoreCollections, SystemStateFirestoreCollections } from '@dereekb/firebase';\nimport { DBX_FIRESTORE_CONTEXT_TOKEN } from './firebase.firestore';\nimport { Firestore } from '@angular/fire/firestore';\nimport { type ClassLikeType } from '@dereekb/util';\n\n/**\n * Provider factory for the SystemStateFirestoreCollections.\n *\n * @param appCollection The app collection class to use.\n * @returns Provider factory for the SystemStateFirestoreCollections.\n */\nexport function provideSystemStateFirestoreCollections(appCollection: SystemStateFirestoreCollections): SystemStateFirestoreCollections {\n if (!appCollection.systemStateCollection) {\n throw new Error(`SystemStateFirestoreCollections could not be provided using the app's app collection. Set provideSystemStateFirestoreCollections to false in DbxFirebaseFirestoreCollectionModuleConfig to prevent auto-initialization, or update your app's collection class to implement SystemStateFirestoreCollections.`);\n }\n\n return appCollection;\n}\n\n/**\n * Provider factory for the NotificationFirestoreCollections.\n *\n * @param appCollection The app collection class to use.\n * @returns Provider factory for the NotificationFirestoreCollections.\n */\nexport function provideNotificationFirestoreCollections(appCollection: NotificationFirestoreCollections): NotificationFirestoreCollections {\n if (!appCollection.notificationSummaryCollection) {\n throw new Error(`NotificationFirestoreCollections could not be provided using the app's app collection. Set provideNotificationFirestoreCollections to false in DbxFirebaseFirestoreCollectionModuleConfig to prevent auto-initialization, or update your app's collection class to implement NotificationFirestoreCollections.`);\n }\n\n return appCollection;\n}\n\n/**\n * Provider factory for the StorageFileFirestoreCollections.\n *\n * @param appCollection The app collection class to use.\n * @returns Provider factory for the StorageFileFirestoreCollections.\n */\nexport function provideStorageFileFirestoreCollections(appCollection: StorageFileFirestoreCollections): StorageFileFirestoreCollections {\n if (!appCollection.storageFileCollection) {\n throw new Error(`StorageFileFirestoreCollections could not be provided using the app's app collection. Set provideStorageFileFirestoreCollections to false in DbxFirebaseFirestoreCollectionModuleConfig to prevent auto-initialization, or update your app's collection class to implement StorageFileFirestoreCollections.`);\n }\n\n return appCollection;\n}\n\n/**\n * Configuration for provideDbxFirestoreCollection().\n */\nexport interface ProvideDbxFirebaseFirestoreCollectionConfig<T> {\n /**\n * The app collection class to use.\n */\n readonly appCollectionClass: ClassLikeType<T>;\n /**\n * The collection factory to use.\n */\n readonly collectionFactory: (context: FirestoreContext) => T;\n /**\n * Whether or not to provide the SystemStateFirestoreCollections.\n *\n * True by default.\n */\n readonly provideSystemStateFirestoreCollections?: boolean;\n /**\n * Whether or not to provide the NotificationFirestoreCollections.\n *\n * False by default.\n */\n readonly provideNotificationFirestoreCollections?: boolean;\n /**\n * Whether or not to provide the StorageFileFirestoreCollections.\n *\n * False by default.\n */\n readonly provideStorageFileFirestoreCollections?: boolean;\n}\n\n/**\n * Creates EnvironmentProviders for the DBX_FIRESTORE_CONTEXT_TOKEN, appCollectionClass, and optionally the SystemStateFirestoreCollections and NotificationFirestoreCollections.\n *\n * @param config Configuration for the providers.\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirestoreCollection<T>(config: ProvideDbxFirebaseFirestoreCollectionConfig<T>): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: DBX_FIRESTORE_CONTEXT_TOKEN,\n useFactory: clientFirebaseFirestoreContextFactory,\n deps: [Firestore]\n },\n {\n provide: config.appCollectionClass,\n useFactory: config.collectionFactory,\n deps: [DBX_FIRESTORE_CONTEXT_TOKEN]\n }\n ];\n\n if (config.provideSystemStateFirestoreCollections !== false) {\n providers.push({\n /**\n * Provide SystemStateFirestoreCollections via the app collections class and using SystemStateFirestoreCollections.\n */\n provide: SystemStateFirestoreCollections,\n useFactory: provideSystemStateFirestoreCollections,\n deps: [config.appCollectionClass]\n });\n }\n\n if (config.provideNotificationFirestoreCollections) {\n providers.push({\n provide: NotificationFirestoreCollections,\n useFactory: provideNotificationFirestoreCollections,\n deps: [config.appCollectionClass]\n });\n }\n\n if (config.provideStorageFileFirestoreCollections) {\n providers.push({\n provide: StorageFileFirestoreCollections,\n useFactory: provideStorageFileFirestoreCollections,\n deps: [config.appCollectionClass]\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { FirestoreContext } from '@dereekb/firebase';\nimport { Injectable, inject } from '@angular/core';\nimport { DBX_FIRESTORE_CONTEXT_TOKEN } from './firebase.firestore';\n\n/**\n * Service that provides access to the app's FirestoreContext.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirestoreContextService {\n readonly firestoreContext = inject<FirestoreContext>(DBX_FIRESTORE_CONTEXT_TOKEN);\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { Functions } from '@angular/fire/functions';\nimport { FirebaseDevelopmentFunctions, type FirebaseFunctionsConfigMap, type FirebaseFunctionsMap, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY, type LazyFirebaseFunctions } from '@dereekb/firebase';\nimport { type ClassLikeType, forEachKeyValue } from '@dereekb/util';\n\n/**\n * Configuration for provideDbxFirebaseFunctions().\n */\nexport interface ProvideDbxFirebaseFunctionsConfig<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap> {\n /**\n * The token to use for the functions getter.\n *\n * This is typically your LazyFirebaseFunctions result type.\n */\n functionsGetterToken: ClassLikeType<T>;\n /**\n * Factory function to retrieve the functions getter instance.\n *\n * @param functions The Firebase functions instance.\n * @returns The functions getter instance.\n */\n functionsGetterFactory: (functions: Functions) => T;\n /**\n * Key of the functions config to use to inject FirebaseDevelopmentFunctions using that same provider.\n *\n * Defaults to \"developmentFunctions\". If false, will not be injected automatically.\n */\n developmentFunctionsKey?: string | false;\n /**\n * Optional functions config map to provide.\n *\n * If provided, will inject all the types with factory functions so they can be injected into the app.\n */\n functionsConfigMap?: FirebaseFunctionsConfigMap<M>;\n}\n\n/**\n * Creates EnvironmentProviders for the LazyFirebaseFunctions type for a DbxFirebase app.\n *\n * Also provides FirebaseDevelopmentFunctions if developmentFunctionsKey is provided.\n *\n * @param config Configuration for provideDbxFirebaseFunctions().\n * @returns EnvironmentProviders for the LazyFirebaseFunctions type.\n */\nexport function provideDbxFirebaseFunctions<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap>(config: ProvideDbxFirebaseFunctionsConfig<T, M>): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: config.functionsGetterToken,\n useFactory: config.functionsGetterFactory,\n deps: [Functions]\n }\n ];\n\n if (config.functionsConfigMap) {\n forEachKeyValue(config.functionsConfigMap, {\n forEach: ([key, entry]) => {\n const provide = entry[0];\n\n providers.push({\n provide,\n useFactory: (lazyFunctions: LazyFirebaseFunctions<M>) => {\n const getter = lazyFunctions[key as string];\n\n if (!getter) {\n throw new Error(`Could not create provider for firebase function getter \"${provide}\" as the getter was unavailable.`);\n } else {\n return getter();\n }\n },\n deps: [config.functionsGetterToken]\n });\n }\n });\n\n // Add a provider for FirebaseDevelopmentFunctions if developmentFunctions is provided.\n const developmentFunctionsKey = config.developmentFunctionsKey ?? FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY;\n\n if (developmentFunctionsKey) {\n const developmentFunctionsConfig = config.functionsConfigMap[developmentFunctionsKey];\n\n if (developmentFunctionsConfig != null) {\n providers.push({\n provide: FirebaseDevelopmentFunctions,\n useExisting: developmentFunctionsConfig[0]\n });\n }\n }\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { type IterationQueryDocChangeWatcherChangeType, type IterationQueryDocChangeWatcherEvent } from '@dereekb/firebase';\nimport { SubscriptionObject } from '@dereekb/rxjs';\nimport { type Destroyable } from '@dereekb/util';\nimport { filter, take, map, BehaviorSubject, distinctUntilChanged, type Observable, switchMap, startWith, shareReplay, combineLatest } from 'rxjs';\nimport { type DbxFirebaseCollectionLoaderAccessor } from './collection.loader';\n\n/**\n * DbxFirebaseCollectionChangeWatcher trigger modes\n * - auto: will automatically call trigger\n * - off: will never call trigger\n */\nexport type DbxFirebaseCollectionChangeWatcherTriggerMode = 'auto' | 'off';\nexport type DbxFirebaseCollectionChangeWatcherEvent = Pick<IterationQueryDocChangeWatcherEvent<unknown>, 'time' | 'type'>;\n\n/**\n * Used to watch a DbxFirebaseCollectionLoaderAccessor for when the query changes and\n */\nexport interface DbxFirebaseCollectionChangeWatcher<S extends DbxFirebaseCollectionLoaderAccessor<any>> {\n readonly store: S;\n /**\n * Current mode observable\n */\n readonly mode$: Observable<DbxFirebaseCollectionChangeWatcherTriggerMode>;\n /**\n * Stream of events\n */\n readonly event$: Observable<DbxFirebaseCollectionChangeWatcherEvent>;\n readonly hasChangeAvailable$: Observable<boolean>;\n /**\n * Current trigger state. Based on the hasChangeAvailable$ state and current mode.\n */\n readonly triggered$: Observable<boolean>;\n /**\n * Trigger emitter. Only emits when triggered$ is/becomes true.\n */\n readonly trigger$: Observable<void>;\n}\n\n/**\n * DbxFirebaseCollectionChangeWatcher instance that can be destroyed and the mode changed.\n */\nexport interface DbxFirebaseCollectionChangeWatcherInstance<S extends DbxFirebaseCollectionLoaderAccessor<any>> extends DbxFirebaseCollectionChangeWatcher<S>, Destroyable {\n /**\n * Changes the mode\n */\n setMode(mode: DbxFirebaseCollectionChangeWatcherTriggerMode): void;\n}\n\nexport function dbxFirebaseCollectionChangeWatcher<S extends DbxFirebaseCollectionLoaderAccessor<any>>(store: S, initialMode?: DbxFirebaseCollectionChangeWatcherTriggerMode): DbxFirebaseCollectionChangeWatcherInstance<S> {\n const _mode = new BehaviorSubject<DbxFirebaseCollectionChangeWatcherTriggerMode>(initialMode ?? 'off');\n const _sub = new SubscriptionObject();\n\n const mode$ = _mode.pipe(distinctUntilChanged());\n\n const event$: Observable<DbxFirebaseCollectionChangeWatcherEvent> = store.queryChangeWatcher$.pipe(\n switchMap((x) =>\n x.event$.pipe(\n filter((x) => x.type !== 'none'), // do not share 'none' events.\n take(1), // only need one event to mark as change is available.\n startWith({\n time: new Date(),\n type: 'none' as IterationQueryDocChangeWatcherChangeType\n })\n )\n ),\n shareReplay(1)\n );\n\n const hasChangeAvailable$: Observable<boolean> = event$.pipe(\n map((x) => x.type !== 'none'),\n shareReplay(1)\n );\n\n const triggered$: Observable<boolean> = combineLatest([mode$, hasChangeAvailable$]).pipe(map(([mode, hasChange]) => mode === 'auto' && hasChange));\n\n const trigger$: Observable<void> = triggered$.pipe(\n filter((triggered) => triggered),\n map(() => undefined)\n );\n\n function destroy() {\n _sub.destroy();\n _mode.complete();\n }\n\n function setMode(mode: DbxFirebaseCollectionChangeWatcherTriggerMode) {\n _mode.next(mode);\n }\n\n const instance: DbxFirebaseCollectionChangeWatcherInstance<S> = {\n store,\n mode$,\n event$,\n hasChangeAvailable$,\n triggered$,\n trigger$,\n destroy,\n setMode\n };\n\n return instance;\n}\n","import { SubscriptionObject, type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { BehaviorSubject, filter, switchMap, exhaustMap, EMPTY } from 'rxjs';\nimport { type Destroyable, type Maybe, type Initialized } from '@dereekb/util';\nimport { type DbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionChangeWatcher } from './collection.change.watcher';\nimport { type DbxFirebaseCollectionLoaderAccessor } from './collection.loader';\n\nexport type DbxFirebaseCollectionChangeTriggerFunction<S extends DbxFirebaseCollectionLoaderAccessor<any>> = (instance: DbxFirebaseCollectionChangeTriggerInstance<S>) => ObservableOrValue<void>;\n\n/**\n * Restarts the store.\n *\n * @param instance\n * @returns\n */\nexport const DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION: DbxFirebaseCollectionChangeTriggerFunction<any> = (instance) => instance.watcher.store.restart();\n\nexport interface DbxFirebaseCollectionChangeTriggerInstanceConfig<S extends DbxFirebaseCollectionLoaderAccessor<any>> {\n readonly watcher: DbxFirebaseCollectionChangeWatcher<S> & Partial<Destroyable>;\n /**\n * Whether or not to also destroy the watcher when the trigger instance is destroyed.\n *\n * Defaults to false.\n */\n readonly destroyWatcherOnDestroy?: boolean;\n /**\n * Initial trigger function to use.\n *\n * By default restarts the store.\n */\n readonly triggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>;\n}\n\nexport interface DbxFirebaseCollectionChangeTrigger<S extends DbxFirebaseCollectionLoaderAccessor<any>> {\n readonly watcher: DbxFirebaseCollectionChangeWatcher<S>;\n setTriggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>;\n}\n\nexport class DbxFirebaseCollectionChangeTriggerInstance<S extends DbxFirebaseCollectionLoaderAccessor<any>> implements DbxFirebaseCollectionChangeTrigger<S>, Initialized, Destroyable {\n readonly watcher: DbxFirebaseCollectionChangeWatcher<S>;\n\n private readonly _config: DbxFirebaseCollectionChangeTriggerInstanceConfig<S>;\n private readonly _triggerFunction = new BehaviorSubject<Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(config: DbxFirebaseCollectionChangeTriggerInstanceConfig<S>) {\n this._config = config;\n this.watcher = config.watcher;\n this.triggerFunction = config.triggerFunction ?? DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION;\n }\n\n get config() {\n return this._config;\n }\n\n init(): void {\n this._sub.subscription = this._triggerFunction\n .pipe(\n switchMap((triggerFunction) => {\n if (triggerFunction) {\n return this.watcher.triggered$.pipe(\n filter((triggered) => triggered),\n exhaustMap(() => asObservable(triggerFunction(this)))\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._triggerFunction.complete();\n\n if (this._config.destroyWatcherOnDestroy === true) {\n (this.watcher as unknown as Destroyable)?.destroy();\n }\n }\n\n get triggerFunction(): Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>> {\n return this._triggerFunction.value;\n }\n\n set triggerFunction(triggerFunction: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>) {\n this._triggerFunction.next(triggerFunction);\n }\n}\n\n/**\n * Creates a new DbxFirebaseCollectionChangeWatcher, set the modes to \"auto\", and creates a new DbxFirebaseCollectionChangeTriggerInstance.\n *\n * If no trigger function is provided it will default to resetting the store.\n *\n * NOTE: Don't forget to initialize the DbxFirebaseCollectionChangeTriggerInstance and handle other lifecycle changes.\n *\n * @param store\n * @param triggerFunction\n * @returns\n */\nexport function dbxFirebaseCollectionChangeTriggerForStore<S extends DbxFirebaseCollectionLoaderAccessor<any>>(store: S, triggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>): DbxFirebaseCollectionChangeTriggerInstance<S> {\n return dbxFirebaseCollectionChangeTrigger<S>({\n watcher: dbxFirebaseCollectionChangeWatcher<S>(store, 'auto'),\n destroyWatcherOnDestroy: true,\n triggerFunction:\n triggerFunction ??\n (() => {\n store.restart();\n })\n });\n}\n\nexport function dbxFirebaseCollectionChangeTriggerForWatcher<S extends DbxFirebaseCollectionLoaderAccessor<any>>(watcher: DbxFirebaseCollectionChangeWatcher<S>, triggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>): DbxFirebaseCollectionChangeTriggerInstance<S> {\n return dbxFirebaseCollectionChangeTrigger<S>({\n watcher,\n destroyWatcherOnDestroy: false,\n triggerFunction\n });\n}\n\nexport function dbxFirebaseCollectionChangeTrigger<S extends DbxFirebaseCollectionLoaderAccessor<any>>(config: DbxFirebaseCollectionChangeTriggerInstanceConfig<S>): DbxFirebaseCollectionChangeTriggerInstance<S> {\n return new DbxFirebaseCollectionChangeTriggerInstance(config);\n}\n","import { type PageListLoadingState, cleanupDestroyable, filterMaybe, useFirst, SubscriptionObject, accumulatorFlattenPageListLoadingState, type ItemAccumulatorNextPageUntilResultsCountFunction, itemAccumulatorNextPageUntilResultsCount, iteratorNextPageUntilPage, iteratorNextPageUntilMaxPageLoadLimit, pageItemAccumulatorCurrentPage, type ItemAccumulatorNextPageUntilResultsCountResult, iterationHasNextAndCanLoadMore, distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { BehaviorSubject, combineLatest, map, shareReplay, distinctUntilChanged, Subject, throttleTime, switchMap, type Observable, tap, startWith, NEVER, of } from 'rxjs';\nimport {\n type DocumentDataWithIdAndKey,\n type DocumentReference,\n type FirebaseQueryItemAccumulator,\n firebaseQueryItemAccumulator,\n type FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction,\n type FirebaseQuerySnapshotAccumulator,\n firebaseQuerySnapshotAccumulator,\n type FirestoreCollectionLike,\n type FirestoreDocument,\n type FirestoreItemPageIterationInstance,\n type FirestoreItemPageIteratorFilter,\n type FirestoreModelKey,\n type FirestoreQueryConstraint,\n type IterationQueryDocChangeWatcher,\n iterationQueryDocChangeWatcher\n} from '@dereekb/firebase';\nimport { type ArrayOrValue, type Destroyable, type GetterOrValue, type Initialized, type Maybe, type PageNumber, countAllInNestedArray } from '@dereekb/util';\nimport { type DbxFirebaseCollectionLoaderAccessor, type DbxFirebaseCollectionLoaderWithAccumulator } from './collection.loader';\n\n/**\n * The store mode.\n *\n * - query: The store will load documents from a query, using the given collection.\n * - references: The store will load documents from the input references (keys, refs, etc.).\n */\nexport type DbxFirebaseCollectionMode = 'query' | 'references';\n\nexport interface DbxFirebaseCollectionLoaderInstanceInitConfig<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> {\n readonly collection?: Maybe<FirestoreCollectionLike<T, D>>;\n readonly collectionMode?: DbxFirebaseCollectionMode;\n readonly collectionKeys?: Maybe<FirestoreModelKey[]>;\n readonly collectionRefs?: Maybe<DocumentReference<T>[]>;\n readonly maxPages?: Maybe<number>;\n readonly itemsPerPage?: Maybe<number>;\n readonly constraints?: Maybe<ArrayOrValue<FirestoreQueryConstraint>>;\n /**\n * Whether or not to wait for non-null constraints before beginning the iteration.\n *\n * Defaults to true.\n */\n readonly waitForNonNullConstraints?: Maybe<boolean>;\n}\n\nexport type DbxFirebaseCollectionLoaderInstanceData<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> = DbxFirebaseCollectionLoaderAccessor<T>;\n\n/**\n * DbxFirebaseModelLoader implementation within an instance.\n */\nexport class DbxFirebaseCollectionLoaderInstance<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>> implements DbxFirebaseCollectionLoaderWithAccumulator<T>, DbxFirebaseCollectionLoaderInstanceData<T, D>, Initialized, Destroyable {\n private readonly _maxPagesSub = new SubscriptionObject();\n\n protected readonly _collection = new BehaviorSubject<Maybe<FirestoreCollectionLike<T, D>>>(undefined);\n\n protected readonly _collectionMode = new BehaviorSubject<DbxFirebaseCollectionMode>('query');\n protected readonly _collectionRefs = new BehaviorSubject<Maybe<DocumentReference<T>[]>>(undefined);\n protected readonly _maxPages = new BehaviorSubject<Maybe<number>>(undefined);\n protected readonly _itemsPerPage = new BehaviorSubject<Maybe<number>>(undefined);\n protected readonly _constraints = new BehaviorSubject<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>(undefined);\n protected readonly _waitForNonNullConstraints = new BehaviorSubject<Maybe<boolean>>(undefined);\n protected readonly _restart = new Subject<void>();\n\n readonly collection$ = this._collection.pipe(distinctUntilChanged());\n\n readonly collectionMode$ = this._collectionMode.pipe(distinctUntilChanged(), shareReplay(1));\n readonly currentCollectionRefs$ = this._collectionRefs.pipe(distinctUntilChanged(), shareReplay(1));\n readonly collectionRefs$ = this.currentCollectionRefs$.pipe(\n filterMaybe(),\n distinctUntilKeysChange((x) => x.path),\n shareReplay(1)\n );\n readonly collectionKeys$ = this.collectionRefs$.pipe(\n map((x) => x.map((y) => y.path)),\n shareReplay(1)\n );\n\n readonly currentConstraints$ = this._constraints.pipe(distinctUntilChanged());\n\n readonly constraints$ = this._waitForNonNullConstraints.pipe(\n switchMap((waitForNonNullConstraints) => {\n let obs: Observable<Maybe<ArrayOrValue<FirestoreQueryConstraint>>> = this.currentConstraints$;\n\n // defaults to true\n if (waitForNonNullConstraints !== false) {\n obs = this.currentConstraints$.pipe(filterMaybe());\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n\n readonly iteratorFilter$: Observable<FirestoreItemPageIteratorFilter> = combineLatest([this._itemsPerPage.pipe(distinctUntilChanged()), this.constraints$]).pipe(\n map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages }) as FirestoreItemPageIteratorFilter),\n shareReplay(1)\n );\n\n readonly firestoreIteration$: Observable<FirestoreItemPageIterationInstance<T>> = this.collection$.pipe(\n switchMap((collection) => {\n if (collection) {\n return combineLatest([this.collectionMode$, this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(\n throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.\n switchMap(([mode, filter]) => {\n if (mode === 'query') {\n return of(collection.firestoreIteration(filter));\n } else {\n return this.collectionRefs$.pipe(map((refs) => collection.firestoreFixedIteration(refs, filter)));\n }\n }),\n cleanupDestroyable(), // cleanup the iteration\n shareReplay(1)\n );\n } else {\n return NEVER; // don't emit anything until collection is provided.\n }\n }),\n cleanupDestroyable(), // cleanup the iteration\n shareReplay(1)\n );\n\n readonly queryChangeWatcher$: Observable<IterationQueryDocChangeWatcher<T>> = this.firestoreIteration$.pipe(\n map((instance) => iterationQueryDocChangeWatcher({ instance })),\n shareReplay(1)\n );\n\n readonly snapshotAccumulator$: Observable<FirebaseQuerySnapshotAccumulator<T>> = this.firestoreIteration$.pipe(\n map((x) => firebaseQuerySnapshotAccumulator<T>(x)),\n cleanupDestroyable(),\n shareReplay(1)\n );\n\n readonly hasNext$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => x.hasNext$),\n shareReplay(1)\n );\n\n readonly canLoadMore$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => x.canLoadMore$),\n shareReplay(1)\n );\n\n readonly hasNextAndCanLoadMore$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => iterationHasNextAndCanLoadMore(x)),\n shareReplay(1)\n );\n\n readonly snapshotAccumulatorDocumentRefs$: Observable<DocumentReference<T>[][]> = this.snapshotAccumulator$.pipe(\n switchMap((x) => x.allItems$.pipe(map((y) => y.map((z) => z.map((zz) => zz.ref))))),\n shareReplay(1)\n );\n\n readonly snapshotAccumulatorDocuments$: Observable<D[][]> = combineLatest([this.collection$.pipe(filterMaybe()), this.snapshotAccumulatorDocumentRefs$]).pipe(\n map(([collection, documentRefs]) => {\n const accessor = collection.documentAccessor();\n return documentRefs.map((y) => y.map((z) => accessor.loadDocument(z)));\n }),\n shareReplay(1)\n );\n\n readonly accumulator$: Observable<FirebaseQueryItemAccumulator<T>> = this.firestoreIteration$.pipe(\n map((x) => firebaseQueryItemAccumulator<T>(x)),\n cleanupDestroyable(),\n shareReplay(1)\n );\n\n readonly accumulatorPage$: Observable<PageNumber> = this.accumulator$.pipe(\n switchMap((x) => pageItemAccumulatorCurrentPage(x)),\n shareReplay(1)\n );\n\n /**\n * Passthrough for currentAllItems$ from the accumulator.\n */\n readonly currentAccumulatorItems$: Observable<DocumentDataWithIdAndKey<T>[][]> = this.accumulator$.pipe(\n switchMap((x) => x.currentAllItems$),\n shareReplay(1)\n );\n\n /**\n * Passthrough for allItems$ from the accumulator.\n */\n readonly accumulatorItems$: Observable<DocumentDataWithIdAndKey<T>[][]> = this.accumulator$.pipe(\n switchMap((x) => x.allItems$),\n shareReplay(1)\n );\n\n /**\n * Returns true if the first page result has one or more documents.\n */\n readonly hasDocuments$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => x.firstState$.pipe(map((x) => Boolean(x.value?.length)))),\n shareReplay(1)\n );\n\n readonly allDocumentRefs$: Observable<DocumentReference<T>[]> = this.snapshotAccumulatorDocumentRefs$.pipe(\n map((x) => x.flat()),\n shareReplay(1)\n );\n\n readonly allDocuments$: Observable<D[]> = this.snapshotAccumulatorDocuments$.pipe(\n map((x) => x.flat()),\n shareReplay(1)\n );\n\n readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]> = this.accumulatorItems$.pipe(\n map((x) => x.flat()),\n shareReplay(1)\n );\n\n readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = this.accumulator$.pipe(\n switchMap((x) => accumulatorFlattenPageListLoadingState(x)),\n shareReplay(1)\n );\n\n constructor(initConfig?: DbxFirebaseCollectionLoaderInstanceInitConfig<T, D>) {\n this._collectionMode.next(initConfig?.collectionMode ?? 'query');\n\n if (initConfig?.collectionKeys) {\n this.collectionKeys = initConfig?.collectionKeys;\n } else if (initConfig?.collectionRefs) {\n this.collectionRefs = initConfig?.collectionRefs;\n }\n\n this._collection.next(initConfig?.collection);\n this._maxPages.next(initConfig?.maxPages);\n this._itemsPerPage.next(initConfig?.itemsPerPage);\n this._constraints.next(initConfig?.constraints);\n }\n\n init(): void {\n // When max pages changes, update the iteration's max page limit.\n this._maxPagesSub.subscription = this._maxPages\n .pipe(\n distinctUntilChanged(),\n filterMaybe(), // do not pass null/undefined values\n switchMap((maxPageLoadLimit) =>\n this.firestoreIteration$.pipe(\n tap((iteration) => {\n iteration.setMaxPageLoadLimit(maxPageLoadLimit);\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this._collectionMode.complete();\n this._collectionRefs.complete();\n this._maxPages.complete();\n this._collection.complete();\n this._constraints.complete();\n this._itemsPerPage.complete();\n this._restart.complete();\n this._maxPagesSub.destroy();\n }\n\n // MARK: Inputs\n get collectionMode(): DbxFirebaseCollectionMode {\n return this._collectionMode.value;\n }\n\n set collectionMode(mode: DbxFirebaseCollectionMode) {\n if (this.collectionMode != mode) {\n this._collectionMode.next(mode);\n }\n }\n\n get collectionKeys(): Maybe<FirestoreModelKey[]> {\n const refs = this.collectionRefs;\n return refs?.map((x) => x.path);\n }\n\n set collectionKeys(keys: Maybe<FirestoreModelKey[]>) {\n let refs: Maybe<DocumentReference<T>[]> = undefined;\n const { collection } = this;\n\n if (keys && collection) {\n const accessor = collection.documentAccessor();\n refs = keys.map((x) => accessor.documentRefForKey(x));\n }\n\n this.collectionRefs = refs;\n }\n\n get collectionRefs(): Maybe<DocumentReference<T>[]> {\n return this._collectionRefs.value;\n }\n\n set collectionRefs(refs: Maybe<DocumentReference<T>[]>) {\n this._collectionRefs.next(refs);\n }\n\n get maxPages(): Maybe<number> {\n return this._maxPages.value;\n }\n\n set maxPages(maxPages: Maybe<number>) {\n if (this.maxPages != maxPages) {\n this._maxPages.next(maxPages);\n }\n }\n\n get itemsPerPage(): Maybe<number> {\n return this._itemsPerPage.value;\n }\n\n set itemsPerPage(itemsPerPage: Maybe<number>) {\n if (this.itemsPerPage != itemsPerPage) {\n this._itemsPerPage.next(itemsPerPage);\n }\n }\n\n get constraints(): Maybe<ArrayOrValue<FirestoreQueryConstraint>> {\n return this._constraints.value;\n }\n\n set constraints(constraints: Maybe<ArrayOrValue<FirestoreQueryConstraint>>) {\n this._constraints.next(constraints);\n }\n\n get waitForNonNullConstraints(): Maybe<boolean> {\n return this._waitForNonNullConstraints.value;\n }\n\n set waitForNonNullConstraints(waitForNonNullConstraints: Maybe<boolean>) {\n this._waitForNonNullConstraints.next(waitForNonNullConstraints);\n }\n\n get collection(): Maybe<FirestoreCollectionLike<T, D>> {\n return this._collection.value;\n }\n\n set collection(collection: Maybe<FirestoreCollectionLike<T, D>>) {\n this._collection.next(collection);\n }\n\n // MARK: DbxFirebaseCollectionLoader\n next() {\n useFirst(this.firestoreIteration$, (x) => x.next());\n }\n\n restart() {\n this._restart.next();\n }\n\n setCollectionMode(mode: DbxFirebaseCollectionMode) {\n this.collectionMode = mode;\n }\n\n // References Mode\n setCollectionKeys(keys: Maybe<FirestoreModelKey[]>): void {\n this.collectionKeys = keys;\n }\n\n setCollectionRefs(refs: Maybe<DocumentReference<T>[]>): void {\n this.collectionRefs = refs;\n }\n\n // Query Mode\n setMaxPages(maxPages: Maybe<number>) {\n this.maxPages = maxPages;\n }\n\n setItemsPerPage(itemsPerPage: Maybe<number>) {\n this.itemsPerPage = itemsPerPage;\n }\n\n setConstraints(constraints: Maybe<ArrayOrValue<FirestoreQueryConstraint>>) {\n this.constraints = constraints;\n }\n\n setWaitForNonNullConstraints(waitForNonNullConstraints: Maybe<boolean>) {\n this.waitForNonNullConstraints = waitForNonNullConstraints;\n }\n\n setCollection(firestoreCollection: Maybe<FirestoreCollectionLike<T, D>>) {\n this.collection = firestoreCollection;\n }\n\n loadPagesUntilResultsCount(maxResultsLimit: GetterOrValue<number>, countResultsFunction?: FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction<T> | undefined): Observable<ItemAccumulatorNextPageUntilResultsCountResult> {\n const defaultFn: ItemAccumulatorNextPageUntilResultsCountFunction<DocumentDataWithIdAndKey<T>[]> = countAllInNestedArray;\n return this.accumulator$.pipe(\n switchMap((accumulator) =>\n itemAccumulatorNextPageUntilResultsCount({\n accumulator,\n maxResultsLimit,\n countResultsFunction: countResultsFunction ?? defaultFn\n })\n )\n );\n }\n\n loadToPage(page: PageNumber): Observable<PageNumber> {\n return this.accumulator$.pipe(switchMap((accumulator) => iteratorNextPageUntilPage(accumulator.itemIteration, page)));\n }\n\n loadAllResults(): Observable<PageNumber> {\n return this.accumulator$.pipe(switchMap((accumulator) => iteratorNextPageUntilMaxPageLoadLimit(accumulator.itemIteration)));\n }\n}\n\nexport function dbxFirebaseCollectionLoaderInstance<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(config: DbxFirebaseCollectionLoaderInstanceInitConfig<T, D>): DbxFirebaseCollectionLoaderInstance<T, D> {\n return new DbxFirebaseCollectionLoaderInstance<T, D>(config);\n}\n\nexport function dbxFirebaseCollectionLoaderInstanceWithCollection<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(collection: Maybe<FirestoreCollectionLike<T, D>>): DbxFirebaseCollectionLoaderInstance<T, D> {\n return new DbxFirebaseCollectionLoaderInstance<T, D>({ collection });\n}\n","import { type ObservableOrValue, useAsObservable, type PageListLoadingState, filterMaybe, SubscriptionObject, asObservable, pageLoadingStateFromObs } from '@dereekb/rxjs';\nimport { BehaviorSubject, map, shareReplay, distinctUntilChanged, Subject, switchMap, type Observable, startWith, exhaustMap } from 'rxjs';\nimport {\n dataFromDocumentSnapshots,\n type DocumentDataWithIdAndKey,\n type DocumentReference,\n documentReferencesFromDocuments,\n type DocumentSnapshot,\n type FirestoreDocument,\n type FirestoreDocumentAccessor,\n firestoreModelIdsFromDocuments,\n type FirestoreModelKey,\n firestoreModelKeysFromDocuments,\n getDataFromDocumentSnapshots,\n getDocumentSnapshots,\n latestSnapshotsFromDocuments,\n type LimitedFirestoreDocumentAccessor,\n loadDocumentsForDocumentReferences,\n loadDocumentsForIds,\n loadDocumentsForKeys\n} from '@dereekb/firebase';\nimport { type ArrayOrValue, asArray, type Destroyable, type Maybe } from '@dereekb/util';\nimport { type DbxFirebaseDocumentLoader, type DbxLimitedFirebaseDocumentLoader } from './document.loader';\n\nexport interface DbxFirebaseDocumentLoaderInstanceInitConfig<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>> {\n readonly accessor: A;\n}\n\n/**\n * DbxLimitedFirebaseDocumentLoader implementation within an instance.\n */\nexport class DbxLimitedFirebaseDocumentLoaderInstance<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>> implements DbxLimitedFirebaseDocumentLoader<T>, Destroyable {\n readonly accessor: A;\n\n protected readonly _documents = new BehaviorSubject<Maybe<D[]>>(undefined);\n protected readonly _restart = new Subject<void>();\n protected readonly _sub = new SubscriptionObject();\n\n readonly documents$ = this._documents.pipe(filterMaybe(), distinctUntilChanged());\n readonly keys$ = this.documents$.pipe(map(firestoreModelKeysFromDocuments));\n readonly ids$ = this.documents$.pipe(map(firestoreModelIdsFromDocuments));\n readonly refs$ = this.documents$.pipe(map(documentReferencesFromDocuments));\n\n readonly snapshots$: Observable<DocumentSnapshot<T>[]> = this.documents$.pipe(\n switchMap((docs) =>\n this._restart.pipe(\n startWith(null),\n exhaustMap(() => getDocumentSnapshots<D>(docs))\n )\n ),\n shareReplay(1)\n );\n\n readonly data$: Observable<DocumentDataWithIdAndKey<T>[]> = this.snapshots$.pipe(\n map((snapshots) => getDataFromDocumentSnapshots(snapshots, true)),\n shareReplay(1)\n );\n\n /**\n * Snapshot stream of the documents\n */\n readonly snapshotsStream$: Observable<DocumentSnapshot<T>[]> = this.documents$.pipe(\n switchMap((docs) => latestSnapshotsFromDocuments(docs)),\n shareReplay(1)\n );\n\n /**\n * Data streamd of the documents.\n */\n readonly dataStream$: Observable<DocumentDataWithIdAndKey<T>[]> = this.snapshotsStream$.pipe(dataFromDocumentSnapshots(), shareReplay(1));\n\n readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = pageLoadingStateFromObs(this.data$, false);\n readonly pageLoadingStateStream$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = pageLoadingStateFromObs(this.dataStream$, false);\n\n constructor(initConfig: DbxFirebaseDocumentLoaderInstanceInitConfig<T, D, A>) {\n this.accessor = initConfig.accessor;\n }\n\n destroy(): void {\n this._documents.complete();\n this._restart.complete();\n this._sub.destroy();\n }\n\n restart() {\n this._restart.next();\n }\n\n setKeys(keys: Maybe<ObservableOrValue<ArrayOrValue<FirestoreModelKey>>>): void {\n this.setDocuments(asObservable(keys).pipe(map((x) => loadDocumentsForKeys(this.accessor, asArray(x)))));\n }\n\n setRefs(refs: Maybe<ObservableOrValue<ArrayOrValue<DocumentReference<T>>>>): void {\n this.setDocuments(asObservable(refs).pipe(map((x) => loadDocumentsForDocumentReferences(this.accessor, asArray(x)))));\n }\n\n setDocuments(docs: Maybe<ObservableOrValue<ArrayOrValue<D>>>): void {\n this._sub.subscription = useAsObservable(docs, (x) => this._documents.next(asArray(x)));\n }\n}\n\nexport function dbxLimitedFirebaseDocumentLoaderInstance<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>>(config: DbxFirebaseDocumentLoaderInstanceInitConfig<T, D, A>): DbxLimitedFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxLimitedFirebaseDocumentLoaderInstance<T, D, A>(config);\n}\n\nexport function dbxLimitedFirebaseDocumentLoaderInstanceWithAccessor<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>>(accessor: A): DbxLimitedFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxLimitedFirebaseDocumentLoaderInstance<T, D, A>({ accessor });\n}\n\n// MARK: Full DbxFirebaseDocumentLoaderInstance\nexport class DbxFirebaseDocumentLoaderInstance<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends FirestoreDocumentAccessor<T, D> = FirestoreDocumentAccessor<T, D>> extends DbxLimitedFirebaseDocumentLoaderInstance<T, D, A> implements DbxFirebaseDocumentLoader<T>, Destroyable {\n setIds(ids: Maybe<ObservableOrValue<ArrayOrValue<FirestoreModelKey>>>): void {\n this.setDocuments(asObservable(ids).pipe(map((x) => loadDocumentsForIds(this.accessor, asArray(x)))));\n }\n}\n\nexport function dbxFirebaseDocumentLoaderInstance<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends FirestoreDocumentAccessor<T, D> = FirestoreDocumentAccessor<T, D>>(config: DbxFirebaseDocumentLoaderInstanceInitConfig<T, D, A>): DbxFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxFirebaseDocumentLoaderInstance<T, D, A>(config);\n}\n\nexport function dbxFirebaseDocumentLoaderInstanceWithAccessor<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends FirestoreDocumentAccessor<T, D> = FirestoreDocumentAccessor<T, D>>(accessor: A): DbxFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxFirebaseDocumentLoaderInstance<T, D, A>({ accessor });\n}\n","import { type FirestoreDocument, type FirebasePermissionErrorContext, type InModelContextFirebaseModelService, type FirestoreDocumentData, type DocumentSnapshot, type FirestoreAccessorStreamMode, type SnapshotOptions, type InContextFirebaseModelsService, type FirebaseModelsService } from '@dereekb/firebase';\nimport { type GrantedRole, type GrantedRoleTruthMap, type GrantedRoleTruthMapObject } from '@dereekb/model';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type SetIncludesMode, type IterableOrValue, type ModelKey } from '@dereekb/util';\nimport { map, type Observable, switchMap, shareReplay, distinctUntilChanged } from 'rxjs';\nimport { type DbxFirebaseInContextFirebaseModelInfoServiceInstance } from './model.context';\n\nexport type DbxFirebaseInContextFirebaseModelServiceInstanceFactory<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext> = <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(type: S extends InContextFirebaseModelsService<infer Y> ? (Y extends FirebaseModelsService<infer X, infer C> ? keyof X : never) : never, keyObs: ObservableOrValue<ModelKey>) => DbxFirebaseInContextFirebaseModelServiceInstance<D, R, C>;\n\nexport function dbxFirebaseInContextFirebaseModelServiceInstanceFactory<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext>(context$: Observable<S>): DbxFirebaseInContextFirebaseModelServiceInstanceFactory<S, C> {\n return <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(type: S extends InContextFirebaseModelsService<infer Y> ? (Y extends FirebaseModelsService<infer X, infer C> ? keyof X : never) : never, keyObs: ObservableOrValue<ModelKey>) => {\n const key$ = asObservable(keyObs);\n const modelServiceObs = context$.pipe(\n map((x) => x(type)),\n switchMap((service) => key$.pipe(map((key) => service(key))))\n ) as unknown as Observable<InModelContextFirebaseModelService<C, FirestoreDocumentData<D>, D, R>>;\n\n return dbxFirebaseInContextFirebaseModelServiceInstance<D, R, C>(modelServiceObs);\n };\n}\n\nexport interface DbxFirebaseInContextFirebaseModelServiceInstance<D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext> extends DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R> {\n readonly modelService$: Observable<InModelContextFirebaseModelService<C, FirestoreDocumentData<D>, D, R>>;\n}\n\n/**\n * Creates a new DbxFirebaseInContextFirebaseModelServiceInstance.\n *\n * Wraps an InModelContextFirebaseModelService observable and provides different piped observables.\n */\nexport function dbxFirebaseInContextFirebaseModelServiceInstance<D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext>(modelService$: Observable<InModelContextFirebaseModelService<C, FirestoreDocumentData<D>, D, R>>) {\n const key$ = modelService$.pipe(map((x) => x.model.key));\n\n // MARK: Model\n const modelType$ = modelService$.pipe(\n map((x) => x.model.modelType),\n distinctUntilChanged()\n );\n\n const model$ = modelService$.pipe(\n map((x) => x.model),\n distinctUntilChanged((a, b) => a.key === b.key),\n shareReplay(1)\n );\n\n const snapshotData$ = model$.pipe(\n switchMap((x) => x.snapshotData()),\n shareReplay(1)\n );\n\n function snapshotStream(mode: FirestoreAccessorStreamMode): Observable<DocumentSnapshot<FirestoreDocumentData<D>>> {\n return model$.pipe(\n switchMap((x) => x.snapshotStream(mode)),\n shareReplay(1)\n );\n }\n\n function snapshotDataStream(mode: FirestoreAccessorStreamMode, options?: SnapshotOptions): Observable<FirestoreDocumentData<D>> {\n return model$.pipe(\n switchMap((x) => x.snapshotDataStream(mode)),\n shareReplay(1)\n );\n }\n\n // MARK: Roles\n const roleReader$ = modelService$.pipe(\n switchMap((x) => x.roleReader()),\n shareReplay(1)\n );\n\n const roleMap$ = roleReader$.pipe(\n map((x) => x.roleMap),\n shareReplay(1)\n );\n\n const hasNoAccess$ = roleReader$.pipe(\n map((x) => x.hasNoAccess()),\n shareReplay(1)\n );\n\n function truthMap<M extends GrantedRoleTruthMapObject<any, R>>(input: M): Observable<GrantedRoleTruthMap<M>> {\n return roleReader$.pipe(\n map((x) => x.truthMap(input)),\n shareReplay(1)\n );\n }\n\n function hasAnyRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return hasRoles('any', roles);\n }\n\n function hasAllRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return hasRoles('all', roles);\n }\n\n function hasRoles(setIncludes: SetIncludesMode, roles: IterableOrValue<R>): Observable<boolean> {\n return roleReader$.pipe(\n map((x) => x.hasRoles(setIncludes, roles)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n function containsAnyRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return containsRoles('any', roles);\n }\n\n function containsAllRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return containsRoles('all', roles);\n }\n\n function containsRoles(setIncludes: SetIncludesMode, roles: IterableOrValue<R>): Observable<boolean> {\n return roleReader$.pipe(\n map((x) => x.containsRoles(setIncludes, roles)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n const result: DbxFirebaseInContextFirebaseModelServiceInstance<D, R, C> = {\n modelService$,\n key$,\n modelType$,\n model$,\n snapshotData$,\n snapshotStream,\n snapshotDataStream,\n roleReader$,\n roleMap$,\n hasNoAccess$,\n truthMap,\n hasAnyRoles,\n hasAllRoles,\n hasRoles,\n containsAnyRoles,\n containsAllRoles,\n containsRoles\n };\n\n return result;\n}\n","import { type FirestoreModelType, buildFirebaseCollectionTypeModelTypeMap, type FirebasePermissionErrorContext, type FirestoreDocument, type FirestoreModelIdentityTypeMap, type FirestoreModelKey, type InContextFirebaseModelsService, firestoreModelKeyCollectionTypePair } from '@dereekb/firebase';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type GrantedRole } from '@dereekb/model';\nimport { shareReplay, map, type Observable, type OperatorFunction, first, switchMap } from 'rxjs';\nimport { type DbxFirebaseInContextFirebaseModelInfoServiceInstance } from './model.context';\nimport { type DbxFirebaseInContextFirebaseModelServiceInstanceFactory } from './model.context.instance';\n\n/**\n * Used for retrieving contexts for a specific model type/identity.\n */\nexport abstract class DbxFirebaseModelContextService {\n /**\n * Creates a new DbxFirebaseInContextFirebaseModelInfoServiceInstance for the input model key.\n *\n * @param key$\n */\n abstract modelInfoInstance<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole>(keyObs: ObservableOrValue<FirestoreModelKey>): Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>;\n}\n\nexport type DbxFirebaseModelContextServiceInfoInstanceFactory = <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(keyObs: ObservableOrValue<FirestoreModelKey>) => Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>;\n\nexport interface DbxFirebaseModelContextServiceInfoInstanceFactoryConfig<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext> {\n readonly modelService: DbxFirebaseInContextFirebaseModelServiceInstanceFactory<S, C>;\n readonly entityMap$: Observable<FirestoreModelIdentityTypeMap>;\n}\n\nexport function dbxFirebaseModelContextServiceInfoInstanceFactory<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext>(config: DbxFirebaseModelContextServiceInfoInstanceFactoryConfig<S, C>): DbxFirebaseModelContextServiceInfoInstanceFactory {\n const { modelService, entityMap$ } = config;\n return <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(keyObs: ObservableOrValue<string>) => {\n const key$ = asObservable(keyObs);\n\n return key$.pipe(\n map(firestoreModelKeyCollectionTypePair),\n switchMap((pair) => {\n return entityMap$.pipe(\n map((entityMap) => {\n const modelType = entityMap.get(pair.collectionType) as FirestoreModelType;\n\n if (!modelType) {\n const message = `dbxFirebaseModelContextServiceInfoInstanceFactory Error: Failed to retrieve model type for collection type \"${pair.collectionType}\"`;\n console.error(message);\n throw new Error(message);\n }\n\n return modelService(modelType as any, pair.key) as DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>;\n })\n );\n })\n );\n };\n}\n\n/**\n * Operator function that builds a FirestoreModelIdentityTypeMap from the input context and shares the replay.\n *\n * Since the output won't change with different contexts, the map is built once and then shared.\n *\n * @returns\n */\nexport function firebaseContextServiceEntityMap<T extends InContextFirebaseModelsService<any>>(): OperatorFunction<T, FirestoreModelIdentityTypeMap> {\n return (obs: Observable<T>) => {\n return obs.pipe(\n map((x) => buildFirebaseCollectionTypeModelTypeMap(x)),\n first(),\n shareReplay(1)\n );\n };\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxFirebaseModelContextService } from './model.context.service';\nimport { type ClassType } from '@dereekb/util';\n\n/**\n * Factory function for creating a DbxFirebaseModelContextService instance.\n */\nexport type DbxFirebaseModelContextServiceFactory<T extends DbxFirebaseModelContextService> = (injector: Injector) => T;\n\nexport interface ProvideDbxFirebaseModelContextServiceConfig<T extends DbxFirebaseModelContextService> {\n readonly dbxFirebaseModelContextServiceClass: ClassType<T>;\n readonly dbxFirebaseModelContextServiceFactory?: DbxFirebaseModelContextServiceFactory<T>;\n}\n\n/**\n * Creates EnvironmentProviders that provides a DbxFirebaseModelContextService and the configured class instance.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseModelContextService<T extends DbxFirebaseModelContextService>(config: ProvideDbxFirebaseModelContextServiceConfig<T>): EnvironmentProviders {\n const { dbxFirebaseModelContextServiceClass, dbxFirebaseModelContextServiceFactory } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseModelContextService,\n useExisting: dbxFirebaseModelContextServiceClass\n }\n ];\n\n if (dbxFirebaseModelContextServiceFactory) {\n providers.push({\n provide: dbxFirebaseModelContextServiceClass,\n useFactory: dbxFirebaseModelContextServiceFactory,\n deps: [Injector]\n });\n } else {\n providers.push({\n provide: DbxFirebaseModelContextService,\n useClass: dbxFirebaseModelContextServiceClass\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { distinctUntilChanged, map, Observable, shareReplay, switchMap, combineLatest, of, catchError } from 'rxjs';\nimport { FirestoreCollectionType, FirestoreDocument, FirestoreDocumentData, FirestoreModelIdentity, FirestoreModelKey } from '@dereekb/firebase';\nimport { DbxModelTypeInfo, DbxModelTypesMap, DbxModelTypesService } from '@dereekb/dbx-web';\nimport { ArrayOrValue, asArray, Configurable, FactoryWithRequiredInput, Maybe } from '@dereekb/util';\nimport { ClickableAnchorLinkSegueRef, IconAndTitle, SegueRef } from '@dereekb/dbx-core';\nimport { ObservableOrValue, filterMaybe, filterMaybeArray } from '@dereekb/rxjs';\nimport { GrantedRole } from '@dereekb/model';\nimport { Injectable, inject, Inject } from '@angular/core';\nimport { DbxFirebaseModelContextService } from '../../service/model.context.service';\nimport { DbxFirebaseInContextFirebaseModelInfoServiceInstance } from '../../service/model.context';\n\n/**\n * Configuration provided in the root module for configuring entries.\n */\nexport abstract class DbxFirebaseModelTypesServiceConfig {\n /**\n * Entries to register.\n */\n abstract entries: DbxFirebaseModelTypesServiceEntry[];\n}\n\nexport interface DbxFirebaseModelTypesServiceEntry<T = unknown> extends Omit<DbxModelTypeInfo, 'canSegueToView' | 'modelType'> {\n /**\n * Identity of the item being registered.\n */\n readonly identity: FirestoreModelIdentity;\n /**\n * Creates the DbxFirebaseModelDisplayInfo for the input data.\n *\n * If no icon is provided, it uses the default icon configured in this entry.\n *\n * @param value\n * @returns\n */\n readonly displayInfoFactory: FactoryWithRequiredInput<DbxFirebaseModelDisplayInfo, T>;\n}\n\nexport type DbxFirebaseModelDisplayInfo = IconAndTitle;\n\nexport interface DbxFirebaseModelTypeInfo<T = unknown> extends DbxModelTypeInfo, Pick<DbxFirebaseModelTypesServiceEntry<T>, 'identity' | 'displayInfoFactory'> {}\n\nexport type DbxFirebaseModelTypesMap = DbxModelTypesMap<DbxFirebaseModelTypeInfo>;\n\n/**\n * Provides model type information about models registered within Firebase.\n *\n * Automatically configures the DbxModelTypesService.\n */\n@Injectable()\nexport class DbxFirebaseModelTypesService {\n readonly dbxFirebaseModelContextService = inject(DbxFirebaseModelContextService);\n\n readonly dbxModelTypesService = inject(DbxModelTypesService<DbxFirebaseModelTypeInfo>);\n\n constructor(@Inject(DbxFirebaseModelTypesServiceConfig) initialConfig: DbxFirebaseModelTypesServiceConfig) {\n if (initialConfig.entries) {\n this.register(initialConfig.entries);\n }\n }\n\n getDisplayInfo<T>(typeInfo: DbxFirebaseModelTypeInfo<T>, data: T): DbxFirebaseModelDisplayInfo {\n let displayInfo: Configurable<DbxFirebaseModelDisplayInfo>;\n\n if (data != null) {\n displayInfo = typeInfo.displayInfoFactory(data);\n displayInfo.icon = displayInfo.icon || typeInfo.icon; // set default icon\n } else {\n displayInfo = this.getDefaultDisplayInfo(typeInfo);\n }\n\n return displayInfo;\n }\n\n getDefaultDisplayInfo<T = unknown>(typeInfo: DbxFirebaseModelTypeInfo<T>) {\n // TODO: Make configurable\n return {\n title: typeInfo.label ?? '',\n icon: 'warning'\n };\n }\n\n // MARK: Register\n register(entries: ArrayOrValue<DbxFirebaseModelTypesServiceEntry>) {\n const typeConfigs = asArray(entries).map((x) => ({ ...x, modelType: x.identity.modelType }));\n this.dbxModelTypesService.addTypeConfigs(typeConfigs);\n }\n\n // MARK: Retrieval\n currentInfoForType(type: FirestoreCollectionType): Observable<Maybe<DbxFirebaseModelTypeInfo>> {\n return this.dbxModelTypesService.typesMap$.pipe(map((x) => x[type]));\n }\n\n infoForType(type: FirestoreCollectionType): Observable<DbxFirebaseModelTypeInfo> {\n return this.currentInfoForType(type).pipe(\n map((x) => {\n if (!x) {\n console.error(`DbxFirebaseModelTypesService: contained no info for type \"${type}\". Ensure the correct type was entered, and that the type is registered with the DbxFirebaseModelTypesService.`);\n throw x;\n }\n\n return x as DbxFirebaseModelTypeInfo;\n })\n );\n }\n\n instanceForKey<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole>(key$: ObservableOrValue<FirestoreModelKey>): DbxFirebaseModelTypesServiceInstance<D, R> {\n return dbxFirebaseModelTypesServiceInstance<D, R>(this.dbxFirebaseModelContextService.modelInfoInstance<D, R>(key$), this);\n }\n\n instancePairsForKeys(keys: ArrayOrValue<ObservableOrValue<FirestoreModelKey>>) {\n return dbxFirebaseModelTypesServiceInstancePairForKeysFactory(this)(keys);\n }\n}\n\n/**\n * Information pair for an instance.\n */\nexport interface DbxFirebaseModelTypesServiceInstancePair<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole> {\n readonly key: FirestoreModelKey;\n readonly instance: DbxFirebaseModelTypesServiceInstance<D, R>;\n readonly displayInfo: DbxFirebaseModelDisplayInfo;\n readonly segueRef: Maybe<ClickableAnchorLinkSegueRef>;\n}\n\nexport type DbxFirebaseModelTypesServiceInstancePairForKeysFactory = (keys: ArrayOrValue<ObservableOrValue<FirestoreModelKey>>) => Observable<DbxFirebaseModelTypesServiceInstancePair[]>;\n\nexport function dbxFirebaseModelTypesServiceInstancePairForKeysFactory(service: DbxFirebaseModelTypesService): DbxFirebaseModelTypesServiceInstancePairForKeysFactory {\n return (keys: ArrayOrValue<ObservableOrValue<FirestoreModelKey>>) => {\n const instances = asArray(keys).map((x) => service.instanceForKey(x).safeInstancePair$);\n return instances.length ? combineLatest(instances).pipe(filterMaybeArray(), shareReplay(1)) : of([]);\n };\n}\n\n/**\n * DbxFirebaseModelTypesService instance\n */\nexport interface DbxFirebaseModelTypesServiceInstance<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole> {\n readonly modelInfoInstance$: Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>;\n readonly dbxFirebaseModelTypesService: DbxFirebaseModelTypesService;\n readonly key$: Observable<string>;\n readonly modelType$: Observable<string>;\n readonly snapshotData$: Observable<Maybe<FirestoreDocumentData<D>>>;\n readonly safeTypeInfo$: Observable<Maybe<DbxFirebaseModelTypeInfo<unknown>>>;\n readonly typeInfo$: Observable<DbxFirebaseModelTypeInfo<unknown>>;\n readonly identity$: Observable<FirestoreModelIdentity>;\n readonly segueRef$: Observable<Maybe<SegueRef>>;\n readonly displayInfo$: Observable<DbxFirebaseModelDisplayInfo>;\n readonly clickableSegueRef$: Observable<Maybe<ClickableAnchorLinkSegueRef>>;\n readonly safeInstancePair$: Observable<Maybe<DbxFirebaseModelTypesServiceInstancePair>>;\n readonly instancePair$: Observable<DbxFirebaseModelTypesServiceInstancePair>;\n}\n\nexport function dbxFirebaseModelTypesServiceInstance<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole>(modelInfoInstance$: Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>, dbxFirebaseModelTypesService: DbxFirebaseModelTypesService) {\n const key$ = modelInfoInstance$.pipe(switchMap((x) => x.key$));\n const modelType$ = modelInfoInstance$.pipe(switchMap((x) => x.modelType$));\n const snapshotData$ = modelInfoInstance$.pipe(switchMap((x) => x.snapshotData$));\n\n const safeTypeInfo$ = modelType$.pipe(\n switchMap((x) => dbxFirebaseModelTypesService.currentInfoForType(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const typeInfo$ = safeTypeInfo$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n const identity$ = typeInfo$.pipe(\n map((x) => x.identity),\n distinctUntilChanged()\n );\n\n const segueRef$: Observable<Maybe<SegueRef>> = combineLatest([key$, typeInfo$]).pipe(\n map(([key, info]) => (info.sref ? info.sref(key) : undefined)),\n shareReplay(1)\n );\n\n const displayInfo$: Observable<DbxFirebaseModelDisplayInfo> = combineLatest([typeInfo$, snapshotData$]).pipe(\n map(([typeInfo, data]) => dbxFirebaseModelTypesService.getDisplayInfo(typeInfo, data)),\n shareReplay(1)\n );\n\n const clickableSegueRef$: Observable<Maybe<ClickableAnchorLinkSegueRef>> = combineLatest([segueRef$, displayInfo$]).pipe(\n map(([segueRef, displayInfo]) => {\n let ref: Maybe<ClickableAnchorLinkSegueRef> = undefined;\n\n if (segueRef) {\n ref = {\n ...segueRef,\n title: displayInfo.title,\n icon: displayInfo.icon\n };\n }\n\n return ref;\n }),\n shareReplay(1)\n );\n\n const instancePair$: Observable<DbxFirebaseModelTypesServiceInstancePair> = combineLatest([clickableSegueRef$, displayInfo$, key$]).pipe(\n map(([segueRef, displayInfo, key]) => ({ segueRef, displayInfo, key, instance })),\n shareReplay(1)\n );\n\n const safeInstancePair$: Observable<Maybe<DbxFirebaseModelTypesServiceInstancePair>> = instancePair$.pipe(catchError(() => of(undefined)));\n\n const instance: DbxFirebaseModelTypesServiceInstance<D, R> = {\n modelInfoInstance$,\n dbxFirebaseModelTypesService,\n key$,\n modelType$,\n snapshotData$,\n safeTypeInfo$,\n typeInfo$,\n identity$,\n segueRef$,\n displayInfo$,\n clickableSegueRef$,\n safeInstancePair$,\n instancePair$\n };\n\n return instance;\n}\n","import { ArrayOrValue, DecisionFunction, Maybe, asArray, invertDecision } from '@dereekb/util';\nimport { FirestoreModelIdentity } from '@dereekb/firebase';\nimport { map, Observable, switchMap, shareReplay, startWith, of, catchError } from 'rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { allDbxModelViewTrackerEventModelKeys, DbxModelTrackerService } from '@dereekb/dbx-web';\nimport { DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { filterItemsWithObservableDecision, filterMaybeArray, invertObservableDecision, mapEachAsync, ObservableDecisionFunction } from '@dereekb/rxjs';\n\nexport interface DbxFirebaseModelTrackerFilterItem {\n readonly instancePair: DbxFirebaseModelTypesServiceInstancePair;\n readonly identity: FirestoreModelIdentity;\n}\n\nexport interface DbxFirebaseModelTrackerHistoryFilter {\n /**\n * Whether or not to exclude the values instead of include them.\n */\n readonly invertFilter?: boolean;\n /**\n * Identity types to filter on.\n */\n readonly identity?: Maybe<ArrayOrValue<FirestoreModelIdentity>>;\n /**\n * Arbitrary filter function to filter individual items.\n */\n readonly filterItem?: ObservableDecisionFunction<DbxFirebaseModelTrackerFilterItem>;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirebaseModelTrackerService {\n readonly dbxModelTrackerService = inject(DbxModelTrackerService);\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly historyKeys$ = this.dbxModelTrackerService.newEvent$.pipe(\n startWith(null),\n switchMap(() => this.loadHistoryKeys()),\n shareReplay(1)\n );\n\n readonly historyPairs$ = this.dbxModelTrackerService.newEvent$.pipe(\n startWith(null),\n switchMap(() => this.loadHistoryPairs()), // TODO: Improve efficiency of this to only load/remove items for new keys\n shareReplay(1)\n );\n\n readonly filterItemHistoryPairs$: Observable<DbxFirebaseModelTrackerFilterItem[]> = this.historyPairs$.pipe(\n mapEachAsync(\n (instancePair) =>\n instancePair.instance.identity$.pipe(\n map((identity) => ({ instancePair, identity })),\n catchError(() => of(undefined))\n ),\n { onlyFirst: true }\n ),\n filterMaybeArray<DbxFirebaseModelTrackerFilterItem>(),\n shareReplay(1)\n );\n\n /**\n * Filters from historyPairs$ using the input filter configuration, if it is provided.\n *\n * @param filter\n * @returns\n */\n filterHistoryPairs(filter?: Maybe<DbxFirebaseModelTrackerHistoryFilter>): Observable<DbxFirebaseModelTypesServiceInstancePair[]> {\n if (filter && (filter?.identity || filter?.filterItem)) {\n const { invertFilter = false, identity, filterItem } = filter;\n const allowedIdentities = new Set(asArray(identity));\n const baseIsAllowedIdentityFn: DecisionFunction<FirestoreModelIdentity> = identity ? (x) => allowedIdentities.has(x) : () => true;\n const isAllowedIdentityFn = invertDecision(baseIsAllowedIdentityFn, invertFilter);\n\n const baseFilterItemFn: ObservableDecisionFunction<DbxFirebaseModelTrackerFilterItem> = filterItem ? invertObservableDecision(filterItem, invertFilter) : () => of(true);\n\n const filterItemFn: ObservableDecisionFunction<DbxFirebaseModelTrackerFilterItem> = (x) => {\n if (isAllowedIdentityFn(x.identity)) {\n return baseFilterItemFn(x);\n } else {\n return of(false);\n }\n };\n\n return this.filterItemHistoryPairs$.pipe(\n filterItemsWithObservableDecision(filterItemFn),\n map((x) => x.map((y) => y.instancePair)),\n shareReplay(1)\n );\n } else {\n return this.historyPairs$;\n }\n }\n\n loadHistoryKeys() {\n return this.dbxModelTrackerService.getAllViewEvents().pipe(map(allDbxModelViewTrackerEventModelKeys));\n }\n\n loadHistoryPairs(): Observable<DbxFirebaseModelTypesServiceInstancePair[]> {\n const historyKeys$ = this.loadHistoryKeys();\n return historyKeys$.pipe(switchMap((x) => this.dbxFirebaseModelTypesService.instancePairsForKeys(x)));\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, provideDbxListView, DbxValueAsListItem, provideDbxListViewWrapper, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, DbxSelectionValueListViewComponentImportsModule, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE } from '@dereekb/dbx-web';\nimport { of } from 'rxjs';\nimport { DbxFirebaseModelTypesServiceInstancePair } from './model.types.service';\n\nexport type DbxFirebaseModelTypeInstanceListItem = DbxValueAsListItem<DbxFirebaseModelTypesServiceInstancePair>;\n\n/**\n * Renders an item as configured from the DbxFirebaseModelTypesServiceInstancePair.\n */\n@Component({\n selector: 'dbx-firebase-model-type-instance-list',\n template: DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxListWrapperComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListViewWrapper(DbxFirebaseModelTypeInstanceListComponent),\n standalone: true\n})\nexport class DbxFirebaseModelTypeInstanceListComponent extends AbstractDbxSelectionListWrapperDirective<DbxFirebaseModelTypesServiceInstancePair> {\n constructor() {\n super({\n componentClass: DbxFirebaseModelTypeInstanceListViewComponent,\n defaultSelectionMode: 'view'\n });\n }\n}\n\n@Component({\n selector: 'dbx-firebase-model-type-instance-list-view',\n template: DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxSelectionValueListViewComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListView(DbxFirebaseModelTypeInstanceListViewComponent),\n standalone: true\n})\nexport class DbxFirebaseModelTypeInstanceListViewComponent extends AbstractDbxSelectionListViewDirective<DbxFirebaseModelTypesServiceInstancePair> {\n readonly config: DbxSelectionValueListViewConfig<DbxFirebaseModelTypeInstanceListItem> = {\n componentClass: DbxFirebaseModelTypeInstanceListViewItemComponent,\n mapValuesToItemValues: (x) => of(x.map((y) => ({ itemValue: y, icon: y.displayInfo.icon ?? y.icon, anchor: y.segueRef })))\n };\n}\n\n@Component({\n selector: 'dbx-firebase-model-type-instance-list-view-item',\n template: `\n <span>{{ title }}</span>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelTypeInstanceListViewItemComponent extends AbstractDbxValueListViewItemComponent<DbxFirebaseModelTypesServiceInstancePair> {\n readonly title = this.itemValue.displayInfo.title;\n}\n","import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport { AnchorForValueFunction, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective } from '@dereekb/dbx-web';\nimport { ListLoadingState, loadingStateFromObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap, shareReplay, Observable } from 'rxjs';\nimport { DbxFirebaseModelTrackerHistoryFilter, DbxFirebaseModelTrackerService } from './model.tracker.service';\nimport { DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { DbxFirebaseModelTypeInstanceListComponent } from '../model.types.list.component';\n\n@Component({\n selector: 'dbx-firebase-model-history',\n template: `\n <dbx-firebase-model-type-instance-list [state]=\"state\" dbxListItemModifier [dbxListItemAnchorModifier]=\"anchorForItem()\">\n <ng-content empty select=\"[empty]\"></ng-content>\n </dbx-firebase-model-type-instance-list>\n `,\n imports: [DbxFirebaseModelTypeInstanceListComponent, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelHistoryComponent {\n readonly dbxFirebaseModelTrackerService = inject(DbxFirebaseModelTrackerService);\n\n readonly anchorForItem = input<Maybe<AnchorForValueFunction<DbxFirebaseModelTypesServiceInstancePair>>>();\n readonly historyFilter = input<Maybe<DbxFirebaseModelTrackerHistoryFilter>>();\n\n readonly historyPairs$ = toObservable(this.historyFilter).pipe(\n switchMap((x) => this.dbxFirebaseModelTrackerService.filterHistoryPairs(x)),\n shareReplay(1)\n );\n\n readonly state: Observable<ListLoadingState<DbxFirebaseModelTypesServiceInstancePair>> = loadingStateFromObs(this.historyPairs$);\n}\n","import { ChangeDetectionStrategy, Component, ElementRef } from '@angular/core';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { AbstractPopoverDirective, AnchorForValueFunction, DbxListEmptyContentComponent, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverKey, DbxPopoverScrollContentDirective, DbxPopoverService } from '@dereekb/dbx-web';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { DbxFirebaseModelTrackerHistoryFilter } from './model.tracker.service';\nimport { DbxFirebaseModelHistoryComponent } from './model.history.component';\n\nexport interface DbxFirebaseModelHistoryPopoverConfig {\n /**\n * Custom icon\n *\n * Defaults to \"history\"\n */\n readonly icon?: string;\n /**\n * Custom header text\n *\n * Defaults to \"History\"\n */\n readonly header?: string;\n /**\n * Custom empty text when no items exist.\n */\n readonly emptyText?: string;\n /**\n * Origin to add the popover to.\n */\n readonly origin: ElementRef;\n /**\n * Optional config to pass to the DbxFirebaseHistoryComponent\n */\n readonly historyFilter?: Maybe<DbxFirebaseModelTrackerHistoryFilter>;\n /**\n * Anchor\n */\n readonly anchorForItem?: Maybe<AnchorForValueFunction<DbxFirebaseModelTypesServiceInstancePair>>;\n}\n\nexport type DbxFirebaseModelHistoryPopoverConfigWithoutOrigin = Omit<DbxFirebaseModelHistoryPopoverConfig, 'origin'>;\n\nexport const DEFAULT_DBX_FIREBASE_MODEL_HISTORY_COMPONENT_POPOVER_KEY = 'history';\n\n@Component({\n templateUrl: './model.history.popover.component.html',\n imports: [DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxFirebaseModelHistoryComponent, DbxListEmptyContentComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelHistoryPopoverComponent extends AbstractPopoverDirective<unknown, DbxFirebaseModelHistoryPopoverConfig> {\n static openPopover(popupService: DbxPopoverService, { origin, header, icon, emptyText, historyFilter, anchorForItem }: DbxFirebaseModelHistoryPopoverConfig, popoverKey?: DbxPopoverKey): NgPopoverRef {\n return popupService.open({\n key: popoverKey ?? DEFAULT_DBX_FIREBASE_MODEL_HISTORY_COMPONENT_POPOVER_KEY,\n origin,\n componentClass: DbxFirebaseModelHistoryPopoverComponent,\n data: {\n header,\n icon,\n emptyText,\n historyFilter,\n anchorForItem\n }\n });\n }\n\n get config(): DbxFirebaseModelHistoryPopoverConfig {\n return this.popover.data as DbxFirebaseModelHistoryPopoverConfig;\n }\n\n readonly icon = this.config.icon ?? 'history';\n readonly header = this.config.header ?? 'History';\n readonly emptyText = this.config.emptyText ?? 'History is empty.';\n readonly historyFilter = this.config.historyFilter;\n readonly anchorForItem = this.config.anchorForItem;\n}\n","<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-model-history [historyFilter]=\"historyFilter\" [anchorForItem]=\"anchorForItem\">\n <dbx-list-empty-content empty>\n <p>{{ emptyText }}</p>\n </dbx-list-empty-content>\n </dbx-firebase-model-history>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, viewChild } from '@angular/core';\nimport { AbstractPopoverRefDirective, DbxIconButtonComponent, DbxPopoverService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseModelHistoryPopoverComponent, DbxFirebaseModelHistoryPopoverConfigWithoutOrigin } from './model.history.popover.component';\nimport { Maybe } from '@dereekb/util';\n\nexport type DbxFirebaseModelHistoryPopoverButtonConfig = DbxFirebaseModelHistoryPopoverConfigWithoutOrigin;\n\n@Component({\n selector: 'dbx-firebase-model-history-popover-button',\n template: `\n <dbx-icon-button #button (buttonClick)=\"showHistoryPopover()\" icon=\"history\"></dbx-icon-button>\n `,\n standalone: true,\n imports: [DbxIconButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseModelHistoryPopoverButtonComponent extends AbstractPopoverRefDirective<unknown, unknown> {\n private readonly _dbxPopoverService = inject(DbxPopoverService);\n\n readonly buttonElement = viewChild.required<string, ElementRef>('button', { read: ElementRef });\n readonly config = input<DbxFirebaseModelHistoryPopoverConfigWithoutOrigin>();\n\n protected override _makePopoverRef(origin?: Maybe<ElementRef>): NgPopoverRef<unknown, unknown> {\n const config = this.config();\n\n if (!origin) {\n throw new Error('Missing origin.');\n }\n\n return DbxFirebaseModelHistoryPopoverComponent.openPopover(this._dbxPopoverService, {\n origin,\n ...config\n });\n }\n\n showHistoryPopover(): void {\n const origin = this.buttonElement();\n this.showPopover(origin);\n }\n}\n","import { type FirestoreDocument, type FirestoreModelIdentity } from '@dereekb/firebase';\nimport { type SourceSelectLoadSource } from '@dereekb/dbx-form';\nimport { type LoadingState, loadingStateFromObs, mapEachAsync } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\nimport { type GrantedRole } from '@dereekb/model';\nimport { type MapFunction } from '@dereekb/util';\nimport { type DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { type DbxFirebaseModelTrackerHistoryFilter, type DbxFirebaseModelTrackerService } from './model.tracker.service';\n\nexport interface DbxFirebaseSourceSelectLoadSourceConfig<M, D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole> extends Pick<DbxFirebaseModelTrackerHistoryFilter, 'filterItem'> {\n /**\n * Source label. Defaults to \"History\".\n */\n readonly label?: string;\n /**\n * Type of model to pull from the history.\n */\n readonly identity: FirestoreModelIdentity;\n /**\n * Maps a result instance to the target meta type\n */\n readonly mapToMeta: MapFunction<DbxFirebaseModelTypesServiceInstancePair<D, R>, Observable<M>>;\n /**\n * Tracker service to load history values from.\n */\n readonly dbxFirebaseModelTrackerService: DbxFirebaseModelTrackerService;\n}\n\n/**\n * Configures a SourceSelectLoadSource using the DbxFirebaseModelTrackerService to load models of a specific identity.\n *\n * @param config\n * @returns\n */\nexport function dbxFirebaseSourceSelectLoadSource<M>(config: DbxFirebaseSourceSelectLoadSourceConfig<M>): SourceSelectLoadSource<M> {\n const { label = 'History', identity, mapToMeta, filterItem, dbxFirebaseModelTrackerService } = config;\n const historyValuesObs = dbxFirebaseModelTrackerService.filterHistoryPairs({ identity, filterItem });\n const metaObs = historyValuesObs.pipe(mapEachAsync(mapToMeta));\n const meta: Observable<LoadingState<M[]>> = loadingStateFromObs(metaObs);\n\n return {\n label,\n meta\n };\n}\n","import { type FirestoreDocument, type FirestoreModelIdentity } from '@dereekb/firebase';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type DbxFirebaseDocumentReadOnlyStore } from '../../store/store';\nimport { type LoadingState } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * Provides a source of entities.\n */\nexport abstract class DbxFirebaseModelEntitiesSource {\n /**\n * Observable of a LoadingState of entity values.\n */\n abstract readonly entities$: Observable<LoadingState<DbxFirebaseModelEntity[]>>;\n}\n\n/**\n * A model entity.\n */\nexport interface DbxFirebaseModelEntity {\n /**\n * Model identity for the entity.\n *\n * Used for sorting/grouping by expected entity type.\n */\n readonly modelIdentity: FirestoreModelIdentity;\n /**\n * Optional name for\n */\n readonly name?: Maybe<string>;\n /**\n * An associated store for the document, if it is available.\n */\n readonly store?: Maybe<DbxFirebaseDocumentReadOnlyStore<any, any>>;\n}\n\nexport interface DbxFirebaseModelEntityWithStore<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends DbxFirebaseModelEntity {\n /**\n * An associated store for the document, if it is available.\n */\n readonly store: DbxFirebaseDocumentReadOnlyStore<T, D>;\n}\n\n/**\n * Returns true if the input entity has a defined store.\n *\n * @param entity\n * @returns\n */\nexport function isDbxFirebaseModelEntityWithStore<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>>(entity: DbxFirebaseModelEntity): entity is DbxFirebaseModelEntityWithStore<T, D> {\n return entity.modelIdentity != null && entity.store != null;\n}\n\n/**\n * An entity that has a key.\n */\nexport interface DbxFirebaseModelEntityWithKey extends DbxFirebaseModelEntity {\n /**\n * The key of the target document.\n */\n readonly key: ModelKey;\n}\n\n/**\n * An entity that has a key and a store.\n */\nexport interface DbxFirebaseModelEntityWithKeyAndStore<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends Omit<DbxFirebaseModelEntityWithKey, 'store'>, DbxFirebaseModelEntityWithStore<T, D> {}\n","import { inject, Injectable, Type } from '@angular/core';\nimport { ArrayOrValue, Maybe, cachedGetter, filterMaybeArrayValues, mapIterable, useIterableOrValue } from '@dereekb/util';\nimport { FirestoreModelIdentity } from '@dereekb/firebase';\n\nexport interface DbxFirebaseModelEntitiesWidgetEntry {\n /**\n * Widget type to respond to.\n */\n readonly identity: FirestoreModelIdentity;\n /**\n * The priority to use when sorting the entities.\n *\n * Higher values are displayed first in the list.\n */\n readonly sortPriority?: Maybe<number>;\n /**\n * Widget component that is specific to this entity.\n */\n readonly entityComponentClass?: Maybe<Type<unknown>>;\n /**\n * Overrides the \"common\" widget component used for all entities.\n */\n readonly commonComponentClass?: Maybe<Type<unknown>>;\n /**\n * Optional widget component that is specific to this entity that provides additional debug information, and is displayed after the common widget.\n */\n readonly debugComponentClass?: Maybe<Type<unknown>>;\n}\n\n/**\n * Configuration provided in the root module for configuring entries.\n */\nexport abstract class DbxFirebaseModelEntitiesWidgetServiceConfig {\n /**\n * Entries to register.\n */\n abstract entries: DbxFirebaseModelEntitiesWidgetEntry[];\n /**\n * The default \"common\" widget component used for all entities.\n */\n abstract commonComponentClass?: Maybe<Type<unknown>>;\n /**\n * The default \"debug\" widget component used for all entities.\n */\n abstract debugComponentClass?: Maybe<Type<unknown>>;\n}\n\n/**\n * Service used to register widgets used for model entities.\n */\n@Injectable()\nexport class DbxFirebaseModelEntitiesWidgetService {\n private _commonComponentClass: Maybe<Type<unknown>>;\n private _debugComponentClass: Maybe<Type<unknown>>;\n\n private readonly _entries = new Map<FirestoreModelIdentity, DbxFirebaseModelEntitiesWidgetEntry>();\n\n private readonly _sortPriorityMap = cachedGetter(() => {\n return new Map<FirestoreModelIdentity, number>(mapIterable(this._entries.values(), (entry) => [entry.identity, entry.sortPriority ?? -1]));\n });\n\n constructor() {\n const initialConfig = inject(DbxFirebaseModelEntitiesWidgetServiceConfig, { optional: true });\n this._commonComponentClass = initialConfig?.commonComponentClass;\n this._debugComponentClass = initialConfig?.debugComponentClass;\n\n if (initialConfig?.entries) {\n this.register(initialConfig.entries);\n }\n }\n\n getCommonComponentClass(): Maybe<Type<unknown>> {\n return this._commonComponentClass;\n }\n\n setCommonComponentClass(componentClass: Maybe<Type<unknown>>): void {\n this._commonComponentClass = componentClass;\n }\n\n getDebugComponentClass(): Maybe<Type<unknown>> {\n return this._debugComponentClass;\n }\n\n setDebugComponentClass(componentClass: Maybe<Type<unknown>>): void {\n this._debugComponentClass = componentClass;\n }\n\n /**\n * Used to register one or more entries.\n *\n * If an entry with the same identity is already registered, this will override it by default.\n *\n * @param entries The entries to register\n * @param override Whether to override existing entries (default: true)\n */\n register(entries: ArrayOrValue<DbxFirebaseModelEntitiesWidgetEntry>, override: boolean = true): void {\n useIterableOrValue(entries, (entry) => {\n if (override || !this._entries.has(entry.identity)) {\n this._entries.set(entry.identity, entry);\n }\n });\n\n // Invalidate the cache\n this._sortPriorityMap.reset();\n }\n\n // MARK: Get\n getAllRegisteredWidgetIdentities(): FirestoreModelIdentity[] {\n return Array.from(this._entries.keys());\n }\n\n getWidgetEntry(identity: FirestoreModelIdentity): DbxFirebaseModelEntitiesWidgetEntry {\n const entry = this._entries.get(identity);\n\n return entry\n ? {\n ...entry,\n commonComponentClass: entry.commonComponentClass ?? this._commonComponentClass,\n debugComponentClass: entry.debugComponentClass ?? this._debugComponentClass\n }\n : {\n identity,\n commonComponentClass: this._commonComponentClass,\n debugComponentClass: this._debugComponentClass\n };\n }\n\n getWidgetEntries(identities: Iterable<FirestoreModelIdentity>): DbxFirebaseModelEntitiesWidgetEntry[] {\n return filterMaybeArrayValues(mapIterable(identities ?? [], (x) => this.getWidgetEntry(x)));\n }\n\n getSortPriorityMap() {\n return this._sortPriorityMap();\n }\n}\n","import { InjectionToken, type Injector, type StaticProvider } from '@angular/core';\nimport { type DbxFirebaseModelEntityWithStore } from './model.entities';\nimport { type DbxFirebaseModelEntitiesWidgetEntry } from './model.entities.widget.service';\nimport { type DbxInjectionComponentConfig } from '@dereekb/dbx-core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Injection token for providing DbxFirebaseModelEntityWithStore context to dynamically loaded widgets.\n */\nexport const DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN = new InjectionToken<DbxFirebaseModelEntityWithStore<any, any>>('DbxFirebaseModelEntityWithStore');\n\n/**\n * Contains the DbxInjectionComponentConfig for the different injected components a DbxFirebaseModelEntity\n */\nexport interface DbxFirebaseModelEntitiesWidgetInjectionConfig {\n readonly entry: DbxFirebaseModelEntitiesWidgetEntry;\n readonly entity: DbxFirebaseModelEntityWithStore;\n readonly entityComponentConfig?: Maybe<DbxInjectionComponentConfig<unknown>>;\n readonly commonComponentConfig?: Maybe<DbxInjectionComponentConfig<unknown>>;\n readonly debugComponentConfig?: Maybe<DbxInjectionComponentConfig<unknown>>;\n}\n\n/**\n * Factory function used to create a DbxFirebaseModelEntitiesWidgetInjectionConfig given the input.\n */\nexport type DbxFirebaseModelEntitiesWidgetInjectionConfigFactory = (entry: DbxFirebaseModelEntitiesWidgetEntry, entity: DbxFirebaseModelEntityWithStore) => DbxFirebaseModelEntitiesWidgetInjectionConfig;\n\n/**\n * Creates a DbxFirebaseModelEntitiesWidgetInjectionConfigFactory.\n *\n * @param injector Optional injector to use for the components.\n * @returns\n */\nexport function dbxFirebaseModelEntityWidgetInjectionConfigFactory(injector?: Maybe<Injector>): DbxFirebaseModelEntitiesWidgetInjectionConfigFactory {\n return (entry: DbxFirebaseModelEntitiesWidgetEntry, entity: DbxFirebaseModelEntityWithStore): DbxFirebaseModelEntitiesWidgetInjectionConfig => {\n const providers: StaticProvider[] = [\n {\n provide: DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN,\n useValue: entity\n }\n ];\n\n let entityComponentConfig: Maybe<DbxInjectionComponentConfig<unknown>> = undefined;\n let commonComponentConfig: Maybe<DbxInjectionComponentConfig<unknown>> = undefined;\n let debugComponentConfig: Maybe<DbxInjectionComponentConfig<unknown>> = undefined;\n\n if (entry.entityComponentClass) {\n entityComponentConfig = {\n componentClass: entry.entityComponentClass,\n injector,\n providers\n };\n }\n\n if (entry.commonComponentClass) {\n commonComponentConfig = {\n componentClass: entry.commonComponentClass,\n providers\n };\n }\n\n if (entry.debugComponentClass) {\n debugComponentConfig = {\n componentClass: entry.debugComponentClass,\n providers\n };\n }\n\n return {\n entry,\n entity,\n entityComponentConfig,\n commonComponentConfig,\n debugComponentConfig\n };\n };\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { DbxFirebaseModelEntity, DbxFirebaseModelEntityWithStore, isDbxFirebaseModelEntityWithStore } from './model.entities';\nimport { cleanLoadingContext, DbxInjectionComponent } from '@dereekb/dbx-core';\nimport { MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle, MatExpansionPanelContent } from '@angular/material/expansion';\nimport { MatIcon } from '@angular/material/icon';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, distinctUntilChanged, map, Observable, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { DbxFirebaseModelEntitiesWidgetService } from './model.entities.widget.service';\nimport { DbxFirebaseModelTypesService, type DbxFirebaseModelDisplayInfo, type DbxFirebaseModelTypeInfo } from '../model.types.service';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxLoadingComponent } from '@dereekb/dbx-web';\nimport { dbxFirebaseModelEntityWidgetInjectionConfigFactory } from './model.entities.widget';\n\n@Component({\n selector: 'dbx-firebase-model-entities-entity',\n templateUrl: './model.entities.entity.component.html',\n imports: [DbxInjectionComponent, DbxLoadingComponent, MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle, MatExpansionPanelContent, MatIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelEntitiesEntityComponent {\n readonly widgetInjectionConfigFactory = dbxFirebaseModelEntityWidgetInjectionConfigFactory();\n\n readonly entitiesWidgetService = inject(DbxFirebaseModelEntitiesWidgetService);\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly entity = input.required<DbxFirebaseModelEntity>();\n\n readonly entity$ = toObservable(this.entity);\n\n readonly currentEntityWithStore$ = this.entity$.pipe(\n map((x) => {\n let result: Maybe<DbxFirebaseModelEntityWithStore>;\n\n if (isDbxFirebaseModelEntityWithStore(x)) {\n result = x;\n } else {\n result = null;\n }\n\n return result;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly modelIdentity$ = this.entity$.pipe(\n map((x) => x.modelIdentity),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly store$ = this.entity$.pipe(\n map((x) => x.store),\n filterMaybe(),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly storeName$ = this.store$.pipe(\n switchMap((x) => x.storeName$),\n shareReplay(1)\n );\n\n readonly displayName$ = combineLatest([this.storeName$, this.entity$]).pipe(\n map(([storeName, entity]) => entity.name ?? storeName),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly loadingState$ = this.store$.pipe(switchMap((x) => x.dataLoadingState$));\n readonly currentData$ = this.store$.pipe(\n switchMap((x) => x.currentData$),\n shareReplay(1)\n );\n\n readonly currentWidgetEntry$ = this.modelIdentity$.pipe(\n map((modelIdentity) => this.entitiesWidgetService.getWidgetEntry(modelIdentity)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentTypeInfo$: Observable<Maybe<DbxFirebaseModelTypeInfo>> = this.modelIdentity$.pipe(\n switchMap((modelIdentity) => this.dbxFirebaseModelTypesService.currentInfoForType(modelIdentity.modelType)),\n shareReplay(1)\n );\n\n readonly hasTypeInfo$ = this.currentTypeInfo$.pipe(\n map((x) => !!x),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly displayInfo$: Observable<DbxFirebaseModelDisplayInfo> = combineLatest([this.modelIdentity$, this.currentTypeInfo$, this.currentData$]).pipe(\n map(([modelIdentity, typeInfo, currentData]) => {\n let result: DbxFirebaseModelDisplayInfo;\n\n if (typeInfo) {\n if (currentData) {\n result = typeInfo.displayInfoFactory(currentData);\n\n if (!result.title) {\n result = { ...result, title: `No Name - <${modelIdentity.modelType}>` };\n }\n } else {\n result = { icon: typeInfo.icon, title: `No Data - <${modelIdentity.modelType}>` };\n }\n } else {\n result = { icon: 'warning', title: `No Type Info - <${modelIdentity.modelType}>` };\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n readonly widgetInjectionConfig$ = combineLatest([this.currentWidgetEntry$, this.currentEntityWithStore$]).pipe(\n map(([entry, entity]) => (entity ? this.widgetInjectionConfigFactory(entry, entity) : null)),\n shareReplay(1)\n );\n\n readonly hasTypeInfoSignal = toSignal(this.hasTypeInfo$);\n readonly displayNameSignal = toSignal(this.displayName$);\n readonly displayInfoSignal = toSignal(this.displayInfo$);\n readonly modelIdentitySignal = toSignal(this.modelIdentity$);\n readonly modelTypeSignal = computed(() => this.modelIdentitySignal()?.modelType);\n\n readonly widgetInjectionConfigSignal = toSignal(this.widgetInjectionConfig$);\n\n readonly entityWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.entityComponentConfig);\n readonly commonWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.commonComponentConfig);\n readonly debugWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.debugComponentConfig);\n\n readonly loadingContext = cleanLoadingContext({ obs: this.loadingState$ });\n}\n","<mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n @if (displayInfoSignal(); as displayInfo) {\n <div class=\"dbx-list-two-line-item\">\n <div class=\"item-left\">\n <span class=\"dbx-pb2 dbx-flex-bar\">\n @if (displayInfo.icon) {\n <mat-icon class=\"dbx-button-spacer\">{{ displayInfo.icon }}</mat-icon>\n }\n <span>{{ displayInfo.title }}</span>\n </span>\n <span>\n <span class=\"dbx-hint dbx-small\">{{ modelTypeSignal() }}</span>\n @if (displayNameSignal(); as displayName) {\n <span class=\"dbx-small dbx-u dbx-pl2\">{{ displayName }}</span>\n }\n </span>\n </div>\n </div>\n }\n </mat-panel-title>\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"dbx-firebase-model-entities-entity-panel-content\">\n <dbx-loading [context]=\"loadingContext\">\n @if (entityWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-entity-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n @if (commonWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-common-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n @if (debugWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-debug-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n </dbx-loading>\n </div>\n </ng-template>\n</mat-expansion-panel>\n","import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { DbxFirebaseModelEntity, DbxFirebaseModelEntityWithKeyAndStore, DbxFirebaseModelEntityWithStore } from './model.entities';\nimport { MatAccordion } from '@angular/material/expansion';\nimport { DbxIconButtonComponent, DbxListEmptyContentComponent, DbxLoadingComponent } from '@dereekb/dbx-web';\nimport { DbxFirebaseModelEntitiesEntityComponent } from './model.entities.entity.component';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, combineLatestWith, defaultIfEmpty, distinctUntilChanged, map, Observable, shareReplay, switchMap } from 'rxjs';\nimport { filterUniqueValues, Maybe, reverseCompareFn, separateValues, sortByNumberFunction } from '@dereekb/util';\nimport { beginLoading, filterMaybeArray, LoadingState, mapLoadingStateValueWithOperator, switchMapMaybe, valueFromFinishedLoadingState } from '@dereekb/rxjs';\nimport { DbxFirebaseModelEntitiesWidgetService } from './model.entities.widget.service';\nimport { cleanLoadingContext } from '@dereekb/dbx-core';\n\ninterface DbxFirebaseModelEntitiesComponentAllEntities {\n readonly entities: DbxFirebaseModelEntityWithKeyAndStore[];\n readonly registeredEntities: DbxFirebaseModelEntityWithKeyAndStore[];\n readonly unregisteredEntities: DbxFirebaseModelEntityWithKeyAndStore[];\n readonly onlyShowRegisteredTypes?: Maybe<boolean>;\n}\n\n@Component({\n selector: 'dbx-firebase-model-entities',\n template: `\n <dbx-loading [linear]=\"true\" [context]=\"context\">\n <mat-accordion class=\"dbx-firebase-model-entities-accordion\" [multi]=\"multi()\">\n @for (entity of entitiesWithKeysSignal(); track entity.key) {\n <dbx-firebase-model-entities-entity [entity]=\"entity\"></dbx-firebase-model-entities-entity>\n }\n </mat-accordion>\n @if (hasNoEntitiesSignal()) {\n <dbx-list-empty-content>\n <ng-content select=\"[empty]\"></ng-content>\n </dbx-list-empty-content>\n }\n @if (showViewUnregisteredEntitiesButtonSignal()) {\n <div class=\"dbx-pt3 text-center\">\n <dbx-icon-button icon=\"visibility\" [text]=\"'View ' + unregisteredEntitiesCountSignal() + ' Hidden Entities'\" (buttonClick)=\"clickShowUnregisteredEntities()\"></dbx-icon-button>\n </div>\n }\n </dbx-loading>\n `,\n imports: [MatAccordion, DbxLoadingComponent, DbxFirebaseModelEntitiesEntityComponent, DbxListEmptyContentComponent, DbxIconButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelEntitiesComponent {\n readonly entitiesWidgetService = inject(DbxFirebaseModelEntitiesWidgetService);\n\n /**\n * Whether the accordion should allow multiple expanded panels.\n */\n readonly multi = input<boolean>(true);\n\n /**\n * If true, will only show entities that have a registered widget entry.\n *\n * Defaults to true.\n */\n readonly onlyShowRegisteredTypes = input<Maybe<boolean>>(true);\n\n /**\n * If true, will show unregistered entities, even if onlyShowRegisteredTypes is true.\n */\n readonly showUnregisteredTypesSignal = signal<Maybe<boolean>>(undefined);\n\n readonly onlyShowRegisteredTypesSignal = computed(() => {\n const onlyShowRegisteredTypes = this.onlyShowRegisteredTypes();\n const showUnregisteredTypes = this.showUnregisteredTypesSignal();\n\n return !showUnregisteredTypes && onlyShowRegisteredTypes;\n });\n\n readonly onlyShowRegisteredTypes$ = toObservable(this.onlyShowRegisteredTypesSignal).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly entities = input<Observable<LoadingState<DbxFirebaseModelEntity[]>>>();\n readonly entities$: Observable<LoadingState<DbxFirebaseModelEntity[]>> = toObservable(this.entities).pipe(\n switchMapMaybe(),\n map((x) => x ?? beginLoading<DbxFirebaseModelEntity[]>()),\n shareReplay(1)\n );\n\n readonly allEntitiesState$: Observable<LoadingState<DbxFirebaseModelEntitiesComponentAllEntities>> = this.entities$.pipe(\n mapLoadingStateValueWithOperator(\n switchMap((entities) => {\n const sortPriorityMap = this.entitiesWidgetService.getSortPriorityMap();\n const entitiesWithStore = (entities ?? []).filter((x) => Boolean(x.store)) as DbxFirebaseModelEntityWithStore[];\n\n interface DbxFirebaseModelEntityWithKeyAndStoreAndSortPriority extends DbxFirebaseModelEntityWithKeyAndStore {\n readonly sortPriority: number;\n readonly isRegisteredType: boolean;\n }\n\n const entitiesWithKeys: Observable<Maybe<DbxFirebaseModelEntityWithKeyAndStoreAndSortPriority>[]> = combineLatest(\n entitiesWithStore.map((x) => {\n const sortPriorityMapEntry = sortPriorityMap.get(x.modelIdentity);\n const isRegisteredType = sortPriorityMapEntry != null;\n const sortPriority = sortPriorityMapEntry ?? -2;\n\n const obs: Observable<Maybe<DbxFirebaseModelEntityWithKeyAndStoreAndSortPriority>> = x.store.currentKey$.pipe(map((key) => (key ? { key, ...x, sortPriority, isRegisteredType } : null)));\n return obs;\n })\n );\n\n return entitiesWithKeys.pipe(\n filterMaybeArray(),\n defaultIfEmpty([]),\n combineLatestWith(this.onlyShowRegisteredTypes$),\n map(([entities, onlyShowRegisteredTypes]) => {\n const filteredEntities = filterUniqueValues(entities, (x) => x.key).sort(reverseCompareFn(sortByNumberFunction((x) => x.sortPriority)));\n\n const { included: registeredEntities, excluded: unregisteredEntities } = separateValues(filteredEntities, (x) => x.isRegisteredType);\n\n const result: DbxFirebaseModelEntitiesComponentAllEntities = {\n entities: onlyShowRegisteredTypes ? registeredEntities : filteredEntities,\n onlyShowRegisteredTypes,\n registeredEntities,\n unregisteredEntities\n };\n\n return result;\n })\n );\n })\n ),\n shareReplay(1)\n );\n\n readonly allEntities$ = this.allEntitiesState$.pipe(valueFromFinishedLoadingState(), shareReplay(1));\n readonly allEntitiesSignal = toSignal(this.allEntities$, { initialValue: { entities: [], registeredEntities: [], unregisteredEntities: [], onlyShowRegisteredTypes: false } });\n\n readonly entitiesWithKeysSignal = computed(() => this.allEntitiesSignal()?.entities);\n readonly unregisteredEntitiesCountSignal = computed(() => this.allEntitiesSignal()?.unregisteredEntities?.length ?? 0);\n\n readonly showViewUnregisteredEntitiesButtonSignal = computed(() => {\n const { onlyShowRegisteredTypes, unregisteredEntities } = this.allEntitiesSignal() ?? {};\n return onlyShowRegisteredTypes && Boolean(unregisteredEntities?.length);\n });\n\n readonly hasNoEntitiesSignal = computed(() => !this.entitiesWithKeysSignal()?.length);\n\n readonly context = cleanLoadingContext({ obs: this.allEntitiesState$ });\n\n clickShowUnregisteredEntities() {\n this.showUnregisteredTypesSignal.set(true);\n }\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, Injector } from '@angular/core';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { AbstractPopoverDirective, DbxPopoverConfigSizing, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverKey, DbxPopoverScrollContentDirective, DbxPopoverService } from '@dereekb/dbx-web';\nimport { DbxFirebaseModelEntitiesComponent } from './model.entities.component';\nimport { Observable } from 'rxjs';\nimport { LoadingState } from '@dereekb/rxjs';\nimport { DbxFirebaseModelEntity } from './model.entities';\nimport { Maybe } from '@dereekb/util';\n\nexport interface DbxFirebaseModelEntitiesPopoverConfig {\n /**\n * Custom icon\n *\n * Defaults to \"history\"\n */\n readonly icon?: string;\n\n /**\n * Custom header text\n *\n * Defaults to \"Entities\"\n */\n readonly header?: string;\n\n /**\n * Custom empty text when no entities exist.\n */\n readonly emptyText?: string;\n\n /**\n * Origin to add the popover to.\n */\n readonly origin: ElementRef;\n\n /**\n * Observable of entities to display.\n */\n readonly entities$: Observable<LoadingState<DbxFirebaseModelEntity[]>>;\n\n /**\n * Whether or not to only show entities that have a registered widget entry.\n */\n readonly onlyShowRegisteredTypes?: Maybe<boolean>;\n\n /**\n * Additional popover configuration.\n */\n readonly popoverSizingConfig?: Maybe<DbxPopoverConfigSizing>;\n\n /**\n * Injector to use for the popover.\n */\n readonly injector?: Maybe<Injector>;\n}\n\nexport type DbxFirebaseModelEntitiesPopoverConfigWithoutOrigin = Omit<DbxFirebaseModelEntitiesPopoverConfig, 'origin' | 'entities$'>;\n\nexport const DEFAULT_DBX_FIREBASE_MODEL_ENTITIES_COMPONENT_POPOVER_KEY = 'entities';\n\n@Component({\n templateUrl: './model.entities.popover.component.html',\n imports: [DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxFirebaseModelEntitiesComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelEntitiesPopoverComponent extends AbstractPopoverDirective<unknown, DbxFirebaseModelEntitiesPopoverConfig> {\n readonly entities$ = this.popover.data?.entities$;\n\n static openPopover(popupService: DbxPopoverService, config: DbxFirebaseModelEntitiesPopoverConfig, popoverKey?: DbxPopoverKey): NgPopoverRef {\n const { origin, header, icon, emptyText, entities$, onlyShowRegisteredTypes, popoverSizingConfig, injector } = config;\n\n return popupService.open({\n height: '600px',\n width: '800px',\n injector: injector ?? undefined,\n isResizable: true,\n ...popoverSizingConfig,\n key: popoverKey ?? DEFAULT_DBX_FIREBASE_MODEL_ENTITIES_COMPONENT_POPOVER_KEY,\n origin,\n componentClass: DbxFirebaseModelEntitiesPopoverComponent,\n data: {\n header,\n icon,\n emptyText,\n entities$,\n onlyShowRegisteredTypes\n }\n });\n }\n\n get config(): DbxFirebaseModelEntitiesPopoverConfig {\n return this.popover.data as DbxFirebaseModelEntitiesPopoverConfig;\n }\n\n readonly icon = this.config.icon ?? 'data_object';\n readonly header = this.config.header ?? 'Entities';\n readonly emptyText = this.config.emptyText ?? 'No entities found in current context.';\n readonly onlyShowRegisteredTypes = this.config.onlyShowRegisteredTypes;\n}\n","<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-model-entities [entities]=\"entities$\" [onlyShowRegisteredTypes]=\"onlyShowRegisteredTypes\">\n <p empty>{{ emptyText }}</p>\n </dbx-firebase-model-entities>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n","import { ChangeDetectionStrategy, Component, computed, ElementRef, inject, input, viewChild } from '@angular/core';\nimport { AbstractPopoverRefDirective, DbxButtonComponent, DbxButtonStyle, DbxPopoverService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseModelEntitiesPopoverComponent, DbxFirebaseModelEntitiesPopoverConfigWithoutOrigin } from './model.entities.popover.component';\nimport { Maybe } from '@dereekb/util';\nimport { DbxFirebaseModelEntitiesSource } from './model.entities';\nimport { DbxButtonDisplay } from '@dereekb/dbx-core';\n\nexport interface DbxFirebaseModelEntitiesPopoverButtonConfig extends DbxFirebaseModelEntitiesPopoverConfigWithoutOrigin {\n /**\n * The display configuration for the button.\n */\n readonly buttonDisplay?: Maybe<DbxButtonDisplay>;\n /**\n * The style configuration for the button.\n */\n readonly buttonStyle?: Maybe<DbxButtonStyle>;\n}\n\n@Component({\n selector: 'dbx-firebase-model-entities-popover-button',\n template: `\n <dbx-button #button (buttonClick)=\"showEntitiesPopover()\" [buttonStyle]=\"buttonStyleSignal()\" [buttonDisplay]=\"buttonDisplaySignal()\"></dbx-button>\n `,\n standalone: true,\n imports: [DbxButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseModelEntitiesPopoverButtonComponent extends AbstractPopoverRefDirective<unknown, unknown> {\n private readonly _dbxPopoverService = inject(DbxPopoverService);\n\n readonly entitiesSource = inject(DbxFirebaseModelEntitiesSource);\n\n readonly buttonElement = viewChild.required<string, ElementRef>('button', { read: ElementRef });\n readonly config = input<DbxFirebaseModelEntitiesPopoverButtonConfig>();\n\n readonly buttonDisplaySignal = computed(() => {\n const config = this.config();\n return config?.buttonDisplay ?? { icon: config?.icon ?? 'data_object' };\n });\n\n readonly buttonStyleSignal = computed(() => this.config()?.buttonStyle);\n\n protected override _makePopoverRef(origin?: Maybe<ElementRef>): NgPopoverRef<unknown, unknown> {\n if (!origin) {\n throw new Error('Missing origin.');\n }\n\n const config = this.config();\n const entities$ = this.entitiesSource.entities$;\n\n return DbxFirebaseModelEntitiesPopoverComponent.openPopover(this._dbxPopoverService, {\n origin,\n ...config,\n entities$\n });\n }\n\n showEntitiesPopover(): void {\n const origin = this.buttonElement();\n this.showPopover(origin);\n }\n}\n","import { type EnvironmentProviders, type Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxFirebaseModelEntitiesWidgetService, DbxFirebaseModelEntitiesWidgetServiceConfig } from './model.entities.widget.service';\n\n/**\n * Factory for DbxFirebaseModelEntitiesWidgetServiceConfig.\n */\nexport type DbxFirebaseModelEntitiesWidgetServiceConfigFactory = (injector: Injector) => DbxFirebaseModelEntitiesWidgetServiceConfig;\n\n/**\n * Configuration for provideDbxFirebaseModelEntitiesWidgetService().\n */\nexport interface ProvideDbxFirebaseModelEntitiesWidgetServiceConfig {\n /**\n * Factory for DbxFirebaseModelEntitiesWidgetServiceConfig.\n */\n readonly dbxFirebaseModelEntitiesWidgetServiceConfigFactory: DbxFirebaseModelEntitiesWidgetServiceConfigFactory;\n}\n\n/**\n * Creates EnvironmentProviders for DbxFirebaseModelEntitiesWidgetService.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseModelEntitiesWidgetService(config: ProvideDbxFirebaseModelEntitiesWidgetServiceConfig): EnvironmentProviders {\n const { dbxFirebaseModelEntitiesWidgetServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseModelEntitiesWidgetServiceConfig,\n useFactory: dbxFirebaseModelEntitiesWidgetServiceConfigFactory\n },\n DbxFirebaseModelEntitiesWidgetService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { FirestoreModelIdentity } from '@dereekb/firebase';\nimport { Configurable, Maybe, separateValues, sortByNumberFunction } from '@dereekb/util';\nimport { combineLatest, distinctUntilChanged, first, map, Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { isSameDate } from '@dereekb/date';\nimport { DbxFirebaseDocumentStore } from './store';\n/**\n * A unique number for a store entry.\n */\nexport type DbxFirebaseDocumentStoreContextStoreEntryNumber = number;\n\n/**\n * A specifiy entry in the store.\n *\n * Used for caching information about a specific store.\n */\nexport interface DbxFirebaseDocumentStoreContextStoreEntry {\n /**\n * The number the entry was assigned when added to the store.\n */\n readonly entryNumber: DbxFirebaseDocumentStoreContextStoreEntryNumber;\n /**\n * The referenced document store.\n */\n readonly store: DbxFirebaseDocumentStore<unknown>;\n\n // Cached Values\n readonly modelIdentity?: Maybe<FirestoreModelIdentity>;\n}\n\nexport interface DbxFirebaseDocumentStoreContextStoreEntryWithIdentity extends Omit<DbxFirebaseDocumentStoreContextStoreEntry, 'modelIdentity'> {\n readonly modelIdentity: FirestoreModelIdentity;\n}\n\nexport interface DbxFirebaseDocumentStoreContextStoreState {\n /**\n * The next entry number to use for a new store.\n */\n readonly nextEntryNumber: DbxFirebaseDocumentStoreContextStoreEntryNumber;\n /**\n * The current number of entries\n */\n readonly currentEntryCount: number;\n /**\n * The map of all current stores.\n *\n * The map uses the store as the key for it's corresponding entry that contains additional information about the store.\n */\n readonly stores: Map<DbxFirebaseDocumentStore<unknown>, DbxFirebaseDocumentStoreContextStoreEntry>;\n /**\n * The last time the stores map was changed.\n */\n readonly lastStoresChangeAt: Date;\n}\n\n@Injectable()\nexport class DbxFirebaseDocumentStoreContextStore extends ComponentStore<DbxFirebaseDocumentStoreContextStoreState> {\n constructor() {\n super({\n nextEntryNumber: 0,\n currentEntryCount: 0,\n stores: new Map(),\n lastStoresChangeAt: new Date()\n });\n }\n\n // MARK: Accessors\n readonly stores$ = this.select((state) => [state.stores, state.currentEntryCount, state.nextEntryNumber] as const, {\n debounce: true, // NOTE: The addStore/removeStore functions use the same map, so we overload the equal function to properly trigger changes to the map.\n equal: (a, b) => a[1] === b[1] && a[2] === b[2] // only considered different if the nextEntryNumber changes\n }).pipe(\n map((x) => x[0]),\n shareReplay(1)\n );\n\n readonly lastStoresChangeAt$ = this.select((state) => state.lastStoresChangeAt).pipe(distinctUntilChanged(isSameDate), shareReplay(1));\n\n readonly entriesGroupedByIdentity$: Observable<DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]> = this.stores$.pipe(\n switchMap((stores) => {\n let entriesObs: Observable<DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]>;\n\n const allEntries = Array.from(stores.values());\n\n const { included: hasIdentity, excluded: noIdentity } = separateValues(allEntries, (x) => x.modelIdentity != null);\n\n if (noIdentity.length > 0) {\n entriesObs = combineLatest(\n noIdentity.map((entryWithoutCachedIdentity) =>\n entryWithoutCachedIdentity.store.modelIdentity$.pipe(\n first(),\n map((z) => {\n // set the model identity on the entry\n (entryWithoutCachedIdentity as Configurable<DbxFirebaseDocumentStoreContextStoreEntryWithIdentity>).modelIdentity = z;\n // return the entry\n return entryWithoutCachedIdentity;\n })\n )\n )\n ).pipe(\n map(() => {\n return allEntries as DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]; // all the entries should have an identity now\n })\n );\n } else {\n entriesObs = of(hasIdentity as DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]);\n }\n\n return entriesObs;\n }),\n map((x) => {\n // sort in ascending order by entry number\n x.sort(sortByNumberFunction((x) => x.entryNumber));\n\n return x;\n }),\n shareReplay(1)\n );\n\n // MARK: State Changes\n readonly addStore = this.updater(addStore);\n readonly removeStore = this.updater(removeStore);\n}\n\nfunction addStore(state: DbxFirebaseDocumentStoreContextStoreState, store: DbxFirebaseDocumentStore<unknown>) {\n const { stores, nextEntryNumber } = state;\n\n let nextState: DbxFirebaseDocumentStoreContextStoreState;\n\n if (stores.has(store)) {\n nextState = state;\n } else {\n // add the entry\n const entry: Configurable<DbxFirebaseDocumentStoreContextStoreEntry> = {\n store,\n entryNumber: nextEntryNumber\n };\n\n stores.set(store, entry);\n\n // update the last changed date\n nextState = { ...state, currentEntryCount: state.currentEntryCount + 1, lastStoresChangeAt: new Date(), nextEntryNumber: nextEntryNumber + 1 };\n }\n\n return nextState;\n}\n\nfunction removeStore(state: DbxFirebaseDocumentStoreContextStoreState, store: DbxFirebaseDocumentStore<unknown>) {\n const { stores } = state;\n\n let nextState: DbxFirebaseDocumentStoreContextStoreState;\n\n if (!stores.has(store)) {\n nextState = state;\n } else {\n // remove the entry\n stores.delete(store);\n\n // update the last changed date\n nextState = { ...state, currentEntryCount: state.currentEntryCount - 1, lastStoresChangeAt: new Date() };\n }\n\n return nextState;\n}\n","import { Directive } from '@angular/core';\nimport { DbxFirebaseModelEntitiesSource, DbxFirebaseModelEntity } from './model.entities';\nimport { DbxFirebaseDocumentStoreContextStore } from '../../store/store.document.context.store';\nimport { map, Observable } from 'rxjs';\nimport { loadingStateFromObs } from '@dereekb/rxjs';\n\nexport const dbxFirebaseDocumentStoreContextModelEntitiesSourceFactory = (storeContextStore: DbxFirebaseDocumentStoreContextStore): DbxFirebaseModelEntitiesSource => {\n const entities$: Observable<DbxFirebaseModelEntity[]> = storeContextStore.entriesGroupedByIdentity$.pipe(map((entries) => entries.map((entry) => ({ store: entry.store, modelIdentity: entry.modelIdentity }))));\n\n const source: DbxFirebaseModelEntitiesSource = {\n entities$: loadingStateFromObs(entities$)\n };\n\n return source;\n};\n\n@Directive({\n selector: '[dbxFirebaseDocumentStoreContextModelEntitiesSource]',\n providers: [\n {\n provide: DbxFirebaseModelEntitiesSource,\n useFactory: dbxFirebaseDocumentStoreContextModelEntitiesSourceFactory,\n deps: [DbxFirebaseDocumentStoreContextStore]\n }\n ],\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreContextModelEntitiesSourceDirective {}\n","import { Directive, inject } from '@angular/core';\nimport { DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN } from './model.entities.widget';\nimport { DbxFirebaseModelEntityWithStore } from './model.entities';\nimport { type FirestoreDocument } from '@dereekb/firebase';\n\n/**\n * An abstract DbxFirebase widget component that injects the entity data and provides some common accessors.\n */\n@Directive({})\nexport abstract class AbstractDbxFirebaseModelEntityWidgetDirective<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>> {\n readonly entityData: DbxFirebaseModelEntityWithStore<T, D> = inject(DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN);\n\n readonly store = this.entityData.store;\n readonly data$ = this.store.data$;\n}\n","import { Component, inject, input, computed } from '@angular/core';\nimport { FirestoreModelKey, twoWayFlatFirestoreModelKey, flatFirestoreModelKey, firestoreModelId } from '@dereekb/firebase';\nimport { DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceInstance } from './model.types.service';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { switchMap, of } from 'rxjs';\nimport { DbxDetailBlockComponent, DbxClickToCopyTextComponent, DbxAnchorComponent, DbxButtonComponent } from '@dereekb/dbx-web';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * An interactive display for a FirestoreModelKey.\n */\n@Component({\n selector: 'dbx-firebase-model-key',\n templateUrl: './model.key.component.html',\n standalone: true,\n imports: [DbxDetailBlockComponent, DbxButtonComponent, DbxClickToCopyTextComponent, DbxAnchorComponent]\n})\nexport class DbxFirebaseModelKeyComponent {\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly modelKey = input<FirestoreModelKey>();\n\n readonly modelKeyIdSignal = computed(() => {\n const modelKey = this.modelKey();\n return modelKey ? firestoreModelId(modelKey) : undefined;\n });\n\n readonly oneWayFlatModelKeySignal = computed(() => {\n const modelKey = this.modelKey();\n return modelKey ? flatFirestoreModelKey(modelKey) : undefined;\n });\n\n readonly twoWayFlatModelKeySignal = computed(() => {\n const modelKey = this.modelKey();\n return modelKey ? twoWayFlatFirestoreModelKey(modelKey) : undefined;\n });\n\n // Convert signal to observable for types service\n readonly modelKey$ = toObservable(this.modelKey);\n\n readonly modelTypeInstance$ = this.modelKey$.pipe(\n switchMap((key) => {\n let result: Maybe<DbxFirebaseModelTypesServiceInstance> = undefined;\n\n if (key) {\n result = this.dbxFirebaseModelTypesService.instanceForKey(key);\n }\n\n return of(result);\n })\n );\n\n readonly modelIdentity$ = this.modelTypeInstance$.pipe(switchMap((x) => x?.identity$ ?? of(undefined)));\n readonly typeInfo$ = this.modelTypeInstance$.pipe(switchMap((x) => x?.safeTypeInfo$ ?? of(undefined)));\n\n readonly modelTypeInstanceSignal = toSignal(this.modelTypeInstance$);\n readonly modelIdentitySignal = toSignal(this.modelIdentity$);\n readonly typeInfoSignal = toSignal(this.typeInfo$);\n\n readonly typeCanSegueToView = computed(() => this.typeInfoSignal()?.canSegueToView ?? false);\n\n readonly sref$ = this.modelTypeInstance$.pipe(switchMap((x) => x?.segueRef$ ?? of(undefined)));\n readonly srefSignal = toSignal(this.sref$);\n}\n","<div class=\"dbx-firebase-model-key\">\n @if (modelKey(); as key) {\n <!-- Key Data -->\n <dbx-detail-block icon=\"key\" header=\"Model Key\">\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ key }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ modelKeyIdSignal() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"oneWayFlatModelKeySignal()\">(Flat) {{ oneWayFlatModelKeySignal() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"twoWayFlatModelKeySignal()\">(Encoded Flat) {{ twoWayFlatModelKeySignal() }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n\n <!-- Type Info -->\n @if (typeInfoSignal(); as typeInfo) {\n <!-- Model Meta Data -->\n <div>\n <dbx-detail-block [icon]=\"typeInfo.icon\" header=\"Model Type\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.modelType }}</dbx-click-to-copy-text>\n @if (typeInfo.icon) {\n <dbx-click-to-copy-text [copyText]=\"typeInfo.icon\" class=\"dbx-block\">\n Icon:\n <span class=\"dbx-u\">{{ typeInfo.icon }}</span>\n </dbx-click-to-copy-text>\n } @else {\n <span class=\"dbx-notice\">No Icon For Type</span>\n }\n </dbx-detail-block>\n <dbx-detail-block icon=\"dataset\" header=\"Collection Name\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.identity.collectionName }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n </div>\n\n <!-- Segue Info -->\n @if (typeCanSegueToView()) {\n <dbx-detail-block icon=\"arrow_forward\" header=\"Segue To View\">\n <div class=\"dbx-hint dbx-small\">This model has a unique view within the app.</div>\n <dbx-anchor [anchor]=\"srefSignal()\"><dbx-button text=\"Go To View\"></dbx-button></dbx-anchor>\n </dbx-detail-block>\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Segue View\">\n <span>This type provides no information for segue directly.</span>\n </dbx-detail-block>\n }\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Type Info\">\n <span>There is no type info registered for this model type.</span>\n </dbx-detail-block>\n }\n } @else {\n <div class=\"dbx-firebase-model-key-empty\">No model key provided</div>\n }\n</div>\n","import { Component, computed, Signal } from '@angular/core';\nimport { AbstractDbxFirebaseModelEntityWidgetDirective } from './model.entities.widget.entity.abstract.directive';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { DbxFirebaseModelKeyComponent } from '../model.key.component';\nimport { DbxDownloadTextViewComponent, DbxLoadingComponent, DownloadTextContent } from '@dereekb/dbx-web';\nimport { Maybe } from '@dereekb/util';\nimport { twoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { cleanLoadingContext } from '@dereekb/dbx-core';\n\n/**\n * A debug widget component that displays entity data and metadata.\n */\n@Component({\n selector: 'dbx-firebase-model-entities-debug-widget',\n templateUrl: './model.entities.widget.entity.debug.component.html',\n standalone: true,\n imports: [DbxFirebaseModelKeyComponent, DbxDownloadTextViewComponent, DbxLoadingComponent]\n})\nexport class DbxFirebaseModelEntitiesDebugWidgetComponent extends AbstractDbxFirebaseModelEntityWidgetDirective {\n // Convert store observables to signals for template usage\n readonly currentKey = toSignal(this.store.currentKey$);\n readonly currentData = toSignal(this.data$);\n\n readonly contentSignal: Signal<Maybe<DownloadTextContent>> = computed(() => {\n const key = this.currentKey();\n const data = this.currentData();\n\n let content: Maybe<DownloadTextContent>;\n\n if (key && data) {\n const flattenKey = twoWayFlatFirestoreModelKey(key);\n\n content = {\n content: JSON.stringify(data, null, 2),\n name: `${flattenKey}.json`\n };\n }\n\n return content;\n });\n\n readonly context = cleanLoadingContext(this.store.dataLoadingState$);\n}\n","<div class=\"dbx-firebase-model-entities-debug-widget\">\n <!-- Model Key Section -->\n <div class=\"dbx-debug-section\">\n <h4>Model Key Information</h4>\n @if (currentKey(); as key) {\n <dbx-firebase-model-key [modelKey]=\"key\"></dbx-firebase-model-key>\n }\n </div>\n\n <!-- Document Data Section -->\n <div class=\"dbx-debug-section\">\n <h4>Document Data</h4>\n <dbx-loading [context]=\"context\">\n @if (currentData(); as data) {\n <dbx-download-text-view [showTitle]=\"false\" [content]=\"contentSignal()\"></dbx-download-text-view>\n } @else {\n <p class=\"dbx-empty\">No data available</p>\n }\n </dbx-loading>\n </div>\n</div>\n","import { Directive, forwardRef, model, Provider, Type } from '@angular/core';\nimport { DocumentReference, FirestoreAccessorStreamMode, FirestoreDocument, FirestoreModelKey, FirestoreModelId, TwoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { ModelKey, type Maybe } from '@dereekb/util';\nimport { DbxFirebaseDocumentStore } from './store';\nimport { BehaviorSubject, Observable, shareReplay, Subscription, switchMap } from 'rxjs';\nimport { filterMaybe, skipInitialMaybe } from '@dereekb/rxjs';\nimport { cleanSubscription, completeOnDestroy, DbxRouteModelIdDirectiveDelegate, DbxRouteModelKeyDirectiveDelegate, provideDbxRouteModelIdDirectiveDelegate, provideDbxRouteModelKeyDirectiveDelegate } from '@dereekb/dbx-core';\nimport { DbxFirebaseDocumentStoreTwoWayKeyProvider } from './store.document.twoway.key.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract directive that contains a DbxFirebaseDocumentStore and provides an interface for communicating with other directives.\n */\n@Directive()\nexport abstract class DbxFirebaseDocumentStoreDirective<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, S extends DbxFirebaseDocumentStore<T, D> = DbxFirebaseDocumentStore<T, D>> implements DbxFirebaseDocumentStoreTwoWayKeyProvider, DbxRouteModelIdDirectiveDelegate, DbxRouteModelKeyDirectiveDelegate {\n readonly storeName = model<Maybe<string>>(undefined);\n readonly documentId = model<Maybe<FirestoreModelId>>(undefined);\n readonly key = model<Maybe<FirestoreModelKey>>(undefined);\n readonly flatKey = model<Maybe<TwoWayFlatFirestoreModelKey>>(undefined);\n readonly ref = model<Maybe<DocumentReference<T>>>(undefined);\n readonly streamMode = model<FirestoreAccessorStreamMode>(FirestoreAccessorStreamMode.STREAM);\n\n private readonly _storeName$ = toObservable(this.storeName).pipe(skipInitialMaybe());\n private readonly _documentId$ = toObservable(this.documentId).pipe(skipInitialMaybe());\n private readonly _key$ = toObservable(this.key).pipe(skipInitialMaybe());\n private readonly _flatKey$ = toObservable(this.flatKey).pipe(skipInitialMaybe());\n private readonly _ref$ = toObservable(this.ref).pipe(skipInitialMaybe());\n private readonly _streamMode$ = toObservable(this.streamMode).pipe(skipInitialMaybe());\n\n private readonly _store = completeOnDestroy(new BehaviorSubject<Maybe<S>>(undefined));\n\n readonly store$ = this._store.pipe(filterMaybe(), shareReplay(1));\n\n readonly exists$ = this.store$.pipe(switchMap((x) => x.exists$));\n readonly document$ = this.store$.pipe(switchMap((x) => x.document$));\n readonly documentLoadingState$ = this.store$.pipe(switchMap((x) => x.documentLoadingState$));\n\n readonly id$ = this.store$.pipe(switchMap((x) => x.id$));\n readonly key$ = this.store$.pipe(switchMap((x) => x.key$));\n readonly twoWayFlatKey$ = this.store$.pipe(switchMap((x) => x.twoWayFlatKey$));\n readonly ref$ = this.store$.pipe(switchMap((x) => x.ref$));\n\n readonly snapshot$ = this.store$.pipe(switchMap((x) => x.snapshot$));\n readonly snapshotLoadingState$ = this.store$.pipe(switchMap((x) => x.snapshotLoadingState$));\n\n readonly modelIdentity$ = this.store$.pipe(switchMap((x) => x.modelIdentity$));\n readonly data$ = this.store$.pipe(switchMap((x) => x.data$));\n readonly loadingState$ = this.store$.pipe(switchMap((x) => x.dataLoadingState$));\n\n constructor(store: S) {\n this.replaceStore(store);\n\n // sync inputs to store any time the store changes\n cleanSubscription(\n this._store.subscribe((x) => {\n if (x) {\n x.setStoreName(this._storeName$);\n x.setId(this._documentId$);\n x.setKey(this._key$);\n x.setFlatKey(this._flatKey$);\n x.setRef(this._ref$);\n x.setStreamMode(this._streamMode$);\n }\n })\n );\n }\n\n get store() {\n return this._store.value as S;\n }\n\n // MARK: Setters\n setStoreName(storeName: Maybe<string>) {\n this.storeName.set(storeName);\n }\n\n setDocumentId(documentId: Maybe<FirestoreModelId>) {\n this.documentId.set(documentId);\n }\n\n setKey(key: Maybe<FirestoreModelKey>) {\n this.key.set(key);\n }\n\n setFlatKey(flatKey: Maybe<TwoWayFlatFirestoreModelKey>) {\n this.flatKey.set(flatKey);\n }\n\n setRef(ref: Maybe<DocumentReference<T>>) {\n this.ref.set(ref);\n }\n\n setStreamMode(streamMode: FirestoreAccessorStreamMode) {\n this.streamMode.set(streamMode);\n }\n\n /**\n * Replaces the internal store.\n */\n replaceStore(store: S) {\n this._store.next(store);\n }\n\n // MARK: DbxRouteModelIdDirectiveDelegate\n useRouteModelIdParamsObservable(idFromParams: Observable<Maybe<ModelKey>>): Subscription {\n return idFromParams.subscribe((x) => this.setDocumentId(x));\n }\n\n // MARK: DbxRouteModelKeyDirectiveDelegate\n useRouteModelKeyParamsObservable(keyFromParams: Observable<Maybe<TwoWayFlatFirestoreModelKey>>): Subscription {\n // we assume that the input model key is a TwoWayFlatFirestoreModelKey, since the TwoWayFlatFirestoreModelKey is safe to encode in the url\n return keyFromParams.subscribe((x) => this.setFlatKey(x));\n }\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// The use of any here does not degrade the type-safety; we want to simply match that the Store type S is used in the Directive type C to provide it.\n\n/**\n * Configures providers for a DbxFirebaseDocumentStoreDirective.\n *\n * Can optionally also provide the actual store type to include in the providers array so it is instantiated by Angular.\n *\n * @param sourceType\n */\nexport function provideDbxFirebaseDocumentStoreDirective<S extends DbxFirebaseDocumentStoreDirective<any, any, any>>(sourceType: Type<S>): Provider[];\nexport function provideDbxFirebaseDocumentStoreDirective<S extends DbxFirebaseDocumentStore<any, any>, C extends DbxFirebaseDocumentStoreDirective<any, any, S> = DbxFirebaseDocumentStoreDirective<any, any, S>>(sourceType: Type<C>, storeType: Type<S>): Provider[];\nexport function provideDbxFirebaseDocumentStoreDirective<S extends DbxFirebaseDocumentStore<any, any>, C extends DbxFirebaseDocumentStoreDirective<any, any, S> = DbxFirebaseDocumentStoreDirective<any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxFirebaseDocumentStoreDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideDbxRouteModelIdDirectiveDelegate(sourceType),\n ...provideDbxRouteModelKeyDirectiveDelegate(sourceType)\n ];\n\n if (storeType != null) {\n providers.push(storeType);\n }\n\n return providers;\n}\n","import { distinctUntilModelKeyChange } from '@dereekb/rxjs';\nimport { DbxModelObjectStateService, ModelViewContext } from '@dereekb/dbx-web';\nimport { Directive, inject, input } from '@angular/core';\nimport { cleanSubscription } from '@dereekb/dbx-core';\nimport { combineLatestWith, first, map, switchMap } from 'rxjs';\nimport { DbxFirebaseDocumentStoreDirective } from '../store/store.document.directive';\nimport { DbxFirebaseModelTypesService } from './model.types.service';\nimport { Maybe, ModelKeyTypeNamePair } from '@dereekb/util';\n\n/**\n * Used with a DbxFirebaseDocumentStoreDirective to emit model viewed events.\n */\n@Directive({\n selector: '[dbxFirebaseModelViewedEvent]',\n standalone: true\n})\nexport class DbxFirebaseModelViewedEventDirective {\n readonly dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective);\n readonly dbxModelObjectStateService = inject(DbxModelObjectStateService);\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly modelViewContext = input<Maybe<ModelViewContext>>(undefined, { alias: 'dbxFirebaseModelViewedEvent' });\n\n constructor() {\n cleanSubscription(\n this.dbxFirebaseDocumentStoreDirective.data$\n .pipe(\n //\n distinctUntilModelKeyChange(),\n combineLatestWith(\n this.dbxFirebaseDocumentStoreDirective.modelIdentity$.pipe(\n switchMap((x) => this.dbxFirebaseModelTypesService.infoForType(x.modelType)),\n first()\n ),\n this.dbxFirebaseDocumentStoreDirective.key$\n ),\n map(([data, typeInfo, key]) => {\n const displayInfo = this.dbxFirebaseModelTypesService.getDisplayInfo(typeInfo, data);\n\n const pair: ModelKeyTypeNamePair = {\n key,\n type: typeInfo.modelType,\n name: displayInfo.title\n };\n\n return pair;\n })\n )\n .subscribe((modelKeyTypeNamePair) => {\n const context = this.modelViewContext();\n this.dbxModelObjectStateService.emitModelViewEvent({ modelKeyTypeNamePair, context });\n })\n );\n }\n}\n","import { Directive, forwardRef, model, Provider, Type } from '@angular/core';\nimport { DocumentReference, FirestoreDocument, FirestoreModelKey, FirestoreQueryConstraint } from '@dereekb/firebase';\nimport { Maybe, ArrayOrValue } from '@dereekb/util';\nimport { DbxFirebaseCollectionStore } from './store.collection';\nimport { BehaviorSubject, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe, skipInitialMaybe } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscription, completeOnDestroy } from '@dereekb/dbx-core';\nimport { DbxFirebaseCollectionMode } from '../../loader/collection.loader.instance';\n\n/**\n * Abstract directive that contains a DbxFirebaseCollectionStore and provides an interface for communicating with other directives.\n */\n@Directive()\nexport abstract class DbxFirebaseCollectionStoreDirective<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, S extends DbxFirebaseCollectionStore<T, D> = DbxFirebaseCollectionStore<T, D>> {\n readonly collectionMode = model<DbxFirebaseCollectionMode>('query');\n readonly collectionKeys = model<Maybe<FirestoreModelKey[]>>(undefined);\n readonly collectionRefs = model<Maybe<DocumentReference<T>[]>>(undefined);\n readonly maxPages = model<Maybe<number>>(undefined);\n readonly itemsPerPage = model<Maybe<number>>(undefined);\n readonly constraints = model<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>(undefined);\n readonly waitForNonNullConstraints = model<Maybe<boolean>>(undefined);\n\n private readonly _collectionMode = toObservable(this.collectionMode).pipe(skipInitialMaybe());\n private readonly _collectionKeys = toObservable(this.collectionKeys).pipe(skipInitialMaybe());\n private readonly _collectionRefs = toObservable(this.collectionRefs).pipe(skipInitialMaybe());\n private readonly _maxPages = toObservable(this.maxPages).pipe(skipInitialMaybe());\n private readonly _itemsPerPage = toObservable(this.itemsPerPage).pipe(skipInitialMaybe());\n private readonly _constraints = toObservable(this.constraints).pipe(skipInitialMaybe());\n private readonly _waitForNonNullConstraints = toObservable(this.waitForNonNullConstraints).pipe(skipInitialMaybe());\n\n private readonly _store = completeOnDestroy(new BehaviorSubject<Maybe<S>>(undefined));\n\n readonly store$ = this._store.pipe(filterMaybe(), shareReplay(1));\n readonly pageLoadingState$ = this.store$.pipe(switchMap((x) => x.pageLoadingState$));\n\n constructor(store: S) {\n this.replaceStore(store);\n\n // sync inputs to store any time the store changes\n cleanSubscription(\n this.store$.subscribe((x) => {\n x.setCollectionMode(this._collectionMode);\n x.setCollectionKeys(this._collectionKeys);\n x.setCollectionRefs(this._collectionRefs);\n x.setConstraints(this._constraints);\n x.setMaxPages(this._maxPages);\n x.setItemsPerPage(this._itemsPerPage);\n x.setWaitForNonNullConstraints(this._waitForNonNullConstraints);\n })\n );\n }\n\n get store() {\n return this._store.value as S;\n }\n\n /**\n * Replaces the internal store.\n */\n replaceStore(store: S) {\n this._store.next(store);\n }\n\n setCollectionMode(collectionMode: DbxFirebaseCollectionMode) {\n this.collectionMode.set(collectionMode);\n }\n\n setCollectionKeys(collectionKeys: Maybe<FirestoreModelKey[]>) {\n this.collectionKeys.set(collectionKeys);\n }\n\n setCollectionRefs(collectionRefs: Maybe<DocumentReference<T>[]>) {\n this.collectionRefs.set(collectionRefs);\n }\n\n setMaxPages(maxPages: Maybe<number>) {\n this.maxPages.set(maxPages);\n }\n\n setItemsPerPage(itemsPerPage: Maybe<number>) {\n this.itemsPerPage.set(itemsPerPage);\n }\n\n setConstraints(constraints: Maybe<ArrayOrValue<FirestoreQueryConstraint>>) {\n this.constraints.set(constraints);\n }\n\n setWaitForNonNullConstraints(waitForNonNullConstraints: Maybe<boolean>) {\n this.waitForNonNullConstraints.set(waitForNonNullConstraints);\n }\n\n next() {\n this.store.next();\n }\n\n restart() {\n this.store.restart();\n }\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// The use of any here does not degrade the type-safety; we want to simply match that the Store type S is used in the Directive type C to provide it.\n\n/**\n * Configures providers for a DbxFirebaseCollectionStoreDirective.\n *\n * Can optionally also provide the actual store type to include in the providers array so it is instantiated by Angular.\n *\n * @param sourceType\n */\nexport function provideDbxFirebaseCollectionStoreDirective<S extends DbxFirebaseCollectionStoreDirective<any, any, any>>(sourceType: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionStoreDirective<S extends DbxFirebaseCollectionStore<any, any>, C extends DbxFirebaseCollectionStoreDirective<any, any, S> = DbxFirebaseCollectionStoreDirective<any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionStoreDirective<S extends DbxFirebaseCollectionStore<any, any>, C extends DbxFirebaseCollectionStoreDirective<any, any, S> = DbxFirebaseCollectionStoreDirective<any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxFirebaseCollectionStoreDirective,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n if (storeType) {\n providers.push(storeType);\n }\n\n return providers;\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { FirestoreDocument } from '@dereekb/firebase';\nimport { DbxFirebaseCollectionStore } from './store.collection';\nimport { DbxFirebaseCollectionStoreDirective } from './store.collection.directive';\nimport { DbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionChangeWatcher, DbxFirebaseCollectionChangeWatcherEvent, DbxFirebaseCollectionChangeWatcherTriggerMode } from '../../loader/collection.change.watcher';\nimport { Observable } from 'rxjs';\nimport { dbxFirebaseCollectionChangeTriggerForWatcher } from '../../loader/collection.change.trigger';\nimport { clean } from '@dereekb/dbx-core';\n\n/**\n * Used to watch query doc changes and respond to them accordingly.\n */\n@Directive({\n selector: '[dbxFirebaseCollectionChange]',\n standalone: true\n})\nexport class DbxFirebaseCollectionChangeDirective<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, S extends DbxFirebaseCollectionStore<T, D> = DbxFirebaseCollectionStore<T, D>> implements DbxFirebaseCollectionChangeWatcher<S> {\n readonly dbxFirebaseCollectionStoreDirective = inject(DbxFirebaseCollectionStoreDirective<T, D, S>);\n readonly mode = input<DbxFirebaseCollectionChangeWatcherTriggerMode, DbxFirebaseCollectionChangeWatcherTriggerMode | ''>('off', { alias: 'dbxFirebaseCollectionChange', transform: (x) => x || 'off' });\n\n private readonly _watcher = clean(dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store));\n private readonly _trigger = clean(dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart()));\n\n readonly mode$: Observable<DbxFirebaseCollectionChangeWatcherTriggerMode> = this._watcher.mode$;\n readonly event$: Observable<DbxFirebaseCollectionChangeWatcherEvent> = this._watcher.event$;\n readonly hasChangeAvailable$: Observable<boolean> = this._watcher.hasChangeAvailable$;\n readonly triggered$: Observable<boolean> = this._watcher.triggered$;\n readonly trigger$: Observable<void> = this._watcher.trigger$;\n\n protected readonly modeEffect = effect(() => {\n this._watcher.setMode(this.mode());\n });\n\n get store() {\n return this._watcher.store;\n }\n\n constructor() {\n this._trigger.init();\n }\n\n restart() {\n this.dbxFirebaseCollectionStoreDirective.store.restart();\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { AbstractIfDirective } from '@dereekb/dbx-core';\nimport { shareReplay, combineLatest, Observable, map } from 'rxjs';\nimport { DbxFirebaseCollectionChangeDirective } from './store.collection.change.directive';\nimport { IterationQueryDocChangeWatcherChangeType } from '@dereekb/firebase';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport type DbxFirebaseCollectionHasChangeDirectiveMode = 'all' | IterationQueryDocChangeWatcherChangeType;\n\n/**\n * Structural directive that displays the content when the target change is detected.\n *\n * Can specify which changes to appear on.\n */\n@Directive({\n selector: '[dbxFirebaseCollectionHasChange]',\n standalone: true\n})\nexport class DbxFirebaseCollectionHasChangeDirective extends AbstractIfDirective {\n readonly directive = inject(DbxFirebaseCollectionChangeDirective);\n readonly mode = input<DbxFirebaseCollectionHasChangeDirectiveMode, DbxFirebaseCollectionHasChangeDirectiveMode | ''>('addedAndRemoved', { alias: 'dbxFirebaseCollectionHasChange', transform: (x) => x || 'addedAndRemoved' });\n\n readonly show$: Observable<boolean> = combineLatest([toObservable(this.mode), this.directive.event$]).pipe(\n map(([mode, event]) => {\n let show = false;\n\n if (event.type !== 'none') {\n switch (mode) {\n case 'all':\n show = true;\n break;\n case 'addedAndRemoved':\n show = event.type === 'addedAndRemoved' || event.type === 'added' || event.type === 'removed';\n break;\n default:\n show = event.type === mode;\n break;\n }\n }\n\n return show;\n }),\n shareReplay(1)\n );\n}\n","import { cleanSubscription } from '@dereekb/dbx-core';\nimport { DbxListViewWrapper } from '@dereekb/dbx-web';\nimport { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective } from './store.collection.directive';\n\n/**\n * Directive that connects a host DbxListView to a DbxFirebaseCollectionStoreDirective to pass data for rendering items from a collection and query parameters.\n */\n@Directive({\n selector: '[dbxFirebaseCollectionList]',\n standalone: true\n})\nexport class DbxFirebaseCollectionListDirective<T> {\n readonly dbxFirebaseCollectionStoreDirective = inject(DbxFirebaseCollectionStoreDirective<T>);\n readonly dbxListViewWrapper = inject(DbxListViewWrapper<T>, { host: true });\n\n constructor() {\n this.dbxListViewWrapper.setState(this.dbxFirebaseCollectionStoreDirective.pageLoadingState$);\n\n if (this.dbxListViewWrapper.loadMore) {\n cleanSubscription(\n this.dbxListViewWrapper.loadMore.subscribe(() => {\n this.dbxFirebaseCollectionStoreDirective.next();\n })\n );\n }\n }\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type TwoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { type Observable } from 'rxjs';\n\nexport abstract class DbxFirebaseDocumentStoreTwoWayKeyProvider {\n abstract readonly twoWayFlatKey$: Observable<TwoWayFlatFirestoreModelKey>;\n}\n\n/**\n * Configures Providers for a DbxFirebaseDocumentStoreTwoWayKeyProvider.\n */\nexport function provideDbxFirebaseDocumentStoreTwoWayKeyProvider<S extends DbxFirebaseDocumentStoreTwoWayKeyProvider>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxFirebaseDocumentStoreTwoWayKeyProvider,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Observable } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective } from './store.document.directive';\nimport { DbxFirebaseDocumentStoreTwoWayKeyProvider, provideDbxFirebaseDocumentStoreTwoWayKeyProvider } from './store.document.twoway.key.source';\n\n/**\n * Directive that implements DbxFirebaseDocumentStoreTwoWayKeyProvider and passes the twoWayFlatKey from a host DbxFirebaseDocumentStoreDirective.\n */\n@Directive({\n selector: '[dbxFirebaseDocumentStoreTwoWayModelKeySource]',\n providers: provideDbxFirebaseDocumentStoreTwoWayKeyProvider(DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective),\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective implements DbxFirebaseDocumentStoreTwoWayKeyProvider {\n readonly dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective, { host: true });\n readonly twoWayFlatKey$: Observable<string> = this.dbxFirebaseDocumentStoreDirective.twoWayFlatKey$;\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective } from './store.document.directive';\nimport { DbxFirebaseDocumentStoreTwoWayKeyProvider } from './store.document.twoway.key.source';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Used for providing an id from the twoWayFlatKey$ from a DbxFirebaseDocumentStoreTwoWayKeyProvider.\n */\n@Directive({\n selector: '[dbxFirebaseDocumentStoreIdFromTwoWayModelKey]',\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective {\n readonly dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective, { host: true });\n readonly dbxFirebaseDocumentStoreTwoWayKeyProvider = inject(DbxFirebaseDocumentStoreTwoWayKeyProvider, { skipSelf: true, host: false });\n\n constructor() {\n cleanSubscription(this.dbxFirebaseDocumentStoreDirective.store.setId(this.dbxFirebaseDocumentStoreTwoWayKeyProvider.twoWayFlatKey$));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseCollectionChangeDirective } from './store.collection.change.directive';\nimport { DbxFirebaseCollectionHasChangeDirective } from './store.collection.change.if.directive';\nimport { DbxFirebaseCollectionListDirective } from './store.collection.list.directive';\nimport { DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective } from './store.document.twoway.key.source.directive';\nimport { DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective } from './store.document.twoway.key.directive';\n\nconst importsAndExports = [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective, DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective];\n\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxFirebaseModelStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Observable, shareReplay, distinctUntilChanged, Subscription, first, map, switchMap, tap } from 'rxjs';\nimport { FirebaseQueryItemAccumulator, FirestoreCollectionLike, FirestoreDocument, FirestoreItemPageIterationInstance, FirestoreQueryConstraint, IterationQueryDocChangeWatcher, DocumentDataWithIdAndKey, DocumentReference, FirebaseQuerySnapshotAccumulator, FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction, FirestoreModelKey } from '@dereekb/firebase';\nimport { ObservableOrValue, cleanupDestroyable, PageListLoadingState, filterMaybe, ItemAccumulatorNextPageUntilResultsCountResult } from '@dereekb/rxjs';\nimport { ArrayOrValue, Maybe, PageNumber } from '@dereekb/util';\nimport { LockSetComponentStore } from '@dereekb/dbx-core';\nimport { DbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionLoaderInstanceData, DbxFirebaseCollectionLoaderInstanceInitConfig, DbxFirebaseCollectionMode } from '../../loader/collection.loader.instance';\nimport { DbxFirebaseCollectionLoaderAccessorWithAccumulator } from '../../loader/collection.loader';\n\nexport interface DbxFirebaseCollectionStore<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends DbxFirebaseCollectionLoaderAccessorWithAccumulator<T>, DbxFirebaseCollectionLoaderInstanceData<T, D> {\n /**\n * The current collection that documents are loaded from.\n */\n readonly firestoreCollection$: Observable<Maybe<FirestoreCollectionLike<T, D>>>;\n /**\n * The current store mode.\n */\n readonly collectionMode$: Observable<DbxFirebaseCollectionMode>;\n /**\n * The loader instance.\n */\n readonly loader$: Observable<DbxFirebaseCollectionLoaderInstance<T, D>>;\n /**\n * Whether or not the iterator has more pages to load.\n */\n readonly hasNext$: Observable<boolean>;\n /**\n * Whether or not the iterator can load more pages.\n */\n readonly canLoadMore$: Observable<boolean>;\n /**\n * Whether or not the iterator has more pages to load and can load more pages.\n */\n readonly hasNextAndCanLoadMore$: Observable<boolean>;\n /**\n * Returns true if the collection has documents.\n */\n readonly hasDocuments$: Observable<boolean>;\n /**\n * Returns all document references loaded by the accumulator.\n */\n readonly allDocumentRefs$: Observable<DocumentReference<T>[]>;\n /**\n * Returns all documents loaded by the accomulator.\n */\n readonly allDocuments$: Observable<D[]>;\n /**\n * Returns all documents data loaded by the accumulator.\n */\n readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]>;\n\n setCollectionMode(observableOrValue: ObservableOrValue<DbxFirebaseCollectionMode>): Subscription;\n\n // References Mode\n setCollectionKeys(observableOrValue: ObservableOrValue<Maybe<FirestoreModelKey[]>>): Subscription;\n setCollectionRefs(observableOrValue: ObservableOrValue<Maybe<DocumentReference<T>[]>>): Subscription;\n\n // Query Mode\n setMaxPages(observableOrValue: ObservableOrValue<Maybe<number>>): Subscription;\n setItemsPerPage(observableOrValue: ObservableOrValue<Maybe<number>>): Subscription;\n setConstraints(observableOrValue: ObservableOrValue<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>): Subscription;\n setWaitForNonNullConstraints(observableOrValue: ObservableOrValue<Maybe<boolean>>): Subscription;\n next(observableOrValue: ObservableOrValue<void>): void;\n restart(observableOrValue: ObservableOrValue<void>): void;\n\n readonly setFirestoreCollection: (() => void) | ((observableOrValue: ObservableOrValue<Maybe<FirestoreCollectionLike<T, D>>>) => Subscription);\n}\n\nexport interface DbxFirebaseCollectionStoreContextState<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends Omit<DbxFirebaseCollectionLoaderInstanceInitConfig<T, D>, 'collection'> {\n readonly firestoreCollection?: Maybe<FirestoreCollectionLike<T, D>>;\n}\n\n@Injectable()\nexport class AbstractDbxFirebaseCollectionStore<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseCollectionStoreContextState<T, D> = DbxFirebaseCollectionStoreContextState<T, D>> extends LockSetComponentStore<C> implements DbxFirebaseCollectionStore<T, D> {\n // MARK: Effects\n readonly setCollectionMode = this.effect((input: Observable<DbxFirebaseCollectionMode>) => {\n return input.pipe(switchMap((mode) => this.loader$.pipe(tap((x) => x.setCollectionMode(mode)))));\n });\n\n readonly setCollectionKeys = this.effect((input: Observable<Maybe<FirestoreModelKey[]>>) => {\n return input.pipe(switchMap((keys) => this.loader$.pipe(tap((x) => x.setCollectionKeys(keys)))));\n });\n\n readonly setCollectionRefs = this.effect((input: Observable<Maybe<DocumentReference<T>[]>>) => {\n return input.pipe(switchMap((refs) => this.loader$.pipe(tap((x) => x.setCollectionRefs(refs)))));\n });\n\n readonly setMaxPages = this.effect((input: Observable<Maybe<number>>) => {\n return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => x.setMaxPages(maxPages)))));\n });\n\n readonly setItemsPerPage = this.effect((input: Observable<Maybe<number>>) => {\n return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => x.setItemsPerPage(itemsPerPage)))));\n });\n\n readonly setConstraints = this.effect((input: Observable<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>) => {\n return input.pipe(switchMap((constraints) => this.loader$.pipe(tap((x) => x.setConstraints(constraints)))));\n });\n\n readonly setWaitForNonNullConstraints = this.effect((input: Observable<Maybe<boolean>>) => {\n return input.pipe(switchMap((waitForNonNullConstraints) => this.loader$.pipe(tap((x) => x.setWaitForNonNullConstraints(waitForNonNullConstraints)))));\n });\n\n readonly next = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.loader$.pipe(\n first(),\n tap((x) => x.next())\n )\n )\n );\n });\n\n readonly restart = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.loader$.pipe(\n first(),\n tap((x) => x.restart())\n )\n )\n );\n });\n\n // MARK: Accessors\n readonly currentFirestoreCollection$: Observable<Maybe<FirestoreCollectionLike<T, D>>> = this.state$.pipe(\n map((x) => x.firestoreCollection),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly firestoreCollection$: Observable<FirestoreCollectionLike<T, D>> = this.currentFirestoreCollection$.pipe(filterMaybe());\n\n readonly loader$: Observable<DbxFirebaseCollectionLoaderInstance<T, D>> = this.currentFirestoreCollection$.pipe(\n switchMap((collection) =>\n this.state$.pipe(\n first(),\n map((x) =>\n dbxFirebaseCollectionLoaderInstance({\n collection,\n collectionMode: x.collectionMode,\n collectionKeys: x.collectionKeys,\n collectionRefs: x.collectionRefs,\n maxPages: x.maxPages,\n itemsPerPage: x.itemsPerPage,\n constraints: x.constraints,\n waitForNonNullConstraints: x.waitForNonNullConstraints\n })\n )\n )\n ),\n cleanupDestroyable(),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionMode$: Observable<DbxFirebaseCollectionMode> = this.loader$.pipe(switchMap((x) => x.collectionMode$));\n readonly constraints$: Observable<Maybe<ArrayOrValue<FirestoreQueryConstraint>>> = this.loader$.pipe(switchMap((x) => x.constraints$));\n readonly firestoreIteration$: Observable<FirestoreItemPageIterationInstance<T>> = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));\n readonly queryChangeWatcher$: Observable<IterationQueryDocChangeWatcher<T>> = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));\n readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = this.loader$.pipe(switchMap((x) => x.pageLoadingState$));\n readonly snapshotAccumulator$: Observable<FirebaseQuerySnapshotAccumulator<T>> = this.loader$.pipe(switchMap((x) => x.snapshotAccumulator$));\n readonly accumulator$: Observable<FirebaseQueryItemAccumulator<T>> = this.loader$.pipe(switchMap((x) => x.accumulator$));\n\n readonly hasNext$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.hasNext$));\n readonly canLoadMore$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.canLoadMore$));\n readonly hasNextAndCanLoadMore$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.hasNextAndCanLoadMore$));\n\n readonly hasDocuments$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.hasDocuments$));\n readonly allDocumentRefs$: Observable<DocumentReference<T>[]> = this.loader$.pipe(switchMap((x) => x.allDocumentRefs$));\n readonly allDocuments$: Observable<D[]> = this.loader$.pipe(switchMap((x) => x.allDocuments$));\n readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]> = this.loader$.pipe(switchMap((x) => x.allDocumentData$));\n\n readonly setFirestoreCollection = this.updater((state, firestoreCollection: FirestoreCollectionLike<T, D> | null | undefined) => ({ ...state, firestoreCollection }));\n\n loadToPage(page: PageNumber): Observable<PageNumber> {\n return this.loader$.pipe(switchMap((x) => x.loadToPage(page)));\n }\n\n loadPagesUntilResultsCount(maxResultsCount: number, countFunction?: FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction<T> | undefined): Observable<ItemAccumulatorNextPageUntilResultsCountResult> {\n return this.loader$.pipe(switchMap((x) => x.loadPagesUntilResultsCount(maxResultsCount, countFunction)));\n }\n\n loadAllResults(): Observable<PageNumber> {\n return this.loader$.pipe(switchMap((x) => x.loadAllResults()));\n }\n}\n","import { type ModelFirebaseCreateFunction, type ModelFirebaseCrudFunction, type OnCallCreateModelResult } from '@dereekb/firebase';\nimport { type LoadingState, loadingStateFromObs, lazyFrom } from '@dereekb/rxjs';\nimport { asArray } from '@dereekb/util';\nimport { type Observable, from, shareReplay } from 'rxjs';\nimport { type DbxFirebaseCollectionStore } from './store.collection';\n\n// MARK: Create\nexport type DbxFirebaseCollectionStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult> = (params: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a function for a store that DbxFirebaseDocumentStore captures the ModelFirebaseCreateFunction result and sets the key of the created value.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseCollectionStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult>(store: DbxFirebaseCollectionStore<any, any>, fn: ModelFirebaseCreateFunction<I, O>): DbxFirebaseCollectionStoreCreateFunction<I, O> {\n return (params: I) =>\n loadingStateFromObs(\n lazyFrom(() =>\n fn(params).then((result) => {\n const modelKeys = asArray(result.modelKeys);\n\n store.setCollectionKeys(modelKeys);\n store.setCollectionMode('references'); // switch mode to references if not yet set\n\n return result;\n })\n )\n );\n}\n\nexport type DbxFirebaseCollectionStoreCrudFunction<I, O = void> = (input: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a DbxfirebaseDocumentStoreCrudFunction from the input ModelFirebaseCrudFunction.\n *\n * @param fn\n * @returns\n */\nexport function firebaseCollectionStoreCrudFunction<I, O = void>(fn: ModelFirebaseCrudFunction<I, O>): DbxFirebaseCollectionStoreCrudFunction<I, O> {\n return (params: I) => loadingStateFromObs(from(fn(params)).pipe(shareReplay(1)));\n}\n","import { readableError } from '@dereekb/util';\n\nexport const DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR = 'DOES_NOT_EXIST';\n\nexport function modelDoesNotExistError() {\n return readableError(DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, 'The document does not exist.');\n}\n","import { inject, DestroyRef, InjectionToken, type Provider } from '@angular/core';\nimport { DbxFirebaseDocumentStoreContextStore } from './store.document.context.store';\nimport { type DbxFirebaseDocumentStore } from './store';\n\n/**\n * Injection token for DbxFirebaseDocumentStoreContextStore.\n */\nexport const DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN = new InjectionToken<DbxFirebaseDocumentStoreContextStore[]>('DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN');\n\n/**\n * Provides the DbxFirebaseDocumentStoreContextStore.\n */\nexport function provideDbxFirebaseDocumentStoreContextStore(): Provider[] {\n return [\n {\n // Create/Provide a \"nearest\" DbxFirebaseDocumentStoreContextStore.\n provide: DbxFirebaseDocumentStoreContextStore\n },\n {\n // Also make that context store available to the DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN.\n provide: DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN,\n useExisting: DbxFirebaseDocumentStoreContextStore,\n multi: true\n }\n ];\n}\n\n/**\n * Links a DbxFirebaseDocumentStore to parent DbxFirebaseDocumentStoreContextStore instances.\n *\n * This should be called in an Angular injection context.\n */\nexport function linkDocumentStoreToParentContextStores(store: DbxFirebaseDocumentStore<any, any>) {\n const contextStores = inject(DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN, { optional: true });\n const destroyRef = inject(DestroyRef);\n\n if (contextStores) {\n // add the store to each available context store\n contextStores.forEach((contextStore) => {\n contextStore.addStore(store);\n });\n\n // remove the store from each available context store when the context is destroyed\n destroyRef.onDestroy(() => {\n contextStores.forEach((contextStore) => {\n contextStore.removeStore(store);\n });\n });\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { Observable, shareReplay, distinctUntilChanged, map, switchMap, combineLatest, Subscription, of, catchError } from 'rxjs';\nimport {\n DocumentSnapshot,\n DocumentReference,\n FirestoreCollection,\n FirestoreDocument,\n DocumentDataWithIdAndKey,\n FirestoreModelId,\n FirestoreModelKey,\n FirestoreCollectionLike,\n FirestoreModelIdentity,\n firestoreModelIdsFromKey,\n firestoreModelKeyPartPairs,\n FirestoreModelCollectionAndIdPair,\n firestoreModelKeyPairObject,\n FirestoreModelCollectionAndIdPairObject,\n documentDataWithIdAndKey,\n FirestoreAccessorStreamMode,\n TwoWayFlatFirestoreModelKey,\n inferKeyFromTwoWayFlatFirestoreModelKey,\n RootSingleItemFirestoreCollection,\n FlatFirestoreModelKey,\n flatFirestoreModelKey,\n twoWayFlatFirestoreModelKey,\n FIRESTORE_PERMISSION_DENIED_ERROR_CODE,\n isClientFirebaseError\n} from '@dereekb/firebase';\nimport { filterMaybe, LoadingState, beginLoading, successResult, loadingStateFromObs, errorResult, isLoadingStateLoading } from '@dereekb/rxjs';\nimport { Maybe, isMaybeSo } from '@dereekb/util';\nimport { LockSetComponentStore } from '@dereekb/dbx-core';\nimport { modelDoesNotExistError } from '../../error';\nimport { DbxFirebaseDocumentStore } from './store';\nimport { linkDocumentStoreToParentContextStores } from './store.document.context.store.link';\n\n@Injectable()\nexport class AbstractDbxFirebaseDocumentStore<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseDocumentStoreContextState<T, D> = DbxFirebaseDocumentStoreContextState<T, D>> extends LockSetComponentStore<C> implements DbxFirebaseDocumentStore<T, D> {\n // NOTE: Injection does not occur here, but we need @Injectable to compile properly for Angular usage\n // eslint-disable-next-line @angular-eslint/prefer-inject\n protected constructor(@Inject(null) @Optional() initialState?: C) {\n super(initialState);\n linkDocumentStoreToParentContextStores(this);\n }\n\n // MARK: Effects\n\n // MARK: Accessors\n readonly storeName$: Observable<Maybe<string>> = this.state$.pipe(\n map((x) => x.storeName),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentFirestoreCollectionLike$: Observable<Maybe<FirestoreCollectionLike<T, D>>> = this.state$.pipe(\n map((x) => x.firestoreCollection ?? x.firestoreCollectionLike),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentFirestoreCollection$: Observable<Maybe<FirestoreCollection<T, D>>> = this.state$.pipe(\n map((x) => x.firestoreCollection),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly firestoreCollectionLike$: Observable<FirestoreCollectionLike<T, D>> = this.currentFirestoreCollectionLike$.pipe(filterMaybe());\n readonly firestoreCollection$: Observable<FirestoreCollection<T, D>> = this.currentFirestoreCollection$.pipe(filterMaybe());\n\n readonly currentInputId$: Observable<Maybe<FirestoreModelId>> = this.state$.pipe(\n map((x) => x.id),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly inputId$: Observable<FirestoreModelId> = this.currentInputId$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly currentInputKey$: Observable<Maybe<FirestoreModelKey>> = this.state$.pipe(\n map((x) => x.key),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly inputKey$: Observable<FirestoreModelKey> = this.currentInputKey$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly currentInputRef$: Observable<Maybe<DocumentReference<T>>> = this.state$.pipe(\n map((x) => x.ref),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly inputRef$: Observable<DocumentReference<T>> = this.currentInputRef$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly streamMode$: Observable<FirestoreAccessorStreamMode> = this.state$.pipe(\n map((x) => x.streamMode ?? FirestoreAccessorStreamMode.STREAM),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentDocument$: Observable<Maybe<D>> = combineLatest([this.currentInputId$, this.currentInputKey$, this.currentInputRef$]).pipe(\n switchMap(([id, key, ref]) => {\n let document: Observable<Maybe<D>>;\n\n if (ref) {\n document = this.firestoreCollectionLike$.pipe(map((x) => x.documentAccessor().loadDocument(ref)));\n } else if (key) {\n document = this.firestoreCollectionLike$.pipe(map((x) => x.documentAccessor().loadDocumentForKey(key)));\n } else if (id) {\n document = this.firestoreCollection$.pipe(map((x) => x.documentAccessor().loadDocumentForId(id)));\n } else {\n document = of(undefined);\n }\n\n return document;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Whether or not an id/ref/key has been input and currentDocument is not null.\n */\n readonly hasRef$: Observable<boolean> = this.currentDocument$.pipe(\n map((x) => x?.documentRef != null),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly document$: Observable<D> = this.currentDocument$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly documentLoadingState$: Observable<LoadingState<D>> = this.currentDocument$.pipe(\n map((x) => (x ? successResult(x) : beginLoading<D>())),\n shareReplay(1)\n );\n\n readonly currentId$: Observable<Maybe<FirestoreModelId>> = this.currentDocument$.pipe(\n map((x) => x?.id),\n shareReplay(1)\n );\n\n readonly currentKey$: Observable<Maybe<FirestoreModelKey>> = this.currentDocument$.pipe(\n map((x) => x?.key),\n shareReplay(1)\n );\n\n readonly id$: Observable<FirestoreModelId> = this.document$.pipe(\n map((x) => x.id),\n shareReplay(1)\n );\n\n readonly key$: Observable<FirestoreModelKey> = this.document$.pipe(\n map((x) => x.key),\n shareReplay(1)\n );\n\n readonly keyModelIds$: Observable<FirestoreModelId[]> = this.key$.pipe(map(firestoreModelIdsFromKey), shareReplay(1));\n readonly keyPairs$: Observable<FirestoreModelCollectionAndIdPair[]> = this.key$.pipe(map(firestoreModelKeyPartPairs), filterMaybe(), shareReplay(1));\n readonly keyPairObject$: Observable<FirestoreModelCollectionAndIdPairObject> = this.key$.pipe(map(firestoreModelKeyPairObject), filterMaybe(), shareReplay(1));\n\n readonly ref$: Observable<DocumentReference<T>> = this.document$.pipe(\n map((x) => x.documentRef),\n shareReplay(1)\n );\n\n readonly flatKey$: Observable<FlatFirestoreModelKey> = this.key$.pipe(\n map((x) => flatFirestoreModelKey(x)),\n shareReplay(1)\n );\n\n readonly twoWayFlatKey$: Observable<FlatFirestoreModelKey> = this.key$.pipe(\n map((x) => twoWayFlatFirestoreModelKey(x)),\n shareReplay(1)\n );\n\n readonly snapshot$: Observable<DocumentSnapshot<T>> = combineLatest([this.document$, this.streamMode$]).pipe(\n switchMap(([x, mode]) => x.snapshotStream(mode)),\n shareReplay(1)\n );\n\n readonly snapshotLoadingState$: Observable<LoadingState<DocumentSnapshot<T>>> = this.currentDocument$.pipe(\n switchMap(() => loadingStateFromObs(this.snapshot$).pipe(catchError((error) => of(errorResult(error) as LoadingState<DocumentSnapshot<T>>)))),\n shareReplay(1)\n );\n\n readonly dataLoadingState$: Observable<LoadingState<DocumentDataWithIdAndKey<T>>> = this.snapshotLoadingState$.pipe(\n map((x) => {\n let result: LoadingState<DocumentDataWithIdAndKey<T>>;\n\n if (x.value) {\n const data = documentDataWithIdAndKey(x.value);\n\n if (data) {\n result = successResult(data);\n } else {\n result = errorResult(modelDoesNotExistError());\n }\n } else {\n result = {\n ...x,\n value: undefined\n };\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n readonly currentData$: Observable<Maybe<DocumentDataWithIdAndKey<T>>> = this.dataLoadingState$.pipe(\n map((x) => x.value),\n shareReplay(1)\n );\n\n readonly data$: Observable<DocumentDataWithIdAndKey<T>> = this.currentDocument$.pipe(\n switchMap(() => this.currentData$.pipe(filterMaybe())),\n shareReplay(1)\n );\n\n readonly isLoadingData$ = this.dataLoadingState$.pipe(map(isLoadingStateLoading), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Returns false while hasRef$ is false, and then returns exists$.\n */\n readonly currentExists$: Observable<boolean> = this.hasRef$.pipe(\n switchMap((hasRef) => {\n if (hasRef) {\n return this.exists$;\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n\n readonly exists$: Observable<boolean> = this.currentData$.pipe(\n map((x) => isMaybeSo(x)),\n catchError((e) => {\n let result: Maybe<boolean>;\n\n if (isClientFirebaseError(e)) {\n switch (e.code) {\n case FIRESTORE_PERMISSION_DENIED_ERROR_CODE:\n result = false; // does not exist if permission is denied\n break;\n }\n }\n\n if (result == null) {\n throw e;\n }\n\n return of(result);\n }),\n shareReplay(1)\n );\n\n readonly doesNotExist$: Observable<boolean> = this.exists$.pipe(\n map((x) => !x),\n shareReplay(1)\n );\n\n readonly modelIdentity$: Observable<FirestoreModelIdentity> = this.firestoreCollectionLike$.pipe(\n map((x) => x.modelIdentity),\n shareReplay(1)\n );\n\n // MARK: State Changes\n readonly setStoreName = this.updater((state, storeName: Maybe<string>) => ({ ...state, storeName })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setId = this.updater((state, id: Maybe<FirestoreModelId>) => (id ? { ...state, id, key: undefined, ref: undefined } : { ...state, id })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setKey = this.updater((state, key: Maybe<FirestoreModelKey>) => (key ? { ...state, key, id: undefined, ref: undefined } : { ...state, key })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setFlatKey = this.updater((state, key: Maybe<TwoWayFlatFirestoreModelKey>) => (key ? { ...state, key: inferKeyFromTwoWayFlatFirestoreModelKey(key), id: undefined, ref: undefined } : { ...state, key })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setRef = this.updater((state, ref: Maybe<DocumentReference<T>>) => (ref ? { ...state, key: undefined, id: undefined, ref } : { ...state, ref })) as (observableOrValue: Maybe<DocumentReference<T>> | Observable<Maybe<DocumentReference<T>>>) => Subscription;\n\n readonly setStreamMode = this.updater((state, streamMode: FirestoreAccessorStreamMode) => ({ ...state, streamMode }));\n\n readonly clearRefs = this.updater((state) => ({ ...state, id: undefined, key: undefined, ref: undefined }));\n\n readonly setFirestoreCollection = this.updater((state, firestoreCollection: Maybe<FirestoreCollection<T, D>>) => ({ ...state, firestoreCollection }));\n readonly setFirestoreCollectionLike = this.updater((state, firestoreCollectionLike: Maybe<FirestoreCollectionLike<T, D>>) => ({ ...state, firestoreCollectionLike }));\n}\n\nfunction injectSingleItemIdIntoState<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseDocumentStoreContextState<T, D> = DbxFirebaseDocumentStoreContextState<T, D>>(state?: C | undefined): C | undefined {\n const id = (state?.firestoreCollection as RootSingleItemFirestoreCollection<T, D>)?.singleItemIdentifier;\n\n if (state && id != null) {\n return { ...state, id };\n } else {\n return state;\n }\n}\n\n/**\n * AbstractDbxFirebaseDocumentWithParentStore extension for use with RootSingleItemFirestoreCollection.\n */\nexport class AbstractRootSingleItemDbxFirebaseDocument<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseDocumentStoreContextState<T, D> = DbxFirebaseDocumentStoreContextState<T, D>> extends AbstractDbxFirebaseDocumentStore<T, D, C> {\n protected constructor(@Inject(null) @Optional() initialState?: C) {\n super(injectSingleItemIdIntoState<T, D, C>(initialState));\n }\n\n /**\n * Sets the SingleItemFirestoreCollection to use.\n */\n override readonly setFirestoreCollection = this.updater((state, firestoreCollection: Maybe<FirestoreCollection<T, D>>) => {\n if (firestoreCollection != null) {\n const id = (firestoreCollection as RootSingleItemFirestoreCollection<T, D>).singleItemIdentifier;\n\n if (id != null) {\n return { ...state, firestoreCollection, id };\n } else {\n throw new Error('AbstractRootSingleItemDbxFirebaseDocument only accepts RootSingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');\n }\n } else {\n return { ...state, firestoreCollection: null };\n }\n });\n\n /**\n * Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setId = this.updater((state, id: Maybe<FirestoreModelId>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setKey = this.updater((state, key: Maybe<FirestoreModelKey>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setRef = this.updater((state, ref: Maybe<DocumentReference<T>>) => state) as (observableOrValue: Maybe<DocumentReference<T>> | Observable<Maybe<DocumentReference<T>>>) => Subscription;\n\n override readonly clearRefs = this.updater((state) => state);\n}\n\nexport interface DbxFirebaseDocumentStoreContextState<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> {\n readonly storeName?: Maybe<string>;\n readonly firestoreCollectionLike?: Maybe<FirestoreCollectionLike<T, D>>;\n readonly firestoreCollection?: Maybe<FirestoreCollection<T, D>>;\n readonly streamMode?: FirestoreAccessorStreamMode;\n readonly id?: Maybe<FirestoreModelId>;\n readonly key?: Maybe<FirestoreModelKey>;\n readonly ref?: Maybe<DocumentReference<T>>;\n}\n","import { type ModelFirebaseCreateFunction, type ModelFirebaseDeleteFunction, type ModelFirebaseUpdateFunction, type OnCallCreateModelResult, type TargetModelParams, type InferredTargetModelParams, type ModelFirebaseCrudFunction, type ModelFirebaseReadFunction } from '@dereekb/firebase';\nimport { lazyFrom, type LoadingState, loadingStateFromObs } from '@dereekb/rxjs';\nimport { firstValue, type PartialOnKeys } from '@dereekb/util';\nimport { shareReplay, exhaustMap, first, from, type Observable } from 'rxjs';\nimport { type DbxFirebaseDocumentStore } from './store';\n\n// MARK: Create\nexport type DbxFirebaseDocumentStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult> = (params: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a function for a store that DbxFirebaseDocumentStore captures the ModelFirebaseCreateFunction result and sets the key of the created value.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseCreateFunction<I, O>): DbxFirebaseDocumentStoreCreateFunction<I, O> {\n return (params: I) =>\n loadingStateFromObs(\n lazyFrom(() =>\n fn(params).then((result) => {\n const modelKeys = result.modelKeys;\n const firstKey = firstValue(modelKeys);\n\n if (firstKey) {\n store.setKey(firstKey);\n }\n\n return result;\n })\n )\n );\n}\n\nexport type DbxFirebaseDocumentStoreCrudFunction<I, O = void> = (input: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a DbxfirebaseDocumentStoreCrudFunction from the input ModelFirebaseCrudFunction.\n *\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreCrudFunction<I, O = void>(fn: ModelFirebaseCrudFunction<I, O>): DbxFirebaseDocumentStoreCrudFunction<I, O> {\n return (params: I) => loadingStateFromObs(from(fn(params)).pipe(shareReplay(1)));\n}\n\n// MARK: Targeted Functions\n/**\n * A parameter that refers to a specific key.\n */\nexport type DbxFirebaseDocumentStoreFunctionParams = TargetModelParams | InferredTargetModelParams;\n\n/**\n * Used for the input to related functions\n */\nexport type DbxFirebaseDocumentStoreFunctionParamsInput<I extends DbxFirebaseDocumentStoreFunctionParams> = PartialOnKeys<I, 'key'>;\nexport type DbxFirebaseDocumentStoreFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O = void> = DbxFirebaseDocumentStoreCrudFunction<DbxFirebaseDocumentStoreFunctionParamsInput<I>, O>;\n\n// MARK: Read\n/**\n * Creates a DbxfirebaseDocumentStoreCrudFunction for read.\n *\n * The store's current key is always injected into the params of the request.\n *\n * For functions that do not require the store's current key, use firebaseDocumentStoreCrudFunction() instead.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreReadFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseReadFunction<I, O>): DbxFirebaseDocumentStoreFunction<I, O> {\n return firebaseDocumentStoreUpdateFunction(store, fn);\n}\n\n// MARK: Update\n/**\n * Creates a DbxFirebaseDocumentStoreFunction for update.\n *\n * The store's current key is always injected into the params of the request.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreUpdateFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O = void>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseUpdateFunction<I, O>): DbxFirebaseDocumentStoreFunction<I, O> {\n return (params: DbxFirebaseDocumentStoreFunctionParamsInput<I>) =>\n loadingStateFromObs(\n store.key$.pipe(\n first(),\n exhaustMap((key) =>\n fn({\n ...params,\n key // inject key into the parameters.\n } as I)\n ),\n shareReplay(1)\n )\n );\n}\n\n// MARK: Delete\n/**\n * Creates a DbxFirebaseDocumentStoreFunction for delete.\n *\n * The store's current key is always injected into the params of the request.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreDeleteFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O = void>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseDeleteFunction<I, O>): DbxFirebaseDocumentStoreFunction<I, O> {\n return (params: DbxFirebaseDocumentStoreFunctionParamsInput<I>) =>\n loadingStateFromObs(\n store.key$.pipe(\n first(),\n exhaustMap((key) =>\n fn({\n ...params,\n key // inject key into the parameters.\n } as I).then((result) => {\n store.clearRefs();\n return result;\n })\n ),\n shareReplay(1)\n )\n );\n}\n","import { type LockSetComponentStore } from '@dereekb/dbx-core';\nimport { type FirestoreCollectionLike, type FirestoreCollectionWithParentFactory, type FirestoreDocument } from '@dereekb/firebase';\nimport { cleanup, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { type ComponentStore } from '@ngrx/component-store';\nimport { map, type Observable, type Subscription } from 'rxjs';\nimport { type DbxFirebaseDocumentStore } from './store';\n\nexport interface DbxFirebaseComponentStoreWithParentContextState<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> {\n readonly parent?: Maybe<PD>;\n readonly collectionFactory?: Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>;\n}\n\nexport type DbxFirebaseComponentStoreSetParentEffectFunction<PD> = (parent: Observable<Maybe<PD>>) => Subscription;\nexport type DbxFirebaseComponentStoreWithParentSetParentEffectFunction<PD> = (observableOrValue: ObservableOrValue<Maybe<PD>>) => Subscription;\nexport type DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> = (observableOrValue: ObservableOrValue<DbxFirebaseDocumentStore<PT, PD>>) => Subscription;\n\nexport interface DbxFirebaseComponentStoreWithParent<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, A extends FirestoreCollectionLike<T, D> = FirestoreCollectionLike<T, D>> extends LockSetComponentStore<object>, Pick<ComponentStore<DbxFirebaseComponentStoreWithParentContextState<T, PT, D, PD>>, 'effect'> {\n readonly currentParent$: Observable<Maybe<PD>>;\n readonly parent$: Observable<PD>;\n readonly currentCollectionFactory$: Observable<Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>>;\n readonly collectionFactory$: Observable<FirestoreCollectionWithParentFactory<T, PT, D, PD>>;\n readonly _setParent: DbxFirebaseComponentStoreSetParentEffectFunction<PD>;\n readonly _setParentDocument: (() => void) | ((observableOrValue: ObservableOrValue<Maybe<PD>>) => Subscription);\n readonly setFirestoreCollection: (() => void) | ((observableOrValue: ObservableOrValue<Maybe<A>>) => Subscription);\n}\n\nexport function setParentStoreEffect<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, A extends FirestoreCollectionLike<T, D> = FirestoreCollectionLike<T, D>>(store: DbxFirebaseComponentStoreWithParent<T, PT, D, PD, A>): DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD> {\n return store.effect((input: Observable<Maybe<DbxFirebaseDocumentStore<PT, PD>>>) => {\n return input.pipe(\n map((parentStore) => {\n let result: Maybe<Subscription>;\n\n if (parentStore) {\n result = store._setParent(parentStore.currentDocument$) as Subscription;\n } else {\n result = undefined;\n }\n\n // set as the parent lock set too\n store.setParentLockSet(parentStore);\n\n return result;\n }),\n cleanup((sub) => {\n if (sub) {\n sub.unsubscribe();\n }\n })\n );\n });\n}\n","import { type Maybe } from '@dereekb/util';\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport { filterMaybe, ObservableOrValue } from '@dereekb/rxjs';\nimport { Observable, shareReplay, distinctUntilChanged, map, Subscription, NEVER, switchMap, tap } from 'rxjs';\nimport { FirestoreCollectionGroup, FirestoreCollectionWithParentFactory, FirestoreDocument } from '@dereekb/firebase';\nimport { AbstractDbxFirebaseCollectionStore, DbxFirebaseCollectionStore, DbxFirebaseCollectionStoreContextState } from './store.collection';\nimport { DbxFirebaseComponentStoreSetParentEffectFunction, DbxFirebaseComponentStoreWithParent, DbxFirebaseComponentStoreWithParentContextState, DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction, setParentStoreEffect } from './store.subcollection.rxjs';\n\n/**\n * Whether or not to load values from a parent or a group.\n */\nexport type DbxFirebaseComponentStoreWithParentSourceMode = 'parent' | 'group';\n\nexport interface DbxFirebaseCollectionWithParentStoreContextState<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseCollectionStoreContextState<T, D>, DbxFirebaseComponentStoreWithParentContextState<T, PT, D, PD> {\n readonly mode?: Maybe<DbxFirebaseComponentStoreWithParentSourceMode>;\n readonly collectionGroup?: Maybe<FirestoreCollectionGroup<T, D>>;\n}\n\nexport type DbxFirebaseComponentStoreWithParentSetParentSourceModeFunction = (observableOrValue: ObservableOrValue<Maybe<DbxFirebaseComponentStoreWithParentSourceMode>>) => Subscription;\n\nexport interface DbxFirebaseCollectionWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseCollectionStore<T, D>, DbxFirebaseComponentStoreWithParent<T, PT, D, PD> {\n readonly setSourceMode: DbxFirebaseComponentStoreWithParentSetParentSourceModeFunction;\n readonly setCollectionGroup: (observableOrValue: FirestoreCollectionGroup<T, D> | Observable<FirestoreCollectionGroup<T, D>>) => Subscription;\n readonly currentCollectionGroup$: Observable<Maybe<FirestoreCollectionGroup<T, D>>>;\n readonly collectionGroup$: Observable<FirestoreCollectionGroup<T, D>>;\n}\n\n/**\n * Abstract DbxFirebaseCollectionStore that has a parent document from which is derives it's FiresbaseCollection from.\n */\n@Injectable()\nexport class AbstractDbxFirebaseCollectionWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, C extends DbxFirebaseCollectionWithParentStoreContextState<T, PT, D, PD> = DbxFirebaseCollectionWithParentStoreContextState<T, PT, D, PD>> extends AbstractDbxFirebaseCollectionStore<T, D, C> implements DbxFirebaseCollectionWithParentStore<T, PT, D, PD> {\n // NOTE: Injection does not occur here, but we need @Injectable to compile properly for Angular usage\n // eslint-disable-next-line @angular-eslint/prefer-inject\n constructor(@Inject(null) @Optional() state: C, @Inject(null) @Optional() defaultSourceMode?: DbxFirebaseComponentStoreWithParentSourceMode) {\n super(state);\n this.setSourceMode(defaultSourceMode || 'parent');\n }\n\n // MARK: Effects\n readonly setParentStore: DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD> = setParentStoreEffect(this);\n readonly setSourceMode: DbxFirebaseComponentStoreWithParentSetParentSourceModeFunction = this.effect((input: Observable<Maybe<DbxFirebaseComponentStoreWithParentSourceMode>>) => {\n return input.pipe(\n distinctUntilChanged(),\n switchMap((inputMode) => {\n const mode = inputMode?.toLowerCase() ?? 'parent'; // default to parent mode\n\n if (mode === 'group') {\n return this.currentCollectionGroup$.pipe(\n tap((collectionGroup) => {\n this.setFirestoreCollection(collectionGroup);\n })\n );\n } else {\n // parent document collection\n return this.currentParent$.pipe(\n switchMap((parent) => {\n if (parent) {\n return this.collectionFactory$.pipe(\n tap((collectionFactory) => {\n const collection = collectionFactory(parent);\n this.setFirestoreCollection(collection);\n })\n );\n } else {\n this.setFirestoreCollection(undefined);\n return NEVER;\n }\n })\n );\n }\n })\n );\n });\n\n // MARK: Accessors\n readonly currentParent$: Observable<Maybe<PD>> = this.state$.pipe(\n map((x) => x.parent),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly parent$: Observable<PD> = this.currentParent$.pipe(filterMaybe());\n\n readonly currentCollectionFactory$: Observable<Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>> = this.state$.pipe(\n map((x) => x.collectionFactory),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionFactory$: Observable<FirestoreCollectionWithParentFactory<T, PT, D, PD>> = this.currentCollectionFactory$.pipe(filterMaybe());\n\n readonly currentCollectionGroup$: Observable<Maybe<FirestoreCollectionGroup<T, D>>> = this.state$.pipe(\n map((x) => x.collectionGroup),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionGroup$: Observable<FirestoreCollectionGroup<T, D>> = this.currentCollectionGroup$.pipe(filterMaybe());\n\n // MARK: State Changes\n /**\n * Sets the collection factory function to use.\n */\n readonly setCollectionFactory = this.updater((state, collectionFactory: FirestoreCollectionWithParentFactory<T, PT, D, PD>) => ({ ...state, collectionFactory }));\n\n /**\n * Sets the collection group to use.\n */\n readonly setCollectionGroup = this.updater((state, collectionGroup: Maybe<FirestoreCollectionGroup<T, D>>) => ({ ...state, collectionGroup })) as (observableOrValue: Maybe<FirestoreCollectionGroup<T, D>> | Observable<Maybe<FirestoreCollectionGroup<T, D>>>) => Subscription;\n\n /**\n * Sets the parent on the current state.\n */\n readonly _setParentDocument = this.updater((state, parent: Maybe<PD>) => ({ ...state, parent }));\n readonly _setParent = this._setParentDocument as DbxFirebaseComponentStoreSetParentEffectFunction<PD>;\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Injectable } from '@angular/core';\nimport { Observable, shareReplay, distinctUntilChanged, map, NEVER, switchMap, tap, Subscription } from 'rxjs';\nimport { FirestoreDocument, FirestoreCollectionWithParentFactory, FirestoreCollection, DocumentReference, FirestoreModelId, FirestoreModelKey, SingleItemFirestoreCollection, firestoreModelKeyParentKey } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\nimport { AbstractDbxFirebaseDocumentStore , DbxFirebaseDocumentStoreContextState } from './store.document';\nimport { DbxFirebaseDocumentStore } from './store';\nimport { DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction, setParentStoreEffect, DbxFirebaseComponentStoreWithParent, DbxFirebaseComponentStoreWithParentContextState, DbxFirebaseComponentStoreWithParentSetParentEffectFunction } from './store.subcollection.rxjs';\n\nexport interface DbxFirebaseDocumentWithParentStoreContextState<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseDocumentStoreContextState<T, D>, DbxFirebaseComponentStoreWithParentContextState<T, PT, D, PD> {}\n\nexport interface DbxFirebaseDocumentWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseDocumentStore<T, D>, DbxFirebaseComponentStoreWithParent<T, PT, D, PD, FirestoreCollection<T, D>> {}\n\n/**\n * Abstract DbxFirebaseDocumentStore that has a parent document from which is derives it's FiresbaseCollection from.\n */\n@Injectable()\nexport class AbstractDbxFirebaseDocumentWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, C extends DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD> = DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD>> extends AbstractDbxFirebaseDocumentStore<T, D, C> implements DbxFirebaseDocumentWithParentStore<T, PT, D, PD> {\n // MARK: Effects\n readonly setParentStore: DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD> = setParentStoreEffect(this);\n readonly setParent: DbxFirebaseComponentStoreWithParentSetParentEffectFunction<PD> = this.effect((input: Observable<Maybe<PD>>) => {\n return input.pipe(\n switchMap((parent) => {\n this._setParentDocument(parent);\n\n if (parent) {\n return this.collectionFactory$.pipe(\n tap((collectionFactory) => {\n const collection = collectionFactory(parent);\n this.setFirestoreCollection(collection);\n })\n );\n } else {\n // clear the current collection\n this.setFirestoreCollection(undefined);\n\n // do nothing until a parent is returned.\n return NEVER;\n }\n })\n );\n });\n\n readonly _setParent = this.setParent;\n\n // MARK: Accessors\n /**\n * Returns the parent model key given the current key value.\n */\n readonly keyParentKey$ = this.key$.pipe(\n map((x) => firestoreModelKeyParentKey(x, 1)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentParent$: Observable<Maybe<PD>> = this.state$.pipe(\n map((x) => x.parent),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentParentKey$: Observable<Maybe<FirestoreModelKey>> = this.state$.pipe(\n map((x) => x.parent?.key),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly parent$: Observable<PD> = this.currentParent$.pipe(filterMaybe());\n readonly parentKey$: Observable<Maybe<FirestoreModelKey>> = this.currentParentKey$.pipe(filterMaybe());\n\n readonly currentCollectionFactory$: Observable<Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>> = this.state$.pipe(\n map((x) => x.collectionFactory),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionFactory$: Observable<FirestoreCollectionWithParentFactory<T, PT, D, PD>> = this.currentCollectionFactory$.pipe(filterMaybe());\n\n // MARK: State Changes\n /**\n * Sets the collection factory function to use.\n */\n readonly setCollectionFactory = this.updater((state, collectionFactory: FirestoreCollectionWithParentFactory<T, PT, D, PD>) => ({ ...state, collectionFactory }));\n\n /**\n * Sets the parent on the current state.\n */\n readonly _setParentDocument = this.updater((state, parent: Maybe<PD>) => ({ ...state, parent }));\n}\n\n/**\n * AbstractDbxFirebaseDocumentWithParentStore extension for use with SingleItemFirestoreCollection.\n */\nexport class AbstractSingleItemDbxFirebaseDocument<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, C extends DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD> = DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD>> extends AbstractDbxFirebaseDocumentWithParentStore<T, PT, D, PD, C> {\n /**\n * Sets the SingleItemFirestoreCollection to use.\n */\n override readonly setFirestoreCollection = this.updater((state, firestoreCollection: Maybe<FirestoreCollection<T, D>>) => {\n if (firestoreCollection != null) {\n const id = (firestoreCollection as SingleItemFirestoreCollection<T, PT, D, PD>).singleItemIdentifier;\n\n if (id != null) {\n return { ...state, firestoreCollection, id };\n } else {\n throw new Error('AbstractSingleItemDbxFirebaseDocument only accepts SingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');\n }\n } else {\n return { ...state, firestoreCollection: null };\n }\n });\n\n /**\n * Does nothing on a AbstractSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setId = this.updater((state, id: Maybe<FirestoreModelId>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setKey = this.updater((state, key: Maybe<FirestoreModelKey>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setRef = this.updater((state, ref: Maybe<DocumentReference<T>>) => state) as (observableOrValue: Maybe<DocumentReference<T>> | Observable<Maybe<DocumentReference<T>>>) => Subscription;\n override readonly clearRefs = this.updater((state) => state);\n}\n","import { Directive, forwardRef, model, Provider, Type } from '@angular/core';\nimport { FirestoreDocument } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from './store.collection.directive';\nimport { DbxFirebaseCollectionWithParentStore, DbxFirebaseComponentStoreWithParentSourceMode } from './store.subcollection';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { skipInitialMaybe } from '@dereekb/rxjs';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Abstract directive that contains a DbxFirebaseCollectionWithParentStore and provides an interface for communicating with other directives.\n */\n@Directive()\nexport abstract class DbxFirebaseCollectionWithParentStoreDirective<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, S extends DbxFirebaseCollectionWithParentStore<T, PT, D, PD> = DbxFirebaseCollectionWithParentStore<T, PT, D, PD>> extends DbxFirebaseCollectionStoreDirective<T, D, S> {\n readonly sourceMode = model<Maybe<DbxFirebaseComponentStoreWithParentSourceMode>>(undefined);\n\n private readonly _sourceMode$ = toObservable(this.sourceMode).pipe(skipInitialMaybe());\n\n constructor(store: S) {\n super(store);\n\n // sync inputs to store any time the store changes\n cleanSubscription(\n this.store$.subscribe((x) => {\n x.setSourceMode(this._sourceMode$);\n })\n );\n }\n\n // MARK: Inputs\n setSourceMode(sourceMode: Maybe<DbxFirebaseComponentStoreWithParentSourceMode>) {\n this.sourceMode.set(sourceMode);\n }\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// The use of any here does not degrade the type-safety; we want to simply match that the Store type S is used in the Directive type C to provide it.\n\n/**\n * Configures providers for a DbxFirebaseCollectionWithParentStoreDirective.\n *\n * Can optionally also provide the actual store type to include in the providers array so it is instantiated by Angular.\n *\n * @param sourceType\n */\nexport function provideDbxFirebaseCollectionWithParentStoreDirective<S extends DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, any>>(sourceType: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionWithParentStoreDirective<S extends DbxFirebaseCollectionWithParentStore<any, any, any, any>, C extends DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S> = DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionWithParentStoreDirective<S extends DbxFirebaseCollectionWithParentStore<any, any, any, any>, C extends DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S> = DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[] {\n const providers: Provider[] = [\n ...provideDbxFirebaseCollectionStoreDirective(sourceType, storeType),\n {\n provide: DbxFirebaseCollectionWithParentStoreDirective,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Directive } from '@angular/core';\nimport { provideDbxFirebaseDocumentStoreContextStore } from './store.document.context.store.link';\n\n/**\n * Directive that provides a DbxFirebaseDocumentStoreContextStore.\n */\n@Directive({\n selector: '[dbxFirebaseDocumentStoreContextStore]',\n providers: provideDbxFirebaseDocumentStoreContextStore(),\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreContextStoreDirective {}\n","import { inject, Injectable } from '@angular/core';\nimport { SystemState, SystemStateDocument, SystemStateFirestoreCollections } from '@dereekb/firebase';\nimport { AbstractDbxFirebaseCollectionStore } from '../modules/store/store.collection';\n\n@Injectable()\nexport class SystemStateCollectionStore extends AbstractDbxFirebaseCollectionStore<SystemState, SystemStateDocument> {\n constructor() {\n super({ firestoreCollection: inject(SystemStateFirestoreCollections).systemStateCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { SystemState, SystemStateDocument } from '@dereekb/firebase';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../modules/store/store.collection.directive';\nimport { SystemStateCollectionStore } from './systemstate.collection.store';\n\n@Directive({\n selector: '[dbxFirebaseSystemStateCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseSystemStateCollectionStoreDirective, SystemStateCollectionStore)\n})\nexport class DbxFirebaseSystemStateCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<SystemState, SystemStateDocument, SystemStateCollectionStore> {\n constructor() {\n super(inject(SystemStateCollectionStore));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { SystemState, SystemStateDocument, SystemStateFirestoreCollection, SystemStateFirestoreCollections, SystemStateStoredData } from '@dereekb/firebase';\nimport { AbstractDbxFirebaseDocumentStore } from '../modules/store/store.document';\n\n@Injectable()\nexport class SystemStateDocumentStore<T extends SystemStateStoredData = SystemStateStoredData> extends AbstractDbxFirebaseDocumentStore<SystemState<T>, SystemStateDocument<T>> {\n constructor() {\n super({ firestoreCollection: inject(SystemStateFirestoreCollections).systemStateCollection as SystemStateFirestoreCollection<T> });\n }\n}\n","import { SystemState, SystemStateStoredData, SystemStateTypeIdentifier } from '@dereekb/firebase';\nimport { LoadingState, mapLoadingState } from '@dereekb/rxjs';\nimport { map, Observable, shareReplay } from 'rxjs';\nimport { SystemStateDocumentStore } from './systemstate.document.store';\nimport { Inject, Injectable, Injector, Optional, inject } from '@angular/core';\nimport { newWithInjector } from '@dereekb/dbx-core';\n\n/**\n * Abstract class used for accessing a SystemStateDocumentStore's data.\n */\n@Injectable()\nexport abstract class AbstractSystemStateDocumentStoreAccessor<T extends SystemStateStoredData = SystemStateStoredData> {\n readonly systemStateDocumentStore = newWithInjector(SystemStateDocumentStore<T>, inject(Injector));\n\n readonly documentData$ = this.systemStateDocumentStore.data$;\n readonly data$: Observable<T> = this.documentData$.pipe(\n map((x) => x.data),\n shareReplay(1)\n );\n readonly dataState$: Observable<LoadingState<T>> = this.systemStateDocumentStore.dataLoadingState$.pipe(mapLoadingState({ mapValue: (x: SystemState<T>) => x.data }), shareReplay(1));\n readonly exists$ = this.systemStateDocumentStore.exists$;\n readonly doesNotExist$ = this.systemStateDocumentStore.doesNotExist$;\n\n readonly type$: Observable<SystemStateTypeIdentifier> = this.systemStateDocumentStore.id$;\n\n constructor(@Inject(null) @Optional() type: SystemStateTypeIdentifier) {\n this.systemStateDocumentStore.setId(type);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { SystemState, SystemStateDocument, SystemStateStoredData } from '@dereekb/firebase';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../modules/store/store.document.directive';\nimport { SystemStateDocumentStore } from './systemstate.document.store';\n\n@Directive({\n selector: '[dbxFirebaseSystemStateDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseSystemStateDocumentStoreDirective, SystemStateDocumentStore)\n})\nexport class DbxFirebaseSystemStateDocumentStoreDirective<T extends SystemStateStoredData = SystemStateStoredData> extends DbxFirebaseDocumentStoreDirective<SystemState<T>, SystemStateDocument<T>, SystemStateDocumentStore<T>> {\n constructor() {\n super(inject(SystemStateDocumentStore<T>));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseModelStoreModule } from './modules/store/model.store.module';\n\n@NgModule({\n exports: [DbxFirebaseModelStoreModule]\n})\nexport class DbxFirebaseModelModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { AppNotificationTemplateTypeInfoRecordService, NotificationItem, NotificationItemMetadata, NotificationItemSubjectMessagePair } from '@dereekb/firebase';\n\n/**\n * Client-side service used for retrieving notification templates.\n */\n@Injectable()\nexport class DbxFirebaseNotificationTemplateService {\n readonly appNotificationTemplateTypeInfoRecordService = inject(AppNotificationTemplateTypeInfoRecordService);\n\n notificationItemSubjectMessagePairForNotificationSummaryItem<D extends NotificationItemMetadata = {}>(item: NotificationItem<D>): NotificationItemSubjectMessagePair<D> {\n const templateType = item.t;\n const templateDetails = this.appNotificationTemplateTypeInfoRecordService.appNotificationTemplateTypeInfoRecord[templateType];\n\n const subject = item.s ?? templateDetails.name;\n const message = item.g ?? '';\n const date = item.cat;\n\n return {\n item,\n subject,\n message,\n date\n };\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, provideDbxListView, DbxValueAsListItem, provideDbxListViewWrapper, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, DbxListWrapperComponentImportsModule, DbxSelectionValueListViewComponentImportsModule } from '@dereekb/dbx-web';\nimport { NotificationItem } from '@dereekb/firebase';\nimport { cachedGetter } from '@dereekb/util';\nimport { of } from 'rxjs';\nimport { DbxFirebaseNotificationTemplateService } from '../service/notification.template.service';\nimport { DatePipe } from '@angular/common';\nimport { CutTextPipe } from '@dereekb/dbx-core';\n\nexport type NotificationItemWithSelection = DbxValueAsListItem<NotificationItem>;\n\n@Component({\n selector: 'dbx-firebase-notificationitem-list',\n template: DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxListWrapperComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListViewWrapper(DbxFirebaseNotificationItemListComponent),\n standalone: true\n})\nexport class DbxFirebaseNotificationItemListComponent extends AbstractDbxSelectionListWrapperDirective<NotificationItem> {\n constructor() {\n super({\n componentClass: DbxFirebaseNotificationItemListViewComponent,\n defaultSelectionMode: 'view'\n });\n }\n}\n\n@Component({\n selector: 'dbx-firebase-notificationitem-list-view',\n template: DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxSelectionValueListViewComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListView(DbxFirebaseNotificationItemListViewComponent),\n standalone: true\n})\nexport class DbxFirebaseNotificationItemListViewComponent extends AbstractDbxSelectionListViewDirective<NotificationItem> {\n readonly config: DbxSelectionValueListViewConfig<NotificationItemWithSelection> = {\n componentClass: DbxFirebaseNotificationItemListViewItemComponent,\n mapValuesToItemValues: (x) => of(x.map((y) => ({ ...y, icon: y.icon, itemValue: y })))\n };\n}\n\n@Component({\n template: `\n <div class=\"dbx-list-item-padded dbx-list-two-line-item dbx-firebase-notificationitem-list-view-item\">\n <div class=\"item-left\">\n <span class=\"notificationitem-subject\">{{ subject }}</span>\n <span class=\"notificationitem-message item-details\">{{ message | cutText: 90 }}</span>\n <span class=\"notificationitem-date item-details-footnote\">{{ date | date: 'medium' }}</span>\n </div>\n </div>\n `,\n imports: [DatePipe, CutTextPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseNotificationItemListViewItemComponent extends AbstractDbxValueListViewItemComponent<NotificationItem> {\n readonly dbxFirebaseNotificationTemplateService = inject(DbxFirebaseNotificationTemplateService);\n readonly pairGetter = cachedGetter(() => this.dbxFirebaseNotificationTemplateService.notificationItemSubjectMessagePairForNotificationSummaryItem(this.itemValue));\n\n get subject() {\n return this.pairGetter().subject;\n }\n\n get message() {\n return this.pairGetter().message;\n }\n\n get date() {\n return this.pairGetter().date;\n }\n}\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Component({\n selector: 'dbx-firebase-notificationitem-content',\n templateUrl: './notificationitem.content.component.html',\n styleUrls: ['./notificationitem.content.scss'],\n imports: [DatePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseNotificationItemContentComponent {\n readonly subject = input<Maybe<string>>();\n readonly message = input<Maybe<string>>();\n readonly date = input<Maybe<Date>>();\n}\n","<div class=\"dbx-firebase-notificationitem-content\">\n <div class=\"notificationitem-header dbx-pb2\">\n @if (subject()) {\n <div class=\"notificationitem-subject dbx-pb1\">{{ subject() }}</div>\n }\n <ng-content select=\"[header]\"></ng-content>\n @if (date()) {\n <div class=\"notificationitem-date dbx-label dbx-small\">{{ date() | date: 'medium' }}</div>\n }\n </div>\n <ng-content select=\"[premessage]\"></ng-content>\n <div class=\"notificationitem-message\">{{ message() }}</div>\n <ng-content></ng-content>\n</div>\n","import { type DbxWidgetEntry, type DbxWidgetType } from '@dereekb/dbx-web';\nimport { type NotificationTemplateType, type NotificationTemplateTypeInfo } from '@dereekb/firebase';\n\n/**\n * Prefix used by all widgets.\n *\n * Does not include the \"-\" between the prefix and the template type returned by dbxWidgetTypeForNotificationTemplateType().\n */\nexport const FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX: string = 'dbxFirebaseNotificationItem';\n\nexport const DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE: DbxWidgetType = `${FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX}Default`;\n\nexport function dbxWidgetTypeForNotificationTemplateType(notificationTemplateType: NotificationTemplateType): DbxWidgetType {\n return `${FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX}-${notificationTemplateType}`;\n}\n\n/**\n * Used for registering a DbxFirebaseNotificationItemWidgetEntry.\n *\n * The notificationTemplateType should be known by the app, otherwise a warning may be thrown.\n */\nexport interface DbxFirebaseNotificationItemWidgetEntryRegistration extends Omit<DbxWidgetEntry, 'type'> {\n readonly notificationTemplateType: NotificationTemplateType;\n}\n\n/**\n * A widget used for DbxFirebaseNotificationItem views.\n */\nexport interface DbxFirebaseNotificationItemWidgetEntry {\n readonly notificationTemplateType: NotificationTemplateType;\n readonly notificationTemplateTypeInfo: NotificationTemplateTypeInfo;\n readonly widget: DbxWidgetEntry;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { NotificationTemplateType } from '@dereekb/firebase';\nimport { DbxFirebaseNotificationTemplateService } from './notification.template.service';\nimport { DbxWidgetEntry, DbxWidgetService } from '@dereekb/dbx-web';\nimport { DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE, DbxFirebaseNotificationItemWidgetEntry, DbxFirebaseNotificationItemWidgetEntryRegistration, dbxWidgetTypeForNotificationTemplateType } from './notificationitem.widget';\n\n/**\n * Service used for registering widgets used for notification items.\n */\n@Injectable()\nexport class DbxFirebaseNotificationItemWidgetService {\n readonly dbxWidgetService = inject(DbxWidgetService);\n readonly dbxFirebaseNotificationTemplateService = inject(DbxFirebaseNotificationTemplateService);\n\n private readonly _entries = new Map<NotificationTemplateType, DbxFirebaseNotificationItemWidgetEntry>();\n\n /**\n * Used to register a item widget. If widget for the given type is already registered, this will override it by default.\n *\n * @param provider\n * @param override\n */\n register(provider: DbxFirebaseNotificationItemWidgetEntryRegistration, override: boolean = true): boolean {\n const { componentClass, notificationTemplateType } = provider;\n const widgetType = dbxWidgetTypeForNotificationTemplateType(notificationTemplateType);\n\n if (override || !this._entries.has(notificationTemplateType)) {\n const notificationTemplateTypeInfo = this.dbxFirebaseNotificationTemplateService.appNotificationTemplateTypeInfoRecordService.appNotificationTemplateTypeInfoRecord[notificationTemplateType];\n\n if (!notificationTemplateTypeInfo) {\n console.warn(`DbxFirebaseNotificationItemWidgetService.register(): No known template type info was found for notification type: ${notificationTemplateType}. The entry is not being registered.`);\n } else {\n const entry: DbxFirebaseNotificationItemWidgetEntry = {\n notificationTemplateType,\n notificationTemplateTypeInfo,\n widget: {\n type: widgetType,\n componentClass\n }\n };\n\n this._entries.set(notificationTemplateType, entry);\n this.dbxWidgetService.register(entry.widget, override);\n return true;\n }\n }\n\n return false;\n }\n\n registerDefaultWidget(entry: Omit<DbxWidgetEntry, 'type'>, override: boolean = true): boolean {\n return this.dbxWidgetService.register(\n {\n ...entry,\n type: DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE\n },\n override\n );\n }\n}\n","import { ChangeDetectionStrategy, Component, input, computed } from '@angular/core';\nimport { DbxWidgetViewComponentConfig, DbxWidgetViewComponent } from '@dereekb/dbx-web';\nimport { NotificationItem, NotificationItemMetadata } from '@dereekb/firebase';\nimport { Maybe } from '@dereekb/util';\nimport { DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE, dbxWidgetTypeForNotificationTemplateType } from '../service';\n\n@Component({\n selector: 'dbx-firebase-notificationitem-view',\n template: `\n <dbx-widget-view [config]=\"configSignal()\"></dbx-widget-view>\n `,\n standalone: true,\n imports: [DbxWidgetViewComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseNotificationItemViewComponent<D extends NotificationItemMetadata = {}> {\n readonly item = input<Maybe<NotificationItem<D>>>();\n\n readonly configSignal = computed(() => {\n const data = this.item();\n\n let config: Maybe<DbxWidgetViewComponentConfig> = undefined;\n\n if (data) {\n const type = dbxWidgetTypeForNotificationTemplateType(data.t);\n\n config = {\n type,\n data,\n defaultType: DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE\n };\n }\n\n return config;\n });\n}\n","import { Directive } from '@angular/core';\nimport { AbstractDbxWidgetComponent } from '@dereekb/dbx-web';\nimport { NotificationItem, NotificationItemMetadata } from '@dereekb/firebase';\n\n@Directive()\nexport abstract class AbstractDbxFirebaseNotificationItemWidgetComponent<D extends NotificationItemMetadata = {}> extends AbstractDbxWidgetComponent<NotificationItem<D>> {\n get notificationItem(): NotificationItem<D> {\n return this.data;\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractDbxFirebaseNotificationItemWidgetComponent } from './notificationitem.view.directive';\nimport { DbxFirebaseNotificationItemContentComponent } from './notificationitem.content.component';\n\n@Component({\n selector: 'dbx-firebase-notificationitem-view-default',\n template: '<dbx-firebase-notificationitem-content [subject]=\"subject\" [message]=\"message\" [date]=\"date\"></dbx-firebase-notificationitem-content>',\n imports: [DbxFirebaseNotificationItemContentComponent],\n standalone: true\n})\nexport class DbxFirebaseNotificationItemDefaultViewComponent extends AbstractDbxFirebaseNotificationItemWidgetComponent {\n get subject() {\n return this.notificationItem.s;\n }\n\n get message() {\n return this.notificationItem.g;\n }\n\n get date() {\n return this.notificationItem.cat;\n }\n}\n","import { ChangeDetectionStrategy, Component, ElementRef } from '@angular/core';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { AbstractPopoverDirective, AnchorForValueFunction, DbxListEmptyContentComponent, DbxListItemAnchorModifierDirective, DbxListModifierModule, DbxPopoverInteractionModule, DbxPopoverKey, DbxPopoverService } from '@dereekb/dbx-web';\nimport { type Maybe } from '@dereekb/util';\nimport { NotificationItem } from '@dereekb/firebase';\nimport { Observable } from 'rxjs';\nimport { LoadingState } from '@dereekb/rxjs';\nimport { DbxFirebaseNotificationItemListComponent } from '../component';\n\nexport interface DbxFirebaseNotificationItemStorePopoverParams {\n /**\n * Custom icon\n *\n * Defaults to \"history\"\n */\n readonly icon?: string;\n /**\n * Custom header text\n *\n * Defaults to \"History\"\n */\n readonly header?: string;\n /**\n * Custom empty text when no items exist.\n */\n readonly emptyText?: string;\n /**\n * Origin to add the popover to.\n */\n readonly origin: ElementRef;\n /**\n * Items loading state.\n */\n readonly notificationItemsLoadingState$: Observable<LoadingState<NotificationItem[]>>;\n /**\n * Anchor\n */\n readonly makeNotificationItemAnchor?: Maybe<AnchorForValueFunction<NotificationItem>>;\n}\n\nexport const DEFAULT_DBX_FIREBASE_NOTIFICATION_ITEM_STORE_POPOVER_KEY = 'notification-item-store-notifications';\n\n@Component({\n templateUrl: './notification.item.store.popover.component.html',\n imports: [DbxPopoverInteractionModule, DbxListModifierModule, DbxFirebaseNotificationItemListComponent, DbxListEmptyContentComponent, DbxListItemAnchorModifierDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseNotificationItemStorePopoverComponent extends AbstractPopoverDirective<unknown, DbxFirebaseNotificationItemStorePopoverParams> {\n static openPopover(popupService: DbxPopoverService, { origin, header, icon, emptyText, makeNotificationItemAnchor, notificationItemsLoadingState$ }: DbxFirebaseNotificationItemStorePopoverParams, popoverKey?: DbxPopoverKey): NgPopoverRef {\n return popupService.open({\n key: popoverKey ?? DEFAULT_DBX_FIREBASE_NOTIFICATION_ITEM_STORE_POPOVER_KEY,\n origin,\n componentClass: DbxFirebaseNotificationItemStorePopoverComponent,\n data: {\n header,\n icon,\n emptyText,\n notificationItemsLoadingState$,\n makeNotificationItemAnchor\n }\n });\n }\n\n readonly params = this.popover.data as DbxFirebaseNotificationItemStorePopoverParams;\n readonly icon = this.params.icon ?? 'notifications';\n readonly header = this.params.header ?? 'Notifications';\n readonly emptyText = this.params.header ?? 'There are no notifications.';\n readonly makeNotificationItemAnchor = this.params.makeNotificationItemAnchor;\n readonly notificationItemsLoadingState$ = this.params.notificationItemsLoadingState$;\n}\n","<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-notificationitem-list [state]=\"notificationItemsLoadingState$\" dbxListItemModifier [dbxListItemAnchorModifier]=\"makeNotificationItemAnchor\">\n <dbx-list-empty-content empty>\n <p>{{ emptyText }}</p>\n </dbx-list-empty-content>\n </dbx-firebase-notificationitem-list>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n","import { Injectable } from '@angular/core';\nimport { NotificationId, NotificationItem } from '@dereekb/firebase';\nimport { Maybe } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { combineLatest, distinctUntilChanged, map, shareReplay } from 'rxjs';\n\nexport interface DbxFirebaseNotificationItemStoreState {\n /**\n * The NotificationSummary to pull items from\n */\n readonly items: NotificationItem[];\n /**\n * The currently selected id\n */\n readonly selectedId: Maybe<NotificationId>;\n}\n\n/**\n * Store used for selecting a specific NotificationItem from a list of notification items.\n */\n@Injectable()\nexport class DbxFirebaseNotificationItemStore extends ComponentStore<DbxFirebaseNotificationItemStoreState> {\n constructor() {\n super({\n items: [],\n selectedId: undefined\n });\n }\n\n // MARK: Accessors\n readonly items$ = this.select((state) => state.items);\n\n readonly selectedId$ = this.select((state) => state.selectedId).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly selectedItem$ = combineLatest([this.items$, this.selectedId$]).pipe(\n map(([items, selectedId]) => {\n return items.find((item) => item.id === selectedId);\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n readonly setItems = this.updater((state, items: NotificationItem[]) => ({ ...state, items }));\n readonly setSelectedId = this.updater((state, selectedId: Maybe<NotificationId>) => ({ ...state, selectedId }));\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, viewChild } from '@angular/core';\nimport { AbstractPopoverRefDirective, DbxIconButtonComponent, DbxPopoverService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseNotificationItemStorePopoverComponent, DbxFirebaseNotificationItemStorePopoverParams } from './notification.item.store.popover.component';\nimport { DbxFirebaseNotificationItemStore } from '../store/notification.item.store';\nimport { loadingStateFromObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\nexport type DbxFirebaseNotificationItemStorePopoverButtonConfig = DbxFirebaseNotificationItemStorePopoverParams;\n\n@Component({\n selector: 'dbx-firebase-notification-item-store-popover-button',\n template: `\n <dbx-icon-button #button (buttonClick)=\"showNotificationsPopover()\" icon=\"notifications\"></dbx-icon-button>\n `,\n standalone: true,\n imports: [DbxIconButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseNotificationItemStorePopoverButtonComponent extends AbstractPopoverRefDirective<unknown, unknown> {\n private readonly _dbxPopoverService = inject(DbxPopoverService);\n private readonly _dbxFirebaseNotificationItemStore = inject(DbxFirebaseNotificationItemStore, { optional: true });\n\n readonly buttonElement = viewChild<string, Maybe<ElementRef>>('button', { read: ElementRef });\n readonly config = input<Maybe<Partial<DbxFirebaseNotificationItemStorePopoverButtonConfig>>>();\n\n showNotificationsPopover(): void {\n const origin = this.buttonElement()?.nativeElement;\n this.showPopover(origin);\n }\n\n protected override _makePopoverRef(origin?: ElementRef): NgPopoverRef<unknown, unknown> {\n const config = this.config();\n const notificationItemsLoadingState$ = config?.notificationItemsLoadingState$ ?? (this._dbxFirebaseNotificationItemStore != null ? loadingStateFromObs(this._dbxFirebaseNotificationItemStore.items$) : undefined);\n\n if (!origin) {\n throw new Error('Missing origin.');\n } else if (!notificationItemsLoadingState$) {\n throw new Error('Missing notificationItemsLoadingState$.');\n }\n\n return DbxFirebaseNotificationItemStorePopoverComponent.openPopover(this._dbxPopoverService, {\n origin,\n notificationItemsLoadingState$,\n ...config\n });\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { isSameDate } from '@dereekb/date';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationFunctions, NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs';\n\n@Injectable()\nexport class NotificationBoxDocumentStore extends AbstractDbxFirebaseDocumentStore<NotificationBox, NotificationBoxDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationBoxCollection });\n }\n\n readonly createdAt$ = this.data$.pipe(\n map((x) => x.cat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly recipients$ = this.data$.pipe(\n map((x) => x.r),\n shareReplay(1)\n );\n\n readonly updateNotificationBox = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationBox.updateNotificationBox.update);\n readonly updateNotificationBoxRecipient = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationBox.updateNotificationBox.recipient);\n}\n","import { Injectable, inject } from '@angular/core';\nimport { firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store/store.document.crud';\nimport { AbstractDbxFirebaseDocumentWithParentStore } from '../../../model/modules/store/store.subcollection.document';\nimport { NotificationBoxDocumentStore } from './notificationbox.document.store';\nimport { Notification, NotificationBox, NotificationBoxDocument, NotificationDocument, NotificationFirestoreCollections, NotificationFunctions } from '@dereekb/firebase';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs';\nimport { isSameDate } from '@dereekb/date';\n\n@Injectable()\nexport class NotificationDocumentStore extends AbstractDbxFirebaseDocumentWithParentStore<Notification, NotificationBox, NotificationDocument, NotificationBoxDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ collectionFactory: inject(NotificationFirestoreCollections).notificationCollectionFactory, firestoreCollectionLike: inject(NotificationFirestoreCollections).notificationCollectionGroup });\n const parent = inject(NotificationBoxDocumentStore, { optional: true });\n\n if (parent) {\n this.setParentStore(parent);\n }\n }\n\n readonly createdAt$ = this.data$.pipe(\n map((x) => x.cat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly nextSendAt$ = this.data$.pipe(\n map((x) => x.sat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly sendType$ = this.data$.pipe(\n map((x) => x.st),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly sendAttemptsCount$ = this.data$.pipe(\n map((x) => x.a),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isUnique$ = this.data$.pipe(\n map((x) => x.ut),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly sendNotification = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notification.updateNotification.send);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store/store.document.directive';\nimport { type Notification, type NotificationDocument } from '@dereekb/firebase';\nimport { NotificationDocumentStore } from './notification.document.store';\n\n@Directive({\n selector: '[dbxFirebaseNotificationDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationDocumentStoreDirective, NotificationDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<Notification, NotificationDocument, NotificationDocumentStore> {\n constructor() {\n super(inject(NotificationDocumentStore));\n }\n}\n","import { Optional, Injectable , inject } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionWithParentStore } from '../../../model/modules/store/store.subcollection';\nimport { NotificationFirestoreCollections, type NotificationBox, type NotificationBoxDocument, type Notification, type NotificationDocument } from '@dereekb/firebase';\nimport { NotificationBoxDocumentStore } from './notificationbox.document.store';\n\n@Injectable()\nexport class NotificationCollectionStore extends AbstractDbxFirebaseCollectionWithParentStore<Notification, NotificationBox, NotificationDocument, NotificationBoxDocument> {\n constructor(@Optional() parent: NotificationBoxDocumentStore) {\n super({ collectionFactory: inject(NotificationFirestoreCollections).notificationCollectionFactory, collectionGroup: inject(NotificationFirestoreCollections).notificationCollectionGroup });\n\n if (parent) {\n this.setParentStore(parent);\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { type NotificationBox, type NotificationBoxDocument, type Notification, type NotificationDocument } from '@dereekb/firebase';\nimport { NotificationCollectionStore } from './notification.collection.store';\nimport { DbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective } from '../../../model/modules/store/store.subcollection.directive';\n\n@Directive({\n selector: '[dbxFirebaseNotificationCollection]',\n providers: provideDbxFirebaseCollectionWithParentStoreDirective(DbxFirebaseNotificationCollectionStoreDirective, NotificationCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationCollectionStoreDirective extends DbxFirebaseCollectionWithParentStoreDirective<Notification, NotificationBox, NotificationDocument, NotificationBoxDocument, NotificationCollectionStore> {\n constructor() {\n super(inject(NotificationCollectionStore));\n }\n}\n","import { inject, Directive } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { NotificationBoxDocumentStore } from './notificationbox.document.store';\nimport { NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationBoxDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationBoxDocumentStoreDirective, NotificationBoxDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationBoxDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<NotificationBox, NotificationBoxDocument, NotificationBoxDocumentStore> {\n constructor() {\n super(inject(NotificationBoxDocumentStore));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationBoxCollectionStore extends AbstractDbxFirebaseCollectionStore<NotificationBox, NotificationBoxDocument> {\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationBoxCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { NotificationBoxCollectionStore } from './notificationbox.collection.store';\nimport { NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\n\n@Directive({\n selector: '[dbxFirebaseNotificationBoxCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseNotificationBoxCollectionStoreDirective, NotificationBoxCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationBoxCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<NotificationBox, NotificationBoxDocument, NotificationBoxCollectionStore> {\n constructor() {\n super(inject(NotificationBoxCollectionStore));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationSummary, NotificationSummaryDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationSummaryCollectionStore extends AbstractDbxFirebaseCollectionStore<NotificationSummary, NotificationSummaryDocument> {\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationSummaryCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\nimport { NotificationSummaryCollectionStore } from './notificationsummary.collection.store';\nimport { NotificationSummary, NotificationSummaryDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationSummaryCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseNotificationSummaryCollectionStoreDirective, NotificationSummaryCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationSummaryCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<NotificationSummary, NotificationSummaryDocument, NotificationSummaryCollectionStore> {\n constructor() {\n super(inject(NotificationSummaryCollectionStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { isSameDate } from '@dereekb/date';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationFunctions, NotificationItem, NotificationItemMetadata, NotificationSummary, NotificationSummaryDocument, UnreadNotificationItemsResult, unreadNotificationItems } from '@dereekb/firebase';\nimport { LoadingState, ObservableOrValue, asObservable, mapLoadingStateValueWithOperator } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { map, shareReplay, distinctUntilChanged, Observable, combineLatest } from 'rxjs';\n\n@Injectable()\nexport class NotificationSummaryDocumentStore extends AbstractDbxFirebaseDocumentStore<NotificationSummary, NotificationSummaryDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationSummaryCollection });\n }\n\n readonly notificationItemsLoadingState$: Observable<LoadingState<NotificationItem<any>[]>> = this.dataLoadingState$.pipe(\n mapLoadingStateValueWithOperator(map((x) => [...x.n].reverse())), // n is sorted in ascending order\n shareReplay(1)\n );\n\n readonly createdAt$ = this.data$.pipe(\n map((x) => x.cat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly lastReadAt$ = this.data$.pipe(\n map((x) => x.rat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly lastUpdateAt$ = this.data$.pipe(\n map((x) => x.lat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly notificationItems$ = this.data$.pipe(\n map((x) => [...x.n].reverse()), // n is sorted in ascending order\n shareReplay(1)\n );\n\n readonly needsSync$ = this.data$.pipe(\n map((x) => x.s),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n notificationItemsLoadingState<D extends NotificationItemMetadata = {}>(): Observable<LoadingState<NotificationItem<D>[]>> {\n return this.notificationItemsLoadingState$;\n }\n\n unreadNotificationItems<D extends NotificationItemMetadata = {}>(checkLastReadIfCreatedBeforeObs?: ObservableOrValue<Maybe<Date>>): Observable<UnreadNotificationItemsResult<D>> {\n return combineLatest([asObservable(checkLastReadIfCreatedBeforeObs), this.notificationItems$ as Observable<NotificationItem<D>[]>]).pipe(map(([c, items]) => unreadNotificationItems<D>(items, c)));\n }\n\n readonly updateNotificationSummary = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationSummary.updateNotificationSummary.update);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { NotificationSummaryDocumentStore } from './notificationsummary.document.store';\nimport { NotificationSummary, NotificationSummaryDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationSummaryDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationSummaryDocumentStoreDirective, NotificationSummaryDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationSummaryDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<NotificationSummary, NotificationSummaryDocument, NotificationSummaryDocumentStore> {\n constructor() {\n super(inject(NotificationSummaryDocumentStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationUserCollectionStore extends AbstractDbxFirebaseCollectionStore<NotificationUser, NotificationUserDocument> {\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationUserCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\nimport { NotificationUserCollectionStore } from './notificationuser.collection.store';\nimport { NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationUserCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseNotificationUserCollectionStoreDirective, NotificationUserCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationUserCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<NotificationUser, NotificationUserDocument, NotificationUserCollectionStore> {\n constructor() {\n super(inject(NotificationUserCollectionStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationFunctions, NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationUserDocumentStore extends AbstractDbxFirebaseDocumentStore<NotificationUser, NotificationUserDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationUserCollection });\n }\n\n readonly updateNotificationUser = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationUser.updateNotificationUser.update);\n readonly resyncNotificationUser = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationUser.updateNotificationUser.resync);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { NotificationUserDocumentStore } from './notificationuser.document.store';\nimport { NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationUserDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationUserDocumentStoreDirective, NotificationUserDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationUserDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<NotificationUser, NotificationUserDocument, NotificationUserDocumentStore> {\n constructor() {\n super(inject(NotificationUserDocumentStore));\n }\n}\n","import { inject, type EnvironmentProviders, makeEnvironmentProviders, provideAppInitializer, type Provider } from '@angular/core';\nimport { AppNotificationTemplateTypeInfoRecordService } from '@dereekb/firebase';\nimport { DbxFirebaseNotificationTemplateService } from './service/notification.template.service';\nimport { DbxFirebaseNotificationItemWidgetService } from './service/notificationitem.widget.service';\nimport { DbxFirebaseNotificationItemDefaultViewComponent } from './component/notificationitem.view.default.component';\nimport { type DbxWidgetEntry } from '@dereekb/dbx-web';\n\n/**\n * Configuration for DbxFirebaseNotificationModule.\n */\nexport interface ProvideDbxFirebaseNotificationsConfig {\n readonly appNotificationTemplateTypeInfoRecordService: AppNotificationTemplateTypeInfoRecordService;\n /**\n * The default notification item widget to register with the DbxFirebaseNotificationItemWidgetService.\n *\n * If not defined, will automatically register the default widget.\n *\n * If false, will not register anything.\n */\n readonly defaultNotificationItemWidget?: DbxWidgetEntry['componentClass'] | false;\n}\n\n/**\n * Creates EnvironmentProviders that provides a DbxFirebaseNotificationTemplateService, DbxFirebaseNotificationItemWidgetService and AppNotificationTemplateTypeInfoRecordService.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseNotifications(config: ProvideDbxFirebaseNotificationsConfig): EnvironmentProviders {\n const { appNotificationTemplateTypeInfoRecordService } = config;\n\n const providers: (EnvironmentProviders | Provider)[] = [\n {\n provide: AppNotificationTemplateTypeInfoRecordService,\n useValue: appNotificationTemplateTypeInfoRecordService\n },\n {\n provide: DbxFirebaseNotificationItemWidgetService,\n useClass: DbxFirebaseNotificationItemWidgetService\n },\n {\n provide: DbxFirebaseNotificationTemplateService,\n useClass: DbxFirebaseNotificationTemplateService\n },\n // service initialization\n provideAppInitializer(() => {\n const dbxFirebaseNotificationItemWidgetService = inject(DbxFirebaseNotificationItemWidgetService);\n\n // register the default widget\n if (config.defaultNotificationItemWidget !== false) {\n const widget = config.defaultNotificationItemWidget ?? DbxFirebaseNotificationItemDefaultViewComponent;\n\n dbxFirebaseNotificationItemWidgetService.registerDefaultWidget({\n componentClass: widget\n });\n }\n })\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { StorageAccessor } from '@dereekb/dbx-core';\nimport { map, mergeMap, catchError, Observable, of, switchMap, first } from 'rxjs';\nimport { FirebaseAuthUserId, firestoreModelId, FirestoreModelIdInput, StorageFileId, StorageFileSignedDownloadUrl } from '@dereekb/firebase';\nimport { DbxFirebaseAuthService } from '../../../auth/service/firebase.auth.service';\nimport { ContentTypeMimeType, Maybe, splitJoinRemainder, UnixDateTimeSecondsNumber } from '@dereekb/util';\n\nexport interface DbxFirebaseStorageFileDownloadUrlPair {\n readonly id: StorageFileId;\n readonly downloadUrl: StorageFileSignedDownloadUrl;\n /**\n * Mime type, if available.\n */\n readonly mimeType?: Maybe<ContentTypeMimeType>;\n /**\n * Expiration in seconds since epoch.\n */\n readonly expiresAt: UnixDateTimeSecondsNumber;\n}\n\nexport type DbxFirebaseStorageFileDownloadUrlPairString = `${UnixDateTimeSecondsNumber}_${StorageFileSignedDownloadUrl}`;\n\nexport type DbxFirebaseStorageFileDownloadUrlPairsRecord = Record<StorageFileId, DbxFirebaseStorageFileDownloadUrlPairString>;\n\nexport interface DbxFirebaseStorageFileDownloadUserCache {\n readonly uid: FirebaseAuthUserId;\n readonly pairs: DbxFirebaseStorageFileDownloadUrlPairsRecord;\n}\n\n/**\n * Token that corresponds to a StorageAccessor<DbxFirebaseStorageFileDownloadUserCache> that is used by DbxModelViewTrackerStorage.\n */\nexport const DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN = new InjectionToken('DbxFirebaseStorageFileDownloadStorageAccessor');\n\n/**\n * Used for managing DbxModelViewTrackerEvent storage.\n */\n@Injectable()\nexport class DbxFirebaseStorageFileDownloadStorage {\n static readonly DEFAULT_MAX_DOWNLOAD_URLS = 100;\n\n readonly authService = inject(DbxFirebaseAuthService);\n readonly storageAccessor = inject<StorageAccessor<DbxFirebaseStorageFileDownloadUserCache>>(DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN);\n\n addDownloadUrl({ id, downloadUrl, expiresAt, mimeType }: DbxFirebaseStorageFileDownloadUrlPair): Observable<void> {\n return this.getCurrentUserDownloadCache().pipe(\n mergeMap((cache) => {\n const { uid, pairs: currentPairs } = cache;\n\n const storageKey = this.getStorageKeyForUid(uid);\n const pairs: DbxFirebaseStorageFileDownloadUrlPairsRecord = {\n ...currentPairs,\n [id]: `${expiresAt}_${mimeType}_${downloadUrl}`\n };\n\n return this.storageAccessor.set(storageKey, {\n uid,\n pairs\n });\n }),\n first()\n );\n }\n\n /**\n * Returns the cached download URL pair for the given key.\n *\n * The pair may be expired.\n *\n * @param key\n * @returns\n */\n getDownloadUrlPair(input: FirestoreModelIdInput): Observable<DbxFirebaseStorageFileDownloadUrlPair | undefined> {\n const id = firestoreModelId(input);\n return this.authService.uid$.pipe(\n switchMap((uid) => {\n return this.getUserDownloadCache(uid).pipe(\n map((cache) => {\n const pair = cache?.pairs[id];\n\n let result: DbxFirebaseStorageFileDownloadUrlPair | undefined;\n\n if (pair) {\n const [expiresAt, mimeType, downloadUrl] = splitJoinRemainder(pair, '_', 3);\n\n result = {\n id,\n downloadUrl,\n expiresAt: Number(expiresAt),\n mimeType\n };\n }\n\n return result;\n })\n );\n }),\n first()\n );\n }\n\n getAllDownloadUrlPairsRecord(uid: FirebaseAuthUserId): Observable<DbxFirebaseStorageFileDownloadUrlPairsRecord> {\n return this.getUserDownloadCache(uid).pipe(map((x) => x.pairs));\n }\n\n getCurrentUserDownloadCache(): Observable<DbxFirebaseStorageFileDownloadUserCache> {\n return this.authService.uid$.pipe(switchMap((uid) => this.getUserDownloadCache(uid)));\n }\n\n getUserDownloadCache(uid: FirebaseAuthUserId): Observable<DbxFirebaseStorageFileDownloadUserCache> {\n const storageKey = this.getStorageKeyForUid(uid);\n return this._getUserDownloadCacheForStorageKey(storageKey, uid);\n }\n\n clearCurrentUserDownloadCache(): Observable<void> {\n return this.authService.uid$.pipe(switchMap((uid) => this.clearUserDownloadCache(uid)));\n }\n\n clearUserDownloadCache(uid: FirebaseAuthUserId): Observable<void> {\n const storageKey = this.getStorageKeyForUid(uid);\n return this.storageAccessor.remove(storageKey);\n }\n\n private _getUserDownloadCacheForStorageKey(storageKey: string, uid: FirebaseAuthUserId): Observable<DbxFirebaseStorageFileDownloadUserCache> {\n return this.storageAccessor.get(storageKey).pipe(\n catchError((e) => {\n return of(undefined);\n }),\n map((result) => result ?? { uid, pairs: {} })\n );\n }\n\n getStorageKeyForUid(uid: FirebaseAuthUserId): string {\n const storageKey = `sf_dl_cache_${uid}`;\n return storageKey;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { StorageFileFunctions, DownloadStorageFileParams, StorageFileKey, StorageFileId, firestoreModelId, firestoreModelKey, storageFileIdentity, DownloadStorageFileResult } from '@dereekb/firebase';\nimport { addMilliseconds, Maybe, Milliseconds, MS_IN_DAY, MS_IN_HOUR, MS_IN_MINUTE, Seconds, SECONDS_IN_MINUTE, unixDateTimeSecondsNumberForNow, unixDateTimeSecondsNumberFromDate } from '@dereekb/util';\nimport { DbxFirebaseStorageFileDownloadStorage, DbxFirebaseStorageFileDownloadUrlPair } from './storagefile.download.storage.service';\nimport { first, firstValueFrom, from, interval, map, Observable, of, shareReplay, startWith, switchMap, tap } from 'rxjs';\nimport { LoadingState, throwErrorFromLoadingStateError, valueFromFinishedLoadingState } from '@dereekb/rxjs';\n\nexport type DbxFirebaseStorageFileDownloadServiceCustomSourceDownloadFunction = (params: DownloadStorageFileParams, storageFileId: StorageFileId) => Promise<DownloadStorageFileResult>;\n\n/**\n * Used as a custom source for downloading StorageFiles.\n */\nexport interface DbxFirebaseStorageFileDownloadServiceCustomSource {\n /**\n * Retrieves the download result for the StorageFile using the input parameters.\n *\n * @param storageFileId\n * @returns\n */\n downloadStorageFileResult: DbxFirebaseStorageFileDownloadServiceCustomSourceDownloadFunction;\n}\n\nexport function dbxFirebaseStorageFileDownloadServiceCustomSourceFromObs(obsForInput: (params: DownloadStorageFileParams, storageFileId: StorageFileId) => Observable<LoadingState<DownloadStorageFileResult>>): DbxFirebaseStorageFileDownloadServiceCustomSource {\n return {\n downloadStorageFileResult: (params: DownloadStorageFileParams, storageFileId: StorageFileId) => firstValueFrom(obsForInput(params, storageFileId).pipe(throwErrorFromLoadingStateError(), valueFromFinishedLoadingState())) as Promise<DownloadStorageFileResult>\n };\n}\n\n/**\n * Service used for retrieving download links for StorageFiles.\n */\n@Injectable()\nexport class DbxFirebaseStorageFileDownloadService {\n /**\n * Expiration duration for cached download URLs.\n */\n protected _expiresAfterTime: Milliseconds = MS_IN_HOUR * 12;\n\n /**\n * When reading cached values, this buffer is added to the expiration time to prevent the URL from expiring while it is being used.\n */\n protected _expiresAfterTimeBuffer: Seconds = SECONDS_IN_MINUTE * 10;\n\n readonly storageFileFunctions = inject(StorageFileFunctions);\n readonly storageFileDownloadStorage = inject(DbxFirebaseStorageFileDownloadStorage);\n\n // MARK: Config\n getExpiresAfterTime(): number {\n return this._expiresAfterTime;\n }\n\n setExpiresAfterTime(expiresAfter: number): void {\n const maxAllowed = MS_IN_DAY * 20;\n\n if (expiresAfter > maxAllowed) {\n throw new Error(`Expires after time cannot be greater than 20 days.`);\n } else if (expiresAfter < MS_IN_HOUR) {\n throw new Error(`Expires after time cannot be less than 1 hour.`);\n }\n\n this._expiresAfterTime = expiresAfter;\n }\n\n // MARK: Download\n /**\n * Returns an observable that returns the cached download URL pair for the StorageFile, and emits null once it expires.\n *\n * @param storageFileIdOrKey\n * @returns\n */\n getCachedDownloadPairForStorageFile(storageFileIdOrKey: StorageFileId | StorageFileKey): Observable<Maybe<DbxFirebaseStorageFileDownloadUrlPair>> {\n const storageFileId = firestoreModelId(storageFileIdOrKey);\n return this.storageFileDownloadStorage.getDownloadUrlPair(storageFileId).pipe(\n switchMap((pair) => {\n let result: Observable<Maybe<DbxFirebaseStorageFileDownloadUrlPair>>;\n\n if (pair) {\n const expiresAt = pair.expiresAt - this._expiresAfterTimeBuffer;\n\n function pairIfNotExpired(): Maybe<DbxFirebaseStorageFileDownloadUrlPair> {\n const now = unixDateTimeSecondsNumberForNow();\n const isExpired = now > expiresAt;\n return isExpired ? null : pair;\n }\n\n const initialPair = pairIfNotExpired();\n\n if (initialPair) {\n // every minute emit the result again\n result = interval(MS_IN_MINUTE).pipe(\n map(pairIfNotExpired),\n first((x) => x == null), // only emit the first null value\n startWith(initialPair), // send the initial value first\n shareReplay(1)\n );\n } else {\n result = of(null);\n }\n } else {\n result = of(null);\n }\n\n return result;\n })\n );\n }\n\n /**\n * Retrieves the download URL for the StorageFile using the default parameters.\n *\n * These URLs are cached locally to prevent extra/redundant calls to the server.\n *\n * @param storageFileIdOrKey\n * @returns\n */\n downloadPairForStorageFile(storageFileIdOrKey: StorageFileId | StorageFileKey): Observable<DbxFirebaseStorageFileDownloadUrlPair> {\n return this.downloadPairForStorageFileUsingSource(storageFileIdOrKey, undefined);\n }\n\n /**\n * Retrieves the download URL for the StorageFile using the default parameters and pulled from the input source, if applicable.\n *\n * If no source is provided, uses the default internal source.\n *\n * These URLs are cached locally to prevent extra/redundant calls to the server.\n *\n * @param storageFileIdOrKey\n * @returns\n */\n downloadPairForStorageFileUsingSource(storageFileIdOrKey: StorageFileId | StorageFileKey, source: Maybe<DbxFirebaseStorageFileDownloadServiceCustomSource>): Observable<DbxFirebaseStorageFileDownloadUrlPair> {\n const storageFileId = firestoreModelId(storageFileIdOrKey);\n const obs: Observable<DbxFirebaseStorageFileDownloadUrlPair> = this.getCachedDownloadPairForStorageFile(storageFileId).pipe(\n switchMap((cachedPair) => {\n let result: Observable<DbxFirebaseStorageFileDownloadUrlPair>;\n\n const downloadAndCacheResult = () => {\n return from(this._createDownloadPairForStorageFileUsingSource(source, storageFileIdOrKey)).pipe(\n tap((downloadUrlPair) => {\n this.addPairForStorageFileToCache(downloadUrlPair);\n })\n );\n };\n\n if (cachedPair) {\n result = of(cachedPair);\n } else {\n result = downloadAndCacheResult();\n }\n\n return result;\n }),\n first(),\n shareReplay(1)\n );\n\n return obs;\n }\n\n /**\n * Adds the given download URL pair to the cache.\n */\n addPairForStorageFileToCache(downloadUrlPair: DbxFirebaseStorageFileDownloadUrlPair): void {\n this.storageFileDownloadStorage.addDownloadUrl(downloadUrlPair).pipe(first()).subscribe();\n }\n\n /**\n * Creates a new download URL for the StorageFile.\n *\n * @param storageFileIdOrKey\n * @param inputParams\n * @returns\n */\n createDownloadPairForStorageFile(storageFileIdOrKey: StorageFileId | StorageFileKey, inputParams?: Omit<DownloadStorageFileParams, 'key'>): Promise<DbxFirebaseStorageFileDownloadUrlPair> {\n return this._createDownloadPairForStorageFileUsingSource(undefined, storageFileIdOrKey, inputParams);\n }\n\n private _createDownloadPairForStorageFileUsingSource(inputSource: Maybe<DbxFirebaseStorageFileDownloadServiceCustomSource>, storageFileIdOrKey: StorageFileId | StorageFileKey, inputParams?: Omit<DownloadStorageFileParams, 'key'>): Promise<DbxFirebaseStorageFileDownloadUrlPair> {\n const source = inputSource ?? {\n downloadStorageFileResult: (params) => this.storageFileFunctions.storageFile.readStorageFile.download(params)\n };\n\n const storageFileId = firestoreModelId(storageFileIdOrKey);\n const expiresAt = inputParams?.expiresAt ?? addMilliseconds(new Date(), this._expiresAfterTime);\n\n const params: DownloadStorageFileParams = {\n ...inputParams,\n expiresAt,\n key: firestoreModelKey(storageFileIdentity, storageFileId)\n };\n\n return source.downloadStorageFileResult(params, storageFileId).then((x) => {\n return {\n id: storageFileId,\n downloadUrl: x.url,\n mimeType: x.mimeType,\n expiresAt: x.expiresAt ?? unixDateTimeSecondsNumberFromDate(expiresAt)\n };\n });\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, inject, input, output, signal } from '@angular/core';\nimport { DbxActionDialogDirective, DbxActionDialogFunction, DbxActionModule, DbxActionSnackbarErrorDirective, DbxAnchorComponent, DbxButtonComponent, DbxButtonStyle, DbxWebFilePreviewService } from '@dereekb/dbx-web';\nimport { StorageFileDownloadUrl, StorageFileKey } from '@dereekb/firebase';\nimport { ContentTypeMimeType, dateFromDateOrTimeSecondsNumber, DateOrUnixDateTimeSecondsNumber, isPast, Maybe, MS_IN_SECOND } from '@dereekb/util';\nimport { DbxFirebaseStorageFileDownloadService, DbxFirebaseStorageFileDownloadServiceCustomSource } from '../service/storagefile.download.service';\nimport { ClickableAnchor } from '@dereekb/dbx-core';\nimport { MaybeObservableOrValue, maybeValueFromObservableOrValue, WorkInstance, WorkUsingContext } from '@dereekb/rxjs';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, distinctUntilChanged, interval, map, Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { DbxFirebaseStorageFileDownloadUrlPair } from '../service/storagefile.download.storage.service';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { isSameDate } from '@dereekb/date';\n\nexport interface DbxFirebaseStorageFileDownloadDetails {\n readonly downloadUrl: StorageFileDownloadUrl;\n readonly mimeType?: Maybe<ContentTypeMimeType>;\n readonly expiresAt?: Maybe<Date>;\n}\n\n/**\n * Source configuration for the DbxFirebaseStorageFileDownloadButtonComponent.\n */\nexport interface DbxFirebaseStorageFileDownloadButtonSource {\n /**\n * A static StorageFileKey to use.\n */\n readonly storageFileKey?: MaybeObservableOrValue<StorageFileKey>;\n /**\n * Whether or not to pre-load the download url from the source.\n *\n * Defaults to false.\n */\n readonly preload?: Maybe<boolean>;\n /**\n * The expected mime type of the StorageFile to use when previewing.\n */\n readonly storageFileEmbedMimeType?: MaybeObservableOrValue<ContentTypeMimeType | string>;\n /**\n * Custom source to use with the DbxFirebaseStorageFileDownloadService. A more simple alternative to using handleGetDownloadUrl().\n */\n readonly customSource?: Maybe<DbxFirebaseStorageFileDownloadServiceCustomSource>;\n /**\n * Optional custom work to use to get the download URL.\n *\n * If provided, customSource is ignored.\n */\n readonly handleGetDownloadUrl?: Maybe<WorkUsingContext<StorageFileKey, DbxFirebaseStorageFileDownloadUrlPair>>;\n /**\n * Optional custom success handler for the download URL.\n */\n readonly handleGetDownloadUrlSuccess?: (value: DbxFirebaseStorageFileDownloadUrlPair) => void;\n /**\n * Optional custom error handler for the download URL.\n */\n readonly handleGetDownloadUrlError?: (error: unknown) => void;\n /**\n * Called when the download details change.\n */\n readonly downloadDetailsChangeCallback?: Maybe<(downloadDetails: Maybe<DbxFirebaseStorageFileDownloadDetails>) => void>;\n}\n\n/**\n * Configuration for the DbxFirebaseStorageFileDownloadButtonComponent.\n */\nexport interface DbxFirebaseStorageFileDownloadButtonConfig {\n readonly buttonStyle?: Maybe<DbxButtonStyle>;\n readonly previewButtonStyle?: Maybe<DbxButtonStyle>;\n /**\n * Whether or not to show a preview button.\n *\n * Defaults to true.\n */\n readonly showPreviewButton?: Maybe<boolean>;\n readonly icon?: Maybe<string>;\n readonly text?: Maybe<string>;\n readonly downloadReadyIcon?: Maybe<string>;\n readonly downloadReadyText?: Maybe<string>;\n readonly previewIcon?: Maybe<string>;\n readonly previewText?: Maybe<string>;\n /**\n * Optional custom function to open a preview dialog. If not provided, the default preview dialog provided by the DbxWebFilePreviewService will be used.\n *\n * The function can return undefined, in which case the default preview dialog will be used.\n */\n readonly openCustomPreview?: Maybe<(downloadUrl: StorageFileDownloadUrl, embedMimeType?: Maybe<string>) => Maybe<MatDialogRef<any>>>;\n}\n\n@Component({\n selector: 'dbx-firebase-storagefile-download-button',\n template: `\n <dbx-anchor dbxActionAnchor [anchor]=\"anchorSignal()\" dbxAction [dbxActionAutoTrigger]=\"preloadSignal()\" dbxActionSnackbarError [dbxActionDisabled]=\"!storageFileKeySignal()\" [dbxActionValue]=\"storageFileKeySignal()\" [dbxActionHandler]=\"handleGetDownloadUrl\" [dbxActionSuccessHandler]=\"handleGetDownloadUrlSuccess\" [dbxActionErrorHandler]=\"handleGetDownloadUrlError\">\n <dbx-button dbxActionButton [buttonStyle]=\"buttonStyleSignal()\" [icon]=\"iconSignal()\" [text]=\"textSignal()\"></dbx-button>\n </dbx-anchor>\n @if (showPreviewButtonSignal()) {\n <ng-container dbxAction [dbxActionDialog]=\"handleOpenPreviewDialog\" dbxActionHandlerValue>\n <span class=\"dbx-button-spacer\"></span>\n <dbx-button dbxActionButton [buttonStyle]=\"previewButtonStyleSignal()\" [icon]=\"previewIconSignal()\" [text]=\"previewTextSignal()\"></dbx-button>\n </ng-container>\n }\n `,\n imports: [DbxButtonComponent, DbxActionModule, DbxActionSnackbarErrorDirective, DbxActionDialogDirective, DbxAnchorComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseStorageFileDownloadButtonComponent {\n readonly matDialog = inject(MatDialog);\n\n readonly dbxWebFilePreviewService = inject(DbxWebFilePreviewService);\n readonly dbxFirebaseStorageFileDownloadService = inject(DbxFirebaseStorageFileDownloadService);\n\n /**\n * The StorageFileKey to set up the download button for.\n */\n readonly storageFileKey = input<Maybe<StorageFileKey>>();\n\n /**\n * The download URL to use for the download button.\n */\n readonly storageFileDownloadUrl = input<Maybe<StorageFileDownloadUrl>>();\n\n /**\n * The MIME type to use the embed component.\n */\n readonly embedMimeType = input<Maybe<ContentTypeMimeType | string>>();\n\n /**\n * Whether or not to show a preview button.\n *\n * Defaults to true.\n */\n readonly showPreviewButton = input<Maybe<boolean>>(true);\n\n /**\n * Whether or not to pre-load the download URL from the source.\n */\n readonly preload = input<Maybe<boolean>>(undefined);\n\n /**\n * Output event emitted when the download details change.\n */\n readonly downloadDetailsChange = output<Maybe<DbxFirebaseStorageFileDownloadDetails>>();\n\n readonly config = input<Maybe<DbxFirebaseStorageFileDownloadButtonConfig>>();\n readonly source = input<Maybe<DbxFirebaseStorageFileDownloadButtonSource>>();\n\n readonly source$ = toObservable(this.source);\n\n readonly configSignal = computed(() => {\n const config = this.config();\n\n const result: DbxFirebaseStorageFileDownloadButtonConfig = {\n buttonStyle: config?.buttonStyle,\n previewButtonStyle: config?.previewButtonStyle,\n icon: config?.icon ?? 'cloud_download',\n text: config?.text ?? 'Start Download',\n downloadReadyIcon: config?.downloadReadyIcon ?? 'download',\n downloadReadyText: config?.downloadReadyText ?? 'Save File',\n previewIcon: config?.previewIcon ?? 'preview',\n previewText: config?.previewText ?? 'View File'\n };\n\n return result;\n });\n\n readonly preloadSignal = computed(() => {\n const preload = this.preload();\n const source = this.source();\n return preload ?? source?.preload ?? false;\n });\n\n readonly downloadUrlSignal = signal<Maybe<StorageFileDownloadUrl>>(undefined);\n readonly downloadMimeTypeSignal = signal<Maybe<ContentTypeMimeType>>(undefined);\n readonly downloadUrlExpiresAtSignal = signal<Maybe<DateOrUnixDateTimeSecondsNumber>>(undefined);\n\n readonly storageFileKeyFromInput$ = toObservable(this.storageFileKey).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly storageFileKeyFromSource$: Observable<Maybe<StorageFileKey>> = this.source$.pipe(\n map((source) => source?.storageFileKey),\n maybeValueFromObservableOrValue(),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly storageFileKey$: Observable<Maybe<StorageFileKey>> = combineLatest([this.storageFileKeyFromInput$, this.storageFileKeyFromSource$]).pipe(\n map(([storageFileKeyFromInput, storageFileKeyFromSource]) => {\n return storageFileKeyFromInput ?? storageFileKeyFromSource;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly storageFileKeySignal = toSignal(this.storageFileKey$);\n\n readonly hasDownloadUrlSignal = computed(() => Boolean(this.downloadUrlSignal()));\n\n readonly buttonStyleSignal = computed(() => {\n const config = this.configSignal();\n\n const result: DbxButtonStyle = {\n type: 'raised',\n ...config.buttonStyle\n };\n\n return result;\n });\n\n readonly previewButtonStyleSignal = computed(() => {\n const config = this.configSignal();\n\n const result: DbxButtonStyle = {\n type: 'raised',\n ...config.previewButtonStyle\n };\n\n return result;\n });\n\n readonly iconSignal = computed(() => {\n const config = this.configSignal();\n const hasDownloadUrl = this.hasDownloadUrlSignal();\n return hasDownloadUrl ? (config.downloadReadyIcon ?? config.icon) : config.icon;\n });\n\n readonly textSignal = computed(() => {\n const config = this.configSignal();\n const hasDownloadUrl = this.hasDownloadUrlSignal();\n return hasDownloadUrl ? (config.downloadReadyText ?? config.text) : config.text;\n });\n\n readonly previewIconSignal = computed(() => {\n const config = this.configSignal();\n return config.previewIcon;\n });\n\n readonly previewTextSignal = computed(() => {\n const config = this.configSignal();\n return config.previewText;\n });\n\n readonly anchorSignal = computed(() => {\n const downloadUrl = this.downloadUrlSignal();\n\n let result: Maybe<ClickableAnchor>;\n\n if (downloadUrl) {\n result = {\n url: downloadUrl\n };\n }\n\n return result;\n });\n\n readonly storageFileDownloadUrlEffect = effect(\n () => {\n const downloadUrl = this.storageFileDownloadUrl();\n\n if (downloadUrl || downloadUrl === null) {\n this.downloadUrlSignal.set(downloadUrl);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Preview\n readonly showPreviewButtonSignal = computed(() => {\n const config = this.configSignal();\n const hasDownloadUrl = this.hasDownloadUrlSignal();\n return hasDownloadUrl && (config.showPreviewButton ?? true);\n });\n\n readonly openCustomPreviewSignal = computed(() => {\n const config = this.configSignal();\n return config.openCustomPreview;\n });\n\n readonly handleOpenPreviewDialog: DbxActionDialogFunction = () => {\n const openPreview = this.openCustomPreviewSignal();\n\n const srcUrl = this.downloadUrlSignal() as string;\n const inputEmbedMimeType = this.embedMimeType();\n const downloadMimeType = this.downloadMimeTypeSignal();\n const embedMimeType = inputEmbedMimeType ?? downloadMimeType;\n\n return (\n openPreview?.(srcUrl, embedMimeType) ??\n this.dbxWebFilePreviewService.openPreviewDialog({\n srcUrl,\n embedMimeType\n })\n );\n };\n\n // Cached Url Effect\n // When the key changes, check the cache to see if it is already available, and populate the download url if it is.\n readonly cachedUrlForStorageFileKey$ = this.storageFileKey$.pipe(\n switchMap((key) => (key ? this.dbxFirebaseStorageFileDownloadService.getCachedDownloadPairForStorageFile(key) : of(null))),\n shareReplay(1)\n );\n\n readonly cachedUrlForStorageFileKeySignal = toSignal(this.cachedUrlForStorageFileKey$);\n\n readonly cachedUrlEffect = effect(\n () => {\n const cachedPair = this.cachedUrlForStorageFileKeySignal();\n\n if (cachedPair) {\n this.downloadUrlSignal.set(cachedPair.downloadUrl);\n this.downloadMimeTypeSignal.set(cachedPair.mimeType);\n this.downloadUrlExpiresAtSignal.set(cachedPair.expiresAt);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Expiration Effect\n readonly downloadUrlExpiresAtDate$ = toObservable(this.downloadUrlExpiresAtSignal).pipe(map(dateFromDateOrTimeSecondsNumber), distinctUntilChanged(isSameDate), shareReplay(1));\n readonly downloadUrlExpiresAtDateSignal = toSignal(this.downloadUrlExpiresAtDate$);\n\n readonly downloadUrlHasExpired$ = this.downloadUrlExpiresAtDate$.pipe(\n switchMap((x) => {\n let obs: Observable<boolean>;\n\n if (x) {\n obs = interval(MS_IN_SECOND).pipe(\n map(() => isPast(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n } else {\n obs = of(false);\n }\n\n return obs;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly downloadUrlHasExpiredSignal = toSignal(this.downloadUrlHasExpired$);\n readonly downloadUrlHasExpiredEffect = effect(\n () => {\n const expired = this.downloadUrlHasExpiredSignal();\n\n if (expired) {\n this.downloadUrlSignal.set(undefined);\n this.downloadMimeTypeSignal.set(undefined);\n this.downloadUrlExpiresAtSignal.set(undefined);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Output Effect\n readonly downloadDetailsSignal = computed(() => {\n const downloadUrl = this.downloadUrlSignal();\n const mimeType = this.downloadMimeTypeSignal();\n const expiresAt = this.downloadUrlExpiresAtDateSignal();\n\n const details: Maybe<DbxFirebaseStorageFileDownloadDetails> =\n downloadUrl != null\n ? {\n downloadUrl,\n mimeType,\n expiresAt\n }\n : undefined;\n\n return details;\n });\n\n readonly downloadDetailsChangedEffect = effect(() => {\n const details: Maybe<DbxFirebaseStorageFileDownloadDetails> = this.downloadDetailsSignal();\n this.downloadDetailsChange.emit(details);\n });\n\n readonly sourceDownloadDetailsChangeCallbackEffect = effect(\n () => {\n const details: Maybe<DbxFirebaseStorageFileDownloadDetails> = this.downloadDetailsSignal();\n const source = this.source();\n\n if (source?.downloadDetailsChangeCallback) {\n source.downloadDetailsChangeCallback(details);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Handlers\n readonly handleGetDownloadUrl: WorkUsingContext<StorageFileKey, DbxFirebaseStorageFileDownloadUrlPair> = (value: StorageFileKey, context: WorkInstance<StorageFileKey, DbxFirebaseStorageFileDownloadUrlPair>) => {\n const source = this.source();\n const { customSource, handleGetDownloadUrl } = source ?? {};\n\n if (handleGetDownloadUrl) {\n handleGetDownloadUrl(value, context);\n } else {\n context.startWorkingWithObservable(this.dbxFirebaseStorageFileDownloadService.downloadPairForStorageFileUsingSource(value, customSource));\n }\n };\n\n readonly handleGetDownloadUrlSuccess = (value: DbxFirebaseStorageFileDownloadUrlPair) => {\n const source = this.source();\n const { handleGetDownloadUrlSuccess } = source ?? {};\n\n this.downloadUrlSignal.set(value.downloadUrl);\n this.downloadMimeTypeSignal.set(value.mimeType);\n this.downloadUrlExpiresAtSignal.set(value.expiresAt);\n\n if (handleGetDownloadUrlSuccess) {\n handleGetDownloadUrlSuccess(value);\n }\n };\n\n readonly handleGetDownloadUrlError = (error: unknown) => {\n const source = this.source();\n const { handleGetDownloadUrlError } = source ?? {};\n\n this.downloadUrlSignal.set(undefined);\n this.downloadMimeTypeSignal.set(undefined);\n this.downloadUrlExpiresAtSignal.set(undefined);\n\n if (handleGetDownloadUrlError) {\n handleGetDownloadUrlError(error);\n }\n };\n}\n","import { Injectable } from '@angular/core';\nimport { FileAcceptFilterTypeString } from '@dereekb/dbx-web';\nimport { FirebaseStorageAccessorFile, StoragePathInput } from '@dereekb/firebase';\nimport { distinctUntilHasDifferentValues, filterMaybe } from '@dereekb/rxjs';\nimport { ArrayOrValue, asArray, Maybe, PercentDecimal } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs';\nimport { StorageFileUploadFilesEvent, StorageFileUploadFilesFinalResult } from '../container';\n\n/**\n * The stage of the upload process.\n *\n * - configuration: The initial stage where the upload store is being configured.\n * - files: The stage where the files are to be selected.\n * - uploading: The stage where the files are being uploaded.\n * - success: The stage where the files have been successfully uploaded.\n * - error: The stage where the upload has failed.\n */\nexport type DbxFirebaseStorageFileUploadStoreUploadStage = 'configuration' | 'files' | 'uploading' | 'success' | 'error';\n\n/**\n * The accepted file types for the upload.\n *\n * If unset, then all file types are accepted.\n */\nexport type DbxFirebaseStorageFileUploadStoreAllowedTypes = FileAcceptFilterTypeString[];\n\n/**\n * The progress of a file being uploaded.\n *\n * File progresses are automatically created for all files when one file's progress is\n */\nexport interface DbxFirebaseStorageFileUploadStoreFileProgress<T = unknown> {\n /**\n * The file being uploaded.\n */\n readonly file: File;\n /**\n * The accessor file for the file, if available.\n */\n readonly fileRef?: Maybe<FirebaseStorageAccessorFile>;\n /**\n * The upload reference info for the file, if available.\n */\n readonly uploadRef?: Maybe<T>;\n /**\n * The number of bytes that have been transferred for this file.\n */\n readonly bytesTransferred?: Maybe<number>;\n /**\n * The total number of bytes to be uploaded.\n */\n readonly totalBytes?: Maybe<number>;\n /**\n * The progress of the upload.\n *\n * If unset, then the file has not started uploading.\n */\n readonly progress?: Maybe<PercentDecimal>;\n /**\n * If true, the upload has failed for this file.\n */\n readonly failed?: boolean;\n /**\n * The error that occurred during the upload for this file.\n */\n readonly error?: unknown;\n}\n\nexport interface DbxFirebaseStorageFileUploadStoreState {\n // Component Configuration\n /**\n * The default accepted file types for the upload.\n *\n * This may be set by the component.\n */\n readonly componentFileTypesAccepted?: Maybe<DbxFirebaseStorageFileUploadStoreAllowedTypes>;\n\n /**\n * If true, the component allows multiple files to be selected.\n *\n * Defaults to undefined.\n */\n readonly isComponentMultiUploadAllowed?: Maybe<boolean>;\n\n // Configuration Step\n /**\n * The accepted file types for the upload.\n *\n * Is used to filter the files that can be selected for upload.\n *\n * Overrides the componentFileTypesAccepted value if set.\n */\n readonly fileTypesAccepted?: Maybe<DbxFirebaseStorageFileUploadStoreAllowedTypes>;\n\n /**\n * If true, allow selecting multiple files for upload.\n *\n * If isComponentMultiUploadAllowed is false, then this value is ignored.\n */\n readonly isMultiUploadAllowed?: Maybe<boolean>;\n\n /**\n * Path to upload the file(s) to.\n *\n * Must be set before uploading.\n */\n readonly uploadPath?: Maybe<StoragePathInput>;\n\n // Files Step\n /**\n * The current file(s) to upload.\n */\n readonly files?: Maybe<File[]>;\n\n // Upload Step\n /**\n * The progress of the upload for each file.\n *\n * Only set while one or more files are being uploaded.\n */\n readonly latestProgressEvent?: Maybe<StorageFileUploadFilesEvent>;\n\n /**\n * If true, the upload handler is working.\n */\n readonly isUploadHandlerWorking?: Maybe<boolean>;\n\n // Upload Result\n /**\n * The final upload result for the files.\n *\n * Only set after the upload has completed.\n */\n readonly uploadResult?: Maybe<StorageFileUploadFilesFinalResult>;\n}\n\n/**\n * Store used for selecting a specific NotificationItem from a list of notification items.\n */\n@Injectable()\nexport class DbxFirebaseStorageFileUploadStore extends ComponentStore<DbxFirebaseStorageFileUploadStoreState> {\n constructor() {\n super({});\n }\n\n // MARK: Accessors\n readonly componentFileTypesAccepted$ = this.select((state) => state.componentFileTypesAccepted);\n readonly isComponentMultiUploadAllowed$ = this.select((state) => state.isComponentMultiUploadAllowed).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly fileTypesAllowed$ = this.select((state) => state.fileTypesAccepted ?? state.componentFileTypesAccepted ?? []).pipe(distinctUntilHasDifferentValues(), shareReplay(1));\n readonly fileTypesAcceptString$ = this.fileTypesAllowed$.pipe(\n map((x) => x.join(',')),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isMultiUploadAllowed$ = this.select((state) => state.isComponentMultiUploadAllowed !== false && state.isMultiUploadAllowed).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly uploadPath$ = this.select((state) => state.uploadPath).pipe(distinctUntilChanged(), shareReplay(1));\n readonly currentFiles$ = this.select((state) => state.files).pipe(distinctUntilChanged(), shareReplay(1));\n readonly files$ = this.currentFiles$.pipe(filterMaybe());\n\n readonly isUploadHandlerWorking$ = this.select((state) => state.isUploadHandlerWorking).pipe(distinctUntilChanged(), shareReplay(1));\n readonly latestProgressEvent$ = this.select((state) => state.latestProgressEvent).pipe(distinctUntilChanged(), shareReplay(1));\n readonly currentUploadResult$ = this.select((state) => state.uploadResult).pipe(distinctUntilChanged(), shareReplay(1));\n readonly uploadResult$ = this.currentUploadResult$.pipe(filterMaybe());\n\n // MARK: State Changes\n readonly setComponentFileTypesAccepted = this.updater((state, componentFileTypesAccepted: Maybe<DbxFirebaseStorageFileUploadStoreAllowedTypes>) => ({ ...state, componentFileTypesAccepted }));\n readonly setIsComponentMultiUploadAllowed = this.updater((state, isComponentMultiUploadAllowed: Maybe<boolean>) => ({ ...state, isComponentMultiUploadAllowed }));\n\n readonly setUploadPath = this.updater((state, uploadPath: Maybe<StoragePathInput>) => ({ ...state, uploadPath }));\n readonly setFileTypesAccepted = this.updater((state, fileTypesAccepted: Maybe<ArrayOrValue<FileAcceptFilterTypeString>>) => ({ ...state, fileTypesAccepted: fileTypesAccepted ? asArray(fileTypesAccepted) : undefined }));\n\n /**\n * Sets the file list to upload.\n *\n * If the upload handler is working, the file list cannot be changed.\n */\n readonly setFiles = this.updater((state, files: Maybe<File[]>) => ({ ...state, files: state.isUploadHandlerWorking ? state.files : files }));\n readonly setIsMultiUploadAllowed = this.updater((state, isMultiUploadAllowed: Maybe<boolean>) => ({ ...state, isMultiUploadAllowed }));\n\n /**\n * Flags the upload handler to begin working.\n *\n * Once the upload handler is flagged, it cannot be unset until the upload handler has finished.\n */\n readonly setIsUploadHandlerWorking = this.updater((state, isUploadHandlerWorking: boolean) => ({ ...state, isUploadHandlerWorking }));\n\n /**\n * Sets the latest progress event.\n */\n readonly setLatestProgressEvent = this.updater((state, latestProgressEvent: Maybe<StorageFileUploadFilesEvent>) => ({ ...state, latestProgressEvent }));\n\n /**\n * Updates the upload progress for one or more files.\n */\n // readonly updateUploadProgress = this.updater((state, uploadProgress: ArrayOrValue<DbxFirebaseStorageFileUploadStoreFileProgress>) => updateUploadStorageFileStoreStateWithUploadProgress(state, uploadProgress));\n\n /**\n * Sets the upload result.\n */\n readonly setUploadResult = this.updater((state, uploadResult: Maybe<StorageFileUploadFilesFinalResult>) => ({ ...state, isUploadHandlerWorking: false, uploadProgress: undefined, uploadResult }));\n}\n\n// TODO: Consider moving this back, but might not be needed...\n/*\nexport function updateUploadStorageFileStoreStateWithUploadProgress(state: DbxFirebaseStorageFileUploadStoreState, uploadProgress: ArrayOrValue<DbxFirebaseStorageFileUploadStoreFileProgress>): DbxFirebaseStorageFileUploadStoreState {\n const { uploadProgress: currentUploadProgress } = state;\n\n const newUploadProgress = asArray(uploadProgress);\n const newUploadProgressMap = new Map(newUploadProgress.map((progress) => [progress.file, progress]));\n\n const updatedUploadProgress = (currentUploadProgress ?? []).map((progress) => {\n const newProgress = newUploadProgressMap.get(progress.file);\n return newProgress ?? progress;\n });\n\n return { ...state, uploadProgress: updatedUploadProgress };\n}\n*/\n","import { catchError, map, Observable, of, shareReplay } from 'rxjs';\nimport { type DbxFirebaseStorageFileUploadStoreFileProgress } from '../store';\nimport { type DbxFirebaseStorageService } from '../../../storage/firebase.storage.service';\nimport { type IndexNumber, type Maybe, type PercentDecimal, type PercentNumber, type PromiseOrValue, runAsyncTasksForValues, separateValues } from '@dereekb/util';\nimport { MultiSubscriptionObject } from '@dereekb/rxjs';\nimport { type FirebaseStorageAccessorFile, type StorageCustomMetadata, type StoragePathInput, type StorageUploadOptions, type StorageUploadTask } from '@dereekb/firebase';\n\n/**\n * Creates a new observable for uploading a file.\n */\nexport type StorageFileUploadHandlerFunction = (file: File) => Promise<StorageFileUploadHandlerInstance>;\n\nexport interface StorageFileUploadHandlerInstance extends Pick<StorageUploadTask<FirebaseStorageAccessorFile>, 'taskRef' | 'pause' | 'resume' | 'cancel'> {\n /**\n * The upload observable.\n *\n * Must be subscribed to in order for the upload to begin.\n */\n readonly upload: Observable<DbxFirebaseStorageFileUploadStoreFileProgress>;\n}\n\n/**\n * Handles uploading files.\n */\nexport interface StorageFileUploadHandler {\n /**\n * Uploads a file, and returns the file progress as it is uploading.\n */\n readonly uploadFile: StorageFileUploadHandlerFunction;\n}\n\n/**\n * Configuration for a single file upload.\n */\nexport interface StorageFileUploadConfig {\n /**\n * Path for where to upload the file to\n */\n readonly storagePath: StoragePathInput;\n /**\n * Upload options for the file.\n *\n * Resumable is not supported.\n */\n readonly uploadOptions?: StorageFileUploadConfigOptions;\n /**\n * Custom metadata for the file.\n *\n * Is merged with uploadOptions's metadata.\n */\n readonly customMetadata?: StorageCustomMetadata;\n}\n\n/**\n * StorageFileUploadConfig upload options.\n */\nexport type StorageFileUploadConfigOptions = Omit<StorageUploadOptions, 'resumable'>;\n\n/**\n * Function used to generate file names for the uploaded files.\n *\n * If not set, the file name will be used as is.\n */\nexport type StorageFileUploadConfigFactory = (file: File) => PromiseOrValue<StorageFileUploadConfig>;\n\n/**\n * Configuration for StorageFileUploadHandler().\n */\nexport interface StorageFileUploadHandlerConfig {\n readonly storageService: DbxFirebaseStorageService;\n readonly storageFileUploadConfigFactory: StorageFileUploadConfigFactory;\n}\n\n/**\n * Default implementation of StorageFileUploadHandler.\n */\nexport function storageFileUploadHandler(config: StorageFileUploadHandlerConfig): StorageFileUploadHandler {\n const { storageService, storageFileUploadConfigFactory } = config;\n\n let resumable: Maybe<StorageUploadTask>;\n\n return {\n uploadFile: async (file) => {\n const storageFileUploadConfig = await storageFileUploadConfigFactory(file);\n\n const { storagePath } = storageFileUploadConfig;\n const storageAccessorFile = storageService.file(storagePath);\n\n const upload = new Observable<DbxFirebaseStorageFileUploadStoreFileProgress>((x) => {\n if (storageAccessorFile.uploadResumable) {\n resumable = storageAccessorFile.uploadResumable(file);\n\n // subscribe to the event by piping this observable to it\n resumable\n .streamSnapshotEvents()\n .pipe(\n map((x) => {\n const { bytesTransferred, totalBytes } = x;\n\n const progress: DbxFirebaseStorageFileUploadStoreFileProgress = {\n file,\n fileRef: storageAccessorFile,\n uploadRef: resumable,\n bytesTransferred,\n totalBytes,\n progress: bytesTransferred / totalBytes\n };\n\n return progress;\n })\n )\n .pipe(\n catchError((error) => {\n // if an error occurs, catch it and emit it as a progress\n const progress: DbxFirebaseStorageFileUploadStoreFileProgress = {\n file,\n fileRef: storageAccessorFile,\n uploadRef: resumable,\n error,\n failed: true\n };\n\n return of(progress);\n })\n )\n .subscribe(x);\n } else {\n throw new Error('uploadResumable() function was unavailable.');\n }\n }).pipe(shareReplay(1));\n\n const instance: StorageFileUploadHandlerInstance = {\n upload,\n taskRef: storageAccessorFile,\n pause: () => resumable?.pause() ?? false,\n resume: () => resumable?.resume() ?? false,\n cancel: () => resumable?.cancel() ?? false\n };\n\n return instance;\n }\n };\n}\n\n// MARK: Upload Files\nexport interface StorageFileUploadFilesInput {\n readonly uploadHandler: StorageFileUploadHandler;\n /**\n * Files to upload\n */\n readonly files: File[];\n /**\n * The number of max parallel uploads to perform at a time.\n *\n * Defaults to 3\n */\n readonly maxParallelUploads?: number;\n}\n\nexport interface StorageFileUploadFilesInstance {\n /**\n * Cancels the upload of the remaining files.\n */\n cancel(): void;\n /**\n * The upload observable.\n *\n * Must be subscribed to in order for the upload to begin.\n */\n readonly upload: Observable<StorageFileUploadFilesEvent>;\n}\n\nexport interface StorageFileUploadFilesEvent {\n /**\n * All files being uploaded\n */\n readonly allFiles: File[];\n /**\n * Returns true if all files have been uploaded.\n *\n * The result value should be available.\n */\n readonly isComplete: boolean;\n /**\n * Returns true if the upload was canceled.\n */\n readonly isCanceled?: Maybe<boolean>;\n /**\n * The overall progress of all files being uploaded.\n */\n readonly overallProgress: PercentNumber;\n /**\n * The upload progress that triggered this event.\n */\n readonly uploadProgress?: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>;\n /**\n * The final result.\n *\n * Set when the final file has been uploaded or failed.\n */\n readonly result?: StorageFileUploadFilesFinalResult;\n /**\n * The number of files that are still uploading or queued for upload.\n */\n readonly incompleteFileCount: number;\n /**\n * The number of files that are active.\n */\n readonly activeFileCount: number;\n /**\n * The number of files that are done.\n */\n readonly doneFileCount: number;\n}\n\nexport interface StorageFileUploadFilesFinalResult {\n readonly startTime: Date;\n readonly endTime: Date;\n readonly fileResults: StorageFileUploadFilesFinalFileResult[];\n readonly successFileResults: StorageFileUploadFilesFinalFileResult[];\n readonly errorFileResults: StorageFileUploadFilesFinalFileResult[];\n}\n\nexport interface StorageFileUploadFilesFinalFileResult {\n /**\n * The start time of the file upload.\n */\n readonly startTime: Date;\n /**\n * The end time of the file upload, or when it failed or was canceled.\n */\n readonly endTime: Date;\n /**\n * The file that was uploaded.\n */\n readonly file: File;\n /**\n * The accessor file for the file, if available.\n *\n * Is generally available if success is true.\n */\n readonly fileRef?: Maybe<FirebaseStorageAccessorFile>;\n /**\n * True if the file was uploaded successfully.\n */\n readonly success: boolean;\n /**\n * Error if the file failed to upload.\n */\n readonly error?: Maybe<unknown>;\n /**\n * True if the file upload was cancelled.\n */\n readonly canceled?: Maybe<boolean>;\n}\n\n/**\n * Uploads files using the provided upload handler and files.\n *\n * An observable is returned that emits the latest file events from any file that is being uploaded.\n *\n * @param input\n * @returns\n */\nexport function storageFileUploadFiles(input: StorageFileUploadFilesInput): StorageFileUploadFilesInstance {\n const { uploadHandler, files, maxParallelUploads: inputMaxParallelUploads } = input;\n const maxParallelTasks = inputMaxParallelUploads ?? 3;\n\n const multiUploadsSubscriptionObject = new MultiSubscriptionObject();\n\n // begin the upload for each file\n const allFiles = Array.from(files);\n\n // unsubscribe from all previous uploads\n multiUploadsSubscriptionObject.unsub();\n\n interface UpdateUploadProgressInput {\n /**\n * The file index number.\n */\n readonly index: IndexNumber;\n /**\n * The next progress event, if applicable.\n */\n readonly nextProgress?: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>;\n /**\n * An error that occured outside of the nextProgress, if applicable.\n *\n * These are typically \"uncaught\" errors.\n */\n readonly nonProgressError?: Maybe<unknown>;\n /**\n * Passed as true when the upload task is done.\n *\n * This is also inferred as true when a progress error occurs for an upload.\n *\n * Does not specify whether or not success was achieved or not.\n */\n readonly fileUploadTaskDone?: boolean;\n /**\n * True if the upload was canceled.\n */\n readonly canceled?: boolean;\n }\n\n interface FileUploadDetails {\n readonly file: File;\n /**\n * The current upload instance for the file.\n *\n * Set if the file is currently uploading.\n */\n uploadInstance?: StorageFileUploadHandlerInstance;\n fileRef?: Maybe<FirebaseStorageAccessorFile>;\n startTime?: Date;\n endTime?: Date;\n success?: boolean;\n canceled?: Maybe<boolean>;\n error?: Maybe<unknown>;\n }\n\n const allFilesAndLatestProgress: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>[] = new Array(allFiles.length);\n const allFilesAndDetails: FileUploadDetails[] = allFiles.map((file) => ({ file }));\n const overallProgressPerCompletedFile: PercentDecimal = (1 / allFilesAndLatestProgress.length) as PercentDecimal;\n\n /**\n * Once set, any new file upload task that hits this will return an cancel failure.\n */\n let flaggedCancel = false;\n\n const cancel = () => {\n flaggedCancel = true;\n };\n\n const upload = new Observable<StorageFileUploadFilesEvent>((subscriber) => {\n const overallStartTime = new Date();\n\n const incompleteFileFileIndexes = new Set<IndexNumber>(allFiles.map((_, index) => index));\n const activeFileIndexes = new Set<IndexNumber>();\n const doneFileIndexes = new Set<IndexNumber>();\n let latestOverallProgress: PercentNumber = 0;\n\n function onStartFileUpload(index: IndexNumber, uploadInstance: StorageFileUploadHandlerInstance) {\n activeFileIndexes.add(index);\n allFilesAndDetails[index].startTime = new Date();\n allFilesAndDetails[index].uploadInstance = uploadInstance;\n allFilesAndDetails[index].fileRef = uploadInstance.taskRef;\n }\n\n function onStartFileUploadFlaggedCancelled(index: IndexNumber) {\n allFilesAndDetails[index].startTime = new Date();\n\n // immediately mark it done\n _markFileUploadDone(index, true);\n\n // emit new progress event\n _emitEvent();\n }\n\n function _markFileUploadDone(fileIndex: IndexNumber, finalError?: Maybe<unknown>) {\n doneFileIndexes.add(fileIndex); // add to done file indexes\n activeFileIndexes.delete(fileIndex); // remove from active file indexes if it exists\n incompleteFileFileIndexes.delete(fileIndex); // remove from incomplete file indexes\n\n // update details\n allFilesAndDetails[fileIndex].endTime = new Date();\n\n const error = finalError ?? allFilesAndDetails[fileIndex].error;\n allFilesAndDetails[fileIndex].success = !error;\n allFilesAndDetails[fileIndex].error = error;\n }\n\n function updateUploadProgress(input: UpdateUploadProgressInput) {\n const { index: fileIndex, nextProgress, fileUploadTaskDone: inputFileUploadTaskDone, nonProgressError } = input;\n const error = nonProgressError ?? nextProgress?.error;\n const fileUploadTaskDone = inputFileUploadTaskDone ?? Boolean(error);\n\n // the task may already be done, as after a progress-related error the complete task can get called.\n const isTaskAlreadyDone = allFilesAndDetails[fileIndex].endTime != null;\n\n if (!isTaskAlreadyDone) {\n let nextOverallProgress = latestOverallProgress;\n const nextProgressPercent = fileUploadTaskDone ? 100 : (nextProgress?.progress ?? 0) * 100;\n\n // update the overall progress percentage\n if (nextProgressPercent) {\n // update the overall percentage\n const previousProgress = allFilesAndLatestProgress[fileIndex];\n const previousProgressPercent = previousProgress?.progress != null ? previousProgress.progress * 100 : 0;\n const progressPercentChange = nextProgressPercent - previousProgressPercent;\n\n // increase overall progress by the change\n nextOverallProgress += progressPercentChange * overallProgressPerCompletedFile;\n }\n\n // update the file progress\n if (nextProgress) {\n // update the latest FileProgress\n allFilesAndLatestProgress[fileIndex] = nextProgress;\n\n // only set fileRef once\n if (!allFilesAndDetails[fileIndex].fileRef) {\n allFilesAndDetails[fileIndex].fileRef = nextProgress.fileRef;\n }\n }\n\n // if complete, update the indexes and details\n if (fileUploadTaskDone) {\n _markFileUploadDone(fileIndex, error);\n }\n\n // update the overall progress\n latestOverallProgress = nextOverallProgress;\n\n // emit the event to send it\n _emitEvent(nextProgress);\n }\n }\n\n function _emitEvent(nextProgress?: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>) {\n const isComplete = incompleteFileFileIndexes.size === 0;\n\n let overallProgress = latestOverallProgress;\n let result: Maybe<StorageFileUploadFilesFinalResult> = undefined;\n\n if (isComplete) {\n overallProgress = 100; // set to 100%\n const overallEndTime = new Date();\n\n const fileResults = allFiles.map((file, index) => {\n const result: StorageFileUploadFilesFinalFileResult = {\n startTime: allFilesAndDetails[index].startTime as Date,\n endTime: allFilesAndDetails[index].endTime as Date,\n file,\n fileRef: allFilesAndDetails[index].fileRef,\n success: !allFilesAndDetails[index].error,\n error: allFilesAndDetails[index].error\n };\n\n return result;\n });\n\n const { included: successFileResults, excluded: errorFileResults } = separateValues(fileResults, (x) => x.success);\n\n // all are done, set the result on the next event\n result = {\n startTime: overallStartTime,\n endTime: overallEndTime,\n successFileResults,\n errorFileResults,\n fileResults\n };\n }\n\n const nextEvent: StorageFileUploadFilesEvent = {\n allFiles,\n isComplete,\n overallProgress,\n uploadProgress: nextProgress,\n incompleteFileCount: incompleteFileFileIndexes.size,\n activeFileCount: activeFileIndexes.size,\n doneFileCount: doneFileIndexes.size,\n result\n };\n\n subscriber.next(nextEvent);\n }\n\n async function runUploadTaskForFile([file, index]: readonly [File, IndexNumber]) {\n if (flaggedCancel) {\n onStartFileUploadFlaggedCancelled(index);\n return Promise.resolve();\n }\n\n return new Promise<void>((resolve) => {\n const updateFileUploadProgress = (nextProgress: DbxFirebaseStorageFileUploadStoreFileProgress) => {\n // update the progress\n updateUploadProgress({\n index,\n nextProgress\n });\n };\n\n const updateFileUploadProgressWithUncaughtError = (error: unknown) => {\n // error occurred, update the progress with the error\n updateUploadProgress({\n index,\n nonProgressError: error,\n fileUploadTaskDone: true\n });\n\n // always resolve, never reject\n resolve();\n };\n\n const completeFileUploadProgress = () => {\n updateUploadProgress({\n index,\n fileUploadTaskDone: true\n });\n\n resolve();\n };\n\n // upload the file, subscribe to the progress\n try {\n uploadHandler\n .uploadFile(file)\n .then((uploadInstance) => {\n // add to active file indexes\n onStartFileUpload(index, uploadInstance);\n\n const uploadSubscription = uploadInstance.upload.subscribe({\n next: updateFileUploadProgress,\n error: updateFileUploadProgressWithUncaughtError,\n complete: completeFileUploadProgress\n });\n\n multiUploadsSubscriptionObject.addSubs(uploadSubscription);\n })\n .catch(updateFileUploadProgressWithUncaughtError);\n } catch (error) {\n updateFileUploadProgressWithUncaughtError(error);\n }\n });\n }\n\n // run upload task for each file\n const fileTuples = allFiles.map((file, index) => [file, index] as const);\n\n runAsyncTasksForValues(fileTuples, runUploadTaskForFile, {\n maxParallelTasks,\n retriesAllowed: 0 // no retries allowed\n }).then(() => {\n // all tasks are finished. Complete the subscriber.\n subscriber.complete();\n });\n }).pipe(shareReplay(1));\n\n const instance: StorageFileUploadFilesInstance = {\n cancel,\n upload\n };\n\n return instance;\n}\n","import { BaseError } from 'make-error';\nimport { type StorageFileUploadFilesFinalResult } from './storagefile.upload.handler';\n\n/**\n * Error that is thrown when a single file fails to upload.\n */\nexport class StorageFileUploadFilesError extends BaseError {\n readonly result: StorageFileUploadFilesFinalResult;\n\n constructor(result: StorageFileUploadFilesFinalResult) {\n super('Failed to upload all files.');\n this.result = result;\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseStorageFileUploadStore } from '../store/storagefile.upload.store';\nimport { storageFileUploadFiles, type StorageFileUploadFilesFinalResult, type StorageFileUploadHandler } from './storagefile.upload.handler';\nimport { clean, cleanSubscriptionWithLockSet, DbxActionContextStoreSourceInstance, DbxActionHandlerInstance } from '@dereekb/dbx-core';\nimport { errorResult, type LoadingState, startWithBeginLoading, successResult, type WorkUsingContext } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { distinctUntilChanged, filter, map, of, switchMap, tap, throttleTime } from 'rxjs';\nimport { StorageFileUploadFilesError } from './storagefile.upload.error';\n\n/**\n * Connects a DbxFirebaseStorageFileUploadStore to a DbxActionContext, and handles the upload action.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadActionHandler]',\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadActionHandlerDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance<File[], StorageFileUploadFilesFinalResult>);\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n\n readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<File[], StorageFileUploadFilesFinalResult>(this.source));\n\n /**\n * If true, the action will be triggered when files are set.\n *\n * Defaults to false.\n */\n readonly triggerOnFiles = input<boolean>(false);\n readonly triggerOnFiles$ = toObservable(this.triggerOnFiles);\n\n /**\n * Uploading of all/any files should be cancelled if any file fails to upload.\n *\n * Any file that was successfully uploaded will not be reverted.\n *\n * Defaults to false.\n */\n readonly cancelUploadsOnUploadError = input<boolean>(false);\n\n /**\n * The upload should fail if any file fails to upload, rather than if all files fail to upload.\n *\n * Defaults to false.\n */\n readonly actionFailureOnUploadError = input<boolean>(false);\n\n readonly uploadHandler = input.required<Maybe<StorageFileUploadHandler>>({ alias: 'dbxFirebaseStorageFileUploadActionHandler' });\n\n protected readonly _uploadHandlerEffect = effect(() => {\n const uploadHandler = this.uploadHandler();\n let handlerFunction: Maybe<WorkUsingContext<File[], StorageFileUploadFilesFinalResult>>;\n\n if (uploadHandler) {\n handlerFunction = (files, context) => {\n const { upload, cancel } = storageFileUploadFiles({\n files,\n uploadHandler\n });\n\n const loadingStateObs = upload.pipe(\n tap((x) => {\n this.uploadStore.setLatestProgressEvent(x);\n }),\n filter((x) => x.isComplete),\n tap((x) => {\n this.uploadStore.setUploadResult(x.result as StorageFileUploadFilesFinalResult);\n }),\n map((x) => {\n const result = x.result as StorageFileUploadFilesFinalResult;\n const { successFileResults, errorFileResults } = result;\n\n const actionFailureOnUploadError = this.actionFailureOnUploadError();\n\n let finalLoadingState: LoadingState<StorageFileUploadFilesFinalResult>;\n\n if ((errorFileResults.length > 0 && actionFailureOnUploadError) || (successFileResults.length === 0 && errorFileResults.length > 0)) {\n finalLoadingState = errorResult(new StorageFileUploadFilesError(result));\n } else {\n finalLoadingState = successResult(x.result as StorageFileUploadFilesFinalResult);\n }\n\n return finalLoadingState;\n }),\n startWithBeginLoading()\n );\n\n context.startWorkingWithLoadingStateObservable(loadingStateObs);\n };\n } else {\n handlerFunction = undefined;\n }\n\n this._dbxActionHandlerInstance.setHandlerFunction(handlerFunction);\n });\n\n readonly files$ = this.uploadStore.files$;\n readonly uploadHandler$ = toObservable(this.uploadHandler);\n\n constructor() {\n this._dbxActionHandlerInstance.init();\n\n // trigger the action if files are available\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.triggerOnFiles$\n .pipe(\n switchMap((triggerOnFiles) => {\n if (triggerOnFiles) {\n return this.files$.pipe(map((x) => x?.length));\n } else {\n return of(false);\n }\n })\n )\n .subscribe((canTrigger) => {\n if (canTrigger) {\n this.source.trigger();\n }\n })\n });\n\n // ready the source with files after trigger is called and files are available\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.files$.pipe(switchMap((files) => this.source.triggered$.pipe(map(() => files)))).subscribe((files) => {\n this.source.readyValue(files);\n })\n });\n\n // sync isWorking\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.uploadStore.setIsUploadHandlerWorking(this.source.isWorking$)\n });\n\n // sync progress amount\n this.source.setWorkProgress(\n this.uploadStore.latestProgressEvent$.pipe(\n throttleTime(100, undefined, { leading: true, trailing: true }),\n map((x) => x?.overallProgress),\n distinctUntilChanged()\n )\n );\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore, firebaseCollectionStoreCreateFunction } from '../../../model/modules/store';\nimport { StorageFileFirestoreCollections, StorageFile, StorageFileDocument, StorageFileFunctions } from '@dereekb/firebase';\n\n@Injectable()\nexport class StorageFileCollectionStore extends AbstractDbxFirebaseCollectionStore<StorageFile, StorageFileDocument> {\n readonly storageFileFunctions = inject(StorageFileFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(StorageFileFirestoreCollections).storageFileCollection });\n }\n\n readonly initializeAllStorageFilesFromUpload = firebaseCollectionStoreCreateFunction(this, this.storageFileFunctions.storageFile.createStorageFile.allFromUpload);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\nimport { StorageFileCollectionStore } from './storagefile.collection.store';\nimport { StorageFile, StorageFileDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseStorageFileCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseStorageFileCollectionStoreDirective, StorageFileCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseStorageFileCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<StorageFile, StorageFileDocument, StorageFileCollectionStore> {\n constructor() {\n super(inject(StorageFileCollectionStore));\n this.setConstraints([]);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreCreateFunction, firebaseDocumentStoreCrudFunction, firebaseDocumentStoreDeleteFunction, firebaseDocumentStoreReadFunction, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { StorageFile, StorageFileDocument, StorageFileFirestoreCollections, StorageFileFunctions } from '@dereekb/firebase';\n\n@Injectable()\nexport class StorageFileDocumentStore extends AbstractDbxFirebaseDocumentStore<StorageFile, StorageFileDocument> {\n readonly storageFileFunctions = inject(StorageFileFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(StorageFileFirestoreCollections).storageFileCollection });\n }\n\n readonly createStorageFileFromUpload = firebaseDocumentStoreCreateFunction(this, this.storageFileFunctions.storageFile.createStorageFile.create);\n readonly initializeStorageFileFromUpload = firebaseDocumentStoreCreateFunction(this, this.storageFileFunctions.storageFile.createStorageFile.fromUpload);\n readonly initializeAllStorageFilesFromUpload = firebaseDocumentStoreCrudFunction(this.storageFileFunctions.storageFile.createStorageFile.allFromUpload);\n\n readonly updateStorageFile = firebaseDocumentStoreUpdateFunction(this, this.storageFileFunctions.storageFile.updateStorageFile.update);\n readonly processStorageFile = firebaseDocumentStoreUpdateFunction(this, this.storageFileFunctions.storageFile.updateStorageFile.process);\n\n readonly deleteStorageFile = firebaseDocumentStoreDeleteFunction(this, this.storageFileFunctions.storageFile.deleteStorageFile.delete);\n\n readonly downloadStorageFile = firebaseDocumentStoreReadFunction(this, this.storageFileFunctions.storageFile.readStorageFile.download);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { StorageFileDocumentStore } from './storagefile.document.store';\nimport { StorageFile, StorageFileDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseStorageFileDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseStorageFileDocumentStoreDirective, StorageFileDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseStorageFileDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<StorageFile, StorageFileDocument, StorageFileDocumentStore> {\n constructor() {\n super(inject(StorageFileDocumentStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreCrudFunction, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { StorageFileGroup, StorageFileGroupDocument, StorageFileFirestoreCollections, StorageFileFunctions } from '@dereekb/firebase';\n\n@Injectable()\nexport class StorageFileGroupDocumentStore extends AbstractDbxFirebaseDocumentStore<StorageFileGroup, StorageFileGroupDocument> {\n readonly storageFileFunctions = inject(StorageFileFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(StorageFileFirestoreCollections).storageFileGroupCollection });\n }\n\n readonly updateStorageFileGroup = firebaseDocumentStoreUpdateFunction(this, this.storageFileFunctions.storageFileGroup.updateStorageFileGroup.update);\n readonly regenerateStorageFileGroupContent = firebaseDocumentStoreCrudFunction(this.storageFileFunctions.storageFileGroup.updateStorageFileGroup.regenerateContent);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { StorageFileGroupDocumentStore } from './storagefilegroup.document.store';\nimport { StorageFileGroup, StorageFileGroupDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseStorageFileGroupDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseStorageFileGroupDocumentStoreDirective, StorageFileGroupDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseStorageFileGroupDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<StorageFileGroup, StorageFileGroupDocument, StorageFileGroupDocumentStore> {\n constructor() {\n super(inject(StorageFileGroupDocumentStore));\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { DbxFirebaseStorageFileUploadStore, StorageFileDocumentStore } from '../store';\nimport { DbxActionContextStoreSourceInstance, DbxActionHandlerInstance, clean, cleanSubscription } from '@dereekb/dbx-core';\nimport { FirebaseStorageAccessorFile, OnCallCreateModelResult } from '@dereekb/firebase';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Directive that passes the upload result to a StorageFileDocumentStore to initialize the document immediately.\n *\n * Use with a DbxAction instance.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadInitializeDocument]',\n exportAs: 'dbxFirebaseStorageFileUploadInitializeDocument',\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadInitializeDocumentDirective {\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n readonly storageFileDocumentStore = inject(StorageFileDocumentStore);\n\n readonly initializeWithExpediteProcessing = input<Maybe<boolean>>();\n\n private readonly source: DbxActionContextStoreSourceInstance<FirebaseStorageAccessorFile, OnCallCreateModelResult> = inject(DbxActionContextStoreSourceInstance<FirebaseStorageAccessorFile, OnCallCreateModelResult>, { host: true });\n private readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<FirebaseStorageAccessorFile, OnCallCreateModelResult>(this.source));\n\n constructor() {\n // set the trigger\n cleanSubscription(\n this.uploadStore.uploadResult$.subscribe(async (result) => {\n const successFileResult = result.successFileResults.find((x) => x.fileRef != null);\n const fileRef = successFileResult?.fileRef;\n\n if (fileRef) {\n this.source.triggerWithValue(fileRef);\n }\n })\n );\n\n // set the handler function\n this._dbxActionHandlerInstance.setHandlerFunction((fileRef, context) => {\n context.startWorkingWithLoadingStateObservable(\n this.storageFileDocumentStore.initializeStorageFileFromUpload({\n pathString: fileRef.storagePath.pathString,\n bucketId: fileRef.storagePath.bucketId,\n expediteProcessing: this.initializeWithExpediteProcessing() ?? undefined\n })\n );\n });\n\n this._dbxActionHandlerInstance.init();\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { skipAllInitialMaybe } from '@dereekb/rxjs';\nimport { DbxFirebaseStorageFileUploadStore } from '../store';\nimport { ArrayOrValue, Maybe } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { shareReplay } from 'rxjs';\nimport { FileAcceptFilterTypeString } from '@dereekb/dbx-web';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Directive that provides a DbxFirebaseStorageFileUploadStore, and sync's the inputs to the store.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadStore]',\n exportAs: 'dbxFirebaseStorageFileUploadStore',\n providers: [DbxFirebaseStorageFileUploadStore],\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadStoreDirective {\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n\n readonly multipleUpload = input<Maybe<boolean>>();\n readonly fileTypesAccepted = input<Maybe<ArrayOrValue<FileAcceptFilterTypeString>>>();\n\n readonly fileTypesAccepted$ = toObservable(this.fileTypesAccepted).pipe(skipAllInitialMaybe(), shareReplay(1));\n readonly isMultiUploadAllowed$ = toObservable(this.multipleUpload).pipe(skipAllInitialMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscription(this.fileTypesAccepted$.subscribe((x) => this.uploadStore.setFileTypesAccepted(x)));\n cleanSubscription(this.isMultiUploadAllowed$.subscribe((x) => this.uploadStore.setIsMultiUploadAllowed(x)));\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseStorageFileUploadStore } from '../store';\nimport { DbxFileUploadComponent } from '@dereekb/dbx-web';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Directive that syncs a DbxFirebaseStorageFileUploadStore's configuration to a DbxFileUploadComponent.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadSync]',\n exportAs: 'dbxFirebaseStorageFileUploadSync',\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadSyncDirective {\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n readonly uploadComponent = inject(DbxFileUploadComponent);\n\n constructor() {\n cleanSubscription(this.uploadStore.fileTypesAllowed$.subscribe((x) => this.uploadComponent.setAccept(x)));\n cleanSubscription(this.uploadStore.isMultiUploadAllowed$.subscribe((x) => this.uploadComponent.setMultiple(x)));\n cleanSubscription(this.uploadComponent.filesChanged.subscribe((files) => this.uploadStore.setFiles(files.matchResult.accepted)));\n }\n}\n","import { DbxActionLoadingContextDirective, DbxActionModule, DbxActionSnackbarErrorDirective, DbxFileUploadComponent, DbxFileUploadActionSyncDirective, DbxLoadingComponent } from '@dereekb/dbx-web';\nimport { DbxFirebaseStorageFileUploadActionHandlerDirective, DbxFirebaseStorageFileUploadStoreDirective, DbxFirebaseStorageFileUploadSyncDirective, DbxFirebaseStorageFileUploadInitializeDocumentDirective } from './container';\nimport { NgModule } from '@angular/core';\nimport { DbxFirebaseStorageFileDocumentStoreDirective } from './store/storagefile.document.store.directive';\nimport { DbxFirebaseStorageFileCollectionStoreDirective } from './store';\n\nexport const importsAndExports = [\n // dbx-core/dbx-web modules/components\n DbxActionModule,\n DbxLoadingComponent,\n DbxActionLoadingContextDirective,\n DbxActionSnackbarErrorDirective,\n DbxFileUploadComponent,\n DbxFileUploadActionSyncDirective,\n // containers\n DbxFirebaseStorageFileUploadActionHandlerDirective,\n DbxFirebaseStorageFileUploadStoreDirective,\n DbxFirebaseStorageFileUploadSyncDirective,\n DbxFirebaseStorageFileUploadInitializeDocumentDirective,\n // stores\n DbxFirebaseStorageFileCollectionStoreDirective,\n DbxFirebaseStorageFileDocumentStoreDirective\n];\n\n/**\n * Convenience module for importing various modules/components that are relevant to the storage file upload feature.\n *\n * - DbxActionModule\n * - DbxFileUploadComponent\n * - DbxFirebaseStorageFileUploadActionHandlerDirective\n * - DbxFirebaseStorageFileUploadStoreDirective\n * - DbxFirebaseStorageFileUploadSyncDirective\n * - DbxFirebaseStorageFileUploadInitializeDocumentDirective\n * - DbxFirebaseStorageFileUploadStore\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxFirebaseStorageFileUploadModule {}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { SimpleStorageAccessorFactory, type StorageAccessor } from '@dereekb/dbx-core';\nimport { DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN, DbxFirebaseStorageFileDownloadStorage, type DbxFirebaseStorageFileDownloadUserCache } from './service/storagefile.download.storage.service';\nimport { DbxFirebaseStorageFileDownloadService } from './service/storagefile.download.service';\n\n/**\n * Factory function for creating a StorageAccessor for the model view tracker.\n */\nexport function defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory(storageAccessorFactory: SimpleStorageAccessorFactory): StorageAccessor<DbxFirebaseStorageFileDownloadUserCache> {\n const accessor = storageAccessorFactory.createStorageAccessor<DbxFirebaseStorageFileDownloadUserCache>({\n prefix: 'sfds'\n });\n\n return accessor;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxModelTrackerService, DbxModelObjectStateService and sets up the NgRx store for DbxModelTrackerEffects.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseStorageFileService(): EnvironmentProviders {\n const providers: (Provider | EnvironmentProviders)[] = [\n // Storage accessor\n {\n provide: DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN,\n useFactory: defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory,\n deps: [SimpleStorageAccessorFactory]\n },\n // Service\n DbxFirebaseStorageFileDownloadStorage,\n DbxFirebaseStorageFileDownloadService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FirestoreModelKey, flatFirestoreModelKey } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'flatFirestoreModelKey', standalone: true })\nexport class FlatFirestoreModelKeyPipe implements PipeTransform {\n transform(input: Maybe<FirestoreModelKey>): string {\n if (input != null) {\n return flatFirestoreModelKey(input);\n } else {\n return '';\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FirestoreModelKey, twoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'twoWayFlatFirestoreModelKey', standalone: true })\nexport class TwoWayFlatFirestoreModelKeyPipe implements PipeTransform {\n transform(input: Maybe<FirestoreModelKey>): string {\n if (input != null) {\n return twoWayFlatFirestoreModelKey(input);\n } else {\n return '';\n }\n }\n}\n","import { type Observable, BehaviorSubject, map, shareReplay, of, switchMap } from 'rxjs';\nimport { type DbxRouterService, DbxRouteParamDefaultRedirectInstance, type DbxRouteParamReader, dbxRouteParamReaderInstance } from '@dereekb/dbx-core';\nimport { type Destroyable, type Initialized, type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\n\nexport const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY = 'id';\nexport const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY = 'key';\nexport const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE = '0';\n\n/**\n * Used to read an id with a specific key from the current route.\n *\n * Can be configured to redirect to a default route if a specific value is seen.\n */\nexport interface DbxFirebaseIdRouteParamRedirect extends DbxRouteParamReader<ModelKey> {\n /**\n * The id value as it is from the current state's params.\n */\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n /**\n * The id value as it is when considering the default value.\n */\n readonly id$: Observable<Maybe<ModelKey>>;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n}\n\n/**\n * DbxFirebaseIdRouteParamRedirect instance\n */\nexport interface DbxFirebaseIdRouteParamRedirectInstance extends DbxFirebaseIdRouteParamRedirect, DbxRouteParamReader<ModelKey>, Initialized, Destroyable {\n readonly paramValue$: Observable<Maybe<string>>;\n readonly defaultValue$: Observable<Maybe<string>>;\n readonly value$: Observable<Maybe<string>>;\n\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n readonly id$: Observable<Maybe<ModelKey>>;\n\n setParamKey(paramKey: string): void;\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n setParamValue(value: MaybeObservableOrValueGetter<string>): void;\n}\n\nexport function dbxFirebaseKeyRouteParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY): DbxFirebaseIdRouteParamRedirectInstance {\n return dbxFirebaseIdRouteParamRedirect(dbxRouterService, defaultParamKey);\n}\n\nexport function dbxFirebaseIdRouteParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY): DbxFirebaseIdRouteParamRedirectInstance {\n const _paramReader = dbxRouteParamReaderInstance<ModelKey>(dbxRouterService, defaultParamKey);\n const _paramRedirect = new DbxRouteParamDefaultRedirectInstance<ModelKey>(_paramReader);\n const _useDefaultParamDecider = new BehaviorSubject<string | SwitchMapToDefaultFilterFunction<ModelKey>>(DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE);\n\n const _useDefaultParam$: Observable<SwitchMapToDefaultFilterFunction<ModelKey>> = _useDefaultParamDecider.pipe(\n map((x) => {\n let result: SwitchMapToDefaultFilterFunction<ModelKey>;\n\n if (typeof x === 'string') {\n result = (value: Maybe<ModelKey>) => of(value === x);\n } else {\n result = x;\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n const setParamKey = (paramKey: Maybe<string>) => {\n _paramReader.setParamKey(paramKey || defaultParamKey);\n };\n\n const paramValue$ = _paramReader.paramValue$;\n const value$ = _paramReader.value$;\n\n const result: DbxFirebaseIdRouteParamRedirectInstance = {\n paramValue$,\n defaultValue$: _paramReader.defaultValue$,\n value$,\n idFromParams$: paramValue$,\n id$: value$,\n\n init(): void {\n _paramRedirect.setUseDefaultFilter((value: Maybe<string>) => {\n return _useDefaultParam$.pipe(switchMap((x) => x(value)));\n });\n\n _paramRedirect.init();\n },\n\n destroy(): void {\n _paramReader.destroy();\n _paramRedirect.destroy();\n _useDefaultParamDecider.complete();\n },\n\n getParamKey(): string {\n return _paramReader.getParamKey();\n },\n\n setParamKey,\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setDefaultValue(defaultValue);\n },\n\n setRedirectEnabled(redirect: Maybe<boolean>): void {\n _paramRedirect.enabled = redirect !== false;\n },\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void {\n _useDefaultParamDecider.next(decider);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setParamValue(value);\n }\n };\n\n return result;\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Token to access the FirebaseStorageContextConfig value.\n */\nexport const DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN = new InjectionToken('DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN');\n\n/**\n * Token to access the FirebaseStorageContext value.\n */\nexport const DBX_FIREBASE_STORAGE_CONTEXT_TOKEN = new InjectionToken('DBX_FIREBASE_STORAGE_CONTEXT_TOKEN');\n","import { Injectable, inject } from '@angular/core';\nimport { FirebaseStorageContext, FirebaseStorageAccessor, FirebaseStorageAccessorFile, FirebaseStorageAccessorFolder, StoragePathInput } from '@dereekb/firebase';\nimport { DBX_FIREBASE_STORAGE_CONTEXT_TOKEN } from './firebase.storage';\n\n/**\n * Service that provides access to the app's FirebaseStorageContext.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirebaseStorageService implements FirebaseStorageAccessor {\n readonly storageContext = inject<FirebaseStorageContext>(DBX_FIREBASE_STORAGE_CONTEXT_TOKEN);\n\n defaultBucket() {\n return this.storageContext.defaultBucket();\n }\n\n file(path: StoragePathInput): FirebaseStorageAccessorFile {\n return this.storageContext.file(path);\n }\n\n folder(path: StoragePathInput): FirebaseStorageAccessorFolder {\n return this.storageContext.folder(path);\n }\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { FirebaseApp } from '@angular/fire/app';\nimport { type FirebaseStorageContextFactoryConfig, clientFirebaseStorageContextFactory } from '@dereekb/firebase';\nimport { DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_TOKEN } from './firebase.storage';\nimport { DbxFirebaseStorageService } from './firebase.storage.service';\nimport { Storage } from '@angular/fire/storage';\n\nexport type DbxFirebaseStorageContextConfigFactory = (app: FirebaseApp, injector: Injector) => FirebaseStorageContextFactoryConfig;\n\n/**\n * The default factory function for the DbxFirebaseStorageContext.\n *\n * @param base Optional base configuration to use.\n * @returns Factory function for the DbxFirebaseStorageContext.\n */\nexport function dbxFirebaseStorageProvidersContextConfigFactory(base?: FirebaseStorageContextFactoryConfig): DbxFirebaseStorageContextConfigFactory {\n return (app: FirebaseApp) => {\n return {\n defaultBucketId: base?.defaultBucketId || app.options.storageBucket,\n forceBucket: base?.forceBucket ?? false\n };\n };\n}\n\n/**\n * Configuration for provideDbxFirebaseStorage().\n */\nexport interface ProvideDbxFirebaseStorageConfig {\n /**\n * Optional context config to provide.\n */\n readonly contextConfig?: FirebaseStorageContextFactoryConfig;\n /**\n * Optional factory function to provide the context config.\n */\n readonly contextConfigFactory?: DbxFirebaseStorageContextConfigFactory;\n}\n\n/**\n * Creates EnvironmentProviders for the DbxFirebaseStorageService.\n *\n * @param config\n * @returns\n */\nexport function providedDbxFirebaseStorage(config?: ProvideDbxFirebaseStorageConfig): EnvironmentProviders {\n const configFactory = config?.contextConfigFactory ?? dbxFirebaseStorageProvidersContextConfigFactory(config?.contextConfig);\n\n const providers: Provider[] = [\n {\n provide: DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN,\n useFactory: configFactory,\n deps: [FirebaseApp, Injector]\n },\n {\n provide: DBX_FIREBASE_STORAGE_CONTEXT_TOKEN,\n useFactory: clientFirebaseStorageContextFactory,\n deps: [Storage, DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN]\n },\n DbxFirebaseStorageService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseModelModule } from './model/model.module';\n\n@NgModule({\n exports: [DbxFirebaseModelModule]\n})\nexport class DbxFirebaseModule {}\n","import { type EnvironmentProviders, type Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceConfig } from './model.types.service';\n\n/**\n * Factory for DbxFirebaseModelTypesServiceConfig.\n */\nexport type DbxFirebaseModelTypesServiceConfigFactory = (injector: Injector) => DbxFirebaseModelTypesServiceConfig;\n\n/**\n * Configuration for provideDbxFirebaseModelTypesService().\n */\nexport interface ProvideDbxFirebaseModelTypesServiceConfig {\n /**\n * Factory for DbxFirebaseModelTypesServiceConfig.\n */\n readonly dbxFirebaseModelTypesServiceConfigFactory: DbxFirebaseModelTypesServiceConfigFactory;\n}\n\n/**\n * Creates EnvironmentProviders for DbxFirebaseModelTypesService.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseModelTypesService(config: ProvideDbxFirebaseModelTypesServiceConfig): EnvironmentProviders {\n const { dbxFirebaseModelTypesServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseModelTypesServiceConfig,\n useFactory: dbxFirebaseModelTypesServiceConfigFactory\n },\n DbxFirebaseModelTypesService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type ArrayOrValue, asArray, type Maybe } from '@dereekb/util';\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { type FirebaseFunctionsMap } from '@dereekb/firebase';\nimport { provideDbxFirebaseAuth, type ProvideDbxFirebaseAuthConfig } from './auth//firebase.auth.providers';\nimport { provideDbxFirebaseEmulator, type ProvideDbxFirebaseEmulatorsConfig } from './firebase/firebase.emulator.providers';\nimport { provideDbxFirebaseApp, type ProvideDbxFirebaseAppConfig } from './firebase/firebase.providers';\nimport { type ProvideDbxFirebaseFirestoreCollectionConfig, provideDbxFirestoreCollection } from './firestore/firebase.firestore.providers';\nimport { provideDbxFirebaseFunctions, type ProvideDbxFirebaseFunctionsConfig } from './function/firebase.function.providers';\nimport { type ProvideDbxFirebaseStorageConfig, providedDbxFirebaseStorage } from './storage/firebase.storage.providers';\nimport { provideDbxFirebaseDevelopment, type ProvideDbxFirebaseDevelopmentConfig } from './development/development.providers';\nimport { provideDbxFirebaseNotifications, type ProvideDbxFirebaseNotificationsConfig } from './modules/notification/notification.providers';\nimport { provideDbxFirebaseModelContextService, type ProvideDbxFirebaseModelContextServiceConfig } from './model/service/model.context.providers';\nimport { provideDbxFirebaseModelTypesService, type ProvideDbxFirebaseModelTypesServiceConfig } from './model/modules/model/model.types.providers';\nimport { provideDbxFirebaseAnalyticsUserEventsListenerService } from './analytics';\nimport { provideDbxFirebaseStorageFileService } from './modules/storagefile/storagefile.providers';\nimport { provideDbxFirebaseModelEntitiesWidgetService, type ProvideDbxFirebaseModelEntitiesWidgetServiceConfig } from './model/modules/model/entities/model.entities.providers';\n\nexport interface ProvideDbxFirebaseConfig<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap> {\n // Required Configurations\n readonly app: ProvideDbxFirebaseAppConfig;\n readonly emulator: ProvideDbxFirebaseEmulatorsConfig;\n readonly storage: ProvideDbxFirebaseStorageConfig;\n readonly auth: ProvideDbxFirebaseAuthConfig;\n readonly functions: ProvideDbxFirebaseFunctionsConfig<T, M>;\n readonly firestores: ArrayOrValue<ProvideDbxFirebaseFirestoreCollectionConfig<any>>;\n /**\n * Configuration for provideDbxFirebaseModelContextService().\n */\n readonly modelContextService: ProvideDbxFirebaseModelContextServiceConfig<any>;\n /**\n * Configuration for provideDbxFirebaseModelTypesService().\n */\n readonly modelTypesService: ProvideDbxFirebaseModelTypesServiceConfig;\n /**\n * Configuration for provideDbxFirebaseModelEntitiesWidgetService().\n */\n readonly modelEntitiesWidgetService?: Maybe<ProvideDbxFirebaseModelEntitiesWidgetServiceConfig>;\n /**\n * Configuration for provideDbxFirebaseDevelopment.\n *\n * If false, provideDbxFirebaseDevelopment() will not be provided/called.\n */\n readonly development?: ProvideDbxFirebaseDevelopmentConfig | false;\n\n // Optional\n /**\n * Configuration for provideDbxFirebaseNotifications().\n *\n * If not provided, provideDbxFirebaseNotifications() will not be provided/called.\n */\n readonly notifications?: ProvideDbxFirebaseNotificationsConfig;\n\n /**\n * If true, provideDbxFirebaseAnalyticsUserEventsListenerService() will be provided/called.\n */\n readonly provideAnalyticsUserEventsListener?: Maybe<boolean>;\n\n /**\n * If true, provideDbxFirebaseStorageFileService() will be provided/called.\n */\n readonly provideStorageFileService?: Maybe<boolean>;\n}\n\n/**\n * All-in-one provider for providing the main configurations for DbxFirebase.\n *\n * Requires the following already be provided/called:\n * - provideDbxModelService()\n *\n * @param config Configuration for provideDbxFirebase().\n * @returns EnvironmentProviders for the DbxFirebase configuration.\n */\nexport function provideDbxFirebase<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap>(config: ProvideDbxFirebaseConfig<T, M>) {\n const { app, emulator, storage, auth, functions, firestores, modelContextService, modelTypesService, development, notifications, provideAnalyticsUserEventsListener, provideStorageFileService, modelEntitiesWidgetService: inputModelEntitiesWidgetService } = config;\n\n const modelEntitiesWidgetServiceConfig = inputModelEntitiesWidgetService ?? {\n dbxFirebaseModelEntitiesWidgetServiceConfigFactory: () => ({ entries: [] })\n };\n\n const providers: EnvironmentProviders[] = [provideDbxFirebaseApp(app), provideDbxFirebaseEmulator(emulator), providedDbxFirebaseStorage(storage), provideDbxFirebaseAuth(auth), provideDbxFirebaseFunctions(functions), provideDbxFirebaseModelContextService(modelContextService), provideDbxFirebaseModelTypesService(modelTypesService), provideDbxFirebaseModelEntitiesWidgetService(modelEntitiesWidgetServiceConfig)];\n\n asArray(firestores).forEach((firestore) => {\n providers.push(provideDbxFirestoreCollection(firestore));\n });\n\n if (provideAnalyticsUserEventsListener) {\n providers.push(provideDbxFirebaseAnalyticsUserEventsListenerService());\n }\n\n if (development !== false) {\n providers.push(provideDbxFirebaseDevelopment(development ?? {}));\n }\n\n if (notifications != null) {\n providers.push(provideDbxFirebaseNotifications(notifications));\n }\n\n if (provideStorageFileService) {\n providers.push(provideDbxFirebaseStorageFileService());\n }\n\n return makeEnvironmentProviders(providers);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i3","i1.DbxFirebaseLoginButtonComponent","i1.DbxFirebaseLoginButtonContainerComponent","i1","importsAndExports","i1.NotificationBoxDocumentStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBM,SAAU,wBAAwB,CAAC,IAAU,EAAA;IACjD,OAAO;QACL,WAAW,EAAE,IAAI,EAAE,WAAW;QAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;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/auth/service/firebase.auth.rxjs.ts","../../../../packages/dbx-firebase/src/lib/auth/service/firebase.auth.service.ts","../../../../packages/dbx-firebase/src/lib/analytics/analytics.user.source.ts","../../../../packages/dbx-firebase/src/lib/analytics/analytics.user.events.service.ts","../../../../packages/dbx-firebase/src/lib/analytics/analytics.user.events.providers.ts","../../../../packages/dbx-firebase/src/lib/auth/appcheck/appcheck.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.options.ts","../../../../packages/dbx-firebase/src/lib/auth/appcheck/appcheck.interceptor.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.terms.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.terms.simple.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.password.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.service.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.context.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.button.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.anonymous.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.recovery.form.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.form.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.content.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.content.component.html","../../../../packages/dbx-firebase/src/lib/auth/login/login.email.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.facebook.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.github.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.google.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.twitter.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/register.email.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/firebase.login.providers.default.ts","../../../../packages/dbx-firebase/src/lib/auth/login/firebase.login.providers.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.apple.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.list.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.context.directive.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.context.back.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.microsoft.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/login.terms.component.ts","../../../../packages/dbx-firebase/src/lib/auth/login/register.component.ts","../../../../packages/dbx-firebase/src/lib/auth/service/firebase.auth.service.delegate.ts","../../../../packages/dbx-firebase/src/lib/auth/firebase.auth.providers.ts","../../../../packages/dbx-firebase/src/lib/development/development.widget.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.scheduler.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.popup.content.form.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.scheduler.list.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.scheduler.widget.component.ts","../../../../packages/dbx-firebase/src/lib/firebase/emulators.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.emulator.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.popup.content.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.popup.content.component.html","../../../../packages/dbx-firebase/src/lib/development/development.popup.component.ts","../../../../packages/dbx-firebase/src/lib/development/development.service.ts","../../../../packages/dbx-firebase/src/lib/development/development.directive.ts","../../../../packages/dbx-firebase/src/lib/development/development.module.ts","../../../../packages/dbx-firebase/src/lib/development/development.providers.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.providers.ts","../../../../packages/dbx-firebase/src/lib/firebase/firebase.emulator.providers.ts","../../../../packages/dbx-firebase/src/lib/firestore/firebase.firestore.ts","../../../../packages/dbx-firebase/src/lib/firestore/firebase.firestore.providers.ts","../../../../packages/dbx-firebase/src/lib/firestore/firebase.firestore.context.service.ts","../../../../packages/dbx-firebase/src/lib/function/firebase.function.providers.ts","../../../../packages/dbx-firebase/src/lib/model/loader/collection.change.watcher.ts","../../../../packages/dbx-firebase/src/lib/model/loader/collection.change.trigger.ts","../../../../packages/dbx-firebase/src/lib/model/loader/collection.loader.instance.ts","../../../../packages/dbx-firebase/src/lib/model/loader/document.loader.instance.ts","../../../../packages/dbx-firebase/src/lib/model/service/model.context.instance.ts","../../../../packages/dbx-firebase/src/lib/model/service/model.context.service.ts","../../../../packages/dbx-firebase/src/lib/model/service/model.context.providers.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.service.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.tracker.service.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.list.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.popover.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.popover.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.history.popover.button.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/history/model.sourceselect.history.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.service.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.entity.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.entity.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.popover.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.popover.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.popover.button.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.providers.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.context.store.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.source.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.entity.abstract.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.key.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.key.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.entity.debug.component.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/entities/model.entities.widget.entity.debug.component.html","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.view.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.change.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.change.if.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.list.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.twoway.key.source.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.twoway.key.source.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.twoway.key.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/model.store.module.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.collection.crud.ts","../../../../packages/dbx-firebase/src/lib/model/error.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.context.store.link.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.crud.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.rxjs.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.document.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.subcollection.directive.ts","../../../../packages/dbx-firebase/src/lib/model/modules/store/store.document.context.store.directive.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.collection.store.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.document.store.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.document.store.accessor.ts","../../../../packages/dbx-firebase/src/lib/model/system/systemstate.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/model/model.module.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/service/notification.template.service.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.list.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.content.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.content.component.html","../../../../packages/dbx-firebase/src/lib/modules/notification/service/notificationitem.widget.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/service/notificationitem.widget.service.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.view.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.view.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/component/notificationitem.view.default.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/container/notification.item.store.popover.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/container/notification.item.store.popover.component.html","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.item.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/container/notification.item.store.popover.button.component.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notification.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationbox.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationsummary.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/store/notificationuser.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/notification/notification.providers.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/service/storagefile.download.storage.service.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/service/storagefile.download.service.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.download.button.component.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.upload.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.handler.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.error.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.action.handler.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.collection.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.collection.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefile.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefilegroup.document.store.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/store/storagefilegroup.document.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.initialize.document.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.store.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/container/storagefile.upload.sync.directive.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/storagefile.upload.module.ts","../../../../packages/dbx-firebase/src/lib/modules/storagefile/storagefile.providers.ts","../../../../packages/dbx-firebase/src/lib/pipe/key.flat.pipe.ts","../../../../packages/dbx-firebase/src/lib/pipe/key.twoway.pipe.ts","../../../../packages/dbx-firebase/src/lib/router/id.param.redirect.ts","../../../../packages/dbx-firebase/src/lib/storage/firebase.storage.ts","../../../../packages/dbx-firebase/src/lib/storage/firebase.storage.service.ts","../../../../packages/dbx-firebase/src/lib/storage/firebase.storage.providers.ts","../../../../packages/dbx-firebase/src/lib/module.ts","../../../../packages/dbx-firebase/src/lib/model/modules/model/model.types.providers.ts","../../../../packages/dbx-firebase/src/lib/providers.ts","../../../../packages/dbx-firebase/src/dereekb-dbx-firebase.ts"],"sourcesContent":["import { safeFormatToISO8601DateString } from '@dereekb/date';\nimport { type FirebaseAuthToken } from '@dereekb/firebase';\nimport { type ISO8601DateString, type Maybe } from '@dereekb/util';\nimport { type User, type UserInfo } from 'firebase/auth';\n\nexport type AuthUserInfo = Omit<UserInfo, 'providerId'> & {\n /**\n * The creation time of the user's account.\n */\n readonly creationTime?: Maybe<ISO8601DateString>;\n /**\n * The last time the user signed in and recieved a refresh token.\n */\n readonly lastSignInTime?: Maybe<ISO8601DateString>;\n};\n\nexport function authUserInfoFromAuthUser(user: User): AuthUserInfo {\n return {\n displayName: user?.displayName,\n email: user.email,\n phoneNumber: user.phoneNumber,\n photoURL: user.photoURL,\n uid: user.uid,\n creationTime: safeFormatToISO8601DateString(user.metadata.creationTime),\n lastSignInTime: safeFormatToISO8601DateString(user.metadata.lastSignInTime)\n };\n}\n\nexport function firebaseAuthTokenFromUser(user: User): FirebaseAuthToken {\n return {\n email: user.email,\n emailVerified: user.emailVerified,\n phoneNumber: user.phoneNumber,\n creationTime: safeFormatToISO8601DateString(user.metadata.creationTime),\n lastSignInTime: safeFormatToISO8601DateString(user.metadata.lastSignInTime)\n };\n}\n","import { type AuthUserState } from '@dereekb/dbx-core';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type IdTokenResult } from 'firebase/auth';\nimport { type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { type AuthUserStateObsFunction, type DbxFirebaseAuthService } from './firebase.auth.service';\n\n/**\n * Creates a AuthUserStateObsFunction that derives a user state from the input firebase auth service, and the optional stateForLoggedInUser input\n *\n * @param stateForLoggedInUser Optional function that returns an observable for the user's state if they are logged in and not an anonymous user.\n * @returns\n */\nexport function authUserStateFromFirebaseAuthServiceFunction(stateForLoggedInUser: AuthUserStateObsFunction = () => of('user')): AuthUserStateObsFunction {\n return (dbxFirebaseAuthService: DbxFirebaseAuthService) => {\n return dbxFirebaseAuthService.hasAuthUser$.pipe(\n switchMap((hasUser) => {\n let obs: Observable<AuthUserState>;\n\n if (hasUser) {\n obs = dbxFirebaseAuthService.isAnonymousUser$.pipe(switchMap((isAnon) => (isAnon ? of('anon' as AuthUserState) : stateForLoggedInUser(dbxFirebaseAuthService))));\n } else {\n obs = of('none');\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n };\n}\n\nexport type StateFromTokenFunction = (token: IdTokenResult) => ObservableOrValue<AuthUserState>;\n\nexport function stateFromTokenForLoggedInUserFunction(stateFromToken: StateFromTokenFunction, defaultState: AuthUserState = 'user'): AuthUserStateObsFunction {\n return (dbxFirebaseAuthService: DbxFirebaseAuthService) => {\n return readValueFromIdToken<AuthUserState>(dbxFirebaseAuthService, stateFromToken, defaultState);\n };\n}\n\n/**\n * Convenience function to read a value from an IdTokenResult off of the current user.\n *\n * @param dbxFirebaseAuthService\n * @param readValueFromIdToken\n * @param defaultValue\n * @returns\n */\nexport function readValueFromIdToken<T>(dbxFirebaseAuthService: DbxFirebaseAuthService, readValueFromIdToken: (idToken: IdTokenResult) => ObservableOrValue<T>, defaultValue: T): Observable<T> {\n return dbxFirebaseAuthService.currentAuthUserInfo$.pipe(\n switchMap((x) => {\n if (x) {\n return dbxFirebaseAuthService.idTokenResult$.pipe(switchMap((x) => asObservable(readValueFromIdToken(x))));\n } else {\n return of(defaultValue);\n }\n })\n );\n}\n","import { filterMaybe, isNot, timeoutStartWith } from '@dereekb/rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { AuthUserState, DbxAuthService, loggedOutObsFromIsLoggedIn, loggedInObsFromIsLoggedIn, AuthUserIdentifier, authUserIdentifier, NoAuthUserIdentifier } from '@dereekb/dbx-core';\nimport { reauthenticateWithPopup, Auth, authState, idToken, User, IdTokenResult, ParsedToken, GoogleAuthProvider, signInWithPopup, AuthProvider, PopupRedirectResolver, signInAnonymously, signInWithEmailAndPassword, UserCredential, FacebookAuthProvider, GithubAuthProvider, TwitterAuthProvider, createUserWithEmailAndPassword } from '@angular/fire/auth';\nimport { of, Observable, distinctUntilChanged, shareReplay, map, switchMap, firstValueFrom, catchError, EMPTY } from 'rxjs';\nimport { AuthClaims, AuthClaimsObject, AuthRoleClaimsService, AuthRoleSet, AUTH_ADMIN_ROLE, cachedGetter, type Maybe } from '@dereekb/util';\nimport { AuthUserInfo, authUserInfoFromAuthUser, firebaseAuthTokenFromUser } from '../auth';\nimport { sendPasswordResetEmail } from 'firebase/auth';\nimport { authUserStateFromFirebaseAuthServiceFunction } from './firebase.auth.rxjs';\nimport { FirebaseAuthContextInfo } from '@dereekb/firebase';\n\n/**\n * Returns an observable that returns the state of the\n */\nexport type AuthUserStateObsFunction = (dbxFirebaseAuthService: DbxFirebaseAuthService) => Observable<AuthUserState>;\n\n// MARK: Delegate\nexport abstract class DbxFirebaseAuthServiceDelegate {\n readonly fullControlOfAuthUserState?: boolean = false;\n abstract authUserStateObs: AuthUserStateObsFunction;\n abstract authRolesObs(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<AuthRoleSet>;\n abstract isOnboarded(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<boolean>;\n /**\n * Whether or not the input roles imply the admin priviledges.\n */\n abstract isAdminInAuthRoleSet(authRoleSet: AuthRoleSet): boolean;\n abstract authRoleClaimsService?: Maybe<AuthRoleClaimsService<AuthClaimsObject>>;\n}\n\nexport const DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE: DbxFirebaseAuthServiceDelegate = {\n authUserStateObs: authUserStateFromFirebaseAuthServiceFunction(),\n authRolesObs(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<AuthRoleSet> {\n return dbxFirebaseAuthService.authUserState$.pipe(map((x) => (x === 'user' ? new Set(['user']) : new Set())));\n },\n isOnboarded(dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<boolean> {\n return dbxFirebaseAuthService.authUserState$.pipe(map((x) => x === 'user'));\n },\n isAdminInAuthRoleSet(authRoleSet: AuthRoleSet): boolean {\n return authRoleSet.has(AUTH_ADMIN_ROLE);\n }\n};\n\n// MARK: Service\n@Injectable()\nexport class DbxFirebaseAuthService implements DbxAuthService {\n readonly firebaseAuth = inject(Auth);\n readonly delegate = inject(DbxFirebaseAuthServiceDelegate, { optional: true }) ?? DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE;\n\n readonly _authState$: Observable<Maybe<User>> = authState(this.firebaseAuth);\n\n readonly currentAuthUser$: Observable<Maybe<User>> = this._authState$.pipe(timeoutStartWith(null as Maybe<User>, 1000), distinctUntilChanged(), shareReplay(1));\n readonly currentAuthUserInfo$: Observable<Maybe<AuthUserInfo>> = this.currentAuthUser$.pipe(map((x) => (x ? authUserInfoFromAuthUser(x) : undefined)));\n\n readonly authUser$: Observable<User> = this.currentAuthUser$.pipe(filterMaybe());\n readonly authUserInfo$: Observable<AuthUserInfo> = this.authUser$.pipe(map(authUserInfoFromAuthUser));\n\n readonly hasAuthUser$: Observable<boolean> = this.currentAuthUser$.pipe(\n map((x) => Boolean(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isAnonymousUser$: Observable<boolean> = this.authUser$.pipe(\n map((x) => x.isAnonymous),\n distinctUntilChanged(),\n shareReplay(1)\n );\n readonly isNotAnonymousUser$: Observable<boolean> = this.isAnonymousUser$.pipe(isNot(), distinctUntilChanged(), shareReplay(1));\n\n readonly isLoggedIn$: Observable<boolean> = this.hasAuthUser$;\n readonly isNotLoggedIn$: Observable<boolean> = this.isLoggedIn$.pipe(isNot());\n readonly onLogIn$: Observable<void> = loggedInObsFromIsLoggedIn(this.isLoggedIn$);\n readonly onLogOut$: Observable<void> = loggedOutObsFromIsLoggedIn(this.isLoggedIn$);\n\n readonly currentUid$: Observable<Maybe<AuthUserIdentifier>> = this.currentAuthUser$.pipe(\n map((x) => x?.uid),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly uid$: Observable<AuthUserIdentifier | NoAuthUserIdentifier> = this.currentUid$.pipe(map(authUserIdentifier), distinctUntilChanged(), shareReplay(1));\n /**\n * Alias for uid$\n */\n readonly userIdentifier$: Observable<AuthUserIdentifier | NoAuthUserIdentifier> = this.uid$;\n\n readonly currentIdTokenString$: Observable<Maybe<string>> = idToken(this.firebaseAuth).pipe(distinctUntilChanged(), shareReplay(1));\n readonly idTokenString$: Observable<string> = this.currentUid$.pipe(switchMap((x) => (x ? this.currentIdTokenString$.pipe(filterMaybe()) : EMPTY)));\n\n readonly currentIdTokenResult$: Observable<Maybe<IdTokenResult>> = this.currentAuthUser$.pipe(\n switchMap((x) => (x ? this.currentIdTokenString$.pipe(switchMap((y) => (y ? x.getIdTokenResult() : of(null)))) : of(null))),\n distinctUntilChanged(),\n shareReplay(1)\n );\n readonly idTokenResult$: Observable<IdTokenResult> = this.currentIdTokenResult$.pipe(filterMaybe());\n\n readonly currentClaims$: Observable<Maybe<ParsedToken>> = this.currentIdTokenResult$.pipe(\n map((x) => (x ? x.claims : null)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n readonly claims$: Observable<ParsedToken> = this.currentClaims$.pipe(filterMaybe());\n\n readonly currentAuthContextInfo$: Observable<Maybe<DbxFirebaseAuthContextInfo>> = this.currentAuthUser$.pipe(\n switchMap((x) => this.loadAuthContextInfoForUser(x)),\n shareReplay(1)\n );\n readonly authContextInfo$: Observable<Maybe<DbxFirebaseAuthContextInfo>> = this.currentAuthContextInfo$.pipe(filterMaybe());\n\n readonly authUserState$: Observable<AuthUserState> = (() => {\n const delegateAuthUserStateObs: Observable<AuthUserState> = this.delegate.authUserStateObs(this).pipe(\n catchError(() => of('error' as AuthUserState)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n let obs: Observable<AuthUserState>;\n\n if (this.delegate.fullControlOfAuthUserState) {\n obs = delegateAuthUserStateObs;\n } else {\n obs = this._authState$.pipe(\n distinctUntilChanged(),\n switchMap((x) => {\n if (x != null) {\n return delegateAuthUserStateObs;\n } else {\n return of('none' as AuthUserState);\n }\n })\n );\n }\n\n return obs;\n })();\n\n readonly authRoles$: Observable<AuthRoleSet> = this.delegate.authRolesObs(this);\n readonly isOnboarded$: Observable<boolean> = this.delegate.isOnboarded(this);\n\n private _authRoleClaimsService?: Maybe<AuthRoleClaimsService<AuthClaimsObject>> = this.delegate.authRoleClaimsService;\n readonly isAdminInAuthRoleSet: (authRoleSet: AuthRoleSet) => boolean = this.delegate.isAdminInAuthRoleSet;\n\n async refreshToken(): Promise<IdTokenResult> {\n const user = this.firebaseAuth.currentUser;\n\n if (!user) {\n throw new Error('no user to refresh the token for.');\n }\n\n return user.getIdTokenResult(true);\n }\n\n rolesForClaims<T extends AuthClaimsObject = AuthClaimsObject>(claims: AuthClaims<T>): AuthRoleSet {\n let result: AuthRoleSet;\n\n if (this._authRoleClaimsService) {\n return this._authRoleClaimsService.toRoles(claims);\n } else {\n console.warn('DbxFirebaseAuthService: rolesForClaims called with no authRoleClaimsService provided. An empty set is returned.');\n result = new Set();\n }\n\n return result;\n }\n\n getAuthContextInfo(): Promise<Maybe<DbxFirebaseAuthContextInfo>> {\n return firstValueFrom(this.authUser$).then((user) => this.loadAuthContextInfoForUser(user));\n }\n\n async loadAuthContextInfoForUser(user: Maybe<User>): Promise<Maybe<DbxFirebaseAuthContextInfo>> {\n let result: Maybe<DbxFirebaseAuthContextInfo>;\n\n if (user) {\n const jwtToken: IdTokenResult = await user.getIdTokenResult();\n result = dbxFirebaseAuthContextInfo(this, user, jwtToken);\n }\n\n return result;\n }\n\n logInWithGoogle(): Promise<UserCredential> {\n return this.logInWithPopup(new GoogleAuthProvider());\n }\n\n logInWithFacebook(): Promise<UserCredential> {\n return this.logInWithPopup(new FacebookAuthProvider());\n }\n\n logInWithTwitter(): Promise<UserCredential> {\n return this.logInWithPopup(new TwitterAuthProvider());\n }\n\n logInWithGithub(): Promise<UserCredential> {\n return this.logInWithPopup(new GithubAuthProvider());\n }\n\n logInWithApple(): Promise<UserCredential> {\n throw new Error('todo');\n }\n\n logInWithMicrosoft(): Promise<UserCredential> {\n // return this.logInWithPopup(new MicrosoftAuthProvider());\n throw new Error('todo');\n }\n\n logInWithPhone(): Promise<UserCredential> {\n throw new Error('todo');\n // return signInWithPhoneNumber(this.firebaseAuth, )\n }\n\n logInWithPopup(provider: AuthProvider, resolver?: PopupRedirectResolver): Promise<UserCredential> {\n return signInWithPopup(this.firebaseAuth, provider, resolver);\n }\n\n registerWithEmailAndPassword(email: string, password: string): Promise<UserCredential> {\n return createUserWithEmailAndPassword(this.firebaseAuth, email, password);\n }\n\n sendPasswordResetEmail(email: string): Promise<void> {\n return sendPasswordResetEmail(this.firebaseAuth, email);\n }\n\n logInWithEmailAndPassword(email: string, password: string): Promise<UserCredential> {\n return signInWithEmailAndPassword(this.firebaseAuth, email, password);\n }\n\n logInAsAnonymous(): Promise<UserCredential> {\n return signInAnonymously(this.firebaseAuth);\n }\n\n logOut(): Promise<void> {\n return this.firebaseAuth.signOut();\n }\n\n reauthenticateWithPopup(provider: AuthProvider, resolver?: PopupRedirectResolver): Promise<UserCredential> {\n return firstValueFrom(\n this.currentAuthUser$.pipe(\n switchMap((x: Maybe<User>) => {\n if (x) {\n return reauthenticateWithPopup(x, provider, resolver);\n } else {\n throw new Error('User is not logged in currently.');\n }\n })\n )\n );\n }\n}\n\n/**\n * FirebaseAuthContextInfo implementation from DbxFirebaseAuthService.\n */\nexport interface DbxFirebaseAuthContextInfo extends FirebaseAuthContextInfo {\n readonly service: DbxFirebaseAuthService;\n readonly user: User;\n readonly jwtToken: IdTokenResult;\n}\n\n/**\n * Creates a new DbxFirebaseAuthContextInfo instance.\n *\n * @param service\n * @param user\n * @param jwtToken\n * @returns\n */\nexport function dbxFirebaseAuthContextInfo(service: DbxFirebaseAuthService, user: User, jwtToken: IdTokenResult): DbxFirebaseAuthContextInfo {\n function getClaims<T extends AuthClaimsObject = AuthClaimsObject>(): AuthClaims<T> {\n return jwtToken.claims as AuthClaims<T>;\n }\n\n const { uid } = user;\n const token = firebaseAuthTokenFromUser(user);\n const getAuthRoles = cachedGetter(() => service.rolesForClaims(getClaims()));\n const isAdmin = cachedGetter(() => service.isAdminInAuthRoleSet(getAuthRoles()));\n\n const result: DbxFirebaseAuthContextInfo = {\n service,\n user,\n jwtToken,\n\n uid,\n\n isAdmin,\n getClaims,\n getAuthRoles,\n\n token\n };\n\n return result;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAnalyticsUser, DbxAnalyticsUserProperties, DbxAnalyticsUserSource } from '@dereekb/dbx-analytics';\nimport { FactoryWithRequiredInput, type Maybe } from '@dereekb/util';\nimport { BehaviorSubject, map, Observable, of, switchMap, shareReplay, combineLatest } from 'rxjs';\nimport { AuthUserInfo } from '../auth/auth';\nimport { DbxFirebaseAuthService } from '../auth/service/firebase.auth.service';\n\nexport type DbxFirebaseAnalyticsUserPropertiesFactory = FactoryWithRequiredInput<Observable<DbxAnalyticsUserProperties>, AuthUserInfo>;\n\nexport function readDbxAnalyticsUserPropertiesFromAuthUserInfo(user: AuthUserInfo): DbxAnalyticsUserProperties {\n const properties: DbxAnalyticsUserProperties = {\n name: user.displayName ?? '',\n email: user.email ?? '',\n createdAt: user.creationTime ?? ''\n };\n\n return properties;\n}\n\nexport const DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY: DbxFirebaseAnalyticsUserPropertiesFactory = (authUserInfo: AuthUserInfo) => of(readDbxAnalyticsUserPropertiesFromAuthUserInfo(authUserInfo));\n\n/**\n * DbxAnalyticsUserSource implementation that uses the DbxFirebaseAuthService.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirebaseAnalyticsUserSource implements DbxAnalyticsUserSource {\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n\n private _userPropertiesFactory = new BehaviorSubject<DbxFirebaseAnalyticsUserPropertiesFactory>(DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY);\n\n readonly analyticsUser$: Observable<Maybe<DbxAnalyticsUser>> = combineLatest([this._userPropertiesFactory, this.dbxFirebaseAuthService.currentAuthUserInfo$]).pipe(\n switchMap(([userPropertiesFactory, x]) => {\n let analyticsUser: Observable<Maybe<DbxAnalyticsUser>>;\n\n if (x != null) {\n analyticsUser = userPropertiesFactory(x).pipe(\n map((properties) => ({\n user: x.uid,\n properties\n }))\n );\n } else {\n analyticsUser = of(null);\n }\n\n return analyticsUser;\n }),\n shareReplay(1)\n );\n\n get userPropertiesFactory() {\n return this._userPropertiesFactory.value;\n }\n\n set userPropertiesFactory(userPropertiesFactory: DbxFirebaseAnalyticsUserPropertiesFactory) {\n this._userPropertiesFactory.next(userPropertiesFactory);\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { DbxAnalyticsService } from '@dereekb/dbx-analytics';\nimport { filterMaybe, SubscriptionObject } from '@dereekb/rxjs';\nimport { Destroyable, Initialized } from '@dereekb/util';\nimport { first } from 'rxjs';\nimport { DbxFirebaseAuthService } from '../auth/service/firebase.auth.service';\nimport { DbxFirebaseAnalyticsUserSource } from './analytics.user.source';\n\n/**\n * Service that listens for DbxFirebaseAuthService changes and emits them a user events.\n */\n@Injectable()\nexport class DbxFirebaseAnalyticsUserEventsListenerService implements Initialized, Destroyable {\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n readonly dbxFirebaseAnalyticsUserSource = inject(DbxFirebaseAnalyticsUserSource);\n readonly dbxAnalyticsService = inject(DbxAnalyticsService);\n\n private readonly _loginSub = new SubscriptionObject();\n private readonly _logoutSub = new SubscriptionObject();\n\n init(): void {\n this._loginSub.subscription = this.dbxFirebaseAuthService.onLogIn$.subscribe(() => {\n this.dbxFirebaseAnalyticsUserSource.analyticsUser$.pipe(filterMaybe(), first()).subscribe((analyticsUser) => {\n this.dbxAnalyticsService.sendUserLoginEvent(analyticsUser);\n });\n });\n\n this._logoutSub.subscription = this.dbxFirebaseAuthService.onLogOut$.subscribe(() => {\n this.dbxAnalyticsService.sendUserLogoutEvent(undefined, false); // do not clear user. Will be cleared by the analytics service\n });\n }\n\n destroy(): void {\n this._loginSub.destroy();\n this._logoutSub.destroy();\n }\n}\n","import { type EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer, type Provider } from '@angular/core';\nimport { DbxFirebaseAnalyticsUserEventsListenerService } from './analytics.user.events.service';\n\n/**\n * Creates a EnvironmentProviders that provides a DbxFirebaseAnalyticsUserEventsListenerService and initialize it when the app is initialized.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseAnalyticsUserEventsListenerService() {\n const providers: (EnvironmentProviders | Provider)[] = [\n DbxFirebaseAnalyticsUserEventsListenerService,\n // service initialization\n provideAppInitializer(() => {\n const service = inject(DbxFirebaseAnalyticsUserEventsListenerService);\n service.init();\n })\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","/**\n * Enables debug token generation for AppCheck by setting FIREBASE_APPCHECK_DEBUG_TOKEN in the browser's self/window.\n *\n * https://firebase.google.com/docs/app-check/web/debug-provider\n *\n * @param enable\n */\nexport function enableAppCheckDebugTokenGeneration(enable = true) {\n (self as unknown as { FIREBASE_APPCHECK_DEBUG_TOKEN: boolean }).FIREBASE_APPCHECK_DEBUG_TOKEN = enable;\n}\n","import { InjectionToken } from '@angular/core';\nimport { type PersistentCacheSettings } from 'firebase/firestore';\nimport { type FirebaseOptions } from 'firebase/app';\nimport { type DbxFirebaseAppCheckConfig } from './appcheck';\nimport { type DbxFirebaseEmulatorsConfig } from './emulators';\n\nexport const DBX_FIREBASE_APP_OPTIONS_TOKEN = new InjectionToken<DbxFirebaseAppOptions>('DbxFirebaseOptions');\n\n/**\n * Extends FirebaseOptions with additional properties for configuring the underlying client-side Firebase services.\n */\nexport interface DbxFirebaseAppOptions extends FirebaseOptions {\n readonly emulators: DbxFirebaseEmulatorsConfig;\n /**\n * Firebase AppCheck handling\n */\n readonly appCheck?: DbxFirebaseAppCheckConfig;\n /**\n * Passed to the Functions initialization to set the domain to use when sending requests.\n */\n readonly functionsRegionOrCustomDomain?: string | undefined;\n /**\n * Whether or not to call enableMultiTabIndexedDbPersistence() for firestore at setup time.\n *\n * True by default.\n */\n readonly enableMultiTabIndexedDbPersistence?: boolean;\n /**\n * Whether or not to call enableIndexedDbPersistence() for firestore at setup time.\n *\n * True by default if enableMultiTabIndexedDbPersistence is false.\n */\n readonly enableIndexedDbPersistence?: boolean;\n /**\n * Optional persistent cache setting to pass to the Firestore cache.\n */\n readonly persistentCacheSettings?: Omit<PersistentCacheSettings, 'tabManager'>;\n}\n","import { urlWithoutParameters } from '@dereekb/util';\nimport { DBX_FIREBASE_APP_OPTIONS_TOKEN, DbxFirebaseAppOptions } from '../../firebase/firebase.options';\nimport { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';\nimport { getToken } from 'firebase/app-check';\nimport { Observable, switchMap, first, map, from } from 'rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { AppCheck } from '@angular/fire/app-check';\n\ninterface EnabledAppCheckRoute {\n isWildcard: boolean;\n match: string;\n}\n\n/**\n * HTTP Interceptor that sets the X-Firebase-AppCheck for any requests to the routes configured in DbxFirebaseEnvironmentOptions.\n */\n@Injectable()\nexport class DbxFirebaseAppCheckHttpInterceptor implements HttpInterceptor {\n private appCheck = inject(AppCheck);\n\n private _appCheckRoutes: EnabledAppCheckRoute[] = ((dbxFirebaseOptions: DbxFirebaseAppOptions) => {\n const { appCheck } = dbxFirebaseOptions;\n\n let routes: EnabledAppCheckRoute[] = [];\n\n if (appCheck?.disabled !== false) {\n routes = (appCheck?.appCheckRoutes ?? ['/api/*']).map((route) => {\n const wildcardIndex = route.indexOf('*');\n const isWildcard = wildcardIndex === route.length - 1;\n const match = isWildcard ? route.substring(0, wildcardIndex) : route;\n\n return {\n isWildcard,\n match\n };\n });\n }\n\n return routes;\n })(inject<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN));\n\n private _isEnabled: boolean = this._appCheckRoutes.length > 0;\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n let obs: Observable<HttpEvent<unknown>>;\n\n if (this._isEnabled) {\n obs = this.matchesAnyRoute(req.url).pipe(\n switchMap((isMatch) => {\n let nextEvent: Observable<HttpEvent<unknown>>;\n\n if (isMatch) {\n nextEvent = from(\n getToken(this.appCheck).then((appCheckTokenResponse) => {\n const token = appCheckTokenResponse.token;\n let nextRequest: HttpRequest<unknown> = req;\n\n if (token) {\n nextRequest = req.clone({\n headers: req.headers.set('X-Firebase-AppCheck', token)\n });\n }\n\n return nextRequest;\n })\n ).pipe(switchMap((nextRequest) => next.handle(nextRequest)));\n } else {\n nextEvent = next.handle(req);\n }\n\n return nextEvent;\n })\n );\n } else {\n obs = next.handle(req);\n }\n\n return obs;\n }\n\n private matchesAnyRoute(inputUrl: string): Observable<boolean> {\n const url = urlWithoutParameters(inputUrl);\n\n function isEnabledRouteMatch(enabledRoute: EnabledAppCheckRoute): boolean {\n if (enabledRoute.isWildcard) {\n return url.startsWith(enabledRoute.match);\n } else {\n return url === enabledRoute.match;\n }\n }\n\n return from(this._appCheckRoutes).pipe(\n first((route) => isEnabledRouteMatch(route), false),\n map((x) => Boolean(x))\n );\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Configuration interface for DbxFirebaseLoginTermsSimpleComponent.\n */\nexport interface DbxFirebaseLoginTermsOfServiceUrlsConfig {\n /**\n * The Terms of Service URL.\n */\n readonly tosUrl: string;\n /**\n * The Privacy Policy URL.\n */\n readonly privacyUrl: string;\n}\n\n/**\n * Injection token for DbxFirebaseLoginTermsOfServiceUrlsConfig.\n */\nexport const DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG = new InjectionToken<DbxFirebaseLoginTermsOfServiceUrlsConfig>('DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG');\n","import { ClickableAnchor } from '@dereekb/dbx-core';\nimport { Component, inject } from '@angular/core';\nimport { DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG } from './login.terms';\nimport { DbxLinkComponent } from '@dereekb/dbx-web';\n\n@Component({\n template: `\n <div class=\"dbx-firebase-login-terms-view\">\n <dbx-link [anchor]=\"tosAnchor\">Terms</dbx-link>\n <span class=\"dbx-link-spacer\"></span>\n <dbx-link [anchor]=\"privacyAnchor\">Privacy</dbx-link>\n </div>\n `,\n standalone: true,\n imports: [DbxLinkComponent]\n})\nexport class DbxFirebaseLoginTermsSimpleComponent {\n readonly dbxFirebaseLoginTermsConfig = inject(DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG);\n\n readonly tosAnchor: ClickableAnchor = {\n url: this.dbxFirebaseLoginTermsConfig.tosUrl,\n target: '_blank'\n };\n\n readonly privacyAnchor: ClickableAnchor = {\n url: this.dbxFirebaseLoginTermsConfig.privacyUrl,\n target: '_blank'\n };\n}\n","import { type TextPasswordFieldPasswordParameters } from '@dereekb/dbx-form';\n\nexport type DbxFirebaseAuthLoginPasswordConfig = TextPasswordFieldPasswordParameters;\n\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG: DbxFirebaseAuthLoginPasswordConfig = {\n minLength: 6\n};\n","import { mapIterable, addToSet, removeFromSet, Maybe, ArrayOrValue, filterMaybeArrayValues } from '@dereekb/util';\nimport { Injectable, InjectionToken, Type, inject } from '@angular/core';\nimport { FirebaseLoginMethodCategory, FirebaseLoginMethodType, KnownFirebaseLoginMethodType } from './login';\nimport { DbxFirebaseLoginTermsSimpleComponent } from './login.terms.simple.component';\nimport { DbxFirebaseAuthLoginPasswordConfig, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG } from './login.password';\n\n/**\n * Default providers to inject.\n */\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN = new InjectionToken<DbxFirebaseAuthLoginProvider[]>('DefaultDbxFirebaseAuthLoginProviders');\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN = new InjectionToken<Type<unknown>>('DefaultDbxFirebaseAuthLoginTermsComponentClass');\nexport const DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN = new InjectionToken<DbxFirebaseAuthLoginPasswordConfig>('DefaultDbxFirebaseAuthLoginPasswordConfig');\n\nexport interface DbxFirebaseAuthLoginProvider<D = unknown> {\n /**\n * Category for this login method.\n */\n readonly category?: FirebaseLoginMethodCategory;\n /**\n * Login method key for this type.\n */\n readonly loginMethodType: KnownFirebaseLoginMethodType | FirebaseLoginMethodType;\n /**\n * Login/Registration class to use.\n */\n readonly componentClass: Type<unknown>;\n /**\n * Custom registration type to use instead. If false, registration is not allowd for this type.\n */\n readonly registrationComponentClass?: Type<unknown> | false;\n /**\n * Custom data available to the components.\n *\n * Components are responsible for knowing the typing information of this data.\n */\n readonly componentData?: D;\n /**\n * Asset configuration for this type.\n */\n readonly assets: DbxFirebaseAuthLoginProviderAssets;\n}\n\n/**\n * Asset configurations for a provider.\n */\nexport interface DbxFirebaseAuthLoginProviderAssets {\n /**\n * URL of the logo to use.\n */\n readonly logoUrl?: string;\n /**\n * Icon to use in place of the logo.\n */\n readonly loginIcon?: string;\n /**\n * Log in text to display next to the logo.\n */\n readonly loginText?: string;\n /**\n * Optional background color to apply.\n */\n readonly backgroundColor?: string;\n /**\n * Optional background color to apply.\n */\n readonly textColor?: string;\n}\n\n/**\n * Service used for registering components used for logging in.\n *\n * Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.\n */\n@Injectable()\nexport class DbxFirebaseAuthLoginService {\n readonly loginTermsComponentClass = inject(DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN, { optional: true }) ?? DbxFirebaseLoginTermsSimpleComponent;\n\n private readonly _providers = new Map<FirebaseLoginMethodType, DbxFirebaseAuthLoginProvider>();\n private readonly _assets = new Map<FirebaseLoginMethodType, DbxFirebaseAuthLoginProviderAssets>();\n\n private _enableAll = false;\n private _passwordConfig: DbxFirebaseAuthLoginPasswordConfig;\n private _enabled = new Set<FirebaseLoginMethodType>();\n\n constructor() {\n const defaultProviders = inject(DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, { optional: true });\n const passwordConfig = inject(DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, { optional: true });\n\n if (defaultProviders) {\n defaultProviders.forEach((x) => this.register(x, false));\n }\n\n this._passwordConfig = passwordConfig ?? DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG;\n }\n\n /**\n * Used to register a provider. If a provider is already registered, this will override it by default.\n *\n * @param provider\n * @param override\n */\n register(provider: DbxFirebaseAuthLoginProvider, override: boolean = true): boolean {\n if (override || !this._providers.has(provider.loginMethodType)) {\n this._providers.set(provider.loginMethodType, provider);\n\n if (provider.assets) {\n this.updateAssetsForProvider(provider.loginMethodType, provider.assets);\n }\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Updates the assets for a provider type.\n *\n * @param type\n * @param assets\n */\n updateAssetsForProvider(type: FirebaseLoginMethodType, assets: Partial<DbxFirebaseAuthLoginProviderAssets>): void {\n const current = this._assets.get(type);\n const update = {\n ...current,\n ...assets\n };\n\n this._assets.set(type, update);\n }\n\n // MARK: Enable/Disable\n /**\n * Enables all providers and any providers that will be registered.\n */\n setEnableAll(enableAll = true) {\n this._enableAll = enableAll;\n }\n\n clearEnabled(): void {\n this._enabled = new Set();\n }\n\n /**\n * Enables all of the specified types.\n *\n * @param types\n */\n enable(types: ArrayOrValue<FirebaseLoginMethodType>): void {\n addToSet(this._enabled, types);\n }\n\n disable(types: ArrayOrValue<FirebaseLoginMethodType>): void {\n removeFromSet(this._enabled, types);\n }\n\n // MARK: Get\n getRegisteredTypes(): FirebaseLoginMethodType[] {\n return Array.from(this._providers.keys());\n }\n\n getEnabledTypes(): FirebaseLoginMethodType[] {\n return this._enableAll ? this.getRegisteredTypes() : Array.from(this._enabled);\n }\n\n getLoginProvider(type: FirebaseLoginMethodType): Maybe<DbxFirebaseAuthLoginProvider> {\n return this._providers.get(type);\n }\n\n getLoginProviders(types: Iterable<FirebaseLoginMethodType>): DbxFirebaseAuthLoginProvider[] {\n return filterMaybeArrayValues(mapIterable(types ?? [], (x) => this._providers.get(x)));\n }\n\n getRegisterProvider(type: FirebaseLoginMethodType): Maybe<DbxFirebaseAuthLoginProvider> {\n return this._providers.get(type);\n }\n\n getRegisterProviders(types: Iterable<FirebaseLoginMethodType>): DbxFirebaseAuthLoginProvider[] {\n return filterMaybeArrayValues(mapIterable(types ?? [], (x) => this._providers.get(x))).filter((x) => x.registrationComponentClass !== false);\n }\n\n getProviderAssets(type: FirebaseLoginMethodType): Maybe<DbxFirebaseAuthLoginProviderAssets> {\n return this._assets.get(type);\n }\n\n getPasswordConfig() {\n return this._passwordConfig;\n }\n\n setPasswordConfig(passwordConfig: DbxFirebaseAuthLoginPasswordConfig) {\n this._passwordConfig = passwordConfig;\n }\n}\n","export type FirebaseLoginMethodType = string;\nexport type FirebaseLoginMethodCategory = string;\n\nexport type KnownFirebaseLoginMethodType = 'email' | 'phone' | 'google' | 'facebook' | 'github' | 'twitter' | 'apple' | 'microsoft' | 'anonymous'; // TODO: Add more\n\nexport const DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY = 'default';\nexport const OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY = 'oauth';\n\nexport type KnownFirebaseLoginMethodCategory = typeof DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY | typeof OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY;\n\nexport type DbxFirebaseLoginMode = 'login' | 'register';\n","import { DbxInjectionContext } from '@dereekb/dbx-core';\n\n/**\n * Injection token for a DbxInjectionContext for DbxFirebaseLoginContext.\n */\nexport abstract class DbxFirebaseLoginContext extends DbxInjectionContext {}\n","import { Component, Directive, OnInit, inject, signal, computed, ChangeDetectionStrategy, model } from '@angular/core';\nimport { WorkUsingContext } from '@dereekb/rxjs';\nimport { DbxFirebaseAuthService } from '../service/firebase.auth.service';\nimport { FirebaseLoginMethodType } from './login';\nimport { DbxFirebaseAuthLoginService } from './login.service';\nimport { DbxFirebaseLoginContext } from './login.context';\nimport { MatIconModule } from '@angular/material/icon';\nimport { DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';\nimport { Maybe } from '@dereekb/util';\n\nexport interface DbxFirebaseLoginButtonConfig {\n text: string;\n iconUrl?: string;\n icon?: string;\n buttonColor?: string;\n buttonTextColor?: string;\n handleLogin: () => Promise<unknown>;\n}\n\n/**\n * Login button and action.\n */\n@Component({\n selector: 'dbx-firebase-login-button',\n template: `\n <ng-container dbxAction [dbxActionHandler]=\"handleAction\" dbxActionValue [dbxActionSuccessHandler]=\"onActionSuccess\">\n <dbx-button dbxActionButton [customTextColor]=\"buttonTextColorSignal()\" [customButtonColor]=\"buttonColorSignal()\" [raised]=\"true\">\n <div class=\"dbx-firebase-login-button-content\">\n <span class=\"dbx-firebase-login-button-icon dbx-icon-spacer\">\n @if (iconUrlSignal()) {\n <img [src]=\"iconUrlSignal()\" />\n }\n @if (iconSignal()) {\n <mat-icon>{{ iconSignal() }}</mat-icon>\n }\n </span>\n <span class=\"dbx-firebase-login-button-text\">{{ textSignal() }}</span>\n </div>\n </dbx-button>\n </ng-container>\n `,\n host: {\n class: 'dbx-firebase-login-button'\n },\n standalone: true,\n imports: [MatIconModule, DbxActionModule, DbxButtonModule],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseLoginButtonComponent {\n readonly config = model<Maybe<DbxFirebaseLoginButtonConfig>>(null);\n\n readonly iconUrlSignal = computed(() => this.config()?.iconUrl);\n readonly iconSignal = computed(() => this.config()?.icon);\n readonly textSignal = computed(() => this.config()?.text ?? '');\n readonly buttonColorSignal = computed(() => this.config()?.buttonColor ?? 'transparent');\n readonly buttonTextColorSignal = computed(() => this.config()?.buttonTextColor);\n\n setConfig(config: Maybe<DbxFirebaseLoginButtonConfig>) {\n this.config.set(config);\n }\n\n readonly handleAction: WorkUsingContext = (_, context) => {\n const config = this.config();\n\n if (config != null) {\n const loginPromise = config.handleLogin();\n context.startWorkingWithPromise(loginPromise);\n } else {\n context.reject();\n }\n };\n\n onActionSuccess = () => {\n // todo: show checkmark on success?\n };\n}\n\n@Component({\n selector: 'dbx-firebase-login-button-container',\n template: `\n <div class=\"dbx-firebase-login-button-container\">\n <ng-content></ng-content>\n </div>\n `,\n standalone: true\n})\nexport class DbxFirebaseLoginButtonContainerComponent {}\n\nexport const DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE = `\n <dbx-firebase-login-button-container>\n <dbx-firebase-login-button [config]=\"configSignal()\"></dbx-firebase-login-button>\n </dbx-firebase-login-button-container>\n`;\n\nexport const DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION: Pick<Component, 'template' | 'imports' | 'changeDetection'> = {\n template: DEFAULT_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_TEMPLATE,\n imports: [DbxFirebaseLoginButtonComponent, DbxFirebaseLoginButtonContainerComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n};\n\n@Directive()\nexport abstract class AbstractConfiguredDbxFirebaseLoginButtonDirective implements OnInit {\n abstract readonly loginProvider: FirebaseLoginMethodType;\n\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n readonly dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n readonly dbxFirebaseLoginContext = inject(DbxFirebaseLoginContext);\n\n // TODO: Consider updating these signals, etc.\n\n private readonly _config = signal<DbxFirebaseLoginButtonConfig | null>(null);\n readonly configSignal = computed(() => this._config());\n\n ngOnInit(): void {\n const assets = this.assetConfig;\n\n this._config.set({\n text: assets.loginText ?? `<loginText not configured>`,\n icon: assets.loginIcon,\n iconUrl: assets.logoUrl,\n buttonColor: assets.backgroundColor,\n buttonTextColor: assets.textColor,\n handleLogin: () => this.handleLogin()\n });\n }\n\n abstract handleLogin(): Promise<unknown>;\n\n get providerConfig() {\n return this.dbxFirebaseAuthLoginService.getLoginProvider(this.loginProvider);\n }\n\n get assetConfig() {\n return this.dbxFirebaseAuthLoginService.getProviderAssets(this.loginProvider) ?? {};\n }\n\n get config() {\n return this._config() as DbxFirebaseLoginButtonConfig;\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-anonymous',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginAnonymousComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'anonymous';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInAsAnonymous();\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { AbstractSyncFormlyFormDirective, DBX_FORMLY_FORM_COMPONENT_TEMPLATE, DbxFormlyFormComponentImportsModule, dbxFormlyFormComponentProviders, emailField } from '@dereekb/dbx-form';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\n\nexport interface DbxFirebaseEmailRecoveryFormValue {\n email: string;\n}\n\n@Component({\n selector: 'dbx-firebase-email-recovery-form',\n template: DBX_FORMLY_FORM_COMPONENT_TEMPLATE,\n imports: [DbxFormlyFormComponentImportsModule],\n providers: dbxFormlyFormComponentProviders(),\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseEmailRecoveryFormComponent extends AbstractSyncFormlyFormDirective<DbxFirebaseEmailRecoveryFormValue> {\n readonly fields: FormlyFieldConfig[] = [emailField({ required: true })];\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { TextPasswordFieldConfig, usernamePasswordLoginFields, DefaultUsernameLoginFieldsValue, AbstractConfigAsyncFormlyFormDirective, DBX_FORMLY_FORM_COMPONENT_TEMPLATE, DbxFormlyFormComponentImportsModule, dbxFormlyFormComponentProviders } from '@dereekb/dbx-form';\nimport { type Maybe } from '@dereekb/util';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\nimport { map, Observable } from 'rxjs';\nimport { DbxFirebaseLoginMode } from './login';\n\nexport type DbxFirebaseEmailFormValue = DefaultUsernameLoginFieldsValue;\n\nexport interface DbxFirebaseEmailFormConfig {\n readonly loginMode: DbxFirebaseLoginMode;\n readonly passwordConfig?: TextPasswordFieldConfig;\n}\n\n@Component({\n selector: 'dbx-firebase-email-form',\n template: DBX_FORMLY_FORM_COMPONENT_TEMPLATE,\n imports: [DbxFormlyFormComponentImportsModule],\n providers: dbxFormlyFormComponentProviders(),\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseEmailFormComponent extends AbstractConfigAsyncFormlyFormDirective<DbxFirebaseEmailFormValue, DbxFirebaseEmailFormConfig> {\n readonly fields$: Observable<Maybe<FormlyFieldConfig[]>> = this.currentConfig$.pipe(\n map((config) => {\n const loginMode = config?.loginMode ?? 'login';\n const passwordConfig = config?.passwordConfig;\n\n const fields: FormlyFieldConfig[] = usernamePasswordLoginFields({ username: 'email', password: passwordConfig, verifyPassword: loginMode === 'register' });\n return fields;\n })\n );\n}\n","import { DbxFirebaseEmailRecoveryFormValue, DbxFirebaseEmailRecoveryFormComponent } from './login.email.recovery.form.component';\nimport { DBX_INJECTION_COMPONENT_DATA, ClickableAnchor, DbxActionSuccessHandlerFunction } from '@dereekb/dbx-core';\nimport { WorkUsingObservable, WorkUsingContext } from '@dereekb/rxjs';\nimport { DbxFirebaseAuthService } from './../service/firebase.auth.service';\nimport { firstValueFrom, from, tap } from 'rxjs';\nimport { Component, EventEmitter, inject, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { DbxFirebaseLoginContext } from './login.context';\nimport { DbxFirebaseEmailFormValue, DbxFirebaseEmailFormConfig, DbxFirebaseEmailFormComponent } from './login.email.form.component';\nimport { DbxFirebaseLoginMode } from './login';\nimport { firebaseAuthErrorToReadableError } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { DbxActionErrorDirective, DbxActionModule, DbxLinkComponent, DbxButtonComponent, DbxButtonSpacerDirective, DbxErrorComponent } from '@dereekb/dbx-web';\nimport { DbxActionFormDirective, DbxFormSourceDirective } from '@dereekb/dbx-form';\n\nexport interface DbxFirebaseLoginEmailContentComponentConfig extends DbxFirebaseEmailFormConfig {\n readonly loginMode: DbxFirebaseLoginMode;\n}\n\nexport type DbxFirebaseLoginEmailContentMode = 'login' | 'recover' | 'recoversent';\n\n@Component({\n templateUrl: './login.email.content.component.html',\n imports: [NgTemplateOutlet, DbxErrorComponent, DbxLinkComponent, DbxActionErrorDirective, DbxActionFormDirective, MatButtonModule, DbxActionModule, DbxButtonComponent, DbxButtonSpacerDirective, DbxFirebaseEmailFormComponent, DbxFirebaseEmailRecoveryFormComponent, DbxFormSourceDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseLoginEmailContentComponent {\n readonly dbxFirebaseAuthService = inject(DbxFirebaseAuthService);\n readonly config = inject<DbxFirebaseLoginEmailContentComponentConfig>(DBX_INJECTION_COMPONENT_DATA);\n\n readonly formConfig: DbxFirebaseEmailFormConfig = {\n loginMode: this.config.loginMode,\n passwordConfig: this.config.passwordConfig\n };\n\n private readonly _emailFormValueSignal = signal<Maybe<DbxFirebaseEmailFormValue>>(undefined);\n private readonly _recoveryFormValueSignal = signal<Maybe<DbxFirebaseEmailRecoveryFormValue>>(undefined);\n private readonly _emailModeSignal = signal<DbxFirebaseLoginEmailContentMode>('login');\n\n readonly emailFormValueSignal = this._emailFormValueSignal.asReadonly();\n readonly recoveryFormValueSignal = this._recoveryFormValueSignal.asReadonly();\n readonly emailModeSignal = this._emailModeSignal.asReadonly();\n\n readonly forgotAnchor: ClickableAnchor = {\n onClick: () => {\n this.openRecovery();\n }\n };\n\n readonly doneOrCancelled = new EventEmitter<boolean>();\n\n static openEmailLoginContext(dbxFirebaseLoginContext: DbxFirebaseLoginContext, config: DbxFirebaseLoginEmailContentComponentConfig): Promise<boolean> {\n return dbxFirebaseLoginContext.showContext({\n config: {\n componentClass: DbxFirebaseLoginEmailContentComponent,\n data: config\n },\n use: (instance) => firstValueFrom(instance.doneOrCancelled)\n });\n }\n\n get loginMode() {\n return this.config.loginMode;\n }\n\n get isLoginMode() {\n return this.loginMode === 'login';\n }\n\n get isRegisterMode() {\n return this.loginMode === 'register';\n }\n\n get buttonText() {\n return this.config.loginMode === 'register' ? 'Register' : 'Log In';\n }\n\n readonly handleLoginAction: WorkUsingObservable<DbxFirebaseEmailFormValue> = (value: DbxFirebaseEmailFormValue) => {\n // TODO(signals): double check that this performs as we want to.\n\n this._emailFormValueSignal.set(value);\n this._recoveryFormValueSignal.set({ email: value.username }); // cache value for recovery\n\n let result;\n\n if (this.loginMode === 'register') {\n result = this.dbxFirebaseAuthService.registerWithEmailAndPassword(value.username, value.password);\n } else {\n result = this.dbxFirebaseAuthService.logInWithEmailAndPassword(value.username, value.password).catch((error) => {\n throw firebaseAuthErrorToReadableError(error);\n });\n }\n\n return from(result).pipe(\n tap(() => {\n this.doneOrCancelled.next(true);\n })\n );\n };\n\n // MARK: Recovery\n openRecovery() {\n this._emailModeSignal.set('recover');\n }\n\n readonly handleRecoveryAction: WorkUsingContext<DbxFirebaseEmailRecoveryFormValue> = (value: DbxFirebaseEmailRecoveryFormValue, context) => {\n this._recoveryFormValueSignal.set(value);\n this._emailFormValueSignal.set({ username: value.email, password: '' });\n context.startWorkingWithPromise(this.dbxFirebaseAuthService.sendPasswordResetEmail(value.email));\n };\n\n // MARK: Recovering\n readonly handleRecoverySuccess: DbxActionSuccessHandlerFunction = (x) => {\n this._emailModeSignal.set('recoversent');\n };\n\n clickedRecoveryAcknowledged() {\n this._emailModeSignal.set('login');\n }\n\n // MARK: Cancel\n onCancel() {\n this.doneOrCancelled.next(false);\n }\n\n onCancelReset() {\n this.doneOrCancelled.next(false);\n }\n}\n","<div class=\"dbx-firebase-login-email-content\">\n @switch (emailModeSignal()) {\n @case ('login') {\n <ng-container *ngTemplateOutlet=\"loginView\"></ng-container>\n }\n @case ('recover') {\n <ng-container *ngTemplateOutlet=\"resetPassword\"></ng-container>\n }\n @case ('recoversent') {\n <ng-container *ngTemplateOutlet=\"resetPasswordSent\"></ng-container>\n }\n }\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]=\"emailFormValueSignal()\"></dbx-firebase-email-form>\n @if (isLoginMode) {\n <div class=\"dbx-firebase-login-email-forgot-prompt\">\n <dbx-link [anchor]=\"forgotAnchor\">Forgot Password?</dbx-link>\n </div>\n }\n <div class=\"dbx-flex\">\n <dbx-button class=\"dbx-button-wide\" [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 <div class=\"dbx-firebase-login-email-content-recovery\" dbxAction [dbxActionHandler]=\"handleRecoveryAction\" [dbxActionSuccessHandler]=\"handleRecoverySuccess\">\n <dbx-firebase-email-recovery-form dbxActionForm [dbxFormSource]=\"recoveryFormValueSignal()\"></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-button-wide\" 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 </div>\n</ng-template>\n\n<!-- Reset Password Sent -->\n<ng-template #resetPasswordSent>\n <div class=\"dbx-firebase-login-email-content-recovery-sent\">\n <p class=\"dbx-hint\">A recovery email was sent to the specified address. Please check your email for next steps.</p>\n <button mat-raised-button (click)=\"clickedRecoveryAcknowledged()\">Ok</button>\n </div>\n</ng-template>\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\nimport { DbxFirebaseLoginEmailContentComponent } from './login.email.content.component';\n\n@Component({\n selector: 'dbx-firebase-login-email',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'email';\n\n handleLogin() {\n return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'login', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-facebook',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginFacebookComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'facebook';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithFacebook();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-github',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginGitHubComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'github';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithGithub();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-google',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginGoogleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'google';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithGoogle();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-twitter',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginTwitterComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'twitter';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithTwitter();\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\nimport { DbxFirebaseLoginEmailContentComponent } from './login.email.content.component';\n\n@Component({\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseRegisterEmailComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'email';\n\n handleLogin() {\n return DbxFirebaseLoginEmailContentComponent.openEmailLoginContext(this.dbxFirebaseLoginContext, { loginMode: 'register', passwordConfig: this.dbxFirebaseAuthLoginService.getPasswordConfig() });\n }\n}\n","import { DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY, type KnownFirebaseLoginMethodType, OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY } from './login';\nimport { DbxFirebaseLoginAnonymousComponent } from './login.anonymous.component';\nimport { DbxFirebaseLoginEmailComponent } from './login.email.component';\nimport { DbxFirebaseLoginFacebookComponent } from './login.facebook.component';\nimport { DbxFirebaseLoginGitHubComponent } from './login.github.component';\nimport { DbxFirebaseLoginGoogleComponent } from './login.google.component';\nimport { type DbxFirebaseAuthLoginProvider } from './login.service';\nimport { DbxFirebaseLoginTwitterComponent } from './login.twitter.component';\nimport { DbxFirebaseRegisterEmailComponent } from './register.email.component';\n\n/**\n * Factory function for creating the default Firebase auth login providers.\n *\n * @returns Array of DbxFirebaseAuthLoginProvider\n */\nexport function defaultFirebaseAuthLoginProvidersFactory(): DbxFirebaseAuthLoginProvider[] {\n // NOTE: Asset URLS are from Firebase.\n // https://firebase.google.com/docs/auth/web/firebaseui\n const baseFirebaseJSUrl = `https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth`;\n\n // NOTE: Colors are from https://brandcolors.net/\n return [\n {\n category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'email' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginEmailComponent,\n registrationComponentClass: DbxFirebaseRegisterEmailComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/mail.svg`,\n loginText: 'Continue with Email',\n backgroundColor: '#ea4335', // gmail red color\n textColor: '#FFF'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'google' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGoogleComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/google.svg`,\n loginText: 'Continue with Google',\n backgroundColor: '#FFF',\n textColor: '#757575'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'facebook' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginFacebookComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/facebook.svg`,\n loginText: 'Continue with Facebook',\n backgroundColor: '#4267B2',\n textColor: '#FFF'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'twitter' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginTwitterComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/twitter.svg`,\n loginText: 'Continue with Twitter',\n backgroundColor: '#1da1f2',\n textColor: '#FFF'\n }\n },\n {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'github' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGitHubComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/github.svg`,\n loginText: 'Continue with Github',\n backgroundColor: '#333',\n textColor: '#FFF'\n }\n },\n /*{\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'apple' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGitHubComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/apple.svg`,\n loginText: 'Continue with Apple',\n backgroundColor: '#333',\n textColor: '#FFF'\n }\n }, {\n category: OAUTH_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'microsoft' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginGitHubComponent,\n assets: {\n logoUrl: `${baseFirebaseJSUrl}/microsoft.svg`,\n loginText: 'Continue with Microsoft',\n backgroundColor: '#ea3e23',\n textColor: '#FFF'\n }\n },*/ {\n category: DEFAULT_FIREBASE_LOGIN_METHOD_CATEGORY,\n loginMethodType: 'anonymous' as KnownFirebaseLoginMethodType,\n componentClass: DbxFirebaseLoginAnonymousComponent,\n assets: {\n loginIcon: 'account_circle',\n loginText: 'Continue as Guest',\n backgroundColor: '#000',\n textColor: '#FFF'\n }\n }\n ];\n}\n","import { inject, type EnvironmentProviders, makeEnvironmentProviders, provideAppInitializer, type Provider, type Type } from '@angular/core';\nimport { type FirebaseLoginMethodType } from './login';\nimport { type DbxFirebaseAuthLoginPasswordConfig } from './login.password';\nimport { DbxFirebaseAuthLoginService, DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN, DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN } from './login.service';\nimport { DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG, type DbxFirebaseLoginTermsOfServiceUrlsConfig } from './login.terms';\nimport { defaultFirebaseAuthLoginProvidersFactory } from './firebase.login.providers.default';\n\n/**\n * Configuration for provideDbxFirebaseLogin().\n */\nexport interface ProvideDbxFirebaseLoginConfig {\n /**\n * DbxFirebaseLoginTermsOfServiceUrlsConfig configuration.\n */\n readonly termsOfServiceUrls: DbxFirebaseLoginTermsOfServiceUrlsConfig;\n\n /**\n * Enabled login methods. Set to true to enable all methods.\n */\n readonly enabledLoginMethods: FirebaseLoginMethodType[] | true;\n\n /**\n * Configures the default login terms component class via DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN.\n */\n readonly loginTermsComponentClass?: Type<unknown>;\n\n /**\n * Optional password configuration.\n */\n readonly passwordConfig?: DbxFirebaseAuthLoginPasswordConfig;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxFirebaseLogin configuration.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseLogin(config: ProvideDbxFirebaseLoginConfig): EnvironmentProviders {\n const { termsOfServiceUrls: loginTerms, enabledLoginMethods, loginTermsComponentClass, passwordConfig } = config;\n\n const providers: (EnvironmentProviders | Provider)[] = [\n // Default login providers\n {\n provide: DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN,\n useFactory: defaultFirebaseAuthLoginProvidersFactory\n },\n // Config for terms\n {\n provide: DBX_FIREBASE_LOGIN_TERMS_OF_SERVICE_URLS_CONFIG,\n useValue: loginTerms\n },\n DbxFirebaseAuthLoginService,\n // service initialization\n provideAppInitializer(() => {\n const dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n if (enabledLoginMethods === true) {\n dbxFirebaseAuthLoginService.setEnableAll();\n } else {\n dbxFirebaseAuthLoginService.enable(enabledLoginMethods);\n }\n })\n ];\n\n // Terms component\n if (loginTermsComponentClass) {\n providers.push({\n provide: DEFAULT_FIREBASE_AUTH_LOGIN_TERMS_COMPONENT_CLASS_TOKEN,\n useValue: loginTermsComponentClass\n });\n }\n\n // Password config\n if (passwordConfig) {\n providers.push({\n provide: DEFAULT_FIREBASE_AUTH_LOGIN_PASSWORD_CONFIG_TOKEN,\n useValue: passwordConfig\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-apple',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginAppleComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'apple';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithApple();\n }\n}\n","import { DbxFirebaseAuthLoginProvider, DbxFirebaseAuthLoginService } from './login.service';\nimport { DbxFirebaseLoginMode, FirebaseLoginMethodType, FirebaseLoginMethodCategory } from './login';\nimport { Component, Type, computed, inject, input } from '@angular/core';\nimport { containsStringAnyCase, Maybe, ArrayOrValue, excludeValuesFromArray, asArray } from '@dereekb/util';\nimport { DbxInjectionComponent, DbxInjectionComponentConfig } from '@dereekb/dbx-core';\n\nexport type DbxFirebaseLoginListItemInjectionComponentConfig = DbxInjectionComponentConfig & Pick<DbxFirebaseAuthLoginProvider, 'loginMethodType'>;\n\n/**\n * Pre-configured login component that displays all configured login types.\n */\n@Component({\n selector: 'dbx-firebase-login-list',\n template: `\n @for (config of providersInjectionConfigsSignal(); track config.loginMethodType) {\n <div class=\"dbx-firebase-login-item\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n `,\n host: {\n class: 'dbx-firebase-login-list'\n },\n standalone: true,\n imports: [DbxInjectionComponent]\n})\nexport class DbxFirebaseLoginListComponent {\n readonly dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n\n readonly loginMode = input<DbxFirebaseLoginMode>('login');\n readonly providerTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly omitProviderTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly providerCategories = input<Maybe<ArrayOrValue<FirebaseLoginMethodCategory>>>();\n\n readonly providerTypesSignal = computed(() => {\n const providerTypes = this.providerTypes();\n const omitProviderTypes = this.omitProviderTypes();\n\n const baseTypes = providerTypes ? asArray(providerTypes) : this.dbxFirebaseAuthLoginService.getEnabledTypes();\n const types = omitProviderTypes ? excludeValuesFromArray(baseTypes, asArray(omitProviderTypes)) : baseTypes;\n return types;\n });\n\n readonly providersSignal = computed(() => {\n const providerCategories = asArray(this.providerCategories());\n let providers = this.dbxFirebaseAuthLoginService.getLoginProviders(this.providerTypesSignal());\n\n if (providerCategories.length) {\n const categories = new Set(providerCategories);\n providers = providers.filter((x) => containsStringAnyCase(categories, x.category ?? ''));\n }\n\n return providers;\n });\n\n readonly providersInjectionConfigsSignal = computed<DbxFirebaseLoginListItemInjectionComponentConfig[]>(() => {\n let providers = this.providersSignal();\n let mapFn: (x: DbxFirebaseAuthLoginProvider) => DbxFirebaseLoginListItemInjectionComponentConfig;\n\n if (this.loginMode() === 'register') {\n providers = providers.filter((x) => x.registrationComponentClass !== false); // providers with \"registrationComponentClass\" set to false are not available for registration\n mapFn = (x: DbxFirebaseAuthLoginProvider) => ({ componentClass: (x.registrationComponentClass ?? x.componentClass) as Type<unknown>, loginMethodType: x.loginMethodType });\n } else {\n mapFn = (x: DbxFirebaseAuthLoginProvider) => ({ componentClass: x.componentClass as Type<unknown>, loginMethodType: x.loginMethodType });\n }\n\n const configs = providers.map(mapFn);\n return configs;\n });\n}\n","import { Directive } from '@angular/core';\nimport { AbstractForwardDbxInjectionContextDirective } from '@dereekb/dbx-core';\nimport { DbxFirebaseLoginContext } from './login.context';\n\n/**\n * DbxFirebaseLoginContext implementation.\n */\n@Directive({\n selector: '[dbxFirebaseLoginContext]',\n standalone: true,\n providers: [\n {\n provide: DbxFirebaseLoginContext,\n useExisting: DbxFirebaseLoginContextDirective\n }\n ]\n})\nexport class DbxFirebaseLoginContextDirective extends AbstractForwardDbxInjectionContextDirective implements DbxFirebaseLoginContext {}\n","import { DbxFirebaseLoginMode, FirebaseLoginMethodCategory, FirebaseLoginMethodType } from './login';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { DbxInjectionContextDirective } from '@dereekb/dbx-core';\nimport { DbxFirebaseLoginListComponent } from './login.list.component';\nimport { DbxFirebaseLoginContextDirective } from './login.context.directive';\n\n/**\n * Pre-configured login component that displays all configured login types.\n */\n@Component({\n selector: 'dbx-firebase-login',\n standalone: true,\n imports: [DbxInjectionContextDirective, DbxFirebaseLoginContextDirective, DbxFirebaseLoginListComponent],\n template: `\n <ng-container *dbxInjectionContext dbxFirebaseLoginContext>\n <dbx-firebase-login-list [providerTypes]=\"providerTypes()\" [omitProviderTypes]=\"omitProviderTypes()\" [providerCategories]=\"providerCategories()\" [loginMode]=\"loginMode()\"></dbx-firebase-login-list>\n </ng-container>\n `,\n host: {\n class: 'd-block dbx-firebase-login',\n '[class]': '{ \"dbx-firebase-register\": loginMode() === \"register\" }'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseLoginComponent {\n readonly loginMode = input<DbxFirebaseLoginMode>('login');\n readonly providerTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly omitProviderTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly providerCategories = input<Maybe<ArrayOrValue<FirebaseLoginMethodCategory>>>();\n}\n","import { ClickableAnchor } from '@dereekb/dbx-core';\nimport { Component, output } from '@angular/core';\nimport { DbxRouterAnchorModule } from '@dereekb/dbx-web';\n\n@Component({\n selector: 'dbx-firebase-login-context-back-button',\n standalone: true,\n imports: [DbxRouterAnchorModule],\n template: `\n <dbx-link [anchor]=\"anchor\">Choose other login method.</dbx-link>\n `\n})\nexport class DbxFirebaseLoginContextBackButtonComponent {\n readonly cancelLogin = output<void>();\n\n readonly anchor: ClickableAnchor = {\n onClick: () => this.cancelLogin.emit()\n };\n}\n","import { Component } from '@angular/core';\nimport { AbstractConfiguredDbxFirebaseLoginButtonDirective, DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION } from './login.button.component';\n\n@Component({\n selector: 'dbx-firebase-login-microsoft',\n imports: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.imports,\n template: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.template,\n changeDetection: DBX_CONFIGURED_DBX_FIREBASE_LOGIN_BUTTON_COMPONENT_CONFIGURATION.changeDetection,\n standalone: true\n})\nexport class DbxFirebaseLoginMicrosoftComponent extends AbstractConfiguredDbxFirebaseLoginButtonDirective {\n readonly loginProvider = 'microsoft';\n\n handleLogin() {\n return this.dbxFirebaseAuthService.logInWithMicrosoft();\n }\n}\n","import { DbxInjectionComponent, DbxInjectionComponentConfig } from '@dereekb/dbx-core';\n\nimport { Component, inject } from '@angular/core';\nimport { DbxFirebaseAuthLoginService } from './login.service';\n\n@Component({\n selector: 'dbx-firebase-login-terms',\n template: `\n <dbx-injection [config]=\"config\"></dbx-injection>\n `,\n host: {\n class: 'dbx-firebase-login-terms d-block'\n },\n imports: [DbxInjectionComponent],\n standalone: true\n})\nexport class DbxFirebaseLoginTermsComponent {\n readonly dbxFirebaseAuthLoginService = inject(DbxFirebaseAuthLoginService);\n\n readonly config: DbxInjectionComponentConfig = {\n componentClass: this.dbxFirebaseAuthLoginService.loginTermsComponentClass\n };\n}\n","import { FirebaseLoginMethodCategory, FirebaseLoginMethodType } from './login';\nimport { Component, input } from '@angular/core';\nimport { ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { DbxFirebaseLoginComponent } from './login.component';\n\n/**\n * Pre-configured register component that displays all configured login types and their registration components.\n */\n@Component({\n selector: 'dbx-firebase-register',\n template: `\n <dbx-firebase-login loginMode=\"register\" [providerTypes]=\"providerTypes()\" [omitProviderTypes]=\"omitProviderTypes()\" [providerCategories]=\"providerCategories()\"></dbx-firebase-login>\n `,\n imports: [DbxFirebaseLoginComponent],\n standalone: true\n})\nexport class DbxFirebaseRegisterComponent {\n readonly providerTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly omitProviderTypes = input<Maybe<ArrayOrValue<FirebaseLoginMethodType>>>();\n readonly providerCategories = input<Maybe<ArrayOrValue<FirebaseLoginMethodCategory>>>();\n}\n","import { addToSetCopy, type AuthClaims, type AuthClaimsObject, type AuthRoleClaimsService, type AuthRoleSet, filterMaybeArrayValues } from '@dereekb/util';\nimport { map, type Observable, switchMap } from 'rxjs';\nimport { authUserStateFromFirebaseAuthServiceFunction, stateFromTokenForLoggedInUserFunction, type StateFromTokenFunction } from './firebase.auth.rxjs';\nimport { type AuthUserStateObsFunction, type DbxFirebaseAuthService, type DbxFirebaseAuthServiceDelegate, DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE } from './firebase.auth.service';\n\nexport interface AuthRolesObsWithClaimsServiceConfig<T extends AuthClaimsObject> extends Partial<Pick<DbxFirebaseAuthServiceDelegate, 'isAdminInAuthRoleSet' | 'authUserStateObs'>> {\n /**\n * (Optional) alternative to supplying authUserStateObs. Is passed to authUserStateFromFirebaseAuthService.\n */\n readonly stateForLoggedInUser?: AuthUserStateObsFunction;\n /**\n * (Optional) alternative to supplying authUserStateObs.\n */\n readonly stateForLoggedInUserToken?: StateFromTokenFunction;\n /**\n * Claims service to use for decoding.\n */\n readonly claimsService: AuthRoleClaimsService<T>;\n /**\n * Whether or not to also add the current AuthUserState value to decoded roles.\n */\n readonly addAuthUserStateToRoles?: boolean;\n}\n\nexport function authRolesObsWithClaimsService<T extends AuthClaimsObject>(config: AuthRolesObsWithClaimsServiceConfig<T>): (dbxFirebaseAuthService: DbxFirebaseAuthService) => Observable<AuthRoleSet> {\n const { addAuthUserStateToRoles: addAuthUserState, claimsService } = config;\n\n return (dbxFirebaseAuthService: DbxFirebaseAuthService): Observable<AuthRoleSet> => {\n let obs = dbxFirebaseAuthService.idTokenResult$.pipe(map((x) => claimsService.toRoles(x.claims as AuthClaims<T>)));\n\n if (addAuthUserState) {\n obs = obs.pipe(switchMap((authRoleSet: AuthRoleSet) => dbxFirebaseAuthService.authUserState$.pipe(map((userState) => addToSetCopy(authRoleSet, [userState])))));\n }\n\n return obs;\n };\n}\n\nexport type DefaultDbxFirebaseAuthServiceDelegateWithClaimsServiceConfig<T extends AuthClaimsObject> = AuthRolesObsWithClaimsServiceConfig<T>;\n\nexport function defaultDbxFirebaseAuthServiceDelegateWithClaimsService<T extends AuthClaimsObject>(config: DefaultDbxFirebaseAuthServiceDelegateWithClaimsServiceConfig<T>): DbxFirebaseAuthServiceDelegate {\n if (filterMaybeArrayValues([config.stateForLoggedInUser, config.stateForLoggedInUserToken, config.authUserStateObs]).length > 1) {\n throw new Error('Cannot specify a combination of \"stateForLoggedInUserToken\", \"stateForLoggedInUser\" and \"authUserStateObs\". Must specify one at max.');\n }\n\n const authUserStateObs = config.authUserStateObs ?? authUserStateFromFirebaseAuthServiceFunction(config.stateForLoggedInUserToken ? stateFromTokenForLoggedInUserFunction(config.stateForLoggedInUserToken) : config.stateForLoggedInUser);\n\n return {\n authUserStateObs,\n isAdminInAuthRoleSet: config.isAdminInAuthRoleSet ?? DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE.isAdminInAuthRoleSet,\n authRolesObs: authRolesObsWithClaimsService(config),\n isOnboarded: DEFAULT_DBX_FIREBASE_AUTH_SERVICE_DELEGATE.isOnboarded,\n authRoleClaimsService: config.claimsService as unknown as AuthRoleClaimsService<AuthClaimsObject>\n };\n}\n","import { type EnvironmentProviders, Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAuthService } from '@dereekb/dbx-core';\nimport { DbxFirebaseAuthService, DbxFirebaseAuthServiceDelegate } from './service/firebase.auth.service';\n\n/**\n * Configuration for provideDbxFirebaseAuth().\n */\nexport interface ProvideDbxFirebaseAuthConfig {\n /**\n * Optional custom delegate factory for the configured DbxFirebaseAuthService.\n *\n * @param injector\n * @returns\n */\n delegateFactory?: (injector: Injector) => DbxFirebaseAuthServiceDelegate;\n}\n\n/**\n * Creates EnvironmentProviders for the DbxFirebaseAuthService, and configures the DbxFirebaseAuthService to provide DbxAuthService.\n *\n * @param config\n * @returns\n */\nexport function provideDbxFirebaseAuth(config?: ProvideDbxFirebaseAuthConfig): EnvironmentProviders {\n const providers: Provider[] = [\n DbxFirebaseAuthService,\n {\n provide: DbxAuthService,\n useExisting: DbxFirebaseAuthService\n }\n ];\n\n if (config?.delegateFactory) {\n providers.push({\n provide: DbxFirebaseAuthServiceDelegate,\n useFactory: config.delegateFactory,\n deps: [Injector]\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { iterableToArray } from '@dereekb/util';\nimport { Inject, Injectable, InjectionToken, Optional, inject } from '@angular/core';\nimport { DbxWidgetService, DbxWidgetType } from '@dereekb/dbx-web';\nimport { DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\n\n/**\n * Default providers to inject.\n */\nexport const DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN = new InjectionToken<DbxFirebaseDevelopmentWidgetEntry[]>('DefaultDbxFirebaseDevelopmentWidgetEntries');\n\n/**\n * Service used for registering widgets used for development.\n *\n * Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.\n */\n@Injectable()\nexport class DbxFirebaseDevelopmentWidgetService {\n readonly dbxWidgetService = inject(DbxWidgetService);\n\n private readonly _entries = new Map<DbxWidgetType, DbxFirebaseDevelopmentWidgetEntry>();\n\n constructor(@Optional() @Inject(DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN) defaultEntries: DbxFirebaseDevelopmentWidgetEntry[]) {\n if (defaultEntries) {\n defaultEntries.forEach((x) => this.register(x, false));\n }\n }\n\n /**\n * Used to register a provider. If a provider is already registered, this will override it by default.\n *\n * @param provider\n * @param override\n */\n register(provider: DbxFirebaseDevelopmentWidgetEntry, override: boolean = true): boolean {\n const type = provider.widget.type;\n\n if (override || !this._entries.has(type)) {\n this._entries.set(type, provider);\n this.dbxWidgetService.register(provider.widget, override);\n return true;\n } else {\n return false;\n }\n }\n\n getEntryWidgetIdentifiers(): DbxWidgetType[] {\n return Array.from(this._entries.keys());\n }\n\n getEntries(): DbxFirebaseDevelopmentWidgetEntry[] {\n return iterableToArray(this._entries.values());\n }\n}\n","import { DbxAuthService } from '@dereekb/dbx-core';\nimport { tap, switchMap, BehaviorSubject, Observable, interval, combineLatest, map, exhaustMap, distinctUntilChanged, shareReplay } from 'rxjs';\nimport { Initialized, Milliseconds, runAsyncTasksForValues } from '@dereekb/util';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { lazyFrom, SubscriptionObject, switchMapWhileTrue } from '@dereekb/rxjs';\nimport { FirebaseDevelopmentFunctions, ScheduledFunctionDevelopmentFirebaseFunctionListEntry, ScheduledFunctionDevelopmentFirebaseFunctionListResult, ScheduledFunctionDevelopmentFunctionTypeEnum } from '@dereekb/firebase';\n\n/**\n * Whether or not the scheduler should be enabled.\n */\nexport const DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN = new InjectionToken('DefaultDbxFirebaseDevelopmentSchedulerEnabled');\n\n/**\n * Service used for hitting the scheduler in the development environment using the\n */\n@Injectable()\nexport class DbxFirebaseDevelopmentSchedulerService implements Initialized {\n readonly dbxAuthService = inject(DbxAuthService);\n readonly firebaseDevelopmentFunctions = inject(FirebaseDevelopmentFunctions);\n\n private readonly _sub = new SubscriptionObject();\n private readonly _enabled = new BehaviorSubject<boolean>(inject<boolean>(DEFAULT_FIREBASE_DEVELOPMENT_SCHEDULER_ENABLED_TOKEN, { optional: true }) !== false);\n\n private readonly _timerInterval = new BehaviorSubject<Milliseconds>(60 * 1000);\n private readonly _error = new BehaviorSubject<boolean>(false);\n\n readonly enabled$ = this._enabled.asObservable();\n readonly running$ = combineLatest([this._enabled, this.dbxAuthService.authUserState$.pipe(map((x) => x === 'user'))]).pipe(\n map(([enabled, userReady]) => enabled && userReady),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly timerInterval$ = this._timerInterval.asObservable();\n readonly error$ = this._error.pipe(distinctUntilChanged());\n\n readonly schedulerList$: Observable<ScheduledFunctionDevelopmentFirebaseFunctionListEntry[]> = lazyFrom(() => {\n return this.firebaseDevelopmentFunctions\n .scheduledFunction({ type: ScheduledFunctionDevelopmentFunctionTypeEnum.LIST })\n .then((result) => {\n const list = result as ScheduledFunctionDevelopmentFirebaseFunctionListResult;\n return list.list;\n })\n .catch((e) => {\n console.error('Failed to retrieve development schedule list from server.', e);\n throw e;\n });\n });\n\n init(): void {\n this._sub.subscription = this.running$\n .pipe(\n switchMapWhileTrue(() => {\n console.log('DbxFirebaseDevelopmentSchedulerService enabled.');\n return combineLatest([this._timerInterval, this.schedulerList$]).pipe(\n switchMap(([timerInterval, schedulerList]) => {\n const executionOrder: string[] = schedulerList.map((x) => x.name);\n\n return interval(timerInterval).pipe(\n exhaustMap(() => {\n console.log('Running scheduled tasks in order... ', executionOrder);\n\n return runAsyncTasksForValues(executionOrder, (taskName) => this.runScheduledFunction(taskName), { sequential: true, retriesAllowed: false })\n .then(() => true)\n .catch((e) => {\n console.log('Failed running scheduled task: ', e);\n this._error.next(true);\n return false;\n });\n }),\n tap((success) => {\n if (success) {\n console.log('Successfully finished running all scheduled tasks.');\n this._error.next(false);\n }\n })\n );\n })\n );\n })\n )\n .subscribe();\n }\n\n runScheduledFunction(taskName: string) {\n return this.firebaseDevelopmentFunctions.scheduledFunction({\n run: taskName,\n type: ScheduledFunctionDevelopmentFunctionTypeEnum.RUN\n });\n }\n\n setTimer(timerInterval: number) {\n this._timerInterval.next(timerInterval);\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { AbstractConfigAsyncFormlyFormDirective, pickableItemChipField, filterPickableItemFieldValuesByLabel, SearchableValueFieldDisplayFn, SearchableValueFieldDisplayValue, SearchableValueFieldValue, DBX_FORMLY_FORM_COMPONENT_TEMPLATE, dbxFormlyFormComponentProviders, DbxFormlyFormComponentImportsModule } from '@dereekb/dbx-form';\nimport { type Maybe } from '@dereekb/util';\nimport { FormlyFieldConfig } from '@ngx-formly/core';\nimport { map, Observable, of } from 'rxjs';\nimport { DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\n\nexport interface DbxFirebaseDevelopmentPopupContentFormInput {\n readonly entries: DbxFirebaseDevelopmentWidgetEntry[];\n}\n\nexport interface DbxFirebaseDevelopmentPopupContentFormValue {\n readonly specifier?: Maybe<string>;\n}\n\nconst DISPLAY_FOR_DEVELOPMENT_POPUP_STRING_VALUE: SearchableValueFieldDisplayFn<string, DbxFirebaseDevelopmentWidgetEntry> = (values: SearchableValueFieldValue<string, DbxFirebaseDevelopmentWidgetEntry>[]) => {\n const displayValues: SearchableValueFieldDisplayValue<string, DbxFirebaseDevelopmentWidgetEntry>[] = values.map((x) => ({ ...x, label: x.meta?.label || x.value }));\n const obs: Observable<SearchableValueFieldDisplayValue<string, DbxFirebaseDevelopmentWidgetEntry>[]> = of(displayValues);\n return obs;\n};\n\n@Component({\n selector: 'dbx-firebase-development-popup-content-form',\n template: DBX_FORMLY_FORM_COMPONENT_TEMPLATE,\n imports: [DbxFormlyFormComponentImportsModule],\n providers: dbxFormlyFormComponentProviders(),\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseDevelopmentPopupContentFormComponent extends AbstractConfigAsyncFormlyFormDirective<DbxFirebaseDevelopmentPopupContentFormValue, DbxFirebaseDevelopmentPopupContentFormInput> {\n readonly fields$: Observable<FormlyFieldConfig[]> = this.config$.pipe(\n map((config: DbxFirebaseDevelopmentPopupContentFormInput) => {\n return [\n pickableItemChipField<string, DbxFirebaseDevelopmentWidgetEntry>({\n key: 'specifier',\n filterLabel: 'Tools',\n description: 'Pick a tool to get started.',\n filterValues: filterPickableItemFieldValuesByLabel,\n loadValues: () => of(config.entries.map((y) => ({ value: y.widget.type, meta: y }))),\n displayForValue: DISPLAY_FOR_DEVELOPMENT_POPUP_STRING_VALUE,\n asArrayValue: false\n })\n ];\n })\n );\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, provideDbxListView, DbxValueAsListItem, provideDbxListViewWrapper, DbxActionModule, DbxButtonComponent, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, DbxSelectionValueListViewComponentImportsModule, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE } from '@dereekb/dbx-web';\nimport { from, of } from 'rxjs';\nimport { ScheduledFunctionDevelopmentFirebaseFunctionListEntry } from '@dereekb/firebase';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { WorkUsingContext } from '@dereekb/rxjs';\nimport { DbxActionButtonDirective } from '@dereekb/dbx-core';\n\nexport type ScheduledFunctionDevelopmentFirebaseFunctionListEntryWithSelection = DbxValueAsListItem<ScheduledFunctionDevelopmentFirebaseFunctionListEntry>;\n\n@Component({\n selector: 'dbx-firebase-development-scheduler-list',\n template: DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxListWrapperComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListViewWrapper(DbxFirebaseDevelopmentSchedulerListComponent),\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerListComponent extends AbstractDbxSelectionListWrapperDirective<ScheduledFunctionDevelopmentFirebaseFunctionListEntry> {\n constructor() {\n super({\n componentClass: DbxFirebaseDevelopmentSchedulerListViewComponent,\n defaultSelectionMode: 'view'\n });\n }\n}\n\n@Component({\n selector: 'dbx-firebase-development-scheduler-list-view',\n template: DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxSelectionValueListViewComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListView(DbxFirebaseDevelopmentSchedulerListViewComponent),\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerListViewComponent extends AbstractDbxSelectionListViewDirective<ScheduledFunctionDevelopmentFirebaseFunctionListEntry> {\n readonly config: DbxSelectionValueListViewConfig<ScheduledFunctionDevelopmentFirebaseFunctionListEntryWithSelection> = {\n componentClass: DbxFirebaseDevelopmentSchedulerListViewItemComponent,\n mapValuesToItemValues: (x) => of(x.map((y) => ({ ...y, icon: y.icon, itemValue: y })))\n };\n}\n\n@Component({\n template: `\n <div dbxAction dbxActionValue useFastTriggerPreset [dbxActionHandler]=\"handleRun\">\n <dbx-button dbxActionButton [text]=\"'Run ' + name\"></dbx-button>\n <div *dbxActionHasSuccess=\"3000\" class=\"dbx-success\">Success</div>\n </div>\n `,\n imports: [DbxActionModule, DbxButtonComponent, DbxActionButtonDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerListViewItemComponent extends AbstractDbxValueListViewItemComponent<ScheduledFunctionDevelopmentFirebaseFunctionListEntry> {\n readonly dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);\n\n get name() {\n return this.itemValue.name;\n }\n\n readonly handleRun: WorkUsingContext<unknown, unknown> = (value, context) => {\n context.startWorkingWithObservable(from(this.dbxFirebaseDevelopmentSchedulerService.runScheduledFunction(this.name)));\n };\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { loadingStateFromObs } from '@dereekb/rxjs';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\nimport { DbxFirebaseDevelopmentSchedulerListComponent } from './development.scheduler.list.component';\n\nexport const DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY = 'DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET';\n\nexport function developmentFirebaseServerSchedulerWidgetEntry(): DbxFirebaseDevelopmentWidgetEntry {\n return {\n label: 'Run Scheduled Task',\n widget: {\n type: DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY,\n componentClass: DbxFirebaseDevelopmentSchedulerWidgetComponent\n }\n };\n}\n\n@Component({\n template: `\n <div>\n <dbx-firebase-development-scheduler-list [state]=\"state$\"></dbx-firebase-development-scheduler-list>\n </div>\n `,\n imports: [DbxFirebaseDevelopmentSchedulerListComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseDevelopmentSchedulerWidgetComponent {\n readonly dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);\n readonly entries$ = this.dbxFirebaseDevelopmentSchedulerService.schedulerList$;\n readonly state$ = loadingStateFromObs(this.entries$);\n}\n","export interface DbxFirebaseEmulatorConfig {\n /**\n * Port to target.\n */\n readonly port: number;\n /**\n * Defaults to localhost if not provided.\n */\n readonly host?: string;\n}\n\nexport interface DbxFirebaseEmulatorsConfig {\n /**\n * Whether or not to enable the emulators.\n *\n * Defaults to false.\n */\n readonly useEmulators?: boolean;\n /**\n * Default host to target. Defaults to localhost if not provided.\n */\n readonly host?: string;\n /**\n * emulator UI configuration\n */\n readonly ui?: DbxFirebaseEmulatorConfig;\n /**\n * Auth emulator configuration\n */\n readonly auth?: DbxFirebaseEmulatorConfig;\n /**\n * Firestore emulator configuration\n */\n readonly firestore?: DbxFirebaseEmulatorConfig;\n /**\n * Firestore emulator configuration\n */\n readonly storage?: DbxFirebaseEmulatorConfig;\n /**\n * Functions emulator configuration\n */\n readonly functions?: DbxFirebaseEmulatorConfig;\n /**\n * Database emulator configuration\n */\n readonly database?: DbxFirebaseEmulatorConfig;\n}\n\nexport abstract class DbxFirebaseParsedEmulatorsConfig implements DbxFirebaseEmulatorsConfig {\n abstract readonly useEmulators: boolean;\n readonly host?: string;\n /**\n * Fix used by some components to allow changing 0.0.0.0 to localhost. Defaults to true.\n */\n readonly allow0000ToLocalhost?: boolean;\n readonly ui?: Required<DbxFirebaseEmulatorConfig>;\n readonly auth?: Required<DbxFirebaseEmulatorConfig>;\n readonly firestore?: Required<DbxFirebaseEmulatorConfig>;\n readonly storage?: Required<DbxFirebaseEmulatorConfig>;\n readonly functions?: Required<DbxFirebaseEmulatorConfig>;\n readonly database?: Required<DbxFirebaseEmulatorConfig>;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { ClickableUrl } from '@dereekb/dbx-core';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseParsedEmulatorsConfig } from './emulators';\n\n@Injectable()\nexport class DbxFirebaseEmulatorService {\n readonly emulatorsConfig = inject(DbxFirebaseParsedEmulatorsConfig);\n\n get useEmulators(): boolean {\n return this.emulatorsConfig.useEmulators || false;\n }\n\n get emulatorUIAnchor(): Maybe<ClickableUrl> {\n const ui = this.emulatorsConfig.ui;\n let host = this.emulatorsConfig.host;\n\n // Issue where sometimes 0.0.0.0 is not configured to handle transferring traffic properly, compared to localhost. This sets 0.0.0.0 to localhost unless disallowed.\n if (host === '0.0.0.0' && this.emulatorsConfig.allow0000ToLocalhost !== false) {\n host = 'localhost';\n }\n\n return ui\n ? {\n url: `http://${host ?? 'localhost'}:${ui.port}`,\n target: '_blank'\n }\n : undefined;\n }\n}\n","import { ClickableAnchor, DbxActionAutoTriggerDirective, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxAuthService, cleanSubscription, completeOnDestroy } from '@dereekb/dbx-core';\nimport { Component, computed, inject } from '@angular/core';\nimport { DbxAnchorComponent, DbxTwoBlockComponent, DbxTwoColumnComponent, DbxTwoColumnFullLeftDirective, DbxTwoColumnRightComponent, DbxWidgetDataPair, DbxWidgetViewComponent, TwoColumnsContextStore } from '@dereekb/dbx-web';\nimport { DevelopmentFirebaseFunctionSpecifier } from '@dereekb/firebase';\nimport { WorkUsingContext, IsModifiedFunction } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { first, BehaviorSubject, distinctUntilChanged, map, shareReplay, combineLatest, Observable } from 'rxjs';\nimport { DbxFirebaseDevelopmentWidgetService } from './development.widget.service';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { DbxFirebaseDevelopmentPopupContentFormComponent, DbxFirebaseDevelopmentPopupContentFormValue } from './development.popup.content.form.component';\nimport { msToSeconds } from '@dereekb/date';\nimport { DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY } from './development.scheduler.widget.component';\nimport { DbxFirebaseEmulatorService } from '../firebase/firebase.emulator.service';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { DbxActionFormDirective, DbxFormSourceDirective } from '@dereekb/dbx-form';\nimport { MatButtonModule } from '@angular/material/button';\n\n@Component({\n selector: 'dbx-firebase-development-popup-content',\n templateUrl: './development.popup.content.component.html',\n styleUrls: ['./development.popup.component.scss'],\n imports: [DbxAnchorComponent, DbxTwoColumnFullLeftDirective, DbxWidgetViewComponent, DbxTwoColumnComponent, DbxTwoBlockComponent, DbxTwoColumnRightComponent, DbxWidgetViewComponent, DbxFirebaseDevelopmentPopupContentFormComponent, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxActionFormDirective, DbxFormSourceDirective, DbxActionAutoTriggerDirective, MatButtonModule],\n providers: [TwoColumnsContextStore],\n standalone: true\n})\nexport class DbxFirebaseDevelopmentPopupContentComponent {\n readonly twoColumnsContextStore = inject(TwoColumnsContextStore);\n readonly dbxAuthService = inject(DbxAuthService);\n readonly dbxFirebaseDevelopmentWidgetService = inject(DbxFirebaseDevelopmentWidgetService);\n readonly dbxFirebaseDevelopmentSchedulerService = inject(DbxFirebaseDevelopmentSchedulerService);\n readonly dbxFirebaseEmulatorService = inject(DbxFirebaseEmulatorService);\n\n readonly showEmulatorButton = this.dbxFirebaseEmulatorService.useEmulators === true;\n readonly emulatorUIAnchor: ClickableAnchor = this.dbxFirebaseEmulatorService.emulatorUIAnchor ?? {};\n\n readonly entries = this.dbxFirebaseDevelopmentWidgetService.getEntries();\n\n private readonly _activeEntrySelector = completeOnDestroy(new BehaviorSubject<Maybe<DevelopmentFirebaseFunctionSpecifier>>(DEVELOPMENT_FIREBASE_SERVER_SCHEDULER_WIDGET_KEY));\n\n readonly isLoggedIn$ = this.dbxAuthService.isLoggedIn$;\n\n readonly entries$ = this.isLoggedIn$.pipe(\n distinctUntilChanged(),\n map((isLoggedIn) => this.entries),\n shareReplay(1)\n );\n\n readonly formConfig$ = this.entries$.pipe(map((entries) => ({ entries })));\n readonly activeEntrySelector$ = this._activeEntrySelector.pipe(distinctUntilChanged());\n readonly currentActiveEntry$ = combineLatest([this.entries$, this.activeEntrySelector$]).pipe(\n map(([entries, selector]) => (selector ? entries.find((e) => e.widget.type === selector) : undefined)),\n shareReplay(1)\n );\n\n readonly showRight$ = this.currentActiveEntry$.pipe(map((x) => x != null));\n readonly activeEntry$ = this.currentActiveEntry$.pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly schedulerRunning$ = this.dbxFirebaseDevelopmentSchedulerService.running$;\n readonly schedulerInterval$ = this.dbxFirebaseDevelopmentSchedulerService.timerInterval$.pipe(\n map((x) => msToSeconds(x)),\n shareReplay(1)\n );\n readonly schedulerError$ = this.dbxFirebaseDevelopmentSchedulerService.error$.pipe(\n map((x) => (x ? 'Error Occured' : 'Ok')),\n shareReplay(1)\n );\n\n readonly formData$: Observable<DbxFirebaseDevelopmentPopupContentFormValue> = this._activeEntrySelector.pipe(\n distinctUntilChanged(),\n map((specifier) => ({ specifier }))\n );\n\n readonly schedulerRunningSignal = toSignal(this.schedulerRunning$);\n readonly schedulerIntervalSignal = toSignal(this.schedulerInterval$);\n readonly schedulerErrorSignal = toSignal(this.schedulerError$);\n\n readonly activeEntrySignal = toSignal(this.activeEntry$);\n readonly rightTitleSignal = computed(() => this.activeEntrySignal()?.label);\n readonly widgetConfigSignal = computed<Maybe<DbxWidgetDataPair>>(() => {\n const widget = this.activeEntrySignal()?.widget;\n let widgetConfig: Maybe<DbxWidgetDataPair> = undefined;\n\n if (widget) {\n widgetConfig = { type: widget.type, data: undefined };\n }\n\n return widgetConfig;\n });\n\n constructor() {\n this.twoColumnsContextStore.setShowRight(this.showRight$);\n cleanSubscription(\n this.twoColumnsContextStore.back$.subscribe(() => {\n this.clearSelection();\n })\n );\n }\n\n readonly handleFormUpdate: WorkUsingContext<DbxFirebaseDevelopmentPopupContentFormValue, void> = (value, context) => {\n this._activeEntrySelector.next(value.specifier);\n context.success();\n };\n\n readonly isFormModified: IsModifiedFunction<DbxFirebaseDevelopmentPopupContentFormValue> = (value) => {\n return this._activeEntrySelector.pipe(\n map((currentSelector) => value.specifier !== currentSelector),\n first()\n );\n };\n\n clearSelection() {\n this._activeEntrySelector.next(undefined);\n }\n}\n","<dbx-two-column class=\"dbx-firebase-development-popup-content\" [dbxTwoColumnFullLeft]=\"true\">\n <dbx-two-block left>\n <div>\n <h4>Info</h4>\n <p>Scheduler (Running): {{ schedulerRunningSignal() }} : {{ schedulerIntervalSignal() }}s : {{ schedulerErrorSignal() }}</p>\n <div>\n @if (showEmulatorButton) {\n <dbx-anchor [anchor]=\"emulatorUIAnchor\">\n <button mat-flat-button color=\"accent\">Emulator Enabled</button>\n </dbx-anchor>\n }\n </div>\n </div>\n <div>\n <h4>Tools</h4>\n <div dbxAction dbxActionEnforceModified dbxActionAutoTrigger useInstantTriggerPreset [dbxActionHandler]=\"handleFormUpdate\">\n <dbx-firebase-development-popup-content-form [config]=\"formConfig$\" dbxActionForm [dbxActionFormIsModified]=\"isFormModified\" [dbxFormSource]=\"formData$\" dbxFormSourceMode=\"always\"></dbx-firebase-development-popup-content-form>\n </div>\n </div>\n </dbx-two-block>\n <dbx-two-column-right right [header]=\"rightTitleSignal()\">\n <dbx-widget-view [config]=\"widgetConfigSignal()\"></dbx-widget-view>\n </dbx-two-column-right>\n</dbx-two-column>\n","import { ChangeDetectionStrategy, Component, inject, viewChild } from '@angular/core';\nimport { DbxPopupKey, AbstractPopupDirective, DbxPopupService, DbxPopupContentComponent, DbxPopupControlsComponent } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseDevelopmentPopupContentComponent } from './development.popup.content.component';\n\nexport const DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY = 'devpopup';\n\n@Component({\n template: `\n <dbx-popup-content>\n <dbx-popup-controls [header]=\"header\" controls></dbx-popup-controls>\n <dbx-firebase-development-popup-content (shouldClose)=\"closePopup()\"></dbx-firebase-development-popup-content>\n </dbx-popup-content>\n `,\n imports: [DbxPopupContentComponent, DbxPopupControlsComponent, DbxFirebaseDevelopmentPopupContentComponent],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseDevelopmentPopupComponent extends AbstractPopupDirective {\n private readonly popupService = inject(DbxPopupService);\n\n readonly content = viewChild.required(DbxFirebaseDevelopmentPopupContentComponent);\n\n readonly header = 'Development Tools';\n\n static openPopup(popupService: DbxPopupService, popupKey?: DbxPopupKey): NgPopoverRef {\n return popupService.open({\n key: popupKey ?? DEFAULT_FIREBASE_DEVELOPMENT_POPUP_KEY,\n componentClass: DbxFirebaseDevelopmentPopupComponent,\n closeOnTransition: false,\n isDraggable: true,\n position: 'center'\n });\n }\n\n reopen = () => {\n DbxFirebaseDevelopmentPopupComponent.openPopup(this.popupService, this.popup.key);\n };\n}\n","import { inject, Injectable, InjectionToken } from '@angular/core';\n\n/**\n * Corresponds to the enabled value on the DbxFirebaseDevelopmentService.\n */\nexport const DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN = new InjectionToken('DefaultDbxFirebaseDevelopmentEnabled');\n\n/**\n * Service used for registering widgets used for development.\n *\n * Default providers can be configured by the DEFAULT_FIREBASE_AUTH_LOGIN_PROVIDERS_TOKEN injectable value.\n */\n@Injectable()\nexport class DbxFirebaseDevelopmentService {\n readonly enabled = inject<boolean>(DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN, { optional: true }) ?? false;\n}\n","import { HostListener, AfterViewInit, Directive, inject } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { DbxPopupService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseDevelopmentPopupComponent } from './development.popup.component';\nimport { DbxFirebaseDevelopmentService } from './development.service';\nimport { clean } from '@dereekb/dbx-core';\n\n/**\n * Directive for showing the development tools snackbar when the app opens up and listening for keybindings for opening the popup.\n */\n@Directive({\n selector: '[dbxFirebaseDevelopment]',\n standalone: true\n})\nexport class DbxFirebaseDevelopmentDirective implements AfterViewInit {\n readonly popupService = inject(DbxPopupService);\n readonly matSnackBar = inject(MatSnackBar);\n readonly dbxFirebaseDevelopmentService = inject(DbxFirebaseDevelopmentService);\n\n ref?: NgPopoverRef<any, any>;\n\n get enabled() {\n return this.dbxFirebaseDevelopmentService.enabled;\n }\n\n constructor() {\n clean(() => this.closePopup());\n }\n\n @HostListener('window:keydown', ['$event'])\n handleKeyboardEvent(event: KeyboardEvent) {\n if (this.enabled && event.shiftKey && event.altKey && event.code === 'KeyD') {\n this.togglePopup();\n event.preventDefault();\n }\n }\n\n togglePopup() {\n if (this.ref) {\n this.closePopup();\n } else {\n this.openPopup();\n }\n }\n\n openPopup() {\n if (!this.ref) {\n const ref = DbxFirebaseDevelopmentPopupComponent.openPopup(this.popupService);\n ref.afterClosed$.subscribe(() => {\n if (this.ref === ref) {\n this.ref = undefined;\n }\n });\n\n this.ref = ref;\n }\n }\n\n closePopup() {\n if (this.ref != null) {\n this.ref.close();\n }\n }\n\n ngAfterViewInit(): void {\n if (this.enabled) {\n this.matSnackBar\n .open('Dev Tools: alt/option + shift + D', 'Open', {\n horizontalPosition: 'center',\n verticalPosition: 'bottom',\n duration: 8 * 1000\n })\n .onAction()\n .subscribe(() => {\n this.openPopup();\n });\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseDevelopmentPopupComponent } from './development.popup.component';\nimport { DbxFirebaseDevelopmentPopupContentComponent } from './development.popup.content.component';\nimport { DbxFirebaseDevelopmentDirective } from './development.directive';\nimport { DbxFirebaseDevelopmentPopupContentFormComponent } from './development.popup.content.form.component';\nimport { DbxFirebaseDevelopmentSchedulerListComponent, DbxFirebaseDevelopmentSchedulerListViewComponent, DbxFirebaseDevelopmentSchedulerListViewItemComponent } from './development.scheduler.list.component';\nimport { DbxFirebaseDevelopmentSchedulerWidgetComponent } from './development.scheduler.widget.component';\n\nconst importsAndExports = [\n //\n DbxFirebaseDevelopmentPopupContentFormComponent,\n DbxFirebaseDevelopmentDirective,\n DbxFirebaseDevelopmentPopupComponent,\n DbxFirebaseDevelopmentPopupContentComponent,\n DbxFirebaseDevelopmentSchedulerWidgetComponent,\n DbxFirebaseDevelopmentSchedulerListComponent,\n DbxFirebaseDevelopmentSchedulerListViewComponent,\n DbxFirebaseDevelopmentSchedulerListViewItemComponent\n];\n/**\n * Contains components related to logging in.\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxFirebaseDevelopmentModule {}\n","import { inject, type EnvironmentProviders, makeEnvironmentProviders, provideAppInitializer, type Provider } from '@angular/core';\nimport { DbxFirebaseDevelopmentWidgetService, DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN } from './development.widget.service';\nimport { DbxFirebaseDevelopmentService, DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN } from './development.service';\nimport { DbxFirebaseDevelopmentSchedulerService } from './development.scheduler.service';\nimport { type DbxFirebaseDevelopmentWidgetEntry } from './development.widget';\nimport { developmentFirebaseServerSchedulerWidgetEntry } from './development.scheduler.widget.component';\n\n/**\n * Configuration for provideDbxFirebaseDevelopment().\n */\nexport interface ProvideDbxFirebaseDevelopmentConfig {\n /**\n * Whether or not to automatically add the developmentFirebaseServerSchedulerWidgetEntry() to the developmentWidgetEntries.\n *\n * Defaults to true.\n */\n readonly addDevelopmentSchedulerWidget?: boolean;\n /**\n * Widgets to add to the DbxFirebaseDevelopmentWidgetService module.\n *\n * Configured via the DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN.\n */\n readonly developmentWidgetEntries?: DbxFirebaseDevelopmentWidgetEntry[];\n /**\n * Whether or not the development module is currently enabled.\n *\n * Corresponds to DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN.\n */\n readonly enabled?: boolean;\n}\n\n/**\n * Creates providers for DbxFirebaseDevelopmentSchedulerService, DbxFirebaseDevelopmentWidgetService, and DbxFirebaseDevelopmentService.\n *\n * @param config\n * @returns\n */\nexport function provideDbxFirebaseDevelopment(config: ProvideDbxFirebaseDevelopmentConfig): EnvironmentProviders {\n const { developmentWidgetEntries: inputEntries, enabled, addDevelopmentSchedulerWidget } = config;\n const entries = [...(inputEntries ?? [])];\n\n if (addDevelopmentSchedulerWidget !== false) {\n entries.push(developmentFirebaseServerSchedulerWidgetEntry());\n }\n\n const providers: (EnvironmentProviders | Provider)[] = [\n // config\n {\n provide: DEFAULT_FIREBASE_DEVELOPMENT_WIDGET_PROVIDERS_TOKEN,\n useValue: entries\n },\n {\n provide: DEFAULT_FIREBASE_DEVELOPMENT_ENABLED_TOKEN,\n useValue: enabled\n },\n // services\n DbxFirebaseDevelopmentService,\n DbxFirebaseDevelopmentSchedulerService,\n DbxFirebaseDevelopmentWidgetService,\n // service initialization\n provideAppInitializer(() => {\n const scheduler = inject(DbxFirebaseDevelopmentSchedulerService);\n // initialize the scheduler\n scheduler.init();\n })\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type Injector, type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { initializeApp } from 'firebase/app';\nimport { initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';\nimport { FirebaseApp, provideFirebaseApp } from '@angular/fire/app';\nimport { provideStorage, getStorage, connectStorageEmulator } from '@angular/fire/storage';\nimport { provideFunctions, getFunctions, connectFunctionsEmulator } from '@angular/fire/functions';\nimport { provideFirestore, connectFirestoreEmulator, initializeFirestore, persistentLocalCache, persistentMultipleTabManager, type FirestoreSettings, persistentSingleTabManager } from '@angular/fire/firestore';\nimport { provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';\nimport { type AppCheck, provideAppCheck } from '@angular/fire/app-check';\nimport { DbxFirebaseParsedEmulatorsConfig } from './emulators';\nimport { type DbxFirebaseAppOptions, DBX_FIREBASE_APP_OPTIONS_TOKEN } from './firebase.options';\nimport { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { enableAppCheckDebugTokenGeneration } from '../auth/appcheck/appcheck';\nimport { DbxFirebaseAppCheckHttpInterceptor } from '../auth/appcheck/appcheck.interceptor';\nimport { type Maybe, pushArrayItemsIntoArray } from '@dereekb/util';\n\n/**\n * Configuration for provideDbxFirebaseApp().\n */\nexport interface ProvideDbxFirebaseAppConfig {\n /**\n * DbxFirebaseAppOptions for the app.\n *\n * Is automatically configured as a provider for the DBX_FIREBASE_APP_OPTIONS_TOKEN.\n */\n readonly dbxFirebaseAppOptions: DbxFirebaseAppOptions;\n /**\n * Whether or not to provide Firestore configuration.\n *\n * True by default.\n */\n readonly provideFirestore?: Maybe<boolean>;\n /**\n * Whether or not to provide App Check configuration.\n *\n * True by default.\n */\n readonly provideAppCheck?: Maybe<boolean>;\n /**\n * Whether or not to provide Auth configuration.\n *\n * True by default.\n */\n readonly provideAuth?: Maybe<boolean>;\n /**\n * Whether or not to provide Storage configuration.\n *\n * True by default.\n */\n readonly provideStorage?: Maybe<boolean>;\n /**\n * Whether or not to provide Functions configuration.\n *\n * True by default.\n */\n readonly provideFunctions?: Maybe<boolean>;\n}\n\n/**\n * Provides EnvironmentProviders for all Firebase services.\n *\n * @param config\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseApp(config: ProvideDbxFirebaseAppConfig): EnvironmentProviders {\n const { dbxFirebaseAppOptions: dbxFirebaseOptions } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n // options\n makeEnvironmentProviders([\n {\n provide: DBX_FIREBASE_APP_OPTIONS_TOKEN,\n useValue: dbxFirebaseOptions\n }\n ]),\n\n // app\n provideFirebaseApp((injector: Injector) => {\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n return initializeApp(firebaseOptions);\n })\n ];\n\n // firestore\n if (config.provideFirestore !== false) {\n const firestoreProvider = provideFirestore((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n\n const firestoreSettings: FirestoreSettings = {};\n\n const { enableMultiTabIndexedDbPersistence, enableIndexedDbPersistence } = firebaseOptions;\n const { persistentCacheSettings } = firebaseOptions;\n\n if (enableIndexedDbPersistence !== false) {\n let tabManager;\n\n if (enableMultiTabIndexedDbPersistence !== false) {\n tabManager = persistentMultipleTabManager();\n } else {\n tabManager = persistentSingleTabManager(undefined);\n }\n\n firestoreSettings.localCache = persistentLocalCache({\n tabManager,\n ...persistentCacheSettings\n });\n }\n\n const firestore = initializeFirestore(firebaseApp, firestoreSettings);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.firestore) {\n connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});\n }\n\n return firestore;\n });\n\n providers.push(firestoreProvider);\n }\n\n // app check\n if (config.provideAppCheck !== false) {\n const appCheckProviders = [\n provideAppCheck((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n const appCheckOptions = firebaseOptions.appCheck;\n const appCheckKnowinglyDisabled = appCheckOptions?.disabled === true || firebaseOptions.emulators?.useEmulators === true;\n\n let appCheck: AppCheck;\n\n if (appCheckOptions && !appCheckKnowinglyDisabled) {\n // enable the debug tokens if not using emulators and allowDebugTokens is set true\n if (!firebaseOptions.emulators?.useEmulators && appCheckOptions.allowDebugTokens) {\n enableAppCheckDebugTokenGeneration(true);\n }\n\n // Only enabled outside of app-check environments. The emulators will not use appcheck.\n appCheck = initializeAppCheck(firebaseApp, {\n provider: new ReCaptchaV3Provider(appCheckOptions.reCaptchaV3),\n isTokenAutoRefreshEnabled: appCheckOptions.isTokenAutoRefreshEnabled ?? true\n });\n\n console.log('Enabled AppCheck.');\n } else {\n appCheck = undefined as unknown as AppCheck;\n\n if (!appCheckKnowinglyDisabled) {\n console.error('dbx-firebase: No appcheck configuration for the app, and not specifically disabled in config either.');\n }\n }\n\n return appCheck;\n }),\n {\n provide: HTTP_INTERCEPTORS,\n useClass: DbxFirebaseAppCheckHttpInterceptor,\n multi: true\n }\n ];\n\n pushArrayItemsIntoArray(providers, appCheckProviders);\n }\n\n // auth\n if (config.provideAuth !== false) {\n const authProvider = provideAuth((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const auth = getAuth(firebaseApp);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.auth) {\n connectAuthEmulator(auth, `http://${emulators.auth.host}:${emulators.auth.port}`);\n }\n\n return auth;\n });\n\n providers.push(authProvider);\n }\n\n // storage\n if (config.provideStorage !== false) {\n const storageProvider = provideStorage((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const storage = getStorage(firebaseApp);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.storage) {\n connectStorageEmulator(storage, emulators.storage.host, emulators.storage.port, {});\n }\n\n return storage;\n });\n\n providers.push(storageProvider);\n }\n\n // functions\n if (config.provideFunctions !== false) {\n const functionsProvider = provideFunctions((injector: Injector) => {\n const firebaseApp = injector.get(FirebaseApp);\n const firebaseOptions = injector.get<DbxFirebaseAppOptions>(DBX_FIREBASE_APP_OPTIONS_TOKEN);\n const { functionsRegionOrCustomDomain } = firebaseOptions;\n\n const functions = getFunctions(firebaseApp, functionsRegionOrCustomDomain);\n const emulators = injector.get<DbxFirebaseParsedEmulatorsConfig>(DbxFirebaseParsedEmulatorsConfig, undefined);\n\n if (emulators?.useEmulators && emulators?.functions) {\n connectFunctionsEmulator(functions, emulators.functions.host, emulators.functions.port);\n }\n\n return functions;\n });\n\n providers.push(functionsProvider);\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n// TODO: Providers now need to be initialized/registered in the bootstrap section as additional providers/config and not imported as modules this way\n","import { makeEnvironmentProviders, type EnvironmentProviders, type Provider } from '@angular/core';\nimport { type DbxFirebaseEmulatorConfig, type DbxFirebaseEmulatorsConfig, DbxFirebaseParsedEmulatorsConfig } from './emulators';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseEmulatorService } from './firebase.emulator.service';\n\n/**\n * Config for provideDbxFirebaseEmulator().\n */\nexport type ProvideDbxFirebaseEmulatorsConfig = DbxFirebaseEmulatorsConfig;\n\n/**\n * Creates EnvironmentProviders for the DbxFirebaseEmulatorService.\n *\n * @param config\n * @returns\n */\nexport function provideDbxFirebaseEmulator(config: ProvideDbxFirebaseEmulatorsConfig): EnvironmentProviders {\n const defaultHost = config.host ?? 'localhost';\n\n function emulatorConfig(emulator: Maybe<DbxFirebaseEmulatorConfig>): Required<DbxFirebaseEmulatorConfig> | undefined {\n return emulator ? { host: emulator.host ?? defaultHost, port: emulator.port } : undefined;\n }\n\n const finalConfig: DbxFirebaseParsedEmulatorsConfig = {\n useEmulators: config.useEmulators !== false,\n ui: emulatorConfig(config.ui),\n auth: emulatorConfig(config.auth),\n firestore: emulatorConfig(config.firestore),\n storage: emulatorConfig(config.storage),\n functions: emulatorConfig(config.functions),\n database: emulatorConfig(config.database)\n };\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseParsedEmulatorsConfig,\n useValue: finalConfig\n },\n DbxFirebaseEmulatorService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Token to access the FirestoreContext value.\n */\nexport const DBX_FIRESTORE_CONTEXT_TOKEN = new InjectionToken('DBX_FIRESTORE_CONTEXT_TOKEN');\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { clientFirebaseFirestoreContextFactory, type FirestoreContext, NotificationFirestoreCollections, StorageFileFirestoreCollections, SystemStateFirestoreCollections } from '@dereekb/firebase';\nimport { DBX_FIRESTORE_CONTEXT_TOKEN } from './firebase.firestore';\nimport { Firestore } from '@angular/fire/firestore';\nimport { type ClassLikeType } from '@dereekb/util';\n\n/**\n * Provider factory for the SystemStateFirestoreCollections.\n *\n * @param appCollection The app collection class to use.\n * @returns Provider factory for the SystemStateFirestoreCollections.\n */\nexport function provideSystemStateFirestoreCollections(appCollection: SystemStateFirestoreCollections): SystemStateFirestoreCollections {\n if (!appCollection.systemStateCollection) {\n throw new Error(`SystemStateFirestoreCollections could not be provided using the app's app collection. Set provideSystemStateFirestoreCollections to false in DbxFirebaseFirestoreCollectionModuleConfig to prevent auto-initialization, or update your app's collection class to implement SystemStateFirestoreCollections.`);\n }\n\n return appCollection;\n}\n\n/**\n * Provider factory for the NotificationFirestoreCollections.\n *\n * @param appCollection The app collection class to use.\n * @returns Provider factory for the NotificationFirestoreCollections.\n */\nexport function provideNotificationFirestoreCollections(appCollection: NotificationFirestoreCollections): NotificationFirestoreCollections {\n if (!appCollection.notificationSummaryCollection) {\n throw new Error(`NotificationFirestoreCollections could not be provided using the app's app collection. Set provideNotificationFirestoreCollections to false in DbxFirebaseFirestoreCollectionModuleConfig to prevent auto-initialization, or update your app's collection class to implement NotificationFirestoreCollections.`);\n }\n\n return appCollection;\n}\n\n/**\n * Provider factory for the StorageFileFirestoreCollections.\n *\n * @param appCollection The app collection class to use.\n * @returns Provider factory for the StorageFileFirestoreCollections.\n */\nexport function provideStorageFileFirestoreCollections(appCollection: StorageFileFirestoreCollections): StorageFileFirestoreCollections {\n if (!appCollection.storageFileCollection) {\n throw new Error(`StorageFileFirestoreCollections could not be provided using the app's app collection. Set provideStorageFileFirestoreCollections to false in DbxFirebaseFirestoreCollectionModuleConfig to prevent auto-initialization, or update your app's collection class to implement StorageFileFirestoreCollections.`);\n }\n\n return appCollection;\n}\n\n/**\n * Configuration for provideDbxFirestoreCollection().\n */\nexport interface ProvideDbxFirebaseFirestoreCollectionConfig<T> {\n /**\n * The app collection class to use.\n */\n readonly appCollectionClass: ClassLikeType<T>;\n /**\n * The collection factory to use.\n */\n readonly collectionFactory: (context: FirestoreContext) => T;\n /**\n * Whether or not to provide the SystemStateFirestoreCollections.\n *\n * True by default.\n */\n readonly provideSystemStateFirestoreCollections?: boolean;\n /**\n * Whether or not to provide the NotificationFirestoreCollections.\n *\n * False by default.\n */\n readonly provideNotificationFirestoreCollections?: boolean;\n /**\n * Whether or not to provide the StorageFileFirestoreCollections.\n *\n * False by default.\n */\n readonly provideStorageFileFirestoreCollections?: boolean;\n}\n\n/**\n * Creates EnvironmentProviders for the DBX_FIRESTORE_CONTEXT_TOKEN, appCollectionClass, and optionally the SystemStateFirestoreCollections and NotificationFirestoreCollections.\n *\n * @param config Configuration for the providers.\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirestoreCollection<T>(config: ProvideDbxFirebaseFirestoreCollectionConfig<T>): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: DBX_FIRESTORE_CONTEXT_TOKEN,\n useFactory: clientFirebaseFirestoreContextFactory,\n deps: [Firestore]\n },\n {\n provide: config.appCollectionClass,\n useFactory: config.collectionFactory,\n deps: [DBX_FIRESTORE_CONTEXT_TOKEN]\n }\n ];\n\n if (config.provideSystemStateFirestoreCollections !== false) {\n providers.push({\n /**\n * Provide SystemStateFirestoreCollections via the app collections class and using SystemStateFirestoreCollections.\n */\n provide: SystemStateFirestoreCollections,\n useFactory: provideSystemStateFirestoreCollections,\n deps: [config.appCollectionClass]\n });\n }\n\n if (config.provideNotificationFirestoreCollections) {\n providers.push({\n provide: NotificationFirestoreCollections,\n useFactory: provideNotificationFirestoreCollections,\n deps: [config.appCollectionClass]\n });\n }\n\n if (config.provideStorageFileFirestoreCollections) {\n providers.push({\n provide: StorageFileFirestoreCollections,\n useFactory: provideStorageFileFirestoreCollections,\n deps: [config.appCollectionClass]\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { FirestoreContext } from '@dereekb/firebase';\nimport { Injectable, inject } from '@angular/core';\nimport { DBX_FIRESTORE_CONTEXT_TOKEN } from './firebase.firestore';\n\n/**\n * Service that provides access to the app's FirestoreContext.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirestoreContextService {\n readonly firestoreContext = inject<FirestoreContext>(DBX_FIRESTORE_CONTEXT_TOKEN);\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { Functions } from '@angular/fire/functions';\nimport { FirebaseDevelopmentFunctions, type FirebaseFunctionsConfigMap, type FirebaseFunctionsMap, FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY, type LazyFirebaseFunctions } from '@dereekb/firebase';\nimport { type ClassLikeType, forEachKeyValue } from '@dereekb/util';\n\n/**\n * Configuration for provideDbxFirebaseFunctions().\n */\nexport interface ProvideDbxFirebaseFunctionsConfig<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap> {\n /**\n * The token to use for the functions getter.\n *\n * This is typically your LazyFirebaseFunctions result type.\n */\n functionsGetterToken: ClassLikeType<T>;\n /**\n * Factory function to retrieve the functions getter instance.\n *\n * @param functions The Firebase functions instance.\n * @returns The functions getter instance.\n */\n functionsGetterFactory: (functions: Functions) => T;\n /**\n * Key of the functions config to use to inject FirebaseDevelopmentFunctions using that same provider.\n *\n * Defaults to \"developmentFunctions\". If false, will not be injected automatically.\n */\n developmentFunctionsKey?: string | false;\n /**\n * Optional functions config map to provide.\n *\n * If provided, will inject all the types with factory functions so they can be injected into the app.\n */\n functionsConfigMap?: FirebaseFunctionsConfigMap<M>;\n}\n\n/**\n * Creates EnvironmentProviders for the LazyFirebaseFunctions type for a DbxFirebase app.\n *\n * Also provides FirebaseDevelopmentFunctions if developmentFunctionsKey is provided.\n *\n * @param config Configuration for provideDbxFirebaseFunctions().\n * @returns EnvironmentProviders for the LazyFirebaseFunctions type.\n */\nexport function provideDbxFirebaseFunctions<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap>(config: ProvideDbxFirebaseFunctionsConfig<T, M>): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: config.functionsGetterToken,\n useFactory: config.functionsGetterFactory,\n deps: [Functions]\n }\n ];\n\n if (config.functionsConfigMap) {\n forEachKeyValue(config.functionsConfigMap, {\n forEach: ([key, entry]) => {\n const provide = entry[0];\n\n providers.push({\n provide,\n useFactory: (lazyFunctions: LazyFirebaseFunctions<M>) => {\n const getter = lazyFunctions[key as string];\n\n if (!getter) {\n throw new Error(`Could not create provider for firebase function getter \"${provide}\" as the getter was unavailable.`);\n } else {\n return getter();\n }\n },\n deps: [config.functionsGetterToken]\n });\n }\n });\n\n // Add a provider for FirebaseDevelopmentFunctions if developmentFunctions is provided.\n const developmentFunctionsKey = config.developmentFunctionsKey ?? FIREBASE_DEVELOPMENT_FUNCTIONS_MAP_KEY;\n\n if (developmentFunctionsKey) {\n const developmentFunctionsConfig = config.functionsConfigMap[developmentFunctionsKey];\n\n if (developmentFunctionsConfig != null) {\n providers.push({\n provide: FirebaseDevelopmentFunctions,\n useExisting: developmentFunctionsConfig[0]\n });\n }\n }\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { type IterationQueryDocChangeWatcherChangeType, type IterationQueryDocChangeWatcherEvent } from '@dereekb/firebase';\nimport { SubscriptionObject } from '@dereekb/rxjs';\nimport { type Destroyable } from '@dereekb/util';\nimport { filter, take, map, BehaviorSubject, distinctUntilChanged, type Observable, switchMap, startWith, shareReplay, combineLatest } from 'rxjs';\nimport { type DbxFirebaseCollectionLoaderAccessor } from './collection.loader';\n\n/**\n * DbxFirebaseCollectionChangeWatcher trigger modes\n * - auto: will automatically call trigger\n * - off: will never call trigger\n */\nexport type DbxFirebaseCollectionChangeWatcherTriggerMode = 'auto' | 'off';\nexport type DbxFirebaseCollectionChangeWatcherEvent = Pick<IterationQueryDocChangeWatcherEvent<unknown>, 'time' | 'type'>;\n\n/**\n * Used to watch a DbxFirebaseCollectionLoaderAccessor for when the query changes and\n */\nexport interface DbxFirebaseCollectionChangeWatcher<S extends DbxFirebaseCollectionLoaderAccessor<any>> {\n readonly store: S;\n /**\n * Current mode observable\n */\n readonly mode$: Observable<DbxFirebaseCollectionChangeWatcherTriggerMode>;\n /**\n * Stream of events\n */\n readonly event$: Observable<DbxFirebaseCollectionChangeWatcherEvent>;\n readonly hasChangeAvailable$: Observable<boolean>;\n /**\n * Current trigger state. Based on the hasChangeAvailable$ state and current mode.\n */\n readonly triggered$: Observable<boolean>;\n /**\n * Trigger emitter. Only emits when triggered$ is/becomes true.\n */\n readonly trigger$: Observable<void>;\n}\n\n/**\n * DbxFirebaseCollectionChangeWatcher instance that can be destroyed and the mode changed.\n */\nexport interface DbxFirebaseCollectionChangeWatcherInstance<S extends DbxFirebaseCollectionLoaderAccessor<any>> extends DbxFirebaseCollectionChangeWatcher<S>, Destroyable {\n /**\n * Changes the mode\n */\n setMode(mode: DbxFirebaseCollectionChangeWatcherTriggerMode): void;\n}\n\nexport function dbxFirebaseCollectionChangeWatcher<S extends DbxFirebaseCollectionLoaderAccessor<any>>(store: S, initialMode?: DbxFirebaseCollectionChangeWatcherTriggerMode): DbxFirebaseCollectionChangeWatcherInstance<S> {\n const _mode = new BehaviorSubject<DbxFirebaseCollectionChangeWatcherTriggerMode>(initialMode ?? 'off');\n const _sub = new SubscriptionObject();\n\n const mode$ = _mode.pipe(distinctUntilChanged());\n\n const event$: Observable<DbxFirebaseCollectionChangeWatcherEvent> = store.queryChangeWatcher$.pipe(\n switchMap((x) =>\n x.event$.pipe(\n filter((x) => x.type !== 'none'), // do not share 'none' events.\n take(1), // only need one event to mark as change is available.\n startWith({\n time: new Date(),\n type: 'none' as IterationQueryDocChangeWatcherChangeType\n })\n )\n ),\n shareReplay(1)\n );\n\n const hasChangeAvailable$: Observable<boolean> = event$.pipe(\n map((x) => x.type !== 'none'),\n shareReplay(1)\n );\n\n const triggered$: Observable<boolean> = combineLatest([mode$, hasChangeAvailable$]).pipe(map(([mode, hasChange]) => mode === 'auto' && hasChange));\n\n const trigger$: Observable<void> = triggered$.pipe(\n filter((triggered) => triggered),\n map(() => undefined)\n );\n\n function destroy() {\n _sub.destroy();\n _mode.complete();\n }\n\n function setMode(mode: DbxFirebaseCollectionChangeWatcherTriggerMode) {\n _mode.next(mode);\n }\n\n const instance: DbxFirebaseCollectionChangeWatcherInstance<S> = {\n store,\n mode$,\n event$,\n hasChangeAvailable$,\n triggered$,\n trigger$,\n destroy,\n setMode\n };\n\n return instance;\n}\n","import { SubscriptionObject, type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { BehaviorSubject, filter, switchMap, exhaustMap, EMPTY } from 'rxjs';\nimport { type Destroyable, type Maybe, type Initialized } from '@dereekb/util';\nimport { type DbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionChangeWatcher } from './collection.change.watcher';\nimport { type DbxFirebaseCollectionLoaderAccessor } from './collection.loader';\n\nexport type DbxFirebaseCollectionChangeTriggerFunction<S extends DbxFirebaseCollectionLoaderAccessor<any>> = (instance: DbxFirebaseCollectionChangeTriggerInstance<S>) => ObservableOrValue<void>;\n\n/**\n * Restarts the store.\n *\n * @param instance\n * @returns\n */\nexport const DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION: DbxFirebaseCollectionChangeTriggerFunction<any> = (instance) => instance.watcher.store.restart();\n\nexport interface DbxFirebaseCollectionChangeTriggerInstanceConfig<S extends DbxFirebaseCollectionLoaderAccessor<any>> {\n readonly watcher: DbxFirebaseCollectionChangeWatcher<S> & Partial<Destroyable>;\n /**\n * Whether or not to also destroy the watcher when the trigger instance is destroyed.\n *\n * Defaults to false.\n */\n readonly destroyWatcherOnDestroy?: boolean;\n /**\n * Initial trigger function to use.\n *\n * By default restarts the store.\n */\n readonly triggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>;\n}\n\nexport interface DbxFirebaseCollectionChangeTrigger<S extends DbxFirebaseCollectionLoaderAccessor<any>> {\n readonly watcher: DbxFirebaseCollectionChangeWatcher<S>;\n setTriggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>;\n}\n\nexport class DbxFirebaseCollectionChangeTriggerInstance<S extends DbxFirebaseCollectionLoaderAccessor<any>> implements DbxFirebaseCollectionChangeTrigger<S>, Initialized, Destroyable {\n readonly watcher: DbxFirebaseCollectionChangeWatcher<S>;\n\n private readonly _config: DbxFirebaseCollectionChangeTriggerInstanceConfig<S>;\n private readonly _triggerFunction = new BehaviorSubject<Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(config: DbxFirebaseCollectionChangeTriggerInstanceConfig<S>) {\n this._config = config;\n this.watcher = config.watcher;\n this.triggerFunction = config.triggerFunction ?? DEFAULT_FIREBASE_COLLECTION_CHANGE_TRIGGER_FUNCTION;\n }\n\n get config() {\n return this._config;\n }\n\n init(): void {\n this._sub.subscription = this._triggerFunction\n .pipe(\n switchMap((triggerFunction) => {\n if (triggerFunction) {\n return this.watcher.triggered$.pipe(\n filter((triggered) => triggered),\n exhaustMap(() => asObservable(triggerFunction(this)))\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._triggerFunction.complete();\n\n if (this._config.destroyWatcherOnDestroy === true) {\n (this.watcher as unknown as Destroyable)?.destroy();\n }\n }\n\n get triggerFunction(): Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>> {\n return this._triggerFunction.value;\n }\n\n set triggerFunction(triggerFunction: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>) {\n this._triggerFunction.next(triggerFunction);\n }\n}\n\n/**\n * Creates a new DbxFirebaseCollectionChangeWatcher, set the modes to \"auto\", and creates a new DbxFirebaseCollectionChangeTriggerInstance.\n *\n * If no trigger function is provided it will default to resetting the store.\n *\n * NOTE: Don't forget to initialize the DbxFirebaseCollectionChangeTriggerInstance and handle other lifecycle changes.\n *\n * @param store\n * @param triggerFunction\n * @returns\n */\nexport function dbxFirebaseCollectionChangeTriggerForStore<S extends DbxFirebaseCollectionLoaderAccessor<any>>(store: S, triggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>): DbxFirebaseCollectionChangeTriggerInstance<S> {\n return dbxFirebaseCollectionChangeTrigger<S>({\n watcher: dbxFirebaseCollectionChangeWatcher<S>(store, 'auto'),\n destroyWatcherOnDestroy: true,\n triggerFunction:\n triggerFunction ??\n (() => {\n store.restart();\n })\n });\n}\n\nexport function dbxFirebaseCollectionChangeTriggerForWatcher<S extends DbxFirebaseCollectionLoaderAccessor<any>>(watcher: DbxFirebaseCollectionChangeWatcher<S>, triggerFunction?: Maybe<DbxFirebaseCollectionChangeTriggerFunction<S>>): DbxFirebaseCollectionChangeTriggerInstance<S> {\n return dbxFirebaseCollectionChangeTrigger<S>({\n watcher,\n destroyWatcherOnDestroy: false,\n triggerFunction\n });\n}\n\nexport function dbxFirebaseCollectionChangeTrigger<S extends DbxFirebaseCollectionLoaderAccessor<any>>(config: DbxFirebaseCollectionChangeTriggerInstanceConfig<S>): DbxFirebaseCollectionChangeTriggerInstance<S> {\n return new DbxFirebaseCollectionChangeTriggerInstance(config);\n}\n","import { type PageListLoadingState, cleanupDestroyable, filterMaybe, useFirst, SubscriptionObject, accumulatorFlattenPageListLoadingState, type ItemAccumulatorNextPageUntilResultsCountFunction, itemAccumulatorNextPageUntilResultsCount, iteratorNextPageUntilPage, iteratorNextPageUntilMaxPageLoadLimit, pageItemAccumulatorCurrentPage, type ItemAccumulatorNextPageUntilResultsCountResult, iterationHasNextAndCanLoadMore, distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { BehaviorSubject, combineLatest, map, shareReplay, distinctUntilChanged, Subject, throttleTime, switchMap, type Observable, tap, startWith, NEVER, of } from 'rxjs';\nimport {\n type DocumentDataWithIdAndKey,\n type DocumentReference,\n type FirebaseQueryItemAccumulator,\n firebaseQueryItemAccumulator,\n type FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction,\n type FirebaseQuerySnapshotAccumulator,\n firebaseQuerySnapshotAccumulator,\n type FirestoreCollectionLike,\n type FirestoreDocument,\n type FirestoreItemPageIterationInstance,\n type FirestoreItemPageIteratorFilter,\n type FirestoreModelKey,\n type FirestoreQueryConstraint,\n type IterationQueryDocChangeWatcher,\n iterationQueryDocChangeWatcher\n} from '@dereekb/firebase';\nimport { type ArrayOrValue, type Destroyable, type GetterOrValue, type Initialized, type Maybe, type PageNumber, countAllInNestedArray } from '@dereekb/util';\nimport { type DbxFirebaseCollectionLoaderAccessor, type DbxFirebaseCollectionLoaderWithAccumulator } from './collection.loader';\n\n/**\n * The store mode.\n *\n * - query: The store will load documents from a query, using the given collection.\n * - references: The store will load documents from the input references (keys, refs, etc.).\n */\nexport type DbxFirebaseCollectionMode = 'query' | 'references';\n\nexport interface DbxFirebaseCollectionLoaderInstanceInitConfig<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> {\n readonly collection?: Maybe<FirestoreCollectionLike<T, D>>;\n readonly collectionMode?: DbxFirebaseCollectionMode;\n readonly collectionKeys?: Maybe<FirestoreModelKey[]>;\n readonly collectionRefs?: Maybe<DocumentReference<T>[]>;\n readonly maxPages?: Maybe<number>;\n readonly itemsPerPage?: Maybe<number>;\n readonly constraints?: Maybe<ArrayOrValue<FirestoreQueryConstraint>>;\n /**\n * Whether or not to wait for non-null constraints before beginning the iteration.\n *\n * Defaults to true.\n */\n readonly waitForNonNullConstraints?: Maybe<boolean>;\n}\n\nexport type DbxFirebaseCollectionLoaderInstanceData<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> = DbxFirebaseCollectionLoaderAccessor<T>;\n\n/**\n * DbxFirebaseModelLoader implementation within an instance.\n */\nexport class DbxFirebaseCollectionLoaderInstance<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>> implements DbxFirebaseCollectionLoaderWithAccumulator<T>, DbxFirebaseCollectionLoaderInstanceData<T, D>, Initialized, Destroyable {\n private readonly _maxPagesSub = new SubscriptionObject();\n\n protected readonly _collection = new BehaviorSubject<Maybe<FirestoreCollectionLike<T, D>>>(undefined);\n\n protected readonly _collectionMode = new BehaviorSubject<DbxFirebaseCollectionMode>('query');\n protected readonly _collectionRefs = new BehaviorSubject<Maybe<DocumentReference<T>[]>>(undefined);\n protected readonly _maxPages = new BehaviorSubject<Maybe<number>>(undefined);\n protected readonly _itemsPerPage = new BehaviorSubject<Maybe<number>>(undefined);\n protected readonly _constraints = new BehaviorSubject<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>(undefined);\n protected readonly _waitForNonNullConstraints = new BehaviorSubject<Maybe<boolean>>(undefined);\n protected readonly _restart = new Subject<void>();\n\n readonly collection$ = this._collection.pipe(distinctUntilChanged());\n\n readonly collectionMode$ = this._collectionMode.pipe(distinctUntilChanged(), shareReplay(1));\n readonly currentCollectionRefs$ = this._collectionRefs.pipe(distinctUntilChanged(), shareReplay(1));\n readonly collectionRefs$ = this.currentCollectionRefs$.pipe(\n filterMaybe(),\n distinctUntilKeysChange((x) => x.path),\n shareReplay(1)\n );\n readonly collectionKeys$ = this.collectionRefs$.pipe(\n map((x) => x.map((y) => y.path)),\n shareReplay(1)\n );\n\n readonly currentConstraints$ = this._constraints.pipe(distinctUntilChanged());\n\n readonly constraints$ = this._waitForNonNullConstraints.pipe(\n switchMap((waitForNonNullConstraints) => {\n let obs: Observable<Maybe<ArrayOrValue<FirestoreQueryConstraint>>> = this.currentConstraints$;\n\n // defaults to true\n if (waitForNonNullConstraints !== false) {\n obs = this.currentConstraints$.pipe(filterMaybe());\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n\n readonly iteratorFilter$: Observable<FirestoreItemPageIteratorFilter> = combineLatest([this._itemsPerPage.pipe(distinctUntilChanged()), this.constraints$]).pipe(\n map(([limit, constraints]) => ({ limit, constraints, maxPageLoadLimit: this.maxPages }) as FirestoreItemPageIteratorFilter),\n shareReplay(1)\n );\n\n readonly firestoreIteration$: Observable<FirestoreItemPageIterationInstance<T>> = this.collection$.pipe(\n switchMap((collection) => {\n if (collection) {\n return combineLatest([this.collectionMode$, this.iteratorFilter$, this._restart.pipe(startWith(undefined))]).pipe(\n throttleTime(100, undefined, { trailing: true }), // prevent rapid changes and executing filters too quickly.\n switchMap(([mode, filter]) => {\n if (mode === 'query') {\n return of(collection.firestoreIteration(filter));\n } else {\n return this.collectionRefs$.pipe(map((refs) => collection.firestoreFixedIteration(refs, filter)));\n }\n }),\n cleanupDestroyable(), // cleanup the iteration\n shareReplay(1)\n );\n } else {\n return NEVER; // don't emit anything until collection is provided.\n }\n }),\n cleanupDestroyable(), // cleanup the iteration\n shareReplay(1)\n );\n\n readonly queryChangeWatcher$: Observable<IterationQueryDocChangeWatcher<T>> = this.firestoreIteration$.pipe(\n map((instance) => iterationQueryDocChangeWatcher({ instance })),\n shareReplay(1)\n );\n\n readonly snapshotAccumulator$: Observable<FirebaseQuerySnapshotAccumulator<T>> = this.firestoreIteration$.pipe(\n map((x) => firebaseQuerySnapshotAccumulator<T>(x)),\n cleanupDestroyable(),\n shareReplay(1)\n );\n\n readonly hasNext$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => x.hasNext$),\n shareReplay(1)\n );\n\n readonly canLoadMore$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => x.canLoadMore$),\n shareReplay(1)\n );\n\n readonly hasNextAndCanLoadMore$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => iterationHasNextAndCanLoadMore(x)),\n shareReplay(1)\n );\n\n readonly snapshotAccumulatorDocumentRefs$: Observable<DocumentReference<T>[][]> = this.snapshotAccumulator$.pipe(\n switchMap((x) => x.allItems$.pipe(map((y) => y.map((z) => z.map((zz) => zz.ref))))),\n shareReplay(1)\n );\n\n readonly snapshotAccumulatorDocuments$: Observable<D[][]> = combineLatest([this.collection$.pipe(filterMaybe()), this.snapshotAccumulatorDocumentRefs$]).pipe(\n map(([collection, documentRefs]) => {\n const accessor = collection.documentAccessor();\n return documentRefs.map((y) => y.map((z) => accessor.loadDocument(z)));\n }),\n shareReplay(1)\n );\n\n readonly accumulator$: Observable<FirebaseQueryItemAccumulator<T>> = this.firestoreIteration$.pipe(\n map((x) => firebaseQueryItemAccumulator<T>(x)),\n cleanupDestroyable(),\n shareReplay(1)\n );\n\n readonly accumulatorPage$: Observable<PageNumber> = this.accumulator$.pipe(\n switchMap((x) => pageItemAccumulatorCurrentPage(x)),\n shareReplay(1)\n );\n\n /**\n * Passthrough for currentAllItems$ from the accumulator.\n */\n readonly currentAccumulatorItems$: Observable<DocumentDataWithIdAndKey<T>[][]> = this.accumulator$.pipe(\n switchMap((x) => x.currentAllItems$),\n shareReplay(1)\n );\n\n /**\n * Passthrough for allItems$ from the accumulator.\n */\n readonly accumulatorItems$: Observable<DocumentDataWithIdAndKey<T>[][]> = this.accumulator$.pipe(\n switchMap((x) => x.allItems$),\n shareReplay(1)\n );\n\n /**\n * Returns true if the first page result has one or more documents.\n */\n readonly hasDocuments$: Observable<boolean> = this.firestoreIteration$.pipe(\n switchMap((x) => x.firstState$.pipe(map((x) => Boolean(x.value?.length)))),\n shareReplay(1)\n );\n\n readonly allDocumentRefs$: Observable<DocumentReference<T>[]> = this.snapshotAccumulatorDocumentRefs$.pipe(\n map((x) => x.flat()),\n shareReplay(1)\n );\n\n readonly allDocuments$: Observable<D[]> = this.snapshotAccumulatorDocuments$.pipe(\n map((x) => x.flat()),\n shareReplay(1)\n );\n\n readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]> = this.accumulatorItems$.pipe(\n map((x) => x.flat()),\n shareReplay(1)\n );\n\n readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = this.accumulator$.pipe(\n switchMap((x) => accumulatorFlattenPageListLoadingState(x)),\n shareReplay(1)\n );\n\n constructor(initConfig?: DbxFirebaseCollectionLoaderInstanceInitConfig<T, D>) {\n this._collectionMode.next(initConfig?.collectionMode ?? 'query');\n\n if (initConfig?.collectionKeys) {\n this.collectionKeys = initConfig?.collectionKeys;\n } else if (initConfig?.collectionRefs) {\n this.collectionRefs = initConfig?.collectionRefs;\n }\n\n this._collection.next(initConfig?.collection);\n this._maxPages.next(initConfig?.maxPages);\n this._itemsPerPage.next(initConfig?.itemsPerPage);\n this._constraints.next(initConfig?.constraints);\n }\n\n init(): void {\n // When max pages changes, update the iteration's max page limit.\n this._maxPagesSub.subscription = this._maxPages\n .pipe(\n distinctUntilChanged(),\n filterMaybe(), // do not pass null/undefined values\n switchMap((maxPageLoadLimit) =>\n this.firestoreIteration$.pipe(\n tap((iteration) => {\n iteration.setMaxPageLoadLimit(maxPageLoadLimit);\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this._collectionMode.complete();\n this._collectionRefs.complete();\n this._maxPages.complete();\n this._collection.complete();\n this._constraints.complete();\n this._itemsPerPage.complete();\n this._restart.complete();\n this._maxPagesSub.destroy();\n }\n\n // MARK: Inputs\n get collectionMode(): DbxFirebaseCollectionMode {\n return this._collectionMode.value;\n }\n\n set collectionMode(mode: DbxFirebaseCollectionMode) {\n if (this.collectionMode != mode) {\n this._collectionMode.next(mode);\n }\n }\n\n get collectionKeys(): Maybe<FirestoreModelKey[]> {\n const refs = this.collectionRefs;\n return refs?.map((x) => x.path);\n }\n\n set collectionKeys(keys: Maybe<FirestoreModelKey[]>) {\n let refs: Maybe<DocumentReference<T>[]> = undefined;\n const { collection } = this;\n\n if (keys && collection) {\n const accessor = collection.documentAccessor();\n refs = keys.map((x) => accessor.documentRefForKey(x));\n }\n\n this.collectionRefs = refs;\n }\n\n get collectionRefs(): Maybe<DocumentReference<T>[]> {\n return this._collectionRefs.value;\n }\n\n set collectionRefs(refs: Maybe<DocumentReference<T>[]>) {\n this._collectionRefs.next(refs);\n }\n\n get maxPages(): Maybe<number> {\n return this._maxPages.value;\n }\n\n set maxPages(maxPages: Maybe<number>) {\n if (this.maxPages != maxPages) {\n this._maxPages.next(maxPages);\n }\n }\n\n get itemsPerPage(): Maybe<number> {\n return this._itemsPerPage.value;\n }\n\n set itemsPerPage(itemsPerPage: Maybe<number>) {\n if (this.itemsPerPage != itemsPerPage) {\n this._itemsPerPage.next(itemsPerPage);\n }\n }\n\n get constraints(): Maybe<ArrayOrValue<FirestoreQueryConstraint>> {\n return this._constraints.value;\n }\n\n set constraints(constraints: Maybe<ArrayOrValue<FirestoreQueryConstraint>>) {\n this._constraints.next(constraints);\n }\n\n get waitForNonNullConstraints(): Maybe<boolean> {\n return this._waitForNonNullConstraints.value;\n }\n\n set waitForNonNullConstraints(waitForNonNullConstraints: Maybe<boolean>) {\n this._waitForNonNullConstraints.next(waitForNonNullConstraints);\n }\n\n get collection(): Maybe<FirestoreCollectionLike<T, D>> {\n return this._collection.value;\n }\n\n set collection(collection: Maybe<FirestoreCollectionLike<T, D>>) {\n this._collection.next(collection);\n }\n\n // MARK: DbxFirebaseCollectionLoader\n next() {\n useFirst(this.firestoreIteration$, (x) => x.next());\n }\n\n restart() {\n this._restart.next();\n }\n\n setCollectionMode(mode: DbxFirebaseCollectionMode) {\n this.collectionMode = mode;\n }\n\n // References Mode\n setCollectionKeys(keys: Maybe<FirestoreModelKey[]>): void {\n this.collectionKeys = keys;\n }\n\n setCollectionRefs(refs: Maybe<DocumentReference<T>[]>): void {\n this.collectionRefs = refs;\n }\n\n // Query Mode\n setMaxPages(maxPages: Maybe<number>) {\n this.maxPages = maxPages;\n }\n\n setItemsPerPage(itemsPerPage: Maybe<number>) {\n this.itemsPerPage = itemsPerPage;\n }\n\n setConstraints(constraints: Maybe<ArrayOrValue<FirestoreQueryConstraint>>) {\n this.constraints = constraints;\n }\n\n setWaitForNonNullConstraints(waitForNonNullConstraints: Maybe<boolean>) {\n this.waitForNonNullConstraints = waitForNonNullConstraints;\n }\n\n setCollection(firestoreCollection: Maybe<FirestoreCollectionLike<T, D>>) {\n this.collection = firestoreCollection;\n }\n\n loadPagesUntilResultsCount(maxResultsLimit: GetterOrValue<number>, countResultsFunction?: FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction<T> | undefined): Observable<ItemAccumulatorNextPageUntilResultsCountResult> {\n const defaultFn: ItemAccumulatorNextPageUntilResultsCountFunction<DocumentDataWithIdAndKey<T>[]> = countAllInNestedArray;\n return this.accumulator$.pipe(\n switchMap((accumulator) =>\n itemAccumulatorNextPageUntilResultsCount({\n accumulator,\n maxResultsLimit,\n countResultsFunction: countResultsFunction ?? defaultFn\n })\n )\n );\n }\n\n loadToPage(page: PageNumber): Observable<PageNumber> {\n return this.accumulator$.pipe(switchMap((accumulator) => iteratorNextPageUntilPage(accumulator.itemIteration, page)));\n }\n\n loadAllResults(): Observable<PageNumber> {\n return this.accumulator$.pipe(switchMap((accumulator) => iteratorNextPageUntilMaxPageLoadLimit(accumulator.itemIteration)));\n }\n}\n\nexport function dbxFirebaseCollectionLoaderInstance<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(config: DbxFirebaseCollectionLoaderInstanceInitConfig<T, D>): DbxFirebaseCollectionLoaderInstance<T, D> {\n return new DbxFirebaseCollectionLoaderInstance<T, D>(config);\n}\n\nexport function dbxFirebaseCollectionLoaderInstanceWithCollection<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(collection: Maybe<FirestoreCollectionLike<T, D>>): DbxFirebaseCollectionLoaderInstance<T, D> {\n return new DbxFirebaseCollectionLoaderInstance<T, D>({ collection });\n}\n","import { type ObservableOrValue, useAsObservable, type PageListLoadingState, filterMaybe, SubscriptionObject, asObservable, pageLoadingStateFromObs } from '@dereekb/rxjs';\nimport { BehaviorSubject, map, shareReplay, distinctUntilChanged, Subject, switchMap, type Observable, startWith, exhaustMap } from 'rxjs';\nimport {\n dataFromDocumentSnapshots,\n type DocumentDataWithIdAndKey,\n type DocumentReference,\n documentReferencesFromDocuments,\n type DocumentSnapshot,\n type FirestoreDocument,\n type FirestoreDocumentAccessor,\n firestoreModelIdsFromDocuments,\n type FirestoreModelKey,\n firestoreModelKeysFromDocuments,\n getDataFromDocumentSnapshots,\n getDocumentSnapshots,\n latestSnapshotsFromDocuments,\n type LimitedFirestoreDocumentAccessor,\n loadDocumentsForDocumentReferences,\n loadDocumentsForIds,\n loadDocumentsForKeys\n} from '@dereekb/firebase';\nimport { type ArrayOrValue, asArray, type Destroyable, type Maybe } from '@dereekb/util';\nimport { type DbxFirebaseDocumentLoader, type DbxLimitedFirebaseDocumentLoader } from './document.loader';\n\nexport interface DbxFirebaseDocumentLoaderInstanceInitConfig<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>> {\n readonly accessor: A;\n}\n\n/**\n * DbxLimitedFirebaseDocumentLoader implementation within an instance.\n */\nexport class DbxLimitedFirebaseDocumentLoaderInstance<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>> implements DbxLimitedFirebaseDocumentLoader<T>, Destroyable {\n readonly accessor: A;\n\n protected readonly _documents = new BehaviorSubject<Maybe<D[]>>(undefined);\n protected readonly _restart = new Subject<void>();\n protected readonly _sub = new SubscriptionObject();\n\n readonly documents$ = this._documents.pipe(filterMaybe(), distinctUntilChanged());\n readonly keys$ = this.documents$.pipe(map(firestoreModelKeysFromDocuments));\n readonly ids$ = this.documents$.pipe(map(firestoreModelIdsFromDocuments));\n readonly refs$ = this.documents$.pipe(map(documentReferencesFromDocuments));\n\n readonly snapshots$: Observable<DocumentSnapshot<T>[]> = this.documents$.pipe(\n switchMap((docs) =>\n this._restart.pipe(\n startWith(null),\n exhaustMap(() => getDocumentSnapshots<D>(docs))\n )\n ),\n shareReplay(1)\n );\n\n readonly data$: Observable<DocumentDataWithIdAndKey<T>[]> = this.snapshots$.pipe(\n map((snapshots) => getDataFromDocumentSnapshots(snapshots, true)),\n shareReplay(1)\n );\n\n /**\n * Snapshot stream of the documents\n */\n readonly snapshotsStream$: Observable<DocumentSnapshot<T>[]> = this.documents$.pipe(\n switchMap((docs) => latestSnapshotsFromDocuments(docs)),\n shareReplay(1)\n );\n\n /**\n * Data streamd of the documents.\n */\n readonly dataStream$: Observable<DocumentDataWithIdAndKey<T>[]> = this.snapshotsStream$.pipe(dataFromDocumentSnapshots(), shareReplay(1));\n\n readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = pageLoadingStateFromObs(this.data$, false);\n readonly pageLoadingStateStream$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = pageLoadingStateFromObs(this.dataStream$, false);\n\n constructor(initConfig: DbxFirebaseDocumentLoaderInstanceInitConfig<T, D, A>) {\n this.accessor = initConfig.accessor;\n }\n\n destroy(): void {\n this._documents.complete();\n this._restart.complete();\n this._sub.destroy();\n }\n\n restart() {\n this._restart.next();\n }\n\n setKeys(keys: Maybe<ObservableOrValue<ArrayOrValue<FirestoreModelKey>>>): void {\n this.setDocuments(asObservable(keys).pipe(map((x) => loadDocumentsForKeys(this.accessor, asArray(x)))));\n }\n\n setRefs(refs: Maybe<ObservableOrValue<ArrayOrValue<DocumentReference<T>>>>): void {\n this.setDocuments(asObservable(refs).pipe(map((x) => loadDocumentsForDocumentReferences(this.accessor, asArray(x)))));\n }\n\n setDocuments(docs: Maybe<ObservableOrValue<ArrayOrValue<D>>>): void {\n this._sub.subscription = useAsObservable(docs, (x) => this._documents.next(asArray(x)));\n }\n}\n\nexport function dbxLimitedFirebaseDocumentLoaderInstance<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>>(config: DbxFirebaseDocumentLoaderInstanceInitConfig<T, D, A>): DbxLimitedFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxLimitedFirebaseDocumentLoaderInstance<T, D, A>(config);\n}\n\nexport function dbxLimitedFirebaseDocumentLoaderInstanceWithAccessor<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends LimitedFirestoreDocumentAccessor<T, D> = LimitedFirestoreDocumentAccessor<T, D>>(accessor: A): DbxLimitedFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxLimitedFirebaseDocumentLoaderInstance<T, D, A>({ accessor });\n}\n\n// MARK: Full DbxFirebaseDocumentLoaderInstance\nexport class DbxFirebaseDocumentLoaderInstance<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends FirestoreDocumentAccessor<T, D> = FirestoreDocumentAccessor<T, D>> extends DbxLimitedFirebaseDocumentLoaderInstance<T, D, A> implements DbxFirebaseDocumentLoader<T>, Destroyable {\n setIds(ids: Maybe<ObservableOrValue<ArrayOrValue<FirestoreModelKey>>>): void {\n this.setDocuments(asObservable(ids).pipe(map((x) => loadDocumentsForIds(this.accessor, asArray(x)))));\n }\n}\n\nexport function dbxFirebaseDocumentLoaderInstance<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends FirestoreDocumentAccessor<T, D> = FirestoreDocumentAccessor<T, D>>(config: DbxFirebaseDocumentLoaderInstanceInitConfig<T, D, A>): DbxFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxFirebaseDocumentLoaderInstance<T, D, A>(config);\n}\n\nexport function dbxFirebaseDocumentLoaderInstanceWithAccessor<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, A extends FirestoreDocumentAccessor<T, D> = FirestoreDocumentAccessor<T, D>>(accessor: A): DbxFirebaseDocumentLoaderInstance<T, D, A> {\n return new DbxFirebaseDocumentLoaderInstance<T, D, A>({ accessor });\n}\n","import { type FirestoreDocument, type FirebasePermissionErrorContext, type InModelContextFirebaseModelService, type FirestoreDocumentData, type DocumentSnapshot, type FirestoreAccessorStreamMode, type SnapshotOptions, type InContextFirebaseModelsService, type FirebaseModelsService } from '@dereekb/firebase';\nimport { type GrantedRole, type GrantedRoleTruthMap, type GrantedRoleTruthMapObject } from '@dereekb/model';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type SetIncludesMode, type IterableOrValue, type ModelKey } from '@dereekb/util';\nimport { map, type Observable, switchMap, shareReplay, distinctUntilChanged } from 'rxjs';\nimport { type DbxFirebaseInContextFirebaseModelInfoServiceInstance } from './model.context';\n\nexport type DbxFirebaseInContextFirebaseModelServiceInstanceFactory<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext> = <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(type: S extends InContextFirebaseModelsService<infer Y> ? (Y extends FirebaseModelsService<infer X, infer C> ? keyof X : never) : never, keyObs: ObservableOrValue<ModelKey>) => DbxFirebaseInContextFirebaseModelServiceInstance<D, R, C>;\n\nexport function dbxFirebaseInContextFirebaseModelServiceInstanceFactory<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext>(context$: Observable<S>): DbxFirebaseInContextFirebaseModelServiceInstanceFactory<S, C> {\n return <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(type: S extends InContextFirebaseModelsService<infer Y> ? (Y extends FirebaseModelsService<infer X, infer C> ? keyof X : never) : never, keyObs: ObservableOrValue<ModelKey>) => {\n const key$ = asObservable(keyObs);\n const modelServiceObs = context$.pipe(\n map((x) => x(type)),\n switchMap((service) => key$.pipe(map((key) => service(key))))\n ) as unknown as Observable<InModelContextFirebaseModelService<C, FirestoreDocumentData<D>, D, R>>;\n\n return dbxFirebaseInContextFirebaseModelServiceInstance<D, R, C>(modelServiceObs);\n };\n}\n\nexport interface DbxFirebaseInContextFirebaseModelServiceInstance<D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext> extends DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R> {\n readonly modelService$: Observable<InModelContextFirebaseModelService<C, FirestoreDocumentData<D>, D, R>>;\n}\n\n/**\n * Creates a new DbxFirebaseInContextFirebaseModelServiceInstance.\n *\n * Wraps an InModelContextFirebaseModelService observable and provides different piped observables.\n */\nexport function dbxFirebaseInContextFirebaseModelServiceInstance<D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext>(modelService$: Observable<InModelContextFirebaseModelService<C, FirestoreDocumentData<D>, D, R>>) {\n const key$ = modelService$.pipe(map((x) => x.model.key));\n\n // MARK: Model\n const modelType$ = modelService$.pipe(\n map((x) => x.model.modelType),\n distinctUntilChanged()\n );\n\n const model$ = modelService$.pipe(\n map((x) => x.model),\n distinctUntilChanged((a, b) => a.key === b.key),\n shareReplay(1)\n );\n\n const snapshotData$ = model$.pipe(\n switchMap((x) => x.snapshotData()),\n shareReplay(1)\n );\n\n function snapshotStream(mode: FirestoreAccessorStreamMode): Observable<DocumentSnapshot<FirestoreDocumentData<D>>> {\n return model$.pipe(\n switchMap((x) => x.snapshotStream(mode)),\n shareReplay(1)\n );\n }\n\n function snapshotDataStream(mode: FirestoreAccessorStreamMode, options?: SnapshotOptions): Observable<FirestoreDocumentData<D>> {\n return model$.pipe(\n switchMap((x) => x.snapshotDataStream(mode)),\n shareReplay(1)\n );\n }\n\n // MARK: Roles\n const roleReader$ = modelService$.pipe(\n switchMap((x) => x.roleReader()),\n shareReplay(1)\n );\n\n const roleMap$ = roleReader$.pipe(\n map((x) => x.roleMap),\n shareReplay(1)\n );\n\n const hasNoAccess$ = roleReader$.pipe(\n map((x) => x.hasNoAccess()),\n shareReplay(1)\n );\n\n function truthMap<M extends GrantedRoleTruthMapObject<any, R>>(input: M): Observable<GrantedRoleTruthMap<M>> {\n return roleReader$.pipe(\n map((x) => x.truthMap(input)),\n shareReplay(1)\n );\n }\n\n function hasAnyRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return hasRoles('any', roles);\n }\n\n function hasAllRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return hasRoles('all', roles);\n }\n\n function hasRoles(setIncludes: SetIncludesMode, roles: IterableOrValue<R>): Observable<boolean> {\n return roleReader$.pipe(\n map((x) => x.hasRoles(setIncludes, roles)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n function containsAnyRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return containsRoles('any', roles);\n }\n\n function containsAllRoles(roles: IterableOrValue<R>): Observable<boolean> {\n return containsRoles('all', roles);\n }\n\n function containsRoles(setIncludes: SetIncludesMode, roles: IterableOrValue<R>): Observable<boolean> {\n return roleReader$.pipe(\n map((x) => x.containsRoles(setIncludes, roles)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n const result: DbxFirebaseInContextFirebaseModelServiceInstance<D, R, C> = {\n modelService$,\n key$,\n modelType$,\n model$,\n snapshotData$,\n snapshotStream,\n snapshotDataStream,\n roleReader$,\n roleMap$,\n hasNoAccess$,\n truthMap,\n hasAnyRoles,\n hasAllRoles,\n hasRoles,\n containsAnyRoles,\n containsAllRoles,\n containsRoles\n };\n\n return result;\n}\n","import { type FirestoreModelType, buildFirebaseCollectionTypeModelTypeMap, type FirebasePermissionErrorContext, type FirestoreDocument, type FirestoreModelIdentityTypeMap, type FirestoreModelKey, type InContextFirebaseModelsService, firestoreModelKeyCollectionTypePair } from '@dereekb/firebase';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type GrantedRole } from '@dereekb/model';\nimport { shareReplay, map, type Observable, type OperatorFunction, first, switchMap } from 'rxjs';\nimport { type DbxFirebaseInContextFirebaseModelInfoServiceInstance } from './model.context';\nimport { type DbxFirebaseInContextFirebaseModelServiceInstanceFactory } from './model.context.instance';\n\n/**\n * Used for retrieving contexts for a specific model type/identity.\n */\nexport abstract class DbxFirebaseModelContextService {\n /**\n * Creates a new DbxFirebaseInContextFirebaseModelInfoServiceInstance for the input model key.\n *\n * @param key$\n */\n abstract modelInfoInstance<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole>(keyObs: ObservableOrValue<FirestoreModelKey>): Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>;\n}\n\nexport type DbxFirebaseModelContextServiceInfoInstanceFactory = <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(keyObs: ObservableOrValue<FirestoreModelKey>) => Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>;\n\nexport interface DbxFirebaseModelContextServiceInfoInstanceFactoryConfig<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext> {\n readonly modelService: DbxFirebaseInContextFirebaseModelServiceInstanceFactory<S, C>;\n readonly entityMap$: Observable<FirestoreModelIdentityTypeMap>;\n}\n\nexport function dbxFirebaseModelContextServiceInfoInstanceFactory<S extends InContextFirebaseModelsService<any>, C extends FirebasePermissionErrorContext = FirebasePermissionErrorContext>(config: DbxFirebaseModelContextServiceInfoInstanceFactoryConfig<S, C>): DbxFirebaseModelContextServiceInfoInstanceFactory {\n const { modelService, entityMap$ } = config;\n return <D extends FirestoreDocument<any>, R extends GrantedRole = GrantedRole>(keyObs: ObservableOrValue<string>) => {\n const key$ = asObservable(keyObs);\n\n return key$.pipe(\n map(firestoreModelKeyCollectionTypePair),\n switchMap((pair) => {\n return entityMap$.pipe(\n map((entityMap) => {\n const modelType = entityMap.get(pair.collectionType) as FirestoreModelType;\n\n if (!modelType) {\n const message = `dbxFirebaseModelContextServiceInfoInstanceFactory Error: Failed to retrieve model type for collection type \"${pair.collectionType}\"`;\n console.error(message);\n throw new Error(message);\n }\n\n return modelService(modelType as any, pair.key) as DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>;\n })\n );\n })\n );\n };\n}\n\n/**\n * Operator function that builds a FirestoreModelIdentityTypeMap from the input context and shares the replay.\n *\n * Since the output won't change with different contexts, the map is built once and then shared.\n *\n * @returns\n */\nexport function firebaseContextServiceEntityMap<T extends InContextFirebaseModelsService<any>>(): OperatorFunction<T, FirestoreModelIdentityTypeMap> {\n return (obs: Observable<T>) => {\n return obs.pipe(\n map((x) => buildFirebaseCollectionTypeModelTypeMap(x)),\n first(),\n shareReplay(1)\n );\n };\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxFirebaseModelContextService } from './model.context.service';\nimport { type ClassType } from '@dereekb/util';\n\n/**\n * Factory function for creating a DbxFirebaseModelContextService instance.\n */\nexport type DbxFirebaseModelContextServiceFactory<T extends DbxFirebaseModelContextService> = (injector: Injector) => T;\n\nexport interface ProvideDbxFirebaseModelContextServiceConfig<T extends DbxFirebaseModelContextService> {\n readonly dbxFirebaseModelContextServiceClass: ClassType<T>;\n readonly dbxFirebaseModelContextServiceFactory?: DbxFirebaseModelContextServiceFactory<T>;\n}\n\n/**\n * Creates EnvironmentProviders that provides a DbxFirebaseModelContextService and the configured class instance.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseModelContextService<T extends DbxFirebaseModelContextService>(config: ProvideDbxFirebaseModelContextServiceConfig<T>): EnvironmentProviders {\n const { dbxFirebaseModelContextServiceClass, dbxFirebaseModelContextServiceFactory } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseModelContextService,\n useExisting: dbxFirebaseModelContextServiceClass\n }\n ];\n\n if (dbxFirebaseModelContextServiceFactory) {\n providers.push({\n provide: dbxFirebaseModelContextServiceClass,\n useFactory: dbxFirebaseModelContextServiceFactory,\n deps: [Injector]\n });\n } else {\n providers.push({\n provide: DbxFirebaseModelContextService,\n useClass: dbxFirebaseModelContextServiceClass\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { distinctUntilChanged, map, Observable, shareReplay, switchMap, combineLatest, of, catchError } from 'rxjs';\nimport { FirestoreCollectionType, FirestoreDocument, FirestoreDocumentData, FirestoreModelIdentity, FirestoreModelKey } from '@dereekb/firebase';\nimport { DbxModelTypeInfo, DbxModelTypesMap, DbxModelTypesService } from '@dereekb/dbx-web';\nimport { ArrayOrValue, asArray, Configurable, FactoryWithRequiredInput, Maybe } from '@dereekb/util';\nimport { ClickableAnchorLinkSegueRef, IconAndTitle, SegueRef } from '@dereekb/dbx-core';\nimport { ObservableOrValue, filterMaybe, filterMaybeArray } from '@dereekb/rxjs';\nimport { GrantedRole } from '@dereekb/model';\nimport { Injectable, inject, Inject } from '@angular/core';\nimport { DbxFirebaseModelContextService } from '../../service/model.context.service';\nimport { DbxFirebaseInContextFirebaseModelInfoServiceInstance } from '../../service/model.context';\n\n/**\n * Configuration provided in the root module for configuring entries.\n */\nexport abstract class DbxFirebaseModelTypesServiceConfig {\n /**\n * Entries to register.\n */\n abstract entries: DbxFirebaseModelTypesServiceEntry[];\n}\n\nexport interface DbxFirebaseModelTypesServiceEntry<T = unknown> extends Omit<DbxModelTypeInfo, 'canSegueToView' | 'modelType'> {\n /**\n * Identity of the item being registered.\n */\n readonly identity: FirestoreModelIdentity;\n /**\n * Creates the DbxFirebaseModelDisplayInfo for the input data.\n *\n * If no icon is provided, it uses the default icon configured in this entry.\n *\n * @param value\n * @returns\n */\n readonly displayInfoFactory: FactoryWithRequiredInput<DbxFirebaseModelDisplayInfo, T>;\n}\n\nexport type DbxFirebaseModelDisplayInfo = IconAndTitle;\n\nexport interface DbxFirebaseModelTypeInfo<T = unknown> extends DbxModelTypeInfo, Pick<DbxFirebaseModelTypesServiceEntry<T>, 'identity' | 'displayInfoFactory'> {}\n\nexport type DbxFirebaseModelTypesMap = DbxModelTypesMap<DbxFirebaseModelTypeInfo>;\n\n/**\n * Provides model type information about models registered within Firebase.\n *\n * Automatically configures the DbxModelTypesService.\n */\n@Injectable()\nexport class DbxFirebaseModelTypesService {\n readonly dbxFirebaseModelContextService = inject(DbxFirebaseModelContextService);\n\n readonly dbxModelTypesService = inject(DbxModelTypesService<DbxFirebaseModelTypeInfo>);\n\n constructor(@Inject(DbxFirebaseModelTypesServiceConfig) initialConfig: DbxFirebaseModelTypesServiceConfig) {\n if (initialConfig.entries) {\n this.register(initialConfig.entries);\n }\n }\n\n getDisplayInfo<T>(typeInfo: DbxFirebaseModelTypeInfo<T>, data: T): DbxFirebaseModelDisplayInfo {\n let displayInfo: Configurable<DbxFirebaseModelDisplayInfo>;\n\n if (data != null) {\n displayInfo = typeInfo.displayInfoFactory(data);\n displayInfo.icon = displayInfo.icon || typeInfo.icon; // set default icon\n } else {\n displayInfo = this.getDefaultDisplayInfo(typeInfo);\n }\n\n return displayInfo;\n }\n\n getDefaultDisplayInfo<T = unknown>(typeInfo: DbxFirebaseModelTypeInfo<T>) {\n // TODO: Make configurable\n return {\n title: typeInfo.label ?? '',\n icon: 'warning'\n };\n }\n\n // MARK: Register\n register(entries: ArrayOrValue<DbxFirebaseModelTypesServiceEntry>) {\n const typeConfigs = asArray(entries).map((x) => ({ ...x, modelType: x.identity.modelType }));\n this.dbxModelTypesService.addTypeConfigs(typeConfigs);\n }\n\n // MARK: Retrieval\n currentInfoForType(type: FirestoreCollectionType): Observable<Maybe<DbxFirebaseModelTypeInfo>> {\n return this.dbxModelTypesService.typesMap$.pipe(map((x) => x[type]));\n }\n\n infoForType(type: FirestoreCollectionType): Observable<DbxFirebaseModelTypeInfo> {\n return this.currentInfoForType(type).pipe(\n map((x) => {\n if (!x) {\n console.error(`DbxFirebaseModelTypesService: contained no info for type \"${type}\". Ensure the correct type was entered, and that the type is registered with the DbxFirebaseModelTypesService.`);\n throw x;\n }\n\n return x as DbxFirebaseModelTypeInfo;\n })\n );\n }\n\n instanceForKey<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole>(key$: ObservableOrValue<FirestoreModelKey>): DbxFirebaseModelTypesServiceInstance<D, R> {\n return dbxFirebaseModelTypesServiceInstance<D, R>(this.dbxFirebaseModelContextService.modelInfoInstance<D, R>(key$), this);\n }\n\n instancePairsForKeys(keys: ArrayOrValue<ObservableOrValue<FirestoreModelKey>>) {\n return dbxFirebaseModelTypesServiceInstancePairForKeysFactory(this)(keys);\n }\n}\n\n/**\n * Information pair for an instance.\n */\nexport interface DbxFirebaseModelTypesServiceInstancePair<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole> {\n readonly key: FirestoreModelKey;\n readonly instance: DbxFirebaseModelTypesServiceInstance<D, R>;\n readonly displayInfo: DbxFirebaseModelDisplayInfo;\n readonly segueRef: Maybe<ClickableAnchorLinkSegueRef>;\n}\n\nexport type DbxFirebaseModelTypesServiceInstancePairForKeysFactory = (keys: ArrayOrValue<ObservableOrValue<FirestoreModelKey>>) => Observable<DbxFirebaseModelTypesServiceInstancePair[]>;\n\nexport function dbxFirebaseModelTypesServiceInstancePairForKeysFactory(service: DbxFirebaseModelTypesService): DbxFirebaseModelTypesServiceInstancePairForKeysFactory {\n return (keys: ArrayOrValue<ObservableOrValue<FirestoreModelKey>>) => {\n const instances = asArray(keys).map((x) => service.instanceForKey(x).safeInstancePair$);\n return instances.length ? combineLatest(instances).pipe(filterMaybeArray(), shareReplay(1)) : of([]);\n };\n}\n\n/**\n * DbxFirebaseModelTypesService instance\n */\nexport interface DbxFirebaseModelTypesServiceInstance<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole> {\n readonly modelInfoInstance$: Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>;\n readonly dbxFirebaseModelTypesService: DbxFirebaseModelTypesService;\n readonly key$: Observable<string>;\n readonly modelType$: Observable<string>;\n readonly snapshotData$: Observable<Maybe<FirestoreDocumentData<D>>>;\n readonly safeTypeInfo$: Observable<Maybe<DbxFirebaseModelTypeInfo<unknown>>>;\n readonly typeInfo$: Observable<DbxFirebaseModelTypeInfo<unknown>>;\n readonly identity$: Observable<FirestoreModelIdentity>;\n readonly segueRef$: Observable<Maybe<SegueRef>>;\n readonly displayInfo$: Observable<DbxFirebaseModelDisplayInfo>;\n readonly clickableSegueRef$: Observable<Maybe<ClickableAnchorLinkSegueRef>>;\n readonly safeInstancePair$: Observable<Maybe<DbxFirebaseModelTypesServiceInstancePair>>;\n readonly instancePair$: Observable<DbxFirebaseModelTypesServiceInstancePair>;\n}\n\nexport function dbxFirebaseModelTypesServiceInstance<D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole>(modelInfoInstance$: Observable<DbxFirebaseInContextFirebaseModelInfoServiceInstance<D, R>>, dbxFirebaseModelTypesService: DbxFirebaseModelTypesService) {\n const key$ = modelInfoInstance$.pipe(switchMap((x) => x.key$));\n const modelType$ = modelInfoInstance$.pipe(switchMap((x) => x.modelType$));\n const snapshotData$ = modelInfoInstance$.pipe(switchMap((x) => x.snapshotData$));\n\n const safeTypeInfo$ = modelType$.pipe(\n switchMap((x) => dbxFirebaseModelTypesService.currentInfoForType(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const typeInfo$ = safeTypeInfo$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n const identity$ = typeInfo$.pipe(\n map((x) => x.identity),\n distinctUntilChanged()\n );\n\n const segueRef$: Observable<Maybe<SegueRef>> = combineLatest([key$, typeInfo$]).pipe(\n map(([key, info]) => (info.sref ? info.sref(key) : undefined)),\n shareReplay(1)\n );\n\n const displayInfo$: Observable<DbxFirebaseModelDisplayInfo> = combineLatest([typeInfo$, snapshotData$]).pipe(\n map(([typeInfo, data]) => dbxFirebaseModelTypesService.getDisplayInfo(typeInfo, data)),\n shareReplay(1)\n );\n\n const clickableSegueRef$: Observable<Maybe<ClickableAnchorLinkSegueRef>> = combineLatest([segueRef$, displayInfo$]).pipe(\n map(([segueRef, displayInfo]) => {\n let ref: Maybe<ClickableAnchorLinkSegueRef> = undefined;\n\n if (segueRef) {\n ref = {\n ...segueRef,\n title: displayInfo.title,\n icon: displayInfo.icon\n };\n }\n\n return ref;\n }),\n shareReplay(1)\n );\n\n const instancePair$: Observable<DbxFirebaseModelTypesServiceInstancePair> = combineLatest([clickableSegueRef$, displayInfo$, key$]).pipe(\n map(([segueRef, displayInfo, key]) => ({ segueRef, displayInfo, key, instance })),\n shareReplay(1)\n );\n\n const safeInstancePair$: Observable<Maybe<DbxFirebaseModelTypesServiceInstancePair>> = instancePair$.pipe(catchError(() => of(undefined)));\n\n const instance: DbxFirebaseModelTypesServiceInstance<D, R> = {\n modelInfoInstance$,\n dbxFirebaseModelTypesService,\n key$,\n modelType$,\n snapshotData$,\n safeTypeInfo$,\n typeInfo$,\n identity$,\n segueRef$,\n displayInfo$,\n clickableSegueRef$,\n safeInstancePair$,\n instancePair$\n };\n\n return instance;\n}\n","import { ArrayOrValue, DecisionFunction, Maybe, asArray, invertDecision } from '@dereekb/util';\nimport { FirestoreModelIdentity } from '@dereekb/firebase';\nimport { map, Observable, switchMap, shareReplay, startWith, of, catchError } from 'rxjs';\nimport { Injectable, inject } from '@angular/core';\nimport { allDbxModelViewTrackerEventModelKeys, DbxModelTrackerService } from '@dereekb/dbx-web';\nimport { DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { filterItemsWithObservableDecision, filterMaybeArray, invertObservableDecision, mapEachAsync, ObservableDecisionFunction } from '@dereekb/rxjs';\n\nexport interface DbxFirebaseModelTrackerFilterItem {\n readonly instancePair: DbxFirebaseModelTypesServiceInstancePair;\n readonly identity: FirestoreModelIdentity;\n}\n\nexport interface DbxFirebaseModelTrackerHistoryFilter {\n /**\n * Whether or not to exclude the values instead of include them.\n */\n readonly invertFilter?: boolean;\n /**\n * Identity types to filter on.\n */\n readonly identity?: Maybe<ArrayOrValue<FirestoreModelIdentity>>;\n /**\n * Arbitrary filter function to filter individual items.\n */\n readonly filterItem?: ObservableDecisionFunction<DbxFirebaseModelTrackerFilterItem>;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirebaseModelTrackerService {\n readonly dbxModelTrackerService = inject(DbxModelTrackerService);\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly historyKeys$ = this.dbxModelTrackerService.newEvent$.pipe(\n startWith(null),\n switchMap(() => this.loadHistoryKeys()),\n shareReplay(1)\n );\n\n readonly historyPairs$ = this.dbxModelTrackerService.newEvent$.pipe(\n startWith(null),\n switchMap(() => this.loadHistoryPairs()), // TODO: Improve efficiency of this to only load/remove items for new keys\n shareReplay(1)\n );\n\n readonly filterItemHistoryPairs$: Observable<DbxFirebaseModelTrackerFilterItem[]> = this.historyPairs$.pipe(\n mapEachAsync(\n (instancePair) =>\n instancePair.instance.identity$.pipe(\n map((identity) => ({ instancePair, identity })),\n catchError(() => of(undefined))\n ),\n { onlyFirst: true }\n ),\n filterMaybeArray<DbxFirebaseModelTrackerFilterItem>(),\n shareReplay(1)\n );\n\n /**\n * Filters from historyPairs$ using the input filter configuration, if it is provided.\n *\n * @param filter\n * @returns\n */\n filterHistoryPairs(filter?: Maybe<DbxFirebaseModelTrackerHistoryFilter>): Observable<DbxFirebaseModelTypesServiceInstancePair[]> {\n if (filter && (filter?.identity || filter?.filterItem)) {\n const { invertFilter = false, identity, filterItem } = filter;\n const allowedIdentities = new Set(asArray(identity));\n const baseIsAllowedIdentityFn: DecisionFunction<FirestoreModelIdentity> = identity ? (x) => allowedIdentities.has(x) : () => true;\n const isAllowedIdentityFn = invertDecision(baseIsAllowedIdentityFn, invertFilter);\n\n const baseFilterItemFn: ObservableDecisionFunction<DbxFirebaseModelTrackerFilterItem> = filterItem ? invertObservableDecision(filterItem, invertFilter) : () => of(true);\n\n const filterItemFn: ObservableDecisionFunction<DbxFirebaseModelTrackerFilterItem> = (x) => {\n if (isAllowedIdentityFn(x.identity)) {\n return baseFilterItemFn(x);\n } else {\n return of(false);\n }\n };\n\n return this.filterItemHistoryPairs$.pipe(\n filterItemsWithObservableDecision(filterItemFn),\n map((x) => x.map((y) => y.instancePair)),\n shareReplay(1)\n );\n } else {\n return this.historyPairs$;\n }\n }\n\n loadHistoryKeys() {\n return this.dbxModelTrackerService.getAllViewEvents().pipe(map(allDbxModelViewTrackerEventModelKeys));\n }\n\n loadHistoryPairs(): Observable<DbxFirebaseModelTypesServiceInstancePair[]> {\n const historyKeys$ = this.loadHistoryKeys();\n return historyKeys$.pipe(switchMap((x) => this.dbxFirebaseModelTypesService.instancePairsForKeys(x)));\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, provideDbxListView, DbxValueAsListItem, provideDbxListViewWrapper, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, DbxSelectionValueListViewComponentImportsModule, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE } from '@dereekb/dbx-web';\nimport { of } from 'rxjs';\nimport { DbxFirebaseModelTypesServiceInstancePair } from './model.types.service';\n\nexport type DbxFirebaseModelTypeInstanceListItem = DbxValueAsListItem<DbxFirebaseModelTypesServiceInstancePair>;\n\n/**\n * Renders an item as configured from the DbxFirebaseModelTypesServiceInstancePair.\n */\n@Component({\n selector: 'dbx-firebase-model-type-instance-list',\n template: DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxListWrapperComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListViewWrapper(DbxFirebaseModelTypeInstanceListComponent),\n standalone: true\n})\nexport class DbxFirebaseModelTypeInstanceListComponent extends AbstractDbxSelectionListWrapperDirective<DbxFirebaseModelTypesServiceInstancePair> {\n constructor() {\n super({\n componentClass: DbxFirebaseModelTypeInstanceListViewComponent,\n defaultSelectionMode: 'view'\n });\n }\n}\n\n@Component({\n selector: 'dbx-firebase-model-type-instance-list-view',\n template: DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxSelectionValueListViewComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListView(DbxFirebaseModelTypeInstanceListViewComponent),\n standalone: true\n})\nexport class DbxFirebaseModelTypeInstanceListViewComponent extends AbstractDbxSelectionListViewDirective<DbxFirebaseModelTypesServiceInstancePair> {\n readonly config: DbxSelectionValueListViewConfig<DbxFirebaseModelTypeInstanceListItem> = {\n componentClass: DbxFirebaseModelTypeInstanceListViewItemComponent,\n mapValuesToItemValues: (x) => of(x.map((y) => ({ itemValue: y, icon: y.displayInfo.icon ?? y.icon, anchor: y.segueRef })))\n };\n}\n\n@Component({\n selector: 'dbx-firebase-model-type-instance-list-view-item',\n template: `\n <span>{{ title }}</span>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelTypeInstanceListViewItemComponent extends AbstractDbxValueListViewItemComponent<DbxFirebaseModelTypesServiceInstancePair> {\n readonly title = this.itemValue.displayInfo.title;\n}\n","import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport { AnchorForValueFunction, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective } from '@dereekb/dbx-web';\nimport { ListLoadingState, loadingStateFromObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap, shareReplay, Observable } from 'rxjs';\nimport { DbxFirebaseModelTrackerHistoryFilter, DbxFirebaseModelTrackerService } from './model.tracker.service';\nimport { DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { DbxFirebaseModelTypeInstanceListComponent } from '../model.types.list.component';\n\n@Component({\n selector: 'dbx-firebase-model-history',\n template: `\n <dbx-firebase-model-type-instance-list [state]=\"state\" dbxListItemModifier [dbxListItemAnchorModifier]=\"anchorForItem()\">\n <ng-content empty select=\"[empty]\"></ng-content>\n </dbx-firebase-model-type-instance-list>\n `,\n imports: [DbxFirebaseModelTypeInstanceListComponent, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelHistoryComponent {\n readonly dbxFirebaseModelTrackerService = inject(DbxFirebaseModelTrackerService);\n\n readonly anchorForItem = input<Maybe<AnchorForValueFunction<DbxFirebaseModelTypesServiceInstancePair>>>();\n readonly historyFilter = input<Maybe<DbxFirebaseModelTrackerHistoryFilter>>();\n\n readonly historyPairs$ = toObservable(this.historyFilter).pipe(\n switchMap((x) => this.dbxFirebaseModelTrackerService.filterHistoryPairs(x)),\n shareReplay(1)\n );\n\n readonly state: Observable<ListLoadingState<DbxFirebaseModelTypesServiceInstancePair>> = loadingStateFromObs(this.historyPairs$);\n}\n","import { ChangeDetectionStrategy, Component, ElementRef } from '@angular/core';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { AbstractPopoverDirective, AnchorForValueFunction, DbxListEmptyContentComponent, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverKey, DbxPopoverScrollContentDirective, DbxPopoverService } from '@dereekb/dbx-web';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { DbxFirebaseModelTrackerHistoryFilter } from './model.tracker.service';\nimport { DbxFirebaseModelHistoryComponent } from './model.history.component';\n\nexport interface DbxFirebaseModelHistoryPopoverConfig {\n /**\n * Custom icon\n *\n * Defaults to \"history\"\n */\n readonly icon?: string;\n /**\n * Custom header text\n *\n * Defaults to \"History\"\n */\n readonly header?: string;\n /**\n * Custom empty text when no items exist.\n */\n readonly emptyText?: string;\n /**\n * Origin to add the popover to.\n */\n readonly origin: ElementRef;\n /**\n * Optional config to pass to the DbxFirebaseHistoryComponent\n */\n readonly historyFilter?: Maybe<DbxFirebaseModelTrackerHistoryFilter>;\n /**\n * Anchor\n */\n readonly anchorForItem?: Maybe<AnchorForValueFunction<DbxFirebaseModelTypesServiceInstancePair>>;\n}\n\nexport type DbxFirebaseModelHistoryPopoverConfigWithoutOrigin = Omit<DbxFirebaseModelHistoryPopoverConfig, 'origin'>;\n\nexport const DEFAULT_DBX_FIREBASE_MODEL_HISTORY_COMPONENT_POPOVER_KEY = 'history';\n\n@Component({\n templateUrl: './model.history.popover.component.html',\n imports: [DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxFirebaseModelHistoryComponent, DbxListEmptyContentComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelHistoryPopoverComponent extends AbstractPopoverDirective<unknown, DbxFirebaseModelHistoryPopoverConfig> {\n static openPopover(popupService: DbxPopoverService, { origin, header, icon, emptyText, historyFilter, anchorForItem }: DbxFirebaseModelHistoryPopoverConfig, popoverKey?: DbxPopoverKey): NgPopoverRef {\n return popupService.open({\n key: popoverKey ?? DEFAULT_DBX_FIREBASE_MODEL_HISTORY_COMPONENT_POPOVER_KEY,\n origin,\n componentClass: DbxFirebaseModelHistoryPopoverComponent,\n data: {\n header,\n icon,\n emptyText,\n historyFilter,\n anchorForItem\n }\n });\n }\n\n get config(): DbxFirebaseModelHistoryPopoverConfig {\n return this.popover.data as DbxFirebaseModelHistoryPopoverConfig;\n }\n\n readonly icon = this.config.icon ?? 'history';\n readonly header = this.config.header ?? 'History';\n readonly emptyText = this.config.emptyText ?? 'History is empty.';\n readonly historyFilter = this.config.historyFilter;\n readonly anchorForItem = this.config.anchorForItem;\n}\n","<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-model-history [historyFilter]=\"historyFilter\" [anchorForItem]=\"anchorForItem\">\n <dbx-list-empty-content empty>\n <p>{{ emptyText }}</p>\n </dbx-list-empty-content>\n </dbx-firebase-model-history>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, viewChild } from '@angular/core';\nimport { AbstractPopoverRefDirective, DbxIconButtonComponent, DbxPopoverService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseModelHistoryPopoverComponent, DbxFirebaseModelHistoryPopoverConfigWithoutOrigin } from './model.history.popover.component';\nimport { Maybe } from '@dereekb/util';\n\nexport type DbxFirebaseModelHistoryPopoverButtonConfig = DbxFirebaseModelHistoryPopoverConfigWithoutOrigin;\n\n@Component({\n selector: 'dbx-firebase-model-history-popover-button',\n template: `\n <dbx-icon-button #button (buttonClick)=\"showHistoryPopover()\" icon=\"history\"></dbx-icon-button>\n `,\n standalone: true,\n imports: [DbxIconButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseModelHistoryPopoverButtonComponent extends AbstractPopoverRefDirective<unknown, unknown> {\n private readonly _dbxPopoverService = inject(DbxPopoverService);\n\n readonly buttonElement = viewChild.required<string, ElementRef>('button', { read: ElementRef });\n readonly config = input<DbxFirebaseModelHistoryPopoverConfigWithoutOrigin>();\n\n protected override _makePopoverRef(origin?: Maybe<ElementRef>): NgPopoverRef<unknown, unknown> {\n const config = this.config();\n\n if (!origin) {\n throw new Error('Missing origin.');\n }\n\n return DbxFirebaseModelHistoryPopoverComponent.openPopover(this._dbxPopoverService, {\n origin,\n ...config\n });\n }\n\n showHistoryPopover(): void {\n const origin = this.buttonElement();\n this.showPopover(origin);\n }\n}\n","import { type FirestoreDocument, type FirestoreModelIdentity } from '@dereekb/firebase';\nimport { type SourceSelectLoadSource } from '@dereekb/dbx-form';\nimport { type LoadingState, loadingStateFromObs, mapEachAsync } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\nimport { type GrantedRole } from '@dereekb/model';\nimport { type MapFunction } from '@dereekb/util';\nimport { type DbxFirebaseModelTypesServiceInstancePair } from '../model.types.service';\nimport { type DbxFirebaseModelTrackerHistoryFilter, type DbxFirebaseModelTrackerService } from './model.tracker.service';\n\nexport interface DbxFirebaseSourceSelectLoadSourceConfig<M, D extends FirestoreDocument<any> = any, R extends GrantedRole = GrantedRole> extends Pick<DbxFirebaseModelTrackerHistoryFilter, 'filterItem'> {\n /**\n * Source label. Defaults to \"History\".\n */\n readonly label?: string;\n /**\n * Type of model to pull from the history.\n */\n readonly identity: FirestoreModelIdentity;\n /**\n * Maps a result instance to the target meta type\n */\n readonly mapToMeta: MapFunction<DbxFirebaseModelTypesServiceInstancePair<D, R>, Observable<M>>;\n /**\n * Tracker service to load history values from.\n */\n readonly dbxFirebaseModelTrackerService: DbxFirebaseModelTrackerService;\n}\n\n/**\n * Configures a SourceSelectLoadSource using the DbxFirebaseModelTrackerService to load models of a specific identity.\n *\n * @param config\n * @returns\n */\nexport function dbxFirebaseSourceSelectLoadSource<M>(config: DbxFirebaseSourceSelectLoadSourceConfig<M>): SourceSelectLoadSource<M> {\n const { label = 'History', identity, mapToMeta, filterItem, dbxFirebaseModelTrackerService } = config;\n const historyValuesObs = dbxFirebaseModelTrackerService.filterHistoryPairs({ identity, filterItem });\n const metaObs = historyValuesObs.pipe(mapEachAsync(mapToMeta));\n const meta: Observable<LoadingState<M[]>> = loadingStateFromObs(metaObs);\n\n return {\n label,\n meta\n };\n}\n","import { type FirestoreDocument, type FirestoreModelIdentity } from '@dereekb/firebase';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type DbxFirebaseDocumentReadOnlyStore } from '../../store/store';\nimport { type LoadingState } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * Provides a source of entities.\n */\nexport abstract class DbxFirebaseModelEntitiesSource {\n /**\n * Observable of a LoadingState of entity values.\n */\n abstract readonly entities$: Observable<LoadingState<DbxFirebaseModelEntity[]>>;\n}\n\n/**\n * A model entity.\n */\nexport interface DbxFirebaseModelEntity {\n /**\n * Model identity for the entity.\n *\n * Used for sorting/grouping by expected entity type.\n */\n readonly modelIdentity: FirestoreModelIdentity;\n /**\n * Optional name for\n */\n readonly name?: Maybe<string>;\n /**\n * An associated store for the document, if it is available.\n */\n readonly store?: Maybe<DbxFirebaseDocumentReadOnlyStore<any, any>>;\n}\n\nexport interface DbxFirebaseModelEntityWithStore<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends DbxFirebaseModelEntity {\n /**\n * An associated store for the document, if it is available.\n */\n readonly store: DbxFirebaseDocumentReadOnlyStore<T, D>;\n}\n\n/**\n * Returns true if the input entity has a defined store.\n *\n * @param entity\n * @returns\n */\nexport function isDbxFirebaseModelEntityWithStore<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>>(entity: DbxFirebaseModelEntity): entity is DbxFirebaseModelEntityWithStore<T, D> {\n return entity.modelIdentity != null && entity.store != null;\n}\n\n/**\n * An entity that has a key.\n */\nexport interface DbxFirebaseModelEntityWithKey extends DbxFirebaseModelEntity {\n /**\n * The key of the target document.\n */\n readonly key: ModelKey;\n}\n\n/**\n * An entity that has a key and a store.\n */\nexport interface DbxFirebaseModelEntityWithKeyAndStore<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends Omit<DbxFirebaseModelEntityWithKey, 'store'>, DbxFirebaseModelEntityWithStore<T, D> {}\n","import { inject, Injectable, Type } from '@angular/core';\nimport { ArrayOrValue, Maybe, cachedGetter, filterMaybeArrayValues, mapIterable, useIterableOrValue } from '@dereekb/util';\nimport { FirestoreModelIdentity } from '@dereekb/firebase';\n\nexport interface DbxFirebaseModelEntitiesWidgetEntry {\n /**\n * Widget type to respond to.\n */\n readonly identity: FirestoreModelIdentity;\n /**\n * The priority to use when sorting the entities.\n *\n * Higher values are displayed first in the list.\n */\n readonly sortPriority?: Maybe<number>;\n /**\n * Widget component that is specific to this entity.\n */\n readonly entityComponentClass?: Maybe<Type<unknown>>;\n /**\n * Overrides the \"common\" widget component used for all entities.\n */\n readonly commonComponentClass?: Maybe<Type<unknown>>;\n /**\n * Optional widget component that is specific to this entity that provides additional debug information, and is displayed after the common widget.\n */\n readonly debugComponentClass?: Maybe<Type<unknown>>;\n}\n\n/**\n * Configuration provided in the root module for configuring entries.\n */\nexport abstract class DbxFirebaseModelEntitiesWidgetServiceConfig {\n /**\n * Entries to register.\n */\n abstract entries: DbxFirebaseModelEntitiesWidgetEntry[];\n /**\n * The default \"common\" widget component used for all entities.\n */\n abstract commonComponentClass?: Maybe<Type<unknown>>;\n /**\n * The default \"debug\" widget component used for all entities.\n */\n abstract debugComponentClass?: Maybe<Type<unknown>>;\n}\n\n/**\n * Service used to register widgets used for model entities.\n */\n@Injectable()\nexport class DbxFirebaseModelEntitiesWidgetService {\n private _commonComponentClass: Maybe<Type<unknown>>;\n private _debugComponentClass: Maybe<Type<unknown>>;\n\n private readonly _entries = new Map<FirestoreModelIdentity, DbxFirebaseModelEntitiesWidgetEntry>();\n\n private readonly _sortPriorityMap = cachedGetter(() => {\n return new Map<FirestoreModelIdentity, number>(mapIterable(this._entries.values(), (entry) => [entry.identity, entry.sortPriority ?? -1]));\n });\n\n constructor() {\n const initialConfig = inject(DbxFirebaseModelEntitiesWidgetServiceConfig, { optional: true });\n this._commonComponentClass = initialConfig?.commonComponentClass;\n this._debugComponentClass = initialConfig?.debugComponentClass;\n\n if (initialConfig?.entries) {\n this.register(initialConfig.entries);\n }\n }\n\n getCommonComponentClass(): Maybe<Type<unknown>> {\n return this._commonComponentClass;\n }\n\n setCommonComponentClass(componentClass: Maybe<Type<unknown>>): void {\n this._commonComponentClass = componentClass;\n }\n\n getDebugComponentClass(): Maybe<Type<unknown>> {\n return this._debugComponentClass;\n }\n\n setDebugComponentClass(componentClass: Maybe<Type<unknown>>): void {\n this._debugComponentClass = componentClass;\n }\n\n /**\n * Used to register one or more entries.\n *\n * If an entry with the same identity is already registered, this will override it by default.\n *\n * @param entries The entries to register\n * @param override Whether to override existing entries (default: true)\n */\n register(entries: ArrayOrValue<DbxFirebaseModelEntitiesWidgetEntry>, override: boolean = true): void {\n useIterableOrValue(entries, (entry) => {\n if (override || !this._entries.has(entry.identity)) {\n this._entries.set(entry.identity, entry);\n }\n });\n\n // Invalidate the cache\n this._sortPriorityMap.reset();\n }\n\n // MARK: Get\n getAllRegisteredWidgetIdentities(): FirestoreModelIdentity[] {\n return Array.from(this._entries.keys());\n }\n\n getWidgetEntry(identity: FirestoreModelIdentity): DbxFirebaseModelEntitiesWidgetEntry {\n const entry = this._entries.get(identity);\n\n return entry\n ? {\n ...entry,\n commonComponentClass: entry.commonComponentClass ?? this._commonComponentClass,\n debugComponentClass: entry.debugComponentClass ?? this._debugComponentClass\n }\n : {\n identity,\n commonComponentClass: this._commonComponentClass,\n debugComponentClass: this._debugComponentClass\n };\n }\n\n getWidgetEntries(identities: Iterable<FirestoreModelIdentity>): DbxFirebaseModelEntitiesWidgetEntry[] {\n return filterMaybeArrayValues(mapIterable(identities ?? [], (x) => this.getWidgetEntry(x)));\n }\n\n getSortPriorityMap() {\n return this._sortPriorityMap();\n }\n}\n","import { InjectionToken, type Injector, type StaticProvider } from '@angular/core';\nimport { type DbxFirebaseModelEntityWithStore } from './model.entities';\nimport { type DbxFirebaseModelEntitiesWidgetEntry } from './model.entities.widget.service';\nimport { type DbxInjectionComponentConfig } from '@dereekb/dbx-core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Injection token for providing DbxFirebaseModelEntityWithStore context to dynamically loaded widgets.\n */\nexport const DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN = new InjectionToken<DbxFirebaseModelEntityWithStore<any, any>>('DbxFirebaseModelEntityWithStore');\n\n/**\n * Contains the DbxInjectionComponentConfig for the different injected components a DbxFirebaseModelEntity\n */\nexport interface DbxFirebaseModelEntitiesWidgetInjectionConfig {\n readonly entry: DbxFirebaseModelEntitiesWidgetEntry;\n readonly entity: DbxFirebaseModelEntityWithStore;\n readonly entityComponentConfig?: Maybe<DbxInjectionComponentConfig<unknown>>;\n readonly commonComponentConfig?: Maybe<DbxInjectionComponentConfig<unknown>>;\n readonly debugComponentConfig?: Maybe<DbxInjectionComponentConfig<unknown>>;\n}\n\n/**\n * Factory function used to create a DbxFirebaseModelEntitiesWidgetInjectionConfig given the input.\n */\nexport type DbxFirebaseModelEntitiesWidgetInjectionConfigFactory = (entry: DbxFirebaseModelEntitiesWidgetEntry, entity: DbxFirebaseModelEntityWithStore) => DbxFirebaseModelEntitiesWidgetInjectionConfig;\n\n/**\n * Creates a DbxFirebaseModelEntitiesWidgetInjectionConfigFactory.\n *\n * @param injector Optional injector to use for the components.\n * @returns\n */\nexport function dbxFirebaseModelEntityWidgetInjectionConfigFactory(injector?: Maybe<Injector>): DbxFirebaseModelEntitiesWidgetInjectionConfigFactory {\n return (entry: DbxFirebaseModelEntitiesWidgetEntry, entity: DbxFirebaseModelEntityWithStore): DbxFirebaseModelEntitiesWidgetInjectionConfig => {\n const providers: StaticProvider[] = [\n {\n provide: DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN,\n useValue: entity\n }\n ];\n\n let entityComponentConfig: Maybe<DbxInjectionComponentConfig<unknown>> = undefined;\n let commonComponentConfig: Maybe<DbxInjectionComponentConfig<unknown>> = undefined;\n let debugComponentConfig: Maybe<DbxInjectionComponentConfig<unknown>> = undefined;\n\n if (entry.entityComponentClass) {\n entityComponentConfig = {\n componentClass: entry.entityComponentClass,\n injector,\n providers\n };\n }\n\n if (entry.commonComponentClass) {\n commonComponentConfig = {\n componentClass: entry.commonComponentClass,\n providers\n };\n }\n\n if (entry.debugComponentClass) {\n debugComponentConfig = {\n componentClass: entry.debugComponentClass,\n providers\n };\n }\n\n return {\n entry,\n entity,\n entityComponentConfig,\n commonComponentConfig,\n debugComponentConfig\n };\n };\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { DbxFirebaseModelEntity, DbxFirebaseModelEntityWithStore, isDbxFirebaseModelEntityWithStore } from './model.entities';\nimport { cleanLoadingContext, DbxInjectionComponent } from '@dereekb/dbx-core';\nimport { MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle, MatExpansionPanelContent } from '@angular/material/expansion';\nimport { MatIcon } from '@angular/material/icon';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, distinctUntilChanged, map, Observable, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { DbxFirebaseModelEntitiesWidgetService } from './model.entities.widget.service';\nimport { DbxFirebaseModelTypesService, type DbxFirebaseModelDisplayInfo, type DbxFirebaseModelTypeInfo } from '../model.types.service';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxLoadingComponent } from '@dereekb/dbx-web';\nimport { dbxFirebaseModelEntityWidgetInjectionConfigFactory } from './model.entities.widget';\n\n@Component({\n selector: 'dbx-firebase-model-entities-entity',\n templateUrl: './model.entities.entity.component.html',\n imports: [DbxInjectionComponent, DbxLoadingComponent, MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle, MatExpansionPanelContent, MatIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelEntitiesEntityComponent {\n readonly widgetInjectionConfigFactory = dbxFirebaseModelEntityWidgetInjectionConfigFactory();\n\n readonly entitiesWidgetService = inject(DbxFirebaseModelEntitiesWidgetService);\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly entity = input.required<DbxFirebaseModelEntity>();\n\n readonly entity$ = toObservable(this.entity);\n\n readonly currentEntityWithStore$ = this.entity$.pipe(\n map((x) => {\n let result: Maybe<DbxFirebaseModelEntityWithStore>;\n\n if (isDbxFirebaseModelEntityWithStore(x)) {\n result = x;\n } else {\n result = null;\n }\n\n return result;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly modelIdentity$ = this.entity$.pipe(\n map((x) => x.modelIdentity),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly store$ = this.entity$.pipe(\n map((x) => x.store),\n filterMaybe(),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly storeName$ = this.store$.pipe(\n switchMap((x) => x.storeName$),\n shareReplay(1)\n );\n\n readonly displayName$ = combineLatest([this.storeName$, this.entity$]).pipe(\n map(([storeName, entity]) => entity.name ?? storeName),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly loadingState$ = this.store$.pipe(switchMap((x) => x.dataLoadingState$));\n readonly currentData$ = this.store$.pipe(\n switchMap((x) => x.currentData$),\n shareReplay(1)\n );\n\n readonly currentWidgetEntry$ = this.modelIdentity$.pipe(\n map((modelIdentity) => this.entitiesWidgetService.getWidgetEntry(modelIdentity)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentTypeInfo$: Observable<Maybe<DbxFirebaseModelTypeInfo>> = this.modelIdentity$.pipe(\n switchMap((modelIdentity) => this.dbxFirebaseModelTypesService.currentInfoForType(modelIdentity.modelType)),\n shareReplay(1)\n );\n\n readonly hasTypeInfo$ = this.currentTypeInfo$.pipe(\n map((x) => !!x),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly displayInfo$: Observable<DbxFirebaseModelDisplayInfo> = combineLatest([this.modelIdentity$, this.currentTypeInfo$, this.currentData$]).pipe(\n map(([modelIdentity, typeInfo, currentData]) => {\n let result: DbxFirebaseModelDisplayInfo;\n\n if (typeInfo) {\n if (currentData) {\n result = typeInfo.displayInfoFactory(currentData);\n\n if (!result.title) {\n result = { ...result, title: `No Name - <${modelIdentity.modelType}>` };\n }\n } else {\n result = { icon: typeInfo.icon, title: `No Data - <${modelIdentity.modelType}>` };\n }\n } else {\n result = { icon: 'warning', title: `No Type Info - <${modelIdentity.modelType}>` };\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n readonly widgetInjectionConfig$ = combineLatest([this.currentWidgetEntry$, this.currentEntityWithStore$]).pipe(\n map(([entry, entity]) => (entity ? this.widgetInjectionConfigFactory(entry, entity) : null)),\n shareReplay(1)\n );\n\n readonly hasTypeInfoSignal = toSignal(this.hasTypeInfo$);\n readonly displayNameSignal = toSignal(this.displayName$);\n readonly displayInfoSignal = toSignal(this.displayInfo$);\n readonly modelIdentitySignal = toSignal(this.modelIdentity$);\n readonly modelTypeSignal = computed(() => this.modelIdentitySignal()?.modelType);\n\n readonly widgetInjectionConfigSignal = toSignal(this.widgetInjectionConfig$);\n\n readonly entityWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.entityComponentConfig);\n readonly commonWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.commonComponentConfig);\n readonly debugWidgetConfigSignal = computed(() => this.widgetInjectionConfigSignal()?.debugComponentConfig);\n\n readonly loadingContext = cleanLoadingContext({ obs: this.loadingState$ });\n}\n","<mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n @if (displayInfoSignal(); as displayInfo) {\n <div class=\"dbx-list-two-line-item\">\n <div class=\"item-left\">\n <span class=\"dbx-pb2 dbx-flex-bar\">\n @if (displayInfo.icon) {\n <mat-icon class=\"dbx-button-spacer\">{{ displayInfo.icon }}</mat-icon>\n }\n <span>{{ displayInfo.title }}</span>\n </span>\n <span>\n <span class=\"dbx-hint dbx-small\">{{ modelTypeSignal() }}</span>\n @if (displayNameSignal(); as displayName) {\n <span class=\"dbx-small dbx-u dbx-pl2\">{{ displayName }}</span>\n }\n </span>\n </div>\n </div>\n }\n </mat-panel-title>\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"dbx-firebase-model-entities-entity-panel-content\">\n <dbx-loading [context]=\"loadingContext\">\n @if (entityWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-entity-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n @if (commonWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-common-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n @if (debugWidgetConfigSignal(); as config) {\n <div class=\"dbx-pb3 dbx-firebase-model-entities-debug-content\">\n <dbx-injection [config]=\"config\"></dbx-injection>\n </div>\n }\n </dbx-loading>\n </div>\n </ng-template>\n</mat-expansion-panel>\n","import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';\nimport { DbxFirebaseModelEntity, DbxFirebaseModelEntityWithKeyAndStore, DbxFirebaseModelEntityWithStore } from './model.entities';\nimport { MatAccordion } from '@angular/material/expansion';\nimport { DbxIconButtonComponent, DbxListEmptyContentComponent, DbxLoadingComponent } from '@dereekb/dbx-web';\nimport { DbxFirebaseModelEntitiesEntityComponent } from './model.entities.entity.component';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, combineLatestWith, defaultIfEmpty, distinctUntilChanged, map, Observable, shareReplay, switchMap } from 'rxjs';\nimport { filterUniqueValues, Maybe, reverseCompareFn, separateValues, sortByNumberFunction } from '@dereekb/util';\nimport { beginLoading, filterMaybeArray, LoadingState, mapLoadingStateValueWithOperator, switchMapMaybe, valueFromFinishedLoadingState } from '@dereekb/rxjs';\nimport { DbxFirebaseModelEntitiesWidgetService } from './model.entities.widget.service';\nimport { cleanLoadingContext } from '@dereekb/dbx-core';\n\ninterface DbxFirebaseModelEntitiesComponentAllEntities {\n readonly entities: DbxFirebaseModelEntityWithKeyAndStore[];\n readonly registeredEntities: DbxFirebaseModelEntityWithKeyAndStore[];\n readonly unregisteredEntities: DbxFirebaseModelEntityWithKeyAndStore[];\n readonly onlyShowRegisteredTypes?: Maybe<boolean>;\n}\n\n@Component({\n selector: 'dbx-firebase-model-entities',\n template: `\n <dbx-loading [linear]=\"true\" [context]=\"context\">\n <mat-accordion class=\"dbx-firebase-model-entities-accordion\" [multi]=\"multi()\">\n @for (entity of entitiesWithKeysSignal(); track entity.key) {\n <dbx-firebase-model-entities-entity [entity]=\"entity\"></dbx-firebase-model-entities-entity>\n }\n </mat-accordion>\n @if (hasNoEntitiesSignal()) {\n <dbx-list-empty-content>\n <ng-content select=\"[empty]\"></ng-content>\n </dbx-list-empty-content>\n }\n @if (showViewUnregisteredEntitiesButtonSignal()) {\n <div class=\"dbx-pt3 text-center\">\n <dbx-icon-button icon=\"visibility\" [text]=\"'View ' + unregisteredEntitiesCountSignal() + ' Hidden Entities'\" (buttonClick)=\"clickShowUnregisteredEntities()\"></dbx-icon-button>\n </div>\n }\n </dbx-loading>\n `,\n imports: [MatAccordion, DbxLoadingComponent, DbxFirebaseModelEntitiesEntityComponent, DbxListEmptyContentComponent, DbxIconButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelEntitiesComponent {\n readonly entitiesWidgetService = inject(DbxFirebaseModelEntitiesWidgetService);\n\n /**\n * Whether the accordion should allow multiple expanded panels.\n */\n readonly multi = input<boolean>(true);\n\n /**\n * If true, will only show entities that have a registered widget entry.\n *\n * Defaults to true.\n */\n readonly onlyShowRegisteredTypes = input<Maybe<boolean>>(true);\n\n /**\n * If true, will show unregistered entities, even if onlyShowRegisteredTypes is true.\n */\n readonly showUnregisteredTypesSignal = signal<Maybe<boolean>>(undefined);\n\n readonly onlyShowRegisteredTypesSignal = computed(() => {\n const onlyShowRegisteredTypes = this.onlyShowRegisteredTypes();\n const showUnregisteredTypes = this.showUnregisteredTypesSignal();\n\n return !showUnregisteredTypes && onlyShowRegisteredTypes;\n });\n\n readonly onlyShowRegisteredTypes$ = toObservable(this.onlyShowRegisteredTypesSignal).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly entities = input<Observable<LoadingState<DbxFirebaseModelEntity[]>>>();\n readonly entities$: Observable<LoadingState<DbxFirebaseModelEntity[]>> = toObservable(this.entities).pipe(\n switchMapMaybe(),\n map((x) => x ?? beginLoading<DbxFirebaseModelEntity[]>()),\n shareReplay(1)\n );\n\n readonly allEntitiesState$: Observable<LoadingState<DbxFirebaseModelEntitiesComponentAllEntities>> = this.entities$.pipe(\n mapLoadingStateValueWithOperator(\n switchMap((entities) => {\n const sortPriorityMap = this.entitiesWidgetService.getSortPriorityMap();\n const entitiesWithStore = (entities ?? []).filter((x) => Boolean(x.store)) as DbxFirebaseModelEntityWithStore[];\n\n interface DbxFirebaseModelEntityWithKeyAndStoreAndSortPriority extends DbxFirebaseModelEntityWithKeyAndStore {\n readonly sortPriority: number;\n readonly isRegisteredType: boolean;\n }\n\n const entitiesWithKeys: Observable<Maybe<DbxFirebaseModelEntityWithKeyAndStoreAndSortPriority>[]> = combineLatest(\n entitiesWithStore.map((x) => {\n const sortPriorityMapEntry = sortPriorityMap.get(x.modelIdentity);\n const isRegisteredType = sortPriorityMapEntry != null;\n const sortPriority = sortPriorityMapEntry ?? -2;\n\n const obs: Observable<Maybe<DbxFirebaseModelEntityWithKeyAndStoreAndSortPriority>> = x.store.currentKey$.pipe(map((key) => (key ? { key, ...x, sortPriority, isRegisteredType } : null)));\n return obs;\n })\n );\n\n return entitiesWithKeys.pipe(\n filterMaybeArray(),\n defaultIfEmpty([]),\n combineLatestWith(this.onlyShowRegisteredTypes$),\n map(([entities, onlyShowRegisteredTypes]) => {\n const filteredEntities = filterUniqueValues(entities, (x) => x.key).sort(reverseCompareFn(sortByNumberFunction((x) => x.sortPriority)));\n\n const { included: registeredEntities, excluded: unregisteredEntities } = separateValues(filteredEntities, (x) => x.isRegisteredType);\n\n const result: DbxFirebaseModelEntitiesComponentAllEntities = {\n entities: onlyShowRegisteredTypes ? registeredEntities : filteredEntities,\n onlyShowRegisteredTypes,\n registeredEntities,\n unregisteredEntities\n };\n\n return result;\n })\n );\n })\n ),\n shareReplay(1)\n );\n\n readonly allEntities$ = this.allEntitiesState$.pipe(valueFromFinishedLoadingState(), shareReplay(1));\n readonly allEntitiesSignal = toSignal(this.allEntities$, { initialValue: { entities: [], registeredEntities: [], unregisteredEntities: [], onlyShowRegisteredTypes: false } });\n\n readonly entitiesWithKeysSignal = computed(() => this.allEntitiesSignal()?.entities);\n readonly unregisteredEntitiesCountSignal = computed(() => this.allEntitiesSignal()?.unregisteredEntities?.length ?? 0);\n\n readonly showViewUnregisteredEntitiesButtonSignal = computed(() => {\n const { onlyShowRegisteredTypes, unregisteredEntities } = this.allEntitiesSignal() ?? {};\n return onlyShowRegisteredTypes && Boolean(unregisteredEntities?.length);\n });\n\n readonly hasNoEntitiesSignal = computed(() => !this.entitiesWithKeysSignal()?.length);\n\n readonly context = cleanLoadingContext({ obs: this.allEntitiesState$ });\n\n clickShowUnregisteredEntities() {\n this.showUnregisteredTypesSignal.set(true);\n }\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, Injector } from '@angular/core';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { AbstractPopoverDirective, DbxPopoverConfigSizing, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverKey, DbxPopoverScrollContentDirective, DbxPopoverService } from '@dereekb/dbx-web';\nimport { DbxFirebaseModelEntitiesComponent } from './model.entities.component';\nimport { Observable } from 'rxjs';\nimport { LoadingState } from '@dereekb/rxjs';\nimport { DbxFirebaseModelEntity } from './model.entities';\nimport { Maybe } from '@dereekb/util';\n\nexport interface DbxFirebaseModelEntitiesPopoverConfig {\n /**\n * Custom icon\n *\n * Defaults to \"history\"\n */\n readonly icon?: string;\n\n /**\n * Custom header text\n *\n * Defaults to \"Entities\"\n */\n readonly header?: string;\n\n /**\n * Custom empty text when no entities exist.\n */\n readonly emptyText?: string;\n\n /**\n * Origin to add the popover to.\n */\n readonly origin: ElementRef;\n\n /**\n * Observable of entities to display.\n */\n readonly entities$: Observable<LoadingState<DbxFirebaseModelEntity[]>>;\n\n /**\n * Whether or not to only show entities that have a registered widget entry.\n */\n readonly onlyShowRegisteredTypes?: Maybe<boolean>;\n\n /**\n * Additional popover configuration.\n */\n readonly popoverSizingConfig?: Maybe<DbxPopoverConfigSizing>;\n\n /**\n * Injector to use for the popover.\n */\n readonly injector?: Maybe<Injector>;\n}\n\nexport type DbxFirebaseModelEntitiesPopoverConfigWithoutOrigin = Omit<DbxFirebaseModelEntitiesPopoverConfig, 'origin' | 'entities$'>;\n\nexport const DEFAULT_DBX_FIREBASE_MODEL_ENTITIES_COMPONENT_POPOVER_KEY = 'entities';\n\n@Component({\n templateUrl: './model.entities.popover.component.html',\n imports: [DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxFirebaseModelEntitiesComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseModelEntitiesPopoverComponent extends AbstractPopoverDirective<unknown, DbxFirebaseModelEntitiesPopoverConfig> {\n readonly entities$ = this.popover.data?.entities$;\n\n static openPopover(popupService: DbxPopoverService, config: DbxFirebaseModelEntitiesPopoverConfig, popoverKey?: DbxPopoverKey): NgPopoverRef {\n const { origin, header, icon, emptyText, entities$, onlyShowRegisteredTypes, popoverSizingConfig, injector } = config;\n\n return popupService.open({\n height: '600px',\n width: '800px',\n injector: injector ?? undefined,\n isResizable: true,\n ...popoverSizingConfig,\n key: popoverKey ?? DEFAULT_DBX_FIREBASE_MODEL_ENTITIES_COMPONENT_POPOVER_KEY,\n origin,\n componentClass: DbxFirebaseModelEntitiesPopoverComponent,\n data: {\n header,\n icon,\n emptyText,\n entities$,\n onlyShowRegisteredTypes\n }\n });\n }\n\n get config(): DbxFirebaseModelEntitiesPopoverConfig {\n return this.popover.data as DbxFirebaseModelEntitiesPopoverConfig;\n }\n\n readonly icon = this.config.icon ?? 'data_object';\n readonly header = this.config.header ?? 'Entities';\n readonly emptyText = this.config.emptyText ?? 'No entities found in current context.';\n readonly onlyShowRegisteredTypes = this.config.onlyShowRegisteredTypes;\n}\n","<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-model-entities [entities]=\"entities$\" [onlyShowRegisteredTypes]=\"onlyShowRegisteredTypes\">\n <p empty>{{ emptyText }}</p>\n </dbx-firebase-model-entities>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n","import { ChangeDetectionStrategy, Component, computed, ElementRef, inject, input, viewChild } from '@angular/core';\nimport { AbstractPopoverRefDirective, DbxButtonComponent, DbxButtonStyle, DbxPopoverService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseModelEntitiesPopoverComponent, DbxFirebaseModelEntitiesPopoverConfigWithoutOrigin } from './model.entities.popover.component';\nimport { Maybe } from '@dereekb/util';\nimport { DbxFirebaseModelEntitiesSource } from './model.entities';\nimport { DbxButtonDisplay } from '@dereekb/dbx-core';\n\nexport interface DbxFirebaseModelEntitiesPopoverButtonConfig extends DbxFirebaseModelEntitiesPopoverConfigWithoutOrigin {\n /**\n * The display configuration for the button.\n */\n readonly buttonDisplay?: Maybe<DbxButtonDisplay>;\n /**\n * The style configuration for the button.\n */\n readonly buttonStyle?: Maybe<DbxButtonStyle>;\n}\n\n@Component({\n selector: 'dbx-firebase-model-entities-popover-button',\n template: `\n <dbx-button #button (buttonClick)=\"showEntitiesPopover()\" [buttonStyle]=\"buttonStyleSignal()\" [buttonDisplay]=\"buttonDisplaySignal()\"></dbx-button>\n `,\n standalone: true,\n imports: [DbxButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseModelEntitiesPopoverButtonComponent extends AbstractPopoverRefDirective<unknown, unknown> {\n private readonly _dbxPopoverService = inject(DbxPopoverService);\n\n readonly entitiesSource = inject(DbxFirebaseModelEntitiesSource);\n\n readonly buttonElement = viewChild.required<string, ElementRef>('button', { read: ElementRef });\n readonly config = input<DbxFirebaseModelEntitiesPopoverButtonConfig>();\n\n readonly buttonDisplaySignal = computed(() => {\n const config = this.config();\n return config?.buttonDisplay ?? { icon: config?.icon ?? 'data_object' };\n });\n\n readonly buttonStyleSignal = computed(() => this.config()?.buttonStyle);\n\n protected override _makePopoverRef(origin?: Maybe<ElementRef>): NgPopoverRef<unknown, unknown> {\n if (!origin) {\n throw new Error('Missing origin.');\n }\n\n const config = this.config();\n const entities$ = this.entitiesSource.entities$;\n\n return DbxFirebaseModelEntitiesPopoverComponent.openPopover(this._dbxPopoverService, {\n origin,\n ...config,\n entities$\n });\n }\n\n showEntitiesPopover(): void {\n const origin = this.buttonElement();\n this.showPopover(origin);\n }\n}\n","import { type EnvironmentProviders, type Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxFirebaseModelEntitiesWidgetService, DbxFirebaseModelEntitiesWidgetServiceConfig } from './model.entities.widget.service';\n\n/**\n * Factory for DbxFirebaseModelEntitiesWidgetServiceConfig.\n */\nexport type DbxFirebaseModelEntitiesWidgetServiceConfigFactory = (injector: Injector) => DbxFirebaseModelEntitiesWidgetServiceConfig;\n\n/**\n * Configuration for provideDbxFirebaseModelEntitiesWidgetService().\n */\nexport interface ProvideDbxFirebaseModelEntitiesWidgetServiceConfig {\n /**\n * Factory for DbxFirebaseModelEntitiesWidgetServiceConfig.\n */\n readonly dbxFirebaseModelEntitiesWidgetServiceConfigFactory: DbxFirebaseModelEntitiesWidgetServiceConfigFactory;\n}\n\n/**\n * Creates EnvironmentProviders for DbxFirebaseModelEntitiesWidgetService.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseModelEntitiesWidgetService(config: ProvideDbxFirebaseModelEntitiesWidgetServiceConfig): EnvironmentProviders {\n const { dbxFirebaseModelEntitiesWidgetServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseModelEntitiesWidgetServiceConfig,\n useFactory: dbxFirebaseModelEntitiesWidgetServiceConfigFactory\n },\n DbxFirebaseModelEntitiesWidgetService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { FirestoreModelIdentity } from '@dereekb/firebase';\nimport { Configurable, Maybe, separateValues, sortByNumberFunction } from '@dereekb/util';\nimport { combineLatest, distinctUntilChanged, first, map, Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { isSameDate } from '@dereekb/date';\nimport { DbxFirebaseDocumentStore } from './store';\n/**\n * A unique number for a store entry.\n */\nexport type DbxFirebaseDocumentStoreContextStoreEntryNumber = number;\n\n/**\n * A specifiy entry in the store.\n *\n * Used for caching information about a specific store.\n */\nexport interface DbxFirebaseDocumentStoreContextStoreEntry {\n /**\n * The number the entry was assigned when added to the store.\n */\n readonly entryNumber: DbxFirebaseDocumentStoreContextStoreEntryNumber;\n /**\n * The referenced document store.\n */\n readonly store: DbxFirebaseDocumentStore<unknown>;\n\n // Cached Values\n readonly modelIdentity?: Maybe<FirestoreModelIdentity>;\n}\n\nexport interface DbxFirebaseDocumentStoreContextStoreEntryWithIdentity extends Omit<DbxFirebaseDocumentStoreContextStoreEntry, 'modelIdentity'> {\n readonly modelIdentity: FirestoreModelIdentity;\n}\n\nexport interface DbxFirebaseDocumentStoreContextStoreState {\n /**\n * The next entry number to use for a new store.\n */\n readonly nextEntryNumber: DbxFirebaseDocumentStoreContextStoreEntryNumber;\n /**\n * The current number of entries\n */\n readonly currentEntryCount: number;\n /**\n * The map of all current stores.\n *\n * The map uses the store as the key for it's corresponding entry that contains additional information about the store.\n */\n readonly stores: Map<DbxFirebaseDocumentStore<unknown>, DbxFirebaseDocumentStoreContextStoreEntry>;\n /**\n * The last time the stores map was changed.\n */\n readonly lastStoresChangeAt: Date;\n}\n\n@Injectable()\nexport class DbxFirebaseDocumentStoreContextStore extends ComponentStore<DbxFirebaseDocumentStoreContextStoreState> {\n constructor() {\n super({\n nextEntryNumber: 0,\n currentEntryCount: 0,\n stores: new Map(),\n lastStoresChangeAt: new Date()\n });\n }\n\n // MARK: Accessors\n readonly stores$ = this.select((state) => [state.stores, state.currentEntryCount, state.nextEntryNumber] as const, {\n debounce: true, // NOTE: The addStore/removeStore functions use the same map, so we overload the equal function to properly trigger changes to the map.\n equal: (a, b) => a[1] === b[1] && a[2] === b[2] // only considered different if the nextEntryNumber changes\n }).pipe(\n map((x) => x[0]),\n shareReplay(1)\n );\n\n readonly lastStoresChangeAt$ = this.select((state) => state.lastStoresChangeAt).pipe(distinctUntilChanged(isSameDate), shareReplay(1));\n\n readonly entriesGroupedByIdentity$: Observable<DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]> = this.stores$.pipe(\n switchMap((stores) => {\n let entriesObs: Observable<DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]>;\n\n const allEntries = Array.from(stores.values());\n\n const { included: hasIdentity, excluded: noIdentity } = separateValues(allEntries, (x) => x.modelIdentity != null);\n\n if (noIdentity.length > 0) {\n entriesObs = combineLatest(\n noIdentity.map((entryWithoutCachedIdentity) =>\n entryWithoutCachedIdentity.store.modelIdentity$.pipe(\n first(),\n map((z) => {\n // set the model identity on the entry\n (entryWithoutCachedIdentity as Configurable<DbxFirebaseDocumentStoreContextStoreEntryWithIdentity>).modelIdentity = z;\n // return the entry\n return entryWithoutCachedIdentity;\n })\n )\n )\n ).pipe(\n map(() => {\n return allEntries as DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]; // all the entries should have an identity now\n })\n );\n } else {\n entriesObs = of(hasIdentity as DbxFirebaseDocumentStoreContextStoreEntryWithIdentity[]);\n }\n\n return entriesObs;\n }),\n map((x) => {\n // sort in ascending order by entry number\n x.sort(sortByNumberFunction((x) => x.entryNumber));\n\n return x;\n }),\n shareReplay(1)\n );\n\n // MARK: State Changes\n readonly addStore = this.updater(addStore);\n readonly removeStore = this.updater(removeStore);\n}\n\nfunction addStore(state: DbxFirebaseDocumentStoreContextStoreState, store: DbxFirebaseDocumentStore<unknown>) {\n const { stores, nextEntryNumber } = state;\n\n let nextState: DbxFirebaseDocumentStoreContextStoreState;\n\n if (stores.has(store)) {\n nextState = state;\n } else {\n // add the entry\n const entry: Configurable<DbxFirebaseDocumentStoreContextStoreEntry> = {\n store,\n entryNumber: nextEntryNumber\n };\n\n stores.set(store, entry);\n\n // update the last changed date\n nextState = { ...state, currentEntryCount: state.currentEntryCount + 1, lastStoresChangeAt: new Date(), nextEntryNumber: nextEntryNumber + 1 };\n }\n\n return nextState;\n}\n\nfunction removeStore(state: DbxFirebaseDocumentStoreContextStoreState, store: DbxFirebaseDocumentStore<unknown>) {\n const { stores } = state;\n\n let nextState: DbxFirebaseDocumentStoreContextStoreState;\n\n if (!stores.has(store)) {\n nextState = state;\n } else {\n // remove the entry\n stores.delete(store);\n\n // update the last changed date\n nextState = { ...state, currentEntryCount: state.currentEntryCount - 1, lastStoresChangeAt: new Date() };\n }\n\n return nextState;\n}\n","import { Directive } from '@angular/core';\nimport { DbxFirebaseModelEntitiesSource, DbxFirebaseModelEntity } from './model.entities';\nimport { DbxFirebaseDocumentStoreContextStore } from '../../store/store.document.context.store';\nimport { map, Observable } from 'rxjs';\nimport { loadingStateFromObs } from '@dereekb/rxjs';\n\nexport const dbxFirebaseDocumentStoreContextModelEntitiesSourceFactory = (storeContextStore: DbxFirebaseDocumentStoreContextStore): DbxFirebaseModelEntitiesSource => {\n const entities$: Observable<DbxFirebaseModelEntity[]> = storeContextStore.entriesGroupedByIdentity$.pipe(map((entries) => entries.map((entry) => ({ store: entry.store, modelIdentity: entry.modelIdentity }))));\n\n const source: DbxFirebaseModelEntitiesSource = {\n entities$: loadingStateFromObs(entities$)\n };\n\n return source;\n};\n\n@Directive({\n selector: '[dbxFirebaseDocumentStoreContextModelEntitiesSource]',\n providers: [\n {\n provide: DbxFirebaseModelEntitiesSource,\n useFactory: dbxFirebaseDocumentStoreContextModelEntitiesSourceFactory,\n deps: [DbxFirebaseDocumentStoreContextStore]\n }\n ],\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreContextModelEntitiesSourceDirective {}\n","import { Directive, inject } from '@angular/core';\nimport { DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN } from './model.entities.widget';\nimport { DbxFirebaseModelEntityWithStore } from './model.entities';\nimport { type FirestoreDocument } from '@dereekb/firebase';\n\n/**\n * An abstract DbxFirebase widget component that injects the entity data and provides some common accessors.\n */\n@Directive({})\nexport abstract class AbstractDbxFirebaseModelEntityWidgetDirective<T = any, D extends FirestoreDocument<T> = FirestoreDocument<T>> {\n readonly entityData: DbxFirebaseModelEntityWithStore<T, D> = inject(DBX_FIREBASE_MODEL_ENTITY_WITH_STORE_TOKEN);\n\n readonly store = this.entityData.store;\n readonly data$ = this.store.data$;\n}\n","import { Component, inject, input, computed } from '@angular/core';\nimport { FirestoreModelKey, twoWayFlatFirestoreModelKey, flatFirestoreModelKey, firestoreModelId } from '@dereekb/firebase';\nimport { DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceInstance } from './model.types.service';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { switchMap, of } from 'rxjs';\nimport { DbxDetailBlockComponent, DbxClickToCopyTextComponent, DbxAnchorComponent, DbxButtonComponent } from '@dereekb/dbx-web';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * An interactive display for a FirestoreModelKey.\n */\n@Component({\n selector: 'dbx-firebase-model-key',\n templateUrl: './model.key.component.html',\n standalone: true,\n imports: [DbxDetailBlockComponent, DbxButtonComponent, DbxClickToCopyTextComponent, DbxAnchorComponent]\n})\nexport class DbxFirebaseModelKeyComponent {\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly modelKey = input<FirestoreModelKey>();\n\n readonly modelKeyIdSignal = computed(() => {\n const modelKey = this.modelKey();\n return modelKey ? firestoreModelId(modelKey) : undefined;\n });\n\n readonly oneWayFlatModelKeySignal = computed(() => {\n const modelKey = this.modelKey();\n return modelKey ? flatFirestoreModelKey(modelKey) : undefined;\n });\n\n readonly twoWayFlatModelKeySignal = computed(() => {\n const modelKey = this.modelKey();\n return modelKey ? twoWayFlatFirestoreModelKey(modelKey) : undefined;\n });\n\n // Convert signal to observable for types service\n readonly modelKey$ = toObservable(this.modelKey);\n\n readonly modelTypeInstance$ = this.modelKey$.pipe(\n switchMap((key) => {\n let result: Maybe<DbxFirebaseModelTypesServiceInstance> = undefined;\n\n if (key) {\n result = this.dbxFirebaseModelTypesService.instanceForKey(key);\n }\n\n return of(result);\n })\n );\n\n readonly modelIdentity$ = this.modelTypeInstance$.pipe(switchMap((x) => x?.identity$ ?? of(undefined)));\n readonly typeInfo$ = this.modelTypeInstance$.pipe(switchMap((x) => x?.safeTypeInfo$ ?? of(undefined)));\n\n readonly modelTypeInstanceSignal = toSignal(this.modelTypeInstance$);\n readonly modelIdentitySignal = toSignal(this.modelIdentity$);\n readonly typeInfoSignal = toSignal(this.typeInfo$);\n\n readonly typeCanSegueToView = computed(() => this.typeInfoSignal()?.canSegueToView ?? false);\n\n readonly sref$ = this.modelTypeInstance$.pipe(switchMap((x) => x?.segueRef$ ?? of(undefined)));\n readonly srefSignal = toSignal(this.sref$);\n}\n","<div class=\"dbx-firebase-model-key\">\n @if (modelKey(); as key) {\n <!-- Key Data -->\n <dbx-detail-block icon=\"key\" header=\"Model Key\">\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ key }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ modelKeyIdSignal() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"oneWayFlatModelKeySignal()\">(Flat) {{ oneWayFlatModelKeySignal() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"twoWayFlatModelKeySignal()\">(Encoded Flat) {{ twoWayFlatModelKeySignal() }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n\n <!-- Type Info -->\n @if (typeInfoSignal(); as typeInfo) {\n <!-- Model Meta Data -->\n <div>\n <dbx-detail-block [icon]=\"typeInfo.icon\" header=\"Model Type\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.modelType }}</dbx-click-to-copy-text>\n @if (typeInfo.icon) {\n <dbx-click-to-copy-text [copyText]=\"typeInfo.icon\" class=\"dbx-block\">\n Icon:\n <span class=\"dbx-u\">{{ typeInfo.icon }}</span>\n </dbx-click-to-copy-text>\n } @else {\n <span class=\"dbx-notice\">No Icon For Type</span>\n }\n </dbx-detail-block>\n <dbx-detail-block icon=\"dataset\" header=\"Collection Name\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.identity.collectionName }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n </div>\n\n <!-- Segue Info -->\n @if (typeCanSegueToView()) {\n <dbx-detail-block icon=\"arrow_forward\" header=\"Segue To View\">\n <div class=\"dbx-hint dbx-small\">This model has a unique view within the app.</div>\n <dbx-anchor [anchor]=\"srefSignal()\"><dbx-button text=\"Go To View\"></dbx-button></dbx-anchor>\n </dbx-detail-block>\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Segue View\">\n <span>This type provides no information for segue directly.</span>\n </dbx-detail-block>\n }\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Type Info\">\n <span>There is no type info registered for this model type.</span>\n </dbx-detail-block>\n }\n } @else {\n <div class=\"dbx-firebase-model-key-empty\">No model key provided</div>\n }\n</div>\n","import { Component, computed, Signal } from '@angular/core';\nimport { AbstractDbxFirebaseModelEntityWidgetDirective } from './model.entities.widget.entity.abstract.directive';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { DbxFirebaseModelKeyComponent } from '../model.key.component';\nimport { DbxDownloadTextViewComponent, DbxLoadingComponent, DownloadTextContent } from '@dereekb/dbx-web';\nimport { Maybe } from '@dereekb/util';\nimport { twoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { cleanLoadingContext } from '@dereekb/dbx-core';\n\n/**\n * A debug widget component that displays entity data and metadata.\n */\n@Component({\n selector: 'dbx-firebase-model-entities-debug-widget',\n templateUrl: './model.entities.widget.entity.debug.component.html',\n standalone: true,\n imports: [DbxFirebaseModelKeyComponent, DbxDownloadTextViewComponent, DbxLoadingComponent]\n})\nexport class DbxFirebaseModelEntitiesDebugWidgetComponent extends AbstractDbxFirebaseModelEntityWidgetDirective {\n // Convert store observables to signals for template usage\n readonly currentKey = toSignal(this.store.currentKey$);\n readonly currentData = toSignal(this.data$);\n\n readonly contentSignal: Signal<Maybe<DownloadTextContent>> = computed(() => {\n const key = this.currentKey();\n const data = this.currentData();\n\n let content: Maybe<DownloadTextContent>;\n\n if (key && data) {\n const flattenKey = twoWayFlatFirestoreModelKey(key);\n\n content = {\n content: JSON.stringify(data, null, 2),\n name: `${flattenKey}.json`\n };\n }\n\n return content;\n });\n\n readonly context = cleanLoadingContext(this.store.dataLoadingState$);\n}\n","<div class=\"dbx-firebase-model-entities-debug-widget\">\n <!-- Model Key Section -->\n <div class=\"dbx-debug-section\">\n <h4>Model Key Information</h4>\n @if (currentKey(); as key) {\n <dbx-firebase-model-key [modelKey]=\"key\"></dbx-firebase-model-key>\n }\n </div>\n\n <!-- Document Data Section -->\n <div class=\"dbx-debug-section\">\n <h4>Document Data</h4>\n <dbx-loading [context]=\"context\">\n @if (currentData(); as data) {\n <dbx-download-text-view [showTitle]=\"false\" [content]=\"contentSignal()\"></dbx-download-text-view>\n } @else {\n <p class=\"dbx-empty\">No data available</p>\n }\n </dbx-loading>\n </div>\n</div>\n","import { Directive, forwardRef, model, Provider, Type } from '@angular/core';\nimport { DocumentReference, FirestoreAccessorStreamMode, FirestoreDocument, FirestoreModelKey, FirestoreModelId, TwoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { ModelKey, type Maybe } from '@dereekb/util';\nimport { DbxFirebaseDocumentStore } from './store';\nimport { BehaviorSubject, Observable, shareReplay, Subscription, switchMap } from 'rxjs';\nimport { filterMaybe, skipInitialMaybe } from '@dereekb/rxjs';\nimport { cleanSubscription, completeOnDestroy, DbxRouteModelIdDirectiveDelegate, DbxRouteModelKeyDirectiveDelegate, provideDbxRouteModelIdDirectiveDelegate, provideDbxRouteModelKeyDirectiveDelegate } from '@dereekb/dbx-core';\nimport { DbxFirebaseDocumentStoreTwoWayKeyProvider } from './store.document.twoway.key.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract directive that contains a DbxFirebaseDocumentStore and provides an interface for communicating with other directives.\n */\n@Directive()\nexport abstract class DbxFirebaseDocumentStoreDirective<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, S extends DbxFirebaseDocumentStore<T, D> = DbxFirebaseDocumentStore<T, D>> implements DbxFirebaseDocumentStoreTwoWayKeyProvider, DbxRouteModelIdDirectiveDelegate, DbxRouteModelKeyDirectiveDelegate {\n readonly storeName = model<Maybe<string>>(undefined);\n readonly documentId = model<Maybe<FirestoreModelId>>(undefined);\n readonly key = model<Maybe<FirestoreModelKey>>(undefined);\n readonly flatKey = model<Maybe<TwoWayFlatFirestoreModelKey>>(undefined);\n readonly ref = model<Maybe<DocumentReference<T>>>(undefined);\n readonly streamMode = model<FirestoreAccessorStreamMode>(FirestoreAccessorStreamMode.STREAM);\n\n private readonly _storeName$ = toObservable(this.storeName).pipe(skipInitialMaybe());\n private readonly _documentId$ = toObservable(this.documentId).pipe(skipInitialMaybe());\n private readonly _key$ = toObservable(this.key).pipe(skipInitialMaybe());\n private readonly _flatKey$ = toObservable(this.flatKey).pipe(skipInitialMaybe());\n private readonly _ref$ = toObservable(this.ref).pipe(skipInitialMaybe());\n private readonly _streamMode$ = toObservable(this.streamMode).pipe(skipInitialMaybe());\n\n private readonly _store = completeOnDestroy(new BehaviorSubject<Maybe<S>>(undefined));\n\n readonly store$ = this._store.pipe(filterMaybe(), shareReplay(1));\n\n readonly exists$ = this.store$.pipe(switchMap((x) => x.exists$));\n readonly document$ = this.store$.pipe(switchMap((x) => x.document$));\n readonly documentLoadingState$ = this.store$.pipe(switchMap((x) => x.documentLoadingState$));\n\n readonly id$ = this.store$.pipe(switchMap((x) => x.id$));\n readonly key$ = this.store$.pipe(switchMap((x) => x.key$));\n readonly twoWayFlatKey$ = this.store$.pipe(switchMap((x) => x.twoWayFlatKey$));\n readonly ref$ = this.store$.pipe(switchMap((x) => x.ref$));\n\n readonly snapshot$ = this.store$.pipe(switchMap((x) => x.snapshot$));\n readonly snapshotLoadingState$ = this.store$.pipe(switchMap((x) => x.snapshotLoadingState$));\n\n readonly modelIdentity$ = this.store$.pipe(switchMap((x) => x.modelIdentity$));\n readonly data$ = this.store$.pipe(switchMap((x) => x.data$));\n readonly loadingState$ = this.store$.pipe(switchMap((x) => x.dataLoadingState$));\n\n constructor(store: S) {\n this.replaceStore(store);\n\n // sync inputs to store any time the store changes\n cleanSubscription(\n this._store.subscribe((x) => {\n if (x) {\n x.setStoreName(this._storeName$);\n x.setId(this._documentId$);\n x.setKey(this._key$);\n x.setFlatKey(this._flatKey$);\n x.setRef(this._ref$);\n x.setStreamMode(this._streamMode$);\n }\n })\n );\n }\n\n get store() {\n return this._store.value as S;\n }\n\n // MARK: Setters\n setStoreName(storeName: Maybe<string>) {\n this.storeName.set(storeName);\n }\n\n setDocumentId(documentId: Maybe<FirestoreModelId>) {\n this.documentId.set(documentId);\n }\n\n setKey(key: Maybe<FirestoreModelKey>) {\n this.key.set(key);\n }\n\n setFlatKey(flatKey: Maybe<TwoWayFlatFirestoreModelKey>) {\n this.flatKey.set(flatKey);\n }\n\n setRef(ref: Maybe<DocumentReference<T>>) {\n this.ref.set(ref);\n }\n\n setStreamMode(streamMode: FirestoreAccessorStreamMode) {\n this.streamMode.set(streamMode);\n }\n\n /**\n * Replaces the internal store.\n */\n replaceStore(store: S) {\n this._store.next(store);\n }\n\n // MARK: DbxRouteModelIdDirectiveDelegate\n useRouteModelIdParamsObservable(idFromParams: Observable<Maybe<ModelKey>>): Subscription {\n return idFromParams.subscribe((x) => this.setDocumentId(x));\n }\n\n // MARK: DbxRouteModelKeyDirectiveDelegate\n useRouteModelKeyParamsObservable(keyFromParams: Observable<Maybe<TwoWayFlatFirestoreModelKey>>): Subscription {\n // we assume that the input model key is a TwoWayFlatFirestoreModelKey, since the TwoWayFlatFirestoreModelKey is safe to encode in the url\n return keyFromParams.subscribe((x) => this.setFlatKey(x));\n }\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// The use of any here does not degrade the type-safety; we want to simply match that the Store type S is used in the Directive type C to provide it.\n\n/**\n * Configures providers for a DbxFirebaseDocumentStoreDirective.\n *\n * Can optionally also provide the actual store type to include in the providers array so it is instantiated by Angular.\n *\n * @param sourceType\n */\nexport function provideDbxFirebaseDocumentStoreDirective<S extends DbxFirebaseDocumentStoreDirective<any, any, any>>(sourceType: Type<S>): Provider[];\nexport function provideDbxFirebaseDocumentStoreDirective<S extends DbxFirebaseDocumentStore<any, any>, C extends DbxFirebaseDocumentStoreDirective<any, any, S> = DbxFirebaseDocumentStoreDirective<any, any, S>>(sourceType: Type<C>, storeType: Type<S>): Provider[];\nexport function provideDbxFirebaseDocumentStoreDirective<S extends DbxFirebaseDocumentStore<any, any>, C extends DbxFirebaseDocumentStoreDirective<any, any, S> = DbxFirebaseDocumentStoreDirective<any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxFirebaseDocumentStoreDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideDbxRouteModelIdDirectiveDelegate(sourceType),\n ...provideDbxRouteModelKeyDirectiveDelegate(sourceType)\n ];\n\n if (storeType != null) {\n providers.push(storeType);\n }\n\n return providers;\n}\n","import { distinctUntilModelKeyChange } from '@dereekb/rxjs';\nimport { DbxModelObjectStateService, ModelViewContext } from '@dereekb/dbx-web';\nimport { Directive, inject, input } from '@angular/core';\nimport { cleanSubscription } from '@dereekb/dbx-core';\nimport { combineLatestWith, first, map, switchMap } from 'rxjs';\nimport { DbxFirebaseDocumentStoreDirective } from '../store/store.document.directive';\nimport { DbxFirebaseModelTypesService } from './model.types.service';\nimport { Maybe, ModelKeyTypeNamePair } from '@dereekb/util';\n\n/**\n * Used with a DbxFirebaseDocumentStoreDirective to emit model viewed events.\n */\n@Directive({\n selector: '[dbxFirebaseModelViewedEvent]',\n standalone: true\n})\nexport class DbxFirebaseModelViewedEventDirective {\n readonly dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective);\n readonly dbxModelObjectStateService = inject(DbxModelObjectStateService);\n readonly dbxFirebaseModelTypesService = inject(DbxFirebaseModelTypesService);\n\n readonly modelViewContext = input<Maybe<ModelViewContext>>(undefined, { alias: 'dbxFirebaseModelViewedEvent' });\n\n constructor() {\n cleanSubscription(\n this.dbxFirebaseDocumentStoreDirective.data$\n .pipe(\n //\n distinctUntilModelKeyChange(),\n combineLatestWith(\n this.dbxFirebaseDocumentStoreDirective.modelIdentity$.pipe(\n switchMap((x) => this.dbxFirebaseModelTypesService.infoForType(x.modelType)),\n first()\n ),\n this.dbxFirebaseDocumentStoreDirective.key$\n ),\n map(([data, typeInfo, key]) => {\n const displayInfo = this.dbxFirebaseModelTypesService.getDisplayInfo(typeInfo, data);\n\n const pair: ModelKeyTypeNamePair = {\n key,\n type: typeInfo.modelType,\n name: displayInfo.title\n };\n\n return pair;\n })\n )\n .subscribe((modelKeyTypeNamePair) => {\n const context = this.modelViewContext();\n this.dbxModelObjectStateService.emitModelViewEvent({ modelKeyTypeNamePair, context });\n })\n );\n }\n}\n","import { Directive, forwardRef, model, Provider, Type } from '@angular/core';\nimport { DocumentReference, FirestoreDocument, FirestoreModelKey, FirestoreQueryConstraint } from '@dereekb/firebase';\nimport { Maybe, ArrayOrValue } from '@dereekb/util';\nimport { DbxFirebaseCollectionStore } from './store.collection';\nimport { BehaviorSubject, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe, skipInitialMaybe } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscription, completeOnDestroy } from '@dereekb/dbx-core';\nimport { DbxFirebaseCollectionMode } from '../../loader/collection.loader.instance';\n\n/**\n * Abstract directive that contains a DbxFirebaseCollectionStore and provides an interface for communicating with other directives.\n */\n@Directive()\nexport abstract class DbxFirebaseCollectionStoreDirective<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, S extends DbxFirebaseCollectionStore<T, D> = DbxFirebaseCollectionStore<T, D>> {\n readonly collectionMode = model<DbxFirebaseCollectionMode>('query');\n readonly collectionKeys = model<Maybe<FirestoreModelKey[]>>(undefined);\n readonly collectionRefs = model<Maybe<DocumentReference<T>[]>>(undefined);\n readonly maxPages = model<Maybe<number>>(undefined);\n readonly itemsPerPage = model<Maybe<number>>(undefined);\n readonly constraints = model<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>(undefined);\n readonly waitForNonNullConstraints = model<Maybe<boolean>>(undefined);\n\n private readonly _collectionMode = toObservable(this.collectionMode).pipe(skipInitialMaybe());\n private readonly _collectionKeys = toObservable(this.collectionKeys).pipe(skipInitialMaybe());\n private readonly _collectionRefs = toObservable(this.collectionRefs).pipe(skipInitialMaybe());\n private readonly _maxPages = toObservable(this.maxPages).pipe(skipInitialMaybe());\n private readonly _itemsPerPage = toObservable(this.itemsPerPage).pipe(skipInitialMaybe());\n private readonly _constraints = toObservable(this.constraints).pipe(skipInitialMaybe());\n private readonly _waitForNonNullConstraints = toObservable(this.waitForNonNullConstraints).pipe(skipInitialMaybe());\n\n private readonly _store = completeOnDestroy(new BehaviorSubject<Maybe<S>>(undefined));\n\n readonly store$ = this._store.pipe(filterMaybe(), shareReplay(1));\n readonly pageLoadingState$ = this.store$.pipe(switchMap((x) => x.pageLoadingState$));\n\n constructor(store: S) {\n this.replaceStore(store);\n\n // sync inputs to store any time the store changes\n cleanSubscription(\n this.store$.subscribe((x) => {\n x.setCollectionMode(this._collectionMode);\n x.setCollectionKeys(this._collectionKeys);\n x.setCollectionRefs(this._collectionRefs);\n x.setConstraints(this._constraints);\n x.setMaxPages(this._maxPages);\n x.setItemsPerPage(this._itemsPerPage);\n x.setWaitForNonNullConstraints(this._waitForNonNullConstraints);\n })\n );\n }\n\n get store() {\n return this._store.value as S;\n }\n\n /**\n * Replaces the internal store.\n */\n replaceStore(store: S) {\n this._store.next(store);\n }\n\n setCollectionMode(collectionMode: DbxFirebaseCollectionMode) {\n this.collectionMode.set(collectionMode);\n }\n\n setCollectionKeys(collectionKeys: Maybe<FirestoreModelKey[]>) {\n this.collectionKeys.set(collectionKeys);\n }\n\n setCollectionRefs(collectionRefs: Maybe<DocumentReference<T>[]>) {\n this.collectionRefs.set(collectionRefs);\n }\n\n setMaxPages(maxPages: Maybe<number>) {\n this.maxPages.set(maxPages);\n }\n\n setItemsPerPage(itemsPerPage: Maybe<number>) {\n this.itemsPerPage.set(itemsPerPage);\n }\n\n setConstraints(constraints: Maybe<ArrayOrValue<FirestoreQueryConstraint>>) {\n this.constraints.set(constraints);\n }\n\n setWaitForNonNullConstraints(waitForNonNullConstraints: Maybe<boolean>) {\n this.waitForNonNullConstraints.set(waitForNonNullConstraints);\n }\n\n next() {\n this.store.next();\n }\n\n restart() {\n this.store.restart();\n }\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// The use of any here does not degrade the type-safety; we want to simply match that the Store type S is used in the Directive type C to provide it.\n\n/**\n * Configures providers for a DbxFirebaseCollectionStoreDirective.\n *\n * Can optionally also provide the actual store type to include in the providers array so it is instantiated by Angular.\n *\n * @param sourceType\n */\nexport function provideDbxFirebaseCollectionStoreDirective<S extends DbxFirebaseCollectionStoreDirective<any, any, any>>(sourceType: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionStoreDirective<S extends DbxFirebaseCollectionStore<any, any>, C extends DbxFirebaseCollectionStoreDirective<any, any, S> = DbxFirebaseCollectionStoreDirective<any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionStoreDirective<S extends DbxFirebaseCollectionStore<any, any>, C extends DbxFirebaseCollectionStoreDirective<any, any, S> = DbxFirebaseCollectionStoreDirective<any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxFirebaseCollectionStoreDirective,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n if (storeType) {\n providers.push(storeType);\n }\n\n return providers;\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { FirestoreDocument } from '@dereekb/firebase';\nimport { DbxFirebaseCollectionStore } from './store.collection';\nimport { DbxFirebaseCollectionStoreDirective } from './store.collection.directive';\nimport { DbxFirebaseCollectionChangeWatcher, dbxFirebaseCollectionChangeWatcher, DbxFirebaseCollectionChangeWatcherEvent, DbxFirebaseCollectionChangeWatcherTriggerMode } from '../../loader/collection.change.watcher';\nimport { Observable } from 'rxjs';\nimport { dbxFirebaseCollectionChangeTriggerForWatcher } from '../../loader/collection.change.trigger';\nimport { clean } from '@dereekb/dbx-core';\n\n/**\n * Used to watch query doc changes and respond to them accordingly.\n */\n@Directive({\n selector: '[dbxFirebaseCollectionChange]',\n standalone: true\n})\nexport class DbxFirebaseCollectionChangeDirective<T = unknown, D extends FirestoreDocument<T> = FirestoreDocument<T>, S extends DbxFirebaseCollectionStore<T, D> = DbxFirebaseCollectionStore<T, D>> implements DbxFirebaseCollectionChangeWatcher<S> {\n readonly dbxFirebaseCollectionStoreDirective = inject(DbxFirebaseCollectionStoreDirective<T, D, S>);\n readonly mode = input<DbxFirebaseCollectionChangeWatcherTriggerMode, DbxFirebaseCollectionChangeWatcherTriggerMode | ''>('off', { alias: 'dbxFirebaseCollectionChange', transform: (x) => x || 'off' });\n\n private readonly _watcher = clean(dbxFirebaseCollectionChangeWatcher(this.dbxFirebaseCollectionStoreDirective.store));\n private readonly _trigger = clean(dbxFirebaseCollectionChangeTriggerForWatcher(this._watcher, () => this.restart()));\n\n readonly mode$: Observable<DbxFirebaseCollectionChangeWatcherTriggerMode> = this._watcher.mode$;\n readonly event$: Observable<DbxFirebaseCollectionChangeWatcherEvent> = this._watcher.event$;\n readonly hasChangeAvailable$: Observable<boolean> = this._watcher.hasChangeAvailable$;\n readonly triggered$: Observable<boolean> = this._watcher.triggered$;\n readonly trigger$: Observable<void> = this._watcher.trigger$;\n\n protected readonly modeEffect = effect(() => {\n this._watcher.setMode(this.mode());\n });\n\n get store() {\n return this._watcher.store;\n }\n\n constructor() {\n this._trigger.init();\n }\n\n restart() {\n this.dbxFirebaseCollectionStoreDirective.store.restart();\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { AbstractIfDirective } from '@dereekb/dbx-core';\nimport { shareReplay, combineLatest, Observable, map } from 'rxjs';\nimport { DbxFirebaseCollectionChangeDirective } from './store.collection.change.directive';\nimport { IterationQueryDocChangeWatcherChangeType } from '@dereekb/firebase';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nexport type DbxFirebaseCollectionHasChangeDirectiveMode = 'all' | IterationQueryDocChangeWatcherChangeType;\n\n/**\n * Structural directive that displays the content when the target change is detected.\n *\n * Can specify which changes to appear on.\n */\n@Directive({\n selector: '[dbxFirebaseCollectionHasChange]',\n standalone: true\n})\nexport class DbxFirebaseCollectionHasChangeDirective extends AbstractIfDirective {\n readonly directive = inject(DbxFirebaseCollectionChangeDirective);\n readonly mode = input<DbxFirebaseCollectionHasChangeDirectiveMode, DbxFirebaseCollectionHasChangeDirectiveMode | ''>('addedAndRemoved', { alias: 'dbxFirebaseCollectionHasChange', transform: (x) => x || 'addedAndRemoved' });\n\n readonly show$: Observable<boolean> = combineLatest([toObservable(this.mode), this.directive.event$]).pipe(\n map(([mode, event]) => {\n let show = false;\n\n if (event.type !== 'none') {\n switch (mode) {\n case 'all':\n show = true;\n break;\n case 'addedAndRemoved':\n show = event.type === 'addedAndRemoved' || event.type === 'added' || event.type === 'removed';\n break;\n default:\n show = event.type === mode;\n break;\n }\n }\n\n return show;\n }),\n shareReplay(1)\n );\n}\n","import { cleanSubscription } from '@dereekb/dbx-core';\nimport { DbxListViewWrapper } from '@dereekb/dbx-web';\nimport { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective } from './store.collection.directive';\n\n/**\n * Directive that connects a host DbxListView to a DbxFirebaseCollectionStoreDirective to pass data for rendering items from a collection and query parameters.\n */\n@Directive({\n selector: '[dbxFirebaseCollectionList]',\n standalone: true\n})\nexport class DbxFirebaseCollectionListDirective<T> {\n readonly dbxFirebaseCollectionStoreDirective = inject(DbxFirebaseCollectionStoreDirective<T>);\n readonly dbxListViewWrapper = inject(DbxListViewWrapper<T>, { host: true });\n\n constructor() {\n this.dbxListViewWrapper.setState(this.dbxFirebaseCollectionStoreDirective.pageLoadingState$);\n\n if (this.dbxListViewWrapper.loadMore) {\n cleanSubscription(\n this.dbxListViewWrapper.loadMore.subscribe(() => {\n this.dbxFirebaseCollectionStoreDirective.next();\n })\n );\n }\n }\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type TwoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { type Observable } from 'rxjs';\n\nexport abstract class DbxFirebaseDocumentStoreTwoWayKeyProvider {\n abstract readonly twoWayFlatKey$: Observable<TwoWayFlatFirestoreModelKey>;\n}\n\n/**\n * Configures Providers for a DbxFirebaseDocumentStoreTwoWayKeyProvider.\n */\nexport function provideDbxFirebaseDocumentStoreTwoWayKeyProvider<S extends DbxFirebaseDocumentStoreTwoWayKeyProvider>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxFirebaseDocumentStoreTwoWayKeyProvider,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Observable } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective } from './store.document.directive';\nimport { DbxFirebaseDocumentStoreTwoWayKeyProvider, provideDbxFirebaseDocumentStoreTwoWayKeyProvider } from './store.document.twoway.key.source';\n\n/**\n * Directive that implements DbxFirebaseDocumentStoreTwoWayKeyProvider and passes the twoWayFlatKey from a host DbxFirebaseDocumentStoreDirective.\n */\n@Directive({\n selector: '[dbxFirebaseDocumentStoreTwoWayModelKeySource]',\n providers: provideDbxFirebaseDocumentStoreTwoWayKeyProvider(DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective),\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective implements DbxFirebaseDocumentStoreTwoWayKeyProvider {\n readonly dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective, { host: true });\n readonly twoWayFlatKey$: Observable<string> = this.dbxFirebaseDocumentStoreDirective.twoWayFlatKey$;\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective } from './store.document.directive';\nimport { DbxFirebaseDocumentStoreTwoWayKeyProvider } from './store.document.twoway.key.source';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Used for providing an id from the twoWayFlatKey$ from a DbxFirebaseDocumentStoreTwoWayKeyProvider.\n */\n@Directive({\n selector: '[dbxFirebaseDocumentStoreIdFromTwoWayModelKey]',\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective {\n readonly dbxFirebaseDocumentStoreDirective = inject(DbxFirebaseDocumentStoreDirective, { host: true });\n readonly dbxFirebaseDocumentStoreTwoWayKeyProvider = inject(DbxFirebaseDocumentStoreTwoWayKeyProvider, { skipSelf: true, host: false });\n\n constructor() {\n cleanSubscription(this.dbxFirebaseDocumentStoreDirective.store.setId(this.dbxFirebaseDocumentStoreTwoWayKeyProvider.twoWayFlatKey$));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseCollectionChangeDirective } from './store.collection.change.directive';\nimport { DbxFirebaseCollectionHasChangeDirective } from './store.collection.change.if.directive';\nimport { DbxFirebaseCollectionListDirective } from './store.collection.list.directive';\nimport { DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective } from './store.document.twoway.key.source.directive';\nimport { DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective } from './store.document.twoway.key.directive';\n\nconst importsAndExports = [DbxFirebaseCollectionListDirective, DbxFirebaseCollectionChangeDirective, DbxFirebaseCollectionHasChangeDirective, DbxFirebaseDocumentStoreTwoWayModelKeySourceDirective, DbxFirebaseDocumentStoreIdFromTwoWayModelKeyDirective];\n\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxFirebaseModelStoreModule {}\n","import { Injectable } from '@angular/core';\nimport { Observable, shareReplay, distinctUntilChanged, Subscription, first, map, switchMap, tap } from 'rxjs';\nimport { FirebaseQueryItemAccumulator, FirestoreCollectionLike, FirestoreDocument, FirestoreItemPageIterationInstance, FirestoreQueryConstraint, IterationQueryDocChangeWatcher, DocumentDataWithIdAndKey, DocumentReference, FirebaseQuerySnapshotAccumulator, FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction, FirestoreModelKey } from '@dereekb/firebase';\nimport { ObservableOrValue, cleanupDestroyable, PageListLoadingState, filterMaybe, ItemAccumulatorNextPageUntilResultsCountResult } from '@dereekb/rxjs';\nimport { ArrayOrValue, Maybe, PageNumber } from '@dereekb/util';\nimport { LockSetComponentStore } from '@dereekb/dbx-core';\nimport { DbxFirebaseCollectionLoaderInstance, dbxFirebaseCollectionLoaderInstance, DbxFirebaseCollectionLoaderInstanceData, DbxFirebaseCollectionLoaderInstanceInitConfig, DbxFirebaseCollectionMode } from '../../loader/collection.loader.instance';\nimport { DbxFirebaseCollectionLoaderAccessorWithAccumulator } from '../../loader/collection.loader';\n\nexport interface DbxFirebaseCollectionStore<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends DbxFirebaseCollectionLoaderAccessorWithAccumulator<T>, DbxFirebaseCollectionLoaderInstanceData<T, D> {\n /**\n * The current collection that documents are loaded from.\n */\n readonly firestoreCollection$: Observable<Maybe<FirestoreCollectionLike<T, D>>>;\n /**\n * The current store mode.\n */\n readonly collectionMode$: Observable<DbxFirebaseCollectionMode>;\n /**\n * The loader instance.\n */\n readonly loader$: Observable<DbxFirebaseCollectionLoaderInstance<T, D>>;\n /**\n * Whether or not the iterator has more pages to load.\n */\n readonly hasNext$: Observable<boolean>;\n /**\n * Whether or not the iterator can load more pages.\n */\n readonly canLoadMore$: Observable<boolean>;\n /**\n * Whether or not the iterator has more pages to load and can load more pages.\n */\n readonly hasNextAndCanLoadMore$: Observable<boolean>;\n /**\n * Returns true if the collection has documents.\n */\n readonly hasDocuments$: Observable<boolean>;\n /**\n * Returns all document references loaded by the accumulator.\n */\n readonly allDocumentRefs$: Observable<DocumentReference<T>[]>;\n /**\n * Returns all documents loaded by the accomulator.\n */\n readonly allDocuments$: Observable<D[]>;\n /**\n * Returns all documents data loaded by the accumulator.\n */\n readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]>;\n\n setCollectionMode(observableOrValue: ObservableOrValue<DbxFirebaseCollectionMode>): Subscription;\n\n // References Mode\n setCollectionKeys(observableOrValue: ObservableOrValue<Maybe<FirestoreModelKey[]>>): Subscription;\n setCollectionRefs(observableOrValue: ObservableOrValue<Maybe<DocumentReference<T>[]>>): Subscription;\n\n // Query Mode\n setMaxPages(observableOrValue: ObservableOrValue<Maybe<number>>): Subscription;\n setItemsPerPage(observableOrValue: ObservableOrValue<Maybe<number>>): Subscription;\n setConstraints(observableOrValue: ObservableOrValue<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>): Subscription;\n setWaitForNonNullConstraints(observableOrValue: ObservableOrValue<Maybe<boolean>>): Subscription;\n next(observableOrValue: ObservableOrValue<void>): void;\n restart(observableOrValue: ObservableOrValue<void>): void;\n\n readonly setFirestoreCollection: (() => void) | ((observableOrValue: ObservableOrValue<Maybe<FirestoreCollectionLike<T, D>>>) => Subscription);\n}\n\nexport interface DbxFirebaseCollectionStoreContextState<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> extends Omit<DbxFirebaseCollectionLoaderInstanceInitConfig<T, D>, 'collection'> {\n readonly firestoreCollection?: Maybe<FirestoreCollectionLike<T, D>>;\n}\n\n@Injectable()\nexport class AbstractDbxFirebaseCollectionStore<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseCollectionStoreContextState<T, D> = DbxFirebaseCollectionStoreContextState<T, D>> extends LockSetComponentStore<C> implements DbxFirebaseCollectionStore<T, D> {\n // MARK: Effects\n readonly setCollectionMode = this.effect((input: Observable<DbxFirebaseCollectionMode>) => {\n return input.pipe(switchMap((mode) => this.loader$.pipe(tap((x) => x.setCollectionMode(mode)))));\n });\n\n readonly setCollectionKeys = this.effect((input: Observable<Maybe<FirestoreModelKey[]>>) => {\n return input.pipe(switchMap((keys) => this.loader$.pipe(tap((x) => x.setCollectionKeys(keys)))));\n });\n\n readonly setCollectionRefs = this.effect((input: Observable<Maybe<DocumentReference<T>[]>>) => {\n return input.pipe(switchMap((refs) => this.loader$.pipe(tap((x) => x.setCollectionRefs(refs)))));\n });\n\n readonly setMaxPages = this.effect((input: Observable<Maybe<number>>) => {\n return input.pipe(switchMap((maxPages) => this.loader$.pipe(tap((x) => x.setMaxPages(maxPages)))));\n });\n\n readonly setItemsPerPage = this.effect((input: Observable<Maybe<number>>) => {\n return input.pipe(switchMap((itemsPerPage) => this.loader$.pipe(tap((x) => x.setItemsPerPage(itemsPerPage)))));\n });\n\n readonly setConstraints = this.effect((input: Observable<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>) => {\n return input.pipe(switchMap((constraints) => this.loader$.pipe(tap((x) => x.setConstraints(constraints)))));\n });\n\n readonly setWaitForNonNullConstraints = this.effect((input: Observable<Maybe<boolean>>) => {\n return input.pipe(switchMap((waitForNonNullConstraints) => this.loader$.pipe(tap((x) => x.setWaitForNonNullConstraints(waitForNonNullConstraints)))));\n });\n\n readonly next = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.loader$.pipe(\n first(),\n tap((x) => x.next())\n )\n )\n );\n });\n\n readonly restart = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() =>\n this.loader$.pipe(\n first(),\n tap((x) => x.restart())\n )\n )\n );\n });\n\n // MARK: Accessors\n readonly currentFirestoreCollection$: Observable<Maybe<FirestoreCollectionLike<T, D>>> = this.state$.pipe(\n map((x) => x.firestoreCollection),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly firestoreCollection$: Observable<FirestoreCollectionLike<T, D>> = this.currentFirestoreCollection$.pipe(filterMaybe());\n\n readonly loader$: Observable<DbxFirebaseCollectionLoaderInstance<T, D>> = this.currentFirestoreCollection$.pipe(\n switchMap((collection) =>\n this.state$.pipe(\n first(),\n map((x) =>\n dbxFirebaseCollectionLoaderInstance({\n collection,\n collectionMode: x.collectionMode,\n collectionKeys: x.collectionKeys,\n collectionRefs: x.collectionRefs,\n maxPages: x.maxPages,\n itemsPerPage: x.itemsPerPage,\n constraints: x.constraints,\n waitForNonNullConstraints: x.waitForNonNullConstraints\n })\n )\n )\n ),\n cleanupDestroyable(),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionMode$: Observable<DbxFirebaseCollectionMode> = this.loader$.pipe(switchMap((x) => x.collectionMode$));\n readonly constraints$: Observable<Maybe<ArrayOrValue<FirestoreQueryConstraint>>> = this.loader$.pipe(switchMap((x) => x.constraints$));\n readonly firestoreIteration$: Observable<FirestoreItemPageIterationInstance<T>> = this.loader$.pipe(switchMap((x) => x.firestoreIteration$));\n readonly queryChangeWatcher$: Observable<IterationQueryDocChangeWatcher<T>> = this.loader$.pipe(switchMap((x) => x.queryChangeWatcher$));\n readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>> = this.loader$.pipe(switchMap((x) => x.pageLoadingState$));\n readonly snapshotAccumulator$: Observable<FirebaseQuerySnapshotAccumulator<T>> = this.loader$.pipe(switchMap((x) => x.snapshotAccumulator$));\n readonly accumulator$: Observable<FirebaseQueryItemAccumulator<T>> = this.loader$.pipe(switchMap((x) => x.accumulator$));\n\n readonly hasNext$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.hasNext$));\n readonly canLoadMore$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.canLoadMore$));\n readonly hasNextAndCanLoadMore$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.hasNextAndCanLoadMore$));\n\n readonly hasDocuments$: Observable<boolean> = this.loader$.pipe(switchMap((x) => x.hasDocuments$));\n readonly allDocumentRefs$: Observable<DocumentReference<T>[]> = this.loader$.pipe(switchMap((x) => x.allDocumentRefs$));\n readonly allDocuments$: Observable<D[]> = this.loader$.pipe(switchMap((x) => x.allDocuments$));\n readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]> = this.loader$.pipe(switchMap((x) => x.allDocumentData$));\n\n readonly setFirestoreCollection = this.updater((state, firestoreCollection: FirestoreCollectionLike<T, D> | null | undefined) => ({ ...state, firestoreCollection }));\n\n loadToPage(page: PageNumber): Observable<PageNumber> {\n return this.loader$.pipe(switchMap((x) => x.loadToPage(page)));\n }\n\n loadPagesUntilResultsCount(maxResultsCount: number, countFunction?: FirebaseQueryItemAccumulatorNextPageUntilResultsCountFunction<T> | undefined): Observable<ItemAccumulatorNextPageUntilResultsCountResult> {\n return this.loader$.pipe(switchMap((x) => x.loadPagesUntilResultsCount(maxResultsCount, countFunction)));\n }\n\n loadAllResults(): Observable<PageNumber> {\n return this.loader$.pipe(switchMap((x) => x.loadAllResults()));\n }\n}\n","import { type ModelFirebaseCreateFunction, type ModelFirebaseCrudFunction, type OnCallCreateModelResult } from '@dereekb/firebase';\nimport { type LoadingState, loadingStateFromObs, lazyFrom } from '@dereekb/rxjs';\nimport { asArray } from '@dereekb/util';\nimport { type Observable, from, shareReplay } from 'rxjs';\nimport { type DbxFirebaseCollectionStore } from './store.collection';\n\n// MARK: Create\nexport type DbxFirebaseCollectionStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult> = (params: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a function for a store that DbxFirebaseDocumentStore captures the ModelFirebaseCreateFunction result and sets the key of the created value.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseCollectionStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult>(store: DbxFirebaseCollectionStore<any, any>, fn: ModelFirebaseCreateFunction<I, O>): DbxFirebaseCollectionStoreCreateFunction<I, O> {\n return (params: I) =>\n loadingStateFromObs(\n lazyFrom(() =>\n fn(params).then((result) => {\n const modelKeys = asArray(result.modelKeys);\n\n store.setCollectionKeys(modelKeys);\n store.setCollectionMode('references'); // switch mode to references if not yet set\n\n return result;\n })\n )\n );\n}\n\nexport type DbxFirebaseCollectionStoreCrudFunction<I, O = void> = (input: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a DbxfirebaseDocumentStoreCrudFunction from the input ModelFirebaseCrudFunction.\n *\n * @param fn\n * @returns\n */\nexport function firebaseCollectionStoreCrudFunction<I, O = void>(fn: ModelFirebaseCrudFunction<I, O>): DbxFirebaseCollectionStoreCrudFunction<I, O> {\n return (params: I) => loadingStateFromObs(from(fn(params)).pipe(shareReplay(1)));\n}\n","import { readableError } from '@dereekb/util';\n\nexport const DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR = 'DOES_NOT_EXIST';\n\nexport function modelDoesNotExistError() {\n return readableError(DBX_FIREBASE_MODEL_DOES_NOT_EXIST_ERROR, 'The document does not exist.');\n}\n","import { inject, DestroyRef, InjectionToken, type Provider } from '@angular/core';\nimport { DbxFirebaseDocumentStoreContextStore } from './store.document.context.store';\nimport { type DbxFirebaseDocumentStore } from './store';\n\n/**\n * Injection token for DbxFirebaseDocumentStoreContextStore.\n */\nexport const DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN = new InjectionToken<DbxFirebaseDocumentStoreContextStore[]>('DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN');\n\n/**\n * Provides the DbxFirebaseDocumentStoreContextStore.\n */\nexport function provideDbxFirebaseDocumentStoreContextStore(): Provider[] {\n return [\n {\n // Create/Provide a \"nearest\" DbxFirebaseDocumentStoreContextStore.\n provide: DbxFirebaseDocumentStoreContextStore\n },\n {\n // Also make that context store available to the DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN.\n provide: DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN,\n useExisting: DbxFirebaseDocumentStoreContextStore,\n multi: true\n }\n ];\n}\n\n/**\n * Links a DbxFirebaseDocumentStore to parent DbxFirebaseDocumentStoreContextStore instances.\n *\n * This should be called in an Angular injection context.\n */\nexport function linkDocumentStoreToParentContextStores(store: DbxFirebaseDocumentStore<any, any>) {\n const contextStores = inject(DBX_FIREBASE_DOCUMENT_STORE_CONTEXT_STORE_TOKEN, { optional: true });\n const destroyRef = inject(DestroyRef);\n\n if (contextStores) {\n // add the store to each available context store\n contextStores.forEach((contextStore) => {\n contextStore.addStore(store);\n });\n\n // remove the store from each available context store when the context is destroyed\n destroyRef.onDestroy(() => {\n contextStores.forEach((contextStore) => {\n contextStore.removeStore(store);\n });\n });\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { Observable, shareReplay, distinctUntilChanged, map, switchMap, combineLatest, Subscription, of, catchError } from 'rxjs';\nimport {\n DocumentSnapshot,\n DocumentReference,\n FirestoreCollection,\n FirestoreDocument,\n DocumentDataWithIdAndKey,\n FirestoreModelId,\n FirestoreModelKey,\n FirestoreCollectionLike,\n FirestoreModelIdentity,\n firestoreModelIdsFromKey,\n firestoreModelKeyPartPairs,\n FirestoreModelCollectionAndIdPair,\n firestoreModelKeyPairObject,\n FirestoreModelCollectionAndIdPairObject,\n documentDataWithIdAndKey,\n FirestoreAccessorStreamMode,\n TwoWayFlatFirestoreModelKey,\n inferKeyFromTwoWayFlatFirestoreModelKey,\n RootSingleItemFirestoreCollection,\n FlatFirestoreModelKey,\n flatFirestoreModelKey,\n twoWayFlatFirestoreModelKey,\n FIRESTORE_PERMISSION_DENIED_ERROR_CODE,\n isClientFirebaseError\n} from '@dereekb/firebase';\nimport { filterMaybe, LoadingState, beginLoading, successResult, loadingStateFromObs, errorResult, isLoadingStateLoading } from '@dereekb/rxjs';\nimport { Maybe, isMaybeSo } from '@dereekb/util';\nimport { LockSetComponentStore } from '@dereekb/dbx-core';\nimport { modelDoesNotExistError } from '../../error';\nimport { DbxFirebaseDocumentStore } from './store';\nimport { linkDocumentStoreToParentContextStores } from './store.document.context.store.link';\n\n@Injectable()\nexport class AbstractDbxFirebaseDocumentStore<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseDocumentStoreContextState<T, D> = DbxFirebaseDocumentStoreContextState<T, D>> extends LockSetComponentStore<C> implements DbxFirebaseDocumentStore<T, D> {\n // NOTE: Injection does not occur here, but we need @Injectable to compile properly for Angular usage\n // eslint-disable-next-line @angular-eslint/prefer-inject\n protected constructor(@Inject(null) @Optional() initialState?: C) {\n super(initialState);\n linkDocumentStoreToParentContextStores(this);\n }\n\n // MARK: Effects\n\n // MARK: Accessors\n readonly storeName$: Observable<Maybe<string>> = this.state$.pipe(\n map((x) => x.storeName),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentFirestoreCollectionLike$: Observable<Maybe<FirestoreCollectionLike<T, D>>> = this.state$.pipe(\n map((x) => x.firestoreCollection ?? x.firestoreCollectionLike),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentFirestoreCollection$: Observable<Maybe<FirestoreCollection<T, D>>> = this.state$.pipe(\n map((x) => x.firestoreCollection),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly firestoreCollectionLike$: Observable<FirestoreCollectionLike<T, D>> = this.currentFirestoreCollectionLike$.pipe(filterMaybe());\n readonly firestoreCollection$: Observable<FirestoreCollection<T, D>> = this.currentFirestoreCollection$.pipe(filterMaybe());\n\n readonly currentInputId$: Observable<Maybe<FirestoreModelId>> = this.state$.pipe(\n map((x) => x.id),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly inputId$: Observable<FirestoreModelId> = this.currentInputId$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly currentInputKey$: Observable<Maybe<FirestoreModelKey>> = this.state$.pipe(\n map((x) => x.key),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly inputKey$: Observable<FirestoreModelKey> = this.currentInputKey$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly currentInputRef$: Observable<Maybe<DocumentReference<T>>> = this.state$.pipe(\n map((x) => x.ref),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly inputRef$: Observable<DocumentReference<T>> = this.currentInputRef$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly streamMode$: Observable<FirestoreAccessorStreamMode> = this.state$.pipe(\n map((x) => x.streamMode ?? FirestoreAccessorStreamMode.STREAM),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentDocument$: Observable<Maybe<D>> = combineLatest([this.currentInputId$, this.currentInputKey$, this.currentInputRef$]).pipe(\n switchMap(([id, key, ref]) => {\n let document: Observable<Maybe<D>>;\n\n if (ref) {\n document = this.firestoreCollectionLike$.pipe(map((x) => x.documentAccessor().loadDocument(ref)));\n } else if (key) {\n document = this.firestoreCollectionLike$.pipe(map((x) => x.documentAccessor().loadDocumentForKey(key)));\n } else if (id) {\n document = this.firestoreCollection$.pipe(map((x) => x.documentAccessor().loadDocumentForId(id)));\n } else {\n document = of(undefined);\n }\n\n return document;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Whether or not an id/ref/key has been input and currentDocument is not null.\n */\n readonly hasRef$: Observable<boolean> = this.currentDocument$.pipe(\n map((x) => x?.documentRef != null),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly document$: Observable<D> = this.currentDocument$.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly documentLoadingState$: Observable<LoadingState<D>> = this.currentDocument$.pipe(\n map((x) => (x ? successResult(x) : beginLoading<D>())),\n shareReplay(1)\n );\n\n readonly currentId$: Observable<Maybe<FirestoreModelId>> = this.currentDocument$.pipe(\n map((x) => x?.id),\n shareReplay(1)\n );\n\n readonly currentKey$: Observable<Maybe<FirestoreModelKey>> = this.currentDocument$.pipe(\n map((x) => x?.key),\n shareReplay(1)\n );\n\n readonly id$: Observable<FirestoreModelId> = this.document$.pipe(\n map((x) => x.id),\n shareReplay(1)\n );\n\n readonly key$: Observable<FirestoreModelKey> = this.document$.pipe(\n map((x) => x.key),\n shareReplay(1)\n );\n\n readonly keyModelIds$: Observable<FirestoreModelId[]> = this.key$.pipe(map(firestoreModelIdsFromKey), shareReplay(1));\n readonly keyPairs$: Observable<FirestoreModelCollectionAndIdPair[]> = this.key$.pipe(map(firestoreModelKeyPartPairs), filterMaybe(), shareReplay(1));\n readonly keyPairObject$: Observable<FirestoreModelCollectionAndIdPairObject> = this.key$.pipe(map(firestoreModelKeyPairObject), filterMaybe(), shareReplay(1));\n\n readonly ref$: Observable<DocumentReference<T>> = this.document$.pipe(\n map((x) => x.documentRef),\n shareReplay(1)\n );\n\n readonly flatKey$: Observable<FlatFirestoreModelKey> = this.key$.pipe(\n map((x) => flatFirestoreModelKey(x)),\n shareReplay(1)\n );\n\n readonly twoWayFlatKey$: Observable<FlatFirestoreModelKey> = this.key$.pipe(\n map((x) => twoWayFlatFirestoreModelKey(x)),\n shareReplay(1)\n );\n\n readonly snapshot$: Observable<DocumentSnapshot<T>> = combineLatest([this.document$, this.streamMode$]).pipe(\n switchMap(([x, mode]) => x.snapshotStream(mode)),\n shareReplay(1)\n );\n\n readonly snapshotLoadingState$: Observable<LoadingState<DocumentSnapshot<T>>> = this.currentDocument$.pipe(\n switchMap(() => loadingStateFromObs(this.snapshot$).pipe(catchError((error) => of(errorResult(error) as LoadingState<DocumentSnapshot<T>>)))),\n shareReplay(1)\n );\n\n readonly dataLoadingState$: Observable<LoadingState<DocumentDataWithIdAndKey<T>>> = this.snapshotLoadingState$.pipe(\n map((x) => {\n let result: LoadingState<DocumentDataWithIdAndKey<T>>;\n\n if (x.value) {\n const data = documentDataWithIdAndKey(x.value);\n\n if (data) {\n result = successResult(data);\n } else {\n result = errorResult(modelDoesNotExistError());\n }\n } else {\n result = {\n ...x,\n value: undefined\n };\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n readonly currentData$: Observable<Maybe<DocumentDataWithIdAndKey<T>>> = this.dataLoadingState$.pipe(\n map((x) => x.value),\n shareReplay(1)\n );\n\n readonly data$: Observable<DocumentDataWithIdAndKey<T>> = this.currentDocument$.pipe(\n switchMap(() => this.currentData$.pipe(filterMaybe())),\n shareReplay(1)\n );\n\n readonly isLoadingData$ = this.dataLoadingState$.pipe(map(isLoadingStateLoading), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Returns false while hasRef$ is false, and then returns exists$.\n */\n readonly currentExists$: Observable<boolean> = this.hasRef$.pipe(\n switchMap((hasRef) => {\n if (hasRef) {\n return this.exists$;\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n\n readonly exists$: Observable<boolean> = this.currentData$.pipe(\n map((x) => isMaybeSo(x)),\n catchError((e) => {\n let result: Maybe<boolean>;\n\n if (isClientFirebaseError(e)) {\n switch (e.code) {\n case FIRESTORE_PERMISSION_DENIED_ERROR_CODE:\n result = false; // does not exist if permission is denied\n break;\n }\n }\n\n if (result == null) {\n throw e;\n }\n\n return of(result);\n }),\n shareReplay(1)\n );\n\n readonly doesNotExist$: Observable<boolean> = this.exists$.pipe(\n map((x) => !x),\n shareReplay(1)\n );\n\n readonly modelIdentity$: Observable<FirestoreModelIdentity> = this.firestoreCollectionLike$.pipe(\n map((x) => x.modelIdentity),\n shareReplay(1)\n );\n\n // MARK: State Changes\n readonly setStoreName = this.updater((state, storeName: Maybe<string>) => ({ ...state, storeName })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setId = this.updater((state, id: Maybe<FirestoreModelId>) => (id ? { ...state, id, key: undefined, ref: undefined } : { ...state, id })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setKey = this.updater((state, key: Maybe<FirestoreModelKey>) => (key ? { ...state, key, id: undefined, ref: undefined } : { ...state, key })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setFlatKey = this.updater((state, key: Maybe<TwoWayFlatFirestoreModelKey>) => (key ? { ...state, key: inferKeyFromTwoWayFlatFirestoreModelKey(key), id: undefined, ref: undefined } : { ...state, key })) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n readonly setRef = this.updater((state, ref: Maybe<DocumentReference<T>>) => (ref ? { ...state, key: undefined, id: undefined, ref } : { ...state, ref })) as (observableOrValue: Maybe<DocumentReference<T>> | Observable<Maybe<DocumentReference<T>>>) => Subscription;\n\n readonly setStreamMode = this.updater((state, streamMode: FirestoreAccessorStreamMode) => ({ ...state, streamMode }));\n\n readonly clearRefs = this.updater((state) => ({ ...state, id: undefined, key: undefined, ref: undefined }));\n\n readonly setFirestoreCollection = this.updater((state, firestoreCollection: Maybe<FirestoreCollection<T, D>>) => ({ ...state, firestoreCollection }));\n readonly setFirestoreCollectionLike = this.updater((state, firestoreCollectionLike: Maybe<FirestoreCollectionLike<T, D>>) => ({ ...state, firestoreCollectionLike }));\n}\n\nfunction injectSingleItemIdIntoState<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseDocumentStoreContextState<T, D> = DbxFirebaseDocumentStoreContextState<T, D>>(state?: C | undefined): C | undefined {\n const id = (state?.firestoreCollection as RootSingleItemFirestoreCollection<T, D>)?.singleItemIdentifier;\n\n if (state && id != null) {\n return { ...state, id };\n } else {\n return state;\n }\n}\n\n/**\n * AbstractDbxFirebaseDocumentWithParentStore extension for use with RootSingleItemFirestoreCollection.\n */\nexport class AbstractRootSingleItemDbxFirebaseDocument<T, D extends FirestoreDocument<T> = FirestoreDocument<T>, C extends DbxFirebaseDocumentStoreContextState<T, D> = DbxFirebaseDocumentStoreContextState<T, D>> extends AbstractDbxFirebaseDocumentStore<T, D, C> {\n protected constructor(@Inject(null) @Optional() initialState?: C) {\n super(injectSingleItemIdIntoState<T, D, C>(initialState));\n }\n\n /**\n * Sets the SingleItemFirestoreCollection to use.\n */\n override readonly setFirestoreCollection = this.updater((state, firestoreCollection: Maybe<FirestoreCollection<T, D>>) => {\n if (firestoreCollection != null) {\n const id = (firestoreCollection as RootSingleItemFirestoreCollection<T, D>).singleItemIdentifier;\n\n if (id != null) {\n return { ...state, firestoreCollection, id };\n } else {\n throw new Error('AbstractRootSingleItemDbxFirebaseDocument only accepts RootSingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');\n }\n } else {\n return { ...state, firestoreCollection: null };\n }\n });\n\n /**\n * Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setId = this.updater((state, id: Maybe<FirestoreModelId>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setKey = this.updater((state, key: Maybe<FirestoreModelKey>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractRootSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setRef = this.updater((state, ref: Maybe<DocumentReference<T>>) => state) as (observableOrValue: Maybe<DocumentReference<T>> | Observable<Maybe<DocumentReference<T>>>) => Subscription;\n\n override readonly clearRefs = this.updater((state) => state);\n}\n\nexport interface DbxFirebaseDocumentStoreContextState<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> {\n readonly storeName?: Maybe<string>;\n readonly firestoreCollectionLike?: Maybe<FirestoreCollectionLike<T, D>>;\n readonly firestoreCollection?: Maybe<FirestoreCollection<T, D>>;\n readonly streamMode?: FirestoreAccessorStreamMode;\n readonly id?: Maybe<FirestoreModelId>;\n readonly key?: Maybe<FirestoreModelKey>;\n readonly ref?: Maybe<DocumentReference<T>>;\n}\n","import { type ModelFirebaseCreateFunction, type ModelFirebaseDeleteFunction, type ModelFirebaseUpdateFunction, type OnCallCreateModelResult, type TargetModelParams, type InferredTargetModelParams, type ModelFirebaseCrudFunction, type ModelFirebaseReadFunction } from '@dereekb/firebase';\nimport { lazyFrom, type LoadingState, loadingStateFromObs } from '@dereekb/rxjs';\nimport { firstValue, type PartialOnKeys } from '@dereekb/util';\nimport { shareReplay, exhaustMap, first, from, type Observable } from 'rxjs';\nimport { type DbxFirebaseDocumentStore } from './store';\n\n// MARK: Create\nexport type DbxFirebaseDocumentStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult> = (params: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a function for a store that DbxFirebaseDocumentStore captures the ModelFirebaseCreateFunction result and sets the key of the created value.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreCreateFunction<I, O extends OnCallCreateModelResult = OnCallCreateModelResult>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseCreateFunction<I, O>): DbxFirebaseDocumentStoreCreateFunction<I, O> {\n return (params: I) =>\n loadingStateFromObs(\n lazyFrom(() =>\n fn(params).then((result) => {\n const modelKeys = result.modelKeys;\n const firstKey = firstValue(modelKeys);\n\n if (firstKey) {\n store.setKey(firstKey);\n }\n\n return result;\n })\n )\n );\n}\n\nexport type DbxFirebaseDocumentStoreCrudFunction<I, O = void> = (input: I) => Observable<LoadingState<O>>;\n\n/**\n * Creates a DbxfirebaseDocumentStoreCrudFunction from the input ModelFirebaseCrudFunction.\n *\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreCrudFunction<I, O = void>(fn: ModelFirebaseCrudFunction<I, O>): DbxFirebaseDocumentStoreCrudFunction<I, O> {\n return (params: I) => loadingStateFromObs(from(fn(params)).pipe(shareReplay(1)));\n}\n\n// MARK: Targeted Functions\n/**\n * A parameter that refers to a specific key.\n */\nexport type DbxFirebaseDocumentStoreFunctionParams = TargetModelParams | InferredTargetModelParams;\n\n/**\n * Used for the input to related functions\n */\nexport type DbxFirebaseDocumentStoreFunctionParamsInput<I extends DbxFirebaseDocumentStoreFunctionParams> = PartialOnKeys<I, 'key'>;\nexport type DbxFirebaseDocumentStoreFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O = void> = DbxFirebaseDocumentStoreCrudFunction<DbxFirebaseDocumentStoreFunctionParamsInput<I>, O>;\n\n// MARK: Read\n/**\n * Creates a DbxfirebaseDocumentStoreCrudFunction for read.\n *\n * The store's current key is always injected into the params of the request.\n *\n * For functions that do not require the store's current key, use firebaseDocumentStoreCrudFunction() instead.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreReadFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseReadFunction<I, O>): DbxFirebaseDocumentStoreFunction<I, O> {\n return firebaseDocumentStoreUpdateFunction(store, fn);\n}\n\n// MARK: Update\n/**\n * Creates a DbxFirebaseDocumentStoreFunction for update.\n *\n * The store's current key is always injected into the params of the request.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreUpdateFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O = void>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseUpdateFunction<I, O>): DbxFirebaseDocumentStoreFunction<I, O> {\n return (params: DbxFirebaseDocumentStoreFunctionParamsInput<I>) =>\n loadingStateFromObs(\n store.key$.pipe(\n first(),\n exhaustMap((key) =>\n fn({\n ...params,\n key // inject key into the parameters.\n } as I)\n ),\n shareReplay(1)\n )\n );\n}\n\n// MARK: Delete\n/**\n * Creates a DbxFirebaseDocumentStoreFunction for delete.\n *\n * The store's current key is always injected into the params of the request.\n *\n * @param store\n * @param fn\n * @returns\n */\nexport function firebaseDocumentStoreDeleteFunction<I extends DbxFirebaseDocumentStoreFunctionParams, O = void>(store: DbxFirebaseDocumentStore<any, any>, fn: ModelFirebaseDeleteFunction<I, O>): DbxFirebaseDocumentStoreFunction<I, O> {\n return (params: DbxFirebaseDocumentStoreFunctionParamsInput<I>) =>\n loadingStateFromObs(\n store.key$.pipe(\n first(),\n exhaustMap((key) =>\n fn({\n ...params,\n key // inject key into the parameters.\n } as I).then((result) => {\n store.clearRefs();\n return result;\n })\n ),\n shareReplay(1)\n )\n );\n}\n","import { type LockSetComponentStore } from '@dereekb/dbx-core';\nimport { type FirestoreCollectionLike, type FirestoreCollectionWithParentFactory, type FirestoreDocument } from '@dereekb/firebase';\nimport { cleanup, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { type ComponentStore } from '@ngrx/component-store';\nimport { map, type Observable, type Subscription } from 'rxjs';\nimport { type DbxFirebaseDocumentStore } from './store';\n\nexport interface DbxFirebaseComponentStoreWithParentContextState<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> {\n readonly parent?: Maybe<PD>;\n readonly collectionFactory?: Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>;\n}\n\nexport type DbxFirebaseComponentStoreSetParentEffectFunction<PD> = (parent: Observable<Maybe<PD>>) => Subscription;\nexport type DbxFirebaseComponentStoreWithParentSetParentEffectFunction<PD> = (observableOrValue: ObservableOrValue<Maybe<PD>>) => Subscription;\nexport type DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> = (observableOrValue: ObservableOrValue<DbxFirebaseDocumentStore<PT, PD>>) => Subscription;\n\nexport interface DbxFirebaseComponentStoreWithParent<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, A extends FirestoreCollectionLike<T, D> = FirestoreCollectionLike<T, D>> extends LockSetComponentStore<object>, Pick<ComponentStore<DbxFirebaseComponentStoreWithParentContextState<T, PT, D, PD>>, 'effect'> {\n readonly currentParent$: Observable<Maybe<PD>>;\n readonly parent$: Observable<PD>;\n readonly currentCollectionFactory$: Observable<Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>>;\n readonly collectionFactory$: Observable<FirestoreCollectionWithParentFactory<T, PT, D, PD>>;\n readonly _setParent: DbxFirebaseComponentStoreSetParentEffectFunction<PD>;\n readonly _setParentDocument: (() => void) | ((observableOrValue: ObservableOrValue<Maybe<PD>>) => Subscription);\n readonly setFirestoreCollection: (() => void) | ((observableOrValue: ObservableOrValue<Maybe<A>>) => Subscription);\n}\n\nexport function setParentStoreEffect<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, A extends FirestoreCollectionLike<T, D> = FirestoreCollectionLike<T, D>>(store: DbxFirebaseComponentStoreWithParent<T, PT, D, PD, A>): DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD> {\n return store.effect((input: Observable<Maybe<DbxFirebaseDocumentStore<PT, PD>>>) => {\n return input.pipe(\n map((parentStore) => {\n let result: Maybe<Subscription>;\n\n if (parentStore) {\n result = store._setParent(parentStore.currentDocument$) as Subscription;\n } else {\n result = undefined;\n }\n\n // set as the parent lock set too\n store.setParentLockSet(parentStore);\n\n return result;\n }),\n cleanup((sub) => {\n if (sub) {\n sub.unsubscribe();\n }\n })\n );\n });\n}\n","import { type Maybe } from '@dereekb/util';\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport { filterMaybe, ObservableOrValue } from '@dereekb/rxjs';\nimport { Observable, shareReplay, distinctUntilChanged, map, Subscription, NEVER, switchMap, tap } from 'rxjs';\nimport { FirestoreCollectionGroup, FirestoreCollectionWithParentFactory, FirestoreDocument } from '@dereekb/firebase';\nimport { AbstractDbxFirebaseCollectionStore, DbxFirebaseCollectionStore, DbxFirebaseCollectionStoreContextState } from './store.collection';\nimport { DbxFirebaseComponentStoreSetParentEffectFunction, DbxFirebaseComponentStoreWithParent, DbxFirebaseComponentStoreWithParentContextState, DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction, setParentStoreEffect } from './store.subcollection.rxjs';\n\n/**\n * Whether or not to load values from a parent or a group.\n */\nexport type DbxFirebaseComponentStoreWithParentSourceMode = 'parent' | 'group';\n\nexport interface DbxFirebaseCollectionWithParentStoreContextState<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseCollectionStoreContextState<T, D>, DbxFirebaseComponentStoreWithParentContextState<T, PT, D, PD> {\n readonly mode?: Maybe<DbxFirebaseComponentStoreWithParentSourceMode>;\n readonly collectionGroup?: Maybe<FirestoreCollectionGroup<T, D>>;\n}\n\nexport type DbxFirebaseComponentStoreWithParentSetParentSourceModeFunction = (observableOrValue: ObservableOrValue<Maybe<DbxFirebaseComponentStoreWithParentSourceMode>>) => Subscription;\n\nexport interface DbxFirebaseCollectionWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseCollectionStore<T, D>, DbxFirebaseComponentStoreWithParent<T, PT, D, PD> {\n readonly setSourceMode: DbxFirebaseComponentStoreWithParentSetParentSourceModeFunction;\n readonly setCollectionGroup: (observableOrValue: FirestoreCollectionGroup<T, D> | Observable<FirestoreCollectionGroup<T, D>>) => Subscription;\n readonly currentCollectionGroup$: Observable<Maybe<FirestoreCollectionGroup<T, D>>>;\n readonly collectionGroup$: Observable<FirestoreCollectionGroup<T, D>>;\n}\n\n/**\n * Abstract DbxFirebaseCollectionStore that has a parent document from which is derives it's FiresbaseCollection from.\n */\n@Injectable()\nexport class AbstractDbxFirebaseCollectionWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, C extends DbxFirebaseCollectionWithParentStoreContextState<T, PT, D, PD> = DbxFirebaseCollectionWithParentStoreContextState<T, PT, D, PD>> extends AbstractDbxFirebaseCollectionStore<T, D, C> implements DbxFirebaseCollectionWithParentStore<T, PT, D, PD> {\n // NOTE: Injection does not occur here, but we need @Injectable to compile properly for Angular usage\n // eslint-disable-next-line @angular-eslint/prefer-inject\n constructor(@Inject(null) @Optional() state: C, @Inject(null) @Optional() defaultSourceMode?: DbxFirebaseComponentStoreWithParentSourceMode) {\n super(state);\n this.setSourceMode(defaultSourceMode || 'parent');\n }\n\n // MARK: Effects\n readonly setParentStore: DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD> = setParentStoreEffect(this);\n readonly setSourceMode: DbxFirebaseComponentStoreWithParentSetParentSourceModeFunction = this.effect((input: Observable<Maybe<DbxFirebaseComponentStoreWithParentSourceMode>>) => {\n return input.pipe(\n distinctUntilChanged(),\n switchMap((inputMode) => {\n const mode = inputMode?.toLowerCase() ?? 'parent'; // default to parent mode\n\n if (mode === 'group') {\n return this.currentCollectionGroup$.pipe(\n tap((collectionGroup) => {\n this.setFirestoreCollection(collectionGroup);\n })\n );\n } else {\n // parent document collection\n return this.currentParent$.pipe(\n switchMap((parent) => {\n if (parent) {\n return this.collectionFactory$.pipe(\n tap((collectionFactory) => {\n const collection = collectionFactory(parent);\n this.setFirestoreCollection(collection);\n })\n );\n } else {\n this.setFirestoreCollection(undefined);\n return NEVER;\n }\n })\n );\n }\n })\n );\n });\n\n // MARK: Accessors\n readonly currentParent$: Observable<Maybe<PD>> = this.state$.pipe(\n map((x) => x.parent),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly parent$: Observable<PD> = this.currentParent$.pipe(filterMaybe());\n\n readonly currentCollectionFactory$: Observable<Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>> = this.state$.pipe(\n map((x) => x.collectionFactory),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionFactory$: Observable<FirestoreCollectionWithParentFactory<T, PT, D, PD>> = this.currentCollectionFactory$.pipe(filterMaybe());\n\n readonly currentCollectionGroup$: Observable<Maybe<FirestoreCollectionGroup<T, D>>> = this.state$.pipe(\n map((x) => x.collectionGroup),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionGroup$: Observable<FirestoreCollectionGroup<T, D>> = this.currentCollectionGroup$.pipe(filterMaybe());\n\n // MARK: State Changes\n /**\n * Sets the collection factory function to use.\n */\n readonly setCollectionFactory = this.updater((state, collectionFactory: FirestoreCollectionWithParentFactory<T, PT, D, PD>) => ({ ...state, collectionFactory }));\n\n /**\n * Sets the collection group to use.\n */\n readonly setCollectionGroup = this.updater((state, collectionGroup: Maybe<FirestoreCollectionGroup<T, D>>) => ({ ...state, collectionGroup })) as (observableOrValue: Maybe<FirestoreCollectionGroup<T, D>> | Observable<Maybe<FirestoreCollectionGroup<T, D>>>) => Subscription;\n\n /**\n * Sets the parent on the current state.\n */\n readonly _setParentDocument = this.updater((state, parent: Maybe<PD>) => ({ ...state, parent }));\n readonly _setParent = this._setParentDocument as DbxFirebaseComponentStoreSetParentEffectFunction<PD>;\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Injectable } from '@angular/core';\nimport { Observable, shareReplay, distinctUntilChanged, map, NEVER, switchMap, tap, Subscription } from 'rxjs';\nimport { FirestoreDocument, FirestoreCollectionWithParentFactory, FirestoreCollection, DocumentReference, FirestoreModelId, FirestoreModelKey, SingleItemFirestoreCollection, firestoreModelKeyParentKey } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\nimport { AbstractDbxFirebaseDocumentStore , DbxFirebaseDocumentStoreContextState } from './store.document';\nimport { DbxFirebaseDocumentStore } from './store';\nimport { DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction, setParentStoreEffect, DbxFirebaseComponentStoreWithParent, DbxFirebaseComponentStoreWithParentContextState, DbxFirebaseComponentStoreWithParentSetParentEffectFunction } from './store.subcollection.rxjs';\n\nexport interface DbxFirebaseDocumentWithParentStoreContextState<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseDocumentStoreContextState<T, D>, DbxFirebaseComponentStoreWithParentContextState<T, PT, D, PD> {}\n\nexport interface DbxFirebaseDocumentWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>> extends DbxFirebaseDocumentStore<T, D>, DbxFirebaseComponentStoreWithParent<T, PT, D, PD, FirestoreCollection<T, D>> {}\n\n/**\n * Abstract DbxFirebaseDocumentStore that has a parent document from which is derives it's FiresbaseCollection from.\n */\n@Injectable()\nexport class AbstractDbxFirebaseDocumentWithParentStore<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, C extends DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD> = DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD>> extends AbstractDbxFirebaseDocumentStore<T, D, C> implements DbxFirebaseDocumentWithParentStore<T, PT, D, PD> {\n // MARK: Effects\n readonly setParentStore: DbxFirebaseComponentStoreWithParentSetParentStoreEffectFunction<PT, PD> = setParentStoreEffect(this);\n readonly setParent: DbxFirebaseComponentStoreWithParentSetParentEffectFunction<PD> = this.effect((input: Observable<Maybe<PD>>) => {\n return input.pipe(\n switchMap((parent) => {\n this._setParentDocument(parent);\n\n if (parent) {\n return this.collectionFactory$.pipe(\n tap((collectionFactory) => {\n const collection = collectionFactory(parent);\n this.setFirestoreCollection(collection);\n })\n );\n } else {\n // clear the current collection\n this.setFirestoreCollection(undefined);\n\n // do nothing until a parent is returned.\n return NEVER;\n }\n })\n );\n });\n\n readonly _setParent = this.setParent;\n\n // MARK: Accessors\n /**\n * Returns the parent model key given the current key value.\n */\n readonly keyParentKey$ = this.key$.pipe(\n map((x) => firestoreModelKeyParentKey(x, 1)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentParent$: Observable<Maybe<PD>> = this.state$.pipe(\n map((x) => x.parent),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly currentParentKey$: Observable<Maybe<FirestoreModelKey>> = this.state$.pipe(\n map((x) => x.parent?.key),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly parent$: Observable<PD> = this.currentParent$.pipe(filterMaybe());\n readonly parentKey$: Observable<Maybe<FirestoreModelKey>> = this.currentParentKey$.pipe(filterMaybe());\n\n readonly currentCollectionFactory$: Observable<Maybe<FirestoreCollectionWithParentFactory<T, PT, D, PD>>> = this.state$.pipe(\n map((x) => x.collectionFactory),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly collectionFactory$: Observable<FirestoreCollectionWithParentFactory<T, PT, D, PD>> = this.currentCollectionFactory$.pipe(filterMaybe());\n\n // MARK: State Changes\n /**\n * Sets the collection factory function to use.\n */\n readonly setCollectionFactory = this.updater((state, collectionFactory: FirestoreCollectionWithParentFactory<T, PT, D, PD>) => ({ ...state, collectionFactory }));\n\n /**\n * Sets the parent on the current state.\n */\n readonly _setParentDocument = this.updater((state, parent: Maybe<PD>) => ({ ...state, parent }));\n}\n\n/**\n * AbstractDbxFirebaseDocumentWithParentStore extension for use with SingleItemFirestoreCollection.\n */\nexport class AbstractSingleItemDbxFirebaseDocument<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, C extends DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD> = DbxFirebaseDocumentWithParentStoreContextState<T, PT, D, PD>> extends AbstractDbxFirebaseDocumentWithParentStore<T, PT, D, PD, C> {\n /**\n * Sets the SingleItemFirestoreCollection to use.\n */\n override readonly setFirestoreCollection = this.updater((state, firestoreCollection: Maybe<FirestoreCollection<T, D>>) => {\n if (firestoreCollection != null) {\n const id = (firestoreCollection as SingleItemFirestoreCollection<T, PT, D, PD>).singleItemIdentifier;\n\n if (id != null) {\n return { ...state, firestoreCollection, id };\n } else {\n throw new Error('AbstractSingleItemDbxFirebaseDocument only accepts SingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');\n }\n } else {\n return { ...state, firestoreCollection: null };\n }\n });\n\n /**\n * Does nothing on a AbstractSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setId = this.updater((state, id: Maybe<FirestoreModelId>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setKey = this.updater((state, key: Maybe<FirestoreModelKey>) => state) as (observableOrValue: Maybe<string> | Observable<Maybe<string>>) => Subscription;\n\n /**\n * Does nothing on a AbstractSingleItemDbxFirebaseDocument.\n *\n * Ref is set with the FirestoreCollection\n */\n override readonly setRef = this.updater((state, ref: Maybe<DocumentReference<T>>) => state) as (observableOrValue: Maybe<DocumentReference<T>> | Observable<Maybe<DocumentReference<T>>>) => Subscription;\n override readonly clearRefs = this.updater((state) => state);\n}\n","import { Directive, forwardRef, model, Provider, Type } from '@angular/core';\nimport { FirestoreDocument } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from './store.collection.directive';\nimport { DbxFirebaseCollectionWithParentStore, DbxFirebaseComponentStoreWithParentSourceMode } from './store.subcollection';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { skipInitialMaybe } from '@dereekb/rxjs';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Abstract directive that contains a DbxFirebaseCollectionWithParentStore and provides an interface for communicating with other directives.\n */\n@Directive()\nexport abstract class DbxFirebaseCollectionWithParentStoreDirective<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>, S extends DbxFirebaseCollectionWithParentStore<T, PT, D, PD> = DbxFirebaseCollectionWithParentStore<T, PT, D, PD>> extends DbxFirebaseCollectionStoreDirective<T, D, S> {\n readonly sourceMode = model<Maybe<DbxFirebaseComponentStoreWithParentSourceMode>>(undefined);\n\n private readonly _sourceMode$ = toObservable(this.sourceMode).pipe(skipInitialMaybe());\n\n constructor(store: S) {\n super(store);\n\n // sync inputs to store any time the store changes\n cleanSubscription(\n this.store$.subscribe((x) => {\n x.setSourceMode(this._sourceMode$);\n })\n );\n }\n\n // MARK: Inputs\n setSourceMode(sourceMode: Maybe<DbxFirebaseComponentStoreWithParentSourceMode>) {\n this.sourceMode.set(sourceMode);\n }\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// The use of any here does not degrade the type-safety; we want to simply match that the Store type S is used in the Directive type C to provide it.\n\n/**\n * Configures providers for a DbxFirebaseCollectionWithParentStoreDirective.\n *\n * Can optionally also provide the actual store type to include in the providers array so it is instantiated by Angular.\n *\n * @param sourceType\n */\nexport function provideDbxFirebaseCollectionWithParentStoreDirective<S extends DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, any>>(sourceType: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionWithParentStoreDirective<S extends DbxFirebaseCollectionWithParentStore<any, any, any, any>, C extends DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S> = DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[];\nexport function provideDbxFirebaseCollectionWithParentStoreDirective<S extends DbxFirebaseCollectionWithParentStore<any, any, any, any>, C extends DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S> = DbxFirebaseCollectionWithParentStoreDirective<any, any, any, any, S>>(sourceType: Type<C>, storeType?: Type<S>): Provider[] {\n const providers: Provider[] = [\n ...provideDbxFirebaseCollectionStoreDirective(sourceType, storeType),\n {\n provide: DbxFirebaseCollectionWithParentStoreDirective,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Directive } from '@angular/core';\nimport { provideDbxFirebaseDocumentStoreContextStore } from './store.document.context.store.link';\n\n/**\n * Directive that provides a DbxFirebaseDocumentStoreContextStore.\n */\n@Directive({\n selector: '[dbxFirebaseDocumentStoreContextStore]',\n providers: provideDbxFirebaseDocumentStoreContextStore(),\n standalone: true\n})\nexport class DbxFirebaseDocumentStoreContextStoreDirective {}\n","import { inject, Injectable } from '@angular/core';\nimport { SystemState, SystemStateDocument, SystemStateFirestoreCollections } from '@dereekb/firebase';\nimport { AbstractDbxFirebaseCollectionStore } from '../modules/store/store.collection';\n\n@Injectable()\nexport class SystemStateCollectionStore extends AbstractDbxFirebaseCollectionStore<SystemState, SystemStateDocument> {\n constructor() {\n super({ firestoreCollection: inject(SystemStateFirestoreCollections).systemStateCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { SystemState, SystemStateDocument } from '@dereekb/firebase';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../modules/store/store.collection.directive';\nimport { SystemStateCollectionStore } from './systemstate.collection.store';\n\n@Directive({\n selector: '[dbxFirebaseSystemStateCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseSystemStateCollectionStoreDirective, SystemStateCollectionStore)\n})\nexport class DbxFirebaseSystemStateCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<SystemState, SystemStateDocument, SystemStateCollectionStore> {\n constructor() {\n super(inject(SystemStateCollectionStore));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { SystemState, SystemStateDocument, SystemStateFirestoreCollection, SystemStateFirestoreCollections, SystemStateStoredData } from '@dereekb/firebase';\nimport { AbstractDbxFirebaseDocumentStore } from '../modules/store/store.document';\n\n@Injectable()\nexport class SystemStateDocumentStore<T extends SystemStateStoredData = SystemStateStoredData> extends AbstractDbxFirebaseDocumentStore<SystemState<T>, SystemStateDocument<T>> {\n constructor() {\n super({ firestoreCollection: inject(SystemStateFirestoreCollections).systemStateCollection as SystemStateFirestoreCollection<T> });\n }\n}\n","import { SystemState, SystemStateStoredData, SystemStateTypeIdentifier } from '@dereekb/firebase';\nimport { LoadingState, mapLoadingState } from '@dereekb/rxjs';\nimport { map, Observable, shareReplay } from 'rxjs';\nimport { SystemStateDocumentStore } from './systemstate.document.store';\nimport { Inject, Injectable, Injector, Optional, inject } from '@angular/core';\nimport { newWithInjector } from '@dereekb/dbx-core';\n\n/**\n * Abstract class used for accessing a SystemStateDocumentStore's data.\n */\n@Injectable()\nexport abstract class AbstractSystemStateDocumentStoreAccessor<T extends SystemStateStoredData = SystemStateStoredData> {\n readonly systemStateDocumentStore = newWithInjector(SystemStateDocumentStore<T>, inject(Injector));\n\n readonly documentData$ = this.systemStateDocumentStore.data$;\n readonly data$: Observable<T> = this.documentData$.pipe(\n map((x) => x.data),\n shareReplay(1)\n );\n readonly dataState$: Observable<LoadingState<T>> = this.systemStateDocumentStore.dataLoadingState$.pipe(mapLoadingState({ mapValue: (x: SystemState<T>) => x.data }), shareReplay(1));\n readonly exists$ = this.systemStateDocumentStore.exists$;\n readonly doesNotExist$ = this.systemStateDocumentStore.doesNotExist$;\n\n readonly type$: Observable<SystemStateTypeIdentifier> = this.systemStateDocumentStore.id$;\n\n constructor(@Inject(null) @Optional() type: SystemStateTypeIdentifier) {\n this.systemStateDocumentStore.setId(type);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { SystemState, SystemStateDocument, SystemStateStoredData } from '@dereekb/firebase';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../modules/store/store.document.directive';\nimport { SystemStateDocumentStore } from './systemstate.document.store';\n\n@Directive({\n selector: '[dbxFirebaseSystemStateDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseSystemStateDocumentStoreDirective, SystemStateDocumentStore)\n})\nexport class DbxFirebaseSystemStateDocumentStoreDirective<T extends SystemStateStoredData = SystemStateStoredData> extends DbxFirebaseDocumentStoreDirective<SystemState<T>, SystemStateDocument<T>, SystemStateDocumentStore<T>> {\n constructor() {\n super(inject(SystemStateDocumentStore<T>));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseModelStoreModule } from './modules/store/model.store.module';\n\n@NgModule({\n exports: [DbxFirebaseModelStoreModule]\n})\nexport class DbxFirebaseModelModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { AppNotificationTemplateTypeInfoRecordService, NotificationItem, NotificationItemMetadata, NotificationItemSubjectMessagePair } from '@dereekb/firebase';\n\n/**\n * Client-side service used for retrieving notification templates.\n */\n@Injectable()\nexport class DbxFirebaseNotificationTemplateService {\n readonly appNotificationTemplateTypeInfoRecordService = inject(AppNotificationTemplateTypeInfoRecordService);\n\n notificationItemSubjectMessagePairForNotificationSummaryItem<D extends NotificationItemMetadata = {}>(item: NotificationItem<D>): NotificationItemSubjectMessagePair<D> {\n const templateType = item.t;\n const templateDetails = this.appNotificationTemplateTypeInfoRecordService.appNotificationTemplateTypeInfoRecord[templateType];\n\n const subject = item.s ?? templateDetails.name;\n const message = item.g ?? '';\n const date = item.cat;\n\n return {\n item,\n subject,\n message,\n date\n };\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, provideDbxListView, DbxValueAsListItem, provideDbxListViewWrapper, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, DbxListWrapperComponentImportsModule, DbxSelectionValueListViewComponentImportsModule } from '@dereekb/dbx-web';\nimport { NotificationItem } from '@dereekb/firebase';\nimport { cachedGetter } from '@dereekb/util';\nimport { of } from 'rxjs';\nimport { DbxFirebaseNotificationTemplateService } from '../service/notification.template.service';\nimport { DatePipe } from '@angular/common';\nimport { CutTextPipe } from '@dereekb/dbx-core';\n\nexport type NotificationItemWithSelection = DbxValueAsListItem<NotificationItem>;\n\n@Component({\n selector: 'dbx-firebase-notificationitem-list',\n template: DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxListWrapperComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListViewWrapper(DbxFirebaseNotificationItemListComponent),\n standalone: true\n})\nexport class DbxFirebaseNotificationItemListComponent extends AbstractDbxSelectionListWrapperDirective<NotificationItem> {\n constructor() {\n super({\n componentClass: DbxFirebaseNotificationItemListViewComponent,\n defaultSelectionMode: 'view'\n });\n }\n}\n\n@Component({\n selector: 'dbx-firebase-notificationitem-list-view',\n template: DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE,\n imports: [DbxSelectionValueListViewComponentImportsModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: provideDbxListView(DbxFirebaseNotificationItemListViewComponent),\n standalone: true\n})\nexport class DbxFirebaseNotificationItemListViewComponent extends AbstractDbxSelectionListViewDirective<NotificationItem> {\n readonly config: DbxSelectionValueListViewConfig<NotificationItemWithSelection> = {\n componentClass: DbxFirebaseNotificationItemListViewItemComponent,\n mapValuesToItemValues: (x) => of(x.map((y) => ({ ...y, icon: y.icon, itemValue: y })))\n };\n}\n\n@Component({\n template: `\n <div class=\"dbx-list-item-padded dbx-list-two-line-item dbx-firebase-notificationitem-list-view-item\">\n <div class=\"item-left\">\n <span class=\"notificationitem-subject\">{{ subject }}</span>\n <span class=\"notificationitem-message item-details\">{{ message | cutText: 90 }}</span>\n <span class=\"notificationitem-date item-details-footnote\">{{ date | date: 'medium' }}</span>\n </div>\n </div>\n `,\n imports: [DatePipe, CutTextPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseNotificationItemListViewItemComponent extends AbstractDbxValueListViewItemComponent<NotificationItem> {\n readonly dbxFirebaseNotificationTemplateService = inject(DbxFirebaseNotificationTemplateService);\n readonly pairGetter = cachedGetter(() => this.dbxFirebaseNotificationTemplateService.notificationItemSubjectMessagePairForNotificationSummaryItem(this.itemValue));\n\n get subject() {\n return this.pairGetter().subject;\n }\n\n get message() {\n return this.pairGetter().message;\n }\n\n get date() {\n return this.pairGetter().date;\n }\n}\n","import { DatePipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Component({\n selector: 'dbx-firebase-notificationitem-content',\n templateUrl: './notificationitem.content.component.html',\n styleUrls: ['./notificationitem.content.scss'],\n imports: [DatePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseNotificationItemContentComponent {\n readonly subject = input<Maybe<string>>();\n readonly message = input<Maybe<string>>();\n readonly date = input<Maybe<Date>>();\n}\n","<div class=\"dbx-firebase-notificationitem-content\">\n <div class=\"notificationitem-header dbx-pb2\">\n @if (subject()) {\n <div class=\"notificationitem-subject dbx-pb1\">{{ subject() }}</div>\n }\n <ng-content select=\"[header]\"></ng-content>\n @if (date()) {\n <div class=\"notificationitem-date dbx-label dbx-small\">{{ date() | date: 'medium' }}</div>\n }\n </div>\n <ng-content select=\"[premessage]\"></ng-content>\n <div class=\"notificationitem-message\">{{ message() }}</div>\n <ng-content></ng-content>\n</div>\n","import { type DbxWidgetEntry, type DbxWidgetType } from '@dereekb/dbx-web';\nimport { type NotificationTemplateType, type NotificationTemplateTypeInfo } from '@dereekb/firebase';\n\n/**\n * Prefix used by all widgets.\n *\n * Does not include the \"-\" between the prefix and the template type returned by dbxWidgetTypeForNotificationTemplateType().\n */\nexport const FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX: string = 'dbxFirebaseNotificationItem';\n\nexport const DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE: DbxWidgetType = `${FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX}Default`;\n\nexport function dbxWidgetTypeForNotificationTemplateType(notificationTemplateType: NotificationTemplateType): DbxWidgetType {\n return `${FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE_PREFIX}-${notificationTemplateType}`;\n}\n\n/**\n * Used for registering a DbxFirebaseNotificationItemWidgetEntry.\n *\n * The notificationTemplateType should be known by the app, otherwise a warning may be thrown.\n */\nexport interface DbxFirebaseNotificationItemWidgetEntryRegistration extends Omit<DbxWidgetEntry, 'type'> {\n readonly notificationTemplateType: NotificationTemplateType;\n}\n\n/**\n * A widget used for DbxFirebaseNotificationItem views.\n */\nexport interface DbxFirebaseNotificationItemWidgetEntry {\n readonly notificationTemplateType: NotificationTemplateType;\n readonly notificationTemplateTypeInfo: NotificationTemplateTypeInfo;\n readonly widget: DbxWidgetEntry;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { NotificationTemplateType } from '@dereekb/firebase';\nimport { DbxFirebaseNotificationTemplateService } from './notification.template.service';\nimport { DbxWidgetEntry, DbxWidgetService } from '@dereekb/dbx-web';\nimport { DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE, DbxFirebaseNotificationItemWidgetEntry, DbxFirebaseNotificationItemWidgetEntryRegistration, dbxWidgetTypeForNotificationTemplateType } from './notificationitem.widget';\n\n/**\n * Service used for registering widgets used for notification items.\n */\n@Injectable()\nexport class DbxFirebaseNotificationItemWidgetService {\n readonly dbxWidgetService = inject(DbxWidgetService);\n readonly dbxFirebaseNotificationTemplateService = inject(DbxFirebaseNotificationTemplateService);\n\n private readonly _entries = new Map<NotificationTemplateType, DbxFirebaseNotificationItemWidgetEntry>();\n\n /**\n * Used to register a item widget. If widget for the given type is already registered, this will override it by default.\n *\n * @param provider\n * @param override\n */\n register(provider: DbxFirebaseNotificationItemWidgetEntryRegistration, override: boolean = true): boolean {\n const { componentClass, notificationTemplateType } = provider;\n const widgetType = dbxWidgetTypeForNotificationTemplateType(notificationTemplateType);\n\n if (override || !this._entries.has(notificationTemplateType)) {\n const notificationTemplateTypeInfo = this.dbxFirebaseNotificationTemplateService.appNotificationTemplateTypeInfoRecordService.appNotificationTemplateTypeInfoRecord[notificationTemplateType];\n\n if (!notificationTemplateTypeInfo) {\n console.warn(`DbxFirebaseNotificationItemWidgetService.register(): No known template type info was found for notification type: ${notificationTemplateType}. The entry is not being registered.`);\n } else {\n const entry: DbxFirebaseNotificationItemWidgetEntry = {\n notificationTemplateType,\n notificationTemplateTypeInfo,\n widget: {\n type: widgetType,\n componentClass\n }\n };\n\n this._entries.set(notificationTemplateType, entry);\n this.dbxWidgetService.register(entry.widget, override);\n return true;\n }\n }\n\n return false;\n }\n\n registerDefaultWidget(entry: Omit<DbxWidgetEntry, 'type'>, override: boolean = true): boolean {\n return this.dbxWidgetService.register(\n {\n ...entry,\n type: DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE\n },\n override\n );\n }\n}\n","import { ChangeDetectionStrategy, Component, input, computed } from '@angular/core';\nimport { DbxWidgetViewComponentConfig, DbxWidgetViewComponent } from '@dereekb/dbx-web';\nimport { NotificationItem, NotificationItemMetadata } from '@dereekb/firebase';\nimport { Maybe } from '@dereekb/util';\nimport { DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE, dbxWidgetTypeForNotificationTemplateType } from '../service';\n\n@Component({\n selector: 'dbx-firebase-notificationitem-view',\n template: `\n <dbx-widget-view [config]=\"configSignal()\"></dbx-widget-view>\n `,\n standalone: true,\n imports: [DbxWidgetViewComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseNotificationItemViewComponent<D extends NotificationItemMetadata = {}> {\n readonly item = input<Maybe<NotificationItem<D>>>();\n\n readonly configSignal = computed(() => {\n const data = this.item();\n\n let config: Maybe<DbxWidgetViewComponentConfig> = undefined;\n\n if (data) {\n const type = dbxWidgetTypeForNotificationTemplateType(data.t);\n\n config = {\n type,\n data,\n defaultType: DEFAULT_FIREBASE_NOTIFICATION_ITEM_WIDGET_TYPE\n };\n }\n\n return config;\n });\n}\n","import { Directive } from '@angular/core';\nimport { AbstractDbxWidgetComponent } from '@dereekb/dbx-web';\nimport { NotificationItem, NotificationItemMetadata } from '@dereekb/firebase';\n\n@Directive()\nexport abstract class AbstractDbxFirebaseNotificationItemWidgetComponent<D extends NotificationItemMetadata = {}> extends AbstractDbxWidgetComponent<NotificationItem<D>> {\n get notificationItem(): NotificationItem<D> {\n return this.data;\n }\n}\n","import { Component } from '@angular/core';\nimport { AbstractDbxFirebaseNotificationItemWidgetComponent } from './notificationitem.view.directive';\nimport { DbxFirebaseNotificationItemContentComponent } from './notificationitem.content.component';\n\n@Component({\n selector: 'dbx-firebase-notificationitem-view-default',\n template: '<dbx-firebase-notificationitem-content [subject]=\"subject\" [message]=\"message\" [date]=\"date\"></dbx-firebase-notificationitem-content>',\n imports: [DbxFirebaseNotificationItemContentComponent],\n standalone: true\n})\nexport class DbxFirebaseNotificationItemDefaultViewComponent extends AbstractDbxFirebaseNotificationItemWidgetComponent {\n get subject() {\n return this.notificationItem.s;\n }\n\n get message() {\n return this.notificationItem.g;\n }\n\n get date() {\n return this.notificationItem.cat;\n }\n}\n","import { ChangeDetectionStrategy, Component, ElementRef } from '@angular/core';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { AbstractPopoverDirective, AnchorForValueFunction, DbxListEmptyContentComponent, DbxListItemAnchorModifierDirective, DbxListModifierModule, DbxPopoverInteractionModule, DbxPopoverKey, DbxPopoverService } from '@dereekb/dbx-web';\nimport { type Maybe } from '@dereekb/util';\nimport { NotificationItem } from '@dereekb/firebase';\nimport { Observable } from 'rxjs';\nimport { LoadingState } from '@dereekb/rxjs';\nimport { DbxFirebaseNotificationItemListComponent } from '../component';\n\nexport interface DbxFirebaseNotificationItemStorePopoverParams {\n /**\n * Custom icon\n *\n * Defaults to \"history\"\n */\n readonly icon?: string;\n /**\n * Custom header text\n *\n * Defaults to \"History\"\n */\n readonly header?: string;\n /**\n * Custom empty text when no items exist.\n */\n readonly emptyText?: string;\n /**\n * Origin to add the popover to.\n */\n readonly origin: ElementRef;\n /**\n * Items loading state.\n */\n readonly notificationItemsLoadingState$: Observable<LoadingState<NotificationItem[]>>;\n /**\n * Anchor\n */\n readonly makeNotificationItemAnchor?: Maybe<AnchorForValueFunction<NotificationItem>>;\n}\n\nexport const DEFAULT_DBX_FIREBASE_NOTIFICATION_ITEM_STORE_POPOVER_KEY = 'notification-item-store-notifications';\n\n@Component({\n templateUrl: './notification.item.store.popover.component.html',\n imports: [DbxPopoverInteractionModule, DbxListModifierModule, DbxFirebaseNotificationItemListComponent, DbxListEmptyContentComponent, DbxListItemAnchorModifierDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseNotificationItemStorePopoverComponent extends AbstractPopoverDirective<unknown, DbxFirebaseNotificationItemStorePopoverParams> {\n static openPopover(popupService: DbxPopoverService, { origin, header, icon, emptyText, makeNotificationItemAnchor, notificationItemsLoadingState$ }: DbxFirebaseNotificationItemStorePopoverParams, popoverKey?: DbxPopoverKey): NgPopoverRef {\n return popupService.open({\n key: popoverKey ?? DEFAULT_DBX_FIREBASE_NOTIFICATION_ITEM_STORE_POPOVER_KEY,\n origin,\n componentClass: DbxFirebaseNotificationItemStorePopoverComponent,\n data: {\n header,\n icon,\n emptyText,\n notificationItemsLoadingState$,\n makeNotificationItemAnchor\n }\n });\n }\n\n readonly params = this.popover.data as DbxFirebaseNotificationItemStorePopoverParams;\n readonly icon = this.params.icon ?? 'notifications';\n readonly header = this.params.header ?? 'Notifications';\n readonly emptyText = this.params.header ?? 'There are no notifications.';\n readonly makeNotificationItemAnchor = this.params.makeNotificationItemAnchor;\n readonly notificationItemsLoadingState$ = this.params.notificationItemsLoadingState$;\n}\n","<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\"></dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-firebase-notificationitem-list [state]=\"notificationItemsLoadingState$\" dbxListItemModifier [dbxListItemAnchorModifier]=\"makeNotificationItemAnchor\">\n <dbx-list-empty-content empty>\n <p>{{ emptyText }}</p>\n </dbx-list-empty-content>\n </dbx-firebase-notificationitem-list>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n","import { Injectable } from '@angular/core';\nimport { NotificationId, NotificationItem } from '@dereekb/firebase';\nimport { Maybe } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { combineLatest, distinctUntilChanged, map, shareReplay } from 'rxjs';\n\nexport interface DbxFirebaseNotificationItemStoreState {\n /**\n * The NotificationSummary to pull items from\n */\n readonly items: NotificationItem[];\n /**\n * The currently selected id\n */\n readonly selectedId: Maybe<NotificationId>;\n}\n\n/**\n * Store used for selecting a specific NotificationItem from a list of notification items.\n */\n@Injectable()\nexport class DbxFirebaseNotificationItemStore extends ComponentStore<DbxFirebaseNotificationItemStoreState> {\n constructor() {\n super({\n items: [],\n selectedId: undefined\n });\n }\n\n // MARK: Accessors\n readonly items$ = this.select((state) => state.items);\n\n readonly selectedId$ = this.select((state) => state.selectedId).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly selectedItem$ = combineLatest([this.items$, this.selectedId$]).pipe(\n map(([items, selectedId]) => {\n return items.find((item) => item.id === selectedId);\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n readonly setItems = this.updater((state, items: NotificationItem[]) => ({ ...state, items }));\n readonly setSelectedId = this.updater((state, selectedId: Maybe<NotificationId>) => ({ ...state, selectedId }));\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, inject, input, viewChild } from '@angular/core';\nimport { AbstractPopoverRefDirective, DbxIconButtonComponent, DbxPopoverService } from '@dereekb/dbx-web';\nimport { NgPopoverRef } from 'ng-overlay-container';\nimport { DbxFirebaseNotificationItemStorePopoverComponent, DbxFirebaseNotificationItemStorePopoverParams } from './notification.item.store.popover.component';\nimport { DbxFirebaseNotificationItemStore } from '../store/notification.item.store';\nimport { loadingStateFromObs } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\nexport type DbxFirebaseNotificationItemStorePopoverButtonConfig = DbxFirebaseNotificationItemStorePopoverParams;\n\n@Component({\n selector: 'dbx-firebase-notification-item-store-popover-button',\n template: `\n <dbx-icon-button #button (buttonClick)=\"showNotificationsPopover()\" icon=\"notifications\"></dbx-icon-button>\n `,\n standalone: true,\n imports: [DbxIconButtonComponent],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DbxFirebaseNotificationItemStorePopoverButtonComponent extends AbstractPopoverRefDirective<unknown, unknown> {\n private readonly _dbxPopoverService = inject(DbxPopoverService);\n private readonly _dbxFirebaseNotificationItemStore = inject(DbxFirebaseNotificationItemStore, { optional: true });\n\n readonly buttonElement = viewChild<string, Maybe<ElementRef>>('button', { read: ElementRef });\n readonly config = input<Maybe<Partial<DbxFirebaseNotificationItemStorePopoverButtonConfig>>>();\n\n showNotificationsPopover(): void {\n const origin = this.buttonElement()?.nativeElement;\n this.showPopover(origin);\n }\n\n protected override _makePopoverRef(origin?: ElementRef): NgPopoverRef<unknown, unknown> {\n const config = this.config();\n const notificationItemsLoadingState$ = config?.notificationItemsLoadingState$ ?? (this._dbxFirebaseNotificationItemStore != null ? loadingStateFromObs(this._dbxFirebaseNotificationItemStore.items$) : undefined);\n\n if (!origin) {\n throw new Error('Missing origin.');\n } else if (!notificationItemsLoadingState$) {\n throw new Error('Missing notificationItemsLoadingState$.');\n }\n\n return DbxFirebaseNotificationItemStorePopoverComponent.openPopover(this._dbxPopoverService, {\n origin,\n notificationItemsLoadingState$,\n ...config\n });\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { isSameDate } from '@dereekb/date';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationFunctions, NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs';\n\n@Injectable()\nexport class NotificationBoxDocumentStore extends AbstractDbxFirebaseDocumentStore<NotificationBox, NotificationBoxDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationBoxCollection });\n }\n\n readonly createdAt$ = this.data$.pipe(\n map((x) => x.cat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly recipients$ = this.data$.pipe(\n map((x) => x.r),\n shareReplay(1)\n );\n\n readonly updateNotificationBox = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationBox.updateNotificationBox.update);\n readonly updateNotificationBoxRecipient = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationBox.updateNotificationBox.recipient);\n}\n","import { Injectable, inject } from '@angular/core';\nimport { firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store/store.document.crud';\nimport { AbstractDbxFirebaseDocumentWithParentStore } from '../../../model/modules/store/store.subcollection.document';\nimport { NotificationBoxDocumentStore } from './notificationbox.document.store';\nimport { Notification, NotificationBox, NotificationBoxDocument, NotificationDocument, NotificationFirestoreCollections, NotificationFunctions } from '@dereekb/firebase';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs';\nimport { isSameDate } from '@dereekb/date';\n\n@Injectable()\nexport class NotificationDocumentStore extends AbstractDbxFirebaseDocumentWithParentStore<Notification, NotificationBox, NotificationDocument, NotificationBoxDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ collectionFactory: inject(NotificationFirestoreCollections).notificationCollectionFactory, firestoreCollectionLike: inject(NotificationFirestoreCollections).notificationCollectionGroup });\n const parent = inject(NotificationBoxDocumentStore, { optional: true });\n\n if (parent) {\n this.setParentStore(parent);\n }\n }\n\n readonly createdAt$ = this.data$.pipe(\n map((x) => x.cat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly nextSendAt$ = this.data$.pipe(\n map((x) => x.sat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly sendType$ = this.data$.pipe(\n map((x) => x.st),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly sendAttemptsCount$ = this.data$.pipe(\n map((x) => x.a),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isUnique$ = this.data$.pipe(\n map((x) => x.ut),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly sendNotification = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notification.updateNotification.send);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store/store.document.directive';\nimport { type Notification, type NotificationDocument } from '@dereekb/firebase';\nimport { NotificationDocumentStore } from './notification.document.store';\n\n@Directive({\n selector: '[dbxFirebaseNotificationDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationDocumentStoreDirective, NotificationDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<Notification, NotificationDocument, NotificationDocumentStore> {\n constructor() {\n super(inject(NotificationDocumentStore));\n }\n}\n","import { Optional, Injectable , inject } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionWithParentStore } from '../../../model/modules/store/store.subcollection';\nimport { NotificationFirestoreCollections, type NotificationBox, type NotificationBoxDocument, type Notification, type NotificationDocument } from '@dereekb/firebase';\nimport { NotificationBoxDocumentStore } from './notificationbox.document.store';\n\n@Injectable()\nexport class NotificationCollectionStore extends AbstractDbxFirebaseCollectionWithParentStore<Notification, NotificationBox, NotificationDocument, NotificationBoxDocument> {\n constructor(@Optional() parent: NotificationBoxDocumentStore) {\n super({ collectionFactory: inject(NotificationFirestoreCollections).notificationCollectionFactory, collectionGroup: inject(NotificationFirestoreCollections).notificationCollectionGroup });\n\n if (parent) {\n this.setParentStore(parent);\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { type NotificationBox, type NotificationBoxDocument, type Notification, type NotificationDocument } from '@dereekb/firebase';\nimport { NotificationCollectionStore } from './notification.collection.store';\nimport { DbxFirebaseCollectionWithParentStoreDirective, provideDbxFirebaseCollectionWithParentStoreDirective } from '../../../model/modules/store/store.subcollection.directive';\n\n@Directive({\n selector: '[dbxFirebaseNotificationCollection]',\n providers: provideDbxFirebaseCollectionWithParentStoreDirective(DbxFirebaseNotificationCollectionStoreDirective, NotificationCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationCollectionStoreDirective extends DbxFirebaseCollectionWithParentStoreDirective<Notification, NotificationBox, NotificationDocument, NotificationBoxDocument, NotificationCollectionStore> {\n constructor() {\n super(inject(NotificationCollectionStore));\n }\n}\n","import { inject, Directive } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { NotificationBoxDocumentStore } from './notificationbox.document.store';\nimport { NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationBoxDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationBoxDocumentStoreDirective, NotificationBoxDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationBoxDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<NotificationBox, NotificationBoxDocument, NotificationBoxDocumentStore> {\n constructor() {\n super(inject(NotificationBoxDocumentStore));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationBoxCollectionStore extends AbstractDbxFirebaseCollectionStore<NotificationBox, NotificationBoxDocument> {\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationBoxCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { NotificationBoxCollectionStore } from './notificationbox.collection.store';\nimport { NotificationBox, NotificationBoxDocument } from '@dereekb/firebase';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\n\n@Directive({\n selector: '[dbxFirebaseNotificationBoxCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseNotificationBoxCollectionStoreDirective, NotificationBoxCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationBoxCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<NotificationBox, NotificationBoxDocument, NotificationBoxCollectionStore> {\n constructor() {\n super(inject(NotificationBoxCollectionStore));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationSummary, NotificationSummaryDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationSummaryCollectionStore extends AbstractDbxFirebaseCollectionStore<NotificationSummary, NotificationSummaryDocument> {\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationSummaryCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\nimport { NotificationSummaryCollectionStore } from './notificationsummary.collection.store';\nimport { NotificationSummary, NotificationSummaryDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationSummaryCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseNotificationSummaryCollectionStoreDirective, NotificationSummaryCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationSummaryCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<NotificationSummary, NotificationSummaryDocument, NotificationSummaryCollectionStore> {\n constructor() {\n super(inject(NotificationSummaryCollectionStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { isSameDate } from '@dereekb/date';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationFunctions, NotificationItem, NotificationItemMetadata, NotificationSummary, NotificationSummaryDocument, UnreadNotificationItemsResult, unreadNotificationItems } from '@dereekb/firebase';\nimport { LoadingState, ObservableOrValue, asObservable, mapLoadingStateValueWithOperator } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\nimport { map, shareReplay, distinctUntilChanged, Observable, combineLatest } from 'rxjs';\n\n@Injectable()\nexport class NotificationSummaryDocumentStore extends AbstractDbxFirebaseDocumentStore<NotificationSummary, NotificationSummaryDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationSummaryCollection });\n }\n\n readonly notificationItemsLoadingState$: Observable<LoadingState<NotificationItem<any>[]>> = this.dataLoadingState$.pipe(\n mapLoadingStateValueWithOperator(map((x) => [...x.n].reverse())), // n is sorted in ascending order\n shareReplay(1)\n );\n\n readonly createdAt$ = this.data$.pipe(\n map((x) => x.cat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly lastReadAt$ = this.data$.pipe(\n map((x) => x.rat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly lastUpdateAt$ = this.data$.pipe(\n map((x) => x.lat),\n distinctUntilChanged(isSameDate),\n shareReplay(1)\n );\n\n readonly notificationItems$ = this.data$.pipe(\n map((x) => [...x.n].reverse()), // n is sorted in ascending order\n shareReplay(1)\n );\n\n readonly needsSync$ = this.data$.pipe(\n map((x) => x.s),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n notificationItemsLoadingState<D extends NotificationItemMetadata = {}>(): Observable<LoadingState<NotificationItem<D>[]>> {\n return this.notificationItemsLoadingState$;\n }\n\n unreadNotificationItems<D extends NotificationItemMetadata = {}>(checkLastReadIfCreatedBeforeObs?: ObservableOrValue<Maybe<Date>>): Observable<UnreadNotificationItemsResult<D>> {\n return combineLatest([asObservable(checkLastReadIfCreatedBeforeObs), this.notificationItems$ as Observable<NotificationItem<D>[]>]).pipe(map(([c, items]) => unreadNotificationItems<D>(items, c)));\n }\n\n readonly updateNotificationSummary = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationSummary.updateNotificationSummary.update);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { NotificationSummaryDocumentStore } from './notificationsummary.document.store';\nimport { NotificationSummary, NotificationSummaryDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationSummaryDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationSummaryDocumentStoreDirective, NotificationSummaryDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationSummaryDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<NotificationSummary, NotificationSummaryDocument, NotificationSummaryDocumentStore> {\n constructor() {\n super(inject(NotificationSummaryDocumentStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationUserCollectionStore extends AbstractDbxFirebaseCollectionStore<NotificationUser, NotificationUserDocument> {\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationUserCollection });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\nimport { NotificationUserCollectionStore } from './notificationuser.collection.store';\nimport { NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationUserCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseNotificationUserCollectionStoreDirective, NotificationUserCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationUserCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<NotificationUser, NotificationUserDocument, NotificationUserCollectionStore> {\n constructor() {\n super(inject(NotificationUserCollectionStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { NotificationFirestoreCollections, NotificationFunctions, NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Injectable()\nexport class NotificationUserDocumentStore extends AbstractDbxFirebaseDocumentStore<NotificationUser, NotificationUserDocument> {\n readonly notificationFunctions = inject(NotificationFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(NotificationFirestoreCollections).notificationUserCollection });\n }\n\n readonly updateNotificationUser = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationUser.updateNotificationUser.update);\n readonly resyncNotificationUser = firebaseDocumentStoreUpdateFunction(this, this.notificationFunctions.notificationUser.updateNotificationUser.resync);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { NotificationUserDocumentStore } from './notificationuser.document.store';\nimport { NotificationUser, NotificationUserDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseNotificationUserDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseNotificationUserDocumentStoreDirective, NotificationUserDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseNotificationUserDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<NotificationUser, NotificationUserDocument, NotificationUserDocumentStore> {\n constructor() {\n super(inject(NotificationUserDocumentStore));\n }\n}\n","import { inject, type EnvironmentProviders, makeEnvironmentProviders, provideAppInitializer, type Provider } from '@angular/core';\nimport { AppNotificationTemplateTypeInfoRecordService } from '@dereekb/firebase';\nimport { DbxFirebaseNotificationTemplateService } from './service/notification.template.service';\nimport { DbxFirebaseNotificationItemWidgetService } from './service/notificationitem.widget.service';\nimport { DbxFirebaseNotificationItemDefaultViewComponent } from './component/notificationitem.view.default.component';\nimport { type DbxWidgetEntry } from '@dereekb/dbx-web';\n\n/**\n * Configuration for DbxFirebaseNotificationModule.\n */\nexport interface ProvideDbxFirebaseNotificationsConfig {\n readonly appNotificationTemplateTypeInfoRecordService: AppNotificationTemplateTypeInfoRecordService;\n /**\n * The default notification item widget to register with the DbxFirebaseNotificationItemWidgetService.\n *\n * If not defined, will automatically register the default widget.\n *\n * If false, will not register anything.\n */\n readonly defaultNotificationItemWidget?: DbxWidgetEntry['componentClass'] | false;\n}\n\n/**\n * Creates EnvironmentProviders that provides a DbxFirebaseNotificationTemplateService, DbxFirebaseNotificationItemWidgetService and AppNotificationTemplateTypeInfoRecordService.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseNotifications(config: ProvideDbxFirebaseNotificationsConfig): EnvironmentProviders {\n const { appNotificationTemplateTypeInfoRecordService } = config;\n\n const providers: (EnvironmentProviders | Provider)[] = [\n {\n provide: AppNotificationTemplateTypeInfoRecordService,\n useValue: appNotificationTemplateTypeInfoRecordService\n },\n {\n provide: DbxFirebaseNotificationItemWidgetService,\n useClass: DbxFirebaseNotificationItemWidgetService\n },\n {\n provide: DbxFirebaseNotificationTemplateService,\n useClass: DbxFirebaseNotificationTemplateService\n },\n // service initialization\n provideAppInitializer(() => {\n const dbxFirebaseNotificationItemWidgetService = inject(DbxFirebaseNotificationItemWidgetService);\n\n // register the default widget\n if (config.defaultNotificationItemWidget !== false) {\n const widget = config.defaultNotificationItemWidget ?? DbxFirebaseNotificationItemDefaultViewComponent;\n\n dbxFirebaseNotificationItemWidgetService.registerDefaultWidget({\n componentClass: widget\n });\n }\n })\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { StorageAccessor } from '@dereekb/dbx-core';\nimport { map, mergeMap, catchError, Observable, of, switchMap, first } from 'rxjs';\nimport { FirebaseAuthUserId, firestoreModelId, FirestoreModelIdInput, StorageFileId, StorageFileSignedDownloadUrl } from '@dereekb/firebase';\nimport { DbxFirebaseAuthService } from '../../../auth/service/firebase.auth.service';\nimport { ContentTypeMimeType, Maybe, splitJoinRemainder, UnixDateTimeSecondsNumber } from '@dereekb/util';\n\nexport interface DbxFirebaseStorageFileDownloadUrlPair {\n readonly id: StorageFileId;\n readonly downloadUrl: StorageFileSignedDownloadUrl;\n /**\n * Mime type, if available.\n */\n readonly mimeType?: Maybe<ContentTypeMimeType>;\n /**\n * Expiration in seconds since epoch.\n */\n readonly expiresAt: UnixDateTimeSecondsNumber;\n}\n\nexport type DbxFirebaseStorageFileDownloadUrlPairString = `${UnixDateTimeSecondsNumber}_${StorageFileSignedDownloadUrl}`;\n\nexport type DbxFirebaseStorageFileDownloadUrlPairsRecord = Record<StorageFileId, DbxFirebaseStorageFileDownloadUrlPairString>;\n\nexport interface DbxFirebaseStorageFileDownloadUserCache {\n readonly uid: FirebaseAuthUserId;\n readonly pairs: DbxFirebaseStorageFileDownloadUrlPairsRecord;\n}\n\n/**\n * Token that corresponds to a StorageAccessor<DbxFirebaseStorageFileDownloadUserCache> that is used by DbxModelViewTrackerStorage.\n */\nexport const DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN = new InjectionToken('DbxFirebaseStorageFileDownloadStorageAccessor');\n\n/**\n * Used for managing DbxModelViewTrackerEvent storage.\n */\n@Injectable()\nexport class DbxFirebaseStorageFileDownloadStorage {\n static readonly DEFAULT_MAX_DOWNLOAD_URLS = 100;\n\n readonly authService = inject(DbxFirebaseAuthService);\n readonly storageAccessor = inject<StorageAccessor<DbxFirebaseStorageFileDownloadUserCache>>(DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN);\n\n addDownloadUrl({ id, downloadUrl, expiresAt, mimeType }: DbxFirebaseStorageFileDownloadUrlPair): Observable<void> {\n return this.getCurrentUserDownloadCache().pipe(\n mergeMap((cache) => {\n const { uid, pairs: currentPairs } = cache;\n\n const storageKey = this.getStorageKeyForUid(uid);\n const pairs: DbxFirebaseStorageFileDownloadUrlPairsRecord = {\n ...currentPairs,\n [id]: `${expiresAt}_${mimeType}_${downloadUrl}`\n };\n\n return this.storageAccessor.set(storageKey, {\n uid,\n pairs\n });\n }),\n first()\n );\n }\n\n /**\n * Returns the cached download URL pair for the given key.\n *\n * The pair may be expired.\n *\n * @param key\n * @returns\n */\n getDownloadUrlPair(input: FirestoreModelIdInput): Observable<DbxFirebaseStorageFileDownloadUrlPair | undefined> {\n const id = firestoreModelId(input);\n return this.authService.uid$.pipe(\n switchMap((uid) => {\n return this.getUserDownloadCache(uid).pipe(\n map((cache) => {\n const pair = cache?.pairs[id];\n\n let result: DbxFirebaseStorageFileDownloadUrlPair | undefined;\n\n if (pair) {\n const [expiresAt, mimeType, downloadUrl] = splitJoinRemainder(pair, '_', 3);\n\n result = {\n id,\n downloadUrl,\n expiresAt: Number(expiresAt),\n mimeType\n };\n }\n\n return result;\n })\n );\n }),\n first()\n );\n }\n\n getAllDownloadUrlPairsRecord(uid: FirebaseAuthUserId): Observable<DbxFirebaseStorageFileDownloadUrlPairsRecord> {\n return this.getUserDownloadCache(uid).pipe(map((x) => x.pairs));\n }\n\n getCurrentUserDownloadCache(): Observable<DbxFirebaseStorageFileDownloadUserCache> {\n return this.authService.uid$.pipe(switchMap((uid) => this.getUserDownloadCache(uid)));\n }\n\n getUserDownloadCache(uid: FirebaseAuthUserId): Observable<DbxFirebaseStorageFileDownloadUserCache> {\n const storageKey = this.getStorageKeyForUid(uid);\n return this._getUserDownloadCacheForStorageKey(storageKey, uid);\n }\n\n clearCurrentUserDownloadCache(): Observable<void> {\n return this.authService.uid$.pipe(switchMap((uid) => this.clearUserDownloadCache(uid)));\n }\n\n clearUserDownloadCache(uid: FirebaseAuthUserId): Observable<void> {\n const storageKey = this.getStorageKeyForUid(uid);\n return this.storageAccessor.remove(storageKey);\n }\n\n private _getUserDownloadCacheForStorageKey(storageKey: string, uid: FirebaseAuthUserId): Observable<DbxFirebaseStorageFileDownloadUserCache> {\n return this.storageAccessor.get(storageKey).pipe(\n catchError((e) => {\n return of(undefined);\n }),\n map((result) => result ?? { uid, pairs: {} })\n );\n }\n\n getStorageKeyForUid(uid: FirebaseAuthUserId): string {\n const storageKey = `sf_dl_cache_${uid}`;\n return storageKey;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { StorageFileFunctions, DownloadStorageFileParams, StorageFileKey, StorageFileId, firestoreModelId, firestoreModelKey, storageFileIdentity, DownloadStorageFileResult } from '@dereekb/firebase';\nimport { addMilliseconds, Maybe, Milliseconds, MS_IN_DAY, MS_IN_HOUR, MS_IN_MINUTE, Seconds, SECONDS_IN_MINUTE, unixDateTimeSecondsNumberForNow, unixDateTimeSecondsNumberFromDate } from '@dereekb/util';\nimport { DbxFirebaseStorageFileDownloadStorage, DbxFirebaseStorageFileDownloadUrlPair } from './storagefile.download.storage.service';\nimport { first, firstValueFrom, from, interval, map, Observable, of, shareReplay, startWith, switchMap, tap } from 'rxjs';\nimport { LoadingState, throwErrorFromLoadingStateError, valueFromFinishedLoadingState } from '@dereekb/rxjs';\n\nexport type DbxFirebaseStorageFileDownloadServiceCustomSourceDownloadFunction = (params: DownloadStorageFileParams, storageFileId: StorageFileId) => Promise<DownloadStorageFileResult>;\n\n/**\n * Used as a custom source for downloading StorageFiles.\n */\nexport interface DbxFirebaseStorageFileDownloadServiceCustomSource {\n /**\n * Retrieves the download result for the StorageFile using the input parameters.\n *\n * @param storageFileId\n * @returns\n */\n downloadStorageFileResult: DbxFirebaseStorageFileDownloadServiceCustomSourceDownloadFunction;\n}\n\nexport function dbxFirebaseStorageFileDownloadServiceCustomSourceFromObs(obsForInput: (params: DownloadStorageFileParams, storageFileId: StorageFileId) => Observable<LoadingState<DownloadStorageFileResult>>): DbxFirebaseStorageFileDownloadServiceCustomSource {\n return {\n downloadStorageFileResult: (params: DownloadStorageFileParams, storageFileId: StorageFileId) => firstValueFrom(obsForInput(params, storageFileId).pipe(throwErrorFromLoadingStateError(), valueFromFinishedLoadingState())) as Promise<DownloadStorageFileResult>\n };\n}\n\n/**\n * Service used for retrieving download links for StorageFiles.\n */\n@Injectable()\nexport class DbxFirebaseStorageFileDownloadService {\n /**\n * Expiration duration for cached download URLs.\n */\n protected _expiresAfterTime: Milliseconds = MS_IN_HOUR * 12;\n\n /**\n * When reading cached values, this buffer is added to the expiration time to prevent the URL from expiring while it is being used.\n */\n protected _expiresAfterTimeBuffer: Seconds = SECONDS_IN_MINUTE * 10;\n\n readonly storageFileFunctions = inject(StorageFileFunctions);\n readonly storageFileDownloadStorage = inject(DbxFirebaseStorageFileDownloadStorage);\n\n // MARK: Config\n getExpiresAfterTime(): number {\n return this._expiresAfterTime;\n }\n\n setExpiresAfterTime(expiresAfter: number): void {\n const maxAllowed = MS_IN_DAY * 20;\n\n if (expiresAfter > maxAllowed) {\n throw new Error(`Expires after time cannot be greater than 20 days.`);\n } else if (expiresAfter < MS_IN_HOUR) {\n throw new Error(`Expires after time cannot be less than 1 hour.`);\n }\n\n this._expiresAfterTime = expiresAfter;\n }\n\n // MARK: Download\n /**\n * Returns an observable that returns the cached download URL pair for the StorageFile, and emits null once it expires.\n *\n * @param storageFileIdOrKey\n * @returns\n */\n getCachedDownloadPairForStorageFile(storageFileIdOrKey: StorageFileId | StorageFileKey): Observable<Maybe<DbxFirebaseStorageFileDownloadUrlPair>> {\n const storageFileId = firestoreModelId(storageFileIdOrKey);\n return this.storageFileDownloadStorage.getDownloadUrlPair(storageFileId).pipe(\n switchMap((pair) => {\n let result: Observable<Maybe<DbxFirebaseStorageFileDownloadUrlPair>>;\n\n if (pair) {\n const expiresAt = pair.expiresAt - this._expiresAfterTimeBuffer;\n\n function pairIfNotExpired(): Maybe<DbxFirebaseStorageFileDownloadUrlPair> {\n const now = unixDateTimeSecondsNumberForNow();\n const isExpired = now > expiresAt;\n return isExpired ? null : pair;\n }\n\n const initialPair = pairIfNotExpired();\n\n if (initialPair) {\n // every minute emit the result again\n result = interval(MS_IN_MINUTE).pipe(\n map(pairIfNotExpired),\n first((x) => x == null), // only emit the first null value\n startWith(initialPair), // send the initial value first\n shareReplay(1)\n );\n } else {\n result = of(null);\n }\n } else {\n result = of(null);\n }\n\n return result;\n })\n );\n }\n\n /**\n * Retrieves the download URL for the StorageFile using the default parameters.\n *\n * These URLs are cached locally to prevent extra/redundant calls to the server.\n *\n * @param storageFileIdOrKey\n * @returns\n */\n downloadPairForStorageFile(storageFileIdOrKey: StorageFileId | StorageFileKey): Observable<DbxFirebaseStorageFileDownloadUrlPair> {\n return this.downloadPairForStorageFileUsingSource(storageFileIdOrKey, undefined);\n }\n\n /**\n * Retrieves the download URL for the StorageFile using the default parameters and pulled from the input source, if applicable.\n *\n * If no source is provided, uses the default internal source.\n *\n * These URLs are cached locally to prevent extra/redundant calls to the server.\n *\n * @param storageFileIdOrKey\n * @returns\n */\n downloadPairForStorageFileUsingSource(storageFileIdOrKey: StorageFileId | StorageFileKey, source: Maybe<DbxFirebaseStorageFileDownloadServiceCustomSource>): Observable<DbxFirebaseStorageFileDownloadUrlPair> {\n const storageFileId = firestoreModelId(storageFileIdOrKey);\n const obs: Observable<DbxFirebaseStorageFileDownloadUrlPair> = this.getCachedDownloadPairForStorageFile(storageFileId).pipe(\n switchMap((cachedPair) => {\n let result: Observable<DbxFirebaseStorageFileDownloadUrlPair>;\n\n const downloadAndCacheResult = () => {\n return from(this._createDownloadPairForStorageFileUsingSource(source, storageFileIdOrKey)).pipe(\n tap((downloadUrlPair) => {\n this.addPairForStorageFileToCache(downloadUrlPair);\n })\n );\n };\n\n if (cachedPair) {\n result = of(cachedPair);\n } else {\n result = downloadAndCacheResult();\n }\n\n return result;\n }),\n first(),\n shareReplay(1)\n );\n\n return obs;\n }\n\n /**\n * Adds the given download URL pair to the cache.\n */\n addPairForStorageFileToCache(downloadUrlPair: DbxFirebaseStorageFileDownloadUrlPair): void {\n this.storageFileDownloadStorage.addDownloadUrl(downloadUrlPair).pipe(first()).subscribe();\n }\n\n /**\n * Creates a new download URL for the StorageFile.\n *\n * @param storageFileIdOrKey\n * @param inputParams\n * @returns\n */\n createDownloadPairForStorageFile(storageFileIdOrKey: StorageFileId | StorageFileKey, inputParams?: Omit<DownloadStorageFileParams, 'key'>): Promise<DbxFirebaseStorageFileDownloadUrlPair> {\n return this._createDownloadPairForStorageFileUsingSource(undefined, storageFileIdOrKey, inputParams);\n }\n\n private _createDownloadPairForStorageFileUsingSource(inputSource: Maybe<DbxFirebaseStorageFileDownloadServiceCustomSource>, storageFileIdOrKey: StorageFileId | StorageFileKey, inputParams?: Omit<DownloadStorageFileParams, 'key'>): Promise<DbxFirebaseStorageFileDownloadUrlPair> {\n const source = inputSource ?? {\n downloadStorageFileResult: (params) => this.storageFileFunctions.storageFile.readStorageFile.download(params)\n };\n\n const storageFileId = firestoreModelId(storageFileIdOrKey);\n const expiresAt = inputParams?.expiresAt ?? addMilliseconds(new Date(), this._expiresAfterTime);\n\n const params: DownloadStorageFileParams = {\n ...inputParams,\n expiresAt,\n key: firestoreModelKey(storageFileIdentity, storageFileId)\n };\n\n return source.downloadStorageFileResult(params, storageFileId).then((x) => {\n return {\n id: storageFileId,\n downloadUrl: x.url,\n mimeType: x.mimeType,\n expiresAt: x.expiresAt ?? unixDateTimeSecondsNumberFromDate(expiresAt)\n };\n });\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, inject, input, output, signal } from '@angular/core';\nimport { DbxActionDialogDirective, DbxActionDialogFunction, DbxActionModule, DbxActionSnackbarErrorDirective, DbxAnchorComponent, DbxButtonComponent, DbxButtonStyle, DbxWebFilePreviewService } from '@dereekb/dbx-web';\nimport { StorageFileDownloadUrl, StorageFileKey } from '@dereekb/firebase';\nimport { ContentTypeMimeType, dateFromDateOrTimeSecondsNumber, DateOrUnixDateTimeSecondsNumber, isPast, Maybe, MS_IN_SECOND } from '@dereekb/util';\nimport { DbxFirebaseStorageFileDownloadService, DbxFirebaseStorageFileDownloadServiceCustomSource } from '../service/storagefile.download.service';\nimport { ClickableAnchor } from '@dereekb/dbx-core';\nimport { MaybeObservableOrValue, maybeValueFromObservableOrValue, WorkInstance, WorkUsingContext } from '@dereekb/rxjs';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, distinctUntilChanged, interval, map, Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { DbxFirebaseStorageFileDownloadUrlPair } from '../service/storagefile.download.storage.service';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { isSameDate } from '@dereekb/date';\n\nexport interface DbxFirebaseStorageFileDownloadDetails {\n readonly downloadUrl: StorageFileDownloadUrl;\n readonly mimeType?: Maybe<ContentTypeMimeType>;\n readonly expiresAt?: Maybe<Date>;\n}\n\n/**\n * Source configuration for the DbxFirebaseStorageFileDownloadButtonComponent.\n */\nexport interface DbxFirebaseStorageFileDownloadButtonSource {\n /**\n * A static StorageFileKey to use.\n */\n readonly storageFileKey?: MaybeObservableOrValue<StorageFileKey>;\n /**\n * Whether or not to pre-load the download url from the source.\n *\n * Defaults to false.\n */\n readonly preload?: Maybe<boolean>;\n /**\n * The expected mime type of the StorageFile to use when previewing.\n */\n readonly storageFileEmbedMimeType?: MaybeObservableOrValue<ContentTypeMimeType | string>;\n /**\n * Custom source to use with the DbxFirebaseStorageFileDownloadService. A more simple alternative to using handleGetDownloadUrl().\n */\n readonly customSource?: Maybe<DbxFirebaseStorageFileDownloadServiceCustomSource>;\n /**\n * Optional custom work to use to get the download URL.\n *\n * If provided, customSource is ignored.\n */\n readonly handleGetDownloadUrl?: Maybe<WorkUsingContext<StorageFileKey, DbxFirebaseStorageFileDownloadUrlPair>>;\n /**\n * Optional custom success handler for the download URL.\n */\n readonly handleGetDownloadUrlSuccess?: (value: DbxFirebaseStorageFileDownloadUrlPair) => void;\n /**\n * Optional custom error handler for the download URL.\n */\n readonly handleGetDownloadUrlError?: (error: unknown) => void;\n /**\n * Called when the download details change.\n */\n readonly downloadDetailsChangeCallback?: Maybe<(downloadDetails: Maybe<DbxFirebaseStorageFileDownloadDetails>) => void>;\n}\n\n/**\n * Configuration for the DbxFirebaseStorageFileDownloadButtonComponent.\n */\nexport interface DbxFirebaseStorageFileDownloadButtonConfig {\n readonly buttonStyle?: Maybe<DbxButtonStyle>;\n readonly previewButtonStyle?: Maybe<DbxButtonStyle>;\n /**\n * Whether or not to show a preview button.\n *\n * Defaults to true.\n */\n readonly showPreviewButton?: Maybe<boolean>;\n readonly icon?: Maybe<string>;\n readonly text?: Maybe<string>;\n readonly downloadReadyIcon?: Maybe<string>;\n readonly downloadReadyText?: Maybe<string>;\n readonly previewIcon?: Maybe<string>;\n readonly previewText?: Maybe<string>;\n /**\n * Optional custom function to open a preview dialog. If not provided, the default preview dialog provided by the DbxWebFilePreviewService will be used.\n *\n * The function can return undefined, in which case the default preview dialog will be used.\n */\n readonly openCustomPreview?: Maybe<(downloadUrl: StorageFileDownloadUrl, embedMimeType?: Maybe<string>) => Maybe<MatDialogRef<any>>>;\n}\n\n@Component({\n selector: 'dbx-firebase-storagefile-download-button',\n template: `\n <dbx-anchor dbxActionAnchor [anchor]=\"anchorSignal()\" dbxAction [dbxActionAutoTrigger]=\"preloadSignal()\" dbxActionSnackbarError [dbxActionDisabled]=\"!storageFileKeySignal()\" [dbxActionValue]=\"storageFileKeySignal()\" [dbxActionHandler]=\"handleGetDownloadUrl\" [dbxActionSuccessHandler]=\"handleGetDownloadUrlSuccess\" [dbxActionErrorHandler]=\"handleGetDownloadUrlError\">\n <dbx-button dbxActionButton [buttonStyle]=\"buttonStyleSignal()\" [icon]=\"iconSignal()\" [text]=\"textSignal()\"></dbx-button>\n </dbx-anchor>\n @if (showPreviewButtonSignal()) {\n <ng-container dbxAction [dbxActionDialog]=\"handleOpenPreviewDialog\" dbxActionHandlerValue>\n <span class=\"dbx-button-spacer\"></span>\n <dbx-button dbxActionButton [buttonStyle]=\"previewButtonStyleSignal()\" [icon]=\"previewIconSignal()\" [text]=\"previewTextSignal()\"></dbx-button>\n </ng-container>\n }\n `,\n imports: [DbxButtonComponent, DbxActionModule, DbxActionSnackbarErrorDirective, DbxActionDialogDirective, DbxAnchorComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxFirebaseStorageFileDownloadButtonComponent {\n readonly matDialog = inject(MatDialog);\n\n readonly dbxWebFilePreviewService = inject(DbxWebFilePreviewService);\n readonly dbxFirebaseStorageFileDownloadService = inject(DbxFirebaseStorageFileDownloadService);\n\n /**\n * The StorageFileKey to set up the download button for.\n */\n readonly storageFileKey = input<Maybe<StorageFileKey>>();\n\n /**\n * The download URL to use for the download button.\n */\n readonly storageFileDownloadUrl = input<Maybe<StorageFileDownloadUrl>>();\n\n /**\n * The MIME type to use the embed component.\n */\n readonly embedMimeType = input<Maybe<ContentTypeMimeType | string>>();\n\n /**\n * Whether or not to show a preview button.\n *\n * Defaults to true.\n */\n readonly showPreviewButton = input<Maybe<boolean>>(true);\n\n /**\n * Whether or not to pre-load the download URL from the source.\n */\n readonly preload = input<Maybe<boolean>>(undefined);\n\n /**\n * Output event emitted when the download details change.\n */\n readonly downloadDetailsChange = output<Maybe<DbxFirebaseStorageFileDownloadDetails>>();\n\n readonly config = input<Maybe<DbxFirebaseStorageFileDownloadButtonConfig>>();\n readonly source = input<Maybe<DbxFirebaseStorageFileDownloadButtonSource>>();\n\n readonly source$ = toObservable(this.source);\n\n readonly configSignal = computed(() => {\n const config = this.config();\n\n const result: DbxFirebaseStorageFileDownloadButtonConfig = {\n buttonStyle: config?.buttonStyle,\n previewButtonStyle: config?.previewButtonStyle,\n icon: config?.icon ?? 'cloud_download',\n text: config?.text ?? 'Start Download',\n downloadReadyIcon: config?.downloadReadyIcon ?? 'download',\n downloadReadyText: config?.downloadReadyText ?? 'Save File',\n previewIcon: config?.previewIcon ?? 'preview',\n previewText: config?.previewText ?? 'View File'\n };\n\n return result;\n });\n\n readonly preloadSignal = computed(() => {\n const preload = this.preload();\n const source = this.source();\n return preload ?? source?.preload ?? false;\n });\n\n readonly downloadUrlSignal = signal<Maybe<StorageFileDownloadUrl>>(undefined);\n readonly downloadMimeTypeSignal = signal<Maybe<ContentTypeMimeType>>(undefined);\n readonly downloadUrlExpiresAtSignal = signal<Maybe<DateOrUnixDateTimeSecondsNumber>>(undefined);\n\n readonly storageFileKeyFromInput$ = toObservable(this.storageFileKey).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly storageFileKeyFromSource$: Observable<Maybe<StorageFileKey>> = this.source$.pipe(\n map((source) => source?.storageFileKey),\n maybeValueFromObservableOrValue(),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly storageFileKey$: Observable<Maybe<StorageFileKey>> = combineLatest([this.storageFileKeyFromInput$, this.storageFileKeyFromSource$]).pipe(\n map(([storageFileKeyFromInput, storageFileKeyFromSource]) => {\n return storageFileKeyFromInput ?? storageFileKeyFromSource;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly storageFileKeySignal = toSignal(this.storageFileKey$);\n\n readonly hasDownloadUrlSignal = computed(() => Boolean(this.downloadUrlSignal()));\n\n readonly buttonStyleSignal = computed(() => {\n const config = this.configSignal();\n\n const result: DbxButtonStyle = {\n type: 'raised',\n ...config.buttonStyle\n };\n\n return result;\n });\n\n readonly previewButtonStyleSignal = computed(() => {\n const config = this.configSignal();\n\n const result: DbxButtonStyle = {\n type: 'raised',\n ...config.previewButtonStyle\n };\n\n return result;\n });\n\n readonly iconSignal = computed(() => {\n const config = this.configSignal();\n const hasDownloadUrl = this.hasDownloadUrlSignal();\n return hasDownloadUrl ? (config.downloadReadyIcon ?? config.icon) : config.icon;\n });\n\n readonly textSignal = computed(() => {\n const config = this.configSignal();\n const hasDownloadUrl = this.hasDownloadUrlSignal();\n return hasDownloadUrl ? (config.downloadReadyText ?? config.text) : config.text;\n });\n\n readonly previewIconSignal = computed(() => {\n const config = this.configSignal();\n return config.previewIcon;\n });\n\n readonly previewTextSignal = computed(() => {\n const config = this.configSignal();\n return config.previewText;\n });\n\n readonly anchorSignal = computed(() => {\n const downloadUrl = this.downloadUrlSignal();\n\n let result: Maybe<ClickableAnchor>;\n\n if (downloadUrl) {\n result = {\n url: downloadUrl\n };\n }\n\n return result;\n });\n\n readonly storageFileDownloadUrlEffect = effect(\n () => {\n const downloadUrl = this.storageFileDownloadUrl();\n\n if (downloadUrl || downloadUrl === null) {\n this.downloadUrlSignal.set(downloadUrl);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Preview\n readonly showPreviewButtonSignal = computed(() => {\n const config = this.configSignal();\n const hasDownloadUrl = this.hasDownloadUrlSignal();\n return hasDownloadUrl && (config.showPreviewButton ?? true);\n });\n\n readonly openCustomPreviewSignal = computed(() => {\n const config = this.configSignal();\n return config.openCustomPreview;\n });\n\n readonly handleOpenPreviewDialog: DbxActionDialogFunction = () => {\n const openPreview = this.openCustomPreviewSignal();\n\n const srcUrl = this.downloadUrlSignal() as string;\n const inputEmbedMimeType = this.embedMimeType();\n const downloadMimeType = this.downloadMimeTypeSignal();\n const embedMimeType = inputEmbedMimeType ?? downloadMimeType;\n\n return (\n openPreview?.(srcUrl, embedMimeType) ??\n this.dbxWebFilePreviewService.openPreviewDialog({\n srcUrl,\n embedMimeType\n })\n );\n };\n\n // Cached Url Effect\n // When the key changes, check the cache to see if it is already available, and populate the download url if it is.\n readonly cachedUrlForStorageFileKey$ = this.storageFileKey$.pipe(\n switchMap((key) => (key ? this.dbxFirebaseStorageFileDownloadService.getCachedDownloadPairForStorageFile(key) : of(null))),\n shareReplay(1)\n );\n\n readonly cachedUrlForStorageFileKeySignal = toSignal(this.cachedUrlForStorageFileKey$);\n\n readonly cachedUrlEffect = effect(\n () => {\n const cachedPair = this.cachedUrlForStorageFileKeySignal();\n\n if (cachedPair) {\n this.downloadUrlSignal.set(cachedPair.downloadUrl);\n this.downloadMimeTypeSignal.set(cachedPair.mimeType);\n this.downloadUrlExpiresAtSignal.set(cachedPair.expiresAt);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Expiration Effect\n readonly downloadUrlExpiresAtDate$ = toObservable(this.downloadUrlExpiresAtSignal).pipe(map(dateFromDateOrTimeSecondsNumber), distinctUntilChanged(isSameDate), shareReplay(1));\n readonly downloadUrlExpiresAtDateSignal = toSignal(this.downloadUrlExpiresAtDate$);\n\n readonly downloadUrlHasExpired$ = this.downloadUrlExpiresAtDate$.pipe(\n switchMap((x) => {\n let obs: Observable<boolean>;\n\n if (x) {\n obs = interval(MS_IN_SECOND).pipe(\n map(() => isPast(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n } else {\n obs = of(false);\n }\n\n return obs;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly downloadUrlHasExpiredSignal = toSignal(this.downloadUrlHasExpired$);\n readonly downloadUrlHasExpiredEffect = effect(\n () => {\n const expired = this.downloadUrlHasExpiredSignal();\n\n if (expired) {\n this.downloadUrlSignal.set(undefined);\n this.downloadMimeTypeSignal.set(undefined);\n this.downloadUrlExpiresAtSignal.set(undefined);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Output Effect\n readonly downloadDetailsSignal = computed(() => {\n const downloadUrl = this.downloadUrlSignal();\n const mimeType = this.downloadMimeTypeSignal();\n const expiresAt = this.downloadUrlExpiresAtDateSignal();\n\n const details: Maybe<DbxFirebaseStorageFileDownloadDetails> =\n downloadUrl != null\n ? {\n downloadUrl,\n mimeType,\n expiresAt\n }\n : undefined;\n\n return details;\n });\n\n readonly downloadDetailsChangedEffect = effect(() => {\n const details: Maybe<DbxFirebaseStorageFileDownloadDetails> = this.downloadDetailsSignal();\n this.downloadDetailsChange.emit(details);\n });\n\n readonly sourceDownloadDetailsChangeCallbackEffect = effect(\n () => {\n const details: Maybe<DbxFirebaseStorageFileDownloadDetails> = this.downloadDetailsSignal();\n const source = this.source();\n\n if (source?.downloadDetailsChangeCallback) {\n source.downloadDetailsChangeCallback(details);\n }\n },\n {\n allowSignalWrites: true\n }\n );\n\n // Handlers\n readonly handleGetDownloadUrl: WorkUsingContext<StorageFileKey, DbxFirebaseStorageFileDownloadUrlPair> = (value: StorageFileKey, context: WorkInstance<StorageFileKey, DbxFirebaseStorageFileDownloadUrlPair>) => {\n const source = this.source();\n const { customSource, handleGetDownloadUrl } = source ?? {};\n\n if (handleGetDownloadUrl) {\n handleGetDownloadUrl(value, context);\n } else {\n context.startWorkingWithObservable(this.dbxFirebaseStorageFileDownloadService.downloadPairForStorageFileUsingSource(value, customSource));\n }\n };\n\n readonly handleGetDownloadUrlSuccess = (value: DbxFirebaseStorageFileDownloadUrlPair) => {\n const source = this.source();\n const { handleGetDownloadUrlSuccess } = source ?? {};\n\n this.downloadUrlSignal.set(value.downloadUrl);\n this.downloadMimeTypeSignal.set(value.mimeType);\n this.downloadUrlExpiresAtSignal.set(value.expiresAt);\n\n if (handleGetDownloadUrlSuccess) {\n handleGetDownloadUrlSuccess(value);\n }\n };\n\n readonly handleGetDownloadUrlError = (error: unknown) => {\n const source = this.source();\n const { handleGetDownloadUrlError } = source ?? {};\n\n this.downloadUrlSignal.set(undefined);\n this.downloadMimeTypeSignal.set(undefined);\n this.downloadUrlExpiresAtSignal.set(undefined);\n\n if (handleGetDownloadUrlError) {\n handleGetDownloadUrlError(error);\n }\n };\n}\n","import { Injectable } from '@angular/core';\nimport { FileAcceptFilterTypeString } from '@dereekb/dbx-web';\nimport { FirebaseStorageAccessorFile, StoragePathInput } from '@dereekb/firebase';\nimport { distinctUntilHasDifferentValues, filterMaybe } from '@dereekb/rxjs';\nimport { ArrayOrValue, asArray, Maybe, PercentDecimal } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs';\nimport { StorageFileUploadFilesEvent, StorageFileUploadFilesFinalResult } from '../container';\n\n/**\n * The stage of the upload process.\n *\n * - configuration: The initial stage where the upload store is being configured.\n * - files: The stage where the files are to be selected.\n * - uploading: The stage where the files are being uploaded.\n * - success: The stage where the files have been successfully uploaded.\n * - error: The stage where the upload has failed.\n */\nexport type DbxFirebaseStorageFileUploadStoreUploadStage = 'configuration' | 'files' | 'uploading' | 'success' | 'error';\n\n/**\n * The accepted file types for the upload.\n *\n * If unset, then all file types are accepted.\n */\nexport type DbxFirebaseStorageFileUploadStoreAllowedTypes = FileAcceptFilterTypeString[];\n\n/**\n * The progress of a file being uploaded.\n *\n * File progresses are automatically created for all files when one file's progress is\n */\nexport interface DbxFirebaseStorageFileUploadStoreFileProgress<T = unknown> {\n /**\n * The file being uploaded.\n */\n readonly file: File;\n /**\n * The accessor file for the file, if available.\n */\n readonly fileRef?: Maybe<FirebaseStorageAccessorFile>;\n /**\n * The upload reference info for the file, if available.\n */\n readonly uploadRef?: Maybe<T>;\n /**\n * The number of bytes that have been transferred for this file.\n */\n readonly bytesTransferred?: Maybe<number>;\n /**\n * The total number of bytes to be uploaded.\n */\n readonly totalBytes?: Maybe<number>;\n /**\n * The progress of the upload.\n *\n * If unset, then the file has not started uploading.\n */\n readonly progress?: Maybe<PercentDecimal>;\n /**\n * If true, the upload has failed for this file.\n */\n readonly failed?: boolean;\n /**\n * The error that occurred during the upload for this file.\n */\n readonly error?: unknown;\n}\n\nexport interface DbxFirebaseStorageFileUploadStoreState {\n // Component Configuration\n /**\n * The default accepted file types for the upload.\n *\n * This may be set by the component.\n */\n readonly componentFileTypesAccepted?: Maybe<DbxFirebaseStorageFileUploadStoreAllowedTypes>;\n\n /**\n * If true, the component allows multiple files to be selected.\n *\n * Defaults to undefined.\n */\n readonly isComponentMultiUploadAllowed?: Maybe<boolean>;\n\n // Configuration Step\n /**\n * The accepted file types for the upload.\n *\n * Is used to filter the files that can be selected for upload.\n *\n * Overrides the componentFileTypesAccepted value if set.\n */\n readonly fileTypesAccepted?: Maybe<DbxFirebaseStorageFileUploadStoreAllowedTypes>;\n\n /**\n * If true, allow selecting multiple files for upload.\n *\n * If isComponentMultiUploadAllowed is false, then this value is ignored.\n */\n readonly isMultiUploadAllowed?: Maybe<boolean>;\n\n /**\n * Path to upload the file(s) to.\n *\n * Must be set before uploading.\n */\n readonly uploadPath?: Maybe<StoragePathInput>;\n\n // Files Step\n /**\n * The current file(s) to upload.\n */\n readonly files?: Maybe<File[]>;\n\n // Upload Step\n /**\n * The progress of the upload for each file.\n *\n * Only set while one or more files are being uploaded.\n */\n readonly latestProgressEvent?: Maybe<StorageFileUploadFilesEvent>;\n\n /**\n * If true, the upload handler is working.\n */\n readonly isUploadHandlerWorking?: Maybe<boolean>;\n\n // Upload Result\n /**\n * The final upload result for the files.\n *\n * Only set after the upload has completed.\n */\n readonly uploadResult?: Maybe<StorageFileUploadFilesFinalResult>;\n}\n\n/**\n * Store used for selecting a specific NotificationItem from a list of notification items.\n */\n@Injectable()\nexport class DbxFirebaseStorageFileUploadStore extends ComponentStore<DbxFirebaseStorageFileUploadStoreState> {\n constructor() {\n super({});\n }\n\n // MARK: Accessors\n readonly componentFileTypesAccepted$ = this.select((state) => state.componentFileTypesAccepted);\n readonly isComponentMultiUploadAllowed$ = this.select((state) => state.isComponentMultiUploadAllowed).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly fileTypesAllowed$ = this.select((state) => state.fileTypesAccepted ?? state.componentFileTypesAccepted ?? []).pipe(distinctUntilHasDifferentValues(), shareReplay(1));\n readonly fileTypesAcceptString$ = this.fileTypesAllowed$.pipe(\n map((x) => x.join(',')),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isMultiUploadAllowed$ = this.select((state) => state.isComponentMultiUploadAllowed !== false && state.isMultiUploadAllowed).pipe(distinctUntilChanged(), shareReplay(1));\n\n readonly uploadPath$ = this.select((state) => state.uploadPath).pipe(distinctUntilChanged(), shareReplay(1));\n readonly currentFiles$ = this.select((state) => state.files).pipe(distinctUntilChanged(), shareReplay(1));\n readonly files$ = this.currentFiles$.pipe(filterMaybe());\n\n readonly isUploadHandlerWorking$ = this.select((state) => state.isUploadHandlerWorking).pipe(distinctUntilChanged(), shareReplay(1));\n readonly latestProgressEvent$ = this.select((state) => state.latestProgressEvent).pipe(distinctUntilChanged(), shareReplay(1));\n readonly currentUploadResult$ = this.select((state) => state.uploadResult).pipe(distinctUntilChanged(), shareReplay(1));\n readonly uploadResult$ = this.currentUploadResult$.pipe(filterMaybe());\n\n // MARK: State Changes\n readonly setComponentFileTypesAccepted = this.updater((state, componentFileTypesAccepted: Maybe<DbxFirebaseStorageFileUploadStoreAllowedTypes>) => ({ ...state, componentFileTypesAccepted }));\n readonly setIsComponentMultiUploadAllowed = this.updater((state, isComponentMultiUploadAllowed: Maybe<boolean>) => ({ ...state, isComponentMultiUploadAllowed }));\n\n readonly setUploadPath = this.updater((state, uploadPath: Maybe<StoragePathInput>) => ({ ...state, uploadPath }));\n readonly setFileTypesAccepted = this.updater((state, fileTypesAccepted: Maybe<ArrayOrValue<FileAcceptFilterTypeString>>) => ({ ...state, fileTypesAccepted: fileTypesAccepted ? asArray(fileTypesAccepted) : undefined }));\n\n /**\n * Sets the file list to upload.\n *\n * If the upload handler is working, the file list cannot be changed.\n */\n readonly setFiles = this.updater((state, files: Maybe<File[]>) => ({ ...state, files: state.isUploadHandlerWorking ? state.files : files }));\n readonly setIsMultiUploadAllowed = this.updater((state, isMultiUploadAllowed: Maybe<boolean>) => ({ ...state, isMultiUploadAllowed }));\n\n /**\n * Flags the upload handler to begin working.\n *\n * Once the upload handler is flagged, it cannot be unset until the upload handler has finished.\n */\n readonly setIsUploadHandlerWorking = this.updater((state, isUploadHandlerWorking: boolean) => ({ ...state, isUploadHandlerWorking }));\n\n /**\n * Sets the latest progress event.\n */\n readonly setLatestProgressEvent = this.updater((state, latestProgressEvent: Maybe<StorageFileUploadFilesEvent>) => ({ ...state, latestProgressEvent }));\n\n /**\n * Updates the upload progress for one or more files.\n */\n // readonly updateUploadProgress = this.updater((state, uploadProgress: ArrayOrValue<DbxFirebaseStorageFileUploadStoreFileProgress>) => updateUploadStorageFileStoreStateWithUploadProgress(state, uploadProgress));\n\n /**\n * Sets the upload result.\n */\n readonly setUploadResult = this.updater((state, uploadResult: Maybe<StorageFileUploadFilesFinalResult>) => ({ ...state, isUploadHandlerWorking: false, uploadProgress: undefined, uploadResult }));\n}\n\n// TODO: Consider moving this back, but might not be needed...\n/*\nexport function updateUploadStorageFileStoreStateWithUploadProgress(state: DbxFirebaseStorageFileUploadStoreState, uploadProgress: ArrayOrValue<DbxFirebaseStorageFileUploadStoreFileProgress>): DbxFirebaseStorageFileUploadStoreState {\n const { uploadProgress: currentUploadProgress } = state;\n\n const newUploadProgress = asArray(uploadProgress);\n const newUploadProgressMap = new Map(newUploadProgress.map((progress) => [progress.file, progress]));\n\n const updatedUploadProgress = (currentUploadProgress ?? []).map((progress) => {\n const newProgress = newUploadProgressMap.get(progress.file);\n return newProgress ?? progress;\n });\n\n return { ...state, uploadProgress: updatedUploadProgress };\n}\n*/\n","import { catchError, map, Observable, of, shareReplay } from 'rxjs';\nimport { type DbxFirebaseStorageFileUploadStoreFileProgress } from '../store';\nimport { type DbxFirebaseStorageService } from '../../../storage/firebase.storage.service';\nimport { type IndexNumber, type Maybe, type PercentDecimal, type PercentNumber, type PromiseOrValue, runAsyncTasksForValues, separateValues } from '@dereekb/util';\nimport { MultiSubscriptionObject } from '@dereekb/rxjs';\nimport { type FirebaseStorageAccessorFile, type StorageCustomMetadata, type StoragePathInput, type StorageUploadOptions, type StorageUploadTask } from '@dereekb/firebase';\n\n/**\n * Creates a new observable for uploading a file.\n */\nexport type StorageFileUploadHandlerFunction = (file: File) => Promise<StorageFileUploadHandlerInstance>;\n\nexport interface StorageFileUploadHandlerInstance extends Pick<StorageUploadTask<FirebaseStorageAccessorFile>, 'taskRef' | 'pause' | 'resume' | 'cancel'> {\n /**\n * The upload observable.\n *\n * Must be subscribed to in order for the upload to begin.\n */\n readonly upload: Observable<DbxFirebaseStorageFileUploadStoreFileProgress>;\n}\n\n/**\n * Handles uploading files.\n */\nexport interface StorageFileUploadHandler {\n /**\n * Uploads a file, and returns the file progress as it is uploading.\n */\n readonly uploadFile: StorageFileUploadHandlerFunction;\n}\n\n/**\n * Configuration for a single file upload.\n */\nexport interface StorageFileUploadConfig {\n /**\n * Path for where to upload the file to\n */\n readonly storagePath: StoragePathInput;\n /**\n * Upload options for the file.\n *\n * Resumable is not supported.\n */\n readonly uploadOptions?: StorageFileUploadConfigOptions;\n /**\n * Custom metadata for the file.\n *\n * Is merged with uploadOptions's metadata.\n */\n readonly customMetadata?: StorageCustomMetadata;\n}\n\n/**\n * StorageFileUploadConfig upload options.\n */\nexport type StorageFileUploadConfigOptions = Omit<StorageUploadOptions, 'resumable'>;\n\n/**\n * Function used to generate file names for the uploaded files.\n *\n * If not set, the file name will be used as is.\n */\nexport type StorageFileUploadConfigFactory = (file: File) => PromiseOrValue<StorageFileUploadConfig>;\n\n/**\n * Configuration for StorageFileUploadHandler().\n */\nexport interface StorageFileUploadHandlerConfig {\n readonly storageService: DbxFirebaseStorageService;\n readonly storageFileUploadConfigFactory: StorageFileUploadConfigFactory;\n}\n\n/**\n * Default implementation of StorageFileUploadHandler.\n */\nexport function storageFileUploadHandler(config: StorageFileUploadHandlerConfig): StorageFileUploadHandler {\n const { storageService, storageFileUploadConfigFactory } = config;\n\n let resumable: Maybe<StorageUploadTask>;\n\n return {\n uploadFile: async (file) => {\n const storageFileUploadConfig = await storageFileUploadConfigFactory(file);\n\n const { storagePath } = storageFileUploadConfig;\n const storageAccessorFile = storageService.file(storagePath);\n\n const upload = new Observable<DbxFirebaseStorageFileUploadStoreFileProgress>((x) => {\n if (storageAccessorFile.uploadResumable) {\n resumable = storageAccessorFile.uploadResumable(file);\n\n // subscribe to the event by piping this observable to it\n resumable\n .streamSnapshotEvents()\n .pipe(\n map((x) => {\n const { bytesTransferred, totalBytes } = x;\n\n const progress: DbxFirebaseStorageFileUploadStoreFileProgress = {\n file,\n fileRef: storageAccessorFile,\n uploadRef: resumable,\n bytesTransferred,\n totalBytes,\n progress: bytesTransferred / totalBytes\n };\n\n return progress;\n })\n )\n .pipe(\n catchError((error) => {\n // if an error occurs, catch it and emit it as a progress\n const progress: DbxFirebaseStorageFileUploadStoreFileProgress = {\n file,\n fileRef: storageAccessorFile,\n uploadRef: resumable,\n error,\n failed: true\n };\n\n return of(progress);\n })\n )\n .subscribe(x);\n } else {\n throw new Error('uploadResumable() function was unavailable.');\n }\n }).pipe(shareReplay(1));\n\n const instance: StorageFileUploadHandlerInstance = {\n upload,\n taskRef: storageAccessorFile,\n pause: () => resumable?.pause() ?? false,\n resume: () => resumable?.resume() ?? false,\n cancel: () => resumable?.cancel() ?? false\n };\n\n return instance;\n }\n };\n}\n\n// MARK: Upload Files\nexport interface StorageFileUploadFilesInput {\n readonly uploadHandler: StorageFileUploadHandler;\n /**\n * Files to upload\n */\n readonly files: File[];\n /**\n * The number of max parallel uploads to perform at a time.\n *\n * Defaults to 3\n */\n readonly maxParallelUploads?: number;\n}\n\nexport interface StorageFileUploadFilesInstance {\n /**\n * Cancels the upload of the remaining files.\n */\n cancel(): void;\n /**\n * The upload observable.\n *\n * Must be subscribed to in order for the upload to begin.\n */\n readonly upload: Observable<StorageFileUploadFilesEvent>;\n}\n\nexport interface StorageFileUploadFilesEvent {\n /**\n * All files being uploaded\n */\n readonly allFiles: File[];\n /**\n * Returns true if all files have been uploaded.\n *\n * The result value should be available.\n */\n readonly isComplete: boolean;\n /**\n * Returns true if the upload was canceled.\n */\n readonly isCanceled?: Maybe<boolean>;\n /**\n * The overall progress of all files being uploaded.\n */\n readonly overallProgress: PercentNumber;\n /**\n * The upload progress that triggered this event.\n */\n readonly uploadProgress?: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>;\n /**\n * The final result.\n *\n * Set when the final file has been uploaded or failed.\n */\n readonly result?: StorageFileUploadFilesFinalResult;\n /**\n * The number of files that are still uploading or queued for upload.\n */\n readonly incompleteFileCount: number;\n /**\n * The number of files that are active.\n */\n readonly activeFileCount: number;\n /**\n * The number of files that are done.\n */\n readonly doneFileCount: number;\n}\n\nexport interface StorageFileUploadFilesFinalResult {\n readonly startTime: Date;\n readonly endTime: Date;\n readonly fileResults: StorageFileUploadFilesFinalFileResult[];\n readonly successFileResults: StorageFileUploadFilesFinalFileResult[];\n readonly errorFileResults: StorageFileUploadFilesFinalFileResult[];\n}\n\nexport interface StorageFileUploadFilesFinalFileResult {\n /**\n * The start time of the file upload.\n */\n readonly startTime: Date;\n /**\n * The end time of the file upload, or when it failed or was canceled.\n */\n readonly endTime: Date;\n /**\n * The file that was uploaded.\n */\n readonly file: File;\n /**\n * The accessor file for the file, if available.\n *\n * Is generally available if success is true.\n */\n readonly fileRef?: Maybe<FirebaseStorageAccessorFile>;\n /**\n * True if the file was uploaded successfully.\n */\n readonly success: boolean;\n /**\n * Error if the file failed to upload.\n */\n readonly error?: Maybe<unknown>;\n /**\n * True if the file upload was cancelled.\n */\n readonly canceled?: Maybe<boolean>;\n}\n\n/**\n * Uploads files using the provided upload handler and files.\n *\n * An observable is returned that emits the latest file events from any file that is being uploaded.\n *\n * @param input\n * @returns\n */\nexport function storageFileUploadFiles(input: StorageFileUploadFilesInput): StorageFileUploadFilesInstance {\n const { uploadHandler, files, maxParallelUploads: inputMaxParallelUploads } = input;\n const maxParallelTasks = inputMaxParallelUploads ?? 3;\n\n const multiUploadsSubscriptionObject = new MultiSubscriptionObject();\n\n // begin the upload for each file\n const allFiles = Array.from(files);\n\n // unsubscribe from all previous uploads\n multiUploadsSubscriptionObject.unsub();\n\n interface UpdateUploadProgressInput {\n /**\n * The file index number.\n */\n readonly index: IndexNumber;\n /**\n * The next progress event, if applicable.\n */\n readonly nextProgress?: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>;\n /**\n * An error that occured outside of the nextProgress, if applicable.\n *\n * These are typically \"uncaught\" errors.\n */\n readonly nonProgressError?: Maybe<unknown>;\n /**\n * Passed as true when the upload task is done.\n *\n * This is also inferred as true when a progress error occurs for an upload.\n *\n * Does not specify whether or not success was achieved or not.\n */\n readonly fileUploadTaskDone?: boolean;\n /**\n * True if the upload was canceled.\n */\n readonly canceled?: boolean;\n }\n\n interface FileUploadDetails {\n readonly file: File;\n /**\n * The current upload instance for the file.\n *\n * Set if the file is currently uploading.\n */\n uploadInstance?: StorageFileUploadHandlerInstance;\n fileRef?: Maybe<FirebaseStorageAccessorFile>;\n startTime?: Date;\n endTime?: Date;\n success?: boolean;\n canceled?: Maybe<boolean>;\n error?: Maybe<unknown>;\n }\n\n const allFilesAndLatestProgress: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>[] = new Array(allFiles.length);\n const allFilesAndDetails: FileUploadDetails[] = allFiles.map((file) => ({ file }));\n const overallProgressPerCompletedFile: PercentDecimal = (1 / allFilesAndLatestProgress.length) as PercentDecimal;\n\n /**\n * Once set, any new file upload task that hits this will return an cancel failure.\n */\n let flaggedCancel = false;\n\n const cancel = () => {\n flaggedCancel = true;\n };\n\n const upload = new Observable<StorageFileUploadFilesEvent>((subscriber) => {\n const overallStartTime = new Date();\n\n const incompleteFileFileIndexes = new Set<IndexNumber>(allFiles.map((_, index) => index));\n const activeFileIndexes = new Set<IndexNumber>();\n const doneFileIndexes = new Set<IndexNumber>();\n let latestOverallProgress: PercentNumber = 0;\n\n function onStartFileUpload(index: IndexNumber, uploadInstance: StorageFileUploadHandlerInstance) {\n activeFileIndexes.add(index);\n allFilesAndDetails[index].startTime = new Date();\n allFilesAndDetails[index].uploadInstance = uploadInstance;\n allFilesAndDetails[index].fileRef = uploadInstance.taskRef;\n }\n\n function onStartFileUploadFlaggedCancelled(index: IndexNumber) {\n allFilesAndDetails[index].startTime = new Date();\n\n // immediately mark it done\n _markFileUploadDone(index, true);\n\n // emit new progress event\n _emitEvent();\n }\n\n function _markFileUploadDone(fileIndex: IndexNumber, finalError?: Maybe<unknown>) {\n doneFileIndexes.add(fileIndex); // add to done file indexes\n activeFileIndexes.delete(fileIndex); // remove from active file indexes if it exists\n incompleteFileFileIndexes.delete(fileIndex); // remove from incomplete file indexes\n\n // update details\n allFilesAndDetails[fileIndex].endTime = new Date();\n\n const error = finalError ?? allFilesAndDetails[fileIndex].error;\n allFilesAndDetails[fileIndex].success = !error;\n allFilesAndDetails[fileIndex].error = error;\n }\n\n function updateUploadProgress(input: UpdateUploadProgressInput) {\n const { index: fileIndex, nextProgress, fileUploadTaskDone: inputFileUploadTaskDone, nonProgressError } = input;\n const error = nonProgressError ?? nextProgress?.error;\n const fileUploadTaskDone = inputFileUploadTaskDone ?? Boolean(error);\n\n // the task may already be done, as after a progress-related error the complete task can get called.\n const isTaskAlreadyDone = allFilesAndDetails[fileIndex].endTime != null;\n\n if (!isTaskAlreadyDone) {\n let nextOverallProgress = latestOverallProgress;\n const nextProgressPercent = fileUploadTaskDone ? 100 : (nextProgress?.progress ?? 0) * 100;\n\n // update the overall progress percentage\n if (nextProgressPercent) {\n // update the overall percentage\n const previousProgress = allFilesAndLatestProgress[fileIndex];\n const previousProgressPercent = previousProgress?.progress != null ? previousProgress.progress * 100 : 0;\n const progressPercentChange = nextProgressPercent - previousProgressPercent;\n\n // increase overall progress by the change\n nextOverallProgress += progressPercentChange * overallProgressPerCompletedFile;\n }\n\n // update the file progress\n if (nextProgress) {\n // update the latest FileProgress\n allFilesAndLatestProgress[fileIndex] = nextProgress;\n\n // only set fileRef once\n if (!allFilesAndDetails[fileIndex].fileRef) {\n allFilesAndDetails[fileIndex].fileRef = nextProgress.fileRef;\n }\n }\n\n // if complete, update the indexes and details\n if (fileUploadTaskDone) {\n _markFileUploadDone(fileIndex, error);\n }\n\n // update the overall progress\n latestOverallProgress = nextOverallProgress;\n\n // emit the event to send it\n _emitEvent(nextProgress);\n }\n }\n\n function _emitEvent(nextProgress?: Maybe<DbxFirebaseStorageFileUploadStoreFileProgress>) {\n const isComplete = incompleteFileFileIndexes.size === 0;\n\n let overallProgress = latestOverallProgress;\n let result: Maybe<StorageFileUploadFilesFinalResult> = undefined;\n\n if (isComplete) {\n overallProgress = 100; // set to 100%\n const overallEndTime = new Date();\n\n const fileResults = allFiles.map((file, index) => {\n const result: StorageFileUploadFilesFinalFileResult = {\n startTime: allFilesAndDetails[index].startTime as Date,\n endTime: allFilesAndDetails[index].endTime as Date,\n file,\n fileRef: allFilesAndDetails[index].fileRef,\n success: !allFilesAndDetails[index].error,\n error: allFilesAndDetails[index].error\n };\n\n return result;\n });\n\n const { included: successFileResults, excluded: errorFileResults } = separateValues(fileResults, (x) => x.success);\n\n // all are done, set the result on the next event\n result = {\n startTime: overallStartTime,\n endTime: overallEndTime,\n successFileResults,\n errorFileResults,\n fileResults\n };\n }\n\n const nextEvent: StorageFileUploadFilesEvent = {\n allFiles,\n isComplete,\n overallProgress,\n uploadProgress: nextProgress,\n incompleteFileCount: incompleteFileFileIndexes.size,\n activeFileCount: activeFileIndexes.size,\n doneFileCount: doneFileIndexes.size,\n result\n };\n\n subscriber.next(nextEvent);\n }\n\n async function runUploadTaskForFile([file, index]: readonly [File, IndexNumber]) {\n if (flaggedCancel) {\n onStartFileUploadFlaggedCancelled(index);\n return Promise.resolve();\n }\n\n return new Promise<void>((resolve) => {\n const updateFileUploadProgress = (nextProgress: DbxFirebaseStorageFileUploadStoreFileProgress) => {\n // update the progress\n updateUploadProgress({\n index,\n nextProgress\n });\n };\n\n const updateFileUploadProgressWithUncaughtError = (error: unknown) => {\n // error occurred, update the progress with the error\n updateUploadProgress({\n index,\n nonProgressError: error,\n fileUploadTaskDone: true\n });\n\n // always resolve, never reject\n resolve();\n };\n\n const completeFileUploadProgress = () => {\n updateUploadProgress({\n index,\n fileUploadTaskDone: true\n });\n\n resolve();\n };\n\n // upload the file, subscribe to the progress\n try {\n uploadHandler\n .uploadFile(file)\n .then((uploadInstance) => {\n // add to active file indexes\n onStartFileUpload(index, uploadInstance);\n\n const uploadSubscription = uploadInstance.upload.subscribe({\n next: updateFileUploadProgress,\n error: updateFileUploadProgressWithUncaughtError,\n complete: completeFileUploadProgress\n });\n\n multiUploadsSubscriptionObject.addSubs(uploadSubscription);\n })\n .catch(updateFileUploadProgressWithUncaughtError);\n } catch (error) {\n updateFileUploadProgressWithUncaughtError(error);\n }\n });\n }\n\n // run upload task for each file\n const fileTuples = allFiles.map((file, index) => [file, index] as const);\n\n runAsyncTasksForValues(fileTuples, runUploadTaskForFile, {\n maxParallelTasks,\n retriesAllowed: 0 // no retries allowed\n }).then(() => {\n // all tasks are finished. Complete the subscriber.\n subscriber.complete();\n });\n }).pipe(shareReplay(1));\n\n const instance: StorageFileUploadFilesInstance = {\n cancel,\n upload\n };\n\n return instance;\n}\n","import { BaseError } from 'make-error';\nimport { type StorageFileUploadFilesFinalResult } from './storagefile.upload.handler';\n\n/**\n * Error that is thrown when a single file fails to upload.\n */\nexport class StorageFileUploadFilesError extends BaseError {\n readonly result: StorageFileUploadFilesFinalResult;\n\n constructor(result: StorageFileUploadFilesFinalResult) {\n super('Failed to upload all files.');\n this.result = result;\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DbxFirebaseStorageFileUploadStore } from '../store/storagefile.upload.store';\nimport { storageFileUploadFiles, StorageFileUploadFilesFinalResult, StorageFileUploadHandler } from './storagefile.upload.handler';\nimport { clean, cleanSubscriptionWithLockSet, DbxActionContextStoreSourceInstance, DbxActionHandlerInstance } from '@dereekb/dbx-core';\nimport { errorResult, LoadingState, startWithBeginLoading, successResult, WorkUsingContext } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { distinctUntilChanged, filter, map, of, switchMap, tap, throttleTime } from 'rxjs';\nimport { StorageFileUploadFilesError } from './storagefile.upload.error';\n\n/**\n * Connects a DbxFirebaseStorageFileUploadStore to a DbxActionContext, and handles the upload action.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadActionHandler]',\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadActionHandlerDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance<File[], StorageFileUploadFilesFinalResult>);\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n\n readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<File[], StorageFileUploadFilesFinalResult>(this.source));\n\n /**\n * If true, the action will be triggered when files are set.\n *\n * Defaults to false.\n */\n readonly triggerOnFiles = input<boolean>(false);\n readonly triggerOnFiles$ = toObservable(this.triggerOnFiles);\n\n /**\n * Uploading of all/any files should be cancelled if any file fails to upload.\n *\n * Any file that was successfully uploaded will not be reverted.\n *\n * Defaults to false.\n */\n readonly cancelUploadsOnUploadError = input<boolean>(false);\n\n /**\n * The upload should fail if any file fails to upload, rather than if all files fail to upload.\n *\n * Defaults to false.\n */\n readonly actionFailureOnUploadError = input<boolean>(false);\n\n readonly uploadHandler = input.required<Maybe<StorageFileUploadHandler>>({ alias: 'dbxFirebaseStorageFileUploadActionHandler' });\n\n protected readonly _uploadHandlerEffect = effect(() => {\n const uploadHandler = this.uploadHandler();\n let handlerFunction: Maybe<WorkUsingContext<File[], StorageFileUploadFilesFinalResult>>;\n\n if (uploadHandler) {\n handlerFunction = (files, context) => {\n const { upload, cancel } = storageFileUploadFiles({\n files,\n uploadHandler\n });\n\n const loadingStateObs = upload.pipe(\n tap((x) => {\n this.uploadStore.setLatestProgressEvent(x);\n }),\n filter((x) => x.isComplete),\n tap((x) => {\n this.uploadStore.setUploadResult(x.result as StorageFileUploadFilesFinalResult);\n }),\n map((x) => {\n const result = x.result as StorageFileUploadFilesFinalResult;\n const { successFileResults, errorFileResults } = result;\n\n const actionFailureOnUploadError = this.actionFailureOnUploadError();\n\n let finalLoadingState: LoadingState<StorageFileUploadFilesFinalResult>;\n\n if ((errorFileResults.length > 0 && actionFailureOnUploadError) || (successFileResults.length === 0 && errorFileResults.length > 0)) {\n finalLoadingState = errorResult(new StorageFileUploadFilesError(result));\n } else {\n finalLoadingState = successResult(x.result as StorageFileUploadFilesFinalResult);\n }\n\n return finalLoadingState;\n }),\n startWithBeginLoading()\n );\n\n context.startWorkingWithLoadingStateObservable(loadingStateObs);\n };\n } else {\n handlerFunction = undefined;\n }\n\n this._dbxActionHandlerInstance.setHandlerFunction(handlerFunction);\n });\n\n readonly files$ = this.uploadStore.files$;\n readonly uploadHandler$ = toObservable(this.uploadHandler);\n\n constructor() {\n this._dbxActionHandlerInstance.init();\n\n // trigger the action if files are available\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.triggerOnFiles$\n .pipe(\n switchMap((triggerOnFiles) => {\n if (triggerOnFiles) {\n return this.files$.pipe(map((x) => x?.length));\n } else {\n return of(false);\n }\n })\n )\n .subscribe((canTrigger) => {\n if (canTrigger) {\n this.source.trigger();\n }\n })\n });\n\n // ready the source with files after trigger is called and files are available\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.files$.pipe(switchMap((files) => this.source.triggered$.pipe(map(() => files)))).subscribe((files) => {\n this.source.readyValue(files);\n })\n });\n\n // sync isWorking\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.uploadStore.setIsUploadHandlerWorking(this.source.isWorking$)\n });\n\n // sync progress amount\n this.source.setWorkProgress(\n this.uploadStore.latestProgressEvent$.pipe(\n throttleTime(100, undefined, { leading: true, trailing: true }),\n map((x) => x?.overallProgress),\n distinctUntilChanged()\n )\n );\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseCollectionStore, firebaseCollectionStoreCreateFunction } from '../../../model/modules/store';\nimport { StorageFileFirestoreCollections, StorageFile, StorageFileDocument, StorageFileFunctions } from '@dereekb/firebase';\n\n@Injectable()\nexport class StorageFileCollectionStore extends AbstractDbxFirebaseCollectionStore<StorageFile, StorageFileDocument> {\n readonly storageFileFunctions = inject(StorageFileFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(StorageFileFirestoreCollections).storageFileCollection });\n }\n\n readonly initializeAllStorageFilesFromUpload = firebaseCollectionStoreCreateFunction(this, this.storageFileFunctions.storageFile.createStorageFile.allFromUpload);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseCollectionStoreDirective, provideDbxFirebaseCollectionStoreDirective } from '../../../model/modules/store';\nimport { StorageFileCollectionStore } from './storagefile.collection.store';\nimport { StorageFile, StorageFileDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseStorageFileCollection]',\n providers: provideDbxFirebaseCollectionStoreDirective(DbxFirebaseStorageFileCollectionStoreDirective, StorageFileCollectionStore),\n standalone: true\n})\nexport class DbxFirebaseStorageFileCollectionStoreDirective extends DbxFirebaseCollectionStoreDirective<StorageFile, StorageFileDocument, StorageFileCollectionStore> {\n constructor() {\n super(inject(StorageFileCollectionStore));\n this.setConstraints([]);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreCreateFunction, firebaseDocumentStoreCrudFunction, firebaseDocumentStoreDeleteFunction, firebaseDocumentStoreReadFunction, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { StorageFile, StorageFileDocument, StorageFileFirestoreCollections, StorageFileFunctions } from '@dereekb/firebase';\n\n@Injectable()\nexport class StorageFileDocumentStore extends AbstractDbxFirebaseDocumentStore<StorageFile, StorageFileDocument> {\n readonly storageFileFunctions = inject(StorageFileFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(StorageFileFirestoreCollections).storageFileCollection });\n }\n\n readonly createStorageFileFromUpload = firebaseDocumentStoreCreateFunction(this, this.storageFileFunctions.storageFile.createStorageFile.create);\n readonly initializeStorageFileFromUpload = firebaseDocumentStoreCreateFunction(this, this.storageFileFunctions.storageFile.createStorageFile.fromUpload);\n readonly initializeAllStorageFilesFromUpload = firebaseDocumentStoreCrudFunction(this.storageFileFunctions.storageFile.createStorageFile.allFromUpload);\n\n readonly updateStorageFile = firebaseDocumentStoreUpdateFunction(this, this.storageFileFunctions.storageFile.updateStorageFile.update);\n readonly processStorageFile = firebaseDocumentStoreUpdateFunction(this, this.storageFileFunctions.storageFile.updateStorageFile.process);\n\n readonly deleteStorageFile = firebaseDocumentStoreDeleteFunction(this, this.storageFileFunctions.storageFile.deleteStorageFile.delete);\n\n readonly downloadStorageFile = firebaseDocumentStoreReadFunction(this, this.storageFileFunctions.storageFile.readStorageFile.download);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { StorageFileDocumentStore } from './storagefile.document.store';\nimport { StorageFile, StorageFileDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseStorageFileDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseStorageFileDocumentStoreDirective, StorageFileDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseStorageFileDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<StorageFile, StorageFileDocument, StorageFileDocumentStore> {\n constructor() {\n super(inject(StorageFileDocumentStore));\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AbstractDbxFirebaseDocumentStore, firebaseDocumentStoreCrudFunction, firebaseDocumentStoreUpdateFunction } from '../../../model/modules/store';\nimport { StorageFileGroup, StorageFileGroupDocument, StorageFileFirestoreCollections, StorageFileFunctions } from '@dereekb/firebase';\n\n@Injectable()\nexport class StorageFileGroupDocumentStore extends AbstractDbxFirebaseDocumentStore<StorageFileGroup, StorageFileGroupDocument> {\n readonly storageFileFunctions = inject(StorageFileFunctions);\n\n constructor() {\n super({ firestoreCollection: inject(StorageFileFirestoreCollections).storageFileGroupCollection });\n }\n\n readonly updateStorageFileGroup = firebaseDocumentStoreUpdateFunction(this, this.storageFileFunctions.storageFileGroup.updateStorageFileGroup.update);\n readonly regenerateStorageFileGroupContent = firebaseDocumentStoreCrudFunction(this.storageFileFunctions.storageFileGroup.updateStorageFileGroup.regenerateContent);\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseDocumentStoreDirective, provideDbxFirebaseDocumentStoreDirective } from '../../../model/modules/store';\nimport { StorageFileGroupDocumentStore } from './storagefilegroup.document.store';\nimport { StorageFileGroup, StorageFileGroupDocument } from '@dereekb/firebase';\n\n@Directive({\n selector: '[dbxFirebaseStorageFileGroupDocument]',\n providers: provideDbxFirebaseDocumentStoreDirective(DbxFirebaseStorageFileGroupDocumentStoreDirective, StorageFileGroupDocumentStore),\n standalone: true\n})\nexport class DbxFirebaseStorageFileGroupDocumentStoreDirective extends DbxFirebaseDocumentStoreDirective<StorageFileGroup, StorageFileGroupDocument, StorageFileGroupDocumentStore> {\n constructor() {\n super(inject(StorageFileGroupDocumentStore));\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { DbxFirebaseStorageFileUploadStore, StorageFileDocumentStore } from '../store';\nimport { DbxActionContextStoreSourceInstance, DbxActionHandlerInstance, clean, cleanSubscription } from '@dereekb/dbx-core';\nimport { FirebaseStorageAccessorFile, OnCallCreateModelResult } from '@dereekb/firebase';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Directive that passes the upload result to a StorageFileDocumentStore to initialize the document immediately.\n *\n * Use with a DbxAction instance.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadInitializeDocument]',\n exportAs: 'dbxFirebaseStorageFileUploadInitializeDocument',\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadInitializeDocumentDirective {\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n readonly storageFileDocumentStore = inject(StorageFileDocumentStore);\n\n readonly initializeWithExpediteProcessing = input<Maybe<boolean>>();\n\n private readonly source: DbxActionContextStoreSourceInstance<FirebaseStorageAccessorFile, OnCallCreateModelResult> = inject(DbxActionContextStoreSourceInstance<FirebaseStorageAccessorFile, OnCallCreateModelResult>, { host: true });\n private readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<FirebaseStorageAccessorFile, OnCallCreateModelResult>(this.source));\n\n constructor() {\n // set the trigger\n cleanSubscription(\n this.uploadStore.uploadResult$.subscribe(async (result) => {\n const successFileResult = result.successFileResults.find((x) => x.fileRef != null);\n const fileRef = successFileResult?.fileRef;\n\n if (fileRef) {\n this.source.triggerWithValue(fileRef);\n }\n })\n );\n\n // set the handler function\n this._dbxActionHandlerInstance.setHandlerFunction((fileRef, context) => {\n context.startWorkingWithLoadingStateObservable(\n this.storageFileDocumentStore.initializeStorageFileFromUpload({\n pathString: fileRef.storagePath.pathString,\n bucketId: fileRef.storagePath.bucketId,\n expediteProcessing: this.initializeWithExpediteProcessing() ?? undefined\n })\n );\n });\n\n this._dbxActionHandlerInstance.init();\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { skipAllInitialMaybe } from '@dereekb/rxjs';\nimport { DbxFirebaseStorageFileUploadStore } from '../store';\nimport { ArrayOrValue, Maybe } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { shareReplay } from 'rxjs';\nimport { FileAcceptFilterTypeString } from '@dereekb/dbx-web';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Directive that provides a DbxFirebaseStorageFileUploadStore, and sync's the inputs to the store.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadStore]',\n exportAs: 'dbxFirebaseStorageFileUploadStore',\n providers: [DbxFirebaseStorageFileUploadStore],\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadStoreDirective {\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n\n readonly multipleUpload = input<Maybe<boolean>>();\n readonly fileTypesAccepted = input<Maybe<ArrayOrValue<FileAcceptFilterTypeString>>>();\n\n readonly fileTypesAccepted$ = toObservable(this.fileTypesAccepted).pipe(skipAllInitialMaybe(), shareReplay(1));\n readonly isMultiUploadAllowed$ = toObservable(this.multipleUpload).pipe(skipAllInitialMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscription(this.fileTypesAccepted$.subscribe((x) => this.uploadStore.setFileTypesAccepted(x)));\n cleanSubscription(this.isMultiUploadAllowed$.subscribe((x) => this.uploadStore.setIsMultiUploadAllowed(x)));\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxFirebaseStorageFileUploadStore } from '../store';\nimport { DbxFileUploadComponent } from '@dereekb/dbx-web';\nimport { cleanSubscription } from '@dereekb/dbx-core';\n\n/**\n * Directive that syncs a DbxFirebaseStorageFileUploadStore's configuration to a DbxFileUploadComponent.\n */\n@Directive({\n selector: '[dbxFirebaseStorageFileUploadSync]',\n exportAs: 'dbxFirebaseStorageFileUploadSync',\n standalone: true\n})\nexport class DbxFirebaseStorageFileUploadSyncDirective {\n readonly uploadStore = inject(DbxFirebaseStorageFileUploadStore);\n readonly uploadComponent = inject(DbxFileUploadComponent);\n\n constructor() {\n cleanSubscription(this.uploadStore.fileTypesAllowed$.subscribe((x) => this.uploadComponent.setAccept(x)));\n cleanSubscription(this.uploadStore.isMultiUploadAllowed$.subscribe((x) => this.uploadComponent.setMultiple(x)));\n cleanSubscription(this.uploadComponent.filesChanged.subscribe((files) => this.uploadStore.setFiles(files.matchResult.accepted)));\n }\n}\n","import { DbxActionLoadingContextDirective, DbxActionModule, DbxActionSnackbarErrorDirective, DbxFileUploadComponent, DbxFileUploadActionSyncDirective, DbxLoadingComponent } from '@dereekb/dbx-web';\nimport { DbxFirebaseStorageFileUploadActionHandlerDirective, DbxFirebaseStorageFileUploadStoreDirective, DbxFirebaseStorageFileUploadSyncDirective, DbxFirebaseStorageFileUploadInitializeDocumentDirective } from './container';\nimport { NgModule } from '@angular/core';\nimport { DbxFirebaseStorageFileDocumentStoreDirective } from './store/storagefile.document.store.directive';\nimport { DbxFirebaseStorageFileCollectionStoreDirective } from './store';\n\nexport const importsAndExports = [\n // dbx-core/dbx-web modules/components\n DbxActionModule,\n DbxLoadingComponent,\n DbxActionLoadingContextDirective,\n DbxActionSnackbarErrorDirective,\n DbxFileUploadComponent,\n DbxFileUploadActionSyncDirective,\n // containers\n DbxFirebaseStorageFileUploadActionHandlerDirective,\n DbxFirebaseStorageFileUploadStoreDirective,\n DbxFirebaseStorageFileUploadSyncDirective,\n DbxFirebaseStorageFileUploadInitializeDocumentDirective,\n // stores\n DbxFirebaseStorageFileCollectionStoreDirective,\n DbxFirebaseStorageFileDocumentStoreDirective\n];\n\n/**\n * Convenience module for importing various modules/components that are relevant to the storage file upload feature.\n *\n * - DbxActionModule\n * - DbxFileUploadComponent\n * - DbxFirebaseStorageFileUploadActionHandlerDirective\n * - DbxFirebaseStorageFileUploadStoreDirective\n * - DbxFirebaseStorageFileUploadSyncDirective\n * - DbxFirebaseStorageFileUploadInitializeDocumentDirective\n * - DbxFirebaseStorageFileUploadStore\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxFirebaseStorageFileUploadModule {}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { SimpleStorageAccessorFactory, type StorageAccessor } from '@dereekb/dbx-core';\nimport { DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN, DbxFirebaseStorageFileDownloadStorage, type DbxFirebaseStorageFileDownloadUserCache } from './service/storagefile.download.storage.service';\nimport { DbxFirebaseStorageFileDownloadService } from './service/storagefile.download.service';\n\n/**\n * Factory function for creating a StorageAccessor for the model view tracker.\n */\nexport function defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory(storageAccessorFactory: SimpleStorageAccessorFactory): StorageAccessor<DbxFirebaseStorageFileDownloadUserCache> {\n const accessor = storageAccessorFactory.createStorageAccessor<DbxFirebaseStorageFileDownloadUserCache>({\n prefix: 'sfds'\n });\n\n return accessor;\n}\n\n/**\n * Creates EnvironmentProviders for providing DbxModelTrackerService, DbxModelObjectStateService and sets up the NgRx store for DbxModelTrackerEffects.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseStorageFileService(): EnvironmentProviders {\n const providers: (Provider | EnvironmentProviders)[] = [\n // Storage accessor\n {\n provide: DBX_FIREBASE_STORAGEFILE_DOWNLOAD_STORAGE_ACCESSOR_TOKEN,\n useFactory: defaultDbxFirebaseStorageFileDownloadStorageAccessorFactory,\n deps: [SimpleStorageAccessorFactory]\n },\n // Service\n DbxFirebaseStorageFileDownloadStorage,\n DbxFirebaseStorageFileDownloadService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FirestoreModelKey, flatFirestoreModelKey } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'flatFirestoreModelKey', standalone: true })\nexport class FlatFirestoreModelKeyPipe implements PipeTransform {\n transform(input: Maybe<FirestoreModelKey>): string {\n if (input != null) {\n return flatFirestoreModelKey(input);\n } else {\n return '';\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FirestoreModelKey, twoWayFlatFirestoreModelKey } from '@dereekb/firebase';\nimport { type Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'twoWayFlatFirestoreModelKey', standalone: true })\nexport class TwoWayFlatFirestoreModelKeyPipe implements PipeTransform {\n transform(input: Maybe<FirestoreModelKey>): string {\n if (input != null) {\n return twoWayFlatFirestoreModelKey(input);\n } else {\n return '';\n }\n }\n}\n","import { type Observable, BehaviorSubject, map, shareReplay, of, switchMap } from 'rxjs';\nimport { type DbxRouterService, DbxRouteParamDefaultRedirectInstance, type DbxRouteParamReader, dbxRouteParamReaderInstance } from '@dereekb/dbx-core';\nimport { type Destroyable, type Initialized, type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\n\nexport const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY = 'id';\nexport const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY = 'key';\nexport const DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE = '0';\n\n/**\n * Used to read an id with a specific key from the current route.\n *\n * Can be configured to redirect to a default route if a specific value is seen.\n */\nexport interface DbxFirebaseIdRouteParamRedirect extends DbxRouteParamReader<ModelKey> {\n /**\n * The id value as it is from the current state's params.\n */\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n /**\n * The id value as it is when considering the default value.\n */\n readonly id$: Observable<Maybe<ModelKey>>;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n}\n\n/**\n * DbxFirebaseIdRouteParamRedirect instance\n */\nexport interface DbxFirebaseIdRouteParamRedirectInstance extends DbxFirebaseIdRouteParamRedirect, DbxRouteParamReader<ModelKey>, Initialized, Destroyable {\n readonly paramValue$: Observable<Maybe<string>>;\n readonly defaultValue$: Observable<Maybe<string>>;\n readonly value$: Observable<Maybe<string>>;\n\n readonly idFromParams$: Observable<Maybe<ModelKey>>;\n readonly id$: Observable<Maybe<ModelKey>>;\n\n setParamKey(paramKey: string): void;\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void;\n setRedirectEnabled(redirect: Maybe<boolean>): void;\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void;\n setParamValue(value: MaybeObservableOrValueGetter<string>): void;\n}\n\nexport function dbxFirebaseKeyRouteParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_KEY_PARAM_KEY): DbxFirebaseIdRouteParamRedirectInstance {\n return dbxFirebaseIdRouteParamRedirect(dbxRouterService, defaultParamKey);\n}\n\nexport function dbxFirebaseIdRouteParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_ID_PARAM_KEY): DbxFirebaseIdRouteParamRedirectInstance {\n const _paramReader = dbxRouteParamReaderInstance<ModelKey>(dbxRouterService, defaultParamKey);\n const _paramRedirect = new DbxRouteParamDefaultRedirectInstance<ModelKey>(_paramReader);\n const _useDefaultParamDecider = new BehaviorSubject<string | SwitchMapToDefaultFilterFunction<ModelKey>>(DBX_FIREBASE_ID_ROUTER_PARAM_DEFAULT_USE_PARAM_VALUE);\n\n const _useDefaultParam$: Observable<SwitchMapToDefaultFilterFunction<ModelKey>> = _useDefaultParamDecider.pipe(\n map((x) => {\n let result: SwitchMapToDefaultFilterFunction<ModelKey>;\n\n if (typeof x === 'string') {\n result = (value: Maybe<ModelKey>) => of(value === x);\n } else {\n result = x;\n }\n\n return result;\n }),\n shareReplay(1)\n );\n\n const setParamKey = (paramKey: Maybe<string>) => {\n _paramReader.setParamKey(paramKey || defaultParamKey);\n };\n\n const paramValue$ = _paramReader.paramValue$;\n const value$ = _paramReader.value$;\n\n const result: DbxFirebaseIdRouteParamRedirectInstance = {\n paramValue$,\n defaultValue$: _paramReader.defaultValue$,\n value$,\n idFromParams$: paramValue$,\n id$: value$,\n\n init(): void {\n _paramRedirect.setUseDefaultFilter((value: Maybe<string>) => {\n return _useDefaultParam$.pipe(switchMap((x) => x(value)));\n });\n\n _paramRedirect.init();\n },\n\n destroy(): void {\n _paramReader.destroy();\n _paramRedirect.destroy();\n _useDefaultParamDecider.complete();\n },\n\n getParamKey(): string {\n return _paramReader.getParamKey();\n },\n\n setParamKey,\n\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setDefaultValue(defaultValue);\n },\n\n setRedirectEnabled(redirect: Maybe<boolean>): void {\n _paramRedirect.enabled = redirect !== false;\n },\n\n setDecider(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>): void {\n _useDefaultParamDecider.next(decider);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<string>): void {\n _paramReader.setParamValue(value);\n }\n };\n\n return result;\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Token to access the FirebaseStorageContextConfig value.\n */\nexport const DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN = new InjectionToken('DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN');\n\n/**\n * Token to access the FirebaseStorageContext value.\n */\nexport const DBX_FIREBASE_STORAGE_CONTEXT_TOKEN = new InjectionToken('DBX_FIREBASE_STORAGE_CONTEXT_TOKEN');\n","import { Injectable, inject } from '@angular/core';\nimport { FirebaseStorageContext, FirebaseStorageAccessor, FirebaseStorageAccessorFile, FirebaseStorageAccessorFolder, StoragePathInput } from '@dereekb/firebase';\nimport { DBX_FIREBASE_STORAGE_CONTEXT_TOKEN } from './firebase.storage';\n\n/**\n * Service that provides access to the app's FirebaseStorageContext.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxFirebaseStorageService implements FirebaseStorageAccessor {\n readonly storageContext = inject<FirebaseStorageContext>(DBX_FIREBASE_STORAGE_CONTEXT_TOKEN);\n\n defaultBucket() {\n return this.storageContext.defaultBucket();\n }\n\n file(path: StoragePathInput): FirebaseStorageAccessorFile {\n return this.storageContext.file(path);\n }\n\n folder(path: StoragePathInput): FirebaseStorageAccessorFolder {\n return this.storageContext.folder(path);\n }\n}\n","import { type EnvironmentProviders, Injector, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { FirebaseApp } from '@angular/fire/app';\nimport { type FirebaseStorageContextFactoryConfig, clientFirebaseStorageContextFactory } from '@dereekb/firebase';\nimport { DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN, DBX_FIREBASE_STORAGE_CONTEXT_TOKEN } from './firebase.storage';\nimport { DbxFirebaseStorageService } from './firebase.storage.service';\nimport { Storage } from '@angular/fire/storage';\n\nexport type DbxFirebaseStorageContextConfigFactory = (app: FirebaseApp, injector: Injector) => FirebaseStorageContextFactoryConfig;\n\n/**\n * The default factory function for the DbxFirebaseStorageContext.\n *\n * @param base Optional base configuration to use.\n * @returns Factory function for the DbxFirebaseStorageContext.\n */\nexport function dbxFirebaseStorageProvidersContextConfigFactory(base?: FirebaseStorageContextFactoryConfig): DbxFirebaseStorageContextConfigFactory {\n return (app: FirebaseApp) => {\n return {\n defaultBucketId: base?.defaultBucketId || app.options.storageBucket,\n forceBucket: base?.forceBucket ?? false\n };\n };\n}\n\n/**\n * Configuration for provideDbxFirebaseStorage().\n */\nexport interface ProvideDbxFirebaseStorageConfig {\n /**\n * Optional context config to provide.\n */\n readonly contextConfig?: FirebaseStorageContextFactoryConfig;\n /**\n * Optional factory function to provide the context config.\n */\n readonly contextConfigFactory?: DbxFirebaseStorageContextConfigFactory;\n}\n\n/**\n * Creates EnvironmentProviders for the DbxFirebaseStorageService.\n *\n * @param config\n * @returns\n */\nexport function providedDbxFirebaseStorage(config?: ProvideDbxFirebaseStorageConfig): EnvironmentProviders {\n const configFactory = config?.contextConfigFactory ?? dbxFirebaseStorageProvidersContextConfigFactory(config?.contextConfig);\n\n const providers: Provider[] = [\n {\n provide: DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN,\n useFactory: configFactory,\n deps: [FirebaseApp, Injector]\n },\n {\n provide: DBX_FIREBASE_STORAGE_CONTEXT_TOKEN,\n useFactory: clientFirebaseStorageContextFactory,\n deps: [Storage, DBX_FIREBASE_STORAGE_CONTEXT_CONFIG_TOKEN]\n },\n DbxFirebaseStorageService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { NgModule } from '@angular/core';\nimport { DbxFirebaseModelModule } from './model/model.module';\n\n@NgModule({\n exports: [DbxFirebaseModelModule]\n})\nexport class DbxFirebaseModule {}\n","import { type EnvironmentProviders, type Injector, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxFirebaseModelTypesService, DbxFirebaseModelTypesServiceConfig } from './model.types.service';\n\n/**\n * Factory for DbxFirebaseModelTypesServiceConfig.\n */\nexport type DbxFirebaseModelTypesServiceConfigFactory = (injector: Injector) => DbxFirebaseModelTypesServiceConfig;\n\n/**\n * Configuration for provideDbxFirebaseModelTypesService().\n */\nexport interface ProvideDbxFirebaseModelTypesServiceConfig {\n /**\n * Factory for DbxFirebaseModelTypesServiceConfig.\n */\n readonly dbxFirebaseModelTypesServiceConfigFactory: DbxFirebaseModelTypesServiceConfigFactory;\n}\n\n/**\n * Creates EnvironmentProviders for DbxFirebaseModelTypesService.\n *\n * @param config Configuration\n * @returns EnvironmentProviders\n */\nexport function provideDbxFirebaseModelTypesService(config: ProvideDbxFirebaseModelTypesServiceConfig): EnvironmentProviders {\n const { dbxFirebaseModelTypesServiceConfigFactory } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxFirebaseModelTypesServiceConfig,\n useFactory: dbxFirebaseModelTypesServiceConfigFactory\n },\n DbxFirebaseModelTypesService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type ArrayOrValue, asArray, type Maybe } from '@dereekb/util';\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { type FirebaseFunctionsMap } from '@dereekb/firebase';\nimport { provideDbxFirebaseAuth, type ProvideDbxFirebaseAuthConfig } from './auth//firebase.auth.providers';\nimport { provideDbxFirebaseEmulator, type ProvideDbxFirebaseEmulatorsConfig } from './firebase/firebase.emulator.providers';\nimport { provideDbxFirebaseApp, type ProvideDbxFirebaseAppConfig } from './firebase/firebase.providers';\nimport { type ProvideDbxFirebaseFirestoreCollectionConfig, provideDbxFirestoreCollection } from './firestore/firebase.firestore.providers';\nimport { provideDbxFirebaseFunctions, type ProvideDbxFirebaseFunctionsConfig } from './function/firebase.function.providers';\nimport { type ProvideDbxFirebaseStorageConfig, providedDbxFirebaseStorage } from './storage/firebase.storage.providers';\nimport { provideDbxFirebaseDevelopment, type ProvideDbxFirebaseDevelopmentConfig } from './development/development.providers';\nimport { provideDbxFirebaseNotifications, type ProvideDbxFirebaseNotificationsConfig } from './modules/notification/notification.providers';\nimport { provideDbxFirebaseModelContextService, type ProvideDbxFirebaseModelContextServiceConfig } from './model/service/model.context.providers';\nimport { provideDbxFirebaseModelTypesService, type ProvideDbxFirebaseModelTypesServiceConfig } from './model/modules/model/model.types.providers';\nimport { provideDbxFirebaseAnalyticsUserEventsListenerService } from './analytics';\nimport { provideDbxFirebaseStorageFileService } from './modules/storagefile/storagefile.providers';\nimport { provideDbxFirebaseModelEntitiesWidgetService, type ProvideDbxFirebaseModelEntitiesWidgetServiceConfig } from './model/modules/model/entities/model.entities.providers';\n\nexport interface ProvideDbxFirebaseConfig<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap> {\n // Required Configurations\n readonly app: ProvideDbxFirebaseAppConfig;\n readonly emulator: ProvideDbxFirebaseEmulatorsConfig;\n readonly storage: ProvideDbxFirebaseStorageConfig;\n readonly auth: ProvideDbxFirebaseAuthConfig;\n readonly functions: ProvideDbxFirebaseFunctionsConfig<T, M>;\n readonly firestores: ArrayOrValue<ProvideDbxFirebaseFirestoreCollectionConfig<any>>;\n /**\n * Configuration for provideDbxFirebaseModelContextService().\n */\n readonly modelContextService: ProvideDbxFirebaseModelContextServiceConfig<any>;\n /**\n * Configuration for provideDbxFirebaseModelTypesService().\n */\n readonly modelTypesService: ProvideDbxFirebaseModelTypesServiceConfig;\n /**\n * Configuration for provideDbxFirebaseModelEntitiesWidgetService().\n */\n readonly modelEntitiesWidgetService?: Maybe<ProvideDbxFirebaseModelEntitiesWidgetServiceConfig>;\n /**\n * Configuration for provideDbxFirebaseDevelopment.\n *\n * If false, provideDbxFirebaseDevelopment() will not be provided/called.\n */\n readonly development?: ProvideDbxFirebaseDevelopmentConfig | false;\n\n // Optional\n /**\n * Configuration for provideDbxFirebaseNotifications().\n *\n * If not provided, provideDbxFirebaseNotifications() will not be provided/called.\n */\n readonly notifications?: ProvideDbxFirebaseNotificationsConfig;\n\n /**\n * If true, provideDbxFirebaseAnalyticsUserEventsListenerService() will be provided/called.\n */\n readonly provideAnalyticsUserEventsListener?: Maybe<boolean>;\n\n /**\n * If true, provideDbxFirebaseStorageFileService() will be provided/called.\n */\n readonly provideStorageFileService?: Maybe<boolean>;\n}\n\n/**\n * All-in-one provider for providing the main configurations for DbxFirebase.\n *\n * Requires the following already be provided/called:\n * - provideDbxModelService()\n *\n * @param config Configuration for provideDbxFirebase().\n * @returns EnvironmentProviders for the DbxFirebase configuration.\n */\nexport function provideDbxFirebase<T, M extends FirebaseFunctionsMap = FirebaseFunctionsMap>(config: ProvideDbxFirebaseConfig<T, M>) {\n const { app, emulator, storage, auth, functions, firestores, modelContextService, modelTypesService, development, notifications, provideAnalyticsUserEventsListener, provideStorageFileService, modelEntitiesWidgetService: inputModelEntitiesWidgetService } = config;\n\n const modelEntitiesWidgetServiceConfig = inputModelEntitiesWidgetService ?? {\n dbxFirebaseModelEntitiesWidgetServiceConfigFactory: () => ({ entries: [] })\n };\n\n const providers: EnvironmentProviders[] = [provideDbxFirebaseApp(app), provideDbxFirebaseEmulator(emulator), providedDbxFirebaseStorage(storage), provideDbxFirebaseAuth(auth), provideDbxFirebaseFunctions(functions), provideDbxFirebaseModelContextService(modelContextService), provideDbxFirebaseModelTypesService(modelTypesService), provideDbxFirebaseModelEntitiesWidgetService(modelEntitiesWidgetServiceConfig)];\n\n asArray(firestores).forEach((firestore) => {\n providers.push(provideDbxFirestoreCollection(firestore));\n });\n\n if (provideAnalyticsUserEventsListener) {\n providers.push(provideDbxFirebaseAnalyticsUserEventsListenerService());\n }\n\n if (development !== false) {\n providers.push(provideDbxFirebaseDevelopment(development ?? {}));\n }\n\n if (notifications != null) {\n providers.push(provideDbxFirebaseNotifications(notifications));\n }\n\n if (provideStorageFileService) {\n providers.push(provideDbxFirebaseStorageFileService());\n }\n\n return makeEnvironmentProviders(providers);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i3","i1.DbxFirebaseLoginButtonComponent","i1.DbxFirebaseLoginButtonContainerComponent","i1","importsAndExports","i1.NotificationBoxDocumentStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBM,SAAU,wBAAwB,CAAC,IAAU,EAAA;IACjD,OAAO;QACL,WAAW,EAAE,IAAI,EAAE,WAAW;QAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,YAAY,EAAE,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;QACvE,cAAc,EAAE,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc;KAC3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