@bravobit/bb-foundation 0.14.2 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/README.md +47 -47
  2. package/auth/bravobit-bb-foundation-auth.d.ts +5 -5
  3. package/auth/lib/auth.interceptor.d.ts +21 -21
  4. package/auth/lib/auth.module.d.ts +15 -15
  5. package/auth/lib/auth.service.d.ts +59 -59
  6. package/auth/lib/auth.session.d.ts +34 -34
  7. package/auth/lib/directives/authenticated.directive.d.ts +14 -14
  8. package/auth/lib/directives/permission.directive.d.ts +24 -24
  9. package/auth/lib/directives/role.directive.d.ts +16 -16
  10. package/auth/lib/guards/anonymous.guard.d.ts +11 -11
  11. package/auth/lib/guards/authenticated.guard.d.ts +11 -11
  12. package/auth/lib/helpers/jwt.helper.d.ts +8 -8
  13. package/auth/lib/helpers/mapper.helper.d.ts +23 -23
  14. package/auth/lib/interfaces/config.interface.d.ts +12 -12
  15. package/auth/lib/interfaces/mapper.interface.d.ts +19 -19
  16. package/auth/lib/interfaces/provider.interface.d.ts +16 -16
  17. package/auth/lib/interfaces/token.interface.d.ts +11 -11
  18. package/auth/lib/permissions.service.d.ts +14 -14
  19. package/auth/lib/providers/email.provider.d.ts +15 -15
  20. package/auth/lib/providers/verify.provider.d.ts +13 -13
  21. package/auth/lib/tokens/use-authorization.token.d.ts +2 -2
  22. package/auth/public_api.d.ts +18 -18
  23. package/bravobit-bb-foundation.d.ts +5 -5
  24. package/bundles/bravobit-bb-foundation-auth.umd.js +1400 -1402
  25. package/bundles/bravobit-bb-foundation-auth.umd.js.map +1 -1
  26. package/bundles/bravobit-bb-foundation-collections.umd.js +851 -0
  27. package/bundles/bravobit-bb-foundation-collections.umd.js.map +1 -0
  28. package/bundles/bravobit-bb-foundation-dashboard.umd.js +817 -819
  29. package/bundles/bravobit-bb-foundation-dashboard.umd.js.map +1 -1
  30. package/bundles/bravobit-bb-foundation-dialog.umd.js +649 -651
  31. package/bundles/bravobit-bb-foundation-dialog.umd.js.map +1 -1
  32. package/bundles/bravobit-bb-foundation-elements.umd.js +2651 -2653
  33. package/bundles/bravobit-bb-foundation-elements.umd.js.map +1 -1
  34. package/bundles/bravobit-bb-foundation-http.umd.js +488 -490
  35. package/bundles/bravobit-bb-foundation-http.umd.js.map +1 -1
  36. package/bundles/bravobit-bb-foundation-localize.umd.js +1208 -1210
  37. package/bundles/bravobit-bb-foundation-localize.umd.js.map +1 -1
  38. package/bundles/bravobit-bb-foundation-notifications.umd.js +743 -745
  39. package/bundles/bravobit-bb-foundation-notifications.umd.js.map +1 -1
  40. package/bundles/bravobit-bb-foundation-recaptcha.umd.js +640 -642
  41. package/bundles/bravobit-bb-foundation-recaptcha.umd.js.map +1 -1
  42. package/bundles/bravobit-bb-foundation-rxjs.umd.js +13 -13
  43. package/bundles/bravobit-bb-foundation-rxjs.umd.js.map +1 -1
  44. package/bundles/bravobit-bb-foundation-storage.umd.js +756 -758
  45. package/bundles/bravobit-bb-foundation-storage.umd.js.map +1 -1
  46. package/bundles/bravobit-bb-foundation-table.umd.js +993 -995
  47. package/bundles/bravobit-bb-foundation-table.umd.js.map +1 -1
  48. package/bundles/bravobit-bb-foundation.umd.js +1336 -1263
  49. package/bundles/bravobit-bb-foundation.umd.js.map +1 -1
  50. package/collections/bravobit-bb-foundation-collections.d.ts +5 -0
  51. package/collections/lib/collection.d.ts +40 -0
  52. package/collections/lib/collections.module.d.ts +10 -0
  53. package/collections/lib/components/collections-pager/collections-pager.component.d.ts +34 -0
  54. package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +12 -0
  55. package/collections/lib/components/collections.directive.d.ts +17 -0
  56. package/collections/lib/interfaces/collection.interface.d.ts +26 -0
  57. package/collections/lib/providers/api-collection.provider.d.ts +15 -0
  58. package/collections/lib/providers/collection.provider.d.ts +6 -0
  59. package/collections/lib/providers/local-collection.provider.d.ts +8 -0
  60. package/collections/package.json +10 -0
  61. package/collections/public_api.d.ts +9 -0
  62. package/dashboard/bravobit-bb-foundation-dashboard.d.ts +5 -5
  63. package/dashboard/lib/dashboard/dashboard.component.d.ts +19 -19
  64. package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +11 -11
  65. package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +9 -9
  66. package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +11 -11
  67. package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +21 -21
  68. package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +27 -27
  69. package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +16 -16
  70. package/dashboard/lib/dashboard.module.d.ts +16 -16
  71. package/dashboard/public_api.d.ts +8 -8
  72. package/dialog/bravobit-bb-foundation-dialog.d.ts +5 -5
  73. package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +5 -5
  74. package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +16 -16
  75. package/dialog/lib/dialog-container/dialog-container.component.d.ts +24 -24
  76. package/dialog/lib/dialog-header/dialog-header.component.d.ts +9 -9
  77. package/dialog/lib/dialog-link/dialog-link.component.d.ts +5 -5
  78. package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +12 -12
  79. package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +22 -22
  80. package/dialog/lib/dialog.injector.d.ts +8 -8
  81. package/dialog/lib/dialog.insertion.d.ts +8 -8
  82. package/dialog/lib/dialog.interfaces.d.ts +3 -3
  83. package/dialog/lib/dialog.module.d.ts +19 -19
  84. package/dialog/lib/dialog.ref.d.ts +8 -8
  85. package/dialog/lib/dialog.service.d.ts +19 -19
  86. package/dialog/public_api.d.ts +9 -9
  87. package/elements/bravobit-bb-foundation-elements.d.ts +5 -5
  88. package/elements/lib/avatar/avatar.component.d.ts +25 -25
  89. package/elements/lib/button/button.component.d.ts +23 -23
  90. package/elements/lib/checkbox/checkbox.component.d.ts +27 -27
  91. package/elements/lib/date-picker/date-picker.component.d.ts +69 -69
  92. package/elements/lib/directives/addon.directive.d.ts +9 -9
  93. package/elements/lib/directives/autosize.directive.d.ts +18 -18
  94. package/elements/lib/directives/focus-trap.directive.d.ts +17 -17
  95. package/elements/lib/directives/focus.directive.d.ts +14 -14
  96. package/elements/lib/directives/form-submit.directive.d.ts +17 -17
  97. package/elements/lib/directives/input.directive.d.ts +38 -38
  98. package/elements/lib/directives/template.directive.d.ts +10 -10
  99. package/elements/lib/dropdown/dropdown.component.d.ts +21 -21
  100. package/elements/lib/elements.interfaces.d.ts +25 -25
  101. package/elements/lib/elements.module.d.ts +116 -116
  102. package/elements/lib/file-picker/file-picker.component.d.ts +49 -49
  103. package/elements/lib/form-control/form-control.component.d.ts +21 -21
  104. package/elements/lib/form-error/form-error.component.d.ts +29 -29
  105. package/elements/lib/form-group/form-group.component.d.ts +10 -10
  106. package/elements/lib/icon/icon.component.d.ts +22 -22
  107. package/elements/lib/image-picker/image-picker.component.d.ts +38 -38
  108. package/elements/lib/pipes/file-image.pipe.d.ts +13 -13
  109. package/elements/lib/pipes/file-size.pipe.d.ts +8 -8
  110. package/elements/lib/pipes/relative-time.pipe.d.ts +19 -19
  111. package/elements/lib/spinner/spinner.component.d.ts +12 -12
  112. package/elements/lib/tag/tag.component.d.ts +7 -7
  113. package/elements/public_api.d.ts +25 -25
  114. package/esm2015/auth/bravobit-bb-foundation-auth.js +4 -4
  115. package/esm2015/auth/lib/auth.interceptor.js +95 -95
  116. package/esm2015/auth/lib/auth.module.js +54 -54
  117. package/esm2015/auth/lib/auth.service.js +299 -299
  118. package/esm2015/auth/lib/auth.session.js +136 -136
  119. package/esm2015/auth/lib/directives/authenticated.directive.js +32 -32
  120. package/esm2015/auth/lib/directives/permission.directive.js +81 -81
  121. package/esm2015/auth/lib/directives/role.directive.js +38 -38
  122. package/esm2015/auth/lib/guards/anonymous.guard.js +35 -35
  123. package/esm2015/auth/lib/guards/authenticated.guard.js +36 -36
  124. package/esm2015/auth/lib/helpers/jwt.helper.js +69 -69
  125. package/esm2015/auth/lib/helpers/mapper.helper.js +35 -35
  126. package/esm2015/auth/lib/interfaces/config.interface.js +3 -3
  127. package/esm2015/auth/lib/interfaces/mapper.interface.js +2 -2
  128. package/esm2015/auth/lib/interfaces/provider.interface.js +2 -2
  129. package/esm2015/auth/lib/interfaces/token.interface.js +2 -2
  130. package/esm2015/auth/lib/permissions.service.js +58 -58
  131. package/esm2015/auth/lib/providers/email.provider.js +26 -26
  132. package/esm2015/auth/lib/providers/verify.provider.js +20 -20
  133. package/esm2015/auth/lib/tokens/use-authorization.token.js +3 -3
  134. package/esm2015/auth/public_api.js +19 -19
  135. package/esm2015/bravobit-bb-foundation.js +4 -4
  136. package/esm2015/collections/bravobit-bb-foundation-collections.js +5 -0
  137. package/esm2015/collections/lib/collection.js +88 -0
  138. package/esm2015/collections/lib/collections.module.js +54 -0
  139. package/esm2015/collections/lib/components/collections-pager/collections-pager.component.js +136 -0
  140. package/esm2015/collections/lib/components/collections-viewer/collections-viewer.component.js +39 -0
  141. package/esm2015/collections/lib/components/collections.directive.js +43 -0
  142. package/esm2015/collections/lib/interfaces/collection.interface.js +2 -0
  143. package/esm2015/collections/lib/providers/api-collection.provider.js +69 -0
  144. package/esm2015/collections/lib/providers/collection.provider.js +14 -0
  145. package/esm2015/collections/lib/providers/local-collection.provider.js +16 -0
  146. package/esm2015/collections/public_api.js +10 -0
  147. package/esm2015/dashboard/bravobit-bb-foundation-dashboard.js +4 -4
  148. package/esm2015/dashboard/lib/dashboard/dashboard.component.js +64 -64
  149. package/esm2015/dashboard/lib/dashboard-header/dashboard-header.component.js +41 -41
  150. package/esm2015/dashboard/lib/dashboard-menu/dashboard-menu.component.js +39 -39
  151. package/esm2015/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.js +38 -38
  152. package/esm2015/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.js +83 -83
  153. package/esm2015/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.js +110 -110
  154. package/esm2015/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.js +71 -71
  155. package/esm2015/dashboard/lib/dashboard.module.js +47 -47
  156. package/esm2015/dashboard/public_api.js +9 -9
  157. package/esm2015/dialog/bravobit-bb-foundation-dialog.js +4 -4
  158. package/esm2015/dialog/lib/dialog-actions/dialog-actions.component.js +20 -20
  159. package/esm2015/dialog/lib/dialog-confirm/dialog-confirm.component.js +45 -45
  160. package/esm2015/dialog/lib/dialog-container/dialog-container.component.js +162 -162
  161. package/esm2015/dialog/lib/dialog-header/dialog-header.component.js +33 -33
  162. package/esm2015/dialog/lib/dialog-link/dialog-link.component.js +19 -19
  163. package/esm2015/dialog/lib/dialog-modal/dialog-modal.component.js +54 -54
  164. package/esm2015/dialog/lib/dialog-overlay/dialog-overlay.component.js +143 -143
  165. package/esm2015/dialog/lib/dialog.injector.js +18 -18
  166. package/esm2015/dialog/lib/dialog.insertion.js +16 -16
  167. package/esm2015/dialog/lib/dialog.interfaces.js +3 -3
  168. package/esm2015/dialog/lib/dialog.module.js +74 -74
  169. package/esm2015/dialog/lib/dialog.ref.js +22 -22
  170. package/esm2015/dialog/lib/dialog.service.js +77 -77
  171. package/esm2015/dialog/public_api.js +10 -10
  172. package/esm2015/elements/bravobit-bb-foundation-elements.js +4 -4
  173. package/esm2015/elements/lib/avatar/avatar.component.js +151 -151
  174. package/esm2015/elements/lib/button/button.component.js +79 -79
  175. package/esm2015/elements/lib/checkbox/checkbox.component.js +83 -83
  176. package/esm2015/elements/lib/date-picker/date-picker.component.js +322 -322
  177. package/esm2015/elements/lib/directives/addon.directive.js +29 -29
  178. package/esm2015/elements/lib/directives/autosize.directive.js +74 -74
  179. package/esm2015/elements/lib/directives/focus-trap.directive.js +77 -77
  180. package/esm2015/elements/lib/directives/focus.directive.js +39 -39
  181. package/esm2015/elements/lib/directives/form-submit.directive.js +53 -53
  182. package/esm2015/elements/lib/directives/input.directive.js +139 -139
  183. package/esm2015/elements/lib/directives/template.directive.js +28 -28
  184. package/esm2015/elements/lib/dropdown/dropdown.component.js +111 -111
  185. package/esm2015/elements/lib/elements.interfaces.js +4 -4
  186. package/esm2015/elements/lib/elements.module.js +177 -177
  187. package/esm2015/elements/lib/file-picker/file-picker.component.js +247 -247
  188. package/esm2015/elements/lib/form-control/form-control.component.js +58 -58
  189. package/esm2015/elements/lib/form-error/form-error.component.js +116 -116
  190. package/esm2015/elements/lib/form-group/form-group.component.js +27 -27
  191. package/esm2015/elements/lib/icon/icon.component.js +110 -110
  192. package/esm2015/elements/lib/image-picker/image-picker.component.js +119 -119
  193. package/esm2015/elements/lib/pipes/file-image.pipe.js +45 -45
  194. package/esm2015/elements/lib/pipes/file-size.pipe.js +28 -28
  195. package/esm2015/elements/lib/pipes/relative-time.pipe.js +96 -96
  196. package/esm2015/elements/lib/spinner/spinner.component.js +34 -34
  197. package/esm2015/elements/lib/tag/tag.component.js +26 -26
  198. package/esm2015/elements/public_api.js +26 -26
  199. package/esm2015/http/bravobit-bb-foundation-http.js +4 -4
  200. package/esm2015/http/lib/classes/http.config.js +31 -31
  201. package/esm2015/http/lib/classes/http.error.js +21 -21
  202. package/esm2015/http/lib/http.interfaces.js +2 -2
  203. package/esm2015/http/lib/http.module.js +43 -43
  204. package/esm2015/http/lib/interceptors/base-url.interceptor.js +52 -52
  205. package/esm2015/http/lib/interceptors/error.interceptor.js +33 -33
  206. package/esm2015/http/public_api.js +7 -7
  207. package/esm2015/lib/core/coercions/boolean-coercion.js +4 -4
  208. package/esm2015/lib/core/miscellaneous/regex.js +5 -5
  209. package/esm2015/lib/core/miscellaneous/validator.js +86 -86
  210. package/esm2015/lib/core/mixins/can-disable.js +16 -16
  211. package/esm2015/lib/core/mixins/can-hide-errors.js +16 -16
  212. package/esm2015/lib/core/mixins/can-load.js +16 -16
  213. package/esm2015/lib/core/mixins/constructor.js +2 -2
  214. package/esm2015/lib/core/mixins/has-error.js +16 -16
  215. package/esm2015/lib/core/mixins/is-focused.js +16 -16
  216. package/esm2015/lib/core/mixins/is-grouped.js +16 -16
  217. package/esm2015/lib/core/mixins/is-readonly.js +16 -16
  218. package/esm2015/lib/core/mixins/is-required.js +16 -16
  219. package/esm2015/lib/core/services/clipboard.service.js +72 -0
  220. package/esm2015/lib/core/services/exif.service.js +168 -168
  221. package/esm2015/lib/core/services/file-loader.service.js +90 -90
  222. package/esm2015/lib/core/services/image-converter.service.js +130 -130
  223. package/esm2015/lib/core/services/languages.service.js +74 -74
  224. package/esm2015/lib/core/services/network.service.js +56 -56
  225. package/esm2015/lib/core/services/patch.service.js +65 -65
  226. package/esm2015/lib/core/services/platform.service.js +42 -42
  227. package/esm2015/lib/core/tokens/accept-language.token.js +3 -3
  228. package/esm2015/lib/core/tokens/base-url.token.js +3 -3
  229. package/esm2015/lib/core/tokens/cookie.token.js +3 -3
  230. package/esm2015/lib/core/tokens/location.token.js +6 -6
  231. package/esm2015/lib/core/tokens/navigator.token.js +6 -6
  232. package/esm2015/lib/core/tokens/window.token.js +12 -12
  233. package/esm2015/localize/bravobit-bb-foundation-localize.js +4 -4
  234. package/esm2015/localize/lib/functions/date.function.js +18 -18
  235. package/esm2015/localize/lib/functions/lowercase.function.js +13 -13
  236. package/esm2015/localize/lib/functions/uppercase.function.js +13 -13
  237. package/esm2015/localize/lib/handlers/missing.handler.js +17 -17
  238. package/esm2015/localize/lib/interfaces/config.interfaces.js +10 -10
  239. package/esm2015/localize/lib/interfaces/dictionary.interfaces.js +8 -8
  240. package/esm2015/localize/lib/interfaces/functions.interfaces.js +8 -8
  241. package/esm2015/localize/lib/interfaces/handlers.interfaces.js +2 -2
  242. package/esm2015/localize/lib/interfaces/options.interfaces.js +6 -6
  243. package/esm2015/localize/lib/localizations/dutch.localization.js +53 -53
  244. package/esm2015/localize/lib/localizations/english.localization.js +53 -53
  245. package/esm2015/localize/lib/localize.dictionary.js +137 -137
  246. package/esm2015/localize/lib/localize.module.js +69 -69
  247. package/esm2015/localize/lib/localize.pipe.js +49 -49
  248. package/esm2015/localize/lib/localize.service.js +282 -282
  249. package/esm2015/localize/lib/views/localize-string/localize-string.component.js +99 -99
  250. package/esm2015/localize/lib/views/localize-template-or-string.directive.js +28 -28
  251. package/esm2015/localize/lib/views/localize-template.directive.js +21 -21
  252. package/esm2015/localize/public_api.js +18 -18
  253. package/esm2015/notifications/bravobit-bb-foundation-notifications.js +4 -4
  254. package/esm2015/notifications/lib/notifications-item/notifications-item.component.js +108 -108
  255. package/esm2015/notifications/lib/notifications-list/notifications-list.component.js +56 -56
  256. package/esm2015/notifications/lib/notifications.animations.js +28 -28
  257. package/esm2015/notifications/lib/notifications.injector.js +18 -18
  258. package/esm2015/notifications/lib/notifications.interfaces.js +20 -20
  259. package/esm2015/notifications/lib/notifications.module.js +31 -31
  260. package/esm2015/notifications/lib/notifications.service.js +145 -145
  261. package/esm2015/notifications/public_api.js +4 -4
  262. package/esm2015/public_api.js +30 -29
  263. package/esm2015/recaptcha/bravobit-bb-foundation-recaptcha.js +4 -4
  264. package/esm2015/recaptcha/lib/recaptcha/recaptcha.component.js +199 -199
  265. package/esm2015/recaptcha/lib/recaptcha-loader.service.js +93 -93
  266. package/esm2015/recaptcha/lib/recaptcha.interface.js +3 -3
  267. package/esm2015/recaptcha/lib/recaptcha.module.js +27 -27
  268. package/esm2015/recaptcha/public_api.js +5 -5
  269. package/esm2015/rxjs/bravobit-bb-foundation-rxjs.js +4 -4
  270. package/esm2015/rxjs/lib/operators/combine-latest-map.operator.js +7 -7
  271. package/esm2015/rxjs/lib/operators/filter-nil.operator.js +5 -5
  272. package/esm2015/rxjs/public_api.js +3 -3
  273. package/esm2015/storage/bravobit-bb-foundation-storage.js +4 -4
  274. package/esm2015/storage/lib/interfaces/attributes.interface.js +2 -2
  275. package/esm2015/storage/lib/interfaces/memory.interface.js +2 -2
  276. package/esm2015/storage/lib/interfaces/strategy.interface.js +2 -2
  277. package/esm2015/storage/lib/storage.service.js +111 -111
  278. package/esm2015/storage/lib/strategies/cookie-storage.strategy.js +143 -143
  279. package/esm2015/storage/lib/strategies/memory-storage.strategy.js +56 -56
  280. package/esm2015/storage/lib/strategies/polyfill-storage.strategy.js +102 -102
  281. package/esm2015/storage/public_api.js +8 -8
  282. package/esm2015/table/bravobit-bb-foundation-table.js +4 -4
  283. package/esm2015/table/lib/components/table/table.component.js +183 -183
  284. package/esm2015/table/lib/components/table-cell/table-cell.component.js +19 -19
  285. package/esm2015/table/lib/components/table-header-cell/table-header-cell.component.js +141 -141
  286. package/esm2015/table/lib/components/table-pager/table-pager.component.js +146 -146
  287. package/esm2015/table/lib/data/datasource.data.js +32 -32
  288. package/esm2015/table/lib/data/generic.data.js +73 -73
  289. package/esm2015/table/lib/interfaces/datasource.interface.js +2 -2
  290. package/esm2015/table/lib/interfaces/table.interfaces.js +2 -2
  291. package/esm2015/table/lib/table.module.js +39 -39
  292. package/esm2015/table/public_api.js +10 -10
  293. package/fesm2015/bravobit-bb-foundation-auth.js +915 -915
  294. package/fesm2015/bravobit-bb-foundation-auth.js.map +1 -1
  295. package/fesm2015/bravobit-bb-foundation-collections.js +447 -0
  296. package/fesm2015/bravobit-bb-foundation-collections.js.map +1 -0
  297. package/fesm2015/bravobit-bb-foundation-dashboard.js +434 -434
  298. package/fesm2015/bravobit-bb-foundation-dashboard.js.map +1 -1
  299. package/fesm2015/bravobit-bb-foundation-dialog.js +603 -603
  300. package/fesm2015/bravobit-bb-foundation-dialog.js.map +1 -1
  301. package/fesm2015/bravobit-bb-foundation-elements.js +2076 -2076
  302. package/fesm2015/bravobit-bb-foundation-elements.js.map +1 -1
  303. package/fesm2015/bravobit-bb-foundation-http.js +154 -154
  304. package/fesm2015/bravobit-bb-foundation-http.js.map +1 -1
  305. package/fesm2015/bravobit-bb-foundation-localize.js +796 -796
  306. package/fesm2015/bravobit-bb-foundation-localize.js.map +1 -1
  307. package/fesm2015/bravobit-bb-foundation-notifications.js +364 -364
  308. package/fesm2015/bravobit-bb-foundation-notifications.js.map +1 -1
  309. package/fesm2015/bravobit-bb-foundation-recaptcha.js +297 -297
  310. package/fesm2015/bravobit-bb-foundation-recaptcha.js.map +1 -1
  311. package/fesm2015/bravobit-bb-foundation-rxjs.js +7 -7
  312. package/fesm2015/bravobit-bb-foundation-rxjs.js.map +1 -1
  313. package/fesm2015/bravobit-bb-foundation-storage.js +399 -399
  314. package/fesm2015/bravobit-bb-foundation-storage.js.map +1 -1
  315. package/fesm2015/bravobit-bb-foundation-table.js +578 -578
  316. package/fesm2015/bravobit-bb-foundation-table.js.map +1 -1
  317. package/fesm2015/bravobit-bb-foundation.js +854 -785
  318. package/fesm2015/bravobit-bb-foundation.js.map +1 -1
  319. package/http/bravobit-bb-foundation-http.d.ts +5 -5
  320. package/http/lib/classes/http.config.d.ts +9 -9
  321. package/http/lib/classes/http.error.d.ts +7 -7
  322. package/http/lib/http.interfaces.d.ts +12 -12
  323. package/http/lib/http.module.d.ts +15 -15
  324. package/http/lib/interceptors/base-url.interceptor.d.ts +15 -15
  325. package/http/lib/interceptors/error.interceptor.d.ts +11 -11
  326. package/http/public_api.d.ts +6 -6
  327. package/lib/core/coercions/boolean-coercion.d.ts +1 -1
  328. package/lib/core/miscellaneous/regex.d.ts +4 -4
  329. package/lib/core/miscellaneous/validator.d.ts +13 -13
  330. package/lib/core/mixins/can-disable.d.ts +6 -6
  331. package/lib/core/mixins/can-hide-errors.d.ts +6 -6
  332. package/lib/core/mixins/can-load.d.ts +6 -6
  333. package/lib/core/mixins/constructor.d.ts +1 -1
  334. package/lib/core/mixins/has-error.d.ts +6 -6
  335. package/lib/core/mixins/is-focused.d.ts +6 -6
  336. package/lib/core/mixins/is-grouped.d.ts +6 -6
  337. package/lib/core/mixins/is-readonly.d.ts +6 -6
  338. package/lib/core/mixins/is-required.d.ts +6 -6
  339. package/lib/core/services/clipboard.service.d.ts +18 -0
  340. package/lib/core/services/exif.service.d.ts +15 -15
  341. package/lib/core/services/file-loader.service.d.ts +13 -13
  342. package/lib/core/services/image-converter.service.d.ts +21 -21
  343. package/lib/core/services/languages.service.d.ts +16 -16
  344. package/lib/core/services/network.service.d.ts +14 -14
  345. package/lib/core/services/patch.service.d.ts +16 -16
  346. package/lib/core/services/platform.service.d.ts +18 -18
  347. package/lib/core/tokens/accept-language.token.d.ts +2 -2
  348. package/lib/core/tokens/base-url.token.d.ts +2 -2
  349. package/lib/core/tokens/cookie.token.d.ts +2 -2
  350. package/lib/core/tokens/location.token.d.ts +2 -2
  351. package/lib/core/tokens/navigator.token.d.ts +2 -2
  352. package/lib/core/tokens/window.token.d.ts +2 -2
  353. package/localize/bravobit-bb-foundation-localize.d.ts +5 -5
  354. package/localize/lib/functions/date.function.d.ts +5 -5
  355. package/localize/lib/functions/lowercase.function.d.ts +5 -5
  356. package/localize/lib/functions/uppercase.function.d.ts +5 -5
  357. package/localize/lib/handlers/missing.handler.d.ts +6 -6
  358. package/localize/lib/interfaces/config.interfaces.d.ts +8 -8
  359. package/localize/lib/interfaces/dictionary.interfaces.d.ts +12 -12
  360. package/localize/lib/interfaces/functions.interfaces.d.ts +9 -9
  361. package/localize/lib/interfaces/handlers.interfaces.d.ts +6 -6
  362. package/localize/lib/interfaces/options.interfaces.d.ts +10 -10
  363. package/localize/lib/localizations/dutch.localization.d.ts +51 -51
  364. package/localize/lib/localizations/english.localization.d.ts +51 -51
  365. package/localize/lib/localize.dictionary.d.ts +24 -24
  366. package/localize/lib/localize.module.d.ts +18 -18
  367. package/localize/lib/localize.pipe.d.ts +12 -12
  368. package/localize/lib/localize.service.d.ts +51 -51
  369. package/localize/lib/views/localize-string/localize-string.component.d.ts +23 -23
  370. package/localize/lib/views/localize-template-or-string.directive.d.ts +10 -10
  371. package/localize/lib/views/localize-template.directive.d.ts +9 -9
  372. package/localize/public_api.d.ts +17 -17
  373. package/notifications/bravobit-bb-foundation-notifications.d.ts +5 -5
  374. package/notifications/lib/notifications-item/notifications-item.component.d.ts +34 -34
  375. package/notifications/lib/notifications-list/notifications-list.component.d.ts +16 -16
  376. package/notifications/lib/notifications.animations.d.ts +1 -1
  377. package/notifications/lib/notifications.injector.d.ts +8 -8
  378. package/notifications/lib/notifications.interfaces.d.ts +49 -49
  379. package/notifications/lib/notifications.module.d.ts +13 -13
  380. package/notifications/lib/notifications.service.d.ts +34 -34
  381. package/notifications/public_api.d.ts +3 -3
  382. package/package.json +5 -5
  383. package/public_api.d.ts +26 -25
  384. package/recaptcha/bravobit-bb-foundation-recaptcha.d.ts +5 -5
  385. package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +47 -47
  386. package/recaptcha/lib/recaptcha-loader.service.d.ts +22 -22
  387. package/recaptcha/lib/recaptcha.interface.d.ts +14 -14
  388. package/recaptcha/lib/recaptcha.module.d.ts +10 -10
  389. package/recaptcha/public_api.d.ts +4 -4
  390. package/rxjs/bravobit-bb-foundation-rxjs.d.ts +5 -5
  391. package/rxjs/lib/operators/combine-latest-map.operator.d.ts +8 -8
  392. package/rxjs/lib/operators/filter-nil.operator.d.ts +1 -1
  393. package/rxjs/public_api.d.ts +2 -2
  394. package/storage/bravobit-bb-foundation-storage.d.ts +5 -5
  395. package/storage/lib/interfaces/attributes.interface.d.ts +13 -13
  396. package/storage/lib/interfaces/memory.interface.d.ts +7 -7
  397. package/storage/lib/interfaces/strategy.interface.d.ts +17 -17
  398. package/storage/lib/storage.service.d.ts +26 -26
  399. package/storage/lib/strategies/cookie-storage.strategy.d.ts +20 -20
  400. package/storage/lib/strategies/memory-storage.strategy.d.ts +11 -11
  401. package/storage/lib/strategies/polyfill-storage.strategy.d.ts +15 -15
  402. package/storage/public_api.d.ts +7 -7
  403. package/table/bravobit-bb-foundation-table.d.ts +5 -5
  404. package/table/lib/components/table/table.component.d.ts +48 -48
  405. package/table/lib/components/table-cell/table-cell.component.d.ts +5 -5
  406. package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +29 -29
  407. package/table/lib/components/table-pager/table-pager.component.d.ts +41 -41
  408. package/table/lib/data/datasource.data.d.ts +14 -14
  409. package/table/lib/data/generic.data.d.ts +23 -23
  410. package/table/lib/interfaces/datasource.interface.d.ts +17 -17
  411. package/table/lib/interfaces/table.interfaces.d.ts +1 -1
  412. package/table/lib/table.module.d.ts +14 -14
  413. package/table/public_api.d.ts +9 -9
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/operators'), require('rxjs')) :
3
3
  typeof define === 'function' && define.amd ? define('@bravobit/bb-foundation', ['exports', '@angular/core', '@angular/common', 'rxjs/operators', 'rxjs'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravobit = global.bravobit || {}, global.bravobit['bb-foundation'] = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs));
5
- }(this, (function (exports, i0, common, operators, rxjs) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.bravobit = global.bravobit || {}, global.bravobit["bb-foundation"] = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs));
5
+ })(this, (function (exports, i0, common, operators, rxjs) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -13,1327 +13,1398 @@
13
13
  var d = Object.getOwnPropertyDescriptor(e, k);
14
14
  Object.defineProperty(n, k, d.get ? d : {
15
15
  enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
16
+ get: function () { return e[k]; }
19
17
  });
20
18
  }
21
19
  });
22
20
  }
23
- n['default'] = e;
21
+ n["default"] = e;
24
22
  return Object.freeze(n);
25
23
  }
26
24
 
27
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
26
 
29
- var hasV8BreakIterator;
30
- try {
31
- hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
32
- }
33
- catch (_a) {
34
- hasV8BreakIterator = false;
35
- }
36
- var Platform = /** @class */ (function () {
37
- function Platform(_platformId) {
38
- this._platformId = _platformId;
39
- // Browser check.
40
- this.isBrowser = this._platformId
41
- ? common.isPlatformBrowser(this._platformId)
42
- : typeof document === 'object' && !!document;
43
- // Is checks.
44
- this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
45
- this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
46
- this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
47
- this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
48
- this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
49
- this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
50
- this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
51
- this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
52
- this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
53
- this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
54
- }
55
- return Platform;
56
- }());
57
- Platform.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Platform, deps: [{ token: i0.PLATFORM_ID }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
58
- Platform.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Platform, providedIn: 'root' });
59
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Platform, decorators: [{
60
- type: i0.Injectable,
61
- args: [{
62
- providedIn: 'root'
63
- }]
64
- }], ctorParameters: function () {
65
- return [{ type: Object, decorators: [{
66
- type: i0.Inject,
67
- args: [i0.PLATFORM_ID]
68
- }] }];
27
+ var hasV8BreakIterator;
28
+ try {
29
+ hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
30
+ }
31
+ catch (_a) {
32
+ hasV8BreakIterator = false;
33
+ }
34
+ var Platform = /** @class */ (function () {
35
+ function Platform(_platformId) {
36
+ this._platformId = _platformId;
37
+ // Browser check.
38
+ this.isBrowser = this._platformId
39
+ ? common.isPlatformBrowser(this._platformId)
40
+ : typeof document === 'object' && !!document;
41
+ // Is checks.
42
+ this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
43
+ this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
44
+ this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
45
+ this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
46
+ this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
47
+ this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
48
+ this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
49
+ this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
50
+ this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
51
+ this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
52
+ }
53
+ return Platform;
54
+ }());
55
+ Platform.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Platform, deps: [{ token: i0.PLATFORM_ID }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
56
+ Platform.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Platform, providedIn: 'root' });
57
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Platform, decorators: [{
58
+ type: i0.Injectable,
59
+ args: [{
60
+ providedIn: 'root'
61
+ }]
62
+ }], ctorParameters: function () {
63
+ return [{ type: Object, decorators: [{
64
+ type: i0.Inject,
65
+ args: [i0.PLATFORM_ID]
66
+ }] }];
69
67
  } });
70
68
 
71
- /*! *****************************************************************************
72
- Copyright (c) Microsoft Corporation.
73
-
74
- Permission to use, copy, modify, and/or distribute this software for any
75
- purpose with or without fee is hereby granted.
76
-
77
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
78
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
79
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
80
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
81
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
82
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
83
- PERFORMANCE OF THIS SOFTWARE.
84
- ***************************************************************************** */
85
- /* global Reflect, Promise */
86
- var extendStatics = function (d, b) {
87
- extendStatics = Object.setPrototypeOf ||
88
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
89
- function (d, b) { for (var p in b)
90
- if (Object.prototype.hasOwnProperty.call(b, p))
91
- d[p] = b[p]; };
92
- return extendStatics(d, b);
93
- };
94
- function __extends(d, b) {
95
- if (typeof b !== "function" && b !== null)
96
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
97
- extendStatics(d, b);
98
- function __() { this.constructor = d; }
99
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
100
- }
101
- var __assign = function () {
102
- __assign = Object.assign || function __assign(t) {
103
- for (var s, i = 1, n = arguments.length; i < n; i++) {
104
- s = arguments[i];
105
- for (var p in s)
106
- if (Object.prototype.hasOwnProperty.call(s, p))
107
- t[p] = s[p];
108
- }
109
- return t;
110
- };
111
- return __assign.apply(this, arguments);
112
- };
113
- function __rest(s, e) {
114
- var t = {};
115
- for (var p in s)
116
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
117
- t[p] = s[p];
118
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
119
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
120
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
121
- t[p[i]] = s[p[i]];
122
- }
123
- return t;
124
- }
125
- function __decorate(decorators, target, key, desc) {
126
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
127
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
128
- r = Reflect.decorate(decorators, target, key, desc);
129
- else
130
- for (var i = decorators.length - 1; i >= 0; i--)
131
- if (d = decorators[i])
132
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
133
- return c > 3 && r && Object.defineProperty(target, key, r), r;
134
- }
135
- function __param(paramIndex, decorator) {
136
- return function (target, key) { decorator(target, key, paramIndex); };
137
- }
138
- function __metadata(metadataKey, metadataValue) {
139
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
140
- return Reflect.metadata(metadataKey, metadataValue);
141
- }
142
- function __awaiter(thisArg, _arguments, P, generator) {
143
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
144
- return new (P || (P = Promise))(function (resolve, reject) {
145
- function fulfilled(value) { try {
146
- step(generator.next(value));
147
- }
148
- catch (e) {
149
- reject(e);
150
- } }
151
- function rejected(value) { try {
152
- step(generator["throw"](value));
153
- }
154
- catch (e) {
155
- reject(e);
156
- } }
157
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
158
- step((generator = generator.apply(thisArg, _arguments || [])).next());
159
- });
160
- }
161
- function __generator(thisArg, body) {
162
- var _ = { label: 0, sent: function () { if (t[0] & 1)
163
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
164
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
165
- function verb(n) { return function (v) { return step([n, v]); }; }
166
- function step(op) {
167
- if (f)
168
- throw new TypeError("Generator is already executing.");
169
- while (_)
170
- try {
171
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
172
- return t;
173
- if (y = 0, t)
174
- op = [op[0] & 2, t.value];
175
- switch (op[0]) {
176
- case 0:
177
- case 1:
178
- t = op;
179
- break;
180
- case 4:
181
- _.label++;
182
- return { value: op[1], done: false };
183
- case 5:
184
- _.label++;
185
- y = op[1];
186
- op = [0];
187
- continue;
188
- case 7:
189
- op = _.ops.pop();
190
- _.trys.pop();
191
- continue;
192
- default:
193
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
194
- _ = 0;
195
- continue;
196
- }
197
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
198
- _.label = op[1];
199
- break;
200
- }
201
- if (op[0] === 6 && _.label < t[1]) {
202
- _.label = t[1];
203
- t = op;
204
- break;
205
- }
206
- if (t && _.label < t[2]) {
207
- _.label = t[2];
208
- _.ops.push(op);
209
- break;
210
- }
211
- if (t[2])
212
- _.ops.pop();
213
- _.trys.pop();
214
- continue;
215
- }
216
- op = body.call(thisArg, _);
217
- }
218
- catch (e) {
219
- op = [6, e];
220
- y = 0;
221
- }
222
- finally {
223
- f = t = 0;
224
- }
225
- if (op[0] & 5)
226
- throw op[1];
227
- return { value: op[0] ? op[1] : void 0, done: true };
228
- }
229
- }
230
- var __createBinding = Object.create ? (function (o, m, k, k2) {
231
- if (k2 === undefined)
232
- k2 = k;
233
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
234
- }) : (function (o, m, k, k2) {
235
- if (k2 === undefined)
236
- k2 = k;
237
- o[k2] = m[k];
238
- });
239
- function __exportStar(m, o) {
240
- for (var p in m)
241
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
242
- __createBinding(o, m, p);
243
- }
244
- function __values(o) {
245
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
246
- if (m)
247
- return m.call(o);
248
- if (o && typeof o.length === "number")
249
- return {
250
- next: function () {
251
- if (o && i >= o.length)
252
- o = void 0;
253
- return { value: o && o[i++], done: !o };
254
- }
255
- };
256
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
257
- }
258
- function __read(o, n) {
259
- var m = typeof Symbol === "function" && o[Symbol.iterator];
260
- if (!m)
261
- return o;
262
- var i = m.call(o), r, ar = [], e;
263
- try {
264
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
265
- ar.push(r.value);
266
- }
267
- catch (error) {
268
- e = { error: error };
269
- }
270
- finally {
271
- try {
272
- if (r && !r.done && (m = i["return"]))
273
- m.call(i);
274
- }
275
- finally {
276
- if (e)
277
- throw e.error;
278
- }
279
- }
280
- return ar;
281
- }
282
- /** @deprecated */
283
- function __spread() {
284
- for (var ar = [], i = 0; i < arguments.length; i++)
285
- ar = ar.concat(__read(arguments[i]));
286
- return ar;
287
- }
288
- /** @deprecated */
289
- function __spreadArrays() {
290
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
291
- s += arguments[i].length;
292
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
293
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
294
- r[k] = a[j];
295
- return r;
296
- }
297
- function __spreadArray(to, from, pack) {
298
- if (pack || arguments.length === 2)
299
- for (var i = 0, l = from.length, ar; i < l; i++) {
300
- if (ar || !(i in from)) {
301
- if (!ar)
302
- ar = Array.prototype.slice.call(from, 0, i);
303
- ar[i] = from[i];
304
- }
305
- }
306
- return to.concat(ar || from);
307
- }
308
- function __await(v) {
309
- return this instanceof __await ? (this.v = v, this) : new __await(v);
310
- }
311
- function __asyncGenerator(thisArg, _arguments, generator) {
312
- if (!Symbol.asyncIterator)
313
- throw new TypeError("Symbol.asyncIterator is not defined.");
314
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
315
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
316
- function verb(n) { if (g[n])
317
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
318
- function resume(n, v) { try {
319
- step(g[n](v));
320
- }
321
- catch (e) {
322
- settle(q[0][3], e);
323
- } }
324
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
325
- function fulfill(value) { resume("next", value); }
326
- function reject(value) { resume("throw", value); }
327
- function settle(f, v) { if (f(v), q.shift(), q.length)
328
- resume(q[0][0], q[0][1]); }
329
- }
330
- function __asyncDelegator(o) {
331
- var i, p;
332
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
333
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
334
- }
335
- function __asyncValues(o) {
336
- if (!Symbol.asyncIterator)
337
- throw new TypeError("Symbol.asyncIterator is not defined.");
338
- var m = o[Symbol.asyncIterator], i;
339
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
340
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
341
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
342
- }
343
- function __makeTemplateObject(cooked, raw) {
344
- if (Object.defineProperty) {
345
- Object.defineProperty(cooked, "raw", { value: raw });
346
- }
347
- else {
348
- cooked.raw = raw;
349
- }
350
- return cooked;
351
- }
352
- ;
353
- var __setModuleDefault = Object.create ? (function (o, v) {
354
- Object.defineProperty(o, "default", { enumerable: true, value: v });
355
- }) : function (o, v) {
356
- o["default"] = v;
357
- };
358
- function __importStar(mod) {
359
- if (mod && mod.__esModule)
360
- return mod;
361
- var result = {};
362
- if (mod != null)
363
- for (var k in mod)
364
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
365
- __createBinding(result, mod, k);
366
- __setModuleDefault(result, mod);
367
- return result;
368
- }
369
- function __importDefault(mod) {
370
- return (mod && mod.__esModule) ? mod : { default: mod };
371
- }
372
- function __classPrivateFieldGet(receiver, state, kind, f) {
373
- if (kind === "a" && !f)
374
- throw new TypeError("Private accessor was defined without a getter");
375
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
376
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
377
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
378
- }
379
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
380
- if (kind === "m")
381
- throw new TypeError("Private method is not writable");
382
- if (kind === "a" && !f)
383
- throw new TypeError("Private accessor was defined without a setter");
384
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
385
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
386
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
69
+ /*! *****************************************************************************
70
+ Copyright (c) Microsoft Corporation.
71
+
72
+ Permission to use, copy, modify, and/or distribute this software for any
73
+ purpose with or without fee is hereby granted.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
76
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
77
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
78
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
79
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
80
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
81
+ PERFORMANCE OF THIS SOFTWARE.
82
+ ***************************************************************************** */
83
+ /* global Reflect, Promise */
84
+ var extendStatics = function (d, b) {
85
+ extendStatics = Object.setPrototypeOf ||
86
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
87
+ function (d, b) { for (var p in b)
88
+ if (Object.prototype.hasOwnProperty.call(b, p))
89
+ d[p] = b[p]; };
90
+ return extendStatics(d, b);
91
+ };
92
+ function __extends(d, b) {
93
+ if (typeof b !== "function" && b !== null)
94
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
95
+ extendStatics(d, b);
96
+ function __() { this.constructor = d; }
97
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
98
+ }
99
+ var __assign = function () {
100
+ __assign = Object.assign || function __assign(t) {
101
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
102
+ s = arguments[i];
103
+ for (var p in s)
104
+ if (Object.prototype.hasOwnProperty.call(s, p))
105
+ t[p] = s[p];
106
+ }
107
+ return t;
108
+ };
109
+ return __assign.apply(this, arguments);
110
+ };
111
+ function __rest(s, e) {
112
+ var t = {};
113
+ for (var p in s)
114
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
115
+ t[p] = s[p];
116
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
117
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
118
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
119
+ t[p[i]] = s[p[i]];
120
+ }
121
+ return t;
122
+ }
123
+ function __decorate(decorators, target, key, desc) {
124
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
125
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
126
+ r = Reflect.decorate(decorators, target, key, desc);
127
+ else
128
+ for (var i = decorators.length - 1; i >= 0; i--)
129
+ if (d = decorators[i])
130
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
131
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
132
+ }
133
+ function __param(paramIndex, decorator) {
134
+ return function (target, key) { decorator(target, key, paramIndex); };
135
+ }
136
+ function __metadata(metadataKey, metadataValue) {
137
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
138
+ return Reflect.metadata(metadataKey, metadataValue);
139
+ }
140
+ function __awaiter(thisArg, _arguments, P, generator) {
141
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
142
+ return new (P || (P = Promise))(function (resolve, reject) {
143
+ function fulfilled(value) { try {
144
+ step(generator.next(value));
145
+ }
146
+ catch (e) {
147
+ reject(e);
148
+ } }
149
+ function rejected(value) { try {
150
+ step(generator["throw"](value));
151
+ }
152
+ catch (e) {
153
+ reject(e);
154
+ } }
155
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
156
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
157
+ });
158
+ }
159
+ function __generator(thisArg, body) {
160
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
161
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
162
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
163
+ function verb(n) { return function (v) { return step([n, v]); }; }
164
+ function step(op) {
165
+ if (f)
166
+ throw new TypeError("Generator is already executing.");
167
+ while (_)
168
+ try {
169
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
170
+ return t;
171
+ if (y = 0, t)
172
+ op = [op[0] & 2, t.value];
173
+ switch (op[0]) {
174
+ case 0:
175
+ case 1:
176
+ t = op;
177
+ break;
178
+ case 4:
179
+ _.label++;
180
+ return { value: op[1], done: false };
181
+ case 5:
182
+ _.label++;
183
+ y = op[1];
184
+ op = [0];
185
+ continue;
186
+ case 7:
187
+ op = _.ops.pop();
188
+ _.trys.pop();
189
+ continue;
190
+ default:
191
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
192
+ _ = 0;
193
+ continue;
194
+ }
195
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
196
+ _.label = op[1];
197
+ break;
198
+ }
199
+ if (op[0] === 6 && _.label < t[1]) {
200
+ _.label = t[1];
201
+ t = op;
202
+ break;
203
+ }
204
+ if (t && _.label < t[2]) {
205
+ _.label = t[2];
206
+ _.ops.push(op);
207
+ break;
208
+ }
209
+ if (t[2])
210
+ _.ops.pop();
211
+ _.trys.pop();
212
+ continue;
213
+ }
214
+ op = body.call(thisArg, _);
215
+ }
216
+ catch (e) {
217
+ op = [6, e];
218
+ y = 0;
219
+ }
220
+ finally {
221
+ f = t = 0;
222
+ }
223
+ if (op[0] & 5)
224
+ throw op[1];
225
+ return { value: op[0] ? op[1] : void 0, done: true };
226
+ }
227
+ }
228
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
229
+ if (k2 === undefined)
230
+ k2 = k;
231
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
232
+ }) : (function (o, m, k, k2) {
233
+ if (k2 === undefined)
234
+ k2 = k;
235
+ o[k2] = m[k];
236
+ });
237
+ function __exportStar(m, o) {
238
+ for (var p in m)
239
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
240
+ __createBinding(o, m, p);
241
+ }
242
+ function __values(o) {
243
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
244
+ if (m)
245
+ return m.call(o);
246
+ if (o && typeof o.length === "number")
247
+ return {
248
+ next: function () {
249
+ if (o && i >= o.length)
250
+ o = void 0;
251
+ return { value: o && o[i++], done: !o };
252
+ }
253
+ };
254
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
255
+ }
256
+ function __read(o, n) {
257
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
258
+ if (!m)
259
+ return o;
260
+ var i = m.call(o), r, ar = [], e;
261
+ try {
262
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
263
+ ar.push(r.value);
264
+ }
265
+ catch (error) {
266
+ e = { error: error };
267
+ }
268
+ finally {
269
+ try {
270
+ if (r && !r.done && (m = i["return"]))
271
+ m.call(i);
272
+ }
273
+ finally {
274
+ if (e)
275
+ throw e.error;
276
+ }
277
+ }
278
+ return ar;
279
+ }
280
+ /** @deprecated */
281
+ function __spread() {
282
+ for (var ar = [], i = 0; i < arguments.length; i++)
283
+ ar = ar.concat(__read(arguments[i]));
284
+ return ar;
285
+ }
286
+ /** @deprecated */
287
+ function __spreadArrays() {
288
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
289
+ s += arguments[i].length;
290
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
291
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
292
+ r[k] = a[j];
293
+ return r;
294
+ }
295
+ function __spreadArray(to, from, pack) {
296
+ if (pack || arguments.length === 2)
297
+ for (var i = 0, l = from.length, ar; i < l; i++) {
298
+ if (ar || !(i in from)) {
299
+ if (!ar)
300
+ ar = Array.prototype.slice.call(from, 0, i);
301
+ ar[i] = from[i];
302
+ }
303
+ }
304
+ return to.concat(ar || Array.prototype.slice.call(from));
305
+ }
306
+ function __await(v) {
307
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
308
+ }
309
+ function __asyncGenerator(thisArg, _arguments, generator) {
310
+ if (!Symbol.asyncIterator)
311
+ throw new TypeError("Symbol.asyncIterator is not defined.");
312
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
313
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
314
+ function verb(n) { if (g[n])
315
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
316
+ function resume(n, v) { try {
317
+ step(g[n](v));
318
+ }
319
+ catch (e) {
320
+ settle(q[0][3], e);
321
+ } }
322
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
323
+ function fulfill(value) { resume("next", value); }
324
+ function reject(value) { resume("throw", value); }
325
+ function settle(f, v) { if (f(v), q.shift(), q.length)
326
+ resume(q[0][0], q[0][1]); }
327
+ }
328
+ function __asyncDelegator(o) {
329
+ var i, p;
330
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
331
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
332
+ }
333
+ function __asyncValues(o) {
334
+ if (!Symbol.asyncIterator)
335
+ throw new TypeError("Symbol.asyncIterator is not defined.");
336
+ var m = o[Symbol.asyncIterator], i;
337
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
338
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
339
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
340
+ }
341
+ function __makeTemplateObject(cooked, raw) {
342
+ if (Object.defineProperty) {
343
+ Object.defineProperty(cooked, "raw", { value: raw });
344
+ }
345
+ else {
346
+ cooked.raw = raw;
347
+ }
348
+ return cooked;
349
+ }
350
+ ;
351
+ var __setModuleDefault = Object.create ? (function (o, v) {
352
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
353
+ }) : function (o, v) {
354
+ o["default"] = v;
355
+ };
356
+ function __importStar(mod) {
357
+ if (mod && mod.__esModule)
358
+ return mod;
359
+ var result = {};
360
+ if (mod != null)
361
+ for (var k in mod)
362
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
363
+ __createBinding(result, mod, k);
364
+ __setModuleDefault(result, mod);
365
+ return result;
366
+ }
367
+ function __importDefault(mod) {
368
+ return (mod && mod.__esModule) ? mod : { default: mod };
369
+ }
370
+ function __classPrivateFieldGet(receiver, state, kind, f) {
371
+ if (kind === "a" && !f)
372
+ throw new TypeError("Private accessor was defined without a getter");
373
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
374
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
375
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
376
+ }
377
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
378
+ if (kind === "m")
379
+ throw new TypeError("Private method is not writable");
380
+ if (kind === "a" && !f)
381
+ throw new TypeError("Private accessor was defined without a setter");
382
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
383
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
384
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
387
385
  }
388
386
 
389
- var FileLoader = /** @class */ (function () {
390
- function FileLoader() {
391
- this.isFile = function (input) {
392
- return 'File' in window && input instanceof File;
393
- };
394
- this.isBlob = function (input) {
395
- return 'Blob' in window && input instanceof Blob;
396
- };
397
- this.blobToFile = function (blob, fileName) {
398
- var anyBlob = blob;
399
- anyBlob.lastModifiedDate = new Date();
400
- anyBlob.name = fileName;
401
- return anyBlob;
402
- };
403
- }
404
- FileLoader.prototype.fromDataUrl = function (value, name) {
405
- if (name === void 0) { name = 'file'; }
406
- if (!value) {
407
- return null;
408
- }
409
- try {
410
- // Convert base64 to raw binary data held in a string.
411
- var byteString = window.atob(value.split(',')[1]);
412
- // Separate out the mime component.
413
- var mimeString = value
414
- .split(',')[0]
415
- .split(':')[1]
416
- .split(';')[0];
417
- // Write the bytes of the string to an ArrayBuffer.
418
- var arrayBuffer = new ArrayBuffer(byteString.length);
419
- var uint8Array = new Uint8Array(arrayBuffer);
420
- for (var index = 0; index < byteString.length; index++) {
421
- uint8Array[index] = byteString.charCodeAt(index);
422
- }
423
- var dataView = new DataView(arrayBuffer);
424
- var blob = new Blob([dataView.buffer], { type: mimeString });
425
- return this.createFile(blob, name);
426
- }
427
- catch (_a) {
428
- return null;
429
- }
430
- };
431
- FileLoader.prototype.asDataUrl = function (file) {
432
- return this.read(file, 'dataurl');
433
- };
434
- FileLoader.prototype.asArrayBuffer = function (file) {
435
- return this.read(file, 'arraybuffer');
436
- };
437
- FileLoader.prototype.read = function (file, type) {
438
- return __awaiter(this, void 0, void 0, function () {
439
- var _this = this;
440
- return __generator(this, function (_b) {
441
- return [2 /*return*/, new Promise(function (resolve, reject) {
442
- var isFileLike = _this.isFile(file) || _this.isBlob(file);
443
- if (!file || !isFileLike) {
444
- return reject('Invalid file');
445
- }
446
- var reader = new FileReader();
447
- reader.onerror = function () { return reject('Error file read'); };
448
- reader.onabort = function () { return reject('Abort file read'); };
449
- reader.onload = function () {
450
- var result = reader.result;
451
- return resolve(result);
452
- };
453
- if (type === 'dataurl') {
454
- reader.readAsDataURL(file);
455
- }
456
- else if (type === 'arraybuffer') {
457
- reader.readAsArrayBuffer(file);
458
- }
459
- })];
460
- });
461
- });
462
- };
463
- FileLoader.prototype.createFile = function (blob, name) {
464
- if (!navigator.msSaveBlob) {
465
- return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
466
- }
467
- var blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
468
- return this.blobToFile(blobFile, name);
469
- };
470
- return FileLoader;
471
- }());
472
- FileLoader.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: FileLoader, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
473
- FileLoader.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: FileLoader, providedIn: 'root' });
474
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: FileLoader, decorators: [{
475
- type: i0.Injectable,
476
- args: [{
477
- providedIn: 'root'
478
- }]
387
+ var FileLoader = /** @class */ (function () {
388
+ function FileLoader() {
389
+ this.isFile = function (input) {
390
+ return 'File' in window && input instanceof File;
391
+ };
392
+ this.isBlob = function (input) {
393
+ return 'Blob' in window && input instanceof Blob;
394
+ };
395
+ this.blobToFile = function (blob, fileName) {
396
+ var anyBlob = blob;
397
+ anyBlob.lastModifiedDate = new Date();
398
+ anyBlob.name = fileName;
399
+ return anyBlob;
400
+ };
401
+ }
402
+ FileLoader.prototype.fromDataUrl = function (value, name) {
403
+ if (name === void 0) { name = 'file'; }
404
+ if (!value) {
405
+ return null;
406
+ }
407
+ try {
408
+ // Convert base64 to raw binary data held in a string.
409
+ var byteString = window.atob(value.split(',')[1]);
410
+ // Separate out the mime component.
411
+ var mimeString = value
412
+ .split(',')[0]
413
+ .split(':')[1]
414
+ .split(';')[0];
415
+ // Write the bytes of the string to an ArrayBuffer.
416
+ var arrayBuffer = new ArrayBuffer(byteString.length);
417
+ var uint8Array = new Uint8Array(arrayBuffer);
418
+ for (var index = 0; index < byteString.length; index++) {
419
+ uint8Array[index] = byteString.charCodeAt(index);
420
+ }
421
+ var dataView = new DataView(arrayBuffer);
422
+ var blob = new Blob([dataView.buffer], { type: mimeString });
423
+ return this.createFile(blob, name);
424
+ }
425
+ catch (_a) {
426
+ return null;
427
+ }
428
+ };
429
+ FileLoader.prototype.asDataUrl = function (file) {
430
+ return this.read(file, 'dataurl');
431
+ };
432
+ FileLoader.prototype.asArrayBuffer = function (file) {
433
+ return this.read(file, 'arraybuffer');
434
+ };
435
+ FileLoader.prototype.read = function (file, type) {
436
+ return __awaiter(this, void 0, void 0, function () {
437
+ var _this = this;
438
+ return __generator(this, function (_b) {
439
+ return [2 /*return*/, new Promise(function (resolve, reject) {
440
+ var isFileLike = _this.isFile(file) || _this.isBlob(file);
441
+ if (!file || !isFileLike) {
442
+ return reject('Invalid file');
443
+ }
444
+ var reader = new FileReader();
445
+ reader.onerror = function () { return reject('Error file read'); };
446
+ reader.onabort = function () { return reject('Abort file read'); };
447
+ reader.onload = function () {
448
+ var result = reader.result;
449
+ return resolve(result);
450
+ };
451
+ if (type === 'dataurl') {
452
+ reader.readAsDataURL(file);
453
+ }
454
+ else if (type === 'arraybuffer') {
455
+ reader.readAsArrayBuffer(file);
456
+ }
457
+ })];
458
+ });
459
+ });
460
+ };
461
+ FileLoader.prototype.createFile = function (blob, name) {
462
+ if (!navigator.msSaveBlob) {
463
+ return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
464
+ }
465
+ var blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
466
+ return this.blobToFile(blobFile, name);
467
+ };
468
+ return FileLoader;
469
+ }());
470
+ FileLoader.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: FileLoader, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
471
+ FileLoader.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: FileLoader, providedIn: 'root' });
472
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: FileLoader, decorators: [{
473
+ type: i0.Injectable,
474
+ args: [{
475
+ providedIn: 'root'
476
+ }]
479
477
  }] });
480
478
 
481
- var Exif = /** @class */ (function () {
482
- function Exif(_platform, _fileLoader) {
483
- this._platform = _platform;
484
- this._fileLoader = _fileLoader;
485
- this.transformImage = function (image, type, orientation, quality) {
486
- if (quality === void 0) { quality = 100; }
487
- // Create the canvas and context.
488
- var canvas = document.createElement('canvas');
489
- var context = canvas.getContext('2d');
490
- // Validate the context exists.
491
- if (!context) {
492
- return null;
493
- }
494
- // Set the canvas size based on the image.
495
- var width = image.width, height = image.height;
496
- canvas.width = width;
497
- canvas.height = height;
498
- // Validate the orientation is correct
499
- // else flip the canvas sizes.
500
- if (4 < orientation && orientation < 9) {
501
- canvas.width = height;
502
- canvas.height = width;
503
- }
504
- // Transform the context based on the orientation.
505
- switch (orientation) {
506
- case 2:
507
- context.transform(-1, 0, 0, 1, width, 0);
508
- break;
509
- case 3:
510
- context.transform(-1, 0, 0, -1, width, height);
511
- break;
512
- case 4:
513
- context.transform(1, 0, 0, -1, 0, height);
514
- break;
515
- case 5:
516
- context.transform(0, 1, 1, 0, 0, 0);
517
- break;
518
- case 6:
519
- context.transform(0, 1, -1, 0, height, 0);
520
- break;
521
- case 7:
522
- context.transform(0, -1, -1, 0, height, width);
523
- break;
524
- case 8:
525
- context.transform(0, -1, 1, 0, 0, width);
526
- break;
527
- default:
528
- break;
529
- }
530
- // Draw the image on the context and return the data URL.
531
- context.drawImage(image, 0, 0, width, height);
532
- return canvas.toDataURL(type, quality / 100);
533
- };
534
- this.getSupportedCanvasType = function (fileType) {
535
- switch (fileType) {
536
- case 'image/jpeg':
537
- case 'image/jpg':
538
- return 'image/jpeg';
539
- case 'image/x-windows-bmp':
540
- case 'image/bmp':
541
- return 'image/bmp';
542
- default:
543
- return 'image/png';
544
- }
545
- };
546
- this.getOrientation = function (buffer) {
547
- // Create a new data view.
548
- var view = new DataView(buffer);
549
- if (view.getUint16(0, false) !== 0xFFD8) {
550
- return -2;
551
- }
552
- var length = view.byteLength;
553
- var offset = 2;
554
- while (offset < length) {
555
- if (view.getUint16(offset + 2, false) <= 8) {
556
- return -1;
557
- }
558
- var marker = view.getUint16(offset, false);
559
- offset += 2;
560
- if (marker === 0xFFE1) {
561
- if (view.getUint32(offset += 2, false) !== 0x45786966) {
562
- return -1;
563
- }
564
- var little = view.getUint16(offset += 6, false) === 0x4949;
565
- offset += view.getUint32(offset + 4, little);
566
- var tags = view.getUint16(offset, little);
567
- offset += 2;
568
- for (var index = 0; index < tags; index++) {
569
- if (view.getUint16(offset + index * 12, little) === 0x0112) {
570
- return view.getUint16(offset + index * 12 + 8, little);
571
- }
572
- }
573
- }
574
- else if ((marker & 0xFF00) !== 0xFF00) {
575
- break;
576
- }
577
- else {
578
- offset += view.getUint16(offset, false);
579
- }
580
- }
581
- return -1;
582
- };
583
- }
584
- Exif.prototype.strip = function (file, quality) {
585
- if (quality === void 0) { quality = 100; }
586
- return __awaiter(this, void 0, void 0, function () {
587
- var arrayBuffer, dataUrl, imageElement, orientation, canvasType, imageUrl, _a_1;
588
- return __generator(this, function (_b) {
589
- switch (_b.label) {
590
- case 0:
591
- // Validate we are on a browser.
592
- if (!this._platform.isBrowser) {
593
- return [2 /*return*/, file];
594
- }
595
- // Validate the file exists and is
596
- // an instance of a File object.
597
- if (!file || !(file instanceof File)) {
598
- return [2 /*return*/, file];
599
- }
600
- // Only jpeg images need correction.
601
- if (!['image/jpeg'].includes(file.type)) {
602
- return [2 /*return*/, file];
603
- }
604
- _b.label = 1;
605
- case 1:
606
- _b.trys.push([1, 5, , 6]);
607
- return [4 /*yield*/, this._fileLoader.asArrayBuffer(file)];
608
- case 2:
609
- arrayBuffer = _b.sent();
610
- return [4 /*yield*/, this._fileLoader.asDataUrl(file)];
611
- case 3:
612
- dataUrl = _b.sent();
613
- return [4 /*yield*/, this.createImageElement(dataUrl)];
614
- case 4:
615
- imageElement = _b.sent();
616
- orientation = this.getOrientation(arrayBuffer);
617
- canvasType = this.getSupportedCanvasType(file.type);
618
- imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
619
- // Validate the image url exists.
620
- if (!imageUrl) {
621
- return [2 /*return*/, file];
622
- }
623
- // Transform the image url to a file.
624
- return [2 /*return*/, this._fileLoader.fromDataUrl(imageUrl, file.name)];
625
- case 5:
626
- _a_1 = _b.sent();
627
- // When something goes wrong we
628
- // just return the default file.
629
- return [2 /*return*/, file];
630
- case 6: return [2 /*return*/];
631
- }
632
- });
633
- });
634
- };
635
- Exif.prototype.createImageElement = function (dataUrl) {
636
- return __awaiter(this, void 0, void 0, function () {
637
- return __generator(this, function (_b) {
638
- return [2 /*return*/, new Promise(function (resolve, reject) {
639
- var image = new Image();
640
- image.src = dataUrl;
641
- image.onerror = function () { return reject('Error image create'); };
642
- image.onabort = function () { return reject('Abort image create'); };
643
- image.onload = function () { return resolve(image); };
644
- })];
645
- });
646
- });
647
- };
648
- return Exif;
649
- }());
650
- Exif.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
651
- Exif.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Exif, providedIn: 'root' });
652
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Exif, decorators: [{
653
- type: i0.Injectable,
654
- args: [{
655
- providedIn: 'root'
656
- }]
479
+ var Exif = /** @class */ (function () {
480
+ function Exif(_platform, _fileLoader) {
481
+ this._platform = _platform;
482
+ this._fileLoader = _fileLoader;
483
+ this.transformImage = function (image, type, orientation, quality) {
484
+ if (quality === void 0) { quality = 100; }
485
+ // Create the canvas and context.
486
+ var canvas = document.createElement('canvas');
487
+ var context = canvas.getContext('2d');
488
+ // Validate the context exists.
489
+ if (!context) {
490
+ return null;
491
+ }
492
+ // Set the canvas size based on the image.
493
+ var width = image.width, height = image.height;
494
+ canvas.width = width;
495
+ canvas.height = height;
496
+ // Validate the orientation is correct
497
+ // else flip the canvas sizes.
498
+ if (4 < orientation && orientation < 9) {
499
+ canvas.width = height;
500
+ canvas.height = width;
501
+ }
502
+ // Transform the context based on the orientation.
503
+ switch (orientation) {
504
+ case 2:
505
+ context.transform(-1, 0, 0, 1, width, 0);
506
+ break;
507
+ case 3:
508
+ context.transform(-1, 0, 0, -1, width, height);
509
+ break;
510
+ case 4:
511
+ context.transform(1, 0, 0, -1, 0, height);
512
+ break;
513
+ case 5:
514
+ context.transform(0, 1, 1, 0, 0, 0);
515
+ break;
516
+ case 6:
517
+ context.transform(0, 1, -1, 0, height, 0);
518
+ break;
519
+ case 7:
520
+ context.transform(0, -1, -1, 0, height, width);
521
+ break;
522
+ case 8:
523
+ context.transform(0, -1, 1, 0, 0, width);
524
+ break;
525
+ default:
526
+ break;
527
+ }
528
+ // Draw the image on the context and return the data URL.
529
+ context.drawImage(image, 0, 0, width, height);
530
+ return canvas.toDataURL(type, quality / 100);
531
+ };
532
+ this.getSupportedCanvasType = function (fileType) {
533
+ switch (fileType) {
534
+ case 'image/jpeg':
535
+ case 'image/jpg':
536
+ return 'image/jpeg';
537
+ case 'image/x-windows-bmp':
538
+ case 'image/bmp':
539
+ return 'image/bmp';
540
+ default:
541
+ return 'image/png';
542
+ }
543
+ };
544
+ this.getOrientation = function (buffer) {
545
+ // Create a new data view.
546
+ var view = new DataView(buffer);
547
+ if (view.getUint16(0, false) !== 0xFFD8) {
548
+ return -2;
549
+ }
550
+ var length = view.byteLength;
551
+ var offset = 2;
552
+ while (offset < length) {
553
+ if (view.getUint16(offset + 2, false) <= 8) {
554
+ return -1;
555
+ }
556
+ var marker = view.getUint16(offset, false);
557
+ offset += 2;
558
+ if (marker === 0xFFE1) {
559
+ if (view.getUint32(offset += 2, false) !== 0x45786966) {
560
+ return -1;
561
+ }
562
+ var little = view.getUint16(offset += 6, false) === 0x4949;
563
+ offset += view.getUint32(offset + 4, little);
564
+ var tags = view.getUint16(offset, little);
565
+ offset += 2;
566
+ for (var index = 0; index < tags; index++) {
567
+ if (view.getUint16(offset + index * 12, little) === 0x0112) {
568
+ return view.getUint16(offset + index * 12 + 8, little);
569
+ }
570
+ }
571
+ }
572
+ else if ((marker & 0xFF00) !== 0xFF00) {
573
+ break;
574
+ }
575
+ else {
576
+ offset += view.getUint16(offset, false);
577
+ }
578
+ }
579
+ return -1;
580
+ };
581
+ }
582
+ Exif.prototype.strip = function (file, quality) {
583
+ if (quality === void 0) { quality = 100; }
584
+ return __awaiter(this, void 0, void 0, function () {
585
+ var arrayBuffer, dataUrl, imageElement, orientation, canvasType, imageUrl, _a_1;
586
+ return __generator(this, function (_b) {
587
+ switch (_b.label) {
588
+ case 0:
589
+ // Validate we are on a browser.
590
+ if (!this._platform.isBrowser) {
591
+ return [2 /*return*/, file];
592
+ }
593
+ // Validate the file exists and is
594
+ // an instance of a File object.
595
+ if (!file || !(file instanceof File)) {
596
+ return [2 /*return*/, file];
597
+ }
598
+ // Only jpeg images need correction.
599
+ if (!['image/jpeg'].includes(file.type)) {
600
+ return [2 /*return*/, file];
601
+ }
602
+ _b.label = 1;
603
+ case 1:
604
+ _b.trys.push([1, 5, , 6]);
605
+ return [4 /*yield*/, this._fileLoader.asArrayBuffer(file)];
606
+ case 2:
607
+ arrayBuffer = _b.sent();
608
+ return [4 /*yield*/, this._fileLoader.asDataUrl(file)];
609
+ case 3:
610
+ dataUrl = _b.sent();
611
+ return [4 /*yield*/, this.createImageElement(dataUrl)];
612
+ case 4:
613
+ imageElement = _b.sent();
614
+ orientation = this.getOrientation(arrayBuffer);
615
+ canvasType = this.getSupportedCanvasType(file.type);
616
+ imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
617
+ // Validate the image url exists.
618
+ if (!imageUrl) {
619
+ return [2 /*return*/, file];
620
+ }
621
+ // Transform the image url to a file.
622
+ return [2 /*return*/, this._fileLoader.fromDataUrl(imageUrl, file.name)];
623
+ case 5:
624
+ _a_1 = _b.sent();
625
+ // When something goes wrong we
626
+ // just return the default file.
627
+ return [2 /*return*/, file];
628
+ case 6: return [2 /*return*/];
629
+ }
630
+ });
631
+ });
632
+ };
633
+ Exif.prototype.createImageElement = function (dataUrl) {
634
+ return __awaiter(this, void 0, void 0, function () {
635
+ return __generator(this, function (_b) {
636
+ return [2 /*return*/, new Promise(function (resolve, reject) {
637
+ var image = new Image();
638
+ image.src = dataUrl;
639
+ image.onerror = function () { return reject('Error image create'); };
640
+ image.onabort = function () { return reject('Abort image create'); };
641
+ image.onload = function () { return resolve(image); };
642
+ })];
643
+ });
644
+ });
645
+ };
646
+ return Exif;
647
+ }());
648
+ Exif.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
649
+ Exif.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Exif, providedIn: 'root' });
650
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Exif, decorators: [{
651
+ type: i0.Injectable,
652
+ args: [{
653
+ providedIn: 'root'
654
+ }]
657
655
  }], ctorParameters: function () { return [{ type: Platform }, { type: FileLoader }]; } });
658
656
 
659
- var ImageConverter = /** @class */ (function () {
660
- function ImageConverter(_exif, _platform, _fileLoader) {
661
- this._exif = _exif;
662
- this._platform = _platform;
663
- this._fileLoader = _fileLoader;
664
- // Data.
665
- this._types = ['image/png', 'image/jpeg'];
666
- this.calculateOffsetAndDimensions = function (image, canvasWidth, canvasHeight) {
667
- var originalWidth = image.width;
668
- var originalHeight = image.height;
669
- var widthRatio = canvasWidth / originalWidth;
670
- var heightRatio = canvasHeight / originalHeight;
671
- var width;
672
- var height;
673
- if (originalWidth > originalHeight) {
674
- height = originalHeight * heightRatio;
675
- width = (originalWidth / originalHeight) * height;
676
- }
677
- else {
678
- width = originalWidth * widthRatio;
679
- height = (originalHeight / originalWidth) * width;
680
- }
681
- var xOffset = 0;
682
- var yOffset = 0;
683
- if (canvasHeight === height) {
684
- xOffset = -((width - canvasWidth) / 2);
685
- }
686
- else if (canvasWidth === width) {
687
- yOffset = -((height - canvasHeight) / 2);
688
- }
689
- return { xOffset: xOffset, yOffset: yOffset, width: width, height: height };
690
- };
691
- }
692
- ImageConverter.prototype.toDataUri = function (contents, options) {
693
- if (options === void 0) { options = null; }
694
- return __awaiter(this, void 0, void 0, function () {
695
- var image, canvasWidth, canvasHeight, canvas, context, _b, width, height, xOffset, yOffset;
696
- return __generator(this, function (_c) {
697
- switch (_c.label) {
698
- case 0:
699
- // Check if the current platform is a browser.
700
- if (!this._platform.isBrowser) {
701
- return [2 /*return*/, null];
702
- }
703
- return [4 /*yield*/, this.getImage(contents)];
704
- case 1:
705
- image = _c.sent();
706
- canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
707
- canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
708
- canvas = document.createElement('canvas');
709
- context = canvas.getContext('2d');
710
- // Validate the context exists.
711
- if (!context) {
712
- return [2 /*return*/, null];
713
- }
714
- // Set the width and height.
715
- canvas.width = canvasWidth;
716
- canvas.height = canvasHeight;
717
- // When the canvas sizes are 0 we have failed.
718
- if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
719
- return [2 /*return*/, null];
720
- }
721
- // Check if dimensions where supplied, else create the image.
722
- if (!options) {
723
- // Draw the image.
724
- context.drawImage(image, 0, 0);
725
- // Convert the canvas to a data url.
726
- return [2 /*return*/, canvas.toDataURL(this._types[0])];
727
- }
728
- _b = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight), width = _b.width, height = _b.height, xOffset = _b.xOffset, yOffset = _b.yOffset;
729
- // Draw the image.
730
- context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
731
- // Convert the canvas to a data url.
732
- return [2 /*return*/, canvas.toDataURL(this._types[0])];
733
- }
734
- });
735
- });
736
- };
737
- ImageConverter.prototype.fileToImage = function (file, types) {
738
- if (types === void 0) { types = this._types; }
739
- return __awaiter(this, void 0, void 0, function () {
740
- var stripped, _a_1, dataUri;
741
- return __generator(this, function (_b) {
742
- switch (_b.label) {
743
- case 0:
744
- // Check if the file matches an image.
745
- if (!types.includes(file.type)) {
746
- throw new Error('The selected file does not meet the required format.');
747
- }
748
- stripped = null;
749
- _b.label = 1;
750
- case 1:
751
- _b.trys.push([1, 3, , 4]);
752
- return [4 /*yield*/, this._exif.strip(file, 90)];
753
- case 2:
754
- stripped = _b.sent();
755
- return [3 /*break*/, 4];
756
- case 3:
757
- _a_1 = _b.sent();
758
- return [3 /*break*/, 4];
759
- case 4: return [4 /*yield*/, this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file)];
760
- case 5:
761
- dataUri = _b.sent();
762
- return [4 /*yield*/, this.stringToImage(dataUri)];
763
- case 6:
764
- // Convert the data URI to a image element.
765
- return [2 /*return*/, _b.sent()];
766
- }
767
- });
768
- });
769
- };
770
- ImageConverter.prototype.stringToImage = function (src) {
771
- return new Promise(function (resolve, reject) {
772
- var image = new Image();
773
- image.src = src;
774
- image.onload = function () { return resolve(image); };
775
- image.onerror = function (error) { return reject(error); };
776
- });
777
- };
778
- ImageConverter.prototype.getImage = function (contents) {
779
- return __awaiter(this, void 0, void 0, function () {
780
- return __generator(this, function (_b) {
781
- // If the contents is already an HTML image element just return it.
782
- if (contents instanceof HTMLImageElement) {
783
- return [2 /*return*/, contents];
784
- }
785
- // If the contents is a file convert it to an HTML image element.
786
- if (contents instanceof File) {
787
- return [2 /*return*/, this.fileToImage(contents)];
788
- }
789
- // If the contents is a string convert it to an HTML image element.
790
- return [2 /*return*/, this.stringToImage(contents)];
791
- });
792
- });
793
- };
794
- return ImageConverter;
795
- }());
796
- ImageConverter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
797
- ImageConverter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: ImageConverter, providedIn: 'root' });
798
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: ImageConverter, decorators: [{
799
- type: i0.Injectable,
800
- args: [{
801
- providedIn: 'root'
802
- }]
657
+ var ImageConverter = /** @class */ (function () {
658
+ function ImageConverter(_exif, _platform, _fileLoader) {
659
+ this._exif = _exif;
660
+ this._platform = _platform;
661
+ this._fileLoader = _fileLoader;
662
+ // Data.
663
+ this._types = ['image/png', 'image/jpeg'];
664
+ this.calculateOffsetAndDimensions = function (image, canvasWidth, canvasHeight) {
665
+ var originalWidth = image.width;
666
+ var originalHeight = image.height;
667
+ var widthRatio = canvasWidth / originalWidth;
668
+ var heightRatio = canvasHeight / originalHeight;
669
+ var width;
670
+ var height;
671
+ if (originalWidth > originalHeight) {
672
+ height = originalHeight * heightRatio;
673
+ width = (originalWidth / originalHeight) * height;
674
+ }
675
+ else {
676
+ width = originalWidth * widthRatio;
677
+ height = (originalHeight / originalWidth) * width;
678
+ }
679
+ var xOffset = 0;
680
+ var yOffset = 0;
681
+ if (canvasHeight === height) {
682
+ xOffset = -((width - canvasWidth) / 2);
683
+ }
684
+ else if (canvasWidth === width) {
685
+ yOffset = -((height - canvasHeight) / 2);
686
+ }
687
+ return { xOffset: xOffset, yOffset: yOffset, width: width, height: height };
688
+ };
689
+ }
690
+ ImageConverter.prototype.toDataUri = function (contents, options) {
691
+ if (options === void 0) { options = null; }
692
+ return __awaiter(this, void 0, void 0, function () {
693
+ var image, canvasWidth, canvasHeight, canvas, context, _b, width, height, xOffset, yOffset;
694
+ return __generator(this, function (_c) {
695
+ switch (_c.label) {
696
+ case 0:
697
+ // Check if the current platform is a browser.
698
+ if (!this._platform.isBrowser) {
699
+ return [2 /*return*/, null];
700
+ }
701
+ return [4 /*yield*/, this.getImage(contents)];
702
+ case 1:
703
+ image = _c.sent();
704
+ canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
705
+ canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
706
+ canvas = document.createElement('canvas');
707
+ context = canvas.getContext('2d');
708
+ // Validate the context exists.
709
+ if (!context) {
710
+ return [2 /*return*/, null];
711
+ }
712
+ // Set the width and height.
713
+ canvas.width = canvasWidth;
714
+ canvas.height = canvasHeight;
715
+ // When the canvas sizes are 0 we have failed.
716
+ if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
717
+ return [2 /*return*/, null];
718
+ }
719
+ // Check if dimensions where supplied, else create the image.
720
+ if (!options) {
721
+ // Draw the image.
722
+ context.drawImage(image, 0, 0);
723
+ // Convert the canvas to a data url.
724
+ return [2 /*return*/, canvas.toDataURL(this._types[0])];
725
+ }
726
+ _b = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight), width = _b.width, height = _b.height, xOffset = _b.xOffset, yOffset = _b.yOffset;
727
+ // Draw the image.
728
+ context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
729
+ // Convert the canvas to a data url.
730
+ return [2 /*return*/, canvas.toDataURL(this._types[0])];
731
+ }
732
+ });
733
+ });
734
+ };
735
+ ImageConverter.prototype.fileToImage = function (file, types) {
736
+ if (types === void 0) { types = this._types; }
737
+ return __awaiter(this, void 0, void 0, function () {
738
+ var stripped, _a_1, dataUri;
739
+ return __generator(this, function (_b) {
740
+ switch (_b.label) {
741
+ case 0:
742
+ // Check if the file matches an image.
743
+ if (!types.includes(file.type)) {
744
+ throw new Error('The selected file does not meet the required format.');
745
+ }
746
+ stripped = null;
747
+ _b.label = 1;
748
+ case 1:
749
+ _b.trys.push([1, 3, , 4]);
750
+ return [4 /*yield*/, this._exif.strip(file, 90)];
751
+ case 2:
752
+ stripped = _b.sent();
753
+ return [3 /*break*/, 4];
754
+ case 3:
755
+ _a_1 = _b.sent();
756
+ return [3 /*break*/, 4];
757
+ case 4: return [4 /*yield*/, this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file)];
758
+ case 5:
759
+ dataUri = _b.sent();
760
+ return [4 /*yield*/, this.stringToImage(dataUri)];
761
+ case 6:
762
+ // Convert the data URI to a image element.
763
+ return [2 /*return*/, _b.sent()];
764
+ }
765
+ });
766
+ });
767
+ };
768
+ ImageConverter.prototype.stringToImage = function (src) {
769
+ return new Promise(function (resolve, reject) {
770
+ var image = new Image();
771
+ image.src = src;
772
+ image.onload = function () { return resolve(image); };
773
+ image.onerror = function (error) { return reject(error); };
774
+ });
775
+ };
776
+ ImageConverter.prototype.getImage = function (contents) {
777
+ return __awaiter(this, void 0, void 0, function () {
778
+ return __generator(this, function (_b) {
779
+ // If the contents is already an HTML image element just return it.
780
+ if (contents instanceof HTMLImageElement) {
781
+ return [2 /*return*/, contents];
782
+ }
783
+ // If the contents is a file convert it to an HTML image element.
784
+ if (contents instanceof File) {
785
+ return [2 /*return*/, this.fileToImage(contents)];
786
+ }
787
+ // If the contents is a string convert it to an HTML image element.
788
+ return [2 /*return*/, this.stringToImage(contents)];
789
+ });
790
+ });
791
+ };
792
+ return ImageConverter;
793
+ }());
794
+ ImageConverter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
795
+ ImageConverter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: ImageConverter, providedIn: 'root' });
796
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: ImageConverter, decorators: [{
797
+ type: i0.Injectable,
798
+ args: [{
799
+ providedIn: 'root'
800
+ }]
803
801
  }], ctorParameters: function () { return [{ type: Exif }, { type: Platform }, { type: FileLoader }]; } });
804
802
 
805
803
  var ACCEPT_LANGUAGE = new i0.InjectionToken('AcceptLanguage');
806
804
 
807
- var Languages = /** @class */ (function () {
808
- function Languages(_acceptLanguage) {
809
- var _this = this;
810
- this._acceptLanguage = _acceptLanguage;
811
- // Data.
812
- this._data = [];
813
- this.getLanguages = function () {
814
- // If defined we must be in a server environment.
815
- if (_this._acceptLanguage) {
816
- return _this._acceptLanguage;
817
- }
818
- // Try to get the languages from the navigator.
819
- if (typeof navigator !== 'object') {
820
- return null;
821
- }
822
- var t = 'anguage';
823
- var n = navigator;
824
- var f = n['l' + t + 's'];
825
- var data = f && f.length ? f : (t = n['l' + t] ||
826
- n['browserL' + t] ||
827
- n['userL' + t]) ? [t] : t;
828
- return typeof data === 'string'
829
- ? data
830
- : data.join(';');
831
- };
832
- this._data = this.initialize();
833
- }
834
- Object.defineProperty(Languages.prototype, "all", {
835
- get: function () {
836
- return this._data;
837
- },
838
- enumerable: false,
839
- configurable: true
840
- });
841
- Languages.prototype.initialize = function () {
842
- // Get the languages.
843
- var data = this.getLanguages();
844
- // Parse all languages by using a regex.
845
- var strings = (data || '')
846
- .match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
847
- // Get the content by parsing the strings.
848
- var content = strings.map(function (item) {
849
- if (!item) {
850
- return null;
851
- }
852
- var bits = item.split(';');
853
- var ietf = bits[0].split('-');
854
- var hasScript = ietf.length === 3;
855
- return {
856
- code: ietf[0],
857
- script: hasScript ? ietf[1] : null,
858
- region: hasScript ? ietf[2] : ietf[1],
859
- quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
860
- };
861
- });
862
- // Filter out all the empty items
863
- // and sort them by the quality.
864
- return content
865
- .filter(function (item) { return !!item; })
866
- .sort(function (a, b) { return b.quality - a.quality; });
867
- };
868
- return Languages;
869
- }());
870
- Languages.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
871
- Languages.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Languages, providedIn: 'root' });
872
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Languages, decorators: [{
873
- type: i0.Injectable,
874
- args: [{
875
- providedIn: 'root'
876
- }]
877
- }], ctorParameters: function () {
878
- return [{ type: undefined, decorators: [{
879
- type: i0.Optional
880
- }, {
881
- type: i0.Inject,
882
- args: [ACCEPT_LANGUAGE]
883
- }] }];
805
+ var Languages = /** @class */ (function () {
806
+ function Languages(_acceptLanguage) {
807
+ var _this = this;
808
+ this._acceptLanguage = _acceptLanguage;
809
+ // Data.
810
+ this._data = [];
811
+ this.getLanguages = function () {
812
+ // If defined we must be in a server environment.
813
+ if (_this._acceptLanguage) {
814
+ return _this._acceptLanguage;
815
+ }
816
+ // Try to get the languages from the navigator.
817
+ if (typeof navigator !== 'object') {
818
+ return null;
819
+ }
820
+ var t = 'anguage';
821
+ var n = navigator;
822
+ var f = n['l' + t + 's'];
823
+ var data = f && f.length ? f : (t = n['l' + t] ||
824
+ n['browserL' + t] ||
825
+ n['userL' + t]) ? [t] : t;
826
+ return typeof data === 'string'
827
+ ? data
828
+ : data.join(';');
829
+ };
830
+ this._data = this.initialize();
831
+ }
832
+ Object.defineProperty(Languages.prototype, "all", {
833
+ get: function () {
834
+ return this._data;
835
+ },
836
+ enumerable: false,
837
+ configurable: true
838
+ });
839
+ Languages.prototype.initialize = function () {
840
+ // Get the languages.
841
+ var data = this.getLanguages();
842
+ // Parse all languages by using a regex.
843
+ var strings = (data || '')
844
+ .match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
845
+ // Get the content by parsing the strings.
846
+ var content = strings.map(function (item) {
847
+ if (!item) {
848
+ return null;
849
+ }
850
+ var bits = item.split(';');
851
+ var ietf = bits[0].split('-');
852
+ var hasScript = ietf.length === 3;
853
+ return {
854
+ code: ietf[0],
855
+ script: hasScript ? ietf[1] : null,
856
+ region: hasScript ? ietf[2] : ietf[1],
857
+ quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
858
+ };
859
+ });
860
+ // Filter out all the empty items
861
+ // and sort them by the quality.
862
+ return content
863
+ .filter(function (item) { return !!item; })
864
+ .sort(function (a, b) { return b.quality - a.quality; });
865
+ };
866
+ return Languages;
867
+ }());
868
+ Languages.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
869
+ Languages.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Languages, providedIn: 'root' });
870
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Languages, decorators: [{
871
+ type: i0.Injectable,
872
+ args: [{
873
+ providedIn: 'root'
874
+ }]
875
+ }], ctorParameters: function () {
876
+ return [{ type: undefined, decorators: [{
877
+ type: i0.Optional
878
+ }, {
879
+ type: i0.Inject,
880
+ args: [ACCEPT_LANGUAGE]
881
+ }] }];
884
882
  } });
885
883
 
886
- var WINDOW = new i0.InjectionToken('An abstraction over global window object', {
887
- factory: function () {
888
- var defaultView = i0.inject(common.DOCUMENT).defaultView;
889
- if (!defaultView) {
890
- throw new Error('Window is not available');
891
- }
892
- return defaultView;
893
- }
884
+ var WINDOW = new i0.InjectionToken('An abstraction over global window object', {
885
+ factory: function () {
886
+ var defaultView = i0.inject(common.DOCUMENT).defaultView;
887
+ if (!defaultView) {
888
+ throw new Error('Window is not available');
889
+ }
890
+ return defaultView;
891
+ }
894
892
  });
895
893
 
896
- var NAVIGATOR = new i0.InjectionToken('An abstraction over window.navigator object', {
897
- factory: function () { return i0.inject(WINDOW).navigator; }
894
+ var NAVIGATOR = new i0.InjectionToken('An abstraction over window.navigator object', {
895
+ factory: function () { return i0.inject(WINDOW).navigator; }
898
896
  });
899
897
 
900
- var Network = /** @class */ (function () {
901
- function Network(_platform, _window, _navigator) {
902
- this._platform = _platform;
903
- this._window = _window;
904
- this._navigator = _navigator;
905
- // Data.
906
- this._online$ = rxjs.of(true);
907
- this.getOnlineObservable();
908
- }
909
- Network.prototype.online = function () {
910
- return this._online$;
911
- };
912
- Network.prototype.getOnlineObservable = function () {
913
- var _this = this;
914
- // Validate we are on a browser.
915
- if (!this._platform.isBrowser) {
916
- return;
917
- }
918
- // Get all the events from the window.
919
- var online$ = rxjs.fromEvent(this._window, 'online').pipe(operators.mapTo(true));
920
- var offline$ = rxjs.fromEvent(this._window, 'offline').pipe(operators.mapTo(false));
921
- var now$ = new rxjs.Observable(function (subscriber) {
922
- var _a;
923
- subscriber.next((_a = _this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
924
- subscriber.complete();
925
- });
926
- // Merge all event so we get notified when
927
- // a user is online/offline.
928
- this._online$ = rxjs.merge(now$, online$, offline$).pipe(operators.map(function (value) { return value; }), operators.distinctUntilChanged(), operators.shareReplay(1));
929
- };
930
- return Network;
931
- }());
932
- Network.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
933
- Network.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Network, providedIn: 'root' });
934
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Network, decorators: [{
935
- type: i0.Injectable,
936
- args: [{
937
- providedIn: 'root'
938
- }]
939
- }], ctorParameters: function () {
940
- return [{ type: Platform }, { type: undefined, decorators: [{
941
- type: i0.Optional
942
- }, {
943
- type: i0.Inject,
944
- args: [WINDOW]
945
- }] }, { type: undefined, decorators: [{
946
- type: i0.Optional
947
- }, {
948
- type: i0.Inject,
949
- args: [NAVIGATOR]
950
- }] }];
898
+ var Network = /** @class */ (function () {
899
+ function Network(_platform, _window, _navigator) {
900
+ this._platform = _platform;
901
+ this._window = _window;
902
+ this._navigator = _navigator;
903
+ // Data.
904
+ this._online$ = rxjs.of(true);
905
+ this.getOnlineObservable();
906
+ }
907
+ Network.prototype.online = function () {
908
+ return this._online$;
909
+ };
910
+ Network.prototype.getOnlineObservable = function () {
911
+ var _this = this;
912
+ // Validate we are on a browser.
913
+ if (!this._platform.isBrowser) {
914
+ return;
915
+ }
916
+ // Get all the events from the window.
917
+ var online$ = rxjs.fromEvent(this._window, 'online').pipe(operators.mapTo(true));
918
+ var offline$ = rxjs.fromEvent(this._window, 'offline').pipe(operators.mapTo(false));
919
+ var now$ = new rxjs.Observable(function (subscriber) {
920
+ var _a;
921
+ subscriber.next((_a = _this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
922
+ subscriber.complete();
923
+ });
924
+ // Merge all event so we get notified when
925
+ // a user is online/offline.
926
+ this._online$ = rxjs.merge(now$, online$, offline$).pipe(operators.map(function (value) { return value; }), operators.distinctUntilChanged(), operators.shareReplay(1));
927
+ };
928
+ return Network;
929
+ }());
930
+ Network.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
931
+ Network.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Network, providedIn: 'root' });
932
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Network, decorators: [{
933
+ type: i0.Injectable,
934
+ args: [{
935
+ providedIn: 'root'
936
+ }]
937
+ }], ctorParameters: function () {
938
+ return [{ type: Platform }, { type: undefined, decorators: [{
939
+ type: i0.Optional
940
+ }, {
941
+ type: i0.Inject,
942
+ args: [WINDOW]
943
+ }] }, { type: undefined, decorators: [{
944
+ type: i0.Optional
945
+ }, {
946
+ type: i0.Inject,
947
+ args: [NAVIGATOR]
948
+ }] }];
951
949
  } });
952
950
 
953
- var Patch = /** @class */ (function () {
954
- function Patch(_platform, _window, _document) {
955
- this._platform = _platform;
956
- this._window = _window;
957
- this._document = _document;
958
- this._hasPatchedMobileVerticalHeight = false;
959
- // Subscriptions.
960
- this._subscription = new rxjs.Subscription();
961
- }
962
- Patch.prototype.mobileVerticalHeight = function () {
963
- // Check if the user has already patched
964
- // the mobile vertical height.
965
- if (this._hasPatchedMobileVerticalHeight) {
966
- return;
967
- }
968
- this.periodicallySetDocumentVerticalProperty();
969
- this._hasPatchedMobileVerticalHeight = true;
970
- };
971
- Patch.prototype.ngOnDestroy = function () {
972
- var _a;
973
- (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
974
- };
975
- Patch.prototype.periodicallySetDocumentVerticalProperty = function () {
976
- var _this = this;
977
- // Validate we are using a browser.
978
- if (!this._platform.isBrowser) {
979
- return;
980
- }
981
- // Listen to a debounced window resize event.
982
- var resize$ = rxjs.fromEvent(this._window, 'resize').pipe(operators.debounceTime(25), operators.startWith(0));
983
- // Subscribe to the resize observable.
984
- var subscription = resize$.subscribe(function () {
985
- var _a, _b, _c, _d;
986
- var verticalHeight = ((_a = _this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
987
- (_d = (_c = (_b = _this._document) === null || _b === void 0 ? void 0 : _b.documentElement) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.setProperty('--vh', verticalHeight + "px");
988
- });
989
- // Save the subscription so we can destroy it later.
990
- this._subscription.add(subscription);
991
- };
992
- return Patch;
993
- }());
994
- Patch.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: common.DOCUMENT, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
995
- Patch.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Patch, providedIn: 'root' });
996
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.4", ngImport: i0__namespace, type: Patch, decorators: [{
997
- type: i0.Injectable,
998
- args: [{
999
- providedIn: 'root'
1000
- }]
1001
- }], ctorParameters: function () {
1002
- return [{ type: Platform }, { type: undefined, decorators: [{
1003
- type: i0.Optional
1004
- }, {
1005
- type: i0.Inject,
1006
- args: [WINDOW]
1007
- }] }, { type: undefined, decorators: [{
1008
- type: i0.Optional
1009
- }, {
1010
- type: i0.Inject,
1011
- args: [common.DOCUMENT]
1012
- }] }];
951
+ var Patch = /** @class */ (function () {
952
+ function Patch(_platform, _window, _document) {
953
+ this._platform = _platform;
954
+ this._window = _window;
955
+ this._document = _document;
956
+ this._hasPatchedMobileVerticalHeight = false;
957
+ // Subscriptions.
958
+ this._subscription = new rxjs.Subscription();
959
+ }
960
+ Patch.prototype.mobileVerticalHeight = function () {
961
+ // Check if the user has already patched
962
+ // the mobile vertical height.
963
+ if (this._hasPatchedMobileVerticalHeight) {
964
+ return;
965
+ }
966
+ this.periodicallySetDocumentVerticalProperty();
967
+ this._hasPatchedMobileVerticalHeight = true;
968
+ };
969
+ Patch.prototype.ngOnDestroy = function () {
970
+ var _a;
971
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
972
+ };
973
+ Patch.prototype.periodicallySetDocumentVerticalProperty = function () {
974
+ var _this = this;
975
+ // Validate we are using a browser.
976
+ if (!this._platform.isBrowser) {
977
+ return;
978
+ }
979
+ // Listen to a debounced window resize event.
980
+ var resize$ = rxjs.fromEvent(this._window, 'resize').pipe(operators.debounceTime(25), operators.startWith(0));
981
+ // Subscribe to the resize observable.
982
+ var subscription = resize$.subscribe(function () {
983
+ var _a, _b, _c, _d;
984
+ var verticalHeight = ((_a = _this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
985
+ (_d = (_c = (_b = _this._document) === null || _b === void 0 ? void 0 : _b.documentElement) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.setProperty('--vh', verticalHeight + "px");
986
+ });
987
+ // Save the subscription so we can destroy it later.
988
+ this._subscription.add(subscription);
989
+ };
990
+ return Patch;
991
+ }());
992
+ Patch.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: common.DOCUMENT, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
993
+ Patch.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Patch, providedIn: 'root' });
994
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Patch, decorators: [{
995
+ type: i0.Injectable,
996
+ args: [{
997
+ providedIn: 'root'
998
+ }]
999
+ }], ctorParameters: function () {
1000
+ return [{ type: Platform }, { type: undefined, decorators: [{
1001
+ type: i0.Optional
1002
+ }, {
1003
+ type: i0.Inject,
1004
+ args: [WINDOW]
1005
+ }] }, { type: undefined, decorators: [{
1006
+ type: i0.Optional
1007
+ }, {
1008
+ type: i0.Inject,
1009
+ args: [common.DOCUMENT]
1010
+ }] }];
1013
1011
  } });
1014
1012
 
1015
- function coerceBooleanProperty(value) {
1016
- return value != null && "" + value !== 'false';
1013
+ var Clipboard = /** @class */ (function () {
1014
+ function Clipboard(_document) {
1015
+ this._document = _document;
1016
+ }
1017
+ Clipboard.prototype.copy = function (text) {
1018
+ var pendingCopy = this.beginCopy(text);
1019
+ var successful = pendingCopy.copy();
1020
+ pendingCopy.destroy();
1021
+ return successful;
1022
+ };
1023
+ Clipboard.prototype.beginCopy = function (text) {
1024
+ return new ClipboardCopy(text, this._document);
1025
+ };
1026
+ return Clipboard;
1027
+ }());
1028
+ Clipboard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Clipboard, deps: [{ token: common.DOCUMENT, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1029
+ Clipboard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Clipboard, providedIn: 'root' });
1030
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0__namespace, type: Clipboard, decorators: [{
1031
+ type: i0.Injectable,
1032
+ args: [{
1033
+ providedIn: 'root'
1034
+ }]
1035
+ }], ctorParameters: function () {
1036
+ return [{ type: undefined, decorators: [{
1037
+ type: i0.Optional
1038
+ }, {
1039
+ type: i0.Inject,
1040
+ args: [common.DOCUMENT]
1041
+ }] }];
1042
+ } });
1043
+ var ClipboardCopy = /** @class */ (function () {
1044
+ function ClipboardCopy(_text, _document) {
1045
+ this._text = _text;
1046
+ this._document = _document;
1047
+ this.initialize();
1048
+ }
1049
+ ClipboardCopy.prototype.copy = function () {
1050
+ var _a, _b, _c, _d, _e, _f;
1051
+ var textarea = this._textarea;
1052
+ var successful = false;
1053
+ try {
1054
+ var currentFocus = this._document.activeElement;
1055
+ (_a = textarea === null || textarea === void 0 ? void 0 : textarea.select) === null || _a === void 0 ? void 0 : _a.call(textarea);
1056
+ (_b = textarea === null || textarea === void 0 ? void 0 : textarea.setSelectionRange) === null || _b === void 0 ? void 0 : _b.call(textarea, 0, (_c = textarea === null || textarea === void 0 ? void 0 : textarea.value) === null || _c === void 0 ? void 0 : _c.length);
1057
+ successful = (_e = (_d = this._document) === null || _d === void 0 ? void 0 : _d.execCommand) === null || _e === void 0 ? void 0 : _e.call(_d, 'copy');
1058
+ (_f = currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.focus) === null || _f === void 0 ? void 0 : _f.call(currentFocus);
1059
+ }
1060
+ catch (_g) {
1061
+ // Do nothing.
1062
+ }
1063
+ return successful;
1064
+ };
1065
+ ClipboardCopy.prototype.destroy = function () {
1066
+ var _a, _b, _c;
1067
+ (_c = (_b = (_a = this._textarea) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild) === null || _c === void 0 ? void 0 : _c.call(_b, this._textarea);
1068
+ this._textarea = undefined;
1069
+ };
1070
+ ClipboardCopy.prototype.initialize = function () {
1071
+ var textarea = this._textarea = this._document.createElement('textarea');
1072
+ var styles = textarea.style;
1073
+ // Hide the element for display and accessibility. Set a fixed position so the page layout
1074
+ // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
1075
+ // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
1076
+ styles.position = 'fixed';
1077
+ styles.top = styles.opacity = '0';
1078
+ styles.left = '-999em';
1079
+ textarea.setAttribute('aria-hidden', 'true');
1080
+ textarea.value = this._text;
1081
+ this._document.body.appendChild(textarea);
1082
+ };
1083
+ return ClipboardCopy;
1084
+ }());
1085
+
1086
+ function coerceBooleanProperty(value) {
1087
+ return value != null && "" + value !== 'false';
1017
1088
  }
1018
1089
 
1019
- function mixinDisabled(base) {
1020
- return /** @class */ (function (_super) {
1021
- __extends(class_1, _super);
1022
- function class_1() {
1023
- var args = [];
1024
- for (var _i = 0; _i < arguments.length; _i++) {
1025
- args[_i] = arguments[_i];
1026
- }
1027
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1028
- _this._disable = false;
1029
- return _this;
1030
- }
1031
- Object.defineProperty(class_1.prototype, "disabled", {
1032
- get: function () {
1033
- return this._disable;
1034
- },
1035
- set: function (value) {
1036
- this._disable = coerceBooleanProperty(value);
1037
- },
1038
- enumerable: false,
1039
- configurable: true
1040
- });
1041
- return class_1;
1042
- }(base));
1090
+ function mixinDisabled(base) {
1091
+ return /** @class */ (function (_super) {
1092
+ __extends(class_1, _super);
1093
+ function class_1() {
1094
+ var args = [];
1095
+ for (var _i = 0; _i < arguments.length; _i++) {
1096
+ args[_i] = arguments[_i];
1097
+ }
1098
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1099
+ _this._disable = false;
1100
+ return _this;
1101
+ }
1102
+ Object.defineProperty(class_1.prototype, "disabled", {
1103
+ get: function () {
1104
+ return this._disable;
1105
+ },
1106
+ set: function (value) {
1107
+ this._disable = coerceBooleanProperty(value);
1108
+ },
1109
+ enumerable: false,
1110
+ configurable: true
1111
+ });
1112
+ return class_1;
1113
+ }(base));
1043
1114
  }
1044
1115
 
1045
- function mixinLoad(base) {
1046
- return /** @class */ (function (_super) {
1047
- __extends(class_1, _super);
1048
- function class_1() {
1049
- var args = [];
1050
- for (var _i = 0; _i < arguments.length; _i++) {
1051
- args[_i] = arguments[_i];
1052
- }
1053
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1054
- _this._loading = false;
1055
- return _this;
1056
- }
1057
- Object.defineProperty(class_1.prototype, "loading", {
1058
- get: function () {
1059
- return this._loading;
1060
- },
1061
- set: function (value) {
1062
- this._loading = coerceBooleanProperty(value);
1063
- },
1064
- enumerable: false,
1065
- configurable: true
1066
- });
1067
- return class_1;
1068
- }(base));
1116
+ function mixinLoad(base) {
1117
+ return /** @class */ (function (_super) {
1118
+ __extends(class_1, _super);
1119
+ function class_1() {
1120
+ var args = [];
1121
+ for (var _i = 0; _i < arguments.length; _i++) {
1122
+ args[_i] = arguments[_i];
1123
+ }
1124
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1125
+ _this._loading = false;
1126
+ return _this;
1127
+ }
1128
+ Object.defineProperty(class_1.prototype, "loading", {
1129
+ get: function () {
1130
+ return this._loading;
1131
+ },
1132
+ set: function (value) {
1133
+ this._loading = coerceBooleanProperty(value);
1134
+ },
1135
+ enumerable: false,
1136
+ configurable: true
1137
+ });
1138
+ return class_1;
1139
+ }(base));
1069
1140
  }
1070
1141
 
1071
- function mixinError(base) {
1072
- return /** @class */ (function (_super) {
1073
- __extends(class_1, _super);
1074
- function class_1() {
1075
- var args = [];
1076
- for (var _i = 0; _i < arguments.length; _i++) {
1077
- args[_i] = arguments[_i];
1078
- }
1079
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1080
- _this._error = false;
1081
- return _this;
1082
- }
1083
- Object.defineProperty(class_1.prototype, "error", {
1084
- get: function () {
1085
- return this._error;
1086
- },
1087
- set: function (value) {
1088
- this._error = coerceBooleanProperty(value);
1089
- },
1090
- enumerable: false,
1091
- configurable: true
1092
- });
1093
- return class_1;
1094
- }(base));
1142
+ function mixinError(base) {
1143
+ return /** @class */ (function (_super) {
1144
+ __extends(class_1, _super);
1145
+ function class_1() {
1146
+ var args = [];
1147
+ for (var _i = 0; _i < arguments.length; _i++) {
1148
+ args[_i] = arguments[_i];
1149
+ }
1150
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1151
+ _this._error = false;
1152
+ return _this;
1153
+ }
1154
+ Object.defineProperty(class_1.prototype, "error", {
1155
+ get: function () {
1156
+ return this._error;
1157
+ },
1158
+ set: function (value) {
1159
+ this._error = coerceBooleanProperty(value);
1160
+ },
1161
+ enumerable: false,
1162
+ configurable: true
1163
+ });
1164
+ return class_1;
1165
+ }(base));
1095
1166
  }
1096
1167
 
1097
- function mixinHideErrors(base) {
1098
- return /** @class */ (function (_super) {
1099
- __extends(class_1, _super);
1100
- function class_1() {
1101
- var args = [];
1102
- for (var _i = 0; _i < arguments.length; _i++) {
1103
- args[_i] = arguments[_i];
1104
- }
1105
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1106
- _this._hideErrors = false;
1107
- return _this;
1108
- }
1109
- Object.defineProperty(class_1.prototype, "hideErrors", {
1110
- get: function () {
1111
- return this._hideErrors;
1112
- },
1113
- set: function (value) {
1114
- this._hideErrors = coerceBooleanProperty(value);
1115
- },
1116
- enumerable: false,
1117
- configurable: true
1118
- });
1119
- return class_1;
1120
- }(base));
1168
+ function mixinHideErrors(base) {
1169
+ return /** @class */ (function (_super) {
1170
+ __extends(class_1, _super);
1171
+ function class_1() {
1172
+ var args = [];
1173
+ for (var _i = 0; _i < arguments.length; _i++) {
1174
+ args[_i] = arguments[_i];
1175
+ }
1176
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1177
+ _this._hideErrors = false;
1178
+ return _this;
1179
+ }
1180
+ Object.defineProperty(class_1.prototype, "hideErrors", {
1181
+ get: function () {
1182
+ return this._hideErrors;
1183
+ },
1184
+ set: function (value) {
1185
+ this._hideErrors = coerceBooleanProperty(value);
1186
+ },
1187
+ enumerable: false,
1188
+ configurable: true
1189
+ });
1190
+ return class_1;
1191
+ }(base));
1121
1192
  }
1122
1193
 
1123
- function mixinFocused(base) {
1124
- return /** @class */ (function (_super) {
1125
- __extends(class_1, _super);
1126
- function class_1() {
1127
- var args = [];
1128
- for (var _i = 0; _i < arguments.length; _i++) {
1129
- args[_i] = arguments[_i];
1130
- }
1131
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1132
- _this._focused = false;
1133
- return _this;
1134
- }
1135
- Object.defineProperty(class_1.prototype, "focused", {
1136
- get: function () {
1137
- return this._focused;
1138
- },
1139
- set: function (value) {
1140
- this._focused = coerceBooleanProperty(value);
1141
- },
1142
- enumerable: false,
1143
- configurable: true
1144
- });
1145
- return class_1;
1146
- }(base));
1194
+ function mixinFocused(base) {
1195
+ return /** @class */ (function (_super) {
1196
+ __extends(class_1, _super);
1197
+ function class_1() {
1198
+ var args = [];
1199
+ for (var _i = 0; _i < arguments.length; _i++) {
1200
+ args[_i] = arguments[_i];
1201
+ }
1202
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1203
+ _this._focused = false;
1204
+ return _this;
1205
+ }
1206
+ Object.defineProperty(class_1.prototype, "focused", {
1207
+ get: function () {
1208
+ return this._focused;
1209
+ },
1210
+ set: function (value) {
1211
+ this._focused = coerceBooleanProperty(value);
1212
+ },
1213
+ enumerable: false,
1214
+ configurable: true
1215
+ });
1216
+ return class_1;
1217
+ }(base));
1147
1218
  }
1148
1219
 
1149
- function mixinGrouped(base) {
1150
- return /** @class */ (function (_super) {
1151
- __extends(class_1, _super);
1152
- function class_1() {
1153
- var args = [];
1154
- for (var _i = 0; _i < arguments.length; _i++) {
1155
- args[_i] = arguments[_i];
1156
- }
1157
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1158
- _this._grouped = false;
1159
- return _this;
1160
- }
1161
- Object.defineProperty(class_1.prototype, "grouped", {
1162
- get: function () {
1163
- return this._grouped;
1164
- },
1165
- set: function (value) {
1166
- this._grouped = coerceBooleanProperty(value);
1167
- },
1168
- enumerable: false,
1169
- configurable: true
1170
- });
1171
- return class_1;
1172
- }(base));
1220
+ function mixinGrouped(base) {
1221
+ return /** @class */ (function (_super) {
1222
+ __extends(class_1, _super);
1223
+ function class_1() {
1224
+ var args = [];
1225
+ for (var _i = 0; _i < arguments.length; _i++) {
1226
+ args[_i] = arguments[_i];
1227
+ }
1228
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1229
+ _this._grouped = false;
1230
+ return _this;
1231
+ }
1232
+ Object.defineProperty(class_1.prototype, "grouped", {
1233
+ get: function () {
1234
+ return this._grouped;
1235
+ },
1236
+ set: function (value) {
1237
+ this._grouped = coerceBooleanProperty(value);
1238
+ },
1239
+ enumerable: false,
1240
+ configurable: true
1241
+ });
1242
+ return class_1;
1243
+ }(base));
1173
1244
  }
1174
1245
 
1175
- function mixinReadonly(base) {
1176
- return /** @class */ (function (_super) {
1177
- __extends(class_1, _super);
1178
- function class_1() {
1179
- var args = [];
1180
- for (var _i = 0; _i < arguments.length; _i++) {
1181
- args[_i] = arguments[_i];
1182
- }
1183
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1184
- _this._readonly = false;
1185
- return _this;
1186
- }
1187
- Object.defineProperty(class_1.prototype, "readonly", {
1188
- get: function () {
1189
- return this._readonly;
1190
- },
1191
- set: function (value) {
1192
- this._readonly = coerceBooleanProperty(value);
1193
- },
1194
- enumerable: false,
1195
- configurable: true
1196
- });
1197
- return class_1;
1198
- }(base));
1246
+ function mixinReadonly(base) {
1247
+ return /** @class */ (function (_super) {
1248
+ __extends(class_1, _super);
1249
+ function class_1() {
1250
+ var args = [];
1251
+ for (var _i = 0; _i < arguments.length; _i++) {
1252
+ args[_i] = arguments[_i];
1253
+ }
1254
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1255
+ _this._readonly = false;
1256
+ return _this;
1257
+ }
1258
+ Object.defineProperty(class_1.prototype, "readonly", {
1259
+ get: function () {
1260
+ return this._readonly;
1261
+ },
1262
+ set: function (value) {
1263
+ this._readonly = coerceBooleanProperty(value);
1264
+ },
1265
+ enumerable: false,
1266
+ configurable: true
1267
+ });
1268
+ return class_1;
1269
+ }(base));
1199
1270
  }
1200
1271
 
1201
- function mixinRequired(base) {
1202
- return /** @class */ (function (_super) {
1203
- __extends(class_1, _super);
1204
- function class_1() {
1205
- var args = [];
1206
- for (var _i = 0; _i < arguments.length; _i++) {
1207
- args[_i] = arguments[_i];
1208
- }
1209
- var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1210
- _this._required = false;
1211
- return _this;
1212
- }
1213
- Object.defineProperty(class_1.prototype, "required", {
1214
- get: function () {
1215
- return this._required;
1216
- },
1217
- set: function (value) {
1218
- this._required = coerceBooleanProperty(value);
1219
- },
1220
- enumerable: false,
1221
- configurable: true
1222
- });
1223
- return class_1;
1224
- }(base));
1272
+ function mixinRequired(base) {
1273
+ return /** @class */ (function (_super) {
1274
+ __extends(class_1, _super);
1275
+ function class_1() {
1276
+ var args = [];
1277
+ for (var _i = 0; _i < arguments.length; _i++) {
1278
+ args[_i] = arguments[_i];
1279
+ }
1280
+ var _this = _super.apply(this, __spreadArray([], __read(args))) || this;
1281
+ _this._required = false;
1282
+ return _this;
1283
+ }
1284
+ Object.defineProperty(class_1.prototype, "required", {
1285
+ get: function () {
1286
+ return this._required;
1287
+ },
1288
+ set: function (value) {
1289
+ this._required = coerceBooleanProperty(value);
1290
+ },
1291
+ enumerable: false,
1292
+ configurable: true
1293
+ });
1294
+ return class_1;
1295
+ }(base));
1225
1296
  }
1226
1297
 
1227
1298
  var BASE_URL = new i0.InjectionToken('BaseUrl');
1228
1299
 
1229
1300
  var COOKIE = new i0.InjectionToken('Cookie');
1230
1301
 
1231
- var LOCATION = new i0.InjectionToken('An abstraction over window.location object', {
1232
- factory: function () { return i0.inject(WINDOW).location; }
1302
+ var LOCATION = new i0.InjectionToken('An abstraction over window.location object', {
1303
+ factory: function () { return i0.inject(WINDOW).location; }
1233
1304
  });
1234
1305
 
1235
- var BbRegex = {
1236
- email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
1237
- fullNumber: /^\d*[1-9]\d*$/
1306
+ var BbRegex = {
1307
+ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
1308
+ fullNumber: /^\d*[1-9]\d*$/
1238
1309
  };
1239
1310
 
1240
- var BbValidator = /** @class */ (function () {
1241
- function BbValidator() {
1242
- }
1243
- BbValidator.email = function (control) {
1244
- if (isEmptyInputValue(control.value)) {
1245
- return null;
1246
- }
1247
- return BbRegex.email.test(control.value) ? null : { email: true };
1248
- };
1249
- BbValidator.fullNumber = function (control) {
1250
- if (isEmptyInputValue(control.value)) {
1251
- return null;
1252
- }
1253
- return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
1254
- };
1255
- BbValidator.maxFileSize = function (bytes) {
1256
- var validator = function (control) {
1257
- var value = control.value;
1258
- // Validate if the value is a file.
1259
- if (!(value instanceof File)) {
1260
- return null;
1261
- }
1262
- if (value.size <= bytes) {
1263
- return null;
1264
- }
1265
- var maxSize = '0 Bytes';
1266
- if (bytes !== 0) {
1267
- var k = 1024;
1268
- var dm = 2;
1269
- var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
1270
- var index = Math.floor(Math.log(bytes) / Math.log(k));
1271
- maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
1272
- }
1273
- return { maxFileSize: { maxSize: maxSize } };
1274
- };
1275
- return validator;
1276
- };
1277
- BbValidator.confirm = function (fieldName, error) {
1278
- if (error === void 0) { error = 'confirm'; }
1279
- var validator = function (control) {
1280
- var _b;
1281
- var _a;
1282
- if (isEmptyInputValue(control.value)) {
1283
- return null;
1284
- }
1285
- var field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
1286
- return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
1287
- ? null
1288
- : (_b = {}, _b[error] = true, _b);
1289
- };
1290
- return validator;
1291
- };
1292
- BbValidator.maxDate = function (date, error) {
1293
- if (error === void 0) { error = 'maxDate'; }
1294
- var formattedDate = date.toString() !== 'Invalid Date'
1295
- ? common.formatDate(date, 'yyyy-MM-dd', 'en-US')
1296
- : null;
1297
- var validator = function (control) {
1298
- var _b;
1299
- if (isEmptyInputValue(control.value)) {
1300
- return null;
1301
- }
1302
- var controlDate = new Date(control.value);
1303
- return controlDate.getTime() > date.getTime()
1304
- ? (_b = {}, _b[error] = { date: formattedDate }, _b) : null;
1305
- };
1306
- return validator;
1307
- };
1308
- BbValidator.minDate = function (date, error) {
1309
- if (error === void 0) { error = 'minDate'; }
1310
- var formattedDate = date.toString() !== 'Invalid Date'
1311
- ? common.formatDate(date, 'yyyy-MM-dd', 'en-US')
1312
- : null;
1313
- var validator = function (control) {
1314
- var _b;
1315
- if (isEmptyInputValue(control.value)) {
1316
- return null;
1317
- }
1318
- var controlDate = new Date(control.value);
1319
- return controlDate.getTime() < date.getTime()
1320
- ? (_b = {}, _b[error] = { date: formattedDate }, _b) : null;
1321
- };
1322
- return validator;
1323
- };
1324
- return BbValidator;
1325
- }());
1326
- function isEmptyInputValue(value) {
1327
- // We don't check for string here so it also works with arrays.
1328
- return value == null || value.length === 0;
1311
+ var BbValidator = /** @class */ (function () {
1312
+ function BbValidator() {
1313
+ }
1314
+ BbValidator.email = function (control) {
1315
+ if (isEmptyInputValue(control.value)) {
1316
+ return null;
1317
+ }
1318
+ return BbRegex.email.test(control.value) ? null : { email: true };
1319
+ };
1320
+ BbValidator.fullNumber = function (control) {
1321
+ if (isEmptyInputValue(control.value)) {
1322
+ return null;
1323
+ }
1324
+ return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
1325
+ };
1326
+ BbValidator.maxFileSize = function (bytes) {
1327
+ var validator = function (control) {
1328
+ var value = control.value;
1329
+ // Validate if the value is a file.
1330
+ if (!(value instanceof File)) {
1331
+ return null;
1332
+ }
1333
+ if (value.size <= bytes) {
1334
+ return null;
1335
+ }
1336
+ var maxSize = '0 Bytes';
1337
+ if (bytes !== 0) {
1338
+ var k = 1024;
1339
+ var dm = 2;
1340
+ var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
1341
+ var index = Math.floor(Math.log(bytes) / Math.log(k));
1342
+ maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
1343
+ }
1344
+ return { maxFileSize: { maxSize: maxSize } };
1345
+ };
1346
+ return validator;
1347
+ };
1348
+ BbValidator.confirm = function (fieldName, error) {
1349
+ if (error === void 0) { error = 'confirm'; }
1350
+ var validator = function (control) {
1351
+ var _b;
1352
+ var _a;
1353
+ if (isEmptyInputValue(control.value)) {
1354
+ return null;
1355
+ }
1356
+ var field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
1357
+ return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
1358
+ ? null
1359
+ : (_b = {}, _b[error] = true, _b);
1360
+ };
1361
+ return validator;
1362
+ };
1363
+ BbValidator.maxDate = function (date, error) {
1364
+ if (error === void 0) { error = 'maxDate'; }
1365
+ var formattedDate = date.toString() !== 'Invalid Date'
1366
+ ? common.formatDate(date, 'yyyy-MM-dd', 'en-US')
1367
+ : null;
1368
+ var validator = function (control) {
1369
+ var _b;
1370
+ if (isEmptyInputValue(control.value)) {
1371
+ return null;
1372
+ }
1373
+ var controlDate = new Date(control.value);
1374
+ return controlDate.getTime() > date.getTime()
1375
+ ? (_b = {}, _b[error] = { date: formattedDate }, _b) : null;
1376
+ };
1377
+ return validator;
1378
+ };
1379
+ BbValidator.minDate = function (date, error) {
1380
+ if (error === void 0) { error = 'minDate'; }
1381
+ var formattedDate = date.toString() !== 'Invalid Date'
1382
+ ? common.formatDate(date, 'yyyy-MM-dd', 'en-US')
1383
+ : null;
1384
+ var validator = function (control) {
1385
+ var _b;
1386
+ if (isEmptyInputValue(control.value)) {
1387
+ return null;
1388
+ }
1389
+ var controlDate = new Date(control.value);
1390
+ return controlDate.getTime() < date.getTime()
1391
+ ? (_b = {}, _b[error] = { date: formattedDate }, _b) : null;
1392
+ };
1393
+ return validator;
1394
+ };
1395
+ return BbValidator;
1396
+ }());
1397
+ function isEmptyInputValue(value) {
1398
+ // We don't check for string here so it also works with arrays.
1399
+ return value == null || value.length === 0;
1329
1400
  }
1330
1401
 
1331
- /*
1332
- * Public API Surface of bb-foundation
1402
+ /*
1403
+ * Public API Surface of bb-foundation
1333
1404
  */
1334
1405
 
1335
- /**
1336
- * Generated bundle index. Do not edit.
1406
+ /**
1407
+ * Generated bundle index. Do not edit.
1337
1408
  */
1338
1409
 
1339
1410
  exports.ACCEPT_LANGUAGE = ACCEPT_LANGUAGE;
@@ -1341,6 +1412,8 @@
1341
1412
  exports.BbRegex = BbRegex;
1342
1413
  exports.BbValidator = BbValidator;
1343
1414
  exports.COOKIE = COOKIE;
1415
+ exports.Clipboard = Clipboard;
1416
+ exports.ClipboardCopy = ClipboardCopy;
1344
1417
  exports.Exif = Exif;
1345
1418
  exports.FileLoader = FileLoader;
1346
1419
  exports.ImageConverter = ImageConverter;
@@ -1363,5 +1436,5 @@
1363
1436
 
1364
1437
  Object.defineProperty(exports, '__esModule', { value: true });
1365
1438
 
1366
- })));
1439
+ }));
1367
1440
  //# sourceMappingURL=bravobit-bb-foundation.umd.js.map