@adyen/adyen-web 6.0.0-beta.1 → 6.0.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 (532) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/adyen.css +9 -5
  3. package/dist/cjs/adyen.css.map +1 -1
  4. package/dist/cjs/index.cjs +2 -2
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/index.d.cts +802 -849
  7. package/dist/es/adyen.css +9 -5
  8. package/dist/es/adyen.css.map +1 -1
  9. package/dist/es/components/ANCV/ANCV.js +1 -1
  10. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  11. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  12. package/dist/es/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  13. package/dist/es/components/Card/Card.js +1 -1
  14. package/dist/es/components/Card/Card.js.map +1 -1
  15. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  16. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  17. package/dist/es/components/Card/components/CardInput/components/CVC.js +1 -1
  18. package/dist/es/components/Card/components/CardInput/components/CVC.js.map +1 -1
  19. package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
  20. package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  21. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  22. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  23. package/dist/es/components/Card/components/CardInput/components/{IframeLabelAlternative.js → FieldLabelAlternative.js} +1 -1
  24. package/dist/es/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  25. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  26. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  27. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  28. package/dist/es/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  29. package/dist/es/components/Card/components/CardInput/defaultProps.js +1 -1
  30. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  31. package/dist/es/components/CustomCard/CustomCard.js +1 -1
  32. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  33. package/dist/es/components/Donation/components/CampaignContent.js +1 -1
  34. package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
  35. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  36. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  37. package/dist/es/components/Donation/components/FixedAmounts.js +2 -0
  38. package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -0
  39. package/dist/es/components/Donation/components/Roundup.js +2 -0
  40. package/dist/es/components/Donation/components/Roundup.js.map +1 -0
  41. package/dist/es/components/Donation/components/utils.js +2 -0
  42. package/dist/es/components/Donation/components/utils.js.map +1 -0
  43. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  44. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  45. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  46. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  47. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  48. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  49. package/dist/es/components/Dropin/elements/createElements.js +1 -1
  50. package/dist/es/components/Dropin/elements/createElements.js.map +1 -1
  51. package/dist/es/components/Dropin/elements/filters.js +1 -1
  52. package/dist/es/components/Dropin/elements/filters.js.map +1 -1
  53. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  54. package/dist/es/components/Giftcard/components/GiftcardNumberField.js +1 -1
  55. package/dist/es/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  56. package/dist/es/components/Giftcard/components/GiftcardPinField.js +1 -1
  57. package/dist/es/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  58. package/dist/es/components/GooglePay/GooglePay.js +1 -1
  59. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  60. package/dist/es/components/GooglePay/components/GooglePayButton.js +1 -1
  61. package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
  62. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  63. package/dist/es/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  64. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  65. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  66. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  67. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  68. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  69. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  70. package/dist/es/components/ThreeDS2/components/utils.js +1 -1
  71. package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
  72. package/dist/es/components/UPI/UPI.js +1 -1
  73. package/dist/es/components/UPI/UPI.js.map +1 -1
  74. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  75. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  76. package/dist/es/components/UPI/components/UPIComponent/constants.js +2 -0
  77. package/dist/es/components/UPI/components/UPIComponent/constants.js.map +1 -0
  78. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  79. package/dist/es/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  80. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  81. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  82. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  83. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  84. package/dist/es/components/UPI/components/VpaInput/VpaInput.js +1 -1
  85. package/dist/es/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  86. package/dist/es/components/components-name-map.js +1 -1
  87. package/dist/es/components/components-name-map.js.map +1 -1
  88. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  89. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  90. package/dist/es/components/internal/Await/Await.js +1 -1
  91. package/dist/es/components/internal/Await/Await.js.map +1 -1
  92. package/dist/es/components/internal/Countdown/index.js +1 -1
  93. package/dist/es/components/internal/Countdown/index.js.map +1 -1
  94. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  95. package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  96. package/dist/es/components/internal/ExpandButton/ExpandButton.js +2 -0
  97. package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  98. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  99. package/dist/es/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  100. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  101. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  102. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  103. package/dist/es/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  104. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  105. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  106. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  107. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  108. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  109. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  110. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  111. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  112. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  113. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  114. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  115. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  116. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  117. package/dist/es/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  118. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  119. package/dist/es/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  120. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  121. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  122. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  123. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  124. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  125. package/dist/es/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  126. package/dist/es/components/internal/SecuredFields/utils.js +1 -1
  127. package/dist/es/components/internal/SecuredFields/utils.js.map +1 -1
  128. package/dist/es/components/tx-variants.js +1 -1
  129. package/dist/es/components/tx-variants.js.map +1 -1
  130. package/dist/es/core/Analytics/analyticsPreProcessor.js +1 -1
  131. package/dist/es/core/Analytics/analyticsPreProcessor.js.map +1 -1
  132. package/dist/es/core/Analytics/utils.js +1 -1
  133. package/dist/es/core/Analytics/utils.js.map +1 -1
  134. package/dist/es/core/Environment/constants.js +1 -1
  135. package/dist/es/core/Environment/constants.js.map +1 -1
  136. package/dist/es/core/RiskModule/RiskModule.js +1 -1
  137. package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
  138. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  139. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  140. package/dist/es/core/Services/get-translations.js +1 -1
  141. package/dist/es/core/Services/get-translations.js.map +1 -1
  142. package/dist/es/core/config.js +1 -1
  143. package/dist/es/core/config.js.map +1 -1
  144. package/dist/es/core/core.js +1 -1
  145. package/dist/es/core/core.js.map +1 -1
  146. package/dist/es/external/preact/dist/preact.js +1 -1
  147. package/dist/es/external/preact/dist/preact.js.map +1 -1
  148. package/dist/es/external/preact/hooks/dist/hooks.js +1 -1
  149. package/dist/es/external/preact/hooks/dist/hooks.js.map +1 -1
  150. package/dist/es/index.d.ts +802 -849
  151. package/dist/es/language/constants.js +1 -1
  152. package/dist/es/language/constants.js.map +1 -1
  153. package/dist/es/utils/amount-util.js.map +1 -1
  154. package/dist/es/utils/commonUtils.js +2 -0
  155. package/dist/es/utils/commonUtils.js.map +1 -0
  156. package/dist/es-legacy/adyen.css +9 -5
  157. package/dist/es-legacy/adyen.css.map +1 -1
  158. package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
  159. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  160. package/dist/es-legacy/components/Ach/Ach.js +1 -1
  161. package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
  162. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
  163. package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
  164. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js +1 -1
  165. package/dist/es-legacy/components/Ach/components/AchInput/components/AchSFInput.js.map +1 -1
  166. package/dist/es-legacy/components/Address/Address.js +1 -1
  167. package/dist/es-legacy/components/Address/Address.js.map +1 -1
  168. package/dist/es-legacy/components/Affirm/Affirm.js +1 -1
  169. package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
  170. package/dist/es-legacy/components/AfterPay/AfterPay.js +1 -1
  171. package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
  172. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js +1 -1
  173. package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.map +1 -1
  174. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  175. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  176. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js +1 -1
  177. package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
  178. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  179. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  180. package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
  181. package/dist/es-legacy/components/AmazonPay/utils.js.map +1 -1
  182. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  183. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  184. package/dist/es-legacy/components/Atome/Atome.js +1 -1
  185. package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
  186. package/dist/es-legacy/components/Atome/config.js +1 -1
  187. package/dist/es-legacy/components/Atome/config.js.map +1 -1
  188. package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
  189. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  190. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  191. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  192. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js +1 -1
  193. package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
  194. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js +1 -1
  195. package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
  196. package/dist/es-legacy/components/Blik/Blik.js +1 -1
  197. package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
  198. package/dist/es-legacy/components/Boleto/Boleto.js +1 -1
  199. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  200. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
  201. package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
  202. package/dist/es-legacy/components/Card/Bancontact.js +1 -1
  203. package/dist/es-legacy/components/Card/Bancontact.js.map +1 -1
  204. package/dist/es-legacy/components/Card/Card.js +1 -1
  205. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  206. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  207. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  208. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js +1 -1
  209. package/dist/es-legacy/components/Card/components/CardInput/components/CVC.js.map +1 -1
  210. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js +1 -1
  211. package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
  212. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  213. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  214. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js +2 -0
  215. package/dist/es-legacy/components/Card/components/CardInput/components/FieldLabelAlternative.js.map +1 -0
  216. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  217. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  218. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js +1 -1
  219. package/dist/es-legacy/components/Card/components/CardInput/components/KCPAuthentication.js.map +1 -1
  220. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
  221. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
  222. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
  223. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  224. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  225. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  226. package/dist/es-legacy/components/ClickToPay/ClickToPay.js +1 -1
  227. package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
  228. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  229. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  230. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
  231. package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
  232. package/dist/es-legacy/components/Doku/Doku.js +1 -1
  233. package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
  234. package/dist/es-legacy/components/Donation/Donation.js +1 -1
  235. package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
  236. package/dist/es-legacy/components/Donation/components/CampaignContent.js +1 -1
  237. package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
  238. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  239. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  240. package/dist/es-legacy/components/Donation/components/FixedAmounts.js +2 -0
  241. package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -0
  242. package/dist/es-legacy/components/Donation/components/Roundup.js +2 -0
  243. package/dist/es-legacy/components/Donation/components/Roundup.js.map +1 -0
  244. package/dist/es-legacy/components/Donation/components/utils.js +2 -0
  245. package/dist/es-legacy/components/Donation/components/utils.js.map +1 -0
  246. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  247. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  248. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
  249. package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
  250. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  251. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  252. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  253. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  254. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  255. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  256. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  257. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  258. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
  259. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
  260. package/dist/es-legacy/components/Dropin/elements/createElements.js +1 -1
  261. package/dist/es-legacy/components/Dropin/elements/createElements.js.map +1 -1
  262. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js +1 -1
  263. package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
  264. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js +1 -1
  265. package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
  266. package/dist/es-legacy/components/Dropin/elements/filters.js +1 -1
  267. package/dist/es-legacy/components/Dropin/elements/filters.js.map +1 -1
  268. package/dist/es-legacy/components/EPS/index.js +1 -1
  269. package/dist/es-legacy/components/EPS/index.js.map +1 -1
  270. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  271. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  272. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js +1 -1
  273. package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
  274. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js +1 -1
  275. package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
  276. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js +1 -1
  277. package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
  278. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js +1 -1
  279. package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
  280. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js +1 -1
  281. package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
  282. package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
  283. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  284. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
  285. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  286. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js +1 -1
  287. package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
  288. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js +1 -1
  289. package/dist/es-legacy/components/Giftcard/components/GiftcardNumberField.js.map +1 -1
  290. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js +1 -1
  291. package/dist/es-legacy/components/Giftcard/components/GiftcardPinField.js.map +1 -1
  292. package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
  293. package/dist/es-legacy/components/Giropay/Giropay.js.map +1 -1
  294. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  295. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  296. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js +1 -1
  297. package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
  298. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  299. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  300. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  301. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  302. package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
  303. package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
  304. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  305. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  306. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js +1 -1
  307. package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
  308. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js +1 -1
  309. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherExpiryField.js.map +1 -1
  310. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js +1 -1
  311. package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
  312. package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
  313. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  314. package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
  315. package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
  316. package/dist/es-legacy/components/OnlineBankingIN/index.js +1 -1
  317. package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
  318. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js +1 -1
  319. package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
  320. package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
  321. package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
  322. package/dist/es-legacy/components/Oxxo/Oxxo.js +1 -1
  323. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  324. package/dist/es-legacy/components/PayByBank/PayByBank.js +1 -1
  325. package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
  326. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  327. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  328. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  329. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  330. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  331. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  332. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +1 -1
  333. package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -1
  334. package/dist/es-legacy/components/PayU/PayuCashcard.js +1 -1
  335. package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
  336. package/dist/es-legacy/components/PayU/PayuNetBanking.js +1 -1
  337. package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
  338. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js +1 -1
  339. package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js.map +1 -1
  340. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  341. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  342. package/dist/es-legacy/components/RatePay/RatePay.js +1 -1
  343. package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
  344. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js +1 -1
  345. package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js.map +1 -1
  346. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  347. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  348. package/dist/es-legacy/components/Riverty/Riverty.js +1 -1
  349. package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
  350. package/dist/es-legacy/components/Sepa/Sepa.js +1 -1
  351. package/dist/es-legacy/components/Sepa/Sepa.js.map +1 -1
  352. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  353. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  354. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  355. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  356. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  357. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  358. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  359. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  360. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  361. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  362. package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
  363. package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
  364. package/dist/es-legacy/components/Trustly/Trustly.js +1 -1
  365. package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
  366. package/dist/es-legacy/components/Twint/Twint.js +1 -1
  367. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  368. package/dist/es-legacy/components/UPI/UPI.js +1 -1
  369. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  370. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  371. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  372. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js +2 -0
  373. package/dist/es-legacy/components/UPI/components/UPIComponent/constants.js.map +1 -0
  374. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js +2 -0
  375. package/dist/es-legacy/components/UPI/components/UPIComponent/useUpiSegmentedControlOptions.js.map +1 -0
  376. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +2 -0
  377. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -0
  378. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js +2 -0
  379. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppList.js.map +1 -0
  380. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js +1 -1
  381. package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
  382. package/dist/es-legacy/components/WalletIN/index.js +1 -1
  383. package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
  384. package/dist/es-legacy/components/components-name-map.js +1 -1
  385. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  386. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
  387. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  388. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
  389. package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
  390. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  391. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  392. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  393. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  394. package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
  395. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  396. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js +1 -1
  397. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  398. package/dist/es-legacy/components/internal/Await/Await.js +1 -1
  399. package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
  400. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  401. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  402. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  403. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  404. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
  405. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  406. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
  407. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  408. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js +1 -1
  409. package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
  410. package/dist/es-legacy/components/internal/Countdown/index.js +1 -1
  411. package/dist/es-legacy/components/internal/Countdown/index.js.map +1 -1
  412. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
  413. package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
  414. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +2 -0
  415. package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -0
  416. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  417. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  418. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  419. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  420. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  421. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  422. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  423. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  424. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js +1 -1
  425. package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
  426. package/dist/es-legacy/components/internal/FormFields/InputEmail.js +1 -1
  427. package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
  428. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js +1 -1
  429. package/dist/es-legacy/components/internal/FormFields/InputTelephone.js.map +1 -1
  430. package/dist/es-legacy/components/internal/FormFields/InputText.js +1 -1
  431. package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
  432. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js +1 -1
  433. package/dist/es-legacy/components/internal/FormFields/RadioGroup/RadioGroup.js.map +1 -1
  434. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  435. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  436. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  437. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  438. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
  439. package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
  440. package/dist/es-legacy/components/internal/Img/Img.js +1 -1
  441. package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
  442. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js +1 -1
  443. package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
  444. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  445. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  446. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  447. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  448. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  449. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  450. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +1 -1
  451. package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js.map +1 -1
  452. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  453. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  454. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  455. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  456. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  457. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  458. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  459. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  460. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  461. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  462. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
  463. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js.map +1 -1
  464. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js +1 -1
  465. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleValidation.js.map +1 -1
  466. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js +1 -1
  467. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/initCSF.js.map +1 -1
  468. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js +1 -1
  469. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/partials/processBrand.js.map +1 -1
  470. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js +1 -1
  471. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/getCardGroupTypes.js.map +1 -1
  472. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js +1 -1
  473. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  474. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
  475. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js.map +1 -1
  476. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js +1 -1
  477. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/commonUtils.js.map +1 -1
  478. package/dist/es-legacy/components/internal/SecuredFields/utils.js +1 -1
  479. package/dist/es-legacy/components/internal/SecuredFields/utils.js.map +1 -1
  480. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  481. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  482. package/dist/es-legacy/components/tx-variants.js +1 -1
  483. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  484. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +1 -1
  485. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +1 -1
  486. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  487. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  488. package/dist/es-legacy/core/Context/Resources.js +1 -1
  489. package/dist/es-legacy/core/Context/Resources.js.map +1 -1
  490. package/dist/es-legacy/core/Environment/constants.js +1 -1
  491. package/dist/es-legacy/core/Environment/constants.js.map +1 -1
  492. package/dist/es-legacy/core/Errors/SRPanel.js +1 -1
  493. package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
  494. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  495. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  496. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  497. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  498. package/dist/es-legacy/core/ProcessResponse/process-response.js +1 -1
  499. package/dist/es-legacy/core/ProcessResponse/process-response.js.map +1 -1
  500. package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
  501. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  502. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  503. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  504. package/dist/es-legacy/core/Services/get-translations.js +1 -1
  505. package/dist/es-legacy/core/Services/get-translations.js.map +1 -1
  506. package/dist/es-legacy/core/Services/http.js +1 -1
  507. package/dist/es-legacy/core/Services/http.js.map +1 -1
  508. package/dist/es-legacy/core/config.js +1 -1
  509. package/dist/es-legacy/core/config.js.map +1 -1
  510. package/dist/es-legacy/core/core.js +1 -1
  511. package/dist/es-legacy/core/core.js.map +1 -1
  512. package/dist/es-legacy/core/core.registry.js +1 -1
  513. package/dist/es-legacy/core/core.registry.js.map +1 -1
  514. package/dist/es-legacy/external/preact/dist/preact.js +1 -1
  515. package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
  516. package/dist/es-legacy/external/preact/hooks/dist/hooks.js +1 -1
  517. package/dist/es-legacy/external/preact/hooks/dist/hooks.js.map +1 -1
  518. package/dist/es-legacy/language/constants.js +1 -1
  519. package/dist/es-legacy/language/constants.js.map +1 -1
  520. package/dist/es-legacy/utils/amount-util.js.map +1 -1
  521. package/dist/es-legacy/utils/commonUtils.js +2 -0
  522. package/dist/es-legacy/utils/commonUtils.js.map +1 -0
  523. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  524. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  525. package/package.json +20 -20
  526. package/dist/es/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  527. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  528. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
  529. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js +0 -2
  530. package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +0 -1
  531. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js +0 -2
  532. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/ExpandButton.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/ANCVInput.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import o from"./components/ANCVAwait/config.js";import i from"../internal/Await/Await.js";import n from"../../core/Errors/SRPanelProvider.js";import a from"../../core/Errors/AdyenCheckoutError.js";import p from"../internal/PayButton/PayButton.js";import{sanitizeResponse as h,verifyPaymentDidNotFail as m}from"../internal/UIElement/utils.js";class d extends e{static type="ancv";formatData(){return{paymentMethod:{type:d.type,beneficiaryId:this.state.data?.beneficiaryId}}}onOrderRequest=t=>this.props.onOrderRequest?new Promise(((e,r)=>{this.props.onOrderRequest(e,r,t)})):this.props.session?this.props.session.createOrder():void 0;createOrder=()=>(this.setStatus("loading"),this.props.order?Promise.resolve():this.onOrderRequest(this.data).then((t=>{const e={orderData:t.orderData,pspReference:t.pspReference};return this.setState(e),Promise.resolve()})).catch((t=>{this.setStatus(t?.message||"error"),this.props.onError&&this.handleError(new a("ERROR",t))})));submit(){if(!this.isValid)return this.showValidation(),!1;this.createOrder().then(this.makePaymentsCall).then(h).then(m).then(this.handleResponse).catch(this.handleFailedResult)}payButton=e=>t(p,e);get isValid(){return!!this.state.isValid}get displayName(){return this.props.name}render(){return this.props.paymentData?t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{srPanel:this.props.modules.srPanel},t(i,{ref:t=>{this.componentRef=t},clientKey:this.props.clientKey,paymentData:this.props.paymentData,onError:this.props.onError,onComplete:this.onComplete,brandLogo:this.icon,type:this.constructor.type,messageText:this.props.i18n.get("ancv.confirmPayment"),awaitText:this.props.i18n.get("await.waitForConfirmation"),showCountdownTimer:o.showCountdownTimer,throttleTime:o.THROTTLE_TIME,throttleInterval:o.THROTTLE_INTERVAL,onActionHandled:this.props.onActionHandled}))):t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(r,{ref:t=>{this.componentRef=t},...this.props,onSubmit:this.submit,onChange:this.setState,payButton:this.payButton,showPayButton:this.props.showPayButton}))}}export{d as ANCVElement,d as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import r from"./components/ANCVInput.js";import{CoreProvider as s}from"../../core/Context/CoreProvider.js";import o from"./components/ANCVAwait/config.js";import i from"../internal/Await/Await.js";import n from"../../core/Errors/SRPanelProvider.js";import a from"../../core/Errors/AdyenCheckoutError.js";import p from"../internal/PayButton/PayButton.js";import{sanitizeResponse as h,verifyPaymentDidNotFail as m}from"../internal/UIElement/utils.js";class d extends e{static type="ancv";formatData(){return{paymentMethod:{type:d.type,beneficiaryId:this.state.data?.beneficiaryId}}}onOrderRequest=t=>this.props.onOrderRequest?new Promise(((e,r)=>{this.props.onOrderRequest(e,r,t)})):this.props.session?this.props.session.createOrder():void 0;createOrder=()=>(this.setStatus("loading"),this.props.order?Promise.resolve():this.onOrderRequest(this.data).then((t=>{const e={order:{orderData:t.orderData,pspReference:t.pspReference}};return this.setState(e),Promise.resolve()})).catch((t=>{this.setStatus(t?.message||"error"),this.props.onError&&this.handleError(new a("ERROR",t))})));submit(){if(!this.isValid)return this.showValidation(),!1;this.createOrder().then(this.makePaymentsCall).then(h).then(m).then(this.handleResponse).catch(this.handleFailedResult)}payButton=e=>t(p,e);get isValid(){return!!this.state.isValid}get displayName(){return this.props.name}render(){return this.props.paymentData?t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(n,{srPanel:this.props.modules.srPanel},t(i,{ref:t=>{this.componentRef=t},clientKey:this.props.clientKey,paymentData:this.props.paymentData,onError:this.props.onError,onComplete:this.onComplete,brandLogo:this.icon,type:this.constructor.type,messageText:this.props.i18n.get("ancv.confirmPayment"),awaitText:this.props.i18n.get("await.waitForConfirmation"),showCountdownTimer:o.showCountdownTimer,throttleTime:o.THROTTLE_TIME,throttleInterval:o.THROTTLE_INTERVAL,onActionHandled:this.props.onActionHandled}))):t(s,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(r,{ref:t=>{this.componentRef=t},...this.props,onSubmit:this.submit,onChange:this.setState,payButton:this.payButton,showPayButton:this.props.showPayButton}))}}export{d as ANCVElement,d as default};
2
2
  //# sourceMappingURL=ANCV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ANCV.js","sources":["../../../../src/components/ANCV/ANCV.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ANCVInput from './components/ANCVInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport config from './components/ANCVAwait/config';\nimport Await from '../../components/internal/Await';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport PayButton from '../internal/PayButton';\nimport { ANCVConfiguration } from './types';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nexport class ANCVElement extends UIElement<ANCVConfiguration> {\n public static type = 'ancv';\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n paymentMethod: {\n type: ANCVElement.type,\n beneficiaryId: this.state.data?.beneficiaryId\n }\n };\n }\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n this.props.onOrderRequest(resolve, reject, data);\n });\n\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n /**\n * Check if order exists, if it does Resolve.\n * Otherwise createOrder and then Resolve.\n */\n public createOrder = (): Promise<void> => {\n this.setStatus('loading');\n\n // allow for multiple ANCV payments, follow giftcard logic and just use order if it exists\n if (this.props.order) {\n return Promise.resolve();\n }\n\n return this.onOrderRequest(this.data)\n .then((order: { orderData: string; pspReference: string }) => {\n const stateOrder = { orderData: order.orderData, pspReference: order.pspReference };\n this.setState(stateOrder);\n return Promise.resolve();\n })\n .catch(error => {\n this.setStatus(error?.message || 'error');\n if (this.props.onError) this.handleError(new AdyenCheckoutError('ERROR', error));\n });\n };\n\n public submit() {\n if (!this.isValid) {\n this.showValidation();\n return false;\n }\n\n this.createOrder()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n // Reimplement payButton similar to GiftCard to allow to set onClick\n public payButton = props => {\n return <PayButton {...props} />;\n };\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n get displayName(): string {\n return this.props.name;\n }\n\n render() {\n if (this.props.paymentData) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onError={this.props.onError}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n type={this.constructor['type']}\n messageText={this.props.i18n.get('ancv.confirmPayment')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n showCountdownTimer={config.showCountdownTimer}\n throttleTime={config.THROTTLE_TIME}\n throttleInterval={config.THROTTLE_INTERVAL}\n onActionHandled={this.props.onActionHandled}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <ANCVInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onSubmit={this.submit}\n onChange={this.setState}\n payButton={this.payButton}\n showPayButton={this.props.showPayButton}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ANCVElement;\n"],"names":["ANCVElement","UIElement","static","formatData","paymentMethod","type","beneficiaryId","this","state","data","onOrderRequest","props","Promise","resolve","reject","session","createOrder","setStatus","order","then","stateOrder","orderData","pspReference","setState","catch","error","message","onError","handleError","AdyenCheckoutError","submit","isValid","showValidation","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","handleFailedResult","payButton","h","PayButton","displayName","name","render","paymentData","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","Await","ref","componentRef","clientKey","onComplete","brandLogo","icon","constructor","messageText","get","awaitText","showCountdownTimer","config","throttleTime","THROTTLE_TIME","throttleInterval","THROTTLE_INTERVAL","onActionHandled","ANCVInput","onSubmit","onChange","showPayButton"],"mappings":"qkBAYO,MAAMA,UAAoBC,EAC7BC,YAAqB,OAKrBC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAML,EAAYK,KAClBC,cAAeC,KAAKC,MAAMC,MAAMH,eAG5C,CAEQI,eAAiBD,GACjBF,KAAKI,MAAMD,eACJ,IAAIE,SAAQ,CAACC,EAASC,KACzBP,KAAKI,MAAMD,eAAeG,EAASC,EAAQL,EAAAA,IAG/CF,KAAKI,MAAMI,QACJR,KAAKI,MAAMI,QAAQC,mBAD9B,EASJA,YAAqB,KACjBT,KAAKU,UAAU,WAGXV,KAAKI,MAAMO,MACJN,QAAQC,UAGZN,KAAKG,eAAeH,KAAKE,MAC3BU,MAAMD,IACH,MAAME,EAAa,CAAEC,UAAWH,EAAMG,UAAWC,aAAcJ,EAAMI,cAErE,OADAf,KAAKgB,SAASH,GACPR,QAAQC,SAAO,IAEzBW,OAAMC,IACHlB,KAAKU,UAAUQ,GAAOC,SAAW,SAC7BnB,KAAKI,MAAMgB,SAASpB,KAAKqB,YAAY,IAAIC,EAAmB,QAASJ,GAAAA,KAI9EK,MAAAA,GACH,IAAKvB,KAAKwB,QAEN,OAD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AI1C"}
1
+ {"version":3,"file":"ANCV.js","sources":["../../../../src/components/ANCV/ANCV.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ANCVInput from './components/ANCVInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport config from './components/ANCVAwait/config';\nimport Await from '../../components/internal/Await';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport PayButton from '../internal/PayButton';\nimport { ANCVConfiguration } from './types';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nexport class ANCVElement extends UIElement<ANCVConfiguration> {\n public static type = 'ancv';\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n paymentMethod: {\n type: ANCVElement.type,\n beneficiaryId: this.state.data?.beneficiaryId\n }\n };\n }\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n this.props.onOrderRequest(resolve, reject, data);\n });\n\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n /**\n * Check if order exists, if it does Resolve.\n * Otherwise createOrder and then Resolve.\n */\n public createOrder = (): Promise<void> => {\n this.setStatus('loading');\n\n // allow for multiple ANCV payments, follow giftcard logic and just use order if it exists\n if (this.props.order) {\n return Promise.resolve();\n }\n\n return this.onOrderRequest(this.data)\n .then((order: { orderData: string; pspReference: string }) => {\n const stateOrder = { order: { orderData: order.orderData, pspReference: order.pspReference } };\n this.setState(stateOrder);\n return Promise.resolve();\n })\n .catch(error => {\n this.setStatus(error?.message || 'error');\n if (this.props.onError) this.handleError(new AdyenCheckoutError('ERROR', error));\n });\n };\n\n public submit() {\n if (!this.isValid) {\n this.showValidation();\n return false;\n }\n\n this.createOrder()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n // Reimplement payButton similar to GiftCard to allow to set onClick\n public payButton = props => {\n return <PayButton {...props} />;\n };\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n get displayName(): string {\n return this.props.name;\n }\n\n render() {\n if (this.props.paymentData) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onError={this.props.onError}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n type={this.constructor['type']}\n messageText={this.props.i18n.get('ancv.confirmPayment')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n showCountdownTimer={config.showCountdownTimer}\n throttleTime={config.THROTTLE_TIME}\n throttleInterval={config.THROTTLE_INTERVAL}\n onActionHandled={this.props.onActionHandled}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <ANCVInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onSubmit={this.submit}\n onChange={this.setState}\n payButton={this.payButton}\n showPayButton={this.props.showPayButton}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ANCVElement;\n"],"names":["ANCVElement","UIElement","static","formatData","paymentMethod","type","beneficiaryId","this","state","data","onOrderRequest","props","Promise","resolve","reject","session","createOrder","setStatus","order","then","stateOrder","orderData","pspReference","setState","catch","error","message","onError","handleError","AdyenCheckoutError","submit","isValid","showValidation","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","handleFailedResult","payButton","h","PayButton","displayName","name","render","paymentData","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","Await","ref","componentRef","clientKey","onComplete","brandLogo","icon","constructor","messageText","get","awaitText","showCountdownTimer","config","throttleTime","THROTTLE_TIME","throttleInterval","THROTTLE_INTERVAL","onActionHandled","ANCVInput","on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AMwC,QAAQD,SACzCX,EAACa,EAAAA,CACGC,IAAKA,IACD9C,KAAK+C,aAAeD,CAAAA,EAExBE,UAAWhD,KAAKI,MAAM4C,UACtBX,YAAarC,KAAKI,MAAMiC,YACxBjB,QAASpB,KAAKI,MAAMgB,QACpB6B,WAAYjD,KAAKiD,WACjBC,UAAWlD,KAAKmD,KAChBrD,KAAME,KAAKoD,YAAmB,KAC9BC,YAAarD,KAAKI,MAAMmC,KAAKe,IAAI,uBACjCC,UAAWvD,KAAKI,MAAMmC,KAAKe,IAAI,6BAC/BE,mBAAoBC,EAAOD,mBAC3BE,aAAcD,EAAOE,cACrBC,iBAAkBH,EAAOI,kBACzBC,gBAAiB9D,KAAKI,MAAM0D,oBAQ5C9B,EAACM,EAAAA,CAAaC,KAAMvC,KAAKI,MAAMmC,KAAMC,eAAgBxC,KAAKI,MAAMoC,eAAgBC,UAAWzC,KAAKyC,WAC5FT,EAAC+B,EAAAA,CACGjB,IAAKA,IACD9C,KAAK+C,aAAeD,CAAAA,KAEpB9C,KAAKI,MACT4D,SAAUhE,KAAKuB,OACf0C,SAAUjE,KAAKgB,SACfe,UAAW/B,KAAK+B,UAChBmC,cAAelE,KAAKI,MAAM8D,gBAI1C"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import r from"../../../../Card/components/CardInput/components/DataSfSpan.js";import{alternativeLabelContent as n}from"../../../../Card/components/CardInput/components/IframeLabelAlternative.js";import{capitalizeFirstLetter as o}from"../../../../../utils/textUtils.js";const s=({id:s,dataInfo:i,className:l="",label:d,focused:c,filled:m,errorMessage:p="",isValid:u=!1,onFocusField:f,dir:_})=>{const F=`encrypted${o(s)}`;return e(a,{label:d,focused:c,filled:m,classNameModifiers:[s],onFocusField:()=>f(F),errorMessage:p,isValid:u,className:l,dir:_,name:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:n},e(r,{encryptedFieldType:F,"data-info":i,className:t({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":p.length,"adyen-checkout__input--focus":c,"adyen-checkout__input--valid":u})}))};export{s as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import r from"../../../../Card/components/CardInput/components/DataSfSpan.js";import{alternativeLabelContent as n}from"../../../../Card/components/CardInput/components/FieldLabelAlternative.js";import{capitalizeFirstLetter as o}from"../../../../../utils/textUtils.js";const s=({id:s,dataInfo:i,className:l="",label:d,focused:c,filled:m,errorMessage:p="",isValid:u=!1,onFocusField:f,dir:F})=>{const _=`encrypted${o(s)}`;return e(a,{label:d,focused:c,filled:m,classNameModifiers:[s],onFocusField:()=>f(_),errorMessage:p,isValid:u,className:l,dir:F,name:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:n},e(r,{encryptedFieldType:_,"data-info":i,className:t({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__input--error":p.length,"adyen-checkout__input--focus":c,"adyen-checkout__input--valid":u})}))};export{s as default};
2
2
  //# sourceMappingURL=AchSFInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AchSFInput.js","sources":["../../../../../../../src/components/Ach/components/AchInput/components/AchSFInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport DataSfSpan from '../../../../Card/components/CardInput/components/DataSfSpan';\nimport { alternativeLabelContent } from '../../../../Card/components/CardInput/components/IframeLabelAlternative';\nimport { capitalizeFirstLetter } from '../../../../../utils/textUtils';\n\nconst AchSFInput = ({ id, dataInfo, className = '', label, focused, filled, errorMessage = '', isValid = false, onFocusField, dir }) => {\n const capitalisedId = capitalizeFirstLetter(id);\n const encryptedIdStr = `encrypted${capitalisedId}`;\n\n return (\n <Field\n label={label}\n focused={focused}\n filled={filled}\n classNameModifiers={[id]}\n onFocusField={() => onFocusField(encryptedIdStr)}\n errorMessage={errorMessage}\n isValid={isValid}\n className={className}\n dir={dir}\n name={id}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={encryptedIdStr}\n data-info={dataInfo}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': errorMessage.length,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n </Field>\n );\n};\n\nexport default AchSFInput;\n"],"names":["AchSFInput","id","dataInfo","className","label","focused","filled","errorMessage","isValid","onFocusField","dir","encryptedIdStr","capitalizeFirstLetter","h","Field","classNameModifiers","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","classNames","length"],"mappings":"odAOMA,MAAAA,EAAa,EAAGC,KAAIC,WAAUC,YAAY,GAAIC,QAAOC,UAASC,SAAQC,eAAe,GAAIC,WAAU,EAAOC,eAAcC,UAC1H,MACMC,EAAiB,YADDC,EAAsBX,KAG5C,OACIY,EAACC,EAAAA,CACGV,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRS,mBAAoB,CAACd,GACrBQ,aAAc,IAAMA,EAAaE,GACjCJ,aAAcA,EACdC,QAASA,EACTL,UAAWA,EACXO,IAAKA,EACLM,KAAMf,EACNgB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BP,EAACQ,EAAAA,CACGC,mBAAoBX,EACpBY,YAAWrB,EACXC,UAAWqB,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,+BAAgCjB,EAAakB,OAC7C,+BAAgCpB,EAChC,+BAAgCG"}
1
+ {"version":3,"file":"AchSFInput.js","sources":["../../../../../../../src/components/Ach/components/AchInput/components/AchSFInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport DataSfSpan from '../../../../Card/components/CardInput/components/DataSfSpan';\nimport { alternativeLabelContent } from '../../../../Card/components/CardInput/components/FieldLabelAlternative';\nimport { capitalizeFirstLetter } from '../../../../../utils/textUtils';\n\nconst AchSFInput = ({ id, dataInfo, className = '', label, focused, filled, errorMessage = '', isValid = false, onFocusField, dir }) => {\n const capitalisedId = capitalizeFirstLetter(id);\n const encryptedIdStr = `encrypted${capitalisedId}`;\n\n return (\n <Field\n label={label}\n focused={focused}\n filled={filled}\n classNameModifiers={[id]}\n onFocusField={() => onFocusField(encryptedIdStr)}\n errorMessage={errorMessage}\n isValid={isValid}\n className={className}\n dir={dir}\n name={id}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={encryptedIdStr}\n data-info={dataInfo}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__input--error': errorMessage.length,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n </Field>\n );\n};\n\nexport default AchSFInput;\n"],"names":["AchSFInput","id","dataInfo","className","label","focused","filled","errorMessage","isValid","onFocusField","dir","encryptedIdStr","capitalizeFirstLetter","h","Field","classNameModifiers","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","data-info","classNames","length"],"mappings":"mdAOMA,MAAAA,EAAa,EAAGC,KAAIC,WAAUC,YAAY,GAAIC,QAAOC,UAASC,SAAQC,eAAe,GAAIC,WAAU,EAAOC,eAAcC,UAC1H,MACMC,EAAiB,YADDC,EAAsBX,KAG5C,OACIY,EAACC,EAAAA,CACGV,MAAOA,EACPC,QAASA,EACTC,OAAQA,EACRS,mBAAoB,CAACd,GACrBQ,aAAc,IAAMA,EAAaE,GACjCJ,aAAcA,EACdC,QAASA,EACTL,UAAWA,EACXO,IAAKA,EACLM,KAAMf,EACNgB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1BP,EAACQ,EAAAA,CACGC,mBAAoBX,EACpBY,YAAWrB,EACXC,UAAWqB,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,+BAAgCjB,EAAakB,OAC7C,+BAAgCpB,EAChC,+BAAgCG"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import s from"../../utils/browserInfo.js";import r from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{reject as i,fieldTypeToSnakeCase as n}from"../internal/SecuredFields/utils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import p from"../internal/ClickToPay/services/create-clicktopay-service.js";import c from"./components/ClickToPayWrapper.js";import l from"../../core/Errors/SRPanelProvider.js";import{TxVariants as u}from"../tx-variants.js";import{UIElement as d}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as f,ANALYTICS_UNFOCUS_STR as b,ANALYTICS_VALIDATION_ERROR_STR as g}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as P}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as C}from"../../utils/hasOwnProperty.js";import S,{IMPLEMENTATION_ERROR as k}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as T}from"../../core/Errors/utils.js";import{SF_ErrorCodes as B}from"../../core/Errors/constants.js";class R extends d{static type=u.scheme;clickToPayService;clickToPayRef=null;constructor(t,o){super(t,o),o&&!o._disableClickToPay&&(this.clickToPayService=p(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),this.clickToPayService?.initialize())}static defaultProps={onBinLookup:()=>{},_disableClickToPay:!1};setStatus(t,o){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,o),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t,o),this}setClickToPayRef=t=>{this.clickToPayRef=t};formatProps(t){const o=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,e=!(0===t.amount?.value)&&o,s=t.storedPaymentMethodId||t.id,r=s&&t?.supportedShopperInteractions?.includes("Ecommerce");if(s&&!r)throw new S(k,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,brand:t.brand??u.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:t.session?.configuration?.installmentOptions||t.installmentOptions,enableStoreDetails:o,showStoreDetailsCheckbox:e,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...s&&{storedPaymentMethodId:s}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:R.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...a(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}onBrand=t=>{this.props.onBrand?.(t)};processBinLookupResponse(t,o=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}handleClickToPaySubmit=t=>{this.setState({data:{...t},valid:{},errors:{},isValid:!0}),this.submit()};onBinLookup(t){if(!t.isReset){const o=i("supportedBrandsRaw").from(t);this.props.onBinLookup(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&C(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t)}onConfigSuccess=t=>{this.submitAnalytics({type:y}),this.props.onConfigSuccess?.(t)};onFocus=t=>{this.submitAnalytics({type:f,target:n(t.fieldType)}),P.includes(t.fieldType)?this.props.onFocus?.(t.event):this.props.onFocus?.(t)};onBlur=t=>{this.submitAnalytics({type:b,target:n(t.fieldType)}),P.includes(t.fieldType)?this.props.onBlur?.(t.event):this.props.onBlur?.(t)};onValidationErrorAnalytics=t=>{this.submitAnalytics({type:g,target:n(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:T(t.errorCode,B)})};onBinValue=r(this);get storePaymentMethodPayload(){if(this.props.storedPaymentMethodId?.length>0)return{};if(0===this.props.amount?.value)return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>({icon:o[t]?.icon??this.props.modules.resources.getImage()(t),name:t}))):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||R.type}get accessibleName(){return(this.props.name||R.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return s()}payButton=o=>{const e=0===this.props.amount?.value,s=this.props.storedPaymentMethodId?.length>0;return t(h,{...o,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:e&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})};renderCardInput(e=!0){return t(o,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess})}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(l,{srPanel:this.props.modules.srPanel},t(c,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}}export{R as CardElement,R as default};
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import o from"./components/CardInput/CardInput.js";import{CoreProvider as e}from"../../core/Context/CoreProvider.js";import s from"../../utils/browserInfo.js";import r from"../internal/SecuredFields/binLookup/triggerBinLookUp.js";import{fieldTypeToSnakeCase as i}from"../internal/SecuredFields/utils.js";import{reject as n}from"../../utils/commonUtils.js";import{hasValidInstallmentsObject as a}from"./components/CardInput/utils.js";import p from"../internal/ClickToPay/services/create-clicktopay-service.js";import c from"./components/ClickToPayWrapper.js";import l from"../../core/Errors/SRPanelProvider.js";import{TxVariants as d}from"../tx-variants.js";import{UIElement as u}from"../internal/UIElement/UIElement.js";import h from"../internal/PayButton/PayButton.js";import{ANALYTICS_RENDERED_STR as m,ANALYTICS_CONFIGURED_STR as y,ANALYTICS_FOCUS_STR as f,ANALYTICS_UNFOCUS_STR as b,ANALYTICS_VALIDATION_ERROR_STR as g}from"../../core/Analytics/constants.js";import{ALL_SECURED_FIELDS as C}from"../internal/SecuredFields/lib/constants.js";import{hasOwnProperty as P}from"../../utils/hasOwnProperty.js";import S,{IMPLEMENTATION_ERROR as k}from"../../core/Errors/AdyenCheckoutError.js";import{getErrorMessageFromCode as T}from"../../core/Errors/utils.js";import{SF_ErrorCodes as R}from"../../core/Errors/constants.js";import B from"./components/CardInput/defaultProps.js";class I extends u{static type=d.scheme;clickToPayService;clickToPayRef=null;constructor(t,o){super(t,o),o&&!o._disableClickToPay&&(this.clickToPayService=p(this.props.configuration,this.props.clickToPayConfiguration,this.props.environment),this.clickToPayService?.initialize())}static defaultProps={showFormInstruction:!0,_disableClickToPay:!1,doBinLookup:!0,...n(["type","setComponentRef"]).from(B)};setStatus(t,o){return this.componentRef?.setStatus&&this.componentRef.setStatus(t,o),this.clickToPayRef?.setStatus&&this.clickToPayRef.setStatus(t,o),this}setClickToPayRef=t=>{this.clickToPayRef=t};formatProps(t){const o=t.session?.configuration?.enableStoreDetails??t.enableStoreDetails,e=!(0===t.amount?.value)&&o,s=t.storedPaymentMethodId||t.id,r=s&&t?.supportedShopperInteractions?.includes("Ecommerce");if(s&&!r)throw new S(k,"You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions");return{...t,holderNameRequired:!!t.hasHolderName&&t.holderNameRequired,hasCVC:!(t.brand&&"bcmc"===t.brand||t.hideCVC),billingAddressRequired:!t.storedPaymentMethodId&&t.billingAddressRequired,billingAddressMode:t.onAddressLookup?B.billingAddressMode:t.billingAddressMode,brand:t.brand??d.card,countryCode:t.countryCode?t.countryCode.toLowerCase():null,configuration:{...t.configuration,socialSecurityNumberMode:t.configuration?.socialSecurityNumberMode??"auto"},brandsConfiguration:t.brandsConfiguration||t.configuration?.brandsConfiguration||{},icon:t.icon||t.configuration?.icon,installmentOptions:t.session?.configuration?.installmentOptions||t.installmentOptions,enableStoreDetails:o,showStoreDetailsCheckbox:e,clickToPayConfiguration:{...t.clickToPayConfiguration,disableOtpAutoFocus:t.clickToPayConfiguration?.disableOtpAutoFocus||!1,shopperEmail:t.clickToPayConfiguration?.shopperEmail||this.core.options?.session?.shopperEmail,telephoneNumber:t.clickToPayConfiguration?.telephoneNumber||this.core.options?.session?.telephoneNumber,locale:t.clickToPayConfiguration?.locale||t.i18n?.locale?.replace("-","_")},...s&&{storedPaymentMethodId:s}}}formatData(){const t=this.state.selectedBrandValue;return{paymentMethod:{type:I.type,...this.state.data,...this.props.storedPaymentMethodId&&{storedPaymentMethodId:this.props.storedPaymentMethodId},...t&&{brand:t},...this.props.fundingSource&&{fundingSource:this.props.fundingSource}},...this.state.billingAddress&&{billingAddress:this.state.billingAddress},...this.state.socialSecurityNumber&&{socialSecurityNumber:this.state.socialSecurityNumber},...this.storePaymentMethodPayload,...a(this.state.installments)&&{installments:this.state.installments},browserInfo:this.browserInfo,origin:!!window&&window.location.origin}}updateStyles(t){return this.componentRef?.updateStyles&&this.componentRef.updateStyles(t),this}setFocusOn(t){return this.componentRef?.setFocusOn&&this.componentRef.setFocusOn(t),this}onBrand=t=>{this.props.onBrand?.(t)};processBinLookupResponse(t,o=!1){return this.componentRef?.processBinLookupResponse&&this.componentRef.processBinLookupResponse(t,o),this}handleUnsupportedCard(t){return this.componentRef?.handleUnsupportedCard&&this.componentRef.handleUnsupportedCard(t),this}handleClickToPaySubmit=t=>{this.setState({data:{...t},valid:{},errors:{},isValid:!0}),this.submit()};onBinLookup(t){if(!t.isReset){const o=n("supportedBrandsRaw").from(t);this.props.onBinLookup(o)}}submitAnalytics(t){const{type:o}=t;o!==m&&o!==y||"scheme"===this.constructor.type&&P(this.props,"supportedShopperInteractions")&&(t.isStoredPaymentMethod=!0,t.brand=this.props.brand),super.submitAnalytics(t,this.props)}onConfigSuccess=t=>{this.submitAnalytics({type:y}),this.props.onConfigSuccess?.(t)};onFocus=t=>{this.submitAnalytics({type:f,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onFocus?.(t.event):this.props.onFocus?.(t)};onBlur=t=>{this.submitAnalytics({type:b,target:i(t.fieldType)}),C.includes(t.fieldType)?this.props.onBlur?.(t.event):this.props.onBlur?.(t)};onValidationErrorAnalytics=t=>{this.submitAnalytics({type:g,target:i(t.fieldType),validationErrorCode:t.errorCode,validationErrorMessage:T(t.errorCode,R)})};onBinValue=r(this);get storePaymentMethodPayload(){if(this.props.storedPaymentMethodId?.length>0)return{};if(0===this.props.amount?.value)return this.props.enableStoreDetails?{storePaymentMethod:!0}:{};return this.props.showStoreDetailsCheckbox&&void 0!==this.state.storePaymentMethod?{storePaymentMethod:Boolean(this.state.storePaymentMethod)}:{}}get isValid(){return!!this.state.isValid}get icon(){return this.props.icon??this.resources.getImage()(this.props.brand)}get brands(){const{brands:t,brandsConfiguration:o}=this.props;return t?t.map((t=>({icon:o[t]?.icon??this.props.modules.resources.getImage()(t),name:t}))):[]}get displayName(){return this.props.storedPaymentMethodId?`•••• ${this.props.lastFour}`:this.props.name||I.type}get accessibleName(){return(this.props.name||I.type)+(this.props.storedPaymentMethodId?" "+this.props.i18n.get("creditCard.storedCard.description.ariaLabel").replace("%@",this.props.lastFour):"")}get browserInfo(){return s()}payButton=o=>{const e=0===this.props.amount?.value,s=this.props.storedPaymentMethodId?.length>0;return t(h,{...o,amount:this.props.amount,secondaryAmount:this.props.secondaryAmount,label:e&&!s?this.props.i18n.get("payButton.saveDetails"):"",onClick:this.submit})};renderCardInput(e=!0){return t(o,{setComponentRef:this.setComponentRef,...this.props,...this.state,onChange:this.setState,onSubmit:this.submit,handleKeyPress:this.handleKeyPress,payButton:this.payButton,onBrand:this.onBrand,onBinValue:this.onBinValue,brand:this.props.brand,brandsIcons:this.brands,isPayButtonPrimaryVariant:e,resources:this.resources,onFocus:this.onFocus,onBlur:this.onBlur,onValidationErrorAnalytics:this.onValidationErrorAnalytics,onConfigSuccess:this.onConfigSuccess})}render(){return t(e,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(l,{srPanel:this.props.modules.srPanel},t(c,{amount:this.props.amount,configuration:this.props.clickToPayConfiguration,clickToPayService:this.clickToPayService,isStandaloneComponent:!1,setClickToPayRef:this.setClickToPayRef,onSetStatus:this.setElementStatus,onSubmit:this.handleClickToPaySubmit,onError:this.handleError},(t=>this.renderCardInput(t)))))}}export{I as CardElement,I as default};
2
2
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase, reject } from '../internal/SecuredFields/utils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport { UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport { PayButtonProps } from '../internal/PayButton/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n onBinLookup: () => {},\n _disableClickToPay: false\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration) {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // ...(props.brands && !props.groupTypes && { groupTypes: props.brands }),\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && { storedPaymentMethodId: this.props.storedPaymentMethodId }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n // Override\n protected payButton = (props: PayButtonProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","static","TxVariants","scheme","clickToPayService","clickToPayRef","constructor","checkout","props","super","_disableClickToPay","this","createClickToPayService","configuration","clickToPayConfiguration","environment","initialize","onBinLookup","setStatus","status","componentRef","setClickToPayRef","ref","formatProps","enableStoreDetails","session","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","onBrand","event","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","handleClickToPaySubmit","payload","setState","valid","errors","isValid","submit","obj","nuObj","reject","from","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","hasOwnProperty","isStoredPaymentMethod","onConfigSuccess","onFocus","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","onBlur","ANALYTICS_UNFOCUS_STR","onValidationErrorAnalytics","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onBinValue","triggerBinLookUp","length","storePaymentMethod","Boolean","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","payButton","isZeroAuth","isStoredCard","h","PayButton","secondaryAmount","label","onClick","renderCardInput","isCardPrimaryInput","CardInput","setComponentRef","onChange","onSubmit","handleKeyPress","brandsIcons","isPayButtonPrimaryVariant","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","isStandaloneComponent","onSetStatus","setElementStatus","onError","handleError"],"mappings":"q0CAkCO,MAAMA,UAAoBC,EAC7BC,YAAqBC,EAAWC,OAEfC,kBAKTC,cAAgB,KAExBC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAEZA,IAAUA,EAAME,qBAChBC,KAAKP,kBAAoBQ,EAAwBD,KAAKH,MAAMK,cAAeF,KAAKH,MAAMM,wBAAyBH,KAAKH,MAAMO,aACrHJ,KAAKP,mBAAmBY,aAErC,CAEAf,oBAAgC,CAC5BgB,YAAa,OACbP,oBAAoB,GAGjBQ,SAAAA,CA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E,IAAI,yBAA2B,GACpFS,QAASnI,KAAKiF,UAKlBmD,eAAAA,CAAgBC,GAAqB,GACzC,OACIN,EAACO,EAAAA,CACGC,gBAAiBvI,KAAKuI,mBAClBvI,KAAKH,SACLG,KAAKiD,MACTuF,SAAUxI,KAAK6E,SACf4D,SAAUzI,KAAKiF,OACfyD,eAAgB1I,KAAK0I,eACrBd,UAAW5H,KAAK4H,UAChBxD,QAASpE,KAAKoE,QACdwC,WAAY5G,KAAK4G,WACjB/E,MAAO7B,KAAKH,MAAMgC,MAClB8G,YAAa3I,KAAKmH,OAClByB,0BAA2BP,EAC3BpB,UAAWjH,KAAKiH,UAChBpB,QAAS7F,KAAK6F,QACdM,OAAQnG,KAAKmG,OACbE,2BAA4BrG,KAAKqG,2BACjCT,gBAAiB5F,KAAK4F,iBAGlC,CAEAiD,MAAAA,GACI,OACId,EAACe,EAAAA,CAAajG,KAAM7C,KAAKH,MAAMgD,KAAMkG,eAAgB/I,KAAKH,MAAMkJ,eAAgB9B,UAAWjH,KAAKiH,WAC5Fc,EAACiB,EAAAA,CAAgBC,QAASjJ,KAAKH,MAAMwH,QAAQ4B,SACzClB,EAACmB,EAAAA,CACGlI,OAAQhB,KAAKH,MAAMmB,OACnBd,cAAeF,KAAKH,MAAMM,wBAC1BV,kBAAmBO,KAAKP,kBACxB0J,uBAAuB,EACvBzI,iBAAkBV,KAAKU,iBACvB0I,YAAapJ,KAAKqJ,iBAClBZ,SAAUzI,KAAK2E,uBACf2E,QAAStJ,KAAKuJ,cAEblB,GAAsBrI,KAAKoI,gBAAgBC,MAKhE"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { reject } from '../../utils/commonUtils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && { storedPaymentMethodId: this.props.storedPaymentMethodId }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n // const includeStorePaymentMethod = this.props.enableStoreDetails && typeof this.state.storePaymentMethod !== 'undefined';\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonFunctionProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","static","TxVariants","scheme","clickToPayService","clickToPayRef","constructor","checkout","props","super","_disableClickToPay","this","createClickToPayService","configuration","clickToPayConfiguration","environment","initialize","showFormInstruction","doBinLookup","reject","from","CardInputDefaultProps","setStatus","status","componentRef","setClickToPayRef","ref","formatProps","enableStoreDetails","session","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","paymentMethod","type","data","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","onBrand","event","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","handleClickToPaySubmit","payload","setState","valid","errors","isValid","submit","onBinLookup","obj","nuObj","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","hasOwnProperty","isStoredPaymentMethod","onConfigSuccess","onFocus","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","onBlur","ANALYTICS_UNFOCUS_STR","onValidationErrorAnalytics","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onBinValue","triggerBinLookUp","length","storePaymentMethod","Boolean","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","payButton","isZeroAuth","isStoredCard","h","PayButton","secondaryAmount","label","onClick","renderCardInput","isCardPrimaryInput","CardInput","setComponentRef","onChange","onSubmit","handleKeyPress","brandsIcons","isPayButtonPrimaryVariant","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","isStandaloneComponent","onSetStatus","setElementStatus","onError","handleError"],"mappings":"m6CAmCO,MAAMA,UAAoBC,EAC7BC,YAAqBC,EAAWC,OAEfC,kBAKTC,cAAgB,KAExBC,WAAAA,CAAYC,EAAiBC,GACzBC,MAAMF,EAAUC,GAEZA,IAAUA,EAAME,qBAChBC,KAAKP,kBAAoBQ,EAAwBD,KAAKH,MAAMK,cAAeF,KAAKH,MAAMM,wBAAyBH,KAAKH,MAAMO,aACrHJ,KAAKP,mBAAmBY,aAErC,CAEAf,oBAAgC,CAC5BgB,qBAAqB,EACrBP,oBAAoB,EACpBQ,aAAa,KAEVC,EAAO,CAAC,OAAQ,oBAAoBC,KAAKC,IAGzCC,SAAAA,CAAUC,EAAyBf,GAOtC,OANIG,KAAKa,cAAcF,WACnBX,KAAKa,aAAaF,UAAUC,EAAQf,GAEpCG,KAAKN,eAAeiB,WACpBX,KAAKN,cAAciB,UAAUC,EAAQf,GAElCG,IACX,CAEQc,iBAAmBC,IACvBf,KAAKN,cAAgBqB,CAAAA,EAGzBC,WAAAA,CAAYnB,GAER,MAAMoB,EAAqBpB,EAAMqB,SAAShB,eAAee,oBAAsBpB,EAAMoB,mBAG/EE,IADqC,IAAxBtB,EAAMuB,QAAQC,QACqBJ,EAEhDK,EAAezB,E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QAAS1E,KAAK0E,QACduC,WAAYjH,KAAKiH,WACjBhF,MAAOjC,KAAKH,MAAMoC,MAClB+G,YAAahJ,KAAKwH,OAClByB,0BAA2BP,EAC3BpB,UAAWtH,KAAKsH,UAChBpB,QAASlG,KAAKkG,QACdM,OAAQxG,KAAKwG,OACbE,2BAA4B1G,KAAK0G,2BACjCT,gBAAiBjG,KAAKiG,iBAGlC,CAEAiD,MAAAA,GACI,OACId,EAACe,EAAAA,CAAahG,KAAMnD,KAAKH,MAAMsD,KAAMiG,eAAgBpJ,KAAKH,MAAMuJ,eAAgB9B,UAAWtH,KAAKsH,WAC5Fc,EAACiB,EAAAA,CAAgBC,QAAStJ,KAAKH,MAAM6H,QAAQ4B,SACzClB,EAACmB,EAAAA,CACGnI,OAAQpB,KAAKH,MAAMuB,OACnBlB,cAAeF,KAAKH,MAAMM,wBAC1BV,kBAAmBO,KAAKP,kBACxB+J,uBAAuB,EACvB1I,iBAAkBd,KAAKc,iBACvB2I,YAAazJ,KAAK0J,iBAClBZ,SAAU9I,KAAKiF,uBACf0E,QAAS3J,KAAK4J,cAEblB,GAAsB1I,KAAKyI,gBAAgBC,MAKhE"}
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as s,useMemo as t,useState as o,useCallback as n,useEffect as a}from"../../../../external/preact/hooks/dist/hooks.js";import i from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import l from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{ENCRYPTED_CARD_NUMBER as u,DATE_POLICY_REQUIRED as c,CVC_POLICY_REQUIRED as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputFormatters as p,cardInputValidationRules as h,getRuleByNameAndMode as f}from"./validate.js";import y from"../../../internal/SecuredFields/binLookup/extensions.js";import b from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as N,extractPropsForSFP as S,extractPropsForCardFields as g,getLayout as A}from"./utils.js";import F from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as C}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as j}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as k,getFocusHandler as x,getAddressHandler as R}from"./handlers.js";import P from"../../../../external/classnames/index.js";import{getPartialAddressValidationRules as v}from"../../../internal/Address/validate.js";import w from"../../../../core/Context/useImage.js";import{getArrayDifferences as I}from"../../../../utils/arrayUtils.js";import B from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as V}from"../../../internal/Icon/constants.js";import E from"./useSRPanelForCardInputErrors.js";const O=l=>{const O=s(null),q=s(!1),M=w(),D=s(null),_=e=>{D.current=e},L=s({});Object.keys(L.current).length||l.setComponentRef(L.current);const T=s(0),K=s(!1),H=t((()=>new F(l.specifications)),[l.specifications]);L.current.sfp=O;const[U,z]=o("ready"),[W,$]=o({}),[G,J]=o({...l.holderNameRequired&&{holderName:!1}}),[Q,X]=o({...l.hasHolderName&&{holderName:l.data.holderName??""}}),[Y,Z]=o(""),[ee,re]=o(!1),[se,te]=o(c),[oe,ne]=o(m),[ae,ie]=o(null),[le,de]=o([]),[ue,ce]=o(l.storedPaymentMethodId?l.brand:""),me=l.billingAddressMode!==d.none&&l.billingAddressRequired,pe=N(l.billingAddressMode),he=s(pe&&l.data?.billingAddress?.country),[fe,ye]=o(!1),[be,Ne]=o(me?l.data.billingAddress:null),[Se,ge]=o(!1),[Ae,Fe]=o(""),[Ce,je]=o({value:null}),[ke,xe]=o(null),{handleChangeFor:Re,triggerValidation:Pe,data:ve,valid:we,errors:Ie,setSchema:Be,setData:Ve,setValid:Ee,setErrors:Oe}=b({schema:[],defaultData:l.data,formatters:p,rules:h}),qe=!!Object.keys(l.installmentOptions).length&&"debit"!==l.fundingSource,Me=l.showInstallmentAmounts??!0,De="kr"===(ae??l.countryCode),_e=l.configuration.koreanAuthenticationRequired&&De,Le=Se&&"auto"===l.configuration.socialSecurityNumberMode||"show"===l.configuration.socialSecurityNumberMode,Te=(e,r)=>{l.onFocus({fieldType:e,event:r})},Ke=(e,r)=>{l.onBlur({fieldType:e,event:r})},He=x(Z,Te,Ke),Ue=()=>A({props:l,showKCP:_e,showBrazilianSSN:Le,...l.billingAddressRequired&&{countrySpecificSchemas:H.getAddressSchemaForCountry(be?.country),billingAddressRequiredFields:l.billingAddressRequiredFields}}),ze=n((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;xe(r)}),[]),We=R(Ve,Ee,Oe),$e=k(K,O,Ue()),Ge=t((()=>y(l,{sfp:O},{dualBrandSelectElements:le,setDualBrandSelectElements:de,setSelectedBrandValue:ce,issuingCountryCode:ae,setIssuingCountryCode:ie},T)),[le,ae]);L.current.showValidation=()=>{q.current=!0,Xe?.(),O.current.showValidation(),Pe(["holderName","socialSecurityNumber","taxNumber"]),D?.current&&D.current.showValidation()},L.current.processBinLookupResponse=(e,r)=>{Ge.processBinLookup(e,r)},L.current.setStatus=z,a((()=>(L.current.setFocusOn=O.current.setFocusOn,L.current.updateStyles=O.current.updateStyles,L.current.handleUnsupportedCard=O.current.handleUnsupportedCard,()=>{O.current.destroy()})),[]),a((()=>{const e=[...l.hasHolderName?["holderName"]:[],...Le?["socialSecurityNumber"]:[],..._e?["taxNumber"]:[],...me?["billingAddress"]:[]];Be(e)}),[l.hasHolderName,Le,_e]),a((()=>{X({...Q,holderName:ve.holderName??"",taxNumber:ve.taxNumber}),Fe(ve.socialSecurityNumber),me&&Ne({...ve.billingAddress}),J({...G,holderName:!l.holderNameRequired||we.holderName,socialSecurityNumber:!!we.socialSecurityNumber&&we.socialSecurityNumber,taxNumber:!!we.taxNumber&&we.taxNumber,billingAddress:!!we.billingAddress&&we.billingAddress});const e=!!Ie.billingAddress&&Object.entries(Ie.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);$({...W,holderName:l.holderNameRequired&&Ie.holderName?Ie.holderName:null,socialSecurityNumber:Le&&Ie.socialSecurityNumber?Ie.socialSecurityNumber:null,taxNumber:_e&&Ie.taxNumber?Ie.taxNumber:null,billingAddress:me&&e?Ie.billingAddress:null})}),[ve,we,Ie]);const{sortedErrorList:Je,previousSortedErrors:Qe,clearSRPanel:Xe}=E({errors:W,props:l,isValidating:q,retrieveLayout:Ue,specifications:H,billingAddress:be,sfp:O});a((()=>{const e=G.holderName,r=ee,s=!me||G.billingAddress,t=!_e||!!G.taxNumber&&!!G.encryptedPassword,o=!Le||!!G.socialSecurityNumber,n=r&&e&&s&&t&&o,a=O.current.mapErrorsToValidationRuleResult(),i={...W,...a};if(Je){const e=I(Je,Qe,"field");e?.forEach((e=>{const r={fieldType:e.field,errorCode:e.errorCode};l.onValidationErrorAnalytics(r)}))}l.onChange({data:Q,valid:G,errors:i,isValid:n,billingAddress:be,selectedBrandValue:ue,storePaymentMethod:fe,socialSecurityNumber:Ae,installments:Ce})}),[Q,G,W,ue,fe,Ce]);const Ye=l.storedPaymentMethodId?C:j;return e(r,null,e(i,{ref:O,...S(l),styles:{...l.styles},koreanAuthenticationRequired:l.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!l.configuration.koreanAuthenticationRequired||"kr"!==l.countryCode),onChange:(e,r)=>{if(e.autoCompleteName){if(!l.hasHolderName)return;const r=f("holderName","blur")(e.autoCompleteName)?e.autoCompleteName:null;r&&(Ve("holderName",r),Ee("holderName",!0),Oe("holderName",null))}else l.autoFocus&&T.current>0&&"handleOnFieldValid"===r?.event&&r?.fieldType===u&&e.valid.encryptedCardNumber&&$e(),X({...Q,...e.data}),$({...W,...e.errors}),J({...G,...e.valid}),re(e.isSfpValid),ne(e.cvcPolicy),ge(e.showSocialSecurityNumber),te(e.expiryDatePolicy)},onBrand:l.onBrand,onFocus:He,type:l.brand,disableIOSArrowKeys:l.disableIOSArrowKeys?ze:null,render:({setRootNode:r,setFocusOn:s},t)=>e("div",{ref:r,className:P({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${l.fundingSource??"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===U}),role:"form"},e(B,null),e(Ye,{...g(l),data:Q,valid:G,errors:W,handleChangeFor:Re,focusedElement:Y,setFocusOn:s,sfpState:t,cvcPolicy:oe,hasInstallments:qe,showAmountsInInstallments:Me,handleInstallments:je,brandsIcons:l.brandsIcons,formData:ve,formErrors:Ie,formValid:we,expiryDatePolicy:se,dualBrandSelectElements:le,extensions:Ge,selectedBrandValue:ue,showKCP:_e,showBrazilianSSN:Le,socialSecurityNumber:Ae,handleOnStoreDetails:ye,setAddressRef:_,billingAddress:be,billingAddressValidationRules:pe&&v(he.current),partialAddressSchema:pe,handleAddress:We,onAddressLookup:l.onAddressLookup,onAddressSelected:l.onAddressSelected,addressSearchDebounceMs:l.addressSearchDebounceMs,iOSFocusedField:ke,onFieldFocusAnalytics:Te,onFieldBlurAnalytics:Ke}))}),l.showPayButton&&l.payButton({status:U,variant:l.isPayButtonPrimaryVariant?"primary":"secondary",icon:M({imageFolder:"components/"})(`${V}lock`)}))};O.defaultProps=l;export{O as default};
1
+ import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as s,useMemo as t,useState as o,useCallback as n,useEffect as a}from"../../../../external/preact/hooks/dist/hooks.js";import i from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import l from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{ENCRYPTED_CARD_NUMBER as u,DATE_POLICY_REQUIRED as c,CVC_POLICY_REQUIRED as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputFormatters as p,cardInputValidationRules as h,getRuleByNameAndMode as f}from"./validate.js";import y from"../../../internal/SecuredFields/binLookup/extensions.js";import b from"../../../../utils/useForm/useForm.js";import{handlePartialAddressMode as N,extractPropsForSFP as S,extractPropsForCardFields as g,getLayout as A}from"./utils.js";import F from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as C}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as j}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as k,getFocusHandler as x,getAddressHandler as R}from"./handlers.js";import P from"../../../../external/classnames/index.js";import{getPartialAddressValidationRules as v}from"../../../internal/Address/validate.js";import w from"../../../../core/Context/useImage.js";import{getArrayDifferences as I}from"../../../../utils/arrayUtils.js";import B from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as V}from"../../../internal/Icon/constants.js";import E from"./useSRPanelForCardInputErrors.js";const O=l=>{const O=s(null),q=s(!1),M=w(),D=s(null),_=e=>{D.current=e},L=s({});Object.keys(L.current).length||l.setComponentRef(L.current);const T=s(0),K=s(!1),H=t((()=>new F(l.specifications)),[l.specifications]);L.current.sfp=O;const[U,z]=o("ready"),[W,$]=o({}),[G,J]=o({...l.holderNameRequired&&{holderName:!1}}),[Q,X]=o({...l.hasHolderName&&{holderName:l.data.holderName??""}}),[Y,Z]=o(""),[ee,re]=o(!1),[se,te]=o(c),[oe,ne]=o(m),[ae,ie]=o(null),[le,de]=o([]),[ue,ce]=o(l.storedPaymentMethodId?l.brand:""),me=l.billingAddressMode!==d.none&&l.billingAddressRequired,pe=N(l.billingAddressMode),he=s(pe&&l.data?.billingAddress?.country),[fe,ye]=o(!1),[be,Ne]=o(me?l.data.billingAddress:null),[Se,ge]=o(!1),[Ae,Fe]=o(""),[Ce,je]=o({value:null}),[ke,xe]=o(null),{handleChangeFor:Re,triggerValidation:Pe,data:ve,valid:we,errors:Ie,setSchema:Be,setData:Ve,setValid:Ee,setErrors:Oe}=b({schema:[],defaultData:l.data,formatters:p,rules:h}),qe=!!Object.keys(l.installmentOptions).length&&"debit"!==l.fundingSource,Me=l.showInstallmentAmounts??!0,De="kr"===(ae??l.countryCode),_e=l.configuration.koreanAuthenticationRequired&&De,Le=Se&&"auto"===l.configuration.socialSecurityNumberMode||"show"===l.configuration.socialSecurityNumberMode,Te=(e,r)=>{l.onFocus({fieldType:e,event:r})},Ke=(e,r)=>{l.onBlur({fieldType:e,event:r})},He=x(Z,Te,Ke),Ue=()=>A({props:l,showKCP:_e,showBrazilianSSN:Le,...l.billingAddressRequired&&{countrySpecificSchemas:H.getAddressSchemaForCountry(be?.country),billingAddressRequiredFields:l.billingAddressRequiredFields}}),ze=n((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;xe(r)}),[]),We=R(Ve,Ee,Oe),$e=k(K,O,Ue()),Ge=t((()=>y(l,{sfp:O},{dualBrandSelectElements:le,setDualBrandSelectElements:de,setSelectedBrandValue:ce,issuingCountryCode:ae,setIssuingCountryCode:ie},T)),[le,ae]);L.current.showValidation=()=>{q.current=!0,Xe?.(),O.current.showValidation(),Pe(["holderName","socialSecurityNumber","taxNumber"]),D?.current&&D.current.showValidation()},L.current.processBinLookupResponse=(e,r)=>{Ge.processBinLookup(e,r)},L.current.setStatus=z,a((()=>(L.current.setFocusOn=O.current.setFocusOn,L.current.updateStyles=O.current.updateStyles,L.current.handleUnsupportedCard=O.current.handleUnsupportedCard,()=>{O.current.destroy()})),[]),a((()=>{const e=[...l.hasHolderName?["holderName"]:[],...Le?["socialSecurityNumber"]:[],..._e?["taxNumber"]:[],...me?["billingAddress"]:[]];Be(e)}),[l.hasHolderName,Le,_e]),a((()=>{X({...Q,holderName:ve.holderName??"",taxNumber:ve.taxNumber}),Fe(ve.socialSecurityNumber),me&&Ne({...ve.billingAddress}),J({...G,holderName:!l.holderNameRequired||we.holderName,socialSecurityNumber:!!we.socialSecurityNumber&&we.socialSecurityNumber,taxNumber:!!we.taxNumber&&we.taxNumber,billingAddress:!!we.billingAddress&&we.billingAddress});const e=!!Ie.billingAddress&&Object.entries(Ie.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);$({...W,holderName:l.holderNameRequired&&Ie.holderName?Ie.holderName:null,socialSecurityNumber:Le&&Ie.socialSecurityNumber?Ie.socialSecurityNumber:null,taxNumber:_e&&Ie.taxNumber?Ie.taxNumber:null,billingAddress:me&&e?Ie.billingAddress:null})}),[ve,we,Ie]);const{sortedErrorList:Je,previousSortedErrors:Qe,clearSRPanel:Xe}=E({errors:W,props:l,isValidating:q,retrieveLayout:Ue,specifications:H,billingAddress:be,sfp:O});if(Je){const e=I(Je,Qe,"field");e?.forEach((e=>{const r={fieldType:e.field,errorCode:e.errorCode};l.onValidationErrorAnalytics(r)}))}a((()=>{const e=G.holderName,r=ee,s=!me||G.billingAddress,t=!_e||!!G.taxNumber&&!!G.encryptedPassword,o=!Le||!!G.socialSecurityNumber,n=r&&e&&s&&t&&o,a=O.current.mapErrorsToValidationRuleResult(),i={...W,...a};l.onChange({data:Q,valid:G,errors:i,isValid:n,billingAddress:be,selectedBrandValue:ue,storePaymentMethod:fe,socialSecurityNumber:Ae,installments:Ce})}),[Q,G,W,ue,fe,Ce]);const Ye=l.storedPaymentMethodId?C:j;return e(r,null,e(i,{ref:O,...S(l),styles:{...l.styles},koreanAuthenticationRequired:l.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!l.configuration.koreanAuthenticationRequired||"kr"!==l.countryCode),onChange:(e,r)=>{if(e.autoCompleteName){if(!l.hasHolderName)return;const r=f("holderName","blur")(e.autoCompleteName)?e.autoCompleteName:null;r&&(Ve("holderName",r),Ee("holderName",!0),Oe("holderName",null))}else l.autoFocus&&T.current>0&&"handleOnFieldValid"===r?.event&&r?.fieldType===u&&e.valid.encryptedCardNumber&&$e(),X({...Q,...e.data}),$({...W,...e.errors}),J({...G,...e.valid}),re(e.isSfpValid),ne(e.cvcPolicy),ge(e.showSocialSecurityNumber),te(e.expiryDatePolicy)},onBrand:l.onBrand,onFocus:He,type:l.brand,disableIOSArrowKeys:l.disableIOSArrowKeys?ze:null,render:({setRootNode:r,setFocusOn:s},t)=>e("div",{ref:r,className:P({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${l.fundingSource??"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===U}),role:"form"},e(B,null),e(Ye,{...g(l),data:Q,valid:G,errors:W,handleChangeFor:Re,focusedElement:Y,setFocusOn:s,sfpState:t,cvcPolicy:oe,hasInstallments:qe,showAmountsInInstallments:Me,handleInstallments:je,brandsIcons:l.brandsIcons,formData:ve,formErrors:Ie,formValid:we,expiryDatePolicy:se,dualBrandSelectElements:le,extensions:Ge,selectedBrandValue:ue,showKCP:_e,showBrazilianSSN:Le,socialSecurityNumber:Ae,handleOnStoreDetails:ye,setAddressRef:_,billingAddress:be,billingAddressValidationRules:pe&&v(he.current),partialAddressSchema:pe,handleAddress:We,onAddressLookup:l.onAddressLookup,onAddressSelected:l.onAddressSelected,addressSearchDebounceMs:l.addressSearchDebounceMs,iOSFocusedField:ke,onFieldFocusAnalytics:Te,onFieldBlurAnalytics:Ke}))}),l.showPayButton&&l.payButton({status:U,variant:l.isPayButtonPrimaryVariant?"primary":"secondary",icon:M({imageFolder:"components/"})(`${V}lock`)}))};O.defaultProps=l;export{O as default};
2
2
  //# sourceMappingURL=CardInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CbObjOnFocus } from '../../../internal/SecuredFields/lib/types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n // Analytics\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n newErrors?.forEach(errorItem => {\n const aObj: FieldErrorAnalyticsObject = {\n fieldType: errorItem.field,\n errorCode: errorItem.errorCode\n };\n\n props.onValidationErrorAnalytics(aObj);\n });\n }\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={props.onBrand}\n onFocus={handleFocus}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n <FormInstruction />\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n {props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","useCallback","obj","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","newErrors","getArrayDifferences","forEach","errorItem","aObj","field","errorCode","onValidationErrorAnalytics","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onBrand","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"wlDA+BA,MAAMA,EAAaC,IACf,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAeR,EAAqB,CAAA,GAErCS,OAAOC,KAAKF,EAAaD,SAASI,QACnCb,EAAM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EtBsI,qBAAsB1I,GAEtBtD,cAAeA,EACfmD,eAAgBA,GAChB8I,8BAA+BjJ,IAAwBkJ,EAAiChJ,GAAsBhD,SAC9G8C,qBAAsBA,GACtBiE,cAAeA,GACfkF,gBAAiB1M,EAAM0M,gBACvBC,kBAAmB3M,EAAM2M,kBACzBC,wBAAyB5M,EAAM4M,wBAE/BtI,gBAAiBA,GAEjB8B,sBAAuBA,GACvBM,qBAAsBA,QAKrC1G,EAAM6M,eACH7M,EAAM8M,UAAU,CACZ1L,SACA2L,QAAS/M,EAAMgN,0BAA4B,UAAY,YACvDC,KAAM7M,EAAS,CAAE8M,YAAa,eAAxB9M,CAAyC,GAAG+M,WACtD,EAKhBpN,EAAUqN,aAAeA"}
1
+ {"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CbObjOnFocus } from '../../../internal/SecuredFields/lib/types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n // Analytics: ValidationErrors\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n newErrors?.forEach(errorItem => {\n const aObj: FieldErrorAnalyticsObject = {\n fieldType: errorItem.field,\n errorCode: errorItem.errorCode\n };\n\n props.onValidationErrorAnalytics(aObj);\n });\n }\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={props.onBrand}\n onFocus={handleFocus}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n <FormInstruction />\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n {props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","useCallback","obj","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","aObj","field","errorCode","onValidationErrorAnalytics","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onBrand","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"wlDA+BA,MAAMA,EAAaC,IACf,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAeR,EAAqB,CAAA,GAErCS,OAAOC,KAAKF,EAAaD,SAASI,QACnCb,EAAMc,gBAAgBJ,EAAaD,SAGvC,MAAMM,EAAkBb,EAAO,GACzBc,EAAgBd,GAAO,GAEvBe,EAAiBC,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J,GAAsBhD,SAC9G8C,qBAAsBA,GACtBiE,cAAeA,GACfkF,gBAAiB1M,EAAM0M,gBACvBC,kBAAmB3M,EAAM2M,kBACzBC,wBAAyB5M,EAAM4M,wBAE/BtI,gBAAiBA,GAEjB8B,sBAAuBA,GACvBM,qBAAsBA,QAKrC1G,EAAM6M,eACH7M,EAAM8M,UAAU,CACZ1L,SACA2L,QAAS/M,EAAMgN,0BAA4B,UAAY,YACvDC,KAAM7M,EAAS,CAAE8M,YAAa,eAAxB9M,CAAyC,GAAG+M,WACtD,EAKhBpN,EAAUqN,aAAeA"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import o from"./CVCHint.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as r}from"../../../../../core/Context/CoreProvider.js";import{CVC_POLICY_HIDDEN as c,CVC_POLICY_OPTIONAL as i,ENCRYPTED_SECURITY_CODE as n,CVC_POLICY_REQUIRED as l}from"../../../../internal/SecuredFields/lib/constants.js";import s from"./DataSfSpan.js";import{alternativeLabelContent as d}from"./IframeLabelAlternative.js";function u(u){const{label:m,onFocusField:_=(()=>{}),error:f="",className:p="",classNameModifiers:y=[],focused:C,filled:h,isValid:x,frontCVC:F=!1,cvcPolicy:b=l,showContextualElement:k,contextualText:v}=u,{i18n:j}=r(),V=t(p,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":b===c,"adyen-checkout__field__cvc--optional":b===i}),N=t({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":C,"adyen-checkout__input--valid":x}),T=b!==i?m:j.get("creditCard.securityCode.label.optional");return e(a,{label:T,focused:C,filled:h,classNameModifiers:[...y,"securityCode"],onFocusField:()=>_(n),className:V,errorMessage:f,isValid:x,dir:"ltr",name:n,i18n:j,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:d,showContextualElement:k,contextualText:v},e(s,{encryptedFieldType:n,className:N}),e(o,{frontCVC:F,fieldLabel:T}))}export{u as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../external/classnames/index.js";import o from"./CVCHint.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as r}from"../../../../../core/Context/CoreProvider.js";import{CVC_POLICY_HIDDEN as i,CVC_POLICY_OPTIONAL as c,ENCRYPTED_SECURITY_CODE as l,CVC_POLICY_REQUIRED as n}from"../../../../internal/SecuredFields/lib/constants.js";import s from"./DataSfSpan.js";import{alternativeLabelContent as d}from"./FieldLabelAlternative.js";function u(u){const{label:_,onFocusField:m=()=>{},error:f="",className:p="",classNameModifiers:y=[],focused:C,filled:h,isValid:x,frontCVC:F=!1,cvcPolicy:b=n,showContextualElement:k,contextualText:v}=u,{i18n:j}=r(),V=t(p,{"adyen-checkout__field__cvc":!0,"adyen-checkout__card__cvc__input--hidden":b===i,"adyen-checkout__field__cvc--optional":b===c}),N=t({"adyen-checkout__input":!0,"adyen-checkout__input--small":!0,"adyen-checkout__card__cvc__input":!0,"adyen-checkout__input--error":f,"adyen-checkout__input--focus":C,"adyen-checkout__input--valid":x}),T=b!==c?_:j.get("creditCard.securityCode.label.optional");return e(a,{label:T,focused:C,filled:h,classNameModifiers:[...y,"securityCode"],onFocusField:()=>m(l),className:V,errorMessage:f,isValid:x,dir:"ltr",name:l,i18n:j,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:d,showContextualElement:k,contextualText:v},e(s,{encryptedFieldType:l,className:N}),e(o,{frontCVC:F,fieldLabel:T}))}export{u as default};
2
2
  //# sourceMappingURL=CVC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CVC.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVC.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport CVCHint from './CVCHint';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CVCProps } from './types';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n CVC_POLICY_REQUIRED,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport DataSfSpan from './DataSfSpan';\nimport { alternativeLabelContent } from './IframeLabelAlternative';\n\nexport default function CVC(props: CVCProps) {\n const {\n label,\n onFocusField = () => {},\n error = '',\n className = '',\n classNameModifiers = [],\n focused,\n filled,\n isValid,\n frontCVC = false,\n cvcPolicy = CVC_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__cvc': true,\n 'adyen-checkout__card__cvc__input--hidden': cvcPolicy === CVC_POLICY_HIDDEN,\n 'adyen-checkout__field__cvc--optional': cvcPolicy === CVC_POLICY_OPTIONAL\n });\n\n const cvcClassnames = classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--small': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n });\n\n const fieldLabel = cvcPolicy !== CVC_POLICY_OPTIONAL ? label : i18n.get('creditCard.securityCode.label.optional');\n\n return (\n <Field\n label={fieldLabel}\n focused={focused}\n filled={filled}\n classNameModifiers={[...classNameModifiers, 'securityCode']}\n onFocusField={() => onFocusField(ENCRYPTED_SECURITY_CODE)}\n className={fieldClassnames}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_SECURITY_CODE}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan encryptedFieldType={ENCRYPTED_SECURITY_CODE} className={cvcClassnames} />\n\n <CVCHint frontCVC={frontCVC} fieldLabel={fieldLabel} />\n </Field>\n );\n}\n"],"names":["CVC","props","label","onFocusField","error","className","classNameModifiers","focused","filled","isValid","frontCVC","cvcPolicy","CVC_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","fieldClassnames","classNames","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","cvcClassnames","fieldLabel","get","h","Field","ENCRYPTED_SECURITY_CODE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","CVCHint"],"mappings":"4jBAee,SAASA,EAAIC,GACxB,MAAMC,MACFA,EAAKC,aACLA,EAAe,SAAQC,MACvBA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,QACvBA,EAAOC,OACPA,EAAMC,QACNA,EAAOC,SACPA,GAAW,EAAKC,UAChBA,EAAYC,EAAmBC,sBAC/BA,EAAqBC,eACrBA,GACAb,GACEc,KAAEA,GAASC,IAEXC,EAAkBC,EAAWb,EAAW,CAC1C,8BAA8B,EAC9B,2CAA4CM,IAAcQ,EAC1D,uCAAwCR,IAAcS,IAGpDC,EAAgBH,EAAW,CAC7B,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCd,EAChC,+BAAgCG,EAChC,+BAAgCE,IAG9Ba,EAAaX,IAAcS,EAAsBlB,EAAQa,EAAKQ,IAAI,0CAExE,OACIC,EAACC,EAAAA,CACGvB,MAAOoB,EACPf,QAASA,EACTC,OAAQA,EACRF,mBAAoB,IAAIA,EAAoB,gBAC5CH,aAAc,IAAMA,EAAauB,GACjCrB,UAAWY,EACXU,aAAcvB,EACdK,QAASA,EACTmB,IAAK,MACLC,KAAMH,EACNX,KAAMA,EACNe,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BpB,sBAAuBA,EACvBC,eAAgBA,GAEhBU,EAACU,EAAAA,CAAWC,mBAAoBT,EAAyBrB,UAAWgB,IAEpEG,EAACY,EAAAA,CAAQ1B,SAAUA,EAAUY,WAAYA,IAGrD"}
1
+ {"version":3,"file":"CVC.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVC.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport CVCHint from './CVCHint';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CVCProps } from './types';\nimport {\n CVC_POLICY_HIDDEN,\n CVC_POLICY_OPTIONAL,\n CVC_POLICY_REQUIRED,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport DataSfSpan from './DataSfSpan';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CVC(props: CVCProps) {\n const {\n label,\n onFocusField = () => {},\n error = '',\n className = '',\n classNameModifiers = [],\n focused,\n filled,\n isValid,\n frontCVC = false,\n cvcPolicy = CVC_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__cvc': true,\n 'adyen-checkout__card__cvc__input--hidden': cvcPolicy === CVC_POLICY_HIDDEN,\n 'adyen-checkout__field__cvc--optional': cvcPolicy === CVC_POLICY_OPTIONAL\n });\n\n const cvcClassnames = classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--small': true,\n 'adyen-checkout__card__cvc__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n });\n\n const fieldLabel = cvcPolicy !== CVC_POLICY_OPTIONAL ? label : i18n.get('creditCard.securityCode.label.optional');\n\n return (\n <Field\n label={fieldLabel}\n focused={focused}\n filled={filled}\n classNameModifiers={[...classNameModifiers, 'securityCode']}\n onFocusField={() => onFocusField(ENCRYPTED_SECURITY_CODE)}\n className={fieldClassnames}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_SECURITY_CODE}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan encryptedFieldType={ENCRYPTED_SECURITY_CODE} className={cvcClassnames} />\n\n <CVCHint frontCVC={frontCVC} fieldLabel={fieldLabel} />\n </Field>\n );\n}\n"],"names":["CVC","props","label","onFocusField","error","className","classNameModifiers","focused","filled","isValid","frontCVC","cvcPolicy","CVC_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","fieldClassnames","classNames","CVC_POLICY_HIDDEN","CVC_POLICY_OPTIONAL","cvcClassnames","fieldLabel","get","h","Field","ENCRYPTED_SECURITY_CODE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","CVCHint"],"mappings":"2jBAee,SAASA,EAAIC,GACxB,MAAMC,MACFA,EAAKC,aACLA,EAAe,OAAQC,MACvBA,EAAQ,GAAEC,UACVA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,QACvBA,EAAOC,OACPA,EAAMC,QACNA,EAAOC,SACPA,GAAW,EAAKC,UAChBA,EAAYC,EAAmBC,sBAC/BA,EAAqBC,eACrBA,GACAb,GACEc,KAAEA,GAASC,IAEXC,EAAkBC,EAAWb,EAAW,CAC1C,8BAA8B,EAC9B,2CAA4CM,IAAcQ,EAC1D,uCAAwCR,IAAcS,IAGpDC,EAAgBH,EAAW,CAC7B,yBAAyB,EACzB,gCAAgC,EAChC,oCAAoC,EACpC,+BAAgCd,EAChC,+BAAgCG,EAChC,+BAAgCE,IAG9Ba,EAAaX,IAAcS,EAAsBlB,EAAQa,EAAKQ,IAAI,0CAExE,OACIC,EAACC,EAAAA,CACGvB,MAAOoB,EACPf,QAASA,EACTC,OAAQA,EACRF,mBAAoB,IAAIA,EAAoB,gBAC5CH,aAAc,IAAMA,EAAauB,GACjCrB,UAAWY,EACXU,aAAcvB,EACdK,QAASA,EACTmB,IAAK,MACLC,KAAMH,EACNX,KAAMA,EACNe,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BpB,sBAAuBA,EACvBC,eAAgBA,GAEhBU,EAACU,EAAAA,CAAWC,mBAAoBT,EAAyBrB,UAAWgB,IAEpEG,EAACY,EAAAA,CAAQ1B,SAAUA,EAAUY,WAAYA,IAGrD"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../external/classnames/index.js";import a from"./BrandIcon.js";import r from"./DualBrandingIcon/DualBrandingIcon.js";import d from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as o}from"../../../../../core/Context/CoreProvider.js";import i from"./DataSfSpan.js";import{ENCRYPTED_CARD_NUMBER as t}from"../../../../internal/SecuredFields/lib/constants.js";import{alternativeLabelContent as c}from"./IframeLabelAlternative.js";function l(l){const{i18n:s}=o(),{error:u="",isValid:_=!1,onFocusField:m=(()=>{}),dualBrandingElements:f,dualBrandingChangeHandler:p,dualBrandingSelected:b}=l;return e(d,{label:l.label,focused:l.focused,filled:l.filled,classNameModifiers:["cardNumber"],onFocusField:()=>m(t),errorMessage:u,isValid:_,dir:"ltr",name:t,showValidIcon:!1,i18n:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:c},e(i,{encryptedFieldType:t,className:n({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":u,"adyen-checkout__input--focus":l.focused,"adyen-checkout__input--valid":_,"adyen-checkout__card__cardNumber__input--noBrand":!l.showBrandIcon})}),l.showBrandIcon&&!f&&e(a,{brandsConfiguration:l.brandsConfiguration,brand:l.brand}),f&&!u&&e("div",{className:n(["adyen-checkout__card__dual-branding__buttons",{"adyen-checkout__card__dual-branding__buttons--active":_}])},f.map((n=>e(r,{key:n.id,brand:n.id,brandsConfiguration:l.brandsConfiguration,onClick:p,dataValue:n.id,notSelected:""!==b&&b!==n.id})))))}export{l as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import n from"../../../../../external/classnames/index.js";import a from"./BrandIcon.js";import r from"./DualBrandingIcon/DualBrandingIcon.js";import d from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as o}from"../../../../../core/Context/CoreProvider.js";import i from"./DataSfSpan.js";import{ENCRYPTED_CARD_NUMBER as t}from"../../../../internal/SecuredFields/lib/constants.js";import{alternativeLabelContent as c}from"./FieldLabelAlternative.js";function l(l){const{i18n:s}=o(),{error:u="",isValid:_=!1,onFocusField:m=()=>{},dualBrandingElements:f,dualBrandingChangeHandler:p,dualBrandingSelected:b}=l;return e(d,{label:l.label,focused:l.focused,filled:l.filled,classNameModifiers:["cardNumber"],onFocusField:()=>m(t),errorMessage:u,isValid:_,dir:"ltr",name:t,showValidIcon:!1,i18n:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:c},e(i,{encryptedFieldType:t,className:n({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":u,"adyen-checkout__input--focus":l.focused,"adyen-checkout__input--valid":_,"adyen-checkout__card__cardNumber__input--noBrand":!l.showBrandIcon})}),l.showBrandIcon&&!f&&e(a,{brandsConfiguration:l.brandsConfiguration,brand:l.brand}),f&&!u&&e("div",{className:n(["adyen-checkout__card__dual-branding__buttons",{"adyen-checkout__card__dual-branding__buttons--active":_}])},f.map((n=>e(r,{key:n.id,brand:n.id,brandsConfiguration:l.brandsConfiguration,onClick:p,dataValue:n.id,notSelected:""!==b&&b!==n.id})))))}export{l as default};
2
2
  //# sourceMappingURL=CardNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './IframeLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements, dualBrandingChangeHandler, dualBrandingSelected } = props;\n\n return (\n <Field\n label={props.label}\n focused={props.focused}\n filled={props.filled}\n classNameModifiers={['cardNumber']}\n onFocusField={() => onFocusField(ENCRYPTED_CARD_NUMBER)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_CARD_NUMBER}\n showValidIcon={false}\n i18n={i18n}\n contextVisibleToScreenReader={false} // securedFields have their own, internal, aria-describedby element\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_CARD_NUMBER}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': props.focused,\n 'adyen-checkout__input--valid': isValid,\n 'adyen-checkout__card__cardNumber__input--noBrand': !props.showBrandIcon\n })}\n ></DataSfSpan>\n\n {props.showBrandIcon && !dualBrandingElements && <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} />}\n\n {dualBrandingElements && !error && (\n <div\n className={classNames([\n 'adyen-checkout__card__dual-branding__buttons',\n { 'adyen-checkout__card__dual-branding__buttons--active': isValid }\n ])}\n >\n {dualBrandingElements.map(element => (\n <DualBrandingIcon\n key={element.id}\n brand={element.id}\n brandsConfiguration={props.brandsConfiguration}\n onClick={dualBrandingChangeHandler}\n dataValue={element.id}\n notSelected={dualBrandingSelected !== '' && dualBrandingSelected !== element.id}\n />\n ))}\n </div>\n )}\n </Field>\n );\n}\n"],"names":["CardNumber","props","i18n","useCoreContext","error","isValid","onFocusField","dualBrandingElements","dualBrandingChangeHandler","dualBrandingSelected","h","Field","label","focused","filled","classNameModifiers","ENCRYPTED_CARD_NUMBER","errorMessage","dir","name","showValidIcon","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","className","classNames","showBrandIcon","BrandIcon","brandsConfiguration","brand","div","map","element","DualBrandingIcon","key","id","onClick","dataValue","notSelected"],"mappings":"yiBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,SAAQC,qBAAEA,EAAoBC,0BAAEA,EAAyBC,qBAAEA,GAAyBR,EAExI,OACIS,EAACC,EAAAA,CACGC,MAAOX,EAAMW,MACbC,QAASZ,EAAMY,QACfC,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,cACrBT,aAAc,IAAMA,EAAaU,GACjCC,aAAcb,EACdC,QAASA,EACTa,IAAK,MACLC,KAAMH,EACNI,eAAe,EACflB,KAAMA,EACNmB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1Bd,EAACe,EAAAA,CACGC,mBAAoBV,EACpBW,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCxB,EAChC,+BAAgCH,EAAMY,QACtC,+BAAgCR,EAChC,oDAAqDJ,EAAM4B,kBAIlE5B,EAAM4B,gBAAkBtB,GAAwBG,EAACoB,EAAAA,CAAUC,oBAAqB9B,EAAM8B,oBAAqBC,MAAO/B,EAAM+B,QAExHzB,IAAyBH,GACtBM,EAACuB,MAAAA,CACGN,UAAWC,EAAW,CAClB,+CACA,CAAE,uDAAwDvB,MAG7DE,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbN,MAAOG,EAAQG,GACfP,oBAAqB9B,EAAM8B,oBAC3BQ,QAAS/B,EACTgC,UAAWL,EAAQG,GACnBG,YAAsC,KAAzBhC,GAA+BA,IAAyB0B,EAAQG,QAOzG"}
1
+ {"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements, dualBrandingChangeHandler, dualBrandingSelected } = props;\n\n return (\n <Field\n label={props.label}\n focused={props.focused}\n filled={props.filled}\n classNameModifiers={['cardNumber']}\n onFocusField={() => onFocusField(ENCRYPTED_CARD_NUMBER)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_CARD_NUMBER}\n showValidIcon={false}\n i18n={i18n}\n contextVisibleToScreenReader={false} // securedFields have their own, internal, aria-describedby element\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_CARD_NUMBER}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': props.focused,\n 'adyen-checkout__input--valid': isValid,\n 'adyen-checkout__card__cardNumber__input--noBrand': !props.showBrandIcon\n })}\n ></DataSfSpan>\n\n {props.showBrandIcon && !dualBrandingElements && <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} />}\n\n {dualBrandingElements && !error && (\n <div\n className={classNames([\n 'adyen-checkout__card__dual-branding__buttons',\n { 'adyen-checkout__card__dual-branding__buttons--active': isValid }\n ])}\n >\n {dualBrandingElements.map(element => (\n <DualBrandingIcon\n key={element.id}\n brand={element.id}\n brandsConfiguration={props.brandsConfiguration}\n onClick={dualBrandingChangeHandler}\n dataValue={element.id}\n notSelected={dualBrandingSelected !== '' && dualBrandingSelected !== element.id}\n />\n ))}\n </div>\n )}\n </Field>\n );\n}\n"],"names":["CardNumber","props","i18n","useCoreContext","error","isValid","onFocusField","dualBrandingElements","dualBrandingChangeHandler","dualBrandingSelected","h","Field","label","focused","filled","classNameModifiers","ENCRYPTED_CARD_NUMBER","errorMessage","dir","name","showValidIcon","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","className","classNames","showBrandIcon","BrandIcon","brandsConfiguration","brand","div","map","element","DualBrandingIcon","key","id","onClick","dataValue","notSelected"],"mappings":"wiBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,OAAQC,qBAAEA,EAAoBC,0BAAEA,EAAyBC,qBAAEA,GAAyBR,EAExI,OACIS,EAACC,EAAAA,CACGC,MAAOX,EAAMW,MACbC,QAASZ,EAAMY,QACfC,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,cACrBT,aAAc,IAAMA,EAAaU,GACjCC,aAAcb,EACdC,QAASA,EACTa,IAAK,MACLC,KAAMH,EACNI,eAAe,EACflB,KAAMA,EACNmB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1Bd,EAACe,EAAAA,CACGC,mBAAoBV,EACpBW,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCxB,EAChC,+BAAgCH,EAAMY,QACtC,+BAAgCR,EAChC,oDAAqDJ,EAAM4B,kBAIlE5B,EAAM4B,gBAAkBtB,GAAwBG,EAACoB,EAAAA,CAAUC,oBAAqB9B,EAAM8B,oBAAqBC,MAAO/B,EAAM+B,QAExHzB,IAAyBH,GACtBM,EAACuB,MAAAA,CACGN,UAAWC,EAAW,CAClB,+CACA,CAAE,uDAAwDvB,MAG7DE,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbN,MAAOG,EAAQG,GACfP,oBAAqB9B,EAAM8B,oBAC3BQ,QAAS/B,EACTgC,UAAWL,EAAQG,GACnBG,YAAsC,KAAzBhC,GAA+BA,IAAyB0B,EAAQG,QAOzG"}