@adyen/adyen-web 6.22.0 → 6.24.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 (387) hide show
  1. package/README.md +9 -8
  2. package/dist/cjs/adyen.css +8 -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 +315 -121
  7. package/dist/es/adyen.css +8 -5
  8. package/dist/es/adyen.css.map +1 -1
  9. package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
  10. package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
  11. package/dist/es/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  12. package/dist/es/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  13. package/dist/es/components/ApplePay/ApplePay.js +1 -1
  14. package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
  15. package/dist/es/components/ApplePay/services/ApplePaySdkLoader.js +1 -1
  16. package/dist/es/components/ApplePay/services/ApplePaySdkLoader.js.map +1 -1
  17. package/dist/es/components/BankTransfer/BankTransfer.js +1 -1
  18. package/dist/es/components/BankTransfer/BankTransfer.js.map +1 -1
  19. package/dist/es/components/BankTransfer/components/BankTransferResult/BankTransferResult.js +1 -1
  20. package/dist/es/components/BankTransfer/components/BankTransferResult/BankTransferResult.js.map +1 -1
  21. package/dist/es/components/Card/Card.js +1 -1
  22. package/dist/es/components/Card/Card.js.map +1 -1
  23. package/dist/es/components/Card/components/CardInput/components/CardFields.js +1 -1
  24. package/dist/es/components/Card/components/CardInput/components/CardFields.js.map +1 -1
  25. package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
  26. package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
  27. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  28. package/dist/es/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  29. package/dist/es/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
  30. package/dist/es/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
  31. package/dist/es/components/Card/components/CardInput/defaultProps.js +1 -1
  32. package/dist/es/components/Card/components/CardInput/defaultProps.js.map +1 -1
  33. package/dist/es/components/Card/components/CardInput/utils.js +1 -1
  34. package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
  35. package/dist/es/components/Card/components/Fastlane/FastlaneSignup.js +1 -1
  36. package/dist/es/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
  37. package/dist/es/components/Card/constants.js +2 -0
  38. package/dist/es/components/Card/constants.js.map +1 -0
  39. package/dist/es/components/CashAppPay/CashAppPay.js +1 -1
  40. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  41. package/dist/es/components/CashAppPay/services/CashAppSdkLoader.js +1 -1
  42. package/dist/es/components/CashAppPay/services/CashAppSdkLoader.js.map +1 -1
  43. package/dist/es/components/ClickToPay/ClickToPay.js +1 -1
  44. package/dist/es/components/ClickToPay/ClickToPay.js.map +1 -1
  45. package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -1
  46. package/dist/es/components/Dropin/Dropin.js +1 -1
  47. package/dist/es/components/Dropin/Dropin.js.map +1 -1
  48. package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
  49. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  50. package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js +1 -1
  51. package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
  52. package/dist/es/components/GooglePay/GooglePay.js +1 -1
  53. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  54. package/dist/es/components/GooglePay/GooglePayService.js +1 -1
  55. package/dist/es/components/GooglePay/GooglePayService.js.map +1 -1
  56. package/dist/es/components/GooglePay/defaultProps.js +1 -1
  57. package/dist/es/components/GooglePay/defaultProps.js.map +1 -1
  58. package/dist/es/components/GooglePay/utils/map-adyen-brands-to-googlepay-brands.js +2 -0
  59. package/dist/es/components/GooglePay/utils/map-adyen-brands-to-googlepay-brands.js.map +1 -0
  60. package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
  61. package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
  62. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  63. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  64. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  65. package/dist/es/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  66. package/dist/es/components/PayByBankPix/PayByBankPix.js +1 -1
  67. package/dist/es/components/PayByBankPix/PayByBankPix.js.map +1 -1
  68. package/dist/es/components/PayByBankPix/services/PasskeySdkLoader.js +1 -1
  69. package/dist/es/components/PayByBankPix/services/PasskeySdkLoader.js.map +1 -1
  70. package/dist/es/components/PayByBankPix/services/PasskeyService.js +1 -1
  71. package/dist/es/components/PayByBankPix/services/PasskeyService.js.map +1 -1
  72. package/dist/es/components/PayPal/Paypal.js +1 -1
  73. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  74. package/dist/es/components/PayPal/components/PaypalButtons.js +1 -1
  75. package/dist/es/components/PayPal/components/PaypalButtons.js.map +1 -1
  76. package/dist/es/components/PayPal/components/PaypalComponent.js +1 -1
  77. package/dist/es/components/PayPal/components/PaypalComponent.js.map +1 -1
  78. package/dist/es/components/PayPal/defaultProps.js +1 -1
  79. package/dist/es/components/PayPal/defaultProps.js.map +1 -1
  80. package/dist/es/components/PayPalFastlane/FastlaneSDK.js +1 -1
  81. package/dist/es/components/PayPalFastlane/FastlaneSDK.js.map +1 -1
  82. package/dist/es/components/PayTo/PayTo.js.map +1 -1
  83. package/dist/es/components/PayTo/components/PayIDInput.js +1 -1
  84. package/dist/es/components/PayTo/components/PayIDInput.js.map +1 -1
  85. package/dist/es/components/PayTo/components/PayToPhone.js +1 -1
  86. package/dist/es/components/PayTo/components/PayToPhone.js.map +1 -1
  87. package/dist/es/components/PayTo/components/validate.js +1 -1
  88. package/dist/es/components/PayTo/components/validate.js.map +1 -1
  89. package/dist/es/components/Pix/Pix.js +1 -1
  90. package/dist/es/components/Pix/Pix.js.map +1 -1
  91. package/dist/es/components/Pix/components/PixInput/PixInput.js +2 -0
  92. package/dist/es/components/Pix/components/PixInput/PixInput.js.map +1 -0
  93. package/dist/es/components/Pix/components/PixInput/utils.js +2 -0
  94. package/dist/es/components/Pix/components/PixInput/utils.js.map +1 -0
  95. package/dist/es/components/Pix/components/PixInput/validate.js +2 -0
  96. package/dist/es/components/Pix/components/PixInput/validate.js.map +1 -0
  97. package/dist/es/components/Pix/components/PixQRDetails.js +2 -0
  98. package/dist/es/components/Pix/components/PixQRDetails.js.map +1 -0
  99. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  100. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  101. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  102. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  103. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  104. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  105. package/dist/es/components/ThreeDS2/components/utils.js +1 -1
  106. package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
  107. package/dist/es/components/UPI/UPI.js +1 -1
  108. package/dist/es/components/UPI/UPI.js.map +1 -1
  109. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +1 -1
  110. package/dist/es/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
  111. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  112. package/dist/es/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  113. package/dist/es/components/internal/Address/Address.js +1 -1
  114. package/dist/es/components/internal/Address/Address.js.map +1 -1
  115. package/dist/es/components/internal/Button/Button.js +1 -1
  116. package/dist/es/components/internal/Button/Button.js.map +1 -1
  117. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  118. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  119. package/dist/es/components/internal/ClickToPay/services/create-clicktopay-service.js +1 -1
  120. package/dist/es/components/internal/ClickToPay/services/create-clicktopay-service.js.map +1 -1
  121. package/dist/es/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js +1 -1
  122. package/dist/es/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
  123. package/dist/es/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
  124. package/dist/es/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  125. package/dist/es/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js +1 -1
  126. package/dist/es/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js.map +1 -1
  127. package/dist/es/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
  128. package/dist/es/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  129. package/dist/es/components/internal/Countdown/CountdownA11yReporter.js +1 -1
  130. package/dist/es/components/internal/Countdown/CountdownA11yReporter.js.map +1 -1
  131. package/dist/es/components/internal/Countdown/index.js +1 -1
  132. package/dist/es/components/internal/Countdown/index.js.map +1 -1
  133. package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
  134. package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
  135. package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js +1 -1
  136. package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
  137. package/dist/es/components/internal/PayButton/PayButton.js.map +1 -1
  138. package/dist/es/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
  139. package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
  140. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  141. package/dist/es/components/internal/QRLoader/QRLoaderDetailsProvider.js +2 -0
  142. package/dist/es/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -0
  143. package/dist/es/components/internal/QRLoader/components/QRCodeCopyButton.js +2 -0
  144. package/dist/es/components/internal/QRLoader/components/QRCodeCopyButton.js.map +1 -0
  145. package/dist/es/components/internal/QRLoader/components/QRCountdown.js +2 -0
  146. package/dist/es/components/internal/QRLoader/components/QRCountdown.js.map +1 -0
  147. package/dist/es/components/internal/QRLoader/components/QRDetails.js +2 -0
  148. package/dist/es/components/internal/QRLoader/components/QRDetails.js.map +1 -0
  149. package/dist/es/components/internal/QRLoader/components/QRImage.js +2 -0
  150. package/dist/es/components/internal/QRLoader/components/QRImage.js.map +1 -0
  151. package/dist/es/components/internal/QRLoader/components/QRIntructions.js +2 -0
  152. package/dist/es/components/internal/QRLoader/components/QRIntructions.js.map +1 -0
  153. package/dist/es/components/internal/QRLoader/components/QRProgressbar.js +2 -0
  154. package/dist/es/components/internal/QRLoader/components/QRProgressbar.js.map +1 -0
  155. package/dist/es/components/internal/SecuredFields/binLookup/extensions.js +1 -1
  156. package/dist/es/components/internal/SecuredFields/binLookup/extensions.js.map +1 -1
  157. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js +1 -1
  158. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  159. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  160. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  161. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  162. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  163. package/dist/es/components/internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.js +1 -1
  164. package/dist/es/components/internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.js.map +1 -1
  165. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  166. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  167. package/dist/es/components/tx-variants.js +1 -1
  168. package/dist/es/components/tx-variants.js.map +1 -1
  169. package/dist/es/core/Analytics/Analytics.js +1 -1
  170. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  171. package/dist/es/core/Analytics/AnalyticsInfoEvent.js +1 -1
  172. package/dist/es/core/Analytics/AnalyticsInfoEvent.js.map +1 -1
  173. package/dist/es/core/Analytics/constants.js +1 -1
  174. package/dist/es/core/Analytics/constants.js.map +1 -1
  175. package/dist/es/core/Analytics/useAnalytics.js +2 -0
  176. package/dist/es/core/Analytics/useAnalytics.js.map +1 -0
  177. package/dist/es/core/Context/CoreProvider.js +1 -1
  178. package/dist/es/core/Context/CoreProvider.js.map +1 -1
  179. package/dist/es/core/Environment/Environment.js.map +1 -1
  180. package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  181. package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  182. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  183. package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
  184. package/dist/es/core/config.js +1 -1
  185. package/dist/es/core/config.js.map +1 -1
  186. package/dist/es/core/core.js +1 -1
  187. package/dist/es/core/core.js.map +1 -1
  188. package/dist/es/index.d.ts +315 -121
  189. package/dist/es/utils/Script.js +1 -1
  190. package/dist/es/utils/Script.js.map +1 -1
  191. package/dist/es-legacy/adyen.css +8 -5
  192. package/dist/es-legacy/adyen.css.map +1 -1
  193. package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
  194. package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
  195. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
  196. package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
  197. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  198. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  199. package/dist/es-legacy/components/ApplePay/services/ApplePaySdkLoader.js +1 -1
  200. package/dist/es-legacy/components/ApplePay/services/ApplePaySdkLoader.js.map +1 -1
  201. package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
  202. package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
  203. package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferResult.js +1 -1
  204. package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferResult.js.map +1 -1
  205. package/dist/es-legacy/components/Card/Card.js +1 -1
  206. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  207. package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js +1 -1
  208. package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js.map +1 -1
  209. package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
  210. package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
  211. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js +1 -1
  212. package/dist/es-legacy/components/Card/components/CardInput/components/ExpirationDate.js.map +1 -1
  213. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
  214. package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
  215. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
  216. package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js.map +1 -1
  217. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  218. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  219. package/dist/es-legacy/components/Card/components/Fastlane/FastlaneSignup.js +1 -1
  220. package/dist/es-legacy/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
  221. package/dist/es-legacy/components/Card/constants.js +2 -0
  222. package/dist/es-legacy/components/Card/constants.js.map +1 -0
  223. package/dist/es-legacy/components/CashAppPay/CashAppPay.js +1 -1
  224. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  225. package/dist/es-legacy/components/CashAppPay/services/CashAppSdkLoader.js +1 -1
  226. package/dist/es-legacy/components/CashAppPay/services/CashAppSdkLoader.js.map +1 -1
  227. package/dist/es-legacy/components/ClickToPay/ClickToPay.js +1 -1
  228. package/dist/es-legacy/components/ClickToPay/ClickToPay.js.map +1 -1
  229. package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -1
  230. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  231. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  232. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  233. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  234. package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js +1 -1
  235. package/dist/es-legacy/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
  236. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  237. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  238. package/dist/es-legacy/components/GooglePay/GooglePayService.js +1 -1
  239. package/dist/es-legacy/components/GooglePay/GooglePayService.js.map +1 -1
  240. package/dist/es-legacy/components/GooglePay/defaultProps.js +1 -1
  241. package/dist/es-legacy/components/GooglePay/defaultProps.js.map +1 -1
  242. package/dist/es-legacy/components/GooglePay/utils/map-adyen-brands-to-googlepay-brands.js +2 -0
  243. package/dist/es-legacy/components/GooglePay/utils/map-adyen-brands-to-googlepay-brands.js.map +1 -0
  244. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  245. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  246. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  247. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  248. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
  249. package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
  250. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +1 -1
  251. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -1
  252. package/dist/es-legacy/components/PayByBankPix/services/PasskeySdkLoader.js +1 -1
  253. package/dist/es-legacy/components/PayByBankPix/services/PasskeySdkLoader.js.map +1 -1
  254. package/dist/es-legacy/components/PayByBankPix/services/PasskeyService.js +1 -1
  255. package/dist/es-legacy/components/PayByBankPix/services/PasskeyService.js.map +1 -1
  256. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  257. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  258. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  259. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  260. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  261. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  262. package/dist/es-legacy/components/PayPal/defaultProps.js +1 -1
  263. package/dist/es-legacy/components/PayPal/defaultProps.js.map +1 -1
  264. package/dist/es-legacy/components/PayPalFastlane/FastlaneSDK.js +1 -1
  265. package/dist/es-legacy/components/PayPalFastlane/FastlaneSDK.js.map +1 -1
  266. package/dist/es-legacy/components/PayTo/PayTo.js.map +1 -1
  267. package/dist/es-legacy/components/PayTo/components/PayIDInput.js +1 -1
  268. package/dist/es-legacy/components/PayTo/components/PayIDInput.js.map +1 -1
  269. package/dist/es-legacy/components/PayTo/components/PayToPhone.js +1 -1
  270. package/dist/es-legacy/components/PayTo/components/PayToPhone.js.map +1 -1
  271. package/dist/es-legacy/components/PayTo/components/validate.js +1 -1
  272. package/dist/es-legacy/components/PayTo/components/validate.js.map +1 -1
  273. package/dist/es-legacy/components/Pix/Pix.js +1 -1
  274. package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
  275. package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js +2 -0
  276. package/dist/es-legacy/components/Pix/components/PixInput/PixInput.js.map +1 -0
  277. package/dist/es-legacy/components/Pix/components/PixInput/utils.js +2 -0
  278. package/dist/es-legacy/components/Pix/components/PixInput/utils.js.map +1 -0
  279. package/dist/es-legacy/components/Pix/components/PixInput/validate.js +2 -0
  280. package/dist/es-legacy/components/Pix/components/PixInput/validate.js.map +1 -0
  281. package/dist/es-legacy/components/Pix/components/PixQRDetails.js +2 -0
  282. package/dist/es-legacy/components/Pix/components/PixQRDetails.js.map +1 -0
  283. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  284. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  285. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  286. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  287. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  288. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  289. package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
  290. package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
  291. package/dist/es-legacy/components/UPI/UPI.js +1 -1
  292. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  293. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js +1 -1
  294. package/dist/es-legacy/components/UPI/components/UPIIntentAppList/UPIIntentAppItem/UPIIntentAppItem.js.map +1 -1
  295. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
  296. package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
  297. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  298. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  299. package/dist/es-legacy/components/internal/Button/Button.js +1 -1
  300. package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
  301. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  302. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  303. package/dist/es-legacy/components/internal/ClickToPay/services/create-clicktopay-service.js +1 -1
  304. package/dist/es-legacy/components/internal/ClickToPay/services/create-clicktopay-service.js.map +1 -1
  305. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js +1 -1
  306. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
  307. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
  308. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
  309. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js +1 -1
  310. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrcSdkLoader.js.map +1 -1
  311. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
  312. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
  313. package/dist/es-legacy/components/internal/Countdown/CountdownA11yReporter.js +1 -1
  314. package/dist/es-legacy/components/internal/Countdown/CountdownA11yReporter.js.map +1 -1
  315. package/dist/es-legacy/components/internal/Countdown/index.js +1 -1
  316. package/dist/es-legacy/components/internal/Countdown/index.js.map +1 -1
  317. package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
  318. package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
  319. package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js +1 -1
  320. package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
  321. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  322. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
  323. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
  324. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  325. package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js +2 -0
  326. package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -0
  327. package/dist/es-legacy/components/internal/QRLoader/components/QRCodeCopyButton.js +2 -0
  328. package/dist/es-legacy/components/internal/QRLoader/components/QRCodeCopyButton.js.map +1 -0
  329. package/dist/es-legacy/components/internal/QRLoader/components/QRCountdown.js +2 -0
  330. package/dist/es-legacy/components/internal/QRLoader/components/QRCountdown.js.map +1 -0
  331. package/dist/es-legacy/components/internal/QRLoader/components/QRDetails.js +2 -0
  332. package/dist/es-legacy/components/internal/QRLoader/components/QRDetails.js.map +1 -0
  333. package/dist/es-legacy/components/internal/QRLoader/components/QRImage.js +2 -0
  334. package/dist/es-legacy/components/internal/QRLoader/components/QRImage.js.map +1 -0
  335. package/dist/es-legacy/components/internal/QRLoader/components/QRIntructions.js +2 -0
  336. package/dist/es-legacy/components/internal/QRLoader/components/QRIntructions.js.map +1 -0
  337. package/dist/es-legacy/components/internal/QRLoader/components/QRProgressbar.js +2 -0
  338. package/dist/es-legacy/components/internal/QRLoader/components/QRProgressbar.js.map +1 -0
  339. package/dist/es-legacy/components/internal/SecuredFields/binLookup/extensions.js +1 -1
  340. package/dist/es-legacy/components/internal/SecuredFields/binLookup/extensions.js.map +1 -1
  341. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js +1 -1
  342. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  343. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  344. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  345. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  346. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  347. package/dist/es-legacy/components/internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.js +1 -1
  348. package/dist/es-legacy/components/internal/SocialSecurityNumberBrazil/BrazilPersonalDetail.js.map +1 -1
  349. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  350. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  351. package/dist/es-legacy/components/tx-variants.js +1 -1
  352. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  353. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  354. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  355. package/dist/es-legacy/core/Analytics/AnalyticsInfoEvent.js +1 -1
  356. package/dist/es-legacy/core/Analytics/AnalyticsInfoEvent.js.map +1 -1
  357. package/dist/es-legacy/core/Analytics/constants.js +1 -1
  358. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  359. package/dist/es-legacy/core/Analytics/useAnalytics.js +2 -0
  360. package/dist/es-legacy/core/Analytics/useAnalytics.js.map +1 -0
  361. package/dist/es-legacy/core/Context/CoreProvider.js +1 -1
  362. package/dist/es-legacy/core/Context/CoreProvider.js.map +1 -1
  363. package/dist/es-legacy/core/Environment/Environment.js.map +1 -1
  364. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
  365. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  366. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  367. package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
  368. package/dist/es-legacy/core/config.js +1 -1
  369. package/dist/es-legacy/core/config.js.map +1 -1
  370. package/dist/es-legacy/core/core.js +1 -1
  371. package/dist/es-legacy/core/core.js.map +1 -1
  372. package/dist/es-legacy/utils/Script.js +1 -1
  373. package/dist/es-legacy/utils/Script.js.map +1 -1
  374. package/package.json +149 -157
  375. package/styles/adyen.css +8 -5
  376. package/dist/es/components/Pix/PixInput/PixInput.js +0 -2
  377. package/dist/es/components/Pix/PixInput/PixInput.js.map +0 -1
  378. package/dist/es/components/Pix/PixInput/utils.js +0 -2
  379. package/dist/es/components/Pix/PixInput/utils.js.map +0 -1
  380. package/dist/es/components/Pix/PixInput/validate.js +0 -2
  381. package/dist/es/components/Pix/PixInput/validate.js.map +0 -1
  382. package/dist/es-legacy/components/Pix/PixInput/PixInput.js +0 -2
  383. package/dist/es-legacy/components/Pix/PixInput/PixInput.js.map +0 -1
  384. package/dist/es-legacy/components/Pix/PixInput/utils.js +0 -2
  385. package/dist/es-legacy/components/Pix/PixInput/utils.js.map +0 -1
  386. package/dist/es-legacy/components/Pix/PixInput/validate.js +0 -2
  387. package/dist/es-legacy/components/Pix/PixInput/validate.js.map +0 -1
@@ -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 { CardBinLookupData, CardConfigSuccessData, CardFocusData } 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 { ANALYTICS_FOCUS_STR, ANALYTICS_CONFIGURED_STR, ANALYTICS_UNFOCUS_STR, ANALYTICS_RENDERED_STR } from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\nimport { getCardConfigData } from './components/CardInput/utils';\nimport { AnalyticsEvent } from '../../core/Analytics/AnalyticsEvent';\nimport { AnalyticsInfoEvent } from '../../core/Analytics/AnalyticsInfoEvent';\n\nexport const DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM = ['cartebancaire', 'bcmc', 'dankort'];\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 && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource }),\n ...(this.state.fastlaneData && { fastlaneData: btoa(JSON.stringify(this.state.fastlaneData)) })\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: CardBinLookupData) {\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: AnalyticsEvent) {\n const isInfoType = analyticsObj instanceof AnalyticsInfoEvent;\n\n if ((isInfoType && analyticsObj.type === ANALYTICS_RENDERED_STR) || (isInfoType && analyticsObj.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 // Add config data\n if (isInfoType && analyticsObj.type === ANALYTICS_RENDERED_STR) {\n analyticsObj.configData = getCardConfigData(this.props);\n }\n }\n\n super.submitAnalytics(analyticsObj);\n }\n\n private onConfigSuccess = (obj: CardConfigSuccessData) => {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_CONFIGURED_STR });\n this.submitAnalytics(event);\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_FOCUS_STR, target: fieldTypeToSnakeCase(obj.fieldType) });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CardFocusData);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_UNFOCUS_STR, target: fieldTypeToSnakeCase(obj.fieldType) });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CardFocusData);\n } else {\n this.props.onBlur?.(obj);\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.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 onSubmitAnalytics={this.submitAnalytics}\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 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":["DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM","CardElement","UIElement","setStatus","status","props","_this_componentRef","_this_clickToPayRef","this","componentRef","clickToPayRef","formatProps","_this_core_options_session","_this_core_options","_this_core_options_session1","_this_core_options1","enableStoreDetails","session","configuration","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","_object_spread","_object_spread_props","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","CardInputDefaultProps","TxVariants","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","clickToPayConfiguration","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","_this_props_holderName","paymentMethod","type","data","holderName","fundingSource","fastlaneData","btoa","JSON","stringify","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","_this_props_onBinLookup","_this_props","nuObj","reject","from","call","submitAnalytics","analyticsObj","isInfoType","AnalyticsInfoEvent","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","constructor","hasOwnProperty","isStoredPaymentMethod","configData","getCardConfigData","super","_this_props_storedPaymentMethodId","_this_props_amount","length","storePaymentMethod","Boolean","isValid","_this_props_icon","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onSubmitAnalytics","onChange","setState","onSubmit","submit","handleKeyPress","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onConfigSuccess","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","checkout","_this_clickToPayService","_define_property","ref","event","_this_props_onBrand","payload","valid","errors","_this_props_onConfigSuccess","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","_this_props_onFocus","_this_props_onFocus1","_this_props1","ALL_SECURED_FIELDS","ANALYTICS_UNFOCUS_STR","_this_props_onBlur","_this_props_onBlur1","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","secondaryAmount","label","onClick","_disableClickToPay","createClickToPayService","environment","initialize","scheme","defaultProps","showFormInstruction","doBinLookup"],"mappings":"ipEA6BaA,EAA4C,CAAC,gBAAiB,OAAQ,WAE5E,MAAMC,UAAoBC,EA2BtBC,SAAAA,CAAUC,EAAyBC,OAClCC,EAGAC,EAGJ,eANID,EAAAE,KAAKC,oBAAL,IAAAH,OAAA,EAAAA,EAAmBH,YACnBK,KAAKC,aAAaN,UAAUC,EAAQC,YAEpCE,EAAAC,KAAKE,qBAAL,IAAAH,OAAA,EAAAA,EAAoBJ,YACpBK,KAAKE,cAAcP,UAAUC,EAAQC,GAElCG,IACX,CAMAG,WAAAA,CAAYN,GAEmBA,IAAAA,EAAAA,EAERA,EAI2BA,EA4BZA,EAEoBA,EAC9BA,EAEAA,EAAAA,EASKA,EACPA,EAA+CO,EAAAC,EAC5CR,EAAkDS,EAAAC,EAC3DV,EAAyCA,EAAAA,EAnD9BA,EAA3B,MAAMW,UAAqBX,UAAAA,EAAAA,EAAMY,eAANZ,IAAAA,GAA4B,QAA5BA,EAAAA,EAAea,yBAAfb,OAAAA,EAAAA,EAA8BW,0BAA9BX,IAAAA,EAAAA,EAAoDA,EAAMW,mBAG/EG,IADqC,KAAZ,QAAZd,EAAAA,EAAMe,cAANf,IAAAA,OAAAA,EAAAA,EAAcgB,SACqBL,EAEhDM,EAAejB,EAAMkB,uBAAyBlB,EAAMmB,GACpDC,EAAwBH,IAAgBjB,SAAmC,QAAnCA,EAAAA,EAAOqB,oCAAPrB,IAAAA,OAAAA,EAAAA,EAAqCsB,SAAS,cAG5F,GAAIL,IAAiBG,EAEjB,MAAM,IAAIG,EAC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,IAAAmC,GAAAA,EAAAnF,KAAAJ,EAAoBF,EAAI0E,OAEP,QAAjBgB,GAAAJ,EAAAzK,KAAKH,OAAM4I,cAAX,IAAAoC,GAAAA,EAAApF,KAAAgF,EAAoBtF,KAI5BwE,OAAOtB,aAAayC,EAAiB9K,OAoErC2J,EAAA3J,KAAmBmI,YAAatI,QACT0G,EACED,EADrB,MAAMyE,EAA0C,KAAZ,QAAjBxE,EAAAvG,KAAKH,MAAMe,cAAX,IAAA2F,OAAA,EAAAA,EAAmB1F,OAChCmK,GAA+C,QAAhC1E,EAAAtG,KAAKH,MAAMkB,6BAAX,IAAAuF,OAAA,EAAAA,EAAkCE,QAAS,EAChE,OACIkB,EAACuD,EAAAA,EAAAA,EAAAA,CAAAA,EACOpL,GAAAA,CACJe,OAAQZ,KAAKH,MAAMe,OACnBsK,gBAAiBlL,KAAKH,MAAMqL,gBAC5BC,MAAOJ,IAAeC,EAAehL,KAAKH,MAAMmD,KAAKsE,IAAI,yBAA2B,GACpF8D,QAASpL,KAAKiI,YA9RlBpI,IAAUA,EAAMwL,sBAChBrL,KAAKiJ,kBAAoBqC,EAAwBtL,KAAKH,MAAMa,cAAeV,KAAKH,MAAM4C,wBAAyBzC,KAAKH,MAAM0L,aAC/F,QAAtB7B,EAAA1J,KAAKiJ,yBAAL,IAAAS,GAAAA,EAAwB8B,aAErC,EAhBA7B,EADSlK,EACK+D,OAAOvB,EAAWwJ,QAkBhC9B,EAnBSlK,EAmBQiM,eAAepK,EAAA,CAC5BqK,qBAAqB,EACrBN,oBAAoB,EACpBO,aAAa,GAEVrG,EAAO,CAAC,OAAQ,oBAAoBC,KAAKxD"}
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 { CardBinLookupData, CardConfigSuccessData, CardFocusData } 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 { ANALYTICS_FOCUS_STR, ANALYTICS_CONFIGURED_STR, ANALYTICS_UNFOCUS_STR, ANALYTICS_RENDERED_STR } from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\nimport { getCardConfigData } from './components/CardInput/utils';\nimport { AnalyticsEvent } from '../../core/Analytics/AnalyticsEvent';\nimport { AnalyticsInfoEvent } from '../../core/Analytics/AnalyticsInfoEvent';\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(\n this.props.configuration,\n this.props.clickToPayConfiguration,\n this.props.environment,\n this.analytics\n );\n\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 && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource }),\n ...(this.state.fastlaneData && { fastlaneData: btoa(JSON.stringify(this.state.fastlaneData)) })\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: CardBinLookupData) {\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: AnalyticsEvent) {\n const isInfoType = analyticsObj instanceof AnalyticsInfoEvent;\n\n if ((isInfoType && analyticsObj.type === ANALYTICS_RENDERED_STR) || (isInfoType && analyticsObj.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 // Add config data\n if (isInfoType && analyticsObj.type === ANALYTICS_RENDERED_STR) {\n analyticsObj.configData = getCardConfigData(this.props);\n }\n }\n\n super.submitAnalytics(analyticsObj);\n }\n\n private onConfigSuccess = (obj: CardConfigSuccessData) => {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_CONFIGURED_STR });\n this.submitAnalytics(event);\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_FOCUS_STR, target: fieldTypeToSnakeCase(obj.fieldType) });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CardFocusData);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_UNFOCUS_STR, target: fieldTypeToSnakeCase(obj.fieldType) });\n this.submitAnalytics(event);\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CardFocusData);\n } else {\n this.props.onBlur?.(obj);\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.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 onSubmitAnalytics={this.submitAnalytics}\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 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","setStatus","status","props","_this_componentRef","_this_clickToPayRef","this","componentRef","clickToPayRef","formatProps","_this_core_options_session","_this_core_options","_this_core_options_session1","_this_core_options1","enableStoreDetails","session","configuration","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","_object_spread","_object_spread_props","holderNameRequired","hasHolderName","hasCVC","brand","hideCVC","billingAddressRequired","billingAddressMode","onAddressLookup","CardInputDefaultProps","TxVariants","card","countryCode","toLowerCase","socialSecurityNumberMode","brandsConfiguration","icon","installmentOptions","clickToPayConfiguration","disableOtpAutoFocus","shopperEmail","core","options","telephoneNumber","locale","i18n","replace","formatData","cardBrand","state","selectedBrandValue","_this_props_holderName","paymentMethod","type","data","holderName","fundingSource","fastlaneData","btoa","JSON","stringify","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","_this_props_onBinLookup","_this_props","nuObj","reject","from","call","submitAnalytics","analyticsObj","isInfoType","AnalyticsInfoEvent","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","constructor","hasOwnProperty","isStoredPaymentMethod","configData","getCardConfigData","super","_this_props_storedPaymentMethodId","_this_props_amount","length","storePaymentMethod","Boolean","isValid","_this_props_icon","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onSubmitAnalytics","onChange","setState","onSubmit","submit","handleKeyPress","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onConfigSuccess","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","checkout","_this_clickToPayService","_define_property","ref","event","_this_props_onBrand","payload","valid","errors","_this_props_onConfigSuccess","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","_this_props_onFocus","_this_props_onFocus1","_this_props1","ALL_SECURED_FIELDS","ANALYTICS_UNFOCUS_STR","_this_props_onBlur","_this_props_onBlur1","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","secondaryAmount","label","onClick","_disableClickToPay","createClickToPayService","environment","analytics","initialize","scheme","defaultProps","showFormInstruction","doBinLookup"],"mappings":"2oEA6BO,MAAMA,UAAoBC,EAiCtBC,SAAAA,CAAUC,EAAyBC,OAClCC,EAGAC,EAGJ,eANID,EAAAE,KAAKC,oBAAL,IAAAH,OAAA,EAAAA,EAAmBH,YACnBK,KAAKC,aAAaN,UAAUC,EAAQC,YAEpCE,EAAAC,KAAKE,qBAAL,IAAAH,OAAA,EAAAA,EAAoBJ,YACpBK,KAAKE,cAAcP,UAAUC,EAAQC,GAElCG,IACX,CAMAG,WAAAA,CAAYN,GAEmBA,IAAAA,EAAAA,EAERA,EAI2BA,EA4BZA,EAEoBA,EAC9BA,EAEAA,EAAAA,EASKA,EACPA,EAA+CO,EAAAC,EAC5CR,EAAkDS,EAAAC,EAC3DV,EAAyCA,EAAAA,EAnD9BA,EAA3B,MAAMW,UAAqBX,UAAAA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,IAAAS,GAAAA,EAAwB+B,aAErC,EAtBA9B,EADSlK,EACK+D,OAAOvB,EAAWyJ,QAwBhC/B,EAzBSlK,EAyBQkM,eAAerK,EAAA,CAC5BsK,qBAAqB,EACrBP,oBAAoB,EACpBQ,aAAa,GAEVtG,EAAO,CAAC,OAAQ,oBAAoBC,KAAKxD"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"./CardNumber.js";import t from"./CVC.js";import a from"./ExpirationDate.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import o from"../../../../../_virtual/index.js";import{BRAND_ICON_UI_EXCLUSION_LIST as i,ENCRYPTED_CARD_NUMBER as c,DATE_POLICY_HIDDEN as n,ENCRYPTED_EXPIRY_DATE as l,ENCRYPTED_SECURITY_CODE as s}from"../../../../internal/SecuredFields/lib/constants.js";import u from"./AvailableBrands/AvailableBrands.js";function p({brand:p,brandsIcons:m,brandsConfiguration:y,dualBrandingElements:x,errors:C,focusedElement:f,hasCVC:_,cvcPolicy:b,expiryDatePolicy:h,onFocusField:v,showBrandIcon:g,valid:E,showContextualElement:F}){const{i18n:N}=d(),j=(e,r)=>e[r]?N.get(e[r]):null,B=null==m?void 0:m.filter(e=>!(null==i?void 0:i.includes(e.name))),k="amex"===p,w=k?N.get("creditCard.securityCode.contextualText.4digits"):N.get("creditCard.securityCode.contextualText.3digits");return e("div",{className:"adyen-checkout__card__form"},e(r,{brand:p,brandsConfiguration:y,error:j(C,c),focused:f===c,isValid:!!E.encryptedCardNumber,label:N.get("creditCard.cardNumber.label"),onFocusField:v,filled:!!C.encryptedCardNumber||!!E.encryptedCardNumber,showBrandIcon:g,dualBrandingElements:x}),e(u,{activeBrand:p,brands:B}),e("div",{className:o("adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":h===n})},e(a,{error:j(C,l),focused:f===l,isValid:!!E.encryptedExpiryMonth&&!!E.encryptedExpiryYear,filled:!!C.encryptedExpiryDate||!!E.encryptedExpiryYear,label:N.get("creditCard.expiryDate.label"),onFocusField:v,className:"adyen-checkout__field--50",expiryDatePolicy:h,showContextualElement:F,contextualText:N.get("creditCard.expiryDate.contextualText")}),_&&e(t,{error:j(C,s),focused:f===s,cvcPolicy:b,isValid:!!E.encryptedSecurityCode,filled:!!C.encryptedSecurityCode||!!E.encryptedSecurityCode,label:N.get("creditCard.securityCode.label"),onFocusField:v,className:"adyen-checkout__field--50",frontCVC:k,showContextualElement:F,contextualText:w})))}export{p as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"./CardNumber.js";import t from"./CVC.js";import a from"./ExpirationDate.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import o from"../../../../../_virtual/index.js";import{BRAND_ICON_UI_EXCLUSION_LIST as i,ENCRYPTED_CARD_NUMBER as c,DATE_POLICY_HIDDEN as n,ENCRYPTED_EXPIRY_DATE as l,ENCRYPTED_SECURITY_CODE as s}from"../../../../internal/SecuredFields/lib/constants.js";import u from"./AvailableBrands/AvailableBrands.js";function m({brand:m,brandsIcons:p,brandsConfiguration:y,dualBrandingElements:x,errors:C,focusedElement:f,hasCVC:b,cvcPolicy:_,expiryDatePolicy:v,onFocusField:g,showBrandIcon:E,valid:h,showContextualElement:F}){const{i18n:N}=d(),j=(e,r)=>e[r]?N.get(e[r]):null,B=null==p?void 0:p.filter(e=>!(null==i?void 0:i.includes(e.name))),D="amex"===m,V=D?N.get("creditCard.securityCode.contextualText.4digits"):N.get("creditCard.securityCode.contextualText.3digits");return e("div",{className:"adyen-checkout__card__form"},e(r,{brand:m,brandsConfiguration:y,error:j(C,c),focused:f===c,isValid:!!h.encryptedCardNumber,label:N.get("creditCard.cardNumber.label"),onFocusField:g,filled:!!C.encryptedCardNumber||!!h.encryptedCardNumber,showBrandIcon:E,dualBrandingElements:x}),e(u,{activeBrand:m,brands:B}),e("div",{className:o("adyen-checkout__card__exp-cvc",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":v===n})},e(a,{classNameModifiers:["col-50"],error:j(C,l),focused:f===l,isValid:!!h.encryptedExpiryMonth&&!!h.encryptedExpiryYear,filled:!!C.encryptedExpiryDate||!!h.encryptedExpiryYear,label:N.get("creditCard.expiryDate.label"),onFocusField:g,expiryDatePolicy:v,showContextualElement:F,contextualText:N.get("creditCard.expiryDate.contextualText")}),b&&e(t,{classNameModifiers:["col-50"],error:j(C,s),focused:f===s,cvcPolicy:_,isValid:!!h.encryptedSecurityCode,filled:!!C.encryptedSecurityCode||!!h.encryptedSecurityCode,label:N.get("creditCard.securityCode.label"),onFocusField:g,frontCVC:D,showContextualElement:F,contextualText:V})))}export{m as default};
2
2
  //# sourceMappingURL=CardFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardNumber from './CardNumber';\nimport CVC from './CVC';\nimport ExpirationDate from './ExpirationDate';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardFieldsProps } from './types';\nimport classNames from 'classnames';\nimport {\n BRAND_ICON_UI_EXCLUSION_LIST,\n DATE_POLICY_HIDDEN,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport AvailableBrands from './AvailableBrands';\n\nexport default function CardFields({\n brand,\n brandsIcons,\n brandsConfiguration,\n dualBrandingElements,\n errors,\n focusedElement,\n hasCVC,\n cvcPolicy,\n expiryDatePolicy,\n onFocusField,\n showBrandIcon,\n valid,\n showContextualElement\n}: CardFieldsProps) {\n const { i18n } = useCoreContext();\n\n const getError = (errors, fieldType) => {\n return errors[fieldType] ? i18n.get(errors[fieldType]) : null;\n };\n\n // A set of brands filtered to exclude those that can never appear in the UI\n const allowedBrands = brandsIcons?.filter(brandsIcons => !BRAND_ICON_UI_EXCLUSION_LIST?.includes(brandsIcons.name));\n const isAmex = brand === 'amex';\n const cvcContextualText = isAmex\n ? i18n.get('creditCard.securityCode.contextualText.4digits')\n : i18n.get('creditCard.securityCode.contextualText.3digits');\n\n return (\n <div className=\"adyen-checkout__card__form\">\n <CardNumber\n brand={brand}\n brandsConfiguration={brandsConfiguration}\n error={getError(errors, ENCRYPTED_CARD_NUMBER)}\n focused={focusedElement === ENCRYPTED_CARD_NUMBER}\n isValid={!!valid.encryptedCardNumber}\n label={i18n.get('creditCard.cardNumber.label')}\n onFocusField={onFocusField}\n filled={!!errors.encryptedCardNumber || !!valid.encryptedCardNumber}\n showBrandIcon={showBrandIcon}\n dualBrandingElements={dualBrandingElements}\n />\n\n <AvailableBrands activeBrand={brand} brands={allowedBrands} />\n\n <div\n className={classNames('adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper', {\n 'adyen-checkout__card__exp-cvc__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN\n })}\n >\n <ExpirationDate\n error={getError(errors, ENCRYPTED_EXPIRY_DATE)}\n focused={focusedElement === ENCRYPTED_EXPIRY_DATE}\n isValid={!!valid.encryptedExpiryMonth && !!valid.encryptedExpiryYear}\n filled={!!errors.encryptedExpiryDate || !!valid.encryptedExpiryYear}\n label={i18n.get('creditCard.expiryDate.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n expiryDatePolicy={expiryDatePolicy}\n showContextualElement={showContextualElement}\n contextualText={i18n.get('creditCard.expiryDate.contextualText')}\n />\n\n {hasCVC && (\n <CVC\n error={getError(errors, ENCRYPTED_SECURITY_CODE)}\n focused={focusedElement === ENCRYPTED_SECURITY_CODE}\n cvcPolicy={cvcPolicy}\n isValid={!!valid.encryptedSecurityCode}\n filled={!!errors.encryptedSecurityCode || !!valid.encryptedSecurityCode}\n label={i18n.get('creditCard.securityCode.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n frontCVC={isAmex}\n showContextualElement={showContextualElement}\n contextualText={cvcContextualText}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["CardFields","brand","brandsIcons","brandsConfiguration","dualBrandingElements","errors","focusedElement","hasCVC","cvcPolicy","expiryDatePolicy","onFocusField","showBrandIcon","valid","showContextualElement","i18n","useCoreContext","getError","fieldType","get","allowedBrands","filter","BRAND_ICON_UI_EXCLUSION_LIST","includes","name","isAmex","cvcContextualText","h","div","className","CardNumber","error","ENCRYPTED_CARD_NUMBER","focused","isValid","encryptedCardNumber","label","filled","AvailableBrands","activeBrand","brands","classNames","DATE_POLICY_HIDDEN","ExpirationDate","ENCRYPTED_EXPIRY_DATE","encryptedExpiryMonth","encryptedExpiryYear","encryptedExpiryDate","contextualText","CVC","ENCRYPTED_SECURITY_CODE","encryptedSecurityCode","frontCVC"],"mappings":"uiBAgBe,SAASA,GAAWC,MAC/BA,EAAKC,YACLA,EAAWC,oBACXA,EAAmBC,qBACnBA,EAAoBC,OACpBA,EAAMC,eACNA,EAAcC,OACdA,EAAMC,UACNA,EAASC,iBACTA,EAAgBC,aAChBA,EAAYC,cACZA,EAAaC,MACbA,EAAKC,sBACLA,IAEA,MAAMC,KAAEA,GAASC,IAEXC,EAAW,CAACX,EAAQY,IACfZ,EAAOY,GAAaH,EAAKI,IAAIb,EAAOY,IAAc,KAIvDE,EAAgBjB,aAAAA,EAAAA,EAAakB,OAAOlB,KAAgBmB,aAAAA,EAAAA,EAA8BC,SAASpB,EAAYqB,QACvGC,EAAmB,SAAVvB,EACTwB,EAAoBD,EACpBV,EAAKI,IAAI,kDACTJ,EAAKI,IAAI,kDAEf,OACIQ,EAACC,MAAAA,CAAIC,UAAU,8BACXF,EAACG,EAAAA,CACG5B,MAAOA,EACPE,oBAAqBA,EACrB2B,MAAOd,EAASX,EAAQ0B,GACxBC,QAAS1B,IAAmByB,EAC5BE,UAAWrB,EAAMsB,oBACjBC,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACd0B,SAAU/B,EAAO6B,uBAAyBtB,EAAMsB,oBAChDvB,cAAeA,EACfP,qBAAsBA,IAG1BsB,EAACW,EAAAA,CAAgBC,YAAarC,EAAOsC,OAAQpB,IAE7CO,EAACC,MAAAA,CACGC,UAAWY,EAAW,8DAA+D,CACjF,yDAA0D/B,IAAqBgC,KAGnFf,EAACgB,EAAAA,CACGZ,MAAOd,EAASX,EAAQsC,GACxBX,QAAS1B,IAAmBqC,EAC5BV,UAAWrB,EAAMgC,wBAA0BhC,EAAMiC,oBACjDT,SAAU/B,EAAOyC,uBAAyBlC,EAAMiC,oBAChDV,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACdkB,UAAW,4BACXnB,iBAAkBA,EAClBI,sBAAuBA,EACvBkC,eAAgBjC,EAAKI,IAAI,0CAG5BX,GACGmB,EAACsB,EAAAA,CACGlB,MAAOd,EAASX,EAAQ4C,GACxBjB,QAAS1B,IAAmB2C,EAC5BzC,UAAWA,EACXyB,UAAWrB,EAAMsC,sBACjBd,SAAU/B,EAAO6C,yBAA2BtC,EAAMsC,sBAClDf,MAAOrB,EAAKI,IAAI,iCAChBR,aAAcA,EACdkB,UAAW,4BACXuB,SAAU3B,EACVX,sBAAuBA,EACvBkC,eAAgBtB,KAMxC"}
1
+ {"version":3,"file":"CardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardNumber from './CardNumber';\nimport CVC from './CVC';\nimport ExpirationDate from './ExpirationDate';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardFieldsProps } from './types';\nimport classNames from 'classnames';\nimport {\n BRAND_ICON_UI_EXCLUSION_LIST,\n DATE_POLICY_HIDDEN,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport AvailableBrands from './AvailableBrands';\nimport './CardFields.scss';\n\nexport default function CardFields({\n brand,\n brandsIcons,\n brandsConfiguration,\n dualBrandingElements,\n errors,\n focusedElement,\n hasCVC,\n cvcPolicy,\n expiryDatePolicy,\n onFocusField,\n showBrandIcon,\n valid,\n showContextualElement\n}: CardFieldsProps) {\n const { i18n } = useCoreContext();\n\n const getError = (errors, fieldType) => {\n return errors[fieldType] ? i18n.get(errors[fieldType]) : null;\n };\n\n // A set of brands filtered to exclude those that can never appear in the UI\n const allowedBrands = brandsIcons?.filter(brandsIcons => !BRAND_ICON_UI_EXCLUSION_LIST?.includes(brandsIcons.name));\n const isAmex = brand === 'amex';\n const cvcContextualText = isAmex\n ? i18n.get('creditCard.securityCode.contextualText.4digits')\n : i18n.get('creditCard.securityCode.contextualText.3digits');\n\n return (\n <div className=\"adyen-checkout__card__form\">\n <CardNumber\n brand={brand}\n brandsConfiguration={brandsConfiguration}\n error={getError(errors, ENCRYPTED_CARD_NUMBER)}\n focused={focusedElement === ENCRYPTED_CARD_NUMBER}\n isValid={!!valid.encryptedCardNumber}\n label={i18n.get('creditCard.cardNumber.label')}\n onFocusField={onFocusField}\n filled={!!errors.encryptedCardNumber || !!valid.encryptedCardNumber}\n showBrandIcon={showBrandIcon}\n dualBrandingElements={dualBrandingElements}\n />\n\n <AvailableBrands activeBrand={brand} brands={allowedBrands} />\n\n <div\n className={classNames('adyen-checkout__card__exp-cvc', {\n 'adyen-checkout__card__exp-cvc__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN\n })}\n >\n <ExpirationDate\n classNameModifiers={['col-50']}\n error={getError(errors, ENCRYPTED_EXPIRY_DATE)}\n focused={focusedElement === ENCRYPTED_EXPIRY_DATE}\n isValid={!!valid.encryptedExpiryMonth && !!valid.encryptedExpiryYear}\n filled={!!errors.encryptedExpiryDate || !!valid.encryptedExpiryYear}\n label={i18n.get('creditCard.expiryDate.label')}\n onFocusField={onFocusField}\n expiryDatePolicy={expiryDatePolicy}\n showContextualElement={showContextualElement}\n contextualText={i18n.get('creditCard.expiryDate.contextualText')}\n />\n\n {hasCVC && (\n <CVC\n classNameModifiers={['col-50']}\n error={getError(errors, ENCRYPTED_SECURITY_CODE)}\n focused={focusedElement === ENCRYPTED_SECURITY_CODE}\n cvcPolicy={cvcPolicy}\n isValid={!!valid.encryptedSecurityCode}\n filled={!!errors.encryptedSecurityCode || !!valid.encryptedSecurityCode}\n label={i18n.get('creditCard.securityCode.label')}\n onFocusField={onFocusField}\n frontCVC={isAmex}\n showContextualElement={showContextualElement}\n contextualText={cvcContextualText}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["CardFields","brand","brandsIcons","brandsConfiguration","dualBrandingElements","errors","focusedElement","hasCVC","cvcPolicy","expiryDatePolicy","onFocusField","showBrandIcon","valid","showContextualElement","i18n","useCoreContext","getError","fieldType","get","allowedBrands","filter","BRAND_ICON_UI_EXCLUSION_LIST","includes","name","isAmex","cvcContextualText","h","div","className","CardNumber","error","ENCRYPTED_CARD_NUMBER","focused","isValid","encryptedCardNumber","label","filled","AvailableBrands","activeBrand","brands","classNames","DATE_POLICY_HIDDEN","ExpirationDate","classNameModifiers","ENCRYPTED_EXPIRY_DATE","encryptedExpiryMonth","encryptedExpiryYear","encryptedExpiryDate","contextualText","CVC","ENCRYPTED_SECURITY_CODE","encryptedSecurityCode","frontCVC"],"mappings":"uiBAiBe,SAASA,GAAWC,MAC/BA,EAAKC,YACLA,EAAWC,oBACXA,EAAmBC,qBACnBA,EAAoBC,OACpBA,EAAMC,eACNA,EAAcC,OACdA,EAAMC,UACNA,EAASC,iBACTA,EAAgBC,aAChBA,EAAYC,cACZA,EAAaC,MACbA,EAAKC,sBACLA,IAEA,MAAMC,KAAEA,GAASC,IAEXC,EAAW,CAACX,EAAQY,IACfZ,EAAOY,GAAaH,EAAKI,IAAIb,EAAOY,IAAc,KAIvDE,EAAgBjB,aAAAA,EAAAA,EAAakB,OAAOlB,KAAgBmB,aAAAA,EAAAA,EAA8BC,SAASpB,EAAYqB,QACvGC,EAAmB,SAAVvB,EACTwB,EAAoBD,EACpBV,EAAKI,IAAI,kDACTJ,EAAKI,IAAI,kDAEf,OACIQ,EAACC,MAAAA,CAAIC,UAAU,8BACXF,EAACG,EAAAA,CACG5B,MAAOA,EACPE,oBAAqBA,EACrB2B,MAAOd,EAASX,EAAQ0B,GACxBC,QAAS1B,IAAmByB,EAC5BE,UAAWrB,EAAMsB,oBACjBC,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACd0B,SAAU/B,EAAO6B,uBAAyBtB,EAAMsB,oBAChDvB,cAAeA,EACfP,qBAAsBA,IAG1BsB,EAACW,EAAAA,CAAgBC,YAAarC,EAAOsC,OAAQpB,IAE7CO,EAACC,MAAAA,CACGC,UAAWY,EAAW,gCAAiC,CACnD,yDAA0D/B,IAAqBgC,KAGnFf,EAACgB,EAAAA,CACGC,mBAAoB,CAAC,UACrBb,MAAOd,EAASX,EAAQuC,GACxBZ,QAAS1B,IAAmBsC,EAC5BX,UAAWrB,EAAMiC,wBAA0BjC,EAAMkC,oBACjDV,SAAU/B,EAAO0C,uBAAyBnC,EAAMkC,oBAChDX,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACdD,iBAAkBA,EAClBI,sBAAuBA,EACvBmC,eAAgBlC,EAAKI,IAAI,0CAG5BX,GACGmB,EAACuB,EAAAA,CACGN,mBAAoB,CAAC,UACrBb,MAAOd,EAASX,EAAQ6C,GACxBlB,QAAS1B,IAAmB4C,EAC5B1C,UAAWA,EACXyB,UAAWrB,EAAMuC,sBACjBf,SAAU/B,EAAO8C,yBAA2BvC,EAAMuC,sBAClDhB,MAAOrB,EAAKI,IAAI,iCAChBR,aAAcA,EACd0C,SAAU5B,EACVX,sBAAuBA,EACvBmC,eAAgBvB,KAMxC"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../internal/LoadingWrapper/LoadingWrapper.js";import s from"./CardFields.js";import a from"./KCPAuthentication.js";import l from"../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js";import o from"../../../../internal/StoreDetails/StoreDetails.js";import i from"../../../../internal/Address/Address.js";import n from"./CardHolderName.js";import t from"./Installments/Installments.js";import d from"../../../../internal/DisclaimerMessage/DisclaimerMessage.js";import u from"../../../../internal/FormFields/RadioGroupExtended/RadioGroupExtended.js";import{mustHandleDualBrandingAccordingToEURegulations as c,mapDualBrandButtons as m}from"../utils.js";import p from"../../../../internal/FormFields/Fieldset/Fieldset.js";import{useCoreContext as h}from"../../../../../core/Context/CoreProvider.js";import{DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM as b}from"../../../Card.js";const F=({data:F,valid:y,errors:N,handleChangeFor:S,sfpState:f,setFocusOn:A,cvcPolicy:C,focusedElement:g,hasInstallments:x,handleInstallments:B,showAmountsInInstallments:w,brandsIcons:v,formData:j,formErrors:D,formValid:I,expiryDatePolicy:E,dualBrandSelectElements:P,extensions:k,selectedBrandValue:O,showKCP:R,showBrazilianSSN:q,socialSecurityNumber:V,handleOnStoreDetails:M,billingAddress:T,handleAddress:L,setAddressRef:_,partialAddressSchema:z,onAddressLookup:H,onAddressSelected:G,addressSearchDebounceMs:K,amount:W,billingAddressRequired:$,billingAddressRequiredFields:J,billingAddressAllowedCountries:Q,billingAddressValidationRules:U=null,brandsConfiguration:X,showStoreDetailsCheckbox:Y,hasCVC:Z,hasHolderName:ee,holderNameRequired:re,installmentOptions:se,placeholders:ae,positionHolderNameOnTop:le,showBrandIcon:oe,showContextualElement:ie,iOSFocusedField:ne,disclaimerMessage:te,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue})=>{const{i18n:ce}=h(),me=e(n,{required:re,placeholder:ae.holderName,value:j.holderName,error:!!D.holderName&&re,isValid:!!I.holderName,onBlur:S("holderName","blur"),onInput:S("holderName","input"),disabled:ne&&"holderName"!==ne,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue}),pe=c(b,P,"id");return e(r,{status:f.status},ee&&le&&me,e(s,{showBrandIcon:oe,showContextualElement:ie,brand:f.brand,brandsIcons:v,brandsConfiguration:X,focusedElement:g,onFocusField:A,hasCVC:Z,cvcPolicy:C,expiryDatePolicy:E,errors:f.errors,valid:f.valid,dualBrandingElements:P.length>0&&P}),ee&&!le&&me,pe&&P.length>0&&P&&e(p,{classNameModifiers:["dual-brand-switcher"],label:ce.get("creditCard.dualBrand.title")},e("p",{className:"adyen-checkout-form-instruction"},ce.get("creditCard.dualBrand.description")),e(u,{name:"dualBrandSwitcher",value:O,items:m(P,X),onChange:k.handleDualBrandSelection,required:!0,showSelectedTick:!0})),R&&e(a,{onFocusField:A,focusedElement:g,encryptedPasswordState:{data:f.encryptedPassword,valid:!!f.valid&&f.valid.encryptedPassword,errors:!!f.errors&&f.errors.encryptedPassword},value:F.taxNumber,error:!!N.taxNumber,isValid:!!y.taxNumber,onBlur:S("taxNumber","blur"),onInput:S("taxNumber","input"),disabled:ne&&"kcpTaxNumberOrDOB"!==ne,placeholder:ae.taxNumber,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue}),q&&e("div",{className:"adyen-checkout__card__socialSecurityNumber"},e(l,{onBlur:S("socialSecurityNumber","blur"),onInput:S("socialSecurityNumber","input"),error:null==N?void 0:N.socialSecurityNumber,valid:null==y?void 0:y.socialSecurityNumber,data:V,required:!0,disabled:ne&&"socialSecurityNumber"!==ne,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue})),Y&&e(o,{onChange:M}),x&&e(t,{amount:W,brand:f.brand,installmentOptions:se,onChange:B,type:w?"amount":"months"}),$&&e(i,{label:"billingAddress",data:T,onChange:L,allowedCountries:Q,requiredFields:J,setComponentRef:_,validationRules:U,specifications:z,iOSFocusedField:ne,onAddressLookup:H,showContextualElement:ie,onAddressSelected:G,addressSearchDebounceMs:K,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue}),te&&e(d,{message:te.message.replace("%{linkText}",`%#${te.linkText}%#`),urls:[te.link]}))};export{F as CardFieldsWrapper};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../internal/LoadingWrapper/LoadingWrapper.js";import s from"./CardFields.js";import a from"./KCPAuthentication.js";import l from"../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js";import o from"../../../../internal/StoreDetails/StoreDetails.js";import i from"../../../../internal/Address/Address.js";import n from"./CardHolderName.js";import t from"./Installments/Installments.js";import d from"../../../../internal/DisclaimerMessage/DisclaimerMessage.js";import u from"../../../../internal/FormFields/RadioGroupExtended/RadioGroupExtended.js";import{mustHandleDualBrandingAccordingToEURegulations as c,mapDualBrandButtons as m}from"../utils.js";import p from"../../../../internal/FormFields/Fieldset/Fieldset.js";import{useCoreContext as h}from"../../../../../core/Context/CoreProvider.js";import{DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM as b}from"../../../constants.js";const F=({data:F,valid:y,errors:N,handleChangeFor:S,sfpState:f,setFocusOn:A,cvcPolicy:C,focusedElement:g,hasInstallments:x,handleInstallments:B,showAmountsInInstallments:w,brandsIcons:v,formData:j,formErrors:D,formValid:I,expiryDatePolicy:E,dualBrandSelectElements:P,extensions:k,selectedBrandValue:O,showKCP:R,showBrazilianSSN:q,socialSecurityNumber:V,handleOnStoreDetails:M,billingAddress:T,handleAddress:L,setAddressRef:_,partialAddressSchema:z,onAddressLookup:H,onAddressSelected:G,addressSearchDebounceMs:K,amount:W,billingAddressRequired:$,billingAddressRequiredFields:J,billingAddressAllowedCountries:Q,billingAddressValidationRules:U=null,brandsConfiguration:X,showStoreDetailsCheckbox:Y,hasCVC:Z,hasHolderName:ee,holderNameRequired:re,installmentOptions:se,placeholders:ae,positionHolderNameOnTop:le,showBrandIcon:oe,showContextualElement:ie,iOSFocusedField:ne,disclaimerMessage:te,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue})=>{const{i18n:ce}=h(),me=e(n,{required:re,placeholder:ae.holderName,value:j.holderName,error:!!D.holderName&&re,isValid:!!I.holderName,onBlur:S("holderName","blur"),onInput:S("holderName","input"),disabled:ne&&"holderName"!==ne,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue}),pe=c(b,P,"id");return e(r,{status:f.status},ee&&le&&me,e(s,{showBrandIcon:oe,showContextualElement:ie,brand:f.brand,brandsIcons:v,brandsConfiguration:X,focusedElement:g,onFocusField:A,hasCVC:Z,cvcPolicy:C,expiryDatePolicy:E,errors:f.errors,valid:f.valid,dualBrandingElements:P.length>0&&P}),ee&&!le&&me,pe&&P.length>0&&P&&e(p,{classNameModifiers:["dual-brand-switcher"],label:ce.get("creditCard.dualBrand.title")},e("p",{className:"adyen-checkout-form-instruction"},ce.get("creditCard.dualBrand.description")),e(u,{name:"dualBrandSwitcher",value:O,items:m(P,X),onChange:k.handleDualBrandSelection,required:!0,showSelectedTick:!0})),R&&e(a,{onFocusField:A,focusedElement:g,encryptedPasswordState:{data:f.encryptedPassword,valid:!!f.valid&&f.valid.encryptedPassword,errors:!!f.errors&&f.errors.encryptedPassword},value:F.taxNumber,error:!!N.taxNumber,isValid:!!y.taxNumber,onBlur:S("taxNumber","blur"),onInput:S("taxNumber","input"),disabled:ne&&"kcpTaxNumberOrDOB"!==ne,placeholder:ae.taxNumber,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue}),q&&e("div",{className:"adyen-checkout__card__socialSecurityNumber"},e(l,{onBlur:S("socialSecurityNumber","blur"),onInput:S("socialSecurityNumber","input"),error:null==N?void 0:N.socialSecurityNumber,valid:null==y?void 0:y.socialSecurityNumber,data:V,required:!0,disabled:ne&&"socialSecurityNumber"!==ne,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue})),Y&&e(o,{onChange:M}),x&&e(t,{amount:W,brand:f.brand,installmentOptions:se,onChange:B,type:w?"amount":"months"}),$&&e(i,{label:"billingAddress",data:T,onChange:L,allowedCountries:Q,requiredFields:J,setComponentRef:_,validationRules:U,specifications:z,iOSFocusedField:ne,onAddressLookup:H,showContextualElement:ie,onAddressSelected:G,addressSearchDebounceMs:K,onFieldFocusAnalytics:de,onFieldBlurAnalytics:ue}),te&&e(d,{message:te.message.replace("%{linkText}",`%#${te.linkText}%#`),urls:[te.link]}))};export{F as CardFieldsWrapper};
2
2
  //# sourceMappingURL=CardFieldsWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardFieldsWrapper.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFieldsWrapper.tsx"],"sourcesContent":["import { h } from 'preact';\nimport LoadingWrapper from '../../../../internal/LoadingWrapper';\nimport CardFields from './CardFields';\nimport KCPAuthentication from './KCPAuthentication';\nimport SocialSecurityNumberBrazil from '../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil';\nimport StoreDetails from '../../../../internal/StoreDetails';\nimport Address from '../../../../internal/Address';\nimport CardHolderName from './CardHolderName';\nimport Installments from './Installments';\nimport DisclaimerMessage from '../../../../internal/DisclaimerMessage';\nimport RadioGroupExtended from '../../../../internal/FormFields/RadioGroupExtended';\nimport { mapDualBrandButtons, mustHandleDualBrandingAccordingToEURegulations } from '../utils';\nimport Fieldset from '../../../../internal/FormFields/Fieldset';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM } from '../../../Card';\n\nexport const CardFieldsWrapper = ({\n // vars created in CardInput:\n // base (shared)\n data,\n valid,\n errors,\n handleChangeFor,\n sfpState,\n setFocusOn,\n cvcPolicy,\n focusedElement,\n hasInstallments,\n handleInstallments,\n showAmountsInInstallments,\n // Card\n brandsIcons,\n formData,\n formErrors,\n formValid,\n expiryDatePolicy,\n dualBrandSelectElements,\n extensions,\n selectedBrandValue,\n // KCP\n showKCP,\n // SSN\n showBrazilianSSN,\n socialSecurityNumber,\n // Store details\n handleOnStoreDetails,\n // Address\n billingAddress,\n handleAddress,\n setAddressRef,\n partialAddressSchema,\n onAddressLookup,\n onAddressSelected,\n addressSearchDebounceMs,\n // For this comp (props passed through from CardInput)\n amount,\n billingAddressRequired,\n billingAddressRequiredFields,\n billingAddressAllowedCountries,\n billingAddressValidationRules = null,\n brandsConfiguration,\n showStoreDetailsCheckbox,\n hasCVC,\n hasHolderName,\n holderNameRequired,\n installmentOptions,\n placeholders,\n positionHolderNameOnTop,\n // For CardFields > CardNumber\n showBrandIcon,\n showContextualElement,\n //\n iOSFocusedField,\n disclaimerMessage,\n //\n onFieldFocusAnalytics,\n onFieldBlurAnalytics\n}) => {\n const { i18n } = useCoreContext();\n\n const cardHolderField = (\n <CardHolderName\n required={holderNameRequired}\n placeholder={placeholders.holderName}\n value={formData.holderName}\n error={!!formErrors.holderName && holderNameRequired}\n isValid={!!formValid.holderName}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'holderName'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n );\n\n // Only if the brands in DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM are present in the binLookup response should we handle dual branding based on EU regulations\n const showDualBrandSelectElements = mustHandleDualBrandingAccordingToEURegulations(\n DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM,\n dualBrandSelectElements,\n 'id'\n );\n\n return (\n <LoadingWrapper status={sfpState.status}>\n {hasHolderName && positionHolderNameOnTop && cardHolderField}\n\n <CardFields\n showBrandIcon={showBrandIcon}\n showContextualElement={showContextualElement}\n brand={sfpState.brand}\n brandsIcons={brandsIcons}\n brandsConfiguration={brandsConfiguration}\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n hasCVC={hasCVC}\n cvcPolicy={cvcPolicy}\n expiryDatePolicy={expiryDatePolicy}\n errors={sfpState.errors}\n valid={sfpState.valid}\n dualBrandingElements={dualBrandSelectElements.length > 0 && dualBrandSelectElements}\n />\n\n {hasHolderName && !positionHolderNameOnTop && cardHolderField}\n\n {showDualBrandSelectElements && dualBrandSelectElements.length > 0 && dualBrandSelectElements && (\n <Fieldset classNameModifiers={['dual-brand-switcher']} label={i18n.get('creditCard.dualBrand.title')}>\n <p className={'adyen-checkout-form-instruction'}>{i18n.get('creditCard.dualBrand.description')}</p>\n <RadioGroupExtended\n name={'dualBrandSwitcher'}\n value={selectedBrandValue} // Set which button is in a selected (checked) state\n items={mapDualBrandButtons(dualBrandSelectElements, brandsConfiguration)}\n onChange={extensions.handleDualBrandSelection}\n required={true}\n showSelectedTick={true}\n />\n </Fieldset>\n )}\n\n {showKCP && (\n <KCPAuthentication\n onFocusField={setFocusOn}\n focusedElement={focusedElement}\n encryptedPasswordState={{\n data: sfpState.encryptedPassword,\n valid: sfpState.valid ? sfpState.valid.encryptedPassword : false,\n errors: sfpState.errors ? sfpState.errors.encryptedPassword : false\n }}\n value={data.taxNumber}\n error={!!errors.taxNumber}\n isValid={!!valid.taxNumber}\n onBlur={handleChangeFor('taxNumber', 'blur')}\n onInput={handleChangeFor('taxNumber', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'kcpTaxNumberOrDOB'}\n placeholder={placeholders.taxNumber}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {showBrazilianSSN && (\n <div className=\"adyen-checkout__card__socialSecurityNumber\">\n <SocialSecurityNumberBrazil\n onBlur={handleChangeFor('socialSecurityNumber', 'blur')}\n onInput={handleChangeFor('socialSecurityNumber', 'input')}\n error={errors?.socialSecurityNumber}\n valid={valid?.socialSecurityNumber}\n data={socialSecurityNumber}\n required={true}\n disabled={iOSFocusedField && iOSFocusedField !== 'socialSecurityNumber'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n\n {showStoreDetailsCheckbox && <StoreDetails onChange={handleOnStoreDetails} />}\n\n {hasInstallments && (\n <Installments\n amount={amount}\n brand={sfpState.brand}\n installmentOptions={installmentOptions}\n onChange={handleInstallments}\n type={showAmountsInInstallments ? 'amount' : 'months'}\n />\n )}\n\n {billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={billingAddressAllowedCountries}\n requiredFields={billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n validationRules={billingAddressValidationRules}\n specifications={partialAddressSchema}\n iOSFocusedField={iOSFocusedField}\n onAddressLookup={onAddressLookup}\n showContextualElement={showContextualElement}\n onAddressSelected={onAddressSelected}\n addressSearchDebounceMs={addressSearchDebounceMs}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {disclaimerMessage && (\n <DisclaimerMessage\n message={disclaimerMessage.message.replace('%{linkText}', `%#${disclaimerMessage.linkText}%#`)}\n urls={[disclaimerMessage.link]}\n />\n )}\n </LoadingWrapper>\n );\n};\n"],"names":["CardFieldsWrapper","data","valid","errors","handleChangeFor","sfpState","setFocusOn","cvcPolicy","focusedElement","hasInstallments","handleInstallments","showAmountsInInstallments","brandsIcons","formData","formErrors","formValid","expiryDatePolicy","dualBrandSelectElements","extensions","selectedBrandValue","showKCP","showBrazilianSSN","socialSecurityNumber","handleOnStoreDetails","billingAddress","handleAddress","setAddressRef","partialAddressSchema","onAddressLookup","onAddressSelected","addressSearchDebounceMs","amount","billingAddressRequired","billingAddressRequiredFields","billingAddressAllowedCountries","billingAddressValidationRules","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","hasHolderName","holderNameRequired","installmentOptions","placeholders","positionHolderNameOnTop","showBrandIcon","showContextualElement","iOSFocusedField","disclaimerMessage","onFieldFocusAnalytics","onFieldBlurAnalytics","i18n","useCoreContext","cardHolderField","h","CardHolderName","required","placeholder","holderName","value","error","isValid","onBlur","onInput","disabled","showDualBrandSelectElements","mustHandleDualBrandingAccordingToEURegulations","DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM","LoadingWrapper","status","CardFields","brand","onFocusField","dualBrandingElements","length","Fieldset","classNameModifiers","label","get","p","className","RadioGroupExtended","name","items","mapDualBrandButtons","onChange","handleDualBrandSelection","showSelectedTick","KCPAuthentication","encryptedPasswordState","encryptedPassword","taxNumber","div","SocialSecurityNumberBrazil","StoreDetails","Installments","type","Address","allowedCountries","requiredFields","setComponentRef","validationRules","specifications","DisclaimerMessage","message","replace","linkText","urls","link"],"mappings":"q+BAgBO,MAAMA,EAAoB,EAG7BC,OACAC,QACAC,SACAC,kBACAC,WACAC,aACAC,YACAC,iBACAC,kBACAC,qBACAC,4BAEAC,cACAC,WACAC,aACAC,YACAC,mBACAC,0BACAC,aACAC,qBAEAC,UAEAC,mBACAC,uBAEAC,uBAEAC,iBACAC,gBACAC,gBACAC,uBACAC,kBACAC,oBACAC,0BAEAC,SACAC,yBACAC,+BACAC,iCACAC,gCAAgC,KAChCC,sBACAC,2BACAC,SACAC,iBACAC,sBACAC,sBACAC,gBACAC,2BAEAC,iBACAC,yBAEAC,mBACAC,qBAEAC,yBACAC,4BAEA,MAAMC,KAAEA,IAASC,IAEXC,GACFC,EAACC,EAAAA,CACGC,SAAUf,GACVgB,YAAad,GAAae,WAC1BC,MAAO7C,EAAS4C,WAChBE,QAAS7C,EAAW2C,YAAcjB,GAClCoB,UAAW7C,EAAU0C,WACrBI,OAAQzD,EAAgB,aAAc,QACtC0D,QAAS1D,EAAgB,aAAc,SACvC2D,SAAUjB,IAAuC,eAApBA,GAC7BE,sBAAuBA,GACvBC,qBAAsBA,KAKxBe,GAA8BC,EAChCC,EACAjD,EACA,MAGJ,OACIoC,EAACc,EAAAA,CAAeC,OAAQ/D,EAAS+D,QAC5B7B,IAAiBI,IAA2BS,GAE7CC,EAACgB,EAAAA,CACGzB,cAAeA,GACfC,sBAAuBA,GACvByB,MAAOjE,EAASiE,MAChB1D,YAAaA,EACbwB,oBAAqBA,EACrB5B,eAAgBA,EAChB+D,aAAcjE,EACdgC,OAAQA,EACR/B,UAAWA,EACXS,iBAAkBA,EAClBb,OAAQE,EAASF,OACjBD,MAAOG,EAASH,MAChBsE,qBAAsBvD,EAAwBwD,OAAS,GAAKxD,IAG/DsB,KAA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B,SAAW,WAIpDqB,GACGqB,EAAC2C,EAAAA,CACGpB,MAAM,iBACN3E,KAAMuB,EACN4D,SAAU3D,EACVwE,iBAAkB/D,EAClBgE,eAAgBjE,EAChBkE,gBAAiBzE,EACjB0E,gBAAiBjE,EACjBkE,eAAgB1E,EAChBmB,gBAAiBA,GACjBlB,gBAAiBA,EACjBiB,sBAAuBA,GACvBhB,kBAAmBA,EACnBC,wBAAyBA,EACzBkB,sBAAuBA,GACvBC,qBAAsBA,KAI7BF,IACGM,EAACiD,EAAAA,CACGC,QAASxD,GAAkBwD,QAAQC,QAAQ,cAAe,KAAKzD,GAAkB0D,cACjFC,KAAM,CAAC3D,GAAkB4D"}
1
+ {"version":3,"file":"CardFieldsWrapper.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFieldsWrapper.tsx"],"sourcesContent":["import { h } from 'preact';\nimport LoadingWrapper from '../../../../internal/LoadingWrapper';\nimport CardFields from './CardFields';\nimport KCPAuthentication from './KCPAuthentication';\nimport SocialSecurityNumberBrazil from '../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil';\nimport StoreDetails from '../../../../internal/StoreDetails';\nimport Address from '../../../../internal/Address';\nimport CardHolderName from './CardHolderName';\nimport Installments from './Installments';\nimport DisclaimerMessage from '../../../../internal/DisclaimerMessage';\nimport RadioGroupExtended from '../../../../internal/FormFields/RadioGroupExtended';\nimport { mapDualBrandButtons, mustHandleDualBrandingAccordingToEURegulations } from '../utils';\nimport Fieldset from '../../../../internal/FormFields/Fieldset';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM } from '../../../constants';\n\nexport const CardFieldsWrapper = ({\n // vars created in CardInput:\n // base (shared)\n data,\n valid,\n errors,\n handleChangeFor,\n sfpState,\n setFocusOn,\n cvcPolicy,\n focusedElement,\n hasInstallments,\n handleInstallments,\n showAmountsInInstallments,\n // Card\n brandsIcons,\n formData,\n formErrors,\n formValid,\n expiryDatePolicy,\n dualBrandSelectElements,\n extensions,\n selectedBrandValue,\n // KCP\n showKCP,\n // SSN\n showBrazilianSSN,\n socialSecurityNumber,\n // Store details\n handleOnStoreDetails,\n // Address\n billingAddress,\n handleAddress,\n setAddressRef,\n partialAddressSchema,\n onAddressLookup,\n onAddressSelected,\n addressSearchDebounceMs,\n // For this comp (props passed through from CardInput)\n amount,\n billingAddressRequired,\n billingAddressRequiredFields,\n billingAddressAllowedCountries,\n billingAddressValidationRules = null,\n brandsConfiguration,\n showStoreDetailsCheckbox,\n hasCVC,\n hasHolderName,\n holderNameRequired,\n installmentOptions,\n placeholders,\n positionHolderNameOnTop,\n // For CardFields > CardNumber\n showBrandIcon,\n showContextualElement,\n //\n iOSFocusedField,\n disclaimerMessage,\n //\n onFieldFocusAnalytics,\n onFieldBlurAnalytics\n}) => {\n const { i18n } = useCoreContext();\n\n const cardHolderField = (\n <CardHolderName\n required={holderNameRequired}\n placeholder={placeholders.holderName}\n value={formData.holderName}\n error={!!formErrors.holderName && holderNameRequired}\n isValid={!!formValid.holderName}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'holderName'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n );\n\n // Only if the brands in DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM are present in the binLookup response should we handle dual branding based on EU regulations\n const showDualBrandSelectElements = mustHandleDualBrandingAccordingToEURegulations(\n DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM,\n dualBrandSelectElements,\n 'id'\n );\n\n return (\n <LoadingWrapper status={sfpState.status}>\n {hasHolderName && positionHolderNameOnTop && cardHolderField}\n\n <CardFields\n showBrandIcon={showBrandIcon}\n showContextualElement={showContextualElement}\n brand={sfpState.brand}\n brandsIcons={brandsIcons}\n brandsConfiguration={brandsConfiguration}\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n hasCVC={hasCVC}\n cvcPolicy={cvcPolicy}\n expiryDatePolicy={expiryDatePolicy}\n errors={sfpState.errors}\n valid={sfpState.valid}\n dualBrandingElements={dualBrandSelectElements.length > 0 && dualBrandSelectElements}\n />\n\n {hasHolderName && !positionHolderNameOnTop && cardHolderField}\n\n {showDualBrandSelectElements && dualBrandSelectElements.length > 0 && dualBrandSelectElements && (\n <Fieldset classNameModifiers={['dual-brand-switcher']} label={i18n.get('creditCard.dualBrand.title')}>\n <p className={'adyen-checkout-form-instruction'}>{i18n.get('creditCard.dualBrand.description')}</p>\n <RadioGroupExtended\n name={'dualBrandSwitcher'}\n value={selectedBrandValue} // Set which button is in a selected (checked) state\n items={mapDualBrandButtons(dualBrandSelectElements, brandsConfiguration)}\n onChange={extensions.handleDualBrandSelection}\n required={true}\n showSelectedTick={true}\n />\n </Fieldset>\n )}\n\n {showKCP && (\n <KCPAuthentication\n onFocusField={setFocusOn}\n focusedElement={focusedElement}\n encryptedPasswordState={{\n data: sfpState.encryptedPassword,\n valid: sfpState.valid ? sfpState.valid.encryptedPassword : false,\n errors: sfpState.errors ? sfpState.errors.encryptedPassword : false\n }}\n value={data.taxNumber}\n error={!!errors.taxNumber}\n isValid={!!valid.taxNumber}\n onBlur={handleChangeFor('taxNumber', 'blur')}\n onInput={handleChangeFor('taxNumber', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'kcpTaxNumberOrDOB'}\n placeholder={placeholders.taxNumber}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {showBrazilianSSN && (\n <div className=\"adyen-checkout__card__socialSecurityNumber\">\n <SocialSecurityNumberBrazil\n onBlur={handleChangeFor('socialSecurityNumber', 'blur')}\n onInput={handleChangeFor('socialSecurityNumber', 'input')}\n error={errors?.socialSecurityNumber}\n valid={valid?.socialSecurityNumber}\n data={socialSecurityNumber}\n required={true}\n disabled={iOSFocusedField && iOSFocusedField !== 'socialSecurityNumber'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n\n {showStoreDetailsCheckbox && <StoreDetails onChange={handleOnStoreDetails} />}\n\n {hasInstallments && (\n <Installments\n amount={amount}\n brand={sfpState.brand}\n installmentOptions={installmentOptions}\n onChange={handleInstallments}\n type={showAmountsInInstallments ? 'amount' : 'months'}\n />\n )}\n\n {billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={billingAddressAllowedCountries}\n requiredFields={billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n validationRules={billingAddressValidationRules}\n specifications={partialAddressSchema}\n iOSFocusedField={iOSFocusedField}\n onAddressLookup={onAddressLookup}\n showContextualElement={showContextualElement}\n onAddressSelected={onAddressSelected}\n addressSearchDebounceMs={addressSearchDebounceMs}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {disclaimerMessage && (\n <DisclaimerMessage\n message={disclaimerMessage.message.replace('%{linkText}', `%#${disclaimerMessage.linkText}%#`)}\n urls={[disclaimerMessage.link]}\n />\n )}\n </LoadingWrapper>\n );\n};\n"],"names":["CardFieldsWrapper","data","valid","errors","handleChangeFor","sfpState","setFocusOn","cvcPolicy","focusedElement","hasInstallments","handleInstallments","showAmountsInInstallments","brandsIcons","formData","formErrors","formValid","expiryDatePolicy","dualBrandSelectElements","extensions","selectedBrandValue","showKCP","showBrazilianSSN","socialSecurityNumber","handleOnStoreDetails","billingAddress","handleAddress","setAddressRef","partialAddressSchema","onAddressLookup","onAddressSelected","addressSearchDebounceMs","amount","billingAddressRequired","billingAddressRequiredFields","billingAddressAllowedCountries","billingAddressValidationRules","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","hasHolderName","holderNameRequired","installmentOptions","placeholders","positionHolderNameOnTop","showBrandIcon","showContextualElement","iOSFocusedField","disclaimerMessage","onFieldFocusAnalytics","onFieldBlurAnalytics","i18n","useCoreContext","cardHolderField","h","CardHolderName","required","placeholder","holderName","value","error","isValid","onBlur","onInput","disabled","showDualBrandSelectElements","mustHandleDualBrandingAccordingToEURegulations","DUAL_BRANDS_THAT_NEED_SELECTION_MECHANISM","LoadingWrapper","status","CardFields","brand","onFocusField","dualBrandingElements","length","Fieldset","classNameModifiers","label","get","p","className","RadioGroupExtended","name","items","mapDualBrandButtons","onChange","handleDualBrandSelection","showSelectedTick","KCPAuthentication","encryptedPasswordState","encryptedPassword","taxNumber","div","SocialSecurityNumberBrazil","StoreDetails","Installments","type","Address","allowedCountries","requiredFields","setComponentRef","validationRules","specifications","DisclaimerMessage","message","replace","linkText","urls","link"],"mappings":"0+BAgBO,MAAMA,EAAoB,EAG7BC,OACAC,QACAC,SACAC,kBACAC,WACAC,aACAC,YACAC,iBACAC,kBACAC,qBACAC,4BAEAC,cACAC,WACAC,aACAC,YACAC,mBACAC,0BACAC,aACAC,qBAEAC,UAEAC,mBACAC,uBAEAC,uBAEAC,iBACAC,gBACAC,gBACAC,uBACAC,kBACAC,oBACAC,0BAEAC,SACAC,yBACAC,+BACAC,iCACAC,gCAAgC,KAChCC,sBACAC,2BACAC,SACAC,iBACAC,sBACAC,sBACAC,gBACAC,2BAEAC,iBACAC,yBAEAC,mBACAC,qBAEAC,yBACAC,4BAEA,MAAMC,KAAEA,IAASC,IAEXC,GACFC,EAACC,EAAAA,CACGC,SAAUf,GACVgB,YAAad,GAAae,WAC1BC,MAAO7C,EAAS4C,WAChBE,QAAS7C,EAAW2C,YAAcjB,GAClCoB,UAAW7C,EAAU0C,WACrBI,OAAQzD,EAAgB,aAAc,QACtC0D,QAAS1D,EAAgB,aAAc,SACvC2D,SAAUjB,IAAuC,eAApBA,GAC7BE,sBAAuBA,GACvBC,qBAAsBA,KAKxBe,GAA8BC,EAChCC,EACAjD,EACA,MAGJ,OACIoC,EAACc,EAAAA,CAAeC,OAAQ/D,EAA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EAAQmB,qBACfpB,MAAOA,aAAAA,EAAAA,EAAOoB,qBACdrB,KAAMqB,EACNiC,UAAU,EACVQ,SAAUjB,IAAuC,yBAApBA,GAC7BE,sBAAuBA,GACvBC,qBAAsBA,MAKjCZ,GAA4BgB,EAACwC,EAAAA,CAAaT,SAAU7D,IAEpDd,GACG4C,EAACyC,EAAAA,CACG/D,OAAQA,EACRuC,MAAOjE,EAASiE,MAChB7B,mBAAoBA,GACpB2C,SAAU1E,EACVqF,KAAMpF,EAA4B,SAAW,WAIpDqB,GACGqB,EAAC2C,EAAAA,CACGpB,MAAM,iBACN3E,KAAMuB,EACN4D,SAAU3D,EACVwE,iBAAkB/D,EAClBgE,eAAgBjE,EAChBkE,gBAAiBzE,EACjB0E,gBAAiBjE,EACjBkE,eAAgB1E,EAChBmB,gBAAiBA,GACjBlB,gBAAiBA,EACjBiB,sBAAuBA,GACvBhB,kBAAmBA,EACnBC,wBAAyBA,EACzBkB,sBAAuBA,GACvBC,qBAAsBA,KAI7BF,IACGM,EAACiD,EAAAA,CACGC,QAASxD,GAAkBwD,QAAQC,QAAQ,cAAe,KAAKzD,GAAkB0D,cACjFC,KAAM,CAAC3D,GAAkB4D"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../_virtual/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import o from"./DataSfSpan.js";import{DATE_POLICY_REQUIRED as n,DATE_POLICY_OPTIONAL as r,DATE_POLICY_HIDDEN as l,ENCRYPTED_EXPIRY_DATE as d}from"../../../../internal/SecuredFields/lib/constants.js";import c from"../../../../../core/Context/useImage.js";import{alternativeLabelContent as _}from"./FieldLabelAlternative.js";function s(s){const{label:p,focused:u,filled:m,onFocusField:f,className:x="",error:h="",isValid:y=!1,expiryDatePolicy:k=n,showContextualElement:F,contextualText:j}=s,{i18n:b}=i(),C=c(),N=t(x,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":k===l,"adyen-checkout__field__exp-date--optional":k===r}),g=k!==r?p:`${p} ${b.get("field.title.optional")}`,v=`${g} ${j}`;return e(a,{label:g,classNameModifiers:["expiryDate"],className:N,focused:u,filled:m,onFocusField:()=>f(d),errorMessage:h,isValid:y,dir:"ltr",name:"encryptedExpiryDate",i18n:b,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:_,showContextualElement:F,contextualText:j},e(o,{encryptedFieldType:d,className:t("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":h,"adyen-checkout__input--focus":u,"adyen-checkout__input--valid":y})}),e("span",{className:t("adyen-checkout__field__exp-date_hint_wrapper",{"adyen-checkout__field__exp-date_hint_wrapper--hidden":h||y})},e("img",{src:C({imageFolder:"components/"})("expiry_date_hint"),className:"adyen-checkout__field__exp-date_hint",alt:v,onClick:()=>{f(d)}})))}export{s as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"../../../../../_virtual/index.js";import a from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import o from"./DataSfSpan.js";import{DATE_POLICY_REQUIRED as n,DATE_POLICY_OPTIONAL as r,DATE_POLICY_HIDDEN as l,ENCRYPTED_EXPIRY_DATE as d}from"../../../../internal/SecuredFields/lib/constants.js";import c from"../../../../../core/Context/useImage.js";import{alternativeLabelContent as s}from"./FieldLabelAlternative.js";function _(_){const{label:p,focused:u,filled:m,onFocusField:f,className:x="",classNameModifiers:h=[],error:y="",isValid:k=!1,expiryDatePolicy:F=n,showContextualElement:j,contextualText:b}=_,{i18n:N}=i(),C=c(),g=t(x,{"adyen-checkout__field__exp-date":!0,"adyen-checkout__card__exp-date__input--hidden":F===l,"adyen-checkout__field__exp-date--optional":F===r}),v=F!==r?p:`${p} ${N.get("field.title.optional")}`,E=`${v} ${b}`;return e(a,{label:v,classNameModifiers:[...h,"expiryDate"],className:g,focused:u,filled:m,onFocusField:()=>f(d),errorMessage:y,isValid:k,dir:"ltr",name:"encryptedExpiryDate",i18n:N,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:s,showContextualElement:j,contextualText:b},e(o,{encryptedFieldType:d,className:t("adyen-checkout__input","adyen-checkout__input--small","adyen-checkout__card__exp-date__input",{"adyen-checkout__input--error":y,"adyen-checkout__input--focus":u,"adyen-checkout__input--valid":k})}),e("span",{className:t("adyen-checkout__field__exp-date_hint_wrapper",{"adyen-checkout__field__exp-date_hint_wrapper--hidden":y||k})},e("img",{src:C({imageFolder:"components/"})("expiry_date_hint"),className:"adyen-checkout__field__exp-date_hint",alt:E,onClick:()=>{f(d)}})))}export{_ as default};
2
2
  //# sourceMappingURL=ExpirationDate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpirationDate.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/ExpirationDate.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { ExpirationDateProps } from './types';\nimport DataSfSpan from './DataSfSpan';\n\nimport {\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport useImage from '../../../../../core/Context/useImage';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function ExpirationDate(props: ExpirationDateProps) {\n const {\n label,\n focused,\n filled,\n onFocusField,\n className = '',\n error = '',\n isValid = false,\n expiryDatePolicy = DATE_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__exp-date': true,\n 'adyen-checkout__card__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN,\n 'adyen-checkout__field__exp-date--optional': expiryDatePolicy === DATE_POLICY_OPTIONAL\n });\n\n const fieldLabel = expiryDatePolicy !== DATE_POLICY_OPTIONAL ? label : `${label} ${i18n.get('field.title.optional')}`;\n\n const handleIconClick = () => {\n onFocusField(ENCRYPTED_EXPIRY_DATE);\n };\n\n const imageDescription = `${fieldLabel} ${contextualText}`;\n\n return (\n <Field\n label={fieldLabel}\n classNameModifiers={['expiryDate']}\n className={fieldClassnames}\n focused={focused}\n filled={filled}\n onFocusField={() => onFocusField(ENCRYPTED_EXPIRY_DATE)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={'encryptedExpiryDate'}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_EXPIRY_DATE}\n className={classNames('adyen-checkout__input', 'adyen-checkout__input--small', 'adyen-checkout__card__exp-date__input', {\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n <span\n className={classNames('adyen-checkout__field__exp-date_hint_wrapper', {\n 'adyen-checkout__field__exp-date_hint_wrapper--hidden': error || isValid\n })}\n >\n {/*eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions*/}\n <img\n src={getImage({ imageFolder: 'components/' })('expiry_date_hint')}\n className=\"adyen-checkout__field__exp-date_hint\"\n alt={imageDescription}\n onClick={handleIconClick}\n />\n </span>\n </Field>\n );\n}\n"],"names":["ExpirationDate","props","label","focused","filled","onFocusField","className","error","isValid","expiryDatePolicy","DATE_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","getImage","useImage","fieldClassnames","classNames","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","fieldLabel","get","imageDescription","h","Field","classNameModifiers","ENCRYPTED_EXPIRY_DATE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","span","img","src","imageFolder","alt","onClick"],"mappings":"4kBAgBe,SAASA,EAAeC,GACnC,MAAMC,MACFA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,aACNA,EAAYC,UACZA,EAAY,GAAEC,MACdA,EAAQ,GAAEC,QACVA,GAAU,EAAKC,iBACfA,EAAmBC,EAAoBC,sBACvCA,EAAqBC,eACrBA,GACAX,GACEY,KAAEA,GAASC,IACXC,EAAWC,IAEXC,EAAkBC,EAAWZ,EAAW,CAC1C,mCAAmC,EACnC,gDAAiDG,IAAqBU,EACtE,4CAA6CV,IAAqBW,IAGhEC,EAAaZ,IAAqBW,EAAuBlB,EAAQ,GAAGA,KAASW,EAAKS,IAAI,0BAMtFC,EAAmB,GAAGF,KAAcT,IAE1C,OACIY,EAACC,EAAAA,CACGvB,MAAOmB,EACPK,mBAAoB,CAAC,cACrBpB,UAAWW,EACXd,QAASA,EACTC,OAAQA,EACRC,aAAc,IAAMA,EAAasB,GACjCC,aAAcrB,EACdC,QAASA,EACTqB,IAAK,MACLC,KAAM,sBACNjB,KAAMA,EACNkB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BvB,sBAAuBA,EACvBC,eAAgBA,GAEhBY,EAACW,EAAAA,CACGC,mBAAoBT,EACpBrB,UAAWY,EAAW,wBAAyB,+BAAgC,wCAAyC,CACpH,+BAAgCX,EAChC,+BAAgCJ,EAChC,+BAAgCK,MAGxCgB,EAACa,OAAAA,CACG/B,UAAWY,EAAW,+CAAgD,CAClE,uDAAwDX,GAASC,KAIrEgB,EAACc,MAAAA,CACGC,IAAKxB,EAAS,CAAEyB,YAAa,eAAxBzB,CAAyC,oBAC9CT,UAAU,uCACVmC,IAAKlB,EACLmB,QA3CQ,KACpBrC,EAAasB,OA+CrB"}
1
+ {"version":3,"file":"ExpirationDate.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/ExpirationDate.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { ExpirationDateProps } from './types';\nimport DataSfSpan from './DataSfSpan';\n\nimport {\n DATE_POLICY_HIDDEN,\n DATE_POLICY_OPTIONAL,\n DATE_POLICY_REQUIRED,\n ENCRYPTED_EXPIRY_DATE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport useImage from '../../../../../core/Context/useImage';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function ExpirationDate(props: ExpirationDateProps) {\n const {\n label,\n focused,\n filled,\n onFocusField,\n className = '',\n classNameModifiers = [],\n error = '',\n isValid = false,\n expiryDatePolicy = DATE_POLICY_REQUIRED,\n showContextualElement,\n contextualText\n } = props;\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const fieldClassnames = classNames(className, {\n 'adyen-checkout__field__exp-date': true,\n 'adyen-checkout__card__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN,\n 'adyen-checkout__field__exp-date--optional': expiryDatePolicy === DATE_POLICY_OPTIONAL\n });\n\n const fieldLabel = expiryDatePolicy !== DATE_POLICY_OPTIONAL ? label : `${label} ${i18n.get('field.title.optional')}`;\n\n const handleIconClick = () => {\n onFocusField(ENCRYPTED_EXPIRY_DATE);\n };\n\n const imageDescription = `${fieldLabel} ${contextualText}`;\n\n return (\n <Field\n label={fieldLabel}\n classNameModifiers={[...classNameModifiers, 'expiryDate']}\n className={fieldClassnames}\n focused={focused}\n filled={filled}\n onFocusField={() => onFocusField(ENCRYPTED_EXPIRY_DATE)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={'encryptedExpiryDate'}\n i18n={i18n}\n contextVisibleToScreenReader={false}\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_EXPIRY_DATE}\n className={classNames('adyen-checkout__input', 'adyen-checkout__input--small', 'adyen-checkout__card__exp-date__input', {\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': focused,\n 'adyen-checkout__input--valid': isValid\n })}\n />\n <span\n className={classNames('adyen-checkout__field__exp-date_hint_wrapper', {\n 'adyen-checkout__field__exp-date_hint_wrapper--hidden': error || isValid\n })}\n >\n {/*eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions*/}\n <img\n src={getImage({ imageFolder: 'components/' })('expiry_date_hint')}\n className=\"adyen-checkout__field__exp-date_hint\"\n alt={imageDescription}\n onClick={handleIconClick}\n />\n </span>\n </Field>\n );\n}\n"],"names":["ExpirationDate","props","label","focused","filled","onFocusField","className","classNameModifiers","error","isValid","expiryDatePolicy","DATE_POLICY_REQUIRED","showContextualElement","contextualText","i18n","useCoreContext","getImage","useImage","fieldClassnames","classNames","DATE_POLICY_HIDDEN","DATE_POLICY_OPTIONAL","fieldLabel","get","imageDescription","h","Field","ENCRYPTED_EXPIRY_DATE","errorMessage","dir","name","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","span","img","src","imageFolder","alt","onClick"],"mappings":"4kBAgBe,SAASA,EAAeC,GACnC,MAAMC,MACFA,EAAKC,QACLA,EAAOC,OACPA,EAAMC,aACNA,EAAYC,UACZA,EAAY,GAAEC,mBACdA,EAAqB,GAAEC,MACvBA,EAAQ,GAAEC,QACVA,GAAU,EAAKC,iBACfA,EAAmBC,EAAoBC,sBACvCA,EAAqBC,eACrBA,GACAZ,GACEa,KAAEA,GAASC,IACXC,EAAWC,IAEXC,EAAkBC,EAAWb,EAAW,CAC1C,mCAAmC,EACnC,gDAAiDI,IAAqBU,EACtE,4CAA6CV,IAAqBW,IAGhEC,EAAaZ,IAAqBW,EAAuBnB,EAAQ,GAAGA,KAASY,EAAKS,IAAI,0BAMtFC,EAAmB,GAAGF,KAAcT,IAE1C,OACIY,EAACC,EAAAA,CACGxB,MAAOoB,EACPf,mBAAoB,IAAIA,EAAoB,cAC5CD,UAAWY,EACXf,QAASA,EACTC,OAAQA,EACRC,aAAc,IAAMA,EAAasB,GACjCC,aAAcpB,EACdC,QAASA,EACToB,IAAK,MACLC,KAAM,sBACNhB,KAAMA,EACNiB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,EAC1BtB,sBAAuBA,EACvBC,eAAgBA,GAEhBY,EAACU,EAAAA,CACGC,mBAAoBT,EACpBrB,UAAWa,EAAW,wBAAyB,+BAAgC,wCAAyC,CACpH,+BAAgCX,EAChC,+BAAgCL,EAChC,+BAAgCM,MAGxCgB,EAACY,OAAAA,CACG/B,UAAWa,EAAW,+CAAgD,CAClE,uDAAwDX,GAASC,KAIrEgB,EAACa,MAAAA,CACGC,IAAKvB,EAAS,CAAEwB,YAAa,eAAxBxB,CAAyC,oBAC9CV,UAAU,uCACVmC,IAAKjB,EACLkB,QA3CQ,KACpBrC,EAAasB,OA+CrB"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"./CVC.js";import r from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as c}from"../../../../../core/Context/CoreProvider.js";import{ENCRYPTED_SECURITY_CODE as o}from"../../../../internal/SecuredFields/lib/constants.js";import a from"../../../../internal/FormFields/InputText.js";function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function d({brand:d,hasCVC:l,onFocusField:s,errors:u,valid:p,cvcPolicy:y,focusedElement:f,lastFour:m,expiryMonth:b,expiryYear:_,showContextualElement:C}){const{i18n:O}=c(),x=`${O.get("creditCard.storedCard.description.ariaLabel").replace("%@",m)}${b&&_?` ${O.get("creditCard.expiryDate.label")} ${b}/${_}`:""}`,j="amex"===d,g=j?O.get("creditCard.securityCode.contextualText.4digits"):O.get("creditCard.securityCode.contextualText.3digits");return e("div",{className:"adyen-checkout__card__form adyen-checkout__card__form--oneClick","aria-label":x},e("div",{className:"adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper"},b&&_&&e(r,{label:O.get("creditCard.expiryDate.label"),className:"adyen-checkout__field--50",classNameModifiers:["storedCard"],name:"expiryDateField",disabled:!0},e(a,{name:"expiryDateField",className:"adyen-checkout__input adyen-checkout__input--disabled adyen-checkout__card__exp-date__input--oneclick",value:`${b} / ${_}`,disabled:!0,dir:"ltr"})),l&&e(t,n(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},c=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(c=c.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),c.forEach(function(t){i(e,t,r[t])})}return e}({cvcPolicy:y,error:((e,t)=>e[t]?O.get(e[t]):null)(u,o),focused:"encryptedSecurityCode"===f,filled:!!p.encryptedSecurityCode||!!u.encryptedSecurityCode,isValid:!!p.encryptedSecurityCode,label:O.get("creditCard.securityCode.label"),onFocusField:s},b&&_&&{className:"adyen-checkout__field--50"}),{classNameModifiers:["storedCard"],frontCVC:j,showContextualElement:C,contextualText:g}))))}export{d as default};
1
+ import{createElement as e}from"../../../../../external/preact/dist/preact.js";import t from"./CVC.js";import r from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import{ENCRYPTED_SECURITY_CODE as a}from"../../../../internal/SecuredFields/lib/constants.js";import i from"../../../../internal/FormFields/InputText.js";import o from"../../../../internal/FormFields/Fieldset/Fieldset.js";function c({brand:c,hasCVC:l,onFocusField:s,errors:n,valid:u,cvcPolicy:m,focusedElement:p,lastFour:C,expiryMonth:y,expiryYear:_,showContextualElement:x}){const{i18n:F}=d(),f=`${F.get("creditCard.storedCard.description.ariaLabel").replace("%@",C)}${y&&_?` ${F.get("creditCard.expiryDate.label")} ${y}/${_}`:""}`,b="amex"===c,h=b?F.get("creditCard.securityCode.contextualText.4digits"):F.get("creditCard.securityCode.contextualText.3digits");return e("div",{className:"adyen-checkout__card__form adyen-checkout__card__form--oneClick","aria-label":f},e(o,{classNamesFields:["adyen-checkout__card__exp-cvc"]},y&&_&&e(r,{label:F.get("creditCard.expiryDate.label"),classNameModifiers:["col-50","storedCard"],name:"expiryDateField",disabled:!0},e(i,{name:"expiryDateField",className:"adyen-checkout__input adyen-checkout__input--disabled adyen-checkout__card__exp-date__input--oneclick",value:`${y} / ${_}`,disabled:!0,dir:"ltr"})),l&&e(t,{cvcPolicy:m,error:((e,t)=>e[t]?F.get(e[t]):null)(n,a),focused:"encryptedSecurityCode"===p,filled:!!u.encryptedSecurityCode||!!n.encryptedSecurityCode,isValid:!!u.encryptedSecurityCode,label:F.get("creditCard.securityCode.label"),onFocusField:s,classNameModifiers:[...y&&_?["col-50","storedCard"]:["storedCard"]],frontCVC:b,showContextualElement:x,contextualText:h})))}export{c as default};
2
2
  //# sourceMappingURL=StoredCardFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StoredCardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/StoredCardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CVC from './CVC';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { StoredCardFieldsProps } from './types';\nimport { ENCRYPTED_SECURITY_CODE } from '../../../../internal/SecuredFields/lib/constants';\nimport InputText from '../../../../internal/FormFields/InputText';\n\nexport default function StoredCardFields({\n brand,\n hasCVC,\n onFocusField,\n errors,\n valid,\n cvcPolicy,\n focusedElement,\n lastFour,\n expiryMonth,\n expiryYear,\n showContextualElement\n}: StoredCardFieldsProps) {\n const { i18n } = useCoreContext();\n const storedCardDescription = i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', lastFour);\n const storedCardDescriptionSuffix = expiryMonth && expiryYear ? ` ${i18n.get('creditCard.expiryDate.label')} ${expiryMonth}/${expiryYear}` : '';\n const ariaLabel = `${storedCardDescription}${storedCardDescriptionSuffix}`;\n const isAmex = brand === 'amex';\n const cvcContextualText = isAmex\n ? i18n.get('creditCard.securityCode.contextualText.4digits')\n : i18n.get('creditCard.securityCode.contextualText.3digits');\n\n const getError = (errors, fieldType) => {\n return errors[fieldType] ? i18n.get(errors[fieldType]) : null;\n };\n\n return (\n <div className=\"adyen-checkout__card__form adyen-checkout__card__form--oneClick\" aria-label={ariaLabel}>\n <div className=\"adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper\">\n {expiryMonth && expiryYear && (\n <Field\n label={i18n.get('creditCard.expiryDate.label')}\n className=\"adyen-checkout__field--50\"\n classNameModifiers={['storedCard']}\n name={'expiryDateField'}\n disabled\n >\n <InputText\n name={'expiryDateField'}\n className={'adyen-checkout__input adyen-checkout__input--disabled adyen-checkout__card__exp-date__input--oneclick'}\n value={`${expiryMonth} / ${expiryYear}`}\n disabled={true}\n dir={'ltr'}\n />\n </Field>\n )}\n\n {hasCVC && (\n <CVC\n cvcPolicy={cvcPolicy}\n error={getError(errors, ENCRYPTED_SECURITY_CODE)}\n focused={focusedElement === 'encryptedSecurityCode'}\n filled={!!valid.encryptedSecurityCode || !!errors.encryptedSecurityCode}\n isValid={!!valid.encryptedSecurityCode}\n label={i18n.get('creditCard.securityCode.label')}\n onFocusField={onFocusField}\n {...(expiryMonth && expiryYear && { className: 'adyen-checkout__field--50' })}\n classNameModifiers={['storedCard']}\n frontCVC={isAmex}\n showContextualElement={showContextualElement}\n contextualText={cvcContextualText}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["StoredCardFields","brand","hasCVC","onFocusField","errors","valid","cvcPolicy","focusedElement","lastFour","expiryMonth","expiryYear","showContextualElement","i18n","useCoreContext","ariaLabel","get","replace","isAmex","cvcContextualText","h","div","className","aria-label","Field","label","classNameModifiers","name","disabled","InputText","value","dir","CVC","error","fieldType","getError","ENCRYPTED_SECURITY_CODE","focused","filled","encryptedSecurityCode","isValid","frontCVC","contextualText"],"mappings":"g3BAQe,SAASA,GAAiBC,MACrCA,EAAKC,OACLA,EAAMC,aACNA,EAAYC,OACZA,EAAMC,MACNA,EAAKC,UACLA,EAASC,eACTA,EAAcC,SACdA,EAAQC,YACRA,EAAWC,WACXA,EAAUC,sBACVA,IAEA,MAAMC,KAAEA,GAASC,IAGXC,EAAY,GAFYF,EAAKG,IAAI,+CAA+CC,QAAQ,KAAMR,KAChEC,GAAeC,EAAa,IAAIE,EAAKG,IAAI,kCAAkCN,KAAeC,IAAe,KAEvIO,EAAmB,SAAVhB,EACTiB,EAAoBD,EACpBL,EAAKG,IAAI,kDACTH,EAAKG,IAAI,kDAMf,OACII,EAACC,MAAAA,CAAIC,UAAU,kEAAkEC,aAAYR,GACzFK,EAACC,MAAAA,CAAIC,UAAU,+DACVZ,GAAeC,GACZS,EAACI,EAAAA,CACGC,MAAOZ,EAAKG,IAAI,+BAChBM,UAAU,4BACVI,mBAAoB,CAAC,cACrBC,KAAM,kBACNC,UAAAA,GAEAR,EAACS,EAAAA,CACGF,KAAM,kBACNL,UAAW,wGACXQ,MAAO,GAAGpB,OAAiBC,IAC3BiB,UAAU,EACVG,IAAK,SAKhB5B,GACGiB,EAACY,EAAAA,oUAAAA,CAAAA,CACGzB,UAAWA,EACX0B,MA5BH,EAAC5B,EAAQ6B,IACf7B,EAAO6B,GAAarB,EAAKG,IAAIX,EAAO6B,IAAc,KA2BlCC,CAAS9B,EAAQ+B,GACxBC,QAA4B,0BAAnB7B,EACT8B,SAAUhC,EAAMiC,yBAA2BlC,EAAOkC,sBAClDC,UAAWlC,EAAMiC,sBACjBd,MAAOZ,EAAKG,IAAI,iCAChBZ,aAAcA,GACTM,GAAeC,GAAc,CAAEW,UAAW,8BAA4B,CAC3EI,mBAAoB,CAAC,cACrBe,SAAUvB,EACVN,sBAAuBA,EACvB8B,eAAgBvB,MAMxC"}
1
+ {"version":3,"file":"StoredCardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/StoredCardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CVC from './CVC';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { StoredCardFieldsProps } from './types';\nimport { ENCRYPTED_SECURITY_CODE } from '../../../../internal/SecuredFields/lib/constants';\nimport InputText from '../../../../internal/FormFields/InputText';\nimport Fieldset from '../../../../internal/FormFields/Fieldset';\n\nexport default function StoredCardFields({\n brand,\n hasCVC,\n onFocusField,\n errors,\n valid,\n cvcPolicy,\n focusedElement,\n lastFour,\n expiryMonth,\n expiryYear,\n showContextualElement\n}: StoredCardFieldsProps) {\n const { i18n } = useCoreContext();\n const storedCardDescription = i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', lastFour);\n const storedCardDescriptionSuffix = expiryMonth && expiryYear ? ` ${i18n.get('creditCard.expiryDate.label')} ${expiryMonth}/${expiryYear}` : '';\n const ariaLabel = `${storedCardDescription}${storedCardDescriptionSuffix}`;\n const isAmex = brand === 'amex';\n const cvcContextualText = isAmex\n ? i18n.get('creditCard.securityCode.contextualText.4digits')\n : i18n.get('creditCard.securityCode.contextualText.3digits');\n\n const getError = (errors, fieldType) => {\n return errors[fieldType] ? i18n.get(errors[fieldType]) : null;\n };\n\n return (\n <div className=\"adyen-checkout__card__form adyen-checkout__card__form--oneClick\" aria-label={ariaLabel}>\n <Fieldset classNamesFields={['adyen-checkout__card__exp-cvc']}>\n {expiryMonth && expiryYear && (\n <Field\n label={i18n.get('creditCard.expiryDate.label')}\n classNameModifiers={['col-50', 'storedCard']}\n name={'expiryDateField'}\n disabled\n >\n <InputText\n name={'expiryDateField'}\n className={'adyen-checkout__input adyen-checkout__input--disabled adyen-checkout__card__exp-date__input--oneclick'}\n value={`${expiryMonth} / ${expiryYear}`}\n disabled={true}\n dir={'ltr'}\n />\n </Field>\n )}\n\n {hasCVC && (\n <CVC\n cvcPolicy={cvcPolicy}\n error={getError(errors, ENCRYPTED_SECURITY_CODE)}\n focused={focusedElement === 'encryptedSecurityCode'}\n filled={!!valid.encryptedSecurityCode || !!errors.encryptedSecurityCode}\n isValid={!!valid.encryptedSecurityCode}\n label={i18n.get('creditCard.securityCode.label')}\n onFocusField={onFocusField}\n classNameModifiers={[...(expiryMonth && expiryYear ? ['col-50', 'storedCard'] : ['storedCard'])]}\n frontCVC={isAmex}\n showContextualElement={showContextualElement}\n contextualText={cvcContextualText}\n />\n )}\n </Fieldset>\n </div>\n );\n}\n"],"names":["StoredCardFields","brand","hasCVC","onFocusField","errors","valid","cvcPolicy","focusedElement","lastFour","expiryMonth","expiryYear","showContextualElement","i18n","useCoreContext","ariaLabel","get","replace","isAmex","cvcContextualText","h","div","className","aria-label","Fieldset","classNamesFields","Field","label","classNameModifiers","name","disabled","InputText","value","dir","CVC","error","fieldType","getError","ENCRYPTED_SECURITY_CODE","focused","filled","encryptedSecurityCode","isValid","frontCVC","contextualText"],"mappings":"+cASe,SAASA,GAAiBC,MACrCA,EAAKC,OACLA,EAAMC,aACNA,EAAYC,OACZA,EAAMC,MACNA,EAAKC,UACLA,EAASC,eACTA,EAAcC,SACdA,EAAQC,YACRA,EAAWC,WACXA,EAAUC,sBACVA,IAEA,MAAMC,KAAEA,GAASC,IAGXC,EAAY,GAFYF,EAAKG,IAAI,+CAA+CC,QAAQ,KAAMR,KAChEC,GAAeC,EAAa,IAAIE,EAAKG,IAAI,kCAAkCN,KAAeC,IAAe,KAEvIO,EAAmB,SAAVhB,EACTiB,EAAoBD,EACpBL,EAAKG,IAAI,kDACTH,EAAKG,IAAI,kDAMf,OACII,EAACC,MAAAA,CAAIC,UAAU,kEAAkEC,aAAYR,GACzFK,EAACI,EAAAA,CAASC,iBAAkB,CAAC,kCACxBf,GAAeC,GACZS,EAACM,EAAAA,CACGC,MAAOd,EAAKG,IAAI,+BAChBY,mBAAoB,CAAC,SAAU,cAC/BC,KAAM,kBACNC,UAAAA,GAEAV,EAACW,EAAAA,CACGF,KAAM,kBACNP,UAAW,wGACXU,MAAO,GAAGtB,OAAiBC,IAC3BmB,UAAU,EACVG,IAAK,SAKhB9B,GACGiB,EAACc,EAAAA,CACG3B,UAAWA,EACX4B,MA3BH,EAAC9B,EAAQ+B,IACf/B,EAAO+B,GAAavB,EAAKG,IAAIX,EAAO+B,IAAc,KA0BlCC,CAAShC,EAAQiC,GACxBC,QAA4B,0BAAnB/B,EACTgC,SAAUlC,EAAMmC,yBAA2BpC,EAAOoC,sBAClDC,UAAWpC,EAAMmC,sBACjBd,MAAOd,EAAKG,IAAI,iCAChBZ,aAAcA,EACdwB,mBAAoB,IAAKlB,GAAeC,EAAa,CAAC,SAAU,cAAgB,CAAC,eACjFgC,SAAUzB,EACVN,sBAAuBA,EACvBgC,eAAgBzB,KAMxC"}
@@ -1,2 +1,2 @@
1
- import{AddressModeOptions as e}from"./types.js";var o={type:"scheme",setComponentRef:()=>{},autoFocus:!0,billingAddressAllowedCountries:[],billingAddressMode:e.full,billingAddressRequired:!1,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},data:{billingAddress:{}},disableIOSArrowKeys:!1,enableStoreDetails:!1,exposeExpiryDate:!1,forceCompat:!1,hasHolderName:!1,holderNameRequired:!1,hasCVC:!0,hideCVC:!1,installmentOptions:{},keypadFix:!0,legacyInputMode:!1,maskSecurityCode:!1,minimumExpiryDate:null,name:null,placeholders:{},positionHolderNameOnTop:!1,showBrandIcon:!0,showInstallmentAmounts:null,styles:{},isPayButtonPrimaryVariant:!0,showContextualElement:!0,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{}};export{o as default};
1
+ import{AddressModeOptions as e}from"./types.js";var o={type:"scheme",setComponentRef:()=>{},autoFocus:!0,billingAddressAllowedCountries:[],billingAddressMode:e.full,billingAddressRequired:!1,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},data:{billingAddress:{}},disableIOSArrowKeys:!1,enableStoreDetails:!1,exposeExpiryDate:!1,forceCompat:!1,hasHolderName:!1,holderNameRequired:!1,hasCVC:!0,hideCVC:!1,installmentOptions:{},keypadFix:!0,legacyInputMode:!1,maskSecurityCode:!1,minimumExpiryDate:null,name:null,placeholders:{},positionHolderNameOnTop:!1,showBrandIcon:!0,showInstallmentAmounts:null,styles:{},trimTrailingSeparator:!0,isPayButtonPrimaryVariant:!0,showContextualElement:!0,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{}};export{o as default};
2
2
  //# sourceMappingURL=defaultProps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Card/components/CardInput/defaultProps.ts"],"sourcesContent":["import { SocialSecurityMode } from '../../types';\nimport { AddressModeOptions } from './types';\n\nexport default {\n type: 'scheme',\n\n setComponentRef: () => {},\n\n // Settings\n autoFocus: true,\n billingAddressAllowedCountries: [],\n billingAddressMode: AddressModeOptions.full,\n billingAddressRequired: false,\n billingAddressRequiredFields: ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'],\n\n configuration: { koreanAuthenticationRequired: false, socialSecurityNumberMode: 'auto' as SocialSecurityMode },\n data: {\n billingAddress: {}\n },\n disableIOSArrowKeys: false,\n enableStoreDetails: false,\n exposeExpiryDate: false,\n forceCompat: false,\n hasHolderName: false,\n holderNameRequired: false,\n hasCVC: true,\n hideCVC: false,\n installmentOptions: {},\n keypadFix: true,\n legacyInputMode: false,\n maskSecurityCode: false,\n minimumExpiryDate: null,\n name: null, // Affects Dropin only, the name displayed in the PMList item\n placeholders: {},\n positionHolderNameOnTop: false,\n showBrandIcon: true,\n showInstallmentAmounts: null,\n styles: {},\n\n isPayButtonPrimaryVariant: true,\n showContextualElement: true,\n\n // Events\n onLoad: (): any => {},\n onConfigSuccess: (): any => {},\n onAllValid: (): any => {},\n onFieldValid: (): any => {},\n onBrand: (): any => {},\n onError: (): any => {},\n onBinValue: (): any => {},\n onBlur: (): any => {},\n onFocus: (): any => {},\n onChange: (): any => {}\n};\n"],"names":["CardInputDefaultProps","type","setComponentRef","autoFocus","billingAddressAllowedCountries","billingAddressMode","AddressModeOptions","full","billingAddressRequired","billingAddressRequiredFields","configuration","koreanAuthenticationRequired","socialSecurityNumberMode","data","billingAddress","disableIOSArrowKeys","enableStoreDetails","exposeExpiryDate","forceCompat","hasHolderName","holderNameRequired","hasCVC","hideCVC","installmentOptions","keypadFix","legacyInputMode","maskSecurityCode","minimumExpiryDate","name","placeholders","positionHolderNameOnTop","showBrandIcon","showInstallmentAmounts","styles","isPayButtonPrimaryVariant","showContextualElement","onLoad","onConfigSuccess","onAllValid","onFieldValid","onBrand","onError","onBinValue","onBlur","onFocus","onChange"],"mappings":"gDAGA,IAAAA,EAAe,CACXC,KAAM,SAENC,gBAAiB,OAGjBC,WAAW,EACXC,+BAAgC,GAChCC,mBAAoBC,EAAmBC,KACvCC,wBAAwB,EACxBC,6BAA8B,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,WAEvGC,cAAe,CAAEC,8BAA8B,EAAOC,yBAA0B,QAChFC,KAAM,CACFC,eAAgB,CAAA,GAEpBC,qBAAqB,EACrBC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACpBC,QAAQ,EACRC,SAAS,EACTC,mBAAoB,CAAA,EACpBC,WAAW,EACXC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAmB,KACnBC,KAAM,KACNC,aAAc,CAAA,EACdC,yBAAyB,EACzBC,eAAe,EACfC,uBAAwB,KACxBC,OAAQ,CAAA,EAERC,2BAA2B,EAC3BC,uBAAuB,EAGvBC,OAAQ,OACRC,gBAAiB,OACjBC,WAAY,OACZC,aAAc,OACdC,QAAS,OACTC,QAAS,OACTC,WAAY,OACZC,OAAQ,OACRC,QAAS,OACTC,SAAU"}
1
+ {"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Card/components/CardInput/defaultProps.ts"],"sourcesContent":["import { SocialSecurityMode } from '../../types';\nimport { AddressModeOptions } from './types';\n\nexport default {\n type: 'scheme',\n\n setComponentRef: () => {},\n\n // Settings\n autoFocus: true,\n billingAddressAllowedCountries: [],\n billingAddressMode: AddressModeOptions.full,\n billingAddressRequired: false,\n billingAddressRequiredFields: ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'],\n\n configuration: { koreanAuthenticationRequired: false, socialSecurityNumberMode: 'auto' as SocialSecurityMode },\n data: {\n billingAddress: {}\n },\n disableIOSArrowKeys: false,\n enableStoreDetails: false,\n exposeExpiryDate: false,\n forceCompat: false,\n hasHolderName: false,\n holderNameRequired: false,\n hasCVC: true,\n hideCVC: false,\n installmentOptions: {},\n keypadFix: true,\n legacyInputMode: false,\n maskSecurityCode: false,\n minimumExpiryDate: null,\n name: null, // Affects Dropin only, the name displayed in the PMList item\n placeholders: {},\n positionHolderNameOnTop: false,\n showBrandIcon: true,\n showInstallmentAmounts: null,\n styles: {},\n trimTrailingSeparator: true,\n\n isPayButtonPrimaryVariant: true,\n showContextualElement: true,\n\n // Events\n onLoad: (): any => {},\n onConfigSuccess: (): any => {},\n onAllValid: (): any => {},\n onFieldValid: (): any => {},\n onBrand: (): any => {},\n onError: (): any => {},\n onBinValue: (): any => {},\n onBlur: (): any => {},\n onFocus: (): any => {},\n onChange: (): any => {}\n};\n"],"names":["CardInputDefaultProps","type","setComponentRef","autoFocus","billingAddressAllowedCountries","billingAddressMode","AddressModeOptions","full","billingAddressRequired","billingAddressRequiredFields","configuration","koreanAuthenticationRequired","socialSecurityNumberMode","data","billingAddress","disableIOSArrowKeys","enableStoreDetails","exposeExpiryDate","forceCompat","hasHolderName","holderNameRequired","hasCVC","hideCVC","installmentOptions","keypadFix","legacyInputMode","maskSecurityCode","minimumExpiryDate","name","placeholders","positionHolderNameOnTop","showBrandIcon","showInstallmentAmounts","styles","trimTrailingSeparator","isPayButtonPrimaryVariant","showContextualElement","onLoad","onConfigSuccess","onAllValid","onFieldValid","onBrand","onError","onBinValue","onBlur","onFocus","onChange"],"mappings":"gDAGA,IAAAA,EAAe,CACXC,KAAM,SAENC,gBAAiB,OAGjBC,WAAW,EACXC,+BAAgC,GAChCC,mBAAoBC,EAAmBC,KACvCC,wBAAwB,EACxBC,6BAA8B,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,WAEvGC,cAAe,CAAEC,8BAA8B,EAAOC,yBAA0B,QAChFC,KAAM,CACFC,eAAgB,CAAA,GAEpBC,qBAAqB,EACrBC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACpBC,QAAQ,EACRC,SAAS,EACTC,mBAAoB,CAAA,EACpBC,WAAW,EACXC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAmB,KACnBC,KAAM,KACNC,aAAc,CAAA,EACdC,yBAAyB,EACzBC,eAAe,EACfC,uBAAwB,KACxBC,OAAQ,CAAA,EACRC,uBAAuB,EAEvBC,2BAA2B,EAC3BC,uBAAuB,EAGvBC,OAAQ,OACRC,gBAAiB,OACjBC,WAAY,OACZC,aAAc,OACdC,QAAS,OACTC,QAAS,OACTC,WAAY,OACZC,OAAQ,OACRC,QAAS,OACTC,SAAU"}
@@ -1,2 +1,2 @@
1
- import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as l,CREDIT_CARD as s,KCP_CARD as a,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{DEFAULT_CARD_GROUP_TYPES as c,BRAND_READABLE_NAME_MAP as m}from"../../../internal/SecuredFields/lib/constants.js";import p from"../../../../core/Context/useImage.js";import{SF_ErrorCodes as g}from"../../../../core/Errors/constants.js";import{DEFAULT_CHALLENGE_WINDOW_SIZE as h}from"../../../ThreeDS2/constants.js";import y from"./defaultProps.js";import{isConfigurationValid as b}from"../Fastlane/utils/validate-configuration.js";import{notFalsy as O}from"../../../../utils/commonUtils.js";function f(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function C(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(o){f(e,o,n[o])})}return e}function S(e,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):function(e){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o}(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}),e}const v=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),A=e=>"revolving"===(null==e?void 0:e.plan)||(null==e?void 0:e.value)>1,R=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let g=s;const h=e.hasHolderName&&e.holderNameRequired;if(h&&(g=e.positionHolderNameOnTop?o:n),u&&(g=a,h&&(g=e.positionHolderNameOnTop?i:r)),c&&(g=d,h&&(g=e.positionHolderNameOnTop?t:l)),m){const i=m.flat(2).filter(e=>"number"!=typeof e);let r=i;p&&(r=i.filter(e=>p.includes(e))),g=s.concat(r),h&&(g=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return g},w=(e,o,n)=>{switch(e){case"socialSecurityNumber":return o.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return(null==n?void 0:n[e])?o.get(null==n?void 0:n[e]):o.get(e);default:return null}},F=e=>({amount:e.amount,billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),E=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyPress:e.handleKeyPress,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),x=o=>o==e.partial?u:null;function N(e){return![g.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,g.ERROR_MSG_CARD_TOO_OLD,g.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,g.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function P(e){var o;return null!==(o=m[e])&&void 0!==o?o:e}const D=e=>{var o,n,i,r,t,l,s,a;const{autoFocus:d,billingAddressAllowedCountries:u,billingAddressMode:m,billingAddressRequired:p,billingAddressRequiredFields:g,brands:f=c,brandsConfiguration:v,challengeWindowSize:A=h,configuration:R,countryCode:w,data:F,disclaimerMessage:E,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,fastlaneConfiguration:j,forceCompat:B,hasHolderName:k,hideCVC:T,holderNameRequired:M,installmentOptions:V,keypadFix:_,legacyInputMode:I,maskSecurityCode:q,minimumExpiryDate:H,name:L,placeholders:K,positionHolderNameOnTop:U,showBrandIcon:G,showInstallmentAmounts:W,showPayButton:z=!1,styles:J,onAllValid:Y,onBinLookup:X,onBinValue:$,onBlur:Q,onBrand:Z,onConfigSuccess:ee,onEnterKeyPressed:oe,onFieldValid:ne,onFocus:ie,onLoad:re}=e,te=JSON.stringify(y.data),le=null===(n=e.modules)||void 0===n||null===(o=n.srPanel)||void 0===o?void 0:o.enabled,se=null===(r=e.modules)||void 0===r||null===(i=r.srPanel)||void 0===i?void 0:i.moveFocus,ae=null===(l=e.modules)||void 0===l||null===(t=l.risk)||void 0===t?void 0:t.enabled,de=b(j),ue=e.onAddressLookup?"lookup":m;let ce="none";!0===(null==R?void 0:R.koreanAuthenticationRequired)&&(ce="kr"===(null==w?void 0:w.toLowerCase())?"atStart":"auto");return C(S(C({autoFocus:d},(null==u?void 0:u.length)>0&&{billingAddressAllowedCountries:u.toString().substring(0,128)}),{billingAddressMode:ue,billingAddressRequired:p,billingAddressRequiredFields:null==g||null===(s=g.toString())||void 0===s?void 0:s.substring(0,128),brands:null==f||null===(a=f.toString())||void 0===a?void 0:a.substring(0,128),challengeWindowSize:A,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,forceCompat:B,hasBrandsConfiguration:O(v),hasData:F&&JSON.stringify(e.data)!==te,hasDisclaimerMessage:!!E,hasHolderName:k,hasInstallmentOptions:O(V),hasPlaceholders:O(K),hasStylesConfigured:O(J),hideCVC:T,holderNameRequired:M,keypadFix:_,legacyInputMode:I,maskSecurityCode:q,minimumExpiryDate:!!H,name:L,positionHolderNameOnTop:U,riskEnabled:ae,showBrandIcon:G,showInstallmentAmounts:!!W,showKCPType:ce,showPayButton:z,socialSecurityNumberMode:null==R?void 0:R.socialSecurityNumberMode,srPanelEnabled:le,srPanelMoveFocus:se,hasOnAllValid:Y!==y.onAllValid,hasOnBinValue:$!==y.onBinValue,hasOnBlur:Q!==y.onBlur,hasOnBrand:Z!==y.onBrand,hasOnConfigSuccess:ee!==y.onConfigSuccess,hasOnFieldValid:ne!==y.onFieldValid,hasOnFocus:ie!==y.onFocus,hasOnLoad:re!==y.onLoad,hasOnBinLookup:!!X,hasOnEnterKeyPressed:!!oe}),de&&{hasFastlaneConfigured:!0,isFastlaneConsentDefaultOn:j.defaultToggleState})},j=(e,o)=>e.map(e=>{var n;const i=e.id,r=p(),t="card"===i?"nocard":i;var l;const s=null!==(l=null===(n=o[i])||void 0===n?void 0:n.icon)&&void 0!==l?l:v(t,r);return{id:e.id,name:e.brandObject.localeBrand||e.brandObject.brand,imageURL:s,altName:P(i)}}),B=(e,o,n)=>!!o.filter(o=>e.includes(o[n])).length;export{F as extractPropsForCardFields,E as extractPropsForSFP,D as getCardConfigData,v as getCardImageUrl,P as getFullBrandName,R as getLayout,x as handlePartialAddressMode,A as hasValidInstallmentsObject,N as lookupBlurBasedErrors,j as mapDualBrandButtons,w as mapFieldKey,B as mustHandleDualBrandingAccordingToEURegulations};
1
+ import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as l,CREDIT_CARD as a,KCP_CARD as s,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{DEFAULT_CARD_GROUP_TYPES as c,BRAND_READABLE_NAME_MAP as m}from"../../../internal/SecuredFields/lib/constants.js";import p from"../../../../core/Context/useImage.js";import{SF_ErrorCodes as g}from"../../../../core/Errors/constants.js";import{DEFAULT_CHALLENGE_WINDOW_SIZE as h}from"../../../ThreeDS2/constants.js";import y from"./defaultProps.js";import{isConfigurationValid as b}from"../Fastlane/utils/validate-configuration.js";import{notFalsy as O}from"../../../../utils/commonUtils.js";function f(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function C(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(o){f(e,o,n[o])})}return e}function S(e,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):function(e){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);o.push.apply(o,n)}return o}(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}),e}const v=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),A=e=>"revolving"===(null==e?void 0:e.plan)||(null==e?void 0:e.value)>1,R=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let g=a;const h=e.hasHolderName&&e.holderNameRequired;if(h&&(g=e.positionHolderNameOnTop?o:n),u&&(g=s,h&&(g=e.positionHolderNameOnTop?i:r)),c&&(g=d,h&&(g=e.positionHolderNameOnTop?t:l)),m){const i=m.flat(2).filter(e=>"number"!=typeof e);let r=i;p&&(r=i.filter(e=>p.includes(e))),g=a.concat(r),h&&(g=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return g},w=(e,o,n)=>{switch(e){case"socialSecurityNumber":return o.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return(null==n?void 0:n[e])?o.get(null==n?void 0:n[e]):o.get(e);default:return null}},F=e=>({amount:e.amount,billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),E=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyPress:e.handleKeyPress,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),x=o=>o==e.partial?u:null;function N(e){return![g.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,g.ERROR_MSG_CARD_TOO_OLD,g.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,g.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function P(e){var o;return null!==(o=m[e])&&void 0!==o?o:e}const D=e=>{var o,n,i,r,t,l,a,s;const{autoFocus:d,billingAddressAllowedCountries:u,billingAddressMode:m,billingAddressRequired:p,billingAddressRequiredFields:g,brands:f=c,brandsConfiguration:v,challengeWindowSize:A=h,configuration:R,countryCode:w,data:F,disclaimerMessage:E,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,fastlaneConfiguration:j,forceCompat:B,hasHolderName:T,hideCVC:k,holderNameRequired:M,installmentOptions:V,keypadFix:_,legacyInputMode:I,maskSecurityCode:q,minimumExpiryDate:H,name:L,placeholders:K,positionHolderNameOnTop:U,showBrandIcon:G,showInstallmentAmounts:W,showPayButton:z=!1,styles:J,trimTrailingSeparator:Y,onAllValid:X,onBinLookup:$,onBinValue:Q,onBlur:Z,onBrand:ee,onConfigSuccess:oe,onEnterKeyPressed:ne,onFieldValid:ie,onFocus:re,onLoad:te}=e,le=JSON.stringify(y.data),ae=null===(n=e.modules)||void 0===n||null===(o=n.srPanel)||void 0===o?void 0:o.enabled,se=null===(r=e.modules)||void 0===r||null===(i=r.srPanel)||void 0===i?void 0:i.moveFocus,de=null===(l=e.modules)||void 0===l||null===(t=l.risk)||void 0===t?void 0:t.enabled,ue=b(j),ce=e.onAddressLookup?"lookup":m;let me="none";!0===(null==R?void 0:R.koreanAuthenticationRequired)&&(me="kr"===(null==w?void 0:w.toLowerCase())?"atStart":"auto");return C(S(C({autoFocus:d},(null==u?void 0:u.length)>0&&{billingAddressAllowedCountries:u.toString().substring(0,128)}),{billingAddressMode:ce,billingAddressRequired:p,billingAddressRequiredFields:null==g||null===(a=g.toString())||void 0===a?void 0:a.substring(0,128),brands:null==f||null===(s=f.toString())||void 0===s?void 0:s.substring(0,128),challengeWindowSize:A,disableIOSArrowKeys:x,doBinLookup:N,enableStoreDetails:P,exposeExpiryDate:D,forceCompat:B,hasBrandsConfiguration:O(v),hasData:F&&JSON.stringify(e.data)!==le,hasDisclaimerMessage:!!E,hasHolderName:T,hasInstallmentOptions:O(V),hasPlaceholders:O(K),hasStylesConfigured:O(J),hideCVC:k,holderNameRequired:M,keypadFix:_,legacyInputMode:I,maskSecurityCode:q,minimumExpiryDate:!!H,name:L,positionHolderNameOnTop:U,riskEnabled:de,showBrandIcon:G,showInstallmentAmounts:!!W,showKCPType:me,showPayButton:z,socialSecurityNumberMode:null==R?void 0:R.socialSecurityNumberMode,srPanelEnabled:ae,srPanelMoveFocus:se,trimTrailingSeparator:Y,hasOnAllValid:X!==y.onAllValid,hasOnBinValue:Q!==y.onBinValue,hasOnBlur:Z!==y.onBlur,hasOnBrand:ee!==y.onBrand,hasOnConfigSuccess:oe!==y.onConfigSuccess,hasOnFieldValid:ie!==y.onFieldValid,hasOnFocus:re!==y.onFocus,hasOnLoad:te!==y.onLoad,hasOnBinLookup:!!$,hasOnEnterKeyPressed:!!ne}),ue&&{hasFastlaneConfigured:!0,isFastlaneConsentDefaultOn:j.defaultToggleState})},j=(e,o)=>e.map(e=>{var n;const i=e.id,r=p(),t="card"===i?"nocard":i;var l;const a=null!==(l=null===(n=o[i])||void 0===n?void 0:n.icon)&&void 0!==l?l:v(t,r);return{id:e.id,name:e.brandObject.localeBrand||e.brandObject.brand,imageURL:a,altName:P(i)}}),B=(e,o,n)=>o.some(o=>e.includes(o[n]));export{F as extractPropsForCardFields,E as extractPropsForSFP,D as getCardConfigData,v as getCardImageUrl,P as getFullBrandName,R as getLayout,x as handlePartialAddressMode,A as hasValidInstallmentsObject,N as lookupBlurBasedErrors,j as mapDualBrandButtons,w as mapFieldKey,B as mustHandleDualBrandingAccordingToEURegulations};
2
2
  //# sourceMappingURL=utils.js.map