monkey-front-core 0.0.96 → 0.0.100

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 (204) hide show
  1. package/README.md +24 -24
  2. package/bundles/monkey-front-core.umd.js +4900 -0
  3. package/bundles/monkey-front-core.umd.js.map +1 -0
  4. package/esm2015/lib/components/closed-to-maintenance/closed-to-maintenance.component.js +35 -0
  5. package/{esm2020/lib/components/closed-to-maintenance/closed-to-maintenance.module.mjs → esm2015/lib/components/closed-to-maintenance/closed-to-maintenance.module.js} +5 -5
  6. package/{esm2020/lib/components/closed-to-maintenance/index.mjs → esm2015/lib/components/closed-to-maintenance/index.js} +1 -1
  7. package/{esm2020/lib/components/index.mjs → esm2015/lib/components/index.js} +0 -0
  8. package/{esm2020/lib/components/progress-bar/index.mjs → esm2015/lib/components/progress-bar/index.js} +1 -1
  9. package/esm2015/lib/components/progress-bar/progress-bar.component.js +29 -0
  10. package/{esm2020/lib/components/progress-bar/progress-bar.module.mjs → esm2015/lib/components/progress-bar/progress-bar.module.js} +5 -5
  11. package/esm2015/lib/components/progress-bar/progress-bar.service.js +53 -0
  12. package/{esm2020/lib/components/version-changed/index.mjs → esm2015/lib/components/version-changed/index.js} +1 -1
  13. package/esm2015/lib/components/version-changed/version-changed.component.js +29 -0
  14. package/{esm2020/lib/components/version-changed/version-changed.module.mjs → esm2015/lib/components/version-changed/version-changed.module.js} +5 -5
  15. package/{esm2020/lib/core/decorators/index.mjs → esm2015/lib/core/decorators/index.js} +1 -1
  16. package/{esm2020/lib/core/decorators/monkeyecx-charts-decorators.mjs → esm2015/lib/core/decorators/monkeyecx-charts-decorators.js} +1 -1
  17. package/esm2015/lib/core/decorators/monkeyecx-decorators.js +112 -0
  18. package/esm2015/lib/core/decorators/monkeyecx-download-decorators.js +25 -0
  19. package/esm2015/lib/core/decorators/monkeyecx-upload-decorators.js +25 -0
  20. package/{esm2020/lib/core/directives/index.mjs → esm2015/lib/core/directives/index.js} +1 -1
  21. package/{esm2020/lib/core/directives/monkeyecx-directives-module.mjs → esm2015/lib/core/directives/monkeyecx-directives-module.js} +5 -5
  22. package/esm2015/lib/core/directives/monkeyecx-drag-drop.js +57 -0
  23. package/esm2015/lib/core/directives/monkeyecx-feature-directive.js +68 -0
  24. package/{esm2020/lib/core/directives/monkeyecx-format-currency.mjs → esm2015/lib/core/directives/monkeyecx-format-currency.js} +4 -4
  25. package/esm2015/lib/core/directives/monkeyecx-format-upper.js +69 -0
  26. package/{esm2020/lib/core/directives/monkeyecx-only-alpha-numeric-directive.mjs → esm2015/lib/core/directives/monkeyecx-only-alpha-numeric-directive.js} +4 -4
  27. package/{esm2020/lib/core/directives/monkeyecx-only-number-directive.mjs → esm2015/lib/core/directives/monkeyecx-only-number-directive.js} +4 -4
  28. package/esm2015/lib/core/directives/monkeyecx-security-directive.js +69 -0
  29. package/esm2015/lib/core/directives/monkeyecx-tooltip-directive.js +124 -0
  30. package/{esm2020/lib/core/index.mjs → esm2015/lib/core/index.js} +1 -1
  31. package/{esm2020/lib/core/interceptors/index.mjs → esm2015/lib/core/interceptors/index.js} +1 -1
  32. package/esm2015/lib/core/interceptors/monkeyecx-http-config-error.interceptor.js +40 -0
  33. package/esm2015/lib/core/interceptors/monkeyecx-http-config-header.interceptor.js +33 -0
  34. package/{esm2020/lib/core/interceptors/monkeyecx-http-config-interceptor.module.mjs → esm2015/lib/core/interceptors/monkeyecx-http-config-interceptor.module.js} +5 -5
  35. package/esm2015/lib/core/interceptors/monkeyecx-http-config-loading-in-progress.interceptor.js +44 -0
  36. package/esm2015/lib/core/interceptors/monkeyecx-http-config-queue.interceptor.js +38 -0
  37. package/{esm2020/lib/core/interfaces/index.mjs → esm2015/lib/core/interfaces/index.js} +1 -1
  38. package/esm2015/lib/core/interfaces/monkeyecx-auth-credentials.js +2 -0
  39. package/{esm2020/lib/core/interfaces/monkeyecx-company.mjs → esm2015/lib/core/interfaces/monkeyecx-company.js} +1 -1
  40. package/esm2015/lib/core/interfaces/monkeyecx-config-boostrap.js +2 -0
  41. package/esm2015/lib/core/interfaces/monkeyecx-config.js +2 -0
  42. package/{esm2020/lib/core/interfaces/monkeyecx-error-response.mjs → esm2015/lib/core/interfaces/monkeyecx-error-response.js} +1 -1
  43. package/{esm2020/lib/core/interfaces/monkeyecx-handled-error-response.mjs → esm2015/lib/core/interfaces/monkeyecx-handled-error-response.js} +1 -1
  44. package/{esm2020/lib/core/interfaces/monkeyecx-header-credentials.mjs → esm2015/lib/core/interfaces/monkeyecx-header-credentials.js} +1 -1
  45. package/{esm2020/lib/core/interfaces/monkeyecx-intercom-options.mjs → esm2015/lib/core/interfaces/monkeyecx-intercom-options.js} +1 -1
  46. package/esm2015/lib/core/interfaces/monkeyecx-me-credentials.js +2 -0
  47. package/esm2015/lib/core/interfaces/monkeyecx-navigation.js +2 -0
  48. package/{esm2020/lib/core/interfaces/monkeyecx-program.mjs → esm2015/lib/core/interfaces/monkeyecx-program.js} +1 -1
  49. package/{esm2020/lib/core/interfaces/monkeyecx-releases.mjs → esm2015/lib/core/interfaces/monkeyecx-releases.js} +1 -1
  50. package/{esm2020/lib/core/interfaces/monkeyecx-request-in-progress.mjs → esm2015/lib/core/interfaces/monkeyecx-request-in-progress.js} +1 -1
  51. package/esm2015/lib/core/interfaces/monkeyecx-request-paged.js +2 -0
  52. package/{esm2020/lib/core/interfaces/monkeyecx-response-links.mjs → esm2015/lib/core/interfaces/monkeyecx-response-links.js} +1 -1
  53. package/{esm2020/lib/core/interfaces/monkeyecx-response-paged.mjs → esm2015/lib/core/interfaces/monkeyecx-response-paged.js} +1 -1
  54. package/{esm2020/lib/core/interfaces/monkeyecx-saved-state.mjs → esm2015/lib/core/interfaces/monkeyecx-saved-state.js} +1 -1
  55. package/{esm2020/lib/core/interfaces/monkeyecx-scroll-options.mjs → esm2015/lib/core/interfaces/monkeyecx-scroll-options.js} +1 -1
  56. package/esm2015/lib/core/interfaces/monkeyecx-service-credentials.js +2 -0
  57. package/{esm2020/lib/core/interfaces/monkeyecx-support-options.mjs → esm2015/lib/core/interfaces/monkeyecx-support-options.js} +1 -1
  58. package/esm2015/lib/core/interfaces/monkeyecx-token-credentials.js +2 -0
  59. package/{esm2020/lib/core/interfaces/monkeyecx-translate-options.mjs → esm2015/lib/core/interfaces/monkeyecx-translate-options.js} +1 -1
  60. package/{esm2020/lib/core/interfaces/request-download/index.mjs → esm2015/lib/core/interfaces/request-download/index.js} +1 -1
  61. package/{esm2020/lib/core/interfaces/request-download/monkeyecx-request-download.mjs → esm2015/lib/core/interfaces/request-download/monkeyecx-request-download.js} +1 -1
  62. package/{esm2020/lib/core/interfaces/request-download/monkeyecx-request-downloaded.mjs → esm2015/lib/core/interfaces/request-download/monkeyecx-request-downloaded.js} +1 -1
  63. package/{esm2020/lib/core/interfaces/request-download/monkeyecx-request-item-download.mjs → esm2015/lib/core/interfaces/request-download/monkeyecx-request-item-download.js} +1 -1
  64. package/{esm2020/lib/core/interfaces/request-queue/index.mjs → esm2015/lib/core/interfaces/request-queue/index.js} +1 -1
  65. package/{esm2020/lib/core/interfaces/request-queue/monkeyecx-request-item-queue.mjs → esm2015/lib/core/interfaces/request-queue/monkeyecx-request-item-queue.js} +1 -1
  66. package/{esm2020/lib/core/interfaces/request-queue/monkeyecx-request-progress-queue.mjs → esm2015/lib/core/interfaces/request-queue/monkeyecx-request-progress-queue.js} +1 -1
  67. package/{esm2020/lib/core/interfaces/request-queue/monkeyecx-request-queue.mjs → esm2015/lib/core/interfaces/request-queue/monkeyecx-request-queue.js} +1 -1
  68. package/{esm2020/lib/core/interfaces/request-upload/index.mjs → esm2015/lib/core/interfaces/request-upload/index.js} +1 -1
  69. package/{esm2020/lib/core/interfaces/request-upload/monkeyecx-request-item-upload.mjs → esm2015/lib/core/interfaces/request-upload/monkeyecx-request-item-upload.js} +1 -1
  70. package/{esm2020/lib/core/interfaces/request-upload/monkeyecx-request-upload.mjs → esm2015/lib/core/interfaces/request-upload/monkeyecx-request-upload.js} +1 -1
  71. package/{esm2020/lib/core/interfaces/schedules/index.mjs → esm2015/lib/core/interfaces/schedules/index.js} +1 -1
  72. package/esm2015/lib/core/interfaces/schedules/monkeyecx-request-schedule.js +2 -0
  73. package/{esm2020/lib/core/model/index.mjs → esm2015/lib/core/model/index.js} +1 -1
  74. package/{esm2020/lib/core/model/monkeyecx-model.mjs → esm2015/lib/core/model/monkeyecx-model.js} +1 -1
  75. package/{esm2020/lib/core/pipes/index.mjs → esm2015/lib/core/pipes/index.js} +0 -0
  76. package/{esm2020/lib/core/pipes/monkeyecx-display-first-name.mjs → esm2015/lib/core/pipes/monkeyecx-display-first-name.js} +4 -4
  77. package/{esm2020/lib/core/pipes/monkeyecx-format-address.mjs → esm2015/lib/core/pipes/monkeyecx-format-address.js} +4 -4
  78. package/{esm2020/lib/core/pipes/monkeyecx-format-currency.mjs → esm2015/lib/core/pipes/monkeyecx-format-currency.js} +4 -4
  79. package/esm2015/lib/core/pipes/monkeyecx-format-date-group.js +46 -0
  80. package/{esm2020/lib/core/pipes/monkeyecx-format-date-timelapse.mjs → esm2015/lib/core/pipes/monkeyecx-format-date-timelapse.js} +4 -4
  81. package/{esm2020/lib/core/pipes/monkeyecx-format-document.mjs → esm2015/lib/core/pipes/monkeyecx-format-document.js} +4 -4
  82. package/{esm2020/lib/core/pipes/monkeyecx-format-number.mjs → esm2015/lib/core/pipes/monkeyecx-format-number.js} +4 -4
  83. package/{esm2020/lib/core/pipes/monkeyecx-format-phone.mjs → esm2015/lib/core/pipes/monkeyecx-format-phone.js} +4 -4
  84. package/{esm2020/lib/core/pipes/monkeyecx-format-size.mjs → esm2015/lib/core/pipes/monkeyecx-format-size.js} +4 -4
  85. package/{esm2020/lib/core/pipes/monkeyecx-format-type-document.mjs → esm2015/lib/core/pipes/monkeyecx-format-type-document.js} +4 -4
  86. package/{esm2020/lib/core/pipes/monkeyecx-format-value.mjs → esm2015/lib/core/pipes/monkeyecx-format-value.js} +4 -4
  87. package/{esm2020/lib/core/pipes/monkeyecx-format-zipcode.mjs → esm2015/lib/core/pipes/monkeyecx-format-zipcode.js} +4 -4
  88. package/{esm2020/lib/core/pipes/monkeyecx-pipes.module.mjs → esm2015/lib/core/pipes/monkeyecx-pipes.module.js} +5 -5
  89. package/{esm2020/lib/core/pipes/monkeyecx-text-truncate.mjs → esm2015/lib/core/pipes/monkeyecx-text-truncate.js} +4 -4
  90. package/{esm2020/lib/core/pipes/monkeyecx-truncate-qtd.mjs → esm2015/lib/core/pipes/monkeyecx-truncate-qtd.js} +4 -4
  91. package/{esm2020/lib/core/services/auth/index.mjs → esm2015/lib/core/services/auth/index.js} +1 -1
  92. package/{esm2020/lib/core/services/auth/monkeyecx-auth-guard-login.service.mjs → esm2015/lib/core/services/auth/monkeyecx-auth-guard-login.service.js} +4 -4
  93. package/{esm2020/lib/core/services/auth/monkeyecx-auth-guard.service.mjs → esm2015/lib/core/services/auth/monkeyecx-auth-guard.service.js} +4 -4
  94. package/esm2015/lib/core/services/auth/monkeyecx-authentication.service.js +61 -0
  95. package/{esm2020/lib/core/services/commons/index.mjs → esm2015/lib/core/services/commons/index.js} +1 -1
  96. package/esm2015/lib/core/services/commons/monkeyecx-commons.service.js +265 -0
  97. package/{esm2020/lib/core/services/config/monkeyecx-config.module.mjs → esm2015/lib/core/services/config/monkeyecx-config.module.js} +5 -5
  98. package/{esm2020/lib/core/services/config/monkeyecx-config.service.mjs → esm2015/lib/core/services/config/monkeyecx-config.service.js} +9 -11
  99. package/esm2015/lib/core/services/config/monkeyecx-error-config.service.js +85 -0
  100. package/esm2015/lib/core/services/config/monkeyecx-feature-toggle.service.js +70 -0
  101. package/esm2015/lib/core/services/config/monkeyecx-i18n-config.service.js +72 -0
  102. package/esm2015/lib/core/services/config/monkeyecx-logs-config.service.js +34 -0
  103. package/{esm2020/lib/core/services/config/monkeyecx-maintenance-config.service.mjs → esm2015/lib/core/services/config/monkeyecx-maintenance-config.service.js} +4 -4
  104. package/esm2015/lib/core/services/config/monkeyecx-security-console-config.service.js +42 -0
  105. package/esm2015/lib/core/services/config/monkeyecx-service-worker-config.service.js +54 -0
  106. package/{esm2020/lib/core/services/error/index.mjs → esm2015/lib/core/services/error/index.js} +1 -1
  107. package/{esm2020/lib/core/services/error/monkeyecx-error-handling.module.mjs → esm2015/lib/core/services/error/monkeyecx-error-handling.module.js} +5 -5
  108. package/esm2015/lib/core/services/error/monkeyecx-error-handling.service.js +41 -0
  109. package/esm2015/lib/core/services/error/monkeyecx-http-error-handling.service.js +132 -0
  110. package/{esm2020/lib/core/services/error/monkeyecx-others-errors-handling.service.mjs → esm2015/lib/core/services/error/monkeyecx-others-errors-handling.service.js} +4 -4
  111. package/{esm2020/lib/core/services/index.mjs → esm2015/lib/core/services/index.js} +1 -1
  112. package/{esm2020/lib/core/services/logged/index.mjs → esm2015/lib/core/services/logged/index.js} +1 -1
  113. package/{esm2020/lib/core/services/logged/monkeyecx-logged-handling.service.mjs → esm2015/lib/core/services/logged/monkeyecx-logged-handling.service.js} +4 -4
  114. package/esm2015/lib/core/services/monkeyecx-handling.service.js +50 -0
  115. package/esm2015/lib/core/services/monkeyecx-service.service.js +102 -0
  116. package/{esm2020/lib/core/services/request-download/index.mjs → esm2015/lib/core/services/request-download/index.js} +1 -1
  117. package/esm2015/lib/core/services/request-download/monkeyecx-request-download-handling.service.js +81 -0
  118. package/esm2015/lib/core/services/request-download/monkeyecx-request-downloaded-handling.service.js +55 -0
  119. package/{esm2020/lib/core/services/request-paged/index.mjs → esm2015/lib/core/services/request-paged/index.js} +1 -1
  120. package/esm2015/lib/core/services/request-paged/monkeyecx-request-request-paged-handling.js +37 -0
  121. package/{esm2020/lib/core/services/request-queue/index.mjs → esm2015/lib/core/services/request-queue/index.js} +1 -1
  122. package/esm2015/lib/core/services/request-queue/monkeyecx-request-queue-handling.service.js +101 -0
  123. package/esm2015/lib/core/services/request-queue/monkeyecx-request-queue-modal-handling.service.js +106 -0
  124. package/{esm2020/lib/core/services/routes/index.mjs → esm2015/lib/core/services/routes/index.js} +1 -1
  125. package/esm2015/lib/core/services/routes/monkeyecx-dicovery-params.service.js +55 -0
  126. package/{esm2020/lib/core/services/schedules/index.mjs → esm2015/lib/core/services/schedules/index.js} +1 -1
  127. package/esm2015/lib/core/services/schedules/monkeyecx-request-schedule.service.js +99 -0
  128. package/{esm2020/lib/core/services/storage/index.mjs → esm2015/lib/core/services/storage/index.js} +1 -1
  129. package/{esm2020/lib/core/services/storage/monkeyecx-cookie-storage.service.mjs → esm2015/lib/core/services/storage/monkeyecx-cookie-storage.service.js} +4 -4
  130. package/esm2015/lib/core/services/storage/monkeyecx-token-storage.service.js +123 -0
  131. package/{esm2020/lib/core/specification-search/index.mjs → esm2015/lib/core/specification-search/index.js} +1 -1
  132. package/{esm2020/lib/core/specification-search/monkeyecx-specification-search.mjs → esm2015/lib/core/specification-search/monkeyecx-specification-search.js} +3 -2
  133. package/esm2015/lib/core/utils/decorators-utils.js +37 -0
  134. package/{esm2020/lib/core/utils/index.mjs → esm2015/lib/core/utils/index.js} +1 -1
  135. package/{esm2020/lib/core/utils/statics.mjs → esm2015/lib/core/utils/statics.js} +1 -1
  136. package/esm2015/lib/core/utils/utils.js +219 -0
  137. package/esm2015/lib/core/utils/validate-utils.js +210 -0
  138. package/esm2015/lib/core/utils/validators.js +211 -0
  139. package/{esm2020/lib/monkey-front-core.module.mjs → esm2015/lib/monkey-front-core.module.js} +5 -5
  140. package/{esm2020/monkey-front-core.mjs → esm2015/monkey-front-core.js} +0 -0
  141. package/{esm2020/public-api.mjs → esm2015/public-api.js} +1 -1
  142. package/fesm2015/{monkey-front-core.mjs → monkey-front-core.js} +229 -218
  143. package/fesm2015/monkey-front-core.js.map +1 -0
  144. package/lib/core/pipes/monkeyecx-format-currency.d.ts +1 -1
  145. package/lib/core/services/auth/monkeyecx-authentication.service.d.ts +3 -3
  146. package/lib/core/services/commons/monkeyecx-commons.service.d.ts +15 -15
  147. package/lib/core/services/schedules/monkeyecx-request-schedule.service.d.ts +1 -1
  148. package/lib/core/utils/validate-utils.d.ts +13 -13
  149. package/monkey-front-core-0.0.100.tgz +0 -0
  150. package/package.json +7 -20
  151. package/esm2020/lib/components/closed-to-maintenance/closed-to-maintenance.component.mjs +0 -29
  152. package/esm2020/lib/components/progress-bar/progress-bar.component.mjs +0 -23
  153. package/esm2020/lib/components/progress-bar/progress-bar.service.mjs +0 -50
  154. package/esm2020/lib/components/version-changed/version-changed.component.mjs +0 -24
  155. package/esm2020/lib/core/decorators/monkeyecx-decorators.mjs +0 -111
  156. package/esm2020/lib/core/decorators/monkeyecx-download-decorators.mjs +0 -26
  157. package/esm2020/lib/core/decorators/monkeyecx-upload-decorators.mjs +0 -26
  158. package/esm2020/lib/core/directives/monkeyecx-drag-drop.mjs +0 -57
  159. package/esm2020/lib/core/directives/monkeyecx-feature-directive.mjs +0 -68
  160. package/esm2020/lib/core/directives/monkeyecx-format-upper.mjs +0 -67
  161. package/esm2020/lib/core/directives/monkeyecx-security-directive.mjs +0 -69
  162. package/esm2020/lib/core/directives/monkeyecx-tooltip-directive.mjs +0 -123
  163. package/esm2020/lib/core/interceptors/monkeyecx-http-config-error.interceptor.mjs +0 -39
  164. package/esm2020/lib/core/interceptors/monkeyecx-http-config-header.interceptor.mjs +0 -32
  165. package/esm2020/lib/core/interceptors/monkeyecx-http-config-loading-in-progress.interceptor.mjs +0 -43
  166. package/esm2020/lib/core/interceptors/monkeyecx-http-config-queue.interceptor.mjs +0 -37
  167. package/esm2020/lib/core/interfaces/monkeyecx-auth-credentials.mjs +0 -2
  168. package/esm2020/lib/core/interfaces/monkeyecx-config-boostrap.mjs +0 -2
  169. package/esm2020/lib/core/interfaces/monkeyecx-config.mjs +0 -2
  170. package/esm2020/lib/core/interfaces/monkeyecx-me-credentials.mjs +0 -2
  171. package/esm2020/lib/core/interfaces/monkeyecx-navigation.mjs +0 -2
  172. package/esm2020/lib/core/interfaces/monkeyecx-request-paged.mjs +0 -2
  173. package/esm2020/lib/core/interfaces/monkeyecx-service-credentials.mjs +0 -2
  174. package/esm2020/lib/core/interfaces/monkeyecx-token-credentials.mjs +0 -2
  175. package/esm2020/lib/core/interfaces/schedules/monkeyecx-request-schedule.mjs +0 -2
  176. package/esm2020/lib/core/pipes/monkeyecx-format-date-group.mjs +0 -45
  177. package/esm2020/lib/core/services/auth/monkeyecx-authentication.service.mjs +0 -61
  178. package/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +0 -280
  179. package/esm2020/lib/core/services/config/monkeyecx-error-config.service.mjs +0 -85
  180. package/esm2020/lib/core/services/config/monkeyecx-feature-toggle.service.mjs +0 -67
  181. package/esm2020/lib/core/services/config/monkeyecx-i18n-config.service.mjs +0 -74
  182. package/esm2020/lib/core/services/config/monkeyecx-logs-config.service.mjs +0 -34
  183. package/esm2020/lib/core/services/config/monkeyecx-security-console-config.service.mjs +0 -42
  184. package/esm2020/lib/core/services/config/monkeyecx-service-worker-config.service.mjs +0 -53
  185. package/esm2020/lib/core/services/error/monkeyecx-error-handling.service.mjs +0 -41
  186. package/esm2020/lib/core/services/error/monkeyecx-http-error-handling.service.mjs +0 -127
  187. package/esm2020/lib/core/services/monkeyecx-handling.service.mjs +0 -50
  188. package/esm2020/lib/core/services/monkeyecx-service.service.mjs +0 -104
  189. package/esm2020/lib/core/services/request-download/monkeyecx-request-download-handling.service.mjs +0 -93
  190. package/esm2020/lib/core/services/request-download/monkeyecx-request-downloaded-handling.service.mjs +0 -61
  191. package/esm2020/lib/core/services/request-paged/monkeyecx-request-request-paged-handling.mjs +0 -37
  192. package/esm2020/lib/core/services/request-queue/monkeyecx-request-queue-handling.service.mjs +0 -114
  193. package/esm2020/lib/core/services/request-queue/monkeyecx-request-queue-modal-handling.service.mjs +0 -119
  194. package/esm2020/lib/core/services/routes/monkeyecx-dicovery-params.service.mjs +0 -54
  195. package/esm2020/lib/core/services/schedules/monkeyecx-request-schedule.service.mjs +0 -113
  196. package/esm2020/lib/core/services/storage/monkeyecx-token-storage.service.mjs +0 -126
  197. package/esm2020/lib/core/utils/decorators-utils.mjs +0 -40
  198. package/esm2020/lib/core/utils/utils.mjs +0 -218
  199. package/esm2020/lib/core/utils/validate-utils.mjs +0 -206
  200. package/esm2020/lib/core/utils/validators.mjs +0 -208
  201. package/fesm2015/monkey-front-core.mjs.map +0 -1
  202. package/fesm2020/monkey-front-core.mjs +0 -4265
  203. package/fesm2020/monkey-front-core.mjs.map +0 -1
  204. package/monkey-front-core-0.0.96.tgz +0 -0
@@ -1,4265 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Pipe, Component, ViewEncapsulation, Input, Injectable, NgModule, EventEmitter, Directive, Output, HostBinding, HostListener, forwardRef, Self, NgZone, ErrorHandler, Optional, SkipSelf } from '@angular/core';
3
- import * as i1 from 'monkey-style-guide';
4
- import { MonkeyButtonModule, MonkeyIconModule, MonkeyInputModule, MonkeyModalModule, MonkeyUtils, MonkeyStyleGuideModule, MonkeyStyleGuideModalService, MonkeyStyleGuideSettingsService, MonkeyStyleGuideSnackbarService } from 'monkey-style-guide';
5
- import * as i2 from '@angular/common';
6
- import { formatNumber, CurrencyPipe, CommonModule } from '@angular/common';
7
- import * as i1$1 from '@ngx-translate/core';
8
- import { TranslateService, TranslateModule } from '@ngx-translate/core';
9
- import * as moment_ from 'moment';
10
- import * as i1$2 from 'ngx-cookie-service';
11
- import * as i1$3 from '@angular/router';
12
- import { NavigationStart, NavigationEnd, NavigationError, NavigationCancel } from '@angular/router';
13
- import { BehaviorSubject, throwError, interval, concat, of, Subject } from 'rxjs';
14
- import { filter, take, takeWhile, map, catchError, first, takeUntil, mergeMap, finalize } from 'rxjs/operators';
15
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
16
- import { __decorate } from 'tslib';
17
- import * as i1$4 from '@angular/common/http';
18
- import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
19
- import { datadogRum } from '@datadog/browser-rum';
20
- import * as i1$5 from '@angular/service-worker';
21
- import { ServiceWorkerModule } from '@angular/service-worker';
22
- import { initialize } from 'launchdarkly-js-client-sdk';
23
-
24
- /* eslint-disable comma-dangle */
25
- /* eslint-disable max-len */
26
- /* eslint-disable no-useless-escape */
27
- /* eslint-disable no-plusplus */
28
- /* eslint-disable no-cond-assign */
29
- /* eslint-disable eqeqeq */
30
- /* eslint-disable no-redeclare */
31
- /* eslint-disable vars-on-top */
32
- /* eslint-disable no-var */
33
- /* eslint-disable block-scoped-var */
34
- class MonkeyEcxUtils {
35
- static persistNullEmptyUndefined(tp) {
36
- return tp !== null && tp !== undefined && tp !== '';
37
- }
38
- static getDocumentType(doc, country) {
39
- if (!doc)
40
- return '';
41
- if (country === 'cl')
42
- return 'RUT';
43
- return doc.length <= 11 ? 'CPF' : 'CNPJ';
44
- }
45
- static getDocumentMask(type) {
46
- if (type === 'CPF')
47
- return '000.000.000-00';
48
- return '00.000.000/0000-00';
49
- }
50
- static formatDocumentWithMask(doc, withType, country) {
51
- if (!doc)
52
- return doc;
53
- let formated = '';
54
- if (country === 'cl') {
55
- formated = doc.replace(/^(\d{1,2})(\d{3})(\d{3})(\w{1})$/, '$1.$2.$3-$4');
56
- return `${formated}`;
57
- }
58
- if (doc.length === 14) {
59
- formated = doc
60
- .replace(/^(\d{2})(\d)/, '$1.$2')
61
- .replace(/^(\d{2})\.(\d{3})(\d)/, '$1.$2.$3')
62
- .replace(/\.(\d{3})(\d)/, '.$1/$2')
63
- .replace(/(\d{4})(\d)/, '$1-$2');
64
- }
65
- else {
66
- formated = doc
67
- .replace(/^(\d{3})(\d)/, '$1.$2')
68
- .replace(/^(\d{3})\.(\d{3})(\d)/, '$1.$2.$3')
69
- .replace(/\.(\d{3})(\d)/, '.$1-$2');
70
- }
71
- return `${withType ? `${this.getDocumentType(doc)}:` : ''} ${formated}`;
72
- }
73
- static cutFirstLastName(value, tp = 'first') {
74
- const split = value?.trim()?.split(' ');
75
- if (tp === 'first')
76
- return split[0];
77
- return split?.splice(1, split.length)?.join(' ');
78
- }
79
- static isCPFCNPJValid(document) {
80
- document = document.replace(/[^\d]/g, '');
81
- if (document.length === 11) {
82
- let base = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
83
- for (var i = 0, n = 0; i < 9; n += document[i] * base[i++])
84
- ;
85
- if (document[9] != ((n %= 11) <= 1 ? 0 : 11 - n)) {
86
- return false;
87
- }
88
- base = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
89
- for (var i = 0, n = 0; i <= 9; n += document[i] * base[i++])
90
- ;
91
- if (document[10] != ((n %= 11) <= 1 ? 0 : 11 - n)) {
92
- return false;
93
- }
94
- return true;
95
- }
96
- if (document.length === 14 || /0{14}/.test(document)) {
97
- const base = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
98
- for (var i = 0, n = 0; i < 12; n += document[i] * base[++i])
99
- ;
100
- if (document[12] != ((n %= 11) < 2 ? 0 : 11 - n)) {
101
- return false;
102
- }
103
- for (var i = 0, n = 0; i <= 12; n += document[i] * base[i++])
104
- ;
105
- if (document[13] != ((n %= 11) < 2 ? 0 : 11 - n)) {
106
- return false;
107
- }
108
- return true;
109
- }
110
- return false;
111
- }
112
- static isValidRUT(document) {
113
- if (!document || document.trim().length < 3)
114
- return false;
115
- const documentHandled = document.replace(/[^0-9kK]/g, '');
116
- if (documentHandled.length < 3)
117
- return false;
118
- const calcDv = (rut) => {
119
- const value = `${rut}`;
120
- let sum = 0;
121
- let mult = 2;
122
- for (let i = 1; i <= value.length; i++) {
123
- const index = mult * Number(value.charAt(value.length - i));
124
- sum += index;
125
- if (mult < 7) {
126
- mult += 1;
127
- }
128
- else {
129
- mult = 2;
130
- }
131
- }
132
- const dvEsperado = 11 - (sum % 11);
133
- if (dvEsperado === 10)
134
- return 'K';
135
- if (dvEsperado === 11)
136
- return '0';
137
- return `${dvEsperado}`;
138
- };
139
- const num = documentHandled.slice(0, -1);
140
- const dgv = documentHandled.slice(-1).toUpperCase();
141
- const dvCalc = calcDv(num);
142
- return dvCalc === dgv;
143
- }
144
- static isValidUrl(txt) {
145
- const regex = new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)+[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,10}(:[0-9]{1,5})?(\/.*)?$/gm);
146
- return regex.test(txt);
147
- }
148
- static isValidZipCode(zipCode) {
149
- return `${this.handleOnlyNumbers(zipCode)}`.length === 8;
150
- }
151
- static getRandomString(len, charSet) {
152
- charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
153
- const randomString = new Array(len)
154
- .fill('1')
155
- .map(() => {
156
- return charSet?.charAt(Math.floor(Math.random() * charSet?.length));
157
- })
158
- .join('');
159
- return randomString;
160
- }
161
- static handleOnlyNumbers(value) {
162
- if (!value)
163
- return null;
164
- return value.replace(new RegExp(/[^0-9]/g), '');
165
- }
166
- static handleOnlyAlphaNumeric(value) {
167
- if (!value)
168
- return '';
169
- return value.replace(new RegExp(/[^0-9A-Za-z]/, 'g'), '');
170
- }
171
- static capitalize(value) {
172
- return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
173
- }
174
- static formatZipCode(zipCode) {
175
- if (!zipCode)
176
- return zipCode;
177
- const formated = zipCode
178
- .replace(/^(\d{5})(\d)/, '$1-$2')
179
- .replace(/\.(\d{3})(\d)/, '.$1-$2');
180
- return `${formated}`;
181
- }
182
- static formatFileSize(size) {
183
- const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
184
- let l = 0;
185
- while (size >= 1024 && ++l) {
186
- size /= 1024;
187
- }
188
- return `${size.toFixed(size < 10 && l > 0 ? 1 : 0)} ${units[l]}`;
189
- }
190
- static sufflue(data) {
191
- for (let i = data.length - 1; i > 0; i--) {
192
- const j = Math.floor(Math.random() * i);
193
- const temp = data[i];
194
- data[i] = data[j];
195
- data[j] = temp;
196
- }
197
- return data;
198
- }
199
- static handleBlobFile(theBlob, fileName, fileType) {
200
- function blobToFile(theBlob, fileName) {
201
- const b = theBlob;
202
- b.lastModifiedDate = new Date();
203
- b.name = fileName;
204
- return b;
205
- }
206
- let file;
207
- if (!navigator.msSaveBlob) {
208
- file = new File([theBlob], fileName, {
209
- type: fileType,
210
- });
211
- }
212
- else {
213
- file = new Blob([theBlob], {
214
- type: fileType,
215
- });
216
- file = blobToFile(file, fileName);
217
- }
218
- return file;
219
- }
220
- static truncate(text, maxLength = 25) {
221
- const midChar = '...';
222
- if (!text)
223
- return midChar;
224
- if (text && text.length <= maxLength)
225
- return text;
226
- const left = Math.ceil(maxLength / 2);
227
- const right = text.length - left + 1;
228
- return `${text.substr(0, left)} ${midChar} ${text.substring(right)}`;
229
- }
230
- static isLocalhost() {
231
- const { href } = window?.location;
232
- if (!href)
233
- return false;
234
- return href?.search('localhost') >= 0;
235
- }
236
- static isSameOrigin(frontend) {
237
- const initialPath = window.location.origin;
238
- return (initialPath || '') === frontend;
239
- }
240
- }
241
-
242
- const moment$3 = moment_;
243
- class MonkeyEcxFormatDateTimelapsePipe {
244
- transform(date, showTime = false, useUtc = true, format = '- HH:mm') {
245
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
246
- return '';
247
- let stillUtc = moment$3.default.utc(date).toDate();
248
- if (!useUtc)
249
- stillUtc = moment$3.default(date).toDate();
250
- if (date.toString().indexOf(':') <= -1) {
251
- if (typeof date === 'string') {
252
- stillUtc = date;
253
- showTime = false;
254
- }
255
- }
256
- const formatFrom = `YYYY/MM/DD${showTime ? ` ${format}` : ''}`;
257
- const formatTo = `DD/MM/YYYY${showTime ? ` ${format}` : ''}`;
258
- return `${moment$3.default(stillUtc, formatFrom).format(formatTo)}`;
259
- }
260
- }
261
- MonkeyEcxFormatDateTimelapsePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateTimelapsePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
262
- MonkeyEcxFormatDateTimelapsePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateTimelapsePipe, name: "monkeyecxFormatDateTimelapse" });
263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateTimelapsePipe, decorators: [{
264
- type: Pipe,
265
- args: [{
266
- name: 'monkeyecxFormatDateTimelapse',
267
- }]
268
- }] });
269
-
270
- class ClosedToMaintenanceComponent {
271
- constructor() {
272
- this.config = null;
273
- this._configBoostrap = null;
274
- }
275
- ngOnInit() {
276
- this._configBoostrap = this.config?.data;
277
- }
278
- onClose() {
279
- document.location.reload();
280
- }
281
- }
282
- ClosedToMaintenanceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
283
- ClosedToMaintenanceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: ClosedToMaintenanceComponent, selector: "monkeyecx-closed-to-maintenance", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-1' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-2' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-3' | translate }}\n {{ _configBoostrap?.maintenance?.endDate | monkeyecxFormatDateTimelapse: true }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-4' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.BUTTONS.UPDATE-MAINTENANCE' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-closed-to-maintenance .body{padding:24px;width:100%}monkeyecx-closed-to-maintenance .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53}monkeyecx-closed-to-maintenance .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-closed-to-maintenance .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-closed-to-maintenance .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-closed-to-maintenance monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"], components: [{ type: i1.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe, "monkeyecxFormatDateTimelapse": MonkeyEcxFormatDateTimelapsePipe }, encapsulation: i0.ViewEncapsulation.None });
284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceComponent, decorators: [{
285
- type: Component,
286
- args: [{ selector: 'monkeyecx-closed-to-maintenance', encapsulation: ViewEncapsulation.None, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-1' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-2' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-3' | translate }}\n {{ _configBoostrap?.maintenance?.endDate | monkeyecxFormatDateTimelapse: true }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-4' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.BUTTONS.UPDATE-MAINTENANCE' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-closed-to-maintenance .body{padding:24px;width:100%}monkeyecx-closed-to-maintenance .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53}monkeyecx-closed-to-maintenance .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-closed-to-maintenance .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-closed-to-maintenance .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-closed-to-maintenance monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"] }]
287
- }], propDecorators: { config: [{
288
- type: Input
289
- }], modalRef: [{
290
- type: Input
291
- }] } });
292
-
293
- class MonkeyEcxDisplayFirstNamePipe {
294
- transform(name) {
295
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(name))
296
- return '';
297
- return MonkeyEcxUtils.cutFirstLastName(name);
298
- }
299
- }
300
- MonkeyEcxDisplayFirstNamePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDisplayFirstNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
301
- MonkeyEcxDisplayFirstNamePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDisplayFirstNamePipe, name: "monkeyecxDisplayFirstName" });
302
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDisplayFirstNamePipe, decorators: [{
303
- type: Pipe,
304
- args: [{
305
- name: 'monkeyecxDisplayFirstName'
306
- }]
307
- }] });
308
-
309
- class MonkeyEcxFormatAddressPipe {
310
- transform({ zipCode, address, neighborhood, city, state, }) {
311
- return [address, neighborhood, zipCode, city, state]
312
- .filter((_) => {
313
- return _;
314
- })
315
- .join(', ');
316
- }
317
- }
318
- MonkeyEcxFormatAddressPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatAddressPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
319
- MonkeyEcxFormatAddressPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatAddressPipe, name: "monkeyecxFormatAddress" });
320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatAddressPipe, decorators: [{
321
- type: Pipe,
322
- args: [{
323
- name: 'monkeyecxFormatAddress',
324
- }]
325
- }] });
326
-
327
- /* eslint-disable object-curly-newline */
328
- class MonkeyEcxCookieStorageService {
329
- constructor(cookieService) {
330
- this.cookieService = cookieService;
331
- // not to do
332
- }
333
- setCookie(name, value) {
334
- this.removeCookie(name);
335
- this.cookieService.set(name, value, undefined, '/', '', true, 'None');
336
- }
337
- getCookie(name) {
338
- return this.cookieService.get(name);
339
- }
340
- removeCookie(name) {
341
- this.cookieService.delete(name, '/');
342
- }
343
- }
344
- MonkeyEcxCookieStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxCookieStorageService, deps: [{ token: i1$2.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
345
- MonkeyEcxCookieStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxCookieStorageService, providedIn: 'root' });
346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxCookieStorageService, decorators: [{
347
- type: Injectable,
348
- args: [{
349
- providedIn: 'root'
350
- }]
351
- }], ctorParameters: function () { return [{ type: i1$2.CookieService }]; } });
352
-
353
- class MonkeyEcxFormatCurrencyPipe {
354
- constructor(injector, currencyPipe) {
355
- this.injector = injector;
356
- this.currencyPipe = currencyPipe;
357
- // not to do
358
- }
359
- transform(value) {
360
- const cookieStorageService = this.injector.get(MonkeyEcxCookieStorageService);
361
- const cookie = cookieStorageService.getCookie('monkey-app-locale');
362
- const i18n = JSON.parse(atob(cookie));
363
- const { currency } = i18n;
364
- return this.currencyPipe.transform(value, currency, 'symbol');
365
- }
366
- }
367
- MonkeyEcxFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, deps: [{ token: i0.Injector }, { token: i2.CurrencyPipe }], target: i0.ɵɵFactoryTarget.Pipe });
368
- MonkeyEcxFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, name: "monkeyecxFormatCurrency" });
369
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrencyPipe, decorators: [{
370
- type: Pipe,
371
- args: [{
372
- name: 'monkeyecxFormatCurrency'
373
- }]
374
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i2.CurrencyPipe }]; } });
375
-
376
- class MonkeyEcxFormatDocumentPipe {
377
- transform(document, withType) {
378
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(document))
379
- return '';
380
- return MonkeyEcxUtils.formatDocumentWithMask(document, withType);
381
- }
382
- }
383
- MonkeyEcxFormatDocumentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
384
- MonkeyEcxFormatDocumentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentPipe, name: "monkeyecxFormatDocument" });
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentPipe, decorators: [{
386
- type: Pipe,
387
- args: [{
388
- name: 'monkeyecxFormatDocument'
389
- }]
390
- }] });
391
-
392
- class MonkeyEcxFormatNumberPipe {
393
- transform(number) {
394
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(number))
395
- return '';
396
- return formatNumber(Number(number), 'ptbr');
397
- }
398
- }
399
- MonkeyEcxFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
400
- MonkeyEcxFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatNumberPipe, name: "monkeyecxFormatNumber" });
401
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatNumberPipe, decorators: [{
402
- type: Pipe,
403
- args: [{
404
- name: 'monkeyecxFormatNumber'
405
- }]
406
- }] });
407
-
408
- class MonkeyEcxFormatPhonePipe {
409
- transform(phone) {
410
- if (phone) {
411
- const value = `${phone || ''}`.replace(/\D/g, '');
412
- let formated = '';
413
- if (value.length > 12) {
414
- formated = value.replace(/(\d{2})?(\d{2})?(\d{5})?(\d{4})/, '+$1 ($2) $3-$4');
415
- }
416
- else if (value.length > 11) {
417
- formated = value.replace(/(\d{2})?(\d{2})?(\d{4})?(\d{4})/, '+$1 ($2) $3-$4');
418
- }
419
- else if (value.length > 10) {
420
- formated = value.replace(/(\d{2})?(\d{5})?(\d{4})/, '($1) $2-$3');
421
- }
422
- else if (value.length > 9) {
423
- formated = value.replace(/(\d{2})?(\d{4})?(\d{4})/, '($1) $2-$3');
424
- }
425
- else if (value.length > 5) {
426
- formated = value.replace(/^(\d{2})?(\d{4})?(\d{0,4})/, '($1) $2-$3');
427
- }
428
- else if (value.length > 1) {
429
- formated = value.replace(/^(\d{2})?(\d{0,5})/, '($1) $2');
430
- }
431
- else if (phone !== '') {
432
- formated = value.replace(/^(\d*)/, '($1');
433
- }
434
- return formated;
435
- }
436
- return '';
437
- }
438
- }
439
- MonkeyEcxFormatPhonePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatPhonePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
440
- MonkeyEcxFormatPhonePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatPhonePipe, name: "monkeyecxFormatPhone" });
441
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatPhonePipe, decorators: [{
442
- type: Pipe,
443
- args: [{
444
- name: 'monkeyecxFormatPhone'
445
- }]
446
- }] });
447
-
448
- class MonkeyEcxFormatSizePipe {
449
- transform(size) {
450
- if (!size)
451
- return '0 B';
452
- const sizeNum = Number(size);
453
- return MonkeyEcxUtils.formatFileSize(sizeNum);
454
- }
455
- }
456
- MonkeyEcxFormatSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
457
- MonkeyEcxFormatSizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatSizePipe, name: "monkeyecxFormatSize" });
458
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatSizePipe, decorators: [{
459
- type: Pipe,
460
- args: [{
461
- name: 'monkeyecxFormatSize'
462
- }]
463
- }] });
464
-
465
- class MonkeyEcxFormatDocumentTypePipe {
466
- transform(document) {
467
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(document))
468
- return '';
469
- return MonkeyEcxUtils.getDocumentType(document);
470
- }
471
- }
472
- MonkeyEcxFormatDocumentTypePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentTypePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
473
- MonkeyEcxFormatDocumentTypePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentTypePipe, name: "monkeyecxFormatDocumentType" });
474
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDocumentTypePipe, decorators: [{
475
- type: Pipe,
476
- args: [{
477
- name: 'monkeyecxFormatDocumentType'
478
- }]
479
- }] });
480
-
481
- class MonkeyEcxFormatValue {
482
- transform(number) {
483
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(number))
484
- return '';
485
- return number;
486
- }
487
- }
488
- MonkeyEcxFormatValue.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatValue, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
489
- MonkeyEcxFormatValue.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatValue, name: "monkeyecxFormatValue" });
490
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatValue, decorators: [{
491
- type: Pipe,
492
- args: [{
493
- name: 'monkeyecxFormatValue'
494
- }]
495
- }] });
496
-
497
- class MonkeyEcxFormatZipCodePipe {
498
- transform(zipCode) {
499
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(zipCode))
500
- return '';
501
- return MonkeyEcxUtils.formatZipCode(zipCode);
502
- }
503
- }
504
- MonkeyEcxFormatZipCodePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatZipCodePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
505
- MonkeyEcxFormatZipCodePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatZipCodePipe, name: "monkeyecxFormatZipCode" });
506
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatZipCodePipe, decorators: [{
507
- type: Pipe,
508
- args: [{
509
- name: 'monkeyecxFormatZipCode'
510
- }]
511
- }] });
512
-
513
- class MonkeyEcxTextTruncatePipe {
514
- transform(text, maxLength = 25) {
515
- const midChar = '...';
516
- if (!text)
517
- return midChar;
518
- if (text && text.length <= maxLength)
519
- return text;
520
- const left = Math.ceil(maxLength / 2);
521
- const right = text.length - left + 1;
522
- return `${text.substr(0, left)} ${midChar} ${text.substring(right)}`;
523
- }
524
- }
525
- MonkeyEcxTextTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTextTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
526
- MonkeyEcxTextTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTextTruncatePipe, name: "monkeyecxTextTruncate" });
527
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTextTruncatePipe, decorators: [{
528
- type: Pipe,
529
- args: [{
530
- name: 'monkeyecxTextTruncate'
531
- }]
532
- }] });
533
-
534
- class MonkeyEcxTruncateQtdPipe {
535
- transform(number, threshold) {
536
- return `${number > threshold ? `${threshold}+` : number}`;
537
- }
538
- }
539
- MonkeyEcxTruncateQtdPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTruncateQtdPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
540
- MonkeyEcxTruncateQtdPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTruncateQtdPipe, name: "monkeyecxTruncateQtd" });
541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTruncateQtdPipe, decorators: [{
542
- type: Pipe,
543
- args: [{
544
- name: 'monkeyecxTruncateQtd'
545
- }]
546
- }] });
547
-
548
- const moment$2 = moment_;
549
- class MonkeyEcxFormatDateGroupPipe {
550
- constructor(injector) {
551
- this.injector = injector;
552
- this.lang = 'pt-BR';
553
- const translateService = this.injector.get(TranslateService);
554
- this.lang = translateService.getDefaultLang();
555
- }
556
- format(date) {
557
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
558
- return '';
559
- let stillUtc = moment$2.default.utc(date).toDate();
560
- if (date.toString()?.indexOf(':') <= -1) {
561
- stillUtc = date;
562
- }
563
- const formatFrom = 'YYYY/MM/DD';
564
- const fmt = moment$2.default(stillUtc, formatFrom).locale(this.lang);
565
- const dayFormated = fmt.format('DD/');
566
- const monthFormated = MonkeyEcxUtils.capitalize(fmt.format('MMMM'));
567
- const yearFormated = fmt.format('YYYY');
568
- return `${`${dayFormated}${monthFormated}`.substring(0, 6)}, ${yearFormated}`;
569
- }
570
- transform(obj) {
571
- if (!obj || !obj?.start || !obj?.end)
572
- return '';
573
- const { start, end } = obj;
574
- const formatedStart = this.format(start);
575
- const formatedEnd = this.format(end);
576
- return `${formatedStart} - ${formatedEnd}`;
577
- }
578
- }
579
- MonkeyEcxFormatDateGroupPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateGroupPipe, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Pipe });
580
- MonkeyEcxFormatDateGroupPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateGroupPipe, name: "monkeyecxFormatDateGroup" });
581
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatDateGroupPipe, decorators: [{
582
- type: Pipe,
583
- args: [{
584
- name: 'monkeyecxFormatDateGroup',
585
- }]
586
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
587
-
588
- class MonkeyEcxPipesModule {
589
- }
590
- MonkeyEcxPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
591
- MonkeyEcxPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, declarations: [MonkeyEcxDisplayFirstNamePipe,
592
- MonkeyEcxFormatAddressPipe,
593
- MonkeyEcxFormatCurrencyPipe,
594
- MonkeyEcxFormatDateTimelapsePipe,
595
- MonkeyEcxFormatDateGroupPipe,
596
- MonkeyEcxFormatDocumentPipe,
597
- MonkeyEcxFormatNumberPipe,
598
- MonkeyEcxFormatPhonePipe,
599
- MonkeyEcxFormatSizePipe,
600
- MonkeyEcxFormatDocumentTypePipe,
601
- MonkeyEcxFormatValue,
602
- MonkeyEcxFormatZipCodePipe,
603
- MonkeyEcxTextTruncatePipe,
604
- MonkeyEcxTruncateQtdPipe], exports: [MonkeyEcxDisplayFirstNamePipe,
605
- MonkeyEcxFormatAddressPipe,
606
- MonkeyEcxFormatCurrencyPipe,
607
- MonkeyEcxFormatDateTimelapsePipe,
608
- MonkeyEcxFormatDateGroupPipe,
609
- MonkeyEcxFormatDocumentPipe,
610
- MonkeyEcxFormatNumberPipe,
611
- MonkeyEcxFormatPhonePipe,
612
- MonkeyEcxFormatSizePipe,
613
- MonkeyEcxFormatDocumentTypePipe,
614
- MonkeyEcxFormatValue,
615
- MonkeyEcxFormatZipCodePipe,
616
- MonkeyEcxTextTruncatePipe,
617
- MonkeyEcxTruncateQtdPipe] });
618
- MonkeyEcxPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, providers: [CurrencyPipe] });
619
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxPipesModule, decorators: [{
620
- type: NgModule,
621
- args: [{
622
- declarations: [
623
- MonkeyEcxDisplayFirstNamePipe,
624
- MonkeyEcxFormatAddressPipe,
625
- MonkeyEcxFormatCurrencyPipe,
626
- MonkeyEcxFormatDateTimelapsePipe,
627
- MonkeyEcxFormatDateGroupPipe,
628
- MonkeyEcxFormatDocumentPipe,
629
- MonkeyEcxFormatNumberPipe,
630
- MonkeyEcxFormatPhonePipe,
631
- MonkeyEcxFormatSizePipe,
632
- MonkeyEcxFormatDocumentTypePipe,
633
- MonkeyEcxFormatValue,
634
- MonkeyEcxFormatZipCodePipe,
635
- MonkeyEcxTextTruncatePipe,
636
- MonkeyEcxTruncateQtdPipe,
637
- ],
638
- exports: [
639
- MonkeyEcxDisplayFirstNamePipe,
640
- MonkeyEcxFormatAddressPipe,
641
- MonkeyEcxFormatCurrencyPipe,
642
- MonkeyEcxFormatDateTimelapsePipe,
643
- MonkeyEcxFormatDateGroupPipe,
644
- MonkeyEcxFormatDocumentPipe,
645
- MonkeyEcxFormatNumberPipe,
646
- MonkeyEcxFormatPhonePipe,
647
- MonkeyEcxFormatSizePipe,
648
- MonkeyEcxFormatDocumentTypePipe,
649
- MonkeyEcxFormatValue,
650
- MonkeyEcxFormatZipCodePipe,
651
- MonkeyEcxTextTruncatePipe,
652
- MonkeyEcxTruncateQtdPipe,
653
- ],
654
- providers: [CurrencyPipe],
655
- }]
656
- }] });
657
-
658
- class ClosedToMaintenanceModule {
659
- }
660
- ClosedToMaintenanceModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
661
- ClosedToMaintenanceModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, declarations: [ClosedToMaintenanceComponent], imports: [CommonModule,
662
- MonkeyButtonModule,
663
- MonkeyIconModule,
664
- MonkeyInputModule,
665
- MonkeyModalModule,
666
- MonkeyEcxPipesModule, i1$1.TranslateModule], exports: [ClosedToMaintenanceComponent] });
667
- ClosedToMaintenanceModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, imports: [[
668
- CommonModule,
669
- MonkeyButtonModule,
670
- MonkeyIconModule,
671
- MonkeyInputModule,
672
- MonkeyModalModule,
673
- MonkeyEcxPipesModule,
674
- TranslateModule.forChild()
675
- ]] });
676
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: ClosedToMaintenanceModule, decorators: [{
677
- type: NgModule,
678
- args: [{
679
- declarations: [ClosedToMaintenanceComponent],
680
- imports: [
681
- CommonModule,
682
- MonkeyButtonModule,
683
- MonkeyIconModule,
684
- MonkeyInputModule,
685
- MonkeyModalModule,
686
- MonkeyEcxPipesModule,
687
- TranslateModule.forChild()
688
- ],
689
- exports: [ClosedToMaintenanceComponent]
690
- }]
691
- }] });
692
-
693
- class MonkeyEcxProgressBarService {
694
- constructor(router) {
695
- this.router = router;
696
- this.visible = null;
697
- this.init();
698
- }
699
- init() {
700
- this.visible = new BehaviorSubject(false);
701
- this.router.events
702
- .pipe(filter((event) => {
703
- return event instanceof NavigationStart;
704
- }))
705
- .subscribe(() => {
706
- this.show();
707
- });
708
- this.router.events
709
- .pipe(filter((event) => {
710
- return (event instanceof NavigationEnd ||
711
- event instanceof NavigationError ||
712
- event instanceof NavigationCancel);
713
- }))
714
- .subscribe(() => {
715
- this.hide();
716
- });
717
- }
718
- show() {
719
- this.visible?.next(true);
720
- }
721
- hide() {
722
- this.visible?.next(false);
723
- }
724
- visibleConfig() {
725
- return this.visible?.asObservable() || null;
726
- }
727
- }
728
- MonkeyEcxProgressBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarService, deps: [{ token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
729
- MonkeyEcxProgressBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarService, providedIn: 'root' });
730
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarService, decorators: [{
731
- type: Injectable,
732
- args: [{
733
- providedIn: 'root'
734
- }]
735
- }], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
736
-
737
- class MonkeyEcxProgressBarComponent {
738
- constructor(progressBarService) {
739
- this.progressBarService = progressBarService;
740
- this.visible = false;
741
- //not to do
742
- }
743
- ngOnInit() {
744
- this.progressBarService?.visibleConfig()?.subscribe((visible) => {
745
- this.visible = visible;
746
- });
747
- }
748
- }
749
- MonkeyEcxProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarComponent, deps: [{ token: MonkeyEcxProgressBarService }], target: i0.ɵɵFactoryTarget.Component });
750
- MonkeyEcxProgressBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxProgressBarComponent, selector: "monkeyecx-progress-bar", ngImport: i0, template: "<ng-container *ngIf=\"visible\">\n <progress class=\"monkey-progress monkey-progress__theme\"></progress>\n</ng-container>\n", styles: ["monkeyecx-progress-bar{position:absolute;width:100%;margin-top:-9.5px;z-index:99998}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
751
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarComponent, decorators: [{
752
- type: Component,
753
- args: [{ selector: 'monkeyecx-progress-bar', encapsulation: ViewEncapsulation.None, template: "<ng-container *ngIf=\"visible\">\n <progress class=\"monkey-progress monkey-progress__theme\"></progress>\n</ng-container>\n", styles: ["monkeyecx-progress-bar{position:absolute;width:100%;margin-top:-9.5px;z-index:99998}\n"] }]
754
- }], ctorParameters: function () { return [{ type: MonkeyEcxProgressBarService }]; } });
755
-
756
- class MonkeyEcxProgressBarModule {
757
- }
758
- MonkeyEcxProgressBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
759
- MonkeyEcxProgressBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, declarations: [MonkeyEcxProgressBarComponent], imports: [CommonModule], exports: [MonkeyEcxProgressBarComponent] });
760
- MonkeyEcxProgressBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, imports: [[CommonModule]] });
761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxProgressBarModule, decorators: [{
762
- type: NgModule,
763
- args: [{
764
- declarations: [MonkeyEcxProgressBarComponent],
765
- imports: [CommonModule],
766
- exports: [MonkeyEcxProgressBarComponent]
767
- }]
768
- }] });
769
-
770
- class VersionChangedComponent {
771
- constructor() {
772
- this.config = null;
773
- }
774
- onClose() {
775
- document.location.reload();
776
- }
777
- }
778
- VersionChangedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
779
- VersionChangedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: VersionChangedComponent, selector: "monkeyecx-version-changed", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.VERSION-CHANGED.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-1' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-2' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.VERSION-CHANGED.BUTTONS.UPDATE-VERSION' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-version-changed .body{padding:24px;width:100%}monkeyecx-version-changed .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-version-changed .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-version-changed monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"], components: [{ type: i1.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$1.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
780
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedComponent, decorators: [{
781
- type: Component,
782
- args: [{ selector: 'monkeyecx-version-changed', encapsulation: ViewEncapsulation.None, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\" *ngIf=\"config\">\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\n <span class=\"h2\">\n {{ 'SCREENS.VERSION-CHANGED.TITLE' | translate }}\n </span>\n <span class=\"information-title mt-4\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-1' | translate }}\n </span>\n <span class=\"information mt-3\">\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-2' | translate }}\n </span>\n </div>\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\n {{ 'SCREENS.VERSION-CHANGED.BUTTONS.UPDATE-VERSION' | translate }}\n </monkey-button>\n </div>\n</monkey-modal>", styles: ["monkeyecx-version-changed .body{padding:24px;width:100%}monkeyecx-version-changed .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .information{font-style:normal;font-weight:400;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .browser-name{font-style:normal;font-weight:400;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-version-changed .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-version-changed monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"] }]
783
- }], propDecorators: { config: [{
784
- type: Input
785
- }], modalRef: [{
786
- type: Input
787
- }] } });
788
-
789
- class VersionChangedModule {
790
- }
791
- VersionChangedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
792
- VersionChangedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, declarations: [VersionChangedComponent], imports: [CommonModule,
793
- MonkeyButtonModule,
794
- MonkeyIconModule,
795
- MonkeyInputModule,
796
- MonkeyModalModule, i1$1.TranslateModule], exports: [VersionChangedComponent] });
797
- VersionChangedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, imports: [[
798
- CommonModule,
799
- MonkeyButtonModule,
800
- MonkeyIconModule,
801
- MonkeyInputModule,
802
- MonkeyModalModule,
803
- TranslateModule.forChild()
804
- ]] });
805
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: VersionChangedModule, decorators: [{
806
- type: NgModule,
807
- args: [{
808
- declarations: [VersionChangedComponent],
809
- imports: [
810
- CommonModule,
811
- MonkeyButtonModule,
812
- MonkeyIconModule,
813
- MonkeyInputModule,
814
- MonkeyModalModule,
815
- TranslateModule.forChild()
816
- ],
817
- exports: [VersionChangedComponent]
818
- }]
819
- }] });
820
-
821
- /* eslint-disable space-before-function-paren */
822
- /* eslint-disable func-names */
823
- function MonkeyEcxCoreCharts(render = true) {
824
- return (target, propertyName, propertyDescriptor) => {
825
- const method = propertyDescriptor.value;
826
- propertyDescriptor.value = function (...args) {
827
- const context = this;
828
- if (render) {
829
- const scriptsLoaded = Array.from(document.scripts);
830
- scriptsLoaded.forEach((script) => {
831
- const { src } = script;
832
- if (src.search('www.gstatic.com/charts') > 0) {
833
- document.getElementsByTagName('head')[0].removeChild(script);
834
- }
835
- });
836
- const node = document.createElement('script');
837
- node.src = 'https://www.gstatic.com/charts/loader.js';
838
- node.type = 'text/javascript';
839
- node.async = true;
840
- node.id = 'monkeyecx-charts-settings';
841
- node.onload = () => {
842
- method.apply(context, args);
843
- };
844
- document.getElementsByTagName('head')[0].appendChild(node);
845
- }
846
- else {
847
- const scriptsLoaded = Array.from(document.scripts);
848
- scriptsLoaded.forEach((script) => {
849
- const { src } = script;
850
- if (src.search('www.gstatic.com/charts') > 0) {
851
- document.getElementsByTagName('head')[0].removeChild(script);
852
- }
853
- });
854
- method.apply(context, args);
855
- }
856
- };
857
- return propertyDescriptor;
858
- };
859
- }
860
-
861
- /* eslint-disable max-classes-per-file */
862
- const moment$1 = moment_;
863
- class DateValidator {
864
- static do(control) {
865
- if (!control.parent || !control)
866
- return null;
867
- if (control && control.value) {
868
- const dateFormat = 'MM-DD-YYYY';
869
- if (!moment$1
870
- .default(moment$1.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
871
- .isValid()) {
872
- return {
873
- invalidDate: true,
874
- };
875
- }
876
- }
877
- return null;
878
- }
879
- }
880
- class DocumentValidator {
881
- static do(control) {
882
- if (!control.parent || !control)
883
- return null;
884
- if (control && control.value) {
885
- if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
886
- return {
887
- invalidCpfCnpj: true,
888
- };
889
- }
890
- }
891
- return null;
892
- }
893
- }
894
- class DocumentRutValidator {
895
- static do(control) {
896
- if (!control.parent || !control)
897
- return null;
898
- if (control && control.value) {
899
- if (!MonkeyEcxUtils.isValidRUT(control.value)) {
900
- return {
901
- invalidRut: true,
902
- };
903
- }
904
- }
905
- return null;
906
- }
907
- }
908
- class ZipCodeValidator {
909
- static do(control) {
910
- if (!control.parent || !control)
911
- return null;
912
- if (control && control.value) {
913
- if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
914
- return {
915
- invalidZipCode: true,
916
- };
917
- }
918
- }
919
- return null;
920
- }
921
- }
922
- class ComboValidator {
923
- static do(control) {
924
- if (!control.parent || !control)
925
- return null;
926
- if (control && control.value !== '0')
927
- return null;
928
- return {
929
- invalidCombo: true,
930
- };
931
- }
932
- }
933
- class isTrueValidator {
934
- static do(control) {
935
- if (!control.parent || !control)
936
- return null;
937
- if (control && control.value !== false)
938
- return null;
939
- return {
940
- invalidTrue: true,
941
- };
942
- }
943
- }
944
- class PasswordMatchValidation {
945
- static do(control) {
946
- if (!control.parent || !control)
947
- return null;
948
- const { parent } = control;
949
- const password = parent?.get('password')?.value;
950
- const passwordConfirm = parent?.get('passwordConfirm')?.value;
951
- if (!password || !passwordConfirm)
952
- return null;
953
- if (password === passwordConfirm)
954
- return null;
955
- return {
956
- passwordsNotMatching: true,
957
- };
958
- }
959
- }
960
- class UrlValidator {
961
- static do(control) {
962
- if (!control.parent || !control)
963
- return null;
964
- if (control && control.value) {
965
- if (!MonkeyEcxUtils.isValidUrl(control.value)) {
966
- return {
967
- invalidUrl: true,
968
- };
969
- }
970
- }
971
- return null;
972
- }
973
- }
974
- class CustomDatesStartValidator {
975
- static do(control) {
976
- if (!control.parent || !control)
977
- return null;
978
- const { parent } = control;
979
- const valueStart = parent?.get('dateStart')?.value;
980
- const valueEnd = parent?.get('dateEnd')?.value;
981
- let dateStart = null;
982
- let dateEnd = null;
983
- if (valueStart) {
984
- dateStart = new Date(valueStart);
985
- }
986
- if (valueEnd) {
987
- dateEnd = new Date(valueEnd);
988
- }
989
- if (!dateStart || !dateEnd)
990
- return null;
991
- if (dateStart > dateEnd) {
992
- return {
993
- dateStartMustBeLessThanAnd: true,
994
- };
995
- }
996
- return null;
997
- }
998
- }
999
- class CustomDatesEndValidator {
1000
- static do(control) {
1001
- if (!control.parent || !control)
1002
- return null;
1003
- const { parent } = control;
1004
- const valueStart = parent?.get('dateStart')?.value;
1005
- const valueEnd = parent?.get('dateEnd')?.value;
1006
- let dateStart = null;
1007
- let dateEnd = null;
1008
- if (valueStart) {
1009
- dateStart = new Date(valueStart);
1010
- }
1011
- if (valueEnd) {
1012
- dateEnd = new Date(valueEnd);
1013
- }
1014
- if (!dateEnd || !dateStart)
1015
- return null;
1016
- if (dateEnd < dateStart) {
1017
- return {
1018
- dateEndMustBeGreaterThanStart: true,
1019
- };
1020
- }
1021
- return null;
1022
- }
1023
- }
1024
- class UnlockRegisterBuyerValidator {
1025
- static do(control) {
1026
- if (!control.parent || !control)
1027
- return null;
1028
- if (control && control.value !== '#MONKEYBUYER') {
1029
- return {
1030
- invalidUnlockRegister: true,
1031
- };
1032
- }
1033
- return null;
1034
- }
1035
- }
1036
- class UnlockRegisterSponsorValidator {
1037
- static do(control) {
1038
- if (!control.parent || !control)
1039
- return null;
1040
- if (control && control.value !== '#MONKEYSPONSOR') {
1041
- return {
1042
- invalidUnlockRegister: true,
1043
- };
1044
- }
1045
- return null;
1046
- }
1047
- }
1048
- class DateRangeValidator {
1049
- static do(control) {
1050
- if (!control.parent || !control) {
1051
- return null;
1052
- }
1053
- const dates = control?.parent?.get('dates')?.value;
1054
- if (dates &&
1055
- (!MonkeyEcxUtils.persistNullEmptyUndefined(dates.startDate) ||
1056
- !MonkeyEcxUtils.persistNullEmptyUndefined(dates.endDate))) {
1057
- return {
1058
- invalidDateRange: true,
1059
- };
1060
- }
1061
- return null;
1062
- }
1063
- }
1064
-
1065
- var validateUtils = /*#__PURE__*/Object.freeze({
1066
- __proto__: null,
1067
- DateValidator: DateValidator,
1068
- DocumentValidator: DocumentValidator,
1069
- DocumentRutValidator: DocumentRutValidator,
1070
- ZipCodeValidator: ZipCodeValidator,
1071
- ComboValidator: ComboValidator,
1072
- isTrueValidator: isTrueValidator,
1073
- PasswordMatchValidation: PasswordMatchValidation,
1074
- UrlValidator: UrlValidator,
1075
- CustomDatesStartValidator: CustomDatesStartValidator,
1076
- CustomDatesEndValidator: CustomDatesEndValidator,
1077
- UnlockRegisterBuyerValidator: UnlockRegisterBuyerValidator,
1078
- UnlockRegisterSponsorValidator: UnlockRegisterSponsorValidator,
1079
- DateRangeValidator: DateRangeValidator
1080
- });
1081
-
1082
- /* eslint-disable no-unused-vars */
1083
- /* eslint-disable no-shadow */
1084
- var MonkeyEcxQueueEvents;
1085
- (function (MonkeyEcxQueueEvents) {
1086
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["OnGoing"] = 0] = "OnGoing";
1087
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["Finished"] = 1] = "Finished";
1088
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["FinishedWithError"] = 2] = "FinishedWithError";
1089
- })(MonkeyEcxQueueEvents || (MonkeyEcxQueueEvents = {}));
1090
- var MonkeyEcxDownloadEvents;
1091
- (function (MonkeyEcxDownloadEvents) {
1092
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["OnGoing"] = 0] = "OnGoing";
1093
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["Finished"] = 1] = "Finished";
1094
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["FinishedWithError"] = 2] = "FinishedWithError";
1095
- })(MonkeyEcxDownloadEvents || (MonkeyEcxDownloadEvents = {}));
1096
- var MonkeyEcxUploadEvents;
1097
- (function (MonkeyEcxUploadEvents) {
1098
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["OnGoing"] = 0] = "OnGoing";
1099
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["Finished"] = 1] = "Finished";
1100
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["FinishedWithError"] = 2] = "FinishedWithError";
1101
- })(MonkeyEcxUploadEvents || (MonkeyEcxUploadEvents = {}));
1102
- // TODO pegar do json de config
1103
- var ApiEndPointsTokenNotMandatory;
1104
- (function (ApiEndPointsTokenNotMandatory) {
1105
- ApiEndPointsTokenNotMandatory["Assets"] = "assets/";
1106
- ApiEndPointsTokenNotMandatory["MonkeyEcx"] = "/monkeyecx";
1107
- ApiEndPointsTokenNotMandatory["ViaCep"] = "viacep.com.br/";
1108
- })(ApiEndPointsTokenNotMandatory || (ApiEndPointsTokenNotMandatory = {}));
1109
- // TODO pegar do json de config
1110
- var ApiEndPointsHeaderNotMandatory;
1111
- (function (ApiEndPointsHeaderNotMandatory) {
1112
- ApiEndPointsHeaderNotMandatory["Assets"] = "/assets";
1113
- ApiEndPointsHeaderNotMandatory["PayablesUpload"] = "payables-upload";
1114
- ApiEndPointsHeaderNotMandatory["PictureUser"] = "/user-pictures";
1115
- ApiEndPointsHeaderNotMandatory["Documents"] = "documents/";
1116
- ApiEndPointsHeaderNotMandatory["BuyerTaxFile"] = "/buyer-tax-file";
1117
- ApiEndPointsHeaderNotMandatory["ViaCep"] = "viacep.com.br/";
1118
- })(ApiEndPointsHeaderNotMandatory || (ApiEndPointsHeaderNotMandatory = {}));
1119
-
1120
- var statics = /*#__PURE__*/Object.freeze({
1121
- __proto__: null,
1122
- get MonkeyEcxQueueEvents () { return MonkeyEcxQueueEvents; },
1123
- get MonkeyEcxDownloadEvents () { return MonkeyEcxDownloadEvents; },
1124
- get MonkeyEcxUploadEvents () { return MonkeyEcxUploadEvents; },
1125
- get ApiEndPointsTokenNotMandatory () { return ApiEndPointsTokenNotMandatory; },
1126
- get ApiEndPointsHeaderNotMandatory () { return ApiEndPointsHeaderNotMandatory; }
1127
- });
1128
-
1129
- function buildQueuePropertys(queue) {
1130
- const params = {
1131
- item: {
1132
- ...queue,
1133
- id: MonkeyEcxUtils.getRandomString(40)
1134
- },
1135
- status: MonkeyEcxQueueEvents.OnGoing
1136
- };
1137
- return params;
1138
- }
1139
- function buildDownloadPropertys(name, description, size) {
1140
- const params = {
1141
- item: {
1142
- name,
1143
- description,
1144
- id: `${MonkeyEcxUtils.getRandomString(40)}`,
1145
- size,
1146
- createdAt: new Date()
1147
- },
1148
- status: MonkeyEcxQueueEvents.OnGoing
1149
- };
1150
- return params;
1151
- }
1152
- function buildUploadPropertys(name, description) {
1153
- const params = {
1154
- item: {
1155
- name,
1156
- description,
1157
- id: `${MonkeyEcxUtils.getRandomString(40)}`
1158
- },
1159
- status: MonkeyEcxUploadEvents.OnGoing
1160
- };
1161
- return params;
1162
- }
1163
- function hasMonkeyEcxServiceAndHandlingProperties(context) {
1164
- return Object.prototype.hasOwnProperty.call(context, 'monkeyecxService');
1165
- }
1166
-
1167
- var decoratorsUtils = /*#__PURE__*/Object.freeze({
1168
- __proto__: null,
1169
- buildQueuePropertys: buildQueuePropertys,
1170
- buildDownloadPropertys: buildDownloadPropertys,
1171
- buildUploadPropertys: buildUploadPropertys,
1172
- hasMonkeyEcxServiceAndHandlingProperties: hasMonkeyEcxServiceAndHandlingProperties
1173
- });
1174
-
1175
- const moment = moment_;
1176
- const EMAIL_REGEXP = /^[\w-.]+@([\w-]+\.)+[\w-]{1,64}$/;
1177
- function isEmptyInputValue(value) {
1178
- return value == null || value.length === 0;
1179
- }
1180
- function emailValidator(control) {
1181
- if (!control.parent || !control || isEmptyInputValue(control.value)) {
1182
- return null;
1183
- }
1184
- const test = EMAIL_REGEXP.test(control.value);
1185
- if (test)
1186
- return null;
1187
- return {
1188
- email: true,
1189
- };
1190
- }
1191
- function dateRangeValidator(control) {
1192
- if (!control.parent || !control || isEmptyInputValue(control.value)) {
1193
- return null;
1194
- }
1195
- const dates = control?.parent?.get('dates')?.value;
1196
- if (dates &&
1197
- (!MonkeyEcxUtils.persistNullEmptyUndefined(dates?.startDate) ||
1198
- !MonkeyEcxUtils.persistNullEmptyUndefined(dates?.endDate))) {
1199
- return {
1200
- dateRange: true,
1201
- };
1202
- }
1203
- return null;
1204
- }
1205
- function registerValidator(control, type) {
1206
- if (!control.parent || !control || isEmptyInputValue(control.value)) {
1207
- return null;
1208
- }
1209
- if (control && control.value !== `#MONKEY${type}`.toUpperCase()) {
1210
- return {
1211
- invalidUnlockRegister: true,
1212
- };
1213
- }
1214
- return null;
1215
- }
1216
- function dateStartEndValidator(control) {
1217
- if (!control.parent || !control) {
1218
- return null;
1219
- }
1220
- const { parent } = control;
1221
- const valueStart = parent?.get('dateStart')?.value;
1222
- const valueEnd = parent?.get('dateEnd')?.value;
1223
- let dateStart = null;
1224
- let dateEnd = null;
1225
- if (valueStart) {
1226
- dateStart = new Date(valueStart);
1227
- }
1228
- if (valueEnd) {
1229
- dateEnd = new Date(valueEnd);
1230
- }
1231
- if (!dateEnd || !dateStart)
1232
- return null;
1233
- if (dateStart > dateEnd) {
1234
- return {
1235
- dateStartMustBeLessThanAnd: true,
1236
- };
1237
- }
1238
- return null;
1239
- }
1240
- function urlValidator(control) {
1241
- if (!control.parent || !control || isEmptyInputValue(control.value))
1242
- return null;
1243
- if (!MonkeyEcxUtils.isValidUrl(control.value)) {
1244
- return {
1245
- url: true,
1246
- };
1247
- }
1248
- return null;
1249
- }
1250
- function passwordConfirmValidator(control) {
1251
- if (!control.parent || !control || isEmptyInputValue(control.value))
1252
- return null;
1253
- const { parent } = control;
1254
- const password = parent?.get('password')?.value;
1255
- const passwordConfirm = parent?.get('passwordConfirm')?.value;
1256
- if (!password || !passwordConfirm)
1257
- return null;
1258
- if (password === passwordConfirm)
1259
- return null;
1260
- return {
1261
- passwordsNotMatching: true,
1262
- };
1263
- }
1264
- function trueValidator(control) {
1265
- if (!control.parent || !control)
1266
- return null;
1267
- if (control && control.value !== false)
1268
- return null;
1269
- return {
1270
- invalidTrue: true,
1271
- };
1272
- }
1273
- function comboValidator(control) {
1274
- if (!control.parent || !control)
1275
- return null;
1276
- if (control && control.value !== '0')
1277
- return null;
1278
- return {
1279
- invalidCombo: true,
1280
- };
1281
- }
1282
- function zipCodeValidator(control) {
1283
- if (!control.parent || !control || isEmptyInputValue(control.value))
1284
- return null;
1285
- if (control && control.value) {
1286
- if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
1287
- return {
1288
- invalidZipCode: true,
1289
- };
1290
- }
1291
- }
1292
- return null;
1293
- }
1294
- function documentValidator(control, country) {
1295
- if (!control.parent || !control || isEmptyInputValue(control.value))
1296
- return null;
1297
- if (country === 'BR') {
1298
- if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
1299
- return {
1300
- invalidCpfCnpj: true,
1301
- };
1302
- }
1303
- }
1304
- else if (country === 'CL') {
1305
- if (!MonkeyEcxUtils.isValidRUT(control.value)) {
1306
- return {
1307
- invalidCpfCnpj: true,
1308
- };
1309
- }
1310
- }
1311
- return null;
1312
- }
1313
- function dateValidator(control) {
1314
- if (!control.parent || !control || isEmptyInputValue(control.value))
1315
- return null;
1316
- const dateFormat = 'MM-DD-YYYY';
1317
- if (!moment
1318
- .default(moment.default(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true)
1319
- .isValid()) {
1320
- return {
1321
- invalidDate: true,
1322
- };
1323
- }
1324
- return null;
1325
- }
1326
- function valueGreaterThanZero(control) {
1327
- if (!control.parent || !control || isEmptyInputValue(control.value))
1328
- return null;
1329
- if (control && `${control?.value}` === '0') {
1330
- return {
1331
- invalidValueGreaterThanZero: true,
1332
- };
1333
- }
1334
- return null;
1335
- }
1336
- class Validators {
1337
- static email(control) {
1338
- return emailValidator(control);
1339
- }
1340
- static dateRange(control) {
1341
- return dateRangeValidator(control);
1342
- }
1343
- static unlockSponsorRegister(control) {
1344
- return registerValidator(control, 'sponsor');
1345
- }
1346
- static unlockBuyerRegister(control) {
1347
- return registerValidator(control, 'buyer');
1348
- }
1349
- static dateStartEnd(control) {
1350
- return dateStartEndValidator(control);
1351
- }
1352
- static url(control) {
1353
- return urlValidator(control);
1354
- }
1355
- static passwordConfirm(control) {
1356
- return passwordConfirmValidator(control);
1357
- }
1358
- static true(control) {
1359
- return trueValidator(control);
1360
- }
1361
- static combo(control) {
1362
- return comboValidator(control);
1363
- }
1364
- static zipCode(control) {
1365
- return zipCodeValidator(control);
1366
- }
1367
- static documentBR(control) {
1368
- return documentValidator(control, 'BR');
1369
- }
1370
- static documentCL(control) {
1371
- return documentValidator(control, 'CL');
1372
- }
1373
- static date(control) {
1374
- return dateValidator(control);
1375
- }
1376
- static greaterThanZero(control) {
1377
- return valueGreaterThanZero(control);
1378
- }
1379
- }
1380
-
1381
- /* eslint-disable object-curly-newline */
1382
-
1383
- function MonkeyEcxCoreServiceConstructor() {
1384
- return (target) => {
1385
- Object.entries(target.prototype).forEach(([key, value]) => {
1386
- const method = target.prototype[key];
1387
- if (key !== 'constructor') {
1388
- target.prototype[key] = function (...args) {
1389
- const context = this;
1390
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1391
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1392
- }
1393
- const result = method.apply(context, args);
1394
- return result;
1395
- };
1396
- }
1397
- });
1398
- return target;
1399
- };
1400
- }
1401
- function MonkeyEcxCoreLog(tp) {
1402
- return function (target, propertyName, propertyDescriptor) {
1403
- const method = propertyDescriptor.value;
1404
- propertyDescriptor.value = function (...args) {
1405
- const params = args
1406
- .map((a) => {
1407
- return JSON.stringify(a);
1408
- })
1409
- .join();
1410
- const result = method.apply(this, args);
1411
- const r = JSON.stringify(result);
1412
- console.log(`Call: ${propertyName}(${params}) => ${r}`);
1413
- return result;
1414
- };
1415
- return propertyDescriptor;
1416
- };
1417
- }
1418
- function MonkeyEcxCoreClearDecorators() {
1419
- return function (target, propertyName, propertyDescriptor) {
1420
- const method = propertyDescriptor.value;
1421
- propertyDescriptor.value = function (...args) {
1422
- const context = this;
1423
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1424
- context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
1425
- }
1426
- const result = method.apply(context, args);
1427
- return result;
1428
- };
1429
- return propertyDescriptor;
1430
- };
1431
- }
1432
- function MonkeyEcxCoreService(params) {
1433
- return function (target, propertyName, propertyDescriptor) {
1434
- const method = propertyDescriptor.value;
1435
- propertyDescriptor.value = function (...args) {
1436
- const context = this;
1437
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1438
- context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
1439
- context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
1440
- }
1441
- const result = method.apply(context, args);
1442
- return result;
1443
- };
1444
- return propertyDescriptor;
1445
- };
1446
- }
1447
- function MonkeyEcxCoreServicePaged(params) {
1448
- return function (target, propertyName, propertyDescriptor) {
1449
- const method = propertyDescriptor.value;
1450
- propertyDescriptor.value = function (...args) {
1451
- const context = this;
1452
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1453
- const credentials = context?.monkeyecxService?.monkeyecxHandlingService?.getMonkeyEcxServiceCredentials();
1454
- let requestPaged = null;
1455
- if (credentials) {
1456
- requestPaged = credentials.requestPaged;
1457
- }
1458
- context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
1459
- context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials({
1460
- ...params,
1461
- ...(requestPaged || {}),
1462
- });
1463
- }
1464
- const result = method.apply(context, args);
1465
- return result;
1466
- };
1467
- return propertyDescriptor;
1468
- };
1469
- }
1470
- function MonkeyEcxCoreServiceQueue(name, description, params) {
1471
- return function (target, propertyName, propertyDescriptor) {
1472
- const method = propertyDescriptor.value;
1473
- propertyDescriptor.value = function (...args) {
1474
- const context = this;
1475
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1476
- if (MonkeyEcxUtils.persistNullEmptyUndefined(params)) {
1477
- context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
1478
- context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
1479
- }
1480
- context?.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxRequestQueue(buildQueuePropertys({
1481
- name,
1482
- description,
1483
- }));
1484
- }
1485
- const result = method.apply(context, args);
1486
- return result;
1487
- };
1488
- return propertyDescriptor;
1489
- };
1490
- }
1491
-
1492
- /* eslint-disable space-before-function-paren */
1493
- function MonkeyEcxServiceDownload(name, description, params) {
1494
- return function (target, propertyName, propertyDescriptor) {
1495
- const method = propertyDescriptor.value;
1496
- propertyDescriptor.value = function (...args) {
1497
- const context = this;
1498
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1499
- if (MonkeyUtils.persistNullEmptyUndefined(params)) {
1500
- context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
1501
- context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
1502
- }
1503
- context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxRequestDownload({
1504
- ...buildDownloadPropertys(name, description),
1505
- });
1506
- }
1507
- const result = method.apply(context, args);
1508
- return result;
1509
- };
1510
- return propertyDescriptor;
1511
- };
1512
- }
1513
-
1514
- /* eslint-disable space-before-function-paren */
1515
- function MonkeyEcxServiceUpload(name, description, params) {
1516
- return function (target, propertyName, propertyDescriptor) {
1517
- const method = propertyDescriptor.value;
1518
- propertyDescriptor.value = function (...args) {
1519
- const context = this;
1520
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1521
- if (MonkeyUtils.persistNullEmptyUndefined(params)) {
1522
- context?.monkeyecxService?.monkeyecxHandlingService?.clearAll();
1523
- context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxServiceCredentials(params);
1524
- }
1525
- context?.monkeyecxService?.monkeyecxHandlingService?.setMonkeyEcxRequestUpload({
1526
- ...buildUploadPropertys(name, description),
1527
- });
1528
- }
1529
- const result = method.apply(context, args);
1530
- return result;
1531
- };
1532
- return propertyDescriptor;
1533
- };
1534
- }
1535
-
1536
- class MonkeyEcxDragDropDirective {
1537
- constructor() {
1538
- this.onFileDropped = new EventEmitter();
1539
- this.background = '#f5fcff';
1540
- this.opacity = '1';
1541
- }
1542
- onDragOver(evt) {
1543
- evt?.preventDefault();
1544
- evt?.stopPropagation();
1545
- this.background = '#9ecbec';
1546
- this.opacity = '0.8';
1547
- }
1548
- onDragLeave(evt) {
1549
- evt?.preventDefault();
1550
- evt?.stopPropagation();
1551
- this.background = '#f5fcff';
1552
- this.opacity = '1';
1553
- }
1554
- ondrop(evt) {
1555
- evt?.preventDefault();
1556
- evt?.stopPropagation();
1557
- this.background = '#f5fcff';
1558
- this.opacity = '1';
1559
- const { files } = evt?.dataTransfer;
1560
- if (files.length > 0) {
1561
- this.onFileDropped.emit(files);
1562
- }
1563
- }
1564
- }
1565
- MonkeyEcxDragDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDragDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1566
- MonkeyEcxDragDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxDragDropDirective, selector: "[monkeyecxDragDrop]", outputs: { onFileDropped: "onFileDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "ondrop($event)" }, properties: { "style.background-color": "this.background", "style.opacity": "this.opacity" } }, ngImport: i0 });
1567
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDragDropDirective, decorators: [{
1568
- type: Directive,
1569
- args: [{
1570
- selector: '[monkeyecxDragDrop]',
1571
- }]
1572
- }], propDecorators: { onFileDropped: [{
1573
- type: Output
1574
- }], background: [{
1575
- type: HostBinding,
1576
- args: ['style.background-color']
1577
- }], opacity: [{
1578
- type: HostBinding,
1579
- args: ['style.opacity']
1580
- }], onDragOver: [{
1581
- type: HostListener,
1582
- args: ['dragover', ['$event']]
1583
- }], onDragLeave: [{
1584
- type: HostListener,
1585
- args: ['dragleave', ['$event']]
1586
- }], ondrop: [{
1587
- type: HostListener,
1588
- args: ['drop', ['$event']]
1589
- }] } });
1590
-
1591
- class MonkeyEcxFormatCurrency {
1592
- constructor(elementRef, injector) {
1593
- this.elementRef = elementRef;
1594
- this.injector = injector;
1595
- this.currencyCode = 'BRL';
1596
- this.currentLocale = 'pt-BR';
1597
- this.el = this.elementRef.nativeElement;
1598
- this.currency = this.injector.get(CurrencyPipe);
1599
- const translateService = this.injector.get(TranslateService);
1600
- translateService.get('MONKEY-CURRENCY-CODE').subscribe((_) => {
1601
- this.currencyCode = _;
1602
- this.currentLocale = translateService.getDefaultLang();
1603
- });
1604
- }
1605
- handle(value) {
1606
- const { currencyCode, currentLocale } = this;
1607
- const newValue = MonkeyEcxUtils.handleOnlyNumbers(value);
1608
- return this.currency.transform(newValue / 100, currencyCode, 'symbol', '', currentLocale);
1609
- }
1610
- ngOnInit() {
1611
- this.el.value = this.handle(this.el.value);
1612
- }
1613
- onInput(value) {
1614
- this.el.value = this.handle(value);
1615
- }
1616
- }
1617
- MonkeyEcxFormatCurrency.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrency, deps: [{ token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
1618
- MonkeyEcxFormatCurrency.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxFormatCurrency, selector: "[monkeyecxFormatCurrency]", host: { listeners: { "input": "onInput($event.target.value)" } }, providers: [CurrencyPipe], ngImport: i0 });
1619
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatCurrency, decorators: [{
1620
- type: Directive,
1621
- args: [{
1622
- selector: '[monkeyecxFormatCurrency]',
1623
- providers: [CurrencyPipe]
1624
- }]
1625
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Injector }]; }, propDecorators: { onInput: [{
1626
- type: HostListener,
1627
- args: ['input', ['$event.target.value']]
1628
- }] } });
1629
-
1630
- class MonkeyEcxFormatUpper {
1631
- constructor(_el, _renderer) {
1632
- this._el = _el;
1633
- this._renderer = _renderer;
1634
- // not to do
1635
- }
1636
- onKeyDown(evt) {
1637
- const value = this._el.nativeElement.value.toUpperCase();
1638
- this._renderer.setProperty(this._el.nativeElement, 'value', value);
1639
- this._onChange?.(value);
1640
- evt.preventDefault();
1641
- }
1642
- onBlur() {
1643
- this._touched?.();
1644
- }
1645
- writeValue(value) {
1646
- this._renderer.setProperty(this._el.nativeElement, 'value', value);
1647
- }
1648
- registerOnChange(fn) {
1649
- this._onChange = fn;
1650
- }
1651
- registerOnTouched(fn) {
1652
- this._touched = fn;
1653
- }
1654
- setDisabledState(isDisabled) {
1655
- this._renderer.setProperty(this._el.nativeElement, 'disabled', isDisabled);
1656
- }
1657
- }
1658
- MonkeyEcxFormatUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatUpper, deps: [{ token: i0.ElementRef, self: true }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
1659
- MonkeyEcxFormatUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxFormatUpper, selector: "[monkeyecxFormatUpper]", host: { listeners: { "keyup": "onKeyDown($event)", "blur": "onBlur($event)" } }, providers: [
1660
- {
1661
- provide: NG_VALUE_ACCESSOR,
1662
- useExisting: forwardRef(() => {
1663
- // eslint-disable-next-line no-use-before-define
1664
- return MonkeyEcxFormatUpper;
1665
- }),
1666
- multi: true,
1667
- },
1668
- ], ngImport: i0 });
1669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFormatUpper, decorators: [{
1670
- type: Directive,
1671
- args: [{
1672
- selector: '[monkeyecxFormatUpper]',
1673
- providers: [
1674
- {
1675
- provide: NG_VALUE_ACCESSOR,
1676
- useExisting: forwardRef(() => {
1677
- // eslint-disable-next-line no-use-before-define
1678
- return MonkeyEcxFormatUpper;
1679
- }),
1680
- multi: true,
1681
- },
1682
- ],
1683
- }]
1684
- }], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
1685
- type: Self
1686
- }] }, { type: i0.Renderer2 }]; }, propDecorators: { onKeyDown: [{
1687
- type: HostListener,
1688
- args: ['keyup', ['$event']]
1689
- }], onBlur: [{
1690
- type: HostListener,
1691
- args: ['blur', ['$event']]
1692
- }] } });
1693
-
1694
- class MonkeyEcxOnlyAlphaNumericDirective {
1695
- constructor(elementRef) {
1696
- this.elementRef = elementRef;
1697
- // not to do
1698
- }
1699
- onInputChange(event) {
1700
- const initalValue = this.elementRef.nativeElement.value;
1701
- this.elementRef.nativeElement.value = MonkeyEcxUtils.handleOnlyAlphaNumeric(initalValue);
1702
- if (initalValue !== this.elementRef.nativeElement.value) {
1703
- event.stopPropagation();
1704
- }
1705
- }
1706
- }
1707
- MonkeyEcxOnlyAlphaNumericDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyAlphaNumericDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1708
- MonkeyEcxOnlyAlphaNumericDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxOnlyAlphaNumericDirective, selector: "[monkeyecxOnlyAlphaNumeric]", host: { listeners: { "input": "onInputChange($event)" } }, ngImport: i0 });
1709
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyAlphaNumericDirective, decorators: [{
1710
- type: Directive,
1711
- args: [{
1712
- selector: '[monkeyecxOnlyAlphaNumeric]'
1713
- }]
1714
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onInputChange: [{
1715
- type: HostListener,
1716
- args: ['input', ['$event']]
1717
- }] } });
1718
-
1719
- class MonkeyEcxOnlyNumbersDirective {
1720
- constructor(elementRef) {
1721
- this.elementRef = elementRef;
1722
- // not to do
1723
- }
1724
- onInputChange(event) {
1725
- const initalValue = this.elementRef.nativeElement.value;
1726
- this.elementRef.nativeElement.value = MonkeyEcxUtils.handleOnlyNumbers(initalValue);
1727
- if (initalValue !== this.elementRef.nativeElement.value) {
1728
- event.stopPropagation();
1729
- }
1730
- }
1731
- }
1732
- MonkeyEcxOnlyNumbersDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyNumbersDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1733
- MonkeyEcxOnlyNumbersDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxOnlyNumbersDirective, selector: "[monkeyecxOnlyNumbers]", host: { listeners: { "input": "onInputChange($event)" } }, ngImport: i0 });
1734
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOnlyNumbersDirective, decorators: [{
1735
- type: Directive,
1736
- args: [{
1737
- selector: '[monkeyecxOnlyNumbers]'
1738
- }]
1739
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onInputChange: [{
1740
- type: HostListener,
1741
- args: ['input', ['$event']]
1742
- }] } });
1743
-
1744
- class MonkeyEcxRequestPagedHandling {
1745
- constructor(_url, _pagedParams, _links) {
1746
- this.url = _url;
1747
- this.pagedParams = _pagedParams || {
1748
- page: {},
1749
- };
1750
- this.links = _links;
1751
- }
1752
- handlePagedValuesFromApi(url = '') {
1753
- if (url.search('\\?') < 0)
1754
- return url;
1755
- const params = url.substring(url.search('\\?') + 1, url.length);
1756
- url = url.substring(0, url.search('\\?'));
1757
- return `${url}?${new HttpParams({
1758
- fromString: params,
1759
- })
1760
- .delete('size')
1761
- .delete('page')
1762
- .toString()}`;
1763
- }
1764
- getUrlParams(url) {
1765
- const { pagedParams } = this;
1766
- const { number, size } = pagedParams?.page || {};
1767
- const hasInitialQueryParams = url.search('\\?') > 0;
1768
- return `${!hasInitialQueryParams ? '?' : '&'}page=${number || 0}&size=${size || 20}`;
1769
- }
1770
- getRequestWithPagedParams() {
1771
- const { url, links } = this;
1772
- if (links && links.next) {
1773
- return links.next.href;
1774
- }
1775
- const handled = this.handlePagedValuesFromApi(url);
1776
- return `${handled}${this.getUrlParams(handled)}`;
1777
- }
1778
- }
1779
-
1780
- class MonkeyEcxCommonsService {
1781
- constructor(monkeyecxService, tokenStorage, otherArgs) {
1782
- this.monkeyecxService = monkeyecxService;
1783
- this.tokenStorage = tokenStorage;
1784
- this.otherArgs = otherArgs;
1785
- this.flagValidator = true;
1786
- this.__savedState = null;
1787
- this.__error = null;
1788
- this.__handledError = null;
1789
- this.__page = null;
1790
- this.__links = null;
1791
- this.__requestPaged = null;
1792
- this.__onSearchChanged$ = new BehaviorSubject(null);
1793
- this.__onDataChanged$ = new BehaviorSubject(null);
1794
- this.__onLoadingInProgress$ = new BehaviorSubject(false);
1795
- this.__onDataDeleted$ = new BehaviorSubject(null);
1796
- this.__onErrorChanged$ = new BehaviorSubject(null);
1797
- this.__onGovernmentIdDataChanged$ = new BehaviorSubject(null);
1798
- this.__onZipCodeDataChanged$ = new BehaviorSubject(null);
1799
- this.__oni18nDataChanged$ = new BehaviorSubject(null);
1800
- this.__onDoSearch$ = new BehaviorSubject({});
1801
- this.__tokenCredentials = null;
1802
- this.__schedule = null;
1803
- this.__callbackPagination = () => {
1804
- // eslint-disable-next-line no-console
1805
- return console.error('Method callbackPagination needs to be declared');
1806
- };
1807
- this.handleInit();
1808
- }
1809
- handleInit() {
1810
- if (this.tokenStorage) {
1811
- this.__tokenCredentials = this.tokenStorage.getToken();
1812
- }
1813
- if (this.otherArgs?.router) {
1814
- const { clearOnChangeRoute } = this.otherArgs?.schedule?.options || {
1815
- clearOnChangeRoute: false,
1816
- };
1817
- this.otherArgs.router.events
1818
- .pipe(filter((event) => {
1819
- return event instanceof NavigationStart;
1820
- }), take(1))
1821
- .subscribe(() => {
1822
- if (this.__schedule && clearOnChangeRoute) {
1823
- this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
1824
- this.__schedule = null;
1825
- }
1826
- });
1827
- }
1828
- }
1829
- getRole() {
1830
- const { __tokenCredentials } = this;
1831
- if (!__tokenCredentials)
1832
- return '';
1833
- if (__tokenCredentials?.programAdmin === 'true') {
1834
- return 'PROGRAM_ADMIN';
1835
- }
1836
- return __tokenCredentials?.role || '';
1837
- }
1838
- allowedSecurityAccess(args) {
1839
- if (!args)
1840
- return true;
1841
- const roles = args?.roles;
1842
- const byExclusion = args?.byExclusion;
1843
- const found = roles?.indexOf(this.getRole());
1844
- let ret = false;
1845
- if (byExclusion) {
1846
- ret = true;
1847
- if (found > -1) {
1848
- ret = false;
1849
- }
1850
- }
1851
- else {
1852
- ret = false;
1853
- if (found > -1) {
1854
- ret = true;
1855
- }
1856
- }
1857
- if (!roles || roles.length === 0 || this.getRole() === 'PROGRAM_ADMIN') {
1858
- ret = true;
1859
- }
1860
- return ret;
1861
- }
1862
- navigateToErrorPage(statusCode, router) {
1863
- const routes = {
1864
- 403: 'forbidden',
1865
- 404: 'not-found',
1866
- 500: 'service-problems',
1867
- 503: 'service-problems',
1868
- };
1869
- if (!router) {
1870
- console.error('Router must be declared');
1871
- }
1872
- else {
1873
- router?.navigate([`/app/pages/${routes[statusCode]}`.toLowerCase()], {
1874
- skipLocationChange: true,
1875
- });
1876
- }
1877
- }
1878
- setPage(requestPaged) {
1879
- this.__requestPaged = {
1880
- ...this.__requestPaged,
1881
- ...requestPaged,
1882
- };
1883
- return this;
1884
- }
1885
- nextPage() {
1886
- if (this.__links) {
1887
- return !!this.__links?.next;
1888
- }
1889
- if (!this.__requestPaged)
1890
- return false;
1891
- const { page } = this.__requestPaged;
1892
- const { number, totalPages } = page;
1893
- if (number < totalPages) {
1894
- this.__requestPaged = {
1895
- ...this.__requestPaged,
1896
- page: {
1897
- ...page,
1898
- number: number + 1,
1899
- },
1900
- };
1901
- return true;
1902
- }
1903
- return false;
1904
- }
1905
- getEmbeddedData(data, field) {
1906
- const { _embedded } = data;
1907
- return _embedded ? _embedded[field] : null;
1908
- }
1909
- getNormalizedUrl(url) {
1910
- const { __requestPaged, __links } = this;
1911
- return new MonkeyEcxRequestPagedHandling(url, __requestPaged || {}, __links).getRequestWithPagedParams();
1912
- }
1913
- clear(clearData) {
1914
- if (clearData) {
1915
- this.__data = null;
1916
- this.__requestPaged = null;
1917
- this.__params = null;
1918
- this.__page = null;
1919
- this.__links = null;
1920
- if (this.__schedule) {
1921
- const { queue } = this.__schedule;
1922
- if (queue) {
1923
- this.otherArgs?.queue?.service?.removeQueueItem(queue);
1924
- }
1925
- this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
1926
- this.__schedule = null;
1927
- }
1928
- }
1929
- this.__error = null;
1930
- this.__handledError = null;
1931
- this.flagValidator = false;
1932
- }
1933
- resolve(route, state, otherArgs) {
1934
- if (JSON.stringify(route?.queryParams) === '{}') {
1935
- this.__data = null;
1936
- this.__page = null;
1937
- }
1938
- this.__requestPaged = null;
1939
- this.flagValidator = true;
1940
- if (this.tokenStorage) {
1941
- this.__tokenCredentials = this.tokenStorage.getToken();
1942
- }
1943
- if (this.allowedSecurityAccess(otherArgs?.security)) {
1944
- if (this.__schedule) {
1945
- this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
1946
- this.__schedule = null;
1947
- }
1948
- const { __requestPaged } = this;
1949
- if (!__requestPaged) {
1950
- this.setPage({
1951
- page: {
1952
- number: 0,
1953
- size: 10,
1954
- },
1955
- });
1956
- }
1957
- if (otherArgs?.translateOptions) {
1958
- const { service, keys } = otherArgs?.translateOptions;
1959
- this.geti18n(service, keys || '');
1960
- }
1961
- if (otherArgs?.callbackPagination) {
1962
- this.__callbackPagination = otherArgs.callbackPagination;
1963
- }
1964
- if (otherArgs?.feature) {
1965
- const { flag, service } = otherArgs.feature;
1966
- service.onFlags
1967
- .pipe(takeWhile(() => {
1968
- return this.flagValidator;
1969
- }))
1970
- .subscribe((val) => {
1971
- if (val) {
1972
- const hasFlag = service.getFlag(flag);
1973
- if (MonkeyEcxUtils.persistNullEmptyUndefined(hasFlag)) {
1974
- if (!hasFlag) {
1975
- this.navigateToErrorPage(404, otherArgs?.router);
1976
- return;
1977
- }
1978
- }
1979
- otherArgs?.callbackMain();
1980
- }
1981
- });
1982
- }
1983
- else {
1984
- otherArgs?.callbackMain();
1985
- }
1986
- }
1987
- else {
1988
- this.navigateToErrorPage(403, otherArgs?.router);
1989
- }
1990
- }
1991
- getHTTPHeaderApplicationPDF() {
1992
- return {
1993
- observe: 'response',
1994
- responseType: 'blob',
1995
- };
1996
- }
1997
- genericMethod(link, data, callback) {
1998
- const { href, type = 'get' } = link;
1999
- this.monkeyecxService?.[type.toLowerCase()](`${href}`, data)?.subscribe(() => {
2000
- if (callback)
2001
- callback();
2002
- }, (err) => {
2003
- throwError(err);
2004
- });
2005
- }
2006
- geti18n(translateService, keys) {
2007
- translateService.getStreamOnTranslationChange(keys).subscribe((translations) => {
2008
- this.__i18n = translations;
2009
- this.__oni18nDataChanged$.next(null);
2010
- });
2011
- }
2012
- doPagination() {
2013
- if (!this.__onLoadingInProgress$.value) {
2014
- const hasMorePages = this.setPage({
2015
- page: {
2016
- ...this.__page,
2017
- },
2018
- }).nextPage();
2019
- if (hasMorePages && this.__callbackPagination) {
2020
- this.__callbackPagination();
2021
- }
2022
- }
2023
- }
2024
- setSearchByUrl(router, url, search, extras) {
2025
- this.__data = null;
2026
- this.__page = null;
2027
- this.__onDataChanged$.next(null);
2028
- this.__onLoadingInProgress$.next(false);
2029
- router.navigate([url], {
2030
- queryParams: {
2031
- ...search,
2032
- r: MonkeyEcxUtils.getRandomString(30),
2033
- },
2034
- queryParamsHandling: 'merge',
2035
- ...extras,
2036
- });
2037
- }
2038
- saveState(state) {
2039
- this.__savedState = {
2040
- page: this.__page,
2041
- ...state,
2042
- };
2043
- }
2044
- }
2045
- __decorate([
2046
- MonkeyEcxCoreService({
2047
- requestInProgress: {
2048
- showProgress: true,
2049
- },
2050
- })
2051
- ], MonkeyEcxCommonsService.prototype, "genericMethod", null);
2052
-
2053
- /* eslint-disable max-len */
2054
- class MonkeyEcxHandlingService {
2055
- constructor() {
2056
- this.monkeyecxServiceCredentials = null;
2057
- this.monkeyecxRequestQueue = null;
2058
- this.monkeyecxRequestDownload = null;
2059
- this.monkeyecxRequestUpload = null;
2060
- }
2061
- clearAll() {
2062
- this.monkeyecxServiceCredentials = null;
2063
- this.monkeyecxRequestQueue = null;
2064
- this.monkeyecxRequestDownload = null;
2065
- this.monkeyecxRequestUpload = null;
2066
- }
2067
- setMonkeyEcxServiceCredentials(param) {
2068
- this.monkeyecxServiceCredentials = param;
2069
- }
2070
- getMonkeyEcxServiceCredentials() {
2071
- return this.monkeyecxServiceCredentials;
2072
- }
2073
- setMonkeyEcxRequestQueue(queue) {
2074
- this.monkeyecxRequestQueue = queue;
2075
- }
2076
- getMonkeyEcxRequestQueue() {
2077
- return this.monkeyecxRequestQueue;
2078
- }
2079
- setMonkeyEcxRequestDownload(download) {
2080
- this.monkeyecxRequestDownload = download;
2081
- }
2082
- getMonkeyEcxRequestDownload() {
2083
- return this.monkeyecxRequestDownload;
2084
- }
2085
- setMonkeyEcxRequestUpload(upload) {
2086
- this.monkeyecxRequestUpload = upload;
2087
- }
2088
- getMonkeyEcxRequestUpload() {
2089
- return this.monkeyecxRequestUpload;
2090
- }
2091
- }
2092
- MonkeyEcxHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2093
- MonkeyEcxHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHandlingService, providedIn: 'root' });
2094
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHandlingService, decorators: [{
2095
- type: Injectable,
2096
- args: [{
2097
- providedIn: 'root'
2098
- }]
2099
- }] });
2100
-
2101
- class MonkeyEcxService {
2102
- constructor(http, monkeyecxHandlingService) {
2103
- this.http = http;
2104
- this.monkeyecxHandlingService = monkeyecxHandlingService;
2105
- // not to do
2106
- }
2107
- handlelize(params) {
2108
- if (!params) {
2109
- return params;
2110
- }
2111
- // eslint-disable-next-line no-restricted-syntax
2112
- for (const field of [
2113
- 'createdAt',
2114
- 'createUserId',
2115
- 'updatedAt',
2116
- 'lastUserId',
2117
- '_links',
2118
- 'governmentIdType',
2119
- 'governmentIdMask',
2120
- 'screenType',
2121
- 'screenTab',
2122
- ]) {
2123
- delete params[field];
2124
- }
2125
- return params;
2126
- }
2127
- get(url, options) {
2128
- return this.http.get(url, options);
2129
- }
2130
- post(url, params, options) {
2131
- return this.http.post(url, params, options);
2132
- }
2133
- put(url, params) {
2134
- return this.http.put(url, this.handlelize({
2135
- ...params,
2136
- }));
2137
- }
2138
- delete(url, params) {
2139
- return this.http.delete(url, params);
2140
- }
2141
- download(url, options, filename) {
2142
- this.http.get(url, options).subscribe((resp) => {
2143
- const { headers, body } = resp;
2144
- const contentType = headers.get('Content-Type');
2145
- const contentDisposition = headers.get('Content-Disposition');
2146
- if (contentDisposition) {
2147
- filename = contentDisposition
2148
- .split(';')[1]
2149
- .split('filename')[1]
2150
- .split('=')[1]
2151
- .trim()
2152
- .replace(new RegExp(/"/g), '');
2153
- }
2154
- const blob = new Blob([body], {
2155
- type: `${contentType}`,
2156
- });
2157
- return {
2158
- filename,
2159
- blob,
2160
- };
2161
- }, (err) => {
2162
- throwError(err);
2163
- });
2164
- }
2165
- downloadOb(url, options, filename) {
2166
- return this.http.get(url, options).pipe(map((resp) => {
2167
- const { headers, body } = resp;
2168
- const contentType = headers.get('Content-Type');
2169
- const contentDisposition = headers.get('Content-Disposition');
2170
- if (contentDisposition) {
2171
- filename = contentDisposition
2172
- .split(';')[1]
2173
- .split('filename')[1]
2174
- .split('=')[1]
2175
- .trim()
2176
- .replace(new RegExp(/"/g), '');
2177
- }
2178
- const blob = new Blob([body], {
2179
- type: `${contentType}`,
2180
- });
2181
- return {
2182
- filename,
2183
- blob,
2184
- };
2185
- }), catchError((err) => {
2186
- return throwError(err);
2187
- }));
2188
- }
2189
- }
2190
- MonkeyEcxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxService, deps: [{ token: i1$4.HttpClient }, { token: MonkeyEcxHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
2191
- MonkeyEcxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxService, providedIn: 'root' });
2192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxService, decorators: [{
2193
- type: Injectable,
2194
- args: [{
2195
- providedIn: 'root',
2196
- }]
2197
- }], ctorParameters: function () { return [{ type: i1$4.HttpClient }, { type: MonkeyEcxHandlingService }]; } });
2198
-
2199
- let window$1;
2200
- const text = {
2201
- i18n: {
2202
- title: 'We have an quick update for you',
2203
- message: 'Click anywhere here to reload your locale',
2204
- },
2205
- theme: {
2206
- title: 'We have an quick update for you',
2207
- message: 'Click anywhere here to reload your theme',
2208
- },
2209
- };
2210
- class MonkeyEcxErrorConfigService {
2211
- constructor() {
2212
- // not to do
2213
- }
2214
- enableSupport() {
2215
- window$1.zE('webWidget', 'updateSettings', {
2216
- webWidget: {
2217
- color: {
2218
- theme: '#0273E8',
2219
- launcherText: '#fff',
2220
- header: '#0273E8',
2221
- button: '#0273E8',
2222
- },
2223
- zIndex: 99,
2224
- offset: {
2225
- horizontal: '1px',
2226
- vertical: '20px',
2227
- },
2228
- mobile: {
2229
- labelVisible: true,
2230
- },
2231
- launcher: {
2232
- mobile: {
2233
- labelVisible: true,
2234
- },
2235
- },
2236
- },
2237
- });
2238
- window$1.zE('webWidget', 'setLocale', 'en-US');
2239
- window$1.zE('webWidget', 'show');
2240
- }
2241
- apply(type) {
2242
- const { title, message } = text?.[type];
2243
- const element = document.createElement('div');
2244
- element.id = 'monkeyecx-information';
2245
- const elementImg = document.createElement('img');
2246
- elementImg.width = 128;
2247
- elementImg.src = 'assets/images/monkey.svg';
2248
- elementImg.style.marginBottom = '50px';
2249
- const elementTitle = document.createElement('span');
2250
- elementTitle.id = 'title';
2251
- elementTitle.innerText = title;
2252
- elementTitle.style.marginBottom = '20px';
2253
- const elementMessage = document.createElement('span');
2254
- elementMessage.id = 'message';
2255
- elementMessage.innerText = message;
2256
- elementMessage.style.marginBottom = '20px';
2257
- const elementChat = document.createElement('span');
2258
- elementChat.id = 'message';
2259
- elementChat.innerText =
2260
- "If you're having trouble to update, please use the support icon bellow";
2261
- element.appendChild(elementImg);
2262
- element.appendChild(elementTitle);
2263
- element.appendChild(elementMessage);
2264
- element.appendChild(elementChat);
2265
- element.addEventListener('click', () => {
2266
- document.location.reload();
2267
- });
2268
- document.body.appendChild(element);
2269
- document.body.getElementsByTagName('app-root')[0].remove();
2270
- this.enableSupport();
2271
- }
2272
- }
2273
- MonkeyEcxErrorConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2274
- MonkeyEcxErrorConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorConfigService, providedIn: 'root' });
2275
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorConfigService, decorators: [{
2276
- type: Injectable,
2277
- args: [{
2278
- providedIn: 'root',
2279
- }]
2280
- }], ctorParameters: function () { return []; } });
2281
-
2282
- class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
2283
- constructor(monkeyecxService, translateService, monkeyecxCookieStorageService, monkeyecxErrorConfigService) {
2284
- super(monkeyecxService);
2285
- this.translateService = translateService;
2286
- this.monkeyecxCookieStorageService = monkeyecxCookieStorageService;
2287
- this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
2288
- this.translateService.addLangs(['pt-BR', 'en-US']);
2289
- this.translateService.setDefaultLang('pt-BR');
2290
- this.translateService.use('pt-BR');
2291
- }
2292
- apply(params, environment, change = false) {
2293
- const { monkeyecxService, monkeyecxCookieStorageService, monkeyecxErrorConfigService } = this;
2294
- let { i18n } = params;
2295
- const externali18n = params?.externali18n?.[`${i18n?.lang || 'pt-BR'}`];
2296
- const cookie = monkeyecxCookieStorageService.getCookie('monkey-app-locale');
2297
- if (cookie && !change) {
2298
- i18n = JSON.parse(atob(cookie));
2299
- }
2300
- else {
2301
- monkeyecxCookieStorageService.setCookie('monkey-app-locale', btoa(JSON.stringify(i18n)));
2302
- if (!cookie)
2303
- change = true;
2304
- }
2305
- monkeyecxService?.get(`${environment.localAssets}/i18n/${i18n?.lang}.json`)?.subscribe((config) => {
2306
- const { lang } = config;
2307
- let { data } = config;
2308
- if (externali18n) {
2309
- data = {
2310
- ...data,
2311
- EXTERNAL: externali18n,
2312
- };
2313
- }
2314
- this.translateService.setTranslation(lang, data, true);
2315
- this.translateService.use(lang);
2316
- if (change)
2317
- document.location.reload();
2318
- }, (err) => {
2319
- console.error(`i18n ${i18n?.lang} not found!`);
2320
- monkeyecxErrorConfigService.apply('i18n');
2321
- throwError(err);
2322
- });
2323
- }
2324
- }
2325
- MonkeyEcxi18nConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxi18nConfigService, deps: [{ token: MonkeyEcxService }, { token: i1$1.TranslateService }, { token: MonkeyEcxCookieStorageService }, { token: MonkeyEcxErrorConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2326
- MonkeyEcxi18nConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxi18nConfigService, providedIn: 'root' });
2327
- __decorate([
2328
- MonkeyEcxCoreService({
2329
- httpResponse: {
2330
- httpCodeIgnore: [404],
2331
- },
2332
- requestInProgress: {
2333
- showProgress: false,
2334
- },
2335
- })
2336
- ], MonkeyEcxi18nConfigService.prototype, "apply", null);
2337
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxi18nConfigService, decorators: [{
2338
- type: Injectable,
2339
- args: [{
2340
- providedIn: 'root',
2341
- }]
2342
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: i1$1.TranslateService }, { type: MonkeyEcxCookieStorageService }, { type: MonkeyEcxErrorConfigService }]; }, propDecorators: { apply: [] } });
2343
-
2344
- class MonkeyEcxLogsConfigService {
2345
- apply(params, configBoostrap, environment, identifyCode) {
2346
- const { program, logs } = params;
2347
- if (logs?.enabled && environment.environment !== 'dev') {
2348
- datadogRum.init({
2349
- applicationId: environment?.dataDogApplicationId,
2350
- clientToken: environment?.dataDogClientToken,
2351
- service: program?.token,
2352
- site: 'datadoghq.com',
2353
- sampleRate: 100,
2354
- replaySampleRate: 100,
2355
- env: `monkey-front-${identifyCode}-${environment.environment}`,
2356
- version: configBoostrap?.version,
2357
- trackInteractions: true,
2358
- trackSessionAcrossSubdomains: true,
2359
- useSecureSessionCookie: true,
2360
- useCrossSiteSessionCookie: true
2361
- });
2362
- datadogRum.startSessionReplayRecording();
2363
- }
2364
- }
2365
- }
2366
- MonkeyEcxLogsConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLogsConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2367
- MonkeyEcxLogsConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLogsConfigService, providedIn: 'root' });
2368
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLogsConfigService, decorators: [{
2369
- type: Injectable,
2370
- args: [{
2371
- providedIn: 'root'
2372
- }]
2373
- }] });
2374
-
2375
- class MonkeyEcxServiceWorkerConfigService {
2376
- constructor(appRef, updates, modalService) {
2377
- this.appRef = appRef;
2378
- this.updates = updates;
2379
- this.modalService = modalService;
2380
- // not to do
2381
- }
2382
- handleValidation(config) {
2383
- const { updates, modalService } = this;
2384
- updates?.versionUpdates?.subscribe(() => {
2385
- if (!config.showNewVersion || config.maintenance.closed) {
2386
- document.location.reload();
2387
- }
2388
- else {
2389
- modalService.open(VersionChangedComponent, {
2390
- color: 'theme',
2391
- size: 'md'
2392
- });
2393
- }
2394
- });
2395
- }
2396
- verify() {
2397
- const { appRef, updates } = this;
2398
- const appIsStable$ = appRef.isStable
2399
- .pipe(first((isStable) => { return isStable === true; }));
2400
- const everyHour$ = interval(1 * 60 * 60 * 1000);
2401
- const everyHourOnceAppIsStable$ = concat(appIsStable$, everyHour$);
2402
- everyHourOnceAppIsStable$.subscribe(() => {
2403
- updates.checkForUpdate();
2404
- });
2405
- updates.checkForUpdate();
2406
- }
2407
- apply(config) {
2408
- this.handleValidation(config);
2409
- this.verify();
2410
- }
2411
- }
2412
- MonkeyEcxServiceWorkerConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, deps: [{ token: i0.ApplicationRef }, { token: i1$5.SwUpdate }, { token: i1.MonkeyStyleGuideModalService }], target: i0.ɵɵFactoryTarget.Injectable });
2413
- MonkeyEcxServiceWorkerConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, providedIn: 'root' });
2414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxServiceWorkerConfigService, decorators: [{
2415
- type: Injectable,
2416
- args: [{
2417
- providedIn: 'root'
2418
- }]
2419
- }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i1$5.SwUpdate }, { type: i1.MonkeyStyleGuideModalService }]; } });
2420
-
2421
- /* eslint-disable no-console */
2422
- class MonkeyEcxSecurityConsoleConfigService extends MonkeyEcxCommonsService {
2423
- constructor(translateService) {
2424
- super();
2425
- this.translateService = translateService;
2426
- this.geti18n(this.translateService, 'SERVICES.WARNING.CONSOLE');
2427
- }
2428
- handleValidation() {
2429
- this.__oni18nDataChanged$.subscribe(() => {
2430
- const { __i18n } = this;
2431
- const title = __i18n?.TITLE;
2432
- const message = __i18n?.MESSAGE;
2433
- if (title) {
2434
- console.log(`%c${title}`, 'background: #f2f061; color: #ff0000; font-size: x-large');
2435
- console.log(`%c${message}`, 'font-size: x-large');
2436
- console.log('%c __ __ _ ______ \n ' +
2437
- '| \\/ | ___ _ __ | | _____ _ _\\ \\ \\ \\ \n ' +
2438
- "| |\\/| |/ _ \\| '_ \\| |/ / _ \\ | | |\\ \\ \\ \\ \n " +
2439
- '| | | | (_) | | | | < __/ |_| |/ / / / \n ' +
2440
- '|_| |_|\\___/|_| |_|_|\\_\\___|\\__, /_/_/_/ \n ' +
2441
- ' |___/ \n ' +
2442
- 'Join us: https://monkeyecx.gupy.io', 'background: #1976d2; color: #fff');
2443
- }
2444
- });
2445
- }
2446
- apply() {
2447
- this.handleValidation();
2448
- }
2449
- }
2450
- MonkeyEcxSecurityConsoleConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityConsoleConfigService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
2451
- MonkeyEcxSecurityConsoleConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityConsoleConfigService, providedIn: 'root' });
2452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityConsoleConfigService, decorators: [{
2453
- type: Injectable,
2454
- args: [{
2455
- providedIn: 'root'
2456
- }]
2457
- }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; } });
2458
-
2459
- class MonkeyEcxMaintenanceConfigService {
2460
- constructor(modalService, router) {
2461
- this.modalService = modalService;
2462
- this.router = router;
2463
- // not to do
2464
- }
2465
- handleValidation(config) {
2466
- if (config.maintenance.closed) {
2467
- localStorage.clear();
2468
- this.router.navigate(['']);
2469
- setTimeout(() => {
2470
- this.modalService.open(ClosedToMaintenanceComponent, {
2471
- color: 'theme',
2472
- size: 'md',
2473
- data: config
2474
- });
2475
- }, 200);
2476
- }
2477
- }
2478
- apply(config) {
2479
- this.handleValidation(config);
2480
- }
2481
- }
2482
- MonkeyEcxMaintenanceConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxMaintenanceConfigService, deps: [{ token: i1.MonkeyStyleGuideModalService }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
2483
- MonkeyEcxMaintenanceConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxMaintenanceConfigService, providedIn: 'root' });
2484
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxMaintenanceConfigService, decorators: [{
2485
- type: Injectable,
2486
- args: [{
2487
- providedIn: 'root'
2488
- }]
2489
- }], ctorParameters: function () { return [{ type: i1.MonkeyStyleGuideModalService }, { type: i1$3.Router }]; } });
2490
-
2491
- class MonkeyEcxFeatureToggleService {
2492
- constructor() {
2493
- this.flagSubject$ = new BehaviorSubject(null);
2494
- this.flags = undefined;
2495
- this.ldClient = undefined;
2496
- // not to do
2497
- }
2498
- getAllFlags() {
2499
- if (!this)
2500
- return;
2501
- this.flags = this.ldClient?.allFlags();
2502
- this.flagSubject$.next(true);
2503
- }
2504
- identify(config, environment) {
2505
- if (config) {
2506
- const email = 'monkey@monkey.exchange';
2507
- const user = {
2508
- email,
2509
- key: `${config.program?.token}#${email}`,
2510
- };
2511
- if (!this.ldClient) {
2512
- this.ldClient = initialize(environment.launchDarklyClientSideID, user, {
2513
- streaming: true,
2514
- disableSyncEventPost: true,
2515
- sendEvents: false,
2516
- diagnosticOptOut: true,
2517
- });
2518
- this.ldClient.on('change', this.getAllFlags.bind(this));
2519
- this.ldClient.on('ready', this.getAllFlags.bind(this));
2520
- }
2521
- else {
2522
- this.ldClient.identify(user, undefined, this.getAllFlags);
2523
- }
2524
- }
2525
- }
2526
- apply(configSubject$, environment) {
2527
- if (environment.launchDarklyClientSideID) {
2528
- configSubject$.subscribe((config) => {
2529
- this.identify(config, environment);
2530
- });
2531
- }
2532
- else {
2533
- this.flagSubject$.next(true);
2534
- }
2535
- }
2536
- get onFlags() {
2537
- return this.flagSubject$.asObservable();
2538
- }
2539
- getFlag(flag) {
2540
- const flagValue = this.flags?.[flag];
2541
- return MonkeyUtils.persistNullEmptyUndefined(flagValue) ? flagValue : null;
2542
- }
2543
- }
2544
- MonkeyEcxFeatureToggleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureToggleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2545
- MonkeyEcxFeatureToggleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureToggleService, providedIn: 'root' });
2546
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureToggleService, decorators: [{
2547
- type: Injectable,
2548
- args: [{
2549
- providedIn: 'root',
2550
- }]
2551
- }], ctorParameters: function () { return []; } });
2552
-
2553
- class MonkeyEcxConfigService extends MonkeyEcxCommonsService {
2554
- constructor(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService) {
2555
- super(monkeyecxService);
2556
- this.monkeyecxi18nConfigService = monkeyecxi18nConfigService;
2557
- this.monkeyecxLogsConfigService = monkeyecxLogsConfigService;
2558
- this.monkeyStyleGuideSettingsService = monkeyStyleGuideSettingsService;
2559
- this.monkeyecxServiceWorkerConfigService = monkeyecxServiceWorkerConfigService;
2560
- this.monkeyecxSecurityConsoleConfigService = monkeyecxSecurityConsoleConfigService;
2561
- this.monkeyecxMaintenanceConfigService = monkeyecxMaintenanceConfigService;
2562
- this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
2563
- this.monkeyEcxFeatureToggleService = monkeyEcxFeatureToggleService;
2564
- this.configSubject$ = new BehaviorSubject({});
2565
- this.configBoostrapSubject$ = new BehaviorSubject({});
2566
- }
2567
- internalValidations(...args) {
2568
- const { monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, } = this;
2569
- const configBoostrap = args[0];
2570
- const callback = args[1];
2571
- monkeyecxSecurityConsoleConfigService.apply();
2572
- monkeyecxServiceWorkerConfigService.apply(configBoostrap);
2573
- monkeyecxMaintenanceConfigService.apply(configBoostrap);
2574
- callback(configBoostrap);
2575
- }
2576
- getWhiteLabelSettings(monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
2577
- const { monkeyecxService, monkeyecxi18nConfigService, configSubject$, monkeyStyleGuideSettingsService, monkeyecxLogsConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService, internalValidations, } = this;
2578
- const url = `${environment.urlAssets}`;
2579
- monkeyecxService
2580
- ?.get(`${url}/${monkeyecxCode.toLowerCase()}/white-label.json?t=${MonkeyUtils.getRandomString(30)}`)
2581
- ?.subscribe((config) => {
2582
- monkeyecxi18nConfigService.apply(config, environment);
2583
- monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
2584
- monkeyEcxFeatureToggleService.apply(configSubject$, environment);
2585
- monkeyStyleGuideSettingsService.boostrap(`${url}/${monkeyecxCode.toLowerCase()}/monkey-style-guide-settings.json?t=${MonkeyUtils.getRandomString(30)}`, internalValidations.bind(this, configBoostrap, callback, environment));
2586
- configSubject$.next(config);
2587
- }, (err) => {
2588
- monkeyecxErrorConfigService.apply('theme');
2589
- console.error('Program Configuration not found!');
2590
- throwError(err);
2591
- });
2592
- }
2593
- init(callback, environment, identifyCode, monkeyecxCode) {
2594
- const { monkeyecxService, configBoostrapSubject$, monkeyecxErrorConfigService } = this;
2595
- monkeyecxService
2596
- ?.get(`${environment.boostrapAssets}?t=${MonkeyUtils.getRandomString(30)}`, {
2597
- observe: 'response',
2598
- })
2599
- ?.subscribe((resp) => {
2600
- const { headers, body } = resp;
2601
- const monkeyCode = headers.get('monkey-code') || monkeyecxCode;
2602
- if (monkeyCode) {
2603
- this.getWhiteLabelSettings(monkeyCode, body, callback, environment, identifyCode);
2604
- configBoostrapSubject$.next(body);
2605
- }
2606
- else {
2607
- monkeyecxErrorConfigService.apply('theme');
2608
- console.error(`Boostrap ${monkeyCode} Configuration not found!`);
2609
- }
2610
- }, (err) => {
2611
- monkeyecxErrorConfigService.apply('theme');
2612
- console.error('Boostrap Configuration not found!');
2613
- throwError(err);
2614
- });
2615
- }
2616
- config() {
2617
- return this.configSubject$.asObservable();
2618
- }
2619
- boostrapConfig() {
2620
- return this.configBoostrapSubject$.asObservable();
2621
- }
2622
- }
2623
- MonkeyEcxConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxi18nConfigService }, { token: MonkeyEcxLogsConfigService }, { token: i1.MonkeyStyleGuideSettingsService }, { token: MonkeyEcxServiceWorkerConfigService }, { token: MonkeyEcxSecurityConsoleConfigService }, { token: MonkeyEcxMaintenanceConfigService }, { token: MonkeyEcxErrorConfigService }, { token: MonkeyEcxFeatureToggleService }], target: i0.ɵɵFactoryTarget.Injectable });
2624
- MonkeyEcxConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigService, providedIn: 'root' });
2625
- __decorate([
2626
- MonkeyEcxCoreService({
2627
- httpResponse: {
2628
- httpCodeIgnore: [404],
2629
- },
2630
- requestInProgress: {
2631
- showProgress: false,
2632
- },
2633
- })
2634
- ], MonkeyEcxConfigService.prototype, "init", null);
2635
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigService, decorators: [{
2636
- type: Injectable,
2637
- args: [{
2638
- providedIn: 'root',
2639
- }]
2640
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxi18nConfigService }, { type: MonkeyEcxLogsConfigService }, { type: i1.MonkeyStyleGuideSettingsService }, { type: MonkeyEcxServiceWorkerConfigService }, { type: MonkeyEcxSecurityConsoleConfigService }, { type: MonkeyEcxMaintenanceConfigService }, { type: MonkeyEcxErrorConfigService }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { init: [] } });
2641
-
2642
- class MonkeyEcxTokenStorageService {
2643
- constructor(monkeyecxConfigService) {
2644
- this.monkeyecxConfigService = monkeyecxConfigService;
2645
- this.config = null;
2646
- this.token = {
2647
- username: '',
2648
- program: '',
2649
- accessToken: '',
2650
- refreshToken: '',
2651
- companyId: '',
2652
- governmentId: '',
2653
- companyTypeUrl: '',
2654
- companyType: '',
2655
- programAdmin: false,
2656
- programType: '',
2657
- accessType: '',
2658
- role: '',
2659
- _clearIgnore: {
2660
- ignore: ['username', 'program', 'accessType'],
2661
- },
2662
- };
2663
- this.token$ = new BehaviorSubject(null);
2664
- this.me$ = new BehaviorSubject(null);
2665
- this.monkeyecxConfigService.config().subscribe((_) => {
2666
- this.config = _;
2667
- });
2668
- }
2669
- setAllTokens(token) {
2670
- const { token$ } = this;
2671
- Object.entries(token).forEach(([key, value]) => {
2672
- if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
2673
- localStorage.setItem(key, value);
2674
- }
2675
- });
2676
- token$.next(token);
2677
- }
2678
- getAllTokens() {
2679
- const { token, config } = this;
2680
- const handledToken = {
2681
- ...token,
2682
- };
2683
- Object.entries(token || {}).forEach(([key, value]) => {
2684
- handledToken[key] = localStorage.getItem(key);
2685
- });
2686
- if (!handledToken?.program && config?.program) {
2687
- handledToken.program = config?.program?.token;
2688
- }
2689
- return handledToken;
2690
- }
2691
- setAllMe(me) {
2692
- const { me$ } = this;
2693
- let previousMe = JSON.parse(localStorage?.getItem('me') || '{}');
2694
- Object.entries(me).forEach(([key, value]) => {
2695
- if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
2696
- previousMe = {
2697
- ...previousMe,
2698
- [key]: value,
2699
- };
2700
- }
2701
- });
2702
- localStorage.setItem('me', JSON.stringify(previousMe));
2703
- me$.next(previousMe);
2704
- }
2705
- getAllMe() {
2706
- const me = localStorage.getItem('me');
2707
- return JSON.parse(me || '{}');
2708
- }
2709
- tokenHasChanged() {
2710
- return this.token$.asObservable();
2711
- }
2712
- meHasChanged() {
2713
- return this.me$.asObservable() || null;
2714
- }
2715
- getToken() {
2716
- return this.getAllTokens();
2717
- }
2718
- getMe() {
2719
- return this.getAllMe();
2720
- }
2721
- setToken(token) {
2722
- this.setAllTokens(token);
2723
- }
2724
- setMe(me) {
2725
- this.setAllMe(me);
2726
- }
2727
- clear(force) {
2728
- const { token } = this;
2729
- try {
2730
- Object.entries(token || {}).forEach(([key, value]) => {
2731
- if ((token?._clearIgnore?.ignore || []).filter((val) => {
2732
- return val === key;
2733
- }).length <= 0 ||
2734
- force === true) {
2735
- localStorage.removeItem(key);
2736
- }
2737
- });
2738
- localStorage.removeItem('me');
2739
- }
2740
- catch (error) {
2741
- return of(false);
2742
- }
2743
- return of(true);
2744
- }
2745
- /**
2746
- * @param fields (the name of fields you want to clear. ie: ['companyId', 'role', ...])
2747
- */
2748
- clearCredentials(fields = ['companyId', 'governmentId', 'companyType', 'programAdmin', 'role']) {
2749
- fields?.forEach((key) => {
2750
- localStorage.removeItem(key);
2751
- });
2752
- }
2753
- }
2754
- MonkeyEcxTokenStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTokenStorageService, deps: [{ token: MonkeyEcxConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2755
- MonkeyEcxTokenStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTokenStorageService, providedIn: 'root' });
2756
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTokenStorageService, decorators: [{
2757
- type: Injectable,
2758
- args: [{
2759
- providedIn: 'root',
2760
- }]
2761
- }], ctorParameters: function () { return [{ type: MonkeyEcxConfigService }]; } });
2762
-
2763
- class MonkeyEcxSecurityDirective {
2764
- constructor(elementRef, tokenStorageService, cdr) {
2765
- this.elementRef = elementRef;
2766
- this.tokenStorageService = tokenStorageService;
2767
- this.cdr = cdr;
2768
- this.roles = [];
2769
- this.byExclusion = false;
2770
- this.tokenCredentials = null;
2771
- // not to do
2772
- }
2773
- getRole() {
2774
- const { tokenCredentials } = this;
2775
- if (!tokenCredentials)
2776
- return '';
2777
- if (tokenCredentials?.programAdmin === 'true') {
2778
- return 'PROGRAM_ADMIN';
2779
- }
2780
- return tokenCredentials?.role || '';
2781
- }
2782
- handleAccess() {
2783
- const { roles, byExclusion } = this;
2784
- let display = 'none';
2785
- const found = roles?.indexOf(this.getRole());
2786
- if (byExclusion) {
2787
- display = 'block';
2788
- if (found > -1) {
2789
- display = 'none';
2790
- }
2791
- }
2792
- else {
2793
- display = 'none';
2794
- if (found > -1) {
2795
- display = 'block';
2796
- }
2797
- }
2798
- if (!roles || roles.length === 0 || this.getRole() === 'PROGRAM_ADMIN')
2799
- display = 'block';
2800
- this.elementRef.nativeElement.style.display = display;
2801
- this.cdr.detectChanges();
2802
- }
2803
- ngOnInit() {
2804
- this.elementRef.nativeElement.style.display = 'none';
2805
- this.cdr.detectChanges();
2806
- this.tokenStorageService.tokenHasChanged().subscribe(() => {
2807
- this.tokenCredentials = this.tokenStorageService.getToken();
2808
- this.handleAccess();
2809
- });
2810
- this.tokenCredentials = this.tokenStorageService.getToken();
2811
- this.handleAccess();
2812
- }
2813
- }
2814
- MonkeyEcxSecurityDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityDirective, deps: [{ token: i0.ElementRef }, { token: MonkeyEcxTokenStorageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
2815
- MonkeyEcxSecurityDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxSecurityDirective, selector: "[monkeyecxSecurity]", inputs: { roles: ["securityRoles", "roles"], byExclusion: ["securityByExclusion", "byExclusion"] }, ngImport: i0 });
2816
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxSecurityDirective, decorators: [{
2817
- type: Directive,
2818
- args: [{
2819
- selector: '[monkeyecxSecurity]',
2820
- }]
2821
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MonkeyEcxTokenStorageService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { roles: [{
2822
- type: Input,
2823
- args: ['securityRoles']
2824
- }], byExclusion: [{
2825
- type: Input,
2826
- args: ['securityByExclusion']
2827
- }] } });
2828
-
2829
- class MonkeyEcxTooltipDirective {
2830
- constructor(el, renderer) {
2831
- this.el = el;
2832
- this.renderer = renderer;
2833
- this.enableToShow = true;
2834
- this.offset = 10;
2835
- this.tooltip = null;
2836
- // not to do
2837
- }
2838
- onMouseEnter() {
2839
- if (!this.tooltip) {
2840
- this.show();
2841
- }
2842
- }
2843
- onMouseLeave() {
2844
- if (this.tooltip) {
2845
- this.hide();
2846
- }
2847
- }
2848
- clickout() {
2849
- if (this.tooltip) {
2850
- this.hide();
2851
- }
2852
- }
2853
- show() {
2854
- if (this.enableToShow) {
2855
- this.create();
2856
- this.setPosition();
2857
- this.renderer.addClass(this.tooltip, 'monkeyecx-tooltip-show');
2858
- setTimeout(() => {
2859
- this.hide();
2860
- }, 5000);
2861
- }
2862
- }
2863
- hide() {
2864
- if (!this.tooltip)
2865
- return;
2866
- this.renderer.removeClass(this.tooltip, 'monkeyecx-tooltip-show');
2867
- this.renderer.removeChild(document.body, this.tooltip);
2868
- this.tooltip = null;
2869
- }
2870
- create() {
2871
- const tooltipElement = document.createElement('div');
2872
- this.tooltip = this.renderer.createElement('span');
2873
- if (this.tooltipTitle) {
2874
- const tooltipTitleElement = document.createElement('span');
2875
- tooltipTitleElement.innerText = `${this.tooltipTitle}`;
2876
- tooltipTitleElement.className = 'monkeyecx-tooltip-title';
2877
- tooltipElement.appendChild(tooltipTitleElement);
2878
- }
2879
- if (this.tooltipText) {
2880
- const tooltipTextElement = document.createElement('span');
2881
- tooltipTextElement.innerText = `${this.tooltipText}`;
2882
- tooltipTextElement.className = 'monkeyecx-tooltip-description';
2883
- tooltipElement.appendChild(tooltipTextElement);
2884
- }
2885
- this.renderer.appendChild(this.tooltip, tooltipElement);
2886
- this.renderer.appendChild(document.body, this.tooltip);
2887
- this.renderer.addClass(this.tooltip, 'monkeyecx-tooltip');
2888
- this.renderer.addClass(this.tooltip, `monkeyecx-tooltip-${this.tooltipPosition}`);
2889
- this.renderer.setStyle(this.tooltip, '-webkit-transition', `opacity ${this.tooltipDelay}ms`);
2890
- this.renderer.setStyle(this.tooltip, '-moz-transition', `opacity ${this.tooltipDelay}ms`);
2891
- this.renderer.setStyle(this.tooltip, '-o-transition', `opacity ${this.tooltipDelay}ms`);
2892
- this.renderer.setStyle(this.tooltip, 'transition', `opacity ${this.tooltipDelay}ms`);
2893
- }
2894
- setPosition() {
2895
- const hostPos = this.el.nativeElement.getBoundingClientRect();
2896
- const tooltipPos = this.tooltip?.getBoundingClientRect();
2897
- if (!tooltipPos)
2898
- return;
2899
- const scrollPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
2900
- let top = 0;
2901
- let left = 0;
2902
- if (this.tooltipPosition === 'top') {
2903
- top = hostPos.top - tooltipPos.height - this.offset;
2904
- left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
2905
- }
2906
- if (this.tooltipPosition === 'bottom') {
2907
- top = hostPos.bottom + this.offset;
2908
- left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
2909
- }
2910
- if (this.tooltipPosition === 'left') {
2911
- top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
2912
- left = hostPos.left - tooltipPos.width - this.offset;
2913
- }
2914
- if (this.tooltipPosition === 'right') {
2915
- top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
2916
- left = hostPos.right + this.offset;
2917
- }
2918
- this.renderer.setStyle(this.tooltip, 'top', `${top + scrollPos}px`);
2919
- this.renderer.setStyle(this.tooltip, 'left', `${left}px`);
2920
- }
2921
- }
2922
- MonkeyEcxTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
2923
- MonkeyEcxTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxTooltipDirective, selector: "[monkeyecxTooltip]", inputs: { tooltipDelay: "tooltipDelay", tooltipPosition: "tooltipPosition", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", enableToShow: "enableToShow" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "click": "clickout()" } }, ngImport: i0 });
2924
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxTooltipDirective, decorators: [{
2925
- type: Directive,
2926
- args: [{
2927
- selector: '[monkeyecxTooltip]',
2928
- }]
2929
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { tooltipDelay: [{
2930
- type: Input
2931
- }], tooltipPosition: [{
2932
- type: Input
2933
- }], tooltipText: [{
2934
- type: Input
2935
- }], tooltipTitle: [{
2936
- type: Input
2937
- }], enableToShow: [{
2938
- type: Input
2939
- }], onMouseEnter: [{
2940
- type: HostListener,
2941
- args: ['mouseenter']
2942
- }], onMouseLeave: [{
2943
- type: HostListener,
2944
- args: ['mouseleave']
2945
- }], clickout: [{
2946
- type: HostListener,
2947
- args: ['click']
2948
- }] } });
2949
-
2950
- class MonkeyEcxFeatureDirective {
2951
- constructor(cdr, elementRef, monkeyecxFeatureToggleService) {
2952
- this.cdr = cdr;
2953
- this.elementRef = elementRef;
2954
- this.monkeyecxFeatureToggleService = monkeyecxFeatureToggleService;
2955
- this.unsubscribeAll = new Subject();
2956
- // not to do
2957
- }
2958
- getFeature(feature) {
2959
- const { monkeyecxFeatureToggleService } = this;
2960
- if (!monkeyecxFeatureToggleService) {
2961
- return false;
2962
- }
2963
- return monkeyecxFeatureToggleService?.getFlag(feature) || false;
2964
- }
2965
- handleDisplay() {
2966
- if (!this.feature)
2967
- return;
2968
- const flag = this.getFeature(this.feature);
2969
- let display = 'none';
2970
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(flag)) {
2971
- return;
2972
- }
2973
- if (flag) {
2974
- display = 'block';
2975
- }
2976
- if (display === 'none') {
2977
- this.elementRef.nativeElement.remove();
2978
- }
2979
- this.elementRef.nativeElement.style.display = display;
2980
- this.cdr.detectChanges();
2981
- }
2982
- ngOnDestroy() {
2983
- this.unsubscribeAll.next();
2984
- this.unsubscribeAll.complete();
2985
- }
2986
- ngOnInit() {
2987
- if (!this.feature)
2988
- return;
2989
- this.elementRef.nativeElement.style.display = 'none';
2990
- this.cdr.detectChanges();
2991
- this.monkeyecxFeatureToggleService.onFlags
2992
- .pipe(takeUntil(this.unsubscribeAll))
2993
- .subscribe((val) => {
2994
- if (val) {
2995
- this.handleDisplay();
2996
- }
2997
- });
2998
- }
2999
- }
3000
- MonkeyEcxFeatureDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: MonkeyEcxFeatureToggleService }], target: i0.ɵɵFactoryTarget.Directive });
3001
- MonkeyEcxFeatureDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.2", type: MonkeyEcxFeatureDirective, selector: "[monkeyecxFeature]", inputs: { feature: ["featureName", "feature"] }, ngImport: i0 });
3002
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxFeatureDirective, decorators: [{
3003
- type: Directive,
3004
- args: [{
3005
- selector: '[monkeyecxFeature]',
3006
- }]
3007
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { feature: [{
3008
- type: Input,
3009
- args: ['featureName']
3010
- }] } });
3011
-
3012
- class MonkeyEcxDirectivesModule {
3013
- }
3014
- MonkeyEcxDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3015
- MonkeyEcxDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule, declarations: [MonkeyEcxDragDropDirective,
3016
- MonkeyEcxFormatCurrency,
3017
- MonkeyEcxFeatureDirective,
3018
- MonkeyEcxFormatUpper,
3019
- MonkeyEcxOnlyAlphaNumericDirective,
3020
- MonkeyEcxOnlyNumbersDirective,
3021
- MonkeyEcxSecurityDirective,
3022
- MonkeyEcxTooltipDirective], exports: [MonkeyEcxDragDropDirective,
3023
- MonkeyEcxFormatCurrency,
3024
- MonkeyEcxFeatureDirective,
3025
- MonkeyEcxFormatUpper,
3026
- MonkeyEcxOnlyAlphaNumericDirective,
3027
- MonkeyEcxOnlyNumbersDirective,
3028
- MonkeyEcxSecurityDirective,
3029
- MonkeyEcxTooltipDirective] });
3030
- MonkeyEcxDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule });
3031
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDirectivesModule, decorators: [{
3032
- type: NgModule,
3033
- args: [{
3034
- declarations: [
3035
- MonkeyEcxDragDropDirective,
3036
- MonkeyEcxFormatCurrency,
3037
- MonkeyEcxFeatureDirective,
3038
- MonkeyEcxFormatUpper,
3039
- MonkeyEcxOnlyAlphaNumericDirective,
3040
- MonkeyEcxOnlyNumbersDirective,
3041
- MonkeyEcxSecurityDirective,
3042
- MonkeyEcxTooltipDirective
3043
- ],
3044
- exports: [
3045
- MonkeyEcxDragDropDirective,
3046
- MonkeyEcxFormatCurrency,
3047
- MonkeyEcxFeatureDirective,
3048
- MonkeyEcxFormatUpper,
3049
- MonkeyEcxOnlyAlphaNumericDirective,
3050
- MonkeyEcxOnlyNumbersDirective,
3051
- MonkeyEcxSecurityDirective,
3052
- MonkeyEcxTooltipDirective
3053
- ]
3054
- }]
3055
- }] });
3056
-
3057
- /* eslint-disable no-console */
3058
- class MonkeyEcxAuthenticationService {
3059
- constructor() {
3060
- this.hadAtLeastOneLogin = () => {
3061
- console.error('hadAtLeastOneLogin needs to be declared!');
3062
- return null;
3063
- };
3064
- this.redirectApp = () => {
3065
- console.error('redirectApp needs to be declared!');
3066
- return null;
3067
- };
3068
- this.redirectLoginWelcomeBack = () => {
3069
- console.error('redirectLoginWelcomeBack needs to be declared!');
3070
- return null;
3071
- };
3072
- this.isAuthorized = () => {
3073
- console.error('isAuthorized needs to be declared!');
3074
- return false;
3075
- };
3076
- this.getRequestWithHeaders = (request) => {
3077
- console.error('getRequestWithHeaders needs to be declared!');
3078
- return null;
3079
- };
3080
- this.getRequestWithHeadersOb = (request) => {
3081
- console.error('getRequestWithHeadersOb needs to be declared!');
3082
- return null;
3083
- };
3084
- this.refreshShouldHappen = (response) => {
3085
- console.error('refreshShouldHappen needs to be declared!');
3086
- return false;
3087
- };
3088
- this.refreshToken = () => {
3089
- console.error('refreshToken needs to be declared!');
3090
- return null;
3091
- };
3092
- // not to do
3093
- }
3094
- init(args) {
3095
- this.hadAtLeastOneLogin = args?.hadAtLeastOneLogin || this.hadAtLeastOneLogin.bind(this);
3096
- this.redirectApp = args?.redirectApp || this.redirectApp.bind(this);
3097
- this.redirectLoginWelcomeBack = args?.redirectLoginWelcomeBack ||
3098
- this.redirectLoginWelcomeBack.bind(this);
3099
- this.isAuthorized = args?.isAuthorized || this.isAuthorized.bind(this);
3100
- this.getRequestWithHeaders = args?.getRequestWithHeaders ||
3101
- this.getRequestWithHeaders.bind(this);
3102
- this.getRequestWithHeadersOb = args?.getRequestWithHeadersOb.bind(this);
3103
- this.refreshShouldHappen = args?.refreshShouldHappen || this.refreshShouldHappen.bind(this);
3104
- this.refreshToken = args?.refreshToken || this.refreshToken.bind(this);
3105
- }
3106
- }
3107
- MonkeyEcxAuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthenticationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3108
- MonkeyEcxAuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthenticationService, providedIn: 'root' });
3109
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthenticationService, decorators: [{
3110
- type: Injectable,
3111
- args: [{
3112
- providedIn: 'root'
3113
- }]
3114
- }], ctorParameters: function () { return []; } });
3115
-
3116
- class MonkeyEcxAuthGuardLogin {
3117
- constructor(monkeyecxAuthenticationService) {
3118
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3119
- // not to do
3120
- }
3121
- canActivate() {
3122
- if (this.monkeyecxAuthenticationService.isAuthorized()) {
3123
- this.monkeyecxAuthenticationService.redirectApp();
3124
- return false;
3125
- }
3126
- if (this.monkeyecxAuthenticationService.hadAtLeastOneLogin()) {
3127
- this.monkeyecxAuthenticationService.redirectLoginWelcomeBack();
3128
- return false;
3129
- }
3130
- return true;
3131
- }
3132
- }
3133
- MonkeyEcxAuthGuardLogin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuardLogin, deps: [{ token: MonkeyEcxAuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
3134
- MonkeyEcxAuthGuardLogin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuardLogin, providedIn: 'root' });
3135
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuardLogin, decorators: [{
3136
- type: Injectable,
3137
- args: [{
3138
- providedIn: 'root'
3139
- }]
3140
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
3141
-
3142
- class MonkeyEcxAuthGuard {
3143
- constructor(monkeyecxAuthenticationService) {
3144
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3145
- // not to do
3146
- }
3147
- canActivate() {
3148
- const { monkeyecxAuthenticationService } = this;
3149
- if (monkeyecxAuthenticationService.isAuthorized()) {
3150
- return true;
3151
- }
3152
- monkeyecxAuthenticationService.redirectLoginWelcomeBack();
3153
- return false;
3154
- }
3155
- }
3156
- MonkeyEcxAuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuard, deps: [{ token: MonkeyEcxAuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
3157
- MonkeyEcxAuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuard, providedIn: 'root' });
3158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxAuthGuard, decorators: [{
3159
- type: Injectable,
3160
- args: [{
3161
- providedIn: 'root'
3162
- }]
3163
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
3164
-
3165
- class MonkeyEcxHttpErrorHandlingService extends MonkeyEcxCommonsService {
3166
- constructor(monkeyecxService, tokenStorage, monkeyecxAuthenticationService, router, snackbarService, translateService) {
3167
- super(monkeyecxService, tokenStorage);
3168
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3169
- this.router = router;
3170
- this.snackbarService = snackbarService;
3171
- this.translateService = translateService;
3172
- super.resolve(null, null);
3173
- this.geti18n(this.translateService, 'SERVICES.WARNING');
3174
- }
3175
- isHttpCodeIgnoreMessage(tp, httpCode) {
3176
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(tp) && !tp?.httpResponse) {
3177
- return false;
3178
- }
3179
- const found = (tp?.httpResponse?.httpCodeIgnore || [])?.indexOf(httpCode) > -1;
3180
- return found;
3181
- }
3182
- isHttpCodeIgnoreRedirect(tp, httpCode) {
3183
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(tp) && !tp?.httpResponse) {
3184
- return false;
3185
- }
3186
- const found = (tp?.httpResponse?.httpCodeIgnoreRedirect || [])?.indexOf(httpCode) > -1;
3187
- return found;
3188
- }
3189
- getMessageType(status) {
3190
- if (status === 409 || status === 400) {
3191
- return 'warning';
3192
- }
3193
- return 'error';
3194
- }
3195
- showMessage(message, error, mkc) {
3196
- const { snackbarService } = this;
3197
- if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
3198
- snackbarService.show({
3199
- title: this.__i18n?.TITLE,
3200
- message,
3201
- type: this.getMessageType(error.status),
3202
- duration: 4000,
3203
- horizontalPosition: 'center',
3204
- verticalPosition: 'top'
3205
- });
3206
- }
3207
- }
3208
- handleMessage(error, mkc) {
3209
- // eslint-disable-next-line camelcase
3210
- const { notifications, error_description, message } = error.error;
3211
- let customMessage = '';
3212
- if (message) {
3213
- customMessage = message;
3214
- }
3215
- // eslint-disable-next-line camelcase
3216
- if (error_description) {
3217
- // eslint-disable-next-line camelcase
3218
- customMessage = error_description;
3219
- }
3220
- if (notifications) {
3221
- customMessage = notifications;
3222
- }
3223
- if (!customMessage) {
3224
- if (error.error instanceof Blob) {
3225
- const blob = new Blob([error.error], {
3226
- type: 'application/json'
3227
- });
3228
- const reader = new FileReader();
3229
- reader.addEventListener('loadend', (e) => {
3230
- const text = e?.target?.result;
3231
- const jsonResp = JSON.parse(text);
3232
- customMessage = jsonResp.notifications;
3233
- this.showMessage(customMessage, error, mkc);
3234
- });
3235
- reader.readAsText(blob);
3236
- }
3237
- else {
3238
- this.showMessage(this.__i18n['ERROR-HANDLING']?.ERROR, error, mkc);
3239
- }
3240
- }
3241
- else {
3242
- this.showMessage(customMessage, error, mkc);
3243
- }
3244
- }
3245
- handleError(error, mkc) {
3246
- const { router } = this;
3247
- const { status } = error;
3248
- const routes = {
3249
- 403: 'forbidden',
3250
- 500: 'service-problems',
3251
- 503: 'service-problems'
3252
- };
3253
- const found = routes[status];
3254
- let timeout = 0;
3255
- if (found && !this.isHttpCodeIgnoreRedirect(mkc, error?.status)) {
3256
- const route = `/app/pages/${found}`.toLowerCase();
3257
- timeout = 800;
3258
- router.navigate([route]);
3259
- }
3260
- setTimeout(() => {
3261
- this.handleMessage(error, mkc);
3262
- }, timeout);
3263
- }
3264
- handleErrorRefreshToken(error, mkc) {
3265
- if (error.status === 401 || error.status === 400) {
3266
- NgZone.call(this.monkeyecxAuthenticationService.redirectLoginWelcomeBack(), {});
3267
- }
3268
- else if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
3269
- this.handleMessage(error, mkc);
3270
- }
3271
- }
3272
- }
3273
- MonkeyEcxHttpErrorHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpErrorHandlingService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxTokenStorageService }, { token: MonkeyEcxAuthenticationService }, { token: i1$3.Router }, { token: i1.MonkeyStyleGuideSnackbarService }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
3274
- MonkeyEcxHttpErrorHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpErrorHandlingService, providedIn: 'root' });
3275
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpErrorHandlingService, decorators: [{
3276
- type: Injectable,
3277
- args: [{
3278
- providedIn: 'root'
3279
- }]
3280
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxTokenStorageService }, { type: MonkeyEcxAuthenticationService }, { type: i1$3.Router }, { type: i1.MonkeyStyleGuideSnackbarService }, { type: i1$1.TranslateService }]; } });
3281
-
3282
- class MonkeyEcxOthersErrorsHandlingService {
3283
- constructor(modalService) {
3284
- this.modalService = modalService;
3285
- // not to do
3286
- }
3287
- handleError(error) {
3288
- const { modalService } = this;
3289
- const { message } = error;
3290
- if (new RegExp(/Loading chunk [\d]+ failed/).test(message)) {
3291
- modalService.open(VersionChangedComponent, {
3292
- color: 'theme',
3293
- size: 'md'
3294
- });
3295
- }
3296
- }
3297
- }
3298
- MonkeyEcxOthersErrorsHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOthersErrorsHandlingService, deps: [{ token: i1.MonkeyStyleGuideModalService }], target: i0.ɵɵFactoryTarget.Injectable });
3299
- MonkeyEcxOthersErrorsHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOthersErrorsHandlingService, providedIn: 'root' });
3300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxOthersErrorsHandlingService, decorators: [{
3301
- type: Injectable,
3302
- args: [{
3303
- providedIn: 'root'
3304
- }]
3305
- }], ctorParameters: function () { return [{ type: i1.MonkeyStyleGuideModalService }]; } });
3306
-
3307
- class MonkeyEcxErrorHandlingService {
3308
- constructor(injector) {
3309
- this.injector = injector;
3310
- // not to do
3311
- }
3312
- handleError(error, type) {
3313
- const { injector } = this;
3314
- const handlingService = injector.get(MonkeyEcxHandlingService);
3315
- const httpErrorHandlingService = injector.get(MonkeyEcxHttpErrorHandlingService);
3316
- const othersErrorsHandlingService = injector.get(MonkeyEcxOthersErrorsHandlingService);
3317
- console.log('======error');
3318
- console.log(error);
3319
- if (error instanceof HttpErrorResponse) {
3320
- const sCredentials = handlingService?.getMonkeyEcxServiceCredentials() || {};
3321
- if (MonkeyEcxUtils.persistNullEmptyUndefined(type) && type === 'refresh_token') {
3322
- httpErrorHandlingService.handleErrorRefreshToken(error, sCredentials);
3323
- }
3324
- else
3325
- httpErrorHandlingService.handleError(error, sCredentials);
3326
- }
3327
- else {
3328
- othersErrorsHandlingService.handleError(error);
3329
- }
3330
- }
3331
- }
3332
- MonkeyEcxErrorHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
3333
- MonkeyEcxErrorHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingService, providedIn: 'root' });
3334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingService, decorators: [{
3335
- type: Injectable,
3336
- args: [{
3337
- providedIn: 'root',
3338
- }]
3339
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
3340
-
3341
- class MonkeyEcxErrorHandlingModule {
3342
- static forRoot() {
3343
- return {
3344
- ngModule: MonkeyEcxErrorHandlingModule,
3345
- providers: [
3346
- {
3347
- provide: ErrorHandler,
3348
- useClass: MonkeyEcxErrorHandlingService,
3349
- },
3350
- ],
3351
- };
3352
- }
3353
- }
3354
- MonkeyEcxErrorHandlingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3355
- MonkeyEcxErrorHandlingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, imports: [CommonModule] });
3356
- MonkeyEcxErrorHandlingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, imports: [[CommonModule]] });
3357
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxErrorHandlingModule, decorators: [{
3358
- type: NgModule,
3359
- args: [{
3360
- imports: [CommonModule],
3361
- }]
3362
- }] });
3363
-
3364
- class MonkeyEcxHttpConfigErrorInterceptor {
3365
- constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
3366
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3367
- this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
3368
- // no to do
3369
- }
3370
- intercept(request, next) {
3371
- return next.handle(request).pipe(map((event) => {
3372
- return event;
3373
- }), catchError((error) => {
3374
- if (this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
3375
- return this.monkeyecxAuthenticationService?.refreshToken()?.pipe(take(1), map(() => {
3376
- return this.monkeyecxAuthenticationService.getRequestWithHeaders(request);
3377
- }), mergeMap((resp) => {
3378
- return next.handle(resp).pipe(catchError((error) => {
3379
- this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
3380
- return throwError(null);
3381
- }));
3382
- }), catchError((error) => {
3383
- this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
3384
- return throwError(null);
3385
- })) || throwError(error);
3386
- }
3387
- return throwError(error);
3388
- }));
3389
- }
3390
- }
3391
- MonkeyEcxHttpConfigErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
3392
- MonkeyEcxHttpConfigErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor });
3393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigErrorInterceptor, decorators: [{
3394
- type: Injectable
3395
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
3396
-
3397
- class MonkeyEcxHttpConfigHeaderInterceptor {
3398
- constructor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
3399
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3400
- this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
3401
- // not to do
3402
- }
3403
- intercept(request, next) {
3404
- return this.monkeyecxAuthenticationService?.getRequestWithHeadersOb(request)?.pipe(take(1), map((event) => {
3405
- return event;
3406
- }), mergeMap((resp) => {
3407
- request = request.clone({
3408
- setHeaders: resp
3409
- });
3410
- return next.handle(request);
3411
- }), catchError((error) => {
3412
- this.monkeyecxErrorHandlingService.handleError(error);
3413
- return throwError(error);
3414
- })) || throwError('getRequestWithHeadersOb undefined');
3415
- }
3416
- }
3417
- MonkeyEcxHttpConfigHeaderInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
3418
- MonkeyEcxHttpConfigHeaderInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor });
3419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigHeaderInterceptor, decorators: [{
3420
- type: Injectable
3421
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
3422
-
3423
- class MonkeyEcxRequestQueueHandlingService {
3424
- constructor() {
3425
- this.queue = [];
3426
- this.newQueue = new BehaviorSubject(false);
3427
- this.queues$ = new BehaviorSubject([]);
3428
- }
3429
- addToQueue(q) {
3430
- this.queue.push(q);
3431
- this.queues$.next(this.queue);
3432
- this.newQueue.next(true);
3433
- }
3434
- markQueueItemAsFinish(q, status, action) {
3435
- const saved = [...this.queue];
3436
- this.queue = [
3437
- ...saved.map((val) => {
3438
- const valSaved = {
3439
- ...val
3440
- };
3441
- if (val.status === MonkeyEcxQueueEvents.OnGoing) {
3442
- if (valSaved.item.id === q.item.id) {
3443
- return {
3444
- ...valSaved,
3445
- status: status || MonkeyEcxQueueEvents.Finished,
3446
- action
3447
- };
3448
- }
3449
- }
3450
- return valSaved;
3451
- })
3452
- ];
3453
- this.queues$.next(this.queue);
3454
- }
3455
- updateQueue(q, progress) {
3456
- const saved = [...this.queue];
3457
- this.queue = [
3458
- ...saved.map((val) => {
3459
- const valSaved = {
3460
- ...val
3461
- };
3462
- const { total, loaded } = progress;
3463
- const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
3464
- const totalPercentage = 100;
3465
- if (valSaved.item.id === q.item.id) {
3466
- return {
3467
- ...valSaved,
3468
- progress: {
3469
- loaded,
3470
- total,
3471
- currentPercentage: currentPecentage,
3472
- totalPercentage
3473
- }
3474
- };
3475
- }
3476
- return valSaved;
3477
- })
3478
- ];
3479
- this.queues$.next(this.queue);
3480
- }
3481
- deleteQueue(q) {
3482
- const saved = [...this.queue];
3483
- this.queue = [
3484
- ...saved.map((val) => {
3485
- const valSaved = {
3486
- ...val
3487
- };
3488
- if (valSaved.item.id === q.item.id) {
3489
- return null;
3490
- }
3491
- return valSaved;
3492
- })
3493
- ].filter((_) => {
3494
- return _;
3495
- });
3496
- this.queues$.next(this.queue);
3497
- }
3498
- setQueue(q) {
3499
- if (!q)
3500
- return;
3501
- this.addToQueue(q);
3502
- }
3503
- getQueue() {
3504
- return this.queues$.asObservable();
3505
- }
3506
- finishQueueItem(q, action, status) {
3507
- if (!q)
3508
- return;
3509
- this.markQueueItemAsFinish(q, status, action);
3510
- }
3511
- removeQueueItem(q) {
3512
- this.deleteQueue(q);
3513
- }
3514
- updateQueueItem(q, progress) {
3515
- this.updateQueue(q, progress);
3516
- }
3517
- hasNewQueue() {
3518
- return this.newQueue.pipe(map((_) => {
3519
- return _;
3520
- }));
3521
- }
3522
- }
3523
- MonkeyEcxRequestQueueHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3524
- MonkeyEcxRequestQueueHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueHandlingService, providedIn: 'root' });
3525
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueHandlingService, decorators: [{
3526
- type: Injectable,
3527
- args: [{
3528
- providedIn: 'root'
3529
- }]
3530
- }], ctorParameters: function () { return []; } });
3531
-
3532
- class MonkeyEcxRequestQueueModalHandlingService {
3533
- constructor() {
3534
- this.queue = [];
3535
- this.newQueue$ = new BehaviorSubject(false);
3536
- this.allQueueFinished$ = new BehaviorSubject(false);
3537
- this.queues$ = new BehaviorSubject([]);
3538
- }
3539
- addToQueue(q) {
3540
- this.queue.push(q);
3541
- this.queues$.next(this.queue);
3542
- this.newQueue$.next(true);
3543
- }
3544
- markQueueItemAsFinish(q, status, action) {
3545
- const saved = [...this.queue];
3546
- this.queue = [
3547
- ...saved.map((val) => {
3548
- const valSaved = {
3549
- ...val
3550
- };
3551
- if (val.status === MonkeyEcxQueueEvents.OnGoing) {
3552
- if (valSaved.item.id === q.item.id) {
3553
- return {
3554
- ...valSaved,
3555
- status: status || MonkeyEcxQueueEvents.Finished,
3556
- action
3557
- };
3558
- }
3559
- }
3560
- return valSaved;
3561
- })
3562
- ];
3563
- this.queues$.next(this.queue);
3564
- }
3565
- updateQueue(q, progress) {
3566
- const saved = [...this.queue];
3567
- this.queue = [
3568
- ...saved.map((val) => {
3569
- const valSaved = {
3570
- ...val
3571
- };
3572
- const { total, loaded } = progress;
3573
- const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
3574
- const totalPercentage = 100;
3575
- if (valSaved.item.id === q.item.id) {
3576
- return {
3577
- ...valSaved,
3578
- progress: {
3579
- loaded,
3580
- total,
3581
- currentPercentage: currentPecentage,
3582
- totalPercentage
3583
- }
3584
- };
3585
- }
3586
- return valSaved;
3587
- })
3588
- ];
3589
- this.queues$.next(this.queue);
3590
- }
3591
- deleteQueue(q) {
3592
- const saved = [...this.queue];
3593
- this.queue = [
3594
- ...saved.map((val) => {
3595
- const valSaved = {
3596
- ...val
3597
- };
3598
- if (valSaved.item.id === q.item.id) {
3599
- return null;
3600
- }
3601
- return valSaved;
3602
- })
3603
- ].filter((_) => {
3604
- return _;
3605
- });
3606
- this.queues$.next(this.queue);
3607
- if (this.queue.length <= 0) {
3608
- this.allQueueFinished$.next(true);
3609
- }
3610
- }
3611
- setQueue(q) {
3612
- this.addToQueue(q);
3613
- }
3614
- getQueue() {
3615
- return this.queues$.asObservable();
3616
- }
3617
- finishQueueItem(q, action, status) {
3618
- this.markQueueItemAsFinish(q, status, action);
3619
- }
3620
- removeQueueItem(q) {
3621
- this.deleteQueue(q);
3622
- }
3623
- updateQueueItem(q, progress) {
3624
- this.updateQueue(q, progress);
3625
- }
3626
- hasNewQueue() {
3627
- return this.newQueue$.pipe(map((_) => {
3628
- return _;
3629
- }));
3630
- }
3631
- hasAllQueueFinished() {
3632
- return this.allQueueFinished$.pipe(map((_) => {
3633
- return _;
3634
- }));
3635
- }
3636
- }
3637
- MonkeyEcxRequestQueueModalHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueModalHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3638
- MonkeyEcxRequestQueueModalHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueModalHandlingService, providedIn: 'root' });
3639
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestQueueModalHandlingService, decorators: [{
3640
- type: Injectable,
3641
- args: [{
3642
- providedIn: 'root'
3643
- }]
3644
- }], ctorParameters: function () { return []; } });
3645
-
3646
- /* eslint-disable max-len */
3647
- class MonkeyEcxHttpConfigQueueInterceptor {
3648
- constructor(injector, monkeyecxRequestQueueHandlingService) {
3649
- this.injector = injector;
3650
- this.monkeyecxRequestQueueHandlingService = monkeyecxRequestQueueHandlingService;
3651
- // not to do
3652
- }
3653
- intercept(request, next) {
3654
- const { injector, isQueueProperty } = this;
3655
- const monkeyecxHandlingService = injector.get(MonkeyEcxHandlingService);
3656
- const monkeyecxRequestQueue = monkeyecxHandlingService?.getMonkeyEcxRequestQueue();
3657
- if (isQueueProperty(monkeyecxRequestQueue)) {
3658
- this.monkeyecxRequestQueueHandlingService.setQueue(monkeyecxRequestQueue);
3659
- }
3660
- return next.handle(request).pipe(finalize(() => {
3661
- if (isQueueProperty(monkeyecxRequestQueue)) {
3662
- this.monkeyecxRequestQueueHandlingService.finishQueueItem(monkeyecxRequestQueue);
3663
- }
3664
- }));
3665
- }
3666
- isQueueProperty(mrq) {
3667
- return (MonkeyEcxUtils.persistNullEmptyUndefined(mrq) &&
3668
- MonkeyEcxUtils.persistNullEmptyUndefined(mrq?.item?.name));
3669
- }
3670
- }
3671
- MonkeyEcxHttpConfigQueueInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, deps: [{ token: i0.Injector }, { token: MonkeyEcxRequestQueueHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
3672
- MonkeyEcxHttpConfigQueueInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor });
3673
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigQueueInterceptor, decorators: [{
3674
- type: Injectable
3675
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: MonkeyEcxRequestQueueHandlingService }]; } });
3676
-
3677
- /* eslint-disable max-len */
3678
- class MonkeyEcxHttpConfigLoadingInProgressInterceptor {
3679
- constructor(injector) {
3680
- this.injector = injector;
3681
- // no to do
3682
- }
3683
- intercept(request, next) {
3684
- const { injector, isLoadingInProgressProperty } = this;
3685
- const handlingService = injector.get(MonkeyEcxHandlingService);
3686
- const progressBarService = injector.get(MonkeyEcxProgressBarService);
3687
- const inProgress = handlingService?.getMonkeyEcxServiceCredentials()
3688
- ? handlingService?.getMonkeyEcxServiceCredentials()?.requestInProgress || null
3689
- : null;
3690
- if (isLoadingInProgressProperty(inProgress)) {
3691
- progressBarService.show();
3692
- }
3693
- return next.handle(request).pipe(finalize(() => {
3694
- if (isLoadingInProgressProperty(inProgress)) {
3695
- progressBarService.hide();
3696
- }
3697
- }));
3698
- }
3699
- isLoadingInProgressProperty(mlp) {
3700
- if (!mlp)
3701
- return false;
3702
- return MonkeyEcxUtils.persistNullEmptyUndefined(mlp) &&
3703
- MonkeyEcxUtils.persistNullEmptyUndefined(mlp.showProgress)
3704
- ? mlp.showProgress
3705
- : true;
3706
- }
3707
- }
3708
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
3709
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor });
3710
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, decorators: [{
3711
- type: Injectable
3712
- }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
3713
-
3714
- class MonkeyEcxHttpConfigInterceptorModule {
3715
- static forRoot() {
3716
- return {
3717
- ngModule: MonkeyEcxHttpConfigInterceptorModule,
3718
- providers: [
3719
- {
3720
- provide: HTTP_INTERCEPTORS,
3721
- useClass: MonkeyEcxHttpConfigHeaderInterceptor,
3722
- multi: true,
3723
- },
3724
- {
3725
- provide: HTTP_INTERCEPTORS,
3726
- useClass: MonkeyEcxHttpConfigErrorInterceptor,
3727
- multi: true,
3728
- },
3729
- {
3730
- provide: HTTP_INTERCEPTORS,
3731
- useClass: MonkeyEcxHttpConfigQueueInterceptor,
3732
- multi: true,
3733
- },
3734
- {
3735
- provide: HTTP_INTERCEPTORS,
3736
- useClass: MonkeyEcxHttpConfigLoadingInProgressInterceptor,
3737
- multi: true,
3738
- },
3739
- ],
3740
- };
3741
- }
3742
- }
3743
- MonkeyEcxHttpConfigInterceptorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3744
- MonkeyEcxHttpConfigInterceptorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [CommonModule] });
3745
- MonkeyEcxHttpConfigInterceptorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, imports: [[CommonModule]] });
3746
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxHttpConfigInterceptorModule, decorators: [{
3747
- type: NgModule,
3748
- args: [{
3749
- imports: [CommonModule],
3750
- }]
3751
- }] });
3752
-
3753
- class MonkeyEcxModel {
3754
- getAction(type) {
3755
- const { _links } = this;
3756
- if (!_links)
3757
- return null;
3758
- const link = _links[type.toLowerCase()];
3759
- return link;
3760
- }
3761
- }
3762
-
3763
- /* eslint-disable indent */
3764
- class MonkeyEcxConfigModule {
3765
- constructor(parentModule) {
3766
- if (parentModule) {
3767
- throw new Error('MonkeyEcxConfigModule is already loaded. Import it in the AppModule only!');
3768
- }
3769
- }
3770
- static forRoot() {
3771
- return {
3772
- ngModule: MonkeyEcxConfigModule,
3773
- providers: [MonkeyEcxConfigService]
3774
- };
3775
- }
3776
- }
3777
- MonkeyEcxConfigModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule, deps: [{ token: MonkeyEcxConfigModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
3778
- MonkeyEcxConfigModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule });
3779
- MonkeyEcxConfigModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule });
3780
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxConfigModule, decorators: [{
3781
- type: NgModule
3782
- }], ctorParameters: function () { return [{ type: MonkeyEcxConfigModule, decorators: [{
3783
- type: Optional
3784
- }, {
3785
- type: SkipSelf
3786
- }] }]; } });
3787
-
3788
- class MonkeyEcxLoggedHandlingService {
3789
- constructor() {
3790
- this.schedules = [];
3791
- // not to do
3792
- }
3793
- destroySchedule() {
3794
- this.schedules.forEach((sch) => {
3795
- clearInterval(sch.interval);
3796
- });
3797
- this.schedules = [];
3798
- }
3799
- addSchedule(sch) {
3800
- this.schedules = sch;
3801
- }
3802
- destroy() {
3803
- this.destroySchedule();
3804
- }
3805
- }
3806
- MonkeyEcxLoggedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLoggedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3807
- MonkeyEcxLoggedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLoggedHandlingService, providedIn: 'root' });
3808
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxLoggedHandlingService, decorators: [{
3809
- type: Injectable,
3810
- args: [{
3811
- providedIn: 'root'
3812
- }]
3813
- }], ctorParameters: function () { return []; } });
3814
-
3815
- class MonkeyEcxRequestDownloadHandlingService {
3816
- constructor() {
3817
- this.download = [];
3818
- this.download$ = new BehaviorSubject([]);
3819
- }
3820
- addTo(q) {
3821
- this.download.push(q);
3822
- this.download$.next(this.download);
3823
- }
3824
- markItemAsFinish(q, status) {
3825
- const saved = [...this.download];
3826
- this.download = [
3827
- ...saved
3828
- .map((val) => {
3829
- if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
3830
- const valSaved = {
3831
- ...val
3832
- };
3833
- if (valSaved.item.id === q.item.id) {
3834
- return {
3835
- ...valSaved,
3836
- status: status || MonkeyEcxDownloadEvents.Finished
3837
- };
3838
- }
3839
- return valSaved;
3840
- }
3841
- return null;
3842
- })
3843
- .filter((_) => {
3844
- return _;
3845
- })
3846
- ];
3847
- this.download = this.download.filter((_) => {
3848
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
3849
- });
3850
- this.download$.next(this.download);
3851
- }
3852
- updateItem(q, loaded, total) {
3853
- const saved = [...this.download];
3854
- this.download = [
3855
- ...saved.map((val) => {
3856
- const valSaved = {
3857
- ...val
3858
- };
3859
- const currentPecentage = Math.floor(((loaded || 0) / (total || 0)) * 100);
3860
- const totalPercentage = 100;
3861
- if (valSaved.item.id === q.item.id) {
3862
- return {
3863
- ...valSaved,
3864
- loaded,
3865
- total,
3866
- currentPercentage: currentPecentage,
3867
- totalPercentage
3868
- };
3869
- }
3870
- return valSaved;
3871
- })
3872
- ];
3873
- this.download$.next(this.download);
3874
- }
3875
- set(q) {
3876
- this.addTo(q);
3877
- }
3878
- get() {
3879
- return this.download$.asObservable();
3880
- }
3881
- update(q, loaded, total) {
3882
- this.updateItem(q, loaded, total);
3883
- }
3884
- finishItem(q, status) {
3885
- this.markItemAsFinish(q, status);
3886
- }
3887
- hasDownloadOnGoing() {
3888
- const found = this.download.find((_) => {
3889
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
3890
- });
3891
- return MonkeyEcxUtils.persistNullEmptyUndefined(found);
3892
- }
3893
- }
3894
- MonkeyEcxRequestDownloadHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3895
- MonkeyEcxRequestDownloadHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, providedIn: 'root' });
3896
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadHandlingService, decorators: [{
3897
- type: Injectable,
3898
- args: [{
3899
- providedIn: 'root'
3900
- }]
3901
- }], ctorParameters: function () { return []; } });
3902
-
3903
- class MonkeyEcxRequestDownloadedHandlingService {
3904
- constructor() {
3905
- this.downloaded = [];
3906
- this.downloaded$ = new BehaviorSubject([]);
3907
- }
3908
- addTo(q) {
3909
- this.downloaded.push(q);
3910
- this.downloaded$.next(this.downloaded);
3911
- }
3912
- markItemAsFinish(q, status) {
3913
- const saved = [...this.downloaded];
3914
- this.downloaded = [
3915
- ...saved.map((val) => {
3916
- if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
3917
- const valSaved = {
3918
- ...val
3919
- };
3920
- if (valSaved.item.id === q.item.id) {
3921
- return {
3922
- ...valSaved,
3923
- status: status || MonkeyEcxDownloadEvents.Finished,
3924
- action: q.action
3925
- };
3926
- }
3927
- return valSaved;
3928
- }
3929
- return val;
3930
- })
3931
- ];
3932
- this.downloaded$.next(this.downloaded);
3933
- }
3934
- set(q) {
3935
- this.addTo(q);
3936
- }
3937
- get() {
3938
- return this.downloaded$.asObservable();
3939
- }
3940
- finishItem(q, status) {
3941
- this.markItemAsFinish(q, status);
3942
- }
3943
- hasDownloadOnGoing() {
3944
- const found = this.downloaded.find((_) => {
3945
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
3946
- });
3947
- return MonkeyEcxUtils.persistNullEmptyUndefined(found);
3948
- }
3949
- }
3950
- MonkeyEcxRequestDownloadedHandlingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3951
- MonkeyEcxRequestDownloadedHandlingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, providedIn: 'root' });
3952
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestDownloadedHandlingService, decorators: [{
3953
- type: Injectable,
3954
- args: [{
3955
- providedIn: 'root'
3956
- }]
3957
- }], ctorParameters: function () { return []; } });
3958
-
3959
- class MonkeyEcxDiscoveryParamsService {
3960
- constructor(router) {
3961
- this.router = router;
3962
- // not to do
3963
- }
3964
- getLastChild(route) {
3965
- if (route.firstChild) {
3966
- return this.getLastChild(route.firstChild);
3967
- }
3968
- return route;
3969
- }
3970
- setData(field, value) {
3971
- const { root } = this.router.routerState.snapshot;
3972
- const route = this.getLastChild(root);
3973
- route.data[field] = value;
3974
- }
3975
- getData(field) {
3976
- const { root } = this.router.routerState.snapshot;
3977
- const route = this.getLastChild(root);
3978
- const found = MonkeyEcxUtils.persistNullEmptyUndefined(route) ? route.data[field] : null;
3979
- return found;
3980
- }
3981
- getDataFromCurrentNavigation(field) {
3982
- const navigation = this.router.getCurrentNavigation();
3983
- let state = null;
3984
- if (MonkeyEcxUtils.persistNullEmptyUndefined(navigation)) {
3985
- state = navigation?.extras.state;
3986
- }
3987
- return state ? state[field] : null;
3988
- }
3989
- getParam(param) {
3990
- const { root } = this.router.routerState.snapshot;
3991
- const route = this.getLastChild(root);
3992
- let found = MonkeyEcxUtils.persistNullEmptyUndefined(route)
3993
- ? route?.paramMap?.get(param) || ''
3994
- : '';
3995
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(found))
3996
- found = this.getData(param);
3997
- return found;
3998
- }
3999
- }
4000
- MonkeyEcxDiscoveryParamsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, deps: [{ token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
4001
- MonkeyEcxDiscoveryParamsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, providedIn: 'root' });
4002
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxDiscoveryParamsService, decorators: [{
4003
- type: Injectable,
4004
- args: [{
4005
- providedIn: 'root'
4006
- }]
4007
- }], ctorParameters: function () { return [{ type: i1$3.Router }]; } });
4008
-
4009
- class MonkeyEcxRequestScheduleService {
4010
- constructor(monkeyecxService, monkeyecxLoggedHandlingService) {
4011
- this.monkeyecxService = monkeyecxService;
4012
- this.monkeyecxLoggedHandlingService = monkeyecxLoggedHandlingService;
4013
- this.schedule = [];
4014
- // not to do
4015
- }
4016
- addToSchedule(q) {
4017
- this.schedule.push(q);
4018
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4019
- }
4020
- removeFromSchedule(q) {
4021
- clearInterval(q.interval);
4022
- const saved = [...this.schedule];
4023
- this.schedule = [
4024
- ...saved.map((sch) => {
4025
- const savedLocal = {
4026
- ...sch,
4027
- };
4028
- if (sch.id === q.id) {
4029
- return null;
4030
- }
4031
- return savedLocal;
4032
- }),
4033
- ].filter((_) => {
4034
- return _;
4035
- });
4036
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4037
- }
4038
- removeFromScheduleById(id) {
4039
- const q = this.getScheduleById(id);
4040
- clearInterval(q.interval);
4041
- const saved = [...this.schedule];
4042
- this.schedule = [
4043
- ...saved.map((sch) => {
4044
- const savedLocal = {
4045
- ...sch,
4046
- };
4047
- if (sch.id === q.id) {
4048
- return null;
4049
- }
4050
- return savedLocal;
4051
- }),
4052
- ].filter((_) => {
4053
- return _;
4054
- });
4055
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4056
- }
4057
- doCall(sch) {
4058
- const { url, method, params, data, action } = sch;
4059
- this.monkeyecxService[method.toLowerCase()](`${url}`, params).subscribe((resp) => {
4060
- action({
4061
- ...data,
4062
- ...resp,
4063
- }, sch);
4064
- }, () => {
4065
- this.removeFromSchedule(sch);
4066
- });
4067
- }
4068
- setSchedule(q, delay = 3000) {
4069
- const interval = setInterval(() => {
4070
- this.doCall({
4071
- ...q,
4072
- interval,
4073
- });
4074
- }, delay);
4075
- const sch = {
4076
- ...q,
4077
- id: `${MonkeyEcxUtils.getRandomString(40)}`,
4078
- interval,
4079
- };
4080
- this.addToSchedule(sch);
4081
- return sch;
4082
- }
4083
- removeSchedule(q) {
4084
- this.removeFromSchedule(q);
4085
- }
4086
- removeScheduleById(id) {
4087
- this.removeFromScheduleById(id);
4088
- }
4089
- getScheduleById(id) {
4090
- const q = this.schedule.find((sch) => {
4091
- return sch.id === id;
4092
- });
4093
- return q;
4094
- }
4095
- }
4096
- MonkeyEcxRequestScheduleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestScheduleService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxLoggedHandlingService }], target: i0.ɵɵFactoryTarget.Injectable });
4097
- MonkeyEcxRequestScheduleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestScheduleService, providedIn: 'root' });
4098
- __decorate([
4099
- MonkeyEcxCoreService({
4100
- httpResponse: {
4101
- httpCodeIgnore: [400, 403, 404, 500, 503],
4102
- },
4103
- requestInProgress: {
4104
- showProgress: false,
4105
- },
4106
- })
4107
- ], MonkeyEcxRequestScheduleService.prototype, "doCall", null);
4108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyEcxRequestScheduleService, decorators: [{
4109
- type: Injectable,
4110
- args: [{
4111
- providedIn: 'root',
4112
- }]
4113
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [] } });
4114
-
4115
- /* eslint-disable no-unused-vars */
4116
- var OpSearch;
4117
- (function (OpSearch) {
4118
- OpSearch["LIKE"] = ":*:value*";
4119
- OpSearch["BETWEEN"] = ":first AND :last";
4120
- OpSearch["OR"] = "OR";
4121
- OpSearch["AND"] = "AND";
4122
- OpSearch["GT"] = ">:value";
4123
- OpSearch["LT"] = "<:value";
4124
- OpSearch["EQUAL"] = "::value";
4125
- })(OpSearch || (OpSearch = {}));
4126
- class MonkeyEcxSpecificationSearch {
4127
- constructor() {
4128
- // not to do
4129
- }
4130
- handleValue(value) {
4131
- return Object.entries(value).map(([key, value1]) => {
4132
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(value1)) {
4133
- return null;
4134
- }
4135
- if (Array.isArray(value1)) {
4136
- if (key === OpSearch.BETWEEN) {
4137
- return `${key}`.replace(':first', value1[0]).replace(':last', value1[1]);
4138
- }
4139
- }
4140
- return `${key}`.replace(':value', `${value1}`);
4141
- })[0];
4142
- }
4143
- queryVisitor(value) {
4144
- const okay = Object.entries(value).map(([key1, value1]) => {
4145
- if (key1 === OpSearch.OR || key1 === OpSearch.AND) {
4146
- const join = value1
4147
- .map((_) => {
4148
- return Object.entries(_).map(([key2, value2]) => {
4149
- if (value2 instanceof Object) {
4150
- value2 = this.handleValue(value2);
4151
- }
4152
- return this.criteriaParser(key2, value2);
4153
- })[0];
4154
- })
4155
- .filter((_) => {
4156
- return _;
4157
- })
4158
- .join(` ${key1} `);
4159
- return `${join ? `(${join})` : ''}`;
4160
- }
4161
- if (value1 instanceof Object) {
4162
- value1 = this.handleValue(value1);
4163
- }
4164
- return this.criteriaParser(key1, value1);
4165
- });
4166
- return okay
4167
- .filter((_) => {
4168
- return _;
4169
- })
4170
- .join(' AND ');
4171
- }
4172
- criteriaParser(key, value) {
4173
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
4174
- return '';
4175
- }
4176
- if (value instanceof Object) {
4177
- return this.queryVisitor(value);
4178
- }
4179
- return `${key}${value}`;
4180
- }
4181
- build(spec) {
4182
- try {
4183
- return this.queryVisitor(spec);
4184
- }
4185
- catch (e) {
4186
- throw new Error(`MonkeyEcxSpecificationSearch Error ${e}`);
4187
- }
4188
- }
4189
- buildMoreThanOne(field, op = OpSearch.EQUAL) {
4190
- let self = this;
4191
- try {
4192
- if (!self[field])
4193
- return [];
4194
- const filters = self[field]?.split(',')?.map((filter) => {
4195
- if (!filter)
4196
- return null;
4197
- return {
4198
- [field]: {
4199
- [op]: `${filter}`
4200
- }
4201
- };
4202
- }).filter((val) => { return val; });
4203
- return filters || [];
4204
- }
4205
- catch (e) {
4206
- throw new Error(`MonkeyEcxSpecificationSearch Error ${e}`);
4207
- }
4208
- }
4209
- }
4210
-
4211
- class MonkeyFrontCoreModuleModule {
4212
- }
4213
- MonkeyFrontCoreModuleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4214
- MonkeyFrontCoreModuleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, imports: [CommonModule,
4215
- HttpClientModule, i1$1.TranslateModule, MonkeyEcxConfigModule, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxErrorHandlingModule, MonkeyStyleGuideModule, i1$5.ServiceWorkerModule, ClosedToMaintenanceModule,
4216
- VersionChangedModule] });
4217
- MonkeyFrontCoreModuleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, providers: [
4218
- MonkeyStyleGuideModalService,
4219
- MonkeyStyleGuideSettingsService,
4220
- MonkeyStyleGuideSnackbarService
4221
- ], imports: [[
4222
- CommonModule,
4223
- HttpClientModule,
4224
- TranslateModule.forRoot(),
4225
- MonkeyEcxConfigModule.forRoot(),
4226
- MonkeyEcxHttpConfigInterceptorModule.forRoot(),
4227
- MonkeyEcxErrorHandlingModule.forRoot(),
4228
- MonkeyStyleGuideModule,
4229
- ServiceWorkerModule.register('ngsw-worker.js'),
4230
- ClosedToMaintenanceModule,
4231
- VersionChangedModule
4232
- ]] });
4233
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: MonkeyFrontCoreModuleModule, decorators: [{
4234
- type: NgModule,
4235
- args: [{
4236
- imports: [
4237
- CommonModule,
4238
- HttpClientModule,
4239
- TranslateModule.forRoot(),
4240
- MonkeyEcxConfigModule.forRoot(),
4241
- MonkeyEcxHttpConfigInterceptorModule.forRoot(),
4242
- MonkeyEcxErrorHandlingModule.forRoot(),
4243
- MonkeyStyleGuideModule,
4244
- ServiceWorkerModule.register('ngsw-worker.js'),
4245
- ClosedToMaintenanceModule,
4246
- VersionChangedModule
4247
- ],
4248
- providers: [
4249
- MonkeyStyleGuideModalService,
4250
- MonkeyStyleGuideSettingsService,
4251
- MonkeyStyleGuideSnackbarService
4252
- ]
4253
- }]
4254
- }] });
4255
-
4256
- /*
4257
- * Public API Surface of monkey-front-core
4258
- */
4259
-
4260
- /**
4261
- * Generated bundle index. Do not edit.
4262
- */
4263
-
4264
- export { ClosedToMaintenanceComponent, ClosedToMaintenanceModule, decoratorsUtils as DecoratorsUtils, MonkeyEcxAuthGuard, MonkeyEcxAuthGuardLogin, MonkeyEcxAuthenticationService, MonkeyEcxCommonsService, MonkeyEcxConfigModule, MonkeyEcxConfigService, MonkeyEcxCookieStorageService, MonkeyEcxCoreCharts, MonkeyEcxCoreClearDecorators, MonkeyEcxCoreLog, MonkeyEcxCoreService, MonkeyEcxCoreServiceConstructor, MonkeyEcxCoreServicePaged, MonkeyEcxCoreServiceQueue, MonkeyEcxDirectivesModule, MonkeyEcxDiscoveryParamsService, MonkeyEcxDisplayFirstNamePipe, MonkeyEcxDragDropDirective, MonkeyEcxErrorConfigService, MonkeyEcxErrorHandlingModule, MonkeyEcxErrorHandlingService, MonkeyEcxFeatureDirective, MonkeyEcxFeatureToggleService, MonkeyEcxFormatAddressPipe, MonkeyEcxFormatCurrency, MonkeyEcxFormatCurrencyPipe, MonkeyEcxFormatDateGroupPipe, MonkeyEcxFormatDateTimelapsePipe, MonkeyEcxFormatDocumentPipe, MonkeyEcxFormatDocumentTypePipe, MonkeyEcxFormatNumberPipe, MonkeyEcxFormatPhonePipe, MonkeyEcxFormatSizePipe, MonkeyEcxFormatUpper, MonkeyEcxFormatValue, MonkeyEcxFormatZipCodePipe, MonkeyEcxHandlingService, MonkeyEcxHttpConfigErrorInterceptor, MonkeyEcxHttpConfigHeaderInterceptor, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxHttpConfigLoadingInProgressInterceptor, MonkeyEcxHttpConfigQueueInterceptor, MonkeyEcxHttpErrorHandlingService, MonkeyEcxLoggedHandlingService, MonkeyEcxLogsConfigService, MonkeyEcxMaintenanceConfigService, MonkeyEcxModel, MonkeyEcxOnlyAlphaNumericDirective, MonkeyEcxOnlyNumbersDirective, MonkeyEcxOthersErrorsHandlingService, MonkeyEcxPipesModule, MonkeyEcxProgressBarComponent, MonkeyEcxProgressBarModule, MonkeyEcxProgressBarService, MonkeyEcxRequestDownloadHandlingService, MonkeyEcxRequestDownloadedHandlingService, MonkeyEcxRequestPagedHandling, MonkeyEcxRequestQueueHandlingService, MonkeyEcxRequestQueueModalHandlingService, MonkeyEcxRequestScheduleService, MonkeyEcxSecurityConsoleConfigService, MonkeyEcxSecurityDirective, MonkeyEcxService, MonkeyEcxServiceDownload, MonkeyEcxServiceUpload, MonkeyEcxServiceWorkerConfigService, MonkeyEcxSpecificationSearch, MonkeyEcxTextTruncatePipe, MonkeyEcxTokenStorageService, MonkeyEcxTooltipDirective, MonkeyEcxTruncateQtdPipe, MonkeyEcxUtils, MonkeyEcxi18nConfigService, MonkeyFrontCoreModuleModule, OpSearch, statics as Statics, validateUtils as ValidateUtils, Validators, VersionChangedComponent, VersionChangedModule, comboValidator, dateRangeValidator, dateStartEndValidator, dateValidator, documentValidator, emailValidator, passwordConfirmValidator, registerValidator, trueValidator, urlValidator, valueGreaterThanZero, zipCodeValidator };
4265
- //# sourceMappingURL=monkey-front-core.mjs.map