@dereekb/dbx-core 2.0.0 → 4.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 (237) 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 +4 -4
  22. package/esm2020/lib/action/directive/state/action.value.trigger.directive.mjs +73 -0
  23. package/esm2020/lib/action/directive/state/action.value.trigger.instance.mjs +43 -0
  24. package/esm2020/lib/action/directive/state/action.working.component.mjs +28 -22
  25. package/esm2020/lib/action/directive/state/index.mjs +4 -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 +1742 -538
  131. package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
  132. package/fesm2020/dereekb-dbx-core.mjs +1748 -544
  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.stream.directive.d.ts +2 -2
  144. package/lib/action/directive/state/action.value.trigger.directive.d.ts +34 -0
  145. package/lib/action/directive/state/action.value.trigger.instance.d.ts +34 -0
  146. package/lib/action/directive/state/action.working.component.d.ts +11 -5
  147. package/lib/action/directive/state/index.d.ts +3 -1
  148. package/lib/auth/auth.module.d.ts +8 -0
  149. package/lib/auth/auth.role.any.directive.d.ts +20 -0
  150. package/lib/auth/auth.role.has.directive.d.ts +20 -0
  151. package/lib/auth/auth.state.module.d.ts +8 -0
  152. package/lib/auth/auth.state.service.d.ts +13 -0
  153. package/lib/auth/auth.user.d.ts +28 -0
  154. package/lib/auth/index.d.ts +9 -0
  155. package/lib/auth/router/auth.router.d.ts +10 -0
  156. package/lib/auth/router/auth.router.module.d.ts +9 -0
  157. package/lib/auth/router/auth.router.service.d.ts +38 -0
  158. package/lib/auth/router/index.d.ts +5 -0
  159. package/lib/auth/router/provider/uirouter/auth.hook.d.ts +18 -0
  160. package/lib/auth/router/provider/uirouter/hook.d.ts +46 -0
  161. package/lib/auth/router/provider/uirouter/index.d.ts +5 -0
  162. package/lib/auth/router/provider/uirouter/redirect.d.ts +9 -0
  163. package/lib/auth/router/provider/uirouter/role.hook.d.ts +26 -0
  164. package/lib/auth/router/provider/uirouter/state.hook.d.ts +31 -0
  165. package/lib/auth/router/state/auth.router.state.module.d.ts +14 -0
  166. package/lib/auth/router/state/effect/auth.router.state.effect.d.ts +32 -0
  167. package/lib/auth/router/state/effect/index.d.ts +1 -0
  168. package/lib/auth/router/state/index.d.ts +2 -0
  169. package/lib/auth/service/auth.service.d.ts +46 -0
  170. package/lib/auth/service/auth.service.rxjs.d.ts +18 -0
  171. package/lib/auth/service/index.d.ts +2 -0
  172. package/lib/auth/state/action/auth.action.d.ts +12 -0
  173. package/lib/auth/state/action/index.d.ts +11 -0
  174. package/lib/auth/state/action/user.action.d.ts +34 -0
  175. package/lib/auth/state/effect/auth.effect.d.ts +31 -0
  176. package/lib/auth/state/index.d.ts +12 -0
  177. package/lib/auth/state/reducer/index.d.ts +29 -0
  178. package/lib/auth/state/reducer/user.reducer.d.ts +11 -0
  179. package/lib/auth/state/state.d.ts +5 -0
  180. package/lib/button/button.d.ts +3 -3
  181. package/lib/button/router/button.segue.directive.d.ts +1 -0
  182. package/lib/context/context.d.ts +39 -0
  183. package/lib/context/context.directive.d.ts +19 -0
  184. package/lib/context/context.module.d.ts +8 -0
  185. package/lib/context/context.service.d.ts +16 -0
  186. package/lib/context/index.d.ts +5 -0
  187. package/lib/context/state/action/data.action.d.ts +13 -0
  188. package/lib/context/state/action/index.d.ts +6 -0
  189. package/lib/context/state/effect/index.d.ts +39 -0
  190. package/lib/context/state/index.d.ts +12 -0
  191. package/lib/context/state/reducer/data.reducer.d.ts +13 -0
  192. package/lib/context/state/reducer/index.d.ts +34 -0
  193. package/lib/context/state/state.d.ts +9 -0
  194. package/lib/filter/filter.abstract.source.directive.d.ts +2 -2
  195. package/lib/index.d.ts +5 -1
  196. package/lib/injection/index.d.ts +8 -0
  197. package/lib/injection/injection.component.d.ts +15 -0
  198. package/lib/injection/injection.component.module.d.ts +9 -0
  199. package/lib/injection/injection.context.d.ts +39 -0
  200. package/lib/injection/injection.context.directive.d.ts +25 -0
  201. package/lib/injection/injection.context.forward.directive.d.ts +16 -0
  202. package/lib/{injected/injected.d.ts → injection/injection.d.ts} +4 -4
  203. package/lib/injection/injection.directive.d.ts +19 -0
  204. package/lib/{injected/injected.instance.d.ts → injection/injection.instance.d.ts} +8 -8
  205. package/lib/ngrx/index.d.ts +1 -0
  206. package/lib/ngrx/store.lockset.d.ts +36 -0
  207. package/lib/pipe/index.d.ts +2 -0
  208. package/lib/pipe/misc/index.d.ts +2 -0
  209. package/lib/pipe/misc/misc.pipe.module.d.ts +7 -0
  210. package/lib/pipe/misc/prettyjson.pipe.d.ts +9 -0
  211. package/lib/pipe/pipe.module.d.ts +8 -0
  212. package/lib/router/anchor/anchor.d.ts +5 -1
  213. package/lib/router/anchor/anchor.directive.d.ts +10 -2
  214. package/lib/router/router/provider/angular/angular.router.service.d.ts +7 -5
  215. package/lib/router/router/provider/uirouter/uirouter.router.service.d.ts +11 -5
  216. package/lib/router/router/service/index.d.ts +1 -0
  217. package/lib/router/router/service/router.go.d.ts +14 -0
  218. package/lib/router/router/service/router.service.d.ts +10 -4
  219. package/lib/router/router/transition/transition.directive.d.ts +2 -2
  220. package/lib/router/router/transition/transition.watcher.directive.d.ts +1 -1
  221. package/lib/router/segue.d.ts +10 -3
  222. package/lib/util/view.d.ts +12 -0
  223. package/lib/view/if.directive.d.ts +19 -0
  224. package/lib/view/index.d.ts +1 -0
  225. package/package.json +7 -19
  226. package/esm2020/lib/action/directive/state/action.success.component.mjs +0 -50
  227. package/esm2020/lib/injected/index.mjs +0 -6
  228. package/esm2020/lib/injected/injected.component.mjs +0 -34
  229. package/esm2020/lib/injected/injected.component.module.mjs +0 -26
  230. package/esm2020/lib/injected/injected.directive.mjs +0 -33
  231. package/esm2020/lib/injected/injected.instance.mjs +0 -116
  232. package/esm2020/lib/injected/injected.mjs +0 -16
  233. package/lib/action/directive/state/action.success.component.d.ts +0 -15
  234. package/lib/injected/index.d.ts +0 -5
  235. package/lib/injected/injected.component.d.ts +0 -15
  236. package/lib/injected/injected.component.module.d.ts +0 -8
  237. 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, 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, tap as tap$1, filter as filter$1, startWith as startWith$1, switchMap as switchMap$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,115 @@ 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']
1410
+ }] } });
1411
+
1412
+ /**
1413
+ * Utility class that handles trigger events to retrieve a value.
1414
+ */
1415
+ class DbxActionValueOnTriggerInstance {
1416
+ constructor(config) {
1417
+ this._valueGetter = new BehaviorSubject(undefined);
1418
+ this.valueGetter$ = this._valueGetter.pipe(filterMaybe());
1419
+ this._triggeredSub = new SubscriptionObject();
1420
+ this.source = config.source;
1421
+ this._valueGetter.next(config.valueGetter);
1422
+ }
1423
+ get valueGetter() {
1424
+ return this._valueGetter.value;
1425
+ }
1426
+ set valueGetter(valueGetter) {
1427
+ this._valueGetter.next(valueGetter);
1428
+ }
1429
+ init() {
1430
+ // Ready the value after the source is triggered. Do modified check one last time.
1431
+ this._triggeredSub.subscription = this.source.triggered$.pipe(switchMap$1(() => this.valueGetter$.pipe(switchMap$1((valueGetter) => asObservable(valueGetter())))
1432
+ .pipe(
1433
+ // If the value is not null/undefined and is considered modified, then pass the value.
1434
+ switchMap$1((value) => returnIfIs(this.isModifiedFunction, value, false).pipe(map$1((value) => ({ value })))),
1435
+ // Catch any errors and pass them to reject.
1436
+ catchError((reject) => of({ reject }))))).subscribe((result) => {
1437
+ if (result.value != null) {
1438
+ this.source.readyValue(result.value);
1439
+ }
1440
+ else {
1441
+ this.source.reject(result.reject);
1442
+ }
1443
+ });
1444
+ }
1445
+ destroy() {
1446
+ this.source.lockSet.onNextUnlock(() => {
1447
+ this._triggeredSub.destroy();
1448
+ this._valueGetter.complete();
1449
+ });
1450
+ }
1451
+ }
1452
+
1453
+ /**
1454
+ * Abstract class for directives that may perform an action when trigger is called, and returns a value.
1455
+ */
1456
+ class AbstractDbxActionValueOnTriggerDirective {
1457
+ constructor(source, valueGetter) {
1458
+ this.source = source;
1459
+ this._triggeredSub = new SubscriptionObject();
1460
+ this._instance = new DbxActionValueOnTriggerInstance({
1461
+ source: this.source,
1462
+ valueGetter
1463
+ });
1464
+ }
1465
+ get valueGetter() {
1466
+ return this._instance.valueGetter;
1467
+ }
1468
+ set valueGetter(valueGetter) {
1469
+ this._instance.valueGetter = valueGetter;
1470
+ }
1471
+ get isModifiedFunction() {
1472
+ return this._instance.isModifiedFunction;
1473
+ }
1474
+ set isModifiedFunction(isModifiedFunction) {
1475
+ this._instance.isModifiedFunction = isModifiedFunction;
1476
+ }
1477
+ ngOnInit() {
1478
+ this._instance.init();
1479
+ }
1480
+ ngOnDestroy() {
1481
+ this._instance.destroy();
1482
+ this._triggeredSub.destroy();
1483
+ }
1484
+ }
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: [{
1488
+ type: Directive
1489
+ }], ctorParameters: function () { return [{ type: DbxActionContextStoreSourceInstance }, { type: undefined }]; } });
1490
+ /**
1491
+ * Action directive that is used to trigger/display a popover, then watches that popover for a value.
1492
+ */
1493
+ class DbxActionValueTriggerDirective extends AbstractDbxActionValueOnTriggerDirective {
1494
+ constructor(elementRef, source) {
1495
+ super(source);
1496
+ this.elementRef = elementRef;
1497
+ }
1498
+ set dbxActionValueOnTrigger(dbxActionValueTrigger) {
1499
+ this.valueGetter = dbxActionValueTrigger;
1500
+ }
1501
+ set dbxActionValueTriggerModified(isModifiedFunction) {
1502
+ this.isModifiedFunction = isModifiedFunction;
1503
+ }
1504
+ }
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: [{
1508
+ type: Directive,
1509
+ args: [{
1510
+ exportAs: 'dbxActionValueOnTrigger',
1511
+ selector: '[dbxActionValueOnTrigger]'
1512
+ }]
1513
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DbxActionContextStoreSourceInstance }]; }, propDecorators: { dbxActionValueOnTrigger: [{
1514
+ type: Input,
1515
+ args: ['dbxActionValueOnTrigger']
1516
+ }], dbxActionValueTriggerModified: [{
1517
+ type: Input
1509
1518
  }] } });
1510
1519
 
1511
1520
  /**
@@ -1522,14 +1531,15 @@ class DbxActionContextMachine extends DbxActionContextBaseSource {
1522
1531
  this._successSub = new SubscriptionObject();
1523
1532
  // Handle Value Ready
1524
1533
  this._handleValueReadySub.subscription = this.sourceInstance.valueReady$.subscribe((value) => {
1525
- handleWorkValueReadyFn({
1526
- handlerFunction: config.handleValueReady,
1527
- delegate: new WorkHandlerContextSourceDelegate(this.sourceInstance)
1528
- })(value);
1534
+ const doWork = workFactory({
1535
+ work: config.handleValueReady,
1536
+ delegate: new DbxActionWorkInstanceDelegate(this.sourceInstance)
1537
+ });
1538
+ doWork(value);
1529
1539
  });
1530
1540
  // If this is a one-time use, then destroy it after the first success comes through.
1531
1541
  if (this.config.oneTimeUse) {
1532
- this.sourceInstance.success$.pipe(first(), delay(1000)).subscribe(() => {
1542
+ this.sourceInstance.success$.pipe(first(), delay$1(1000)).subscribe(() => {
1533
1543
  this.destroy();
1534
1544
  });
1535
1545
  }
@@ -1550,18 +1560,18 @@ class DbxActionContextMachine extends DbxActionContextBaseSource {
1550
1560
 
1551
1561
  class DbxCoreActionModule {
1552
1562
  }
1553
- DbxCoreActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1554
- 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,
1555
1565
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1556
1566
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1557
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent], imports: [CommonModule], exports: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1567
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective], imports: [CommonModule], exports: [DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1558
1568
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1559
1569
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1560
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent] });
1561
- 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: [[
1562
1572
  CommonModule
1563
1573
  ]] });
1564
- 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: [{
1565
1575
  type: NgModule,
1566
1576
  args: [{
1567
1577
  imports: [
@@ -1571,13 +1581,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1571
1581
  DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1572
1582
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1573
1583
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1574
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent,
1584
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective,
1575
1585
  ],
1576
1586
  exports: [
1577
1587
  DbxActionDirective, DbxActionContextMapDirective, DbxActionFromMapDirective, DbxActionMapSourceDirective,
1578
1588
  DbxActionMapWorkingDisableDirective, DbxActionSourceDirective, DbxActionHandlerDirective, DbxActionDisabledDirective, DbxActionEnforceModifiedDirective,
1579
1589
  DbxActionAutoTriggerDirective, dbxActionValueStreamDirective, DbxActionAutoModifyDirective, DbxActionValueDirective, DbxActionContextLoggerDirective,
1580
- DbxActionSuccessComponent, DbxActionSuccessDirective, DbxActionWorkingComponent
1590
+ DbxActionHasSuccessDirective, DbxActionSuccessHandlerDirective, DbxActionIsWorkingDirective
1581
1591
  ]
1582
1592
  }]
1583
1593
  }] });
@@ -1590,128 +1600,412 @@ function makeDbxActionContextSourceReference(sourceInstance) {
1590
1600
  }
1591
1601
 
1592
1602
  /**
1593
- * Convenience function used within observables for views that need to detect changes after a value changes.
1594
- *
1595
- * @param cdRef
1596
- * @param timeout
1597
- * @returns
1603
+ * Client auth service used to retrieve info about the current state of client authentication and client roles they may have.
1598
1604
  */
1599
- function tapDetectChanges(cdRef, timeout = 0) {
1600
- return tap$1(() => setTimeout(() => safeDetectChanges(cdRef), timeout));
1605
+ class DbxAuthService {
1601
1606
  }
1607
+
1602
1608
  /**
1603
- * Triggers a detection change on the input view as long as the view has not been destroyed.
1604
- *
1605
- * @param cdRef
1609
+ * This generates a TransitionHookFn that can be used with redirecting routes.
1606
1610
  */
1607
- function safeDetectChanges(cdRef) {
1608
- if (!cdRef.destroyed) {
1609
- cdRef.detectChanges();
1610
- }
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;
1611
1668
  }
1669
+
1612
1670
  /**
1613
- * Used to check an injected ElementRef that wraps an ng-content injection point whether or not any content was injected,
1614
- * or more specifically if the parent component passed any target content to the child. This will still return true if
1615
- * passed content is empty.
1616
- *
1617
- * TS:
1618
- * @ViewChild('customLoading', { static: false }) customCustom: ElementRef;
1671
+ * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.
1619
1672
  *
1620
- * HTML:
1621
- * <div #customContent>
1622
- * <ng-content select="[content]"></ng-content>
1623
- * </div>
1673
+ * @param stateMap
1674
+ * @returns
1624
1675
  */
1625
- function checkNgContentWrapperHasContent(ref) {
1626
- // https://github.com/angular/angular/issues/26083
1627
- let hasContent = false;
1628
- if (ref != null) {
1629
- const childNodes = ref.nativeElement.childNodes;
1630
- const hasChildNodes = childNodes && childNodes.length > 0;
1631
- hasContent = Boolean(hasChildNodes);
1632
- }
1633
- 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
+ };
1634
1695
  }
1635
1696
 
1636
- class DbxButton {
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 });
1637
1714
  }
1638
- function ProvideDbxButton(sourceType) {
1639
- return [{
1640
- provide: DbxButton,
1641
- useExisting: forwardRef(() => sourceType)
1642
- }];
1715
+
1716
+ /**
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
1721
+ */
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 });
1643
1740
  }
1644
1741
 
1645
1742
  /**
1646
- * Context used for linking a button to an ActionContext and only look for triggers.
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
1647
1747
  */
1648
- class DbxActionButtonTriggerDirective extends AbstractSubscriptionDirective {
1649
- constructor(button, source) {
1650
- super();
1651
- this.button = button;
1652
- this.source = source;
1653
- }
1654
- ngOnInit() {
1655
- this.sub = this.button.clicked$.subscribe(() => {
1656
- this._buttonClicked();
1657
- });
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
+ };
1658
1777
  }
1659
- _buttonClicked() {
1660
- this.source.trigger();
1778
+ else {
1779
+ return input;
1661
1780
  }
1662
1781
  }
1663
- 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 });
1664
- DbxActionButtonTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionButtonTriggerDirective, selector: "[dbxActionButtonTrigger]", usesInheritance: true, ngImport: i0 });
1665
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonTriggerDirective, decorators: [{
1666
- type: Directive,
1667
- args: [{
1668
- selector: '[dbxActionButtonTrigger]'
1669
- }]
1670
- }], ctorParameters: function () {
1671
- return [{ type: DbxButton, decorators: [{
1672
- type: Host
1673
- }] }, { type: DbxActionContextStoreSourceInstance }];
1674
- } });
1782
+ function toParsedHasAuthStateConfig(input) {
1783
+ return {
1784
+ allowed: maybeSet(input.allowedStates),
1785
+ disallowed: maybeSet(input.disallowedStates)
1786
+ };
1787
+ }
1675
1788
 
1789
+ const DBX_INIT_APP_CONTEXT_STATE = 'init';
1676
1790
  /**
1677
- * Context used for linking a button to an ActionContext.
1791
+ *
1678
1792
  */
1679
- class DbxActionButtonDirective extends DbxActionButtonTriggerDirective {
1680
- constructor(button, source, cdRef) {
1681
- super(button, source);
1682
- this.cdRef = cdRef;
1683
- this._workingSub = new SubscriptionObject();
1684
- this._disabledSub = new SubscriptionObject();
1685
- }
1686
- ngOnInit() {
1687
- super.ngOnInit();
1688
- this._workingSub.subscription = this.source.isWorking$.subscribe((working) => {
1689
- this.button.working = working;
1690
- safeDetectChanges(this.cdRef);
1691
- });
1692
- this._disabledSub.subscription = this.source.isDisabled$.subscribe((disabled) => {
1693
- this.button.disabled = disabled;
1694
- safeDetectChanges(this.cdRef);
1695
- });
1793
+ const DBX_PUBLIC_APP_CONTEXT_STATE = 'public';
1794
+ /**
1795
+ *
1796
+ */
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);
1696
1896
  }
1697
- ngOnDestroy() {
1698
- super.ngOnDestroy();
1699
- this._workingSub.destroy();
1700
- this._disabledSub.destroy();
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)))))));
1701
1907
  }
1702
1908
  }
1703
- 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 });
1704
- DbxActionButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxActionButtonDirective, selector: "[dbxActionButton]", usesInheritance: true, ngImport: i0 });
1705
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxActionButtonDirective, decorators: [{
1706
- type: Directive,
1707
- args: [{
1708
- selector: '[dbxActionButton]'
1709
- }]
1710
- }], ctorParameters: function () {
1711
- return [{ type: DbxButton, decorators: [{
1712
- type: Host
1713
- }] }, { type: DbxActionContextStoreSourceInstance }, { type: i0.ChangeDetectorRef }];
1714
- } });
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
+ });
1715
2009
 
1716
2010
  const expandClickableAnchorLinkTreeNode = expandTreeFunction({
1717
2011
  getChildren: (x) => x.children
@@ -1774,6 +2068,28 @@ function ProvideDbxAnchor(sourceType) {
1774
2068
  }];
1775
2069
  }
1776
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
+
1777
2093
  /**
1778
2094
  * Abstract anchor directive.
1779
2095
  */
@@ -1783,7 +2099,17 @@ class AbstractDbxAnchorDirective {
1783
2099
  this._anchor = new BehaviorSubject(undefined);
1784
2100
  this.disabled$ = this._disabled.asObservable();
1785
2101
  this.anchor$ = this._anchor.pipe(skipFirstMaybe(), distinctUntilChanged(), shareReplay(1));
1786
- 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);
1787
2113
  }
1788
2114
  get anchor() {
1789
2115
  return this._anchor.value;
@@ -1798,11 +2124,13 @@ class AbstractDbxAnchorDirective {
1798
2124
  this._disabled.next(disabled);
1799
2125
  }
1800
2126
  }
1801
- AbstractDbxAnchorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxAnchorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1802
- AbstractDbxAnchorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxAnchorDirective, inputs: { anchor: "anchor", disabled: "disabled" }, ngImport: i0 });
1803
- 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: [{
1804
2130
  type: Directive
1805
- }], propDecorators: { anchor: [{
2131
+ }], ctorParameters: function () { return []; }, propDecorators: { ref: [{
2132
+ type: Input
2133
+ }], anchor: [{
1806
2134
  type: Input
1807
2135
  }], disabled: [{
1808
2136
  type: Input
@@ -1827,6 +2155,7 @@ class DbxAngularRouterService {
1827
2155
  constructor(router, activatedRoute) {
1828
2156
  this.router = router;
1829
2157
  this.activatedRoute = activatedRoute;
2158
+ this.params$ = this.activatedRoute.params;
1830
2159
  this.transitions$ = this.router.events.pipe(map((x) => {
1831
2160
  let event;
1832
2161
  if (x instanceof NavigationStart) {
@@ -1842,7 +2171,8 @@ class DbxAngularRouterService {
1842
2171
  return event;
1843
2172
  }), filterMaybe());
1844
2173
  }
1845
- go(segueRef) {
2174
+ go(input) {
2175
+ const segueRef = asSegueRef(input);
1846
2176
  let ref = segueRef.ref;
1847
2177
  if (isArray(ref)) {
1848
2178
  return this.router.navigate(ref, Object.assign(Object.assign({}, segueRef.refOptions), { queryParams: segueRef.refParams }));
@@ -1858,9 +2188,9 @@ class DbxAngularRouterService {
1858
2188
  return 0; // TODO!
1859
2189
  }
1860
2190
  }
1861
- 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 });
1862
- DbxAngularRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxAngularRouterService });
1863
- 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: [{
1864
2194
  type: Injectable
1865
2195
  }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
1866
2196
 
@@ -1870,6 +2200,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
1870
2200
  class DbxRouterService {
1871
2201
  }
1872
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
+
1873
2215
  /**
1874
2216
  * Router service definition that provides high level information about router transitions.
1875
2217
  */
@@ -1894,10 +2236,10 @@ class DbxCoreAngularRouterSegueModule {
1894
2236
  };
1895
2237
  }
1896
2238
  }
1897
- DbxCoreAngularRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1898
- DbxCoreAngularRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
1899
- DbxCoreAngularRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreAngularRouterSegueModule });
1900
- 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: [{
1901
2243
  type: NgModule,
1902
2244
  args: [{}]
1903
2245
  }] });
@@ -1947,12 +2289,15 @@ class DbxUIRouterService {
1947
2289
  this.state = state;
1948
2290
  this.transitionService = transitionService;
1949
2291
  this.uiRouterGlobals = uiRouterGlobals;
2292
+ this._params = new BehaviorSubject(this.uiRouterGlobals.params);
2293
+ this.params$ = this._params.asObservable();
1950
2294
  this._transitions = new Subject();
1951
2295
  this.transitions$ = this._transitions.asObservable();
1952
2296
  const emitTransition = (type) => {
1953
2297
  this._transitions.next({
1954
2298
  type
1955
2299
  });
2300
+ this._params.next(this.uiRouterGlobals.params);
1956
2301
  };
1957
2302
  this.transitionService.onStart({}, () => {
1958
2303
  emitTransition(DbxRouterTransitionEventType.START);
@@ -1961,27 +2306,46 @@ class DbxUIRouterService {
1961
2306
  emitTransition(DbxRouterTransitionEventType.SUCCESS);
1962
2307
  });
1963
2308
  }
1964
- 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);
1965
2317
  const params = Object.assign(Object.assign({}, this.uiRouterGlobals.current.params), segueRef.refParams);
1966
2318
  return this.state.go(segueRef.ref, params, segueRef.refOptions).then(_ => true).catch(_ => false);
1967
2319
  }
1968
- isActive(segueRef) {
2320
+ isActive(input) {
2321
+ const segueRef = asSegueRef(input);
1969
2322
  const { ref, refParams } = segueRef;
1970
2323
  const targetRef = (ref.startsWith('.') ? `^${ref}` : ref);
1971
2324
  const active = this.state.includes(targetRef, refParams);
1972
2325
  return active;
1973
2326
  }
1974
- comparePrecision(a, b) {
1975
- const aLength = a.ref.length;
1976
- 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;
1977
2332
  return (aLength > bLength) ? 1 : (aLength === bLength) ? 0 : -1;
1978
2333
  }
1979
2334
  }
1980
- 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 });
1981
- DbxUIRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxUIRouterService });
1982
- 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: [{
1983
2338
  type: Injectable
1984
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
+ }
1985
2349
 
1986
2350
  class DbxCoreUIRouterSegueModule {
1987
2351
  static forRoot() {
@@ -2001,10 +2365,10 @@ class DbxCoreUIRouterSegueModule {
2001
2365
  };
2002
2366
  }
2003
2367
  }
2004
- DbxCoreUIRouterSegueModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2005
- DbxCoreUIRouterSegueModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2006
- DbxCoreUIRouterSegueModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreUIRouterSegueModule });
2007
- 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: [{
2008
2372
  type: NgModule,
2009
2373
  args: [{}]
2010
2374
  }] });
@@ -2018,63 +2382,523 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2018
2382
  function successTransition(obs) {
2019
2383
  return obs.pipe(filterTransitionSuccess());
2020
2384
  }
2021
- function filterTransitionSuccess() {
2022
- 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 {
2023
2824
  }
2024
- function filterTransitionEvent(type) {
2025
- return filter$1(x => x.type === type);
2825
+ function ProvideDbxButton(sourceType) {
2826
+ return [{
2827
+ provide: DbxButton,
2828
+ useExisting: forwardRef(() => sourceType)
2829
+ }];
2026
2830
  }
2027
2831
 
2028
2832
  /**
2029
- * 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.
2030
2834
  */
2031
- class AbstractTransitionDirective {
2032
- constructor(dbNgxRouterTransitionService) {
2033
- this.dbNgxRouterTransitionService = dbNgxRouterTransitionService;
2034
- this.transitionSuccess$ = successTransition(this.dbNgxRouterTransitionService.transitions$);
2035
- 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();
2036
2848
  }
2037
2849
  }
2038
- AbstractTransitionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionDirective, deps: [{ token: DbxRouterTransitionService }], target: i0.ɵɵFactoryTarget.Directive });
2039
- AbstractTransitionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractTransitionDirective, ngImport: i0 });
2040
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionDirective, decorators: [{
2041
- type: Directive
2042
- }], 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
+ } });
2043
2862
 
2044
2863
  /**
2045
- * Abstract directive that listens to onSuccess transition events and runs a function.
2864
+ * Context used for linking a button to an ActionContext.
2046
2865
  */
2047
- class AbstractTransitionWatcherDirective extends AbstractTransitionDirective {
2048
- constructor(dbNgxRouterTransitionService, ngZone) {
2049
- super(dbNgxRouterTransitionService);
2050
- this.ngZone = ngZone;
2051
- 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();
2052
2872
  }
2053
2873
  ngOnInit() {
2054
- this._transitionSub.subscription = this.transitionSuccess$.subscribe(() => {
2055
- 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);
2056
2882
  });
2057
2883
  }
2058
2884
  ngOnDestroy() {
2059
- this._transitionSub.destroy();
2060
- }
2061
- // MARK: Action
2062
- zoneUpdateForSuccessfulTransition() {
2063
- this.ngZone.run(() => this.updateForSuccessfulTransition());
2885
+ super.ngOnDestroy();
2886
+ this._workingSub.destroy();
2887
+ this._disabledSub.destroy();
2064
2888
  }
2065
2889
  }
2066
- 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 });
2067
- AbstractTransitionWatcherDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractTransitionWatcherDirective, usesInheritance: true, ngImport: i0 });
2068
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractTransitionWatcherDirective, decorators: [{
2069
- type: Directive
2070
- }], ctorParameters: function () { return [{ type: DbxRouterTransitionService }, { type: i0.NgZone }]; } });
2071
-
2072
- function refStringToSegueRef(ref, options) {
2073
- return Object.assign(Object.assign({}, options), { ref });
2074
- }
2075
- function mapRefStringObsToSegueRefObs(obs, options) {
2076
- return obs.pipe(map(x => refStringToSegueRef(x, options)));
2077
- }
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
+ } });
2078
2902
 
2079
2903
  // MARK: Button Directives
2080
2904
  class DbxButtonSegueDirective extends AbstractSubscriptionDirective {
@@ -2096,10 +2920,14 @@ class DbxButtonSegueDirective extends AbstractSubscriptionDirective {
2096
2920
  this.dbxRouterService.go(segueRef);
2097
2921
  })))).subscribe();
2098
2922
  }
2923
+ ngOnDestroy() {
2924
+ super.ngOnDestroy();
2925
+ this._segueRef.complete();
2926
+ }
2099
2927
  }
2100
- 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 });
2101
- DbxButtonSegueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxButtonSegueDirective, selector: "[dbxButtonSegue]", inputs: { segueRef: ["dbxButtonSegue", "segueRef"] }, usesInheritance: true, ngImport: i0 });
2102
- 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: [{
2103
2931
  type: Directive,
2104
2932
  args: [{
2105
2933
  selector: '[dbxButtonSegue]'
@@ -2180,9 +3008,9 @@ class AbstractDbxButtonDirective extends AbstractSubscriptionDirective {
2180
3008
  this.buttonClick.emit();
2181
3009
  }
2182
3010
  }
2183
- AbstractDbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2184
- 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 });
2185
- 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: [{
2186
3014
  type: Directive
2187
3015
  }], ctorParameters: function () { return []; }, propDecorators: { disabled: [{
2188
3016
  type: Input
@@ -2201,9 +3029,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2201
3029
  */
2202
3030
  class DbxButtonDirective extends AbstractDbxButtonDirective {
2203
3031
  }
2204
- DbxButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2205
- 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 });
2206
- 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: [{
2207
3035
  type: Directive,
2208
3036
  args: [{
2209
3037
  selector: '[dbxButton]',
@@ -2236,9 +3064,9 @@ class DbxLoadingButtonDirective extends AbstractSubscriptionDirective {
2236
3064
  this.sub = subscription;
2237
3065
  }
2238
3066
  }
2239
- 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 });
2240
- DbxLoadingButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxLoadingButtonDirective, selector: "[dbxLoadingButton]", inputs: { context: ["dbxLoadingButton", "context"] }, usesInheritance: true, ngImport: i0 });
2241
- 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: [{
2242
3070
  type: Directive,
2243
3071
  args: [{
2244
3072
  selector: '[dbxLoadingButton]'
@@ -2254,8 +3082,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2254
3082
 
2255
3083
  class DbxCoreButtonModule {
2256
3084
  }
2257
- DbxCoreButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2258
- 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,
2259
3087
  DbxLoadingButtonDirective,
2260
3088
  DbxActionButtonTriggerDirective,
2261
3089
  DbxActionButtonDirective,
@@ -2264,8 +3092,8 @@ DbxCoreButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
2264
3092
  DbxActionButtonTriggerDirective,
2265
3093
  DbxActionButtonDirective,
2266
3094
  DbxButtonSegueDirective] });
2267
- DbxCoreButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreButtonModule, imports: [[]] });
2268
- 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: [{
2269
3097
  type: NgModule,
2270
3098
  args: [{
2271
3099
  imports: [],
@@ -2286,6 +3114,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2286
3114
  }]
2287
3115
  }] });
2288
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
+
2289
3197
  /**
2290
3198
  * Pipe that takes in a date and number of minutes and outputs a formatted date.
2291
3199
  */
@@ -2306,9 +3214,9 @@ class DateFromToTimePipe {
2306
3214
  return undefined;
2307
3215
  }
2308
3216
  }
2309
- DateFromToTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
2310
- DateFromToTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFromToTimePipe, name: "dateFromPlusTo" });
2311
- 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: [{
2312
3220
  type: Pipe,
2313
3221
  args: [{ name: 'dateFromPlusTo' }]
2314
3222
  }], ctorParameters: function () {
@@ -2341,24 +3249,31 @@ class MinutesStringPipe {
2341
3249
  }
2342
3250
  }
2343
3251
  }
2344
- MinutesStringPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2345
- MinutesStringPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: MinutesStringPipe, name: "minutesString", pure: false });
2346
- 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: [{
2347
3255
  type: Pipe,
2348
3256
  args: [{ name: 'minutesString', pure: false }]
2349
3257
  }] });
2350
3258
 
2351
3259
  class ToJsDatePipe {
2352
3260
  static toJsDate(input) {
2353
- 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;
2354
3269
  }
2355
3270
  transform(input) {
2356
3271
  return ToJsDatePipe.toJsDate(input);
2357
3272
  }
2358
3273
  }
2359
- ToJsDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2360
- ToJsDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToJsDatePipe, name: "toJsDate" });
2361
- 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: [{
2362
3277
  type: Pipe,
2363
3278
  args: [{ name: 'toJsDate' }]
2364
3279
  }] });
@@ -2382,9 +3297,9 @@ class TimeDistanceCountdownPipe {
2382
3297
  }
2383
3298
  }
2384
3299
  }
2385
- TimeDistanceCountdownPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2386
- TimeDistanceCountdownPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistanceCountdownPipe, name: "timeCountdownDistance", pure: false });
2387
- 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: [{
2388
3303
  type: Pipe,
2389
3304
  args: [{ name: 'timeCountdownDistance', pure: false }]
2390
3305
  }] });
@@ -2401,9 +3316,9 @@ class TimeDistancePipe {
2401
3316
  }
2402
3317
  }
2403
3318
  }
2404
- TimeDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2405
- TimeDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: TimeDistancePipe, name: "timeDistance", pure: false });
2406
- 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: [{
2407
3322
  type: Pipe,
2408
3323
  args: [{ name: 'timeDistance', pure: false }]
2409
3324
  }] });
@@ -2416,9 +3331,9 @@ class ToMinutesPipe {
2416
3331
  return milliseconds;
2417
3332
  }
2418
3333
  }
2419
- ToMinutesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2420
- ToMinutesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: ToMinutesPipe, name: "toMinutes" });
2421
- 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: [{
2422
3337
  type: Pipe,
2423
3338
  args: [{ name: 'toMinutes' }]
2424
3339
  }] });
@@ -2445,9 +3360,9 @@ class DateFormatDistancePipe {
2445
3360
  return undefined;
2446
3361
  }
2447
3362
  }
2448
- DateFormatDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
2449
- DateFormatDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateFormatDistancePipe, name: "dateFormatDistance", pure: false });
2450
- 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: [{
2451
3366
  type: Pipe,
2452
3367
  args: [{ name: 'dateFormatDistance', pure: false }]
2453
3368
  }], ctorParameters: function () {
@@ -2488,17 +3403,17 @@ class DateDistancePipe {
2488
3403
  }
2489
3404
  }
2490
3405
  }
2491
- DateDistancePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2492
- DateDistancePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DateDistancePipe, name: "dateDistance", pure: false });
2493
- 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: [{
2494
3409
  type: Pipe,
2495
3410
  args: [{ name: 'dateDistance', pure: false }]
2496
3411
  }] });
2497
3412
 
2498
3413
  class DbxDatePipeModule {
2499
3414
  }
2500
- DbxDatePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2501
- 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,
2502
3417
  DateFormatDistancePipe,
2503
3418
  MinutesStringPipe,
2504
3419
  TimeDistanceCountdownPipe,
@@ -2513,8 +3428,8 @@ DbxDatePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versi
2513
3428
  DateDistancePipe,
2514
3429
  ToJsDatePipe,
2515
3430
  ToMinutesPipe] });
2516
- DbxDatePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxDatePipeModule });
2517
- 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: [{
2518
3433
  type: NgModule,
2519
3434
  args: [{
2520
3435
  exports: [
@@ -2540,6 +3455,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2540
3455
  }]
2541
3456
  }] });
2542
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
+
2543
3517
  /**
2544
3518
  * Abstract FilterSource implementation.
2545
3519
  */
@@ -2568,9 +3542,9 @@ class AbstractFilterSourceDirective {
2568
3542
  return of(undefined);
2569
3543
  }
2570
3544
  }
2571
- AbstractFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2572
- AbstractFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFilterSourceDirective, ngImport: i0 });
2573
- 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: [{
2574
3548
  type: Directive
2575
3549
  }] });
2576
3550
 
@@ -2593,9 +3567,9 @@ class AbstractActionFilterSourceDirective extends AbstractFilterSourceDirective
2593
3567
  this.filterAction.trigger();
2594
3568
  }
2595
3569
  }
2596
- AbstractActionFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractActionFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2597
- 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 });
2598
- 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: [{
2599
3573
  type: Directive
2600
3574
  }], propDecorators: { filterAction: [{
2601
3575
  type: ViewChild,
@@ -2617,9 +3591,9 @@ class AbstractFilterSourceConnectorDirective {
2617
3591
  this._source.next(filterSource);
2618
3592
  }
2619
3593
  }
2620
- AbstractFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractFilterSourceConnectorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2621
- AbstractFilterSourceConnectorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractFilterSourceConnectorDirective, ngImport: i0 });
2622
- 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: [{
2623
3597
  type: Directive
2624
3598
  }] });
2625
3599
 
@@ -2650,12 +3624,12 @@ function ProvideFilterSourceConnector(sourceType) {
2650
3624
  */
2651
3625
  class DbxFilterSourceConnectorDirective extends AbstractFilterSourceConnectorDirective {
2652
3626
  }
2653
- DbxFilterSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2654
- 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: [
2655
3629
  ...ProvideFilterSource(DbxFilterSourceConnectorDirective),
2656
3630
  ...ProvideFilterSourceConnector(DbxFilterSourceConnectorDirective)
2657
3631
  ], usesInheritance: true, ngImport: i0 });
2658
- 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: [{
2659
3633
  type: Directive,
2660
3634
  args: [{
2661
3635
  selector: '[dbxFilterSourceConnector]',
@@ -2680,11 +3654,11 @@ class AbstractDbxFilterMapInstanceDirective {
2680
3654
  this._key.complete();
2681
3655
  }
2682
3656
  }
2683
- 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 });
2684
- AbstractDbxFilterMapInstanceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxFilterMapInstanceDirective, ngImport: i0 });
2685
- 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: [{
2686
3660
  type: Directive
2687
- }], ctorParameters: function () { return [{ type: i1$3.FilterMap }]; } });
3661
+ }], ctorParameters: function () { return [{ type: i1$5.FilterMap }]; } });
2688
3662
 
2689
3663
  /**
2690
3664
  * Provides a FilterSource from a parent FilterMap.
@@ -2704,11 +3678,11 @@ class DbxFilterMapSourceDirective extends AbstractDbxFilterMapInstanceDirective
2704
3678
  this.instance$.pipe(first$1()).subscribe((x) => x.initWithFilter(filterObs));
2705
3679
  }
2706
3680
  }
2707
- DbxFilterMapSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2708
- 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: [
2709
3683
  ...ProvideFilterSource(DbxFilterMapSourceDirective)
2710
3684
  ], exportAs: ["dbxFilterMapSource"], usesInheritance: true, ngImport: i0 });
2711
- 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: [{
2712
3686
  type: Directive,
2713
3687
  args: [{
2714
3688
  selector: '[dbxFilterMapSource]',
@@ -2737,12 +3711,12 @@ class DbxFilterMapSourceConnectorDirective extends DbxFilterMapSourceDirective {
2737
3711
  this.instance$.pipe(first$1()).subscribe((x) => x.connectWithSource(filterSource));
2738
3712
  }
2739
3713
  }
2740
- DbxFilterMapSourceConnectorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterMapSourceConnectorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2741
- 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: [
2742
3716
  ...ProvideFilterSource(DbxFilterMapSourceConnectorDirective),
2743
3717
  ...ProvideFilterSourceConnector(DbxFilterMapSourceConnectorDirective)
2744
3718
  ], exportAs: ["dbxFilterMapSourceConnector"], usesInheritance: true, ngImport: i0 });
2745
- 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: [{
2746
3720
  type: Directive,
2747
3721
  args: [{
2748
3722
  selector: '[dbxFilterMapSourceConnector]',
@@ -2768,25 +3742,25 @@ class DbxFilterMapDirective {
2768
3742
  this.filterMap.destroy();
2769
3743
  }
2770
3744
  }
2771
- 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 });
2772
- DbxFilterMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterMapDirective, selector: "[dbxFilterMap]", providers: [FilterMap], exportAs: ["dbxFilterMap"], ngImport: i0 });
2773
- 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: [{
2774
3748
  type: Directive,
2775
3749
  args: [{
2776
3750
  selector: '[dbxFilterMap]',
2777
3751
  exportAs: 'dbxFilterMap',
2778
3752
  providers: [FilterMap]
2779
3753
  }]
2780
- }], ctorParameters: function () { return [{ type: i1$3.FilterMap }]; } });
3754
+ }], ctorParameters: function () { return [{ type: i1$5.FilterMap }]; } });
2781
3755
 
2782
3756
  /**
2783
3757
  * Basic filter source directive.
2784
3758
  */
2785
3759
  class DbxFilterSourceDirective extends AbstractFilterSourceDirective {
2786
3760
  }
2787
- DbxFilterSourceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxFilterSourceDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2788
- DbxFilterSourceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: DbxFilterSourceDirective, selector: "[dbxFilterSource]", providers: ProvideFilterSource(DbxFilterSourceDirective), usesInheritance: true, ngImport: i0 });
2789
- 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: [{
2790
3764
  type: Directive,
2791
3765
  args: [{
2792
3766
  selector: '[dbxFilterSource]',
@@ -2796,8 +3770,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2796
3770
 
2797
3771
  class DbxCoreFilterModule {
2798
3772
  }
2799
- DbxCoreFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxCoreFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2800
- 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,
2801
3775
  DbxFilterSourceConnectorDirective,
2802
3776
  DbxFilterMapDirective,
2803
3777
  DbxFilterMapSourceConnectorDirective,
@@ -2806,10 +3780,10 @@ DbxCoreFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", ver
2806
3780
  DbxFilterMapDirective,
2807
3781
  DbxFilterMapSourceConnectorDirective,
2808
3782
  DbxFilterMapSourceDirective] });
2809
- 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: [[
2810
3784
  CommonModule
2811
3785
  ]] });
2812
- 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: [{
2813
3787
  type: NgModule,
2814
3788
  args: [{
2815
3789
  imports: [
@@ -2832,14 +3806,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
2832
3806
  }]
2833
3807
  }] });
2834
3808
 
2835
- const DBX_INJECTED_COMPONENT_DATA = new InjectionToken('DbxInjectedComponentConfigData');
3809
+ const DBX_INJECTION_COMPONENT_DATA = new InjectionToken('DbxInjectionComponentConfigData');
2836
3810
  /**
2837
3811
  * Merges multiple configurations into a single configuration.
2838
3812
  *
2839
3813
  * @param configs
2840
3814
  * @returns
2841
3815
  */
2842
- function mergeDbxInjectedComponentConfigs(configs) {
3816
+ function mergeDbxInjectionComponentConfigs(configs) {
2843
3817
  const providers = mergeArrays(filterMaybeValues(configs).map(x => x.providers));
2844
3818
  const result = mergeObjects(configs);
2845
3819
  result.providers = providers;
@@ -2849,7 +3823,7 @@ function mergeDbxInjectedComponentConfigs(configs) {
2849
3823
  /**
2850
3824
  * Instance used by components to inject content based on the configuration into the view.
2851
3825
  */
2852
- class DbxInjectedComponentInstance {
3826
+ class DbxInjectionInstance {
2853
3827
  constructor(_injector) {
2854
3828
  this._injector = _injector;
2855
3829
  this._subscriptionObject = new SubscriptionObject();
@@ -2925,7 +3899,7 @@ class DbxInjectedComponentInstance {
2925
3899
  injector = Injector.create({
2926
3900
  parent: parentInjector,
2927
3901
  providers: mergeArrayOrValueIntoArray([{
2928
- provide: DBX_INJECTED_COMPONENT_DATA,
3902
+ provide: DBX_INJECTION_COMPONENT_DATA,
2929
3903
  useValue: data
2930
3904
  }], providers !== null && providers !== void 0 ? providers : [])
2931
3905
  });
@@ -2959,10 +3933,10 @@ class DbxInjectedComponentInstance {
2959
3933
  /**
2960
3934
  * Abstract directive that injects content based on the configuration into the view.
2961
3935
  */
2962
- class AbstractDbxInjectedDirective {
3936
+ class AbstractDbxInjectionDirective {
2963
3937
  constructor(_injector) {
2964
3938
  this._injector = _injector;
2965
- this._instance = new DbxInjectedComponentInstance(this._injector);
3939
+ this._instance = new DbxInjectionInstance(this._injector);
2966
3940
  }
2967
3941
  ngOnInit() {
2968
3942
  this._instance.init();
@@ -2980,16 +3954,16 @@ class AbstractDbxInjectedDirective {
2980
3954
  this._instance.content = content;
2981
3955
  }
2982
3956
  }
2983
- AbstractDbxInjectedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: AbstractDbxInjectedDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
2984
- AbstractDbxInjectedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.4", type: AbstractDbxInjectedDirective, ngImport: i0 });
2985
- 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: [{
2986
3960
  type: Directive
2987
3961
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
2988
3962
 
2989
3963
  /**
2990
3964
  * Component that injects content based on the configuration into the view.
2991
3965
  */
2992
- class DbxInjectedComponent extends AbstractDbxInjectedDirective {
3966
+ class DbxInjectionComponent extends AbstractDbxInjectionDirective {
2993
3967
  set config(config) {
2994
3968
  this.setConfig(config);
2995
3969
  }
@@ -3000,12 +3974,12 @@ class DbxInjectedComponent extends AbstractDbxInjectedDirective {
3000
3974
  this.setContent(content);
3001
3975
  }
3002
3976
  }
3003
- DbxInjectedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3004
- 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 });
3005
- 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: [{
3006
3980
  type: Component,
3007
3981
  args: [{
3008
- selector: 'dbx-injected-content, [dbx-injected-content]',
3982
+ selector: 'dbx-injection, [dbxInjection], [dbx-injection]',
3009
3983
  template: `<ng-template #content></ng-template>`
3010
3984
  }]
3011
3985
  }], propDecorators: { config: [{
@@ -3017,28 +3991,258 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
3017
3991
  args: ['content', { static: true, read: ViewContainerRef }]
3018
3992
  }] } });
3019
3993
 
3020
- 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 {
3021
4132
  }
3022
- DbxInjectedComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3023
- DbxInjectedComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxInjectedComponentModule, declarations: [DbxInjectedComponent], imports: [CommonModule], exports: [DbxInjectedComponent] });
3024
- 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: [[
3025
4138
  CommonModule
3026
4139
  ]] });
3027
- 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: [{
3028
4141
  type: NgModule,
3029
4142
  args: [{
3030
4143
  imports: [
3031
4144
  CommonModule
3032
4145
  ],
3033
4146
  declarations: [
3034
- DbxInjectedComponent
4147
+ DbxInjectionComponent,
4148
+ DbxInjectionContextDirective
3035
4149
  ],
3036
4150
  exports: [
3037
- DbxInjectedComponent
4151
+ DbxInjectionComponent,
4152
+ DbxInjectionContextDirective
3038
4153
  ],
3039
4154
  }]
3040
4155
  }] });
3041
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
+
3042
4246
  class StringifySimpleStorageAccessorConverter {
3043
4247
  stringifyValue(value) {
3044
4248
  return JSON.stringify(value);
@@ -3260,12 +4464,12 @@ class SimpleStorageAccessorFactory {
3260
4464
  return new SimpleStorageAccessor(delegate, accessorConfig);
3261
4465
  }
3262
4466
  }
3263
- 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 });
3264
- SimpleStorageAccessorFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: SimpleStorageAccessorFactory });
3265
- 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: [{
3266
4470
  type: Injectable
3267
4471
  }], ctorParameters: function () {
3268
- return [{ type: i1$4.FullStorageObject, decorators: [{
4472
+ return [{ type: i1$6.FullStorageObject, decorators: [{
3269
4473
  type: Inject,
3270
4474
  args: [DEFAULT_STORAGE_OBJECT_TOKEN]
3271
4475
  }] }];
@@ -3371,10 +4575,10 @@ class DbxStorageModule {
3371
4575
  };
3372
4576
  }
3373
4577
  }
3374
- DbxStorageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3375
- DbxStorageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule });
3376
- DbxStorageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.4", ngImport: i0, type: DbxStorageModule });
3377
- 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: [{
3378
4582
  type: NgModule
3379
4583
  }] });
3380
4584
 
@@ -3382,5 +4586,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.4", ngImpor
3382
4586
  * Generated bundle index. Do not edit.
3383
4587
  */
3384
4588
 
3385
- export { APP_ACTION_DISABLED_DIRECTIVE_KEY, APP_ACTION_ENFORCE_MODIFIED_DIRECTIVE_KEY, AbstractActionFilterSourceDirective, 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, 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 };
3386
4590
  //# sourceMappingURL=dereekb-dbx-core.mjs.map