@adyen/adyen-web 6.5.0 → 6.6.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 (248) hide show
  1. package/dist/cjs/adyen.css +2 -2
  2. package/dist/cjs/adyen.css.map +1 -1
  3. package/dist/cjs/index.cjs +2 -2
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +68 -30
  6. package/dist/es/adyen.css +2 -2
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/ANCV/ANCV.js.map +1 -1
  9. package/dist/es/components/Ach/components/AchInput/defaultProps.js +1 -1
  10. package/dist/es/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  11. package/dist/es/components/ApplePay/components/ApplePayButton.js.map +1 -1
  12. package/dist/es/components/BacsDD/BacsDD.js.map +1 -1
  13. package/dist/es/components/Boleto/Boleto.js.map +1 -1
  14. package/dist/es/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js +1 -1
  15. package/dist/es/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js.map +1 -1
  16. package/dist/es/components/Card/Card.js.map +1 -1
  17. package/dist/es/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  18. package/dist/es/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  19. package/dist/es/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  20. package/dist/es/components/Card/components/CardInput/types.js +1 -1
  21. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  22. package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
  23. package/dist/es/components/CashAppPay/services/types.js +1 -1
  24. package/dist/es/components/CashAppPay/services/types.js.map +1 -1
  25. package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
  26. package/dist/es/components/Donation/components/CampaignContent.js +1 -1
  27. package/dist/es/components/Donation/components/CampaignContent.js.map +1 -1
  28. package/dist/es/components/Donation/components/CampaignInfo.js +2 -0
  29. package/dist/es/components/Donation/components/CampaignInfo.js.map +1 -0
  30. package/dist/es/components/Donation/components/DonationComponent.js +1 -1
  31. package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
  32. package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
  33. package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
  34. package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  35. package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
  36. package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  37. package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
  38. package/dist/es/components/Klarna/KlarnaPayments.js +1 -1
  39. package/dist/es/components/Klarna/KlarnaPayments.js.map +1 -1
  40. package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  41. package/dist/es/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  42. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  43. package/dist/es/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  44. package/dist/es/components/Multibanco/Multibanco.js.map +1 -1
  45. package/dist/es/components/OnlineBankingCZ/index.js +1 -1
  46. package/dist/es/components/OnlineBankingCZ/index.js.map +1 -1
  47. package/dist/es/components/OnlineBankingSK/index.js +1 -1
  48. package/dist/es/components/OnlineBankingSK/index.js.map +1 -1
  49. package/dist/es/components/Oxxo/Oxxo.js.map +1 -1
  50. package/dist/es/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js +1 -1
  51. package/dist/es/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
  52. package/dist/es/components/PayPal/Paypal.js.map +1 -1
  53. package/dist/es/components/Redirect/Redirect.js +1 -1
  54. package/dist/es/components/Redirect/Redirect.js.map +1 -1
  55. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  56. package/dist/es/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  57. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  58. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  59. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  60. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  61. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  62. package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  63. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  64. package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  65. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  66. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  67. package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  68. package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  69. package/dist/es/components/Twint/Twint.js.map +1 -1
  70. package/dist/es/components/UPI/UPI.js.map +1 -1
  71. package/dist/es/components/internal/Address/components/CountryField.js +1 -1
  72. package/dist/es/components/internal/Address/components/CountryField.js.map +1 -1
  73. package/dist/es/components/internal/Address/components/FieldContainer.js +1 -1
  74. package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
  75. package/dist/es/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  76. package/dist/es/components/internal/Address/components/StateField.js +1 -1
  77. package/dist/es/components/internal/Address/components/StateField.js.map +1 -1
  78. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  79. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  80. package/dist/es/components/internal/Button/Button.js.map +1 -1
  81. package/dist/es/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  82. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  83. package/dist/es/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  84. package/dist/es/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  85. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  86. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  87. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  88. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  89. package/dist/es/components/internal/IFrame/Iframe.js.map +1 -1
  90. package/dist/es/components/internal/IssuerList/IssuerList.js +1 -1
  91. package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
  92. package/dist/es/components/internal/PersonalDetails/ReadOnlyPersonalDetails.js.map +1 -1
  93. package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
  94. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  95. package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  96. package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  97. package/dist/es/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  98. package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
  99. package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
  100. package/dist/es/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  101. package/dist/es/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  102. package/dist/es/components/internal/UIElement/UIElement.js +1 -1
  103. package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
  104. package/dist/es/components/tx-variants.js +1 -1
  105. package/dist/es/components/tx-variants.js.map +1 -1
  106. package/dist/es/core/Analytics/Analytics.js +1 -1
  107. package/dist/es/core/Analytics/Analytics.js.map +1 -1
  108. package/dist/es/core/Analytics/EventsQueue.js.map +1 -1
  109. package/dist/es/core/Analytics/analyticsPreProcessor.js +1 -1
  110. package/dist/es/core/Analytics/analyticsPreProcessor.js.map +1 -1
  111. package/dist/es/core/Analytics/constants.js +1 -1
  112. package/dist/es/core/Analytics/constants.js.map +1 -1
  113. package/dist/es/core/CheckoutSession/CheckoutSession.js.map +1 -1
  114. package/dist/es/core/Errors/AdyenCheckoutError.js.map +1 -1
  115. package/dist/es/core/Errors/SRPanel.js.map +1 -1
  116. package/dist/es/core/Errors/constants.js +1 -1
  117. package/dist/es/core/Errors/constants.js.map +1 -1
  118. package/dist/es/core/Errors/utils.js +1 -1
  119. package/dist/es/core/RiskModule/RiskModule.js.map +1 -1
  120. package/dist/es/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  121. package/dist/es/core/Services/analytics/collect-id.js +1 -1
  122. package/dist/es/core/core.js +1 -1
  123. package/dist/es/index.d.ts +68 -30
  124. package/dist/es-legacy/adyen.css +2 -2
  125. package/dist/es-legacy/adyen.css.map +1 -1
  126. package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
  127. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js +1 -1
  128. package/dist/es-legacy/components/Ach/components/AchInput/defaultProps.js.map +1 -1
  129. package/dist/es-legacy/components/ApplePay/components/ApplePayButton.js.map +1 -1
  130. package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
  131. package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
  132. package/dist/es-legacy/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js +1 -1
  133. package/dist/es-legacy/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.js.map +1 -1
  134. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  135. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  136. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  137. package/dist/es-legacy/components/Card/components/CardInput/components/CVCHint.js.map +1 -1
  138. package/dist/es-legacy/components/Card/components/CardInput/types.js +1 -1
  139. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  140. package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
  141. package/dist/es-legacy/components/CashAppPay/services/types.js +1 -1
  142. package/dist/es-legacy/components/CashAppPay/services/types.js.map +1 -1
  143. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  144. package/dist/es-legacy/components/Donation/components/CampaignContent.js +1 -1
  145. package/dist/es-legacy/components/Donation/components/CampaignContent.js.map +1 -1
  146. package/dist/es-legacy/components/Donation/components/CampaignInfo.js +2 -0
  147. package/dist/es-legacy/components/Donation/components/CampaignInfo.js.map +1 -0
  148. package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
  149. package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
  150. package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
  151. package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
  152. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  153. package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
  154. package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
  155. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  156. package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
  157. package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
  158. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  159. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  160. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  161. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  162. package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
  163. package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
  164. package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
  165. package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
  166. package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
  167. package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
  168. package/dist/es-legacy/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js +1 -1
  169. package/dist/es-legacy/components/Oxxo/components/OxxoVoucherResult/OxxoVoucherResult.js.map +1 -1
  170. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  171. package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
  172. package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
  173. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js +1 -1
  174. package/dist/es-legacy/components/Redirect/components/RedirectShopper/RedirectShopper.js.map +1 -1
  175. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
  176. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  177. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
  178. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  179. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  180. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  181. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
  182. package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
  183. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
  184. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
  185. package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
  186. package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
  187. package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
  188. package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
  189. package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
  190. package/dist/es-legacy/components/internal/Address/components/CountryField.js.map +1 -1
  191. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js +1 -1
  192. package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
  193. package/dist/es-legacy/components/internal/Address/components/ReadOnlyAddress.js.map +1 -1
  194. package/dist/es-legacy/components/internal/Address/components/StateField.js +1 -1
  195. package/dist/es-legacy/components/internal/Address/components/StateField.js.map +1 -1
  196. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  197. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  198. package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
  199. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
  200. package/dist/es-legacy/components/internal/ClickToPay/errors/TimeoutError.js.map +1 -1
  201. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
  202. package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
  203. package/dist/es-legacy/components/internal/ClickToPay/services/sdks/SrciError.js.map +1 -1
  204. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  205. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  206. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  207. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  208. package/dist/es-legacy/components/internal/IFrame/Iframe.js.map +1 -1
  209. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js +1 -1
  210. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
  211. package/dist/es-legacy/components/internal/PersonalDetails/ReadOnlyPersonalDetails.js.map +1 -1
  212. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
  213. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  214. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  215. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  216. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/utils/cardType.js.map +1 -1
  217. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
  218. package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
  219. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
  220. package/dist/es-legacy/components/internal/SecuredFields/lib/utilities/logger.js.map +1 -1
  221. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  222. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  223. package/dist/es-legacy/components/tx-variants.js +1 -1
  224. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  225. package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
  226. package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
  227. package/dist/es-legacy/core/Analytics/EventsQueue.js.map +1 -1
  228. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +1 -1
  229. package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +1 -1
  230. package/dist/es-legacy/core/Analytics/constants.js +1 -1
  231. package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
  232. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  233. package/dist/es-legacy/core/CheckoutSession/CheckoutSession.js.map +1 -1
  234. package/dist/es-legacy/core/Errors/AdyenCheckoutError.js.map +1 -1
  235. package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
  236. package/dist/es-legacy/core/Errors/constants.js +1 -1
  237. package/dist/es-legacy/core/Errors/constants.js.map +1 -1
  238. package/dist/es-legacy/core/Errors/utils.js +1 -1
  239. package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
  240. package/dist/es-legacy/core/RiskModule/components/DeviceFingerprint/GetDeviceFingerprint.js.map +1 -1
  241. package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
  242. package/dist/es-legacy/core/core.js +1 -1
  243. package/package.json +15 -12
  244. package/styles/adyen.css +2 -2
  245. package/dist/es/components/Donation/components/CampaignContainer.js +0 -2
  246. package/dist/es/components/Donation/components/CampaignContainer.js.map +0 -1
  247. package/dist/es-legacy/components/Donation/components/CampaignContainer.js +0 -2
  248. package/dist/es-legacy/components/Donation/components/CampaignContainer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ANCV.js","sources":["../../../../src/components/ANCV/ANCV.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ANCVInput from './components/ANCVInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport config from './components/ANCVAwait/config';\nimport Await from '../../components/internal/Await';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport PayButton from '../internal/PayButton';\nimport { ANCVConfiguration } from './types';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nexport class ANCVElement extends UIElement<ANCVConfiguration> {\n public static type = 'ancv';\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n paymentMethod: {\n type: ANCVElement.type,\n beneficiaryId: this.state.data?.beneficiaryId\n }\n };\n }\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n this.props.onOrderRequest(resolve, reject, data);\n });\n\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n /**\n * Check if order exists, if it does Resolve.\n * Otherwise createOrder and then Resolve.\n */\n public createOrder = (): Promise<void> => {\n this.setStatus('loading');\n\n // allow for multiple ANCV payments, follow giftcard logic and just use order if it exists\n if (this.props.order) {\n return Promise.resolve();\n }\n\n return this.onOrderRequest(this.data)\n .then((order: { orderData: string; pspReference: string }) => {\n const stateOrder = { order: { orderData: order.orderData, pspReference: order.pspReference } };\n this.setState(stateOrder);\n return Promise.resolve();\n })\n .catch(error => {\n this.setStatus(error?.message || 'error');\n if (this.props.onError) this.handleError(new AdyenCheckoutError('ERROR', error));\n });\n };\n\n public submit() {\n if (!this.isValid) {\n this.showValidation();\n return false;\n }\n\n this.createOrder()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n // Reimplement payButton similar to GiftCard to allow to set onClick\n public payButton = props => {\n return <PayButton {...props} />;\n };\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n get displayName(): string {\n return this.props.name;\n }\n\n render() {\n if (this.props.paymentData) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onError={this.props.onError}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n type={this.constructor['type']}\n messageText={this.props.i18n.get('ancv.confirmPayment')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n showCountdownTimer={config.showCountdownTimer}\n throttleTime={config.THROTTLE_TIME}\n throttleInterval={config.THROTTLE_INTERVAL}\n onActionHandled={this.onActionHandled}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <ANCVInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onSubmit={this.submit}\n onChange={this.setState}\n payButton={this.payButton}\n showPayButton={this.props.showPayButton}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ANCVElement;\n"],"names":["ANCVElement","UIElement","formatData","paymentMethod","type","beneficiaryId","this","state","data","submit","isValid","showValidation","createOrder","then","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","catch","handleFailedResult","displayName","props","name","render","paymentData","h","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","Await","ref","componentRef","clientKey","onError","onComplete","brandLogo","icon","constructor","messageText","get","awaitText","showCountdownTimer","config","throttleTime","THROTTLE_TIME","throttleInterval","THROTTLE_INTERVAL","onActionHandled","ANCVInput","onSubmit","onChange","setState","payButton","showPayButton","_define_property","onOrderRequest","Promise","resolve","reject","session","setStatus","order","stateOrder","orderData","pspReference","error","message","handleError","AdyenCheckoutError","PayButton"],"mappings":"6rBAYO,MAAMA,UAAoBC,EAM7BC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMJ,EAAYI,KAClBC,cAAeC,KAAKC,MAAMC,MAAMH,eAG5C,CAqCOI,MAAAA,GACH,IAAKH,KAAKI,QAEN,OADAJ,KAAKK,kBACE,EAGXL,KAAKM,cACAC,KAAKP,KAAKQ,kBACVD,KAAKE,GACLF,KAAKG,GACLH,KAAKP,KAAKW,gBACVC,MAAMZ,KAAKa,mBACpB,CAOA,WAAIT,GACA,QAASJ,KAAKC,MAAMG,OACxB,CAEA,eAAIU,GACA,OAAOd,KAAKe,MAAMC,IACtB,CAEAC,MAAAA,GACI,OAAIjB,KAAKe,MAAMG,YAEPC,EAACC,EAAAA,CAAaC,KAAMrB,KAAKe,MAAMM,KAAMC,eAAgBtB,KAAKe,MAAMO,eAAgBC,UAAWvB,KAAKuB,WAC5FJ,EAACK,EAAAA,CAAgBC,QAASzB,KAAKe,MAAMW,QAAQD,SACzCN,EAACQ,EAAAA,CACGC,IAAKA,IACD5B,KAAK6B,aAAeD,CAAAA,EAExBE,UAAW9B,KAAKe,MAAMe,UACtBZ,YAAalB,KAAKe,MAAMG,YACxBa,QAAS/B,KAAKe,MAAMgB,QACpBC,WAAYhC,KAAKgC,WACjBC,UAAWjC,KAAKkC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ources":["../../../../src/components/ANCV/ANCV.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport ANCVInput from './components/ANCVInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport config from './components/ANCVAwait/config';\nimport Await from '../../components/internal/Await';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';\nimport PayButton from '../internal/PayButton';\nimport { ANCVConfiguration } from './types';\nimport { sanitizeResponse, verifyPaymentDidNotFail } from '../internal/UIElement/utils';\n\nexport class ANCVElement extends UIElement<ANCVConfiguration> {\n public static type = 'ancv';\n\n /**\n * Formats the component data output\n */\n formatData() {\n return {\n paymentMethod: {\n type: ANCVElement.type,\n beneficiaryId: this.state.data?.beneficiaryId\n }\n };\n }\n\n private onOrderRequest = data => {\n if (this.props.onOrderRequest)\n return new Promise((resolve, reject) => {\n this.props.onOrderRequest(resolve, reject, data);\n });\n\n if (this.props.session) {\n return this.props.session.createOrder();\n }\n };\n\n /**\n * Check if order exists, if it does Resolve.\n * Otherwise createOrder and then Resolve.\n */\n public createOrder = (): Promise<void> => {\n this.setStatus('loading');\n\n // allow for multiple ANCV payments, follow giftcard logic and just use order if it exists\n if (this.props.order) {\n return Promise.resolve();\n }\n\n return this.onOrderRequest(this.data)\n .then((order: { orderData: string; pspReference: string }) => {\n const stateOrder = { order: { orderData: order.orderData, pspReference: order.pspReference } };\n this.setState(stateOrder);\n return Promise.resolve();\n })\n .catch(error => {\n this.setStatus(error?.message || 'error');\n if (this.props.onError) this.handleError(new AdyenCheckoutError('ERROR', error));\n });\n };\n\n public submit() {\n if (!this.isValid) {\n this.showValidation();\n return false;\n }\n\n this.createOrder()\n .then(this.makePaymentsCall)\n .then(sanitizeResponse)\n .then(verifyPaymentDidNotFail)\n .then(this.handleResponse)\n .catch(this.handleFailedResult);\n }\n\n // Reimplement payButton similar to GiftCard to allow to set onClick\n public payButton = props => {\n return <PayButton {...props} />;\n };\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n get displayName(): string {\n return this.props.name;\n }\n\n render() {\n if (this.props.paymentData) {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <Await\n ref={ref => {\n this.componentRef = ref;\n }}\n clientKey={this.props.clientKey}\n paymentData={this.props.paymentData}\n onError={this.props.onError}\n onComplete={this.onComplete}\n brandLogo={this.icon}\n type={this.constructor['type']}\n messageText={this.props.i18n.get('ancv.confirmPayment')}\n awaitText={this.props.i18n.get('await.waitForConfirmation')}\n showCountdownTimer={config.showCountdownTimer}\n throttleTime={config.THROTTLE_TIME}\n throttleInterval={config.THROTTLE_INTERVAL}\n onActionHandled={this.onActionHandled}\n />\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <ANCVInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onSubmit={this.submit}\n onChange={this.setState}\n payButton={this.payButton}\n showPayButton={this.props.showPayButton}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default ANCVElement;\n"],"names":["ANCVElement","UIElement","formatData","paymentMethod","type","beneficiaryId","this","state","data","submit","isValid","showValidation","createOrder","then","makePaymentsCall","sanitizeResponse","verifyPaymentDidNotFail","handleResponse","catch","handleFailedResult","displayName","props","name","render","paymentData","h","CoreProvider","i18n","loadingContext","resources","SRPanelProvider","srPanel","modules","Await","ref","componentRef","clientKey","onError","onComplete","brandLogo","icon","constructor","messageText","get","awaitText","showCountdownTimer","config","throttleTime","THROTTLE_TIME","throttleInterval","THROTTLE_INTERVAL","onActionHandled","ANCVInput","onSubmit","onChange","setState","payButton","showPayButton","super","args","_define_property","onOrderRequest","Promise","resolve","reject","session","setStatus","order","stateOrder","orderData","pspReference","error","message","handleError","AdyenCheckoutError","PayButton"],"mappings":"6r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,SAAU/C,KAAKG,OACf6C,SAAUhD,KAAKiD,SACfC,UAAWlD,KAAKkD,UAChBC,cAAenD,KAAKe,MAAMoC,gBAI1C,mBAvGAC,SAAAC,GAAAC,EAAAtD,KAAQuD,kBAAiBrD,GACjBF,KAAKe,MAAMwC,eACJ,IAAIC,SAAQ,CAACC,EAASC,KACzB1D,KAAKe,MAAMwC,eAAeE,EAASC,EAAQxD,EAAAA,IAG/CF,KAAKe,MAAM4C,QACJ3D,KAAKe,MAAM4C,QAAQrD,mBAD9B,IASJgD,OAAOhD,eAAc,KACjBN,KAAK4D,UAAU,WAGX5D,KAAKe,MAAM8C,MACJL,QAAQC,UAGZzD,KAAKuD,eAAevD,KAAKE,MAC3BK,MAAMsD,IACH,MAAMC,EAAa,CAAED,MAAO,CAAEE,UAAWF,EAAME,UAAWC,aAAcH,EAAMG,eAE9E,OADAhE,KAAKiD,SAASa,GACPN,QAAQC,SAAO,IAEzB7C,OAAMqD,IACHjE,KAAK4D,UAAUK,GAAOC,SAAW,SAC7BlE,KAAKe,MAAMgB,SAAS/B,KAAKmE,YAAY,IAAIC,EAAmB,QAASH,GAAAA,OAmBrFX,EAAAtD,KAAOkD,aAAYnC,GACRI,EAACkD,EAActD,MAjE1BuC,EADS5D,EACKI,OAAO"}
@@ -1,2 +1,2 @@
1
- var e={type:"ach",hasHolderName:!0,holderNameRequired:!0,billingAddressRequired:!0,billingAddressAllowedCountries:["US","PR"],showContextualElement:!0,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onError:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{},holderName:"",data:{holderName:"",billingAddress:{}},styles:{},placeholders:{}};export{e as default};
1
+ var e={type:"ach",hasHolderName:!0,holderNameRequired:!0,billingAddressRequired:!0,billingAddressAllowedCountries:["US","PR"],showContextualElement:!1,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onError:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{},holderName:"",data:{holderName:"",billingAddress:{}},styles:{},placeholders:{}};export{e as default};
2
2
  //# sourceMappingURL=defaultProps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Ach/components/AchInput/defaultProps.ts"],"sourcesContent":["export default {\n type: 'ach',\n\n // Settings\n hasHolderName: true,\n holderNameRequired: true,\n billingAddressRequired: true,\n billingAddressAllowedCountries: ['US', 'PR'],\n showContextualElement: true,\n\n // Events\n onLoad: () => {},\n onConfigSuccess: () => {},\n onAllValid: () => {},\n onFieldValid: () => {},\n onError: () => {},\n onBlur: () => {},\n onFocus: () => {},\n onChange: () => {},\n\n // Values\n holderName: '',\n data: {\n holderName: '',\n billingAddress: {}\n },\n\n // Customization\n styles: {},\n placeholders: {}\n};\n"],"names":["defaultProps","type","hasHolderName","holderNameRequired","billingAddressRequired","billingAddressAllowedCountries","showContextualElement","onLoad","onConfigSuccess","onAllValid","onFieldValid","onError","onBlur","onFocus","onChange","holderName","data","billingAddress","styles","placeholders"],"mappings":"AAAA,IAAeA,EAAA,CACXC,KAAM,MAGNC,eAAe,EACfC,oBAAoB,EACpBC,wBAAwB,EACxBC,+BAAgC,CAAC,KAAM,MACvCC,uBAAuB,EAGvBC,OAAQ,OACRC,gBAAiB,OACjBC,WAAY,OACZC,aAAc,OACdC,QAAS,OACTC,OAAQ,OACRC,QAAS,OACTC,SAAU,OAGVC,WAAY,GACZC,KAAM,CACFD,WAAY,GACZE,eAAgB,CAAC,GAIrBC,OAAQ,CAAC,EACTC,aAAc,CAAC"}
1
+ {"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Ach/components/AchInput/defaultProps.ts"],"sourcesContent":["export default {\n type: 'ach',\n\n // Settings\n hasHolderName: true,\n holderNameRequired: true,\n billingAddressRequired: true,\n billingAddressAllowedCountries: ['US', 'PR'],\n showContextualElement: false,\n\n // Events\n onLoad: () => {},\n onConfigSuccess: () => {},\n onAllValid: () => {},\n onFieldValid: () => {},\n onError: () => {},\n onBlur: () => {},\n onFocus: () => {},\n onChange: () => {},\n\n // Values\n holderName: '',\n data: {\n holderName: '',\n billingAddress: {}\n },\n\n // Customization\n styles: {},\n placeholders: {}\n};\n"],"names":["defaultProps","type","hasHolderName","holderNameRequired","billingAddressRequired","billingAddressAllowedCountries","showContextualElement","onLoad","onConfigSuccess","onAllValid","onFieldValid","onError","onBlur","onFocus","onChange","holderName","data","billingAddress","styles","placeholders"],"mappings":"AAAA,IAAeA,EAAA,CACXC,KAAM,MAGNC,eAAe,EACfC,oBAAoB,EACpBC,wBAAwB,EACxBC,+BAAgC,CAAC,KAAM,MACvCC,uBAAuB,EAGvBC,OAAQ,OACRC,gBAAiB,OACjBC,WAAY,OACZC,aAAc,OACdC,QAAS,OACTC,OAAQ,OACRC,QAAS,OACTC,SAAU,OAGVC,WAAY,GACZC,KAAM,CACFD,WAAY,GACZE,eAAgB,CAAC,GAIrBC,OAAQ,CAAC,EACTC,aAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApplePayButton.js","sources":["../../../../../src/components/ApplePay/components/ApplePayButton.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport cx from 'classnames';\nimport './ApplePayButton.scss';\nimport Language from '../../../language/Language';\nimport { ApplePayButtonType } from '../types';\n\ninterface ApplePayButtonProps {\n i18n: Language;\n buttonColor: 'black' | 'white' | 'white-with-line';\n buttonType: ApplePayButtonType;\n onClick: (event) => void;\n}\n\nclass ApplePayButton extends Component<ApplePayButtonProps> {\n public static defaultProps = {\n onClick: () => {},\n buttonColor: 'black',\n buttonType: 'plain'\n };\n\n render({ buttonColor, buttonType }) {\n return (\n <button\n type=\"button\"\n aria-label={this.props.i18n.get('payButton')}\n lang={this.props.i18n.languageCode}\n className={cx(\n 'adyen-checkout__applepay__button',\n `adyen-checkout__applepay__button--${buttonColor}`,\n `adyen-checkout__applepay__button--${buttonType}`,\n 'apple-pay',\n 'apple-pay-button',\n `apple-pay-button-${buttonColor}`,\n `apple-pay-button--type-${buttonType}`\n )}\n onClick={this.props.onClick}\n />\n );\n \n }\n}\n\nexport default ApplePayButton;\n"],"names":["ApplePayButton","Component","render","buttonColor","buttonType","h","button","type","aria-label","this","props","i18n","get","lang","languageCode","className","cx","onClick","defaultProps"],"mappings":"4IAaA,MAAMA,UAAuBC,EAOzBC,MAAAA,EAAOC,YAAEA,EAAWC,WAAEA,IAClB,OACIC,EAACC,SAAAA,CACGC,KAAK,SACLC,aAAYC,KAAKC,MAAMC,KAAKC,IAAI,aAChCC,KAAMJ,KAAKC,MAAMC,KAAKG,aACtBC,UAAWC,EACP,mCACA,qCAAqCb,IACrC,qCAAqCC,IACrC,YACA,mBACA,oBAAoBD,IACpB,0BAA0BC,KAE9Ba,QAASR,KAAKC,MAAMO,SAIhC,cAzB6B,CACzBA,QAAS,OACTd,YAAa,QACbC,WAAY,YAHFc,oBADZlB"}
1
+ {"version":3,"file":"ApplePayButton.js","sources":["../../../../../src/components/ApplePay/components/ApplePayButton.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport cx from 'classnames';\nimport './ApplePayButton.scss';\nimport Language from '../../../language/Language';\nimport { ApplePayButtonType } from '../types';\n\ninterface ApplePayButtonProps {\n i18n: Language;\n buttonColor: 'black' | 'white' | 'white-with-line';\n buttonType: ApplePayButtonType;\n onClick: (event) => void;\n}\n\nclass ApplePayButton extends Component<ApplePayButtonProps> {\n public static defaultProps = {\n onClick: () => {},\n buttonColor: 'black',\n buttonType: 'plain'\n };\n\n render({ buttonColor, buttonType }) {\n return (\n <button\n type=\"button\"\n aria-label={this.props.i18n.get('payButton')}\n lang={this.props.i18n.languageCode}\n className={cx(\n 'adyen-checkout__applepay__button',\n `adyen-checkout__applepay__button--${buttonColor}`,\n `adyen-checkout__applepay__button--${buttonType}`,\n 'apple-pay',\n 'apple-pay-button',\n `apple-pay-button-${buttonColor}`,\n `apple-pay-button--type-${buttonType}`\n )}\n onClick={this.props.onClick}\n />\n );\n }\n}\n\nexport default ApplePayButton;\n"],"names":["ApplePayButton","Component","render","buttonColor","buttonType","h","button","type","aria-label","this","props","i18n","get","lang","languageCode","className","cx","onClick","defaultProps"],"mappings":"4IAaA,MAAMA,UAAuBC,EAOzBC,MAAAA,EAAOC,YAAEA,EAAWC,WAAEA,IAClB,OACIC,EAACC,SAAAA,CACGC,KAAK,SACLC,aAAYC,KAAKC,MAAMC,KAAKC,IAAI,aAChCC,KAAMJ,KAAKC,MAAMC,KAAKG,aACtBC,UAAWC,EACP,mCACA,qCAAqCb,IACrC,qCAAqCC,IACrC,YACA,mBACA,oBAAoBD,IACpB,0BAA0BC,KAE9Ba,QAASR,KAAKC,MAAMO,SAGhC,cAxB6B,CACzBA,QAAS,OACTd,YAAa,QACbC,WAAY,YAHFc,oBADZlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"BacsDD.js","sources":["../../../../src/components/BacsDD/BacsDD.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport BacsInput from './components/BacsInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport BacsResult from './components/BacsResult';\nimport PayButton from '../internal/PayButton';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\nimport { BacsElementData } from './types';\n\nclass BacsElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.directdebit_GB;\n\n formatData(): BacsElementData {\n return {\n paymentMethod: {\n type: BacsElement.type,\n ...(this.state.data?.holderName && { holderName: this.state.data.holderName }),\n ...(this.state.data?.bankAccountNumber && { bankAccountNumber: this.state.data.bankAccountNumber }),\n ...(this.state.data?.bankLocationId && { bankLocationId: this.state.data.bankLocationId })\n },\n ...(this.state.data?.shopperEmail && { shopperEmail: this.state.data.shopperEmail })\n };\n }\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n public payButton = props => {\n return <PayButton amount={this.props.amount} onClick={this.submit} {...props} />;\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.url ? (\n <BacsResult\n ref={ref => {\n this.componentRef = ref;\n }}\n icon={this.icon}\n url={this.props.url}\n paymentMethodType={this.props.paymentMethodType}\n onActionHandled={this.onActionHandled}\n // originalAction={this.props.originalAction}\n />\n ) : (\n <BacsInput\n // @ts-ignore ref is internal from the Component\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onChange={this.setState}\n payButton={this.payButton}\n onSubmit={this.submit}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default BacsElement;\n"],"names":["BacsElement","UIElement","formatData","paymentMethod","type","this","state","data","holderName","bankAccountNumber","bankLocationId","shopperEmail","isValid","render","h","CoreProvider","i18n","props","loadingContext","resources","url","BacsResult","ref","componentRef","icon","paymentMethodType","onActionHandled","BacsInput","onChange","setState","payButton","onSubmit","submit","_define_property","PayButton","amount","onClick","TxVariants","directdebit_GB"],"mappings":"kfAUA,MAAMA,UAAoBC,EAGtBC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMJ,EAAYI,QACdC,KAAKC,MAAMC,MAAMC,YAAc,CAAEA,WAAYH,KAAKC,MAAMC,KAAKC,eAC7DH,KAAKC,MAAMC,MAAME,mBAAqB,CAAEA,kBAAmBJ,KAAKC,MAAMC,KAAKE,sBAC3EJ,KAAKC,MAAMC,MAAMG,gBAAkB,CAAEA,eAAgBL,KAAKC,MAAMC,KAAKG,oBAEzEL,KAAKC,MAAMC,MAAMI,cAAgB,CAAEA,aAAcN,KAAKC,MAAMC,KAAKI,cAE7E,CAEA,WAAIC,GACA,QAASP,KAAKC,MAAMM,OACxB,CAMAC,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMX,KAAKY,MAAMD,KAAME,eAAgBb,KAAKY,MAAMC,eAAgBC,UAAWd,KAAKc,WAC3Fd,KAAKY,MAAMG,IACRN,EAACO,EAAAA,CACGC,IAAKA,IACDjB,KAAKkB,aAAeD,CAAAA,EAExBE,KAAMnB,KAAKmB,KACXJ,IAAKf,KAAKY,MAAMG,IAChBK,kBAAmBpB,KAAKY,MAAMQ,kBAC9BC,gBAAiBrB,KAAKqB,kBAI1BZ,EAACa,EAAAA,CAEGL,IAAKA,IACDjB,KAAKkB,aAAeD,CAAAA,KAEpBjB,KAAKY,MACTW,SAAUvB,KAAKwB,SACfC,UAAWzB,KAAKyB,UAChBC,SAAU1B,KAAK2B,SAKnC,+BAhCAC,EAAA5B,KAAOyB,aAAYb,GACRH,EAACoB,EAAAA,CAAUC,OAAQ9B,KAAKY,MAAMkB,OAAQC,QAAS/B,KAAK2B,UAAYf,OAnB3EgB,EADEjC,EACYI,OAAOiC,EAAWC"}
1
+ {"version":3,"file":"BacsDD.js","sources":["../../../../src/components/BacsDD/BacsDD.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport BacsInput from './components/BacsInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport BacsResult from './components/BacsResult';\nimport PayButton from '../internal/PayButton';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\nimport { BacsElementData } from './types';\n\nclass BacsElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.directdebit_GB;\n\n formatData(): BacsElementData {\n return {\n paymentMethod: {\n type: BacsElement.type,\n ...(this.state.data?.holderName && { holderName: this.state.data.holderName }),\n ...(this.state.data?.bankAccountNumber && { bankAccountNumber: this.state.data.bankAccountNumber }),\n ...(this.state.data?.bankLocationId && { bankLocationId: this.state.data.bankLocationId })\n },\n ...(this.state.data?.shopperEmail && { shopperEmail: this.state.data.shopperEmail })\n };\n }\n\n get isValid(): boolean {\n return !!this.state.isValid;\n }\n\n public payButton = props => {\n return <PayButton amount={this.props.amount} onClick={this.submit} {...props} />;\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.url ? (\n <BacsResult\n ref={ref => {\n this.componentRef = ref;\n }}\n icon={this.icon}\n url={this.props.url}\n paymentMethodType={this.props.paymentMethodType}\n onActionHandled={this.onActionHandled}\n // originalAction={this.props.originalAction}\n />\n ) : (\n <BacsInput\n // @ts-ignore ref is internal from the Component\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n onChange={this.setState}\n payButton={this.payButton}\n onSubmit={this.submit}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default BacsElement;\n"],"names":["BacsElement","UIElement","formatData","paymentMethod","type","this","state","data","holderName","bankAccountNumber","bankLocationId","shopperEmail","isValid","render","h","CoreProvider","i18n","props","loadingContext","resources","url","BacsResult","ref","componentRef","icon","paymentMethodType","onActionHandled","BacsInput","onChange","setState","payButton","onSubmit","submit","super","args","_define_property","PayButton","amount","onClick","TxVariants","directdebit_GB"],"mappings":"kfAUA,MAAMA,UAAoBC,EAGtBC,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMJ,EAAYI,QACdC,KAAKC,MAAMC,MAAMC,YAAc,CAAEA,WAAYH,KAAKC,MAAMC,KAAKC,eAC7DH,KAAKC,MAAMC,MAAME,mBAAqB,CAAEA,kBAAmBJ,KAAKC,MAAMC,KAAKE,sBAC3EJ,KAAKC,MAAMC,MAAMG,gBAAkB,CAAEA,eAAgBL,KAAKC,MAAMC,KAAKG,oBAEzEL,KAAKC,MAAMC,MAAMI,cAAgB,CAAEA,aAAcN,KAAKC,MAAMC,KAAKI,cAE7E,CAEA,WAAIC,GACA,QAASP,KAAKC,MAAMM,OACxB,CAMAC,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMX,KAAKY,MAAMD,KAAME,eAAgBb,KAAKY,MAAMC,eAAgBC,UAAWd,KAAKc,WAC3Fd,KAAKY,MAAMG,IACRN,EAACO,EAAAA,CACGC,IAAKA,IACDjB,KAAKkB,aAAeD,CAAAA,EAExBE,KAAMnB,KAAKmB,KACXJ,IAAKf,KAAKY,MAAMG,IAChBK,kBAAmBpB,KAAKY,MAAMQ,kBAC9BC,gBAAiBrB,KAAKqB,kBAI1BZ,EAACa,EAAAA,CAEGL,IAAKA,IACDjB,KAAKkB,aAAeD,CAAAA,KAEpBjB,KAAKY,MACTW,SAAUvB,KAAKwB,SACfC,UAAWzB,KAAKyB,UAChBC,SAAU1B,KAAK2B,SAKnC,mBAhCAC,SAAAC,GAAAC,EAAA9B,KAAOyB,aAAYb,GACRH,EAACsB,EAAAA,CAAUC,OAAQhC,KAAKY,MAAMoB,OAAQC,QAASjC,KAAK2B,UAAYf,OAnB3EkB,EADEnC,EACYI,OAAOmC,EAAWC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Boleto.js","sources":["../../../../src/components/Boleto/Boleto.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport BoletoInput from './components/BoletoInput';\nimport { cleanCPFCNPJ } from '../internal/SocialSecurityNumberBrazil/utils';\nimport BoletoVoucherResult from './components/BoletoVoucherResult';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\n\nexport class BoletoElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.boletobancario;\n\n public static txVariants = [\n TxVariants.boletobancario,\n TxVariants.boletobancario_itau,\n TxVariants.boletobancario_santander,\n TxVariants.primeiropay_boleto\n ];\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const { data = {} } = this.state;\n const { billingAddress, shopperEmail, firstName, lastName, socialSecurityNumber = '' } = data;\n\n return {\n paymentMethod: {\n type: this.type\n },\n ...(billingAddress && { billingAddress }),\n ...(shopperEmail && { shopperEmail }),\n ...(firstName && lastName && { shopperName: { firstName, lastName } }),\n ...(socialSecurityNumber && { socialSecurityNumber: cleanCPFCNPJ(socialSecurityNumber) })\n };\n }\n\n private handleRef = ref => {\n this.componentRef = ref;\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.reference ? (\n <BoletoVoucherResult ref={this.handleRef} icon={this.icon} {...this.props} onActionHandled={this.onActionHandled} />\n ) : (\n <BoletoInput\n setComponentRef={this.handleRef}\n {...this.props}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default BoletoElement;\n"],"names":["BoletoElement","UIElement","isValid","this","state","formatData","data","billingAddress","shopperEmail","firstName","lastName","socialSecurityNumber","paymentMethod","type","shopperName","cleanCPFCNPJ","render","h","CoreProvider","i18n","props","loadingContext","resources","reference","BoletoVoucherResult","ref","handleRef","icon","onActionHandled","BoletoInput","setComponentRef","onChange","setState","onSubmit","submit","payButton","_define_property","componentRef","TxVariants","boletobancario","txVariants","boletobancario_itau","boletobancario_santander","primeiropay_boleto"],"mappings":"0jBASO,MAAMA,UAAsBC,EAU/B,WAAIC,GACA,QAASC,KAAKC,MAAMF,OACxB,CAKAG,UAAAA,GACI,MAAMC,KAAEA,EAAO,CAAA,GAAOH,KAAKC,OACrBG,eAAEA,EAAcC,aAAEA,EAAYC,UAAEA,EAASC,SAAEA,EAAQC,qBAAEA,EAAuB,IAAOL,EAEzF,MAAO,CACHM,cAAe,CACXC,KAAMV,KAAKU,SAEXN,GAAkB,CAAEA,qBACpBC,GAAgB,CAAEA,mBAClBC,GAAaC,GAAY,CAAEI,YAAa,CAAEL,YAAWC,gBACrDC,GAAwB,CAAEA,qBAAsBI,EAAaJ,IAEzE,CAMAK,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMhB,KAAKiB,MAAMD,KAAME,eAAgBlB,KAAKiB,MAAMC,eAAgBC,UAAWnB,KAAKmB,WAC3FnB,KAAKiB,MAAMG,UACRN,EAACO,EAAAA,CAAoBC,IAAKtB,KAAKuB,UAAWC,KAAMxB,KAAKwB,QAAUxB,KAAKiB,MAAOQ,gBAAiBzB,KAAKyB,kBAEjGX,EAACY,EAAAA,CACGC,gBAAiB3B,KAAKuB,aAClBvB,KAAKiB,MACTW,SAAU5B,KAAK6B,SACfC,SAAU9B,KAAK+B,OACfC,UAAWhC,KAAKgC,YAKpC,+BApBAC,EAAAjC,KAAQuB,aAAYD,IAChBtB,KAAKkC,aAAeZ,CAAAA,KAhCxBW,EADSpC,EACKa,OAAOyB,EAAWC,gBAEhCH,EAHSpC,EAGKwC,aAAa,CACvBF,EAAWC,eACXD,EAAWG,oBACXH,EAAWI,yBACXJ,EAAWK"}
1
+ {"version":3,"file":"Boleto.js","sources":["../../../../src/components/Boleto/Boleto.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport BoletoInput from './components/BoletoInput';\nimport { cleanCPFCNPJ } from '../internal/SocialSecurityNumberBrazil/utils';\nimport BoletoVoucherResult from './components/BoletoVoucherResult';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { TxVariants } from '../tx-variants';\nimport { VoucherConfiguration } from '../internal/Voucher/types';\n\nexport class BoletoElement extends UIElement<VoucherConfiguration> {\n public static type = TxVariants.boletobancario;\n\n public static txVariants = [\n TxVariants.boletobancario,\n TxVariants.boletobancario_itau,\n TxVariants.boletobancario_santander,\n TxVariants.primeiropay_boleto\n ];\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const { data = {} } = this.state;\n const { billingAddress, shopperEmail, firstName, lastName, socialSecurityNumber = '' } = data;\n\n return {\n paymentMethod: {\n type: this.type\n },\n ...(billingAddress && { billingAddress }),\n ...(shopperEmail && { shopperEmail }),\n ...(firstName && lastName && { shopperName: { firstName, lastName } }),\n ...(socialSecurityNumber && { socialSecurityNumber: cleanCPFCNPJ(socialSecurityNumber) })\n };\n }\n\n private handleRef = ref => {\n this.componentRef = ref;\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n {this.props.reference ? (\n <BoletoVoucherResult ref={this.handleRef} icon={this.icon} {...this.props} onActionHandled={this.onActionHandled} />\n ) : (\n <BoletoInput\n setComponentRef={this.handleRef}\n {...this.props}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default BoletoElement;\n"],"names":["BoletoElement","UIElement","isValid","this","state","formatData","data","billingAddress","shopperEmail","firstName","lastName","socialSecurityNumber","paymentMethod","type","shopperName","cleanCPFCNPJ","render","h","CoreProvider","i18n","props","loadingContext","resources","reference","BoletoVoucherResult","ref","handleRef","icon","onActionHandled","BoletoInput","setComponentRef","onChange","setState","onSubmit","submit","payButton","super","args","_define_property","componentRef","TxVariants","boletobancario","txVariants","boletobancario_itau","boletobancario_santander","primeiropay_boleto"],"mappings":"0jBASO,MAAMA,UAAsBC,EAU/B,WAAIC,GACA,QAASC,KAAKC,MAAMF,OACxB,CAKAG,UAAAA,GACI,MAAMC,KAAEA,EAAO,CAAA,GAAOH,KAAKC,OACrBG,eAAEA,EAAcC,aAAEA,EAAYC,UAAEA,EAASC,SAAEA,EAAQC,qBAAEA,EAAuB,IAAOL,EAEzF,MAAO,CACHM,cAAe,CACXC,KAAMV,KAAKU,SAEXN,GAAkB,CAAEA,qBACpBC,GAAgB,CAAEA,mBAClBC,GAAaC,GAAY,CAAEI,YAAa,CAAEL,YAAWC,gBACrDC,GAAwB,CAAEA,qBAAsBI,EAAaJ,IAEzE,CAMAK,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMhB,KAAKiB,MAAMD,KAAME,eAAgBlB,KAAKiB,MAAMC,eAAgBC,UAAWnB,KAAKmB,WAC3FnB,KAAKiB,MAAMG,UACRN,EAACO,EAAAA,CAAoBC,IAAKtB,KAAKuB,UAAWC,KAAMxB,KAAKwB,QAAUxB,KAAKiB,MAAOQ,gBAAiBzB,KAAKyB,kBAEjGX,EAACY,EAAAA,CACGC,gBAAiB3B,KAAKuB,aAClBvB,KAAKiB,MACTW,SAAU5B,KAAK6B,SACfC,SAAU9B,KAAK+B,OACfC,UAAWhC,KAAKgC,YAKpC,mBApBAC,SAAAC,GAAAC,EAAAnC,KAAQuB,aAAYD,IAChBtB,KAAKoC,aAAed,CAAAA,KAhCxBa,EADStC,EACKa,OAAO2B,EAAWC,gBAEhCH,EAHStC,EAGK0C,aAAa,CACvBF,EAAWC,eACXD,EAAWG,oBACXH,EAAWI,yBACXJ,EAAWK"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import o from"../../../internal/Voucher/Voucher.js";import{useCoreContext as r}from"../../../../core/Context/CoreProvider.js";import t from"../../../../core/Context/useImage.js";import{extractCommonPropsForVoucher as a}from"../../../internal/Voucher/utils.js";const n=n=>{const{i18n:d,loadingContext:c}=r(),i=t(),{reference:l,expiresAt:p,downloadUrl:s}=n,m=`${c}barcode.shtml?data=${l.replace(/[^\d]/g,"").replace(/^(\d{4})(\d{5})\d{1}(\d{10})\d{1}(\d{10})\d{1}(\d{15})$/,"$1$5$2$3$4")}&barcodeType=BT_Int2of5A&fileType=png`;return e(o,{...a({props:{...n,paymentMethodType:"boletobancario"},i18n:d,introKey:"voucher.introduction",getImage:i()}),barcode:m,voucherDetails:[{label:d.get("voucher.expirationDate"),value:d.date(p)}],downloadUrl:s,copyBtn:!0})};export{n as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import t from"../../../internal/Voucher/Voucher.js";import{useCoreContext as r}from"../../../../core/Context/CoreProvider.js";import o from"../../../../core/Context/useImage.js";import{extractCommonPropsForVoucher as a}from"../../../internal/Voucher/utils.js";const n=n=>{const{i18n:i,loadingContext:c}=r(),d=o(),{reference:l,expiresAt:p,downloadUrl:s}=n,m=`${c}utility/v1/barcode.png?data=${l.replace(/[^\d]/g,"").replace(/^(\d{4})(\d{5})\d{1}(\d{10})\d{1}(\d{10})\d{1}(\d{15})$/,"$1$5$2$3$4")}&type=itf&clientKey=${n.clientKey}`;return e(t,{...a({props:{...n,paymentMethodType:"boletobancario"},i18n:i,introKey:"voucher.introduction",getImage:d()}),barcode:m,voucherDetails:[{label:i.get("voucher.expirationDate"),value:i.date(p)}],downloadUrl:s,copyBtn:!0})};export{n as default};
2
2
  //# sourceMappingURL=BoletoVoucherResult.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BoletoVoucherResult.js","sources":["../../../../../../src/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Voucher from '../../../internal/Voucher';\n\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport './BoletoVoucherResult.scss';\nimport { VoucherDetail } from '../../../internal/Voucher/types';\nimport useImage from '../../../../core/Context/useImage';\nimport { extractCommonPropsForVoucher } from '../../../internal/Voucher/utils';\n\nconst BoletoVoucherResult = props => {\n const { i18n, loadingContext } = useCoreContext();\n const getImage = useImage();\n const { reference, expiresAt, downloadUrl } = props;\n const barcodeReference = reference.replace(/[^\\d]/g, '').replace(/^(\\d{4})(\\d{5})\\d{1}(\\d{10})\\d{1}(\\d{10})\\d{1}(\\d{15})$/, '$1$5$2$3$4');\n const barcodeUrl = `${loadingContext}barcode.shtml?data=${barcodeReference}&barcodeType=BT_Int2of5A&fileType=png`;\n\n const paymentMethodType = 'boletobancario'; // overwrite the bank specific type of boleto, e.g. 'boletobancario_santander', to a more generic form\n\n return (\n <Voucher\n {...extractCommonPropsForVoucher({\n props: { ...props, paymentMethodType },\n i18n,\n introKey: 'voucher.introduction',\n getImage: getImage()\n })}\n barcode={barcodeUrl}\n voucherDetails={[{ label: i18n.get('voucher.expirationDate'), value: i18n.date(expiresAt) }] as VoucherDetail[]}\n downloadUrl={downloadUrl}\n copyBtn\n />\n );\n};\n\nexport default BoletoVoucherResult;\n"],"names":["BoletoVoucherResult","props","i18n","loadingContext","useCoreContext","getImage","useImage","reference","expiresAt","downloadUrl","barcodeUrl","replace","h","Voucher","extractCommonPropsForVoucher","paymentMethodType","introKey","barcode","voucherDetails","label","get","value","date","copyBtn"],"mappings":"+UASA,MAAMA,EAAsBC,IACxB,MAAMC,KAAEA,EAAIC,eAAEA,GAAmBC,IAC3BC,EAAWC,KACXC,UAAEA,EAASC,UAAEA,EAASC,YAAEA,GAAgBR,EAExCS,EAAa,GAAGP,uBADGI,EAAUI,QAAQ,SAAU,IAAIA,QAAQ,0DAA2D,qDAK5H,OACIC,EAACC,EAAAA,IACOC,EAA6B,CAC7Bb,MAAO,IAAKA,EAAOc,kBALL,kBAMdb,OACAc,SAAU,uBACVX,SAAUA,MAEdY,QAASP,EACTQ,eAAgB,CAAC,CAAEC,MAAOjB,EAAKkB,IAAI,0BAA2BC,MAAOnB,EAAKoB,KAAKd,KAC/EC,YAAaA,EACbc,SAAAA"}
1
+ {"version":3,"file":"BoletoVoucherResult.js","sources":["../../../../../../src/components/Boleto/components/BoletoVoucherResult/BoletoVoucherResult.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Voucher from '../../../internal/Voucher';\n\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport './BoletoVoucherResult.scss';\nimport { VoucherDetail } from '../../../internal/Voucher/types';\nimport useImage from '../../../../core/Context/useImage';\nimport { extractCommonPropsForVoucher } from '../../../internal/Voucher/utils';\n\nconst BoletoVoucherResult = props => {\n const { i18n, loadingContext } = useCoreContext();\n const getImage = useImage();\n const { reference, expiresAt, downloadUrl } = props;\n const barcodeReference = reference.replace(/[^\\d]/g, '').replace(/^(\\d{4})(\\d{5})\\d{1}(\\d{10})\\d{1}(\\d{10})\\d{1}(\\d{15})$/, '$1$5$2$3$4');\n const barcodeUrl = `${loadingContext}utility/v1/barcode.png?data=${barcodeReference}&type=itf&clientKey=${props.clientKey}`;\n\n const paymentMethodType = 'boletobancario'; // overwrite the bank specific type of boleto, e.g. 'boletobancario_santander', to a more generic form\n\n return (\n <Voucher\n {...extractCommonPropsForVoucher({\n props: { ...props, paymentMethodType },\n i18n,\n introKey: 'voucher.introduction',\n getImage: getImage()\n })}\n barcode={barcodeUrl}\n voucherDetails={[{ label: i18n.get('voucher.expirationDate'), value: i18n.date(expiresAt) }] as VoucherDetail[]}\n downloadUrl={downloadUrl}\n copyBtn\n />\n );\n};\n\nexport default BoletoVoucherResult;\n"],"names":["BoletoVoucherResult","props","i18n","loadingContext","useCoreContext","getImage","useImage","reference","expiresAt","downloadUrl","barcodeUrl","replace","clientKey","h","Voucher","extractCommonPropsForVoucher","paymentMethodType","introKey","barcode","voucherDetails","label","get","value","date","copyBtn"],"mappings":"+UASA,MAAMA,EAAsBC,IACxB,MAAMC,KAAEA,EAAIC,eAAEA,GAAmBC,IAC3BC,EAAWC,KACXC,UAAEA,EAASC,UAAEA,EAASC,YAAEA,GAAgBR,EAExCS,EAAa,GAAGP,gCADGI,EAAUI,QAAQ,SAAU,IAAIA,QAAQ,0DAA2D,oCAClBV,EAAMW,YAIhH,OACIC,EAACC,EAAAA,IACOC,EAA6B,CAC7Bd,MAAO,IAAKA,EAAOe,kBALL,kBAMdd,OACAe,SAAU,uBACVZ,SAAUA,MAEda,QAASR,EACTS,eAAgB,CAAC,CAAEC,MAAOlB,EAAKmB,IAAI,0BAA2BC,MAAOpB,EAAKqB,KAAKf,KAC/EC,YAAaA,EACbe,SAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { reject } from '../../utils/commonUtils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup?.(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonFunctionProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","setStatus","status","props","this","componentRef","clickToPayRef","formatProps","enableStoreDetails","session","configuration","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","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","paymentMethod","type","data","holderName","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","nuObj","reject","from","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","constructor","hasOwnProperty","isStoredPaymentMethod","super","length","storePaymentMethod","Boolean","isValid","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onChange","setState","onSubmit","submit","handleKeyPress","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onValidationErrorAnalytics","onConfigSuccess","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","checkout","_define_property","ref","event","payload","valid","errors","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","ANALYTICS_UNFOCUS_STR","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","secondaryAmount","label","onClick","_disableClickToPay","createClickToPayService","environment","initialize","scheme","defaultProps","showFormInstruction","doBinLookup"],"mappings":"2hDAmCO,MAAMA,UAAoBC,EA2BtBC,SAAAA,CAAUC,EAAyBC,GAOtC,OANIC,KAAKC,cAAcJ,WACnBG,KAAKC,aAAaJ,UAAUC,EAAQC,GAEpCC,KAAKE,eAAeL,WACpBG,KAAKE,cAAcL,UAAUC,EAAQC,GAElCC,IACX,CAMAG,WAAAA,CAAYJ,GAER,MAAMK,EAAqBL,EAAMM,SAASC,eAAeF,oBAAsBL,EAAMK,mBAG/EG,IADqC,IAAxBR,EAAMS,QAAQC,QACqBL,EAEhDM,EAAeX,EAAMY,uBAAyBZ,EAAMa,GACpDC,EAAwBH,GAAgBX,GAAOe,8BAA8BC,SAAS,aAG5F,GAAIL,IAAiBG,EAEjB,MAAM,IAAIG,EACNC,EACA,uGAIR,MAAO,IACAlB,EAEHmB,qBAAqBnB,EAAMoB,eAAwBpB,EAAMmB,mBAEzDE,SAAUrB,EAAOsB,OAAyB,SAAhBtB,EAAMsB,OAAqBtB,EAAMuB,SAE3DC,wBAAwBxB,EAAMY,uBAAgCZ,EAAMwB,uBAEpEC,mBAAoBzB,EAAM0B,gBAAkBC,EAAsBF,mBAAqBzB,EAAMyB,mBAE7FH,MAAOtB,EAAMsB,OAASM,EAAWC,KACjCC,YAAa9B,EAAM8B,YAAc9B,EAAM8B,YAAYC,cAAgB,KAGnExB,cAAe,IACRP,EAAMO,cACTyB,yBAA0BhC,EAAMO,eAAeyB,0BAA4B,QAE/EC,oBAAqBjC,EAAMiC,qBAAuBjC,EAAMO,eAAe0B,qBAAuB,CAAC,EAC/FC,KAAMl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AIsE,WACjCI,oBAAqB1E,EAAI2E,UACzBC,uBAAwBC,EAAwB7E,EAAI2E,UAAWG,IACnE,IAGJjB,EAAOtB,KAAAA,aAAawC,EAAiBvJ,OAoErCqI,EAAArI,KAAmB6G,aAAa9G,IAC5B,MAAMyJ,EAA0C,IAA7BxJ,KAAKD,MAAMS,QAAQC,MAChCgJ,EAAezJ,KAAKD,MAAMY,uBAAuByE,OAAS,EAChE,OACIiB,EAACqD,EAAAA,IACO3J,EACJS,OAAQR,KAAKD,MAAMS,OACnBmJ,gBAAiB3J,KAAKD,MAAM4J,gBAC5BC,MAAOJ,IAAeC,EAAezJ,KAAKD,MAAM2C,KAAKuD,IAAI,yBAA2B,GACpF4D,QAAS7J,KAAK2G,YAtSlB5G,IAAUA,EAAM+J,qBAChB9J,KAAK4H,kBAAoBmC,EAAwB/J,KAAKD,MAAMO,cAAeN,KAAKD,MAAMoC,wBAAyBnC,KAAKD,MAAMiK,aACrHhK,KAAK4H,mBAAmBqC,aAErC,EAhBA5B,EADS1I,EACKsD,OAAOtB,EAAWuI,QAkBhC7B,EAnBS1I,EAmBQwK,eAAe,CAC5BC,qBAAqB,EACrBN,oBAAoB,EACpBO,aAAa,KAEV3F,EAAO,CAAC,OAAQ,oBAAoBC,KAAKjD"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../src/components/Card/Card.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardInput from './components/CardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport { BinLookupResponse, CardElementData, CardConfiguration } from './types';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnConfigSuccess, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { reject } from '../../utils/commonUtils';\nimport { hasValidInstallmentsObject } from './components/CardInput/utils';\nimport createClickToPayService from '../internal/ClickToPay/services/create-clicktopay-service';\nimport { ClickToPayCheckoutPayload, IClickToPayService } from '../internal/ClickToPay/services/types';\nimport ClickToPayWrapper from './components/ClickToPayWrapper';\nimport { ComponentFocusObject } from '../../types/global-types';\nimport SRPanelProvider from '../../core/Errors/SRPanelProvider';\nimport { TxVariants } from '../tx-variants';\nimport type { PayButtonFunctionProps, UIElementStatus } from '../internal/UIElement/types';\nimport UIElement from '../internal/UIElement';\nimport PayButton from '../internal/PayButton';\nimport type { ICore } from '../../core/types';\nimport {\n ANALYTICS_FOCUS_STR,\n ANALYTICS_CONFIGURED_STR,\n ANALYTICS_UNFOCUS_STR,\n ANALYTICS_VALIDATION_ERROR_STR,\n ANALYTICS_RENDERED_STR\n} from '../../core/Analytics/constants';\nimport { ALL_SECURED_FIELDS } from '../internal/SecuredFields/lib/constants';\nimport { FieldErrorAnalyticsObject, SendAnalyticsObject } from '../../core/Analytics/types';\nimport { hasOwnProperty } from '../../utils/hasOwnProperty';\nimport AdyenCheckoutError, { IMPLEMENTATION_ERROR } from '../../core/Errors/AdyenCheckoutError';\nimport { getErrorMessageFromCode } from '../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../core/Errors/constants';\nimport CardInputDefaultProps from './components/CardInput/defaultProps';\n\nexport class CardElement extends UIElement<CardConfiguration> {\n public static type = TxVariants.scheme;\n\n private readonly clickToPayService: IClickToPayService | null;\n\n /**\n * Reference to the 'ClickToPayComponent'\n */\n private clickToPayRef = null;\n\n constructor(checkout: ICore, props?: CardConfiguration) {\n super(checkout, props);\n\n if (props && !props._disableClickToPay) {\n this.clickToPayService = createClickToPayService(this.props.configuration, this.props.clickToPayConfiguration, this.props.environment);\n void this.clickToPayService?.initialize();\n }\n }\n\n protected static defaultProps = {\n showFormInstruction: true,\n _disableClickToPay: false,\n doBinLookup: true,\n // Merge most of CardInput's defaultProps\n ...reject(['type', 'setComponentRef']).from(CardInputDefaultProps)\n };\n\n public setStatus(status: UIElementStatus, props?): this {\n if (this.componentRef?.setStatus) {\n this.componentRef.setStatus(status, props);\n }\n if (this.clickToPayRef?.setStatus) {\n this.clickToPayRef.setStatus(status, props);\n }\n return this;\n }\n\n private setClickToPayRef = ref => {\n this.clickToPayRef = ref;\n };\n\n formatProps(props: CardConfiguration): CardConfiguration {\n // The value from a session should be used, before falling back to the merchant configuration\n const enableStoreDetails = props.session?.configuration?.enableStoreDetails ?? props.enableStoreDetails;\n\n const isZeroAuth = props.amount?.value === 0;\n const showStoreDetailsCheckbox = isZeroAuth ? false : enableStoreDetails;\n\n const storedCardID = props.storedPaymentMethodId || props.id; // check if we've been passed a (checkout) processed storedCard or one that merchant has pulled from the PMs response\n const isEcommerceStoredCard = storedCardID && props?.supportedShopperInteractions?.includes('Ecommerce'); // If we have a storedCard does it support Ecommerce (it might not if the merchant has pulled it from the PMs response)\n\n // If we have a storedPM but it doesn't support Ecommerce - we can't make a storedCard component from it\n if (storedCardID && !isEcommerceStoredCard) {\n // TODO - Decide if an error is too severe? Would a console.warning suffice?\n throw new AdyenCheckoutError(\n IMPLEMENTATION_ERROR,\n 'You are trying to create a storedCard from a stored PM that does not support Ecommerce interactions'\n );\n }\n\n return {\n ...props,\n // Mismatch between hasHolderName & holderNameRequired which can mean card can never be valid\n holderNameRequired: !props.hasHolderName ? false : props.holderNameRequired,\n // False for *stored* BCMC cards & if merchant explicitly wants to hide the CVC field\n hasCVC: !((props.brand && props.brand === 'bcmc') || props.hideCVC),\n // billingAddressRequired only available for non-stored cards\n billingAddressRequired: props.storedPaymentMethodId ? false : props.billingAddressRequired,\n // edge case where merchant has defined both an onAddressLookup callback AND set billingAddressMode: 'partial' - which leads to some strange behaviour in the address UI\n billingAddressMode: props.onAddressLookup ? CardInputDefaultProps.billingAddressMode : props.billingAddressMode,\n /** props.brand will be specified in the case of a StoredCard or a Bancontact component, for a regular Card we default it to 'card' */\n brand: props.brand ?? TxVariants.card,\n countryCode: props.countryCode ? props.countryCode.toLowerCase() : null,\n // Required for transition period (until configuration object becomes the norm)\n // - if merchant has defined value directly in props, use this instead\n configuration: {\n ...props.configuration,\n socialSecurityNumberMode: props.configuration?.socialSecurityNumberMode ?? 'auto'\n },\n brandsConfiguration: props.brandsConfiguration || props.configuration?.brandsConfiguration || {},\n icon: props.icon || props.configuration?.icon,\n // installmentOptions of a session should be used before falling back to the merchant configuration\n installmentOptions: props.session?.configuration?.installmentOptions || props.installmentOptions,\n enableStoreDetails,\n showStoreDetailsCheckbox,\n /**\n * Click to Pay configuration\n * - If email is set explicitly in the configuration, then it can override the one used in the session creation\n */\n clickToPayConfiguration: {\n ...props.clickToPayConfiguration,\n disableOtpAutoFocus: props.clickToPayConfiguration?.disableOtpAutoFocus || false,\n shopperEmail: props.clickToPayConfiguration?.shopperEmail || this.core.options?.session?.shopperEmail,\n telephoneNumber: props.clickToPayConfiguration?.telephoneNumber || this.core.options?.session?.telephoneNumber,\n locale: props.clickToPayConfiguration?.locale || props.i18n?.locale?.replace('-', '_')\n },\n ...(storedCardID && { storedPaymentMethodId: storedCardID })\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): CardElementData {\n /**\n * this.state.selectedBrandValue will be set when:\n * - /binLookup detects a single brand,\n * - when /binLookup detects a dual-branded card and the shopper makes a brand selection\n * - or, in the case of a storedCard\n */\n const cardBrand = this.state.selectedBrandValue;\n\n return {\n paymentMethod: {\n type: CardElement.type,\n ...this.state.data,\n ...(this.props.storedPaymentMethodId && {\n storedPaymentMethodId: this.props.storedPaymentMethodId,\n holderName: this.props.holderName ?? ''\n }),\n ...(cardBrand && { brand: cardBrand }),\n ...(this.props.fundingSource && { fundingSource: this.props.fundingSource })\n },\n ...(this.state.billingAddress && { billingAddress: this.state.billingAddress }),\n ...(this.state.socialSecurityNumber && { socialSecurityNumber: this.state.socialSecurityNumber }),\n ...this.storePaymentMethodPayload,\n ...(hasValidInstallmentsObject(this.state.installments) && { installments: this.state.installments }),\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(fieldName) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(fieldName);\n return this;\n }\n\n public onBrand = event => {\n this.props.onBrand?.(event);\n };\n\n processBinLookupResponse(binLookupResponse: BinLookupResponse, isReset = false) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse, isReset);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n private handleClickToPaySubmit = (payload: ClickToPayCheckoutPayload) => {\n this.setState({ data: { ...payload }, valid: {}, errors: {}, isValid: true });\n this.submit();\n };\n\n onBinLookup(obj: CbObjOnBinLookup) {\n // Handler for regular card comp doesn't need this 'raw' data or to know about 'resets'\n if (!obj.isReset) {\n const nuObj = reject('supportedBrandsRaw').from(obj);\n this.props.onBinLookup?.(nuObj);\n }\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n const { type } = analyticsObj;\n\n if (type === ANALYTICS_RENDERED_STR || type === ANALYTICS_CONFIGURED_STR) {\n // Check if it's a storedCard\n if (this.constructor['type'] === 'scheme') {\n if (hasOwnProperty(this.props, 'supportedShopperInteractions')) {\n analyticsObj.isStoredPaymentMethod = true;\n analyticsObj.brand = this.props.brand;\n }\n }\n }\n\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n private onConfigSuccess = (obj: CbObjOnConfigSuccess) => {\n this.submitAnalytics({\n type: ANALYTICS_CONFIGURED_STR\n });\n\n this.props.onConfigSuccess?.(obj);\n };\n\n private onFocus = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_FOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onFocus?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onFocus?.(obj);\n }\n };\n\n private onBlur = (obj: ComponentFocusObject) => {\n this.submitAnalytics({\n type: ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n if (ALL_SECURED_FIELDS.includes(obj.fieldType)) {\n this.props.onBlur?.(obj.event as CbObjOnFocus);\n } else {\n this.props.onBlur?.(obj);\n }\n };\n\n private onValidationErrorAnalytics = (obj: FieldErrorAnalyticsObject) => {\n this.submitAnalytics({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(obj.fieldType),\n validationErrorCode: obj.errorCode,\n validationErrorMessage: getErrorMessageFromCode(obj.errorCode, SF_ErrorCodes)\n });\n };\n\n public onBinValue = triggerBinLookUp(this);\n\n get storePaymentMethodPayload() {\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n if (isStoredCard) {\n return {};\n }\n\n /**\n * For regular card, zero auth payments, we store the payment method, *if* the configuration says we should:\n * - For sessions, this means if the session has been created with storePaymentMethodMode: 'askForConsent'\n * - For the advanced flow, this means if the merchant has still set enableStoreDetails: true\n *\n * What we are doing is.. if for a normal payment we would show the \"Save for my next payment\" checkbox,\n * for a zero-auth payment we effectively click the checkbox on behalf of the shopper.\n */\n const isZeroAuth = this.props.amount?.value === 0;\n if (isZeroAuth) {\n return this.props.enableStoreDetails ? { storePaymentMethod: true } : {};\n }\n\n // For regular card, non-zero auth payments, we store the payment method based on the checkbox value.\n const includeStorePaymentMethod = this.props.showStoreDetailsCheckbox && typeof this.state.storePaymentMethod !== 'undefined';\n return includeStorePaymentMethod ? { storePaymentMethod: Boolean(this.state.storePaymentMethod) } : {};\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get icon() {\n return this.props.icon ?? this.resources.getImage()(this.props.brand);\n }\n\n get brands(): { icon: any; name: string }[] {\n const { brands, brandsConfiguration } = this.props;\n if (brands) {\n return brands.map(brand => {\n const brandIcon = brandsConfiguration[brand]?.icon ?? this.props.modules.resources.getImage()(brand);\n return { icon: brandIcon, name: brand };\n });\n }\n\n return [];\n }\n\n get displayName(): string {\n if (this.props.storedPaymentMethodId) {\n return `•••• ${this.props.lastFour}`;\n }\n\n return this.props.name || CardElement.type;\n }\n\n get accessibleName(): string {\n // Use display name, unless it's a stored payment method, there inform user\n return (\n (this.props.name || CardElement.type) +\n (this.props.storedPaymentMethodId\n ? ' ' + this.props.i18n.get('creditCard.storedCard.description.ariaLabel').replace('%@', this.props.lastFour)\n : '')\n );\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n protected override payButton = (props: PayButtonFunctionProps) => {\n const isZeroAuth = this.props.amount?.value === 0;\n const isStoredCard = this.props.storedPaymentMethodId?.length > 0;\n return (\n <PayButton\n {...props}\n amount={this.props.amount}\n secondaryAmount={this.props.secondaryAmount}\n label={isZeroAuth && !isStoredCard ? this.props.i18n.get('payButton.saveDetails') : ''}\n onClick={this.submit}\n />\n );\n };\n\n private renderCardInput(isCardPrimaryInput = true): h.JSX.Element {\n return (\n <CardInput\n setComponentRef={this.setComponentRef}\n {...this.props}\n {...this.state}\n onChange={this.setState}\n onSubmit={this.submit}\n handleKeyPress={this.handleKeyPress}\n payButton={this.payButton}\n onBrand={this.onBrand}\n onBinValue={this.onBinValue}\n brand={this.props.brand}\n brandsIcons={this.brands}\n isPayButtonPrimaryVariant={isCardPrimaryInput}\n resources={this.resources}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onValidationErrorAnalytics={this.onValidationErrorAnalytics}\n onConfigSuccess={this.onConfigSuccess}\n />\n );\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <SRPanelProvider srPanel={this.props.modules.srPanel}>\n <ClickToPayWrapper\n amount={this.props.amount}\n configuration={this.props.clickToPayConfiguration}\n clickToPayService={this.clickToPayService}\n isStandaloneComponent={false}\n setClickToPayRef={this.setClickToPayRef}\n onSetStatus={this.setElementStatus}\n onSubmit={this.handleClickToPaySubmit}\n onError={this.handleError}\n >\n {isCardPrimaryInput => this.renderCardInput(isCardPrimaryInput)}\n </ClickToPayWrapper>\n </SRPanelProvider>\n </CoreProvider>\n );\n }\n}\n\nexport default CardElement;\n"],"names":["CardElement","UIElement","setStatus","status","props","this","componentRef","clickToPayRef","formatProps","enableStoreDetails","session","configuration","showStoreDetailsCheckbox","amount","value","storedCardID","storedPaymentMethodId","id","isEcommerceStoredCard","supportedShopperInteractions","includes","AdyenCheckoutError","IMPLEMENTATION_ERROR","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","paymentMethod","type","data","holderName","fundingSource","billingAddress","socialSecurityNumber","storePaymentMethodPayload","hasValidInstallmentsObject","installments","browserInfo","origin","window","location","updateStyles","stylesObj","setFocusOn","fieldName","processBinLookupResponse","binLookupResponse","isReset","handleUnsupportedCard","errObj","onBinLookup","obj","nuObj","reject","from","submitAnalytics","analyticsObj","ANALYTICS_RENDERED_STR","ANALYTICS_CONFIGURED_STR","constructor","hasOwnProperty","isStoredPaymentMethod","super","length","storePaymentMethod","Boolean","isValid","resources","getImage","brands","map","modules","name","displayName","lastFour","accessibleName","get","collectBrowserInfo","renderCardInput","isCardPrimaryInput","h","CardInput","setComponentRef","onChange","setState","onSubmit","submit","handleKeyPress","payButton","onBrand","onBinValue","brandsIcons","isPayButtonPrimaryVariant","onFocus","onBlur","onValidationErrorAnalytics","onConfigSuccess","render","CoreProvider","loadingContext","SRPanelProvider","srPanel","ClickToPayWrapper","clickToPayService","isStandaloneComponent","setClickToPayRef","onSetStatus","setElementStatus","handleClickToPaySubmit","onError","handleError","checkout","_define_property","ref","event","payload","valid","errors","ANALYTICS_FOCUS_STR","target","fieldTypeToSnakeCase","fieldType","ALL_SECURED_FIELDS","ANALYTICS_UNFOCUS_STR","ANALYTICS_VALIDATION_ERROR_STR","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","triggerBinLookUp","isZeroAuth","isStoredCard","PayButton","secondaryAmount","label","onClick","_disableClickToPay","createClickToPayService","environment","initialize","scheme","defaultProps","showFormInstruction","doBinLookup"],"mappings":"2hDAmCO,MAAMA,UAAoBC,EA2BtBC,SAAAA,CAAUC,EAAyBC,GAOtC,OANIC,KAAKC,cAAcJ,WACnBG,KAAKC,aAAaJ,UAAUC,EAAQC,GAEpCC,KAAKE,eAAeL,WACpBG,KAAKE,cAAcL,UAAUC,EAAQC,GAElCC,IACX,CAMAG,WAAAA,CAAYJ,GAER,MAAMK,EAAqBL,EAAMM,SAASC,eAAeF,oBAAsBL,EAAMK,mBAG/EG,IADqC,IAAxBR,EAAMS,QAAQC,QACqBL,EAEhDM,EAAeX,EAAMY,uBAAyBZ,EAAMa,GACpDC,EAAwBH,GAAgBX,GAAOe,8BAA8BC,SAAS,aAG5F,GAAIL,IAAiBG,EAEjB,MAAM,IAAIG,EACNC,EACA,uGAIR,MAAO,IACAlB,EAEHmB,qBAAqBnB,EAAMoB,eAAwBpB,EAAMmB,mBAEzDE,SAAUrB,EAAOsB,OAAyB,SAAhBtB,EAAMsB,OAAqBtB,EAAMuB,SAE3DC,wBAAwBxB,EAAMY,uBAAgCZ,EAAMwB,uBAEpEC,mBAAoBzB,EAAM0B,gBAAkBC,EAAsBF,mBAAqBzB,EAAMyB,mBAE7FH,MAAOtB,EAAMsB,OAASM,EAAWC,KACjCC,YAAa9B,EAAM8B,YAAc9B,EAAM8B,YAAYC,cAAgB,KAGnExB,cAAe,IACRP,EAAMO,cACTyB,yBAA0BhC,EAAMO,eAAeyB,0BAA4B,QAE/EC,oBAAqBjC,EAAMiC,qBAAuBjC,EAAMO,eAAe0B,qBAAuB,CAAC,EAC/FC,KAA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qBrE,EAAIsE,WACjCI,oBAAqB1E,EAAI2E,UACzBC,uBAAwBC,EAAwB7E,EAAI2E,UAAWG,IACnE,IAGJjB,OAAOtB,aAAawC,EAAiBvJ,OAoErCqI,EAAArI,KAAmB6G,aAAa9G,IAC5B,MAAMyJ,EAA0C,IAA7BxJ,KAAKD,MAAMS,QAAQC,MAChCgJ,EAAezJ,KAAKD,MAAMY,uBAAuByE,OAAS,EAChE,OACIiB,EAACqD,EAAAA,IACO3J,EACJS,OAAQR,KAAKD,MAAMS,OACnBmJ,gBAAiB3J,KAAKD,MAAM4J,gBAC5BC,MAAOJ,IAAeC,EAAezJ,KAAKD,MAAM2C,KAAKuD,IAAI,yBAA2B,GACpF4D,QAAS7J,KAAK2G,YAtSlB5G,IAAUA,EAAM+J,qBAChB9J,KAAK4H,kBAAoBmC,EAAwB/J,KAAKD,MAAMO,cAAeN,KAAKD,MAAMoC,wBAAyBnC,KAAKD,MAAMiK,aACrHhK,KAAK4H,mBAAmBqC,aAErC,EAhBA5B,EADS1I,EACKsD,OAAOtB,EAAWuI,QAkBhC7B,EAnBS1I,EAmBQwK,eAAe,CAC5BC,qBAAqB,EACrBN,oBAAoB,EACpBO,aAAa,KAEV3F,EAAO,CAAC,OAAQ,oBAAoBC,KAAKjD"}
@@ -1,2 +1,2 @@
1
- import{createElement as r}from"../../../../../external/preact/dist/preact.js";import{getCardImageUrl as t,getFullBrandName as e}from"../utils.js";import a from"../../../../../core/Context/useImage.js";function n({brand:n,brandsConfiguration:o={}}){const c=a(),s="card"===n?"nocard":n,d=o[n]?.icon??t(s,c);return r("img",{className:"adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon",onError:r=>{r.target.style.cssText="display: none"},alt:e(n),src:d})}export{n as default};
1
+ import{createElement as r}from"../../../../../external/preact/dist/preact.js";import{getCardImageUrl as e,getFullBrandName as o}from"../utils.js";import a from"../../../../../core/Context/useImage.js";import{useState as t}from"../../../../../external/preact/hooks/dist/hooks.js";import n from"../../../../../external/classnames/index.js";function c({brand:c,brandsConfiguration:s={}}){const d=a(),i="card"===c?"nocard":c,m=s[c]?.icon??e(i,d),[u,p]=t(!1),_=n({"adyen-checkout-card-input__icon":!0,"adyen-checkout__card__cardNumber__brandIcon":!0,"adyen-checkout-card-input__icon--hidden":!u});return r("img",{className:_,onLoad:()=>{p(!0)},onError:()=>{p(!1)},alt:o(c),src:m})}export{c as default};
2
2
  //# sourceMappingURL=BrandIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrandIcon.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/BrandIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../utils';\nimport { BrandIconProps } from './types';\nimport useImage from '../../../../../core/Context/useImage';\n\nexport default function BrandIcon({ brand, brandsConfiguration = {} }: BrandIconProps) {\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageUrl = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n const handleError = e => {\n e.target.style.cssText = 'display: none';\n };\n\n return (\n <img\n className=\"adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon\"\n onError={handleError}\n alt={getFullBrandName(brand)}\n src={imageUrl}\n />\n );\n}\n"],"names":["BrandIcon","brand","brandsConfiguration","getImage","useImage","imageName","imageUrl","icon","getCardImageUrl","h","img","className","onError","e","target","style","cssText","alt","getFullBrandName","src"],"mappings":"yMAKe,SAASA,GAAUC,MAAEA,EAAKC,oBAAEA,EAAsB,CAAE,IAC/D,MAAMC,EAAWC,IACXC,EAAsB,SAAVJ,EAAmB,SAAWA,EAC1CK,EAAWJ,EAAoBD,IAAQM,MAAQC,EAAgBH,EAAWF,GAKhF,OACIM,EAACC,MAAAA,CACGC,UAAU,8EACVC,QAPYC,IAChBA,EAAEC,OAAOC,MAAMC,QAAU,eAAA,EAOrBC,IAAKC,EAAiBjB,GACtBkB,IAAKb,GAGjB"}
1
+ {"version":3,"file":"BrandIcon.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/BrandIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../utils';\nimport { BrandIconProps } from './types';\nimport useImage from '../../../../../core/Context/useImage';\nimport { useState } from 'preact/hooks';\nimport classNames from 'classnames';\n\nexport default function BrandIcon({ brand, brandsConfiguration = {} }: BrandIconProps) {\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageUrl = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n\n const [hasLoaded, setHasLoaded] = useState(false);\n\n const handleError = () => {\n setHasLoaded(false);\n };\n\n const handleLoad = () => {\n setHasLoaded(true);\n };\n\n const fieldClassnames = classNames({\n 'adyen-checkout-card-input__icon': true,\n 'adyen-checkout__card__cardNumber__brandIcon': true,\n 'adyen-checkout-card-input__icon--hidden': !hasLoaded\n });\n\n return <img className={fieldClassnames} onLoad={handleLoad} onError={handleError} alt={getFullBrandName(brand)} src={imageUrl} />;\n}\n"],"names":["BrandIcon","brand","brandsConfiguration","getImage","useImage","imageName","imageUrl","icon","getCardImageUrl","hasLoaded","setHasLoaded","useState","fieldClassnames","classNames","h","img","className","onLoad","onError","alt","getFullBrandName","src"],"mappings":"kVAOe,SAASA,GAAUC,MAAEA,EAAKC,oBAAEA,EAAsB,CAAE,IAC/D,MAAMC,EAAWC,IACXC,EAAsB,SAAVJ,EAAmB,SAAWA,EAC1CK,EAAWJ,EAAoBD,IAAQM,MAAQC,EAAgBH,EAAWF,IAEzEM,EAAWC,GAAgBC,GAAS,GAUrCC,EAAkBC,EAAW,CAC/B,mCAAmC,EACnC,+CAA+C,EAC/C,2CAA4CJ,IAGhD,OAAOK,EAACC,MAAAA,CAAIC,UAAWJ,EAAiBK,OAVrB,KACfP,GAAa,EAAA,EAS2CQ,QAdxC,KAChBR,GAAa,EAAA,EAaiES,IAAKC,EAAiBnB,GAAQoB,IAAKf,GACzH"}
@@ -1 +1 @@
1
- {"version":3,"file":"CVCHint.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVCHint.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport { CVCHintProps } from './types';\n\nexport default function CVCHint({ frontCVC = false, fieldLabel }: CVCHintProps) {\n const hintClassnames = classNames({\n 'adyen-checkout__card__cvc__hint__wrapper': true,\n 'adyen-checkout__field__cvc--front-hint': !!frontCVC,\n 'adyen-checkout__field__cvc--back-hint': !frontCVC\n });\n\n \n return (\n <span className={hintClassnames}>\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!frontCVC}\n aria-describedby={'adyen-checkout__cvc__front-hint-img'}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__front-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z\"\n fill=\"#E6E9EB\"\n />\n <rect x=\"4\" y=\"12\" width=\"19\" height=\"2\" fill=\"#B9C4C9\" />\n <rect x=\"4\" y=\"4\" width=\"4\" height=\"4\" rx=\"1\" fill=\"white\" />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"4.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!!frontCVC}\n aria-describedby={'adyen-checkout__cvc__back-hint-img'}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__back-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z\"\n fill=\"#E6E9EB\"\n />\n <path\n d=\"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z\"\n fill=\"#E6E9EB\"\n />\n <rect y=\"4.00012\" width=\"27\" height=\"3.00001\" fill=\"#687282\" />\n <path\n d=\"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z\"\n fill=\"white\"\n />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"9.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n </span>\n );\n \n}\n"],"names":["CVCHint","frontCVC","fieldLabel","hintClassnames","classNames","h","span","className","svg","width","height","viewBox","fill","xmlns","aria-hidden","aria-describedby","role","title","id","path","d","rect","x","y","rx","stroke"],"mappings":"yIAIe,SAASA,GAAQC,SAAEA,GAAW,EAAKC,WAAEA,IAChD,MAAMC,EAAiBC,EAAW,CAC9B,4CAA4C,EAC5C,2CAA4CH,EAC5C,yCAA0CA,IAI9C,OACII,EAACC,OAAAA,CAAKC,UAAWJ,GACbE,EAACG,MAAAA,CACGD,UAAW,yEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,eAAcb,EACdc,mBAAkB,sCAClBC,KAAM,OAENX,EAACY,QAAAA,CAAMC,GAAI,uCAAwChB,GACnDG,EAACc,OAAAA,CACGC,EAAE,0HACFR,KAAK,YAETP,EAACgB,OAAAA,CAAKC,EAAE,IAAIC,EAAE,KAAKd,MAAM,KAAKC,OAAO,IAAIE,KAAK,YAC9CP,EAACgB,OAAAA,CAAKC,EAAE,IAAIC,EAAE,IAAId,MAAM,IAAIC,OAAO,IAAIc,GAAG,IAAIZ,KAAK,UACnDP,EAACgB,OAAAA,CAAKd,UAAW,4CAA6Ce,EAAE,OAAOC,EAAE,MAAMd,MAAM,IAAIC,OAAO,IAAIc,GAAG,MAAMC,OAAO,aAGxHpB,EAACG,MAAAA,CACGD,UAAW,wEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,gBAAeb,EACfc,mBAAkB,qCAClBC,KAAM,OAENX,EAACY,QAAAA,CAAMC,GAAI,sCAAuChB,GAClDG,EAACc,OAAAA,CACGC,EAAE,wMACFR,KAAK,YAETP,EAACc,OAAAA,CACGC,EAAE,wMACFR,KAAK,YAETP,EAACgB,OAAAA,CAAKE,EAAE,UAAUd,MAAM,KAAKC,OAAO,UAAUE,KAAK,YACnDP,EAACc,OAAAA,CACGC,EAAE,6HACFR,KAAK,UAETP,EAACgB,OAAAA,CAAKd,UAAW,4CAA6Ce,EAAE,OAAOC,EAAE,MAAMd,MAAM,IAAIC,OAAO,IAAIc,GAAG,MAAMC,OAAO,aAKpI"}
1
+ {"version":3,"file":"CVCHint.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CVCHint.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport { CVCHintProps } from './types';\n\nexport default function CVCHint({ frontCVC = false, fieldLabel }: CVCHintProps) {\n const hintClassnames = classNames({\n 'adyen-checkout__card__cvc__hint__wrapper': true,\n 'adyen-checkout__field__cvc--front-hint': !!frontCVC,\n 'adyen-checkout__field__cvc--back-hint': !frontCVC\n });\n\n return (\n <span className={hintClassnames}>\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--front'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!frontCVC}\n aria-describedby={'adyen-checkout__cvc__front-hint-img'}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__front-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M0 3C0 1.34315 1.34315 0 3 0H24C25.6569 0 27 1.34315 27 3V15C27 16.6569 25.6569 18 24 18H3C1.34315 18 0 16.6569 0 15V3Z\"\n fill=\"#E6E9EB\"\n />\n <rect x=\"4\" y=\"12\" width=\"19\" height=\"2\" fill=\"#B9C4C9\" />\n <rect x=\"4\" y=\"4\" width=\"4\" height=\"4\" rx=\"1\" fill=\"white\" />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"4.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n\n <svg\n className={'adyen-checkout__card__cvc__hint adyen-checkout__card__cvc__hint--back'}\n width=\"27\"\n height=\"18\"\n viewBox=\"0 0 27 18\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden={!!frontCVC}\n aria-describedby={'adyen-checkout__cvc__back-hint-img'}\n role={'img'}\n >\n <title id={'adyen-checkout__cvc__back-hint-img'}>{fieldLabel}</title>\n <path\n d=\"M27 4.00001V3.37501C27 2.4799 26.6444 1.62146 26.0115 0.988518C25.3786 0.355581 24.5201 0 23.625 0H3.375C2.47989 0 1.62145 0.355581 0.988514 0.988518C0.355579 1.62146 0 2.4799 0 3.37501V4.00001H27Z\"\n fill=\"#E6E9EB\"\n />\n <path\n d=\"M0 6.99994V14.6666C0 15.5507 0.355579 16.3985 0.988514 17.0237C1.62145 17.6488 2.47989 18 3.375 18H23.625C24.5201 18 25.3786 17.6488 26.0115 17.0237C26.6444 16.3985 27 15.5507 27 14.6666V6.99994H0Z\"\n fill=\"#E6E9EB\"\n />\n <rect y=\"4.00012\" width=\"27\" height=\"3.00001\" fill=\"#687282\" />\n <path\n d=\"M4 11C4 10.4477 4.44772 10 5 10H21C22.1046 10 23 10.8954 23 12C23 13.1046 22.1046 14 21 14H5C4.44771 14 4 13.5523 4 13V11Z\"\n fill=\"white\"\n />\n <rect className={'adyen-checkout__card__cvc__hint__location'} x=\"16.5\" y=\"9.5\" width=\"7\" height=\"5\" rx=\"2.5\" stroke=\"#C12424\" />\n </svg>\n </span>\n );\n}\n"],"names":["CVCHint","frontCVC","fieldLabel","hintClassnames","classNames","h","span","className","svg","width","height","viewBox","fill","xmlns","aria-hidden","aria-describedby","role","title","id","path","d","rect","x","y","rx","stroke"],"mappings":"yIAIe,SAASA,GAAQC,SAAEA,GAAW,EAAKC,WAAEA,IAChD,MAAMC,EAAiBC,EAAW,CAC9B,4CAA4C,EAC5C,2CAA4CH,EAC5C,yCAA0CA,IAG9C,OACII,EAACC,OAAAA,CAAKC,UAAWJ,GACbE,EAACG,MAAAA,CACGD,UAAW,yEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,eAAcb,EACdc,mBAAkB,sCAClBC,KAAM,OAENX,EAACY,QAAAA,CAAMC,GAAI,uCAAwChB,GACnDG,EAACc,OAAAA,CACGC,EAAE,0HACFR,KAAK,YAETP,EAACgB,OAAAA,CAAKC,EAAE,IAAIC,EAAE,KAAKd,MAAM,KAAKC,OAAO,IAAIE,KAAK,YAC9CP,EAACgB,OAAAA,CAAKC,EAAE,IAAIC,EAAE,IAAId,MAAM,IAAIC,OAAO,IAAIc,GAAG,IAAIZ,KAAK,UACnDP,EAACgB,OAAAA,CAAKd,UAAW,4CAA6Ce,EAAE,OAAOC,EAAE,MAAMd,MAAM,IAAIC,OAAO,IAAIc,GAAG,MAAMC,OAAO,aAGxHpB,EAACG,MAAAA,CACGD,UAAW,wEACXE,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACNC,gBAAeb,EACfc,mBAAkB,qCAClBC,KAAM,OAENX,EAACY,QAAAA,CAAMC,GAAI,sCAAuChB,GAClDG,EAACc,OAAAA,CACGC,EAAE,wMACFR,KAAK,YAETP,EAACc,OAAAA,CACGC,EAAE,wMACFR,KAAK,YAETP,EAACgB,OAAAA,CAAKE,EAAE,UAAUd,MAAM,KAAKC,OAAO,UAAUE,KAAK,YACnDP,EAACc,OAAAA,CACGC,EAAE,6HACFR,KAAK,UAETP,EAACgB,OAAAA,CAAKd,UAAW,4CAA6Ce,EAAE,OAAOC,EAAE,MAAMd,MAAM,IAAIC,OAAO,IAAIc,GAAG,MAAMC,OAAO,aAIpI"}
@@ -1,2 +1,2 @@
1
- var l;!function(l){l.full="full",l.partial="partial",l.none="none"}(l||(l={}));export{l as AddressModeOptions};
1
+ var n=function(n){return n.full="full",n.partial="partial",n.none="none",n}({});export{n as AddressModeOptions};
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport { BinLookupResponse, BrandConfiguration, CardBrandsConfiguration, CardBackendConfiguration, DualBrandSelectElement } from '../../types';\nimport { InstallmentOptions } from './components/types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CbObjOnError, StylesObject } from '../../../internal/SecuredFields/lib/types';\nimport { Resources } from '../../../../core/Context/Resources';\nimport { SRPanel } from '../../../../core/Errors/SRPanel';\nimport RiskElement from '../../../../core/RiskModule';\nimport { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';\nimport { OnAddressLookupType, OnAddressSelectedType } from '../../../internal/Address/components/AddressSearch';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport { AddressData, PaymentAmount } from '../../../../types/global-types';\nimport { AnalyticsModule } from '../../../../types/global-types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\n\nexport interface CardInputValidState {\n holderName?: boolean;\n billingAddress?: boolean;\n socialSecurityNumber?: boolean;\n encryptedCardNumber?: boolean;\n encryptedExpiryMonth?: boolean;\n encryptedExpiryYear?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: boolean;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputErrorState {\n holderName?: ValidationResult;\n billingAddress?: ValidationResult;\n socialSecurityNumber?: ValidationResult;\n encryptedCardNumber?: boolean;\n encryptedExpiryDate?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: ValidationResult;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputDataState {\n holderName?: string;\n billingAddress?: AddressData;\n socialSecurityNumber?: string;\n taxNumber?: string;\n}\n\ntype PlaceholderKeys =\n | 'holderName'\n | 'cardNumber'\n | 'expiryDate'\n | 'expiryMonth'\n | 'expiryYear'\n | 'securityCodeThreeDigits'\n | 'securityCodeFourDigits'\n | 'password';\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\n\n/**\n * Should be the subset of the props sent to CardInput that are *actually* used by CardInput\n * - either in the comp itself or are passed on to its children\n */\nexport interface CardInputProps {\n amount?: PaymentAmount;\n isPayButtonPrimaryVariant?: boolean;\n autoFocus?: boolean;\n billingAddressAllowedCountries?: string[];\n billingAddressRequired?: boolean;\n billingAddressRequiredFields?: string[];\n billingAddressMode?: AddressModeOptions;\n brand?: string;\n brands?: string[];\n brandsConfiguration?: CardBrandsConfiguration;\n brandsIcons: Array<BrandConfiguration>;\n clientKey: string;\n configuration?: CardBackendConfiguration;\n countryCode?: string;\n cvcPolicy?: CVCPolicyType;\n data?: CardInputDataState;\n disableIOSArrowKeys?: boolean;\n enableStoreDetails?: boolean;\n expiryMonth?: string;\n expiryYear?: string;\n forceCompat?: boolean;\n fundingSource?: 'debit' | 'credit';\n hasCVC?: boolean;\n hasHolderName?: boolean;\n holderName?: string;\n holderNameRequired?: boolean;\n i18n?: Language;\n implementationType?: string;\n installmentOptions?: InstallmentOptions;\n keypadFix?: boolean;\n lastFour?: string;\n loadingContext: string;\n legacyInputMode?: boolean;\n minimumExpiryDate?: string;\n modules?: {\n srPanel: SRPanel;\n analytics: AnalyticsModule;\n risk: RiskElement;\n resources: Resources;\n };\n onAdditionalSFConfig?: () => {};\n onAdditionalSFRemoved?: () => {};\n onAllValid?: () => {};\n onAutoComplete?: () => {};\n onBinValue?: () => {};\n onBlur?: (e) => {};\n onBrand?: () => {};\n onConfigSuccess?: () => {};\n onChange?: (state) => {};\n onError?: () => {};\n onFieldValid?: () => {};\n onFocus?: (e) => {};\n onLoad?: () => {};\n handleKeyPress?: (obj: KeyboardEvent) => void;\n onAddressLookup?: OnAddressLookupType;\n onAddressSelected?: OnAddressSelectedType;\n addressSearchDebounceMs?: number;\n payButton?: (obj) => {};\n placeholders?: Placeholders;\n positionHolderNameOnTop?: boolean;\n resources: Resources;\n setComponentRef?: (ref) => void;\n showBrandIcon?: boolean;\n showInstallmentAmounts?: boolean;\n showPayButton: boolean;\n showStoreDetailsCheckbox?: boolean;\n showWarnings?: boolean;\n showContextualElement?: boolean;\n specifications?: Specifications;\n storedPaymentMethodId?: string;\n styles?: StylesObject;\n trimTrailingSeparator?: boolean;\n type?: string;\n maskSecurityCode?: boolean;\n exposeExpiryDate?: boolean;\n disclaimerMessage?: DisclaimerMsgObject;\n onValidationErrorAnalytics?: (obj: FieldErrorAnalyticsObject) => {};\n}\n\nexport interface CardInputState {\n dualBrandSelectElements: DualBrandSelectElement[];\n selectedBrandValue: string;\n billingAddress: object;\n brand?: string;\n data?: object;\n errors?: object;\n focusedElement: string;\n cvcPolicy: CVCPolicyType;\n expiryDatePolicy: DatePolicyType;\n isValid: boolean;\n status: string;\n valid?: object;\n issuingCountryCode: string;\n showSocialSecurityNumber?: boolean;\n}\n\n// An interface for the members exposed by CardInput to its parent Card/UIElement\nexport interface CardInputRef extends ComponentMethodsRef {\n sfp?: any;\n setFocusOn?: (who) => void;\n processBinLookupResponse?: (binLookupResponse: BinLookupResponse, isReset: boolean) => void;\n updateStyles?: (stylesObj: StylesObject) => void;\n handleUnsupportedCard?: (errObj: CbObjOnError) => boolean;\n}\n\nexport interface FieldError {\n errorMessage?: string;\n errorI18n?: string;\n}\n\nexport interface SFError {\n isValid?: boolean;\n errorMessage?: string;\n errorI18n?: string;\n error: string;\n rootNode: HTMLElement;\n detectedBrands?: string[];\n}\n\nexport interface SFStateErrorObj {\n [key: string]: SFError;\n}\n\nexport interface LayoutObj {\n props: CardInputProps;\n showKCP: boolean;\n showBrazilianSSN: boolean;\n countrySpecificSchemas: AddressSchema;\n billingAddressRequiredFields?: string[];\n}\n\nexport enum AddressModeOptions {\n full = 'full',\n partial = 'partial',\n none = 'none'\n}\n"],"names":["AddressModeOptions"],"mappings":"OAmMYA,SAAAA,mDAAAA,CAAAA,IAAAA,EAAAA,CAAAA"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport { BinLookupResponse, BrandConfiguration, CardBrandsConfiguration, CardBackendConfiguration, DualBrandSelectElement } from '../../types';\nimport { InstallmentOptions } from './components/types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CbObjOnError, StylesObject } from '../../../internal/SecuredFields/lib/types';\nimport { Resources } from '../../../../core/Context/Resources';\nimport { SRPanel } from '../../../../core/Errors/SRPanel';\nimport RiskElement from '../../../../core/RiskModule';\nimport { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';\nimport { OnAddressLookupType, OnAddressSelectedType } from '../../../internal/Address/components/AddressSearch';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport { AddressData, PaymentAmount } from '../../../../types/global-types';\nimport { AnalyticsModule } from '../../../../types/global-types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\n\nexport interface CardInputValidState {\n holderName?: boolean;\n billingAddress?: boolean;\n socialSecurityNumber?: boolean;\n encryptedCardNumber?: boolean;\n encryptedExpiryMonth?: boolean;\n encryptedExpiryYear?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: boolean;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputErrorState {\n holderName?: ValidationResult;\n billingAddress?: ValidationResult;\n socialSecurityNumber?: ValidationResult;\n encryptedCardNumber?: boolean;\n encryptedExpiryDate?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: ValidationResult;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputDataState {\n holderName?: string;\n billingAddress?: AddressData;\n socialSecurityNumber?: string;\n taxNumber?: string;\n}\n\ntype PlaceholderKeys =\n | 'holderName'\n | 'cardNumber'\n | 'expiryDate'\n | 'expiryMonth'\n | 'expiryYear'\n | 'securityCodeThreeDigits'\n | 'securityCodeFourDigits'\n | 'password';\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\n\n/**\n * Should be the subset of the props sent to CardInput that are *actually* used by CardInput\n * - either in the comp itself or are passed on to its children\n */\nexport interface CardInputProps {\n amount?: PaymentAmount;\n isPayButtonPrimaryVariant?: boolean;\n autoFocus?: boolean;\n billingAddressAllowedCountries?: string[];\n billingAddressRequired?: boolean;\n billingAddressRequiredFields?: string[];\n billingAddressMode?: AddressModeOptions;\n brand?: string;\n brands?: string[];\n brandsConfiguration?: CardBrandsConfiguration;\n brandsIcons: Array<BrandConfiguration>;\n clientKey: string;\n configuration?: CardBackendConfiguration;\n countryCode?: string;\n cvcPolicy?: CVCPolicyType;\n data?: CardInputDataState;\n disableIOSArrowKeys?: boolean;\n enableStoreDetails?: boolean;\n expiryMonth?: string;\n expiryYear?: string;\n forceCompat?: boolean;\n fundingSource?: 'debit' | 'credit';\n hasCVC?: boolean;\n hasHolderName?: boolean;\n holderName?: string;\n holderNameRequired?: boolean;\n i18n?: Language;\n implementationType?: string;\n installmentOptions?: InstallmentOptions;\n keypadFix?: boolean;\n lastFour?: string;\n loadingContext: string;\n legacyInputMode?: boolean;\n minimumExpiryDate?: string;\n modules?: {\n srPanel: SRPanel;\n analytics: AnalyticsModule;\n risk: RiskElement;\n resources: Resources;\n };\n onAdditionalSFConfig?: () => {};\n onAdditionalSFRemoved?: () => {};\n onAllValid?: () => {};\n onAutoComplete?: () => {};\n onBinValue?: () => {};\n onBlur?: (e) => {};\n onBrand?: () => {};\n onConfigSuccess?: () => {};\n onChange?: (state) => {};\n onError?: () => {};\n onFieldValid?: () => {};\n onFocus?: (e) => {};\n onLoad?: () => {};\n handleKeyPress?: (obj: KeyboardEvent) => void;\n onAddressLookup?: OnAddressLookupType;\n onAddressSelected?: OnAddressSelectedType;\n addressSearchDebounceMs?: number;\n payButton?: (obj) => {};\n placeholders?: Placeholders;\n positionHolderNameOnTop?: boolean;\n resources: Resources;\n setComponentRef?: (ref) => void;\n showBrandIcon?: boolean;\n showInstallmentAmounts?: boolean;\n showPayButton: boolean;\n showStoreDetailsCheckbox?: boolean;\n showWarnings?: boolean;\n showContextualElement?: boolean;\n specifications?: Specifications;\n storedPaymentMethodId?: string;\n styles?: StylesObject;\n trimTrailingSeparator?: boolean;\n type?: string;\n maskSecurityCode?: boolean;\n exposeExpiryDate?: boolean;\n disclaimerMessage?: DisclaimerMsgObject;\n onValidationErrorAnalytics?: (obj: FieldErrorAnalyticsObject) => {};\n}\n\nexport interface CardInputState {\n dualBrandSelectElements: DualBrandSelectElement[];\n selectedBrandValue: string;\n billingAddress: object;\n brand?: string;\n data?: object;\n errors?: object;\n focusedElement: string;\n cvcPolicy: CVCPolicyType;\n expiryDatePolicy: DatePolicyType;\n isValid: boolean;\n status: string;\n valid?: object;\n issuingCountryCode: string;\n showSocialSecurityNumber?: boolean;\n}\n\n// An interface for the members exposed by CardInput to its parent Card/UIElement\nexport interface CardInputRef extends ComponentMethodsRef {\n sfp?: any;\n setFocusOn?: (who) => void;\n processBinLookupResponse?: (binLookupResponse: BinLookupResponse, isReset: boolean) => void;\n updateStyles?: (stylesObj: StylesObject) => void;\n handleUnsupportedCard?: (errObj: CbObjOnError) => boolean;\n}\n\nexport interface FieldError {\n errorMessage?: string;\n errorI18n?: string;\n}\n\nexport interface SFError {\n isValid?: boolean;\n errorMessage?: string;\n errorI18n?: string;\n error: string;\n rootNode: HTMLElement;\n detectedBrands?: string[];\n}\n\nexport interface SFStateErrorObj {\n [key: string]: SFError;\n}\n\nexport interface LayoutObj {\n props: CardInputProps;\n showKCP: boolean;\n showBrazilianSSN: boolean;\n countrySpecificSchemas: AddressSchema;\n billingAddressRequiredFields?: string[];\n}\n\nexport enum AddressModeOptions {\n full = 'full',\n partial = 'partial',\n none = 'none'\n}\n"],"names":["AddressModeOptions"],"mappings":"AAmMO,IAAAA,EAAKA,SAAAA,GAAAA,uDAAAA,CAIX,CAJWA,CAIX,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CashAppPay.js","sources":["../../../../src/components/CashAppPay/CashAppPay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { CashAppComponent } from './components/CashAppComponent';\nimport CashAppService from './services/CashAppService';\nimport { CashAppSdkLoader } from './services/CashAppSdkLoader';\nimport { CashAppPayElementData, CashAppPayConfiguration, CashAppPayEventData } from './types';\nimport { ICashAppService } from './services/types';\nimport defaultProps from './defaultProps';\nimport RedirectButton from '../internal/RedirectButton';\nimport { payAmountLabel } from '../internal/PayButton';\nimport { TxVariants } from '../tx-variants';\nimport type { ICore } from '../../core/types';\nimport { PREFIX } from '../internal/Icon/constants';\n\nexport class CashAppPay extends UIElement<CashAppPayConfiguration> {\n public static type = TxVariants.cashapp;\n\n private readonly cashAppService: ICashAppService | undefined;\n\n protected static defaultProps = defaultProps;\n\n constructor(checkout: ICore, props?: CashAppPayConfiguration) {\n super(checkout, props);\n\n if (this.props.enableStoreDetails && this.props.storePaymentMethod) {\n console.warn(\n 'CashAppPay: enableStoreDetails AND storePaymentMethod configuration properties should not be used together. That can lead to undesired behavior.'\n );\n }\n\n if (this.props.storedPaymentMethodId) {\n return;\n }\n\n this.cashAppService = new CashAppService(new CashAppSdkLoader(), {\n storePaymentMethod: this.props.storePaymentMethod,\n useCashAppButtonUi: this.props.showPayButton,\n environment: this.props.environment,\n amount: this.props.amount,\n redirectURL: this.props.redirectURL,\n clientId: this.props.configuration?.clientId,\n scopeId: this.props.configuration?.scopeId,\n button: this.props.button,\n referenceId: this.props.referenceId\n });\n }\n\n public formatProps(props: CashAppPayConfiguration) {\n return {\n ...props,\n enableStoreDetails: props.session?.configuration?.enableStoreDetails || props.enableStoreDetails\n };\n }\n\n public formatData(): CashAppPayElementData {\n const { shopperWantsToStore, grantId, onFileGrantId, cashTag, customerId } = this.state.data || {};\n const { storePaymentMethod: storePaymentMethodSetByMerchant, storedPaymentMethodId } = this.props;\n\n /**\n * We include 'storePaymentMethod' flag if we either Display the Checkbox OR if it is non-sessions flow AND the merchant wants to store the payment method\n */\n const includeStorePaymentMethod = this.props.enableStoreDetails || (!this.props.session && storePaymentMethodSetByMerchant);\n\n if (storedPaymentMethodId) {\n return {\n paymentMethod: {\n type: CashAppPay.type,\n storedPaymentMethodId\n }\n };\n }\n\n const shouldAddOnFileProperties = onFileGrantId && cashTag;\n\n return {\n paymentMethod: {\n type: CashAppPay.type,\n ...(grantId && { grantId }),\n ...(customerId && { customerId }),\n ...(shouldAddOnFileProperties && { onFileGrantId, cashtag: cashTag })\n },\n ...(includeStorePaymentMethod && { storePaymentMethod: storePaymentMethodSetByMerchant || shopperWantsToStore })\n };\n }\n\n get displayName() {\n if (this.props.storedPaymentMethodId && this.props.cashtag) {\n return this.props.cashtag;\n }\n return this.props.name;\n }\n\n get additionalInfo() {\n return this.props.storedPaymentMethodId ? 'Cash App Pay' : '';\n }\n\n public submit = () => {\n const { onClick, storedPaymentMethodId } = this.props;\n\n if (storedPaymentMethodId) {\n super.submit();\n return;\n }\n\n let onClickPromiseRejected = false;\n\n new Promise<void>((resolve, reject) => onClick({ resolve, reject }))\n .catch(() => {\n onClickPromiseRejected = true;\n throw Error('onClick rejected');\n })\n .then(() => {\n return this.cashAppService.createCustomerRequest();\n })\n .then(() => {\n this.cashAppService.begin();\n })\n .catch(error => {\n if (onClickPromiseRejected) {\n // Swallow exception triggered by onClick reject\n return;\n }\n this.handleError(error);\n });\n };\n\n public get isValid(): boolean {\n return true;\n }\n\n private handleOnChangeStoreDetails = (storePayment: boolean) => {\n const data = { ...this.state.data, shopperWantsToStore: storePayment };\n this.setState({ data });\n };\n\n private handleAuthorize = (cashAppPaymentData: CashAppPayEventData): void => {\n const data = { ...this.state.data, ...cashAppPaymentData };\n this.setState({ data, valid: {}, errors: {}, isValid: true });\n super.submit();\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} resources={this.resources} loadingContext={this.props.loadingContext}>\n {this.props.storedPaymentMethodId ? (\n <RedirectButton\n showPayButton={this.props.showPayButton}\n label={payAmountLabel(this.props.i18n, this.props.amount)}\n icon={this.resources?.getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)}\n name={this.displayName}\n amount={this.props.amount}\n payButton={this.payButton}\n onSubmit={this.submit}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n ) : (\n <CashAppComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n enableStoreDetails={this.props.enableStoreDetails}\n cashAppService={this.cashAppService}\n onChangeStoreDetails={this.handleOnChangeStoreDetails}\n onError={this.handleError}\n onClick={this.submit}\n onAuthorize={this.handleAuthorize}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default CashAppPay;\n"],"names":["CashAppPay","UIElement","formatProps","props","enableStoreDetails","session","configuration","formatData","shopperWantsToStore","grantId","onFileGrantId","cashTag","customerId","this","state","data","storePaymentMethod","storePaymentMethodSetByMerchant","storedPaymentMethodId","includeStorePaymentMethod","paymentMethod","type","cashtag","displayName","name","additionalInfo","isValid","render","h","CoreProvider","i18n","resources","loadingContext","RedirectButton","showPayButton","label","payAmountLabel","amount","icon","getImage","imageFolder","PREFIX","payButton","onSubmit","submit","ref","componentRef","CashAppComponent","cashAppService","onChangeStoreDetails","handleOnChangeStoreDetails","onError","handleError","onClick","onAuthorize","handleAuthorize","constructor","checkout","super","_define_property","onClickPromiseRejected","Promise","resolve","reject","catch","Error","then","createCustomerRequest","begin","error","storePayment","setState","cashAppPaymentData","valid","errors","console","warn","CashAppService","CashAppSdkLoader","useCashAppButtonUi","environment","redirectURL","clientId","scopeId","button","referenceId","TxVariants","cashapp","defaultProps"],"mappings":"wxBAeO,MAAMA,UAAmBC,EAiCrBC,WAAAA,CAAYC,GACf,MAAO,IACAA,EACHC,mBAAoBD,EAAME,SAASC,eAAeF,oBAAsBD,EAAMC,mBAEtF,CAEOG,UAAAA,GACH,MAAMC,oBAAEA,EAAmBC,QAAEA,EAAOC,cAAEA,EAAaC,QAAEA,EAAOC,WAAEA,GAAeC,KAAKC,MAAMC,MAAQ,IACxFC,mBAAoBC,EAA+BC,sBAAEA,GAA0BL,KAAKV,MAKtFgB,EAA4BN,KAAKV,MAAMC,qBAAwBS,KAAKV,MAAME,SAAWY,EAE3F,GAAIC,EACA,MAAO,CACHE,cAAe,CACXC,KAAMrB,EAAWqB,KACjBH,0BAOZ,MAAO,CACHE,cAAe,CACXC,KAAMrB,EAAWqB,QACbZ,GAAW,CAAEA,cACbG,GAAc,CAAEA,iBANMF,GAAiBC,GAOV,CAAED,gBAAeY,QAASX,OAE3DQ,GAA6B,CAAEH,mBAAoBC,GAAmCT,GAElG,CAEA,eAAIe,GACA,OAAIV,KAAKV,MAAMe,uBAAyBL,KAAKV,MAAMmB,QACxCT,KAAKV,MAAMmB,QAEfT,KAAKV,MAAMqB,IACtB,CAEA,kBAAIC,GACA,OAAOZ,KAAKV,MAAMe,sBAAwB,eAAiB,EAC/D,CAgCA,WAAWQ,GACP,OAAO,CACX,CAaA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B,IAClC,MAAMvD,EAAO,IAAKF,KAAKC,MAAMC,KAAMP,oBAAqB8D,GACxDzD,KAAK0D,SAAS,CAAExD,QAAK,IAGzB4C,EAAA9C,KAAQ0C,mBAAmBiB,IACvB,MAAMzD,EAAO,IAAKF,KAAKC,MAAMC,QAASyD,GACtC3D,KAAK0D,SAAS,CAAExD,OAAM0D,MAAO,CAAC,EAAGC,OAAQ,CAAC,EAAGhD,SAAS,IACtDgC,MAAMd,QAAAA,IAlHF/B,KAAKV,MAAMC,oBAAsBS,KAAKV,MAAMa,oBAC5C2D,QAAQC,KACJ,oJAIJ/D,KAAKV,MAAMe,wBAIfL,KAAKmC,eAAiB,IAAI6B,EAAe,IAAIC,EAAoB,CAC7D9D,mBAAoBH,KAAKV,MAAMa,mBAC/B+D,mBAAoBlE,KAAKV,MAAM+B,cAC/B8C,YAAanE,KAAKV,MAAM6E,YACxB3C,OAAQxB,KAAKV,MAAMkC,OACnB4C,YAAapE,KAAKV,MAAM8E,YACxBC,SAAUrE,KAAKV,MAAMG,eAAe4E,SACpCC,QAAStE,KAAKV,MAAMG,eAAe6E,QACnCC,OAAQvE,KAAKV,MAAMiF,OACnBC,YAAaxE,KAAKV,MAAMkF,cAEhC,EA9BA1B,EADS3D,EACKqB,OAAOiE,EAAWC,SAIhC5B,EALS3D,EAKQwF,eAAeA"}
1
+ {"version":3,"file":"CashAppPay.js","sources":["../../../../src/components/CashAppPay/CashAppPay.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { CashAppComponent } from './components/CashAppComponent';\nimport CashAppService from './services/CashAppService';\nimport { CashAppSdkLoader } from './services/CashAppSdkLoader';\nimport { CashAppPayElementData, CashAppPayConfiguration, CashAppPayEventData } from './types';\nimport { ICashAppService } from './services/types';\nimport defaultProps from './defaultProps';\nimport RedirectButton from '../internal/RedirectButton';\nimport { payAmountLabel } from '../internal/PayButton';\nimport { TxVariants } from '../tx-variants';\nimport type { ICore } from '../../core/types';\nimport { PREFIX } from '../internal/Icon/constants';\n\nexport class CashAppPay extends UIElement<CashAppPayConfiguration> {\n public static type = TxVariants.cashapp;\n\n private readonly cashAppService: ICashAppService | undefined;\n\n protected static defaultProps = defaultProps;\n\n constructor(checkout: ICore, props?: CashAppPayConfiguration) {\n super(checkout, props);\n\n if (this.props.enableStoreDetails && this.props.storePaymentMethod) {\n console.warn(\n 'CashAppPay: enableStoreDetails AND storePaymentMethod configuration properties should not be used together. That can lead to undesired behavior.'\n );\n }\n\n if (this.props.storedPaymentMethodId) {\n return;\n }\n\n this.cashAppService = new CashAppService(new CashAppSdkLoader(), {\n storePaymentMethod: this.props.storePaymentMethod,\n useCashAppButtonUi: this.props.showPayButton,\n environment: this.props.environment,\n amount: this.props.amount,\n redirectURL: this.props.redirectURL,\n clientId: this.props.configuration?.clientId,\n scopeId: this.props.configuration?.scopeId,\n button: this.props.button,\n referenceId: this.props.referenceId\n });\n }\n\n public formatProps(props: CashAppPayConfiguration) {\n return {\n ...props,\n enableStoreDetails: props.session?.configuration?.enableStoreDetails || props.enableStoreDetails\n };\n }\n\n public formatData(): CashAppPayElementData {\n const { shopperWantsToStore, grantId, onFileGrantId, cashTag, customerId } = this.state.data || {};\n const { storePaymentMethod: storePaymentMethodSetByMerchant, storedPaymentMethodId } = this.props;\n\n /**\n * We include 'storePaymentMethod' flag if we either Display the Checkbox OR if it is non-sessions flow AND the merchant wants to store the payment method\n */\n const includeStorePaymentMethod = this.props.enableStoreDetails || (!this.props.session && storePaymentMethodSetByMerchant);\n\n if (storedPaymentMethodId) {\n return {\n paymentMethod: {\n type: CashAppPay.type,\n storedPaymentMethodId\n }\n };\n }\n\n const shouldAddOnFileProperties = onFileGrantId && cashTag;\n\n return {\n paymentMethod: {\n type: CashAppPay.type,\n ...(grantId && { grantId }),\n ...(customerId && { customerId }),\n ...(shouldAddOnFileProperties && { onFileGrantId, cashtag: cashTag })\n },\n ...(includeStorePaymentMethod && { storePaymentMethod: storePaymentMethodSetByMerchant || shopperWantsToStore })\n };\n }\n\n get displayName() {\n if (this.props.storedPaymentMethodId && this.props.cashtag) {\n return this.props.cashtag;\n }\n return this.props.name;\n }\n\n get additionalInfo() {\n return this.props.storedPaymentMethodId ? 'Cash App Pay' : '';\n }\n\n public submit = () => {\n const { onClick, storedPaymentMethodId } = this.props;\n\n if (storedPaymentMethodId) {\n super.submit();\n return;\n }\n\n let onClickPromiseRejected = false;\n\n new Promise<void>((resolve, reject) => onClick({ resolve, reject }))\n .catch(() => {\n onClickPromiseRejected = true;\n throw Error('onClick rejected');\n })\n .then(() => {\n return this.cashAppService.createCustomerRequest();\n })\n .then(() => {\n this.cashAppService.begin();\n })\n .catch(error => {\n if (onClickPromiseRejected) {\n // Swallow exception triggered by onClick reject\n return;\n }\n this.handleError(error);\n });\n };\n\n public get isValid(): boolean {\n return true;\n }\n\n private handleOnChangeStoreDetails = (storePayment: boolean) => {\n const data = { ...this.state.data, shopperWantsToStore: storePayment };\n this.setState({ data });\n };\n\n private handleAuthorize = (cashAppPaymentData: CashAppPayEventData): void => {\n const data = { ...this.state.data, ...cashAppPaymentData };\n this.setState({ data, valid: {}, errors: {}, isValid: true });\n super.submit();\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} resources={this.resources} loadingContext={this.props.loadingContext}>\n {this.props.storedPaymentMethodId ? (\n <RedirectButton\n showPayButton={this.props.showPayButton}\n label={payAmountLabel(this.props.i18n, this.props.amount)}\n icon={this.resources?.getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)}\n name={this.displayName}\n amount={this.props.amount}\n payButton={this.payButton}\n onSubmit={this.submit}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n ) : (\n <CashAppComponent\n ref={ref => {\n this.componentRef = ref;\n }}\n enableStoreDetails={this.props.enableStoreDetails}\n cashAppService={this.cashAppService}\n onChangeStoreDetails={this.handleOnChangeStoreDetails}\n onError={this.handleError}\n onClick={this.submit}\n onAuthorize={this.handleAuthorize}\n />\n )}\n </CoreProvider>\n );\n }\n}\n\nexport default CashAppPay;\n"],"names":["CashAppPay","UIElement","formatProps","props","enableStoreDetails","session","configuration","formatData","shopperWantsToStore","grantId","onFileGrantId","cashTag","customerId","this","state","data","storePaymentMethod","storePaymentMethodSetByMerchant","storedPaymentMethodId","includeStorePaymentMethod","paymentMethod","type","cashtag","displayName","name","additionalInfo","isValid","render","h","CoreProvider","i18n","resources","loadingContext","RedirectButton","showPayButton","label","payAmountLabel","amount","icon","getImage","imageFolder","PREFIX","payButton","onSubmit","submit","ref","componentRef","CashAppComponent","cashAppService","onChangeStoreDetails","handleOnChangeStoreDetails","onError","handleError","onClick","onAuthorize","handleAuthorize","constructor","checkout","super","_define_property","onClickPromiseRejected","Promise","resolve","reject","catch","Error","then","createCustomerRequest","begin","error","storePayment","setState","cashAppPaymentData","valid","errors","console","warn","CashAppService","CashAppSdkLoader","useCashAppButtonUi","environment","redirectURL","clientId","scopeId","button","referenceId","TxVariants","cashapp","defaultProps"],"mappings":"wxBAeO,MAAMA,UAAmBC,EAiCrBC,WAAAA,CAAYC,GACf,MAAO,IACAA,EACHC,mBAAoBD,EAAME,SAASC,eAAeF,oBAAsBD,EAAMC,mBAEtF,CAEOG,UAAAA,GACH,MAAMC,oBAAEA,EAAmBC,QAAEA,EAAOC,cAAEA,EAAaC,QAAEA,EAAOC,WAAEA,GAAeC,KAAKC,MAAMC,MAAQ,IACxFC,mBAAoBC,EAA+BC,sBAAEA,GAA0BL,KAAKV,MAKtFgB,EAA4BN,KAAKV,MAAMC,qBAAwBS,KAAKV,MAAME,SAAWY,EAE3F,GAAIC,EACA,MAAO,CACHE,cAAe,CACXC,KAAMrB,EAAWqB,KACjBH,0BAOZ,MAAO,CACHE,cAAe,CACXC,KAAMrB,EAAWqB,QACbZ,GAAW,CAAEA,cACbG,GAAc,CAAEA,iBANMF,GAAiBC,GAOV,CAAED,gBAAeY,QAASX,OAE3DQ,GAA6B,CAAEH,mBAA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rDC,OAAM,KAEH,MADAJ,GAAyB,EACnBK,MAAM,mBAAA,IAEfC,MAAK,IACKrD,KAAKmC,eAAemB,0BAE9BD,MAAK,KACFrD,KAAKmC,eAAeoB,OAAK,IAE5BJ,OAAMK,IACCT,GAIJ/C,KAAKuC,YAAYiB,EAAAA,GACrB,IAORV,EAAA9C,KAAQqC,8BAA8BoB,IAClC,MAAMvD,EAAO,IAAKF,KAAKC,MAAMC,KAAMP,oBAAqB8D,GACxDzD,KAAK0D,SAAS,CAAExD,QAAK,IAGzB4C,EAAA9C,KAAQ0C,mBAAmBiB,IACvB,MAAMzD,EAAO,IAAKF,KAAKC,MAAMC,QAASyD,GACtC3D,KAAK0D,SAAS,CAAExD,OAAM0D,MAAO,CAAC,EAAGC,OAAQ,CAAC,EAAGhD,SAAS,IACtDgC,MAAMd,QAAAA,IAlHF/B,KAAKV,MAAMC,oBAAsBS,KAAKV,MAAMa,oBAC5C2D,QAAQC,KACJ,oJAIJ/D,KAAKV,MAAMe,wBAIfL,KAAKmC,eAAiB,IAAI6B,EAAe,IAAIC,EAAoB,CAC7D9D,mBAAoBH,KAAKV,MAAMa,mBAC/B+D,mBAAoBlE,KAAKV,MAAM+B,cAC/B8C,YAAanE,KAAKV,MAAM6E,YACxB3C,OAAQxB,KAAKV,MAAMkC,OACnB4C,YAAapE,KAAKV,MAAM8E,YACxBC,SAAUrE,KAAKV,MAAMG,eAAe4E,SACpCC,QAAStE,KAAKV,MAAMG,eAAe6E,QACnCC,OAAQvE,KAAKV,MAAMiF,OACnBC,YAAaxE,KAAKV,MAAMkF,cAEhC,EA9BA1B,EADS3D,EACKqB,OAAOiE,EAAWC,SAIhC5B,EALS3D,EAKQwF,eAAeA"}
@@ -1,2 +1,2 @@
1
- var e;!function(e){e.CustomerDismissed="CUSTOMER_DISMISSED",e.CustomerRequestApproved="CUSTOMER_REQUEST_APPROVED",e.CustomerRequestDeclined="CUSTOMER_REQUEST_DECLINED",e.CustomerRequestFailed="CUSTOMER_REQUEST_FAILED"}(e||(e={}));export{e as CashAppPayEvents};
1
+ var e=function(e){return e.CustomerDismissed="CUSTOMER_DISMISSED",e.CustomerRequestApproved="CUSTOMER_REQUEST_APPROVED",e.CustomerRequestDeclined="CUSTOMER_REQUEST_DECLINED",e.CustomerRequestFailed="CUSTOMER_REQUEST_FAILED",e}({});export{e as CashAppPayEvents};
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../src/components/CashAppPay/services/types.ts"],"sourcesContent":["import { PaymentAmount } from '../../../types/global-types';\n\nexport interface ICashAppWindowObject {\n pay({ clientId }: { clientId: string }): Promise<ICashAppSDK>;\n}\n\n/**\n * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference\n */\nexport interface ICashAppSDK {\n render(target: string | HTMLElement, options?: any): Promise<{ begin?: () => void }>;\n addEventListener(eventType: CashAppPayEvents, callback: Function): void;\n removeEventListener(eventType: CashAppPayEvents, callback: Function): void;\n customerRequest(customerRequest: any): Promise<void>;\n restart(): Promise<void>;\n}\n\nexport enum CashAppPayEvents {\n CustomerDismissed = 'CUSTOMER_DISMISSED',\n CustomerRequestApproved = 'CUSTOMER_REQUEST_APPROVED',\n CustomerRequestDeclined = 'CUSTOMER_REQUEST_DECLINED',\n CustomerRequestFailed = 'CUSTOMER_REQUEST_FAILED'\n}\n\nexport interface ICashAppService {\n begin(): void;\n initialize(): Promise<void>;\n setStorePaymentMethod(store: boolean): void;\n renderButton(target: HTMLElement): Promise<void>;\n restart(): Promise<void>;\n createCustomerRequest(): Promise<void>;\n subscribeToEvent(eventType: CashAppPayEvents, callback: Function): Function;\n}\n\nexport type CashAppServiceConfig = {\n useCashAppButtonUi: boolean;\n storePaymentMethod: boolean;\n environment: string;\n clientId: string;\n scopeId: string;\n amount: PaymentAmount;\n referenceId?: string;\n redirectURL?: string;\n button?: {\n shape?: 'semiround' | 'round';\n size?: 'medium' | 'small';\n theme?: 'dark' | 'light';\n width?: 'static' | 'full';\n };\n};\n"],"names":["CashAppPayEvents"],"mappings":"OAiBYA,SAAAA,0MAAAA,CAAAA,IAAAA,EAAAA,CAAAA"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/components/CashAppPay/services/types.ts"],"sourcesContent":["import { PaymentAmount } from '../../../types/global-types';\n\nexport interface ICashAppWindowObject {\n pay({ clientId }: { clientId: string }): Promise<ICashAppSDK>;\n}\n\n/**\n * https://developers.cash.app/docs/api/technical-documentation/sdks/pay-kit/technical-reference\n */\nexport interface ICashAppSDK {\n render(target: string | HTMLElement, options?: any): Promise<{ begin?: () => void }>;\n addEventListener(eventType: CashAppPayEvents, callback: Function): void;\n removeEventListener(eventType: CashAppPayEvents, callback: Function): void;\n customerRequest(customerRequest: any): Promise<void>;\n restart(): Promise<void>;\n}\n\nexport enum CashAppPayEvents {\n CustomerDismissed = 'CUSTOMER_DISMISSED',\n CustomerRequestApproved = 'CUSTOMER_REQUEST_APPROVED',\n CustomerRequestDeclined = 'CUSTOMER_REQUEST_DECLINED',\n CustomerRequestFailed = 'CUSTOMER_REQUEST_FAILED'\n}\n\nexport interface ICashAppService {\n begin(): void;\n initialize(): Promise<void>;\n setStorePaymentMethod(store: boolean): void;\n renderButton(target: HTMLElement): Promise<void>;\n restart(): Promise<void>;\n createCustomerRequest(): Promise<void>;\n subscribeToEvent(eventType: CashAppPayEvents, callback: Function): Function;\n}\n\nexport type CashAppServiceConfig = {\n useCashAppButtonUi: boolean;\n storePaymentMethod: boolean;\n environment: string;\n clientId: string;\n scopeId: string;\n amount: PaymentAmount;\n referenceId?: string;\n redirectURL?: string;\n button?: {\n shape?: 'semiround' | 'round';\n size?: 'medium' | 'small';\n theme?: 'dark' | 'light';\n width?: 'static' | 'full';\n };\n};\n"],"names":["CashAppPayEvents"],"mappings":"AAiBO,IAAAA,EAAKA,SAAAA,GAAAA,8MAAAA,CAKX,CALWA,CAKX,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomCard.js","sources":["../../../../src/components/CustomCard/CustomCard.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement';\nimport CustomCardInput from './CustomCardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { BrandObject } from '../Card/types';\nimport { getCardImageUrl, fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { TxVariants } from '../tx-variants';\nimport { CustomCardConfiguration } from './types';\nimport { ANALYTICS_FOCUS_STR, ANALYTICS_UNFOCUS_STR } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\n\n// TODO questions about\n// brand - does a merchant ever make a custom stored card?\n// type\n// countryCode\n\nexport class CustomCard extends UIElement<CustomCardConfiguration> {\n public static type = TxVariants.customCard;\n\n public static analyticsType = 'custom-scheme';\n\n protected static defaultProps = {\n onBinLookup: () => {},\n brandsConfiguration: {}\n };\n\n formatProps(props: CustomCardConfiguration) {\n return {\n ...props,\n type: TxVariants.customCard,\n brand: TxVariants.card\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const sfBrand = this.state.selectedBrandValue;\n return {\n paymentMethod: {\n type: 'scheme',\n ...this.state.data,\n ...(sfBrand && { brand: sfBrand })\n },\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(frame) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(frame);\n return this;\n }\n\n processBinLookupResponse(binLookupResponse) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse);\n return this;\n }\n\n dualBrandingChangeHandler(e: Event | string) {\n if (this.componentRef?.dualBrandingChangeHandler) this.componentRef.dualBrandingChangeHandler(e);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n onBinLookup(obj: CbObjOnBinLookup) {\n const nuObj = { ...obj };\n nuObj.rootNode = this._node;\n\n if (!nuObj.isReset) {\n // Add brandImage urls, first checking if the merchant has configured their own one for the brand\n nuObj.supportedBrandsRaw = obj.supportedBrandsRaw?.map((item: BrandObject) => {\n item.brandImageUrl = this.props.brandsConfiguration[item.brand]?.icon ?? getCardImageUrl(item.brand, this.resources);\n return item;\n });\n }\n\n this.props.onBinLookup(nuObj);\n }\n\n public onBinValue = triggerBinLookUp(this);\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n private onFocus = (obj: CbObjOnFocus) => {\n this.submitAnalytics({\n type: obj.focus === true ? ANALYTICS_FOCUS_STR : ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n this.props.onFocus?.(obj);\n };\n\n protected onEnterKeyPressed = (activeElement: Element, component: UIElement) => {\n this.props.onEnterKeyPressed?.(activeElement, component);\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <CustomCardInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n {...this.state}\n handleKeyPress={this.handleKeyPress}\n rootNode={this._node}\n onChange={this.setState}\n onBinValue={this.onBinValue}\n implementationType={'custom'}\n resources={this.resources}\n brand={this.props.brand}\n onFocus={this.onFocus}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default CustomCard;\n"],"names":["CustomCard","UIElement","formatProps","props","type","TxVariants","customCard","brand","card","formatData","sfBrand","this","state","selectedBrandValue","paymentMethod","data","browserInfo","origin","window","location","submitAnalytics","analyticsObj","super","updateStyles","stylesObj","componentRef","setFocusOn","frame","processBinLookupResponse","binLookupResponse","dualBrandingChangeHandler","e","handleUnsupportedCard","errObj","onBinLookup","obj","nuObj","rootNode","_node","isReset","supportedBrandsRaw","map","item","brandImageUrl","brandsConfiguration","icon","getCardImageUrl","resources","isValid","collectBrowserInfo","render","h","CoreProvider","i18n","loadingContext","CustomCardInput","ref","handleKeyPress","onChange","setState","onBinValue","implementationType","onFocus","_define_property","triggerBinLookUp","focus","ANALYTICS_FOCUS_STR","ANALYTICS_UNFOCUS_STR","target","fieldTypeToSnakeCase","fieldType","onEnterKeyPressed","activeElement","component","analyticsType","defaultProps"],"mappings":"otBAmBO,MAAMA,UAAmBC,EAU5BC,WAAAA,CAAYC,GACR,MAAO,IACAA,EACHC,KAAMC,EAAWC,WACjBC,MAAOF,EAAWG,KAE1B,CAKAC,UAAAA,GACI,MAAMC,EAAUC,KAAKC,MAAMC,mBAC3B,MAAO,CACHC,cAAe,CACXV,KAAM,YACHO,KAAKC,MAAMG,QACVL,GAAW,CAAEH,MAAOG,IAE5BM,YAAaL,KAAKK,YAClBC,SAAUC,QAAUA,OAAOC,SAASF,OAE5C,CAEUG,eAAAA,CAAgBC,GACtBC,MAAMF,gBAAgBC,EAAcV,KAAKR,MAC7C,CAEAoB,YAAAA,CAAaC,GAET,OADIb,KAAKc,cAAcF,cAAcZ,KAAKc,aAAaF,aAAaC,GAC7Db,IACX,CAEAe,UAAAA,CAAWC,GAEP,OADIhB,KAAKc,cAAcC,YAAYf,KAAKc,aAAaC,WAAWC,GACzDhB,IACX,CAEAiB,wBAAAA,CAAyBC,GAErB,OADIlB,KAAKc,cAAcG,0BAA0BjB,KAAKc,aAAaG,yBAAyBC,GACrFlB,IACX,CAEAmB,yBAAAA,CAA0BC,GAEtB,OADIpB,KAAKc,cAAcK,2BAA2BnB,KAAKc,aAAaK,0BAA0BC,GACvFpB,IACX,CAEAqB,qBAAAA,CAAsBC,GAElB,OAD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HS/D,EAGK0E,gBAAgB,iBAE9BX,EALS/D,EAKQ2E,eAAe,CAC5BzC,YAAa,OACbU,oBAAqB,CAAC"}
1
+ {"version":3,"file":"CustomCard.js","sources":["../../../../src/components/CustomCard/CustomCard.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement';\nimport CustomCardInput from './CustomCardInput';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport collectBrowserInfo from '../../utils/browserInfo';\nimport triggerBinLookUp from '../internal/SecuredFields/binLookup/triggerBinLookUp';\nimport { CbObjOnBinLookup, CbObjOnFocus } from '../internal/SecuredFields/lib/types';\nimport { BrandObject } from '../Card/types';\nimport { getCardImageUrl, fieldTypeToSnakeCase } from '../internal/SecuredFields/utils';\nimport { TxVariants } from '../tx-variants';\nimport { CustomCardConfiguration } from './types';\nimport { ANALYTICS_FOCUS_STR, ANALYTICS_UNFOCUS_STR } from '../../core/Analytics/constants';\nimport { SendAnalyticsObject } from '../../core/Analytics/types';\n\n// TODO questions about\n// brand - does a merchant ever make a custom stored card?\n// type\n// countryCode\n\nexport class CustomCard extends UIElement<CustomCardConfiguration> {\n public static type = TxVariants.customCard;\n\n public static analyticsType = 'custom-scheme';\n\n protected static defaultProps = {\n onBinLookup: () => {},\n brandsConfiguration: {}\n };\n\n formatProps(props: CustomCardConfiguration) {\n return {\n ...props,\n type: TxVariants.customCard,\n brand: TxVariants.card\n };\n }\n\n /**\n * Formats the component data output\n */\n formatData() {\n const sfBrand = this.state.selectedBrandValue;\n return {\n paymentMethod: {\n type: 'scheme',\n ...this.state.data,\n ...(sfBrand && { brand: sfBrand })\n },\n browserInfo: this.browserInfo,\n origin: !!window && window.location.origin\n };\n }\n\n protected submitAnalytics(analyticsObj: SendAnalyticsObject) {\n super.submitAnalytics(analyticsObj, this.props);\n }\n\n updateStyles(stylesObj) {\n if (this.componentRef?.updateStyles) this.componentRef.updateStyles(stylesObj);\n return this;\n }\n\n setFocusOn(frame) {\n if (this.componentRef?.setFocusOn) this.componentRef.setFocusOn(frame);\n return this;\n }\n\n processBinLookupResponse(binLookupResponse) {\n if (this.componentRef?.processBinLookupResponse) this.componentRef.processBinLookupResponse(binLookupResponse);\n return this;\n }\n\n dualBrandingChangeHandler(e: Event | string) {\n if (this.componentRef?.dualBrandingChangeHandler) this.componentRef.dualBrandingChangeHandler(e);\n return this;\n }\n\n handleUnsupportedCard(errObj) {\n if (this.componentRef?.handleUnsupportedCard) this.componentRef.handleUnsupportedCard(errObj);\n return this;\n }\n\n onBinLookup(obj: CbObjOnBinLookup) {\n const nuObj = { ...obj };\n nuObj.rootNode = this._node;\n\n if (!nuObj.isReset) {\n // Add brandImage urls, first checking if the merchant has configured their own one for the brand\n nuObj.supportedBrandsRaw = obj.supportedBrandsRaw?.map((item: BrandObject) => {\n item.brandImageUrl = this.props.brandsConfiguration[item.brand]?.icon ?? getCardImageUrl(item.brand, this.resources);\n return item;\n });\n }\n\n this.props.onBinLookup(nuObj);\n }\n\n public onBinValue = triggerBinLookUp(this);\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n get browserInfo() {\n return collectBrowserInfo();\n }\n\n private onFocus = (obj: CbObjOnFocus) => {\n this.submitAnalytics({\n type: obj.focus === true ? ANALYTICS_FOCUS_STR : ANALYTICS_UNFOCUS_STR,\n target: fieldTypeToSnakeCase(obj.fieldType)\n });\n\n // Call merchant defined callback\n this.props.onFocus?.(obj);\n };\n\n protected onEnterKeyPressed = (activeElement: Element, component: UIElement) => {\n this.props.onEnterKeyPressed?.(activeElement, component);\n };\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <CustomCardInput\n ref={ref => {\n this.componentRef = ref;\n }}\n {...this.props}\n {...this.state}\n handleKeyPress={this.handleKeyPress}\n rootNode={this._node}\n onChange={this.setState}\n onBinValue={this.onBinValue}\n implementationType={'custom'}\n resources={this.resources}\n brand={this.props.brand}\n onFocus={this.onFocus}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default CustomCard;\n"],"names":["CustomCard","UIElement","formatProps","props","type","TxVariants","customCard","brand","card","formatData","sfBrand","this","state","selectedBrandValue","paymentMethod","data","browserInfo","origin","window","location","submitAnalytics","analyticsObj","super","updateStyles","stylesObj","componentRef","setFocusOn","frame","processBinLookupResponse","binLookupResponse","dualBrandingChangeHandler","e","handleUnsupportedCard","errObj","onBinLookup","obj","nuObj","rootNode","_node","isReset","supportedBrandsRaw","map","item","brandImageUrl","brandsConfiguration","icon","getCardImageUrl","resources","isValid","collectBrowserInfo","render","h","CoreProvider","i18n","loadingContext","CustomCardInput","ref","handleKeyPress","onChange","setState","onBinValue","implementationType","onFocus","args","_define_property","triggerBinLookUp","focus","ANALYTICS_FOCUS_STR","ANALYTICS_UNFOCUS_STR","target","fieldTypeToSnakeCase","fieldType","onEnterKeyPressed","activeElement","component","analyticsType","defaultProps"],"mappings":"otBAmBO,MAAMA,UAAmBC,EAU5BC,WAAAA,CAAYC,GACR,MAAO,IACAA,EACHC,KAAMC,EAAWC,WACjBC,MAAOF,EAAWG,KAE1B,CAKAC,UAAAA,GACI,MAAMC,EAAUC,KAAKC,MAAMC,mBAC3B,MAAO,CACHC,cAAe,CACXV,KAAM,YACHO,KAAKC,MAAMG,QACVL,GAAW,CAAEH,MAAOG,IAE5BM,YAAaL,KAAKK,YAClBC,SAAUC,QAAUA,OAAOC,SAASF,OAE5C,CAEUG,eAAAA,CAAgBC,GACtBC,MAAMF,gBAAgBC,EAAcV,KAAKR,MAC7C,CAEAoB,YAAAA,CAAaC,GAET,OADIb,KAAKc,cAAcF,cAAcZ,KAAKc,aAAaF,aAAaC,GAC7Db,IACX,CAEAe,UAAAA,CAAWC,GAEP,OADIhB,KAAKc,cAAcC,YAAYf,KAAKc,aAAaC,WAAWC,GACzDhB,IACX,CAEAiB,wBAAAA,CAAyBC,GAErB,OADIlB,KAAKc,cAAcG,0BAA0BjB,KAAKc,aAAaG,yBAAyBC,GACrFlB,IACX,CAEAmB,yB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AGzB6B,EAAArD,KAAU6D,qBAAoB,CAACC,EAAwBC,KACnD/D,KAAKR,MAAMqE,oBAAoBC,EAAeC,EAAAA,KAlGlDV,EADShE,EACKI,OAAOC,EAAWC,YAEhC0D,EAHShE,EAGK2E,gBAAgB,iBAE9BX,EALShE,EAKQ4E,eAAe,CAC5B1C,YAAa,OACbU,oBAAqB,CAAC"}
@@ -1,2 +1,2 @@
1
- import{createElement as a}from"../../../external/preact/dist/preact.js";import e from"../../internal/Img/Img.js";function c({logoUrl:c="",nonprofitDescription:n="",nonprofitName:t="",causeName:i="",nonprofitUrl:o="",bannerUrl:r=""}){return a("div",{className:"adyen-checkout__campaign-container"},a(e,{className:"adyen-checkout__campaign-background-image",style:{backgroundImage:`linear-gradient(0, #000, #0003), url(${r})`},backgroundUrl:r}),a("div",{className:"adyen-checkout__campaign-content"},c&&a("img",{src:c,className:"adyen-checkout__campaign-logo",alt:t}),t&&a("div",{className:"adyen-checkout__campaign-title"},t),i&&a("div",{className:"adyen-checkout__campaign-cause"},i),n&&a("div",{className:"adyen-checkout__campaign-description"},n,o&&" ›")))}export{c as default};
1
+ import{createElement as e}from"../../../external/preact/dist/preact.js";import a from"./CampaignInfo.js";function n({logoUrl:n="",nonprofitDescription:r="",nonprofitName:o="",causeName:t="",nonprofitUrl:c="",bannerUrl:i=""}){return e("div",{className:"adyen-checkout__campaign"},c?e("a",{href:c,className:"adyen-checkout__campaign-link",target:"_blank",rel:"noopener noreferrer"},e(a,{logoUrl:n,nonprofitName:o,causeName:t,bannerUrl:i})):e(a,{logoUrl:n,nonprofitName:o,causeName:t,bannerUrl:i}),r&&e("div",{className:"adyen-checkout__campaign-description"},r))}export{n as default};
2
2
  //# sourceMappingURL=CampaignContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CampaignContent.js","sources":["../../../../../src/components/Donation/components/CampaignContent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Img from '../../internal/Img';\n\nexport interface CampaignContentProps {\n logoUrl?: string;\n nonprofitDescription?: string;\n nonprofitName?: string;\n causeName?: string;\n nonprofitUrl?: string;\n bannerUrl?: string;\n}\n\nexport default function CampaignContent({\n logoUrl = '',\n nonprofitDescription = '',\n nonprofitName = '',\n causeName = '',\n nonprofitUrl = '',\n bannerUrl = ''\n}: CampaignContentProps) {\n const backgroundImage = `linear-gradient(0, #000, #0003), url(${bannerUrl})`;\n\n return (\n <div className=\"adyen-checkout__campaign-container\">\n <Img className=\"adyen-checkout__campaign-background-image\" style={{ backgroundImage }} backgroundUrl={bannerUrl} />\n\n <div className=\"adyen-checkout__campaign-content\">\n {logoUrl && <img src={logoUrl} className=\"adyen-checkout__campaign-logo\" alt={nonprofitName} />}\n {nonprofitName && <div className=\"adyen-checkout__campaign-title\">{nonprofitName}</div>}\n {causeName && <div className=\"adyen-checkout__campaign-cause\">{causeName}</div>}\n {nonprofitDescription && (\n <div className=\"adyen-checkout__campaign-description\">\n {nonprofitDescription}\n {nonprofitUrl && ' ›'}\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"names":["CampaignContent","logoUrl","nonprofitDescription","nonprofitName","causeName","nonprofitUrl","bannerUrl","h","div","className","Img","style","backgroundImage","backgroundUrl","img","src","alt"],"mappings":"iHAYe,SAASA,GAAgBC,QACpCA,EAAU,GAAEC,qBACZA,EAAuB,GAAEC,cACzBA,EAAgB,GAAEC,UAClBA,EAAY,GAAEC,aACdA,EAAe,GAAEC,UACjBA,EAAY,KAIZ,OACIC,EAACC,MAAAA,CAAIC,UAAU,sCACXF,EAACG,EAAAA,CAAID,UAAU,4CAA4CE,MAAO,CAAEC,gBAJpD,wCAAwCN,MAI+BO,cAAeP,IAEtGC,EAACC,MAAAA,CAAIC,UAAU,oCACVR,GAAWM,EAACO,MAAAA,CAAIC,IAAKd,EAASQ,UAAU,gCAAgCO,IAAKb,IAC7EA,GAAiBI,EAACC,MAAAA,CAAIC,UAAU,kCAAkCN,GAClEC,GAAaG,EAACC,MAAAA,CAAIC,UAAU,kCAAkCL,GAC9DF,GACGK,EAACC,MAAAA,CAAIC,UAAU,wCACVP,EACAG,GAAgB,OAMzC"}
1
+ {"version":3,"file":"CampaignContent.js","sources":["../../../../../src/components/Donation/components/CampaignContent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CampaignInfo from './CampaignInfo';\n\nexport interface CampaignContentProps {\n logoUrl?: string;\n nonprofitDescription?: string;\n nonprofitName?: string;\n causeName?: string;\n nonprofitUrl?: string;\n bannerUrl?: string;\n}\n\nexport default function CampaignContent({\n logoUrl = '',\n nonprofitDescription = '',\n nonprofitName = '',\n causeName = '',\n nonprofitUrl = '',\n bannerUrl = ''\n}: CampaignContentProps) {\n return (\n <div className=\"adyen-checkout__campaign\">\n {nonprofitUrl ? (\n <a href={nonprofitUrl} className=\"adyen-checkout__campaign-link\" target=\"_blank\" rel=\"noopener noreferrer\">\n <CampaignInfo logoUrl={logoUrl} nonprofitName={nonprofitName} causeName={causeName} bannerUrl={bannerUrl} />\n </a>\n ) : (\n <CampaignInfo logoUrl={logoUrl} nonprofitName={nonprofitName} causeName={causeName} bannerUrl={bannerUrl} />\n )}\n\n {nonprofitDescription && <div className=\"adyen-checkout__campaign-description\">{nonprofitDescription}</div>}\n </div>\n );\n}\n"],"names":["CampaignContent","logoUrl","nonprofitDescription","nonprofitName","causeName","nonprofitUrl","bannerUrl","h","div","className","a","href","target","rel","CampaignInfo"],"mappings":"yGAYe,SAASA,GAAgBC,QACpCA,EAAU,GAAEC,qBACZA,EAAuB,GAAEC,cACzBA,EAAgB,GAAEC,UAClBA,EAAY,GAAEC,aACdA,EAAe,GAAEC,UACjBA,EAAY,KAEZ,OACIC,EAACC,MAAAA,CAAIC,UAAU,4BACVJ,EACGE,EAACG,IAAAA,CAAEC,KAAMN,EAAcI,UAAU,gCAAgCG,OAAO,SAASC,IAAI,uBACjFN,EAACO,EAAAA,CAAab,QAASA,EAASE,cAAeA,EAAeC,UAAWA,EAAWE,UAAWA,KAGnGC,EAACO,EAAAA,CAAab,QAASA,EAASE,cAAeA,EAAeC,UAAWA,EAAWE,UAAWA,IAGlGJ,GAAwBK,EAACC,MAAAA,CAAIC,UAAU,wCAAwCP,GAG5F"}
@@ -0,0 +1,2 @@
1
+ import{createElement as a,Fragment as e}from"../../../external/preact/dist/preact.js";import c from"../../internal/Img/Img.js";function n({logoUrl:n="",nonprofitName:t="",causeName:m="",bannerUrl:r=""}){return a(e,null,a(c,{className:"adyen-checkout__campaign-background-image",style:{backgroundImage:`url(${r})`},backgroundUrl:r}),a("div",{className:"adyen-checkout__campaign-content"},n&&a("img",{src:n,className:"adyen-checkout__campaign-logo",alt:t}),a("div",null,t&&a("div",{className:"adyen-checkout__campaign-title"},t),m&&a("div",{className:"adyen-checkout__campaign-cause"},m))))}export{n as default};
2
+ //# sourceMappingURL=CampaignInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CampaignInfo.js","sources":["../../../../../src/components/Donation/components/CampaignInfo.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport Img from '../../internal/Img';\n\nexport interface CampaignInfoProps {\n logoUrl?: string;\n nonprofitName?: string;\n causeName?: string;\n bannerUrl?: string;\n}\n\nexport default function CampaignInfo({ logoUrl = '', nonprofitName = '', causeName = '', bannerUrl = '' }: CampaignInfoProps) {\n const backgroundImage = `url(${bannerUrl})`;\n\n return (\n <Fragment>\n <Img className=\"adyen-checkout__campaign-background-image\" style={{ backgroundImage }} backgroundUrl={bannerUrl} />\n\n <div className=\"adyen-checkout__campaign-content\">\n {logoUrl && <img src={logoUrl} className=\"adyen-checkout__campaign-logo\" alt={nonprofitName} />}\n <div>\n {nonprofitName && <div className=\"adyen-checkout__campaign-title\">{nonprofitName}</div>}\n {causeName && <div className=\"adyen-checkout__campaign-cause\">{causeName}</div>}\n </div>\n </div>\n </Fragment>\n );\n}\n"],"names":["CampaignInfo","logoUrl","nonprofitName","causeName","bannerUrl","h","Fragment","Img","className","style","backgroundImage","backgroundUrl","div","img","src","alt"],"mappings":"+HAUe,SAASA,GAAaC,QAAEA,EAAU,GAAEC,cAAEA,EAAgB,GAAEC,UAAEA,EAAY,GAAEC,UAAEA,EAAY,KAGjG,OACIC,EAACC,OACGD,EAACE,EAAAA,CAAIC,UAAU,4CAA4CC,MAAO,CAAEC,gBAJpD,OAAON,MAIgEO,cAAeP,IAEtGC,EAACO,MAAAA,CAAIJ,UAAU,oCACVP,GAAWI,EAACQ,MAAAA,CAAIC,IAAKb,EAASO,UAAU,gCAAgCO,IAAKb,IAC9EG,EAACO,MAAAA,KACIV,GAAiBG,EAACO,MAAAA,CAAIJ,UAAU,kCAAkCN,GAClEC,GAAaE,EAACO,MAAAA,CAAIJ,UAAU,kCAAkCL,KAKnF"}