@flarehr/apollo-super-selection 3.52.60060 → 3.55.61713

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 (203) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -0
  2. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  3. package/dist/lib/apollo-super-selection/apollo-super-selection.js +1 -1
  4. package/dist/lib/apollo-super-selection/assets/icon-check.svg +3 -0
  5. package/dist/lib/apollo-super-selection/assets/icon-exclamation.svg +3 -0
  6. package/dist/lib/apollo-super-selection/assets/icon-information-circle.svg +3 -0
  7. package/dist/lib/apollo-super-selection/p-0d3b8084.system.entry.js +1 -0
  8. package/dist/lib/apollo-super-selection/p-0ef73515.entry.js +1 -0
  9. package/dist/lib/apollo-super-selection/p-0f723eb4.system.js +1 -0
  10. package/dist/lib/apollo-super-selection/{p-01a9f4a4.entry.js → p-12d77532.entry.js} +1 -1
  11. package/dist/lib/apollo-super-selection/p-14885f78.system.js +15 -0
  12. package/dist/lib/apollo-super-selection/{p-381262c1.system.js → p-15f0e5eb.system.js} +1 -1
  13. package/dist/lib/apollo-super-selection/p-29c11183.js +15 -0
  14. package/dist/lib/apollo-super-selection/{p-20136efe.entry.js → p-375401a0.entry.js} +1 -1
  15. package/dist/lib/apollo-super-selection/{p-285da037.system.entry.js → p-3ce021a5.system.entry.js} +1 -1
  16. package/dist/lib/apollo-super-selection/{p-61734b66.js → p-40e504c4.js} +1 -1
  17. package/dist/lib/apollo-super-selection/p-67b71067.entry.js +1 -0
  18. package/dist/lib/apollo-super-selection/{p-082669d9.js → p-683b6e23.js} +1 -1
  19. package/dist/lib/apollo-super-selection/{p-38ee2795.system.js → p-6cdec249.system.js} +1 -1
  20. package/dist/lib/apollo-super-selection/{p-cd49a6b7.system.entry.js → p-76eee25a.system.entry.js} +1 -1
  21. package/dist/lib/apollo-super-selection/p-86e3e03f.js +1 -0
  22. package/dist/lib/apollo-super-selection/{p-8cbfc343.system.entry.js → p-918a740c.system.entry.js} +1 -1
  23. package/dist/lib/apollo-super-selection/p-93f7a547.entry.js +14 -0
  24. package/dist/lib/apollo-super-selection/p-c249f6ed.system.js +1 -0
  25. package/dist/lib/apollo-super-selection/p-c2b9cfa5.system.entry.js +69 -0
  26. package/dist/lib/apollo-super-selection/{p-a98c2760.entry.js → p-cb6b386e.entry.js} +1 -1
  27. package/dist/lib/apollo-super-selection/{p-f15bf700.system.entry.js → p-e9a34be2.system.entry.js} +1 -1
  28. package/dist/lib/cjs/{active-router-e92fd784.js → active-router-71d965f4.js} +1 -1
  29. package/dist/lib/cjs/apollo-super-selection.cjs.js +4 -5
  30. package/dist/lib/cjs/{app-globals-45007120.js → app-globals-b1125d8c.js} +1 -1
  31. package/dist/lib/cjs/context-consumer.cjs.entry.js +1 -1
  32. package/dist/lib/cjs/{datorama-akita-7f4b082a.js → datorama-akita-6c9cb8fb.js} +1005 -68
  33. package/dist/lib/cjs/{index-942e6faa.js → index-f746d8f0.js} +2 -0
  34. package/dist/lib/cjs/loader.cjs.js +4 -5
  35. package/dist/lib/cjs/{fl-button_31.cjs.entry.js → sss-button_28.cjs.entry.js} +2138 -2177
  36. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +1 -1
  37. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +2 -2
  38. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +2 -2
  39. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +2 -2
  40. package/dist/lib/collection/apollo-super-selection.css +1 -0
  41. package/dist/lib/collection/collection-manifest.json +16 -28
  42. package/dist/lib/collection/components/app-host/loading-page.js +3 -3
  43. package/dist/lib/collection/components/app-host/super-selection-app-host.css +0 -4
  44. package/dist/lib/collection/components/app-host/super-selection-app-host.js +7 -19
  45. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +69 -1
  46. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +9 -3
  47. package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +16 -21
  48. package/dist/lib/collection/components/super-selection-app/assets/icon-check.svg +3 -0
  49. package/dist/lib/collection/components/super-selection-app/assets/icon-exclamation.svg +3 -0
  50. package/dist/lib/collection/components/super-selection-app/assets/icon-information-circle.svg +3 -0
  51. package/dist/lib/collection/components/super-selection-app/consent/consent.js +57 -0
  52. package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +136 -0
  53. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +6 -18
  54. package/dist/lib/collection/components/super-selection-app/funds/constants.js +50 -0
  55. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +32 -16
  56. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.store.js +10 -14
  57. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +36 -45
  58. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +40 -19
  59. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +45 -40
  60. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +104 -58
  61. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +53 -49
  62. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.js +6 -16
  63. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-page.js +1 -1
  64. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund.store.js +1 -4
  65. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-iframe-builder.js +10 -4
  66. package/dist/lib/collection/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.js +13 -4
  67. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-join-page.js +2 -3
  68. package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +45 -0
  69. package/dist/lib/collection/components/super-selection-app/misc/button.js +146 -0
  70. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.css +7 -0
  71. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +359 -0
  72. package/dist/lib/collection/components/super-selection-app/misc/loading-indicator.js +52 -0
  73. package/dist/lib/collection/components/super-selection-app/services/australian-fund-lookup.service.js +8 -4
  74. package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +20 -0
  75. package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +95 -0
  76. package/dist/lib/collection/components/super-selection-app/services/feature-flag.service.js +11 -0
  77. package/dist/lib/collection/components/super-selection-app/services/navigation.service.js +8 -0
  78. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +6 -4
  79. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +69 -34
  80. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.store.js +10 -0
  81. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js +94 -0
  82. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.js +90 -0
  83. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +85 -92
  84. package/dist/lib/collection/components/super-selection-app/super-selection-app.css +16 -4
  85. package/dist/lib/collection/components/super-selection-app/super-selection-app.js +59 -11
  86. package/dist/lib/esm/{active-router-4c80d3d2.js → active-router-2056f552.js} +1 -1
  87. package/dist/lib/esm/apollo-super-selection.js +4 -5
  88. package/dist/lib/esm/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
  89. package/dist/lib/esm/context-consumer.entry.js +1 -1
  90. package/dist/lib/esm/{datorama-akita-79ce4385.js → datorama-akita-127aea91.js} +960 -28
  91. package/dist/lib/esm/{index-0496d1af.js → index-e1e930c8.js} +2 -1
  92. package/dist/lib/esm/loader.js +4 -5
  93. package/dist/lib/esm/{fl-button_31.entry.js → sss-button_28.entry.js} +2124 -2160
  94. package/dist/lib/esm/stencil-async-content.entry.js +1 -1
  95. package/dist/lib/esm/stencil-route-title.entry.js +2 -2
  96. package/dist/lib/esm/stencil-router-prompt.entry.js +2 -2
  97. package/dist/lib/esm/stencil-router-redirect.entry.js +2 -2
  98. package/dist/lib/esm-es5/{active-router-4c80d3d2.js → active-router-2056f552.js} +1 -1
  99. package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
  100. package/dist/lib/esm-es5/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
  101. package/dist/lib/esm-es5/context-consumer.entry.js +1 -1
  102. package/dist/lib/esm-es5/datorama-akita-127aea91.js +15 -0
  103. package/dist/lib/esm-es5/{index-0496d1af.js → index-e1e930c8.js} +1 -1
  104. package/dist/lib/esm-es5/loader.js +1 -1
  105. package/dist/lib/esm-es5/sss-button_28.entry.js +69 -0
  106. package/dist/lib/esm-es5/stencil-async-content.entry.js +1 -1
  107. package/dist/lib/esm-es5/stencil-route-title.entry.js +1 -1
  108. package/dist/lib/esm-es5/stencil-router-prompt.entry.js +1 -1
  109. package/dist/lib/esm-es5/stencil-router-redirect.entry.js +1 -1
  110. package/dist/lib/types/components/app-host/super-selection-app-host.d.ts +0 -3
  111. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +30 -0
  112. package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +2 -1
  113. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +19 -4
  114. package/dist/lib/types/components/super-selection-app/consent/consent.d.ts +9 -0
  115. package/dist/lib/types/components/super-selection-app/existing-choice/existing-choice.d.ts +12 -0
  116. package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +0 -1
  117. package/dist/lib/types/components/super-selection-app/funds/constants.d.ts +3 -0
  118. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.d.ts +1 -1
  119. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +4 -6
  120. package/dist/lib/types/components/super-selection-app/funds/custom-fund/default-fund/default-fund.d.ts +0 -2
  121. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.d.ts +2 -1
  122. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.d.ts +1 -0
  123. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +7 -0
  124. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +1 -0
  125. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts +0 -1
  126. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund.store.d.ts +0 -3
  127. package/dist/lib/types/components/super-selection-app/header-section/header-section.d.ts +4 -0
  128. package/dist/lib/types/components/super-selection-app/misc/button.d.ts +11 -0
  129. package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +44 -0
  130. package/dist/lib/types/components/super-selection-app/misc/loading-indicator.d.ts +5 -0
  131. package/dist/lib/types/components/super-selection-app/services/australian-fund-lookup.service.d.ts +1 -0
  132. package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +4 -0
  133. package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +51 -0
  134. package/dist/lib/types/components/super-selection-app/services/feature-flag.service.d.ts +3 -0
  135. package/dist/lib/types/components/super-selection-app/services/navigation.service.d.ts +6 -0
  136. package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +3 -2
  137. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.d.ts +6 -3
  138. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.store.d.ts +8 -0
  139. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.d.ts +9 -0
  140. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.d.ts +7 -0
  141. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page.d.ts +1 -4
  142. package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +2 -1
  143. package/dist/lib/types/components.d.ts +148 -97
  144. package/package.json +12 -7
  145. package/dist/lib/apollo-super-selection/assets/logo-qsuper-square.png +0 -0
  146. package/dist/lib/apollo-super-selection/assets/logo-qsuper.png +0 -0
  147. package/dist/lib/apollo-super-selection/p-0623b20a.system.entry.js +0 -69
  148. package/dist/lib/apollo-super-selection/p-13573238.system.js +0 -15
  149. package/dist/lib/apollo-super-selection/p-342cee5a.js +0 -1
  150. package/dist/lib/apollo-super-selection/p-38f24f69.js +0 -1
  151. package/dist/lib/apollo-super-selection/p-642db1f7.system.entry.js +0 -1
  152. package/dist/lib/apollo-super-selection/p-64ebe17d.system.entry.js +0 -1
  153. package/dist/lib/apollo-super-selection/p-7dbe5a2f.system.js +0 -1
  154. package/dist/lib/apollo-super-selection/p-abedb220.entry.js +0 -1
  155. package/dist/lib/apollo-super-selection/p-ae4f5e0b.system.js +0 -1
  156. package/dist/lib/apollo-super-selection/p-c5e41889.entry.js +0 -1
  157. package/dist/lib/apollo-super-selection/p-d82b00ed.system.js +0 -1
  158. package/dist/lib/apollo-super-selection/p-df9ce4b7.js +0 -15
  159. package/dist/lib/apollo-super-selection/p-f7a45412.entry.js +0 -1
  160. package/dist/lib/apollo-super-selection/p-fbe8c6d1.entry.js +0 -14
  161. package/dist/lib/cjs/delay-81aff2f1.js +0 -955
  162. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -90
  163. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.css +0 -11
  164. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.css +0 -23
  165. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.js +0 -62
  166. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-fund.store.js +0 -10
  167. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-standard-choice-page.js +0 -67
  168. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.css +0 -0
  169. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.js +0 -19
  170. package/dist/lib/collection/components/super-selection-app/notifications-section/notifications-section.js +0 -25
  171. package/dist/lib/collection/components/super-selection-app/services/notifications.service.js +0 -37
  172. package/dist/lib/collection/components/super-selection-app/services/notifications.store.js +0 -3
  173. package/dist/lib/collection/components/super-selection-app/services/selected-super-choice-info.service.js +0 -50
  174. package/dist/lib/collection/components/super-selection-app/standard-choice/api/standard-choice.model.js +0 -1
  175. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper-square.png +0 -0
  176. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper.png +0 -0
  177. package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.css +0 -18
  178. package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.js +0 -53
  179. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item.js +0 -296
  180. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.css +0 -70
  181. package/dist/lib/esm/delay-c0555599.js +0 -935
  182. package/dist/lib/esm/fl-style-guide.entry.js +0 -86
  183. package/dist/lib/esm-es5/datorama-akita-79ce4385.js +0 -15
  184. package/dist/lib/esm-es5/delay-c0555599.js +0 -1
  185. package/dist/lib/esm-es5/fl-button_31.entry.js +0 -69
  186. package/dist/lib/esm-es5/fl-style-guide.entry.js +0 -1
  187. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  188. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  189. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  190. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  191. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  192. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  193. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.d.ts +0 -8
  194. package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-fund.store.d.ts +0 -7
  195. package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-standard-choice-page.d.ts +0 -8
  196. package/dist/lib/types/components/super-selection-app/funds/slate-super/slatesuper-header.d.ts +0 -3
  197. package/dist/lib/types/components/super-selection-app/notifications-section/notifications-section.d.ts +0 -5
  198. package/dist/lib/types/components/super-selection-app/services/notifications.service.d.ts +0 -15
  199. package/dist/lib/types/components/super-selection-app/services/notifications.store.d.ts +0 -14
  200. package/dist/lib/types/components/super-selection-app/services/selected-super-choice-info.service.d.ts +0 -18
  201. package/dist/lib/types/components/super-selection-app/standard-choice/api/standard-choice.model.d.ts +0 -3
  202. package/dist/lib/types/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.d.ts +0 -5
  203. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item.d.ts +0 -22
@@ -1,86 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-0496d1af.js';
2
- import { g as isArray, O as Observable, l as isScheduler, k as async, d as of, f as delay } from './delay-c0555599.js';
3
-
4
- function isNumeric(val) {
5
- return !isArray(val) && (val - parseFloat(val) + 1) >= 0;
6
- }
7
-
8
- function timer(dueTime = 0, periodOrScheduler, scheduler) {
9
- let period = -1;
10
- if (isNumeric(periodOrScheduler)) {
11
- period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
12
- }
13
- else if (isScheduler(periodOrScheduler)) {
14
- scheduler = periodOrScheduler;
15
- }
16
- if (!isScheduler(scheduler)) {
17
- scheduler = async;
18
- }
19
- return new Observable(subscriber => {
20
- const due = isNumeric(dueTime)
21
- ? dueTime
22
- : (+dueTime - scheduler.now());
23
- return scheduler.schedule(dispatch, due, {
24
- index: 0, period, subscriber
25
- });
26
- });
27
- }
28
- function dispatch(state) {
29
- const { index, period, subscriber } = state;
30
- subscriber.next(index);
31
- if (subscriber.closed) {
32
- return;
33
- }
34
- else if (period === -1) {
35
- return subscriber.complete();
36
- }
37
- state.index = index + 1;
38
- this.schedule(state, period);
39
- }
40
-
41
- const getLocalResourceUrl = (relativePath) => {
42
- const resourcesUrlElement = document.querySelector('script[data-fl-namespace="design-system"][data-fl-resources-url]');
43
- const resourcesUrl = (resourcesUrlElement && resourcesUrlElement.getAttribute('data-fl-resources-url')) || '';
44
- try {
45
- return new URL(relativePath, resourcesUrl).href;
46
- }
47
- catch (error) {
48
- return `${resourcesUrl}/${relativePath}`;
49
- }
50
- };
51
-
52
- const styleGuideCss = "";
53
-
54
- const FlareStyleGuide = class {
55
- constructor(hostRef) {
56
- registerInstance(this, hostRef);
57
- this.data = [
58
- 'Apple',
59
- 'Application',
60
- 'Appetizer',
61
- 'Anna',
62
- 'Banana',
63
- 'Archery',
64
- 'Apogee'
65
- ].map((v) => ({
66
- label: v,
67
- value: v
68
- }));
69
- this.searchFunction = (query) => {
70
- const results = this.data.filter((item) => item.label.toLowerCase().includes(query.toLowerCase()));
71
- return of(results).pipe(delay(1000)).toPromise();
72
- };
73
- }
74
- render() {
75
- return (h(Host, null, h("link", { rel: "stylesheet", href: getLocalResourceUrl('beacon.css'), media: "all" }), this.themeCssUrl && h("link", { rel: "stylesheet", href: this.themeCssUrl, media: "all" }), h("div", { class: "container m-3 p-5 shadow" }, h("h1", null, "Beacon"), h("h5", null, "Flare-Apollo Component Library \uD83D\uDE80"), h("div", { class: "row" }, h("div", { class: "col" }, h("ul", { class: "list-group" }, h("li", { class: "list-group-item" }, h("small", { class: "text-muted" }, "Typography"), h("div", { class: "col" }, h("h1", null, "h1 Heading"), h("h2", null, "h2 Sub-heading"), h("h3", null, "h3 Sub-heading"), h("h4", null, "h4 Sub-heading"), h("p", null, "Paragraph"), h("div", { class: "d-flex flex-column" }, h("strong", null, "Strong"), h("small", null, "small"), h("a", { href: "https://www.flarehr.com", target: "_blank" }, "Weblink")))), h("li", { class: "list-group-item" }, h("small", { class: "text-muted" }, "Buttons"), h("div", { class: "col-3 my-2" }, this.renderButtonVariants())), h("li", { class: "list-group-item" }, h("small", { class: "text-muted" }, "Loading indicator"), h("div", { class: "col" }, h("fl-loading-indicator", null), h("fl-loading-indicator", { theme: "dark" }))), h("li", { class: "list-group-item" }, h("small", { class: "text-muted" }, "Dropdown"), h("div", { class: "col-4" }, h("fl-dropdown", { options: this.data }))), h("li", { class: "list-group-item" }, h("small", { class: "text-muted" }, "Async Dropdown"), h("div", { class: "col-4" }, h("fl-dropdown-async", { "min-search-string-length": "2", searchFunction: this.searchFunction }))), h("li", { class: "list-group-item" }, h("small", { class: "text-muted" }, "Promise Button"), h("div", { class: "col-3 my-2" }, h("fl-promise-button", { isBlockElement: true, promiseFn: () => this.takeTime() }, "Promise Button block")), h("div", { class: "col-3 my-2" }, h("fl-promise-button", { promiseFn: () => this.takeTime() }, "Promise Button")), h("div", { class: "col-3 my-2" }, h("fl-promise-button", { variant: "secondary", promiseFn: () => this.takeTime() }, "Secondary Promise Button")))))))));
76
- }
77
- renderButtonVariants() {
78
- return (h("ul", { class: "list-group" }, h("li", { class: "list-group-item" }, h("i", null, "Primary"), h("fl-button", { isBlockElement: true }, "Button")), h("li", { class: "list-group-item" }, h("i", null, "Primary, disabled"), h("fl-button", { isBlockElement: true, disabled: true }, "Button")), h("li", { class: "list-group-item" }, h("i", null, "Secondary"), h("fl-button", { isBlockElement: true, variant: "secondary" }, "Button")), h("li", { class: "list-group-item" }, h("i", null, "Secondary, disabled"), h("fl-button", { isBlockElement: true, disabled: true, variant: "secondary" }, "Button"))));
79
- }
80
- async takeTime() {
81
- return timer(Math.random() * 2000 + 2000).toPromise();
82
- }
83
- };
84
- FlareStyleGuide.style = styleGuideCss;
85
-
86
- export { FlareStyleGuide as fl_style_guide };
@@ -1,15 +0,0 @@
1
- var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}();var __spreadArrays=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i};import{S as Subscription,O as Observable,r as rxSubscriber,a as Subscriber,A as AsyncAction,b as AsyncScheduler,N as Notification,h as hostReportError,o as observable,s as subscribeToArray,i as isObject$1,c as scheduleArray,e as empty,d as of,f as delay}from"./delay-c0555599.js";
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function __rest(t,e){var r={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0)r[i]=t[i];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++){if(e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n]))r[i[n]]=t[i[n]]}return r}function __decorate(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)if(o=t[a])s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s;return n>3&&s&&Object.defineProperty(e,r,s),s}function __metadata(t,e){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(t,e)}var ObjectUnsubscribedErrorImpl=function(){function t(){Error.call(this);this.message="object unsubscribed";this.name="ObjectUnsubscribedError";return this}t.prototype=Object.create(Error.prototype);return t}();var ObjectUnsubscribedError=ObjectUnsubscribedErrorImpl;var SubjectSubscription=function(t){__extends(e,t);function e(e,r){var i=t.call(this)||this;i.subject=e;i.subscriber=r;i.closed=false;return i}e.prototype.unsubscribe=function(){if(this.closed){return}this.closed=true;var t=this.subject;var e=t.observers;this.subject=null;if(!e||e.length===0||t.isStopped||t.closed){return}var r=e.indexOf(this.subscriber);if(r!==-1){e.splice(r,1)}};return e}(Subscription);var SubjectSubscriber=function(t){__extends(e,t);function e(e){var r=t.call(this,e)||this;r.destination=e;return r}return e}(Subscriber);var Subject=function(t){__extends(e,t);function e(){var e=t.call(this)||this;e.observers=[];e.closed=false;e.isStopped=false;e.hasError=false;e.thrownError=null;return e}e.prototype[rxSubscriber]=function(){return new SubjectSubscriber(this)};e.prototype.lift=function(t){var e=new AnonymousSubject(this,this);e.operator=t;return e};e.prototype.next=function(t){if(this.closed){throw new ObjectUnsubscribedError}if(!this.isStopped){var e=this.observers;var r=e.length;var i=e.slice();for(var n=0;n<r;n++){i[n].next(t)}}};e.prototype.error=function(t){if(this.closed){throw new ObjectUnsubscribedError}this.hasError=true;this.thrownError=t;this.isStopped=true;var e=this.observers;var r=e.length;var i=e.slice();for(var n=0;n<r;n++){i[n].error(t)}this.observers.length=0};e.prototype.complete=function(){if(this.closed){throw new ObjectUnsubscribedError}this.isStopped=true;var t=this.observers;var e=t.length;var r=t.slice();for(var i=0;i<e;i++){r[i].complete()}this.observers.length=0};e.prototype.unsubscribe=function(){this.isStopped=true;this.closed=true;this.observers=null};e.prototype._trySubscribe=function(e){if(this.closed){throw new ObjectUnsubscribedError}else{return t.prototype._trySubscribe.call(this,e)}};e.prototype._subscribe=function(t){if(this.closed){throw new ObjectUnsubscribedError}else if(this.hasError){t.error(this.thrownError);return Subscription.EMPTY}else if(this.isStopped){t.complete();return Subscription.EMPTY}else{this.observers.push(t);return new SubjectSubscription(this,t)}};e.prototype.asObservable=function(){var t=new Observable;t.source=this;return t};return e}(Observable);Subject.create=function(t,e){return new AnonymousSubject(t,e)};var AnonymousSubject=function(t){__extends(e,t);function e(e,r){var i=t.call(this)||this;i.destination=e;i.source=r;return i}e.prototype.next=function(t){var e=this.destination;if(e&&e.next){e.next(t)}};e.prototype.error=function(t){var e=this.destination;if(e&&e.error){this.destination.error(t)}};e.prototype.complete=function(){var t=this.destination;if(t&&t.complete){this.destination.complete()}};e.prototype._subscribe=function(t){var e=this.source;if(e){return this.source.subscribe(t)}else{return Subscription.EMPTY}};return e}(Subject);var BehaviorSubject=function(t){__extends(e,t);function e(e){var r=t.call(this)||this;r._value=e;return r}Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:false,configurable:true});e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);if(r&&!r.closed){e.next(this._value)}return r};e.prototype.getValue=function(){if(this.hasError){throw this.thrownError}else if(this.closed){throw new ObjectUnsubscribedError}else{return this._value}};e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)};return e}(Subject);var QueueAction=function(t){__extends(e,t);function e(e,r){var i=t.call(this,e,r)||this;i.scheduler=e;i.work=r;return i}e.prototype.schedule=function(e,r){if(r===void 0){r=0}if(r>0){return t.prototype.schedule.call(this,e,r)}this.delay=r;this.state=e;this.scheduler.flush(this);return this};e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)};e.prototype.requestAsyncId=function(e,r,i){if(i===void 0){i=0}if(i!==null&&i>0||i===null&&this.delay>0){return t.prototype.requestAsyncId.call(this,e,r,i)}return e.flush(this)};return e}(AsyncAction);var QueueScheduler=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(AsyncScheduler);var queueScheduler=new QueueScheduler(QueueAction);var queue=queueScheduler;var ObserveOnSubscriber=function(t){__extends(e,t);function e(e,r,i){if(i===void 0){i=0}var n=t.call(this,e)||this;n.scheduler=r;n.delay=i;return n}e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r);this.unsubscribe()};e.prototype.scheduleMessage=function(t){var r=this.destination;r.add(this.scheduler.schedule(e.dispatch,this.delay,new ObserveOnMessage(t,this.destination)))};e.prototype._next=function(t){this.scheduleMessage(Notification.createNext(t))};e.prototype._error=function(t){this.scheduleMessage(Notification.createError(t));this.unsubscribe()};e.prototype._complete=function(){this.scheduleMessage(Notification.createComplete());this.unsubscribe()};return e}(Subscriber);var ObserveOnMessage=function(){function t(t,e){this.notification=t;this.destination=e}return t}();var ReplaySubject=function(t){__extends(e,t);function e(e,r,i){if(e===void 0){e=Number.POSITIVE_INFINITY}if(r===void 0){r=Number.POSITIVE_INFINITY}var n=t.call(this)||this;n.scheduler=i;n._events=[];n._infiniteTimeWindow=false;n._bufferSize=e<1?1:e;n._windowTime=r<1?1:r;if(r===Number.POSITIVE_INFINITY){n._infiniteTimeWindow=true;n.next=n.nextInfiniteTimeWindow}else{n.next=n.nextTimeWindow}return n}e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e);if(r.length>this._bufferSize){r.shift()}}t.prototype.next.call(this,e)};e.prototype.nextTimeWindow=function(e){if(!this.isStopped){this._events.push(new ReplayEvent(this._getNow(),e));this._trimBufferThenGetEvents()}t.prototype.next.call(this,e)};e.prototype._subscribe=function(t){var e=this._infiniteTimeWindow;var r=e?this._events:this._trimBufferThenGetEvents();var i=this.scheduler;var n=r.length;var s;if(this.closed){throw new ObjectUnsubscribedError}else if(this.isStopped||this.hasError){s=Subscription.EMPTY}else{this.observers.push(t);s=new SubjectSubscription(this,t)}if(i){t.add(t=new ObserveOnSubscriber(t,i))}if(e){for(var o=0;o<n&&!t.closed;o++){t.next(r[o])}}else{for(var o=0;o<n&&!t.closed;o++){t.next(r[o].value)}}if(this.hasError){t.error(this.thrownError)}else if(this.isStopped){t.complete()}return s};e.prototype._getNow=function(){return(this.scheduler||queue).now()};e.prototype._trimBufferThenGetEvents=function(){var t=this._getNow();var e=this._bufferSize;var r=this._windowTime;var i=this._events;var n=i.length;var s=0;while(s<n){if(t-i[s].time<r){break}s++}if(n>e){s=Math.max(s,n-e)}if(s>0){i.splice(0,s)}return i};return e}(Subject);var ReplayEvent=function(){function t(t,e){this.time=t;this.value=e}return t}();function isObservable(t){return!!t&&(t instanceof Observable||typeof t.lift==="function"&&typeof t.subscribe==="function")}var ArgumentOutOfRangeErrorImpl=function(){function t(){Error.call(this);this.message="argument out of range";this.name="ArgumentOutOfRangeError";return this}t.prototype=Object.create(Error.prototype);return t}();var ArgumentOutOfRangeError=ArgumentOutOfRangeErrorImpl;function map(t,e){return function r(i){if(typeof t!=="function"){throw new TypeError("argument is not a function. Are you looking for `mapTo()`?")}return i.lift(new MapOperator(t,e))}}var MapOperator=function(){function t(t,e){this.project=t;this.thisArg=e}t.prototype.call=function(t,e){return e.subscribe(new MapSubscriber(t,this.project,this.thisArg))};return t}();var MapSubscriber=function(t){__extends(e,t);function e(e,r,i){var n=t.call(this,e)||this;n.project=r;n.count=0;n.thisArg=i||n;return n}e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){this.destination.error(t);return}this.destination.next(e)};return e}(Subscriber);var subscribeToPromise=function(t){return function(e){t.then((function(t){if(!e.closed){e.next(t);e.complete()}}),(function(t){return e.error(t)})).then(null,hostReportError);return e}};function getSymbolIterator(){if(typeof Symbol!=="function"||!Symbol.iterator){return"@@iterator"}return Symbol.iterator}var iterator=getSymbolIterator();var subscribeToIterable=function(t){return function(e){var r=t[iterator]();do{var i=void 0;try{i=r.next()}catch(t){e.error(t);return e}if(i.done){e.complete();break}e.next(i.value);if(e.closed){break}}while(true);if(typeof r.return==="function"){e.add((function(){if(r.return){r.return()}}))}return e}};var subscribeToObservable=function(t){return function(e){var r=t[observable]();if(typeof r.subscribe!=="function"){throw new TypeError("Provided object does not correctly implement Symbol.observable")}else{return r.subscribe(e)}}};var isArrayLike=function(t){return t&&typeof t.length==="number"&&typeof t!=="function"};function isPromise(t){return!!t&&typeof t.subscribe!=="function"&&typeof t.then==="function"}var subscribeTo=function(t){if(!!t&&typeof t[observable]==="function"){return subscribeToObservable(t)}else if(isArrayLike(t)){return subscribeToArray(t)}else if(isPromise(t)){return subscribeToPromise(t)}else if(!!t&&typeof t[iterator]==="function"){return subscribeToIterable(t)}else{var e=isObject$1(t)?"an invalid object":"'"+t+"'";var r="You provided "+e+" where a stream was expected."+" You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)}};function scheduleObservable(t,e){return new Observable((function(r){var i=new Subscription;i.add(e.schedule((function(){var n=t[observable]();i.add(n.subscribe({next:function(t){i.add(e.schedule((function(){return r.next(t)})))},error:function(t){i.add(e.schedule((function(){return r.error(t)})))},complete:function(){i.add(e.schedule((function(){return r.complete()})))}}))})));return i}))}function schedulePromise(t,e){return new Observable((function(r){var i=new Subscription;i.add(e.schedule((function(){return t.then((function(t){i.add(e.schedule((function(){r.next(t);i.add(e.schedule((function(){return r.complete()})))})))}),(function(t){i.add(e.schedule((function(){return r.error(t)})))}))})));return i}))}function scheduleIterable(t,e){if(!t){throw new Error("Iterable cannot be null")}return new Observable((function(r){var i=new Subscription;var n;i.add((function(){if(n&&typeof n.return==="function"){n.return()}}));i.add(e.schedule((function(){n=t[iterator]();i.add(e.schedule((function(){if(r.closed){return}var t;var e;try{var i=n.next();t=i.value;e=i.done}catch(t){r.error(t);return}if(e){r.complete()}else{r.next(t);this.schedule()}})))})));return i}))}function isInteropObservable(t){return t&&typeof t[observable]==="function"}function isIterable(t){return t&&typeof t[iterator]==="function"}function scheduled(t,e){if(t!=null){if(isInteropObservable(t)){return scheduleObservable(t,e)}else if(isPromise(t)){return schedulePromise(t,e)}else if(isArrayLike(t)){return scheduleArray(t,e)}else if(isIterable(t)||typeof t==="string"){return scheduleIterable(t,e)}}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function from(t,e){if(!e){if(t instanceof Observable){return t}return new Observable(subscribeTo(t))}else{return scheduled(t,e)}}var SimpleInnerSubscriber=function(t){__extends(e,t);function e(e){var r=t.call(this)||this;r.parent=e;return r}e.prototype._next=function(t){this.parent.notifyNext(t)};e.prototype._error=function(t){this.parent.notifyError(t);this.unsubscribe()};e.prototype._complete=function(){this.parent.notifyComplete();this.unsubscribe()};return e}(Subscriber);var SimpleOuterSubscriber=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.notifyNext=function(t){this.destination.next(t)};e.prototype.notifyError=function(t){this.destination.error(t)};e.prototype.notifyComplete=function(){this.destination.complete()};return e}(Subscriber);function innerSubscribe(t,e){if(e.closed){return undefined}if(t instanceof Observable){return t.subscribe(e)}return subscribeTo(t)(e)}function filter(t,e){return function r(i){return i.lift(new FilterOperator(t,e))}}var FilterOperator=function(){function t(t,e){this.predicate=t;this.thisArg=e}t.prototype.call=function(t,e){return e.subscribe(new FilterSubscriber(t,this.predicate,this.thisArg))};return t}();var FilterSubscriber=function(t){__extends(e,t);function e(e,r,i){var n=t.call(this,e)||this;n.predicate=r;n.thisArg=i;n.count=0;return n}e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){this.destination.error(t);return}if(e){this.destination.next(t)}};return e}(Subscriber);function distinctUntilChanged(t,e){return function(r){return r.lift(new DistinctUntilChangedOperator(t,e))}}var DistinctUntilChangedOperator=function(){function t(t,e){this.compare=t;this.keySelector=e}t.prototype.call=function(t,e){return e.subscribe(new DistinctUntilChangedSubscriber(t,this.compare,this.keySelector))};return t}();var DistinctUntilChangedSubscriber=function(t){__extends(e,t);function e(e,r,i){var n=t.call(this,e)||this;n.keySelector=i;n.hasKey=false;if(typeof r==="function"){n.compare=r}return n}e.prototype.compare=function(t,e){return t===e};e.prototype._next=function(t){var e;try{var r=this.keySelector;e=r?r(t):t}catch(t){return this.destination.error(t)}var i=false;if(this.hasKey){try{var n=this.compare;i=n(this.key,e)}catch(t){return this.destination.error(t)}}else{this.hasKey=true}if(!i){this.key=e;this.destination.next(t)}};return e}(Subscriber);function take(t){return function(e){if(t===0){return empty()}else{return e.lift(new TakeOperator(t))}}}var TakeOperator=function(){function t(t){this.total=t;if(this.total<0){throw new ArgumentOutOfRangeError}}t.prototype.call=function(t,e){return e.subscribe(new TakeSubscriber(t,this.total))};return t}();var TakeSubscriber=function(t){__extends(e,t);function e(e,r){var i=t.call(this,e)||this;i.total=r;i.count=0;return i}e.prototype._next=function(t){var e=this.total;var r=++this.count;if(r<=e){this.destination.next(t);if(r===e){this.destination.complete();this.unsubscribe()}}};return e}(Subscriber);function switchMap(t,e){if(typeof e==="function"){return function(r){return r.pipe(switchMap((function(r,i){return from(t(r,i)).pipe(map((function(t,n){return e(r,t,i,n)})))})))}}return function(e){return e.lift(new SwitchMapOperator(t))}}var SwitchMapOperator=function(){function t(t){this.project=t}t.prototype.call=function(t,e){return e.subscribe(new SwitchMapSubscriber(t,this.project))};return t}();var SwitchMapSubscriber=function(t){__extends(e,t);function e(e,r){var i=t.call(this,e)||this;i.project=r;i.index=0;return i}e.prototype._next=function(t){var e;var r=this.index++;try{e=this.project(t,r)}catch(t){this.destination.error(t);return}this._innerSub(e)};e.prototype._innerSub=function(t){var e=this.innerSubscription;if(e){e.unsubscribe()}var r=new SimpleInnerSubscriber(this);var i=this.destination;i.add(r);this.innerSubscription=innerSubscribe(t,r);if(this.innerSubscription!==r){i.add(this.innerSubscription)}};e.prototype._complete=function(){var e=this.innerSubscription;if(!e||e.closed){t.prototype._complete.call(this)}this.unsubscribe()};e.prototype._unsubscribe=function(){this.innerSubscription=undefined};e.prototype.notifyComplete=function(){this.innerSubscription=undefined;if(this.isStopped){t.prototype._complete.call(this)}};e.prototype.notifyNext=function(t){this.destination.next(t)};return e}(SimpleOuterSubscriber);var currentAction={type:null,entityIds:null,skip:false};var customActionActive=false;function resetCustomAction(){customActionActive=false}function logAction(t,e){setAction(t,e);customActionActive=true}function setAction(t,e){if(customActionActive===false){currentAction.type=t;currentAction.entityIds=e}}function action(t,e){return function(r,i,n){var s=n.value;n.value=function(){var r=[];for(var i=0;i<arguments.length;i++){r[i]=arguments[i]}logAction(t,e);return s.apply(this,r)};return n}}function hasEntity(t,e){return t.hasOwnProperty(e)}function addEntities(t){var e=t.state,r=t.entities,i=t.idKey,n=t.options,s=n===void 0?{}:n,o=t.preAddEntity;var a={};var u=[];var c=false;for(var f=0,l=r;f<l.length;f++){var p=l[f];if(hasEntity(e.entities,p[i])===false){var h=o(p);var d=h[i];a[d]=h;if(s.prepend)u.unshift(d);else u.push(d);c=true}}return c?{newState:Object.assign({},e,{entities:Object.assign({},e.entities,a),ids:s.prepend?__spreadArrays(u,e.ids):__spreadArrays(e.ids,u)}),newIds:u}:null}function isNil(t){return t===null||t===undefined}function coerceArray(t){if(isNil(t)){return[]}return Array.isArray(t)?t:[t]}var DEFAULT_ID_KEY="id";var EntityActions;(function(t){t["Set"]="Set";t["Add"]="Add";t["Update"]="Update";t["Remove"]="Remove"})(EntityActions||(EntityActions={}));var isBrowser=typeof window!=="undefined";var __DEV__=true;function enableAkitaProdMode(){__DEV__=false;if(isBrowser){delete window.$$stores;delete window.$$queries}}function isDev(){return __DEV__}function isObject(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function isArray(t){return Array.isArray(t)}function getActiveEntities(t,e,r){var i;if(isArray(t)){i=t}else{if(isObject(t)){if(isNil(r))return;t=Object.assign({wrap:true},t);var n=e.indexOf(r);if(t.prev){var s=n===0;if(s&&!t.wrap)return;i=s?e[e.length-1]:e[n-1]}else if(t.next){var o=e.length===n+1;if(o&&!t.wrap)return;i=o?e[0]:e[n+1]}}else{if(t===r)return;i=t}}return i}var getInitialEntitiesState=function(){return{entities:{},ids:[],loading:true,error:null}};function isDefined(t){return isNil(t)===false}function isEmpty(t){if(isArray(t)){return t.length===0}return false}function isFunction(t){return typeof t==="function"}function isUndefined(t){return t===undefined}function hasActiveState(t){return t.hasOwnProperty("active")}function isMultiActiveState(t){return isArray(t)}function resolveActiveEntity(t){var e=t.active,r=t.ids,i=t.entities;if(isMultiActiveState(e)){return getExitingActives(e,r)}if(hasEntity(i,e)===false){return null}return e}function getExitingActives(t,e){var r=t.filter((function(t){return e.indexOf(t)>-1}));if(r.length===t.length){return t}return r}function removeEntities(t){var e=t.state,r=t.ids;if(isNil(r))return removeAllEntities(e);var i=e.entities;var n={};for(var s=0,o=e.ids;s<o.length;s++){var a=o[s];if(r.includes(a)===false){n[a]=i[a]}}var u=Object.assign({},e,{entities:n,ids:e.ids.filter((function(t){return r.includes(t)===false}))});if(hasActiveState(e)){u.active=resolveActiveEntity(u)}return u}function removeAllEntities(t){return Object.assign({},t,{entities:{},ids:[],active:isMultiActiveState(t.active)?[]:null})}function toEntitiesObject(t,e,r){var i={entities:{},ids:[]};for(var n=0,s=t;n<s.length;n++){var o=s[n];var a=r(o);i.entities[a[e]]=a;i.ids.push(a[e])}return i}function isEntityState(t){return t.entities&&t.ids}function applyMiddleware(t,e){var r={};for(var i=0,n=Object.keys(t);i<n.length;i++){var s=n[i];r[s]=e(t[s])}return r}function setEntities(t){var e=t.state,r=t.entities,i=t.idKey,n=t.preAddEntity,s=t.isNativePreAdd;var o;var a;if(isArray(r)){var u=toEntitiesObject(r,i,n);o=u.entities;a=u.ids}else if(isEntityState(r)){o=s?r.entities:applyMiddleware(r.entities,n);a=r.ids}else{o=s?r:applyMiddleware(r,n);a=Object.keys(o).map((function(t){return isNaN(t)?t:Number(t)}))}var c=Object.assign({},e,{entities:o,ids:a,loading:false});if(hasActiveState(e)){c.active=resolveActiveEntity(c)}return c}var CONFIG={resettable:false,ttl:null,producerFn:undefined};function getAkitaConfig(){return CONFIG}function getGlobalProducerFn(){return CONFIG.producerFn}function deepFreeze(t){Object.freeze(t);var e=typeof t==="function";var r=Object.prototype.hasOwnProperty;Object.getOwnPropertyNames(t).forEach((function(i){if(r.call(t,i)&&(e?i!=="caller"&&i!=="callee"&&i!=="arguments":true)&&t[i]!==null&&(typeof t[i]==="object"||typeof t[i]==="function")&&!Object.isFrozen(t[i])){deepFreeze(t[i])}}));return t}var $$deleteStore=new Subject;var $$addStore=new ReplaySubject(50,5e3);var $$updateStore=new Subject;function dispatchDeleted(t){$$deleteStore.next(t)}function dispatchAdded(t){$$addStore.next(t)}function dispatchUpdate(t,e){$$updateStore.next({storeName:t,action:e})}function assertStoreHasName(t,e){if(!t){console.error("@StoreConfig({ name }) is missing in "+e)}}function toBoolean(t){return t!=null&&""+t!=="false"}function isPlainObject(t){return toBoolean(t)&&t.constructor.name==="Object"}var configKey="akitaConfig";function StoreConfig(t){return function(e){e[configKey]={idKey:"id"};for(var r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];if(n==="name"){e[configKey]["storeName"]=t[n]}else{e[configKey][n]=t[n]}}}}var __stores__={};var __queries__={};if(isBrowser){window.$$stores=__stores__;window.$$queries=__queries__}var transactionFinished=new Subject;var transactionInProcess=new BehaviorSubject(false);var transactionManager={activeTransactions:0,batchTransaction:null};function startBatch(){if(!isTransactionInProcess()){transactionManager.batchTransaction=new Subject}transactionManager.activeTransactions++;transactionInProcess.next(true)}function endBatch(){if(--transactionManager.activeTransactions===0){transactionManager.batchTransaction.next(true);transactionManager.batchTransaction.complete();transactionInProcess.next(false);transactionFinished.next(true)}}function isTransactionInProcess(){return transactionManager.activeTransactions>0}function commit(){return transactionManager.batchTransaction?transactionManager.batchTransaction.asObservable():of(true)}function applyTransaction(t,e){if(e===void 0){e=undefined}startBatch();try{return t.apply(e)}finally{logAction("@Transaction");endBatch()}}function transaction(){return function(t,e,r){var i=r.value;r.value=function(){var t=this;var e=[];for(var r=0;r<arguments.length;r++){e[r]=arguments[r]}return applyTransaction((function(){return i.apply(t,e)}),this)};return r}}var Store=function(){function t(t,e){if(e===void 0){e={}}this.options=e;this.inTransaction=false;this.cache={active:new BehaviorSubject(false),ttl:null};this.onInit(t)}t.prototype.setLoading=function(t){if(t===void 0){t=false}if(t!==this._value().loading){isDev()&&setAction("Set Loading");this._setState((function(e){return Object.assign({},e,{loading:t})}))}};t.prototype.setHasCache=function(t,e){var r=this;if(e===void 0){e={restartTTL:false}}if(t!==this.cache.active.value){this.cache.active.next(t)}if(e.restartTTL){var i=this.getCacheTTL();if(i){if(this.cache.ttl!==null){clearTimeout(this.cache.ttl)}this.cache.ttl=setTimeout((function(){return r.setHasCache(false)}),i)}}};t.prototype.getValue=function(){return this.storeValue};t.prototype.setError=function(t){if(t!==this._value().error){isDev()&&setAction("Set Error");this._setState((function(e){return Object.assign({},e,{error:t})}))}};t.prototype._select=function(t){return this.store.asObservable().pipe(map((function(e){return t(e.state)})),distinctUntilChanged())};t.prototype._value=function(){return this.storeValue};t.prototype._cache=function(){return this.cache.active};Object.defineProperty(t.prototype,"config",{get:function(){return this.constructor[configKey]||{}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"storeName",{get:function(){return this.config.storeName||this.options.storeName||this.options.name},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"deepFreeze",{get:function(){return this.config.deepFreezeFn||this.options.deepFreezeFn||deepFreeze},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"cacheConfig",{get:function(){return this.config.cache||this.options.cache},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"_producerFn",{get:function(){return this.config.producerFn||this.options.producerFn||getGlobalProducerFn()},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"resettable",{get:function(){return isDefined(this.config.resettable)?this.config.resettable:this.options.resettable},enumerable:false,configurable:true});t.prototype._setState=function(t,e){var r=this;if(e===void 0){e=true}if(isFunction(t)){var i=t(this._value());this.storeValue=__DEV__?this.deepFreeze(i):i}else{this.storeValue=t}if(!this.store){this.store=new BehaviorSubject({state:this.storeValue});if(isDev()){this.store.subscribe((function(t){var e=t.action;if(e){dispatchUpdate(r.storeName,e)}}))}return}if(isTransactionInProcess()){this.handleTransaction();return}this.dispatch(this.storeValue,e)};t.prototype.reset=function(){var t=this;if(this.isResettable()){isDev()&&setAction("Reset");this._setState((function(){return Object.assign({},t._initialState)}));this.setHasCache(false)}else{isDev()&&console.warn("You need to enable the reset functionality")}};t.prototype.update=function(t){isDev()&&setAction("Update");var e;var r=this._value();if(isFunction(t)){e=isFunction(this._producerFn)?this._producerFn(r,t):t(r)}else{e=t}var i=this.akitaPreUpdate(r,Object.assign({},r,e));var n=isPlainObject(r)?i:new r.constructor(i);this._setState(n)};t.prototype.updateStoreConfig=function(t){this.options=Object.assign({},this.options,t)};t.prototype.akitaPreUpdate=function(t,e){return e};t.prototype.ngOnDestroy=function(){this.destroy()};t.prototype.destroy=function(){var t=isBrowser?window.hmrEnabled:false;if(!t&&this===__stores__[this.storeName]){delete __stores__[this.storeName];dispatchDeleted(this.storeName);this.setHasCache(false);this.cache.active.complete();this.store.complete()}};t.prototype.onInit=function(t){__stores__[this.storeName]=this;this._setState((function(){return t}));dispatchAdded(this.storeName);if(this.isResettable()){this._initialState=t}isDev()&&assertStoreHasName(this.storeName,this.constructor.name)};t.prototype.dispatch=function(t,e){if(e===void 0){e=true}var r=undefined;if(e){r=currentAction;resetCustomAction()}this.store.next({state:t,action:r})};t.prototype.watchTransaction=function(){var t=this;commit().subscribe((function(){t.inTransaction=false;t.dispatch(t._value())}))};t.prototype.isResettable=function(){if(this.resettable===false){return false}return this.resettable||getAkitaConfig().resettable};t.prototype.handleTransaction=function(){if(!this.inTransaction){this.watchTransaction();this.inTransaction=true}};t.prototype.getCacheTTL=function(){return this.cacheConfig&&this.cacheConfig.ttl||getAkitaConfig().ttl};return t}();function updateEntities(t){var e=t.state,r=t.ids,i=t.idKey,n=t.newStateOrFn,s=t.preUpdateEntity,o=t.producerFn,a=t.onEntityIdChanges;var u={};var c=false;var f;for(var l=0,p=r;l<p.length;l++){var h=p[l];if(hasEntity(e.entities,h)===false){continue}var d=e.entities[h];var v=void 0;if(isFunction(n)){v=isFunction(o)?o(d,n):n(d)}else{v=n}var y=v.hasOwnProperty(i)&&v[i]!==d[i];var b=void 0;f=h;if(y){c=true;f=v[i]}var g=Object.assign({},d,v);if(isPlainObject(d)){b=g}else{if(isPlainObject(v)){b=new d.constructor(g)}else{b=new v.constructor(g)}}u[f]=s(d,b)}var _=e.ids;var S=e.entities;if(c){var m=r[0];var A=e.entities,O=m,E=__rest(A,[typeof O==="symbol"?O:O+""]);S=E;_=e.ids.map((function(t){return t===m?f:t}));a(m,f)}return Object.assign({},e,{entities:Object.assign({},S,u),ids:_})}var _b;var EntityStore=function(t){__extends(e,t);function e(e,r){if(e===void 0){e={}}if(r===void 0){r={}}var i=t.call(this,Object.assign({},getInitialEntitiesState(),e),r)||this;i.options=r;i.entityActions=new Subject;i.entityIdChanges=new Subject;return i}Object.defineProperty(e.prototype,"selectEntityAction$",{get:function(){return this.entityActions.asObservable()},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"selectEntityIdChanges$",{get:function(){return this.entityIdChanges.asObservable()},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"idKey",{get:function(){return this.config.idKey||this.options.idKey||DEFAULT_ID_KEY},enumerable:false,configurable:true});e.prototype.set=function(t,r){var i=this;if(r===void 0){r={}}if(isNil(t))return;isDev()&&setAction("Set Entity");var n=this.akitaPreAddEntity===e.prototype.akitaPreAddEntity;this.setHasCache(true,{restartTTL:true});this._setState((function(e){var s=setEntities({state:e,entities:t,idKey:i.idKey,preAddEntity:i.akitaPreAddEntity,isNativePreAdd:n});if(isUndefined(r.activeId)===false){s.active=r.activeId}return s}));if(this.hasInitialUIState()){this.handleUICreation()}this.entityActions.next({type:EntityActions.Set,ids:this.ids})};e.prototype.add=function(t,e){if(e===void 0){e={loading:false}}var r=coerceArray(t);if(isEmpty(r))return;var i=addEntities({state:this._value(),preAddEntity:this.akitaPreAddEntity,entities:r,idKey:this.idKey,options:e});if(i){isDev()&&setAction("Add Entity");i.newState.loading=e.loading;this._setState((function(){return i.newState}));if(this.hasInitialUIState()){this.handleUICreation(true)}this.entityActions.next({type:EntityActions.Add,ids:i.newIds})}};e.prototype.update=function(e,r){var i=this;if(isUndefined(r)){t.prototype.update.call(this,e);return}var n=[];if(isFunction(e)){n=this.ids.filter((function(t){return e(i.entities[t])}))}else{n=isNil(e)?this.ids:coerceArray(e)}if(isEmpty(n))return;isDev()&&setAction("Update Entity",n);var s;this._setState((function(t){return updateEntities({idKey:i.idKey,ids:n,preUpdateEntity:i.akitaPreUpdateEntity,state:t,newStateOrFn:r,producerFn:i._producerFn,onEntityIdChanges:function(t,e){s={oldId:t,newId:e};i.entityIdChanges.next(Object.assign({},s,{pending:true}))}})}));if(s){this.entityIdChanges.next(Object.assign({},s,{pending:false}))}this.entityActions.next({type:EntityActions.Update,ids:n})};e.prototype.upsert=function(t,e,r,i){var n=this;if(i===void 0){i={}}var s=coerceArray(t);var o=function(t){return function(e){return hasEntity(n.entities,e)===t}};var a=isFunction(r)?i.baseClass:r?r.baseClass:undefined;var u=isFunction(a);var c=s.filter(o(true));var f=s.filter(o(false)).map((function(t){var i;var s=typeof e==="function"?e({}):e;var o=isFunction(r)?r(t,s):s;var c=Object.assign({},o,(i={},i[n.idKey]=t,i));if(u){return new a(c)}return c}));this.update(c,e);this.add(f);isDev()&&logAction("Upsert Entity")};e.prototype.upsertMany=function(t,e){if(e===void 0){e={}}var r=[];var i=[];var n={};for(var s=0,o=t;s<o.length;s++){var a=o[s];var u=this.akitaPreCheckEntity(a);var c=u[this.idKey];if(hasEntity(this.entities,c)){var f=this._value().entities[c];var l=Object.assign({},this._value().entities[c],u);var p=e.baseClass?new e.baseClass(l):l;var h=this.akitaPreUpdateEntity(f,p);var d=h[this.idKey];n[d]=h;i.push(d)}else{var v=e.baseClass?new e.baseClass(u):u;var h=this.akitaPreAddEntity(v);var d=h[this.idKey];r.push(d);n[d]=h}}isDev()&&logAction("Upsert Many");this._setState((function(t){return Object.assign({},t,{ids:r.length?__spreadArrays(t.ids,r):t.ids,entities:Object.assign({},t.entities,n),loading:!!e.loading})}));i.length&&this.entityActions.next({type:EntityActions.Update,ids:i});r.length&&this.entityActions.next({type:EntityActions.Add,ids:r});if(r.length&&this.hasUIStore()){this.handleUICreation(true)}};e.prototype.replace=function(t,e){var r=coerceArray(t);if(isEmpty(r))return;var i={};for(var n=0,s=r;n<s.length;n++){var o=s[n];e[this.idKey]=o;i[o]=e}isDev()&&setAction("Replace Entity",t);this._setState((function(t){return Object.assign({},t,{entities:Object.assign({},t.entities,i)})}))};e.prototype.move=function(t,e){var r=this.ids.slice();r.splice(e<0?r.length+e:e,0,r.splice(t,1)[0]);isDev()&&setAction("Move Entity");this._setState((function(t){return Object.assign({},t,{entities:Object.assign({},t.entities),ids:r})}))};e.prototype.remove=function(t){var e=this;if(isEmpty(this.ids))return;var r=isDefined(t);var i=[];if(isFunction(t)){i=this.ids.filter((function(r){return t(e.entities[r])}))}else{i=r?coerceArray(t):this.ids}if(isEmpty(i))return;isDev()&&setAction("Remove Entity",i);this._setState((function(t){return removeEntities({state:t,ids:i})}));if(!r){this.setHasCache(false)}this.handleUIRemove(i);this.entityActions.next({type:EntityActions.Remove,ids:i})};e.prototype.updateActive=function(t){var e=coerceArray(this.active);isDev()&&setAction("Update Active",e);this.update(e,t)};e.prototype.setActive=function(t){var e=getActiveEntities(t,this.ids,this.active);if(e===undefined){return}isDev()&&setAction("Set Active",e);this._setActive(e)};e.prototype.addActive=function(t){var e=this;var r=coerceArray(t);if(isEmpty(r))return;var i=r.every((function(t){return e.active.indexOf(t)>-1}));if(i)return;isDev()&&setAction("Add Active",t);this._setState((function(t){var e=Array.from(new Set(__spreadArrays(t.active,r)));return Object.assign({},t,{active:e})}))};e.prototype.removeActive=function(t){var e=this;var r=coerceArray(t);if(isEmpty(r))return;var i=r.some((function(t){return e.active.indexOf(t)>-1}));if(!i)return;isDev()&&setAction("Remove Active",t);this._setState((function(t){return Object.assign({},t,{active:Array.isArray(t.active)?t.active.filter((function(t){return r.indexOf(t)===-1})):null})}))};e.prototype.toggleActive=function(t){var e=this;var r=coerceArray(t);var i=function(t){return function(r){return e.active.includes(r)===t}};var n=r.filter(i(true));var s=r.filter(i(false));this.removeActive(n);this.addActive(s);isDev()&&logAction("Toggle Active")};e.prototype.createUIStore=function(t,e){if(t===void 0){t={}}if(e===void 0){e={}}var r={name:"UI/"+this.storeName,idKey:this.idKey};this.ui=new EntityUIStore(t,Object.assign({},r,e));return this.ui};e.prototype.destroy=function(){t.prototype.destroy.call(this);if(this.ui instanceof e){this.ui.destroy()}this.entityActions.complete()};e.prototype.akitaPreUpdateEntity=function(t,e){return e};e.prototype.akitaPreAddEntity=function(t){return t};e.prototype.akitaPreCheckEntity=function(t){return t};Object.defineProperty(e.prototype,"ids",{get:function(){return this._value().ids},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"entities",{get:function(){return this._value().entities},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"active",{get:function(){return this._value().active},enumerable:false,configurable:true});e.prototype._setActive=function(t){this._setState((function(e){return Object.assign({},e,{active:t})}))};e.prototype.handleUICreation=function(t){var e=this;if(t===void 0){t=false}var r=this.ids;var i=isFunction(this.ui._akitaCreateEntityFn);var n;var s=function(t){var r;var n=e.entities[t];var s=i?e.ui._akitaCreateEntityFn(n):e.ui._akitaCreateEntityFn;return Object.assign((r={},r[e.idKey]=n[e.idKey],r),s)};if(t){n=this.ids.filter((function(t){return isUndefined(e.ui.entities[t])})).map(s)}else{n=r.map(s)}t?this.ui.add(n):this.ui.set(n)};e.prototype.hasInitialUIState=function(){return this.hasUIStore()&&isUndefined(this.ui._akitaCreateEntityFn)===false};e.prototype.handleUIRemove=function(t){if(this.hasUIStore()){this.ui.remove(t)}};e.prototype.hasUIStore=function(){return this.ui instanceof EntityUIStore};return e}(Store);__decorate([transaction(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object,Object,Object,Object]),__metadata("design:returntype",void 0)],EntityStore.prototype,"upsert",null);__decorate([transaction(),__metadata("design:type",Function),__metadata("design:paramtypes",[typeof(_b=typeof T!=="undefined"&&T)==="function"?_b:Object]),__metadata("design:returntype",void 0)],EntityStore.prototype,"toggleActive",null);var EntityUIStore=function(t){__extends(e,t);function e(e,r){if(e===void 0){e={}}if(r===void 0){r={}}return t.call(this,e,r)||this}e.prototype.setInitialEntityState=function(t){this._akitaCreateEntityFn=t};return e}(EntityStore);var Order;(function(t){t["ASC"]="asc";t["DESC"]="desc"})(Order||(Order={}));function isString(t){return typeof t==="string"}var queryConfigKey="akitaQueryConfig";function compareKeys(t){return function(e,r){var i=isFunction(t[0]);return t.some((function(t){if(i){return t(e)!==t(r)}return e[t]!==r[t]}))===false}}var Query=function(){function t(t){this.store=t;this.__store__=t;if(isDev()){__queries__[t.storeName]=this}}t.prototype.select=function(t){var e;if(isFunction(t)){e=t}else if(isString(t)){e=function(e){return e[t]}}else if(Array.isArray(t)){return this.store._select((function(t){return t})).pipe(distinctUntilChanged(compareKeys(t)),map((function(e){if(isFunction(t[0])){return t.map((function(t){return t(e)}))}return t.reduce((function(t,r){t[r]=e[r];return t}),{})})))}else{e=function(t){return t}}return this.store._select(e)};t.prototype.selectLoading=function(){return this.select((function(t){return t.loading}))};t.prototype.selectError=function(){return this.select((function(t){return t.error}))};t.prototype.getValue=function(){return this.store._value()};t.prototype.selectHasCache=function(){return this.store._cache().asObservable()};t.prototype.getHasCache=function(){return this.store._cache().value};Object.defineProperty(t.prototype,"config",{get:function(){return this.constructor[queryConfigKey]},enumerable:false,configurable:true});return t}();var filterNil=function(t){return t.pipe(filter((function(t){return t!==null&&typeof t!=="undefined"})))};function getValue(t,e){if(e.split(".").length===1){return t}var r=e.split(".").slice(1).join(".");return r.split(".").reduce((function(t,e){return t&&t[e]}),t)}function setValue(t,e,r){var i=e.split(".");if(i.length===1){return Object.assign({},t,r)}t=Object.assign({},t);var n=i.length-2;var s=e.split(".").slice(1);s.reduce((function(t,e,i){if(i!==n){t[e]=Object.assign({},t[e]);return t&&t[e]}t[e]=Array.isArray(t[e])||!isObject(t[e])?r:Object.assign({},t[e],r);return t&&t[e]}),t);return t}var _persistStateInit=new ReplaySubject(1);var AkitaPlugin=function(){function t(t,e){this.query=t;if(e&&e.resetFn){if(getAkitaConfig().resettable){this.onReset(e.resetFn)}}}t.prototype.getQuery=function(){return this.query};t.prototype.getStore=function(){return this.getQuery().__store__};t.prototype.isEntityBased=function(t){return toBoolean(t)};t.prototype.selectSource=function(t,e){var r=this;if(this.isEntityBased(t)){return this.getQuery().selectEntity(t).pipe(filterNil)}if(e){return this.getQuery().select((function(t){return getValue(t,r.withStoreName(e))}))}return this.getQuery().select()};t.prototype.getSource=function(t,e){if(this.isEntityBased(t)){return this.getQuery().getEntity(t)}var r=this.getQuery().getValue();if(e){return getValue(r,this.withStoreName(e))}return r};t.prototype.withStoreName=function(t){return this.storeName+"."+t};Object.defineProperty(t.prototype,"storeName",{get:function(){return this.getStore().storeName},enumerable:false,configurable:true});t.prototype.updateStore=function(t,e,r){var i=this;if(this.isEntityBased(e)){this.getStore().update(e,t)}else{if(r){this.getStore()._setState((function(e){return setValue(e,i.withStoreName(r),t)}));return}this.getStore()._setState((function(e){return Object.assign({},e,t)}))}};t.prototype.onReset=function(t){var e=this;var r=this.getStore().reset;this.getStore().reset=function(){var i=[];for(var n=0;n<arguments.length;n++){i[n]=arguments[n]}setTimeout((function(){r.apply(e.getStore(),i);t()}))}};return t}();var paginatorDefaults={pagesControls:false,range:false,startWith:1,cacheTimeout:undefined,clearStoreWithCache:true};var PaginatorPlugin=function(t){__extends(e,t);function e(e,r){if(r===void 0){r={}}var i=t.call(this,e,{resetFn:function(){i.initial=false;i.destroy({clearCache:true,currentPage:1})}})||this;i.query=e;i.config=r;i.metadata=new Map;i.pages=new Map;i.pagination={currentPage:1,perPage:0,total:0,lastPage:0,data:[]};i.initial=true;i.isLoading$=i.query.selectLoading().pipe(delay(0));i.config=Object.assign(paginatorDefaults,r);var n=i.config,s=n.startWith,o=n.cacheTimeout;i.page=new BehaviorSubject(s);if(isObservable(o)){i.clearCacheSubscription=o.subscribe((function(){return i.clearCache()}))}return i}Object.defineProperty(e.prototype,"pageChanges",{get:function(){return this.page.asObservable()},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"currentPage",{get:function(){return this.pagination.currentPage},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isFirst",{get:function(){return this.currentPage===1},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isLast",{get:function(){return this.currentPage===this.pagination.lastPage},enumerable:false,configurable:true});e.prototype.withControls=function(){this.config.pagesControls=true;return this};e.prototype.withRange=function(){this.config.range=true;return this};e.prototype.setLoading=function(t){if(t===void 0){t=true}this.getStore().setLoading(t)};e.prototype.update=function(t){this.pagination=t;this.addPage(t.data)};e.prototype.addPage=function(t){var e=this;this.pages.set(this.currentPage,{ids:t.map((function(t){return t[e.getStore().idKey]}))});this.getStore().upsertMany(t)};e.prototype.clearCache=function(t){if(t===void 0){t={}}if(!this.initial){logAction("@Pagination - Clear Cache");if(t.clearStore!==false&&(this.config.clearStoreWithCache||t.clearStore)){this.getStore().remove()}this.pages=new Map;this.metadata=new Map}this.initial=false};e.prototype.clearPage=function(t){this.pages.delete(t)};e.prototype.destroy=function(t){var e=t===void 0?{}:t,r=e.clearCache,i=e.currentPage;if(this.clearCacheSubscription){this.clearCacheSubscription.unsubscribe()}if(r){this.clearCache()}if(!isUndefined(i)){this.setPage(i)}this.initial=true};e.prototype.isPageActive=function(t){return this.currentPage===t};e.prototype.setPage=function(t){if(t!==this.currentPage||!this.hasPage(t)){this.page.next(this.pagination.currentPage=t)}};e.prototype.nextPage=function(){if(this.currentPage!==this.pagination.lastPage){this.setPage(this.pagination.currentPage+1)}};e.prototype.prevPage=function(){if(this.pagination.currentPage>1){this.setPage(this.pagination.currentPage-1)}};e.prototype.setLastPage=function(){this.setPage(this.pagination.lastPage)};e.prototype.setFirstPage=function(){this.setPage(1)};e.prototype.hasPage=function(t){return this.pages.has(t)};e.prototype.getPage=function(t){var e=this;var r=this.pagination.currentPage;if(this.hasPage(r)){return this.selectPage(r)}else{this.setLoading(true);return from(t()).pipe(switchMap((function(t){r=t.currentPage;applyTransaction((function(){e.setLoading(false);e.update(t)}));return e.selectPage(r)})))}};e.prototype.getQuery=function(){return this.query};e.prototype.refreshCurrentPage=function(){if(isNil(this.currentPage)===false){this.clearPage(this.currentPage);this.setPage(this.currentPage)}};e.prototype.getFrom=function(){if(this.isFirst){return 1}return(this.currentPage-1)*this.pagination.perPage+1};e.prototype.getTo=function(){if(this.isLast){return this.pagination.total}return this.currentPage*this.pagination.perPage};e.prototype.selectPage=function(t){var e=this;return this.query.selectAll({asObject:true}).pipe(take(1),map((function(r){var i=Object.assign({},e.pagination,{data:e.pages.get(t).ids.map((function(t){return r[t]}))});var n=e.config,s=n.range,o=n.pagesControls;if(isNaN(e.pagination.total)){if(i.lastPage===1){i.total=i.data?i.data.length:0}else{i.total=i.perPage*i.lastPage}e.pagination.total=i.total}if(s){i.from=e.getFrom();i.to=e.getTo()}if(o){i.pageControls=generatePages(e.pagination.total,e.pagination.perPage)}return i})))};return e}(AkitaPlugin);__decorate([action("@Pagination - New Page"),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],PaginatorPlugin.prototype,"update",null);function generatePages(t,e){var r=Math.ceil(t/e);var i=[];for(var n=0;n<r;n++){i.push(n+1)}return i}var StoreAction;(function(t){t["Update"]="UPDATE"})(StoreAction||(StoreAction={}));var EntityStoreAction;(function(t){t["Update"]="UPDATE";t["AddEntities"]="ADD_ENTITIES";t["SetEntities"]="SET_ENTITIES";t["UpdateEntities"]="UPDATE_ENTITIES";t["RemoveEntities"]="REMOVE_ENTITIES";t["UpsertEntities"]="UPSERT_ENTITIES";t["UpsertManyEntities"]="UPSERT_MANY_ENTITIES"})(EntityStoreAction||(EntityStoreAction={}));export{Query as Q,SimpleOuterSubscriber as S,SimpleInnerSubscriber as a,filter as b,StoreConfig as c,distinctUntilChanged as d,enableAkitaProdMode as e,from as f,Store as g,innerSubscribe as i,map as m};
@@ -1 +0,0 @@
1
- var __extends=this&&this.__extends||function(){var r=function(e,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]};return r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();function isFunction(r){return typeof r==="function"}var _enable_super_gross_mode_that_will_cause_bad_things=false;var config={Promise:undefined,set useDeprecatedSynchronousErrorHandling(r){if(r){var e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else if(_enable_super_gross_mode_that_will_cause_bad_things){console.log("RxJS: Back to a better error behavior. Thank you. <3")}_enable_super_gross_mode_that_will_cause_bad_things=r},get useDeprecatedSynchronousErrorHandling(){return _enable_super_gross_mode_that_will_cause_bad_things}};function hostReportError(r){setTimeout((function(){throw r}),0)}var empty={closed:true,next:function(r){},error:function(r){if(config.useDeprecatedSynchronousErrorHandling){throw r}else{hostReportError(r)}},complete:function(){}};var isArray=function(){return Array.isArray||function(r){return r&&typeof r.length==="number"}}();function isObject(r){return r!==null&&typeof r==="object"}var UnsubscriptionErrorImpl=function(){function r(r){Error.call(this);this.message=r?r.length+" errors occurred during unsubscription:\n"+r.map((function(r,e){return e+1+") "+r.toString()})).join("\n "):"";this.name="UnsubscriptionError";this.errors=r;return this}r.prototype=Object.create(Error.prototype);return r}();var UnsubscriptionError=UnsubscriptionErrorImpl;var Subscription=function(){function r(r){this.closed=false;this._parentOrParents=null;this._subscriptions=null;if(r){this._ctorUnsubscribe=true;this._unsubscribe=r}}r.prototype.unsubscribe=function(){var e;if(this.closed){return}var t=this,n=t._parentOrParents,i=t._ctorUnsubscribe,s=t._unsubscribe,o=t._subscriptions;this.closed=true;this._parentOrParents=null;this._subscriptions=null;if(n instanceof r){n.remove(this)}else if(n!==null){for(var u=0;u<n.length;++u){var c=n[u];c.remove(this)}}if(isFunction(s)){if(i){this._unsubscribe=undefined}try{s.call(this)}catch(r){e=r instanceof UnsubscriptionError?flattenUnsubscriptionErrors(r.errors):[r]}}if(isArray(o)){var u=-1;var a=o.length;while(++u<a){var h=o[u];if(isObject(h)){try{h.unsubscribe()}catch(r){e=e||[];if(r instanceof UnsubscriptionError){e=e.concat(flattenUnsubscriptionErrors(r.errors))}else{e.push(r)}}}}}if(e){throw new UnsubscriptionError(e)}};r.prototype.add=function(e){var t=e;if(!e){return r.EMPTY}switch(typeof e){case"function":t=new r(e);case"object":if(t===this||t.closed||typeof t.unsubscribe!=="function"){return t}else if(this.closed){t.unsubscribe();return t}else if(!(t instanceof r)){var n=t;t=new r;t._subscriptions=[n]}break;default:{throw new Error("unrecognized teardown "+e+" added to Subscription.")}}var i=t._parentOrParents;if(i===null){t._parentOrParents=this}else if(i instanceof r){if(i===this){return t}t._parentOrParents=[i,this]}else if(i.indexOf(this)===-1){i.push(this)}else{return t}var s=this._subscriptions;if(s===null){this._subscriptions=[t]}else{s.push(t)}return t};r.prototype.remove=function(r){var e=this._subscriptions;if(e){var t=e.indexOf(r);if(t!==-1){e.splice(t,1)}}};return r}();Subscription.EMPTY=function(r){r.closed=true;return r}(new Subscription);function flattenUnsubscriptionErrors(r){return r.reduce((function(r,e){return r.concat(e instanceof UnsubscriptionError?e.errors:e)}),[])}var rxSubscriber=function(){return typeof Symbol==="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}();var Subscriber=function(r){__extends(e,r);function e(t,n,i){var s=r.call(this)||this;s.syncErrorValue=null;s.syncErrorThrown=false;s.syncErrorThrowable=false;s.isStopped=false;switch(arguments.length){case 0:s.destination=empty;break;case 1:if(!t){s.destination=empty;break}if(typeof t==="object"){if(t instanceof e){s.syncErrorThrowable=t.syncErrorThrowable;s.destination=t;t.add(s)}else{s.syncErrorThrowable=true;s.destination=new SafeSubscriber(s,t)}break}default:s.syncErrorThrowable=true;s.destination=new SafeSubscriber(s,t,n,i);break}return s}e.prototype[rxSubscriber]=function(){return this};e.create=function(r,t,n){var i=new e(r,t,n);i.syncErrorThrowable=false;return i};e.prototype.next=function(r){if(!this.isStopped){this._next(r)}};e.prototype.error=function(r){if(!this.isStopped){this.isStopped=true;this._error(r)}};e.prototype.complete=function(){if(!this.isStopped){this.isStopped=true;this._complete()}};e.prototype.unsubscribe=function(){if(this.closed){return}this.isStopped=true;r.prototype.unsubscribe.call(this)};e.prototype._next=function(r){this.destination.next(r)};e.prototype._error=function(r){this.destination.error(r);this.unsubscribe()};e.prototype._complete=function(){this.destination.complete();this.unsubscribe()};e.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;this._parentOrParents=null;this.unsubscribe();this.closed=false;this.isStopped=false;this._parentOrParents=r;return this};return e}(Subscription);var SafeSubscriber=function(r){__extends(e,r);function e(e,t,n,i){var s=r.call(this)||this;s._parentSubscriber=e;var o;var u=s;if(isFunction(t)){o=t}else if(t){o=t.next;n=t.error;i=t.complete;if(t!==empty){u=Object.create(t);if(isFunction(u.unsubscribe)){s.add(u.unsubscribe.bind(u))}u.unsubscribe=s.unsubscribe.bind(s)}}s._context=u;s._next=o;s._error=n;s._complete=i;return s}e.prototype.next=function(r){if(!this.isStopped&&this._next){var e=this._parentSubscriber;if(!config.useDeprecatedSynchronousErrorHandling||!e.syncErrorThrowable){this.__tryOrUnsub(this._next,r)}else if(this.__tryOrSetError(e,this._next,r)){this.unsubscribe()}}};e.prototype.error=function(r){if(!this.isStopped){var e=this._parentSubscriber;var t=config.useDeprecatedSynchronousErrorHandling;if(this._error){if(!t||!e.syncErrorThrowable){this.__tryOrUnsub(this._error,r);this.unsubscribe()}else{this.__tryOrSetError(e,this._error,r);this.unsubscribe()}}else if(!e.syncErrorThrowable){this.unsubscribe();if(t){throw r}hostReportError(r)}else{if(t){e.syncErrorValue=r;e.syncErrorThrown=true}else{hostReportError(r)}this.unsubscribe()}}};e.prototype.complete=function(){var r=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var t=function(){return r._complete.call(r._context)};if(!config.useDeprecatedSynchronousErrorHandling||!e.syncErrorThrowable){this.__tryOrUnsub(t);this.unsubscribe()}else{this.__tryOrSetError(e,t);this.unsubscribe()}}else{this.unsubscribe()}}};e.prototype.__tryOrUnsub=function(r,e){try{r.call(this._context,e)}catch(r){this.unsubscribe();if(config.useDeprecatedSynchronousErrorHandling){throw r}else{hostReportError(r)}}};e.prototype.__tryOrSetError=function(r,e,t){if(!config.useDeprecatedSynchronousErrorHandling){throw new Error("bad call")}try{e.call(this._context,t)}catch(e){if(config.useDeprecatedSynchronousErrorHandling){r.syncErrorValue=e;r.syncErrorThrown=true;return true}else{hostReportError(e);return true}}return false};e.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null;this._parentSubscriber=null;r.unsubscribe()};return e}(Subscriber);function canReportError(r){while(r){var e=r.closed,t=r.destination,n=r.isStopped;if(e||n){return false}else if(t&&t instanceof Subscriber){r=t}else{r=null}}return true}function toSubscriber(r,e,t){if(r){if(r instanceof Subscriber){return r}if(r[rxSubscriber]){return r[rxSubscriber]()}}if(!r&&!e&&!t){return new Subscriber(empty)}return new Subscriber(r,e,t)}var observable=function(){return typeof Symbol==="function"&&Symbol.observable||"@@observable"}();function identity(r){return r}function pipeFromArray(r){if(r.length===0){return identity}if(r.length===1){return r[0]}return function e(t){return r.reduce((function(r,e){return e(r)}),t)}}var Observable=function(){function r(r){this._isScalar=false;if(r){this._subscribe=r}}r.prototype.lift=function(e){var t=new r;t.source=this;t.operator=e;return t};r.prototype.subscribe=function(r,e,t){var n=this.operator;var i=toSubscriber(r,e,t);if(n){i.add(n.call(i,this.source))}else{i.add(this.source||config.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i))}if(config.useDeprecatedSynchronousErrorHandling){if(i.syncErrorThrowable){i.syncErrorThrowable=false;if(i.syncErrorThrown){throw i.syncErrorValue}}}return i};r.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(e){if(config.useDeprecatedSynchronousErrorHandling){r.syncErrorThrown=true;r.syncErrorValue=e}if(canReportError(r)){r.error(e)}else{console.warn(e)}}};r.prototype.forEach=function(r,e){var t=this;e=getPromiseCtor(e);return new e((function(e,n){var i;i=t.subscribe((function(e){try{r(e)}catch(r){n(r);if(i){i.unsubscribe()}}}),n,e)}))};r.prototype._subscribe=function(r){var e=this.source;return e&&e.subscribe(r)};r.prototype[observable]=function(){return this};r.prototype.pipe=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}if(r.length===0){return this}return pipeFromArray(r)(this)};r.prototype.toPromise=function(r){var e=this;r=getPromiseCtor(r);return new r((function(r,t){var n;e.subscribe((function(r){return n=r}),(function(r){return t(r)}),(function(){return r(n)}))}))};return r}();Observable.create=function(r){return new Observable(r)};function getPromiseCtor(r){if(!r){r=Promise}if(!r){throw new Error("no Promise impl found")}return r}var Action=function(r){__extends(e,r);function e(e,t){return r.call(this)||this}e.prototype.schedule=function(r,e){if(e===void 0){e=0}return this};return e}(Subscription);var AsyncAction=function(r){__extends(e,r);function e(e,t){var n=r.call(this,e,t)||this;n.scheduler=e;n.work=t;n.pending=false;return n}e.prototype.schedule=function(r,e){if(e===void 0){e=0}if(this.closed){return this}this.state=r;var t=this.id;var n=this.scheduler;if(t!=null){this.id=this.recycleAsyncId(n,t,e)}this.pending=true;this.delay=e;this.id=this.id||this.requestAsyncId(n,this.id,e);return this};e.prototype.requestAsyncId=function(r,e,t){if(t===void 0){t=0}return setInterval(r.flush.bind(r,this),t)};e.prototype.recycleAsyncId=function(r,e,t){if(t===void 0){t=0}if(t!==null&&this.delay===t&&this.pending===false){return e}clearInterval(e);return undefined};e.prototype.execute=function(r,e){if(this.closed){return new Error("executing a cancelled action")}this.pending=false;var t=this._execute(r,e);if(t){return t}else if(this.pending===false&&this.id!=null){this.id=this.recycleAsyncId(this.scheduler,this.id,null)}};e.prototype._execute=function(r,e){var t=false;var n=undefined;try{this.work(r)}catch(r){t=true;n=!!r&&r||new Error(r)}if(t){this.unsubscribe();return n}};e.prototype._unsubscribe=function(){var r=this.id;var e=this.scheduler;var t=e.actions;var n=t.indexOf(this);this.work=null;this.state=null;this.pending=false;this.scheduler=null;if(n!==-1){t.splice(n,1)}if(r!=null){this.id=this.recycleAsyncId(e,r,null)}this.delay=null};return e}(Action);var Scheduler=function(){function r(e,t){if(t===void 0){t=r.now}this.SchedulerAction=e;this.now=t}r.prototype.schedule=function(r,e,t){if(e===void 0){e=0}return new this.SchedulerAction(this,r).schedule(t,e)};return r}();Scheduler.now=function(){return Date.now()};var AsyncScheduler=function(r){__extends(e,r);function e(t,n){if(n===void 0){n=Scheduler.now}var i=r.call(this,t,(function(){if(e.delegate&&e.delegate!==i){return e.delegate.now()}else{return n()}}))||this;i.actions=[];i.active=false;i.scheduled=undefined;return i}e.prototype.schedule=function(t,n,i){if(n===void 0){n=0}if(e.delegate&&e.delegate!==this){return e.delegate.schedule(t,n,i)}else{return r.prototype.schedule.call(this,t,n,i)}};e.prototype.flush=function(r){var e=this.actions;if(this.active){e.push(r);return}var t;this.active=true;do{if(t=r.execute(r.state,r.delay)){break}}while(r=e.shift());this.active=false;if(t){while(r=e.shift()){r.unsubscribe()}throw t}};return e}(Scheduler);var EMPTY=new Observable((function(r){return r.complete()}));function empty$1(r){return r?emptyScheduled(r):EMPTY}function emptyScheduled(r){return new Observable((function(e){return r.schedule((function(){return e.complete()}))}))}function isScheduler(r){return r&&typeof r.schedule==="function"}var subscribeToArray=function(r){return function(e){for(var t=0,n=r.length;t<n&&!e.closed;t++){e.next(r[t])}e.complete()}};function scheduleArray(r,e){return new Observable((function(t){var n=new Subscription;var i=0;n.add(e.schedule((function(){if(i===r.length){t.complete();return}t.next(r[i++]);if(!t.closed){n.add(this.schedule())}})));return n}))}function fromArray(r,e){if(!e){return new Observable(subscribeToArray(r))}else{return scheduleArray(r,e)}}function of(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var t=r[r.length-1];if(isScheduler(t)){r.pop();return scheduleArray(r,t)}else{return fromArray(r)}}function throwError(r,e){if(!e){return new Observable((function(e){return e.error(r)}))}else{return new Observable((function(t){return e.schedule(dispatch,0,{error:r,subscriber:t})}))}}function dispatch(r){var e=r.error,t=r.subscriber;t.error(e)}var NotificationKind;(function(r){r["NEXT"]="N";r["ERROR"]="E";r["COMPLETE"]="C"})(NotificationKind||(NotificationKind={}));var Notification=function(){function r(r,e,t){this.kind=r;this.value=e;this.error=t;this.hasValue=r==="N"}r.prototype.observe=function(r){switch(this.kind){case"N":return r.next&&r.next(this.value);case"E":return r.error&&r.error(this.error);case"C":return r.complete&&r.complete()}};r.prototype.do=function(r,e,t){var n=this.kind;switch(n){case"N":return r&&r(this.value);case"E":return e&&e(this.error);case"C":return t&&t()}};r.prototype.accept=function(r,e,t){if(r&&typeof r.next==="function"){return this.observe(r)}else{return this.do(r,e,t)}};r.prototype.toObservable=function(){var r=this.kind;switch(r){case"N":return of(this.value);case"E":return throwError(this.error);case"C":return empty$1()}throw new Error("unexpected notification kind value")};r.createNext=function(e){if(typeof e!=="undefined"){return new r("N",e)}return r.undefinedValueNotification};r.createError=function(e){return new r("E",undefined,e)};r.createComplete=function(){return r.completeNotification};return r}();Notification.completeNotification=new Notification("C");Notification.undefinedValueNotification=new Notification("N",undefined);var asyncScheduler=new AsyncScheduler(AsyncAction);var async=asyncScheduler;function isDate(r){return r instanceof Date&&!isNaN(+r)}function delay(r,e){if(e===void 0){e=async}var t=isDate(r);var n=t?+r-e.now():Math.abs(r);return function(r){return r.lift(new DelayOperator(n,e))}}var DelayOperator=function(){function r(r,e){this.delay=r;this.scheduler=e}r.prototype.call=function(r,e){return e.subscribe(new DelaySubscriber(r,this.delay,this.scheduler))};return r}();var DelaySubscriber=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e)||this;i.delay=t;i.scheduler=n;i.queue=[];i.active=false;i.errored=false;return i}e.dispatch=function(r){var e=r.source;var t=e.queue;var n=r.scheduler;var i=r.destination;while(t.length>0&&t[0].time-n.now()<=0){t.shift().notification.observe(i)}if(t.length>0){var s=Math.max(0,t[0].time-n.now());this.schedule(r,s)}else{this.unsubscribe();e.active=false}};e.prototype._schedule=function(r){this.active=true;var t=this.destination;t.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))};e.prototype.scheduleNotification=function(r){if(this.errored===true){return}var e=this.scheduler;var t=new DelayMessage(e.now()+this.delay,r);this.queue.push(t);if(this.active===false){this._schedule(e)}};e.prototype._next=function(r){this.scheduleNotification(Notification.createNext(r))};e.prototype._error=function(r){this.errored=true;this.queue=[];this.destination.error(r);this.unsubscribe()};e.prototype._complete=function(){this.scheduleNotification(Notification.createComplete());this.unsubscribe()};return e}(Subscriber);var DelayMessage=function(){function r(r,e){this.time=r;this.notification=e}return r}();export{AsyncAction as A,Notification as N,Observable as O,Subscription as S,Subscriber as a,AsyncScheduler as b,scheduleArray as c,of as d,empty$1 as e,delay as f,isArray as g,hostReportError as h,isObject as i,isFunction as j,async as k,isScheduler as l,observable as o,rxSubscriber as r,subscribeToArray as s};