@dereekb/dbx-core 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +1 -1
  2. package/esm2020/lib/action/action.handler.mjs +3 -3
  3. package/esm2020/lib/action/action.holder.mjs +13 -4
  4. package/esm2020/lib/action/action.machine.mjs +12 -5
  5. package/esm2020/lib/action/action.mjs +37 -17
  6. package/esm2020/lib/action/action.module.mjs +11 -11
  7. package/esm2020/lib/action/action.reference.mjs +7 -0
  8. package/esm2020/lib/action/action.store.mjs +60 -23
  9. package/esm2020/lib/action/action.store.source.mjs +27 -13
  10. package/esm2020/lib/action/directive/auto/action.automodify.directive.mjs +5 -5
  11. package/esm2020/lib/action/directive/auto/action.autotrigger.directive.mjs +8 -7
  12. package/esm2020/lib/action/directive/auto/index.mjs +2 -2
  13. package/esm2020/lib/action/directive/context/action.directive.mjs +5 -5
  14. package/esm2020/lib/action/directive/debug/action.logger.directive.mjs +4 -4
  15. package/esm2020/lib/action/directive/map/action.map.working.disable.directive.mjs +5 -5
  16. package/esm2020/lib/action/directive/state/action.disabled.directive.mjs +7 -5
  17. package/esm2020/lib/action/directive/state/action.enforce.modified.directive.mjs +48 -0
  18. package/esm2020/lib/action/directive/state/action.handler.directive.mjs +5 -5
  19. package/esm2020/lib/action/directive/state/action.success.component.mjs +4 -4
  20. package/esm2020/lib/action/directive/state/action.success.directive.mjs +4 -4
  21. package/esm2020/lib/action/directive/state/action.value.directive.mjs +9 -7
  22. package/esm2020/lib/action/directive/state/action.value.stream.directive.mjs +80 -0
  23. package/esm2020/lib/action/directive/state/action.working.component.mjs +4 -4
  24. package/esm2020/lib/action/directive/state/index.mjs +2 -2
  25. package/esm2020/lib/action/index.mjs +2 -2
  26. package/esm2020/lib/button/action/action.button.directive.mjs +12 -11
  27. package/esm2020/lib/button/action/action.button.trigger.directive.mjs +4 -4
  28. package/esm2020/lib/button/button.directive.mjs +1 -1
  29. package/esm2020/lib/button/button.mjs +1 -1
  30. package/esm2020/lib/filter/action/action.filter.source.directive.mjs +4 -4
  31. package/fesm2015/dereekb-dbx-core.mjs +323 -240
  32. package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
  33. package/fesm2020/dereekb-dbx-core.mjs +321 -238
  34. package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
  35. package/lib/action/action.d.ts +14 -12
  36. package/lib/action/action.handler.d.ts +13 -5
  37. package/lib/action/action.holder.d.ts +9 -5
  38. package/lib/action/action.machine.d.ts +21 -8
  39. package/lib/action/action.module.d.ts +3 -3
  40. package/lib/action/action.reference.d.ts +11 -0
  41. package/lib/action/action.store.d.ts +33 -15
  42. package/lib/action/action.store.source.d.ts +20 -13
  43. package/lib/action/directive/auto/action.automodify.directive.d.ts +5 -4
  44. package/lib/action/directive/auto/action.autotrigger.directive.d.ts +6 -6
  45. package/lib/action/directive/auto/index.d.ts +1 -1
  46. package/lib/action/directive/context/action.directive.d.ts +3 -3
  47. package/lib/action/directive/debug/action.logger.directive.d.ts +3 -3
  48. package/lib/action/directive/map/action.map.working.disable.directive.d.ts +6 -6
  49. package/lib/action/directive/state/action.disabled.directive.d.ts +5 -4
  50. package/lib/action/directive/state/action.enforce.modified.directive.d.ts +19 -0
  51. package/lib/action/directive/state/action.handler.directive.d.ts +3 -3
  52. package/lib/action/directive/state/action.success.component.d.ts +3 -3
  53. package/lib/action/directive/state/action.success.directive.d.ts +3 -3
  54. package/lib/action/directive/state/action.value.directive.d.ts +3 -3
  55. package/lib/action/directive/state/action.value.stream.directive.d.ts +25 -0
  56. package/lib/action/directive/state/action.working.component.d.ts +3 -3
  57. package/lib/action/directive/state/index.d.ts +1 -1
  58. package/lib/action/index.d.ts +1 -1
  59. package/lib/button/action/action.button.directive.d.ts +4 -4
  60. package/lib/button/action/action.button.trigger.directive.d.ts +3 -3
  61. package/lib/button/button.d.ts +2 -2
  62. package/lib/button/button.directive.d.ts +2 -2
  63. package/lib/filter/action/action.filter.source.directive.d.ts +2 -2
  64. package/package.json +5 -4
  65. package/esm2020/lib/action/directive/auto/action.autotrigger.value.directive.mjs +0 -79
  66. package/esm2020/lib/action/directive/state/action.disabled.modified.directive.mjs +0 -35
  67. package/esm2020/lib/action/snackbar/index.mjs +0 -3
  68. package/esm2020/lib/action/snackbar/snackbar.mjs +0 -24
  69. package/lib/action/directive/auto/action.autotrigger.value.directive.d.ts +0 -25
  70. package/lib/action/directive/state/action.disabled.modified.directive.d.ts +0 -16
  71. package/lib/action/snackbar/index.d.ts +0 -1
  72. package/lib/action/snackbar/snackbar.d.ts +0 -50
@@ -1 +1 @@
1
- {"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/subscription/subscription.directive.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/directive/auto/action.autotrigger.value.directive.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/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.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.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.disabled.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/action.handler.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.component.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.component.ts","../../../../packages/dbx-core/src/lib/action/snackbar/snackbar.ts","../../../../packages/dbx-core/src/lib/action/snackbar/index.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.module.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/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.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/service/router.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.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/util/future.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.module.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/segue.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/pipe/date/datefromtoformat.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.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/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/date.pipe.module.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/action/action.filter.source.directive.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.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.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injected/injected.ts","../../../../packages/dbx-core/src/lib/injected/injected.instance.ts","../../../../packages/dbx-core/src/lib/injected/injected.directive.ts","../../../../packages/dbx-core/src/lib/injected/injected.component.ts","../../../../packages/dbx-core/src/lib/injected/injected.component.module.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.module.ts","../../../../packages/dbx-core/src/lib/util/view.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { OnDestroy, Directive, Inject } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { SubscriptionObject, LockSet } from '@dereekb/rxjs';\n\n/**\n * Abstract component that contains a SubscriptionObject and will clean it up automatically.\n */\n@Directive()\nexport abstract class AbstractSubscriptionDirective implements OnDestroy {\n\n private _subscriptionObject = new SubscriptionObject();\n\n constructor(subscription?: Subscription) {\n this.sub = subscription;\n }\n\n ngOnDestroy(): void {\n this._subscriptionObject.destroy();\n }\n\n protected set sub(subscription: Subscription | undefined) {\n this._subscriptionObject.subscription = subscription;\n }\n\n}\n\n\n/**\n * AbstractSubscriptionDirective extension that prevents the OnDestroy from occuring until the lockset is unlocked.\n */\n@Directive()\nexport abstract class AbstractLockSetSubscriptionDirective extends AbstractSubscriptionDirective implements OnDestroy {\n\n readonly lockSet = new LockSet();\n\n override ngOnDestroy(): void {\n this.lockSet.onNextUnlock(() => this.onLockSetDestroy());\n }\n\n protected onLockSetDestroy(): void {\n super.ngOnDestroy();\n }\n\n}\n","import { first, switchMap } from 'rxjs/operators';\nimport { Observable, Subscription } from 'rxjs';\nimport { Directive, forwardRef, Provider, Type } from '@angular/core';\nimport { LockSet, filterMaybe } from '@dereekb/rxjs';\nimport { OnDestroy } from '@angular/core';\nimport { Maybe, ReadableError } from '@dereekb/util';\nimport { ActionContextState, ActionContextStore } from './action.store';\nimport { ActionDisabledKey, ActionState } from './action';\n\n/**\n * Source that provides a ActionContextStore observable.\n */\nexport abstract class ActionContextStoreSource<T = any, O = any> {\n /**\n * Observable referencing the ActionContextStore.\n *\n * This observable by design is pre-filtered to not return null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary source. Used by DbxActionContextComponent to find secondary sources.\n */\nexport abstract class SecondaryActionContextStoreSource<T = any, O = any> extends ActionContextStoreSource<T, O> { }\n\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\nexport function pipeActionStore<R = any, T = any, O = any>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(\n switchMap(pipeFn)\n );\n}\n\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Convenience function for subscribing to the input source once and using the provided store.\n */\nexport function useActionStore<T = any, O = any>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n@Directive()\n// tslint:disable-next-line: directive-class-suffix\nexport class ActionContextStoreSourceInstance<T = any, O = any> implements OnDestroy {\n\n readonly lockSet = new LockSet();\n\n constructor(readonly source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n }\n\n public ngOnDestroy(): 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 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<O> {\n return this.pipeStore(x => x.success$);\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 isModified$(): Observable<boolean> {\n return this.pipeStore(x => x.isModified$);\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<ActionState> {\n return this.pipeStore(x => x.actionState$);\n }\n\n get isWorking$(): Observable<boolean> {\n return this.pipeStore(x => x.isWorking$);\n }\n\n get isSuccess$(): Observable<boolean> {\n return this.pipeStore(x => x.isSuccess$);\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?: ActionDisabledKey, enable = true): void {\n this.disable(key, !enable);\n }\n\n public disable(key?: ActionDisabledKey, disable = true): void {\n this.useStore((x) => (disable) ? x.disable(key) : x.enable(key));\n }\n\n public setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\n }\n\n public readyValue(value: Maybe<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 success(value: O | Observable<O>): void {\n this.useStore((x) => x.success(value));\n }\n\n public reset(): void {\n this.useStore((x) => x.reset());\n }\n\n}\n\nexport const actionContextStoreSourceInstanceFactory = (source: ActionContextStoreSource) => {\n return new ActionContextStoreSourceInstance(source);\n};\n\n/**\n * Provides an ActionContextStoreSource, as well as an ActionContextStoreSourceInstance.\n */\nexport function ProvideActionStoreSource<S>(sourceType: Type<S>): Provider[] {\n return [{\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: ActionContextStoreSourceInstance,\n useFactory: actionContextStoreSourceInstanceFactory,\n deps: [ActionContextStoreSource]\n }];\n}\n\nexport function ProvideSecondaryActionStoreSource<S>(sourceType: Type<S>): Provider[] {\n return [{\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...ProvideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, Input, OnInit, OnDestroy } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { distinctUntilChanged, filter } from 'rxjs/operators';\nimport { combineLatest } from 'rxjs';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\nimport { Host } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\n@Directive({\n selector: '[dbxActionAutoModify]',\n})\nexport class DbxActionAutoModifyDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private readonly _autoModifyEnabled = new BehaviorSubject<boolean>(true);\n\n @Input('dbxActionAutoModify')\n get autoModifyEnabled(): boolean {\n return this._autoModifyEnabled.value;\n }\n\n set autoModifyEnabled(autoModifyEnabled: boolean) {\n this._autoModifyEnabled.next(autoModifyEnabled as any !== 'false');\n }\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n const obs = combineLatest([\n this._autoModifyEnabled.pipe(distinctUntilChanged()), // Don't change unless specified otherwise.\n this.source.isModified$.pipe(filter(x => !x)) // Only when not modified send a value.\n ]);\n\n this.sub = obs.subscribe(([autoModifyEnabled, isModified]) => {\n if (autoModifyEnabled && !isModified) {\n this.source.setIsModified(true);\n }\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._autoModifyEnabled.complete();\n });\n }\n\n}\n","import { Directive, Input, OnInit, OnDestroy } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle } from 'rxjs/operators';\nimport { EMPTY, interval, Subject, combineLatest } from 'rxjs';\nimport { Observable } from 'rxjs';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\nimport { Host } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { Maybe } from '@dereekb/util';\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\n/**\n * Extension of DbxActionTransitionSafetyDirective that automatically triggers the action periodically when it is in a modified state.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]',\n})\nexport class DbxActionAutoTriggerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _triggerEnabled = new BehaviorSubject<boolean>(true);\n\n /**\n * How much to throttle the auto-triggering.\n */\n @Input('dbxActionAutoTrigger')\n get triggerEnabled(): boolean {\n return this._triggerEnabled.value;\n }\n\n set triggerEnabled(triggerEnabled: Maybe<boolean> | any) {\n triggerEnabled = triggerEnabled !== false; // Default to true\n\n if (this.triggerEnabled !== triggerEnabled) {\n this._triggerEnabled.next(triggerEnabled);\n }\n }\n\n @Input()\n triggerDebounce = DEFAULT_DEBOUNCE_MS;\n\n @Input()\n triggerThrottle = DEFAULT_THROTTLE_MS;\n\n @Input()\n triggerErrorThrottle = DEFAULT_ERROR_THROTTLE_MS;\n\n maxErrorsForThrottle = MAX_ERRORS_TO_THROTTLE_ON;\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle.\n *\n * Used in forms that are simple.\n */\n @Input()\n set fastTrigger(fastTrigger: boolean) {\n if (fastTrigger) {\n this.triggerDebounce = 200;\n this.triggerThrottle = 500;\n }\n }\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle to be 0.\n *\n * Used in forms that generally return a single value.\n */\n @Input()\n set instantTrigger(instantTrigger: boolean) {\n if (instantTrigger) {\n this.triggerDebounce = 10;\n this.triggerThrottle = 0;\n }\n }\n\n @Input()\n get triggerLimit(): Maybe<number> {\n return this._triggerLimit.value;\n }\n\n set triggerLimit(triggerLimit: Maybe<number>) {\n triggerLimit = triggerLimit || 0;\n this._triggerLimit.next(triggerLimit);\n }\n\n private readonly _triggerLimit = new BehaviorSubject<number | undefined>(undefined);\n private readonly _trigger = new Subject<number>();\n private _triggerCount = 0;\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n filter(() => this.isEnabled),\n filter((x) => x),\n debounce(() => interval(this.triggerDebounce)),\n throttle(() => this._errorCount$.pipe(\n first(),\n exhaustMap((count) => interval(this.triggerThrottle + (Math.min(count, this.maxErrorsForThrottle) * this.triggerErrorThrottle)))\n ), { leading: true, trailing: true }),\n // Check again for the \"trailing\" piece.\n filter(() => this.isEnabled),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => this._triggerCount += 1),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = this._triggerEnabled.pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this._triggerCount$;\n } else {\n return EMPTY;\n }\n })\n );\n\n private readonly _isTriggerLimited$: Observable<[number, boolean]> =\n combineLatest([this.triggerCount$, this._triggerLimit]).pipe(\n map(([triggerCount, limit]) => [triggerCount, ((limit) ? (triggerCount > limit) : false)] as [number, boolean]),\n shareReplay(1)\n );\n\n readonly isTriggerLimited$ = this._isTriggerLimited$.pipe(map(x => x[1]));\n readonly trigger$: 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(@Host() public readonly source: ActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n get isEnabled(): boolean {\n return this.triggerEnabled !== false;\n }\n\n ngOnInit(): void {\n this.sub = this.trigger$.subscribe(() => {\n this.source.trigger();\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._trigger.complete();\n this._triggerLimit.complete();\n });\n }\n\n}\n","import { ActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay } from 'rxjs/operators';\nimport { Directive, Host, Input, OnInit } from '@angular/core';\nimport { BehaviorSubject, Observable, of, EMPTY } from 'rxjs';\nimport { OnDestroy } from '@angular/core';\nimport { hasValueOrNotEmpty, Maybe } from '@dereekb/util';\nimport { SubscriptionObject } from '@dereekb/rxjs';\n\nexport type DbxActionAutoTriggerIsModifiedFn<T> = (value: T) => Observable<boolean>;\n\n/**\n * Directive that watches an observable for changes and sets the new value and modified states as necessary.\n */\n@Directive({\n selector: '[dbxActionAutoTriggerValue]',\n})\nexport class DbxActionAutoTriggerValueDirective<T, O> implements OnInit, OnDestroy {\n\n private _valueObs = new BehaviorSubject<Observable<T>>(EMPTY);\n private _isModifiedFn = new BehaviorSubject<Maybe<DbxActionAutoTriggerIsModifiedFn<T>>>(undefined);\n\n private _modifiedSub = new SubscriptionObject();\n private _triggerSub = new SubscriptionObject();\n\n @Input('dbxActionAutoTriggerValue')\n set dbxActionAutoTriggerValue(dbxActionAutoTriggerValue: Observable<T>) {\n this._valueObs.next(dbxActionAutoTriggerValue);\n }\n\n @Input()\n set dbxActionAutoTriggerModifiedNonEmptyValue(requireNonEmpty: boolean) {\n if (requireNonEmpty) {\n this.dbxActionAutoTriggerModified = (value) => {\n return of(hasValueOrNotEmpty(value));\n };\n }\n }\n\n @Input()\n set dbxActionAutoTriggerModified(dbxActionAutoTriggerModified: DbxActionAutoTriggerIsModifiedFn<T>) {\n this._isModifiedFn.next(dbxActionAutoTriggerModified);\n }\n\n readonly modifiedValue$ = this._valueObs.pipe(\n switchMap((obs) => obs.pipe(\n withLatestFrom(this._isModifiedFn),\n mergeMap(([value, dbxActionAutoTriggerModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionAutoTriggerModified) {\n result = dbxActionAutoTriggerModified(value).pipe(\n map((isModified) => [isModified, value] as [boolean, T])\n );\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n ))\n );\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance<T, O>) { }\n\n ngOnInit(): void {\n // Update Modified value.\n this._modifiedSub.subscription = this.modifiedValue$.subscribe(([isModified, value]) => {\n this.source.setIsModified(isModified);\n });\n\n // Set the value on triggers.\n this._triggerSub.subscription = this.source.triggered$.pipe(\n mergeMap(x => this.modifiedValue$)\n ).subscribe(([isModified, value]) => {\n this.source.readyValue(value);\n });\n }\n\n ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._isModifiedFn.complete();\n this._valueObs.complete();\n this._modifiedSub.destroy();\n this._triggerSub.destroy();\n });\n }\n\n}\n","\n/**\n * Used by ActionContextState to denote what state the action is in.\n */\n export enum ActionState {\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 ValueReady = '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 was successful.\n */\n Success = 'success'\n}\n\n/**\n * Unique key for disabling/enabling.\n */\nexport type ActionDisabledKey = string;\n\nexport const DEFAULT_ACTION_DISABLED_KEY = 'default';\n\nexport function isIdleActionState(actionState: ActionState): boolean {\n switch (actionState) {\n case ActionState.Idle:\n case ActionState.Disabled:\n case ActionState.Rejected:\n case ActionState.Success:\n return true;\n default:\n return false;\n }\n}\n","import { Injectable, OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Observable } from 'rxjs';\nimport { distinctUntilChanged, filter, map, shareReplay, switchMap, startWith } from 'rxjs/operators';\nimport { BooleanStringKeyArray, BooleanStringKeyArrayUtilityInstance, Maybe, ReadableError } from '@dereekb/util';\nimport { filterMaybe, LockSet, scanCount } from '@dereekb/rxjs';\nimport { ActionDisabledKey, ActionState, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState } from './action';\n\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtilityInstance.isFalse(state.disabled);\n}\n\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtilityInstance.isTrue(state.disabled);\n}\n\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\nexport function isWorkingActionState(actionState: ActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\nexport function canTriggerActionState(actionState: ActionState): boolean {\n return actionState !== ActionState.Disabled && isIdleActionState(actionState);\n}\n\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === ActionState.Triggered;\n}\n\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\nexport interface ActionContextState<T = any, O = any> {\n actionState: ActionState;\n isModified: boolean;\n /**\n * Value that is set after a triggered action.\n */\n value?: Maybe<T>;\n result?: Maybe<O>;\n error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: ActionState.Idle\n};\n\n@Injectable()\nexport class ActionContextStore<T = any, O = any> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n\n readonly lockSet = new LockSet();\n\n constructor() {\n super({ ...INITIAL_STATE });\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(map(x => isDisabledActionContextState(x) ? ActionState.Disabled : x.actionState), shareReplay(1));\n\n /**\n * Returns the current disabled reasons.\n */\n readonly disabled$ = this.state$.pipe(map(x => [...x.disabled ?? []]), distinctUntilChanged(), shareReplay(1));\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 triggered.\n */\n readonly triggered$ = this.afterDistinctActionState(ActionState.Triggered, () => true);\n\n /**\n * Pipes the readied value on ValueReady.\n */\n readonly valueReady$ = this.afterDistinctActionState(ActionState.ValueReady, x => x.value);\n\n /**\n * Pipes the error on the rejection state.\n */\n readonly rejected$ = this.afterDistinctActionState(ActionState.Rejected, x => x.error);\n\n /**\n * Pipes the result when the ActionState becomes working.\n */\n readonly working$ = this.afterDistinctActionState(ActionState.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 error.\n */\n readonly error$ = this.state$.pipe(map(x => x.error), distinctUntilChanged(), shareReplay(1));\n\n /**\n * Pipes the result when the ActionState becomes success.\n */\n readonly success$ = this.afterDistinctActionState(ActionState.Success, x => x.result);\n\n /**\n * Whether or not it is currently in a success state.\n */\n readonly isSuccess$ = this.afterDistinctBoolean(x => x.actionState === ActionState.Success);\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(\n map(canTriggerAction),\n distinctUntilChanged(),\n shareReplay(1)\n );\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), shareReplay(1))\n );\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(\n distinctUntilChanged()\n );\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(), shareReplay(1)\n );\n\n // MARK: State Changes\n /**\n * Adds a disabled reason.\n */\n readonly disable = this.updater((state, key?: void | ActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtilityInstance.insert(state.disabled, ((key as any) ?? DEFAULT_ACTION_DISABLED_KEY))\n }));\n\n /**\n * Removes a disabled reason.\n */\n readonly enable = this.updater((state, key?: void | ActionDisabledKey) => ({\n ...state,\n disabled: BooleanStringKeyArrayUtilityInstance.remove(state.disabled, ((key as any) ?? DEFAULT_ACTION_DISABLED_KEY))\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater((state, isModified: void | boolean) => ({\n ...state,\n actionState: (state.actionState === ActionState.Success) ? ActionState.Idle : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true\n }));\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)\n ? ({ isModified: state.isModified, actionState: ActionState.Triggered, error: state.error, value: undefined })\n : state);\n\n /**\n * Updates the value, setting value ready. The current result is cleared.\n */\n readonly readyValue = this.updater((state, value: Maybe<T>) => canReadyValue(state)\n ? ({ ...state, actionState: ActionState.ValueReady, value, result: undefined })\n : state);\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: ActionState.Working }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({ isModified: state.isModified, actionState: ActionState.Rejected, error, errorCount: (state.errorCount ?? 0) + 1 }));\n\n /**\n * Updates the state to success, and optionally sets a result.\n *\n * Clears modified state, and any errors.\n */\n readonly success = this.updater((state, result?: O) => ({ isModified: false, actionState: ActionState.Success, value: state.value, result, error: undefined }));\n\n /**\n * Completely resets the store.\n */\n readonly reset = this.updater((state) => ({ ...INITIAL_STATE }));\n\n // MARK: Utility\n afterDistinctBoolean(fromState: (state: ActionContextState) => 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: ActionState, fromState: (state: ActionContextState) => X): Observable<X> {\n return this.state$.pipe(\n map((x) => ([x, x.actionState]) as [ActionContextState, ActionState]),\n distinctUntilChanged((a, b) => a?.[1] === b?.[1]), // Filter out when the state remains the same.\n filter(([x, y]) => y === actionState), // Only pipe when the action state matches.\n map(x => fromState(x[0])),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n }, 2000);\n }\n\n}\n","import { Observable, of } from 'rxjs';\nimport { Destroyable } from '@dereekb/util';\nimport { LockSet } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, ActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\n\n/**\n * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.\n */\nexport class ActionContextBaseSource<T = any, O = any> implements ActionContextStoreSource, Destroyable {\n\n private readonly _store?: ActionContextStore;\n private readonly _store$: Observable<ActionContextStore<T, O>>;\n private readonly _instance: ActionContextStoreSourceInstance<T, O>;\n\n readonly isModified$: Observable<boolean>;\n readonly triggered$: Observable<boolean>;\n readonly success$: Observable<O>;\n\n constructor(readonly inputSource?: SecondaryActionContextStoreSource) {\n if (this.inputSource) {\n this._store$ = this.inputSource.store$;\n } else {\n this._store = new ActionContextStore();\n this._store$ = of(this._store);\n }\n\n this._instance = new ActionContextStoreSourceInstance(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.ngOnDestroy();\n }\n }\n\n get lockSet(): LockSet {\n return this._instance.lockSet;\n }\n\n get sourceInstance(): ActionContextStoreSourceInstance<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): void {\n this._instance.readyValue(value);\n }\n\n public reset(): void {\n this._instance.reset();\n }\n\n}\n","import { Directive, Optional, OnDestroy, Host } from '@angular/core';\nimport { ProvideActionStoreSource, SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { ActionContextBaseSource } from '../../action.holder';\n\n/**\n * Provides an DbxActionContext.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]',\n exportAs: 'action',\n providers: ProvideActionStoreSource(DbxActionDirective)\n})\nexport class DbxActionDirective<T = any, O = any> extends ActionContextBaseSource implements OnDestroy {\n\n constructor(@Optional() @Host() inputSource: SecondaryActionContextStoreSource) {\n super(inputSource);\n }\n\n ngOnDestroy(): void {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n }\n\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\nimport { ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource, ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\n\n/**\n * Directive that provides a DbxActionSourceDirective that is passed in.\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: ProvideSecondaryActionStoreSource(DbxActionSourceDirective)\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource, OnDestroy {\n\n private _source = new BehaviorSubject<Maybe<ActionContextStoreSource>>(undefined);\n readonly store$ = this._source.pipe(filterMaybe(), switchMap((x) => actionContextStoreSourcePipe(x.store$)));\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n @Input('dbxActionSource')\n get source(): Maybe<ActionContextStoreSource> {\n return this._source.value;\n }\n\n set source(source: Maybe<ActionContextStoreSource>) {\n if (source && !source.store$) {\n throw new Error('Invalid source passed to dbxActionSource.');\n }\n\n this._source.next(source);\n }\n\n}\n","import { Directive, OnInit, Host } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Prints out the current state to the console. Useful for debugging.\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]'\n})\nexport class DbxActionContextLoggerDirective extends AbstractSubscriptionDirective implements OnInit {\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.source.state$.subscribe((state) => {\n console.log('State: ', state);\n });\n }\n\n}\n","import { reduceBooleansWithOrFn } from '@dereekb/util';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay, switchMap } from 'rxjs/operators';\nimport { combineLatestFromMapValuesObsFn } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { ActionContextStore } from '../../action.store';\nimport { ActionContextStoreSourceMap, ActionKey } from './action.map';\n\n/**\n * Context used for providing actions based on the action key.\n *\n * This is useful for passing action contexts around via the providers instead of explicit injection.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n exportAs: 'actionMap',\n providers: [],\n})\nexport class DbxActionContextMapDirective implements ActionContextStoreSourceMap, OnDestroy {\n\n private readonly _map = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource>>(new Map());\n readonly map$ = this._map.asObservable();\n\n readonly areAnyWorking$ = this.checkAnyAre(x => x.isWorking$, false);\n\n constructor() { }\n\n get map(): Map<ActionKey, ActionContextStoreSource> {\n return this._map.value;\n }\n\n sourceForKey(key: ActionKey): ActionContextStoreSource<any, any> {\n return new DbxActionContextMapDirectiveSourceInstance(this, key);\n }\n\n addStoreSource(key: ActionKey, source: ActionContextStoreSource): void {\n if (this.map.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 this.map.set(key, source);\n this._map.next(this.map);\n }\n\n removeStore(key: ActionKey): void {\n if (!this.map.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n this._map.next(this.map);\n }\n\n ngOnDestroy(): void {\n this._map.complete();\n }\n\n // MARK: Utility\n checkAnyAre(mapFn: (input: ActionContextStore) => Observable<boolean>, emptyArrayValue = false): Observable<boolean> {\n return this.reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n reduceFromAllSources<O, R>(mapFn: (input: ActionContextStore) => Observable<O>, reduceFn: (values: O[]) => R): Observable<R> {\n return this.fromAllSources<O>(mapFn).pipe(map(reduceFn));\n }\n\n fromAllSources<O>(mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return this.map$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n\n}\n\nexport class DbxActionContextMapDirectiveSourceInstance implements ActionContextStoreSource {\n\n readonly _source$ = this.parent.map$.pipe(map(x => x.get(this.key)), distinctUntilChanged());\n readonly _store$ = this._source$.pipe(switchMap((x) => x?.store$ ?? of(undefined)), shareReplay(1));\n readonly store$ = actionContextStoreSourcePipe(this._store$);\n\n constructor(private readonly parent: DbxActionContextMapDirective, readonly key: ActionKey) { }\n\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\nimport { ActionKey } from './action.map';\nimport { ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\n\n/**\n * Directive that provides a ActionContextStoreSource using the input key and DbxActionContextMapDirective.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: ProvideSecondaryActionStoreSource(DbxActionFromMapDirective)\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource, OnDestroy {\n\n private _key = new BehaviorSubject<Maybe<ActionKey>>(undefined);\n readonly store$ = this._key.pipe(filterMaybe(), switchMap((x) => this._map.sourceForKey(x).store$));\n\n constructor(private readonly _map: DbxActionContextMapDirective) { }\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n\n @Input('dbxActionFromMap')\n get key(): Maybe<ActionKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<ActionKey>) {\n this._key.next(key);\n }\n\n}\n","import { Directive, Host, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { ActionKey } from './action.map';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to the store based on the key.\n */\n@Directive({\n selector: '[dbxActionMapSource]'\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n\n private _key: Maybe<ActionKey>;\n\n constructor(@Host() public readonly source: ActionContextStoreSource, private readonly _map: DbxActionContextMapDirective) { }\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n @Input('dbxActionMapSource')\n set key(key: ActionKey) {\n if (this._key !== key) {\n this._removeFromToStore();\n }\n\n this._key = key;\n this._addToStore();\n }\n\n private _addToStore(): void {\n if (this._key) {\n this._map.addStoreSource(this._key, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._key) {\n this._map.removeStore(this._key);\n }\n }\n\n}\n","import { ActionContextStoreSource } from '../../action.store.source';\n\nexport type ActionKey = string;\n\n/**\n * Map that returns sources for ActionKey values.\n */\nexport abstract class ActionContextStoreSourceMap<T = any, O = any> {\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","import { Directive, Host, Input, OnInit, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { ActionDisabledKey } from '../../action';\n\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = '__disabled';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]'\n})\nexport class DbxActionMapWorkingDisableDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n @Input('dbxActionMapWorkingDisable')\n disabledKey: Maybe<ActionDisabledKey>;\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance, private readonly _map: DbxActionContextMapDirective) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this._map.areAnyWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.source.enable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n }\n\n}\n","import { Directive, Host, Input, OnInit, OnDestroy } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that allows disabling an action using the inputs.\n */\n@Directive({\n selector: '[dbxActionDisabled]'\n})\nexport class DbxActionDisabledDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _disabled = new BehaviorSubject<boolean>(false);\n readonly disabled$ = this._disabled.pipe(distinctUntilChanged());\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionDisabled')\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: boolean) {\n this._disabled.next(disabled);\n }\n\n}\n","import { Directive, Host, OnInit, OnDestroy } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY = 'dbx_action_is_not_modified';\n\n/**\n * Directive that sets the disabled state based on the current isModified state.\n */\n@Directive({\n selector: '[dbxActionDisabledUntilModified]'\n})\nexport class DbxActionDisabledUntilModifiedDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.source.isModified$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY, !x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.source.enable(APP_ACTION_DISABLED_UNTIL_MODIFIED_DIRECTIVE_KEY);\n }\n\n}\n","import { BehaviorSubject, isObservable, Observable, of } from 'rxjs';\nimport { first } from 'rxjs/operators';\nimport { ActionContextStoreSourceInstance } from './action.store.source';\nimport { Maybe, Destroyable } from '@dereekb/util';\n\nexport interface WorkHandlerContextDelegate<O = any> {\n startWorking(): void;\n success(result?: Maybe<O>): void;\n reject(error?: Maybe<any>): void;\n}\n\n/**\n * WorkHandlerContextDelegate implementation using an ActionContextStoreSourceInstance.\n */\nexport class WorkHandlerContextSourceDelegate<T = any, O = any> implements WorkHandlerContextDelegate<O> {\n\n constructor(readonly source: ActionContextStoreSourceInstance<T, O>) { }\n\n startWorking(): void {\n this.source.startWorking();\n }\n\n success(result: O): void {\n this.source.success(result);\n }\n\n reject(error: any): void {\n this.source.reject(error);\n }\n\n}\n\n/**\n * Used by DbxActionHandlerDirective when handling a function.\n */\nexport class WorkHandlerContext<T = any, O = any> implements Destroyable {\n\n private _done = false;\n private _doneActionBegan = false;\n\n private _actionBegan = new BehaviorSubject<boolean>(false);\n private _isComplete = new BehaviorSubject<boolean>(false);\n\n constructor(public readonly value: T, readonly delegate: WorkHandlerContextDelegate<O>) {\n // Schedule to cleanup self once isComplete is true.\n this._isComplete.subscribe((done) => {\n if (done) {\n this.destroy();\n }\n });\n }\n\n get actionBegan(): boolean {\n return this._doneActionBegan ?? this._actionBegan.value;\n }\n\n get actionBegan$(): Observable<boolean> {\n return this._done ? of(this._doneActionBegan) : this._actionBegan.asObservable();\n }\n\n get isComplete(): boolean {\n return this._done || this._isComplete.value;\n }\n\n get isComplete$(): Observable<boolean> {\n return this._done ? of(true) : this._isComplete.asObservable();\n }\n\n /**\n * Begins working using an observable.\n */\n startWorkingWithObservable(actionObs: Observable<O>): void {\n this.startWorking();\n actionObs.pipe(first()).subscribe((actionResult: O) => {\n this.success(actionResult);\n }, (error: any) => {\n const message = error.message ?? error.code ?? undefined;\n this.reject((message) ? ({ message }) : undefined);\n });\n }\n\n /**\n * Notifies the system that the action has begun.\n */\n startWorking(): void {\n this._setWorking();\n this.delegate.startWorking();\n }\n\n /**\n * Sets success on the action.\n */\n success(result?: O): void {\n this._setComplete();\n this.delegate.success(result);\n }\n\n /**\n * Sets rejected on the action.\n */\n reject(error?: any): void {\n this._setComplete();\n this.delegate.reject(error);\n }\n\n destroy(): void {\n this._doneActionBegan = this.actionBegan;\n this._done = true;\n\n // Delay to prevent error.\n setTimeout(() => {\n this._actionBegan.complete();\n this._isComplete.complete();\n });\n }\n\n private _setWorking(): void {\n if (this.actionBegan) {\n throw new Error('Action already has been triggered for this context.');\n }\n\n this._actionBegan.next(true);\n }\n\n private _setComplete(): void {\n if (this.isComplete) {\n throw new Error('Action has already been marked as completed.');\n }\n\n this._isComplete.next(true);\n }\n\n}\n\nexport type HandleActionFunctionConfigFn<T, O> = (value: T) => HandleWorkValueReadyConfig<T, O>;\n\n/**\n * Creates a function that uses a provider to always handle new values.\n */\nexport function handleWorkValueReadyWithConfigFn<T, O>(providerFn: HandleActionFunctionConfigFn<T, O>): (value: T) => Maybe<WorkHandlerContext<T, O>> {\n return (value) => {\n const config: HandleWorkValueReadyConfig<T, O> = providerFn(value);\n return handleWorkValueReadyFn(config)(value);\n };\n}\n\n/**\n * Config for handleWorkValueReadyFn().\n */\nexport interface HandleWorkValueReadyConfig<T, O> {\n handlerFunction: HandleActionFunction<T, O>;\n delegate: WorkHandlerContextDelegate<O>;\n}\n\n/**\n * Performs the action. Can either return an observable that will use the handler, or can use the handler itself.\n */\nexport type HandleActionFunction<T = any, O = any> = (value: T, context: WorkHandlerContext<T, O>) => Observable<O> | void;\n\n/**\n * Creates a function that handles the incoming value and creates a WorkHandlerContext.\n */\nexport function handleWorkValueReadyFn<T, O>({ handlerFunction, delegate }: HandleWorkValueReadyConfig<T, O>): (value: T) => Maybe<WorkHandlerContext<T, O>> {\n return (value: T) => {\n const handler = new WorkHandlerContext<T, O>(value, delegate);\n let fnResult: void | Observable<O>;\n\n try {\n fnResult = handlerFunction(value, handler);\n } catch (e: any) {\n console.error('Action encountered an unexpected error.', e);\n handler.reject(e);\n return;\n }\n\n if (!handler.isComplete) {\n if (fnResult && isObservable(fnResult)) {\n if (handler.actionBegan) {\n throw new Error('Action already marked as begun from handlerFunction result. Either return an observable or use the handler directly.');\n }\n\n handler.startWorkingWithObservable(fnResult);\n }\n }\n\n return handler;\n };\n}\n","import { Directive, Host, Input, OnDestroy, OnInit } from '@angular/core';\nimport { map, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\nimport { HandleActionFunction, WorkHandlerContextSourceDelegate, handleWorkValueReadyFn } from '../../action.handler';\nimport { Maybe } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\n\n\n/**\n * Context used for defining a function that performs an action using the input function on ValueReady.\n */\n@Directive({\n selector: '[dbxActionHandler]',\n})\nexport class DbxActionHandlerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _handlerFunction = new BehaviorSubject<Maybe<HandleActionFunction<T, O>>>(undefined);\n readonly handlerFunction$ = this._handlerFunction.pipe(filterMaybe(), shareReplay(1));\n\n @Input('dbxActionHandler')\n get handlerFunction(): Maybe<HandleActionFunction<T, O>> {\n return this._handlerFunction.value;\n }\n\n set handlerFunction(handlerFunction: Maybe<HandleActionFunction<T, O>>) {\n this._handlerFunction.next(handlerFunction);\n }\n\n private _delegate = new WorkHandlerContextSourceDelegate<T, O>(this.source);\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.handlerFunction$.pipe(\n switchMap(handlerFunction => this.source.valueReady$.pipe(\n map((x: T) => ([handlerFunction, x] as [HandleActionFunction<T, O>, T])),\n tap(([handlerFunction, value]) => {\n const context = handleWorkValueReadyFn({ handlerFunction, delegate: this._delegate })(value);\n\n if (context) {\n\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('actionhandler', context.isComplete$.pipe(map(x => !x)));\n }\n })\n ))\n ).subscribe();\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n });\n }\n\n}\n","import { Component, Input } from '@angular/core';\nimport { of } from 'rxjs';\nimport { delay, exhaustMap, shareReplay, startWith } from 'rxjs/operators';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Displays the input content when success is set.\n *\n * Can be configured to show for a limited time afterwards, etc.\n */\n@Component({\n selector: 'dbx-action-success',\n template: `\n <ng-container *ngIf=\"show$ | async\">\n <ng-content></ng-content>\n </ng-container>\n `\n})\nexport class DbxActionSuccessComponent {\n\n @Input()\n hideAfter?: number;\n\n readonly show$ = this.source.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n if (this.hideAfter) {\n return of(false).pipe(\n delay(this.hideAfter),\n startWith(true)\n );\n } else {\n return of(true);\n }\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n\n constructor(public readonly source: ActionContextStoreSourceInstance) { }\n\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs/operators';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Host, Input, OnInit, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Performs the action on success.\n */\nexport type SuccessActionFunction<O> = (value: O) => void;\n\n/**\n * Directive that executes a function on ActionContextStore Success.\n */\n@Directive({\n selector: '[dbxActionSuccess]',\n})\nexport class DbxActionSuccessDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _successFunction = new BehaviorSubject<Maybe<SuccessActionFunction<O>>>(undefined);\n readonly successFunction$ = this._successFunction.pipe(filterMaybe(), shareReplay(1));\n\n @Input('dbxActionSuccess')\n get successFunction(): Maybe<SuccessActionFunction<O>> {\n return this._successFunction.value;\n }\n\n set successFunction(successFunction: Maybe<SuccessActionFunction<O>>) {\n this._successFunction.next(successFunction);\n }\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.successFunction$.pipe(\n switchMap(successFunction => this.source.success$.pipe(\n map(x => ([successFunction, x])),\n tap(([successFn, result]) => {\n successFn(result);\n })\n ))\n ).subscribe();\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._successFunction.complete();\n }\n\n}\n","import { Directive, Host, Input, OnInit } from '@angular/core';\nimport { getValueFromObjectOrGetter, Maybe, ObjectOrGetter } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Directive that provides a default value when triggered.\n *\n * No value is required, allowing the directive to automatically call readyValue with undefined.\n */\n@Directive({\n selector: '[dbxActionValue]',\n})\nexport class DbxActionValueDirective<T, O> extends AbstractSubscriptionDirective implements OnInit {\n\n private _valueOrFunction = new BehaviorSubject<Maybe<ObjectOrGetter<T>>>(undefined);\n readonly valueOrFunction$ = this._valueOrFunction.pipe(filterMaybe(), shareReplay(1));\n\n @Input('dbxActionValue')\n get valueOrFunction(): Maybe<ObjectOrGetter<T>> {\n return this._valueOrFunction.value;\n }\n\n set valueOrFunction(valueOrFunction: Maybe<ObjectOrGetter<T>>) {\n this._valueOrFunction.next(valueOrFunction);\n }\n\n constructor(@Host() public readonly source: ActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.valueOrFunction$.pipe(\n switchMap(valueOrFunction => this.source.triggered$.pipe(\n tap(() => {\n const value: T = getValueFromObjectOrGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n ))\n ).subscribe();\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._valueOrFunction.complete();\n }\n\n}\n","import { Component } from '@angular/core';\nimport { ActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Displays the input content when working is set.\n */\n@Component({\n selector: 'dbx-action-working',\n template: `\n <ng-container *ngIf=\"show$ | async\">\n <ng-content></ng-content>\n </ng-container>\n `\n})\nexport class DbxActionWorkingComponent {\n\n readonly show$ = this.source.isWorking$;\n\n constructor(public readonly source: ActionContextStoreSourceInstance) { }\n\n}\n","import { Type } from \"@angular/core\";\nimport { Maybe } from \"@dereekb/util\";\nimport ms from \"ms\";\nimport { ActionContextStoreSourceInstance } from \"../action.store.source\";\n\nexport const DEFAULT_SNACKBAR_DIRECTIVE_DURATION = ms('4s');\nexport const DEFAULT_SNACKBAR_UNDO_DIRECTIVE_DURATION = ms('30s');\n\nexport enum ActionSnackbarDefaultType {\n NONE = 'none',\n CREATE = 'create',\n SAVE = 'save',\n DELETE = 'delete',\n MERGE = 'merge',\n SEND = 'send',\n CANCEL = 'cancel',\n RESTORE = 'restore',\n REFRESH = 'refresh',\n MARK_READ = 'read',\n MARK_UNREAD = 'unread'\n}\n\nexport enum ActionSnackbarEventType {\n WORKING,\n SUCCESS,\n REJECTED\n}\n\nexport interface ActionSnackbarEvent<O = any> {\n type: ActionSnackbarEventType;\n value?: Maybe<O>;\n error?: Maybe<any>;\n}\n\nexport interface ActionSnackBarOpenConfig {\n message: string;\n action?: string;\n}\n\nexport interface ActionSnackbarPopupConfig<C = any> {\n open?: ActionSnackBarOpenConfig;\n component?: Maybe<Type<any>>;\n config?: C;\n}\n\n/**\n * Performs the action on success.\n */\nexport type ActionSnackbarFunction<O = any, C = any> = (event: ActionSnackbarEvent<O>) => ActionSnackbarPopupConfig<C>;\n\nexport interface DbxActionSnackbarGetUndoConfig extends Omit<DbxActionSnackbarComponentConfig, 'message' | 'action'>, Partial<Pick<DbxActionSnackbarComponentConfig, 'message' | 'action'>> {\n duration?: number; // Optional duration override for the popup to stay open.\n}\n\nexport type ActionSnackbarGetUndoConfigFunction = () => Maybe<DbxActionSnackbarGetUndoConfig>;\n\nexport interface DbxActionSnackbarComponentConfig {\n action: string;\n message?: Maybe<string>;\n actionSource: ActionContextStoreSourceInstance;\n}\n","export * from './snackbar';\n// export * from './snackbar.directive';\n","import { delay, first } from 'rxjs/operators';\nimport { ActionContextStoreSource } from './action.store.source';\nimport { HandleActionFunction, handleWorkValueReadyFn, WorkHandlerContextSourceDelegate } from './action.handler';\nimport { ActionContextBaseSource } from './action.holder';\nimport { Destroyable } from '@dereekb/util';\nimport { SubscriptionObject } from '@dereekb/rxjs';\n\nexport interface ActionContextMachineConfig<T = any, O = any> {\n /**\n * Whether or not the machine should clean itself up after being triggered.\n */\n oneTimeUse: boolean;\n handleValueReady: HandleActionFunction<T, O>;\n onSuccess?: (value: O) => void;\n}\n\n/**\n * Configurable machine that handles components of the ActionContextStore lifecycle.\n */\nexport class ActionContextMachine<T = any, O = any> extends ActionContextBaseSource<T, O> implements Destroyable {\n\n private _isShutdown = true;\n private _handleValueReadySub = new SubscriptionObject();\n\n constructor(readonly config: ActionContextMachineConfig<T, O>, source?: ActionContextStoreSource) {\n super(source);\n\n // Handle Value Ready\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n handleWorkValueReadyFn({ handlerFunction: config.handleValueReady, delegate: new WorkHandlerContextSourceDelegate<T, O>(this.sourceInstance) })(value);\n });\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (this.config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (this.config.onSuccess) {\n this.sourceInstance.success$.subscribe(this.config.onSuccess);\n }\n }\n\n override destroy(): void {\n super.destroy();\n this._handleValueReadySub.destroy();\n this._isShutdown = true;\n }\n\n get isShutdown(): boolean {\n return this._isShutdown;\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport {\n DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective,\n DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,\n DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent\n} from './directive';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective,\n DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,\n DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent\n ],\n exports: [\n DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionDisabledUntilModifiedDirective,\n DbxActionAutoTriggerDirective, DbxActionAutoTriggerValueDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,\n DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent\n ]\n})\nexport class DbxCoreActionModule { }\n","import { Type, Provider, forwardRef } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Used for intercepting button click events.\n *\n * Can be used to delay/modify trigger/click behaviors.\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\nexport abstract class DbxButton {\n abstract disabled$: Observable<boolean>;\n abstract working$: Observable<boolean>;\n abstract disabled: Maybe<boolean>;\n abstract working: Maybe<boolean>;\n abstract icon?: string;\n abstract text?: string;\n abstract clicked$: Observable<any>;\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n abstract clickButton(): void;\n}\n\nexport function ProvideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [{\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n","import { Directive, Host, OnInit } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { DbxButton } from '../button';\nimport { ActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Context used for linking a button to an ActionContext and only look for triggers.\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]'\n})\nexport class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective implements OnInit {\n\n constructor(@Host() public readonly button: DbxButton, public readonly source: ActionContextStoreSourceInstance) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.button.clicked$.subscribe(() => {\n this._buttonClicked();\n });\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n\n}\n","import { Directive, Host, OnInit, OnDestroy, NgZone } from '@angular/core';\nimport { DbxButton } from '../button';\nimport { ActionContextStoreSourceInstance } from '../../action/action.store.source';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * Context used for linking a button to an ActionContext.\n */\n@Directive({\n selector: '[dbxActionButton]'\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective implements OnInit, OnDestroy {\n\n private _workingSub = new SubscriptionObject();\n private _disabledSub = new SubscriptionObject();\n\n constructor(@Host() button: DbxButton, source: ActionContextStoreSourceInstance, private readonly ngZone: NgZone) {\n super(button, source);\n }\n\n override ngOnInit(): void {\n super.ngOnInit();\n\n this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {\n // console.log('Working: ', working);\n this.ngZone.run(() => this.button.working = working);\n });\n\n this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {\n // console.log('Disabled: ', disabled);\n this.ngZone.run(() => this.button.disabled = disabled);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._workingSub.destroy();\n this._disabledSub.destroy();\n }\n\n}\n","import { ClickableFunction, ClickableUrl } from './clickable';\nimport { SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, ExpandTreeFunction, FlattenTreeFunction, flattenTreeToArrayFunction, Maybe, TreeNode } from '@dereekb/util';\nimport { Type, Provider, forwardRef } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport interface ClickableAnchor extends ClickableFunction, ClickableUrl, SegueRef {\n disabled?: boolean;\n}\n\nexport interface ClickableAnchorLink extends ClickableAnchor {\n title: string;\n icon?: string;\n}\n\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n icon: string;\n}\n\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n children?: ClickableAnchorLinkTree[];\n}\n\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\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\nexport enum AnchorType {\n /**\n * When the anchor has no specific content but is not disabled.\n * \n * Is a passthrough for the content.\n */\n PLAIN = 0,\n CLICKABLE = 1,\n SREF = 2,\n HREF = 3,\n DISABLED = 4\n}\n\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): AnchorType {\n let type: AnchorType = AnchorType.DISABLED;\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = AnchorType.DISABLED;\n } else if (anchor.ref) {\n type = AnchorType.SREF;\n } else if (anchor.onClick) {\n type = AnchorType.CLICKABLE;\n } else if (anchor.url) {\n type = AnchorType.HREF;\n } else {\n type = AnchorType.PLAIN;\n }\n }\n\n return type;\n}\n\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract disabled$: Observable<Maybe<boolean>>;\n abstract anchor$: Observable<Maybe<T>>;\n abstract disabled: Maybe<boolean>;\n abstract anchor: Maybe<T>;\n abstract type$: Observable<AnchorType>;\n}\n\nexport function ProvideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [{\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n","import { skipFirstMaybe } from '@dereekb/rxjs';\nimport { map, shareReplay, distinctUntilChanged } from 'rxjs/operators';\nimport { BehaviorSubject, combineLatest, Observable, delay } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AnchorType, ClickableAnchor, anchorTypeForAnchor, DbxAnchor } from './anchor';\n\n/**\n * Abstract anchor directive.\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor {\n\n private _disabled = new BehaviorSubject<Maybe<boolean>>(false);\n private _anchor = new BehaviorSubject<Maybe<T>>(undefined);\n\n readonly disabled$ = this._disabled.asObservable();\n readonly anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly type$: Observable<AnchorType> = combineLatest([this.disabled$, this.anchor$]).pipe(\n delay(0),\n map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n @Input()\n public get anchor(): Maybe<T> {\n return this._anchor.value;\n }\n\n public set anchor(anchor: Maybe<T>) {\n this._anchor.next(anchor);\n }\n\n @Input()\n public get disabled(): Maybe<boolean> {\n return this._disabled.value;\n }\n\n public set disabled(disabled: Maybe<boolean>) {\n this._disabled.next(disabled);\n }\n\n}\n","export enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'ended'\n}\n\nexport interface DbxRouterTransitionEvent {\n type: DbxRouterTransitionEventType;\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { SegueRef } from \"../../../segue\";\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from \"../../transition/transition\";\nimport { ActivatedRoute, NavigationBehaviorOptions, NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';\nimport { Injectable } from \"@angular/core\";\nimport { isArray } from \"class-validator\";\nimport { map } from \"rxjs/operators\";\nimport { Maybe } from '@dereekb/util';\n\n/**\n * AngularRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\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 constructor(readonly router: Router, readonly activatedRoute: ActivatedRoute) { }\n\n go(segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions>): Promise<boolean> {\n let ref = segueRef.ref;\n\n if (isArray(ref)) {\n return this.router.navigate(ref, {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n })\n } else {\n return this.router.navigateByUrl(ref, {\n ...segueRef.refOptions\n });\n }\n }\n\n isActive(segueRef: SegueRef<any>): boolean {\n return false; // TODO!\n }\n\n comparePrecision(a: SegueRef, b: SegueRef): number {\n return 0; // TODO!\n }\n\n}\n","import { SegueRef } from \"../../segue\";\n\n/**\n * Router service definition that can route the app and provide routing details.\n */\nexport abstract class DbxRouterService {\n\n /**\n * Navigates to the target SegueRef.\n * \n * @param segueRef \n */\n abstract go(segueRef: SegueRef): Promise<boolean>;\n\n /**\n * Returns true if the input segue ref is considered active.\n * \n * @param segueRef \n */\n abstract isActive(segueRef: SegueRef): 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: SegueRef, b: SegueRef): number;\n\n}\n","import { Observable } from 'rxjs';\nimport { DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Router service definition that provides high level information about router transitions.\n */\nexport abstract class DbxRouterTransitionService {\n\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n\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}\n","import { mergeArrayIntoArray, objectFlatMergeMatrix } from '@dereekb/util';\nimport { Ng2StateDeclaration } from '@uirouter/angular';\n\n/**\n * Used for creating a future state that also captures any children urls.\n * \n * This is important for cases, such as /, where multiple urls should target a specific future so that \n * it can load that module and continue route resolution for the child url.\n * \n * For example:\n * - the urls /a and /b are declared in a lazy loaded module that is for /. This presents a problem, since\n * the root module does not know how to handle /a or /b, since they are children of /. We use \n * futureStateWithChildrenUrls() to build a future state with the child urls so the parent routing knows where\n * to send /a or /b.\n * \n * @param state \n * @param urls \n * @returns \n * \n * @deprecated not how this feature works. Consider adding it to ui-router later then re-export this function.\n */\nfunction futureStateWithChildrenUrls(state: Ng2StateDeclaration, urls: string[]): Ng2StateDeclaration[] {\n const states = [state];\n mergeArrayIntoArray(states, expandFutureStateWithUrls(state, urls));\n return states;\n}\n\n/**\n * Copies the input state and replaces the url in each of them with the passed urls.\n * \n * @param state \n * @param urls \n * @returns \n * \n * @deprecated\n */\nfunction expandFutureStateWithUrls(state: Ng2StateDeclaration, urls: string[]): Ng2StateDeclaration[] {\n const childrenStates = objectFlatMergeMatrix(state, urls.map(url => ({ url })));\n return childrenStates;\n}\n","import { Subject } from 'rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { SegueRef } from \"../../../segue\";\nimport { StateService, UIRouterGlobals, TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable } from \"@angular/core\";\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\n\n/**\n * UIRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService {\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor(readonly state: StateService, readonly transitionService: TransitionService, readonly uiRouterGlobals: UIRouterGlobals) {\n\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n }\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n }) as any;\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n }) as any;\n\n }\n\n go(segueRef: SegueRef<TransitionOptions>): Promise<boolean> {\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state.go(segueRef.ref, params, segueRef.refOptions).then(_ => true).catch(_ => false);\n }\n\n isActive(segueRef: SegueRef): boolean {\n const { ref, refParams } = segueRef;\n\n const targetRef = (ref.startsWith('.') ? `^${ref}` : ref);\n const active = this.state.includes(targetRef, refParams);\n return active;\n }\n\n comparePrecision(a: SegueRef, b: SegueRef): number {\n const aLength = (a.ref as string).length;\n const bLength = (b.ref as string).length;\n return (aLength > bLength) ? 1 : (aLength === bLength) ? 0 : -1;\n }\n\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n@NgModule({})\nexport class DbxCoreUIRouterSegueModule {\n\n static forRoot(): ModuleWithProviders<DbxCoreUIRouterSegueModule> {\n return {\n ngModule: DbxCoreUIRouterSegueModule,\n providers: [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ]\n };\n }\n\n}\n","import { filter, MonoTypeOperatorFunction, Observable } from \"rxjs\";\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from \"./transition\";\n\n/**\n * Convenience function for filtering success from the input observable.\n * \n * @param obs \n * @returns \n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter(x => x.type === type);\n}\n","import { Observable, startWith } from 'rxjs';\nimport { Directive, NgZone } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n\n readonly transitionSuccess$ = successTransition(this.dbNgxRouterTransitionService.transitions$);\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n\n constructor(protected readonly dbNgxRouterTransitionService: DbxRouterTransitionService) { }\n\n}\n","import { Directive, NgZone, OnDestroy, OnInit } from '@angular/core';\nimport { SubscriptionObject } from '@dereekb/rxjs';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { AbstractTransitionDirective } from './transition.directive';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective implements OnInit, OnDestroy {\n\n private _transitionSub = new SubscriptionObject();\n\n ngOnInit(): void {\n this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n });\n }\n\n ngOnDestroy(): void {\n this._transitionSub.destroy();\n }\n\n constructor(dbNgxRouterTransitionService: DbxRouterTransitionService, protected readonly ngZone: NgZone) {\n super(dbNgxRouterTransitionService);\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n\n}\n","import { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nexport type SegueRefRouterLink = string | any[] | any;\n\nexport interface SegueRefRawSegueParams {\n [key: string]: any;\n}\n\nexport interface SegueRefOptions<O = any> {\n\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/**\n * Represents a segue ref\n */\nexport interface SegueRef<O = any> extends SegueRefOptions<O> {\n\n /**\n * UI Sref reference value.\n */\n ref?: SegueRefRouterLink;\n\n}\n\nexport function refStringToSegueRef<O = any>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\nexport function mapRefStringObsToSegueRefObs<O = any>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map(x => refStringToSegueRef(x, options)));\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, OnInit, OnDestroy, Input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { shareReplay, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';\nimport { DbxButton } from '../button';\nimport { BehaviorSubject } from 'rxjs';\nimport { SegueRef, DbxRouterService } from '../../router';\n\n// MARK: Button Directives\n@Directive({\n selector: '[dbxButtonSegue]'\n})\nexport class DbxButtonSegueDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _segueRef = new BehaviorSubject<Maybe<SegueRef>>(undefined);\n readonly segueRef$ = this._segueRef.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n @Input('dbxButtonSegue')\n get segueRef(): Maybe<SegueRef> {\n return this._segueRef.value;\n }\n\n set segueRef(segueRef: Maybe<SegueRef>) {\n this._segueRef.next(segueRef);\n }\n\n constructor(readonly dbxButton: DbxButton, readonly dbxRouterService: DbxRouterService) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.segueRef$.pipe(\n switchMap(segueRef => this.dbxButton.clicked$.pipe(\n tap(() => {\n this.dbxRouterService.go(segueRef);\n })\n ))\n ).subscribe();\n }\n\n}\n","import { Directive, Input, Output, EventEmitter, OnDestroy, OnInit } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, of, Subject } from 'rxjs';\nimport { filter, first, switchMap } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton, DbxButtonInterceptor, ProvideDbxButton } from './button';\n\n/**\n * Abstract button component.\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective extends AbstractSubscriptionDirective implements DbxButton, OnInit, OnDestroy {\n\n private _disabled = new BehaviorSubject<boolean>(false);\n private _working = new BehaviorSubject<boolean>(false);\n\n readonly disabled$ = this._disabled.asObservable();\n readonly working$ = this._working.asObservable();\n\n @Input()\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: boolean) {\n this._disabled.next(disabled);\n }\n\n @Input()\n get working(): boolean {\n return this._working.value;\n }\n\n set working(working: boolean) {\n this._working.next(working);\n }\n\n @Input()\n icon?: string;\n\n @Input()\n text?: string;\n\n @Output()\n readonly buttonClick = new EventEmitter();\n\n readonly clicked$ = this.buttonClick.asObservable();\n\n constructor() {\n super();\n }\n\n /**\n * Pre-interceptor button click.\n */\n protected _buttonClick = new Subject<void>();\n protected _buttonInterceptor = new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined);\n\n ngOnInit(): void {\n this.sub = this._buttonClick.pipe(\n switchMap(() => this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(\n first()\n );\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n ))\n ).subscribe(() => {\n this._forceButtonClicked();\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this._working.complete();\n this._buttonClick.complete();\n this._buttonInterceptor.complete();\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\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\n// MARK: Implementation\n/**\n * Provides an DbxButton directive.\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: ProvideDbxButton(DbxButtonDirective)\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective { }\n","import { Directive, Host, Input, NgZone } from '@angular/core';\nimport { LoadingContext } from '@dereekb/rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton } from './button';\n\n/**\n * Context used for linking a button to a LoadingContext.\n *\n * It will be set working when the context is set loading.\n */\n@Directive({\n selector: '[dbxLoadingButton]'\n})\nexport class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {\n\n constructor(@Host() public readonly button: DbxButton, readonly ngZone: NgZone) {\n super();\n }\n\n /**\n * Sets a LoadingContext that is watched for the loading state.\n */\n @Input('dbxLoadingButton')\n set context(context: LoadingContext) {\n let subscription;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => {\n this.ngZone.run(() => this.button.working = x.loading);\n });\n }\n\n this.sub = subscription;\n }\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\n@NgModule({\n imports: [],\n declarations: [\n DbxButtonDirective,\n DbxLoadingButtonDirective,\n DbxActionButtonTriggerDirective,\n DbxActionButtonDirective,\n DbxButtonSegueDirective\n ],\n exports: [\n DbxButtonDirective,\n DbxLoadingButtonDirective,\n DbxActionButtonTriggerDirective,\n DbxActionButtonDirective,\n DbxButtonSegueDirective\n ],\n})\nexport class DbxCoreButtonModule { }\n","import { addMinutes } from 'date-fns';\nimport { Pipe, PipeTransform, Inject, LOCALE_ID } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and number of minutes and outputs a formatted date.\n */\n@Pipe({ name: 'dateFromPlusTo' })\nexport class DateFromToTimePipe implements PipeTransform {\n\n constructor(@Inject(LOCALE_ID) private locale: string) { }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: number): Maybe<string> {\n return DateFromToTimePipe.formatFromTo(input, format, minutes, this.locale);\n }\n\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: number, 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}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'minutesString', pure: false })\nexport class MinutesStringPipe implements PipeTransform {\n\n transform(input: Maybe<number | string>): Maybe<string> {\n const minutes = Number(input);\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > 3600) {\n const unrounded = minutes / 3600;\n const days = Math.ceil(unrounded);\n return ((unrounded !== days) ? '~' : '') + days + ' days';\n } else if (minutes > 180) {\n const unrounded = minutes / 60;\n const hours = Math.ceil(unrounded);\n return ((unrounded !== hours) ? '~' : '') + hours + ' hours';\n } else {\n return minutes + ' minutes';\n }\n } else {\n return undefined;\n }\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'toJsDate' })\nexport class ToJsDatePipe implements PipeTransform {\n\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n return (input) ? toJsDate(input) : undefined;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({ name: 'timeCountdownDistance', pure: false })\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n\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@Pipe({ name: 'timeDistance', pure: false })\nexport class TimeDistancePipe implements PipeTransform {\n\n transform(input: Maybe<DateOrDateString>, to: Date = new Date(), unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input)!;\n return formatDistance(from, to, {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'toMinutes' })\nexport class ToMinutesPipe implements PipeTransform {\n\n transform(milliseconds: number): number {\n if (milliseconds) {\n return Math.floor(milliseconds / (60 * 1000));\n }\n\n return milliseconds;\n }\n\n}\n","import { Pipe, PipeTransform, Inject, LOCALE_ID } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and appends the distance to it in parenthesis.\n */\n@Pipe({ name: 'dateFormatDistance', pure: false })\nexport class DateFormatDistancePipe implements PipeTransform {\n\n constructor(@Inject(LOCALE_ID) private locale: string) { }\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\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}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { formatDistance, isPast, isSameDay, startOfDay } from 'date-fns';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({ name: 'dateDistance', pure: false })\nexport class DateDistancePipe implements PipeTransform {\n\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const useDefaultTo: boolean = !to;\n\n if (useDefaultTo) {\n to = new Date();\n }\n\n const from = ToJsDatePipe.toJsDate(input)!;\n\n const fromStart = startOfDay(from);\n const toStart = startOfDay(to!);\n\n if (isSameDay(fromStart, toStart)) {\n let text;\n\n if (useDefaultTo || isSameDay(from, new Date())) {\n text = 'Today';\n } else {\n text = 'Same Day';\n }\n\n return text;\n } else {\n return formatDistance(fromStart, toStart, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { DateFromToTimePipe } from './datefromtoformat.pipe';\nimport { MinutesStringPipe } from './minutesstring.pipe';\nimport { TimeDistanceCountdownPipe, TimeDistancePipe } from './timedistance.pipe';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { ToMinutesPipe } from './tominutes.pipe';\nimport { DateFormatDistancePipe } from './dateformatdistance.pipe';\nimport { DateDistancePipe } from './datedistance.pipe';\n\n@NgModule({\n exports: [\n DateFromToTimePipe,\n DateFormatDistancePipe,\n MinutesStringPipe,\n TimeDistanceCountdownPipe,\n TimeDistancePipe,\n DateDistancePipe,\n ToJsDatePipe,\n ToMinutesPipe\n ],\n declarations: [\n DateFromToTimePipe,\n DateFormatDistancePipe,\n MinutesStringPipe,\n TimeDistanceCountdownPipe,\n TimeDistancePipe,\n DateDistancePipe,\n ToJsDatePipe,\n ToMinutesPipe\n ]\n})\nexport class DbxDatePipeModule { }\n","import { of, Observable } from 'rxjs';\nimport { Directive, OnDestroy, OnInit } from '@angular/core';\nimport { FilterSource, FilterSourceInstance, ObservableGetter } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract FilterSource implementation.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F> implements FilterSource<F>, OnInit, OnDestroy {\n\n protected _defaultFilterSource = new FilterSourceInstance<F>();\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnInit(): void {\n this._defaultFilterSource.setDefaultFilter(this.makeDefaultFilter());\n }\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\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 // MARK: Internal\n protected makeDefaultFilter(): ObservableGetter<Maybe<F>> {\n return of(undefined);\n }\n\n}\n","import { HandleActionFunction } from '../../action/action.handler';\nimport { AbstractFilterSourceDirective } from '../filter.abstract.source.directive';\nimport { Directive, ViewChild } from '@angular/core';\nimport { of } from 'rxjs';\nimport { ActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Abstract filter source for components that use an action to filter.\n */\n@Directive()\nexport abstract class AbstractActionFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {\n\n @ViewChild(ActionContextStoreSourceInstance, { static: true, read: ActionContextStoreSourceInstance })\n readonly filterAction!: ActionContextStoreSourceInstance;\n\n applyFilter(): void {\n this.filterAction.setIsModified(true); // Force setting modified.\n this.filterAction.trigger();\n }\n\n /**\n * Pre-set action handler for the template to use to set the filter.\n */\n setFilterAction: HandleActionFunction<F> = (filter: F) => {\n this.setFilter(filter);\n return of(true);\n }\n\n}\n","import { Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { FilterSourceConnector, FilterSource } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract FilterSourceConnector directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, OnDestroy {\n\n private _source = new BehaviorSubject<Maybe<FilterSource<F>>>(undefined);\n\n readonly filter$: Observable<Maybe<F>> = this._source.pipe(\n switchMap(x => x?.filter$ ?? of(undefined)),\n shareReplay(1)\n );\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n\n}\n","import { FilterSource, FilterSourceConnector } from \"@dereekb/rxjs\";\nimport { forwardRef, Provider, Type } from '@angular/core';\n\n/**\n * Angular provider convenience function for a FilterSource.\n */\nexport function ProvideFilterSource<S extends FilterSource<any>>(sourceType: Type<S>): Provider[] {\n return [{\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n\n/**\n * Angular provider convenience function for a FilterSourceConnector.\n */\nexport function ProvideFilterSourceConnector<S extends FilterSourceConnector<any>>(sourceType: Type<S>): Provider[] {\n return [{\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n }, {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { ProvideFilterSource, ProvideFilterSourceConnector } from './filter.content';\n\n/**\n * Used as a FilterSource and FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [\n ...ProvideFilterSource(DbxFilterSourceConnectorDirective),\n ...ProvideFilterSourceConnector(DbxFilterSourceConnectorDirective)\n ]\n})\nexport class DbxFilterSourceConnectorDirective<F> extends AbstractFilterSourceConnectorDirective<F> { }\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { FilterMapKey, FilterMap } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n\n protected _key = new BehaviorSubject<Maybe<FilterMapKey>>(undefined);\n readonly key$ = this._key.pipe(filterMaybe());\n\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.key$);\n\n constructor(readonly dbxFilterMap: FilterMap<F>) { }\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n\n}\n","import { FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { ProvideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [\n ...ProvideFilterSource(DbxFilterMapSourceDirective)\n ]\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap(x => x.filter$));\n\n @Input('dbxFilterMapSource')\n get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n initWithFilter?(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n\n}\n","import { first } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { ProvideFilterSource, ProvideFilterSourceConnector } from './filter.content';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Acts as an \"input\" FilterSourceConnector for an FilterMap, as well as a source for the FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [\n ...ProvideFilterSource(DbxFilterMapSourceConnectorDirective),\n ...ProvideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)\n ]\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends DbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n\n @Input('dbxFilterMapSourceConnector')\n override get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n override set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.connectWithSource(filterSource));\n }\n\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\n\n/**\n * Direction that provides an FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap]\n})\nexport class DbxFilterMapDirective<F> implements OnDestroy {\n\n constructor(readonly filterMap: FilterMap<F>) { }\n\n ngOnDestroy(): void {\n this.filterMap.destroy();\n }\n\n}\n","import { Directive } from '@angular/core';\nimport { ProvideFilterSource } from './filter.content';\nimport { AbstractFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Basic filter source directive.\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: ProvideFilterSource(DbxFilterSourceDirective)\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> { }\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\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';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n DbxFilterSourceDirective,\n DbxFilterSourceConnectorDirective,\n DbxFilterMapDirective,\n DbxFilterMapSourceConnectorDirective,\n DbxFilterMapSourceDirective,\n ],\n exports: [\n DbxFilterSourceDirective,\n DbxFilterSourceConnectorDirective,\n DbxFilterMapDirective,\n DbxFilterMapSourceConnectorDirective,\n DbxFilterMapSourceDirective,\n ]\n})\nexport class DbxCoreFilterModule { }\n","import { InjectionToken, Injector, NgModuleRef, StaticProvider, TemplateRef, Type, ViewRef } from \"@angular/core\";\nimport { filterMaybeValues, Maybe, mergeArrays, mergeIntoArray, mergeObjects } from \"@dereekb/util\";\n\nexport const DBX_INJECTED_COMPONENT_DATA = new InjectionToken('DbxInjectedComponentConfigData');\n\nexport interface DbxInjectedComponentConfig<T = any> {\n /**\n * Type of Component to initialize.\n */\n componentClass: Type<T>;\n /**\n * (Optional) providers to provide to the existing injector.\n */\n providers?: StaticProvider[];\n /**\n * (Optional) Custom Injector to use when creating the component. If provided, providers is ignored.\n */\n injector?: Injector;\n /**\n * (Optional) Module ref to use when creating the component.\n */\n ngModuleRef?: NgModuleRef<unknown>;\n /**\n * (Optional) Custom initialization code when an instance is created.\n */\n init?: (instance: T) => void;\n /**\n * Any optional data to inject into the component.\n */\n data?: any;\n}\n\nexport interface DbxInjectedTemplateConfig<T = any> {\n /**\n * Template ref to display.\n */\n templateRef?: Maybe<TemplateRef<T>>;\n /**\n * View ref to inject.\n */\n viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Merges multiple configurations into a single configuration.\n * \n * @param configs \n * @returns \n */\nexport function mergeDbxInjectedComponentConfigs(configs: Maybe<Partial<DbxInjectedComponentConfig>>[]): Partial<DbxInjectedComponentConfig> {\n const providers = mergeArrays(filterMaybeValues(configs).map(x => x.providers));\n const result = mergeObjects(configs);\n result.providers = providers;\n return result;\n}\n","import { ComponentRef, Injector, ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs/operators';\nimport { BehaviorSubject, combineLatest } from 'rxjs';\nimport { DbxInjectedComponentConfig, DbxInjectedTemplateConfig, DBX_INJECTED_COMPONENT_DATA } from './injected';\nimport { Initialized, Destroyable, Maybe, mergeArrayOrValueIntoArray } from '@dereekb/util';\nimport { SubscriptionObject, filterMaybe, skipFirstMaybe } from '@dereekb/rxjs';\n\n/**\n * Instance used by components to inject content based on the configuration into the view.\n */\nexport class DbxInjectedComponentInstance<T> implements Initialized, Destroyable {\n\n private _subscriptionObject = new SubscriptionObject();\n\n private _config = new BehaviorSubject<Maybe<DbxInjectedComponentConfig<T>>>(undefined);\n private _template = new BehaviorSubject<Maybe<DbxInjectedTemplateConfig<T>>>(undefined);\n\n private _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n readonly config$ = this._config.pipe(distinctUntilChanged());\n readonly template$ = this._template.pipe(distinctUntilChanged());\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): Maybe<DbxInjectedComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: Maybe<DbxInjectedComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): Maybe<DbxInjectedTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: Maybe<DbxInjectedTemplateConfig<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(private readonly _injector: Injector) { }\n\n init(): void {\n\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 skipFirstMaybe()\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._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectedComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n let injector: Injector | undefined;\n const parentInjector = inputInjector ?? this._injector;\n\n if (Boolean(providers || data)) {\n injector = Injector.create({\n parent: parentInjector,\n providers: mergeArrayOrValueIntoArray([{\n provide: DBX_INJECTED_COMPONENT_DATA,\n useValue: data\n }], providers ?? [])\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n\n const instance = componentRef.instance;\n\n if (init) {\n init(instance);\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectedTemplateConfig<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\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}\n","import { ViewContainerRef, OnInit, OnDestroy, Directive, Injector } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DbxInjectedComponentConfig, DbxInjectedTemplateConfig } from './injected';\nimport { DbxInjectedComponentInstance } from './injected.instance';\n\n/**\n * Abstract directive that injects content based on the configuration into the view.\n */\n@Directive()\nexport abstract class AbstractDbxInjectedDirective<T> implements OnInit, OnDestroy {\n\n private _instance = new DbxInjectedComponentInstance<T>(this._injector);\n\n constructor(private readonly _injector: Injector) { }\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n setConfig(config: Maybe<DbxInjectedComponentConfig>) {\n this._instance.config = config;\n }\n\n setTemplate(template: Maybe<DbxInjectedTemplateConfig>) {\n this._instance.template = template;\n }\n\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n\n}\n","import { Component, ViewChild, ViewContainerRef, Input } from '@angular/core';\nimport { DbxInjectedComponentConfig, DbxInjectedTemplateConfig } from './injected';\nimport { AbstractDbxInjectedDirective } from './injected.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injected-content, [dbx-injected-content]',\n template: `<ng-template #content></ng-template>`\n})\nexport class DbxInjectedComponent<T> extends AbstractDbxInjectedDirective<T> {\n\n @Input()\n set config(config: Maybe<DbxInjectedComponentConfig<T>>) {\n this.setConfig(config);\n }\n\n @Input()\n set template(template: Maybe<DbxInjectedTemplateConfig<T>>) {\n this.setTemplate(template);\n }\n\n @ViewChild('content', { static: true, read: ViewContainerRef })\n set content(content: Maybe<ViewContainerRef>) {\n this.setContent(content);\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { DbxInjectedComponent } from './injected.component';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n DbxInjectedComponent\n ],\n exports: [\n DbxInjectedComponent\n ],\n})\nexport class DbxInjectedComponentModule { }\n","import { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { timeHasExpired, unixTimeNumberForNow } from '@dereekb/date';\nimport { filterMaybeValuesFn, DataDoesNotExistError, DataIsExpiredError, ReadStoredData, StoredData, StoredDataStorageKey, StoredDataString, Maybe } from '@dereekb/util';\nimport { StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\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 * SimpleStorageAccessor delegate.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {\n\n\n}\n\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n\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\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n\n constructor(\n private _delegate: StorageAccessor<StoredDataString>,\n private _converter: SimpleStorageAccessorConverter<T>\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<{}> {\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\nexport interface SimpleStorageAccessorConfig {\n /**\n * Storage Key Prefix\n */\n readonly prefix: string;\n /**\n * Optional prefix/value splitter.\n */\n readonly prefixSplitter?: string;\n /**\n * Number in milliseconds that objects stored will expire in.\n */\n readonly expiresIn?: number;\n}\n\n/**\n * LimitedStorageAccessor implementation that uses a Delegate\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n\n static readonly PREFIX_SPLITTER = '::';\n\n protected readonly _config: SimpleStorageAccessorConfig & {\n fullPrefix: string;\n };\n\n constructor(private readonly _delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n this.assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\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.map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n }).filter(filterMaybeValuesFn)\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(\n map((keys) => keys.map(x => this.decodeStorageKey(x)))\n );\n }\n\n clear(): Observable<{}> {\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: unixTimeNumberForNow(),\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 timeHasExpired(storeData.storedAt, expiresIn);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.');\n }\n\n if (!this.isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n }\n\n protected isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix && prefix.indexOf(prefixSpltter) === -1);\n }\n\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 = storageKey.split(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}\n","import { Observable } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { StorageAccessor } from './storage.accessor';\nimport { StoredDataString, FullStorageObject, StorageObjectUtility, Maybe } from '@dereekb/util';\n\n/**\n * Simple StorageAccessor implementation that wraps a FullStorageObject.\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n\n constructor(private readonly _storage: FullStorageObject) { }\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 => 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}\n","import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_UTIL_DEFAULT_STORAGE_OBJECT');\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_UTIL_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Inject, Injectable } from '@angular/core';\nimport { StorageAccessor } from './storage.accessor';\nimport { SimpleStorageAccessorConfig, SimpleStorageAccessor, SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { FullStorageObject, StoredDataString } from '@dereekb/util';\n\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Used for building SimpleStorageAccessor instances from SimpleStorageAccessorConfig.\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n\n constructor(@Inject(DEFAULT_STORAGE_OBJECT_TOKEN) readonly storageObject: FullStorageObject) { }\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}\n","import { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Stored object accessor that can get/set/remove via a key, or be cleared entirely.\n */\nexport abstract class LimitedStorageAccessor<T> {\n\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<{}>;\n\n}\n\n/**\n * LimitedStorageAccessor extension that has knowledge of all stored keys.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n\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/**\n * StorageAccessor-like object that has immediate/synchronous functionality for get/set.\n */\nexport abstract class InstantStorageAccessor<T> {\n\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}\n","import { FullStorageObject, Maybe, StorageObject, StorageObjectUtility, StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * StorageObject using LocalStorage.\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n\n constructor(private _localStorage: StorageObject) { }\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 (e) {\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}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * FullStorageObject implementation that uses a localstorage that entirely resides in memory.\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n\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}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { 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\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@NgModule()\nexport class DbxStorageModule {\n\n static forRoot(): ModuleWithProviders<DbxStorageModule> {\n return {\n ngModule: DbxStorageModule,\n providers: [{\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n }, {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useClass: SimpleStorageAccessorFactory\n }, {\n provide: SimpleStorageAccessorFactory,\n useExisting: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN\n }]\n };\n }\n\n}\n","import { MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { ChangeDetectorRef, ViewRef, ElementRef } from \"@angular/core\";\nimport { Maybe } from \"@dereekb/util\";\n\n/**\n * Convenience function used within observables for views that need to detect changes after a value changes.\n * \n * @param cdRef \n * @param timeout \n * @returns \n */\nexport function tapDetectChanges<T>(cdRef: ChangeDetectorRef, timeout = 0): MonoTypeOperatorFunction<T> {\n return tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout));\n}\n\n/**\n * Triggers a detection change on the input view as long as the view has not been destroyed.\n * \n * @param cdRef \n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n if (!(cdRef as ViewRef).destroyed) {\n cdRef.detectChanges();\n }\n}\n\n/**\n * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,\n * or more specifically if the parent component passed any target content to the child. This will still return true if\n * passed content is empty.\n *\n * TS:\n * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;\n *\n * HTML:\n * <div #customContent>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\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":["delay","filter","startWith","switchMap","shareReplay","first","tap"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA;;;MAIsB,6BAA6B;IAIjD,YAAY,YAA2B;QAF/B,wBAAmB,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAGrD,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC;KACzB;IAED,WAAW;QACT,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;KACpC;IAED,IAAc,GAAG,CAAC,YAAsC;QACtD,IAAI,CAAC,mBAAmB,CAAC,YAAY,GAAG,YAAY,CAAC;KACtD;;0HAdmB,6BAA6B;8GAA7B,6BAA6B;2FAA7B,6BAA6B;kBADlD,SAAS;;AAoBV;;;MAIsB,oCAAqC,SAAQ,6BAA6B;IADhG;;QAGW,YAAO,GAAG,IAAI,OAAO,EAAE,CAAC;KAUlC;IARU,WAAW;QAClB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;KAC1D;IAES,gBAAgB;QACxB,KAAK,CAAC,WAAW,EAAE,CAAC;KACrB;;iIAVmB,oCAAoC;qHAApC,oCAAoC;2FAApC,oCAAoC;kBADzD,SAAS;;;ACrBV;;;MAGsB,wBAAwB;CAO7C;AAED;;;MAGsB,iCAAoD,SAAQ,wBAA8B;CAAI;SAEpG,4BAA4B,CAAO,GAAgD;IACjG,OAAO,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACjC,CAAC;SAIe,eAAe,CAA4B,MAAsC,EAAE,MAAwC;IACzI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CACvB,SAAS,CAAC,MAAM,CAAC,CAClB,CAAC;AACJ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;;;;;;"}
1
+ {"version":3,"file":"dereekb-dbx-core.mjs","sources":["../../../../packages/dbx-core/src/lib/subscription/subscription.directive.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/directive/state/action.value.stream.directive.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/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.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.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/action.handler.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.handler.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.component.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.success.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.value.directive.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.working.component.ts","../../../../packages/dbx-core/src/lib/action/directive/state/action.enforce.modified.directive.ts","../../../../packages/dbx-core/src/lib/action/action.machine.ts","../../../../packages/dbx-core/src/lib/action/action.module.ts","../../../../packages/dbx-core/src/lib/action/action.reference.ts","../../../../packages/dbx-core/src/lib/util/view.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/router/anchor/anchor.ts","../../../../packages/dbx-core/src/lib/router/anchor/anchor.directive.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/service/router.service.ts","../../../../packages/dbx-core/src/lib/router/router/service/router.transition.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/util/future.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.module.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/segue.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/pipe/date/datefromtoformat.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/minutesstring.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/tojsdate.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/date/dateformatdistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/datedistance.pipe.ts","../../../../packages/dbx-core/src/lib/pipe/date/date.pipe.module.ts","../../../../packages/dbx-core/src/lib/filter/filter.abstract.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/action/action.filter.source.directive.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.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.source.directive.ts","../../../../packages/dbx-core/src/lib/filter/filter.module.ts","../../../../packages/dbx-core/src/lib/injected/injected.ts","../../../../packages/dbx-core/src/lib/injected/injected.instance.ts","../../../../packages/dbx-core/src/lib/injected/injected.directive.ts","../../../../packages/dbx-core/src/lib/injected/injected.component.ts","../../../../packages/dbx-core/src/lib/injected/injected.component.module.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.module.ts","../../../../packages/dbx-core/src/dereekb-dbx-core.ts"],"sourcesContent":["import { OnDestroy, Directive, Inject } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { SubscriptionObject, LockSet } from '@dereekb/rxjs';\n\n/**\n * Abstract component that contains a SubscriptionObject and will clean it up automatically.\n */\n@Directive()\nexport abstract class AbstractSubscriptionDirective implements OnDestroy {\n\n private _subscriptionObject = new SubscriptionObject();\n\n constructor(subscription?: Subscription) {\n this.sub = subscription;\n }\n\n ngOnDestroy(): void {\n this._subscriptionObject.destroy();\n }\n\n protected set sub(subscription: Subscription | undefined) {\n this._subscriptionObject.subscription = subscription;\n }\n\n}\n\n\n/**\n * AbstractSubscriptionDirective extension that prevents the OnDestroy from occuring until the lockset is unlocked.\n */\n@Directive()\nexport abstract class AbstractLockSetSubscriptionDirective extends AbstractSubscriptionDirective implements OnDestroy {\n\n readonly lockSet = new LockSet();\n\n override ngOnDestroy(): void {\n this.lockSet.onNextUnlock(() => this.onLockSetDestroy());\n }\n\n protected onLockSetDestroy(): void {\n super.ngOnDestroy();\n }\n\n}\n","import { first, switchMap } from 'rxjs/operators';\nimport { Observable, Subscription } from 'rxjs';\nimport { forwardRef, Injectable, Provider, Type } from '@angular/core';\nimport { LockSet, filterMaybe, LoadingState, LoadingStateType } from '@dereekb/rxjs';\nimport { OnDestroy } from '@angular/core';\nimport { Maybe, ReadableError } from '@dereekb/util';\nimport { ActionContextState, ActionContextStore } from './action.store';\nimport { DbxActionDisabledKey, DbxActionState } from './action';\n\n/**\n * Source that provides a ActionContextStore observable.\n */\nexport abstract class ActionContextStoreSource<T = any, O = any> {\n /**\n * Observable referencing the ActionContextStore.\n *\n * This observable by design is pre-filtered to not return null values.\n */\n abstract readonly store$: Observable<ActionContextStore<T, O>>;\n}\n\n/**\n * Secondary source. Used by DbxActionContextComponent to find secondary sources.\n */\nexport abstract class SecondaryActionContextStoreSource<T = any, O = any> extends ActionContextStoreSource<T, O> { }\n\nexport function actionContextStoreSourcePipe<T, O>(obs: Observable<Maybe<ActionContextStore<T, O>>>): Observable<ActionContextStore<T, O>> {\n return obs.pipe(filterMaybe());\n}\n\nexport type PipeActionStoreFunction<R, T, O> = (store: ActionContextStore<T, O>) => Observable<R>;\n\nexport function pipeActionStore<R = any, T = any, O = any>(source: ActionContextStoreSource<T, O>, pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R> {\n return source.store$.pipe(\n switchMap(pipeFn)\n );\n}\n\nexport type UseActionStoreFunction<T, O> = (store: ActionContextStore<T, O>) => void;\n\n/**\n * Convenience function for subscribing to the input source once and using the provided store.\n */\nexport function useActionStore<T = any, O = any>(source: ActionContextStoreSource<T, O>, useFn: UseActionStoreFunction<T, O>): Subscription {\n return source.store$.pipe(first()).subscribe(useFn);\n}\n\n/**\n * Service that wraps a ActionContextStoreSource.\n */\n@Injectable()\nexport class DbxActionContextStoreSourceInstance<T = any, O = any> implements ActionContextStoreSource, OnDestroy {\n\n readonly lockSet = new LockSet();\n\n constructor(readonly source: ActionContextStoreSource<T, O>) {\n if (!source) {\n throw new Error('Source is required.');\n }\n }\n\n public ngOnDestroy(): 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 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 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 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 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 setIsModified(isModified?: boolean | Observable<boolean> | Observable<void>): void {\n this.useStore((x) => x.setIsModified(isModified));\n }\n\n public trigger(): void {\n this.useStore((x) => x.trigger());\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}\n\nexport const actionContextStoreSourceInstanceFactory = (source: ActionContextStoreSource) => {\n return new DbxActionContextStoreSourceInstance(source);\n};\n\n/**\n * Provides an ActionContextStoreSource, as well as an DbxActionContextStoreSourceInstance.\n */\nexport function ProvideActionStoreSource<S>(sourceType: Type<S>): Provider[] {\n return [{\n provide: ActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n {\n provide: DbxActionContextStoreSourceInstance,\n useFactory: actionContextStoreSourceInstanceFactory,\n deps: [ActionContextStoreSource]\n }];\n}\n\nexport function ProvideSecondaryActionStoreSource<S>(sourceType: Type<S>): Provider[] {\n return [{\n provide: SecondaryActionContextStoreSource,\n useExisting: forwardRef(() => sourceType)\n },\n ...ProvideActionStoreSource(sourceType)\n ];\n}\n","import { Directive, Input, OnInit, OnDestroy } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { distinctUntilChanged, filter } from 'rxjs/operators';\nimport { combineLatest } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { Host } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { Maybe } from '@dereekb/util';\n\n@Directive({\n selector: '[dbxActionAutoModify]',\n})\nexport class DbxActionAutoModifyDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private readonly _autoModifyEnabled = new BehaviorSubject<boolean>(true);\n\n @Input('dbxActionAutoModify')\n get autoModifyEnabled(): boolean {\n return this._autoModifyEnabled.value;\n }\n\n set autoModifyEnabled(autoModifyEnabled: Maybe<any>) {\n this._autoModifyEnabled.next(autoModifyEnabled !== false);\n }\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n const obs = combineLatest([\n this._autoModifyEnabled.pipe(distinctUntilChanged()), // Don't change unless specified otherwise.\n this.source.isModified$.pipe(filter(x => !x)) // Only when not modified send a value.\n ]);\n\n this.sub = obs.subscribe(([autoModifyEnabled, isModified]) => {\n if (autoModifyEnabled && !isModified) {\n this.source.setIsModified(true);\n }\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._autoModifyEnabled.complete();\n });\n }\n\n}\n","import { Directive, Input, OnInit, OnDestroy } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { debounce, distinctUntilChanged, exhaustMap, filter, first, map, mergeMap, shareReplay, switchMap, throttle } from 'rxjs/operators';\nimport { EMPTY, interval, Subject, combineLatest } from 'rxjs';\nimport { Observable } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { Host } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { isDefinedAndNotFalse, Maybe } from '@dereekb/util';\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\n/**\n * Directive that automatically triggers the action periodically when it is in a modified state.\n */\n@Directive({\n selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]',\n})\nexport class DbxActionAutoTriggerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _triggerEnabled = new BehaviorSubject<boolean>(true);\n\n /**\n * How much to throttle the auto-triggering.\n */\n @Input('dbxActionAutoTrigger')\n get triggerEnabled(): boolean {\n return this._triggerEnabled.value;\n }\n\n set triggerEnabled(triggerEnabled: Maybe<boolean> | any) {\n triggerEnabled = triggerEnabled !== false; // Default to true\n\n if (this.triggerEnabled !== triggerEnabled) {\n this._triggerEnabled.next(triggerEnabled);\n }\n }\n\n @Input()\n triggerDebounce = DEFAULT_DEBOUNCE_MS;\n\n @Input()\n triggerThrottle = DEFAULT_THROTTLE_MS;\n\n @Input()\n triggerErrorThrottle = DEFAULT_ERROR_THROTTLE_MS;\n\n maxErrorsForThrottle = MAX_ERRORS_TO_THROTTLE_ON;\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle.\n *\n * Used in forms that are simple.\n */\n @Input()\n set fastTrigger(fastTrigger: any) {\n if (isDefinedAndNotFalse(fastTrigger)) {\n this.triggerDebounce = 200;\n this.triggerThrottle = 500;\n }\n }\n\n /**\n * Optional input to override both triggerDebounce and triggerThrottle to be 0.\n *\n * Used in forms that generally return a single value.\n */\n @Input()\n set instantTrigger(instantTrigger: any) {\n if (isDefinedAndNotFalse(instantTrigger)) {\n this.triggerDebounce = 10;\n this.triggerThrottle = 0;\n }\n }\n\n @Input()\n get triggerLimit(): Maybe<number> {\n return this._triggerLimit.value;\n }\n\n set triggerLimit(triggerLimit: Maybe<number>) {\n triggerLimit = triggerLimit || 0;\n this._triggerLimit.next(triggerLimit);\n }\n\n private readonly _triggerLimit = new BehaviorSubject<number | undefined>(undefined);\n private readonly _trigger = new Subject<number>();\n private _triggerCount = 0;\n\n readonly _errorCount$ = this.source.errorCountSinceLastSuccess$;\n\n readonly _triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(\n filter(() => this.isEnabled),\n filter((x) => x),\n debounce(() => interval(this.triggerDebounce)),\n throttle(() => this._errorCount$.pipe(\n first(),\n exhaustMap((count) => interval(this.triggerThrottle + (Math.min(count, this.maxErrorsForThrottle) * this.triggerErrorThrottle)))\n ), { leading: true, trailing: true }),\n // Check again for the \"trailing\" piece.\n filter(() => this.isEnabled),\n mergeMap(() => this.source.isModifiedAndCanTrigger$.pipe(first())),\n filter((x) => x),\n map(() => this._triggerCount += 1),\n shareReplay(1)\n );\n\n /**\n * Observable for the trigger mechanism.\n */\n readonly triggerCount$ = this._triggerEnabled.pipe(\n switchMap((enabled) => {\n if (enabled) {\n return this._triggerCount$;\n } else {\n return EMPTY;\n }\n })\n );\n\n private readonly _isTriggerLimited$: Observable<[number, boolean]> =\n combineLatest([this.triggerCount$, this._triggerLimit]).pipe(\n map(([triggerCount, limit]) => [triggerCount, ((limit) ? (triggerCount > limit) : false)] as [number, boolean]),\n shareReplay(1)\n );\n\n readonly isTriggerLimited$ = this._isTriggerLimited$.pipe(map(x => x[1]));\n readonly trigger$: 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(@Host() public readonly source: DbxActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n get isEnabled(): boolean {\n return this.triggerEnabled !== false;\n }\n\n ngOnInit(): void {\n this.sub = this.trigger$.subscribe(() => {\n this.source.trigger();\n });\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._trigger.complete();\n this._triggerLimit.complete();\n });\n }\n\n}\n","import { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { switchMap, mergeMap, map, withLatestFrom, shareReplay } from 'rxjs/operators';\nimport { Directive, Host, Input, OnInit } from '@angular/core';\nimport { BehaviorSubject, Observable, of, EMPTY } from 'rxjs';\nimport { OnDestroy } from '@angular/core';\nimport { hasValueOrNotEmpty, Maybe, isDefinedAndNotFalse } from '@dereekb/util';\nimport { IsModifiedFn, SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * Directive that watches a value observable for changes and sets the new value and modified states as necessary.\n */\n@Directive({\n selector: '[dbxActionValueStream]',\n})\nexport class dbxActionValueStreamDirective<T, O> implements OnInit, OnDestroy {\n\n private _valueObs = new BehaviorSubject<Observable<T>>(EMPTY);\n private _isModifiedFn = new BehaviorSubject<Maybe<IsModifiedFn<T>>>(undefined);\n\n private _modifiedSub = new SubscriptionObject();\n private _triggerSub = new SubscriptionObject();\n\n @Input()\n set dbxActionValueStream(dbxActionValueStream: Observable<T>) {\n this._valueObs.next(dbxActionValueStream);\n }\n\n @Input()\n set dbxActionValueStreamIsNotEmpty(requireNonEmpty: any) {\n if (isDefinedAndNotFalse(requireNonEmpty)) {\n this.dbxActionValueStreamModified = (value) => {\n return of(hasValueOrNotEmpty(value));\n };\n }\n }\n\n @Input()\n set dbxActionValueStreamModified(dbxActionValueStreamModified: IsModifiedFn<T>) {\n this._isModifiedFn.next(dbxActionValueStreamModified);\n }\n\n readonly modifiedValue$ = this._valueObs.pipe(\n switchMap((obs) => obs.pipe(\n withLatestFrom(this._isModifiedFn),\n mergeMap(([value, dbxActionValueStreamModified]) => {\n let result: Observable<[boolean, T]>;\n\n if (dbxActionValueStreamModified) {\n result = dbxActionValueStreamModified(value).pipe(\n map((isModified) => [isModified, value] as [boolean, T])\n );\n } else {\n result = of([true, value]);\n }\n\n return result;\n }),\n shareReplay(1)\n ))\n );\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance<T, O>) { }\n\n ngOnInit(): void {\n // Update Modified value.\n this._modifiedSub.subscription = this.modifiedValue$.subscribe(([isModified, value]) => {\n this.source.setIsModified(isModified);\n });\n\n // Set the value on triggers.\n this._triggerSub.subscription = this.source.triggered$.pipe(\n switchMap(_ => this.modifiedValue$)\n ).subscribe(([isModified, value]) => {\n if (isModified) {\n this.source.readyValue(value);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n this._valueObs.complete();\n this._isModifiedFn.complete();\n this._modifiedSub.destroy();\n this._triggerSub.destroy();\n });\n }\n\n}\n","import { LoadingStateType } from \"@dereekb/rxjs\";\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 * Unique key for disabling/enabling.\n */\nexport type DbxActionDisabledKey = string;\n\nexport const DEFAULT_ACTION_DISABLED_KEY = 'dbx_action_disabled';\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 default:\n return false;\n }\n}\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 default:\n loadingStateType = LoadingStateType.LOADING;\n break;\n }\n\n return loadingStateType;\n}\n","import { Injectable, OnDestroy } from '@angular/core';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { Observable } from 'rxjs';\nimport { distinctUntilChanged, filter, map, shareReplay, switchMap, startWith } from 'rxjs/operators';\nimport { BooleanStringKeyArray, BooleanStringKeyArrayUtilityInstance, Maybe, ReadableError } from '@dereekb/util';\nimport { LoadingStateType, idleLoadingState, errorResult, filterMaybe, LoadingState, LockSet, scanCount, successResult, beginLoading } from '@dereekb/rxjs';\nimport { DbxActionDisabledKey, DbxActionState, DEFAULT_ACTION_DISABLED_KEY, isIdleActionState, loadingStateTypeForActionState } from './action';\n\nexport function isActionContextEnabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtilityInstance.isFalse(state.disabled);\n}\n\nexport function isActionContextDisabled(state: ActionContextState): boolean {\n return BooleanStringKeyArrayUtilityInstance.isTrue(state.disabled);\n}\n\nexport function isDisabledActionContextState(state: ActionContextState): boolean {\n return isIdleActionState(state.actionState) && isActionContextDisabled(state);\n}\n\nexport function isWorkingActionState(actionState: DbxActionState): boolean {\n return !isIdleActionState(actionState);\n}\n\nexport function canTriggerActionState(actionState: DbxActionState): boolean {\n return actionState !== DbxActionState.DISABLED && isIdleActionState(actionState);\n}\n\nexport function canTriggerAction(state: ActionContextState): boolean {\n return isActionContextEnabled(state) && isIdleActionState(state.actionState);\n}\n\nexport function canReadyValue(state: ActionContextState): boolean {\n return state.actionState === DbxActionState.TRIGGERED;\n}\n\nexport function actionContextIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n // console.log('check: ', state, state.isModified, canTriggerAction(state));\n return state.isModified && canTriggerAction(state);\n}\n\nexport function actionContextHasNoErrorAndIsModifiedAndCanTrigger(state: ActionContextState): boolean {\n return !state.error && actionContextIsModifiedAndCanTrigger(state);\n}\n\nexport function loadingStateForActionContextState<O>(state: ActionContextState): 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 default:\n loadingState = beginLoading();\n break;\n }\n\n return loadingState;\n}\n\nexport function loadingStateTypeForActionContextState(state: ActionContextState): LoadingStateType {\n return loadingStateTypeForActionState(state.actionState);\n}\n\nexport interface ActionContextState<T = any, O = any> {\n actionState: DbxActionState;\n isModified: boolean;\n /**\n * Value that is set after a triggered action. Not to be confused with result.\n */\n value?: Maybe<T>;\n /**\n * Resolved result value.\n */\n result?: Maybe<O>;\n /**\n * Rejected error, if available.\n */\n error?: Maybe<ReadableError>;\n /**\n * Current disabled state.\n */\n disabled?: BooleanStringKeyArray;\n /**\n * Number of consecutive errors that have occured.\n */\n errorCount?: number;\n}\n\nconst INITIAL_STATE: ActionContextState = {\n isModified: false,\n actionState: DbxActionState.IDLE\n};\n\n@Injectable()\nexport class ActionContextStore<T = any, O = any> extends ComponentStore<ActionContextState<T, O>> implements OnDestroy {\n\n readonly lockSet = new LockSet();\n\n constructor() {\n super({ ...INITIAL_STATE });\n this.lockSet.addLock('working', this.isWorking$);\n }\n\n // MARK: Accessors\n readonly actionState$ = this.state$.pipe(map(x => isDisabledActionContextState(x) ? DbxActionState.DISABLED : x.actionState), shareReplay(1));\n\n /**\n * Returns the current disabled reasons/keys.\n */\n readonly disabledKeys$ = this.state$.pipe(map(x => [...x.disabled ?? []]), distinctUntilChanged(), shareReplay(1));\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 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!);\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 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 error.\n */\n readonly error$ = this.state$.pipe(map(x => x.error), distinctUntilChanged(), shareReplay(1));\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 * 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(map(x => loadingStateForActionContextState<O>(x)), shareReplay(1));\n\n /**\n * Returns the current LoadingStateType based on the current state.\n */\n readonly loadingStateType$ = this.state$.pipe(map(x => loadingStateTypeForActionContextState(x)), distinctUntilChanged(), shareReplay(1));\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(\n map(canTriggerAction),\n distinctUntilChanged(),\n shareReplay(1)\n );\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), shareReplay(1))\n );\n\n /**\n * Whether or not it can be triggered and modified.\n */\n readonly isModifiedAndCanTrigger$ = this.isModifiedAndCanTriggerUpdates$.pipe(\n distinctUntilChanged()\n );\n\n readonly hasNoErrorAndIsModifiedAndCanTrigger$ = this.state$.pipe(\n map((x) => actionContextHasNoErrorAndIsModifiedAndCanTrigger(x)),\n distinctUntilChanged(), 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: BooleanStringKeyArrayUtilityInstance.insert(state.disabled, ((key as any) ?? 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: BooleanStringKeyArrayUtilityInstance.remove(state.disabled, ((key as any) ?? DEFAULT_ACTION_DISABLED_KEY))\n }));\n\n /**\n * Triggers the modified state, if not disabled.\n */\n readonly setIsModified = this.updater((state, isModified: void | boolean) => ({\n ...state,\n actionState: (state.actionState === DbxActionState.RESOLVED) ? DbxActionState.IDLE : state.actionState, // Set to idle from success.\n isModified: (isModified as boolean) ?? true\n }));\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)\n ? ({ isModified: state.isModified, actionState: DbxActionState.TRIGGERED, error: state.error, value: undefined })\n : 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)\n ? ({ ...state, actionState: DbxActionState.VALUE_READY, value, result: undefined })\n : state);\n\n /**\n * Notifys the context that the action is in progress.\n */\n readonly startWorking = this.updater((state) => ({ ...state, actionState: DbxActionState.WORKING }));\n\n /**\n * Triggers rejection of the action. The value is cleared.\n */\n readonly reject = this.updater((state, error?: Maybe<ReadableError>) => ({ isModified: state.isModified, actionState: DbxActionState.REJECTED, error, errorCount: (state.errorCount ?? 0) + 1, disabled: state.disabled }));\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((state) => ({ ...INITIAL_STATE }));\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]),\n shareReplay(1)\n );\n }\n\n afterDistinctLoadingStateTypeChange(): Observable<ActionContextState<T, O>> {\n return this.state$.pipe(\n map((x) => ([x, loadingStateForActionContextState(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]),\n shareReplay(1)\n );\n }\n\n // MARK: Cleanup\n override ngOnDestroy(): void {\n // Wait for any actions to complete before destroying.\n this.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n }, 2000);\n }\n\n}\n","import { Observable, of } from 'rxjs';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { LockSet } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, DbxActionContextStoreSourceInstance, SecondaryActionContextStoreSource } from './action.store.source';\nimport { ActionContextStore } from './action.store';\nimport { DbxActionDisabledKey } from './action';\n\n/**\n * Abstract class that can either use SecondaryActionContextStoreSource or create it's own.\n */\nexport class DbxActionContextBaseSource<T = any, O = any> implements ActionContextStoreSource, Destroyable {\n\n private readonly _store?: ActionContextStore;\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(readonly inputSource?: SecondaryActionContextStoreSource) {\n if (this.inputSource) {\n this._store$ = this.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.ngOnDestroy();\n }\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): void {\n this._instance.readyValue(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}\n","import { Directive, Optional, OnDestroy, Host } from '@angular/core';\nimport { ProvideActionStoreSource, SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextBaseSource } from '../../action.holder';\n\n/**\n * Provides an DbxActionContext.\n */\n@Directive({\n selector: 'dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]',\n exportAs: 'action,dbxAction',\n providers: ProvideActionStoreSource(DbxActionDirective)\n})\nexport class DbxActionDirective<T = any, O = any> extends DbxActionContextBaseSource implements OnDestroy {\n\n constructor(@Optional() @Host() inputSource: SecondaryActionContextStoreSource) {\n super(inputSource);\n }\n\n ngOnDestroy(): void {\n this.lockSet.destroyOnNextUnlock(() => {\n this.destroy();\n });\n }\n\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\nimport { ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource, ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\n\n/**\n * Directive that provides a DbxActionSourceDirective that is passed in.\n */\n@Directive({\n selector: '[dbxActionSource]',\n providers: ProvideSecondaryActionStoreSource(DbxActionSourceDirective)\n})\nexport class DbxActionSourceDirective implements SecondaryActionContextStoreSource, OnDestroy {\n\n private _source = new BehaviorSubject<Maybe<ActionContextStoreSource>>(undefined);\n readonly store$ = this._source.pipe(filterMaybe(), switchMap((x) => actionContextStoreSourcePipe(x.store$)));\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n @Input('dbxActionSource')\n get source(): Maybe<ActionContextStoreSource> {\n return this._source.value;\n }\n\n set source(source: Maybe<ActionContextStoreSource>) {\n if (source && !source.store$) {\n throw new Error('Invalid source passed to dbxActionSource.');\n }\n\n this._source.next(source);\n }\n\n}\n","import { Directive, OnInit, Host } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Prints out the current state to the console. Useful for debugging.\n */\n@Directive({\n selector: '[dbxActionLogger],[dbxActionContextLogger]'\n})\nexport class DbxActionContextLoggerDirective extends AbstractSubscriptionDirective implements OnInit {\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.source.state$.subscribe((state) => {\n console.log('State: ', state);\n });\n }\n\n}\n","import { reduceBooleansWithOrFn } from '@dereekb/util';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay, switchMap } from 'rxjs/operators';\nimport { combineLatestFromMapValuesObsFn } from '@dereekb/rxjs';\nimport { ActionContextStoreSource, actionContextStoreSourcePipe } from '../../action.store.source';\nimport { ActionContextStore } from '../../action.store';\nimport { ActionContextStoreSourceMap, ActionKey } from './action.map';\n\n/**\n * Context used for providing actions based on the action key.\n *\n * This is useful for passing action contexts around via the providers instead of explicit injection.\n */\n@Directive({\n selector: '[dbxActionContextMap]',\n exportAs: 'actionMap',\n providers: [],\n})\nexport class DbxActionContextMapDirective implements ActionContextStoreSourceMap, OnDestroy {\n\n private readonly _map = new BehaviorSubject<Map<ActionKey, ActionContextStoreSource>>(new Map());\n readonly map$ = this._map.asObservable();\n\n readonly areAnyWorking$ = this.checkAnyAre(x => x.isWorking$, false);\n\n constructor() { }\n\n get map(): Map<ActionKey, ActionContextStoreSource> {\n return this._map.value;\n }\n\n sourceForKey(key: ActionKey): ActionContextStoreSource<any, any> {\n return new DbxActionContextMapDirectiveSourceInstance(this, key);\n }\n\n addStoreSource(key: ActionKey, source: ActionContextStoreSource): void {\n if (this.map.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 this.map.set(key, source);\n this._map.next(this.map);\n }\n\n removeStore(key: ActionKey): void {\n if (!this.map.delete(key)) {\n console.warn('removeStore called and no value was found.');\n }\n\n this._map.next(this.map);\n }\n\n ngOnDestroy(): void {\n this._map.complete();\n }\n\n // MARK: Utility\n checkAnyAre(mapFn: (input: ActionContextStore) => Observable<boolean>, emptyArrayValue = false): Observable<boolean> {\n return this.reduceFromAllSources(mapFn, reduceBooleansWithOrFn(emptyArrayValue));\n }\n\n reduceFromAllSources<O, R>(mapFn: (input: ActionContextStore) => Observable<O>, reduceFn: (values: O[]) => R): Observable<R> {\n return this.fromAllSources<O>(mapFn).pipe(map(reduceFn));\n }\n\n fromAllSources<O>(mapFn: (input: ActionContextStore) => Observable<O>): Observable<O[]> {\n return this.map$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));\n }\n\n}\n\nexport class DbxActionContextMapDirectiveSourceInstance implements ActionContextStoreSource {\n\n readonly _source$ = this.parent.map$.pipe(map(x => x.get(this.key)), distinctUntilChanged());\n readonly _store$ = this._source$.pipe(switchMap((x) => x?.store$ ?? of(undefined)), shareReplay(1));\n readonly store$ = actionContextStoreSourcePipe(this._store$);\n\n constructor(private readonly parent: DbxActionContextMapDirective, readonly key: ActionKey) { }\n\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\nimport { ActionKey } from './action.map';\nimport { ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\n\n/**\n * Directive that provides a ActionContextStoreSource using the input key and DbxActionContextMapDirective.\n */\n@Directive({\n selector: '[dbxActionFromMap]',\n providers: ProvideSecondaryActionStoreSource(DbxActionFromMapDirective)\n})\nexport class DbxActionFromMapDirective implements SecondaryActionContextStoreSource, OnDestroy {\n\n private _key = new BehaviorSubject<Maybe<ActionKey>>(undefined);\n readonly store$ = this._key.pipe(filterMaybe(), switchMap((x) => this._map.sourceForKey(x).store$));\n\n constructor(private readonly _map: DbxActionContextMapDirective) { }\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n\n @Input('dbxActionFromMap')\n get key(): Maybe<ActionKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<ActionKey>) {\n this._key.next(key);\n }\n\n}\n","import { Directive, Host, Input, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { ActionContextStoreSource } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { ActionKey } from './action.map';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to the store based on the key.\n */\n@Directive({\n selector: '[dbxActionMapSource]'\n})\nexport class DbxActionMapSourceDirective implements OnDestroy {\n\n private _key: Maybe<ActionKey>;\n\n constructor(@Host() public readonly source: ActionContextStoreSource, private readonly _map: DbxActionContextMapDirective) { }\n\n ngOnDestroy(): void {\n this._removeFromToStore();\n }\n\n @Input('dbxActionMapSource')\n set key(key: ActionKey) {\n if (this._key !== key) {\n this._removeFromToStore();\n }\n\n this._key = key;\n this._addToStore();\n }\n\n private _addToStore(): void {\n if (this._key) {\n this._map.addStoreSource(this._key, this.source);\n }\n }\n\n private _removeFromToStore(): void {\n if (this._key) {\n this._map.removeStore(this._key);\n }\n }\n\n}\n","import { ActionContextStoreSource } from '../../action.store.source';\n\nexport type ActionKey = string;\n\n/**\n * Map that returns sources for ActionKey values.\n */\nexport abstract class ActionContextStoreSourceMap<T = any, O = any> {\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","import { Directive, Host, Input, OnInit, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { DbxActionContextMapDirective } from './action.map.directive';\nimport { DbxActionDisabledKey } from '../../action';\n\nexport const DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY = 'action_map_working_disable';\n\n/**\n * Used to communicate with an dbxActionMap and set the ActionContextStore to be disabled if any other element in the map is working.\n */\n@Directive({\n selector: '[dbxActionMapWorkingDisable]'\n})\nexport class DbxActionMapWorkingDisableDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n @Input('dbxActionMapWorkingDisable')\n disabledKey: Maybe<DbxActionDisabledKey>;\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance, private readonly _map: DbxActionContextMapDirective) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this._map.areAnyWorking$.subscribe((x) => {\n this.source.disable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.source.enable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);\n }\n\n}\n","import { Directive, Host, Input, OnInit, OnDestroy } from '@angular/core';\nimport { Maybe, isDefinedAndNotFalse, isUndefinedAndNotFalse } from '@dereekb/util';\nimport { BehaviorSubject } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_DISABLED_DIRECTIVE_KEY = 'dbx_action_disabled';\n\n/**\n * Directive that allows disabling an action using the inputs.\n */\n@Directive({\n selector: '[dbxActionDisabled]'\n})\nexport class DbxActionDisabledDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _disabled = new BehaviorSubject<boolean>(false);\n readonly disabled$ = this._disabled.pipe(distinctUntilChanged());\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.disabled$.subscribe((x) => {\n this.source.disable(APP_ACTION_DISABLED_DIRECTIVE_KEY, x);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this.source.enable(APP_ACTION_DISABLED_DIRECTIVE_KEY);\n }\n\n @Input('dbxActionDisabled')\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: Maybe<any>) {\n const disable = isUndefinedAndNotFalse(disabled);\n this._disabled.next(disable);\n }\n\n}\n","import { BehaviorSubject, isObservable, Observable, of } from 'rxjs';\nimport { first } from 'rxjs/operators';\nimport { DbxActionContextStoreSourceInstance } from './action.store.source';\nimport { Maybe, Destroyable } from '@dereekb/util';\n\nexport interface WorkHandlerContextDelegate<O = any> {\n startWorking(): void;\n success(result?: Maybe<O>): void;\n reject(error?: Maybe<any>): void;\n}\n\n/**\n * WorkHandlerContextDelegate implementation using an DbxActionContextStoreSourceInstance.\n */\nexport class WorkHandlerContextSourceDelegate<T = any, O = any> implements WorkHandlerContextDelegate<O> {\n\n constructor(readonly source: DbxActionContextStoreSourceInstance<T, O>) { }\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: any): void {\n this.source.reject(error);\n }\n\n}\n\n/**\n * Used by DbxActionHandlerDirective when handling a function.\n */\nexport class WorkHandlerContext<T = any, O = any> implements Destroyable {\n\n private _done = false;\n private _doneActionBegan = false;\n\n private _actionBegan = new BehaviorSubject<boolean>(false);\n private _isComplete = new BehaviorSubject<boolean>(false);\n\n constructor(public readonly value: T, readonly delegate: WorkHandlerContextDelegate<O>) {\n // Schedule to cleanup self once isComplete is true.\n this._isComplete.subscribe((done) => {\n if (done) {\n this.destroy();\n }\n });\n }\n\n get actionBegan(): boolean {\n return this._doneActionBegan ?? this._actionBegan.value;\n }\n\n get actionBegan$(): Observable<boolean> {\n return this._done ? of(this._doneActionBegan) : this._actionBegan.asObservable();\n }\n\n get isComplete(): boolean {\n return this._done || this._isComplete.value;\n }\n\n get isComplete$(): Observable<boolean> {\n return this._done ? of(true) : this._isComplete.asObservable();\n }\n\n /**\n * Begins working using an observable.\n */\n startWorkingWithObservable(actionObs: Observable<O>): void {\n this.startWorking();\n actionObs.pipe(first()).subscribe((actionResult: O) => {\n this.success(actionResult);\n }, (error: any) => {\n const message = error.message ?? error.code ?? undefined;\n this.reject((message) ? ({ message }) : undefined);\n });\n }\n\n /**\n * Notifies the system that the action has begun.\n */\n startWorking(): void {\n this._setWorking();\n this.delegate.startWorking();\n }\n\n /**\n * Sets success on the action.\n */\n success(result?: O): void {\n this._setComplete();\n this.delegate.success(result);\n }\n\n /**\n * Sets rejected on the action.\n */\n reject(error?: any): void {\n this._setComplete();\n this.delegate.reject(error);\n }\n\n destroy(): void {\n this._doneActionBegan = this.actionBegan;\n this._done = true;\n\n // Delay to prevent error.\n setTimeout(() => {\n this._actionBegan.complete();\n this._isComplete.complete();\n });\n }\n\n private _setWorking(): void {\n if (this.actionBegan) {\n throw new Error('Action already has been triggered for this context.');\n }\n\n this._actionBegan.next(true);\n }\n\n private _setComplete(): void {\n if (this.isComplete) {\n throw new Error('Action has already been marked as completed.');\n }\n\n this._isComplete.next(true);\n }\n\n}\n\nexport type HandleActionFunctionConfigFn<T, O> = (value: T) => HandleWorkValueReadyConfig<T, O>;\n\n/**\n * Creates a function that uses a provider to always handle new values.\n */\nexport function handleWorkValueReadyWithConfigFn<T, O>(providerFn: HandleActionFunctionConfigFn<T, O>): (value: T) => Maybe<WorkHandlerContext<T, O>> {\n return (value) => {\n const config: HandleWorkValueReadyConfig<T, O> = providerFn(value);\n return handleWorkValueReadyFn(config)(value);\n };\n}\n\n/**\n * Config for handleWorkValueReadyFn().\n */\nexport interface HandleWorkValueReadyConfig<T, O> {\n handlerFunction: HandleActionFunction<T, O>;\n delegate: WorkHandlerContextDelegate<O>;\n}\n\n/**\n * Performs the action using the value and returns an observable.\n */\nexport type HandleActionUsingObservable<T = any, O = any> = (value: T) => Observable<O>;\n\n/**\n * Performs the action that uses the context handler to handle the event.\n */\nexport type HandleActionUsingContext<T = any, O = any> = (value: T, context: WorkHandlerContext<T, O>) => void;\n\n/**\n * Performs the action. Can either return an observable that will use the handler, or can use the handler itself.\n */\nexport type HandleActionFunction<T = any, O = any> = HandleActionUsingObservable<T, O> | HandleActionUsingContext<T, O>;\n\n/**\n * Creates a function that handles the incoming value and creates a WorkHandlerContext.\n */\nexport function handleWorkValueReadyFn<T, O>({ handlerFunction, delegate }: HandleWorkValueReadyConfig<T, O>): (value: T) => Maybe<WorkHandlerContext<T, O>> {\n return (value: T) => {\n const handler = new WorkHandlerContext<T, O>(value, delegate);\n let fnResult: void | Observable<O>;\n\n try {\n fnResult = handlerFunction(value, handler);\n } catch (e: any) {\n console.error('Action encountered an unexpected error.', e);\n handler.reject(e);\n return;\n }\n\n if (!handler.isComplete) {\n if (fnResult && isObservable(fnResult)) {\n if (handler.actionBegan) {\n throw new Error('Action already marked as begun from handlerFunction result. Either return an observable or use the handler directly.');\n }\n\n handler.startWorkingWithObservable(fnResult);\n }\n }\n\n return handler;\n };\n}\n","import { Directive, Host, Input, OnDestroy, OnInit } from '@angular/core';\nimport { map, shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\nimport { HandleActionFunction, WorkHandlerContextSourceDelegate, handleWorkValueReadyFn } from '../../action.handler';\nimport { Maybe } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\n\n\n/**\n * Context used for defining a function that performs an action using the input function on ValueReady.\n */\n@Directive({\n selector: '[dbxActionHandler]',\n})\nexport class DbxActionHandlerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _handlerFunction = new BehaviorSubject<Maybe<HandleActionFunction<T, O>>>(undefined);\n readonly handlerFunction$ = this._handlerFunction.pipe(filterMaybe(), shareReplay(1));\n\n @Input('dbxActionHandler')\n get handlerFunction(): Maybe<HandleActionFunction<T, O>> {\n return this._handlerFunction.value;\n }\n\n set handlerFunction(handlerFunction: Maybe<HandleActionFunction<T, O>>) {\n this._handlerFunction.next(handlerFunction);\n }\n\n private _delegate = new WorkHandlerContextSourceDelegate<T, O>(this.source);\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.handlerFunction$.pipe(\n switchMap(handlerFunction => this.source.valueReady$.pipe(\n map((x: T) => ([handlerFunction, x] as [HandleActionFunction<T, O>, T])),\n tap(([handlerFunction, value]) => {\n const context = handleWorkValueReadyFn({ handlerFunction, delegate: this._delegate })(value);\n\n if (context) {\n\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('dbxActionHandler', context.isComplete$.pipe(map(x => !x)));\n }\n })\n ))\n ).subscribe();\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n });\n }\n\n}\n","import { Component, Input } from '@angular/core';\nimport { of } from 'rxjs';\nimport { delay, exhaustMap, shareReplay, startWith } from 'rxjs/operators';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Displays the input content when success is set.\n *\n * Can be configured to show for a limited time afterwards, etc.\n */\n@Component({\n selector: 'dbx-action-success',\n template: `\n <ng-container *ngIf=\"show$ | async\">\n <ng-content></ng-content>\n </ng-container>\n `\n})\nexport class DbxActionSuccessComponent {\n\n @Input()\n hideAfter?: number;\n\n readonly show$ = this.source.isSuccess$.pipe(\n exhaustMap((success) => {\n if (success) {\n if (this.hideAfter) {\n return of(false).pipe(\n delay(this.hideAfter),\n startWith(true)\n );\n } else {\n return of(true);\n }\n } else {\n return of(false);\n }\n }),\n shareReplay(1)\n );\n\n constructor(public readonly source: DbxActionContextStoreSourceInstance) { }\n\n}\n","import { map, tap, shareReplay, switchMap } from 'rxjs/operators';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, Host, Input, OnInit, OnDestroy } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Performs the action on success.\n */\nexport type SuccessActionFunction<O> = (value: O) => void;\n\n/**\n * Directive that executes a function on ActionContextStore Success.\n */\n@Directive({\n selector: '[dbxActionSuccess]',\n})\nexport class DbxActionSuccessDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _successFunction = new BehaviorSubject<Maybe<SuccessActionFunction<O>>>(undefined);\n readonly successFunction$ = this._successFunction.pipe(filterMaybe(), shareReplay(1));\n\n @Input('dbxActionSuccess')\n get successFunction(): Maybe<SuccessActionFunction<O>> {\n return this._successFunction.value;\n }\n\n set successFunction(successFunction: Maybe<SuccessActionFunction<O>>) {\n this._successFunction.next(successFunction);\n }\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.successFunction$.pipe(\n switchMap(successFunction => this.source.success$.pipe(\n map(x => ([successFunction, x])),\n tap(([successFn, result]) => {\n successFn(result);\n })\n ))\n ).subscribe();\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._successFunction.complete();\n }\n\n}\n","import { Directive, Host, Input, OnInit } from '@angular/core';\nimport { getValueFromObjectOrGetter, Maybe, ObjectOrGetter } from '@dereekb/util';\nimport { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { shareReplay, switchMap, tap } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Directive that provides a default value when triggered.\n *\n * No value is required, allowing the directive to automatically call readyValue with undefined.\n */\n@Directive({\n selector: '[dbxActionValue]',\n})\nexport class DbxActionValueDirective<T, O> extends AbstractSubscriptionDirective implements OnInit {\n\n private _valueOrFunction = new BehaviorSubject<Maybe<ObjectOrGetter<T>>>(undefined);\n readonly valueOrFunction$ = this._valueOrFunction.pipe(filterMaybe(), shareReplay(1));\n\n @Input('dbxActionValue')\n get valueOrFunction(): Maybe<ObjectOrGetter<T>> {\n return this._valueOrFunction.value;\n }\n\n set valueOrFunction(valueOrFunction: Maybe<ObjectOrGetter<T>>) {\n this._valueOrFunction.next(valueOrFunction || undefined);\n }\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance<T, O>) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.valueOrFunction$.pipe(\n switchMap(valueOrFunction => this.source.triggered$.pipe(\n tap(() => {\n const value: T = getValueFromObjectOrGetter(valueOrFunction);\n this.source.readyValue(value);\n })\n ))\n ).subscribe();\n }\n\n override ngOnDestroy(): void {\n this.source.lockSet.onNextUnlock(() => {\n super.ngOnDestroy();\n this._valueOrFunction.complete();\n });\n }\n\n}\n","import { Component } from '@angular/core';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\n/**\n * Displays the input content when working is set.\n */\n@Component({\n selector: 'dbx-action-working',\n template: `\n <ng-container *ngIf=\"show$ | async\">\n <ng-content></ng-content>\n </ng-container>\n `\n})\nexport class DbxActionWorkingComponent {\n\n readonly show$ = this.source.isWorking$;\n\n constructor(public readonly source: DbxActionContextStoreSourceInstance) { }\n\n}\n","import { Directive, Host, Input, OnInit, OnDestroy } from '@angular/core';\nimport { BehaviorSubject, combineLatest, delay } from 'rxjs';\nimport { AbstractSubscriptionDirective } from '../../../subscription';\nimport { DbxActionContextStoreSourceInstance } from '../../action.store.source';\n\nexport const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';\n\n/**\n * Directive that toggles disabling an action if the action is not marked modified.\n */\n@Directive({\n selector: '[dbxActionEnforceModified]'\n})\nexport class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _enabled = new BehaviorSubject<boolean>(true);\n\n constructor(@Host() public readonly source: DbxActionContextStoreSourceInstance) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = combineLatest([this.source.isModified$, this._enabled]).pipe(delay(0)).subscribe(([modified, enableDirective]) => {\n const disable = enableDirective && !modified;\n this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._enabled.complete();\n this.source.enable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY);\n }\n\n @Input('[dbxActionEnforceModified]')\n get enabled(): boolean {\n return this._enabled.value;\n }\n\n set enabled(enabled: boolean) {\n this._enabled.next(enabled ?? true);\n }\n\n}\n","import { DbxActionContextSourceReference } from './action.reference';\nimport { delay, first } from 'rxjs/operators';\nimport { ActionContextStoreSource } from './action.store.source';\nimport { HandleActionFunction, handleWorkValueReadyFn, WorkHandlerContextSourceDelegate } from './action.handler';\nimport { DbxActionContextBaseSource } from './action.holder';\nimport { Destroyable, Maybe } from '@dereekb/util';\nimport { SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * DbxActionContextMachine configuration.\n */\nexport interface DbxActionContextMachineConfig<T = any, O = any> {\n /**\n * Whether or not the machine should clean itself up after being triggered once.\n */\n oneTimeUse: boolean;\n /**\n * Function to handle any valueReady events.\n */\n handleValueReady: HandleActionFunction<T, O>;\n /**\n * Optional function to execute after the action has succeeded.\n */\n 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 = any, O = any> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {\n\n private _isShutdown = true;\n private _handleValueReadySub = new SubscriptionObject();\n private _successSub = new SubscriptionObject();\n\n constructor(readonly config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>) {\n super(source);\n\n // Handle Value Ready\n this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {\n handleWorkValueReadyFn({\n handlerFunction: config.handleValueReady,\n delegate: new WorkHandlerContextSourceDelegate<T, O>(this.sourceInstance)\n })(value);\n });\n\n // If this is a one-time use, then destroy it after the first success comes through.\n if (this.config.oneTimeUse) {\n this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {\n this.destroy();\n });\n }\n\n if (this.config.onSuccess) {\n this._successSub.subscription = this.sourceInstance.success$.subscribe(this.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 isShutdown(): boolean {\n return this._isShutdown;\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport {\n DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,\n DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent\n} from './directive';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,\n DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent,\n ],\n exports: [\n DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,\n DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,\n DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,\n DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent\n ]\n})\nexport class DbxCoreActionModule { }\n","import { Destroyable } from \"@dereekb/util\";\nimport { 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 = any, O = any> extends Destroyable {\n readonly sourceInstance: DbxActionContextStoreSourceInstance<T, O>;\n}\n\nexport function makeDbxActionContextSourceReference<T, O>(sourceInstance: DbxActionContextStoreSourceInstance<T, O>): DbxActionContextSourceReference<T, O> {\n return {\n sourceInstance,\n destroy: () => 0\n };\n}\n","import { MonoTypeOperatorFunction, tap } from 'rxjs';\nimport { ChangeDetectorRef, ViewRef, ElementRef } from \"@angular/core\";\nimport { Maybe } from \"@dereekb/util\";\n\n/**\n * Convenience function used within observables for views that need to detect changes after a value changes.\n * \n * @param cdRef \n * @param timeout \n * @returns \n */\nexport function tapDetectChanges<T>(cdRef: ChangeDetectorRef, timeout = 0): MonoTypeOperatorFunction<T> {\n return tap(() => setTimeout(() => safeDetectChanges(cdRef), timeout));\n}\n\n/**\n * Triggers a detection change on the input view as long as the view has not been destroyed.\n * \n * @param cdRef \n */\nexport function safeDetectChanges(cdRef: ChangeDetectorRef): void {\n if (!(cdRef as ViewRef).destroyed) {\n cdRef.detectChanges();\n }\n}\n\n/**\n * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,\n * or more specifically if the parent component passed any target content to the child. This will still return true if\n * passed content is empty.\n *\n * TS:\n * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;\n *\n * HTML:\n * <div #customContent>\n * <ng-content select=\"[content]\"></ng-content>\n * </div>\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","import { Type, Provider, forwardRef } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Used for intercepting button click events.\n *\n * Can be used to delay/modify trigger/click behaviors.\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\nexport abstract class DbxButton {\n abstract disabled$: Observable<boolean>;\n abstract working$: Observable<boolean>;\n abstract disabled: Maybe<boolean>;\n abstract working: Maybe<boolean>;\n abstract icon?: Maybe<string>;\n abstract text?: Maybe<string>;\n abstract clicked$: Observable<any>;\n abstract setButtonInterceptor(interceptor: DbxButtonInterceptor): void;\n abstract clickButton(): void;\n}\n\nexport function ProvideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[] {\n return [{\n provide: DbxButton,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n","import { Directive, Host, OnInit } from '@angular/core';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Context used for linking a button to an ActionContext and only look for triggers.\n */\n@Directive({\n selector: '[dbxActionButtonTrigger]'\n})\nexport class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective implements OnInit {\n\n constructor(@Host() public readonly button: DbxButton, public readonly source: DbxActionContextStoreSourceInstance) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.button.clicked$.subscribe(() => {\n this._buttonClicked();\n });\n }\n\n protected _buttonClicked(): void {\n this.source.trigger();\n }\n\n}\n","import { safeDetectChanges } from '../../util/view';\nimport { Directive, Host, OnInit, OnDestroy, NgZone, ChangeDetectorRef } from '@angular/core';\nimport { DbxButton } from '../button';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\nimport { DbxActionButtonTriggerDirective } from './action.button.trigger.directive';\nimport { SubscriptionObject } from '@dereekb/rxjs';\n\n/**\n * Context used for linking a button to an ActionContext.\n */\n@Directive({\n selector: '[dbxActionButton]'\n})\nexport class DbxActionButtonDirective extends DbxActionButtonTriggerDirective implements OnInit, OnDestroy {\n\n private _workingSub = new SubscriptionObject();\n private _disabledSub = new SubscriptionObject();\n\n constructor(@Host() button: DbxButton, source: DbxActionContextStoreSourceInstance, private readonly cdRef: ChangeDetectorRef) {\n super(button, source);\n }\n\n override ngOnInit(): void {\n super.ngOnInit();\n\n this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {\n this.button.working = working;\n safeDetectChanges(this.cdRef);\n });\n\n this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {\n this.button.disabled = disabled;\n safeDetectChanges(this.cdRef);\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._workingSub.destroy();\n this._disabledSub.destroy();\n }\n\n}\n","import { ClickableFunction, ClickableUrl } from './clickable';\nimport { SegueRef } from '../segue';\nimport { expandFlattenTreeFunction, expandTreeFunction, ExpandTreeFunction, FlattenTreeFunction, flattenTreeToArrayFunction, Maybe, TreeNode } from '@dereekb/util';\nimport { Type, Provider, forwardRef } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport interface ClickableAnchor extends ClickableFunction, ClickableUrl, SegueRef {\n disabled?: boolean;\n}\n\nexport interface ClickableAnchorLink extends ClickableAnchor {\n title: string;\n icon?: string;\n}\n\nexport interface ClickableIconAnchorLink extends Omit<ClickableAnchorLink, 'title'> {\n icon: string;\n}\n\nexport interface ClickableAnchorLinkTree extends ClickableAnchorLink {\n children?: ClickableAnchorLinkTree[];\n}\n\nexport type ExpandedClickableAnchorLinkTree = TreeNode<ClickableAnchorLinkTree>;\n\nexport const expandClickableAnchorLinkTreeNode: ExpandTreeFunction<ClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = expandTreeFunction({\n getChildren: (x) => x.children\n});\n\nexport const flattenExpandedClickableAnchorLinkTree: FlattenTreeFunction<ExpandedClickableAnchorLinkTree, ExpandedClickableAnchorLinkTree> = flattenTreeToArrayFunction();\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\nexport enum AnchorType {\n /**\n * When the anchor has no specific content but is not disabled.\n * \n * Is a passthrough for the content.\n */\n PLAIN = 0,\n CLICKABLE = 1,\n SREF = 2,\n HREF = 3,\n DISABLED = 4\n}\n\nexport function anchorTypeForAnchor(anchor: Maybe<ClickableAnchor>, disabled?: Maybe<boolean>): AnchorType {\n let type: AnchorType = AnchorType.DISABLED;\n\n if (!disabled && anchor) {\n if (anchor.disabled) {\n type = AnchorType.DISABLED;\n } else if (anchor.ref) {\n type = AnchorType.SREF;\n } else if (anchor.onClick) {\n type = AnchorType.CLICKABLE;\n } else if (anchor.url) {\n type = AnchorType.HREF;\n } else {\n type = AnchorType.PLAIN;\n }\n }\n\n return type;\n}\n\nexport abstract class DbxAnchor<T extends ClickableAnchor = ClickableAnchor> {\n abstract disabled$: Observable<Maybe<boolean>>;\n abstract anchor$: Observable<Maybe<T>>;\n abstract disabled: Maybe<boolean>;\n abstract anchor: Maybe<T>;\n abstract type$: Observable<AnchorType>;\n}\n\nexport function ProvideDbxAnchor<S extends DbxAnchor>(sourceType: Type<S>): Provider[] {\n return [{\n provide: DbxAnchor,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n","import { skipFirstMaybe } from '@dereekb/rxjs';\nimport { map, shareReplay, distinctUntilChanged } from 'rxjs/operators';\nimport { BehaviorSubject, combineLatest, Observable, delay } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AnchorType, ClickableAnchor, anchorTypeForAnchor, DbxAnchor } from './anchor';\n\n/**\n * Abstract anchor directive.\n */\n@Directive()\nexport class AbstractDbxAnchorDirective<T extends ClickableAnchor = ClickableAnchor> implements DbxAnchor {\n\n private _disabled = new BehaviorSubject<Maybe<boolean>>(false);\n private _anchor = new BehaviorSubject<Maybe<T>>(undefined);\n\n readonly disabled$ = this._disabled.asObservable();\n readonly anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));\n\n readonly type$: Observable<AnchorType> = combineLatest([this.disabled$, this.anchor$]).pipe(\n delay(0),\n map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n @Input()\n public get anchor(): Maybe<T> {\n return this._anchor.value;\n }\n\n public set anchor(anchor: Maybe<T>) {\n this._anchor.next(anchor);\n }\n\n @Input()\n public get disabled(): Maybe<boolean> {\n return this._disabled.value;\n }\n\n public set disabled(disabled: Maybe<boolean>) {\n this._disabled.next(disabled);\n }\n\n}\n","export enum DbxRouterTransitionEventType {\n /**\n * A transition started.\n */\n START = 'start',\n /**\n * A transition ended.\n */\n SUCCESS = 'ended'\n}\n\nexport interface DbxRouterTransitionEvent {\n type: DbxRouterTransitionEventType;\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { SegueRef } from \"../../../segue\";\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from \"../../transition/transition\";\nimport { ActivatedRoute, NavigationBehaviorOptions, NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angular/router';\nimport { Injectable } from \"@angular/core\";\nimport { isArray } from \"class-validator\";\nimport { map } from \"rxjs/operators\";\nimport { Maybe } from '@dereekb/util';\n\n/**\n * AngularRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxAngularRouterService implements DbxRouterService, DbxRouterTransitionService {\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 constructor(readonly router: Router, readonly activatedRoute: ActivatedRoute) { }\n\n go(segueRef: SegueRef<NavigationExtras | NavigationBehaviorOptions>): Promise<boolean> {\n let ref = segueRef.ref;\n\n if (isArray(ref)) {\n return this.router.navigate(ref, {\n ...segueRef.refOptions,\n queryParams: segueRef.refParams\n })\n } else {\n return this.router.navigateByUrl(ref, {\n ...segueRef.refOptions\n });\n }\n }\n\n isActive(segueRef: SegueRef<any>): boolean {\n return false; // TODO!\n }\n\n comparePrecision(a: SegueRef, b: SegueRef): number {\n return 0; // TODO!\n }\n\n}\n","import { SegueRef } from \"../../segue\";\n\n/**\n * Router service definition that can route the app and provide routing details.\n */\nexport abstract class DbxRouterService {\n\n /**\n * Navigates to the target SegueRef.\n * \n * @param segueRef \n */\n abstract go(segueRef: SegueRef): Promise<boolean>;\n\n /**\n * Returns true if the input segue ref is considered active.\n * \n * @param segueRef \n */\n abstract isActive(segueRef: SegueRef): 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: SegueRef, b: SegueRef): number;\n\n}\n","import { Observable } from 'rxjs';\nimport { DbxRouterTransitionEvent } from '../transition/transition';\n\n/**\n * Router service definition that provides high level information about router transitions.\n */\nexport abstract class DbxRouterTransitionService {\n\n /**\n * Observable that emits DbxRouterTransitionEvent values as transitions occur.\n */\n abstract readonly transitions$: Observable<DbxRouterTransitionEvent>;\n\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { DbxAngularRouterService } from './angular.router.service';\n\n@NgModule({})\nexport class DbxCoreAngularRouterSegueModule {\n\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}\n","import { mergeArrayIntoArray, objectFlatMergeMatrix } from '@dereekb/util';\nimport { Ng2StateDeclaration } from '@uirouter/angular';\n\n/**\n * Used for creating a future state that also captures any children urls.\n * \n * This is important for cases, such as /, where multiple urls should target a specific future so that \n * it can load that module and continue route resolution for the child url.\n * \n * For example:\n * - the urls /a and /b are declared in a lazy loaded module that is for /. This presents a problem, since\n * the root module does not know how to handle /a or /b, since they are children of /. We use \n * futureStateWithChildrenUrls() to build a future state with the child urls so the parent routing knows where\n * to send /a or /b.\n * \n * @param state \n * @param urls \n * @returns \n * \n * @deprecated not how this feature works. Consider adding it to ui-router later then re-export this function.\n */\nfunction futureStateWithChildrenUrls(state: Ng2StateDeclaration, urls: string[]): Ng2StateDeclaration[] {\n const states = [state];\n mergeArrayIntoArray(states, expandFutureStateWithUrls(state, urls));\n return states;\n}\n\n/**\n * Copies the input state and replaces the url in each of them with the passed urls.\n * \n * @param state \n * @param urls \n * @returns \n * \n * @deprecated\n */\nfunction expandFutureStateWithUrls(state: Ng2StateDeclaration, urls: string[]): Ng2StateDeclaration[] {\n const childrenStates = objectFlatMergeMatrix(state, urls.map(url => ({ url })));\n return childrenStates;\n}\n","import { Subject } from 'rxjs';\nimport { DbxRouterService, DbxRouterTransitionService } from '../../service';\nimport { SegueRef } from \"../../../segue\";\nimport { StateService, UIRouterGlobals, TransitionOptions, TransitionService } from '@uirouter/core';\nimport { Injectable } from \"@angular/core\";\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from '../../transition/transition';\n\n/**\n * UIRouter implementation of DbxRouterService and DbxRouterTransitionService.\n */\n@Injectable()\nexport class DbxUIRouterService implements DbxRouterService, DbxRouterTransitionService {\n\n private readonly _transitions = new Subject<DbxRouterTransitionEvent>();\n readonly transitions$ = this._transitions.asObservable();\n\n constructor(readonly state: StateService, readonly transitionService: TransitionService, readonly uiRouterGlobals: UIRouterGlobals) {\n\n const emitTransition = (type: DbxRouterTransitionEventType) => {\n this._transitions.next({\n type\n });\n }\n\n this.transitionService.onStart({}, () => {\n emitTransition(DbxRouterTransitionEventType.START);\n }) as any;\n\n this.transitionService.onSuccess({}, () => {\n emitTransition(DbxRouterTransitionEventType.SUCCESS);\n }) as any;\n\n }\n\n go(segueRef: SegueRef<TransitionOptions>): Promise<boolean> {\n const params = { ...this.uiRouterGlobals.current.params, ...segueRef.refParams };\n return this.state.go(segueRef.ref, params, segueRef.refOptions).then(_ => true).catch(_ => false);\n }\n\n isActive(segueRef: SegueRef): boolean {\n const { ref, refParams } = segueRef;\n\n const targetRef = (ref.startsWith('.') ? `^${ref}` : ref);\n const active = this.state.includes(targetRef, refParams);\n return active;\n }\n\n comparePrecision(a: SegueRef, b: SegueRef): number {\n const aLength = (a.ref as string).length;\n const bLength = (b.ref as string).length;\n return (aLength > bLength) ? 1 : (aLength === bLength) ? 0 : -1;\n }\n\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DbxRouterTransitionService } from '../../service/router.transition.service';\nimport { DbxRouterService } from '../../service/router.service';\nimport { DbxUIRouterService } from './uirouter.router.service';\n\n@NgModule({})\nexport class DbxCoreUIRouterSegueModule {\n\n static forRoot(): ModuleWithProviders<DbxCoreUIRouterSegueModule> {\n return {\n ngModule: DbxCoreUIRouterSegueModule,\n providers: [\n DbxUIRouterService,\n {\n provide: DbxRouterService,\n useExisting: DbxUIRouterService\n },\n {\n provide: DbxRouterTransitionService,\n useExisting: DbxUIRouterService\n }\n ]\n };\n }\n\n}\n","import { filter, MonoTypeOperatorFunction, Observable } from \"rxjs\";\nimport { DbxRouterTransitionEvent, DbxRouterTransitionEventType } from \"./transition\";\n\n/**\n * Convenience function for filtering success from the input observable.\n * \n * @param obs \n * @returns \n */\nexport function successTransition(obs: Observable<DbxRouterTransitionEvent>): Observable<DbxRouterTransitionEvent> {\n return obs.pipe(filterTransitionSuccess());\n}\n\nexport function filterTransitionSuccess(): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);\n}\n\nexport function filterTransitionEvent(type: DbxRouterTransitionEventType): MonoTypeOperatorFunction<DbxRouterTransitionEvent> {\n return filter(x => x.type === type);\n}\n","import { Observable, startWith } from 'rxjs';\nimport { Directive, NgZone } from '@angular/core';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { successTransition } from './transition.rxjs';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionDirective {\n\n readonly transitionSuccess$ = successTransition(this.dbNgxRouterTransitionService.transitions$);\n readonly initAndUpdateOnTransitionSuccess$: Observable<void> = this.transitionSuccess$.pipe(startWith(undefined)) as Observable<void>;\n\n constructor(protected readonly dbNgxRouterTransitionService: DbxRouterTransitionService) { }\n\n}\n","import { Directive, NgZone, OnDestroy, OnInit } from '@angular/core';\nimport { SubscriptionObject } from '@dereekb/rxjs';\nimport { DbxRouterTransitionService } from '../service/router.transition.service';\nimport { AbstractTransitionDirective } from './transition.directive';\n\n/**\n * Abstract directive that listens to onSuccess transition events and runs a function.\n */\n@Directive()\nexport abstract class AbstractTransitionWatcherDirective extends AbstractTransitionDirective implements OnInit, OnDestroy {\n\n private _transitionSub = new SubscriptionObject();\n\n ngOnInit(): void {\n this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {\n this.updateForSuccessfulTransition();\n });\n }\n\n ngOnDestroy(): void {\n this._transitionSub.destroy();\n }\n\n constructor(dbNgxRouterTransitionService: DbxRouterTransitionService, protected readonly ngZone: NgZone) {\n super(dbNgxRouterTransitionService);\n }\n\n // MARK: Action\n protected zoneUpdateForSuccessfulTransition(): void {\n this.ngZone.run(() => this.updateForSuccessfulTransition());\n }\n\n protected abstract updateForSuccessfulTransition(): void;\n\n}\n","import { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nexport type SegueRefRouterLink = string | any[] | any;\n\nexport interface SegueRefRawSegueParams {\n [key: string]: any;\n}\n\nexport interface SegueRefOptions<O = any> {\n\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/**\n * Represents a segue ref\n */\nexport interface SegueRef<O = any> extends SegueRefOptions<O> {\n\n /**\n * UI Sref reference value.\n */\n ref?: SegueRefRouterLink;\n\n}\n\nexport function refStringToSegueRef<O = any>(ref: string, options?: SegueRefOptions<O>): SegueRef<O> {\n return { ...options, ref };\n}\n\nexport function mapRefStringObsToSegueRefObs<O = any>(obs: Observable<string>, options?: SegueRefOptions<O>): Observable<SegueRef<O>> {\n return obs.pipe(map(x => refStringToSegueRef(x, options)));\n}\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { Directive, OnInit, OnDestroy, Input } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { AbstractSubscriptionDirective } from '../../subscription';\nimport { shareReplay, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';\nimport { DbxButton } from '../button';\nimport { BehaviorSubject } from 'rxjs';\nimport { SegueRef, DbxRouterService } from '../../router';\n\n// MARK: Button Directives\n@Directive({\n selector: '[dbxButtonSegue]'\n})\nexport class DbxButtonSegueDirective extends AbstractSubscriptionDirective implements OnInit, OnDestroy {\n\n private _segueRef = new BehaviorSubject<Maybe<SegueRef>>(undefined);\n readonly segueRef$ = this._segueRef.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n @Input('dbxButtonSegue')\n get segueRef(): Maybe<SegueRef> {\n return this._segueRef.value;\n }\n\n set segueRef(segueRef: Maybe<SegueRef>) {\n this._segueRef.next(segueRef);\n }\n\n constructor(readonly dbxButton: DbxButton, readonly dbxRouterService: DbxRouterService) {\n super();\n }\n\n ngOnInit(): void {\n this.sub = this.segueRef$.pipe(\n switchMap(segueRef => this.dbxButton.clicked$.pipe(\n tap(() => {\n this.dbxRouterService.go(segueRef);\n })\n ))\n ).subscribe();\n }\n\n}\n","import { Directive, Input, Output, EventEmitter, OnDestroy, OnInit } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { BehaviorSubject, of, Subject } from 'rxjs';\nimport { filter, first, switchMap } from 'rxjs/operators';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton, DbxButtonInterceptor, ProvideDbxButton } from './button';\n\n/**\n * Abstract button component.\n */\n@Directive()\nexport abstract class AbstractDbxButtonDirective extends AbstractSubscriptionDirective implements DbxButton, OnInit, OnDestroy {\n\n private _disabled = new BehaviorSubject<boolean>(false);\n private _working = new BehaviorSubject<boolean>(false);\n\n readonly disabled$ = this._disabled.asObservable();\n readonly working$ = this._working.asObservable();\n\n @Input()\n get disabled(): boolean {\n return this._disabled.value;\n }\n\n set disabled(disabled: boolean) {\n this._disabled.next(disabled);\n }\n\n @Input()\n get working(): boolean {\n return this._working.value;\n }\n\n set working(working: boolean) {\n this._working.next(working);\n }\n\n @Input()\n icon?: Maybe<string>;\n\n @Input()\n text?: Maybe<string>;\n\n @Output()\n readonly buttonClick = new EventEmitter();\n\n readonly clicked$ = this.buttonClick.asObservable();\n\n constructor() {\n super();\n }\n\n /**\n * Pre-interceptor button click.\n */\n protected _buttonClick = new Subject<void>();\n protected _buttonInterceptor = new BehaviorSubject<Maybe<DbxButtonInterceptor>>(undefined);\n\n ngOnInit(): void {\n this.sub = this._buttonClick.pipe(\n switchMap(() => this._buttonInterceptor.pipe(\n switchMap((x) => {\n if (x) {\n return x.interceptButtonClick().pipe(\n first()\n );\n } else {\n return of(true);\n }\n }),\n filter((x) => Boolean(x)) // Ignore false values.\n ))\n ).subscribe(() => {\n this._forceButtonClicked();\n });\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this._disabled.complete();\n this._working.complete();\n this._buttonClick.complete();\n this._buttonInterceptor.complete();\n }\n\n /**\n * Sets the button interceptor. If any interceptor is already set, it is replaced.\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\n// MARK: Implementation\n/**\n * Provides an DbxButton directive.\n */\n@Directive({\n selector: '[dbxButton]',\n exportAs: 'dbxButton',\n providers: ProvideDbxButton(DbxButtonDirective)\n})\nexport class DbxButtonDirective extends AbstractDbxButtonDirective { }\n","import { Directive, Host, Input, NgZone } from '@angular/core';\nimport { LoadingContext } from '@dereekb/rxjs';\nimport { AbstractSubscriptionDirective } from '../subscription';\nimport { DbxButton } from './button';\n\n/**\n * Context used for linking a button to a LoadingContext.\n *\n * It will be set working when the context is set loading.\n */\n@Directive({\n selector: '[dbxLoadingButton]'\n})\nexport class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {\n\n constructor(@Host() public readonly button: DbxButton, readonly ngZone: NgZone) {\n super();\n }\n\n /**\n * Sets a LoadingContext that is watched for the loading state.\n */\n @Input('dbxLoadingButton')\n set context(context: LoadingContext) {\n let subscription;\n\n if (context) {\n subscription = context.stream$.subscribe((x) => {\n this.ngZone.run(() => this.button.working = x.loading);\n });\n }\n\n this.sub = subscription;\n }\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\n@NgModule({\n imports: [],\n declarations: [\n DbxButtonDirective,\n DbxLoadingButtonDirective,\n DbxActionButtonTriggerDirective,\n DbxActionButtonDirective,\n DbxButtonSegueDirective\n ],\n exports: [\n DbxButtonDirective,\n DbxLoadingButtonDirective,\n DbxActionButtonTriggerDirective,\n DbxActionButtonDirective,\n DbxButtonSegueDirective\n ],\n})\nexport class DbxCoreButtonModule { }\n","import { addMinutes } from 'date-fns';\nimport { Pipe, PipeTransform, Inject, LOCALE_ID } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatToTimeString, toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and number of minutes and outputs a formatted date.\n */\n@Pipe({ name: 'dateFromPlusTo' })\nexport class DateFromToTimePipe implements PipeTransform {\n\n constructor(@Inject(LOCALE_ID) private locale: string) { }\n\n transform(input: Maybe<DateOrDateString>, format: string, minutes: number): Maybe<string> {\n return DateFromToTimePipe.formatFromTo(input, format, minutes, this.locale);\n }\n\n static formatFromTo(input: Maybe<DateOrDateString>, format: string, minutes: number, 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}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'minutesString', pure: false })\nexport class MinutesStringPipe implements PipeTransform {\n\n transform(input: Maybe<number | string>): Maybe<string> {\n const minutes = Number(input);\n\n if (input != null && !isNaN(minutes)) {\n if (minutes > 3600) {\n const unrounded = minutes / 3600;\n const days = Math.ceil(unrounded);\n return ((unrounded !== days) ? '~' : '') + days + ' days';\n } else if (minutes > 180) {\n const unrounded = minutes / 60;\n const hours = Math.ceil(unrounded);\n return ((unrounded !== hours) ? '~' : '') + hours + ' hours';\n } else {\n return minutes + ' minutes';\n }\n } else {\n return undefined;\n }\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { toJsDate } from '@dereekb/date';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\n\n@Pipe({ name: 'toJsDate' })\nexport class ToJsDatePipe implements PipeTransform {\n\n public static toJsDate(input: Maybe<DateOrDateString>): Maybe<Date> {\n return (input) ? toJsDate(input) : undefined;\n }\n\n transform(input: Maybe<DateOrDateString>): Maybe<Date> {\n return ToJsDatePipe.toJsDate(input);\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Maybe, DateOrDateString } from '@dereekb/util';\nimport { formatDistance, isPast } from 'date-fns';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({ name: 'timeCountdownDistance', pure: false })\nexport class TimeDistanceCountdownPipe implements PipeTransform {\n\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@Pipe({ name: 'timeDistance', pure: false })\nexport class TimeDistancePipe implements PipeTransform {\n\n transform(input: Maybe<DateOrDateString>, to: Date = new Date(), unavailable: string = 'Not Available'): string {\n if (input) {\n const from = ToJsDatePipe.toJsDate(input)!;\n return formatDistance(from, to, {\n addSuffix: true\n });\n } else {\n return unavailable;\n }\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'toMinutes' })\nexport class ToMinutesPipe implements PipeTransform {\n\n transform(milliseconds: number): number {\n if (milliseconds) {\n return Math.floor(milliseconds / (60 * 1000));\n }\n\n return milliseconds;\n }\n\n}\n","import { Pipe, PipeTransform, Inject, LOCALE_ID } from '@angular/core';\nimport { formatDate } from '@angular/common';\nimport { formatDistanceToNow, isValid } from 'date-fns';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { toJsDate } from '@dereekb/date';\n\n/**\n * Pipe that takes in a date and appends the distance to it in parenthesis.\n */\n@Pipe({ name: 'dateFormatDistance', pure: false })\nexport class DateFormatDistancePipe implements PipeTransform {\n\n constructor(@Inject(LOCALE_ID) private locale: string) { }\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\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}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { formatDistance, isPast, isSameDay, startOfDay } from 'date-fns';\nimport { DateOrDateString, Maybe } from '@dereekb/util';\nimport { ToJsDatePipe } from './tojsdate.pipe';\n\n@Pipe({ name: 'dateDistance', pure: false })\nexport class DateDistancePipe implements PipeTransform {\n\n transform(input: Maybe<DateOrDateString>, to?: Maybe<Date>, unavailable: string = 'Not Available'): string {\n if (input) {\n const useDefaultTo: boolean = !to;\n\n if (useDefaultTo) {\n to = new Date();\n }\n\n const from = ToJsDatePipe.toJsDate(input)!;\n\n const fromStart = startOfDay(from);\n const toStart = startOfDay(to!);\n\n if (isSameDay(fromStart, toStart)) {\n let text;\n\n if (useDefaultTo || isSameDay(from, new Date())) {\n text = 'Today';\n } else {\n text = 'Same Day';\n }\n\n return text;\n } else {\n return formatDistance(fromStart, toStart, {\n addSuffix: true\n });\n }\n } else {\n return unavailable;\n }\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { DateFromToTimePipe } from './datefromtoformat.pipe';\nimport { MinutesStringPipe } from './minutesstring.pipe';\nimport { TimeDistanceCountdownPipe, TimeDistancePipe } from './timedistance.pipe';\nimport { ToJsDatePipe } from './tojsdate.pipe';\nimport { ToMinutesPipe } from './tominutes.pipe';\nimport { DateFormatDistancePipe } from './dateformatdistance.pipe';\nimport { DateDistancePipe } from './datedistance.pipe';\n\n@NgModule({\n exports: [\n DateFromToTimePipe,\n DateFormatDistancePipe,\n MinutesStringPipe,\n TimeDistanceCountdownPipe,\n TimeDistancePipe,\n DateDistancePipe,\n ToJsDatePipe,\n ToMinutesPipe\n ],\n declarations: [\n DateFromToTimePipe,\n DateFormatDistancePipe,\n MinutesStringPipe,\n TimeDistanceCountdownPipe,\n TimeDistancePipe,\n DateDistancePipe,\n ToJsDatePipe,\n ToMinutesPipe\n ]\n})\nexport class DbxDatePipeModule { }\n","import { of, Observable } from 'rxjs';\nimport { Directive, OnDestroy, OnInit } from '@angular/core';\nimport { FilterSource, FilterSourceInstance, ObservableGetter } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract FilterSource implementation.\n */\n@Directive()\nexport abstract class AbstractFilterSourceDirective<F> implements FilterSource<F>, OnInit, OnDestroy {\n\n protected _defaultFilterSource = new FilterSourceInstance<F>();\n\n readonly filter$: Observable<F> = this._defaultFilterSource.filter$;\n\n ngOnInit(): void {\n this._defaultFilterSource.setDefaultFilter(this.makeDefaultFilter());\n }\n\n ngOnDestroy(): void {\n this._defaultFilterSource.destroy();\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 // MARK: Internal\n protected makeDefaultFilter(): ObservableGetter<Maybe<F>> {\n return of(undefined);\n }\n\n}\n","import { HandleActionFunction } from '../../action/action.handler';\nimport { AbstractFilterSourceDirective } from '../filter.abstract.source.directive';\nimport { Directive, ViewChild } from '@angular/core';\nimport { of } from 'rxjs';\nimport { DbxActionContextStoreSourceInstance } from '../../action/action.store.source';\n\n/**\n * Abstract filter source for components that use an action to filter.\n */\n@Directive()\nexport abstract class AbstractActionFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> {\n\n @ViewChild(DbxActionContextStoreSourceInstance, { static: true, read: DbxActionContextStoreSourceInstance })\n readonly filterAction!: DbxActionContextStoreSourceInstance;\n\n applyFilter(): void {\n this.filterAction.setIsModified(true); // Force setting modified.\n this.filterAction.trigger();\n }\n\n /**\n * Pre-set action handler for the template to use to set the filter.\n */\n setFilterAction: HandleActionFunction<F> = (filter: F) => {\n this.setFilter(filter);\n return of(true);\n }\n\n}\n","import { Observable, BehaviorSubject, of, switchMap, shareReplay } from 'rxjs';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { FilterSourceConnector, FilterSource } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Abstract FilterSourceConnector directive.\n */\n@Directive()\nexport abstract class AbstractFilterSourceConnectorDirective<F> implements FilterSourceConnector<F>, OnDestroy {\n\n private _source = new BehaviorSubject<Maybe<FilterSource<F>>>(undefined);\n\n readonly filter$: Observable<Maybe<F>> = this._source.pipe(\n switchMap(x => x?.filter$ ?? of(undefined)),\n shareReplay(1)\n );\n\n ngOnDestroy(): void {\n this._source.complete();\n }\n\n connectWithSource(filterSource: FilterSource<F>): void {\n this._source.next(filterSource);\n }\n\n}\n","import { FilterSource, FilterSourceConnector } from \"@dereekb/rxjs\";\nimport { forwardRef, Provider, Type } from '@angular/core';\n\n/**\n * Angular provider convenience function for a FilterSource.\n */\nexport function ProvideFilterSource<S extends FilterSource<any>>(sourceType: Type<S>): Provider[] {\n return [{\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n\n/**\n * Angular provider convenience function for a FilterSourceConnector.\n */\nexport function ProvideFilterSourceConnector<S extends FilterSourceConnector<any>>(sourceType: Type<S>): Provider[] {\n return [{\n provide: FilterSourceConnector,\n useExisting: forwardRef(() => sourceType)\n }, {\n provide: FilterSource,\n useExisting: forwardRef(() => sourceType)\n }];\n}\n","import { Directive } from '@angular/core';\nimport { AbstractFilterSourceConnectorDirective } from './filter.abstract.connector.directive';\nimport { ProvideFilterSource, ProvideFilterSourceConnector } from './filter.content';\n\n/**\n * Used as a FilterSource and FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterSourceConnector]',\n providers: [\n ...ProvideFilterSource(DbxFilterSourceConnectorDirective),\n ...ProvideFilterSourceConnector(DbxFilterSourceConnectorDirective)\n ]\n})\nexport class DbxFilterSourceConnectorDirective<F> extends AbstractFilterSourceConnectorDirective<F> { }\n","import { filterMaybe } from '@dereekb/rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { Directive, OnDestroy } from '@angular/core';\nimport { FilterMapKey, FilterMap } from '@dereekb/rxjs';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive()\nexport abstract class AbstractDbxFilterMapInstanceDirective<F> implements OnDestroy {\n\n protected _key = new BehaviorSubject<Maybe<FilterMapKey>>(undefined);\n readonly key$ = this._key.pipe(filterMaybe());\n\n readonly instance$ = this.dbxFilterMap.instanceObsForKeyObs(this.key$);\n\n constructor(readonly dbxFilterMap: FilterMap<F>) { }\n\n ngOnDestroy(): void {\n this._key.complete();\n }\n\n}\n","import { FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { switchMap, first, Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { ProvideFilterSource } from './filter.content';\nimport { AbstractDbxFilterMapInstanceDirective } from './filter.map.instance.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Provides a FilterSource from a parent FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMapSource]',\n exportAs: 'dbxFilterMapSource',\n providers: [\n ...ProvideFilterSource(DbxFilterMapSourceDirective)\n ]\n})\nexport class DbxFilterMapSourceDirective<F> extends AbstractDbxFilterMapInstanceDirective<F> implements FilterSource<F> {\n\n readonly filter$: Observable<F> = this.instance$.pipe(switchMap(x => x.filter$));\n\n @Input('dbxFilterMapSource')\n get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n initWithFilter?(filterObs: Observable<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.initWithFilter(filterObs));\n }\n\n}\n","import { first } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\nimport { FilterSourceConnector, FilterSource, FilterMapKey } from '@dereekb/rxjs';\nimport { ProvideFilterSource, ProvideFilterSourceConnector } from './filter.content';\nimport { DbxFilterMapSourceDirective } from './filter.map.source.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Acts as an \"input\" FilterSourceConnector for an FilterMap, as well as a source for the FilterSourceConnector.\n */\n@Directive({\n selector: '[dbxFilterMapSourceConnector]',\n exportAs: 'dbxFilterMapSourceConnector',\n providers: [\n ...ProvideFilterSource(DbxFilterMapSourceConnectorDirective),\n ...ProvideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)\n ]\n})\nexport class DbxFilterMapSourceConnectorDirective<F> extends DbxFilterMapSourceDirective<F> implements FilterSourceConnector<F> {\n\n @Input('dbxFilterMapSourceConnector')\n override get key(): Maybe<FilterMapKey> {\n return this._key.value;\n }\n\n override set key(key: Maybe<FilterMapKey>) {\n this._key.next(key);\n }\n\n // MARK: FilterSourceConnector\n connectWithSource(filterSource: FilterSource<F>): void {\n this.instance$.pipe(first()).subscribe((x) => x.connectWithSource(filterSource));\n }\n\n}\n","import { Directive, OnDestroy } from '@angular/core';\nimport { FilterMap } from '@dereekb/rxjs';\n\n/**\n * Direction that provides an FilterMap.\n */\n@Directive({\n selector: '[dbxFilterMap]',\n exportAs: 'dbxFilterMap',\n providers: [FilterMap]\n})\nexport class DbxFilterMapDirective<F> implements OnDestroy {\n\n constructor(readonly filterMap: FilterMap<F>) { }\n\n ngOnDestroy(): void {\n this.filterMap.destroy();\n }\n\n}\n","import { Directive } from '@angular/core';\nimport { ProvideFilterSource } from './filter.content';\nimport { AbstractFilterSourceDirective } from './filter.abstract.source.directive';\n\n/**\n * Basic filter source directive.\n */\n@Directive({\n selector: '[dbxFilterSource]',\n providers: ProvideFilterSource(DbxFilterSourceDirective)\n})\nexport class DbxFilterSourceDirective<F> extends AbstractFilterSourceDirective<F> { }\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\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';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n DbxFilterSourceDirective,\n DbxFilterSourceConnectorDirective,\n DbxFilterMapDirective,\n DbxFilterMapSourceConnectorDirective,\n DbxFilterMapSourceDirective,\n ],\n exports: [\n DbxFilterSourceDirective,\n DbxFilterSourceConnectorDirective,\n DbxFilterMapDirective,\n DbxFilterMapSourceConnectorDirective,\n DbxFilterMapSourceDirective,\n ]\n})\nexport class DbxCoreFilterModule { }\n","import { InjectionToken, Injector, NgModuleRef, StaticProvider, TemplateRef, Type, ViewRef } from \"@angular/core\";\nimport { filterMaybeValues, Maybe, mergeArrays, mergeIntoArray, mergeObjects } from \"@dereekb/util\";\n\nexport const DBX_INJECTED_COMPONENT_DATA = new InjectionToken('DbxInjectedComponentConfigData');\n\nexport interface DbxInjectedComponentConfig<T = any> {\n /**\n * Type of Component to initialize.\n */\n componentClass: Type<T>;\n /**\n * (Optional) providers to provide to the existing injector.\n */\n providers?: StaticProvider[];\n /**\n * (Optional) Custom Injector to use when creating the component. If provided, providers is ignored.\n */\n injector?: Injector;\n /**\n * (Optional) Module ref to use when creating the component.\n */\n ngModuleRef?: NgModuleRef<unknown>;\n /**\n * (Optional) Custom initialization code when an instance is created.\n */\n init?: (instance: T) => void;\n /**\n * Any optional data to inject into the component.\n */\n data?: any;\n}\n\nexport interface DbxInjectedTemplateConfig<T = any> {\n /**\n * Template ref to display.\n */\n templateRef?: Maybe<TemplateRef<T>>;\n /**\n * View ref to inject.\n */\n viewRef?: Maybe<ViewRef>;\n}\n\n/**\n * Merges multiple configurations into a single configuration.\n * \n * @param configs \n * @returns \n */\nexport function mergeDbxInjectedComponentConfigs(configs: Maybe<Partial<DbxInjectedComponentConfig>>[]): Partial<DbxInjectedComponentConfig> {\n const providers = mergeArrays(filterMaybeValues(configs).map(x => x.providers));\n const result = mergeObjects(configs);\n result.providers = providers;\n return result;\n}\n","import { ComponentRef, Injector, ViewContainerRef } from '@angular/core';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs/operators';\nimport { BehaviorSubject, combineLatest } from 'rxjs';\nimport { DbxInjectedComponentConfig, DbxInjectedTemplateConfig, DBX_INJECTED_COMPONENT_DATA } from './injected';\nimport { Initialized, Destroyable, Maybe, mergeArrayOrValueIntoArray } from '@dereekb/util';\nimport { SubscriptionObject, filterMaybe, skipFirstMaybe } from '@dereekb/rxjs';\n\n/**\n * Instance used by components to inject content based on the configuration into the view.\n */\nexport class DbxInjectedComponentInstance<T> implements Initialized, Destroyable {\n\n private _subscriptionObject = new SubscriptionObject();\n\n private _config = new BehaviorSubject<Maybe<DbxInjectedComponentConfig<T>>>(undefined);\n private _template = new BehaviorSubject<Maybe<DbxInjectedTemplateConfig<T>>>(undefined);\n\n private _content = new BehaviorSubject<Maybe<ViewContainerRef>>(undefined);\n private _componentRef = new BehaviorSubject<Maybe<ComponentRef<T>>>(undefined);\n\n readonly config$ = this._config.pipe(distinctUntilChanged());\n readonly template$ = this._template.pipe(distinctUntilChanged());\n readonly content$ = this._content.pipe(filterMaybe(), distinctUntilChanged(), shareReplay(1));\n\n get config(): Maybe<DbxInjectedComponentConfig<T>> {\n return this._config.value;\n }\n\n set config(config: Maybe<DbxInjectedComponentConfig<T>>) {\n this._config.next(config);\n }\n\n get template(): Maybe<DbxInjectedTemplateConfig<T>> {\n return this._template.value;\n }\n\n set template(template: Maybe<DbxInjectedTemplateConfig<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(private readonly _injector: Injector) { }\n\n init(): void {\n\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 skipFirstMaybe()\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._config.complete();\n this._template.complete();\n this._content.complete();\n this._componentRef.complete();\n }\n\n private _initComponent(config: DbxInjectedComponentConfig<T>, content: ViewContainerRef): void {\n content.clear();\n\n const { init, injector: inputInjector, providers, ngModuleRef, componentClass, data } = config;\n\n let injector: Injector | undefined;\n const parentInjector = inputInjector ?? this._injector;\n\n if (Boolean(providers || data)) {\n injector = Injector.create({\n parent: parentInjector,\n providers: mergeArrayOrValueIntoArray([{\n provide: DBX_INJECTED_COMPONENT_DATA,\n useValue: data\n }], providers ?? [])\n });\n }\n\n const componentRef: ComponentRef<T> = content.createComponent(componentClass, { injector, ngModuleRef });\n\n const instance = componentRef.instance;\n\n if (init) {\n init(instance);\n }\n\n this.componentRef = componentRef;\n }\n\n private _initTemplate(config: DbxInjectedTemplateConfig<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\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}\n","import { ViewContainerRef, OnInit, OnDestroy, Directive, Injector } from '@angular/core';\nimport { Maybe } from '@dereekb/util';\nimport { DbxInjectedComponentConfig, DbxInjectedTemplateConfig } from './injected';\nimport { DbxInjectedComponentInstance } from './injected.instance';\n\n/**\n * Abstract directive that injects content based on the configuration into the view.\n */\n@Directive()\nexport abstract class AbstractDbxInjectedDirective<T> implements OnInit, OnDestroy {\n\n private _instance = new DbxInjectedComponentInstance<T>(this._injector);\n\n constructor(private readonly _injector: Injector) { }\n\n ngOnInit(): void {\n this._instance.init();\n }\n\n ngOnDestroy(): void {\n this._instance.destroy();\n }\n\n setConfig(config: Maybe<DbxInjectedComponentConfig>) {\n this._instance.config = config;\n }\n\n setTemplate(template: Maybe<DbxInjectedTemplateConfig>) {\n this._instance.template = template;\n }\n\n setContent(content: Maybe<ViewContainerRef>) {\n this._instance.content = content;\n }\n\n}\n","import { Component, ViewChild, ViewContainerRef, Input } from '@angular/core';\nimport { DbxInjectedComponentConfig, DbxInjectedTemplateConfig } from './injected';\nimport { AbstractDbxInjectedDirective } from './injected.directive';\nimport { Maybe } from '@dereekb/util';\n\n/**\n * Component that injects content based on the configuration into the view.\n */\n@Component({\n selector: 'dbx-injected-content, [dbx-injected-content]',\n template: `<ng-template #content></ng-template>`\n})\nexport class DbxInjectedComponent<T> extends AbstractDbxInjectedDirective<T> {\n\n @Input()\n set config(config: Maybe<DbxInjectedComponentConfig<T>>) {\n this.setConfig(config);\n }\n\n @Input()\n set template(template: Maybe<DbxInjectedTemplateConfig<T>>) {\n this.setTemplate(template);\n }\n\n @ViewChild('content', { static: true, read: ViewContainerRef })\n set content(content: Maybe<ViewContainerRef>) {\n this.setContent(content);\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { DbxInjectedComponent } from './injected.component';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n DbxInjectedComponent\n ],\n exports: [\n DbxInjectedComponent\n ],\n})\nexport class DbxInjectedComponentModule { }\n","import { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { timeHasExpired, unixTimeNumberForNow } from '@dereekb/date';\nimport { filterMaybeValuesFn, DataDoesNotExistError, DataIsExpiredError, ReadStoredData, StoredData, StoredDataStorageKey, StoredDataString, Maybe } from '@dereekb/util';\nimport { StorageAccessor } from './storage.accessor';\n\n// MARK: SimpleStorageAccessor\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 * SimpleStorageAccessor delegate.\n */\nexport interface SimpleStorageAccessorDelegate<T> extends SimpleStorageAccessorConverter<T>, StorageAccessor<StoredDataString> {\n\n\n}\n\nexport class StringifySimpleStorageAccessorConverter<T> implements SimpleStorageAccessorConverter<T> {\n\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\nexport class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {\n\n constructor(\n private _delegate: StorageAccessor<StoredDataString>,\n private _converter: SimpleStorageAccessorConverter<T>\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<{}> {\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\nexport interface SimpleStorageAccessorConfig {\n /**\n * Storage Key Prefix\n */\n readonly prefix: string;\n /**\n * Optional prefix/value splitter.\n */\n readonly prefixSplitter?: string;\n /**\n * Number in milliseconds that objects stored will expire in.\n */\n readonly expiresIn?: number;\n}\n\n/**\n * LimitedStorageAccessor implementation that uses a Delegate\n */\nexport class SimpleStorageAccessor<T> implements StorageAccessor<T> {\n\n static readonly PREFIX_SPLITTER = '::';\n\n protected readonly _config: SimpleStorageAccessorConfig & {\n fullPrefix: string;\n };\n\n constructor(private readonly _delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig) {\n const prefix = config.prefix;\n const prefixSplitter = config.prefixSplitter ?? SimpleStorageAccessor.PREFIX_SPLITTER;\n\n this.assertValidStorageKeyPrefix(prefix, prefixSplitter);\n\n const fullPrefix = `${prefix}${prefixSplitter}`;\n this._config = {\n ...config,\n prefixSplitter,\n fullPrefix\n };\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.map((storedData) => {\n const readStoredData = this.readStoredData(storedData);\n\n if (!readStoredData.expired) {\n return readStoredData.convertedData;\n } else {\n return null;\n }\n }).filter(filterMaybeValuesFn)\n })\n );\n }\n\n allKeys(): Observable<string[]> {\n return this._delegate.allKeys(this._config.fullPrefix).pipe(\n map((keys) => keys.map(x => this.decodeStorageKey(x)))\n );\n }\n\n clear(): Observable<{}> {\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: unixTimeNumberForNow(),\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 timeHasExpired(storeData.storedAt, expiresIn);\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n // MARK: Internal\n protected assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void {\n if (!prefixSplitter) {\n throw new Error('Invalid storage key prefix splitter. Must be defined and not empty.');\n }\n\n if (!this.isValidStorageKeyPrefix(prefix, prefixSplitter)) {\n throw new Error('Invalid storage key prefix.');\n }\n }\n\n protected isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean {\n return Boolean(prefix && prefix.indexOf(prefixSpltter) === -1);\n }\n\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 = storageKey.split(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}\n","import { Observable } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\nimport { StorageAccessor } from './storage.accessor';\nimport { StoredDataString, FullStorageObject, StorageObjectUtility, Maybe } from '@dereekb/util';\n\n/**\n * Simple StorageAccessor implementation that wraps a FullStorageObject.\n */\nexport class StringStorageAccessor implements StorageAccessor<StoredDataString> {\n\n constructor(private readonly _storage: FullStorageObject) { }\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 => 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}\n","import { InjectionToken } from '@angular/core';\n\nexport const DEFAULT_STORAGE_OBJECT_TOKEN = new InjectionToken('DBX_UTIL_DEFAULT_STORAGE_OBJECT');\nexport const DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN = new InjectionToken('DBX_UTIL_DEFAULT_STORAGE_ACCESSOR_FACTORY');\n","import { Inject, Injectable } from '@angular/core';\nimport { StorageAccessor } from './storage.accessor';\nimport { SimpleStorageAccessorConfig, SimpleStorageAccessor, SimpleStorageAccessorConverter, StringifySimpleStorageAccessorConverter, WrapperSimpleStorageAccessorDelegate } from './storage.accessor.simple';\nimport { StringStorageAccessor } from './storage.accessor.string';\nimport { DEFAULT_STORAGE_OBJECT_TOKEN } from './storage.di';\nimport { FullStorageObject, StoredDataString } from '@dereekb/util';\n\nexport interface StorageAccessorFactoryConfig<T> extends SimpleStorageAccessorConfig {\n storage?: StorageAccessor<StoredDataString>;\n converter?: SimpleStorageAccessorConverter<T>;\n}\n\n/**\n * Used for building SimpleStorageAccessor instances from SimpleStorageAccessorConfig.\n */\n@Injectable()\nexport class SimpleStorageAccessorFactory {\n\n constructor(@Inject(DEFAULT_STORAGE_OBJECT_TOKEN) readonly storageObject: FullStorageObject) { }\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}\n","import { Maybe } from '@dereekb/util';\nimport { Observable } from 'rxjs';\n\n/**\n * Stored object accessor that can get/set/remove via a key, or be cleared entirely.\n */\nexport abstract class LimitedStorageAccessor<T> {\n\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<{}>;\n\n}\n\n/**\n * LimitedStorageAccessor extension that has knowledge of all stored keys.\n */\nexport abstract class StorageAccessor<T> extends LimitedStorageAccessor<T> {\n\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/**\n * StorageAccessor-like object that has immediate/synchronous functionality for get/set.\n */\nexport abstract class InstantStorageAccessor<T> {\n\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}\n","import { FullStorageObject, Maybe, StorageObject, StorageObjectUtility, StoredDataStorageKey } from '@dereekb/util';\n\n/**\n * StorageObject using LocalStorage.\n */\nexport class FullLocalStorageObject implements FullStorageObject {\n\n constructor(private _localStorage: StorageObject) { }\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 (e) {\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}\n","import { SHARED_MEMORY_STORAGE } from '@dereekb/util';\nimport { FullLocalStorageObject } from './storage.object.localstorage';\n\n/**\n * FullStorageObject implementation that uses a localstorage that entirely resides in memory.\n */\nexport class MemoryStorageObject extends FullLocalStorageObject {\n\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}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { 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\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@NgModule()\nexport class DbxStorageModule {\n\n static forRoot(): ModuleWithProviders<DbxStorageModule> {\n return {\n ngModule: DbxStorageModule,\n providers: [{\n provide: DEFAULT_STORAGE_OBJECT_TOKEN,\n useFactory: defaultStorageObjectFactory\n }, {\n provide: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN,\n useClass: SimpleStorageAccessorFactory\n }, {\n provide: SimpleStorageAccessorFactory,\n useExisting: DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN\n }]\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["delay","tap","filter","startWith","switchMap","shareReplay","first"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA;;;MAIsB,6BAA6B;IAIjD,YAAY,YAA2B;QAF/B,wBAAmB,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAGrD,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC;KACzB;IAED,WAAW;QACT,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;KACpC;IAED,IAAc,GAAG,CAAC,YAAsC;QACtD,IAAI,CAAC,mBAAmB,CAAC,YAAY,GAAG,YAAY,CAAC;KACtD;;0HAdmB,6BAA6B;8GAA7B,6BAA6B;2FAA7B,6BAA6B;kBADlD,SAAS;;AAoBV;;;MAIsB,oCAAqC,SAAQ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