@tonysamperi/ts-mapi-core 1.8.0-next.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/changelog.md +0 -1
  2. package/dist/cjs/index.cjs +1 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/index.d.cts +1273 -66
  5. package/dist/esm/{chunk-JE3FPJGV.js → chunk-D2XOH6K4.js} +1 -1
  6. package/dist/esm/chunk-LD5COSFG.js +1 -0
  7. package/dist/esm/{chunk-QTWLHW3D.js → chunk-STU5GUNH.js} +1 -1
  8. package/dist/esm/chunk-V6NBH54E.js +1 -0
  9. package/dist/esm/chunk-WTLVPDI2.js +1 -0
  10. package/dist/esm/chunk-XF457SYA.js +1 -0
  11. package/dist/esm/index.d.ts +2 -3
  12. package/dist/esm/index.js +1 -1
  13. package/dist/esm/services/firebase/index.d.ts +1 -1
  14. package/dist/esm/services/firebase/index.js +1 -1
  15. package/dist/esm/services/firebase/smp-firebase-service-config.interface.d.ts +1 -1
  16. package/dist/esm/services/firebase/smp-firebase.service.d.ts +1 -1
  17. package/dist/esm/services/firebase/smp-firebase.service.js +1 -1
  18. package/dist/esm/services/http/index.js +1 -1
  19. package/dist/esm/services/http/smp-http.service.js +1 -1
  20. package/dist/esm/services/index.d.ts +1 -1
  21. package/dist/esm/services/index.js +1 -1
  22. package/dist/esm/services/smp-dynamo.service.d.ts +1 -1
  23. package/dist/esm/services/smp-dynamo.service.js +1 -1
  24. package/dist/esm/shared/api/index.d.ts +1 -1
  25. package/dist/esm/shared/api/index.js +1 -1
  26. package/dist/esm/shared/api/smp-api-common-utils.class.d.ts +1 -1
  27. package/dist/esm/shared/api/smp-api-common-utils.class.js +1 -1
  28. package/dist/esm/shared/crypto/index.js +1 -1
  29. package/dist/esm/shared/crypto/smp-secure-code.class.js +1 -1
  30. package/dist/esm/shared/giftcard/index.d.ts +1 -1
  31. package/dist/esm/shared/giftcard/smp-giftcard-transaction.class.d.ts +1 -1
  32. package/dist/esm/shared/utils/index.d.ts +1 -1
  33. package/dist/esm/shared/utils/index.js +1 -1
  34. package/dist/esm/shared/utils/smp-noop.function.d.ts +1 -3
  35. package/dist/esm/shared/utils/smp-noop.function.js +1 -1
  36. package/package.json +2 -1
  37. package/dist/cjs/services/firebase/index.cjs +0 -2
  38. package/dist/cjs/services/firebase/index.cjs.map +0 -1
  39. package/dist/cjs/services/firebase/index.d.cts +0 -7
  40. package/dist/cjs/services/firebase/smp-firebase-service-config.interface.cjs +0 -2
  41. package/dist/cjs/services/firebase/smp-firebase-service-config.interface.cjs.map +0 -1
  42. package/dist/cjs/services/firebase/smp-firebase-service-config.interface.d.cts +0 -12
  43. package/dist/cjs/services/firebase/smp-firebase.service.cjs +0 -2
  44. package/dist/cjs/services/firebase/smp-firebase.service.cjs.map +0 -1
  45. package/dist/cjs/services/firebase/smp-firebase.service.d.cts +0 -56
  46. package/dist/cjs/services/http/index.cjs +0 -2
  47. package/dist/cjs/services/http/index.cjs.map +0 -1
  48. package/dist/cjs/services/http/index.d.cts +0 -12
  49. package/dist/cjs/services/http/smp-dynamic-fetch-return.type.cjs +0 -2
  50. package/dist/cjs/services/http/smp-dynamic-fetch-return.type.cjs.map +0 -1
  51. package/dist/cjs/services/http/smp-dynamic-fetch-return.type.d.cts +0 -3
  52. package/dist/cjs/services/http/smp-http-config.interface.cjs +0 -2
  53. package/dist/cjs/services/http/smp-http-config.interface.cjs.map +0 -1
  54. package/dist/cjs/services/http/smp-http-config.interface.d.cts +0 -16
  55. package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs +0 -2
  56. package/dist/cjs/services/http/smp-http-session-storage-cache.class.cjs.map +0 -1
  57. package/dist/cjs/services/http/smp-http-session-storage-cache.class.d.cts +0 -11
  58. package/dist/cjs/services/http/smp-http-status-code.enum.cjs +0 -2
  59. package/dist/cjs/services/http/smp-http-status-code.enum.cjs.map +0 -1
  60. package/dist/cjs/services/http/smp-http-status-code.enum.d.cts +0 -70
  61. package/dist/cjs/services/http/smp-http.service.cjs +0 -2
  62. package/dist/cjs/services/http/smp-http.service.cjs.map +0 -1
  63. package/dist/cjs/services/http/smp-http.service.d.cts +0 -46
  64. package/dist/cjs/services/index.cjs +0 -2
  65. package/dist/cjs/services/index.cjs.map +0 -1
  66. package/dist/cjs/services/index.d.cts +0 -22
  67. package/dist/cjs/services/smp-dynamo.service.cjs +0 -2
  68. package/dist/cjs/services/smp-dynamo.service.cjs.map +0 -1
  69. package/dist/cjs/services/smp-dynamo.service.d.cts +0 -39
  70. package/dist/cjs/shared/api/index.cjs +0 -2
  71. package/dist/cjs/shared/api/index.cjs.map +0 -1
  72. package/dist/cjs/shared/api/index.d.cts +0 -11
  73. package/dist/cjs/shared/api/smp-api-common-utils.class.cjs +0 -2
  74. package/dist/cjs/shared/api/smp-api-common-utils.class.cjs.map +0 -1
  75. package/dist/cjs/shared/api/smp-api-common-utils.class.d.cts +0 -15
  76. package/dist/cjs/shared/api/smp-error-response-create-opts.interface.cjs +0 -2
  77. package/dist/cjs/shared/api/smp-error-response-create-opts.interface.cjs.map +0 -1
  78. package/dist/cjs/shared/api/smp-error-response-create-opts.interface.d.cts +0 -13
  79. package/dist/cjs/shared/api/smp-error-response.class.cjs +0 -2
  80. package/dist/cjs/shared/api/smp-error-response.class.cjs.map +0 -1
  81. package/dist/cjs/shared/api/smp-error-response.class.d.cts +0 -25
  82. package/dist/cjs/shared/api/smp-generic-response-base.interface.cjs +0 -2
  83. package/dist/cjs/shared/api/smp-generic-response-base.interface.cjs.map +0 -1
  84. package/dist/cjs/shared/api/smp-generic-response-base.interface.d.cts +0 -9
  85. package/dist/cjs/shared/api/smp-generic-response.class.cjs +0 -2
  86. package/dist/cjs/shared/api/smp-generic-response.class.cjs.map +0 -1
  87. package/dist/cjs/shared/api/smp-generic-response.class.d.cts +0 -20
  88. package/dist/cjs/shared/api/smp-healtz.const.cjs +0 -2
  89. package/dist/cjs/shared/api/smp-healtz.const.cjs.map +0 -1
  90. package/dist/cjs/shared/api/smp-healtz.const.d.cts +0 -5
  91. package/dist/cjs/shared/api/smp-response-message-base.interface.cjs +0 -2
  92. package/dist/cjs/shared/api/smp-response-message-base.interface.cjs.map +0 -1
  93. package/dist/cjs/shared/api/smp-response-message-base.interface.d.cts +0 -8
  94. package/dist/cjs/shared/api/smp-response-message-types.enum.cjs +0 -2
  95. package/dist/cjs/shared/api/smp-response-message-types.enum.cjs.map +0 -1
  96. package/dist/cjs/shared/api/smp-response-message-types.enum.d.cts +0 -8
  97. package/dist/cjs/shared/api/smp-response-message.class.cjs +0 -2
  98. package/dist/cjs/shared/api/smp-response-message.class.cjs.map +0 -1
  99. package/dist/cjs/shared/api/smp-response-message.class.d.cts +0 -13
  100. package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs +0 -2
  101. package/dist/cjs/shared/api/smp-rest-verbs.enum.cjs.map +0 -1
  102. package/dist/cjs/shared/api/smp-rest-verbs.enum.d.cts +0 -9
  103. package/dist/cjs/shared/common/index.cjs +0 -2
  104. package/dist/cjs/shared/common/index.cjs.map +0 -1
  105. package/dist/cjs/shared/common/index.d.cts +0 -6
  106. package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs +0 -2
  107. package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.cjs.map +0 -1
  108. package/dist/cjs/shared/common/smp-base-jwt-token-plain.interface.d.cts +0 -7
  109. package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs +0 -2
  110. package/dist/cjs/shared/common/smp-base-jwt-token.class.cjs.map +0 -1
  111. package/dist/cjs/shared/common/smp-base-jwt-token.class.d.cts +0 -14
  112. package/dist/cjs/shared/common/smp-generic-constructor.type.cjs +0 -2
  113. package/dist/cjs/shared/common/smp-generic-constructor.type.cjs.map +0 -1
  114. package/dist/cjs/shared/common/smp-generic-constructor.type.d.cts +0 -3
  115. package/dist/cjs/shared/common/smp-primitive.type.cjs +0 -2
  116. package/dist/cjs/shared/common/smp-primitive.type.cjs.map +0 -1
  117. package/dist/cjs/shared/common/smp-primitive.type.d.cts +0 -3
  118. package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs +0 -2
  119. package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.cjs.map +0 -1
  120. package/dist/cjs/shared/common/smp-social-sign-in-keys.enum.d.cts +0 -7
  121. package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs +0 -2
  122. package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.cjs.map +0 -1
  123. package/dist/cjs/shared/common/smp-social-sign-in-ux-modes.enum.d.cts +0 -6
  124. package/dist/cjs/shared/crypto/index.cjs +0 -2
  125. package/dist/cjs/shared/crypto/index.cjs.map +0 -1
  126. package/dist/cjs/shared/crypto/index.d.cts +0 -3
  127. package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs +0 -2
  128. package/dist/cjs/shared/crypto/smp-aes-crypt.class.cjs.map +0 -1
  129. package/dist/cjs/shared/crypto/smp-aes-crypt.class.d.cts +0 -1
  130. package/dist/cjs/shared/crypto/smp-crypto.class.cjs +0 -2
  131. package/dist/cjs/shared/crypto/smp-crypto.class.cjs.map +0 -1
  132. package/dist/cjs/shared/crypto/smp-crypto.class.d.cts +0 -10
  133. package/dist/cjs/shared/crypto/smp-secure-code.class.cjs +0 -2
  134. package/dist/cjs/shared/crypto/smp-secure-code.class.cjs.map +0 -1
  135. package/dist/cjs/shared/crypto/smp-secure-code.class.d.cts +0 -20
  136. package/dist/cjs/shared/firebase/index.cjs +0 -2
  137. package/dist/cjs/shared/firebase/index.cjs.map +0 -1
  138. package/dist/cjs/shared/firebase/index.d.cts +0 -1
  139. package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs +0 -2
  140. package/dist/cjs/shared/firebase/smp-firebase-errors.enum.cjs.map +0 -1
  141. package/dist/cjs/shared/firebase/smp-firebase-errors.enum.d.cts +0 -14
  142. package/dist/cjs/shared/giftcard/index.cjs +0 -2
  143. package/dist/cjs/shared/giftcard/index.cjs.map +0 -1
  144. package/dist/cjs/shared/giftcard/index.d.cts +0 -8
  145. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.cjs +0 -2
  146. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.cjs.map +0 -1
  147. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-config.interface.d.cts +0 -11
  148. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs +0 -2
  149. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.cjs.map +0 -1
  150. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-hash-strategies.enum.d.cts +0 -8
  151. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs +0 -2
  152. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.cjs.map +0 -1
  153. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-ops.enum.d.cts +0 -16
  154. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.cjs +0 -2
  155. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.cjs.map +0 -1
  156. package/dist/cjs/shared/giftcard/smp-giftcard-transaction-plain.interface.d.cts +0 -8
  157. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs +0 -2
  158. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.cjs.map +0 -1
  159. package/dist/cjs/shared/giftcard/smp-giftcard-transaction.class.d.cts +0 -56
  160. package/dist/cjs/shared/marketing-cloud/index.cjs +0 -2
  161. package/dist/cjs/shared/marketing-cloud/index.cjs.map +0 -1
  162. package/dist/cjs/shared/marketing-cloud/index.d.cts +0 -2
  163. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.cjs +0 -2
  164. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.cjs.map +0 -1
  165. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validation-response.interface.d.cts +0 -14
  166. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs +0 -2
  167. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.cjs.map +0 -1
  168. package/dist/cjs/shared/marketing-cloud/smp-marketing-cloud-validators.enum.d.cts +0 -7
  169. package/dist/cjs/shared/rxjs/index.cjs +0 -2
  170. package/dist/cjs/shared/rxjs/index.cjs.map +0 -1
  171. package/dist/cjs/shared/rxjs/index.d.cts +0 -10
  172. package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs +0 -2
  173. package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.cjs.map +0 -1
  174. package/dist/cjs/shared/rxjs/smp-abstract-rxjs-ttl-cache-strategy.class.d.cts +0 -17
  175. package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs +0 -2
  176. package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.cjs.map +0 -1
  177. package/dist/cjs/shared/rxjs/smp-rxjs-catch-only.function.d.cts +0 -5
  178. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs +0 -2
  179. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.cjs.map +0 -1
  180. package/dist/cjs/shared/rxjs/smp-rxjs-in-memory-cache.class.d.cts +0 -15
  181. package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs +0 -2
  182. package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.cjs.map +0 -1
  183. package/dist/cjs/shared/rxjs/smp-rxjs-queue.function.d.cts +0 -11
  184. package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs +0 -2
  185. package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.cjs.map +0 -1
  186. package/dist/cjs/shared/rxjs/smp-rxjs-sequence.function.d.cts +0 -12
  187. package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.cjs +0 -2
  188. package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.cjs.map +0 -1
  189. package/dist/cjs/shared/rxjs/smp-rxjs-throw-if-empty.function.d.cts +0 -38
  190. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.cjs +0 -2
  191. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.cjs.map +0 -1
  192. package/dist/cjs/shared/rxjs/smp-rxjs-throw-on-condition.function.d.cts +0 -30
  193. package/dist/cjs/shared/utils/cache/index.cjs +0 -2
  194. package/dist/cjs/shared/utils/cache/index.cjs.map +0 -1
  195. package/dist/cjs/shared/utils/cache/index.d.cts +0 -7
  196. package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs +0 -2
  197. package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.cjs.map +0 -1
  198. package/dist/cjs/shared/utils/cache/smp-abstract-cache-strategy.class.d.cts +0 -16
  199. package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs +0 -2
  200. package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.cjs.map +0 -1
  201. package/dist/cjs/shared/utils/cache/smp-abstract-ttl-cache-strategy.class.d.cts +0 -17
  202. package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs +0 -2
  203. package/dist/cjs/shared/utils/cache/smp-browser-cache.class.cjs.map +0 -1
  204. package/dist/cjs/shared/utils/cache/smp-browser-cache.class.d.cts +0 -16
  205. package/dist/cjs/shared/utils/cache/smp-cached-value.interface.cjs +0 -2
  206. package/dist/cjs/shared/utils/cache/smp-cached-value.interface.cjs.map +0 -1
  207. package/dist/cjs/shared/utils/cache/smp-cached-value.interface.d.cts +0 -6
  208. package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs +0 -2
  209. package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.cjs.map +0 -1
  210. package/dist/cjs/shared/utils/cache/smp-in-memory-cache.class.d.cts +0 -15
  211. package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs +0 -2
  212. package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.cjs.map +0 -1
  213. package/dist/cjs/shared/utils/cache/smp-is-smp-cached-value.function.d.cts +0 -9
  214. package/dist/cjs/shared/utils/index.cjs +0 -2
  215. package/dist/cjs/shared/utils/index.cjs.map +0 -1
  216. package/dist/cjs/shared/utils/index.d.cts +0 -15
  217. package/dist/cjs/shared/utils/smp-apply-mixin.function.cjs +0 -2
  218. package/dist/cjs/shared/utils/smp-apply-mixin.function.cjs.map +0 -1
  219. package/dist/cjs/shared/utils/smp-apply-mixin.function.d.cts +0 -5
  220. package/dist/cjs/shared/utils/smp-ascii-words.function.cjs +0 -2
  221. package/dist/cjs/shared/utils/smp-ascii-words.function.cjs.map +0 -1
  222. package/dist/cjs/shared/utils/smp-ascii-words.function.d.cts +0 -3
  223. package/dist/cjs/shared/utils/smp-common-utils.class.cjs +0 -2
  224. package/dist/cjs/shared/utils/smp-common-utils.class.cjs.map +0 -1
  225. package/dist/cjs/shared/utils/smp-common-utils.class.d.cts +0 -101
  226. package/dist/cjs/shared/utils/smp-filter-exception.class.cjs +0 -2
  227. package/dist/cjs/shared/utils/smp-filter-exception.class.cjs.map +0 -1
  228. package/dist/cjs/shared/utils/smp-filter-exception.class.d.cts +0 -7
  229. package/dist/cjs/shared/utils/smp-noop.function.cjs +0 -2
  230. package/dist/cjs/shared/utils/smp-noop.function.cjs.map +0 -1
  231. package/dist/cjs/shared/utils/smp-noop.function.d.cts +0 -3
  232. package/dist/cjs/shared/utils/smp-regular-expressions.class.cjs +0 -2
  233. package/dist/cjs/shared/utils/smp-regular-expressions.class.cjs.map +0 -1
  234. package/dist/cjs/shared/utils/smp-regular-expressions.class.d.cts +0 -16
  235. package/dist/cjs/shared/utils/smp-sid.class.cjs +0 -2
  236. package/dist/cjs/shared/utils/smp-sid.class.cjs.map +0 -1
  237. package/dist/cjs/shared/utils/smp-sid.class.d.cts +0 -18
  238. package/dist/cjs/shared/utils/smp-unicode-words.class.cjs +0 -2
  239. package/dist/cjs/shared/utils/smp-unicode-words.class.cjs.map +0 -1
  240. package/dist/cjs/shared/utils/smp-unicode-words.class.d.cts +0 -15
  241. package/dist/cjs/shared/zod/index.cjs +0 -2
  242. package/dist/cjs/shared/zod/index.cjs.map +0 -1
  243. package/dist/cjs/shared/zod/index.d.cts +0 -3
  244. package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs +0 -2
  245. package/dist/cjs/shared/zod/smp-zod-date-time.definition.cjs.map +0 -1
  246. package/dist/cjs/shared/zod/smp-zod-date-time.definition.d.cts +0 -28
  247. package/dist/cjs/smp-aes-crypt.class-CI82T7GV.d.cts +0 -470
  248. package/dist/cjs/smp-logger-methods.class-F7p-lMeQ.d.cts +0 -66
  249. package/dist/esm/chunk-C3LKT6AF.js +0 -1
  250. package/dist/esm/chunk-FUHGPBNJ.js +0 -1
  251. package/dist/esm/chunk-NIN4PUZX.js +0 -0
  252. package/dist/esm/chunk-RCI7NEJO.js +0 -1
  253. package/dist/esm/chunk-TSC2BSSL.js +0 -1
  254. package/dist/esm/chunk-ZNC4KYAS.js +0 -1
  255. package/dist/esm/smp-logger-methods.class-F7p-lMeQ.d.ts +0 -66
package/changelog.md CHANGED
@@ -1,7 +1,6 @@
1
1
  ## 1.8.0
2
2
  * Made SmpGenericConstructor GENERIC!
3
3
  * Add SmpBaseJwtToken and SmpBaseJwtTokenPlain
4
- * Add smpAppyMixin
5
4
  * Improve typings in smpRxjsQueue and smpRxjsSequence
6
5
  * Add SmpBaseJtwToken + SmpBaseJwtTokenPlain
7
6
 
@@ -1,2 +1,2 @@
1
- "use strict";var xs=Object.create;var Ie=Object.defineProperty;var Es=Object.getOwnPropertyDescriptor;var Rs=Object.getOwnPropertyNames;var As=Object.getPrototypeOf,bs=Object.prototype.hasOwnProperty;var c=(s,e)=>Ie(s,"name",{value:e,configurable:!0});var y=(s,e)=>()=>(s&&(e=s(s=0)),e);var Ce=(s,e)=>{for(var t in e)Ie(s,t,{get:e[t],enumerable:!0})},Qt=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Rs(e))!bs.call(s,o)&&o!==t&&Ie(s,o,{get:()=>e[o],enumerable:!(r=Es(e,o))||r.enumerable});return s};var Os=(s,e,t)=>(t=s!=null?xs(As(s)):{},Qt(e||!s||!s.__esModule?Ie(t,"default",{value:s,enumerable:!0}):t,s)),F=s=>Qt(Ie({},"__esModule",{value:!0}),s);var re,pt=y(()=>{"use strict";re=class{static{c(this,"SmpAbstractCacheStrategy")}}});function ve(s){return typeof s=="object"&&s!==null&&"value"in s&&"expiry"in s&&typeof s.expiry=="number"}var ft=y(()=>{"use strict";c(ve,"smpIsSmpCachedValue")});var rr,sr=y(()=>{"use strict";rr=class{static{c(this,"SmpSessionManagerService")}get sessionId(){return this._sessionId||this._storage.getItem(this._sessionIdKey)||void 0}constructor(e="lggr_sid"){this._sessionIdKey=e,this._storage=this._getStorage(),this._sessionId=this.sessionId||this._generateSessionId()}_generateSessionId(){let e=this._generateUUID();return this._storage.setItem(this._sessionIdKey,e),e}_generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}_getStorage(){try{if(typeof window<"u"&&typeof window.sessionStorage==typeof isNaN)return sessionStorage}catch(e){console.warn(`${this.constructor.name}: error while checking sessionStorage`,e)}return{getItem:c(()=>null,"getItem"),setItem:c(()=>null,"setItem"),removeItem:c(()=>null,"removeItem"),clear:c(()=>null,"clear")}}}});var U,_t=y(()=>{"use strict";(function(s){s[s.OFF=0]="OFF",s[s.ERROR=1]="ERROR",s[s.WARN=2]="WARN",s[s.INFO=3]="INFO",s[s.LOG=4]="LOG",s[s.DEBUG=5]="DEBUG"})(U||(U={}))});function O(){}var $e=y(()=>{"use strict";c(O,"smpNoop")});var Bs,Z,wt=y(()=>{"use strict";$e();Bs=class{static{c(this,"SmpConsoleOnlyMethods")}constructor(){this.group=O,this.groupCollapsed=O,this.groupEnd=O,this.time=O,this.timeEnd=O}},Z=class or extends Bs{static{c(this,"SmpLoggerMethods")}constructor(){super(...arguments),this.debug=O,this.error=O,this.info=O,this.log=O,this.warn=O}static describe(){return Object.getOwnPropertyNames(new or).map(e=>e)}}});var ir,Se,We,nr=y(()=>{"use strict";sr();_t();wt();$e();Se="[DEFAULT]",We=class extends Z{static{c(this,"SmpLoggerService")}static get INSTANCE(){return this.get(Se)}static get INSTANCES(){return this._instances.keys()}static get NOOP_INSTANCE(){return this._noopInstance}get activeLevels(){return Object.values(U).filter(e=>+e>U.OFF&&+e<=this.level).map(e=>U[e])}get appName(){return this._appName}get currentConfig(){return{level:this.level,enableSessionId:this.enableSessionId,enablePreprocessing:this.enablePreprocessing,sensitiveProps:this._sensitiveProps}}get enablePreprocessing(){return this.preprocessArgs!==this._noopPreprocessArgs}get enableSessionId(){return!!this.sessionId}get level(){return this.constructor._level}get sessionId(){return this._sessionId}constructor(e){super(),this._sensitivePropMask="*****",this._sessionManager=new rr,this._loadConfig(e)}static destroy(e){return this._instances.delete(e)}static get(e=Se){return this._instances.get(e)||this._instances.get(Se)||this._noopInstance}static init(e,t=Se){let r;if(this._instances.has(t)){r=this.get(t);let o=r.currentConfig;r._loadConfig(Object.assign(Object.assign({},o),e))}else this._instances.set(t,new this(e)),r=this.get(t),r._appName=t;return r}static pop(e){let t=this.get(e);return this.destroy(e),t}destroy(){return this.constructor.destroy(this.appName)}filterSensitiveData(e){if(e===null||typeof e!="object"||Array.isArray(e)||e.constructor!==Object)return e;let t={};for(let r in e){let o=e[r];if(!Object.prototype.hasOwnProperty.call(e,r)||o===null||o===void 0){t[r]=o;continue}if(this._sensitiveProps.includes(r)){t[r]=this._sensitivePropMask;continue}t[r]=this.filterSensitiveData(o)}return t}preprocessArgs(e,...t){return this._defaultPreprocessArgs.apply(this,[e,...t])}_defaultPreprocessArgs(e,...t){let r=new Date;return[`${r.toISOString()}`,`${t.shift()}`.trim(),...t.map(o=>({tags:[this._appName,`level-${U[this.level]}`,e],timestamp:+r,sessionId:this.sessionId,metadata:this.filterSensitiveData(o)}))]}_loadConfig({sensitiveProps:e=[],level:t=U.OFF,enablePreprocessing:r=!1,enableSessionId:o=!1}){this._sensitiveProps=[...e,"pwd","password","buffer","token","accessToken","refreshToken"],this.preprocessArgs=r?this.preprocessArgs:this._noopPreprocessArgs,this._sessionId=o?this._sessionManager.sessionId:void 0,this._updateLevel(t)}_noopPreprocessArgs(...e){return e}_setup(e){let t=this.preprocessArgs.bind(this);this.activeLevels.forEach(r=>{let o=`${r}`.toLowerCase();typeof e[o]==typeof isNaN&&(this[o]=function(...i){e[o].apply(e,t.apply(null,[o,...i]))})}),this.level>U.OFF&&console&&(console.group&&console.groupEnd&&(this.group=console.group.bind(console),this.groupEnd=console.groupEnd.bind(console)),console.groupCollapsed&&(this.groupCollapsed=console.groupCollapsed.bind(console)),console.time&&console.timeEnd&&(this.time=console.time.bind(console),this.timeEnd=console.timeEnd.bind(console)))}_updateLevel(e=U.WARN){this.constructor.describe().forEach(t=>{this[t]=O}),this.constructor._level=e,console&&this._setup(console)}};ir=We;We._instances=new Map;We._level=U.OFF;We._noopInstance=new ir({level:U.OFF})});var ar=y(()=>{"use strict"});var cr=y(()=>{"use strict"});var hr=y(()=>{"use strict";ar();cr();wt();_t();$e()});var Te=y(()=>{"use strict";nr();hr()});var X,lr=y(()=>{"use strict";X=(function(s){return s.APPLE="APPLE",s.FACEBOOK="FACEBOOK",s.GOOGLE="GOOGLE",s})({})});var fe,dr=y(()=>{"use strict";fe=(function(s){return s.POPUP="POPUP",s.REDIRECT="REDIRECT",s})({})});var ke,Cr=y(()=>{"use strict";ke=(function(s){return s.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",s.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",s.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",s.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",s.EMAIL_EXISTS="auth/email-already-exists",s.INVALID_ACTION_CODE="auth/invalid-action-code",s.POPUP_BLOCKED="auth/popup-blocked",s.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",s.USER_NOT_FOUND="auth/user-not-found",s.WRONG_PASSWORD="auth/wrong-password",s})({})});var Xr={};Ce(Xr,{SmpDynamoService:()=>Mt});var Zr,ot,st,Mt,Hr=y(()=>{"use strict";Zr=require("@aws-sdk/client-dynamodb"),ot=require("@aws-sdk/util-dynamodb");Te();st=(function(s){return s.CouldNotDelete="ERR_COULD_NOT_DELETE",s.CouldNotRead="ERR_COULD_NOT_READ",s.CouldNotWrite="ERR_COULD_NOT_WRITE",s.ConditionalCheckFailedException="ERR_DUPE_TOKEN",s})(st||{}),Mt=class{static{c(this,"SmpDynamoService")}_config;_tableName;get marshall(){return ot.marshall}get unmarshall(){return ot.unmarshall}_db=new Zr.DynamoDB([this._buildConfig()]);_logger=new Z;constructor(e,t){this._config=e,this._tableName=t}_buildConfig(){return this._config}_delete(e,t=this._tableName,r){let o={TableName:t,Key:this.marshall(e),...r};return this._db.deleteItem(o).catch(i=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",i),Promise.reject(st[i.code]||"ERR_COULD_NOT_DELETE")))}_read(e,t=this._tableName,r){let o={TableName:t,Key:this.marshall(e),...r};return this._db.getItem(o).catch(i=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",i),Promise.reject(st[i.code]||"ERR_COULD_NOT_READ")))}_write(e,t=this._tableName,r){let o={TableName:t,Item:this.marshall(e),...r};return this._db.putItem(o).catch(i=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",i),Promise.reject(st[i.code]||"ERR_COULD_NOT_WRITE")))}}});var Jr={};Ce(Jr,{SmpFirebaseService:()=>Lt});var Me,u,Lt,Qr=y(()=>{"use strict";Te();Me=require("firebase/app"),u=require("firebase/auth");lr();dr();Cr();Lt=class s{static{c(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof s))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":X.FACEBOOK,"google.com":X.GOOGLE,"apple.com":X.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return(0,u.getAuth)(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=fe.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||fe.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new Z,this._app=(0,Me.getApps)().length?(0,Me.getApps)()[0]:(0,Me.initializeApp)(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new s(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return(0,u.checkActionCode)(this._auth,e)}confirmPasswordReset(e,t){return(0,u.confirmPasswordReset)(this._auth,e,t)}fetchSignInMethodsForEmail(e){return(0,u.fetchSignInMethodsForEmail)(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return(0,u.getRedirectResult)(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.sendEmailVerification)(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return(0,u.sendPasswordResetEmail)(this._auth,e,{url:t})}setPersistence(e){return(0,u.setPersistence)(this._auth,e?u.browserLocalPersistence:u.browserSessionPersistence)}signInWithCustomToken(e){return(0,u.signInWithCustomToken)(this._auth,e)}signInWithEmailAndPassword(e,t){return(0,u.signInWithEmailAndPassword)(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return(0,u.signOut)(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=u.EmailAuthProvider.credential(this.loggedUser.email,e);return(0,u.reauthenticateWithCredential)(this.loggedUser,r).then(()=>(0,u.updatePassword)(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.updateProfile)(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[X.APPLE]:new u.OAuthProvider("apple.com"),[X.FACEBOOK]:new u.FacebookAuthProvider().setCustomParameters({prompt:"select_account"}),[X.GOOGLE]:new u.GoogleAuthProvider().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===ke.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=ke["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:c(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===fe.POPUP?u.signInWithPopup:u.signInWithRedirect)(this._auth,e).then(o=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),o.user)).catch(async o=>o?.code===ke.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,fe.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,o),await this._expandDifferentCredential(o),Promise.reject(o)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}}});var Yr,zt,Re,$t=y(()=>{"use strict";Yr=require("rxjs"),zt=require("ts-luxon");pt();ft();Re=class extends re{static{c(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(e){return this._readRaw(e).pipe((0,Yr.map)(t=>{if(this._isSmpCachedValue(t)){if(t.expiry>=zt.DateTime.now().ts)return t.value;this._removeRaw(e).subscribe();return}return t}))}remove(e){return this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0)return this._writeRaw(e,t,r);let o=zt.DateTime.now().ts+r*1e3,i={value:t,expiry:o};return this._writeRaw(e,i,r)}_isSmpCachedValue(e){return ve(e)}}});function es(s,e){return t=>t.pipe((0,it.catchError)(r=>(typeof s==typeof isNaN?oo(s)?io(r,s):s(r):!1)?e(r):(0,it.throwError)(()=>r)))}function oo(s){try{return Reflect.construct(String,[],s),!0}catch{return!1}}function io(s,e){return typeof s=="object"&&s!==null&&s.constructor===e}var it,ts=y(()=>{"use strict";it=require("rxjs");c(es,"smpRxjsCatchOnly");c(oo,"isConstructor");c(io,"isExactInstance")});var S,nt,rs=y(()=>{"use strict";S=require("rxjs");$t();nt=class extends Re{static{c(this,"SmpRxjsInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){return(0,S.defer)(()=>(this._staticSelf._storage.clear(),(0,S.of)(void 0)))}_readRaw(e){return(0,S.defer)(()=>(0,S.of)(this._staticSelf._storage.get(e)))}_removeRaw(e){return(0,S.defer)(()=>(this._staticSelf._storage.delete(e),(0,S.of)(void 0)))}_writeRaw(e,t){return(0,S.defer)(()=>(this._staticSelf._storage.set(e,t),(0,S.of)(void 0)))}}});function ss(s){let e=[];function t(r){return r>=s.length?(0,Q.of)(e):(0,Q.defer)(()=>s[r]()).pipe((0,Q.switchMap)(o=>(e[r]=o,t(r+1))))}return c(t,"runStep"),t(0)}function os(s){if(Array.isArray(s))return ss(s);{let e=Object.keys(s),t=e.map(r=>s[r]);return ss(t).pipe((0,Q.map)(r=>{let o={};return e.forEach((i,n)=>{o[i]=r[n]}),o}))}}var Q,is=y(()=>{"use strict";Q=require("rxjs");c(ss,"smpRxjsSequence");c(os,"smpRxjsQueue")});function ns(s){return(0,Ae.from)(s).pipe((0,Ae.concatMap)(t=>t()),(0,Ae.toArray)())}var Ae,as=y(()=>{"use strict";Ae=require("rxjs");c(ns,"smpRxjsSequence")});function at(s=ao){return e=>e.pipe((0,cs.map)(t=>{if(~no.indexOf(JSON.stringify(t)))throw s(t);return t}))}var cs,no,ao,St=y(()=>{"use strict";cs=require("rxjs");c(at,"smpRxjsThrowIfEmpty");no=[void 0,null,!1,0,"","0",[],{}].map(s=>JSON.stringify(s)),ao=c(()=>new Error,"defaultErrorFactory")});function hs(s,e){return t=>t.pipe((0,ct.filter)(r=>!s(r)),(0,ct.defaultIfEmpty)(!1),at(e))}var ct,ls=y(()=>{"use strict";ct=require("rxjs");St();c(hs,"smpRxjsThrowOnCondition")});var Y={};Ce(Y,{SmpAbstractRxjsTtlCacheStrategy:()=>Re,SmpRxjsInMemoryCache:()=>nt,smpRxjsCatchOnly:()=>es,smpRxjsQueue:()=>os,smpRxjsSequence:()=>ns,smpRxjsThrowIfEmpty:()=>at,smpRxjsThrowOnCondition:()=>hs});var ee=y(()=>{"use strict";$t();ts();rs();is();as();St();ls()});var R,te,ht,co,ds=y(()=>{"use strict";R=Os(require("zod"),1),te=require("ts-luxon"),ht=class s extends R.default.ZodType{static{c(this,"SmpZodDateTime")}constructor(e){super({typeName:"SmpZodDateTime",coerce:e?.coerce??!1,checks:e?.checks??[]})}_parse(e){let t=this._getOrReturnCtx(e),r=t.data;if(this._def.coerce&&(r=this._coerceToDateTime(r),!(r instanceof te.DateTime)||!r.isValid))return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Invalid date format"}),R.default.INVALID;if((!(r instanceof te.DateTime)||!r.isValid)&&!this._def.coerce)return R.default.addIssueToContext(t,{code:R.ZodIssueCode.invalid_type,expected:R.ZodParsedType.date,received:R.ZodParsedType.unknown,path:t.path,message:"Input must be a valid DateTime object"}),R.default.INVALID;let o={min:c((i,n,a)=>{if(i.min&&n<i.min)return{code:R.ZodIssueCode.too_small,minimum:i.min.toMillis(),type:"date",inclusive:!0,message:i.message??`Date must be \u2265 ${i.min.toISODate()}`,path:a.path}},"min"),max:c((i,n,a)=>{if(i.max&&n>i.max)return{code:R.ZodIssueCode.too_big,maximum:i.max.toMillis(),type:"date",inclusive:!0,message:i.message??`Date must be \u2264 ${i.max.toISODate()}`,path:a.path}},"max"),between:c((i,n,a)=>{if(i.min&&i.max&&(n<i.min||n>i.max))return{code:R.ZodIssueCode.custom,message:i.message??`Date must be between ${i.min.toISODate()} and ${i.max.toISODate()}`,path:a.path}},"between")};for(let i of this._def.checks)if(r instanceof te.DateTime&&r.isValid){let n=o[i.kind](i,r,t);n&&R.default.addIssueToContext(t,n)}return t.common.issues.length>0?R.default.INVALID:R.default.OK(r)}between(e,t,r){return new s({...this._def,checks:[...this._def.checks,{kind:"between",min:e.toUTC(),max:t.toUTC(),message:r}]})}coerce(){return new s({...this._def,coerce:!0})}max(e,t){return new s({...this._def,checks:[...this._def.checks,{kind:"max",max:e.toUTC(),message:t}]})}min(e,t){return new s({...this._def,checks:[...this._def.checks,{kind:"min",min:e.toUTC(),message:t}]})}_coerceToDateTime(e){if(e instanceof te.DateTime&&e.isValid)return e;let t={string:c(()=>te.DateTime.fromJSDate(new Date(e)),"string"),number:c(()=>te.DateTime.fromMillis(e),"number"),object:c(()=>te.DateTime.fromJSDate(e),"object"),default:c(()=>null,"default")};return(t[typeof e]||t.default)()}},co=c((s={})=>new ht({coerce:s.coerce??!1,checks:[]}),"smpZodDateTime")});var Wt={};Ce(Wt,{SmpZodDateTime:()=>ht,smpZodDateTime:()=>co});var Kt=y(()=>{"use strict";ds()});var lo={};Ce(lo,{SMP_HEALTHZ:()=>vs,SmpAbstractCacheStrategy:()=>re,SmpAbstractTtlCacheStrategy:()=>se,SmpAesCrypt:()=>ye,SmpApiCommonUtils:()=>yt,SmpBaseJwtToken:()=>Et,SmpBaseJwtTokenPlain:()=>Rt,SmpBrowserCache:()=>Pe,SmpCommonUtils:()=>Tt,SmpCrypto:()=>Ye,SmpErrorResponse:()=>z,SmpFilterException:()=>jt,SmpFirebaseErrors:()=>ke,SmpGenericResponse:()=>pe,SmpGiftcardTransaction:()=>rt,SmpGiftcardTransactionHashStrategies:()=>he,SmpGiftcardTransactionOps:()=>v,SmpHttpService:()=>mt,SmpHttpSessionStorageCache:()=>De,SmpHttpStatusCodes:()=>gt,SmpInMemoryCache:()=>Ne,SmpMarketingCloudValidators:()=>Ts,SmpRegularExpressions:()=>Ut,SmpResponseMessage:()=>k,SmpResponseMessageTypes:()=>V,SmpRestVerbs:()=>xt,SmpSecureCode:()=>et,SmpSid:()=>kt,SmpSocialSignInKeys:()=>X,SmpSocialSignInUxModes:()=>fe,VERSION:()=>ho,smpApplyMixin:()=>js,smpIsSmpCachedValue:()=>ve,smpNoop:()=>O});module.exports=F(lo);var Be=require("class-transformer");var q=require("class-transformer");var dt=require("class-transformer");var V=(function(s){return s.INFO="INFO",s.SUCCESS="SUCCESS",s.WARNING="WARNING",s.ERROR="ERROR",s})({});function Yt(s,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(i=(o<3?n(i):o>3?n(e,t,i):n(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i}c(Yt,"_ts_decorate");function Le(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(Le,"_ts_metadata");var k=class s{static{c(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(e,t=V.ERROR){this._message=e,this._type=t}static sanitizeMessages(e){return typeof e=="string"?e.length?[new s(e)]:[]:[e].flat().map(t=>typeof t=="string"?new s(t):t)}};Yt([(0,dt.Expose)(),Le("design:type",String),Le("design:paramtypes",[])],k.prototype,"message",null);Yt([(0,dt.Expose)(),Le("design:type",typeof V>"u"?Object:V),Le("design:paramtypes",[])],k.prototype,"type",null);function Is(s,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(i=(o<3?n(i):o>3?n(e,t,i):n(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i}c(Is,"_ts_decorate");function er(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(er,"_ts_metadata");var pe=class s{static{c(this,"SmpGenericResponse")}_messages;data;set messages(e){this._messages=k.sanitizeMessages(e)}get messages(){return this._messages}constructor(e=[],t){this._messages=e,this.data=t}static buildInfo(e,t){return new s([e].flat().map(r=>new k(r,V.INFO)),t)}static buildSuccess(e,t){return new s([e].flat().map(r=>new k(r,V.SUCCESS)),t)}static fromPlain(e){return(0,q.plainToInstance)(s,e)}isError(){return!this.isSuccess()}isSuccess(){return"_errorCode"in this&&this._errorCode!==null&&this._errorCode!==void 0}serialize(){return(0,q.instanceToPlain)(this,{excludePrefixes:["_"]})}};Is([(0,q.Expose)(),(0,q.Transform)(({value:s})=>s?.length?s:void 0),er("design:type",Object),er("design:paramtypes",[])],pe.prototype,"messages",null);function tr(s,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(i=(o<3?n(i):o>3?n(e,t,i):n(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i}c(tr,"_ts_decorate");function ze(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(ze,"_ts_metadata");var z=class s extends pe{static{c(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new k("GENERIC_ERROR")]}get errorCode(){return this._errorCode}get status(){return this._status}get timestamp(){return this._timestamp}_timestamp=Date.now();constructor(e=s.DEFAULT_MESSAGES,t="GENERIC_ERROR",r=500,o){super(e,o),this._errorCode=t,this._status=r}static create({messages:e=s.DEFAULT_MESSAGES,...t}={}){return new s(k.sanitizeMessages(e),t.errorCode,t.status,t.data)}static fromPlain(e){let t=(0,Be.plainToInstance)(Cs,e,{excludePrefixes:["_"]}),r=new s;return Object.getOwnPropertyNames(t).forEach(o=>{o in r&&(r[o]=t[o])}),r}};tr([(0,Be.Expose)(),ze("design:type",Object),ze("design:paramtypes",[])],z.prototype,"errorCode",null);tr([(0,Be.Expose)(),ze("design:type",Number),ze("design:paramtypes",[])],z.prototype,"timestamp",null);var Cs=class extends z{static{c(this,"SmpErrorResponseMutable")}set errorCode(e){this._errorCode=e}set status(e){this._status=e}set timestamp(e){this._timestamp=e}};var ut=require("ts-luxon");pt();ft();var se=class extends re{static{c(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(e){let t=this._readRaw(e);if(this._isSmpCachedValue(t)){if(t.expiry>=ut.DateTime.now().ts)return t.value;this._removeRaw(e);return}return t}remove(e){this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0){this._writeRaw(e,t,r);return}let o=ut.DateTime.now().ts+r*1e3,i={value:t,expiry:o};this._writeRaw(e,i,r)}_isSmpCachedValue(e){return ve(e)}};var Pe=class extends se{static{c(this,"SmpBrowserCache")}_storage;_prefix;constructor(e,t){super(),this._storage=e,this._prefix=t}_flushRaw(){let e=[],t=-1;for(;++t<this._storage.length;){let r=this._storage.key(t);r&&r.startsWith(this._prefix)&&e.push(r)}for(t=-1;++t<e.length;)this._storage.removeItem(e[t])}_readRaw(e){let t=this._storage.getItem(this._prefix+e);try{return t?JSON.parse(t):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+e}`);return}}_removeRaw(e){this._storage.removeItem(this._prefix+e)}_writeRaw(e,t){try{this._storage.setItem(this._prefix+e,JSON.stringify(t))}catch(r){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+e}`,r)}}};var De=class extends Pe{static{c(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var Ne=class extends se{static{c(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(e){return this._staticSelf._storage.get(e)}_removeRaw(e){this._staticSelf._storage.delete(e)}_writeRaw(e,t){this._staticSelf._storage.set(e,t)}};var mt=class{static{c(this,"SmpHttpService")}static _cachePrefix="smp_rest_cache_";static _cacheStrategy=typeof sessionStorage<"u"?new De:new Ne;static _config={cachePrefix:this._cachePrefix,shared:new Map};static _errorClass=z;static _mergeParamsFallbackBaseUrl="https://ts-mapi-core.com";static $http(e){return this._generateAjax(e)}static async _generateAjax(e){if(e.cacheKey){let t=this._cacheRead(e.cacheKey);return t?Promise.resolve(t):this._generateAjaxBase(e).then(r=>(e.cacheKey&&this._cacheWrite(e.cacheKey,r),r))}return this._generateAjaxBase(e)}static async _generateAjaxBase(e){let t=await this._preprocessRequest(e),r={method:t.method,headers:new Headers({"content-type":"application/json",...t.headers}),body:t.body?JSON.stringify(t.body):null};return t.useCredentials&&(r.credentials="include"),t.url=this.mergeQueryParams(t.url,t.queryParams),fetch(t.url,r).then(o=>this._preprocessResponse(e,o)).then(o=>{if(o.ok){if(o.status===204||o.headers.get("content-length")==="0")return null;switch(t.responseType){case"blob":return o.blob();case"arraybuffer":return o.arrayBuffer();case"text":return o.text();case"json":default:return o.json()}}return o.json().then(i=>{let n=i;try{n=this._errorClass.fromPlain(i)}catch(a){console.debug("http: failed to parse error response into ErrorResponse",a)}return Promise.reject({status:o.status,message:o.statusText,body:n})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(e,t){let r=e.startsWith("http");if(t){let o=new URL(e,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),i=Object.fromEntries(o.searchParams.entries());o.search=new URLSearchParams({...i,...Object.fromEntries(Object.entries(t).map(([n,a])=>[n,`${a}`]))}).toString(),e=r?o.href:o.pathname+o.search}return e}static _cacheKey(e){return`${this._config.cachePrefix}${e}`}static _cachePop(e){let t=this._cacheRead(e);return this._cacheRemove(e),t}static _cacheRead(e){return this._cacheStrategy.read(this._cacheKey(e))}static _cacheRemove(e){this._cacheStrategy.remove(this._cacheKey(e))}static _cacheWrite(e,t){this._cacheStrategy.write(this._cacheKey(e),t)}static async _preprocessRequest(e){return e}static async _preprocessResponse(e,t){return t}};var gt=(function(s){return s[s.Continue=100]="Continue",s[s.SwitchingProtocols=101]="SwitchingProtocols",s[s.Processing=102]="Processing",s[s.EarlyHints=103]="EarlyHints",s[s.Ok=200]="Ok",s[s.Created=201]="Created",s[s.Accepted=202]="Accepted",s[s.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",s[s.NoContent=204]="NoContent",s[s.ResetContent=205]="ResetContent",s[s.PartialContent=206]="PartialContent",s[s.MultiStatus=207]="MultiStatus",s[s.AlreadyReported=208]="AlreadyReported",s[s.ImUsed=226]="ImUsed",s[s.MultipleChoices=300]="MultipleChoices",s[s.MovedPermanently=301]="MovedPermanently",s[s.Found=302]="Found",s[s.SeeOther=303]="SeeOther",s[s.NotModified=304]="NotModified",s[s.UseProxy=305]="UseProxy",s[s.Unused=306]="Unused",s[s.TemporaryRedirect=307]="TemporaryRedirect",s[s.PermanentRedirect=308]="PermanentRedirect",s[s.BadRequest=400]="BadRequest",s[s.Unauthorized=401]="Unauthorized",s[s.PaymentRequired=402]="PaymentRequired",s[s.Forbidden=403]="Forbidden",s[s.NotFound=404]="NotFound",s[s.MethodNotAllowed=405]="MethodNotAllowed",s[s.NotAcceptable=406]="NotAcceptable",s[s.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",s[s.RequestTimeout=408]="RequestTimeout",s[s.Conflict=409]="Conflict",s[s.Gone=410]="Gone",s[s.LengthRequired=411]="LengthRequired",s[s.PreconditionFailed=412]="PreconditionFailed",s[s.PayloadTooLarge=413]="PayloadTooLarge",s[s.UriTooLong=414]="UriTooLong",s[s.UnsupportedMediaType=415]="UnsupportedMediaType",s[s.RangeNotSatisfiable=416]="RangeNotSatisfiable",s[s.ExpectationFailed=417]="ExpectationFailed",s[s.ImATeapot=418]="ImATeapot",s[s.MisdirectedRequest=421]="MisdirectedRequest",s[s.UnprocessableEntity=422]="UnprocessableEntity",s[s.Locked=423]="Locked",s[s.FailedDependency=424]="FailedDependency",s[s.TooEarly=425]="TooEarly",s[s.UpgradeRequired=426]="UpgradeRequired",s[s.PreconditionRequired=428]="PreconditionRequired",s[s.TooManyRequests=429]="TooManyRequests",s[s.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",s[s.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",s[s.InternalServerError=500]="InternalServerError",s[s.NotImplemented=501]="NotImplemented",s[s.BadGateway=502]="BadGateway",s[s.ServiceUnavailable=503]="ServiceUnavailable",s[s.GatewayTimeout=504]="GatewayTimeout",s[s.HttpVersionNotSupported=505]="HttpVersionNotSupported",s[s.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",s[s.InsufficientStorage=507]="InsufficientStorage",s[s.LoopDetected=508]="LoopDetected",s[s.NotExtended=510]="NotExtended",s[s.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",s})({});Te();var yt=class{static{c(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new Z;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(e,t){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}static fromBearer(e=""){return e.split(" ")[1]}static getCountryFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[1]}static getLocaleFromReferer(e){return e?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(e,t){try{return e.replace(this._pathParamRegex,(r,o)=>{let i=t[o];return i!==void 0?encodeURIComponent(i):r})}catch(r){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,r)}return e}};var vs={status:"OK"};var xt=(function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s.PATCH="PATCH",s})({});var Et=class{static{c(this,"SmpBaseJwtToken")}_access_token;_exp;_iss;get access_token(){return this._access_token}get exp(){return this._exp}get iss(){return this._iss}constructor(e,t,r){this._access_token=e,this._exp=t,this._iss=r}serialize(){return{access_token:this._access_token,exp:this._exp,iss:this._iss}}};var Rt=class{static{c(this,"SmpBaseJwtTokenPlain")}access_token;exp;iss};var H=class{static{c(this,"Hex")}static parse(e){let t=e.length,r=[];for(let o=0;o<t;o+=2)r[o>>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new _(r,t/2)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let o=e.words[r>>>2]>>>24-r%4*8&255;t.push((o>>>4).toString(16)),t.push((o&15).toString(16))}return t.join("")}};var _=class At{static{c(this,"WordArray")}constructor(e,t){this.words=e||[],t!==void 0?this.sigBytes=t:this.sigBytes=this.words.length*4}static random(e){let t=[],r=c(function(o){let i=987654321,n=4294967295;return function(){i=36969*(i&65535)+(i>>16)&n,o=18e3*(o&65535)+(o>>16)&n;let a=(i<<16)+o&n;return a/=4294967296,a+=.5,a*(Math.random()>.5?1:-1)}},"r");for(let o=0,i;o<e;o+=4){let n=r((i||Math.random())*4294967296);i=n()*987654071,t.push(n()*4294967296|0)}return new At(t,e)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new At(this.words.slice(0),this.sigBytes)}concat(e){if(this.clamp(),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let r=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];return this.sigBytes+=e.sigBytes,this}toString(e){return(e||H).stringify(this)}};var Ke=class{static{c(this,"Latin1")}static parse(e){let t=e.length,r=[];for(let o=0;o<t;o++)r[o>>>2]|=(e.charCodeAt(o)&255)<<24-o%4*8;return new _(r,t)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let o=e.words[r>>>2]>>>24-r%4*8&255;t.push(String.fromCharCode(o))}return t.join("")}};var I=class{static{c(this,"Utf8")}static parse(e){return Ke.parse(unescape(encodeURIComponent(e)))}static stringify(e){try{return decodeURIComponent(escape(Ke.stringify(e)))}catch(t){throw console.error("Malformed UTF-8 data",t),new Error("Malformed UTF-8 data")}}};var Ge=class{static{c(this,"BufferedBlockAlgorithm")}constructor(e){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},e),this._data=new _,this._nDataBytes=0}clone(){let e=this.constructor();for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e[t]=this[t]);return e._data=this._data.clone(),e}reset(){this._data=new _,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=I.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let t=this.cfg.blockSize*4,r=this._data.sigBytes/t;e?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);let o=r*this.cfg.blockSize,i=Math.min(o*4,this._data.sigBytes),n;if(o){for(let a=0;a<o;a+=this.cfg.blockSize)this._doProcessBlock(this._data.words,a);n=this._data.words.splice(0,o),this._data.sigBytes-=i}return new _(n,i)}};var ue=class{static{c(this,"CipherParams")}constructor(e){this.ciphertext=e.ciphertext,this.key=e.key,this.iv=e.iv,this.salt=e.salt,this.algorithm=e.algorithm,this.mode=e.mode,this.padding=e.padding,this.blockSize=e.blockSize,this.formatter=e.formatter}extend(e){return e.ciphertext!==void 0&&(this.ciphertext=e.ciphertext),e.key!==void 0&&(this.key=e.key),e.iv!==void 0&&(this.iv=e.iv),e.salt!==void 0&&(this.salt=e.salt),e.algorithm!==void 0&&(this.algorithm=e.algorithm),e.mode!==void 0&&(this.mode=e.mode),e.padding!==void 0&&(this.padding=e.padding),e.blockSize!==void 0&&(this.blockSize=e.blockSize),e.formatter!==void 0&&(this.formatter=e.formatter),this}toString(e){if(e)return e.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var W=class{static{c(this,"Base64")}static parse(e){let t=e.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let o=0;o<this._map.length;o++)this._reverseMap[this._map.charCodeAt(o)]=o}let r=this._map.charAt(64);if(r){let o=e.indexOf(r);o!==-1&&(t=o)}return this.parseLoop(e,t,this._reverseMap)}static parseLoop(e,t,r){let o=[],i=0;for(let n=0;n<t;n++)if(n%4){let a=r[e.charCodeAt(n-1)]<<n%4*2,h=r[e.charCodeAt(n)]>>>6-n%4*2;o[i>>>2]|=(a|h)<<24-i%4*8,i++}return new _(o,i)}static stringify(e){e.clamp();let t=[];for(let o=0;o<e.sigBytes;o+=3){let i=e.words[o>>>2]>>>24-o%4*8&255,n=e.words[o+1>>>2]>>>24-(o+1)%4*8&255,a=e.words[o+2>>>2]>>>24-(o+2)%4*8&255,h=i<<16|n<<8|a;for(let f=0;f<4&&o+f*.75<e.sigBytes;f++)t.push(this._map.charAt(h>>>6*(3-f)&63))}let r=this._map.charAt(64);if(r)for(;t.length%4;)t.push(r);return t.join("")}};W._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";W._reverseMap=void 0;var Ve=class{static{c(this,"OpenSSL")}static parse(e){let t=W.parse(e),r;return t.words[0]===1398893684&&t.words[1]===1701076831&&(r=new _(t.words.slice(2,4)),t.words.splice(0,4),t.sigBytes-=16),new ue({ciphertext:t,salt:r})}static stringify(e){if(!e.ciphertext)throw new Error("missing ciphertext in params");let t=e.ciphertext,r=e.salt,o;if(r){if(typeof r=="string")throw new Error("salt is expected to be a WordArray");o=new _([1398893684,1701076831]).concat(r).concat(t)}else o=t;return o.toString(W)}};var oe=class{static{c(this,"SerializableCipher")}static decrypt(e,t,r,o){let i=Object.assign({},this.cfg,o);if(!i.format)throw new Error("could not determine format");if(t=this._parse(t,i.format),!t.ciphertext)throw new Error("could not determine ciphertext");return e.createDecryptor(r,i).finalize(t.ciphertext)}static encrypt(e,t,r,o){let i=Object.assign({},this.cfg,o),n=e.createEncryptor(r,i),a=n.finalize(t);return new ue({ciphertext:a,key:r,iv:n.cfg.iv,algorithm:e,mode:n.cfg.mode,padding:n.cfg.padding,blockSize:n.cfg.blockSize,formatter:i.format})}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};oe.cfg={blockSize:4,iv:new _([]),format:Ve};var b=class extends Ge{static{c(this,"Hasher")}constructor(e){super(Object.assign({blockSize:512/32},e)),this.reset()}static _createHelper(e){function t(r,o){return new e(o).finalize(r)}return c(t,"helper"),t}finalize(e){return e&&this._append(e),this._doFinalize()}update(e){return this._append(e),this._process(),this}};var d=[];for(let s=0;s<64;s++)d[s]=Math.abs(Math.sin(s+1))*4294967296|0;var K=class p extends b{static{c(this,"MD5")}get hash(){return this._hash}static FF(e,t,r,o,i,n,a){let h=e+(t&r|~t&o)+i+a;return(h<<n|h>>>32-n)+t}static GG(e,t,r,o,i,n,a){let h=e+(t&o|r&~o)+i+a;return(h<<n|h>>>32-n)+t}static HH(e,t,r,o,i,n,a){let h=e+(t^r^o)+i+a;return(h<<n|h>>>32-n)+t}static II(e,t,r,o,i,n,a){let h=e+(r^(t|~o))+i+a;return(h<<n|h>>>32-n)+t}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;this._data.words[t>>>5]|=128<<24-t%32;let r=Math.floor(e/4294967296),o=e;this._data.words[(t+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,this._data.words[(t+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let i=0;i<4;i++)this._hash.words[i]=(this._hash.words[i]<<8|this._hash.words[i]>>>24)&16711935|(this._hash.words[i]<<24|this._hash.words[i]>>>8)&4278255360;return this._hash}_doProcessBlock(e,t){for(let h=0;h<16;h++){let f=t+h,g=e[f];e[f]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let r=Array.from({length:16});for(let h=0;h<16;h++)r[h]=e[t+h];let o=this._hash.words[0],i=this._hash.words[1],n=this._hash.words[2],a=this._hash.words[3];o=p.FF(o,i,n,a,r[0],7,d[0]),a=p.FF(a,o,i,n,r[1],12,d[1]),n=p.FF(n,a,o,i,r[2],17,d[2]),i=p.FF(i,n,a,o,r[3],22,d[3]),o=p.FF(o,i,n,a,r[4],7,d[4]),a=p.FF(a,o,i,n,r[5],12,d[5]),n=p.FF(n,a,o,i,r[6],17,d[6]),i=p.FF(i,n,a,o,r[7],22,d[7]),o=p.FF(o,i,n,a,r[8],7,d[8]),a=p.FF(a,o,i,n,r[9],12,d[9]),n=p.FF(n,a,o,i,r[10],17,d[10]),i=p.FF(i,n,a,o,r[11],22,d[11]),o=p.FF(o,i,n,a,r[12],7,d[12]),a=p.FF(a,o,i,n,r[13],12,d[13]),n=p.FF(n,a,o,i,r[14],17,d[14]),i=p.FF(i,n,a,o,r[15],22,d[15]),o=p.GG(o,i,n,a,r[1],5,d[16]),a=p.GG(a,o,i,n,r[6],9,d[17]),n=p.GG(n,a,o,i,r[11],14,d[18]),i=p.GG(i,n,a,o,r[0],20,d[19]),o=p.GG(o,i,n,a,r[5],5,d[20]),a=p.GG(a,o,i,n,r[10],9,d[21]),n=p.GG(n,a,o,i,r[15],14,d[22]),i=p.GG(i,n,a,o,r[4],20,d[23]),o=p.GG(o,i,n,a,r[9],5,d[24]),a=p.GG(a,o,i,n,r[14],9,d[25]),n=p.GG(n,a,o,i,r[3],14,d[26]),i=p.GG(i,n,a,o,r[8],20,d[27]),o=p.GG(o,i,n,a,r[13],5,d[28]),a=p.GG(a,o,i,n,r[2],9,d[29]),n=p.GG(n,a,o,i,r[7],14,d[30]),i=p.GG(i,n,a,o,r[12],20,d[31]),o=p.HH(o,i,n,a,r[5],4,d[32]),a=p.HH(a,o,i,n,r[8],11,d[33]),n=p.HH(n,a,o,i,r[11],16,d[34]),i=p.HH(i,n,a,o,r[14],23,d[35]),o=p.HH(o,i,n,a,r[1],4,d[36]),a=p.HH(a,o,i,n,r[4],11,d[37]),n=p.HH(n,a,o,i,r[7],16,d[38]),i=p.HH(i,n,a,o,r[10],23,d[39]),o=p.HH(o,i,n,a,r[13],4,d[40]),a=p.HH(a,o,i,n,r[0],11,d[41]),n=p.HH(n,a,o,i,r[3],16,d[42]),i=p.HH(i,n,a,o,r[6],23,d[43]),o=p.HH(o,i,n,a,r[9],4,d[44]),a=p.HH(a,o,i,n,r[12],11,d[45]),n=p.HH(n,a,o,i,r[15],16,d[46]),i=p.HH(i,n,a,o,r[2],23,d[47]),o=p.II(o,i,n,a,r[0],6,d[48]),a=p.II(a,o,i,n,r[7],10,d[49]),n=p.II(n,a,o,i,r[14],15,d[50]),i=p.II(i,n,a,o,r[5],21,d[51]),o=p.II(o,i,n,a,r[12],6,d[52]),a=p.II(a,o,i,n,r[3],10,d[53]),n=p.II(n,a,o,i,r[10],15,d[54]),i=p.II(i,n,a,o,r[1],21,d[55]),o=p.II(o,i,n,a,r[8],6,d[56]),a=p.II(a,o,i,n,r[15],10,d[57]),n=p.II(n,a,o,i,r[6],15,d[58]),i=p.II(i,n,a,o,r[13],21,d[59]),o=p.II(o,i,n,a,r[4],6,d[60]),a=p.II(a,o,i,n,r[11],10,d[61]),n=p.II(n,a,o,i,r[2],15,d[62]),i=p.II(i,n,a,o,r[9],21,d[63]),this._hash.words[0]=this._hash.words[0]+o|0,this._hash.words[1]=this._hash.words[1]+i|0,this._hash.words[2]=this._hash.words[2]+n|0,this._hash.words[3]=this._hash.words[3]+a|0}};var bt=class pr{static{c(this,"EVPKDF")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:K,iterations:1},e)}static execute(e,t,r){return new pr(r).compute(e,t)}compute(e,t){let r=new this.cfg.hasher,o=new _,i;for(;o.words.length<this.cfg.keySize;){i&&r.update(i),i=r.update(e).finalize(t),r.reset();for(let n=1;n<this.cfg.iterations;n++)i=r.finalize(i),r.reset();o.concat(i)}return o.sigBytes=this.cfg.keySize*4,o}};var fr=class{static{c(this,"OpenSSLKdf")}static execute(e,t,r,o){o||(o=_.random(64/8));let i=new bt({keySize:t+r}).compute(e,o),n=new _(i.words.slice(t),r*4);return i.sigBytes=t*4,new ue({key:i,iv:n,salt:o})}};var qe=class{static{c(this,"PasswordBasedCipher")}static decrypt(e,t,r,o){let i=Object.assign({},this.cfg,o);if(i.format===void 0)throw new Error("missing format in config");if(t=this._parse(t,i.format),i.kdf===void 0)throw new Error("the key derivation function must be set");let n=i.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv!==void 0&&(i.iv=n.iv),oe.decrypt.call(this,e,t,n.key,i)}static encrypt(e,t,r,o){let i=Object.assign({},this.cfg,o);if(i.kdf===void 0)throw new Error("missing kdf in config");let n=i.kdf.execute(r,e.keySize,e.ivSize);return n.iv!==void 0&&(i.iv=n.iv),oe.encrypt.call(this,e,t,n.key,i).extend(n)}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};qe.cfg={blockSize:4,iv:new _([]),format:Ve,kdf:fr};var ur=class{static{c(this,"CipherHelper")}constructor(e){this._cipher=e}decrypt(e,t,r){return typeof t=="string"?qe.decrypt(this._cipher,e,t,r):oe.decrypt(this._cipher,e,t,r)}encrypt(e,t,r){return typeof t=="string"?qe.encrypt(this._cipher,e,t,r):oe.encrypt(this._cipher,e,t,r)}};var me=class extends Ge{static{c(this,"Cipher")}constructor(e,t,r){super(Object.assign({blockSize:1},r)),this._xformMode=e,this._key=t,this.reset()}static _createHelper(e){return new ur(e)}static createDecryptor(e,t){let r=this;return new r(this._DEC_XFORM_MODE,e,t)}static createEncryptor(e,t){return new this(this._ENC_XFORM_MODE,e,t)}finalize(e){return e&&this._append(e),this._doFinalize()}process(e){return this._append(e),this._process()}};me.ivSize=4;me.keySize=4;me._DEC_XFORM_MODE=2;me._ENC_XFORM_MODE=1;var ie=class{static{c(this,"BlockCipherModeAlgorithm")}constructor(e,t){this.init(e,t)}init(e,t){this._cipher=e,this._iv=t}};var Ze=class{static{c(this,"BlockCipherMode")}static createDecryptor(e,t){let r=this.Decryptor;return new r(e,t)}static createEncryptor(e,t){let r=this.Encryptor;return new r(e,t)}};Ze.Decryptor=ie;Ze.Encryptor=ie;var mr=class extends ie{static{c(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(e,t,this._cipher.cfg.blockSize),this._cipher.encryptBlock(e,t),this._prevBlock=e.slice(t,t+this._cipher.cfg.blockSize)}xorBlock(e,t,r){let o;this._iv?(o=this._iv,this._iv=void 0):o=this._prevBlock;for(let i=0;i<r;i++)e[t+i]^=o[i]}};var gr=class extends ie{static{c(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let r=e.slice(t,t+this._cipher.cfg.blockSize);this._cipher.decryptBlock(e,t),this.xorBlock(e,t,this._cipher.cfg.blockSize),this._prevBlock=r}xorBlock(e,t,r){let o;this._iv?(o=this._iv,this._iv=void 0):o=this._prevBlock;for(let i=0;i<r;i++)e[t+i]^=o[i]}};var J=class extends Ze{static{c(this,"CBC")}};J.Decryptor=gr;J.Encryptor=mr;var ge=class{static{c(this,"PKCS7")}static pad(e,t){let r=t*4,o=r-e.sigBytes%r,i=o<<24|o<<16|o<<8|o,n=[];for(let h=0;h<o;h+=4)n.push(i);let a=new _(n,o);e.concat(a)}static unpad(e){let t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};var Xe=class extends me{static{c(this,"BlockCipher")}constructor(e,t,r){super(e,t,Object.assign({blockSize:4,mode:J,padding:ge},r))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let e;this._xformMode===this.constructor._ENC_XFORM_MODE?e=this.cfg.mode.createEncryptor:(e=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===e?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=e.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=e)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let e;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),e=this._process(!0)}else e=this._process(!0),this.cfg.padding.unpad(e);return e}_doProcessBlock(e,t){this._mode.processBlock(e,t)}};var l=class ${static{c(this,"X64Word")}constructor(e,t){this.high=e,this.low=t}add(e){let t=this.low+e.low|0,r=t>>>0<this.low>>>0?1:0,o=this.high+e.high+r|0;return new $(o,t)}and(e){return new $(this.high&e.high,this.low&e.low)}not(){return new $(~this.high,~this.low)}or(e){return new $(this.high|e.high,this.low|e.low)}rotL(e){return this.shiftL(e).or(this.shiftR(64-e))}rotR(e){return this.shiftR(e).or(this.shiftL(64-e))}shiftL(e){return e<32?new $(this.high<<e|this.low>>>32-e,this.low<<e):new $(this.low<<e-32,0)}shiftR(e){return e<32?new $(this.high>>>e,this.low>>>e|this.high<<32-e):new $(0,this.high>>>e-32)}xor(e){return new $(this.high^e.high,this.low^e.low)}};var _r=class Ot{static{c(this,"X64WordArray")}constructor(e=[],t){this.words=e,this.sigBytes=t!==void 0?t:e.length*8}static create(e=[],t){return new Ot(e,t)}clone(){let e=this.words.map(t=>new l(t.high,t.low));return new Ot(e,this.sigBytes)}toX32(){let e=[];for(let t of this.words)e.push(t.high,t.low);return new _(e,this.sigBytes)}};var B=[],wr=[],yr=[],xr=[],Er=[],Rr=[],It=[],Ct=[],Bt=[],vt=[];(function(){let s=[];for(let r=0;r<256;r++)r<128?s[r]=r<<1:s[r]=r<<1^283;let e=0,t=0;for(let r=0;r<256;r++){let o=t^t<<1^t<<2^t<<3^t<<4;o=o>>>8^o&255^99,B[e]=o,wr[o]=e;let i=s[e],n=s[i],a=s[n],h=s[o]*257^o*16843008;yr[e]=h<<24|h>>>8,xr[e]=h<<16|h>>>16,Er[e]=h<<8|h>>>24,Rr[e]=h,h=a*16843009^n*65537^i*257^e*16843008,It[o]=h<<24|h>>>8,Ct[o]=h<<16|h>>>16,Bt[o]=h<<8|h>>>24,vt[o]=h,e?(e=i^s[s[s[a^i]]],t^=s[s[t]]):e=t=1}})();var Ps=[0,1,2,4,8,16,32,64,128,27,54],He=class extends Xe{static{c(this,"AES")}constructor(e,t,r){super(e,t,r),super.reset()}decryptBlock(e,t){let r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,It,Ct,Bt,vt,wr),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r}encryptBlock(e,t){this._doCryptBlock(e,t,this._keySchedule,yr,xr,Er,Rr,B)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,i=((this._nRounds=r+6)+1)*4,n=this._keySchedule=[];for(let a=0;a<i;a++)if(a<r)n[a]=t[a];else{let h=n[a-1];a%r?r>6&&a%r===4&&(h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255]):(h=h<<8|h>>>24,h=B[h>>>24]<<24|B[h>>>16&255]<<16|B[h>>>8&255]<<8|B[h&255],h^=Ps[a/r|0]<<24),n[a]=n[a-r]^h}this._invKeySchedule=[];for(let a=0;a<i;a++){let h=i-a,f;a%4?f=n[h]:f=n[h-4],a<4||h<=4?this._invKeySchedule[a]=f:this._invKeySchedule[a]=It[B[f>>>24]]^Ct[B[f>>>16&255]]^Bt[B[f>>>8&255]]^vt[B[f&255]]}}_doCryptBlock(e,t,r,o,i,n,a,h){let f=e[t]^r[0],g=e[t+1]^r[1],m=e[t+2]^r[2],w=e[t+3]^r[3],A=4;for(let C=1;C<this._nRounds;C++){let x=o[f>>>24]^i[g>>>16&255]^n[m>>>8&255]^a[w&255]^r[A++],E=o[g>>>24]^i[m>>>16&255]^n[w>>>8&255]^a[f&255]^r[A++],j=o[m>>>24]^i[w>>>16&255]^n[f>>>8&255]^a[g&255]^r[A++],lt=o[w>>>24]^i[f>>>16&255]^n[g>>>8&255]^a[m&255]^r[A++];f=x,g=E,m=j,w=lt}let P=(h[f>>>24]<<24|h[g>>>16&255]<<16|h[m>>>8&255]<<8|h[w&255])^r[A++],L=(h[g>>>24]<<24|h[m>>>16&255]<<16|h[w>>>8&255]<<8|h[f&255])^r[A++],N=(h[m>>>24]<<24|h[w>>>16&255]<<16|h[f>>>8&255]<<8|h[g&255])^r[A++],T=(h[w>>>24]<<24|h[f>>>16&255]<<16|h[g>>>8&255]<<8|h[m&255])^r[A++];e[t]=P,e[t+1]=L,e[t+2]=N,e[t+3]=T}};He.keySize=256/32;var Ds=[1732584193,4023233417,2562383102,271733878,3285377520],ne=new Array(80),ae=class extends b{static{c(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(Ds.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],o=this._hash.words[1],i=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)ne[h]=e[t+h]|0;else{let w=ne[h-3]^ne[h-8]^ne[h-14]^ne[h-16];ne[h]=w<<1|w>>>31}let f,g;h<20?(f=o&i|~o&n,g=1518500249):h<40?(f=o^i^n,g=1859775393):h<60?(f=o&i|o&n|i&n,g=2400959708):(f=o^i^n,g=3395469782);let m=(r<<5|r>>>27)+f+a+g+ne[h];a=n,n=i,i=o<<30|o>>>2,o=r,r=m|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+o|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0}};var Ar=[],br=[];(function(){function s(o){let i=Math.sqrt(o);for(let n=2;n<=i;n++)if(!(o%n))return!1;return!0}c(s,"isPrime");function e(o){return(o-(o|0))*4294967296|0}c(e,"getFractionalBits");let t=2,r=0;for(;r<64;)s(t)&&(r<8&&(Ar[r]=e(Math.pow(t,1/2))),br[r]=e(Math.pow(t,1/3)),r++),t++})();var ce=[],je=class extends b{static{c(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(Ar.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],o=this._hash.words[1],i=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4],h=this._hash.words[5],f=this._hash.words[6],g=this._hash.words[7];for(let m=0;m<64;m++){if(m<16)ce[m]=e[t+m]|0;else{let C=ce[m-15],x=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,E=ce[m-2],j=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;ce[m]=x+ce[m-7]+j+ce[m-16]}let w=a&h^~a&f,A=r&o^r&i^o&i,P=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),L=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),N=g+L+w+br[m]+ce[m],T=P+A;g=f,f=h,h=a,a=n+N|0,n=i,i=o,o=r,r=N+T|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+o|0,this._hash.words[2]=this._hash.words[2]+i|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+f|0,this._hash.words[7]=this._hash.words[7]+g|0}};var Pt=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],M=[];(function(){for(let s=0;s<80;s++)M[s]=new l(void 0,void 0)})();var Dt=class extends b{static{c(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new _r([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let e=this._data,t=e.words,r=this._nDataBytes*8,o=e.sigBytes*8;return t[o>>>5]|=128<<24-o%32,t[(o+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(o+128>>>10<<5)+31]=r,e.sigBytes=t.length*4,this._process(),this._hash.toX32()}_doProcessBlock(e,t){let r=this._hash.words[0].high,o=this._hash.words[0].low,i=this._hash.words[1].high,n=this._hash.words[1].low,a=this._hash.words[2].high,h=this._hash.words[2].low,f=this._hash.words[3].high,g=this._hash.words[3].low,m=this._hash.words[4].high,w=this._hash.words[4].low,A=this._hash.words[5].high,P=this._hash.words[5].low,L=this._hash.words[6].high,N=this._hash.words[6].low,T=this._hash.words[7].high,C=this._hash.words[7].low;for(let x=0;x<80;x++){let E,j;if(x<16)j=M[x].high=e[t+x*2]|0,E=M[x].low=e[t+x*2+1]|0;else{let Zt=M[x-15],le=Zt.high,be=Zt.low,ws=(le>>>1|be<<31)^(le>>>8|be<<24)^le>>>7,Xt=(be>>>1|le<<31)^(be>>>8|le<<24)^(be>>>7|le<<25),Ht=M[x-2],de=Ht.high,Oe=Ht.low,ys=(de>>>19|Oe<<13)^(de<<3|Oe>>>29)^de>>>6,Jt=(Oe>>>19|de<<13)^(Oe<<3|de>>>29)^(Oe>>>6|de<<26);E=Xt+M[x-7].low,j=ws+M[x-7].high+(E>>>0<Xt>>>0?1:0),E=E+Jt,j=j+ys+(E>>>0<Jt>>>0?1:0),E=E+M[x-16].low,j=j+M[x-16].high+(E>>>0<M[x-16].low>>>0?1:0),M[x].high=j,M[x].low=E}let lt=m&A^~m&L,Gt=w&P^~w&N,ps=r&i^r&a^i&a,fs=o&n^o&h^n&h,us=(r>>>28|o<<4)^(r<<30|o>>>2)^(r<<25|o>>>7),Vt=(o>>>28|r<<4)^(o<<30|r>>>2)^(o<<25|r>>>7),ms=(m>>>14|w<<18)^(m>>>18|w<<14)^(m<<23|w>>>9),gs=(w>>>14|m<<18)^(w>>>18|m<<14)^(w<<23|m>>>9),D=C+gs,G=T+ms+(D>>>0<C>>>0?1:0);D=D+Gt,G=G+lt+(D>>>0<Gt>>>0?1:0),D=D+Pt[x].low,G=G+Pt[x].high+(D>>>0<Pt[x].low>>>0?1:0),D=D+E,G=G+j+(D>>>0<E>>>0?1:0);let qt=Vt+fs,_s=us+ps+(qt>>>0<Vt>>>0?1:0);T=L,C=N,L=A,N=P,A=m,P=w,w=g+D|0,m=f+G+(w>>>0<g>>>0?1:0)|0,f=a,g=h,a=i,h=n,i=r,n=o,o=D+qt|0,r=G+_s+(o>>>0<D>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+o,this._hash.words[0].high=this._hash.words[0].high+r+(this._hash.words[0].low>>>0<o>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+n,this._hash.words[1].high=this._hash.words[1].high+i+(this._hash.words[1].low>>>0<n>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+a+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+f+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+w,this._hash.words[4].high=this._hash.words[4].high+m+(this._hash.words[4].low>>>0<w>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+P,this._hash.words[5].high=this._hash.words[5].high+A+(this._hash.words[5].low>>>0<P>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+N,this._hash.words[6].high=this._hash.words[6].high+L+(this._hash.words[6].low>>>0<N>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+C,this._hash.words[7].high=this._hash.words[7].high+T+(this._hash.words[7].low>>>0<C>>>0?1:0)}};var Or=class{static{c(this,"HMAC")}constructor(e,t){this._hasher=new e;let r=typeof t=="string"?I.parse(t):t,o=this._hasher.cfg.blockSize,i=o*4;r.sigBytes>i&&(r=this._hasher.finalize(r)),r.clamp();let n=this._oKey=r.clone(),a=this._iKey=r.clone(),h=n.words,f=a.words;for(let g=0;g<o;g++)h[g]^=1549556828,f[g]^=909522486;n.sigBytes=a.sigBytes=i,this.reset()}finalize(e){let t=this._hasher.finalize(e);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(t))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(e){return this._hasher.update(e),this}};var Nt=class Ir{static{c(this,"PBKDF2")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:je,iterations:25e4},e)}static execute(e,t,r){return new Ir(r).compute(e,t)}compute(e,t){let r=this.cfg,o=new Or(r.hasher,e),i=new _,n=new _([1]),a=i.words,h=n.words,f=r.keySize,g=r.iterations;for(;a.length<f;){let m=o.update(t).finalize(n);o.reset();let w=m.words,A=w.length,P=m;for(let L=1;L<g;L++){P=o.finalize(P),o.reset();let N=P.words;for(let T=0;T<A;T++)w[T]^=N[T]}i.concat(m),h[0]++}return i.sigBytes=f*4,i}};var Fe=Xe._createHelper(He);var _e=b._createHelper(K);var we=b._createHelper(ae);var Je=b._createHelper(je);var Qe=b._createHelper(Dt);var ye=class{static{c(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?H.parse(this._initVector):void 0}_mode=J;_padding=ge;constructor(e,t,r){this._password=e,this._salt=t,this._initVector=r}decryptAES(e){return Fe.decrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(I)}encryptAES(e){return Fe.encrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return Nt.execute(this._password,H.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:ae})}};var Ye=class{static{c(this,"SmpCrypto")}static base64Decode(e){return I.stringify(W.parse(e))}static base64Encode(e){return W.stringify(I.parse(e))}static md5(e){return _e(e).toString()}static sha1(e){return we(e).toString()}static sha256(e){return Je(e).toString()}static sha512(e){return Qe(e).toString()}};var et=class{static{c(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength=5;_seed="changeme";constructor(e){this._baseCode=e}static check(e,t){if(new this(e).secureCode!==t)throw z.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:gt.BadRequest})}_encode(){let e=new K;return e.update(I.parse(this._seed+this._baseCode)),e.finalize().toString(H).substring(0,this._crcLength).toUpperCase()}};var xe=require("class-transformer"),tt=require("ts-luxon");var v=(function(s){return s.ACTIVATE="ACTIVATE",s.BLOCK="BLOCK",s.CHECK="CHECK",s.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",s.FREEZE="FREEZE",s.PURCHASE="PURCHASE",s.RECHARGE="RECHARGE",s.ROLLBACK="ROLLBACK",s.TRANSACTION="TRANSACTION",s.TRANSACTION_DETAIL="TRANSACTION_DETAIL",s.UNFREEZE="UNFREEZE",s.XREFUND="XREFUND",s})({});var he=(function(s){return s.MD5="MD5",s.MD5_HMAC="MD5_HMAC",s.SHA1="SHA1",s.SHA1_HMAC="SHA1_HMAC",s})({});function Ns(s,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(i=(o<3?n(i):o>3?n(e,t,i):n(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i}c(Ns,"_ts_decorate");function Br(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(Br,"_ts_metadata");var rt=class s{static{c(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new ye("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _LOGGER=console;static _OP_CODES={[v.CHECK]:"",[v.TRANSACTION]:"",[v.TRANSACTION_DETAIL]:"",[v.ACTIVATE]:"A",[v.BLOCK]:"B",[v.DIGITAL_ACTIVATE]:"D",[v.FREEZE]:"F",[v.PURCHASE]:"P",[v.RECHARGE]:"G",[v.ROLLBACK]:"R",[v.UNFREEZE]:"U",[v.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies={[he.MD5]:e=>_e(e),[he.MD5_HMAC]:e=>{let t=new K;return t.update(I.parse(e)),t.finalize()},[he.SHA1]:e=>we(e),[he.SHA1_HMAC]:e=>{let t=new ae;return t.update(I.parse(e)),t.finalize()}};_hashStrategy=this._hashStrategies[he.MD5];constructor(e="ACTIVATION",t,r,o){this.gc=e,this.op=t,this.ot=r,this._dto=typeof o=="number"&&o>=0?tt.DateTime.fromMillis(+`${o}000`.slice(0,13)):tt.DateTime.local()}static build({gc:e,op:t,ot:r,dto:o}){return new this(e,t,r,o?.ts)}static explode(e){let t=this.constructor,r=(e||"").split(t._SEP);if(r.length<4)throw new Error(`INVALID_TRANSACTION "${e}"`);return this.build({gc:r[1],op:t.prefixToOperation(r[2]),dto:tt.DateTime.fromSeconds(+r[3])})}static isBase64(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)&&e.length%4===0}static parse(e){this._LOGGER.info(`${this.constructor.name}: trying to parse ${e}`);try{if(this.isBase64(e)){let t=this._AES_ENCODER.decryptAES(e),r=JSON.parse(t);return(0,xe.plainToInstance)(s,r)}else return this.explode(e)}catch(t){throw this._LOGGER.error(`${this.constructor.name}: failed to parse ${e}`,t),new Error(`UNPARSEABLE "${e}"`)}}static prefixToOperation(e){return Object.entries(this._OP_CODES).find(([,r])=>r===e)[0]}serialize(){return(0,xe.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let e=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(e)}};Ns([(0,xe.Expose)(),Br("design:type",Number),Br("design:paramtypes",[])],rt.prototype,"ts",null);var Ts=(function(s){return s.ListDetectiveValidator="ListDetectiveValidator",s.MXValidator="MXValidator",s.SyntaxValidator="SyntaxValidator",s})({});function js(s,e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&(r in s.prototype||Object.defineProperty(s.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r)))});try{let r=new t;Object.getOwnPropertyNames(r).forEach(o=>{o in s.prototype||Object.defineProperty(s.prototype,o,Object.getOwnPropertyDescriptor(r,o))})}catch{}Object.getOwnPropertyNames(t).forEach(r=>{r!=="prototype"&&r!=="name"&&r!=="length"&&(r in s||Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(t,r)))})})}c(js,"smpApplyMixin");var Fs=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function vr(s){return s.match(Fs)}c(vr,"smpAsciiWords");var Fr="\\ud800-\\udfff",ks="\\u0300-\\u036f",Us="\\ufe20-\\ufe2f",Ms="\\u20d0-\\u20ff",Ls="\\u1ab0-\\u1aff",zs="\\u1dc0-\\u1dff",$s=ks+Us+Ms+Ls+zs,kr="\\u2700-\\u27bf",Ur="a-z\\xdf-\\xf6\\xf8-\\xff",Ss="\\xac\\xb1\\xd7\\xf7",Ws="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ks="\\u2000-\\u206f",Gs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Mr="A-Z\\xc0-\\xd6\\xd8-\\xde",Vs="\\ufe0e\\ufe0f",Lr=Ss+Ws+Ks+Gs,zr="['\u2019]",Pr=`[${Lr}]`,qs=`[${$s}]`,$r="\\d",Zs=`[${kr}]`,Sr=`[${Ur}]`,Wr=`[^${Fr}${Lr+$r+kr+Ur+Mr}]`,Xs="\\ud83c[\\udffb-\\udfff]",Hs=`(?:${qs}|${Xs})`,Js=`[^${Fr}]`,Kr="(?:\\ud83c[\\udde6-\\uddff]){2}",Gr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee=`[${Mr}]`,Qs="\\u200d",Dr=`(?:${Sr}|${Wr})`,Ys=`(?:${Ee}|${Wr})`,Nr=`(?:${zr}(?:d|ll|m|re|s|t|ve))?`,Tr=`(?:${zr}(?:D|LL|M|RE|S|T|VE))?`,Vr=`${Hs}?`,qr=`[${Vs}]?`,eo=`(?:${Qs}(?:${[Js,Kr,Gr].join("|")})${qr+Vr})*`,to="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ro="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",so=qr+Vr+eo,jr=`(?:${[Zs,Kr,Gr].join("|")})${so}`,Ue=class{static{c(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${Ee}?${Sr}+${Nr}(?=${[Pr,Ee,"$"].join("|")})`,`${Ys}+${Tr}(?=${[Pr,Ee+Dr,"$"].join("|")})`,`${Ee}?${Dr}+${Nr}`,`${Ee}+${Tr}`,ro,to,`${$r}+`,jr].join("|"),"g");static RS_EMOJI=jr;static unicodeWords(e){return e.match(this.RE_UNICODE_WORDS)}};var Tt=class s{static{c(this,"SmpCommonUtils")}static arrayRemove(e,t){let r=[],o=e.filter((i,n)=>t(i,n)&&r.push(n));return r.reverse().forEach(i=>e.splice(i,1)),o}static assertIsArray(e,t){if(!Array.isArray(e))throw new Error(t||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(e,t){if(!this.isBoolean(e))throw new Error(t||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(e,t){if(!this.isFunction(e))throw new Error(t||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(e,t,r){if(!(e instanceof t))throw new Error(r||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(e,t){if(this.isEmpty(e))throw new Error(t||`${this.constructor.name} => entity was empty`)}static assertIsNumber(e,t){if(typeof e!="number")throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(e,t){if(!this.isNumeric(e))throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsObject(e,t){if(!this.isObject(e))throw new Error(t||`${this.constructor.name} => val was not an object`)}static assertIsString(e,t){if(!this.isString(e))throw new Error(t||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(e,t){if(!e)throw new Error(t||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...e){let t=e.filter(r=>!!r).join("/").replace(/(?<!:)\/\/+/g,"/");return t.startsWith("http")&&!t.endsWith("/")?`${t}/`:t}static downloadBlob(e,t){let r=window.URL.createObjectURL(e),o=document.createElement("a");o.href=r,o.setAttribute("download",t),document.body.appendChild(o),o.click()}static generateRandomHexString(e=12){let t="0123456789abcdef",r="";for(let o=0;o<e;o++){let i=Math.floor(Math.random()*t.length);r+=t[i]}return r}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}static getDecimalPrecision(e){if(this.assertIsNumeric(e),!isFinite(+e))return 0;let t=1,r=0;for(;Math.round(+e*t)/t!==e;)t*=10,r++;return r}static getType(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static isBoolean(e){return typeof e=="boolean"}static isColor(e){if(!e||!this.isString(e))return!1;let t=new Option().style;return t.color=e,t.color!==""}static isEmpty(e){return!e&&e!==0}static isEqual(e,t){function r(){if(e.length!==t.length)return!1;for(let h=0;h<e.length;h++)if(!s.isEqual(e[h],t[h]))return!1;return!0}c(r,"areArraysEqual");function o(){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let h in e)if(Object.prototype.hasOwnProperty.call(e,h)&&!s.isEqual(e[h],t[h]))return!1;return!0}c(o,"areObjectsEqual");function i(){return e.toString()===t.toString()}c(i,"areFunctionsEqual");function n(){return e===t}c(n,"arePrimativesEqual");let a=this.getType(e);return a!==this.getType(t)?!1:a==="array"?r():a==="object"?o():a==="function"?i():n()}static isFormField(e){return/^(?:input|select|textarea|button)$/i.test(e.nodeName)}static isFunction(e){return typeof e==typeof isNaN}static isNotEmpty(e){return!this.isEmpty(e)}static isNumber(e){return typeof e=="number"&&this.isNumeric(e)}static isNumeric(e){return!isNaN(e)}static isObject(e){return!!e&&e===Object(e)&&e.constructor===Object}static isPrimitive(e){let t=this.getType(e);return t!=="function"&&(t!=="object"||!e)}static isString(e){return typeof e=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(e,t){if(this.assertIsFunction(t,`CommonUtils => expected type of iteratee to be Function, got ${typeof t}`),this.isObject(e))return Object.entries(e).reduce((r,[o,i])=>(r.push(t(i,o)),r),[]);if(Array.isArray(e))return e.map(t);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof t}`)}static mapObjectKeys(e,t){return Object.entries(e).reduce((r,[o,i])=>(r[o]=t.call(null,o,i),r),{})}static mapObjectValues(e,t){return this.isObject(e)?Object.entries(e).reduce((r,[o,i])=>(r[o]=t.call(null,i,o),r),{}):{}}static noop(){}static objectHasValue(e,t){return!!~Object.values(e).filter(r=>this.isEqual(r,t))}static omit(e,t){return Object.keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>(o[i]=e[i],o),{})}static parseBoolean(e){return e?/^true$/i.test(e):!1}static parseJsonSafely(e){try{return JSON.parse(e)}catch(t){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:e,error:t});return}}static pick(e,t){return t.reduce((r,o)=>(o in e&&(r[o]=e[o]),r),{})}static runSafely(e,t=null,r=[]){if(this.isFunction(e))return e.apply(t,r)}static sleep(e){return new Promise(t=>setTimeout(t,e))}static sprintf(e,...t){return this.isString(e)&&t.length?this.sprintf(e.replace("%s",String(t.shift())),...t):e}static stripComments(e){return typeof e=="string"?e.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):e}static submitFakeForm({action:e,method:t=xt.POST,data:r,target:o}){let i=Object.entries(r||{}).map(([a,h])=>`<input name="${a}" type="hidden" value="${h}" />`),n=document.createElement("form");n.method=t,n.action=e,n.innerHTML=`${i}`,n.target=o||"_self",document.body.append(n),n.submit()}static toCamelCase(e){return this.words(e.replace(/['\u2019]/g,"")).reduce((t,r,o)=>(r=r.toLowerCase(),t+(o?r.charAt(0).toUpperCase()+r.slice(1):r)),"")}static toKebabCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(e){return this.toCamelCase(e).replace(/^(.)/,t=>t.toUpperCase())}static toSnakeCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(e){return this.toSnakeCase(e).toUpperCase()}static words(e,t){return t===void 0?(Ue.HAS_UNICODE_WORD(e)?Ue.unicodeWords(e):vr(e))||[]:e.match(t)||[]}};var jt=class extends Error{static{c(this,"SmpFilterException")}message;data;constructor(e="Filter Exception",t){super(),this.message=e,this.data=t}};var Ft=require("ts-luxon");var kt=class s{static{c(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return Ft.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix="$1";constructor(e=`sid-xxxx-${+Ft.DateTime.now().ts}`,t=0){this.value=e,this.expiry=t}static parse(e){return new s(e.value,e.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};Te();var Ut=class{static{c(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var ho="1.8.0-next.0";Object.defineProperties(module.exports,{SmpDynamoService:{get:c(()=>(Hr(),F(Xr)).SmpDynamoService,"get")},SmpFirebaseService:{get:c(()=>(Qr(),F(Jr)).SmpFirebaseService,"get")},SmpAbstractRxjsTtlCacheStrategy:{get:c(()=>(ee(),F(Y)).SmpAbstractRxjsTtlCacheStrategy,"get")},smpRxjsCatchOnly:{get:c(()=>(ee(),F(Y)).smpRxjsCatchOnly,"get")},SmpRxjsInMemoryCache:{get:c(()=>(ee(),F(Y)).SmpRxjsInMemoryCache,"get")},smpRxjsQueue:{get:c(()=>(ee(),F(Y)).smpRxjsQueue,"get")},smpRxjsSequence:{get:c(()=>(ee(),F(Y)).smpRxjsSequence,"get")},smpRxjsThrowIfEmpty:{get:c(()=>(ee(),F(Y)).smpRxjsThrowIfEmpty,"get")},smpRxjsThrowOnCondition:{get:c(()=>(ee(),F(Y)).smpRxjsThrowOnCondition,"get")},smpZodDateTime:{get:c(()=>(Kt(),F(Wt)).smpZodDateTime,"get")},SmpZodDateTime:{get:c(()=>(Kt(),F(Wt)).SmpZodDateTime,"get")}});0&&(module.exports={SMP_HEALTHZ,SmpAbstractCacheStrategy,SmpAbstractTtlCacheStrategy,SmpAesCrypt,SmpApiCommonUtils,SmpBaseJwtToken,SmpBaseJwtTokenPlain,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpService,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpApplyMixin,smpIsSmpCachedValue,smpNoop});
1
+ "use strict";var as=Object.create;var Ae=Object.defineProperty;var cs=Object.getOwnPropertyDescriptor;var hs=Object.getOwnPropertyNames;var ls=Object.getPrototypeOf,ds=Object.prototype.hasOwnProperty;var c=(s,e)=>Ae(s,"name",{value:e,configurable:!0});var A=(s,e)=>()=>(s&&(e=s(s=0)),e);var be=(s,e)=>{for(var t in e)Ae(s,t,{get:e[t],enumerable:!0})},St=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hs(e))!ds.call(s,i)&&i!==t&&Ae(s,i,{get:()=>e[i],enumerable:!(r=cs(e,i))||r.enumerable});return s};var fs=(s,e,t)=>(t=s!=null?as(ls(s)):{},St(e||!s||!s.__esModule?Ae(t,"default",{value:s,enumerable:!0}):t,s)),j=s=>St(Ae({},"__esModule",{value:!0}),s);var Y,ot=A(()=>{"use strict";Y=class{static{c(this,"SmpAbstractCacheStrategy")}}});function Be(s){return typeof s=="object"&&s!==null&&"value"in s&&"expiry"in s&&typeof s.expiry=="number"}var nt=A(()=>{"use strict";c(Be,"smpIsSmpCachedValue")});var q,Zt=A(()=>{"use strict";q=(function(s){return s.APPLE="APPLE",s.FACEBOOK="FACEBOOK",s.GOOGLE="GOOGLE",s})({})});var le,Xt=A(()=>{"use strict";le=(function(s){return s.POPUP="POPUP",s.REDIRECT="REDIRECT",s})({})});var Te,dr=A(()=>{"use strict";Te=(function(s){return s.DIFFERENT_CREDENTIAL="auth/account-exists-with-different-credential",s.DIFFERENT_CREDENTIAL_APPLE="auth/account-exists-with-different-credential/apple",s.DIFFERENT_CREDENTIAL_FACEBOOK="auth/account-exists-with-different-credential/facebook",s.DIFFERENT_CREDENTIAL_GOOGLE="auth/account-exists-with-different-credential/google",s.EMAIL_EXISTS="auth/email-already-exists",s.INVALID_ACTION_CODE="auth/invalid-action-code",s.POPUP_BLOCKED="auth/popup-blocked",s.POPUP_CLOSED_BY_USER="auth/popup-closed-by-user",s.USER_NOT_FOUND="auth/user-not-found",s.WRONG_PASSWORD="auth/wrong-password",s})({})});var Fr={};be(Fr,{SmpDynamoService:()=>Dt});var Nr,Je,jr,He,Dt,Ur=A(()=>{"use strict";Nr=require("@aws-sdk/client-dynamodb"),Je=require("@aws-sdk/util-dynamodb"),jr=require("@tonysamperi/logger"),He=(function(s){return s.CouldNotDelete="ERR_COULD_NOT_DELETE",s.CouldNotRead="ERR_COULD_NOT_READ",s.CouldNotWrite="ERR_COULD_NOT_WRITE",s.ConditionalCheckFailedException="ERR_DUPE_TOKEN",s})(He||{}),Dt=class{static{c(this,"SmpDynamoService")}_config;_tableName;get marshall(){return Je.marshall}get unmarshall(){return Je.unmarshall}_db=new Nr.DynamoDB([this._buildConfig()]);_logger=new jr.SmpLoggerMethods;constructor(e,t){this._config=e,this._tableName=t}_buildConfig(){return this._config}_delete(e,t=this._tableName,r){let i={TableName:t,Key:this.marshall(e),...r};return this._db.deleteItem(i).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(He[o.code]||"ERR_COULD_NOT_DELETE")))}_read(e,t=this._tableName,r){let i={TableName:t,Key:this.marshall(e),...r};return this._db.getItem(i).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(He[o.code]||"ERR_COULD_NOT_READ")))}_write(e,t=this._tableName,r){let i={TableName:t,Item:this.marshall(e),...r};return this._db.putItem(i).catch(o=>(this._logger.error("DynamoActionTokensService: couldn't write token to DB",o),Promise.reject(He[o.code]||"ERR_COULD_NOT_WRITE")))}}});var Lr={};be(Lr,{SmpFirebaseService:()=>vt});var kr,je,u,vt,Mr=A(()=>{"use strict";kr=require("@tonysamperi/logger"),je=require("firebase/app"),u=require("firebase/auth");Zt();Xt();dr();vt=class s{static{c(this,"SmpFirebaseService")}static get INSTANCE(){if(!(this._instance instanceof s))throw Error(`${this.constructor.name} instance doesn't exist! Call ${this.constructor.name}.init first!`);return this._instance}static _instance;get config(){return this._config}get enabledSocials(){return this._enabledSocials}get loggedUser(){return this._loggedUser||(this._loggedUser=this._readStoredUser()),this._auth.currentUser||this._loggedUser||void 0}get providersRelation(){return{"facebook.com":q.FACEBOOK,"google.com":q.GOOGLE,"apple.com":q.APPLE}}get socialLoginUXMode(){return this._socialLoginUxMode}get storedUserKey(){return"firebaseUser"}get _auth(){return(0,u.getAuth)(this._app)}_app;_config;_enabledSocials=[];_loggedUser;_logger;_popupErrors=0;_popupFallsBackToRedirect;_providers;_socialLoginUxMode=le.POPUP;constructor(e,t){this._config=e,this._enabledSocials=t.enabledSocials||[],this._socialLoginUxMode=t.socialLoginUxMode||le.POPUP,this._popupFallsBackToRedirect=!!t.popupFallsBackToRedirect,this._buildProviders(),this._logger=t.logger||new kr.SmpLoggerMethods,this._app=(0,je.getApps)().length?(0,je.getApps)()[0]:(0,je.initializeApp)(e),this._watchAuthState()}static init(e,t){return this._instance||(this._instance=new s(e,t)),this._instance}addAuthStateChangedCallback(e){return this._auth.onAuthStateChanged(t=>{e(t||this.loggedUser||null)})}checkActionCode(e){return(0,u.checkActionCode)(this._auth,e)}confirmPasswordReset(e,t){return(0,u.confirmPasswordReset)(this._auth,e,t)}fetchSignInMethodsForEmail(e){return(0,u.fetchSignInMethodsForEmail)(this._auth,e).then(t=>t.map(r=>this.providersRelation[r]||r))}getRedirectResult(){return(0,u.getRedirectResult)(this._auth).catch(async e=>(await this._expandDifferentCredential(e),Promise.reject(e)))}initAppCheck(){}sendEmailVerification(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.sendEmailVerification)(this.loggedUser,e?{url:e}:void 0)}sendPasswordResetEmail(e,t){return(0,u.sendPasswordResetEmail)(this._auth,e,{url:t})}setPersistence(e){return(0,u.setPersistence)(this._auth,e?u.browserLocalPersistence:u.browserSessionPersistence)}signInWithCustomToken(e){return(0,u.signInWithCustomToken)(this._auth,e)}signInWithEmailAndPassword(e,t){return(0,u.signInWithEmailAndPassword)(this._auth,e,t).then(async r=>r.user)}signInWithSocialProvider(e){if(!this._providers[e])throw Error(`Firebase: invalid social key provided! Expected one of ${this.enabledSocials}, got ${e}`);return this._signInWithProvider(this._providers[e])}signOut(){return(0,u.signOut)(this._auth)}updatePassword(e,t){if(!this.loggedUser)throw Error("Firebase: user is not logged!");let r=u.EmailAuthProvider.credential(this.loggedUser.email,e);return(0,u.reauthenticateWithCredential)(this.loggedUser,r).then(()=>(0,u.updatePassword)(this.loggedUser,t))}updateUserProfile(e){if(!this.loggedUser)throw Error("Firebase: user is not logged!");return(0,u.updateProfile)(this.loggedUser,e)}async verifyIdToken(){return this._auth.currentUser?.getIdTokenResult()}_buildProviders(){this._providers=this._enabledSocials.reduce((e,t)=>(t in e&&(e[t]=e[t]),e),{[q.APPLE]:new u.OAuthProvider("apple.com"),[q.FACEBOOK]:new u.FacebookAuthProvider().setCustomParameters({prompt:"select_account"}),[q.GOOGLE]:new u.GoogleAuthProvider().setCustomParameters({prompt:"select_account"})})}async _expandDifferentCredential(e){if(e?.code===Te.DIFFERENT_CREDENTIAL){let t=await this.fetchSignInMethodsForEmail(e.customData.email);throw e.code=Te["DIFFERENT_CREDENTIAL_"+t[0]],e}}_readStoredUser(){try{let e=localStorage.getItem(this.storedUserKey);if(e){this._logger?.debug("Firebase: found local user",e);let t=JSON.parse(e);return{...t,getIdToken:c(()=>Promise.resolve(t.stsTokenManager.accessToken),"getIdToken")}}}catch(e){this._logger.debug("Firebase: error while getting stored user",e)}}async _signInWithProvider(e,t=this.socialLoginUXMode){return(t===le.POPUP?u.signInWithPopup:u.signInWithRedirect)(this._auth,e).then(i=>(this._logger.info(`Firebase: signin with provider ${e.providerId} was successful`),i.user)).catch(async i=>i?.code===Te.POPUP_BLOCKED&&(this._logger.warn(`Firebase: social signin popup blocked (${++this._popupErrors}`),this._popupFallsBackToRedirect&&this._popupErrors>1)?(this._popupErrors=0,this._signInWithProvider(e,le.REDIRECT)):(this._logger.error(`Firebase: sign in with ${e.providerId} errored`,i),await this._expandDifferentCredential(i),Promise.reject(i)))}_updateLocalUser(e){try{e?localStorage.setItem(this.storedUserKey,JSON.stringify(e)):localStorage.removeItem(this.storedUserKey),this._logger.debug("Firebase: updating local user",e),this._loggedUser=e}catch(t){this._logger.warn("Firebase: couldn't update local user",{user:e,error:t})}}_watchAuthState(){this._auth.onAuthStateChanged(e=>{this._logger.debug("Firebase: firebase detected auth state change",e),this._updateLocalUser(e||void 0)})}}});var zr,Pt,ye,Tt=A(()=>{"use strict";zr=require("rxjs"),Pt=require("ts-luxon");ot();nt();ye=class extends Y{static{c(this,"SmpAbstractRxjsTtlCacheStrategy")}flush(){return this._flushRaw()}read(e){return this._readRaw(e).pipe((0,zr.map)(t=>{if(this._isSmpCachedValue(t)){if(t.expiry>=Pt.DateTime.now().ts)return t.value;this._removeRaw(e).subscribe();return}return t}))}remove(e){return this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0)return this._writeRaw(e,t,r);let i=Pt.DateTime.now().ts+r*1e3,o={value:t,expiry:i};return this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Be(e)}}});function $r(s,e){return t=>t.pipe((0,Qe.catchError)(r=>(typeof s==typeof isNaN?Ks(s)?Gs(r,s):s(r):!1)?e(r):(0,Qe.throwError)(()=>r)))}function Ks(s){try{return Reflect.construct(String,[],s),!0}catch{return!1}}function Gs(s,e){return typeof s=="object"&&s!==null&&s.constructor===e}var Qe,Wr=A(()=>{"use strict";Qe=require("rxjs");c($r,"smpRxjsCatchOnly");c(Ks,"isConstructor");c(Gs,"isExactInstance")});var z,Ye,Sr=A(()=>{"use strict";z=require("rxjs");Tt();Ye=class extends ye{static{c(this,"SmpRxjsInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){return(0,z.defer)(()=>(this._staticSelf._storage.clear(),(0,z.of)(void 0)))}_readRaw(e){return(0,z.defer)(()=>(0,z.of)(this._staticSelf._storage.get(e)))}_removeRaw(e){return(0,z.defer)(()=>(this._staticSelf._storage.delete(e),(0,z.of)(void 0)))}_writeRaw(e,t){return(0,z.defer)(()=>(this._staticSelf._storage.set(e,t),(0,z.of)(void 0)))}}});function Kr(s){let e=[];function t(r){return r>=s.length?(0,X.of)(e):(0,X.defer)(()=>s[r]()).pipe((0,X.switchMap)(i=>(e[r]=i,t(r+1))))}return c(t,"runStep"),t(0)}function Gr(s){if(Array.isArray(s))return Kr(s);{let e=Object.keys(s),t=e.map(r=>s[r]);return Kr(t).pipe((0,X.map)(r=>{let i={};return e.forEach((o,n)=>{i[o]=r[n]}),i}))}}var X,qr=A(()=>{"use strict";X=require("rxjs");c(Kr,"smpRxjsSequence");c(Gr,"smpRxjsQueue")});function Vr(s){return(0,xe.from)(s).pipe((0,xe.concatMap)(t=>t()),(0,xe.toArray)())}var xe,Zr=A(()=>{"use strict";xe=require("rxjs");c(Vr,"smpRxjsSequence")});function et(s=Vs){return e=>e.pipe((0,Xr.map)(t=>{if(~qs.indexOf(JSON.stringify(t)))throw s(t);return t}))}var Xr,qs,Vs,Nt=A(()=>{"use strict";Xr=require("rxjs");c(et,"smpRxjsThrowIfEmpty");qs=[void 0,null,!1,0,"","0",[],{}].map(s=>JSON.stringify(s)),Vs=c(()=>new Error,"defaultErrorFactory")});function Hr(s,e){return t=>t.pipe((0,tt.filter)(r=>!s(r)),(0,tt.defaultIfEmpty)(!1),et(e))}var tt,Jr=A(()=>{"use strict";tt=require("rxjs");Nt();c(Hr,"smpRxjsThrowOnCondition")});var H={};be(H,{SmpAbstractRxjsTtlCacheStrategy:()=>ye,SmpRxjsInMemoryCache:()=>Ye,smpRxjsCatchOnly:()=>$r,smpRxjsQueue:()=>Gr,smpRxjsSequence:()=>Vr,smpRxjsThrowIfEmpty:()=>et,smpRxjsThrowOnCondition:()=>Hr});var J=A(()=>{"use strict";Tt();Wr();Sr();qr();Zr();Nt();Jr()});var E,Q,rt,Zs,Qr=A(()=>{"use strict";E=fs(require("zod"),1),Q=require("ts-luxon"),rt=class s extends E.default.ZodType{static{c(this,"SmpZodDateTime")}constructor(e){super({typeName:"SmpZodDateTime",coerce:e?.coerce??!1,checks:e?.checks??[]})}_parse(e){let t=this._getOrReturnCtx(e),r=t.data;if(this._def.coerce&&(r=this._coerceToDateTime(r),!(r instanceof Q.DateTime)||!r.isValid))return E.default.addIssueToContext(t,{code:E.ZodIssueCode.invalid_type,expected:E.ZodParsedType.date,received:E.ZodParsedType.unknown,path:t.path,message:"Invalid date format"}),E.default.INVALID;if((!(r instanceof Q.DateTime)||!r.isValid)&&!this._def.coerce)return E.default.addIssueToContext(t,{code:E.ZodIssueCode.invalid_type,expected:E.ZodParsedType.date,received:E.ZodParsedType.unknown,path:t.path,message:"Input must be a valid DateTime object"}),E.default.INVALID;let i={min:c((o,n,a)=>{if(o.min&&n<o.min)return{code:E.ZodIssueCode.too_small,minimum:o.min.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2265 ${o.min.toISODate()}`,path:a.path}},"min"),max:c((o,n,a)=>{if(o.max&&n>o.max)return{code:E.ZodIssueCode.too_big,maximum:o.max.toMillis(),type:"date",inclusive:!0,message:o.message??`Date must be \u2264 ${o.max.toISODate()}`,path:a.path}},"max"),between:c((o,n,a)=>{if(o.min&&o.max&&(n<o.min||n>o.max))return{code:E.ZodIssueCode.custom,message:o.message??`Date must be between ${o.min.toISODate()} and ${o.max.toISODate()}`,path:a.path}},"between")};for(let o of this._def.checks)if(r instanceof Q.DateTime&&r.isValid){let n=i[o.kind](o,r,t);n&&E.default.addIssueToContext(t,n)}return t.common.issues.length>0?E.default.INVALID:E.default.OK(r)}between(e,t,r){return new s({...this._def,checks:[...this._def.checks,{kind:"between",min:e.toUTC(),max:t.toUTC(),message:r}]})}coerce(){return new s({...this._def,coerce:!0})}max(e,t){return new s({...this._def,checks:[...this._def.checks,{kind:"max",max:e.toUTC(),message:t}]})}min(e,t){return new s({...this._def,checks:[...this._def.checks,{kind:"min",min:e.toUTC(),message:t}]})}_coerceToDateTime(e){if(e instanceof Q.DateTime&&e.isValid)return e;let t={string:c(()=>Q.DateTime.fromJSDate(new Date(e)),"string"),number:c(()=>Q.DateTime.fromMillis(e),"number"),object:c(()=>Q.DateTime.fromJSDate(e),"object"),default:c(()=>null,"default")};return(t[typeof e]||t.default)()}},Zs=c((s={})=>new rt({coerce:s.coerce??!1,checks:[]}),"smpZodDateTime")});var jt={};be(jt,{SmpZodDateTime:()=>rt,smpZodDateTime:()=>Zs});var Ft=A(()=>{"use strict";Qr()});var Hs={};be(Hs,{SMP_HEALTHZ:()=>ms,SmpAbstractCacheStrategy:()=>Y,SmpAbstractTtlCacheStrategy:()=>ee,SmpAesCrypt:()=>ge,SmpApiCommonUtils:()=>lt,SmpBaseJwtToken:()=>ft,SmpBaseJwtTokenPlain:()=>pt,SmpBrowserCache:()=>Ie,SmpCommonUtils:()=>bt,SmpCrypto:()=>qe,SmpErrorResponse:()=>L,SmpFilterException:()=>Ot,SmpFirebaseErrors:()=>Te,SmpGenericResponse:()=>he,SmpGiftcardTransaction:()=>Xe,SmpGiftcardTransactionHashStrategies:()=>ne,SmpGiftcardTransactionOps:()=>C,SmpHttpService:()=>ct,SmpHttpSessionStorageCache:()=>Ce,SmpHttpStatusCodes:()=>ht,SmpInMemoryCache:()=>De,SmpMarketingCloudValidators:()=>ys,SmpRegularExpressions:()=>Ct,SmpResponseMessage:()=>F,SmpResponseMessageTypes:()=>K,SmpRestVerbs:()=>dt,SmpSecureCode:()=>Ve,SmpSid:()=>It,SmpSocialSignInKeys:()=>q,SmpSocialSignInUxModes:()=>le,VERSION:()=>Xs,smpApplyMixin:()=>xs,smpIsSmpCachedValue:()=>Be,smpNoop:()=>Tr.smpNoop});module.exports=j(Hs);var Oe=require("class-transformer");var G=require("class-transformer");var it=require("class-transformer");var K=(function(s){return s.INFO="INFO",s.SUCCESS="SUCCESS",s.WARNING="WARNING",s.ERROR="ERROR",s})({});function Kt(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o}c(Kt,"_ts_decorate");function Fe(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(Fe,"_ts_metadata");var F=class s{static{c(this,"SmpResponseMessage")}_message;_type;get message(){return this._message}get type(){return this._type}constructor(e,t=K.ERROR){this._message=e,this._type=t}static sanitizeMessages(e){return typeof e=="string"?e.length?[new s(e)]:[]:[e].flat().map(t=>typeof t=="string"?new s(t):t)}};Kt([(0,it.Expose)(),Fe("design:type",String),Fe("design:paramtypes",[])],F.prototype,"message",null);Kt([(0,it.Expose)(),Fe("design:type",typeof K>"u"?Object:K),Fe("design:paramtypes",[])],F.prototype,"type",null);function ps(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o}c(ps,"_ts_decorate");function Gt(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(Gt,"_ts_metadata");var he=class s{static{c(this,"SmpGenericResponse")}_messages;data;set messages(e){this._messages=F.sanitizeMessages(e)}get messages(){return this._messages}constructor(e=[],t){this._messages=e,this.data=t}static buildInfo(e,t){return new s([e].flat().map(r=>new F(r,K.INFO)),t)}static buildSuccess(e,t){return new s([e].flat().map(r=>new F(r,K.SUCCESS)),t)}static fromPlain(e){return(0,G.plainToInstance)(s,e)}isError(){return!this.isSuccess()}isSuccess(){return"_errorCode"in this&&this._errorCode!==null&&this._errorCode!==void 0}serialize(){return(0,G.instanceToPlain)(this,{excludePrefixes:["_"]})}};ps([(0,G.Expose)(),(0,G.Transform)(({value:s})=>s?.length?s:void 0),Gt("design:type",Object),Gt("design:paramtypes",[])],he.prototype,"messages",null);function qt(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o}c(qt,"_ts_decorate");function Ue(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(Ue,"_ts_metadata");var L=class s extends he{static{c(this,"SmpErrorResponse")}_errorCode;_status;static get DEFAULT_MESSAGES(){return[new F("GENERIC_ERROR")]}get errorCode(){return this._errorCode}get status(){return this._status}get timestamp(){return this._timestamp}_timestamp=Date.now();constructor(e=s.DEFAULT_MESSAGES,t="GENERIC_ERROR",r=500,i){super(e,i),this._errorCode=t,this._status=r}static create({messages:e=s.DEFAULT_MESSAGES,...t}={}){return new s(F.sanitizeMessages(e),t.errorCode,t.status,t.data)}static fromPlain(e){let t=(0,Oe.plainToInstance)(us,e,{excludePrefixes:["_"]}),r=new s;return Object.getOwnPropertyNames(t).forEach(i=>{i in r&&(r[i]=t[i])}),r}};qt([(0,Oe.Expose)(),Ue("design:type",Object),Ue("design:paramtypes",[])],L.prototype,"errorCode",null);qt([(0,Oe.Expose)(),Ue("design:type",Number),Ue("design:paramtypes",[])],L.prototype,"timestamp",null);var us=class extends L{static{c(this,"SmpErrorResponseMutable")}set errorCode(e){this._errorCode=e}set status(e){this._status=e}set timestamp(e){this._timestamp=e}};var at=require("ts-luxon");ot();nt();var ee=class extends Y{static{c(this,"SmpAbstractTtlCacheStrategy")}flush(){this._flushRaw()}read(e){let t=this._readRaw(e);if(this._isSmpCachedValue(t)){if(t.expiry>=at.DateTime.now().ts)return t.value;this._removeRaw(e);return}return t}remove(e){this._removeRaw(e)}write(e,t,r){if(isNaN(+r)||+r<=0){this._writeRaw(e,t,r);return}let i=at.DateTime.now().ts+r*1e3,o={value:t,expiry:i};this._writeRaw(e,o,r)}_isSmpCachedValue(e){return Be(e)}};var Ie=class extends ee{static{c(this,"SmpBrowserCache")}_storage;_prefix;constructor(e,t){super(),this._storage=e,this._prefix=t}_flushRaw(){let e=[],t=-1;for(;++t<this._storage.length;){let r=this._storage.key(t);r&&r.startsWith(this._prefix)&&e.push(r)}for(t=-1;++t<e.length;)this._storage.removeItem(e[t])}_readRaw(e){let t=this._storage.getItem(this._prefix+e);try{return t?JSON.parse(t):void 0}catch{console.warn(`${this.constructor.name}: failed to parse cache item for key ${this._prefix+e}`);return}}_removeRaw(e){this._storage.removeItem(this._prefix+e)}_writeRaw(e,t){try{this._storage.setItem(this._prefix+e,JSON.stringify(t))}catch(r){console.warn(`${this.constructor.name}: failed to write cache item for key ${this._prefix+e}`,r)}}};var Ce=class extends Ie{static{c(this,"SmpHttpSessionStorageCache")}constructor(){super(sessionStorage,"smp_rest_cache_")}};var De=class extends ee{static{c(this,"SmpInMemoryCache")}static _storage=new Map;get _staticSelf(){return this.constructor}_flushRaw(){this._staticSelf._storage.clear()}_readRaw(e){return this._staticSelf._storage.get(e)}_removeRaw(e){this._staticSelf._storage.delete(e)}_writeRaw(e,t){this._staticSelf._storage.set(e,t)}};var ct=class{static{c(this,"SmpHttpService")}static _cachePrefix="smp_rest_cache_";static _cacheStrategy=typeof sessionStorage<"u"?new Ce:new De;static _config={cachePrefix:this._cachePrefix,shared:new Map};static _errorClass=L;static _mergeParamsFallbackBaseUrl="https://ts-mapi-core.com";static $http(e){return this._generateAjax(e)}static async _generateAjax(e){if(e.cacheKey){let t=this._cacheRead(e.cacheKey);return t?Promise.resolve(t):this._generateAjaxBase(e).then(r=>(e.cacheKey&&this._cacheWrite(e.cacheKey,r),r))}return this._generateAjaxBase(e)}static async _generateAjaxBase(e){let t=await this._preprocessRequest(e),r={method:t.method,headers:new Headers({"content-type":"application/json",...t.headers}),body:t.body?JSON.stringify(t.body):null};return t.useCredentials&&(r.credentials="include"),t.url=this.mergeQueryParams(t.url,t.queryParams),fetch(t.url,r).then(i=>this._preprocessResponse(e,i)).then(i=>{if(i.ok){if(i.status===204||i.headers.get("content-length")==="0")return null;switch(t.responseType){case"blob":return i.blob();case"arraybuffer":return i.arrayBuffer();case"text":return i.text();case"json":default:return i.json()}}return i.json().then(o=>{let n=o;try{n=this._errorClass.fromPlain(o)}catch(a){console.debug("http: failed to parse error response into ErrorResponse",a)}return Promise.reject({status:i.status,message:i.statusText,body:n})})})}static cacheFlush(){this._cacheStrategy.flush()}static mergeQueryParams(e,t){let r=e.startsWith("http");if(t){let i=new URL(e,globalThis?.location?.origin||this._mergeParamsFallbackBaseUrl),o=Object.fromEntries(i.searchParams.entries());i.search=new URLSearchParams({...o,...Object.fromEntries(Object.entries(t).map(([n,a])=>[n,`${a}`]))}).toString(),e=r?i.href:i.pathname+i.search}return e}static _cacheKey(e){return`${this._config.cachePrefix}${e}`}static _cachePop(e){let t=this._cacheRead(e);return this._cacheRemove(e),t}static _cacheRead(e){return this._cacheStrategy.read(this._cacheKey(e))}static _cacheRemove(e){this._cacheStrategy.remove(this._cacheKey(e))}static _cacheWrite(e,t){this._cacheStrategy.write(this._cacheKey(e),t)}static async _preprocessRequest(e){return e}static async _preprocessResponse(e,t){return t}};var ht=(function(s){return s[s.Continue=100]="Continue",s[s.SwitchingProtocols=101]="SwitchingProtocols",s[s.Processing=102]="Processing",s[s.EarlyHints=103]="EarlyHints",s[s.Ok=200]="Ok",s[s.Created=201]="Created",s[s.Accepted=202]="Accepted",s[s.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",s[s.NoContent=204]="NoContent",s[s.ResetContent=205]="ResetContent",s[s.PartialContent=206]="PartialContent",s[s.MultiStatus=207]="MultiStatus",s[s.AlreadyReported=208]="AlreadyReported",s[s.ImUsed=226]="ImUsed",s[s.MultipleChoices=300]="MultipleChoices",s[s.MovedPermanently=301]="MovedPermanently",s[s.Found=302]="Found",s[s.SeeOther=303]="SeeOther",s[s.NotModified=304]="NotModified",s[s.UseProxy=305]="UseProxy",s[s.Unused=306]="Unused",s[s.TemporaryRedirect=307]="TemporaryRedirect",s[s.PermanentRedirect=308]="PermanentRedirect",s[s.BadRequest=400]="BadRequest",s[s.Unauthorized=401]="Unauthorized",s[s.PaymentRequired=402]="PaymentRequired",s[s.Forbidden=403]="Forbidden",s[s.NotFound=404]="NotFound",s[s.MethodNotAllowed=405]="MethodNotAllowed",s[s.NotAcceptable=406]="NotAcceptable",s[s.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",s[s.RequestTimeout=408]="RequestTimeout",s[s.Conflict=409]="Conflict",s[s.Gone=410]="Gone",s[s.LengthRequired=411]="LengthRequired",s[s.PreconditionFailed=412]="PreconditionFailed",s[s.PayloadTooLarge=413]="PayloadTooLarge",s[s.UriTooLong=414]="UriTooLong",s[s.UnsupportedMediaType=415]="UnsupportedMediaType",s[s.RangeNotSatisfiable=416]="RangeNotSatisfiable",s[s.ExpectationFailed=417]="ExpectationFailed",s[s.ImATeapot=418]="ImATeapot",s[s.MisdirectedRequest=421]="MisdirectedRequest",s[s.UnprocessableEntity=422]="UnprocessableEntity",s[s.Locked=423]="Locked",s[s.FailedDependency=424]="FailedDependency",s[s.TooEarly=425]="TooEarly",s[s.UpgradeRequired=426]="UpgradeRequired",s[s.PreconditionRequired=428]="PreconditionRequired",s[s.TooManyRequests=429]="TooManyRequests",s[s.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",s[s.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",s[s.InternalServerError=500]="InternalServerError",s[s.NotImplemented=501]="NotImplemented",s[s.BadGateway=502]="BadGateway",s[s.ServiceUnavailable=503]="ServiceUnavailable",s[s.GatewayTimeout=504]="GatewayTimeout",s[s.HttpVersionNotSupported=505]="HttpVersionNotSupported",s[s.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",s[s.InsufficientStorage=507]="InsufficientStorage",s[s.LoopDetected=508]="LoopDetected",s[s.NotExtended=510]="NotExtended",s[s.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",s})({});var Vt=require("@tonysamperi/logger");var lt=class{static{c(this,"SmpApiCommonUtils")}static _javascriptVariablePattern="[a-zA-Z_$][a-zA-Z_$0-9]*";static _logger=new Vt.SmpLoggerMethods;static _pathParamRegex=new RegExp(`\\{(${this._javascriptVariablePattern})\\}`,"g");static credentialsToBasicAuth(e,t){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}static fromBearer(e=""){return e.split(" ")[1]}static getCountryFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[0]?.toUpperCase()}static getLanguageFromReferer(e){return this.getLocaleFromReferer(e)?.split("-")[1]}static getLocaleFromReferer(e){return e?.match(/\/([A-Z]{2}-[A-Z]{2})\//i)?.[1]}static interpolateParams(e,t){try{return e.replace(this._pathParamRegex,(r,i)=>{let o=t[i];return o!==void 0?encodeURIComponent(o):r})}catch(r){this._logger.warn(`${this.constructor.name}: couldn't interpolate params`,r)}return e}};var ms={status:"OK"};var dt=(function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s.PATCH="PATCH",s})({});var ft=class{static{c(this,"SmpBaseJwtToken")}_access_token;_exp;_iss;get access_token(){return this._access_token}get exp(){return this._exp}get iss(){return this._iss}constructor(e,t,r){this._access_token=e,this._exp=t,this._iss=r}serialize(){return{access_token:this._access_token,exp:this._exp,iss:this._iss}}};var pt=class{static{c(this,"SmpBaseJwtTokenPlain")}access_token;exp;iss};var V=class{static{c(this,"Hex")}static parse(e){let t=e.length,r=[];for(let i=0;i<t;i+=2)r[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new _(r,t/2)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let i=e.words[r>>>2]>>>24-r%4*8&255;t.push((i>>>4).toString(16)),t.push((i&15).toString(16))}return t.join("")}};var _=class ut{static{c(this,"WordArray")}constructor(e,t){this.words=e||[],t!==void 0?this.sigBytes=t:this.sigBytes=this.words.length*4}static random(e){let t=[],r=c(function(i){let o=987654321,n=4294967295;return function(){o=36969*(o&65535)+(o>>16)&n,i=18e3*(i&65535)+(i>>16)&n;let a=(o<<16)+i&n;return a/=4294967296,a+=.5,a*(Math.random()>.5?1:-1)}},"r");for(let i=0,o;i<e;i+=4){let n=r((o||Math.random())*4294967296);o=n()*987654071,t.push(n()*4294967296|0)}return new ut(t,e)}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new ut(this.words.slice(0),this.sigBytes)}concat(e){if(this.clamp(),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let r=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];return this.sigBytes+=e.sigBytes,this}toString(e){return(e||V).stringify(this)}};var ke=class{static{c(this,"Latin1")}static parse(e){let t=e.length,r=[];for(let i=0;i<t;i++)r[i>>>2]|=(e.charCodeAt(i)&255)<<24-i%4*8;return new _(r,t)}static stringify(e){let t=[];for(let r=0;r<e.sigBytes;r++){let i=e.words[r>>>2]>>>24-r%4*8&255;t.push(String.fromCharCode(i))}return t.join("")}};var O=class{static{c(this,"Utf8")}static parse(e){return ke.parse(unescape(encodeURIComponent(e)))}static stringify(e){try{return decodeURIComponent(escape(ke.stringify(e)))}catch(t){throw console.error("Malformed UTF-8 data",t),new Error("Malformed UTF-8 data")}}};var Le=class{static{c(this,"BufferedBlockAlgorithm")}constructor(e){this._minBufferSize=0,this.cfg=Object.assign({blockSize:1},e),this._data=new _,this._nDataBytes=0}clone(){let e=this.constructor();for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e[t]=this[t]);return e._data=this._data.clone(),e}reset(){this._data=new _,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=O.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){if(!this.cfg.blockSize)throw new Error("missing blockSize in config");let t=this.cfg.blockSize*4,r=this._data.sigBytes/t;e?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);let i=r*this.cfg.blockSize,o=Math.min(i*4,this._data.sigBytes),n;if(i){for(let a=0;a<i;a+=this.cfg.blockSize)this._doProcessBlock(this._data.words,a);n=this._data.words.splice(0,i),this._data.sigBytes-=o}return new _(n,o)}};var de=class{static{c(this,"CipherParams")}constructor(e){this.ciphertext=e.ciphertext,this.key=e.key,this.iv=e.iv,this.salt=e.salt,this.algorithm=e.algorithm,this.mode=e.mode,this.padding=e.padding,this.blockSize=e.blockSize,this.formatter=e.formatter}extend(e){return e.ciphertext!==void 0&&(this.ciphertext=e.ciphertext),e.key!==void 0&&(this.key=e.key),e.iv!==void 0&&(this.iv=e.iv),e.salt!==void 0&&(this.salt=e.salt),e.algorithm!==void 0&&(this.algorithm=e.algorithm),e.mode!==void 0&&(this.mode=e.mode),e.padding!==void 0&&(this.padding=e.padding),e.blockSize!==void 0&&(this.blockSize=e.blockSize),e.formatter!==void 0&&(this.formatter=e.formatter),this}toString(e){if(e)return e.stringify(this);if(this.formatter)return this.formatter.stringify(this);throw new Error("cipher needs a formatter to be able to convert the result into a string")}};var $=class{static{c(this,"Base64")}static parse(e){let t=e.length;if(this._reverseMap===void 0){this._reverseMap=[];for(let i=0;i<this._map.length;i++)this._reverseMap[this._map.charCodeAt(i)]=i}let r=this._map.charAt(64);if(r){let i=e.indexOf(r);i!==-1&&(t=i)}return this.parseLoop(e,t,this._reverseMap)}static parseLoop(e,t,r){let i=[],o=0;for(let n=0;n<t;n++)if(n%4){let a=r[e.charCodeAt(n-1)]<<n%4*2,h=r[e.charCodeAt(n)]>>>6-n%4*2;i[o>>>2]|=(a|h)<<24-o%4*8,o++}return new _(i,o)}static stringify(e){e.clamp();let t=[];for(let i=0;i<e.sigBytes;i+=3){let o=e.words[i>>>2]>>>24-i%4*8&255,n=e.words[i+1>>>2]>>>24-(i+1)%4*8&255,a=e.words[i+2>>>2]>>>24-(i+2)%4*8&255,h=o<<16|n<<8|a;for(let p=0;p<4&&i+p*.75<e.sigBytes;p++)t.push(this._map.charAt(h>>>6*(3-p)&63))}let r=this._map.charAt(64);if(r)for(;t.length%4;)t.push(r);return t.join("")}};$._map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";$._reverseMap=void 0;var Me=class{static{c(this,"OpenSSL")}static parse(e){let t=$.parse(e),r;return t.words[0]===1398893684&&t.words[1]===1701076831&&(r=new _(t.words.slice(2,4)),t.words.splice(0,4),t.sigBytes-=16),new de({ciphertext:t,salt:r})}static stringify(e){if(!e.ciphertext)throw new Error("missing ciphertext in params");let t=e.ciphertext,r=e.salt,i;if(r){if(typeof r=="string")throw new Error("salt is expected to be a WordArray");i=new _([1398893684,1701076831]).concat(r).concat(t)}else i=t;return i.toString($)}};var te=class{static{c(this,"SerializableCipher")}static decrypt(e,t,r,i){let o=Object.assign({},this.cfg,i);if(!o.format)throw new Error("could not determine format");if(t=this._parse(t,o.format),!t.ciphertext)throw new Error("could not determine ciphertext");return e.createDecryptor(r,o).finalize(t.ciphertext)}static encrypt(e,t,r,i){let o=Object.assign({},this.cfg,i),n=e.createEncryptor(r,o),a=n.finalize(t);return new de({ciphertext:a,key:r,iv:n.cfg.iv,algorithm:e,mode:n.cfg.mode,padding:n.cfg.padding,blockSize:n.cfg.blockSize,formatter:o.format})}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};te.cfg={blockSize:4,iv:new _([]),format:Me};var b=class extends Le{static{c(this,"Hasher")}constructor(e){super(Object.assign({blockSize:512/32},e)),this.reset()}static _createHelper(e){function t(r,i){return new e(i).finalize(r)}return c(t,"helper"),t}finalize(e){return e&&this._append(e),this._doFinalize()}update(e){return this._append(e),this._process(),this}};var d=[];for(let s=0;s<64;s++)d[s]=Math.abs(Math.sin(s+1))*4294967296|0;var W=class f extends b{static{c(this,"MD5")}get hash(){return this._hash}static FF(e,t,r,i,o,n,a){let h=e+(t&r|~t&i)+o+a;return(h<<n|h>>>32-n)+t}static GG(e,t,r,i,o,n,a){let h=e+(t&i|r&~i)+o+a;return(h<<n|h>>>32-n)+t}static HH(e,t,r,i,o,n,a){let h=e+(t^r^i)+o+a;return(h<<n|h>>>32-n)+t}static II(e,t,r,i,o,n,a){let h=e+(r^(t|~i))+o+a;return(h<<n|h>>>32-n)+t}reset(){super.reset(),this._hash=new _([1732584193,4023233417,2562383102,271733878])}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;this._data.words[t>>>5]|=128<<24-t%32;let r=Math.floor(e/4294967296),i=e;this._data.words[(t+64>>>9<<4)+15]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,this._data.words[(t+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,this._data.sigBytes=(this._data.words.length+1)*4,this._process();for(let o=0;o<4;o++)this._hash.words[o]=(this._hash.words[o]<<8|this._hash.words[o]>>>24)&16711935|(this._hash.words[o]<<24|this._hash.words[o]>>>8)&4278255360;return this._hash}_doProcessBlock(e,t){for(let h=0;h<16;h++){let p=t+h,g=e[p];e[p]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}let r=Array.from({length:16});for(let h=0;h<16;h++)r[h]=e[t+h];let i=this._hash.words[0],o=this._hash.words[1],n=this._hash.words[2],a=this._hash.words[3];i=f.FF(i,o,n,a,r[0],7,d[0]),a=f.FF(a,i,o,n,r[1],12,d[1]),n=f.FF(n,a,i,o,r[2],17,d[2]),o=f.FF(o,n,a,i,r[3],22,d[3]),i=f.FF(i,o,n,a,r[4],7,d[4]),a=f.FF(a,i,o,n,r[5],12,d[5]),n=f.FF(n,a,i,o,r[6],17,d[6]),o=f.FF(o,n,a,i,r[7],22,d[7]),i=f.FF(i,o,n,a,r[8],7,d[8]),a=f.FF(a,i,o,n,r[9],12,d[9]),n=f.FF(n,a,i,o,r[10],17,d[10]),o=f.FF(o,n,a,i,r[11],22,d[11]),i=f.FF(i,o,n,a,r[12],7,d[12]),a=f.FF(a,i,o,n,r[13],12,d[13]),n=f.FF(n,a,i,o,r[14],17,d[14]),o=f.FF(o,n,a,i,r[15],22,d[15]),i=f.GG(i,o,n,a,r[1],5,d[16]),a=f.GG(a,i,o,n,r[6],9,d[17]),n=f.GG(n,a,i,o,r[11],14,d[18]),o=f.GG(o,n,a,i,r[0],20,d[19]),i=f.GG(i,o,n,a,r[5],5,d[20]),a=f.GG(a,i,o,n,r[10],9,d[21]),n=f.GG(n,a,i,o,r[15],14,d[22]),o=f.GG(o,n,a,i,r[4],20,d[23]),i=f.GG(i,o,n,a,r[9],5,d[24]),a=f.GG(a,i,o,n,r[14],9,d[25]),n=f.GG(n,a,i,o,r[3],14,d[26]),o=f.GG(o,n,a,i,r[8],20,d[27]),i=f.GG(i,o,n,a,r[13],5,d[28]),a=f.GG(a,i,o,n,r[2],9,d[29]),n=f.GG(n,a,i,o,r[7],14,d[30]),o=f.GG(o,n,a,i,r[12],20,d[31]),i=f.HH(i,o,n,a,r[5],4,d[32]),a=f.HH(a,i,o,n,r[8],11,d[33]),n=f.HH(n,a,i,o,r[11],16,d[34]),o=f.HH(o,n,a,i,r[14],23,d[35]),i=f.HH(i,o,n,a,r[1],4,d[36]),a=f.HH(a,i,o,n,r[4],11,d[37]),n=f.HH(n,a,i,o,r[7],16,d[38]),o=f.HH(o,n,a,i,r[10],23,d[39]),i=f.HH(i,o,n,a,r[13],4,d[40]),a=f.HH(a,i,o,n,r[0],11,d[41]),n=f.HH(n,a,i,o,r[3],16,d[42]),o=f.HH(o,n,a,i,r[6],23,d[43]),i=f.HH(i,o,n,a,r[9],4,d[44]),a=f.HH(a,i,o,n,r[12],11,d[45]),n=f.HH(n,a,i,o,r[15],16,d[46]),o=f.HH(o,n,a,i,r[2],23,d[47]),i=f.II(i,o,n,a,r[0],6,d[48]),a=f.II(a,i,o,n,r[7],10,d[49]),n=f.II(n,a,i,o,r[14],15,d[50]),o=f.II(o,n,a,i,r[5],21,d[51]),i=f.II(i,o,n,a,r[12],6,d[52]),a=f.II(a,i,o,n,r[3],10,d[53]),n=f.II(n,a,i,o,r[10],15,d[54]),o=f.II(o,n,a,i,r[1],21,d[55]),i=f.II(i,o,n,a,r[8],6,d[56]),a=f.II(a,i,o,n,r[15],10,d[57]),n=f.II(n,a,i,o,r[6],15,d[58]),o=f.II(o,n,a,i,r[13],21,d[59]),i=f.II(i,o,n,a,r[4],6,d[60]),a=f.II(a,i,o,n,r[11],10,d[61]),n=f.II(n,a,i,o,r[2],15,d[62]),o=f.II(o,n,a,i,r[9],21,d[63]),this._hash.words[0]=this._hash.words[0]+i|0,this._hash.words[1]=this._hash.words[1]+o|0,this._hash.words[2]=this._hash.words[2]+n|0,this._hash.words[3]=this._hash.words[3]+a|0}};var mt=class Ht{static{c(this,"EVPKDF")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:W,iterations:1},e)}static execute(e,t,r){return new Ht(r).compute(e,t)}compute(e,t){let r=new this.cfg.hasher,i=new _,o;for(;i.words.length<this.cfg.keySize;){o&&r.update(o),o=r.update(e).finalize(t),r.reset();for(let n=1;n<this.cfg.iterations;n++)o=r.finalize(o),r.reset();i.concat(o)}return i.sigBytes=this.cfg.keySize*4,i}};var Jt=class{static{c(this,"OpenSSLKdf")}static execute(e,t,r,i){i||(i=_.random(64/8));let o=new mt({keySize:t+r}).compute(e,i),n=new _(o.words.slice(t),r*4);return o.sigBytes=t*4,new de({key:o,iv:n,salt:i})}};var ze=class{static{c(this,"PasswordBasedCipher")}static decrypt(e,t,r,i){let o=Object.assign({},this.cfg,i);if(o.format===void 0)throw new Error("missing format in config");if(t=this._parse(t,o.format),o.kdf===void 0)throw new Error("the key derivation function must be set");let n=o.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv!==void 0&&(o.iv=n.iv),te.decrypt.call(this,e,t,n.key,o)}static encrypt(e,t,r,i){let o=Object.assign({},this.cfg,i);if(o.kdf===void 0)throw new Error("missing kdf in config");let n=o.kdf.execute(r,e.keySize,e.ivSize);return n.iv!==void 0&&(o.iv=n.iv),te.encrypt.call(this,e,t,n.key,o).extend(n)}static _parse(e,t){return typeof e=="string"?t.parse(e):e}};ze.cfg={blockSize:4,iv:new _([]),format:Me,kdf:Jt};var Qt=class{static{c(this,"CipherHelper")}constructor(e){this._cipher=e}decrypt(e,t,r){return typeof t=="string"?ze.decrypt(this._cipher,e,t,r):te.decrypt(this._cipher,e,t,r)}encrypt(e,t,r){return typeof t=="string"?ze.encrypt(this._cipher,e,t,r):te.encrypt(this._cipher,e,t,r)}};var fe=class extends Le{static{c(this,"Cipher")}constructor(e,t,r){super(Object.assign({blockSize:1},r)),this._xformMode=e,this._key=t,this.reset()}static _createHelper(e){return new Qt(e)}static createDecryptor(e,t){let r=this;return new r(this._DEC_XFORM_MODE,e,t)}static createEncryptor(e,t){return new this(this._ENC_XFORM_MODE,e,t)}finalize(e){return e&&this._append(e),this._doFinalize()}process(e){return this._append(e),this._process()}};fe.ivSize=4;fe.keySize=4;fe._DEC_XFORM_MODE=2;fe._ENC_XFORM_MODE=1;var re=class{static{c(this,"BlockCipherModeAlgorithm")}constructor(e,t){this.init(e,t)}init(e,t){this._cipher=e,this._iv=t}};var $e=class{static{c(this,"BlockCipherMode")}static createDecryptor(e,t){let r=this.Decryptor;return new r(e,t)}static createEncryptor(e,t){let r=this.Encryptor;return new r(e,t)}};$e.Decryptor=re;$e.Encryptor=re;var Yt=class extends re{static{c(this,"CBCEncryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");this.xorBlock(e,t,this._cipher.cfg.blockSize),this._cipher.encryptBlock(e,t),this._prevBlock=e.slice(t,t+this._cipher.cfg.blockSize)}xorBlock(e,t,r){let i;this._iv?(i=this._iv,this._iv=void 0):i=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=i[o]}};var er=class extends re{static{c(this,"CBCDecryptor")}get prevBlock(){return this._prevBlock}processBlock(e,t){if(this._cipher.cfg.blockSize===void 0)throw new Error("missing blockSize in cipher config");let r=e.slice(t,t+this._cipher.cfg.blockSize);this._cipher.decryptBlock(e,t),this.xorBlock(e,t,this._cipher.cfg.blockSize),this._prevBlock=r}xorBlock(e,t,r){let i;this._iv?(i=this._iv,this._iv=void 0):i=this._prevBlock;for(let o=0;o<r;o++)e[t+o]^=i[o]}};var Z=class extends $e{static{c(this,"CBC")}};Z.Decryptor=er;Z.Encryptor=Yt;var pe=class{static{c(this,"PKCS7")}static pad(e,t){let r=t*4,i=r-e.sigBytes%r,o=i<<24|i<<16|i<<8|i,n=[];for(let h=0;h<i;h+=4)n.push(o);let a=new _(n,i);e.concat(a)}static unpad(e){let t=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=t}};var We=class extends fe{static{c(this,"BlockCipher")}constructor(e,t,r){super(e,t,Object.assign({blockSize:4,mode:Z,padding:pe},r))}reset(){if(super.reset(),this.cfg.mode===void 0)throw new Error("missing mode in config");let e;this._xformMode===this.constructor._ENC_XFORM_MODE?e=this.cfg.mode.createEncryptor:(e=this.cfg.mode.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator===e?this._mode.init(this,this.cfg.iv&&this.cfg.iv.words):(this._mode=e.call(this.cfg.mode,this,this.cfg.iv&&this.cfg.iv.words),this._mode.__creator=e)}_doFinalize(){if(this.cfg.padding===void 0)throw new Error("missing padding in config");let e;if(this._xformMode===this.constructor._ENC_XFORM_MODE){if(this.cfg.blockSize===void 0)throw new Error("missing blockSize in config");this.cfg.padding.pad(this._data,this.cfg.blockSize),e=this._process(!0)}else e=this._process(!0),this.cfg.padding.unpad(e);return e}_doProcessBlock(e,t){this._mode.processBlock(e,t)}};var l=class M{static{c(this,"X64Word")}constructor(e,t){this.high=e,this.low=t}add(e){let t=this.low+e.low|0,r=t>>>0<this.low>>>0?1:0,i=this.high+e.high+r|0;return new M(i,t)}and(e){return new M(this.high&e.high,this.low&e.low)}not(){return new M(~this.high,~this.low)}or(e){return new M(this.high|e.high,this.low|e.low)}rotL(e){return this.shiftL(e).or(this.shiftR(64-e))}rotR(e){return this.shiftR(e).or(this.shiftL(64-e))}shiftL(e){return e<32?new M(this.high<<e|this.low>>>32-e,this.low<<e):new M(this.low<<e-32,0)}shiftR(e){return e<32?new M(this.high>>>e,this.low>>>e|this.high<<32-e):new M(0,this.high>>>e-32)}xor(e){return new M(this.high^e.high,this.low^e.low)}};var tr=class gt{static{c(this,"X64WordArray")}constructor(e=[],t){this.words=e,this.sigBytes=t!==void 0?t:e.length*8}static create(e=[],t){return new gt(e,t)}clone(){let e=this.words.map(t=>new l(t.high,t.low));return new gt(e,this.sigBytes)}toX32(){let e=[];for(let t of this.words)e.push(t.high,t.low);return new _(e,this.sigBytes)}};var I=[],rr=[],sr=[],ir=[],or=[],nr=[],_t=[],wt=[],yt=[],xt=[];(function(){let s=[];for(let r=0;r<256;r++)r<128?s[r]=r<<1:s[r]=r<<1^283;let e=0,t=0;for(let r=0;r<256;r++){let i=t^t<<1^t<<2^t<<3^t<<4;i=i>>>8^i&255^99,I[e]=i,rr[i]=e;let o=s[e],n=s[o],a=s[n],h=s[i]*257^i*16843008;sr[e]=h<<24|h>>>8,ir[e]=h<<16|h>>>16,or[e]=h<<8|h>>>24,nr[e]=h,h=a*16843009^n*65537^o*257^e*16843008,_t[i]=h<<24|h>>>8,wt[i]=h<<16|h>>>16,yt[i]=h<<8|h>>>24,xt[i]=h,e?(e=o^s[s[s[a^o]]],t^=s[s[t]]):e=t=1}})();var gs=[0,1,2,4,8,16,32,64,128,27,54],Se=class extends We{static{c(this,"AES")}constructor(e,t,r){super(e,t,r),super.reset()}decryptBlock(e,t){let r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,_t,wt,yt,xt,rr),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r}encryptBlock(e,t){this._doCryptBlock(e,t,this._keySchedule,sr,ir,or,nr,I)}reset(){if(super.reset(),this._nRounds&&this._keyPriorReset===this._key)return;let e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,o=((this._nRounds=r+6)+1)*4,n=this._keySchedule=[];for(let a=0;a<o;a++)if(a<r)n[a]=t[a];else{let h=n[a-1];a%r?r>6&&a%r===4&&(h=I[h>>>24]<<24|I[h>>>16&255]<<16|I[h>>>8&255]<<8|I[h&255]):(h=h<<8|h>>>24,h=I[h>>>24]<<24|I[h>>>16&255]<<16|I[h>>>8&255]<<8|I[h&255],h^=gs[a/r|0]<<24),n[a]=n[a-r]^h}this._invKeySchedule=[];for(let a=0;a<o;a++){let h=o-a,p;a%4?p=n[h]:p=n[h-4],a<4||h<=4?this._invKeySchedule[a]=p:this._invKeySchedule[a]=_t[I[p>>>24]]^wt[I[p>>>16&255]]^yt[I[p>>>8&255]]^xt[I[p&255]]}}_doCryptBlock(e,t,r,i,o,n,a,h){let p=e[t]^r[0],g=e[t+1]^r[1],m=e[t+2]^r[2],w=e[t+3]^r[3],R=4;for(let B=1;B<this._nRounds;B++){let y=i[p>>>24]^o[g>>>16&255]^n[m>>>8&255]^a[w&255]^r[R++],x=i[g>>>24]^o[m>>>16&255]^n[w>>>8&255]^a[p&255]^r[R++],N=i[m>>>24]^o[w>>>16&255]^n[p>>>8&255]^a[g&255]^r[R++],st=i[w>>>24]^o[p>>>16&255]^n[g>>>8&255]^a[m&255]^r[R++];p=y,g=x,m=N,w=st}let D=(h[p>>>24]<<24|h[g>>>16&255]<<16|h[m>>>8&255]<<8|h[w&255])^r[R++],k=(h[g>>>24]<<24|h[m>>>16&255]<<16|h[w>>>8&255]<<8|h[p&255])^r[R++],P=(h[m>>>24]<<24|h[w>>>16&255]<<16|h[p>>>8&255]<<8|h[g&255])^r[R++],T=(h[w>>>24]<<24|h[p>>>16&255]<<16|h[g>>>8&255]<<8|h[m&255])^r[R++];e[t]=D,e[t+1]=k,e[t+2]=P,e[t+3]=T}};Se.keySize=256/32;var _s=[1732584193,4023233417,2562383102,271733878,3285377520],se=new Array(80),ie=class extends b{static{c(this,"SHA1")}get hash(){return this._hash}reset(){super.reset(),this._hash=new _(_s.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],i=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4];for(let h=0;h<80;h++){if(h<16)se[h]=e[t+h]|0;else{let w=se[h-3]^se[h-8]^se[h-14]^se[h-16];se[h]=w<<1|w>>>31}let p,g;h<20?(p=i&o|~i&n,g=1518500249):h<40?(p=i^o^n,g=1859775393):h<60?(p=i&o|i&n|o&n,g=2400959708):(p=i^o^n,g=3395469782);let m=(r<<5|r>>>27)+p+a+g+se[h];a=n,n=o,o=i<<30|i>>>2,i=r,r=m|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+i|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0}};var ar=[],cr=[];(function(){function s(i){let o=Math.sqrt(i);for(let n=2;n<=o;n++)if(!(i%n))return!1;return!0}c(s,"isPrime");function e(i){return(i-(i|0))*4294967296|0}c(e,"getFractionalBits");let t=2,r=0;for(;r<64;)s(t)&&(r<8&&(ar[r]=e(Math.pow(t,1/2))),cr[r]=e(Math.pow(t,1/3)),r++),t++})();var oe=[],ve=class extends b{static{c(this,"SHA256")}constructor(){super()}reset(){super.reset(),this._hash=new _(ar.slice(0))}_doFinalize(){let e=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(t+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let r=this._hash.words[0],i=this._hash.words[1],o=this._hash.words[2],n=this._hash.words[3],a=this._hash.words[4],h=this._hash.words[5],p=this._hash.words[6],g=this._hash.words[7];for(let m=0;m<64;m++){if(m<16)oe[m]=e[t+m]|0;else{let B=oe[m-15],y=(B<<25|B>>>7)^(B<<14|B>>>18)^B>>>3,x=oe[m-2],N=(x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10;oe[m]=y+oe[m-7]+N+oe[m-16]}let w=a&h^~a&p,R=r&i^r&o^i&o,D=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),k=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),P=g+k+w+cr[m]+oe[m],T=D+R;g=p,p=h,h=a,a=n+P|0,n=o,o=i,i=r,r=P+T|0}this._hash.words[0]=this._hash.words[0]+r|0,this._hash.words[1]=this._hash.words[1]+i|0,this._hash.words[2]=this._hash.words[2]+o|0,this._hash.words[3]=this._hash.words[3]+n|0,this._hash.words[4]=this._hash.words[4]+a|0,this._hash.words[5]=this._hash.words[5]+h|0,this._hash.words[6]=this._hash.words[6]+p|0,this._hash.words[7]=this._hash.words[7]+g|0}};var Et=[new l(1116352408,3609767458),new l(1899447441,602891725),new l(3049323471,3964484399),new l(3921009573,2173295548),new l(961987163,4081628472),new l(1508970993,3053834265),new l(2453635748,2937671579),new l(2870763221,3664609560),new l(3624381080,2734883394),new l(310598401,1164996542),new l(607225278,1323610764),new l(1426881987,3590304994),new l(1925078388,4068182383),new l(2162078206,991336113),new l(2614888103,633803317),new l(3248222580,3479774868),new l(3835390401,2666613458),new l(4022224774,944711139),new l(264347078,2341262773),new l(604807628,2007800933),new l(770255983,1495990901),new l(1249150122,1856431235),new l(1555081692,3175218132),new l(1996064986,2198950837),new l(2554220882,3999719339),new l(2821834349,766784016),new l(2952996808,2566594879),new l(3210313671,3203337956),new l(3336571891,1034457026),new l(3584528711,2466948901),new l(113926993,3758326383),new l(338241895,168717936),new l(666307205,1188179964),new l(773529912,1546045734),new l(1294757372,1522805485),new l(1396182291,2643833823),new l(1695183700,2343527390),new l(1986661051,1014477480),new l(2177026350,1206759142),new l(2456956037,344077627),new l(2730485921,1290863460),new l(2820302411,3158454273),new l(3259730800,3505952657),new l(3345764771,106217008),new l(3516065817,3606008344),new l(3600352804,1432725776),new l(4094571909,1467031594),new l(275423344,851169720),new l(430227734,3100823752),new l(506948616,1363258195),new l(659060556,3750685593),new l(883997877,3785050280),new l(958139571,3318307427),new l(1322822218,3812723403),new l(1537002063,2003034995),new l(1747873779,3602036899),new l(1955562222,1575990012),new l(2024104815,1125592928),new l(2227730452,2716904306),new l(2361852424,442776044),new l(2428436474,593698344),new l(2756734187,3733110249),new l(3204031479,2999351573),new l(3329325298,3815920427),new l(3391569614,3928383900),new l(3515267271,566280711),new l(3940187606,3454069534),new l(4118630271,4000239992),new l(116418474,1914138554),new l(174292421,2731055270),new l(289380356,3203993006),new l(460393269,320620315),new l(685471733,587496836),new l(852142971,1086792851),new l(1017036298,365543100),new l(1126000580,2618297676),new l(1288033470,3409855158),new l(1501505948,4234509866),new l(1607167915,987167468),new l(1816402316,1246189591)],U=[];(function(){for(let s=0;s<80;s++)U[s]=new l(void 0,void 0)})();var Rt=class extends b{static{c(this,"SHA512")}constructor(){super({blockSize:1024/32})}reset(){super.reset(),this._hash=new tr([new l(1779033703,4089235720),new l(3144134277,2227873595),new l(1013904242,4271175723),new l(2773480762,1595750129),new l(1359893119,2917565137),new l(2600822924,725511199),new l(528734635,4215389547),new l(1541459225,327033209)])}_doFinalize(){let e=this._data,t=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;return t[i>>>5]|=128<<24-i%32,t[(i+128>>>10<<5)+30]=Math.floor(r/4294967296),t[(i+128>>>10<<5)+31]=r,e.sigBytes=t.length*4,this._process(),this._hash.toX32()}_doProcessBlock(e,t){let r=this._hash.words[0].high,i=this._hash.words[0].low,o=this._hash.words[1].high,n=this._hash.words[1].low,a=this._hash.words[2].high,h=this._hash.words[2].low,p=this._hash.words[3].high,g=this._hash.words[3].low,m=this._hash.words[4].high,w=this._hash.words[4].low,R=this._hash.words[5].high,D=this._hash.words[5].low,k=this._hash.words[6].high,P=this._hash.words[6].low,T=this._hash.words[7].high,B=this._hash.words[7].low;for(let y=0;y<80;y++){let x,N;if(y<16)N=U[y].high=e[t+y*2]|0,x=U[y].low=e[t+y*2+1]|0;else{let Mt=U[y-15],ae=Mt.high,Ee=Mt.low,os=(ae>>>1|Ee<<31)^(ae>>>8|Ee<<24)^ae>>>7,zt=(Ee>>>1|ae<<31)^(Ee>>>8|ae<<24)^(Ee>>>7|ae<<25),$t=U[y-2],ce=$t.high,Re=$t.low,ns=(ce>>>19|Re<<13)^(ce<<3|Re>>>29)^ce>>>6,Wt=(Re>>>19|ce<<13)^(Re<<3|ce>>>29)^(Re>>>6|ce<<26);x=zt+U[y-7].low,N=os+U[y-7].high+(x>>>0<zt>>>0?1:0),x=x+Wt,N=N+ns+(x>>>0<Wt>>>0?1:0),x=x+U[y-16].low,N=N+U[y-16].high+(x>>>0<U[y-16].low>>>0?1:0),U[y].high=N,U[y].low=x}let st=m&R^~m&k,Ut=w&D^~w&P,Yr=r&o^r&a^o&a,es=i&n^i&h^n&h,ts=(r>>>28|i<<4)^(r<<30|i>>>2)^(r<<25|i>>>7),kt=(i>>>28|r<<4)^(i<<30|r>>>2)^(i<<25|r>>>7),rs=(m>>>14|w<<18)^(m>>>18|w<<14)^(m<<23|w>>>9),ss=(w>>>14|m<<18)^(w>>>18|m<<14)^(w<<23|m>>>9),v=B+ss,S=T+rs+(v>>>0<B>>>0?1:0);v=v+Ut,S=S+st+(v>>>0<Ut>>>0?1:0),v=v+Et[y].low,S=S+Et[y].high+(v>>>0<Et[y].low>>>0?1:0),v=v+x,S=S+N+(v>>>0<x>>>0?1:0);let Lt=kt+es,is=ts+Yr+(Lt>>>0<kt>>>0?1:0);T=k,B=P,k=R,P=D,R=m,D=w,w=g+v|0,m=p+S+(w>>>0<g>>>0?1:0)|0,p=a,g=h,a=o,h=n,o=r,n=i,i=v+Lt|0,r=S+is+(i>>>0<v>>>0?1:0)|0}this._hash.words[0].low=this._hash.words[0].low=this._hash.words[0].low+i,this._hash.words[0].high=this._hash.words[0].high+r+(this._hash.words[0].low>>>0<i>>>0?1:0),this._hash.words[1].low=this._hash.words[1].low=this._hash.words[1].low+n,this._hash.words[1].high=this._hash.words[1].high+o+(this._hash.words[1].low>>>0<n>>>0?1:0),this._hash.words[2].low=this._hash.words[2].low=this._hash.words[2].low+h,this._hash.words[2].high=this._hash.words[2].high+a+(this._hash.words[2].low>>>0<h>>>0?1:0),this._hash.words[3].low=this._hash.words[3].low=this._hash.words[3].low+g,this._hash.words[3].high=this._hash.words[3].high+p+(this._hash.words[3].low>>>0<g>>>0?1:0),this._hash.words[4].low=this._hash.words[4].low=this._hash.words[4].low+w,this._hash.words[4].high=this._hash.words[4].high+m+(this._hash.words[4].low>>>0<w>>>0?1:0),this._hash.words[5].low=this._hash.words[5].low=this._hash.words[5].low+D,this._hash.words[5].high=this._hash.words[5].high+R+(this._hash.words[5].low>>>0<D>>>0?1:0),this._hash.words[6].low=this._hash.words[6].low=this._hash.words[6].low+P,this._hash.words[6].high=this._hash.words[6].high+k+(this._hash.words[6].low>>>0<P>>>0?1:0),this._hash.words[7].low=this._hash.words[7].low=this._hash.words[7].low+B,this._hash.words[7].high=this._hash.words[7].high+T+(this._hash.words[7].low>>>0<B>>>0?1:0)}};var hr=class{static{c(this,"HMAC")}constructor(e,t){this._hasher=new e;let r=typeof t=="string"?O.parse(t):t,i=this._hasher.cfg.blockSize,o=i*4;r.sigBytes>o&&(r=this._hasher.finalize(r)),r.clamp();let n=this._oKey=r.clone(),a=this._iKey=r.clone(),h=n.words,p=a.words;for(let g=0;g<i;g++)h[g]^=1549556828,p[g]^=909522486;n.sigBytes=a.sigBytes=o,this.reset()}finalize(e){let t=this._hasher.finalize(e);return this._hasher.reset(),this._hasher.finalize(this._oKey.clone().concat(t))}reset(){this._hasher.reset(),this._hasher.update(this._iKey)}update(e){return this._hasher.update(e),this}};var At=class lr{static{c(this,"PBKDF2")}constructor(e){this.cfg=Object.assign({keySize:128/32,hasher:ve,iterations:25e4},e)}static execute(e,t,r){return new lr(r).compute(e,t)}compute(e,t){let r=this.cfg,i=new hr(r.hasher,e),o=new _,n=new _([1]),a=o.words,h=n.words,p=r.keySize,g=r.iterations;for(;a.length<p;){let m=i.update(t).finalize(n);i.reset();let w=m.words,R=w.length,D=m;for(let k=1;k<g;k++){D=i.finalize(D),i.reset();let P=D.words;for(let T=0;T<R;T++)w[T]^=P[T]}o.concat(m),h[0]++}return o.sigBytes=p*4,o}};var Pe=We._createHelper(Se);var ue=b._createHelper(W);var me=b._createHelper(ie);var Ke=b._createHelper(ve);var Ge=b._createHelper(Rt);var ge=class{static{c(this,"SmpAesCrypt")}_password;_salt;_initVector;get _iv(){return this._initVector?V.parse(this._initVector):void 0}_mode=Z;_padding=pe;constructor(e,t,r){this._password=e,this._salt=t,this._initVector=r}decryptAES(e){return Pe.decrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString(O)}encryptAES(e){return Pe.encrypt(e,this._buildKey(),{iv:this._iv,mode:this._mode,padding:this._padding}).toString()}_buildKey(){return At.execute(this._password,V.parse(this._salt),{keySize:256/32,iterations:1e3,hasher:ie})}};var qe=class{static{c(this,"SmpCrypto")}static base64Decode(e){return O.stringify($.parse(e))}static base64Encode(e){return $.stringify(O.parse(e))}static md5(e){return ue(e).toString()}static sha1(e){return me(e).toString()}static sha256(e){return Ke(e).toString()}static sha512(e){return Ge(e).toString()}};var Ve=class{static{c(this,"SmpSecureCode")}_baseCode;get baseCode(){return this._baseCode}get secureCode(){return this._encode()}_crcLength=5;_seed="changeme";constructor(e){this._baseCode=e}static check(e,t){if(new this(e).secureCode!==t)throw L.create({messages:"WRONG_SECURE_CODE",errorCode:"WRONG_SECURE_CODE",status:ht.BadRequest})}_encode(){let e=new W;return e.update(O.parse(this._seed+this._baseCode)),e.finalize().toString(V).substring(0,this._crcLength).toUpperCase()}};var _e=require("class-transformer"),Ze=require("ts-luxon");var C=(function(s){return s.ACTIVATE="ACTIVATE",s.BLOCK="BLOCK",s.CHECK="CHECK",s.DIGITAL_ACTIVATE="DIGITAL_ACTIVATE",s.FREEZE="FREEZE",s.PURCHASE="PURCHASE",s.RECHARGE="RECHARGE",s.ROLLBACK="ROLLBACK",s.TRANSACTION="TRANSACTION",s.TRANSACTION_DETAIL="TRANSACTION_DETAIL",s.UNFREEZE="UNFREEZE",s.XREFUND="XREFUND",s})({});var ne=(function(s){return s.MD5="MD5",s.MD5_HMAC="MD5_HMAC",s.SHA1="SHA1",s.SHA1_HMAC="SHA1_HMAC",s})({});function ws(s,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(e,t,o):n(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o}c(ws,"_ts_decorate");function fr(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}c(fr,"_ts_metadata");var Xe=class s{static{c(this,"SmpGiftcardTransaction")}gc;op;ot;static _AES_ENCODER=new ge("changeme","5f6eae61d2428b99","d92fbf214e16a79fd36f9a5185ae733f");static _LOGGER=console;static _OP_CODES={[C.CHECK]:"",[C.TRANSACTION]:"",[C.TRANSACTION_DETAIL]:"",[C.ACTIVATE]:"A",[C.BLOCK]:"B",[C.DIGITAL_ACTIVATE]:"D",[C.FREEZE]:"F",[C.PURCHASE]:"P",[C.RECHARGE]:"G",[C.ROLLBACK]:"R",[C.UNFREEZE]:"U",[C.XREFUND]:"X"};static _SEP="_";get dto(){return this._dto}get hash(){return this._hashStrategy(this.toString()).toString()}get iso(){return this.dto.toUTC().toISO()}get ts(){return this._dto.ts}_dto;_hashStrategies={[ne.MD5]:e=>ue(e),[ne.MD5_HMAC]:e=>{let t=new W;return t.update(O.parse(e)),t.finalize()},[ne.SHA1]:e=>me(e),[ne.SHA1_HMAC]:e=>{let t=new ie;return t.update(O.parse(e)),t.finalize()}};_hashStrategy=this._hashStrategies[ne.MD5];constructor(e="ACTIVATION",t,r,i){this.gc=e,this.op=t,this.ot=r,this._dto=typeof i=="number"&&i>=0?Ze.DateTime.fromMillis(+`${i}000`.slice(0,13)):Ze.DateTime.local()}static build({gc:e,op:t,ot:r,dto:i}){return new this(e,t,r,i?.ts)}static explode(e){let t=this.constructor,r=(e||"").split(t._SEP);if(r.length<4)throw new Error(`INVALID_TRANSACTION "${e}"`);return this.build({gc:r[1],op:t.prefixToOperation(r[2]),dto:Ze.DateTime.fromSeconds(+r[3])})}static isBase64(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)&&e.length%4===0}static parse(e){this._LOGGER.info(`${this.constructor.name}: trying to parse ${e}`);try{if(this.isBase64(e)){let t=this._AES_ENCODER.decryptAES(e),r=JSON.parse(t);return(0,_e.plainToInstance)(s,r)}else return this.explode(e)}catch(t){throw this._LOGGER.error(`${this.constructor.name}: failed to parse ${e}`,t),new Error(`UNPARSEABLE "${e}"`)}}static prefixToOperation(e){return Object.entries(this._OP_CODES).find(([,r])=>r===e)[0]}serialize(){return(0,_e.instanceToPlain)(this,{excludePrefixes:["_"]})}toString(){let e=JSON.stringify(this.serialize());return this.constructor._AES_ENCODER.encryptAES(e)}};ws([(0,_e.Expose)(),fr("design:type",Number),fr("design:paramtypes",[])],Xe.prototype,"ts",null);var ys=(function(s){return s.ListDetectiveValidator="ListDetectiveValidator",s.MXValidator="MXValidator",s.SyntaxValidator="SyntaxValidator",s})({});function xs(s,e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(r=>{r!=="constructor"&&(r in s.prototype||Object.defineProperty(s.prototype,r,Object.getOwnPropertyDescriptor(t.prototype,r)))});try{let r=new t;Object.getOwnPropertyNames(r).forEach(i=>{i in s.prototype||Object.defineProperty(s.prototype,i,Object.getOwnPropertyDescriptor(r,i))})}catch{}Object.getOwnPropertyNames(t).forEach(r=>{r!=="prototype"&&r!=="name"&&r!=="length"&&(r in s||Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(t,r)))})})}c(xs,"smpApplyMixin");var Es=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function pr(s){return s.match(Es)}c(pr,"smpAsciiWords");var yr="\\ud800-\\udfff",Rs="\\u0300-\\u036f",As="\\ufe20-\\ufe2f",bs="\\u20d0-\\u20ff",Os="\\u1ab0-\\u1aff",Bs="\\u1dc0-\\u1dff",Is=Rs+As+bs+Os+Bs,xr="\\u2700-\\u27bf",Er="a-z\\xdf-\\xf6\\xf8-\\xff",Cs="\\xac\\xb1\\xd7\\xf7",Ds="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vs="\\u2000-\\u206f",Ps=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rr="A-Z\\xc0-\\xd6\\xd8-\\xde",Ts="\\ufe0e\\ufe0f",Ar=Cs+Ds+vs+Ps,br="['\u2019]",ur=`[${Ar}]`,Ns=`[${Is}]`,Or="\\d",js=`[${xr}]`,Br=`[${Er}]`,Ir=`[^${yr}${Ar+Or+xr+Er+Rr}]`,Fs="\\ud83c[\\udffb-\\udfff]",Us=`(?:${Ns}|${Fs})`,ks=`[^${yr}]`,Cr="(?:\\ud83c[\\udde6-\\uddff]){2}",Dr="[\\ud800-\\udbff][\\udc00-\\udfff]",we=`[${Rr}]`,Ls="\\u200d",mr=`(?:${Br}|${Ir})`,Ms=`(?:${we}|${Ir})`,gr=`(?:${br}(?:d|ll|m|re|s|t|ve))?`,_r=`(?:${br}(?:D|LL|M|RE|S|T|VE))?`,vr=`${Us}?`,Pr=`[${Ts}]?`,zs=`(?:${Ls}(?:${[ks,Cr,Dr].join("|")})${Pr+vr})*`,$s="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ws="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ss=Pr+vr+zs,wr=`(?:${[js,Cr,Dr].join("|")})${Ss}`,Ne=class{static{c(this,"SmpUnicodeWords")}static HAS_UNICODE_WORD=RegExp.prototype.test.bind(/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/);static RE_UNICODE_WORDS=RegExp([`${we}?${Br}+${gr}(?=${[ur,we,"$"].join("|")})`,`${Ms}+${_r}(?=${[ur,we+mr,"$"].join("|")})`,`${we}?${mr}+${gr}`,`${we}+${_r}`,Ws,$s,`${Or}+`,wr].join("|"),"g");static RS_EMOJI=wr;static unicodeWords(e){return e.match(this.RE_UNICODE_WORDS)}};var bt=class s{static{c(this,"SmpCommonUtils")}static arrayRemove(e,t){let r=[],i=e.filter((o,n)=>t(o,n)&&r.push(n));return r.reverse().forEach(o=>e.splice(o,1)),i}static assertIsArray(e,t){if(!Array.isArray(e))throw new Error(t||`${this.constructor.name} => val was not an array`)}static assertIsBoolean(e,t){if(!this.isBoolean(e))throw new Error(t||`${this.constructor.name} => val was not boolean`)}static assertIsFunction(e,t){if(!this.isFunction(e))throw new Error(t||`${this.constructor.name} => entity was not a function`)}static assertIsInstance(e,t,r){if(!(e instanceof t))throw new Error(r||`${this.constructor.name} => val was not instance of class`)}static assertIsNotEmpty(e,t){if(this.isEmpty(e))throw new Error(t||`${this.constructor.name} => entity was empty`)}static assertIsNumber(e,t){if(typeof e!="number")throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsNumeric(e,t){if(!this.isNumeric(e))throw new Error(t||`${this.constructor.name} => val was not numeric`)}static assertIsObject(e,t){if(!this.isObject(e))throw new Error(t||`${this.constructor.name} => val was not an object`)}static assertIsString(e,t){if(!this.isString(e))throw new Error(t||`${this.constructor.name} => val was not a string`)}static assertIsTruthy(e,t){if(!e)throw new Error(t||`${this.constructor.name} => condition wasn't truthy`)}static buildPath(...e){let t=e.filter(r=>!!r).join("/").replace(/(?<!:)\/\/+/g,"/");return t.startsWith("http")&&!t.endsWith("/")?`${t}/`:t}static downloadBlob(e,t){let r=window.URL.createObjectURL(e),i=document.createElement("a");i.href=r,i.setAttribute("download",t),document.body.appendChild(i),i.click()}static generateRandomHexString(e=12){let t="0123456789abcdef",r="";for(let i=0;i<e;i++){let o=Math.floor(Math.random()*t.length);r+=t[o]}return r}static generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}static getDecimalPrecision(e){if(this.assertIsNumeric(e),!isFinite(+e))return 0;let t=1,r=0;for(;Math.round(+e*t)/t!==e;)t*=10,r++;return r}static getType(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}static isBoolean(e){return typeof e=="boolean"}static isColor(e){if(!e||!this.isString(e))return!1;let t=new Option().style;return t.color=e,t.color!==""}static isEmpty(e){return!e&&e!==0}static isEqual(e,t){function r(){if(e.length!==t.length)return!1;for(let h=0;h<e.length;h++)if(!s.isEqual(e[h],t[h]))return!1;return!0}c(r,"areArraysEqual");function i(){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let h in e)if(Object.prototype.hasOwnProperty.call(e,h)&&!s.isEqual(e[h],t[h]))return!1;return!0}c(i,"areObjectsEqual");function o(){return e.toString()===t.toString()}c(o,"areFunctionsEqual");function n(){return e===t}c(n,"arePrimativesEqual");let a=this.getType(e);return a!==this.getType(t)?!1:a==="array"?r():a==="object"?i():a==="function"?o():n()}static isFormField(e){return/^(?:input|select|textarea|button)$/i.test(e.nodeName)}static isFunction(e){return typeof e==typeof isNaN}static isNotEmpty(e){return!this.isEmpty(e)}static isNumber(e){return typeof e=="number"&&this.isNumeric(e)}static isNumeric(e){return!isNaN(e)}static isObject(e){return!!e&&e===Object(e)&&e.constructor===Object}static isPrimitive(e){let t=this.getType(e);return t!=="function"&&(t!=="object"||!e)}static isString(e){return typeof e=="string"}static isWindows(){return navigator.userAgent.toLowerCase().includes("win")}static mapObject(e,t){if(this.assertIsFunction(t,`CommonUtils => expected type of iteratee to be Function, got ${typeof t}`),this.isObject(e))return Object.entries(e).reduce((r,[i,o])=>(r.push(t(o,i)),r),[]);if(Array.isArray(e))return e.map(t);throw new Error(`CommonUtils => invalid object provided. Expected Object or Array, got ${typeof t}`)}static mapObjectKeys(e,t){return Object.entries(e).reduce((r,[i,o])=>(r[i]=t.call(null,i,o),r),{})}static mapObjectValues(e,t){return this.isObject(e)?Object.entries(e).reduce((r,[i,o])=>(r[i]=t.call(null,o,i),r),{}):{}}static noop(){}static objectHasValue(e,t){return!!~Object.values(e).filter(r=>this.isEqual(r,t))}static omit(e,t){return Object.keys(e).filter(i=>!t.includes(i)).reduce((i,o)=>(i[o]=e[o],i),{})}static parseBoolean(e){return e?/^true$/i.test(e):!1}static parseJsonSafely(e){try{return JSON.parse(e)}catch(t){console.warn(`${this.constructor.name} => couldn't parse json string`,{str:e,error:t});return}}static pick(e,t){return t.reduce((r,i)=>(i in e&&(r[i]=e[i]),r),{})}static runSafely(e,t=null,r=[]){if(this.isFunction(e))return e.apply(t,r)}static sleep(e){return new Promise(t=>setTimeout(t,e))}static sprintf(e,...t){return this.isString(e)&&t.length?this.sprintf(e.replace("%s",String(t.shift())),...t):e}static stripComments(e){return typeof e=="string"?e.replace(/(<!--.*?-->)|(<!--[\S\s]+?-->)|(<!--[\S\s]*?$)/g,""):e}static submitFakeForm({action:e,method:t=dt.POST,data:r,target:i}){let o=Object.entries(r||{}).map(([a,h])=>`<input name="${a}" type="hidden" value="${h}" />`),n=document.createElement("form");n.method=t,n.action=e,n.innerHTML=`${o}`,n.target=i||"_self",document.body.append(n),n.submit()}static toCamelCase(e){return this.words(e.replace(/['\u2019]/g,"")).reduce((t,r,i)=>(r=r.toLowerCase(),t+(i?r.charAt(0).toUpperCase()+r.slice(1):r)),"")}static toKebabCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("-").toLowerCase()}static toPascalCase(e){return this.toCamelCase(e).replace(/^(.)/,t=>t.toUpperCase())}static toSnakeCase(e){return this.words(e.replace(/['\u2019]/g,"")).join("_").toLowerCase()}static toUpperSnakeCase(e){return this.toSnakeCase(e).toUpperCase()}static words(e,t){return t===void 0?(Ne.HAS_UNICODE_WORD(e)?Ne.unicodeWords(e):pr(e))||[]:e.match(t)||[]}};var Ot=class extends Error{static{c(this,"SmpFilterException")}message;data;constructor(e="Filter Exception",t){super(),this.message=e,this.data=t}};var Bt=require("ts-luxon");var It=class s{static{c(this,"SmpSid")}value;expiry;get active(){return this.value.endsWith(this._controlSuffix)}get expired(){return Bt.DateTime.now().ts>this.expiry}get valid(){return!this.expired}_controlSuffix="$1";constructor(e=`sid-xxxx-${+Bt.DateTime.now().ts}`,t=0){this.value=e,this.expiry=t}static parse(e){return new s(e.value,e.expiry)}toPlain(){return{value:this.value,expiry:this.expiry}}};var Tr=require("@tonysamperi/logger");var Ct=class{static{c(this,"SmpRegularExpressions")}static get COUNTRY(){return this._country}static get DOMAIN(){return/^(?!www)(\w)([\w.-])*\.[a-z]{2,6}$/}static get EMAIL(){return/^[^\\|!"£$%&/()='?^€*[\]°#§<>,;:\s]+@[a-z0-9.-]+\.[a-z]{2,6}$/}static get LANGUAGE(){return this._language}static get LATIN_CHARS(){return/^[\u0000-\u024F\u1E00-\u1EFF\u2C60-\u2C7F\uA720-\uA7FF]+/}static get LOCALE(){return new RegExp(`${this._country.source}-${this._language.source}`)}static get NO_EMOJI_NO_PUNCTUATION(){return/[^\p{Emoji_Presentation}|\p{P}]/gu}static get PHONE_NUMBER(){return/^(\+\d{1,4}\s)(\d{4,15})$/}static get PHONE_NUMBER_BY_PREFIX(){return{"+971":{dontStartWithZero:/^(\+\d{3}\s)([1-9])/,typeExactlyNineDigits:/^(\+\d{3}\s)([1-9]\d{8}$)/}}}static get TAXCODE_BY_COUNTRY(){return{ES:{DNI:/^\d{8}[A-Z]$/,NIE:/^[A-Z]\d{7}[A-Z]$/,CIF:/^[A-Z]\d{8}$/}}}static _country=/[a-zA-Z]{2}/;static _language=/[a-z]{2}/};var Xs="1.8.0";Object.defineProperties(module.exports,{SmpDynamoService:{get:c(()=>(Ur(),j(Fr)).SmpDynamoService,"get")},SmpFirebaseService:{get:c(()=>(Mr(),j(Lr)).SmpFirebaseService,"get")},SmpAbstractRxjsTtlCacheStrategy:{get:c(()=>(J(),j(H)).SmpAbstractRxjsTtlCacheStrategy,"get")},smpRxjsCatchOnly:{get:c(()=>(J(),j(H)).smpRxjsCatchOnly,"get")},SmpRxjsInMemoryCache:{get:c(()=>(J(),j(H)).SmpRxjsInMemoryCache,"get")},smpRxjsQueue:{get:c(()=>(J(),j(H)).smpRxjsQueue,"get")},smpRxjsSequence:{get:c(()=>(J(),j(H)).smpRxjsSequence,"get")},smpRxjsThrowIfEmpty:{get:c(()=>(J(),j(H)).smpRxjsThrowIfEmpty,"get")},smpRxjsThrowOnCondition:{get:c(()=>(J(),j(H)).smpRxjsThrowOnCondition,"get")},smpZodDateTime:{get:c(()=>(Ft(),j(jt)).smpZodDateTime,"get")},SmpZodDateTime:{get:c(()=>(Ft(),j(jt)).SmpZodDateTime,"get")}});0&&(module.exports={SMP_HEALTHZ,SmpAbstractCacheStrategy,SmpAbstractTtlCacheStrategy,SmpAesCrypt,SmpApiCommonUtils,SmpBaseJwtToken,SmpBaseJwtTokenPlain,SmpBrowserCache,SmpCommonUtils,SmpCrypto,SmpErrorResponse,SmpFilterException,SmpFirebaseErrors,SmpGenericResponse,SmpGiftcardTransaction,SmpGiftcardTransactionHashStrategies,SmpGiftcardTransactionOps,SmpHttpService,SmpHttpSessionStorageCache,SmpHttpStatusCodes,SmpInMemoryCache,SmpMarketingCloudValidators,SmpRegularExpressions,SmpResponseMessage,SmpResponseMessageTypes,SmpRestVerbs,SmpSecureCode,SmpSid,SmpSocialSignInKeys,SmpSocialSignInUxModes,VERSION,smpApplyMixin,smpIsSmpCachedValue,smpNoop});
2
2
  //# sourceMappingURL=index.cjs.map