@dereekb/dbx-core 13.4.2 → 13.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/rxjs/clean.ts","../../../../packages/dbx-core/src/lib/rxjs/subscription.ts","../../../../packages/dbx-core/src/lib/rxjs/lockset.ts","../../../../packages/dbx-core/src/lib/rxjs/loading.ts","../../../../packages/dbx-core/src/lib/rxjs/destroy.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.automodify.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.autotrigger.directive.ts","../../../../packages/dbx-core/src/lib/action/action.handler.ts","../../../../packages/dbx-core/src/lib/action/action.ts","../../../../packages/dbx-core/src/lib/action/action.store.ts","../../../../packages/dbx-core/src/lib/action/action.holder.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.provide.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/debug/action.logger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.key.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.utility.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.working.disable.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disabled.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disableonsuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/view/if.directive.ts","../../../../packages/dbx-core/src/lib/util/input.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.idle.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.presuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.error.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.enforce.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.stream.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.triggered.directive.ts","../../../../packages/dbx-core/src/lib/action/action.module.ts","../../../../packages/dbx-core/src/lib/action/action.reference.ts","../../../../packages/dbx-core/src/lib/router/segue.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/redirect.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/auth.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/role.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/state.hook.ts","../../../../packages/dbx-core/src/lib/context/context.ts","../../../../packages/dbx-core/src/lib/context/state/action/data.action.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/data.reducer.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/context/state/effect/index.ts","../../../../packages/dbx-core/src/lib/auth/auth.user.ts","../../../../packages/dbx-core/src/lib/auth/state/action/auth.action.ts","../../../../packages/dbx-core/src/lib/auth/state/action/user.action.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/user.reducer.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.go.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/state/effect/auth.router.state.effect.ts","../../../../packages/dbx-core/src/lib/auth/router/state/auth.router.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.providers.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.rxjs.ts","../../../../packages/dbx-core/src/lib/auth/state/effect/auth.effect.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.any.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.has.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.not.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.service.ts","../../../../packages/dbx-core/src/lib/button/button.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.trigger.directive.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.directive.ts","../../../../packages/dbx-core/src/lib/button/router/button.segue.directive.ts","../../../../packages/dbx-core/src/lib/button/button.directive.ts","../../../../packages/dbx-core/src/lib/button/button.loading.directive.ts","../../../../packages/dbx-core/src/lib/button/button.module.ts","../../../../packages/dbx-core/src/lib/context/context.service.ts","../../../../packages/dbx-core/src/lib/context/context.directive.ts","../../../../packages/dbx-core/src/lib/context/context.providers.ts","../../../../packages/dbx-core/src/lib/environment/environment.ts","../../../../packages/dbx-core/src/lib/environment/environment.service.ts","../../../../packages/dbx-core/src/lib/environment/environment.providers.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.ts","../../../../packages/dbx-core/src/lib/router/anchor/clickable.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/id.hook.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/uid.hook.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.providers.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.directive.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.watcher.directive.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.util.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.reader.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.default.ts","../../../../packages/dbx-core/src/lib/router/model/id.param.redirect.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.uid.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.id.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.key.directive.ts","../../../../packages/dbx-core/src/lib/pipe/async/asobservable.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedayrange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatfromto.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedaytimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/daterangedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonly.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/targetdatetosystemdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonlydistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timezoneabbreviation.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/systemdatetotargetdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tominutes.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/misc/prettyjson.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/cuttext.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/getvalue.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/dollar.pipe.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.content.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connect.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.instance.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.preset.ts","../../../../packages/dbx-core/src/lib/filter/filter.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.ts","../../../../packages/dbx-core/src/lib/injection/injection.util.ts","../../../../packages/dbx-core/src/lib/injection/injection.instance.ts","../../../../packages/dbx-core/src/lib/injection/injection.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.array.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.forward.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.rxjs.ts","../../../../packages/dbx-core/src/lib/injection/injector.ts","../../../../packages/dbx-core/src/lib/ngrx/store.lockset.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.string.ts","../../../../packages/dbx-core/src/lib/storage/storage.di.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.factory.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.localstorage.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.memory.ts","../../../../packages/dbx-core/src/lib/storage/storage.providers.ts","../../../../packages/dbx-core/src/lib/util/view.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { type Destroyable, type DestroyFunction } from '@dereekb/util';\nimport { type Subject } from 'rxjs';\n\n/**\n * Wraps a Destroyable in a function that registers the input Destroyable to be destroyed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Clean up a Destroyable object (e.g., SubscriptionObject, LockSet):\n * const sub = new SubscriptionObject(obs$.subscribe(handler));\n * clean(sub);\n *\n * @example\n * // Clean up a destroy function directly:\n * clean(() => resource.release());\n *\n * @param input - The Destroyable object or destroy function to register for cleanup.\n * @returns The same input, for chaining.\n */\nexport function clean<T extends Destroyable | DestroyFunction>(input: T): T {\n const destroyRef = inject(DestroyRef);\n\n if ((input as Destroyable).destroy) {\n destroyRef.onDestroy(() => (input as Destroyable).destroy());\n } else {\n destroyRef.onDestroy(input as DestroyFunction);\n }\n\n return input;\n}\n\n/**\n * Wraps a Subject in a function that registers the input Subject to be completed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Complete a BehaviorSubject when the component is destroyed:\n * readonly value$ = completeOnDestroy(new BehaviorSubject<string>('initial'));\n *\n * @example\n * // Complete a ReplaySubject when the component is destroyed:\n * readonly events$ = completeOnDestroy(new ReplaySubject<Event>(1));\n *\n * @param input - The Subject to register for completion on destroy.\n * @returns The same input, for chaining.\n */\nexport function completeOnDestroy<T extends Pick<Subject<unknown>, 'complete' | 'error'>>(input: T): T {\n clean(() => input.complete());\n return input;\n}\n","import { SubscriptionObject } from '@dereekb/rxjs';\nimport { type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { type Unsubscribable } from 'rxjs';\nimport { clean } from './clean';\n\n// MARK: cleanSubscription()\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription directly - it will be cleaned up automatically:\n * cleanSubscription(obs$.subscribe(handler));\n *\n * // Or create first, then set the subscription later:\n * readonly _sub = cleanSubscription();\n * this._sub.subscription = obs$.subscribe(handler);\n *\n * @param sub - Optional subscription or getter to wrap.\n * @returns A SubscriptionObject that is automatically destroyed when the context is destroyed.\n */\nexport function cleanSubscription<T extends Unsubscribable = Unsubscribable>(sub?: Maybe<GetterOrValue<T>>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n clean(subscriptionObject);\n return subscriptionObject;\n}\n","import { DestroyRef, inject } from '@angular/core';\nimport { type DestroyOnNextUnlockConfig, LockSet, SubscriptionObject } from '@dereekb/rxjs';\nimport { type Configurable, type DestroyFunction, type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from './subscription';\nimport { type Unsubscribable } from 'rxjs';\n\n/**\n * Configuration for {@link cleanLockSet}, controlling destruction timing and lifecycle callbacks.\n */\nexport interface CleanLockSetConfig {\n /**\n * Callback invoked when the Angular `DestroyRef` fires, before the lock set begins its unlock-and-destroy sequence.\n */\n readonly onDestroy?: Maybe<() => void>;\n /**\n * Callback invoked when the lock set has fully completed destruction (after all locks are released).\n */\n readonly onLockSetDestroy?: Maybe<() => void>;\n /**\n * Timing configuration for the deferred destruction of the lock set.\n */\n readonly destroyLocksetTiming?: Maybe<DestroyOnNextUnlockConfig>;\n}\n\n/**\n * A {@link LockSet} created by {@link cleanLockSet} that exposes a `_cleanDestroy` method\n * for programmatically triggering the destroy sequence outside of Angular's `DestroyRef`.\n */\nexport type CleanLockSet = LockSet & { readonly _cleanDestroy: () => void };\n\n/**\n * Creates a new LockSet that is automatically destroyed when the component is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @param config - Optional configuration for destruction behavior and callbacks.\n * @returns A CleanLockSet that is automatically destroyed when the context is destroyed.\n *\n * @example\n * // Create a simple lockset:\n * readonly lockSet = cleanLockSet();\n *\n * @example\n * // Create with a callback when the lockset is destroyed:\n * readonly lockSet = cleanLockSet({\n * onLockSetDestroy: () => console.log('lockset destroyed')\n * });\n */\nexport function cleanLockSet(config?: Maybe<CleanLockSetConfig>): CleanLockSet {\n const { onDestroy, onLockSetDestroy, destroyLocksetTiming } = config ?? {};\n\n const destroyRef = inject(DestroyRef);\n const lockSet = new LockSet() as unknown as CleanLockSet;\n\n function cleanDestroy() {\n onDestroy?.();\n lockSet.destroyOnNextUnlock(destroyLocksetTiming); // flag to be destroyed on the next complete unlock\n }\n\n destroyRef.onDestroy(() => cleanDestroy());\n\n if (onLockSetDestroy) {\n const _destroySub = cleanSubscription(\n lockSet.onDestroy$.subscribe(() => {\n onLockSetDestroy();\n _destroySub.destroy();\n })\n );\n }\n\n (lockSet as Configurable<CleanLockSet>)._cleanDestroy = cleanDestroy;\n return lockSet;\n}\n\n// MARK: cleanWithLockSet()\n/**\n * Runs the given onDestroy function when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @param lockSet The lockset to use.\n * @param onDestroy The function to run when the lockset is unlocked.\n *\n * @example\n * // Defer cleanup until the lockset unlocks after component destroy:\n * cleanWithLockSet(this.lockSet, () => resource.release());\n */\nexport function cleanWithLockSet(lockSet: LockSet, onDestroy: DestroyFunction) {\n const destroyRef = inject(DestroyRef);\n\n destroyRef.onDestroy(() => {\n lockSet.onNextUnlock(() => {\n onDestroy();\n });\n });\n}\n\n// MARK: cleanSubscriptionWithLockSet()\n/**\n * Configuration for {@link cleanSubscriptionWithLockSet}, specifying the lock set and optional initial subscription.\n *\n * @typeParam T - The type of unsubscribable being managed.\n */\nexport interface CleanSubscriptionWithLockSetConfig<T extends Unsubscribable = Unsubscribable> {\n readonly lockSet: LockSet;\n readonly sub?: Maybe<GetterOrValue<T>>;\n}\n\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription that waits for the lockset to unlock before cleanup:\n * readonly _sub = cleanSubscriptionWithLockSet({\n * lockSet: this.lockSet,\n * sub: obs$.subscribe(handler)\n * });\n *\n * @example\n * // Create first, then set the subscription later:\n * readonly _sub = cleanSubscriptionWithLockSet({ lockSet: this.lockSet });\n * this._sub.subscription = obs$.subscribe(handler);\n *\n * @param input - Configuration specifying the lock set and optional initial subscription.\n * @returns A SubscriptionObject that is destroyed when the context is destroyed and the lock set unlocks.\n */\nexport function cleanSubscriptionWithLockSet<T extends Unsubscribable = Unsubscribable>(input: CleanSubscriptionWithLockSetConfig<T>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(input.sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n cleanWithLockSet(input.lockSet, () => subscriptionObject.destroy());\n return subscriptionObject;\n}\n","import { type LoadingState, type LoadingContextEvent, type LoadingStateContextInput, type MutableLoadingStateContext, loadingStateContext, type ListLoadingState, type ListLoadingStateContextInput, type MutableListLoadingStateContext, listLoadingStateContext } from '@dereekb/rxjs';\nimport { clean } from './clean';\n\n/**\n * Creates a new LoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly context = cleanLoadingContext<MyData>(this.data$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly context = cleanLoadingContext<MyData>();\n * this.context.obs = this.data$;\n *\n * @param input - Optional loading state context input configuration.\n * @returns A mutable loading state context that is automatically destroyed on cleanup.\n */\nexport function cleanLoadingContext<T = unknown, S extends LoadingState<T> = LoadingState<T>, E extends LoadingContextEvent = LoadingContextEvent & S>(input?: LoadingStateContextInput<T, S, E>): MutableLoadingStateContext<T, S, E> {\n return clean(loadingStateContext(input));\n}\n\n/**\n * Creates a new ListLoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly listContext = cleanListLoadingContext<MyItem>(this.items$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly listContext = cleanListLoadingContext<MyItem>();\n * this.listContext.obs = this.items$;\n *\n * @param input - Optional list loading state context input configuration.\n * @returns A mutable list loading state context that is automatically destroyed on cleanup.\n */\nexport function cleanListLoadingContext<L = unknown, S extends ListLoadingState<L> = ListLoadingState<L>>(input?: ListLoadingStateContextInput<L, S>): MutableListLoadingStateContext<L, S> {\n return clean(listLoadingStateContext(input));\n}\n","import { type DestroyFunction, DestroyFunctionObject, type Maybe } from '@dereekb/util';\nimport { clean } from './clean';\n\n/**\n * Creates a new DestroyFunctionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a destroy function directly:\n * cleanDestroy(() => resource.release());\n *\n * @example\n * // Create first, then set the destroy function later:\n * readonly _destroy = cleanDestroy();\n * this._destroy.setDestroyFunction(() => resource.release());\n *\n * @param input - Optional destroy function to wrap.\n * @returns A DestroyFunctionObject that will be automatically destroyed when the context is destroyed.\n */\nexport function cleanDestroy(input?: Maybe<DestroyFunction>): DestroyFunctionObject {\n const destroyFunction = new DestroyFunctionObject(input);\n clean(destroyFunction);\n return destroyFunction;\n}\n","import { first, switchMap, type Observable, type Subscription } from 'rxjs';\nimport { LockSet, filterMaybe, type LoadingState, type LoadingStateType, type MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe, type ReadableError } from '@dereekb/util';\nimport { type ActionContextState, type ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey, type DbxActionRejectedPair, type DbxActionState, type DbxActionSuccessPair, type DbxActionWorkOrWorkProgress, type DbxActionWorkProgress } from './action';\n\n/**\n * Abstract source that provides an observable of an {@link ActionContextStore}.\n *\n * This is the primary injection token used by action directives to access the action state.\n * Implementations are typically provided via Angular's DI, either by {@link DbxActionDirective}\n * or through secondary source providers.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionDirective} for the directive that provides this source.\n * @see {@link SecondaryActionContextStoreSource} for nested action source forwarding.\n */\nexport abstract class ActionContextStoreSource<T = unknown, O = unknown> {\n /**\n * Observable referencing the {@link ActionContextStore}.\n *\n * This observable is pre-filtered to never emit null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary action context store source used for nested or forwarded action contexts.\n *\n * When a {@link DbxActionDirective} is created, it checks for the presence of this secondary\n * source via host injection. If found, the directive reuses the existing store rather than\n * creating its own, enabling action context sharing across component boundaries.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionSourceDirective} for the directive that provides this.\n */\nexport abstract class SecondaryActionContextStoreSource<T = unknown, O = unknown> extends ActionContextStoreSource<T, O> {}\n\n/**\n * Filters null/undefined values from an observable of {@link ActionContextStore} instances.\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param obs - The observable that may emit null/undefined store values.\n * @returns An observable that only emits non-null store instances.\n */\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\n/**\n * Function that receives an {@link ActionContextStore} and returns an observable derived from it.\n *\n * @typeParam R - The return type of the derived observable.\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n */\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\n/**\n * Pipes a function through the action store from the given source.\n *\n * Subscribes to the source's store observable and applies the provided function\n * via switchMap, automatically switching to the latest store.\n *\n * @typeParam R - The return type of the derived observable.\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param source - The action context store source to read from.\n * @param pipeFn - The function to apply to each emitted store.\n * @returns An observable of the derived value.\n */\nexport function pipeActionStore<R = unknown, T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(switchMap(pipeFn));\n}\n\n/**\n * Function that receives an {@link ActionContextStore} for imperative use (e.g., triggering state changes).\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n */\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Subscribes to the source once and invokes the provided function with the store.\n *\n * This is a convenience for performing one-shot imperative operations on the store,\n * such as triggering an action or setting a value, without maintaining a long-lived subscription.\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param source - The action context store source to read from.\n * @param useFn - The function to invoke with the store.\n * @returns The subscription (completes after first emission).\n */\nexport function useActionStore<T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n/**\n * Convenience wrapper around an {@link ActionContextStoreSource} that provides direct\n * access to all the store's reactive selectors and imperative state-change methods.\n *\n * This class is the primary interface injected by action directives to interact with\n * the action lifecycle. It delegates all operations through the underlying source's\n * store observable, while also maintaining a {@link LockSet} for cleanup coordination.\n *\n * All reactive properties (e.g., `isWorking$`, `success$`, `error$`) are piped through\n * the source's `store$` via switchMap, so they automatically follow store changes.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link ActionContextStore} for the underlying store.\n * @see {@link ActionContextStoreSource} for the source abstraction.\n */\nexport class DbxActionContextStoreSourceInstance<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n readonly lockSet = new LockSet();\n\n private readonly _source: ActionContextStoreSource<T, O>;\n\n constructor(source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n\n this._source = source;\n }\n\n get source(): ActionContextStoreSource<T, O> {\n return this._source;\n }\n\n public destroy(): void {\n this.lockSet.destroyOnNextUnlock();\n }\n\n // MARK: Store\n get store$(): Observable<ActionContextStore<T, O>> {\n return this.source.store$;\n }\n\n pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return pipeActionStore(this.source, pipeFn);\n }\n\n useStore(useFn: UseActionStoreFunction<T, O>): Subscription {\n return useActionStore(this.source, useFn);\n }\n\n get state$(): Observable<ActionContextState<T, O>> {\n return this.pipeStore((x) => x.state$);\n }\n\n get idle$(): Observable<boolean> {\n return this.pipeStore((x) => x.idle$);\n }\n\n get triggered$(): Observable<boolean> {\n return this.pipeStore((x) => x.triggered$);\n }\n\n get valueReady$(): Observable<T> {\n return this.pipeStore((x) => x.valueReady$);\n }\n\n get success$(): Observable<Maybe<O>> {\n return this.pipeStore((x) => x.success$);\n }\n\n get successPair$(): Observable<DbxActionSuccessPair<T, O>> {\n return this.pipeStore((x) => x.successPair$);\n }\n\n get workProgress$(): Observable<Maybe<DbxActionWorkProgress>> {\n return this.pipeStore((x) => x.workProgress$);\n }\n\n get error$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.error$);\n }\n\n get rejected$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.rejected$);\n }\n\n get rejectedPair$(): Observable<DbxActionRejectedPair<T>> {\n return this.pipeStore((x) => x.rejectedPair$);\n }\n\n get isModified$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModified$);\n }\n\n get canTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.canTrigger$);\n }\n\n get isModifiedAndCanTriggerUpdates$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTriggerUpdates$);\n }\n\n get isModifiedAndCanTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTrigger$);\n }\n\n get actionState$(): Observable<DbxActionState> {\n return this.pipeStore((x) => x.actionState$);\n }\n\n get loadingState$(): Observable<LoadingState<O>> {\n return this.pipeStore((x) => x.loadingState$);\n }\n\n get loadingStateType$(): Observable<LoadingStateType> {\n return this.pipeStore((x) => x.loadingStateType$);\n }\n\n get isWorking$(): Observable<boolean> {\n return this.pipeStore((x) => x.isWorking$);\n }\n\n get isWorkingOrWorkProgress$(): Observable<DbxActionWorkOrWorkProgress> {\n return this.pipeStore((x) => x.isWorkingOrWorkProgress$);\n }\n\n get isSuccess$(): Observable<boolean> {\n return this.pipeStore((x) => x.isSuccess$);\n }\n\n get disabledKeys$(): Observable<string[]> {\n return this.pipeStore((x) => x.disabledKeys$);\n }\n\n get isDisabled$(): Observable<boolean> {\n return this.pipeStore((x) => x.isDisabled$);\n }\n\n get errorCountSinceLastSuccess$(): Observable<number> {\n return this.pipeStore((x) => x.errorCountSinceLastSuccess$);\n }\n\n public enable(key?: DbxActionDisabledKey, enable = true): void {\n this.disable(key, !enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable = true): void {\n this.useStore((x) => (disable ? x.disable(key) : x.enable(key)));\n }\n\n public setIsSame(isSame?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsSame(isSame));\n }\n\n public setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public setWorkProgress(workProgress: MaybeObservableOrValue<DbxActionWorkProgress>): void {\n this.useStore((x) => x.setWorkProgress(workProgress));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\n }\n\n public triggerWithValue(value: T | Observable<T>): void {\n this.useStore((x) => {\n x.trigger();\n x.readyValue(value);\n });\n }\n\n public readyValue(value: T | Observable<T>): void {\n this.useStore((x) => x.readyValue(value));\n }\n\n public startWorking(): void {\n this.useStore((x) => x.startWorking());\n }\n\n public reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.useStore((x) => x.reject(error));\n }\n\n public resolve(value: O | Observable<O>): void {\n this.useStore((x) => x.resolve(value));\n }\n\n public reset(): void {\n this.useStore((x) => x.reset());\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { distinctUntilChanged, filter, switchMap, type Observable, EMPTY } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isNotFalse } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that automatically marks the parent action as modified whenever it becomes unmodified.\n *\n * This ensures the action is always considered \"modified\" and therefore always eligible for triggering.\n * Useful in combination with {@link DbxActionAutoTriggerDirective} and {@link DbxActionEnforceModifiedDirective}\n * when the action should be continuously available for submission.\n *\n * Can be disabled by setting `dbxActionAutoModify` to `false`.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionAutoModify></ng-container>\n * <ng-container dbxActionAutoTrigger></ng-container>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionAutoTriggerDirective} for automatically triggering modified actions.\n */\n@Directive({\n selector: 'dbxActionAutoModify, [dbxActionAutoModify]',\n standalone: true\n})\nexport class DbxActionAutoModifyDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n readonly autoModifyEnabled = input<boolean, string | boolean>(true, { alias: 'dbxActionAutoModify', transform: isNotFalse });\n readonly markAsModified$: Observable<void> = toObservable(this.autoModifyEnabled).pipe(\n distinctUntilChanged(),\n switchMap((x) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let obs: Observable<any>;\n\n if (x) {\n obs = this.source.isModified$.pipe(filter((x) => !x));\n } else {\n obs = EMPTY;\n }\n\n return obs;\n })\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.markAsModified$.subscribe(() => {\n this.source.setIsModified(true);\n })\n });\n }\n}\n","import { inject, Directive, input, computed, signal, type Signal } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle, EMPTY, interval, combineLatest, type Observable } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isDefinedAndNotFalse, isNotFalse, type Maybe } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nconst DEFAULT_DEBOUNCE_MS = 2 * 1000;\n\nconst DEFAULT_THROTTLE_MS = 10 * 1000;\n\nconst DEFAULT_ERROR_THROTTLE_MS = 3 * 1000;\n\nconst MAX_ERRORS_TO_THROTTLE_ON = 6;\n\nconst DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE = 200;\nconst DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE = 10;\n\n/**\n * Directive that automatically triggers the parent action when the action becomes modified and can be triggered.\n *\n * Uses configurable debounce and throttle timers to prevent excessive triggering. Also\n * supports error-aware throttling: as consecutive errors accumulate, the throttle interval\n * increases to give transient issues time to resolve.\n *\n * Useful for auto-save scenarios where data changes should automatically submit without\n * requiring an explicit user action. Use with care to avoid triggering loops.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionAutoTrigger></ng-container>\n * <!-- form or value source here -->\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Fast trigger preset with limit -->\n * <div dbxAction>\n * <ng-container dbxActionAutoTrigger useFastTriggerPreset [triggerLimit]=\"5\"></ng-container>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionAutoModifyDirective} for automatically marking the action as modified.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger,[dbxActionAutoTrigger]',\n standalone: true\n})\nexport class DbxActionAutoTriggerDirective<T = unknown, O = unknown> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly triggerDebounce = input<Maybe<number>>(undefined);\n readonly triggerThrottle = input<Maybe<number>>(undefined);\n readonly triggerErrorThrottle = input<number, Maybe<number>>(DEFAULT_ERROR_THROTTLE_MS, { transform: (x) => x ?? DEFAULT_ERROR_THROTTLE_MS });\n readonly maxErrorsForThrottle = input<number, Maybe<number>>(MAX_ERRORS_TO_THROTTLE_ON, { transform: (x) => x ?? MAX_ERRORS_TO_THROTTLE_ON });\n readonly triggerLimit = input<Maybe<number>>();\n readonly triggerEnabled = input<boolean, Maybe<string | boolean>>(true, { alias: 'dbxActionAutoTrigger', transform: isNotFalse });\n readonly useFastTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n readonly useInstantTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n\n readonly triggerDebounceSignal = computed(() => {\n let debounce = this.triggerDebounce();\n\n if (debounce == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return debounce ?? DEFAULT_DEBOUNCE_MS;\n });\n\n readonly triggerThrottleSignal: Signal<number> = computed(() => {\n let throttle = this.triggerThrottle();\n\n if (throttle == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return throttle ?? DEFAULT_THROTTLE_MS;\n });\n\n readonly triggerCountSignal = signal<number>(0);\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n // each time something is triggered the\n filter(() => this.triggerEnabled() ?? false),\n debounce(() => interval(this.triggerDebounceSignal())),\n throttle(\n () =>\n this._errorCount$.pipe(\n first(),\n exhaustMap((errorCount) => {\n const maxErrors = this.maxErrorsForThrottle() ?? MAX_ERRORS_TO_THROTTLE_ON;\n const throttleTime = this.triggerErrorThrottle() ?? DEFAULT_ERROR_THROTTLE_MS;\n const additionalInterval = Math.min(errorCount, maxErrors) * throttleTime;\n\n return interval(this.triggerThrottleSignal() + additionalInterval);\n })\n ),\n { leading: true, trailing: true }\n ),\n // Check again for the \"trailing\" piece.\n filter(() => this.triggerEnabled() ?? false),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => {\n const count = this.triggerCountSignal();\n this.triggerCountSignal.update((x) => x + 1);\n return count;\n }),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = toObservable(this.triggerEnabled).pipe(\n switchMap((enabled) => {\n let countObs: Observable<number>;\n\n if (enabled !== false) {\n countObs = this._triggerCount$;\n } else {\n countObs = EMPTY;\n }\n\n return countObs;\n })\n );\n\n private readonly _isTriggerLimited$: Observable<readonly [number, boolean]> = combineLatest([this.triggerCount$, toObservable(this.triggerLimit)]).pipe(\n map(([triggerCount, limit]) => {\n const isAllowedToRun = limit != null ? triggerCount < limit : true;\n return [triggerCount, isAllowedToRun] as const;\n }),\n shareReplay(1)\n );\n\n readonly isTriggerAllowedToRun$ = this._isTriggerLimited$.pipe(\n map((x) => x[1]),\n shareReplay(1)\n );\n\n readonly automaticTrigger$: Observable<void> = this._isTriggerLimited$.pipe(\n filter((x) => x[1]),\n distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.\n map(() => undefined as void)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.automaticTrigger$.subscribe(() => {\n this.source.trigger();\n })\n });\n }\n}\n","import { type Maybe, type ReadableError } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\nimport { type WorkInstanceDelegate } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * {@link WorkInstanceDelegate} implementation that bridges the `@dereekb/rxjs` work execution\n * system with the action context store.\n *\n * This delegate translates work lifecycle events (startWorking, success, reject) into\n * corresponding state transitions on the {@link DbxActionContextStoreSourceInstance},\n * allowing {@link workFactory} to drive the action state machine.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerInstance} which uses this delegate to handle value-ready events.\n */\nexport class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> implements WorkInstanceDelegate<O> {\n private _source: DbxActionContextStoreSourceInstance<T, O>;\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._source = source;\n }\n\n get source() {\n return this._source;\n }\n\n startWorking(): void {\n this.source.startWorking();\n }\n\n success(result: O): void {\n this.source.resolve(result);\n }\n\n reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.source.reject(error);\n }\n}\n","import { LoadingStateType } from '@dereekb/rxjs';\nimport { type PercentNumber, type Maybe } from '@dereekb/util';\n\n/**\n * Represents the percent completion of an in-progress action.\n *\n * This is a {@link PercentNumber}, a number between 0 and 100 where 0 means just started and 100 means complete.\n *\n * @see {@link DbxActionWorkOrWorkProgress} for the union type that includes boolean working state.\n */\nexport type DbxActionWorkProgress = PercentNumber;\n\n/**\n * Union type representing either a boolean working indicator or a numeric progress value.\n *\n * - `true` indicates the action is working but no specific progress percentage is available.\n * - `false` indicates the action is not working.\n * - A {@link DbxActionWorkProgress} number (0-100) indicates both that the action is working and how far along it is.\n *\n * @see {@link DbxActionWorkProgress}\n */\nexport type DbxActionWorkOrWorkProgress = boolean | DbxActionWorkProgress;\n\n/**\n * Creates a working progress value from an array of working progress values.\n *\n * @param workOrWorkProgress The array of working progress values to use.\n * @param progressPercent An optional progress percent value to use if the working progress is a boolean.\n * @returns The working progress value.\n */\nexport function dbxActionWorkProgress(workOrWorkProgress: Maybe<DbxActionWorkOrWorkProgress>[], progressPercent?: Maybe<DbxActionWorkProgress>) {\n const workingValue = workOrWorkProgress.reduce((acc, val) => acc ?? val);\n const isWorking = workingValue != null && workingValue !== false;\n\n let workingProgress: DbxActionWorkOrWorkProgress;\n\n if (isWorking) {\n if (typeof workingValue === 'number') {\n workingProgress = workingValue;\n } else {\n workingProgress = progressPercent ?? true;\n }\n } else {\n workingProgress = false;\n }\n\n return workingProgress;\n}\n\n/**\n * Used by ActionContextState to denote what state the action is in.\n */\nexport enum DbxActionState {\n /**\n * No action in progress. Waiting for the trigger.\n */\n IDLE = 'idle',\n /**\n * Idle state that can be set to show that the source is not yet ready.\n */\n DISABLED = 'disabled',\n /**\n * The action was triggered. We wait (and allow) the value to be updated.\n */\n TRIGGERED = 'triggered',\n /**\n * The trigger was accepted and the value is updated. It should begin working immediately.\n *\n * ValueReady cannot be set until triggered is set.\n */\n VALUE_READY = 'valueReady',\n /**\n * The action is in progress.\n */\n WORKING = 'working',\n /**\n * The trigger, action, or value was rejected due to an error or other issue.\n *\n * An error may be specified optionally.\n */\n REJECTED = 'rejected',\n /**\n * The action resolved without issue.\n */\n RESOLVED = 'resolved'\n}\n\n/**\n * Pairs the input value with the output result from a successfully resolved action.\n *\n * Emitted by {@link ActionContextStore.successPair$} when an action completes without error.\n *\n * @typeParam T - The input value type provided to the action.\n * @typeParam O - The output result type produced by the action.\n */\nexport interface DbxActionSuccessPair<T, O> {\n readonly value: T;\n readonly result: Maybe<O>;\n}\n\n/**\n * Pairs the input value with the error from a rejected action.\n *\n * Emitted by {@link ActionContextStore.rejectedPair$} when an action fails.\n *\n * @typeParam T - The input value type that was provided to the action before rejection.\n */\nexport interface DbxActionRejectedPair<T> {\n readonly value: T;\n readonly error: unknown;\n}\n\n/**\n * Unique string key used to track individual reasons for disabling an action.\n *\n * Multiple keys can be active simultaneously, and the action remains disabled\n * as long as at least one key is present. This allows multiple independent sources\n * (e.g., form validation, permissions, working state) to each control the disabled state\n * without conflicting with one another.\n *\n * @see {@link ActionContextStore.disable}\n * @see {@link ActionContextStore.enable}\n */\nexport type DbxActionDisabledKey = string;\n\n/**\n * The default disabled key used when no specific key is provided to {@link ActionContextStore.disable}.\n */\nexport const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';\n\n/**\n * Determines whether the given action state represents an idle-like state.\n *\n * Idle-like states include IDLE, DISABLED, REJECTED, and RESOLVED -- any state\n * where the action is not currently in-progress (triggered, value-ready, or working).\n *\n * @param actionState - The action state to check.\n * @returns `true` if the state is idle-like, `false` if the action is in-progress.\n */\nexport function isIdleActionState(actionState: DbxActionState): boolean {\n switch (actionState) {\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n case DbxActionState.REJECTED:\n case DbxActionState.RESOLVED:\n return true;\n case DbxActionState.TRIGGERED:\n case DbxActionState.VALUE_READY:\n case DbxActionState.WORKING:\n return false;\n }\n}\n\n/**\n * Maps a {@link DbxActionState} to the corresponding {@link LoadingStateType}.\n *\n * This bridges the action state machine with the loading state system from `@dereekb/rxjs`,\n * allowing action states to be represented as loading states for UI display.\n *\n * @param actionState - The action state to convert.\n * @returns The corresponding loading state type (IDLE, LOADING, SUCCESS, or ERROR).\n */\nexport function loadingStateTypeForActionState(actionState: DbxActionState): LoadingStateType {\n let loadingStateType: LoadingStateType;\n\n switch (actionState) {\n case DbxActionState.RESOLVED:\n loadingStateType = LoadingStateType.SUCCESS;\n break;\n case DbxActionState.REJECTED:\n loadingStateType = LoadingStateType.ERROR;\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingStateType = LoadingStateType.IDLE;\n break;\n case DbxActionState.TRIGGERED:\n case DbxActionState.VALUE_READY:\n case DbxActionState.WORKING:\n loadingStateType = LoadingStateType.LOADING;\n break;\n }\n\n return loadingStateType;\n}\n","import { Injectable, type OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type Observable, distinctUntilChanged, filter, map, shareReplay, switchMap, startWith, of } from 'rxjs';\nimport { type BooleanStringKeyArray, BooleanStringKeyArrayUtility, type Maybe, type ReadableError } from '@dereekb/util';\nimport { type LoadingStateType, idleLoadingState, errorResult, filterMaybe, type LoadingState, scanCount, successResult, beginLoading } from '@dereekb/rxjs';\nimport { type DbxActionDisabledKey, type DbxActionRejectedPair, DbxActionState, type DbxActionSuccessPair, type DbxActionWorkOrWorkProgress, type DbxActionWorkProgress, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState, loadingStateTypeForActionState } from './action';\nimport { cleanLockSet } from '../rxjs';\n\n/**\n * Checks whether the action context is enabled (not disabled by any key).\n *\n * @param state - The current action context state to check.\n * @returns `true` if no disabled keys are active.\n */\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isFalse(state.disabled);\n}\n\n/**\n * Checks whether the action context is disabled by at least one disabled key.\n *\n * @param state - The current action context state to check.\n * @returns `true` if any disabled keys are active.\n */\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isTrue(state.disabled);\n}\n\n/**\n * Checks whether the action context state represents an effectively disabled state.\n *\n * An action is considered disabled when it is both idle (not in-progress) and has\n * at least one active disabled key.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action is idle and disabled.\n */\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\n/**\n * Checks whether the given action state represents an in-progress (non-idle) state.\n *\n * This is the inverse of {@link isIdleActionState}. Returns `true` for TRIGGERED, VALUE_READY, and WORKING states.\n *\n * @param actionState - The action state to check.\n * @returns `true` if the action is in any non-idle state.\n */\nexport function isWorkingActionState(actionState: DbxActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\n/**\n * Determines whether the action state allows triggering.\n *\n * An action can be triggered when it is idle (but not DISABLED specifically) and\n * not already in-progress.\n *\n * @param actionState - The action state to check.\n * @returns `true` if the action can be triggered from this state.\n */\nexport function canTriggerActionState(actionState: DbxActionState): boolean {\n return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);\n}\n\n/**\n * Determines whether the action can be triggered based on the full context state.\n *\n * Requires the action to be both enabled (no disabled keys) and in an idle action state.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action can be triggered.\n */\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\n/**\n * Determines whether a value can be readied for the action.\n *\n * A value can only be readied when the action is in the TRIGGERED state,\n * which means the trigger has been activated and the system is waiting for a value.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action is in the TRIGGERED state.\n */\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === DbxActionState.TRIGGERED;\n}\n\n/**\n * Checks whether the action context is both modified and ready to be triggered.\n *\n * This is commonly used by auto-trigger directives to determine when to fire automatically.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action is modified and can be triggered.\n */\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\n/**\n * Checks whether the action context has no error, is modified, and can be triggered.\n *\n * A stricter variant of {@link actionContextIsModifiedAndCanTrigger} that also requires\n * no error to be present in the current state.\n *\n * @param state - The current action context state to check.\n * @returns `true` if no error exists and the action is modified and triggerable.\n */\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\n/**\n * Converts an {@link ActionContextState} to a {@link LoadingState} for UI consumption.\n *\n * Maps the action lifecycle states to loading state equivalents:\n * - RESOLVED -> success result with the output value\n * - REJECTED -> error result with the error\n * - IDLE/DISABLED -> idle loading state\n * - All other states -> loading (with optional work progress)\n *\n * @typeParam O - The output result type.\n * @param state - The action context state to convert.\n * @returns A loading state representation of the action context state.\n */\nexport function loadingStateForActionContextState<O = unknown>(state: ActionContextState<unknown, O>): LoadingState<O> {\n let loadingState: LoadingState<O>;\n\n switch (state.actionState) {\n case DbxActionState.RESOLVED:\n loadingState = successResult(state.result);\n break;\n case DbxActionState.REJECTED:\n loadingState = errorResult(state.error);\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingState = idleLoadingState();\n break;\n case DbxActionState.TRIGGERED:\n case DbxActionState.VALUE_READY:\n case DbxActionState.WORKING:\n loadingState = beginLoading(state.workProgress != null ? { loadingProgress: state.workProgress } : undefined);\n break;\n }\n\n return loadingState;\n}\n\n/**\n * Extracts the {@link LoadingStateType} from the current action context state.\n *\n * A convenience wrapper around {@link loadingStateTypeForActionState} that accepts the full context state.\n *\n * @param state - The action context state to convert.\n * @returns The corresponding loading state type.\n */\nexport function loadingStateTypeForActionContextState(state: ActionContextState): LoadingStateType {\n return loadingStateTypeForActionState(state.actionState);\n}\n\n/**\n * Immutable snapshot of the entire action context state at a given point in time.\n *\n * This is the core state shape managed by {@link ActionContextStore}. It captures:\n * - The current lifecycle phase ({@link DbxActionState})\n * - Whether the source data has been modified\n * - The input value (set after trigger), the output result (set on success), and any error (set on rejection)\n * - The disabled state (a set of keys that each independently control disabling)\n * - Optional work progress for long-running actions\n *\n * @typeParam T - The input value type provided to the action after triggering.\n * @typeParam O - The output result type produced on successful resolution.\n */\nexport interface ActionContextState<T = unknown, O = unknown> {\n readonly actionState: DbxActionState;\n /**\n * Whether or not this action is flagged as having been modified.\n */\n readonly isModified: boolean;\n /**\n * The working progress of the action.\n *\n * Is reset to null when triggered/ready value is set.\n */\n readonly workProgress?: Maybe<DbxActionWorkProgress>;\n /**\n * Value that is set after a triggered action. Not to be confused with result.\n */\n readonly value?: Maybe<T>;\n /**\n * Resolved result value.\n */\n readonly result?: Maybe<O>;\n /**\n * Rejected error, if available.\n */\n readonly error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n readonly disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n readonly errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: DbxActionState.IDLE\n};\n\n/**\n * Delay in milliseconds before the lock set destroys the store after all locks are released.\n * Provides a grace period for actions to finalize before the store is torn down.\n */\nexport const ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME = 2000;\n\n/**\n * NgRx ComponentStore that manages the reactive state machine for a single action lifecycle.\n *\n * This is the central state container for the action system. It tracks the full lifecycle\n * of an action from idle through trigger, value preparation, work execution, and resolution\n * or rejection. Multiple selectors expose derived reactive streams for each phase.\n *\n * The store uses a {@link LockSet} for cleanup coordination: it delays its own destruction\n * until all in-flight work completes (e.g., a working action finishes), preventing\n * premature teardown of subscriptions.\n *\n * State transitions follow this flow:\n * ```\n * IDLE/DISABLED -> TRIGGERED -> VALUE_READY -> WORKING -> RESOLVED | REJECTED\n * ```\n *\n * @typeParam T - The input value type provided after triggering.\n * @typeParam O - The output result type produced on resolution.\n *\n * @see {@link ActionContextStoreSource} for providing store access to directives.\n * @see {@link DbxActionContextStoreSourceInstance} for the convenience wrapper.\n */\n@Injectable()\nexport class ActionContextStore<T = unknown, O = unknown> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n readonly lockSet = cleanLockSet({\n onLockSetDestroy: () => super.ngOnDestroy(),\n destroyLocksetTiming: {\n delayTime: ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME\n }\n });\n\n constructor() {\n super({ ...INITIAL_STATE } as ActionContextState<T, O>);\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(\n map((x) => (isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState)),\n shareReplay(1)\n );\n\n /**\n * Returns the current disabled reasons/keys.\n */\n readonly disabledKeys$ = this.state$.pipe(\n map((x) => [...(x.disabled ?? [])]),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Current value of the state.\n */\n readonly currentValue$: Observable<Maybe<T>> = this.state$.pipe(map((x) => x.value));\n\n /**\n * Maps the current state to true or not when the action state changes to/from disabled.\n */\n readonly isDisabled$ = this.state$.pipe(map(isDisabledActionContextState), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipes when idle but modified.\n */\n readonly isModified$ = this.afterDistinctBoolean((x) => x.isModified);\n\n /**\n * Pipes true when idle.\n */\n readonly idle$ = this.actionState$.pipe(\n map((x) => x === DbxActionState.IDLE),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes true when triggered.\n */\n readonly triggered$ = this.afterDistinctActionState(DbxActionState.TRIGGERED, () => true);\n\n /**\n * Pipes the readied value on ValueReady.\n */\n readonly valueReady$: Observable<T> = this.afterDistinctActionState(DbxActionState.VALUE_READY, (x) => x.value as T);\n\n /**\n * Pipes the working progress on the working state.\n */\n readonly workProgress$ = this.state$.pipe(\n map((x) => x.workProgress),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the error on the rejection state.\n */\n readonly rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, (x) => x.error);\n\n /**\n * Pipes the result when the ActionState becomes rejected.\n */\n readonly rejectedPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, error: x.error }) as DbxActionRejectedPair<T>);\n\n /**\n * Pipes the result when the ActionState becomes working.\n */\n readonly working$ = this.afterDistinctActionState(DbxActionState.WORKING, () => true);\n\n /**\n * Whether or not it is currently in a working state.\n */\n readonly isWorking$ = this.afterDistinctBoolean((x) => isWorkingActionState(x.actionState));\n\n /**\n * Pipes the current work or work progress.\n */\n readonly isWorkingOrWorkProgress$ = this.isWorking$.pipe(\n switchMap((x) => {\n let obs: Observable<DbxActionWorkOrWorkProgress>;\n\n if (x) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n startWith(x)\n );\n } else {\n obs = of(x);\n }\n\n return obs;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the current error.\n */\n readonly error$ = this.state$.pipe(\n map((x) => x.error),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => x.result);\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly successPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, result: x.result }) as DbxActionSuccessPair<T, O>);\n\n /**\n * Whether or not it is currently in a success state.\n */\n readonly isSuccess$ = this.afterDistinctBoolean((x) => x.actionState === DbxActionState.RESOLVED);\n\n /**\n * Returns a loading state based on the current state.\n */\n readonly loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(\n switchMap((x) => {\n const base = loadingStateForActionContextState<O>(x);\n let obs: Observable<LoadingState<O>>;\n\n if (base.loading === true) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n map((loadingProgress) => ({ ...base, loadingProgress })),\n startWith(base)\n );\n } else {\n obs = of(base);\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n\n /**\n * Returns the current LoadingStateType based on the current state.\n */\n readonly loadingStateType$ = this.state$.pipe(\n map((x) => loadingStateTypeForActionContextState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Number of errors since last success.\n */\n readonly errorCountSinceLastSuccess$ = this.isSuccess$.pipe(\n startWith(false),\n distinctUntilChanged(),\n switchMap(() => this.error$.pipe(filterMaybe(), scanCount(), startWith(0))),\n shareReplay(1)\n );\n\n /**\n * Whether or not the state can be triggered.\n */\n readonly canTrigger$ = this.state$.pipe(map(canTriggerAction), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipe that maps whether or not this is modified and can be triggered.\n *\n * Updates every state update instead of when the value changes.\n */\n readonly isModifiedAndCanTriggerUpdates$ = this.state$.pipe(\n map((x) => actionContextIsModifiedAndCanTrigger(x)),\n shareReplay(1)\n );\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(distinctUntilChanged());\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Adds a disabled reason.\n */\n readonly disable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.insert(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Removes a disabled reason.\n */\n readonly enable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.remove(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n *\n * Equivalent to calling setIsModified() with opposite input.\n */\n readonly setIsSame = this.updater<void, void | boolean>(updateIsSameOnActionContextState);\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater<void, void | boolean>(updateIsModifiedOnActionContextState);\n\n /**\n * Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).\n *\n * Will not fire if the action is disabled.\n */\n readonly trigger = this.updater((state) => (canTriggerAction(state) ? { isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined } : state));\n\n /**\n * Updates the value, setting value ready. The current result is cleared.\n */\n readonly readyValue = this.updater((state, value: T) => (canReadyValue(state) ? { ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined } : state));\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: DbxActionState.WORKING, workProgress: null }));\n\n /**\n * Updates the working progress.\n */\n readonly setWorkProgress = this.updater((state, workProgress: Maybe<DbxActionWorkProgress>) => ({ ...state, workProgress }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({\n isModified: state.isModified,\n actionState: DbxActionState.REJECTED,\n error,\n errorCount: (state.errorCount ?? 0) + 1,\n disabled: state.disabled\n }));\n\n /**\n * Updates the state to success, and optionally sets a result.\n *\n * Clears modified state, and any errors.\n */\n readonly resolve = this.updater((state, result?: Maybe<O>) => ({ isModified: false, actionState: DbxActionState.RESOLVED, value: state.value, result, error: undefined, disabled: state.disabled }));\n\n /**\n * Completely resets the store.\n */\n readonly reset = this.updater(() => ({ ...INITIAL_STATE }) as ActionContextState<T, O>);\n\n // MARK: Utility\n afterDistinctBoolean(fromState: (state: ActionContextState<T, O>) => boolean): Observable<boolean> {\n return this.state$.pipe(\n map((x) => fromState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n afterDistinctActionState<X>(actionState: DbxActionState, fromState: (state: ActionContextState<T, O>) => X): Observable<X> {\n return this.afterDistinctActionStateChange().pipe(\n filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.\n map((x) => fromState(x)),\n shareReplay(1)\n );\n }\n\n afterDistinctActionStateChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, x.actionState] as [ActionContextState, DbxActionState]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n afterDistinctLoadingStateTypeChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, loadingStateTypeForActionContextState(x)] as [ActionContextState, LoadingStateType]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the loading state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method\n override ngOnDestroy(): void {\n // do not call super.destroy here, to keep the component store from destroying itself.\n // the lockset is configured to cleanup the component store.\n }\n}\n\nfunction updateIsSameOnActionContextState<T, O>(state: ActionContextState<T, O>, isSame?: void | boolean): ActionContextState<T, O> {\n return updateIsModifiedOnActionContextState(state, isSame == null ? false : !isSame);\n}\n\nfunction updateIsModifiedOnActionContextState<T, O>(state: ActionContextState<T, O>, isModified?: void | boolean): ActionContextState<T, O> {\n return {\n ...state,\n actionState: state.actionState === DbxActionState.RESOLVED ? DbxActionState.IDLE : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true // if isModified is not input, default it to true\n };\n}\n","import { type Observable, of } from 'rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { type LockSet } from '@dereekb/rxjs';\nimport { type ActionContextStoreSource, DbxActionContextStoreSourceInstance, type SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey } from './action';\n\n/**\n * Base class for action context sources that can either reuse an existing\n * {@link SecondaryActionContextStoreSource} or create their own internal {@link ActionContextStore}.\n *\n * If a secondary source is provided (typically via Angular DI), it is used directly,\n * enabling store sharing across component boundaries. Otherwise, a new standalone store is created.\n *\n * This class also creates a {@link DbxActionContextStoreSourceInstance} for convenient access\n * to the store's reactive streams and imperative methods.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionDirective} which extends this class.\n * @see {@link DbxActionContextMachine} which extends this class for programmatic use.\n */\nexport abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n private readonly _inputSource: Maybe<SecondaryActionContextStoreSource<T, O>>;\n\n private readonly _store?: ActionContextStore<T, O>;\n private readonly _store$: Observable<ActionContextStore<T, O>>;\n private readonly _instance: DbxActionContextStoreSourceInstance<T, O>;\n\n readonly isModified$: Observable<boolean>;\n readonly triggered$: Observable<boolean>;\n readonly success$: Observable<Maybe<O>>;\n\n constructor(inputSource?: Maybe<SecondaryActionContextStoreSource<T, O>>) {\n this._inputSource = inputSource;\n\n if (inputSource) {\n this._store$ = inputSource.store$;\n } else {\n this._store = new ActionContextStore();\n this._store$ = of(this._store);\n }\n\n this._instance = new DbxActionContextStoreSourceInstance(this);\n this.isModified$ = this._instance.isModified$;\n this.triggered$ = this._instance.triggered$;\n this.success$ = this._instance.success$;\n }\n\n destroy(): void {\n if (this._store) {\n this._store.ngOnDestroy();\n this._instance.destroy();\n }\n }\n\n get inputSource() {\n return this._inputSource;\n }\n\n get lockSet(): LockSet {\n return this._instance.lockSet;\n }\n\n get sourceInstance(): DbxActionContextStoreSourceInstance<T, O> {\n return this._instance;\n }\n\n get store$(): Observable<ActionContextStore<T, O>> {\n return this._store$;\n }\n\n /**\n * Use to trigger the action directly.\n */\n public trigger(): void {\n this._instance.trigger();\n }\n\n public readyValue(value: T | Observable<T>): void {\n this._instance.readyValue(value);\n }\n\n /**\n * Triggers the context and then readies the value.\n *\n * @param value\n */\n public triggerWithValue(value: T | Observable<T>): void {\n this._instance.triggerWithValue(value);\n }\n\n public reset(): void {\n this._instance.reset();\n }\n\n public enable(key?: DbxActionDisabledKey, enable?: boolean): void {\n this._instance.enable(key, enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable?: boolean): void {\n this._instance.disable(key, disable);\n }\n\n public setIsModified(isModified?: boolean): void {\n this._instance.setIsModified(isModified);\n }\n}\n","import { type DbxActionContextSourceReference } from './action.reference';\nimport { delay, first } from 'rxjs';\nimport { type ActionContextStoreSource } from './action.store.source';\nimport { DbxActionWorkInstanceDelegate } from './action.handler';\nimport { DbxActionContextBaseSource } from './action.holder';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { SubscriptionObject, type Work, workFactory } from '@dereekb/rxjs';\nimport { Injectable } from '@angular/core';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Configuration for a {@link DbxActionContextMachine}.\n *\n * Controls how the machine handles the value-ready phase, whether it self-destructs\n * after a single use, and optional callbacks for success events.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n */\nexport interface DbxActionContextMachineConfig<T = unknown, O = unknown> {\n /**\n * Whether or not the machine should clean itself up after being triggered once.\n */\n readonly oneTimeUse: boolean;\n /**\n * Function to handle any valueReady events.\n *\n * If false, will not subscribe/handle valueReady$ events.\n */\n readonly handleValueReady: Work<T, O> | false;\n /**\n * Optional function to execute after the action has succeeded.\n */\n readonly onSuccess?: (value: Maybe<O>) => void;\n}\n\n/**\n * Configurable machine that handles components of the ActionContextStore lifecycle.\n *\n * It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.\n */\nexport class DbxActionContextMachine<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {\n private _isShutdown = true;\n\n private readonly _config: DbxActionContextMachineConfig<T, O>;\n private readonly _handleValueReadySub = new SubscriptionObject();\n private readonly _successSub = new SubscriptionObject();\n\n constructor(config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>) {\n super(source);\n this._config = config;\n\n // Handle Value Ready\n if (config.handleValueReady !== false) {\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n const doWork = workFactory({\n work: config.handleValueReady as Work<T, O>,\n delegate: new DbxActionWorkInstanceDelegate<T, O>(this.sourceInstance)\n });\n\n doWork(value);\n });\n }\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (config.onSuccess) {\n this._successSub.subscription = this.sourceInstance.success$.subscribe(config.onSuccess);\n }\n }\n\n override destroy(): void {\n super.destroy();\n this._handleValueReadySub.destroy();\n this._successSub.destroy();\n this._isShutdown = true;\n }\n\n get config() {\n return this._config;\n }\n\n get isShutdown(): boolean {\n return this._isShutdown;\n }\n}\n\n/**\n * DbxActionContextMachine configured for use as a Service/Injectable.\n */\n@Injectable()\nexport class DbxActionContextMachineAsService<T = unknown, O = unknown> extends DbxActionContextMachine<T, O> {\n constructor() {\n super({\n oneTimeUse: false,\n handleValueReady: false\n });\n\n clean(() => this.destroy());\n }\n}\n","import { forwardRef, type Provider, type Type } from '@angular/core';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { DbxActionContextMachineAsService } from './action.machine';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Creates Angular DI providers for an {@link ActionContextStoreSource} and its associated {@link DbxActionContextStoreSourceInstance}.\n *\n * When `sourceType` is provided, the existing class is registered as the source. When `null`,\n * a standalone {@link DbxActionContextMachineAsService} is created as the default implementation.\n *\n * @param sourceType - The concrete source class to register, or `null` to use the default machine-based implementation\n * @returns An array of Angular providers\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myAction]',\n * providers: provideActionStoreSource(MyActionDirective),\n * })\n * export class MyActionDirective extends ActionContextStoreSource { ... }\n * ```\n */\nexport function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S> | null): Provider[] {\n const storeSourceProvider: Provider =\n sourceType != null\n ? {\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n }\n : {\n provide: ActionContextStoreSource,\n useFactory: () => new DbxActionContextMachineAsService()\n };\n\n return [\n storeSourceProvider,\n {\n provide: DbxActionContextStoreSourceInstance,\n useFactory: (source: ActionContextStoreSource) => clean(new DbxActionContextStoreSourceInstance(source)),\n deps: [ActionContextStoreSource]\n }\n ];\n}\n\n/**\n * Creates Angular DI providers for a {@link SecondaryActionContextStoreSource} along with\n * the standard {@link ActionContextStoreSource} and {@link DbxActionContextStoreSourceInstance} providers.\n *\n * @param sourceType - The concrete secondary source class to register\n * @returns An array of Angular providers\n */\nexport function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, inject } from '@angular/core';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideActionStoreSource } from '../../action.store.source.provide';\nimport { DbxActionContextBaseSource } from '../../action.holder';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Core directive that creates and provides an action context for its host element and descendants.\n *\n * This is the root of the action system in templates. It creates an {@link ActionContextStore}\n * and provides it (along with the related source tokens) via Angular's dependency injection,\n * making the action lifecycle available to all child action directives.\n *\n * If a {@link SecondaryActionContextStoreSource} is available on the host, the directive will\n * reuse that store instead of creating its own, enabling action context forwarding.\n *\n * On destruction, the directive coordinates cleanup through a {@link LockSet} to ensure\n * in-flight operations complete before the store is torn down.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <button (click)=\"action.trigger()\">Submit</button>\n * <div *dbxActionHasSuccess>Success!</div>\n * <div *dbxActionWorking>Loading...</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- As an element -->\n * <dbx-action>\n * <ng-container [dbxActionHandler]=\"handleAction\">...</ng-container>\n * </dbx-action>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionSourceDirective} for forwarding an external action source.\n * @see {@link ActionContextStore} for the underlying state store.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction]',\n exportAs: 'action,dbxAction',\n providers: provideActionStoreSource(DbxActionDirective),\n standalone: true\n})\nexport class DbxActionDirective<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> {\n constructor() {\n super(inject(SecondaryActionContextStoreSource<T, O>, { optional: true, host: true }));\n\n // during cleaning/onDestroy, queue the lockset for cleanup\n clean(() => {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n });\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { type SecondaryActionContextStoreSource, type ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that forwards an externally-provided {@link ActionContextStoreSource} as a\n * {@link SecondaryActionContextStoreSource}, enabling child `dbxAction` directives to\n * reuse an existing action context rather than creating their own.\n *\n * This is useful when an action context is created programmatically (e.g., via\n * {@link DbxActionContextMachine}) and needs to be shared with template-based directives.\n *\n * @example\n * ```html\n * <!-- Forward a programmatic action source to template directives -->\n * <div [dbxActionSource]=\"myActionSource\">\n * <div dbxAction>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionDirective} for the directive that consumes this source.\n * @see {@link SecondaryActionContextStoreSource}\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: provideSecondaryActionStoreSource(DbxActionSourceDirective),\n standalone: true\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource {\n readonly dbxActionSource = input<Maybe<ActionContextStoreSource>>();\n\n readonly store$ = toObservable(this.dbxActionSource).pipe(\n filterMaybe(),\n switchMap((x) => actionContextStoreSourcePipe(x.store$))\n );\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs/lockset';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Debug directive that logs every action context state change to the console.\n *\n * Subscribes to the parent action's full state stream and prints each state snapshot\n * via `console.log`. Useful during development to inspect the action lifecycle transitions.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionLogger></ng-container>\n * <!-- other action directives -->\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]',\n standalone: true\n})\nexport class DbxActionContextLoggerDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.state$.subscribe((state) => {\n console.log('dbxActionLogger - state: ', state);\n })\n });\n }\n}\n","import { BehaviorSubject, distinctUntilChanged, map, type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { type ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { type Destroyable } from '@dereekb/util';\n\n/**\n * Arbitrary string key used to identify and look up an action within an {@link ActionContextStoreSourceMap}.\n *\n * Each key maps to a unique {@link ActionContextStoreSource}, allowing multiple independent\n * actions to be managed and referenced by name in a single map context.\n */\nexport type ActionKey = string;\n\n/**\n * Abstract map that associates {@link ActionKey} values with {@link ActionContextStoreSource} instances.\n *\n * This allows multiple independent actions to be registered and retrieved by key,\n * enabling coordination between related actions (e.g., disabling one while another is working).\n *\n * @typeParam T - The input value type for the actions.\n * @typeParam O - The output result type for the actions.\n *\n * @see {@link actionContextStoreSourceMap} for the factory function.\n * @see {@link DbxActionContextMapDirective} for the directive that provides this in templates.\n */\nexport abstract class ActionContextStoreSourceMap<T = unknown, O = unknown> implements Destroyable {\n /**\n * Returns the read-only map of action keys to sources.\n */\n abstract readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n /**\n * Returns a ActionContextStoreSource for the input action key.\n *\n * @param key Action key to retrieve the source for.\n */\n abstract sourceForKey(key: ActionKey): ActionContextStoreSource<T, O>;\n /**\n * Adds the store source for the input key.\n *\n * @param key Action key to add the source for.\n * @param source Store source to add.\n */\n abstract addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void;\n /**\n * Removes the store source for the input key.\n *\n * @param key Action key to remove the source for.\n */\n abstract removeStoreSource(key: ActionKey): void;\n /**\n * Destroys the map.\n */\n abstract destroy(): void;\n}\n\n/**\n * Creates a new ActionContextStoreSourceMap.\n *\n * @returns A new ActionContextStoreSourceMap.\n */\nexport function actionContextStoreSourceMap<T = unknown, O = unknown>(): ActionContextStoreSourceMap<T, O> {\n const _actionKeySourceMap = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource<T, O>>>(new Map());\n const actionKeySourceMap$ = _actionKeySourceMap.asObservable();\n\n function updateMap(fn: (map: Map<ActionKey, ActionContextStoreSource<T, O>>) => Map<ActionKey, ActionContextStoreSource<T, O>> | void): void {\n const currentMap = _actionKeySourceMap.value;\n const nextMap = fn(currentMap) ?? currentMap;\n _actionKeySourceMap.next(nextMap);\n }\n\n function sourceForKey(key: ActionKey): ActionContextStoreSource<T, O> {\n const _store$ = actionKeySourceMap$.pipe(\n map((x) => x.get(key)),\n distinctUntilChanged(),\n switchMap((x) => x?.store$ ?? of(undefined)),\n shareReplay(1)\n );\n\n const source: ActionContextStoreSource<T, O> = {\n store$: actionContextStoreSourcePipe(_store$)\n };\n\n return source;\n }\n\n function addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void {\n updateMap((actionKeySourceMap) => {\n if (actionKeySourceMap.has(key)) {\n throw new Error(`Key already existed for \"${key}\" in map. Ensure the previous store is removed before setting another.`);\n } else if (!source) {\n throw new Error('addStoreSource requires a source.');\n }\n\n actionKeySourceMap.set(key, source);\n return actionKeySourceMap;\n });\n }\n\n function removeStoreSource(key: ActionKey): void {\n updateMap((actionKeySourceMap) => {\n if (!actionKeySourceMap.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n return actionKeySourceMap;\n });\n }\n\n function destroy(): void {\n _actionKeySourceMap.complete();\n }\n\n const result: ActionContextStoreSourceMap<T, O> = {\n actionKeySourceMap$: actionKeySourceMap$,\n sourceForKey: sourceForKey,\n addStoreSource: addStoreSource,\n removeStoreSource: removeStoreSource,\n destroy\n };\n\n return result;\n}\n","import { Directive, inject } from '@angular/core';\nimport { actionContextStoreSourceMap, ActionContextStoreSourceMap } from './action.map';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Directive that creates and provides an {@link ActionContextStoreSourceMap} for its descendants.\n *\n * This enables a group of related action contexts to be registered by key and looked up\n * by child directives. Useful when multiple actions need to coordinate (e.g., disable\n * all other actions while one is working).\n *\n * The map is exported as `actionMap` for template reference access.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'save'\">...</div>\n * <div dbxAction [dbxActionMapSource]=\"'delete'\">...</div>\n * <div [dbxActionFromMap]=\"'save'\">\n * <!-- consumes the 'save' action context -->\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionFromMapDirective} for consuming actions by key.\n * @see {@link DbxActionMapSourceDirective} for registering actions by key.\n * @see {@link DbxActionMapWorkingDisableDirective} for cross-action disable coordination.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n providers: [\n {\n provide: ActionContextStoreSourceMap,\n useFactory: actionContextStoreSourceMap\n }\n ],\n exportAs: 'actionMap',\n standalone: true\n})\nexport class DbxActionContextMapDirective {\n readonly actionContextStoreSourceMap = clean(inject(ActionContextStoreSourceMap));\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { ActionContextStoreSourceMap, type ActionKey } from './action.map';\nimport { type SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that retrieves an {@link ActionContextStoreSource} from an ancestor\n * {@link DbxActionContextMapDirective} using the provided key, and provides it as\n * a {@link SecondaryActionContextStoreSource} for descendant `dbxAction` directives.\n *\n * This allows a child action context to bind to an action that was registered elsewhere\n * in the template via {@link DbxActionMapSourceDirective}.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'myAction'\">...</div>\n * <!-- Consume the registered action elsewhere in the tree -->\n * <div [dbxActionFromMap]=\"'myAction'\">\n * <div dbxAction>\n * <div *dbxActionHasSuccess>Done!</div>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionContextMapDirective} for the parent map provider.\n * @see {@link DbxActionMapSourceDirective} for registering an action into the map.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: provideSecondaryActionStoreSource(DbxActionFromMapDirective),\n standalone: true\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionFromMap' });\n readonly key$ = toObservable(this.key);\n\n readonly store$ = this.key$.pipe(\n filterMaybe(),\n switchMap((x) => this._actionContextStoreSourceMap.sourceForKey(x).store$)\n );\n}\n","import { Directive, type OnDestroy, effect, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { ActionContextStoreSourceMap, type ActionKey } from './action.map';\n\n/**\n * Directive that registers the host element's {@link ActionContextStoreSource} into an ancestor\n * {@link ActionContextStoreSourceMap} under the provided key.\n *\n * When the key changes, the previous registration is removed and the new one is added.\n * On destroy, the registration is cleaned up automatically.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'save'\">\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionContextMapDirective} for the parent map provider.\n * @see {@link DbxActionFromMapDirective} for consuming registered actions by key.\n */\n@Directive({\n selector: '[dbxActionMapSource]',\n standalone: true\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(ActionContextStoreSource, { host: true });\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionMapSource' });\n private _currentKey: Maybe<ActionKey>;\n\n protected readonly _keyEffect = effect(() => {\n const nextKey = this.key();\n\n if (this._currentKey !== nextKey) {\n this._removeFromToStore();\n }\n\n this._currentKey = nextKey;\n this._addToStore();\n });\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n private _addToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.addStoreSource(this._currentKey, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.removeStoreSource(this._currentKey);\n }\n }\n}\n","import { asObservable, combineLatestFromMapValuesObsFn, type IsCheckFunction, type ObservableOrValue } from '@dereekb/rxjs';\nimport { map, type Observable, switchMap } from 'rxjs';\nimport { type ActionContextStore } from '../../action.store';\nimport { type ActionContextStoreSourceMap, type ActionKey } from './action.map';\nimport { type ActionContextStoreSource } from '../../action.store.source';\nimport { reduceBooleansWithOrFn } from '@dereekb/util';\n\n/**\n * Utility interface that provides a set of functions to read from an ActionContextStoreSourceMap.\n */\nexport interface ActionContextStoreSourceMapReader<T = unknown, O = unknown> {\n /**\n * The input key source map.\n */\n readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n\n /**\n * Checks if any of the stores in the map match the input checkFunction.\n *\n * @param checkFunction Function to apply to each store.\n * @param emptyArrayValue Value to return if the map is empty.\n */\n checkAny(checkFunction: IsCheckFunction<ActionContextStore<T, O>>, emptyArrayValue?: boolean): Observable<boolean>;\n\n /**\n * Reduces a value from all stores in the map.\n *\n * @param mapFn Function to apply to each store.\n * @param reduceFn Function to apply to the results of the mapFn.\n */\n reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y>;\n\n /**\n * Reads a value from each store in the map and returns an array of the results.\n *\n * @param mapFn Function to apply to each store.\n */\n fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]>;\n}\n\n/**\n * Creates a new {@link ActionContextStoreSourceMapReader} from the given action key source map.\n *\n * The reader provides reactive utility functions to aggregate data across all stores\n * in the map (e.g., checking if any store is working, or reducing values from all stores).\n *\n * @typeParam T - The input value type for the actions.\n * @typeParam O - The output result type for the actions.\n * @param actionKeySourceMap$ - Observable (or static value) of the action key to source map.\n * @returns A reader with aggregate query functions over the map's stores.\n */\nexport function actionContextStoreSourceMapReader<T = unknown, O = unknown>(actionKeySourceMap$: ObservableOrValue<Map<ActionKey, ActionContextStoreSource<T, O>>>): ActionContextStoreSourceMapReader<T, O> {\n const sourceMap$ = asObservable(actionKeySourceMap$);\n\n function checkAnyAre(mapFn: (input: ActionContextStore<T, O>) => Observable<boolean>, emptyArrayValue?: boolean): Observable<boolean> {\n return reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n function reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y> {\n return fromAllSources<X>(mapFn).pipe(map(reduceFn));\n }\n\n function fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]> {\n return sourceMap$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n\n return {\n actionKeySourceMap$: sourceMap$,\n fromAllSources,\n checkAny: checkAnyAre,\n reduceFromAllSources\n };\n}\n\n/**\n * Returns an Observable of the results of the mapFn for each source in the actionKeySourceMap$.\n *\n * @param actionKeySourceMap$ Observable of the action key source map.\n * @param mapFn Function to apply to each source.\n * @returns Observable of the results of the mapFn for each source.\n */\nexport function fromAllActionContextStoreSourceMapSources<O>(actionKeySourceMap$: ObservableOrValue<ActionContextStoreSourceMap>, mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return asObservable(actionKeySourceMap$).pipe(\n switchMap((x) => x.actionKeySourceMap$),\n switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn))))\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type DbxActionDisabledKey } from '../../action';\nimport { actionContextStoreSourceMapReader } from './action.map.utility';\nimport { ActionContextStoreSourceMap } from './action.map';\n\n/**\n * Default disabled key used by {@link DbxActionMapWorkingDisableDirective} to track\n * the \"another action is working\" disabled reason.\n */\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';\n\n/**\n * Directive that disables the host action when any other action in the ancestor\n * {@link ActionContextStoreSourceMap} is currently working.\n *\n * This prevents concurrent action execution within a group of related actions.\n * When all other actions finish working, the host action is automatically re-enabled.\n *\n * A custom disabled key can be provided via the `dbxActionMapWorkingDisable` input.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'save'\" dbxActionMapWorkingDisable>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * <div dbxAction [dbxActionMapSource]=\"'delete'\" dbxActionMapWorkingDisable>\n * <button (click)=\"action.trigger()\">Delete</button>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionContextMapDirective} for the parent map provider.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]',\n standalone: true\n})\nexport class DbxActionMapWorkingDisableDirective {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly disabledKey = input<Maybe<DbxActionDisabledKey>>(undefined, { alias: 'dbxActionMapWorkingDisable' });\n\n readonly areAnySourcesWorking$ = actionContextStoreSourceMapReader(this._actionContextStoreSourceMap.actionKeySourceMap$).checkAny((x) => x.isWorking$, false);\n\n constructor() {\n cleanSubscription(\n this.areAnySourcesWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n })\n );\n\n clean(() => {\n this.source.enable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Disabled key used by {@link DbxActionDisabledDirective} to track its disabled state.\n */\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that disables or enables the parent action based on a boolean input.\n *\n * When `dbxActionDisabled` is `true` (or an empty string, which coerces to `true`),\n * the action is disabled with the {@link APP_ACTION_DISABLED_DIRECTIVE_KEY}. When `false`,\n * the disable key is removed, re-enabling the action (assuming no other sources have disabled it).\n *\n * The disable key is automatically cleaned up on directive destruction.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionDisabled]=\"isFormInvalid\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionEnforceModifiedDirective} for disabling when not modified.\n * @see {@link DbxActionDisabledOnSuccessDirective} for disabling after success.\n */\n@Directive({\n selector: '[dbxActionDisabled]',\n standalone: true\n})\nexport class DbxActionDisabledDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabled = input<boolean, Maybe<boolean | ''>>(false, { alias: 'dbxActionDisabled', transform: (value) => value !== false });\n readonly disabled$ = toObservable(this.disabled);\n\n constructor() {\n cleanSubscription(\n this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY));\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Disabled key used by {@link DbxActionDisabledOnSuccessDirective} to track the\n * \"disabled after success\" reason.\n */\nexport const APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY = 'dbx_action_disabled_on_success';\n\n/**\n * Directive that disables the parent action after it resolves successfully.\n *\n * This is useful for one-shot actions where the user should not be able to re-trigger\n * the action after it succeeds (e.g., a confirmation dialog or a single-use form submission).\n *\n * Can be disabled by setting `dbxActionDisabledOnSuccess` to `false`.\n *\n * The disable key is automatically cleaned up on directive destruction.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionDisabledOnSuccess></ng-container>\n * <button (click)=\"action.trigger()\">Confirm</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionDisabledDirective} for general-purpose disabling.\n * @see {@link DbxActionEnforceModifiedDirective} for disabling when not modified.\n */\n@Directive({\n selector: '[dbxActionDisabledOnSuccess]',\n standalone: true\n})\nexport class DbxActionDisabledOnSuccessDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabledOnSuccess = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionDisabledOnSuccess', transform: (value) => value !== false });\n readonly disabledOnSuccess$ = toObservable(this.disabledOnSuccess);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.disabledOnSuccess$, this.source.isSuccess$]).subscribe(([disableOnSuccess, success]) => {\n this.source.disable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, disableOnSuccess && success);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY));\n }\n}\n","import { map, shareReplay, switchMap, tap, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionWorkInstanceDelegate } from '../../action.handler';\nimport { type Maybe, type Destroyable, type Initialized, type GetterOrValue, asGetter, type FactoryWithInput } from '@dereekb/util';\nimport { filterMaybe, SubscriptionObject, type Work, workFactory } from '@dereekb/rxjs';\n\n/**\n * Lock key used by {@link DbxActionHandlerInstance} to prevent the source from being destroyed\n * while a handler's work is still in progress.\n */\nexport const DBX_ACTION_HANDLER_LOCK_KEY = 'dbxActionHandler';\n\n/**\n * Manages the execution of a {@link Work} function in response to `valueReady$` events\n * from an action context.\n *\n * When initialized, it subscribes to the source's `valueReady$` stream and executes\n * the configured handler function (or handler value) using {@link workFactory}. The handler\n * function drives the action through the working/success/reject lifecycle via a\n * {@link DbxActionWorkInstanceDelegate}.\n *\n * Supports two modes:\n * - **Handler function**: A full {@link Work} function that receives the value and a work context.\n * - **Handler value**: A simple getter or factory that returns the result directly.\n *\n * A lock is added to the source's lock set during work execution to prevent premature cleanup.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerDirective} for the template directive that wraps this instance.\n * @see {@link DbxActionWorkInstanceDelegate} for the delegate that bridges work events to the store.\n */\nexport class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {\n private readonly _delegate: DbxActionWorkInstanceDelegate<T, O>;\n\n private readonly _sub = new SubscriptionObject();\n private readonly _handlerFunction = new BehaviorSubject<Maybe<Work<T, O>>>(undefined);\n private readonly _handlerValue = new BehaviorSubject<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>(undefined);\n\n readonly handlerFunction$ = combineLatest([this._handlerValue, this._handlerFunction]).pipe(\n map(([handlerValue, handlerFunction]) => {\n let work: Maybe<Work<T, O>>;\n\n if (handlerFunction != null) {\n work = handlerFunction;\n } else if (handlerValue !== undefined) {\n const getter = asGetter(handlerValue) as FactoryWithInput<O, T>;\n work = (x, c) => c.performTaskWithReturnValue(() => getter(x));\n }\n\n return work;\n }),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._delegate = new DbxActionWorkInstanceDelegate<T, O>(source);\n }\n\n get source(): DbxActionContextStoreSourceInstance<T, O> {\n return this._delegate.source;\n }\n\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._handlerFunction.value;\n }\n\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._handlerValue.value;\n }\n\n setHandlerFunction(handlerFunction: Maybe<Work<T, O>>): void {\n this._handlerFunction.next(handlerFunction);\n }\n\n setHandlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>): void {\n this._handlerValue.next(handlerValue);\n }\n\n init(): void {\n this._sub.subscription = this.handlerFunction$\n .pipe(\n switchMap((work) =>\n this.source.valueReady$.pipe(\n tap((value) => {\n const context = workFactory({ work, delegate: this._delegate })(value);\n\n if (context) {\n // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.\n this.source.lockSet.addLock(DBX_ACTION_HANDLER_LOCK_KEY, context.isComplete$.pipe(map((x) => !x)));\n }\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._sub.destroy();\n this._handlerFunction.complete();\n });\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type FactoryWithInput, type GetterOrValue, type Maybe } from '@dereekb/util';\nimport { DbxActionHandlerInstance } from './action.handler.instance';\nimport { type Work } from '@dereekb/rxjs';\nimport { clean } from '../../../rxjs';\n\n/**\n * Abstract base directive that creates and manages a {@link DbxActionHandlerInstance} lifecycle.\n *\n * Subclasses configure how the handler function or value is provided to the instance.\n * The instance is initialized on construction and cleaned up automatically via the action's lock set.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerDirective} for the work-function variant.\n * @see {@link DbxActionHandlerValueDirective} for the value/getter variant.\n */\n@Directive()\nexport abstract class AbstractDbxActionHandlerDirective<T = unknown, O = unknown> {\n readonly source: DbxActionContextStoreSourceInstance<T, O> = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n protected readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<T, O>(this.source));\n\n constructor() {\n this._dbxActionHandlerInstance.init();\n }\n}\n\n/**\n * Directive that provides a {@link Work} function to handle the action's `valueReady$` event.\n *\n * When the action is triggered and a value becomes ready, the provided work function is\n * called with the value and a work context. The work function is responsible for performing\n * the async operation and signaling success or failure through the context.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionHandler]=\"handleSave\"></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerValueDirective} for the simpler value/getter variant.\n */\n@Directive({\n selector: '[dbxActionHandler]',\n standalone: true\n})\nexport class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerFunction = input.required<Maybe<Work<T, O>>>({ alias: 'dbxActionHandler' });\n\n protected readonly _handlerFunctionEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerFunction(this.handlerFunction());\n });\n}\n\n/**\n * Directive that provides a static value, getter, or factory to resolve the action's `valueReady$` event.\n *\n * Unlike {@link DbxActionHandlerDirective}, this does not require a full {@link Work} function.\n * The provided value (or the result of calling the getter/factory) is used directly as the\n * action's result, with the working/success lifecycle handled automatically.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionHandlerValue]=\"computeResult\"></ng-container>\n * <button (click)=\"action.trigger()\">Compute</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerDirective} for the full work-function variant.\n */\n@Directive({\n selector: '[dbxActionHandlerValue]',\n standalone: true\n})\nexport class DbxActionHandlerValueDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerValue = input.required<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>({ alias: 'dbxActionHandlerValue' });\n protected readonly _handlerValueEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerValue(this.handlerValue());\n });\n}\n","import { Directive, type OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { distinctUntilChanged, type Observable } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Abstract structural directive that conditionally renders its template based on a reactive boolean observable,\n * similar to `*ngIf` but driven by an `Observable<boolean>`.\n *\n * Subclasses provide the `show$` observable to control visibility. The template is created\n * when `show$` emits `true` and cleared when it emits `false`.\n *\n * @example\n * ```typescript\n * @Directive({ selector: '[appShowIfAdmin]' })\n * export class ShowIfAdminDirective extends AbstractIfDirective {\n * readonly show$ = inject(AuthService).isAdmin$;\n * }\n * ```\n *\n * @example\n * ```html\n * <div *appShowIfAdmin>Only visible to admins</div>\n * ```\n */\n@Directive()\nexport abstract class AbstractIfDirective implements OnInit {\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n /**\n * Observable that is watched for showing/hiding.\n */\n abstract readonly show$: Observable<boolean>;\n\n private readonly _sub = cleanSubscription();\n\n ngOnInit() {\n this._sub.subscription = this.show$.pipe(distinctUntilChanged()).subscribe((show) => {\n if (show) {\n this._viewContainer.createEmbeddedView(this._templateRef);\n } else {\n this._viewContainer.clear();\n }\n });\n }\n}\n","/**\n * Angular input transform that converts an empty string to `undefined`.\n *\n * Useful for Angular directive inputs where the attribute can be applied without a value\n * (e.g., `<div myDirective>` passes `''`), and you want to treat that as \"not provided\".\n *\n * @param value - The input value to transform.\n * @returns The original value, or `undefined` if the value is an empty string.\n *\n * @example\n * ```typescript\n * @Directive({ selector: '[appHighlight]' })\n * export class HighlightDirective {\n * @Input({ alias: 'appHighlight', transform: transformEmptyStringInputToUndefined })\n * color?: string;\n * }\n * ```\n */\nexport const transformEmptyStringInputToUndefined = <T>(value: T | '') => (value === '' ? undefined : value);\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content when the action is idle.\n *\n * Optionally accepts a number (in milliseconds) to auto-hide the content after the specified\n * duration, even if the action is still idle. Useful for showing initial instructions that\n * should disappear after a timeout.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionIdle>Ready to submit.</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Hide idle content after 5 seconds -->\n * <div dbxAction>\n * <div *dbxActionIdle=\"5000\">Ready to submit.</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionIsWorkingDirective} for showing content when working.\n * @see {@link DbxActionHasSuccessDirective} for showing content on success.\n */\n@Directive({\n selector: '[dbxActionIdle]',\n standalone: true\n})\nexport class DbxActionIdleDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIdle', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.idle$.pipe(\n exhaustMap((idle) => {\n if (idle) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that renders its content while the action has not yet succeeded.\n *\n * The content is visible during all states before success (IDLE, TRIGGERED, WORKING, etc.)\n * and is hidden once the action resolves successfully. Optionally accepts a number (in milliseconds)\n * specifying how long to keep the content hidden after success before showing it again.\n *\n * This is the inverse of {@link DbxActionHasSuccessDirective}.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionPreSuccess>Not yet saved.</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Re-show content 2 seconds after success -->\n * <div dbxAction>\n * <div *dbxActionPreSuccess=\"2000\">Not yet saved.</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionHasSuccessDirective} for showing content on success.\n */\n@Directive({\n selector: '[dbxActionPreSuccess]',\n standalone: true\n})\nexport class DbxActionPreSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideFor = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionPreSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(false, true, this.hideFor());\n } else {\n return of(true);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content when the action has resolved successfully.\n *\n * Optionally accepts a number (in milliseconds) to auto-hide the content after the specified\n * duration, useful for showing temporary success messages that fade away.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionHasSuccess>Saved successfully!</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Show success message for 3 seconds -->\n * <div dbxAction>\n * <div *dbxActionHasSuccess=\"3000\">Saved!</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionPreSuccessDirective} for showing content before success.\n * @see {@link DbxActionSuccessHandlerDirective} for executing a function on success.\n */\n@Directive({\n selector: '[dbxActionHasSuccess]',\n standalone: true\n})\nexport class DbxActionHasSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionHasSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Callback function invoked when an action resolves successfully.\n *\n * @typeParam O - The output result type from the action.\n */\nexport type DbxActionSuccessHandlerFunction<O = unknown> = (value: O) => void;\n\n/**\n * Directive that executes a callback function each time the action resolves successfully.\n *\n * The provided function receives the action's result value. This is useful for\n * performing side effects like navigation, showing notifications, or refreshing data\n * after a successful action.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionSuccessHandler]=\"onSaveSuccess\"></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionHasSuccessDirective} for rendering content on success.\n * @see {@link DbxActionErrorHandlerDirective} for handling errors.\n */\n@Directive({\n selector: '[dbxActionSuccessHandler]',\n standalone: true\n})\nexport class DbxActionSuccessHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionSuccessHandler = input<Maybe<DbxActionSuccessHandlerFunction<O>>>();\n readonly successFunction$ = toObservable(this.dbxActionSuccessHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.successFunction$\n .pipe(\n switchMap((successFunction) =>\n this.source.success$.pipe(\n map((x) => [successFunction, x] as [DbxActionSuccessHandlerFunction<O>, O]),\n tap(([successFn, result]) => {\n successFn(result);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type ReadableError, type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Callback function invoked when an action encounters an error.\n *\n * Receives the {@link ReadableError} if available, or undefined.\n */\nexport type DbxActionErrorHandlerFunction = (error?: Maybe<ReadableError>) => void;\n\n/**\n * Directive that executes a callback function each time the action's error state changes.\n *\n * The provided function receives the {@link ReadableError} from the action context.\n * This is useful for performing side effects like logging, showing error toasts, or\n * handling specific error conditions programmatically.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionErrorHandler]=\"onError\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionSuccessHandlerDirective} for handling success.\n */\n@Directive({\n selector: '[dbxActionErrorHandler]',\n standalone: true\n})\nexport class DbxActionErrorHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionErrorHandler = input<Maybe<DbxActionErrorHandlerFunction>>();\n readonly errorFunction$ = toObservable(this.dbxActionErrorHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.errorFunction$\n .pipe(\n switchMap((errorFunction) =>\n this.source.error$.pipe(\n filterMaybe(),\n map((x) => [errorFunction, x] as const),\n tap(([errorFn, error]) => {\n errorFn(error);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { getValueFromGetter, type Maybe, type GetterOrValue } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject, combineLatest, map, type Observable, shareReplay, switchMap } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that provides a value (or value-producing function) to the action when triggered.\n *\n * The value is always available and ready to be used. When the action is triggered,\n * the current value is resolved (via `getValueFromGetter` if a function) and passed\n * to `readyValue()` on the action source.\n *\n * The input filters out null/undefined values, waiting until a non-null value is provided.\n * If you need to pass null/undefined as valid action values, use {@link DbxActionValueTriggerDirective} instead.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionValue]=\"myValue\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- With a getter function -->\n * <div dbxAction>\n * <ng-container [dbxActionValue]=\"getLatestValue\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionValueTriggerDirective} for lazy value retrieval on trigger.\n * @see {@link DbxActionValueStreamDirective} for reactive stream-based values.\n */\n@Directive({\n selector: 'dbxActionValue,[dbxActionValue]',\n standalone: true\n})\nexport class DbxActionValueDirective<T, O> {\n readonly valueOrFunction = input<Maybe<GetterOrValue<T> | ''>>('', { alias: 'dbxActionValue' });\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _valueOrFunctionOverride = new BehaviorSubject<Maybe<GetterOrValue<T>>>(undefined);\n\n readonly valueOrFunction$: Observable<GetterOrValue<T>> = combineLatest([this._valueOrFunctionOverride, toObservable(this.valueOrFunction)]).pipe(\n map(([x, y]) => x ?? (y as Maybe<GetterOrValue<T>>)),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.valueOrFunction$.pipe(switchMap((valueOrFunction) => this.source.triggered$.pipe(map(() => valueOrFunction)))).subscribe((valueOrFunction) => {\n const value: T = getValueFromGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n });\n }\n\n setValueOrFunction(value: Maybe<GetterOrValue<T>>) {\n this._valueOrFunctionOverride.next(value);\n }\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content while the action is in a working state.\n *\n * Optionally accepts a number (in milliseconds) to auto-hide the content after a specified duration,\n * even if the action is still working. This is useful for showing brief \"loading\" indicators\n * that should disappear after a timeout.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionWorking>Loading...</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Hide after 3 seconds even if still working -->\n * <div dbxAction>\n * <div *dbxActionIsWorking=\"3000\">Loading...</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionIdleDirective} for showing content when idle.\n */\n@Directive({\n selector: '[dbxActionWorking],[dbxActionIsWorking]',\n standalone: true\n})\nexport class DbxActionIsWorkingDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionWorking', transform: transformEmptyStringInputToUndefined });\n readonly hideAfterIsWorking = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIsWorking', transform: transformEmptyStringInputToUndefined });\n\n readonly hideAfterSignal = computed(() => {\n const hideAfter = this.hideAfter();\n const hideAfterIsWorking = this.hideAfterIsWorking();\n return hideAfter ?? hideAfterIsWorking;\n });\n\n readonly show$ = this._store.isWorking$.pipe(\n exhaustMap((isWorking) => {\n const hideAfter = this.hideAfterSignal();\n\n if (isWorking && hideAfter != null) {\n return emitDelayObs(true, false, hideAfter);\n } else {\n return of(isWorking);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest, delay } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Disabled key used by {@link DbxActionEnforceModifiedDirective} to track the\n * \"not modified\" disabled reason.\n */\nexport const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';\n\n/**\n * Directive that disables the parent action when the action is not marked as modified.\n *\n * When enabled (default), this enforces that the user must make changes before the action\n * can be triggered. Once the action is marked as modified, the disabled key is removed.\n * This prevents no-op submissions where nothing has actually changed.\n *\n * Can be disabled by setting `dbxActionEnforceModified` to `false`.\n *\n * The disable key is automatically cleaned up on directive destruction.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionEnforceModified></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @see {@link DbxActionDisabledDirective} for general-purpose disabling.\n * @see {@link DbxActionAutoModifyDirective} for always keeping the action modified.\n */\n@Directive({\n selector: '[dbxActionEnforceModified]',\n standalone: true\n})\nexport class DbxActionEnforceModifiedDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly enabled = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionEnforceModified', transform: (value) => value !== false });\n readonly enabled$ = toObservable(this.enabled);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.source.isModified$, this.enabled$])\n .pipe(delay(0))\n .subscribe(([modified, enableDirective]) => {\n const disable = enableDirective && !modified;\n this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY));\n }\n}\n","import { toReadableError, type Destroyable, type Initialized, type Maybe, type ReadableError } from '@dereekb/util';\nimport { switchMap, map, catchError, of, BehaviorSubject, type Observable, shareReplay, combineLatestWith } from 'rxjs';\nimport { type ObservableOrValue, SubscriptionObject, type IsModifiedFunction, asObservable, returnIfIs, filterMaybe, type IsEqualFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Function that retrieves the input value for an action when triggered.\n *\n * Called by {@link DbxActionValueGetterInstance} when the action is triggered,\n * returning the value (or an observable of the value) to pass to the action.\n *\n * @typeParam T - The value type to retrieve.\n */\nexport type DbxActionValueGetterValueGetterFunction<T> = () => ObservableOrValue<Maybe<T>>;\n\n/**\n * Result of a value getter invocation, containing either a value to proceed with\n * or an error to reject the action.\n *\n * @typeParam T - The value type.\n */\nexport interface DbxActionValueGetterResult<T = unknown> {\n /**\n * The value to trigger with\n */\n readonly value?: Maybe<T>;\n /**\n * The error to reject with\n */\n readonly reject?: Maybe<ReadableError>;\n}\n\n/**\n * Configuration for a {@link DbxActionValueGetterInstance}.\n *\n * @typeParam T - The value type for the action.\n */\nexport interface DbxActionValueGetterInstanceConfig<T> {\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n readonly valueGetter?: Maybe<DbxActionValueGetterValueGetterFunction<T>>;\n readonly isEqualFunction?: Maybe<IsEqualFunction<T>>;\n readonly isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n}\n\n/**\n * Utility class that handles the trigger-to-value-ready phase of the action lifecycle.\n *\n * When initialized, it subscribes to the source's `triggered$` stream. On each trigger,\n * it calls the configured {@link DbxActionValueGetterValueGetterFunction} to retrieve the value,\n * runs an optional {@link IsModifiedFunction} check, and either calls `readyValue()` with\n * the retrieved value or `reject()` if the value is null/undefined or an error occurred.\n *\n * This separates value retrieval from the trigger event, allowing lazy or async value computation.\n *\n * @typeParam T - The value type for the action.\n *\n * @see {@link DbxActionValueTriggerDirective} for the directive wrapper.\n * @see {@link DbxActionValueDirective} for the simpler always-piped-value approach.\n */\nexport class DbxActionValueGetterInstance<T> implements Initialized, Destroyable {\n private readonly _valueGetterFunction = new BehaviorSubject<Maybe<DbxActionValueGetterValueGetterFunction<T>>>(undefined);\n readonly valueGetterFunction$ = this._valueGetterFunction.pipe(filterMaybe());\n\n private readonly _isModifiedFunction = new BehaviorSubject<Maybe<IsModifiedFunction<T>>>(undefined);\n private readonly _isEqualFunction = new BehaviorSubject<Maybe<IsEqualFunction<T>>>(undefined);\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: this._isModifiedFunction,\n isEqual: this._isEqualFunction\n }).pipe(shareReplay(1));\n\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n\n private readonly _triggeredSub = new SubscriptionObject();\n\n constructor(config: DbxActionValueGetterInstanceConfig<T>) {\n this.source = config.source;\n this.setValueGetterFunction(config.valueGetter);\n this.setIsModifiedFunction(config.isModifiedFunction);\n this.setIsEqualFunction(config.isEqualFunction);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._valueGetterFunction.next(valueGetterFunction);\n }\n\n setIsModifiedFunction(isModifiedFunction: Maybe<IsModifiedFunction<T>>) {\n this._isModifiedFunction.next(isModifiedFunction);\n }\n\n setIsEqualFunction(isEqualFunction: Maybe<IsEqualFunction<T>>) {\n this._isEqualFunction.next(isEqualFunction);\n }\n\n init(): void {\n // Ready the value after the source is triggered. Do modified check one last time.\n this._triggeredSub.subscription = this.source.triggered$\n .pipe(\n switchMap(() =>\n this.valueGetterFunction$.pipe(\n switchMap((valueGetter) => asObservable(valueGetter())),\n combineLatestWith(this.isModifiedFunction$),\n // If the value is not null/undefined and is considered modified, then pass the value.\n switchMap(([value, isModifiedFunction]) => returnIfIs(isModifiedFunction, value, false).pipe(map((value) => ({ value })))),\n // Catch unknown errors and pass them to reject.\n catchError((reject) => of({ reject: toReadableError(reject) }))\n )\n )\n )\n .subscribe((result: DbxActionValueGetterResult<T>) => {\n if (result.value != null) {\n this.source.readyValue(result.value);\n } else {\n this.source.reject(result.reject);\n }\n });\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._valueGetterFunction.complete();\n this._isModifiedFunction.complete();\n this._isEqualFunction.complete();\n this._triggeredSub.destroy();\n });\n }\n}\n","import { Directive, Injector, type Signal, effect, inject, input, runInInjectionContext } from '@angular/core';\nimport { type IsEqualFunction, type IsModifiedFunction } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type DbxActionValueGetterValueGetterFunction, DbxActionValueGetterInstance } from './action.value.trigger.instance';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Configuration for connecting Angular signals to a {@link DbxActionValueGetterInstance}'s\n * value getter, isModified, and isEqual functions.\n *\n * @typeParam T - The value type for the action.\n */\nexport interface DbxActionValueGetterDirectiveComputeInputsConfig<T> {\n readonly valueGetterSignal?: Signal<Maybe<DbxActionValueGetterValueGetterFunction<T>>>;\n readonly isModifiedSignal?: Signal<Maybe<IsModifiedFunction>>;\n readonly isEqualSignal?: Signal<Maybe<IsEqualFunction>>;\n}\n\n/**\n * Abstract base class for directives that retrieve a value when the action is triggered.\n *\n * Creates and manages a {@link DbxActionValueGetterInstance} internally, providing\n * methods for subclasses to configure the value getter, isModified, and isEqual functions.\n *\n * @typeParam T - The value type for the action.\n *\n * @see {@link DbxActionValueTriggerDirective} for the concrete implementation.\n */\n@Directive()\nexport abstract class AbstractDbxActionValueGetterDirective<T> {\n private readonly _injector = inject(Injector);\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, unknown>);\n\n private readonly _triggerInstance: DbxActionValueGetterInstance<T> = new DbxActionValueGetterInstance<T>({\n source: this.source\n });\n\n constructor() {\n this._triggerInstance.init();\n clean(this._triggerInstance);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._triggerInstance.setValueGetterFunction(valueGetterFunction);\n }\n\n protected configureInputs(config: DbxActionValueGetterDirectiveComputeInputsConfig<T>): void {\n runInInjectionContext(this._injector, () => {\n effect(() => {\n if (config?.isModifiedSignal != null) {\n const isModified = config?.isModifiedSignal();\n this._triggerInstance.setIsModifiedFunction(isModified);\n }\n\n if (config?.isEqualSignal != null) {\n const isEqual = config?.isEqualSignal();\n this._triggerInstance.setIsEqualFunction(isEqual);\n }\n\n if (config?.valueGetterSignal != null) {\n const valueGetter = config?.valueGetterSignal();\n this._triggerInstance.setValueGetterFunction(valueGetter);\n }\n });\n });\n }\n}\n\n/**\n * Directive that uses a getter function to retrieve the action value only when triggered.\n *\n * Unlike {@link DbxActionValueDirective} which continuously pipes the latest value,\n * this directive calls the getter function lazily -- only when the action is triggered.\n * This is useful when the value computation is expensive or depends on state that should\n * only be captured at trigger time.\n *\n * Supports optional `isModified` and `isEqual` functions to control whether the retrieved\n * value should proceed to `readyValue` or be rejected.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionValueGetter]=\"getFormValue\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The value type for the action.\n *\n * @see {@link DbxActionValueDirective} for the always-available value approach.\n */\n@Directive({\n exportAs: 'dbxActionValueGetter',\n selector: '[dbxActionValueGetter]',\n standalone: true\n})\nexport class DbxActionValueTriggerDirective<T = object> extends AbstractDbxActionValueGetterDirective<T> {\n readonly dbxActionValueGetter = input<Maybe<DbxActionValueGetterValueGetterFunction<T>>>();\n readonly dbxActionValueGetterIsModified = input<Maybe<IsModifiedFunction>>();\n readonly dbxActionValueGetterIsEqual = input<Maybe<IsEqualFunction>>();\n\n constructor() {\n super();\n this.configureInputs({\n valueGetterSignal: this.dbxActionValueGetter,\n isModifiedSignal: this.dbxActionValueGetterIsModified,\n isEqualSignal: this.dbxActionValueGetterIsEqual\n });\n }\n}\n","import { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay, type Observable, of, EMPTY } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type IsEqualFunction, type IsModifiedFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that watches a value observable stream and automatically updates the action's\n * modified state and provides the latest value when triggered.\n *\n * Each emission from the stream is checked against an optional `isModified` or `isEqual`\n * function to determine if the action should be marked as modified. When the action is\n * triggered, the latest value from the stream is passed to `readyValue()` only if modified.\n *\n * This is ideal for form-based workflows where the form value changes over time and\n * should automatically track modification state.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionValueStream]=\"formValue$\"></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionValueDirective} for static/getter-based values.\n * @see {@link DbxActionValueTriggerDirective} for lazy getter values on trigger.\n */\n@Directive({\n selector: '[dbxActionValueStream]',\n standalone: true\n})\nexport class DbxActionValueStreamDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionValueStream = input<Observable<T>>(EMPTY);\n readonly dbxActionValueStreamIsEqualValue = input<Maybe<IsEqualFunction<T>>>();\n readonly dbxActionValueStreamIsModifiedValue = input<Maybe<IsModifiedFunction<T>>>();\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: toObservable(this.dbxActionValueStreamIsModifiedValue),\n isEqual: toObservable(this.dbxActionValueStreamIsEqualValue)\n }).pipe(shareReplay(1));\n\n readonly modifiedValue$ = toObservable(this.dbxActionValueStream).pipe(\n switchMap((obs) =>\n obs.pipe(\n withLatestFrom(this.isModifiedFunction$),\n mergeMap(([value, dbxActionValueStreamModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionValueStreamModified) {\n result = dbxActionValueStreamModified(value).pipe(map((isModified) => [isModified, value] as [boolean, T]));\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n )\n )\n );\n\n constructor() {\n // Update isModified on source\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.modifiedValue$.subscribe(([isModified]) => {\n this.source.setIsModified(isModified);\n })\n });\n\n // Set the value on triggers.\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.triggered$.pipe(switchMap(() => this.modifiedValue$)).subscribe(([isModified, value]) => {\n // only mark ready once modified\n if (isModified) {\n this.source.readyValue(value);\n }\n })\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content when the action has been triggered.\n *\n * Shows content during the TRIGGERED state (after trigger, before value-ready/working).\n * Optionally accepts a number (in milliseconds) to auto-hide the content after the specified duration.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionTriggered>Preparing...</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionIsWorkingDirective} for content shown during the working state.\n */\n@Directive({\n selector: '[dbxActionTriggered]',\n standalone: true\n})\nexport class DbxActionTriggeredDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionTriggered', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.triggered$.pipe(\n exhaustMap((triggered) => {\n if (triggered) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { NgModule } from '@angular/core';\nimport {\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionDisabledDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionPreSuccessDirective,\n DbxActionIdleDirective,\n DbxActionHandlerValueDirective,\n DbxActionErrorHandlerDirective\n} from './directive';\n\nconst importsAndExports = [\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionHandlerValueDirective,\n DbxActionDisabledDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionIdleDirective,\n DbxActionPreSuccessDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionErrorHandlerDirective,\n DbxActionIsWorkingDirective\n];\n\n/**\n * Contains all base DbxAction components.\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreActionModule {}\n","import { type Destroyable } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\n\n/**\n * Acts as a reference to a DbxActionContextStoreSourceInstance that can be destroyed.\n *\n * This is used in cases where the action is passed around and the context it is passed to needs to clean up.\n */\nexport interface DbxActionContextSourceReference<T = unknown, O = unknown> extends Destroyable {\n readonly sourceInstance: DbxActionContextStoreSourceInstance<T, O>;\n}\n\n/**\n * Creates a simple {@link DbxActionContextSourceReference} wrapper around a source instance.\n *\n * The returned reference has a no-op `destroy()` method, making it suitable for cases\n * where the caller does not own the lifecycle of the source instance.\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param sourceInstance - The source instance to wrap.\n * @returns A destroyable reference to the source instance.\n */\nexport function makeDbxActionContextSourceReference<T, O>(sourceInstance: DbxActionContextStoreSourceInstance<T, O>): DbxActionContextSourceReference<T, O> {\n return {\n sourceInstance,\n destroy: () => 0\n };\n}\n","import { type ArrayOrValue, hasValueOrNotEmpty, type Maybe } from '@dereekb/util';\nimport { map, type Observable } from 'rxjs';\n\n/**\n * Represents a router link that can be used for navigation.\n *\n * Can be a URL string, a single route configuration object, or an array of route segments.\n *\n * @example\n * ```ts\n * const stringLink: SegueRefRouterLink = '/app/dashboard';\n * const arrayLink: SegueRefRouterLink = ['/app', { id: '123' }];\n * ```\n */\nexport type SegueRefRouterLink = string | ArrayOrValue<object>;\n\n/**\n * Raw key-value parameters passed along with a segue navigation.\n *\n * These are typically route or query parameters for the target state.\n *\n * @example\n * ```ts\n * const params: SegueRefRawSegueParams = { id: '123', tab: 'settings' };\n * ```\n */\nexport interface SegueRefRawSegueParams {\n [key: string]: unknown;\n}\n\n/**\n * Configuration options for a segue navigation, including raw parameters and framework-specific transition options.\n *\n * @typeParam O - The type of the transition options. For UIRouter this is `TransitionOptions`; for Angular Router this is `NavigationExtras`.\n *\n * @example\n * ```ts\n * const options: SegueRefOptions = {\n * refParams: { id: '123' },\n * refOptions: { location: 'replace' }\n * };\n * ```\n */\nexport interface SegueRefOptions<O = object> {\n /**\n * Raw parameters\n */\n refParams?: SegueRefRawSegueParams;\n\n /**\n * Custom Transition Options.\n *\n * For UIRouter, this is TransitionOptions.\n */\n refOptions?: O;\n}\n\n/**\n * Represents a complete segue reference combining a navigation target path with optional parameters and transition options.\n *\n * This is the primary navigation descriptor used throughout the router abstraction layer.\n *\n * @typeParam O - The type of the transition options. For UIRouter this is `TransitionOptions`; for Angular Router this is `NavigationExtras`.\n *\n * @example\n * ```ts\n * const segue: SegueRef = {\n * ref: 'app.dashboard',\n * refParams: { id: '123' },\n * refOptions: { location: 'replace' }\n * };\n * ```\n *\n * @see {@link SegueRefOptions} for the options portion of the segue reference\n * @see {@link SegueRefRouterLink} for the supported ref path formats\n */\nexport interface SegueRef<O = object> extends SegueRefOptions<O> {\n /**\n * Ref path value.\n */\n ref: SegueRefRouterLink;\n}\n\n/**\n * Union type representing either a full {@link SegueRef} object or a raw {@link SegueRefRouterLink}.\n *\n * This flexibility allows consumers to pass either a simple string path or a fully-configured segue reference.\n *\n * @typeParam O - The type of the transition options.\n *\n * @example\n * ```ts\n * // As a simple string\n * const link: SegueRefOrSegueRefRouterLink = '/app/dashboard';\n *\n * // As a full SegueRef\n * const ref: SegueRefOrSegueRefRouterLink = { ref: 'app.dashboard', refParams: { id: '123' } };\n * ```\n */\nexport type SegueRefOrSegueRefRouterLink<O = object> = SegueRef<O> | SegueRefRouterLink;\n\n/**\n * Type guard that checks whether the given input is a {@link SegueRef} object (as opposed to a raw router link string).\n *\n * @typeParam O - The type of the transition options.\n * @param input - The value to test.\n * @returns `true` if the input is a {@link SegueRef} with a non-empty `ref` property.\n *\n * @see {@link asSegueRef} for converting an input to a SegueRef\n */\nexport function isSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): input is SegueRef<O> {\n return typeof input === 'object' && hasValueOrNotEmpty((input as SegueRef).ref);\n}\n\n/**\n * Converts a {@link SegueRefOrSegueRefRouterLink} to a {@link SegueRef}.\n *\n * - If the input is a string, it is wrapped into a `SegueRef` via {@link refStringToSegueRef}.\n * - If the input is already a `SegueRef`, it is returned as-is.\n * - Otherwise, returns `undefined`.\n *\n * @typeParam O - The type of the transition options.\n * @param input - The value to convert.\n * @returns The converted {@link SegueRef}, or `undefined` if the input is not convertible.\n *\n * @see {@link isSegueRef}\n * @see {@link refStringToSegueRef}\n */\nexport function asSegueRef<O = object>(input: SegueRefOrSegueRefRouterLink<O>): SegueRef<O>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>> {\n const type = typeof input;\n\n if (type === 'string') {\n return refStringToSegueRef(input as string);\n } else if (isSegueRef(input)) {\n return input as SegueRef<O>;\n } else {\n return undefined;\n }\n}\n\n/**\n * Extracts the string ref path from a {@link SegueRefOrSegueRefRouterLink}.\n *\n * - If the input is already a string, it is returned directly.\n * - If the input is a `SegueRef`, the `ref` property is returned as a string.\n * - Otherwise, throws an error.\n *\n * @typeParam O - The type of the transition options.\n * @param input - The segue ref or string to extract from.\n * @returns The string representation of the ref.\n * @throws Error if the input cannot be converted to a string.\n */\nexport function asSegueRefString<O = object>(input: SegueRefOrSegueRefRouterLink<O> | string): string;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string>;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string> {\n if (typeof input === 'string') {\n return input;\n } else if (isSegueRef(input)) {\n return input.ref as string;\n } else {\n throw new Error(`asSegueRefString() failed to convert the input to a string: ${input}`);\n }\n}\n\n/**\n * Creates a {@link SegueRef} from a string ref path and optional segue options.\n *\n * @typeParam O - The type of the transition options.\n * @param ref - The string ref path to wrap.\n * @param options - Optional parameters and transition options to include.\n * @returns A new {@link SegueRef} containing the given ref and options.\n */\nexport function refStringToSegueRef<O = object>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\n/**\n * Maps an observable of string ref paths to an observable of {@link SegueRef} objects.\n *\n * @typeParam O - The type of the transition options.\n * @param obs - The source observable emitting string ref paths.\n * @param options - Optional parameters and transition options to include in each emitted SegueRef.\n * @returns An observable that emits {@link SegueRef} objects.\n *\n * @see {@link refStringToSegueRef}\n */\nexport function mapRefStringObsToSegueRefObs<O = object>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map((x) => refStringToSegueRef(x, options)));\n}\n","import { type Observable } from 'rxjs';\nimport { type AuthRoleSet } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../auth.user';\n\n/**\n * Abstract service that provides reactive access to the current authentication state, user roles, and lifecycle events.\n *\n * This is the primary abstraction for authentication in dbx-core. Concrete implementations\n * (e.g., Firebase-based auth) must provide all observable streams and the logout behavior.\n *\n * Components and services should inject this abstract class rather than a concrete implementation,\n * enabling the auth provider to be swapped without changing consumer code.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private readonly authService = inject(DbxAuthService);\n *\n * readonly isLoggedIn$ = this.authService.isLoggedIn$;\n * readonly roles$ = this.authService.authRoles$;\n *\n * logout() {\n * this.authService.logOut();\n * }\n * }\n * ```\n *\n * @see {@link AuthUserState} for the possible user states.\n * @see {@link DbxAppAuthEffects} for how this service is bridged into the NgRx store.\n */\nexport abstract class DbxAuthService {\n /**\n * Whether or not the user is logged in.\n *\n * This will only emit once the authentication has been determined, preventing issues with premature decision making.\n *\n * A user is considered logged in even if there is an anonymous user. For more detailed info, consider using authUserState$.\n */\n abstract readonly isLoggedIn$: Observable<boolean>;\n\n /**\n * Whether or not the user has finished onboarding.\n *\n * This will only emit once the onboarding status has been determined, preventing issues with premature decision making.\n */\n abstract readonly isOnboarded$: Observable<boolean>;\n\n /**\n * Emits an event every time the user logs in.\n */\n abstract readonly onLogIn$: Observable<void>;\n\n /**\n * Emits an event every time the user logs out.\n */\n abstract readonly onLogOut$: Observable<void>;\n\n /**\n * Current state of the user.\n */\n abstract readonly authUserState$: Observable<AuthUserState>;\n\n /**\n * Role set for the current user.\n */\n abstract readonly authRoles$: Observable<AuthRoleSet>;\n\n /**\n * Identifier for the current user.\n */\n abstract readonly userIdentifier$: Observable<AuthUserIdentifier>;\n\n /**\n * Performs the logout action.\n */\n abstract logOut(): Promise<void>;\n}\n","import { type TransitionHookFn, type Transition, type HookResult, type StateService, type UIInjector, type TransitionOptions, type RawParams } from '@uirouter/core';\nimport { catchError, map, first, firstValueFrom, type Observable, of, switchMap } from 'rxjs';\nimport { asSegueRef, asSegueRefString, type SegueRefOrSegueRefRouterLink } from './../../../../router/segue';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { type FactoryWithRequiredInput, getValueFromGetter, isGetter, type Maybe, type Milliseconds } from '@dereekb/util';\nimport { type Injector } from '@angular/core';\nimport { timeoutStartWith } from '@dereekb/rxjs';\n\n/**\n * Represents the outcome of an auth transition decision in a UIRouter hook.\n *\n * Possible values:\n * - `true` - Allow the transition to proceed to the target state.\n * - `false` - Reject the transition and redirect to the configured default redirect target.\n * - `SegueRefOrSegueRefRouterLink` - Redirect to a specific route instead.\n *\n * @see {@link AuthTransitionHookConfig.makeDecisionsObs}\n */\nexport type AuthTransitionDecision = true | false | SegueRefOrSegueRefRouterLink;\n\n/**\n * Input provided to an {@link AuthTransitionRedirectTargetGetter} when determining\n * where to redirect a user during an auth transition.\n *\n * Contains the current transition context, the Angular injector, and the auth service\n * for making authorization decisions.\n */\nexport interface AuthTransitionDecisionGetterInput {\n /**\n * The UIRouter transition that triggered the auth check.\n */\n readonly transition: Transition;\n /**\n * The Angular injector for resolving additional dependencies.\n */\n readonly injector: Injector;\n /**\n * The auth service for querying the current authentication state.\n */\n readonly authService: DbxAuthService;\n}\n\n/**\n * An observable that resolves to a redirect target (or `undefined` for no redirect).\n */\nexport type AuthTransitionRedirectTarget = Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n/**\n * Factory function that produces an {@link AuthTransitionRedirectTarget} given the transition context.\n *\n * Used when the redirect destination needs to be computed dynamically based on the current\n * auth state, transition, or other runtime factors.\n */\nexport type AuthTransitionRedirectTargetGetter = FactoryWithRequiredInput<AuthTransitionRedirectTarget, AuthTransitionDecisionGetterInput>;\n\n/**\n * A redirect target that can be either a static route reference, a dynamic getter, or `undefined`.\n *\n * @see {@link AuthTransitionRedirectTargetGetter} for the dynamic variant.\n */\nexport type AuthTransitionRedirectTargetOrGetter = Maybe<SegueRefOrSegueRefRouterLink> | AuthTransitionRedirectTargetGetter;\n\n/**\n * Options shared by all auth transition hook configurations.\n *\n * Controls where users are redirected when auth checks fail and how long to wait\n * for the auth decision observable before timing out.\n */\nexport interface AuthTransitionHookOptions {\n /**\n * The UIRouter state name to redirect the user to when their auth check fails.\n */\n readonly defaultRedirectTarget: string;\n\n /**\n * The UIRouter state name to redirect to when an error occurs during the auth check.\n * Defaults to {@link defaultRedirectTarget} if not specified.\n */\n readonly errorRedirectTarget?: string;\n\n /**\n * Maximum time in milliseconds to wait for the decision observable to emit.\n * If the timeout is reached, the transition is treated as a `false` decision (redirect).\n *\n * @defaultValue 1000\n */\n timeoutTime?: Milliseconds;\n}\n\n/**\n * Full configuration for creating an auth transition hook via {@link makeAuthTransitionHook}.\n *\n * Extends {@link AuthTransitionHookOptions} with the decision-making observable factory.\n */\nexport interface AuthTransitionHookConfig extends AuthTransitionHookOptions {\n /**\n * Factory that creates the decision observable for a given transition.\n *\n * The observable should emit an {@link AuthTransitionDecision} value:\n * `true` to allow, `false` to redirect to the default target, or a route reference\n * to redirect to a specific location.\n */\n readonly makeDecisionsObs: (transition: Transition, authService: DbxAuthService, injector: UIInjector) => Observable<AuthTransitionDecision>;\n}\n\n/**\n * Interface for UIRouter state `data` that supports custom redirect logic on auth failure.\n *\n * When a state's auth check fails, the `redirectTo` property determines where the user\n * is sent. If not provided, the hook's `defaultRedirectTarget` is used.\n *\n * @see {@link AuthTransitionRedirectTargetOrGetter}\n */\nexport interface AuthTransitionStateData {\n /**\n * Optional static route reference or dynamic getter that determines the redirect destination\n * when the auth check for this state fails.\n */\n redirectTo?: AuthTransitionRedirectTargetOrGetter;\n}\n\n/**\n * Creates a UIRouter `TransitionHookFn` that performs auth-based route guarding.\n *\n * The generated hook evaluates the `makeDecisionsObs` observable for each transition:\n * - If it emits `true`, the transition proceeds normally.\n * - If it emits `false`, the user is redirected to the default target or a custom redirect\n * specified in the state's `data.redirectTo` property.\n * - If it emits a route reference, the user is redirected to that specific route.\n * - If the observable does not emit within the configured timeout, the transition is rejected.\n *\n * @param config - The hook configuration including redirect targets and the decision observable factory.\n * @returns A `TransitionHookFn` suitable for registration with UIRouter's `TransitionService`.\n *\n * @see {@link enableIsLoggedInHook} for a login-based usage.\n * @see {@link enableHasAuthRoleHook} for a role-based usage.\n * @see {@link enableHasAuthStateHook} for a state-based usage.\n */\nexport function makeAuthTransitionHook(config: AuthTransitionHookConfig): TransitionHookFn {\n const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget, timeoutTime = 1000 } = config;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertIsAuthenticated: TransitionHookFn = (transition: Transition): HookResult => {\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const $state: StateService = transition.router.stateService;\n const decisionObs = config.makeDecisionsObs(transition, authService, injector);\n\n function redirectOut(): Observable<HookResult> {\n const stateData: AuthTransitionStateData = transition.targetState().state().data;\n const redirectTo = stateData?.redirectTo;\n\n let redirectToObs: Observable<HookResult>;\n\n if (redirectTo) {\n let resultObs: Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n if (isGetter<AuthTransitionRedirectTarget>(redirectTo)) {\n resultObs = getValueFromGetter(redirectTo, { authService, injector, transition } as AuthTransitionDecisionGetterInput);\n } else {\n resultObs = of(redirectTo as SegueRefOrSegueRefRouterLink);\n }\n\n redirectToObs = resultObs.pipe(\n map((inputStateRef: Maybe<SegueRefOrSegueRefRouterLink>) => {\n const stateRef = asSegueRef(inputStateRef);\n\n let redirectTarget;\n let redirectParams;\n\n if (stateRef) {\n redirectTarget = stateRef.ref;\n redirectParams = stateRef.refParams;\n }\n\n if (!redirectTarget) {\n redirectTarget = defaultRedirectTarget;\n }\n\n return $state.target(redirectTarget, redirectParams);\n })\n );\n } else {\n redirectToObs = of($state.target(defaultRedirectTarget));\n }\n\n return redirectToObs;\n }\n\n const resultObs = decisionObs.pipe(\n // after the timeoutTime seconds of no transition working, redirect with a false decision\n timeoutStartWith(false as AuthTransitionDecision, timeoutTime),\n first(),\n switchMap((decision: AuthTransitionDecision): Observable<HookResult> => {\n if (typeof decision === 'boolean') {\n if (decision) {\n return of(true);\n } else {\n return redirectOut();\n }\n } else {\n const segueRef = asSegueRef(decision);\n return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams as RawParams, segueRef.refOptions as TransitionOptions));\n }\n }),\n catchError((x) => {\n console.warn(`Encountered error in auth transition hook. Attempting redirect to ${errorRedirectTarget}.`, x);\n return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home\n })\n );\n\n return firstValueFrom(resultObs) as HookResult;\n };\n\n return assertIsAuthenticated;\n}\n","import { first, type Observable, of, switchMap } from 'rxjs';\nimport { getValueFromGetter, isGetter, type Maybe, type ObjectMap } from '@dereekb/util';\nimport { type AuthTransitionDecisionGetterInput, type AuthTransitionRedirectTarget, type AuthTransitionRedirectTargetGetter, type AuthTransitionRedirectTargetOrGetter } from './hook';\nimport { type SegueRefOrSegueRefRouterLink } from '../../../../router/segue';\nimport { type AuthUserState } from '../../../auth.user';\n\n/**\n * Creates an {@link AuthTransitionRedirectTargetGetter} that dynamically determines the redirect\n * destination based on the current {@link AuthUserState}.\n *\n * This is useful when different auth states should redirect to different routes. For example,\n * a `'new'` user might be redirected to an onboarding page while an `'anon'` user is sent to login.\n *\n * Each value in the `stateMap` can be either a static route reference or a dynamic getter\n * for more complex redirect logic.\n *\n * @param stateMap - An object map where keys are {@link AuthUserState} values and values are\n * redirect targets (static or dynamic) for that state.\n * @returns An {@link AuthTransitionRedirectTargetGetter} that resolves the redirect based on the current auth state.\n *\n * @example\n * ```ts\n * const redirectGetter = redirectBasedOnAuthUserState({\n * 'none': '/auth/login',\n * 'anon': '/auth/login',\n * 'new': '/onboard',\n * 'user': '/app'\n * });\n * ```\n *\n * @see {@link AuthTransitionRedirectTargetOrGetter}\n * @see {@link AuthUserState}\n */\nexport function redirectBasedOnAuthUserState(stateMap: ObjectMap<AuthTransitionRedirectTargetOrGetter>): AuthTransitionRedirectTargetGetter {\n return (input: AuthTransitionDecisionGetterInput) => {\n return input.authService.authUserState$.pipe(\n first(),\n switchMap((authUserState: AuthUserState) => {\n const getter = stateMap[authUserState];\n let result: Maybe<Observable<Maybe<SegueRefOrSegueRefRouterLink>>>;\n\n if (getter) {\n if (isGetter<AuthTransitionRedirectTarget>(getter)) {\n result = getValueFromGetter(getter, input);\n } else {\n result = of(getter);\n }\n }\n\n if (!result) {\n result = of(undefined);\n }\n\n return result;\n })\n );\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, makeAuthTransitionHook } from './hook';\n\n/**\n * Configuration for the {@link enableIsLoggedInHook} UIRouter transition hook.\n *\n * @see {@link AuthTransitionHookOptions} for redirect and timeout configuration.\n */\nexport interface IsLoggedInHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * UIRouter state `data` interface for states that require the user to be logged in.\n *\n * Attach this data to a UIRouter state definition to mark it as requiring authentication.\n * The {@link enableIsLoggedInHook} will check this property on entering states.\n *\n * @example\n * ```ts\n * // In a UIRouter state definition:\n * {\n * name: 'app.dashboard',\n * url: '/dashboard',\n * data: { requiredLogIn: true } as IsLoggedInStateData,\n * component: DashboardComponent\n * }\n * ```\n */\nexport interface IsLoggedInStateData {\n /**\n * Whether the user must be logged in to access this state.\n * When `true`, unauthenticated users will be redirected to the default redirect target.\n */\n requiredLogIn: boolean;\n}\n\n/**\n * Registers a UIRouter transition hook that redirects unauthenticated users away from\n * states that require login.\n *\n * The hook fires on `onBefore` (priority 100) for any state whose `data` property has\n * `requiredLogIn: true`. If the user is not logged in (as determined by {@link DbxAuthService.isLoggedIn$}),\n * they are redirected to the configured `defaultRedirectTarget`.\n *\n * @param transitionService - The UIRouter `TransitionService` to register the hook with.\n * @param config - Configuration including redirect targets and timeout settings.\n *\n * @see {@link IsLoggedInStateData} for marking states as requiring login.\n * @see {@link makeAuthTransitionHook} for the underlying hook factory.\n */\nexport function enableIsLoggedInHook(transitionService: TransitionService, config: IsLoggedInHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<IsLoggedInStateData>>;\n return Boolean(data?.requiredLogIn);\n }\n };\n\n const assertIsLoggedIn: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n return authService.isLoggedIn$;\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });\n}\n","import { map, type Observable, type OperatorFunction } from 'rxjs';\nimport { type AuthRole, type SetIncludesMode, type ArrayOrValue, type Maybe, setIncludes, asArray, type AuthRoleSet } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\n/**\n * Configuration for the {@link enableHasAuthRoleHook} UIRouter transition hook.\n *\n * @see {@link AuthTransitionHookOptions} for redirect and timeout configuration.\n */\nexport interface HasAuthRoleHookConfig {\n readonly options: AuthTransitionHookOptions;\n}\n\n/**\n * Configuration for specifying which auth roles are required for a state,\n * and how they should be evaluated.\n *\n * @see {@link HasAuthRoleStateData} for how this is used in UIRouter state data.\n */\nexport interface HasAuthRoleStateRoleConfig {\n /**\n * The auth role(s) required for this state. Can be a single role or an array of roles.\n */\n readonly authRoles: ArrayOrValue<AuthRole>;\n /**\n * How to evaluate the required roles against the user's role set.\n *\n * - `'all'` - User must have all specified roles (default).\n * - `'any'` - User must have at least one of the specified roles.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * Parsed (internal) representation of a {@link HasAuthRoleStateRoleConfig}\n * where the roles have been converted to a `Set` for efficient lookup.\n */\nexport interface ParsedHasAuthRoleStateRoleConfig {\n /**\n * The set of auth roles required for this state.\n */\n readonly requiredRoles: Set<AuthRole>;\n /**\n * How to evaluate the required roles against the user's role set.\n *\n * @see {@link HasAuthRoleStateRoleConfig.authRolesMode}\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * UIRouter state `data` interface for states that require specific auth roles.\n *\n * Attach this data to a UIRouter state definition to enforce role-based access control.\n * The {@link enableHasAuthRoleHook} checks this property on entering states.\n *\n * @example\n * ```ts\n * // In a UIRouter state definition:\n * {\n * name: 'app.admin',\n * url: '/admin',\n * data: {\n * authRoles: ['admin'],\n * authRolesMode: 'all'\n * } as HasAuthRoleStateData,\n * component: AdminComponent\n * }\n * ```\n *\n * @see {@link enableHasAuthRoleHook} for the hook that evaluates this data.\n */\nexport interface HasAuthRoleStateData extends AuthTransitionStateData, Pick<HasAuthRoleStateRoleConfig, 'authRolesMode'> {\n /**\n * Auth roles configuration for this state. Can be simple role string(s) or detailed\n * {@link HasAuthRoleStateRoleConfig} objects for per-group mode control.\n */\n readonly authRoles: ArrayOrValue<AuthRole | HasAuthRoleStateRoleConfig>;\n}\n\n/**\n * Registers a UIRouter transition hook that redirects users who lack the required auth roles\n * away from protected states.\n *\n * The hook fires on `onBefore` (priority 100) for any state whose `data` property has an\n * `authRoles` value. If the user's current roles do not satisfy the requirement\n * (based on the configured `authRolesMode`), they are redirected.\n *\n * @param transitionService - The UIRouter `TransitionService` to register the hook with.\n * @param config - Configuration including redirect targets and timeout settings.\n *\n * @see {@link HasAuthRoleStateData} for marking states with required roles.\n * @see {@link hasAuthRoleDecisionPipe} for the role evaluation logic.\n * @see {@link makeAuthTransitionHook} for the underlying hook factory.\n */\nexport function enableHasAuthRoleHook(transitionService: TransitionService, config: HasAuthRoleHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthRoleStateData>>;\n return Boolean(data?.authRoles);\n }\n };\n\n const assertHasAuthRole: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthRoleStateData = targetState.state().data;\n const mapFn: OperatorFunction<AuthRoleSet, boolean> = hasAuthRoleDecisionPipe(data);\n return authService.authRoles$.pipe(mapFn);\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });\n}\n\n/**\n * Creates an RxJS operator that evaluates whether the user's {@link AuthRoleSet} satisfies\n * the role requirements defined in the given {@link HasAuthRoleStateData}.\n *\n * The operator processes role configurations and applies the specified `authRolesMode`\n * (`'all'` or `'any'`) to determine if the user has sufficient roles.\n *\n * @param stateData - The role configuration from the UIRouter state's `data` property.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link enableHasAuthRoleHook} for where this is used in transition hooks.\n */\nexport function hasAuthRoleDecisionPipe(stateData: HasAuthRoleStateData): OperatorFunction<AuthRoleSet, boolean> {\n const authRolesMode: SetIncludesMode = stateData.authRolesMode || 'all';\n\n const authRoleConfigs: ParsedHasAuthRoleStateRoleConfig[] = asArray(stateData.authRoles).map((x) => {\n let config: HasAuthRoleStateRoleConfig;\n\n if (typeof x === 'string') {\n config = {\n authRoles: x,\n authRolesMode: 'any'\n };\n } else {\n config = x;\n }\n\n return {\n requiredRoles: new Set<AuthRole>(config.authRoles),\n authRolesMode: config.authRolesMode\n };\n });\n\n let mapFn: OperatorFunction<AuthRoleSet, boolean>;\n\n if (authRolesMode === 'any') {\n mapFn = map((x) => authRoleConfigs.some((y) => setIncludes(x, y.requiredRoles, y.authRolesMode))); // find the first match\n } else {\n mapFn = map((x) => !authRoleConfigs.some((y) => !setIncludes(x, y.requiredRoles, y.authRolesMode))); // find the first failed match\n }\n\n return mapFn;\n}\n","import { map, type Observable } from 'rxjs';\nimport { type AllowedSet, isAllowed, maybeSet, type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type AuthUserState } from '../../../auth.user';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\n/**\n * Configuration for the {@link enableHasAuthStateHook} UIRouter transition hook.\n *\n * @see {@link AuthTransitionHookOptions} for redirect and timeout configuration.\n */\nexport interface HasAuthStateHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * Configuration for specifying which {@link AuthUserState} values are allowed or disallowed for a UIRouter state.\n *\n * Can be provided as:\n * - A single `AuthUserState` string (e.g., `'user'`)\n * - An array of `AuthUserState` strings (e.g., `['user', 'new']`)\n * - A {@link HasAuthStateObjectConfig} for fine-grained allowed/disallowed control\n *\n * @see {@link HasAuthStateData} for how this is used in UIRouter state data.\n */\nexport type HasAuthStateConfig = ArrayOrValue<AuthUserState> | HasAuthStateObjectConfig;\n\n/**\n * Detailed configuration for specifying allowed and disallowed {@link AuthUserState} values.\n *\n * Provides more control than a simple array by supporting both allow-lists and deny-lists.\n * If a user's current auth state matches a disallowed state, the transition is rejected.\n *\n * @example\n * ```ts\n * const config: HasAuthStateObjectConfig = {\n * allowedStates: ['user'],\n * disallowedStates: ['none', 'error']\n * };\n * ```\n */\nexport interface HasAuthStateObjectConfig {\n /**\n * Auth user states that are permitted to access this route.\n * If specified, only users in one of these states can proceed.\n */\n allowedStates?: ArrayOrValue<AuthUserState>;\n\n /**\n * Auth user states that are explicitly forbidden from accessing this route.\n * If the user is in one of these states, the transition is rejected.\n */\n disallowedStates?: ArrayOrValue<AuthUserState>;\n}\n\n/**\n * UIRouter state `data` interface for states that require a specific {@link AuthUserState}.\n *\n * Attach this data to a UIRouter state definition to enforce auth-state-based access control.\n * The {@link enableHasAuthStateHook} checks this property on entering states.\n *\n * @example\n * ```ts\n * // In a UIRouter state definition:\n * {\n * name: 'app.dashboard',\n * url: '/dashboard',\n * data: {\n * authStates: ['user']\n * } as HasAuthStateData,\n * component: DashboardComponent\n * }\n * ```\n *\n * @see {@link enableHasAuthStateHook} for the hook that evaluates this data.\n */\nexport interface HasAuthStateData extends AuthTransitionStateData {\n /**\n * Configuration specifying which {@link AuthUserState} values are required or forbidden for this state.\n */\n authStates: HasAuthStateConfig;\n}\n\n/**\n * Registers a UIRouter transition hook that redirects users whose {@link AuthUserState} does not\n * satisfy the state's requirements.\n *\n * The hook fires on `onBefore` (priority 100) for any state whose `data` property has an\n * `authStates` value. It supports both allow-lists and deny-lists of auth user states.\n *\n * @param transitionService - The UIRouter `TransitionService` to register the hook with.\n * @param config - Configuration including redirect targets and timeout settings.\n *\n * @see {@link HasAuthStateData} for marking states with required auth states.\n * @see {@link HasAuthStateObjectConfig} for detailed allowed/disallowed configuration.\n * @see {@link makeAuthTransitionHook} for the underlying hook factory.\n */\nexport function enableHasAuthStateHook(transitionService: TransitionService, config: HasAuthStateHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthStateData>>;\n return Boolean(data?.authStates);\n }\n };\n\n const assertHasAuthState: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthStateData = targetState.state().data;\n const config = toHasAuthStateObjectConfig(data.authStates);\n const allowedStates: ParsedHasAuthStateConfig = toParsedHasAuthStateConfig(config);\n\n return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });\n}\n\n// MARK: Utility\nfunction toHasAuthStateObjectConfig(input: HasAuthStateConfig): HasAuthStateObjectConfig {\n const isString = typeof input === 'string';\n\n if (Array.isArray(input) || isString) {\n if (isString) {\n input = [input as AuthUserState];\n }\n\n return {\n allowedStates: input as AuthUserState[]\n };\n } else {\n return input as HasAuthStateObjectConfig;\n }\n}\n\ntype ParsedHasAuthStateConfig = AllowedSet<AuthUserState>;\n\nfunction toParsedHasAuthStateConfig(input: HasAuthStateObjectConfig): ParsedHasAuthStateConfig {\n return {\n allowed: maybeSet(input.allowedStates),\n disallowed: maybeSet(input.disallowedStates)\n };\n}\n","/**\n * A contextual state identifier for a specific section of the app.\n *\n * Some examples are:\n * - init: The default context that is initialized.\n * - public: A public part of the app.\n * - onboarding: The onboarding section of the app.\n * - app: The main portion of the app.\n *\n * More complex apps may have more sub-sections or app portions that could each have their own context state.\n */\nexport type DbxAppContextState = string;\n\n/**\n * The init state of an app after the default context has been initialized.\n */\nexport const DBX_INIT_APP_CONTEXT_STATE = 'init';\n/**\n * The public state of an app, typically when a user opens up the site to a public page.\n */\nexport const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';\n/**\n * The auth state of an app, typically when a user has not finished logging in.\n */\nexport const DBX_AUTH_APP_CONTEXT_STATE = 'auth';\n/**\n * The onboarding state of an app, typically when a user has completed auth but not finished setting up their account.\n */\nexport const DBX_ONBOARD_APP_CONTEXT_STATE = 'onboard';\n/**\n * The app state of an app, typically when a user has completed auth and onboarding.\n */\nexport const DBX_APP_APP_CONTEXT_STATE = 'app';\n/**\n * The oauth state of an app, typically when a user is validating an oauth request.\n */\nexport const DBX_OAUTH_APP_CONTEXT_STATE = 'oauth';\n\n/**\n * Default AppContextStates.\n *\n * Your app may not use these, but this type is available for convenience.\n */\nexport type DbxKnownAppContextState = typeof DBX_INIT_APP_CONTEXT_STATE | typeof DBX_PUBLIC_APP_CONTEXT_STATE | typeof DBX_AUTH_APP_CONTEXT_STATE | typeof DBX_ONBOARD_APP_CONTEXT_STATE | typeof DBX_APP_APP_CONTEXT_STATE | typeof DBX_OAUTH_APP_CONTEXT_STATE;\n\n/**\n * Array of all DbxKnownAppContextState values, minus the init state.\n */\nexport const DBX_KNOWN_APP_CONTEXT_STATES: DbxKnownAppContextState[] = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARD_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE, DBX_OAUTH_APP_CONTEXT_STATE];\n","import { createAction, props } from '@ngrx/store';\nimport { type DbxAppContextState } from '../../context';\n\n/**\n * Action to set the current DbxAppContextState value.\n */\nexport const setState = createAction('[App/Context] Set State', props<{ state: DbxAppContextState }>());\n\n/**\n * Resets the app back to the init context.\n */\nexport const resetState = createAction('[App/Context] Reset');\n","import { createReducer, on } from '@ngrx/store';\nimport { type DbxAppContextState, DBX_INIT_APP_CONTEXT_STATE } from '../../context';\nimport { DbxAppContextActions } from '../action';\n\n/**\n * The feature key for these items/reducers.\n */\nexport const DBX_APP_CONTEXT_STATE_FEATURE_KEY = 'data';\n\n/**\n * The typings for this feature.\n */\nexport interface DbxAppContextStateData {\n state: DbxAppContextState;\n}\n\nexport const initialState: DbxAppContextStateData = {\n state: DBX_INIT_APP_CONTEXT_STATE\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.\n */\n on(DbxAppContextActions.setState, (_, { state }) => ({ state }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppContextState from './data.reducer';\n\n/**\n * Global feature key for our app.\n */\nexport const FEATURE_KEY = 'app.context';\n\n/**\n * This is a \"feature state\", which in this case is a single feature (our app state), but could include keys/states within this feature.\n */\nexport interface DbxAppContextFeatureState {\n [fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY]: fromDbxAppContextState.DbxAppContextStateData;\n}\n\n/**\n * Interface typing extension for the DbxAppContextFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [FEATURE_KEY]: DbxAppContextFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppContextFeatureState\n *\n * @param state - The current feature state, or undefined for initialization.\n * @param action - The dispatched action to reduce.\n * @returns The updated feature state.\n */\nexport function reducers(state: DbxAppContextFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY]: fromDbxAppContextState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppContextFeatureState feature context.\n *\n * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.\n */\nexport const selectAppContextFeature = createFeatureSelector<DbxAppContextFeatureState>(FEATURE_KEY);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState: DbxAppContextFeatureState) => featureState[fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY].state);\n","import { type OnRunEffects, Actions, type EffectNotification, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { type Observable, exhaustMap, filter, takeUntil } from 'rxjs';\nimport { type DbxAppContextState } from '../../context';\nimport { onDbxAppContext } from '../';\nimport { type IterableOrValue, iterableToSet } from '@dereekb/util';\nimport { inject } from '@angular/core';\n\n// MARK: Abstract Context Effects\n/**\n * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.\n */\nexport abstract class AbstractOnDbxAppContextStateEffects<S = unknown> implements OnRunEffects {\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<S>);\n\n /**\n * The set of state(s) to activate on.\n */\n private _activeStatesSet: Set<DbxAppContextState>;\n\n constructor(activeStates: IterableOrValue<DbxAppContextState>) {\n this._activeStatesSet = iterableToSet(activeStates);\n }\n\n /**\n * Configures all actions of the sub-class to only activate when the DbxAppContextState in App\n *\n * @param resolvedEffects$\n * @returns\n */\n ngrxOnRunEffects(resolvedEffects$: Observable<EffectNotification>): Observable<EffectNotification> {\n return this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => {\n return this._activeStatesSet.has(state);\n }),\n exhaustMap(() =>\n resolvedEffects$.pipe(\n takeUntil(\n this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => !this._activeStatesSet.has(state))\n )\n )\n )\n )\n );\n }\n}\n","import { type Maybe } from '@dereekb/util';\n\n/**\n * Represents the authentication state of an application user.\n *\n * These generic states define the current lifecycle stage of a user's authentication:\n *\n * - `'none'` - The user is not logged in (no active session).\n * - `'anon'` - The user is authenticated via an anonymous account (e.g., Firebase anonymous auth).\n * - `'error'` - An error occurred while resolving the user's authentication state.\n * - `'new'` - The user has a full account but has not yet completed onboarding or initial setup.\n * - `'user'` - The user has a full account and has completed all setup steps.\n *\n * @example\n * ```ts\n * const state: AuthUserState = 'user';\n *\n * if (state === 'new') {\n * // redirect to onboarding\n * }\n * ```\n */\nexport type AuthUserState = 'none' | 'anon' | 'new' | 'user' | 'error';\n\n/**\n * Arbitrary string identifier used to uniquely differentiate authenticated users.\n *\n * Typically corresponds to a UID from the authentication provider (e.g., Firebase Auth UID).\n *\n * @see {@link NO_AUTH_USER_IDENTIFIER} for the sentinel value representing an unidentified user.\n */\nexport type AuthUserIdentifier = string;\n\n/**\n * Sentinel value representing an unauthenticated or unidentifiable user.\n *\n * Used as a fallback when no valid {@link AuthUserIdentifier} is available.\n */\nexport const NO_AUTH_USER_IDENTIFIER = '0';\n\n/**\n * Type representing the {@link NO_AUTH_USER_IDENTIFIER} sentinel value.\n *\n * Useful for type narrowing when distinguishing between authenticated and unauthenticated user identifiers.\n *\n * @see {@link NO_AUTH_USER_IDENTIFIER}\n */\nexport type NoAuthUserIdentifier = typeof NO_AUTH_USER_IDENTIFIER;\n\n/**\n * Normalizes an optional user identifier into a guaranteed {@link AuthUserIdentifier}.\n *\n * If the input is `undefined` or falsy, returns {@link NO_AUTH_USER_IDENTIFIER} as a safe default.\n * This ensures downstream consumers always receive a non-null identifier value.\n *\n * @param inputId - The user identifier to normalize, or `undefined`/`null`.\n * @returns The input identifier if truthy, otherwise {@link NO_AUTH_USER_IDENTIFIER}.\n *\n * @example\n * ```ts\n * authUserIdentifier('abc123'); // 'abc123'\n * authUserIdentifier(undefined); // '0'\n * ```\n */\nexport function authUserIdentifier(inputId: Maybe<AuthUserIdentifier>): AuthUserIdentifier {\n return inputId ? inputId : NO_AUTH_USER_IDENTIFIER;\n}\n","import { createAction } from '@ngrx/store';\n\n/**\n * NgRx action dispatched when the user has successfully logged in.\n *\n * This is an event action (past tense) triggered by {@link DbxAppAuthEffects} in response\n * to the {@link DbxAuthService.onLogIn$} observable. It signals that authentication has been\n * established and downstream effects (e.g., navigation to the app) can proceed.\n *\n * @see {@link loggedOut} for the corresponding logout event.\n * @see {@link DbxAppAuthEffects.emitLoggedIn}\n */\nexport const loggedIn = createAction('[App/Auth] Auth Logged In');\n\n/**\n * NgRx action dispatched when the user has logged out.\n *\n * This is an event action (past tense) triggered by {@link DbxAppAuthEffects} in response\n * to the {@link DbxAuthService.onLogOut$} observable. When dispatched, the user reducer\n * resets the auth state to its initial values (no user, no roles, not onboarded).\n *\n * @see {@link loggedIn} for the corresponding login event.\n * @see {@link logout} for the imperative command action to initiate logout.\n */\nexport const loggedOut = createAction('[App/Auth] Auth Logged Out');\n\n/**\n * NgRx action that commands the application to perform a logout.\n *\n * This is a command action (imperative) that, when dispatched, triggers {@link DbxAppAuthEffects.forwardLogoutToAuthService}\n * to call {@link DbxAuthService.logOut}. Use this action to initiate logout from anywhere in the application\n * via the NgRx store rather than calling the auth service directly.\n *\n * @see {@link loggedOut} for the event action dispatched after logout completes.\n */\nexport const logout = createAction('[App/Auth] Auth Logout');\n","import { createAction, props } from '@ngrx/store';\nimport { type AuthRole } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\n\n/**\n * NgRx action that updates the authenticated user's identifier in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserIdentifier} whenever the\n * {@link DbxAuthService.userIdentifier$} emits a new value.\n *\n * @see {@link DbxAppAuthStateUser.userId}\n */\nexport const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props<{ id: AuthUserIdentifier }>());\n\n/**\n * NgRx action that updates the authenticated user's {@link AuthUserState} in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserState} whenever the\n * {@link DbxAuthService.authUserState$} emits a new value. The state determines\n * the user's lifecycle stage (none, anon, new, user, or error).\n *\n * @see {@link AuthUserState}\n * @see {@link DbxAppAuthStateUser.userState}\n */\nexport const setUserState = createAction('[App/Auth] Set User State', props<{ state: AuthUserState }>());\n\n/**\n * NgRx action that updates the authenticated user's auth roles in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserRoles} whenever the\n * {@link DbxAuthService.authRoles$} emits a new role set. Roles are stored\n * as an array in the NgRx state.\n *\n * @see {@link DbxAppAuthStateUser.userRoles}\n */\nexport const setUserRoles = createAction('[App/Auth] Set User Roles', props<{ roles: AuthRole[] }>());\n\n/**\n * NgRx action that updates the authenticated user's onboarding status in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserIsOnboarded} whenever the\n * {@link DbxAuthService.isOnboarded$} emits a new value.\n *\n * @see {@link DbxAppAuthStateUser.isOnboarded}\n */\nexport const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props<{ isOnboarded: boolean }>());\n","import { NO_AUTH_USER_IDENTIFIER, type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\nimport { createReducer, on } from '@ngrx/store';\nimport { DbxAppAuthActions, DbxAppAuthUserActions } from '../action';\nimport { type AuthRole } from '@dereekb/util';\n\n/**\n * NgRx feature key for the auth user sub-state within the auth feature.\n */\nexport const DBX_APP_AUTH_USER_FEATURE_KEY = 'user';\n\n/**\n * Shape of the authenticated user's state stored in the NgRx store.\n *\n * This interface represents the complete snapshot of user authentication information\n * managed by the auth reducer, including identity, lifecycle state, authorization roles,\n * and onboarding status.\n *\n * @example\n * ```ts\n * // Selecting from the store via DbxAppAuthStateService:\n * const user$ = authStateService.authStateUser$;\n * user$.subscribe((user: DbxAppAuthStateUser) => {\n * console.log(user.userId, user.userState, user.userRoles);\n * });\n * ```\n *\n * @see {@link DbxAppAuthStateService} for accessing this state reactively.\n * @see {@link AuthUserState} for possible values of `userState`.\n */\nexport interface DbxAppAuthStateUser {\n /**\n * Unique identifier for the authenticated user. Defaults to {@link NO_AUTH_USER_IDENTIFIER} when no user is logged in.\n */\n userId: AuthUserIdentifier;\n /**\n * Whether the user has completed the onboarding/setup flow.\n */\n isOnboarded: boolean;\n /**\n * Current authentication lifecycle state of the user.\n */\n userState: AuthUserState;\n /**\n * Array of authorization roles assigned to the current user.\n */\n userRoles: AuthRole[];\n}\n\n/**\n * Initial state for the auth user reducer.\n *\n * Represents a fully unauthenticated state: no user identifier, not onboarded,\n * in the `'none'` auth state, with no roles assigned.\n */\nexport const initialState: DbxAppAuthStateUser = {\n userId: NO_AUTH_USER_IDENTIFIER,\n isOnboarded: false,\n userState: 'none',\n userRoles: []\n};\n\nexport const reducer = createReducer(\n initialState,\n on(DbxAppAuthActions.loggedOut, () => ({ ...initialState })),\n on(DbxAppAuthUserActions.setUserIdentifier, (state, { id: userId }) => ({ ...state, userId })),\n on(DbxAppAuthUserActions.setUserIsOnboarded, (state, { isOnboarded }) => ({ ...state, isOnboarded })),\n on(DbxAppAuthUserActions.setUserState, (state, { state: userState }) => ({ ...state, userState })),\n on(DbxAppAuthUserActions.setUserRoles, (state, { roles: userRoles }) => ({ ...state, userRoles: [...userRoles] }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\nimport * as fromDbxAppAuthUserState from './user.reducer';\n\n/**\n * NgRx feature key used to register the auth feature state in the global store.\n *\n * The auth state is registered under `'app.auth'` in the root NgRx state tree.\n */\nexport const FEATURE_KEY = 'app.auth';\n\n/**\n * Shape of the auth feature state slice, containing all auth-related sub-states.\n *\n * Currently contains only the user sub-state ({@link DbxAppAuthStateUser}), but is\n * structured to accommodate additional auth-related sub-features in the future.\n *\n * @see {@link DbxAppAuthStateUser} for the user sub-state shape.\n */\nexport interface DbxAppAuthFeatureState {\n [fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY]: fromDbxAppAuthUserState.DbxAppAuthStateUser;\n}\n\n/**\n * Root state interface extension that declares how the auth feature integrates into the global NgRx store.\n *\n * Use this type when injecting `Store<State>` in effects or services that need typed access\n * to the auth feature selectors.\n *\n * @see {@link DbxAppAuthFullState} for the public alias of this type.\n */\nexport interface State {\n [FEATURE_KEY]: DbxAppAuthFeatureState;\n}\n\n/**\n * Combined reducer function for the auth feature state.\n *\n * Merges all auth sub-reducers (currently just the user reducer) using NgRx's `combineReducers`.\n * This function is registered with `provideState` via {@link provideDbxAppAuthState}.\n *\n * @param state - The current auth feature state, or `undefined` for initialization.\n * @param action - The dispatched NgRx action.\n * @returns The updated {@link DbxAppAuthFeatureState}.\n */\nexport function reducers(state: DbxAppAuthFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY]: fromDbxAppAuthUserState.reducer\n })(state, action);\n}\n\n/**\n * NgRx feature selector that retrieves the entire {@link DbxAppAuthFeatureState} from the global store.\n */\nexport const selectAppAuthFeature = createFeatureSelector<DbxAppAuthFeatureState>(FEATURE_KEY);\n\n/**\n * NgRx selector that retrieves the {@link DbxAppAuthStateUser} from the auth feature state.\n *\n * Provides access to the user's identifier, auth state, roles, and onboarding status.\n *\n * @see {@link DbxAppAuthStateService.authStateUser$} for the observable wrapper.\n */\nexport const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState: DbxAppAuthFeatureState) => featureState[fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY]);\n","import { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { firstValueFrom } from 'rxjs';\nimport { type SegueRef, type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * A function type that performs router navigation using a {@link SegueRef}.\n *\n * Returns a promise that resolves to `true` if the navigation was successful.\n *\n * @see {@link goWithRouter} for creating instances\n */\nexport type GoWithRouter = (route: ObservableOrValue<SegueRef>) => Promise<boolean>;\n\n/**\n * Creates a navigation function bound to the given {@link DbxRouterService}.\n *\n * The returned function accepts either a {@link SegueRef}, a router link string, or an observable of either,\n * resolves it to a single value, and calls `go()` on the router service.\n *\n * @param dbxRouterService - The router service to use for navigation.\n * @returns A function that navigates to the given route and returns a promise resolving to the navigation result.\n *\n * @example\n * ```ts\n * const navigate = goWithRouter(routerService);\n * await navigate({ ref: 'app.dashboard' });\n * ```\n *\n * @see {@link GoWithRouter}\n */\nexport function goWithRouter(dbxRouterService: DbxRouterService): (route: ObservableOrValue<SegueRefOrSegueRefRouterLink>) => Promise<boolean> {\n return (route) => {\n return firstValueFrom(asObservable(route)).then((x) => dbxRouterService.go(x));\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Abstract service that provides an observable stream of router transition events.\n *\n * This is the base class for {@link DbxRouterService}, exposing only the transition\n * observation capability without navigation methods. Useful when a consumer only needs\n * to react to route changes without performing navigation.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * class MyComponent {\n * private readonly transitions = inject(DbxRouterTransitionService);\n *\n * readonly onSuccess$ = this.transitions.transitions$.pipe(\n * filter(e => e.type === DbxRouterTransitionEventType.SUCCESS)\n * );\n * }\n * ```\n *\n * @see {@link DbxRouterService} for the full router service with navigation\n * @see {@link DbxRouterTransitionEvent} for the event type\n */\nexport abstract class DbxRouterTransitionService {\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n}\n","import { type ObservableOrValue } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../segue';\nimport { DbxRouterTransitionService } from './router.transition.service';\n\n/**\n * Abstract router service that provides navigation capabilities and routing state information.\n *\n * Extends {@link DbxRouterTransitionService} with navigation methods (`go`, `updateParams`) and\n * route inspection methods (`isActive`, `isActiveExactly`, `comparePrecision`).\n *\n * Concrete implementations include {@link DbxAngularRouterService} (Angular Router) and\n * {@link DbxUIRouterService} (UIRouter).\n *\n * @example\n * ```ts\n * // Inject and use in a component or service\n * @Component({ ... })\n * class MyComponent {\n * private readonly router = inject(DbxRouterService);\n *\n * navigateToDashboard(): void {\n * this.router.go({ ref: 'app.dashboard', refParams: { tab: 'overview' } });\n * }\n * }\n * ```\n *\n * @see {@link DbxRouterTransitionService} for transition event observables\n * @see {@link DbxAngularRouterService} for the Angular Router implementation\n * @see {@link DbxUIRouterService} for the UIRouter implementation\n */\nexport abstract class DbxRouterService extends DbxRouterTransitionService {\n /**\n * Params of the current successfully loaded route.\n */\n abstract readonly params$: Observable<SegueRefRawSegueParams>;\n\n /**\n * Navigates to the target SegueRef.\n *\n * @param segueRef\n */\n abstract go(segueRef: ObservableOrValue<SegueRefOrSegueRefRouterLink>): Promise<boolean>;\n\n /**\n * Navigates to the current url with updated parameters. Will be merged with the existing parameters.\n *\n * The new state will replace the current state in the history.\n *\n * @param segueRef\n */\n abstract updateParams(params: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean>;\n\n /**\n * Returns `true` if the input segue ref is considered active (hierarchical match).\n *\n * Accepts both state names (e.g., `'app.dashboard'`) and slash paths (e.g., `'/app/dashboard'`).\n * For non-exact checks, a parent route matches all of its children — e.g., `'/app/oauth'`\n * is active when the current path is `'/app/oauth/login'`.\n *\n * @param segueRef - A state name, URL path, or {@link SegueRef} to check against the current route.\n */\n abstract isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Returns `true` if the input segue ref matches the current route exactly.\n *\n * Unlike {@link isActive}, this does not match parent routes against child routes.\n *\n * @param segueRef - A state name, URL path, or {@link SegueRef} to check against the current route.\n */\n abstract isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Compares the two refs for precision for a certain route.\n *\n * For example, if the parent route is input with a child route, the child route is\n * considered more precise.\n *\n * @param a\n * @param b\n */\n abstract comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number;\n}\n","import { type SegueRefOrSegueRefRouterLink } from '../../router/segue';\n\n/**\n * Abstract configuration class that defines the key authentication-related routes for an application.\n *\n * Provide a concrete instance of this class via {@link provideDbxAppAuthRouter} to configure\n * where the auth router service navigates during authentication lifecycle events (login, logout, onboarding).\n *\n * @example\n * ```ts\n * const authRoutes: DbxAppAuthRoutes = {\n * loginRef: '/auth/login',\n * loggedOutRef: '/auth/logged-out',\n * onboardRef: '/onboard',\n * appRef: '/app'\n * };\n * ```\n *\n * @see {@link DbxAppAuthRouterService} for the service that uses these routes for navigation.\n * @see {@link provideDbxAppAuthRouter} for registering this configuration.\n */\nexport abstract class DbxAppAuthRoutes {\n /**\n * Route reference for the login page. Users are redirected here when authentication is required.\n */\n abstract readonly loginRef: SegueRefOrSegueRefRouterLink;\n /**\n * Optional route reference for the logged-out page. Falls back to {@link loginRef} if not provided.\n */\n abstract readonly loggedOutRef?: SegueRefOrSegueRefRouterLink;\n /**\n * Optional route reference for the onboarding/setup page. Falls back to {@link appRef} if not provided.\n */\n abstract readonly onboardRef?: SegueRefOrSegueRefRouterLink;\n /**\n * Route reference for the main application page. Users are redirected here after successful authentication.\n */\n abstract readonly appRef: SegueRefOrSegueRefRouterLink;\n}\n","import { BehaviorSubject, combineLatest, distinctUntilChanged, map, type Observable, startWith } from 'rxjs';\nimport { Injectable, type OnDestroy, inject } from '@angular/core';\nimport { goWithRouter } from '../../router/router/service/router.go';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { type SegueRefOrSegueRefRouterLink } from '../../router/segue';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Angular service that provides programmatic navigation to key authentication-related routes.\n *\n * This service wraps {@link DbxRouterService} and {@link DbxAppAuthRoutes} to offer\n * convenient methods for navigating to login, logout, onboarding, and main app routes.\n * It also manages an `isAuthRouterEffectsEnabled` flag that controls whether\n * {@link DbxAppAuthRouterEffects} should perform automatic navigation on auth events.\n *\n * Routes can be added to the ignored set via {@link addIgnoredRoute} to prevent\n * auth effects from redirecting away from those routes (e.g., OAuth interaction pages).\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class LogoutButtonComponent {\n * private readonly authRouterService = inject(DbxAppAuthRouterService);\n *\n * async onLogout() {\n * await this.authRouterService.goToLoggedOut();\n * }\n * }\n * ```\n *\n * @see {@link DbxAppAuthRoutes} for the route configuration.\n * @see {@link DbxAppAuthRouterEffects} for automatic navigation on auth state changes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthRouterService implements OnDestroy {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxAppAuthRoutes = inject(DbxAppAuthRoutes);\n\n private readonly _isAuthRouterEffectsEnabled = new BehaviorSubject<boolean>(true);\n private readonly _ignoredRoutes = new BehaviorSubject<Set<SegueRefOrSegueRefRouterLink>>(new Set());\n\n /**\n * Observable of whether auth router effects are currently enabled.\n */\n readonly isAuthRouterEffectsEnabled$ = this._isAuthRouterEffectsEnabled.asObservable();\n\n /**\n * Observable of the set of route refs that are excluded from auth redirect effects.\n */\n readonly ignoredRoutes$ = this._ignoredRoutes.asObservable();\n\n /**\n * Observable that emits `true` when the current route is in the ignored set.\n *\n * Combines the ignored route refs with router transition events to re-evaluate\n * whenever the route or the ignored set changes.\n */\n readonly isCurrentRouteIgnoredByAuthEffects$: Observable<boolean> = combineLatest([this._ignoredRoutes, this.dbxRouterService.transitions$.pipe(startWith(undefined))]).pipe(\n map(([ignoredRefs]) => this._checkCurrentRouteIgnored(ignoredRefs)),\n distinctUntilChanged()\n );\n\n /**\n * Observable that emits `true` when auth router effects should be active for the current route.\n *\n * Combines the enabled flag and the ignored route check.\n */\n readonly shouldAuthEffectsRedirect$: Observable<boolean> = combineLatest([this.isAuthRouterEffectsEnabled$, this.isCurrentRouteIgnoredByAuthEffects$]).pipe(\n map(([enabled, ignored]) => enabled && !ignored),\n distinctUntilChanged()\n );\n\n ngOnDestroy(): void {\n this._isAuthRouterEffectsEnabled.complete();\n this._ignoredRoutes.complete();\n }\n\n get hasOnboardingState(): boolean {\n return Boolean(this.dbxAppAuthRoutes.onboardRef);\n }\n\n // MARK: Effects\n /**\n * Whether or not DbxAppAuthRouterEffects are enabled.\n *\n * @returns Whether auth router effects are currently enabled.\n */\n get isAuthRouterEffectsEnabled(): boolean {\n return this._isAuthRouterEffectsEnabled.value;\n }\n\n set isAuthRouterEffectsEnabled(enabled: boolean) {\n this._isAuthRouterEffectsEnabled.next(enabled);\n }\n\n // MARK: Ignored Routes\n /**\n * Adds a route to the ignored set. Auth effects will not redirect\n * when the user is on a route that matches any ignored route.\n *\n * Uses hierarchical matching — adding a parent route (e.g., `'/app/oauth'`)\n * will also ignore all child routes (e.g., `'/app/oauth/login'`).\n *\n * @param ref - The route ref to add to the ignored set.\n */\n addIgnoredRoute(ref: SegueRefOrSegueRefRouterLink): void {\n const current = this._ignoredRoutes.value;\n const next = new Set(current);\n next.add(ref);\n this._ignoredRoutes.next(next);\n }\n\n /**\n * Removes a route from the ignored set.\n *\n * @param ref - The route ref to remove from the ignored set.\n */\n removeIgnoredRoute(ref: SegueRefOrSegueRefRouterLink): void {\n const current = this._ignoredRoutes.value;\n const next = new Set(current);\n next.delete(ref);\n this._ignoredRoutes.next(next);\n }\n\n /**\n * Returns `true` if the current route matches any of the ignored routes.\n *\n * @returns Whether the current route is in the ignored set.\n */\n get isCurrentRouteIgnoredByAuthEffects(): boolean {\n return this._checkCurrentRouteIgnored(this._ignoredRoutes.value);\n }\n\n private _checkCurrentRouteIgnored(ignoredRefs: Set<SegueRefOrSegueRefRouterLink>): boolean {\n for (const ref of ignoredRefs) {\n if (this.dbxRouterService.isActive(ref)) {\n return true;\n }\n }\n\n return false;\n }\n\n // MARK: Navigate\n /**\n * Navigates to the login state.\n *\n * @returns\n */\n goToLogin() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the logged out state, if it exists, otherwise navigates to the login state.\n *\n * @returns\n */\n goToLoggedOut() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loggedOutRef ?? this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the onboarding state if it is available, otherwise navigates to the app.\n *\n * @returns\n */\n goToOnboarding(): Promise<boolean> {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.onboardRef ?? this.dbxAppAuthRoutes.appRef);\n }\n\n /**\n * Navigates to the app state.\n *\n * @returns\n */\n goToApp() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);\n }\n}\n","import { exhaustMap, filter, first, switchMap } from 'rxjs';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { createEffect, ofType } from '@ngrx/effects';\nimport { type DbxAppContextState, DBX_KNOWN_APP_CONTEXT_STATES } from '../../../../context/context';\nimport { AbstractOnDbxAppContextStateEffects } from '../../../../context/state/effect';\nimport { type fromDbxAppAuth, onDbxAppAuth } from '../../../state';\nimport { DbxAppAuthRouterService } from '../../auth.router.service';\n\n/**\n * Angular injection token used to configure which {@link DbxAppContextState} values\n * the {@link DbxAppAuthRouterEffects} should be active for.\n *\n * When provided, the effects will only trigger navigation (e.g., redirect on logout)\n * when the application is in one of the specified context states.\n * Defaults to {@link DBX_KNOWN_APP_CONTEXT_STATES} if not explicitly provided.\n *\n * @see {@link provideDbxAppAuthRouterState} for how this token is provisioned.\n */\nexport const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');\n\n/**\n * NgRx effects class that performs automatic navigation when authentication state changes.\n *\n * This effects class handles two key navigation scenarios:\n * - **On logout**: Redirects the user to the login route via {@link DbxAppAuthRouterService.goToLogin}.\n * - **On login**: Redirects the user to the main app route via {@link DbxAppAuthRouterService.goToApp}.\n *\n * Navigation only occurs when:\n * 1. The app is in one of the configured active context states (see {@link DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN}).\n * 2. The {@link DbxAppAuthRouterService.isAuthRouterEffectsEnabled} flag is `true`.\n * 3. The current route is not in the ignored routes set (see {@link DbxAppAuthRouterService.addIgnoredRoute}).\n *\n * Extends {@link AbstractOnDbxAppContextStateEffects} to scope effect activation to specific app states.\n *\n * @see {@link DbxAppAuthRouterService} for the navigation methods used.\n * @see {@link provideDbxAppAuthRouterState} for registration and configuration.\n */\n@Injectable()\nexport class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects<fromDbxAppAuth.State> {\n readonly dbxAppAuthRouterService = inject(DbxAppAuthRouterService);\n\n constructor() {\n super(inject<Maybe<ArrayOrValue<DbxAppContextState>>>(DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, { optional: true }) ?? DBX_KNOWN_APP_CONTEXT_STATES);\n }\n\n /**\n * Effect to redirect to the login when logout occurs.\n */\n readonly redirectToLoginOnLogout = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedOut),\n switchMap(() => this.dbxAppAuthRouterService.shouldAuthEffectsRedirect$.pipe(first())),\n filter((shouldRedirect) => shouldRedirect),\n exhaustMap(() => this.dbxAppAuthRouterService.goToLogin())\n ),\n { dispatch: false }\n );\n\n /**\n * Effect to redirect to the app when login occurs.\n */\n readonly redirectToOnboardOnLogIn = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedIn),\n switchMap(() => this.dbxAppAuthRouterService.shouldAuthEffectsRedirect$.pipe(first())),\n filter((shouldRedirect) => shouldRedirect),\n exhaustMap(() => this.dbxAppAuthRouterService.goToApp())\n ),\n { dispatch: false }\n );\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type ArrayOrValue } from '@dereekb/util';\nimport { provideEffects } from '@ngrx/effects';\nimport { type DbxAppContextState } from '../../../context';\nimport { DbxAppAuthRouterEffects, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN } from './effect/auth.router.state.effect';\n\n/**\n * Configuration for {@link provideDbxAppAuthRouterState}.\n *\n * @see {@link DbxAppAuthRouterEffects} for the effects that use this configuration.\n */\nexport interface ProvideDbxAppAuthRouterStateConfig {\n /**\n * Application context states during which the auth router effects should be active.\n *\n * When the app is in one of these states, effects like automatic redirect on login/logout\n * will be applied. Typically set to `['root']` or {@link DBX_KNOWN_APP_CONTEXT_STATES}.\n */\n readonly activeRoutesToApplyEffects: ArrayOrValue<DbxAppContextState>;\n}\n\n/**\n * Creates Angular `EnvironmentProviders` that register the auth router state effects\n * and their configuration.\n *\n * This provisions the {@link DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN} with the active states\n * and registers the {@link DbxAppAuthRouterEffects} NgRx effects class.\n *\n * @param config - Configuration specifying which app context states activate the auth router effects.\n * @returns Angular `EnvironmentProviders` for the auth router state effects.\n *\n * @example\n * ```ts\n * provideDbxAppAuthRouterState({\n * activeRoutesToApplyEffects: ['root']\n * });\n * ```\n *\n * @see {@link provideDbxAppAuth} for the all-in-one provider that includes this.\n * @see {@link DbxAppAuthRouterEffects} for the effects that handle auth-based navigation.\n */\nexport function provideDbxAppAuthRouterState(config: ProvideDbxAppAuthRouterStateConfig): EnvironmentProviders {\n const { activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n // Token for effects\n {\n provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,\n useValue: activeRoutesToApplyEffects\n },\n // Effects\n provideEffects(DbxAppAuthRouterEffects)\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Configuration for {@link provideDbxAppAuthRouter}.\n *\n * @see {@link DbxAppAuthRoutes} for the route definitions.\n */\nexport interface ProvideDbxAppAuthRouterConfig {\n /**\n * The concrete {@link DbxAppAuthRoutes} instance that defines the application's auth-related routes\n * (login, logout, onboarding, and main app).\n */\n readonly dbxAppAuthRoutes: DbxAppAuthRoutes;\n}\n\n/**\n * Creates Angular `EnvironmentProviders` that register the {@link DbxAppAuthRoutes} configuration.\n *\n * This makes the auth routes available for injection throughout the application,\n * primarily consumed by {@link DbxAppAuthRouterService} for programmatic navigation.\n *\n * @param config - Configuration containing the auth routes to register.\n * @returns Angular `EnvironmentProviders` for the auth router.\n *\n * @example\n * ```ts\n * provideDbxAppAuthRouter({\n * dbxAppAuthRoutes: {\n * loginRef: '/auth/login',\n * appRef: '/app'\n * }\n * });\n * ```\n *\n * @see {@link provideDbxAppAuth} for the all-in-one provider that includes this.\n */\nexport function provideDbxAppAuthRouter(config: ProvideDbxAppAuthRouterConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxAppAuthRoutes,\n useValue: dbxAppAuthRoutes\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type AuthRole, type AuthRoleSet, type Maybe } from '@dereekb/util';\nimport { onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, setContainsNoValueFrom } from '@dereekb/rxjs';\nimport { map, type Observable, type OperatorFunction } from 'rxjs';\n\n/**\n * Creates an observable that emits a `void` event each time the user transitions from\n * logged-out to logged-in (i.e., the input observable transitions from `false` to `true`).\n *\n * Useful for triggering side effects (e.g., loading user data) on login events.\n *\n * @param isLoggedInObs - An observable that emits `true` when the user is logged in and `false` otherwise.\n * @returns An observable that emits `void` on each false-to-true transition.\n *\n * @see {@link loggedOutObsFromIsLoggedIn} for the inverse (logout detection).\n */\nexport function loggedInObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onFalseToTrue(),\n map(() => undefined)\n );\n}\n/**\n * Creates an observable that emits a `void` event each time the user transitions from\n * logged-in to logged-out (i.e., the input observable transitions from `true` to `false`).\n *\n * Useful for triggering side effects (e.g., clearing cached data) on logout events.\n *\n * @param isLoggedInObs - An observable that emits `true` when the user is logged in and `false` otherwise.\n * @returns An observable that emits `void` on each true-to-false transition.\n *\n * @see {@link loggedInObsFromIsLoggedIn} for the inverse (login detection).\n */\nexport function loggedOutObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onTrueToFalse(),\n map(() => undefined)\n );\n}\n\n/**\n * RxJS operator that checks whether an {@link AuthRoleSet} contains **all** roles from the given observable set.\n *\n * Emits `true` when every role in the target set is present in the source role set, `false` otherwise.\n *\n * @param roles - Observable of the required roles to check against.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link authRolesSetContainsAnyRoleFrom} for matching any role.\n * @see {@link authRolesSetContainsNoRolesFrom} for matching no roles.\n */\nexport function authRolesSetContainsAllRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\n/**\n * RxJS operator that checks whether an {@link AuthRoleSet} contains **any** role from the given observable set.\n *\n * Emits `true` when at least one role in the target set is present in the source role set, `false` otherwise.\n *\n * @param roles - Observable of the target roles to check against.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link authRolesSetContainsAllRolesFrom} for matching all roles.\n * @see {@link authRolesSetContainsNoRolesFrom} for matching no roles.\n */\nexport function authRolesSetContainsAnyRoleFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\n/**\n * RxJS operator that checks whether an {@link AuthRoleSet} contains **none** of the roles from the given observable set.\n *\n * Emits `true` when no role in the target set is present in the source role set, `false` otherwise.\n * Useful for hiding content from users with specific roles.\n *\n * @param roles - Observable of the roles to check for absence.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link authRolesSetContainsAllRolesFrom} for matching all roles.\n * @see {@link authRolesSetContainsAnyRoleFrom} for matching any role.\n */\nexport function authRolesSetContainsNoRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsNoValueFrom<AuthRole>(roles);\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { DbxAuthService } from '../../service/auth.service';\nimport { onDbxAppAuth } from '../';\nimport { map, tap } from 'rxjs';\nimport type * as fromDbxAppAuth from '../reducer';\n\n/**\n * NgRx effects class that bridges the {@link DbxAuthService} observables into the NgRx store.\n *\n * This effects class serves two purposes:\n * 1. **Event forwarding**: Listens to the auth service's reactive streams (login/logout events,\n * user state, roles, onboarding status, user identifier) and dispatches corresponding NgRx actions\n * to keep the store in sync with the auth provider.\n * 2. **Command handling**: Listens for the `logout` command action and forwards it to\n * {@link DbxAuthService.logOut} to perform the actual logout.\n *\n * This is registered via {@link provideDbxAppAuthState} and should not be provided manually.\n *\n * @see {@link DbxAuthService} for the source observables.\n * @see {@link DbxAppAuthActions} for the auth lifecycle actions.\n * @see {@link DbxAppAuthUserActions} for the user state actions.\n */\n@Injectable()\nexport class DbxAppAuthEffects {\n private readonly dbxAuthService = inject(DbxAuthService);\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<fromDbxAppAuth.State>);\n\n // MARK: Auth\n /**\n * Dispatches {@link DbxAppAuthActions.loggedIn} when the auth service emits a login event.\n */\n readonly emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedIn())));\n\n /**\n * Dispatches {@link DbxAppAuthActions.loggedOut} when the auth service emits a logout event.\n */\n readonly emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedOut())));\n\n /**\n * Forwards the {@link DbxAppAuthActions.logout} command to {@link DbxAuthService.logOut}.\n */\n readonly forwardLogoutToAuthService = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.logout),\n tap(() => {\n // Perform the logout\n void this.dbxAuthService.logOut();\n })\n ),\n { dispatch: false }\n );\n\n // MARK: User\n /**\n * Syncs the user identifier from the auth service into the NgRx store.\n */\n readonly setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$.pipe(map((id) => onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier({ id }))));\n\n /**\n * Syncs the user's {@link AuthUserState} from the auth service into the NgRx store.\n */\n readonly setUserState = createEffect(() => this.dbxAuthService.authUserState$.pipe(map((state) => onDbxAppAuth.DbxAppAuthUserActions.setUserState({ state }))));\n\n /**\n * Syncs the user's auth roles from the auth service into the NgRx store.\n */\n readonly setUserRoles = createEffect(() => this.dbxAuthService.authRoles$.pipe(map((roles) => onDbxAppAuth.DbxAppAuthUserActions.setUserRoles({ roles: [...(roles ?? [])] }))));\n\n /**\n * Syncs the user's onboarding status from the auth service into the NgRx store.\n */\n readonly setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$.pipe(map((isOnboarded) => onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded({ isOnboarded }))));\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideEffects } from '@ngrx/effects';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { DbxAppAuthEffects } from './state/effect/auth.effect';\n\n/**\n * Creates Angular `EnvironmentProviders` that register the NgRx auth feature state and effects.\n *\n * This provisions the `fromDbxAppAuth` feature reducer and the {@link DbxAppAuthEffects} effects class,\n * which together manage the auth user state (identifier, roles, onboarding status) in the NgRx store.\n *\n * Typically called internally by {@link provideDbxAppAuth}, but can be used independently\n * if only the state management (without router integration) is needed.\n *\n * @returns Angular `EnvironmentProviders` for the auth state feature.\n *\n * @see {@link DbxAppAuthEffects}\n * @see {@link fromDbxAppAuth}\n */\nexport function provideDbxAppAuthState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppAuth.FEATURE_KEY, fromDbxAppAuth.reducers), provideEffects(DbxAppAuthEffects)]);\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { provideDbxAppAuthState } from './auth.state.providers';\nimport { provideDbxAppAuthRouter, type ProvideDbxAppAuthRouterConfig } from './router/auth.router.providers';\nimport { provideDbxAppAuthRouterState, type ProvideDbxAppAuthRouterStateConfig } from './router/state/auth.router.state.providers';\n\n/**\n * Combined configuration for provisioning all dbx-core authentication providers.\n *\n * Merges the configuration requirements from both the auth router and the auth router state\n * into a single interface, simplifying setup when all auth features are needed.\n *\n * @see {@link ProvideDbxAppAuthRouterConfig} for route configuration details.\n * @see {@link ProvideDbxAppAuthRouterStateConfig} for router state effect configuration details.\n *\n * @example\n * ```ts\n * const config: ProvideDbxAppAuthConfig = {\n * dbxAppAuthRoutes: myAuthRoutes,\n * activeRoutesToApplyEffects: ['root']\n * };\n * ```\n */\nexport interface ProvideDbxAppAuthConfig extends ProvideDbxAppAuthRouterConfig, ProvideDbxAppAuthRouterStateConfig {}\n\n/**\n * All-in-one provider function that registers the complete set of dbx-core auth providers.\n *\n * This is the recommended way to set up authentication in a dbx-core application. It provisions:\n * - The NgRx auth state and effects via {@link provideDbxAppAuthState}\n * - The auth router configuration via {@link provideDbxAppAuthRouter}\n * - The auth router state effects via {@link provideDbxAppAuthRouterState}\n *\n * @param config - Combined auth configuration including routes and active states for effects.\n * @returns Angular `EnvironmentProviders` to be included in the application's provider list.\n *\n * @example\n * ```ts\n * // In your app config or module:\n * provideDbxAppAuth({\n * dbxAppAuthRoutes: {\n * loginRef: '/login',\n * appRef: '/app'\n * },\n * activeRoutesToApplyEffects: ['root']\n * });\n * ```\n *\n * @see {@link provideDbxAppAuthState}\n * @see {@link provideDbxAppAuthRouter}\n * @see {@link provideDbxAppAuthRouterState}\n */\nexport function provideDbxAppAuth(config: ProvideDbxAppAuthConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes, activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [provideDbxAppAuthState(), provideDbxAppAuthRouter({ dbxAppAuthRoutes }), provideDbxAppAuthRouterState({ activeRoutesToApplyEffects })];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type AuthRole, type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAnyRoleFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural directive that conditionally renders its host element based on whether\n * the currently authenticated user possesses **at least one** of the specified auth roles.\n *\n * Similar to `*ngIf`, this directive shows or hides content reactively as the user's\n * roles change. It uses {@link DbxAuthService.authRoles$} to observe the current role set\n * and checks that at least one role in the target list is present.\n *\n * @example\n * ```html\n * <!-- Show if user has either 'admin' or 'moderator' role -->\n * <div *dbxAuthHasAnyRole=\"['admin', 'moderator']\">Privileged content</div>\n *\n * <!-- Show if user has the 'viewer' role -->\n * <div *dbxAuthHasAnyRole=\"'viewer'\">Viewer content</div>\n * ```\n *\n * @see {@link DbxAuthHasRolesDirective} for requiring **all** specified roles.\n * @see {@link DbxAuthNotAnyRoleDirective} for excluding users with specified roles.\n */\n@Directive({\n selector: '[dbxAuthHasAnyRole]',\n standalone: true\n})\nexport class DbxAuthHasAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));\n}\n","import { type Maybe, type AuthRole, type ArrayOrValue } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAllRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural directive that conditionally renders its host element based on whether\n * the currently authenticated user possesses **all** of the specified auth roles.\n *\n * Similar to `*ngIf`, this directive shows or hides content reactively as the user's\n * roles change. It uses {@link DbxAuthService.authRoles$} to observe the current role set\n * and checks that every role in the target list is present.\n *\n * @example\n * ```html\n * <!-- Show only if user has the 'admin' role -->\n * <div *dbxAuthHasRoles=\"'admin'\">Admin-only content</div>\n *\n * <!-- Show only if user has BOTH 'editor' and 'reviewer' roles -->\n * <div *dbxAuthHasRoles=\"['editor', 'reviewer']\">Editor and reviewer content</div>\n * ```\n *\n * @see {@link DbxAuthHasAnyRoleDirective} for matching **any** of the specified roles.\n * @see {@link DbxAuthNotAnyRoleDirective} for excluding users with specified roles.\n */\n@Directive({\n selector: '[dbxAuthHasRoles]',\n standalone: true\n})\nexport class DbxAuthHasRolesDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasRoles' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));\n}\n","import { type Maybe, type AuthRole, type ArrayOrValue } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsNoRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural directive that conditionally renders its host element based on whether\n * the currently authenticated user possesses **none** of the specified auth roles.\n *\n * This is the inverse of {@link DbxAuthHasAnyRoleDirective}. Content is shown only when\n * the user does not have any of the listed roles. Useful for hiding content from\n * privileged users or showing fallback UI for unprivileged users.\n *\n * @example\n * ```html\n * <!-- Show only if user does NOT have the 'admin' role -->\n * <div *dbxAuthNotAnyRole=\"'admin'\">Non-admin content</div>\n *\n * <!-- Show only if user has NEITHER 'banned' nor 'suspended' role -->\n * <div *dbxAuthNotAnyRole=\"['banned', 'suspended']\">Active user content</div>\n * ```\n *\n * @see {@link DbxAuthHasRolesDirective} for requiring **all** specified roles.\n * @see {@link DbxAuthHasAnyRoleDirective} for requiring **any** of the specified roles.\n */\n@Directive({\n selector: '[dbxAuthNotAnyRole]',\n standalone: true\n})\nexport class DbxAuthNotAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthNotAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsNoRolesFrom(this.targetRoles$));\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { type DbxAppAuthFullState } from './state/state';\n\n/**\n * Angular service that provides access to the current auth user state from the NgRx store.\n *\n * This service acts as a convenience wrapper around the NgRx store, exposing a selector\n * for the {@link DbxAppAuthStateUser} slice of the auth feature state. It is provided\n * at the root level and can be injected anywhere authentication state is needed.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private readonly authStateService = inject(DbxAppAuthStateService);\n *\n * readonly user$ = this.authStateService.authStateUser$;\n * }\n * ```\n *\n * @see {@link DbxAppAuthFullState}\n * @see {@link fromDbxAppAuth.selectDbxAppAuthUser}\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthStateService {\n /**\n * NgRx store instance typed to the full auth state.\n */\n readonly store = inject(Store<DbxAppAuthFullState>);\n\n /**\n * Observable of the current {@link DbxAppAuthStateUser} from the NgRx store.\n */\n readonly authStateUser$ = this.store.select(fromDbxAppAuth.selectDbxAppAuthUser);\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type DbxActionWorkProgress, type DbxActionWorkOrWorkProgress } from '../action/action';\n\n/**\n * Progress value for a button's working state, expressed as a percentage (0-100).\n */\nexport type DbxButtonWorkingProgress = DbxActionWorkProgress;\n\n/**\n * Working state for a button. When `true`, indicates indeterminate progress.\n * When a number, indicates determinate progress as a percentage (0-100).\n * When `false` or `undefined`, the button is not in a working state.\n */\nexport type DbxButtonWorking = DbxActionWorkOrWorkProgress;\n\n/**\n * Intercepts button click events to conditionally allow or prevent the click from propagating.\n *\n * Useful for adding confirmation dialogs, permission checks, or other pre-click validation.\n *\n * @example\n * ```typescript\n * const confirmInterceptor: DbxButtonInterceptor = {\n * interceptButtonClick: () => {\n * return from(window.confirm('Are you sure?')).pipe(map(Boolean));\n * },\n * };\n * ```\n */\nexport interface DbxButtonInterceptor {\n /**\n * Handles a button click event. Returns an observable that will say whether or not to continue the click event.\n */\n interceptButtonClick: () => Observable<boolean>;\n}\n\n/**\n * Display configuration for a button, including optional icon and text.\n *\n * @example\n * ```typescript\n * const display: DbxButtonDisplay = { icon: 'save', text: 'Save Changes' };\n * ```\n */\nexport interface DbxButtonDisplay {\n /**\n * button Icon, if applicable\n */\n readonly icon?: Maybe<string>;\n /**\n * button text, if applicable\n */\n readonly text?: Maybe<string>;\n}\n\n/**\n * Abstract base class defining the reactive interface for a button component.\n *\n * Provides observable streams for disabled state, working state, click events,\n * and display content. Implementations are provided via DI using {@link provideDbxButton}.\n *\n * @see {@link AbstractDbxButtonDirective} for the default implementation.\n * @see {@link DbxButtonDirective} for the concrete directive.\n */\nexport abstract class DbxButton {\n /**\n * Observable of the disabled state of the button.\n */\n abstract readonly disabled$: Observable<boolean>;\n /**\n * Observable of the working state of the button.\n */\n abstract readonly working$: Observable<DbxButtonWorking>;\n /**\n * Observable of the clicked event of the button.\n */\n abstract readonly clicked$: Observable<unknown>;\n /**\n * Observable of the display content of the button.\n */\n abstract readonly display$: Observable<DbxButtonDisplay>;\n /**\n * Sets the disabled state of the button. If null/undefined the button will be disabled.\n *\n * @param disabled\n */\n abstract setDisabled(disabled?: Maybe<boolean>): void;\n /**\n * Sets the working state of the button.\n *\n * If a number is passed, then it is treated as a progress percentage.\n *\n * If true is passed, then it is treated as an indeterminate progress.\n *\n * If null/undefined is passed, then the button will not be working.\n */\n abstract setWorking(working?: Maybe<DbxButtonWorking>): void;\n /**\n * Sets the display content of the button.\n *\n * @param content\n */\n abstract setDisplayContent(content: DbxButtonDisplay): void;\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n *\n * @param interceptor\n */\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n /**\n * Main function to use for handling clicks on the button.\n */\n abstract clickButton(): void;\n}\n\n/**\n * Creates Angular providers that register a {@link DbxButton} implementation for DI.\n *\n * @param sourceType - The concrete button directive or component class to provide.\n * @returns An array of Angular providers for the button.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myCustomButton]',\n * providers: provideDbxButton(MyCustomButtonDirective),\n * })\n * export class MyCustomButtonDirective extends AbstractDbxButtonDirective {}\n * ```\n */\nexport function provideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n// MARK: Display\n/**\n * The display type of a button.\n *\n * text_button: A text button has text or is empty.\n * icon_button: An icon button only has an icon and no text.\n */\nexport type DbxButtonDisplayType = 'text_button' | 'icon_button';\n\n/**\n * Delegate for computing a {@link DbxButtonDisplay} from a given value.\n *\n * Useful for dynamically updating button appearance based on data state.\n *\n * @typeParam T - The type of value used to derive the display configuration.\n */\nexport interface DbxButtonDisplayDelegate<T> {\n /**\n * Returns the DbxButtonDisplay for the input value.\n *\n * @param value\n */\n buttonDisplayContentForValue(value: T): DbxButtonDisplay;\n}\n\n/**\n * Determines whether a button display is an icon-only button or a text button.\n *\n * @param content - The button display configuration to evaluate.\n * @returns `'icon_button'` if only an icon is set, otherwise `'text_button'`.\n *\n * @example\n * ```typescript\n * dbxButtonDisplayType({ icon: 'edit' }); // 'icon_button'\n * dbxButtonDisplayType({ icon: 'save', text: 'Save' }); // 'text_button'\n * ```\n */\nexport function dbxButtonDisplayType(content: DbxButtonDisplay): DbxButtonDisplayType {\n return !content.text && content.icon ? 'icon_button' : 'text_button';\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Links a {@link DbxButton} click to an action context trigger, without synchronizing\n * disabled or working states. Use {@link DbxActionButtonDirective} for full state binding.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <button dbxButton dbxActionButtonTrigger>Trigger Only</button>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]',\n standalone: true\n})\nexport class DbxActionButtonTriggerDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly source = inject(DbxActionContextStoreSourceInstance);\n\n constructor() {\n cleanSubscription(\n this.dbxButton.clicked$.subscribe(() => {\n this._buttonClicked();\n })\n );\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n}\n","import { Directive } from '@angular/core';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { cleanSubscription } from '../../rxjs/subscription';\n\n/**\n * Links a {@link DbxButton} to an action context, synchronizing the button's\n * disabled and working states with the action's lifecycle and forwarding\n * button clicks as action triggers.\n *\n * Extends {@link DbxActionButtonTriggerDirective} by also binding working/disabled state.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <button dbxButton dbxActionButton [text]=\"'Submit'\">Submit</button>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxActionButton]',\n standalone: true\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {\n constructor() {\n super();\n\n cleanSubscription(\n this.source.isWorkingOrWorkProgress$.subscribe((working) => {\n this.dbxButton.setWorking(working);\n })\n );\n\n cleanSubscription(\n this.source.isDisabled$.subscribe((disabled) => {\n this.dbxButton.setDisabled(disabled);\n })\n );\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { type SegueRef } from '../../router/segue';\n\n// MARK: Button Directives\n/**\n * Navigates to a route when the host {@link DbxButton} is clicked, using the provided {@link SegueRef}.\n *\n * @example\n * ```html\n * <button dbxButton [dbxButtonSegue]=\"{ ref: '/dashboard' }\">Go to Dashboard</button>\n * ```\n *\n * @example\n * ```typescript\n * readonly segue: SegueRef = { ref: '/settings', refType: 'url' };\n * ```\n *\n * ```html\n * <button dbxButton [dbxButtonSegue]=\"segue\">Settings</button>\n * ```\n */\n@Directive({\n selector: '[dbxButtonSegue]',\n standalone: true\n})\nexport class DbxButtonSegueDirective {\n readonly dbxButton = inject(DbxButton);\n readonly dbxRouterService = inject(DbxRouterService);\n\n readonly segueRef = input<Maybe<SegueRef>>(undefined, { alias: 'dbxButtonSegue' });\n\n constructor() {\n cleanSubscription(() =>\n this.dbxButton.clicked$.subscribe(() => {\n const segueRef = this.segueRef();\n\n if (segueRef) {\n void this.dbxRouterService.go(segueRef);\n }\n })\n );\n }\n}\n","import { Directive, type Signal, computed, input, output, signal } from '@angular/core';\nimport { isDefinedAndNotFalse, type Maybe } from '@dereekb/util';\nimport { of, Subject, filter, first, switchMap, BehaviorSubject } from 'rxjs';\nimport { cleanSubscription, completeOnDestroy } from '../rxjs';\nimport { type DbxButton, type DbxButtonDisplay, type DbxButtonDisplayType, dbxButtonDisplayType, type DbxButtonInterceptor, type DbxButtonWorking, provideDbxButton } from './button';\nimport { outputToObservable, toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract base directive implementing the {@link DbxButton} interface with signal-based state management.\n *\n * Manages disabled state, working/progress state, display content (icon/text),\n * and button click interception. Subclass this to create custom button directives.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myButton]',\n * providers: provideDbxButton(MyButtonDirective),\n * })\n * export class MyButtonDirective extends AbstractDbxButtonDirective {}\n * ```\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective implements DbxButton {\n /**\n * Pre-interceptor button click.\n */\n protected readonly _buttonClick = completeOnDestroy(new Subject<void>());\n protected readonly _buttonInterceptor = completeOnDestroy(new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined));\n\n readonly buttonClick = output();\n\n readonly disabled = input<boolean, Maybe<boolean>>(false, { transform: Boolean });\n readonly working = input<DbxButtonWorking, Maybe<DbxButtonWorking>>(false, { transform: (x) => (x == null ? false : x) });\n readonly buttonDisplay = input<Maybe<DbxButtonDisplay>>(undefined);\n\n private readonly _disabledSignal = signal<Maybe<boolean>>(undefined);\n private readonly _workingSignal = signal<Maybe<DbxButtonWorking>>(undefined);\n private readonly _buttonDisplayContentSignal = signal<Maybe<DbxButtonDisplay>>(undefined);\n\n readonly disabledSignal = computed(() => this._disabledSignal() ?? this.disabled());\n readonly workingSignal = computed(() => this._workingSignal() ?? this.working());\n\n readonly isWorkingSignal = computed(() => {\n const working = this.workingSignal();\n return isDefinedAndNotFalse(working);\n });\n\n readonly icon = input<Maybe<string>>();\n readonly text = input<Maybe<string>>();\n\n readonly buttonDisplayContentSignal: Signal<DbxButtonDisplay> = computed(() => {\n const icon = this.icon();\n const text = this.text();\n const buttonDisplay = this.buttonDisplay();\n\n const buttonDisplayContent = this._buttonDisplayContentSignal() ?? buttonDisplay;\n return { icon: icon || buttonDisplayContent?.icon, text: text || buttonDisplayContent?.text };\n });\n\n readonly buttonDisplayTypeSignal: Signal<DbxButtonDisplayType> = computed(() => {\n return dbxButtonDisplayType(this.buttonDisplayContentSignal());\n });\n\n readonly iconSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.icon);\n readonly textSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.text);\n\n readonly disabled$ = toObservable(this.disabledSignal);\n readonly working$ = toObservable(this.workingSignal);\n readonly display$ = toObservable(this.buttonDisplayContentSignal);\n readonly clicked$ = outputToObservable(this.buttonClick);\n\n constructor() {\n cleanSubscription(\n this._buttonClick\n .pipe(\n switchMap(() =>\n this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(first());\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n )\n )\n )\n .subscribe(() => {\n this._forceButtonClicked();\n })\n );\n }\n\n setDisabled(disabled?: Maybe<boolean>): void {\n this._disabledSignal.set(disabled);\n }\n\n setWorking(working?: Maybe<DbxButtonWorking>): void {\n this._workingSignal.set(working);\n }\n\n setDisplayContent(content: DbxButtonDisplay): void {\n this._buttonDisplayContentSignal.set(content);\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n *\n * @param interceptor - The interceptor to set on the button.\n */\n public setButtonInterceptor(interceptor: DbxButtonInterceptor): void {\n this._buttonInterceptor.next(interceptor);\n }\n\n /**\n * Main function to use for handling clicks on the button.\n */\n public clickButton(): void {\n if (!this.disabled()) {\n this._buttonClick.next();\n }\n }\n\n /**\n * Forces a button click. Skips the interceptors if any are configured.\n */\n protected _forceButtonClicked(): void {\n this.buttonClick.emit();\n }\n}\n\n// MARK: Implementation\n/**\n * Concrete button directive that provides a {@link DbxButton} instance via DI.\n *\n * Apply to any element to make it a managed button with reactive disabled,\n * working, and display state.\n *\n * @example\n * ```html\n * <button dbxButton [icon]=\"'save'\" [text]=\"'Save'\" [disabled]=\"isSaving\">\n * Save\n * </button>\n * ```\n *\n * @example\n * ```html\n * <!-- Access the button instance via template reference: -->\n * <button dbxButton #btn=\"dbxButton\" (click)=\"btn.clickButton()\">Submit</button>\n * ```\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: provideDbxButton(DbxButtonDirective),\n standalone: true\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective {}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { type LoadingContext, type MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { DbxButton } from './button';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { distinctUntilChanged, shareReplay, type Subscription } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Links a {@link DbxButton} to a {@link LoadingContext}, automatically setting the button\n * to a working state whenever the loading context is actively loading.\n *\n * @example\n * ```html\n * <button dbxButton [dbxLoadingButton]=\"loadingContext\">\n * Loading...\n * </button>\n * ```\n *\n * @example\n * ```typescript\n * readonly loadingContext = cleanLoadingContext<MyData>(this.data$);\n * ```\n */\n@Directive({\n selector: '[dbxLoadingButton]',\n standalone: true\n})\nexport class DbxLoadingButtonDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly context = input.required<MaybeObservableOrValue<LoadingContext>>({ alias: 'dbxLoadingButton' });\n readonly context$ = toObservable(this.context).pipe(maybeValueFromObservableOrValue(), distinctUntilChanged(), shareReplay(1));\n readonly contextSignal = toSignal(this.context$);\n\n protected readonly _loadingEffectSub = cleanSubscription();\n protected readonly _loadingEffect = effect(() => {\n const context = this.contextSignal();\n let subscription: Subscription | undefined;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => this.dbxButton.setWorking(x.loading));\n }\n\n this._loadingEffectSub.setSub(subscription);\n });\n}\n","import { NgModule } from '@angular/core';\nimport { DbxActionButtonTriggerDirective, DbxActionButtonDirective } from './action';\nimport { DbxButtonDirective } from './button.directive';\nimport { DbxLoadingButtonDirective } from './button.loading.directive';\nimport { DbxButtonSegueDirective } from './router/button.segue.directive';\n\nconst importsAndExports = [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective];\n\n/**\n * Exports the following directives:\n * - DbxButtonDirective\n * - DbxLoadingButtonDirective\n * - DbxActionButtonTriggerDirective\n * - DbxActionButtonDirective\n * - DbxButtonSegueDirective\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreButtonModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { type DbxAppContextState } from './context';\nimport { onDbxAppContext, fromDbxAppContext } from './state';\nimport { type DbxAppContextFullState } from './state/state';\n\n/**\n * Service for dispatching and selecting the application's {@link DbxAppContextState} from the NgRx store.\n *\n * Provided at the root level. Use to transition between app-level context states\n * (e.g., public, auth, onboard, app).\n *\n * @example\n * ```typescript\n * @Component({ ... })\n * export class AppComponent {\n * private readonly contextService = inject(DbxAppContextService);\n *\n * onLogin(): void {\n * this.contextService.setState('app');\n * }\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppContextService {\n readonly store = inject(Store<DbxAppContextFullState>);\n readonly state$ = this.store.select(fromDbxAppContext.selectDbxAppContextState);\n\n setState(state: DbxAppContextState) {\n this.store.dispatch(onDbxAppContext.DbxAppContextActions.setState({ state }));\n }\n\n resetState() {\n this.store.next(onDbxAppContext.DbxAppContextActions.resetState());\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxAppContextService } from './context.service';\nimport { type DbxAppContextState } from './context';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Sets the application's {@link DbxAppContextState} when the input value changes.\n *\n * Dispatches to the NgRx store via {@link DbxAppContextService}. Commonly placed\n * on route-level components to declare which context the route belongs to.\n *\n * @example\n * ```html\n * <div [dbxAppContextState]=\"'app'\">\n * <!-- App-level content rendered when context is 'app' -->\n * </div>\n * ```\n *\n * @example\n * ```html\n * <router-outlet dbxAppContextState=\"public\"></router-outlet>\n * ```\n */\n@Directive({\n selector: '[dbxAppContextState]',\n standalone: true\n})\nexport class DbxAppContextStateDirective {\n readonly dbxAppContextStateService = inject(DbxAppContextService);\n\n readonly state = input<Maybe<DbxAppContextState>>(undefined, { alias: 'dbxAppContextState' });\n\n protected readonly _stateEffect = effect(() => {\n const state = this.state();\n\n if (state != null) {\n this.dbxAppContextStateService.setState(state);\n }\n });\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppContext } from './state';\n\n/**\n * Creates EnvironmentProviders for providing the DbxAppContext state.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppContextState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppContext.FEATURE_KEY, fromDbxAppContext.reducers)]);\n}\n","/**\n * Abstract token class representing the application's runtime environment configuration.\n *\n * Provided via DI using {@link provideDbxAppEnviroment} and accessed through {@link DbxAppEnviromentService}.\n * Subclass or provide a concrete instance to define environment-specific flags.\n *\n * @example\n * ```typescript\n * const env: DbxAppEnviroment = {\n * production: false,\n * testing: true,\n * };\n *\n * // In app config:\n * provideDbxAppEnviroment(env);\n * ```\n */\nexport abstract class DbxAppEnviroment {\n /**\n * Whether or not this is a production environment.\n */\n abstract production: boolean;\n /**\n * Whether or not this is a testing environment.\n *\n * Generally \"production\" is false when this is true.\n */\n abstract testing?: boolean;\n /**\n * Whether or not this is a staging environment.\n *\n * Generally \"production\" is true when this is true.\n */\n abstract staging?: boolean;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\n\n/**\n * Injectable service providing convenience accessors for the application's {@link DbxAppEnviroment}.\n *\n * Exposes computed properties for common environment checks (production, staging, testing)\n * and a typed getter for accessing custom environment properties.\n *\n * @example\n * ```typescript\n * @Component({ ... })\n * export class MyComponent {\n * private readonly envService = inject(DbxAppEnviromentService);\n *\n * get showDebugPanel(): boolean {\n * return !this.envService.isProduction;\n * }\n * }\n * ```\n */\n@Injectable()\nexport class DbxAppEnviromentService {\n readonly environment = inject(DbxAppEnviroment);\n\n get isProduction() {\n return this.environment.production === true;\n }\n\n get isStaging() {\n return this.environment.staging ?? false;\n }\n\n get isTesting() {\n return this.environment.testing ?? !this.environment.production;\n }\n\n /**\n * Returns the environment, typed as a specific type.\n *\n * @returns The environment cast to the specified type.\n */\n getEnvironment<T extends DbxAppEnviroment>(): T {\n return this.environment as T;\n }\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\nimport { DbxAppEnviromentService } from './environment.service';\n\n/**\n * Registers {@link DbxAppEnviroment} and {@link DbxAppEnviromentService} as environment-level providers.\n *\n * @param environment - The concrete environment configuration to provide.\n * @returns The environment providers for the application environment.\n *\n * @example\n * ```typescript\n * // In app.config.ts:\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAppEnviroment({ production: true, staging: false }),\n * ],\n * };\n * ```\n */\nexport function provideDbxAppEnviroment(environment: DbxAppEnviroment): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: DbxAppEnviroment,\n useValue: environment\n },\n DbxAppEnviromentService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MousableFunction } from './mousable';\nimport { type ClickableFunction, type ClickableUrl } from './clickable';\nimport { type SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, type ExpandTreeFunction, type FlattenTreeFunction, flattenTreeToArrayFunction, type Maybe, type TreeNode } from '@dereekb/util';\nimport { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Observable } from 'rxjs';\nimport { type DbxInjectionComponentConfig } from '../../injection/injection';\n\n/**\n * Represents a clickable anchor element that combines click handling, mouse event handling, URL linking, and segue-based routing.\n *\n * This is the foundational anchor interface used across the application for navigation elements such as links, buttons, and menu items.\n *\n * @example\n * ```ts\n * const anchor: ClickableAnchor = {\n * ref: 'app.dashboard',\n * onClick: () => console.log('clicked'),\n * disabled: false,\n * selected: true\n * };\n * ```\n *\n * @see {@link ClickableFunction} for click handling\n * @see {@link MousableFunction} for mouse event handling\n * @see {@link ClickableUrl} for external URL configuration\n * @see {@link SegueRef} for router navigation references\n */\nexport interface ClickableAnchor extends ClickableFunction, MousableFunction, ClickableUrl, Partial<SegueRef> {\n /**\n * Whether this anchor is disabled and should not be interactive.\n */\n readonly disabled?: boolean;\n /**\n * Whether this anchor is currently in a selected/active state.\n */\n readonly selected?: boolean;\n}\n\n/**\n * Title and an optional icon.\n */\nexport interface IconAndTitle {\n readonly title: string;\n readonly icon?: Maybe<string>;\n}\n\n/**\n * A clickable anchor with a title, optional icon, hint text, and custom injection content.\n *\n * Used to represent navigation links in menus, sidebars, and other navigable UI components.\n *\n * @example\n * ```ts\n * const link: ClickableAnchorLink = {\n * title: 'Dashboard',\n * icon: 'dashboard',\n * hint: 'View your main dashboard',\n * ref: 'app.dashboard'\n * };\n * ```\n *\n * @see {@link ClickableAnchor} for the base anchor interface\n * @see {@link IconAndTitle} for the title and icon properties\n */\nexport interface ClickableAnchorLink extends ClickableAnchor, IconAndTitle {\n /**\n * Optional detail string/content.\n */\n readonly hint?: string;\n /**\n * Custom injection content for this link.\n */\n readonly content?: DbxInjectionComponentConfig;\n}\n\n/**\n * ClickableAnchorLink that definitely has a SegueRef\n */\n/**\n * A {@link ClickableAnchorLink} that is guaranteed to have a {@link SegueRef}, ensuring it represents a navigable router link.\n *\n * @see {@link ClickableAnchorLink}\n * @see {@link SegueRef}\n */\nexport type ClickableAnchorLinkSegueRef = ClickableAnchorLink & SegueRef;\n\n/**\n * A clickable anchor link where the icon is required but the title is omitted.\n *\n * Useful for icon-only navigation elements such as toolbar buttons.\n *\n * @see {@link ClickableAnchorLink}\n */\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n /**\n * The icon identifier (e.g., Material icon name).\n */\n readonly icon: string;\n}\n\n/**\n * A hierarchical tree structure of {@link ClickableAnchorLink} nodes, where each node can have child links.\n *\n * Used to represent nested navigation structures such as sidebar menus with sub-items.\n *\n * @example\n * ```ts\n * const tree: ClickableAnchorLinkTree = {\n * title: 'Settings',\n * icon: 'settings',\n * ref: 'app.settings',\n * children: [\n * { title: 'Profile', ref: 'app.settings.profile' },\n * { title: 'Security', ref: 'app.settings.security' }\n * ]\n * };\n * ```\n *\n * @see {@link ClickableAnchorLink}\n * @see {@link expandClickableAnchorLinkTree} for flattening trees\n */\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n /**\n * Optional child links forming a nested navigation tree.\n */\n readonly children?: ClickableAnchorLinkTree[];\n}\n\n/**\n * A tree node wrapping a {@link ClickableAnchorLinkTree} value, produced by expanding the tree structure.\n *\n * @see {@link expandClickableAnchorLinkTreeNode}\n * @see {@link TreeNode}\n */\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\n/**\n * Function that expands a single {@link ClickableAnchorLinkTree} node into a tree of {@link ExpandedClickableAnchorLinkTree} nodes.\n *\n * @see {@link expandClickableAnchorLinkTree} for the full expand-and-flatten operation\n */\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\n/**\n * Flattens an expanded tree of {@link ExpandedClickableAnchorLinkTree} nodes into a flat array, preserving the tree node wrappers.\n */\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\n\n/**\n * Flattens an expanded tree of {@link ExpandedClickableAnchorLinkTree} nodes into a flat array of the underlying {@link ClickableAnchorLinkTree} values.\n */\nexport const flattenExpandedClickableAnchorLinkTreeToLinks: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ClickableAnchorLinkTree> = flattenTreeToArrayFunction((x) => x.value);\n\n/**\n * Fully expands the given parent link and flattens the tree to a single parent link.\n *\n * @param link\n * @returns\n */\nexport function expandClickableAnchorLinkTree(link: ClickableAnchorLinkTree): ExpandedClickableAnchorLinkTree[] {\n return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));\n}\n\n/**\n * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.\n */\nexport const expandClickableAnchorLinkTrees = expandFlattenTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree>(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);\n\n/**\n * Describes the Anchor type given a ClickableAnchor.\n *\n * - plain: When the anchor has no specific content but is not disabled. It is a passthrough for the content.\n * - clickable: When the anchor has a click handler\n * - sref: When the anchor has a SegueRef\n * - href: When the anchor has a URL\n * - disabled: When the anchor is disabled.\n */\nexport type ClickableAnchorType = 'plain' | 'clickable' | 'sref' | 'href' | 'disabled';\n\n/**\n * Determines the {@link ClickableAnchorType} for a given anchor based on its properties.\n *\n * Priority order: disabled > sref (router link) > clickable (onClick handler) > href (external URL) > plain.\n *\n * @param anchor - The anchor to evaluate.\n * @param disabled - An optional external disabled override; if `true`, the anchor type will be `'disabled'` regardless of the anchor's own state.\n * @returns The determined {@link ClickableAnchorType}.\n */\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): ClickableAnchorType {\n let type: ClickableAnchorType = 'disabled';\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = 'disabled';\n } else if (anchor.ref) {\n type = 'sref';\n } else if (anchor.onClick) {\n type = 'clickable';\n } else if (anchor.url) {\n type = 'href';\n } else {\n type = 'plain';\n }\n }\n\n return type;\n}\n\n/**\n * Abstract base class representing a reactive anchor element that exposes its state as observables.\n *\n * Subclasses provide concrete implementations that manage the anchor's disabled, selected, and type states.\n *\n * @typeParam T - The specific anchor type, defaulting to {@link ClickableAnchor}.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * class MyAnchorComponent extends DbxAnchor {\n * readonly disabled$ = of(false);\n * readonly selected$ = of(true);\n * readonly anchor$ = of({ ref: 'app.home' });\n * readonly type$ = of('sref' as ClickableAnchorType);\n * }\n * ```\n *\n * @see {@link provideDbxAnchor} for configuring DI providers\n * @see {@link AbstractDbxAnchorDirective} for the directive-based implementation\n */\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract readonly disabled$: Observable<Maybe<boolean>>;\n abstract readonly selected$: Observable<Maybe<boolean>>;\n abstract readonly anchor$: Observable<Maybe<T>>;\n abstract readonly type$: Observable<ClickableAnchorType>;\n}\n\n/**\n * Creates Angular DI providers that register the given source type as a {@link DbxAnchor} provider using `forwardRef`.\n *\n * @typeParam S - The concrete {@link DbxAnchor} subclass to provide.\n * @param sourceType - The class type to register as the anchor provider.\n * @returns An array of Angular providers.\n *\n * @example\n * ```ts\n * @Directive({\n * selector: '[myAnchor]',\n * providers: provideDbxAnchor(MyAnchorDirective)\n * })\n * class MyAnchorDirective extends DbxAnchor { ... }\n * ```\n */\nexport function provideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { type Observable } from 'rxjs';\nimport { computed, Directive, model } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type ClickableAnchorType, type ClickableAnchor, anchorTypeForAnchor, type DbxAnchor } from './anchor';\nimport { type SegueRefOrSegueRefRouterLink, asSegueRef } from '../segue';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract base directive for managing anchor state using Angular signals and model inputs.\n *\n * Provides reactive computed properties for the resolved anchor, its disabled/selected state, and its type.\n * Subclasses can extend this to implement framework-specific anchor rendering (e.g., UIRouter or Angular Router).\n *\n * @typeParam T - The specific anchor type, defaulting to {@link ClickableAnchor}.\n *\n * @example\n * ```html\n * <!-- Usage in a template via a concrete subclass -->\n * <my-anchor [ref]=\"'/app/dashboard'\" [disabled]=\"isDisabled\">\n * Dashboard\n * </my-anchor>\n * ```\n *\n * @example\n * ```ts\n * // Programmatic usage\n * directive.setRef('app.dashboard');\n * directive.setDisabled(true);\n * ```\n *\n * @see {@link DbxAnchor} for the abstract base class this implements\n * @see {@link anchorTypeForAnchor} for anchor type resolution logic\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor {\n /**\n * Model input for the segue ref or router link to navigate to.\n */\n readonly ref = model<Maybe<SegueRefOrSegueRefRouterLink>>();\n\n /**\n * Model input for the full anchor configuration object.\n */\n readonly anchor = model<Maybe<T>>();\n /**\n * Model input for externally controlling the disabled state.\n */\n readonly disabled = model<Maybe<boolean>>();\n /**\n * Model input for externally controlling the selected state.\n */\n readonly selected = model<Maybe<boolean>>();\n\n /**\n * Computed anchor that merges the `ref` input with the `anchor` input, preferring `ref` when set.\n */\n readonly anchorSignal = computed(() => {\n const ref = this.ref();\n const anchor = this.anchor();\n\n let result: Maybe<T> = anchor;\n\n if (ref != null) {\n result = asSegueRef(ref) as T;\n }\n\n return result;\n });\n\n /**\n * Computed selected state that combines the `selected` input with the anchor's own `selected` property.\n */\n readonly selectedSignal = computed(() => {\n const selected = this.selected();\n const anchor = this.anchorSignal();\n\n return selected || anchor?.selected;\n });\n\n /**\n * Computed {@link ClickableAnchorType} derived from the current anchor and disabled state.\n */\n readonly typeSignal = computed(() => {\n const anchor = this.anchorSignal();\n const disabled = this.disabled();\n return anchorTypeForAnchor(anchor, disabled);\n });\n\n /**\n * Computed disabled state that combines the `disabled` input with the anchor's own `disabled` property.\n */\n readonly disabledSignal = computed(() => {\n const disabled = this.disabled();\n const anchor = this.anchorSignal();\n\n return disabled || anchor?.disabled;\n });\n\n /**\n * Computed URL extracted from the current anchor's `url` property.\n */\n readonly urlSignal = computed(() => this.anchorSignal()?.url);\n /**\n * Computed target (e.g., `_blank`) extracted from the current anchor's `target` property.\n */\n readonly targetSignal = computed(() => this.anchorSignal()?.target);\n\n readonly anchor$: Observable<Maybe<T>> = toObservable(this.anchorSignal);\n readonly disabled$: Observable<Maybe<boolean>> = toObservable(this.disabledSignal);\n readonly selected$: Observable<Maybe<boolean>> = toObservable(this.selectedSignal);\n readonly type$: Observable<ClickableAnchorType> = toObservable(this.typeSignal);\n\n // MARK: Accessors\n /**\n * Sets the segue ref or router link for this anchor.\n *\n * @param ref - The segue ref or router link to set.\n */\n setRef(ref: Maybe<SegueRefOrSegueRefRouterLink>) {\n this.ref.set(ref);\n }\n\n /**\n * Sets the full anchor configuration object.\n *\n * @param anchor - The anchor configuration to set.\n */\n setAnchor(anchor: Maybe<T>) {\n this.anchor.set(anchor);\n }\n\n /**\n * Sets the external disabled state override.\n *\n * @param disabled - Whether the anchor should be disabled.\n */\n setDisabled(disabled: Maybe<boolean>) {\n this.disabled.set(disabled);\n }\n\n /**\n * Sets the external selected state override.\n *\n * @param selected - Whether the anchor should be selected.\n */\n setSelected(selected: Maybe<boolean>) {\n this.selected.set(selected);\n }\n}\n","import { type E164PhoneNumberWithOptionalExtension, type MailToUrlInput, mailToUrlString, type Maybe, type PhoneNumber, telUrlString, type WebsiteUrl } from '@dereekb/util';\n\n/**\n * Interface for elements that support a click handler callback.\n *\n * @example\n * ```ts\n * const clickable: ClickableFunction = {\n * onClick: (event) => console.log('Element clicked', event)\n * };\n * ```\n */\nexport interface ClickableFunction {\n /**\n * Optional click handler invoked when the element is clicked.\n */\n readonly onClick?: (event?: Maybe<MouseEvent>) => void;\n}\n\n/**\n * Represents a clickable href/url configuration.\n */\nexport interface ClickableUrl {\n /**\n * href url\n */\n readonly url?: string;\n /**\n * href target attribute.\n */\n readonly target?: string;\n}\n\n/**\n * Creates a {@link ClickableUrl} configured to open the given URL in a new browser tab (`target=\"_blank\"`).\n *\n * @param url - The URL to open.\n * @returns A {@link ClickableUrl} with the `target` set to `'_blank'`.\n */\nexport function clickableUrlInNewTab(url: string | WebsiteUrl): ClickableUrl {\n return {\n url,\n target: '_blank'\n };\n}\n\n/**\n * Creates a {@link ClickableUrl} with a `mailto:` URL from the given email configuration.\n *\n * @param mailTo - The mail-to configuration (email address, subject, body, etc.).\n * @returns A {@link ClickableUrl} with the URL set to a `mailto:` link.\n *\n * @see {@link mailToUrlString}\n */\nexport function clickableUrlMailTo(mailTo: MailToUrlInput): ClickableUrl {\n return {\n url: mailToUrlString(mailTo)\n };\n}\n\n/**\n * Creates a {@link ClickableUrl} with a `tel:` URL from the given phone number.\n *\n * @param tel - The phone number to create a tel link for.\n * @returns A {@link ClickableUrl} with the URL set to a `tel:` link.\n *\n * @see {@link telUrlString}\n */\nexport function clickableUrlTel(tel: PhoneNumber | E164PhoneNumberWithOptionalExtension): ClickableUrl {\n return {\n url: telUrlString(tel)\n };\n}\n","import { DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookResult, type StateService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { map, first, switchMap, firstValueFrom, type Observable, of } from 'rxjs';\nimport { type Injector } from '@angular/core';\n\n/**\n * Default param value that indicates no specific identifier has been set, triggering a redirect to the default allowed identifier.\n */\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE = '0';\n\n/**\n * Default route parameter key used to read the model identifier from the URL.\n */\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY = 'id';\n\n/**\n * Configuration for the {@link redirectForIdentifierParamHook} function.\n *\n * Specifies how to read, validate, and redirect based on an identifier route parameter.\n * This is used with UIRouter's transition hooks to guard routes that require a valid model identifier.\n *\n * @example\n * ```ts\n * redirectForIdentifierParamHook({\n * criteria: 'app.profile',\n * transitionService,\n * idParam: 'id',\n * defaultAllowedValue: (authService) => authService.userIdentifier$,\n * canViewModelWithId: (targetId, authService) => of(true)\n * });\n * ```\n *\n * @see {@link redirectForIdentifierParamHook}\n * @see {@link RedirectForUserIdentifierParamHookInput} for a user-specific variant\n */\nexport interface RedirectForIdentifierParamHookInput {\n /**\n * Factory that returns an observable that sends the default allowed identifier to use when accessing the resource.\n */\n readonly defaultAllowedValue: (authService: DbxAuthService, injector: Injector, transition: Transition) => Observable<ModelKey>;\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly idParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target id.\n *\n * Can return another identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewModelWithId: (targetId: ModelKey, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | ModelKey>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * Registers a UIRouter transition hook that asserts the user is allowed to view a route with an identifier as a state parameter.\n *\n * When a transition occurs to the target route:\n * 1. If the identifier param is missing or equals the default placeholder value, it redirects to the default allowed identifier.\n * 2. If the identifier differs from the default, it calls `canViewModelWithId` to verify access.\n * 3. If access is denied, it redirects to the default allowed identifier.\n *\n * @param input - Configuration specifying the route criteria, param key, and access control logic.\n *\n * @see {@link RedirectForIdentifierParamHookInput}\n * @see {@link redirectForUserIdentifierParamHook} for a user-specific convenience wrapper\n */\nexport function redirectForIdentifierParamHook(input: RedirectForIdentifierParamHookInput): void {\n const { defaultAllowedValue, idParam = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE, priority = 100, transitionService, canViewModelWithId: canViewUser } = input;\n const criteria: HookMatchCriteria = typeof input.criteria === 'string' ? { entering: input.criteria } : input.criteria;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertAllowedId: TransitionHookFn = (transition: Transition): HookResult => {\n const $state: StateService = transition.router.stateService;\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const params = transition.params();\n\n const transitionTargetId: Maybe<string> = params[idParam];\n const defaultAllowedValueObs$ = defaultAllowedValue(authService, injector, transition);\n\n return firstValueFrom(\n defaultAllowedValueObs$.pipe(\n first(),\n switchMap((defaultAllowedIdValue) => {\n let result: Observable<HookResult> = of(true);\n\n let redirectToId: Maybe<Observable<Maybe<ModelKey>>>;\n\n if (!transitionTargetId || transitionTargetId === defaultParamValue) {\n // If the param isn't set, default to the default value\n redirectToId = of(defaultAllowedIdValue);\n } else if (defaultAllowedIdValue !== transitionTargetId) {\n redirectToId = canViewUser(transitionTargetId, authService, injector).pipe(\n map((x) => {\n if (x == null || typeof x === 'boolean') {\n return x ? transitionTargetId : defaultAllowedIdValue;\n } else {\n return x;\n }\n })\n );\n }\n\n if (redirectToId != null) {\n result = redirectToId.pipe(\n first(),\n map((targetId) => {\n if (targetId !== transitionTargetId) {\n const target = transition.targetState();\n const state = target.state();\n return $state.target(state, { ...params, [idParam]: targetId }, { location: true });\n } else {\n return true;\n }\n })\n );\n }\n\n return result;\n })\n )\n ) as HookResult;\n };\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(criteria, assertAllowedId, { priority });\n}\n","import { type AuthUserIdentifier } from '../../../auth/auth.user';\nimport { type DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type Injector } from '@angular/core';\nimport { redirectForIdentifierParamHook } from './id.hook';\n\n/**\n * Default param value that indicates no specific user identifier has been set, triggering a redirect to the authenticated user's identifier.\n */\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE = '0';\n\n/**\n * Default route parameter key used to read the user identifier from the URL.\n */\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY = 'uid';\n\n/**\n * Configuration for the {@link redirectForUserIdentifierParamHook} function.\n *\n * A specialized variant of {@link RedirectForIdentifierParamHookInput} that defaults to reading the authenticated\n * user's identifier from {@link DbxAuthService} and uses the `uid` route parameter.\n *\n * @example\n * ```ts\n * redirectForUserIdentifierParamHook({\n * criteria: 'app.user.profile',\n * transitionService,\n * canViewUser: (targetUid, authService) => of(true)\n * });\n * ```\n *\n * @see {@link redirectForUserIdentifierParamHook}\n * @see {@link redirectForIdentifierParamHook} for the underlying generic implementation\n */\nexport interface RedirectForUserIdentifierParamHookInput {\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly uidParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target user.\n *\n * Can return another users identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewUser: (targetUid: AuthUserIdentifier, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | AuthUserIdentifier>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * Registers a UIRouter transition hook that asserts the current user is allowed to view a route parameterized by a user identifier.\n *\n * This is a convenience wrapper around {@link redirectForIdentifierParamHook} that automatically uses the\n * authenticated user's identifier from {@link DbxAuthService} as the default value when the `uid` param is\n * missing or matches the placeholder value.\n *\n * @param input - Configuration specifying the route criteria, access control logic, and optional parameter overrides.\n * @returns The result of registering the transition hook.\n *\n * @see {@link RedirectForUserIdentifierParamHookInput}\n * @see {@link redirectForIdentifierParamHook}\n */\nexport function redirectForUserIdentifierParamHook(input: RedirectForUserIdentifierParamHookInput): void {\n const { uidParam = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE, criteria, priority = 100, transitionService, canViewUser } = input;\n\n return redirectForIdentifierParamHook({\n defaultAllowedValue: (authService: DbxAuthService) => authService.userIdentifier$,\n idParam: uidParam,\n defaultParamValue,\n criteria,\n transitionService,\n canViewModelWithId: canViewUser,\n priority\n });\n}\n","/**\n * Enum describing the type of a router transition event.\n *\n * Used by {@link DbxRouterTransitionEvent} to categorize transition lifecycle events.\n *\n * @see {@link DbxRouterTransitionEvent}\n * @see {@link DbxRouterTransitionService}\n */\nexport enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'success'\n}\n\n/**\n * Represents a router transition event emitted during navigation lifecycle.\n *\n * @example\n * ```ts\n * transitionService.transitions$.subscribe(event => {\n * if (event.type === DbxRouterTransitionEventType.SUCCESS) {\n * console.log('Navigation completed successfully');\n * }\n * });\n * ```\n *\n * @see {@link DbxRouterTransitionEventType}\n * @see {@link DbxRouterTransitionService}\n */\nexport interface DbxRouterTransitionEvent {\n /**\n * The type of transition event (start or success).\n */\n type: DbxRouterTransitionEventType;\n}\n","import { map, type Observable, combineLatest, firstValueFrom } from 'rxjs';\nimport { asObservable, filterMaybe, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type DbxRouterService } from '../../service/router.service';\nimport { type DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, type SegueRef, type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../../segue';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ActivatedRoute, type NavigationBehaviorOptions, NavigationEnd, type NavigationExtras, NavigationStart, Router, type UrlTree } from '@angular/router';\nimport { Injectable, inject } from '@angular/core';\nimport { KeyValueTypleValueFilter, type Maybe, mergeObjects } from '@dereekb/util';\n\n/**\n * Angular Router implementation of {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Maps Angular Router's `NavigationStart` and `NavigationEnd` events to {@link DbxRouterTransitionEvent} values\n * and provides navigation via Angular's `Router.navigate()` and `Router.navigateByUrl()` methods.\n *\n * @example\n * ```ts\n * // Register via the module\n * DbxCoreAngularRouterSegueModule.forRoot()\n *\n * // Or inject directly\n * const router = inject(DbxRouterService);\n * await router.go({ ref: '/dashboard' });\n * ```\n *\n * @see {@link DbxRouterService}\n * @see {@link DbxCoreAngularRouterSegueModule} for module-based registration\n * @see {@link DbxUIRouterService} for the UIRouter alternative\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\n readonly router = inject(Router);\n readonly activatedRoute = inject(ActivatedRoute);\n\n readonly params$: Observable<SegueRefRawSegueParams> = this.activatedRoute.params;\n\n readonly transitions$ = this.router.events.pipe(\n map((x) => {\n let event: Maybe<DbxRouterTransitionEvent>;\n\n if (x instanceof NavigationStart) {\n event = {\n type: DbxRouterTransitionEventType.START\n };\n } else if (x instanceof NavigationEnd) {\n event = {\n type: DbxRouterTransitionEventType.SUCCESS\n };\n }\n\n return event;\n }),\n filterMaybe()\n );\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const ref = segueRef.ref;\n\n if (Array.isArray(ref)) {\n return this.router.navigate(ref as unknown[], {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n });\n } else {\n return this.router.navigateByUrl(ref as string | UrlTree, {\n ...segueRef.refOptions\n });\n }\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>> = combineLatest([this.activatedRoute.params, asObservable(inputParams)]).pipe(\n map(([currentParams, params]) => {\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n const segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions> = {\n ref: this.activatedRoute.pathFromRoot,\n refParams,\n refOptions: {\n replaceUrl: true\n }\n };\n\n return segueRef;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(_segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n isActiveExactly(_segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n comparePrecision(_a: SegueRefOrSegueRefRouterLink, _b: SegueRefOrSegueRefRouterLink): number {\n return 0; // TODO!\n }\n}\n","import { type ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n/**\n * NgModule that provides the Angular Router-based implementation of {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Use `forRoot()` to register the providers at the application root level.\n *\n * @example\n * ```ts\n * @NgModule({\n * imports: [\n * DbxCoreAngularRouterSegueModule.forRoot()\n * ]\n * })\n * export class AppModule {}\n * ```\n *\n * @see {@link DbxAngularRouterService} for the underlying service implementation\n * @see {@link provideDbxUIRouterService} for the UIRouter alternative\n */\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreAngularRouterSegueModule> {\n return {\n ngModule: DbxCoreAngularRouterSegueModule,\n providers: [\n DbxAngularRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxAngularRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxAngularRouterService\n }\n ]\n };\n }\n}\n","import { KeyValueTypleValueFilter, mergeObjects } from '@dereekb/util';\nimport { Subject, BehaviorSubject, type Observable, firstValueFrom, map } from 'rxjs';\nimport { type DbxRouterService } from '../../service/router.service';\nimport { type DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, asSegueRefString, type SegueRef, type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../../segue';\nimport { StateService, UIRouter, UIRouterGlobals, type TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable, type OnDestroy, inject } from '@angular/core';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\n\n/**\n * UIRouter implementation of {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Bridges UIRouter's `TransitionService` events to {@link DbxRouterTransitionEvent} values and provides\n * navigation via UIRouter's `StateService.go()`. Supports state activity checks and route precision comparison.\n *\n * @example\n * ```ts\n * // Register via the provider function\n * provideDbxUIRouterService()\n *\n * // Or inject and use\n * const router = inject(DbxRouterService);\n * await router.go({ ref: 'app.dashboard', refParams: { id: '123' } });\n * ```\n *\n * @see {@link DbxRouterService}\n * @see {@link provideDbxUIRouterService} for provider registration\n * @see {@link DbxAngularRouterService} for the Angular Router alternative\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService, OnDestroy {\n readonly uiRouter = inject(UIRouter);\n readonly state = inject(StateService);\n readonly transitionService = inject(TransitionService);\n readonly uiRouterGlobals = inject(UIRouterGlobals);\n\n private readonly _params = new BehaviorSubject<SegueRefRawSegueParams>(this.uiRouterGlobals.params);\n\n readonly params$ = this._params.asObservable();\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor() {\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n\n this._params.next(this.uiRouterGlobals.params);\n };\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n });\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n });\n }\n\n ngOnDestroy(): void {\n this._transitions.complete();\n }\n\n get params() {\n return this.uiRouterGlobals.params;\n }\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<TransitionOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state\n .go(segueRef.ref as string, params, segueRef.refOptions)\n .then(() => true)\n .catch(() => false);\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<TransitionOptions>> = asObservable(inputParams).pipe(\n map((params) => {\n const currentParams = this.uiRouterGlobals.params;\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n\n const ref: SegueRef<TransitionOptions> = {\n ref: '.',\n refParams,\n refOptions: {\n location: 'replace',\n inherit: true\n }\n };\n\n return ref;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, false);\n }\n\n isActiveExactly(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, true);\n }\n\n comparePrecision(aInput: SegueRefOrSegueRefRouterLink, bInput: SegueRefOrSegueRefRouterLink): number {\n const aRef = asSegueRefString(aInput);\n const bRef = asSegueRefString(bInput);\n\n const aLength = aRef.length;\n const bLength = bRef.length;\n return aLength > bLength ? 1 : aLength === bLength ? 0 : -1;\n }\n\n // MARK: Internal\n isActiveState(input: SegueRefOrSegueRefRouterLink, exactly: boolean): boolean {\n const segueRef = asSegueRef(input);\n const ref = segueRef.ref as string;\n const refParams = segueRef.refParams;\n\n // Slash paths (e.g., '/demo/oauth') are compared against the current URL path\n if (ref.startsWith('/')) {\n const currentPath = this.uiRouter.urlService.path();\n\n if (exactly) {\n return currentPath === ref;\n } else {\n return currentPath === ref || currentPath.startsWith(ref + '/');\n }\n }\n\n const targetRef = ref.startsWith('.') ? `^${ref}` : ref;\n return exactly ? this.state.is(targetRef, refParams) : this.state.includes(targetRef, refParams);\n }\n}\n","import { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n/**\n * Creates Angular environment providers that register {@link DbxUIRouterService} as the implementation\n * for both {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Use this function in the application's `bootstrapApplication` or `provideRouter` configuration\n * when using UIRouter as the routing framework.\n *\n * @returns Angular `EnvironmentProviders` for the UIRouter-based router service.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideDbxUIRouterService()\n * ]\n * });\n * ```\n *\n * @see {@link DbxUIRouterService}\n * @see {@link DbxCoreAngularRouterSegueModule} for the Angular Router alternative\n */\nexport function provideDbxUIRouterService(): EnvironmentProviders {\n const providers: Provider[] = [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { type ArrayOrValue, asArray, filterMaybeArrayValues, type IndexRef } from '@dereekb/util';\nimport { filter, map, type MonoTypeOperatorFunction, type Observable, distinctUntilChanged, shareReplay, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from '../service/router.service';\nimport { type DbxRouterTransitionService } from '../service/router.transition.service';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from './transition';\n\n/**\n * Filters the given transition event observable to only emit successful transitions.\n *\n * Convenience function equivalent to applying {@link filterTransitionSuccess} as a pipe operator.\n *\n * @param obs - The source observable of router transition events.\n * @returns An observable that emits only successful transition events.\n *\n * @see {@link filterTransitionSuccess}\n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\n/**\n * RxJS operator that filters transition events to only pass through successful transitions.\n *\n * @returns A `MonoTypeOperatorFunction` that filters for {@link DbxRouterTransitionEventType.SUCCESS} events.\n *\n * @see {@link filterTransitionEvent}\n */\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\n/**\n * RxJS operator that filters transition events to only pass through events of the specified type.\n *\n * @param type - The transition event type to filter for.\n * @returns A `MonoTypeOperatorFunction` that only passes matching events.\n */\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter((x) => x.type === type);\n}\n// MARK: LatestSuccessfulRoutesConfig\n/**\n * Configuration for a single route to check for activity within {@link latestSuccessfulRoutes}.\n *\n * @see {@link LatestSuccessfulRoutesConfig}\n */\nexport interface LatestSuccessfulRoutesConfigRoute {\n /**\n * Route to check if it is active or not.\n */\n readonly route: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n */\n readonly activeExactly?: boolean;\n}\n\ninterface LatestSuccessfulRoutesConfigRouteItem<T> extends IndexRef {\n readonly r: T;\n}\n\n/**\n * Configuration for {@link latestSuccessfulRoutes}, specifying the router services and routes to monitor.\n *\n * @typeParam T - The route configuration type, extending {@link LatestSuccessfulRoutesConfigRoute}.\n *\n * @see {@link latestSuccessfulRoutes}\n */\nexport interface LatestSuccessfulRoutesConfig<T extends LatestSuccessfulRoutesConfigRoute> {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<T>;\n}\n\n/**\n * Creates an observable that emits the list of currently active routes after each successful transition.\n *\n * On each successful router transition, checks all configured routes against the router service\n * and emits an array of those that are active. The result is deduplicated by index and shared.\n *\n * @typeParam T - The route configuration type, extending {@link LatestSuccessfulRoutesConfigRoute}.\n * @param config - Configuration specifying the router services and routes to monitor.\n * @returns An observable emitting an array of the currently active route configurations.\n *\n * @see {@link LatestSuccessfulRoutesConfig}\n * @see {@link isLatestSuccessfulRoute} for a boolean variant\n */\nexport function latestSuccessfulRoutes<T extends LatestSuccessfulRoutesConfigRoute>(config: LatestSuccessfulRoutesConfig<T>): Observable<T[]> {\n const { dbxRouterTransitionService, dbxRouterService, routes: inputRoutes } = config;\n const routes: LatestSuccessfulRoutesConfigRouteItem<T>[] = asArray(inputRoutes).map((r, i) => ({ r, i }));\n const checkRoutes: (() => LatestSuccessfulRoutesConfigRouteItem<T> | undefined)[] = routes.map((routeConfig) => {\n const { r: route } = routeConfig;\n return route.activeExactly ? () => (dbxRouterService.isActiveExactly(route.route) ? routeConfig : undefined) : () => (dbxRouterService.isActive(route.route) ? routeConfig : undefined);\n });\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const activeRoutes: LatestSuccessfulRoutesConfigRouteItem<T>[] = filterMaybeArrayValues(checkRoutes.map((x) => x()));\n return activeRoutes;\n }),\n distinctUntilKeysChange((x) => x.i),\n map((x) => x.map((y) => y.r)),\n shareReplay(1)\n );\n}\n\n// MARK: IsLatestSuccessfulRouteConfig\n/**\n * Configuration for {@link isLatestSuccessfulRoute}, specifying the router services, routes, and match mode.\n *\n * @see {@link isLatestSuccessfulRoute}\n */\nexport interface IsLatestSuccessfulRouteConfig {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<SegueRefOrSegueRefRouterLink>;\n /**\n * Whether or not to match route activity exactly.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an observable that emits `true` when any of the configured routes are active after a successful transition,\n * and `false` otherwise.\n *\n * This is a simplified boolean variant of {@link latestSuccessfulRoutes}.\n *\n * @param config - Configuration specifying the router services, routes, and match mode.\n * @returns An observable emitting `true` when at least one configured route is active, `false` otherwise.\n *\n * @see {@link IsLatestSuccessfulRouteConfig}\n * @see {@link latestSuccessfulRoutes} for the full route list variant\n */\nexport function isLatestSuccessfulRoute(config: IsLatestSuccessfulRouteConfig): Observable<boolean> {\n const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;\n const routes = asArray(config.routes);\n const checkRoute: (route: SegueRefOrSegueRefRouterLink) => boolean = activeExactly ? (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActiveExactly(route) : (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActive(route);\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n return routes.some(checkRoute);\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n}\n","import { type Observable, startWith } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that provides observables for reacting to successful router transitions.\n *\n * Subclasses can subscribe to `transitionSuccess$` to react to each successful navigation,\n * or use `initAndUpdateOnTransitionSuccess$` which also emits once immediately on initialization.\n *\n * @example\n * ```ts\n * @Directive({ selector: '[myTransitionHandler]' })\n * class MyTransitionHandlerDirective extends AbstractTransitionDirective {\n * readonly data$ = this.initAndUpdateOnTransitionSuccess$.pipe(\n * switchMap(() => this.loadData())\n * );\n * }\n * ```\n *\n * @see {@link AbstractTransitionWatcherDirective} for a variant that automatically calls a callback\n * @see {@link DbxRouterTransitionService}\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n protected readonly dbxRouterTransitionService = inject(DbxRouterTransitionService);\n\n /**\n * Observable that emits on each successful router transition.\n */\n readonly transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);\n /**\n * Observable that emits immediately on initialization and on each subsequent successful transition.\n */\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n}\n","import { Directive, NgZone, inject } from '@angular/core';\nimport { AbstractTransitionDirective } from './transition.directive';\nimport { cleanSubscription } from '../../../rxjs/subscription';\n\n/**\n * Abstract directive that automatically calls {@link updateForSuccessfulTransition} on each successful router transition.\n *\n * Extends {@link AbstractTransitionDirective} by subscribing to successful transitions during construction\n * and invoking the abstract `updateForSuccessfulTransition()` method for each one.\n *\n * Also provides a `zoneUpdateForSuccessfulTransition()` method that wraps the update call in `NgZone.run()`.\n *\n * @example\n * ```ts\n * @Directive({ selector: '[myRouteWatcher]' })\n * class MyRouteWatcherDirective extends AbstractTransitionWatcherDirective {\n * protected updateForSuccessfulTransition(): void {\n * console.log('Route changed successfully');\n * }\n * }\n * ```\n *\n * @see {@link AbstractTransitionDirective}\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {\n protected readonly ngZone = inject(NgZone);\n\n constructor() {\n super();\n\n cleanSubscription(\n this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n })\n );\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n // TODO: NgZone Deprecation\n // remove this function and replace, if necessary or remove entirely with angular zoneless implementation details.\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n}\n","import { type Building } from '@dereekb/util';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * A callable function that returns `true` when the configured segue ref is currently active in the router.\n *\n * Also exposes the underlying segue ref and match mode as readonly properties for introspection.\n *\n * @see {@link isSegueRefActiveFunction} for creating instances\n */\nexport type IsSegueRefActiveFunction = (() => boolean) & {\n readonly _segueRef: SegueRefOrSegueRefRouterLink;\n readonly _activeExactly: boolean;\n};\n\n/**\n * Configuration for creating an {@link IsSegueRefActiveFunction}.\n *\n * @see {@link isSegueRefActiveFunction}\n */\nexport interface IsSegueRefActiveFunctionConfig {\n readonly dbxRouterService: DbxRouterService;\n readonly segueRef: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n *\n * False by default.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an {@link IsSegueRefActiveFunction} from the given configuration.\n *\n * The returned function checks whether the configured segue ref is active in the router each time it is called.\n * When `activeExactly` is `true`, uses `isActiveExactly`; otherwise uses `isActive`.\n *\n * @param config - The configuration containing the router service, segue ref, and match mode.\n * @returns A callable function that returns `true` when the route is active.\n *\n * @see {@link IsSegueRefActiveFunctionConfig}\n */\nexport function isSegueRefActiveFunction(config: IsSegueRefActiveFunctionConfig): IsSegueRefActiveFunction {\n const { dbxRouterService, segueRef, activeExactly = false } = config;\n const result = (activeExactly ? () => dbxRouterService.isActiveExactly(segueRef) : () => dbxRouterService.isActive(segueRef)) as Building<IsSegueRefActiveFunction>;\n\n result._segueRef = segueRef;\n result._activeExactly = activeExactly;\n\n return result as IsSegueRefActiveFunction;\n}\n","import { type Maybe } from '@dereekb/util';\nimport { filter, map, type Observable, of, type OperatorFunction, switchMap, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../transition';\nimport { isSegueRefActiveFunction, type IsSegueRefActiveFunctionConfig } from './router.service.util';\n\n// MARK: Transition Events\n/**\n * Filters the given transition event observable to only emit events of the specified type.\n *\n * @param events$ - The source observable of router transition events.\n * @param type - The transition event type to filter for.\n * @returns An observable that emits only events matching the given type.\n */\nexport function onRouterTransitionEventType(events$: Observable<DbxRouterTransitionEvent>, type: DbxRouterTransitionEventType): Observable<DbxRouterTransitionEvent> {\n return events$.pipe(filter((x) => x.type === type));\n}\n\n/**\n * Filters the given transition event observable to only emit successful transition events.\n *\n * @param events$ - The source observable of router transition events.\n * @returns An observable that emits only {@link DbxRouterTransitionEventType.SUCCESS} events.\n *\n * @see {@link onRouterTransitionEventType}\n */\nexport function onRouterTransitionSuccessEvent(events$: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return onRouterTransitionEventType(events$, DbxRouterTransitionEventType.SUCCESS);\n}\n\n// MARK: Router Service\n/**\n * Creates an observable that returns true when the route for the input segueRef is active.\n *\n * @param config - Configuration specifying the router service, segue ref, and matching options.\n * @returns An observable that emits `true` when the segue ref's route is active.\n */\nexport function isSegueRefActiveOnTransitionSuccess(config: IsSegueRefActiveFunctionConfig): Observable<boolean> {\n const isActiveFn = isSegueRefActiveFunction(config);\n return onRouterTransitionSuccessEvent(config.dbxRouterService.transitions$).pipe(\n startWith(undefined),\n map(() => isActiveFn())\n );\n}\n\n/**\n * Configuration for the {@link isSegueRefActive} RxJS operator function.\n *\n * @see {@link isSegueRefActive}\n */\nexport interface IsSegueRefActiveConfig extends Pick<IsSegueRefActiveFunctionConfig, 'dbxRouterService' | 'activeExactly'> {\n /**\n * What to pipe if the input segueRef is null.\n */\n readonly defaultIfNull?: boolean;\n}\n\n/**\n * Operator function that maps the input segueRef to a boolean depending on the current route state.\n *\n * @param config - Configuration specifying the router service and default behavior for null refs.\n * @returns An RxJS operator that maps a segue ref to whether it is currently active.\n */\nexport function isSegueRefActive(config: IsSegueRefActiveConfig): OperatorFunction<Maybe<SegueRefOrSegueRefRouterLink>, boolean> {\n const { defaultIfNull = false } = config;\n\n return switchMap((segueRef) => {\n if (segueRef) {\n return isSegueRefActiveOnTransitionSuccess({ ...config, segueRef });\n } else {\n return of(defaultIfNull);\n }\n });\n}\n","import { type ObservableOrValueGetter, type MaybeObservableOrValueGetter, switchMapToDefault, maybeValueFromObservableOrValueGetter, asObservableFromGetter } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, distinctUntilChanged, first, map, type Observable, shareReplay } from 'rxjs';\nimport { type DbxRouterService } from '../service/router.service';\n\n/**\n * Interface for reading a single parameter value from the router state.\n *\n * Provides observables for the raw parameter value, a configurable default value, and a computed value\n * that falls back to the default when the parameter is not set. Also supports programmatic updates.\n *\n * @typeParam T - The type of the parameter value.\n *\n * @example\n * ```ts\n * const reader = dbxRouteParamReaderInstance<string>(routerService, 'id');\n * reader.value$.subscribe(id => console.log('Current ID:', id));\n * reader.setDefaultValue('default-id');\n * ```\n *\n * @see {@link dbxRouteParamReaderInstance} for creating instances\n * @see {@link DbxRouterService} for the router service that provides route parameters\n */\nexport interface DbxRouteParamReader<T> {\n /**\n * The param value as read from the current router state.\n */\n readonly paramValue$: Observable<Maybe<T>>;\n\n /**\n * The default value observable.\n */\n readonly defaultValue$: Observable<Maybe<T>>;\n\n /**\n * The current value given the paramValue and the defaultValue.\n */\n readonly value$: Observable<Maybe<T>>;\n\n /**\n * Returns the current param key.\n */\n getParamKey(): string;\n\n /**\n * Sets a new param key. If the value is undefined, the param reader will use the default key.\n */\n setParamKey(paramKey: Maybe<string>): void;\n\n /**\n * Sets the default value source.\n *\n * @param defaultValue\n */\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<T>): void;\n\n /**\n * Updates the value on the current route for the paramKey.\n *\n * @param value\n */\n setParamValue(value: MaybeObservableOrValueGetter<T>): void;\n}\n\n/**\n * Full lifecycle instance of a {@link DbxRouteParamReader} that exposes the underlying router service,\n * additional observable streams, and implements the {@link Destroyable} interface for cleanup.\n *\n * @typeParam T - The type of the parameter value.\n *\n * @see {@link DbxRouteParamReader}\n * @see {@link dbxRouteParamReaderInstance} for creating instances\n */\nexport interface DbxRouteParamReaderInstance<T> extends DbxRouteParamReader<T>, Destroyable {\n readonly dbxRouterService: DbxRouterService;\n readonly paramKey$: Observable<string>;\n readonly nextDefaultValue$: Observable<Maybe<T>>;\n readonly value$: Observable<Maybe<T>>;\n}\n\n/**\n * Creates a new DbxRouteParamReaderInstance from the input.\n *\n * @param dbxRouterService\n * @param defaultParamKey\n * @param defaultValue\n * @returns\n */\nexport function dbxRouteParamReaderInstance<T>(dbxRouterService: DbxRouterService, defaultParamKey: string, defaultValue?: MaybeObservableOrValueGetter<T>): DbxRouteParamReaderInstance<T> {\n const _paramKey = new BehaviorSubject<string>(defaultParamKey);\n const _defaultValue = new BehaviorSubject<Maybe<ObservableOrValueGetter<Maybe<T>>>>(defaultValue);\n\n const paramKey$ = _paramKey.asObservable();\n\n const paramValue$ = combineLatest([paramKey$, dbxRouterService.params$]).pipe(\n map(([key, params]) => (params[key] as Maybe<T>) ?? undefined),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const nextDefaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const defaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const value$ = paramValue$.pipe(switchMapToDefault(defaultValue$), shareReplay(1));\n\n const result: DbxRouteParamReaderInstance<T> = {\n dbxRouterService,\n\n paramKey$,\n paramValue$,\n nextDefaultValue$,\n defaultValue$,\n value$,\n\n destroy() {\n _paramKey.complete();\n _defaultValue.complete();\n },\n\n getParamKey(): string {\n return _paramKey.value;\n },\n\n setParamKey(paramKey: Maybe<string>) {\n _paramKey.next(paramKey || defaultParamKey);\n },\n\n setDefaultValue(newValue: MaybeObservableOrValueGetter<T>) {\n _defaultValue.next(newValue ?? defaultValue);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<T>) {\n combineLatest([paramKey$, asObservableFromGetter(value)])\n .pipe(first())\n .subscribe(([paramKey, value]) => void dbxRouterService.updateParams({ [paramKey]: value }));\n }\n };\n\n return result;\n}\n","import { BehaviorSubject, EMPTY, switchMap, of } from 'rxjs';\nimport { type DbxRouteParamReaderInstance } from './route.reader';\nimport { type Destroyable, type Initialized, type Maybe, type DefaultForwardFunctionFactory, defaultForwardFunctionFactory } from '@dereekb/util';\nimport { SubscriptionObject, switchMapToDefault, type SwitchMapToDefaultFilterFunction, filterMaybe } from '@dereekb/rxjs';\n\nconst DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY = defaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<unknown>>((value) => of(value == null));\n\n/**\n * Utility class that works with a {@link DbxRouteParamReaderInstance} to automatically redirect the router\n * when the current parameter value is determined to require a default substitution.\n *\n * When enabled and initialized, it monitors the parameter value and, if the configured filter function\n * indicates the value should be replaced, updates the route to use the default value instead.\n *\n * @typeParam T - The type of the parameter value.\n *\n * @example\n * ```ts\n * const paramReader = dbxRouteParamReaderInstance<string>(routerService, 'id');\n * const redirect = new DbxRouteParamDefaultRedirectInstance(paramReader);\n * redirect.setUseDefaultFilter(value => of(value === '0'));\n * redirect.init();\n * ```\n *\n * @see {@link DbxRouteParamReaderInstance}\n * @see {@link dbxRouteModelIdParamRedirect} for the model-specific usage pattern\n */\nexport class DbxRouteParamDefaultRedirectInstance<T> implements Initialized, Destroyable {\n private readonly instance: DbxRouteParamReaderInstance<T>;\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n private readonly _useDefaultFilter = new BehaviorSubject<Maybe<SwitchMapToDefaultFilterFunction<T>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(instance: DbxRouteParamReaderInstance<T>) {\n this.instance = instance;\n }\n\n init(): void {\n this._sub.subscription = this._enabled\n .pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this.instance.paramValue$.pipe(\n switchMapToDefault(this.instance.defaultValue$, (value) => {\n return this._useDefaultFilter.pipe(switchMap((fn) => (DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY as DefaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<T>>)(fn)(value)));\n }),\n filterMaybe(), // do not redirect on MaybeNot values\n switchMap((defaultValue) => {\n return this.redirectWithDefaultValue(defaultValue);\n })\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._enabled.complete();\n this._useDefaultFilter.complete();\n this._sub.destroy();\n }\n\n protected redirectWithDefaultValue(value: Maybe<T>): Promise<boolean> {\n if (value != null) {\n // perform a segue once\n return this.redirectWithValue(value);\n } else {\n // do nothing\n return Promise.resolve(false);\n }\n }\n\n protected redirectWithValue(value: Maybe<T>): Promise<boolean> {\n return this.instance.dbxRouterService.updateParams({\n [this.instance.getParamKey()]: value\n });\n }\n\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: boolean) {\n this._enabled.next(enabled);\n }\n\n setUseDefaultFilter(useValueFilter: Maybe<SwitchMapToDefaultFilterFunction<T>>): void {\n this._useDefaultFilter.next(useValueFilter);\n }\n}\n","import { type Observable, BehaviorSubject, map, shareReplay, of, switchMap } from 'rxjs';\nimport { type Destroyable, type Initialized, type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { type DbxRouterService } from '../router/service';\nimport { type DbxRouteParamReader, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance } from '../router/util';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the id param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY = 'id';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the key param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY = 'key';\n\n/**\n * Default value used by dbxRouteModelIdParamRedirect() for when a value is not available or provided.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_USE_PARAM_VALUE = '0';\n\n/**\n * Reads a model identifier from the current route by parameter key, with support for automatic\n * redirect when the parameter matches a placeholder value (e.g., `'0'`).\n *\n * Extends {@link DbxRouteParamReader} with redirect and decision logic so that routes with\n * placeholder identifiers can be automatically resolved to a meaningful default.\n *\n * @example\n * ```ts\n * const redirect = dbxRouteModelIdParamRedirect(routerService);\n * redirect.init();\n *\n * // Observe the resolved id (after redirect logic is applied)\n * redirect.id$.subscribe(id => console.log('Model ID:', id));\n * ```\n *\n * @see {@link DbxRouteParamReader}\n * @see {@link dbxRouteModelIdParamRedirect} for creating instances\n */\nexport interface DbxRouteModelIdParamRedirect 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 * Full lifecycle instance of a {@link DbxRouteModelIdParamRedirect} that supports initialization and destruction.\n *\n * Provides mutable setters for the parameter key, default value, redirect enabled state, and decision function.\n *\n * @see {@link DbxRouteModelIdParamRedirect}\n * @see {@link dbxRouteModelIdParamRedirect} for creating instances\n */\nexport interface DbxRouteModelIdParamRedirectInstance extends DbxRouteModelIdParamRedirect, 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: Maybe<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\n/**\n * Creates a {@link DbxRouteModelIdParamRedirectInstance} configured to read a \"key\" parameter from the current route.\n *\n * This is a convenience wrapper around {@link dbxRouteModelIdParamRedirect} that defaults the parameter key to `'key'`.\n *\n * @param dbxRouterService - The router service to read parameters from.\n * @param defaultParamKey - The route parameter key to read. Defaults to `'key'`.\n * @returns A new redirect instance.\n *\n * @see {@link dbxRouteModelIdParamRedirect}\n */\nexport function dbxRouteModelKeyParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n return dbxRouteModelIdParamRedirect(dbxRouterService, defaultParamKey);\n}\n\n/**\n * Creates a {@link DbxRouteModelIdParamRedirectInstance} that reads a model identifier from the current route\n * and optionally redirects when the value matches a placeholder (defaulting to `'0'`).\n *\n * The instance must be initialized via `init()` to activate the redirect behavior, and destroyed via `destroy()`\n * when no longer needed.\n *\n * @param dbxRouterService - The router service to read parameters from and perform redirects with.\n * @param defaultParamKey - The route parameter key to read. Defaults to `'id'`.\n * @returns A new redirect instance.\n *\n * @see {@link DbxRouteModelIdParamRedirectInstance}\n * @see {@link dbxRouteModelKeyParamRedirect} for the key-based variant\n */\nexport function dbxRouteModelIdParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n const _paramReader = dbxRouteParamReaderInstance<ModelKey>(dbxRouterService, defaultParamKey);\n const _paramRedirect = new DbxRouteParamDefaultRedirectInstance<ModelKey>(_paramReader);\n const _useDefaultParamDecider = new BehaviorSubject<string | SwitchMapToDefaultFilterFunction<ModelKey>>(DBX_ROUTE_MODEL_ID_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: DbxRouteModelIdParamRedirectInstance = {\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 { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type Observable, type Subscription } from 'rxjs';\n\n// MARK: Id\n/**\n * Abstract delegate that receives model identifier observables from a {@link DbxRouteModelIdDirective}.\n *\n * Implement this class and register it as a provider to receive the id parameter read from the current route.\n * The directive will call {@link useRouteModelIdParamsObservable} during initialization.\n *\n * @example\n * ```ts\n * @Directive({\n * selector: '[myModelLoader]',\n * providers: provideDbxRouteModelIdDirectiveDelegate(MyModelLoaderDirective)\n * })\n * class MyModelLoaderDirective extends DbxRouteModelIdDirectiveDelegate {\n * useRouteModelIdParamsObservable(idFromParams$: Observable<Maybe<ModelKey>>, computedId$: Observable<Maybe<ModelKey>>): Subscription {\n * return computedId$.subscribe(id => this.loadModel(id));\n * }\n * }\n * ```\n *\n * @see {@link DbxRouteModelIdDirective} for the directive that provides the id observables\n * @see {@link provideDbxRouteModelIdDirectiveDelegate} for registering the delegate provider\n */\nexport abstract class DbxRouteModelIdDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelIdDirective to this delegate.\n *\n * @param idFromParamsObs\n * @param computedIdObs\n */\n abstract useRouteModelIdParamsObservable(idFromParamsObs: Observable<Maybe<ModelKey>>, computedIdObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Creates Angular DI providers that register the given source type as a {@link DbxRouteModelIdDirectiveDelegate}.\n *\n * @typeParam S - The concrete delegate class type to register.\n * @param sourceType - The class to provide as the delegate.\n * @returns An array of Angular providers.\n *\n * @see {@link DbxRouteModelIdDirectiveDelegate}\n */\nexport function provideDbxRouteModelIdDirectiveDelegate<S extends DbxRouteModelIdDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelIdDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n\n// MARK: Key\n/**\n * Abstract delegate that receives model key observables from a {@link DbxRouteModelKeyDirective}.\n *\n * Implement this class and register it as a provider to receive the key parameter read from the current route.\n * The directive will call {@link useRouteModelKeyParamsObservable} during initialization.\n *\n * @example\n * ```ts\n * @Directive({\n * selector: '[myModelKeyLoader]',\n * providers: provideDbxRouteModelKeyDirectiveDelegate(MyModelKeyLoaderDirective)\n * })\n * class MyModelKeyLoaderDirective extends DbxRouteModelKeyDirectiveDelegate {\n * useRouteModelKeyParamsObservable(keyFromParams$: Observable<Maybe<ModelKey>>, computedKey$: Observable<Maybe<ModelKey>>): Subscription {\n * return computedKey$.subscribe(key => this.loadModel(key));\n * }\n * }\n * ```\n *\n * @see {@link DbxRouteModelKeyDirective} for the directive that provides the key observables\n * @see {@link provideDbxRouteModelKeyDirectiveDelegate} for registering the delegate provider\n */\nexport abstract class DbxRouteModelKeyDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelKeyDirective to this delegate.\n *\n * @param keyFromParamsObs\n * @param computedKeyObs\n */\n abstract useRouteModelKeyParamsObservable(keyFromParamsObs: Observable<Maybe<ModelKey>>, computedKeyObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Creates Angular DI providers that register the given source type as a {@link DbxRouteModelKeyDirectiveDelegate}.\n *\n * @typeParam S - The concrete delegate class type to register.\n * @param sourceType - The class to provide as the delegate.\n * @returns An array of Angular providers.\n *\n * @see {@link DbxRouteModelKeyDirectiveDelegate}\n */\nexport function provideDbxRouteModelKeyDirectiveDelegate<S extends DbxRouteModelKeyDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelKeyDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { DbxAuthService } from '../../auth';\nimport { cleanSubscription } from '../../rxjs';\n\n/**\n * Directive that retrieves the currently authenticated user's identifier from {@link DbxAuthService}\n * and passes it directly to a {@link DbxRouteModelIdDirectiveDelegate}.\n *\n * This is useful for routes that should always use the current user's ID, bypassing route parameter reading entirely.\n *\n * @example\n * ```html\n * <!-- Automatically provides the authenticated user's ID to the delegate -->\n * <div dbxRouteModelIdFromAuthUserId></div>\n * ```\n *\n * @see {@link DbxRouteModelIdDirectiveDelegate} for the delegate that receives the id observables\n * @see {@link DbxAuthService} for the authentication service providing the user identifier\n */\n@Directive({\n selector: '[dbxRouteModelIdFromAuthUserId]',\n standalone: true\n})\nexport class DbxRouteModelIdFromAuthUserIdDirective {\n readonly dbxAuthService = inject(DbxAuthService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.dbxAuthService.userIdentifier$, this.dbxAuthService.userIdentifier$));\n }\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelIdParamRedirect } from './id.param.redirect';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { clean, cleanSubscription } from '../../rxjs';\n\n/**\n * Directive that reads a model identifier from the current route's parameters and passes it to a {@link DbxRouteModelIdDirectiveDelegate}.\n *\n * Supports configurable parameter key, default value, redirect behavior, and custom decision logic for determining\n * when to use the default value vs. the route parameter.\n *\n * @example\n * ```html\n * <!-- Basic usage: reads \"id\" param from route and passes to delegate -->\n * <div dbxRouteModelId></div>\n *\n * <!-- Custom param key -->\n * <div [dbxRouteModelId]=\"'modelId'\"></div>\n *\n * <!-- With default value and redirect disabled -->\n * <div dbxRouteModelId [dbxRouteModelIdDefault]=\"defaultId$\" [dbxRouteModelIdDefaultRedirect]=\"false\"></div>\n * ```\n *\n * @see {@link DbxRouteModelIdDirectiveDelegate} for the delegate that receives the id observables\n * @see {@link dbxRouteModelIdParamRedirect} for the underlying redirect logic\n */\n@Directive({\n selector: '[dbxRouteModelId]',\n standalone: true\n})\nexport class DbxRouteModelIdDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelIdParamRedirect(this.dbxRouterService));\n\n readonly idFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly id$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.idFromParams$, this.id$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelId')\n get idParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set idParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n /**\n * Default model identifier value to use when the route parameter matches the placeholder or is absent.\n */\n @Input()\n set dbxRouteModelIdDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelIdDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n /**\n * Custom decision function or placeholder string value that determines when to use the default value instead of the route parameter.\n */\n @Input()\n set dbxRouteModelIdDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelKeyParamRedirect } from './id.param.redirect';\nimport { clean, cleanSubscription } from '../../rxjs';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelKeyDirectiveDelegate } from './model.router';\n\n/**\n * Directive that reads a model key from the current route's parameters and passes it to a {@link DbxRouteModelKeyDirectiveDelegate}.\n *\n * Functions identically to {@link DbxRouteModelIdDirective} but uses a \"key\" parameter (defaulting to `'key'`)\n * instead of \"id\". Supports configurable parameter key, default value, redirect behavior, and custom decision logic.\n *\n * @example\n * ```html\n * <!-- Basic usage: reads \"key\" param from route and passes to delegate -->\n * <div dbxRouteModelKey></div>\n *\n * <!-- Custom param key -->\n * <div [dbxRouteModelKey]=\"'slug'\"></div>\n *\n * <!-- With default value and redirect disabled -->\n * <div dbxRouteModelKey [dbxRouteModelKeyDefault]=\"defaultKey$\" [dbxRouteModelKeyDefaultRedirect]=\"false\"></div>\n * ```\n *\n * @see {@link DbxRouteModelKeyDirectiveDelegate} for the delegate that receives the key observables\n * @see {@link dbxRouteModelKeyParamRedirect} for the underlying redirect logic\n * @see {@link DbxRouteModelIdDirective} for the id-based equivalent\n */\n@Directive({\n selector: '[dbxRouteModelKey]',\n standalone: true\n})\nexport class DbxRouteModelKeyDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelKeyDelegate = inject(DbxRouteModelKeyDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelKeyParamRedirect(this.dbxRouterService));\n\n readonly keyFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly key$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelKeyDelegate.useRouteModelKeyParamsObservable(this.keyFromParams$, this.key$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelKey')\n get keyParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set keyParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n /**\n * Default model key value to use when the route parameter matches the placeholder or is absent.\n */\n @Input()\n set dbxRouteModelKeyDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelKeyDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n /**\n * Custom decision function or placeholder string value that determines when to use the default value instead of the route parameter.\n */\n @Input()\n set dbxRouteModelKeyDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { asObservableFromGetter, type ObservableOrValueGetter } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * Converts an {@link ObservableOrValueGetter} into an {@link Observable}.\n *\n * Useful for normalizing values that may be plain values, getter functions, or Observables\n * into a consistent Observable stream for use with the `async` pipe.\n *\n * @example\n * ```html\n * <span>{{ valueOrGetter | asObservable | async }}</span>\n * ```\n */\n@Pipe({\n name: 'asObservable',\n standalone: true\n})\nexport class AsObservablePipe implements PipeTransform {\n transform<T>(input: ObservableOrValueGetter<T>): Observable<T> {\n return asObservableFromGetter(input);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToDayRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a human-readable day range string using {@link formatToDayRangeString}.\n *\n * Displays only the date portion (no times). Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateDayRange }}</span>\n * <!-- Output: \"Jan 5 - Jan 8\" -->\n *\n * <span>{{ nullRange | dateDayRange:'No dates' }}</span>\n * <!-- Output: \"No dates\" -->\n * ```\n */\n@Pipe({\n name: 'dateDayRange',\n standalone: true,\n pure: true\n})\nexport class DateDayRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { isValid } from 'date-fns';\nimport { Pipe, type PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\n\n/**\n * Converts a {@link DateOrDateString} value to a JavaScript {@link Date} object using {@link toJsDate}.\n *\n * Returns `undefined` if the input is `null`, `undefined`, or results in an invalid date.\n * Also provides a static `toJsDate()` method used by other pipes in this package.\n *\n * @example\n * ```html\n * <span>{{ '2024-01-05T12:00:00Z' | toJsDate | date:'short' }}</span>\n * <!-- Output: \"1/5/24, 12:00 PM\" -->\n *\n * <span>{{ dateOrString | toJsDate | date:'fullDate' }}</span>\n * ```\n */\n@Pipe({\n name: 'toJsDate',\n standalone: true,\n pure: true\n})\nexport class ToJsDatePipe implements PipeTransform {\n public static toJsDate(input: DateOrDateString): Date;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date>;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n let date: Maybe<Date>;\n\n if (input != null) {\n date = toJsDate(input);\n\n if (!isValid(date)) {\n date = undefined;\n }\n }\n\n return date;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { formatDateDistance } from '@dereekb/date';\n\n/**\n * Formats a date as a human-readable distance string relative to another date (or now) using {@link formatDateDistance}.\n *\n * Accepts an optional comparison date (defaults to now) and a fallback string for `null`/`undefined` input.\n *\n * @example\n * ```html\n * <span>{{ someDate | dateDistance }}</span>\n * <!-- Output: \"3 hours ago\" -->\n *\n * <span>{{ someDate | dateDistance:referenceDate }}</span>\n * <!-- Output: \"2 days ago\" -->\n *\n * <span>{{ nullDate | dateDistance:null:'Unknown' }}</span>\n * <!-- Output: \"Unknown\" -->\n * ```\n */\n@Pipe({\n name: 'dateDistance',\n standalone: true,\n pure: false\n})\nexport class DateDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, inputTo?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n const to = inputTo ?? new Date();\n const from = ToJsDatePipe.toJsDate(input);\n return formatDateDistance(to, from);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Formats a date using a locale-aware format string and appends the relative distance to now in parentheses.\n *\n * Returns `undefined` if the input is falsy or not a valid date.\n *\n * @example\n * ```html\n * <span>{{ someDate | dateFormatDistance:'MMM d, y' }}</span>\n * <!-- Output: \"Jan 5, 2024 (3 days ago)\" -->\n *\n * <span>{{ someDate | dateFormatDistance:'short':true }}</span>\n * <!-- Output: \"1/5/24, 2:30 PM (about 3 days ago)\" with includeSeconds enabled -->\n * ```\n */\n@Pipe({\n name: 'dateFormatDistance',\n standalone: true,\n pure: false\n})\nexport class DateFormatDistancePipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(input: Maybe<DateOrDateString>, format: string, includeSeconds = false): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n\n if (isValid(date)) {\n const dateString = formatDate(date, format, this.locale);\n\n const distance = formatDistanceToNow(date, {\n includeSeconds,\n addSuffix: true\n });\n\n return `${dateString} (${distance})`;\n }\n }\n\n return undefined;\n }\n}\n","import { addMinutes } from 'date-fns';\nimport { Pipe, type PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { type Maybe, type DateOrDateString, type Minutes } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Formats a date as a \"from - to\" time range string given a start date, format string, and duration in minutes.\n *\n * The start date is formatted using the Angular locale-aware {@link formatDate}, and the end time\n * is computed by adding the given minutes and formatted as a time-only string.\n *\n * @example\n * ```html\n * <span>{{ eventStart | dateFormatFromTo:'MMM d, h:mm a':90 }}</span>\n * <!-- Output: \"Jan 5, 2:00 PM - 3:30 PM\" -->\n * ```\n */\n@Pipe({\n name: 'dateFormatFromTo',\n standalone: true,\n pure: true\n})\nexport class DateFormatFromToPipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n // eslint-disable-next-line @typescript-eslint/max-params\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: Minutes, locale: string): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n const endDate = addMinutes(date, minutes);\n const dateString = formatDate(date, format, locale);\n return dateString + ' - ' + formatToTimeString(endDate);\n }\n\n return undefined;\n }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: Minutes): Maybe<string> {\n return DateFormatFromToPipe.formatFromTo(input, format, minutes, this.locale);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToDayTimeRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a human-readable day and time range string using {@link formatToDayTimeRangeString}.\n *\n * Includes both the date and time portions. Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateDayTimeRange }}</span>\n * <!-- Output: \"Jan 5, 2:00 PM - Jan 8, 4:00 PM\" -->\n *\n * <span>{{ nullRange | dateDayTimeRange:'No dates' }}</span>\n * <!-- Output: \"No dates\" -->\n * ```\n */\n@Pipe({\n name: 'dateDayTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateDayTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a time range string using {@link formatToTimeRangeString}.\n *\n * Displays the date and time of both the start and end. Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateTimeRange }}</span>\n * <!-- Output: \"Jan 5, 2:00 PM - 4:00 PM\" -->\n *\n * <span>{{ nullRange | dateTimeRange:'TBD' }}</span>\n * <!-- Output: \"TBD\" -->\n * ```\n */\n@Pipe({\n name: 'dateTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatDateDistance } from '@dereekb/date';\n\n/**\n * Formats a {@link Date} or {@link DateRange} as a human-readable distance string relative to now using {@link formatDateDistance}.\n *\n * This is an impure pipe that recalculates on every change detection cycle to keep the distance up to date.\n * Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ someDate | dateRangeDistance }}</span>\n * <!-- Output: \"3 hours ago\" -->\n *\n * <span>{{ nullDate | dateRangeDistance:'Unknown' }}</span>\n * <!-- Output: \"Unknown\" -->\n * ```\n */\n@Pipe({\n name: 'dateRangeDistance',\n standalone: true,\n pure: false\n})\nexport class DateRangeDistancePipe implements PipeTransform {\n transform(input: Maybe<Date | DateRange>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n return formatDateDistance(input as Date, new Date());\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a time-only range string using {@link formatToTimeRangeString} with the time-only flag enabled.\n *\n * Displays only the time portion (no date). Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateTimeRangeOnly }}</span>\n * <!-- Output: \"2:00 PM - 4:00 PM\" -->\n *\n * <span>{{ nullRange | dateTimeRangeOnly:'TBD' }}</span>\n * <!-- Output: \"TBD\" -->\n * ```\n */\n@Pipe({\n name: 'dateTimeRangeOnly',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyPipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input, undefined, true);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts a target timezone date back to the equivalent system (UTC-based) date using {@link dateTimezoneUtcNormal}.\n *\n * This is the inverse of {@link SystemDateToTargetDatePipe}. Useful when you have a date representing\n * local time in a target timezone and need to convert it back to the system timezone.\n * Returns `undefined` if either the input date or timezone is falsy.\n *\n * @example\n * ```html\n * <span>{{ targetDate | targetDateToSystemDate:'America/New_York' | date:'short' }}</span>\n * <!-- Output: the date/time converted back to the system timezone -->\n * ```\n */\n@Pipe({\n name: 'targetDateToSystemDate',\n standalone: true,\n pure: false\n})\nexport class TargetDateToSystemDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).targetDateToSystemDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatDateRangeDistance, type FormatDateRangeDistanceFunctionConfig } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a human-readable distance string using {@link formatDateRangeDistance}.\n *\n * Accepts an optional {@link FormatDateRangeDistanceFunctionConfig} to customize the output format.\n * Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateTimeRangeOnlyDistance }}</span>\n * <!-- Output: \"3 hours\" -->\n *\n * <span>{{ dateRange | dateTimeRangeOnlyDistance:config }}</span>\n * <!-- Output varies based on config -->\n *\n * <span>{{ nullRange | dateTimeRangeOnlyDistance:null:'TBD' }}</span>\n * <!-- Output: \"TBD\" -->\n * ```\n */\n@Pipe({\n name: 'dateTimeRangeOnlyDistance',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyDistancePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, config?: FormatDateRangeDistanceFunctionConfig, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatDateRangeDistance(input, { ...config });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { getTimezoneAbbreviation } from '@dereekb/date';\n\n/**\n * Returns the abbreviated name for a timezone string (e.g., \"EST\", \"PDT\") using {@link getTimezoneAbbreviation}.\n *\n * Optionally accepts a reference date to determine the correct abbreviation (e.g., for daylight saving time).\n * Defaults to the current date if no reference date is provided.\n * Returns `undefined` if the timezone is falsy.\n *\n * @example\n * ```html\n * <span>{{ 'America/New_York' | timezoneAbbreviation }}</span>\n * <!-- Output: \"EST\" or \"EDT\" depending on the current date -->\n *\n * <span>{{ timezone | timezoneAbbreviation:referenceDate }}</span>\n * <!-- Output: abbreviation for the timezone at the given reference date -->\n * ```\n */\n@Pipe({\n name: 'timezoneAbbreviation',\n standalone: true,\n pure: false\n})\nexport class TimezoneAbbreviationPipe implements PipeTransform {\n transform(timezone: Maybe<TimezoneString>, input?: Maybe<Date>): Maybe<string> {\n if (timezone) {\n return getTimezoneAbbreviation(timezone, input ?? undefined);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts a system (UTC-based) date to the equivalent local date in the given timezone using {@link dateTimezoneUtcNormal}.\n *\n * This is useful when you have a date in the system's timezone and need to display it as if it were in the target timezone.\n * Returns `undefined` if either the input date or timezone is falsy.\n *\n * @example\n * ```html\n * <span>{{ systemDate | systemDateToTargetDate:'America/New_York' | date:'short' }}</span>\n * <!-- Output: the date/time as it appears in the New York timezone -->\n * ```\n */\n@Pipe({\n name: 'systemDateToTargetDate',\n standalone: true,\n pure: false\n})\nexport class SystemDateToTargetDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).systemDateToTargetDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe, type Minutes, MINUTES_IN_DAY, MINUTES_IN_HOUR } from '@dereekb/util';\n\n/**\n * Converts a numeric minute value into a human-readable duration string with automatic unit scaling.\n *\n * - Values over 3600 minutes are displayed as days (e.g., \"~2 days\")\n * - Values over 180 minutes are displayed as hours (e.g., \"~4 hours\")\n * - Values at or below 180 minutes are displayed as minutes (e.g., \"90 minutes\")\n *\n * A `~` prefix is added when the value is rounded up. Returns `undefined` for `null` or non-numeric input.\n *\n * @example\n * ```html\n * <span>{{ 90 | minutesString }}</span>\n * <!-- Output: \"90 minutes\" -->\n *\n * <span>{{ 250 | minutesString }}</span>\n * <!-- Output: \"~5 hours\" -->\n *\n * <span>{{ 5000 | minutesString }}</span>\n * <!-- Output: \"~4 days\" -->\n * ```\n */\n@Pipe({\n name: 'minutesString',\n standalone: true,\n pure: false\n})\nexport class MinutesStringPipe implements PipeTransform {\n transform(input: Maybe<Minutes | string>): Maybe<string> {\n const minutes = Number(input);\n\n let result: Maybe<string>;\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > MINUTES_IN_DAY * 2.5) {\n const unrounded = minutes / MINUTES_IN_DAY;\n const days = Math.ceil(unrounded);\n result = (unrounded !== days ? '~' : '') + days + ' days';\n } else if (minutes > MINUTES_IN_HOUR * 3) {\n const unrounded = minutes / MINUTES_IN_HOUR;\n const hours = Math.ceil(unrounded);\n result = (unrounded !== hours ? '~' : '') + hours + ' hours';\n } else {\n result = minutes + ' minutes';\n }\n }\n\n return result;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe, type DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n/**\n * Formats the distance from now to a future date as a countdown string.\n *\n * If the target date is in the past, returns the `soonString` (defaults to `\"Soon\"`).\n * Otherwise, returns a human-readable distance string with suffix (e.g., \"in 3 hours\").\n * Returns the `unavailable` string when the input is falsy.\n *\n * @example\n * ```html\n * <span>{{ futureDate | timeCountdownDistance }}</span>\n * <!-- Output: \"in 3 hours\" or \"Soon\" if past -->\n *\n * <span>{{ futureDate | timeCountdownDistance:'Imminent':'N/A' }}</span>\n * <!-- Output: \"Imminent\" if past, \"N/A\" if null -->\n * ```\n */\n@Pipe({\n name: 'timeCountdownDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, soonString: string = 'Soon', unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n\n if (isPast(from)) {\n return soonString;\n } else {\n const to = new Date();\n return formatDistance(from, to, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n}\n\n/**\n * Formats the distance between a date and a reference date (defaults to now) as a human-readable string with suffix.\n *\n * Uses date-fns {@link formatDistance} to produce output like \"3 hours ago\" or \"in 2 days\".\n * Returns the `unavailable` string when the input is falsy.\n *\n * @example\n * ```html\n * <span>{{ someDate | timeDistance }}</span>\n * <!-- Output: \"3 hours ago\" -->\n *\n * <span>{{ someDate | timeDistance:referenceDate }}</span>\n * <!-- Output: \"2 days ago\" (relative to referenceDate) -->\n *\n * <span>{{ nullDate | timeDistance:null:'Unknown' }}</span>\n * <!-- Output: \"Unknown\" -->\n * ```\n */\n@Pipe({\n name: 'timeDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n return formatDistance(from, to ?? new Date(), {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Milliseconds, type Minutes, millisecondsToMinutes } from '@dereekb/util';\n\n/**\n * Converts a duration in milliseconds to whole minutes using {@link millisecondsToMinutes}.\n *\n * Returns the original value (0 or falsy) if the input is falsy.\n *\n * @example\n * ```html\n * <span>{{ 180000 | toMinutes }}</span>\n * <!-- Output: 3 -->\n *\n * <span>{{ durationMs | toMinutes }} min</span>\n * <!-- Output: \"5 min\" -->\n * ```\n */\n@Pipe({\n name: 'toMinutes',\n standalone: true,\n pure: true\n})\nexport class ToMinutesPipe implements PipeTransform {\n transform(milliseconds: Milliseconds): Minutes {\n let result: Minutes = milliseconds;\n\n if (milliseconds) {\n result = millisecondsToMinutes(milliseconds);\n }\n\n return result;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Formats a value as a pretty-printed JSON string using {@link JSON.stringify} with configurable indentation.\n *\n * Returns `undefined` for falsy input. If serialization fails, returns `'ERROR'` and logs the error to the console.\n *\n * @example\n * ```html\n * <pre>{{ myObject | prettyjson }}</pre>\n * <!-- Output: formatted JSON with 2-space indentation -->\n *\n * <pre>{{ myObject | prettyjson:4 }}</pre>\n * <!-- Output: formatted JSON with 4-space indentation -->\n * ```\n */\n@Pipe({\n name: 'prettyjson',\n standalone: true\n})\nexport class PrettyJsonPipe implements PipeTransform {\n public static toPrettyJson(input: Maybe<unknown>, spacing: number = 2): Maybe<string> {\n let json: Maybe<string>;\n\n if (input) {\n try {\n json = JSON.stringify(input, null, spacing);\n } catch {\n console.error('prettyjson pipe failed parsing input: ', input);\n json = 'ERROR';\n }\n }\n\n return json;\n }\n\n transform(input: Maybe<unknown>, spacing?: number): Maybe<string> {\n return PrettyJsonPipe.toPrettyJson(input, spacing);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { cutString, type Maybe } from '@dereekb/util';\n\n/**\n * Truncates the input string to a maximum length and appends an ellipsis (or custom suffix) using {@link cutString}.\n *\n * Returns the original value if the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ 'Hello World' | cutText:5 }}</span>\n * <!-- Output: \"Hello...\" -->\n *\n * <span>{{ longText | cutText:20:'--' }}</span>\n * <!-- Output: \"Some long text here--\" -->\n * ```\n */\n@Pipe({\n name: 'cutText',\n standalone: true,\n pure: true\n})\nexport class CutTextPipe implements PipeTransform {\n transform(input: Maybe<string>, maxLength: number, endText?: Maybe<string>): Maybe<string> {\n return input != null ? cutString(input, maxLength, endText) : input;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type GetterOrValue, getValueFromGetter } from '@dereekb/util';\n\n/**\n * Resolves a {@link GetterOrValue} to its underlying value using {@link getValueFromGetter}.\n *\n * This is an impure pipe that re-evaluates on every change detection cycle, making it suitable\n * for getter functions whose return value may change over time.\n * Use {@link GetValueOncePipe} (`getValueOnce`) for a pure alternative when the value is static.\n *\n * @example\n * ```html\n * <span>{{ myGetterOrValue | getValue }}</span>\n * <span>{{ myGetterFn | getValue:someArg }}</span>\n * ```\n */\n@Pipe({\n name: 'getValue',\n standalone: true,\n pure: false\n})\nexport class GetValuePipe implements PipeTransform {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return getValueFromGetter(input as any, args);\n }\n}\n\n/**\n * Resolves a {@link GetterOrValue} to its underlying value using {@link getValueFromGetter}.\n *\n * This is a pure pipe that only re-evaluates when the input reference changes.\n * Use {@link GetValuePipe} (`getValue`) if the getter function's return value may change between cycles.\n *\n * @example\n * ```html\n * <span>{{ myGetterOrValue | getValueOnce }}</span>\n * ```\n */\n@Pipe({\n name: 'getValueOnce',\n standalone: true,\n pure: true\n})\nexport class GetValueOncePipe implements PipeTransform {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return getValueFromGetter(input as any, args);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { dollarAmountString, type Maybe } from '@dereekb/util';\n\n/**\n * Formats a numeric value as a US dollar currency string using {@link dollarAmountString}.\n *\n * Optionally accepts a default string to display when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ 19.5 | dollarAmount }}</span>\n * <!-- Output: \"$19.50\" -->\n *\n * <span>{{ nullValue | dollarAmount:'N/A' }}</span>\n * <!-- Output: \"N/A\" -->\n * ```\n */\n@Pipe({\n name: 'dollarAmount',\n standalone: true,\n pure: true\n})\nexport class DollarAmountPipe implements PipeTransform {\n transform(input: Maybe<number>, defaultIfNull?: Maybe<string>): Maybe<string> {\n return defaultIfNull == null || input != null ? dollarAmountString(input) : defaultIfNull;\n }\n}\n","import { type Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive } from '@angular/core';\nimport { type FilterSourceConnector, type FilterSource, filterMaybe } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { completeOnDestroy } from '../rxjs';\n\n/**\n * Abstract directive implementing both {@link FilterSourceConnector} and {@link FilterSource}.\n *\n * Receives a filter source via {@link connectWithSource} and re-emits its filter values.\n * Subclass to create concrete connector directives.\n *\n * @typeParam F - The filter type.\n *\n * @example\n * ```html\n * <div dbxFilterSourceConnector>\n * <!-- Child components can inject FilterSource to read the connected filter -->\n * </div>\n * ```\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, FilterSource<F> {\n private readonly _source = completeOnDestroy(new BehaviorSubject<Maybe<FilterSource<F>>>(undefined));\n\n readonly filter$: Observable<F> = this._source.pipe(\n switchMap((x) => x?.filter$ ?? of(undefined)),\n filterMaybe(),\n shareReplay(1)\n );\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n}\n","import { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\nimport { forwardRef, type Provider, type Type } from '@angular/core';\n\n/**\n * Creates Angular providers that register a {@link FilterSource} implementation for DI.\n *\n * @param sourceType - The concrete filter source class to provide.\n * @returns An array of Angular providers for the filter source.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myFilterSource]',\n * providers: provideFilterSource(MyFilterSourceDirective),\n * })\n * export class MyFilterSourceDirective { ... }\n * ```\n */\nexport function provideFilterSource<S extends FilterSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n/**\n * Creates Angular providers that register both a {@link FilterSourceConnector} and {@link FilterSource} for DI.\n *\n * @param sourceType - The concrete connector class to provide.\n * @returns An array of Angular providers for the filter source connector.\n */\nexport function provideFilterSourceConnector<S extends FilterSourceConnector>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, forwardRef, inject, InjectionToken, Injector, type OnDestroy, type Provider, type Type } from '@angular/core';\nimport { type FilterSource, FilterSourceInstance, type MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { provideFilterSource } from './filter.content';\n\n/**\n * DI token for providing a default filter value to {@link AbstractFilterSourceDirective}.\n */\nexport const FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN = new InjectionToken<Maybe<Observable<Maybe<unknown>>>>('FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_SOURCE_TOKEN');\n\n/**\n * Abstract class defining the contract for a filter source directive that can be set, reset, and initialized with filters.\n *\n * @typeParam F - The filter type.\n */\nexport abstract class FilterSourceDirective<F = unknown> implements FilterSource<F> {\n abstract readonly filter$: Observable<F>;\n abstract initWithFilter(filterObs: Observable<F>): void;\n abstract setFilter(filter: F): void;\n abstract resetFilter(): void;\n}\n\n/**\n * Factory function type for creating a default filter value, given access to the Angular injector.\n *\n * @typeParam F - The filter type.\n */\nexport type ProvideFilterSourceDirectiveDefaultFilterFactoryFunction<F = unknown> = (injector: Injector) => MaybeObservableOrValue<F>;\n\n/**\n * Creates Angular providers for a {@link FilterSourceDirective} implementation,\n * with an optional factory for providing a default filter value.\n *\n * @param sourceType - The concrete directive class.\n * @param defaultFilterFactory - Optional factory to provide an initial filter value via DI.\n * @returns An array of Angular providers for the filter source directive.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myFilterSource]',\n * providers: provideFilterSourceDirective(MyFilterSourceDirective),\n * })\n * export class MyFilterSourceDirective extends AbstractFilterSourceDirective<MyFilter> {}\n * ```\n */\nexport function provideFilterSourceDirective<S extends FilterSourceDirective<F>, F = unknown>(sourceType: Type<S>, defaultFilterFactory?: ProvideFilterSourceDirectiveDefaultFilterFactoryFunction): Provider[] {\n const providers = [\n {\n provide: FilterSourceDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideFilterSource(sourceType)\n ];\n\n if (defaultFilterFactory != null) {\n providers.push({\n provide: FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN,\n useFactory: defaultFilterFactory,\n deps: [Injector]\n });\n }\n\n return providers;\n}\n\n/**\n * Abstract directive providing a complete {@link FilterSource} implementation backed by a {@link FilterSourceInstance}.\n *\n * Supports setting/resetting filters, initializing from an external observable, and providing\n * a default filter via the {@link FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN} DI token.\n *\n * @typeParam F - The filter type.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F = unknown> implements FilterSourceDirective<F>, OnDestroy {\n private readonly _defaultFilter = inject<MaybeObservableOrValue<F>>(FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN, { optional: true });\n\n protected readonly _defaultFilterSource = new FilterSourceInstance<F>({\n defaultFilter: this._defaultFilter\n });\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\n }\n\n protected setDefaultFilter(defaultFilter: Observable<Maybe<F>>): void {\n this._defaultFilterSource.setDefaultFilter(defaultFilter);\n console.log('Setting default filter: ', defaultFilter);\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this._defaultFilterSource.initWithFilter(filterObs);\n }\n\n setFilter(filter: F): void {\n this._defaultFilterSource.setFilter(filter);\n }\n\n resetFilter(): void {\n this._defaultFilterSource.resetFilter();\n }\n\n setInitialFilterTakesPriority(initialFilterTakesPriority: boolean) {\n this._defaultFilterSource.setInitialFilterTakesPriority(initialFilterTakesPriority);\n }\n}\n","import { Directive, type OnInit, inject } from '@angular/core';\nimport { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\n\n/**\n * Connects the host element's {@link FilterSource} to an ancestor {@link FilterSourceConnector} on initialization.\n *\n * Place on an element that has a `FilterSource` (via `host: true`) to automatically\n * wire it up to a parent `FilterSourceConnector`.\n *\n * @example\n * ```html\n * <div dbxFilterSourceConnector>\n * <my-filter-form dbxFilterSource dbxFilterConnectSource></my-filter-form>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterConnectSource]',\n standalone: true\n})\nexport class DbxFilterConnectSourceDirective<F = unknown> implements OnInit {\n readonly filterSource = inject(FilterSource<F>, { host: true });\n readonly filterSourceConnector = inject(FilterSourceConnector<F>);\n\n ngOnInit(): void {\n this.filterSourceConnector.connectWithSource(this.filterSource);\n }\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\n\n/**\n * Concrete directive that acts as both a {@link FilterSource} and {@link FilterSourceConnector}.\n *\n * Place on an element to bridge a filter source from one part of the template to another.\n *\n * @example\n * ```html\n * <div dbxFilterSourceConnector>\n * <my-list-component></my-list-component>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterSourceConnectorDirective<F = unknown> extends AbstractFilterSourceConnectorDirective<F> {}\n","import { filterMaybe, type FilterMapKey, FilterMap, type MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { Directive, type OnDestroy, inject } from '@angular/core';\nimport { BehaviorSubject, distinctUntilChanged } from 'rxjs';\n\n/**\n * Abstract directive that resolves a specific filter instance from a parent {@link FilterMap} by key.\n *\n * Subclasses set the key via {@link setFilterMapKey} and access the resolved instance via `instance$`.\n *\n * @typeParam F - The filter type.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n readonly dbxFilterMap = inject(FilterMap<F>);\n private readonly _currentFilterMapKey = new BehaviorSubject<MaybeObservableOrValue<FilterMapKey>>(undefined);\n\n readonly filterMapKey$ = this._currentFilterMapKey.pipe(maybeValueFromObservableOrValue(), filterMaybe(), distinctUntilChanged());\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.filterMapKey$);\n\n ngOnDestroy(): void {\n this._currentFilterMapKey.complete();\n }\n\n setFilterMapKey(filterMapKey: MaybeObservableOrValue<FilterMapKey>) {\n this._currentFilterMapKey.next(filterMapKey);\n }\n}\n","import { type FilterSource, type FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, type Observable } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { provideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Abstract directive that extends {@link AbstractDbxFilterMapInstanceDirective} to also implement {@link FilterSource},\n * emitting the filter values from the resolved filter map instance.\n *\n * @typeParam F - The filter type.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap((x) => x.filter$));\n\n initWithFilter(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n}\n\n/**\n * Concrete directive that provides a {@link FilterSource} from a keyed entry in a parent {@link FilterMap}.\n *\n * @example\n * ```html\n * <div dbxFilterMap>\n * <div [dbxFilterMapSource]=\"'listFilter'\">\n * <my-filtered-list></my-filtered-list>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [provideFilterSource(DbxFilterMapSourceDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSource<F> {\n readonly dbxFilterMapSource = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSource()));\n}\n","import { first } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { type FilterSourceConnector, type FilterSource, type FilterMapKey } from '@dereekb/rxjs';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\nimport { AbstractDbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Directive that acts as both a {@link FilterSourceConnector} and {@link FilterSource} for a keyed entry in a parent {@link FilterMap}.\n *\n * Connects an external filter source to a specific filter map entry and re-emits that entry's filter.\n *\n * @example\n * ```html\n * <div dbxFilterMap>\n * <div [dbxFilterMapSourceConnector]=\"'myList'\">\n * <my-list-component></my-list-component>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n readonly dbxFilterMapSourceConnector = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceConnectorEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSourceConnector()));\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => {\n x.connectWithSource(filterSource);\n\n if (filterSource.initWithFilter) {\n filterSource.initWithFilter(this.filter$);\n }\n });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Directive that provides a {@link FilterMap} instance for managing multiple named filter sources.\n *\n * Child directives like `dbxFilterMapSource` and `dbxFilterMapSourceConnector` look up this\n * map via DI to register and retrieve filter instances by key.\n *\n * @example\n * ```html\n * <div dbxFilterMap>\n * <div [dbxFilterMapSource]=\"'listA'\">...</div>\n * <div [dbxFilterMapSource]=\"'listB'\">...</div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap],\n standalone: true\n})\nexport class DbxFilterMapDirective<F> {\n readonly filterMap = clean(inject(FilterMap<F>));\n}\n","import { type FilterPresetStringRef, type FilterWithPreset, type FilterWithPresetOptional } from '@dereekb/rxjs';\nimport { type EmptyObject, type GetterOrValue, type Maybe, objectHasKey, objectHasKeys } from '@dereekb/util';\nimport { type ClickableAnchorLink } from '../router/anchor/anchor';\n\n/**\n * A clickable preset that applies a predefined filter value when selected.\n *\n * Combines display properties (title, icon, disabled) with a filter preset value.\n * A `null` or empty `presetValue` resets the filter.\n *\n * @typeParam F - The filter type, which must include a preset field.\n * @typeParam P - The preset string identifier type.\n *\n * @example\n * ```typescript\n * const preset: ClickableFilterPreset<MyFilter> = {\n * preset: 'active',\n * title: 'Active Items',\n * icon: 'check',\n * presetValue: { status: 'active', preset: 'active' },\n * };\n * ```\n */\nexport interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef<P> {\n /**\n * GetterOrValue that retrieves the filter for this preset.\n *\n * A null value or empty object is used for reset.\n */\n readonly presetValue: GetterOrValue<FilterWithPresetOptional<F>> | EmptyObject | null;\n}\n\n/**\n * Type guard that checks if an object is a {@link ClickableFilterPreset}.\n *\n * @param preset - The object to check.\n * @returns `true` if the object has a `presetValue` property.\n */\nexport function isClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string>(preset: object): preset is ClickableFilterPreset<F, P> {\n return objectHasKey(preset, 'presetValue');\n}\n\n/**\n * A clickable preset that applies a partial filter modification when selected,\n * with an `isActive` predicate to determine whether the preset is currently active.\n *\n * Unlike {@link ClickableFilterPreset}, this merges a partial value rather than replacing the full filter.\n *\n * @typeParam F - The filter type.\n */\nexport interface ClickablePartialFilterPreset<F> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'> {\n /**\n * GetterOrValue that retrieves the partial filter value.\n *\n * A null value or empty object is used for no change.\n */\n readonly partialPresetValue: GetterOrValue<Partial<F>> | EmptyObject | null;\n /**\n * The current value to test against. Returns true if this partial preset is considered active.\n */\n readonly isActive: (currentFilter: Maybe<Partial<F>>) => boolean;\n}\n\n/**\n * Type guard that checks if an object is a {@link ClickablePartialFilterPreset}.\n *\n * @param preset - The object to check.\n * @returns `true` if the object has `partialPresetValue` and `isActive` properties.\n */\nexport function isClickablePartialFilterPreset<F>(preset: object): preset is ClickablePartialFilterPreset<F> {\n return objectHasKeys(preset, ['partialPresetValue', 'isActive']);\n}\n\n/**\n * Convenience type for either a ClickableFilterPreset or a ClickablePartialFilterPreset of the same type.\n */\nexport type ClickableFilterPresetOrPartialPreset<F extends FilterWithPreset<P>, P extends string = string> = ClickableFilterPreset<F, P> | ClickablePartialFilterPreset<F>;\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceDirective, provideFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Provides a {@link FilterSource} in the DI tree, allowing child components to inject and consume filter state.\n *\n * @example\n * ```html\n * <div dbxFilterSource>\n * <my-list-component></my-list-component>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: provideFilterSourceDirective(DbxFilterSourceDirective),\n standalone: true\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {}\n","import { NgModule } from '@angular/core';\nimport { DbxFilterMapDirective } from './filter.map.directive';\nimport { DbxFilterMapSourceConnectorDirective } from './filter.map.connector.directive';\nimport { DbxFilterSourceDirective } from './filter.source.directive';\nimport { DbxFilterSourceConnectorDirective } from './filter.connector.directive';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { DbxFilterConnectSourceDirective } from './filter.connect.source.directive';\n\nconst importsAndExports = [DbxFilterSourceDirective, DbxFilterMapSourceConnectorDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceDirective];\n\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreFilterModule {}\n","import { InjectionToken, type Injector, type NgModuleRef, type StaticProvider, type TemplateRef, type Type, type ViewRef } from '@angular/core';\nimport { type Configurable, type EqualityComparatorFunction, type FactoryWithRequiredInput, filterMaybeArrayValues, type Maybe, mergeArrays, mergeObjects, safeEqualityComparatorFunction } from '@dereekb/util';\n\n/**\n * Injection token used to provide arbitrary data to dynamically created components.\n *\n * Components created via {@link DbxInjectionComponentConfig} can inject this token\n * to access the `data` property from their configuration.\n *\n * @example\n * ```typescript\n * // In a dynamically injected component:\n * readonly data = inject(DBX_INJECTION_COMPONENT_DATA);\n * ```\n */\nexport const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');\n\n/**\n * Configuration for dynamically creating and injecting an Angular component into a view container.\n *\n * This is the primary configuration interface for the dbx-injection system. It describes which component\n * to create, how to configure its dependency injection context, and how to initialize it after creation.\n *\n * @typeParam T - The type of the component being created.\n *\n * @see {@link DbxInjectionInstance} - The runtime engine that processes this configuration.\n * @see {@link DbxInjectionComponent} - The component that accepts this configuration as an input.\n *\n * @example\n * ```typescript\n * const config: DbxInjectionComponentConfig<MyComponent> = {\n * componentClass: MyComponent,\n * data: { id: 123 },\n * init: (instance) => { instance.title = 'Hello'; }\n * };\n * ```\n */\nexport interface DbxInjectionComponentConfig<T = unknown> {\n /**\n * The Angular component class to dynamically instantiate.\n */\n readonly componentClass: Type<T>;\n /**\n * Optional static providers to add to the injector used when creating the component.\n *\n * These providers are merged with any data provider and made available to the created component.\n */\n readonly providers?: Maybe<StaticProvider[]>;\n /**\n * Optional custom parent injector to use when creating the component.\n *\n * When not provided, the injector from the host {@link DbxInjectionInstance} is used.\n */\n readonly injector?: Maybe<Injector>;\n /**\n * Optional NgModule reference to associate with the created component.\n *\n * Useful when the component belongs to a lazily loaded module.\n */\n readonly ngModuleRef?: NgModuleRef<unknown>;\n /**\n * Optional initialization callback invoked after the component is created.\n *\n * This is called within the Angular injection context of the created component,\n * so `inject()` is available and any `DestroyRef` callbacks registered inside\n * will be cleaned up when the created component is destroyed.\n */\n readonly init?: Maybe<(instance: T) => void>;\n /**\n * Optional arbitrary data to inject into the component via the {@link DBX_INJECTION_COMPONENT_DATA} token.\n */\n readonly data?: Maybe<unknown>;\n}\n\n/**\n * A variant of {@link DbxInjectionComponentConfig} that omits the `injector` property.\n *\n * Used in scenarios where the injection site controls the parent injector and does not\n * allow the configuration to override it (e.g., when the host component must be the injection root).\n *\n * @typeParam T - The type of the component being created.\n */\nexport type DbxInjectionComponentConfigWithoutInjector<T = unknown> = Omit<DbxInjectionComponentConfig<T>, 'injector'>;\n\n/**\n * A factory function that produces a {@link DbxInjectionComponentConfig} from a required input value.\n *\n * @typeParam I - The input type required by the factory.\n * @typeParam T - The type of the component the produced config will create.\n */\nexport type DbxInjectionComponentConfigFactory<I, T = unknown> = FactoryWithRequiredInput<DbxInjectionComponentConfig<T>, I>;\n\n/**\n * Configuration for injecting a template or view reference into a view container.\n *\n * This is an alternative to {@link DbxInjectionComponentConfig} for cases where you want to\n * display a pre-existing template or view rather than dynamically creating a component.\n *\n * @typeParam T - The context type of the template reference.\n *\n * @example\n * ```typescript\n * const config: DbxInjectionTemplateConfig = {\n * templateRef: myTemplateRef\n * };\n * ```\n */\nexport interface DbxInjectionTemplateConfig<T = unknown> {\n /**\n * An Angular `TemplateRef` to render as an embedded view.\n */\n readonly templateRef?: Maybe<TemplateRef<T>>;\n /**\n * A pre-existing `ViewRef` to insert into the container.\n */\n readonly viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Compares two {@link DbxInjectionComponentConfig} values for structural equality, safely handling nullish values.\n *\n * Compares `componentClass`, `data`, `init`, and `injector` by reference. Does NOT compare\n * `providers` or `ngModuleRef`, as provider arrays typically change on every list data update\n * (e.g., with new `DBX_VALUE_LIST_VIEW_ITEM` values) without requiring component recreation.\n *\n * When both values are nullish, uses strict equality (`null === null` is `true`,\n * `null === undefined` is `false`). The comparator is only invoked when both are non-nullish.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const dbxInjectionComponentConfigIsEqual: EqualityComparatorFunction<Maybe<DbxInjectionComponentConfig<any>>> = safeEqualityComparatorFunction((a, b) => a.componentClass === b.componentClass && a.data === b.data && a.init === b.init && a.injector === b.injector);\n\n/**\n * Merges multiple partial {@link DbxInjectionComponentConfig} objects into a single configuration.\n *\n * Provider arrays are concatenated so that all providers from all configs are preserved.\n * All other properties are merged with later values taking precedence.\n *\n * @param configs - An array of partial configs to merge. May contain `undefined`/`null` entries which are filtered out.\n * @returns A single merged partial configuration.\n */\nexport function mergeDbxInjectionComponentConfigs<T = unknown>(configs: Maybe<Partial<DbxInjectionComponentConfig<T>>>[]): Partial<DbxInjectionComponentConfig<T>> {\n const providers = mergeArrays(filterMaybeArrayValues(configs).map((x) => x.providers));\n const result = mergeObjects(configs) as Configurable<DbxInjectionComponentConfig<T>>;\n result.providers = providers;\n return result;\n}\n","import { type StaticProvider } from '@angular/core';\nimport { type ArrayOrValue, flattenArrayOrValueArray, type Maybe } from '@dereekb/util';\n\n/**\n * Flattens and merges multiple provider sources into a single `StaticProvider[]` array.\n *\n * Each argument can be a single `StaticProvider`, an array of providers, or `undefined`/`null`.\n * All values are flattened into a single array with nullish entries removed.\n *\n * @param providers - Any number of provider values or arrays to merge.\n * @returns A flat array of all non-nullish static providers.\n *\n * @example\n * ```typescript\n * const providers = mergeStaticProviders(\n * { provide: TOKEN_A, useValue: 'a' },\n * undefined,\n * [{ provide: TOKEN_B, useValue: 'b' }]\n * );\n * // Result: [{ provide: TOKEN_A, useValue: 'a' }, { provide: TOKEN_B, useValue: 'b' }]\n * ```\n */\nexport function mergeStaticProviders(...providers: Maybe<ArrayOrValue<StaticProvider>>[]): StaticProvider[] {\n return flattenArrayOrValueArray<StaticProvider>(providers);\n}\n","import { type ComponentRef, Injector, runInInjectionContext, type ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig, DBX_INJECTION_COMPONENT_DATA, dbxInjectionComponentConfigIsEqual } from './injection';\nimport { type Initialized, type Destroyable, type Maybe } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, SubscriptionObject, filterMaybe, maybeValueFromObservableOrValueGetter, skipAllInitialMaybe } from '@dereekb/rxjs';\nimport { mergeStaticProviders } from './injection.util';\n\n/**\n * Core runtime engine for the dbx-injection system. Manages the lifecycle of dynamically injected\n * components and templates within an Angular `ViewContainerRef`.\n *\n * This class reactively listens to configuration and template observables. When a new\n * {@link DbxInjectionComponentConfig} or {@link DbxInjectionTemplateConfig} is emitted, it tears\n * down the previous content and creates the new component or template in the target view container.\n *\n * Component configs take precedence over template configs when both are provided.\n *\n * Typically used internally by {@link AbstractDbxInjectionDirective} and {@link DbxInjectionComponent}\n * rather than consumed directly.\n *\n * @typeParam T - The type of the dynamically created component.\n *\n * @see {@link DbxInjectionComponentConfig}\n * @see {@link DbxInjectionTemplateConfig}\n * @see {@link AbstractDbxInjectionDirective}\n */\nexport class DbxInjectionInstance<T> implements Initialized, Destroyable {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n private readonly _config = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>>(undefined);\n private readonly _template = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>>(undefined);\n\n private readonly _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private readonly _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n private readonly _injector: Injector;\n\n readonly config$ = this._config.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(dbxInjectionComponentConfigIsEqual), shareReplay(1));\n readonly template$ = this._template.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(), shareReplay(1));\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>) {\n this._template.next(template);\n }\n\n get content(): Maybe<Maybe<ViewContainerRef>> {\n return this._content.value;\n }\n\n set content(content: Maybe<Maybe<ViewContainerRef>>) {\n this._content.next(content);\n }\n\n get componentRef(): Maybe<ComponentRef<T>> {\n return this._componentRef.value;\n }\n\n set componentRef(componentRef: Maybe<ComponentRef<T>>) {\n this._componentRef.next(componentRef);\n }\n\n constructor(injector: Injector) {\n this._injector = injector;\n }\n\n init(): void {\n // Wait until the first of either of the two inputs comes in as not defined, and then emit.\n // We filter the first maybe here between the two items.\n const configTemplateObs = combineLatest([this.config$, this.template$]).pipe(\n map(([config, template]) => {\n if (config || template) {\n return {\n config,\n template\n };\n } else {\n return undefined;\n }\n }),\n skipAllInitialMaybe()\n );\n\n this._subscriptionObject.subscription = combineLatest([configTemplateObs, this.content$]).subscribe(([inputConfig, content]) => {\n const { config, template } = inputConfig ?? {};\n this._reset(content);\n\n if (config) {\n this._initComponent(config, content);\n } else if (template) {\n this._initTemplate(template, content);\n }\n });\n }\n\n destroy(): void {\n this._subscriptionObject.destroy();\n this._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectionComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n if (!componentClass) {\n throw new Error('DbxInjectionInstance: componentClass was expected in the config but it was unavailable.');\n }\n\n const parentInjector = inputInjector ?? this._injector;\n let injector: Injector | undefined = parentInjector;\n\n if (providers || data) {\n const dataProvider = {\n provide: DBX_INJECTION_COMPONENT_DATA,\n useValue: data\n };\n\n injector = Injector.create({\n parent: parentInjector,\n providers: mergeStaticProviders(dataProvider, providers)\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n const instance = componentRef.instance;\n\n if (init) {\n runInInjectionContext(componentRef.injector, () => init(instance));\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectionTemplateConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { templateRef, viewRef } = config;\n\n if (templateRef) {\n content.createEmbeddedView(templateRef);\n\n // TODO: Figure out if these items need to be destroyed or not when this item is destroyed. If so, we need a reference to destroy.\n } else if (viewRef) {\n content.insert(viewRef);\n }\n }\n\n private _reset(content: ViewContainerRef): void {\n if (this.componentRef) {\n content.clear();\n this.componentRef = undefined;\n }\n }\n}\n","import { type ViewContainerRef, type OnInit, type OnDestroy, Directive, Injector, inject } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig } from './injection';\nimport { DbxInjectionInstance as DbxInjectionInstance } from './injection.instance';\nimport { type ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Abstract base directive for dynamically injecting components or templates into a view.\n *\n * Manages a {@link DbxInjectionInstance} lifecycle, initializing it on `ngOnInit` and\n * destroying it on `ngOnDestroy`. Subclasses are responsible for wiring their inputs\n * (config, template, content) to the corresponding setter methods.\n *\n * @typeParam T - The type of the dynamically created component.\n *\n * @see {@link DbxInjectionComponent} - The concrete standalone component implementation.\n * @see {@link DbxInjectionInstance}\n */\n@Directive()\nexport abstract class AbstractDbxInjectionDirective<T> implements OnInit, OnDestroy {\n private readonly _instance = new DbxInjectionInstance<T>(inject(Injector));\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n /**\n * Sets the component injection configuration on the underlying {@link DbxInjectionInstance}.\n *\n * @param config - The component config, observable, or getter to use.\n */\n setConfig(config: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>) {\n this._instance.config = config;\n }\n\n /**\n * Sets the template injection configuration on the underlying {@link DbxInjectionInstance}.\n *\n * @param template - The template config, observable, or getter to use.\n */\n setTemplate(template: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>) {\n this._instance.template = template;\n }\n\n /**\n * Sets the target `ViewContainerRef` where dynamic content will be inserted.\n *\n * @param content - The view container reference for content projection.\n */\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n}\n","import { ChangeDetectionStrategy, Component, ViewContainerRef, input, viewChild, effect } from '@angular/core';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig } from './injection';\nimport { AbstractDbxInjectionDirective } from './injection.directive';\nimport { type Maybe } from '@dereekb/util';\nimport { type ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Standalone component for dynamically injecting a component or template into the DOM.\n *\n * Accepts a {@link DbxInjectionComponentConfig} (to create a component) or a\n * {@link DbxInjectionTemplateConfig} (to embed a template/view). When the config changes,\n * the previous content is destroyed and the new content is created in its place.\n *\n * Can be used as an element (`<dbx-injection>`) or as an attribute directive\n * (`[dbxInjection]` / `[dbx-injection]`).\n *\n * @typeParam T - The type of the dynamically created component.\n *\n * @example\n * ```html\n * <!-- Element usage with a component config -->\n * <dbx-injection [config]=\"myComponentConfig\"></dbx-injection>\n *\n * <!-- Element usage with a template config -->\n * <dbx-injection [template]=\"myTemplateConfig\"></dbx-injection>\n *\n * <!-- Attribute usage -->\n * <div dbxInjection [config]=\"myComponentConfig\"></div>\n * ```\n *\n * @see {@link DbxInjectionComponentConfig}\n * @see {@link DbxInjectionTemplateConfig}\n * @see {@link AbstractDbxInjectionDirective}\n */\n@Component({\n selector: 'dbx-injection, [dbxInjection], [dbx-injection]',\n template: `\n <ng-template #content></ng-template>\n `,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxInjectionComponent<T> extends AbstractDbxInjectionDirective<T> {\n /**\n * Reference to the internal view container where dynamic content is projected.\n */\n readonly content = viewChild('content', { read: ViewContainerRef });\n\n /**\n * The component injection configuration. Accepts an observable, getter, or static value.\n */\n readonly config = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>>();\n\n /**\n * The template injection configuration. Accepts an observable, getter, or static value.\n * Only used when `config` is not provided.\n */\n readonly template = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>>();\n\n // allow signal writes for each as during their initialization they may write to a signal in some cases when initializing\n protected readonly _contentEffect = effect(() => this.setContent(this.content()));\n protected readonly _configEffect = effect(() => this.setConfig(this.config()));\n protected readonly _templateEffect = effect(() => this.setTemplate(this.template()));\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { type DbxInjectionArrayEntry } from './injection.array';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxInjectionComponent } from './injection.component';\n\n/**\n * Renders a list of dynamically injected components from an array of {@link DbxInjectionArrayEntry} items.\n *\n * Each entry is tracked by its `key` property for efficient change detection, and rendered\n * using a nested {@link DbxInjectionComponent}.\n *\n * @example\n * ```html\n * <dbx-injection-array [entries]=\"myEntries\" />\n * ```\n *\n * @example\n * ```typescript\n * // In the host component:\n * myEntries: DbxInjectionArrayEntry[] = [\n * { key: 'chart', injectionConfig: { componentClass: ChartComponent } },\n * { key: 'table', injectionConfig: { componentClass: TableComponent } }\n * ];\n * ```\n *\n * @see {@link DbxInjectionArrayEntry}\n * @see {@link DbxInjectionComponent}\n */\n@Component({\n selector: 'dbx-injection-array',\n template: `\n @for (entry of entries(); track entry.key) {\n <dbx-injection [config]=\"entry.injectionConfig\"></dbx-injection>\n }\n `,\n imports: [DbxInjectionComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxInjectionArrayComponent {\n /**\n * The array of keyed injection entries to render. Each entry produces a `<dbx-injection>` component.\n */\n readonly entries = input<Maybe<DbxInjectionArrayEntry[]>>(undefined);\n}\n","import { type Provider, type Type } from '@angular/core';\nimport { type DbxInjectionComponentConfig } from './injection';\n\n/**\n * Configuration for temporarily showing a dynamically injected component via {@link DbxInjectionContext.showContext}.\n *\n * Defines both the component to inject and a `use` callback that interacts with the created instance.\n * The injected view is displayed until the promise returned by `use` resolves, at which point\n * the original content is restored.\n *\n * @typeParam T - The type of the component being injected.\n * @typeParam O - The type of the value resolved by the `use` promise.\n *\n * @example\n * ```typescript\n * const contextConfig: DbxInjectionContextConfig<MyEditorComponent, string> = {\n * config: { componentClass: MyEditorComponent },\n * use: async (editor) => {\n * return await editor.waitForUserInput();\n * }\n * };\n *\n * const result = await injectionContext.showContext(contextConfig);\n * ```\n */\nexport interface DbxInjectionContextConfig<T = unknown, O = unknown> {\n /**\n * The {@link DbxInjectionComponentConfig} describing which component to create and how to configure it.\n */\n config: DbxInjectionComponentConfig<T>;\n /**\n * Callback invoked with the created component instance. The returned promise controls how long\n * the injected view remains visible; the original content is restored once it resolves.\n */\n use: (instance: T) => Promise<O>;\n}\n\n/**\n * Abstract service for temporarily replacing a view's content with a dynamically injected component,\n * then restoring the original content when done.\n *\n * Unlike `*ngIf` or `*ngSwitch`, the original child content is **hidden** rather than destroyed,\n * preserving component state. Once the injected context's promise resolves (or is reset), the\n * original content is re-displayed.\n *\n * This is useful for overlay-like workflows such as inline editors, confirmation dialogs,\n * or multi-step flows where destroying and recreating the underlying view would lose state.\n *\n * @see {@link DbxInjectionContextConfig}\n * @see {@link DbxInjectionContextDirective} - The concrete structural directive implementation.\n */\nexport abstract class DbxInjectionContext {\n /**\n * Temporarily replaces the current view content with the component described by `config`.\n *\n * The original content is hidden (not destroyed) and is restored once the `use` promise\n * in the config resolves or rejects.\n *\n * @typeParam T - The type of the injected component.\n * @typeParam O - The return type of the `use` promise.\n * @param config - The context configuration describing the component and usage callback.\n * @returns A promise that resolves with the value from `config.use`.\n */\n abstract showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T>): Promise<O>;\n\n /**\n * Cancels any active context, rejecting its promise and restoring the original content.\n *\n * @returns `true` if there was an active context that was reset, `false` otherwise.\n */\n abstract resetContext(): boolean;\n}\n\n/**\n * Creates Angular providers that register a concrete {@link DbxInjectionContext} implementation\n * under the abstract `DbxInjectionContext` token via `useExisting`.\n *\n * This enables dependency injection consumers to request `DbxInjectionContext` and receive\n * the specific directive or service implementation.\n *\n * @typeParam T - The concrete type that extends {@link DbxInjectionContext}.\n * @param type - The concrete class to register as the existing provider.\n * @returns An array of Angular providers.\n */\nexport function provideDbxInjectionContext<T extends DbxInjectionContext>(type: Type<T>): Provider[] {\n return [\n {\n provide: DbxInjectionContext,\n useExisting: type\n }\n ];\n}\n","import { Directive, type EmbeddedViewRef, Injector, TemplateRef, ViewContainerRef, type OnDestroy, type OnInit, inject, effect, input } from '@angular/core';\nimport { type DbxInjectionContext, type DbxInjectionContextConfig, provideDbxInjectionContext } from './injection.context';\nimport { DbxInjectionInstance } from './injection.instance';\nimport { type DbxInjectionComponentConfig } from './injection';\nimport { type PromiseOrValue, type PromiseReference, promiseReference, type Maybe } from '@dereekb/util';\n\n/**\n * Structural directive that implements {@link DbxInjectionContext}, allowing its host content\n * to be temporarily replaced with a dynamically injected component and then restored.\n *\n * Unlike `*ngIf` or `*ngSwitch`, the original child content is **detached** (hidden) rather than\n * destroyed, so component state is preserved while the injected context is active. When the\n * context's promise resolves or {@link resetContext} is called, the original view is re-attached.\n *\n * The directive also accepts an optional `[dbxInjectionContext]` input to set a static component\n * config directly, which replaces the default content until cleared.\n *\n * @typeParam O - The output type produced by {@link showContext}.\n *\n * @example\n * ```html\n * <!-- Wrap content that should be temporarily replaceable -->\n * <div *dbxInjectionContext>\n * <p>Original content preserved while context is active</p>\n * </div>\n * ```\n *\n * @example\n * ```typescript\n * // Programmatically show a temporary editor overlay:\n * const result = await injectionContext.showContext({\n * config: { componentClass: InlineEditorComponent },\n * use: (editor) => editor.waitForSave()\n * });\n * ```\n *\n * @see {@link DbxInjectionContext}\n * @see {@link DbxInjectionContextConfig}\n */\n@Directive({\n selector: '[dbxInjectionContext]',\n providers: provideDbxInjectionContext(DbxInjectionContextDirective),\n standalone: true\n})\nexport class DbxInjectionContextDirective<O = unknown> implements DbxInjectionContext, OnInit, OnDestroy {\n private readonly _injector = inject(Injector);\n private readonly _templateRef = inject(TemplateRef<O>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n private readonly _instance = new DbxInjectionInstance(this._injector);\n\n private _currentPromise: Maybe<PromiseReference<unknown>>;\n private _embeddedView!: EmbeddedViewRef<O>;\n private _isDetached = false;\n\n /**\n * Optional static component config input. When set, the directive replaces its content\n * with the specified component. When cleared (`undefined`), the original content is restored.\n */\n readonly config = input<Maybe<DbxInjectionComponentConfig<unknown>>>();\n\n protected readonly _configEffect = effect(() => {\n this.setConfig(this.config());\n\n // NOTE: we have/call setConfig() because the effect() may not respond to all value changes,\n // especially when setConfig() ends up being called twice quickly in quick succession.\n });\n\n ngOnInit() {\n this._instance.content = this._viewContainer;\n this._instance.init();\n this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);\n\n // detach the embedded view\n this._viewContainer.detach();\n\n // reattach it through the template configuration.\n // the template configuration acts as the default.\n this._instance.template = {\n viewRef: this._embeddedView\n };\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n this._embeddedView?.destroy(); // destroy our embedded view too if it is set.\n }\n\n /**\n * {@inheritDoc DbxInjectionContext.showContext}\n *\n * @param config - The injection context configuration describing the component and its usage.\n * @returns A promise that resolves with the output of the injected component's usage.\n */\n async showContext<T, O>(config: DbxInjectionContextConfig<T>): Promise<O> {\n // clear the current context before showing something new.\n this.resetContext();\n\n let promiseRef: Maybe<PromiseReference<O>>;\n\n let result: Maybe<O>;\n let error: unknown;\n\n // wait for the promise to resolve and use to finish using that instance.\n try {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n promiseRef = promiseReference(async (resolve, reject) => {\n const injectionConfig: DbxInjectionComponentConfig<T> = {\n ...config.config,\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n init: async (instance: T) => {\n // init if available in the base config.\n if (config.config.init) {\n config.config.init(instance);\n }\n\n try {\n const result = (await config.use(instance)) as PromiseOrValue<O>;\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n\n this.setConfig(injectionConfig as DbxInjectionComponentConfig<unknown>);\n });\n\n this._currentPromise = promiseRef as PromiseReference<unknown>;\n\n // await the promise\n await promiseRef.promise;\n } catch (e) {\n error = e;\n }\n\n // if we're still using the same promiseRef\n if (promiseRef && promiseRef === this._currentPromise) {\n // clear the config to reshow the view\n this.setConfig(undefined);\n\n // clear the current promise\n this._currentPromise = undefined;\n }\n\n if (error != null) {\n return Promise.reject(error);\n } else {\n return result as O;\n }\n }\n\n /**\n * {@inheritDoc DbxInjectionContext.resetContext}\n *\n * @returns `true` if an active context was cleared, `false` otherwise.\n */\n resetContext(): boolean {\n let clearedValue = false;\n\n if (this._currentPromise) {\n const promise = this._currentPromise;\n\n // clear the current promise too\n this._currentPromise = undefined;\n\n // clear the config.\n this.setConfig(undefined);\n\n // send a rejection signal to bail out.\n promise.reject(new Error('dbxInjectionContext bailout'));\n\n clearedValue = true;\n }\n\n return clearedValue;\n }\n\n /**\n * Sets or clears the active component configuration.\n *\n * When a config is provided, the original embedded view is detached and the component is injected.\n * When `undefined` is provided, the injected component is removed and the original view is re-attached.\n *\n * @param config - The component config to display, or `undefined` to restore the original content.\n */\n setConfig(config: Maybe<DbxInjectionComponentConfig<unknown>>) {\n let reattach = false;\n\n if (config) {\n if (!this._isDetached) {\n // detach the original view before setting config.\n this._viewContainer.detach();\n this._isDetached = true;\n }\n } else if (this._isDetached) {\n reattach = true;\n }\n\n this._instance.config = config;\n\n if (reattach) {\n this._viewContainer.insert(this._embeddedView);\n this._isDetached = false;\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxInjectionContext, type DbxInjectionContextConfig } from './injection.context';\n\n/**\n * Abstract directive that delegates {@link DbxInjectionContext} operations to a host-level\n * `DbxInjectionContext` obtained via Angular's dependency injection (`{ host: true }`).\n *\n * This is useful for creating specialized injection context subtypes that can be injected\n * by their own token while still forwarding the actual show/reset behavior to a parent\n * {@link DbxInjectionContextDirective}.\n *\n * @example\n * ```typescript\n * @Directive({ providers: [{ provide: MySpecialContext, useExisting: MyForwardDirective }] })\n * class MyForwardDirective extends AbstractForwardDbxInjectionContextDirective {}\n * ```\n *\n * @see {@link DbxInjectionContext}\n * @see {@link DbxInjectionContextDirective}\n */\n@Directive()\nexport abstract class AbstractForwardDbxInjectionContextDirective implements DbxInjectionContext {\n /**\n * The host-level {@link DbxInjectionContext} that all operations are forwarded to.\n */\n readonly dbxInjectionContext = inject(DbxInjectionContext, { host: true });\n\n // MARK: DbxInjectionContext\n /**\n * {@inheritDoc DbxInjectionContext.showContext}\n *\n * @param config - The injection context configuration to forward to the host context.\n * @returns A promise that resolves with the output of the injected component's usage.\n */\n showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T, unknown>): Promise<O> {\n return this.dbxInjectionContext.showContext(config);\n }\n\n /**\n * {@inheritDoc DbxInjectionContext.resetContext}\n *\n * @returns `true` if an active context was cleared, `false` otherwise.\n */\n resetContext(): boolean {\n return this.dbxInjectionContext.resetContext();\n }\n}\n","import { asGetter, type GetterOrValue, type Maybe } from '@dereekb/util';\nimport { switchMapObject } from '@dereekb/rxjs';\nimport { type DbxInjectionComponentConfig } from './injection';\nimport { type Type } from '@angular/core';\n\n/**\n * Creates an RxJS operator that switches between injection component configs, falling back to a\n * default config when the source emits `null`, `undefined`, or `true`.\n *\n * If the `defaultConfig` resolves to a class (function), it is automatically wrapped into a\n * `{ componentClass }` config object.\n *\n * This is useful for reactive streams where an upstream value may indicate \"use the default component\"\n * rather than providing an explicit configuration.\n *\n * @typeParam T - The specific {@link DbxInjectionComponentConfig} subtype.\n * @typeParam X - The component type.\n * @param defaultConfig - A static value, getter, or component class to use as the fallback config.\n * @returns An RxJS operator compatible with `pipe()`.\n *\n * @see {@link DbxInjectionComponentConfig}\n *\n * @example\n * ```typescript\n * config$.pipe(\n * switchMapDbxInjectionComponentConfig(MyDefaultComponent)\n * ).subscribe(config => {\n * // config is always a DbxInjectionComponentConfig or undefined\n * });\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function switchMapDbxInjectionComponentConfig<T extends DbxInjectionComponentConfig<X>, X = any>(defaultConfig?: GetterOrValue<Maybe<T | Type<X>>>) {\n const defaultAsGetter = asGetter(defaultConfig);\n\n return switchMapObject<T>({\n defaultGetter: () => {\n const value = defaultAsGetter();\n\n if (typeof value === 'function') {\n // is a component class\n return { componentClass: value } as T;\n } else {\n return value;\n }\n }\n });\n}\n","import { type AbstractType, Injector, type Provider, type Type } from '@angular/core';\n\n/**\n * A type that is both an Angular injectable class (concrete or abstract) and a `Provider`,\n * making it suitable for use with `Injector.create()`.\n *\n * @typeParam T - The instance type produced by the injectable.\n */\nexport type InjectableType<T> = (Type<T> | AbstractType<T>) & Provider;\n\n/**\n * Creates a child injector with the given `type` as its sole provider and immediately\n * resolves an instance of that type.\n *\n * This is a convenience for one-off instantiation of an injectable class using a specific\n * parent injector, without needing to manually configure `Injector.create()`.\n *\n * @typeParam T - The type to instantiate.\n * @param type - The injectable class to provide and resolve.\n * @param parent - The parent injector that supplies the type's dependencies.\n * @returns A new instance of `T`.\n *\n * @example\n * ```typescript\n * const service = newWithInjector(MyService, parentInjector);\n * ```\n */\nexport function newWithInjector<T>(type: InjectableType<T>, parent: Injector): T {\n const injector = Injector.create({ providers: [type], parent });\n return injector.get(type);\n}\n","import { map, type Observable } from 'rxjs';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Inject, Optional, Injectable, type OnDestroy } from '@angular/core';\nimport { LockSet, type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { type Maybe, type Milliseconds } from '@dereekb/util';\n\n/**\n * Component or service that exposes a {@link LockSet} for coordinating lock-based state.\n */\nexport interface LockSetComponent {\n readonly lockSet: LockSet;\n}\n\n/**\n * Configuration for initializing a {@link LockSetComponentStore}'s lock set,\n * including an optional parent lock set and named lock observables.\n */\nexport interface LockSetComponentStoreConfig {\n readonly parent?: Maybe<Observable<LockSetComponent>>;\n readonly locks?: {\n [key: string]: Observable<boolean>;\n };\n}\n\n/**\n * Abstract NgRx `ComponentStore` extension that integrates a {@link LockSet} for coordinating\n * async operations and delays destruction until all locks are released.\n *\n * Subclasses call {@link setupLockSet} to register parent lock sets and named locks.\n * On destroy, the store waits for all locks to unlock before completing cleanup,\n * preventing premature teardown of in-flight operations.\n *\n * @typeParam S - The shape of the component store's state object.\n *\n * @example\n * ```typescript\n * interface MyState { items: string[]; }\n *\n * @Injectable()\n * export class MyStore extends LockSetComponentStore<MyState> {\n * constructor() {\n * super({ items: [] });\n * }\n * }\n * ```\n */\n@Injectable()\nexport abstract class LockSetComponentStore<S extends object> extends ComponentStore<S> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n protected lockSetDestroyDelayMs: Milliseconds = 2000;\n protected lockSetDestroyTimeoutMs: Maybe<Milliseconds>;\n\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() protected readonly initialState?: S) {\n super(initialState);\n }\n\n // MARK: State Changes\n readonly resetStore = this.updater(() => ({ ...this.initialState }) as S);\n\n // MARK: Locks\n protected setupLockSet({ parent, locks }: LockSetComponentStoreConfig): void {\n if (parent) {\n this.setParentLockSet(parent);\n }\n\n if (locks) {\n for (const key in locks) {\n if (locks[key]) {\n this.addLock(key, locks[key]);\n }\n }\n }\n }\n\n setParentLockSet(obs: ObservableOrValue<Maybe<LockSetComponent>>): void {\n this.lockSet.setParentLockSet(asObservable(obs).pipe(map((x) => x?.lockSet)));\n }\n\n addLock(key: string, obs: Observable<boolean>): void {\n this.lockSet.addLock(key, obs);\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.destroyOnNextUnlock(\n {\n fn: () => {\n this._destroyNow();\n },\n timeout: this.lockSetDestroyTimeoutMs\n },\n this.lockSetDestroyDelayMs\n );\n }\n\n /**\n * Immediately completes cleanup by destroying the lock set.\n * Called after all locks are released during the deferred destruction process.\n */\n _destroyNow() {\n this.lockSet.destroy();\n }\n}\n","import { type Observable, map } from 'rxjs';\nimport { isThrottled, unixDateTimeSecondsNumberForNow, DataDoesNotExistError, DataIsExpiredError, type ReadStoredData, type StoredData, type StoredDataStorageKey, type StoredDataString, type Maybe, type Milliseconds, hasNonNullValue, splitJoinRemainder } from '@dereekb/util';\nimport { type StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\n/**\n * Strategy for converting values to and from their stored string representation.\n *\n * @typeParam T - The type of value being converted.\n */\nexport interface SimpleStorageAccessorConverter<T> {\n /**\n * Converts the input value to a string.\n */\n stringifyValue(value: T): StoredDataString;\n /**\n * Converts the data string into a value.\n */\n parseValue(data: StoredDataString): T;\n}\n\n/**\n * Combined interface providing both value conversion and raw string storage capabilities.\n * Used as the backing delegate for {@link SimpleStorageAccessor}.\n *\n * @typeParam T - The type of value being stored.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {}\n\n/**\n * Default {@link SimpleStorageAccessorConverter} that uses `JSON.stringify`/`JSON.parse` for conversion.\n *\n * @typeParam T - The type of value being converted.\n */\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n stringifyValue(value: T): StoredDataString {\n return JSON.stringify(value);\n }\n\n parseValue(data: StoredDataString): T {\n return JSON.parse(data);\n }\n}\n\n/**\n * Composes a {@link StorageAccessor} and a {@link SimpleStorageAccessorConverter} into a single\n * {@link SimpleStorageAccessorDelegate} implementation.\n *\n * @typeParam T - The type of value being stored.\n */\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n private readonly _delegate: StorageAccessor<StoredDataString>;\n private readonly _converter: SimpleStorageAccessorConverter<T>;\n\n constructor(delegate: StorageAccessor<StoredDataString>, converter: SimpleStorageAccessorConverter<T>) {\n this._delegate = delegate;\n this._converter = converter;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return this._delegate.get(key);\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return this._delegate.set(key, value);\n }\n\n remove(key: string): Observable<void> {\n return this._delegate.remove(key);\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n all(prefix?: string): Observable<string[]> {\n return this._delegate.all(prefix);\n }\n\n allKeys(prefix?: string): Observable<string[]> {\n return this._delegate.allKeys(prefix);\n }\n\n stringifyValue(value: T): StoredDataString {\n return this._converter.stringifyValue(value);\n }\n\n parseValue(data: StoredDataString): T {\n return this._converter.parseValue(data);\n }\n}\n\n/**\n * Configuration for a {@link SimpleStorageAccessor}, controlling key namespacing and expiration.\n *\n * @example\n * ```typescript\n * const config: SimpleStorageAccessorConfig = {\n * prefix: 'myapp_settings',\n * expiresIn: 24 * 60 * 60 * 1000, // 24 hours\n * };\n * ```\n */\nexport interface SimpleStorageAccessorConfig {\n /**\n * Prefix prepended to all storage keys to namespace entries.\n */\n readonly prefix: string;\n /**\n * Separator between the prefix and the key. Defaults to `'::'`.\n */\n readonly prefixSplitter?: string;\n /**\n * Time in milliseconds after which stored data is considered expired.\n */\n readonly expiresIn?: Milliseconds;\n}\n\ninterface ConfiguredSimpleStorageAccessorConfig extends SimpleStorageAccessorConfig {\n readonly prefixSplitter: string;\n readonly fullPrefix: string;\n}\n\n/**\n * Validates that a storage key prefix is non-empty and does not contain the prefix splitter character.\n *\n * @param prefix - The prefix string to validate.\n * @param prefixSplitter - The splitter string that separates the prefix from the key.\n * @throws {Error} If the prefix is invalid or the splitter is empty.\n */\nexport function assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.'); // TODO(FUTURE): Consider changing to a concrete error type\n }\n\n if (!isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n}\n\n/**\n * Checks whether a storage key prefix is valid (non-empty and does not contain the splitter).\n *\n * @param prefix - The prefix string to validate.\n * @param prefixSpltter - The splitter string that separates the prefix from the key.\n * @returns `true` if the prefix is valid.\n */\nexport function isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix?.indexOf(prefixSpltter) === -1);\n}\n\n/**\n * Full-featured {@link StorageAccessor} that adds key namespacing, JSON serialization,\n * and optional time-based expiration on top of a raw string storage backend.\n *\n * Values are stored as JSON with metadata (timestamp) and automatically checked\n * for expiration on read.\n *\n * @typeParam T - The type of values stored.\n *\n * @throws {DataDoesNotExistError} When reading a key that does not exist.\n * @throws {DataIsExpiredError} When reading a key whose stored data has expired.\n *\n * @example\n * ```typescript\n * const accessor = factory.createStorageAccessor<UserSettings>({\n * prefix: 'user_prefs',\n * expiresIn: 3600000,\n * });\n *\n * accessor.set('theme', { dark: true }).subscribe();\n * accessor.get('theme').subscribe(settings => console.log(settings));\n * ```\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n static readonly PREFIX_SPLITTER = '::';\n\n private readonly _delegate: SimpleStorageAccessorDelegate<T>;\n protected readonly _config: ConfiguredSimpleStorageAccessorConfig;\n\n constructor(delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n\n this._delegate = delegate;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\n }\n\n get delegate() {\n return this._delegate;\n }\n\n get config() {\n return this._config;\n }\n\n // MARK: LimitedStorageAccessor\n get(inputKey: string): Observable<T> {\n const storeKey = this.makeStorageKey(inputKey);\n return this._delegate.get(storeKey).pipe(\n map((storedData: Maybe<string>) => {\n if (storedData) {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n throw new DataIsExpiredError<T>(readStoredData);\n }\n } else {\n throw new DataDoesNotExistError();\n }\n })\n );\n }\n\n set(inputKey: string, inputValue: T): Observable<void> {\n const storeKey = this.makeStorageKey(inputKey);\n const storeData: StoredData = this.buildStoredData(inputValue);\n const data = JSON.stringify(storeData);\n return this._delegate.set(storeKey, data);\n }\n\n remove(key: string): Observable<void> {\n const storeKey = this.makeStorageKey(key);\n return this._delegate.remove(storeKey);\n }\n\n all(): Observable<T[]> {\n return this._delegate.all(this._config.fullPrefix).pipe(\n map((allStoredData) => {\n return allStoredData\n .map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n })\n .filter(hasNonNullValue);\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map((x) => this.decodeStorageKey(x))));\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n // MARK: Stored Values\n protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T> {\n const storedData: StoredData = JSON.parse(storedDataString);\n const expired = this.isExpiredStoredData(storedData);\n const convertedData = this._delegate.parseValue(storedData.data);\n\n return {\n ...storedData,\n expired,\n convertedData\n };\n }\n\n protected buildStoredData(value: T): StoredData {\n return {\n storedAt: unixDateTimeSecondsNumberForNow(),\n data: this.stringifyValue(value)\n };\n }\n\n protected isExpiredStoredData(storeData: StoredData): boolean {\n const expiresIn = this._config.expiresIn;\n if (expiresIn) {\n if (storeData.storedAt) {\n return isThrottled(expiresIn, storeData.storedAt);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected makeStorageKey(key: string): StoredDataStorageKey {\n return `${this._config.prefix}${this._config.prefixSplitter}${String(key)}`;\n }\n\n protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean {\n return storageKey.startsWith(this._config.fullPrefix);\n }\n\n protected decodeStorageKey(storageKey: StoredDataStorageKey): string {\n const split = splitJoinRemainder(storageKey, this._config.prefixSplitter, 2);\n return split[1];\n }\n\n protected stringifyValue(value: T): string {\n return this._delegate.stringifyValue(value);\n }\n}\n","import { filterMaybeArrayValues, type StoredDataString, type FullStorageObject, StorageObjectUtility, type Maybe } from '@dereekb/util';\nimport { Observable, map, shareReplay } from 'rxjs';\nimport { type StorageAccessor } from './storage.accessor';\n\n/**\n * {@link StorageAccessor} implementation that wraps a {@link FullStorageObject} and stores raw strings.\n *\n * Each operation completes synchronously within an observable wrapper.\n *\n * @example\n * ```typescript\n * const accessor = new StringStorageAccessor(localStorage);\n * accessor.set('key', 'value').subscribe();\n * accessor.get('key').subscribe(value => console.log(value)); // 'value'\n * ```\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n private readonly _storage: FullStorageObject;\n\n constructor(storage: FullStorageObject) {\n this._storage = storage;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return new Observable((x) => {\n const value = this._storage.getItem(key);\n x.next(value);\n x.complete();\n });\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.setItem(key, value);\n x.next();\n x.complete();\n });\n }\n\n remove(key: string): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.removeItem(key);\n x.next();\n x.complete();\n });\n }\n\n clear(): Observable<StoredDataString[]> {\n const removed = this._storage.removeAll();\n return new Observable((x) => {\n x.next(removed);\n x.complete();\n });\n }\n\n all(): Observable<StoredDataString[]> {\n return this.allKeys().pipe(\n map((x) => filterMaybeArrayValues(x.map((y) => this._storage.getItem(y)))),\n shareReplay(1)\n );\n }\n\n allKeys(): Observable<string[]> {\n return new Observable((x) => {\n const result = StorageObjectUtility.allKeysFromStorageObject(this._storage);\n x.next(result);\n x.complete();\n });\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * DI token for the application's default {@link FullStorageObject} instance.\n *\n * Provided by {@link provideDbxStorage}.\n */\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_OBJECT');\n\n/**\n * DI token for the application's default {@link SimpleStorageAccessorFactory} instance.\n *\n * Provided by {@link provideDbxStorage}.\n */\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Injectable, inject } from '@angular/core';\nimport { type StorageAccessor } from './storage.accessor';\nimport { type SimpleStorageAccessorConfig, SimpleStorageAccessor, type SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { type FullStorageObject, type StoredDataString } from '@dereekb/util';\n\n/**\n * Configuration for creating a {@link SimpleStorageAccessor} via the factory,\n * with optional overrides for the storage backend and value converter.\n *\n * @typeParam T - The type of values the created accessor will store.\n */\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Injectable factory for creating namespaced {@link SimpleStorageAccessor} instances\n * backed by the application's default storage object.\n *\n * @example\n * ```typescript\n * @Injectable()\n * export class UserPrefsService {\n * private readonly storage = inject(SimpleStorageAccessorFactory)\n * .createStorageAccessor<UserPrefs>({ prefix: 'user_prefs' });\n *\n * save(prefs: UserPrefs) { return this.storage.set('current', prefs); }\n * load() { return this.storage.get('current'); }\n * }\n * ```\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n readonly storageObject = inject<FullStorageObject>(DEFAULT_STORAGE_OBJECT_TOKEN);\n\n createStorageAccessor<T>(config: StorageAccessorFactoryConfig<T>): SimpleStorageAccessor<T> {\n const storage = config.storage ?? new StringStorageAccessor(this.storageObject);\n const converter = config.converter ?? new StringifySimpleStorageAccessorConverter<T>();\n const delegate = new WrapperSimpleStorageAccessorDelegate<T>(storage, converter);\n\n const accessorConfig = {\n prefix: config.prefix\n };\n\n return new SimpleStorageAccessor<T>(delegate, accessorConfig);\n }\n}\n","import { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\n\n/**\n * Abstract storage accessor providing key-value get/set/remove operations and a clear-all method.\n *\n * All operations return observables for consistency across sync and async storage backends.\n *\n * @typeParam T - The type of values stored.\n *\n * @see {@link StorageAccessor} for extended functionality including key/value enumeration.\n */\nexport abstract class LimitedStorageAccessor<T> {\n /**\n * Attempts to get the value. Throws a DataDoesNotExistError if not available.\n */\n abstract get(key: string): Observable<Maybe<T>>;\n\n abstract set(key: string, value: Maybe<T>): Observable<void>;\n\n abstract remove(key: string): Observable<void>;\n\n abstract clear(): Observable<object>;\n}\n\n/**\n * Extended storage accessor that adds the ability to enumerate all stored keys and values,\n * optionally filtered by a key prefix.\n *\n * @typeParam T - The type of values stored.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n /**\n * Returns all values. Filtered by keys of a given prefix.\n */\n abstract all(prefix?: string): Observable<T[]>;\n\n /**\n * Returns all keys. Filtered by keys of a given prefix.\n */\n abstract allKeys(prefix?: string): Observable<string[]>;\n}\n\n/**\n * Synchronous storage accessor for scenarios where blocking get/set/remove is acceptable.\n *\n * @typeParam T - The type of values stored.\n */\nexport abstract class InstantStorageAccessor<T> {\n abstract getNow(key: string): T | undefined;\n\n abstract setNow(key: string, value: T): void;\n\n abstract removeNow(key: string): void;\n}\n","import { type FullStorageObject, type Maybe, type StorageObject, StorageObjectUtility, type StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * {@link FullStorageObject} implementation backed by the browser's `localStorage`.\n *\n * Wraps a `StorageObject` (the Web Storage API interface) and adds availability checking\n * and a `removeAll` operation.\n *\n * @example\n * ```typescript\n * const storage = new FullLocalStorageObject(window.localStorage);\n * if (storage.isAvailable) {\n * storage.setItem('key', 'value');\n * }\n * ```\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n private readonly _localStorage: StorageObject;\n\n constructor(localStorage: StorageObject) {\n this._localStorage = localStorage;\n }\n\n get isPersistant(): boolean {\n return true;\n }\n\n get isAvailable(): boolean {\n const test = '_T_E_S_T_';\n\n try {\n // Tests setting and removing an item. These will throw an\n // exception if the localstorage is not available\n this._localStorage.setItem(test, test);\n this._localStorage.removeItem(test);\n return true;\n } catch {\n return false;\n }\n }\n\n get length(): number {\n return this._localStorage.length;\n }\n\n getItem(key: StoredDataStorageKey): Maybe<string> {\n return this._localStorage.getItem(key);\n }\n\n setItem(key: StoredDataStorageKey, item: string): void {\n this._localStorage.setItem(key, item);\n }\n\n removeItem(key: StoredDataStorageKey): void {\n this._localStorage.removeItem(key);\n }\n\n key(index: number): string | null {\n return this._localStorage.key(index);\n }\n\n removeAll(): string[] {\n const keys = StorageObjectUtility.allKeysFromStorageObject(this);\n keys.forEach((x) => this.removeItem(x));\n return keys;\n }\n}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * In-memory {@link FullStorageObject} implementation that does not persist across page loads.\n *\n * Used as a fallback when `localStorage` is unavailable (e.g., private browsing, SSR)\n * or for testing scenarios.\n *\n * @example\n * ```typescript\n * const storage = new MemoryStorageObject();\n * storage.setItem('temp', 'data'); // stored only in memory\n * ```\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n get isLastingStorage(): boolean {\n return false;\n }\n\n override get isAvailable(): boolean {\n return true;\n }\n\n constructor() {\n super(SHARED_MEMORY_STORAGE);\n }\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type FullStorageObject } from '@dereekb/util';\nimport { SimpleStorageAccessorFactory } from './storage.accessor.simple.factory';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN } from './storage.di';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\nimport { MemoryStorageObject } from './storage.object.memory';\n\n/**\n * Creates the default {@link FullStorageObject}, preferring `localStorage` and\n * falling back to an in-memory store if `localStorage` is unavailable.\n *\n * @returns A FullStorageObject backed by localStorage or an in-memory fallback.\n *\n * @example\n * ```typescript\n * const storage = defaultStorageObjectFactory();\n * storage.setItem('key', 'value');\n * ```\n */\nexport function defaultStorageObjectFactory(): FullStorageObject {\n let storageObject: FullStorageObject = new FullLocalStorageObject(localStorage);\n\n if (!storageObject.isAvailable) {\n storageObject = new MemoryStorageObject();\n }\n\n return storageObject;\n}\n\n/**\n * Registers the default storage object and {@link SimpleStorageAccessorFactory} as environment-level providers.\n *\n * Call in your application config to enable storage-based services throughout the app.\n *\n * @returns The environment providers for storage services.\n *\n * @example\n * ```typescript\n * export const appConfig: ApplicationConfig = {\n * providers: [provideDbxStorage()],\n * };\n * ```\n */\nexport function provideDbxStorage(): EnvironmentProviders {\n const providers: Provider[] = [\n // Storage object\n {\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n },\n // Storage accessor factory\n {\n provide: SimpleStorageAccessorFactory,\n useClass: SimpleStorageAccessorFactory\n },\n {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useExisting: SimpleStorageAccessorFactory\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { type ChangeDetectorRef, type ViewRef, type ElementRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * RxJS operator that triggers `detectChanges()` on a `ChangeDetectorRef` after each emission.\n *\n * Wraps the detection call in a `setTimeout` to avoid triggering it during change detection cycles.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to trigger. If `null`/`undefined`, the operator is a no-op.\n * @param timeout - Delay in milliseconds before calling `detectChanges`.\n * @returns An RxJS operator that triggers change detection on each emission.\n *\n * @example\n * ```typescript\n * this.data$.pipe(tapDetectChanges(this.cdRef)).subscribe();\n * ```\n */\nexport function tapDetectChanges<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return cdRef ? tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout)) : tap();\n}\n\n/**\n * Safely calls `detectChanges()` on a `ChangeDetectorRef`, skipping the call if the view is already destroyed.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to trigger.\n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n safeUseCdRef(cdRef, () => cdRef.detectChanges());\n}\n\n/**\n * RxJS operator that calls `markForCheck()` on a `ChangeDetectorRef` after each emission.\n *\n * Intended for components using `OnPush` change detection that subscribe to observables\n * outside of the `async` pipe. Not needed when using the `async` pipe.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to mark. If `null`/`undefined`, the operator is a no-op.\n * @param timeout - Delay in milliseconds before calling `markForCheck`.\n * @returns An RxJS operator that marks the view for check on each emission.\n *\n * @example\n * ```typescript\n * this.data$.pipe(tapSafeMarkForCheck(this.cdRef)).subscribe();\n * ```\n */\nexport function tapSafeMarkForCheck<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return cdRef ? tap(() => setTimeout(() => safeMarkForCheck(cdRef), timeout)) : tap();\n}\n\n/**\n * Safely calls `markForCheck()` on a `ChangeDetectorRef`, skipping the call if the view is already destroyed.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to mark.\n */\nexport function safeMarkForCheck(cdRef: ChangeDetectorRef): void {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n safeUseCdRef(cdRef, () => cdRef.markForCheck());\n}\n\n/**\n * Executes a callback with the given `ChangeDetectorRef` only if its view has not been destroyed.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to guard.\n * @param use - Callback to invoke with the change detector.\n */\nexport function safeUseCdRef(cdRef: ChangeDetectorRef, use: (cdRef: ChangeDetectorRef) => void): void {\n if (!(cdRef as ViewRef).destroyed) {\n use(cdRef);\n }\n}\n\n/**\n * Checks whether an `ng-content` wrapper element received any projected content from its parent.\n *\n * Returns `true` if the element has any child nodes, even if the projected content is empty.\n * Useful for conditionally showing fallback content when no projection is provided.\n *\n * @param ref - Reference to the wrapper element around `ng-content`.\n * @returns `true` if the wrapper element has any child nodes.\n *\n * @example\n * ```typescript\n * // In the component class:\n * @ViewChild('contentWrapper', { static: false }) contentRef: ElementRef;\n *\n * get hasContent(): boolean {\n * return checkNgContentWrapperHasContent(this.contentRef);\n * }\n * ```\n *\n * @example\n * ```html\n * <!-- In the component template: -->\n * <div #contentWrapper>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\n * <div *ngIf=\"!hasContent\">No content provided</div>\n * ```\n */\nexport function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean {\n // https://github.com/angular/angular/issues/26083\n let hasContent = false;\n\n if (ref != null) {\n const childNodes = ref.nativeElement.childNodes;\n const hasChildNodes = childNodes && childNodes.length > 0;\n hasContent = Boolean(hasChildNodes);\n }\n\n return hasContent;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["importsAndExports","initialState","reducer","DbxAppContextActions.setState","FEATURE_KEY","reducers","fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY","fromDbxAppContextState.reducer","onDbxAppContext.DbxAppContextActions.setState","DbxAppAuthActions.loggedOut","DbxAppAuthUserActions.setUserIdentifier","DbxAppAuthUserActions.setUserIsOnboarded","DbxAppAuthUserActions.setUserState","DbxAppAuthUserActions.setUserRoles","fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY","fromDbxAppAuthUserState.reducer","onDbxAppAuth.DbxAppAuthActions.loggedOut","onDbxAppAuth.DbxAppAuthActions.loggedIn","onDbxAppAuth.DbxAppAuthActions.logout","onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier","onDbxAppAuth.DbxAppAuthUserActions.setUserState","onDbxAppAuth.DbxAppAuthUserActions.setUserRoles","onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded","fromDbxAppAuth.FEATURE_KEY","fromDbxAppAuth.reducers","fromDbxAppAuth.selectDbxAppAuthUser","fromDbxAppContext.selectDbxAppContextState","onDbxAppContext.DbxAppContextActions.resetState","fromDbxAppContext.FEATURE_KEY","fromDbxAppContext.reducers"],"mappings":";;;;;;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;;AAiBG;AACG,SAAU,KAAK,CAA0C,KAAQ,EAAA;AACrE,IAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAErC,IAAA,IAAK,KAAqB,CAAC,OAAO,EAAE;QAClC,UAAU,CAAC,SAAS,CAAC,MAAO,KAAqB,CAAC,OAAO,EAAE,CAAC;IAC9D;SAAO;AACL,QAAA,UAAU,CAAC,SAAS,CAAC,KAAwB,CAAC;IAChD;AAEA,IAAA,OAAO,KAAK;AACd;AAEA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,iBAAiB,CAAyD,KAAQ,EAAA;IAChG,KAAK,CAAC,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC;AAC7B,IAAA,OAAO,KAAK;AACd;;ACjDA;AACA;;;;;;;;;;;;;;;AAeG;AACG,SAAU,iBAAiB,CAA4C,GAA6B,EAAA;AACxG,IAAA,MAAM,YAAY,GAAG,kBAAkB,CAAC,GAAG,CAAC;AAC5C,IAAA,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAI,YAAY,CAAC;IAClE,KAAK,CAAC,kBAAkB,CAAC;AACzB,IAAA,OAAO,kBAAkB;AAC3B;;ACGA;;;;;;;;;;;;;;;;;AAiBG;AACG,SAAU,YAAY,CAAC,MAAkC,EAAA;IAC7D,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,GAAG,MAAM,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A;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/rxjs/clean.ts","../../../../packages/dbx-core/src/lib/rxjs/subscription.ts","../../../../packages/dbx-core/src/lib/rxjs/lockset.ts","../../../../packages/dbx-core/src/lib/rxjs/loading.ts","../../../../packages/dbx-core/src/lib/rxjs/destroy.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.automodify.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/auto/action.autotrigger.directive.ts","../../../../packages/dbx-core/src/lib/action/action.handler.ts","../../../../packages/dbx-core/src/lib/action/action.ts","../../../../packages/dbx-core/src/lib/action/action.store.ts","../../../../packages/dbx-core/src/lib/action/action.holder.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.store.source.provide.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/context/action.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/debug/action.logger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.key.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.source.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.utility.ts","../../../../packages/dbx-core/src/lib/action/directive/map/action.map.working.disable.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disabled.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.disableonsuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/view/if.directive.ts","../../../../packages/dbx-core/src/lib/util/input.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.idle.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.presuccess.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.error.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.enforce.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.instance.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.trigger.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.stream.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.triggered.directive.ts","../../../../packages/dbx-core/src/lib/action/action.module.ts","../../../../packages/dbx-core/src/lib/action/action.reference.ts","../../../../packages/dbx-core/src/lib/router/segue.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/redirect.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/auth.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/role.hook.ts","../../../../packages/dbx-core/src/lib/auth/router/provider/uirouter/state.hook.ts","../../../../packages/dbx-core/src/lib/context/context.ts","../../../../packages/dbx-core/src/lib/context/state/action/data.action.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/data.reducer.ts","../../../../packages/dbx-core/src/lib/context/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/context/state/effect/index.ts","../../../../packages/dbx-core/src/lib/auth/auth.user.ts","../../../../packages/dbx-core/src/lib/auth/state/action/auth.action.ts","../../../../packages/dbx-core/src/lib/auth/state/action/user.action.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/user.reducer.ts","../../../../packages/dbx-core/src/lib/auth/state/reducer/index.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.go.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.service.ts","../../../../packages/dbx-core/src/lib/auth/router/state/effect/auth.router.state.effect.ts","../../../../packages/dbx-core/src/lib/auth/router/state/auth.router.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/router/auth.router.providers.ts","../../../../packages/dbx-core/src/lib/auth/service/auth.service.rxjs.ts","../../../../packages/dbx-core/src/lib/auth/state/effect/auth.effect.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.providers.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.any.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.has.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.role.not.directive.ts","../../../../packages/dbx-core/src/lib/auth/auth.state.service.ts","../../../../packages/dbx-core/src/lib/button/button.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.trigger.directive.ts","../../../../packages/dbx-core/src/lib/button/action/action.button.directive.ts","../../../../packages/dbx-core/src/lib/button/router/button.segue.directive.ts","../../../../packages/dbx-core/src/lib/button/button.directive.ts","../../../../packages/dbx-core/src/lib/button/button.loading.directive.ts","../../../../packages/dbx-core/src/lib/button/button.module.ts","../../../../packages/dbx-core/src/lib/context/context.service.ts","../../../../packages/dbx-core/src/lib/context/context.directive.ts","../../../../packages/dbx-core/src/lib/context/context.providers.ts","../../../../packages/dbx-core/src/lib/environment/environment.ts","../../../../packages/dbx-core/src/lib/environment/environment.service.ts","../../../../packages/dbx-core/src/lib/environment/environment.providers.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.ts","../../../../packages/dbx-core/src/lib/router/anchor/clickable.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/id.hook.ts","../../../../packages/dbx-core/src/lib/router/auth/hook/uid.hook.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/angular/angular.router.service.module.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.ts","../../../../packages/dbx-core/src/lib/router/router/provider/uirouter/uirouter.router.service.providers.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.directive.ts","../../../../packages/dbx-core/src/lib/router/router/transition/transition.watcher.directive.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.util.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.service.rxjs.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.reader.ts","../../../../packages/dbx-core/src/lib/router/router/util/route.default.ts","../../../../packages/dbx-core/src/lib/router/model/id.param.redirect.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.uid.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.id.directive.ts","../../../../packages/dbx-core/src/lib/router/model/model.router.key.directive.ts","../../../../packages/dbx-core/src/lib/pipe/async/asobservable.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedayrange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/dateformatfromto.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedaytimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerange.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/daterangedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonly.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/targetdatetosystemdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datetimerangeonlydistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timezoneabbreviation.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/systemdatetotargetdate.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/timedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tominutes.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/misc/prettyjson.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/cuttext.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/getvalue.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/value/dollar.pipe.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.content.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connect.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.instance.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.connector.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.map.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.preset.ts","../../../../packages/dbx-core/src/lib/filter/filter.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injection/injection.ts","../../../../packages/dbx-core/src/lib/injection/injection.util.ts","../../../../packages/dbx-core/src/lib/injection/injection.instance.ts","../../../../packages/dbx-core/src/lib/injection/injection.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.array.component.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.context.forward.directive.ts","../../../../packages/dbx-core/src/lib/injection/injection.rxjs.ts","../../../../packages/dbx-core/src/lib/injection/injector.ts","../../../../packages/dbx-core/src/lib/ngrx/store.lockset.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.string.ts","../../../../packages/dbx-core/src/lib/storage/storage.di.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.simple.factory.ts","../../../../packages/dbx-core/src/lib/storage/storage.accessor.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.localstorage.ts","../../../../packages/dbx-core/src/lib/storage/storage.object.memory.ts","../../../../packages/dbx-core/src/lib/storage/storage.providers.ts","../../../../packages/dbx-core/src/lib/util/view.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core';\nimport { type Destroyable, type DestroyFunction } from '@dereekb/util';\nimport { type Subject } from 'rxjs';\n\n/**\n * Wraps a Destroyable in a function that registers the input Destroyable to be destroyed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Clean up a Destroyable object (e.g., SubscriptionObject, LockSet):\n * const sub = new SubscriptionObject(obs$.subscribe(handler));\n * clean(sub);\n *\n * @example\n * // Clean up a destroy function directly:\n * clean(() => resource.release());\n *\n * @param input - The Destroyable object or destroy function to register for cleanup.\n * @returns The same input, for chaining.\n */\nexport function clean<T extends Destroyable | DestroyFunction>(input: T): T {\n const destroyRef = inject(DestroyRef);\n\n if ((input as Destroyable).destroy) {\n destroyRef.onDestroy(() => (input as Destroyable).destroy());\n } else {\n destroyRef.onDestroy(input as DestroyFunction);\n }\n\n return input;\n}\n\n/**\n * Wraps a Subject in a function that registers the input Subject to be completed\n * when the DestroyRef is destroyed in the context.\n *\n * Must be run in an Angular injection context.\n *\n * @example\n * // Complete a BehaviorSubject when the component is destroyed:\n * readonly value$ = completeOnDestroy(new BehaviorSubject<string>('initial'));\n *\n * @example\n * // Complete a ReplaySubject when the component is destroyed:\n * readonly events$ = completeOnDestroy(new ReplaySubject<Event>(1));\n *\n * @param input - The Subject to register for completion on destroy.\n * @returns The same input, for chaining.\n */\nexport function completeOnDestroy<T extends Pick<Subject<unknown>, 'complete' | 'error'>>(input: T): T {\n clean(() => input.complete());\n return input;\n}\n","import { SubscriptionObject } from '@dereekb/rxjs';\nimport { type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { type Unsubscribable } from 'rxjs';\nimport { clean } from './clean';\n\n// MARK: cleanSubscription()\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription directly - it will be cleaned up automatically:\n * cleanSubscription(obs$.subscribe(handler));\n *\n * // Or create first, then set the subscription later:\n * readonly _sub = cleanSubscription();\n * this._sub.subscription = obs$.subscribe(handler);\n *\n * @param sub - Optional subscription or getter to wrap.\n * @returns A SubscriptionObject that is automatically destroyed when the context is destroyed.\n */\nexport function cleanSubscription<T extends Unsubscribable = Unsubscribable>(sub?: Maybe<GetterOrValue<T>>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n clean(subscriptionObject);\n return subscriptionObject;\n}\n","import { DestroyRef, inject } from '@angular/core';\nimport { type DestroyOnNextUnlockConfig, LockSet, SubscriptionObject } from '@dereekb/rxjs';\nimport { type Configurable, type DestroyFunction, type GetterOrValue, getValueFromGetter, type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from './subscription';\nimport { type Unsubscribable } from 'rxjs';\n\n/**\n * Configuration for {@link cleanLockSet}, controlling destruction timing and lifecycle callbacks.\n */\nexport interface CleanLockSetConfig {\n /**\n * Callback invoked when the Angular `DestroyRef` fires, before the lock set begins its unlock-and-destroy sequence.\n */\n readonly onDestroy?: Maybe<() => void>;\n /**\n * Callback invoked when the lock set has fully completed destruction (after all locks are released).\n */\n readonly onLockSetDestroy?: Maybe<() => void>;\n /**\n * Timing configuration for the deferred destruction of the lock set.\n */\n readonly destroyLocksetTiming?: Maybe<DestroyOnNextUnlockConfig>;\n}\n\n/**\n * A {@link LockSet} created by {@link cleanLockSet} that exposes a `_cleanDestroy` method\n * for programmatically triggering the destroy sequence outside of Angular's `DestroyRef`.\n */\nexport type CleanLockSet = LockSet & { readonly _cleanDestroy: () => void };\n\n/**\n * Creates a new LockSet that is automatically destroyed when the component is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @param config - Optional configuration for destruction behavior and callbacks.\n * @returns A CleanLockSet that is automatically destroyed when the context is destroyed.\n *\n * @example\n * // Create a simple lockset:\n * readonly lockSet = cleanLockSet();\n *\n * @example\n * // Create with a callback when the lockset is destroyed:\n * readonly lockSet = cleanLockSet({\n * onLockSetDestroy: () => console.log('lockset destroyed')\n * });\n */\nexport function cleanLockSet(config?: Maybe<CleanLockSetConfig>): CleanLockSet {\n const { onDestroy, onLockSetDestroy, destroyLocksetTiming } = config ?? {};\n\n const destroyRef = inject(DestroyRef);\n const lockSet = new LockSet() as unknown as CleanLockSet;\n\n function cleanDestroy() {\n onDestroy?.();\n lockSet.destroyOnNextUnlock(destroyLocksetTiming); // flag to be destroyed on the next complete unlock\n }\n\n destroyRef.onDestroy(() => cleanDestroy());\n\n if (onLockSetDestroy) {\n const _destroySub = cleanSubscription(\n lockSet.onDestroy$.subscribe(() => {\n onLockSetDestroy();\n _destroySub.destroy();\n })\n );\n }\n\n (lockSet as Configurable<CleanLockSet>)._cleanDestroy = cleanDestroy;\n return lockSet;\n}\n\n// MARK: cleanWithLockSet()\n/**\n * Runs the given onDestroy function when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @param lockSet The lockset to use.\n * @param onDestroy The function to run when the lockset is unlocked.\n *\n * @example\n * // Defer cleanup until the lockset unlocks after component destroy:\n * cleanWithLockSet(this.lockSet, () => resource.release());\n */\nexport function cleanWithLockSet(lockSet: LockSet, onDestroy: DestroyFunction) {\n const destroyRef = inject(DestroyRef);\n\n destroyRef.onDestroy(() => {\n lockSet.onNextUnlock(() => {\n onDestroy();\n });\n });\n}\n\n// MARK: cleanSubscriptionWithLockSet()\n/**\n * Configuration for {@link cleanSubscriptionWithLockSet}, specifying the lock set and optional initial subscription.\n *\n * @typeParam T - The type of unsubscribable being managed.\n */\nexport interface CleanSubscriptionWithLockSetConfig<T extends Unsubscribable = Unsubscribable> {\n readonly lockSet: LockSet;\n readonly sub?: Maybe<GetterOrValue<T>>;\n}\n\n/**\n * Creates a new SubscriptionObject that is automatically destroyed when the context is destroyed, and the lock set's next unlock occurs.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a subscription that waits for the lockset to unlock before cleanup:\n * readonly _sub = cleanSubscriptionWithLockSet({\n * lockSet: this.lockSet,\n * sub: obs$.subscribe(handler)\n * });\n *\n * @example\n * // Create first, then set the subscription later:\n * readonly _sub = cleanSubscriptionWithLockSet({ lockSet: this.lockSet });\n * this._sub.subscription = obs$.subscribe(handler);\n *\n * @param input - Configuration specifying the lock set and optional initial subscription.\n * @returns A SubscriptionObject that is destroyed when the context is destroyed and the lock set unlocks.\n */\nexport function cleanSubscriptionWithLockSet<T extends Unsubscribable = Unsubscribable>(input: CleanSubscriptionWithLockSetConfig<T>): SubscriptionObject<T> {\n const subscription = getValueFromGetter(input.sub);\n const subscriptionObject = new SubscriptionObject<T>(subscription);\n cleanWithLockSet(input.lockSet, () => subscriptionObject.destroy());\n return subscriptionObject;\n}\n","import { type LoadingState, type LoadingContextEvent, type LoadingStateContextInput, type MutableLoadingStateContext, loadingStateContext, type ListLoadingState, type ListLoadingStateContextInput, type MutableListLoadingStateContext, listLoadingStateContext } from '@dereekb/rxjs';\nimport { clean } from './clean';\n\n/**\n * Creates a new LoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly context = cleanLoadingContext<MyData>(this.data$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly context = cleanLoadingContext<MyData>();\n * this.context.obs = this.data$;\n *\n * @param input - Optional loading state context input configuration.\n * @returns A mutable loading state context that is automatically destroyed on cleanup.\n */\nexport function cleanLoadingContext<T = unknown, S extends LoadingState<T> = LoadingState<T>, E extends LoadingContextEvent = LoadingContextEvent & S>(input?: LoadingStateContextInput<T, S, E>): MutableLoadingStateContext<T, S, E> {\n return clean(loadingStateContext(input));\n}\n\n/**\n * Creates a new ListLoadingStateContext that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Create with an observable source:\n * readonly listContext = cleanListLoadingContext<MyItem>(this.items$);\n *\n * @example\n * // Create empty, then set the observable source later:\n * readonly listContext = cleanListLoadingContext<MyItem>();\n * this.listContext.obs = this.items$;\n *\n * @param input - Optional list loading state context input configuration.\n * @returns A mutable list loading state context that is automatically destroyed on cleanup.\n */\nexport function cleanListLoadingContext<L = unknown, S extends ListLoadingState<L> = ListLoadingState<L>>(input?: ListLoadingStateContextInput<L, S>): MutableListLoadingStateContext<L, S> {\n return clean(listLoadingStateContext(input));\n}\n","import { type DestroyFunction, DestroyFunctionObject, type Maybe } from '@dereekb/util';\nimport { clean } from './clean';\n\n/**\n * Creates a new DestroyFunctionObject that is automatically destroyed when the context is destroyed.\n *\n * Must be run within an Angular injection context.\n *\n * @example\n * // Pass a destroy function directly:\n * cleanDestroy(() => resource.release());\n *\n * @example\n * // Create first, then set the destroy function later:\n * readonly _destroy = cleanDestroy();\n * this._destroy.setDestroyFunction(() => resource.release());\n *\n * @param input - Optional destroy function to wrap.\n * @returns A DestroyFunctionObject that will be automatically destroyed when the context is destroyed.\n */\nexport function cleanDestroy(input?: Maybe<DestroyFunction>): DestroyFunctionObject {\n const destroyFunction = new DestroyFunctionObject(input);\n clean(destroyFunction);\n return destroyFunction;\n}\n","import { first, switchMap, type Observable, type Subscription } from 'rxjs';\nimport { LockSet, filterMaybe, type LoadingState, type LoadingStateType, type MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe, type ReadableError } from '@dereekb/util';\nimport { type ActionContextState, type ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey, type DbxActionRejectedPair, type DbxActionState, type DbxActionSuccessPair, type DbxActionWorkOrWorkProgress, type DbxActionWorkProgress } from './action';\n\n/**\n * Abstract source that provides an observable of an {@link ActionContextStore}.\n *\n * This is the primary injection token used by action directives to access the action state.\n * Implementations are typically provided via Angular's DI, either by {@link DbxActionDirective}\n * or through secondary source providers.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionDirective} for the directive that provides this source.\n * @see {@link SecondaryActionContextStoreSource} for nested action source forwarding.\n */\nexport abstract class ActionContextStoreSource<T = unknown, O = unknown> {\n /**\n * Observable referencing the {@link ActionContextStore}.\n *\n * This observable is pre-filtered to never emit null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary action context store source used for nested or forwarded action contexts.\n *\n * When a {@link DbxActionDirective} is created, it checks for the presence of this secondary\n * source via host injection. If found, the directive reuses the existing store rather than\n * creating its own, enabling action context sharing across component boundaries.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionSourceDirective} for the directive that provides this.\n */\nexport abstract class SecondaryActionContextStoreSource<T = unknown, O = unknown> extends ActionContextStoreSource<T, O> {}\n\n/**\n * Filters null/undefined values from an observable of {@link ActionContextStore} instances.\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param obs - The observable that may emit null/undefined store values.\n * @returns An observable that only emits non-null store instances.\n */\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\n/**\n * Function that receives an {@link ActionContextStore} and returns an observable derived from it.\n *\n * @typeParam R - The return type of the derived observable.\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n */\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\n/**\n * Pipes a function through the action store from the given source.\n *\n * Subscribes to the source's store observable and applies the provided function\n * via switchMap, automatically switching to the latest store.\n *\n * @typeParam R - The return type of the derived observable.\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param source - The action context store source to read from.\n * @param pipeFn - The function to apply to each emitted store.\n * @returns An observable of the derived value.\n */\nexport function pipeActionStore<R = unknown, T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(switchMap(pipeFn));\n}\n\n/**\n * Function that receives an {@link ActionContextStore} for imperative use (e.g., triggering state changes).\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n */\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Subscribes to the source once and invokes the provided function with the store.\n *\n * This is a convenience for performing one-shot imperative operations on the store,\n * such as triggering an action or setting a value, without maintaining a long-lived subscription.\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param source - The action context store source to read from.\n * @param useFn - The function to invoke with the store.\n * @returns The subscription (completes after first emission).\n */\nexport function useActionStore<T = unknown, O = unknown>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n/**\n * Convenience wrapper around an {@link ActionContextStoreSource} that provides direct\n * access to all the store's reactive selectors and imperative state-change methods.\n *\n * This class is the primary interface injected by action directives to interact with\n * the action lifecycle. It delegates all operations through the underlying source's\n * store observable, while also maintaining a {@link LockSet} for cleanup coordination.\n *\n * All reactive properties (e.g., `isWorking$`, `success$`, `error$`) are piped through\n * the source's `store$` via switchMap, so they automatically follow store changes.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link ActionContextStore} for the underlying store.\n * @see {@link ActionContextStoreSource} for the source abstraction.\n */\nexport class DbxActionContextStoreSourceInstance<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n readonly lockSet = new LockSet();\n\n private readonly _source: ActionContextStoreSource<T, O>;\n\n constructor(source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n\n this._source = source;\n }\n\n get source(): ActionContextStoreSource<T, O> {\n return this._source;\n }\n\n public destroy(): void {\n this.lockSet.destroyOnNextUnlock();\n }\n\n // MARK: Store\n get store$(): Observable<ActionContextStore<T, O>> {\n return this.source.store$;\n }\n\n pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return pipeActionStore(this.source, pipeFn);\n }\n\n useStore(useFn: UseActionStoreFunction<T, O>): Subscription {\n return useActionStore(this.source, useFn);\n }\n\n get state$(): Observable<ActionContextState<T, O>> {\n return this.pipeStore((x) => x.state$);\n }\n\n get idle$(): Observable<boolean> {\n return this.pipeStore((x) => x.idle$);\n }\n\n get triggered$(): Observable<boolean> {\n return this.pipeStore((x) => x.triggered$);\n }\n\n get valueReady$(): Observable<T> {\n return this.pipeStore((x) => x.valueReady$);\n }\n\n get success$(): Observable<Maybe<O>> {\n return this.pipeStore((x) => x.success$);\n }\n\n get successPair$(): Observable<DbxActionSuccessPair<T, O>> {\n return this.pipeStore((x) => x.successPair$);\n }\n\n get workProgress$(): Observable<Maybe<DbxActionWorkProgress>> {\n return this.pipeStore((x) => x.workProgress$);\n }\n\n get error$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.error$);\n }\n\n get rejected$(): Observable<Maybe<ReadableError>> {\n return this.pipeStore((x) => x.rejected$);\n }\n\n get rejectedPair$(): Observable<DbxActionRejectedPair<T>> {\n return this.pipeStore((x) => x.rejectedPair$);\n }\n\n get isModified$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModified$);\n }\n\n get canTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.canTrigger$);\n }\n\n get isModifiedAndCanTriggerUpdates$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTriggerUpdates$);\n }\n\n get isModifiedAndCanTrigger$(): Observable<boolean> {\n return this.pipeStore((x) => x.isModifiedAndCanTrigger$);\n }\n\n get actionState$(): Observable<DbxActionState> {\n return this.pipeStore((x) => x.actionState$);\n }\n\n get loadingState$(): Observable<LoadingState<O>> {\n return this.pipeStore((x) => x.loadingState$);\n }\n\n get loadingStateType$(): Observable<LoadingStateType> {\n return this.pipeStore((x) => x.loadingStateType$);\n }\n\n get isWorking$(): Observable<boolean> {\n return this.pipeStore((x) => x.isWorking$);\n }\n\n get isWorkingOrWorkProgress$(): Observable<DbxActionWorkOrWorkProgress> {\n return this.pipeStore((x) => x.isWorkingOrWorkProgress$);\n }\n\n get isSuccess$(): Observable<boolean> {\n return this.pipeStore((x) => x.isSuccess$);\n }\n\n get disabledKeys$(): Observable<string[]> {\n return this.pipeStore((x) => x.disabledKeys$);\n }\n\n get isDisabled$(): Observable<boolean> {\n return this.pipeStore((x) => x.isDisabled$);\n }\n\n get errorCountSinceLastSuccess$(): Observable<number> {\n return this.pipeStore((x) => x.errorCountSinceLastSuccess$);\n }\n\n public enable(key?: DbxActionDisabledKey, enable = true): void {\n this.disable(key, !enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable = true): void {\n this.useStore((x) => (disable ? x.disable(key) : x.enable(key)));\n }\n\n public setIsSame(isSame?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsSame(isSame));\n }\n\n public setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public setWorkProgress(workProgress: MaybeObservableOrValue<DbxActionWorkProgress>): void {\n this.useStore((x) => x.setWorkProgress(workProgress));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\n }\n\n public triggerWithValue(value: T | Observable<T>): void {\n this.useStore((x) => {\n x.trigger();\n x.readyValue(value);\n });\n }\n\n public readyValue(value: T | Observable<T>): void {\n this.useStore((x) => x.readyValue(value));\n }\n\n public startWorking(): void {\n this.useStore((x) => x.startWorking());\n }\n\n public reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.useStore((x) => x.reject(error));\n }\n\n public resolve(value: O | Observable<O>): void {\n this.useStore((x) => x.resolve(value));\n }\n\n public reset(): void {\n this.useStore((x) => x.reset());\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { distinctUntilChanged, filter, switchMap, type Observable, EMPTY } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isNotFalse } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that automatically marks the parent action as modified whenever it becomes unmodified.\n *\n * This ensures the action is always considered \"modified\" and therefore always eligible for triggering.\n * Useful in combination with {@link DbxActionAutoTriggerDirective} and {@link DbxActionEnforceModifiedDirective}\n * when the action should be continuously available for submission.\n *\n * Can be disabled by setting `dbxActionAutoModify` to `false`.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionAutoModify></ng-container>\n * <ng-container dbxActionAutoTrigger></ng-container>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionAutoTriggerDirective} for automatically triggering modified actions.\n */\n@Directive({\n selector: 'dbxActionAutoModify, [dbxActionAutoModify]',\n standalone: true\n})\nexport class DbxActionAutoModifyDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n readonly autoModifyEnabled = input<boolean, string | boolean>(true, { alias: 'dbxActionAutoModify', transform: isNotFalse });\n readonly markAsModified$: Observable<void> = toObservable(this.autoModifyEnabled).pipe(\n distinctUntilChanged(),\n switchMap((x) => {\n let obs: Observable<any>;\n\n if (x) {\n obs = this.source.isModified$.pipe(filter((x) => !x));\n } else {\n obs = EMPTY;\n }\n\n return obs;\n })\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.markAsModified$.subscribe(() => {\n this.source.setIsModified(true);\n })\n });\n }\n}\n","import { inject, Directive, input, computed, signal, type Signal } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle, EMPTY, interval, combineLatest, type Observable } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { isDefinedAndNotFalse, isNotFalse, type Maybe } from '@dereekb/util';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\nconst DEFAULT_DEBOUNCE_MS = 2 * 1000;\n\nconst DEFAULT_THROTTLE_MS = 10 * 1000;\n\nconst DEFAULT_ERROR_THROTTLE_MS = 3 * 1000;\n\nconst MAX_ERRORS_TO_THROTTLE_ON = 6;\n\nconst DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE = 200;\nconst DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE = 10;\n\n/**\n * Directive that automatically triggers the parent action when the action becomes modified and can be triggered.\n *\n * Uses configurable debounce and throttle timers to prevent excessive triggering. Also\n * supports error-aware throttling: as consecutive errors accumulate, the throttle interval\n * increases to give transient issues time to resolve.\n *\n * Useful for auto-save scenarios where data changes should automatically submit without\n * requiring an explicit user action. Use with care to avoid triggering loops.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionAutoTrigger></ng-container>\n * <!-- form or value source here -->\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Fast trigger preset with limit -->\n * <div dbxAction>\n * <ng-container dbxActionAutoTrigger useFastTriggerPreset [triggerLimit]=\"5\"></ng-container>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionAutoModifyDirective} for automatically marking the action as modified.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger,[dbxActionAutoTrigger]',\n standalone: true\n})\nexport class DbxActionAutoTriggerDirective<T = unknown, O = unknown> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly triggerDebounce = input<Maybe<number>>(undefined);\n readonly triggerThrottle = input<Maybe<number>>(undefined);\n readonly triggerErrorThrottle = input<number, Maybe<number>>(DEFAULT_ERROR_THROTTLE_MS, { transform: (x) => x ?? DEFAULT_ERROR_THROTTLE_MS });\n readonly maxErrorsForThrottle = input<number, Maybe<number>>(MAX_ERRORS_TO_THROTTLE_ON, { transform: (x) => x ?? MAX_ERRORS_TO_THROTTLE_ON });\n readonly triggerLimit = input<Maybe<number>>();\n readonly triggerEnabled = input<boolean, Maybe<string | boolean>>(true, { alias: 'dbxActionAutoTrigger', transform: isNotFalse });\n readonly useFastTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n readonly useInstantTriggerPreset = input<boolean, Maybe<'' | boolean>>(false, { transform: isDefinedAndNotFalse });\n\n readonly triggerDebounceSignal = computed(() => {\n let debounce = this.triggerDebounce();\n\n if (debounce == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n debounce = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return debounce ?? DEFAULT_DEBOUNCE_MS;\n });\n\n readonly triggerThrottleSignal: Signal<number> = computed(() => {\n let throttle = this.triggerThrottle();\n\n if (throttle == null) {\n const useFastTrigger = this.useFastTriggerPreset();\n const useInstantTrigger = this.useInstantTriggerPreset();\n\n if (useFastTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_FAST_TRIGGER_DEBOUNCE;\n } else if (useInstantTrigger) {\n throttle = DBX_ACTION_AUTO_TRIGGER_INSTANT_TRIGGER_DEBOUNCE;\n }\n }\n\n return throttle ?? DEFAULT_THROTTLE_MS;\n });\n\n readonly triggerCountSignal = signal<number>(0);\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n // each time something is triggered the\n filter(() => this.triggerEnabled() ?? false),\n debounce(() => interval(this.triggerDebounceSignal())),\n throttle(\n () =>\n this._errorCount$.pipe(\n first(),\n exhaustMap((errorCount) => {\n const maxErrors = this.maxErrorsForThrottle() ?? MAX_ERRORS_TO_THROTTLE_ON;\n const throttleTime = this.triggerErrorThrottle() ?? DEFAULT_ERROR_THROTTLE_MS;\n const additionalInterval = Math.min(errorCount, maxErrors) * throttleTime;\n\n return interval(this.triggerThrottleSignal() + additionalInterval);\n })\n ),\n { leading: true, trailing: true }\n ),\n // Check again for the \"trailing\" piece.\n filter(() => this.triggerEnabled() ?? false),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => {\n const count = this.triggerCountSignal();\n this.triggerCountSignal.update((x) => x + 1);\n return count;\n }),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = toObservable(this.triggerEnabled).pipe(\n switchMap((enabled) => {\n let countObs: Observable<number>;\n\n if (enabled !== false) {\n countObs = this._triggerCount$;\n } else {\n countObs = EMPTY;\n }\n\n return countObs;\n })\n );\n\n private readonly _isTriggerLimited$: Observable<readonly [number, boolean]> = combineLatest([this.triggerCount$, toObservable(this.triggerLimit)]).pipe(\n map(([triggerCount, limit]) => {\n const isAllowedToRun = limit != null ? triggerCount < limit : true;\n return [triggerCount, isAllowedToRun] as const;\n }),\n shareReplay(1)\n );\n\n readonly isTriggerAllowedToRun$ = this._isTriggerLimited$.pipe(\n map((x) => x[1]),\n shareReplay(1)\n );\n\n readonly automaticTrigger$: Observable<void> = this._isTriggerLimited$.pipe(\n filter((x) => x[1]),\n distinctUntilChanged((a, b) => a[0] === b[0]), // Only trigger when the count changes.\n map(() => undefined as void)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.automaticTrigger$.subscribe(() => {\n this.source.trigger();\n })\n });\n }\n}\n","import { type Maybe, type ReadableError } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\nimport { type WorkInstanceDelegate } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * {@link WorkInstanceDelegate} implementation that bridges the `@dereekb/rxjs` work execution\n * system with the action context store.\n *\n * This delegate translates work lifecycle events (startWorking, success, reject) into\n * corresponding state transitions on the {@link DbxActionContextStoreSourceInstance},\n * allowing {@link workFactory} to drive the action state machine.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerInstance} which uses this delegate to handle value-ready events.\n */\nexport class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> implements WorkInstanceDelegate<O> {\n private _source: DbxActionContextStoreSourceInstance<T, O>;\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._source = source;\n }\n\n get source() {\n return this._source;\n }\n\n startWorking(): void {\n this.source.startWorking();\n }\n\n success(result: O): void {\n this.source.resolve(result);\n }\n\n reject(error: Maybe<ReadableError | Observable<ReadableError>>): void {\n this.source.reject(error);\n }\n}\n","import { LoadingStateType } from '@dereekb/rxjs';\nimport { type PercentNumber, type Maybe } from '@dereekb/util';\n\n/**\n * Represents the percent completion of an in-progress action.\n *\n * This is a {@link PercentNumber}, a number between 0 and 100 where 0 means just started and 100 means complete.\n *\n * @see {@link DbxActionWorkOrWorkProgress} for the union type that includes boolean working state.\n */\nexport type DbxActionWorkProgress = PercentNumber;\n\n/**\n * Union type representing either a boolean working indicator or a numeric progress value.\n *\n * - `true` indicates the action is working but no specific progress percentage is available.\n * - `false` indicates the action is not working.\n * - A {@link DbxActionWorkProgress} number (0-100) indicates both that the action is working and how far along it is.\n *\n * @see {@link DbxActionWorkProgress}\n */\nexport type DbxActionWorkOrWorkProgress = boolean | DbxActionWorkProgress;\n\n/**\n * Creates a working progress value from an array of working progress values.\n *\n * @param workOrWorkProgress The array of working progress values to use.\n * @param progressPercent An optional progress percent value to use if the working progress is a boolean.\n * @returns The working progress value.\n */\nexport function dbxActionWorkProgress(workOrWorkProgress: Maybe<DbxActionWorkOrWorkProgress>[], progressPercent?: Maybe<DbxActionWorkProgress>) {\n const workingValue = workOrWorkProgress.reduce((acc, val) => acc ?? val);\n const isWorking = workingValue != null && workingValue !== false;\n\n let workingProgress: DbxActionWorkOrWorkProgress;\n\n if (isWorking) {\n if (typeof workingValue === 'number') {\n workingProgress = workingValue;\n } else {\n workingProgress = progressPercent ?? true;\n }\n } else {\n workingProgress = false;\n }\n\n return workingProgress;\n}\n\n/**\n * Used by ActionContextState to denote what state the action is in.\n */\nexport enum DbxActionState {\n /**\n * No action in progress. Waiting for the trigger.\n */\n IDLE = 'idle',\n /**\n * Idle state that can be set to show that the source is not yet ready.\n */\n DISABLED = 'disabled',\n /**\n * The action was triggered. We wait (and allow) the value to be updated.\n */\n TRIGGERED = 'triggered',\n /**\n * The trigger was accepted and the value is updated. It should begin working immediately.\n *\n * ValueReady cannot be set until triggered is set.\n */\n VALUE_READY = 'valueReady',\n /**\n * The action is in progress.\n */\n WORKING = 'working',\n /**\n * The trigger, action, or value was rejected due to an error or other issue.\n *\n * An error may be specified optionally.\n */\n REJECTED = 'rejected',\n /**\n * The action resolved without issue.\n */\n RESOLVED = 'resolved'\n}\n\n/**\n * Pairs the input value with the output result from a successfully resolved action.\n *\n * Emitted by {@link ActionContextStore.successPair$} when an action completes without error.\n *\n * @typeParam T - The input value type provided to the action.\n * @typeParam O - The output result type produced by the action.\n */\nexport interface DbxActionSuccessPair<T, O> {\n readonly value: T;\n readonly result: Maybe<O>;\n}\n\n/**\n * Pairs the input value with the error from a rejected action.\n *\n * Emitted by {@link ActionContextStore.rejectedPair$} when an action fails.\n *\n * @typeParam T - The input value type that was provided to the action before rejection.\n */\nexport interface DbxActionRejectedPair<T> {\n readonly value: T;\n readonly error: unknown;\n}\n\n/**\n * Unique string key used to track individual reasons for disabling an action.\n *\n * Multiple keys can be active simultaneously, and the action remains disabled\n * as long as at least one key is present. This allows multiple independent sources\n * (e.g., form validation, permissions, working state) to each control the disabled state\n * without conflicting with one another.\n *\n * @see {@link ActionContextStore.disable}\n * @see {@link ActionContextStore.enable}\n */\nexport type DbxActionDisabledKey = string;\n\n/**\n * The default disabled key used when no specific key is provided to {@link ActionContextStore.disable}.\n */\nexport const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';\n\n/**\n * Determines whether the given action state represents an idle-like state.\n *\n * Idle-like states include IDLE, DISABLED, REJECTED, and RESOLVED -- any state\n * where the action is not currently in-progress (triggered, value-ready, or working).\n *\n * @param actionState - The action state to check.\n * @returns `true` if the state is idle-like, `false` if the action is in-progress.\n */\nexport function isIdleActionState(actionState: DbxActionState): boolean {\n switch (actionState) {\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n case DbxActionState.REJECTED:\n case DbxActionState.RESOLVED:\n return true;\n case DbxActionState.TRIGGERED:\n case DbxActionState.VALUE_READY:\n case DbxActionState.WORKING:\n return false;\n }\n}\n\n/**\n * Maps a {@link DbxActionState} to the corresponding {@link LoadingStateType}.\n *\n * This bridges the action state machine with the loading state system from `@dereekb/rxjs`,\n * allowing action states to be represented as loading states for UI display.\n *\n * @param actionState - The action state to convert.\n * @returns The corresponding loading state type (IDLE, LOADING, SUCCESS, or ERROR).\n */\nexport function loadingStateTypeForActionState(actionState: DbxActionState): LoadingStateType {\n let loadingStateType: LoadingStateType;\n\n switch (actionState) {\n case DbxActionState.RESOLVED:\n loadingStateType = LoadingStateType.SUCCESS;\n break;\n case DbxActionState.REJECTED:\n loadingStateType = LoadingStateType.ERROR;\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingStateType = LoadingStateType.IDLE;\n break;\n case DbxActionState.TRIGGERED:\n case DbxActionState.VALUE_READY:\n case DbxActionState.WORKING:\n loadingStateType = LoadingStateType.LOADING;\n break;\n }\n\n return loadingStateType;\n}\n","import { Injectable, type OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type Observable, distinctUntilChanged, filter, map, shareReplay, switchMap, startWith, of } from 'rxjs';\nimport { type BooleanStringKeyArray, BooleanStringKeyArrayUtility, type Maybe, type ReadableError } from '@dereekb/util';\nimport { type LoadingStateType, idleLoadingState, errorResult, filterMaybe, type LoadingState, scanCount, successResult, beginLoading } from '@dereekb/rxjs';\nimport { type DbxActionDisabledKey, type DbxActionRejectedPair, DbxActionState, type DbxActionSuccessPair, type DbxActionWorkOrWorkProgress, type DbxActionWorkProgress, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState, loadingStateTypeForActionState } from './action';\nimport { cleanLockSet } from '../rxjs';\n\n/**\n * Checks whether the action context is enabled (not disabled by any key).\n *\n * @param state - The current action context state to check.\n * @returns `true` if no disabled keys are active.\n */\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isFalse(state.disabled);\n}\n\n/**\n * Checks whether the action context is disabled by at least one disabled key.\n *\n * @param state - The current action context state to check.\n * @returns `true` if any disabled keys are active.\n */\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtility.isTrue(state.disabled);\n}\n\n/**\n * Checks whether the action context state represents an effectively disabled state.\n *\n * An action is considered disabled when it is both idle (not in-progress) and has\n * at least one active disabled key.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action is idle and disabled.\n */\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\n/**\n * Checks whether the given action state represents an in-progress (non-idle) state.\n *\n * This is the inverse of {@link isIdleActionState}. Returns `true` for TRIGGERED, VALUE_READY, and WORKING states.\n *\n * @param actionState - The action state to check.\n * @returns `true` if the action is in any non-idle state.\n */\nexport function isWorkingActionState(actionState: DbxActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\n/**\n * Determines whether the action state allows triggering.\n *\n * An action can be triggered when it is idle (but not DISABLED specifically) and\n * not already in-progress.\n *\n * @param actionState - The action state to check.\n * @returns `true` if the action can be triggered from this state.\n */\nexport function canTriggerActionState(actionState: DbxActionState): boolean {\n return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);\n}\n\n/**\n * Determines whether the action can be triggered based on the full context state.\n *\n * Requires the action to be both enabled (no disabled keys) and in an idle action state.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action can be triggered.\n */\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\n/**\n * Determines whether a value can be readied for the action.\n *\n * A value can only be readied when the action is in the TRIGGERED state,\n * which means the trigger has been activated and the system is waiting for a value.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action is in the TRIGGERED state.\n */\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === DbxActionState.TRIGGERED;\n}\n\n/**\n * Checks whether the action context is both modified and ready to be triggered.\n *\n * This is commonly used by auto-trigger directives to determine when to fire automatically.\n *\n * @param state - The current action context state to check.\n * @returns `true` if the action is modified and can be triggered.\n */\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\n/**\n * Checks whether the action context has no error, is modified, and can be triggered.\n *\n * A stricter variant of {@link actionContextIsModifiedAndCanTrigger} that also requires\n * no error to be present in the current state.\n *\n * @param state - The current action context state to check.\n * @returns `true` if no error exists and the action is modified and triggerable.\n */\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\n/**\n * Converts an {@link ActionContextState} to a {@link LoadingState} for UI consumption.\n *\n * Maps the action lifecycle states to loading state equivalents:\n * - RESOLVED -> success result with the output value\n * - REJECTED -> error result with the error\n * - IDLE/DISABLED -> idle loading state\n * - All other states -> loading (with optional work progress)\n *\n * @typeParam O - The output result type.\n * @param state - The action context state to convert.\n * @returns A loading state representation of the action context state.\n */\nexport function loadingStateForActionContextState<O = unknown>(state: ActionContextState<unknown, O>): LoadingState<O> {\n let loadingState: LoadingState<O>;\n\n switch (state.actionState) {\n case DbxActionState.RESOLVED:\n loadingState = successResult(state.result);\n break;\n case DbxActionState.REJECTED:\n loadingState = errorResult(state.error);\n break;\n case DbxActionState.IDLE:\n case DbxActionState.DISABLED:\n loadingState = idleLoadingState();\n break;\n case DbxActionState.TRIGGERED:\n case DbxActionState.VALUE_READY:\n case DbxActionState.WORKING:\n loadingState = beginLoading(state.workProgress != null ? { loadingProgress: state.workProgress } : undefined);\n break;\n }\n\n return loadingState;\n}\n\n/**\n * Extracts the {@link LoadingStateType} from the current action context state.\n *\n * A convenience wrapper around {@link loadingStateTypeForActionState} that accepts the full context state.\n *\n * @param state - The action context state to convert.\n * @returns The corresponding loading state type.\n */\nexport function loadingStateTypeForActionContextState(state: ActionContextState): LoadingStateType {\n return loadingStateTypeForActionState(state.actionState);\n}\n\n/**\n * Immutable snapshot of the entire action context state at a given point in time.\n *\n * This is the core state shape managed by {@link ActionContextStore}. It captures:\n * - The current lifecycle phase ({@link DbxActionState})\n * - Whether the source data has been modified\n * - The input value (set after trigger), the output result (set on success), and any error (set on rejection)\n * - The disabled state (a set of keys that each independently control disabling)\n * - Optional work progress for long-running actions\n *\n * @typeParam T - The input value type provided to the action after triggering.\n * @typeParam O - The output result type produced on successful resolution.\n */\nexport interface ActionContextState<T = unknown, O = unknown> {\n readonly actionState: DbxActionState;\n /**\n * Whether or not this action is flagged as having been modified.\n */\n readonly isModified: boolean;\n /**\n * The working progress of the action.\n *\n * Is reset to null when triggered/ready value is set.\n */\n readonly workProgress?: Maybe<DbxActionWorkProgress>;\n /**\n * Value that is set after a triggered action. Not to be confused with result.\n */\n readonly value?: Maybe<T>;\n /**\n * Resolved result value.\n */\n readonly result?: Maybe<O>;\n /**\n * Rejected error, if available.\n */\n readonly error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n readonly disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n readonly errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: DbxActionState.IDLE\n};\n\n/**\n * Delay in milliseconds before the lock set destroys the store after all locks are released.\n * Provides a grace period for actions to finalize before the store is torn down.\n */\nexport const ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME = 2000;\n\n/**\n * NgRx ComponentStore that manages the reactive state machine for a single action lifecycle.\n *\n * This is the central state container for the action system. It tracks the full lifecycle\n * of an action from idle through trigger, value preparation, work execution, and resolution\n * or rejection. Multiple selectors expose derived reactive streams for each phase.\n *\n * The store uses a {@link LockSet} for cleanup coordination: it delays its own destruction\n * until all in-flight work completes (e.g., a working action finishes), preventing\n * premature teardown of subscriptions.\n *\n * State transitions follow this flow:\n * ```\n * IDLE/DISABLED -> TRIGGERED -> VALUE_READY -> WORKING -> RESOLVED | REJECTED\n * ```\n *\n * @typeParam T - The input value type provided after triggering.\n * @typeParam O - The output result type produced on resolution.\n *\n * @see {@link ActionContextStoreSource} for providing store access to directives.\n * @see {@link DbxActionContextStoreSourceInstance} for the convenience wrapper.\n */\n@Injectable()\nexport class ActionContextStore<T = unknown, O = unknown> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n readonly lockSet = cleanLockSet({\n onLockSetDestroy: () => super.ngOnDestroy(),\n destroyLocksetTiming: {\n delayTime: ACTION_CONTEXT_STORE_LOCKSET_DESTROY_DELAY_TIME\n }\n });\n\n constructor() {\n super({ ...INITIAL_STATE } as ActionContextState<T, O>);\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(\n map((x) => (isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState)),\n shareReplay(1)\n );\n\n /**\n * Returns the current disabled reasons/keys.\n */\n readonly disabledKeys$ = this.state$.pipe(\n map((x) => [...(x.disabled ?? [])]),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Current value of the state.\n */\n readonly currentValue$: Observable<Maybe<T>> = this.state$.pipe(map((x) => x.value));\n\n /**\n * Maps the current state to true or not when the action state changes to/from disabled.\n */\n readonly isDisabled$ = this.state$.pipe(map(isDisabledActionContextState), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipes when idle but modified.\n */\n readonly isModified$ = this.afterDistinctBoolean((x) => x.isModified);\n\n /**\n * Pipes true when idle.\n */\n readonly idle$ = this.actionState$.pipe(\n map((x) => x === DbxActionState.IDLE),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes true when triggered.\n */\n readonly triggered$ = this.afterDistinctActionState(DbxActionState.TRIGGERED, () => true);\n\n /**\n * Pipes the readied value on ValueReady.\n */\n readonly valueReady$: Observable<T> = this.afterDistinctActionState(DbxActionState.VALUE_READY, (x) => x.value as T);\n\n /**\n * Pipes the working progress on the working state.\n */\n readonly workProgress$ = this.state$.pipe(\n map((x) => x.workProgress),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the error on the rejection state.\n */\n readonly rejected$ = this.afterDistinctActionState(DbxActionState.REJECTED, (x) => x.error);\n\n /**\n * Pipes the result when the ActionState becomes rejected.\n */\n readonly rejectedPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, error: x.error }) as DbxActionRejectedPair<T>);\n\n /**\n * Pipes the result when the ActionState becomes working.\n */\n readonly working$ = this.afterDistinctActionState(DbxActionState.WORKING, () => true);\n\n /**\n * Whether or not it is currently in a working state.\n */\n readonly isWorking$ = this.afterDistinctBoolean((x) => isWorkingActionState(x.actionState));\n\n /**\n * Pipes the current work or work progress.\n */\n readonly isWorkingOrWorkProgress$ = this.isWorking$.pipe(\n switchMap((x) => {\n let obs: Observable<DbxActionWorkOrWorkProgress>;\n\n if (x) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n startWith(x)\n );\n } else {\n obs = of(x);\n }\n\n return obs;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the current error.\n */\n readonly error$ = this.state$.pipe(\n map((x) => x.error),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly success$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => x.result);\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly successPair$ = this.afterDistinctActionState(DbxActionState.RESOLVED, (x) => ({ value: x.value, result: x.result }) as DbxActionSuccessPair<T, O>);\n\n /**\n * Whether or not it is currently in a success state.\n */\n readonly isSuccess$ = this.afterDistinctBoolean((x) => x.actionState === DbxActionState.RESOLVED);\n\n /**\n * Returns a loading state based on the current state.\n */\n readonly loadingState$ = this.afterDistinctLoadingStateTypeChange().pipe(\n switchMap((x) => {\n const base = loadingStateForActionContextState<O>(x);\n let obs: Observable<LoadingState<O>>;\n\n if (base.loading === true) {\n obs = this.workProgress$.pipe(\n filter((x) => x != null),\n map((loadingProgress) => ({ ...base, loadingProgress })),\n startWith(base)\n );\n } else {\n obs = of(base);\n }\n\n return obs;\n }),\n shareReplay(1)\n );\n\n /**\n * Returns the current LoadingStateType based on the current state.\n */\n readonly loadingStateType$ = this.state$.pipe(\n map((x) => loadingStateTypeForActionContextState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Number of errors since last success.\n */\n readonly errorCountSinceLastSuccess$ = this.isSuccess$.pipe(\n startWith(false),\n distinctUntilChanged(),\n switchMap(() => this.error$.pipe(filterMaybe(), scanCount(), startWith(0))),\n shareReplay(1)\n );\n\n /**\n * Whether or not the state can be triggered.\n */\n readonly canTrigger$ = this.state$.pipe(map(canTriggerAction), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipe that maps whether or not this is modified and can be triggered.\n *\n * Updates every state update instead of when the value changes.\n */\n readonly isModifiedAndCanTriggerUpdates$ = this.state$.pipe(\n map((x) => actionContextIsModifiedAndCanTrigger(x)),\n shareReplay(1)\n );\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(distinctUntilChanged());\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Adds a disabled reason.\n */\n readonly disable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.insert(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Removes a disabled reason.\n */\n readonly enable = this.updater((state, key?: void | DbxActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtility.remove(state.disabled, (key as string) ?? DEFAULT_ACTION_DISABLED_KEY)\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n *\n * Equivalent to calling setIsModified() with opposite input.\n */\n readonly setIsSame = this.updater<void, void | boolean>(updateIsSameOnActionContextState);\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater<void, void | boolean>(updateIsModifiedOnActionContextState);\n\n /**\n * Triggers the action if the state is currently not idle. The current state is cleared, but the error is retained (as we may need the error from the previous attempt).\n *\n * Will not fire if the action is disabled.\n */\n readonly trigger = this.updater((state) => (canTriggerAction(state) ? { isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined } : state));\n\n /**\n * Updates the value, setting value ready. The current result is cleared.\n */\n readonly readyValue = this.updater((state, value: T) => (canReadyValue(state) ? { ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined } : state));\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: DbxActionState.WORKING, workProgress: null }));\n\n /**\n * Updates the working progress.\n */\n readonly setWorkProgress = this.updater((state, workProgress: Maybe<DbxActionWorkProgress>) => ({ ...state, workProgress }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({\n isModified: state.isModified,\n actionState: DbxActionState.REJECTED,\n error,\n errorCount: (state.errorCount ?? 0) + 1,\n disabled: state.disabled\n }));\n\n /**\n * Updates the state to success, and optionally sets a result.\n *\n * Clears modified state, and any errors.\n */\n readonly resolve = this.updater((state, result?: Maybe<O>) => ({ isModified: false, actionState: DbxActionState.RESOLVED, value: state.value, result, error: undefined, disabled: state.disabled }));\n\n /**\n * Completely resets the store.\n */\n readonly reset = this.updater(() => ({ ...INITIAL_STATE }) as ActionContextState<T, O>);\n\n // MARK: Utility\n afterDistinctBoolean(fromState: (state: ActionContextState<T, O>) => boolean): Observable<boolean> {\n return this.state$.pipe(\n map((x) => fromState(x)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n afterDistinctActionState<X>(actionState: DbxActionState, fromState: (state: ActionContextState<T, O>) => X): Observable<X> {\n return this.afterDistinctActionStateChange().pipe(\n filter((x) => x.actionState === actionState), // Only pipe when the new action state matches.\n map((x) => fromState(x)),\n shareReplay(1)\n );\n }\n\n afterDistinctActionStateChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, x.actionState] as [ActionContextState, DbxActionState]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n afterDistinctLoadingStateTypeChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => [x, loadingStateTypeForActionContextState(x)] as [ActionContextState, LoadingStateType]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the loading state remains the same.\n map((x) => x[0] as ActionContextState<T, O>),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method\n override ngOnDestroy(): void {\n // do not call super.destroy here, to keep the component store from destroying itself.\n // the lockset is configured to cleanup the component store.\n }\n}\n\nfunction updateIsSameOnActionContextState<T, O>(state: ActionContextState<T, O>, isSame?: void | boolean): ActionContextState<T, O> {\n return updateIsModifiedOnActionContextState(state, isSame == null ? false : !isSame);\n}\n\nfunction updateIsModifiedOnActionContextState<T, O>(state: ActionContextState<T, O>, isModified?: void | boolean): ActionContextState<T, O> {\n return {\n ...state,\n actionState: state.actionState === DbxActionState.RESOLVED ? DbxActionState.IDLE : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true // if isModified is not input, default it to true\n };\n}\n","import { type Observable, of } from 'rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { type LockSet } from '@dereekb/rxjs';\nimport { type ActionContextStoreSource, DbxActionContextStoreSourceInstance, type SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\nimport { type DbxActionDisabledKey } from './action';\n\n/**\n * Base class for action context sources that can either reuse an existing\n * {@link SecondaryActionContextStoreSource} or create their own internal {@link ActionContextStore}.\n *\n * If a secondary source is provided (typically via Angular DI), it is used directly,\n * enabling store sharing across component boundaries. Otherwise, a new standalone store is created.\n *\n * This class also creates a {@link DbxActionContextStoreSourceInstance} for convenient access\n * to the store's reactive streams and imperative methods.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionDirective} which extends this class.\n * @see {@link DbxActionContextMachine} which extends this class for programmatic use.\n */\nexport abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {\n private readonly _inputSource: Maybe<SecondaryActionContextStoreSource<T, O>>;\n\n private readonly _store?: ActionContextStore<T, O>;\n private readonly _store$: Observable<ActionContextStore<T, O>>;\n private readonly _instance: DbxActionContextStoreSourceInstance<T, O>;\n\n readonly isModified$: Observable<boolean>;\n readonly triggered$: Observable<boolean>;\n readonly success$: Observable<Maybe<O>>;\n\n constructor(inputSource?: Maybe<SecondaryActionContextStoreSource<T, O>>) {\n this._inputSource = inputSource;\n\n if (inputSource) {\n this._store$ = inputSource.store$;\n } else {\n this._store = new ActionContextStore();\n this._store$ = of(this._store);\n }\n\n this._instance = new DbxActionContextStoreSourceInstance(this);\n this.isModified$ = this._instance.isModified$;\n this.triggered$ = this._instance.triggered$;\n this.success$ = this._instance.success$;\n }\n\n destroy(): void {\n if (this._store) {\n this._store.ngOnDestroy();\n this._instance.destroy();\n }\n }\n\n get inputSource() {\n return this._inputSource;\n }\n\n get lockSet(): LockSet {\n return this._instance.lockSet;\n }\n\n get sourceInstance(): DbxActionContextStoreSourceInstance<T, O> {\n return this._instance;\n }\n\n get store$(): Observable<ActionContextStore<T, O>> {\n return this._store$;\n }\n\n /**\n * Use to trigger the action directly.\n */\n public trigger(): void {\n this._instance.trigger();\n }\n\n public readyValue(value: T | Observable<T>): void {\n this._instance.readyValue(value);\n }\n\n /**\n * Triggers the context and then readies the value.\n *\n * @param value\n */\n public triggerWithValue(value: T | Observable<T>): void {\n this._instance.triggerWithValue(value);\n }\n\n public reset(): void {\n this._instance.reset();\n }\n\n public enable(key?: DbxActionDisabledKey, enable?: boolean): void {\n this._instance.enable(key, enable);\n }\n\n public disable(key?: DbxActionDisabledKey, disable?: boolean): void {\n this._instance.disable(key, disable);\n }\n\n public setIsModified(isModified?: boolean): void {\n this._instance.setIsModified(isModified);\n }\n}\n","import { type DbxActionContextSourceReference } from './action.reference';\nimport { delay, first } from 'rxjs';\nimport { type ActionContextStoreSource } from './action.store.source';\nimport { DbxActionWorkInstanceDelegate } from './action.handler';\nimport { DbxActionContextBaseSource } from './action.holder';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { SubscriptionObject, type Work, workFactory } from '@dereekb/rxjs';\nimport { Injectable } from '@angular/core';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Configuration for a {@link DbxActionContextMachine}.\n *\n * Controls how the machine handles the value-ready phase, whether it self-destructs\n * after a single use, and optional callbacks for success events.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n */\nexport interface DbxActionContextMachineConfig<T = unknown, O = unknown> {\n /**\n * Whether or not the machine should clean itself up after being triggered once.\n */\n readonly oneTimeUse: boolean;\n /**\n * Function to handle any valueReady events.\n *\n * If false, will not subscribe/handle valueReady$ events.\n */\n readonly handleValueReady: Work<T, O> | false;\n /**\n * Optional function to execute after the action has succeeded.\n */\n readonly onSuccess?: (value: Maybe<O>) => void;\n}\n\n/**\n * Configurable machine that handles components of the ActionContextStore lifecycle.\n *\n * It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.\n */\nexport class DbxActionContextMachine<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {\n private _isShutdown = true;\n\n private readonly _config: DbxActionContextMachineConfig<T, O>;\n private readonly _handleValueReadySub = new SubscriptionObject();\n private readonly _successSub = new SubscriptionObject();\n\n constructor(config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>) {\n super(source);\n this._config = config;\n\n // Handle Value Ready\n if (config.handleValueReady !== false) {\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n const doWork = workFactory({\n work: config.handleValueReady as Work<T, O>,\n delegate: new DbxActionWorkInstanceDelegate<T, O>(this.sourceInstance)\n });\n\n doWork(value);\n });\n }\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (config.onSuccess) {\n this._successSub.subscription = this.sourceInstance.success$.subscribe(config.onSuccess);\n }\n }\n\n override destroy(): void {\n super.destroy();\n this._handleValueReadySub.destroy();\n this._successSub.destroy();\n this._isShutdown = true;\n }\n\n get config() {\n return this._config;\n }\n\n get isShutdown(): boolean {\n return this._isShutdown;\n }\n}\n\n/**\n * DbxActionContextMachine configured for use as a Service/Injectable.\n */\n@Injectable()\nexport class DbxActionContextMachineAsService<T = unknown, O = unknown> extends DbxActionContextMachine<T, O> {\n constructor() {\n super({\n oneTimeUse: false,\n handleValueReady: false\n });\n\n clean(() => this.destroy());\n }\n}\n","import { forwardRef, type Provider, type Type } from '@angular/core';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { DbxActionContextMachineAsService } from './action.machine';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Creates Angular DI providers for an {@link ActionContextStoreSource} and its associated {@link DbxActionContextStoreSourceInstance}.\n *\n * When `sourceType` is provided, the existing class is registered as the source. When `null`,\n * a standalone {@link DbxActionContextMachineAsService} is created as the default implementation.\n *\n * @param sourceType - The concrete source class to register, or `null` to use the default machine-based implementation\n * @returns An array of Angular providers\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myAction]',\n * providers: provideActionStoreSource(MyActionDirective),\n * })\n * export class MyActionDirective extends ActionContextStoreSource { ... }\n * ```\n */\nexport function provideActionStoreSource<S extends ActionContextStoreSource>(sourceType: Type<S> | null): Provider[] {\n const storeSourceProvider: Provider =\n sourceType != null\n ? {\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n }\n : {\n provide: ActionContextStoreSource,\n useFactory: () => new DbxActionContextMachineAsService()\n };\n\n return [\n storeSourceProvider,\n {\n provide: DbxActionContextStoreSourceInstance,\n useFactory: (source: ActionContextStoreSource) => clean(new DbxActionContextStoreSourceInstance(source)),\n deps: [ActionContextStoreSource]\n }\n ];\n}\n\n/**\n * Creates Angular DI providers for a {@link SecondaryActionContextStoreSource} along with\n * the standard {@link ActionContextStoreSource} and {@link DbxActionContextStoreSourceInstance} providers.\n *\n * @param sourceType - The concrete secondary source class to register\n * @returns An array of Angular providers\n */\nexport function provideSecondaryActionStoreSource<S extends SecondaryActionContextStoreSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, inject } from '@angular/core';\nimport { SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideActionStoreSource } from '../../action.store.source.provide';\nimport { DbxActionContextBaseSource } from '../../action.holder';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Core directive that creates and provides an action context for its host element and descendants.\n *\n * This is the root of the action system in templates. It creates an {@link ActionContextStore}\n * and provides it (along with the related source tokens) via Angular's dependency injection,\n * making the action lifecycle available to all child action directives.\n *\n * If a {@link SecondaryActionContextStoreSource} is available on the host, the directive will\n * reuse that store instead of creating its own, enabling action context forwarding.\n *\n * On destruction, the directive coordinates cleanup through a {@link LockSet} to ensure\n * in-flight operations complete before the store is torn down.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <button (click)=\"action.trigger()\">Submit</button>\n * <div *dbxActionHasSuccess>Success!</div>\n * <div *dbxActionWorking>Loading...</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- As an element -->\n * <dbx-action>\n * <ng-container [dbxActionHandler]=\"handleAction\">...</ng-container>\n * </dbx-action>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionSourceDirective} for forwarding an external action source.\n * @see {@link ActionContextStore} for the underlying state store.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction]',\n exportAs: 'action,dbxAction',\n providers: provideActionStoreSource(DbxActionDirective),\n standalone: true\n})\nexport class DbxActionDirective<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> {\n constructor() {\n super(inject(SecondaryActionContextStoreSource<T, O>, { optional: true, host: true }));\n\n // during cleaning/onDestroy, queue the lockset for cleanup\n clean(() => {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n });\n }\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { type SecondaryActionContextStoreSource, type ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that forwards an externally-provided {@link ActionContextStoreSource} as a\n * {@link SecondaryActionContextStoreSource}, enabling child `dbxAction` directives to\n * reuse an existing action context rather than creating their own.\n *\n * This is useful when an action context is created programmatically (e.g., via\n * {@link DbxActionContextMachine}) and needs to be shared with template-based directives.\n *\n * @example\n * ```html\n * <!-- Forward a programmatic action source to template directives -->\n * <div [dbxActionSource]=\"myActionSource\">\n * <div dbxAction>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionDirective} for the directive that consumes this source.\n * @see {@link SecondaryActionContextStoreSource}\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: provideSecondaryActionStoreSource(DbxActionSourceDirective),\n standalone: true\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource {\n readonly dbxActionSource = input<Maybe<ActionContextStoreSource>>();\n\n readonly store$ = toObservable(this.dbxActionSource).pipe(\n filterMaybe(),\n switchMap((x) => actionContextStoreSourcePipe(x.store$))\n );\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs/lockset';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Debug directive that logs every action context state change to the console.\n *\n * Subscribes to the parent action's full state stream and prints each state snapshot\n * via `console.log`. Useful during development to inspect the action lifecycle transitions.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionLogger></ng-container>\n * <!-- other action directives -->\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]',\n standalone: true\n})\nexport class DbxActionContextLoggerDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.state$.subscribe((state) => {\n console.log('dbxActionLogger - state: ', state);\n })\n });\n }\n}\n","import { BehaviorSubject, distinctUntilChanged, map, type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { type ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { type Destroyable } from '@dereekb/util';\n\n/**\n * Arbitrary string key used to identify and look up an action within an {@link ActionContextStoreSourceMap}.\n *\n * Each key maps to a unique {@link ActionContextStoreSource}, allowing multiple independent\n * actions to be managed and referenced by name in a single map context.\n */\nexport type ActionKey = string;\n\n/**\n * Abstract map that associates {@link ActionKey} values with {@link ActionContextStoreSource} instances.\n *\n * This allows multiple independent actions to be registered and retrieved by key,\n * enabling coordination between related actions (e.g., disabling one while another is working).\n *\n * @typeParam T - The input value type for the actions.\n * @typeParam O - The output result type for the actions.\n *\n * @see {@link actionContextStoreSourceMap} for the factory function.\n * @see {@link DbxActionContextMapDirective} for the directive that provides this in templates.\n */\nexport abstract class ActionContextStoreSourceMap<T = unknown, O = unknown> implements Destroyable {\n /**\n * Returns the read-only map of action keys to sources.\n */\n abstract readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n /**\n * Returns a ActionContextStoreSource for the input action key.\n *\n * @param key Action key to retrieve the source for.\n */\n abstract sourceForKey(key: ActionKey): ActionContextStoreSource<T, O>;\n /**\n * Adds the store source for the input key.\n *\n * @param key Action key to add the source for.\n * @param source Store source to add.\n */\n abstract addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void;\n /**\n * Removes the store source for the input key.\n *\n * @param key Action key to remove the source for.\n */\n abstract removeStoreSource(key: ActionKey): void;\n /**\n * Destroys the map.\n */\n abstract destroy(): void;\n}\n\n/**\n * Creates a new ActionContextStoreSourceMap.\n *\n * @returns A new ActionContextStoreSourceMap.\n */\nexport function actionContextStoreSourceMap<T = unknown, O = unknown>(): ActionContextStoreSourceMap<T, O> {\n const _actionKeySourceMap = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource<T, O>>>(new Map());\n const actionKeySourceMap$ = _actionKeySourceMap.asObservable();\n\n function updateMap(fn: (map: Map<ActionKey, ActionContextStoreSource<T, O>>) => Map<ActionKey, ActionContextStoreSource<T, O>> | void): void {\n const currentMap = _actionKeySourceMap.value;\n const nextMap = fn(currentMap) ?? currentMap;\n _actionKeySourceMap.next(nextMap);\n }\n\n function sourceForKey(key: ActionKey): ActionContextStoreSource<T, O> {\n const _store$ = actionKeySourceMap$.pipe(\n map((x) => x.get(key)),\n distinctUntilChanged(),\n switchMap((x) => x?.store$ ?? of(undefined)),\n shareReplay(1)\n );\n\n const source: ActionContextStoreSource<T, O> = {\n store$: actionContextStoreSourcePipe(_store$)\n };\n\n return source;\n }\n\n function addStoreSource(key: ActionKey, source: ActionContextStoreSource<T, O>): void {\n updateMap((actionKeySourceMap) => {\n if (actionKeySourceMap.has(key)) {\n throw new Error(`Key already existed for \"${key}\" in map. Ensure the previous store is removed before setting another.`);\n } else if (!source) {\n throw new Error('addStoreSource requires a source.');\n }\n\n actionKeySourceMap.set(key, source);\n return actionKeySourceMap;\n });\n }\n\n function removeStoreSource(key: ActionKey): void {\n updateMap((actionKeySourceMap) => {\n if (!actionKeySourceMap.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n return actionKeySourceMap;\n });\n }\n\n function destroy(): void {\n _actionKeySourceMap.complete();\n }\n\n const result: ActionContextStoreSourceMap<T, O> = {\n actionKeySourceMap$: actionKeySourceMap$,\n sourceForKey: sourceForKey,\n addStoreSource: addStoreSource,\n removeStoreSource: removeStoreSource,\n destroy\n };\n\n return result;\n}\n","import { Directive, inject } from '@angular/core';\nimport { actionContextStoreSourceMap, ActionContextStoreSourceMap } from './action.map';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Directive that creates and provides an {@link ActionContextStoreSourceMap} for its descendants.\n *\n * This enables a group of related action contexts to be registered by key and looked up\n * by child directives. Useful when multiple actions need to coordinate (e.g., disable\n * all other actions while one is working).\n *\n * The map is exported as `actionMap` for template reference access.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'save'\">...</div>\n * <div dbxAction [dbxActionMapSource]=\"'delete'\">...</div>\n * <div [dbxActionFromMap]=\"'save'\">\n * <!-- consumes the 'save' action context -->\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionFromMapDirective} for consuming actions by key.\n * @see {@link DbxActionMapSourceDirective} for registering actions by key.\n * @see {@link DbxActionMapWorkingDisableDirective} for cross-action disable coordination.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n providers: [\n {\n provide: ActionContextStoreSourceMap,\n useFactory: actionContextStoreSourceMap\n }\n ],\n exportAs: 'actionMap',\n standalone: true\n})\nexport class DbxActionContextMapDirective {\n readonly actionContextStoreSourceMap = clean(inject(ActionContextStoreSourceMap));\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { switchMap } from 'rxjs';\nimport { ActionContextStoreSourceMap, type ActionKey } from './action.map';\nimport { type SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { provideSecondaryActionStoreSource } from '../../action.store.source.provide';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Directive that retrieves an {@link ActionContextStoreSource} from an ancestor\n * {@link DbxActionContextMapDirective} using the provided key, and provides it as\n * a {@link SecondaryActionContextStoreSource} for descendant `dbxAction` directives.\n *\n * This allows a child action context to bind to an action that was registered elsewhere\n * in the template via {@link DbxActionMapSourceDirective}.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'myAction'\">...</div>\n * <!-- Consume the registered action elsewhere in the tree -->\n * <div [dbxActionFromMap]=\"'myAction'\">\n * <div dbxAction>\n * <div *dbxActionHasSuccess>Done!</div>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionContextMapDirective} for the parent map provider.\n * @see {@link DbxActionMapSourceDirective} for registering an action into the map.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: provideSecondaryActionStoreSource(DbxActionFromMapDirective),\n standalone: true\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionFromMap' });\n readonly key$ = toObservable(this.key);\n\n readonly store$ = this.key$.pipe(\n filterMaybe(),\n switchMap((x) => this._actionContextStoreSourceMap.sourceForKey(x).store$)\n );\n}\n","import { Directive, type OnDestroy, effect, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { ActionContextStoreSourceMap, type ActionKey } from './action.map';\n\n/**\n * Directive that registers the host element's {@link ActionContextStoreSource} into an ancestor\n * {@link ActionContextStoreSourceMap} under the provided key.\n *\n * When the key changes, the previous registration is removed and the new one is added.\n * On destroy, the registration is cleaned up automatically.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'save'\">\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionContextMapDirective} for the parent map provider.\n * @see {@link DbxActionFromMapDirective} for consuming registered actions by key.\n */\n@Directive({\n selector: '[dbxActionMapSource]',\n standalone: true\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(ActionContextStoreSource, { host: true });\n\n readonly key = input<Maybe<ActionKey>>(undefined, { alias: 'dbxActionMapSource' });\n private _currentKey: Maybe<ActionKey>;\n\n protected readonly _keyEffect = effect(() => {\n const nextKey = this.key();\n\n if (this._currentKey !== nextKey) {\n this._removeFromToStore();\n }\n\n this._currentKey = nextKey;\n this._addToStore();\n });\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n private _addToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.addStoreSource(this._currentKey, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._currentKey) {\n this._actionContextStoreSourceMap.removeStoreSource(this._currentKey);\n }\n }\n}\n","import { asObservable, combineLatestFromMapValuesObsFn, type IsCheckFunction, type ObservableOrValue } from '@dereekb/rxjs';\nimport { map, type Observable, switchMap } from 'rxjs';\nimport { type ActionContextStore } from '../../action.store';\nimport { type ActionContextStoreSourceMap, type ActionKey } from './action.map';\nimport { type ActionContextStoreSource } from '../../action.store.source';\nimport { reduceBooleansWithOrFn } from '@dereekb/util';\n\n/**\n * Utility interface that provides a set of functions to read from an ActionContextStoreSourceMap.\n */\nexport interface ActionContextStoreSourceMapReader<T = unknown, O = unknown> {\n /**\n * The input key source map.\n */\n readonly actionKeySourceMap$: Observable<Map<ActionKey, ActionContextStoreSource<T, O>>>;\n\n /**\n * Checks if any of the stores in the map match the input checkFunction.\n *\n * @param checkFunction Function to apply to each store.\n * @param emptyArrayValue Value to return if the map is empty.\n */\n checkAny(checkFunction: IsCheckFunction<ActionContextStore<T, O>>, emptyArrayValue?: boolean): Observable<boolean>;\n\n /**\n * Reduces a value from all stores in the map.\n *\n * @param mapFn Function to apply to each store.\n * @param reduceFn Function to apply to the results of the mapFn.\n */\n reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y>;\n\n /**\n * Reads a value from each store in the map and returns an array of the results.\n *\n * @param mapFn Function to apply to each store.\n */\n fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]>;\n}\n\n/**\n * Creates a new {@link ActionContextStoreSourceMapReader} from the given action key source map.\n *\n * The reader provides reactive utility functions to aggregate data across all stores\n * in the map (e.g., checking if any store is working, or reducing values from all stores).\n *\n * @typeParam T - The input value type for the actions.\n * @typeParam O - The output result type for the actions.\n * @param actionKeySourceMap$ - Observable (or static value) of the action key to source map.\n * @returns A reader with aggregate query functions over the map's stores.\n */\nexport function actionContextStoreSourceMapReader<T = unknown, O = unknown>(actionKeySourceMap$: ObservableOrValue<Map<ActionKey, ActionContextStoreSource<T, O>>>): ActionContextStoreSourceMapReader<T, O> {\n const sourceMap$ = asObservable(actionKeySourceMap$);\n\n function checkAnyAre(mapFn: (input: ActionContextStore<T, O>) => Observable<boolean>, emptyArrayValue?: boolean): Observable<boolean> {\n return reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n function reduceFromAllSources<X, Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<X>, reduceFn: (values: X[]) => Y): Observable<Y> {\n return fromAllSources<X>(mapFn).pipe(map(reduceFn));\n }\n\n function fromAllSources<Y>(mapFn: (input: ActionContextStore<T, O>) => Observable<Y>): Observable<Y[]> {\n return sourceMap$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n\n return {\n actionKeySourceMap$: sourceMap$,\n fromAllSources,\n checkAny: checkAnyAre,\n reduceFromAllSources\n };\n}\n\n/**\n * Returns an Observable of the results of the mapFn for each source in the actionKeySourceMap$.\n *\n * @param actionKeySourceMap$ Observable of the action key source map.\n * @param mapFn Function to apply to each source.\n * @returns Observable of the results of the mapFn for each source.\n */\nexport function fromAllActionContextStoreSourceMapSources<O>(actionKeySourceMap$: ObservableOrValue<ActionContextStoreSourceMap>, mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return asObservable(actionKeySourceMap$).pipe(\n switchMap((x) => x.actionKeySourceMap$),\n switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn))))\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type DbxActionDisabledKey } from '../../action';\nimport { actionContextStoreSourceMapReader } from './action.map.utility';\nimport { ActionContextStoreSourceMap } from './action.map';\n\n/**\n * Default disabled key used by {@link DbxActionMapWorkingDisableDirective} to track\n * the \"another action is working\" disabled reason.\n */\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';\n\n/**\n * Directive that disables the host action when any other action in the ancestor\n * {@link ActionContextStoreSourceMap} is currently working.\n *\n * This prevents concurrent action execution within a group of related actions.\n * When all other actions finish working, the host action is automatically re-enabled.\n *\n * A custom disabled key can be provided via the `dbxActionMapWorkingDisable` input.\n *\n * @example\n * ```html\n * <div dbxActionContextMap>\n * <div dbxAction [dbxActionMapSource]=\"'save'\" dbxActionMapWorkingDisable>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * <div dbxAction [dbxActionMapSource]=\"'delete'\" dbxActionMapWorkingDisable>\n * <button (click)=\"action.trigger()\">Delete</button>\n * </div>\n * </div>\n * ```\n *\n * @see {@link DbxActionContextMapDirective} for the parent map provider.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]',\n standalone: true\n})\nexport class DbxActionMapWorkingDisableDirective {\n private readonly _actionContextStoreSourceMap = inject(ActionContextStoreSourceMap);\n\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly disabledKey = input<Maybe<DbxActionDisabledKey>>(undefined, { alias: 'dbxActionMapWorkingDisable' });\n\n readonly areAnySourcesWorking$ = actionContextStoreSourceMapReader(this._actionContextStoreSourceMap.actionKeySourceMap$).checkAny((x) => x.isWorking$, false);\n\n constructor() {\n cleanSubscription(\n this.areAnySourcesWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n })\n );\n\n clean(() => {\n this.source.enable(this.disabledKey() || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Disabled key used by {@link DbxActionDisabledDirective} to track its disabled state.\n */\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that disables or enables the parent action based on a boolean input.\n *\n * When `dbxActionDisabled` is `true` (or an empty string, which coerces to `true`),\n * the action is disabled with the {@link APP_ACTION_DISABLED_DIRECTIVE_KEY}. When `false`,\n * the disable key is removed, re-enabling the action (assuming no other sources have disabled it).\n *\n * The disable key is automatically cleaned up on directive destruction.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionDisabled]=\"isFormInvalid\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionEnforceModifiedDirective} for disabling when not modified.\n * @see {@link DbxActionDisabledOnSuccessDirective} for disabling after success.\n */\n@Directive({\n selector: '[dbxActionDisabled]',\n standalone: true\n})\nexport class DbxActionDisabledDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabled = input<boolean, Maybe<boolean | ''>>(false, { alias: 'dbxActionDisabled', transform: (value) => value !== false });\n readonly disabled$ = toObservable(this.disabled);\n\n constructor() {\n cleanSubscription(\n this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY));\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Disabled key used by {@link DbxActionDisabledOnSuccessDirective} to track the\n * \"disabled after success\" reason.\n */\nexport const APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY = 'dbx_action_disabled_on_success';\n\n/**\n * Directive that disables the parent action after it resolves successfully.\n *\n * This is useful for one-shot actions where the user should not be able to re-trigger\n * the action after it succeeds (e.g., a confirmation dialog or a single-use form submission).\n *\n * Can be disabled by setting `dbxActionDisabledOnSuccess` to `false`.\n *\n * The disable key is automatically cleaned up on directive destruction.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionDisabledOnSuccess></ng-container>\n * <button (click)=\"action.trigger()\">Confirm</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionDisabledDirective} for general-purpose disabling.\n * @see {@link DbxActionEnforceModifiedDirective} for disabling when not modified.\n */\n@Directive({\n selector: '[dbxActionDisabledOnSuccess]',\n standalone: true\n})\nexport class DbxActionDisabledOnSuccessDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly disabledOnSuccess = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionDisabledOnSuccess', transform: (value) => value !== false });\n readonly disabledOnSuccess$ = toObservable(this.disabledOnSuccess);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.disabledOnSuccess$, this.source.isSuccess$]).subscribe(([disableOnSuccess, success]) => {\n this.source.disable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY, disableOnSuccess && success);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_DISABLED_ON_SUCCESS_DIRECTIVE_KEY));\n }\n}\n","import { map, shareReplay, switchMap, tap, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionWorkInstanceDelegate } from '../../action.handler';\nimport { type Maybe, type Destroyable, type Initialized, type GetterOrValue, asGetter, type FactoryWithInput } from '@dereekb/util';\nimport { filterMaybe, SubscriptionObject, type Work, workFactory } from '@dereekb/rxjs';\n\n/**\n * Lock key used by {@link DbxActionHandlerInstance} to prevent the source from being destroyed\n * while a handler's work is still in progress.\n */\nexport const DBX_ACTION_HANDLER_LOCK_KEY = 'dbxActionHandler';\n\n/**\n * Manages the execution of a {@link Work} function in response to `valueReady$` events\n * from an action context.\n *\n * When initialized, it subscribes to the source's `valueReady$` stream and executes\n * the configured handler function (or handler value) using {@link workFactory}. The handler\n * function drives the action through the working/success/reject lifecycle via a\n * {@link DbxActionWorkInstanceDelegate}.\n *\n * Supports two modes:\n * - **Handler function**: A full {@link Work} function that receives the value and a work context.\n * - **Handler value**: A simple getter or factory that returns the result directly.\n *\n * A lock is added to the source's lock set during work execution to prevent premature cleanup.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerDirective} for the template directive that wraps this instance.\n * @see {@link DbxActionWorkInstanceDelegate} for the delegate that bridges work events to the store.\n */\nexport class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {\n private readonly _delegate: DbxActionWorkInstanceDelegate<T, O>;\n\n private readonly _sub = new SubscriptionObject();\n private readonly _handlerFunction = new BehaviorSubject<Maybe<Work<T, O>>>(undefined);\n private readonly _handlerValue = new BehaviorSubject<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>(undefined);\n\n readonly handlerFunction$ = combineLatest([this._handlerValue, this._handlerFunction]).pipe(\n map(([handlerValue, handlerFunction]) => {\n let work: Maybe<Work<T, O>>;\n\n if (handlerFunction != null) {\n work = handlerFunction;\n } else if (handlerValue !== undefined) {\n const getter = asGetter(handlerValue) as FactoryWithInput<O, T>;\n work = (x, c) => c.performTaskWithReturnValue(() => getter(x));\n }\n\n return work;\n }),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor(source: DbxActionContextStoreSourceInstance<T, O>) {\n this._delegate = new DbxActionWorkInstanceDelegate<T, O>(source);\n }\n\n get source(): DbxActionContextStoreSourceInstance<T, O> {\n return this._delegate.source;\n }\n\n get handlerFunction(): Maybe<Work<T, O>> {\n return this._handlerFunction.value;\n }\n\n get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>> {\n return this._handlerValue.value;\n }\n\n setHandlerFunction(handlerFunction: Maybe<Work<T, O>>): void {\n this._handlerFunction.next(handlerFunction);\n }\n\n setHandlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>): void {\n this._handlerValue.next(handlerValue);\n }\n\n init(): void {\n this._sub.subscription = this.handlerFunction$\n .pipe(\n switchMap((work) =>\n this.source.valueReady$.pipe(\n tap((value) => {\n const context = workFactory({ work, delegate: this._delegate })(value);\n\n if (context) {\n // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.\n this.source.lockSet.addLock(DBX_ACTION_HANDLER_LOCK_KEY, context.isComplete$.pipe(map((x) => !x)));\n }\n })\n )\n )\n )\n .subscribe();\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._sub.destroy();\n this._handlerFunction.complete();\n });\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type FactoryWithInput, type GetterOrValue, type Maybe } from '@dereekb/util';\nimport { DbxActionHandlerInstance } from './action.handler.instance';\nimport { type Work } from '@dereekb/rxjs';\nimport { clean } from '../../../rxjs';\n\n/**\n * Abstract base directive that creates and manages a {@link DbxActionHandlerInstance} lifecycle.\n *\n * Subclasses configure how the handler function or value is provided to the instance.\n * The instance is initialized on construction and cleaned up automatically via the action's lock set.\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerDirective} for the work-function variant.\n * @see {@link DbxActionHandlerValueDirective} for the value/getter variant.\n */\n@Directive()\nexport abstract class AbstractDbxActionHandlerDirective<T = unknown, O = unknown> {\n readonly source: DbxActionContextStoreSourceInstance<T, O> = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n protected readonly _dbxActionHandlerInstance = clean(new DbxActionHandlerInstance<T, O>(this.source));\n\n constructor() {\n this._dbxActionHandlerInstance.init();\n }\n}\n\n/**\n * Directive that provides a {@link Work} function to handle the action's `valueReady$` event.\n *\n * When the action is triggered and a value becomes ready, the provided work function is\n * called with the value and a work context. The work function is responsible for performing\n * the async operation and signaling success or failure through the context.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionHandler]=\"handleSave\"></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerValueDirective} for the simpler value/getter variant.\n */\n@Directive({\n selector: '[dbxActionHandler]',\n standalone: true\n})\nexport class DbxActionHandlerDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerFunction = input.required<Maybe<Work<T, O>>>({ alias: 'dbxActionHandler' });\n\n protected readonly _handlerFunctionEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerFunction(this.handlerFunction());\n });\n}\n\n/**\n * Directive that provides a static value, getter, or factory to resolve the action's `valueReady$` event.\n *\n * Unlike {@link DbxActionHandlerDirective}, this does not require a full {@link Work} function.\n * The provided value (or the result of calling the getter/factory) is used directly as the\n * action's result, with the working/success lifecycle handled automatically.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionHandlerValue]=\"computeResult\"></ng-container>\n * <button (click)=\"action.trigger()\">Compute</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type for the action.\n * @typeParam O - The output result type for the action.\n *\n * @see {@link DbxActionHandlerDirective} for the full work-function variant.\n */\n@Directive({\n selector: '[dbxActionHandlerValue]',\n standalone: true\n})\nexport class DbxActionHandlerValueDirective<T = unknown, O = unknown> extends AbstractDbxActionHandlerDirective<T, O> {\n readonly handlerValue = input.required<Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>>({ alias: 'dbxActionHandlerValue' });\n protected readonly _handlerValueEffect = effect(() => {\n this._dbxActionHandlerInstance.setHandlerValue(this.handlerValue());\n });\n}\n","import { Directive, type OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { distinctUntilChanged, type Observable } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Abstract structural directive that conditionally renders its template based on a reactive boolean observable,\n * similar to `*ngIf` but driven by an `Observable<boolean>`.\n *\n * Subclasses provide the `show$` observable to control visibility. The template is created\n * when `show$` emits `true` and cleared when it emits `false`.\n *\n * @example\n * ```typescript\n * @Directive({ selector: '[appShowIfAdmin]' })\n * export class ShowIfAdminDirective extends AbstractIfDirective {\n * readonly show$ = inject(AuthService).isAdmin$;\n * }\n * ```\n *\n * @example\n * ```html\n * <div *appShowIfAdmin>Only visible to admins</div>\n * ```\n */\n@Directive()\nexport abstract class AbstractIfDirective implements OnInit {\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n /**\n * Observable that is watched for showing/hiding.\n */\n abstract readonly show$: Observable<boolean>;\n\n private readonly _sub = cleanSubscription();\n\n ngOnInit() {\n this._sub.subscription = this.show$.pipe(distinctUntilChanged()).subscribe((show) => {\n if (show) {\n this._viewContainer.createEmbeddedView(this._templateRef);\n } else {\n this._viewContainer.clear();\n }\n });\n }\n}\n","/**\n * Angular input transform that converts an empty string to `undefined`.\n *\n * Useful for Angular directive inputs where the attribute can be applied without a value\n * (e.g., `<div myDirective>` passes `''`), and you want to treat that as \"not provided\".\n *\n * @param value - The input value to transform.\n * @returns The original value, or `undefined` if the value is an empty string.\n *\n * @example\n * ```typescript\n * @Directive({ selector: '[appHighlight]' })\n * export class HighlightDirective {\n * @Input({ alias: 'appHighlight', transform: transformEmptyStringInputToUndefined })\n * color?: string;\n * }\n * ```\n */\nexport const transformEmptyStringInputToUndefined = <T>(value: T | '') => (value === '' ? undefined : value);\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content when the action is idle.\n *\n * Optionally accepts a number (in milliseconds) to auto-hide the content after the specified\n * duration, even if the action is still idle. Useful for showing initial instructions that\n * should disappear after a timeout.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionIdle>Ready to submit.</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Hide idle content after 5 seconds -->\n * <div dbxAction>\n * <div *dbxActionIdle=\"5000\">Ready to submit.</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionIsWorkingDirective} for showing content when working.\n * @see {@link DbxActionHasSuccessDirective} for showing content on success.\n */\n@Directive({\n selector: '[dbxActionIdle]',\n standalone: true\n})\nexport class DbxActionIdleDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIdle', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.idle$.pipe(\n exhaustMap((idle) => {\n if (idle) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that renders its content while the action has not yet succeeded.\n *\n * The content is visible during all states before success (IDLE, TRIGGERED, WORKING, etc.)\n * and is hidden once the action resolves successfully. Optionally accepts a number (in milliseconds)\n * specifying how long to keep the content hidden after success before showing it again.\n *\n * This is the inverse of {@link DbxActionHasSuccessDirective}.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionPreSuccess>Not yet saved.</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Re-show content 2 seconds after success -->\n * <div dbxAction>\n * <div *dbxActionPreSuccess=\"2000\">Not yet saved.</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionHasSuccessDirective} for showing content on success.\n */\n@Directive({\n selector: '[dbxActionPreSuccess]',\n standalone: true\n})\nexport class DbxActionPreSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideFor = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionPreSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(false, true, this.hideFor());\n } else {\n return of(true);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content when the action has resolved successfully.\n *\n * Optionally accepts a number (in milliseconds) to auto-hide the content after the specified\n * duration, useful for showing temporary success messages that fade away.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionHasSuccess>Saved successfully!</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Show success message for 3 seconds -->\n * <div dbxAction>\n * <div *dbxActionHasSuccess=\"3000\">Saved!</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionPreSuccessDirective} for showing content before success.\n * @see {@link DbxActionSuccessHandlerDirective} for executing a function on success.\n */\n@Directive({\n selector: '[dbxActionHasSuccess]',\n standalone: true\n})\nexport class DbxActionHasSuccessDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionHasSuccess', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Callback function invoked when an action resolves successfully.\n *\n * @typeParam O - The output result type from the action.\n */\nexport type DbxActionSuccessHandlerFunction<O = unknown> = (value: O) => void;\n\n/**\n * Directive that executes a callback function each time the action resolves successfully.\n *\n * The provided function receives the action's result value. This is useful for\n * performing side effects like navigation, showing notifications, or refreshing data\n * after a successful action.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionSuccessHandler]=\"onSaveSuccess\"></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionHasSuccessDirective} for rendering content on success.\n * @see {@link DbxActionErrorHandlerDirective} for handling errors.\n */\n@Directive({\n selector: '[dbxActionSuccessHandler]',\n standalone: true\n})\nexport class DbxActionSuccessHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionSuccessHandler = input<Maybe<DbxActionSuccessHandlerFunction<O>>>();\n readonly successFunction$ = toObservable(this.dbxActionSuccessHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.successFunction$\n .pipe(\n switchMap((successFunction) =>\n this.source.success$.pipe(\n map((x) => [successFunction, x] as [DbxActionSuccessHandlerFunction<O>, O]),\n tap(([successFn, result]) => {\n successFn(result);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type ReadableError, type Maybe } from '@dereekb/util';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Callback function invoked when an action encounters an error.\n *\n * Receives the {@link ReadableError} if available, or undefined.\n */\nexport type DbxActionErrorHandlerFunction = (error?: Maybe<ReadableError>) => void;\n\n/**\n * Directive that executes a callback function each time the action's error state changes.\n *\n * The provided function receives the {@link ReadableError} from the action context.\n * This is useful for performing side effects like logging, showing error toasts, or\n * handling specific error conditions programmatically.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionErrorHandler]=\"onError\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionSuccessHandlerDirective} for handling success.\n */\n@Directive({\n selector: '[dbxActionErrorHandler]',\n standalone: true\n})\nexport class DbxActionErrorHandlerDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionErrorHandler = input<Maybe<DbxActionErrorHandlerFunction>>();\n readonly errorFunction$ = toObservable(this.dbxActionErrorHandler).pipe(filterMaybe(), shareReplay(1));\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.errorFunction$\n .pipe(\n switchMap((errorFunction) =>\n this.source.error$.pipe(\n filterMaybe(),\n map((x) => [errorFunction, x] as const),\n tap(([errorFn, error]) => {\n errorFn(error);\n })\n )\n )\n )\n .subscribe()\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { getValueFromGetter, type Maybe, type GetterOrValue } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject, combineLatest, map, type Observable, shareReplay, switchMap } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that provides a value (or value-producing function) to the action when triggered.\n *\n * The value is always available and ready to be used. When the action is triggered,\n * the current value is resolved (via `getValueFromGetter` if a function) and passed\n * to `readyValue()` on the action source.\n *\n * The input filters out null/undefined values, waiting until a non-null value is provided.\n * If you need to pass null/undefined as valid action values, use {@link DbxActionValueTriggerDirective} instead.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionValue]=\"myValue\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- With a getter function -->\n * <div dbxAction>\n * <ng-container [dbxActionValue]=\"getLatestValue\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionValueTriggerDirective} for lazy value retrieval on trigger.\n * @see {@link DbxActionValueStreamDirective} for reactive stream-based values.\n */\n@Directive({\n selector: 'dbxActionValue,[dbxActionValue]',\n standalone: true\n})\nexport class DbxActionValueDirective<T, O> {\n readonly valueOrFunction = input<Maybe<GetterOrValue<T> | ''>>('', { alias: 'dbxActionValue' });\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n private readonly _valueOrFunctionOverride = new BehaviorSubject<Maybe<GetterOrValue<T>>>(undefined);\n\n readonly valueOrFunction$: Observable<GetterOrValue<T>> = combineLatest([this._valueOrFunctionOverride, toObservable(this.valueOrFunction)]).pipe(\n map(([x, y]) => x ?? (y as Maybe<GetterOrValue<T>>)),\n filterMaybe(),\n shareReplay(1)\n );\n\n constructor() {\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.valueOrFunction$.pipe(switchMap((valueOrFunction) => this.source.triggered$.pipe(map(() => valueOrFunction)))).subscribe((valueOrFunction) => {\n const value: T = getValueFromGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n });\n }\n\n setValueOrFunction(value: Maybe<GetterOrValue<T>>) {\n this._valueOrFunctionOverride.next(value);\n }\n}\n","import { computed, Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content while the action is in a working state.\n *\n * Optionally accepts a number (in milliseconds) to auto-hide the content after a specified duration,\n * even if the action is still working. This is useful for showing brief \"loading\" indicators\n * that should disappear after a timeout.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionWorking>Loading...</div>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <!-- Hide after 3 seconds even if still working -->\n * <div dbxAction>\n * <div *dbxActionIsWorking=\"3000\">Loading...</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionIdleDirective} for showing content when idle.\n */\n@Directive({\n selector: '[dbxActionWorking],[dbxActionIsWorking]',\n standalone: true\n})\nexport class DbxActionIsWorkingDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionWorking', transform: transformEmptyStringInputToUndefined });\n readonly hideAfterIsWorking = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionIsWorking', transform: transformEmptyStringInputToUndefined });\n\n readonly hideAfterSignal = computed(() => {\n const hideAfter = this.hideAfter();\n const hideAfterIsWorking = this.hideAfterIsWorking();\n return hideAfter ?? hideAfterIsWorking;\n });\n\n readonly show$ = this._store.isWorking$.pipe(\n exhaustMap((isWorking) => {\n const hideAfter = this.hideAfterSignal();\n\n if (isWorking && hideAfter != null) {\n return emitDelayObs(true, false, hideAfter);\n } else {\n return of(isWorking);\n }\n }),\n shareReplay(1)\n );\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { combineLatest, delay } from 'rxjs';\nimport { clean, cleanSubscription } from '../../../rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Disabled key used by {@link DbxActionEnforceModifiedDirective} to track the\n * \"not modified\" disabled reason.\n */\nexport const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';\n\n/**\n * Directive that disables the parent action when the action is not marked as modified.\n *\n * When enabled (default), this enforces that the user must make changes before the action\n * can be triggered. Once the action is marked as modified, the disabled key is removed.\n * This prevents no-op submissions where nothing has actually changed.\n *\n * Can be disabled by setting `dbxActionEnforceModified` to `false`.\n *\n * The disable key is automatically cleaned up on directive destruction.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container dbxActionEnforceModified></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @see {@link DbxActionDisabledDirective} for general-purpose disabling.\n * @see {@link DbxActionAutoModifyDirective} for always keeping the action modified.\n */\n@Directive({\n selector: '[dbxActionEnforceModified]',\n standalone: true\n})\nexport class DbxActionEnforceModifiedDirective {\n readonly source = inject(DbxActionContextStoreSourceInstance, { host: true });\n\n readonly enabled = input<boolean, Maybe<boolean | ''>>(true, { alias: 'dbxActionEnforceModified', transform: (value) => value !== false });\n readonly enabled$ = toObservable(this.enabled);\n\n constructor() {\n cleanSubscription(\n combineLatest([this.source.isModified$, this.enabled$])\n .pipe(delay(0))\n .subscribe(([modified, enableDirective]) => {\n const disable = enableDirective && !modified;\n this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);\n })\n );\n\n clean(() => this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY));\n }\n}\n","import { toReadableError, type Destroyable, type Initialized, type Maybe, type ReadableError } from '@dereekb/util';\nimport { switchMap, map, catchError, of, BehaviorSubject, type Observable, shareReplay, combineLatestWith } from 'rxjs';\nimport { type ObservableOrValue, SubscriptionObject, type IsModifiedFunction, asObservable, returnIfIs, filterMaybe, type IsEqualFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { type DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Function that retrieves the input value for an action when triggered.\n *\n * Called by {@link DbxActionValueGetterInstance} when the action is triggered,\n * returning the value (or an observable of the value) to pass to the action.\n *\n * @typeParam T - The value type to retrieve.\n */\nexport type DbxActionValueGetterValueGetterFunction<T> = () => ObservableOrValue<Maybe<T>>;\n\n/**\n * Result of a value getter invocation, containing either a value to proceed with\n * or an error to reject the action.\n *\n * @typeParam T - The value type.\n */\nexport interface DbxActionValueGetterResult<T = unknown> {\n /**\n * The value to trigger with\n */\n readonly value?: Maybe<T>;\n /**\n * The error to reject with\n */\n readonly reject?: Maybe<ReadableError>;\n}\n\n/**\n * Configuration for a {@link DbxActionValueGetterInstance}.\n *\n * @typeParam T - The value type for the action.\n */\nexport interface DbxActionValueGetterInstanceConfig<T> {\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n readonly valueGetter?: Maybe<DbxActionValueGetterValueGetterFunction<T>>;\n readonly isEqualFunction?: Maybe<IsEqualFunction<T>>;\n readonly isModifiedFunction?: Maybe<IsModifiedFunction<T>>;\n}\n\n/**\n * Utility class that handles the trigger-to-value-ready phase of the action lifecycle.\n *\n * When initialized, it subscribes to the source's `triggered$` stream. On each trigger,\n * it calls the configured {@link DbxActionValueGetterValueGetterFunction} to retrieve the value,\n * runs an optional {@link IsModifiedFunction} check, and either calls `readyValue()` with\n * the retrieved value or `reject()` if the value is null/undefined or an error occurred.\n *\n * This separates value retrieval from the trigger event, allowing lazy or async value computation.\n *\n * @typeParam T - The value type for the action.\n *\n * @see {@link DbxActionValueTriggerDirective} for the directive wrapper.\n * @see {@link DbxActionValueDirective} for the simpler always-piped-value approach.\n */\nexport class DbxActionValueGetterInstance<T> implements Initialized, Destroyable {\n private readonly _valueGetterFunction = new BehaviorSubject<Maybe<DbxActionValueGetterValueGetterFunction<T>>>(undefined);\n readonly valueGetterFunction$ = this._valueGetterFunction.pipe(filterMaybe());\n\n private readonly _isModifiedFunction = new BehaviorSubject<Maybe<IsModifiedFunction<T>>>(undefined);\n private readonly _isEqualFunction = new BehaviorSubject<Maybe<IsEqualFunction<T>>>(undefined);\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: this._isModifiedFunction,\n isEqual: this._isEqualFunction\n }).pipe(shareReplay(1));\n\n readonly source: DbxActionContextStoreSourceInstance<T, unknown>;\n\n private readonly _triggeredSub = new SubscriptionObject();\n\n constructor(config: DbxActionValueGetterInstanceConfig<T>) {\n this.source = config.source;\n this.setValueGetterFunction(config.valueGetter);\n this.setIsModifiedFunction(config.isModifiedFunction);\n this.setIsEqualFunction(config.isEqualFunction);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._valueGetterFunction.next(valueGetterFunction);\n }\n\n setIsModifiedFunction(isModifiedFunction: Maybe<IsModifiedFunction<T>>) {\n this._isModifiedFunction.next(isModifiedFunction);\n }\n\n setIsEqualFunction(isEqualFunction: Maybe<IsEqualFunction<T>>) {\n this._isEqualFunction.next(isEqualFunction);\n }\n\n init(): void {\n // Ready the value after the source is triggered. Do modified check one last time.\n this._triggeredSub.subscription = this.source.triggered$\n .pipe(\n switchMap(() =>\n this.valueGetterFunction$.pipe(\n switchMap((valueGetter) => asObservable(valueGetter())),\n combineLatestWith(this.isModifiedFunction$),\n // If the value is not null/undefined and is considered modified, then pass the value.\n switchMap(([value, isModifiedFunction]) => returnIfIs(isModifiedFunction, value, false).pipe(map((value) => ({ value })))),\n // Catch unknown errors and pass them to reject.\n catchError((reject) => of({ reject: toReadableError(reject) }))\n )\n )\n )\n .subscribe((result: DbxActionValueGetterResult<T>) => {\n if (result.value != null) {\n this.source.readyValue(result.value);\n } else {\n this.source.reject(result.reject);\n }\n });\n }\n\n destroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._valueGetterFunction.complete();\n this._isModifiedFunction.complete();\n this._isEqualFunction.complete();\n this._triggeredSub.destroy();\n });\n }\n}\n","import { Directive, Injector, type Signal, effect, inject, input, runInInjectionContext } from '@angular/core';\nimport { type IsEqualFunction, type IsModifiedFunction } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { type DbxActionValueGetterValueGetterFunction, DbxActionValueGetterInstance } from './action.value.trigger.instance';\nimport { clean } from '../../../rxjs/clean';\n\n/**\n * Configuration for connecting Angular signals to a {@link DbxActionValueGetterInstance}'s\n * value getter, isModified, and isEqual functions.\n *\n * @typeParam T - The value type for the action.\n */\nexport interface DbxActionValueGetterDirectiveComputeInputsConfig<T> {\n readonly valueGetterSignal?: Signal<Maybe<DbxActionValueGetterValueGetterFunction<T>>>;\n readonly isModifiedSignal?: Signal<Maybe<IsModifiedFunction>>;\n readonly isEqualSignal?: Signal<Maybe<IsEqualFunction>>;\n}\n\n/**\n * Abstract base class for directives that retrieve a value when the action is triggered.\n *\n * Creates and manages a {@link DbxActionValueGetterInstance} internally, providing\n * methods for subclasses to configure the value getter, isModified, and isEqual functions.\n *\n * @typeParam T - The value type for the action.\n *\n * @see {@link DbxActionValueTriggerDirective} for the concrete implementation.\n */\n@Directive()\nexport abstract class AbstractDbxActionValueGetterDirective<T> {\n private readonly _injector = inject(Injector);\n\n readonly source = inject(DbxActionContextStoreSourceInstance<T, unknown>);\n\n private readonly _triggerInstance: DbxActionValueGetterInstance<T> = new DbxActionValueGetterInstance<T>({\n source: this.source\n });\n\n constructor() {\n this._triggerInstance.init();\n clean(this._triggerInstance);\n }\n\n setValueGetterFunction(valueGetterFunction: Maybe<DbxActionValueGetterValueGetterFunction<T>>) {\n this._triggerInstance.setValueGetterFunction(valueGetterFunction);\n }\n\n protected configureInputs(config: DbxActionValueGetterDirectiveComputeInputsConfig<T>): void {\n runInInjectionContext(this._injector, () => {\n effect(() => {\n if (config?.isModifiedSignal != null) {\n const isModified = config?.isModifiedSignal();\n this._triggerInstance.setIsModifiedFunction(isModified);\n }\n\n if (config?.isEqualSignal != null) {\n const isEqual = config?.isEqualSignal();\n this._triggerInstance.setIsEqualFunction(isEqual);\n }\n\n if (config?.valueGetterSignal != null) {\n const valueGetter = config?.valueGetterSignal();\n this._triggerInstance.setValueGetterFunction(valueGetter);\n }\n });\n });\n }\n}\n\n/**\n * Directive that uses a getter function to retrieve the action value only when triggered.\n *\n * Unlike {@link DbxActionValueDirective} which continuously pipes the latest value,\n * this directive calls the getter function lazily -- only when the action is triggered.\n * This is useful when the value computation is expensive or depends on state that should\n * only be captured at trigger time.\n *\n * Supports optional `isModified` and `isEqual` functions to control whether the retrieved\n * value should proceed to `readyValue` or be rejected.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionValueGetter]=\"getFormValue\"></ng-container>\n * <button (click)=\"action.trigger()\">Submit</button>\n * </div>\n * ```\n *\n * @typeParam T - The value type for the action.\n *\n * @see {@link DbxActionValueDirective} for the always-available value approach.\n */\n@Directive({\n exportAs: 'dbxActionValueGetter',\n selector: '[dbxActionValueGetter]',\n standalone: true\n})\nexport class DbxActionValueTriggerDirective<T = object> extends AbstractDbxActionValueGetterDirective<T> {\n readonly dbxActionValueGetter = input<Maybe<DbxActionValueGetterValueGetterFunction<T>>>();\n readonly dbxActionValueGetterIsModified = input<Maybe<IsModifiedFunction>>();\n readonly dbxActionValueGetterIsEqual = input<Maybe<IsEqualFunction>>();\n\n constructor() {\n super();\n this.configureInputs({\n valueGetterSignal: this.dbxActionValueGetter,\n isModifiedSignal: this.dbxActionValueGetterIsModified,\n isEqualSignal: this.dbxActionValueGetterIsEqual\n });\n }\n}\n","import { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay, type Observable, of, EMPTY } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type IsEqualFunction, type IsModifiedFunction, makeIsModifiedFunctionObservable } from '@dereekb/rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cleanSubscriptionWithLockSet } from '../../../rxjs';\n\n/**\n * Directive that watches a value observable stream and automatically updates the action's\n * modified state and provides the latest value when triggered.\n *\n * Each emission from the stream is checked against an optional `isModified` or `isEqual`\n * function to determine if the action should be marked as modified. When the action is\n * triggered, the latest value from the stream is passed to `readyValue()` only if modified.\n *\n * This is ideal for form-based workflows where the form value changes over time and\n * should automatically track modification state.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <ng-container [dbxActionValueStream]=\"formValue$\"></ng-container>\n * <button (click)=\"action.trigger()\">Save</button>\n * </div>\n * ```\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n *\n * @see {@link DbxActionValueDirective} for static/getter-based values.\n * @see {@link DbxActionValueTriggerDirective} for lazy getter values on trigger.\n */\n@Directive({\n selector: '[dbxActionValueStream]',\n standalone: true\n})\nexport class DbxActionValueStreamDirective<T, O> {\n readonly source = inject(DbxActionContextStoreSourceInstance<T, O>, { host: true });\n\n readonly dbxActionValueStream = input<Observable<T>>(EMPTY);\n readonly dbxActionValueStreamIsEqualValue = input<Maybe<IsEqualFunction<T>>>();\n readonly dbxActionValueStreamIsModifiedValue = input<Maybe<IsModifiedFunction<T>>>();\n\n readonly isModifiedFunction$: Observable<IsModifiedFunction<T>> = makeIsModifiedFunctionObservable({\n isModified: toObservable(this.dbxActionValueStreamIsModifiedValue),\n isEqual: toObservable(this.dbxActionValueStreamIsEqualValue)\n }).pipe(shareReplay(1));\n\n readonly modifiedValue$ = toObservable(this.dbxActionValueStream).pipe(\n switchMap((obs) =>\n obs.pipe(\n withLatestFrom(this.isModifiedFunction$),\n mergeMap(([value, dbxActionValueStreamModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionValueStreamModified) {\n result = dbxActionValueStreamModified(value).pipe(map((isModified) => [isModified, value] as [boolean, T]));\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n )\n )\n );\n\n constructor() {\n // Update isModified on source\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.modifiedValue$.subscribe(([isModified]) => {\n this.source.setIsModified(isModified);\n })\n });\n\n // Set the value on triggers.\n cleanSubscriptionWithLockSet({\n lockSet: this.source.lockSet,\n sub: this.source.triggered$.pipe(switchMap(() => this.modifiedValue$)).subscribe(([isModified, value]) => {\n // only mark ready once modified\n if (isModified) {\n this.source.readyValue(value);\n }\n })\n });\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { emitDelayObs } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { of, exhaustMap, shareReplay } from 'rxjs';\nimport { AbstractIfDirective } from '../../../view/if.directive';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { transformEmptyStringInputToUndefined } from '../../../util/input';\n\n/**\n * Structural directive that conditionally renders its content when the action has been triggered.\n *\n * Shows content during the TRIGGERED state (after trigger, before value-ready/working).\n * Optionally accepts a number (in milliseconds) to auto-hide the content after the specified duration.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <div *dbxActionTriggered>Preparing...</div>\n * </div>\n * ```\n *\n * @see {@link DbxActionIsWorkingDirective} for content shown during the working state.\n */\n@Directive({\n selector: '[dbxActionTriggered]',\n standalone: true\n})\nexport class DbxActionTriggeredDirective extends AbstractIfDirective {\n private readonly _store = inject(DbxActionContextStoreSourceInstance);\n\n readonly hideAfter = input<Maybe<number>, Maybe<number> | ''>(undefined, { alias: 'dbxActionTriggered', transform: transformEmptyStringInputToUndefined });\n\n readonly show$ = this._store.triggered$.pipe(\n exhaustMap((triggered) => {\n if (triggered) {\n return emitDelayObs(true, false, this.hideAfter());\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n}\n","import { NgModule } from '@angular/core';\nimport {\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionDisabledDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionIsWorkingDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionPreSuccessDirective,\n DbxActionIdleDirective,\n DbxActionHandlerValueDirective,\n DbxActionErrorHandlerDirective\n} from './directive';\n\nconst importsAndExports = [\n DbxActionDirective,\n DbxActionContextMapDirective,\n DbxActionFromMapDirective,\n DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective,\n DbxActionSourceDirective,\n DbxActionHandlerDirective,\n DbxActionHandlerValueDirective,\n DbxActionDisabledDirective,\n DbxActionDisabledOnSuccessDirective,\n DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective,\n DbxActionValueStreamDirective,\n DbxActionAutoModifyDirective,\n DbxActionValueDirective,\n DbxActionContextLoggerDirective,\n DbxActionIdleDirective,\n DbxActionPreSuccessDirective,\n DbxActionHasSuccessDirective,\n DbxActionSuccessHandlerDirective,\n DbxActionErrorHandlerDirective,\n DbxActionIsWorkingDirective\n];\n\n/**\n * Contains all base DbxAction components.\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreActionModule {}\n","import { type Destroyable } from '@dereekb/util';\nimport { type DbxActionContextStoreSourceInstance } from './action.store.source';\n\n/**\n * Acts as a reference to a DbxActionContextStoreSourceInstance that can be destroyed.\n *\n * This is used in cases where the action is passed around and the context it is passed to needs to clean up.\n */\nexport interface DbxActionContextSourceReference<T = unknown, O = unknown> extends Destroyable {\n readonly sourceInstance: DbxActionContextStoreSourceInstance<T, O>;\n}\n\n/**\n * Creates a simple {@link DbxActionContextSourceReference} wrapper around a source instance.\n *\n * The returned reference has a no-op `destroy()` method, making it suitable for cases\n * where the caller does not own the lifecycle of the source instance.\n *\n * @typeParam T - The input value type.\n * @typeParam O - The output result type.\n * @param sourceInstance - The source instance to wrap.\n * @returns A destroyable reference to the source instance.\n */\nexport function makeDbxActionContextSourceReference<T, O>(sourceInstance: DbxActionContextStoreSourceInstance<T, O>): DbxActionContextSourceReference<T, O> {\n return {\n sourceInstance,\n destroy: () => 0\n };\n}\n","import { type ArrayOrValue, hasValueOrNotEmpty, type Maybe } from '@dereekb/util';\nimport { map, type Observable } from 'rxjs';\n\n/**\n * Represents a router link that can be used for navigation.\n *\n * Can be a URL string, a single route configuration object, or an array of route segments.\n *\n * @example\n * ```ts\n * const stringLink: SegueRefRouterLink = '/app/dashboard';\n * const arrayLink: SegueRefRouterLink = ['/app', { id: '123' }];\n * ```\n */\nexport type SegueRefRouterLink = string | ArrayOrValue<object>;\n\n/**\n * Raw key-value parameters passed along with a segue navigation.\n *\n * These are typically route or query parameters for the target state.\n *\n * @example\n * ```ts\n * const params: SegueRefRawSegueParams = { id: '123', tab: 'settings' };\n * ```\n */\nexport interface SegueRefRawSegueParams {\n [key: string]: unknown;\n}\n\n/**\n * Configuration options for a segue navigation, including raw parameters and framework-specific transition options.\n *\n * @typeParam O - The type of the transition options. For UIRouter this is `TransitionOptions`; for Angular Router this is `NavigationExtras`.\n *\n * @example\n * ```ts\n * const options: SegueRefOptions = {\n * refParams: { id: '123' },\n * refOptions: { location: 'replace' }\n * };\n * ```\n */\nexport interface SegueRefOptions<O = object> {\n /**\n * Raw parameters\n */\n refParams?: SegueRefRawSegueParams;\n\n /**\n * Custom Transition Options.\n *\n * For UIRouter, this is TransitionOptions.\n */\n refOptions?: O;\n}\n\n/**\n * Represents a complete segue reference combining a navigation target path with optional parameters and transition options.\n *\n * This is the primary navigation descriptor used throughout the router abstraction layer.\n *\n * @typeParam O - The type of the transition options. For UIRouter this is `TransitionOptions`; for Angular Router this is `NavigationExtras`.\n *\n * @example\n * ```ts\n * const segue: SegueRef = {\n * ref: 'app.dashboard',\n * refParams: { id: '123' },\n * refOptions: { location: 'replace' }\n * };\n * ```\n *\n * @see {@link SegueRefOptions} for the options portion of the segue reference\n * @see {@link SegueRefRouterLink} for the supported ref path formats\n */\nexport interface SegueRef<O = object> extends SegueRefOptions<O> {\n /**\n * Ref path value.\n */\n ref: SegueRefRouterLink;\n}\n\n/**\n * Union type representing either a full {@link SegueRef} object or a raw {@link SegueRefRouterLink}.\n *\n * This flexibility allows consumers to pass either a simple string path or a fully-configured segue reference.\n *\n * @typeParam O - The type of the transition options.\n *\n * @example\n * ```ts\n * // As a simple string\n * const link: SegueRefOrSegueRefRouterLink = '/app/dashboard';\n *\n * // As a full SegueRef\n * const ref: SegueRefOrSegueRefRouterLink = { ref: 'app.dashboard', refParams: { id: '123' } };\n * ```\n */\nexport type SegueRefOrSegueRefRouterLink<O = object> = SegueRef<O> | SegueRefRouterLink;\n\n/**\n * Type guard that checks whether the given input is a {@link SegueRef} object (as opposed to a raw router link string).\n *\n * @typeParam O - The type of the transition options.\n * @param input - The value to test.\n * @returns `true` if the input is a {@link SegueRef} with a non-empty `ref` property.\n *\n * @see {@link asSegueRef} for converting an input to a SegueRef\n */\nexport function isSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): input is SegueRef<O> {\n return typeof input === 'object' && hasValueOrNotEmpty((input as SegueRef).ref);\n}\n\n/**\n * Converts a {@link SegueRefOrSegueRefRouterLink} to a {@link SegueRef}.\n *\n * - If the input is a string, it is wrapped into a `SegueRef` via {@link refStringToSegueRef}.\n * - If the input is already a `SegueRef`, it is returned as-is.\n * - Otherwise, returns `undefined`.\n *\n * @typeParam O - The type of the transition options.\n * @param input - The value to convert.\n * @returns The converted {@link SegueRef}, or `undefined` if the input is not convertible.\n *\n * @see {@link isSegueRef}\n * @see {@link refStringToSegueRef}\n */\nexport function asSegueRef<O = object>(input: SegueRefOrSegueRefRouterLink<O>): SegueRef<O>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>>;\nexport function asSegueRef<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O>>): Maybe<SegueRef<O>> {\n const type = typeof input;\n\n if (type === 'string') {\n return refStringToSegueRef(input as string);\n } else if (isSegueRef(input)) {\n return input as SegueRef<O>;\n } else {\n return undefined;\n }\n}\n\n/**\n * Extracts the string ref path from a {@link SegueRefOrSegueRefRouterLink}.\n *\n * - If the input is already a string, it is returned directly.\n * - If the input is a `SegueRef`, the `ref` property is returned as a string.\n * - Otherwise, throws an error.\n *\n * @typeParam O - The type of the transition options.\n * @param input - The segue ref or string to extract from.\n * @returns The string representation of the ref.\n * @throws Error if the input cannot be converted to a string.\n */\nexport function asSegueRefString<O = object>(input: SegueRefOrSegueRefRouterLink<O> | string): string;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string>;\nexport function asSegueRefString<O = object>(input: Maybe<SegueRefOrSegueRefRouterLink<O> | string>): Maybe<string> {\n if (typeof input === 'string') {\n return input;\n } else if (isSegueRef(input)) {\n return input.ref as string;\n } else {\n throw new Error(`asSegueRefString() failed to convert the input to a string: ${input}`);\n }\n}\n\n/**\n * Creates a {@link SegueRef} from a string ref path and optional segue options.\n *\n * @typeParam O - The type of the transition options.\n * @param ref - The string ref path to wrap.\n * @param options - Optional parameters and transition options to include.\n * @returns A new {@link SegueRef} containing the given ref and options.\n */\nexport function refStringToSegueRef<O = object>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\n/**\n * Maps an observable of string ref paths to an observable of {@link SegueRef} objects.\n *\n * @typeParam O - The type of the transition options.\n * @param obs - The source observable emitting string ref paths.\n * @param options - Optional parameters and transition options to include in each emitted SegueRef.\n * @returns An observable that emits {@link SegueRef} objects.\n *\n * @see {@link refStringToSegueRef}\n */\nexport function mapRefStringObsToSegueRefObs<O = object>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map((x) => refStringToSegueRef(x, options)));\n}\n","import { type Observable } from 'rxjs';\nimport { type AuthRoleSet } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../auth.user';\n\n/**\n * Abstract service that provides reactive access to the current authentication state, user roles, and lifecycle events.\n *\n * This is the primary abstraction for authentication in dbx-core. Concrete implementations\n * (e.g., Firebase-based auth) must provide all observable streams and the logout behavior.\n *\n * Components and services should inject this abstract class rather than a concrete implementation,\n * enabling the auth provider to be swapped without changing consumer code.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private readonly authService = inject(DbxAuthService);\n *\n * readonly isLoggedIn$ = this.authService.isLoggedIn$;\n * readonly roles$ = this.authService.authRoles$;\n *\n * logout() {\n * this.authService.logOut();\n * }\n * }\n * ```\n *\n * @see {@link AuthUserState} for the possible user states.\n * @see {@link DbxAppAuthEffects} for how this service is bridged into the NgRx store.\n */\nexport abstract class DbxAuthService {\n /**\n * Whether or not the user is logged in.\n *\n * This will only emit once the authentication has been determined, preventing issues with premature decision making.\n *\n * A user is considered logged in even if there is an anonymous user. For more detailed info, consider using authUserState$.\n */\n abstract readonly isLoggedIn$: Observable<boolean>;\n\n /**\n * Whether or not the user has finished onboarding.\n *\n * This will only emit once the onboarding status has been determined, preventing issues with premature decision making.\n */\n abstract readonly isOnboarded$: Observable<boolean>;\n\n /**\n * Emits an event every time the user logs in.\n */\n abstract readonly onLogIn$: Observable<void>;\n\n /**\n * Emits an event every time the user logs out.\n */\n abstract readonly onLogOut$: Observable<void>;\n\n /**\n * Current state of the user.\n */\n abstract readonly authUserState$: Observable<AuthUserState>;\n\n /**\n * Role set for the current user.\n */\n abstract readonly authRoles$: Observable<AuthRoleSet>;\n\n /**\n * Identifier for the current user.\n */\n abstract readonly userIdentifier$: Observable<AuthUserIdentifier>;\n\n /**\n * Performs the logout action.\n */\n abstract logOut(): Promise<void>;\n}\n","import { type TransitionHookFn, type Transition, type HookResult, type StateService, type UIInjector, type TransitionOptions, type RawParams } from '@uirouter/core';\nimport { catchError, map, first, firstValueFrom, type Observable, of, switchMap } from 'rxjs';\nimport { asSegueRef, asSegueRefString, type SegueRefOrSegueRefRouterLink } from './../../../../router/segue';\nimport { DbxAuthService } from '../../../service/auth.service';\nimport { type FactoryWithRequiredInput, getValueFromGetter, isGetter, type Maybe, type Milliseconds } from '@dereekb/util';\nimport { type Injector } from '@angular/core';\nimport { timeoutStartWith } from '@dereekb/rxjs';\n\n/**\n * Represents the outcome of an auth transition decision in a UIRouter hook.\n *\n * Possible values:\n * - `true` - Allow the transition to proceed to the target state.\n * - `false` - Reject the transition and redirect to the configured default redirect target.\n * - `SegueRefOrSegueRefRouterLink` - Redirect to a specific route instead.\n *\n * @see {@link AuthTransitionHookConfig.makeDecisionsObs}\n */\nexport type AuthTransitionDecision = true | false | SegueRefOrSegueRefRouterLink;\n\n/**\n * Input provided to an {@link AuthTransitionRedirectTargetGetter} when determining\n * where to redirect a user during an auth transition.\n *\n * Contains the current transition context, the Angular injector, and the auth service\n * for making authorization decisions.\n */\nexport interface AuthTransitionDecisionGetterInput {\n /**\n * The UIRouter transition that triggered the auth check.\n */\n readonly transition: Transition;\n /**\n * The Angular injector for resolving additional dependencies.\n */\n readonly injector: Injector;\n /**\n * The auth service for querying the current authentication state.\n */\n readonly authService: DbxAuthService;\n}\n\n/**\n * An observable that resolves to a redirect target (or `undefined` for no redirect).\n */\nexport type AuthTransitionRedirectTarget = Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n/**\n * Factory function that produces an {@link AuthTransitionRedirectTarget} given the transition context.\n *\n * Used when the redirect destination needs to be computed dynamically based on the current\n * auth state, transition, or other runtime factors.\n */\nexport type AuthTransitionRedirectTargetGetter = FactoryWithRequiredInput<AuthTransitionRedirectTarget, AuthTransitionDecisionGetterInput>;\n\n/**\n * A redirect target that can be either a static route reference, a dynamic getter, or `undefined`.\n *\n * @see {@link AuthTransitionRedirectTargetGetter} for the dynamic variant.\n */\nexport type AuthTransitionRedirectTargetOrGetter = Maybe<SegueRefOrSegueRefRouterLink> | AuthTransitionRedirectTargetGetter;\n\n/**\n * Options shared by all auth transition hook configurations.\n *\n * Controls where users are redirected when auth checks fail and how long to wait\n * for the auth decision observable before timing out.\n */\nexport interface AuthTransitionHookOptions {\n /**\n * The UIRouter state name to redirect the user to when their auth check fails.\n */\n readonly defaultRedirectTarget: string;\n\n /**\n * The UIRouter state name to redirect to when an error occurs during the auth check.\n * Defaults to {@link defaultRedirectTarget} if not specified.\n */\n readonly errorRedirectTarget?: string;\n\n /**\n * Maximum time in milliseconds to wait for the decision observable to emit.\n * If the timeout is reached, the transition is treated as a `false` decision (redirect).\n *\n * @defaultValue 1000\n */\n timeoutTime?: Milliseconds;\n}\n\n/**\n * Full configuration for creating an auth transition hook via {@link makeAuthTransitionHook}.\n *\n * Extends {@link AuthTransitionHookOptions} with the decision-making observable factory.\n */\nexport interface AuthTransitionHookConfig extends AuthTransitionHookOptions {\n /**\n * Factory that creates the decision observable for a given transition.\n *\n * The observable should emit an {@link AuthTransitionDecision} value:\n * `true` to allow, `false` to redirect to the default target, or a route reference\n * to redirect to a specific location.\n */\n readonly makeDecisionsObs: (transition: Transition, authService: DbxAuthService, injector: UIInjector) => Observable<AuthTransitionDecision>;\n}\n\n/**\n * Interface for UIRouter state `data` that supports custom redirect logic on auth failure.\n *\n * When a state's auth check fails, the `redirectTo` property determines where the user\n * is sent. If not provided, the hook's `defaultRedirectTarget` is used.\n *\n * @see {@link AuthTransitionRedirectTargetOrGetter}\n */\nexport interface AuthTransitionStateData {\n /**\n * Optional static route reference or dynamic getter that determines the redirect destination\n * when the auth check for this state fails.\n */\n redirectTo?: AuthTransitionRedirectTargetOrGetter;\n}\n\n/**\n * Creates a UIRouter `TransitionHookFn` that performs auth-based route guarding.\n *\n * The generated hook evaluates the `makeDecisionsObs` observable for each transition:\n * - If it emits `true`, the transition proceeds normally.\n * - If it emits `false`, the user is redirected to the default target or a custom redirect\n * specified in the state's `data.redirectTo` property.\n * - If it emits a route reference, the user is redirected to that specific route.\n * - If the observable does not emit within the configured timeout, the transition is rejected.\n *\n * @param config - The hook configuration including redirect targets and the decision observable factory.\n * @returns A `TransitionHookFn` suitable for registration with UIRouter's `TransitionService`.\n *\n * @see {@link enableIsLoggedInHook} for a login-based usage.\n * @see {@link enableHasAuthRoleHook} for a role-based usage.\n * @see {@link enableHasAuthStateHook} for a state-based usage.\n */\nexport function makeAuthTransitionHook(config: AuthTransitionHookConfig): TransitionHookFn {\n const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget, timeoutTime = 1000 } = config;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertIsAuthenticated: TransitionHookFn = (transition: Transition): HookResult => {\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const $state: StateService = transition.router.stateService;\n const decisionObs = config.makeDecisionsObs(transition, authService, injector);\n\n function redirectOut(): Observable<HookResult> {\n const stateData: AuthTransitionStateData = transition.targetState().state().data;\n const redirectTo = stateData?.redirectTo;\n\n let redirectToObs: Observable<HookResult>;\n\n if (redirectTo) {\n let resultObs: Observable<Maybe<SegueRefOrSegueRefRouterLink>>;\n\n if (isGetter<AuthTransitionRedirectTarget>(redirectTo)) {\n resultObs = getValueFromGetter(redirectTo, { authService, injector, transition } as AuthTransitionDecisionGetterInput);\n } else {\n resultObs = of(redirectTo as SegueRefOrSegueRefRouterLink);\n }\n\n redirectToObs = resultObs.pipe(\n map((inputStateRef: Maybe<SegueRefOrSegueRefRouterLink>) => {\n const stateRef = asSegueRef(inputStateRef);\n\n let redirectTarget;\n let redirectParams;\n\n if (stateRef) {\n redirectTarget = stateRef.ref;\n redirectParams = stateRef.refParams;\n }\n\n if (!redirectTarget) {\n redirectTarget = defaultRedirectTarget;\n }\n\n return $state.target(redirectTarget, redirectParams);\n })\n );\n } else {\n redirectToObs = of($state.target(defaultRedirectTarget));\n }\n\n return redirectToObs;\n }\n\n const resultObs = decisionObs.pipe(\n // after the timeoutTime seconds of no transition working, redirect with a false decision\n timeoutStartWith(false as AuthTransitionDecision, timeoutTime),\n first(),\n switchMap((decision: AuthTransitionDecision): Observable<HookResult> => {\n if (typeof decision === 'boolean') {\n if (decision) {\n return of(true);\n } else {\n return redirectOut();\n }\n } else {\n const segueRef = asSegueRef(decision);\n return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams as RawParams, segueRef.refOptions as TransitionOptions));\n }\n }),\n catchError((x) => {\n console.warn(`Encountered error in auth transition hook. Attempting redirect to ${errorRedirectTarget}.`, x);\n return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home\n })\n );\n\n return firstValueFrom(resultObs) as HookResult;\n };\n\n return assertIsAuthenticated;\n}\n","import { first, type Observable, of, switchMap } from 'rxjs';\nimport { getValueFromGetter, isGetter, type Maybe, type ObjectMap } from '@dereekb/util';\nimport { type AuthTransitionDecisionGetterInput, type AuthTransitionRedirectTarget, type AuthTransitionRedirectTargetGetter, type AuthTransitionRedirectTargetOrGetter } from './hook';\nimport { type SegueRefOrSegueRefRouterLink } from '../../../../router/segue';\nimport { type AuthUserState } from '../../../auth.user';\n\n/**\n * Creates an {@link AuthTransitionRedirectTargetGetter} that dynamically determines the redirect\n * destination based on the current {@link AuthUserState}.\n *\n * This is useful when different auth states should redirect to different routes. For example,\n * a `'new'` user might be redirected to an onboarding page while an `'anon'` user is sent to login.\n *\n * Each value in the `stateMap` can be either a static route reference or a dynamic getter\n * for more complex redirect logic.\n *\n * @param stateMap - An object map where keys are {@link AuthUserState} values and values are\n * redirect targets (static or dynamic) for that state.\n * @returns An {@link AuthTransitionRedirectTargetGetter} that resolves the redirect based on the current auth state.\n *\n * @example\n * ```ts\n * const redirectGetter = redirectBasedOnAuthUserState({\n * 'none': '/auth/login',\n * 'anon': '/auth/login',\n * 'new': '/onboard',\n * 'user': '/app'\n * });\n * ```\n *\n * @see {@link AuthTransitionRedirectTargetOrGetter}\n * @see {@link AuthUserState}\n */\nexport function redirectBasedOnAuthUserState(stateMap: ObjectMap<AuthTransitionRedirectTargetOrGetter>): AuthTransitionRedirectTargetGetter {\n return (input: AuthTransitionDecisionGetterInput) => {\n return input.authService.authUserState$.pipe(\n first(),\n switchMap((authUserState: AuthUserState) => {\n const getter = stateMap[authUserState];\n let result: Maybe<Observable<Maybe<SegueRefOrSegueRefRouterLink>>>;\n\n if (getter) {\n if (isGetter<AuthTransitionRedirectTarget>(getter)) {\n result = getValueFromGetter(getter, input);\n } else {\n result = of(getter);\n }\n }\n\n if (!result) {\n result = of(undefined);\n }\n\n return result;\n })\n );\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, makeAuthTransitionHook } from './hook';\n\n/**\n * Configuration for the {@link enableIsLoggedInHook} UIRouter transition hook.\n *\n * @see {@link AuthTransitionHookOptions} for redirect and timeout configuration.\n */\nexport interface IsLoggedInHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * UIRouter state `data` interface for states that require the user to be logged in.\n *\n * Attach this data to a UIRouter state definition to mark it as requiring authentication.\n * The {@link enableIsLoggedInHook} will check this property on entering states.\n *\n * @example\n * ```ts\n * // In a UIRouter state definition:\n * {\n * name: 'app.dashboard',\n * url: '/dashboard',\n * data: { requiredLogIn: true } as IsLoggedInStateData,\n * component: DashboardComponent\n * }\n * ```\n */\nexport interface IsLoggedInStateData {\n /**\n * Whether the user must be logged in to access this state.\n * When `true`, unauthenticated users will be redirected to the default redirect target.\n */\n requiredLogIn: boolean;\n}\n\n/**\n * Registers a UIRouter transition hook that redirects unauthenticated users away from\n * states that require login.\n *\n * The hook fires on `onBefore` (priority 100) for any state whose `data` property has\n * `requiredLogIn: true`. If the user is not logged in (as determined by {@link DbxAuthService.isLoggedIn$}),\n * they are redirected to the configured `defaultRedirectTarget`.\n *\n * @param transitionService - The UIRouter `TransitionService` to register the hook with.\n * @param config - Configuration including redirect targets and timeout settings.\n *\n * @see {@link IsLoggedInStateData} for marking states as requiring login.\n * @see {@link makeAuthTransitionHook} for the underlying hook factory.\n */\nexport function enableIsLoggedInHook(transitionService: TransitionService, config: IsLoggedInHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<IsLoggedInStateData>>;\n return Boolean(data?.requiredLogIn);\n }\n };\n\n const assertIsLoggedIn: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n return authService.isLoggedIn$;\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });\n}\n","import { map, type Observable, type OperatorFunction } from 'rxjs';\nimport { type AuthRole, type SetIncludesMode, type ArrayOrValue, type Maybe, setIncludes, asArray, type AuthRoleSet } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\n/**\n * Configuration for the {@link enableHasAuthRoleHook} UIRouter transition hook.\n *\n * @see {@link AuthTransitionHookOptions} for redirect and timeout configuration.\n */\nexport interface HasAuthRoleHookConfig {\n readonly options: AuthTransitionHookOptions;\n}\n\n/**\n * Configuration for specifying which auth roles are required for a state,\n * and how they should be evaluated.\n *\n * @see {@link HasAuthRoleStateData} for how this is used in UIRouter state data.\n */\nexport interface HasAuthRoleStateRoleConfig {\n /**\n * The auth role(s) required for this state. Can be a single role or an array of roles.\n */\n readonly authRoles: ArrayOrValue<AuthRole>;\n /**\n * How to evaluate the required roles against the user's role set.\n *\n * - `'all'` - User must have all specified roles (default).\n * - `'any'` - User must have at least one of the specified roles.\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * Parsed (internal) representation of a {@link HasAuthRoleStateRoleConfig}\n * where the roles have been converted to a `Set` for efficient lookup.\n */\nexport interface ParsedHasAuthRoleStateRoleConfig {\n /**\n * The set of auth roles required for this state.\n */\n readonly requiredRoles: Set<AuthRole>;\n /**\n * How to evaluate the required roles against the user's role set.\n *\n * @see {@link HasAuthRoleStateRoleConfig.authRolesMode}\n */\n readonly authRolesMode?: SetIncludesMode;\n}\n\n/**\n * UIRouter state `data` interface for states that require specific auth roles.\n *\n * Attach this data to a UIRouter state definition to enforce role-based access control.\n * The {@link enableHasAuthRoleHook} checks this property on entering states.\n *\n * @example\n * ```ts\n * // In a UIRouter state definition:\n * {\n * name: 'app.admin',\n * url: '/admin',\n * data: {\n * authRoles: ['admin'],\n * authRolesMode: 'all'\n * } as HasAuthRoleStateData,\n * component: AdminComponent\n * }\n * ```\n *\n * @see {@link enableHasAuthRoleHook} for the hook that evaluates this data.\n */\nexport interface HasAuthRoleStateData extends AuthTransitionStateData, Pick<HasAuthRoleStateRoleConfig, 'authRolesMode'> {\n /**\n * Auth roles configuration for this state. Can be simple role string(s) or detailed\n * {@link HasAuthRoleStateRoleConfig} objects for per-group mode control.\n */\n readonly authRoles: ArrayOrValue<AuthRole | HasAuthRoleStateRoleConfig>;\n}\n\n/**\n * Registers a UIRouter transition hook that redirects users who lack the required auth roles\n * away from protected states.\n *\n * The hook fires on `onBefore` (priority 100) for any state whose `data` property has an\n * `authRoles` value. If the user's current roles do not satisfy the requirement\n * (based on the configured `authRolesMode`), they are redirected.\n *\n * @param transitionService - The UIRouter `TransitionService` to register the hook with.\n * @param config - Configuration including redirect targets and timeout settings.\n *\n * @see {@link HasAuthRoleStateData} for marking states with required roles.\n * @see {@link hasAuthRoleDecisionPipe} for the role evaluation logic.\n * @see {@link makeAuthTransitionHook} for the underlying hook factory.\n */\nexport function enableHasAuthRoleHook(transitionService: TransitionService, config: HasAuthRoleHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthRoleStateData>>;\n return Boolean(data?.authRoles);\n }\n };\n\n const assertHasAuthRole: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthRoleStateData = targetState.state().data;\n const mapFn: OperatorFunction<AuthRoleSet, boolean> = hasAuthRoleDecisionPipe(data);\n return authService.authRoles$.pipe(mapFn);\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });\n}\n\n/**\n * Creates an RxJS operator that evaluates whether the user's {@link AuthRoleSet} satisfies\n * the role requirements defined in the given {@link HasAuthRoleStateData}.\n *\n * The operator processes role configurations and applies the specified `authRolesMode`\n * (`'all'` or `'any'`) to determine if the user has sufficient roles.\n *\n * @param stateData - The role configuration from the UIRouter state's `data` property.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link enableHasAuthRoleHook} for where this is used in transition hooks.\n */\nexport function hasAuthRoleDecisionPipe(stateData: HasAuthRoleStateData): OperatorFunction<AuthRoleSet, boolean> {\n const authRolesMode: SetIncludesMode = stateData.authRolesMode || 'all';\n\n const authRoleConfigs: ParsedHasAuthRoleStateRoleConfig[] = asArray(stateData.authRoles).map((x) => {\n let config: HasAuthRoleStateRoleConfig;\n\n if (typeof x === 'string') {\n config = {\n authRoles: x,\n authRolesMode: 'any'\n };\n } else {\n config = x;\n }\n\n return {\n requiredRoles: new Set<AuthRole>(config.authRoles),\n authRolesMode: config.authRolesMode\n };\n });\n\n let mapFn: OperatorFunction<AuthRoleSet, boolean>;\n\n if (authRolesMode === 'any') {\n mapFn = map((x) => authRoleConfigs.some((y) => setIncludes(x, y.requiredRoles, y.authRolesMode))); // find the first match\n } else {\n mapFn = map((x) => !authRoleConfigs.some((y) => !setIncludes(x, y.requiredRoles, y.authRolesMode))); // find the first failed match\n }\n\n return mapFn;\n}\n","import { map, type Observable } from 'rxjs';\nimport { type AllowedSet, isAllowed, maybeSet, type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookMatchCriteria } from '@uirouter/core';\nimport { type AuthUserState } from '../../../auth.user';\nimport { type DbxAuthService } from '../../../service/auth.service';\nimport { type AuthTransitionDecision, type AuthTransitionHookOptions, type AuthTransitionStateData, makeAuthTransitionHook } from './hook';\n\n/**\n * Configuration for the {@link enableHasAuthStateHook} UIRouter transition hook.\n *\n * @see {@link AuthTransitionHookOptions} for redirect and timeout configuration.\n */\nexport interface HasAuthStateHookConfig {\n options: AuthTransitionHookOptions;\n}\n\n/**\n * Configuration for specifying which {@link AuthUserState} values are allowed or disallowed for a UIRouter state.\n *\n * Can be provided as:\n * - A single `AuthUserState` string (e.g., `'user'`)\n * - An array of `AuthUserState` strings (e.g., `['user', 'new']`)\n * - A {@link HasAuthStateObjectConfig} for fine-grained allowed/disallowed control\n *\n * @see {@link HasAuthStateData} for how this is used in UIRouter state data.\n */\nexport type HasAuthStateConfig = ArrayOrValue<AuthUserState> | HasAuthStateObjectConfig;\n\n/**\n * Detailed configuration for specifying allowed and disallowed {@link AuthUserState} values.\n *\n * Provides more control than a simple array by supporting both allow-lists and deny-lists.\n * If a user's current auth state matches a disallowed state, the transition is rejected.\n *\n * @example\n * ```ts\n * const config: HasAuthStateObjectConfig = {\n * allowedStates: ['user'],\n * disallowedStates: ['none', 'error']\n * };\n * ```\n */\nexport interface HasAuthStateObjectConfig {\n /**\n * Auth user states that are permitted to access this route.\n * If specified, only users in one of these states can proceed.\n */\n allowedStates?: ArrayOrValue<AuthUserState>;\n\n /**\n * Auth user states that are explicitly forbidden from accessing this route.\n * If the user is in one of these states, the transition is rejected.\n */\n disallowedStates?: ArrayOrValue<AuthUserState>;\n}\n\n/**\n * UIRouter state `data` interface for states that require a specific {@link AuthUserState}.\n *\n * Attach this data to a UIRouter state definition to enforce auth-state-based access control.\n * The {@link enableHasAuthStateHook} checks this property on entering states.\n *\n * @example\n * ```ts\n * // In a UIRouter state definition:\n * {\n * name: 'app.dashboard',\n * url: '/dashboard',\n * data: {\n * authStates: ['user']\n * } as HasAuthStateData,\n * component: DashboardComponent\n * }\n * ```\n *\n * @see {@link enableHasAuthStateHook} for the hook that evaluates this data.\n */\nexport interface HasAuthStateData extends AuthTransitionStateData {\n /**\n * Configuration specifying which {@link AuthUserState} values are required or forbidden for this state.\n */\n authStates: HasAuthStateConfig;\n}\n\n/**\n * Registers a UIRouter transition hook that redirects users whose {@link AuthUserState} does not\n * satisfy the state's requirements.\n *\n * The hook fires on `onBefore` (priority 100) for any state whose `data` property has an\n * `authStates` value. It supports both allow-lists and deny-lists of auth user states.\n *\n * @param transitionService - The UIRouter `TransitionService` to register the hook with.\n * @param config - Configuration including redirect targets and timeout settings.\n *\n * @see {@link HasAuthStateData} for marking states with required auth states.\n * @see {@link HasAuthStateObjectConfig} for detailed allowed/disallowed configuration.\n * @see {@link makeAuthTransitionHook} for the underlying hook factory.\n */\nexport function enableHasAuthStateHook(transitionService: TransitionService, config: HasAuthStateHookConfig): void {\n // Matches if the destination state's data property has a truthy 'isSecure' property\n const isSecureCriteria: HookMatchCriteria = {\n entering: (state) => {\n const data = state?.data as Maybe<Partial<HasAuthStateData>>;\n return Boolean(data?.authStates);\n }\n };\n\n const assertHasAuthState: TransitionHookFn = makeAuthTransitionHook({\n ...config.options,\n makeDecisionsObs(transition: Transition, authService: DbxAuthService): Observable<AuthTransitionDecision> {\n const targetState = transition.targetState();\n const data: HasAuthStateData = targetState.state().data;\n const config = toHasAuthStateObjectConfig(data.authStates);\n const allowedStates: ParsedHasAuthStateConfig = toParsedHasAuthStateConfig(config);\n\n return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));\n }\n });\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });\n}\n\n// MARK: Utility\nfunction toHasAuthStateObjectConfig(input: HasAuthStateConfig): HasAuthStateObjectConfig {\n const isString = typeof input === 'string';\n\n if (Array.isArray(input) || isString) {\n if (isString) {\n input = [input as AuthUserState];\n }\n\n return {\n allowedStates: input as AuthUserState[]\n };\n } else {\n return input as HasAuthStateObjectConfig;\n }\n}\n\ntype ParsedHasAuthStateConfig = AllowedSet<AuthUserState>;\n\nfunction toParsedHasAuthStateConfig(input: HasAuthStateObjectConfig): ParsedHasAuthStateConfig {\n return {\n allowed: maybeSet(input.allowedStates),\n disallowed: maybeSet(input.disallowedStates)\n };\n}\n","/**\n * A contextual state identifier for a specific section of the app.\n *\n * Some examples are:\n * - init: The default context that is initialized.\n * - public: A public part of the app.\n * - onboarding: The onboarding section of the app.\n * - app: The main portion of the app.\n *\n * More complex apps may have more sub-sections or app portions that could each have their own context state.\n */\nexport type DbxAppContextState = string;\n\n/**\n * The init state of an app after the default context has been initialized.\n */\nexport const DBX_INIT_APP_CONTEXT_STATE = 'init';\n/**\n * The public state of an app, typically when a user opens up the site to a public page.\n */\nexport const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';\n/**\n * The auth state of an app, typically when a user has not finished logging in.\n */\nexport const DBX_AUTH_APP_CONTEXT_STATE = 'auth';\n/**\n * The onboarding state of an app, typically when a user has completed auth but not finished setting up their account.\n */\nexport const DBX_ONBOARD_APP_CONTEXT_STATE = 'onboard';\n/**\n * The app state of an app, typically when a user has completed auth and onboarding.\n */\nexport const DBX_APP_APP_CONTEXT_STATE = 'app';\n/**\n * The oauth state of an app, typically when a user is validating an oauth request.\n */\nexport const DBX_OAUTH_APP_CONTEXT_STATE = 'oauth';\n\n/**\n * Default AppContextStates.\n *\n * Your app may not use these, but this type is available for convenience.\n */\nexport type DbxKnownAppContextState = typeof DBX_INIT_APP_CONTEXT_STATE | typeof DBX_PUBLIC_APP_CONTEXT_STATE | typeof DBX_AUTH_APP_CONTEXT_STATE | typeof DBX_ONBOARD_APP_CONTEXT_STATE | typeof DBX_APP_APP_CONTEXT_STATE | typeof DBX_OAUTH_APP_CONTEXT_STATE;\n\n/**\n * Array of all DbxKnownAppContextState values, minus the init state.\n */\nexport const DBX_KNOWN_APP_CONTEXT_STATES: DbxKnownAppContextState[] = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARD_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE, DBX_OAUTH_APP_CONTEXT_STATE];\n","import { createAction, props } from '@ngrx/store';\nimport { type DbxAppContextState } from '../../context';\n\n/**\n * Action to set the current DbxAppContextState value.\n */\nexport const setState = createAction('[App/Context] Set State', props<{ state: DbxAppContextState }>());\n\n/**\n * Resets the app back to the init context.\n */\nexport const resetState = createAction('[App/Context] Reset');\n","import { createReducer, on } from '@ngrx/store';\nimport { type DbxAppContextState, DBX_INIT_APP_CONTEXT_STATE } from '../../context';\nimport { DbxAppContextActions } from '../action';\n\n/**\n * The feature key for these items/reducers.\n */\nexport const DBX_APP_CONTEXT_STATE_FEATURE_KEY = 'data';\n\n/**\n * The typings for this feature.\n */\nexport interface DbxAppContextStateData {\n state: DbxAppContextState;\n}\n\nexport const initialState: DbxAppContextStateData = {\n state: DBX_INIT_APP_CONTEXT_STATE\n};\n\nexport const reducer = createReducer(\n initialState,\n /**\n * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.\n */\n on(DbxAppContextActions.setState, (_, { state }) => ({ state }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\n\nimport * as fromDbxAppContextState from './data.reducer';\n\n/**\n * Global feature key for our app.\n */\nexport const FEATURE_KEY = 'app.context';\n\n/**\n * This is a \"feature state\", which in this case is a single feature (our app state), but could include keys/states within this feature.\n */\nexport interface DbxAppContextFeatureState {\n [fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY]: fromDbxAppContextState.DbxAppContextStateData;\n}\n\n/**\n * Interface typing extension for the DbxAppContextFeatureState, and the typing information for how this feature extends the base state.\n */\nexport interface State {\n [FEATURE_KEY]: DbxAppContextFeatureState;\n}\n\n/**\n * Reducers mapping for the DbxAppContextFeatureState\n *\n * @param state - The current feature state, or undefined for initialization.\n * @param action - The dispatched action to reduce.\n * @returns The updated feature state.\n */\nexport function reducers(state: DbxAppContextFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY]: fromDbxAppContextState.reducer\n })(state, action);\n}\n\n/**\n * Selects the DbxAppContextFeatureState feature context.\n *\n * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.\n */\nexport const selectAppContextFeature = createFeatureSelector<DbxAppContextFeatureState>(FEATURE_KEY);\n\n/**\n * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.\n */\nexport const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState: DbxAppContextFeatureState) => featureState[fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY].state);\n","import { type OnRunEffects, Actions, type EffectNotification, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { type Observable, exhaustMap, filter, takeUntil } from 'rxjs';\nimport { type DbxAppContextState } from '../../context';\nimport { onDbxAppContext } from '../';\nimport { type IterableOrValue, iterableToSet } from '@dereekb/util';\nimport { inject } from '@angular/core';\n\n// MARK: Abstract Context Effects\n/**\n * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.\n */\nexport abstract class AbstractOnDbxAppContextStateEffects<S = unknown> implements OnRunEffects {\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<S>);\n\n /**\n * The set of state(s) to activate on.\n */\n private _activeStatesSet: Set<DbxAppContextState>;\n\n constructor(activeStates: IterableOrValue<DbxAppContextState>) {\n this._activeStatesSet = iterableToSet(activeStates);\n }\n\n /**\n * Configures all actions of the sub-class to only activate when the DbxAppContextState in App\n *\n * @param resolvedEffects$\n * @returns\n */\n ngrxOnRunEffects(resolvedEffects$: Observable<EffectNotification>): Observable<EffectNotification> {\n return this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => {\n return this._activeStatesSet.has(state);\n }),\n exhaustMap(() =>\n resolvedEffects$.pipe(\n takeUntil(\n this.actions$.pipe(\n ofType(onDbxAppContext.DbxAppContextActions.setState),\n filter(({ state }) => !this._activeStatesSet.has(state))\n )\n )\n )\n )\n );\n }\n}\n","import { type Maybe } from '@dereekb/util';\n\n/**\n * Represents the authentication state of an application user.\n *\n * These generic states define the current lifecycle stage of a user's authentication:\n *\n * - `'none'` - The user is not logged in (no active session).\n * - `'anon'` - The user is authenticated via an anonymous account (e.g., Firebase anonymous auth).\n * - `'error'` - An error occurred while resolving the user's authentication state.\n * - `'new'` - The user has a full account but has not yet completed onboarding or initial setup.\n * - `'user'` - The user has a full account and has completed all setup steps.\n *\n * @example\n * ```ts\n * const state: AuthUserState = 'user';\n *\n * if (state === 'new') {\n * // redirect to onboarding\n * }\n * ```\n */\nexport type AuthUserState = 'none' | 'anon' | 'new' | 'user' | 'error';\n\n/**\n * Arbitrary string identifier used to uniquely differentiate authenticated users.\n *\n * Typically corresponds to a UID from the authentication provider (e.g., Firebase Auth UID).\n *\n * @see {@link NO_AUTH_USER_IDENTIFIER} for the sentinel value representing an unidentified user.\n */\nexport type AuthUserIdentifier = string;\n\n/**\n * Sentinel value representing an unauthenticated or unidentifiable user.\n *\n * Used as a fallback when no valid {@link AuthUserIdentifier} is available.\n */\nexport const NO_AUTH_USER_IDENTIFIER = '0';\n\n/**\n * Type representing the {@link NO_AUTH_USER_IDENTIFIER} sentinel value.\n *\n * Useful for type narrowing when distinguishing between authenticated and unauthenticated user identifiers.\n *\n * @see {@link NO_AUTH_USER_IDENTIFIER}\n */\nexport type NoAuthUserIdentifier = typeof NO_AUTH_USER_IDENTIFIER;\n\n/**\n * Normalizes an optional user identifier into a guaranteed {@link AuthUserIdentifier}.\n *\n * If the input is `undefined` or falsy, returns {@link NO_AUTH_USER_IDENTIFIER} as a safe default.\n * This ensures downstream consumers always receive a non-null identifier value.\n *\n * @param inputId - The user identifier to normalize, or `undefined`/`null`.\n * @returns The input identifier if truthy, otherwise {@link NO_AUTH_USER_IDENTIFIER}.\n *\n * @example\n * ```ts\n * authUserIdentifier('abc123'); // 'abc123'\n * authUserIdentifier(undefined); // '0'\n * ```\n */\nexport function authUserIdentifier(inputId: Maybe<AuthUserIdentifier>): AuthUserIdentifier {\n return inputId ? inputId : NO_AUTH_USER_IDENTIFIER;\n}\n","import { createAction } from '@ngrx/store';\n\n/**\n * NgRx action dispatched when the user has successfully logged in.\n *\n * This is an event action (past tense) triggered by {@link DbxAppAuthEffects} in response\n * to the {@link DbxAuthService.onLogIn$} observable. It signals that authentication has been\n * established and downstream effects (e.g., navigation to the app) can proceed.\n *\n * @see {@link loggedOut} for the corresponding logout event.\n * @see {@link DbxAppAuthEffects.emitLoggedIn}\n */\nexport const loggedIn = createAction('[App/Auth] Auth Logged In');\n\n/**\n * NgRx action dispatched when the user has logged out.\n *\n * This is an event action (past tense) triggered by {@link DbxAppAuthEffects} in response\n * to the {@link DbxAuthService.onLogOut$} observable. When dispatched, the user reducer\n * resets the auth state to its initial values (no user, no roles, not onboarded).\n *\n * @see {@link loggedIn} for the corresponding login event.\n * @see {@link logout} for the imperative command action to initiate logout.\n */\nexport const loggedOut = createAction('[App/Auth] Auth Logged Out');\n\n/**\n * NgRx action that commands the application to perform a logout.\n *\n * This is a command action (imperative) that, when dispatched, triggers {@link DbxAppAuthEffects.forwardLogoutToAuthService}\n * to call {@link DbxAuthService.logOut}. Use this action to initiate logout from anywhere in the application\n * via the NgRx store rather than calling the auth service directly.\n *\n * @see {@link loggedOut} for the event action dispatched after logout completes.\n */\nexport const logout = createAction('[App/Auth] Auth Logout');\n","import { createAction, props } from '@ngrx/store';\nimport { type AuthRole } from '@dereekb/util';\nimport { type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\n\n/**\n * NgRx action that updates the authenticated user's identifier in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserIdentifier} whenever the\n * {@link DbxAuthService.userIdentifier$} emits a new value.\n *\n * @see {@link DbxAppAuthStateUser.userId}\n */\nexport const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props<{ id: AuthUserIdentifier }>());\n\n/**\n * NgRx action that updates the authenticated user's {@link AuthUserState} in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserState} whenever the\n * {@link DbxAuthService.authUserState$} emits a new value. The state determines\n * the user's lifecycle stage (none, anon, new, user, or error).\n *\n * @see {@link AuthUserState}\n * @see {@link DbxAppAuthStateUser.userState}\n */\nexport const setUserState = createAction('[App/Auth] Set User State', props<{ state: AuthUserState }>());\n\n/**\n * NgRx action that updates the authenticated user's auth roles in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserRoles} whenever the\n * {@link DbxAuthService.authRoles$} emits a new role set. Roles are stored\n * as an array in the NgRx state.\n *\n * @see {@link DbxAppAuthStateUser.userRoles}\n */\nexport const setUserRoles = createAction('[App/Auth] Set User Roles', props<{ roles: AuthRole[] }>());\n\n/**\n * NgRx action that updates the authenticated user's onboarding status in the store.\n *\n * Dispatched by {@link DbxAppAuthEffects.setUserIsOnboarded} whenever the\n * {@link DbxAuthService.isOnboarded$} emits a new value.\n *\n * @see {@link DbxAppAuthStateUser.isOnboarded}\n */\nexport const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props<{ isOnboarded: boolean }>());\n","import { NO_AUTH_USER_IDENTIFIER, type AuthUserIdentifier, type AuthUserState } from '../../auth.user';\nimport { createReducer, on } from '@ngrx/store';\nimport { DbxAppAuthActions, DbxAppAuthUserActions } from '../action';\nimport { type AuthRole } from '@dereekb/util';\n\n/**\n * NgRx feature key for the auth user sub-state within the auth feature.\n */\nexport const DBX_APP_AUTH_USER_FEATURE_KEY = 'user';\n\n/**\n * Shape of the authenticated user's state stored in the NgRx store.\n *\n * This interface represents the complete snapshot of user authentication information\n * managed by the auth reducer, including identity, lifecycle state, authorization roles,\n * and onboarding status.\n *\n * @example\n * ```ts\n * // Selecting from the store via DbxAppAuthStateService:\n * const user$ = authStateService.authStateUser$;\n * user$.subscribe((user: DbxAppAuthStateUser) => {\n * console.log(user.userId, user.userState, user.userRoles);\n * });\n * ```\n *\n * @see {@link DbxAppAuthStateService} for accessing this state reactively.\n * @see {@link AuthUserState} for possible values of `userState`.\n */\nexport interface DbxAppAuthStateUser {\n /**\n * Unique identifier for the authenticated user. Defaults to {@link NO_AUTH_USER_IDENTIFIER} when no user is logged in.\n */\n userId: AuthUserIdentifier;\n /**\n * Whether the user has completed the onboarding/setup flow.\n */\n isOnboarded: boolean;\n /**\n * Current authentication lifecycle state of the user.\n */\n userState: AuthUserState;\n /**\n * Array of authorization roles assigned to the current user.\n */\n userRoles: AuthRole[];\n}\n\n/**\n * Initial state for the auth user reducer.\n *\n * Represents a fully unauthenticated state: no user identifier, not onboarded,\n * in the `'none'` auth state, with no roles assigned.\n */\nexport const initialState: DbxAppAuthStateUser = {\n userId: NO_AUTH_USER_IDENTIFIER,\n isOnboarded: false,\n userState: 'none',\n userRoles: []\n};\n\nexport const reducer = createReducer(\n initialState,\n on(DbxAppAuthActions.loggedOut, () => ({ ...initialState })),\n on(DbxAppAuthUserActions.setUserIdentifier, (state, { id: userId }) => ({ ...state, userId })),\n on(DbxAppAuthUserActions.setUserIsOnboarded, (state, { isOnboarded }) => ({ ...state, isOnboarded })),\n on(DbxAppAuthUserActions.setUserState, (state, { state: userState }) => ({ ...state, userState })),\n on(DbxAppAuthUserActions.setUserRoles, (state, { roles: userRoles }) => ({ ...state, userRoles: [...userRoles] }))\n);\n","import { type Action, combineReducers, createFeatureSelector, createSelector } from '@ngrx/store';\nimport * as fromDbxAppAuthUserState from './user.reducer';\n\n/**\n * NgRx feature key used to register the auth feature state in the global store.\n *\n * The auth state is registered under `'app.auth'` in the root NgRx state tree.\n */\nexport const FEATURE_KEY = 'app.auth';\n\n/**\n * Shape of the auth feature state slice, containing all auth-related sub-states.\n *\n * Currently contains only the user sub-state ({@link DbxAppAuthStateUser}), but is\n * structured to accommodate additional auth-related sub-features in the future.\n *\n * @see {@link DbxAppAuthStateUser} for the user sub-state shape.\n */\nexport interface DbxAppAuthFeatureState {\n [fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY]: fromDbxAppAuthUserState.DbxAppAuthStateUser;\n}\n\n/**\n * Root state interface extension that declares how the auth feature integrates into the global NgRx store.\n *\n * Use this type when injecting `Store<State>` in effects or services that need typed access\n * to the auth feature selectors.\n *\n * @see {@link DbxAppAuthFullState} for the public alias of this type.\n */\nexport interface State {\n [FEATURE_KEY]: DbxAppAuthFeatureState;\n}\n\n/**\n * Combined reducer function for the auth feature state.\n *\n * Merges all auth sub-reducers (currently just the user reducer) using NgRx's `combineReducers`.\n * This function is registered with `provideState` via {@link provideDbxAppAuthState}.\n *\n * @param state - The current auth feature state, or `undefined` for initialization.\n * @param action - The dispatched NgRx action.\n * @returns The updated {@link DbxAppAuthFeatureState}.\n */\nexport function reducers(state: DbxAppAuthFeatureState | undefined, action: Action) {\n return combineReducers({\n [fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY]: fromDbxAppAuthUserState.reducer\n })(state, action);\n}\n\n/**\n * NgRx feature selector that retrieves the entire {@link DbxAppAuthFeatureState} from the global store.\n */\nexport const selectAppAuthFeature = createFeatureSelector<DbxAppAuthFeatureState>(FEATURE_KEY);\n\n/**\n * NgRx selector that retrieves the {@link DbxAppAuthStateUser} from the auth feature state.\n *\n * Provides access to the user's identifier, auth state, roles, and onboarding status.\n *\n * @see {@link DbxAppAuthStateService.authStateUser$} for the observable wrapper.\n */\nexport const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState: DbxAppAuthFeatureState) => featureState[fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY]);\n","import { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { firstValueFrom } from 'rxjs';\nimport { type SegueRef, type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * A function type that performs router navigation using a {@link SegueRef}.\n *\n * Returns a promise that resolves to `true` if the navigation was successful.\n *\n * @see {@link goWithRouter} for creating instances\n */\nexport type GoWithRouter = (route: ObservableOrValue<SegueRef>) => Promise<boolean>;\n\n/**\n * Creates a navigation function bound to the given {@link DbxRouterService}.\n *\n * The returned function accepts either a {@link SegueRef}, a router link string, or an observable of either,\n * resolves it to a single value, and calls `go()` on the router service.\n *\n * @param dbxRouterService - The router service to use for navigation.\n * @returns A function that navigates to the given route and returns a promise resolving to the navigation result.\n *\n * @example\n * ```ts\n * const navigate = goWithRouter(routerService);\n * await navigate({ ref: 'app.dashboard' });\n * ```\n *\n * @see {@link GoWithRouter}\n */\nexport function goWithRouter(dbxRouterService: DbxRouterService): (route: ObservableOrValue<SegueRefOrSegueRefRouterLink>) => Promise<boolean> {\n return (route) => {\n return firstValueFrom(asObservable(route)).then((x) => dbxRouterService.go(x));\n };\n}\n","import { type Observable } from 'rxjs';\nimport { type DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Abstract service that provides an observable stream of router transition events.\n *\n * This is the base class for {@link DbxRouterService}, exposing only the transition\n * observation capability without navigation methods. Useful when a consumer only needs\n * to react to route changes without performing navigation.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * class MyComponent {\n * private readonly transitions = inject(DbxRouterTransitionService);\n *\n * readonly onSuccess$ = this.transitions.transitions$.pipe(\n * filter(e => e.type === DbxRouterTransitionEventType.SUCCESS)\n * );\n * }\n * ```\n *\n * @see {@link DbxRouterService} for the full router service with navigation\n * @see {@link DbxRouterTransitionEvent} for the event type\n */\nexport abstract class DbxRouterTransitionService {\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n}\n","import { type ObservableOrValue } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../segue';\nimport { DbxRouterTransitionService } from './router.transition.service';\n\n/**\n * Abstract router service that provides navigation capabilities and routing state information.\n *\n * Extends {@link DbxRouterTransitionService} with navigation methods (`go`, `updateParams`) and\n * route inspection methods (`isActive`, `isActiveExactly`, `comparePrecision`).\n *\n * Concrete implementations include {@link DbxAngularRouterService} (Angular Router) and\n * {@link DbxUIRouterService} (UIRouter).\n *\n * @example\n * ```ts\n * // Inject and use in a component or service\n * @Component({ ... })\n * class MyComponent {\n * private readonly router = inject(DbxRouterService);\n *\n * navigateToDashboard(): void {\n * this.router.go({ ref: 'app.dashboard', refParams: { tab: 'overview' } });\n * }\n * }\n * ```\n *\n * @see {@link DbxRouterTransitionService} for transition event observables\n * @see {@link DbxAngularRouterService} for the Angular Router implementation\n * @see {@link DbxUIRouterService} for the UIRouter implementation\n */\nexport abstract class DbxRouterService extends DbxRouterTransitionService {\n /**\n * Params of the current successfully loaded route.\n */\n abstract readonly params$: Observable<SegueRefRawSegueParams>;\n\n /**\n * Navigates to the target SegueRef.\n *\n * @param segueRef\n */\n abstract go(segueRef: ObservableOrValue<SegueRefOrSegueRefRouterLink>): Promise<boolean>;\n\n /**\n * Navigates to the current url with updated parameters. Will be merged with the existing parameters.\n *\n * The new state will replace the current state in the history.\n *\n * @param segueRef\n */\n abstract updateParams(params: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean>;\n\n /**\n * Returns `true` if the input segue ref is considered active (hierarchical match).\n *\n * Accepts both state names (e.g., `'app.dashboard'`) and slash paths (e.g., `'/app/dashboard'`).\n * For non-exact checks, a parent route matches all of its children — e.g., `'/app/oauth'`\n * is active when the current path is `'/app/oauth/login'`.\n *\n * @param segueRef - A state name, URL path, or {@link SegueRef} to check against the current route.\n */\n abstract isActive(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Returns `true` if the input segue ref matches the current route exactly.\n *\n * Unlike {@link isActive}, this does not match parent routes against child routes.\n *\n * @param segueRef - A state name, URL path, or {@link SegueRef} to check against the current route.\n */\n abstract isActiveExactly(segueRef: SegueRefOrSegueRefRouterLink): boolean;\n\n /**\n * Compares the two refs for precision for a certain route.\n *\n * For example, if the parent route is input with a child route, the child route is\n * considered more precise.\n *\n * @param a\n * @param b\n */\n abstract comparePrecision(a: SegueRefOrSegueRefRouterLink, b: SegueRefOrSegueRefRouterLink): number;\n}\n","import { type SegueRefOrSegueRefRouterLink } from '../../router/segue';\n\n/**\n * Abstract configuration class that defines the key authentication-related routes for an application.\n *\n * Provide a concrete instance of this class via {@link provideDbxAppAuthRouter} to configure\n * where the auth router service navigates during authentication lifecycle events (login, logout, onboarding).\n *\n * @example\n * ```ts\n * const authRoutes: DbxAppAuthRoutes = {\n * loginRef: '/auth/login',\n * loggedOutRef: '/auth/logged-out',\n * onboardRef: '/onboard',\n * appRef: '/app'\n * };\n * ```\n *\n * @see {@link DbxAppAuthRouterService} for the service that uses these routes for navigation.\n * @see {@link provideDbxAppAuthRouter} for registering this configuration.\n */\nexport abstract class DbxAppAuthRoutes {\n /**\n * Route reference for the login page. Users are redirected here when authentication is required.\n */\n abstract readonly loginRef: SegueRefOrSegueRefRouterLink;\n /**\n * Optional route reference for the logged-out page. Falls back to {@link loginRef} if not provided.\n */\n abstract readonly loggedOutRef?: SegueRefOrSegueRefRouterLink;\n /**\n * Optional route reference for the onboarding/setup page. Falls back to {@link appRef} if not provided.\n */\n abstract readonly onboardRef?: SegueRefOrSegueRefRouterLink;\n /**\n * Route reference for the main application page. Users are redirected here after successful authentication.\n */\n abstract readonly appRef: SegueRefOrSegueRefRouterLink;\n}\n","import { BehaviorSubject, combineLatest, distinctUntilChanged, map, type Observable, startWith } from 'rxjs';\nimport { Injectable, type OnDestroy, inject } from '@angular/core';\nimport { goWithRouter } from '../../router/router/service/router.go';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { type SegueRefOrSegueRefRouterLink } from '../../router/segue';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Angular service that provides programmatic navigation to key authentication-related routes.\n *\n * This service wraps {@link DbxRouterService} and {@link DbxAppAuthRoutes} to offer\n * convenient methods for navigating to login, logout, onboarding, and main app routes.\n * It also manages an `isAuthRouterEffectsEnabled` flag that controls whether\n * {@link DbxAppAuthRouterEffects} should perform automatic navigation on auth events.\n *\n * Routes can be added to the ignored set via {@link addIgnoredRoute} to prevent\n * auth effects from redirecting away from those routes (e.g., OAuth interaction pages).\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class LogoutButtonComponent {\n * private readonly authRouterService = inject(DbxAppAuthRouterService);\n *\n * async onLogout() {\n * await this.authRouterService.goToLoggedOut();\n * }\n * }\n * ```\n *\n * @see {@link DbxAppAuthRoutes} for the route configuration.\n * @see {@link DbxAppAuthRouterEffects} for automatic navigation on auth state changes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthRouterService implements OnDestroy {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxAppAuthRoutes = inject(DbxAppAuthRoutes);\n\n private readonly _isAuthRouterEffectsEnabled = new BehaviorSubject<boolean>(true);\n private readonly _ignoredRoutes = new BehaviorSubject<Set<SegueRefOrSegueRefRouterLink>>(new Set());\n\n /**\n * Observable of whether auth router effects are currently enabled.\n */\n readonly isAuthRouterEffectsEnabled$ = this._isAuthRouterEffectsEnabled.asObservable();\n\n /**\n * Observable of the set of route refs that are excluded from auth redirect effects.\n */\n readonly ignoredRoutes$ = this._ignoredRoutes.asObservable();\n\n /**\n * Observable that emits `true` when the current route is in the ignored set.\n *\n * Combines the ignored route refs with router transition events to re-evaluate\n * whenever the route or the ignored set changes.\n */\n readonly isCurrentRouteIgnoredByAuthEffects$: Observable<boolean> = combineLatest([this._ignoredRoutes, this.dbxRouterService.transitions$.pipe(startWith(undefined))]).pipe(\n map(([ignoredRefs]) => this._checkCurrentRouteIgnored(ignoredRefs)),\n distinctUntilChanged()\n );\n\n /**\n * Observable that emits `true` when auth router effects should be active for the current route.\n *\n * Combines the enabled flag and the ignored route check.\n */\n readonly shouldAuthEffectsRedirect$: Observable<boolean> = combineLatest([this.isAuthRouterEffectsEnabled$, this.isCurrentRouteIgnoredByAuthEffects$]).pipe(\n map(([enabled, ignored]) => enabled && !ignored),\n distinctUntilChanged()\n );\n\n ngOnDestroy(): void {\n this._isAuthRouterEffectsEnabled.complete();\n this._ignoredRoutes.complete();\n }\n\n get hasOnboardingState(): boolean {\n return Boolean(this.dbxAppAuthRoutes.onboardRef);\n }\n\n // MARK: Effects\n /**\n * Whether or not DbxAppAuthRouterEffects are enabled.\n *\n * @returns Whether auth router effects are currently enabled.\n */\n get isAuthRouterEffectsEnabled(): boolean {\n return this._isAuthRouterEffectsEnabled.value;\n }\n\n set isAuthRouterEffectsEnabled(enabled: boolean) {\n this._isAuthRouterEffectsEnabled.next(enabled);\n }\n\n // MARK: Ignored Routes\n /**\n * Adds a route to the ignored set. Auth effects will not redirect\n * when the user is on a route that matches any ignored route.\n *\n * Uses hierarchical matching — adding a parent route (e.g., `'/app/oauth'`)\n * will also ignore all child routes (e.g., `'/app/oauth/login'`).\n *\n * @param ref - The route ref to add to the ignored set.\n */\n addIgnoredRoute(ref: SegueRefOrSegueRefRouterLink): void {\n const current = this._ignoredRoutes.value;\n const next = new Set(current);\n next.add(ref);\n this._ignoredRoutes.next(next);\n }\n\n /**\n * Removes a route from the ignored set.\n *\n * @param ref - The route ref to remove from the ignored set.\n */\n removeIgnoredRoute(ref: SegueRefOrSegueRefRouterLink): void {\n const current = this._ignoredRoutes.value;\n const next = new Set(current);\n next.delete(ref);\n this._ignoredRoutes.next(next);\n }\n\n /**\n * Returns `true` if the current route matches any of the ignored routes.\n *\n * @returns Whether the current route is in the ignored set.\n */\n get isCurrentRouteIgnoredByAuthEffects(): boolean {\n return this._checkCurrentRouteIgnored(this._ignoredRoutes.value);\n }\n\n private _checkCurrentRouteIgnored(ignoredRefs: Set<SegueRefOrSegueRefRouterLink>): boolean {\n for (const ref of ignoredRefs) {\n if (this.dbxRouterService.isActive(ref)) {\n return true;\n }\n }\n\n return false;\n }\n\n // MARK: Navigate\n /**\n * Navigates to the login state.\n *\n * @returns\n */\n goToLogin() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the logged out state, if it exists, otherwise navigates to the login state.\n *\n * @returns\n */\n goToLoggedOut() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loggedOutRef ?? this.dbxAppAuthRoutes.loginRef);\n }\n\n /**\n * Navigates to the onboarding state if it is available, otherwise navigates to the app.\n *\n * @returns\n */\n goToOnboarding(): Promise<boolean> {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.onboardRef ?? this.dbxAppAuthRoutes.appRef);\n }\n\n /**\n * Navigates to the app state.\n *\n * @returns\n */\n goToApp() {\n return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);\n }\n}\n","import { exhaustMap, filter, first, switchMap } from 'rxjs';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\nimport { type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { createEffect, ofType } from '@ngrx/effects';\nimport { type DbxAppContextState, DBX_KNOWN_APP_CONTEXT_STATES } from '../../../../context/context';\nimport { AbstractOnDbxAppContextStateEffects } from '../../../../context/state/effect';\nimport { type fromDbxAppAuth, onDbxAppAuth } from '../../../state';\nimport { DbxAppAuthRouterService } from '../../auth.router.service';\n\n/**\n * Angular injection token used to configure which {@link DbxAppContextState} values\n * the {@link DbxAppAuthRouterEffects} should be active for.\n *\n * When provided, the effects will only trigger navigation (e.g., redirect on logout)\n * when the application is in one of the specified context states.\n * Defaults to {@link DBX_KNOWN_APP_CONTEXT_STATES} if not explicitly provided.\n *\n * @see {@link provideDbxAppAuthRouterState} for how this token is provisioned.\n */\nexport const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');\n\n/**\n * NgRx effects class that performs automatic navigation when authentication state changes.\n *\n * This effects class handles two key navigation scenarios:\n * - **On logout**: Redirects the user to the login route via {@link DbxAppAuthRouterService.goToLogin}.\n * - **On login**: Redirects the user to the main app route via {@link DbxAppAuthRouterService.goToApp}.\n *\n * Navigation only occurs when:\n * 1. The app is in one of the configured active context states (see {@link DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN}).\n * 2. The {@link DbxAppAuthRouterService.isAuthRouterEffectsEnabled} flag is `true`.\n * 3. The current route is not in the ignored routes set (see {@link DbxAppAuthRouterService.addIgnoredRoute}).\n *\n * Extends {@link AbstractOnDbxAppContextStateEffects} to scope effect activation to specific app states.\n *\n * @see {@link DbxAppAuthRouterService} for the navigation methods used.\n * @see {@link provideDbxAppAuthRouterState} for registration and configuration.\n */\n@Injectable()\nexport class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects<fromDbxAppAuth.State> {\n readonly dbxAppAuthRouterService = inject(DbxAppAuthRouterService);\n\n constructor() {\n super(inject<Maybe<ArrayOrValue<DbxAppContextState>>>(DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, { optional: true }) ?? DBX_KNOWN_APP_CONTEXT_STATES);\n }\n\n /**\n * Effect to redirect to the login when logout occurs.\n */\n readonly redirectToLoginOnLogout = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedOut),\n switchMap(() => this.dbxAppAuthRouterService.shouldAuthEffectsRedirect$.pipe(first())),\n filter((shouldRedirect) => shouldRedirect),\n exhaustMap(() => this.dbxAppAuthRouterService.goToLogin())\n ),\n { dispatch: false }\n );\n\n /**\n * Effect to redirect to the app when login occurs.\n */\n readonly redirectToOnboardOnLogIn = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.loggedIn),\n switchMap(() => this.dbxAppAuthRouterService.shouldAuthEffectsRedirect$.pipe(first())),\n filter((shouldRedirect) => shouldRedirect),\n exhaustMap(() => this.dbxAppAuthRouterService.goToApp())\n ),\n { dispatch: false }\n );\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type ArrayOrValue } from '@dereekb/util';\nimport { provideEffects } from '@ngrx/effects';\nimport { type DbxAppContextState } from '../../../context';\nimport { DbxAppAuthRouterEffects, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN } from './effect/auth.router.state.effect';\n\n/**\n * Configuration for {@link provideDbxAppAuthRouterState}.\n *\n * @see {@link DbxAppAuthRouterEffects} for the effects that use this configuration.\n */\nexport interface ProvideDbxAppAuthRouterStateConfig {\n /**\n * Application context states during which the auth router effects should be active.\n *\n * When the app is in one of these states, effects like automatic redirect on login/logout\n * will be applied. Typically set to `['root']` or {@link DBX_KNOWN_APP_CONTEXT_STATES}.\n */\n readonly activeRoutesToApplyEffects: ArrayOrValue<DbxAppContextState>;\n}\n\n/**\n * Creates Angular `EnvironmentProviders` that register the auth router state effects\n * and their configuration.\n *\n * This provisions the {@link DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN} with the active states\n * and registers the {@link DbxAppAuthRouterEffects} NgRx effects class.\n *\n * @param config - Configuration specifying which app context states activate the auth router effects.\n * @returns Angular `EnvironmentProviders` for the auth router state effects.\n *\n * @example\n * ```ts\n * provideDbxAppAuthRouterState({\n * activeRoutesToApplyEffects: ['root']\n * });\n * ```\n *\n * @see {@link provideDbxAppAuth} for the all-in-one provider that includes this.\n * @see {@link DbxAppAuthRouterEffects} for the effects that handle auth-based navigation.\n */\nexport function provideDbxAppAuthRouterState(config: ProvideDbxAppAuthRouterStateConfig): EnvironmentProviders {\n const { activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n // Token for effects\n {\n provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,\n useValue: activeRoutesToApplyEffects\n },\n // Effects\n provideEffects(DbxAppAuthRouterEffects)\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { DbxAppAuthRoutes } from './auth.router';\n\n/**\n * Configuration for {@link provideDbxAppAuthRouter}.\n *\n * @see {@link DbxAppAuthRoutes} for the route definitions.\n */\nexport interface ProvideDbxAppAuthRouterConfig {\n /**\n * The concrete {@link DbxAppAuthRoutes} instance that defines the application's auth-related routes\n * (login, logout, onboarding, and main app).\n */\n readonly dbxAppAuthRoutes: DbxAppAuthRoutes;\n}\n\n/**\n * Creates Angular `EnvironmentProviders` that register the {@link DbxAppAuthRoutes} configuration.\n *\n * This makes the auth routes available for injection throughout the application,\n * primarily consumed by {@link DbxAppAuthRouterService} for programmatic navigation.\n *\n * @param config - Configuration containing the auth routes to register.\n * @returns Angular `EnvironmentProviders` for the auth router.\n *\n * @example\n * ```ts\n * provideDbxAppAuthRouter({\n * dbxAppAuthRoutes: {\n * loginRef: '/auth/login',\n * appRef: '/app'\n * }\n * });\n * ```\n *\n * @see {@link provideDbxAppAuth} for the all-in-one provider that includes this.\n */\nexport function provideDbxAppAuthRouter(config: ProvideDbxAppAuthRouterConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes } = config;\n\n const providers: Provider[] = [\n {\n provide: DbxAppAuthRoutes,\n useValue: dbxAppAuthRoutes\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type AuthRole, type AuthRoleSet, type Maybe } from '@dereekb/util';\nimport { onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, setContainsNoValueFrom } from '@dereekb/rxjs';\nimport { map, type Observable, type OperatorFunction } from 'rxjs';\n\n/**\n * Creates an observable that emits a `void` event each time the user transitions from\n * logged-out to logged-in (i.e., the input observable transitions from `false` to `true`).\n *\n * Useful for triggering side effects (e.g., loading user data) on login events.\n *\n * @param isLoggedInObs - An observable that emits `true` when the user is logged in and `false` otherwise.\n * @returns An observable that emits `void` on each false-to-true transition.\n *\n * @see {@link loggedOutObsFromIsLoggedIn} for the inverse (logout detection).\n */\nexport function loggedInObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onFalseToTrue(),\n map(() => undefined)\n );\n}\n/**\n * Creates an observable that emits a `void` event each time the user transitions from\n * logged-in to logged-out (i.e., the input observable transitions from `true` to `false`).\n *\n * Useful for triggering side effects (e.g., clearing cached data) on logout events.\n *\n * @param isLoggedInObs - An observable that emits `true` when the user is logged in and `false` otherwise.\n * @returns An observable that emits `void` on each true-to-false transition.\n *\n * @see {@link loggedInObsFromIsLoggedIn} for the inverse (login detection).\n */\nexport function loggedOutObsFromIsLoggedIn(isLoggedInObs: Observable<boolean>): Observable<void> {\n return isLoggedInObs.pipe(\n onTrueToFalse(),\n map(() => undefined)\n );\n}\n\n/**\n * RxJS operator that checks whether an {@link AuthRoleSet} contains **all** roles from the given observable set.\n *\n * Emits `true` when every role in the target set is present in the source role set, `false` otherwise.\n *\n * @param roles - Observable of the required roles to check against.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link authRolesSetContainsAnyRoleFrom} for matching any role.\n * @see {@link authRolesSetContainsNoRolesFrom} for matching no roles.\n */\nexport function authRolesSetContainsAllRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\n/**\n * RxJS operator that checks whether an {@link AuthRoleSet} contains **any** role from the given observable set.\n *\n * Emits `true` when at least one role in the target set is present in the source role set, `false` otherwise.\n *\n * @param roles - Observable of the target roles to check against.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link authRolesSetContainsAllRolesFrom} for matching all roles.\n * @see {@link authRolesSetContainsNoRolesFrom} for matching no roles.\n */\nexport function authRolesSetContainsAnyRoleFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsAllValuesFrom<AuthRole>(roles);\n}\n\n/**\n * RxJS operator that checks whether an {@link AuthRoleSet} contains **none** of the roles from the given observable set.\n *\n * Emits `true` when no role in the target set is present in the source role set, `false` otherwise.\n * Useful for hiding content from users with specific roles.\n *\n * @param roles - Observable of the roles to check for absence.\n * @returns An `OperatorFunction` that transforms an `AuthRoleSet` stream into a `boolean` stream.\n *\n * @see {@link authRolesSetContainsAllRolesFrom} for matching all roles.\n * @see {@link authRolesSetContainsAnyRoleFrom} for matching any role.\n */\nexport function authRolesSetContainsNoRolesFrom(roles: Observable<Maybe<Iterable<AuthRole>>>): OperatorFunction<AuthRoleSet, boolean> {\n return setContainsNoValueFrom<AuthRole>(roles);\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Store } from '@ngrx/store';\nimport { DbxAuthService } from '../../service/auth.service';\nimport { onDbxAppAuth } from '../';\nimport { map, tap } from 'rxjs';\nimport type * as fromDbxAppAuth from '../reducer';\n\n/**\n * NgRx effects class that bridges the {@link DbxAuthService} observables into the NgRx store.\n *\n * This effects class serves two purposes:\n * 1. **Event forwarding**: Listens to the auth service's reactive streams (login/logout events,\n * user state, roles, onboarding status, user identifier) and dispatches corresponding NgRx actions\n * to keep the store in sync with the auth provider.\n * 2. **Command handling**: Listens for the `logout` command action and forwards it to\n * {@link DbxAuthService.logOut} to perform the actual logout.\n *\n * This is registered via {@link provideDbxAppAuthState} and should not be provided manually.\n *\n * @see {@link DbxAuthService} for the source observables.\n * @see {@link DbxAppAuthActions} for the auth lifecycle actions.\n * @see {@link DbxAppAuthUserActions} for the user state actions.\n */\n@Injectable()\nexport class DbxAppAuthEffects {\n private readonly dbxAuthService = inject(DbxAuthService);\n protected readonly actions$ = inject(Actions);\n protected readonly store = inject(Store<fromDbxAppAuth.State>);\n\n // MARK: Auth\n /**\n * Dispatches {@link DbxAppAuthActions.loggedIn} when the auth service emits a login event.\n */\n readonly emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedIn())));\n\n /**\n * Dispatches {@link DbxAppAuthActions.loggedOut} when the auth service emits a logout event.\n */\n readonly emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$.pipe(map(() => onDbxAppAuth.DbxAppAuthActions.loggedOut())));\n\n /**\n * Forwards the {@link DbxAppAuthActions.logout} command to {@link DbxAuthService.logOut}.\n */\n readonly forwardLogoutToAuthService = createEffect(\n () =>\n this.actions$.pipe(\n ofType(onDbxAppAuth.DbxAppAuthActions.logout),\n tap(() => {\n // Perform the logout\n void this.dbxAuthService.logOut();\n })\n ),\n { dispatch: false }\n );\n\n // MARK: User\n /**\n * Syncs the user identifier from the auth service into the NgRx store.\n */\n readonly setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$.pipe(map((id) => onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier({ id }))));\n\n /**\n * Syncs the user's {@link AuthUserState} from the auth service into the NgRx store.\n */\n readonly setUserState = createEffect(() => this.dbxAuthService.authUserState$.pipe(map((state) => onDbxAppAuth.DbxAppAuthUserActions.setUserState({ state }))));\n\n /**\n * Syncs the user's auth roles from the auth service into the NgRx store.\n */\n readonly setUserRoles = createEffect(() => this.dbxAuthService.authRoles$.pipe(map((roles) => onDbxAppAuth.DbxAppAuthUserActions.setUserRoles({ roles: [...(roles ?? [])] }))));\n\n /**\n * Syncs the user's onboarding status from the auth service into the NgRx store.\n */\n readonly setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$.pipe(map((isOnboarded) => onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded({ isOnboarded }))));\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideEffects } from '@ngrx/effects';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { DbxAppAuthEffects } from './state/effect/auth.effect';\n\n/**\n * Creates Angular `EnvironmentProviders` that register the NgRx auth feature state and effects.\n *\n * This provisions the `fromDbxAppAuth` feature reducer and the {@link DbxAppAuthEffects} effects class,\n * which together manage the auth user state (identifier, roles, onboarding status) in the NgRx store.\n *\n * Typically called internally by {@link provideDbxAppAuth}, but can be used independently\n * if only the state management (without router integration) is needed.\n *\n * @returns Angular `EnvironmentProviders` for the auth state feature.\n *\n * @see {@link DbxAppAuthEffects}\n * @see {@link fromDbxAppAuth}\n */\nexport function provideDbxAppAuthState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppAuth.FEATURE_KEY, fromDbxAppAuth.reducers), provideEffects(DbxAppAuthEffects)]);\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { provideDbxAppAuthState } from './auth.state.providers';\nimport { provideDbxAppAuthRouter, type ProvideDbxAppAuthRouterConfig } from './router/auth.router.providers';\nimport { provideDbxAppAuthRouterState, type ProvideDbxAppAuthRouterStateConfig } from './router/state/auth.router.state.providers';\n\n/**\n * Combined configuration for provisioning all dbx-core authentication providers.\n *\n * Merges the configuration requirements from both the auth router and the auth router state\n * into a single interface, simplifying setup when all auth features are needed.\n *\n * @see {@link ProvideDbxAppAuthRouterConfig} for route configuration details.\n * @see {@link ProvideDbxAppAuthRouterStateConfig} for router state effect configuration details.\n *\n * @example\n * ```ts\n * const config: ProvideDbxAppAuthConfig = {\n * dbxAppAuthRoutes: myAuthRoutes,\n * activeRoutesToApplyEffects: ['root']\n * };\n * ```\n */\nexport interface ProvideDbxAppAuthConfig extends ProvideDbxAppAuthRouterConfig, ProvideDbxAppAuthRouterStateConfig {}\n\n/**\n * All-in-one provider function that registers the complete set of dbx-core auth providers.\n *\n * This is the recommended way to set up authentication in a dbx-core application. It provisions:\n * - The NgRx auth state and effects via {@link provideDbxAppAuthState}\n * - The auth router configuration via {@link provideDbxAppAuthRouter}\n * - The auth router state effects via {@link provideDbxAppAuthRouterState}\n *\n * @param config - Combined auth configuration including routes and active states for effects.\n * @returns Angular `EnvironmentProviders` to be included in the application's provider list.\n *\n * @example\n * ```ts\n * // In your app config or module:\n * provideDbxAppAuth({\n * dbxAppAuthRoutes: {\n * loginRef: '/login',\n * appRef: '/app'\n * },\n * activeRoutesToApplyEffects: ['root']\n * });\n * ```\n *\n * @see {@link provideDbxAppAuthState}\n * @see {@link provideDbxAppAuthRouter}\n * @see {@link provideDbxAppAuthRouterState}\n */\nexport function provideDbxAppAuth(config: ProvideDbxAppAuthConfig): EnvironmentProviders {\n const { dbxAppAuthRoutes, activeRoutesToApplyEffects } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [provideDbxAppAuthState(), provideDbxAppAuthRouter({ dbxAppAuthRoutes }), provideDbxAppAuthRouterState({ activeRoutesToApplyEffects })];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type AuthRole, type ArrayOrValue, type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAnyRoleFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural directive that conditionally renders its host element based on whether\n * the currently authenticated user possesses **at least one** of the specified auth roles.\n *\n * Similar to `*ngIf`, this directive shows or hides content reactively as the user's\n * roles change. It uses {@link DbxAuthService.authRoles$} to observe the current role set\n * and checks that at least one role in the target list is present.\n *\n * @example\n * ```html\n * <!-- Show if user has either 'admin' or 'moderator' role -->\n * <div *dbxAuthHasAnyRole=\"['admin', 'moderator']\">Privileged content</div>\n *\n * <!-- Show if user has the 'viewer' role -->\n * <div *dbxAuthHasAnyRole=\"'viewer'\">Viewer content</div>\n * ```\n *\n * @see {@link DbxAuthHasRolesDirective} for requiring **all** specified roles.\n * @see {@link DbxAuthNotAnyRoleDirective} for excluding users with specified roles.\n */\n@Directive({\n selector: '[dbxAuthHasAnyRole]',\n standalone: true\n})\nexport class DbxAuthHasAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));\n}\n","import { type Maybe, type AuthRole, type ArrayOrValue } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsAllRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural directive that conditionally renders its host element based on whether\n * the currently authenticated user possesses **all** of the specified auth roles.\n *\n * Similar to `*ngIf`, this directive shows or hides content reactively as the user's\n * roles change. It uses {@link DbxAuthService.authRoles$} to observe the current role set\n * and checks that every role in the target list is present.\n *\n * @example\n * ```html\n * <!-- Show only if user has the 'admin' role -->\n * <div *dbxAuthHasRoles=\"'admin'\">Admin-only content</div>\n *\n * <!-- Show only if user has BOTH 'editor' and 'reviewer' roles -->\n * <div *dbxAuthHasRoles=\"['editor', 'reviewer']\">Editor and reviewer content</div>\n * ```\n *\n * @see {@link DbxAuthHasAnyRoleDirective} for matching **any** of the specified roles.\n * @see {@link DbxAuthNotAnyRoleDirective} for excluding users with specified roles.\n */\n@Directive({\n selector: '[dbxAuthHasRoles]',\n standalone: true\n})\nexport class DbxAuthHasRolesDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthHasRoles' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));\n}\n","import { type Maybe, type AuthRole, type ArrayOrValue } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { Directive, inject, input } from '@angular/core';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { authRolesSetContainsNoRolesFrom, DbxAuthService } from './service';\nimport { AbstractIfDirective } from '../view/if.directive';\n\n/**\n * Structural directive that conditionally renders its host element based on whether\n * the currently authenticated user possesses **none** of the specified auth roles.\n *\n * This is the inverse of {@link DbxAuthHasAnyRoleDirective}. Content is shown only when\n * the user does not have any of the listed roles. Useful for hiding content from\n * privileged users or showing fallback UI for unprivileged users.\n *\n * @example\n * ```html\n * <!-- Show only if user does NOT have the 'admin' role -->\n * <div *dbxAuthNotAnyRole=\"'admin'\">Non-admin content</div>\n *\n * <!-- Show only if user has NEITHER 'banned' nor 'suspended' role -->\n * <div *dbxAuthNotAnyRole=\"['banned', 'suspended']\">Active user content</div>\n * ```\n *\n * @see {@link DbxAuthHasRolesDirective} for requiring **all** specified roles.\n * @see {@link DbxAuthHasAnyRoleDirective} for requiring **any** of the specified roles.\n */\n@Directive({\n selector: '[dbxAuthNotAnyRole]',\n standalone: true\n})\nexport class DbxAuthNotAnyRoleDirective extends AbstractIfDirective {\n private readonly _authService = inject(DbxAuthService);\n\n readonly targetRoles = input<Maybe<ArrayOrValue<AuthRole>>>(undefined, { alias: 'dbxAuthNotAnyRole' });\n readonly targetRoles$ = toObservable(this.targetRoles);\n\n readonly show$: Observable<boolean> = this._authService.authRoles$.pipe(authRolesSetContainsNoRolesFrom(this.targetRoles$));\n}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { fromDbxAppAuth } from './state';\nimport { type DbxAppAuthFullState } from './state/state';\n\n/**\n * Angular service that provides access to the current auth user state from the NgRx store.\n *\n * This service acts as a convenience wrapper around the NgRx store, exposing a selector\n * for the {@link DbxAppAuthStateUser} slice of the auth feature state. It is provided\n * at the root level and can be injected anywhere authentication state is needed.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * private readonly authStateService = inject(DbxAppAuthStateService);\n *\n * readonly user$ = this.authStateService.authStateUser$;\n * }\n * ```\n *\n * @see {@link DbxAppAuthFullState}\n * @see {@link fromDbxAppAuth.selectDbxAppAuthUser}\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppAuthStateService {\n /**\n * NgRx store instance typed to the full auth state.\n */\n readonly store = inject(Store<DbxAppAuthFullState>);\n\n /**\n * Observable of the current {@link DbxAppAuthStateUser} from the NgRx store.\n */\n readonly authStateUser$ = this.store.select(fromDbxAppAuth.selectDbxAppAuthUser);\n}\n","import { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type DbxActionWorkProgress, type DbxActionWorkOrWorkProgress } from '../action/action';\n\n/**\n * Progress value for a button's working state, expressed as a percentage (0-100).\n */\nexport type DbxButtonWorkingProgress = DbxActionWorkProgress;\n\n/**\n * Working state for a button. When `true`, indicates indeterminate progress.\n * When a number, indicates determinate progress as a percentage (0-100).\n * When `false` or `undefined`, the button is not in a working state.\n */\nexport type DbxButtonWorking = DbxActionWorkOrWorkProgress;\n\n/**\n * Intercepts button click events to conditionally allow or prevent the click from propagating.\n *\n * Useful for adding confirmation dialogs, permission checks, or other pre-click validation.\n *\n * @example\n * ```typescript\n * const confirmInterceptor: DbxButtonInterceptor = {\n * interceptButtonClick: () => {\n * return from(window.confirm('Are you sure?')).pipe(map(Boolean));\n * },\n * };\n * ```\n */\nexport interface DbxButtonInterceptor {\n /**\n * Handles a button click event. Returns an observable that will say whether or not to continue the click event.\n */\n interceptButtonClick: () => Observable<boolean>;\n}\n\n/**\n * Display configuration for a button, including optional icon and text.\n *\n * @example\n * ```typescript\n * const display: DbxButtonDisplay = { icon: 'save', text: 'Save Changes' };\n * ```\n */\nexport interface DbxButtonDisplay {\n /**\n * button Icon, if applicable\n */\n readonly icon?: Maybe<string>;\n /**\n * button text, if applicable\n */\n readonly text?: Maybe<string>;\n}\n\n/**\n * Abstract base class defining the reactive interface for a button component.\n *\n * Provides observable streams for disabled state, working state, click events,\n * and display content. Implementations are provided via DI using {@link provideDbxButton}.\n *\n * @see {@link AbstractDbxButtonDirective} for the default implementation.\n * @see {@link DbxButtonDirective} for the concrete directive.\n */\nexport abstract class DbxButton {\n /**\n * Observable of the disabled state of the button.\n */\n abstract readonly disabled$: Observable<boolean>;\n /**\n * Observable of the working state of the button.\n */\n abstract readonly working$: Observable<DbxButtonWorking>;\n /**\n * Observable of the clicked event of the button.\n */\n abstract readonly clicked$: Observable<unknown>;\n /**\n * Observable of the display content of the button.\n */\n abstract readonly display$: Observable<DbxButtonDisplay>;\n /**\n * Sets the disabled state of the button. If null/undefined the button will be disabled.\n *\n * @param disabled\n */\n abstract setDisabled(disabled?: Maybe<boolean>): void;\n /**\n * Sets the working state of the button.\n *\n * If a number is passed, then it is treated as a progress percentage.\n *\n * If true is passed, then it is treated as an indeterminate progress.\n *\n * If null/undefined is passed, then the button will not be working.\n */\n abstract setWorking(working?: Maybe<DbxButtonWorking>): void;\n /**\n * Sets the display content of the button.\n *\n * @param content\n */\n abstract setDisplayContent(content: DbxButtonDisplay): void;\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n *\n * @param interceptor\n */\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n /**\n * Main function to use for handling clicks on the button.\n */\n abstract clickButton(): void;\n}\n\n/**\n * Creates Angular providers that register a {@link DbxButton} implementation for DI.\n *\n * @param sourceType - The concrete button directive or component class to provide.\n * @returns An array of Angular providers for the button.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myCustomButton]',\n * providers: provideDbxButton(MyCustomButtonDirective),\n * })\n * export class MyCustomButtonDirective extends AbstractDbxButtonDirective {}\n * ```\n */\nexport function provideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n// MARK: Display\n/**\n * The display type of a button.\n *\n * text_button: A text button has text or is empty.\n * icon_button: An icon button only has an icon and no text.\n */\nexport type DbxButtonDisplayType = 'text_button' | 'icon_button';\n\n/**\n * Delegate for computing a {@link DbxButtonDisplay} from a given value.\n *\n * Useful for dynamically updating button appearance based on data state.\n *\n * @typeParam T - The type of value used to derive the display configuration.\n */\nexport interface DbxButtonDisplayDelegate<T> {\n /**\n * Returns the DbxButtonDisplay for the input value.\n *\n * @param value\n */\n buttonDisplayContentForValue(value: T): DbxButtonDisplay;\n}\n\n/**\n * Determines whether a button display is an icon-only button or a text button.\n *\n * @param content - The button display configuration to evaluate.\n * @returns `'icon_button'` if only an icon is set, otherwise `'text_button'`.\n *\n * @example\n * ```typescript\n * dbxButtonDisplayType({ icon: 'edit' }); // 'icon_button'\n * dbxButtonDisplayType({ icon: 'save', text: 'Save' }); // 'text_button'\n * ```\n */\nexport function dbxButtonDisplayType(content: DbxButtonDisplay): DbxButtonDisplayType {\n return !content.text && content.icon ? 'icon_button' : 'text_button';\n}\n","import { Directive, inject } from '@angular/core';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Links a {@link DbxButton} click to an action context trigger, without synchronizing\n * disabled or working states. Use {@link DbxActionButtonDirective} for full state binding.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <button dbxButton dbxActionButtonTrigger>Trigger Only</button>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]',\n standalone: true\n})\nexport class DbxActionButtonTriggerDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly source = inject(DbxActionContextStoreSourceInstance);\n\n constructor() {\n cleanSubscription(\n this.dbxButton.clicked$.subscribe(() => {\n this._buttonClicked();\n })\n );\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n}\n","import { Directive } from '@angular/core';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { cleanSubscription } from '../../rxjs/subscription';\n\n/**\n * Links a {@link DbxButton} to an action context, synchronizing the button's\n * disabled and working states with the action's lifecycle and forwarding\n * button clicks as action triggers.\n *\n * Extends {@link DbxActionButtonTriggerDirective} by also binding working/disabled state.\n *\n * @example\n * ```html\n * <div dbxAction>\n * <button dbxButton dbxActionButton [text]=\"'Submit'\">Submit</button>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxActionButton]',\n standalone: true\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {\n constructor() {\n super();\n\n cleanSubscription(\n this.source.isWorkingOrWorkProgress$.subscribe((working) => {\n this.dbxButton.setWorking(working);\n })\n );\n\n cleanSubscription(\n this.source.isDisabled$.subscribe((disabled) => {\n this.dbxButton.setDisabled(disabled);\n })\n );\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { cleanSubscription } from '../../rxjs';\nimport { DbxButton } from '../button';\nimport { DbxRouterService } from '../../router/router/service/router.service';\nimport { type SegueRef } from '../../router/segue';\n\n// MARK: Button Directives\n/**\n * Navigates to a route when the host {@link DbxButton} is clicked, using the provided {@link SegueRef}.\n *\n * @example\n * ```html\n * <button dbxButton [dbxButtonSegue]=\"{ ref: '/dashboard' }\">Go to Dashboard</button>\n * ```\n *\n * @example\n * ```typescript\n * readonly segue: SegueRef = { ref: '/settings', refType: 'url' };\n * ```\n *\n * ```html\n * <button dbxButton [dbxButtonSegue]=\"segue\">Settings</button>\n * ```\n */\n@Directive({\n selector: '[dbxButtonSegue]',\n standalone: true\n})\nexport class DbxButtonSegueDirective {\n readonly dbxButton = inject(DbxButton);\n readonly dbxRouterService = inject(DbxRouterService);\n\n readonly segueRef = input<Maybe<SegueRef>>(undefined, { alias: 'dbxButtonSegue' });\n\n constructor() {\n cleanSubscription(() =>\n this.dbxButton.clicked$.subscribe(() => {\n const segueRef = this.segueRef();\n\n if (segueRef) {\n void this.dbxRouterService.go(segueRef);\n }\n })\n );\n }\n}\n","import { Directive, type Signal, computed, input, output, signal } from '@angular/core';\nimport { isDefinedAndNotFalse, type Maybe } from '@dereekb/util';\nimport { of, Subject, filter, first, switchMap, BehaviorSubject } from 'rxjs';\nimport { cleanSubscription, completeOnDestroy } from '../rxjs';\nimport { type DbxButton, type DbxButtonDisplay, type DbxButtonDisplayType, dbxButtonDisplayType, type DbxButtonInterceptor, type DbxButtonWorking, provideDbxButton } from './button';\nimport { outputToObservable, toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract base directive implementing the {@link DbxButton} interface with signal-based state management.\n *\n * Manages disabled state, working/progress state, display content (icon/text),\n * and button click interception. Subclass this to create custom button directives.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myButton]',\n * providers: provideDbxButton(MyButtonDirective),\n * })\n * export class MyButtonDirective extends AbstractDbxButtonDirective {}\n * ```\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective implements DbxButton {\n /**\n * Pre-interceptor button click.\n */\n protected readonly _buttonClick = completeOnDestroy(new Subject<void>());\n protected readonly _buttonInterceptor = completeOnDestroy(new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined));\n\n readonly buttonClick = output();\n\n readonly disabled = input<boolean, Maybe<boolean>>(false, { transform: Boolean });\n readonly working = input<DbxButtonWorking, Maybe<DbxButtonWorking>>(false, { transform: (x) => (x == null ? false : x) });\n readonly buttonDisplay = input<Maybe<DbxButtonDisplay>>(undefined);\n\n private readonly _disabledSignal = signal<Maybe<boolean>>(undefined);\n private readonly _workingSignal = signal<Maybe<DbxButtonWorking>>(undefined);\n private readonly _buttonDisplayContentSignal = signal<Maybe<DbxButtonDisplay>>(undefined);\n\n readonly disabledSignal = computed(() => this._disabledSignal() ?? this.disabled());\n readonly workingSignal = computed(() => this._workingSignal() ?? this.working());\n\n readonly isWorkingSignal = computed(() => {\n const working = this.workingSignal();\n return isDefinedAndNotFalse(working);\n });\n\n readonly icon = input<Maybe<string>>();\n readonly text = input<Maybe<string>>();\n\n readonly buttonDisplayContentSignal: Signal<DbxButtonDisplay> = computed(() => {\n const icon = this.icon();\n const text = this.text();\n const buttonDisplay = this.buttonDisplay();\n\n const buttonDisplayContent = this._buttonDisplayContentSignal() ?? buttonDisplay;\n return { icon: icon || buttonDisplayContent?.icon, text: text || buttonDisplayContent?.text };\n });\n\n readonly buttonDisplayTypeSignal: Signal<DbxButtonDisplayType> = computed(() => {\n return dbxButtonDisplayType(this.buttonDisplayContentSignal());\n });\n\n readonly iconSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.icon);\n readonly textSignal: Signal<Maybe<string>> = computed(() => this.buttonDisplayContentSignal()?.text);\n\n readonly disabled$ = toObservable(this.disabledSignal);\n readonly working$ = toObservable(this.workingSignal);\n readonly display$ = toObservable(this.buttonDisplayContentSignal);\n readonly clicked$ = outputToObservable(this.buttonClick);\n\n constructor() {\n cleanSubscription(\n this._buttonClick\n .pipe(\n switchMap(() =>\n this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(first());\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n )\n )\n )\n .subscribe(() => {\n this._forceButtonClicked();\n })\n );\n }\n\n setDisabled(disabled?: Maybe<boolean>): void {\n this._disabledSignal.set(disabled);\n }\n\n setWorking(working?: Maybe<DbxButtonWorking>): void {\n this._workingSignal.set(working);\n }\n\n setDisplayContent(content: DbxButtonDisplay): void {\n this._buttonDisplayContentSignal.set(content);\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\n *\n * @param interceptor - The interceptor to set on the button.\n */\n public setButtonInterceptor(interceptor: DbxButtonInterceptor): void {\n this._buttonInterceptor.next(interceptor);\n }\n\n /**\n * Main function to use for handling clicks on the button.\n */\n public clickButton(): void {\n if (!this.disabled()) {\n this._buttonClick.next();\n }\n }\n\n /**\n * Forces a button click. Skips the interceptors if any are configured.\n */\n protected _forceButtonClicked(): void {\n this.buttonClick.emit();\n }\n}\n\n// MARK: Implementation\n/**\n * Concrete button directive that provides a {@link DbxButton} instance via DI.\n *\n * Apply to any element to make it a managed button with reactive disabled,\n * working, and display state.\n *\n * @example\n * ```html\n * <button dbxButton [icon]=\"'save'\" [text]=\"'Save'\" [disabled]=\"isSaving\">\n * Save\n * </button>\n * ```\n *\n * @example\n * ```html\n * <!-- Access the button instance via template reference: -->\n * <button dbxButton #btn=\"dbxButton\" (click)=\"btn.clickButton()\">Submit</button>\n * ```\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: provideDbxButton(DbxButtonDirective),\n standalone: true\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective {}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { type LoadingContext, type MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { DbxButton } from './button';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { distinctUntilChanged, shareReplay, type Subscription } from 'rxjs';\nimport { cleanSubscription } from '../rxjs/subscription';\n\n/**\n * Links a {@link DbxButton} to a {@link LoadingContext}, automatically setting the button\n * to a working state whenever the loading context is actively loading.\n *\n * @example\n * ```html\n * <button dbxButton [dbxLoadingButton]=\"loadingContext\">\n * Loading...\n * </button>\n * ```\n *\n * @example\n * ```typescript\n * readonly loadingContext = cleanLoadingContext<MyData>(this.data$);\n * ```\n */\n@Directive({\n selector: '[dbxLoadingButton]',\n standalone: true\n})\nexport class DbxLoadingButtonDirective {\n readonly dbxButton = inject(DbxButton, { host: true });\n readonly context = input.required<MaybeObservableOrValue<LoadingContext>>({ alias: 'dbxLoadingButton' });\n readonly context$ = toObservable(this.context).pipe(maybeValueFromObservableOrValue(), distinctUntilChanged(), shareReplay(1));\n readonly contextSignal = toSignal(this.context$);\n\n protected readonly _loadingEffectSub = cleanSubscription();\n protected readonly _loadingEffect = effect(() => {\n const context = this.contextSignal();\n let subscription: Subscription | undefined;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => this.dbxButton.setWorking(x.loading));\n }\n\n this._loadingEffectSub.setSub(subscription);\n });\n}\n","import { NgModule } from '@angular/core';\nimport { DbxActionButtonTriggerDirective, DbxActionButtonDirective } from './action';\nimport { DbxButtonDirective } from './button.directive';\nimport { DbxLoadingButtonDirective } from './button.loading.directive';\nimport { DbxButtonSegueDirective } from './router/button.segue.directive';\n\nconst importsAndExports = [DbxButtonDirective, DbxLoadingButtonDirective, DbxActionButtonTriggerDirective, DbxActionButtonDirective, DbxButtonSegueDirective];\n\n/**\n * Exports the following directives:\n * - DbxButtonDirective\n * - DbxLoadingButtonDirective\n * - DbxActionButtonTriggerDirective\n * - DbxActionButtonDirective\n * - DbxButtonSegueDirective\n */\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreButtonModule {}\n","import { Injectable, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { type DbxAppContextState } from './context';\nimport { onDbxAppContext, fromDbxAppContext } from './state';\nimport { type DbxAppContextFullState } from './state/state';\n\n/**\n * Service for dispatching and selecting the application's {@link DbxAppContextState} from the NgRx store.\n *\n * Provided at the root level. Use to transition between app-level context states\n * (e.g., public, auth, onboard, app).\n *\n * @example\n * ```typescript\n * @Component({ ... })\n * export class AppComponent {\n * private readonly contextService = inject(DbxAppContextService);\n *\n * onLogin(): void {\n * this.contextService.setState('app');\n * }\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxAppContextService {\n readonly store = inject(Store<DbxAppContextFullState>);\n readonly state$ = this.store.select(fromDbxAppContext.selectDbxAppContextState);\n\n setState(state: DbxAppContextState) {\n this.store.dispatch(onDbxAppContext.DbxAppContextActions.setState({ state }));\n }\n\n resetState() {\n this.store.next(onDbxAppContext.DbxAppContextActions.resetState());\n }\n}\n","import { Directive, effect, inject, input } from '@angular/core';\nimport { DbxAppContextService } from './context.service';\nimport { type DbxAppContextState } from './context';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Sets the application's {@link DbxAppContextState} when the input value changes.\n *\n * Dispatches to the NgRx store via {@link DbxAppContextService}. Commonly placed\n * on route-level components to declare which context the route belongs to.\n *\n * @example\n * ```html\n * <div [dbxAppContextState]=\"'app'\">\n * <!-- App-level content rendered when context is 'app' -->\n * </div>\n * ```\n *\n * @example\n * ```html\n * <router-outlet dbxAppContextState=\"public\"></router-outlet>\n * ```\n */\n@Directive({\n selector: '[dbxAppContextState]',\n standalone: true\n})\nexport class DbxAppContextStateDirective {\n readonly dbxAppContextStateService = inject(DbxAppContextService);\n\n readonly state = input<Maybe<DbxAppContextState>>(undefined, { alias: 'dbxAppContextState' });\n\n protected readonly _stateEffect = effect(() => {\n const state = this.state();\n\n if (state != null) {\n this.dbxAppContextStateService.setState(state);\n }\n });\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideState } from '@ngrx/store';\nimport { fromDbxAppContext } from './state';\n\n/**\n * Creates EnvironmentProviders for providing the DbxAppContext state.\n *\n * @returns EnvironmentProviders\n */\nexport function provideDbxAppContextState(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(fromDbxAppContext.FEATURE_KEY, fromDbxAppContext.reducers)]);\n}\n","/**\n * Abstract token class representing the application's runtime environment configuration.\n *\n * Provided via DI using {@link provideDbxAppEnviroment} and accessed through {@link DbxAppEnviromentService}.\n * Subclass or provide a concrete instance to define environment-specific flags.\n *\n * @example\n * ```typescript\n * const env: DbxAppEnviroment = {\n * production: false,\n * testing: true,\n * };\n *\n * // In app config:\n * provideDbxAppEnviroment(env);\n * ```\n */\nexport abstract class DbxAppEnviroment {\n /**\n * Whether or not this is a production environment.\n */\n abstract production: boolean;\n /**\n * Whether or not this is a testing environment.\n *\n * Generally \"production\" is false when this is true.\n */\n abstract testing?: boolean;\n /**\n * Whether or not this is a staging environment.\n *\n * Generally \"production\" is true when this is true.\n */\n abstract staging?: boolean;\n}\n","import { Injectable, inject } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\n\n/**\n * Injectable service providing convenience accessors for the application's {@link DbxAppEnviroment}.\n *\n * Exposes computed properties for common environment checks (production, staging, testing)\n * and a typed getter for accessing custom environment properties.\n *\n * @example\n * ```typescript\n * @Component({ ... })\n * export class MyComponent {\n * private readonly envService = inject(DbxAppEnviromentService);\n *\n * get showDebugPanel(): boolean {\n * return !this.envService.isProduction;\n * }\n * }\n * ```\n */\n@Injectable()\nexport class DbxAppEnviromentService {\n readonly environment = inject(DbxAppEnviroment);\n\n get isProduction() {\n return this.environment.production === true;\n }\n\n get isStaging() {\n return this.environment.staging ?? false;\n }\n\n get isTesting() {\n return this.environment.testing ?? !this.environment.production;\n }\n\n /**\n * Returns the environment, typed as a specific type.\n *\n * @returns The environment cast to the specified type.\n */\n getEnvironment<T extends DbxAppEnviroment>(): T {\n return this.environment as T;\n }\n}\n","import { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxAppEnviroment } from './environment';\nimport { DbxAppEnviromentService } from './environment.service';\n\n/**\n * Registers {@link DbxAppEnviroment} and {@link DbxAppEnviromentService} as environment-level providers.\n *\n * @param environment - The concrete environment configuration to provide.\n * @returns The environment providers for the application environment.\n *\n * @example\n * ```typescript\n * // In app.config.ts:\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideDbxAppEnviroment({ production: true, staging: false }),\n * ],\n * };\n * ```\n */\nexport function provideDbxAppEnviroment(environment: DbxAppEnviroment): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: DbxAppEnviroment,\n useValue: environment\n },\n DbxAppEnviromentService\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MousableFunction } from './mousable';\nimport { type ClickableFunction, type ClickableUrl } from './clickable';\nimport { type SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, type ExpandTreeFunction, type FlattenTreeFunction, flattenTreeToArrayFunction, type Maybe, type TreeNode } from '@dereekb/util';\nimport { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Observable } from 'rxjs';\nimport { type DbxInjectionComponentConfig } from '../../injection/injection';\n\n/**\n * Represents a clickable anchor element that combines click handling, mouse event handling, URL linking, and segue-based routing.\n *\n * This is the foundational anchor interface used across the application for navigation elements such as links, buttons, and menu items.\n *\n * @example\n * ```ts\n * const anchor: ClickableAnchor = {\n * ref: 'app.dashboard',\n * onClick: () => console.log('clicked'),\n * disabled: false,\n * selected: true\n * };\n * ```\n *\n * @see {@link ClickableFunction} for click handling\n * @see {@link MousableFunction} for mouse event handling\n * @see {@link ClickableUrl} for external URL configuration\n * @see {@link SegueRef} for router navigation references\n */\nexport interface ClickableAnchor extends ClickableFunction, MousableFunction, ClickableUrl, Partial<SegueRef> {\n /**\n * Whether this anchor is disabled and should not be interactive.\n */\n readonly disabled?: boolean;\n /**\n * Whether this anchor is currently in a selected/active state.\n */\n readonly selected?: boolean;\n}\n\n/**\n * Title and an optional icon.\n */\nexport interface IconAndTitle {\n readonly title: string;\n readonly icon?: Maybe<string>;\n}\n\n/**\n * A clickable anchor with a title, optional icon, hint text, and custom injection content.\n *\n * Used to represent navigation links in menus, sidebars, and other navigable UI components.\n *\n * @example\n * ```ts\n * const link: ClickableAnchorLink = {\n * title: 'Dashboard',\n * icon: 'dashboard',\n * hint: 'View your main dashboard',\n * ref: 'app.dashboard'\n * };\n * ```\n *\n * @see {@link ClickableAnchor} for the base anchor interface\n * @see {@link IconAndTitle} for the title and icon properties\n */\nexport interface ClickableAnchorLink extends ClickableAnchor, IconAndTitle {\n /**\n * Optional detail string/content.\n */\n readonly hint?: string;\n /**\n * Custom injection content for this link.\n */\n readonly content?: DbxInjectionComponentConfig;\n}\n\n/**\n * ClickableAnchorLink that definitely has a SegueRef\n */\n/**\n * A {@link ClickableAnchorLink} that is guaranteed to have a {@link SegueRef}, ensuring it represents a navigable router link.\n *\n * @see {@link ClickableAnchorLink}\n * @see {@link SegueRef}\n */\nexport type ClickableAnchorLinkSegueRef = ClickableAnchorLink & SegueRef;\n\n/**\n * A clickable anchor link where the icon is required but the title is omitted.\n *\n * Useful for icon-only navigation elements such as toolbar buttons.\n *\n * @see {@link ClickableAnchorLink}\n */\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n /**\n * The icon identifier (e.g., Material icon name).\n */\n readonly icon: string;\n}\n\n/**\n * A hierarchical tree structure of {@link ClickableAnchorLink} nodes, where each node can have child links.\n *\n * Used to represent nested navigation structures such as sidebar menus with sub-items.\n *\n * @example\n * ```ts\n * const tree: ClickableAnchorLinkTree = {\n * title: 'Settings',\n * icon: 'settings',\n * ref: 'app.settings',\n * children: [\n * { title: 'Profile', ref: 'app.settings.profile' },\n * { title: 'Security', ref: 'app.settings.security' }\n * ]\n * };\n * ```\n *\n * @see {@link ClickableAnchorLink}\n * @see {@link expandClickableAnchorLinkTree} for flattening trees\n */\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n /**\n * Optional child links forming a nested navigation tree.\n */\n readonly children?: ClickableAnchorLinkTree[];\n}\n\n/**\n * A tree node wrapping a {@link ClickableAnchorLinkTree} value, produced by expanding the tree structure.\n *\n * @see {@link expandClickableAnchorLinkTreeNode}\n * @see {@link TreeNode}\n */\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\n/**\n * Function that expands a single {@link ClickableAnchorLinkTree} node into a tree of {@link ExpandedClickableAnchorLinkTree} nodes.\n *\n * @see {@link expandClickableAnchorLinkTree} for the full expand-and-flatten operation\n */\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\n/**\n * Flattens an expanded tree of {@link ExpandedClickableAnchorLinkTree} nodes into a flat array, preserving the tree node wrappers.\n */\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\n\n/**\n * Flattens an expanded tree of {@link ExpandedClickableAnchorLinkTree} nodes into a flat array of the underlying {@link ClickableAnchorLinkTree} values.\n */\nexport const flattenExpandedClickableAnchorLinkTreeToLinks: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ClickableAnchorLinkTree> = flattenTreeToArrayFunction((x) => x.value);\n\n/**\n * Fully expands the given parent link and flattens the tree to a single parent link.\n *\n * @param link\n * @returns\n */\nexport function expandClickableAnchorLinkTree(link: ClickableAnchorLinkTree): ExpandedClickableAnchorLinkTree[] {\n return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));\n}\n\n/**\n * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.\n */\nexport const expandClickableAnchorLinkTrees = expandFlattenTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree>(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);\n\n/**\n * Describes the Anchor type given a ClickableAnchor.\n *\n * - plain: When the anchor has no specific content but is not disabled. It is a passthrough for the content.\n * - clickable: When the anchor has a click handler\n * - sref: When the anchor has a SegueRef\n * - href: When the anchor has a URL\n * - disabled: When the anchor is disabled.\n */\nexport type ClickableAnchorType = 'plain' | 'clickable' | 'sref' | 'href' | 'disabled';\n\n/**\n * Determines the {@link ClickableAnchorType} for a given anchor based on its properties.\n *\n * Priority order: disabled > sref (router link) > clickable (onClick handler) > href (external URL) > plain.\n *\n * @param anchor - The anchor to evaluate.\n * @param disabled - An optional external disabled override; if `true`, the anchor type will be `'disabled'` regardless of the anchor's own state.\n * @returns The determined {@link ClickableAnchorType}.\n */\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): ClickableAnchorType {\n let type: ClickableAnchorType = 'disabled';\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = 'disabled';\n } else if (anchor.ref) {\n type = 'sref';\n } else if (anchor.onClick) {\n type = 'clickable';\n } else if (anchor.url) {\n type = 'href';\n } else {\n type = 'plain';\n }\n }\n\n return type;\n}\n\n/**\n * Abstract base class representing a reactive anchor element that exposes its state as observables.\n *\n * Subclasses provide concrete implementations that manage the anchor's disabled, selected, and type states.\n *\n * @typeParam T - The specific anchor type, defaulting to {@link ClickableAnchor}.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * class MyAnchorComponent extends DbxAnchor {\n * readonly disabled$ = of(false);\n * readonly selected$ = of(true);\n * readonly anchor$ = of({ ref: 'app.home' });\n * readonly type$ = of('sref' as ClickableAnchorType);\n * }\n * ```\n *\n * @see {@link provideDbxAnchor} for configuring DI providers\n * @see {@link AbstractDbxAnchorDirective} for the directive-based implementation\n */\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract readonly disabled$: Observable<Maybe<boolean>>;\n abstract readonly selected$: Observable<Maybe<boolean>>;\n abstract readonly anchor$: Observable<Maybe<T>>;\n abstract readonly type$: Observable<ClickableAnchorType>;\n}\n\n/**\n * Creates Angular DI providers that register the given source type as a {@link DbxAnchor} provider using `forwardRef`.\n *\n * @typeParam S - The concrete {@link DbxAnchor} subclass to provide.\n * @param sourceType - The class type to register as the anchor provider.\n * @returns An array of Angular providers.\n *\n * @example\n * ```ts\n * @Directive({\n * selector: '[myAnchor]',\n * providers: provideDbxAnchor(MyAnchorDirective)\n * })\n * class MyAnchorDirective extends DbxAnchor { ... }\n * ```\n */\nexport function provideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { type Observable } from 'rxjs';\nimport { computed, Directive, model } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type ClickableAnchorType, type ClickableAnchor, anchorTypeForAnchor, type DbxAnchor } from './anchor';\nimport { type SegueRefOrSegueRefRouterLink, asSegueRef } from '../segue';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * Abstract base directive for managing anchor state using Angular signals and model inputs.\n *\n * Provides reactive computed properties for the resolved anchor, its disabled/selected state, and its type.\n * Subclasses can extend this to implement framework-specific anchor rendering (e.g., UIRouter or Angular Router).\n *\n * @typeParam T - The specific anchor type, defaulting to {@link ClickableAnchor}.\n *\n * @example\n * ```html\n * <!-- Usage in a template via a concrete subclass -->\n * <my-anchor [ref]=\"'/app/dashboard'\" [disabled]=\"isDisabled\">\n * Dashboard\n * </my-anchor>\n * ```\n *\n * @example\n * ```ts\n * // Programmatic usage\n * directive.setRef('app.dashboard');\n * directive.setDisabled(true);\n * ```\n *\n * @see {@link DbxAnchor} for the abstract base class this implements\n * @see {@link anchorTypeForAnchor} for anchor type resolution logic\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor {\n /**\n * Model input for the segue ref or router link to navigate to.\n */\n readonly ref = model<Maybe<SegueRefOrSegueRefRouterLink>>();\n\n /**\n * Model input for the full anchor configuration object.\n */\n readonly anchor = model<Maybe<T>>();\n /**\n * Model input for externally controlling the disabled state.\n */\n readonly disabled = model<Maybe<boolean>>();\n /**\n * Model input for externally controlling the selected state.\n */\n readonly selected = model<Maybe<boolean>>();\n\n /**\n * Computed anchor that merges the `ref` input with the `anchor` input, preferring `ref` when set.\n */\n readonly anchorSignal = computed(() => {\n const ref = this.ref();\n const anchor = this.anchor();\n\n let result: Maybe<T> = anchor;\n\n if (ref != null) {\n result = asSegueRef(ref) as T;\n }\n\n return result;\n });\n\n /**\n * Computed selected state that combines the `selected` input with the anchor's own `selected` property.\n */\n readonly selectedSignal = computed(() => {\n const selected = this.selected();\n const anchor = this.anchorSignal();\n\n return selected || anchor?.selected;\n });\n\n /**\n * Computed {@link ClickableAnchorType} derived from the current anchor and disabled state.\n */\n readonly typeSignal = computed(() => {\n const anchor = this.anchorSignal();\n const disabled = this.disabled();\n return anchorTypeForAnchor(anchor, disabled);\n });\n\n /**\n * Computed disabled state that combines the `disabled` input with the anchor's own `disabled` property.\n */\n readonly disabledSignal = computed(() => {\n const disabled = this.disabled();\n const anchor = this.anchorSignal();\n\n return disabled || anchor?.disabled;\n });\n\n /**\n * Computed URL extracted from the current anchor's `url` property.\n */\n readonly urlSignal = computed(() => this.anchorSignal()?.url);\n /**\n * Computed target (e.g., `_blank`) extracted from the current anchor's `target` property.\n */\n readonly targetSignal = computed(() => this.anchorSignal()?.target);\n\n readonly anchor$: Observable<Maybe<T>> = toObservable(this.anchorSignal);\n readonly disabled$: Observable<Maybe<boolean>> = toObservable(this.disabledSignal);\n readonly selected$: Observable<Maybe<boolean>> = toObservable(this.selectedSignal);\n readonly type$: Observable<ClickableAnchorType> = toObservable(this.typeSignal);\n\n // MARK: Accessors\n /**\n * Sets the segue ref or router link for this anchor.\n *\n * @param ref - The segue ref or router link to set.\n */\n setRef(ref: Maybe<SegueRefOrSegueRefRouterLink>) {\n this.ref.set(ref);\n }\n\n /**\n * Sets the full anchor configuration object.\n *\n * @param anchor - The anchor configuration to set.\n */\n setAnchor(anchor: Maybe<T>) {\n this.anchor.set(anchor);\n }\n\n /**\n * Sets the external disabled state override.\n *\n * @param disabled - Whether the anchor should be disabled.\n */\n setDisabled(disabled: Maybe<boolean>) {\n this.disabled.set(disabled);\n }\n\n /**\n * Sets the external selected state override.\n *\n * @param selected - Whether the anchor should be selected.\n */\n setSelected(selected: Maybe<boolean>) {\n this.selected.set(selected);\n }\n}\n","import { type E164PhoneNumberWithOptionalExtension, type MailToUrlInput, mailToUrlString, type Maybe, type PhoneNumber, telUrlString, type WebsiteUrl } from '@dereekb/util';\n\n/**\n * Interface for elements that support a click handler callback.\n *\n * @example\n * ```ts\n * const clickable: ClickableFunction = {\n * onClick: (event) => console.log('Element clicked', event)\n * };\n * ```\n */\nexport interface ClickableFunction {\n /**\n * Optional click handler invoked when the element is clicked.\n */\n readonly onClick?: (event?: Maybe<MouseEvent>) => void;\n}\n\n/**\n * Represents a clickable href/url configuration.\n */\nexport interface ClickableUrl {\n /**\n * href url\n */\n readonly url?: string;\n /**\n * href target attribute.\n */\n readonly target?: string;\n}\n\n/**\n * Creates a {@link ClickableUrl} configured to open the given URL in a new browser tab (`target=\"_blank\"`).\n *\n * @param url - The URL to open.\n * @returns A {@link ClickableUrl} with the `target` set to `'_blank'`.\n */\nexport function clickableUrlInNewTab(url: string | WebsiteUrl): ClickableUrl {\n return {\n url,\n target: '_blank'\n };\n}\n\n/**\n * Creates a {@link ClickableUrl} with a `mailto:` URL from the given email configuration.\n *\n * @param mailTo - The mail-to configuration (email address, subject, body, etc.).\n * @returns A {@link ClickableUrl} with the URL set to a `mailto:` link.\n *\n * @see {@link mailToUrlString}\n */\nexport function clickableUrlMailTo(mailTo: MailToUrlInput): ClickableUrl {\n return {\n url: mailToUrlString(mailTo)\n };\n}\n\n/**\n * Creates a {@link ClickableUrl} with a `tel:` URL from the given phone number.\n *\n * @param tel - The phone number to create a tel link for.\n * @returns A {@link ClickableUrl} with the URL set to a `tel:` link.\n *\n * @see {@link telUrlString}\n */\nexport function clickableUrlTel(tel: PhoneNumber | E164PhoneNumberWithOptionalExtension): ClickableUrl {\n return {\n url: telUrlString(tel)\n };\n}\n","import { DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type TransitionHookFn, type Transition, type HookResult, type StateService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { map, first, switchMap, firstValueFrom, type Observable, of } from 'rxjs';\nimport { type Injector } from '@angular/core';\n\n/**\n * Default param value that indicates no specific identifier has been set, triggering a redirect to the default allowed identifier.\n */\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE = '0';\n\n/**\n * Default route parameter key used to read the model identifier from the URL.\n */\nexport const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY = 'id';\n\n/**\n * Configuration for the {@link redirectForIdentifierParamHook} function.\n *\n * Specifies how to read, validate, and redirect based on an identifier route parameter.\n * This is used with UIRouter's transition hooks to guard routes that require a valid model identifier.\n *\n * @example\n * ```ts\n * redirectForIdentifierParamHook({\n * criteria: 'app.profile',\n * transitionService,\n * idParam: 'id',\n * defaultAllowedValue: (authService) => authService.userIdentifier$,\n * canViewModelWithId: (targetId, authService) => of(true)\n * });\n * ```\n *\n * @see {@link redirectForIdentifierParamHook}\n * @see {@link RedirectForUserIdentifierParamHookInput} for a user-specific variant\n */\nexport interface RedirectForIdentifierParamHookInput {\n /**\n * Factory that returns an observable that sends the default allowed identifier to use when accessing the resource.\n */\n readonly defaultAllowedValue: (authService: DbxAuthService, injector: Injector, transition: Transition) => Observable<ModelKey>;\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly idParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target id.\n *\n * Can return another identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewModelWithId: (targetId: ModelKey, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | ModelKey>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * Registers a UIRouter transition hook that asserts the user is allowed to view a route with an identifier as a state parameter.\n *\n * When a transition occurs to the target route:\n * 1. If the identifier param is missing or equals the default placeholder value, it redirects to the default allowed identifier.\n * 2. If the identifier differs from the default, it calls `canViewModelWithId` to verify access.\n * 3. If access is denied, it redirects to the default allowed identifier.\n *\n * @param input - Configuration specifying the route criteria, param key, and access control logic.\n *\n * @see {@link RedirectForIdentifierParamHookInput}\n * @see {@link redirectForUserIdentifierParamHook} for a user-specific convenience wrapper\n */\nexport function redirectForIdentifierParamHook(input: RedirectForIdentifierParamHookInput): void {\n const { defaultAllowedValue, idParam = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE, priority = 100, transitionService, canViewModelWithId: canViewUser } = input;\n const criteria: HookMatchCriteria = typeof input.criteria === 'string' ? { entering: input.criteria } : input.criteria;\n\n // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult\n const assertAllowedId: TransitionHookFn = (transition: Transition): HookResult => {\n const $state: StateService = transition.router.stateService;\n const injector = transition.injector();\n const authService: DbxAuthService = injector.get(DbxAuthService);\n const params = transition.params();\n\n const transitionTargetId: Maybe<string> = params[idParam];\n const defaultAllowedValueObs$ = defaultAllowedValue(authService, injector, transition);\n\n return firstValueFrom(\n defaultAllowedValueObs$.pipe(\n first(),\n switchMap((defaultAllowedIdValue) => {\n let result: Observable<HookResult> = of(true);\n\n let redirectToId: Maybe<Observable<Maybe<ModelKey>>>;\n\n if (!transitionTargetId || transitionTargetId === defaultParamValue) {\n // If the param isn't set, default to the default value\n redirectToId = of(defaultAllowedIdValue);\n } else if (defaultAllowedIdValue !== transitionTargetId) {\n redirectToId = canViewUser(transitionTargetId, authService, injector).pipe(\n map((x) => {\n if (x == null || typeof x === 'boolean') {\n return x ? transitionTargetId : defaultAllowedIdValue;\n } else {\n return x;\n }\n })\n );\n }\n\n if (redirectToId != null) {\n result = redirectToId.pipe(\n first(),\n map((targetId) => {\n if (targetId !== transitionTargetId) {\n const target = transition.targetState();\n const state = target.state();\n return $state.target(state, { ...params, [idParam]: targetId }, { location: true });\n } else {\n return true;\n }\n })\n );\n }\n\n return result;\n })\n )\n ) as HookResult;\n };\n\n // Register the \"requires auth\" hook with the TransitionsService\n transitionService.onBefore(criteria, assertAllowedId, { priority });\n}\n","import { type AuthUserIdentifier } from '../../../auth/auth.user';\nimport { type DbxAuthService } from '../../../auth/service/auth.service';\nimport { type TransitionService, type HookMatchCriteria } from '@uirouter/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\nimport { type Injector } from '@angular/core';\nimport { redirectForIdentifierParamHook } from './id.hook';\n\n/**\n * Default param value that indicates no specific user identifier has been set, triggering a redirect to the authenticated user's identifier.\n */\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE = '0';\n\n/**\n * Default route parameter key used to read the user identifier from the URL.\n */\nexport const DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY = 'uid';\n\n/**\n * Configuration for the {@link redirectForUserIdentifierParamHook} function.\n *\n * A specialized variant of {@link RedirectForIdentifierParamHookInput} that defaults to reading the authenticated\n * user's identifier from {@link DbxAuthService} and uses the `uid` route parameter.\n *\n * @example\n * ```ts\n * redirectForUserIdentifierParamHook({\n * criteria: 'app.user.profile',\n * transitionService,\n * canViewUser: (targetUid, authService) => of(true)\n * });\n * ```\n *\n * @see {@link redirectForUserIdentifierParamHook}\n * @see {@link redirectForIdentifierParamHook} for the underlying generic implementation\n */\nexport interface RedirectForUserIdentifierParamHookInput {\n /**\n * Route parameter to use.\n *\n * Defaults to \"uid\"\n */\n readonly uidParam?: string;\n /**\n * The default param value to check against.\n *\n * Defaults to 0.\n */\n readonly defaultParamValue?: string;\n /**\n * Criteria or route to watch and intercept.\n */\n readonly criteria: HookMatchCriteria | string;\n readonly transitionService: TransitionService;\n /**\n * Whether or not the current user can view the target user.\n *\n * Can return another users identifier, or true to allow access, or false/null/undefined to deny access.\n */\n readonly canViewUser: (targetUid: AuthUserIdentifier, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | AuthUserIdentifier>>;\n /**\n * Hook priority\n */\n readonly priority?: number;\n}\n\n/**\n * Registers a UIRouter transition hook that asserts the current user is allowed to view a route parameterized by a user identifier.\n *\n * This is a convenience wrapper around {@link redirectForIdentifierParamHook} that automatically uses the\n * authenticated user's identifier from {@link DbxAuthService} as the default value when the `uid` param is\n * missing or matches the placeholder value.\n *\n * @param input - Configuration specifying the route criteria, access control logic, and optional parameter overrides.\n * @returns The result of registering the transition hook.\n *\n * @see {@link RedirectForUserIdentifierParamHookInput}\n * @see {@link redirectForIdentifierParamHook}\n */\nexport function redirectForUserIdentifierParamHook(input: RedirectForUserIdentifierParamHookInput): void {\n const { uidParam = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_KEY, defaultParamValue = DEFAULT_REDIRECT_FOR_USER_IDENTIFIER_PARAM_VALUE, criteria, priority = 100, transitionService, canViewUser } = input;\n\n return redirectForIdentifierParamHook({\n defaultAllowedValue: (authService: DbxAuthService) => authService.userIdentifier$,\n idParam: uidParam,\n defaultParamValue,\n criteria,\n transitionService,\n canViewModelWithId: canViewUser,\n priority\n });\n}\n","/**\n * Enum describing the type of a router transition event.\n *\n * Used by {@link DbxRouterTransitionEvent} to categorize transition lifecycle events.\n *\n * @see {@link DbxRouterTransitionEvent}\n * @see {@link DbxRouterTransitionService}\n */\nexport enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'success'\n}\n\n/**\n * Represents a router transition event emitted during navigation lifecycle.\n *\n * @example\n * ```ts\n * transitionService.transitions$.subscribe(event => {\n * if (event.type === DbxRouterTransitionEventType.SUCCESS) {\n * console.log('Navigation completed successfully');\n * }\n * });\n * ```\n *\n * @see {@link DbxRouterTransitionEventType}\n * @see {@link DbxRouterTransitionService}\n */\nexport interface DbxRouterTransitionEvent {\n /**\n * The type of transition event (start or success).\n */\n type: DbxRouterTransitionEventType;\n}\n","import { map, type Observable, combineLatest, firstValueFrom } from 'rxjs';\nimport { asObservable, filterMaybe, type ObservableOrValue } from '@dereekb/rxjs';\nimport { type DbxRouterService } from '../../service/router.service';\nimport { type DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, type SegueRef, type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../../segue';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { ActivatedRoute, type NavigationBehaviorOptions, NavigationEnd, type NavigationExtras, NavigationStart, Router, type UrlTree } from '@angular/router';\nimport { Injectable, inject } from '@angular/core';\nimport { KeyValueTypleValueFilter, type Maybe, mergeObjects } from '@dereekb/util';\n\n/**\n * Angular Router implementation of {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Maps Angular Router's `NavigationStart` and `NavigationEnd` events to {@link DbxRouterTransitionEvent} values\n * and provides navigation via Angular's `Router.navigate()` and `Router.navigateByUrl()` methods.\n *\n * @example\n * ```ts\n * // Register via the module\n * DbxCoreAngularRouterSegueModule.forRoot()\n *\n * // Or inject directly\n * const router = inject(DbxRouterService);\n * await router.go({ ref: '/dashboard' });\n * ```\n *\n * @see {@link DbxRouterService}\n * @see {@link DbxCoreAngularRouterSegueModule} for module-based registration\n * @see {@link DbxUIRouterService} for the UIRouter alternative\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\n readonly router = inject(Router);\n readonly activatedRoute = inject(ActivatedRoute);\n\n readonly params$: Observable<SegueRefRawSegueParams> = this.activatedRoute.params;\n\n readonly transitions$ = this.router.events.pipe(\n map((x) => {\n let event: Maybe<DbxRouterTransitionEvent>;\n\n if (x instanceof NavigationStart) {\n event = {\n type: DbxRouterTransitionEventType.START\n };\n } else if (x instanceof NavigationEnd) {\n event = {\n type: DbxRouterTransitionEventType.SUCCESS\n };\n }\n\n return event;\n }),\n filterMaybe()\n );\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const ref = segueRef.ref;\n\n if (Array.isArray(ref)) {\n return this.router.navigate(ref as unknown[], {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n });\n } else {\n return this.router.navigateByUrl(ref as string | UrlTree, {\n ...segueRef.refOptions\n });\n }\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<NavigationExtras | NavigationBehaviorOptions>> = combineLatest([this.activatedRoute.params, asObservable(inputParams)]).pipe(\n map(([currentParams, params]) => {\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n const segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions> = {\n ref: this.activatedRoute.pathFromRoot,\n refParams,\n refOptions: {\n replaceUrl: true\n }\n };\n\n return segueRef;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(_segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n isActiveExactly(_segueRef: SegueRefOrSegueRefRouterLink): boolean {\n return false; // TODO!\n }\n\n comparePrecision(_a: SegueRefOrSegueRefRouterLink, _b: SegueRefOrSegueRefRouterLink): number {\n return 0; // TODO!\n }\n}\n","import { type ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n/**\n * NgModule that provides the Angular Router-based implementation of {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Use `forRoot()` to register the providers at the application root level.\n *\n * @example\n * ```ts\n * @NgModule({\n * imports: [\n * DbxCoreAngularRouterSegueModule.forRoot()\n * ]\n * })\n * export class AppModule {}\n * ```\n *\n * @see {@link DbxAngularRouterService} for the underlying service implementation\n * @see {@link provideDbxUIRouterService} for the UIRouter alternative\n */\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n static forRoot(): ModuleWithProviders<DbxCoreAngularRouterSegueModule> {\n return {\n ngModule: DbxCoreAngularRouterSegueModule,\n providers: [\n DbxAngularRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxAngularRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxAngularRouterService\n }\n ]\n };\n }\n}\n","import { KeyValueTypleValueFilter, mergeObjects } from '@dereekb/util';\nimport { Subject, BehaviorSubject, type Observable, firstValueFrom, map } from 'rxjs';\nimport { type DbxRouterService } from '../../service/router.service';\nimport { type DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { asSegueRef, asSegueRefString, type SegueRef, type SegueRefOrSegueRefRouterLink, type SegueRefRawSegueParams } from '../../../segue';\nimport { StateService, UIRouter, UIRouterGlobals, type TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable, type OnDestroy, inject } from '@angular/core';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\nimport { type ObservableOrValue, asObservable } from '@dereekb/rxjs';\n\n/**\n * UIRouter implementation of {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Bridges UIRouter's `TransitionService` events to {@link DbxRouterTransitionEvent} values and provides\n * navigation via UIRouter's `StateService.go()`. Supports state activity checks and route precision comparison.\n *\n * @example\n * ```ts\n * // Register via the provider function\n * provideDbxUIRouterService()\n *\n * // Or inject and use\n * const router = inject(DbxRouterService);\n * await router.go({ ref: 'app.dashboard', refParams: { id: '123' } });\n * ```\n *\n * @see {@link DbxRouterService}\n * @see {@link provideDbxUIRouterService} for provider registration\n * @see {@link DbxAngularRouterService} for the Angular Router alternative\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService, OnDestroy {\n readonly uiRouter = inject(UIRouter);\n readonly state = inject(StateService);\n readonly transitionService = inject(TransitionService);\n readonly uiRouterGlobals = inject(UIRouterGlobals);\n\n private readonly _params = new BehaviorSubject<SegueRefRawSegueParams>(this.uiRouterGlobals.params);\n\n readonly params$ = this._params.asObservable();\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor() {\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n\n this._params.next(this.uiRouterGlobals.params);\n };\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n });\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n });\n }\n\n ngOnDestroy(): void {\n this._transitions.complete();\n }\n\n get params() {\n return this.uiRouterGlobals.params;\n }\n\n go(input: ObservableOrValue<SegueRefOrSegueRefRouterLink<TransitionOptions>>): Promise<boolean> {\n const inputObs = asObservable(input);\n return firstValueFrom(inputObs).then((inputSegueRef) => {\n const segueRef = asSegueRef(inputSegueRef);\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state\n .go(segueRef.ref as string, params, segueRef.refOptions)\n .then(() => true)\n .catch(() => false);\n });\n }\n\n updateParams(inputParams: ObservableOrValue<SegueRefRawSegueParams>): Promise<boolean> {\n const segueUpdate: Observable<SegueRefOrSegueRefRouterLink<TransitionOptions>> = asObservable(inputParams).pipe(\n map((params) => {\n const currentParams = this.uiRouterGlobals.params;\n const refParams = mergeObjects([currentParams, params], KeyValueTypleValueFilter.UNDEFINED);\n\n const ref: SegueRef<TransitionOptions> = {\n ref: '.',\n refParams,\n refOptions: {\n location: 'replace',\n inherit: true\n }\n };\n\n return ref;\n })\n );\n\n return this.go(segueUpdate);\n }\n\n isActive(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, false);\n }\n\n isActiveExactly(input: SegueRefOrSegueRefRouterLink): boolean {\n return this.isActiveState(input, true);\n }\n\n comparePrecision(aInput: SegueRefOrSegueRefRouterLink, bInput: SegueRefOrSegueRefRouterLink): number {\n const aRef = asSegueRefString(aInput);\n const bRef = asSegueRefString(bInput);\n\n const aLength = aRef.length;\n const bLength = bRef.length;\n return aLength > bLength ? 1 : aLength === bLength ? 0 : -1;\n }\n\n // MARK: Internal\n isActiveState(input: SegueRefOrSegueRefRouterLink, exactly: boolean): boolean {\n const segueRef = asSegueRef(input);\n const ref = segueRef.ref as string;\n const refParams = segueRef.refParams;\n\n // Slash paths (e.g., '/demo/oauth') are compared against the current URL path\n if (ref.startsWith('/')) {\n const currentPath = this.uiRouter.urlService.path();\n\n if (exactly) {\n return currentPath === ref;\n } else {\n return currentPath === ref || currentPath.startsWith(ref + '/');\n }\n }\n\n const targetRef = ref.startsWith('.') ? `^${ref}` : ref;\n return exactly ? this.state.is(targetRef, refParams) : this.state.includes(targetRef, refParams);\n }\n}\n","import { DbxRouterService } from '../../service/router.service';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { type EnvironmentProviders, makeEnvironmentProviders, type Provider } from '@angular/core';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n/**\n * Creates Angular environment providers that register {@link DbxUIRouterService} as the implementation\n * for both {@link DbxRouterService} and {@link DbxRouterTransitionService}.\n *\n * Use this function in the application's `bootstrapApplication` or `provideRouter` configuration\n * when using UIRouter as the routing framework.\n *\n * @returns Angular `EnvironmentProviders` for the UIRouter-based router service.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideDbxUIRouterService()\n * ]\n * });\n * ```\n *\n * @see {@link DbxUIRouterService}\n * @see {@link DbxCoreAngularRouterSegueModule} for the Angular Router alternative\n */\nexport function provideDbxUIRouterService(): EnvironmentProviders {\n const providers: Provider[] = [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { distinctUntilKeysChange } from '@dereekb/rxjs';\nimport { type ArrayOrValue, asArray, filterMaybeArrayValues, type IndexRef } from '@dereekb/util';\nimport { filter, map, type MonoTypeOperatorFunction, type Observable, distinctUntilChanged, shareReplay, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from '../service/router.service';\nimport { type DbxRouterTransitionService } from '../service/router.transition.service';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from './transition';\n\n/**\n * Filters the given transition event observable to only emit successful transitions.\n *\n * Convenience function equivalent to applying {@link filterTransitionSuccess} as a pipe operator.\n *\n * @param obs - The source observable of router transition events.\n * @returns An observable that emits only successful transition events.\n *\n * @see {@link filterTransitionSuccess}\n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\n/**\n * RxJS operator that filters transition events to only pass through successful transitions.\n *\n * @returns A `MonoTypeOperatorFunction` that filters for {@link DbxRouterTransitionEventType.SUCCESS} events.\n *\n * @see {@link filterTransitionEvent}\n */\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\n/**\n * RxJS operator that filters transition events to only pass through events of the specified type.\n *\n * @param type - The transition event type to filter for.\n * @returns A `MonoTypeOperatorFunction` that only passes matching events.\n */\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter((x) => x.type === type);\n}\n// MARK: LatestSuccessfulRoutesConfig\n/**\n * Configuration for a single route to check for activity within {@link latestSuccessfulRoutes}.\n *\n * @see {@link LatestSuccessfulRoutesConfig}\n */\nexport interface LatestSuccessfulRoutesConfigRoute {\n /**\n * Route to check if it is active or not.\n */\n readonly route: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n */\n readonly activeExactly?: boolean;\n}\n\ninterface LatestSuccessfulRoutesConfigRouteItem<T> extends IndexRef {\n readonly r: T;\n}\n\n/**\n * Configuration for {@link latestSuccessfulRoutes}, specifying the router services and routes to monitor.\n *\n * @typeParam T - The route configuration type, extending {@link LatestSuccessfulRoutesConfigRoute}.\n *\n * @see {@link latestSuccessfulRoutes}\n */\nexport interface LatestSuccessfulRoutesConfig<T extends LatestSuccessfulRoutesConfigRoute> {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<T>;\n}\n\n/**\n * Creates an observable that emits the list of currently active routes after each successful transition.\n *\n * On each successful router transition, checks all configured routes against the router service\n * and emits an array of those that are active. The result is deduplicated by index and shared.\n *\n * @typeParam T - The route configuration type, extending {@link LatestSuccessfulRoutesConfigRoute}.\n * @param config - Configuration specifying the router services and routes to monitor.\n * @returns An observable emitting an array of the currently active route configurations.\n *\n * @see {@link LatestSuccessfulRoutesConfig}\n * @see {@link isLatestSuccessfulRoute} for a boolean variant\n */\nexport function latestSuccessfulRoutes<T extends LatestSuccessfulRoutesConfigRoute>(config: LatestSuccessfulRoutesConfig<T>): Observable<T[]> {\n const { dbxRouterTransitionService, dbxRouterService, routes: inputRoutes } = config;\n const routes: LatestSuccessfulRoutesConfigRouteItem<T>[] = asArray(inputRoutes).map((r, i) => ({ r, i }));\n const checkRoutes: (() => LatestSuccessfulRoutesConfigRouteItem<T> | undefined)[] = routes.map((routeConfig) => {\n const { r: route } = routeConfig;\n return route.activeExactly ? () => (dbxRouterService.isActiveExactly(route.route) ? routeConfig : undefined) : () => (dbxRouterService.isActive(route.route) ? routeConfig : undefined);\n });\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n const activeRoutes: LatestSuccessfulRoutesConfigRouteItem<T>[] = filterMaybeArrayValues(checkRoutes.map((x) => x()));\n return activeRoutes;\n }),\n distinctUntilKeysChange((x) => x.i),\n map((x) => x.map((y) => y.r)),\n shareReplay(1)\n );\n}\n\n// MARK: IsLatestSuccessfulRouteConfig\n/**\n * Configuration for {@link isLatestSuccessfulRoute}, specifying the router services, routes, and match mode.\n *\n * @see {@link isLatestSuccessfulRoute}\n */\nexport interface IsLatestSuccessfulRouteConfig {\n readonly dbxRouterTransitionService: DbxRouterTransitionService;\n readonly dbxRouterService: DbxRouterService;\n /**\n * Route or list of routes to check if they're active or not.\n */\n readonly routes: ArrayOrValue<SegueRefOrSegueRefRouterLink>;\n /**\n * Whether or not to match route activity exactly.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an observable that emits `true` when any of the configured routes are active after a successful transition,\n * and `false` otherwise.\n *\n * This is a simplified boolean variant of {@link latestSuccessfulRoutes}.\n *\n * @param config - Configuration specifying the router services, routes, and match mode.\n * @returns An observable emitting `true` when at least one configured route is active, `false` otherwise.\n *\n * @see {@link IsLatestSuccessfulRouteConfig}\n * @see {@link latestSuccessfulRoutes} for the full route list variant\n */\nexport function isLatestSuccessfulRoute(config: IsLatestSuccessfulRouteConfig): Observable<boolean> {\n const { dbxRouterTransitionService, dbxRouterService, activeExactly } = config;\n const routes = asArray(config.routes);\n const checkRoute: (route: SegueRefOrSegueRefRouterLink) => boolean = activeExactly ? (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActiveExactly(route) : (route: SegueRefOrSegueRefRouterLink) => dbxRouterService.isActive(route);\n\n return successTransition(dbxRouterTransitionService.transitions$).pipe(\n startWith(undefined),\n map(() => {\n return routes.some(checkRoute);\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n}\n","import { type Observable, startWith } from 'rxjs';\nimport { Directive, inject } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that provides observables for reacting to successful router transitions.\n *\n * Subclasses can subscribe to `transitionSuccess$` to react to each successful navigation,\n * or use `initAndUpdateOnTransitionSuccess$` which also emits once immediately on initialization.\n *\n * @example\n * ```ts\n * @Directive({ selector: '[myTransitionHandler]' })\n * class MyTransitionHandlerDirective extends AbstractTransitionDirective {\n * readonly data$ = this.initAndUpdateOnTransitionSuccess$.pipe(\n * switchMap(() => this.loadData())\n * );\n * }\n * ```\n *\n * @see {@link AbstractTransitionWatcherDirective} for a variant that automatically calls a callback\n * @see {@link DbxRouterTransitionService}\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n protected readonly dbxRouterTransitionService = inject(DbxRouterTransitionService);\n\n /**\n * Observable that emits on each successful router transition.\n */\n readonly transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);\n /**\n * Observable that emits immediately on initialization and on each subsequent successful transition.\n */\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n}\n","import { Directive, NgZone, inject } from '@angular/core';\nimport { AbstractTransitionDirective } from './transition.directive';\nimport { cleanSubscription } from '../../../rxjs/subscription';\n\n/**\n * Abstract directive that automatically calls {@link updateForSuccessfulTransition} on each successful router transition.\n *\n * Extends {@link AbstractTransitionDirective} by subscribing to successful transitions during construction\n * and invoking the abstract `updateForSuccessfulTransition()` method for each one.\n *\n * Also provides a `zoneUpdateForSuccessfulTransition()` method that wraps the update call in `NgZone.run()`.\n *\n * @example\n * ```ts\n * @Directive({ selector: '[myRouteWatcher]' })\n * class MyRouteWatcherDirective extends AbstractTransitionWatcherDirective {\n * protected updateForSuccessfulTransition(): void {\n * console.log('Route changed successfully');\n * }\n * }\n * ```\n *\n * @see {@link AbstractTransitionDirective}\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {\n protected readonly ngZone = inject(NgZone);\n\n constructor() {\n super();\n\n cleanSubscription(\n this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n })\n );\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n // TODO: NgZone Deprecation\n // remove this function and replace, if necessary or remove entirely with angular zoneless implementation details.\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n}\n","import { type Building } from '@dereekb/util';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterService } from './router.service';\n\n/**\n * A callable function that returns `true` when the configured segue ref is currently active in the router.\n *\n * Also exposes the underlying segue ref and match mode as readonly properties for introspection.\n *\n * @see {@link isSegueRefActiveFunction} for creating instances\n */\nexport type IsSegueRefActiveFunction = (() => boolean) & {\n readonly _segueRef: SegueRefOrSegueRefRouterLink;\n readonly _activeExactly: boolean;\n};\n\n/**\n * Configuration for creating an {@link IsSegueRefActiveFunction}.\n *\n * @see {@link isSegueRefActiveFunction}\n */\nexport interface IsSegueRefActiveFunctionConfig {\n readonly dbxRouterService: DbxRouterService;\n readonly segueRef: SegueRefOrSegueRefRouterLink;\n /**\n * Whether or not to match the route exactly.\n *\n * False by default.\n */\n readonly activeExactly?: boolean;\n}\n\n/**\n * Creates an {@link IsSegueRefActiveFunction} from the given configuration.\n *\n * The returned function checks whether the configured segue ref is active in the router each time it is called.\n * When `activeExactly` is `true`, uses `isActiveExactly`; otherwise uses `isActive`.\n *\n * @param config - The configuration containing the router service, segue ref, and match mode.\n * @returns A callable function that returns `true` when the route is active.\n *\n * @see {@link IsSegueRefActiveFunctionConfig}\n */\nexport function isSegueRefActiveFunction(config: IsSegueRefActiveFunctionConfig): IsSegueRefActiveFunction {\n const { dbxRouterService, segueRef, activeExactly = false } = config;\n const result = (activeExactly ? () => dbxRouterService.isActiveExactly(segueRef) : () => dbxRouterService.isActive(segueRef)) as Building<IsSegueRefActiveFunction>;\n\n result._segueRef = segueRef;\n result._activeExactly = activeExactly;\n\n return result as IsSegueRefActiveFunction;\n}\n","import { type Maybe } from '@dereekb/util';\nimport { filter, map, type Observable, of, type OperatorFunction, switchMap, startWith } from 'rxjs';\nimport { type SegueRefOrSegueRefRouterLink } from '../../segue';\nimport { type DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../transition';\nimport { isSegueRefActiveFunction, type IsSegueRefActiveFunctionConfig } from './router.service.util';\n\n// MARK: Transition Events\n/**\n * Filters the given transition event observable to only emit events of the specified type.\n *\n * @param events$ - The source observable of router transition events.\n * @param type - The transition event type to filter for.\n * @returns An observable that emits only events matching the given type.\n */\nexport function onRouterTransitionEventType(events$: Observable<DbxRouterTransitionEvent>, type: DbxRouterTransitionEventType): Observable<DbxRouterTransitionEvent> {\n return events$.pipe(filter((x) => x.type === type));\n}\n\n/**\n * Filters the given transition event observable to only emit successful transition events.\n *\n * @param events$ - The source observable of router transition events.\n * @returns An observable that emits only {@link DbxRouterTransitionEventType.SUCCESS} events.\n *\n * @see {@link onRouterTransitionEventType}\n */\nexport function onRouterTransitionSuccessEvent(events$: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return onRouterTransitionEventType(events$, DbxRouterTransitionEventType.SUCCESS);\n}\n\n// MARK: Router Service\n/**\n * Creates an observable that returns true when the route for the input segueRef is active.\n *\n * @param config - Configuration specifying the router service, segue ref, and matching options.\n * @returns An observable that emits `true` when the segue ref's route is active.\n */\nexport function isSegueRefActiveOnTransitionSuccess(config: IsSegueRefActiveFunctionConfig): Observable<boolean> {\n const isActiveFn = isSegueRefActiveFunction(config);\n return onRouterTransitionSuccessEvent(config.dbxRouterService.transitions$).pipe(\n startWith(undefined),\n map(() => isActiveFn())\n );\n}\n\n/**\n * Configuration for the {@link isSegueRefActive} RxJS operator function.\n *\n * @see {@link isSegueRefActive}\n */\nexport interface IsSegueRefActiveConfig extends Pick<IsSegueRefActiveFunctionConfig, 'dbxRouterService' | 'activeExactly'> {\n /**\n * What to pipe if the input segueRef is null.\n */\n readonly defaultIfNull?: boolean;\n}\n\n/**\n * Operator function that maps the input segueRef to a boolean depending on the current route state.\n *\n * @param config - Configuration specifying the router service and default behavior for null refs.\n * @returns An RxJS operator that maps a segue ref to whether it is currently active.\n */\nexport function isSegueRefActive(config: IsSegueRefActiveConfig): OperatorFunction<Maybe<SegueRefOrSegueRefRouterLink>, boolean> {\n const { defaultIfNull = false } = config;\n\n return switchMap((segueRef) => {\n if (segueRef) {\n return isSegueRefActiveOnTransitionSuccess({ ...config, segueRef });\n } else {\n return of(defaultIfNull);\n }\n });\n}\n","import { type ObservableOrValueGetter, type MaybeObservableOrValueGetter, switchMapToDefault, maybeValueFromObservableOrValueGetter, asObservableFromGetter } from '@dereekb/rxjs';\nimport { type Destroyable, type Maybe } from '@dereekb/util';\nimport { BehaviorSubject, combineLatest, distinctUntilChanged, first, map, type Observable, shareReplay } from 'rxjs';\nimport { type DbxRouterService } from '../service/router.service';\n\n/**\n * Interface for reading a single parameter value from the router state.\n *\n * Provides observables for the raw parameter value, a configurable default value, and a computed value\n * that falls back to the default when the parameter is not set. Also supports programmatic updates.\n *\n * @typeParam T - The type of the parameter value.\n *\n * @example\n * ```ts\n * const reader = dbxRouteParamReaderInstance<string>(routerService, 'id');\n * reader.value$.subscribe(id => console.log('Current ID:', id));\n * reader.setDefaultValue('default-id');\n * ```\n *\n * @see {@link dbxRouteParamReaderInstance} for creating instances\n * @see {@link DbxRouterService} for the router service that provides route parameters\n */\nexport interface DbxRouteParamReader<T> {\n /**\n * The param value as read from the current router state.\n */\n readonly paramValue$: Observable<Maybe<T>>;\n\n /**\n * The default value observable.\n */\n readonly defaultValue$: Observable<Maybe<T>>;\n\n /**\n * The current value given the paramValue and the defaultValue.\n */\n readonly value$: Observable<Maybe<T>>;\n\n /**\n * Returns the current param key.\n */\n getParamKey(): string;\n\n /**\n * Sets a new param key. If the value is undefined, the param reader will use the default key.\n */\n setParamKey(paramKey: Maybe<string>): void;\n\n /**\n * Sets the default value source.\n *\n * @param defaultValue\n */\n setDefaultValue(defaultValue: MaybeObservableOrValueGetter<T>): void;\n\n /**\n * Updates the value on the current route for the paramKey.\n *\n * @param value\n */\n setParamValue(value: MaybeObservableOrValueGetter<T>): void;\n}\n\n/**\n * Full lifecycle instance of a {@link DbxRouteParamReader} that exposes the underlying router service,\n * additional observable streams, and implements the {@link Destroyable} interface for cleanup.\n *\n * @typeParam T - The type of the parameter value.\n *\n * @see {@link DbxRouteParamReader}\n * @see {@link dbxRouteParamReaderInstance} for creating instances\n */\nexport interface DbxRouteParamReaderInstance<T> extends DbxRouteParamReader<T>, Destroyable {\n readonly dbxRouterService: DbxRouterService;\n readonly paramKey$: Observable<string>;\n readonly nextDefaultValue$: Observable<Maybe<T>>;\n readonly value$: Observable<Maybe<T>>;\n}\n\n/**\n * Creates a new DbxRouteParamReaderInstance from the input.\n *\n * @param dbxRouterService\n * @param defaultParamKey\n * @param defaultValue\n * @returns\n */\nexport function dbxRouteParamReaderInstance<T>(dbxRouterService: DbxRouterService, defaultParamKey: string, defaultValue?: MaybeObservableOrValueGetter<T>): DbxRouteParamReaderInstance<T> {\n const _paramKey = new BehaviorSubject<string>(defaultParamKey);\n const _defaultValue = new BehaviorSubject<Maybe<ObservableOrValueGetter<Maybe<T>>>>(defaultValue);\n\n const paramKey$ = _paramKey.asObservable();\n\n const paramValue$ = combineLatest([paramKey$, dbxRouterService.params$]).pipe(\n map(([key, params]) => (params[key] as Maybe<T>) ?? undefined),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n const nextDefaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const defaultValue$ = _defaultValue.pipe(maybeValueFromObservableOrValueGetter(), shareReplay(1));\n const value$ = paramValue$.pipe(switchMapToDefault(defaultValue$), shareReplay(1));\n\n const result: DbxRouteParamReaderInstance<T> = {\n dbxRouterService,\n\n paramKey$,\n paramValue$,\n nextDefaultValue$,\n defaultValue$,\n value$,\n\n destroy() {\n _paramKey.complete();\n _defaultValue.complete();\n },\n\n getParamKey(): string {\n return _paramKey.value;\n },\n\n setParamKey(paramKey: Maybe<string>) {\n _paramKey.next(paramKey || defaultParamKey);\n },\n\n setDefaultValue(newValue: MaybeObservableOrValueGetter<T>) {\n _defaultValue.next(newValue ?? defaultValue);\n },\n\n setParamValue(value: MaybeObservableOrValueGetter<T>) {\n combineLatest([paramKey$, asObservableFromGetter(value)])\n .pipe(first())\n .subscribe(([paramKey, value]) => void dbxRouterService.updateParams({ [paramKey]: value }));\n }\n };\n\n return result;\n}\n","import { BehaviorSubject, EMPTY, switchMap, of } from 'rxjs';\nimport { type DbxRouteParamReaderInstance } from './route.reader';\nimport { type Destroyable, type Initialized, type Maybe, type DefaultForwardFunctionFactory, defaultForwardFunctionFactory } from '@dereekb/util';\nimport { SubscriptionObject, switchMapToDefault, type SwitchMapToDefaultFilterFunction, filterMaybe } from '@dereekb/rxjs';\n\nconst DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY = defaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<unknown>>((value) => of(value == null));\n\n/**\n * Utility class that works with a {@link DbxRouteParamReaderInstance} to automatically redirect the router\n * when the current parameter value is determined to require a default substitution.\n *\n * When enabled and initialized, it monitors the parameter value and, if the configured filter function\n * indicates the value should be replaced, updates the route to use the default value instead.\n *\n * @typeParam T - The type of the parameter value.\n *\n * @example\n * ```ts\n * const paramReader = dbxRouteParamReaderInstance<string>(routerService, 'id');\n * const redirect = new DbxRouteParamDefaultRedirectInstance(paramReader);\n * redirect.setUseDefaultFilter(value => of(value === '0'));\n * redirect.init();\n * ```\n *\n * @see {@link DbxRouteParamReaderInstance}\n * @see {@link dbxRouteModelIdParamRedirect} for the model-specific usage pattern\n */\nexport class DbxRouteParamDefaultRedirectInstance<T> implements Initialized, Destroyable {\n private readonly instance: DbxRouteParamReaderInstance<T>;\n\n private readonly _enabled = new BehaviorSubject<boolean>(true);\n private readonly _useDefaultFilter = new BehaviorSubject<Maybe<SwitchMapToDefaultFilterFunction<T>>>(undefined);\n private readonly _sub = new SubscriptionObject();\n\n constructor(instance: DbxRouteParamReaderInstance<T>) {\n this.instance = instance;\n }\n\n init(): void {\n this._sub.subscription = this._enabled\n .pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this.instance.paramValue$.pipe(\n switchMapToDefault(this.instance.defaultValue$, (value) => {\n return this._useDefaultFilter.pipe(switchMap((fn) => (DEFAULT_REDIRECT_INSTANCE_FORWARD_FACTORY as DefaultForwardFunctionFactory<SwitchMapToDefaultFilterFunction<T>>)(fn)(value)));\n }),\n filterMaybe(), // do not redirect on MaybeNot values\n switchMap((defaultValue) => {\n return this.redirectWithDefaultValue(defaultValue);\n })\n );\n } else {\n return EMPTY;\n }\n })\n )\n .subscribe();\n }\n\n destroy(): void {\n this._enabled.complete();\n this._useDefaultFilter.complete();\n this._sub.destroy();\n }\n\n protected redirectWithDefaultValue(value: Maybe<T>): Promise<boolean> {\n if (value != null) {\n // perform a segue once\n return this.redirectWithValue(value);\n } else {\n // do nothing\n return Promise.resolve(false);\n }\n }\n\n protected redirectWithValue(value: Maybe<T>): Promise<boolean> {\n return this.instance.dbxRouterService.updateParams({\n [this.instance.getParamKey()]: value\n });\n }\n\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: boolean) {\n this._enabled.next(enabled);\n }\n\n setUseDefaultFilter(useValueFilter: Maybe<SwitchMapToDefaultFilterFunction<T>>): void {\n this._useDefaultFilter.next(useValueFilter);\n }\n}\n","import { type Observable, BehaviorSubject, map, shareReplay, of, switchMap } from 'rxjs';\nimport { type Destroyable, type Initialized, type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { type DbxRouterService } from '../router/service';\nimport { type DbxRouteParamReader, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance } from '../router/util';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the id param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY = 'id';\n\n/**\n * Default identifier used by dbxRouteModelIdParamRedirect() that corresponds to the key param of the model in the current route.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY = 'key';\n\n/**\n * Default value used by dbxRouteModelIdParamRedirect() for when a value is not available or provided.\n */\nexport const DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_USE_PARAM_VALUE = '0';\n\n/**\n * Reads a model identifier from the current route by parameter key, with support for automatic\n * redirect when the parameter matches a placeholder value (e.g., `'0'`).\n *\n * Extends {@link DbxRouteParamReader} with redirect and decision logic so that routes with\n * placeholder identifiers can be automatically resolved to a meaningful default.\n *\n * @example\n * ```ts\n * const redirect = dbxRouteModelIdParamRedirect(routerService);\n * redirect.init();\n *\n * // Observe the resolved id (after redirect logic is applied)\n * redirect.id$.subscribe(id => console.log('Model ID:', id));\n * ```\n *\n * @see {@link DbxRouteParamReader}\n * @see {@link dbxRouteModelIdParamRedirect} for creating instances\n */\nexport interface DbxRouteModelIdParamRedirect 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 * Full lifecycle instance of a {@link DbxRouteModelIdParamRedirect} that supports initialization and destruction.\n *\n * Provides mutable setters for the parameter key, default value, redirect enabled state, and decision function.\n *\n * @see {@link DbxRouteModelIdParamRedirect}\n * @see {@link dbxRouteModelIdParamRedirect} for creating instances\n */\nexport interface DbxRouteModelIdParamRedirectInstance extends DbxRouteModelIdParamRedirect, 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: Maybe<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\n/**\n * Creates a {@link DbxRouteModelIdParamRedirectInstance} configured to read a \"key\" parameter from the current route.\n *\n * This is a convenience wrapper around {@link dbxRouteModelIdParamRedirect} that defaults the parameter key to `'key'`.\n *\n * @param dbxRouterService - The router service to read parameters from.\n * @param defaultParamKey - The route parameter key to read. Defaults to `'key'`.\n * @returns A new redirect instance.\n *\n * @see {@link dbxRouteModelIdParamRedirect}\n */\nexport function dbxRouteModelKeyParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_KEY_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n return dbxRouteModelIdParamRedirect(dbxRouterService, defaultParamKey);\n}\n\n/**\n * Creates a {@link DbxRouteModelIdParamRedirectInstance} that reads a model identifier from the current route\n * and optionally redirects when the value matches a placeholder (defaulting to `'0'`).\n *\n * The instance must be initialized via `init()` to activate the redirect behavior, and destroyed via `destroy()`\n * when no longer needed.\n *\n * @param dbxRouterService - The router service to read parameters from and perform redirects with.\n * @param defaultParamKey - The route parameter key to read. Defaults to `'id'`.\n * @returns A new redirect instance.\n *\n * @see {@link DbxRouteModelIdParamRedirectInstance}\n * @see {@link dbxRouteModelKeyParamRedirect} for the key-based variant\n */\nexport function dbxRouteModelIdParamRedirect(dbxRouterService: DbxRouterService, defaultParamKey: string = DBX_ROUTE_MODEL_ID_PARAM_DEFAULT_ID_PARAM_KEY): DbxRouteModelIdParamRedirectInstance {\n const _paramReader = dbxRouteParamReaderInstance<ModelKey>(dbxRouterService, defaultParamKey);\n const _paramRedirect = new DbxRouteParamDefaultRedirectInstance<ModelKey>(_paramReader);\n const _useDefaultParamDecider = new BehaviorSubject<string | SwitchMapToDefaultFilterFunction<ModelKey>>(DBX_ROUTE_MODEL_ID_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: DbxRouteModelIdParamRedirectInstance = {\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 { type Type, type Provider, forwardRef } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type Observable, type Subscription } from 'rxjs';\n\n// MARK: Id\n/**\n * Abstract delegate that receives model identifier observables from a {@link DbxRouteModelIdDirective}.\n *\n * Implement this class and register it as a provider to receive the id parameter read from the current route.\n * The directive will call {@link useRouteModelIdParamsObservable} during initialization.\n *\n * @example\n * ```ts\n * @Directive({\n * selector: '[myModelLoader]',\n * providers: provideDbxRouteModelIdDirectiveDelegate(MyModelLoaderDirective)\n * })\n * class MyModelLoaderDirective extends DbxRouteModelIdDirectiveDelegate {\n * useRouteModelIdParamsObservable(idFromParams$: Observable<Maybe<ModelKey>>, computedId$: Observable<Maybe<ModelKey>>): Subscription {\n * return computedId$.subscribe(id => this.loadModel(id));\n * }\n * }\n * ```\n *\n * @see {@link DbxRouteModelIdDirective} for the directive that provides the id observables\n * @see {@link provideDbxRouteModelIdDirectiveDelegate} for registering the delegate provider\n */\nexport abstract class DbxRouteModelIdDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelIdDirective to this delegate.\n *\n * @param idFromParamsObs\n * @param computedIdObs\n */\n abstract useRouteModelIdParamsObservable(idFromParamsObs: Observable<Maybe<ModelKey>>, computedIdObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Creates Angular DI providers that register the given source type as a {@link DbxRouteModelIdDirectiveDelegate}.\n *\n * @typeParam S - The concrete delegate class type to register.\n * @param sourceType - The class to provide as the delegate.\n * @returns An array of Angular providers.\n *\n * @see {@link DbxRouteModelIdDirectiveDelegate}\n */\nexport function provideDbxRouteModelIdDirectiveDelegate<S extends DbxRouteModelIdDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelIdDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n\n// MARK: Key\n/**\n * Abstract delegate that receives model key observables from a {@link DbxRouteModelKeyDirective}.\n *\n * Implement this class and register it as a provider to receive the key parameter read from the current route.\n * The directive will call {@link useRouteModelKeyParamsObservable} during initialization.\n *\n * @example\n * ```ts\n * @Directive({\n * selector: '[myModelKeyLoader]',\n * providers: provideDbxRouteModelKeyDirectiveDelegate(MyModelKeyLoaderDirective)\n * })\n * class MyModelKeyLoaderDirective extends DbxRouteModelKeyDirectiveDelegate {\n * useRouteModelKeyParamsObservable(keyFromParams$: Observable<Maybe<ModelKey>>, computedKey$: Observable<Maybe<ModelKey>>): Subscription {\n * return computedKey$.subscribe(key => this.loadModel(key));\n * }\n * }\n * ```\n *\n * @see {@link DbxRouteModelKeyDirective} for the directive that provides the key observables\n * @see {@link provideDbxRouteModelKeyDirectiveDelegate} for registering the delegate provider\n */\nexport abstract class DbxRouteModelKeyDirectiveDelegate {\n /**\n * Passes the param value and computed value from the DbxRouteModelKeyDirective to this delegate.\n *\n * @param keyFromParamsObs\n * @param computedKeyObs\n */\n abstract useRouteModelKeyParamsObservable(keyFromParamsObs: Observable<Maybe<ModelKey>>, computedKeyObs: Observable<Maybe<ModelKey>>): Subscription;\n}\n\n/**\n * Creates Angular DI providers that register the given source type as a {@link DbxRouteModelKeyDirectiveDelegate}.\n *\n * @typeParam S - The concrete delegate class type to register.\n * @param sourceType - The class to provide as the delegate.\n * @returns An array of Angular providers.\n *\n * @see {@link DbxRouteModelKeyDirectiveDelegate}\n */\nexport function provideDbxRouteModelKeyDirectiveDelegate<S extends DbxRouteModelKeyDirectiveDelegate>(sourceType: Type<S>): Provider[] {\n const providers: Provider[] = [\n {\n provide: DbxRouteModelKeyDirectiveDelegate,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n\n return providers;\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { DbxAuthService } from '../../auth';\nimport { cleanSubscription } from '../../rxjs';\n\n/**\n * Directive that retrieves the currently authenticated user's identifier from {@link DbxAuthService}\n * and passes it directly to a {@link DbxRouteModelIdDirectiveDelegate}.\n *\n * This is useful for routes that should always use the current user's ID, bypassing route parameter reading entirely.\n *\n * @example\n * ```html\n * <!-- Automatically provides the authenticated user's ID to the delegate -->\n * <div dbxRouteModelIdFromAuthUserId></div>\n * ```\n *\n * @see {@link DbxRouteModelIdDirectiveDelegate} for the delegate that receives the id observables\n * @see {@link DbxAuthService} for the authentication service providing the user identifier\n */\n@Directive({\n selector: '[dbxRouteModelIdFromAuthUserId]',\n standalone: true\n})\nexport class DbxRouteModelIdFromAuthUserIdDirective {\n readonly dbxAuthService = inject(DbxAuthService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.dbxAuthService.userIdentifier$, this.dbxAuthService.userIdentifier$));\n }\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelIdParamRedirect } from './id.param.redirect';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelIdDirectiveDelegate } from './model.router';\nimport { clean, cleanSubscription } from '../../rxjs';\n\n/**\n * Directive that reads a model identifier from the current route's parameters and passes it to a {@link DbxRouteModelIdDirectiveDelegate}.\n *\n * Supports configurable parameter key, default value, redirect behavior, and custom decision logic for determining\n * when to use the default value vs. the route parameter.\n *\n * @example\n * ```html\n * <!-- Basic usage: reads \"id\" param from route and passes to delegate -->\n * <div dbxRouteModelId></div>\n *\n * <!-- Custom param key -->\n * <div [dbxRouteModelId]=\"'modelId'\"></div>\n *\n * <!-- With default value and redirect disabled -->\n * <div dbxRouteModelId [dbxRouteModelIdDefault]=\"defaultId$\" [dbxRouteModelIdDefaultRedirect]=\"false\"></div>\n * ```\n *\n * @see {@link DbxRouteModelIdDirectiveDelegate} for the delegate that receives the id observables\n * @see {@link dbxRouteModelIdParamRedirect} for the underlying redirect logic\n */\n@Directive({\n selector: '[dbxRouteModelId]',\n standalone: true\n})\nexport class DbxRouteModelIdDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelIdDelegate = inject(DbxRouteModelIdDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelIdParamRedirect(this.dbxRouterService));\n\n readonly idFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly id$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelIdDelegate.useRouteModelIdParamsObservable(this.idFromParams$, this.id$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelId')\n get idParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set idParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n /**\n * Default model identifier value to use when the route parameter matches the placeholder or is absent.\n */\n @Input()\n set dbxRouteModelIdDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelIdDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n /**\n * Custom decision function or placeholder string value that determines when to use the default value instead of the route parameter.\n */\n @Input()\n set dbxRouteModelIdDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, Input, inject } from '@angular/core';\nimport { type Maybe, type ModelKey } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, type SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';\nimport { dbxRouteModelKeyParamRedirect } from './id.param.redirect';\nimport { clean, cleanSubscription } from '../../rxjs';\nimport { DbxRouterService } from '../router/service/router.service';\nimport { DbxRouteModelKeyDirectiveDelegate } from './model.router';\n\n/**\n * Directive that reads a model key from the current route's parameters and passes it to a {@link DbxRouteModelKeyDirectiveDelegate}.\n *\n * Functions identically to {@link DbxRouteModelIdDirective} but uses a \"key\" parameter (defaulting to `'key'`)\n * instead of \"id\". Supports configurable parameter key, default value, redirect behavior, and custom decision logic.\n *\n * @example\n * ```html\n * <!-- Basic usage: reads \"key\" param from route and passes to delegate -->\n * <div dbxRouteModelKey></div>\n *\n * <!-- Custom param key -->\n * <div [dbxRouteModelKey]=\"'slug'\"></div>\n *\n * <!-- With default value and redirect disabled -->\n * <div dbxRouteModelKey [dbxRouteModelKeyDefault]=\"defaultKey$\" [dbxRouteModelKeyDefaultRedirect]=\"false\"></div>\n * ```\n *\n * @see {@link DbxRouteModelKeyDirectiveDelegate} for the delegate that receives the key observables\n * @see {@link dbxRouteModelKeyParamRedirect} for the underlying redirect logic\n * @see {@link DbxRouteModelIdDirective} for the id-based equivalent\n */\n@Directive({\n selector: '[dbxRouteModelKey]',\n standalone: true\n})\nexport class DbxRouteModelKeyDirective {\n readonly dbxRouterService = inject(DbxRouterService);\n readonly dbxRouteModelKeyDelegate = inject(DbxRouteModelKeyDirectiveDelegate, { host: true });\n\n private readonly _redirectInstance = clean(dbxRouteModelKeyParamRedirect(this.dbxRouterService));\n\n readonly keyFromParams$: Observable<Maybe<ModelKey>> = this._redirectInstance.paramValue$;\n readonly key$: Observable<Maybe<ModelKey>> = this._redirectInstance.value$;\n\n constructor() {\n cleanSubscription(this.dbxRouteModelKeyDelegate.useRouteModelKeyParamsObservable(this.keyFromParams$, this.key$));\n this._redirectInstance.init();\n }\n\n // MARK: Input\n @Input('dbxRouteModelKey')\n get keyParam() {\n return this._redirectInstance.getParamKey();\n }\n\n set keyParam(idParam: string) {\n this._redirectInstance.setParamKey(idParam);\n }\n\n /**\n * Default model key value to use when the route parameter matches the placeholder or is absent.\n */\n @Input()\n set dbxRouteModelKeyDefault(defaultValue: MaybeObservableOrValueGetter<ModelKey>) {\n this._redirectInstance.setDefaultValue(defaultValue);\n }\n\n /**\n * Whether or not to enable the redirection. Is enabled by default.\n */\n @Input()\n set dbxRouteModelKeyDefaultRedirect(redirect: Maybe<boolean> | '') {\n this._redirectInstance.setRedirectEnabled(redirect !== false); // true by default\n }\n\n /**\n * Custom decision function or placeholder string value that determines when to use the default value instead of the route parameter.\n */\n @Input()\n set dbxRouteModelKeyDefaultDecision(decider: string | SwitchMapToDefaultFilterFunction<ModelKey>) {\n this._redirectInstance.setDecider(decider);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { asObservableFromGetter, type ObservableOrValueGetter } from '@dereekb/rxjs';\nimport { type Observable } from 'rxjs';\n\n/**\n * Converts an {@link ObservableOrValueGetter} into an {@link Observable}.\n *\n * Useful for normalizing values that may be plain values, getter functions, or Observables\n * into a consistent Observable stream for use with the `async` pipe.\n *\n * @example\n * ```html\n * <span>{{ valueOrGetter | asObservable | async }}</span>\n * ```\n */\n@Pipe({\n name: 'asObservable',\n standalone: true\n})\nexport class AsObservablePipe implements PipeTransform {\n transform<T>(input: ObservableOrValueGetter<T>): Observable<T> {\n return asObservableFromGetter(input);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToDayRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a human-readable day range string using {@link formatToDayRangeString}.\n *\n * Displays only the date portion (no times). Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateDayRange }}</span>\n * <!-- Output: \"Jan 5 - Jan 8\" -->\n *\n * <span>{{ nullRange | dateDayRange:'No dates' }}</span>\n * <!-- Output: \"No dates\" -->\n * ```\n */\n@Pipe({\n name: 'dateDayRange',\n standalone: true,\n pure: true\n})\nexport class DateDayRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { isValid } from 'date-fns';\nimport { Pipe, type PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\n\n/**\n * Converts a {@link DateOrDateString} value to a JavaScript {@link Date} object using {@link toJsDate}.\n *\n * Returns `undefined` if the input is `null`, `undefined`, or results in an invalid date.\n * Also provides a static `toJsDate()` method used by other pipes in this package.\n *\n * @example\n * ```html\n * <span>{{ '2024-01-05T12:00:00Z' | toJsDate | date:'short' }}</span>\n * <!-- Output: \"1/5/24, 12:00 PM\" -->\n *\n * <span>{{ dateOrString | toJsDate | date:'fullDate' }}</span>\n * ```\n */\n@Pipe({\n name: 'toJsDate',\n standalone: true,\n pure: true\n})\nexport class ToJsDatePipe implements PipeTransform {\n public static toJsDate(input: DateOrDateString): Date;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date>;\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n let date: Maybe<Date>;\n\n if (input != null) {\n date = toJsDate(input);\n\n if (!isValid(date)) {\n date = undefined;\n }\n }\n\n return date;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { formatDateDistance } from '@dereekb/date';\n\n/**\n * Formats a date as a human-readable distance string relative to another date (or now) using {@link formatDateDistance}.\n *\n * Accepts an optional comparison date (defaults to now) and a fallback string for `null`/`undefined` input.\n *\n * @example\n * ```html\n * <span>{{ someDate | dateDistance }}</span>\n * <!-- Output: \"3 hours ago\" -->\n *\n * <span>{{ someDate | dateDistance:referenceDate }}</span>\n * <!-- Output: \"2 days ago\" -->\n *\n * <span>{{ nullDate | dateDistance:null:'Unknown' }}</span>\n * <!-- Output: \"Unknown\" -->\n * ```\n */\n@Pipe({\n name: 'dateDistance',\n standalone: true,\n pure: false\n})\nexport class DateDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, inputTo?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n const to = inputTo ?? new Date();\n const from = ToJsDatePipe.toJsDate(input);\n return formatDateDistance(to, from);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { type DateOrDateString, type Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Formats a date using a locale-aware format string and appends the relative distance to now in parentheses.\n *\n * Returns `undefined` if the input is falsy or not a valid date.\n *\n * @example\n * ```html\n * <span>{{ someDate | dateFormatDistance:'MMM d, y' }}</span>\n * <!-- Output: \"Jan 5, 2024 (3 days ago)\" -->\n *\n * <span>{{ someDate | dateFormatDistance:'short':true }}</span>\n * <!-- Output: \"1/5/24, 2:30 PM (about 3 days ago)\" with includeSeconds enabled -->\n * ```\n */\n@Pipe({\n name: 'dateFormatDistance',\n standalone: true,\n pure: false\n})\nexport class DateFormatDistancePipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n transform(input: Maybe<DateOrDateString>, format: string, includeSeconds = false): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n\n if (isValid(date)) {\n const dateString = formatDate(date, format, this.locale);\n\n const distance = formatDistanceToNow(date, {\n includeSeconds,\n addSuffix: true\n });\n\n return `${dateString} (${distance})`;\n }\n }\n\n return undefined;\n }\n}\n","import { addMinutes } from 'date-fns';\nimport { Pipe, type PipeTransform, LOCALE_ID, inject } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { type Maybe, type DateOrDateString, type Minutes } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Formats a date as a \"from - to\" time range string given a start date, format string, and duration in minutes.\n *\n * The start date is formatted using the Angular locale-aware {@link formatDate}, and the end time\n * is computed by adding the given minutes and formatted as a time-only string.\n *\n * @example\n * ```html\n * <span>{{ eventStart | dateFormatFromTo:'MMM d, h:mm a':90 }}</span>\n * <!-- Output: \"Jan 5, 2:00 PM - 3:30 PM\" -->\n * ```\n */\n@Pipe({\n name: 'dateFormatFromTo',\n standalone: true,\n pure: true\n})\nexport class DateFormatFromToPipe implements PipeTransform {\n private readonly locale = inject(LOCALE_ID);\n\n // eslint-disable-next-line @typescript-eslint/max-params\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: Minutes, locale: string): Maybe<string> {\n if (input) {\n const date = toJsDate(input);\n const endDate = addMinutes(date, minutes);\n const dateString = formatDate(date, format, locale);\n return dateString + ' - ' + formatToTimeString(endDate);\n }\n\n return undefined;\n }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: Minutes): Maybe<string> {\n return DateFormatFromToPipe.formatFromTo(input, format, minutes, this.locale);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToDayTimeRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a human-readable day and time range string using {@link formatToDayTimeRangeString}.\n *\n * Includes both the date and time portions. Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateDayTimeRange }}</span>\n * <!-- Output: \"Jan 5, 2:00 PM - Jan 8, 4:00 PM\" -->\n *\n * <span>{{ nullRange | dateDayTimeRange:'No dates' }}</span>\n * <!-- Output: \"No dates\" -->\n * ```\n */\n@Pipe({\n name: 'dateDayTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateDayTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToDayTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a time range string using {@link formatToTimeRangeString}.\n *\n * Displays the date and time of both the start and end. Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateTimeRange }}</span>\n * <!-- Output: \"Jan 5, 2:00 PM - 4:00 PM\" -->\n *\n * <span>{{ nullRange | dateTimeRange:'TBD' }}</span>\n * <!-- Output: \"TBD\" -->\n * ```\n */\n@Pipe({\n name: 'dateTimeRange',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatDateDistance } from '@dereekb/date';\n\n/**\n * Formats a {@link Date} or {@link DateRange} as a human-readable distance string relative to now using {@link formatDateDistance}.\n *\n * This is an impure pipe that recalculates on every change detection cycle to keep the distance up to date.\n * Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ someDate | dateRangeDistance }}</span>\n * <!-- Output: \"3 hours ago\" -->\n *\n * <span>{{ nullDate | dateRangeDistance:'Unknown' }}</span>\n * <!-- Output: \"Unknown\" -->\n * ```\n */\n@Pipe({\n name: 'dateRangeDistance',\n standalone: true,\n pure: false\n})\nexport class DateRangeDistancePipe implements PipeTransform {\n transform(input: Maybe<Date | DateRange>, unavailable: string = 'Not Available'): string {\n if (input != null) {\n return formatDateDistance(input as Date, new Date());\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatToTimeRangeString } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a time-only range string using {@link formatToTimeRangeString} with the time-only flag enabled.\n *\n * Displays only the time portion (no date). Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateTimeRangeOnly }}</span>\n * <!-- Output: \"2:00 PM - 4:00 PM\" -->\n *\n * <span>{{ nullRange | dateTimeRangeOnly:'TBD' }}</span>\n * <!-- Output: \"TBD\" -->\n * ```\n */\n@Pipe({\n name: 'dateTimeRangeOnly',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyPipe implements PipeTransform {\n transform(input: Maybe<DateRange>, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatToTimeRangeString(input, undefined, true);\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts a target timezone date back to the equivalent system (UTC-based) date using {@link dateTimezoneUtcNormal}.\n *\n * This is the inverse of {@link SystemDateToTargetDatePipe}. Useful when you have a date representing\n * local time in a target timezone and need to convert it back to the system timezone.\n * Returns `undefined` if either the input date or timezone is falsy.\n *\n * @example\n * ```html\n * <span>{{ targetDate | targetDateToSystemDate:'America/New_York' | date:'short' }}</span>\n * <!-- Output: the date/time converted back to the system timezone -->\n * ```\n */\n@Pipe({\n name: 'targetDateToSystemDate',\n standalone: true,\n pure: false\n})\nexport class TargetDateToSystemDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).targetDateToSystemDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DateRange, formatDateRangeDistance, type FormatDateRangeDistanceFunctionConfig } from '@dereekb/date';\n\n/**\n * Formats a {@link DateRange} as a human-readable distance string using {@link formatDateRangeDistance}.\n *\n * Accepts an optional {@link FormatDateRangeDistanceFunctionConfig} to customize the output format.\n * Returns a fallback string when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ dateRange | dateTimeRangeOnlyDistance }}</span>\n * <!-- Output: \"3 hours\" -->\n *\n * <span>{{ dateRange | dateTimeRangeOnlyDistance:config }}</span>\n * <!-- Output varies based on config -->\n *\n * <span>{{ nullRange | dateTimeRangeOnlyDistance:null:'TBD' }}</span>\n * <!-- Output: \"TBD\" -->\n * ```\n */\n@Pipe({\n name: 'dateTimeRangeOnlyDistance',\n standalone: true,\n pure: true\n})\nexport class DateTimeRangeOnlyDistancePipe implements PipeTransform {\n transform(input: Maybe<DateRange>, config?: FormatDateRangeDistanceFunctionConfig, unavailable: string = 'Not Available'): string {\n if (input) {\n return formatDateRangeDistance(input, { ...config });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { getTimezoneAbbreviation } from '@dereekb/date';\n\n/**\n * Returns the abbreviated name for a timezone string (e.g., \"EST\", \"PDT\") using {@link getTimezoneAbbreviation}.\n *\n * Optionally accepts a reference date to determine the correct abbreviation (e.g., for daylight saving time).\n * Defaults to the current date if no reference date is provided.\n * Returns `undefined` if the timezone is falsy.\n *\n * @example\n * ```html\n * <span>{{ 'America/New_York' | timezoneAbbreviation }}</span>\n * <!-- Output: \"EST\" or \"EDT\" depending on the current date -->\n *\n * <span>{{ timezone | timezoneAbbreviation:referenceDate }}</span>\n * <!-- Output: abbreviation for the timezone at the given reference date -->\n * ```\n */\n@Pipe({\n name: 'timezoneAbbreviation',\n standalone: true,\n pure: false\n})\nexport class TimezoneAbbreviationPipe implements PipeTransform {\n transform(timezone: Maybe<TimezoneString>, input?: Maybe<Date>): Maybe<string> {\n if (timezone) {\n return getTimezoneAbbreviation(timezone, input ?? undefined);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type TimezoneString, type Maybe } from '@dereekb/util';\nimport { dateTimezoneUtcNormal } from '@dereekb/date';\n\n/**\n * Converts a system (UTC-based) date to the equivalent local date in the given timezone using {@link dateTimezoneUtcNormal}.\n *\n * This is useful when you have a date in the system's timezone and need to display it as if it were in the target timezone.\n * Returns `undefined` if either the input date or timezone is falsy.\n *\n * @example\n * ```html\n * <span>{{ systemDate | systemDateToTargetDate:'America/New_York' | date:'short' }}</span>\n * <!-- Output: the date/time as it appears in the New York timezone -->\n * ```\n */\n@Pipe({\n name: 'systemDateToTargetDate',\n standalone: true,\n pure: false\n})\nexport class SystemDateToTargetDatePipe implements PipeTransform {\n transform(input: Maybe<Date>, timezone: Maybe<TimezoneString>): Maybe<Date> {\n if (input && timezone) {\n return dateTimezoneUtcNormal({ timezone }).systemDateToTargetDate(input);\n } else {\n return undefined;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe, type Minutes, MINUTES_IN_DAY, MINUTES_IN_HOUR } from '@dereekb/util';\n\n/**\n * Converts a numeric minute value into a human-readable duration string with automatic unit scaling.\n *\n * - Values over 3600 minutes are displayed as days (e.g., \"~2 days\")\n * - Values over 180 minutes are displayed as hours (e.g., \"~4 hours\")\n * - Values at or below 180 minutes are displayed as minutes (e.g., \"90 minutes\")\n *\n * A `~` prefix is added when the value is rounded up. Returns `undefined` for `null` or non-numeric input.\n *\n * @example\n * ```html\n * <span>{{ 90 | minutesString }}</span>\n * <!-- Output: \"90 minutes\" -->\n *\n * <span>{{ 250 | minutesString }}</span>\n * <!-- Output: \"~5 hours\" -->\n *\n * <span>{{ 5000 | minutesString }}</span>\n * <!-- Output: \"~4 days\" -->\n * ```\n */\n@Pipe({\n name: 'minutesString',\n standalone: true,\n pure: false\n})\nexport class MinutesStringPipe implements PipeTransform {\n transform(input: Maybe<Minutes | string>): Maybe<string> {\n const minutes = Number(input);\n\n let result: Maybe<string>;\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > MINUTES_IN_DAY * 2.5) {\n const unrounded = minutes / MINUTES_IN_DAY;\n const days = Math.ceil(unrounded);\n result = (unrounded !== days ? '~' : '') + days + ' days';\n } else if (minutes > MINUTES_IN_HOUR * 3) {\n const unrounded = minutes / MINUTES_IN_HOUR;\n const hours = Math.ceil(unrounded);\n result = (unrounded !== hours ? '~' : '') + hours + ' hours';\n } else {\n result = minutes + ' minutes';\n }\n }\n\n return result;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe, type DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n/**\n * Formats the distance from now to a future date as a countdown string.\n *\n * If the target date is in the past, returns the `soonString` (defaults to `\"Soon\"`).\n * Otherwise, returns a human-readable distance string with suffix (e.g., \"in 3 hours\").\n * Returns the `unavailable` string when the input is falsy.\n *\n * @example\n * ```html\n * <span>{{ futureDate | timeCountdownDistance }}</span>\n * <!-- Output: \"in 3 hours\" or \"Soon\" if past -->\n *\n * <span>{{ futureDate | timeCountdownDistance:'Imminent':'N/A' }}</span>\n * <!-- Output: \"Imminent\" if past, \"N/A\" if null -->\n * ```\n */\n@Pipe({\n name: 'timeCountdownDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, soonString: string = 'Soon', unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n\n if (isPast(from)) {\n return soonString;\n } else {\n const to = new Date();\n return formatDistance(from, to, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n}\n\n/**\n * Formats the distance between a date and a reference date (defaults to now) as a human-readable string with suffix.\n *\n * Uses date-fns {@link formatDistance} to produce output like \"3 hours ago\" or \"in 2 days\".\n * Returns the `unavailable` string when the input is falsy.\n *\n * @example\n * ```html\n * <span>{{ someDate | timeDistance }}</span>\n * <!-- Output: \"3 hours ago\" -->\n *\n * <span>{{ someDate | timeDistance:referenceDate }}</span>\n * <!-- Output: \"2 days ago\" (relative to referenceDate) -->\n *\n * <span>{{ nullDate | timeDistance:null:'Unknown' }}</span>\n * <!-- Output: \"Unknown\" -->\n * ```\n */\n@Pipe({\n name: 'timeDistance',\n standalone: true,\n pure: false\n})\nexport class TimeDistancePipe implements PipeTransform {\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input);\n return formatDistance(from, to ?? new Date(), {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Milliseconds, type Minutes, millisecondsToMinutes } from '@dereekb/util';\n\n/**\n * Converts a duration in milliseconds to whole minutes using {@link millisecondsToMinutes}.\n *\n * Returns the original value (0 or falsy) if the input is falsy.\n *\n * @example\n * ```html\n * <span>{{ 180000 | toMinutes }}</span>\n * <!-- Output: 3 -->\n *\n * <span>{{ durationMs | toMinutes }} min</span>\n * <!-- Output: \"5 min\" -->\n * ```\n */\n@Pipe({\n name: 'toMinutes',\n standalone: true,\n pure: true\n})\nexport class ToMinutesPipe implements PipeTransform {\n transform(milliseconds: Milliseconds): Minutes {\n let result: Minutes = milliseconds;\n\n if (milliseconds) {\n result = millisecondsToMinutes(milliseconds);\n }\n\n return result;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Formats a value as a pretty-printed JSON string using {@link JSON.stringify} with configurable indentation.\n *\n * Returns `undefined` for falsy input. If serialization fails, returns `'ERROR'` and logs the error to the console.\n *\n * @example\n * ```html\n * <pre>{{ myObject | prettyjson }}</pre>\n * <!-- Output: formatted JSON with 2-space indentation -->\n *\n * <pre>{{ myObject | prettyjson:4 }}</pre>\n * <!-- Output: formatted JSON with 4-space indentation -->\n * ```\n */\n@Pipe({\n name: 'prettyjson',\n standalone: true\n})\nexport class PrettyJsonPipe implements PipeTransform {\n public static toPrettyJson(input: Maybe<unknown>, spacing: number = 2): Maybe<string> {\n let json: Maybe<string>;\n\n if (input) {\n try {\n json = JSON.stringify(input, null, spacing);\n } catch {\n console.error('prettyjson pipe failed parsing input: ', input);\n json = 'ERROR';\n }\n }\n\n return json;\n }\n\n transform(input: Maybe<unknown>, spacing?: number): Maybe<string> {\n return PrettyJsonPipe.toPrettyJson(input, spacing);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { cutString, type Maybe } from '@dereekb/util';\n\n/**\n * Truncates the input string to a maximum length and appends an ellipsis (or custom suffix) using {@link cutString}.\n *\n * Returns the original value if the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ 'Hello World' | cutText:5 }}</span>\n * <!-- Output: \"Hello...\" -->\n *\n * <span>{{ longText | cutText:20:'--' }}</span>\n * <!-- Output: \"Some long text here--\" -->\n * ```\n */\n@Pipe({\n name: 'cutText',\n standalone: true,\n pure: true\n})\nexport class CutTextPipe implements PipeTransform {\n transform(input: Maybe<string>, maxLength: number, endText?: Maybe<string>): Maybe<string> {\n return input != null ? cutString(input, maxLength, endText) : input;\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { type GetterOrValue, getValueFromGetter } from '@dereekb/util';\n\n/**\n * Resolves a {@link GetterOrValue} to its underlying value using {@link getValueFromGetter}.\n *\n * This is an impure pipe that re-evaluates on every change detection cycle, making it suitable\n * for getter functions whose return value may change over time.\n * Use {@link GetValueOncePipe} (`getValueOnce`) for a pure alternative when the value is static.\n *\n * @example\n * ```html\n * <span>{{ myGetterOrValue | getValue }}</span>\n * <span>{{ myGetterFn | getValue:someArg }}</span>\n * ```\n */\n@Pipe({\n name: 'getValue',\n standalone: true,\n pure: false\n})\nexport class GetValuePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n\n/**\n * Resolves a {@link GetterOrValue} to its underlying value using {@link getValueFromGetter}.\n *\n * This is a pure pipe that only re-evaluates when the input reference changes.\n * Use {@link GetValuePipe} (`getValue`) if the getter function's return value may change between cycles.\n *\n * @example\n * ```html\n * <span>{{ myGetterOrValue | getValueOnce }}</span>\n * ```\n */\n@Pipe({\n name: 'getValueOnce',\n standalone: true,\n pure: true\n})\nexport class GetValueOncePipe implements PipeTransform {\n transform<T, A = any>(input: GetterOrValue<T>, args?: A): T {\n return getValueFromGetter(input as any, args);\n }\n}\n","import { Pipe, type PipeTransform } from '@angular/core';\nimport { dollarAmountString, type Maybe } from '@dereekb/util';\n\n/**\n * Formats a numeric value as a US dollar currency string using {@link dollarAmountString}.\n *\n * Optionally accepts a default string to display when the input is `null` or `undefined`.\n *\n * @example\n * ```html\n * <span>{{ 19.5 | dollarAmount }}</span>\n * <!-- Output: \"$19.50\" -->\n *\n * <span>{{ nullValue | dollarAmount:'N/A' }}</span>\n * <!-- Output: \"N/A\" -->\n * ```\n */\n@Pipe({\n name: 'dollarAmount',\n standalone: true,\n pure: true\n})\nexport class DollarAmountPipe implements PipeTransform {\n transform(input: Maybe<number>, defaultIfNull?: Maybe<string>): Maybe<string> {\n return defaultIfNull == null || input != null ? dollarAmountString(input) : defaultIfNull;\n }\n}\n","import { type Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive } from '@angular/core';\nimport { type FilterSourceConnector, type FilterSource, filterMaybe } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { completeOnDestroy } from '../rxjs';\n\n/**\n * Abstract directive implementing both {@link FilterSourceConnector} and {@link FilterSource}.\n *\n * Receives a filter source via {@link connectWithSource} and re-emits its filter values.\n * Subclass to create concrete connector directives.\n *\n * @typeParam F - The filter type.\n *\n * @example\n * ```html\n * <div dbxFilterSourceConnector>\n * <!-- Child components can inject FilterSource to read the connected filter -->\n * </div>\n * ```\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, FilterSource<F> {\n private readonly _source = completeOnDestroy(new BehaviorSubject<Maybe<FilterSource<F>>>(undefined));\n\n readonly filter$: Observable<F> = this._source.pipe(\n switchMap((x) => x?.filter$ ?? of(undefined)),\n filterMaybe(),\n shareReplay(1)\n );\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n}\n","import { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\nimport { forwardRef, type Provider, type Type } from '@angular/core';\n\n/**\n * Creates Angular providers that register a {@link FilterSource} implementation for DI.\n *\n * @param sourceType - The concrete filter source class to provide.\n * @returns An array of Angular providers for the filter source.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myFilterSource]',\n * providers: provideFilterSource(MyFilterSourceDirective),\n * })\n * export class MyFilterSourceDirective { ... }\n * ```\n */\nexport function provideFilterSource<S extends FilterSource>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n\n/**\n * Creates Angular providers that register both a {@link FilterSourceConnector} and {@link FilterSource} for DI.\n *\n * @param sourceType - The concrete connector class to provide.\n * @returns An array of Angular providers for the filter source connector.\n */\nexport function provideFilterSourceConnector<S extends FilterSourceConnector>(sourceType: Type<S>): Provider[] {\n return [\n {\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }\n ];\n}\n","import { type Observable } from 'rxjs';\nimport { Directive, forwardRef, inject, InjectionToken, Injector, type OnDestroy, type Provider, type Type } from '@angular/core';\nimport { type FilterSource, FilterSourceInstance, type MaybeObservableOrValue } from '@dereekb/rxjs';\nimport { type Maybe } from '@dereekb/util';\nimport { provideFilterSource } from './filter.content';\n\n/**\n * DI token for providing a default filter value to {@link AbstractFilterSourceDirective}.\n */\nexport const FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN = new InjectionToken<Maybe<Observable<Maybe<unknown>>>>('FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_SOURCE_TOKEN');\n\n/**\n * Abstract class defining the contract for a filter source directive that can be set, reset, and initialized with filters.\n *\n * @typeParam F - The filter type.\n */\nexport abstract class FilterSourceDirective<F = unknown> implements FilterSource<F> {\n abstract readonly filter$: Observable<F>;\n abstract initWithFilter(filterObs: Observable<F>): void;\n abstract setFilter(filter: F): void;\n abstract resetFilter(): void;\n}\n\n/**\n * Factory function type for creating a default filter value, given access to the Angular injector.\n *\n * @typeParam F - The filter type.\n */\nexport type ProvideFilterSourceDirectiveDefaultFilterFactoryFunction<F = unknown> = (injector: Injector) => MaybeObservableOrValue<F>;\n\n/**\n * Creates Angular providers for a {@link FilterSourceDirective} implementation,\n * with an optional factory for providing a default filter value.\n *\n * @param sourceType - The concrete directive class.\n * @param defaultFilterFactory - Optional factory to provide an initial filter value via DI.\n * @returns An array of Angular providers for the filter source directive.\n *\n * @example\n * ```typescript\n * @Directive({\n * selector: '[myFilterSource]',\n * providers: provideFilterSourceDirective(MyFilterSourceDirective),\n * })\n * export class MyFilterSourceDirective extends AbstractFilterSourceDirective<MyFilter> {}\n * ```\n */\nexport function provideFilterSourceDirective<S extends FilterSourceDirective<F>, F = unknown>(sourceType: Type<S>, defaultFilterFactory?: ProvideFilterSourceDirectiveDefaultFilterFactoryFunction): Provider[] {\n const providers = [\n {\n provide: FilterSourceDirective,\n useExisting: forwardRef(() => sourceType)\n },\n ...provideFilterSource(sourceType)\n ];\n\n if (defaultFilterFactory != null) {\n providers.push({\n provide: FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN,\n useFactory: defaultFilterFactory,\n deps: [Injector]\n });\n }\n\n return providers;\n}\n\n/**\n * Abstract directive providing a complete {@link FilterSource} implementation backed by a {@link FilterSourceInstance}.\n *\n * Supports setting/resetting filters, initializing from an external observable, and providing\n * a default filter via the {@link FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN} DI token.\n *\n * @typeParam F - The filter type.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F = unknown> implements FilterSourceDirective<F>, OnDestroy {\n private readonly _defaultFilter = inject<MaybeObservableOrValue<F>>(FILTER_SOURCE_DIRECTIVE_DEFAULT_FILTER_TOKEN, { optional: true });\n\n protected readonly _defaultFilterSource = new FilterSourceInstance<F>({\n defaultFilter: this._defaultFilter\n });\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\n }\n\n protected setDefaultFilter(defaultFilter: Observable<Maybe<F>>): void {\n this._defaultFilterSource.setDefaultFilter(defaultFilter);\n console.log('Setting default filter: ', defaultFilter);\n }\n\n initWithFilter(filterObs: Observable<F>): void {\n this._defaultFilterSource.initWithFilter(filterObs);\n }\n\n setFilter(filter: F): void {\n this._defaultFilterSource.setFilter(filter);\n }\n\n resetFilter(): void {\n this._defaultFilterSource.resetFilter();\n }\n\n setInitialFilterTakesPriority(initialFilterTakesPriority: boolean) {\n this._defaultFilterSource.setInitialFilterTakesPriority(initialFilterTakesPriority);\n }\n}\n","import { Directive, type OnInit, inject } from '@angular/core';\nimport { FilterSource, FilterSourceConnector } from '@dereekb/rxjs';\n\n/**\n * Connects the host element's {@link FilterSource} to an ancestor {@link FilterSourceConnector} on initialization.\n *\n * Place on an element that has a `FilterSource` (via `host: true`) to automatically\n * wire it up to a parent `FilterSourceConnector`.\n *\n * @example\n * ```html\n * <div dbxFilterSourceConnector>\n * <my-filter-form dbxFilterSource dbxFilterConnectSource></my-filter-form>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterConnectSource]',\n standalone: true\n})\nexport class DbxFilterConnectSourceDirective<F = unknown> implements OnInit {\n readonly filterSource = inject(FilterSource<F>, { host: true });\n readonly filterSourceConnector = inject(FilterSourceConnector<F>);\n\n ngOnInit(): void {\n this.filterSourceConnector.connectWithSource(this.filterSource);\n }\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\n\n/**\n * Concrete directive that acts as both a {@link FilterSource} and {@link FilterSourceConnector}.\n *\n * Place on an element to bridge a filter source from one part of the template to another.\n *\n * @example\n * ```html\n * <div dbxFilterSourceConnector>\n * <my-list-component></my-list-component>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [...provideFilterSource(DbxFilterSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterSourceConnectorDirective<F = unknown> extends AbstractFilterSourceConnectorDirective<F> {}\n","import { filterMaybe, type FilterMapKey, FilterMap, type MaybeObservableOrValue, maybeValueFromObservableOrValue } from '@dereekb/rxjs';\nimport { Directive, type OnDestroy, inject } from '@angular/core';\nimport { BehaviorSubject, distinctUntilChanged } from 'rxjs';\n\n/**\n * Abstract directive that resolves a specific filter instance from a parent {@link FilterMap} by key.\n *\n * Subclasses set the key via {@link setFilterMapKey} and access the resolved instance via `instance$`.\n *\n * @typeParam F - The filter type.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n readonly dbxFilterMap = inject(FilterMap<F>);\n private readonly _currentFilterMapKey = new BehaviorSubject<MaybeObservableOrValue<FilterMapKey>>(undefined);\n\n readonly filterMapKey$ = this._currentFilterMapKey.pipe(maybeValueFromObservableOrValue(), filterMaybe(), distinctUntilChanged());\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.filterMapKey$);\n\n ngOnDestroy(): void {\n this._currentFilterMapKey.complete();\n }\n\n setFilterMapKey(filterMapKey: MaybeObservableOrValue<FilterMapKey>) {\n this._currentFilterMapKey.next(filterMapKey);\n }\n}\n","import { type FilterSource, type FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, type Observable } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { provideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Abstract directive that extends {@link AbstractDbxFilterMapInstanceDirective} to also implement {@link FilterSource},\n * emitting the filter values from the resolved filter map instance.\n *\n * @typeParam F - The filter type.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap((x) => x.filter$));\n\n initWithFilter(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n}\n\n/**\n * Concrete directive that provides a {@link FilterSource} from a keyed entry in a parent {@link FilterMap}.\n *\n * @example\n * ```html\n * <div dbxFilterMap>\n * <div [dbxFilterMapSource]=\"'listFilter'\">\n * <my-filtered-list></my-filtered-list>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [provideFilterSource(DbxFilterMapSourceDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSource<F> {\n readonly dbxFilterMapSource = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSource()));\n}\n","import { first } from 'rxjs';\nimport { Directive, effect, input } from '@angular/core';\nimport { type FilterSourceConnector, type FilterSource, type FilterMapKey } from '@dereekb/rxjs';\nimport { provideFilterSource, provideFilterSourceConnector } from './filter.content';\nimport { AbstractDbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Directive that acts as both a {@link FilterSourceConnector} and {@link FilterSource} for a keyed entry in a parent {@link FilterMap}.\n *\n * Connects an external filter source to a specific filter map entry and re-emits that entry's filter.\n *\n * @example\n * ```html\n * <div dbxFilterMap>\n * <div [dbxFilterMapSourceConnector]=\"'myList'\">\n * <my-list-component></my-list-component>\n * </div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [...provideFilterSource(DbxFilterMapSourceConnectorDirective), ...provideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)],\n standalone: true\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends AbstractDbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n readonly dbxFilterMapSourceConnector = input<Maybe<FilterMapKey>>();\n protected readonly _dbxFilterMapSourceConnectorEffect = effect(() => this.setFilterMapKey(this.dbxFilterMapSourceConnector()));\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => {\n x.connectWithSource(filterSource);\n\n if (filterSource.initWithFilter) {\n filterSource.initWithFilter(this.filter$);\n }\n });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\nimport { clean } from '../rxjs/clean';\n\n/**\n * Directive that provides a {@link FilterMap} instance for managing multiple named filter sources.\n *\n * Child directives like `dbxFilterMapSource` and `dbxFilterMapSourceConnector` look up this\n * map via DI to register and retrieve filter instances by key.\n *\n * @example\n * ```html\n * <div dbxFilterMap>\n * <div [dbxFilterMapSource]=\"'listA'\">...</div>\n * <div [dbxFilterMapSource]=\"'listB'\">...</div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap],\n standalone: true\n})\nexport class DbxFilterMapDirective<F> {\n readonly filterMap = clean(inject(FilterMap<F>));\n}\n","import { type FilterPresetStringRef, type FilterWithPreset, type FilterWithPresetOptional } from '@dereekb/rxjs';\nimport { type EmptyObject, type GetterOrValue, type Maybe, objectHasKey, objectHasKeys } from '@dereekb/util';\nimport { type ClickableAnchorLink } from '../router/anchor/anchor';\n\n/**\n * A clickable preset that applies a predefined filter value when selected.\n *\n * Combines display properties (title, icon, disabled) with a filter preset value.\n * A `null` or empty `presetValue` resets the filter.\n *\n * @typeParam F - The filter type, which must include a preset field.\n * @typeParam P - The preset string identifier type.\n *\n * @example\n * ```typescript\n * const preset: ClickableFilterPreset<MyFilter> = {\n * preset: 'active',\n * title: 'Active Items',\n * icon: 'check',\n * presetValue: { status: 'active', preset: 'active' },\n * };\n * ```\n */\nexport interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef<P> {\n /**\n * GetterOrValue that retrieves the filter for this preset.\n *\n * A null value or empty object is used for reset.\n */\n readonly presetValue: GetterOrValue<FilterWithPresetOptional<F>> | EmptyObject | null;\n}\n\n/**\n * Type guard that checks if an object is a {@link ClickableFilterPreset}.\n *\n * @param preset - The object to check.\n * @returns `true` if the object has a `presetValue` property.\n */\nexport function isClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string>(preset: object): preset is ClickableFilterPreset<F, P> {\n return objectHasKey(preset, 'presetValue');\n}\n\n/**\n * A clickable preset that applies a partial filter modification when selected,\n * with an `isActive` predicate to determine whether the preset is currently active.\n *\n * Unlike {@link ClickableFilterPreset}, this merges a partial value rather than replacing the full filter.\n *\n * @typeParam F - The filter type.\n */\nexport interface ClickablePartialFilterPreset<F> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'> {\n /**\n * GetterOrValue that retrieves the partial filter value.\n *\n * A null value or empty object is used for no change.\n */\n readonly partialPresetValue: GetterOrValue<Partial<F>> | EmptyObject | null;\n /**\n * The current value to test against. Returns true if this partial preset is considered active.\n */\n readonly isActive: (currentFilter: Maybe<Partial<F>>) => boolean;\n}\n\n/**\n * Type guard that checks if an object is a {@link ClickablePartialFilterPreset}.\n *\n * @param preset - The object to check.\n * @returns `true` if the object has `partialPresetValue` and `isActive` properties.\n */\nexport function isClickablePartialFilterPreset<F>(preset: object): preset is ClickablePartialFilterPreset<F> {\n return objectHasKeys(preset, ['partialPresetValue', 'isActive']);\n}\n\n/**\n * Convenience type for either a ClickableFilterPreset or a ClickablePartialFilterPreset of the same type.\n */\nexport type ClickableFilterPresetOrPartialPreset<F extends FilterWithPreset<P>, P extends string = string> = ClickableFilterPreset<F, P> | ClickablePartialFilterPreset<F>;\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceDirective, provideFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Provides a {@link FilterSource} in the DI tree, allowing child components to inject and consume filter state.\n *\n * @example\n * ```html\n * <div dbxFilterSource>\n * <my-list-component></my-list-component>\n * </div>\n * ```\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: provideFilterSourceDirective(DbxFilterSourceDirective),\n standalone: true\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {}\n","import { NgModule } from '@angular/core';\nimport { DbxFilterMapDirective } from './filter.map.directive';\nimport { DbxFilterMapSourceConnectorDirective } from './filter.map.connector.directive';\nimport { DbxFilterSourceDirective } from './filter.source.directive';\nimport { DbxFilterSourceConnectorDirective } from './filter.connector.directive';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { DbxFilterConnectSourceDirective } from './filter.connect.source.directive';\n\nconst importsAndExports = [DbxFilterSourceDirective, DbxFilterMapSourceConnectorDirective, DbxFilterConnectSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterMapDirective, DbxFilterMapSourceDirective];\n\n@NgModule({\n imports: importsAndExports,\n exports: importsAndExports\n})\nexport class DbxCoreFilterModule {}\n","import { InjectionToken, type Injector, type NgModuleRef, type StaticProvider, type TemplateRef, type Type, type ViewRef } from '@angular/core';\nimport { type Configurable, type EqualityComparatorFunction, type FactoryWithRequiredInput, filterMaybeArrayValues, type Maybe, mergeArrays, mergeObjects, safeEqualityComparatorFunction } from '@dereekb/util';\n\n/**\n * Injection token used to provide arbitrary data to dynamically created components.\n *\n * Components created via {@link DbxInjectionComponentConfig} can inject this token\n * to access the `data` property from their configuration.\n *\n * @example\n * ```typescript\n * // In a dynamically injected component:\n * readonly data = inject(DBX_INJECTION_COMPONENT_DATA);\n * ```\n */\nexport const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');\n\n/**\n * Configuration for dynamically creating and injecting an Angular component into a view container.\n *\n * This is the primary configuration interface for the dbx-injection system. It describes which component\n * to create, how to configure its dependency injection context, and how to initialize it after creation.\n *\n * @typeParam T - The type of the component being created.\n *\n * @see {@link DbxInjectionInstance} - The runtime engine that processes this configuration.\n * @see {@link DbxInjectionComponent} - The component that accepts this configuration as an input.\n *\n * @example\n * ```typescript\n * const config: DbxInjectionComponentConfig<MyComponent> = {\n * componentClass: MyComponent,\n * data: { id: 123 },\n * init: (instance) => { instance.title = 'Hello'; }\n * };\n * ```\n */\nexport interface DbxInjectionComponentConfig<T = unknown> {\n /**\n * The Angular component class to dynamically instantiate.\n */\n readonly componentClass: Type<T>;\n /**\n * Optional static providers to add to the injector used when creating the component.\n *\n * These providers are merged with any data provider and made available to the created component.\n */\n readonly providers?: Maybe<StaticProvider[]>;\n /**\n * Optional custom parent injector to use when creating the component.\n *\n * When not provided, the injector from the host {@link DbxInjectionInstance} is used.\n */\n readonly injector?: Maybe<Injector>;\n /**\n * Optional NgModule reference to associate with the created component.\n *\n * Useful when the component belongs to a lazily loaded module.\n */\n readonly ngModuleRef?: NgModuleRef<unknown>;\n /**\n * Optional initialization callback invoked after the component is created.\n *\n * This is called within the Angular injection context of the created component,\n * so `inject()` is available and any `DestroyRef` callbacks registered inside\n * will be cleaned up when the created component is destroyed.\n */\n readonly init?: Maybe<(instance: T) => void>;\n /**\n * Optional arbitrary data to inject into the component via the {@link DBX_INJECTION_COMPONENT_DATA} token.\n */\n readonly data?: Maybe<unknown>;\n}\n\n/**\n * A variant of {@link DbxInjectionComponentConfig} that omits the `injector` property.\n *\n * Used in scenarios where the injection site controls the parent injector and does not\n * allow the configuration to override it (e.g., when the host component must be the injection root).\n *\n * @typeParam T - The type of the component being created.\n */\nexport type DbxInjectionComponentConfigWithoutInjector<T = unknown> = Omit<DbxInjectionComponentConfig<T>, 'injector'>;\n\n/**\n * A factory function that produces a {@link DbxInjectionComponentConfig} from a required input value.\n *\n * @typeParam I - The input type required by the factory.\n * @typeParam T - The type of the component the produced config will create.\n */\nexport type DbxInjectionComponentConfigFactory<I, T = unknown> = FactoryWithRequiredInput<DbxInjectionComponentConfig<T>, I>;\n\n/**\n * Configuration for injecting a template or view reference into a view container.\n *\n * This is an alternative to {@link DbxInjectionComponentConfig} for cases where you want to\n * display a pre-existing template or view rather than dynamically creating a component.\n *\n * @typeParam T - The context type of the template reference.\n *\n * @example\n * ```typescript\n * const config: DbxInjectionTemplateConfig = {\n * templateRef: myTemplateRef\n * };\n * ```\n */\nexport interface DbxInjectionTemplateConfig<T = unknown> {\n /**\n * An Angular `TemplateRef` to render as an embedded view.\n */\n readonly templateRef?: Maybe<TemplateRef<T>>;\n /**\n * A pre-existing `ViewRef` to insert into the container.\n */\n readonly viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Compares two {@link DbxInjectionComponentConfig} values for structural equality, safely handling nullish values.\n *\n * Compares `componentClass`, `data`, `init`, and `injector` by reference. Does NOT compare\n * `providers` or `ngModuleRef`, as provider arrays typically change on every list data update\n * (e.g., with new `DBX_VALUE_LIST_VIEW_ITEM` values) without requiring component recreation.\n *\n * When both values are nullish, uses strict equality (`null === null` is `true`,\n * `null === undefined` is `false`). The comparator is only invoked when both are non-nullish.\n */\nexport const dbxInjectionComponentConfigIsEqual: EqualityComparatorFunction<Maybe<DbxInjectionComponentConfig<any>>> = safeEqualityComparatorFunction((a, b) => a.componentClass === b.componentClass && a.data === b.data && a.init === b.init && a.injector === b.injector);\n\n/**\n * Merges multiple partial {@link DbxInjectionComponentConfig} objects into a single configuration.\n *\n * Provider arrays are concatenated so that all providers from all configs are preserved.\n * All other properties are merged with later values taking precedence.\n *\n * @param configs - An array of partial configs to merge. May contain `undefined`/`null` entries which are filtered out.\n * @returns A single merged partial configuration.\n */\nexport function mergeDbxInjectionComponentConfigs<T = unknown>(configs: Maybe<Partial<DbxInjectionComponentConfig<T>>>[]): Partial<DbxInjectionComponentConfig<T>> {\n const providers = mergeArrays(filterMaybeArrayValues(configs).map((x) => x.providers));\n const result = mergeObjects(configs) as Configurable<DbxInjectionComponentConfig<T>>;\n result.providers = providers;\n return result;\n}\n","import { type StaticProvider } from '@angular/core';\nimport { type ArrayOrValue, flattenArrayOrValueArray, type Maybe } from '@dereekb/util';\n\n/**\n * Flattens and merges multiple provider sources into a single `StaticProvider[]` array.\n *\n * Each argument can be a single `StaticProvider`, an array of providers, or `undefined`/`null`.\n * All values are flattened into a single array with nullish entries removed.\n *\n * @param providers - Any number of provider values or arrays to merge.\n * @returns A flat array of all non-nullish static providers.\n *\n * @example\n * ```typescript\n * const providers = mergeStaticProviders(\n * { provide: TOKEN_A, useValue: 'a' },\n * undefined,\n * [{ provide: TOKEN_B, useValue: 'b' }]\n * );\n * // Result: [{ provide: TOKEN_A, useValue: 'a' }, { provide: TOKEN_B, useValue: 'b' }]\n * ```\n */\nexport function mergeStaticProviders(...providers: Maybe<ArrayOrValue<StaticProvider>>[]): StaticProvider[] {\n return flattenArrayOrValueArray<StaticProvider>(providers);\n}\n","import { type ComponentRef, Injector, runInInjectionContext, type ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay, BehaviorSubject, combineLatest } from 'rxjs';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig, DBX_INJECTION_COMPONENT_DATA, dbxInjectionComponentConfigIsEqual } from './injection';\nimport { type Initialized, type Destroyable, type Maybe } from '@dereekb/util';\nimport { type MaybeObservableOrValueGetter, SubscriptionObject, filterMaybe, maybeValueFromObservableOrValueGetter, skipAllInitialMaybe } from '@dereekb/rxjs';\nimport { mergeStaticProviders } from './injection.util';\n\n/**\n * Core runtime engine for the dbx-injection system. Manages the lifecycle of dynamically injected\n * components and templates within an Angular `ViewContainerRef`.\n *\n * This class reactively listens to configuration and template observables. When a new\n * {@link DbxInjectionComponentConfig} or {@link DbxInjectionTemplateConfig} is emitted, it tears\n * down the previous content and creates the new component or template in the target view container.\n *\n * Component configs take precedence over template configs when both are provided.\n *\n * Typically used internally by {@link AbstractDbxInjectionDirective} and {@link DbxInjectionComponent}\n * rather than consumed directly.\n *\n * @typeParam T - The type of the dynamically created component.\n *\n * @see {@link DbxInjectionComponentConfig}\n * @see {@link DbxInjectionTemplateConfig}\n * @see {@link AbstractDbxInjectionDirective}\n */\nexport class DbxInjectionInstance<T> implements Initialized, Destroyable {\n private readonly _subscriptionObject = new SubscriptionObject();\n\n private readonly _config = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>>(undefined);\n private readonly _template = new BehaviorSubject<MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>>(undefined);\n\n private readonly _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private readonly _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n private readonly _injector: Injector;\n\n readonly config$ = this._config.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(dbxInjectionComponentConfigIsEqual), shareReplay(1));\n readonly template$ = this._template.pipe(maybeValueFromObservableOrValueGetter(), distinctUntilChanged(), shareReplay(1));\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: MaybeObservableOrValueGetter<DbxInjectionComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: MaybeObservableOrValueGetter<DbxInjectionTemplateConfig<T>>) {\n this._template.next(template);\n }\n\n get content(): Maybe<Maybe<ViewContainerRef>> {\n return this._content.value;\n }\n\n set content(content: Maybe<Maybe<ViewContainerRef>>) {\n this._content.next(content);\n }\n\n get componentRef(): Maybe<ComponentRef<T>> {\n return this._componentRef.value;\n }\n\n set componentRef(componentRef: Maybe<ComponentRef<T>>) {\n this._componentRef.next(componentRef);\n }\n\n constructor(injector: Injector) {\n this._injector = injector;\n }\n\n init(): void {\n // Wait until the first of either of the two inputs comes in as not defined, and then emit.\n // We filter the first maybe here between the two items.\n const configTemplateObs = combineLatest([this.config$, this.template$]).pipe(\n map(([config, template]) => {\n if (config || template) {\n return {\n config,\n template\n };\n } else {\n return undefined;\n }\n }),\n skipAllInitialMaybe()\n );\n\n this._subscriptionObject.subscription = combineLatest([configTemplateObs, this.content$]).subscribe(([inputConfig, content]) => {\n const { config, template } = inputConfig ?? {};\n this._reset(content);\n\n if (config) {\n this._initComponent(config, content);\n } else if (template) {\n this._initTemplate(template, content);\n }\n });\n }\n\n destroy(): void {\n this._subscriptionObject.destroy();\n this._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectionComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n if (!componentClass) {\n throw new Error('DbxInjectionInstance: componentClass was expected in the config but it was unavailable.');\n }\n\n const parentInjector = inputInjector ?? this._injector;\n let injector: Injector | undefined = parentInjector;\n\n if (providers || data) {\n const dataProvider = {\n provide: DBX_INJECTION_COMPONENT_DATA,\n useValue: data\n };\n\n injector = Injector.create({\n parent: parentInjector,\n providers: mergeStaticProviders(dataProvider, providers)\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n const instance = componentRef.instance;\n\n if (init) {\n runInInjectionContext(componentRef.injector, () => init(instance));\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectionTemplateConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { templateRef, viewRef } = config;\n\n if (templateRef) {\n content.createEmbeddedView(templateRef);\n\n // TODO: Figure out if these items need to be destroyed or not when this item is destroyed. If so, we need a reference to destroy.\n } else if (viewRef) {\n content.insert(viewRef);\n }\n }\n\n private _reset(content: ViewContainerRef): void {\n if (this.componentRef) {\n content.clear();\n this.componentRef = undefined;\n }\n }\n}\n","import { type ViewContainerRef, type OnInit, type OnDestroy, Directive, Injector, inject } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig } from './injection';\nimport { DbxInjectionInstance as DbxInjectionInstance } from './injection.instance';\nimport { type ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Abstract base directive for dynamically injecting components or templates into a view.\n *\n * Manages a {@link DbxInjectionInstance} lifecycle, initializing it on `ngOnInit` and\n * destroying it on `ngOnDestroy`. Subclasses are responsible for wiring their inputs\n * (config, template, content) to the corresponding setter methods.\n *\n * @typeParam T - The type of the dynamically created component.\n *\n * @see {@link DbxInjectionComponent} - The concrete standalone component implementation.\n * @see {@link DbxInjectionInstance}\n */\n@Directive()\nexport abstract class AbstractDbxInjectionDirective<T> implements OnInit, OnDestroy {\n private readonly _instance = new DbxInjectionInstance<T>(inject(Injector));\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n /**\n * Sets the component injection configuration on the underlying {@link DbxInjectionInstance}.\n *\n * @param config - The component config, observable, or getter to use.\n */\n setConfig(config: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>) {\n this._instance.config = config;\n }\n\n /**\n * Sets the template injection configuration on the underlying {@link DbxInjectionInstance}.\n *\n * @param template - The template config, observable, or getter to use.\n */\n setTemplate(template: Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>) {\n this._instance.template = template;\n }\n\n /**\n * Sets the target `ViewContainerRef` where dynamic content will be inserted.\n *\n * @param content - The view container reference for content projection.\n */\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n}\n","import { ChangeDetectionStrategy, Component, ViewContainerRef, input, viewChild, effect } from '@angular/core';\nimport { type DbxInjectionComponentConfig, type DbxInjectionTemplateConfig } from './injection';\nimport { AbstractDbxInjectionDirective } from './injection.directive';\nimport { type Maybe } from '@dereekb/util';\nimport { type ObservableOrValueGetter } from '@dereekb/rxjs';\n\n/**\n * Standalone component for dynamically injecting a component or template into the DOM.\n *\n * Accepts a {@link DbxInjectionComponentConfig} (to create a component) or a\n * {@link DbxInjectionTemplateConfig} (to embed a template/view). When the config changes,\n * the previous content is destroyed and the new content is created in its place.\n *\n * Can be used as an element (`<dbx-injection>`) or as an attribute directive\n * (`[dbxInjection]` / `[dbx-injection]`).\n *\n * @typeParam T - The type of the dynamically created component.\n *\n * @example\n * ```html\n * <!-- Element usage with a component config -->\n * <dbx-injection [config]=\"myComponentConfig\"></dbx-injection>\n *\n * <!-- Element usage with a template config -->\n * <dbx-injection [template]=\"myTemplateConfig\"></dbx-injection>\n *\n * <!-- Attribute usage -->\n * <div dbxInjection [config]=\"myComponentConfig\"></div>\n * ```\n *\n * @see {@link DbxInjectionComponentConfig}\n * @see {@link DbxInjectionTemplateConfig}\n * @see {@link AbstractDbxInjectionDirective}\n */\n@Component({\n selector: 'dbx-injection, [dbxInjection], [dbx-injection]',\n template: `\n <ng-template #content></ng-template>\n `,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxInjectionComponent<T> extends AbstractDbxInjectionDirective<T> {\n /**\n * Reference to the internal view container where dynamic content is projected.\n */\n readonly content = viewChild('content', { read: ViewContainerRef });\n\n /**\n * The component injection configuration. Accepts an observable, getter, or static value.\n */\n readonly config = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionComponentConfig<T>>>>>();\n\n /**\n * The template injection configuration. Accepts an observable, getter, or static value.\n * Only used when `config` is not provided.\n */\n readonly template = input<Maybe<ObservableOrValueGetter<Maybe<DbxInjectionTemplateConfig<T>>>>>();\n\n // allow signal writes for each as during their initialization they may write to a signal in some cases when initializing\n protected readonly _contentEffect = effect(() => this.setContent(this.content()));\n protected readonly _configEffect = effect(() => this.setConfig(this.config()));\n protected readonly _templateEffect = effect(() => this.setTemplate(this.template()));\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { type DbxInjectionArrayEntry } from './injection.array';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxInjectionComponent } from './injection.component';\n\n/**\n * Renders a list of dynamically injected components from an array of {@link DbxInjectionArrayEntry} items.\n *\n * Each entry is tracked by its `key` property for efficient change detection, and rendered\n * using a nested {@link DbxInjectionComponent}.\n *\n * @example\n * ```html\n * <dbx-injection-array [entries]=\"myEntries\" />\n * ```\n *\n * @example\n * ```typescript\n * // In the host component:\n * myEntries: DbxInjectionArrayEntry[] = [\n * { key: 'chart', injectionConfig: { componentClass: ChartComponent } },\n * { key: 'table', injectionConfig: { componentClass: TableComponent } }\n * ];\n * ```\n *\n * @see {@link DbxInjectionArrayEntry}\n * @see {@link DbxInjectionComponent}\n */\n@Component({\n selector: 'dbx-injection-array',\n template: `\n @for (entry of entries(); track entry.key) {\n <dbx-injection [config]=\"entry.injectionConfig\"></dbx-injection>\n }\n `,\n imports: [DbxInjectionComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class DbxInjectionArrayComponent {\n /**\n * The array of keyed injection entries to render. Each entry produces a `<dbx-injection>` component.\n */\n readonly entries = input<Maybe<DbxInjectionArrayEntry[]>>(undefined);\n}\n","import { type Provider, type Type } from '@angular/core';\nimport { type DbxInjectionComponentConfig } from './injection';\n\n/**\n * Configuration for temporarily showing a dynamically injected component via {@link DbxInjectionContext.showContext}.\n *\n * Defines both the component to inject and a `use` callback that interacts with the created instance.\n * The injected view is displayed until the promise returned by `use` resolves, at which point\n * the original content is restored.\n *\n * @typeParam T - The type of the component being injected.\n * @typeParam O - The type of the value resolved by the `use` promise.\n *\n * @example\n * ```typescript\n * const contextConfig: DbxInjectionContextConfig<MyEditorComponent, string> = {\n * config: { componentClass: MyEditorComponent },\n * use: async (editor) => {\n * return await editor.waitForUserInput();\n * }\n * };\n *\n * const result = await injectionContext.showContext(contextConfig);\n * ```\n */\nexport interface DbxInjectionContextConfig<T = unknown, O = unknown> {\n /**\n * The {@link DbxInjectionComponentConfig} describing which component to create and how to configure it.\n */\n config: DbxInjectionComponentConfig<T>;\n /**\n * Callback invoked with the created component instance. The returned promise controls how long\n * the injected view remains visible; the original content is restored once it resolves.\n */\n use: (instance: T) => Promise<O>;\n}\n\n/**\n * Abstract service for temporarily replacing a view's content with a dynamically injected component,\n * then restoring the original content when done.\n *\n * Unlike `*ngIf` or `*ngSwitch`, the original child content is **hidden** rather than destroyed,\n * preserving component state. Once the injected context's promise resolves (or is reset), the\n * original content is re-displayed.\n *\n * This is useful for overlay-like workflows such as inline editors, confirmation dialogs,\n * or multi-step flows where destroying and recreating the underlying view would lose state.\n *\n * @see {@link DbxInjectionContextConfig}\n * @see {@link DbxInjectionContextDirective} - The concrete structural directive implementation.\n */\nexport abstract class DbxInjectionContext {\n /**\n * Temporarily replaces the current view content with the component described by `config`.\n *\n * The original content is hidden (not destroyed) and is restored once the `use` promise\n * in the config resolves or rejects.\n *\n * @typeParam T - The type of the injected component.\n * @typeParam O - The return type of the `use` promise.\n * @param config - The context configuration describing the component and usage callback.\n * @returns A promise that resolves with the value from `config.use`.\n */\n abstract showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T>): Promise<O>;\n\n /**\n * Cancels any active context, rejecting its promise and restoring the original content.\n *\n * @returns `true` if there was an active context that was reset, `false` otherwise.\n */\n abstract resetContext(): boolean;\n}\n\n/**\n * Creates Angular providers that register a concrete {@link DbxInjectionContext} implementation\n * under the abstract `DbxInjectionContext` token via `useExisting`.\n *\n * This enables dependency injection consumers to request `DbxInjectionContext` and receive\n * the specific directive or service implementation.\n *\n * @typeParam T - The concrete type that extends {@link DbxInjectionContext}.\n * @param type - The concrete class to register as the existing provider.\n * @returns An array of Angular providers.\n */\nexport function provideDbxInjectionContext<T extends DbxInjectionContext>(type: Type<T>): Provider[] {\n return [\n {\n provide: DbxInjectionContext,\n useExisting: type\n }\n ];\n}\n","import { Directive, type EmbeddedViewRef, Injector, TemplateRef, ViewContainerRef, type OnDestroy, type OnInit, inject, effect, input } from '@angular/core';\nimport { type DbxInjectionContext, type DbxInjectionContextConfig, provideDbxInjectionContext } from './injection.context';\nimport { DbxInjectionInstance } from './injection.instance';\nimport { type DbxInjectionComponentConfig } from './injection';\nimport { type PromiseOrValue, type PromiseReference, promiseReference, type Maybe } from '@dereekb/util';\n\n/**\n * Structural directive that implements {@link DbxInjectionContext}, allowing its host content\n * to be temporarily replaced with a dynamically injected component and then restored.\n *\n * Unlike `*ngIf` or `*ngSwitch`, the original child content is **detached** (hidden) rather than\n * destroyed, so component state is preserved while the injected context is active. When the\n * context's promise resolves or {@link resetContext} is called, the original view is re-attached.\n *\n * The directive also accepts an optional `[dbxInjectionContext]` input to set a static component\n * config directly, which replaces the default content until cleared.\n *\n * @typeParam O - The output type produced by {@link showContext}.\n *\n * @example\n * ```html\n * <!-- Wrap content that should be temporarily replaceable -->\n * <div *dbxInjectionContext>\n * <p>Original content preserved while context is active</p>\n * </div>\n * ```\n *\n * @example\n * ```typescript\n * // Programmatically show a temporary editor overlay:\n * const result = await injectionContext.showContext({\n * config: { componentClass: InlineEditorComponent },\n * use: (editor) => editor.waitForSave()\n * });\n * ```\n *\n * @see {@link DbxInjectionContext}\n * @see {@link DbxInjectionContextConfig}\n */\n@Directive({\n selector: '[dbxInjectionContext]',\n providers: provideDbxInjectionContext(DbxInjectionContextDirective),\n standalone: true\n})\nexport class DbxInjectionContextDirective<O = unknown> implements DbxInjectionContext, OnInit, OnDestroy {\n private readonly _injector = inject(Injector);\n private readonly _templateRef = inject(TemplateRef<O>);\n private readonly _viewContainer = inject(ViewContainerRef);\n\n private readonly _instance = new DbxInjectionInstance(this._injector);\n\n private _currentPromise: Maybe<PromiseReference<unknown>>;\n private _embeddedView!: EmbeddedViewRef<O>;\n private _isDetached = false;\n\n /**\n * Optional static component config input. When set, the directive replaces its content\n * with the specified component. When cleared (`undefined`), the original content is restored.\n */\n readonly config = input<Maybe<DbxInjectionComponentConfig<unknown>>>();\n\n protected readonly _configEffect = effect(() => {\n this.setConfig(this.config());\n\n // NOTE: we have/call setConfig() because the effect() may not respond to all value changes,\n // especially when setConfig() ends up being called twice quickly in quick succession.\n });\n\n ngOnInit() {\n this._instance.content = this._viewContainer;\n this._instance.init();\n this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);\n\n // detach the embedded view\n this._viewContainer.detach();\n\n // reattach it through the template configuration.\n // the template configuration acts as the default.\n this._instance.template = {\n viewRef: this._embeddedView\n };\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n this._embeddedView?.destroy(); // destroy our embedded view too if it is set.\n }\n\n /**\n * {@inheritDoc DbxInjectionContext.showContext}\n *\n * @param config - The injection context configuration describing the component and its usage.\n * @returns A promise that resolves with the output of the injected component's usage.\n */\n async showContext<T, O>(config: DbxInjectionContextConfig<T>): Promise<O> {\n // clear the current context before showing something new.\n this.resetContext();\n\n let promiseRef: Maybe<PromiseReference<O>>;\n\n let result: Maybe<O>;\n let error: unknown;\n\n // wait for the promise to resolve and use to finish using that instance.\n try {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n promiseRef = promiseReference(async (resolve, reject) => {\n const injectionConfig: DbxInjectionComponentConfig<T> = {\n ...config.config,\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n init: async (instance: T) => {\n // init if available in the base config.\n if (config.config.init) {\n config.config.init(instance);\n }\n\n try {\n const result = (await config.use(instance)) as PromiseOrValue<O>;\n resolve(result);\n } catch (e) {\n reject(e);\n }\n }\n };\n\n this.setConfig(injectionConfig as DbxInjectionComponentConfig<unknown>);\n });\n\n this._currentPromise = promiseRef as PromiseReference<unknown>;\n\n // await the promise\n await promiseRef.promise;\n } catch (e) {\n error = e;\n }\n\n // if we're still using the same promiseRef\n if (promiseRef && promiseRef === this._currentPromise) {\n // clear the config to reshow the view\n this.setConfig(undefined);\n\n // clear the current promise\n this._currentPromise = undefined;\n }\n\n if (error != null) {\n return Promise.reject(error);\n } else {\n return result as O;\n }\n }\n\n /**\n * {@inheritDoc DbxInjectionContext.resetContext}\n *\n * @returns `true` if an active context was cleared, `false` otherwise.\n */\n resetContext(): boolean {\n let clearedValue = false;\n\n if (this._currentPromise) {\n const promise = this._currentPromise;\n\n // clear the current promise too\n this._currentPromise = undefined;\n\n // clear the config.\n this.setConfig(undefined);\n\n // send a rejection signal to bail out.\n promise.reject(new Error('dbxInjectionContext bailout'));\n\n clearedValue = true;\n }\n\n return clearedValue;\n }\n\n /**\n * Sets or clears the active component configuration.\n *\n * When a config is provided, the original embedded view is detached and the component is injected.\n * When `undefined` is provided, the injected component is removed and the original view is re-attached.\n *\n * @param config - The component config to display, or `undefined` to restore the original content.\n */\n setConfig(config: Maybe<DbxInjectionComponentConfig<unknown>>) {\n let reattach = false;\n\n if (config) {\n if (!this._isDetached) {\n // detach the original view before setting config.\n this._viewContainer.detach();\n this._isDetached = true;\n }\n } else if (this._isDetached) {\n reattach = true;\n }\n\n this._instance.config = config;\n\n if (reattach) {\n this._viewContainer.insert(this._embeddedView);\n this._isDetached = false;\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { DbxInjectionContext, type DbxInjectionContextConfig } from './injection.context';\n\n/**\n * Abstract directive that delegates {@link DbxInjectionContext} operations to a host-level\n * `DbxInjectionContext` obtained via Angular's dependency injection (`{ host: true }`).\n *\n * This is useful for creating specialized injection context subtypes that can be injected\n * by their own token while still forwarding the actual show/reset behavior to a parent\n * {@link DbxInjectionContextDirective}.\n *\n * @example\n * ```typescript\n * @Directive({ providers: [{ provide: MySpecialContext, useExisting: MyForwardDirective }] })\n * class MyForwardDirective extends AbstractForwardDbxInjectionContextDirective {}\n * ```\n *\n * @see {@link DbxInjectionContext}\n * @see {@link DbxInjectionContextDirective}\n */\n@Directive()\nexport abstract class AbstractForwardDbxInjectionContextDirective implements DbxInjectionContext {\n /**\n * The host-level {@link DbxInjectionContext} that all operations are forwarded to.\n */\n readonly dbxInjectionContext = inject(DbxInjectionContext, { host: true });\n\n // MARK: DbxInjectionContext\n /**\n * {@inheritDoc DbxInjectionContext.showContext}\n *\n * @param config - The injection context configuration to forward to the host context.\n * @returns A promise that resolves with the output of the injected component's usage.\n */\n showContext<T = unknown, O = unknown>(config: DbxInjectionContextConfig<T, unknown>): Promise<O> {\n return this.dbxInjectionContext.showContext(config);\n }\n\n /**\n * {@inheritDoc DbxInjectionContext.resetContext}\n *\n * @returns `true` if an active context was cleared, `false` otherwise.\n */\n resetContext(): boolean {\n return this.dbxInjectionContext.resetContext();\n }\n}\n","import { asGetter, type GetterOrValue, type Maybe } from '@dereekb/util';\nimport { switchMapObject } from '@dereekb/rxjs';\nimport { type DbxInjectionComponentConfig } from './injection';\nimport { type Type } from '@angular/core';\n\n/**\n * Creates an RxJS operator that switches between injection component configs, falling back to a\n * default config when the source emits `null`, `undefined`, or `true`.\n *\n * If the `defaultConfig` resolves to a class (function), it is automatically wrapped into a\n * `{ componentClass }` config object.\n *\n * This is useful for reactive streams where an upstream value may indicate \"use the default component\"\n * rather than providing an explicit configuration.\n *\n * @typeParam T - The specific {@link DbxInjectionComponentConfig} subtype.\n * @typeParam X - The component type.\n * @param defaultConfig - A static value, getter, or component class to use as the fallback config.\n * @returns An RxJS operator compatible with `pipe()`.\n *\n * @see {@link DbxInjectionComponentConfig}\n *\n * @example\n * ```typescript\n * config$.pipe(\n * switchMapDbxInjectionComponentConfig(MyDefaultComponent)\n * ).subscribe(config => {\n * // config is always a DbxInjectionComponentConfig or undefined\n * });\n * ```\n */\nexport function switchMapDbxInjectionComponentConfig<T extends DbxInjectionComponentConfig<X>, X = any>(defaultConfig?: GetterOrValue<Maybe<T | Type<X>>>) {\n const defaultAsGetter = asGetter(defaultConfig);\n\n return switchMapObject<T>({\n defaultGetter: () => {\n const value = defaultAsGetter();\n\n if (typeof value === 'function') {\n // is a component class\n return { componentClass: value } as T;\n } else {\n return value;\n }\n }\n });\n}\n","import { type AbstractType, Injector, type Provider, type Type } from '@angular/core';\n\n/**\n * A type that is both an Angular injectable class (concrete or abstract) and a `Provider`,\n * making it suitable for use with `Injector.create()`.\n *\n * @typeParam T - The instance type produced by the injectable.\n */\nexport type InjectableType<T> = (Type<T> | AbstractType<T>) & Provider;\n\n/**\n * Creates a child injector with the given `type` as its sole provider and immediately\n * resolves an instance of that type.\n *\n * This is a convenience for one-off instantiation of an injectable class using a specific\n * parent injector, without needing to manually configure `Injector.create()`.\n *\n * @typeParam T - The type to instantiate.\n * @param type - The injectable class to provide and resolve.\n * @param parent - The parent injector that supplies the type's dependencies.\n * @returns A new instance of `T`.\n *\n * @example\n * ```typescript\n * const service = newWithInjector(MyService, parentInjector);\n * ```\n */\nexport function newWithInjector<T>(type: InjectableType<T>, parent: Injector): T {\n const injector = Injector.create({ providers: [type], parent });\n return injector.get(type);\n}\n","import { map, type Observable } from 'rxjs';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Inject, Optional, Injectable, type OnDestroy } from '@angular/core';\nimport { LockSet, type ObservableOrValue, asObservable } from '@dereekb/rxjs';\nimport { type Maybe, type Milliseconds } from '@dereekb/util';\n\n/**\n * Component or service that exposes a {@link LockSet} for coordinating lock-based state.\n */\nexport interface LockSetComponent {\n readonly lockSet: LockSet;\n}\n\n/**\n * Configuration for initializing a {@link LockSetComponentStore}'s lock set,\n * including an optional parent lock set and named lock observables.\n */\nexport interface LockSetComponentStoreConfig {\n readonly parent?: Maybe<Observable<LockSetComponent>>;\n readonly locks?: {\n [key: string]: Observable<boolean>;\n };\n}\n\n/**\n * Abstract NgRx `ComponentStore` extension that integrates a {@link LockSet} for coordinating\n * async operations and delays destruction until all locks are released.\n *\n * Subclasses call {@link setupLockSet} to register parent lock sets and named locks.\n * On destroy, the store waits for all locks to unlock before completing cleanup,\n * preventing premature teardown of in-flight operations.\n *\n * @typeParam S - The shape of the component store's state object.\n *\n * @example\n * ```typescript\n * interface MyState { items: string[]; }\n *\n * @Injectable()\n * export class MyStore extends LockSetComponentStore<MyState> {\n * constructor() {\n * super({ items: [] });\n * }\n * }\n * ```\n */\n@Injectable()\nexport abstract class LockSetComponentStore<S extends object> extends ComponentStore<S> implements OnDestroy {\n readonly lockSet = new LockSet();\n\n protected lockSetDestroyDelayMs: Milliseconds = 2000;\n protected lockSetDestroyTimeoutMs: Maybe<Milliseconds>;\n\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() protected readonly initialState?: S) {\n super(initialState);\n }\n\n // MARK: State Changes\n readonly resetStore = this.updater(() => ({ ...this.initialState }) as S);\n\n // MARK: Locks\n protected setupLockSet({ parent, locks }: LockSetComponentStoreConfig): void {\n if (parent) {\n this.setParentLockSet(parent);\n }\n\n if (locks) {\n for (const key in locks) {\n if (locks[key]) {\n this.addLock(key, locks[key]);\n }\n }\n }\n }\n\n setParentLockSet(obs: ObservableOrValue<Maybe<LockSetComponent>>): void {\n this.lockSet.setParentLockSet(asObservable(obs).pipe(map((x) => x?.lockSet)));\n }\n\n addLock(key: string, obs: Observable<boolean>): void {\n this.lockSet.addLock(key, obs);\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.destroyOnNextUnlock(\n {\n fn: () => {\n this._destroyNow();\n },\n timeout: this.lockSetDestroyTimeoutMs\n },\n this.lockSetDestroyDelayMs\n );\n }\n\n /**\n * Immediately completes cleanup by destroying the lock set.\n * Called after all locks are released during the deferred destruction process.\n */\n _destroyNow() {\n this.lockSet.destroy();\n }\n}\n","import { type Observable, map } from 'rxjs';\nimport { isThrottled, unixDateTimeSecondsNumberForNow, DataDoesNotExistError, DataIsExpiredError, type ReadStoredData, type StoredData, type StoredDataStorageKey, type StoredDataString, type Maybe, type Milliseconds, hasNonNullValue, splitJoinRemainder } from '@dereekb/util';\nimport { type StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\n/**\n * Strategy for converting values to and from their stored string representation.\n *\n * @typeParam T - The type of value being converted.\n */\nexport interface SimpleStorageAccessorConverter<T> {\n /**\n * Converts the input value to a string.\n */\n stringifyValue(value: T): StoredDataString;\n /**\n * Converts the data string into a value.\n */\n parseValue(data: StoredDataString): T;\n}\n\n/**\n * Combined interface providing both value conversion and raw string storage capabilities.\n * Used as the backing delegate for {@link SimpleStorageAccessor}.\n *\n * @typeParam T - The type of value being stored.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {}\n\n/**\n * Default {@link SimpleStorageAccessorConverter} that uses `JSON.stringify`/`JSON.parse` for conversion.\n *\n * @typeParam T - The type of value being converted.\n */\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n stringifyValue(value: T): StoredDataString {\n return JSON.stringify(value);\n }\n\n parseValue(data: StoredDataString): T {\n return JSON.parse(data);\n }\n}\n\n/**\n * Composes a {@link StorageAccessor} and a {@link SimpleStorageAccessorConverter} into a single\n * {@link SimpleStorageAccessorDelegate} implementation.\n *\n * @typeParam T - The type of value being stored.\n */\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n private readonly _delegate: StorageAccessor<StoredDataString>;\n private readonly _converter: SimpleStorageAccessorConverter<T>;\n\n constructor(delegate: StorageAccessor<StoredDataString>, converter: SimpleStorageAccessorConverter<T>) {\n this._delegate = delegate;\n this._converter = converter;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return this._delegate.get(key);\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return this._delegate.set(key, value);\n }\n\n remove(key: string): Observable<void> {\n return this._delegate.remove(key);\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n all(prefix?: string): Observable<string[]> {\n return this._delegate.all(prefix);\n }\n\n allKeys(prefix?: string): Observable<string[]> {\n return this._delegate.allKeys(prefix);\n }\n\n stringifyValue(value: T): StoredDataString {\n return this._converter.stringifyValue(value);\n }\n\n parseValue(data: StoredDataString): T {\n return this._converter.parseValue(data);\n }\n}\n\n/**\n * Configuration for a {@link SimpleStorageAccessor}, controlling key namespacing and expiration.\n *\n * @example\n * ```typescript\n * const config: SimpleStorageAccessorConfig = {\n * prefix: 'myapp_settings',\n * expiresIn: 24 * 60 * 60 * 1000, // 24 hours\n * };\n * ```\n */\nexport interface SimpleStorageAccessorConfig {\n /**\n * Prefix prepended to all storage keys to namespace entries.\n */\n readonly prefix: string;\n /**\n * Separator between the prefix and the key. Defaults to `'::'`.\n */\n readonly prefixSplitter?: string;\n /**\n * Time in milliseconds after which stored data is considered expired.\n */\n readonly expiresIn?: Milliseconds;\n}\n\ninterface ConfiguredSimpleStorageAccessorConfig extends SimpleStorageAccessorConfig {\n readonly prefixSplitter: string;\n readonly fullPrefix: string;\n}\n\n/**\n * Validates that a storage key prefix is non-empty and does not contain the prefix splitter character.\n *\n * @param prefix - The prefix string to validate.\n * @param prefixSplitter - The splitter string that separates the prefix from the key.\n * @throws {Error} If the prefix is invalid or the splitter is empty.\n */\nexport function assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.'); // TODO(FUTURE): Consider changing to a concrete error type\n }\n\n if (!isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n}\n\n/**\n * Checks whether a storage key prefix is valid (non-empty and does not contain the splitter).\n *\n * @param prefix - The prefix string to validate.\n * @param prefixSpltter - The splitter string that separates the prefix from the key.\n * @returns `true` if the prefix is valid.\n */\nexport function isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix?.indexOf(prefixSpltter) === -1);\n}\n\n/**\n * Full-featured {@link StorageAccessor} that adds key namespacing, JSON serialization,\n * and optional time-based expiration on top of a raw string storage backend.\n *\n * Values are stored as JSON with metadata (timestamp) and automatically checked\n * for expiration on read.\n *\n * @typeParam T - The type of values stored.\n *\n * @throws {DataDoesNotExistError} When reading a key that does not exist.\n * @throws {DataIsExpiredError} When reading a key whose stored data has expired.\n *\n * @example\n * ```typescript\n * const accessor = factory.createStorageAccessor<UserSettings>({\n * prefix: 'user_prefs',\n * expiresIn: 3600000,\n * });\n *\n * accessor.set('theme', { dark: true }).subscribe();\n * accessor.get('theme').subscribe(settings => console.log(settings));\n * ```\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n static readonly PREFIX_SPLITTER = '::';\n\n private readonly _delegate: SimpleStorageAccessorDelegate<T>;\n protected readonly _config: ConfiguredSimpleStorageAccessorConfig;\n\n constructor(delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n\n this._delegate = delegate;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\n }\n\n get delegate() {\n return this._delegate;\n }\n\n get config() {\n return this._config;\n }\n\n // MARK: LimitedStorageAccessor\n get(inputKey: string): Observable<T> {\n const storeKey = this.makeStorageKey(inputKey);\n return this._delegate.get(storeKey).pipe(\n map((storedData: Maybe<string>) => {\n if (storedData) {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n throw new DataIsExpiredError<T>(readStoredData);\n }\n } else {\n throw new DataDoesNotExistError();\n }\n })\n );\n }\n\n set(inputKey: string, inputValue: T): Observable<void> {\n const storeKey = this.makeStorageKey(inputKey);\n const storeData: StoredData = this.buildStoredData(inputValue);\n const data = JSON.stringify(storeData);\n return this._delegate.set(storeKey, data);\n }\n\n remove(key: string): Observable<void> {\n const storeKey = this.makeStorageKey(key);\n return this._delegate.remove(storeKey);\n }\n\n all(): Observable<T[]> {\n return this._delegate.all(this._config.fullPrefix).pipe(\n map((allStoredData) => {\n return allStoredData\n .map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n })\n .filter(hasNonNullValue);\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(map((keys) => keys.map((x) => this.decodeStorageKey(x))));\n }\n\n clear(): Observable<object> {\n return this._delegate.clear();\n }\n\n // MARK: Stored Values\n protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T> {\n const storedData: StoredData = JSON.parse(storedDataString);\n const expired = this.isExpiredStoredData(storedData);\n const convertedData = this._delegate.parseValue(storedData.data);\n\n return {\n ...storedData,\n expired,\n convertedData\n };\n }\n\n protected buildStoredData(value: T): StoredData {\n return {\n storedAt: unixDateTimeSecondsNumberForNow(),\n data: this.stringifyValue(value)\n };\n }\n\n protected isExpiredStoredData(storeData: StoredData): boolean {\n const expiresIn = this._config.expiresIn;\n if (expiresIn) {\n if (storeData.storedAt) {\n return isThrottled(expiresIn, storeData.storedAt);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected makeStorageKey(key: string): StoredDataStorageKey {\n return `${this._config.prefix}${this._config.prefixSplitter}${String(key)}`;\n }\n\n protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean {\n return storageKey.startsWith(this._config.fullPrefix);\n }\n\n protected decodeStorageKey(storageKey: StoredDataStorageKey): string {\n const split = splitJoinRemainder(storageKey, this._config.prefixSplitter, 2);\n return split[1];\n }\n\n protected stringifyValue(value: T): string {\n return this._delegate.stringifyValue(value);\n }\n}\n","import { filterMaybeArrayValues, type StoredDataString, type FullStorageObject, StorageObjectUtility, type Maybe } from '@dereekb/util';\nimport { Observable, map, shareReplay } from 'rxjs';\nimport { type StorageAccessor } from './storage.accessor';\n\n/**\n * {@link StorageAccessor} implementation that wraps a {@link FullStorageObject} and stores raw strings.\n *\n * Each operation completes synchronously within an observable wrapper.\n *\n * @example\n * ```typescript\n * const accessor = new StringStorageAccessor(localStorage);\n * accessor.set('key', 'value').subscribe();\n * accessor.get('key').subscribe(value => console.log(value)); // 'value'\n * ```\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n private readonly _storage: FullStorageObject;\n\n constructor(storage: FullStorageObject) {\n this._storage = storage;\n }\n\n get(key: string): Observable<Maybe<StoredDataString>> {\n return new Observable((x) => {\n const value = this._storage.getItem(key);\n x.next(value);\n x.complete();\n });\n }\n\n set(key: string, value: StoredDataString): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.setItem(key, value);\n x.next();\n x.complete();\n });\n }\n\n remove(key: string): Observable<void> {\n return new Observable<void>((x) => {\n this._storage.removeItem(key);\n x.next();\n x.complete();\n });\n }\n\n clear(): Observable<StoredDataString[]> {\n const removed = this._storage.removeAll();\n return new Observable((x) => {\n x.next(removed);\n x.complete();\n });\n }\n\n all(): Observable<StoredDataString[]> {\n return this.allKeys().pipe(\n map((x) => filterMaybeArrayValues(x.map((y) => this._storage.getItem(y)))),\n shareReplay(1)\n );\n }\n\n allKeys(): Observable<string[]> {\n return new Observable((x) => {\n const result = StorageObjectUtility.allKeysFromStorageObject(this._storage);\n x.next(result);\n x.complete();\n });\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * DI token for the application's default {@link FullStorageObject} instance.\n *\n * Provided by {@link provideDbxStorage}.\n */\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_OBJECT');\n\n/**\n * DI token for the application's default {@link SimpleStorageAccessorFactory} instance.\n *\n * Provided by {@link provideDbxStorage}.\n */\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_CORE_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Injectable, inject } from '@angular/core';\nimport { type StorageAccessor } from './storage.accessor';\nimport { type SimpleStorageAccessorConfig, SimpleStorageAccessor, type SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { type FullStorageObject, type StoredDataString } from '@dereekb/util';\n\n/**\n * Configuration for creating a {@link SimpleStorageAccessor} via the factory,\n * with optional overrides for the storage backend and value converter.\n *\n * @typeParam T - The type of values the created accessor will store.\n */\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Injectable factory for creating namespaced {@link SimpleStorageAccessor} instances\n * backed by the application's default storage object.\n *\n * @example\n * ```typescript\n * @Injectable()\n * export class UserPrefsService {\n * private readonly storage = inject(SimpleStorageAccessorFactory)\n * .createStorageAccessor<UserPrefs>({ prefix: 'user_prefs' });\n *\n * save(prefs: UserPrefs) { return this.storage.set('current', prefs); }\n * load() { return this.storage.get('current'); }\n * }\n * ```\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n readonly storageObject = inject<FullStorageObject>(DEFAULT_STORAGE_OBJECT_TOKEN);\n\n createStorageAccessor<T>(config: StorageAccessorFactoryConfig<T>): SimpleStorageAccessor<T> {\n const storage = config.storage ?? new StringStorageAccessor(this.storageObject);\n const converter = config.converter ?? new StringifySimpleStorageAccessorConverter<T>();\n const delegate = new WrapperSimpleStorageAccessorDelegate<T>(storage, converter);\n\n const accessorConfig = {\n prefix: config.prefix\n };\n\n return new SimpleStorageAccessor<T>(delegate, accessorConfig);\n }\n}\n","import { type Maybe } from '@dereekb/util';\nimport { type Observable } from 'rxjs';\n\n/**\n * Abstract storage accessor providing key-value get/set/remove operations and a clear-all method.\n *\n * All operations return observables for consistency across sync and async storage backends.\n *\n * @typeParam T - The type of values stored.\n *\n * @see {@link StorageAccessor} for extended functionality including key/value enumeration.\n */\nexport abstract class LimitedStorageAccessor<T> {\n /**\n * Attempts to get the value. Throws a DataDoesNotExistError if not available.\n */\n abstract get(key: string): Observable<Maybe<T>>;\n\n abstract set(key: string, value: Maybe<T>): Observable<void>;\n\n abstract remove(key: string): Observable<void>;\n\n abstract clear(): Observable<object>;\n}\n\n/**\n * Extended storage accessor that adds the ability to enumerate all stored keys and values,\n * optionally filtered by a key prefix.\n *\n * @typeParam T - The type of values stored.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n /**\n * Returns all values. Filtered by keys of a given prefix.\n */\n abstract all(prefix?: string): Observable<T[]>;\n\n /**\n * Returns all keys. Filtered by keys of a given prefix.\n */\n abstract allKeys(prefix?: string): Observable<string[]>;\n}\n\n/**\n * Synchronous storage accessor for scenarios where blocking get/set/remove is acceptable.\n *\n * @typeParam T - The type of values stored.\n */\nexport abstract class InstantStorageAccessor<T> {\n abstract getNow(key: string): T | undefined;\n\n abstract setNow(key: string, value: T): void;\n\n abstract removeNow(key: string): void;\n}\n","import { type FullStorageObject, type Maybe, type StorageObject, StorageObjectUtility, type StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * {@link FullStorageObject} implementation backed by the browser's `localStorage`.\n *\n * Wraps a `StorageObject` (the Web Storage API interface) and adds availability checking\n * and a `removeAll` operation.\n *\n * @example\n * ```typescript\n * const storage = new FullLocalStorageObject(window.localStorage);\n * if (storage.isAvailable) {\n * storage.setItem('key', 'value');\n * }\n * ```\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n private readonly _localStorage: StorageObject;\n\n constructor(localStorage: StorageObject) {\n this._localStorage = localStorage;\n }\n\n get isPersistant(): boolean {\n return true;\n }\n\n get isAvailable(): boolean {\n const test = '_T_E_S_T_';\n\n try {\n // Tests setting and removing an item. These will throw an\n // exception if the localstorage is not available\n this._localStorage.setItem(test, test);\n this._localStorage.removeItem(test);\n return true;\n } catch {\n return false;\n }\n }\n\n get length(): number {\n return this._localStorage.length;\n }\n\n getItem(key: StoredDataStorageKey): Maybe<string> {\n return this._localStorage.getItem(key);\n }\n\n setItem(key: StoredDataStorageKey, item: string): void {\n this._localStorage.setItem(key, item);\n }\n\n removeItem(key: StoredDataStorageKey): void {\n this._localStorage.removeItem(key);\n }\n\n key(index: number): string | null {\n return this._localStorage.key(index);\n }\n\n removeAll(): string[] {\n const keys = StorageObjectUtility.allKeysFromStorageObject(this);\n keys.forEach((x) => this.removeItem(x));\n return keys;\n }\n}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * In-memory {@link FullStorageObject} implementation that does not persist across page loads.\n *\n * Used as a fallback when `localStorage` is unavailable (e.g., private browsing, SSR)\n * or for testing scenarios.\n *\n * @example\n * ```typescript\n * const storage = new MemoryStorageObject();\n * storage.setItem('temp', 'data'); // stored only in memory\n * ```\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n get isLastingStorage(): boolean {\n return false;\n }\n\n override get isAvailable(): boolean {\n return true;\n }\n\n constructor() {\n super(SHARED_MEMORY_STORAGE);\n }\n}\n","import { type EnvironmentProviders, type Provider, makeEnvironmentProviders } from '@angular/core';\nimport { type FullStorageObject } from '@dereekb/util';\nimport { SimpleStorageAccessorFactory } from './storage.accessor.simple.factory';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN } from './storage.di';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\nimport { MemoryStorageObject } from './storage.object.memory';\n\n/**\n * Creates the default {@link FullStorageObject}, preferring `localStorage` and\n * falling back to an in-memory store if `localStorage` is unavailable.\n *\n * @returns A FullStorageObject backed by localStorage or an in-memory fallback.\n *\n * @example\n * ```typescript\n * const storage = defaultStorageObjectFactory();\n * storage.setItem('key', 'value');\n * ```\n */\nexport function defaultStorageObjectFactory(): FullStorageObject {\n let storageObject: FullStorageObject = new FullLocalStorageObject(localStorage);\n\n if (!storageObject.isAvailable) {\n storageObject = new MemoryStorageObject();\n }\n\n return storageObject;\n}\n\n/**\n * Registers the default storage object and {@link SimpleStorageAccessorFactory} as environment-level providers.\n *\n * Call in your application config to enable storage-based services throughout the app.\n *\n * @returns The environment providers for storage services.\n *\n * @example\n * ```typescript\n * export const appConfig: ApplicationConfig = {\n * providers: [provideDbxStorage()],\n * };\n * ```\n */\nexport function provideDbxStorage(): EnvironmentProviders {\n const providers: Provider[] = [\n // Storage object\n {\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n },\n // Storage accessor factory\n {\n provide: SimpleStorageAccessorFactory,\n useClass: SimpleStorageAccessorFactory\n },\n {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useExisting: SimpleStorageAccessorFactory\n }\n ];\n\n return makeEnvironmentProviders(providers);\n}\n","import { type MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { type ChangeDetectorRef, type ViewRef, type ElementRef } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * RxJS operator that triggers `detectChanges()` on a `ChangeDetectorRef` after each emission.\n *\n * Wraps the detection call in a `setTimeout` to avoid triggering it during change detection cycles.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to trigger. If `null`/`undefined`, the operator is a no-op.\n * @param timeout - Delay in milliseconds before calling `detectChanges`.\n * @returns An RxJS operator that triggers change detection on each emission.\n *\n * @example\n * ```typescript\n * this.data$.pipe(tapDetectChanges(this.cdRef)).subscribe();\n * ```\n */\nexport function tapDetectChanges<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return cdRef ? tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout)) : tap();\n}\n\n/**\n * Safely calls `detectChanges()` on a `ChangeDetectorRef`, skipping the call if the view is already destroyed.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to trigger.\n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n safeUseCdRef(cdRef, () => cdRef.detectChanges());\n}\n\n/**\n * RxJS operator that calls `markForCheck()` on a `ChangeDetectorRef` after each emission.\n *\n * Intended for components using `OnPush` change detection that subscribe to observables\n * outside of the `async` pipe. Not needed when using the `async` pipe.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to mark. If `null`/`undefined`, the operator is a no-op.\n * @param timeout - Delay in milliseconds before calling `markForCheck`.\n * @returns An RxJS operator that marks the view for check on each emission.\n *\n * @example\n * ```typescript\n * this.data$.pipe(tapSafeMarkForCheck(this.cdRef)).subscribe();\n * ```\n */\nexport function tapSafeMarkForCheck<T>(cdRef: Maybe<ChangeDetectorRef>, timeout = 0): MonoTypeOperatorFunction<T> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return cdRef ? tap(() => setTimeout(() => safeMarkForCheck(cdRef), timeout)) : tap();\n}\n\n/**\n * Safely calls `markForCheck()` on a `ChangeDetectorRef`, skipping the call if the view is already destroyed.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to mark.\n */\nexport function safeMarkForCheck(cdRef: ChangeDetectorRef): void {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n safeUseCdRef(cdRef, () => cdRef.markForCheck());\n}\n\n/**\n * Executes a callback with the given `ChangeDetectorRef` only if its view has not been destroyed.\n *\n * @deprecated Use Angular signals instead.\n *\n * @param cdRef - The change detector to guard.\n * @param use - Callback to invoke with the change detector.\n */\nexport function safeUseCdRef(cdRef: ChangeDetectorRef, use: (cdRef: ChangeDetectorRef) => void): void {\n if (!(cdRef as ViewRef).destroyed) {\n use(cdRef);\n }\n}\n\n/**\n * Checks whether an `ng-content` wrapper element received any projected content from its parent.\n *\n * Returns `true` if the element has any child nodes, even if the projected content is empty.\n * Useful for conditionally showing fallback content when no projection is provided.\n *\n * @param ref - Reference to the wrapper element around `ng-content`.\n * @returns `true` if the wrapper element has any child nodes.\n *\n * @example\n * ```typescript\n * // In the component class:\n * @ViewChild('contentWrapper', { static: false }) contentRef: ElementRef;\n *\n * get hasContent(): boolean {\n * return checkNgContentWrapperHasContent(this.contentRef);\n * }\n * ```\n *\n * @example\n * ```html\n * <!-- In the component template: -->\n * <div #contentWrapper>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\n * <div *ngIf=\"!hasContent\">No content provided</div>\n * ```\n */\nexport function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean {\n // https://github.com/angular/angular/issues/26083\n let hasContent = false;\n\n if (ref != null) {\n const childNodes = ref.nativeElement.childNodes;\n const hasChildNodes = childNodes && childNodes.length > 0;\n hasContent = Boolean(hasChildNodes);\n }\n\n return hasContent;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["importsAndExports","initialState","reducer","DbxAppContextActions.setState","FEATURE_KEY","reducers","fromDbxAppContextState.DBX_APP_CONTEXT_STATE_FEATURE_KEY","fromDbxAppContextState.reducer","onDbxAppContext.DbxAppContextActions.setState","DbxAppAuthActions.loggedOut","DbxAppAuthUserActions.setUserIdentifier","DbxAppAuthUserActions.setUserIsOnboarded","DbxAppAuthUserActions.setUserState","DbxAppAuthUserActions.setUserRoles","fromDbxAppAuthUserState.DBX_APP_AUTH_USER_FEATURE_KEY","fromDbxAppAuthUserState.reducer","onDbxAppAuth.DbxAppAuthActions.loggedOut","onDbxAppAuth.DbxAppAuthActions.loggedIn","onDbxAppAuth.DbxAppAuthActions.logout","onDbxAppAuth.DbxAppAuthUserActions.setUserIdentifier","onDbxAppAuth.DbxAppAuthUserActions.setUserState","onDbxAppAuth.DbxAppAuthUserActions.setUserRoles","onDbxAppAuth.DbxAppAuthUserActions.setUserIsOnboarded","fromDbxAppAuth.FEATURE_KEY","fromDbxAppAuth.reducers","fromDbxAppAuth.selectDbxAppAuthUser","fromDbxAppContext.selectDbxAppContextState","onDbxAppContext.DbxAppContextActions.resetState","fromDbxAppContext.FEATURE_KEY","fromDbxAppContext.reducers"],"mappings":";;;;;;;;;;;;;;;AAIA;;;;;;;;;;;;;;;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