@adyen/adyen-web 6.45.2 → 6.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/dist/cjs/adyen.css +7 -7
  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 +2027 -1918
  6. package/dist/es/adyen.css +7 -7
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/ANCV/ANCV.js +1 -1
  9. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  10. package/dist/es/components/ANCV/components/ANCVInput.js +1 -1
  11. package/dist/es/components/ANCV/components/ANCVInput.js.map +1 -1
  12. package/dist/es/components/Ach/Ach.js +1 -1
  13. package/dist/es/components/Ach/Ach.js.map +1 -1
  14. package/dist/es/components/Ach/components/AchComponent.js +1 -1
  15. package/dist/es/components/Ach/components/AchComponent.js.map +1 -1
  16. package/dist/es/components/Ach/components/useSRPanelForACHErrors.js.map +1 -1
  17. package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
  18. package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
  19. package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
  20. package/dist/es/components/BacsDD/BacsDD.js +1 -1
  21. package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
  22. package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
  23. package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
  24. package/dist/es/components/BankTransfer/BankTransfer.js +1 -1
  25. package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
  26. package/dist/es/components/BankTransfer/components/BankTransferInput/BankTransferInput.js +1 -1
  27. package/dist/es/components/BankTransfer/components/BankTransferInput/BankTransferInput.js.map +1 -1
  28. package/dist/es/components/Blik/Blik.js +1 -1
  29. package/dist/es/components/Blik/Blik.js.map +1 -1
  30. package/dist/es/components/Blik/components/BlikInput.js +1 -1
  31. package/dist/es/components/Blik/components/BlikInput.js.map +1 -1
  32. package/dist/es/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  33. package/dist/es/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  34. package/dist/es/components/Card/Card.js +1 -1
  35. package/dist/es/components/Card/Card.js.map +1 -1
  36. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  37. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  38. package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
  39. package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
  40. package/dist/es/components/Card/components/CardInput/components/StoredCardFieldsWrapper.js +1 -1
  41. package/dist/es/components/Card/components/CardInput/components/StoredCardFieldsWrapper.js.map +1 -1
  42. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  43. package/dist/es/components/Card/components/CardInput/utils.js +1 -1
  44. package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
  45. package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
  46. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  47. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  48. package/dist/es/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  49. package/dist/es/components/Doku/components/DokuInput/DokuInput.js +1 -1
  50. package/dist/es/components/Doku/components/DokuInput/DokuInput.js.map +1 -1
  51. package/dist/es/components/Donation/Donation.js +1 -1
  52. package/dist/es/components/Donation/Donation.js.map +1 -1
  53. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  54. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  55. package/dist/es/components/Dragonpay/Dragonpay.js +1 -1
  56. package/dist/es/components/Dragonpay/Dragonpay.js.map +1 -1
  57. package/dist/es/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
  58. package/dist/es/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
  59. package/dist/es/components/Dropin/Dropin.js +1 -1
  60. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  61. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  62. package/dist/es/components/Econtext/Econtext.js +1 -1
  63. package/dist/es/components/Econtext/Econtext.js.map +1 -1
  64. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  65. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  66. package/dist/es/components/Giftcard/Giftcard.js +1 -1
  67. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  68. package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
  69. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  70. package/dist/es/components/Giftcard/components/GiftcardResult.js +1 -1
  71. package/dist/es/components/Giftcard/components/GiftcardResult.js.map +1 -1
  72. package/dist/es/components/Giropay/Giropay.js +1 -1
  73. package/dist/es/components/Giropay/Giropay.js.map +1 -1
  74. package/dist/es/components/Iris/Iris.js +1 -1
  75. package/dist/es/components/Iris/Iris.js.map +1 -1
  76. package/dist/es/components/Iris/components/IrisComponent.js +1 -1
  77. package/dist/es/components/Iris/components/IrisComponent.js.map +1 -1
  78. package/dist/es/components/Iris/components/IrisGenerateQRCode.js +1 -1
  79. package/dist/es/components/Iris/components/IrisGenerateQRCode.js.map +1 -1
  80. package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
  81. package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
  82. package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  83. package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  84. package/dist/es/components/MBWay/MBWay.js +1 -1
  85. package/dist/es/components/MBWay/MBWay.js.map +1 -1
  86. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  87. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  88. package/dist/es/components/Multibanco/Multibanco.js +1 -1
  89. package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
  90. package/dist/es/components/Oxxo/Oxxo.js +1 -1
  91. package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
  92. package/dist/es/components/PayByBankPix/PayByBankPix.js +1 -1
  93. package/dist/es/components/PayByBankPix/PayByBankPix.js.map +1 -1
  94. package/dist/es/components/PayByBankPix/components/Enrollment/Enrollment.js +1 -1
  95. package/dist/es/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -1
  96. package/dist/es/components/PayByBankUS/PayByBankUS.js +1 -1
  97. package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
  98. package/dist/es/components/PayPal/Paypal.js +1 -1
  99. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  100. package/dist/es/components/PayPalFastlane/Fastlane.js +1 -1
  101. package/dist/es/components/PayPalFastlane/Fastlane.js.map +1 -1
  102. package/dist/es/components/PayPalFastlane/components/FastlaneComponent.js +1 -1
  103. package/dist/es/components/PayPalFastlane/components/FastlaneComponent.js.map +1 -1
  104. package/dist/es/components/PayTo/PayTo.js +1 -1
  105. package/dist/es/components/PayTo/PayTo.js.map +1 -1
  106. package/dist/es/components/PayTo/components/BSBInput.js +1 -1
  107. package/dist/es/components/PayTo/components/BSBInput.js.map +1 -1
  108. package/dist/es/components/PayTo/components/PayToComponent.js +1 -1
  109. package/dist/es/components/PayTo/components/PayToComponent.js.map +1 -1
  110. package/dist/es/components/PayTo/components/PayToNameFields.js +1 -1
  111. package/dist/es/components/PayTo/components/PayToNameFields.js.map +1 -1
  112. package/dist/es/components/PayTo/components/PayToPhone.js +1 -1
  113. package/dist/es/components/PayTo/components/PayToPhone.js.map +1 -1
  114. package/dist/es/components/Pix/Pix.js +1 -1
  115. package/dist/es/components/Pix/Pix.js.map +1 -1
  116. package/dist/es/components/Pix/components/PixInput/PixInput.js +1 -1
  117. package/dist/es/components/Pix/components/PixInput/PixInput.js.map +1 -1
  118. package/dist/es/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js +1 -1
  119. package/dist/es/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
  120. package/dist/es/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js +1 -1
  121. package/dist/es/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js.map +1 -1
  122. package/dist/es/components/Redirect/Redirect.js +1 -1
  123. package/dist/es/components/Redirect/Redirect.js.map +1 -1
  124. package/dist/es/components/Sepa/Sepa.js.map +1 -1
  125. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  126. package/dist/es/components/Trustly/Trustly.js +1 -1
  127. package/dist/es/components/Trustly/Trustly.js.map +1 -1
  128. package/dist/es/components/UPI/UPI.js +1 -1
  129. package/dist/es/components/UPI/UPI.js.map +1 -1
  130. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  131. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  132. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  133. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  134. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  135. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  136. package/dist/es/components/internal/Address/components/CountryField.js.map +1 -1
  137. package/dist/es/components/internal/Address/components/FieldContainer.js +1 -1
  138. package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
  139. package/dist/es/components/internal/Address/components/StateField.js.map +1 -1
  140. package/dist/es/components/internal/Address/constants.js +1 -1
  141. package/dist/es/components/internal/Address/constants.js.map +1 -1
  142. package/dist/es/components/internal/Address/validate.formats.js +1 -1
  143. package/dist/es/components/internal/Address/validate.formats.js.map +1 -1
  144. package/dist/es/components/internal/Address/validate.js +1 -1
  145. package/dist/es/components/internal/Address/validate.js.map +1 -1
  146. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  147. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  148. package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js +1 -1
  149. package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
  150. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  151. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  152. package/dist/es/components/internal/DisclaimerMessage/utils.js +2 -0
  153. package/dist/es/components/internal/DisclaimerMessage/utils.js.map +1 -0
  154. package/dist/es/components/internal/FormFields/utils.js +1 -1
  155. package/dist/es/components/internal/FormFields/utils.js.map +1 -1
  156. package/dist/es/components/internal/IbanInput/IbanInput.js +1 -1
  157. package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
  158. package/dist/es/components/internal/IbanInput/validate.js +1 -1
  159. package/dist/es/components/internal/IbanInput/validate.js.map +1 -1
  160. package/dist/es/components/internal/IssuerList/IssuerList.js +1 -1
  161. package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
  162. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  163. package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  164. package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
  165. package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -1
  166. package/dist/es/components/internal/PayButton/PayButton.js +1 -1
  167. package/dist/es/components/internal/PayButton/PayButton.js.map +1 -1
  168. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  169. package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  170. package/dist/es/components/internal/PhoneInput/usePhonePrefixes.js.map +1 -1
  171. package/dist/es/components/internal/RedirectButton/RedirectButton.js +1 -1
  172. package/dist/es/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  173. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  174. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  175. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  176. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  177. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  178. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  179. package/dist/es/components/internal/UIElement/utils.js +1 -1
  180. package/dist/es/components/internal/UIElement/utils.js.map +1 -1
  181. package/dist/es/core/Analytics/events/AnalyticsInfoEvent.js +1 -1
  182. package/dist/es/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
  183. package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
  184. package/dist/es/core/Errors/SRPanelProvider.js.map +1 -1
  185. package/dist/es/core/RiskModule/RiskModule.js +1 -1
  186. package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
  187. package/dist/es/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  188. package/dist/es/core/Services/get-dataset.js.map +1 -1
  189. package/dist/es/core/Services/http.js +1 -1
  190. package/dist/es/core/Services/http.js.map +1 -1
  191. package/dist/es/core/config.js +1 -1
  192. package/dist/es/core/config.js.map +1 -1
  193. package/dist/es/core/core.js.map +1 -1
  194. package/dist/es/core/core.registry.js +1 -1
  195. package/dist/es/core/core.registry.js.map +1 -1
  196. package/dist/es/core/utils.js +1 -1
  197. package/dist/es/core/utils.js.map +1 -1
  198. package/dist/es/index.d.ts +2027 -1918
  199. package/dist/es/packages/server/translations/en-US.json.js +1 -1
  200. package/dist/es/utils/Validator/Validator.js +1 -1
  201. package/dist/es/utils/Validator/Validator.js.map +1 -1
  202. package/dist/es/utils/useForm/reducer.js +1 -1
  203. package/dist/es/utils/useForm/reducer.js.map +1 -1
  204. package/dist/es/utils/useForm/useForm.js +1 -1
  205. package/dist/es/utils/useForm/useForm.js.map +1 -1
  206. package/dist/es/utils/useForm/useFormWithA11y.js +1 -1
  207. package/dist/es/utils/useForm/useFormWithA11y.js.map +1 -1
  208. package/dist/es-legacy/adyen.css +7 -7
  209. package/dist/es-legacy/adyen.css.map +1 -1
  210. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  211. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  212. package/dist/es-legacy/components/ANCV/components/ANCVInput.js +1 -1
  213. package/dist/es-legacy/components/ANCV/components/ANCVInput.js.map +1 -1
  214. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  215. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  216. package/dist/es-legacy/components/Ach/components/AchComponent.js +1 -1
  217. package/dist/es-legacy/components/Ach/components/AchComponent.js.map +1 -1
  218. package/dist/es-legacy/components/Ach/components/useSRPanelForACHErrors.js.map +1 -1
  219. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  220. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  221. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  222. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  223. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  224. package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
  225. package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
  226. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  227. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  228. package/dist/es-legacy/components/BankTransfer/components/BankTransferInput/BankTransferInput.js +1 -1
  229. package/dist/es-legacy/components/BankTransfer/components/BankTransferInput/BankTransferInput.js.map +1 -1
  230. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  231. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  232. package/dist/es-legacy/components/Blik/components/BlikInput.js +1 -1
  233. package/dist/es-legacy/components/Blik/components/BlikInput.js.map +1 -1
  234. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  235. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  236. package/dist/es-legacy/components/Card/Card.js +1 -1
  237. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  238. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  239. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  240. package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
  241. package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
  242. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFieldsWrapper.js +1 -1
  243. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFieldsWrapper.js.map +1 -1
  244. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  245. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  246. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  247. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  248. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  249. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  250. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  251. package/dist/es-legacy/components/Doku/components/DokuInput/DokuInput.js +1 -1
  252. package/dist/es-legacy/components/Doku/components/DokuInput/DokuInput.js.map +1 -1
  253. package/dist/es-legacy/components/Donation/Donation.js +1 -1
  254. package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
  255. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  256. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  257. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  258. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  259. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
  260. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
  261. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  262. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  263. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  264. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  265. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  266. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  267. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  268. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  269. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  270. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
  271. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  272. package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js +1 -1
  273. package/dist/es-legacy/components/Giftcard/components/GiftcardResult.js.map +1 -1
  274. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  275. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  276. package/dist/es-legacy/components/Iris/Iris.js +1 -1
  277. package/dist/es-legacy/components/Iris/Iris.js.map +1 -1
  278. package/dist/es-legacy/components/Iris/components/IrisComponent.js +1 -1
  279. package/dist/es-legacy/components/Iris/components/IrisComponent.js.map +1 -1
  280. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.js +1 -1
  281. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.js.map +1 -1
  282. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  283. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  284. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  285. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  286. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  287. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  288. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  289. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  290. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  291. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  292. package/dist/es-legacy/components/Oxxo/Oxxo.js +1 -1
  293. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  294. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +1 -1
  295. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -1
  296. package/dist/es-legacy/components/PayByBankPix/components/Enrollment/Enrollment.js +1 -1
  297. package/dist/es-legacy/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -1
  298. package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js +1 -1
  299. package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js.map +1 -1
  300. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  301. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  302. package/dist/es-legacy/components/PayPalFastlane/Fastlane.js +1 -1
  303. package/dist/es-legacy/components/PayPalFastlane/Fastlane.js.map +1 -1
  304. package/dist/es-legacy/components/PayPalFastlane/components/FastlaneComponent.js +1 -1
  305. package/dist/es-legacy/components/PayPalFastlane/components/FastlaneComponent.js.map +1 -1
  306. package/dist/es-legacy/components/PayTo/PayTo.js +1 -1
  307. package/dist/es-legacy/components/PayTo/PayTo.js.map +1 -1
  308. package/dist/es-legacy/components/PayTo/components/BSBInput.js +1 -1
  309. package/dist/es-legacy/components/PayTo/components/BSBInput.js.map +1 -1
  310. package/dist/es-legacy/components/PayTo/components/PayToComponent.js +1 -1
  311. package/dist/es-legacy/components/PayTo/components/PayToComponent.js.map +1 -1
  312. package/dist/es-legacy/components/PayTo/components/PayToNameFields.js +1 -1
  313. package/dist/es-legacy/components/PayTo/components/PayToNameFields.js.map +1 -1
  314. package/dist/es-legacy/components/PayTo/components/PayToPhone.js +1 -1
  315. package/dist/es-legacy/components/PayTo/components/PayToPhone.js.map +1 -1
  316. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  317. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  318. package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js +1 -1
  319. package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js.map +1 -1
  320. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js +1 -1
  321. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
  322. package/dist/es-legacy/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js +1 -1
  323. package/dist/es-legacy/components/PreAuthorizedDebitCanada/components/PreAuthorizedDebitCanadaComponent.js.map +1 -1
  324. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  325. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  326. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  327. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  328. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  329. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  330. package/dist/es-legacy/components/UPI/UPI.js +1 -1
  331. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  332. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  333. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  334. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  335. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  336. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  337. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  338. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  339. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js +1 -1
  340. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
  341. package/dist/es-legacy/components/internal/Address/components/StateField.js.map +1 -1
  342. package/dist/es-legacy/components/internal/Address/constants.js +1 -1
  343. package/dist/es-legacy/components/internal/Address/constants.js.map +1 -1
  344. package/dist/es-legacy/components/internal/Address/validate.formats.js +1 -1
  345. package/dist/es-legacy/components/internal/Address/validate.formats.js.map +1 -1
  346. package/dist/es-legacy/components/internal/Address/validate.js +1 -1
  347. package/dist/es-legacy/components/internal/Address/validate.js.map +1 -1
  348. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  349. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  350. package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js +1 -1
  351. package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLoginInput.js.map +1 -1
  352. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  353. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  354. package/dist/es-legacy/components/internal/DisclaimerMessage/utils.js +2 -0
  355. package/dist/es-legacy/components/internal/DisclaimerMessage/utils.js.map +1 -0
  356. package/dist/es-legacy/components/internal/FormFields/utils.js +1 -1
  357. package/dist/es-legacy/components/internal/FormFields/utils.js.map +1 -1
  358. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  359. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  360. package/dist/es-legacy/components/internal/IbanInput/validate.js +1 -1
  361. package/dist/es-legacy/components/internal/IbanInput/validate.js.map +1 -1
  362. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js +1 -1
  363. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
  364. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  365. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  366. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
  367. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -1
  368. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  369. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  370. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  371. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  372. package/dist/es-legacy/components/internal/PhoneInput/usePhonePrefixes.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/lib/securedField/SecuredField.js +1 -1
  378. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  379. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  380. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  381. package/dist/es-legacy/components/internal/UIElement/utils.js +1 -1
  382. package/dist/es-legacy/components/internal/UIElement/utils.js.map +1 -1
  383. package/dist/es-legacy/core/Analytics/events/AnalyticsInfoEvent.js +1 -1
  384. package/dist/es-legacy/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
  385. package/dist/es-legacy/core/Errors/AdyenCheckoutError.js.map +1 -1
  386. package/dist/es-legacy/core/Errors/SRPanelProvider.js.map +1 -1
  387. package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
  388. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  389. package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  390. package/dist/es-legacy/core/Services/get-dataset.js.map +1 -1
  391. package/dist/es-legacy/core/Services/http.js +1 -1
  392. package/dist/es-legacy/core/Services/http.js.map +1 -1
  393. package/dist/es-legacy/core/config.js +1 -1
  394. package/dist/es-legacy/core/config.js.map +1 -1
  395. package/dist/es-legacy/core/core.js.map +1 -1
  396. package/dist/es-legacy/core/core.registry.js +1 -1
  397. package/dist/es-legacy/core/core.registry.js.map +1 -1
  398. package/dist/es-legacy/core/utils.js +1 -1
  399. package/dist/es-legacy/core/utils.js.map +1 -1
  400. package/dist/es-legacy/packages/server/translations/en-US.json.js +1 -1
  401. package/dist/es-legacy/utils/Validator/Validator.js +1 -1
  402. package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
  403. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  404. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  405. package/dist/es-legacy/utils/useForm/useForm.js +1 -1
  406. package/dist/es-legacy/utils/useForm/useForm.js.map +1 -1
  407. package/dist/es-legacy/utils/useForm/useFormWithA11y.js +1 -1
  408. package/dist/es-legacy/utils/useForm/useFormWithA11y.js.map +1 -1
  409. package/package.json +12 -12
  410. package/styles/adyen.css +7 -7
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../external/preact/dist/preact.js";import t from"../../components/internal/BaseElement/BaseElement.js";import n from"./components/DeviceFingerprint/DeviceFingerprint.js";import o from"../../utils/base64.js";import{RISK_DATA_VERSION as s,DEVICE_FINGERPRINT as r}from"./constants.js";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class a extends t{formatProps(e){return{...e,risk:{...a.defaultProps.risk,...e.risk}}}get isValid(){return this.state.isValid}get data(){if(this.isValid){const e={version:s,...this.state.data};return o.encode(JSON.stringify(e))}return!1}get enabled(){return this.props.risk.enabled}componentWillUnmount(){this.cleanUp()}render(){return e(n,{...this.props,loadingContext:this.props.loadingContext,onComplete:this.onComplete,onError:this.onError})}constructor(e,t){super(e,t),i(this,"nodeRiskContainer",null),i(this,"onComplete",e=>{const t={...this.state.data,[e.type]:e.value,persistentCookie:e.persistentCookie,components:e.components};this.setState({data:t,isValid:!0}),this.props.risk.onComplete(this.data),this.cleanUp()}),i(this,"onError",e=>{this.props.risk.onError(e),this.cleanUp()}),i(this,"cleanUp",()=>{this.nodeRiskContainer&&this.nodeRiskContainer.parentNode&&this.nodeRiskContainer.parentNode.removeChild(this.nodeRiskContainer)});const n={[r]:null};this.setState({data:n}),!0===this.props.risk.enabled&&(document.querySelector(this.props.risk.node)?(this.nodeRiskContainer=document.createElement("div"),document.querySelector(this.props.risk.node).appendChild(this.nodeRiskContainer),this.mount(this.nodeRiskContainer)):this.onError({message:"RiskModule node was not found"}))}}i(a,"type","risk"),i(a,"defaultProps",{risk:{enabled:!0,onComplete:()=>{},onError:()=>{},node:"body"}});export{a as default};
1
+ import{createElement as e}from"../../external/preact/dist/preact.js";import t from"../../components/internal/BaseElement/BaseElement.js";import n from"./components/DeviceFingerprint/DeviceFingerprint.js";import s from"../../utils/base64.js";import{RISK_DATA_VERSION as o,DEVICE_FINGERPRINT as r}from"./constants.js";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class a extends t{formatProps(e){return{...e,risk:{...a.defaultProps.risk,...e.risk}}}get isValid(){return this.state.isValid}get riskData(){if(!this.isValid)return null;const e={version:o,...this.state.data};return s.encode(JSON.stringify(e))}get enabled(){return this.props.risk.enabled}componentWillUnmount(){this.cleanUp()}render(){return e(n,{...this.props,loadingContext:this.props.loadingContext,onComplete:this.onComplete,onError:this.onError})}constructor(e,t){super(e,t),i(this,"nodeRiskContainer",null),i(this,"onComplete",e=>{const t={...this.state.data,[e.type]:e.value,persistentCookie:e.persistentCookie,components:e.components};this.setState({data:t,isValid:!0}),this.props.risk.onComplete(this.riskData),this.cleanUp()}),i(this,"onError",e=>{this.props.risk.onError(e),this.cleanUp()}),i(this,"cleanUp",()=>{this.nodeRiskContainer&&this.nodeRiskContainer.parentNode&&this.nodeRiskContainer.parentNode.removeChild(this.nodeRiskContainer)});const n={[r]:null};this.setState({data:n}),!0===this.props.risk.enabled&&(document.querySelector(this.props.risk.node)?(this.nodeRiskContainer=document.createElement("div"),document.querySelector(this.props.risk.node).appendChild(this.nodeRiskContainer),this.mount(this.nodeRiskContainer)):this.onError({message:"RiskModule node was not found"}))}}i(a,"type","risk"),i(a,"defaultProps",{risk:{enabled:!0,onComplete:()=>{},onError:()=>{},node:"body"}});export{a as default};
2
2
  //# sourceMappingURL=RiskModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RiskModule.js","sources":["../../../../src/core/RiskModule/RiskModule.tsx"],"sourcesContent":["import { h } from 'preact';\nimport BaseElement from '../../components/internal/BaseElement/BaseElement';\nimport DeviceFingerprint from './components/DeviceFingerprint';\nimport base64 from '../../utils/base64';\nimport { RISK_DATA_VERSION, DEVICE_FINGERPRINT } from './constants';\nimport { BaseElementProps } from '../../components/internal/BaseElement/types';\nimport type { ICore } from '../types';\n\nexport interface RiskModuleOptions {\n enabled: boolean;\n onComplete?: (data) => void;\n onError?: (error) => void;\n node?: string;\n}\n\ninterface RiskModuleProps extends BaseElementProps {\n risk: RiskModuleOptions;\n loadingContext: string;\n}\n\nexport type RiskData = string | boolean;\n\nexport default class RiskElement extends BaseElement<RiskModuleProps> {\n public static readonly type = 'risk';\n public static readonly defaultProps = {\n risk: {\n enabled: true,\n onComplete: () => {},\n onError: () => {},\n node: 'body'\n }\n };\n\n private nodeRiskContainer = null;\n\n constructor(checkout: ICore, props?) {\n super(checkout, props);\n\n // Populate state with null values\n const riskElements = {\n [DEVICE_FINGERPRINT]: null\n };\n\n this.setState({ data: riskElements });\n\n if (this.props.risk.enabled === true) {\n if (document.querySelector(this.props.risk.node)) {\n this.nodeRiskContainer = document.createElement('div');\n document.querySelector(this.props.risk.node).appendChild(this.nodeRiskContainer);\n this.mount(this.nodeRiskContainer);\n } else {\n this.onError({ message: 'RiskModule node was not found' });\n }\n }\n }\n\n formatProps(props) {\n return {\n ...props,\n risk: {\n ...RiskElement.defaultProps.risk,\n ...props.risk\n }\n };\n }\n\n public onComplete = result => {\n const data = { ...this.state.data, [result.type]: result.value, persistentCookie: result.persistentCookie, components: result.components };\n this.setState({ data, isValid: true });\n this.props.risk.onComplete(this.data);\n this.cleanUp();\n };\n\n public onError = error => {\n this.props.risk.onError(error);\n this.cleanUp();\n };\n\n get isValid() {\n return this.state.isValid;\n }\n\n get data(): any {\n if (this.isValid) {\n const dataObj = { version: RISK_DATA_VERSION, ...this.state.data };\n return base64.encode(JSON.stringify(dataObj));\n }\n\n return false;\n }\n\n public get enabled() {\n return this.props.risk.enabled;\n }\n\n public cleanUp = () => {\n if (this.nodeRiskContainer && this.nodeRiskContainer.parentNode) this.nodeRiskContainer.parentNode.removeChild(this.nodeRiskContainer);\n };\n\n componentWillUnmount() {\n this.cleanUp();\n }\n\n render() {\n return <DeviceFingerprint {...this.props} loadingContext={this.props.loadingContext} onComplete={this.onComplete} onError={this.onError} />;\n }\n}\n"],"names":["RiskElement","BaseElement","formatProps","props","risk","defaultProps","isValid","this","state","data","dataObj","version","RISK_DATA_VERSION","base64","encode","JSON","stringify","enabled","componentWillUnmount","cleanUp","render","h","DeviceFingerprint","loadingContext","onComplete","onError","constructor","checkout","super","_define_property","nodeRiskContainer","result","type","value","persistentCookie","components","setState","error","parentNode","removeChild","riskElements","DEVICE_FINGERPRINT","document","querySelector","node","createElement","appendChild","mount","message"],"mappings":"obAsBe,MAAMA,UAAoBC,EAkCrCC,WAAAA,CAAYC,GACR,MAAO,IACAA,EACHC,KAAM,IACCJ,EAAYK,aAAaD,QACzB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SAASC,cAAcpC,KAAKJ,MAAMC,KAAKwC,MAAME,YAAYvC,KAAKuB,mBAC9DvB,KAAKwC,MAAMxC,KAAKuB,oBAEhBvB,KAAKkB,QAAQ,CAAEuB,QAAS,kCAGpC,EA/BAnB,EADiB7B,EACMgC,OAAO,QAC9BH,EAFiB7B,EAEMK,eAAe,CAClCD,KAAM,CACFa,SAAS,EACTO,WAAY,OACZC,QAAS,OACTmB,KAAM"}
1
+ {"version":3,"file":"RiskModule.js","sources":["../../../../src/core/RiskModule/RiskModule.tsx"],"sourcesContent":["import { h } from 'preact';\nimport BaseElement from '../../components/internal/BaseElement/BaseElement';\nimport DeviceFingerprint from './components/DeviceFingerprint';\nimport base64 from '../../utils/base64';\nimport { RISK_DATA_VERSION, DEVICE_FINGERPRINT } from './constants';\nimport { BaseElementProps } from '../../components/internal/BaseElement/types';\nimport type { ICore } from '../types';\n\nexport interface RiskModuleOptions {\n enabled: boolean;\n onComplete?: (riskData: string | null) => void;\n onError?: (error) => void;\n node?: string;\n}\n\ninterface RiskModuleProps extends BaseElementProps {\n risk: RiskModuleOptions;\n loadingContext: string;\n}\n\nexport default class RiskElement extends BaseElement<RiskModuleProps> {\n public static readonly type = 'risk';\n public static readonly defaultProps = {\n risk: {\n enabled: true,\n onComplete: () => {},\n onError: () => {},\n node: 'body'\n }\n };\n\n private nodeRiskContainer = null;\n\n constructor(checkout: ICore, props?) {\n super(checkout, props);\n\n // Populate state with null values\n const riskElements = {\n [DEVICE_FINGERPRINT]: null\n };\n\n this.setState({ data: riskElements });\n\n if (this.props.risk.enabled === true) {\n if (document.querySelector(this.props.risk.node)) {\n this.nodeRiskContainer = document.createElement('div');\n document.querySelector(this.props.risk.node).appendChild(this.nodeRiskContainer);\n this.mount(this.nodeRiskContainer);\n } else {\n this.onError({ message: 'RiskModule node was not found' });\n }\n }\n }\n\n formatProps(props) {\n return {\n ...props,\n risk: {\n ...RiskElement.defaultProps.risk,\n ...props.risk\n }\n };\n }\n\n public onComplete = result => {\n const data = { ...this.state.data, [result.type]: result.value, persistentCookie: result.persistentCookie, components: result.components };\n this.setState({ data, isValid: true });\n this.props.risk.onComplete(this.riskData);\n this.cleanUp();\n };\n\n public onError = error => {\n this.props.risk.onError(error);\n this.cleanUp();\n };\n\n get isValid() {\n return this.state.isValid;\n }\n\n /**\n * Returns the base64 encoded device fingerprint data, or null if the fingerprinting did not complete\n */\n public get riskData(): string | null {\n if (!this.isValid) return null;\n\n const dataObj = { version: RISK_DATA_VERSION, ...this.state.data };\n return base64.encode(JSON.stringify(dataObj));\n }\n\n public get enabled() {\n return this.props.risk.enabled;\n }\n\n public cleanUp = () => {\n if (this.nodeRiskContainer && this.nodeRiskContainer.parentNode) this.nodeRiskContainer.parentNode.removeChild(this.nodeRiskContainer);\n };\n\n componentWillUnmount() {\n this.cleanUp();\n }\n\n render() {\n return <DeviceFingerprint {...this.props} loadingContext={this.props.loadingContext} onComplete={this.onComplete} onError={this.onError} />;\n }\n}\n"],"names":["RiskElement","BaseElement","formatProps","props","risk","defaultProps","isValid","this","state","riskData","dataObj","version","RISK_DATA_VERSION","data","base64","encode","JSON","stringify","enabled","componentWillUnmount","cleanUp","render","h","DeviceFingerprint","loadingContext","onComplete","onError","constructor","checkout","super","_define_property","nodeRiskContainer","result","type","value","persistentCookie","components","setState","error","parentNode","removeChild","riskElements","DEVICE_FINGERPRINT","document","querySelector","node","createElement","appendChild","mount","message"],"mappings":"obAoBe,MAAMA,UAAoBC,EAkCrCC,WAAAA,CAAYC,GACR,MAAO,IACAA,EACHC,KAAM,IACCJ,EAAYK,aAAaD,QACzBD,EAAMC,MAGrB,CAcA,WAAIE,GACA,OAAOC,KAAKC,MAAMF,OACtB,CAKA,YAAWG,GACP,IAAKF,KAAKD,QAAS,OAAO,KAE1B,MAAMI,EAAU,CAAEC,QAASC,KAAsBL,KAAKC,MAAMK,MAC5D,OAAOC,EAAOC,OAAOC,KAAKC,UAAUP,GACxC,CAEA,WAAWQ,GACP,OAAOX,KAAKJ,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AS,OACTmB,KAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"GetDeviceFingerprint.js","sources":["../../../../../../src/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport Iframe from '../../../../components/internal/IFrame';\nimport promiseTimeout from '../../../../utils/promiseTimeout';\nimport { DEVICE_FINGERPRINT, DF_TIMEOUT, FAILED_DFP_RESOLVE_OBJECT_TIMEOUT } from '../../constants';\nimport getProcessMessageHandler from '../../../../utils/get-process-message-handler';\nimport { getOrigin } from '../../../../utils/getOrigin';\nimport { GetDeviceFingerprintProps } from './types';\n\nconst iframeName = 'dfIframe';\nconst allowProperties = 'geolocation; microphone; camera;';\n\nclass GetDeviceFingerprint extends Component<GetDeviceFingerprintProps> {\n public postMessageDomain;\n public processMessageHandler;\n public deviceFingerPrintPromise;\n\n constructor(props) {\n super(props);\n\n this.postMessageDomain = getOrigin(this.props.loadingContext) || this.props.loadingContext;\n }\n\n getDfpPromise(): Promise<any> {\n return new Promise((resolve, reject) => {\n /**\n * Listen for postMessage responses from the notification url\n */\n this.processMessageHandler = getProcessMessageHandler(this.postMessageDomain, resolve, reject, DEVICE_FINGERPRINT);\n\n window.addEventListener('message', this.processMessageHandler);\n });\n }\n\n componentDidMount() {\n // Get device fingerprint\n this.deviceFingerPrintPromise = promiseTimeout(DF_TIMEOUT, this.getDfpPromise(), FAILED_DFP_RESOLVE_OBJECT_TIMEOUT);\n this.deviceFingerPrintPromise.promise\n .then(resolveObject => {\n this.props.onCompleteFingerprint(resolveObject);\n window.removeEventListener('message', this.processMessageHandler);\n })\n .catch(rejectObject => {\n this.props.onErrorFingerprint(rejectObject);\n window.removeEventListener('message', this.processMessageHandler);\n });\n }\n\n render({ dfpURL }) {\n return (\n <div className=\"adyen-checkout-risk__device-fingerprint\">\n <Iframe name={iframeName} src={dfpURL} allow={allowProperties} title=\"devicefingerprinting iframe\" />\n </div>\n );\n }\n}\n\nexport default GetDeviceFingerprint;\n"],"names":["GetDeviceFingerprint","Component","getDfpPromise","Promise","resolve","reject","this","processMessageHandler","getProcessMessageHandler","postMessageDomain","DEVICE_FINGERPRINT","window","addEventListener","componentDidMount","deviceFingerPrintPromise","promiseTimeout","DF_TIMEOUT","FAILED_DFP_RESOLVE_OBJECT_TIMEOUT","promise","then","resolveObject","props","onCompleteFingerprint","removeEventListener","catch","rejectObject","onErrorFingerprint","render","dfpURL","h","div","className","Iframe","name","src","allow","title","constructor","super","_define_property","getOrigin","loadingContext"],"mappings":"+iBAWA,MAAMA,UAA6BC,EAW/BC,aAAAA,GACI,OAAO,IAAIC,QAAQ,CAACC,EAASC,KAIzBC,KAAKC,sBAAwBC,EAAyBF,KAAKG,kBAAmBL,EAASC,EAAQK,GAE/FC,OAAOC,iBAAiB,UAAWN,KAAKC,wBAEhD,CAEAM,iBAAAA,GAEIP,KAAKQ,yBAA2BC,EAAeC,EAAYV,KAAKJ,gBAAiBe,GACjFX,KAAKQ,yBAAyBI,QACzBC,KAAKC,IACFd,KAAKe,MAAMC,sBAAsBF,GACjCT,OAAOY,oBAAoB,UAAWjB,KAAKC,yBAE9CiB,MAAMC,IACHnB,KAAKe,MAAMK,mBAAmBD,GAC9Bd,OAAOY,oBAAoB,UAAWjB,KAAKC,wBAEvD,CAEAoB,MAAAA,EAAOC,OAAEA,IACL,OACIC,EAACC,MAAAA,CAAIC,UAAU,2CACXF,EAACG,EAAAA,CAAOC,KA1CL,WA0CuBC,IAAKN,EAAQO,MAzC/B,mCAyCuDC,MAAM,gCAGjF,CArCA,WAAAC,CAAYhB,GACRiB,MAAMjB,GALVkB,EAAAjC,KAAOG,yBAAP,GACA8B,EAAAjC,KAAOC,6BAAP,GACAgC,EAAAjC,KAAOQ,mCAKHR,KAAKG,kBAAoB+B,EAAUlC,KAAKe,MAAMoB,iBAAmBnC,KAAKe,MAAMoB,cAChF"}
1
+ {"version":3,"file":"GetDeviceFingerprint.js","sources":["../../../../../../src/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport Iframe from '../../../../components/internal/IFrame';\nimport promiseTimeout from '../../../../utils/promiseTimeout';\nimport { DEVICE_FINGERPRINT, DF_TIMEOUT, FAILED_DFP_RESOLVE_OBJECT_TIMEOUT } from '../../constants';\nimport getProcessMessageHandler from '../../../../utils/get-process-message-handler';\nimport { getOrigin } from '../../../../utils/getOrigin';\nimport { GetDeviceFingerprintProps } from './types';\n\nconst iframeName = 'dfIframe';\nconst allowProperties = 'geolocation; microphone; camera;';\n\nclass GetDeviceFingerprint extends Component<GetDeviceFingerprintProps> {\n public postMessageDomain;\n public processMessageHandler;\n public deviceFingerPrintPromise;\n\n constructor(props) {\n super(props);\n\n this.postMessageDomain = getOrigin(this.props.loadingContext) || this.props.loadingContext;\n }\n\n getDfpPromise(): Promise<unknown> {\n return new Promise((resolve, reject) => {\n /**\n * Listen for postMessage responses from the notification url\n */\n this.processMessageHandler = getProcessMessageHandler(this.postMessageDomain, resolve, reject, DEVICE_FINGERPRINT);\n\n window.addEventListener('message', this.processMessageHandler);\n });\n }\n\n componentDidMount() {\n // Get device fingerprint\n this.deviceFingerPrintPromise = promiseTimeout(DF_TIMEOUT, this.getDfpPromise(), FAILED_DFP_RESOLVE_OBJECT_TIMEOUT);\n this.deviceFingerPrintPromise.promise\n .then(resolveObject => {\n this.props.onCompleteFingerprint(resolveObject);\n window.removeEventListener('message', this.processMessageHandler);\n })\n .catch(rejectObject => {\n this.props.onErrorFingerprint(rejectObject);\n window.removeEventListener('message', this.processMessageHandler);\n });\n }\n\n render({ dfpURL }) {\n return (\n <div className=\"adyen-checkout-risk__device-fingerprint\">\n <Iframe name={iframeName} src={dfpURL} allow={allowProperties} title=\"devicefingerprinting iframe\" />\n </div>\n );\n }\n}\n\nexport default GetDeviceFingerprint;\n"],"names":["GetDeviceFingerprint","Component","getDfpPromise","Promise","resolve","reject","this","processMessageHandler","getProcessMessageHandler","postMessageDomain","DEVICE_FINGERPRINT","window","addEventListener","componentDidMount","deviceFingerPrintPromise","promiseTimeout","DF_TIMEOUT","FAILED_DFP_RESOLVE_OBJECT_TIMEOUT","promise","then","resolveObject","props","onCompleteFingerprint","removeEventListener","catch","rejectObject","onErrorFingerprint","render","dfpURL","h","div","className","Iframe","name","src","allow","title","constructor","super","_define_property","getOrigin","loadingContext"],"mappings":"+iBAWA,MAAMA,UAA6BC,EAW/BC,aAAAA,GACI,OAAO,IAAIC,QAAQ,CAACC,EAASC,KAIzBC,KAAKC,sBAAwBC,EAAyBF,KAAKG,kBAAmBL,EAASC,EAAQK,GAE/FC,OAAOC,iBAAiB,UAAWN,KAAKC,wBAEhD,CAEAM,iBAAAA,GAEIP,KAAKQ,yBAA2BC,EAAeC,EAAYV,KAAKJ,gBAAiBe,GACjFX,KAAKQ,yBAAyBI,QACzBC,KAAKC,IACFd,KAAKe,MAAMC,sBAAsBF,GACjCT,OAAOY,oBAAoB,UAAWjB,KAAKC,yBAE9CiB,MAAMC,IACHnB,KAAKe,MAAMK,mBAAmBD,GAC9Bd,OAAOY,oBAAoB,UAAWjB,KAAKC,wBAEvD,CAEAoB,MAAAA,EAAOC,OAAEA,IACL,OACIC,EAACC,MAAAA,CAAIC,UAAU,2CACXF,EAACG,EAAAA,CAAOC,KA1CL,WA0CuBC,IAAKN,EAAQO,MAzC/B,mCAyCuDC,MAAM,gCAGjF,CArCA,WAAAC,CAAYhB,GACRiB,MAAMjB,GALVkB,EAAAjC,KAAOG,yBAAP,GACA8B,EAAAjC,KAAOC,6BAAP,GACAgC,EAAAjC,KAAOQ,mCAKHR,KAAKG,kBAAoB+B,EAAUlC,KAAKe,MAAMoB,iBAAmBnC,KAAKe,MAAMoB,cAChF"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-dataset.js","sources":["../../../../src/core/Services/get-dataset.ts"],"sourcesContent":["import { httpGet } from './http';\n\nexport default function getDataset(name: string, loadingContext, locale?) {\n const options = {\n loadingContext,\n errorLevel: 'warn' as const,\n errorMessage: `Dataset ${name} is not available`,\n path: locale ? `datasets/${name}/${locale}.json` : `datasets/${name}.json`\n };\n\n return httpGet(options);\n}\n"],"names":["getDataset","name","loadingContext","locale","httpGet","errorLevel","errorMessage","path"],"mappings":"oCAEe,SAASA,EAAWC,EAAcC,EAAgBC,GAQ7D,OAAOC,EAPS,CACZF,iBACAG,WAAY,OACZC,aAAc,WAAWL,qBACzBM,KAAMJ,EAAS,YAAYF,KAAQE,SAAgB,YAAYF,UAIvE"}
1
+ {"version":3,"file":"get-dataset.js","sources":["../../../../src/core/Services/get-dataset.ts"],"sourcesContent":["import { httpGet } from './http';\nimport type { DataSet } from './data-set';\n\nexport default function getDataset<T = DataSet>(name: string, loadingContext: string, locale?: string): Promise<T> {\n const options = {\n loadingContext,\n errorLevel: 'warn' as const,\n errorMessage: `Dataset ${name} is not available`,\n path: locale ? `datasets/${name}/${locale}.json` : `datasets/${name}.json`\n };\n\n return httpGet<T>(options);\n}\n"],"names":["getDataset","name","loadingContext","locale","httpGet","errorLevel","errorMessage","path"],"mappings":"oCAGe,SAASA,EAAwBC,EAAcC,EAAwBC,GAQlF,OAAOC,EAPS,CACZF,iBACAG,WAAY,OACZC,aAAc,WAAWL,qBACzBM,KAAMJ,EAAS,YAAYF,KAAQE,SAAgB,YAAYF,UAIvE"}
@@ -1,2 +1,2 @@
1
- import{DEFAULT_HTTP_TIMEOUT as e,FALLBACK_CONTEXT as r}from"../config.js";import o from"../Errors/AdyenCheckoutError.js";function t(t,n){const{headers:s=[],errorLevel:i="warn",errorCode:c,loadingContext:l=r,method:d="GET",path:u,timeout:f=e}=t,m={method:d,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":"POST"===d?"application/json":"text/plain",...s},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(f)},...n&&{body:JSON.stringify(n)}},g=`${l}${u}`;return fetch(g,m).then(async e=>{if(204===e.status)return;const r=await e.json();if(e.ok)return r;if(function(e){return e&&e.errorCode&&e.errorType&&e.message&&e.status}(r))return void a({message:r.message,level:i,cause:r,code:c});a({message:t.errorMessage||`Service at ${g} is not available`,level:i,cause:r,code:c})}).catch(e=>{if(e instanceof o)throw e;a({message:t.errorMessage||`Call to ${g} failed. Error= ${e}`,level:i,cause:e,code:c})})}function a({message:e,level:r,cause:t,code:a}){switch(r){case"silent":break;case"info":case"warn":case"error":console[r](e);break;default:throw new o("NETWORK_ERROR",e,{cause:t,code:a})}}function n(e,r){return t({...e,method:"GET"},r)}function s(e,r){return t({...e,method:"POST"},r)}export{t as http,n as httpGet,s as httpPost};
1
+ import{DEFAULT_HTTP_TIMEOUT as e,FALLBACK_CONTEXT as r}from"../config.js";import o from"../Errors/AdyenCheckoutError.js";function t(t,a){const{headers:s=[],errorLevel:c="warn",errorCode:i,loadingContext:l=r,method:d="GET",path:u,timeout:f=e}=t,m={method:d,mode:"cors",cache:"default",credentials:"same-origin",headers:{Accept:"application/json, text/plain, */*","Content-Type":"POST"===d?"application/json":"text/plain",...s},redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",...AbortSignal?.timeout&&{signal:AbortSignal?.timeout(f)}};a&&(m.body=JSON.stringify(a));const g=`${l}${u}`;return fetch(g,m).then(async e=>{if(204===e.status)return;const r=await e.json();if(e.ok)return r;if(function(e){const r=e;return Boolean(e&&r.errorCode&&r.errorType&&r.message&&r.status)}(r))return void n({message:r.message,level:c,cause:r,code:i});n({message:t.errorMessage||`Service at ${g} is not available`,level:c,cause:r,code:i})}).catch(e=>{if(e instanceof o)throw e;n({message:t.errorMessage||`Call to ${g} failed. Error= ${e}`,level:c,cause:e,code:i})})}function n({message:e,level:r,cause:t,code:n}){switch(r){case"silent":break;case"info":case"warn":case"error":console[r](e);break;default:throw new o("NETWORK_ERROR",e,{cause:t,code:n})}}function a(e,r){return t({...e,method:"GET"},r)}function s(e,r){return t({...e,method:"POST"},r)}export{t as http,a as httpGet,s as httpPost};
2
2
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../../src/core/Services/http.ts"],"sourcesContent":["import { DEFAULT_HTTP_TIMEOUT, FALLBACK_CONTEXT } from '../config';\nimport AdyenCheckoutError from '../Errors/AdyenCheckoutError';\n\nexport interface HttpOptions {\n accept?: string;\n contentType?: string;\n headers?;\n loadingContext?: string;\n method?: string;\n path: string;\n timeout?: number;\n errorLevel?: ErrorLevel;\n errorMessage?: string;\n errorCode?: string;\n}\n\ninterface FetchErrorOptions {\n message?: string;\n level?: ErrorLevel;\n cause?: unknown;\n code?: string;\n}\n\ntype ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';\n\ntype AdyenApiErrorResponse = {\n errorCode: string;\n message: string;\n errorType: string;\n status: number;\n};\n\nfunction isAdyenApiErrorResponse(data: any): data is AdyenApiErrorResponse {\n return data && data.errorCode && data.errorType && data.message && data.status;\n}\n\nexport function http<T>(options: HttpOptions, payload?: any): Promise<T> {\n const {\n headers = [],\n errorLevel = 'warn',\n errorCode,\n loadingContext = FALLBACK_CONTEXT,\n method = 'GET',\n path,\n timeout = DEFAULT_HTTP_TIMEOUT\n } = options;\n\n const request: RequestInit = {\n method,\n mode: 'cors',\n cache: 'default',\n credentials: 'same-origin',\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': method === 'POST' ? 'application/json' : 'text/plain',\n ...headers\n },\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n ...(AbortSignal?.timeout && { signal: AbortSignal?.timeout(timeout) }),\n ...(payload && { body: JSON.stringify(payload) })\n };\n\n const url = `${loadingContext}${path}`;\n\n return (\n fetch(url, request)\n .then(async response => {\n // Handle empty responses (e.g., 204 No Content)\n if (response.status === 204) {\n return;\n }\n\n const data = await response.json();\n\n if (response.ok) {\n return data;\n }\n\n if (isAdyenApiErrorResponse(data)) {\n handleFetchError({ message: data.message, level: errorLevel, cause: data, code: errorCode });\n return;\n }\n\n const errorMessage = options.errorMessage || `Service at ${url} is not available`;\n handleFetchError({ message: errorMessage, level: errorLevel, cause: data, code: errorCode });\n return;\n })\n /**\n * Catch block handles Network error, CORS error, or exception throw by the `handleFetchError`\n * inside the `then` block\n */\n .catch((error: unknown) => {\n /**\n * If error is instance of AdyenCheckoutError, which means that it was already\n * handled by the `handleFetchError` on the `then` block, then we just throw it.\n * There is no need to create it again\n */\n if (error instanceof AdyenCheckoutError) {\n throw error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string,@typescript-eslint/restrict-template-expressions\n const errorMessage = options.errorMessage || `Call to ${url} failed. Error= ${error}`;\n handleFetchError({ message: errorMessage, level: errorLevel, cause: error, code: errorCode });\n })\n );\n}\n\nfunction handleFetchError({ message, level, cause, code }: FetchErrorOptions): void {\n switch (level) {\n case 'silent': {\n break;\n }\n case 'info':\n case 'warn':\n case 'error': {\n console[level](message);\n break;\n }\n default:\n throw new AdyenCheckoutError('NETWORK_ERROR', message, { cause, code });\n }\n}\n\nexport function httpGet<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'GET' }, data);\n}\n\nexport function httpPost<T = any>(options: HttpOptions, data?: any): Promise<T> {\n return http<T>({ ...options, method: 'POST' }, data);\n}\n"],"names":["http","options","payload","headers","errorLevel","errorCode","loadingContext","FALLBACK_CONTEXT","method","path","timeout","DEFAULT_HTTP_TIMEOUT","request","mode","cache","credentials","Accept","redirect","referrerPolicy","AbortSignal","signal","body","JSON","stringify","url","fetch","then","async","response","status","data","json","ok","errorType","message","isAdyenApiErrorResponse","handleFetchError","level","cause","code","errorMessage","catch","error","AdyenCheckoutError","console","httpGet","httpPost"],"mappings":"yHAoCO,SAASA,EAAQC,EAAsBC,GAC1C,MAAMC,QACFA,EAAU,GAAEC,WACZA,EAAa,OAAMC,UACnBA,EAASC,eACTA,EAAiBC,EAAgBC,OACjCA,EAAS,MAAKC,KACdA,EAAIC,QACJA,EAAUC,GACVV,EAEEW,EAAu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kB7C,EAAsB6B,GACpD,OAAO9B,EAAQ,IAAKC,EAASO,OAAQ,QAAUsB,EACnD"}
1
+ {"version":3,"file":"http.js","sources":["../../../../src/core/Services/http.ts"],"sourcesContent":["import { DEFAULT_HTTP_TIMEOUT, FALLBACK_CONTEXT } from '../config';\nimport AdyenCheckoutError from '../Errors/AdyenCheckoutError';\n\nexport interface HttpOptions {\n accept?: string;\n contentType?: string;\n headers?: Record<string, string>;\n loadingContext?: string;\n method?: string;\n path: string;\n timeout?: number;\n errorLevel?: ErrorLevel;\n errorMessage?: string;\n errorCode?: string;\n}\n\ninterface FetchErrorOptions {\n message?: string;\n level?: ErrorLevel;\n cause?: unknown;\n code?: string;\n}\n\ntype ErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';\n\n/**\n * @deprecated Temporary compatibility type. `http` resolves `undefined` for 204 responses and non-fatal errors.\n * Replace with `Promise<T | undefined>` after all consumers handle missing responses.\n */\ntype LegacyHttpPromise<T> = Promise<T>;\n\ntype AdyenApiErrorResponse = {\n errorCode: string;\n message: string;\n errorType: string;\n status: number;\n};\n\nfunction isAdyenApiErrorResponse(data: unknown): data is AdyenApiErrorResponse {\n const response = data as Partial<AdyenApiErrorResponse>;\n return Boolean(data && response.errorCode && response.errorType && response.message && response.status);\n}\n\nexport function http<T>(options: HttpOptions, payload?: unknown): Promise<T> {\n const {\n headers = [],\n errorLevel = 'warn',\n errorCode,\n loadingContext = FALLBACK_CONTEXT,\n method = 'GET',\n path,\n timeout = DEFAULT_HTTP_TIMEOUT\n } = options;\n\n const request: RequestInit = {\n method,\n mode: 'cors',\n cache: 'default',\n credentials: 'same-origin',\n headers: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': method === 'POST' ? 'application/json' : 'text/plain',\n ...headers\n },\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n ...(AbortSignal?.timeout && { signal: AbortSignal?.timeout(timeout) })\n };\n\n if (payload) {\n request.body = JSON.stringify(payload);\n }\n\n const url = `${loadingContext}${path}`;\n\n return (\n fetch(url, request)\n .then(async response => {\n // Handle empty responses (e.g., 204 No Content)\n if (response.status === 204) {\n return;\n }\n\n const data: unknown = await response.json();\n\n if (response.ok) {\n return data as T;\n }\n\n if (isAdyenApiErrorResponse(data)) {\n handleFetchError({ message: data.message, level: errorLevel, cause: data, code: errorCode });\n return;\n }\n\n const errorMessage = options.errorMessage || `Service at ${url} is not available`;\n handleFetchError({ message: errorMessage, level: errorLevel, cause: data, code: errorCode });\n return;\n })\n /**\n * Catch block handles Network error, CORS error, or exception throw by the `handleFetchError`\n * inside the `then` block\n */\n .catch((error: unknown) => {\n /**\n * If error is instance of AdyenCheckoutError, which means that it was already\n * handled by the `handleFetchError` on the `then` block, then we just throw it.\n * There is no need to create it again\n */\n if (error instanceof AdyenCheckoutError) {\n throw error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-base-to-string,@typescript-eslint/restrict-template-expressions\n const errorMessage = options.errorMessage || `Call to ${url} failed. Error= ${error}`;\n handleFetchError({ message: errorMessage, level: errorLevel, cause: error, code: errorCode });\n }) as LegacyHttpPromise<T>\n );\n}\n\nfunction handleFetchError({ message, level, cause, code }: FetchErrorOptions): void {\n switch (level) {\n case 'silent': {\n break;\n }\n case 'info':\n case 'warn':\n case 'error': {\n console[level](message);\n break;\n }\n default:\n throw new AdyenCheckoutError('NETWORK_ERROR', message, { cause, code });\n }\n}\n\nexport function httpGet<T = unknown>(options: HttpOptions, data?: unknown): Promise<T> {\n return http<T>({ ...options, method: 'GET' }, data);\n}\n\nexport function httpPost<T = unknown>(options: HttpOptions, data?: unknown): Promise<T> {\n return http<T>({ ...options, method: 'POST' }, data);\n}\n"],"names":["http","options","payload","headers","errorLevel","errorCode","loadingContext","FALLBACK_CONTEXT","method","path","timeout","DEFAULT_HTTP_TIMEOUT","request","mode","cache","credentials","Accept","redirect","referrerPolicy","AbortSignal","signal","body","JSON","stringify","url","fetch","then","async","response","status","data","json","ok","Boolean","errorType","message","isAdyenApiErrorResponse","handleFetchError","level","cause","code","errorMessage","catch","error","AdyenCheckoutError","console","httpGet","httpPost"],"mappings":"yHA2CO,SAASA,EAAQC,EAAsBC,GAC1C,MAAMC,QACFA,EAAU,GAAEC,WACZA,EAAa,OAAMC,UACnBA,EAASC,eACTA,EAAiBC,EAAgBC,OACjCA,EAAS,MAAKC,KACdA,EAAIC,QACJA,EAAUC,GACVV,EAEEW,EAAuB,CACzBJ,SACAK,KAAM,OACNC,MAAO,UACPC,YAAa,cACbZ,QAAS,CACLa,OAAQ,oCACR,eAA2B,SAAXR,EAAoB,mBAAqB,gBACtDL,GAEPc,SAAU,SACVC,eAAgB,gCACZC,aAAaT,SAAW,CAAEU,OAAQD,aAAaT,QAAQA,KAG3DR,IACAU,EAAQS,KAAOC,KAAKC,UAAUrB,IAGlC,MAAMsB,EAAM,GAAGlB,IAAiBG,IAEhC,OACIgB,MAAMD,EAAKZ,GACNc,KAAKC,MAAMC,IAER,GAAwB,MAApBA,EAASC,OACT,OAGJ,MAAMC,QAAsBF,EAASG,OAErC,GAAIH,EAASI,GACT,OAAOF,EAGX,GAnDhB,SAAiCA,GAC7B,MAAMF,EAAWE,EACjB,OAAOG,QAAQH,GAAQF,EAASvB,WAAauB,EAASM,WAAaN,EAASO,SAAWP,EAASC,OACpG,CAgDoBO,CAAwBN,GAExB,YADAO,EAAiB,CAAEF,QAASL,EAAKK,QAASG,MAAOlC,EAAYmC,MAAOT,EAAMU,KAAMnC,IAKpFgC,EAAiB,CAAEF,QADElC,EAAQwC,cAAgB,cAAcjB,qBACjBc,MAAOlC,EAAYmC,MAAOT,EAAMU,KAAMnC,MAOnFqC,MAAOC,IAMJ,GAAIA,aAAiBC,EACjB,MAAMD,EAKVN,EAAiB,CAAEF,QADElC,EAAQwC,cAAgB,WAAWjB,oBAAsBmB,IACpCL,MAAOlC,EAAYmC,MAAOI,EAAOH,KAAMnC,KAGjG,CAEA,SAASgC,GAAiBF,QAAEA,EAAOG,MAAEA,EAAKC,MAAEA,EAAKC,KAAEA,IAC/C,OAAQF,GACJ,IAAK,SACD,MAEJ,IAAK,OACL,IAAK,OACL,IAAK,QACDO,QAAQP,GAAOH,GACf,MAEJ,QACI,MAAM,IAAIS,EAAmB,gBAAiBT,EAAS,CAAEI,QAAOC,SAE5E,CAEO,SAASM,EAAqB7C,EAAsB6B,GACvD,OAAO9B,EAAQ,IAAKC,EAASO,OAAQ,OAASsB,EAClD,CAEO,SAASiB,EAAsB9C,EAAsB6B,GACxD,OAAO9B,EAAQ,IAAKC,EAASO,OAAQ,QAAUsB,EACnD"}
@@ -1,2 +1,2 @@
1
- function e(e,n){if(null==e)throw new Error(n);return e}const n="https://checkoutshopper-live.adyen.com/checkoutshopper/",o=e("6.45.2","LIBRARY_VERSION is not defined"),t=e("esm","BUNDLE_TYPE is not defined"),r=["amount","secondaryAmount","countryCode","environment","_environmentUrls","loadingContext","i18n","modules","order","session","clientKey","showPayButton","redirectFromTopWhenInIframe","donation","onPaymentCompleted","onPaymentFailed","beforeRedirect","beforeSubmit","onSubmit","onReview","onAction","onActionHandled","onAdditionalDetails","onChange","onEnterKeyPressed","onError","onBalanceCheck","onOrderCancel","onOrderRequest","onOrderUpdated","onPaymentMethodsRequest"],i=6e4;var d=function(e){return e.WEB="web",e}({});const a="web";var c=function(e){return e.NATIVE="nativeComponent",e.GENERIC="genericComponent",e}({});export{d as CHANNEL,i as DEFAULT_HTTP_TIMEOUT,n as FALLBACK_CONTEXT,r as GENERIC_OPTIONS,t as LIBRARY_BUNDLE_TYPE,o as LIBRARY_VERSION,c as PAYMENT_METHOD_BEHAVIOR,a as PLATFORM};
1
+ function e(e,n){if(null==e)throw new Error(n);return e}const n="https://checkoutshopper-live.adyen.com/checkoutshopper/",o=e("6.46.0","LIBRARY_VERSION is not defined"),t=e("esm","BUNDLE_TYPE is not defined"),r=["amount","secondaryAmount","countryCode","environment","_environmentUrls","loadingContext","i18n","modules","order","session","clientKey","showPayButton","redirectFromTopWhenInIframe","donation","onPaymentCompleted","onPaymentFailed","beforeRedirect","beforeSubmit","onSubmit","onReview","onAction","onActionHandled","onAdditionalDetails","onChange","onEnterKeyPressed","onError","onBalanceCheck","onOrderCancel","onOrderRequest","onOrderUpdated","onPaymentMethodsRequest"],i=6e4;var d=function(e){return e.WEB="web",e}({});const a="web";var c=function(e){return e.NATIVE="nativeComponent",e.GENERIC="genericComponent",e}({});export{d as CHANNEL,i as DEFAULT_HTTP_TIMEOUT,n as FALLBACK_CONTEXT,r as GENERIC_OPTIONS,t as LIBRARY_BUNDLE_TYPE,o as LIBRARY_VERSION,c as PAYMENT_METHOD_BEHAVIOR,a as PLATFORM};
2
2
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/core/config.ts"],"sourcesContent":["/**\n * Asserts that a value is defined and throws an error if it is not.\n *\n * @param value The value to check.\n * @param message The error message to throw if the value is undefined.\n * @returns The value if it is defined.\n */\nfunction assertDefined<T>(value: T | undefined, message: string): T {\n if (value === undefined || value === null) {\n throw new Error(message);\n }\n return value;\n}\n\n/**\n * FALLBACK_CONTEXT\n */\nexport const FALLBACK_CONTEXT = 'https://checkoutshopper-live.adyen.com/checkoutshopper/';\n\n/**\n * Library version injected at build time.\n * Always defined - the build process ensures this value is set.\n */\nexport const LIBRARY_VERSION = assertDefined(process.env.VERSION, 'LIBRARY_VERSION is not defined');\n\n/**\n * Bundle type injected at build time.\n * Always defined - the build process ensures this value is set.\n */\nexport const LIBRARY_BUNDLE_TYPE = assertDefined(process.env.BUNDLE_TYPE, 'BUNDLE_TYPE is not defined');\n\nexport const GENERIC_OPTIONS = [\n 'amount',\n 'secondaryAmount',\n 'countryCode',\n 'environment',\n '_environmentUrls',\n 'loadingContext',\n 'i18n',\n 'modules',\n 'order',\n 'session',\n 'clientKey',\n 'showPayButton',\n 'redirectFromTopWhenInIframe',\n 'donation',\n\n // Events\n 'onPaymentCompleted',\n 'onPaymentFailed',\n 'beforeRedirect',\n 'beforeSubmit',\n 'onSubmit',\n 'onReview',\n 'onAction',\n 'onActionHandled',\n 'onAdditionalDetails',\n 'onChange',\n 'onEnterKeyPressed',\n 'onError',\n 'onBalanceCheck',\n 'onOrderCancel',\n 'onOrderRequest',\n 'onOrderUpdated',\n 'onPaymentMethodsRequest'\n];\n\nexport const DEFAULT_HTTP_TIMEOUT = 60000;\n\nexport default {\n FALLBACK_CONTEXT,\n GENERIC_OPTIONS,\n DEFAULT_HTTP_TIMEOUT\n};\n\n/**\n * @internal\n */\n\nexport enum CHANNEL {\n WEB = 'web'\n}\n\n/**\n * @internal\n */\nexport const PLATFORM = 'web';\n\n/**\n * How the SDK handles the rendering of a payment method.\n *\n * - NATIVE: The payment method has a dedicated component in the SDK.\n * - GENERIC: The payment method has no dedicated component; it falls back to a generic component (Redirect).\n * @internal\n */\nexport enum PAYMENT_METHOD_BEHAVIOR {\n NATIVE = 'nativeComponent',\n GENERIC = 'genericComponent'\n}\n"],"names":["assertDefined","value","message","Error","FALLBACK_CONTEXT","LIBRARY_VERSION","LIBRARY_BUNDLE_TYPE","GENERIC_OPTIONS","DEFAULT_HTTP_TIMEOUT","CHANNEL","PLATFORM","PAYMENT_METHOD_BEHAVIOR"],"mappings":"AAOA,SAASA,EAAiBC,EAAsBC,GAC5C,GAAID,QACA,MAAM,IAAIE,MAAMD,GAEpB,OAAOD,CACX,CAKO,MAAMG,EAAmB,0DAMnBC,EAAkBL,EAAc,SAAqB,kCAMrDM,EAAsBN,EAAc,MAAyB,8BAE7DO,EAAkB,CAC3B,SACA,kBACA,cACA,cACA,mBACA,iBACA,OACA,UACA,QACA,UACA,YACA,gBACA,8BACA,WAGA,qBACA,kBACA,iBACA,eACA,WACA,WACA,WACA,kBACA,sBACA,WACA,oBACA,UACA,iBACA,gBACA,iBACA,iBACA,2BAGSC,EAAuB,IAY7B,IAAKC,EAAAA,SAAAA,GAAAA,mBAAAA,CAEZ,CAFYA,CAEZ,CAAA,GAKO,MAAMC,EAAW,MASjB,IAAKC,EAAAA,SAAAA,GAAAA,+DAAAA,CAGZ,CAHYA,CAGZ,CAAA"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/core/config.ts"],"sourcesContent":["/**\n * Asserts that a value is defined and throws an error if it is not.\n *\n * @param value The value to check.\n * @param message The error message to throw if the value is undefined.\n * @returns The value if it is defined.\n */\nfunction assertDefined<T>(value: T | undefined, message: string): T {\n if (value === undefined || value === null) {\n throw new Error(message);\n }\n return value;\n}\n\n/**\n * FALLBACK_CONTEXT\n */\nexport const FALLBACK_CONTEXT = 'https://checkoutshopper-live.adyen.com/checkoutshopper/';\n\n/**\n * Library version injected at build time.\n * Always defined - the build process ensures this value is set.\n */\nexport const LIBRARY_VERSION = assertDefined(process.env.VERSION, 'LIBRARY_VERSION is not defined');\n\n/**\n * Bundle type injected at build time.\n * Always defined - the build process ensures this value is set.\n */\nexport const LIBRARY_BUNDLE_TYPE = assertDefined(process.env.BUNDLE_TYPE, 'BUNDLE_TYPE is not defined');\n\nexport const GENERIC_OPTIONS = [\n 'amount',\n 'secondaryAmount',\n 'countryCode',\n 'environment',\n '_environmentUrls',\n 'loadingContext',\n 'i18n',\n 'modules',\n 'order',\n 'session',\n 'clientKey',\n 'showPayButton',\n 'redirectFromTopWhenInIframe',\n 'donation',\n\n // Events\n 'onPaymentCompleted',\n 'onPaymentFailed',\n 'beforeRedirect',\n 'beforeSubmit',\n 'onSubmit',\n 'onReview',\n 'onAction',\n 'onActionHandled',\n 'onAdditionalDetails',\n 'onChange',\n 'onEnterKeyPressed',\n 'onError',\n 'onBalanceCheck',\n 'onOrderCancel',\n 'onOrderRequest',\n 'onOrderUpdated',\n 'onPaymentMethodsRequest'\n] as const;\n\nexport const DEFAULT_HTTP_TIMEOUT = 60000;\n\nexport default {\n FALLBACK_CONTEXT,\n GENERIC_OPTIONS,\n DEFAULT_HTTP_TIMEOUT\n};\n\n/**\n * @internal\n */\n\nexport enum CHANNEL {\n WEB = 'web'\n}\n\n/**\n * @internal\n */\nexport const PLATFORM = 'web';\n\n/**\n * How the SDK handles the rendering of a payment method.\n *\n * - NATIVE: The payment method has a dedicated component in the SDK.\n * - GENERIC: The payment method has no dedicated component; it falls back to a generic component (Redirect).\n * @internal\n */\nexport enum PAYMENT_METHOD_BEHAVIOR {\n NATIVE = 'nativeComponent',\n GENERIC = 'genericComponent'\n}\n"],"names":["assertDefined","value","message","Error","FALLBACK_CONTEXT","LIBRARY_VERSION","LIBRARY_BUNDLE_TYPE","GENERIC_OPTIONS","DEFAULT_HTTP_TIMEOUT","CHANNEL","PLATFORM","PAYMENT_METHOD_BEHAVIOR"],"mappings":"AAOA,SAASA,EAAiBC,EAAsBC,GAC5C,GAAID,QACA,MAAM,IAAIE,MAAMD,GAEpB,OAAOD,CACX,CAKO,MAAMG,EAAmB,0DAMnBC,EAAkBL,EAAc,SAAqB,kCAMrDM,EAAsBN,EAAc,MAAyB,8BAE7DO,EAAkB,CAC3B,SACA,kBACA,cACA,cACA,mBACA,iBACA,OACA,UACA,QACA,UACA,YACA,gBACA,8BACA,WAGA,qBACA,kBACA,iBACA,eACA,WACA,WACA,WACA,kBACA,sBACA,WACA,oBACA,UACA,iBACA,gBACA,iBACA,iBACA,2BAGSC,EAAuB,IAY7B,IAAKC,EAAAA,SAAAA,GAAAA,mBAAAA,CAEZ,CAFYA,CAEZ,CAAA,GAKO,MAAMC,EAAW,MASjB,IAAKC,EAAAA,SAAAA,GAAAA,+DAAAA,CAGZ,CAHYA,CAGZ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sources":["../../../src/core/core.ts"],"sourcesContent":["import Language from '../language';\nimport UIElement from '../components/internal/UIElement/UIElement';\nimport RiskModule from './RiskModule';\nimport PaymentMethods from './ProcessResponse/PaymentMethods';\nimport getComponentForAction from './ProcessResponse/PaymentAction';\nimport Analytics from './Analytics';\nimport { assertConfigurationPropertiesAreValid, processGlobalOptions } from './utils';\nimport Session from './CheckoutSession';\nimport { hasOwnProperty } from '../utils/hasOwnProperty';\nimport { Resources } from './Context/Resources';\nimport { SRPanel } from './Errors/SRPanel';\nimport registry, { NewableComponent } from './core.registry';\nimport { cleanupFinalResult, sanitizeResponse, verifyPaymentDidNotFail } from '../components/internal/UIElement/utils';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from './Errors/AdyenCheckoutError';\nimport { THREEDS2_FULL } from '../components/ThreeDS2/constants';\nimport { defaultProps } from './core.defaultProps';\nimport { resolveEnvironments } from './Environment';\nimport { LIBRARY_BUNDLE_TYPE, LIBRARY_VERSION } from './config';\n\nimport type { PaymentAction, PaymentAmount, PaymentData, PaymentResponseData } from '../types/global-types';\nimport type { CoreConfiguration, ICore, AdditionalDetailsData, CoreModules } from './types';\nimport type { UIElementProps } from '../components/internal/UIElement/types';\nimport { AnalyticsLogEvent, LogEventSubtype, LogEventType } from './Analytics/events/AnalyticsLogEvent';\nimport CancelError from './Errors/CancelError';\nimport { AnalyticsService } from './Analytics/AnalyticsService';\nimport { AnalyticsEventQueue } from './Analytics/AnalyticsEventQueue';\nimport { isAmountValid } from '../utils/amount-util';\nimport { LanguageService } from '../language/LanguageService';\n\nclass Core implements ICore {\n public session?: Session;\n public paymentMethodsResponse: PaymentMethods;\n public modules: CoreModules;\n public options: CoreConfiguration;\n\n public analyticsContext: string;\n public loadingContext: string;\n public cdnImagesUrl: string;\n public cdnTranslationsUrl: string;\n\n private components: UIElement[] = [];\n\n public static readonly metadata: { version: string; bundleType: string } = {\n version: LIBRARY_VERSION,\n bundleType: LIBRARY_BUNDLE_TYPE\n };\n\n public static readonly registry = registry;\n\n public static setBundleType(type: string): void {\n Core.metadata.bundleType = type;\n }\n\n public static register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n /**\n * Used internally by the PaymentMethod components to auto-register themselves\n * @internal\n */\n public register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n public getComponent(txVariant: string) {\n return registry.getComponent(txVariant);\n }\n\n constructor(props: CoreConfiguration) {\n assertConfigurationPropertiesAreValid(props);\n\n this.createFromAction = this.createFromAction.bind(this);\n this.update = this.update.bind(this);\n\n this.setOptions({ ...defaultProps, ...props });\n\n const { apiUrl, analyticsUrl, cdnImagesUrl, cdnTranslationsUrl } = resolveEnvironments(\n this.options.environment,\n this.options._environmentUrls\n );\n\n this.loadingContext = apiUrl;\n this.analyticsContext = analyticsUrl;\n this.cdnImagesUrl = cdnImagesUrl;\n this.cdnTranslationsUrl = cdnTranslationsUrl;\n\n this.session = this.options.session && new Session(this.options.session, this.options.clientKey, this.loadingContext);\n\n const clientKeyType = this.options.clientKey?.substring(0, 4);\n if ((clientKeyType === 'test' || clientKeyType === 'live') && !this.loadingContext.includes(clientKeyType)) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Error: you are using a ${clientKeyType} clientKey against the ${this.options._environmentUrls?.api || this.options.environment} environment`\n );\n }\n if (clientKeyType === 'pub.') {\n console.debug(\n `The value you are passing as your \"clientKey\" looks like an originKey (${this.options.clientKey?.substring(0, 12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`\n );\n }\n\n if (this.options.exposeLibraryMetadata) {\n window['AdyenWebMetadata'] = Core.metadata;\n }\n }\n\n public async initialize(): Promise<this> {\n await this.initializeCore();\n this.validateCoreConfiguration();\n this.createCoreModules();\n this.assignLocaleToCore();\n void this.requestAnalyticsAttemptId();\n await this.requestTranslations();\n return this;\n }\n\n private async initializeCore(): Promise<this> {\n if (this.session) {\n return this.session\n .setupSession(this.options)\n .then(sessionResponse => {\n const { amount, shopperLocale, countryCode, paymentMethods, ...rest } = sessionResponse;\n\n this.setOptions({\n ...rest,\n amount: this.options.order ? this.options.order.remainingAmount : amount,\n locale: this.options.locale || shopperLocale,\n countryCode: this.options.countryCode || countryCode\n });\n\n this.createPaymentMethodsList(paymentMethods);\n\n return this;\n })\n .catch(error => {\n if (this.options.onError) this.options.onError(error);\n return Promise.reject(error);\n });\n }\n\n this.createPaymentMethodsList();\n return Promise.resolve(this);\n }\n\n private validateCoreConfiguration(): void {\n // @ts-ignore This property does not exist, although merchants might be using when migrating from v5 to v6\n if (this.options.paymentMethodsConfiguration) {\n console.warn('WARNING: \"paymentMethodsConfiguration\" is supported only by Drop-in.');\n }\n\n if (!this.options.countryCode) {\n throw new AdyenCheckoutError(IMPLEMENTATION_ERROR, 'You must specify a countryCode when initializing checkout.');\n }\n }\n\n /**\n * Method used when handling redirects. It submits details using 'onAdditionalDetails' or the Sessions flow if available.\n *\n * @public\n * @see {https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Components&version=5.55.1#handle-the-redirect}\n * @param details - Details object containing the redirectResult\n */\n public submitDetails(details: AdditionalDetailsData['data']): void {\n let promise = null;\n\n if (this.options.onAdditionalDetails) {\n promise = new Promise((resolve, reject) => {\n this.options.onAdditionalDetails({ data: details }, undefined, { resolve, reject });\n });\n }\n\n if (this.session) {\n promise = this.session.submitDetails(details).catch(error => {\n this.options.onError?.(error);\n return Promise.reject(error);\n });\n }\n\n if (!promise) {\n this.options.onError?.(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not submit the details. The callback \"onAdditionalDetails\" or the Session is not setup correctly.'\n )\n );\n return;\n }\n\n promise\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.afterAdditionalDetails)\n .then((response: PaymentResponseData) => {\n cleanupFinalResult(response);\n this.options.onPaymentCompleted?.(response);\n })\n .catch((e: PaymentResponseData | Error) => {\n if (e instanceof CancelError) {\n return;\n }\n\n cleanupFinalResult(e as PaymentResponseData);\n this.options.onPaymentFailed?.(e as PaymentResponseData);\n });\n }\n\n private readonly afterAdditionalDetails = (response: PaymentResponseData): Promise<PaymentResponseData | Error> => {\n /**\n * After the user is redirected back, a request to `/details` or `/paymentDetails` will be made.\n * Typically, the response will not include an action object, except for the case of `paybybank_pix` payment method.\n * In terms of `paybybank_pix`, the action UIElement will be created and passed to the `afterAdditionalDetails` callback, allowing it to be mounted on the page.\n */\n if (this.options.afterAdditionalDetails && response?.action) {\n const actionEle = this.createFromAction(response.action);\n this.options.afterAdditionalDetails(actionEle);\n return Promise.reject(new CancelError('Handled by afterAdditionalDetails'));\n }\n return Promise.resolve(response);\n };\n\n /**\n * Instantiates a new element component ready to be mounted from an action object\n *\n * @param action - action defining the component with the component data\n * @param options - options that will be merged to the global Checkout props\n * @returns new UIElement\n */\n public createFromAction(action: PaymentAction, options = {}): UIElement {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'createFromAction::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('createFromAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n if (action.type) {\n // 'threeDS2' OR 'qrCode', 'voucher', 'redirect', 'await', 'bankTransfer`\n const component = action.type === THREEDS2_FULL ? `${action.type}${action.subtype}` : action.paymentMethodType;\n\n const event = new AnalyticsLogEvent({\n type: LogEventType.action,\n subType: AnalyticsLogEvent.getSubtypeFromActionType(action.type),\n message: `${component} action was handled by the SDK`,\n component\n });\n this.modules.analytics.sendAnalytics(event);\n\n const props = {\n ...this.getCorePropsForComponent(),\n ...options\n };\n\n return getComponentForAction(this, registry, action, props);\n }\n\n return this.handleCreateError();\n }\n\n /**\n * Updates global configurations, resets the internal state and remounts each element.\n *\n * @param props - props to update\n * @param options - Can be used to avoid remounting the elements\n * @returns this - the Core instance\n */\n public update(props: Partial<Omit<CoreConfiguration, 'session'>> = {}, { shouldReinitializeCheckout = true } = {}): Promise<this> {\n if (shouldReinitializeCheckout) {\n this.setOptions(props);\n\n return this.initialize().then(() => {\n this.components.forEach(component => {\n // We update only with the new options that have been received\n const newProps: Partial<UIElementProps> = {\n ...(props.order?.remainingAmount ? { amount: props.order.remainingAmount } : { amount: this.options.amount }),\n ...(this.session && { session: this.session }),\n ...props\n };\n component.update(newProps);\n });\n return this;\n });\n }\n\n const { amount, secondaryAmount } = props;\n\n if (amount || secondaryAmount) {\n this.triggerAmountUpdate(amount, secondaryAmount);\n }\n\n return Promise.resolve(this);\n }\n\n /**\n * Validates and propagates amount updates to all mounted components.\n *\n * @param amount - Primary payment amount object (required)\n * @param secondaryAmount - Optional secondary amount for display purposes (e.g., converted currency)\n * @internal\n */\n private triggerAmountUpdate(amount: PaymentAmount, secondaryAmount?: PaymentAmount): void {\n if (!isAmountValid(amount)) {\n console.warn('Core update(): Update canceled. Invalid amount object');\n return;\n }\n\n if (secondaryAmount && !isAmountValid(secondaryAmount)) {\n console.warn('Core update(): Update canceled. Invalid secondary amount object');\n return;\n }\n\n this.setOptions({\n amount,\n ...(secondaryAmount && { secondaryAmount })\n });\n\n this.components.forEach(component => {\n component.updateAmount(amount, secondaryAmount);\n });\n }\n\n /**\n * Remove the reference of a component\n * @param component - reference to the component to be removed\n * @returns this - the element instance\n * // TODO: Do we need this?\n */\n public remove = (component): this => {\n this.components = this.components.filter(c => c._id !== component._id);\n component.unmount();\n\n return this;\n };\n\n /**\n * @internal\n * Create or update the config object passed when AdyenCheckout is initialised (environment, clientKey, etc...)\n */\n private setOptions = (options: CoreConfiguration): void => {\n this.options = {\n ...this.options,\n ...options,\n locale: options?.locale || this.options?.locale,\n // Make environment lowercase to ensure consistency\n environment: String.prototype.toLowerCase.apply(options?.environment || this.options?.environment)\n };\n };\n\n /**\n * @internal\n * @returns props for a new UIElement\n */\n public getCorePropsForComponent(): any {\n const globalOptions = processGlobalOptions(this.options);\n\n return {\n ...globalOptions,\n core: this,\n i18n: this.modules.i18n,\n modules: this.modules,\n session: this.session,\n loadingContext: this.loadingContext,\n cdnContext: this.cdnImagesUrl,\n createFromAction: this.createFromAction\n };\n }\n\n public processPayment(data: PaymentData): void {\n if (!this.session) {\n this.options.onError?.(new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'processPayment requires a session to be configured'));\n return;\n }\n\n const event = new AnalyticsLogEvent({\n type: LogEventType.submit,\n subType: LogEventSubtype.review,\n message: 'Shopper clicked pay',\n component: data.paymentMethod?.type\n });\n\n this.modules.analytics.sendAnalytics(event);\n\n this.session\n .submitPayment(data)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then((response: PaymentResponseData) => {\n if (response.action) {\n if (this.options.onAction) {\n this.options.onAction(this.createFromAction(response.action));\n } else {\n this.options.onError?.(\n new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'onAction callback is required to handle payment actions')\n );\n }\n return;\n }\n const order = response.order;\n if (order && (order.remainingAmount?.value ?? 0) > 0) {\n this.options.onOrderUpdated?.({ order });\n return;\n }\n cleanupFinalResult(response);\n this.options.onPaymentCompleted?.(response);\n })\n .catch((e: PaymentResponseData | Error) => {\n if (e instanceof CancelError) return;\n cleanupFinalResult(e as PaymentResponseData);\n this.options.onPaymentFailed?.(e as PaymentResponseData);\n });\n }\n\n public storeElementReference(element: UIElement) {\n if (element) {\n this.components.push(element);\n }\n }\n\n /**\n * @internal\n */\n private handleCreateError(paymentMethod?): never {\n const paymentMethodName = paymentMethod?.name ?? 'The passed payment method';\n const errorMessage = paymentMethod\n ? `${paymentMethodName} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(\n paymentMethod\n )}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`\n : 'No Payment Method component was passed';\n\n throw new Error(errorMessage);\n }\n\n private createPaymentMethodsList(paymentMethodsResponse?: PaymentMethods): void {\n this.paymentMethodsResponse = new PaymentMethods(this.options.paymentMethodsResponse || paymentMethodsResponse, this.options);\n }\n\n private createCoreModules(): void {\n if (this.modules) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('Core: Core modules are already created.');\n }\n return;\n }\n\n this.modules = Object.freeze({\n risk: new RiskModule(this, { ...this.options, loadingContext: this.loadingContext }),\n analytics: new Analytics({\n eventQueue: new AnalyticsEventQueue(),\n service: new AnalyticsService({\n analyticsContext: this.analyticsContext,\n clientKey: this.options.clientKey\n }),\n enabled: this.options.analytics?.enabled,\n analyticsData: this.options.analytics?.analyticsData\n }),\n resources: new Resources(this.cdnImagesUrl),\n i18n: new Language({\n locale: this.options.locale,\n customTranslations: this.options.translations,\n service: new LanguageService({\n cdnUrl: this.cdnTranslationsUrl,\n sdkVersion: Core.metadata.version\n }),\n onError: this.options?.onError\n }),\n srPanel: new SRPanel(this, { ...this.options.srConfig })\n });\n }\n\n /**\n * Retrieve the parsed locale from the i18n module and assigns it to the core options.\n */\n private assignLocaleToCore(): void {\n this.options.locale = this.modules.i18n.locale;\n }\n\n /**\n * Request translations to the CDN. If an error occurs, it will be logged to the console in development mode.\n */\n private async requestTranslations(): Promise<void> {\n try {\n await this.modules.i18n.requestTranslations();\n } catch (error: unknown) {\n console.warn('Core - requestTranslations(): Something went wrong.', error);\n }\n }\n\n private async requestAnalyticsAttemptId(): Promise<void> {\n await this.modules.analytics.setUp({\n locale: this.options.locale,\n ...(this.session?.id && { sessionId: this.session.id })\n });\n }\n}\n\nexport default Core;\n"],"names":["Core","setBundleType","type","metadata","bundleType","register","items","registry","add","getComponent","txVariant","initialize","this","initializeCore","validateCoreConfiguration","createCoreModules","assignLocaleToCore","requestAnalyticsAttemptId","requestTranslations","session","setupSession","options","then","sessionResponse","amount","shopperLocale","countryCode","paymentMethods","rest","setOptions","order","remainingAmount","locale","createPaymentMethodsList","catch","error","onError","Promise","reject","resolve","paymentMethodsConfiguration","console","warn","AdyenCheckoutError","IMPLEMENTATION_ERROR","submitDetails","details","promise","onAdditionalDetails","data","undefined","sanitizeResponse","verifyPaymentDidNotFail","afterAdditionalDetails","response","cleanupFinalResult","onPaymentCompleted","e","CancelError","onPaymentFailed","createFromAction","action","hasOwnProperty","Error","component","THREEDS2_FULL","subtype","paymentMethodType","event","AnalyticsLogEvent","LogEventType","subType","getSubtypeFromActionType","message","modules","analytics","sendAnalytics","props","getCorePropsForComponent","getComponentForAction","handleCreateError","update","shouldReinitializeCheckout","components","forEach","newProps","secondaryAmount","triggerAmountUpdate","isAmountValid","updateAmount","processGlobalOptions","core","i18n","loadingContext","cdnContext","cdnImagesUrl","processPayment","submit","LogEventSubtype","review","paymentMethod","submitPayment","onAction","value","onOrderUpdated","storeElementReference","element","push","errorMessage","name","JSON","stringify","paymentMethodsResponse","PaymentMethods","Object","freeze","risk","RiskModule","Analytics","eventQueue","AnalyticsEventQueue","service","AnalyticsService","analyticsContext","clientKey","enabled","analyticsData","resources","Resources","Language","customTranslations","translations","LanguageService","cdnUrl","cdnTranslationsUrl","sdkVersion","version","srPanel","SRPanel","srConfig","setUp","id","sessionId","constructor","_define_property","actionEle","remove","filter","c","_id","unmount","environment","String","prototype","toLowerCase","apply","assertConfigurationPropertiesAreValid","bind","defaultProps","apiUrl","analyticsUrl","resolveEnvironments","_environmentUrls","Session","clientKeyType","substring","includes","api","debug","exposeLibraryMetadata","window","LIBRARY_VERSION","LIBRARY_BUNDLE_TYPE"],"mappings":"6jDA6BA,MAAMA,EAoBF,oBAAcC,CAAcC,GACxBF,EAAKG,SAASC,WAAaF,CAC/B,CAEA,eAAcG,IAAYC,GACtBC,EAASC,OAAOF,EACpB,CAMA,QAAAD,IAAmBC,GACfC,EAASC,OAAOF,EACpB,CAEOG,YAAAA,CAAaC,GAChB,OAAOH,EAASE,aAAaC,EACjC,CAwCA,gBAAaC,GAOT,aANMC,KAAKC,iBACXD,KAAKE,4BACLF,KAAKG,oBACLH,KAAKI,qBACAJ,KAAKK,kCACJL,KAAKM,sBACJN,IACX,CAEA,oBAAcC,GACV,OAAID,KAAKO,QACEP,KAAKO,QACPC,aAAaR,KAAKS,SAClBC,KAAKC,IACF,MAAMC,OAAEA,EAAMC,cAAEA,EAAaC,YAAEA,EAAWC,eAAEA,KAAmBC,GAASL,EAWxE,OATAX,KAAKiB,WAAW,IACTD,EACHJ,OAAQZ,KAAKS,QAAQS,MAAQlB,KAAKS,QAAQS,MAAMC,gBAAkBP,EAClEQ,OAAQpB,KAAKS,QAAQW,QAAUP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J,KAAKS,QAAQ6I,kBAAkBK,KAAO3J,KAAKS,QAAQkI,2BAGtG,SAAlBa,GACA3H,QAAQ+H,MACJ,0EAA0E5J,KAAKS,QAAQuG,WAAWyC,UAAU,EAAG,oQAInHzJ,KAAKS,QAAQoJ,wBACbC,OAAO,iBAAsB1K,EAAKG,SAE1C,EA/DA6I,EAbEhJ,EAaqBG,WAAoD,CACvEqI,QAASmC,EACTvK,WAAYwK,IAGhB5B,EAlBEhJ,EAkBqBO,WAAWA"}
1
+ {"version":3,"file":"core.js","sources":["../../../src/core/core.ts"],"sourcesContent":["import Language from '../language';\nimport UIElement from '../components/internal/UIElement/UIElement';\nimport RiskModule from './RiskModule';\nimport PaymentMethods from './ProcessResponse/PaymentMethods';\nimport getComponentForAction from './ProcessResponse/PaymentAction';\nimport Analytics from './Analytics';\nimport { assertConfigurationPropertiesAreValid, processGlobalOptions } from './utils';\nimport Session from './CheckoutSession';\nimport { hasOwnProperty } from '../utils/hasOwnProperty';\nimport { Resources } from './Context/Resources';\nimport { SRPanel } from './Errors/SRPanel';\nimport registry, { NewableComponent } from './core.registry';\nimport { cleanupFinalResult, sanitizeResponse, verifyPaymentDidNotFail } from '../components/internal/UIElement/utils';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from './Errors/AdyenCheckoutError';\nimport { THREEDS2_FULL } from '../components/ThreeDS2/constants';\nimport { defaultProps } from './core.defaultProps';\nimport { resolveEnvironments } from './Environment';\nimport { LIBRARY_BUNDLE_TYPE, LIBRARY_VERSION } from './config';\n\nimport type { PaymentAction, PaymentAmount, PaymentData, PaymentMethodsResponse, PaymentResponseData } from '../types/global-types';\nimport type { CoreConfiguration, ICore, AdditionalDetailsData, CoreModules, CorePropsForComponent, CreateFromActionOptions } from './types';\nimport type { UIElementProps } from '../components/internal/UIElement/types';\nimport { AnalyticsLogEvent, LogEventSubtype, LogEventType } from './Analytics/events/AnalyticsLogEvent';\nimport CancelError from './Errors/CancelError';\nimport { AnalyticsService } from './Analytics/AnalyticsService';\nimport { AnalyticsEventQueue } from './Analytics/AnalyticsEventQueue';\nimport { isAmountValid } from '../utils/amount-util';\nimport { LanguageService } from '../language/LanguageService';\n\nclass Core implements ICore {\n public session?: Session;\n public paymentMethodsResponse: PaymentMethods;\n public modules: CoreModules;\n public options: CoreConfiguration;\n\n public analyticsContext: string;\n public loadingContext: string;\n public cdnImagesUrl: string;\n public cdnTranslationsUrl: string;\n\n private components: UIElement[] = [];\n\n public static readonly metadata: { version: string; bundleType: string } = {\n version: LIBRARY_VERSION,\n bundleType: LIBRARY_BUNDLE_TYPE\n };\n\n public static readonly registry = registry;\n\n public static setBundleType(type: string): void {\n Core.metadata.bundleType = type;\n }\n\n public static register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n /**\n * Used internally by the PaymentMethod components to auto-register themselves\n * @internal\n */\n public register(...items: NewableComponent[]) {\n registry.add(...items);\n }\n\n public getComponent(txVariant: string) {\n return registry.getComponent(txVariant);\n }\n\n constructor(props: CoreConfiguration) {\n assertConfigurationPropertiesAreValid(props);\n\n this.createFromAction = this.createFromAction.bind(this);\n this.update = this.update.bind(this);\n\n this.setOptions({ ...defaultProps, ...props });\n\n const { apiUrl, analyticsUrl, cdnImagesUrl, cdnTranslationsUrl } = resolveEnvironments(\n this.options.environment,\n this.options._environmentUrls\n );\n\n this.loadingContext = apiUrl;\n this.analyticsContext = analyticsUrl;\n this.cdnImagesUrl = cdnImagesUrl;\n this.cdnTranslationsUrl = cdnTranslationsUrl;\n\n this.session = this.options.session && new Session(this.options.session, this.options.clientKey, this.loadingContext);\n\n const clientKeyType = this.options.clientKey?.substring(0, 4);\n if ((clientKeyType === 'test' || clientKeyType === 'live') && !this.loadingContext.includes(clientKeyType)) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Error: you are using a ${clientKeyType} clientKey against the ${this.options._environmentUrls?.api || this.options.environment} environment`\n );\n }\n if (clientKeyType === 'pub.') {\n console.debug(\n `The value you are passing as your \"clientKey\" looks like an originKey (${this.options.clientKey?.substring(0, 12)}..). Although this is supported it is not the recommended way to integrate. To generate a clientKey, see the documentation (https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/) for more details.`\n );\n }\n\n if (this.options.exposeLibraryMetadata) {\n window['AdyenWebMetadata'] = Core.metadata;\n }\n }\n\n public async initialize(): Promise<this> {\n await this.initializeCore();\n this.validateCoreConfiguration();\n this.createCoreModules();\n this.assignLocaleToCore();\n void this.requestAnalyticsAttemptId();\n await this.requestTranslations();\n return this;\n }\n\n private async initializeCore(): Promise<this> {\n if (this.session) {\n return this.session\n .setupSession(this.options)\n .then(sessionResponse => {\n const { amount, shopperLocale, countryCode, paymentMethods, ...rest } = sessionResponse;\n\n this.setOptions({\n ...rest,\n amount: this.options.order ? this.options.order.remainingAmount : amount,\n locale: this.options.locale || shopperLocale,\n countryCode: this.options.countryCode || countryCode\n });\n\n this.createPaymentMethodsList(paymentMethods);\n\n return this;\n })\n .catch(error => {\n if (this.options.onError) this.options.onError(error);\n return Promise.reject(error);\n });\n }\n\n this.createPaymentMethodsList();\n return Promise.resolve(this);\n }\n\n private validateCoreConfiguration(): void {\n // @ts-ignore This property does not exist, although merchants might be using when migrating from v5 to v6\n if (this.options.paymentMethodsConfiguration) {\n console.warn('WARNING: \"paymentMethodsConfiguration\" is supported only by Drop-in.');\n }\n\n if (!this.options.countryCode) {\n throw new AdyenCheckoutError(IMPLEMENTATION_ERROR, 'You must specify a countryCode when initializing checkout.');\n }\n }\n\n /**\n * Method used when handling redirects. It submits details using 'onAdditionalDetails' or the Sessions flow if available.\n *\n * @public\n * @see {https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Components&version=5.55.1#handle-the-redirect}\n * @param details - Details object containing the redirectResult\n */\n public submitDetails(details: AdditionalDetailsData['data']): void {\n let promise = null;\n\n if (this.options.onAdditionalDetails) {\n promise = new Promise((resolve, reject) => {\n this.options.onAdditionalDetails({ data: details }, undefined, { resolve, reject });\n });\n }\n\n if (this.session) {\n promise = this.session.submitDetails(details).catch(error => {\n this.options.onError?.(error);\n return Promise.reject(error);\n });\n }\n\n if (!promise) {\n this.options.onError?.(\n new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n 'It can not submit the details. The callback \"onAdditionalDetails\" or the Session is not setup correctly.'\n )\n );\n return;\n }\n\n promise\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.afterAdditionalDetails)\n .then((response: PaymentResponseData) => {\n cleanupFinalResult(response);\n this.options.onPaymentCompleted?.(response);\n })\n .catch((e: PaymentResponseData | Error) => {\n if (e instanceof CancelError) {\n return;\n }\n\n cleanupFinalResult(e as PaymentResponseData);\n this.options.onPaymentFailed?.(e as PaymentResponseData);\n });\n }\n\n private readonly afterAdditionalDetails = (response: PaymentResponseData): Promise<PaymentResponseData | Error> => {\n /**\n * After the user is redirected back, a request to `/details` or `/paymentDetails` will be made.\n * Typically, the response will not include an action object, except for the case of `paybybank_pix` payment method.\n * In terms of `paybybank_pix`, the action UIElement will be created and passed to the `afterAdditionalDetails` callback, allowing it to be mounted on the page.\n */\n if (this.options.afterAdditionalDetails && response?.action) {\n const actionEle = this.createFromAction(response.action);\n this.options.afterAdditionalDetails(actionEle);\n return Promise.reject(new CancelError('Handled by afterAdditionalDetails'));\n }\n return Promise.resolve(response);\n };\n\n /**\n * Instantiates a new element component ready to be mounted from an action object\n *\n * @param action - action defining the component with the component data\n * @param options - options that will be merged to the global Checkout props\n * @returns new UIElement\n */\n public createFromAction(action: PaymentAction, options: CreateFromActionOptions = {}): UIElement {\n if (!action || !action.type) {\n if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {\n throw new Error(\n 'createFromAction::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('createFromAction::Invalid Action - the passed action object does not have a \"type\" property');\n }\n\n if (action.type) {\n // 'threeDS2' OR 'qrCode', 'voucher', 'redirect', 'await', 'bankTransfer`\n const component = action.type === THREEDS2_FULL ? `${action.type}${action.subtype}` : action.paymentMethodType;\n\n const event = new AnalyticsLogEvent({\n type: LogEventType.action,\n subType: AnalyticsLogEvent.getSubtypeFromActionType(action.type),\n message: `${component} action was handled by the SDK`,\n component\n });\n this.modules.analytics.sendAnalytics(event);\n\n const props = {\n ...this.getCorePropsForComponent(),\n ...options\n };\n\n return getComponentForAction(this, registry, action, props);\n }\n\n return this.handleCreateError();\n }\n\n /**\n * Updates global configurations, resets the internal state and remounts each element.\n *\n * @param props - props to update\n * @param options - Can be used to avoid remounting the elements\n * @returns this - the Core instance\n */\n public update(props: Partial<Omit<CoreConfiguration, 'session'>> = {}, { shouldReinitializeCheckout = true } = {}): Promise<this> {\n if (shouldReinitializeCheckout) {\n this.setOptions(props);\n\n return this.initialize().then(() => {\n this.components.forEach(component => {\n // We update only with the new options that have been received\n const newProps: Partial<UIElementProps> = {\n ...(props.order?.remainingAmount ? { amount: props.order.remainingAmount } : { amount: this.options.amount }),\n ...(this.session && { session: this.session }),\n ...props\n };\n component.update(newProps);\n });\n return this;\n });\n }\n\n const { amount, secondaryAmount } = props;\n\n if (amount || secondaryAmount) {\n this.triggerAmountUpdate(amount, secondaryAmount);\n }\n\n return Promise.resolve(this);\n }\n\n /**\n * Validates and propagates amount updates to all mounted components.\n *\n * @param amount - Primary payment amount object (required)\n * @param secondaryAmount - Optional secondary amount for display purposes (e.g., converted currency)\n * @internal\n */\n private triggerAmountUpdate(amount: PaymentAmount, secondaryAmount?: PaymentAmount): void {\n if (!isAmountValid(amount)) {\n console.warn('Core update(): Update canceled. Invalid amount object');\n return;\n }\n\n if (secondaryAmount && !isAmountValid(secondaryAmount)) {\n console.warn('Core update(): Update canceled. Invalid secondary amount object');\n return;\n }\n\n this.setOptions({\n amount,\n ...(secondaryAmount && { secondaryAmount })\n });\n\n this.components.forEach(component => {\n component.updateAmount(amount, secondaryAmount);\n });\n }\n\n /**\n * Remove the reference of a component\n * @param component - reference to the component to be removed\n * @returns this - the element instance\n * // TODO: Do we need this?\n */\n public remove = (component): this => {\n this.components = this.components.filter(c => c._id !== component._id);\n component.unmount();\n\n return this;\n };\n\n /**\n * @internal\n * Create or update the config object passed when AdyenCheckout is initialised (environment, clientKey, etc...)\n */\n private setOptions = (options: CoreConfiguration): void => {\n this.options = {\n ...this.options,\n ...options,\n locale: options?.locale || this.options?.locale,\n // Make environment lowercase to ensure consistency\n environment: String.prototype.toLowerCase.apply(options?.environment || this.options?.environment)\n };\n };\n\n /**\n * @internal\n * @returns props for a new UIElement\n */\n public getCorePropsForComponent(): CorePropsForComponent {\n const globalOptions = processGlobalOptions(this.options);\n\n return {\n ...globalOptions,\n core: this,\n i18n: this.modules.i18n,\n modules: this.modules,\n session: this.session,\n loadingContext: this.loadingContext,\n cdnContext: this.cdnImagesUrl,\n createFromAction: this.createFromAction\n };\n }\n\n public processPayment(data: PaymentData): void {\n if (!this.session) {\n this.options.onError?.(new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'processPayment requires a session to be configured'));\n return;\n }\n\n const event = new AnalyticsLogEvent({\n type: LogEventType.submit,\n subType: LogEventSubtype.review,\n message: 'Shopper clicked pay',\n component: data.paymentMethod?.type\n });\n\n this.modules.analytics.sendAnalytics(event);\n\n this.session\n .submitPayment(data)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then((response: PaymentResponseData) => {\n if (response.action) {\n if (this.options.onAction) {\n this.options.onAction(this.createFromAction(response.action));\n } else {\n this.options.onError?.(\n new AdyenCheckoutError('IMPLEMENTATION_ERROR', 'onAction callback is required to handle payment actions')\n );\n }\n return;\n }\n const order = response.order;\n if (order && (order.remainingAmount?.value ?? 0) > 0) {\n this.options.onOrderUpdated?.({ order });\n return;\n }\n cleanupFinalResult(response);\n this.options.onPaymentCompleted?.(response);\n })\n .catch((e: PaymentResponseData | Error) => {\n if (e instanceof CancelError) return;\n cleanupFinalResult(e as PaymentResponseData);\n this.options.onPaymentFailed?.(e as PaymentResponseData);\n });\n }\n\n public storeElementReference(element: UIElement) {\n if (element) {\n this.components.push(element);\n }\n }\n\n /**\n * @internal\n */\n private handleCreateError(paymentMethod?): never {\n const paymentMethodName = paymentMethod?.name ?? 'The passed payment method';\n const errorMessage = paymentMethod\n ? `${paymentMethodName} is not a valid Checkout Component. What was passed as a txVariant was: ${JSON.stringify(\n paymentMethod\n )}. Check if this payment method is configured in the Backoffice or if the txVariant is a valid one`\n : 'No Payment Method component was passed';\n\n throw new Error(errorMessage);\n }\n\n private createPaymentMethodsList(paymentMethodsResponse?: PaymentMethodsResponse): void {\n this.paymentMethodsResponse = new PaymentMethods(this.options.paymentMethodsResponse || paymentMethodsResponse, this.options);\n }\n\n private createCoreModules(): void {\n if (this.modules) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('Core: Core modules are already created.');\n }\n return;\n }\n\n this.modules = Object.freeze({\n risk: new RiskModule(this, { ...this.options, loadingContext: this.loadingContext }),\n analytics: new Analytics({\n eventQueue: new AnalyticsEventQueue(),\n service: new AnalyticsService({\n analyticsContext: this.analyticsContext,\n clientKey: this.options.clientKey\n }),\n enabled: this.options.analytics?.enabled,\n analyticsData: this.options.analytics?.analyticsData\n }),\n resources: new Resources(this.cdnImagesUrl),\n i18n: new Language({\n locale: this.options.locale,\n customTranslations: this.options.translations,\n service: new LanguageService({\n cdnUrl: this.cdnTranslationsUrl,\n sdkVersion: Core.metadata.version\n }),\n onError: this.options?.onError\n }),\n srPanel: new SRPanel(this, { ...this.options.srConfig })\n });\n }\n\n /**\n * Retrieve the parsed locale from the i18n module and assigns it to the core options.\n */\n private assignLocaleToCore(): void {\n this.options.locale = this.modules.i18n.locale;\n }\n\n /**\n * Request translations to the CDN. If an error occurs, it will be logged to the console in development mode.\n */\n private async requestTranslations(): Promise<void> {\n try {\n await this.modules.i18n.requestTranslations();\n } catch (error: unknown) {\n console.warn('Core - requestTranslations(): Something went wrong.', error);\n }\n }\n\n private async requestAnalyticsAttemptId(): Promise<void> {\n await this.modules.analytics.setUp({\n locale: this.options.locale,\n ...(this.session?.id && { sessionId: this.session.id })\n });\n }\n}\n\nexport default Core;\n"],"names":["Core","setBundleType","type","metadata","bundleType","register","items","registry","add","getComponent","txVariant","initialize","this","initializeCore","validateCoreConfiguration","createCoreModules","assignLocaleToCore","requestAnalyticsAttemptId","requestTranslations","session","setupSession","options","then","sessionResponse","amount","shopperLocale","countryCode","paymentMethods","rest","setOptions","order","remainingAmount","locale","createPaymentMethodsList","catch","error","onError","Promise","reject","resolve","paymentMethodsConfiguration","console","warn","AdyenCheckoutError","IMPLEMENTATION_ERROR","submitDetails","details","promise","onAdditionalDetails","data","undefined","sanitizeResponse","verifyPaymentDidNotFail","afterAdditionalDetails","response","cleanupFinalResult","onPaymentCompleted","e","CancelError","onPaymentFailed","createFromAction","action","hasOwnProperty","Error","component","THREEDS2_FULL","subtype","paymentMethodType","event","AnalyticsLogEvent","LogEventType","subType","getSubtypeFromActionType","message","modules","analytics","sendAnalytics","props","getCorePropsForComponent","getComponentForAction","handleCreateError","update","shouldReinitializeCheckout","components","forEach","newProps","secondaryAmount","triggerAmountUpdate","isAmountValid","updateAmount","processGlobalOptions","core","i18n","loadingContext","cdnContext","cdnImagesUrl","processPayment","submit","LogEventSubtype","review","paymentMethod","submitPayment","onAction","value","onOrderUpdated","storeElementReference","element","push","errorMessage","name","JSON","stringify","paymentMethodsResponse","PaymentMethods","Object","freeze","risk","RiskModule","Analytics","eventQueue","AnalyticsEventQueue","service","AnalyticsService","analyticsContext","clientKey","enabled","analyticsData","resources","Resources","Language","customTranslations","translations","LanguageService","cdnUrl","cdnTranslationsUrl","sdkVersion","version","srPanel","SRPanel","srConfig","setUp","id","sessionId","constructor","_define_property","actionEle","remove","filter","c","_id","unmount","environment","String","prototype","toLowerCase","apply","assertConfigurationPropertiesAreValid","bind","defaultProps","apiUrl","analyticsUrl","resolveEnvironments","_environmentUrls","Session","clientKeyType","substring","includes","api","debug","exposeLibraryMetadata","window","LIB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jE,KAAKgD,iBAAmBhD,KAAKgD,iBAAiBiG,KAAKjJ,MACnDA,KAAKqE,OAASrE,KAAKqE,OAAO4E,KAAKjJ,MAE/BA,KAAKiB,WAAW,IAAKiI,KAAiBjF,IAEtC,MAAMkF,OAAEA,EAAMC,aAAEA,EAAYjE,aAAEA,EAAYuC,mBAAEA,GAAuB2B,EAC/DrJ,KAAKS,QAAQkI,YACb3I,KAAKS,QAAQ6I,kBAGjBtJ,KAAKiF,eAAiBkE,EACtBnJ,KAAK+G,iBAAmBqC,EACxBpJ,KAAKmF,aAAeA,EACpBnF,KAAK0H,mBAAqBA,EAE1B1H,KAAKO,QAAUP,KAAKS,QAAQF,SAAW,IAAIgJ,EAAQvJ,KAAKS,QAAQF,QAASP,KAAKS,QAAQuG,UAAWhH,KAAKiF,gBAEtG,MAAMuE,EAAgBxJ,KAAKS,QAAQuG,WAAWyC,UAAU,EAAG,GAC3D,IAAuB,SAAlBD,GAA8C,SAAlBA,KAA8BxJ,KAAKiF,eAAeyE,SAASF,GACxF,MAAM,IAAIzH,EACN,uBACA,0BAA0ByH,2BAAuCxJ,KAAKS,QAAQ6I,kBAAkBK,KAAO3J,KAAKS,QAAQkI,2BAGtG,SAAlBa,GACA3H,QAAQ+H,MACJ,0EAA0E5J,KAAKS,QAAQuG,WAAWyC,UAAU,EAAG,oQAInHzJ,KAAKS,QAAQoJ,wBACbC,OAAO,iBAAsB1K,EAAKG,SAE1C,EA/DA6I,EAbEhJ,EAaqBG,WAAoD,CACvEqI,QAASmC,EACTvK,WAAYwK,IAGhB5B,EAlBEhJ,EAkBqBO,WAAWA"}
@@ -1,2 +1,2 @@
1
- import e from"../components/ThreeDS2/ThreeDS2Challenge.js";import t from"../components/ThreeDS2/ThreeDS2DeviceFingerprint.js";import r from"../components/Redirect/Redirect.js";import{TxVariants as n}from"../components/tx-variants.js";import o from"../components/Donation/Donation.js";function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const i={[n.redirect]:r,[n.threeDS2Challenge]:e,[n.threeDS2DeviceFingerprint]:t,[n.donation]:o};var a=new class{add(...e){this.componentsMap={...this.componentsMap,...this.createComponentsMap(e)}}getComponent(e){const t=this.componentsMap[e];return t||(this.supportedTxVariants.has(e)?void 0:r)}createComponentsMap(e){return e.reduce((e,t)=>{var r;if(!("string"==typeof(r=t).type&&!!r.type))return console.error("CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement"),e;if("dropin"===t.type)return e;return[t.type,...t.txVariants].filter(e=>e).forEach(r=>{e={...e,[r]:t}}),e},{})}constructor(){s(this,"componentsMap",i),s(this,"supportedTxVariants",new Set(Object.values(n)))}};export{a as default};
1
+ import e from"../components/ThreeDS2/ThreeDS2Challenge.js";import t from"../components/ThreeDS2/ThreeDS2DeviceFingerprint.js";import r from"../components/Redirect/Redirect.js";import{TxVariants as n}from"../components/tx-variants.js";import o from"../components/Donation/Donation.js";function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const i={[n.redirect]:r,[n.threeDS2Challenge]:e,[n.threeDS2DeviceFingerprint]:t,[n.donation]:o};var a=new class{add(...e){this.componentsMap={...this.componentsMap,...this.createComponentsMap(e)}}getComponent(e){const t=this.componentsMap[e];return t||(this.supportedTxVariants.has(e)?void 0:r)}createComponentsMap(e){return e.reduce((e,t)=>{if(!function(e){const{type:t}=e;return"string"==typeof t&&!!t}(t))return console.error("CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement"),e;if("dropin"===t.type)return e;return[t.type,...t.txVariants].filter(e=>e).forEach(r=>{e={...e,[r]:t}}),e},{})}constructor(){s(this,"componentsMap",i),s(this,"supportedTxVariants",new Set(Object.values(n)))}};export{a as default};
2
2
  //# sourceMappingURL=core.registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.registry.js","sources":["../../../src/core/core.registry.ts"],"sourcesContent":["import UIElement from '../components/internal/UIElement/UIElement';\nimport ThreeDS2Challenge from '../components/ThreeDS2/ThreeDS2Challenge';\nimport ThreeDS2DeviceFingerprint from '../components/ThreeDS2/ThreeDS2DeviceFingerprint';\nimport Redirect from '../components/Redirect';\nimport { TxVariants } from '../components/tx-variants';\nimport Donation from '../components/Donation/Donation';\nimport type { ICore } from './types';\n\nfunction assertClassHasType(Class: any): Class is typeof UIElement {\n const hasValidType = typeof Class.type === 'string' && !!Class.type;\n return hasValidType;\n}\n\nexport type NewableComponent = new (checkout: ICore, props?) => UIElement;\n\nexport interface IRegistry {\n add(...items: NewableComponent[]): void;\n getComponent(type: string): NewableComponent | undefined;\n}\n\nconst defaultComponents = {\n [TxVariants.redirect]: Redirect,\n [TxVariants.threeDS2Challenge]: ThreeDS2Challenge,\n [TxVariants.threeDS2DeviceFingerprint]: ThreeDS2DeviceFingerprint,\n [TxVariants.donation]: Donation\n};\n\nclass Registry implements IRegistry {\n public componentsMap: Record<string, NewableComponent> = defaultComponents;\n\n public supportedTxVariants: Set<string> = new Set(Object.values(TxVariants));\n\n public add(...items: NewableComponent[]) {\n this.componentsMap = {\n ...this.componentsMap,\n ...this.createComponentsMap(items)\n };\n }\n\n public getComponent(type: string): NewableComponent | undefined {\n const Component = this.componentsMap[type];\n if (Component) {\n return Component;\n }\n\n if (this.supportedTxVariants.has(type)) {\n return;\n }\n\n return Redirect;\n }\n\n public createComponentsMap(components: NewableComponent[]) {\n const componentsMap = components.reduce((memo, component) => {\n const isValid = assertClassHasType(component);\n\n if (!isValid) {\n console.error('CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement');\n return memo;\n }\n if (component.type === 'dropin') {\n return memo;\n }\n\n const supportedTxVariants = [component.type, ...component.txVariants].filter(txVariant => txVariant);\n\n supportedTxVariants.forEach(txVariant => {\n memo = {\n ...memo,\n [txVariant]: component\n };\n });\n\n return memo;\n }, {});\n\n return componentsMap;\n }\n}\n\nexport default new Registry();\n"],"names":["defaultComponents","TxVariants","redirect","Redirect","threeDS2Challenge","ThreeDS2Challenge","threeDS2DeviceFingerprint","ThreeDS2DeviceFingerprint","donation","Donation","registry","add","items","this","componentsMap","createComponentsMap","getComponent","type","Component","supportedTxVariants","has","components","reduce","memo","component","Class","console","error","txVariants","filter","txVariant","forEach","_define_property","Set","Object","values"],"mappings":"oZAoBA,MAAMA,EAAoB,CACtB,CAACC,EAAWC,UAAWC,EACvB,CAACF,EAAWG,mBAAoBC,EAChC,CAACJ,EAAWK,2BAA4BC,EACxC,CAACN,EAAWO,UAAWC,GAwD3B,IAAAC,EAAe,IArDf,MAKWC,GAAAA,IAAOC,GACVC,KAAKC,cAAgB,IACdD,KAAKC,iBACLD,KAAKE,oBAAoBH,GAEpC,CAEOI,YAAAA,CAAaC,GAChB,MAAMC,EAAYL,KAAKC,cAAcG,GACrC,OAAIC,IAIAL,KAAKM,oBAAoBC,IAAIH,QAAjC,EAIOd,EACX,CAEOY,mBAAAA,CAAoBM,GAwBvB,OAvBsBA,EAAWC,OAAO,CAACC,EAAMC,KA7CvD,IAA4BC,EAgDhB,KA/CmC,iBADnBA,EA8CmBD,GA7CTP,QAAuBQ,EAAMR,MAiDnD,OADAS,QAAQC,MAAM,sFACPJ,EAEX,GAAuB,WAAnBC,EAAUP,KACV,OAAOM,EAYX,MAT4B,CAACC,EAAUP,QAASO,EAAUI,YAAYC,OAAOC,GAAaA,GAEtEC,QAAQD,IACxBP,EAAO,IACAA,EACHO,CAACA,GAAYN,KAIdD,GACR,CAAA,EAGP,eAjDAS,EAAAnB,KAAOC,gBAAkDd,GAEzDgC,EAAAnB,KAAOM,sBAAmC,IAAIc,IAAIC,OAAOC,OAAOlC"}
1
+ {"version":3,"file":"core.registry.js","sources":["../../../src/core/core.registry.ts"],"sourcesContent":["import UIElement from '../components/internal/UIElement/UIElement';\nimport ThreeDS2Challenge from '../components/ThreeDS2/ThreeDS2Challenge';\nimport ThreeDS2DeviceFingerprint from '../components/ThreeDS2/ThreeDS2DeviceFingerprint';\nimport Redirect from '../components/Redirect';\nimport { TxVariants } from '../components/tx-variants';\nimport Donation from '../components/Donation/Donation';\nimport type { ICore } from './types';\n\nexport type NewableComponent = new (checkout: ICore, props?) => UIElement;\n\n/**\n * A Class that can be registered: besides being instantiable, it must expose the\n * static members that the registry relies on to map it to its txVariants\n */\ntype RegisterableComponent = NewableComponent & Pick<typeof UIElement, 'type' | 'txVariants'>;\n\nfunction assertClassHasType(Class: NewableComponent): Class is RegisterableComponent {\n const { type } = Class as Partial<RegisterableComponent>;\n const hasValidType = typeof type === 'string' && !!type;\n return hasValidType;\n}\n\nexport interface IRegistry {\n add(...items: NewableComponent[]): void;\n getComponent(type: string): NewableComponent | undefined;\n}\n\nconst defaultComponents = {\n [TxVariants.redirect]: Redirect,\n [TxVariants.threeDS2Challenge]: ThreeDS2Challenge,\n [TxVariants.threeDS2DeviceFingerprint]: ThreeDS2DeviceFingerprint,\n [TxVariants.donation]: Donation\n};\n\nclass Registry implements IRegistry {\n public componentsMap: Record<string, NewableComponent> = defaultComponents;\n\n public supportedTxVariants: Set<string> = new Set(Object.values(TxVariants));\n\n public add(...items: NewableComponent[]) {\n this.componentsMap = {\n ...this.componentsMap,\n ...this.createComponentsMap(items)\n };\n }\n\n public getComponent(type: string): NewableComponent | undefined {\n const Component = this.componentsMap[type];\n if (Component) {\n return Component;\n }\n\n if (this.supportedTxVariants.has(type)) {\n return;\n }\n\n return Redirect;\n }\n\n public createComponentsMap(components: NewableComponent[]) {\n const componentsMap = components.reduce((memo, component) => {\n const isValid = assertClassHasType(component);\n\n if (!isValid) {\n console.error('CoreRegistry: Attempt to register Class failed. The Class is not a valid UIElement');\n return memo;\n }\n if (component.type === 'dropin') {\n return memo;\n }\n\n const supportedTxVariants = [component.type, ...component.txVariants].filter(txVariant => txVariant);\n\n supportedTxVariants.forEach(txVariant => {\n memo = {\n ...memo,\n [txVariant]: component\n };\n });\n\n return memo;\n }, {});\n\n return componentsMap;\n }\n}\n\nexport default new Registry();\n"],"names":["defaultComponents","TxVariants","redirect","Redirect","threeDS2Challenge","ThreeDS2Challenge","threeDS2DeviceFingerprint","ThreeDS2DeviceFingerprint","donation","Donation","registry","add","items","this","componentsMap","createComponentsMap","getComponent","type","Component","supportedTxVariants","has","components","reduce","memo","component","Class","assertClassHasType","console","error","txVariants","filter","txVariant","forEach","_define_property","Set","Object","values"],"mappings":"oZA2BA,MAAMA,EAAoB,CACtB,CAACC,EAAWC,UAAWC,EACvB,CAACF,EAAWG,mBAAoBC,EAChC,CAACJ,EAAWK,2BAA4BC,EACxC,CAACN,EAAWO,UAAWC,GAwD3B,IAAAC,EAAe,IArDf,MAKWC,GAAAA,IAAOC,GACVC,KAAKC,cAAgB,IACdD,KAAKC,iBACLD,KAAKE,oBAAoBH,GAEpC,CAEOI,YAAAA,CAAaC,GAChB,MAAMC,EAAYL,KAAKC,cAAcG,GACrC,OAAIC,IAIAL,KAAKM,oBAAoBC,IAAIH,QAAjC,EAIOd,EACX,CAEOY,mBAAAA,CAAoBM,GAwBvB,OAvBsBA,EAAWC,OAAO,CAACC,EAAMC,KAG3C,IA/CZ,SAA4BC,GACxB,MAAMR,KAAEA,GAASQ,EAEjB,MADqC,iBAATR,KAAuBA,CAEvD,CAyC4BS,CAAmBF,GAI/B,OADAG,QAAQC,MAAM,sFACPL,EAEX,GAAuB,WAAnBC,EAAUP,KACV,OAAOM,EAYX,MAT4B,CAACC,EAAUP,QAASO,EAAUK,YAAYC,OAAOC,GAAaA,GAEtEC,QAAQD,IACxBR,EAAO,IACAA,EACHQ,CAACA,GAAYP,KAIdD,GACR,CAAA,EAGP,eAjDAU,EAAApB,KAAOC,gBAAkDd,GAEzDiC,EAAApB,KAAOM,sBAAmC,IAAIe,IAAIC,OAAOC,OAAOnC"}
@@ -1,2 +1,2 @@
1
- import{GENERIC_OPTIONS as e}from"./config.js";function n(n){return Object.keys(n).reduce((o,t)=>(e.includes(t)&&(o[t]=n[t]),o),{})}function o(e){const n=(e=>e)(["session","environment","_environmentUrls","showPayButton","clientKey","locale","translations","paymentMethodsResponse","amount","secondaryAmount","countryCode","allowPaymentMethods","removePaymentMethods","srConfig","analytics","risk","order","donation","exposeLibraryMetadata","beforeRedirect","beforeSubmit","onPaymentCompleted","onPaymentFailed","onSubmit","onReview","onAdditionalDetails","onAction","onActionHandled","onChange","onError","onBalanceCheck","onOrderRequest","onPaymentMethodsRequest","onOrderCancel","onOrderUpdated","loadingContext","onEnterKeyPressed","afterAdditionalDetails"]);Object.keys(e).forEach(e=>{n.includes(e)||console.warn(`AdyenCheckout - Configuration property "${e}" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to "paymentMethodsConfiguration" object`)})}function t(e){const n=Object.values(e);return e=>n.includes(e)}export{o as assertConfigurationPropertiesAreValid,t as createEnumChecker,n as processGlobalOptions};
1
+ import{GENERIC_OPTIONS as e}from"./config.js";function n(n){const o=e;return Object.keys(n).reduce((e,t)=>(o.includes(t)&&(e[t]=n[t]),e),{})}function o(e){const n=(e=>e)(["session","environment","_environmentUrls","showPayButton","clientKey","locale","translations","paymentMethodsResponse","amount","secondaryAmount","countryCode","allowPaymentMethods","removePaymentMethods","srConfig","analytics","risk","order","donation","exposeLibraryMetadata","beforeRedirect","beforeSubmit","onPaymentCompleted","onPaymentFailed","onSubmit","onReview","onAdditionalDetails","onAction","onActionHandled","onChange","onError","onBalanceCheck","onOrderRequest","onPaymentMethodsRequest","onOrderCancel","onOrderUpdated","loadingContext","onEnterKeyPressed","afterAdditionalDetails"]);Object.keys(e).forEach(e=>{n.includes(e)||console.warn(`AdyenCheckout - Configuration property "${e}" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to "paymentMethodsConfiguration" object`)})}function t(e){const n=Object.values(e);return e=>n.includes(e)}export{o as assertConfigurationPropertiesAreValid,t as createEnumChecker,n as processGlobalOptions};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/core/utils.ts"],"sourcesContent":["import { GENERIC_OPTIONS } from './config';\nimport type { CoreConfiguration } from './types';\n\n/**\n * Filter properties in a global configuration object from an allow list (GENERIC_OPTIONS)\n * @param globalOptions -\n * @returns any\n */\nexport function processGlobalOptions(globalOptions) {\n return Object.keys(globalOptions).reduce((r, e) => {\n if (GENERIC_OPTIONS.includes(e)) r[e] = globalOptions[e];\n return r;\n }, {});\n}\n\n/**\n * Validates that there is no unknown property as part of the CoreConfiguration.\n * The validator makes sure to throw a lint error in case a property is added to CoreConfiguration, but it is not added here\n *\n * @param props - AdyenCheckout props\n */\nexport function assertConfigurationPropertiesAreValid(propsSetByMerchant: CoreConfiguration): void {\n /** Helper that creates a function that validates the array contain ALL CoreConfiguration properties in it */\n function createConfigurationKeysValidator<T>() {\n const arrayOfAll =\n <T>() =>\n <U extends T[]>(array: U & ([T] extends [U[number]] ? unknown : 'Invalid')) =>\n array;\n const arrayWithAllKeys = arrayOfAll<T>();\n return arrayWithAllKeys;\n }\n\n const validator = createConfigurationKeysValidator<keyof CoreConfiguration>();\n const possibleFields = validator([\n 'session',\n 'environment',\n '_environmentUrls',\n 'showPayButton',\n 'clientKey',\n 'locale',\n 'translations',\n 'paymentMethodsResponse',\n 'amount',\n 'secondaryAmount',\n 'countryCode',\n 'allowPaymentMethods',\n 'removePaymentMethods',\n 'srConfig',\n 'analytics',\n 'risk',\n 'order',\n 'donation',\n 'exposeLibraryMetadata',\n 'beforeRedirect',\n 'beforeSubmit',\n 'onPaymentCompleted',\n 'onPaymentFailed',\n 'onSubmit',\n 'onReview',\n 'onAdditionalDetails',\n 'onAction',\n 'onActionHandled',\n 'onChange',\n 'onError',\n 'onBalanceCheck',\n 'onOrderRequest',\n 'onPaymentMethodsRequest',\n 'onOrderCancel',\n 'onOrderUpdated',\n 'loadingContext',\n 'onEnterKeyPressed',\n 'afterAdditionalDetails'\n ]);\n\n Object.keys(propsSetByMerchant).forEach((prop: keyof CoreConfiguration) => {\n if (!possibleFields.includes(prop)) {\n console.warn(\n `AdyenCheckout - Configuration property \"${prop}\" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to \"paymentMethodsConfiguration\" object`\n );\n }\n });\n}\n\n/**\n * TODO: Check if this is correct place\n * Type guard for enums, helpful to make sure strings keep enum value\n * Comes from this: https://github.com/microsoft/TypeScript/issues/30611#issuecomment-570773496\n * @param enumVariable\n */\nexport function createEnumChecker<T extends string, TEnumValue extends string>(enumVariable: { [key in T]: TEnumValue }) {\n const enumValues = Object.values(enumVariable);\n return (value: string): value is TEnumValue => enumValues.includes(value);\n}\n"],"names":["processGlobalOptions","globalOptions","Object","keys","reduce","r","e","GENERIC_OPTIONS","includes","assertConfigurationPropertiesAreValid","propsSetByMerchant","possibleFields","array","validator","forEach","prop","console","warn","createEnumChecker","enumVariable","enumValues","values","value"],"mappings":"8CAQO,SAASA,EAAqBC,GACjC,OAAOC,OAAOC,KAAKF,GAAeG,OAAO,CAACC,EAAGC,KACrCC,EAAgBC,SAASF,KAAID,EAAEC,GAAKL,EAAcK,IAC/CD,GACR,CAAA,EACP,CAQO,SAASI,EAAsCC,GAWlD,MACMC,EAPE,CAAgBC,GACZA,EAMWC,CAAU,CAC7B,UACA,cACA,mBACA,gBACA,YACA,SACA,eACA,yBACA,SACA,kBACA,cACA,sBACA,uBACA,WACA,YACA,OACA,QACA,WACA,wBACA,iBACA,eACA,qBACA,kBACA,WACA,WACA,sBACA,WACA,kBACA,WACA,UACA,iBACA,iBACA,0BACA,gBACA,iBACA,iBACA,oBACA,2BAGJX,OAAOC,KAAKO,GAAoBI,QAASC,IAChCJ,EAAeH,SAASO,IACzBC,QAAQC,KACJ,2CAA2CF,8NAI3D,CAQO,SAASG,EAA+DC,GAC3E,MAAMC,EAAalB,OAAOmB,OAAOF,GACjC,OAAQG,GAAuCF,EAAWZ,SAASc,EACvE"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/core/utils.ts"],"sourcesContent":["import { GENERIC_OPTIONS } from './config';\nimport type { CoreConfiguration, GlobalOptions } from './types';\n\n/**\n * Filter properties in a global configuration object from an allow list (GENERIC_OPTIONS)\n * @param globalOptions -\n * @returns the properties of the configuration that are forwarded to the Components\n */\nexport function processGlobalOptions(globalOptions: CoreConfiguration): GlobalOptions {\n const genericOptions: readonly string[] = GENERIC_OPTIONS;\n\n return Object.keys(globalOptions).reduce<GlobalOptions>((accumulator, option) => {\n if (genericOptions.includes(option)) accumulator[option] = globalOptions[option];\n return accumulator;\n }, {});\n}\n\n/**\n * Validates that there is no unknown property as part of the CoreConfiguration.\n * The validator makes sure to throw a lint error in case a property is added to CoreConfiguration, but it is not added here\n *\n * @param props - AdyenCheckout props\n */\nexport function assertConfigurationPropertiesAreValid(propsSetByMerchant: CoreConfiguration): void {\n /** Helper that creates a function that validates the array contain ALL CoreConfiguration properties in it */\n function createConfigurationKeysValidator<T>() {\n const arrayOfAll =\n <T>() =>\n <U extends T[]>(array: U & ([T] extends [U[number]] ? unknown : 'Invalid')) =>\n array;\n const arrayWithAllKeys = arrayOfAll<T>();\n return arrayWithAllKeys;\n }\n\n const validator = createConfigurationKeysValidator<keyof CoreConfiguration>();\n const possibleFields = validator([\n 'session',\n 'environment',\n '_environmentUrls',\n 'showPayButton',\n 'clientKey',\n 'locale',\n 'translations',\n 'paymentMethodsResponse',\n 'amount',\n 'secondaryAmount',\n 'countryCode',\n 'allowPaymentMethods',\n 'removePaymentMethods',\n 'srConfig',\n 'analytics',\n 'risk',\n 'order',\n 'donation',\n 'exposeLibraryMetadata',\n 'beforeRedirect',\n 'beforeSubmit',\n 'onPaymentCompleted',\n 'onPaymentFailed',\n 'onSubmit',\n 'onReview',\n 'onAdditionalDetails',\n 'onAction',\n 'onActionHandled',\n 'onChange',\n 'onError',\n 'onBalanceCheck',\n 'onOrderRequest',\n 'onPaymentMethodsRequest',\n 'onOrderCancel',\n 'onOrderUpdated',\n 'loadingContext',\n 'onEnterKeyPressed',\n 'afterAdditionalDetails'\n ]);\n\n Object.keys(propsSetByMerchant).forEach((prop: keyof CoreConfiguration) => {\n if (!possibleFields.includes(prop)) {\n console.warn(\n `AdyenCheckout - Configuration property \"${prop}\" is not a valid AdyenCheckout property. If it is a payment method configuration, make sure to pass it directly to the Component. If you are using Drop-in, make sure to pass it to \"paymentMethodsConfiguration\" object`\n );\n }\n });\n}\n\n/**\n * TODO: Check if this is correct place\n * Type guard for enums, helpful to make sure strings keep enum value\n * Comes from this: https://github.com/microsoft/TypeScript/issues/30611#issuecomment-570773496\n * @param enumVariable\n */\nexport function createEnumChecker<T extends string, TEnumValue extends string>(enumVariable: { [key in T]: TEnumValue }) {\n const enumValues = Object.values(enumVariable);\n return (value: string): value is TEnumValue => enumValues.includes(value);\n}\n"],"names":["processGlobalOptions","globalOptions","genericOptions","GENERIC_OPTIONS","Object","keys","reduce","accumulator","option","includes","assertConfigurationPropertiesAreValid","propsSetByMerchant","possibleFields","array","validator","forEach","prop","console","warn","createEnumChecker","enumVariable","enumValues","values","value"],"mappings":"8CAQO,SAASA,EAAqBC,GACjC,MAAMC,EAAoCC,EAE1C,OAAOC,OAAOC,KAAKJ,GAAeK,OAAsB,CAACC,EAAaC,KAC9DN,EAAeO,SAASD,KAASD,EAAYC,GAAUP,EAAcO,IAClED,GACR,CAAA,EACP,CAQO,SAASG,EAAsCC,GAWlD,MACMC,EAPE,CAAgBC,GACZA,EAMWC,CAAU,CAC7B,UACA,cACA,mBACA,gBACA,YACA,SACA,eACA,yBACA,SACA,kBACA,cACA,sBACA,uBACA,WACA,YACA,OACA,QACA,WACA,wBACA,iBACA,eACA,qBACA,kBACA,WACA,WACA,sBACA,WACA,kBACA,WACA,UACA,iBACA,iBACA,0BACA,gBACA,iBACA,iBACA,oBACA,2BAGJV,OAAOC,KAAKM,GAAoBI,QAASC,IAChCJ,EAAeH,SAASO,IACzBC,QAAQC,KACJ,2CAA2CF,8NAI3D,CAQO,SAASG,EAA+DC,GAC3E,MAAMC,EAAajB,OAAOkB,OAAOF,GACjC,OAAQG,GAAuCF,EAAWZ,SAASc,EACvE"}