@dereekb/dbx-core 2.1.0 → 3.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 (235) hide show
  1. package/esm2020/lib/action/action.handler.mjs +3 -125
  2. package/esm2020/lib/action/action.machine.mjs +8 -7
  3. package/esm2020/lib/action/action.module.mjs +10 -10
  4. package/esm2020/lib/action/action.store.mjs +3 -3
  5. package/esm2020/lib/action/action.store.source.mjs +3 -3
  6. package/esm2020/lib/action/directive/auto/action.automodify.directive.mjs +4 -4
  7. package/esm2020/lib/action/directive/auto/action.autotrigger.directive.mjs +7 -6
  8. package/esm2020/lib/action/directive/context/action.directive.mjs +3 -3
  9. package/esm2020/lib/action/directive/context/action.source.directive.mjs +3 -3
  10. package/esm2020/lib/action/directive/debug/action.logger.directive.mjs +3 -3
  11. package/esm2020/lib/action/directive/map/action.map.directive.mjs +3 -3
  12. package/esm2020/lib/action/directive/map/action.map.key.directive.mjs +3 -3
  13. package/esm2020/lib/action/directive/map/action.map.source.directive.mjs +3 -3
  14. package/esm2020/lib/action/directive/map/action.map.working.disable.directive.mjs +3 -3
  15. package/esm2020/lib/action/directive/state/action.disabled.directive.mjs +5 -6
  16. package/esm2020/lib/action/directive/state/action.enforce.modified.directive.mjs +6 -6
  17. package/esm2020/lib/action/directive/state/action.handler.directive.mjs +10 -9
  18. package/esm2020/lib/action/directive/state/action.success.directive.mjs +23 -35
  19. package/esm2020/lib/action/directive/state/action.success.handler.directive.mjs +48 -0
  20. package/esm2020/lib/action/directive/state/action.value.directive.mjs +8 -8
  21. package/esm2020/lib/action/directive/state/action.value.stream.directive.mjs +3 -3
  22. package/esm2020/lib/action/directive/state/action.value.trigger.directive.mjs +6 -6
  23. package/esm2020/lib/action/directive/state/action.value.trigger.instance.mjs +2 -1
  24. package/esm2020/lib/action/directive/state/action.working.component.mjs +28 -22
  25. package/esm2020/lib/action/directive/state/index.mjs +2 -2
  26. package/esm2020/lib/auth/auth.module.mjs +26 -0
  27. package/esm2020/lib/auth/auth.role.any.directive.mjs +36 -0
  28. package/esm2020/lib/auth/auth.role.has.directive.mjs +36 -0
  29. package/esm2020/lib/auth/auth.state.module.mjs +28 -0
  30. package/esm2020/lib/auth/auth.state.service.mjs +23 -0
  31. package/esm2020/lib/auth/auth.user.mjs +11 -0
  32. package/esm2020/lib/auth/index.mjs +10 -0
  33. package/esm2020/lib/auth/router/auth.router.mjs +6 -0
  34. package/esm2020/lib/auth/router/auth.router.module.mjs +26 -0
  35. package/esm2020/lib/auth/router/auth.router.service.mjs +61 -0
  36. package/esm2020/lib/auth/router/index.mjs +6 -0
  37. package/esm2020/lib/auth/router/provider/uirouter/auth.hook.mjs +23 -0
  38. package/esm2020/lib/auth/router/provider/uirouter/hook.mjs +65 -0
  39. package/esm2020/lib/auth/router/provider/uirouter/index.mjs +6 -0
  40. package/esm2020/lib/auth/router/provider/uirouter/redirect.mjs +29 -0
  41. package/esm2020/lib/auth/router/provider/uirouter/role.hook.mjs +32 -0
  42. package/esm2020/lib/auth/router/provider/uirouter/state.hook.mjs +53 -0
  43. package/esm2020/lib/auth/router/state/auth.router.state.module.mjs +32 -0
  44. package/esm2020/lib/auth/router/state/effect/auth.router.state.effect.mjs +46 -0
  45. package/esm2020/lib/auth/router/state/effect/index.mjs +2 -0
  46. package/esm2020/lib/auth/router/state/index.mjs +3 -0
  47. package/esm2020/lib/auth/service/auth.service.mjs +6 -0
  48. package/esm2020/lib/auth/service/auth.service.rxjs.mjs +27 -0
  49. package/esm2020/lib/auth/service/index.mjs +3 -0
  50. package/esm2020/lib/auth/state/action/auth.action.mjs +14 -0
  51. package/esm2020/lib/auth/state/action/index.mjs +12 -0
  52. package/esm2020/lib/auth/state/action/user.action.mjs +18 -0
  53. package/esm2020/lib/auth/state/effect/auth.effect.mjs +44 -0
  54. package/esm2020/lib/auth/state/index.mjs +13 -0
  55. package/esm2020/lib/auth/state/reducer/index.mjs +23 -0
  56. package/esm2020/lib/auth/state/reducer/user.reducer.mjs +12 -0
  57. package/esm2020/lib/auth/state/state.mjs +2 -0
  58. package/esm2020/lib/button/action/action.button.directive.mjs +3 -3
  59. package/esm2020/lib/button/action/action.button.trigger.directive.mjs +3 -3
  60. package/esm2020/lib/button/button.directive.mjs +6 -6
  61. package/esm2020/lib/button/button.loading.directive.mjs +3 -3
  62. package/esm2020/lib/button/button.mjs +1 -1
  63. package/esm2020/lib/button/button.module.mjs +4 -4
  64. package/esm2020/lib/button/router/button.segue.directive.mjs +8 -4
  65. package/esm2020/lib/context/context.directive.mjs +41 -0
  66. package/esm2020/lib/context/context.mjs +22 -0
  67. package/esm2020/lib/context/context.module.mjs +28 -0
  68. package/esm2020/lib/context/context.service.mjs +29 -0
  69. package/esm2020/lib/context/index.mjs +6 -0
  70. package/esm2020/lib/context/state/action/data.action.mjs +10 -0
  71. package/esm2020/lib/context/state/action/index.mjs +7 -0
  72. package/esm2020/lib/context/state/effect/index.mjs +38 -0
  73. package/esm2020/lib/context/state/index.mjs +13 -0
  74. package/esm2020/lib/context/state/reducer/data.reducer.mjs +16 -0
  75. package/esm2020/lib/context/state/reducer/index.mjs +25 -0
  76. package/esm2020/lib/context/state/state.mjs +2 -0
  77. package/esm2020/lib/filter/action/action.filter.source.directive.mjs +3 -3
  78. package/esm2020/lib/filter/filter.abstract.connector.directive.mjs +3 -3
  79. package/esm2020/lib/filter/filter.abstract.source.directive.mjs +4 -4
  80. package/esm2020/lib/filter/filter.connector.directive.mjs +3 -3
  81. package/esm2020/lib/filter/filter.map.connector.directive.mjs +3 -3
  82. package/esm2020/lib/filter/filter.map.directive.mjs +3 -3
  83. package/esm2020/lib/filter/filter.map.instance.directive.mjs +3 -3
  84. package/esm2020/lib/filter/filter.map.source.directive.mjs +3 -3
  85. package/esm2020/lib/filter/filter.module.mjs +4 -4
  86. package/esm2020/lib/filter/filter.source.directive.mjs +3 -3
  87. package/esm2020/lib/index.mjs +6 -2
  88. package/esm2020/lib/injection/index.mjs +9 -0
  89. package/esm2020/lib/injection/injection.component.mjs +34 -0
  90. package/esm2020/lib/injection/injection.component.module.mjs +31 -0
  91. package/esm2020/lib/injection/injection.context.directive.mjs +124 -0
  92. package/esm2020/lib/injection/injection.context.forward.directive.mjs +30 -0
  93. package/esm2020/lib/injection/injection.context.mjs +18 -0
  94. package/esm2020/lib/injection/injection.directive.mjs +33 -0
  95. package/esm2020/lib/injection/injection.instance.mjs +116 -0
  96. package/esm2020/lib/injection/injection.mjs +16 -0
  97. package/esm2020/lib/ngrx/index.mjs +2 -0
  98. package/esm2020/lib/ngrx/store.lockset.mjs +64 -0
  99. package/esm2020/lib/pipe/date/date.pipe.module.mjs +4 -4
  100. package/esm2020/lib/pipe/date/datedistance.pipe.mjs +3 -3
  101. package/esm2020/lib/pipe/date/dateformatdistance.pipe.mjs +3 -3
  102. package/esm2020/lib/pipe/date/datefromtoformat.pipe.mjs +3 -3
  103. package/esm2020/lib/pipe/date/minutesstring.pipe.mjs +3 -3
  104. package/esm2020/lib/pipe/date/timedistance.pipe.mjs +6 -6
  105. package/esm2020/lib/pipe/date/tojsdate.pipe.mjs +13 -5
  106. package/esm2020/lib/pipe/date/tominutes.pipe.mjs +3 -3
  107. package/esm2020/lib/pipe/index.mjs +3 -1
  108. package/esm2020/lib/pipe/misc/index.mjs +3 -0
  109. package/esm2020/lib/pipe/misc/misc.pipe.module.mjs +20 -0
  110. package/esm2020/lib/pipe/misc/prettyjson.pipe.mjs +27 -0
  111. package/esm2020/lib/pipe/pipe.module.mjs +21 -0
  112. package/esm2020/lib/router/anchor/anchor.directive.mjs +18 -5
  113. package/esm2020/lib/router/anchor/anchor.mjs +1 -1
  114. package/esm2020/lib/router/router/provider/angular/angular.router.service.mjs +8 -5
  115. package/esm2020/lib/router/router/provider/angular/angular.router.service.module.mjs +4 -4
  116. package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.mjs +32 -10
  117. package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.module.mjs +4 -4
  118. package/esm2020/lib/router/router/service/index.mjs +2 -1
  119. package/esm2020/lib/router/router/service/router.go.mjs +14 -0
  120. package/esm2020/lib/router/router/service/router.service.mjs +1 -1
  121. package/esm2020/lib/router/router/transition/transition.directive.mjs +7 -7
  122. package/esm2020/lib/router/router/transition/transition.watcher.directive.mjs +6 -6
  123. package/esm2020/lib/router/segue.mjs +17 -2
  124. package/esm2020/lib/storage/storage.accessor.simple.factory.mjs +3 -3
  125. package/esm2020/lib/storage/storage.module.mjs +4 -4
  126. package/esm2020/lib/subscription/subscription.directive.mjs +6 -6
  127. package/esm2020/lib/util/view.mjs +18 -2
  128. package/esm2020/lib/view/if.directive.mjs +30 -0
  129. package/esm2020/lib/view/index.mjs +2 -0
  130. package/fesm2015/dereekb-dbx-core.mjs +1672 -575
  131. package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
  132. package/fesm2020/dereekb-dbx-core.mjs +1682 -585
  133. package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
  134. package/lib/action/action.handler.d.ts +4 -72
  135. package/lib/action/action.module.d.ts +3 -3
  136. package/lib/action/directive/auto/action.automodify.directive.d.ts +1 -1
  137. package/lib/action/directive/auto/action.autotrigger.directive.d.ts +3 -3
  138. package/lib/action/directive/state/action.disabled.directive.d.ts +1 -1
  139. package/lib/action/directive/state/action.enforce.modified.directive.d.ts +3 -2
  140. package/lib/action/directive/state/action.success.directive.d.ts +9 -17
  141. package/lib/action/directive/state/action.success.handler.directive.d.ts +24 -0
  142. package/lib/action/directive/state/action.value.directive.d.ts +5 -5
  143. package/lib/action/directive/state/action.value.trigger.instance.d.ts +2 -2
  144. package/lib/action/directive/state/action.working.component.d.ts +11 -5
  145. package/lib/action/directive/state/index.d.ts +1 -1
  146. package/lib/auth/auth.module.d.ts +8 -0
  147. package/lib/auth/auth.role.any.directive.d.ts +20 -0
  148. package/lib/auth/auth.role.has.directive.d.ts +20 -0
  149. package/lib/auth/auth.state.module.d.ts +8 -0
  150. package/lib/auth/auth.state.service.d.ts +13 -0
  151. package/lib/auth/auth.user.d.ts +28 -0
  152. package/lib/auth/index.d.ts +9 -0
  153. package/lib/auth/router/auth.router.d.ts +10 -0
  154. package/lib/auth/router/auth.router.module.d.ts +9 -0
  155. package/lib/auth/router/auth.router.service.d.ts +38 -0
  156. package/lib/auth/router/index.d.ts +5 -0
  157. package/lib/auth/router/provider/uirouter/auth.hook.d.ts +18 -0
  158. package/lib/auth/router/provider/uirouter/hook.d.ts +46 -0
  159. package/lib/auth/router/provider/uirouter/index.d.ts +5 -0
  160. package/lib/auth/router/provider/uirouter/redirect.d.ts +9 -0
  161. package/lib/auth/router/provider/uirouter/role.hook.d.ts +26 -0
  162. package/lib/auth/router/provider/uirouter/state.hook.d.ts +31 -0
  163. package/lib/auth/router/state/auth.router.state.module.d.ts +14 -0
  164. package/lib/auth/router/state/effect/auth.router.state.effect.d.ts +32 -0
  165. package/lib/auth/router/state/effect/index.d.ts +1 -0
  166. package/lib/auth/router/state/index.d.ts +2 -0
  167. package/lib/auth/service/auth.service.d.ts +46 -0
  168. package/lib/auth/service/auth.service.rxjs.d.ts +18 -0
  169. package/lib/auth/service/index.d.ts +2 -0
  170. package/lib/auth/state/action/auth.action.d.ts +12 -0
  171. package/lib/auth/state/action/index.d.ts +11 -0
  172. package/lib/auth/state/action/user.action.d.ts +34 -0
  173. package/lib/auth/state/effect/auth.effect.d.ts +31 -0
  174. package/lib/auth/state/index.d.ts +12 -0
  175. package/lib/auth/state/reducer/index.d.ts +29 -0
  176. package/lib/auth/state/reducer/user.reducer.d.ts +11 -0
  177. package/lib/auth/state/state.d.ts +5 -0
  178. package/lib/button/button.d.ts +3 -3
  179. package/lib/button/router/button.segue.directive.d.ts +1 -0
  180. package/lib/context/context.d.ts +39 -0
  181. package/lib/context/context.directive.d.ts +19 -0
  182. package/lib/context/context.module.d.ts +8 -0
  183. package/lib/context/context.service.d.ts +16 -0
  184. package/lib/context/index.d.ts +5 -0
  185. package/lib/context/state/action/data.action.d.ts +13 -0
  186. package/lib/context/state/action/index.d.ts +6 -0
  187. package/lib/context/state/effect/index.d.ts +39 -0
  188. package/lib/context/state/index.d.ts +12 -0
  189. package/lib/context/state/reducer/data.reducer.d.ts +13 -0
  190. package/lib/context/state/reducer/index.d.ts +34 -0
  191. package/lib/context/state/state.d.ts +9 -0
  192. package/lib/filter/filter.abstract.source.directive.d.ts +2 -2
  193. package/lib/index.d.ts +5 -1
  194. package/lib/injection/index.d.ts +8 -0
  195. package/lib/injection/injection.component.d.ts +15 -0
  196. package/lib/injection/injection.component.module.d.ts +9 -0
  197. package/lib/injection/injection.context.d.ts +39 -0
  198. package/lib/injection/injection.context.directive.d.ts +25 -0
  199. package/lib/injection/injection.context.forward.directive.d.ts +16 -0
  200. package/lib/{injected/injected.d.ts → injection/injection.d.ts} +4 -4
  201. package/lib/injection/injection.directive.d.ts +19 -0
  202. package/lib/{injected/injected.instance.d.ts → injection/injection.instance.d.ts} +8 -8
  203. package/lib/ngrx/index.d.ts +1 -0
  204. package/lib/ngrx/store.lockset.d.ts +36 -0
  205. package/lib/pipe/index.d.ts +2 -0
  206. package/lib/pipe/misc/index.d.ts +2 -0
  207. package/lib/pipe/misc/misc.pipe.module.d.ts +7 -0
  208. package/lib/pipe/misc/prettyjson.pipe.d.ts +9 -0
  209. package/lib/pipe/pipe.module.d.ts +8 -0
  210. package/lib/router/anchor/anchor.d.ts +5 -1
  211. package/lib/router/anchor/anchor.directive.d.ts +10 -2
  212. package/lib/router/router/provider/angular/angular.router.service.d.ts +7 -5
  213. package/lib/router/router/provider/uirouter/uirouter.router.service.d.ts +11 -5
  214. package/lib/router/router/service/index.d.ts +1 -0
  215. package/lib/router/router/service/router.go.d.ts +14 -0
  216. package/lib/router/router/service/router.service.d.ts +10 -4
  217. package/lib/router/router/transition/transition.directive.d.ts +2 -2
  218. package/lib/router/router/transition/transition.watcher.directive.d.ts +1 -1
  219. package/lib/router/segue.d.ts +10 -3
  220. package/lib/util/view.d.ts +12 -0
  221. package/lib/view/if.directive.d.ts +19 -0
  222. package/lib/view/index.d.ts +1 -0
  223. package/package.json +6 -13
  224. package/esm2020/lib/action/directive/state/action.success.component.mjs +0 -50
  225. package/esm2020/lib/injected/index.mjs +0 -6
  226. package/esm2020/lib/injected/injected.component.mjs +0 -34
  227. package/esm2020/lib/injected/injected.component.module.mjs +0 -26
  228. package/esm2020/lib/injected/injected.directive.mjs +0 -33
  229. package/esm2020/lib/injected/injected.instance.mjs +0 -116
  230. package/esm2020/lib/injected/injected.mjs +0 -16
  231. package/lib/action/directive/state/action.success.component.d.ts +0 -15
  232. package/lib/injected/index.d.ts +0 -5
  233. package/lib/injected/injected.component.d.ts +0 -15
  234. package/lib/injected/injected.component.module.d.ts +0 -8
  235. package/lib/injected/injected.directive.d.ts +0 -19
@@ -1,21 +1,25 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Injectable, forwardRef, Host, Input, Optional, Component, NgModule, EventEmitter, Output, LOCALE_ID, Pipe, Inject, ViewChild, InjectionToken, Injector, ViewContainerRef } from '@angular/core';
3
- import * as i1$3 from '@dereekb/rxjs';
4
- import { SubscriptionObject, LockSet, filterMaybe, LoadingStateType, beginLoading, idleLoadingState, errorResult, successResult, scanCount, combineLatestFromMapValuesObsFn, asObservable, returnIfIs, skipFirstMaybe, FilterSourceInstance, FilterSource, FilterSourceConnector, FilterMap } from '@dereekb/rxjs';
2
+ import { Directive, Injectable, forwardRef, Host, Input, Optional, NgModule, InjectionToken, Inject, EventEmitter, Output, LOCALE_ID, Pipe, ViewChild, Injector, ViewContainerRef, Component } from '@angular/core';
3
+ import * as i1$5 from '@dereekb/rxjs';
4
+ import { SubscriptionObject, LockSet, filterMaybe, LoadingStateType, beginLoading, idleLoadingState, errorResult, successResult, scanCount, combineLatestFromMapValuesObsFn, workFactory, emitDelayObs, asObservable, returnIfIs, skipFirstMaybe, onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, FilterSourceInstance, FilterSource, FilterSourceConnector, FilterMap } from '@dereekb/rxjs';
5
5
  import * as i1 from 'rxjs';
6
- import { BehaviorSubject, combineLatest, Subject, interval, EMPTY, of, isObservable, delay as delay$1, switchMap as switchMap$1, map as map$1, catchError, tap as tap$1, filter as filter$1, startWith as startWith$1, shareReplay as shareReplay$1, first as first$1, Observable } from 'rxjs';
7
- import { switchMap, first, distinctUntilChanged, filter, debounce, throttle, exhaustMap, mergeMap, map, shareReplay, withLatestFrom, startWith, tap, delay } from 'rxjs/operators';
8
- import * as i1$4 from '@dereekb/util';
9
- import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, isUndefinedAndNotFalse, getValueFromObjectOrGetter, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeArrayIntoArray, objectFlatMergeMatrix, mergeArrays, filterMaybeValues, mergeObjects, mergeArrayOrValueIntoArray, DataIsExpiredError, DataDoesNotExistError, filterMaybeValuesFn, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
6
+ import { BehaviorSubject, combineLatest, Subject, interval, EMPTY, of, distinctUntilChanged as distinctUntilChanged$1, exhaustMap as exhaustMap$1, shareReplay as shareReplay$1, delay, switchMap as switchMap$1, map as map$1, catchError, first as first$1, firstValueFrom, filter as filter$1, takeUntil, startWith as startWith$1, tap as tap$1, Observable } from 'rxjs';
7
+ import { switchMap, first, distinctUntilChanged, filter, debounce, throttle, exhaustMap, mergeMap, map, shareReplay, withLatestFrom, startWith, tap, delay as delay$1 } from 'rxjs/operators';
8
+ import * as i1$6 from '@dereekb/util';
9
+ import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, isGetter, setIncludesFunction, maybeSet, isAllowed, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeArrayIntoArray, objectFlatMergeMatrix, mergeArrays, filterMaybeValues, mergeObjects, mergeArrayOrValueIntoArray, makePromiseFullRef, DataIsExpiredError, DataDoesNotExistError, filterMaybeValuesFn, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
10
10
  import { ComponentStore } from '@ngrx/component-store';
11
- import * as i2 from '@angular/common';
12
11
  import { CommonModule, formatDate } from '@angular/common';
12
+ import * as i1$3 from '@ngrx/effects';
13
+ import { ofType, createEffect, EffectsModule } from '@ngrx/effects';
14
+ import * as i1$4 from '@ngrx/store';
15
+ import { createAction, props, createReducer, on, combineReducers, createFeatureSelector, createSelector, StoreModule } from '@ngrx/store';
13
16
  import * as i1$1 from '@angular/router';
14
17
  import { NavigationStart, NavigationEnd } from '@angular/router';
15
18
  import { isArray } from 'class-validator';
16
19
  import * as i1$2 from '@uirouter/core';
17
- import { addMinutes, isPast, formatDistance, isValid, formatDistanceToNow, startOfDay, isSameDay } from 'date-fns';
20
+ import { addMinutes, isValid, isPast, formatDistance, formatDistanceToNow, startOfDay, isSameDay } from 'date-fns';
18
21
  import { toJsDate, formatToTimeString, unixTimeNumberForNow, timeHasExpired } from '@dereekb/date';
22
+ import { __awaiter } from 'tslib';
19
23
 
20
24
  /**
21
25
  * Abstract component that contains a SubscriptionObject and will clean it up automatically.
@@ -32,9 +36,9 @@ class AbstractSubscriptionDirective {
32
36
  this._subscriptionObject.subscription = subscription;
33
37
  }
34
38
  }
35
- AbstractSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractSubscriptionDirective, deps: [{ token: i1.Subscription }], target: i0.ɵɵFactoryTarget.Directive });
36
- AbstractSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractSubscriptionDirective, ngImport: i0 });
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractSubscriptionDirective, decorators: [{
39
+ AbstractSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractSubscriptionDirective, deps: [{ token: i1.Subscription }], target: i0.ɵɵFactoryTarget.Directive });
40
+ AbstractSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractSubscriptionDirective, ngImport: i0 });
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractSubscriptionDirective, decorators: [{
38
42
  type: Directive
39
43
  }], ctorParameters: function () { return [{ type: i1.Subscription }]; } });
40
44
  /**
@@ -52,9 +56,9 @@ class AbstractLockSetSubscriptionDirective extends AbstractSubscriptionDirective
52
56
  super.ngOnDestroy();
53
57
  }
54
58
  }
55
- AbstractLockSetSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractLockSetSubscriptionDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
56
- AbstractLockSetSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractLockSetSubscriptionDirective, usesInheritance: true, ngImport: i0 });
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractLockSetSubscriptionDirective, decorators: [{
59
+ AbstractLockSetSubscriptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractLockSetSubscriptionDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
60
+ AbstractLockSetSubscriptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractLockSetSubscriptionDirective, usesInheritance: true, ngImport: i0 });
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractLockSetSubscriptionDirective, decorators: [{
58
62
  type: Directive
59
63
  }] });
60
64
 
@@ -186,9 +190,9 @@ class DbxActionContextStoreSourceInstance {
186
190
  this.useStore((x) => x.reset());
187
191
  }
188
192
  }
189
- DbxActionContextStoreSourceInstance.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextStoreSourceInstance, deps: [{ token: ActionContextStoreSource }], target: i0.ɵɵFactoryTarget.Injectable });
190
- DbxActionContextStoreSourceInstance.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextStoreSourceInstance });
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextStoreSourceInstance, decorators: [{
193
+ DbxActionContextStoreSourceInstance.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextStoreSourceInstance, deps: [{ token: ActionContextStoreSource }], target: i0.ɵɵFactoryTarget.Injectable });
194
+ DbxActionContextStoreSourceInstance.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextStoreSourceInstance });
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextStoreSourceInstance, decorators: [{
192
196
  type: Injectable
193
197
  }], ctorParameters: function () { return [{ type: ActionContextStoreSource }]; } });
194
198
  const actionContextStoreSourceInstanceFactory = (source) => {
@@ -247,9 +251,9 @@ class DbxActionAutoModifyDirective extends AbstractSubscriptionDirective {
247
251
  });
248
252
  }
249
253
  }
250
- DbxActionAutoModifyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoModifyDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
251
- DbxActionAutoModifyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionAutoModifyDirective, selector: "[dbxActionAutoModify]", inputs: { autoModifyEnabled: ["dbxActionAutoModify", "autoModifyEnabled"] }, usesInheritance: true, ngImport: i0 });
252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoModifyDirective, decorators: [{
254
+ DbxActionAutoModifyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoModifyDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
255
+ DbxActionAutoModifyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionAutoModifyDirective, selector: "[dbxActionAutoModify]", inputs: { autoModifyEnabled: ["dbxActionAutoModify", "autoModifyEnabled"] }, usesInheritance: true, ngImport: i0 });
256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoModifyDirective, decorators: [{
253
257
  type: Directive,
254
258
  args: [{
255
259
  selector: '[dbxActionAutoModify]',
@@ -275,12 +279,12 @@ class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
275
279
  super();
276
280
  this.source = source;
277
281
  this._triggerEnabled = new BehaviorSubject(true);
282
+ this._triggerLimit = new BehaviorSubject(undefined);
283
+ this._trigger = new Subject();
278
284
  this.triggerDebounce = DEFAULT_DEBOUNCE_MS;
279
285
  this.triggerThrottle = DEFAULT_THROTTLE_MS;
280
286
  this.triggerErrorThrottle = DEFAULT_ERROR_THROTTLE_MS;
281
287
  this.maxErrorsForThrottle = MAX_ERRORS_TO_THROTTLE_ON;
282
- this._triggerLimit = new BehaviorSubject(undefined);
283
- this._trigger = new Subject();
284
288
  this._triggerCount = 0;
285
289
  this._errorCount$ = this.source.errorCountSinceLastSuccess$;
286
290
  this._triggerCount$ = this.source.isModifiedAndCanTriggerUpdates$.pipe(filter(() => this.isEnabled), filter((x) => x), debounce(() => interval(this.triggerDebounce)), throttle(() => this._errorCount$.pipe(first(), exhaustMap((count) => interval(this.triggerThrottle + (Math.min(count, this.maxErrorsForThrottle) * this.triggerErrorThrottle)))), { leading: true, trailing: true }),
@@ -354,14 +358,15 @@ class DbxActionAutoTriggerDirective extends AbstractSubscriptionDirective {
354
358
  ngOnDestroy() {
355
359
  this.source.lockSet.onNextUnlock(() => {
356
360
  super.ngOnDestroy();
361
+ this._triggerEnabled.complete();
357
362
  this._trigger.complete();
358
363
  this._triggerLimit.complete();
359
364
  });
360
365
  }
361
366
  }
362
- DbxActionAutoTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoTriggerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
363
- DbxActionAutoTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: { triggerEnabled: ["dbxActionAutoTrigger", "triggerEnabled"], triggerDebounce: "triggerDebounce", triggerThrottle: "triggerThrottle", triggerErrorThrottle: "triggerErrorThrottle", fastTrigger: "fastTrigger", instantTrigger: "instantTrigger", triggerLimit: "triggerLimit" }, usesInheritance: true, ngImport: i0 });
364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionAutoTriggerDirective, decorators: [{
367
+ DbxActionAutoTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoTriggerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
368
+ DbxActionAutoTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: { triggerEnabled: ["dbxActionAutoTrigger", "triggerEnabled"], triggerDebounce: "triggerDebounce", triggerThrottle: "triggerThrottle", triggerErrorThrottle: "triggerErrorThrottle", fastTrigger: "fastTrigger", instantTrigger: "instantTrigger", triggerLimit: "triggerLimit" }, usesInheritance: true, ngImport: i0 });
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionAutoTriggerDirective, decorators: [{
365
370
  type: Directive,
366
371
  args: [{
367
372
  selector: 'dbxActionAutoTrigger, [dbxActionAutoTrigger]',
@@ -442,9 +447,9 @@ class dbxActionValueStreamDirective {
442
447
  });
443
448
  }
444
449
  }
445
- dbxActionValueStreamDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: dbxActionValueStreamDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
446
- dbxActionValueStreamDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: dbxActionValueStreamDirective, selector: "[dbxActionValueStream]", inputs: { dbxActionValueStream: "dbxActionValueStream", dbxActionValueStreamIsNotEmpty: "dbxActionValueStreamIsNotEmpty", dbxActionValueStreamModified: "dbxActionValueStreamModified" }, ngImport: i0 });
447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: dbxActionValueStreamDirective, decorators: [{
450
+ dbxActionValueStreamDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: dbxActionValueStreamDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
451
+ dbxActionValueStreamDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: dbxActionValueStreamDirective, selector: "[dbxActionValueStream]", inputs: { dbxActionValueStream: "dbxActionValueStream", dbxActionValueStreamIsNotEmpty: "dbxActionValueStreamIsNotEmpty", dbxActionValueStreamModified: "dbxActionValueStreamModified" }, ngImport: i0 });
452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: dbxActionValueStreamDirective, decorators: [{
448
453
  type: Directive,
449
454
  args: [{
450
455
  selector: '[dbxActionValueStream]',
@@ -733,9 +738,9 @@ class ActionContextStore extends ComponentStore {
733
738
  }, 2000);
734
739
  }
735
740
  }
736
- ActionContextStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
737
- ActionContextStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStore });
738
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ActionContextStore, decorators: [{
741
+ ActionContextStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ActionContextStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
742
+ ActionContextStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ActionContextStore });
743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ActionContextStore, decorators: [{
739
744
  type: Injectable
740
745
  }], ctorParameters: function () { return []; } });
741
746
 
@@ -808,9 +813,9 @@ class DbxActionDirective extends DbxActionContextBaseSource {
808
813
  });
809
814
  }
810
815
  }
811
- DbxActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDirective, deps: [{ token: SecondaryActionContextStoreSource, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
812
- DbxActionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", providers: ProvideActionStoreSource(DbxActionDirective), exportAs: ["action", "dbxAction"], usesInheritance: true, ngImport: i0 });
813
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDirective, decorators: [{
816
+ DbxActionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDirective, deps: [{ token: SecondaryActionContextStoreSource, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
817
+ DbxActionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", providers: ProvideActionStoreSource(DbxActionDirective), exportAs: ["action", "dbxAction"], usesInheritance: true, ngImport: i0 });
818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDirective, decorators: [{
814
819
  type: Directive,
815
820
  args: [{
816
821
  selector: 'dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]',
@@ -846,9 +851,9 @@ class DbxActionSourceDirective {
846
851
  this._source.next(source);
847
852
  }
848
853
  }
849
- DbxActionSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
850
- DbxActionSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionSourceDirective, selector: "[dbxActionSource]", inputs: { source: ["dbxActionSource", "source"] }, providers: ProvideSecondaryActionStoreSource(DbxActionSourceDirective), ngImport: i0 });
851
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSourceDirective, decorators: [{
854
+ DbxActionSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
855
+ DbxActionSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionSourceDirective, selector: "[dbxActionSource]", inputs: { source: ["dbxActionSource", "source"] }, providers: ProvideSecondaryActionStoreSource(DbxActionSourceDirective), ngImport: i0 });
856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSourceDirective, decorators: [{
852
857
  type: Directive,
853
858
  args: [{
854
859
  selector: '[dbxActionSource]',
@@ -873,9 +878,9 @@ class DbxActionContextLoggerDirective extends AbstractSubscriptionDirective {
873
878
  });
874
879
  }
875
880
  }
876
- DbxActionContextLoggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextLoggerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
877
- DbxActionContextLoggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionContextLoggerDirective, selector: "[dbxActionLogger],[dbxActionContextLogger]", usesInheritance: true, ngImport: i0 });
878
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextLoggerDirective, decorators: [{
881
+ DbxActionContextLoggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextLoggerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
882
+ DbxActionContextLoggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionContextLoggerDirective, selector: "[dbxActionLogger],[dbxActionContextLogger]", usesInheritance: true, ngImport: i0 });
883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextLoggerDirective, decorators: [{
879
884
  type: Directive,
880
885
  args: [{
881
886
  selector: '[dbxActionLogger],[dbxActionContextLogger]'
@@ -933,9 +938,9 @@ class DbxActionContextMapDirective {
933
938
  return this.map$.pipe(switchMap(combineLatestFromMapValuesObsFn((x) => x.store$.pipe(switchMap(mapFn)))));
934
939
  }
935
940
  }
936
- DbxActionContextMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextMapDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
937
- DbxActionContextMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionContextMapDirective, selector: "[dbxActionContextMap]", providers: [], exportAs: ["actionMap"], ngImport: i0 });
938
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionContextMapDirective, decorators: [{
941
+ DbxActionContextMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextMapDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
942
+ DbxActionContextMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionContextMapDirective, selector: "[dbxActionContextMap]", providers: [], exportAs: ["actionMap"], ngImport: i0 });
943
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionContextMapDirective, decorators: [{
939
944
  type: Directive,
940
945
  args: [{
941
946
  selector: '[dbxActionContextMap]',
@@ -972,9 +977,9 @@ class DbxActionFromMapDirective {
972
977
  this._key.next(key);
973
978
  }
974
979
  }
975
- DbxActionFromMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFromMapDirective, deps: [{ token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
976
- DbxActionFromMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionFromMapDirective, selector: "[dbxActionFromMap]", inputs: { key: ["dbxActionFromMap", "key"] }, providers: ProvideSecondaryActionStoreSource(DbxActionFromMapDirective), ngImport: i0 });
977
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionFromMapDirective, decorators: [{
980
+ DbxActionFromMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionFromMapDirective, deps: [{ token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
981
+ DbxActionFromMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionFromMapDirective, selector: "[dbxActionFromMap]", inputs: { key: ["dbxActionFromMap", "key"] }, providers: ProvideSecondaryActionStoreSource(DbxActionFromMapDirective), ngImport: i0 });
982
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionFromMapDirective, decorators: [{
978
983
  type: Directive,
979
984
  args: [{
980
985
  selector: '[dbxActionFromMap]',
@@ -1014,9 +1019,9 @@ class DbxActionMapSourceDirective {
1014
1019
  }
1015
1020
  }
1016
1021
  }
1017
- DbxActionMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapSourceDirective, deps: [{ token: ActionContextStoreSource, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
1018
- DbxActionMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionMapSourceDirective, selector: "[dbxActionMapSource]", inputs: { key: ["dbxActionMapSource", "key"] }, ngImport: i0 });
1019
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapSourceDirective, decorators: [{
1022
+ DbxActionMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapSourceDirective, deps: [{ token: ActionContextStoreSource, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
1023
+ DbxActionMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionMapSourceDirective, selector: "[dbxActionMapSource]", inputs: { key: ["dbxActionMapSource", "key"] }, ngImport: i0 });
1024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapSourceDirective, decorators: [{
1020
1025
  type: Directive,
1021
1026
  args: [{
1022
1027
  selector: '[dbxActionMapSource]'
@@ -1056,9 +1061,9 @@ class DbxActionMapWorkingDisableDirective extends AbstractSubscriptionDirective
1056
1061
  this.source.enable(this.disabledKey || DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY);
1057
1062
  }
1058
1063
  }
1059
- DbxActionMapWorkingDisableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapWorkingDisableDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
1060
- DbxActionMapWorkingDisableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionMapWorkingDisableDirective, selector: "[dbxActionMapWorkingDisable]", inputs: { disabledKey: ["dbxActionMapWorkingDisable", "disabledKey"] }, usesInheritance: true, ngImport: i0 });
1061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionMapWorkingDisableDirective, decorators: [{
1064
+ DbxActionMapWorkingDisableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapWorkingDisableDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }, { token: DbxActionContextMapDirective }], target: i0.ɵɵFactoryTarget.Directive });
1065
+ DbxActionMapWorkingDisableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionMapWorkingDisableDirective, selector: "[dbxActionMapWorkingDisable]", inputs: { disabledKey: ["dbxActionMapWorkingDisable", "disabledKey"] }, usesInheritance: true, ngImport: i0 });
1066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionMapWorkingDisableDirective, decorators: [{
1062
1067
  type: Directive,
1063
1068
  args: [{
1064
1069
  selector: '[dbxActionMapWorkingDisable]'
@@ -1097,13 +1102,13 @@ class DbxActionDisabledDirective extends AbstractSubscriptionDirective {
1097
1102
  return this._disabled.value;
1098
1103
  }
1099
1104
  set disabled(disabled) {
1100
- const disable = isUndefinedAndNotFalse(disabled);
1105
+ const disable = disabled !== false;
1101
1106
  this._disabled.next(disable);
1102
1107
  }
1103
1108
  }
1104
- DbxActionDisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDisabledDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1105
- DbxActionDisabledDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionDisabledDirective, selector: "[dbxActionDisabled]", inputs: { disabled: ["dbxActionDisabled", "disabled"] }, usesInheritance: true, ngImport: i0 });
1106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionDisabledDirective, decorators: [{
1109
+ DbxActionDisabledDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDisabledDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1110
+ DbxActionDisabledDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionDisabledDirective, selector: "[dbxActionDisabled]", inputs: { disabled: ["dbxActionDisabled", "disabled"] }, usesInheritance: true, ngImport: i0 });
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionDisabledDirective, decorators: [{
1107
1112
  type: Directive,
1108
1113
  args: [{
1109
1114
  selector: '[dbxActionDisabled]'
@@ -1118,9 +1123,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1118
1123
  }] } });
1119
1124
 
1120
1125
  /**
1121
- * WorkHandlerContextDelegate implementation using an DbxActionContextStoreSourceInstance.
1126
+ * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.
1122
1127
  */
1123
- class WorkHandlerContextSourceDelegate {
1128
+ class DbxActionWorkInstanceDelegate {
1124
1129
  constructor(source) {
1125
1130
  this.source = source;
1126
1131
  }
@@ -1134,128 +1139,6 @@ class WorkHandlerContextSourceDelegate {
1134
1139
  this.source.reject(error);
1135
1140
  }
1136
1141
  }
1137
- /**
1138
- * Used by DbxActionHandlerDirective when handling a function.
1139
- */
1140
- class WorkHandlerContext {
1141
- constructor(value, delegate) {
1142
- this.value = value;
1143
- this.delegate = delegate;
1144
- this._done = false;
1145
- this._doneActionBegan = false;
1146
- this._actionBegan = new BehaviorSubject(false);
1147
- this._isComplete = new BehaviorSubject(false);
1148
- // Schedule to cleanup self once isComplete is true.
1149
- this._isComplete.subscribe((done) => {
1150
- if (done) {
1151
- this.destroy();
1152
- }
1153
- });
1154
- }
1155
- get actionBegan() {
1156
- var _a;
1157
- return (_a = this._doneActionBegan) !== null && _a !== void 0 ? _a : this._actionBegan.value;
1158
- }
1159
- get actionBegan$() {
1160
- return this._done ? of(this._doneActionBegan) : this._actionBegan.asObservable();
1161
- }
1162
- get isComplete() {
1163
- return this._done || this._isComplete.value;
1164
- }
1165
- get isComplete$() {
1166
- return this._done ? of(true) : this._isComplete.asObservable();
1167
- }
1168
- /**
1169
- * Begins working using an observable.
1170
- */
1171
- startWorkingWithObservable(actionObs) {
1172
- this.startWorking();
1173
- actionObs.pipe(first()).subscribe((actionResult) => {
1174
- this.success(actionResult);
1175
- }, (error) => {
1176
- var _a, _b;
1177
- const message = (_b = (_a = error.message) !== null && _a !== void 0 ? _a : error.code) !== null && _b !== void 0 ? _b : undefined;
1178
- this.reject((message) ? ({ message }) : undefined);
1179
- });
1180
- }
1181
- /**
1182
- * Notifies the system that the action has begun.
1183
- */
1184
- startWorking() {
1185
- this._setWorking();
1186
- this.delegate.startWorking();
1187
- }
1188
- /**
1189
- * Sets success on the action.
1190
- */
1191
- success(result) {
1192
- this._setComplete();
1193
- this.delegate.success(result);
1194
- }
1195
- /**
1196
- * Sets rejected on the action.
1197
- */
1198
- reject(error) {
1199
- this._setComplete();
1200
- this.delegate.reject(error);
1201
- }
1202
- destroy() {
1203
- this._doneActionBegan = this.actionBegan;
1204
- this._done = true;
1205
- // Delay to prevent error.
1206
- setTimeout(() => {
1207
- this._actionBegan.complete();
1208
- this._isComplete.complete();
1209
- });
1210
- }
1211
- _setWorking() {
1212
- if (this.actionBegan) {
1213
- throw new Error('Action already has been triggered for this context.');
1214
- }
1215
- this._actionBegan.next(true);
1216
- }
1217
- _setComplete() {
1218
- if (this.isComplete) {
1219
- throw new Error('Action has already been marked as completed.');
1220
- }
1221
- this._isComplete.next(true);
1222
- }
1223
- }
1224
- /**
1225
- * Creates a function that uses a provider to always handle new values.
1226
- */
1227
- function handleWorkValueReadyWithConfigFn(providerFn) {
1228
- return (value) => {
1229
- const config = providerFn(value);
1230
- return handleWorkValueReadyFn(config)(value);
1231
- };
1232
- }
1233
- /**
1234
- * Creates a function that handles the incoming value and creates a WorkHandlerContext.
1235
- */
1236
- function handleWorkValueReadyFn({ handlerFunction, delegate }) {
1237
- return (value) => {
1238
- const handler = new WorkHandlerContext(value, delegate);
1239
- let fnResult;
1240
- try {
1241
- fnResult = handlerFunction(value, handler);
1242
- }
1243
- catch (e) {
1244
- console.error('Action encountered an unexpected error.', e);
1245
- handler.reject(e);
1246
- return;
1247
- }
1248
- if (!handler.isComplete) {
1249
- if (fnResult && isObservable(fnResult)) {
1250
- if (handler.actionBegan) {
1251
- throw new Error('Action already marked as begun from handlerFunction result. Either return an observable or use the handler directly.');
1252
- }
1253
- handler.startWorkingWithObservable(fnResult);
1254
- }
1255
- }
1256
- return handler;
1257
- };
1258
- }
1259
1142
 
1260
1143
  /**
1261
1144
  * Context used for defining a function that performs an action using the input function on ValueReady.
@@ -1266,7 +1149,7 @@ class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
1266
1149
  this.source = source;
1267
1150
  this._handlerFunction = new BehaviorSubject(undefined);
1268
1151
  this.handlerFunction$ = this._handlerFunction.pipe(filterMaybe(), shareReplay(1));
1269
- this._delegate = new WorkHandlerContextSourceDelegate(this.source);
1152
+ this._delegate = new DbxActionWorkInstanceDelegate(this.source);
1270
1153
  }
1271
1154
  get handlerFunction() {
1272
1155
  return this._handlerFunction.value;
@@ -1275,8 +1158,8 @@ class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
1275
1158
  this._handlerFunction.next(handlerFunction);
1276
1159
  }
1277
1160
  ngOnInit() {
1278
- this.sub = this.handlerFunction$.pipe(switchMap(handlerFunction => this.source.valueReady$.pipe(map((x) => [handlerFunction, x]), tap(([handlerFunction, value]) => {
1279
- const context = handleWorkValueReadyFn({ handlerFunction, delegate: this._delegate })(value);
1161
+ this.sub = this.handlerFunction$.pipe(switchMap(work => this.source.valueReady$.pipe(tap((value) => {
1162
+ const context = workFactory({ work, delegate: this._delegate })(value);
1280
1163
  if (context) {
1281
1164
  // Add the action to the lockSet for the source to prevent it from being destroyed until the action completes.
1282
1165
  this.source.lockSet.addLock('dbxActionHandler', context.isComplete$.pipe(map(x => !x)));
@@ -1286,12 +1169,13 @@ class DbxActionHandlerDirective extends AbstractSubscriptionDirective {
1286
1169
  ngOnDestroy() {
1287
1170
  this.source.lockSet.onNextUnlock(() => {
1288
1171
  super.ngOnDestroy();
1172
+ this._handlerFunction.complete();
1289
1173
  });
1290
1174
  }
1291
1175
  }
1292
- DbxActionHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionHandlerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1293
- DbxActionHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: { handlerFunction: ["dbxActionHandler", "handlerFunction"] }, usesInheritance: true, ngImport: i0 });
1294
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionHandlerDirective, decorators: [{
1176
+ DbxActionHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHandlerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1177
+ DbxActionHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: { handlerFunction: ["dbxActionHandler", "handlerFunction"] }, usesInheritance: true, ngImport: i0 });
1178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHandlerDirective, decorators: [{
1295
1179
  type: Directive,
1296
1180
  args: [{
1297
1181
  selector: '[dbxActionHandler]',
@@ -1306,52 +1190,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1306
1190
  }] } });
1307
1191
 
1308
1192
  /**
1309
- * Displays the input content when success is set.
1310
- *
1311
- * Can be configured to show for a limited time afterwards, etc.
1193
+ * Abstract directive class that watches a show$ observable and behaves like *ngIf.
1312
1194
  */
1313
- class DbxActionSuccessComponent {
1314
- constructor(source) {
1195
+ class AbstractIfDirective extends AbstractSubscriptionDirective {
1196
+ constructor(templateRef, viewContainer) {
1197
+ super();
1198
+ this.templateRef = templateRef;
1199
+ this.viewContainer = viewContainer;
1200
+ }
1201
+ ngOnInit() {
1202
+ this.sub = this.show$.pipe(distinctUntilChanged$1()).subscribe((show) => {
1203
+ if (show) {
1204
+ this.viewContainer.createEmbeddedView(this.templateRef);
1205
+ }
1206
+ else {
1207
+ this.viewContainer.clear();
1208
+ }
1209
+ });
1210
+ }
1211
+ }
1212
+ AbstractIfDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractIfDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
1213
+ AbstractIfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractIfDirective, usesInheritance: true, ngImport: i0 });
1214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractIfDirective, decorators: [{
1215
+ type: Directive
1216
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
1217
+
1218
+ /**
1219
+ * Structural directive that displays the content when the store has a success value.
1220
+ */
1221
+ class DbxActionHasSuccessDirective extends AbstractIfDirective {
1222
+ constructor(templateRef, viewContainer, source) {
1223
+ super(templateRef, viewContainer);
1315
1224
  this.source = source;
1316
- this.show$ = this.source.isSuccess$.pipe(exhaustMap((success) => {
1225
+ this.show$ = this.source.isSuccess$.pipe(exhaustMap$1((success) => {
1317
1226
  if (success) {
1318
- if (this.hideAfter) {
1319
- return of(false).pipe(delay(this.hideAfter), startWith(true));
1320
- }
1321
- else {
1322
- return of(true);
1323
- }
1227
+ return emitDelayObs(true, false, this.hideAfter || undefined);
1324
1228
  }
1325
1229
  else {
1326
1230
  return of(false);
1327
1231
  }
1328
- }), shareReplay(1));
1232
+ }), shareReplay$1(1));
1329
1233
  }
1330
1234
  }
1331
- DbxActionSuccessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessComponent, deps: [{ token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Component });
1332
- DbxActionSuccessComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionSuccessComponent, selector: "dbx-action-success", inputs: { hideAfter: "hideAfter" }, ngImport: i0, template: `
1333
- <ng-container *ngIf="show$ | async">
1334
- <ng-content></ng-content>
1335
- </ng-container>
1336
- `, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i2.AsyncPipe } });
1337
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessComponent, decorators: [{
1338
- type: Component,
1235
+ DbxActionHasSuccessDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHasSuccessDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1236
+ DbxActionHasSuccessDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionHasSuccessDirective, selector: "[dbxActionHasSuccess]", inputs: { hideAfter: ["dbxActionHasSuccess", "hideAfter"] }, usesInheritance: true, ngImport: i0 });
1237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionHasSuccessDirective, decorators: [{
1238
+ type: Directive,
1339
1239
  args: [{
1340
- selector: 'dbx-action-success',
1341
- template: `
1342
- <ng-container *ngIf="show$ | async">
1343
- <ng-content></ng-content>
1344
- </ng-container>
1345
- `
1240
+ selector: '[dbxActionHasSuccess]'
1346
1241
  }]
1347
- }], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { hideAfter: [{
1348
- type: Input
1242
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { hideAfter: [{
1243
+ type: Input,
1244
+ args: ['dbxActionHasSuccess']
1349
1245
  }] } });
1350
1246
 
1351
1247
  /**
1352
1248
  * Directive that executes a function on ActionContextStore Success.
1353
1249
  */
1354
- class DbxActionSuccessDirective extends AbstractSubscriptionDirective {
1250
+ class DbxActionSuccessHandlerDirective extends AbstractSubscriptionDirective {
1355
1251
  constructor(source) {
1356
1252
  super();
1357
1253
  this.source = source;
@@ -1365,7 +1261,7 @@ class DbxActionSuccessDirective extends AbstractSubscriptionDirective {
1365
1261
  this._successFunction.next(successFunction);
1366
1262
  }
1367
1263
  ngOnInit() {
1368
- this.sub = this.successFunction$.pipe(switchMap(successFunction => this.source.success$.pipe(map(x => ([successFunction, x])), tap(([successFn, result]) => {
1264
+ this.sub = this.successFunction$.pipe(switchMap(successFunction => this.source.success$.pipe(map(x => [successFunction, x]), tap(([successFn, result]) => {
1369
1265
  successFn(result);
1370
1266
  })))).subscribe();
1371
1267
  }
@@ -1374,12 +1270,12 @@ class DbxActionSuccessDirective extends AbstractSubscriptionDirective {
1374
1270
  this._successFunction.complete();
1375
1271
  }
1376
1272
  }
1377
- DbxActionSuccessDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1378
- DbxActionSuccessDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionSuccessDirective, selector: "[dbxActionSuccess]", inputs: { successFunction: ["dbxActionSuccess", "successFunction"] }, usesInheritance: true, ngImport: i0 });
1379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionSuccessDirective, decorators: [{
1273
+ DbxActionSuccessHandlerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSuccessHandlerDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1274
+ DbxActionSuccessHandlerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionSuccessHandlerDirective, selector: "[dbxActionSuccessHandler]", inputs: { successFunction: ["dbxActionSuccessHandler", "successFunction"] }, usesInheritance: true, ngImport: i0 });
1275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionSuccessHandlerDirective, decorators: [{
1380
1276
  type: Directive,
1381
1277
  args: [{
1382
- selector: '[dbxActionSuccess]',
1278
+ selector: '[dbxActionSuccessHandler]',
1383
1279
  }]
1384
1280
  }], ctorParameters: function () {
1385
1281
  return [{ type: DbxActionContextStoreSourceInstance, decorators: [{
@@ -1387,13 +1283,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1387
1283
  }] }];
1388
1284
  }, propDecorators: { successFunction: [{
1389
1285
  type: Input,
1390
- args: ['dbxActionSuccess']
1286
+ args: ['dbxActionSuccessHandler']
1391
1287
  }] } });
1392
1288
 
1393
1289
  /**
1394
1290
  * Directive that provides a default value when triggered.
1395
1291
  *
1396
- * No value is required, allowing the directive to automatically call readyValue with undefined.
1292
+ * No value is required, allowing the directive to automatically call readyValue.
1397
1293
  */
1398
1294
  class DbxActionValueDirective extends AbstractSubscriptionDirective {
1399
1295
  constructor(source) {
@@ -1406,11 +1302,11 @@ class DbxActionValueDirective extends AbstractSubscriptionDirective {
1406
1302
  return this._valueOrFunction.value;
1407
1303
  }
1408
1304
  set valueOrFunction(valueOrFunction) {
1409
- this._valueOrFunction.next(valueOrFunction || undefined);
1305
+ this._valueOrFunction.next(valueOrFunction);
1410
1306
  }
1411
1307
  ngOnInit() {
1412
1308
  this.sub = this.valueOrFunction$.pipe(switchMap(valueOrFunction => this.source.triggered$.pipe(tap(() => {
1413
- const value = getValueFromObjectOrGetter(valueOrFunction);
1309
+ const value = getValueFromGetter(valueOrFunction);
1414
1310
  this.source.readyValue(value);
1415
1311
  })))).subscribe();
1416
1312
  }
@@ -1421,9 +1317,9 @@ class DbxActionValueDirective extends AbstractSubscriptionDirective {
1421
1317
  });
1422
1318
  }
1423
1319
  }
1424
- DbxActionValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionValueDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1425
- DbxActionValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionValueDirective, selector: "[dbxActionValue]", inputs: { valueOrFunction: ["dbxActionValue", "valueOrFunction"] }, usesInheritance: true, ngImport: i0 });
1426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionValueDirective, decorators: [{
1320
+ DbxActionValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1321
+ DbxActionValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionValueDirective, selector: "[dbxActionValue]", inputs: { valueOrFunction: ["dbxActionValue", "valueOrFunction"] }, usesInheritance: true, ngImport: i0 });
1322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueDirective, decorators: [{
1427
1323
  type: Directive,
1428
1324
  args: [{
1429
1325
  selector: '[dbxActionValue]',
@@ -1438,31 +1334,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1438
1334
  }] } });
1439
1335
 
1440
1336
  /**
1441
- * Displays the input content when working is set.
1337
+ * Structural directive that displays the content when the store is working.
1338
+ *
1339
+ * Can specify a period in milliseconds that shows how long to show up after working for a particular number of seconds.
1442
1340
  */
1443
- class DbxActionWorkingComponent {
1444
- constructor(source) {
1341
+ class DbxActionIsWorkingDirective extends AbstractIfDirective {
1342
+ constructor(templateRef, viewContainer, source) {
1343
+ super(templateRef, viewContainer);
1445
1344
  this.source = source;
1446
- this.show$ = this.source.isWorking$;
1345
+ this.show$ = this.source.isWorking$.pipe(exhaustMap$1((isWorking) => {
1346
+ if (isWorking && this.showAfter) {
1347
+ return emitDelayObs(false, true, this.showAfter || undefined);
1348
+ }
1349
+ else {
1350
+ return of(isWorking);
1351
+ }
1352
+ }), shareReplay$1(1));
1447
1353
  }
1448
1354
  }
1449
- DbxActionWorkingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionWorkingComponent, deps: [{ token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Component });
1450
- DbxActionWorkingComponentcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionWorkingComponent, selector: "dbx-action-working", ngImport: i0, template: `
1451
- <ng-container *ngIf="show$ | async">
1452
- <ng-content></ng-content>
1453
- </ng-container>
1454
- `, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i2.AsyncPipe } });
1455
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionWorkingComponent, decorators: [{
1456
- type: Component,
1355
+ DbxActionIsWorkingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionIsWorkingDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1356
+ DbxActionIsWorkingDirectivedir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionIsWorkingDirective, selector: "[dbxActionIsWorking]", inputs: { showAfter: ["dbxActionIsWorking", "showAfter"] }, usesInheritance: true, ngImport: i0 });
1357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionIsWorkingDirective, decorators: [{
1358
+ type: Directive,
1457
1359
  args: [{
1458
- selector: 'dbx-action-working',
1459
- template: `
1460
- <ng-container *ngIf="show$ | async">
1461
- <ng-content></ng-content>
1462
- </ng-container>
1463
- `
1360
+ selector: '[dbxActionIsWorking]'
1464
1361
  }]
1465
- }], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance }]; } });
1362
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { showAfter: [{
1363
+ type: Input,
1364
+ args: ['dbxActionIsWorking']
1365
+ }] } });
1466
1366
 
1467
1367
  const APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY = 'dbx_action_enforce_modified';
1468
1368
  /**
@@ -1475,7 +1375,7 @@ class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective {
1475
1375
  this._enabled = new BehaviorSubject(true);
1476
1376
  }
1477
1377
  ngOnInit() {
1478
- this.sub = combineLatest([this.source.isModified$, this._enabled]).pipe(delay$1(0)).subscribe(([modified, enableDirective]) => {
1378
+ this.sub = combineLatest([this.source.isModified$, this._enabled]).pipe(delay(0)).subscribe(([modified, enableDirective]) => {
1479
1379
  const disable = enableDirective && !modified;
1480
1380
  this.source.disable(APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, disable);
1481
1381
  });
@@ -1489,12 +1389,13 @@ class DbxActionEnforceModifiedDirective extends AbstractSubscriptionDirective {
1489
1389
  return this._enabled.value;
1490
1390
  }
1491
1391
  set enabled(enabled) {
1492
- this._enabled.next(enabled !== null && enabled !== void 0 ? enabled : true);
1392
+ var _a;
1393
+ this._enabled.next((_a = Boolean(enabled)) !== null && _a !== void 0 ? _a : true);
1493
1394
  }
1494
1395
  }
1495
- DbxActionEnforceModifiedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionEnforceModifiedDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1496
- DbxActionEnforceModifiedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionEnforceModifiedDirective, selector: "[dbxActionEnforceModified]", inputs: { enabled: ["[dbxActionEnforceModified]", "enabled"] }, usesInheritance: true, ngImport: i0 });
1497
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionEnforceModifiedDirective, decorators: [{
1396
+ DbxActionEnforceModifiedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionEnforceModifiedDirective, deps: [{ token: DbxActionContextStoreSourceInstance, host: true }], target: i0.ɵɵFactoryTarget.Directive });
1397
+ DbxActionEnforceModifiedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionEnforceModifiedDirective, selector: "[dbxActionEnforceModified]", inputs: { enabled: ["dbxActionEnforceModified", "enabled"] }, usesInheritance: true, ngImport: i0 });
1398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionEnforceModifiedDirective, decorators: [{
1498
1399
  type: Directive,
1499
1400
  args: [{
1500
1401
  selector: '[dbxActionEnforceModified]'
@@ -1505,7 +1406,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1505
1406
  }] }];
1506
1407
  }, propDecorators: { enabled: [{
1507
1408
  type: Input,
1508
- args: ['[dbxActionEnforceModified]']
1409
+ args: ['dbxActionEnforceModified']
1509
1410
  }] } });
1510
1411
 
1511
1412
  /**
@@ -1544,6 +1445,7 @@ class DbxActionValueOnTriggerInstance {
1544
1445
  destroy() {
1545
1446
  this.source.lockSet.onNextUnlock(() => {
1546
1447
  this._triggeredSub.destroy();
1448
+ this._valueGetter.complete();
1547
1449
  });
1548
1450
  }
1549
1451
  }
@@ -1580,9 +1482,9 @@ class AbstractDbxActionValueOnTriggerDirective {
1580
1482
  this._triggeredSub.destroy();
1581
1483
  }
1582
1484
  }
1583
- AbstractDbxActionValueOnTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxActionValueOnTriggerDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
1584
- AbstractDbxActionValueOnTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxActionValueOnTriggerDirective, ngImport: i0 });
1585
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxActionValueOnTriggerDirective, decorators: [{
1485
+ AbstractDbxActionValueOnTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxActionValueOnTriggerDirective, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
1486
+ AbstractDbxActionValueOnTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxActionValueOnTriggerDirective, ngImport: i0 });
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxActionValueOnTriggerDirective, decorators: [{
1586
1488
  type: Directive
1587
1489
  }], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance }, { type: undefined }]; } });
1588
1490
  /**
@@ -1600,9 +1502,9 @@ class DbxActionValueTriggerDirective extends AbstractDbxActionValueOnTriggerDire
1600
1502
  this.isModifiedFunction = isModifiedFunction;
1601
1503
  }
1602
1504
  }
1603
- DbxActionValueTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionValueTriggerDirective, deps: [{ token: i0.ElementRef }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1604
- DbxActionValueTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionValueTriggerDirective, selector: "[dbxActionValueOnTrigger]", inputs: { dbxActionValueOnTrigger: "dbxActionValueOnTrigger", dbxActionValueTriggerModified: "dbxActionValueTriggerModified" }, exportAs: ["dbxActionValueOnTrigger"], usesInheritance: true, ngImport: i0 });
1605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionValueTriggerDirective, decorators: [{
1505
+ DbxActionValueTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueTriggerDirective, deps: [{ token: i0.ElementRef }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1506
+ DbxActionValueTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionValueTriggerDirective, selector: "[dbxActionValueOnTrigger]", inputs: { dbxActionValueOnTrigger: "dbxActionValueOnTrigger", dbxActionValueTriggerModified: "dbxActionValueTriggerModified" }, exportAs: ["dbxActionValueOnTrigger"], usesInheritance: true, ngImport: i0 });
1507
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionValueTriggerDirective, decorators: [{
1606
1508
  type: Directive,
1607
1509
  args: [{
1608
1510
  exportAs: 'dbxActionValueOnTrigger',
@@ -1629,14 +1531,15 @@ class DbxActionContextMachine extends DbxActionContextBaseSource {
1629
1531
  this._successSub = new SubscriptionObject();
1630
1532
  // Handle Value Ready
1631
1533
  this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {
1632
- handleWorkValueReadyFn({
1633
- handlerFunction: config.handleValueReady,
1634
- delegate: new WorkHandlerContextSourceDelegate(this.sourceInstance)
1635
- })(value);
1534
+ const doWork = workFactory({
1535
+ work: config.handleValueReady,
1536
+ delegate: new DbxActionWorkInstanceDelegate(this.sourceInstance)
1537
+ });
1538
+ doWork(value);
1636
1539
  });
1637
1540
  // If this is a one-time use, then destroy it after the first success comes through.
1638
1541
  if (this.config.oneTimeUse) {
1639
- this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {
1542
+ this.sourceInstance.success$.pipe(first(), delay$1(1000)).subscribe(() => {
1640
1543
  this.destroy();
1641
1544
  });
1642
1545
  }
@@ -1657,18 +1560,18 @@ class DbxActionContextMachine extends DbxActionContextBaseSource {
1657
1560
 
1658
1561
  class DbxCoreActionModule {
1659
1562
  }
1660
- DbxCoreActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1661
- DbxCoreActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, declarations: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1563
+ DbxCoreActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1564
+ DbxCoreActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, declarations: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1662
1565
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1663
1566
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1664
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent], imports: [CommonModule], exports: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1567
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective], imports: [CommonModule], exports: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1665
1568
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1666
1569
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1667
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent] });
1668
- DbxCoreActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, imports: [[
1570
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective] });
1571
+ DbxCoreActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, imports: [[
1669
1572
  CommonModule
1670
1573
  ]] });
1671
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, decorators: [{
1574
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreActionModule, decorators: [{
1672
1575
  type: NgModule,
1673
1576
  args: [{
1674
1577
  imports: [
@@ -1678,13 +1581,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1678
1581
  DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1679
1582
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1680
1583
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1681
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent,
1584
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective,
1682
1585
  ],
1683
1586
  exports: [
1684
1587
  DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1685
1588
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1686
1589
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1687
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent
1590
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective
1688
1591
  ]
1689
1592
  }]
1690
1593
  }] });
@@ -1697,162 +1600,446 @@ function makeDbxActionContextSourceReference(sourceInstance) {
1697
1600
  }
1698
1601
 
1699
1602
  /**
1700
- * Convenience function used within observables for views that need to detect changes after a value changes.
1701
- *
1702
- * @param cdRef
1703
- * @param timeout
1704
- * @returns
1603
+ * Client auth service used to retrieve info about the current state of client authentication and client roles they may have.
1705
1604
  */
1706
- function tapDetectChanges(cdRef, timeout = 0) {
1707
- return tap$1(() => setTimeout(() => safeDetectChanges(cdRef), timeout));
1605
+ class DbxAuthService {
1708
1606
  }
1607
+
1709
1608
  /**
1710
- * Triggers a detection change on the input view as long as the view has not been destroyed.
1711
- *
1712
- * @param cdRef
1609
+ * This generates a TransitionHookFn that can be used with redirecting routes.
1713
1610
  */
1714
- function safeDetectChanges(cdRef) {
1715
- if (!cdRef.destroyed) {
1716
- cdRef.detectChanges();
1717
- }
1611
+ function makeAuthTransitionHook(config) {
1612
+ const { defaultRedirectTarget, errorRedirectTarget = defaultRedirectTarget } = config;
1613
+ // https://ui-router.github.io/ng2/docs/latest/modules/transition.html#hookresult
1614
+ const assertIsAuthenticated = (transition) => {
1615
+ const injector = transition.injector();
1616
+ const authService = injector.get(DbxAuthService);
1617
+ const $state = transition.router.stateService;
1618
+ const decisionObs = config.makeDecisionsObs(transition, authService, injector);
1619
+ function redirectOut() {
1620
+ const stateData = transition.targetState().state().data;
1621
+ const redirectTo = stateData === null || stateData === void 0 ? void 0 : stateData.redirectTo;
1622
+ let redirectToObs;
1623
+ if (redirectTo) {
1624
+ let resultObs;
1625
+ if (isGetter(redirectTo)) {
1626
+ resultObs = getValueFromGetter(redirectTo, { authService, injector, transition });
1627
+ }
1628
+ else {
1629
+ resultObs = of(redirectTo);
1630
+ }
1631
+ redirectToObs = resultObs.pipe(map$1((stateRef) => {
1632
+ let redirectTarget;
1633
+ let redirectParams;
1634
+ if (stateRef) {
1635
+ redirectTarget = stateRef.ref;
1636
+ redirectParams = stateRef.refParams;
1637
+ }
1638
+ if (!redirectTarget) {
1639
+ redirectTarget = defaultRedirectTarget;
1640
+ }
1641
+ return $state.target(redirectTarget, redirectParams);
1642
+ }));
1643
+ }
1644
+ else {
1645
+ redirectToObs = of($state.target(defaultRedirectTarget));
1646
+ }
1647
+ return redirectToObs;
1648
+ }
1649
+ const resultObs = decisionObs.pipe(first$1(), switchMap$1((decision) => {
1650
+ if (typeof decision === 'boolean') {
1651
+ if (decision) {
1652
+ return of(true);
1653
+ }
1654
+ else {
1655
+ return redirectOut();
1656
+ }
1657
+ }
1658
+ else {
1659
+ return of($state.target(decision.ref, decision.refParams, decision.refOptions));
1660
+ }
1661
+ }), catchError((x) => {
1662
+ console.warn('Encountered error in auth transition hook.', x);
1663
+ return of($state.target(errorRedirectTarget, { location: true })); // Redirect to home
1664
+ }));
1665
+ return firstValueFrom(resultObs);
1666
+ };
1667
+ return assertIsAuthenticated;
1718
1668
  }
1669
+
1719
1670
  /**
1720
- * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,
1721
- * or more specifically if the parent component passed any target content to the child. This will still return true if
1722
- * passed content is empty.
1723
- *
1724
- * TS:
1725
- * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;
1671
+ * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.
1726
1672
  *
1727
- * HTML:
1728
- * <div #customContent>
1729
- * <ng-content select="[content]"></ng-content>
1730
- * </div>
1673
+ * @param stateMap
1674
+ * @returns
1731
1675
  */
1732
- function checkNgContentWrapperHasContent(ref) {
1733
- // https://github.com/angular/angular/issues/26083
1734
- let hasContent = false;
1735
- if (ref != null) {
1736
- const childNodes = ref.nativeElement.childNodes;
1737
- const hasChildNodes = childNodes && childNodes.length > 0;
1738
- hasContent = Boolean(hasChildNodes);
1739
- }
1740
- return hasContent;
1676
+ function redirectBasedOnAuthUserState(stateMap) {
1677
+ return (input) => {
1678
+ return input.authService.authUserState$.pipe(first$1(), switchMap$1((authUserState) => {
1679
+ const getter = stateMap[authUserState];
1680
+ let result;
1681
+ if (getter) {
1682
+ if (isGetter(getter)) {
1683
+ result = getValueFromGetter(getter, input);
1684
+ }
1685
+ else {
1686
+ result = of(getter);
1687
+ }
1688
+ }
1689
+ if (!result) {
1690
+ result = of(undefined);
1691
+ }
1692
+ return result;
1693
+ }));
1694
+ };
1741
1695
  }
1742
1696
 
1743
- class DbxButton {
1744
- }
1745
- function ProvideDbxButton(sourceType) {
1746
- return [{
1747
- provide: DbxButton,
1748
- useExisting: forwardRef(() => sourceType)
1749
- }];
1697
+ /**
1698
+ * This hook redirects to the configured default state when a user is not logged in for configured states.
1699
+ */
1700
+ function enableIsLoggedInHook(transitionService, config) {
1701
+ // Matches if the destination state's data property has a truthy 'isSecure' property
1702
+ const isSecureCriteria = {
1703
+ entering: (state) => {
1704
+ const data = state === null || state === void 0 ? void 0 : state.data;
1705
+ const match = Boolean(data === null || data === void 0 ? void 0 : data.requiredLogIn);
1706
+ return match;
1707
+ }
1708
+ };
1709
+ const assertIsLoggedIn = makeAuthTransitionHook(Object.assign(Object.assign({}, config.options), { makeDecisionsObs(transition, authService) {
1710
+ return authService.isLoggedIn$;
1711
+ } }));
1712
+ // Register the "requires auth" hook with the TransitionsService
1713
+ transitionService.onBefore(isSecureCriteria, assertIsLoggedIn, { priority: 100 });
1750
1714
  }
1751
1715
 
1752
1716
  /**
1753
- * Context used for linking a button to an ActionContext and only look for triggers.
1717
+ * This hook redirects to the configured default state when a user:
1718
+ *
1719
+ * - does not have an allowed state
1720
+ * - has a disallowed state
1754
1721
  */
1755
- class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective {
1756
- constructor(button, source) {
1757
- super();
1758
- this.button = button;
1759
- this.source = source;
1760
- }
1761
- ngOnInit() {
1762
- this.sub = this.button.clicked$.subscribe(() => {
1763
- this._buttonClicked();
1764
- });
1765
- }
1766
- _buttonClicked() {
1767
- this.source.trigger();
1768
- }
1722
+ function enableHasAuthRoleHook(transitionService, config) {
1723
+ // Matches if the destination state's data property has a truthy 'isSecure' property
1724
+ const isSecureCriteria = {
1725
+ entering: (state) => {
1726
+ const data = state === null || state === void 0 ? void 0 : state.data;
1727
+ const match = Boolean(data === null || data === void 0 ? void 0 : data.authRoles);
1728
+ return match;
1729
+ }
1730
+ };
1731
+ const assertHasAuthRole = makeAuthTransitionHook(Object.assign(Object.assign({}, config.options), { makeDecisionsObs(transition, authService) {
1732
+ const targetState = transition.targetState();
1733
+ const data = targetState.state().data;
1734
+ const requiredRoles = new Set(data.authRoles);
1735
+ const setIncludes = setIncludesFunction(requiredRoles, data.authRolesMode);
1736
+ return authService.authUserState$.pipe(map$1(x => setIncludes(x)));
1737
+ } }));
1738
+ // Register the "requires auth" hook with the TransitionsService
1739
+ transitionService.onBefore(isSecureCriteria, assertHasAuthRole, { priority: 100 });
1769
1740
  }
1770
- DbxActionButtonTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonTriggerDirective, deps: [{ token: DbxButton, host: true }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
1771
- DbxActionButtonTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionButtonTriggerDirective, selector: "[dbxActionButtonTrigger]", usesInheritance: true, ngImport: i0 });
1772
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonTriggerDirective, decorators: [{
1773
- type: Directive,
1774
- args: [{
1775
- selector: '[dbxActionButtonTrigger]'
1776
- }]
1777
- }], ctorParameters: function () {
1778
- return [{ type: DbxButton, decorators: [{
1779
- type: Host
1780
- }] }, { type: DbxActionContextStoreSourceInstance }];
1781
- } });
1782
1741
 
1783
1742
  /**
1784
- * Context used for linking a button to an ActionContext.
1743
+ * This hook redirects to the configured default state when a user:
1744
+ *
1745
+ * - does not have an allowed state
1746
+ * - has a disallowed state
1785
1747
  */
1786
- class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {
1787
- constructor(button, source, cdRef) {
1788
- super(button, source);
1789
- this.cdRef = cdRef;
1790
- this._workingSub = new SubscriptionObject();
1791
- this._disabledSub = new SubscriptionObject();
1792
- }
1793
- ngOnInit() {
1794
- super.ngOnInit();
1795
- this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {
1796
- this.button.working = working;
1797
- safeDetectChanges(this.cdRef);
1798
- });
1799
- this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {
1800
- this.button.disabled = disabled;
1801
- safeDetectChanges(this.cdRef);
1802
- });
1748
+ function enableHasAuthStateHook(transitionService, config) {
1749
+ // Matches if the destination state's data property has a truthy 'isSecure' property
1750
+ const isSecureCriteria = {
1751
+ entering: (state) => {
1752
+ const data = state === null || state === void 0 ? void 0 : state.data;
1753
+ const match = Boolean(data === null || data === void 0 ? void 0 : data.authStates);
1754
+ return match;
1755
+ }
1756
+ };
1757
+ const assertHasAuthState = makeAuthTransitionHook(Object.assign(Object.assign({}, config.options), { makeDecisionsObs(transition, authService) {
1758
+ const targetState = transition.targetState();
1759
+ const data = targetState.state().data;
1760
+ const config = toHasAuthStateObjectConfig(data.authStates);
1761
+ const parsed = toParsedHasAuthStateConfig(config);
1762
+ return authService.authUserState$.pipe(map$1(x => isAllowed(x, parsed)));
1763
+ } }));
1764
+ // Register the "requires auth" hook with the TransitionsService
1765
+ transitionService.onBefore(isSecureCriteria, assertHasAuthState, { priority: 100 });
1766
+ }
1767
+ // MARK: Utility
1768
+ function toHasAuthStateObjectConfig(input) {
1769
+ const isString = typeof input === 'string';
1770
+ if ((Array.isArray(input) || isString)) {
1771
+ if (isString) {
1772
+ input = [input];
1773
+ }
1774
+ return {
1775
+ allowedStates: input
1776
+ };
1803
1777
  }
1804
- ngOnDestroy() {
1805
- super.ngOnDestroy();
1806
- this._workingSub.destroy();
1807
- this._disabledSub.destroy();
1778
+ else {
1779
+ return input;
1808
1780
  }
1809
1781
  }
1810
- DbxActionButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonDirective, deps: [{ token: DbxButton, host: true }, { token: DbxActionContextStoreSourceInstance }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1811
- DbxActionButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionButtonDirective, selector: "[dbxActionButton]", usesInheritance: true, ngImport: i0 });
1812
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonDirective, decorators: [{
1813
- type: Directive,
1814
- args: [{
1815
- selector: '[dbxActionButton]'
1816
- }]
1817
- }], ctorParameters: function () {
1818
- return [{ type: DbxButton, decorators: [{
1819
- type: Host
1820
- }] }, { type: DbxActionContextStoreSourceInstance }, { type: i0.ChangeDetectorRef }];
1821
- } });
1782
+ function toParsedHasAuthStateConfig(input) {
1783
+ return {
1784
+ allowed: maybeSet(input.allowedStates),
1785
+ disallowed: maybeSet(input.disallowedStates)
1786
+ };
1787
+ }
1822
1788
 
1823
- const expandClickableAnchorLinkTreeNode = expandTreeFunction({
1824
- getChildren: (x) => x.children
1825
- });
1826
- const flattenExpandedClickableAnchorLinkTree = flattenTreeToArrayFunction();
1827
- const flattenExpandedClickableAnchorLinkTreeToLinks = flattenTreeToArrayFunction((x) => x.value);
1789
+ const DBX_INIT_APP_CONTEXT_STATE = 'init';
1828
1790
  /**
1829
- * Fully expands the given parent link and flattens the tree to a single parent link.
1830
1791
  *
1831
- * @param link
1832
- * @returns
1833
1792
  */
1834
- function expandClickableAnchorLinkTree(link) {
1835
- return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));
1836
- }
1793
+ const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';
1837
1794
  /**
1838
- * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.
1795
+ *
1839
1796
  */
1840
- const expandClickableAnchorLinkTrees = expandFlattenTreeFunction(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);
1841
- var AnchorType;
1842
- (function (AnchorType) {
1843
- /**
1844
- * When the anchor has no specific content but is not disabled.
1845
- *
1846
- * Is a passthrough for the content.
1847
- */
1848
- AnchorType[AnchorType["PLAIN"] = 0] = "PLAIN";
1849
- AnchorType[AnchorType["CLICKABLE"] = 1] = "CLICKABLE";
1850
- AnchorType[AnchorType["SREF"] = 2] = "SREF";
1851
- AnchorType[AnchorType["HREF"] = 3] = "HREF";
1852
- AnchorType[AnchorType["DISABLED"] = 4] = "DISABLED";
1853
- })(AnchorType || (AnchorType = {}));
1854
- function anchorTypeForAnchor(anchor, disabled) {
1855
- let type = AnchorType.DISABLED;
1797
+ const DBX_AUTH_APP_CONTEXT_STATE = 'auth';
1798
+ /**
1799
+ *
1800
+ */
1801
+ const DBX_ONBOARDING_APP_CONTEXT_STATE = 'onboarding';
1802
+ /**
1803
+ *
1804
+ */
1805
+ const DBX_APP_APP_CONTEXT_STATE = 'app';
1806
+ /**
1807
+ * Array of all DbxKnownAppContextState values, minus the init state.
1808
+ */
1809
+ const DBX_KNOWN_APP_CONTEXT_STATES = [DBX_PUBLIC_APP_CONTEXT_STATE, DBX_AUTH_APP_CONTEXT_STATE, DBX_ONBOARDING_APP_CONTEXT_STATE, DBX_APP_APP_CONTEXT_STATE];
1810
+
1811
+ /**
1812
+ * Action to set the current DbxAppContextState value.
1813
+ */
1814
+ const setState = createAction('[App/Context] Set State', props());
1815
+ /**
1816
+ * Resets the app back to the init context.
1817
+ */
1818
+ const resetState = createAction('[App/Context] Reset');
1819
+
1820
+ var data_action = /*#__PURE__*/Object.freeze({
1821
+ __proto__: null,
1822
+ setState: setState,
1823
+ resetState: resetState
1824
+ });
1825
+
1826
+ var index$3 = /*#__PURE__*/Object.freeze({
1827
+ __proto__: null,
1828
+ DbxAppContextActions: data_action
1829
+ });
1830
+
1831
+ /**
1832
+ * The feature key for these items/reducers.
1833
+ */
1834
+ const dbxAppContextStateFeatureKey = 'data';
1835
+ const initialState$1 = {
1836
+ state: DBX_INIT_APP_CONTEXT_STATE
1837
+ };
1838
+ const reducer$1 = createReducer(initialState$1,
1839
+ /**
1840
+ * When DbxAppContextActions.dbxAppContextSetState is pushed, update the app's state to match the argument state.
1841
+ */
1842
+ on(setState, (_, { state }) => ({ state })));
1843
+
1844
+ /**
1845
+ * Global feature key for our app.
1846
+ */
1847
+ const featureKey$1 = 'app.context';
1848
+ /**
1849
+ * Reducers mapping for the DbxAppContextFeatureState
1850
+ */
1851
+ function reducers$1(state, action) {
1852
+ return combineReducers({
1853
+ [dbxAppContextStateFeatureKey]: reducer$1
1854
+ })(state, action);
1855
+ }
1856
+ /**
1857
+ * Selects the DbxAppContextFeatureState feature context.
1858
+ *
1859
+ * Used by createSelector() to retrieve more specific data from the DbxAppContextFeatureState.
1860
+ */
1861
+ const selectAppContextFeature = createFeatureSelector(featureKey$1);
1862
+ /**
1863
+ * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.
1864
+ */
1865
+ const selectDbxAppContextState = createSelector(selectAppContextFeature, (featureState) => featureState[dbxAppContextStateFeatureKey].state);
1866
+
1867
+ var index$2 = /*#__PURE__*/Object.freeze({
1868
+ __proto__: null,
1869
+ featureKey: featureKey$1,
1870
+ reducers: reducers$1,
1871
+ selectAppContextFeature: selectAppContextFeature,
1872
+ selectDbxAppContextState: selectDbxAppContextState
1873
+ });
1874
+
1875
+ // MARK: Abstract Context Effects
1876
+ /**
1877
+ * Abstract effects class that only runs/allows effects when the DbxAppContextState in the ngrx state matches input activeState value.
1878
+ */
1879
+ class AbstractOnDbxAppContextStateEffects {
1880
+ constructor(
1881
+ /**
1882
+ * The state(s) to activate on.
1883
+ */
1884
+ activeStates,
1885
+ /**
1886
+ * ngrx Actions
1887
+ */
1888
+ actions$,
1889
+ /**
1890
+ * ngrx Store
1891
+ */
1892
+ store) {
1893
+ this.actions$ = actions$;
1894
+ this.store = store;
1895
+ this._activeStatesSet = new Set(activeStates);
1896
+ }
1897
+ /**
1898
+ * Configures all actions of the sub-class to only activate when the DbxAppContextState in App
1899
+ *
1900
+ * @param resolvedEffects$
1901
+ * @returns
1902
+ */
1903
+ ngrxOnRunEffects(resolvedEffects$) {
1904
+ return this.actions$.pipe(ofType(setState), filter$1(({ state }) => {
1905
+ return this._activeStatesSet.has(state);
1906
+ }), exhaustMap$1(() => resolvedEffects$.pipe(takeUntil(this.actions$.pipe(ofType(setState), filter$1(({ state }) => !this._activeStatesSet.has(state)))))));
1907
+ }
1908
+ }
1909
+
1910
+ const NO_AUTH_USER_IDENTIFIER = '0';
1911
+ /**
1912
+ * Creates an AuthUserIdentifier from the input. If the input is undefined, returns the NoAuthUserIdentifier.
1913
+ *
1914
+ * @param inputId
1915
+ * @returns
1916
+ */
1917
+ function authUserIdentifier(inputId) {
1918
+ return (inputId) ? inputId : NO_AUTH_USER_IDENTIFIER;
1919
+ }
1920
+
1921
+ /**
1922
+ * Action for when the user has logged in.
1923
+ */
1924
+ const loggedIn = createAction('[App/Auth] Auth Logged In');
1925
+ /**
1926
+ * Action for when the user has logged out.
1927
+ */
1928
+ const loggedOut = createAction('[App/Auth] Auth Logged Out');
1929
+ /**
1930
+ * Action to log the user out.
1931
+ */
1932
+ const logout = createAction('[App/Auth] Auth Logout');
1933
+
1934
+ var auth_action = /*#__PURE__*/Object.freeze({
1935
+ __proto__: null,
1936
+ loggedIn: loggedIn,
1937
+ loggedOut: loggedOut,
1938
+ logout: logout
1939
+ });
1940
+
1941
+ /**
1942
+ * Sets the user's identifier in the auth.
1943
+ */
1944
+ const setUserIdentifier = createAction('[App/Auth] Set User Identifier', props());
1945
+ /**
1946
+ * Sets the user's state in the auth.
1947
+ */
1948
+ const setUserState = createAction('[App/Auth] Set User State', props());
1949
+ /**
1950
+ * Sets the user's roles in the auth.
1951
+ */
1952
+ const setUserRoles = createAction('[App/Auth] Set User Roles', props());
1953
+ /**
1954
+ * Sets the user's onboarding state.
1955
+ */
1956
+ const setUserIsOnboarded = createAction('[App/Auth] Set User Is Onboarded', props());
1957
+
1958
+ var user_action = /*#__PURE__*/Object.freeze({
1959
+ __proto__: null,
1960
+ setUserIdentifier: setUserIdentifier,
1961
+ setUserState: setUserState,
1962
+ setUserRoles: setUserRoles,
1963
+ setUserIsOnboarded: setUserIsOnboarded
1964
+ });
1965
+
1966
+ var index$1 = /*#__PURE__*/Object.freeze({
1967
+ __proto__: null,
1968
+ DbxAppAuthActions: auth_action,
1969
+ DbxAppAuthUserActions: user_action
1970
+ });
1971
+
1972
+ const dbxAppAuthUserFeatureKey = 'user';
1973
+ const initialState = {
1974
+ userId: NO_AUTH_USER_IDENTIFIER,
1975
+ isOnboarded: false,
1976
+ userState: 'none',
1977
+ userRoles: []
1978
+ };
1979
+ const reducer = createReducer(initialState, on(loggedOut, () => (Object.assign({}, initialState))), on(setUserIdentifier, (state, { id: userId }) => (Object.assign(Object.assign({}, state), { userId }))), on(setUserIsOnboarded, (state, { isOnboarded }) => (Object.assign(Object.assign({}, state), { isOnboarded }))), on(setUserState, (state, { state: userState }) => (Object.assign(Object.assign({}, state), { userState }))), on(setUserRoles, (state, { roles: userRoles }) => (Object.assign(Object.assign({}, state), { userRoles: Array.from(userRoles) }))));
1980
+
1981
+ /**
1982
+ * Global feature key
1983
+ */
1984
+ const featureKey = 'app.auth';
1985
+ /**
1986
+ * Reducers mapping for the DbxAppAuthFeatureState
1987
+ */
1988
+ function reducers(state, action) {
1989
+ return combineReducers({
1990
+ [dbxAppAuthUserFeatureKey]: reducer
1991
+ })(state, action);
1992
+ }
1993
+ /**
1994
+ * Selects the DbxAppAuthFeatureState feature context.
1995
+ */
1996
+ const selectAppAuthFeature = createFeatureSelector(featureKey);
1997
+ /**
1998
+ * Selector to retrieve the state value from our DbxAppContextStateData in our DbxAppContextFeatureState.
1999
+ */
2000
+ const selectDbxAppAuthUser = createSelector(selectAppAuthFeature, (featureState) => featureState[dbxAppAuthUserFeatureKey]);
2001
+
2002
+ var index = /*#__PURE__*/Object.freeze({
2003
+ __proto__: null,
2004
+ featureKey: featureKey,
2005
+ reducers: reducers,
2006
+ selectAppAuthFeature: selectAppAuthFeature,
2007
+ selectDbxAppAuthUser: selectDbxAppAuthUser
2008
+ });
2009
+
2010
+ const expandClickableAnchorLinkTreeNode = expandTreeFunction({
2011
+ getChildren: (x) => x.children
2012
+ });
2013
+ const flattenExpandedClickableAnchorLinkTree = flattenTreeToArrayFunction();
2014
+ const flattenExpandedClickableAnchorLinkTreeToLinks = flattenTreeToArrayFunction((x) => x.value);
2015
+ /**
2016
+ * Fully expands the given parent link and flattens the tree to a single parent link.
2017
+ *
2018
+ * @param link
2019
+ * @returns
2020
+ */
2021
+ function expandClickableAnchorLinkTree(link) {
2022
+ return flattenExpandedClickableAnchorLinkTree(expandClickableAnchorLinkTreeNode(link));
2023
+ }
2024
+ /**
2025
+ * Expands an array of links into an array of ExpandedClickableAnchorLinkTree tree values.
2026
+ */
2027
+ const expandClickableAnchorLinkTrees = expandFlattenTreeFunction(expandClickableAnchorLinkTreeNode, flattenExpandedClickableAnchorLinkTree);
2028
+ var AnchorType;
2029
+ (function (AnchorType) {
2030
+ /**
2031
+ * When the anchor has no specific content but is not disabled.
2032
+ *
2033
+ * Is a passthrough for the content.
2034
+ */
2035
+ AnchorType[AnchorType["PLAIN"] = 0] = "PLAIN";
2036
+ AnchorType[AnchorType["CLICKABLE"] = 1] = "CLICKABLE";
2037
+ AnchorType[AnchorType["SREF"] = 2] = "SREF";
2038
+ AnchorType[AnchorType["HREF"] = 3] = "HREF";
2039
+ AnchorType[AnchorType["DISABLED"] = 4] = "DISABLED";
2040
+ })(AnchorType || (AnchorType = {}));
2041
+ function anchorTypeForAnchor(anchor, disabled) {
2042
+ let type = AnchorType.DISABLED;
1856
2043
  if (!disabled && anchor) {
1857
2044
  if (anchor.disabled) {
1858
2045
  type = AnchorType.DISABLED;
@@ -1881,6 +2068,28 @@ function ProvideDbxAnchor(sourceType) {
1881
2068
  }];
1882
2069
  }
1883
2070
 
2071
+ function isSegueRef(input) {
2072
+ return (typeof input === 'object') && input.ref != null;
2073
+ }
2074
+ function asSegueRef(input) {
2075
+ const type = typeof input;
2076
+ if (type === 'string') {
2077
+ return refStringToSegueRef(input);
2078
+ }
2079
+ else if (isSegueRef(input)) {
2080
+ return input;
2081
+ }
2082
+ else {
2083
+ return { ref: undefined };
2084
+ }
2085
+ }
2086
+ function refStringToSegueRef(ref, options) {
2087
+ return Object.assign(Object.assign({}, options), { ref });
2088
+ }
2089
+ function mapRefStringObsToSegueRefObs(obs, options) {
2090
+ return obs.pipe(map$1(x => refStringToSegueRef(x, options)));
2091
+ }
2092
+
1884
2093
  /**
1885
2094
  * Abstract anchor directive.
1886
2095
  */
@@ -1890,7 +2099,17 @@ class AbstractDbxAnchorDirective {
1890
2099
  this._anchor = new BehaviorSubject(undefined);
1891
2100
  this.disabled$ = this._disabled.asObservable();
1892
2101
  this.anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));
1893
- this.type$ = combineLatest([this.disabled$, this.anchor$]).pipe(delay$1(0), map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)), distinctUntilChanged(), shareReplay(1));
2102
+ this.type$ = combineLatest([this.disabled$, this.anchor$]).pipe(delay(0), map(([disabled, anchor]) => anchorTypeForAnchor(anchor, disabled)), distinctUntilChanged(), shareReplay(1));
2103
+ }
2104
+ ngOnDestroy() {
2105
+ this._disabled.complete();
2106
+ this._anchor.complete();
2107
+ }
2108
+ /**
2109
+ * Convenience input to create an Anchor from the input SegueRef.
2110
+ */
2111
+ set ref(ref) {
2112
+ this.anchor = asSegueRef(ref);
1894
2113
  }
1895
2114
  get anchor() {
1896
2115
  return this._anchor.value;
@@ -1905,11 +2124,13 @@ class AbstractDbxAnchorDirective {
1905
2124
  this._disabled.next(disabled);
1906
2125
  }
1907
2126
  }
1908
- AbstractDbxAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxAnchorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1909
- AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxAnchorDirective, inputs: { anchor: "anchor", disabled: "disabled" }, ngImport: i0 });
1910
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxAnchorDirective, decorators: [{
2127
+ AbstractDbxAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxAnchorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2128
+ AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxAnchorDirective, inputs: { ref: "ref", anchor: "anchor", disabled: "disabled" }, ngImport: i0 });
2129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxAnchorDirective, decorators: [{
1911
2130
  type: Directive
1912
- }], propDecorators: { anchor: [{
2131
+ }], ctorParameters: function () { return []; }, propDecorators: { ref: [{
2132
+ type: Input
2133
+ }], anchor: [{
1913
2134
  type: Input
1914
2135
  }], disabled: [{
1915
2136
  type: Input
@@ -1934,6 +2155,7 @@ class DbxAngularRouterService {
1934
2155
  constructor(router, activatedRoute) {
1935
2156
  this.router = router;
1936
2157
  this.activatedRoute = activatedRoute;
2158
+ this.params$ = this.activatedRoute.params;
1937
2159
  this.transitions$ = this.router.events.pipe(map((x) => {
1938
2160
  let event;
1939
2161
  if (x instanceof NavigationStart) {
@@ -1949,7 +2171,8 @@ class DbxAngularRouterService {
1949
2171
  return event;
1950
2172
  }), filterMaybe());
1951
2173
  }
1952
- go(segueRef) {
2174
+ go(input) {
2175
+ const segueRef = asSegueRef(input);
1953
2176
  let ref = segueRef.ref;
1954
2177
  if (isArray(ref)) {
1955
2178
  return this.router.navigate(ref, Object.assign(Object.assign({}, segueRef.refOptions), { queryParams: segueRef.refParams }));
@@ -1965,9 +2188,9 @@ class DbxAngularRouterService {
1965
2188
  return 0; // TODO!
1966
2189
  }
1967
2190
  }
1968
- DbxAngularRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxAngularRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
1969
- DbxAngularRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxAngularRouterService });
1970
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxAngularRouterService, decorators: [{
2191
+ DbxAngularRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAngularRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
2192
+ DbxAngularRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAngularRouterService });
2193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAngularRouterService, decorators: [{
1971
2194
  type: Injectable
1972
2195
  }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
1973
2196
 
@@ -1977,6 +2200,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1977
2200
  class DbxRouterService {
1978
2201
  }
1979
2202
 
2203
+ /**
2204
+ * Creates a GoWithRouter function.
2205
+ *
2206
+ * @param dbxRouterService
2207
+ * @returns
2208
+ */
2209
+ function goWithRouter(dbxRouterService) {
2210
+ return (route) => {
2211
+ return firstValueFrom(asObservable(route)).then(x => dbxRouterService.go(x));
2212
+ };
2213
+ }
2214
+
1980
2215
  /**
1981
2216
  * Router service definition that provides high level information about router transitions.
1982
2217
  */
@@ -2001,10 +2236,10 @@ class DbxCoreAngularRouterSegueModule {
2001
2236
  };
2002
2237
  }
2003
2238
  }
2004
- DbxCoreAngularRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2005
- DbxCoreAngularRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
2006
- DbxCoreAngularRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
2007
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule, decorators: [{
2239
+ DbxCoreAngularRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2240
+ DbxCoreAngularRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
2241
+ DbxCoreAngularRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
2242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAngularRouterSegueModule, decorators: [{
2008
2243
  type: NgModule,
2009
2244
  args: [{}]
2010
2245
  }] });
@@ -2054,12 +2289,15 @@ class DbxUIRouterService {
2054
2289
  this.state = state;
2055
2290
  this.transitionService = transitionService;
2056
2291
  this.uiRouterGlobals = uiRouterGlobals;
2292
+ this._params = new BehaviorSubject(this.uiRouterGlobals.params);
2293
+ this.params$ = this._params.asObservable();
2057
2294
  this._transitions = new Subject();
2058
2295
  this.transitions$ = this._transitions.asObservable();
2059
2296
  const emitTransition = (type) => {
2060
2297
  this._transitions.next({
2061
2298
  type
2062
2299
  });
2300
+ this._params.next(this.uiRouterGlobals.params);
2063
2301
  };
2064
2302
  this.transitionService.onStart({}, () => {
2065
2303
  emitTransition(DbxRouterTransitionEventType.START);
@@ -2068,27 +2306,46 @@ class DbxUIRouterService {
2068
2306
  emitTransition(DbxRouterTransitionEventType.SUCCESS);
2069
2307
  });
2070
2308
  }
2071
- go(segueRef) {
2309
+ ngOnDestroy() {
2310
+ this._transitions.complete();
2311
+ }
2312
+ get params() {
2313
+ return this.uiRouterGlobals.params;
2314
+ }
2315
+ go(input) {
2316
+ const segueRef = asSegueRef(input);
2072
2317
  const params = Object.assign(Object.assign({}, this.uiRouterGlobals.current.params), segueRef.refParams);
2073
2318
  return this.state.go(segueRef.ref, params, segueRef.refOptions).then(_ => true).catch(_ => false);
2074
2319
  }
2075
- isActive(segueRef) {
2320
+ isActive(input) {
2321
+ const segueRef = asSegueRef(input);
2076
2322
  const { ref, refParams } = segueRef;
2077
2323
  const targetRef = (ref.startsWith('.') ? `^${ref}` : ref);
2078
2324
  const active = this.state.includes(targetRef, refParams);
2079
2325
  return active;
2080
2326
  }
2081
- comparePrecision(a, b) {
2082
- const aLength = a.ref.length;
2083
- const bLength = b.ref.length;
2327
+ comparePrecision(aInput, bInput) {
2328
+ const aRef = readSegueRefString(aInput);
2329
+ const bRef = readSegueRefString(bInput);
2330
+ const aLength = aRef.length;
2331
+ const bLength = bRef.length;
2084
2332
  return (aLength > bLength) ? 1 : (aLength === bLength) ? 0 : -1;
2085
2333
  }
2086
2334
  }
2087
- DbxUIRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxUIRouterService, deps: [{ token: i1$2.StateService }, { token: i1$2.TransitionService }, { token: i1$2.UIRouterGlobals }], target: i0.ɵɵFactoryTarget.Injectable });
2088
- DbxUIRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxUIRouterService });
2089
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxUIRouterService, decorators: [{
2335
+ DbxUIRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxUIRouterService, deps: [{ token: i1$2.StateService }, { token: i1$2.TransitionService }, { token: i1$2.UIRouterGlobals }], target: i0.ɵɵFactoryTarget.Injectable });
2336
+ DbxUIRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxUIRouterService });
2337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxUIRouterService, decorators: [{
2090
2338
  type: Injectable
2091
2339
  }], ctorParameters: function () { return [{ type: i1$2.StateService }, { type: i1$2.TransitionService }, { type: i1$2.UIRouterGlobals }]; } });
2340
+ function readSegueRefString(input) {
2341
+ var _a;
2342
+ if (typeof input === 'string') {
2343
+ return input;
2344
+ }
2345
+ else {
2346
+ return (_a = input === null || input === void 0 ? void 0 : input.ref) !== null && _a !== void 0 ? _a : '';
2347
+ }
2348
+ }
2092
2349
 
2093
2350
  class DbxCoreUIRouterSegueModule {
2094
2351
  static forRoot() {
@@ -2108,10 +2365,10 @@ class DbxCoreUIRouterSegueModule {
2108
2365
  };
2109
2366
  }
2110
2367
  }
2111
- DbxCoreUIRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2112
- DbxCoreUIRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2113
- DbxCoreUIRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule, decorators: [{
2368
+ DbxCoreUIRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2369
+ DbxCoreUIRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2370
+ DbxCoreUIRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreUIRouterSegueModule, decorators: [{
2115
2372
  type: NgModule,
2116
2373
  args: [{}]
2117
2374
  }] });
@@ -2125,63 +2382,523 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2125
2382
  function successTransition(obs) {
2126
2383
  return obs.pipe(filterTransitionSuccess());
2127
2384
  }
2128
- function filterTransitionSuccess() {
2129
- return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);
2385
+ function filterTransitionSuccess() {
2386
+ return filterTransitionEvent(DbxRouterTransitionEventType.SUCCESS);
2387
+ }
2388
+ function filterTransitionEvent(type) {
2389
+ return filter$1(x => x.type === type);
2390
+ }
2391
+
2392
+ /**
2393
+ * Abstract directive that listens to onSuccess transition events and runs a function.
2394
+ */
2395
+ class AbstractTransitionDirective {
2396
+ constructor(dbxRouterTransitionService) {
2397
+ this.dbxRouterTransitionService = dbxRouterTransitionService;
2398
+ this.transitionSuccess$ = successTransition(this.dbxRouterTransitionService.transitions$);
2399
+ this.initAndUpdateOnTransitionSuccess$ = this.transitionSuccess$.pipe(startWith$1(undefined));
2400
+ }
2401
+ }
2402
+ AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
2403
+ AbstractTransitionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractTransitionDirective, ngImport: i0 });
2404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionDirective, decorators: [{
2405
+ type: Directive
2406
+ }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }]; } });
2407
+
2408
+ /**
2409
+ * Abstract directive that listens to onSuccess transition events and runs a function.
2410
+ */
2411
+ class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {
2412
+ constructor(dbxRouterTransitionService, ngZone) {
2413
+ super(dbxRouterTransitionService);
2414
+ this.ngZone = ngZone;
2415
+ this._transitionSub = new SubscriptionObject();
2416
+ }
2417
+ ngOnInit() {
2418
+ this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {
2419
+ this.updateForSuccessfulTransition();
2420
+ });
2421
+ }
2422
+ ngOnDestroy() {
2423
+ this._transitionSub.destroy();
2424
+ }
2425
+ // MARK: Action
2426
+ zoneUpdateForSuccessfulTransition() {
2427
+ this.ngZone.run(() => this.updateForSuccessfulTransition());
2428
+ }
2429
+ }
2430
+ AbstractTransitionWatcherDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionWatcherDirective, deps: [{ token: DbxRouterTransitionService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2431
+ AbstractTransitionWatcherDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractTransitionWatcherDirective, usesInheritance: true, ngImport: i0 });
2432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractTransitionWatcherDirective, decorators: [{
2433
+ type: Directive
2434
+ }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }, { type: i0.NgZone }]; } });
2435
+
2436
+ /**
2437
+ * Auth routes configurations for an app.
2438
+ */
2439
+ class DbxAppAuthRoutes {
2440
+ }
2441
+
2442
+ /**
2443
+ * Helper service for navigating to important auth-related routes.
2444
+ */
2445
+ class DbxAppAuthRouterService {
2446
+ constructor(dbxRouterService, dbxAppAuthRoutes) {
2447
+ this.dbxRouterService = dbxRouterService;
2448
+ this.dbxAppAuthRoutes = dbxAppAuthRoutes;
2449
+ }
2450
+ get hasOnboardingState() {
2451
+ return Boolean(this.dbxAppAuthRoutes.onboardRef);
2452
+ }
2453
+ // MARK: Navigate
2454
+ /**
2455
+ * Navigates to the login state.
2456
+ *
2457
+ * @returns
2458
+ */
2459
+ goToLogin() {
2460
+ return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.loginRef);
2461
+ }
2462
+ /**
2463
+ * Navigates to the logged out state, if it exists, otherwise navigates to the login state.
2464
+ *
2465
+ * @returns
2466
+ */
2467
+ goToLoggedOut() {
2468
+ var _a;
2469
+ return goWithRouter(this.dbxRouterService)((_a = this.dbxAppAuthRoutes.loggedOutRef) !== null && _a !== void 0 ? _a : this.dbxAppAuthRoutes.loginRef);
2470
+ }
2471
+ /**
2472
+ * Navigates to the onboarding state if it is available, otherwise navigates to the app.
2473
+ *
2474
+ * @returns
2475
+ */
2476
+ goToOnboarding() {
2477
+ var _a;
2478
+ return goWithRouter(this.dbxRouterService)((_a = this.dbxAppAuthRoutes.onboardRef) !== null && _a !== void 0 ? _a : this.dbxAppAuthRoutes.appRef);
2479
+ }
2480
+ /**
2481
+ * Navigates to the app state.
2482
+ *
2483
+ * @returns
2484
+ */
2485
+ goToApp() {
2486
+ return goWithRouter(this.dbxRouterService)(this.dbxAppAuthRoutes.appRef);
2487
+ }
2488
+ }
2489
+ DbxAppAuthRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterService, deps: [{ token: DbxRouterService }, { token: DbxAppAuthRoutes }], target: i0.ɵɵFactoryTarget.Injectable });
2490
+ DbxAppAuthRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterService, providedIn: 'root' });
2491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterService, decorators: [{
2492
+ type: Injectable,
2493
+ args: [{
2494
+ providedIn: 'root'
2495
+ }]
2496
+ }], ctorParameters: function () { return [{ type: DbxRouterService }, { type: DbxAppAuthRoutes }]; } });
2497
+
2498
+ /**
2499
+ * Used by DbxAppAuthRouterEffects to configure the states that should be activve by default.
2500
+ */
2501
+ const DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN = new InjectionToken('DbxAppAuthRouterEffectsActiveStates');
2502
+ /**
2503
+ * Set of ngrx effects that handle navigation in the app when the auth changes in certain ways.
2504
+ *
2505
+ * Is configurable via the DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN to choose which states this effect is active or not. By default is equal to DBX_KNOWN_APP_CONTEXT_STATES.
2506
+ */
2507
+ class DbxAppAuthRouterEffects extends AbstractOnDbxAppContextStateEffects {
2508
+ constructor(activeStates, actions$, store, dbxAppAuthRouterService) {
2509
+ super(activeStates !== null && activeStates !== void 0 ? activeStates : DBX_KNOWN_APP_CONTEXT_STATES, actions$, store);
2510
+ this.dbxAppAuthRouterService = dbxAppAuthRouterService;
2511
+ /**
2512
+ * Effect to redirect to the login when logout occurs.
2513
+ */
2514
+ this.redirectToLoginOnLogout = createEffect(() => this.actions$.pipe(ofType(loggedOut), exhaustMap$1(() => this.dbxAppAuthRouterService.goToLogin())), { dispatch: false });
2515
+ /**
2516
+ * Effect to redirect to the app when login occurs.
2517
+ */
2518
+ this.redirectToOnboardOnLogIn = createEffect(() => this.actions$.pipe(ofType(loggedIn), exhaustMap$1(() => this.dbxAppAuthRouterService.goToApp())), { dispatch: false });
2519
+ }
2520
+ }
2521
+ DbxAppAuthRouterEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterEffects, deps: [{ token: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, optional: true }, { token: i1$3.Actions }, { token: i1$4.Store }, { token: DbxAppAuthRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
2522
+ DbxAppAuthRouterEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterEffects });
2523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterEffects, decorators: [{
2524
+ type: Injectable
2525
+ }], ctorParameters: function () {
2526
+ return [{ type: undefined, decorators: [{
2527
+ type: Inject,
2528
+ args: [DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN]
2529
+ }, {
2530
+ type: Optional
2531
+ }] }, { type: i1$3.Actions }, { type: i1$4.Store }, { type: DbxAppAuthRouterService }];
2532
+ } });
2533
+
2534
+ class DbxAppAuthRouterStateModule {
2535
+ static forRoot(config) {
2536
+ return {
2537
+ ngModule: DbxAppAuthRouterStateModule,
2538
+ providers: [{
2539
+ provide: DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN,
2540
+ useValue: config.activeRoutesToApplyEffects
2541
+ }]
2542
+ };
2543
+ }
2544
+ }
2545
+ DbxAppAuthRouterStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2546
+ DbxAppAuthRouterStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, imports: [i1$3.EffectsFeatureModule] });
2547
+ DbxAppAuthRouterStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, imports: [[
2548
+ EffectsModule.forFeature([DbxAppAuthRouterEffects])
2549
+ ]] });
2550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterStateModule, decorators: [{
2551
+ type: NgModule,
2552
+ args: [{
2553
+ imports: [
2554
+ EffectsModule.forFeature([DbxAppAuthRouterEffects])
2555
+ ],
2556
+ declarations: [],
2557
+ exports: []
2558
+ }]
2559
+ }] });
2560
+
2561
+ class DbxAppAuthRouterModule {
2562
+ static forRoot(dbxAppAuthRoutes) {
2563
+ return {
2564
+ ngModule: DbxAppAuthRouterModule,
2565
+ providers: [{
2566
+ provide: DbxAppAuthRoutes,
2567
+ useValue: dbxAppAuthRoutes
2568
+ }]
2569
+ };
2570
+ }
2571
+ }
2572
+ DbxAppAuthRouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2573
+ DbxAppAuthRouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule });
2574
+ DbxAppAuthRouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule, imports: [[]] });
2575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthRouterModule, decorators: [{
2576
+ type: NgModule,
2577
+ args: [{
2578
+ imports: [],
2579
+ declarations: [],
2580
+ exports: []
2581
+ }]
2582
+ }] });
2583
+
2584
+ /**
2585
+ * Convenience operator that emits events when the input observable goes from false to true.
2586
+ *
2587
+ * @param isLoggedInObs
2588
+ * @returns
2589
+ */
2590
+ function loggedInObsFromIsLoggedIn(isLoggedInObs) {
2591
+ return isLoggedInObs.pipe(onFalseToTrue(), map$1(_ => undefined));
2592
+ }
2593
+ /**
2594
+ * Convenience operator that emits events when the input observable goes from true to false.
2595
+ *
2596
+ * @param isLoggedInObs
2597
+ * @returns
2598
+ */
2599
+ function loggedOutObsFromIsLoggedIn(isLoggedInObs) {
2600
+ return isLoggedInObs.pipe(onTrueToFalse(), map$1(_ => undefined));
2601
+ }
2602
+ function authRolesSetContainsAllRolesFrom(roles) {
2603
+ return setContainsAllValuesFrom(roles);
2604
+ }
2605
+ function authRolesSetContainsAnyRoleFrom(roles) {
2606
+ return setContainsAllValuesFrom(roles);
2607
+ }
2608
+
2609
+ /**
2610
+ * Structural decorator directive similar to ngIf that embeds content if the current auth user has any of the target role(s).
2611
+ */
2612
+ class DbxAuthHasAnyRoleDirective extends AbstractIfDirective {
2613
+ constructor(templateRef, viewContainer, dbxAuthService) {
2614
+ super(templateRef, viewContainer);
2615
+ this.dbxAuthService = dbxAuthService;
2616
+ this._targetRoles = new BehaviorSubject(undefined);
2617
+ this.targetRoles$ = this._targetRoles.asObservable();
2618
+ this.show$ = this.dbxAuthService.authRoles$.pipe(authRolesSetContainsAnyRoleFrom(this.targetRoles$));
2619
+ }
2620
+ ngOnDestroy() {
2621
+ this._targetRoles.complete();
2622
+ }
2623
+ set targetRoles(roles) {
2624
+ this._targetRoles.next(roles);
2625
+ }
2626
+ }
2627
+ DbxAuthHasAnyRoleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasAnyRoleDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxAuthService }], target: i0.ɵɵFactoryTarget.Directive });
2628
+ DbxAuthHasAnyRoleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxAuthHasAnyRoleDirective, selector: "[dbxAuthHasAnyRole]", inputs: { targetRoles: ["dbxAuthHasAnyRole", "targetRoles"] }, usesInheritance: true, ngImport: i0 });
2629
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasAnyRoleDirective, decorators: [{
2630
+ type: Directive,
2631
+ args: [{
2632
+ selector: '[dbxAuthHasAnyRole]'
2633
+ }]
2634
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxAuthService }]; }, propDecorators: { targetRoles: [{
2635
+ type: Input,
2636
+ args: ['dbxAuthHasAnyRole']
2637
+ }] } });
2638
+
2639
+ /**
2640
+ * Structural decorator directive similar to ngIf that embeds content if the current auth user has all of the target role(s).
2641
+ */
2642
+ class DbxAuthHasRolesDirective extends AbstractIfDirective {
2643
+ constructor(templateRef, viewContainer, dbxAuthService) {
2644
+ super(templateRef, viewContainer);
2645
+ this.dbxAuthService = dbxAuthService;
2646
+ this._targetRoles = new BehaviorSubject(undefined);
2647
+ this.targetRoles$ = this._targetRoles.asObservable();
2648
+ this.show$ = this.dbxAuthService.authRoles$.pipe(authRolesSetContainsAllRolesFrom(this.targetRoles$));
2649
+ }
2650
+ ngOnDestroy() {
2651
+ this._targetRoles.complete();
2652
+ }
2653
+ set targetRoles(roles) {
2654
+ this._targetRoles.next(roles);
2655
+ }
2656
+ }
2657
+ DbxAuthHasRolesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasRolesDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DbxAuthService }], target: i0.ɵɵFactoryTarget.Directive });
2658
+ DbxAuthHasRolesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxAuthHasRolesDirective, selector: "[dbxAuthHasRoles]", inputs: { targetRoles: ["dbxAuthHasRoles", "targetRoles"] }, usesInheritance: true, ngImport: i0 });
2659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAuthHasRolesDirective, decorators: [{
2660
+ type: Directive,
2661
+ args: [{
2662
+ selector: '[dbxAuthHasRoles]'
2663
+ }]
2664
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: DbxAuthService }]; }, propDecorators: { targetRoles: [{
2665
+ type: Input,
2666
+ args: ['dbxAuthHasRoles']
2667
+ }] } });
2668
+
2669
+ class DbxCoreAuthModule {
2670
+ }
2671
+ DbxCoreAuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2672
+ DbxCoreAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, declarations: [DbxAuthHasRolesDirective,
2673
+ DbxAuthHasAnyRoleDirective], exports: [DbxAuthHasRolesDirective,
2674
+ DbxAuthHasAnyRoleDirective] });
2675
+ DbxCoreAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, imports: [[]] });
2676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreAuthModule, decorators: [{
2677
+ type: NgModule,
2678
+ args: [{
2679
+ imports: [],
2680
+ declarations: [
2681
+ DbxAuthHasRolesDirective,
2682
+ DbxAuthHasAnyRoleDirective
2683
+ ],
2684
+ exports: [
2685
+ DbxAuthHasRolesDirective,
2686
+ DbxAuthHasAnyRoleDirective
2687
+ ]
2688
+ }]
2689
+ }] });
2690
+
2691
+ /**
2692
+ * Set of ngrx effects that repeat events from DbxAuthService.
2693
+ */
2694
+ class DbxAppAuthEffects {
2695
+ constructor(actions$, store, dbxAuthService) {
2696
+ this.actions$ = actions$;
2697
+ this.store = store;
2698
+ this.dbxAuthService = dbxAuthService;
2699
+ // MARK: Auth
2700
+ this.emitLoggedIn = createEffect(() => this.dbxAuthService.onLogIn$
2701
+ .pipe(map$1(() => loggedIn())));
2702
+ this.emitLoggedOut = createEffect(() => this.dbxAuthService.onLogOut$
2703
+ .pipe(map$1(() => loggedOut())));
2704
+ this.forwardLogoutToAuthService = createEffect(() => this.actions$.pipe(ofType(logout), tap$1(() => {
2705
+ // Perform the logout
2706
+ this.dbxAuthService.logOut();
2707
+ })), { dispatch: false });
2708
+ // MARK: Auth
2709
+ this.setUserIdentifier = createEffect(() => this.dbxAuthService.userIdentifier$
2710
+ .pipe(map$1((id) => setUserIdentifier({ id }))));
2711
+ this.setUserState = createEffect(() => this.dbxAuthService.authUserState$
2712
+ .pipe(map$1((state) => setUserState({ state }))));
2713
+ this.setUserRoles = createEffect(() => this.dbxAuthService.authRoles$
2714
+ .pipe(map$1((roles) => setUserRoles({ roles: Array.from(roles !== null && roles !== void 0 ? roles : []) }))));
2715
+ this.setUserIsOnboarded = createEffect(() => this.dbxAuthService.isOnboarded$
2716
+ .pipe(map$1((isOnboarded) => setUserIsOnboarded({ isOnboarded }))));
2717
+ }
2718
+ }
2719
+ DbxAppAuthEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthEffects, deps: [{ token: i1$3.Actions }, { token: i1$4.Store }, { token: DbxAuthService }], target: i0.ɵɵFactoryTarget.Injectable });
2720
+ DbxAppAuthEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthEffects });
2721
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthEffects, decorators: [{
2722
+ type: Injectable
2723
+ }], ctorParameters: function () { return [{ type: i1$3.Actions }, { type: i1$4.Store }, { type: DbxAuthService }]; } });
2724
+
2725
+ class DbxAppAuthStateModule {
2726
+ }
2727
+ DbxAppAuthStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2728
+ DbxAppAuthStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, imports: [i1$4.StoreFeatureModule, i1$3.EffectsFeatureModule] });
2729
+ DbxAppAuthStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, imports: [[
2730
+ StoreModule.forFeature(featureKey, reducers),
2731
+ EffectsModule.forFeature([DbxAppAuthEffects])
2732
+ ]] });
2733
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateModule, decorators: [{
2734
+ type: NgModule,
2735
+ args: [{
2736
+ imports: [
2737
+ StoreModule.forFeature(featureKey, reducers),
2738
+ EffectsModule.forFeature([DbxAppAuthEffects])
2739
+ ],
2740
+ declarations: [],
2741
+ exports: []
2742
+ }]
2743
+ }] });
2744
+
2745
+ /**
2746
+ * State for accessing the app's DbxAppAuthState defined within the DbxAppAuthFullState for the ngrx store.
2747
+ */
2748
+ class DbxAppAuthStateService {
2749
+ constructor(store) {
2750
+ this.store = store;
2751
+ this.authStateUser$ = this.store.select(selectDbxAppAuthUser);
2752
+ }
2753
+ }
2754
+ DbxAppAuthStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateService, deps: [{ token: i1$4.Store }], target: i0.ɵɵFactoryTarget.Injectable });
2755
+ DbxAppAuthStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateService, providedIn: 'root' });
2756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppAuthStateService, decorators: [{
2757
+ type: Injectable,
2758
+ args: [{
2759
+ providedIn: 'root'
2760
+ }]
2761
+ }], ctorParameters: function () { return [{ type: i1$4.Store }]; } });
2762
+
2763
+ /**
2764
+ * Convenience function used within observables for views that need to detect changes after a value changes.
2765
+ *
2766
+ * @param cdRef
2767
+ * @param timeout
2768
+ * @returns
2769
+ */
2770
+ function tapDetectChanges(cdRef, timeout = 0) {
2771
+ return tap$1(() => setTimeout(() => safeDetectChanges(cdRef), timeout));
2772
+ }
2773
+ /**
2774
+ * Triggers a detection change on the input view as long as the view has not been destroyed.
2775
+ *
2776
+ * @param cdRef
2777
+ */
2778
+ function safeDetectChanges(cdRef) {
2779
+ safeUseCdRef(cdRef, () => cdRef.detectChanges());
2780
+ }
2781
+ /**
2782
+ * Marks the ChangeDetectorRef for changes as long as the view has not been destroyed.
2783
+ *
2784
+ * @param cdRef
2785
+ */
2786
+ function safeMarkForCheck(cdRef) {
2787
+ safeUseCdRef(cdRef, () => cdRef.markForCheck());
2788
+ }
2789
+ /**
2790
+ * Triggers a detection change on the input view as long as the view has not been destroyed.
2791
+ *
2792
+ * @param cdRef
2793
+ */
2794
+ function safeUseCdRef(cdRef, use) {
2795
+ if (!cdRef.destroyed) {
2796
+ cdRef.markForCheck();
2797
+ }
2798
+ }
2799
+ /**
2800
+ * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,
2801
+ * or more specifically if the parent component passed any target content to the child. This will still return true if
2802
+ * passed content is empty.
2803
+ *
2804
+ * TS:
2805
+ * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;
2806
+ *
2807
+ * HTML:
2808
+ * <div #customContent>
2809
+ * <ng-content select="[content]"></ng-content>
2810
+ * </div>
2811
+ */
2812
+ function checkNgContentWrapperHasContent(ref) {
2813
+ // https://github.com/angular/angular/issues/26083
2814
+ let hasContent = false;
2815
+ if (ref != null) {
2816
+ const childNodes = ref.nativeElement.childNodes;
2817
+ const hasChildNodes = childNodes && childNodes.length > 0;
2818
+ hasContent = Boolean(hasChildNodes);
2819
+ }
2820
+ return hasContent;
2821
+ }
2822
+
2823
+ class DbxButton {
2130
2824
  }
2131
- function filterTransitionEvent(type) {
2132
- return filter$1(x => x.type === type);
2825
+ function ProvideDbxButton(sourceType) {
2826
+ return [{
2827
+ provide: DbxButton,
2828
+ useExisting: forwardRef(() => sourceType)
2829
+ }];
2133
2830
  }
2134
2831
 
2135
2832
  /**
2136
- * Abstract directive that listens to onSuccess transition events and runs a function.
2833
+ * Context used for linking a button to an ActionContext and only look for triggers.
2137
2834
  */
2138
- class AbstractTransitionDirective {
2139
- constructor(dbNgxRouterTransitionService) {
2140
- this.dbNgxRouterTransitionService = dbNgxRouterTransitionService;
2141
- this.transitionSuccess$ = successTransition(this.dbNgxRouterTransitionService.transitions$);
2142
- this.initAndUpdateOnTransitionSuccess$ = this.transitionSuccess$.pipe(startWith$1(undefined));
2835
+ class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective {
2836
+ constructor(button, source) {
2837
+ super();
2838
+ this.button = button;
2839
+ this.source = source;
2840
+ }
2841
+ ngOnInit() {
2842
+ this.sub = this.button.clicked$.subscribe(() => {
2843
+ this._buttonClicked();
2844
+ });
2845
+ }
2846
+ _buttonClicked() {
2847
+ this.source.trigger();
2143
2848
  }
2144
2849
  }
2145
- AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
2146
- AbstractTransitionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractTransitionDirective, ngImport: i0 });
2147
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionDirective, decorators: [{
2148
- type: Directive
2149
- }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }]; } });
2850
+ DbxActionButtonTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonTriggerDirective, deps: [{ token: DbxButton, host: true }, { token: DbxActionContextStoreSourceInstance }], target: i0.ɵɵFactoryTarget.Directive });
2851
+ DbxActionButtonTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionButtonTriggerDirective, selector: "[dbxActionButtonTrigger]", usesInheritance: true, ngImport: i0 });
2852
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonTriggerDirective, decorators: [{
2853
+ type: Directive,
2854
+ args: [{
2855
+ selector: '[dbxActionButtonTrigger]'
2856
+ }]
2857
+ }], ctorParameters: function () {
2858
+ return [{ type: DbxButton, decorators: [{
2859
+ type: Host
2860
+ }] }, { type: DbxActionContextStoreSourceInstance }];
2861
+ } });
2150
2862
 
2151
2863
  /**
2152
- * Abstract directive that listens to onSuccess transition events and runs a function.
2864
+ * Context used for linking a button to an ActionContext.
2153
2865
  */
2154
- class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {
2155
- constructor(dbNgxRouterTransitionService, ngZone) {
2156
- super(dbNgxRouterTransitionService);
2157
- this.ngZone = ngZone;
2158
- this._transitionSub = new SubscriptionObject();
2866
+ class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {
2867
+ constructor(button, source, cdRef) {
2868
+ super(button, source);
2869
+ this.cdRef = cdRef;
2870
+ this._workingSub = new SubscriptionObject();
2871
+ this._disabledSub = new SubscriptionObject();
2159
2872
  }
2160
2873
  ngOnInit() {
2161
- this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {
2162
- this.updateForSuccessfulTransition();
2874
+ super.ngOnInit();
2875
+ this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {
2876
+ this.button.working = working;
2877
+ safeDetectChanges(this.cdRef);
2878
+ });
2879
+ this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {
2880
+ this.button.disabled = disabled;
2881
+ safeDetectChanges(this.cdRef);
2163
2882
  });
2164
2883
  }
2165
2884
  ngOnDestroy() {
2166
- this._transitionSub.destroy();
2167
- }
2168
- // MARK: Action
2169
- zoneUpdateForSuccessfulTransition() {
2170
- this.ngZone.run(() => this.updateForSuccessfulTransition());
2885
+ super.ngOnDestroy();
2886
+ this._workingSub.destroy();
2887
+ this._disabledSub.destroy();
2171
2888
  }
2172
2889
  }
2173
- AbstractTransitionWatcherDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionWatcherDirective, deps: [{ token: DbxRouterTransitionService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2174
- AbstractTransitionWatcherDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractTransitionWatcherDirective, usesInheritance: true, ngImport: i0 });
2175
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionWatcherDirective, decorators: [{
2176
- type: Directive
2177
- }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }, { type: i0.NgZone }]; } });
2178
-
2179
- function refStringToSegueRef(ref, options) {
2180
- return Object.assign(Object.assign({}, options), { ref });
2181
- }
2182
- function mapRefStringObsToSegueRefObs(obs, options) {
2183
- return obs.pipe(map(x => refStringToSegueRef(x, options)));
2184
- }
2890
+ DbxActionButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonDirective, deps: [{ token: DbxButton, host: true }, { token: DbxActionContextStoreSourceInstance }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
2891
+ DbxActionButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxActionButtonDirective, selector: "[dbxActionButton]", usesInheritance: true, ngImport: i0 });
2892
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxActionButtonDirective, decorators: [{
2893
+ type: Directive,
2894
+ args: [{
2895
+ selector: '[dbxActionButton]'
2896
+ }]
2897
+ }], ctorParameters: function () {
2898
+ return [{ type: DbxButton, decorators: [{
2899
+ type: Host
2900
+ }] }, { type: DbxActionContextStoreSourceInstance }, { type: i0.ChangeDetectorRef }];
2901
+ } });
2185
2902
 
2186
2903
  // MARK: Button Directives
2187
2904
  class DbxButtonSegueDirective extends AbstractSubscriptionDirective {
@@ -2203,10 +2920,14 @@ class DbxButtonSegueDirective extends AbstractSubscriptionDirective {
2203
2920
  this.dbxRouterService.go(segueRef);
2204
2921
  })))).subscribe();
2205
2922
  }
2923
+ ngOnDestroy() {
2924
+ super.ngOnDestroy();
2925
+ this._segueRef.complete();
2926
+ }
2206
2927
  }
2207
- DbxButtonSegueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonSegueDirective, deps: [{ token: DbxButton }, { token: DbxRouterService }], target: i0.ɵɵFactoryTarget.Directive });
2208
- DbxButtonSegueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxButtonSegueDirective, selector: "[dbxButtonSegue]", inputs: { segueRef: ["dbxButtonSegue", "segueRef"] }, usesInheritance: true, ngImport: i0 });
2209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonSegueDirective, decorators: [{
2928
+ DbxButtonSegueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonSegueDirective, deps: [{ token: DbxButton }, { token: DbxRouterService }], target: i0.ɵɵFactoryTarget.Directive });
2929
+ DbxButtonSegueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxButtonSegueDirective, selector: "[dbxButtonSegue]", inputs: { segueRef: ["dbxButtonSegue", "segueRef"] }, usesInheritance: true, ngImport: i0 });
2930
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonSegueDirective, decorators: [{
2210
2931
  type: Directive,
2211
2932
  args: [{
2212
2933
  selector: '[dbxButtonSegue]'
@@ -2287,9 +3008,9 @@ class AbstractDbxButtonDirective extends AbstractSubscriptionDirective {
2287
3008
  this.buttonClick.emit();
2288
3009
  }
2289
3010
  }
2290
- AbstractDbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2291
- AbstractDbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxButtonDirective, inputs: { disabled: "disabled", working: "working", icon: "icon", text: "text" }, outputs: { buttonClick: "buttonClick" }, usesInheritance: true, ngImport: i0 });
2292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxButtonDirective, decorators: [{
3011
+ AbstractDbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3012
+ AbstractDbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxButtonDirective, inputs: { disabled: "disabled", working: "working", icon: "icon", text: "text" }, outputs: { buttonClick: "buttonClick" }, usesInheritance: true, ngImport: i0 });
3013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxButtonDirective, decorators: [{
2293
3014
  type: Directive
2294
3015
  }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
2295
3016
  type: Input
@@ -2308,9 +3029,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2308
3029
  */
2309
3030
  class DbxButtonDirective extends AbstractDbxButtonDirective {
2310
3031
  }
2311
- DbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2312
- DbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxButtonDirective, selector: "[dbxButton]", providers: ProvideDbxButton(DbxButtonDirective), exportAs: ["dbxButton"], usesInheritance: true, ngImport: i0 });
2313
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonDirective, decorators: [{
3032
+ DbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3033
+ DbxButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxButtonDirective, selector: "[dbxButton]", providers: ProvideDbxButton(DbxButtonDirective), exportAs: ["dbxButton"], usesInheritance: true, ngImport: i0 });
3034
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxButtonDirective, decorators: [{
2314
3035
  type: Directive,
2315
3036
  args: [{
2316
3037
  selector: '[dbxButton]',
@@ -2343,9 +3064,9 @@ class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {
2343
3064
  this.sub = subscription;
2344
3065
  }
2345
3066
  }
2346
- DbxLoadingButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxLoadingButtonDirective, deps: [{ token: DbxButton, host: true }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2347
- DbxLoadingButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxLoadingButtonDirective, selector: "[dbxLoadingButton]", inputs: { context: ["dbxLoadingButton", "context"] }, usesInheritance: true, ngImport: i0 });
2348
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxLoadingButtonDirective, decorators: [{
3067
+ DbxLoadingButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxLoadingButtonDirective, deps: [{ token: DbxButton, host: true }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
3068
+ DbxLoadingButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxLoadingButtonDirective, selector: "[dbxLoadingButton]", inputs: { context: ["dbxLoadingButton", "context"] }, usesInheritance: true, ngImport: i0 });
3069
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxLoadingButtonDirective, decorators: [{
2349
3070
  type: Directive,
2350
3071
  args: [{
2351
3072
  selector: '[dbxLoadingButton]'
@@ -2361,8 +3082,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2361
3082
 
2362
3083
  class DbxCoreButtonModule {
2363
3084
  }
2364
- DbxCoreButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2365
- DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, declarations: [DbxButtonDirective,
3085
+ DbxCoreButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3086
+ DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, declarations: [DbxButtonDirective,
2366
3087
  DbxLoadingButtonDirective,
2367
3088
  DbxActionButtonTriggerDirective,
2368
3089
  DbxActionButtonDirective,
@@ -2371,8 +3092,8 @@ DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
2371
3092
  DbxActionButtonTriggerDirective,
2372
3093
  DbxActionButtonDirective,
2373
3094
  DbxButtonSegueDirective] });
2374
- DbxCoreButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, imports: [[]] });
2375
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, decorators: [{
3095
+ DbxCoreButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, imports: [[]] });
3096
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreButtonModule, decorators: [{
2376
3097
  type: NgModule,
2377
3098
  args: [{
2378
3099
  imports: [],
@@ -2393,6 +3114,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2393
3114
  }]
2394
3115
  }] });
2395
3116
 
3117
+ /**
3118
+ * State for accessing the app's DbxAppContextState defined within the DbxAppContextFullState for the ngrx store.
3119
+ */
3120
+ class DbxAppContextService {
3121
+ constructor(store) {
3122
+ this.store = store;
3123
+ this.state$ = this.store.select(selectDbxAppContextState);
3124
+ }
3125
+ setState(state) {
3126
+ this.store.dispatch(setState({ state }));
3127
+ }
3128
+ resetState() {
3129
+ this.store.next(resetState());
3130
+ }
3131
+ }
3132
+ DbxAppContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextService, deps: [{ token: i1$4.Store }], target: i0.ɵɵFactoryTarget.Injectable });
3133
+ DbxAppContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextService, providedIn: 'root' });
3134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextService, decorators: [{
3135
+ type: Injectable,
3136
+ args: [{
3137
+ providedIn: 'root'
3138
+ }]
3139
+ }], ctorParameters: function () { return [{ type: i1$4.Store }]; } });
3140
+
3141
+ /**
3142
+ * Used to set the DbxAppContextState for an app to the input state using the DbxAppContextService.
3143
+ */
3144
+ class DbxAppContextStateDirective extends AbstractSubscriptionDirective {
3145
+ constructor(dbxAppContextStateService) {
3146
+ super();
3147
+ this.dbxAppContextStateService = dbxAppContextStateService;
3148
+ this._state = new BehaviorSubject(undefined);
3149
+ }
3150
+ ngOnInit() {
3151
+ this.sub = this._state.pipe(filterMaybe()).subscribe((state) => {
3152
+ this.dbxAppContextStateService.setState(state);
3153
+ });
3154
+ }
3155
+ ngOnDestroy() {
3156
+ super.ngOnDestroy();
3157
+ this._state.complete();
3158
+ }
3159
+ set state(state) {
3160
+ this._state.next(state);
3161
+ }
3162
+ }
3163
+ DbxAppContextStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateDirective, deps: [{ token: DbxAppContextService }], target: i0.ɵɵFactoryTarget.Directive });
3164
+ DbxAppContextStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxAppContextStateDirective, selector: "[dbxAppContextState]", inputs: { state: ["dbxAppContextState", "state"] }, usesInheritance: true, ngImport: i0 });
3165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateDirective, decorators: [{
3166
+ type: Directive,
3167
+ args: [{
3168
+ selector: '[dbxAppContextState]'
3169
+ }]
3170
+ }], ctorParameters: function () { return [{ type: DbxAppContextService }]; }, propDecorators: { state: [{
3171
+ type: Input,
3172
+ args: ['dbxAppContextState']
3173
+ }] } });
3174
+
3175
+ class DbxAppContextStateModule {
3176
+ }
3177
+ DbxAppContextStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3178
+ DbxAppContextStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, declarations: [DbxAppContextStateDirective], imports: [i1$4.StoreFeatureModule], exports: [DbxAppContextStateDirective] });
3179
+ DbxAppContextStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, imports: [[
3180
+ StoreModule.forFeature(featureKey$1, reducers$1)
3181
+ ]] });
3182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxAppContextStateModule, decorators: [{
3183
+ type: NgModule,
3184
+ args: [{
3185
+ imports: [
3186
+ StoreModule.forFeature(featureKey$1, reducers$1)
3187
+ ],
3188
+ declarations: [
3189
+ DbxAppContextStateDirective
3190
+ ],
3191
+ exports: [
3192
+ DbxAppContextStateDirective
3193
+ ]
3194
+ }]
3195
+ }] });
3196
+
2396
3197
  /**
2397
3198
  * Pipe that takes in a date and number of minutes and outputs a formatted date.
2398
3199
  */
@@ -2413,9 +3214,9 @@ class DateFromToTimePipe {
2413
3214
  return undefined;
2414
3215
  }
2415
3216
  }
2416
- DateFromToTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
2417
- DateFromToTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, name: "dateFromPlusTo" });
2418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, decorators: [{
3217
+ DateFromToTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFromToTimePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
3218
+ DateFromToTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFromToTimePipe, name: "dateFromPlusTo" });
3219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFromToTimePipe, decorators: [{
2419
3220
  type: Pipe,
2420
3221
  args: [{ name: 'dateFromPlusTo' }]
2421
3222
  }], ctorParameters: function () {
@@ -2448,24 +3249,31 @@ class MinutesStringPipe {
2448
3249
  }
2449
3250
  }
2450
3251
  }
2451
- MinutesStringPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2452
- MinutesStringPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, name: "minutesString", pure: false });
2453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, decorators: [{
3252
+ MinutesStringPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: MinutesStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3253
+ MinutesStringPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: MinutesStringPipe, name: "minutesString", pure: false });
3254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: MinutesStringPipe, decorators: [{
2454
3255
  type: Pipe,
2455
3256
  args: [{ name: 'minutesString', pure: false }]
2456
3257
  }] });
2457
3258
 
2458
3259
  class ToJsDatePipe {
2459
3260
  static toJsDate(input) {
2460
- return (input) ? toJsDate(input) : undefined;
3261
+ let date;
3262
+ if (input != null) {
3263
+ date = toJsDate(input);
3264
+ if (!isValid(date)) {
3265
+ date = undefined;
3266
+ }
3267
+ }
3268
+ return date;
2461
3269
  }
2462
3270
  transform(input) {
2463
3271
  return ToJsDatePipe.toJsDate(input);
2464
3272
  }
2465
3273
  }
2466
- ToJsDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2467
- ToJsDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, name: "toJsDate" });
2468
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, decorators: [{
3274
+ ToJsDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToJsDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3275
+ ToJsDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToJsDatePipe, name: "toJsDate" });
3276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToJsDatePipe, decorators: [{
2469
3277
  type: Pipe,
2470
3278
  args: [{ name: 'toJsDate' }]
2471
3279
  }] });
@@ -2489,9 +3297,9 @@ class TimeDistanceCountdownPipe {
2489
3297
  }
2490
3298
  }
2491
3299
  }
2492
- TimeDistanceCountdownPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2493
- TimeDistanceCountdownPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, name: "timeCountdownDistance", pure: false });
2494
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, decorators: [{
3300
+ TimeDistanceCountdownPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistanceCountdownPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3301
+ TimeDistanceCountdownPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistanceCountdownPipe, name: "timeCountdownDistance", pure: false });
3302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistanceCountdownPipe, decorators: [{
2495
3303
  type: Pipe,
2496
3304
  args: [{ name: 'timeCountdownDistance', pure: false }]
2497
3305
  }] });
@@ -2508,9 +3316,9 @@ class TimeDistancePipe {
2508
3316
  }
2509
3317
  }
2510
3318
  }
2511
- TimeDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2512
- TimeDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, name: "timeDistance", pure: false });
2513
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, decorators: [{
3319
+ TimeDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3320
+ TimeDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistancePipe, name: "timeDistance", pure: false });
3321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: TimeDistancePipe, decorators: [{
2514
3322
  type: Pipe,
2515
3323
  args: [{ name: 'timeDistance', pure: false }]
2516
3324
  }] });
@@ -2523,9 +3331,9 @@ class ToMinutesPipe {
2523
3331
  return milliseconds;
2524
3332
  }
2525
3333
  }
2526
- ToMinutesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2527
- ToMinutesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, name: "toMinutes" });
2528
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, decorators: [{
3334
+ ToMinutesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToMinutesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3335
+ ToMinutesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToMinutesPipe, name: "toMinutes" });
3336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ToMinutesPipe, decorators: [{
2529
3337
  type: Pipe,
2530
3338
  args: [{ name: 'toMinutes' }]
2531
3339
  }] });
@@ -2552,9 +3360,9 @@ class DateFormatDistancePipe {
2552
3360
  return undefined;
2553
3361
  }
2554
3362
  }
2555
- DateFormatDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
2556
- DateFormatDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, name: "dateFormatDistance", pure: false });
2557
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, decorators: [{
3363
+ DateFormatDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFormatDistancePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
3364
+ DateFormatDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFormatDistancePipe, name: "dateFormatDistance", pure: false });
3365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateFormatDistancePipe, decorators: [{
2558
3366
  type: Pipe,
2559
3367
  args: [{ name: 'dateFormatDistance', pure: false }]
2560
3368
  }], ctorParameters: function () {
@@ -2595,17 +3403,17 @@ class DateDistancePipe {
2595
3403
  }
2596
3404
  }
2597
3405
  }
2598
- DateDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2599
- DateDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, name: "dateDistance", pure: false });
2600
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, decorators: [{
3406
+ DateDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3407
+ DateDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateDistancePipe, name: "dateDistance", pure: false });
3408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DateDistancePipe, decorators: [{
2601
3409
  type: Pipe,
2602
3410
  args: [{ name: 'dateDistance', pure: false }]
2603
3411
  }] });
2604
3412
 
2605
3413
  class DbxDatePipeModule {
2606
3414
  }
2607
- DbxDatePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2608
- DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule, declarations: [DateFromToTimePipe,
3415
+ DbxDatePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3416
+ DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, declarations: [DateFromToTimePipe,
2609
3417
  DateFormatDistancePipe,
2610
3418
  MinutesStringPipe,
2611
3419
  TimeDistanceCountdownPipe,
@@ -2620,8 +3428,8 @@ DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versi
2620
3428
  DateDistancePipe,
2621
3429
  ToJsDatePipe,
2622
3430
  ToMinutesPipe] });
2623
- DbxDatePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule });
2624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule, decorators: [{
3431
+ DbxDatePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule });
3432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxDatePipeModule, decorators: [{
2625
3433
  type: NgModule,
2626
3434
  args: [{
2627
3435
  exports: [
@@ -2647,6 +3455,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2647
3455
  }]
2648
3456
  }] });
2649
3457
 
3458
+ class PrettyJsonPipe {
3459
+ static toPrettyJson(input, spacing = 2) {
3460
+ let json;
3461
+ if (input) {
3462
+ try {
3463
+ json = JSON.stringify(input, null, spacing);
3464
+ }
3465
+ catch (e) {
3466
+ console.error('prettyjson pipe failed parsing input: ', input);
3467
+ json = 'ERROR';
3468
+ }
3469
+ }
3470
+ return json;
3471
+ }
3472
+ transform(input, spacing) {
3473
+ return PrettyJsonPipe.toPrettyJson(input, spacing);
3474
+ }
3475
+ }
3476
+ PrettyJsonPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PrettyJsonPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3477
+ PrettyJsonPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PrettyJsonPipe, name: "prettyjson" });
3478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: PrettyJsonPipe, decorators: [{
3479
+ type: Pipe,
3480
+ args: [{ name: 'prettyjson' }]
3481
+ }] });
3482
+
3483
+ class DbxMiscPipeModule {
3484
+ }
3485
+ DbxMiscPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3486
+ DbxMiscPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule, declarations: [PrettyJsonPipe], exports: [PrettyJsonPipe] });
3487
+ DbxMiscPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule });
3488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxMiscPipeModule, decorators: [{
3489
+ type: NgModule,
3490
+ args: [{
3491
+ exports: [
3492
+ PrettyJsonPipe
3493
+ ],
3494
+ declarations: [
3495
+ PrettyJsonPipe
3496
+ ]
3497
+ }]
3498
+ }] });
3499
+
3500
+ class DbxPipesModule {
3501
+ }
3502
+ DbxPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3503
+ DbxPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, exports: [DbxMiscPipeModule,
3504
+ DbxDatePipeModule] });
3505
+ DbxPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, imports: [DbxMiscPipeModule,
3506
+ DbxDatePipeModule] });
3507
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxPipesModule, decorators: [{
3508
+ type: NgModule,
3509
+ args: [{
3510
+ exports: [
3511
+ DbxMiscPipeModule,
3512
+ DbxDatePipeModule,
3513
+ ]
3514
+ }]
3515
+ }] });
3516
+
2650
3517
  /**
2651
3518
  * Abstract FilterSource implementation.
2652
3519
  */
@@ -2675,9 +3542,9 @@ class AbstractFilterSourceDirective {
2675
3542
  return of(undefined);
2676
3543
  }
2677
3544
  }
2678
- AbstractFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2679
- AbstractFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFilterSourceDirective, ngImport: i0 });
2680
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceDirective, decorators: [{
3545
+ AbstractFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3546
+ AbstractFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractFilterSourceDirective, ngImport: i0 });
3547
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceDirective, decorators: [{
2681
3548
  type: Directive
2682
3549
  }] });
2683
3550
 
@@ -2700,9 +3567,9 @@ class AbstractActionFilterSourceDirective extends AbstractFilterSourceDirective
2700
3567
  this.filterAction.trigger();
2701
3568
  }
2702
3569
  }
2703
- AbstractActionFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractActionFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2704
- AbstractActionFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractActionFilterSourceDirective, viewQueries: [{ propertyName: "filterAction", first: true, predicate: DbxActionContextStoreSourceInstance, descendants: true, read: DbxActionContextStoreSourceInstance, static: true }], usesInheritance: true, ngImport: i0 });
2705
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractActionFilterSourceDirective, decorators: [{
3570
+ AbstractActionFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractActionFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3571
+ AbstractActionFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractActionFilterSourceDirective, viewQueries: [{ propertyName: "filterAction", first: true, predicate: DbxActionContextStoreSourceInstance, descendants: true, read: DbxActionContextStoreSourceInstance, static: true }], usesInheritance: true, ngImport: i0 });
3572
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractActionFilterSourceDirective, decorators: [{
2706
3573
  type: Directive
2707
3574
  }], propDecorators: { filterAction: [{
2708
3575
  type: ViewChild,
@@ -2724,9 +3591,9 @@ class AbstractFilterSourceConnectorDirective {
2724
3591
  this._source.next(filterSource);
2725
3592
  }
2726
3593
  }
2727
- AbstractFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceConnectorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2728
- AbstractFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFilterSourceConnectorDirective, ngImport: i0 });
2729
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceConnectorDirective, decorators: [{
3594
+ AbstractFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceConnectorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3595
+ AbstractFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractFilterSourceConnectorDirective, ngImport: i0 });
3596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractFilterSourceConnectorDirective, decorators: [{
2730
3597
  type: Directive
2731
3598
  }] });
2732
3599
 
@@ -2757,12 +3624,12 @@ function ProvideFilterSourceConnector(sourceType) {
2757
3624
  */
2758
3625
  class DbxFilterSourceConnectorDirective extends AbstractFilterSourceConnectorDirective {
2759
3626
  }
2760
- DbxFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2761
- DbxFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterSourceConnectorDirective, selector: "[dbxFilterSourceConnector]", providers: [
3627
+ DbxFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3628
+ DbxFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterSourceConnectorDirective, selector: "[dbxFilterSourceConnector]", providers: [
2762
3629
  ...ProvideFilterSource(DbxFilterSourceConnectorDirective),
2763
3630
  ...ProvideFilterSourceConnector(DbxFilterSourceConnectorDirective)
2764
3631
  ], usesInheritance: true, ngImport: i0 });
2765
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceConnectorDirective, decorators: [{
3632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceConnectorDirective, decorators: [{
2766
3633
  type: Directive,
2767
3634
  args: [{
2768
3635
  selector: '[dbxFilterSourceConnector]',
@@ -2787,11 +3654,11 @@ class AbstractDbxFilterMapInstanceDirective {
2787
3654
  this._key.complete();
2788
3655
  }
2789
3656
  }
2790
- AbstractDbxFilterMapInstanceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, deps: [{ token: i1$3.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
2791
- AbstractDbxFilterMapInstanceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxFilterMapInstanceDirective, ngImport: i0 });
2792
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, decorators: [{
3657
+ AbstractDbxFilterMapInstanceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, deps: [{ token: i1$5.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
3658
+ AbstractDbxFilterMapInstanceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxFilterMapInstanceDirective, ngImport: i0 });
3659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxFilterMapInstanceDirective, decorators: [{
2793
3660
  type: Directive
2794
- }], ctorParameters: function () { return [{ type: i1$3.FilterMap }]; } });
3661
+ }], ctorParameters: function () { return [{ type: i1$5.FilterMap }]; } });
2795
3662
 
2796
3663
  /**
2797
3664
  * Provides a FilterSource from a parent FilterMap.
@@ -2811,11 +3678,11 @@ class DbxFilterMapSourceDirective extends AbstractDbxFilterMapInstanceDirective
2811
3678
  this.instance$.pipe(first$1()).subscribe((x) => x.initWithFilter(filterObs));
2812
3679
  }
2813
3680
  }
2814
- DbxFilterMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2815
- DbxFilterMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterMapSourceDirective, selector: "[dbxFilterMapSource]", inputs: { key: ["dbxFilterMapSource", "key"] }, providers: [
3681
+ DbxFilterMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3682
+ DbxFilterMapSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapSourceDirective, selector: "[dbxFilterMapSource]", inputs: { key: ["dbxFilterMapSource", "key"] }, providers: [
2816
3683
  ...ProvideFilterSource(DbxFilterMapSourceDirective)
2817
3684
  ], exportAs: ["dbxFilterMapSource"], usesInheritance: true, ngImport: i0 });
2818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceDirective, decorators: [{
3685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceDirective, decorators: [{
2819
3686
  type: Directive,
2820
3687
  args: [{
2821
3688
  selector: '[dbxFilterMapSource]',
@@ -2844,12 +3711,12 @@ class DbxFilterMapSourceConnectorDirective extends DbxFilterMapSourceDirective {
2844
3711
  this.instance$.pipe(first$1()).subscribe((x) => x.connectWithSource(filterSource));
2845
3712
  }
2846
3713
  }
2847
- DbxFilterMapSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2848
- DbxFilterMapSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterMapSourceConnectorDirective, selector: "[dbxFilterMapSourceConnector]", inputs: { key: ["dbxFilterMapSourceConnector", "key"] }, providers: [
3714
+ DbxFilterMapSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3715
+ DbxFilterMapSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapSourceConnectorDirective, selector: "[dbxFilterMapSourceConnector]", inputs: { key: ["dbxFilterMapSourceConnector", "key"] }, providers: [
2849
3716
  ...ProvideFilterSource(DbxFilterMapSourceConnectorDirective),
2850
3717
  ...ProvideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)
2851
3718
  ], exportAs: ["dbxFilterMapSourceConnector"], usesInheritance: true, ngImport: i0 });
2852
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, decorators: [{
3719
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, decorators: [{
2853
3720
  type: Directive,
2854
3721
  args: [{
2855
3722
  selector: '[dbxFilterMapSourceConnector]',
@@ -2875,25 +3742,25 @@ class DbxFilterMapDirective {
2875
3742
  this.filterMap.destroy();
2876
3743
  }
2877
3744
  }
2878
- DbxFilterMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapDirective, deps: [{ token: i1$3.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
2879
- DbxFilterMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterMapDirective, selector: "[dbxFilterMap]", providers: [FilterMap], exportAs: ["dbxFilterMap"], ngImport: i0 });
2880
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapDirective, decorators: [{
3745
+ DbxFilterMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapDirective, deps: [{ token: i1$5.FilterMap }], target: i0.ɵɵFactoryTarget.Directive });
3746
+ DbxFilterMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterMapDirective, selector: "[dbxFilterMap]", providers: [FilterMap], exportAs: ["dbxFilterMap"], ngImport: i0 });
3747
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterMapDirective, decorators: [{
2881
3748
  type: Directive,
2882
3749
  args: [{
2883
3750
  selector: '[dbxFilterMap]',
2884
3751
  exportAs: 'dbxFilterMap',
2885
3752
  providers: [FilterMap]
2886
3753
  }]
2887
- }], ctorParameters: function () { return [{ type: i1$3.FilterMap }]; } });
3754
+ }], ctorParameters: function () { return [{ type: i1$5.FilterMap }]; } });
2888
3755
 
2889
3756
  /**
2890
3757
  * Basic filter source directive.
2891
3758
  */
2892
3759
  class DbxFilterSourceDirective extends AbstractFilterSourceDirective {
2893
3760
  }
2894
- DbxFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2895
- DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers: ProvideFilterSource(DbxFilterSourceDirective), usesInheritance: true, ngImport: i0 });
2896
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceDirective, decorators: [{
3761
+ DbxFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
3762
+ DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers: ProvideFilterSource(DbxFilterSourceDirective), usesInheritance: true, ngImport: i0 });
3763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxFilterSourceDirective, decorators: [{
2897
3764
  type: Directive,
2898
3765
  args: [{
2899
3766
  selector: '[dbxFilterSource]',
@@ -2903,8 +3770,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2903
3770
 
2904
3771
  class DbxCoreFilterModule {
2905
3772
  }
2906
- DbxCoreFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2907
- DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, declarations: [DbxFilterSourceDirective,
3773
+ DbxCoreFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3774
+ DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, declarations: [DbxFilterSourceDirective,
2908
3775
  DbxFilterSourceConnectorDirective,
2909
3776
  DbxFilterMapDirective,
2910
3777
  DbxFilterMapSourceConnectorDirective,
@@ -2913,10 +3780,10 @@ DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
2913
3780
  DbxFilterMapDirective,
2914
3781
  DbxFilterMapSourceConnectorDirective,
2915
3782
  DbxFilterMapSourceDirective] });
2916
- DbxCoreFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, imports: [[
3783
+ DbxCoreFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, imports: [[
2917
3784
  CommonModule
2918
3785
  ]] });
2919
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, decorators: [{
3786
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxCoreFilterModule, decorators: [{
2920
3787
  type: NgModule,
2921
3788
  args: [{
2922
3789
  imports: [
@@ -2939,14 +3806,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2939
3806
  }]
2940
3807
  }] });
2941
3808
 
2942
- const DBX_INJECTED_COMPONENT_DATA = new InjectionToken('DbxInjectedComponentConfigData');
3809
+ const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');
2943
3810
  /**
2944
3811
  * Merges multiple configurations into a single configuration.
2945
3812
  *
2946
3813
  * @param configs
2947
3814
  * @returns
2948
3815
  */
2949
- function mergeDbxInjectedComponentConfigs(configs) {
3816
+ function mergeDbxInjectionComponentConfigs(configs) {
2950
3817
  const providers = mergeArrays(filterMaybeValues(configs).map(x => x.providers));
2951
3818
  const result = mergeObjects(configs);
2952
3819
  result.providers = providers;
@@ -2956,7 +3823,7 @@ function mergeDbxInjectedComponentConfigs(configs) {
2956
3823
  /**
2957
3824
  * Instance used by components to inject content based on the configuration into the view.
2958
3825
  */
2959
- class DbxInjectedComponentInstance {
3826
+ class DbxInjectionInstance {
2960
3827
  constructor(_injector) {
2961
3828
  this._injector = _injector;
2962
3829
  this._subscriptionObject = new SubscriptionObject();
@@ -3032,7 +3899,7 @@ class DbxInjectedComponentInstance {
3032
3899
  injector = Injector.create({
3033
3900
  parent: parentInjector,
3034
3901
  providers: mergeArrayOrValueIntoArray([{
3035
- provide: DBX_INJECTED_COMPONENT_DATA,
3902
+ provide: DBX_INJECTION_COMPONENT_DATA,
3036
3903
  useValue: data
3037
3904
  }], providers !== null && providers !== void 0 ? providers : [])
3038
3905
  });
@@ -3066,10 +3933,10 @@ class DbxInjectedComponentInstance {
3066
3933
  /**
3067
3934
  * Abstract directive that injects content based on the configuration into the view.
3068
3935
  */
3069
- class AbstractDbxInjectedDirective {
3936
+ class AbstractDbxInjectionDirective {
3070
3937
  constructor(_injector) {
3071
3938
  this._injector = _injector;
3072
- this._instance = new DbxInjectedComponentInstance(this._injector);
3939
+ this._instance = new DbxInjectionInstance(this._injector);
3073
3940
  }
3074
3941
  ngOnInit() {
3075
3942
  this._instance.init();
@@ -3087,16 +3954,16 @@ class AbstractDbxInjectedDirective {
3087
3954
  this._instance.content = content;
3088
3955
  }
3089
3956
  }
3090
- AbstractDbxInjectedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxInjectedDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
3091
- AbstractDbxInjectedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxInjectedDirective, ngImport: i0 });
3092
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxInjectedDirective, decorators: [{
3957
+ AbstractDbxInjectionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxInjectionDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
3958
+ AbstractDbxInjectionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractDbxInjectionDirective, ngImport: i0 });
3959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractDbxInjectionDirective, decorators: [{
3093
3960
  type: Directive
3094
3961
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
3095
3962
 
3096
3963
  /**
3097
3964
  * Component that injects content based on the configuration into the view.
3098
3965
  */
3099
- class DbxInjectedComponent extends AbstractDbxInjectedDirective {
3966
+ class DbxInjectionComponent extends AbstractDbxInjectionDirective {
3100
3967
  set config(config) {
3101
3968
  this.setConfig(config);
3102
3969
  }
@@ -3107,12 +3974,12 @@ class DbxInjectedComponent extends AbstractDbxInjectedDirective {
3107
3974
  this.setContent(content);
3108
3975
  }
3109
3976
  }
3110
- DbxInjectedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3111
- DbxInjectedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.4", type: DbxInjectedComponent, selector: "dbx-injected-content, [dbx-injected-content]", inputs: { config: "config", template: "template" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `<ng-template #content></ng-template>`, isInline: true });
3112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponent, decorators: [{
3977
+ DbxInjectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3978
+ DbxInjectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: { config: "config", template: "template" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `<ng-template #content></ng-template>`, isInline: true });
3979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponent, decorators: [{
3113
3980
  type: Component,
3114
3981
  args: [{
3115
- selector: 'dbx-injected-content, [dbx-injected-content]',
3982
+ selector: 'dbx-injection, [dbxInjection], [dbx-injection]',
3116
3983
  template: `<ng-template #content></ng-template>`
3117
3984
  }]
3118
3985
  }], propDecorators: { config: [{
@@ -3124,28 +3991,258 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
3124
3991
  args: ['content', { static: true, read: ViewContainerRef }]
3125
3992
  }] } });
3126
3993
 
3127
- class DbxInjectedComponentModule {
3994
+ /**
3995
+ * View that can switch to show another arbitrary view, then switch back when the promise ends.
3996
+ *
3997
+ * It is similar to *ngIf/*ngSwitch, but the original child content is retained instead of discarded,
3998
+ * and returns once the special context is done being used.
3999
+ */
4000
+ class DbxInjectionContext {
4001
+ }
4002
+ /**
4003
+ * Allows a directive to provide a formly context and form.
4004
+ */
4005
+ function ProvideDbxInjectionContext(type) {
4006
+ return [{
4007
+ provide: DbxInjectionContext,
4008
+ useExisting: type
4009
+ }];
4010
+ }
4011
+
4012
+ /**
4013
+ * DbxInjectedViewContext implementation. Acts similar to *ngIf, but instead switches to a different view without destroying the original child view.
4014
+ */
4015
+ class DbxInjectionContextDirective {
4016
+ constructor(_injector, _templateRef, _viewContainer) {
4017
+ this._injector = _injector;
4018
+ this._templateRef = _templateRef;
4019
+ this._viewContainer = _viewContainer;
4020
+ this._instance = new DbxInjectionInstance(this._injector);
4021
+ this._isDetached = false;
4022
+ }
4023
+ set config(config) {
4024
+ let reattach = false;
4025
+ if (config) {
4026
+ if (!this._isDetached) {
4027
+ // detach the original view before setting config.
4028
+ this._viewContainer.detach();
4029
+ this._isDetached = true;
4030
+ }
4031
+ }
4032
+ else if (this._isDetached) {
4033
+ reattach = true;
4034
+ }
4035
+ this._instance.config = config;
4036
+ if (reattach) {
4037
+ this._viewContainer.insert(this._embeddedView);
4038
+ this._isDetached = false;
4039
+ }
4040
+ }
4041
+ ngOnInit() {
4042
+ this._instance.content = this._viewContainer;
4043
+ this._instance.init();
4044
+ this._embeddedView = this._viewContainer.createEmbeddedView(this._templateRef);
4045
+ // detach the embedded view
4046
+ this._viewContainer.detach();
4047
+ // reattach it through the template configuration.
4048
+ // the template configuration acts as the default.
4049
+ this._instance.template = {
4050
+ viewRef: this._embeddedView
4051
+ };
4052
+ }
4053
+ ngOnDestroy() {
4054
+ var _a;
4055
+ this._instance.destroy();
4056
+ (_a = this._embeddedView) === null || _a === void 0 ? void 0 : _a.destroy(); // destroy our embedded view too.
4057
+ }
4058
+ showContext(config) {
4059
+ return __awaiter(this, void 0, void 0, function* () {
4060
+ // clear the current context before showing something new.
4061
+ this.resetContext();
4062
+ let promiseRef;
4063
+ let result;
4064
+ let error;
4065
+ // wait for the promise to resolve and use to finish using that instance.
4066
+ try {
4067
+ promiseRef = makePromiseFullRef((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
4068
+ const injectionConfig = Object.assign(Object.assign({}, config.config), { init: (instance) => __awaiter(this, void 0, void 0, function* () {
4069
+ // init if available in the base config.
4070
+ if (config.config.init) {
4071
+ config.config.init(instance);
4072
+ }
4073
+ try {
4074
+ resolve(config.use(instance));
4075
+ }
4076
+ catch (e) {
4077
+ reject(e);
4078
+ }
4079
+ }) });
4080
+ this.config = injectionConfig;
4081
+ }));
4082
+ this._currentPromise = promiseRef;
4083
+ // await the promise
4084
+ yield promiseRef.promise;
4085
+ }
4086
+ catch (e) {
4087
+ error = e;
4088
+ }
4089
+ // if we're still using the same promiseRef
4090
+ if (promiseRef && promiseRef === this._currentPromise) {
4091
+ // clear the config to reshow the view
4092
+ this.config = undefined;
4093
+ // clear the current promise
4094
+ this._currentPromise = undefined;
4095
+ }
4096
+ if (error != null) {
4097
+ return Promise.reject(error);
4098
+ }
4099
+ else {
4100
+ return result;
4101
+ }
4102
+ });
4103
+ }
4104
+ resetContext() {
4105
+ let clearedValue = false;
4106
+ if (this._currentPromise) {
4107
+ const promise = this._currentPromise;
4108
+ // clear the current promise too
4109
+ this._currentPromise = undefined;
4110
+ // clear the config.
4111
+ this.config = undefined;
4112
+ // send a rejection signal to bail out.
4113
+ promise.reject(new Error('dbxInjectionContext bailout'));
4114
+ clearedValue = true;
4115
+ }
4116
+ return clearedValue;
4117
+ }
4118
+ }
4119
+ DbxInjectionContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionContextDirective, deps: [{ token: i0.Injector }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
4120
+ DbxInjectionContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DbxInjectionContextDirective, selector: "[dbxInjectionContext]", inputs: { config: "config" }, providers: ProvideDbxInjectionContext(DbxInjectionContextDirective), ngImport: i0 });
4121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionContextDirective, decorators: [{
4122
+ type: Directive,
4123
+ args: [{
4124
+ selector: '[dbxInjectionContext]',
4125
+ providers: ProvideDbxInjectionContext(DbxInjectionContextDirective)
4126
+ }]
4127
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { config: [{
4128
+ type: Input
4129
+ }] } });
4130
+
4131
+ class DbxInjectionComponentModule {
3128
4132
  }
3129
- DbxInjectedComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3130
- DbxInjectedComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, declarations: [DbxInjectedComponent], imports: [CommonModule], exports: [DbxInjectedComponent] });
3131
- DbxInjectedComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, imports: [[
4133
+ DbxInjectionComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4134
+ DbxInjectionComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, declarations: [DbxInjectionComponent,
4135
+ DbxInjectionContextDirective], imports: [CommonModule], exports: [DbxInjectionComponent,
4136
+ DbxInjectionContextDirective] });
4137
+ DbxInjectionComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, imports: [[
3132
4138
  CommonModule
3133
4139
  ]] });
3134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, decorators: [{
4140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxInjectionComponentModule, decorators: [{
3135
4141
  type: NgModule,
3136
4142
  args: [{
3137
4143
  imports: [
3138
4144
  CommonModule
3139
4145
  ],
3140
4146
  declarations: [
3141
- DbxInjectedComponent
4147
+ DbxInjectionComponent,
4148
+ DbxInjectionContextDirective
3142
4149
  ],
3143
4150
  exports: [
3144
- DbxInjectedComponent
4151
+ DbxInjectionComponent,
4152
+ DbxInjectionContextDirective
3145
4153
  ],
3146
4154
  }]
3147
4155
  }] });
3148
4156
 
4157
+ /**
4158
+ * Abstract DbxInjectionContext implementation that forwards commands to a host DbxInjectionContext.
4159
+ *
4160
+ * This abstract type is used by related types for dependency injection purposes, so that those types
4161
+ * can be injected instead of just any DbxInjectionContext.
4162
+ */
4163
+ class AbstractForwardDbxInjectionContextDirective {
4164
+ constructor(dbxInjectionContext) {
4165
+ this.dbxInjectionContext = dbxInjectionContext;
4166
+ }
4167
+ // MARK: DbxInjectionContext
4168
+ showContext(config) {
4169
+ return this.dbxInjectionContext.showContext(config);
4170
+ }
4171
+ resetContext() {
4172
+ return this.dbxInjectionContext.resetContext();
4173
+ }
4174
+ }
4175
+ AbstractForwardDbxInjectionContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractForwardDbxInjectionContextDirective, deps: [{ token: DbxInjectionContext, host: true }], target: i0.ɵɵFactoryTarget.Directive });
4176
+ AbstractForwardDbxInjectionContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: AbstractForwardDbxInjectionContextDirective, ngImport: i0 });
4177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AbstractForwardDbxInjectionContextDirective, decorators: [{
4178
+ type: Directive
4179
+ }], ctorParameters: function () {
4180
+ return [{ type: DbxInjectionContext, decorators: [{
4181
+ type: Host
4182
+ }] }];
4183
+ } });
4184
+
4185
+ /**
4186
+ * Abstract ComponentStore extension that provides a LockSet and OnDestroy delaying/cleanup.
4187
+ */
4188
+ class LockSetComponentStore extends ComponentStore {
4189
+ constructor(initialState) {
4190
+ super(initialState);
4191
+ this.initialState = initialState;
4192
+ this.lockSet = new LockSet();
4193
+ this.lockSetDestroyDelayMs = 2000;
4194
+ // MARK: State Changes
4195
+ this.resetStore = this.updater(() => (Object.assign({}, this.initialState)));
4196
+ }
4197
+ // MARK: Locks
4198
+ setupLockSet({ parent, locks }) {
4199
+ if (parent) {
4200
+ this.setParentLockSet(parent);
4201
+ }
4202
+ if (locks) {
4203
+ for (const key in locks) {
4204
+ if (locks[key]) {
4205
+ this.addLock(key, locks[key]);
4206
+ }
4207
+ }
4208
+ }
4209
+ }
4210
+ setParentLockSet(obs) {
4211
+ this.lockSet.setParentLockSet(asObservable(obs).pipe(map$1(x => x === null || x === void 0 ? void 0 : x.lockSet)));
4212
+ }
4213
+ addLock(key, obs) {
4214
+ this.lockSet.addLock(key, obs);
4215
+ }
4216
+ // MARK: Cleanup
4217
+ ngOnDestroy() {
4218
+ // Wait for any actions to complete before destroying.
4219
+ this.lockSet.destroyOnNextUnlock({
4220
+ fn: () => {
4221
+ this._destroyNow();
4222
+ },
4223
+ timeout: this.lockSetDestroyTimeoutMs,
4224
+ }, this.lockSetDestroyDelayMs);
4225
+ }
4226
+ /**
4227
+ * Completes the cleanup of the object.
4228
+ */
4229
+ _destroyNow() {
4230
+ this.lockSet.destroy();
4231
+ }
4232
+ }
4233
+ LockSetComponentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: LockSetComponentStore, deps: [{ token: null, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
4234
+ LockSetComponentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: LockSetComponentStore });
4235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: LockSetComponentStore, decorators: [{
4236
+ type: Injectable
4237
+ }], ctorParameters: function () {
4238
+ return [{ type: undefined, decorators: [{
4239
+ type: Inject,
4240
+ args: [null]
4241
+ }, {
4242
+ type: Optional
4243
+ }] }];
4244
+ } });
4245
+
3149
4246
  class StringifySimpleStorageAccessorConverter {
3150
4247
  stringifyValue(value) {
3151
4248
  return JSON.stringify(value);
@@ -3367,12 +4464,12 @@ class SimpleStorageAccessorFactory {
3367
4464
  return new SimpleStorageAccessor(delegate, accessorConfig);
3368
4465
  }
3369
4466
  }
3370
- SimpleStorageAccessorFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: SimpleStorageAccessorFactory, deps: [{ token: DEFAULT_STORAGE_OBJECT_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
3371
- SimpleStorageAccessorFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: SimpleStorageAccessorFactory });
3372
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: SimpleStorageAccessorFactory, decorators: [{
4467
+ SimpleStorageAccessorFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SimpleStorageAccessorFactory, deps: [{ token: DEFAULT_STORAGE_OBJECT_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
4468
+ SimpleStorageAccessorFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SimpleStorageAccessorFactory });
4469
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SimpleStorageAccessorFactory, decorators: [{
3373
4470
  type: Injectable
3374
4471
  }], ctorParameters: function () {
3375
- return [{ type: i1$4.FullStorageObject, decorators: [{
4472
+ return [{ type: i1$6.FullStorageObject, decorators: [{
3376
4473
  type: Inject,
3377
4474
  args: [DEFAULT_STORAGE_OBJECT_TOKEN]
3378
4475
  }] }];
@@ -3478,10 +4575,10 @@ class DbxStorageModule {
3478
4575
  };
3479
4576
  }
3480
4577
  }
3481
- DbxStorageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3482
- DbxStorageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule });
3483
- DbxStorageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule });
3484
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule, decorators: [{
4578
+ DbxStorageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4579
+ DbxStorageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule });
4580
+ DbxStorageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule });
4581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DbxStorageModule, decorators: [{
3485
4582
  type: NgModule
3486
4583
  }] });
3487
4584
 
@@ -3489,5 +4586,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
3489
4586
  * Generated bundle index. Do not edit.
3490
4587
  */
3491
4588
 
3492
- export { APP_ACTION_DISABLED_DIRECTIVE_KEY, APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, AbstractActionFilterSourceDirective, AbstractDbxActionValueOnTriggerDirective, AbstractDbxAnchorDirective, AbstractDbxButtonDirective, AbstractDbxFilterMapInstanceDirective, AbstractDbxInjectedDirective, AbstractFilterSourceConnectorDirective, AbstractFilterSourceDirective, AbstractLockSetSubscriptionDirective, AbstractSubscriptionDirective, AbstractTransitionDirective, AbstractTransitionWatcherDirective, ActionContextStore, ActionContextStoreSource, ActionContextStoreSourceMap, AnchorType, DBX_INJECTED_COMPONENT_DATA, DEFAULT_ACTION_DISABLED_KEY, DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN, DEFAULT_STORAGE_OBJECT_TOKEN, DateDistancePipe, DateFormatDistancePipe, DateFromToTimePipe, DbxActionAutoModifyDirective, DbxActionAutoTriggerDirective, DbxActionButtonDirective, DbxActionButtonTriggerDirective, DbxActionContextBaseSource, DbxActionContextLoggerDirective, DbxActionContextMachine, DbxActionContextMapDirective, DbxActionContextMapDirectiveSourceInstance, DbxActionContextStoreSourceInstance, DbxActionDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective, DbxActionFromMapDirective, DbxActionHandlerDirective, DbxActionMapSourceDirective, DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionState, DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionValueDirective, DbxActionValueOnTriggerInstance, DbxActionValueTriggerDirective, DbxActionWorkingComponent, DbxAnchor, DbxAngularRouterService, DbxButton, DbxButtonDirective, DbxButtonSegueDirective, DbxCoreActionModule, DbxCoreAngularRouterSegueModule, DbxCoreButtonModule, DbxCoreFilterModule, DbxCoreUIRouterSegueModule, DbxDatePipeModule, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterSourceDirective, DbxInjectedComponent, DbxInjectedComponentInstance, DbxInjectedComponentModule, DbxLoadingButtonDirective, DbxRouterService, DbxRouterTransitionEventType, DbxRouterTransitionService, DbxStorageModule, DbxUIRouterService, FullLocalStorageObject, InstantStorageAccessor, LimitedStorageAccessor, MemoryStorageObject, MinutesStringPipe, ProvideActionStoreSource, ProvideDbxAnchor, ProvideDbxButton, ProvideFilterSource, ProvideFilterSourceConnector, ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource, SimpleStorageAccessor, SimpleStorageAccessorFactory, StorageAccessor, StringStorageAccessor, StringifySimpleStorageAccessorConverter, TimeDistanceCountdownPipe, TimeDistancePipe, ToJsDatePipe, ToMinutesPipe, WorkHandlerContext, WorkHandlerContextSourceDelegate, WrapperSimpleStorageAccessorDelegate, actionContextHasNoErrorAndIsModifiedAndCanTrigger, actionContextIsModifiedAndCanTrigger, actionContextStoreSourceInstanceFactory, actionContextStoreSourcePipe, anchorTypeForAnchor, canReadyValue, canTriggerAction, canTriggerActionState, checkNgContentWrapperHasContent, dbxActionValueStreamDirective, defaultStorageObjectFactory, expandClickableAnchorLinkTree, expandClickableAnchorLinkTreeNode, expandClickableAnchorLinkTrees, filterTransitionEvent, filterTransitionSuccess, flattenExpandedClickableAnchorLinkTree, flattenExpandedClickableAnchorLinkTreeToLinks, handleWorkValueReadyFn, handleWorkValueReadyWithConfigFn, isActionContextDisabled, isActionContextEnabled, isDisabledActionContextState, isIdleActionState, isWorkingActionState, loadingStateForActionContextState, loadingStateTypeForActionContextState, loadingStateTypeForActionState, makeDbxActionContextSourceReference, mapRefStringObsToSegueRefObs, mergeDbxInjectedComponentConfigs, pipeActionStore, refStringToSegueRef, safeDetectChanges, successTransition, tapDetectChanges, useActionStore };
4589
+ export { APP_ACTION_DISABLED_DIRECTIVE_KEY, APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, AbstractActionFilterSourceDirective, AbstractDbxActionValueOnTriggerDirective, AbstractDbxAnchorDirective, AbstractDbxButtonDirective, AbstractDbxFilterMapInstanceDirective, AbstractDbxInjectionDirective, AbstractFilterSourceConnectorDirective, AbstractFilterSourceDirective, AbstractForwardDbxInjectionContextDirective, AbstractIfDirective, AbstractLockSetSubscriptionDirective, AbstractSubscriptionDirective, AbstractTransitionDirective, AbstractTransitionWatcherDirective, ActionContextStore, ActionContextStoreSource, ActionContextStoreSourceMap, AnchorType, DBX_APP_APP_CONTEXT_STATE, DBX_APP_AUTH_ROUTER_EFFECTS_TOKEN, DBX_AUTH_APP_CONTEXT_STATE, DBX_INIT_APP_CONTEXT_STATE, DBX_INJECTION_COMPONENT_DATA, DBX_KNOWN_APP_CONTEXT_STATES, DBX_ONBOARDING_APP_CONTEXT_STATE, DBX_PUBLIC_APP_CONTEXT_STATE, DEFAULT_ACTION_DISABLED_KEY, DEFAULT_ACTION_MAP_WORKING_DISABLED_KEY, DEFAULT_STORAGE_ACCESSOR_FACTORY_TOKEN, DEFAULT_STORAGE_OBJECT_TOKEN, DateDistancePipe, DateFormatDistancePipe, DateFromToTimePipe, DbxActionAutoModifyDirective, DbxActionAutoTriggerDirective, DbxActionButtonDirective, DbxActionButtonTriggerDirective, DbxActionContextBaseSource, DbxActionContextLoggerDirective, DbxActionContextMachine, DbxActionContextMapDirective, DbxActionContextMapDirectiveSourceInstance, DbxActionContextStoreSourceInstance, DbxActionDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective, DbxActionFromMapDirective, DbxActionHandlerDirective, DbxActionHasSuccessDirective, DbxActionIsWorkingDirective, DbxActionMapSourceDirective, DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionState, DbxActionSuccessHandlerDirective, DbxActionValueDirective, DbxActionValueOnTriggerInstance, DbxActionValueTriggerDirective, DbxActionWorkInstanceDelegate, DbxAnchor, DbxAngularRouterService, DbxAppAuthRouterEffects, DbxAppAuthRouterModule, DbxAppAuthRouterService, DbxAppAuthRouterStateModule, DbxAppAuthRoutes, DbxAppAuthStateModule, DbxAppAuthStateService, DbxAppContextService, DbxAppContextStateDirective, DbxAppContextStateModule, DbxAuthHasAnyRoleDirective, DbxAuthHasRolesDirective, DbxAuthService, DbxButton, DbxButtonDirective, DbxButtonSegueDirective, DbxCoreActionModule, DbxCoreAngularRouterSegueModule, DbxCoreAuthModule, DbxCoreButtonModule, DbxCoreFilterModule, DbxCoreUIRouterSegueModule, DbxDatePipeModule, DbxFilterMapDirective, DbxFilterMapSourceConnectorDirective, DbxFilterMapSourceDirective, DbxFilterSourceConnectorDirective, DbxFilterSourceDirective, DbxInjectionComponent, DbxInjectionComponentModule, DbxInjectionContext, DbxInjectionContextDirective, DbxInjectionInstance, DbxLoadingButtonDirective, DbxMiscPipeModule, DbxPipesModule, DbxRouterService, DbxRouterTransitionEventType, DbxRouterTransitionService, DbxStorageModule, DbxUIRouterService, FullLocalStorageObject, InstantStorageAccessor, LimitedStorageAccessor, LockSetComponentStore, MemoryStorageObject, MinutesStringPipe, NO_AUTH_USER_IDENTIFIER, PrettyJsonPipe, ProvideActionStoreSource, ProvideDbxAnchor, ProvideDbxButton, ProvideDbxInjectionContext, ProvideFilterSource, ProvideFilterSourceConnector, ProvideSecondaryActionStoreSource, SecondaryActionContextStoreSource, SimpleStorageAccessor, SimpleStorageAccessorFactory, StorageAccessor, StringStorageAccessor, StringifySimpleStorageAccessorConverter, TimeDistanceCountdownPipe, TimeDistancePipe, ToJsDatePipe, ToMinutesPipe, WrapperSimpleStorageAccessorDelegate, actionContextHasNoErrorAndIsModifiedAndCanTrigger, actionContextIsModifiedAndCanTrigger, actionContextStoreSourceInstanceFactory, actionContextStoreSourcePipe, anchorTypeForAnchor, asSegueRef, authRolesSetContainsAllRolesFrom, authRolesSetContainsAnyRoleFrom, authUserIdentifier, canReadyValue, canTriggerAction, canTriggerActionState, checkNgContentWrapperHasContent, dbxActionValueStreamDirective, defaultStorageObjectFactory, enableHasAuthRoleHook, enableHasAuthStateHook, enableIsLoggedInHook, expandClickableAnchorLinkTree, expandClickableAnchorLinkTreeNode, expandClickableAnchorLinkTrees, filterTransitionEvent, filterTransitionSuccess, flattenExpandedClickableAnchorLinkTree, flattenExpandedClickableAnchorLinkTreeToLinks, index as fromDbxAppAuth, index$2 as fromDbxAppContext, goWithRouter, isActionContextDisabled, isActionContextEnabled, isDisabledActionContextState, isIdleActionState, isSegueRef, isWorkingActionState, loadingStateForActionContextState, loadingStateTypeForActionContextState, loadingStateTypeForActionState, loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, makeAuthTransitionHook, makeDbxActionContextSourceReference, mapRefStringObsToSegueRefObs, mergeDbxInjectionComponentConfigs, index$1 as onDbxAppAuth, index$3 as onDbxAppContext, pipeActionStore, readSegueRefString, redirectBasedOnAuthUserState, refStringToSegueRef, safeDetectChanges, safeMarkForCheck, safeUseCdRef, successTransition, tapDetectChanges, useActionStore };
3493
4590
  //# sourceMappingURL=dereekb-dbx-core.mjs.map