@bravobit/bb-foundation 0.14.3 → 0.15.2

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 +868 -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 +1332 -1334
  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 +43 -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 +104 -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 -72
  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 -30
  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 +463 -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 +851 -851
  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 -18
  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 -26
  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 -16
  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
@@ -5,909 +5,909 @@ import { __awaiter } from 'tslib';
5
5
  import { mapTo, map, distinctUntilChanged, shareReplay, debounceTime, startWith } from 'rxjs/operators';
6
6
  import { of, fromEvent, Observable, merge, Subscription } from 'rxjs';
7
7
 
8
- let hasV8BreakIterator;
9
- try {
10
- hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
11
- }
12
- catch (_a) {
13
- hasV8BreakIterator = false;
14
- }
15
- class Platform {
16
- constructor(_platformId) {
17
- this._platformId = _platformId;
18
- // Browser check.
19
- this.isBrowser = this._platformId
20
- ? isPlatformBrowser(this._platformId)
21
- : typeof document === 'object' && !!document;
22
- // Is checks.
23
- this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
24
- this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
25
- this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
26
- this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
27
- this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
28
- this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
29
- this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
30
- this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
31
- this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
32
- this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
33
- }
34
- }
35
- Platform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Platform, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
36
- Platform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Platform, providedIn: 'root' });
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Platform, decorators: [{
38
- type: Injectable,
39
- args: [{
40
- providedIn: 'root'
41
- }]
42
- }], ctorParameters: function () { return [{ type: Object, decorators: [{
43
- type: Inject,
44
- args: [PLATFORM_ID]
8
+ let hasV8BreakIterator;
9
+ try {
10
+ hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
11
+ }
12
+ catch (_a) {
13
+ hasV8BreakIterator = false;
14
+ }
15
+ class Platform {
16
+ constructor(_platformId) {
17
+ this._platformId = _platformId;
18
+ // Browser check.
19
+ this.isBrowser = this._platformId
20
+ ? isPlatformBrowser(this._platformId)
21
+ : typeof document === 'object' && !!document;
22
+ // Is checks.
23
+ this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
24
+ this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
25
+ this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
26
+ this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
27
+ this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
28
+ this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
29
+ this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
30
+ this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
31
+ this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
32
+ this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
33
+ }
34
+ }
35
+ Platform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Platform, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
36
+ Platform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Platform, providedIn: 'root' });
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Platform, decorators: [{
38
+ type: Injectable,
39
+ args: [{
40
+ providedIn: 'root'
41
+ }]
42
+ }], ctorParameters: function () { return [{ type: Object, decorators: [{
43
+ type: Inject,
44
+ args: [PLATFORM_ID]
45
45
  }] }]; } });
46
46
 
47
- class FileLoader {
48
- constructor() {
49
- this.isFile = (input) => {
50
- return 'File' in window && input instanceof File;
51
- };
52
- this.isBlob = (input) => {
53
- return 'Blob' in window && input instanceof Blob;
54
- };
55
- this.blobToFile = (blob, fileName) => {
56
- const anyBlob = blob;
57
- anyBlob.lastModifiedDate = new Date();
58
- anyBlob.name = fileName;
59
- return anyBlob;
60
- };
61
- }
62
- fromDataUrl(value, name = 'file') {
63
- if (!value) {
64
- return null;
65
- }
66
- try {
67
- // Convert base64 to raw binary data held in a string.
68
- const byteString = window.atob(value.split(',')[1]);
69
- // Separate out the mime component.
70
- const mimeString = value
71
- .split(',')[0]
72
- .split(':')[1]
73
- .split(';')[0];
74
- // Write the bytes of the string to an ArrayBuffer.
75
- const arrayBuffer = new ArrayBuffer(byteString.length);
76
- const uint8Array = new Uint8Array(arrayBuffer);
77
- for (let index = 0; index < byteString.length; index++) {
78
- uint8Array[index] = byteString.charCodeAt(index);
79
- }
80
- const dataView = new DataView(arrayBuffer);
81
- const blob = new Blob([dataView.buffer], { type: mimeString });
82
- return this.createFile(blob, name);
83
- }
84
- catch (_a) {
85
- return null;
86
- }
87
- }
88
- asDataUrl(file) {
89
- return this.read(file, 'dataurl');
90
- }
91
- asArrayBuffer(file) {
92
- return this.read(file, 'arraybuffer');
93
- }
94
- read(file, type) {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- return new Promise((resolve, reject) => {
97
- const isFileLike = this.isFile(file) || this.isBlob(file);
98
- if (!file || !isFileLike) {
99
- return reject('Invalid file');
100
- }
101
- const reader = new FileReader();
102
- reader.onerror = () => reject('Error file read');
103
- reader.onabort = () => reject('Abort file read');
104
- reader.onload = () => {
105
- const result = reader.result;
106
- return resolve(result);
107
- };
108
- if (type === 'dataurl') {
109
- reader.readAsDataURL(file);
110
- }
111
- else if (type === 'arraybuffer') {
112
- reader.readAsArrayBuffer(file);
113
- }
114
- });
115
- });
116
- }
117
- createFile(blob, name) {
118
- if (!navigator.msSaveBlob) {
119
- return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
120
- }
121
- const blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
122
- return this.blobToFile(blobFile, name);
123
- }
124
- }
125
- FileLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: FileLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
126
- FileLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: FileLoader, providedIn: 'root' });
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: FileLoader, decorators: [{
128
- type: Injectable,
129
- args: [{
130
- providedIn: 'root'
131
- }]
47
+ class FileLoader {
48
+ constructor() {
49
+ this.isFile = (input) => {
50
+ return 'File' in window && input instanceof File;
51
+ };
52
+ this.isBlob = (input) => {
53
+ return 'Blob' in window && input instanceof Blob;
54
+ };
55
+ this.blobToFile = (blob, fileName) => {
56
+ const anyBlob = blob;
57
+ anyBlob.lastModifiedDate = new Date();
58
+ anyBlob.name = fileName;
59
+ return anyBlob;
60
+ };
61
+ }
62
+ fromDataUrl(value, name = 'file') {
63
+ if (!value) {
64
+ return null;
65
+ }
66
+ try {
67
+ // Convert base64 to raw binary data held in a string.
68
+ const byteString = window.atob(value.split(',')[1]);
69
+ // Separate out the mime component.
70
+ const mimeString = value
71
+ .split(',')[0]
72
+ .split(':')[1]
73
+ .split(';')[0];
74
+ // Write the bytes of the string to an ArrayBuffer.
75
+ const arrayBuffer = new ArrayBuffer(byteString.length);
76
+ const uint8Array = new Uint8Array(arrayBuffer);
77
+ for (let index = 0; index < byteString.length; index++) {
78
+ uint8Array[index] = byteString.charCodeAt(index);
79
+ }
80
+ const dataView = new DataView(arrayBuffer);
81
+ const blob = new Blob([dataView.buffer], { type: mimeString });
82
+ return this.createFile(blob, name);
83
+ }
84
+ catch (_a) {
85
+ return null;
86
+ }
87
+ }
88
+ asDataUrl(file) {
89
+ return this.read(file, 'dataurl');
90
+ }
91
+ asArrayBuffer(file) {
92
+ return this.read(file, 'arraybuffer');
93
+ }
94
+ read(file, type) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ return new Promise((resolve, reject) => {
97
+ const isFileLike = this.isFile(file) || this.isBlob(file);
98
+ if (!file || !isFileLike) {
99
+ return reject('Invalid file');
100
+ }
101
+ const reader = new FileReader();
102
+ reader.onerror = () => reject('Error file read');
103
+ reader.onabort = () => reject('Abort file read');
104
+ reader.onload = () => {
105
+ const result = reader.result;
106
+ return resolve(result);
107
+ };
108
+ if (type === 'dataurl') {
109
+ reader.readAsDataURL(file);
110
+ }
111
+ else if (type === 'arraybuffer') {
112
+ reader.readAsArrayBuffer(file);
113
+ }
114
+ });
115
+ });
116
+ }
117
+ createFile(blob, name) {
118
+ if (!navigator.msSaveBlob) {
119
+ return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
120
+ }
121
+ const blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
122
+ return this.blobToFile(blobFile, name);
123
+ }
124
+ }
125
+ FileLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: FileLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
126
+ FileLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: FileLoader, providedIn: 'root' });
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: FileLoader, decorators: [{
128
+ type: Injectable,
129
+ args: [{
130
+ providedIn: 'root'
131
+ }]
132
132
  }] });
133
133
 
134
- class Exif {
135
- constructor(_platform, _fileLoader) {
136
- this._platform = _platform;
137
- this._fileLoader = _fileLoader;
138
- this.transformImage = (image, type, orientation, quality = 100) => {
139
- // Create the canvas and context.
140
- const canvas = document.createElement('canvas');
141
- const context = canvas.getContext('2d');
142
- // Validate the context exists.
143
- if (!context) {
144
- return null;
145
- }
146
- // Set the canvas size based on the image.
147
- const { width, height } = image;
148
- canvas.width = width;
149
- canvas.height = height;
150
- // Validate the orientation is correct
151
- // else flip the canvas sizes.
152
- if (4 < orientation && orientation < 9) {
153
- canvas.width = height;
154
- canvas.height = width;
155
- }
156
- // Transform the context based on the orientation.
157
- switch (orientation) {
158
- case 2:
159
- context.transform(-1, 0, 0, 1, width, 0);
160
- break;
161
- case 3:
162
- context.transform(-1, 0, 0, -1, width, height);
163
- break;
164
- case 4:
165
- context.transform(1, 0, 0, -1, 0, height);
166
- break;
167
- case 5:
168
- context.transform(0, 1, 1, 0, 0, 0);
169
- break;
170
- case 6:
171
- context.transform(0, 1, -1, 0, height, 0);
172
- break;
173
- case 7:
174
- context.transform(0, -1, -1, 0, height, width);
175
- break;
176
- case 8:
177
- context.transform(0, -1, 1, 0, 0, width);
178
- break;
179
- default:
180
- break;
181
- }
182
- // Draw the image on the context and return the data URL.
183
- context.drawImage(image, 0, 0, width, height);
184
- return canvas.toDataURL(type, quality / 100);
185
- };
186
- this.getSupportedCanvasType = (fileType) => {
187
- switch (fileType) {
188
- case 'image/jpeg':
189
- case 'image/jpg':
190
- return 'image/jpeg';
191
- case 'image/x-windows-bmp':
192
- case 'image/bmp':
193
- return 'image/bmp';
194
- default:
195
- return 'image/png';
196
- }
197
- };
198
- this.getOrientation = (buffer) => {
199
- // Create a new data view.
200
- const view = new DataView(buffer);
201
- if (view.getUint16(0, false) !== 0xFFD8) {
202
- return -2;
203
- }
204
- const length = view.byteLength;
205
- let offset = 2;
206
- while (offset < length) {
207
- if (view.getUint16(offset + 2, false) <= 8) {
208
- return -1;
209
- }
210
- const marker = view.getUint16(offset, false);
211
- offset += 2;
212
- if (marker === 0xFFE1) {
213
- if (view.getUint32(offset += 2, false) !== 0x45786966) {
214
- return -1;
215
- }
216
- const little = view.getUint16(offset += 6, false) === 0x4949;
217
- offset += view.getUint32(offset + 4, little);
218
- const tags = view.getUint16(offset, little);
219
- offset += 2;
220
- for (let index = 0; index < tags; index++) {
221
- if (view.getUint16(offset + index * 12, little) === 0x0112) {
222
- return view.getUint16(offset + index * 12 + 8, little);
223
- }
224
- }
225
- }
226
- else if ((marker & 0xFF00) !== 0xFF00) {
227
- break;
228
- }
229
- else {
230
- offset += view.getUint16(offset, false);
231
- }
232
- }
233
- return -1;
234
- };
235
- }
236
- strip(file, quality = 100) {
237
- return __awaiter(this, void 0, void 0, function* () {
238
- // Validate we are on a browser.
239
- if (!this._platform.isBrowser) {
240
- return file;
241
- }
242
- // Validate the file exists and is
243
- // an instance of a File object.
244
- if (!file || !(file instanceof File)) {
245
- return file;
246
- }
247
- // Only jpeg images need correction.
248
- if (!['image/jpeg'].includes(file.type)) {
249
- return file;
250
- }
251
- try {
252
- // Read the file as an array buffer and data url.
253
- const arrayBuffer = yield this._fileLoader.asArrayBuffer(file);
254
- const dataUrl = yield this._fileLoader.asDataUrl(file);
255
- // Create an image element.
256
- const imageElement = yield this.createImageElement(dataUrl);
257
- // Get the orientation by using the buffer.
258
- const orientation = this.getOrientation(arrayBuffer);
259
- // Transform the image to remove the orientation.
260
- const canvasType = this.getSupportedCanvasType(file.type);
261
- const imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
262
- // Validate the image url exists.
263
- if (!imageUrl) {
264
- return file;
265
- }
266
- // Transform the image url to a file.
267
- return this._fileLoader.fromDataUrl(imageUrl, file.name);
268
- }
269
- catch (_a) {
270
- // When something goes wrong we
271
- // just return the default file.
272
- return file;
273
- }
274
- });
275
- }
276
- createImageElement(dataUrl) {
277
- return __awaiter(this, void 0, void 0, function* () {
278
- return new Promise((resolve, reject) => {
279
- const image = new Image();
280
- image.src = dataUrl;
281
- image.onerror = () => reject('Error image create');
282
- image.onabort = () => reject('Abort image create');
283
- image.onload = () => resolve(image);
284
- });
285
- });
286
- }
287
- }
288
- Exif.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
289
- Exif.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Exif, providedIn: 'root' });
290
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Exif, decorators: [{
291
- type: Injectable,
292
- args: [{
293
- providedIn: 'root'
294
- }]
134
+ class Exif {
135
+ constructor(_platform, _fileLoader) {
136
+ this._platform = _platform;
137
+ this._fileLoader = _fileLoader;
138
+ this.transformImage = (image, type, orientation, quality = 100) => {
139
+ // Create the canvas and context.
140
+ const canvas = document.createElement('canvas');
141
+ const context = canvas.getContext('2d');
142
+ // Validate the context exists.
143
+ if (!context) {
144
+ return null;
145
+ }
146
+ // Set the canvas size based on the image.
147
+ const { width, height } = image;
148
+ canvas.width = width;
149
+ canvas.height = height;
150
+ // Validate the orientation is correct
151
+ // else flip the canvas sizes.
152
+ if (4 < orientation && orientation < 9) {
153
+ canvas.width = height;
154
+ canvas.height = width;
155
+ }
156
+ // Transform the context based on the orientation.
157
+ switch (orientation) {
158
+ case 2:
159
+ context.transform(-1, 0, 0, 1, width, 0);
160
+ break;
161
+ case 3:
162
+ context.transform(-1, 0, 0, -1, width, height);
163
+ break;
164
+ case 4:
165
+ context.transform(1, 0, 0, -1, 0, height);
166
+ break;
167
+ case 5:
168
+ context.transform(0, 1, 1, 0, 0, 0);
169
+ break;
170
+ case 6:
171
+ context.transform(0, 1, -1, 0, height, 0);
172
+ break;
173
+ case 7:
174
+ context.transform(0, -1, -1, 0, height, width);
175
+ break;
176
+ case 8:
177
+ context.transform(0, -1, 1, 0, 0, width);
178
+ break;
179
+ default:
180
+ break;
181
+ }
182
+ // Draw the image on the context and return the data URL.
183
+ context.drawImage(image, 0, 0, width, height);
184
+ return canvas.toDataURL(type, quality / 100);
185
+ };
186
+ this.getSupportedCanvasType = (fileType) => {
187
+ switch (fileType) {
188
+ case 'image/jpeg':
189
+ case 'image/jpg':
190
+ return 'image/jpeg';
191
+ case 'image/x-windows-bmp':
192
+ case 'image/bmp':
193
+ return 'image/bmp';
194
+ default:
195
+ return 'image/png';
196
+ }
197
+ };
198
+ this.getOrientation = (buffer) => {
199
+ // Create a new data view.
200
+ const view = new DataView(buffer);
201
+ if (view.getUint16(0, false) !== 0xFFD8) {
202
+ return -2;
203
+ }
204
+ const length = view.byteLength;
205
+ let offset = 2;
206
+ while (offset < length) {
207
+ if (view.getUint16(offset + 2, false) <= 8) {
208
+ return -1;
209
+ }
210
+ const marker = view.getUint16(offset, false);
211
+ offset += 2;
212
+ if (marker === 0xFFE1) {
213
+ if (view.getUint32(offset += 2, false) !== 0x45786966) {
214
+ return -1;
215
+ }
216
+ const little = view.getUint16(offset += 6, false) === 0x4949;
217
+ offset += view.getUint32(offset + 4, little);
218
+ const tags = view.getUint16(offset, little);
219
+ offset += 2;
220
+ for (let index = 0; index < tags; index++) {
221
+ if (view.getUint16(offset + index * 12, little) === 0x0112) {
222
+ return view.getUint16(offset + index * 12 + 8, little);
223
+ }
224
+ }
225
+ }
226
+ else if ((marker & 0xFF00) !== 0xFF00) {
227
+ break;
228
+ }
229
+ else {
230
+ offset += view.getUint16(offset, false);
231
+ }
232
+ }
233
+ return -1;
234
+ };
235
+ }
236
+ strip(file, quality = 100) {
237
+ return __awaiter(this, void 0, void 0, function* () {
238
+ // Validate we are on a browser.
239
+ if (!this._platform.isBrowser) {
240
+ return file;
241
+ }
242
+ // Validate the file exists and is
243
+ // an instance of a File object.
244
+ if (!file || !(file instanceof File)) {
245
+ return file;
246
+ }
247
+ // Only jpeg images need correction.
248
+ if (!['image/jpeg'].includes(file.type)) {
249
+ return file;
250
+ }
251
+ try {
252
+ // Read the file as an array buffer and data url.
253
+ const arrayBuffer = yield this._fileLoader.asArrayBuffer(file);
254
+ const dataUrl = yield this._fileLoader.asDataUrl(file);
255
+ // Create an image element.
256
+ const imageElement = yield this.createImageElement(dataUrl);
257
+ // Get the orientation by using the buffer.
258
+ const orientation = this.getOrientation(arrayBuffer);
259
+ // Transform the image to remove the orientation.
260
+ const canvasType = this.getSupportedCanvasType(file.type);
261
+ const imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
262
+ // Validate the image url exists.
263
+ if (!imageUrl) {
264
+ return file;
265
+ }
266
+ // Transform the image url to a file.
267
+ return this._fileLoader.fromDataUrl(imageUrl, file.name);
268
+ }
269
+ catch (_a) {
270
+ // When something goes wrong we
271
+ // just return the default file.
272
+ return file;
273
+ }
274
+ });
275
+ }
276
+ createImageElement(dataUrl) {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ return new Promise((resolve, reject) => {
279
+ const image = new Image();
280
+ image.src = dataUrl;
281
+ image.onerror = () => reject('Error image create');
282
+ image.onabort = () => reject('Abort image create');
283
+ image.onload = () => resolve(image);
284
+ });
285
+ });
286
+ }
287
+ }
288
+ Exif.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
289
+ Exif.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Exif, providedIn: 'root' });
290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Exif, decorators: [{
291
+ type: Injectable,
292
+ args: [{
293
+ providedIn: 'root'
294
+ }]
295
295
  }], ctorParameters: function () { return [{ type: Platform }, { type: FileLoader }]; } });
296
296
 
297
- class ImageConverter {
298
- constructor(_exif, _platform, _fileLoader) {
299
- this._exif = _exif;
300
- this._platform = _platform;
301
- this._fileLoader = _fileLoader;
302
- // Data.
303
- this._types = ['image/png', 'image/jpeg'];
304
- this.calculateOffsetAndDimensions = (image, canvasWidth, canvasHeight) => {
305
- const originalWidth = image.width;
306
- const originalHeight = image.height;
307
- const widthRatio = canvasWidth / originalWidth;
308
- const heightRatio = canvasHeight / originalHeight;
309
- let width;
310
- let height;
311
- if (originalWidth > originalHeight) {
312
- height = originalHeight * heightRatio;
313
- width = (originalWidth / originalHeight) * height;
314
- }
315
- else {
316
- width = originalWidth * widthRatio;
317
- height = (originalHeight / originalWidth) * width;
318
- }
319
- let xOffset = 0;
320
- let yOffset = 0;
321
- if (canvasHeight === height) {
322
- xOffset = -((width - canvasWidth) / 2);
323
- }
324
- else if (canvasWidth === width) {
325
- yOffset = -((height - canvasHeight) / 2);
326
- }
327
- return { xOffset, yOffset, width, height };
328
- };
329
- }
330
- toDataUri(contents, options = null) {
331
- return __awaiter(this, void 0, void 0, function* () {
332
- // Check if the current platform is a browser.
333
- if (!this._platform.isBrowser) {
334
- return null;
335
- }
336
- // Get the image.
337
- const image = yield this.getImage(contents);
338
- // Get the canvas width and height.
339
- const canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
340
- const canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
341
- // Get the canvas and context.
342
- const canvas = document.createElement('canvas');
343
- const context = canvas.getContext('2d');
344
- // Validate the context exists.
345
- if (!context) {
346
- return null;
347
- }
348
- // Set the width and height.
349
- canvas.width = canvasWidth;
350
- canvas.height = canvasHeight;
351
- // When the canvas sizes are 0 we have failed.
352
- if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
353
- return null;
354
- }
355
- // Check if dimensions where supplied, else create the image.
356
- if (!options) {
357
- // Draw the image.
358
- context.drawImage(image, 0, 0);
359
- // Convert the canvas to a data url.
360
- return canvas.toDataURL(this._types[0]);
361
- }
362
- // Get the dimensions and offsets.
363
- const { width, height, xOffset, yOffset } = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight);
364
- // Draw the image.
365
- context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
366
- // Convert the canvas to a data url.
367
- return canvas.toDataURL(this._types[0]);
368
- });
369
- }
370
- fileToImage(file, types = this._types) {
371
- return __awaiter(this, void 0, void 0, function* () {
372
- // Check if the file matches an image.
373
- if (!types.includes(file.type)) {
374
- throw new Error('The selected file does not meet the required format.');
375
- }
376
- let stripped = null;
377
- try {
378
- stripped = yield this._exif.strip(file, 90);
379
- }
380
- catch (_a) {
381
- // Do nothing.
382
- }
383
- // Ge the data uri.
384
- const dataUri = yield this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file);
385
- // Convert the data URI to a image element.
386
- return yield this.stringToImage(dataUri);
387
- });
388
- }
389
- stringToImage(src) {
390
- return new Promise((resolve, reject) => {
391
- const image = new Image();
392
- image.src = src;
393
- image.onload = () => resolve(image);
394
- image.onerror = error => reject(error);
395
- });
396
- }
397
- getImage(contents) {
398
- return __awaiter(this, void 0, void 0, function* () {
399
- // If the contents is already an HTML image element just return it.
400
- if (contents instanceof HTMLImageElement) {
401
- return contents;
402
- }
403
- // If the contents is a file convert it to an HTML image element.
404
- if (contents instanceof File) {
405
- return this.fileToImage(contents);
406
- }
407
- // If the contents is a string convert it to an HTML image element.
408
- return this.stringToImage(contents);
409
- });
410
- }
411
- }
412
- ImageConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
413
- ImageConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: ImageConverter, providedIn: 'root' });
414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: ImageConverter, decorators: [{
415
- type: Injectable,
416
- args: [{
417
- providedIn: 'root'
418
- }]
297
+ class ImageConverter {
298
+ constructor(_exif, _platform, _fileLoader) {
299
+ this._exif = _exif;
300
+ this._platform = _platform;
301
+ this._fileLoader = _fileLoader;
302
+ // Data.
303
+ this._types = ['image/png', 'image/jpeg'];
304
+ this.calculateOffsetAndDimensions = (image, canvasWidth, canvasHeight) => {
305
+ const originalWidth = image.width;
306
+ const originalHeight = image.height;
307
+ const widthRatio = canvasWidth / originalWidth;
308
+ const heightRatio = canvasHeight / originalHeight;
309
+ let width;
310
+ let height;
311
+ if (originalWidth > originalHeight) {
312
+ height = originalHeight * heightRatio;
313
+ width = (originalWidth / originalHeight) * height;
314
+ }
315
+ else {
316
+ width = originalWidth * widthRatio;
317
+ height = (originalHeight / originalWidth) * width;
318
+ }
319
+ let xOffset = 0;
320
+ let yOffset = 0;
321
+ if (canvasHeight === height) {
322
+ xOffset = -((width - canvasWidth) / 2);
323
+ }
324
+ else if (canvasWidth === width) {
325
+ yOffset = -((height - canvasHeight) / 2);
326
+ }
327
+ return { xOffset, yOffset, width, height };
328
+ };
329
+ }
330
+ toDataUri(contents, options = null) {
331
+ return __awaiter(this, void 0, void 0, function* () {
332
+ // Check if the current platform is a browser.
333
+ if (!this._platform.isBrowser) {
334
+ return null;
335
+ }
336
+ // Get the image.
337
+ const image = yield this.getImage(contents);
338
+ // Get the canvas width and height.
339
+ const canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
340
+ const canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
341
+ // Get the canvas and context.
342
+ const canvas = document.createElement('canvas');
343
+ const context = canvas.getContext('2d');
344
+ // Validate the context exists.
345
+ if (!context) {
346
+ return null;
347
+ }
348
+ // Set the width and height.
349
+ canvas.width = canvasWidth;
350
+ canvas.height = canvasHeight;
351
+ // When the canvas sizes are 0 we have failed.
352
+ if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
353
+ return null;
354
+ }
355
+ // Check if dimensions where supplied, else create the image.
356
+ if (!options) {
357
+ // Draw the image.
358
+ context.drawImage(image, 0, 0);
359
+ // Convert the canvas to a data url.
360
+ return canvas.toDataURL(this._types[0]);
361
+ }
362
+ // Get the dimensions and offsets.
363
+ const { width, height, xOffset, yOffset } = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight);
364
+ // Draw the image.
365
+ context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
366
+ // Convert the canvas to a data url.
367
+ return canvas.toDataURL(this._types[0]);
368
+ });
369
+ }
370
+ fileToImage(file, types = this._types) {
371
+ return __awaiter(this, void 0, void 0, function* () {
372
+ // Check if the file matches an image.
373
+ if (!types.includes(file.type)) {
374
+ throw new Error('The selected file does not meet the required format.');
375
+ }
376
+ let stripped = null;
377
+ try {
378
+ stripped = yield this._exif.strip(file, 90);
379
+ }
380
+ catch (_a) {
381
+ // Do nothing.
382
+ }
383
+ // Ge the data uri.
384
+ const dataUri = yield this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file);
385
+ // Convert the data URI to a image element.
386
+ return yield this.stringToImage(dataUri);
387
+ });
388
+ }
389
+ stringToImage(src) {
390
+ return new Promise((resolve, reject) => {
391
+ const image = new Image();
392
+ image.src = src;
393
+ image.onload = () => resolve(image);
394
+ image.onerror = error => reject(error);
395
+ });
396
+ }
397
+ getImage(contents) {
398
+ return __awaiter(this, void 0, void 0, function* () {
399
+ // If the contents is already an HTML image element just return it.
400
+ if (contents instanceof HTMLImageElement) {
401
+ return contents;
402
+ }
403
+ // If the contents is a file convert it to an HTML image element.
404
+ if (contents instanceof File) {
405
+ return this.fileToImage(contents);
406
+ }
407
+ // If the contents is a string convert it to an HTML image element.
408
+ return this.stringToImage(contents);
409
+ });
410
+ }
411
+ }
412
+ ImageConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
413
+ ImageConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: ImageConverter, providedIn: 'root' });
414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: ImageConverter, decorators: [{
415
+ type: Injectable,
416
+ args: [{
417
+ providedIn: 'root'
418
+ }]
419
419
  }], ctorParameters: function () { return [{ type: Exif }, { type: Platform }, { type: FileLoader }]; } });
420
420
 
421
421
  const ACCEPT_LANGUAGE = new InjectionToken('AcceptLanguage');
422
422
 
423
- class Languages {
424
- constructor(_acceptLanguage) {
425
- this._acceptLanguage = _acceptLanguage;
426
- // Data.
427
- this._data = [];
428
- this.getLanguages = () => {
429
- // If defined we must be in a server environment.
430
- if (this._acceptLanguage) {
431
- return this._acceptLanguage;
432
- }
433
- // Try to get the languages from the navigator.
434
- if (typeof navigator !== 'object') {
435
- return null;
436
- }
437
- let t = 'anguage';
438
- let n = navigator;
439
- let f = n['l' + t + 's'];
440
- const data = f && f.length ? f : (t = n['l' + t] ||
441
- n['browserL' + t] ||
442
- n['userL' + t]) ? [t] : t;
443
- return typeof data === 'string'
444
- ? data
445
- : data.join(';');
446
- };
447
- this._data = this.initialize();
448
- }
449
- get all() {
450
- return this._data;
451
- }
452
- initialize() {
453
- // Get the languages.
454
- const data = this.getLanguages();
455
- // Parse all languages by using a regex.
456
- const strings = (data || '')
457
- .match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
458
- // Get the content by parsing the strings.
459
- const content = strings.map(item => {
460
- if (!item) {
461
- return null;
462
- }
463
- const bits = item.split(';');
464
- const ietf = bits[0].split('-');
465
- const hasScript = ietf.length === 3;
466
- return {
467
- code: ietf[0],
468
- script: hasScript ? ietf[1] : null,
469
- region: hasScript ? ietf[2] : ietf[1],
470
- quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
471
- };
472
- });
473
- // Filter out all the empty items
474
- // and sort them by the quality.
475
- return content
476
- .filter(item => !!item)
477
- .sort((a, b) => b.quality - a.quality);
478
- }
479
- }
480
- Languages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
481
- Languages.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Languages, providedIn: 'root' });
482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Languages, decorators: [{
483
- type: Injectable,
484
- args: [{
485
- providedIn: 'root'
486
- }]
487
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
488
- type: Optional
489
- }, {
490
- type: Inject,
491
- args: [ACCEPT_LANGUAGE]
423
+ class Languages {
424
+ constructor(_acceptLanguage) {
425
+ this._acceptLanguage = _acceptLanguage;
426
+ // Data.
427
+ this._data = [];
428
+ this.getLanguages = () => {
429
+ // If defined we must be in a server environment.
430
+ if (this._acceptLanguage) {
431
+ return this._acceptLanguage;
432
+ }
433
+ // Try to get the languages from the navigator.
434
+ if (typeof navigator !== 'object') {
435
+ return null;
436
+ }
437
+ let t = 'anguage';
438
+ let n = navigator;
439
+ let f = n['l' + t + 's'];
440
+ const data = f && f.length ? f : (t = n['l' + t] ||
441
+ n['browserL' + t] ||
442
+ n['userL' + t]) ? [t] : t;
443
+ return typeof data === 'string'
444
+ ? data
445
+ : data.join(';');
446
+ };
447
+ this._data = this.initialize();
448
+ }
449
+ get all() {
450
+ return this._data;
451
+ }
452
+ initialize() {
453
+ // Get the languages.
454
+ const data = this.getLanguages();
455
+ // Parse all languages by using a regex.
456
+ const strings = (data || '')
457
+ .match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
458
+ // Get the content by parsing the strings.
459
+ const content = strings.map(item => {
460
+ if (!item) {
461
+ return null;
462
+ }
463
+ const bits = item.split(';');
464
+ const ietf = bits[0].split('-');
465
+ const hasScript = ietf.length === 3;
466
+ return {
467
+ code: ietf[0],
468
+ script: hasScript ? ietf[1] : null,
469
+ region: hasScript ? ietf[2] : ietf[1],
470
+ quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
471
+ };
472
+ });
473
+ // Filter out all the empty items
474
+ // and sort them by the quality.
475
+ return content
476
+ .filter(item => !!item)
477
+ .sort((a, b) => b.quality - a.quality);
478
+ }
479
+ }
480
+ Languages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
481
+ Languages.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Languages, providedIn: 'root' });
482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Languages, decorators: [{
483
+ type: Injectable,
484
+ args: [{
485
+ providedIn: 'root'
486
+ }]
487
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
488
+ type: Optional
489
+ }, {
490
+ type: Inject,
491
+ args: [ACCEPT_LANGUAGE]
492
492
  }] }]; } });
493
493
 
494
- const WINDOW = new InjectionToken('An abstraction over global window object', {
495
- factory: () => {
496
- const { defaultView } = inject(DOCUMENT);
497
- if (!defaultView) {
498
- throw new Error('Window is not available');
499
- }
500
- return defaultView;
501
- }
494
+ const WINDOW = new InjectionToken('An abstraction over global window object', {
495
+ factory: () => {
496
+ const { defaultView } = inject(DOCUMENT);
497
+ if (!defaultView) {
498
+ throw new Error('Window is not available');
499
+ }
500
+ return defaultView;
501
+ }
502
502
  });
503
503
 
504
- const NAVIGATOR = new InjectionToken('An abstraction over window.navigator object', {
505
- factory: () => inject(WINDOW).navigator
504
+ const NAVIGATOR = new InjectionToken('An abstraction over window.navigator object', {
505
+ factory: () => inject(WINDOW).navigator
506
506
  });
507
507
 
508
- class Network {
509
- constructor(_platform, _window, _navigator) {
510
- this._platform = _platform;
511
- this._window = _window;
512
- this._navigator = _navigator;
513
- // Data.
514
- this._online$ = of(true);
515
- this.getOnlineObservable();
516
- }
517
- online() {
518
- return this._online$;
519
- }
520
- getOnlineObservable() {
521
- // Validate we are on a browser.
522
- if (!this._platform.isBrowser) {
523
- return;
524
- }
525
- // Get all the events from the window.
526
- const online$ = fromEvent(this._window, 'online').pipe(mapTo(true));
527
- const offline$ = fromEvent(this._window, 'offline').pipe(mapTo(false));
528
- const now$ = new Observable(subscriber => {
529
- var _a;
530
- subscriber.next((_a = this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
531
- subscriber.complete();
532
- });
533
- // Merge all event so we get notified when
534
- // a user is online/offline.
535
- this._online$ = merge(now$, online$, offline$).pipe(map(value => value), distinctUntilChanged(), shareReplay(1));
536
- }
537
- }
538
- Network.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
539
- Network.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Network, providedIn: 'root' });
540
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Network, decorators: [{
541
- type: Injectable,
542
- args: [{
543
- providedIn: 'root'
544
- }]
545
- }], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
546
- type: Optional
547
- }, {
548
- type: Inject,
549
- args: [WINDOW]
550
- }] }, { type: undefined, decorators: [{
551
- type: Optional
552
- }, {
553
- type: Inject,
554
- args: [NAVIGATOR]
508
+ class Network {
509
+ constructor(_platform, _window, _navigator) {
510
+ this._platform = _platform;
511
+ this._window = _window;
512
+ this._navigator = _navigator;
513
+ // Data.
514
+ this._online$ = of(true);
515
+ this.getOnlineObservable();
516
+ }
517
+ online() {
518
+ return this._online$;
519
+ }
520
+ getOnlineObservable() {
521
+ // Validate we are on a browser.
522
+ if (!this._platform.isBrowser) {
523
+ return;
524
+ }
525
+ // Get all the events from the window.
526
+ const online$ = fromEvent(this._window, 'online').pipe(mapTo(true));
527
+ const offline$ = fromEvent(this._window, 'offline').pipe(mapTo(false));
528
+ const now$ = new Observable(subscriber => {
529
+ var _a;
530
+ subscriber.next((_a = this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
531
+ subscriber.complete();
532
+ });
533
+ // Merge all event so we get notified when
534
+ // a user is online/offline.
535
+ this._online$ = merge(now$, online$, offline$).pipe(map(value => value), distinctUntilChanged(), shareReplay(1));
536
+ }
537
+ }
538
+ Network.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
539
+ Network.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Network, providedIn: 'root' });
540
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Network, decorators: [{
541
+ type: Injectable,
542
+ args: [{
543
+ providedIn: 'root'
544
+ }]
545
+ }], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
546
+ type: Optional
547
+ }, {
548
+ type: Inject,
549
+ args: [WINDOW]
550
+ }] }, { type: undefined, decorators: [{
551
+ type: Optional
552
+ }, {
553
+ type: Inject,
554
+ args: [NAVIGATOR]
555
555
  }] }]; } });
556
556
 
557
- class Patch {
558
- constructor(_platform, _window, _document) {
559
- this._platform = _platform;
560
- this._window = _window;
561
- this._document = _document;
562
- this._hasPatchedMobileVerticalHeight = false;
563
- // Subscriptions.
564
- this._subscription = new Subscription();
565
- }
566
- mobileVerticalHeight() {
567
- // Check if the user has already patched
568
- // the mobile vertical height.
569
- if (this._hasPatchedMobileVerticalHeight) {
570
- return;
571
- }
572
- this.periodicallySetDocumentVerticalProperty();
573
- this._hasPatchedMobileVerticalHeight = true;
574
- }
575
- ngOnDestroy() {
576
- var _a;
577
- (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
578
- }
579
- periodicallySetDocumentVerticalProperty() {
580
- // Validate we are using a browser.
581
- if (!this._platform.isBrowser) {
582
- return;
583
- }
584
- // Listen to a debounced window resize event.
585
- const resize$ = fromEvent(this._window, 'resize').pipe(debounceTime(25), startWith(0));
586
- // Subscribe to the resize observable.
587
- const subscription = resize$.subscribe(() => {
588
- var _a, _b, _c, _d;
589
- const verticalHeight = ((_a = this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
590
- (_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`);
591
- });
592
- // Save the subscription so we can destroy it later.
593
- this._subscription.add(subscription);
594
- }
595
- }
596
- Patch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
597
- Patch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Patch, providedIn: 'root' });
598
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Patch, decorators: [{
599
- type: Injectable,
600
- args: [{
601
- providedIn: 'root'
602
- }]
603
- }], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
604
- type: Optional
605
- }, {
606
- type: Inject,
607
- args: [WINDOW]
608
- }] }, { type: undefined, decorators: [{
609
- type: Optional
610
- }, {
611
- type: Inject,
612
- args: [DOCUMENT]
557
+ class Patch {
558
+ constructor(_platform, _window, _document) {
559
+ this._platform = _platform;
560
+ this._window = _window;
561
+ this._document = _document;
562
+ this._hasPatchedMobileVerticalHeight = false;
563
+ // Subscriptions.
564
+ this._subscription = new Subscription();
565
+ }
566
+ mobileVerticalHeight() {
567
+ // Check if the user has already patched
568
+ // the mobile vertical height.
569
+ if (this._hasPatchedMobileVerticalHeight) {
570
+ return;
571
+ }
572
+ this.periodicallySetDocumentVerticalProperty();
573
+ this._hasPatchedMobileVerticalHeight = true;
574
+ }
575
+ ngOnDestroy() {
576
+ var _a;
577
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
578
+ }
579
+ periodicallySetDocumentVerticalProperty() {
580
+ // Validate we are using a browser.
581
+ if (!this._platform.isBrowser) {
582
+ return;
583
+ }
584
+ // Listen to a debounced window resize event.
585
+ const resize$ = fromEvent(this._window, 'resize').pipe(debounceTime(25), startWith(0));
586
+ // Subscribe to the resize observable.
587
+ const subscription = resize$.subscribe(() => {
588
+ var _a, _b, _c, _d;
589
+ const verticalHeight = ((_a = this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
590
+ (_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`);
591
+ });
592
+ // Save the subscription so we can destroy it later.
593
+ this._subscription.add(subscription);
594
+ }
595
+ }
596
+ Patch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
597
+ Patch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Patch, providedIn: 'root' });
598
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Patch, decorators: [{
599
+ type: Injectable,
600
+ args: [{
601
+ providedIn: 'root'
602
+ }]
603
+ }], ctorParameters: function () { return [{ type: Platform }, { type: undefined, decorators: [{
604
+ type: Optional
605
+ }, {
606
+ type: Inject,
607
+ args: [WINDOW]
608
+ }] }, { type: undefined, decorators: [{
609
+ type: Optional
610
+ }, {
611
+ type: Inject,
612
+ args: [DOCUMENT]
613
613
  }] }]; } });
614
614
 
615
- class Clipboard {
616
- constructor(_document) {
617
- this._document = _document;
618
- }
619
- copy(text) {
620
- const pendingCopy = this.beginCopy(text);
621
- const successful = pendingCopy.copy();
622
- pendingCopy.destroy();
623
- return successful;
624
- }
625
- beginCopy(text) {
626
- return new ClipboardCopy(text, this._document);
627
- }
628
- }
629
- Clipboard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Clipboard, deps: [{ token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
630
- Clipboard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Clipboard, providedIn: 'root' });
631
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.1", ngImport: i0, type: Clipboard, decorators: [{
632
- type: Injectable,
633
- args: [{
634
- providedIn: 'root'
635
- }]
636
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
637
- type: Optional
638
- }, {
639
- type: Inject,
640
- args: [DOCUMENT]
641
- }] }]; } });
642
- class ClipboardCopy {
643
- constructor(_text, _document) {
644
- this._text = _text;
645
- this._document = _document;
646
- this.initialize();
647
- }
648
- copy() {
649
- var _a, _b, _c, _d, _e, _f;
650
- const textarea = this._textarea;
651
- let successful = false;
652
- try {
653
- const currentFocus = this._document.activeElement;
654
- (_a = textarea === null || textarea === void 0 ? void 0 : textarea.select) === null || _a === void 0 ? void 0 : _a.call(textarea);
655
- (_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);
656
- successful = (_e = (_d = this._document) === null || _d === void 0 ? void 0 : _d.execCommand) === null || _e === void 0 ? void 0 : _e.call(_d, 'copy');
657
- (_f = currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.focus) === null || _f === void 0 ? void 0 : _f.call(currentFocus);
658
- }
659
- catch (_g) {
660
- // Do nothing.
661
- }
662
- return successful;
663
- }
664
- destroy() {
665
- var _a, _b, _c;
666
- (_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);
667
- this._textarea = undefined;
668
- }
669
- initialize() {
670
- const textarea = this._textarea = this._document.createElement('textarea');
671
- const styles = textarea.style;
672
- // Hide the element for display and accessibility. Set a fixed position so the page layout
673
- // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
674
- // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
675
- styles.position = 'fixed';
676
- styles.top = styles.opacity = '0';
677
- styles.left = '-999em';
678
- textarea.setAttribute('aria-hidden', 'true');
679
- textarea.value = this._text;
680
- this._document.body.appendChild(textarea);
681
- }
615
+ class Clipboard {
616
+ constructor(_document) {
617
+ this._document = _document;
618
+ }
619
+ copy(text) {
620
+ const pendingCopy = this.beginCopy(text);
621
+ const successful = pendingCopy.copy();
622
+ pendingCopy.destroy();
623
+ return successful;
624
+ }
625
+ beginCopy(text) {
626
+ return new ClipboardCopy(text, this._document);
627
+ }
628
+ }
629
+ Clipboard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Clipboard, deps: [{ token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
630
+ Clipboard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Clipboard, providedIn: 'root' });
631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.10", ngImport: i0, type: Clipboard, decorators: [{
632
+ type: Injectable,
633
+ args: [{
634
+ providedIn: 'root'
635
+ }]
636
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
637
+ type: Optional
638
+ }, {
639
+ type: Inject,
640
+ args: [DOCUMENT]
641
+ }] }]; } });
642
+ class ClipboardCopy {
643
+ constructor(_text, _document) {
644
+ this._text = _text;
645
+ this._document = _document;
646
+ this.initialize();
647
+ }
648
+ copy() {
649
+ var _a, _b, _c, _d, _e, _f;
650
+ const textarea = this._textarea;
651
+ let successful = false;
652
+ try {
653
+ const currentFocus = this._document.activeElement;
654
+ (_a = textarea === null || textarea === void 0 ? void 0 : textarea.select) === null || _a === void 0 ? void 0 : _a.call(textarea);
655
+ (_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);
656
+ successful = (_e = (_d = this._document) === null || _d === void 0 ? void 0 : _d.execCommand) === null || _e === void 0 ? void 0 : _e.call(_d, 'copy');
657
+ (_f = currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.focus) === null || _f === void 0 ? void 0 : _f.call(currentFocus);
658
+ }
659
+ catch (_g) {
660
+ // Do nothing.
661
+ }
662
+ return successful;
663
+ }
664
+ destroy() {
665
+ var _a, _b, _c;
666
+ (_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);
667
+ this._textarea = undefined;
668
+ }
669
+ initialize() {
670
+ const textarea = this._textarea = this._document.createElement('textarea');
671
+ const styles = textarea.style;
672
+ // Hide the element for display and accessibility. Set a fixed position so the page layout
673
+ // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
674
+ // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
675
+ styles.position = 'fixed';
676
+ styles.top = styles.opacity = '0';
677
+ styles.left = '-999em';
678
+ textarea.setAttribute('aria-hidden', 'true');
679
+ textarea.value = this._text;
680
+ this._document.body.appendChild(textarea);
681
+ }
682
682
  }
683
683
 
684
- function coerceBooleanProperty(value) {
685
- return value != null && `${value}` !== 'false';
684
+ function coerceBooleanProperty(value) {
685
+ return value != null && `${value}` !== 'false';
686
686
  }
687
687
 
688
- function mixinDisabled(base) {
689
- return class extends base {
690
- constructor(...args) {
691
- super(...args);
692
- this._disable = false;
693
- }
694
- get disabled() {
695
- return this._disable;
696
- }
697
- set disabled(value) {
698
- this._disable = coerceBooleanProperty(value);
699
- }
700
- };
688
+ function mixinDisabled(base) {
689
+ return class extends base {
690
+ constructor(...args) {
691
+ super(...args);
692
+ this._disable = false;
693
+ }
694
+ get disabled() {
695
+ return this._disable;
696
+ }
697
+ set disabled(value) {
698
+ this._disable = coerceBooleanProperty(value);
699
+ }
700
+ };
701
701
  }
702
702
 
703
- function mixinLoad(base) {
704
- return class extends base {
705
- constructor(...args) {
706
- super(...args);
707
- this._loading = false;
708
- }
709
- get loading() {
710
- return this._loading;
711
- }
712
- set loading(value) {
713
- this._loading = coerceBooleanProperty(value);
714
- }
715
- };
703
+ function mixinLoad(base) {
704
+ return class extends base {
705
+ constructor(...args) {
706
+ super(...args);
707
+ this._loading = false;
708
+ }
709
+ get loading() {
710
+ return this._loading;
711
+ }
712
+ set loading(value) {
713
+ this._loading = coerceBooleanProperty(value);
714
+ }
715
+ };
716
716
  }
717
717
 
718
- function mixinError(base) {
719
- return class extends base {
720
- constructor(...args) {
721
- super(...args);
722
- this._error = false;
723
- }
724
- get error() {
725
- return this._error;
726
- }
727
- set error(value) {
728
- this._error = coerceBooleanProperty(value);
729
- }
730
- };
718
+ function mixinError(base) {
719
+ return class extends base {
720
+ constructor(...args) {
721
+ super(...args);
722
+ this._error = false;
723
+ }
724
+ get error() {
725
+ return this._error;
726
+ }
727
+ set error(value) {
728
+ this._error = coerceBooleanProperty(value);
729
+ }
730
+ };
731
731
  }
732
732
 
733
- function mixinHideErrors(base) {
734
- return class extends base {
735
- constructor(...args) {
736
- super(...args);
737
- this._hideErrors = false;
738
- }
739
- get hideErrors() {
740
- return this._hideErrors;
741
- }
742
- set hideErrors(value) {
743
- this._hideErrors = coerceBooleanProperty(value);
744
- }
745
- };
733
+ function mixinHideErrors(base) {
734
+ return class extends base {
735
+ constructor(...args) {
736
+ super(...args);
737
+ this._hideErrors = false;
738
+ }
739
+ get hideErrors() {
740
+ return this._hideErrors;
741
+ }
742
+ set hideErrors(value) {
743
+ this._hideErrors = coerceBooleanProperty(value);
744
+ }
745
+ };
746
746
  }
747
747
 
748
- function mixinFocused(base) {
749
- return class extends base {
750
- constructor(...args) {
751
- super(...args);
752
- this._focused = false;
753
- }
754
- get focused() {
755
- return this._focused;
756
- }
757
- set focused(value) {
758
- this._focused = coerceBooleanProperty(value);
759
- }
760
- };
748
+ function mixinFocused(base) {
749
+ return class extends base {
750
+ constructor(...args) {
751
+ super(...args);
752
+ this._focused = false;
753
+ }
754
+ get focused() {
755
+ return this._focused;
756
+ }
757
+ set focused(value) {
758
+ this._focused = coerceBooleanProperty(value);
759
+ }
760
+ };
761
761
  }
762
762
 
763
- function mixinGrouped(base) {
764
- return class extends base {
765
- constructor(...args) {
766
- super(...args);
767
- this._grouped = false;
768
- }
769
- get grouped() {
770
- return this._grouped;
771
- }
772
- set grouped(value) {
773
- this._grouped = coerceBooleanProperty(value);
774
- }
775
- };
763
+ function mixinGrouped(base) {
764
+ return class extends base {
765
+ constructor(...args) {
766
+ super(...args);
767
+ this._grouped = false;
768
+ }
769
+ get grouped() {
770
+ return this._grouped;
771
+ }
772
+ set grouped(value) {
773
+ this._grouped = coerceBooleanProperty(value);
774
+ }
775
+ };
776
776
  }
777
777
 
778
- function mixinReadonly(base) {
779
- return class extends base {
780
- constructor(...args) {
781
- super(...args);
782
- this._readonly = false;
783
- }
784
- get readonly() {
785
- return this._readonly;
786
- }
787
- set readonly(value) {
788
- this._readonly = coerceBooleanProperty(value);
789
- }
790
- };
778
+ function mixinReadonly(base) {
779
+ return class extends base {
780
+ constructor(...args) {
781
+ super(...args);
782
+ this._readonly = false;
783
+ }
784
+ get readonly() {
785
+ return this._readonly;
786
+ }
787
+ set readonly(value) {
788
+ this._readonly = coerceBooleanProperty(value);
789
+ }
790
+ };
791
791
  }
792
792
 
793
- function mixinRequired(base) {
794
- return class extends base {
795
- constructor(...args) {
796
- super(...args);
797
- this._required = false;
798
- }
799
- get required() {
800
- return this._required;
801
- }
802
- set required(value) {
803
- this._required = coerceBooleanProperty(value);
804
- }
805
- };
793
+ function mixinRequired(base) {
794
+ return class extends base {
795
+ constructor(...args) {
796
+ super(...args);
797
+ this._required = false;
798
+ }
799
+ get required() {
800
+ return this._required;
801
+ }
802
+ set required(value) {
803
+ this._required = coerceBooleanProperty(value);
804
+ }
805
+ };
806
806
  }
807
807
 
808
808
  const BASE_URL = new InjectionToken('BaseUrl');
809
809
 
810
810
  const COOKIE = new InjectionToken('Cookie');
811
811
 
812
- const LOCATION = new InjectionToken('An abstraction over window.location object', {
813
- factory: () => inject(WINDOW).location
812
+ const LOCATION = new InjectionToken('An abstraction over window.location object', {
813
+ factory: () => inject(WINDOW).location
814
814
  });
815
815
 
816
- const BbRegex = {
817
- 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,}))$/,
818
- fullNumber: /^\d*[1-9]\d*$/
816
+ const BbRegex = {
817
+ 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,}))$/,
818
+ fullNumber: /^\d*[1-9]\d*$/
819
819
  };
820
820
 
821
- class BbValidator {
822
- static email(control) {
823
- if (isEmptyInputValue(control.value)) {
824
- return null;
825
- }
826
- return BbRegex.email.test(control.value) ? null : { email: true };
827
- }
828
- static fullNumber(control) {
829
- if (isEmptyInputValue(control.value)) {
830
- return null;
831
- }
832
- return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
833
- }
834
- static maxFileSize(bytes) {
835
- const validator = (control) => {
836
- const value = control.value;
837
- // Validate if the value is a file.
838
- if (!(value instanceof File)) {
839
- return null;
840
- }
841
- if (value.size <= bytes) {
842
- return null;
843
- }
844
- let maxSize = '0 Bytes';
845
- if (bytes !== 0) {
846
- const k = 1024;
847
- const dm = 2;
848
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
849
- const index = Math.floor(Math.log(bytes) / Math.log(k));
850
- maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
851
- }
852
- return { maxFileSize: { maxSize } };
853
- };
854
- return validator;
855
- }
856
- static confirm(fieldName, error = 'confirm') {
857
- const validator = (control) => {
858
- var _a;
859
- if (isEmptyInputValue(control.value)) {
860
- return null;
861
- }
862
- const field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
863
- return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
864
- ? null
865
- : { [error]: true };
866
- };
867
- return validator;
868
- }
869
- static maxDate(date, error = 'maxDate') {
870
- const formattedDate = date.toString() !== 'Invalid Date'
871
- ? formatDate(date, 'yyyy-MM-dd', 'en-US')
872
- : null;
873
- const validator = (control) => {
874
- if (isEmptyInputValue(control.value)) {
875
- return null;
876
- }
877
- const controlDate = new Date(control.value);
878
- return controlDate.getTime() > date.getTime()
879
- ? { [error]: { date: formattedDate } }
880
- : null;
881
- };
882
- return validator;
883
- }
884
- static minDate(date, error = 'minDate') {
885
- const formattedDate = date.toString() !== 'Invalid Date'
886
- ? formatDate(date, 'yyyy-MM-dd', 'en-US')
887
- : null;
888
- const validator = (control) => {
889
- if (isEmptyInputValue(control.value)) {
890
- return null;
891
- }
892
- const controlDate = new Date(control.value);
893
- return controlDate.getTime() < date.getTime()
894
- ? { [error]: { date: formattedDate } }
895
- : null;
896
- };
897
- return validator;
898
- }
899
- }
900
- function isEmptyInputValue(value) {
901
- // We don't check for string here so it also works with arrays.
902
- return value == null || value.length === 0;
821
+ class BbValidator {
822
+ static email(control) {
823
+ if (isEmptyInputValue(control.value)) {
824
+ return null;
825
+ }
826
+ return BbRegex.email.test(control.value) ? null : { email: true };
827
+ }
828
+ static fullNumber(control) {
829
+ if (isEmptyInputValue(control.value)) {
830
+ return null;
831
+ }
832
+ return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
833
+ }
834
+ static maxFileSize(bytes) {
835
+ const validator = (control) => {
836
+ const value = control.value;
837
+ // Validate if the value is a file.
838
+ if (!(value instanceof File)) {
839
+ return null;
840
+ }
841
+ if (value.size <= bytes) {
842
+ return null;
843
+ }
844
+ let maxSize = '0 Bytes';
845
+ if (bytes !== 0) {
846
+ const k = 1024;
847
+ const dm = 2;
848
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
849
+ const index = Math.floor(Math.log(bytes) / Math.log(k));
850
+ maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
851
+ }
852
+ return { maxFileSize: { maxSize } };
853
+ };
854
+ return validator;
855
+ }
856
+ static confirm(fieldName, error = 'confirm') {
857
+ const validator = (control) => {
858
+ var _a;
859
+ if (isEmptyInputValue(control.value)) {
860
+ return null;
861
+ }
862
+ const field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
863
+ return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
864
+ ? null
865
+ : { [error]: true };
866
+ };
867
+ return validator;
868
+ }
869
+ static maxDate(date, error = 'maxDate') {
870
+ const formattedDate = date.toString() !== 'Invalid Date'
871
+ ? formatDate(date, 'yyyy-MM-dd', 'en-US')
872
+ : null;
873
+ const validator = (control) => {
874
+ if (isEmptyInputValue(control.value)) {
875
+ return null;
876
+ }
877
+ const controlDate = new Date(control.value);
878
+ return controlDate.getTime() > date.getTime()
879
+ ? { [error]: { date: formattedDate } }
880
+ : null;
881
+ };
882
+ return validator;
883
+ }
884
+ static minDate(date, error = 'minDate') {
885
+ const formattedDate = date.toString() !== 'Invalid Date'
886
+ ? formatDate(date, 'yyyy-MM-dd', 'en-US')
887
+ : null;
888
+ const validator = (control) => {
889
+ if (isEmptyInputValue(control.value)) {
890
+ return null;
891
+ }
892
+ const controlDate = new Date(control.value);
893
+ return controlDate.getTime() < date.getTime()
894
+ ? { [error]: { date: formattedDate } }
895
+ : null;
896
+ };
897
+ return validator;
898
+ }
899
+ }
900
+ function isEmptyInputValue(value) {
901
+ // We don't check for string here so it also works with arrays.
902
+ return value == null || value.length === 0;
903
903
  }
904
904
 
905
- /*
906
- * Public API Surface of bb-foundation
905
+ /*
906
+ * Public API Surface of bb-foundation
907
907
  */
908
908
 
909
- /**
910
- * Generated bundle index. Do not edit.
909
+ /**
910
+ * Generated bundle index. Do not edit.
911
911
  */
912
912
 
913
913
  export { ACCEPT_LANGUAGE, BASE_URL, BbRegex, BbValidator, COOKIE, Clipboard, ClipboardCopy, Exif, FileLoader, ImageConverter, LOCATION, Languages, NAVIGATOR, Network, Patch, Platform, WINDOW, coerceBooleanProperty, mixinDisabled, mixinError, mixinFocused, mixinGrouped, mixinHideErrors, mixinLoad, mixinReadonly, mixinRequired };