@adyen/adyen-web 6.27.1 → 6.29.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 (279) hide show
  1. package/dist/cjs/adyen.css +10 -8
  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 +1344 -1169
  6. package/dist/es/adyen.css +10 -8
  7. package/dist/es/adyen.css.map +1 -1
  8. package/dist/es/components/Card/Card.js +1 -1
  9. package/dist/es/components/Card/Card.js.map +1 -1
  10. package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
  11. package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
  12. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  13. package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  14. package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
  15. package/dist/es/components/Econtext/Econtext.js +1 -1
  16. package/dist/es/components/Econtext/Econtext.js.map +1 -1
  17. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  18. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  19. package/dist/es/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js +1 -1
  20. package/dist/es/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
  21. package/dist/es/components/Iris/Iris.js +2 -0
  22. package/dist/es/components/Iris/Iris.js.map +1 -0
  23. package/dist/es/components/Iris/components/IrisComponent.js +2 -0
  24. package/dist/es/components/Iris/components/IrisComponent.js.map +1 -0
  25. package/dist/es/components/Iris/components/IrisComponent.module.scss.js +2 -0
  26. package/dist/es/components/Iris/components/IrisComponent.module.scss.js.map +1 -0
  27. package/dist/es/components/Iris/components/IrisGenerateQRCode.js +2 -0
  28. package/dist/es/components/Iris/components/IrisGenerateQRCode.js.map +1 -0
  29. package/dist/es/components/Iris/components/IrisGenerateQRCode.module.scss.js +2 -0
  30. package/dist/es/components/Iris/components/IrisGenerateQRCode.module.scss.js.map +1 -0
  31. package/dist/es/components/Iris/components/IrisQrCodeInstructions.js +2 -0
  32. package/dist/es/components/Iris/components/IrisQrCodeInstructions.js.map +1 -0
  33. package/dist/es/components/Iris/constants.js +2 -0
  34. package/dist/es/components/Iris/constants.js.map +1 -0
  35. package/dist/es/components/Iris/types.js +2 -0
  36. package/dist/es/components/Iris/types.js.map +1 -0
  37. package/dist/es/components/Iris/utils.js +2 -0
  38. package/dist/es/components/Iris/utils.js.map +1 -0
  39. package/dist/es/components/PayTo/components/PayToComponent.js +1 -1
  40. package/dist/es/components/PayTo/components/PayToComponent.js.map +1 -1
  41. package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  42. package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  43. package/dist/es/components/ThreeDS2/components/utils.js +1 -1
  44. package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
  45. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  46. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  47. package/dist/es/components/components-name-map.js +1 -1
  48. package/dist/es/components/components-name-map.js.map +1 -1
  49. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  50. package/dist/es/components/index.js +1 -1
  51. package/dist/es/components/internal/Address/Address.js +1 -1
  52. package/dist/es/components/internal/Address/Address.js.map +1 -1
  53. package/dist/es/components/internal/Address/constants.js +1 -1
  54. package/dist/es/components/internal/Address/constants.js.map +1 -1
  55. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  56. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  57. package/dist/es/components/internal/Button/Button.js +1 -1
  58. package/dist/es/components/internal/Button/Button.js.map +1 -1
  59. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js +1 -1
  60. package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js.map +1 -1
  61. package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
  62. package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
  63. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  64. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  65. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  66. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  67. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  68. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  69. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  70. package/dist/es/components/internal/SegmentedControl/SegmentedControlRegion.js +2 -0
  71. package/dist/es/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -0
  72. package/dist/es/components/internal/Voucher/Voucher.js +1 -1
  73. package/dist/es/components/internal/Voucher/Voucher.js.map +1 -1
  74. package/dist/es/components/internal/Voucher/utils.js.map +1 -1
  75. package/dist/es/components/tx-variants.js +1 -1
  76. package/dist/es/components/tx-variants.js.map +1 -1
  77. package/dist/es/core/Analytics/events/AnalyticsInfoEvent.js +1 -1
  78. package/dist/es/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
  79. package/dist/es/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  80. package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
  81. package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
  82. package/dist/es/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  83. package/dist/es/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  84. package/dist/es/core/config.js +1 -1
  85. package/dist/es/index.d.ts +1344 -1169
  86. package/dist/es/index.js +1 -1
  87. package/dist/es/language/Language.js.map +1 -1
  88. package/dist/es/utils/createSdkData.js +2 -0
  89. package/dist/es/utils/createSdkData.js.map +1 -0
  90. package/dist/es-legacy/adyen.css +10 -8
  91. package/dist/es-legacy/adyen.css.map +1 -1
  92. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  93. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  94. package/dist/es-legacy/components/ApplePay/utils/payment-request.js +1 -1
  95. package/dist/es-legacy/components/ApplePay/utils/payment-request.js.map +1 -1
  96. package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferVoucher.js +1 -1
  97. package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferVoucher.js.map +1 -1
  98. package/dist/es-legacy/components/Card/Card.js +1 -1
  99. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  100. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  101. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  102. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  103. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  104. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  105. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  106. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  107. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js +1 -1
  108. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
  109. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  110. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  111. package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js +1 -1
  112. package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js.map +1 -1
  113. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  114. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  115. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  116. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  117. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  118. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  119. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  120. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  121. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  122. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  123. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  124. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  125. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  126. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  127. package/dist/es-legacy/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js +1 -1
  128. package/dist/es-legacy/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
  129. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  130. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  131. package/dist/es-legacy/components/GooglePay/requests.js +1 -1
  132. package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
  133. package/dist/es-legacy/components/Iris/Iris.js +2 -0
  134. package/dist/es-legacy/components/Iris/Iris.js.map +1 -0
  135. package/dist/es-legacy/components/Iris/components/IrisComponent.js +2 -0
  136. package/dist/es-legacy/components/Iris/components/IrisComponent.js.map +1 -0
  137. package/dist/es-legacy/components/Iris/components/IrisComponent.module.scss.js +2 -0
  138. package/dist/es-legacy/components/Iris/components/IrisComponent.module.scss.js.map +1 -0
  139. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.js +2 -0
  140. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.js.map +1 -0
  141. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.module.scss.js +2 -0
  142. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.module.scss.js.map +1 -0
  143. package/dist/es-legacy/components/Iris/components/IrisQrCodeInstructions.js +2 -0
  144. package/dist/es-legacy/components/Iris/components/IrisQrCodeInstructions.js.map +1 -0
  145. package/dist/es-legacy/components/Iris/constants.js +2 -0
  146. package/dist/es-legacy/components/Iris/constants.js.map +1 -0
  147. package/dist/es-legacy/components/Iris/types.js +2 -0
  148. package/dist/es-legacy/components/Iris/types.js.map +1 -0
  149. package/dist/es-legacy/components/Iris/utils.js +2 -0
  150. package/dist/es-legacy/components/Iris/utils.js.map +1 -0
  151. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  152. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  153. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  154. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  155. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +1 -1
  156. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -1
  157. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  158. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  159. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  160. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  161. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  162. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  163. package/dist/es-legacy/components/PayTo/components/PayToComponent.js +1 -1
  164. package/dist/es-legacy/components/PayTo/components/PayToComponent.js.map +1 -1
  165. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js +1 -1
  166. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
  167. package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
  168. package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
  169. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  170. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  171. package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
  172. package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
  173. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  174. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  175. package/dist/es-legacy/components/components-name-map.js +1 -1
  176. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  177. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  178. package/dist/es-legacy/components/index.js +1 -1
  179. package/dist/es-legacy/components/internal/Address/Address.js +1 -1
  180. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  181. package/dist/es-legacy/components/internal/Address/constants.js +1 -1
  182. package/dist/es-legacy/components/internal/Address/constants.js.map +1 -1
  183. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  184. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  185. package/dist/es-legacy/components/internal/Button/Button.js +1 -1
  186. package/dist/es-legacy/components/internal/Button/Button.js.map +1 -1
  187. package/dist/es-legacy/components/internal/Button/CopyButton.js +1 -1
  188. package/dist/es-legacy/components/internal/Button/CopyButton.js.map +1 -1
  189. package/dist/es-legacy/components/internal/Button/CopyIconButton.js +1 -1
  190. package/dist/es-legacy/components/internal/Button/CopyIconButton.js.map +1 -1
  191. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js +1 -1
  192. package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.js.map +1 -1
  193. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  194. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  195. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  196. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  197. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  198. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  199. package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
  200. package/dist/es-legacy/components/internal/FormFields/Select/Select.js.map +1 -1
  201. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  202. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  203. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js +1 -1
  204. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  205. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  206. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  207. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js +1 -1
  208. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
  209. package/dist/es-legacy/components/internal/Modal/Modal.js +1 -1
  210. package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
  211. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  212. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  213. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
  214. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -1
  215. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  216. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  217. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  218. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  219. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js +1 -1
  220. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
  221. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  222. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  223. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  224. package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js +1 -1
  225. package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -1
  226. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  227. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  228. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  229. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  230. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  231. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  232. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  233. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  234. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  235. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  236. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js +1 -1
  237. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  238. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js +1 -1
  239. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  240. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js.map +1 -1
  241. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  242. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  243. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControlRegion.js +2 -0
  244. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -0
  245. package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js +1 -1
  246. package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js.map +1 -1
  247. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  248. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  249. package/dist/es-legacy/components/internal/Voucher/Voucher.js +1 -1
  250. package/dist/es-legacy/components/internal/Voucher/Voucher.js.map +1 -1
  251. package/dist/es-legacy/components/internal/Voucher/utils.js.map +1 -1
  252. package/dist/es-legacy/components/tx-variants.js +1 -1
  253. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  254. package/dist/es-legacy/core/Analytics/events/AnalyticsInfoEvent.js +1 -1
  255. package/dist/es-legacy/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
  256. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  257. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  258. package/dist/es-legacy/core/Context/Resources.js +1 -1
  259. package/dist/es-legacy/core/Context/Resources.js.map +1 -1
  260. package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
  261. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
  262. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
  263. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  264. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  265. package/dist/es-legacy/core/config.js +1 -1
  266. package/dist/es-legacy/core/core.js +1 -1
  267. package/dist/es-legacy/core/core.js.map +1 -1
  268. package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js +1 -1
  269. package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
  270. package/dist/es-legacy/index.js +1 -1
  271. package/dist/es-legacy/language/Language.js.map +1 -1
  272. package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
  273. package/dist/es-legacy/utils/commonUtils.js.map +1 -1
  274. package/dist/es-legacy/utils/createSdkData.js +2 -0
  275. package/dist/es-legacy/utils/createSdkData.js.map +1 -0
  276. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  277. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  278. package/package.json +22 -22
  279. package/styles/adyen.css +10 -8
@@ -1 +1 @@
1
- {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Bank Transfer */\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.bankTransfer_BE]: 'BankTransfer',\n [TxVariants.bankTransfer_NL]: 'BankTransfer',\n [TxVariants.bankTransfer_PL]: 'BankTransfer',\n [TxVariants.bankTransfer_FR]: 'BankTransfer',\n [TxVariants.bankTransfer_CH]: 'BankTransfer',\n [TxVariants.bankTransfer_IE]: 'BankTransfer',\n [TxVariants.bankTransfer_GB]: 'BankTransfer',\n [TxVariants.bankTransfer_DE]: 'BankTransfer',\n /** Bank Transfer */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDirectDebit',\n [TxVariants.sepadirectdebit]: 'SepaDirectDebit',\n [TxVariants.eft_directdebit_CA]: 'PreAuthorizedDebitCanada',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.fastlane]: 'Fastlane',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n [TxVariants.paybybank_AIS_DD]: 'PayByBankUS',\n [TxVariants.riverty]: 'Riverty',\n [TxVariants.paybybank_pix]: 'PayByBankPix',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n [TxVariants.klarna_b2b]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'DuitNow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.ancv]: 'ANCV',\n [TxVariants.payto]: 'PayTo',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n [TxVariants.upi_intent]: 'UPI',\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","donation","personal_details","bankTransfer_IBAN","bankTransfer_BE","bankTransfer_NL","bankTransfer_PL","bankTransfer_FR","bankTransfer_CH","bankTransfer_IE","bankTransfer_GB","bankTransfer_DE","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","eft_directdebit_CA","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","fastlane","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","paybybank_AIS_DD","riverty","paybybank_pix","klarna","klarna_account","klarna_paynow","klarna_b2b","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","ancv","payto","upi","upi_qr","upi_collect","upi_intent","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","payment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AWkF,iBAAkB,WAI9B,CAAClF,EAAWmF,SAAU,UACtB,CAACnF,EAAWoF,YAAa,aACzB,CAACpF,EAAWqF,UAAW,WACvB,CAACrF,EAAWsF,OAAQ,QACpB,CAACtF,EAAWuF,OAAQ,QACpB,CAACvF,EAAWwF,SAAU,UACtB,CAACxF,EAAWyF,kBAAmB,cAC/B,CAACzF,EAAW0F,SAAU,UACtB,CAAC1F,EAAW2F,eAAgB,eAI5B,CAAC3F,EAAW4F,QAAS,SACrB,CAAC5F,EAAW6F,gBAAiB,SAC7B,CAAC7F,EAAW8F,eAAgB,SAC5B,CAAC9F,EAAW+F,YAAa,SAIzB,CAAC/F,EAAWgG,aAAc,aAC1B,CAAChG,EAAWiG,gBAAiB,aAC7B,CAACjG,EAAWkG,KAAM,MAClB,CAAClG,EAAWmG,OAAQ,QACpB,CAACnG,EAAWoG,WAAY,SACxB,CAACpG,EAAWqG,aAAc,SAC1B,CAACrG,EAAWsG,WAAY,YACxB,CAACtG,EAAWuG,QAAS,SACrB,CAACvG,EAAWwG,SAAU,UAItB,CAACxG,EAAWyG,MAAO,OACnB,CAACzG,EAAW0G,OAAQ,QACpB,CAAC1G,EAAW2G,MAAO,OACnB,CAAC3G,EAAW4G,OAAQ,QACpB,CAAC5G,EAAW6G,KAAM,MAClB,CAAC7G,EAAW8G,QAAS,MACrB,CAAC9G,EAAW+G,aAAc,MAC1B,CAAC/G,EAAWgH,YAAa,MAIzB,CAAChH,EAAWiH,UAAW,WACvB,CAACjH,EAAWkH,wBAAyB,gBACrC,CAAClH,EAAWmH,uBAAwB,gBACpC,CAACnH,EAAWoH,yBAA0B,iBAQ1C,SAASC,EAA8BC,GACnC,OAAOvH,EAAkBuH,EAC7B"}
1
+ {"version":3,"file":"components-name-map.js","sources":["../../../src/components/components-name-map.ts"],"sourcesContent":["import { TxVariants } from './tx-variants';\n\n/**\n * Maps each payment type with the string name of its Component element.\n *\n * It is used to give nicer error messages when creating components using Drop-in.\n * Example: paymentMethods response contains blik, but Blik component is not configured. So it warns that 'Blik' must be imported and added to the Drop-in configuration.\n */\nconst ComponentsNameMap = {\n /** internal */\n [TxVariants.address]: 'Address',\n [TxVariants.donation]: 'Donation',\n [TxVariants.personal_details]: 'PersonalDetails',\n /** internal */\n\n /** Bank Transfer */\n [TxVariants.bankTransfer_IBAN]: 'BankTransfer',\n [TxVariants.bankTransfer_BE]: 'BankTransfer',\n [TxVariants.bankTransfer_NL]: 'BankTransfer',\n [TxVariants.bankTransfer_PL]: 'BankTransfer',\n [TxVariants.bankTransfer_FR]: 'BankTransfer',\n [TxVariants.bankTransfer_CH]: 'BankTransfer',\n [TxVariants.bankTransfer_IE]: 'BankTransfer',\n [TxVariants.bankTransfer_GB]: 'BankTransfer',\n [TxVariants.bankTransfer_DE]: 'BankTransfer',\n /** Bank Transfer */\n\n /** Card */\n [TxVariants.bcmc]: 'Bancontact',\n [TxVariants.card]: 'Card',\n [TxVariants.scheme]: 'Card',\n [TxVariants.storedCard]: 'Card',\n [TxVariants.customCard]: 'CustomCard',\n /** Card */\n\n /** Direct debit */\n [TxVariants.ach]: 'Ach',\n [TxVariants.directdebit_GB]: 'BacsDirectDebit',\n [TxVariants.sepadirectdebit]: 'SepaDirectDebit',\n [TxVariants.eft_directdebit_CA]: 'PreAuthorizedDebitCanada',\n /** Direct debit */\n\n /** Open Invoice */\n [TxVariants.affirm]: 'Affirm',\n [TxVariants.afterpay]: 'AfterPay',\n [TxVariants.afterpay_default]: 'AfterPay',\n [TxVariants.afterpay_b2b]: 'AfterPayB2B',\n [TxVariants.atome]: 'Atome',\n [TxVariants.facilypay_3x]: 'FacilyPay3x',\n [TxVariants.facilypay_4x]: 'FacilyPay4x',\n [TxVariants.facilypay_6x]: 'FacilyPay6x',\n [TxVariants.facilypay_10x]: 'FacilyPay10x',\n [TxVariants.facilypay_12x]: 'FacilyPay12x',\n [TxVariants.ratepay]: 'RatePay',\n [TxVariants.ratepay_directdebit]: 'RatePayDirectDebit',\n /** Open Invoice */\n\n /** Wallets */\n [TxVariants.amazonpay]: 'AmazonPay',\n [TxVariants.applepay]: 'ApplePay',\n [TxVariants.cashapp]: 'CashAppPay',\n [TxVariants.clicktopay]: 'ClickToPay',\n [TxVariants.googlepay]: 'GooglePay',\n [TxVariants.paypal]: 'PayPal',\n [TxVariants.fastlane]: 'Fastlane',\n [TxVariants.paywithgoogle]: 'GooglePay',\n /** Wallets */\n\n /** Voucher */\n [TxVariants.boletobancario]: 'Boleto',\n [TxVariants.boletobancario_itau]: 'Boleto',\n [TxVariants.boletobancario_santander]: 'Boleto',\n [TxVariants.doku]: 'Doku',\n [TxVariants.doku_alfamart]: 'Doku',\n [TxVariants.doku_permata_lite_atm]: 'Doku',\n [TxVariants.doku_indomaret]: 'Doku',\n [TxVariants.doku_atm_mandiri_va]: 'Doku',\n [TxVariants.doku_sinarmas_va]: 'Doku',\n [TxVariants.doku_mandiri_va]: 'Doku',\n [TxVariants.doku_cimb_va]: 'Doku',\n [TxVariants.doku_danamon_va]: 'Doku',\n [TxVariants.doku_bri_va]: 'Doku',\n [TxVariants.doku_bni_va]: 'Doku',\n [TxVariants.doku_bca_va]: 'Doku',\n [TxVariants.doku_wallet]: 'Doku',\n [TxVariants.oxxo]: 'Oxxo',\n [TxVariants.primeiropay_boleto]: 'Boleto',\n /** Voucher */\n\n /** issuerList */\n [TxVariants.billdesk_online]: 'BillDeskOnline',\n [TxVariants.billdesk_wallet]: 'BillDeskWallet',\n [TxVariants.dotpay]: 'Dotpay',\n [TxVariants.eps]: 'Eps',\n [TxVariants.iris]: 'Iris',\n [TxVariants.molpay_ebanking_fpx_MY]: 'MolPayEBankingMY',\n [TxVariants.molpay_ebanking_TH]: 'MolPayEBankingTH',\n [TxVariants.molpay_ebanking_VN]: 'MolPayEBankingVN',\n [TxVariants.onlineBanking_CZ]: 'OnlineBankingCZ',\n [TxVariants.onlinebanking_IN]: 'OnlineBankingIN', // NOTE: the txVariant does have a lowercase \"b\"\n [TxVariants.onlineBanking_PL]: 'OnlineBankingPL',\n [TxVariants.onlineBanking_SK]: 'OnlineBankingSK',\n [TxVariants.paybybank]: 'PayByBank',\n [TxVariants.payu_IN_cashcard]: 'PayuCashcard',\n [TxVariants.payu_IN_nb]: 'PayuNetBanking',\n [TxVariants.wallet_IN]: 'WalletINElement',\n /** issuerList */\n\n /** Dragonpay */\n [TxVariants.dragonpay_ebanking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_non_banking]: 'Dragonpay',\n [TxVariants.dragonpay_otc_philippines]: 'Dragonpay',\n /** Dragonpay */\n\n /** Econtext */\n [TxVariants.econtext_atm]: 'Econtext',\n [TxVariants.econtext_online]: 'Econtext',\n [TxVariants.econtext_seven_eleven]: 'Econtext',\n [TxVariants.econtext_stores]: 'Econtext',\n /** Econtext */\n\n /** Redirect */\n [TxVariants.giropay]: 'Giropay',\n [TxVariants.multibanco]: 'Multibanco',\n [TxVariants.redirect]: 'Redirect',\n [TxVariants.twint]: 'Twint',\n [TxVariants.vipps]: 'Vipps',\n [TxVariants.trustly]: 'Trustly',\n [TxVariants.paybybank_AIS_DD]: 'PayByBankUS',\n [TxVariants.riverty]: 'Riverty',\n [TxVariants.paybybank_pix]: 'PayByBankPix',\n /** Redirect */\n\n /** Klarna */\n [TxVariants.klarna]: 'Klarna',\n [TxVariants.klarna_account]: 'Klarna',\n [TxVariants.klarna_paynow]: 'Klarna',\n [TxVariants.klarna_b2b]: 'Klarna',\n /** Klarna */\n\n /** QRLoader */\n [TxVariants.bcmc_mobile]: 'BcmcMobile',\n [TxVariants.bcmc_mobile_QR]: 'BcmcMobile',\n [TxVariants.pix]: 'Pix',\n [TxVariants.swish]: 'Swish',\n [TxVariants.wechatpay]: 'WeChat',\n [TxVariants.wechatpayQR]: 'WeChat',\n [TxVariants.promptpay]: 'PromptPay',\n [TxVariants.paynow]: 'PayNow',\n [TxVariants.duitnow]: 'DuitNow',\n /** QRLoader */\n\n /** Await */\n [TxVariants.blik]: 'Blik',\n [TxVariants.mbway]: 'MBWay',\n [TxVariants.ancv]: 'ANCV',\n [TxVariants.payto]: 'PayTo',\n [TxVariants.upi]: 'UPI', // also QR\n [TxVariants.upi_qr]: 'UPI', // also QR\n [TxVariants.upi_collect]: 'UPI', // also QR\n [TxVariants.upi_intent]: 'UPI',\n /** Await */\n\n /** Giftcard */\n [TxVariants.giftcard]: 'Giftcard',\n [TxVariants.mealVoucher_FR_natixis]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_sodexo]: 'MealVoucherFR',\n [TxVariants.mealVoucher_FR_groupeup]: 'MealVoucherFR'\n /** Giftcard */\n};\n\n/**\n * Returns the Component name based on the payment type\n * @param paymentType\n */\nfunction getComponentNameOfPaymentType(paymentType: string): string {\n return ComponentsNameMap[paymentType];\n}\n\nexport default getComponentNameOfPaymentType;\n"],"names":["ComponentsNameMap","TxVariants","address","donation","personal_details","bankTransfer_IBAN","bankTransfer_BE","bankTransfer_NL","bankTransfer_PL","bankTransfer_FR","bankTransfer_CH","bankTransfer_IE","bankTransfer_GB","bankTransfer_DE","bcmc","card","scheme","storedCard","customCard","ach","directdebit_GB","sepadirectdebit","eft_directdebit_CA","affirm","afterpay","afterpay_default","afterpay_b2b","atome","facilypay_3x","facilypay_4x","facilypay_6x","facilypay_10x","facilypay_12x","ratepay","ratepay_directdebit","amazonpay","applepay","cashapp","clicktopay","googlepay","paypal","fastlane","paywithgoogle","boletobancario","boletobancario_itau","boletobancario_santander","doku","doku_alfamart","doku_permata_lite_atm","doku_indomaret","doku_atm_mandiri_va","doku_sinarmas_va","doku_mandiri_va","doku_cimb_va","doku_danamon_va","doku_bri_va","doku_bni_va","doku_bca_va","doku_wallet","oxxo","primeiropay_boleto","billdesk_online","billdesk_wallet","dotpay","eps","iris","molpay_ebanking_fpx_MY","molpay_ebanking_TH","molpay_ebanking_VN","onlineBanking_CZ","onlinebanking_IN","onlineBanking_PL","onlineBanking_SK","paybybank","payu_IN_cashcard","payu_IN_nb","wallet_IN","dragonpay_ebanking","dragonpay_otc_banking","dragonpay_otc_non_banking","dragonpay_otc_philippines","econtext_atm","econtext_online","econtext_seven_eleven","econtext_stores","giropay","multibanco","redirect","twint","vipps","trustly","paybybank_AIS_DD","riverty","paybybank_pix","klarna","klarna_account","klarna_paynow","klarna_b2b","bcmc_mobile","bcmc_mobile_QR","pix","swish","wechatpay","wechatpayQR","promptpay","paynow","duitnow","blik","mbway","ancv","payto","upi","upi_qr","upi_collect","upi_intent","giftcard","mealVoucher_FR_natixis","mealVoucher_FR_sodexo","mealVoucher_FR_groupeup","getComponentNameOfPaymentType","paymentType"],"mappings":"8CAQA,MAAMA,EAAoB,CAEtB,CAACC,EAAWC,SAAU,UACtB,CAACD,EAAWE,UAAW,WACvB,CAACF,EAAWG,kBAAmB,kBAI/B,CAACH,EAAWI,mBAAoB,eAChC,CAACJ,EAAWK,iBAAkB,eAC9B,CAACL,EAAWM,iBAAkB,eAC9B,CAACN,EAAWO,iBAAkB,eAC9B,CAACP,EAAWQ,iBAAkB,eAC9B,CAACR,EAAWS,iBAAkB,eAC9B,CAACT,EAAWU,iBAAkB,eAC9B,CAACV,EAAWW,iBAAkB,eAC9B,CAACX,EAAWY,iBAAkB,eAI9B,CAACZ,EAAWa,MAAO,aACnB,CAACb,EAAWc,MAAO,OACnB,CAACd,EAAWe,QAAS,OACrB,CAACf,EAAWgB,YAAa,OACzB,CAAChB,EAAWiB,YAAa,aAIzB,CAACjB,EAAWkB,KAAM,MAClB,CAAClB,EAAWmB,gBAAiB,kBAC7B,CAACnB,EAAWoB,iBAAkB,kBAC9B,CAACpB,EAAWqB,oBAAqB,2BAIjC,CAACrB,EAAWsB,QAAS,SACrB,CAACtB,EAAWuB,UAAW,WACvB,CAACvB,EAAWwB,kBAAmB,WAC/B,CAACxB,EAAWyB,cAAe,cAC3B,CAACzB,EAAW0B,OAAQ,QACpB,CAAC1B,EAAW2B,cAAe,cAC3B,CAAC3B,EAAW4B,cAAe,cAC3B,CAAC5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,QAAS,MACrB,CAAC/G,EAAWgH,aAAc,MAC1B,CAAChH,EAAWiH,YAAa,MAIzB,CAACjH,EAAWkH,UAAW,WACvB,CAAClH,EAAWmH,wBAAyB,gBACrC,CAACnH,EAAWoH,uBAAwB,gBACpC,CAACpH,EAAWqH,yBAA0B,iBAQ1C,SAASC,EAA8BC,GACnC,OAAOxH,EAAkBwH,EAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"IssuerListContainer.js","sources":["../../../../../src/components/helpers/IssuerListContainer/IssuerListContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport IssuerList from '../../internal/IssuerList';\nimport getIssuerImageUrl from '../../../utils/get-issuer-image';\nimport { FALLBACK_CONTEXT } from '../../../core/config';\nimport RedirectButton from '../../internal/RedirectButton';\nimport { IssuerListConfiguration, IssuerListData } from './types';\nimport type { ICore } from '../../../core/types';\n\nclass IssuerListContainer extends UIElement<IssuerListConfiguration> {\n protected static defaultProps = {\n showImage: true,\n issuers: [],\n highlightedIssuers: [],\n loadingContext: FALLBACK_CONTEXT,\n showPaymentMethodItemImages: false\n };\n\n constructor(checkout: ICore, props?: IssuerListConfiguration) {\n super(checkout, props);\n\n const getImage = props => this.resources.getImage(props);\n\n if (this.props.showImage) {\n const getIssuerIcon = getIssuerImageUrl({ loadingContext: this.props.loadingContext }, this.constructor['type'], getImage);\n\n this.props.issuers = this.props.issuers.map(item => ({\n ...item,\n icon: getIssuerIcon(item.id)\n }));\n }\n }\n\n formatProps(props) {\n const issuers = (props.details && props.details.length && (props.details.find(d => d.key === 'issuer') || {}).items) || props.issuers || [];\n return { ...props, issuers };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): IssuerListData {\n return {\n paymentMethod: {\n type: this.type,\n issuer: this.state?.data?.issuer\n }\n };\n }\n\n /**\n * Returns whether the component state is valid or not\n */\n get isValid() {\n if (this.props.issuers.length === 0) {\n return true;\n }\n return !!this.state?.isValid;\n }\n\n /**\n * Returns brands array (similar to card) depending on showPaymentMethodItemImages\n * This is used to show the brands in the PaymentMethodItem\n * Requires brands icons to be loaded in the payment method\n */\n get brands(): { icon: any; name: string }[] {\n if (this.props.showPaymentMethodItemImages) {\n return this.props.issuers.map(brand => {\n const brandIcon = brand.icon;\n return { icon: brandIcon, name: brand.id };\n });\n }\n\n return [];\n }\n\n protected override componentToRender(): h.JSX.Element {\n return this.props.issuers.length > 0 ? (\n <IssuerList\n ref={ref => {\n this.componentRef = ref;\n }}\n items={this.props.issuers}\n highlightedIds={this.props.highlightedIssuers}\n {...this.props}\n {...this.state}\n showImage={this.props.showImage}\n type={this.constructor['type']}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n contextualText={this.props.i18n.get('issuerList.selectField.contextualText')}\n onSubmitAnalytics={this.submitAnalytics}\n />\n ) : (\n <RedirectButton\n showPayButton={this.props.showPayButton}\n name={this.props.name}\n {...this.props}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n );\n }\n}\n\nexport default IssuerListContainer;\n"],"names":["IssuerListContainer","UIElement","formatProps","props","issuers","details","length","find","d","key","items","formatData","paymentMethod","type","this","issuer","state","data","isValid","brands","showPaymentMethodItemImages","map","brand","icon","name","id","componentToRender","h","IssuerList","ref","componentRef","highlightedIds","highlightedIssuers","showImage","constructor","onChange","setState","onSubmit","submit","payButton","contextualText","i18n","get","onSubmitAnalytics","submitAnalytics","RedirectButton","showPayButton","checkout","super","getImage","resources","getIssuerIcon","getIssuerImageUrl","loadingContext","item","FALLBACK_CONTEXT","defaultProps"],"mappings":"6WASA,MAAMA,UAA4BC,EAwB9BC,WAAAA,CAAYC,GACR,MAAMC,EAAWD,EAAME,SAAWF,EAAME,QAAQC,SAAWH,EAAME,QAAQE,KAAKC,GAAe,WAAVA,EAAEC,MAAqB,CAAA,GAAIC,OAAUP,EAAMC,SAAW,GACzI,MAAO,IAAKD,EAAOC,UACvB,CAKAO,UAAAA,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B,EAAcG,EAAK7B,MAEjC,CACJ,cArBgC,CAC5BQ,WAAW,EACX7B,QAAS,GACT4B,mBAAoB,GACpBqB,eAAgBE,EAChBnC,6BAA6B,MALhBoC,oBADfxD"}
1
+ {"version":3,"file":"IssuerListContainer.js","sources":["../../../../../src/components/helpers/IssuerListContainer/IssuerListContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../../internal/UIElement/UIElement';\nimport IssuerList from '../../internal/IssuerList';\nimport getIssuerImageUrl from '../../../utils/get-issuer-image';\nimport { FALLBACK_CONTEXT } from '../../../core/config';\nimport RedirectButton from '../../internal/RedirectButton';\nimport { IssuerListConfiguration, IssuerListData } from './types';\nimport type { ICore } from '../../../core/types';\n\nclass IssuerListContainer<TProps extends IssuerListConfiguration = IssuerListConfiguration, TData = IssuerListData> extends UIElement<TProps> {\n protected static defaultProps = {\n showImage: true,\n issuers: [],\n highlightedIssuers: [],\n loadingContext: FALLBACK_CONTEXT,\n showPaymentMethodItemImages: false\n };\n\n constructor(checkout: ICore, props?: TProps) {\n super(checkout, props);\n\n const getImage = props => this.resources.getImage(props);\n\n if (this.props.showImage) {\n const getIssuerIcon = getIssuerImageUrl({ loadingContext: this.props.loadingContext }, this.constructor['type'], getImage);\n\n this.props.issuers = this.props.issuers.map(item => ({\n ...item,\n icon: getIssuerIcon(item.id)\n }));\n }\n }\n\n formatProps(props) {\n const issuers = (props.details && props.details.length && (props.details.find(d => d.key === 'issuer') || {}).items) || props.issuers || [];\n return { ...props, issuers };\n }\n\n /**\n * Formats the component data output\n */\n formatData(): TData {\n return {\n paymentMethod: {\n type: this.type,\n issuer: this.state?.data?.issuer\n }\n } as TData;\n }\n\n /**\n * Returns whether the component state is valid or not\n */\n get isValid() {\n if (this.props.issuers.length === 0) {\n return true;\n }\n return !!this.state?.isValid;\n }\n\n /**\n * Returns brands array (similar to card) depending on showPaymentMethodItemImages\n * This is used to show the brands in the PaymentMethodItem\n * Requires brands icons to be loaded in the payment method\n */\n get brands(): { icon: any; name: string }[] {\n if (this.props.showPaymentMethodItemImages) {\n return this.props.issuers.map(brand => {\n const brandIcon = brand.icon;\n return { icon: brandIcon, name: brand.id };\n });\n }\n\n return [];\n }\n\n protected override componentToRender(): h.JSX.Element {\n return this.props.issuers.length > 0 ? (\n <IssuerList\n ref={ref => {\n this.componentRef = ref;\n }}\n items={this.props.issuers}\n highlightedIds={this.props.highlightedIssuers}\n {...this.props}\n {...this.state}\n showImage={this.props.showImage}\n type={this.constructor['type']}\n onChange={this.setState}\n onSubmit={this.submit}\n payButton={this.payButton}\n contextualText={this.props.i18n.get('issuerList.selectField.contextualText')}\n onSubmitAnalytics={this.submitAnalytics}\n />\n ) : (\n <RedirectButton\n showPayButton={this.props.showPayButton}\n name={this.props.name}\n {...this.props}\n onSubmit={this.submit}\n payButton={this.payButton}\n ref={ref => {\n this.componentRef = ref;\n }}\n />\n );\n }\n}\n\nexport default IssuerListContainer;\n"],"names":["IssuerListContainer","UIElement","formatProps","props","issuers","details","length","find","d","key","items","formatData","paymentMethod","type","this","issuer","state","data","isValid","brands","showPaymentMethodItemImages","map","brand","icon","name","id","componentToRender","h","IssuerList","ref","componentRef","highlightedIds","highlightedIssuers","showImage","constructor","onChange","setState","onSubmit","submit","payButton","contextualText","i18n","get","onSubmitAnalytics","submitAnalytics","RedirectButton","showPayButton","checkout","super","getImage","resources","getIssuerIcon","getIssuerImageUrl","loadingContext","item","FALLBACK_CONTEXT","defaultProps"],"mappings":"6WASA,MAAMA,UAAsHC,EAwBxHC,WAAAA,CAAYC,GACR,MAAMC,EAAWD,EAAME,SAAWF,EAAME,QAAQC,SAAWH,EAAME,QAAQE,KAAKC,GAAe,WAAVA,EAAEC,MAAqB,CAAA,GAAIC,OAAUP,EAAMC,SAAW,GACzI,MAAO,IAAKD,EAAOC,UACvB,CAKAO,UAAAA,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,KACXE,OAAQD,KAAKE,OAAOC,MAAMF,QAGtC,CAKA,W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AAgBE,EAChBnC,6BAA6B,MALhBoC,oBADfxD"}
@@ -1,2 +1,2 @@
1
- export{CardElement as Card}from"./Card/Card.js";export{default as Bancontact}from"./Card/Bancontact.js";export{CustomCard}from"./CustomCard/CustomCard.js";export{default as ThreeDS2Challenge}from"./ThreeDS2/ThreeDS2Challenge.js";export{default as ThreeDS2DeviceFingerprint}from"./ThreeDS2/ThreeDS2DeviceFingerprint.js";export{AchElement as Ach}from"./Ach/Ach.js";export{default as BacsDirectDebit}from"./BacsDD/BacsDD.js";export{default as SepaDirectDebit}from"./Sepa/Sepa.js";export{PreAuthorizedDebitCanada}from"./PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js";export{default as Affirm}from"./Affirm/Affirm.js";export{default as AfterPay}from"./AfterPay/AfterPay.js";export{default as AfterPayB2B}from"./AfterPay/AfterPayB2B.js";export{default as Atome}from"./Atome/Atome.js";export{default as FacilPay3x}from"./FacilyPay/FacilyPay3x.js";export{default as FacilPay4x}from"./FacilyPay/FacilyPay4x.js";export{default as FacilPay6x}from"./FacilyPay/FacilyPay6x.js";export{default as FacilPay10x}from"./FacilyPay/FacilyPay10x.js";export{default as FacilPay12x}from"./FacilyPay/FacilyPay12x.js";export{default as RatePay}from"./RatePay/RatePay.js";export{default as RatePayDirectDebit}from"./RatePay/RatePayDirectDebit.js";export{AmazonPayElement as AmazonPay}from"./AmazonPay/AmazonPay.js";export{default as ApplePay}from"./ApplePay/ApplePay.js";export{CashAppPay}from"./CashAppPay/CashAppPay.js";export{ClickToPayElement as ClickToPay}from"./ClickToPay/ClickToPay.js";export{default as GooglePay}from"./GooglePay/GooglePay.js";export{default as PayPal}from"./PayPal/Paypal.js";export{default as Fastlane}from"./PayPalFastlane/Fastlane.js";export{BoletoElement as Boleto}from"./Boleto/Boleto.js";export{DokuElement as Doku}from"./Doku/Doku.js";export{OxxoElement as Oxxo}from"./Oxxo/Oxxo.js";export{default as BillDeskOnline}from"./BillDesk/BillDeskOnline.js";export{default as BillDeskWallet}from"./BillDesk/BillDeskWallet.js";export{default as Dotpay}from"./Dotpay/index.js";export{default as EPS}from"./EPS/index.js";export{default as MolPayEBankingMY}from"./MolPayEBanking/MolPayEBankingMY.js";export{default as MolPayEBankingTH}from"./MolPayEBanking/MolPayEBankingTH.js";export{default as MolPayEBankingVN}from"./MolPayEBanking/MolPayEBankingVN.js";export{default as OnlineBankingCZ}from"./OnlineBankingCZ/index.js";export{default as OnlineBankingIN}from"./OnlineBankingIN/index.js";export{default as OnlineBankingPL}from"./OnlineBankingPL/OnlineBankingPL.js";export{default as OnlineBankingSK}from"./OnlineBankingSK/index.js";export{default as OnlineBankingFI}from"./OnlineBankingFI/OnlineBankingFI.js";export{default as PayByBank}from"./PayByBank/PayByBank.js";export{default as PayuCashcard}from"./PayU/PayuCashcard.js";export{default as PayuNetBanking}from"./PayU/PayuNetBanking.js";export{default as WalletIN}from"./WalletIN/index.js";export{DragonpayElement as Dragonpay}from"./Dragonpay/Dragonpay.js";export{EcontextElement as Econtext}from"./Econtext/Econtext.js";export{default as Giropay}from"./Giropay/Giropay.js";export{MultibancoElement as Multibanco}from"./Multibanco/Multibanco.js";export{default as Redirect}from"./Redirect/Redirect.js";export{default as Twint}from"./Twint/Twint.js";export{default as Vipps}from"./Vipps/Vipps.js";export{default as Trustly}from"./Trustly/Trustly.js";export{default as PayByBankUS}from"./PayByBankUS/PayByBankUS.js";export{default as Riverty}from"./Riverty/Riverty.js";export{default as PayByBankPix}from"./PayByBankPix/PayByBankPix.js";export{default as Klarna}from"./Klarna/KlarnaPayments.js";export{default as BcmcMobile}from"./BcmcMobile/BcmcMobile.js";export{default as Pix}from"./Pix/Pix.js";export{default as Swish}from"./Swish/Swish.js";export{default as WeChat}from"./WeChat/WeChat.js";export{default as PromptPay}from"./PromptPay/PromptPay.js";export{default as PayNow}from"./PayNow/PayNow.js";export{default as DuitNow}from"./DuitNow/DuitNow.js";export{default as PayMe}from"./PayMe/PayMe.js";export{default as Blik}from"./Blik/Blik.js";export{MBWayElement as MBWay}from"./MBWay/MBWay.js";export{default as UPI}from"./UPI/UPI.js";export{ANCVElement as ANCV}from"./ANCV/ANCV.js";export{PayToElement as PayTo}from"./PayTo/PayTo.js";export{GiftcardElement as Giftcard}from"./Giftcard/Giftcard.js";export{MealVoucherFRElement as MealVoucherFR}from"./MealVoucherFR/MealVoucherFR.js";export{AddressElement as Address}from"./Address/Address.js";export{BankTransferElement as BankTransfer}from"./BankTransfer/BankTransfer.js";export{default as Donation}from"./Donation/Donation.js";export{default as Dropin}from"./Dropin/Dropin.js";export{PersonalDetailsElement as PersonalDetails}from"./PersonalDetails/PersonalDetails.js";
1
+ export{CardElement as Card}from"./Card/Card.js";export{default as Bancontact}from"./Card/Bancontact.js";export{CustomCard}from"./CustomCard/CustomCard.js";export{default as ThreeDS2Challenge}from"./ThreeDS2/ThreeDS2Challenge.js";export{default as ThreeDS2DeviceFingerprint}from"./ThreeDS2/ThreeDS2DeviceFingerprint.js";export{AchElement as Ach}from"./Ach/Ach.js";export{default as BacsDirectDebit}from"./BacsDD/BacsDD.js";export{default as SepaDirectDebit}from"./Sepa/Sepa.js";export{PreAuthorizedDebitCanada}from"./PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js";export{default as Affirm}from"./Affirm/Affirm.js";export{default as AfterPay}from"./AfterPay/AfterPay.js";export{default as AfterPayB2B}from"./AfterPay/AfterPayB2B.js";export{default as Atome}from"./Atome/Atome.js";export{default as FacilPay3x}from"./FacilyPay/FacilyPay3x.js";export{default as FacilPay4x}from"./FacilyPay/FacilyPay4x.js";export{default as FacilPay6x}from"./FacilyPay/FacilyPay6x.js";export{default as FacilPay10x}from"./FacilyPay/FacilyPay10x.js";export{default as FacilPay12x}from"./FacilyPay/FacilyPay12x.js";export{default as RatePay}from"./RatePay/RatePay.js";export{default as RatePayDirectDebit}from"./RatePay/RatePayDirectDebit.js";export{AmazonPayElement as AmazonPay}from"./AmazonPay/AmazonPay.js";export{default as ApplePay}from"./ApplePay/ApplePay.js";export{CashAppPay}from"./CashAppPay/CashAppPay.js";export{ClickToPayElement as ClickToPay}from"./ClickToPay/ClickToPay.js";export{default as GooglePay}from"./GooglePay/GooglePay.js";export{default as PayPal}from"./PayPal/Paypal.js";export{default as Fastlane}from"./PayPalFastlane/Fastlane.js";export{BoletoElement as Boleto}from"./Boleto/Boleto.js";export{DokuElement as Doku}from"./Doku/Doku.js";export{OxxoElement as Oxxo}from"./Oxxo/Oxxo.js";export{default as BillDeskOnline}from"./BillDesk/BillDeskOnline.js";export{default as BillDeskWallet}from"./BillDesk/BillDeskWallet.js";export{default as Dotpay}from"./Dotpay/index.js";export{default as EPS}from"./EPS/index.js";export{Iris}from"./Iris/Iris.js";export{default as MolPayEBankingMY}from"./MolPayEBanking/MolPayEBankingMY.js";export{default as MolPayEBankingTH}from"./MolPayEBanking/MolPayEBankingTH.js";export{default as MolPayEBankingVN}from"./MolPayEBanking/MolPayEBankingVN.js";export{default as OnlineBankingCZ}from"./OnlineBankingCZ/index.js";export{default as OnlineBankingIN}from"./OnlineBankingIN/index.js";export{default as OnlineBankingPL}from"./OnlineBankingPL/OnlineBankingPL.js";export{default as OnlineBankingSK}from"./OnlineBankingSK/index.js";export{default as OnlineBankingFI}from"./OnlineBankingFI/OnlineBankingFI.js";export{default as PayByBank}from"./PayByBank/PayByBank.js";export{default as PayuCashcard}from"./PayU/PayuCashcard.js";export{default as PayuNetBanking}from"./PayU/PayuNetBanking.js";export{default as WalletIN}from"./WalletIN/index.js";export{DragonpayElement as Dragonpay}from"./Dragonpay/Dragonpay.js";export{EcontextElement as Econtext}from"./Econtext/Econtext.js";export{default as Giropay}from"./Giropay/Giropay.js";export{MultibancoElement as Multibanco}from"./Multibanco/Multibanco.js";export{default as Redirect}from"./Redirect/Redirect.js";export{default as Twint}from"./Twint/Twint.js";export{default as Vipps}from"./Vipps/Vipps.js";export{default as Trustly}from"./Trustly/Trustly.js";export{default as PayByBankUS}from"./PayByBankUS/PayByBankUS.js";export{default as Riverty}from"./Riverty/Riverty.js";export{default as PayByBankPix}from"./PayByBankPix/PayByBankPix.js";export{default as Klarna}from"./Klarna/KlarnaPayments.js";export{default as BcmcMobile}from"./BcmcMobile/BcmcMobile.js";export{default as Pix}from"./Pix/Pix.js";export{default as Swish}from"./Swish/Swish.js";export{default as WeChat}from"./WeChat/WeChat.js";export{default as PromptPay}from"./PromptPay/PromptPay.js";export{default as PayNow}from"./PayNow/PayNow.js";export{default as DuitNow}from"./DuitNow/DuitNow.js";export{default as PayMe}from"./PayMe/PayMe.js";export{default as Blik}from"./Blik/Blik.js";export{MBWayElement as MBWay}from"./MBWay/MBWay.js";export{default as UPI}from"./UPI/UPI.js";export{ANCVElement as ANCV}from"./ANCV/ANCV.js";export{PayToElement as PayTo}from"./PayTo/PayTo.js";export{GiftcardElement as Giftcard}from"./Giftcard/Giftcard.js";export{MealVoucherFRElement as MealVoucherFR}from"./MealVoucherFR/MealVoucherFR.js";export{AddressElement as Address}from"./Address/Address.js";export{BankTransferElement as BankTransfer}from"./BankTransfer/BankTransfer.js";export{default as Donation}from"./Donation/Donation.js";export{default as Dropin}from"./Dropin/Dropin.js";export{PersonalDetailsElement as PersonalDetails}from"./PersonalDetails/PersonalDetails.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as t}from"../../../external/preact/dist/preact.js";import{useRef as s,useMemo as o,useState as r,useCallback as a,useEffect as n}from"../../../external/preact/hooks/dist/hooks.js";import i from"../FormFields/Fieldset/Fieldset.js";import l from"./components/ReadOnlyAddress.js";import{getAddressValidationRules as d}from"./validate.js";import{countrySpecificFormatters as c,addressFormatters as u}from"./validate.formats.js";import m from"./components/FieldContainer.js";import p from"../../../utils/useForm/useForm.js";import f from"./Specifications.js";import{ADDRESS_SCHEMA as y,FALLBACK_VALUE as F}from"./constants.js";import{getMaxLengthByFieldAndCountry as h}from"../../../utils/validator-utils.js";import{useCoreContext as C}from"../../../core/Context/CoreProvider.js";import g from"./components/AddressSearch.js";function A(A){const{i18n:v}=C(),{label:b="",requiredFields:j,visibility:x,iOSFocusedField:S=null,showContextualElement:k}=A,M=s({});Object.keys(M.current).length||A.setComponentRef?.(M.current);const O=o(()=>new f(A.specifications),[A.specifications]),D=O.getAddressSchemaForCountryFlat(A.countryCode).filter(e=>j.includes(e)),[w,B]=r(!1),[E,N]=r(!1),[P,L]=r(""),R=!!A.onAddressLookup,[V,q]=r(!1),H=!A.onAddressLookup||(w||E),{data:T,errors:_,valid:I,isValid:$,handleChangeFor:z,triggerValidation:G,setData:J,mergeData:K}=p({schema:D,defaultData:A.data,rules:{...d(O),...A.validationRules},formatters:u}),Q=a(e=>{const t=y.reduce((t,s)=>{const o=e[s];return null!=o&&(t[s]=String(o)),t},{});K(t),q(!0),G(),B(!0)},[B,G,J]),U=a(()=>{N(!0)},[]);M.current.showValidation=()=>{G(),L(!R||H||$?"":v.get("address.errors.incomplete"))};const W=D.filter(e=>!S||e===S);if(n(()=>{if(V)return void q(!1);const e=O.countryHasDataset(T.country)?"":F,t={...T,stateOrProvince:e};j.forEach(e=>{z(e,"input")(t[e]??"")}),t.postalCode&&z("postalCode","blur")(T.postalCode)},[T.country]),n(()=>{const e=j.includes("stateOrProvince"),t=T.country&&O.countryHasDataset(T.country),s=e&&t,o=T.stateOrProvince||(s?"":F);z("stateOrProvince","input")(o)},[]),n(()=>{const e=O.getOptionalFieldsForCountry(T.country),t=y.reduce((t,s)=>{const o=e.includes(s),r=j.includes(s),a=T[s],n=A.data[s],i=o&&!a||!r?r||a||!n?F:n:a;return i?.length&&(t[s]=i),t},{});A.onChange({data:t,valid:I,errors:_,isValid:$})},[T,I,_,$]),"hidden"===x)return null;if("readOnly"===x)return e(l,{data:T,label:b});const X=(t,{classNameModifiers:s=[]})=>j.includes(t)?e(m,{key:t,allowedCountries:A.allowedCountries,classNameModifiers:[...s,t],data:T,errors:_,valid:I,fieldName:t,onInput:z(t,"input"),onBlur:z(t,"blur"),onDropdownChange:z(t,"blur"),specifications:O,maxLength:h(c,t,T.country),trimOnBlur:!0,disabled:!W.includes(t),onFieldFocusAnalytics:A.onFieldFocusAnalytics,onFieldBlurAnalytics:A.onFieldBlurAnalytics}):null,Y=O.getAddressSchemaForCountry(T.country);return e(t,null,e(i,{classNameModifiers:[b,"address"],label:b},R&&e(g,{onAddressLookup:A.onAddressLookup,onAddressSelected:A.onAddressSelected,onSelect:Q,onManualAddress:U,externalErrorMessage:P,hideManualButton:H,showContextualElement:k,contextualText:v.get("address.search.contextualText"),addressSearchDebounceMs:A.addressSearchDebounceMs}),H&&e(t,null,Y.map(t=>t instanceof Array?e("div",{className:"adyen-checkout__field-group"},t.map(([e,t])=>X(e,{classNameModifiers:[`col-${t}`]}))):X(t,{})))))}A.defaultProps={countryCode:null,validationRules:null,data:{},onChange:()=>{},visibility:"editable",requiredFields:y,specifications:{},onFieldFocusAnalytics:()=>{},onFieldBlurAnalytics:()=>{}};export{A as default};
1
+ import{createElement as e,Fragment as t}from"../../../external/preact/dist/preact.js";import{useRef as o,useMemo as r,useState as s,useCallback as n,useEffect as a}from"../../../external/preact/hooks/dist/hooks.js";import i from"../FormFields/Fieldset/Fieldset.js";import l from"./components/ReadOnlyAddress.js";import{getAddressValidationRules as d}from"./validate.js";import{addressFormatters as c,countrySpecificFormatters as u}from"./validate.formats.js";import m from"./components/FieldContainer.js";import p from"../../../utils/useForm/useForm.js";import f from"./Specifications.js";import{ADDRESS_SCHEMA as y,FALLBACK_VALUE as F}from"./constants.js";import{getMaxLengthByFieldAndCountry as h}from"../../../utils/validator-utils.js";import{useCoreContext as C}from"../../../core/Context/CoreProvider.js";import g from"./components/AddressSearch.js";function A(A){const{i18n:v}=C(),{label:b="",requiredFields:j,visibility:x,iOSFocusedField:S=null,showContextualElement:k}=A,M=o({});Object.keys(M.current).length||A.setComponentRef?.(M.current);const O=r(()=>new f(A.specifications),[A.specifications]),D=O.getAddressSchemaForCountryFlat(A.countryCode).filter(e=>j.includes(e)),[w,B]=s(!1),[E,N]=s(!1),[P,L]=s(""),R=!!A.onAddressLookup,[V,q]=s(!1),H=!A.onAddressLookup||(w||E),{data:T,errors:_,valid:I,isValid:U,handleChangeFor:$,triggerValidation:z,setData:G,mergeData:J}=p({schema:D,defaultData:A.data,rules:{...d(O),...A.validationRules},formatters:c}),K=o(A.data?.country),Q=(T.country||K.current)?.toUpperCase(),W=r(()=>({...T,country:Q}),[T,Q]),X=n(e=>{const t=y.reduce((t,o)=>{const r=e[o];return null!=r&&(t[o]=String(r)),t},{});J(t),q(!0),z(),B(!0)},[B,z,G]),Y=n(()=>{N(!0)},[]);M.current.showValidation=()=>{z(),L(!R||H||U?"":v.get("address.errors.incomplete"))};const Z=D.filter(e=>!S||e===S);if(a(()=>{if(V)return void q(!1);const e=O.countryHasDataset(T.country)?"":F,t={...T,stateOrProvince:e};j.forEach(e=>{$(e,"input")(t[e]??"")}),t.postalCode&&$("postalCode","blur")(T.postalCode)},[T.country]),a(()=>{const e=j.includes("stateOrProvince"),t=T.country&&O.countryHasDataset(T.country),o=e&&t,r=T.stateOrProvince||(o?"":F);$("stateOrProvince","input")(r)},[]),a(()=>{const e=O.getOptionalFieldsForCountry(T.country),t=y.reduce((t,o)=>{const r=e.includes(o),s=j.includes(o),n=T[o],a=A.data[o],i=r&&!n||!s?s||n||!a?F:a:n;return i?.length&&(t[o]=i),t},{});!t.country&&K.current&&(t.country=K.current),A.onChange({data:t,valid:I,errors:_,isValid:U})},[T,I,_,U]),"hidden"===x)return null;if("readOnly"===x)return e(l,{data:T,label:b});const ee=(t,{classNameModifiers:o=[]})=>j.includes(t)?e(m,{key:t,allowedCountries:A.allowedCountries,classNameModifiers:[...o,t],data:W,errors:_,valid:I,fieldName:t,onInput:$(t,"input"),onBlur:$(t,"blur"),onDropdownChange:$(t,"blur"),specifications:O,maxLength:h(u,t,Q),trimOnBlur:!0,disabled:!Z.includes(t),onFieldFocusAnalytics:A.onFieldFocusAnalytics,onFieldBlurAnalytics:A.onFieldBlurAnalytics}):null,te=O.getAddressSchemaForCountry(T.country);return e(t,null,e(i,{classNameModifiers:[b,"address"],label:b},R&&e(g,{onAddressLookup:A.onAddressLookup,onAddressSelected:A.onAddressSelected,onSelect:X,onManualAddress:Y,externalErrorMessage:P,hideManualButton:H,showContextualElement:k,contextualText:v.get("address.search.contextualText"),addressSearchDebounceMs:A.addressSearchDebounceMs}),H&&e(t,null,te.map(t=>t instanceof Array?e("div",{className:"adyen-checkout__field-group"},t.map(([e,t])=>ee(e,{classNameModifiers:[`col-${t}`]}))):ee(t,{})))))}A.defaultProps={countryCode:null,validationRules:null,data:{},onChange:()=>{},visibility:"editable",requiredFields:y,specifications:{},onFieldFocusAnalytics:()=>{},onFieldBlurAnalytics:()=>{}};export{A as default};
2
2
  //# sourceMappingURL=Address.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Address.js","sources":["../../../../../src/components/internal/Address/Address.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport Fieldset from '../FormFields/Fieldset';\nimport ReadOnlyAddress from './components/ReadOnlyAddress';\nimport { getAddressValidationRules } from './validate';\nimport { addressFormatters, countrySpecificFormatters } from './validate.formats';\nimport { AddressProps } from './types';\nimport { AddressData } from '../../../types/global-types';\nimport FieldContainer from './components/FieldContainer';\nimport useForm from '../../../utils/useForm';\nimport Specifications from './Specifications';\nimport { ADDRESS_SCHEMA, FALLBACK_VALUE } from './constants';\nimport { getMaxLengthByFieldAndCountry } from '../../../utils/validator-utils';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport AddressSearch from './components/AddressSearch';\nimport { ComponentMethodsRef } from '../UIElement/types';\nimport './Address.scss';\n\nexport default function Address(props: AddressProps) {\n const { i18n } = useCoreContext();\n\n const { label = '', requiredFields, visibility, iOSFocusedField = null, showContextualElement } = props;\n\n /** An object by which to expose 'public' members to the parent UIElement */\n const addressRef = useRef<ComponentMethodsRef>({});\n // Just call once\n if (!Object.keys(addressRef.current).length) {\n props.setComponentRef?.(addressRef.current);\n }\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n const requiredFieldsSchema = specifications.getAddressSchemaForCountryFlat(props.countryCode).filter(field => requiredFields.includes(field));\n\n const [hasSelectedAddress, setHasSelectedAddress] = useState(false);\n\n const [useManualAddress, setUseManualAddress] = useState(false);\n\n const [searchErrorMessage, setSearchErrorMessage] = useState('');\n\n const showAddressSearch = !!props.onAddressLookup;\n\n const [ignoreCountryChange, setIgnoreCountryChange] = useState(false);\n\n const showAddressFields = props.onAddressLookup ? hasSelectedAddress || useManualAddress : true;\n\n const { data, errors, valid, isValid, handleChangeFor, triggerValidation, setData, mergeData } = useForm<AddressData>({\n schema: requiredFieldsSchema,\n defaultData: props.data,\n // Ensure any passed validation rules are merged with the default ones\n rules: { ...getAddressValidationRules(specifications), ...props.validationRules },\n formatters: addressFormatters\n });\n\n const setSearchData = useCallback(\n (selectedAddress: AddressData) => {\n const propsKeysToProcess = ADDRESS_SCHEMA;\n const newStateData = propsKeysToProcess.reduce((acc: AddressData, propKey) => {\n // Make sure the data provided by the merchant is always strings\n const providedValue = selectedAddress[propKey];\n if (providedValue !== null && providedValue !== undefined) {\n // Cast everything to string\n acc[propKey] = String(providedValue);\n }\n return acc;\n }, {});\n mergeData(newStateData);\n setIgnoreCountryChange(true);\n triggerValidation();\n setHasSelectedAddress(true);\n },\n [setHasSelectedAddress, triggerValidation, setData]\n );\n\n const onManualAddress = useCallback(() => {\n setUseManualAddress(true);\n }, []);\n\n // Expose method expected by (parent) Address.tsx\n addressRef.current.showValidation = () => {\n triggerValidation();\n if (showAddressSearch && !showAddressFields && !isValid) {\n setSearchErrorMessage(i18n.get('address.errors.incomplete'));\n } else {\n setSearchErrorMessage('');\n }\n };\n\n /**\n * For iOS: iOSFocusedField is the name of the element calling for other elements to be disabled\n * - so if it is set (meaning we are in iOS *and* an input has been focussed) only enable the field that corresponds to this element\n */\n const enabledFields: string[] = requiredFieldsSchema.filter(item => {\n return !iOSFocusedField ? true : item === iOSFocusedField;\n });\n\n /**\n * Effect that:\n * - Resets validation for all fields by triggering handleChangeFor(fieldName, 'input')\n * - Applies validation on postalCode field in case it has any value\n */\n useEffect((): void => {\n // if the country was set via setSearchData we don't want to trigger this\n if (ignoreCountryChange) {\n setIgnoreCountryChange(false);\n return;\n }\n\n const stateOrProvince = specifications.countryHasDataset(data.country) ? '' : FALLBACK_VALUE;\n const newData = { ...data, stateOrProvince };\n\n requiredFields.forEach(fieldName => {\n handleChangeFor(fieldName, 'input')(newData[fieldName] ?? '');\n });\n\n if (newData.postalCode) {\n handleChangeFor('postalCode', 'blur')(data.postalCode);\n }\n }, [data.country]);\n\n /**\n * Set the value of 'stateOrProvince' during the initial render if\n * property is provided during the creation of the payment method\n */\n useEffect((): void => {\n const stateFieldIsRequired = requiredFields.includes('stateOrProvince');\n const countryHasStatesDataset = data.country && specifications.countryHasDataset(data.country);\n const addressShouldHaveState = stateFieldIsRequired && countryHasStatesDataset;\n const stateOrProvince = data.stateOrProvince || (addressShouldHaveState ? '' : FALLBACK_VALUE);\n\n handleChangeFor('stateOrProvince', 'input')(stateOrProvince);\n }, []);\n\n useEffect((): void => {\n const optionalFields = specifications.getOptionalFieldsForCountry(data.country);\n const processedData = ADDRESS_SCHEMA.reduce((acc, cur) => {\n const isOptional = optionalFields.includes(cur);\n const isRequired = requiredFields.includes(cur);\n const newValue = data[cur];\n const initialValue = props.data[cur];\n // recover default data values which are not requiredFields, or prefill with 'N/A'\n const fallbackValue = !isRequired && !newValue && !!initialValue ? initialValue : FALLBACK_VALUE;\n const value = (isOptional && !newValue) || !isRequired ? fallbackValue : newValue;\n if (value?.length) acc[cur] = value;\n return acc;\n }, {});\n\n props.onChange({ data: processedData, valid, errors, isValid });\n }, [data, valid, errors, isValid]);\n\n if (visibility === 'hidden') return null;\n if (visibility === 'readOnly') return <ReadOnlyAddress data={data} label={label} />;\n\n const getComponent = (fieldName: string, { classNameModifiers = [] }) => {\n if (!requiredFields.includes(fieldName)) return null;\n\n return (\n <FieldContainer\n key={fieldName}\n allowedCountries={props.allowedCountries}\n classNameModifiers={[...classNameModifiers, fieldName]}\n data={data}\n errors={errors}\n valid={valid}\n fieldName={fieldName}\n onInput={handleChangeFor(fieldName, 'input')}\n onBlur={handleChangeFor(fieldName, 'blur')}\n onDropdownChange={handleChangeFor(fieldName, 'blur')}\n specifications={specifications}\n maxLength={getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country, true)}\n trimOnBlur={true}\n disabled={!enabledFields.includes(fieldName)}\n onFieldFocusAnalytics={props.onFieldFocusAnalytics}\n onFieldBlurAnalytics={props.onFieldBlurAnalytics}\n />\n );\n };\n\n const getWrapper = group => (\n <div className=\"adyen-checkout__field-group\">\n {group.map(([field, size]) => getComponent(field, { classNameModifiers: [`col-${size}`] }))}\n </div>\n );\n\n const addressSchema = specifications.getAddressSchemaForCountry(data.country);\n\n return (\n <Fragment>\n <Fieldset classNameModifiers={[label, 'address']} label={label}>\n {showAddressSearch && (\n <AddressSearch\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n onSelect={setSearchData}\n onManualAddress={onManualAddress}\n externalErrorMessage={searchErrorMessage}\n hideManualButton={showAddressFields}\n showContextualElement={showContextualElement}\n contextualText={i18n.get('address.search.contextualText')}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n />\n )}\n {showAddressFields && (\n <Fragment>{addressSchema.map(field => (field instanceof Array ? getWrapper(field) : getComponent(field, {})))}</Fragment>\n )}\n </Fieldset>\n </Fragment>\n );\n}\n\nAddress.defaultProps = {\n countryCode: null,\n validationRules: null,\n data: {},\n onChange: () => {},\n visibility: 'editable',\n requiredFields: ADDRESS_SCHEMA,\n specifications: {},\n onFieldFocusAnalytics: () => {},\n onFieldBlurAnalytics: () => {}\n};\n"],"names":["Address","props","i18n","useCoreContext","label","requiredFields","visibility","iOSFocusedField","showContextualElement","addressRef","useRef","Object","keys","current","length","setComponentRef","specifications","useMemo","Specifications","requiredFieldsSchema","getAddressSchemaForCountryFlat","countryCode","filter","field","includes","hasSelectedAddress","setHasSelectedAddress","useState","useManualAddress","setUseManualAddress","searchErrorMessage","setSearchErrorMessage","showAddressSearch","onAddressLookup","ignoreCountryChange","setIgnoreCountryChange","showAddressFields","data","errors","valid","isValid","handleChangeFor","triggerValidation","setData","mergeData","useForm","schema","defaultData","rules","getAddressValidationRules","validationRules","formatters","addressFormatters","setSearchData","useCallback","selectedAddress","newStateData","ADDRESS_SCHEMA","reduce","acc","propKey","providedValue","String","onManualAddress","showValidation","get","enabledFields","item","useEffect","stateOrProvince","countryHasDataset","country","FALLBACK_VALUE","newData","forEach","fieldName","postalCode","stateFieldIsRequired","countryHasStatesDataset","addressShouldHaveState","optionalFields","getOptionalFieldsForCountry","processedData","cur","isOptional","isRequired","newValue","initialValue","value","onChange","h","ReadOnlyAddress","getComponent","classNameModifiers","FieldContainer","key","allowedCountries","onInput","onBlur","onDropdownChange","maxLength","getMaxLengthByFieldAndCountry","countrySpecificFormatters","trimOnBlur","disabled","onFieldFocusAnalytics","onFieldBlurAnalytics","addressSchema","getAddressSchemaForCountry","Fragment","Fieldset","AddressSearch","onAddressSelected","onSelect","externalErrorMessage","hideManualButton","contextualText","addressSearchDebounceMs","map","Array","div","className","size","defaultProps"],"mappings":"u1BAkBe,SAASA,EAAQC,GAC5B,MAAMC,KAAEA,GAASC,KAEXC,MAAEA,EAAQ,GAAEC,eAAEA,EAAcC,WAAEA,EAAUC,gBAAEA,EAAkB,KAAIC,sBAAEA,GAA0BP,EAG5FQ,EAAaC,EAA4B,IAE1CC,OAAOC,KAAKH,EAAWI,SAASC,QACjCb,EAAMc,kBAAkBN,EAAWI,SAGvC,MAAMG,EAAiBC,EAAQ,IAAM,IAAIC,EAAejB,EAAMe,gBAAiB,CAACf,EAAMe,iBAEhFG,EAAuBH,EAAeI,+BAA+BnB,EAAMoB,aAAaC,OAAOC,GAASlB,EAAemB,SAASD,KAE/HE,EAAoBC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,EAAMwG,sBAC7BC,qBAAsBzG,EAAMyG,uBAnBY,KA8B9CC,EAAgB3F,EAAe4F,2BAA2BvE,EAAKkC,SAErE,OACImB,EAACmB,OACGnB,EAACoB,EAAAA,CAASjB,mBAAoB,CAACzF,EAAO,WAAYA,MAAOA,GACpD4B,GACG0D,EAACqB,EAAAA,CACG9E,gBAAiBhC,EAAMgC,gBACvB+E,kBAAmB/G,EAAM+G,kBACzBC,SAAU5D,EACVU,gBAAiBA,EACjBmD,qBAAsBpF,EACtBqF,iBAAkB/E,EAClB5B,sBAAuBA,EACvB4G,eAAgBlH,EAAK+D,IAAI,iCACzBoD,wBAAyBpH,EAAMoH,0BAGtCjF,GACGsD,EAACmB,EAAAA,KAAUF,EAAcW,IAAI/F,GAAUA,aAAiBgG,MAxBpE7B,EAAC8B,MAAAA,CAAIC,UAAU,+BAwBwElG,EAvB5E+F,IAAI,EAAE/F,EAAOmG,KAAU9B,EAAarE,EAAO,CAAEsE,mBAAoB,CAAC,OAAO6B,SAuBY9B,EAAarE,EAAO,CAAA,MAK5H,CAEAvB,EAAQ2H,aAAe,CACnBtG,YAAa,KACb6B,gBAAiB,KACjBb,KAAM,CAAA,EACNoD,SAAU,OACVnF,WAAY,WACZD,eAAgBoD,EAChBzC,eAAgB,CAAA,EAChByF,sBAAuB,OACvBC,qBAAsB"}
1
+ {"version":3,"file":"Address.js","sources":["../../../../../src/components/internal/Address/Address.tsx"],"sourcesContent":["import { Fragment, h } from 'preact';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport Fieldset from '../FormFields/Fieldset';\nimport ReadOnlyAddress from './components/ReadOnlyAddress';\nimport { getAddressValidationRules } from './validate';\nimport { addressFormatters, countrySpecificFormatters } from './validate.formats';\nimport { AddressProps } from './types';\nimport { AddressData } from '../../../types/global-types';\nimport FieldContainer from './components/FieldContainer';\nimport useForm from '../../../utils/useForm';\nimport Specifications from './Specifications';\nimport { ADDRESS_SCHEMA, FALLBACK_VALUE } from './constants';\nimport { getMaxLengthByFieldAndCountry } from '../../../utils/validator-utils';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport AddressSearch from './components/AddressSearch';\nimport { ComponentMethodsRef } from '../UIElement/types';\nimport './Address.scss';\n\nexport default function Address(props: AddressProps) {\n const { i18n } = useCoreContext();\n\n const { label = '', requiredFields, visibility, iOSFocusedField = null, showContextualElement } = props;\n\n /** An object by which to expose 'public' members to the parent UIElement */\n const addressRef = useRef<ComponentMethodsRef>({});\n // Just call once\n if (!Object.keys(addressRef.current).length) {\n props.setComponentRef?.(addressRef.current);\n }\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n const requiredFieldsSchema = specifications.getAddressSchemaForCountryFlat(props.countryCode).filter(field => requiredFields.includes(field));\n\n const [hasSelectedAddress, setHasSelectedAddress] = useState(false);\n\n const [useManualAddress, setUseManualAddress] = useState(false);\n\n const [searchErrorMessage, setSearchErrorMessage] = useState('');\n\n const showAddressSearch = !!props.onAddressLookup;\n\n const [ignoreCountryChange, setIgnoreCountryChange] = useState(false);\n\n const showAddressFields = props.onAddressLookup ? hasSelectedAddress || useManualAddress : true;\n\n const { data, errors, valid, isValid, handleChangeFor, triggerValidation, setData, mergeData } = useForm<AddressData>({\n schema: requiredFieldsSchema,\n defaultData: props.data,\n // Ensure any passed validation rules are merged with the default ones\n rules: { ...getAddressValidationRules(specifications), ...props.validationRules },\n formatters: addressFormatters\n });\n\n // In partial address mode, country is not in the form schema but we need it for regionalized labels.\n // Store the merchant's country config once at mount, then use it if form data doesn't have country.\n const initialCountryRef = useRef<string | undefined>((props.data as AddressData)?.country);\n const effectiveCountry = (data.country || initialCountryRef.current)?.toUpperCase();\n const dataWithCountry = useMemo(() => ({ ...data, country: effectiveCountry }), [data, effectiveCountry]);\n\n const setSearchData = useCallback(\n (selectedAddress: AddressData) => {\n const propsKeysToProcess = ADDRESS_SCHEMA;\n const newStateData = propsKeysToProcess.reduce((acc: AddressData, propKey) => {\n // Make sure the data provided by the merchant is always strings\n const providedValue = selectedAddress[propKey];\n if (providedValue !== null && providedValue !== undefined) {\n // Cast everything to string\n acc[propKey] = String(providedValue);\n }\n return acc;\n }, {});\n mergeData(newStateData);\n setIgnoreCountryChange(true);\n triggerValidation();\n setHasSelectedAddress(true);\n },\n [setHasSelectedAddress, triggerValidation, setData]\n );\n\n const onManualAddress = useCallback(() => {\n setUseManualAddress(true);\n }, []);\n\n // Expose method expected by (parent) Address.tsx\n addressRef.current.showValidation = () => {\n triggerValidation();\n if (showAddressSearch && !showAddressFields && !isValid) {\n setSearchErrorMessage(i18n.get('address.errors.incomplete'));\n } else {\n setSearchErrorMessage('');\n }\n };\n\n /**\n * For iOS: iOSFocusedField is the name of the element calling for other elements to be disabled\n * - so if it is set (meaning we are in iOS *and* an input has been focussed) only enable the field that corresponds to this element\n */\n const enabledFields: string[] = requiredFieldsSchema.filter(item => {\n return !iOSFocusedField ? true : item === iOSFocusedField;\n });\n\n /**\n * Effect that:\n * - Resets validation for all fields by triggering handleChangeFor(fieldName, 'input')\n * - Applies validation on postalCode field in case it has any value\n */\n useEffect((): void => {\n // if the country was set via setSearchData we don't want to trigger this\n if (ignoreCountryChange) {\n setIgnoreCountryChange(false);\n return;\n }\n\n const stateOrProvince = specifications.countryHasDataset(data.country) ? '' : FALLBACK_VALUE;\n const newData = { ...data, stateOrProvince };\n\n requiredFields.forEach(fieldName => {\n handleChangeFor(fieldName, 'input')(newData[fieldName] ?? '');\n });\n\n if (newData.postalCode) {\n handleChangeFor('postalCode', 'blur')(data.postalCode);\n }\n }, [data.country]);\n\n /**\n * Set the value of 'stateOrProvince' during the initial render if\n * property is provided during the creation of the payment method\n */\n useEffect((): void => {\n const stateFieldIsRequired = requiredFields.includes('stateOrProvince');\n const countryHasStatesDataset = data.country && specifications.countryHasDataset(data.country);\n const addressShouldHaveState = stateFieldIsRequired && countryHasStatesDataset;\n const stateOrProvince = data.stateOrProvince || (addressShouldHaveState ? '' : FALLBACK_VALUE);\n\n handleChangeFor('stateOrProvince', 'input')(stateOrProvince);\n }, []);\n\n useEffect((): void => {\n const optionalFields = specifications.getOptionalFieldsForCountry(data.country);\n const processedData = ADDRESS_SCHEMA.reduce((acc, cur) => {\n const isOptional = optionalFields.includes(cur);\n const isRequired = requiredFields.includes(cur);\n const newValue = data[cur];\n const initialValue = props.data[cur];\n // recover default data values which are not requiredFields, or prefill with 'N/A'\n const fallbackValue = !isRequired && !newValue && !!initialValue ? initialValue : FALLBACK_VALUE;\n const value = (isOptional && !newValue) || !isRequired ? fallbackValue : newValue;\n if (value?.length) acc[cur] = value;\n return acc;\n }, {});\n\n // In partial address mode, ensure country is included in output for regionalized labels/validation.\n if (!(processedData as AddressData).country && initialCountryRef.current) {\n (processedData as AddressData).country = initialCountryRef.current;\n }\n\n props.onChange({ data: processedData, valid, errors, isValid });\n }, [data, valid, errors, isValid]);\n\n if (visibility === 'hidden') return null;\n if (visibility === 'readOnly') return <ReadOnlyAddress data={data} label={label} />;\n\n const getComponent = (fieldName: string, { classNameModifiers = [] }) => {\n if (!requiredFields.includes(fieldName)) return null;\n\n return (\n <FieldContainer\n key={fieldName}\n allowedCountries={props.allowedCountries}\n classNameModifiers={[...classNameModifiers, fieldName]}\n data={dataWithCountry}\n errors={errors}\n valid={valid}\n fieldName={fieldName}\n onInput={handleChangeFor(fieldName, 'input')}\n onBlur={handleChangeFor(fieldName, 'blur')}\n onDropdownChange={handleChangeFor(fieldName, 'blur')}\n specifications={specifications}\n maxLength={getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, effectiveCountry, true)}\n trimOnBlur={true}\n disabled={!enabledFields.includes(fieldName)}\n onFieldFocusAnalytics={props.onFieldFocusAnalytics}\n onFieldBlurAnalytics={props.onFieldBlurAnalytics}\n />\n );\n };\n\n const getWrapper = group => (\n <div className=\"adyen-checkout__field-group\">\n {group.map(([field, size]) => getComponent(field, { classNameModifiers: [`col-${size}`] }))}\n </div>\n );\n\n const addressSchema = specifications.getAddressSchemaForCountry(data.country);\n\n return (\n <Fragment>\n <Fieldset classNameModifiers={[label, 'address']} label={label}>\n {showAddressSearch && (\n <AddressSearch\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n onSelect={setSearchData}\n onManualAddress={onManualAddress}\n externalErrorMessage={searchErrorMessage}\n hideManualButton={showAddressFields}\n showContextualElement={showContextualElement}\n contextualText={i18n.get('address.search.contextualText')}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n />\n )}\n {showAddressFields && (\n <Fragment>{addressSchema.map(field => (field instanceof Array ? getWrapper(field) : getComponent(field, {})))}</Fragment>\n )}\n </Fieldset>\n </Fragment>\n );\n}\n\nAddress.defaultProps = {\n countryCode: null,\n validationRules: null,\n data: {},\n onChange: () => {},\n visibility: 'editable',\n requiredFields: ADDRESS_SCHEMA,\n specifications: {},\n onFieldFocusAnalytics: () => {},\n onFieldBlurAnalytics: () => {}\n};\n"],"names":["Address","props","i18n","useCoreContext","label","requiredFields","visibility","iOSFocusedField","showContextualElement","addressRef","useRef","Object","keys","current","length","setComponentRef","specifications","useMemo","Specifications","requiredFieldsSchema","getAddressSchemaForCountryFlat","countryCode","filter","field","includes","hasSelectedAddress","setHasSelectedAddress","useState","useManualAddress","setUseManualAddress","searchErrorMessage","setSearchErrorMessage","showAddressSearch","onAddressLookup","ignoreCountryChange","setIgnoreCountryChange","showAddressFields","data","errors","valid","isValid","handleChangeFor","triggerValidation","setData","mergeData","useForm","schema","defaultData","rules","getAddressValidationRules","validationRules","formatters","addressFormatters","initialCountryRef","country","effectiveCountry","toUpperCase","dataWithCountry","setSearchData","useCallback","selectedAddress","newStateData","ADDRESS_SCHEMA","reduce","acc","propKey","providedValue","String","onManualAddress","showValidation","get","enabledFields","item","useEffect","stateOrProvince","countryHasDataset","FALLBACK_VALUE","newData","forEach","fieldName","postalCode","stateFieldIsRequired","countryHasStatesDataset","addressShouldHaveState","optionalFields","getOptionalFieldsForCountry","processedData","cur","isOptional","isRequired","newValue","initialValue","value","onChange","h","ReadOnlyAddress","getComponent","classNameModifiers","FieldContainer","key","allowedCountries","onInput","onBlur","onDropdownChange","maxLength","getMaxLengthByFieldAndCountry","countrySpecificFormatters","trimOnBlur","disabled","onFieldFocusAnalytics","onFieldBlurAnalytics","addressSchema","getAddressSchemaForCountry","Fragment","Fieldset","AddressSearch","onAddressSelected","onSelect","externalErrorMessage","hideManualButton","contextualText","addressSearchDebounceMs","map","Array","div","className","size","defaultProps"],"mappings":"u1BAkBe,SAASA,EAAQC,GAC5B,MAAMC,KAAEA,GAASC,KAEXC,MAAEA,EAAQ,GAAEC,eAAEA,EAAcC,WAAEA,EAAUC,gBAAEA,EAAkB,KAAIC,sBAAEA,GAA0BP,EAG5FQ,EAAaC,EAA4B,IAE1CC,OAAOC,KAAKH,EAAWI,SAASC,QACjCb,EAAMc,kBAAkBN,EAAWI,SAGvC,MAAMG,EAAiBC,EAAQ,IAAM,IAAIC,EAAejB,EAAMe,gBAAiB,CAACf,EAAMe,iBAEhFG,EAAuBH,EAAeI,+BAA+BnB,EAAMoB,aAAaC,OAAOC,GAASlB,EAAemB,SAASD,KAE/HE,EAAoBC,GAAyBC,GAAS,IAEtDC,EAAkBC,GAAuBF,GAAS,IAElDG,EAAoBC,GAAyBJ,EAAS,IAEvDK,IAAsB/B,EAAMgC,iBAE3BC,EAAqBC,GAA0BR,GAAS,GAEzDS,GAAoBnC,EAAMgC,kBAAkBR,GAAsBG,IAElES,KAAEA,EAAIC,OAAEA,EAAMC,MAAEA,EAAKC,QAAEA,EAAOC,gBAAEA,EAAeC,kBAAEA,EAAiBC,QAAEA,EAAOC,UAAEA,GAAcC,EAAqB,CAClHC,OAAQ3B,EACR4B,YAAa9C,EAAMoC,KAEnBW,MAAO,IAAKC,EAA0BjC,MAAoBf,EAAMiD,iBAChEC,WAAYC,IAKVC,EAAoB3C,EAA4BT,EAAMoC,MAAsBiB,SAC5EC,GAAoBlB,EAAKiB,SAAWD,EAAkBxC,UAAU2C,cAChEC,EAAk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AAU3D,EACVU,gBAAiBA,EACjBkD,qBAAsBxF,EACtByF,iBAAkBnF,EAClB5B,sBAAuBA,EACvBgH,eAAgBtH,EAAKoE,IAAI,iCACzBmD,wBAAyBxH,EAAMwH,0BAGtCrF,GACG0D,EAACmB,EAAAA,KAAUF,GAAcW,IAAInG,GAAUA,aAAiBoG,MAxBpE7B,EAAC8B,MAAAA,CAAIC,UAAU,+BAwBwEtG,EAvB5EmG,IAAI,EAAEnG,EAAOuG,KAAU9B,GAAazE,EAAO,CAAE0E,mBAAoB,CAAC,OAAO6B,SAuBY9B,GAAazE,EAAO,CAAA,MAK5H,CAEAvB,EAAQ+H,aAAe,CACnB1G,YAAa,KACb6B,gBAAiB,KACjBb,KAAM,CAAA,EACNwD,SAAU,OACVvF,WAAY,WACZD,eAAgByD,EAChB9C,eAAgB,CAAA,EAChB6F,sBAAuB,OACvBC,qBAAsB"}
@@ -1,2 +1,2 @@
1
- const e="N/A",a=["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],[t,s,l,r,o,c]=a,i={AU:{hasDataset:!0,labels:{[s]:"apartmentSuite",[o]:"state",[t]:"address"},optionalFields:[s],placeholders:{[o]:"select.state"},schema:[c,t,s,r,[[o,50],[l,50]]]},BR:{hasDataset:!0,labels:{[o]:"state"},placeholders:{[o]:"select.state"}},CA:{hasDataset:!0,labels:{[s]:"apartmentSuite",[o]:"provinceOrTerritory",[t]:"address"},optionalFields:[s],schema:[c,t,s,[[r,70],[l,30]],o]},GB:{labels:{[r]:"cityTown"},schema:[c,[[s,30],[t,70]],[[r,70],[l,30]],o]},US:{hasDataset:!0,labels:{[l]:"zipCode",[s]:"apartmentSuite",[o]:"state",[t]:"address"},optionalFields:[s],placeholders:{[o]:"select.state"},schema:[c,t,s,r,[[o,50],[l,50]]]},default:{optionalFields:[],placeholders:{[o]:"select.provinceOrTerritory"},schema:[c,[[t,70],[s,30]],[[l,30],[r,70]],o]}},d={default:{labels:{[l]:"zipCode"},schema:[l]}},p=Object.keys(i);export{a as ADDRESS_SCHEMA,i as ADDRESS_SPECIFICATIONS,r as CITY,p as COUNTRIES_WITH_CUSTOM_SPECIFICATION,c as COUNTRY,e as FALLBACK_VALUE,s as HOUSE_NUMBER_OR_NAME,d as PARTIAL_ADDRESS_SCHEMA,l as POSTAL_CODE,o as STATE_OR_PROVINCE,t as STREET};
1
+ const e="N/A",a=["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],[s,t,l,r,o,c]=a,i={AU:{hasDataset:!0,labels:{[t]:"apartmentSuite",[o]:"state",[s]:"address"},optionalFields:[t],placeholders:{[o]:"select.state"},schema:[c,s,t,r,[[o,50],[l,50]]]},BR:{hasDataset:!0,labels:{[o]:"state"},placeholders:{[o]:"select.state"}},CA:{hasDataset:!0,labels:{[t]:"apartmentSuite",[o]:"provinceOrTerritory",[s]:"address"},optionalFields:[t],schema:[c,s,t,[[r,70],[l,30]],o]},GB:{labels:{[r]:"cityTown"},schema:[c,[[t,30],[s,70]],[[r,70],[l,30]],o]},US:{hasDataset:!0,labels:{[l]:"zipCode",[t]:"apartmentSuite",[o]:"state",[s]:"address"},optionalFields:[t],placeholders:{[o]:"select.state"},schema:[c,s,t,r,[[o,50],[l,50]]]},default:{optionalFields:[],placeholders:{[o]:"select.provinceOrTerritory"},schema:[c,[[s,70],[t,30]],[[l,30],[r,70]],o]}},d=Object.keys(i).reduce((e,a)=>(e[a]={labels:i[a].labels,schema:[l]},e),{}),p=Object.keys(i);export{a as ADDRESS_SCHEMA,i as ADDRESS_SPECIFICATIONS,r as CITY,p as COUNTRIES_WITH_CUSTOM_SPECIFICATION,c as COUNTRY,e as FALLBACK_VALUE,t as HOUSE_NUMBER_OR_NAME,d as PARTIAL_ADDRESS_SCHEMA,l as POSTAL_CODE,o as STATE_OR_PROVINCE,s as STREET};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/components/internal/Address/constants.ts"],"sourcesContent":["import { AddressSpecifications } from './types';\n\nexport const FALLBACK_VALUE = 'N/A';\nexport const ADDRESS_SCHEMA = ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'] as const;\nexport const [STREET, HOUSE_NUMBER_OR_NAME, POSTAL_CODE, CITY, STATE_OR_PROVINCE, COUNTRY] = ADDRESS_SCHEMA;\n// prettier-ignore\nexport const ADDRESS_SPECIFICATIONS: AddressSpecifications = {\n AU: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n BR: {\n hasDataset: true,\n labels: {\n [STATE_OR_PROVINCE]: 'state'\n },\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n },\n CA: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'provinceOrTerritory',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n GB: {\n labels: {\n [CITY]: 'cityTown'\n },\n schema: [COUNTRY, [[HOUSE_NUMBER_OR_NAME, 30], [STREET, 70]], [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n US: {\n hasDataset: true,\n labels: {\n [POSTAL_CODE]: 'zipCode',\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n default: {\n optionalFields: [],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.provinceOrTerritory'\n },\n schema: [COUNTRY, [[STREET, 70], [HOUSE_NUMBER_OR_NAME, 30]], [[POSTAL_CODE, 30], [CITY, 70]], STATE_OR_PROVINCE],\n }\n};\n\nexport const PARTIAL_ADDRESS_SCHEMA: AddressSpecifications = {\n default: {\n labels: {\n [POSTAL_CODE]: 'zipCode'\n },\n schema: [POSTAL_CODE]\n }\n};\n\nexport const COUNTRIES_WITH_CUSTOM_SPECIFICATION = Object.keys(ADDRESS_SPECIFICATIONS);\n"],"names":["FALLBACK_VALUE","ADDRESS_SCHEMA","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","STATE_OR_PROVINCE","COUNTRY","ADDRESS_SPECIFICATIONS","AU","hasDataset","labels","optionalFields","placeholders","schema","BR","CA","GB","US","default","PARTIAL_ADDRESS_SCHEMA","COUNTRIES_WITH_CUSTOM_SPECIFICATION","Object","keys"],"mappings":"AAEO,MAAMA,EAAiB,MACjBC,EAAiB,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,YACzFC,EAAQC,EAAsBC,EAAaC,EAAMC,EAAmBC,GAAWN,EAEhFO,EAAgD,CACzDC,GAAI,CACAC,YAAY,EACZC,OAAQ,CACJR,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEdU,eAAgB,CAACT,GACjBU,aAAc,CACVP,CAACA,GAAoB,gBAEzBQ,OAAQ,CAACP,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGW,GAAI,CACAL,YAAY,EACZC,OAAQ,CACJL,CAACA,GAAoB,SAEzBO,aAAc,CACVP,CAACA,GAAoB,iBAG7BU,GAAI,CACAN,YAAY,EACZC,OAAQ,CACJR,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,sBACrBJ,CAACA,GAAS,WAEdU,eAAgB,CAACT,GACjBW,OAAQ,CAACP,EAASL,EAAQC,EAAsB,CAAC,CAACE,EAAM,IAAK,CAACD,EAAa,KAAME,IAErFW,GAAI,CACAN,OAAQ,CACJN,CAACA,GAAO,YAEZS,OAAQ,CAACP,EAAS,CAAC,CAACJ,EAAsB,IAAK,CAACD,EAAQ,KAAM,CAAC,CAACG,EAAM,IAAK,CAACD,EAAa,KAAME,IAEnGY,GAAI,CACAR,YAAY,EACZC,OAAQ,CACJP,CAACA,GAAc,UACfD,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEdU,eAAgB,CAACT,GACjBU,aAAc,CACVP,CAACA,GAAoB,gBAEzBQ,OAAQ,CAACP,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGe,QAAS,CACLP,eAAgB,GAChBC,aAAc,CACVP,CAACA,GAAoB,8BAEzBQ,OAAQ,CAACP,EAAS,CAAC,CAACL,EAAQ,IAAK,CAACC,EAAsB,KAAM,CAAC,CAACC,EAAa,IAAK,CAACC,EAAM,KAAMC,KAI1Fc,EAAgD,CACzDD,QAAS,CACLR,OAAQ,CACJP,CAACA,GAAc,WAEnBU,OAAQ,CAACV,KAIJiB,EAAsCC,OAAOC,KAAKf"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/components/internal/Address/constants.ts"],"sourcesContent":["import { AddressSpecifications } from './types';\n\nexport const FALLBACK_VALUE = 'N/A';\nexport const ADDRESS_SCHEMA = ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'] as const;\nexport const [STREET, HOUSE_NUMBER_OR_NAME, POSTAL_CODE, CITY, STATE_OR_PROVINCE, COUNTRY] = ADDRESS_SCHEMA;\n// prettier-ignore\nexport const ADDRESS_SPECIFICATIONS: AddressSpecifications = {\n AU: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n BR: {\n hasDataset: true,\n labels: {\n [STATE_OR_PROVINCE]: 'state'\n },\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n },\n CA: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'provinceOrTerritory',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n GB: {\n labels: {\n [CITY]: 'cityTown'\n },\n schema: [COUNTRY, [[HOUSE_NUMBER_OR_NAME, 30], [STREET, 70]], [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n US: {\n hasDataset: true,\n labels: {\n [POSTAL_CODE]: 'zipCode',\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n default: {\n optionalFields: [],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.provinceOrTerritory'\n },\n schema: [COUNTRY, [[STREET, 70], [HOUSE_NUMBER_OR_NAME, 30]], [[POSTAL_CODE, 30], [CITY, 70]], STATE_OR_PROVINCE],\n }\n};\n\nexport const PARTIAL_ADDRESS_SCHEMA: AddressSpecifications = Object.keys(ADDRESS_SPECIFICATIONS).reduce((acc, countryCode) => {\n acc[countryCode] = {\n labels: ADDRESS_SPECIFICATIONS[countryCode].labels,\n schema: [POSTAL_CODE]\n };\n return acc;\n}, {} as AddressSpecifications);\n\nexport const COUNTRIES_WITH_CUSTOM_SPECIFICATION = Object.keys(ADDRESS_SPECIFICATIONS);\n"],"names":["FALLBACK_VALUE","ADDRESS_SCHEMA","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","STATE_OR_PROVINCE","COUNTRY","ADDRESS_SPECIFICATIONS","AU","hasDataset","labels","optionalFields","placeholders","schema","BR","CA","GB","US","default","PARTIAL_ADDRESS_SCHEMA","Object","keys","reduce","acc","countryCode","COUNTRIES_WITH_CUSTOM_SPECIFICATION"],"mappings":"AAEO,MAAMA,EAAiB,MACjBC,EAAiB,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,YACzFC,EAAQC,EAAsBC,EAAaC,EAAMC,EAAmBC,GAAWN,EAEhFO,EAAgD,CACzDC,GAAI,CACAC,YAAY,EACZC,OAAQ,CACJR,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEdU,eAAgB,CAACT,GACjBU,aAAc,CACVP,CAACA,GAAoB,gBAEzBQ,OAAQ,CAACP,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGW,GAAI,CACAL,YAAY,EACZC,OAAQ,CACJL,CAACA,GAAoB,SAEzBO,aAAc,CACVP,CAACA,GAAoB,iBAG7BU,GAAI,CACAN,YAAY,EACZC,OAAQ,CACJR,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,sBACrBJ,CAACA,GAAS,WAEdU,eAAgB,CAACT,GACjBW,OAAQ,CAACP,EAASL,EAAQC,EAAsB,CAAC,CAACE,EAAM,IAAK,CAACD,EAAa,KAAME,IAErFW,GAAI,CACAN,OAAQ,CACJN,CAACA,GAAO,YAEZS,OAAQ,CAACP,EAAS,CAAC,CAACJ,EAAsB,IAAK,CAACD,EAAQ,KAAM,CAAC,CAACG,EAAM,IAAK,CAACD,EAAa,KAAME,IAEnGY,GAAI,CACAR,YAAY,EACZC,OAAQ,CACJP,CAACA,GAAc,UACfD,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEdU,eAAgB,CAACT,GACjBU,aAAc,CACVP,CAACA,GAAoB,gBAEzBQ,OAAQ,CAACP,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGe,QAAS,CACLP,eAAgB,GAChBC,aAAc,CACVP,CAACA,GAAoB,8BAEzBQ,OAAQ,CAACP,EAAS,CAAC,CAACL,EAAQ,IAAK,CAACC,EAAsB,KAAM,CAAC,CAACC,EAAa,IAAK,CAACC,EAAM,KAAMC,KAI1Fc,EAAgDC,OAAOC,KAAKd,GAAwBe,OAAO,CAACC,EAAKC,KAC1GD,EAAIC,GAAe,CACfd,OAAQH,EAAuBiB,GAAad,OAC5CG,OAAQ,CAACV,IAENoB,GACR,CAAA,GAEUE,EAAsCL,OAAOC,KAAKd"}
@@ -1,2 +1,2 @@
1
- import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/getProp.js";import r from"../../../utils/uuid.js";import o from"../../../core/Errors/AdyenCheckoutError.js";import{NO_CHECKOUT_ATTEMPT_ID as s}from"../../../core/Analytics/constants.js";import{on as n,off as i}from"../../../utils/listenerUtils.js";function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class h{buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}submitAnalytics(t){return null}handleKeyPress(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=e(this.props,"modules.risk.data"),r=e(this.props,"modules.analytics.getCheckoutAttemptId")?.()??s,o=this.state.order||this.props.order,n=this.formatData();return n.paymentMethod&&r&&(n.paymentMethod.checkoutAttemptId=r),{...t&&{riskData:{clientData:t}},...o&&{order:{orderData:o.orderData,pspReference:o.pspReference}},...n,clientStateDataIndicator:!0}}activate(){}render(){throw new Error("Payment method cannot be rendered.")}mount(e){const r="string"==typeof e?document.querySelector(e):e;if(!r)throw new Error("Component could not mount. Root node was not found.");return this._node&&this.unmount(),this._node=r,n(this._node,"keypress",this.handleKeyPress,!1),this._component=this.render(),t(this._component,r),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return i(this._node,"keypress",this.handleKeyPress),this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}constructor(t,e){a(this,"_id",`${this.constructor.type}-${r()}`),a(this,"core",void 0),a(this,"props",void 0),a(this,"state",{}),a(this,"_component",void 0),a(this,"_node",null);const s=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!s)throw new o("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(e),this.handleKeyPress=this.handleKeyPress.bind(this)}}a(h,"defaultProps",{});export{h as default};
1
+ import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/getProp.js";import r from"../../../utils/uuid.js";import o from"../../../core/Errors/AdyenCheckoutError.js";import{NO_CHECKOUT_ATTEMPT_ID as s}from"../../../core/Analytics/constants.js";import{on as n,off as i}from"../../../utils/listenerUtils.js";import{createSdkData as a}from"../../../utils/createSdkData.js";function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class u{buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}submitAnalytics(t){return null}handleKeyPress(t){return null}setState(t){this.state={...this.state,...t}}get data(){const t=e(this.props,"modules.risk.data"),r=e(this.props,"modules.analytics.getCheckoutAttemptId")?.()??s,o=this.state.order||this.props.order,n=this.formatData(),i=a(r,t);return n.paymentMethod&&r&&(n.paymentMethod.checkoutAttemptId=r),n.paymentMethod&&i&&(n.paymentMethod.sdkData=i),{...t&&{riskData:{clientData:t}},...o&&{order:{orderData:o.orderData,pspReference:o.pspReference}},...n,clientStateDataIndicator:!0}}activate(){}render(){throw new Error("Payment method cannot be rendered.")}mount(e){const r="string"==typeof e?document.querySelector(e):e;if(!r)throw new Error("Component could not mount. Root node was not found.");return this._node&&this.unmount(),this._node=r,n(this._node,"keypress",this.handleKeyPress,!1),this._component=this.render(),t(this._component,r),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this._node)}unmount(){return i(this._node,"keypress",this.handleKeyPress),this._node&&t(null,this._node),this}remove(){this.unmount(),this.core&&this.core.remove(this)}constructor(t,e){h(this,"_id",`${this.constructor.type}-${r()}`),h(this,"core",void 0),h(this,"props",void 0),h(this,"state",{}),h(this,"_component",void 0),h(this,"_node",null);const s=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!s)throw new o("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(e),this.handleKeyPress=this.handleKeyPress.bind(this)}}h(u,"defaultProps",{});export{u as default};
2
2
  //# sourceMappingURL=BaseElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { NO_CHECKOUT_ATTEMPT_ID } from '../../../core/Analytics/constants';\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport { off, on } from '../../../utils/listenerUtils';\nimport { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyPress = this.handleKeyPress.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: AbstractAnalyticsEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const clientData = getProp(this.props, 'modules.risk.data');\n const checkoutAttemptId = getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() ?? NO_CHECKOUT_ATTEMPT_ID; // NOTE: we never expect to see this \"failed\" value, but, just in case...\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n /**\n * Method used to make the payment method active\n * (Useful when there are different payment methods available and activating one PM must trigger a specific task)\n */\n public activate(): void {\n return;\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key press events, notably 'Enter' key presses\n on(this._node, 'keypress', this.handleKeyPress, false);\n\n this._component = this.render();\n\n render(this._component, node);\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n // Remove listener\n off(this._node, 'keypress', this.handleKeyPress);\n\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","buildElementProps","componentProps","this","props","formatProps","constructor","formatData","submitAnalytics","analyticsObj","handleKeyPress","e","setState","newState","state","data","clientData","getProp","checkoutAttemptId","NO_CHECKOUT_ATTEMPT_ID","order","componentData","paymentMethod","riskData","orderData","pspReference","clientStateDataIndicator","activate","render","Error","mount","domNode","node","document","querySelector","_node","unmount","on","_component","update","off","remove","core","checkout","_define_property","_id","uuid","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","bind","defaultProps"],"mappings":"8cAsBA,MAAeA,EA4BDC,iBAAAA,CAAkBC,GACxBC,KAAKC,MAAQD,KAAKE,YAAY,IAAKF,KAAKG,YAAY,gBAAoBJ,GAC5E,CAMUG,WAAAA,CAAYD,GAClB,OAAOA,CACX,CAMA,UAAAG,GACI,MAAO,CAAA,CACX,CAGUC,eAAAA,CAAgBC,GACtB,OAAO,IACX,CAGUC,cAAAA,CAAeC,GACrB,OAAO,IACX,CAEUC,QAAAA,CAASC,GACfV,KAAKW,MAAQ,IAAKX,KAAKW,SAAUD,EACrC,CAMA,QAAWE,GACP,MAAMC,EAAaC,EAAQd,KAAKC,MAAO,qBACjCc,EAAoBD,EAAQd,KAAKC,MAAO,yCAApBa,MAAqEE,EACzFC,EAAQjB,KAAKW,MAAMM,OAASjB,KAAKC,MAAMgB,MACvCC,EAAgBlB,KAAKI,aAM3B,OAJIc,EAAcC,eAAiBJ,IAC/BG,EAAcC,cAAcJ,kBAAoBA,GAG7C,IACCF,GAAc,CAAEO,SAAU,CAAEP,kBAC5BI,GAAS,CAAEA,MAAO,CAAEI,UAAWJ,EAAMI,UAAWC,aAAcL,EAAMK,kBACrEJ,EACHK,0BAA0B,EAElC,CAMA,QAAAC,GAEA,CAEOC,MAAAA,GAEH,MAAM,IAAIC,MAAM,qCACpB,CAOOC,KAAAA,CAAMC,GACT,MAAMC,EAA0B,iBAAZD,EAAuBE,SAAS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/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render } from 'preact';\nimport getProp from '../../../utils/getProp';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { NO_CHECKOUT_ATTEMPT_ID } from '../../../core/Analytics/constants';\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport { off, on } from '../../../utils/listenerUtils';\nimport { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\nimport { createSdkData } from '../../../utils/createSdkData';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps> implements IBaseElement {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: any = {};\n public _component;\n\n protected _node: HTMLElement = null;\n\n protected static defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyPress = this.handleKeyPress.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): any {\n return {};\n }\n\n /* eslint-disable-next-line */\n protected submitAnalytics(analyticsObj?: AbstractAnalyticsEvent) {\n return null;\n }\n\n /* eslint-disable-next-line */\n protected handleKeyPress(e: h.JSX.TargetedKeyboardEvent<HTMLInputElement>) {\n return null;\n }\n\n protected setState(newState: object): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n // first one used for the clientData field in the payment request\n const clientData = getProp(this.props, 'modules.risk.data');\n const checkoutAttemptId = getProp(this.props, 'modules.analytics.getCheckoutAttemptId')?.() ?? NO_CHECKOUT_ATTEMPT_ID; // NOTE: we never expect to see this \"failed\" value, but, just in case...\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n\n const sdkData = createSdkData(checkoutAttemptId, clientData);\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n if (componentData.paymentMethod && sdkData) {\n componentData.paymentMethod.sdkData = sdkData;\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n /**\n * Method used to make the payment method active\n * (Useful when there are different payment methods available and activating one PM must trigger a specific task)\n */\n public activate(): void {\n return;\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key press events, notably 'Enter' key presses\n on(this._node, 'keypress', this.handleKeyPress, false);\n\n this._component = this.render();\n\n render(this._component, node);\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {};\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n // Remove listener\n off(this._node, 'keypress', this.handleKeyPress);\n\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","buildElementProps","componentProps","this","props","formatProps","constructor","formatData","submitAnalytics","analyticsObj","handleKeyPress","e","setState","newState","state","data","clientData","getProp","checkoutAttemptId","NO_CHECKOUT_ATTEMPT_ID","order","componentData","sdkData","createSdkData","paymentMethod","riskData","orderData","pspReference","clientStateDataIndicator","activate","render","Error","mount","domNode","node","document","querySelector","_node","unmount","on","_component","update","off","remove","core","checkout","_define_property","_id","uuid","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","bind","defaultProps"],"mappings":"8gBAuBA,MAAeA,EA4BDC,iBAAAA,CAAkBC,GACxBC,KAAKC,MAAQD,KAAKE,YAAY,IAAKF,KAAKG,YAAY,gBAAoBJ,GAC5E,CAMUG,WAAAA,CAAYD,GAClB,OAAOA,CACX,CAMA,UAAAG,GACI,MAAO,CAAA,CACX,CAGUC,eAAAA,CAAgBC,GACtB,OAAO,IACX,CAGUC,cAAAA,CAAeC,GACrB,OAAO,IACX,CAEUC,QAAAA,CAASC,GACfV,KAAKW,MAAQ,IAAKX,KAAKW,SAAUD,EACrC,CAMA,QAAWE,GAEP,MAAMC,EAAaC,EAAQd,KAAKC,MAAO,qBACjCc,EAAoBD,EAA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,QAAW0C,OACrDF,EAAA3C,KAAgByC,YAAhB,GAEAE,EAAA3C,KAAOC,aAAP,GACA0C,EAAA3C,KAAOW,QAAa,IACpBgC,EAAA3C,KAAOqC,kBAAP,GAEAM,EAAA3C,KAAUkC,QAAqB,MAK3B,MAAMY,EAnBd,SAA8BJ,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASK,YAAkE,mBAA9BL,EAASM,iBAEtF,CAe+BC,CAAqBP,GAE5C,IAAKI,EACD,MAAM,IAAII,EACN,uBACA,uCAAuClD,KAAKG,YAAY,6DAIhEH,KAAKyC,KAAOC,EACZ1C,KAAKF,kBAAkBG,GAEvBD,KAAKO,eAAiBP,KAAKO,eAAe4C,KAAKnD,KACnD,EAhBA2C,EAVW9C,EAUMuD,eAAe"}
@@ -1,2 +1,2 @@
1
- import{Component as e,createElement as t}from"../../../external/preact/dist/preact.js";import n from"../../../_virtual/index.js";import o from"../Spinner/Spinner.js";import{useCoreContext as a}from"../../../core/Context/CoreProvider.js";function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class i extends e{render(){const{classNameModifiers:e=[],disabled:s,href:i,icon:r,onClickCompletedIcon:l,inline:c,label:d,ariaLabel:u,ariaDescribedBy:p,status:m,variant:_,buttonRef:b,onClickCompletedLabel:h,onMouseEnter:y,onMouseLeave:f,onFocus:k,onBlur:g,onKeyDown:C,onKeyPress:N}=this.props,{completed:v}=this.state,{i18n:x}=a(),j=l||r?t("img",{className:"adyen-checkout__button__icon",src:this.state.completed?l??r:r,alt:"","aria-hidden":"true"}):"",M=[...e,..."primary"!==_?[_]:[],...c?["inline"]:[],...v?["completed"]:[],..."loading"===m||"redirect"===m?["loading"]:[]],P=n(["adyen-checkout__button",...M.map(e=>`adyen-checkout__button--${e}`)]),B={loading:t("span",{className:"adyen-checkout__button__content"},t(o,{size:"medium",inline:!0}),t("span",{className:"adyen-checkout__button__text--sr-only"},x.get("loading"))),redirect:t("span",{className:"adyen-checkout__button__content"},t(o,{size:"medium",inline:!0}),x.get("payButton.redirecting")),default:t("span",{className:"adyen-checkout__button__content"},j,t("span",{className:"adyen-checkout__button__text"},this.state.completed?h??d:d))},D=B[m]||B.default;return i?t("a",{className:P,href:i,disabled:s,target:this.props.target,rel:this.props.rel},D):t("button",{ref:b,className:P,type:"button",disabled:s,onClick:this.onClick,"aria-label":u,"aria-describedby":p,onMouseEnter:y,onMouseLeave:f,onKeyDown:C,onFocus:k,onBlur:g,onKeyPress:N},D,"loading"!==m&&"redirect"!==m&&this.props.children)}constructor(...e){super(...e),s(this,"onClick",e=>{e.preventDefault(),this.props.disabled||this.props.onClick?.(e,{complete:this.complete})}),s(this,"complete",(e=1e3)=>{this.setState({completed:!0}),setTimeout(()=>{this.setState({completed:!1})},e)})}}s(i,"defaultProps",{status:"default",variant:"primary",disabled:!1,label:"",inline:!1,target:"_self"});export{i as default};
1
+ import{Component as e,createElement as t}from"../../../external/preact/dist/preact.js";import a from"../../../_virtual/index.js";import n from"../Spinner/Spinner.js";import{useCoreContext as o}from"../../../core/Context/CoreProvider.js";function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class s extends e{render(){const{classNameModifiers:e=[],disabled:i,href:s,icon:r,onClickCompletedIcon:l,inline:c,label:d,ariaLabel:u,ariaDescribedBy:p,status:m,variant:b,buttonRef:h,onClickCompletedLabel:_,onMouseEnter:y,onMouseLeave:f,onFocus:g,onBlur:k,onKeyDown:C,onKeyPress:v}=this.props,{completed:N}=this.state,{i18n:S}=o(),x=l||r?t("img",{className:"adyen-checkout__button__icon",src:this.state.completed?l??r:r,alt:"","aria-hidden":"true"}):"",L=[...e,..."primary"!==b?[b]:[],...c?["inline"]:[],...N?["completed"]:[],..."loading"===m||"redirect"===m?["loading"]:[]],j=a(["adyen-checkout__button",...L.map(e=>`adyen-checkout__button--${e}`)]),B={loading:t("span",{"aria-hidden":"true",className:"adyen-checkout__button__content"},t(n,{size:"medium",inline:!0})),redirect:t("span",{"aria-hidden":"true",className:"adyen-checkout__button__content"},t(n,{size:"medium",inline:!0}),S.get("payButton.redirecting")),default:t("span",{className:"adyen-checkout__button__content"},x,t("span",{className:"adyen-checkout__button__text"},this.state.completed?_??d:d))},M=B[m]||B.default;return s?t("a",{className:j,href:s,disabled:i,target:this.props.target,rel:this.props.rel},M):t("button",{ref:h,className:j,type:"button",disabled:i,onClick:this.onClick,"aria-label":u,"aria-describedby":p,onMouseEnter:y,onMouseLeave:f,onKeyDown:C,onFocus:g,onBlur:k,onKeyPress:v},M,"loading"!==m&&"redirect"!==m&&this.props.children,t("span",{role:"status","aria-live":"polite",className:"adyen-checkout__button__text--sr-only"},S.get(this.buttonStatusSRLabel(m))))}constructor(...e){super(...e),i(this,"onClick",e=>{e.preventDefault(),this.props.disabled||this.props.onClick?.(e,{complete:this.complete})}),i(this,"complete",(e=1e3)=>{this.setState({completed:!0}),setTimeout(()=>{this.setState({completed:!1})},e)}),i(this,"buttonStatusSRLabel",e=>({loading:"loading",redirect:"payButton.redirecting"}[e]||""))}}i(s,"defaultProps",{status:"default",variant:"primary",disabled:!1,label:"",inline:!1,target:"_self"});export{s as default};
2
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../../src/components/internal/Button/Button.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport classNames from 'classnames';\nimport Spinner from '../Spinner';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { ButtonProps, ButtonState } from './types';\nimport './Button.scss';\n\nclass Button extends Component<ButtonProps, ButtonState> {\n public static defaultProps = {\n status: 'default',\n variant: 'primary',\n disabled: false,\n label: '',\n inline: false,\n target: '_self'\n };\n\n public onClick = (e: h.JSX.TargetedMouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n\n if (!this.props.disabled) {\n this.props.onClick?.(e, { complete: this.complete });\n }\n };\n\n public complete = (delay = 1_000) => {\n this.setState({ completed: true });\n setTimeout(() => {\n this.setState({ completed: false });\n }, delay);\n };\n\n render() {\n const {\n classNameModifiers = [],\n disabled,\n href,\n icon,\n onClickCompletedIcon,\n inline,\n label,\n ariaLabel,\n ariaDescribedBy,\n status,\n variant,\n buttonRef,\n onClickCompletedLabel,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n onKeyPress\n }: ButtonProps = this.props;\n const { completed } = this.state;\n const { i18n } = useCoreContext();\n\n const buttonIcon =\n onClickCompletedIcon || icon ? (\n <img\n className=\"adyen-checkout__button__icon\"\n src={this.state.completed ? (onClickCompletedIcon ?? icon) : icon}\n alt=\"\"\n aria-hidden=\"true\"\n />\n ) : (\n ''\n );\n\n const modifiers = [\n ...classNameModifiers,\n ...(variant !== 'primary' ? [variant] : []),\n ...(inline ? ['inline'] : []),\n ...(completed ? ['completed'] : []),\n ...(status === 'loading' || status === 'redirect' ? ['loading'] : [])\n ];\n\n const buttonClasses = classNames(['adyen-checkout__button', ...modifiers.map(m => `adyen-checkout__button--${m}`)]);\n\n const buttonStates = {\n loading: (\n <span className=\"adyen-checkout__button__content\">\n <Spinner size=\"medium\" inline />\n <span className={'adyen-checkout__button__text--sr-only'}>{i18n.get('loading')}</span>\n </span>\n ),\n redirect: (\n <span className=\"adyen-checkout__button__content\">\n <Spinner size=\"medium\" inline />\n {i18n.get('payButton.redirecting')}\n </span>\n ),\n default: (\n <span className=\"adyen-checkout__button__content\">\n {buttonIcon}\n <span className=\"adyen-checkout__button__text\">{this.state.completed ? (onClickCompletedLabel ?? label) : label}</span>\n </span>\n )\n };\n\n const buttonText = buttonStates[status] || buttonStates.default;\n\n if (href) {\n return (\n <a className={buttonClasses} href={href} disabled={disabled} target={this.props.target} rel={this.props.rel}>\n {buttonText}\n </a>\n );\n }\n\n return (\n <button\n ref={buttonRef}\n className={buttonClasses}\n type=\"button\"\n disabled={disabled}\n onClick={this.onClick}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onKeyDown={onKeyDown}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={onKeyPress}\n >\n {buttonText}\n {status !== 'loading' && status !== 'redirect' && this.props.children}\n </button>\n );\n }\n}\n\nexport default Button;\n"],"names":["Button","Component","render","classNameModifiers","disabled","href","icon","onClickCompletedIcon","inline","label","ariaLabel","ariaDescribedBy","status","variant","buttonRef","onClickCompletedLabel","onMouseEnter","onMouseLeave","onFocus","onBlur","onKeyDown","onKeyPress","this","props","completed","state","i18n","useCoreContext","buttonIcon","h","img","className","src","alt","aria-hidden","modifiers","buttonClasses","classNames","map","m","buttonStates","loading","span","Spinner","size","get","redirect","default","buttonText","a","target","rel","button","ref","type","onClick","aria-label","aria-describedby","children","super","args","_define_property","e","preventDefault","complete","delay","setState","setTimeout","defaultProps"],"mappings":"qWAOA,MAAMA,UAAeC,EAyBjBC,MAAAA,GACI,MAAMC,mBACFA,EAAqB,GAAEC,SACvBA,EAAQC,KACRA,EAAIC,KACJA,EAAIC,qBACJA,EAAoBC,OACpBA,EAAMC,MACNA,EAAKC,UACLA,EAASC,gBACTA,EAAeC,OACfA,EAAMC,QACNA,EAAOC,UACPA,EAASC,sBACTA,EAAqBC,aACrBA,EAAYC,aACZA,EAAYC,QACZA,EAAOC,OACPA,EAAMC,UACNA,EAASC,WACTA,GACaC,KAAKC,OAChBC,UAAEA,GAAcF,KAAKG,OACrBC,KAAEA,GAASC,IAEXC,EACFrB,GAAwBD,EACpBuB,EAACC,MAAAA,CACGC,UAAU,+BACVC,IAAKV,KAAKG,MAAMD,UAAajB,GAAwBD,EAAQA,EAC7D2B,IAAI,GACJC,cAAY,SAGhB,GAGFC,EAAY,IACXhC,KACa,YAAZU,EAAwB,CAACA,GAAW,MACpCL,EAAS,CAAC,UAAY,MACtBgB,EAAY,CAAC,aAAe,MACjB,YAAXZ,GAAmC,aAAXA,EAAwB,CAAC,WAAa,IAGhEwB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,MArBPJ,EADE7D,EACYoE,eAAe,CACzBxD,OAAQ,UACRC,QAAS,UACTT,UAAU,EACVK,MAAO,GACPD,QAAQ,EACR0C,OAAQ"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../../src/components/internal/Button/Button.tsx"],"sourcesContent":["import { Component, h } from 'preact';\nimport classNames from 'classnames';\nimport Spinner from '../Spinner';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { ButtonProps, ButtonState } from './types';\nimport './Button.scss';\n\nclass Button extends Component<ButtonProps, ButtonState> {\n public static defaultProps = {\n status: 'default',\n variant: 'primary',\n disabled: false,\n label: '',\n inline: false,\n target: '_self'\n };\n\n public onClick = (e: h.JSX.TargetedMouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n\n if (!this.props.disabled) {\n this.props.onClick?.(e, { complete: this.complete });\n }\n };\n\n public complete = (delay = 1_000) => {\n this.setState({ completed: true });\n setTimeout(() => {\n this.setState({ completed: false });\n }, delay);\n };\n\n private readonly buttonStatusSRLabel = (status: string): string => {\n const srLabels: Record<string, string> = {\n loading: 'loading',\n redirect: 'payButton.redirecting'\n };\n\n return srLabels[status] || '';\n };\n\n render() {\n const {\n classNameModifiers = [],\n disabled,\n href,\n icon,\n onClickCompletedIcon,\n inline,\n label,\n ariaLabel,\n ariaDescribedBy,\n status,\n variant,\n buttonRef,\n onClickCompletedLabel,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n onKeyPress\n }: ButtonProps = this.props;\n const { completed } = this.state;\n const { i18n } = useCoreContext();\n\n const buttonIcon =\n onClickCompletedIcon || icon ? (\n <img\n className=\"adyen-checkout__button__icon\"\n src={this.state.completed ? (onClickCompletedIcon ?? icon) : icon}\n alt=\"\"\n aria-hidden=\"true\"\n />\n ) : (\n ''\n );\n\n const modifiers = [\n ...classNameModifiers,\n ...(variant !== 'primary' ? [variant] : []),\n ...(inline ? ['inline'] : []),\n ...(completed ? ['completed'] : []),\n ...(status === 'loading' || status === 'redirect' ? ['loading'] : [])\n ];\n\n const buttonClasses = classNames(['adyen-checkout__button', ...modifiers.map(m => `adyen-checkout__button--${m}`)]);\n\n const buttonStates = {\n loading: (\n <span aria-hidden=\"true\" className=\"adyen-checkout__button__content\">\n <Spinner size=\"medium\" inline />\n </span>\n ),\n redirect: (\n <span aria-hidden=\"true\" className=\"adyen-checkout__button__content\">\n <Spinner size=\"medium\" inline />\n {i18n.get('payButton.redirecting')}\n </span>\n ),\n default: (\n <span className=\"adyen-checkout__button__content\">\n {buttonIcon}\n <span className=\"adyen-checkout__button__text\">{this.state.completed ? (onClickCompletedLabel ?? label) : label}</span>\n </span>\n )\n };\n\n const buttonText = buttonStates[status] || buttonStates.default;\n\n if (href) {\n return (\n <a className={buttonClasses} href={href} disabled={disabled} target={this.props.target} rel={this.props.rel}>\n {buttonText}\n </a>\n );\n }\n\n return (\n <button\n ref={buttonRef}\n className={buttonClasses}\n type=\"button\"\n disabled={disabled}\n onClick={this.onClick}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onKeyDown={onKeyDown}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={onKeyPress}\n >\n {buttonText}\n {status !== 'loading' && status !== 'redirect' && this.props.children}\n <span role=\"status\" aria-live=\"polite\" className=\"adyen-checkout__button__text--sr-only\">\n {i18n.get(this.buttonStatusSRLabel(status))}\n </span>\n </button>\n );\n }\n}\n\nexport default Button;\n"],"names":["Button","Component","render","classNameModifiers","disabled","href","icon","onClickCompletedIcon","inline","label","ariaLabel","ariaDescribedBy","status","variant","buttonRef","onClickCompletedLabel","onMouseEnter","onMouseLeave","onFocus","onBlur","onKeyDown","onKeyPress","this","props","completed","state","i18n","useCoreContext","buttonIcon","h","img","className","src","alt","aria-hidden","modifiers","buttonClasses","classNames","map","m","buttonStates","loading","span","Spinner","size","redirect","get","default","buttonText","a","target","rel","button","ref","type","onClick","aria-label","aria-describedby","children","role","aria-live","buttonStatusSRLabel","super","args","_define_property","e","preventDefault","complete","delay","setState","setTimeout","defaultProps"],"mappings":"qWAOA,MAAMA,UAAeC,EAkCjBC,MAAAA,GACI,MAAMC,mBACFA,EAAqB,GAAEC,SACvBA,EAAQC,KACRA,EAAIC,KACJA,EAAIC,qBACJA,EAAoBC,OACpBA,EAAMC,MACNA,EAAKC,UACLA,EAASC,gBACTA,EAAeC,OACfA,EAAMC,QACNA,EAAOC,UACPA,EAASC,sBACTA,EAAqBC,aACrBA,EAAYC,aACZA,EAAYC,QACZA,EAAOC,OACPA,EAAMC,UACNA,EAASC,WACTA,GACaC,KAAKC,OAChBC,UAAEA,GAAcF,KAAKG,OACrBC,KAAEA,GAASC,IAEXC,EACFrB,GAAwBD,EACpBuB,EAACC,MAAAA,CACGC,UAAU,+BACVC,IAAKV,KAAKG,MAAMD,UAAajB,GAAwBD,EAAQA,EAC7D2B,IAAI,GACJC,cAAY,SAGhB,GAGFC,EAAY,IACXhC,KACa,YAAZU,EAAwB,CAACA,GAAW,MACpCL,EAAS,CAAC,UAAY,MACtBgB,EAAY,CAAC,aAAe,MACjB,YAAXZ,GAAmC,aAAXA,EAAwB,CAAC,WAAa,IAGhEwB,EAAgBC,EAAW,CAAC,4BAA6BF,EAAUG,IAAIC,GAAK,2BAA2BA,OAEvGC,EAAe,CACjBC,QACIZ,EAACa,OAAAA,CAAKR,cAAY,OAAOH,UAAU,mCAC/BF,EAACc,EAAAA,CAAQC,KAAK,SAASpC,QAAAA,KAG/BqC,SACIhB,EAACa,OAAAA,CAAKR,cAAY,OAAOH,UAAU,mCAC/BF,EAACc,EAAAA,CAAQC,KAAK,SAASpC,QAAAA,IACtBkB,EAAKoB,IAAI,0BAGlBC,QACIlB,EAACa,OAAAA,CAAKX,UAAU,mCACXH,EACDC,EAACa,OAAAA,CAAKX,UAAU,gCAAgCT,KAAKG,MAAMD,UAAaT,GAAyBN,EAASA,KAKhHuC,EAAaR,EAAa5B,IAAW4B,EAAaO,QAExD,OAAI1C,EAEIwB,EAACoB,IAAAA,CAAElB,UAAWK,EAAe/B,KAAMA,EAAMD,SAAUA,EAAU8C,OAAQ5B,KAAKC,MAAM2B,OAAQC,IAAK7B,KAAKC,MAAM4B,KACnGH,GAMTnB,EAACuB,SAAAA,CACGC,IAAKvC,EACLiB,UAAWK,EACXkB,KAAK,SACLlD,SAAUA,EACVmD,QAASjC,KAAKiC,QACdC,aAAY9C,EACZ+C,mBAAkB9C,EAClBK,aAAcA,EACdC,aAAcA,EACdG,UAAWA,EACXF,QAASA,EACTC,OAAQA,EACRE,WAAYA,GAEX2B,EACW,YAAXpC,GAAmC,aAAXA,GAAyBU,KAAKC,MAAMmC,SAC7D7B,EAACa,OAAAA,CAAKiB,KAAK,SAASC,YAAU,SAAS7B,UAAU,yCAC5CL,EAAKoB,IAAIxB,KAAKuC,oBAAoBjD,KAInD,mBAtIJkD,SAAAC,GAUIC,EAAA1C,KAAOiC,UAAWU,IACdA,EAAEC,iBAEG5C,KAAKC,MAAMnB,UACZkB,KAAKC,MAAMgC,UAAUU,EAAG,CAAEE,SAAU7C,KAAK6C,aAIjDH,EAAA1C,KAAO6C,WAAW,CAACC,EAAQ,OACvB9C,KAAK+C,SAAS,CAAE7C,WAAW,IAC3B8C,WAAW,KACPhD,KAAK+C,SAAS,CAAE7C,WAAW,KAC5B4C,KAGPJ,EAAA1C,KAAiBuC,sBAAuBjD,IACK,CACrC6B,QAAS,UACTI,SAAU,yBAGEjC,IAAW,MA9B/BoD,EADEhE,EACYuE,eAAe,CACzB3D,OAAQ,UACRC,QAAS,UACTT,UAAU,EACVK,MAAO,GACPD,QAAQ,EACR0C,OAAQ"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../../../external/preact/dist/preact.js";import{useMemo as r,useEffect as a}from"../../../../../../external/preact/hooks/dist/hooks.js";import t from"../../../context/useClickToPayContext.js";import{useCoreContext as s}from"../../../../../../core/Context/CoreProvider.js";import o from"../../../../../../core/Context/useImage.js";import i from"../../../../../../utils/useForm/useForm.js";import d from"../../../../../../utils/isMobile.js";import c from"../../../../FormFields/Field/Field.js";import l from"../../../../FormFields/Select/Select.js";const m=["srcDigitalCardId"],n=({cardSelected:n,cards:p,errorMessage:C,onChangeCard:g})=>{const{i18n:u}=s(),f=o(),{status:x}=t(),{handleChangeFor:h,data:F}=i({schema:m,defaultData:{srcDigitalCardId:n.srcDigitalCardId}}),I=r(()=>p.map(e=>({icon:e.artUri||f()(e.scheme),name:`${d()?"":e.title} •••• ${e.panLastFour} `,secondaryText:e.isExpired&&u.get("ctp.cards.expiredCard"),id:e.srcDigitalCardId,disabled:e.isExpired})),[p]);return a(()=>{const{srcDigitalCardId:e}=F,r=p.find(r=>r.srcDigitalCardId===e);g(r)},[F,g]),e(c,{name:"clickToPayCards",className:"adyen-checkout-ctp__cards-list-field",errorMessage:C,readOnly:"loading"===x,label:u.get("ctp.cards.subtitle")},e(l,{items:I,selectedValue:F.srcDigitalCardId,name:"clickToPayCards",filterable:!1,className:"adyen-checkout-ctp__cards-list-dropdown",allowIdOnButton:!0,readonly:"loading"===x,onChange:h("srcDigitalCardId")}))};export{n as default};
1
+ import{createElement as e}from"../../../../../../external/preact/dist/preact.js";import{useMemo as r,useEffect as a}from"../../../../../../external/preact/hooks/dist/hooks.js";import t from"../../../context/useClickToPayContext.js";import{useCoreContext as s}from"../../../../../../core/Context/CoreProvider.js";import i from"../../../../../../core/Context/useImage.js";import o from"../../../../../../utils/useForm/useForm.js";import d from"../../../../../../utils/isMobile.js";import c from"../../../../FormFields/Field/Field.js";import l from"../../../../FormFields/Select/Select.js";const m=["srcDigitalCardId"],n=({cardSelected:n,cards:p,errorMessage:C,onChangeCard:g})=>{const{i18n:u}=s(),f=i(),{status:x}=t(),{handleChangeFor:h,data:F}=o({schema:m,defaultData:{srcDigitalCardId:n.srcDigitalCardId}}),j=r(()=>p.map(e=>({icon:e.artUri||f()(e.scheme),name:`${d()?"":e.title} •••• ${e.panLastFour} `,secondaryText:e.isExpired&&u.get("ctp.cards.expiredCard"),id:e.srcDigitalCardId,disabled:e.isExpired})),[p]);return a(()=>{const{srcDigitalCardId:e}=F,r=p.find(r=>r.srcDigitalCardId===e);g(r)},[F,g]),e(c,{name:"clickToPayCards",className:"adyen-checkout-ctp__cards-list-field",errorMessage:C,readOnly:"loading"===x,label:u.get("ctp.cards.subtitle")},e(l,{items:j,selectedValue:F.srcDigitalCardId,name:"clickToPayCards",filterable:!1,className:"adyen-checkout-ctp__cards-list-dropdown",readonly:"loading"===x,onChange:h("srcDigitalCardId")}))};export{n as default};
2
2
  //# sourceMappingURL=CtPCardsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CtPCardsList.js","sources":["../../../../../../../../src/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useMemo } from 'preact/hooks';\nimport ShopperCard from '../../../models/ShopperCard';\nimport useClickToPayContext from '../../../context/useClickToPayContext';\nimport { useCoreContext } from '../../../../../../core/Context/CoreProvider';\nimport useImage from '../../../../../../core/Context/useImage';\nimport useForm from '../../../../../../utils/useForm';\nimport isMobile from '../../../../../../utils/isMobile';\nimport Field from '../../../../FormFields/Field';\nimport './CtPCardsList.scss';\nimport Select from '../../../../FormFields/Select';\n\ntype CtPCardsListProps = {\n cards: ShopperCard[];\n cardSelected: ShopperCard;\n errorMessage?: string;\n onChangeCard(card: ShopperCard): void;\n};\n\ntype CardsSelectorDataState = {\n srcDigitalCardId: string;\n};\n\nconst schema = ['srcDigitalCardId'];\n\nconst CtPCardsList = ({ cardSelected, cards, errorMessage, onChangeCard }: CtPCardsListProps) => {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const { status } = useClickToPayContext();\n const { handleChangeFor, data } = useForm<CardsSelectorDataState>({\n schema,\n defaultData: { srcDigitalCardId: cardSelected.srcDigitalCardId }\n });\n\n const items = useMemo(() => {\n return cards.map(card => ({\n icon: card.artUri || getImage()(card.scheme),\n name: `${isMobile() ? '' : card.title} •••• ${card.panLastFour} `,\n secondaryText: card.isExpired && i18n.get('ctp.cards.expiredCard'),\n id: card.srcDigitalCardId,\n disabled: card.isExpired\n }));\n }, [cards]);\n\n useEffect(() => {\n const { srcDigitalCardId } = data;\n const card = cards.find(card => card.srcDigitalCardId === srcDigitalCardId);\n onChangeCard(card);\n }, [data, onChangeCard]);\n\n return (\n <Field\n name=\"clickToPayCards\"\n className=\"adyen-checkout-ctp__cards-list-field\"\n errorMessage={errorMessage}\n readOnly={status === 'loading'}\n label={i18n.get('ctp.cards.subtitle')}\n >\n <Select\n items={items}\n selectedValue={data['srcDigitalCardId']}\n name={'clickToPayCards'}\n filterable={false}\n className={'adyen-checkout-ctp__cards-list-dropdown'}\n allowIdOnButton={true}\n readonly={status === 'loading'}\n onChange={handleChangeFor('srcDigitalCardId')}\n />\n </Field>\n );\n};\n\nexport default CtPCardsList;\n"],"names":["schema","CtPCardsList","cardSelected","cards","errorMessage","onChangeCard","i18n","useCoreContext","getImage","useImage","status","useClickToPayContext","handleChangeFor","data","useForm","defaultData","srcDigitalCardId","items","useMemo","map","card","icon","artUri","scheme","name","isMobile","title","panLastFour","secondaryText","isExpired","get","id","disabled","useEffect","find","h","Field","className","readOnly","label","Select","selectedValue","filterable","allowIdOnButton","readonly","onChange"],"mappings":"2kBAuBA,MAAMA,EAAS,CAAC,oBAEVC,EAAe,EAAGC,eAAcC,QAAOC,eAAcC,mBACvD,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KACXC,OAAEA,GAAWC,KACbC,gBAAEA,EAAeC,KAAEA,GAASC,EAAgC,CAC9Dd,SACAe,YAAa,CAAEC,iBAAkBd,EAAac,oBAG5CC,EAAQC,EAAQ,IACXf,EAAMgB,IAAIC,KACbC,KAAMD,EAAKE,QAAUd,IAAWY,EAAKG,QACrCC,KAAM,GAAGC,IAAa,GAAKL,EAAKM,cAAcN,EAAKO,eACnDC,cAAeR,EAAKS,WAAavB,EAAKwB,IAAI,yBAC1CC,GAAIX,EAAKJ,iBACTgB,SAAUZ,EAAKS,aAEpB,CAAC1B,IAQJ,OANA8B,EAAU,KACN,MAAMjB,iBAAEA,GAAqBH,EACvBO,EAAOjB,EAAM+B,KAAKd,GAAQA,EAAKJ,mBAAqBA,GAC1DX,EAAae,IACd,CAACP,EAAMR,IAGN8B,EAACC,EAAAA,CACGZ,KAAK,kBACLa,UAAU,uCACVjC,aAAcA,EACdkC,SAAqB,YAAX5B,EACV6B,MAAOjC,EAAKwB,IAAI,uBAEhBK,EAACK,EAAAA,CACGvB,MAAOA,EACPwB,cAAe5B,EAAK,iBACpBW,KAAM,kBACNkB,YAAY,EACZL,UAAW,0CACXM,iBAAiB,EACjBC,SAAqB,YAAXlC,EACVmC,SAAUjC,EAAgB"}
1
+ {"version":3,"file":"CtPCardsList.js","sources":["../../../../../../../../src/components/internal/ClickToPay/components/CtPCards/CtPCardsList/CtPCardsList.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useEffect, useMemo } from 'preact/hooks';\nimport ShopperCard from '../../../models/ShopperCard';\nimport useClickToPayContext from '../../../context/useClickToPayContext';\nimport { useCoreContext } from '../../../../../../core/Context/CoreProvider';\nimport useImage from '../../../../../../core/Context/useImage';\nimport useForm from '../../../../../../utils/useForm';\nimport isMobile from '../../../../../../utils/isMobile';\nimport Field from '../../../../FormFields/Field';\nimport './CtPCardsList.scss';\nimport Select from '../../../../FormFields/Select';\n\ntype CtPCardsListProps = {\n cards: ShopperCard[];\n cardSelected: ShopperCard;\n errorMessage?: string;\n onChangeCard(card: ShopperCard): void;\n};\n\ntype CardsSelectorDataState = {\n srcDigitalCardId: string;\n};\n\nconst schema = ['srcDigitalCardId'];\n\nconst CtPCardsList = ({ cardSelected, cards, errorMessage, onChangeCard }: CtPCardsListProps) => {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const { status } = useClickToPayContext();\n const { handleChangeFor, data } = useForm<CardsSelectorDataState>({\n schema,\n defaultData: { srcDigitalCardId: cardSelected.srcDigitalCardId }\n });\n\n const items = useMemo(() => {\n return cards.map(card => ({\n icon: card.artUri || getImage()(card.scheme),\n name: `${isMobile() ? '' : card.title} •••• ${card.panLastFour} `,\n secondaryText: card.isExpired && i18n.get('ctp.cards.expiredCard'),\n id: card.srcDigitalCardId,\n disabled: card.isExpired\n }));\n }, [cards]);\n\n useEffect(() => {\n const { srcDigitalCardId } = data;\n const card = cards.find(card => card.srcDigitalCardId === srcDigitalCardId);\n onChangeCard(card);\n }, [data, onChangeCard]);\n\n return (\n <Field\n name=\"clickToPayCards\"\n className=\"adyen-checkout-ctp__cards-list-field\"\n errorMessage={errorMessage}\n readOnly={status === 'loading'}\n label={i18n.get('ctp.cards.subtitle')}\n >\n <Select\n items={items}\n selectedValue={data['srcDigitalCardId']}\n name={'clickToPayCards'}\n filterable={false}\n className={'adyen-checkout-ctp__cards-list-dropdown'}\n readonly={status === 'loading'}\n onChange={handleChangeFor('srcDigitalCardId')}\n />\n </Field>\n );\n};\n\nexport default CtPCardsList;\n"],"names":["schema","CtPCardsList","cardSelected","cards","errorMessage","onChangeCard","i18n","useCoreContext","getImage","useImage","status","useClickToPayContext","handleChangeFor","data","useForm","defaultData","srcDigitalCardId","items","useMemo","map","card","icon","artUri","scheme","name","isMobile","title","panLastFour","secondaryText","isExpired","get","id","disabled","useEffect","find","h","Field","className","readOnly","label","Select","selectedValue","filterable","readonly","onChange"],"mappings":"2kBAuBA,MAAMA,EAAS,CAAC,oBAEVC,EAAe,EAAGC,eAAcC,QAAOC,eAAcC,mBACvD,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KACXC,OAAEA,GAAWC,KACbC,gBAAEA,EAAeC,KAAEA,GAASC,EAAgC,CAC9Dd,SACAe,YAAa,CAAEC,iBAAkBd,EAAac,oBAG5CC,EAAQC,EAAQ,IACXf,EAAMgB,IAAIC,KACbC,KAAMD,EAAKE,QAAUd,IAAWY,EAAKG,QACrCC,KAAM,GAAGC,IAAa,GAAKL,EAAKM,cAAcN,EAAKO,eACnDC,cAAeR,EAAKS,WAAavB,EAAKwB,IAAI,yBAC1CC,GAAIX,EAAKJ,iBACTgB,SAAUZ,EAAKS,aAEpB,CAAC1B,IAQJ,OANA8B,EAAU,KACN,MAAMjB,iBAAEA,GAAqBH,EACvBO,EAAOjB,EAAM+B,KAAKd,GAAQA,EAAKJ,mBAAqBA,GAC1DX,EAAae,IACd,CAACP,EAAMR,IAGN8B,EAACC,EAAAA,CACGZ,KAAK,kBACLa,UAAU,uCACVjC,aAAcA,EACdkC,SAAqB,YAAX5B,EACV6B,MAAOjC,EAAKwB,IAAI,uBAEhBK,EAACK,EAAAA,CACGvB,MAAOA,EACPwB,cAAe5B,EAAK,iBACpBW,KAAM,kBACNkB,YAAY,EACZL,UAAW,0CACXM,SAAqB,YAAXjC,EACVkC,SAAUhC,EAAgB"}
@@ -1,2 +1,2 @@
1
- import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useRef as t,useState as n,useMemo as r,useEffect as l}from"../../../../external/preact/hooks/dist/hooks.js";import s from"../../../../_virtual/index.js";import o from"./components/SelectButton.js";import a from"./components/SelectList.js";import i from"../../../../utils/uuid.js";import{keys as c}from"./constants.js";import{ARIA_ERROR_SUFFIX as u,ARIA_CONTEXT_SUFFIX as d}from"../../../../core/Errors/constants.js";import{simulateFocusScroll as m}from"../utils.js";function f({items:f=[],className:p="",classNameModifiers:g=[],filterable:v=!0,readonly:h=!1,onChange:b=()=>{},onInput:w,selectedValue:y,name:k,isInvalid:I,isValid:L,placeholder:D,uniqueId:j,disabled:x,disableTextFilter:B,clearOnSelect:E,blurOnClose:T,onListToggle:C,allowIdOnButton:N=!1,required:S}){const $=t(null),_=t(null),M=t(null),O=t(null),[R,q]=n(null),[P,V]=n(!1),A=r(()=>`select-${i()}`,[]),F=f.find(e=>e.id===y)||{},[H,K]=n(),[U,z]=n(F),G=F,J=B?f:f.filter(e=>!R||e.name.toLowerCase().includes(R.toLowerCase())),Q=j?`${j}${I?u:d}`:null,W=e=>{if(!e)return;const t=document.getElementById(`listItem-${e.id}`);m(t)},X=()=>{T&&$.current.blur(),V(!1)},Y=()=>{V(!0)},Z=e=>{const t=e.currentTarget.getAttribute("data-value");return J.find(e=>e.id==t)},ee=e=>{let t;e.preventDefault(),t=e.currentTarget instanceof HTMLElement&&"option"===e.currentTarget.getAttribute("role")?Z(e):U.id&&J.some(e=>e.id===U.id)?U:R?J[0]:{id:y},t&&!t.disabled&&(b({target:{value:t.id,name:k}}),E&&K(null),X())},te=e=>{switch(e.key){case c.space:case c.enter:ee(e);break;case c.arrowDown:e.preventDefault(),(()=>{if(!J||J.length<1)return;const e=J.findIndex(e=>e===U)+1,t=e<J.length?e:0,n=J[t];W(n),z(n)})();break;case c.arrowUp:e.preventDefault(),(()=>{if(!J||J.length<1)return;const e=J.findIndex(e=>e===U)-1,t=e<0?J.length-1:e,n=J[t];W(n),z(n)})()}};return l(()=>{P?K(null):q(null)},[P]),l(()=>{P&&v&&$.current&&$.current.focus(),C?.(P)},[P]),l(()=>{function e(e){(e.composedPath?!e.composedPath().includes(_.current):!_.current.contains(e.target))&&X()}return document.addEventListener("click",e,!1),()=>{document.removeEventListener("click",e,!1)}},[_]),e("div",{className:s(["adyen-checkout__dropdown",p,...g.map(e=>`adyen-checkout__dropdown--${e}`)]),ref:_},e(o,{inputText:H,id:j??null,active:U,selected:G,filterInputRef:$,filterable:v,isInvalid:I,isValid:L,onButtonKeyDown:e=>{e.key===c.enter&&v&&P&&R?ee(e):e.key===c.escape?X():![c.arrowUp,c.arrowDown,c.enter].includes(e.key)&&(e.key!==c.space||v&&P)?(e.shiftKey&&e.key===c.tab||e.key===c.tab)&&X():(e.preventDefault(),P?te(e):Y())},onFocus:Y,onInput:e=>{const t=e.target.value;K(t),q(t),w&&w(t)},placeholder:D,readonly:h,selectListId:A,showList:P,toggleButtonRef:M,toggleList:e=>{e.preventDefault(),P?(K(G.name),X()):(K(null),Y())},disabled:x,ariaDescribedBy:Q,allowIdOnButton:N,required:S}),e(a,{active:U,filteredItems:J,onHover:e=>{e.preventDefault();const t=Z(e);z(t)},onSelect:ee,selected:G,selectListId:A,selectListRef:O,showList:P}))}f.defaultProps={className:"",classNameModifiers:[],filterable:!0,items:[],readonly:!1,onChange:()=>{}};export{f as default};
1
+ import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useRef as t,useState as n,useMemo as r,useEffect as l}from"../../../../external/preact/hooks/dist/hooks.js";import s from"../../../../_virtual/index.js";import o from"./components/SelectButton.js";import a from"./components/SelectList.js";import i from"../../../../utils/uuid.js";import{keys as c}from"./constants.js";import{ARIA_ERROR_SUFFIX as u,ARIA_CONTEXT_SUFFIX as d}from"../../../../core/Errors/constants.js";import{simulateFocusScroll as m}from"../utils.js";import{useCoreContext as f}from"../../../../core/Context/CoreProvider.js";function p({items:p=[],className:g="",classNameModifiers:v=[],filterable:h=!0,readonly:y=!1,onChange:b=()=>{},onInput:k,selectedValue:w,name:I,isInvalid:L,isValid:j,placeholder:D,uniqueId:x,disabled:C,disableTextFilter:E,clearOnSelect:T,blurOnClose:N,onListToggle:B,required:S}){const{i18n:$}=f(),_=t(null),M=t(null),P=t(null),R=t(null),[q,O]=n(null),[V,A]=n(!1),[F,H]=n(null),K=r(()=>`select-${i()}`,[]),U=p.find(e=>e.id===w)||{},[z,G]=n(),[J,Q]=n(U),W=U,X=E?p:p.filter(e=>!q||e.name.toLowerCase().includes(q.toLowerCase())),Y=x?`${x}${L?u:d}`:null,Z=e=>{if(!e)return;const t=document.getElementById(`listItem-${e.id}`);m(t)},ee=()=>{N&&_.current.blur(),A(!1)},te=()=>{A(!0)},ne=e=>{const t=e.currentTarget.getAttribute("data-value");return X.find(e=>e.id==t)},re=e=>{let t;e.preventDefault(),t=e.currentTarget instanceof HTMLElement&&"option"===e.currentTarget.getAttribute("role")?ne(e):J.id&&X.some(e=>e.id===J.id)?J:q?X[0]:{id:w},t&&!t.disabled&&(b({target:{value:t.id,name:I}}),T&&G(null),ee())},le=e=>{switch(e.key){case c.space:case c.enter:re(e);break;case c.arrowDown:e.preventDefault(),(()=>{if(!X||X.length<1)return;const e=X.findIndex(e=>e===J)+1,t=e<X.length?e:0,n=X[t];Z(n),Q(n)})();break;case c.arrowUp:e.preventDefault(),(()=>{if(!X||X.length<1)return;const e=X.findIndex(e=>e===J)-1,t=e<0?X.length-1:e,n=X[t];Z(n),Q(n)})()}};return l(()=>{V?G(null):O(null)},[V]),l(()=>{V&&h&&_.current&&_.current.focus(),B?.(V)},[V]),l(()=>{function e(e){(e.composedPath?!e.composedPath().includes(M.current):!M.current.contains(e.target))&&ee()}return document.addEventListener("click",e,!1),()=>{document.removeEventListener("click",e,!1)}},[M]),l(()=>{V&&0===X.length?H($.get("select.noOptionsFound")):H(null)},[V,X.length,$]),e("div",{className:s(["adyen-checkout__dropdown",g,...v.map(e=>`adyen-checkout__dropdown--${e}`)]),ref:M},e(o,{inputText:z,id:x??null,active:J,selected:W,filterInputRef:_,filterable:h,isInvalid:L,isValid:j,onButtonKeyDown:e=>{e.key===c.enter&&h&&V&&q?re(e):e.key===c.escape?ee():![c.arrowUp,c.arrowDown,c.enter].includes(e.key)&&(e.key!==c.space||h&&V)?(e.shiftKey&&e.key===c.tab||e.key===c.tab)&&ee():(e.preventDefault(),V?le(e):te())},onInput:e=>{const t=e.target.value;G(t),O(t),V||te(),k&&k(t)},placeholder:D,readonly:y,selectListId:K,showList:V,toggleButtonRef:P,toggleList:e=>{e.preventDefault(),V?(G(W.name),ee()):(G(null),te())},disabled:C,ariaDescribedBy:Y,required:S}),e(a,{active:J,filteredItems:X,onHover:e=>{e.preventDefault();const t=ne(e);Q(t)},onSelect:re,selected:W,selectListId:K,selectListRef:R,showList:V}),e("div",{role:"status","aria-live":"polite","aria-relevant":"all",className:"adyen-checkout-sr-panel--sr-only"},F))}p.defaultProps={className:"",classNameModifiers:[],filterable:!0,items:[],readonly:!1,onChange:()=>{}};export{p as default};
2
2
  //# sourceMappingURL=Select.js.map