@adyen/adyen-web 6.0.0-alpha.5 → 6.0.0-alpha.7

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 (442) hide show
  1. package/dist/cjs/adyen.css +10 -9
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +41 -29
  6. package/dist/es/adyen.css +10 -9
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/Address/Address.js +1 -1
  9. package/dist/es/components/Address/Address.js.map +1 -1
  10. package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
  11. package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
  12. package/dist/es/components/Blik/components/BlikInput.js +1 -1
  13. package/dist/es/components/Blik/components/BlikInput.js.map +1 -1
  14. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  15. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  16. package/dist/es/components/Card/components/CardInput/defaultProps.js +1 -1
  17. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  18. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  19. package/dist/es/components/Card/components/CardInput/utils.js +1 -1
  20. package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
  21. package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
  22. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  23. package/dist/es/components/CashAppPay/components/CashAppComponent.js +1 -1
  24. package/dist/es/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  25. package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
  26. package/dist/es/components/GooglePay/components/GooglePayButton.js +1 -1
  27. package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
  28. package/dist/es/components/GooglePay/defaultProps.js +1 -1
  29. package/dist/es/components/GooglePay/defaultProps.js.map +1 -1
  30. package/dist/es/components/PersonalDetails/PersonalDetails.js +1 -1
  31. package/dist/es/components/PersonalDetails/PersonalDetails.js.map +1 -1
  32. package/dist/es/components/internal/Address/Address.js +1 -1
  33. package/dist/es/components/internal/Address/Address.js.map +1 -1
  34. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js +1 -1
  35. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  36. package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js +1 -1
  37. package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js.map +1 -1
  38. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js +1 -1
  39. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
  40. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
  41. package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  42. package/dist/es/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
  43. package/dist/es/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  44. package/dist/es/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  45. package/dist/es/components/internal/ClickToPay/services/utils.js +1 -1
  46. package/dist/es/components/internal/ClickToPay/services/utils.js.map +1 -1
  47. package/dist/es/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  48. package/dist/es/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  49. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  50. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  51. package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
  52. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  53. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  54. package/dist/es/components/internal/Icon/constants.js +2 -0
  55. package/dist/es/components/internal/Icon/constants.js.map +1 -0
  56. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  57. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  58. package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +2 -0
  59. package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -0
  60. package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
  61. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  62. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  63. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  64. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  65. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  66. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  67. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  68. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  69. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  70. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  71. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  72. package/dist/es/components/internal/Voucher/Voucher.js +1 -1
  73. package/dist/es/components/internal/Voucher/Voucher.js.map +1 -1
  74. package/dist/es/core/Analytics/Analytics.js +1 -1
  75. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  76. package/dist/es/core/Analytics/constants.js +1 -1
  77. package/dist/es/core/Analytics/constants.js.map +1 -1
  78. package/dist/es/core/Analytics/utils.js.map +1 -1
  79. package/dist/es/core/Context/Resources.js +1 -1
  80. package/dist/es/core/Context/Resources.js.map +1 -1
  81. package/dist/es/core/Environment/Environment.js +1 -1
  82. package/dist/es/core/Environment/Environment.js.map +1 -1
  83. package/dist/es/core/Environment/constants.js +2 -0
  84. package/dist/es/core/Environment/constants.js.map +1 -0
  85. package/dist/es/core/Errors/SRMessages.js +1 -1
  86. package/dist/es/core/Errors/SRMessages.js.map +1 -1
  87. package/dist/es/core/Errors/SRPanel.js +1 -1
  88. package/dist/es/core/Errors/SRPanel.js.map +1 -1
  89. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  90. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  91. package/dist/es/core/Services/analytics/log-event.js +1 -1
  92. package/dist/es/core/Services/get-translations.js +1 -1
  93. package/dist/es/core/Services/get-translations.js.map +1 -1
  94. package/dist/es/core/core.defaultProps.js +1 -1
  95. package/dist/es/core/core.defaultProps.js.map +1 -1
  96. package/dist/es/core/core.js +1 -1
  97. package/dist/es/core/core.js.map +1 -1
  98. package/dist/es/core/core.registry.js +1 -1
  99. package/dist/es/core/core.registry.js.map +1 -1
  100. package/dist/es/core/utils.js +1 -1
  101. package/dist/es/core/utils.js.map +1 -1
  102. package/dist/es/external/preact/dist/preact.js +1 -1
  103. package/dist/es/external/preact/dist/preact.js.map +1 -1
  104. package/dist/es/external/preact/hooks/dist/hooks.js +1 -1
  105. package/dist/es/external/preact/hooks/dist/hooks.js.map +1 -1
  106. package/dist/es/index.d.ts +41 -29
  107. package/dist/es/utils/arrayUtils.js +1 -1
  108. package/dist/es/utils/arrayUtils.js.map +1 -1
  109. package/dist/es/utils/useForm/useForm.js +1 -1
  110. package/dist/es/utils/validator-utils.js +1 -1
  111. package/dist/es/utils/validator-utils.js.map +1 -1
  112. package/dist/es-legacy/adyen.css +10 -9
  113. package/dist/es-legacy/adyen.css.map +1 -1
  114. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  115. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  116. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  117. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  118. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
  119. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  120. package/dist/es-legacy/components/Address/Address.js +1 -1
  121. package/dist/es-legacy/components/Address/Address.js.map +1 -1
  122. package/dist/es-legacy/components/Affirm/Affirm.js +1 -1
  123. package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
  124. package/dist/es-legacy/components/AfterPay/AfterPay.js +1 -1
  125. package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
  126. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js +1 -1
  127. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
  128. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  129. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  130. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js +1 -1
  131. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  132. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  133. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  134. package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
  135. package/dist/es-legacy/components/AmazonPay/utils.js.map +1 -1
  136. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  137. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  138. package/dist/es-legacy/components/Atome/Atome.js +1 -1
  139. package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
  140. package/dist/es-legacy/components/Atome/config.js +1 -1
  141. package/dist/es-legacy/components/Atome/config.js.map +1 -1
  142. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  143. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  144. package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
  145. package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
  146. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  147. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  148. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js +1 -1
  149. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
  150. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js +1 -1
  151. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
  152. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  153. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  154. package/dist/es-legacy/components/Blik/components/BlikInput.js +1 -1
  155. package/dist/es-legacy/components/Blik/components/BlikInput.js.map +1 -1
  156. package/dist/es-legacy/components/Boleto/Boleto.js +1 -1
  157. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  158. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  159. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  160. package/dist/es-legacy/components/Card/Bancontact.js +1 -1
  161. package/dist/es-legacy/components/Card/Bancontact.js.map +1 -1
  162. package/dist/es-legacy/components/Card/Card.js +1 -1
  163. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  164. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  165. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  166. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js +1 -1
  167. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +1 -1
  168. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
  169. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
  170. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
  171. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  172. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  173. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  174. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  175. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  176. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  177. package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js +1 -1
  178. package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js.map +1 -1
  179. package/dist/es-legacy/components/ClickToPay/ClickToPay.js +1 -1
  180. package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
  181. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  182. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  183. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  184. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  185. package/dist/es-legacy/components/Doku/Doku.js +1 -1
  186. package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
  187. package/dist/es-legacy/components/Donation/Donation.js +1 -1
  188. package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
  189. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  190. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  191. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  192. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  193. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
  194. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
  195. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  196. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  197. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  198. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  199. package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
  200. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  201. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  202. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  203. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  204. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js +1 -1
  205. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  206. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js +1 -1
  207. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
  208. package/dist/es-legacy/components/EPS/index.js +1 -1
  209. package/dist/es-legacy/components/EPS/index.js.map +1 -1
  210. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  211. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  212. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js +1 -1
  213. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
  214. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js +1 -1
  215. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
  216. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js +1 -1
  217. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
  218. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js +1 -1
  219. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
  220. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js +1 -1
  221. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
  222. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  223. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  224. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
  225. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  226. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js +1 -1
  227. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
  228. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  229. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  230. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  231. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  232. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js +1 -1
  233. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
  234. package/dist/es-legacy/components/GooglePay/defaultProps.js +1 -1
  235. package/dist/es-legacy/components/GooglePay/defaultProps.js.map +1 -1
  236. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  237. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  238. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  239. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  240. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  241. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  242. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  243. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  244. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js +1 -1
  245. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
  246. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js +1 -1
  247. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
  248. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  249. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  250. package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
  251. package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
  252. package/dist/es-legacy/components/OnlineBankingIN/index.js +1 -1
  253. package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
  254. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js +1 -1
  255. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
  256. package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
  257. package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
  258. package/dist/es-legacy/components/Oxxo/Oxxo.js +1 -1
  259. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  260. package/dist/es-legacy/components/PayByBank/PayByBank.js +1 -1
  261. package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
  262. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  263. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  264. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  265. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  266. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  267. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  268. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +1 -1
  269. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -1
  270. package/dist/es-legacy/components/PayU/PayuCashcard.js +1 -1
  271. package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
  272. package/dist/es-legacy/components/PayU/PayuNetBanking.js +1 -1
  273. package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
  274. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js +1 -1
  275. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js.map +1 -1
  276. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  277. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  278. package/dist/es-legacy/components/RatePay/RatePay.js +1 -1
  279. package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
  280. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js +1 -1
  281. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js.map +1 -1
  282. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  283. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  284. package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
  285. package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
  286. package/dist/es-legacy/components/Sepa/Sepa.js +1 -1
  287. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  288. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  289. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  290. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  291. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  292. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  293. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  294. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  295. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  296. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  297. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  298. package/dist/es-legacy/components/Twint/Twint.js +1 -1
  299. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  300. package/dist/es-legacy/components/UPI/UPI.js +1 -1
  301. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  302. package/dist/es-legacy/components/WalletIN/index.js +1 -1
  303. package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
  304. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  305. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  306. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
  307. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  308. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  309. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  310. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  311. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  312. package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
  313. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  314. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  315. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  316. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js +1 -1
  317. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  318. package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js +1 -1
  319. package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js.map +1 -1
  320. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js +1 -1
  321. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
  322. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
  323. package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
  324. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  325. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  326. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
  327. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
  328. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  329. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
  330. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  331. package/dist/es-legacy/components/internal/ClickToPay/services/utils.js +1 -1
  332. package/dist/es-legacy/components/internal/ClickToPay/services/utils.js.map +1 -1
  333. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  334. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  335. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  336. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  337. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  338. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  339. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  340. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  341. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js +1 -1
  342. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
  343. package/dist/es-legacy/components/internal/FormFields/InputEmail.js +1 -1
  344. package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
  345. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js +1 -1
  346. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js.map +1 -1
  347. package/dist/es-legacy/components/internal/FormFields/InputText.js +1 -1
  348. package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
  349. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  350. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  351. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  352. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  353. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  354. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  355. package/dist/es-legacy/components/internal/Icon/constants.js +2 -0
  356. package/dist/es-legacy/components/internal/Icon/constants.js.map +1 -0
  357. package/dist/es-legacy/components/internal/Img/Img.js +1 -1
  358. package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
  359. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js +1 -1
  360. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
  361. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  362. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  363. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +2 -0
  364. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -0
  365. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  366. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  367. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  368. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  369. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +1 -1
  370. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js.map +1 -1
  371. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
  372. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  373. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  374. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  375. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  376. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  377. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  378. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  379. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  380. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  381. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  382. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  383. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  384. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  385. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  386. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  387. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  388. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  389. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
  390. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
  391. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  392. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  393. package/dist/es-legacy/components/internal/Voucher/Voucher.js +1 -1
  394. package/dist/es-legacy/components/internal/Voucher/Voucher.js.map +1 -1
  395. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  396. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  397. package/dist/es-legacy/core/Analytics/constants.js +1 -1
  398. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  399. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  400. package/dist/es-legacy/core/Context/Resources.js +1 -1
  401. package/dist/es-legacy/core/Context/Resources.js.map +1 -1
  402. package/dist/es-legacy/core/Environment/Environment.js +1 -1
  403. package/dist/es-legacy/core/Environment/Environment.js.map +1 -1
  404. package/dist/es-legacy/core/Environment/constants.js +2 -0
  405. package/dist/es-legacy/core/Environment/constants.js.map +1 -0
  406. package/dist/es-legacy/core/Errors/SRPanel.js +1 -1
  407. package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
  408. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  409. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  410. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  411. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  412. package/dist/es-legacy/core/ProcessResponse/process-response.js +1 -1
  413. package/dist/es-legacy/core/ProcessResponse/process-response.js.map +1 -1
  414. package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
  415. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  416. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  417. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  418. package/dist/es-legacy/core/Services/analytics/log-event.js +1 -1
  419. package/dist/es-legacy/core/Services/get-translations.js +1 -1
  420. package/dist/es-legacy/core/Services/get-translations.js.map +1 -1
  421. package/dist/es-legacy/core/Services/http.js +1 -1
  422. package/dist/es-legacy/core/Services/http.js.map +1 -1
  423. package/dist/es-legacy/core/core.defaultProps.js +1 -1
  424. package/dist/es-legacy/core/core.defaultProps.js.map +1 -1
  425. package/dist/es-legacy/core/core.js +1 -1
  426. package/dist/es-legacy/core/core.js.map +1 -1
  427. package/dist/es-legacy/core/core.registry.js +1 -1
  428. package/dist/es-legacy/core/core.registry.js.map +1 -1
  429. package/dist/es-legacy/core/utils.js +1 -1
  430. package/dist/es-legacy/core/utils.js.map +1 -1
  431. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  432. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  433. package/dist/es-legacy/external/preact/hooks/dist/hooks.js +1 -1
  434. package/dist/es-legacy/external/preact/hooks/dist/hooks.js.map +1 -1
  435. package/dist/es-legacy/utils/arrayUtils.js +1 -1
  436. package/dist/es-legacy/utils/arrayUtils.js.map +1 -1
  437. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  438. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  439. package/dist/es-legacy/utils/useForm/useForm.js +1 -1
  440. package/dist/es-legacy/utils/validator-utils.js +1 -1
  441. package/dist/es-legacy/utils/validator-utils.js.map +1 -1
  442. package/package.json +144 -148
@@ -1 +1 @@
1
- {"version":3,"file":"handleEncryption.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.ts"],"sourcesContent":["import { makeCallbackObjectsEncryption } from '../utils/callbackUtils';\nimport { ENCRYPTED_EXPIRY_MONTH, ENCRYPTED_EXPIRY_YEAR, ENCRYPTED_SECURITY_CODE, ENCRYPTED_CARD_NUMBER } from '../../constants';\nimport { processErrors } from '../utils/processErrors';\nimport { truthy } from '../../utilities/commonUtils';\nimport { SFFeedbackObj, CbObjOnFieldValid, EncryptionObj } from '../../types';\nimport postMessageToIframe from '../utils/iframes/postMessageToIframe';\nimport { hasOwnProperty } from '../../../../../../utils/hasOwnProperty';\nimport getIframeContentWin from '../utils/iframes/getIframeContentWin';\n\nexport function handleEncryption(pFeedbackObj: SFFeedbackObj): void {\n // EXTRACT VARS\n const fieldType: string = pFeedbackObj.fieldType;\n\n // SET FOCUS ON OTHER INPUT - If user has just typed a correct expiryDate - set focus on the cvc field OR typed a correct expiryMonth - focus on year field\n if (this.config.autoFocus) {\n // pFeedbackObj.type === 'year' when the encryption is happening on an expiryDate field c.f. a separate year field (when it equals ENCRYPTED_EXPIRY_YEAR)\n if (pFeedbackObj.type === 'year' || fieldType === ENCRYPTED_EXPIRY_YEAR) {\n this.setFocusOnFrame(ENCRYPTED_SECURITY_CODE);\n }\n if (fieldType === ENCRYPTED_EXPIRY_MONTH) {\n this.setFocusOnFrame(ENCRYPTED_EXPIRY_YEAR);\n }\n }\n //--\n\n let i: number;\n let len: number;\n\n const encryptedObjArr: EncryptionObj[] = pFeedbackObj[fieldType];\n\n // Set boolean saying this securedField is in an encryptedState\n this.state.securedFields[fieldType].isEncrypted = true;\n\n // REMOVE ANY ERRORS ON FIELD e.g. was a full number that failed the luhnCheck, then we corrected the number and now it passes\n processErrors(\n { error: '', fieldType } as any as SFFeedbackObj,\n this.state.securedFields[fieldType],\n this.state.type,\n this.props.rootNode,\n this.callbacks.onError\n );\n\n // MAKE ENCRYPTION OBJECTS FOR EACH OF THE INDIVIDUAL INPUTS\n // N.B. when considering \"individual inputs\" we are concerned with the 4 fields that the checkoutAPI expects to receive for a credit card payment:\n // encryptedCardNumber, encryptedSecurityCode, encryptedExpiryMonth, encryptedExpiryYear\n const callbackObjectsArr: CbObjOnFieldValid[] = makeCallbackObjectsEncryption({\n fieldType,\n txVariant: this.state.type,\n rootNode: this.props.rootNode,\n encryptedObjArr\n });\n\n // For standalone month field\n if (fieldType === ENCRYPTED_EXPIRY_MONTH) {\n if (hasOwnProperty(this.state.securedFields, ENCRYPTED_EXPIRY_YEAR)) {\n const dataObj: object = {\n txVariant: this.state.type,\n code: pFeedbackObj.code,\n blob: encryptedObjArr[0].blob,\n fieldType: ENCRYPTED_EXPIRY_YEAR,\n numKey: this.state.securedFields[ENCRYPTED_EXPIRY_YEAR].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(this.state, ENCRYPTED_EXPIRY_YEAR), this.config.loadingContext);\n }\n }\n\n // For number field - add the endDigits to the encryption object\n if (fieldType === ENCRYPTED_CARD_NUMBER && truthy(pFeedbackObj.endDigits)) {\n callbackObjectsArr[0].endDigits = pFeedbackObj.endDigits;\n }\n\n // For number field - add the 8 digit issuerBin to the encryption object\n if (fieldType === ENCRYPTED_CARD_NUMBER && truthy(pFeedbackObj.issuerBin)) {\n callbackObjectsArr[0].issuerBin = +pFeedbackObj.issuerBin;\n }\n\n // BROADCAST VALID STATE OF INDIVIDUAL INPUTS - passing the encryption objects\n for (i = 0, len = callbackObjectsArr.length; i < len; i += 1) {\n this.callbacks.onFieldValid(callbackObjectsArr[i]);\n }\n //--------------------------------------------\n\n // STORE & BROADCAST VALID STATE OF THE FORM AS A WHOLE ///////\n this.validateForm();\n}\n"],"names":["handleEncryption","pFeedbackObj","fieldType","i","len","this","config","autoFocus","type","ENCRYPTED_EXPIRY_YEAR","setFocusOnFrame","ENCRYPTED_SECURITY_CODE","ENCRYPTED_EXPIRY_MONTH","encryptedObjArr","state","securedFields","isEncrypted","processErrors","error","props","rootNode","callbacks","onError","callbackObjectsArr","makeCallbackObjectsEncryption","txVariant","hasOwnProperty","dataObj","code","blob","numKey","postMessageToIframe","getIframeContentWin","loadingContext","ENCRYPTED_CARD_NUMBER","truthy","endDigits","issuerBin","length","onFieldValid","validateForm"],"mappings":"ogBASO,SAASA,EAAiBC,GAE7B,MAAMC,EAAoBD,EAAaC,UAcvC,IAAIC,EACAC,EAZAC,KAAKC,OAAOC,YAEc,SAAtBN,EAAaO,MAAmBN,IAAcO,GAC9CJ,KAAKK,gBAAgBC,GAErBT,IAAcU,GACdP,KAAKK,gBAAgBD,IAQ7B,MAAMI,EAAmCZ,EAAaC,GAGtDG,KAAKS,MAAMC,cAAcb,GAAWc,aAAc,EAGlDC,EACI,CAAEC,MAAO,GAAIhB,aACbG,KAAKS,MAAMC,cAAcb,GACzBG,KAAKS,MAAMN,KACXH,KAAKc,MAAMC,SACXf,KAAKgB,UAAUC,SAMnB,MAAMC,EAA0CC,EAA8B,CAC1EtB,YACAuB,UAAWpB,KAAKS,MAAMN,KACtBY,SAAUf,KAAKc,MAAMC,SACrBP,oBAIJ,GAAIX,IAAcU,GACVc,EAAerB,KAAKS,MAAMC,cAAeN,GAAwB,CACjE,MAAMkB,EAAkB,CACpBF,UAAWpB,KAAKS,MAAMN,KACtBoB,KAAM3B,EAAa2B,KACnBC,KAAMhB,EAAgB,GAAGgB,KACzB3B,UAAWO,EACXqB,OAAQzB,KAAKS,MAAMC,cAAcN,GAAuBqB,QAE5DC,EAAoBJ,EAASK,EAAoB3B,KAAKS,MAAOL,GAAwBJ,KAAKC,OAAO2B,eACrG,CAcJ,IAVI/B,IAAcgC,GAAyBC,EAAOlC,EAAamC,aAC3Db,EAAmB,GAAGa,UAAYnC,EAAamC,WAI/ClC,IAAcgC,GAAyBC,EAAOlC,EAAaoC,aAC3Dd,EAAmB,GAAGc,WAAapC,EAAaoC,WAI/ClC,EAAI,EAAGC,EAAMmB,EAAmBe,OAAQnC,EAAIC,EAAKD,GAAK,EACvDE,KAAKgB,UAAUkB,aAAahB,EAAmBpB,IAKnDE,KAAKmC,cACT"}
1
+ {"version":3,"file":"handleEncryption.js","sources":["../../../../../../../../src/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.ts"],"sourcesContent":["import { makeCallbackObjectsEncryption } from '../utils/callbackUtils';\nimport {\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE\n} from '../../constants';\nimport { processErrors } from '../utils/processErrors';\nimport { truthy } from '../../utilities/commonUtils';\nimport { SFFeedbackObj, CbObjOnFieldValid, EncryptionObj } from '../../types';\nimport postMessageToIframe from '../utils/iframes/postMessageToIframe';\nimport { hasOwnProperty } from '../../../../../../utils/hasOwnProperty';\nimport getIframeContentWin from '../utils/iframes/getIframeContentWin';\n\nexport function handleEncryption(pFeedbackObj: SFFeedbackObj): void {\n // EXTRACT VARS\n const fieldType: string = pFeedbackObj.fieldType;\n\n // SET FOCUS ON OTHER INPUT - If user has just typed a correct expiryDate - set focus on the cvc field OR typed a correct expiryMonth - focus on year field\n if (this.config.autoFocus) {\n // pFeedbackObj.type === 'year' when the encryption is happening on an expiryDate field c.f. a separate year field (when it equals ENCRYPTED_EXPIRY_YEAR)\n if (pFeedbackObj.type === 'year' || fieldType === ENCRYPTED_EXPIRY_YEAR) {\n this.setFocusOnFrame(ENCRYPTED_SECURITY_CODE);\n }\n if (fieldType === ENCRYPTED_EXPIRY_MONTH) {\n this.setFocusOnFrame(ENCRYPTED_EXPIRY_YEAR);\n }\n }\n //--\n\n let i: number;\n let len: number;\n\n const encryptedObjArr: EncryptionObj[] = pFeedbackObj[fieldType];\n\n // Set boolean saying this securedField is in an encryptedState\n this.state.securedFields[fieldType].isEncrypted = true;\n\n // REMOVE ANY ERRORS ON FIELD e.g. was a full number that failed the luhnCheck, then we corrected the number and now it passes\n processErrors(\n { error: '', fieldType } as any as SFFeedbackObj,\n this.state.securedFields[fieldType],\n this.state.type,\n this.props.rootNode,\n this.callbacks.onError\n );\n\n // MAKE ENCRYPTION OBJECTS FOR EACH OF THE INDIVIDUAL INPUTS\n // N.B. when considering \"individual inputs\" we are concerned with the 4 fields that the checkoutAPI expects to receive for a credit card payment:\n // encryptedCardNumber, encryptedSecurityCode, encryptedExpiryMonth, encryptedExpiryYear\n const callbackObjectsArr: CbObjOnFieldValid[] = makeCallbackObjectsEncryption({\n fieldType,\n txVariant: this.state.type,\n rootNode: this.props.rootNode,\n encryptedObjArr\n });\n\n // For standalone month field\n if (fieldType === ENCRYPTED_EXPIRY_MONTH) {\n if (hasOwnProperty(this.state.securedFields, ENCRYPTED_EXPIRY_YEAR)) {\n const dataObj: object = {\n txVariant: this.state.type,\n code: pFeedbackObj.code,\n blob: encryptedObjArr[0].blob,\n fieldType: ENCRYPTED_EXPIRY_YEAR,\n numKey: this.state.securedFields[ENCRYPTED_EXPIRY_YEAR].numKey\n };\n postMessageToIframe(dataObj, getIframeContentWin(this.state, ENCRYPTED_EXPIRY_YEAR), this.config.loadingContext);\n }\n }\n\n // For number field - add the endDigits to the encryption object\n if (fieldType === ENCRYPTED_CARD_NUMBER && truthy(pFeedbackObj.endDigits)) {\n callbackObjectsArr[0].endDigits = pFeedbackObj.endDigits;\n }\n\n // For number field - add the 8 digit issuerBin to the encryption object\n if (fieldType === ENCRYPTED_CARD_NUMBER && truthy(pFeedbackObj.issuerBin)) {\n callbackObjectsArr[0].issuerBin = +pFeedbackObj.issuerBin;\n }\n\n // Add expiryDate to \"encryptedExpiryYear\" field. It will only be present if the correct config has been sent to SF\n if (fieldType === ENCRYPTED_EXPIRY_DATE && truthy(pFeedbackObj.expiryDate)) {\n callbackObjectsArr[1].expiryDate = pFeedbackObj.expiryDate;\n }\n\n // BROADCAST VALID STATE OF INDIVIDUAL INPUTS - passing the encryption objects\n for (i = 0, len = callbackObjectsArr.length; i < len; i += 1) {\n this.callbacks.onFieldValid(callbackObjectsArr[i]);\n }\n //--------------------------------------------\n\n // STORE & BROADCAST VALID STATE OF THE FORM AS A WHOLE ///////\n this.validateForm();\n}\n"],"names":["handleEncryption","pFeedbackObj","fieldType","i","len","this","config","autoFocus","type","ENCRYPTED_EXPIRY_YEAR","setFocusOnFrame","ENCRYPTED_SECURITY_CODE","ENCRYPTED_EXPIRY_MONTH","encryptedObjArr","state","securedFields","isEncrypted","processErrors","error","props","rootNode","callbacks","onError","callbackObjectsArr","makeCallbackObjectsEncryption","txVariant","hasOwnProperty","dataObj","code","blob","numKey","postMessageToIframe","getIframeContentWin","loadingContext","ENCRYPTED_CARD_NUMBER","truthy","endDigits","issuerBin","ENCRYPTED_EXPIRY_DATE","expiryDate","length","onFieldValid","validateForm"],"mappings":"+hBAeO,SAASA,EAAiBC,GAE7B,MAAMC,EAAoBD,EAAaC,UAcvC,IAAIC,EACAC,EAZAC,KAAKC,OAAOC,YAEc,SAAtBN,EAAaO,MAAmBN,IAAcO,GAC9CJ,KAAKK,gBAAgBC,GAErBT,IAAcU,GACdP,KAAKK,gBAAgBD,IAQ7B,MAAMI,EAAmCZ,EAAaC,GAGtDG,KAAKS,MAAMC,cAAcb,GAAWc,aAAc,EAGlDC,EACI,CAAEC,MAAO,GAAIhB,aACbG,KAAKS,MAAMC,cAAcb,GACzBG,KAAKS,MAAMN,KACXH,KAAKc,MAAMC,SACXf,KAAKgB,UAAUC,SAMnB,MAAMC,EAA0CC,EAA8B,CAC1EtB,YACAuB,UAAWpB,KAAKS,MAAMN,KACtBY,SAAUf,KAAKc,MAAMC,SACrBP,oBAIJ,GAAIX,IAAcU,GACVc,EAAerB,KAAKS,MAAMC,cAAeN,GAAwB,CACjE,MAAMkB,EAAkB,CACpBF,UAAWpB,KAAKS,MAAMN,KACtBoB,KAAM3B,EAAa2B,KACnBC,KAAMhB,EAAgB,GAAGgB,KACzB3B,UAAWO,EACXqB,OAAQzB,KAAKS,MAAMC,cAAcN,GAAuBqB,QAE5DC,EAAoBJ,EAASK,EAAoB3B,KAAKS,MAAOL,GAAwBJ,KAAKC,OAAO2B,eACrG,CAmBJ,IAfI/B,IAAcgC,GAAyBC,EAAOlC,EAAamC,aAC3Db,EAAmB,GAAGa,UAAYnC,EAAamC,WAI/ClC,IAAcgC,GAAyBC,EAAOlC,EAAaoC,aAC3Dd,EAAmB,GAAGc,WAAapC,EAAaoC,WAIhDnC,IAAcoC,GAAyBH,EAAOlC,EAAasC,cAC3DhB,EAAmB,GAAGgB,WAAatC,EAAasC,YAI/CpC,EAAI,EAAGC,EAAMmB,EAAmBiB,OAAQrC,EAAIC,EAAKD,GAAK,EACvDE,KAAKgB,UAAUoB,aAAalB,EAAmBpB,IAKnDE,KAAKqC,cACT"}
@@ -1,2 +1,2 @@
1
- const e="encrypted",r="encryptedCardNumber",c="encryptedExpiryDate",t="encryptedExpiryMonth",a="encryptedExpiryYear",d="encryptedSecurityCode",i="encryptedPassword",n="encryptedBankAccountNumber",o="encryptedBankLocationId",s="encryptedSecurityCode3digits",y="encryptedSecurityCode4digits",p="giftcard",u="5.0.3",m=["amex","mc","visa"],C=["ach",p],b=[r,c,t,a,d,i],x=[n,o],h=b.concat(x),D=["bcmc"],g="required",k="optional",B="hidden",l=g,v=k,A=B,E=g,M=k,N=B,S="data-cse",f="data-info",j="data-uid",I=["accel","pulse","star","nyce"],w={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},L={[r]:"cardNumber",[c]:"expiryDate",[d]:"securityCode",[t]:"expiryMonth",[a]:"expiryYear",[i]:"password",[n]:"bankAccountNumber",[o]:"bankLocationId",[s]:"securityCodeThreeDigits",[y]:"securityCodeFourDigits"},P=6e3;export{h as ALL_SECURED_FIELDS,I as BRAND_ICON_UI_EXCLUSION_LIST,w as BRAND_READABLE_NAME_MAP,b as CREDIT_CARD_SF_FIELDS,A as CVC_POLICY_HIDDEN,v as CVC_POLICY_OPTIONAL,l as CVC_POLICY_REQUIRED,S as DATA_ENCRYPTED_FIELD_ATTR,f as DATA_INFO,j as DATA_UID,N as DATE_POLICY_HIDDEN,M as DATE_POLICY_OPTIONAL,E as DATE_POLICY_REQUIRED,D as DEDICATED_CARD_COMPONENTS,m as DEFAULT_CARD_GROUP_TYPES,e as ENCRYPTED,n as ENCRYPTED_BANK_ACCNT_NUMBER_FIELD,o as ENCRYPTED_BANK_LOCATION_FIELD,r as ENCRYPTED_CARD_NUMBER,c as ENCRYPTED_EXPIRY_DATE,t as ENCRYPTED_EXPIRY_MONTH,a as ENCRYPTED_EXPIRY_YEAR,i as ENCRYPTED_PWD_FIELD,d as ENCRYPTED_SECURITY_CODE,s as ENCRYPTED_SECURITY_CODE_3_DIGITS,y as ENCRYPTED_SECURITY_CODE_4_DIGITS,p as GIFT_CARD,B as HIDDEN,C as NON_CREDIT_CARD_TYPE_SECURED_FIELDS,k as OPTIONAL,x as OTHER_SF_FIELDS,g as REQUIRED,P as SF_CONFIG_TIMEOUT,L as SF_FIELDS_MAP,u as SF_VERSION};
1
+ const e="encrypted",r="encryptedCardNumber",c="encryptedExpiryDate",t="encryptedExpiryMonth",a="encryptedExpiryYear",d="encryptedSecurityCode",i="encryptedPassword",n="encryptedBankAccountNumber",o="encryptedBankLocationId",s="encryptedSecurityCode3digits",y="encryptedSecurityCode4digits",p="giftcard",u="5.1.0",m=["amex","mc","visa"],C=["ach",p],b=[r,c,t,a,d,i],x=[n,o],h=b.concat(x),D=["bcmc"],g="required",k="optional",B="hidden",l=g,v=k,A=B,E=g,M=k,N=B,S="data-cse",f="data-info",j="data-uid",I=["accel","pulse","star","nyce"],w={visa:"VISA",mc:"MasterCard",amex:"American Express",discover:"Discover",cup:"China Union Pay",jcb:"JCB",diners:"Diners Club",maestro:"Maestro",bcmc:"Bancontact card",bijcard:"de Bijenkorf Card"},L={[r]:"cardNumber",[c]:"expiryDate",[d]:"securityCode",[t]:"expiryMonth",[a]:"expiryYear",[i]:"password",[n]:"bankAccountNumber",[o]:"bankLocationId",[s]:"securityCodeThreeDigits",[y]:"securityCodeFourDigits"},P=6e3;export{h as ALL_SECURED_FIELDS,I as BRAND_ICON_UI_EXCLUSION_LIST,w as BRAND_READABLE_NAME_MAP,b as CREDIT_CARD_SF_FIELDS,A as CVC_POLICY_HIDDEN,v as CVC_POLICY_OPTIONAL,l as CVC_POLICY_REQUIRED,S as DATA_ENCRYPTED_FIELD_ATTR,f as DATA_INFO,j as DATA_UID,N as DATE_POLICY_HIDDEN,M as DATE_POLICY_OPTIONAL,E as DATE_POLICY_REQUIRED,D as DEDICATED_CARD_COMPONENTS,m as DEFAULT_CARD_GROUP_TYPES,e as ENCRYPTED,n as ENCRYPTED_BANK_ACCNT_NUMBER_FIELD,o as ENCRYPTED_BANK_LOCATION_FIELD,r as ENCRYPTED_CARD_NUMBER,c as ENCRYPTED_EXPIRY_DATE,t as ENCRYPTED_EXPIRY_MONTH,a as ENCRYPTED_EXPIRY_YEAR,i as ENCRYPTED_PWD_FIELD,d as ENCRYPTED_SECURITY_CODE,s as ENCRYPTED_SECURITY_CODE_3_DIGITS,y as ENCRYPTED_SECURITY_CODE_4_DIGITS,p as GIFT_CARD,B as HIDDEN,C as NON_CREDIT_CARD_TYPE_SECURED_FIELDS,k as OPTIONAL,x as OTHER_SF_FIELDS,g as REQUIRED,P as SF_CONFIG_TIMEOUT,L as SF_FIELDS_MAP,u as SF_VERSION};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../../src/components/internal/SecuredFields/lib/constants.ts"],"sourcesContent":["import { CVCPolicyType, DatePolicyType } from './types';\n\nexport const ENCRYPTED = 'encrypted';\n\nexport const ENCRYPTED_CARD_NUMBER = 'encryptedCardNumber';\nexport const ENCRYPTED_EXPIRY_DATE = 'encryptedExpiryDate';\nexport const ENCRYPTED_EXPIRY_MONTH = 'encryptedExpiryMonth';\nexport const ENCRYPTED_EXPIRY_YEAR = 'encryptedExpiryYear';\nexport const ENCRYPTED_SECURITY_CODE = 'encryptedSecurityCode';\nexport const ENCRYPTED_PWD_FIELD = 'encryptedPassword';\nexport const ENCRYPTED_PIN_FIELD = 'encryptedPin';\nexport const ENCRYPTED_BANK_ACCNT_NUMBER_FIELD = 'encryptedBankAccountNumber';\nexport const ENCRYPTED_BANK_LOCATION_FIELD = 'encryptedBankLocationId';\n\nexport const ENCRYPTED_SECURITY_CODE_3_DIGITS = 'encryptedSecurityCode3digits';\nexport const ENCRYPTED_SECURITY_CODE_4_DIGITS = 'encryptedSecurityCode4digits';\n\nexport const GIFT_CARD = 'giftcard';\n\nexport const SF_VERSION = '5.0.3';\n\nexport const DEFAULT_CARD_GROUP_TYPES = ['amex', 'mc', 'visa'];\n\nexport const NON_CREDIT_CARD_TYPE_SECURED_FIELDS = ['ach', GIFT_CARD]; // Maybe, sometime in the future will include 'sepa' & 'sepadirectdebit'\n\n// Credit card (CardInput) related securedFields (based on the data-cse attribute)\nexport const CREDIT_CARD_SF_FIELDS = [\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_PWD_FIELD\n // ENCRYPTED_PIN_FIELD,// probably redundant - it was an alt. name for KCP's encryptedPassword. But maybe has a role to play if we ever encrypt ibans.\n];\n\nexport const OTHER_SF_FIELDS = [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD, ENCRYPTED_BANK_LOCATION_FIELD]; // ACH fields\n\n/** A list of all the data-cse attributes that relate to securedFields (as found in card, giftcard or ach) */\nexport const ALL_SECURED_FIELDS = CREDIT_CARD_SF_FIELDS.concat(OTHER_SF_FIELDS);\n\n// Card components created as: checkout.create({BRAND}) e.g. checkout.create('bcmc')\n// - which are dedicated to a single, core, brand e.g. 'bcmc' BUT which can in effect handle multiple brands e.g. \"bcmc\", \"maestro\", \"visa\"\nexport const DEDICATED_CARD_COMPONENTS = ['bcmc'];\n\nexport const REQUIRED = 'required';\nexport const OPTIONAL = 'optional';\nexport const HIDDEN = 'hidden';\n\nexport const CVC_POLICY_REQUIRED: CVCPolicyType = REQUIRED;\nexport const CVC_POLICY_OPTIONAL: CVCPolicyType = OPTIONAL;\nexport const CVC_POLICY_HIDDEN: CVCPolicyType = HIDDEN;\n\nexport const DATE_POLICY_REQUIRED: DatePolicyType = REQUIRED;\nexport const DATE_POLICY_OPTIONAL: DatePolicyType = OPTIONAL;\nexport const DATE_POLICY_HIDDEN: DatePolicyType = HIDDEN;\n\nexport const DATA_ENCRYPTED_FIELD_ATTR = 'data-cse';\nexport const DATA_INFO = 'data-info';\nexport const DATA_UID = 'data-uid';\n\nexport const BRAND_ICON_UI_EXCLUSION_LIST = ['accel', 'pulse', 'star', 'nyce'];\n\nexport const BRAND_READABLE_NAME_MAP = {\n visa: 'VISA',\n mc: 'MasterCard',\n amex: 'American Express',\n discover: 'Discover',\n cup: 'China Union Pay',\n jcb: 'JCB',\n diners: 'Diners Club',\n maestro: 'Maestro',\n bcmc: 'Bancontact card',\n bijcard: 'de Bijenkorf Card'\n};\n\nexport const SF_FIELDS_MAP = {\n [ENCRYPTED_CARD_NUMBER]: 'cardNumber', // ph\n [ENCRYPTED_EXPIRY_DATE]: 'expiryDate', // ph\n [ENCRYPTED_SECURITY_CODE]: 'securityCode',\n [ENCRYPTED_EXPIRY_MONTH]: 'expiryMonth', // ph\n [ENCRYPTED_EXPIRY_YEAR]: 'expiryYear', // ph\n //\n [ENCRYPTED_PWD_FIELD]: 'password',\n [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD]: 'bankAccountNumber',\n [ENCRYPTED_BANK_LOCATION_FIELD]: 'bankLocationId',\n //\n [ENCRYPTED_SECURITY_CODE_3_DIGITS]: 'securityCodeThreeDigits', // ph\n [ENCRYPTED_SECURITY_CODE_4_DIGITS]: 'securityCodeFourDigits' // ph\n};\n\n/** time within which we expect to receive a \"configured\" message from a securedField iframe, once it has registered as having loaded */\nexport const SF_CONFIG_TIMEOUT = 6000;\n"],"names":["ENCRYPTED","ENCRYPTED_CARD_NUMBER","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","ENCRYPTED_SECURITY_CODE","ENCRYPTED_PWD_FIELD","ENCRYPTED_BANK_ACCNT_NUMBER_FIELD","ENCRYPTED_BANK_LOCATION_FIELD","ENCRYPTED_SECURITY_CODE_3_DIGITS","ENCRYPTED_SECURITY_CODE_4_DIGITS","GIFT_CARD","SF_VERSION","DEFAULT_CARD_GROUP_TYPES","NON_CREDIT_CARD_TYPE_SECURED_FIELDS","CREDIT_CARD_SF_FIELDS","OTHER_SF_FIELDS","ALL_SECURED_FIELDS","concat","DEDICATED_CARD_COMPONENTS","REQUIRED","OPTIONAL","HIDDEN","CVC_POLICY_REQUIRED","CVC_POLICY_OPTIONAL","CVC_POLICY_HIDDEN","DATE_POLICY_REQUIRED","DATE_POLICY_OPTIONAL","DATE_POLICY_HIDDEN","DATA_ENCRYPTED_FIELD_ATTR","DATA_INFO","DATA_UID","BRAND_ICON_UI_EXCLUSION_LIST","BRAND_READABLE_NAME_MAP","visa","mc","amex","discover","cup","jcb","diners","maestro","bcmc","bijcard","SF_FIELDS_MAP","SF_CONFIG_TIMEOUT"],"mappings":"AAEO,MAAMA,EAAY,YAEZC,EAAwB,sBACxBC,EAAwB,sBACxBC,EAAyB,uBACzBC,EAAwB,sBACxBC,EAA0B,wBAC1BC,EAAsB,oBAEtBC,EAAoC,6BACpCC,EAAgC,0BAEhCC,EAAmC,+BACnCC,EAAmC,+BAEnCC,EAAY,WAEZC,EAAa,QAEbC,EAA2B,CAAC,OAAQ,KAAM,QAE1CC,EAAsC,CAAC,MAAOH,GAG9CI,EAAwB,CACjCd,EACAC,EACAC,EACAC,EACAC,EACAC,GAISU,EAAkB,CAACT,EAAmCC,GAGtDS,EAAqBF,EAAsBG,OAAOF,GAIlDG,EAA4B,CAAC,QAE7BC,EAAW,WACXC,EAAW,WACXC,EAAS,SAETC,EAAqCH,EACrCI,EAAqCH,EACrCI,EAAmCH,EAEnCI,EAAuCN,EACvCO,EAAuCN,EACvCO,EAAqCN,EAErCO,EAA4B,WAC5BC,EAAY,YACZC,EAAW,WAEXC,EAA+B,CAAC,QAAS,QAAS,OAAQ,QAE1DC,EAA0B,CACnCC,KAAM,OACNC,GAAI,aACJC,KAAM,mBACNC,SAAU,WACVC,IAAK,kBACLC,IAAK,MACLC,OAAQ,cACRC,QAAS,UACTC,KAAM,kBACNC,QAAS,qBAGAC,EAAgB,CACzB3C,CAACA,GAAwB,aACzBC,CAACA,GAAwB,aACzBG,CAACA,GAA0B,eAC3BF,CAACA,GAAyB,cAC1BC,CAACA,GAAwB,aAEzBE,CAACA,GAAsB,WACvBC,CAACA,GAAoC,oBACrCC,CAACA,GAAgC,iBAEjCC,CAACA,GAAmC,0BACpCC,CAACA,GAAmC,0BAI3BmC,EAAoB"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../../src/components/internal/SecuredFields/lib/constants.ts"],"sourcesContent":["import { CVCPolicyType, DatePolicyType } from './types';\n\nexport const ENCRYPTED = 'encrypted';\n\nexport const ENCRYPTED_CARD_NUMBER = 'encryptedCardNumber';\nexport const ENCRYPTED_EXPIRY_DATE = 'encryptedExpiryDate';\nexport const ENCRYPTED_EXPIRY_MONTH = 'encryptedExpiryMonth';\nexport const ENCRYPTED_EXPIRY_YEAR = 'encryptedExpiryYear';\nexport const ENCRYPTED_SECURITY_CODE = 'encryptedSecurityCode';\nexport const ENCRYPTED_PWD_FIELD = 'encryptedPassword';\nexport const ENCRYPTED_PIN_FIELD = 'encryptedPin';\nexport const ENCRYPTED_BANK_ACCNT_NUMBER_FIELD = 'encryptedBankAccountNumber';\nexport const ENCRYPTED_BANK_LOCATION_FIELD = 'encryptedBankLocationId';\n\nexport const ENCRYPTED_SECURITY_CODE_3_DIGITS = 'encryptedSecurityCode3digits';\nexport const ENCRYPTED_SECURITY_CODE_4_DIGITS = 'encryptedSecurityCode4digits';\n\nexport const GIFT_CARD = 'giftcard';\n\nexport const SF_VERSION = '5.1.0';\n\nexport const DEFAULT_CARD_GROUP_TYPES = ['amex', 'mc', 'visa'];\n\nexport const NON_CREDIT_CARD_TYPE_SECURED_FIELDS = ['ach', GIFT_CARD]; // Maybe, sometime in the future will include 'sepa' & 'sepadirectdebit'\n\n// Credit card (CardInput) related securedFields (based on the data-cse attribute)\nexport const CREDIT_CARD_SF_FIELDS = [\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_EXPIRY_MONTH,\n ENCRYPTED_EXPIRY_YEAR,\n ENCRYPTED_SECURITY_CODE,\n ENCRYPTED_PWD_FIELD\n // ENCRYPTED_PIN_FIELD,// probably redundant - it was an alt. name for KCP's encryptedPassword. But maybe has a role to play if we ever encrypt ibans.\n];\n\nexport const OTHER_SF_FIELDS = [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD, ENCRYPTED_BANK_LOCATION_FIELD]; // ACH fields\n\n/** A list of all the data-cse attributes that relate to securedFields (as found in card, giftcard or ach) */\nexport const ALL_SECURED_FIELDS = CREDIT_CARD_SF_FIELDS.concat(OTHER_SF_FIELDS);\n\n// Card components created as: checkout.create({BRAND}) e.g. checkout.create('bcmc')\n// - which are dedicated to a single, core, brand e.g. 'bcmc' BUT which can in effect handle multiple brands e.g. \"bcmc\", \"maestro\", \"visa\"\nexport const DEDICATED_CARD_COMPONENTS = ['bcmc'];\n\nexport const REQUIRED = 'required';\nexport const OPTIONAL = 'optional';\nexport const HIDDEN = 'hidden';\n\nexport const CVC_POLICY_REQUIRED: CVCPolicyType = REQUIRED;\nexport const CVC_POLICY_OPTIONAL: CVCPolicyType = OPTIONAL;\nexport const CVC_POLICY_HIDDEN: CVCPolicyType = HIDDEN;\n\nexport const DATE_POLICY_REQUIRED: DatePolicyType = REQUIRED;\nexport const DATE_POLICY_OPTIONAL: DatePolicyType = OPTIONAL;\nexport const DATE_POLICY_HIDDEN: DatePolicyType = HIDDEN;\n\nexport const DATA_ENCRYPTED_FIELD_ATTR = 'data-cse';\nexport const DATA_INFO = 'data-info';\nexport const DATA_UID = 'data-uid';\n\nexport const BRAND_ICON_UI_EXCLUSION_LIST = ['accel', 'pulse', 'star', 'nyce'];\n\nexport const BRAND_READABLE_NAME_MAP = {\n visa: 'VISA',\n mc: 'MasterCard',\n amex: 'American Express',\n discover: 'Discover',\n cup: 'China Union Pay',\n jcb: 'JCB',\n diners: 'Diners Club',\n maestro: 'Maestro',\n bcmc: 'Bancontact card',\n bijcard: 'de Bijenkorf Card'\n};\n\nexport const SF_FIELDS_MAP = {\n [ENCRYPTED_CARD_NUMBER]: 'cardNumber', // ph\n [ENCRYPTED_EXPIRY_DATE]: 'expiryDate', // ph\n [ENCRYPTED_SECURITY_CODE]: 'securityCode',\n [ENCRYPTED_EXPIRY_MONTH]: 'expiryMonth', // ph\n [ENCRYPTED_EXPIRY_YEAR]: 'expiryYear', // ph\n //\n [ENCRYPTED_PWD_FIELD]: 'password',\n [ENCRYPTED_BANK_ACCNT_NUMBER_FIELD]: 'bankAccountNumber',\n [ENCRYPTED_BANK_LOCATION_FIELD]: 'bankLocationId',\n //\n [ENCRYPTED_SECURITY_CODE_3_DIGITS]: 'securityCodeThreeDigits', // ph\n [ENCRYPTED_SECURITY_CODE_4_DIGITS]: 'securityCodeFourDigits' // ph\n};\n\n/** time within which we expect to receive a \"configured\" message from a securedField iframe, once it has registered as having loaded */\nexport const SF_CONFIG_TIMEOUT = 6000;\n"],"names":["ENCRYPTED","ENCRYPTED_CARD_NUMBER","ENCRYPTED_EXPIRY_DATE","ENCRYPTED_EXPIRY_MONTH","ENCRYPTED_EXPIRY_YEAR","ENCRYPTED_SECURITY_CODE","ENCRYPTED_PWD_FIELD","ENCRYPTED_BANK_ACCNT_NUMBER_FIELD","ENCRYPTED_BANK_LOCATION_FIELD","ENCRYPTED_SECURITY_CODE_3_DIGITS","ENCRYPTED_SECURITY_CODE_4_DIGITS","GIFT_CARD","SF_VERSION","DEFAULT_CARD_GROUP_TYPES","NON_CREDIT_CARD_TYPE_SECURED_FIELDS","CREDIT_CARD_SF_FIELDS","OTHER_SF_FIELDS","ALL_SECURED_FIELDS","concat","DEDICATED_CARD_COMPONENTS","REQUIRED","OPTIONAL","HIDDEN","CVC_POLICY_REQUIRED","CVC_POLICY_OPTIONAL","CVC_POLICY_HIDDEN","DATE_POLICY_REQUIRED","DATE_POLICY_OPTIONAL","DATE_POLICY_HIDDEN","DATA_ENCRYPTED_FIELD_ATTR","DATA_INFO","DATA_UID","BRAND_ICON_UI_EXCLUSION_LIST","BRAND_READABLE_NAME_MAP","visa","mc","amex","discover","cup","jcb","diners","maestro","bcmc","bijcard","SF_FIELDS_MAP","SF_CONFIG_TIMEOUT"],"mappings":"AAEO,MAAMA,EAAY,YAEZC,EAAwB,sBACxBC,EAAwB,sBACxBC,EAAyB,uBACzBC,EAAwB,sBACxBC,EAA0B,wBAC1BC,EAAsB,oBAEtBC,EAAoC,6BACpCC,EAAgC,0BAEhCC,EAAmC,+BACnCC,EAAmC,+BAEnCC,EAAY,WAEZC,EAAa,QAEbC,EAA2B,CAAC,OAAQ,KAAM,QAE1CC,EAAsC,CAAC,MAAOH,GAG9CI,EAAwB,CACjCd,EACAC,EACAC,EACAC,EACAC,EACAC,GAISU,EAAkB,CAACT,EAAmCC,GAGtDS,EAAqBF,EAAsBG,OAAOF,GAIlDG,EAA4B,CAAC,QAE7BC,EAAW,WACXC,EAAW,WACXC,EAAS,SAETC,EAAqCH,EACrCI,EAAqCH,EACrCI,EAAmCH,EAEnCI,EAAuCN,EACvCO,EAAuCN,EACvCO,EAAqCN,EAErCO,EAA4B,WAC5BC,EAAY,YACZC,EAAW,WAEXC,EAA+B,CAAC,QAAS,QAAS,OAAQ,QAE1DC,EAA0B,CACnCC,KAAM,OACNC,GAAI,aACJC,KAAM,mBACNC,SAAU,WACVC,IAAK,kBACLC,IAAK,MACLC,OAAQ,cACRC,QAAS,UACTC,KAAM,kBACNC,QAAS,qBAGAC,EAAgB,CACzB3C,CAACA,GAAwB,aACzBC,CAACA,GAAwB,aACzBG,CAACA,GAA0B,eAC3BF,CAACA,GAAyB,cAC1BC,CAACA,GAAwB,aAEzBE,CAACA,GAAsB,WACvBC,CAACA,GAAoC,oBACrCC,CAACA,GAAgC,iBAEjCC,CAACA,GAAmC,0BACpCC,CAACA,GAAmC,0BAI3BmC,EAAoB"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../../external/preact/dist/preact.js";import e from"../BaseElement/BaseElement.js";import s from"../PayButton/PayButton.js";import{assertIsDropin as i,getRegulatoryDefaults as n,sanitizeResponse as o,verifyPaymentDidNotFail as r,cleanupFinalResult as a}from"./utils.js";import h from"../../../core/Errors/AdyenCheckoutError.js";import{hasOwnProperty as l}from"../../../utils/hasOwnProperty.js";import{ANALYTICS_SUBMIT_STR as d}from"../../../core/Analytics/constants.js";class p extends e{componentRef;resources;elementRef;static type=void 0;static txVariants=[];constructor(t,e){super(t,e),this.constructor.type&&this.core.register(this.constructor),this.submit=this.submit.bind(this),this.setState=this.setState.bind(this),this.onComplete=this.onComplete.bind(this),this.handleAction=this.handleAction.bind(this),this.handleOrder=this.handleOrder.bind(this),this.handleAdditionalDetails=this.handleAdditionalDetails.bind(this),this.handleResponse=this.handleResponse.bind(this),this.setElementStatus=this.setElementStatus.bind(this),this.submitAnalytics=this.submitAnalytics.bind(this),this.makePaymentsCall=this.makePaymentsCall.bind(this),this.makeAdditionalDetailsCall=this.makeAdditionalDetailsCall.bind(this),this.submitUsingSessionsFlow=this.submitUsingSessionsFlow.bind(this),this.elementRef=e&&e.elementRef||this,this.resources=this.props.modules?this.props.modules.resources:void 0,this.storeElementRefOnCore(this.props)}buildElementProps(t){const e={showPayButton:!0,...this.core.getCorePropsForComponent(),...!!t?.isStoredPaymentMethod?{}:this.core.paymentMethodsResponse.find(t?.type||this.constructor.type),...t},s=i(this);this.props=this.formatProps({...this.constructor.defaultProps,...n(this.core.options.countryCode,s),...e})}storeElementRefOnCore(t){t?.isDropin||this.core.storeElementReference(this)}isAvailable(){return Promise.resolve()}setState(t){this.state={...this.state,...t},this.onChange()}showValidation(){return this.componentRef&&this.componentRef.showValidation&&this.componentRef.showValidation(),this}setElementStatus(t,e){return this.elementRef?.setStatus(t,e),this}setStatus(t,e){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,e),this}onChange(){const t=this.isValid,e={data:this.data,errors:this.state.errors,valid:this.state.valid,isValid:t};return this.props.onChange?.(e,this.elementRef),e}setUpAnalytics(t){const e=this.props.session?.id;return this.props.modules.analytics.setUp({...t,...e&&{sessionId:e}})}submitAnalytics(t,e){try{let s=this.constructor.analyticsType;s||(s="scheme"===this.constructor.type||"bcmc"===this.constructor.type?this.constructor.type:this.props.type),this.props.modules.analytics.sendAnalytics(s,t,e)}catch(t){console.warn("Failed to submit the analytics event. Error:",t)}}submit(){this.isValid?this.makePaymentsCall().then(o).then(r).then(this.handleResponse).catch(this.handleFailedResult):this.showValidation()}makePaymentsCall(){if(this.setElementStatus("loading"),this.props.onSubmit)return this.submitUsingAdvancedFlow();if(this.core.session){return(this.props.beforeSubmit?new Promise(((t,e)=>this.props.beforeSubmit(this.data,this.elementRef,{resolve:t,reject:e}))):Promise.resolve(this.data)).then(this.submitUsingSessionsFlow)}this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments call. Callback "onSubmit" is missing or Checkout session is not available'))}async submitUsingAdvancedFlow(){return new Promise(((t,e)=>{this.submitAnalytics({type:d}),this.props.onSubmit({data:this.data,isValid:this.isValid},this.elementRef,{resolve:t,reject:e})}))}async submitUsingSessionsFlow(t){this.submitAnalytics({type:d});try{return await this.core.session.submitPayment(t)}catch(t){return this.handleError(t),Promise.reject(t)}}onComplete(t){this.props.onComplete&&this.props.onComplete(t,this.elementRef)}handleError=t=>{this.setElementStatus("ready"),this.props.onError&&this.props.onError(t,this.elementRef)};handleAdditionalDetails(t){this.makeAdditionalDetailsCall(t).then(o).then(r).then(this.handleResponse).catch(this.handleFailedResult)}makeAdditionalDetailsCall(t){return this.setElementStatus("loading"),this.props.onAdditionalDetails?new Promise(((e,s)=>{this.props.onAdditionalDetails(t,this.elementRef,{resolve:e,reject:s})})):this.core.session?this.submitAdditionalDetailsUsingSessionsFlow(t.data):void this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments/details call. Callback "onAdditionalDetails" is missing or Checkout session is not available'))}async submitAdditionalDetailsUsingSessionsFlow(t){try{return await this.core.session.submitDetails(t)}catch(t){return this.handleError(t),Promise.reject(t)}}handleAction(t,e={}){if(!t||!t.type){if(l(t,"action")&&l(t,"resultCode"))throw new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('handleAction::Invalid Action - the passed action object does not have a "type" property')}const s=this.core.createFromAction(t,{...this.elementRef.props,...e,onAdditionalDetails:this.handleAdditionalDetails});return s?(this.unmount(),s.mount(this._node)):null}handleOrder=t=>{const{order:e}=t;(this.core.session?this.core.update({order:e}):this.handleAdvanceFlowPaymentMethodsUpdate(e)).then((()=>{this.props.onOrderUpdated?.({order:e})}))};handleFailedResult=t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("error"),a(t),this.props.onPaymentFailed?.(t,this.elementRef)};handleSuccessResult=t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("success"),a(t),this.props.onPaymentCompleted?.(t,this.elementRef)};handleResponse(t){const e=o(t);e.action?this.elementRef.handleAction(e.action):e.order?.remainingAmount?.value>0?this.handleOrder(e):this.handleSuccessResult(e)}updateParent(t={}){return this.elementRef.core.update(t)}setComponentRef=t=>{this.componentRef=t};get isValid(){return!1}get icon(){const t=this.props.paymentMethodType||this.type;return this.props.icon??this.resources.getImage()(t)}get displayName(){const t=this.core.paymentMethodsResponse?.paymentMethods?.find((t=>t.type===this.type));return this.props.name||t?.name||this.type}get accessibleName(){return this.displayName}get additionalInfo(){return null}get type(){return this.props.type||this.constructor.type}payButton=e=>t(s,{...e,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,onClick:this.submit});async handleAdvanceFlowPaymentMethodsUpdate(t,e){return new Promise(((e,s)=>{if(!this.props.onPaymentMethodsRequest)return s(new Error("onPaymentMethodsRequest is not implemented"));this.props.onPaymentMethodsRequest({...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},locale:this.core.options.locale},{resolve:e,reject:s})})).catch((t=>{this.handleError(new h("IMPLEMENTATION_ERROR","Something failed during payment methods update or onPaymentMethodsRequest was not implemented",{cause:t}))})).then((s=>this.core.update({...s&&{paymentMethodsResponse:s},order:t,amount:t?t.remainingAmount:e})))}}export{p as UIElement,p as default};
1
+ import{createElement as t}from"../../../external/preact/dist/preact.js";import e from"../BaseElement/BaseElement.js";import s from"../PayButton/PayButton.js";import{assertIsDropin as i,getRegulatoryDefaults as n,sanitizeResponse as o,verifyPaymentDidNotFail as r,cleanupFinalResult as a}from"./utils.js";import h from"../../../core/Errors/AdyenCheckoutError.js";import{hasOwnProperty as l}from"../../../utils/hasOwnProperty.js";import{ANALYTICS_SUBMIT_STR as d}from"../../../core/Analytics/constants.js";class p extends e{componentRef;resources;elementRef;static type=void 0;static txVariants=[];constructor(t,e){super(t,e),this.constructor.type&&this.core.register(this.constructor),this.submit=this.submit.bind(this),this.setState=this.setState.bind(this),this.onComplete=this.onComplete.bind(this),this.handleAction=this.handleAction.bind(this),this.handleOrder=this.handleOrder.bind(this),this.handleAdditionalDetails=this.handleAdditionalDetails.bind(this),this.handleResponse=this.handleResponse.bind(this),this.setElementStatus=this.setElementStatus.bind(this),this.submitAnalytics=this.submitAnalytics.bind(this),this.makePaymentsCall=this.makePaymentsCall.bind(this),this.makeAdditionalDetailsCall=this.makeAdditionalDetailsCall.bind(this),this.submitUsingSessionsFlow=this.submitUsingSessionsFlow.bind(this),this.elementRef=e&&e.elementRef||this,this.resources=this.props.modules?this.props.modules.resources:void 0,this.storeElementRefOnCore(this.props)}buildElementProps(t){const e={showPayButton:!0,...this.core.getCorePropsForComponent(),...!!t?.isStoredPaymentMethod?{}:this.core.paymentMethodsResponse.find(t?.type||this.constructor.type),...t},s=i(this);this.props=this.formatProps({...this.constructor.defaultProps,...n(this.core.options.countryCode,s),...e})}storeElementRefOnCore(t){t?.isDropin||this.core.storeElementReference(this)}isAvailable(){return Promise.resolve()}setState(t){this.state={...this.state,...t},this.onChange()}showValidation(){return this.componentRef&&this.componentRef.showValidation&&this.componentRef.showValidation(),this}setElementStatus(t,e){return this.elementRef?.setStatus(t,e),this}setStatus(t,e){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,e),this}onChange(){const t=this.isValid,e={data:this.data,errors:this.state.errors,valid:this.state.valid,isValid:t};return this.props.onChange?.(e,this.elementRef),e}setUpAnalytics(t){const e=this.props.session?.id;return this.props.modules.analytics.setUp({...t,...e&&{sessionId:e}})}submitAnalytics(t,e){try{let s=this.constructor.analyticsType;s||(s="scheme"===this.constructor.type||"bcmc"===this.constructor.type?this.constructor.type:this.props.type),this.props.modules.analytics.sendAnalytics(s,t,e)}catch(t){console.warn("Failed to submit the analytics event. Error:",t)}}submit(){this.isValid?this.makePaymentsCall().then(o).then(r).then(this.handleResponse).catch(this.handleFailedResult):this.showValidation()}makePaymentsCall(){if(this.setElementStatus("loading"),this.props.onSubmit)return this.submitUsingAdvancedFlow();if(this.core.session){return(this.props.beforeSubmit?new Promise(((t,e)=>this.props.beforeSubmit(this.data,this.elementRef,{resolve:t,reject:e}))):Promise.resolve(this.data)).then(this.submitUsingSessionsFlow)}this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments call. Callback "onSubmit" is missing or Checkout session is not available'))}async submitUsingAdvancedFlow(){return new Promise(((t,e)=>{this.submitAnalytics({type:d}),this.props.onSubmit({data:this.data,isValid:this.isValid},this.elementRef,{resolve:t,reject:e})}))}async submitUsingSessionsFlow(t){this.submitAnalytics({type:d});try{return await this.core.session.submitPayment(t)}catch(t){return t instanceof h?this.handleError(t):this.handleError(new h("ERROR","Error when making /payments call",{cause:t})),Promise.reject(t)}}onComplete(t){this.props.onComplete&&this.props.onComplete(t,this.elementRef)}handleError=t=>{this.setElementStatus("ready"),this.props.onError&&this.props.onError(t,this.elementRef)};handleAdditionalDetails(t){this.makeAdditionalDetailsCall(t).then(o).then(r).then(this.handleResponse).catch(this.handleFailedResult)}makeAdditionalDetailsCall(t){return this.props.onAdditionalDetails?new Promise(((e,s)=>{this.props.onAdditionalDetails(t,this.elementRef,{resolve:e,reject:s})})):this.core.session?this.submitAdditionalDetailsUsingSessionsFlow(t.data):void this.handleError(new h("IMPLEMENTATION_ERROR",'It can not perform /payments/details call. Callback "onAdditionalDetails" is missing or Checkout session is not available'))}async submitAdditionalDetailsUsingSessionsFlow(t){try{return await this.core.session.submitDetails(t)}catch(t){return t instanceof h?this.handleError(t):this.handleError(new h("ERROR","Error when making /details call",{cause:t})),Promise.reject(t)}}handleAction(t,e={}){if(!t||!t.type){if(l(t,"action")&&l(t,"resultCode"))throw new Error('handleAction::Invalid Action - the passed action object itself has an "action" property and a "resultCode": have you passed in the whole response object by mistake?');throw new Error('handleAction::Invalid Action - the passed action object does not have a "type" property')}const s=this.core.createFromAction(t,{...this.elementRef.props,...e,onAdditionalDetails:this.handleAdditionalDetails});return s?(this.unmount(),s.mount(this._node)):null}handleOrder=t=>{const{order:e}=t;(this.core.session?this.core.update({order:e}):this.handleAdvanceFlowPaymentMethodsUpdate(e)).then((()=>{this.props.onOrderUpdated?.({order:e})}))};handleFailedResult=t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("error"),a(t),this.props.onPaymentFailed?.(t,this.elementRef)};handleSuccessResult=t=>{i(this.elementRef)&&this.elementRef.displayFinalAnimation("success"),a(t),this.props.onPaymentCompleted?.(t,this.elementRef)};handleResponse(t){const e=o(t);e.action?this.elementRef.handleAction(e.action):e.order?.remainingAmount?.value>0?this.handleOrder(e):this.handleSuccessResult(e)}updateParent(t={}){return this.elementRef.core.update(t)}setComponentRef=t=>{this.componentRef=t};get isValid(){return!1}get icon(){const t=this.props.paymentMethodType||this.type;return this.props.icon??this.resources.getImage()(t)}get displayName(){const t=this.core.paymentMethodsResponse?.paymentMethods?.find((t=>t.type===this.type));return this.props.name||t?.name||this.type}get accessibleName(){return this.displayName}get additionalInfo(){return null}get type(){return this.props.type||this.constructor.type}payButton=e=>t(s,{...e,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,onClick:this.submit});async handleAdvanceFlowPaymentMethodsUpdate(t,e){return new Promise(((e,s)=>{if(!this.props.onPaymentMethodsRequest)return s(new Error("onPaymentMethodsRequest is not implemented"));this.props.onPaymentMethodsRequest({...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},locale:this.core.options.locale},{resolve:e,reject:s})})).catch((t=>{this.handleError(new h("IMPLEMENTATION_ERROR","Something failed during payment methods update or onPaymentMethodsRequest was not implemented",{cause:t}))})).then((s=>this.core.update({...s&&{paymentMethodsResponse:s},order:t,amount:t?t.remainingAmount:e})))}}export{p as UIElement,p as default};
2
2
  //# sourceMappingURL=UIElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UIElement.js","sources":["../../../../../src/components/internal/UIElement/UIElement.tsx"],"sourcesContent":["import { h } from 'preact';\nimport BaseElement from '../BaseElement/BaseElement';\nimport PayButton from '../PayButton';\nimport { assertIsDropin, cleanupFinalResult, getRegulatoryDefaults, sanitizeResponse, verifyPaymentDidNotFail } from './utils';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { hasOwnProperty } from '../../../utils/hasOwnProperty';\nimport { Resources } from '../../../core/Context/Resources';\nimport { ANALYTICS_SUBMIT_STR } from '../../../core/Analytics/constants';\n\nimport type { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\nimport type { CoreConfiguration, ICore } from '../../../core/types';\nimport type { NewableComponent } from '../../../core/core.registry';\nimport type { ComponentMethodsRef, IUIElement, PayButtonFunctionProps, UIElementProps, UIElementStatus } from './types';\nimport type { CheckoutSessionDetailsResponse, CheckoutSessionPaymentResponse } from '../../../core/CheckoutSession/types';\nimport type {\n AdditionalDetailsStateData,\n CheckoutAdvancedFlowResponse,\n Order,\n PaymentAction,\n PaymentAmount,\n PaymentData,\n PaymentMethodsResponse,\n PaymentResponseData,\n RawPaymentResponse\n} from '../../../types/global-types';\nimport type { IDropin } from '../../Dropin/types';\n\nimport './UIElement.scss';\n\nexport abstract class UIElement<P extends UIElementProps = UIElementProps> extends BaseElement<P> implements IUIElement {\n protected componentRef: any;\n\n protected resources: Resources;\n\n public elementRef: UIElement;\n\n public static type = undefined;\n\n /**\n * Defines all txVariants that the Component supports (in case it support multiple ones besides the 'type' one)\n */\n public static txVariants: string[] = [];\n\n constructor(checkout: ICore, props?: P) {\n super(checkout, props);\n\n // Only register UIElements that have the 'type' set. Drop-in for example does not have.\n if (this.constructor['type']) {\n this.core.register(this.constructor as NewableComponent);\n }\n\n this.submit = this.submit.bind(this);\n this.setState = this.setState.bind(this);\n this.onComplete = this.onComplete.bind(this);\n this.handleAction = this.handleAction.bind(this);\n this.handleOrder = this.handleOrder.bind(this);\n this.handleAdditionalDetails = this.handleAdditionalDetails.bind(this);\n this.handleResponse = this.handleResponse.bind(this);\n this.setElementStatus = this.setElementStatus.bind(this);\n this.submitAnalytics = this.submitAnalytics.bind(this);\n this.makePaymentsCall = this.makePaymentsCall.bind(this);\n this.makeAdditionalDetailsCall = this.makeAdditionalDetailsCall.bind(this);\n this.submitUsingSessionsFlow = this.submitUsingSessionsFlow.bind(this);\n\n this.elementRef = (props && props.elementRef) || this;\n this.resources = this.props.modules ? this.props.modules.resources : undefined;\n\n this.storeElementRefOnCore(this.props);\n }\n\n protected override buildElementProps(componentProps?: P) {\n const globalCoreProps = this.core.getCorePropsForComponent();\n const isStoredPaymentMethod = !!componentProps?.isStoredPaymentMethod;\n const paymentMethodsResponseProps = isStoredPaymentMethod\n ? {}\n : this.core.paymentMethodsResponse.find(componentProps?.type || this.constructor['type']);\n\n const finalProps = {\n showPayButton: true,\n ...globalCoreProps,\n ...paymentMethodsResponseProps,\n ...componentProps\n };\n\n const isDropin = assertIsDropin(this as unknown as IDropin);\n\n this.props = this.formatProps({\n ...this.constructor['defaultProps'], // component defaults\n ...getRegulatoryDefaults(this.core.options.countryCode, isDropin), // regulatory defaults\n ...finalProps // the rest (inc. merchant defined config)\n });\n }\n\n protected storeElementRefOnCore(props?: P) {\n if (!props?.isDropin) {\n this.core.storeElementReference(this);\n }\n }\n\n public isAvailable(): Promise<void> {\n return Promise.resolve();\n }\n\n public setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n this.onChange();\n }\n\n public showValidation(): this {\n if (this.componentRef && this.componentRef.showValidation) this.componentRef.showValidation();\n return this;\n }\n\n public setElementStatus(status: UIElementStatus, props?: any): this {\n this.elementRef?.setStatus(status, props);\n return this;\n }\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n return this;\n }\n\n protected onChange(): object {\n const isValid = this.isValid;\n const state = { data: this.data, errors: this.state.errors, valid: this.state.valid, isValid };\n\n this.props.onChange?.(state, this.elementRef);\n\n return state;\n }\n\n // Only called once, for UIElements (including Dropin), as they are being mounted\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n const sessionId = this.props.session?.id;\n\n return this.props.modules.analytics.setUp({\n ...setUpAnalyticsObj,\n ...(sessionId && { sessionId })\n });\n }\n\n /**\n * A function for all UIElements, or BaseElement, to use to create an analytics action for when it's been:\n * - mounted,\n * - a PM has been selected\n * - onSubmit has been called (as a result of the pay button being pressed)\n *\n * In some other cases e.g. 3DS2 components, this function is overridden to allow more specific analytics actions to be created\n */\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj: SendAnalyticsObject, uiElementProps?) {\n /** Work out what the component's \"type\" is:\n * - first check for a dedicated \"analyticsType\" (currently only applies to custom-cards)\n * - otherwise, distinguish cards from non-cards: cards will use their static type property, everything else will use props.type\n */\n try {\n let component = this.constructor['analyticsType'];\n if (!component) {\n component = this.constructor['type'] === 'scheme' || this.constructor['type'] === 'bcmc' ? this.constructor['type'] : this.props.type;\n }\n\n this.props.modules.analytics.sendAnalytics(component, analyticsObj, uiElementProps);\n } catch (error) {\n console.warn('Failed to submit the analytics event. Error:', error);\n }\n }\n\n public submit(): void {\n if (!this.isValid) {\n this.showValidation();\n return;\n }\n\n this.makePaymentsCall().then(sanitizeResponse).then(verifyPaymentDidNotFail).then(this.handleResponse).catch(this.handleFailedResult);\n }\n\n protected makePaymentsCall(): Promise<CheckoutAdvancedFlowResponse | CheckoutSessionPaymentResponse> {\n this.setElementStatus('loading');\n\n if (this.props.onSubmit) {\n return this.submitUsingAdvancedFlow();\n }\n\n if (this.core.session) {\n const beforeSubmitEvent: Promise<PaymentData> = this.props.beforeSubmit\n ? new Promise((resolve, reject) =>\n this.props.beforeSubmit(this.data, this.elementRef, {\n resolve,\n reject\n })\n )\n : Promise.resolve(this.data);\n\n return beforeSubmitEvent.then(this.submitUsingSessionsFlow);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments call. Callback \"onSubmit\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitUsingAdvancedFlow(): Promise<CheckoutAdvancedFlowResponse> {\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n // Call analytics endpoint\n this.submitAnalytics({ type: ANALYTICS_SUBMIT_STR });\n\n this.props.onSubmit(\n {\n data: this.data,\n isValid: this.isValid\n },\n this.elementRef,\n { resolve, reject }\n );\n });\n }\n\n private async submitUsingSessionsFlow(data: PaymentData): Promise<CheckoutSessionPaymentResponse> {\n // Call analytics endpoint\n this.submitAnalytics({ type: ANALYTICS_SUBMIT_STR });\n\n try {\n return await this.core.session.submitPayment(data);\n } catch (error) {\n this.handleError(error);\n return Promise.reject(error);\n }\n\n // // Uncomment to simulate failed\n // return {\n // resultCode: 'Refused',\n // sessionData:\n // 'Ab02b4c0!BQABAgBKGgqfEz8uQlU4yCIOWjA8bkEwmbJ7Qt4r+x5IPXREu1rMjwNk5MDoHFNlv+MWvinS6nXIDniXgRzXCdSC4ksw9CNDBAjOa+B88wRoj/rLTieuWh/0leR88qkV24vtIkjsIsbJTDB78Pd8wX8MEDsXhaAdEIyX9E8eqxuQ3bwPbvLs1Dlgo1ZrfkQRzaNiuVM8ejRG0IWE1bGThJzY+sJvZZHvlDMXIlxhZcDoQvsMj/WwE6+nFJxBiC3oRzmvVn3AbkLQGtvwq16UUSfYbPzG9dXypJMtcrZAQYq2g/2+BSibCcmee9AXq/wij11BERrYmjbDt5NkkdUnDVgAB7pdqbnWX0A2sxBKeYtLSP2kxp+5LoU/Wty3fmcVA3VKVkHfgmIihkeL8lY++5hvHjnkzOE4tyx/sheiKS4zqoWE43TD6n8mpFskAzwMHq4G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5zuw47GQrN9Qzxl2WV3A38MQPUqFtIr/71Rjkphgg49ZGWEYCwgFmm8jJc2/5qTabSGk4bzwiETCTzeydq30bUGqCwglj8CrFViAuQeTJm7dp+PYKMkUNvQRpnSXMj6Kz7rvAMzhzJgK62ltN2idqKxLC7WtivCUgejuQUvNreCYBQCaKwTwP02lZsJpGF9yw8gbyuoB+2aB7IZmgIB8GP4qVQ/ht5B9z/FLohK/8cSPV/4i32SNNdcwhV',\n // sessionResult:\n // 'X3XtfGC7!H4sIAAAAAAAA/6tWykxRslJyDjaxNDMyM3E2MXIyNDUys3RU0lHKTS1KzkjMK3FMTs4vzSsBKgtJLS7xhYo6Z6QmZ+eXlgAVFpcklpQWA+WLUtNKi1NTlGoBMEEbz1cAAAA=iMsCaEJ5LcnsqIUtmNxjm8HtfQ8gZW8JewEU3wHz4qg='\n // };\n }\n\n protected onComplete(state): void {\n if (this.props.onComplete) this.props.onComplete(state, this.elementRef);\n }\n\n protected handleError = (error: AdyenCheckoutError): void => {\n /**\n * Set status using elementRef, which:\n * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component\n * - If Component, it will set its own status\n */\n this.setElementStatus('ready');\n\n if (this.props.onError) {\n this.props.onError(error, this.elementRef);\n }\n };\n\n protected handleAdditionalDetails(state: AdditionalDetailsStateData): void {\n this.makeAdditionalDetailsCall(state)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n private makeAdditionalDetailsCall(state: AdditionalDetailsStateData): Promise<CheckoutSessionDetailsResponse | CheckoutAdvancedFlowResponse> {\n this.setElementStatus('loading');\n\n if (this.props.onAdditionalDetails) {\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n this.props.onAdditionalDetails(state, this.elementRef, { resolve, reject });\n });\n }\n\n if (this.core.session) {\n return this.submitAdditionalDetailsUsingSessionsFlow(state.data);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments/details call. Callback \"onAdditionalDetails\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitAdditionalDetailsUsingSessionsFlow(data: any): Promise<CheckoutSessionDetailsResponse> {\n try {\n return await this.core.session.submitDetails(data);\n } catch (error) {\n this.handleError(error);\n return Promise.reject(error);\n }\n }\n\n public handleAction(action: PaymentAction, props = {}): UIElement<P> | null {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'handleAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('handleAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n const paymentAction = this.core.createFromAction(action, {\n ...this.elementRef.props,\n ...props,\n onAdditionalDetails: this.handleAdditionalDetails\n });\n\n if (paymentAction) {\n this.unmount();\n return paymentAction.mount(this._node);\n }\n\n return null;\n }\n\n protected handleOrder = (response: PaymentResponseData): void => {\n const { order } = response;\n\n const updateCorePromise = this.core.session ? this.core.update({ order }) : this.handleAdvanceFlowPaymentMethodsUpdate(order);\n\n updateCorePromise.then(() => {\n this.props.onOrderUpdated?.({ order });\n });\n };\n\n /**\n * Handles when the payment fails. The payment fails when:\n * - adv flow: the merchant rejects the payment due to a critical error\n * - adv flow: the merchant resolves the payment with a failed resultCode\n * - sessions: a network error occurs when making the payment\n * - sessions: the payment fails with a failed resultCode\n *\n * @param result\n */\n protected handleFailedResult = (result?: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('error');\n }\n\n cleanupFinalResult(result);\n this.props.onPaymentFailed?.(result, this.elementRef);\n };\n\n protected handleSuccessResult = (result: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('success');\n }\n\n cleanupFinalResult(result);\n this.props.onPaymentCompleted?.(result, this.elementRef);\n };\n\n /**\n * Handles a session /payments or /payments/details response.\n * The component will handle automatically actions, orders, and final results.\n *\n * @param rawResponse -\n */\n protected handleResponse(rawResponse: RawPaymentResponse): void {\n const response = sanitizeResponse(rawResponse);\n\n if (response.action) {\n this.elementRef.handleAction(response.action);\n return;\n }\n\n if (response.order?.remainingAmount?.value > 0) {\n // we don't want to call elementRef here, use the component handler\n // we do this way so the logic on handlingOrder is associated with payment method\n this.handleOrder(response);\n return;\n }\n\n this.handleSuccessResult(response);\n }\n\n /**\n * Call update on parent instance\n * This function exist to make safe access to the protect _parentInstance\n * @param options - CoreOptions\n */\n public updateParent(options: CoreConfiguration = {}): Promise<ICore> {\n return this.elementRef.core.update(options);\n }\n\n public setComponentRef = (ref: ComponentMethodsRef) => {\n this.componentRef = ref;\n };\n\n /**\n * Get the current validation status of the element\n */\n public get isValid(): boolean {\n return false;\n }\n\n /**\n * Get the element icon URL for the current environment\n */\n\n public get icon(): string {\n const type = this.props.paymentMethodType || this.type;\n return this.props.icon ?? this.resources.getImage()(type);\n }\n\n /**\n * Get the element's displayable name\n */\n public get displayName(): string {\n const paymentMethodFromResponse = this.core.paymentMethodsResponse?.paymentMethods?.find(pm => pm.type === this.type);\n return this.props.name || paymentMethodFromResponse?.name || this.type;\n }\n\n /**\n * Get the element accessible name, used in the aria-label of the button that controls selected payment method\n */\n public get accessibleName(): string {\n return this.displayName;\n }\n\n /**\n * Used to display the second line of a payment method item\n */\n get additionalInfo(): string {\n return null;\n }\n\n /**\n * Return the type of an element\n */\n public get type(): string {\n return this.props.type || this.constructor['type'];\n }\n\n /**\n * Get the payButton component for the current element\n */\n protected payButton = (props: PayButtonFunctionProps) => {\n return <PayButton {...props} amount={this.props.amount} secondaryAmount={this.props.secondaryAmount} onClick={this.submit} />;\n };\n\n /**\n * Used in the Partial Orders flow.\n * When the Order is updated, the merchant can request new payment methods based on the new remaining amount\n *\n * @private\n */\n protected async handleAdvanceFlowPaymentMethodsUpdate(order: Order | null, amount?: PaymentAmount) {\n return new Promise<PaymentMethodsResponse>((resolve, reject) => {\n if (!this.props.onPaymentMethodsRequest) {\n return reject(new Error('onPaymentMethodsRequest is not implemented'));\n }\n\n this.props.onPaymentMethodsRequest(\n {\n ...(order && {\n order: {\n orderData: order.orderData,\n pspReference: order.pspReference\n }\n }),\n locale: this.core.options.locale\n },\n { resolve, reject }\n );\n })\n .catch(error => {\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'Something failed during payment methods update or onPaymentMethodsRequest was not implemented',\n {\n cause: error\n }\n )\n );\n })\n .then(paymentMethodsResponse => {\n // in the case of the session flow we get order, amount, countryCode and shopperLocale from initialize()\n // apply the same logic here for order and amount\n // in the future it might be worth moving this logic to be performed by the core on update()\n // it would make this more consistent\n return this.core.update({\n ...(paymentMethodsResponse && { paymentMethodsResponse }),\n order,\n amount: order ? order.remainingAmount : amount\n });\n });\n }\n}\n\nexport default UIElement;\n"],"names":["UIElement","BaseElement","componentRef","resources","elementRef","static","undefined","constructor","checkout","props","super","this","core","register","submit","bind","setState","onComplete","handleAction","handleOrder","handleAdditionalDetails","handleResponse","setElementStatus","submitAnalytics","makePaymentsCall","makeAdditionalDetailsCall","submitUsingSessionsFlow","modules","storeElementRefOnCore","buildElementProps","componentProps","finalProps","showPayButton","getCorePropsForComponent","isStoredPaymentMethod","paymentMethodsResponse","find","type","isDropin","assertIsDropin","formatProps","getRegulatoryDefaults","options","countryCode","storeElementReference","isAvailable","Promise","resolve","newState","state","onChange","showValidation","status","setStatus","isValid","data","errors","valid","setUpAnalytics","setUpAnalyticsObj","sessionId","session","id","analytics","setUp","analyticsObj","uiElementProps","component","sendAnalytics","error","console","warn","then","sanitizeResponse","verifyPaymentDidNotFail","catch","handleFailedResult","onSubmit","submitUsingAdvancedFlow","beforeSubmit","reject","handleError","AdyenCheckoutError","ANALYTICS_SUBMIT_STR","submitPayment","onError","onAdditionalDetails","submitAdditionalDetailsUsingSessionsFlow","submitDetails","action","hasOwnProperty","Error","paymentAction","createFromAction","unmount","mount","_node","response","order","update","handleAdvanceFlowPaymentMethodsUpdate","onOrderUpdated","result","displayFinalAnimation","cleanupFinalResult","onPaymentFailed","handleSuccessResult","onPaymentCompleted","rawResponse","remainingAmount","value","updateParent","setComponentRef","ref","icon","paymentMethodType","getImage","displayName","paymentMethodFromResponse","paymentMethods","pm","name","accessibleName","additionalInfo","payButton","h","PayButton","amount","secondaryAmount","onClick","onPaymentMethodsRequest","orderData","pspReference","locale","cause"],"mappings":"wfA6BO,MAAeA,UAA6DC,EACrEC,aAEAC,UAEHC,WAEPC,iBAAqBC,EAKrBD,kBAAqC,GAErCE,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAGZE,KAAKJ,kBACLI,KAAKC,KAAKC,SAASF,KAAKJ,aAG5BI,KAAKG,OAASH,KAAKG,OAAOC,KAAKJ,MAC/BA,KAAKK,SAAWL,KAAKK,SAASD,KAAKJ,MACnCA,KAAKM,WAAaN,KAAKM,WAAWF,KAAKJ,MACvCA,KAAKO,aAAeP,KAAKO,aAAaH,KAAKJ,MAC3CA,KAAKQ,YAAcR,KAAKQ,YAAYJ,KAAKJ,MACzCA,KAAKS,wBAA0BT,KAAKS,wBAAwBL,KAAKJ,MACjEA,KAAKU,eAAiBV,KAAKU,eAAeN,KAAKJ,MAC/CA,KAAKW,iBAAmBX,KAAKW,iBAAiBP,KAAKJ,MACnDA,KAAKY,gBAAkBZ,KAAKY,gBAAgBR,KAAKJ,MACjDA,KAAKa,iBAAmBb,KAAKa,iBAAiBT,KAAKJ,MACnDA,KAAKc,0BAA4Bd,KAAKc,0BAA0BV,KAAKJ,MACrEA,KAAKe,wBAA0Bf,KAAKe,wBAAwBX,KAAKJ,MAEjEA,KAAKP,WAAcK,GAASA,EAAML,YAAeO,KACjDA,KAAKR,UAAYQ,KAAKF,MAAMkB,QAAUhB,KAAKF,MAAMkB,QAAQxB,eAAYG,EAErEK,KAAKiB,sBAAsBjB,KAAKF,MACpC,CAEmBoB,iBAAAA,CAAkBC,G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A,kBAAIM,GACA,OAAO,IACX,CAKA,QAAWtF,GACP,OAAO1B,KAAKF,MAAM4B,MAAQ1B,KAAKJ,YAAmB,IACtD,CAKUqH,UAAanH,GACZoH,EAACC,EAAAA,IAAcrH,EAAOsH,OAAQpH,KAAKF,MAAMsH,OAAQC,gBAAiBrH,KAAKF,MAAMuH,gBAAiBC,QAAStH,KAAKG,SASvH,2CAAgBsF,CAAsCF,EAAqB6B,GACvE,OAAO,IAAIjF,SAAgC,CAACC,EAASiC,KACjD,IAAKrE,KAAKF,MAAMyH,wBACZ,OAAOlD,EAAO,IAAIW,MAAM,+CAG5BhF,KAAKF,MAAMyH,wBACP,IACQhC,GAAS,CACTA,MAAO,CACHiC,UAAWjC,EAAMiC,UACjBC,aAAclC,EAAMkC,eAG5BC,OAAQ1H,KAAKC,KAAK8B,QAAQ2F,QAE9B,CAAEtF,UAASiC,UAAO,IAGrBL,OAAMN,IACH1D,KAAKsE,YACD,IAAIC,EACA,uBACA,gGACA,CACIoD,MAAOjE,IACX,IAIXG,MAAKrC,GAKKxB,KAAKC,KAAKuF,OAAO,IAChBhE,GAA0B,CAAEA,0BAChC+D,QACA6B,OAAQ7B,EAAQA,EAAMW,gBAAkBkB,KAGxD"}
1
+ {"version":3,"file":"UIElement.js","sources":["../../../../../src/components/internal/UIElement/UIElement.tsx"],"sourcesContent":["import { h } from 'preact';\nimport BaseElement from '../BaseElement/BaseElement';\nimport PayButton from '../PayButton';\nimport { assertIsDropin, cleanupFinalResult, getRegulatoryDefaults, sanitizeResponse, verifyPaymentDidNotFail } from './utils';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { hasOwnProperty } from '../../../utils/hasOwnProperty';\nimport { Resources } from '../../../core/Context/Resources';\nimport { ANALYTICS_SUBMIT_STR } from '../../../core/Analytics/constants';\n\nimport type { AnalyticsInitialEvent, SendAnalyticsObject } from '../../../core/Analytics/types';\nimport type { CoreConfiguration, ICore } from '../../../core/types';\nimport type { NewableComponent } from '../../../core/core.registry';\nimport type { ComponentMethodsRef, IUIElement, PayButtonFunctionProps, UIElementProps, UIElementStatus } from './types';\nimport type { CheckoutSessionDetailsResponse, CheckoutSessionPaymentResponse } from '../../../core/CheckoutSession/types';\nimport type {\n AdditionalDetailsStateData,\n CheckoutAdvancedFlowResponse,\n Order,\n PaymentAction,\n PaymentAmount,\n PaymentData,\n PaymentMethodsResponse,\n PaymentResponseData,\n RawPaymentResponse\n} from '../../../types/global-types';\nimport type { IDropin } from '../../Dropin/types';\n\nimport './UIElement.scss';\n\nexport abstract class UIElement<P extends UIElementProps = UIElementProps> extends BaseElement<P> implements IUIElement {\n protected componentRef: any;\n\n protected resources: Resources;\n\n public elementRef: UIElement;\n\n public static type = undefined;\n\n /**\n * Defines all txVariants that the Component supports (in case it support multiple ones besides the 'type' one)\n */\n public static txVariants: string[] = [];\n\n constructor(checkout: ICore, props?: P) {\n super(checkout, props);\n\n // Only register UIElements that have the 'type' set. Drop-in for example does not have.\n if (this.constructor['type']) {\n this.core.register(this.constructor as NewableComponent);\n }\n\n this.submit = this.submit.bind(this);\n this.setState = this.setState.bind(this);\n this.onComplete = this.onComplete.bind(this);\n this.handleAction = this.handleAction.bind(this);\n this.handleOrder = this.handleOrder.bind(this);\n this.handleAdditionalDetails = this.handleAdditionalDetails.bind(this);\n this.handleResponse = this.handleResponse.bind(this);\n this.setElementStatus = this.setElementStatus.bind(this);\n this.submitAnalytics = this.submitAnalytics.bind(this);\n this.makePaymentsCall = this.makePaymentsCall.bind(this);\n this.makeAdditionalDetailsCall = this.makeAdditionalDetailsCall.bind(this);\n this.submitUsingSessionsFlow = this.submitUsingSessionsFlow.bind(this);\n\n this.elementRef = (props && props.elementRef) || this;\n this.resources = this.props.modules ? this.props.modules.resources : undefined;\n\n this.storeElementRefOnCore(this.props);\n }\n\n protected override buildElementProps(componentProps?: P) {\n const globalCoreProps = this.core.getCorePropsForComponent();\n const isStoredPaymentMethod = !!componentProps?.isStoredPaymentMethod;\n const paymentMethodsResponseProps = isStoredPaymentMethod\n ? {}\n : this.core.paymentMethodsResponse.find(componentProps?.type || this.constructor['type']);\n\n const finalProps = {\n showPayButton: true,\n ...globalCoreProps,\n ...paymentMethodsResponseProps,\n ...componentProps\n };\n\n const isDropin = assertIsDropin(this as unknown as IDropin);\n\n this.props = this.formatProps({\n ...this.constructor['defaultProps'], // component defaults\n ...getRegulatoryDefaults(this.core.options.countryCode, isDropin), // regulatory defaults\n ...finalProps // the rest (inc. merchant defined config)\n });\n }\n\n protected storeElementRefOnCore(props?: P) {\n if (!props?.isDropin) {\n this.core.storeElementReference(this);\n }\n }\n\n public isAvailable(): Promise<void> {\n return Promise.resolve();\n }\n\n public setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n this.onChange();\n }\n\n public showValidation(): this {\n if (this.componentRef && this.componentRef.showValidation) this.componentRef.showValidation();\n return this;\n }\n\n public setElementStatus(status: UIElementStatus, props?: any): this {\n this.elementRef?.setStatus(status, props);\n return this;\n }\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n return this;\n }\n\n protected onChange(): object {\n const isValid = this.isValid;\n const state = { data: this.data, errors: this.state.errors, valid: this.state.valid, isValid };\n\n this.props.onChange?.(state, this.elementRef);\n\n return state;\n }\n\n // Only called once, for UIElements (including Dropin), as they are being mounted\n protected setUpAnalytics(setUpAnalyticsObj: AnalyticsInitialEvent) {\n const sessionId = this.props.session?.id;\n\n return this.props.modules.analytics.setUp({\n ...setUpAnalyticsObj,\n ...(sessionId && { sessionId })\n });\n }\n\n /**\n * A function for all UIElements, or BaseElement, to use to create an analytics action for when it's been:\n * - mounted,\n * - a PM has been selected\n * - onSubmit has been called (as a result of the pay button being pressed)\n *\n * In some other cases e.g. 3DS2 components, this function is overridden to allow more specific analytics actions to be created\n */\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj: SendAnalyticsObject, uiElementProps?) {\n /** Work out what the component's \"type\" is:\n * - first check for a dedicated \"analyticsType\" (currently only applies to custom-cards)\n * - otherwise, distinguish cards from non-cards: cards will use their static type property, everything else will use props.type\n */\n try {\n let component = this.constructor['analyticsType'];\n if (!component) {\n component = this.constructor['type'] === 'scheme' || this.constructor['type'] === 'bcmc' ? this.constructor['type'] : this.props.type;\n }\n\n this.props.modules.analytics.sendAnalytics(component, analyticsObj, uiElementProps);\n } catch (error) {\n console.warn('Failed to submit the analytics event. Error:', error);\n }\n }\n\n public submit(): void {\n if (!this.isValid) {\n this.showValidation();\n return;\n }\n\n this.makePaymentsCall().then(sanitizeResponse).then(verifyPaymentDidNotFail).then(this.handleResponse).catch(this.handleFailedResult);\n }\n\n protected makePaymentsCall(): Promise<CheckoutAdvancedFlowResponse | CheckoutSessionPaymentResponse> {\n this.setElementStatus('loading');\n\n if (this.props.onSubmit) {\n return this.submitUsingAdvancedFlow();\n }\n\n if (this.core.session) {\n const beforeSubmitEvent: Promise<PaymentData> = this.props.beforeSubmit\n ? new Promise((resolve, reject) =>\n this.props.beforeSubmit(this.data, this.elementRef, {\n resolve,\n reject\n })\n )\n : Promise.resolve(this.data);\n\n return beforeSubmitEvent.then(this.submitUsingSessionsFlow);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments call. Callback \"onSubmit\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitUsingAdvancedFlow(): Promise<CheckoutAdvancedFlowResponse> {\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n // Call analytics endpoint\n this.submitAnalytics({ type: ANALYTICS_SUBMIT_STR });\n\n this.props.onSubmit(\n {\n data: this.data,\n isValid: this.isValid\n },\n this.elementRef,\n { resolve, reject }\n );\n });\n }\n\n private async submitUsingSessionsFlow(data: PaymentData): Promise<CheckoutSessionPaymentResponse> {\n this.submitAnalytics({ type: ANALYTICS_SUBMIT_STR });\n\n try {\n return await this.core.session.submitPayment(data);\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) this.handleError(error);\n else this.handleError(new AdyenCheckoutError('ERROR', 'Error when making /payments call', { cause: error }));\n\n return Promise.reject(error);\n }\n\n // // Uncomment to simulate failed\n // return {\n // resultCode: 'Refused',\n // sessionData:\n // 'Ab02b4c0!BQABAgBKGgqfEz8uQlU4yCIOWjA8bkEwmbJ7Qt4r+x5IPXREu1rMjwNk5MDoHFNlv+MWvinS6nXIDniXgRzXCdSC4ksw9CNDBAjOa+B88wRoj/rLTieuWh/0leR88qkV24vtIkjsIsbJTDB78Pd8wX8MEDsXhaAdEIyX9E8eqxuQ3bwPbvLs1Dlgo1ZrfkQRzaNiuVM8ejRG0IWE1bGThJzY+sJvZZHvlDMXIlxhZcDoQvsMj/WwE6+nFJxBiC3oRzmvVn3AbkLQGtvwq16UUSfYbPzG9dXypJMtcrZAQYq2g/2+BSibCcmee9AXq/wij11BERrYmjbDt5NkkdUnDVgAB7pdqbnWX0A2sxBKeYtLSP2kxp+5LoU/Wty3fmcVA3VKVkHfgmIihkeL8lY++5hvHjnkzOE4tyx/sheiKS4zqoWE43TD6n8mpFskAzwMHq4G2o6vkXqvaKFEq7y/R2fVrCypenmRhkPASizpM265rKLU+L4E/C+LMHfN0LYKRMCrLr0gI2GAp+1PZLHgh0tCtiJC/zcJJtJs6sHNQxLUN+kxJuELUHOcuL3ivjG+mWteUnBENZu7KqOSZYetiWYRiyLOXDiBHqbxuQwTuO54L15VLkS/mYB20etibM1nn+fRmbo+1IJkCSalhwi5D7fSrpjbQTmAsOpJT1N8lC1MSNmAvAwG1kWL4JxYwXDKYyYASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdFQUVEODdDMjRERDUzOTA5QjgwQTc4QTkyM0UzODIzRDY4REFDQzk0QjlGRjgzMDVEQyJ98uZI4thGveOByYbomCeeP2Gy2rzs99FOBoDYVeWIUjyM+gfnW89DdJZAhxe74Tv0TnL5DRQYPCTRQPOoLbQ21NaeSho70FNE+n8XYKlVK5Ore6BoB6IVCaal5MkM27V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state): void {\n if (this.props.onComplete) this.props.onComplete(state, this.elementRef);\n }\n\n protected handleError = (error: AdyenCheckoutError): void => {\n /**\n * Set status using elementRef, which:\n * - If Drop-in, will set status for Dropin component, and then it will propagate the new status for the active payment method component\n * - If Component, it will set its own status\n */\n this.setElementStatus('ready');\n\n if (this.props.onError) {\n this.props.onError(error, this.elementRef);\n }\n };\n\n protected handleAdditionalDetails(state: AdditionalDetailsStateData): void {\n this.makeAdditionalDetailsCall(state)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n private makeAdditionalDetailsCall(state: AdditionalDetailsStateData): Promise<CheckoutSessionDetailsResponse | CheckoutAdvancedFlowResponse> {\n if (this.props.onAdditionalDetails) {\n return new Promise<CheckoutAdvancedFlowResponse>((resolve, reject) => {\n this.props.onAdditionalDetails(state, this.elementRef, { resolve, reject });\n });\n }\n\n if (this.core.session) {\n return this.submitAdditionalDetailsUsingSessionsFlow(state.data);\n }\n\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not perform /payments/details call. Callback \"onAdditionalDetails\" is missing or Checkout session is not available'\n )\n );\n }\n\n private async submitAdditionalDetailsUsingSessionsFlow(data: any): Promise<CheckoutSessionDetailsResponse> {\n try {\n return await this.core.session.submitDetails(data);\n } catch (error: unknown) {\n if (error instanceof AdyenCheckoutError) this.handleError(error);\n else this.handleError(new AdyenCheckoutError('ERROR', 'Error when making /details call', { cause: error }));\n\n return Promise.reject(error);\n }\n }\n\n public handleAction(action: PaymentAction, props = {}): UIElement<P> | null {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'handleAction::Invalid Action - the passed action object itself has an \"action\" property and ' +\n 'a \"resultCode\": have you passed in the whole response object by mistake?'\n );\n }\n throw new Error('handleAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n const paymentAction = this.core.createFromAction(action, {\n ...this.elementRef.props,\n ...props,\n onAdditionalDetails: this.handleAdditionalDetails\n });\n\n if (paymentAction) {\n this.unmount();\n return paymentAction.mount(this._node);\n }\n\n return null;\n }\n\n protected handleOrder = (response: PaymentResponseData): void => {\n const { order } = response;\n\n const updateCorePromise = this.core.session ? this.core.update({ order }) : this.handleAdvanceFlowPaymentMethodsUpdate(order);\n\n updateCorePromise.then(() => {\n this.props.onOrderUpdated?.({ order });\n });\n };\n\n /**\n * Handles when the payment fails. The payment fails when:\n * - adv flow: the merchant rejects the payment due to a critical error\n * - adv flow: the merchant resolves the payment with a failed resultCode\n * - sessions: a network error occurs when making the payment\n * - sessions: the payment fails with a failed resultCode\n *\n * @param result\n */\n protected handleFailedResult = (result?: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('error');\n }\n\n cleanupFinalResult(result);\n this.props.onPaymentFailed?.(result, this.elementRef);\n };\n\n protected handleSuccessResult = (result: PaymentResponseData): void => {\n if (assertIsDropin(this.elementRef)) {\n this.elementRef.displayFinalAnimation('success');\n }\n\n cleanupFinalResult(result);\n this.props.onPaymentCompleted?.(result, this.elementRef);\n };\n\n /**\n * Handles a session /payments or /payments/details response.\n * The component will handle automatically actions, orders, and final results.\n *\n * @param rawResponse -\n */\n protected handleResponse(rawResponse: RawPaymentResponse): void {\n const response = sanitizeResponse(rawResponse);\n\n if (response.action) {\n this.elementRef.handleAction(response.action);\n return;\n }\n\n if (response.order?.remainingAmount?.value > 0) {\n // we don't want to call elementRef here, use the component handler\n // we do this way so the logic on handlingOrder is associated with payment method\n this.handleOrder(response);\n return;\n }\n\n this.handleSuccessResult(response);\n }\n\n /**\n * Call update on parent instance\n * This function exist to make safe access to the protect _parentInstance\n * @param options - CoreOptions\n */\n public updateParent(options: CoreConfiguration = {}): Promise<ICore> {\n return this.elementRef.core.update(options);\n }\n\n public setComponentRef = (ref: ComponentMethodsRef) => {\n this.componentRef = ref;\n };\n\n /**\n * Get the current validation status of the element\n */\n public get isValid(): boolean {\n return false;\n }\n\n /**\n * Get the element icon URL for the current environment\n */\n\n public get icon(): string {\n const type = this.props.paymentMethodType || this.type;\n return this.props.icon ?? this.resources.getImage()(type);\n }\n\n /**\n * Get the element's displayable name\n */\n public get displayName(): string {\n const paymentMethodFromResponse = this.core.paymentMethodsResponse?.paymentMethods?.find(pm => pm.type === this.type);\n return this.props.name || paymentMethodFromResponse?.name || this.type;\n }\n\n /**\n * Get the element accessible name, used in the aria-label of the button that controls selected payment method\n */\n public get accessibleName(): string {\n return this.displayName;\n }\n\n /**\n * Used to display the second line of a payment method item\n */\n get additionalInfo(): string {\n return null;\n }\n\n /**\n * Return the type of an element\n */\n public get type(): string {\n return this.props.type || this.constructor['type'];\n }\n\n /**\n * Get the payButton component for the current element\n */\n protected payButton = (props: PayButtonFunctionProps) => {\n return <PayButton {...props} amount={this.props.amount} secondaryAmount={this.props.secondaryAmount} onClick={this.submit} />;\n };\n\n /**\n * Used in the Partial Orders flow.\n * When the Order is updated, the merchant can request new payment methods based on the new remaining amount\n *\n * @private\n */\n protected async handleAdvanceFlowPaymentMethodsUpdate(order: Order | null, amount?: PaymentAmount) {\n return new Promise<PaymentMethodsResponse>((resolve, reject) => {\n if (!this.props.onPaymentMethodsRequest) {\n return reject(new Error('onPaymentMethodsRequest is not implemented'));\n }\n\n this.props.onPaymentMethodsRequest(\n {\n ...(order && {\n order: {\n orderData: order.orderData,\n pspReference: order.pspReference\n }\n }),\n locale: this.core.options.locale\n },\n { resolve, reject }\n );\n })\n .catch(error => {\n this.handleError(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'Something failed during payment methods update or onPaymentMethodsRequest was not implemented',\n {\n cause: error\n }\n )\n );\n })\n .then(paymentMethodsResponse => {\n // in the case of the session flow we get order, amount, countryCode and shopperLocale from initialize()\n // apply the same logic here for order and amount\n // in the future it might be worth moving this logic to be performed by the core on update()\n // it would make this more consistent\n return this.core.update({\n ...(paymentMethodsResponse && { paymentMethodsResponse }),\n order,\n amount: order ? order.remainingAmount : amount\n });\n });\n }\n}\n\nexport default UIElement;\n"],"names":["UIElement","BaseElement","componentRef","resources","elementRef","static","undefined","constructor","checkout","props","super","this","core","register","submit","bind","setState","onComplete","handleAction","handleOrder","handleAdditionalDetails","handleResponse","setElementStatus","submitAnalytics","makePaymentsCall","makeAdditionalDetailsCall","submitUsingSessionsFlow","modules","storeElementRefOnCore","buildElementProps","componentProps","finalProps","showPayButton","getCorePropsForComponent","isStoredPaymentMethod","paymentMethodsResponse","find","type","isDropin","assertIsDropin","formatProps","getRegulatoryDefaults","options","countryCode","storeElementReference","isAvailable","Promise","resolve","newState","state","onChange","showValidation","status","setStatus","isValid","data","errors","valid","setUpAnalytics","setUpAnalyticsObj","sessionId","session","id","analytics","setUp","analyticsObj","uiElementProps","component","sendAnalytics","error","console","warn","then","sanitizeResponse","verifyPaymentDidNotFail","catch","handleFailedResult","onSubmit","submitUsingAdvancedFlow","beforeSubmit","reject","handleError","AdyenCheckoutError","ANALYTICS_SUBMIT_STR","submitPayment","cause","onError","onAdditionalDetails","submitAdditionalDetailsUsingSessionsFlow","submitDetails","action","hasOwnProperty","Error","paymentAction","createFromAction","unmount","mount","_node","response","order","update","handleAdvanceFlowPaymentMethodsUpdate","onOrderUpdated","result","displayFinalAnimation","cleanupFinalResult","onPaymentFailed","handleSuccessResult","onPaymentCompleted","rawResponse","remainingAmount","value","updateParent","setComponentRef","ref","icon","paymentMethodType","getImage","displayName","paymentMethodFromResponse","paymentMethods","pm","name","accessibleName","additionalInfo","payButton","h","PayButton","amount","secondaryAmount","onClick","onPaymentMethodsRequest","orderData","pspReference","locale"],"mappings":"wfA6BO,MAAeA,UAA6DC,EACrEC,aAEAC,UAEHC,WAEPC,iBAAqBC,EAKrBD,kBAAqC,GAErCE,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAGZE,KAAKJ,kBACLI,KAAKC,KAAKC,SAASF,KAAKJ,aAG5BI,KAAK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0H,wBACZ,OAAOnD,EAAO,IAAIY,MAAM,+CAG5BjF,KAAKF,MAAM0H,wBACP,IACQhC,GAAS,CACTA,MAAO,CACHiC,UAAWjC,EAAMiC,UACjBC,aAAclC,EAAMkC,eAG5BC,OAAQ3H,KAAKC,KAAK8B,QAAQ4F,QAE9B,CAAEvF,UAASiC,UAAO,IAGrBL,OAAMN,IACH1D,KAAKsE,YACD,IAAIC,EACA,uBACA,gGACA,CACIG,MAAOhB,IACX,IAIXG,MAAKrC,GAKKxB,KAAKC,KAAKwF,OAAO,IAChBjE,GAA0B,CAAEA,0BAChCgE,QACA6B,OAAQ7B,EAAQA,EAAMW,gBAAkBkB,KAGxD"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../external/preact/dist/preact.js";import a from"../../../external/classnames/index.js";import c from"../Button/Button.js";import{copyToClipboard as r}from"../../../utils/clipboard.js";import{useCoreContext as t}from"../../../core/Context/CoreProvider.js";import o from"../../../core/Context/useImage.js";function s({voucherDetails:s=[],className:_="",...l}){const{i18n:n}=t(),u=o();return e("div",{className:a("adyen-checkout__voucher-result",`adyen-checkout__voucher-result--${l.paymentMethodType}`,_)},e("div",{className:"adyen-checkout__voucher-result__top"},e("div",{className:"adyen-checkout__voucher-result__image"},!!l.imageUrl&&e("span",{className:"adyen-checkout__voucher-result__image__wrapper"},e("img",{alt:l.paymentMethodType,className:"adyen-checkout__voucher-result__image__brand",src:l.imageUrl})),!!l.issuerImageUrl&&e("span",{className:"adyen-checkout__voucher-result__image__wrapper"},e("img",{alt:l.paymentMethodType,className:"adyen-checkout__voucher-result__image__issuer",src:l.issuerImageUrl}))),e("div",{className:"adyen-checkout__voucher-result__introduction"},l.introduction," ",l.instructionsUrl&&e("a",{className:"adyen-checkout-link adyen-checkout-link--voucher-result-instructions",href:l.instructionsUrl,target:"_blank",rel:"noopener noreferrer"},n.get("voucher.readInstructions")," ›")),l.amount&&e("div",{className:"adyen-checkout__voucher-result__amount"},l.amount,l.surcharge&&e("span",{className:"adyen-checkout__voucher-result__surcharge"},"(",n.get("voucher.surcharge").replace("%@",l.surcharge),")"))),l.reference&&e("div",{className:"adyen-checkout__voucher-result__separator"},e("div",{className:"adyen-checkout__voucher-result__separator__inner"}),e("div",{className:"adyen-checkout__voucher-result__code__label"},e("span",{className:"adyen-checkout__voucher-result__code__label__text"},n.get("voucher.paymentReferenceLabel")))),e("div",{className:"adyen-checkout__voucher-result__bottom"},l.reference&&e("div",{className:"adyen-checkout__voucher-result__code"},l.barcode&&e("img",{alt:n.get("voucher.paymentReferenceLabel"),className:"adyen-checkout__voucher-result__code__barcode",src:l.barcode}),e("span",null,l.reference)),(!!l.downloadUrl||!!l.copyBtn)&&e("ul",{className:"adyen-checkout__voucher-result__actions"},!!l.copyBtn&&e("li",{className:"adyen-checkout__voucher-result__actions__item"},e(c,{inline:!0,variant:"action",onClick:(e,{complete:a})=>{r(l.reference),a()},icon:u({imageFolder:"components/"})("copy_white"),label:n.get("button.copy")})),!!l.downloadUrl&&e("li",{className:"adyen-checkout__voucher-result__actions__item"},e(c,{inline:!0,variant:"action",href:l.downloadUrl,icon:u({imageFolder:"components/"})("download_white"),label:l.downloadButtonText||n.get("button.download"),target:"_blank",rel:"noopener noreferrer"}))),e("ul",{className:"adyen-checkout__voucher-result__details"},s.filter((({label:e,value:a})=>!!e&&!!a)).map((({label:a,value:c},r)=>e("li",{key:r,className:"adyen-checkout__voucher-result__details__item"},e("span",{className:"adyen-checkout__voucher-result__details__label"},a),e("span",{className:"adyen-checkout__voucher-result__details__value"},c)))))))}export{s as default};
1
+ import{createElement as e}from"../../../external/preact/dist/preact.js";import a from"../../../external/classnames/index.js";import c from"../Button/Button.js";import{copyToClipboard as r}from"../../../utils/clipboard.js";import{useCoreContext as t}from"../../../core/Context/CoreProvider.js";import o from"../../../core/Context/useImage.js";import{PREFIX as s}from"../Icon/constants.js";function _({voucherDetails:_=[],className:l="",...n}){const{i18n:u}=t(),i=o();return e("div",{className:a("adyen-checkout__voucher-result",`adyen-checkout__voucher-result--${n.paymentMethodType}`,l)},e("div",{className:"adyen-checkout__voucher-result__top"},e("div",{className:"adyen-checkout__voucher-result__image"},!!n.imageUrl&&e("span",{className:"adyen-checkout__voucher-result__image__wrapper"},e("img",{alt:n.paymentMethodType,className:"adyen-checkout__voucher-result__image__brand",src:n.imageUrl})),!!n.issuerImageUrl&&e("span",{className:"adyen-checkout__voucher-result__image__wrapper"},e("img",{alt:n.paymentMethodType,className:"adyen-checkout__voucher-result__image__issuer",src:n.issuerImageUrl}))),e("div",{className:"adyen-checkout__voucher-result__introduction"},n.introduction," ",n.instructionsUrl&&e("a",{className:"adyen-checkout-link adyen-checkout-link--voucher-result-instructions",href:n.instructionsUrl,target:"_blank",rel:"noopener noreferrer"},u.get("voucher.readInstructions")," ›")),n.amount&&e("div",{className:"adyen-checkout__voucher-result__amount"},n.amount,n.surcharge&&e("span",{className:"adyen-checkout__voucher-result__surcharge"},"(",u.get("voucher.surcharge").replace("%@",n.surcharge),")"))),n.reference&&e("div",{className:"adyen-checkout__voucher-result__separator"},e("div",{className:"adyen-checkout__voucher-result__separator__inner"}),e("div",{className:"adyen-checkout__voucher-result__code__label"},e("span",{className:"adyen-checkout__voucher-result__code__label__text"},u.get("voucher.paymentReferenceLabel")))),e("div",{className:"adyen-checkout__voucher-result__bottom"},n.reference&&e("div",{className:"adyen-checkout__voucher-result__code"},n.barcode&&e("img",{alt:u.get("voucher.paymentReferenceLabel"),className:"adyen-checkout__voucher-result__code__barcode",src:n.barcode}),e("span",null,n.reference)),(!!n.downloadUrl||!!n.copyBtn)&&e("ul",{className:"adyen-checkout__voucher-result__actions"},!!n.copyBtn&&e("li",{className:"adyen-checkout__voucher-result__actions__item"},e(c,{inline:!0,variant:"action",onClick:(e,{complete:a})=>{r(n.reference),a()},icon:i({imageFolder:"components/"})(`${s}copy`),label:u.get("button.copy")})),!!n.downloadUrl&&e("li",{className:"adyen-checkout__voucher-result__actions__item"},e(c,{inline:!0,variant:"action",href:n.downloadUrl,icon:i({imageFolder:"components/"})(`${s}download`),label:n.downloadButtonText||u.get("button.download"),target:"_blank",rel:"noopener noreferrer"}))),e("ul",{className:"adyen-checkout__voucher-result__details"},_.filter((({label:e,value:a})=>!!e&&!!a)).map((({label:a,value:c},r)=>e("li",{key:r,className:"adyen-checkout__voucher-result__details__item"},e("span",{className:"adyen-checkout__voucher-result__details__label"},a),e("span",{className:"adyen-checkout__voucher-result__details__value"},c)))))))}export{_ as default};
2
2
  //# sourceMappingURL=Voucher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Voucher.js","sources":["../../../../../src/components/internal/Voucher/Voucher.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Button from '../Button';\nimport { copyToClipboard } from '../../../utils/clipboard';\n\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport './Voucher.scss';\nimport { VoucherProps } from './types';\nimport useImage from '../../../core/Context/useImage';\n\nexport default function Voucher({ voucherDetails = [], className = '', ...props }: VoucherProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n return (\n <div className={classNames('adyen-checkout__voucher-result', `adyen-checkout__voucher-result--${props.paymentMethodType}`, className)}>\n <div className=\"adyen-checkout__voucher-result__top\">\n <div className=\"adyen-checkout__voucher-result__image\">\n {!!props.imageUrl && (\n <span className=\"adyen-checkout__voucher-result__image__wrapper\">\n <img alt={props.paymentMethodType} className=\"adyen-checkout__voucher-result__image__brand\" src={props.imageUrl} />\n </span>\n )}\n\n {!!props.issuerImageUrl && (\n <span className=\"adyen-checkout__voucher-result__image__wrapper\">\n <img alt={props.paymentMethodType} className=\"adyen-checkout__voucher-result__image__issuer\" src={props.issuerImageUrl} />\n </span>\n )}\n </div>\n\n <div className=\"adyen-checkout__voucher-result__introduction\">\n {props.introduction}{' '}\n {props.instructionsUrl && (\n <a\n className=\"adyen-checkout-link adyen-checkout-link--voucher-result-instructions\"\n href={props.instructionsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {i18n.get('voucher.readInstructions')} ›\n </a>\n )}\n </div>\n\n {props.amount && (\n <div className=\"adyen-checkout__voucher-result__amount\">\n {props.amount}\n\n {props.surcharge && (\n <span className=\"adyen-checkout__voucher-result__surcharge\">\n ({i18n.get('voucher.surcharge').replace('%@', props.surcharge)})\n </span>\n )}\n </div>\n )}\n </div>\n\n {props.reference && (\n <div className=\"adyen-checkout__voucher-result__separator\">\n <div className=\"adyen-checkout__voucher-result__separator__inner\" />\n <div className=\"adyen-checkout__voucher-result__code__label\">\n <span className=\"adyen-checkout__voucher-result__code__label__text\">{i18n.get('voucher.paymentReferenceLabel')}</span>\n </div>\n </div>\n )}\n\n <div className=\"adyen-checkout__voucher-result__bottom\">\n {props.reference && (\n <div className=\"adyen-checkout__voucher-result__code\">\n {props.barcode && (\n <img\n alt={i18n.get('voucher.paymentReferenceLabel')}\n className=\"adyen-checkout__voucher-result__code__barcode\"\n src={props.barcode}\n />\n )}\n <span>{props.reference}</span>\n </div>\n )}\n\n {(!!props.downloadUrl || !!props.copyBtn) && (\n <ul className=\"adyen-checkout__voucher-result__actions\">\n {!!props.copyBtn && (\n <li className=\"adyen-checkout__voucher-result__actions__item\">\n <Button\n inline\n variant=\"action\"\n onClick={(e, { complete }) => {\n copyToClipboard(props.reference);\n complete();\n }}\n icon={getImage({ imageFolder: 'components/' })('copy_white')}\n label={i18n.get('button.copy')}\n />\n </li>\n )}\n\n {!!props.downloadUrl && (\n <li className=\"adyen-checkout__voucher-result__actions__item\">\n <Button\n inline\n variant=\"action\"\n href={props.downloadUrl}\n icon={getImage({ imageFolder: 'components/' })('download_white')}\n label={props.downloadButtonText || i18n.get('button.download')}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n </li>\n )}\n </ul>\n )}\n\n <ul className=\"adyen-checkout__voucher-result__details\">\n {voucherDetails\n .filter(({ label, value }) => !!label && !!value)\n .map(({ label, value }, index) => (\n <li key={index} className=\"adyen-checkout__voucher-result__details__item\">\n <span className=\"adyen-checkout__voucher-result__details__label\">{label}</span>\n <span className=\"adyen-checkout__voucher-result__details__value\">{value}</span>\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n"],"names":["Voucher","voucherDetails","className","props","i18n","useCoreContext","getImage","useImage","h","div","classNames","paymentMethodType","imageUrl","span","img","alt","src","issuerImageUrl","introduction","instructionsUrl","a","href","target","rel","get","amount","surcharge","replace","reference","barcode","downloadUrl","copyBtn","ul","li","Button","inline","variant","onClick","e","complete","copyToClipboard","icon","imageFolder","label","downloadButtonText","filter","value","map","index","key"],"mappings":"sVAUe,SAASA,GAAQC,eAAEA,EAAiB,GAAEC,UAAEA,EAAY,MAAOC,IACtE,MAAMC,KAAEA,GAASC,IACXC,EAAWC,IAEjB,OACIC,EAACC,MAAAA,CAAIP,UAAWQ,EAAW,iCAAkC,mCAAmCP,EAAMQ,oBAAqBT,IACvHM,EAACC,MAAAA,CAAIP,UAAU,uCACXM,EAACC,MAAAA,CAAIP,UAAU,2CACRC,EAAMS,UACLJ,EAACK,OAAAA,CAAKX,UAAU,kDACZM,EAACM,MAAAA,CAAIC,IAAKZ,EAAMQ,kBAAmBT,UAAU,+CAA+Cc,IAAKb,EAAMS,cAI5GT,EAAMc,gBACLT,EAACK,OAAAA,CAAKX,UAAU,kDACZM,EAACM,MAAAA,CAAIC,IAAKZ,EAAMQ,kBAAmBT,UAAU,gDAAgDc,IAAKb,EAAMc,mBAKpHT,EAACC,MAAAA,CAAIP,UAAU,gDACVC,EAAMe,aAAc,IACpBf,EAAMgB,iBACHX,EAACY,IAAAA,CACGlB,UAAU,uEACVmB,KAAMlB,EAAMgB,gBACZG,OAAO,SACPC,IAAI,uBAEHnB,EAAKoB,IAAI,4BAA4B,OAKjDrB,EAAMsB,QACHjB,EAACC,MAAAA,CAAIP,UAAU,0CACVC,EAAMsB,OAENtB,EAAMuB,WACHlB,EAACK,OAAAA,CAAKX,UAAU,6CAA4C,IACtDE,EAAKoB,IAAI,qBAAqBG,QAAQ,KAAMxB,E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AAAA,CAAKX,UAAU,kDAAkD4C,QAOlG"}
1
+ {"version":3,"file":"Voucher.js","sources":["../../../../../src/components/internal/Voucher/Voucher.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Button from '../Button';\nimport { copyToClipboard } from '../../../utils/clipboard';\n\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport './Voucher.scss';\nimport { VoucherProps } from './types';\nimport useImage from '../../../core/Context/useImage';\nimport { PREFIX } from '../Icon/constants';\n\nexport default function Voucher({ voucherDetails = [], className = '', ...props }: VoucherProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n return (\n <div className={classNames('adyen-checkout__voucher-result', `adyen-checkout__voucher-result--${props.paymentMethodType}`, className)}>\n <div className=\"adyen-checkout__voucher-result__top\">\n <div className=\"adyen-checkout__voucher-result__image\">\n {!!props.imageUrl && (\n <span className=\"adyen-checkout__voucher-result__image__wrapper\">\n <img alt={props.paymentMethodType} className=\"adyen-checkout__voucher-result__image__brand\" src={props.imageUrl} />\n </span>\n )}\n\n {!!props.issuerImageUrl && (\n <span className=\"adyen-checkout__voucher-result__image__wrapper\">\n <img alt={props.paymentMethodType} className=\"adyen-checkout__voucher-result__image__issuer\" src={props.issuerImageUrl} />\n </span>\n )}\n </div>\n\n <div className=\"adyen-checkout__voucher-result__introduction\">\n {props.introduction}{' '}\n {props.instructionsUrl && (\n <a\n className=\"adyen-checkout-link adyen-checkout-link--voucher-result-instructions\"\n href={props.instructionsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {i18n.get('voucher.readInstructions')} ›\n </a>\n )}\n </div>\n\n {props.amount && (\n <div className=\"adyen-checkout__voucher-result__amount\">\n {props.amount}\n\n {props.surcharge && (\n <span className=\"adyen-checkout__voucher-result__surcharge\">\n ({i18n.get('voucher.surcharge').replace('%@', props.surcharge)})\n </span>\n )}\n </div>\n )}\n </div>\n\n {props.reference && (\n <div className=\"adyen-checkout__voucher-result__separator\">\n <div className=\"adyen-checkout__voucher-result__separator__inner\" />\n <div className=\"adyen-checkout__voucher-result__code__label\">\n <span className=\"adyen-checkout__voucher-result__code__label__text\">{i18n.get('voucher.paymentReferenceLabel')}</span>\n </div>\n </div>\n )}\n\n <div className=\"adyen-checkout__voucher-result__bottom\">\n {props.reference && (\n <div className=\"adyen-checkout__voucher-result__code\">\n {props.barcode && (\n <img\n alt={i18n.get('voucher.paymentReferenceLabel')}\n className=\"adyen-checkout__voucher-result__code__barcode\"\n src={props.barcode}\n />\n )}\n <span>{props.reference}</span>\n </div>\n )}\n\n {(!!props.downloadUrl || !!props.copyBtn) && (\n <ul className=\"adyen-checkout__voucher-result__actions\">\n {!!props.copyBtn && (\n <li className=\"adyen-checkout__voucher-result__actions__item\">\n <Button\n inline\n variant=\"action\"\n onClick={(e, { complete }) => {\n copyToClipboard(props.reference);\n complete();\n }}\n icon={getImage({ imageFolder: 'components/' })(`${PREFIX}copy`)}\n label={i18n.get('button.copy')}\n />\n </li>\n )}\n\n {!!props.downloadUrl && (\n <li className=\"adyen-checkout__voucher-result__actions__item\">\n <Button\n inline\n variant=\"action\"\n href={props.downloadUrl}\n icon={getImage({ imageFolder: 'components/' })(`${PREFIX}download`)}\n label={props.downloadButtonText || i18n.get('button.download')}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n </li>\n )}\n </ul>\n )}\n\n <ul className=\"adyen-checkout__voucher-result__details\">\n {voucherDetails\n .filter(({ label, value }) => !!label && !!value)\n .map(({ label, value }, index) => (\n <li key={index} className=\"adyen-checkout__voucher-result__details__item\">\n <span className=\"adyen-checkout__voucher-result__details__label\">{label}</span>\n <span className=\"adyen-checkout__voucher-result__details__value\">{value}</span>\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n"],"names":["Voucher","voucherDetails","className","props","i18n","useCoreContext","getImage","useImage","h","div","classNames","paymentMethodType","imageUrl","span","img","alt","src","issuerImageUrl","introduction","instructionsUrl","a","href","target","rel","get","amount","surcharge","replace","reference","barcode","downloadUrl","copyBtn","ul","li","Button","inline","variant","onClick","e","complete","copyToClipboard","icon","imageFolder","PREFIX","label","downloadButtonText","filter","value","map","index","key"],"mappings":"oYAWe,SAASA,GAAQC,eAAEA,EAAiB,GAAEC,UAAEA,EAAY,MAAOC,IACtE,MAAMC,KAAEA,GAASC,IACXC,EAAWC,IAEjB,OACIC,EAACC,MAAAA,CAAIP,UAAWQ,EAAW,iCAAkC,mCAAmCP,EAAMQ,oBAAqBT,IACvHM,EAACC,MAAAA,CAAIP,UAAU,uCACXM,EAACC,MAAAA,CAAIP,UAAU,2CACRC,EAAMS,UACLJ,EAACK,OAAAA,CAAKX,UAAU,kDACZM,EAACM,MAAAA,CAAIC,IAAKZ,EAAMQ,kBAAmBT,UAAU,+CAA+Cc,IAAKb,EAAMS,cAI5GT,EAAMc,gBACLT,EAACK,OAAAA,CAAKX,UAAU,kDACZM,EAACM,MAAAA,CAAIC,IAAKZ,EAAMQ,kBAAmBT,UAAU,gDAAgDc,IAAKb,EAAMc,mBAKpHT,EAACC,MAAAA,CAAIP,UAAU,gDACVC,EAAMe,aAAc,IACpBf,EAAMgB,iBACHX,EAACY,IAAAA,CACGlB,UAAU,uEACVmB,KAAMlB,EAAMgB,gBACZG,OAAO,SACPC,IAAI,uBAEHnB,EAAKoB,IAAI,4BAA4B,OAKjDrB,EAAMsB,QACHjB,EAACC,MAAAA,CAAIP,UAAU,0CACVC,EAAMsB,OAENtB,EAAMuB,WACHlB,EAACK,OAAAA,CAAKX,UAAU,6CAA4C,IACtDE,EAAKoB,IAAI,qBAAqBG,QAAQ,KAAMxB,EAAMuB,WAAW,OAOlFvB,EAAMyB,WACHpB,EAACC,MAAAA,CAAIP,UAAU,6CACXM,EAACC,MAAAA,CAAIP,UAAU,qDACfM,EAACC,MAAAA,CAAIP,UAAU,+CACXM,EAACK,OAAAA,CAAKX,UAAU,qDAAqDE,EAAKoB,IAAI,oCAK1FhB,EAACC,MAAAA,CAAIP,UAAU,0CACVC,EAAMyB,WACHpB,EAACC,MAAAA,CAAIP,UAAU,wCACVC,EAAM0B,SACHrB,EAACM,MAAAA,CACGC,IAAKX,EAAKoB,IAAI,iCACdtB,UAAU,gDACVc,IAAKb,EAAM0B,UAGnBrB,EAACK,YAAMV,EAAMyB,eAIjBzB,EAAM2B,eAAiB3B,EAAM4B,UAC7BvB,EAACwB,KAAAA,CAAG9B,UAAU,6CACPC,EAAM4B,SACLvB,EAACyB,KAAAA,CAAG/B,UAAU,iDACVM,EAAC0B,EAAAA,CACGC,QAAAA,EACAC,QAAQ,SACRC,QAAS,CAACC,GAAKC,eACXC,EAAgBrC,EAAMyB,WACtBW,GAAAA,EAEJE,KAAMnC,EAAS,CAAEoC,YAAa,eAAxBpC,CAAyC,GAAGqC,SAClDC,MAAOxC,EAAKoB,IAAI,oBAKzBrB,EAAM2B,aACLtB,EAACyB,KAAAA,CAAG/B,UAAU,iDACVM,EAAC0B,EAAAA,CACGC,QAAAA,EACAC,QAAQ,SACRf,KAAMlB,EAAM2B,YACZW,KAAMnC,EAAS,CAAEoC,YAAa,eAAxBpC,CAAyC,GAAGqC,aAClDC,MAAOzC,EAAM0C,oBAAsBzC,EAAKoB,IAAI,mBAC5CF,OAAO,SACPC,IAAI,0BAOxBf,EAACwB,KAAAA,CAAG9B,UAAU,2CACTD,EACI6C,QAAO,EAAGF,QAAOG,aAAcH,KAAWG,IAC1CC,KAAI,EAAGJ,QAAOG,SAASE,IACpBzC,EAACyB,KAAAA,CAAGiB,IAAKD,EAAO/C,UAAU,iDACtBM,EAACK,OAAAA,CAAKX,UAAU,kDAAkD0C,GAClEpC,EAACK,OAAAA,CAAKX,UAAU,kDAAkD6C,QAOlG"}
@@ -1,2 +1,2 @@
1
- import t from"../Services/analytics/log-event.js";import e from"../Services/analytics/collect-id.js";import n from"./EventsQueue.js";import{ANALYTICS_EVENT_INFO as a,ANALYTICS_INFO_TIMER_INTERVAL as l,ANALYTICS_EVENT_LOG as o,ANALYTICS_EVENT_ERROR as c,ANALYTICS_PATH as s}from"./constants.js";import{debounce as i}from"../../utils/debounce.js";import{processAnalyticsData as r,createAnalyticsObject as m}from"./utils.js";import{analyticsPreProcessor as u}from"./analyticsPreProcessor.js";let y=null,d=!1,p=null;const f=({loadingContext:f,locale:h,clientKey:b,analytics:v,amount:g,analyticsContext:j,bundleType:A})=>{const k={enabled:!0,telemetry:!0,checkoutAttemptId:null,analyticsData:{},...v},{telemetry:x,enabled:C}=k;!0===x&&!0===C&&k.checkoutAttemptId&&(y=k.checkoutAttemptId);const E=t({loadingContext:f,locale:h}),I=e({analyticsContext:j,clientKey:b,locale:h,amount:g,analyticsPath:s,bundleType:A}),P=n({analyticsContext:j,clientKey:b,analyticsPath:s}),T=()=>y?P.run(y):Promise.resolve(null),K={setUp:async t=>{const{enabled:e,payload:n,telemetry:a}=k,l=r(k.analyticsData);if(!0===e){if(!0===a&&!y)try{const e=await I({...t,...n&&{...n},...Object.keys(l).length&&{...l}});y=e}catch(t){console.warn("Fetching checkoutAttemptId failed."+(t?` Error=${t}`:""))}d||(E(t),d=!0)}},getCheckoutAttemptId:()=>y,getEventsQueue:()=>P,createAnalyticsEvent:({event:t,data:e})=>{const n=m({event:t,...e});return((t,e)=>{const n=t===a?t:`${t}s`;P.add(`${n}`,e),t===a&&(clearTimeout(p),p=setTimeout(T,l)),t!==o&&t!==c||(clearTimeout(p),i(T)())})(t,n),n},getEnabled:()=>k.enabled,sendAnalytics:null};return K.sendAnalytics=u(K),K};export{f as default};
1
+ import t from"../Services/analytics/log-event.js";import e from"../Services/analytics/collect-id.js";import n from"./EventsQueue.js";import{ANALYTICS_EVENT_INFO as a,ANALYTICS_INFO_TIMER_INTERVAL as l,ANALYTICS_EVENT_LOG as o,ANALYTICS_EVENT_ERROR as s,ANALYTICS_PATH as c}from"./constants.js";import{debounce as i}from"../../utils/debounce.js";import{processAnalyticsData as r,createAnalyticsObject as u}from"./utils.js";import{analyticsPreProcessor as m}from"./analyticsPreProcessor.js";let y=null,d=!1,p=null;const f=({loadingContext:f,locale:v,clientKey:b,analytics:g,amount:h,analyticsContext:j,bundleType:x})=>{const A={enabled:!0,telemetry:!0,checkoutAttemptId:null,analyticsData:{},...g},C=t({loadingContext:f,locale:v}),E=e({analyticsContext:j,clientKey:b,locale:v,amount:h,analyticsPath:c,bundleType:x}),P=n({analyticsContext:j,clientKey:b,analyticsPath:c}),T=()=>y?P.run(y):Promise.resolve(null),k={setUp:async t=>{const{enabled:e,payload:n,telemetry:a}=A,l=r(A.analyticsData);if(!0===e){if(!0===a&&!y)try{const e=await E({...t,...n&&{...n},...Object.keys(l).length&&{...l}});y=e}catch(t){console.warn("Fetching checkoutAttemptId failed."+(t?` Error=${t}`:""))}d||(C(t),d=!0)}},getCheckoutAttemptId:()=>y,getEventsQueue:()=>P,createAnalyticsEvent:({event:t,data:e})=>{const n=u({event:t,...e});return((t,e)=>{const n=t===a?t:`${t}s`;P.add(`${n}`,e),t===a&&(clearTimeout(p),p=setTimeout(T,l)),t!==o&&t!==s||(clearTimeout(p),i(T)())})(t,n),n},getEnabled:()=>A.enabled,sendAnalytics:null};return k.sendAnalytics=m(k),k};export{f as default};
2
2
  //# sourceMappingURL=Analytics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Analytics.js","sources":["../../../../src/core/Analytics/Analytics.ts"],"sourcesContent":["import LogEvent from '../Services/analytics/log-event';\nimport CollectId from '../Services/analytics/collect-id';\nimport EventsQueue, { EventsQueueModule } from './EventsQueue';\nimport { ANALYTICS_EVENT, AnalyticsInitialEvent, AnalyticsObject, AnalyticsProps, CreateAnalyticsEventObject } from './types';\nimport { ANALYTICS_EVENT_ERROR, ANALYTICS_EVENT_INFO, ANALYTICS_EVENT_LOG, ANALYTICS_INFO_TIMER_INTERVAL, ANALYTICS_PATH } from './constants';\nimport { debounce } from '../../utils/debounce';\nimport { AnalyticsModule } from '../../types/global-types';\nimport { createAnalyticsObject, processAnalyticsData } from './utils';\nimport { analyticsPreProcessor } from './analyticsPreProcessor';\n\nlet capturedCheckoutAttemptId = null;\nlet hasLoggedPixel = false;\nlet sendEventsTimerId = null;\n\nconst Analytics = ({ loadingContext, locale, clientKey, analytics, amount, analyticsContext, bundleType }: AnalyticsProps): AnalyticsModule => {\n const defaultProps = {\n enabled: true,\n telemetry: true,\n checkoutAttemptId: null,\n analyticsData: {}\n };\n\n const props = { ...defaultProps, ...analytics };\n\n const { telemetry, enabled } = props;\n if (telemetry === true && enabled === true) {\n if (props.checkoutAttemptId) {\n // handle prefilled checkoutAttemptId // TODO is this still something that ever happens?\n capturedCheckoutAttemptId = props.checkoutAttemptId;\n }\n }\n\n const logEvent = LogEvent({ loadingContext, locale });\n const collectId = CollectId({ analyticsContext, clientKey, locale, amount, analyticsPath: ANALYTICS_PATH, bundleType });\n const eventsQueue: EventsQueueModule = EventsQueue({ analyticsContext, clientKey, analyticsPath: ANALYTICS_PATH });\n\n const sendAnalyticsEvents = () => {\n if (capturedCheckoutAttemptId) {\n return eventsQueue.run(capturedCheckoutAttemptId);\n }\n return Promise.resolve(null);\n };\n\n const addAnalyticsEvent = (type: ANALYTICS_EVENT, obj: AnalyticsObject) => {\n const arrayName = type === ANALYTICS_EVENT_INFO ? type : `${type}s`;\n eventsQueue.add(`${arrayName}`, obj);\n\n /**\n * The logic is:\n * - info events are stored until a log or error comes along,\n * but, if after a set time, no other analytics event (log or error) has come along then we send the info events anyway\n */\n if (type === ANALYTICS_EVENT_INFO) {\n clearTimeout(sendEventsTimerId);\n sendEventsTimerId = setTimeout(sendAnalyticsEvents, ANALYTICS_INFO_TIMER_INTERVAL);\n }\n\n /**\n * The logic is:\n * - errors and logs get sent straightaway\n * ...but... tests with the 3DS2 process show that many logs can happen almost at the same time (or you can have an error followed immediately by a log),\n * so instead of making several sequential api calls we see if we can \"batch\" them using debounce\n */\n if (type === ANALYTICS_EVENT_LOG || type === ANALYTICS_EVENT_ERROR) {\n clearTimeout(sendEventsTimerId); // clear any timer that might be about to dispatch the info events array\n\n debounce(sendAnalyticsEvents)();\n }\n };\n\n const anlModule: AnalyticsModule = {\n setUp: async (initialEvent: AnalyticsInitialEvent) => {\n const { enabled, payload, telemetry } = props; // TODO what is payload, is it ever used?\n\n const analyticsData = processAnalyticsData(props.analyticsData);\n\n if (enabled === true) {\n if (telemetry === true && !capturedCheckoutAttemptId) {\n try {\n // fetch a new checkoutAttemptId if none is already available\n const checkoutAttemptId = await collectId({\n ...initialEvent,\n ...(payload && { ...payload }),\n ...(Object.keys(analyticsData).length && { ...analyticsData })\n });\n capturedCheckoutAttemptId = checkoutAttemptId;\n } catch (e) {\n console.warn(`Fetching checkoutAttemptId failed.${e ? ` Error=${e}` : ''}`);\n }\n }\n\n if (!hasLoggedPixel) {\n // Log pixel\n // TODO once we stop using the pixel we can stop requiring both \"enabled\" & \"telemetry\" config options.\n // And v6 will have a \"level: 'none\" | \"all\" | \"minimal\" config prop\n logEvent(initialEvent);\n hasLoggedPixel = true;\n }\n }\n },\n\n getCheckoutAttemptId: (): string => capturedCheckoutAttemptId,\n\n // Expose getter for testing purposes\n getEventsQueue: () => eventsQueue,\n\n createAnalyticsEvent: ({ event, data }: CreateAnalyticsEventObject): AnalyticsObject => {\n const aObj: AnalyticsObject = createAnalyticsObject({\n event,\n ...data\n });\n // console.log('### Analytics::createAnalyticsEvent:: event=', event, ' aObj=', aObj);\n\n addAnalyticsEvent(event, aObj);\n\n return aObj;\n },\n\n getEnabled: () => props.enabled,\n\n sendAnalytics: null\n };\n\n anlModule.sendAnalytics = analyticsPreProcessor(anlModule);\n\n return anlModule;\n};\n\nexport default Analytics;\n"],"names":["capturedCheckoutAttemptId","hasLoggedPixel","sendEventsTimerId","Analytics","loadingContext","locale","clientKey","analytics","amount","analyticsContext","bundleType","props","enabled","telemetry","checkoutAttemptId","analyticsData","logEvent","LogEvent","collectId","CollectId","analyticsPath","ANALYTICS_PATH","eventsQueue","EventsQueue","sendAnalyticsEvents","run","Promise","resolve","anlModule","setUp","async","initialEvent","payload","processAnalyticsData","Object","keys","length","e","console","warn","getCheckoutAttemptId","getEventsQueue","createAnalyticsEvent","event","data","aObj","createAnalyticsObject","type","obj","arrayName","ANALYTICS_EVENT_INFO","add","clearTimeout","setTimeout","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_EVENT_LOG","ANALYTICS_EVENT_ERROR","debounce","addAnalyticsEvent","getEnabled","sendAnalytics","analyticsPreProcessor"],"mappings":"yeAUA,IAAIA,EAA4B,KAC5BC,GAAiB,EACjBC,EAAoB,KAExB,MAAMC,EAAY,EAAGC,iBAAgBC,SAAQC,YAAWC,YAAWC,SAAQC,mBAAkBC,iBACzF,MAOMC,EAAQ,CANVC,SAAS,EACTC,WAAW,EACXC,kBAAmB,KACnBC,cAAe,CAAC,KAGgBR,IAE9BM,UAAEA,EAASD,QAAEA,GAAYD,GACb,IAAdE,IAAkC,IAAZD,GAClBD,EAAMG,oBAENd,EAA4BW,EAAMG,mBAI1C,MAAME,EAAWC,EAAS,CAAEb,iBAAgBC,WACtCa,EAAYC,EAAU,CAAEV,mBAAkBH,YAAWD,SAAQG,SAAQY,cAAeC,EAAgBX,eACpGY,EAAiCC,EAAY,CAAEd,mBAAkBH,YAAWc,cAAeC,IAE3FG,EAAsB,IACpBxB,EACOsB,EAAYG,IAAIzB,GAEpB0B,QAAQC,QAAQ,MA8BrBC,EAA6B,CAC/BC,MAAOC,MAAOC,IACV,MAAMnB,QAAEA,EAAOoB,QAAEA,EAAOnB,UAAEA,GAAcF,EAElCI,EAAgBkB,EAAqBtB,EAAMI,eAEjD,IAAgB,IAAZH,EAAkB,CAClB,IAAkB,IAAdC,IAAuBb,EACvB,IAEI,MAAMc,QAA0BI,EAAU,IACnCa,KACCC,GAAW,IAAKA,MAChBE,OAAOC,KAAKpB,GAAeqB,QAAU,IAAKrB,KAElDf,EAA4Bc,CAChC,CAAE,MAAOuB,GACLC,QAAQC,KAAK,sCAAqCF,EAAI,UAAUA,IAAM,IAC1E,CAGCpC,IAIDe,EAASe,GACT9B,GAAiB,EAEzB,GAGJuC,qBAAsB,IAAcxC,EAGpCyC,eAAgB,IAAMnB,EAEtBoB,qBAAsB,EAAGC,QAAOC,WAC5B,MAAMC,EAAwBC,EAAsB,CAChDH,WACGC,IAMP,MAxEkB,EAACG,EAAuBC,KAC9C,MAAMC,EAAYF,IAASG,EAAuBH,EAAO,GAAGA,KAC5DzB,EAAY6B,IAAI,GAAGF,IAAaD,GAO5BD,IAASG,IACTE,aAAalD,GACbA,EAAoBmD,WAAW7B,EAAqB8B,IASpDP,IAASQ,GAAuBR,IAASS,IACzCJ,aAAalD,GAEbuD,EAASjC,EAATiC,GACJ,EA8CIC,CAAkBf,EAAOE,GAElBA,CAAAA,EAGXc,WAAY,IAAMhD,EAAMC,QAExBgD,cAAe,MAKnB,OAFAhC,EAAUgC,cAAgBC,EAAsBjC,GAEzCA,CAAAA"}
1
+ {"version":3,"file":"Analytics.js","sources":["../../../../src/core/Analytics/Analytics.ts"],"sourcesContent":["import LogEvent from '../Services/analytics/log-event';\nimport CollectId from '../Services/analytics/collect-id';\nimport EventsQueue, { EventsQueueModule } from './EventsQueue';\nimport { ANALYTICS_EVENT, AnalyticsInitialEvent, AnalyticsObject, AnalyticsProps, CreateAnalyticsEventObject } from './types';\nimport { ANALYTICS_EVENT_ERROR, ANALYTICS_EVENT_INFO, ANALYTICS_EVENT_LOG, ANALYTICS_INFO_TIMER_INTERVAL, ANALYTICS_PATH } from './constants';\nimport { debounce } from '../../utils/debounce';\nimport { AnalyticsModule } from '../../types/global-types';\nimport { createAnalyticsObject, processAnalyticsData } from './utils';\nimport { analyticsPreProcessor } from './analyticsPreProcessor';\n\nlet capturedCheckoutAttemptId = null;\nlet hasLoggedPixel = false;\nlet sendEventsTimerId = null;\n\nconst Analytics = ({ loadingContext, locale, clientKey, analytics, amount, analyticsContext, bundleType }: AnalyticsProps): AnalyticsModule => {\n const defaultProps = {\n enabled: true,\n telemetry: true,\n checkoutAttemptId: null,\n analyticsData: {}\n };\n\n const props = { ...defaultProps, ...analytics };\n\n const logEvent = LogEvent({ loadingContext, locale });\n const collectId = CollectId({ analyticsContext, clientKey, locale, amount, analyticsPath: ANALYTICS_PATH, bundleType });\n const eventsQueue: EventsQueueModule = EventsQueue({ analyticsContext, clientKey, analyticsPath: ANALYTICS_PATH });\n\n const sendAnalyticsEvents = () => {\n if (capturedCheckoutAttemptId) {\n return eventsQueue.run(capturedCheckoutAttemptId);\n }\n return Promise.resolve(null);\n };\n\n const addAnalyticsEvent = (type: ANALYTICS_EVENT, obj: AnalyticsObject) => {\n const arrayName = type === ANALYTICS_EVENT_INFO ? type : `${type}s`;\n eventsQueue.add(`${arrayName}`, obj);\n\n /**\n * The logic is:\n * - info events are stored until a log or error comes along,\n * but, if after a set time, no other analytics event (log or error) has come along then we send the info events anyway\n */\n if (type === ANALYTICS_EVENT_INFO) {\n clearTimeout(sendEventsTimerId);\n sendEventsTimerId = setTimeout(sendAnalyticsEvents, ANALYTICS_INFO_TIMER_INTERVAL);\n }\n\n /**\n * The logic is:\n * - errors and logs get sent straightaway\n * ...but... tests with the 3DS2 process show that many logs can happen almost at the same time (or you can have an error followed immediately by a log),\n * so instead of making several sequential api calls we see if we can \"batch\" them using debounce\n */\n if (type === ANALYTICS_EVENT_LOG || type === ANALYTICS_EVENT_ERROR) {\n clearTimeout(sendEventsTimerId); // clear any timer that might be about to dispatch the info events array\n\n debounce(sendAnalyticsEvents)();\n }\n };\n\n const anlModule: AnalyticsModule = {\n /**\n * Make \"setup\" call, to pass containerWidth, buildType, channel etc, and receive a checkoutAttemptId in return\n * @param initialEvent -\n */\n setUp: async (initialEvent: AnalyticsInitialEvent) => {\n const { enabled, payload, telemetry } = props; // TODO what is payload, is it ever used?\n\n const analyticsData = processAnalyticsData(props.analyticsData);\n\n if (enabled === true) {\n if (telemetry === true && !capturedCheckoutAttemptId) {\n try {\n const checkoutAttemptId = await collectId({\n ...initialEvent,\n ...(payload && { ...payload }),\n ...(Object.keys(analyticsData).length && { ...analyticsData })\n });\n capturedCheckoutAttemptId = checkoutAttemptId;\n } catch (e) {\n console.warn(`Fetching checkoutAttemptId failed.${e ? ` Error=${e}` : ''}`);\n }\n }\n\n if (!hasLoggedPixel) {\n // Log pixel\n // TODO once we stop using the pixel we can stop requiring both \"enabled\" & \"telemetry\" config options.\n // And v6 will have a \"level: 'none\" | \"all\" | \"minimal\" config prop\n logEvent(initialEvent);\n hasLoggedPixel = true;\n }\n }\n },\n\n getCheckoutAttemptId: (): string => capturedCheckoutAttemptId,\n\n // Expose getter for testing purposes\n getEventsQueue: () => eventsQueue,\n\n createAnalyticsEvent: ({ event, data }: CreateAnalyticsEventObject): AnalyticsObject => {\n const aObj: AnalyticsObject = createAnalyticsObject({\n event,\n ...data\n });\n // console.log('### Analytics::createAnalyticsEvent:: event=', event, ' aObj=', aObj);\n\n addAnalyticsEvent(event, aObj);\n\n return aObj;\n },\n\n getEnabled: () => props.enabled,\n\n sendAnalytics: null\n };\n\n anlModule.sendAnalytics = analyticsPreProcessor(anlModule);\n\n return anlModule;\n};\n\nexport default Analytics;\n"],"names":["capturedCheckoutAttemptId","hasLoggedPixel","sendEventsTimerId","Analytics","loadingContext","locale","clientKey","analytics","amount","analyticsContext","bundleType","props","enabled","telemetry","checkoutAttemptId","analyticsData","logEvent","LogEvent","collectId","CollectId","analyticsPath","ANALYTICS_PATH","eventsQueue","EventsQueue","sendAnalyticsEvents","run","Promise","resolve","anlModule","setUp","async","initialEvent","payload","processAnalyticsData","Object","keys","length","e","console","warn","getCheckoutAttemptId","getEventsQueue","createAnalyticsEvent","event","data","aObj","createAnalyticsObject","type","obj","arrayName","ANALYTICS_EVENT_INFO","add","clearTimeout","setTimeout","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_EVENT_LOG","ANALYTICS_EVENT_ERROR","debounce","addAnalyticsEvent","getEnabled","sendAnalytics","analyticsPreProcessor"],"mappings":"yeAUA,IAAIA,EAA4B,KAC5BC,GAAiB,EACjBC,EAAoB,KAExB,MAAMC,EAAY,EAAGC,iBAAgB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D,EAAMC,QAExBgD,cAAe,MAKnB,OAFAhC,EAAUgC,cAAgBC,EAAsBjC,GAEzCA,CAAAA"}
@@ -1,2 +1,2 @@
1
- import{CREDITCARD_HOLDER_NAME_INVALID as _,CREDITCARD_TAX_NUMBER_INVALID as o,BOLETO_SOCIAL_SECURITY_NUMBER_INVALID as t,ERROR_FIELD_REQUIRED as r,ERROR_INVALID_FORMAT_EXPECTS as e}from"../Errors/constants.js";const n="v3/analytics",S=1e4,E=3e3,I="log",N="error",O="info",s="action",T="submit",a="selected",i="rendered",c="displayed",d="input",u="download",A="validationError",R="focus",p="unfocus",l="configured",C="qr_download_button",D="instant_payment_button",M="featured_issuer",f="list",m="list_search",G="ApiError",L="SdkError",$="Network";var F;!function(_){_.ACTION_IS_MISSING_PAYMENT_DATA="700",_.ACTION_IS_MISSING_TOKEN="701",_.TOKEN_IS_MISSING_THREEDSMETHODURL="702",_.TOKEN_IS_MISSING_OTHER_PROPS="703",_.TOKEN_DECODE_OR_PARSING_FAILED="704",_.THREEDS2_TIMEOUT="705",_.TOKEN_IS_MISSING_ACSURL="800",_.NO_TRANSSTATUS="801",_.NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED="802",_.NO_COMPONENT_FOR_ACTION="803",_.NO_ACTION_FOR_CHALLENGE="804"}(F||(F={}));const y={[_]:"925",[o]:"942",[t]:"926",[`${r}.country`]:"930",[`${r}.street`]:"931",[`${r}.house_number_or_name`]:"932",[`${r}.postal_code`]:"933",[`${r}.city`]:"935",[`${r}.state_or_province`]:"936",[`${e}.postal_code`]:"934"},H=["cart","minicart","pdp","checkout"],K=["applicationInfo"];export{K as ALLOWED_ANALYTICS_DATA,s as ANALYTICS_ACTION_STR,G as ANALYTICS_API_ERROR,l as ANALYTICS_CONFIGURED_STR,c as ANALYTICS_DISPLAYED_STR,u as ANALYTICS_DOWNLOAD_STR,N as ANALYTICS_EVENT_ERROR,O as ANALYTICS_EVENT_INFO,I as ANALYTICS_EVENT_LOG,H as ANALYTICS_EXPRESS_PAGES_ARRAY,M as ANALYTICS_FEATURED_ISSUER,R as ANALYTICS_FOCUS_STR,S as ANALYTICS_INFO_TIMER_INTERVAL,d as ANALYTICS_INPUT_STR,D as ANALYTICS_INSTANT_PAYMENT_BUTTON,f as ANALYTICS_LIST,m as ANALYTICS_LIST_SEARCH,$ as ANALYTICS_NETWORK_ERROR,n as ANALYTICS_PATH,C as ANALYTICS_QR_CODE_DOWNLOAD,i as ANALYTICS_RENDERED_STR,L as ANALYTICS_SDK_ERROR,E as ANALYTICS_SEARCH_DEBOUNCE_TIME,a as ANALYTICS_SELECTED_STR,T as ANALYTICS_SUBMIT_STR,p as ANALYTICS_UNFOCUS_STR,A as ANALYTICS_VALIDATION_ERROR_STR,F as Analytics3DS2Errors,y as errorCodeMapping};
1
+ import{CREDITCARD_HOLDER_NAME_INVALID as _,CREDITCARD_TAX_NUMBER_INVALID as t,BOLETO_SOCIAL_SECURITY_NUMBER_INVALID as o,ERROR_FIELD_REQUIRED as r,ERROR_INVALID_FORMAT_EXPECTS as e}from"../Errors/constants.js";const n="v3/analytics",S=1e4,E=3e3,I="log",N="error",O="info",c="action",s="submit",T="selected",a="rendered",i="displayed",d="input",u="download",A="validationError",R="focus",p="unfocus",l="configured",C="qr_download_button",D="instant_payment_button",M="featured_issuer",f="list",m="list_search",G="ApiError",L="SdkError",$="Network";var F;!function(_){_.ACTION_IS_MISSING_PAYMENT_DATA="700",_.ACTION_IS_MISSING_TOKEN="701",_.TOKEN_IS_MISSING_THREEDSMETHODURL="702",_.TOKEN_IS_MISSING_OTHER_PROPS="703",_.TOKEN_DECODE_OR_PARSING_FAILED="704",_.THREEDS2_TIMEOUT="705",_.TOKEN_IS_MISSING_ACSURL="800",_.NO_TRANSSTATUS="801",_.NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED="802",_.NO_COMPONENT_FOR_ACTION="803",_.NO_ACTION_FOR_CHALLENGE="804"}(F||(F={}));const y={[_]:"925",[t]:"942",[o]:"926",[`${r}.country`]:"930",[`${r}.street`]:"931",[`${r}.house_number_or_name`]:"932",[`${r}.postal_code`]:"933",[`${r}.city`]:"935",[`${r}.state_or_province`]:"936",[`${e}.postal_code`]:"934"},H=["cart","minicart","pdp","checkout"],K=["applicationInfo","checkoutAttemptId"];export{K as ALLOWED_ANALYTICS_DATA,c as ANALYTICS_ACTION_STR,G as ANALYTICS_API_ERROR,l as ANALYTICS_CONFIGURED_STR,i as ANALYTICS_DISPLAYED_STR,u as ANALYTICS_DOWNLOAD_STR,N as ANALYTICS_EVENT_ERROR,O as ANALYTICS_EVENT_INFO,I as ANALYTICS_EVENT_LOG,H as ANALYTICS_EXPRESS_PAGES_ARRAY,M as ANALYTICS_FEATURED_ISSUER,R as ANALYTICS_FOCUS_STR,S as ANALYTICS_INFO_TIMER_INTERVAL,d as ANALYTICS_INPUT_STR,D as ANALYTICS_INSTANT_PAYMENT_BUTTON,f as ANALYTICS_LIST,m as ANALYTICS_LIST_SEARCH,$ as ANALYTICS_NETWORK_ERROR,n as ANALYTICS_PATH,C as ANALYTICS_QR_CODE_DOWNLOAD,a as ANALYTICS_RENDERED_STR,L as ANALYTICS_SDK_ERROR,E as ANALYTICS_SEARCH_DEBOUNCE_TIME,T as ANALYTICS_SELECTED_STR,s as ANALYTICS_SUBMIT_STR,p as ANALYTICS_UNFOCUS_STR,A as ANALYTICS_VALIDATION_ERROR_STR,F as Analytics3DS2Errors,y as errorCodeMapping};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/core/Analytics/constants.ts"],"sourcesContent":["import {\n BOLETO_SOCIAL_SECURITY_NUMBER_INVALID,\n CREDITCARD_HOLDER_NAME_INVALID,\n CREDITCARD_TAX_NUMBER_INVALID,\n ERROR_FIELD_REQUIRED,\n ERROR_INVALID_FORMAT_EXPECTS\n} from '../Errors/constants';\n\nexport const ANALYTICS_PATH = 'v3/analytics';\n\nexport const ANALYTICS_INFO_TIMER_INTERVAL = process.env.NODE_ENV === 'development' ? 5000 : 10000;\n\nexport const ANALYTICS_SEARCH_DEBOUNCE_TIME = 3000;\n\nexport const ANALYTICS_EVENT_LOG = 'log';\nexport const ANALYTICS_EVENT_ERROR = 'error';\nexport const ANALYTICS_EVENT_INFO = 'info';\n\nexport const ANALYTICS_ACTION_STR = 'action';\nexport const ANALYTICS_SUBMIT_STR = 'submit';\nexport const ANALYTICS_SELECTED_STR = 'selected';\nexport const ANALYTICS_RENDERED_STR = 'rendered';\nexport const ANALYTICS_DISPLAYED_STR = 'displayed';\nexport const ANALYTICS_INPUT_STR = 'input';\n\nexport const ANALYTICS_DOWNLOAD_STR = 'download';\n\nexport const ANALYTICS_VALIDATION_ERROR_STR = 'validationError';\n\nexport const ANALYTICS_FOCUS_STR = 'focus';\nexport const ANALYTICS_UNFOCUS_STR = 'unfocus';\n\nexport const ANALYTICS_CONFIGURED_STR = 'configured';\n\nexport const ANALYTICS_QR_CODE_DOWNLOAD = 'qr_download_button';\n\nexport const ANALYTICS_INSTANT_PAYMENT_BUTTON = 'instant_payment_button';\nexport const ANALYTICS_FEATURED_ISSUER = 'featured_issuer';\nexport const ANALYTICS_LIST = 'list';\nexport const ANALYTICS_LIST_SEARCH = 'list_search';\n\nexport const ANALYTICS_IMPLEMENTATION_ERROR = 'ImplementationError';\nexport const ANALYTICS_API_ERROR = 'ApiError';\nexport const ANALYTICS_SDK_ERROR = 'SdkError';\nexport const ANALYTICS_NETWORK_ERROR = 'Network';\n\nexport enum Analytics3DS2Errors {\n ACTION_IS_MISSING_PAYMENT_DATA = '700', // Missing 'paymentData' property from threeDS2 action\n ACTION_IS_MISSING_TOKEN = '701', // Missing 'token' property from threeDS2 action\n TOKEN_IS_MISSING_THREEDSMETHODURL = '702', // Decoded token is missing a valid threeDSMethodURL property\n\n /**\n * Decoded token is missing one or more of the following properties:\n * fingerprint: (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)\n * challenge: (acsTransID | messageVersion | threeDSServerTransID)\n */\n TOKEN_IS_MISSING_OTHER_PROPS = '703',\n\n TOKEN_DECODE_OR_PARSING_FAILED = '704', // token decoding or parsing has failed. ('not base64', 'malformed URI sequence' or 'Could not JSON parse token')\n THREEDS2_TIMEOUT = '705', // 3DS2 process has timed out\n\n TOKEN_IS_MISSING_ACSURL = '800', // Decoded token is missing a valid acsURL property\n NO_TRANSSTATUS = '801', // Challenge has resulted in an error (no transStatus could be retrieved by the backend)\n NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED = '802', // callSubmit3DS2Fingerprint has received a response indicating either a \"frictionless\" flow, or a \"refused\" response, but without a details object\n NO_COMPONENT_FOR_ACTION = '803', // callSubmit3DS2Fingerprint cannot find a component to handle the action response\n NO_ACTION_FOR_CHALLENGE = '804' // callSubmit3DS2Fingerprint has received a response indicating a \"challenge\" but without an action object\n}\n\n/**\n * Function to map errorCodes based on translation keys to the codes expected by the analytics endpoint\n */\nexport const errorCodeMapping: Record<string, string> = {\n [CREDITCARD_HOLDER_NAME_INVALID]: '925',\n [CREDITCARD_TAX_NUMBER_INVALID]: '942',\n //\n [BOLETO_SOCIAL_SECURITY_NUMBER_INVALID]: '926',\n //\n [`${ERROR_FIELD_REQUIRED}.country`]: '930',\n [`${ERROR_FIELD_REQUIRED}.street`]: '931',\n [`${ERROR_FIELD_REQUIRED}.house_number_or_name`]: '932',\n [`${ERROR_FIELD_REQUIRED}.postal_code`]: '933',\n [`${ERROR_FIELD_REQUIRED}.city`]: '935',\n [`${ERROR_FIELD_REQUIRED}.state_or_province`]: '936',\n //\n [`${ERROR_INVALID_FORMAT_EXPECTS}.postal_code`]: '934'\n //\n};\n\nexport const ANALYTICS_EXPRESS_PAGES_ARRAY = ['cart', 'minicart', 'pdp', 'checkout'];\n\nexport const ALLOWED_ANALYTICS_DATA = ['applicationInfo'];\n"],"names":["ANALYTICS_PATH","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_SEARCH_DEBOUNCE_TIME","ANALYTICS_EVENT_LOG","ANALYTICS_EVENT_ERROR","ANALYTICS_EVENT_INFO","ANALYTICS_ACTION_STR","ANALYTICS_SUBMIT_STR","ANALYTICS_SELECTED_STR","ANALYTICS_RENDERED_STR","ANALYTICS_DISPLAYED_STR","ANALYTICS_INPUT_STR","ANALYTICS_DOWNLOAD_STR","ANALYTICS_VALIDATION_ERROR_STR","ANALYTICS_FOCUS_STR","ANALYTICS_UNFOCUS_STR","ANALYTICS_CONFIGURED_STR","ANALYTICS_QR_CODE_DOWNLOAD","ANALYTICS_INSTANT_PAYMENT_BUTTON","ANALYTICS_FEATURED_ISSUER","ANALYTICS_LIST","ANALYTICS_LIST_SEARCH","ANALYTICS_API_ERROR","ANALYTICS_SDK_ERROR","ANALYTICS_NETWORK_ERROR","Analytics3DS2Errors","errorCodeMapping","CREDITCARD_HOLDER_NAME_INVALID","CREDITCARD_TAX_NUMBER_INVALID","BOLETO_SOCIAL_SECURITY_NUMBER_INVALID","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","ANALYTICS_EXPRESS_PAGES_ARRAY","ALLOWED_ANALYTICS_DATA"],"mappings":"kNAQO,MAAMA,EAAiB,eAEjBC,EAAgF,IAEhFC,EAAiC,IAEjCC,EAAsB,MACtBC,EAAwB,QACxBC,EAAuB,OAEvBC,EAAuB,SACvBC,EAAuB,SACvBC,EAAyB,WACzBC,EAAyB,WACzBC,EAA0B,YAC1BC,EAAsB,QAEtBC,EAAyB,WAEzBC,EAAiC,kBAEjCC,EAAsB,QACtBC,EAAwB,UAExBC,EAA2B,aAE3BC,EAA6B,qBAE7BC,EAAmC,yBACnCC,EAA4B,kBAC5BC,EAAiB,OACjBC,EAAwB,cAGxBC,EAAsB,WACtBC,EAAsB,WACtBC,EAA0B,iBAE3BC,SAAAA,oHASPA,EAAA,6BAAA,4OATOA,CAAAA,IAAAA,EAAAA,CAAAA,UAyBCC,EAA2C,CACpDC,CAACA,GAAiC,MAClCC,CAACA,GAAgC,MAEjCC,CAACA,GAAwC,MAEzC,CAAC,GAAGC,aAAiC,MACrC,CAAC,GAAGA,YAAgC,MACpC,CAAC,GAAGA,0BAA8C,MAClD,CAAC,GAAGA,iBAAqC,MACzC,CAAC,GAAGA,UAA8B,MAClC,CAAC,GAAGA,uBAA2C,MAE/C,CAAC,GAAGC,iBAA6C,OAIxCC,EAAgC,CAAC,OAAQ,WAAY,MAAO,YAE5DC,EAAyB,CAAC"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/core/Analytics/constants.ts"],"sourcesContent":["import {\n BOLETO_SOCIAL_SECURITY_NUMBER_INVALID,\n CREDITCARD_HOLDER_NAME_INVALID,\n CREDITCARD_TAX_NUMBER_INVALID,\n ERROR_FIELD_REQUIRED,\n ERROR_INVALID_FORMAT_EXPECTS\n} from '../Errors/constants';\n\nexport const ANALYTICS_PATH = 'v3/analytics';\n\nexport const ANALYTICS_INFO_TIMER_INTERVAL = process.env.NODE_ENV === 'development' ? 5000 : 10000;\n\nexport const ANALYTICS_SEARCH_DEBOUNCE_TIME = 3000;\n\nexport const ANALYTICS_EVENT_LOG = 'log';\nexport const ANALYTICS_EVENT_ERROR = 'error';\nexport const ANALYTICS_EVENT_INFO = 'info';\n\nexport const ANALYTICS_ACTION_STR = 'action';\nexport const ANALYTICS_SUBMIT_STR = 'submit';\nexport const ANALYTICS_SELECTED_STR = 'selected';\nexport const ANALYTICS_RENDERED_STR = 'rendered';\nexport const ANALYTICS_DISPLAYED_STR = 'displayed';\nexport const ANALYTICS_INPUT_STR = 'input';\n\nexport const ANALYTICS_DOWNLOAD_STR = 'download';\n\nexport const ANALYTICS_VALIDATION_ERROR_STR = 'validationError';\n\nexport const ANALYTICS_FOCUS_STR = 'focus';\nexport const ANALYTICS_UNFOCUS_STR = 'unfocus';\n\nexport const ANALYTICS_CONFIGURED_STR = 'configured';\n\nexport const ANALYTICS_QR_CODE_DOWNLOAD = 'qr_download_button';\n\nexport const ANALYTICS_INSTANT_PAYMENT_BUTTON = 'instant_payment_button';\nexport const ANALYTICS_FEATURED_ISSUER = 'featured_issuer';\nexport const ANALYTICS_LIST = 'list';\nexport const ANALYTICS_LIST_SEARCH = 'list_search';\n\nexport const ANALYTICS_IMPLEMENTATION_ERROR = 'ImplementationError';\nexport const ANALYTICS_API_ERROR = 'ApiError';\nexport const ANALYTICS_SDK_ERROR = 'SdkError';\nexport const ANALYTICS_NETWORK_ERROR = 'Network';\n\nexport enum Analytics3DS2Errors {\n ACTION_IS_MISSING_PAYMENT_DATA = '700', // Missing 'paymentData' property from threeDS2 action\n ACTION_IS_MISSING_TOKEN = '701', // Missing 'token' property from threeDS2 action\n TOKEN_IS_MISSING_THREEDSMETHODURL = '702', // Decoded token is missing a valid threeDSMethodURL property\n\n /**\n * Decoded token is missing one or more of the following properties:\n * fingerprint: (threeDSMethodNotificationURL | postMessageDomain | threeDSServerTransID)\n * challenge: (acsTransID | messageVersion | threeDSServerTransID)\n */\n TOKEN_IS_MISSING_OTHER_PROPS = '703',\n\n TOKEN_DECODE_OR_PARSING_FAILED = '704', // token decoding or parsing has failed. ('not base64', 'malformed URI sequence' or 'Could not JSON parse token')\n THREEDS2_TIMEOUT = '705', // 3DS2 process has timed out\n\n TOKEN_IS_MISSING_ACSURL = '800', // Decoded token is missing a valid acsURL property\n NO_TRANSSTATUS = '801', // Challenge has resulted in an error (no transStatus could be retrieved by the backend)\n NO_DETAILS_FOR_FRICTIONLESS_OR_REFUSED = '802', // callSubmit3DS2Fingerprint has received a response indicating either a \"frictionless\" flow, or a \"refused\" response, but without a details object\n NO_COMPONENT_FOR_ACTION = '803', // callSubmit3DS2Fingerprint cannot find a component to handle the action response\n NO_ACTION_FOR_CHALLENGE = '804' // callSubmit3DS2Fingerprint has received a response indicating a \"challenge\" but without an action object\n}\n\n/**\n * Function to map errorCodes based on translation keys to the codes expected by the analytics endpoint\n */\nexport const errorCodeMapping: Record<string, string> = {\n [CREDITCARD_HOLDER_NAME_INVALID]: '925',\n [CREDITCARD_TAX_NUMBER_INVALID]: '942',\n //\n [BOLETO_SOCIAL_SECURITY_NUMBER_INVALID]: '926',\n //\n [`${ERROR_FIELD_REQUIRED}.country`]: '930',\n [`${ERROR_FIELD_REQUIRED}.street`]: '931',\n [`${ERROR_FIELD_REQUIRED}.house_number_or_name`]: '932',\n [`${ERROR_FIELD_REQUIRED}.postal_code`]: '933',\n [`${ERROR_FIELD_REQUIRED}.city`]: '935',\n [`${ERROR_FIELD_REQUIRED}.state_or_province`]: '936',\n //\n [`${ERROR_INVALID_FORMAT_EXPECTS}.postal_code`]: '934'\n //\n};\n\nexport const ANALYTICS_EXPRESS_PAGES_ARRAY = ['cart', 'minicart', 'pdp', 'checkout'];\n\nexport const ALLOWED_ANALYTICS_DATA = ['applicationInfo', 'checkoutAttemptId'];\n"],"names":["ANALYTICS_PATH","ANALYTICS_INFO_TIMER_INTERVAL","ANALYTICS_SEARCH_DEBOUNCE_TIME","ANALYTICS_EVENT_LOG","ANALYTICS_EVENT_ERROR","ANALYTICS_EVENT_INFO","ANALYTICS_ACTION_STR","ANALYTICS_SUBMIT_STR","ANALYTICS_SELECTED_STR","ANALYTICS_RENDERED_STR","ANALYTICS_DISPLAYED_STR","ANALYTICS_INPUT_STR","ANALYTICS_DOWNLOAD_STR","ANALYTICS_VALIDATION_ERROR_STR","ANALYTICS_FOCUS_STR","ANALYTICS_UNFOCUS_STR","ANALYTICS_CONFIGURED_STR","ANALYTICS_QR_CODE_DOWNLOAD","ANALYTICS_INSTANT_PAYMENT_BUTTON","ANALYTICS_FEATURED_ISSUER","ANALYTICS_LIST","ANALYTICS_LIST_SEARCH","ANALYTICS_API_ERROR","ANALYTICS_SDK_ERROR","ANALYTICS_NETWORK_ERROR","Analytics3DS2Errors","errorCodeMapping","CREDITCARD_HOLDER_NAME_INVALID","CREDITCARD_TAX_NUMBER_INVALID","BOLETO_SOCIAL_SECURITY_NUMBER_INVALID","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","ANALYTICS_EXPRESS_PAGES_ARRAY","ALLOWED_ANALYTICS_DATA"],"mappings":"kNAQO,MAAMA,EAAiB,eAEjBC,EAAgF,IAEhFC,EAAiC,IAEjCC,EAAsB,MACtBC,EAAwB,QACxBC,EAAuB,OAEvBC,EAAuB,SACvBC,EAAuB,SACvBC,EAAyB,WACzBC,EAAyB,WACzBC,EAA0B,YAC1BC,EAAsB,QAEtBC,EAAyB,WAEzBC,EAAiC,kBAEjCC,EAAsB,QACtBC,EAAwB,UAExBC,EAA2B,aAE3BC,EAA6B,qBAE7BC,EAAmC,yBACnCC,EAA4B,kBAC5BC,EAAiB,OACjBC,EAAwB,cAGxBC,EAAsB,WACtBC,EAAsB,WACtBC,EAA0B,iBAE3BC,SAAAA,oHASPA,EAAA,6BAAA,4OATOA,CAAAA,IAAAA,EAAAA,CAAAA,UAyBCC,EAA2C,CACpDC,CAACA,GAAiC,MAClCC,CAACA,GAAgC,MAEjCC,CAACA,GAAwC,MAEzC,CAAC,GAAGC,aAAiC,MACrC,CAAC,GAAGA,YAAgC,MACpC,CAAC,GAAGA,0BAA8C,MAClD,CAAC,GAAGA,iBAAqC,MACzC,CAAC,GAAGA,UAA8B,MAClC,CAAC,GAAGA,uBAA2C,MAE/C,CAAC,GAAGC,iBAA6C,OAIxCC,EAAgC,CAAC,OAAQ,WAAY,MAAO,YAE5DC,EAAyB,CAAC,kBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/core/Analytics/utils.ts"],"sourcesContent":["import { AnalyticsObject, CreateAnalyticsObject, AnalyticsData } from './types';\nimport { ANALYTICS_ACTION_STR, ANALYTICS_VALIDATION_ERROR_STR, errorCodeMapping, ALLOWED_ANALYTICS_DATA } from './constants';\nimport uuid from '../../utils/uuid';\nimport { digitsOnlyFormatter } from '../../utils/Formatters/formatters';\nimport { ERROR_FIELD_REQUIRED, ERROR_INVALID_FORMAT_EXPECTS } from '../Errors/constants';\n\nexport const getUTCTimestamp = () => Date.now();\n\n/**\n * All objects for the /checkoutanalytics endpoint have base props:\n * \"timestamp\" & \"component\"\n *\n * Error objects have, in addition to the base props:\n * \"code\", \"errorType\" & \"message\"\n *\n * Log objects have, in addition to the base props:\n * \"message\" & \"type\" &\n * \"subtype\" (e.g. when an action is handled)\n *\n * Info objects have, in addition to the base props:\n * \"type\" & \"target\" &\n * \"isStoredPaymentMethod\" & \"brand\" (when a storedCard is \"selected\"), or,\n * \"validationErrorCode\" & \"validationErrorMessage\" (when the event is describing a validation error)\n *\n * All objects can also have a \"metadata\" object of key-value pairs\n */\nexport const createAnalyticsObject = (aObj: CreateAnalyticsObject): AnalyticsObject => ({\n timestamp: String(getUTCTimestamp()),\n component: aObj.component,\n id: uuid(),\n /** ERROR */\n ...(aObj.event === 'error' && { code: aObj.code, errorType: aObj.errorType, message: aObj.message }), // error event\n /** LOG */\n ...(aObj.event === 'log' && { type: aObj.type, message: aObj.message }), // log event\n ...(aObj.event === 'log' && aObj.type === ANALYTICS_ACTION_STR && { subType: aObj.subtype }), // only added if we have a log event of Action type\n /** INFO */\n ...(aObj.event === 'info' && { type: aObj.type, target: aObj.target }), // info event\n ...(aObj.event === 'info' && aObj.issuer && { issuer: aObj.issuer }), // relates to issuerLists\n ...(aObj.event === 'info' && { isExpress: aObj.isExpress, expressPage: aObj.expressPage }), // relates to Plugins & detecting Express PMs\n ...(aObj.event === 'info' && aObj.isStoredPaymentMethod && { isStoredPaymentMethod: aObj.isStoredPaymentMethod, brand: aObj.brand }), // only added if we have an info event about a storedPM\n ...(aObj.event === 'info' &&\n aObj.type === ANALYTICS_VALIDATION_ERROR_STR && {\n validationErrorCode: mapErrorCodesForAnalytics(aObj.validationErrorCode, aObj.target),\n validationErrorMessage: aObj.validationErrorMessage\n }), // only added if we have an info event describing a validation error\n /** All */\n ...(aObj.metadata && { metadata: aObj.metadata })\n});\n\nconst mapErrorCodesForAnalytics = (errorCode: string, target: string) => {\n // Some of the more generic error codes required combination with target to retrieve a specific code\n if (errorCode === ERROR_FIELD_REQUIRED || errorCode === ERROR_INVALID_FORMAT_EXPECTS) {\n return errorCodeMapping[`${errorCode}.${target}`] ?? errorCode;\n }\n\n let errCode = errorCodeMapping[errorCode] ?? errorCode;\n\n // If errCode isn't now a number - then we just need to remove any non-digits\n // since the correct error code is already contained within the string e.g. securedField related errors\n if (isNaN(Number(errCode))) {\n errCode = digitsOnlyFormatter(errCode);\n }\n\n return errCode;\n};\n\nexport const processAnalyticsData = (analyticsData: AnalyticsData) => {\n return Object.keys(analyticsData).reduce((acc, prop) => {\n if (ALLOWED_ANALYTICS_DATA.includes(prop)) acc[prop] = analyticsData[prop];\n return acc;\n }, {});\n};\n"],"names":["getUTCTimestamp","Date","now","createAnalyticsObject","aObj","timestamp","String","component","id","uuid","event","code","errorType","message","type","ANALYTICS_ACTION_STR","subType","subtype","target","issuer","isExpress","expressPage","isStoredPaymentMethod","brand","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","mapErrorCodesForAnalytics","validationErrorMessage","metadata","errorCode","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","errorCodeMapping","errCode","isNaN","Number","digitsOnlyFormatter","processAnalyticsData","analyticsData","Object","keys","reduce","acc","prop","ALLOWED_ANALYTICS_DATA","includes"],"mappings":"0VAMaA,MAAAA,EAAkB,IAAMC,KAAKC,MAoB7BC,EAAyBC,IAAkD,CACpFC,UAAWC,OAAON,KAClBO,UAAWH,EAAKG,UAChBC,GAAIC,OAEe,UAAfL,EAAKM,OAAqB,CAAEC,KAAMP,EAAKO,KAAMC,UAAWR,EAAKQ,UAAWC,QAAST,EAAKS,YAEvE,QAAfT,EAAKM,OAAmB,CAAEI,KAAMV,EAAKU,KAAMD,QAAST,EAAKS,YAC1C,QAAfT,EAAKM,OAAmBN,EAAKU,OAASC,GAAwB,CAAEC,QAASZ,EAAKa,YAE/D,SAAfb,EAAKM,OAAoB,CAAEI,KAAMV,EAAKU,KAAMI,OAAQd,EAAKc,WAC1C,SAAfd,EAAKM,OAAoBN,EAAKe,QAAU,CAAEA,OAAQf,EAAKe,WACxC,SAAff,EAAKM,OAAoB,CAAEU,UAAWhB,EAAKgB,UAAWC,YAAajB,EAAKiB,gBACzD,SAAfjB,EAAKM,OAAoBN,EAAKkB,uBAAyB,CAAEA,sBAAuBlB,EAAKkB,sBAAuBC,MAAOnB,EAAKmB,UACzG,SAAfnB,EAAKM,OACLN,EAAKU,OAASU,GAAkC,CAC5CC,oBAAqBC,EAA0BtB,EAAKqB,oBAAqBrB,EAAKc,QAC9ES,uBAAwBvB,EAAKuB,2BAGjCvB,EAAKwB,UAAY,CAAEA,SAAUxB,EAAKwB,YAGpCF,EAA4B,CAACG,EAAmBX,KAElD,GAAIW,IAAcC,GAAwBD,IAAcE,EACpD,OAAOC,EAAiB,GAAGH,KAAaX,MAAaW,EAGzD,IAAII,EAAUD,EAAiBH,IAAcA,EAQ7C,OAJIK,MAAMC,OAAOF,MACbA,EAAUG,EAAoBH,IAG3BA,CAAAA,EAGEI,EAAwBC,GAC1BC,OAAOC,KAAKF,GAAeG,QAAO,CAACC,EAAKC,KACvCC,EAAuBC,SAASF,KAAOD,EAAIC,GAAQL,EAAcK,IAC9DD,IACR,CAAC"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/core/Analytics/utils.ts"],"sourcesContent":["import { AnalyticsObject, CreateAnalyticsObject, AnalyticsData } from './types';\nimport { ANALYTICS_ACTION_STR, ANALYTICS_VALIDATION_ERROR_STR, errorCodeMapping, ALLOWED_ANALYTICS_DATA } from './constants';\nimport uuid from '../../utils/uuid';\nimport { digitsOnlyFormatter } from '../../utils/Formatters/formatters';\nimport { ERROR_FIELD_REQUIRED, ERROR_INVALID_FORMAT_EXPECTS } from '../Errors/constants';\n\nexport const getUTCTimestamp = () => Date.now();\n\n/**\n * All objects for the /checkoutanalytics endpoint have base props:\n * \"timestamp\" & \"component\"\n *\n * Error objects have, in addition to the base props:\n * \"code\", \"errorType\" & \"message\"\n *\n * Log objects have, in addition to the base props:\n * \"message\" & \"type\" &\n * \"subtype\" (e.g. when an action is handled)\n *\n * Info objects have, in addition to the base props:\n * \"type\" & \"target\" &\n * \"isStoredPaymentMethod\" & \"brand\" (when a storedCard is \"selected\"), or,\n * \"validationErrorCode\" & \"validationErrorMessage\" (when the event is describing a validation error)\n *\n * All objects can also have a \"metadata\" object of key-value pairs\n */\nexport const createAnalyticsObject = (aObj: CreateAnalyticsObject): AnalyticsObject => ({\n timestamp: String(getUTCTimestamp()),\n component: aObj.component,\n id: uuid(),\n /** ERROR */\n ...(aObj.event === 'error' && { code: aObj.code, errorType: aObj.errorType, message: aObj.message }), // error event\n /** LOG */\n ...(aObj.event === 'log' && { type: aObj.type, message: aObj.message }), // log event\n ...(aObj.event === 'log' && aObj.type === ANALYTICS_ACTION_STR && { subType: aObj.subtype }), // only added if we have a log event of Action type\n /** INFO */\n ...(aObj.event === 'info' && { type: aObj.type, target: aObj.target }), // info event\n ...(aObj.event === 'info' && aObj.issuer && { issuer: aObj.issuer }), // relates to issuerLists\n ...(aObj.event === 'info' && { isExpress: aObj.isExpress, expressPage: aObj.expressPage }), // relates to Plugins & detecting Express PMs\n ...(aObj.event === 'info' && aObj.isStoredPaymentMethod && { isStoredPaymentMethod: aObj.isStoredPaymentMethod, brand: aObj.brand }), // only added if we have an info event about a storedPM\n ...(aObj.event === 'info' &&\n aObj.type === ANALYTICS_VALIDATION_ERROR_STR && {\n validationErrorCode: mapErrorCodesForAnalytics(aObj.validationErrorCode, aObj.target),\n validationErrorMessage: aObj.validationErrorMessage\n }), // only added if we have an info event describing a validation error\n /** All */\n ...(aObj.metadata && { metadata: aObj.metadata })\n});\n\nconst mapErrorCodesForAnalytics = (errorCode: string, target: string) => {\n // Some of the more generic error codes required combination with target to retrieve a specific code\n if (errorCode === ERROR_FIELD_REQUIRED || errorCode === ERROR_INVALID_FORMAT_EXPECTS) {\n return errorCodeMapping[`${errorCode}.${target}`] ?? errorCode;\n }\n\n let errCode = errorCodeMapping[errorCode] ?? errorCode;\n\n // If errCode isn't now a number - then we just need to remove any non-digits\n // since the correct error code is already contained within the string e.g. securedField related errors\n if (isNaN(Number(errCode))) {\n errCode = digitsOnlyFormatter(errCode);\n }\n\n return errCode;\n};\n\nexport const processAnalyticsData = (analyticsData: AnalyticsData): AnalyticsData => {\n return Object.keys(analyticsData).reduce((acc, prop) => {\n if (ALLOWED_ANALYTICS_DATA.includes(prop)) acc[prop] = analyticsData[prop];\n return acc;\n }, {});\n};\n"],"names":["getUTCTimestamp","Date","now","createAnalyticsObject","aObj","timestamp","String","component","id","uuid","event","code","errorType","message","type","ANALYTICS_ACTION_STR","subType","subtype","target","issuer","isExpress","expressPage","isStoredPaymentMethod","brand","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","mapErrorCodesForAnalytics","validationErrorMessage","metadata","errorCode","ERROR_FIELD_REQUIRED","ERROR_INVALID_FORMAT_EXPECTS","errorCodeMapping","errCode","isNaN","Number","digitsOnlyFormatter","processAnalyticsData","analyticsData","Object","keys","reduce","acc","prop","ALLOWED_ANALYTICS_DATA","includes"],"mappings":"0VAMaA,MAAAA,EAAkB,IAAMC,KAAKC,MAoB7BC,EAAyBC,IAAkD,CACpFC,UAAWC,OAAON,KAClBO,UAAWH,EAAKG,UAChBC,GAAIC,OAEe,UAAfL,EAAKM,OAAqB,CAAEC,KAAMP,EAAKO,KAAMC,UAAWR,EAAKQ,UAAWC,QAAST,EAAKS,YAEvE,QAAfT,EAAKM,OAAmB,CAAEI,KAAMV,EAAKU,KAAMD,QAAST,EAAKS,YAC1C,QAAfT,EAAKM,OAAmBN,EAAKU,OAASC,GAAwB,CAAEC,QAASZ,EAAKa,YAE/D,SAAfb,EAAKM,OAAoB,CAAEI,KAAMV,EAAKU,KAAMI,OAAQd,EAAKc,WAC1C,SAAfd,EAAKM,OAAoBN,EAAKe,QAAU,CAAEA,OAAQf,EAAKe,WACxC,SAAff,EAAKM,OAAoB,CAAEU,UAAWhB,EAAKgB,UAAWC,YAAajB,EAAKiB,gBACzD,SAAfjB,EAAKM,OAAoBN,EAAKkB,uBAAyB,CAAEA,sBAAuBlB,EAAKkB,sBAAuBC,MAAOnB,EAAKmB,UACzG,SAAfnB,EAAKM,OACLN,EAAKU,OAASU,GAAkC,CAC5CC,oBAAqBC,EAA0BtB,EAAKqB,oBAAqBrB,EAAKc,QAC9ES,uBAAwBvB,EAAKuB,2BAGjCvB,EAAKwB,UAAY,CAAEA,SAAUxB,EAAKwB,YAGpCF,EAA4B,CAACG,EAAmBX,KAElD,GAAIW,IAAcC,GAAwBD,IAAcE,EACpD,OAAOC,EAAiB,GAAGH,KAAaX,MAAaW,EAGzD,IAAII,EAAUD,EAAiBH,IAAcA,EAQ7C,OAJIK,MAAMC,OAAOF,MACbA,EAAUG,EAAoBH,IAG3BA,CAAAA,EAGEI,EAAwBC,GAC1BC,OAAOC,KAAKF,GAAeG,QAAO,CAACC,EAAKC,KACvCC,EAAuBC,SAASF,KAAOD,EAAIC,GAAQL,EAAcK,IAC9DD,IACR,CAAC"}
@@ -1,2 +1,2 @@
1
- import{FALLBACK_CDN_CONTEXT as e}from"../Environment/Environment.js";class r{resourceContext;constructor(r=e){this.resourceContext=r}returnImage=({name:e,resourceContext:r,imageFolder:t="",parentFolder:o="",extension:n,size:s="",subFolder:i=""})=>`${r}images/${t}${i}${o}${e}${s}.${n}`;getImageUrl=({resourceContext:r=e,extension:t="svg",...o})=>e=>{const n={extension:t,resourceContext:r,imageFolder:"logos/",parentFolder:"",name:e,...o};return this.returnImage(n)};getImage(e={}){return this.getImageUrl({...e,resourceContext:this.resourceContext})}}export{r as Resources};
1
+ import e from"../Errors/AdyenCheckoutError.js";class r{resourceContext;constructor(r){if(!r)throw new e("IMPLEMENTATION_ERROR",'Resources module: "environmentsUrls.cdn" is not a valid URL');this.resourceContext=r}returnImage=({name:e,resourceContext:r,imageFolder:t="",parentFolder:o="",extension:n,size:s="",subFolder:i=""})=>`${r}images/${t}${i}${o}${e}${s}.${n}`;getImageUrl=({resourceContext:e,extension:r="svg",...t})=>o=>{const n={extension:r,resourceContext:e,imageFolder:"logos/",parentFolder:"",name:o,...t};return this.returnImage(n)};getImage(e={}){return this.getImageUrl({...e,resourceContext:this.resourceContext})}}export{r as Resources};
2
2
  //# sourceMappingURL=Resources.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Resources.js","sources":["../../../../src/core/Context/Resources.ts"],"sourcesContent":["import { FALLBACK_CDN_CONTEXT } from '../Environment/Environment';\n\nexport interface ImageOptions {\n extension?: string;\n imageFolder?: string;\n resourceContext?: string;\n name?: string;\n parentFolder?: string;\n size?: string;\n subFolder?: string;\n svgOptions?: string;\n type?: string;\n}\n\nexport type GetImageFnType = (name) => string;\n\nexport class Resources {\n private readonly resourceContext: string;\n\n constructor(cdnContext: string = FALLBACK_CDN_CONTEXT) {\n this.resourceContext = cdnContext;\n }\n\n private returnImage = ({\n name,\n resourceContext,\n imageFolder = '',\n parentFolder = '',\n extension,\n size = '',\n subFolder = ''\n }: ImageOptions): string => `${resourceContext}images/${imageFolder}${subFolder}${parentFolder}${name}${size}.${extension}`;\n\n private getImageUrl =\n ({ resourceContext = FALLBACK_CDN_CONTEXT, extension = 'svg', ...options }: ImageOptions): GetImageFnType =>\n (name: string): string => {\n const imageOptions: ImageOptions = {\n extension,\n resourceContext,\n imageFolder: 'logos/',\n parentFolder: '',\n name,\n ...options\n };\n\n return this.returnImage(imageOptions);\n };\n\n public getImage(props = {} as ImageOptions) {\n return this.getImageUrl({ ...props, resourceContext: this.resourceContext });\n }\n}\n"],"names":["Resources","resourceContext","constructor","cdnContext","FALLBACK_CDN_CONTEXT","this","returnImage","name","imageFolder","parentFolder","extension","size","subFolder","getImageUrl","options","imageOptions","getImage","props"],"mappings":"qEAgBO,MAAMA,EACQC,gBAEjBC,WAAAA,CAAYC,EAAqBC,GAC7BC,KAAKJ,gBAAkBE,CAC3B,CAEQG,YAAc,EAClBC,OACAN,kBACAO,cAAc,GACdC,eAAe,GACfC,YACAC,OAAO,GACPC,YAAY,MACY,GAAGX,WAAyBO,IAAcI,IAAYH,IAAeF,IAAOI,KAAQD,IAExGG,YACJ,EAAGZ,kBAAkBG,EAAsBM,YAAY,SAAUI,KAChEP,IACG,MAAMQ,EAA6B,CAC/BL,YACAT,kBACAO,YAAa,SACbC,aAAc,GACdF,UACGO,GAGP,OAAOT,KAAKC,YAAYS,EAAAA,EAGzBC,QAAAA,CAASC,EAAQ,IACpB,OAAOZ,KAAKQ,YAAY,IAAKI,EAAOhB,gBAAiBI,KAAKJ,iBAC9D"}
1
+ {"version":3,"file":"Resources.js","sources":["../../../../src/core/Context/Resources.ts"],"sourcesContent":["import AdyenCheckoutError from '../Errors/AdyenCheckoutError';\n\nexport interface ImageOptions {\n extension?: string;\n imageFolder?: string;\n resourceContext?: string;\n name?: string;\n parentFolder?: string;\n size?: string;\n subFolder?: string;\n svgOptions?: string;\n type?: string;\n}\n\nexport type GetImageFnType = (name) => string;\n\nexport class Resources {\n private readonly resourceContext: string;\n\n constructor(cdnContext: string) {\n if (!cdnContext) {\n throw new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'Resources module: \"environmentsUrls.cdn\" is not a valid URL');\n }\n this.resourceContext = cdnContext;\n }\n\n private returnImage = ({\n name,\n resourceContext,\n imageFolder = '',\n parentFolder = '',\n extension,\n size = '',\n subFolder = ''\n }: ImageOptions): string => `${resourceContext}images/${imageFolder}${subFolder}${parentFolder}${name}${size}.${extension}`;\n\n private getImageUrl =\n ({ resourceContext, extension = 'svg', ...options }: ImageOptions): GetImageFnType =>\n (name: string): string => {\n const imageOptions: ImageOptions = {\n extension,\n resourceContext,\n imageFolder: 'logos/',\n parentFolder: '',\n name,\n ...options\n };\n\n return this.returnImage(imageOptions);\n };\n\n public getImage(props = {} as ImageOptions) {\n return this.getImageUrl({ ...props, resourceContext: this.resourceContext });\n }\n}\n"],"names":["Resources","resourceContext","constructor","cdnContext","AdyenCheckoutError","this","returnImage","name","imageFolder","parentFolder","extension","size","subFolder","getImageUrl","options","imageOptions","getImage","props"],"mappings":"+CAgBO,MAAMA,EACQC,gBAEjBC,WAAAA,CAAYC,GACR,IAAKA,EACD,MAAM,IAAIC,EAAmB,uBAAwB,+DAEzDC,KAAKJ,gBAAkBE,CAC3B,CAEQG,YAAc,EAClBC,OACAN,kBACAO,cAAc,GACdC,eAAe,GACfC,YACAC,OAAO,GACPC,YAAY,MACY,GAAGX,WAAyBO,IAAcI,IAAYH,IAAeF,IAAOI,KAAQD,IAExGG,YACJ,EAAGZ,kBAAiBS,YAAY,SAAUI,KACzCP,IACG,MAAMQ,EAA6B,CAC/BL,YACAT,kBACAO,YAAa,SACbC,aAAc,GACdF,UACGO,GAGP,OAAOT,KAAKC,YAAYS,EAAAA,EAGzBC,QAAAA,CAASC,EAAQ,IACpB,OAAOZ,KAAKQ,YAAY,IAAKI,EAAOhB,gBAAiBI,KAAKJ,iBAC9D"}
@@ -1,2 +1,2 @@
1
- const e="https://checkoutshopper-live.adyen.com/checkoutshopper/",c=(c="",t)=>{if(t)return t;return{test:"https://checkoutshopper-test.adyen.com/checkoutshopper/",live:"https://checkoutshopper-live.adyen.com/checkoutshopper/","live-us":"https://checkoutshopper-live-us.adyen.com/checkoutshopper/","live-au":"https://checkoutshopper-live-au.adyen.com/checkoutshopper/","live-apse":"https://checkoutshopper-live-apse.adyen.com/checkoutshopper/","live-in":"https://checkoutshopper-live-in.adyen.com/checkoutshopper/"}[c.toLowerCase()]||e},t="https://checkoutshopper-live.adyen.com/checkoutshopper/",o=(e="",c)=>{if(c)return c;return{beta:"https://cdf6519016.cdn.adyen.com/checkoutshopper/",test:"https://checkoutshopper-test.adyen.com/checkoutshopper/",live:"https://checkoutshopper-live.adyen.com/checkoutshopper/","live-us":"https://checkoutshopper-live-us.adyen.com/checkoutshopper/","live-au":"https://checkoutshopper-live-au.adyen.com/checkoutshopper/","live-apse":"https://checkoutshopper-live-apse.adyen.com/checkoutshopper/","live-in":"https://checkoutshopper-live-in.adyen.com/checkoutshopper/"}[e.toLowerCase()]||t},h="https://checkoutanalytics-live.adyen.com/checkoutanalytics/",s=(e=h)=>{const c={test:"https://checkoutanalytics-test.adyen.com/checkoutanalytics/",live:"https://checkoutanalytics-live.adyen.com/checkoutanalytics/","live-us":"https://checkoutanalytics-live-us.adyen.com/checkoutanalytics/","live-au":"https://checkoutanalytics-live-au.adyen.com/checkoutanalytics/","live-apse":"https://checkoutanalytics-live-apse.adyen.com/checkoutanalytics/","live-in":"https://checkoutanalytics-live-in.adyen.com/checkoutanalytics/"};return c[e]||c[e.toLowerCase()]||e};export{h as FALLBACK_ANALYTICS_CONTEXT,t as FALLBACK_CDN_CONTEXT,e as FALLBACK_CONTEXT,s as resolveAnalyticsEnvironment,o as resolveCDNEnvironment,c as resolveEnvironment};
1
+ import{API_ENVIRONMENTS as a,ANALYTICS_ENVIRONMENTS as n,CDN_ENVIRONMENTS as s}from"./constants.js";const t=(a="",n,s)=>s||(n[a.toLowerCase()]||n.fallback),l=(l,r)=>({apiUrl:t(l,a,r?.api),analyticsUrl:t(l,n,r?.analytics),cdnImagesUrl:t(l,s,r?.cdn?.images),cdnTranslationsUrl:t(l,s,r?.cdn?.translations)});export{l as resolveEnvironments};
2
2
  //# sourceMappingURL=Environment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.js","sources":["../../../../src/core/Environment/Environment.ts"],"sourcesContent":["export const FALLBACK_CONTEXT = 'https://checkoutshopper-live.adyen.com/checkoutshopper/';\nexport const resolveEnvironment = (env = '', environmentUrl?: string): string => {\n if (environmentUrl) {\n return environmentUrl;\n }\n\n const environments = {\n test: 'https://checkoutshopper-test.adyen.com/checkoutshopper/',\n live: 'https://checkoutshopper-live.adyen.com/checkoutshopper/',\n 'live-us': 'https://checkoutshopper-live-us.adyen.com/checkoutshopper/',\n 'live-au': 'https://checkoutshopper-live-au.adyen.com/checkoutshopper/',\n 'live-apse': 'https://checkoutshopper-live-apse.adyen.com/checkoutshopper/',\n 'live-in': 'https://checkoutshopper-live-in.adyen.com/checkoutshopper/'\n };\n\n return environments[env.toLowerCase()] || FALLBACK_CONTEXT;\n};\n\nexport const FALLBACK_CDN_CONTEXT = 'https://checkoutshopper-live.adyen.com/checkoutshopper/';\nexport const resolveCDNEnvironment = (env = '', environmentUrl?: string) => {\n if (environmentUrl) {\n return environmentUrl;\n }\n\n const environments = {\n beta: 'https://cdf6519016.cdn.adyen.com/checkoutshopper/',\n test: 'https://checkoutshopper-test.adyen.com/checkoutshopper/',\n live: 'https://checkoutshopper-live.adyen.com/checkoutshopper/',\n 'live-us': 'https://checkoutshopper-live-us.adyen.com/checkoutshopper/',\n 'live-au': 'https://checkoutshopper-live-au.adyen.com/checkoutshopper/',\n 'live-apse': 'https://checkoutshopper-live-apse.adyen.com/checkoutshopper/',\n 'live-in': 'https://checkoutshopper-live-in.adyen.com/checkoutshopper/'\n };\n\n return environments[env.toLowerCase()] || FALLBACK_CDN_CONTEXT;\n};\n\nexport const FALLBACK_ANALYTICS_CONTEXT = 'https://checkoutanalytics-live.adyen.com/checkoutanalytics/';\n\nexport const resolveAnalyticsEnvironment = (env: string = FALLBACK_ANALYTICS_CONTEXT) => {\n const environments = {\n test: 'https://checkoutanalytics-test.adyen.com/checkoutanalytics/',\n live: 'https://checkoutanalytics-live.adyen.com/checkoutanalytics/',\n 'live-us': 'https://checkoutanalytics-live-us.adyen.com/checkoutanalytics/',\n 'live-au': 'https://checkoutanalytics-live-au.adyen.com/checkoutanalytics/',\n 'live-apse': 'https://checkoutanalytics-live-apse.adyen.com/checkoutanalytics/',\n 'live-in': 'https://checkoutanalytics-live-in.adyen.com/checkoutanalytics/'\n };\n\n return environments[env] || environments[env.toLowerCase()] || env;\n};\n"],"names":["FALLBACK_CONTEXT","resolveEnvironment","env","environmentUrl","test","live","toLowerCase","FALLBACK_CDN_CONTEXT","resolveCDNEnvironment","beta","FALLBACK_ANALYTICS_CONTEXT","resolveAnalyticsEnvironment","environments"],"mappings":"AAAO,MAAMA,EAAmB,0DACnBC,EAAqB,CAACC,EAAM,GAAIC,KACzC,GAAIA,EACA,OAAOA,EAYX,MATqB,CACjBC,KAAM,0DACNC,KAAM,0DACN,UAAW,6DACX,UAAW,6DACX,YAAa,+DACb,UAAW,8DAGKH,EAAII,gBAAkBN,CAAAA,EAGjCO,EAAuB,0DACvBC,EAAwB,CAACN,EAAM,GAAIC,KAC5C,GAAIA,EACA,OAAOA,EAaX,MAVqB,CACjBM,KAAM,oDACNL,KAAM,0DACNC,KAAM,0DACN,UAAW,6DACX,UAAW,6DACX,YAAa,+DACb,UAAW,8DAGKH,EAAII,gBAAkBC,CAAAA,EAGjCG,EAA6B,8DAE7BC,EAA8B,CAACT,EAAcQ,KACtD,MAAME,EAAe,CACjBR,KAAM,8DACNC,KAAM,8DACN,UAAW,iEACX,UAAW,iEACX,YAAa,mEACb,UAAW,kEAGf,OAAOO,EAAaV,IAAQU,EAAaV,EAAII,gBAAkBJ,CAAAA"}
1
+ {"version":3,"file":"Environment.js","sources":["../../../../src/core/Environment/Environment.ts"],"sourcesContent":["import { ANALYTICS_ENVIRONMENTS, API_ENVIRONMENTS, CDN_ENVIRONMENTS } from './constants';\nimport type { CoreConfiguration } from '../types';\n\nconst getUrlFromMap = (env: CoreConfiguration['environment'] = '', environmentMap: Record<string, string>, environmentUrl?: string): string => {\n if (environmentUrl) {\n return environmentUrl;\n }\n return environmentMap[env.toLowerCase()] || environmentMap.fallback;\n};\n\nexport const resolveEnvironments = (environment: CoreConfiguration['environment'], environmentsUrls?: CoreConfiguration['_environmentUrls']) => {\n const apiUrl = getUrlFromMap(environment, API_ENVIRONMENTS, environmentsUrls?.api);\n const analyticsUrl = getUrlFromMap(environment, ANALYTICS_ENVIRONMENTS, environmentsUrls?.analytics);\n const cdnImagesUrl = getUrlFromMap(environment, CDN_ENVIRONMENTS, environmentsUrls?.cdn?.images);\n const cdnTranslationsUrl =\n process.env.NODE_ENV === 'development' ? '/' : getUrlFromMap(environment, CDN_ENVIRONMENTS, environmentsUrls?.cdn?.translations);\n\n return {\n apiUrl,\n analyticsUrl,\n cdnImagesUrl,\n cdnTranslationsUrl\n };\n};\n"],"names":["getUrlFromMap","env","environmentMap","environmentUrl","toLowerCase","fallback","resolveEnvironments","environment","environmentsUrls","apiUrl","API_ENVIRONMENTS","api","analyticsUrl","ANALYTICS_ENVIRONMENTS","analytics","cdnImagesUrl","CDN_ENVIRONMENTS","cdn","images","cdnTranslationsUrl","translations"],"mappings":"oGAGA,MAAMA,EAAgB,CAACC,EAAwC,GAAIC,EAAwCC,IACnGA,IAGGD,EAAeD,EAAIG,gBAAkBF,EAAeG,UAGlDC,EAAsB,CAACC,EAA+CC,KAOxE,CACHC,OAPWT,EAAcO,EAAaG,EAAkBF,GAAkBG,KAQ1EC,aAPiBZ,EAAcO,EAAaM,EAAwBL,GAAkBM,WAQtFC,aAPiBf,EAAcO,EAAaS,EAAkBR,GAAkBS,KAAKC,QAQrFC,mBAN+CnB,EAAcO,EAAaS,EAAkBR,GAAkBS,KAAKG"}
@@ -0,0 +1,2 @@
1
+ const c={test:"https://checkoutshopper-test.adyen.com/checkoutshopper/",live:"https://checkoutshopper-live.adyen.com/checkoutshopper/","live-us":"https://checkoutshopper-live-us.adyen.com/checkoutshopper/","live-au":"https://checkoutshopper-live-au.adyen.com/checkoutshopper/","live-apse":"https://checkoutshopper-live-apse.adyen.com/checkoutshopper/","live-in":"https://checkoutshopper-live-in.adyen.com/checkoutshopper/",fallback:"https://checkoutshopper-live.adyen.com/checkoutshopper/"},e={test:"https://cdf6519016.cdn.adyen.com/checkoutshopper/",live:"https://bae81f955b.cdn.adyen.com/checkoutshopper/","live-us":"https://26280c4f4d.cdn.adyen.com/checkoutshopper/","live-au":"https://1706f728fe.cdn.adyen.com/checkoutshopper/","live-apse":"https://0688ecafff.cdn.adyen.com/checkoutshopper/","live-in":"https://0b777a1160.cdn.adyen.com/checkoutshopper/",fallback:"https://bae81f955b.cdn.adyen.com/checkoutshopper/"},t={test:"https://checkoutanalytics-test.adyen.com/checkoutanalytics/",live:"https://checkoutanalytics-live.adyen.com/checkoutanalytics/","live-us":"https://checkoutanalytics-live-us.adyen.com/checkoutanalytics/","live-au":"https://checkoutanalytics-live-au.adyen.com/checkoutanalytics/","live-apse":"https://checkoutanalytics-live-apse.adyen.com/checkoutanalytics/","live-in":"https://checkoutanalytics-live-in.adyen.com/checkoutanalytics/",fallback:"https://checkoutanalytics-live.adyen.com/checkoutanalytics/"};export{t as ANALYTICS_ENVIRONMENTS,c as API_ENVIRONMENTS,e as CDN_ENVIRONMENTS};
2
+ //# sourceMappingURL=constants.js.map