@adyen/adyen-web 6.28.0 → 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 (246) hide show
  1. package/dist/cjs/adyen.css +8 -6
  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 +2688 -2557
  6. package/dist/es/adyen.css +8 -6
  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/types.js.map +1 -1
  13. package/dist/es/components/Econtext/Econtext.js +1 -1
  14. package/dist/es/components/Econtext/Econtext.js.map +1 -1
  15. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  16. package/dist/es/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  17. package/dist/es/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js +1 -1
  18. package/dist/es/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
  19. package/dist/es/components/Iris/Iris.js +2 -0
  20. package/dist/es/components/Iris/Iris.js.map +1 -0
  21. package/dist/es/components/Iris/components/IrisComponent.js +2 -0
  22. package/dist/es/components/Iris/components/IrisComponent.js.map +1 -0
  23. package/dist/es/components/Iris/components/IrisComponent.module.scss.js +2 -0
  24. package/dist/es/components/Iris/components/IrisComponent.module.scss.js.map +1 -0
  25. package/dist/es/components/Iris/components/IrisGenerateQRCode.js +2 -0
  26. package/dist/es/components/Iris/components/IrisGenerateQRCode.js.map +1 -0
  27. package/dist/es/components/Iris/components/IrisGenerateQRCode.module.scss.js +2 -0
  28. package/dist/es/components/Iris/components/IrisGenerateQRCode.module.scss.js.map +1 -0
  29. package/dist/es/components/Iris/components/IrisQrCodeInstructions.js +2 -0
  30. package/dist/es/components/Iris/components/IrisQrCodeInstructions.js.map +1 -0
  31. package/dist/es/components/Iris/constants.js +2 -0
  32. package/dist/es/components/Iris/constants.js.map +1 -0
  33. package/dist/es/components/Iris/types.js +2 -0
  34. package/dist/es/components/Iris/types.js.map +1 -0
  35. package/dist/es/components/Iris/utils.js +2 -0
  36. package/dist/es/components/Iris/utils.js.map +1 -0
  37. package/dist/es/components/PayTo/components/PayToComponent.js +1 -1
  38. package/dist/es/components/PayTo/components/PayToComponent.js.map +1 -1
  39. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  40. package/dist/es/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  41. package/dist/es/components/components-name-map.js +1 -1
  42. package/dist/es/components/components-name-map.js.map +1 -1
  43. package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  44. package/dist/es/components/index.js +1 -1
  45. package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
  46. package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
  47. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  48. package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  49. package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
  50. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  51. package/dist/es/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  52. package/dist/es/components/internal/SegmentedControl/SegmentedControlRegion.js +2 -0
  53. package/dist/es/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -0
  54. package/dist/es/components/internal/Voucher/Voucher.js +1 -1
  55. package/dist/es/components/internal/Voucher/Voucher.js.map +1 -1
  56. package/dist/es/components/internal/Voucher/utils.js.map +1 -1
  57. package/dist/es/components/tx-variants.js +1 -1
  58. package/dist/es/components/tx-variants.js.map +1 -1
  59. package/dist/es/core/Analytics/events/AnalyticsInfoEvent.js +1 -1
  60. package/dist/es/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
  61. package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
  62. package/dist/es/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
  63. package/dist/es/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  64. package/dist/es/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  65. package/dist/es/core/config.js +1 -1
  66. package/dist/es/index.d.ts +2688 -2557
  67. package/dist/es/index.js +1 -1
  68. package/dist/es/language/Language.js.map +1 -1
  69. package/dist/es/utils/createSdkData.js +2 -0
  70. package/dist/es/utils/createSdkData.js.map +1 -0
  71. package/dist/es-legacy/adyen.css +8 -6
  72. package/dist/es-legacy/adyen.css.map +1 -1
  73. package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
  74. package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
  75. package/dist/es-legacy/components/ApplePay/utils/payment-request.js +1 -1
  76. package/dist/es-legacy/components/ApplePay/utils/payment-request.js.map +1 -1
  77. package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferVoucher.js +1 -1
  78. package/dist/es-legacy/components/BankTransfer/components/BankTransferResult/BankTransferVoucher.js.map +1 -1
  79. package/dist/es-legacy/components/Card/Card.js +1 -1
  80. package/dist/es-legacy/components/Card/Card.js.map +1 -1
  81. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
  82. package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
  83. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js +1 -1
  84. package/dist/es-legacy/components/Card/components/CardInput/components/BrandIcon.js.map +1 -1
  85. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
  86. package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
  87. package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
  88. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js +1 -1
  89. package/dist/es-legacy/components/Card/components/CardInput/useSRPanelForCardInputErrors.js.map +1 -1
  90. package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
  91. package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
  92. package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js +1 -1
  93. package/dist/es-legacy/components/Card/components/ClickToPayWrapper.js.map +1 -1
  94. package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
  95. package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
  96. package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
  97. package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
  98. package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
  99. package/dist/es-legacy/components/Dropin/Dropin.js.map +1 -1
  100. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
  101. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
  102. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js +1 -1
  103. package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
  104. package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
  105. package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
  106. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js +1 -1
  107. package/dist/es-legacy/components/Econtext/components/EcontextInput/EcontextInput.js.map +1 -1
  108. package/dist/es-legacy/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js +1 -1
  109. package/dist/es-legacy/components/Econtext/components/EcontextVoucherResult/EcontextVoucherResult.js.map +1 -1
  110. package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
  111. package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
  112. package/dist/es-legacy/components/GooglePay/requests.js +1 -1
  113. package/dist/es-legacy/components/GooglePay/requests.js.map +1 -1
  114. package/dist/es-legacy/components/Iris/Iris.js +2 -0
  115. package/dist/es-legacy/components/Iris/Iris.js.map +1 -0
  116. package/dist/es-legacy/components/Iris/components/IrisComponent.js +2 -0
  117. package/dist/es-legacy/components/Iris/components/IrisComponent.js.map +1 -0
  118. package/dist/es-legacy/components/Iris/components/IrisComponent.module.scss.js +2 -0
  119. package/dist/es-legacy/components/Iris/components/IrisComponent.module.scss.js.map +1 -0
  120. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.js +2 -0
  121. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.js.map +1 -0
  122. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.module.scss.js +2 -0
  123. package/dist/es-legacy/components/Iris/components/IrisGenerateQRCode.module.scss.js.map +1 -0
  124. package/dist/es-legacy/components/Iris/components/IrisQrCodeInstructions.js +2 -0
  125. package/dist/es-legacy/components/Iris/components/IrisQrCodeInstructions.js.map +1 -0
  126. package/dist/es-legacy/components/Iris/constants.js +2 -0
  127. package/dist/es-legacy/components/Iris/constants.js.map +1 -0
  128. package/dist/es-legacy/components/Iris/types.js +2 -0
  129. package/dist/es-legacy/components/Iris/types.js.map +1 -0
  130. package/dist/es-legacy/components/Iris/utils.js +2 -0
  131. package/dist/es-legacy/components/Iris/utils.js.map +1 -0
  132. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
  133. package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
  134. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js +1 -1
  135. package/dist/es-legacy/components/Klarna/components/KlarnaWidget/KlarnaWidget.js.map +1 -1
  136. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +1 -1
  137. package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -1
  138. package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
  139. package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
  140. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js +1 -1
  141. package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
  142. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
  143. package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
  144. package/dist/es-legacy/components/PayTo/components/PayToComponent.js +1 -1
  145. package/dist/es-legacy/components/PayTo/components/PayToComponent.js.map +1 -1
  146. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js +1 -1
  147. package/dist/es-legacy/components/PreAuthorizedDebitCanada/PreAuthorizedDebitCanada.js.map +1 -1
  148. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
  149. package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
  150. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js +1 -1
  151. package/dist/es-legacy/components/UPI/components/UPIComponent/UPIComponent.js.map +1 -1
  152. package/dist/es-legacy/components/components-name-map.js +1 -1
  153. package/dist/es-legacy/components/components-name-map.js.map +1 -1
  154. package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
  155. package/dist/es-legacy/components/index.js +1 -1
  156. package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
  157. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
  158. package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
  159. package/dist/es-legacy/components/internal/Button/CopyButton.js +1 -1
  160. package/dist/es-legacy/components/internal/Button/CopyButton.js.map +1 -1
  161. package/dist/es-legacy/components/internal/Button/CopyIconButton.js +1 -1
  162. package/dist/es-legacy/components/internal/Button/CopyIconButton.js.map +1 -1
  163. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
  164. package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
  165. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js +1 -1
  166. package/dist/es-legacy/components/internal/FormFields/ConsentCheckbox/ConsentCheckbox.js.map +1 -1
  167. package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
  168. package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
  169. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  170. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
  171. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js +1 -1
  172. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectList.js.map +1 -1
  173. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  174. package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
  175. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js +1 -1
  176. package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
  177. package/dist/es-legacy/components/internal/Modal/Modal.js +1 -1
  178. package/dist/es-legacy/components/internal/Modal/Modal.js.map +1 -1
  179. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
  180. package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
  181. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +1 -1
  182. package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -1
  183. package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
  184. package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
  185. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
  186. package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
  187. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js +1 -1
  188. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
  189. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +1 -1
  190. package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
  191. package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
  192. package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js +1 -1
  193. package/dist/es-legacy/components/internal/QRLoader/QRLoaderDetailsProvider.js.map +1 -1
  194. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js +1 -1
  195. package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.js.map +1 -1
  196. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
  197. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
  198. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js +1 -1
  199. package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
  200. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
  201. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
  202. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
  203. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
  204. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js +1 -1
  205. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleConfig.js.map +1 -1
  206. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js +1 -1
  207. package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleIOSTouchEvents.js.map +1 -1
  208. package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processPlaceholders.js.map +1 -1
  209. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js +1 -1
  210. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControl.js.map +1 -1
  211. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControlRegion.js +2 -0
  212. package/dist/es-legacy/components/internal/SegmentedControl/SegmentedControlRegion.js.map +1 -0
  213. package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js +1 -1
  214. package/dist/es-legacy/components/internal/StoreDetails/StoreDetails.js.map +1 -1
  215. package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
  216. package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
  217. package/dist/es-legacy/components/internal/Voucher/Voucher.js +1 -1
  218. package/dist/es-legacy/components/internal/Voucher/Voucher.js.map +1 -1
  219. package/dist/es-legacy/components/internal/Voucher/utils.js.map +1 -1
  220. package/dist/es-legacy/components/tx-variants.js +1 -1
  221. package/dist/es-legacy/components/tx-variants.js.map +1 -1
  222. package/dist/es-legacy/core/Analytics/events/AnalyticsInfoEvent.js +1 -1
  223. package/dist/es-legacy/core/Analytics/events/AnalyticsInfoEvent.js.map +1 -1
  224. package/dist/es-legacy/core/Analytics/utils.js +1 -1
  225. package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
  226. package/dist/es-legacy/core/Context/Resources.js +1 -1
  227. package/dist/es-legacy/core/Context/Resources.js.map +1 -1
  228. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js +1 -1
  229. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/PaymentMethods.js.map +1 -1
  230. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
  231. package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
  232. package/dist/es-legacy/core/config.js +1 -1
  233. package/dist/es-legacy/core/core.js +1 -1
  234. package/dist/es-legacy/core/core.js.map +1 -1
  235. package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js +1 -1
  236. package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
  237. package/dist/es-legacy/index.js +1 -1
  238. package/dist/es-legacy/language/Language.js.map +1 -1
  239. package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
  240. package/dist/es-legacy/utils/commonUtils.js.map +1 -1
  241. package/dist/es-legacy/utils/createSdkData.js +2 -0
  242. package/dist/es-legacy/utils/createSdkData.js.map +1 -0
  243. package/dist/es-legacy/utils/useForm/reducer.js +1 -1
  244. package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
  245. package/package.json +12 -12
  246. package/styles/adyen.css +8 -6
@@ -0,0 +1,2 @@
1
+ import{createElement as t}from"../../external/preact/dist/preact.js";import o from"../../utils/isMobile.js";import e from"../helpers/IssuerListContainer/IssuerListContainer.js";import{QRLoader as r}from"../internal/QRLoader/QRLoader.js";import"../../core/Context/CoreProvider.js";import"../../external/preact/hooks/dist/hooks.js";import"../../core/Errors/AdyenCheckoutError.js";import"../../core/Errors/SRPanelContext.js";import"../internal/Button/Button.js";import"../internal/QRLoader/QRLoaderDetailsProvider.js";import{TxVariants as s}from"../tx-variants.js";import n from"./components/IrisComponent.js";import{IrisQrCodeInstructions as i}from"./components/IrisQrCodeInstructions.js";import{IrisMode as p}from"./types.js";import{DEFAULT_IRIS_COUNTDOWN_TIME as a}from"./constants.js";function m(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}class d extends e{renderIssuerList(){return super.componentToRender()}formatData(){return this.mode===p.BANK_LIST?{paymentMethod:{type:this.type,issuer:this.state?.data?.issuer}}:{paymentMethod:{type:this.type}}}formatProps(t){return{...super.formatProps(t),countdownTime:t.countdownTime??a}}get isValid(){return this.mode!==p.BANK_LIST||super.isValid}componentToRender(){return"qrCode"===this.props.type?t(r,{type:s.iris,brandLogo:this.icon,clientKey:this.props.clientKey,qrCodeData:this.props.qrCodeData?encodeURIComponent(this.props.qrCodeData):null,countdownTime:this.props.countdownTime,paymentData:this.props.paymentData,amount:this.props.amount,delay:this.props.delay,onActionHandled:this.onActionHandled,onError:this.props.onError,onComplete:this.onComplete,introduction:i,showAmount:!0,copyBtn:!1}):t(n,{setComponentRef:this.setComponentRef,defaultMode:this.mode,onUpdateMode:this.onUpdateMode,issuerListUI:this.renderIssuerList(),showPayButton:this.props.showPayButton,payButton:this.payButton,issuers:this.props.issuers})}constructor(t,e){super(t,e),m(this,"mode",void 0),m(this,"onUpdateMode",t=>{this.mode=t}),this.mode=o()?p.BANK_LIST:p.QR_CODE}}m(d,"type",s.iris);export{d as Iris,d as default};
2
+ //# sourceMappingURL=Iris.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Iris.js","sources":["../../../../src/components/Iris/Iris.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { ICore } from '../../types';\nimport isMobile from '../../utils/isMobile';\nimport IssuerListContainer from '../helpers/IssuerListContainer/IssuerListContainer';\nimport { QRLoader } from '../internal/QRLoader';\nimport { TxVariants } from '../tx-variants';\nimport IrisComponent from './components/IrisComponent';\nimport { IrisQrCodeInstructions } from './components/IrisQrCodeInstructions';\nimport { IrisConfiguration, IrisData, IrisMode } from './types';\nimport { DEFAULT_IRIS_COUNTDOWN_TIME } from './constants';\n\nexport class Iris extends IssuerListContainer<IrisConfiguration, IrisData> {\n public static readonly type = TxVariants.iris;\n\n private mode: IrisMode;\n\n constructor(checkout: ICore, props: IrisConfiguration) {\n super(checkout, props);\n this.mode = isMobile() ? IrisMode.BANK_LIST : IrisMode.QR_CODE;\n }\n\n private readonly onUpdateMode = (mode: IrisMode): void => {\n this.mode = mode;\n };\n\n private renderIssuerList(): h.JSX.Element {\n return super.componentToRender();\n }\n\n formatData(): IrisData {\n if (this.mode === IrisMode.BANK_LIST) {\n return {\n paymentMethod: {\n type: this.type,\n issuer: this.state?.data?.issuer\n }\n };\n }\n\n return {\n paymentMethod: {\n type: this.type\n }\n };\n }\n\n formatProps(props: IrisConfiguration): IrisConfiguration {\n return {\n ...super.formatProps(props),\n countdownTime: props.countdownTime ?? DEFAULT_IRIS_COUNTDOWN_TIME\n };\n }\n\n get isValid() {\n if (this.mode === IrisMode.BANK_LIST) {\n return super.isValid;\n }\n\n return true;\n }\n\n protected override componentToRender(): h.JSX.Element {\n if (this.props.type === 'qrCode') {\n return (\n <QRLoader\n type={TxVariants.iris}\n brandLogo={this.icon}\n clientKey={this.props.clientKey}\n qrCodeData={this.props.qrCodeData ? encodeURIComponent(this.props.qrCodeData) : null}\n countdownTime={this.props.countdownTime}\n paymentData={this.props.paymentData}\n amount={this.props.amount}\n delay={this.props.delay}\n onActionHandled={this.onActionHandled}\n onError={this.props.onError}\n onComplete={this.onComplete}\n introduction={IrisQrCodeInstructions}\n showAmount\n copyBtn={false}\n />\n );\n }\n\n return (\n <IrisComponent\n setComponentRef={this.setComponentRef}\n defaultMode={this.mode}\n onUpdateMode={this.onUpdateMode}\n issuerListUI={this.renderIssuerList()}\n showPayButton={this.props.showPayButton}\n payButton={this.payButton}\n issuers={this.props.issuers}\n />\n );\n }\n}\n\nexport default Iris;\n"],"names":["Iris","IssuerListContainer","renderIssuerList","super","componentToRender","formatData","this","mode","IrisMode","BANK_LIST","paymentMethod","type","issuer","state","data","formatProps","props","countdownTime","DEFAULT_IRIS_COUNTDOWN_TIME","isValid","h","QRLoader","TxVariants","iris","brandLogo","icon","clientKey","qrCodeData","encodeURIComponent","paymentData","amount","delay","onActionHandled","onError","onComplete","introduction","IrisQrCodeInstructions","showAmount","copyBtn","IrisComponent","setComponentRef","defaultMode","onUpdateMode","issuerListUI","showPayButton","payButton","issuers","constructor","checkout","_define_property","isMobile","QR_CODE"],"mappings":"04BAWO,MAAMA,UAAaC,EAcdC,gBAAAA,GACJ,OAAOC,MAAMC,mBACjB,CAEAC,UAAAA,GACI,OAAIC,KAAKC,OAASC,EAASC,UAChB,CACHC,cAAe,CACXC,KAAML,KAAKK,KACXC,OAAQN,KAAKO,OAAOC,MAAMF,SAK/B,CACHF,cAAe,CACXC,KAAML,KAAKK,MAGvB,CAEAI,WAAAA,CAAYC,GACR,MAAO,IACAb,MAAMY,YAAYC,GACrBC,cAAeD,EAAMC,eAAiBC,EAE9C,CAEA,WAAIC,GACA,OAAIb,KAAKC,OAASC,EAASC,WAChBN,MAAMgB,OAIrB,CAEmBf,iBAAAA,GACf,MAAwB,WAApBE,KAAKU,MAAML,KAEPS,EAACC,EAAAA,CACGV,KAAMW,EAAWC,KACjBC,UAAWlB,KAAKmB,KAChBC,UAAWpB,KAAKU,MAAMU,UACtBC,WAAYrB,KAAKU,MAAMW,WAAaC,mBAAmBtB,KAAKU,MAAMW,YAAc,KAChFV,cAAeX,KAAKU,MAAMC,cAC1BY,YAAavB,KAAKU,MAAMa,YACxBC,OAAQxB,KAAKU,MAAMc,OACnBC,MAAOzB,KAAKU,MAAMe,MAClBC,gBAAiB1B,KAAK0B,gBACtBC,QAAS3B,KAAKU,MAAMiB,QACpBC,WAAY5B,KAAK4B,WACjBC,aAAcC,EACdC,YAAAA,EACAC,SAAS,IAMjBlB,EAACmB,EAAAA,CACGC,gBAAiBlC,KAAKkC,gBACtBC,YAAanC,KAAKC,KAClBmC,aAAcpC,KAAKoC,aACnBC,aAAcrC,KAAKJ,mBACnB0C,cAAetC,KAAKU,MAAM4B,cAC1BC,UAAWvC,KAAKuC,UAChBC,QAASxC,KAAKU,MAAM8B,SAGhC,CA9EA,WAAAC,CAAYC,EAAiBhC,GACzBb,MAAM6C,EAAUhC,GAHpBiC,EAAA3C,KAAQC,YAAR,GAOA0C,EAAA3C,KAAiBoC,eAAgBnC,IAC7BD,KAAKC,KAAOA,IAJZD,KAAKC,KAAO2C,IAAa1C,EAASC,UAAYD,EAAS2C,OAC3D,EAPAF,EADSjD,EACcW,OAAOW,EAAWC"}
@@ -0,0 +1,2 @@
1
+ import{createElement as t}from"../../../external/preact/dist/preact.js";import{IrisMode as e}from"../types.js";import{useState as o,useMemo as s,useRef as n,useEffect as r}from"../../../external/preact/hooks/dist/hooks.js";import{IRIS_ALLY_LABELS as a}from"../constants.js";import{getIrisSegmentedControlOptions as i}from"../utils.js";import{useCoreContext as d}from"../../../core/Context/CoreProvider.js";import{SegmentedControl as l}from"../../internal/SegmentedControl/SegmentedControl.js";import{SegmentedControlRegion as m}from"../../internal/SegmentedControl/SegmentedControlRegion.js";import u from"./IrisGenerateQRCode.js";import p from"./IrisComponent.module.scss.js";import{AnalyticsInfoEvent as c,UiTarget as f,InfoEventType as y}from"../../../core/Analytics/events/AnalyticsInfoEvent.js";import{TxVariants as C}from"../../tx-variants.js";import B from"../../../core/Analytics/useAnalytics.js";function j(j){const{i18n:g}=d(),{analytics:A}=B(),[I,R]=o(j.defaultMode),[S,h]=o("ready"),E=s(()=>i(g,j.defaultMode),[g,j.defaultMode]),L=j.issuers.length>0,_=(t,e=!1)=>{if(R(t),j.onUpdateMode(t),e){const e=new c({type:y.selected,target:f.segmentedControl,component:C.iris,selectedValue:t});A.sendAnalytics(e)}},w=n({setStatus:h});return r(()=>{j.setComponentRef(w.current)},[j.setComponentRef]),r(()=>{if(L){const t=new c({type:y.displayed,target:f.segmentedControl,component:C.iris,selectedValue:j.defaultMode});A.sendAnalytics(t)}},[]),r(()=>{L||_(e.QR_CODE)},[L]),L?t("div",null,t(l,{onChange:t=>_(t,!0),selectedValue:I,disabled:"loading"===S,options:E}),I===e.BANK_LIST&&t(m,{id:a.AreaId.BANK_LIST,ariaLabelledBy:a.ButtonId.BANK_LIST,className:p.bankList},j.issuerListUI),I===e.QR_CODE&&t(m,{id:a.AreaId.QR_CODE,ariaLabelledBy:a.ButtonId.QR_CODE},t(u,{showPayButton:j.showPayButton,payButton:j.payButton,status:S}))):t(u,{showPayButton:j.showPayButton,payButton:j.payButton,status:S})}export{j as default};
2
+ //# sourceMappingURL=IrisComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrisComponent.js","sources":["../../../../../src/components/Iris/components/IrisComponent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport { IrisMode } from '../types';\nimport { useEffect, useMemo, useRef, useState } from 'preact/hooks';\nimport { IRIS_ALLY_LABELS } from '../constants';\nimport { getIrisSegmentedControlOptions } from '../utils';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { SegmentedControl, SegmentedControlRegion } from '../../internal/SegmentedControl';\nimport { ComponentMethodsRef, UIElementStatus } from '../../types';\nimport { IssuerItem } from '../../internal/IssuerList/types';\nimport IrisGenerateQRCode from './IrisGenerateQRCode';\nimport styles from './IrisComponent.module.scss';\nimport { AnalyticsInfoEvent, InfoEventType, UiTarget } from '../../../core/Analytics/events/AnalyticsInfoEvent';\nimport { TxVariants } from '../../tx-variants';\nimport useAnalytics from '../../../core/Analytics/useAnalytics';\n\ninterface IrisComponentProps {\n defaultMode: IrisMode;\n showPayButton?: boolean;\n issuers: IssuerItem[];\n issuerListUI: h.JSX.Element;\n onUpdateMode: (mode: IrisMode) => void;\n payButton: (props: Partial<PayButtonProps>) => h.JSX.Element;\n setComponentRef: (ref: ComponentMethodsRef) => void;\n}\n\nexport default function IrisComponent(props: Readonly<IrisComponentProps>) {\n const { i18n } = useCoreContext();\n const { analytics } = useAnalytics();\n\n const [mode, setMode] = useState<IrisMode>(props.defaultMode);\n const [status, setStatus] = useState<UIElementStatus>('ready');\n const segmentedControlOptions = useMemo(() => getIrisSegmentedControlOptions(i18n, props.defaultMode), [i18n, props.defaultMode]);\n\n const issuersAvailable = props.issuers.length > 0;\n\n const handleModeChange = (mode: IrisMode, sendAnalytics = false) => {\n setMode(mode);\n props.onUpdateMode(mode);\n if (sendAnalytics) {\n const event = new AnalyticsInfoEvent({\n type: InfoEventType.selected,\n target: UiTarget.segmentedControl,\n component: TxVariants.iris,\n selectedValue: mode\n });\n analytics.sendAnalytics(event);\n }\n };\n\n const irisRef = useRef<ComponentMethodsRef>({\n setStatus: setStatus\n });\n\n useEffect(() => {\n props.setComponentRef(irisRef.current);\n }, [props.setComponentRef]);\n\n useEffect(() => {\n if (issuersAvailable) {\n const event = new AnalyticsInfoEvent({\n type: InfoEventType.displayed,\n target: UiTarget.segmentedControl,\n component: TxVariants.iris,\n selectedValue: props.defaultMode\n });\n analytics.sendAnalytics(event);\n }\n }, []);\n\n useEffect(() => {\n if (!issuersAvailable) {\n handleModeChange(IrisMode.QR_CODE);\n }\n }, [issuersAvailable]);\n\n if (!issuersAvailable) {\n return <IrisGenerateQRCode showPayButton={props.showPayButton} payButton={props.payButton} status={status} />;\n }\n\n return (\n <div>\n <SegmentedControl\n onChange={mode => handleModeChange(mode, true)}\n selectedValue={mode}\n disabled={status === 'loading'}\n options={segmentedControlOptions}\n />\n {mode === IrisMode.BANK_LIST && (\n <SegmentedControlRegion\n id={IRIS_ALLY_LABELS.AreaId.BANK_LIST}\n ariaLabelledBy={IRIS_ALLY_LABELS.ButtonId.BANK_LIST}\n className={styles.bankList}\n >\n {props.issuerListUI}\n </SegmentedControlRegion>\n )}\n {mode === IrisMode.QR_CODE && (\n <SegmentedControlRegion id={IRIS_ALLY_LABELS.AreaId.QR_CODE} ariaLabelledBy={IRIS_ALLY_LABELS.ButtonId.QR_CODE}>\n <IrisGenerateQRCode showPayButton={props.showPayButton} payButton={props.payButton} status={status} />\n </SegmentedControlRegion>\n )}\n </div>\n );\n}\n"],"names":["IrisComponent","props","i18n","useCoreContext","analytics","useAnalytics","mode","setMode","useState","defaultMode","status","setStatus","segmentedControlOptions","useMemo","getIrisSegmentedControlOptions","issuersAvailable","issuers","length","handleModeChange","sendAnalytics","onUpdateMode","event","AnalyticsInfoEvent","type","InfoEventType","selected","target","UiTarget","segmentedControl","component","TxVariants","iris","selectedValue","irisRef","useRef","useEffect","setComponentRef","current","displayed","IrisMode","QR_CODE","h","div","SegmentedControl","onChange","disabled","options","BANK_LIST","SegmentedControlRegion","id","IRIS_ALLY_LABELS","AreaId","ariaLabelledBy","ButtonId","className","styles","bankList","issuerListUI","IrisGenerateQRCode","showPayBut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AAgBF,EAAiBG,SAASb,SACnGC,EAACiB,EAAAA,CAAmBC,cAAe1D,EAAM0D,cAAeC,UAAW3D,EAAM2D,UAAWlD,OAAQA,MAtBjG+B,EAACiB,EAAAA,CAAmBC,cAAe1D,EAAM0D,cAAeC,UAAW3D,EAAM2D,UAAWlD,OAAQA,GA2B3G"}
@@ -0,0 +1,2 @@
1
+ var a={bankList:"IrisComponent-module_bankList__fehP-"};export{a as default};
2
+ //# sourceMappingURL=IrisComponent.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrisComponent.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{createElement as e}from"../../../external/preact/dist/preact.js";import{useCoreContext as t}from"../../../core/Context/CoreProvider.js";import o from"../../../core/Context/useImage.js";import r from"./IrisGenerateQRCode.module.scss.js";function s(s){const{i18n:n}=t(),a=o();return e("div",null,e("p",{className:r.instruction},n.get("iris.instructions.generateQrCode")),s.showPayButton&&s.payButton({label:n.get("generateQRCode"),icon:a({imageFolder:"components/"})("qr"),status:s.status}))}export{s as default};
2
+ //# sourceMappingURL=IrisGenerateQRCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrisGenerateQRCode.js","sources":["../../../../../src/components/Iris/components/IrisGenerateQRCode.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport useImage from '../../../core/Context/useImage';\nimport { UIElementStatus } from '../../types';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport styles from './IrisGenerateQRCode.module.scss';\n\ninterface IrisGenerateQRCodeProps {\n showPayButton?: boolean;\n payButton: (props: Partial<PayButtonProps>) => h.JSX.Element;\n status: UIElementStatus;\n}\n\nexport default function IrisGenerateQRCode(props: Readonly<IrisGenerateQRCodeProps>) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n return (\n <div>\n <p className={styles.instruction}>{i18n.get('iris.instructions.generateQrCode')}</p>\n {props.showPayButton &&\n props.payButton({\n label: i18n.get('generateQRCode'),\n icon: getImage({ imageFolder: 'components/' })('qr'),\n status: props.status\n })}\n </div>\n );\n}\n"],"names":["IrisGenerateQRCode","props","i18n","useCoreContext","getImage","useImage","h","div","p","className","styles","instruction","get","showPayButton","payButton","label","icon","imageFolder","status"],"mappings":"mPAae,SAASA,EAAmBC,GACvC,MAAMC,KAAEA,GAASC,IACXC,EAAWC,IAEjB,OACIC,EAACC,WACGD,EAACE,IAAAA,CAAEC,UAAWC,EAAOC,aAAcT,EAAKU,IAAI,qCAC3CX,EAAMY,eACHZ,EAAMa,UAAU,CACZC,MAAOb,EAAKU,IAAI,kBAChBI,KAAMZ,EAAS,CAAEa,YAAa,eAAxBb,CAAyC,MAC/Cc,OAAQjB,EAAMiB,SAIlC"}
@@ -0,0 +1,2 @@
1
+ var e={instruction:"IrisGenerateQRCode-module_instruction__uDTb-"};export{e as default};
2
+ //# sourceMappingURL=IrisGenerateQRCode.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrisGenerateQRCode.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{createElement as t}from"../../../external/preact/dist/preact.js";import{TimelineWrapper as e}from"../../internal/Timeline/TimelineWrapper.js";import{Timeline as i}from"../../internal/Timeline/Timeline.js";import{useCoreContext as r}from"../../../core/Context/CoreProvider.js";const n=()=>{const{i18n:n}=r();return t(e,null,t(i,{instructions:[n.get("iris.instructions.payment.step1"),n.get("iris.instructions.payment.step2"),n.get("iris.instructions.payment.step3")]}))};export{n as IrisQrCodeInstructions};
2
+ //# sourceMappingURL=IrisQrCodeInstructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrisQrCodeInstructions.js","sources":["../../../../../src/components/Iris/components/IrisQrCodeInstructions.tsx"],"sourcesContent":["import { h } from 'preact';\n\nimport { Timeline, TimelineWrapper } from '../../internal/Timeline';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\n\nexport const IrisQrCodeInstructions = () => {\n const { i18n } = useCoreContext();\n return (\n <TimelineWrapper>\n <Timeline\n instructions={[\n i18n.get('iris.instructions.payment.step1'),\n i18n.get('iris.instructions.payment.step2'),\n i18n.get('iris.instructions.payment.step3')\n ]}\n />\n </TimelineWrapper>\n );\n};\n"],"names":["IrisQrCodeInstructions","i18n","useCoreContext","h","TimelineWrapper","Timeline","instructions","get"],"mappings":"iSAKaA,EAAyB,KAClC,MAAMC,KAAEA,GAASC,IACjB,OACIC,EAACC,OACGD,EAACE,EAAAA,CACGC,aAAc,CACVL,EAAKM,IAAI,mCACTN,EAAKM,IAAI,mCACTN,EAAKM,IAAI"}
@@ -0,0 +1,2 @@
1
+ const i={ButtonId:{BANK_LIST:"iris-button-bank-list",QR_CODE:"iris-button-qrCode"},AreaId:{BANK_LIST:"iris-area-bank-list",QR_CODE:"iris-area-qrCode"}},r=10;export{r as DEFAULT_IRIS_COUNTDOWN_TIME,i as IRIS_ALLY_LABELS};
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/Iris/constants.ts"],"sourcesContent":["export const IRIS_ALLY_LABELS = {\n ButtonId: {\n BANK_LIST: 'iris-button-bank-list',\n QR_CODE: 'iris-button-qrCode'\n },\n AreaId: {\n BANK_LIST: 'iris-area-bank-list',\n QR_CODE: 'iris-area-qrCode'\n }\n};\n\nexport const DEFAULT_IRIS_COUNTDOWN_TIME = 10;\n"],"names":["IRIS_ALLY_LABELS","ButtonId","BANK_LIST","QR_CODE","AreaId","DEFAULT_IRIS_COUNTDOWN_TIME"],"mappings":"MAAaA,EAAmB,CAC5BC,SAAU,CACNC,UAAW,wBACXC,QAAS,sBAEbC,OAAQ,CACJF,UAAW,sBACXC,QAAS,qBAIJE,EAA8B"}
@@ -0,0 +1,2 @@
1
+ var r=function(r){return r.QR_CODE="qrCode",r.BANK_LIST="bankList",r}({});export{r as IrisMode};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../../src/components/Iris/types.ts"],"sourcesContent":["import { IssuerListConfiguration, QRLoaderConfiguration } from '../types';\n\nexport type IrisConfiguration = IssuerListConfiguration & Pick<QRLoaderConfiguration, 'countdownTime' | 'qrCodeData' | 'paymentData' | 'delay'>;\n\n/**\n * Iris data format for /payment request\n * @internal\n */\nexport interface IrisData {\n paymentMethod: {\n type: string;\n issuer?: string;\n };\n}\n\n/**\n * Iris component display modes\n * @internal\n */\nexport enum IrisMode {\n QR_CODE = 'qrCode',\n BANK_LIST = 'bankList'\n}\n"],"names":["IrisMode"],"mappings":"AAmBO,IAAKA,EAAAA,SAAAA,GAAAA,iDAAAA,CAGX,CAHWA,CAGX,CAAA"}
@@ -0,0 +1,2 @@
1
+ import{IRIS_ALLY_LABELS as t}from"./constants.js";import{IrisMode as o}from"./types.js";const e=(e,r)=>[{label:e.get("qrCode"),value:o.QR_CODE,id:t.ButtonId.QR_CODE,controls:t.AreaId.QR_CODE},{label:e.get("bankList"),value:o.BANK_LIST,id:t.ButtonId.BANK_LIST,controls:t.AreaId.BANK_LIST}].sort((t,o)=>t.value===r?-1:o.value===r?1:0);export{e as getIrisSegmentedControlOptions};
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/components/Iris/utils.ts"],"sourcesContent":["import Language from '../../language';\nimport { SegmentedControlOption } from '../internal/SegmentedControl/SegmentedControl';\nimport { IRIS_ALLY_LABELS } from './constants';\nimport { IrisMode } from './types';\n\nexport const getIrisSegmentedControlOptions = (i18n: Language, defaultMode: IrisMode): SegmentedControlOption<IrisMode>[] => {\n const options = [\n {\n label: i18n.get('qrCode'),\n value: IrisMode.QR_CODE,\n id: IRIS_ALLY_LABELS.ButtonId.QR_CODE,\n controls: IRIS_ALLY_LABELS.AreaId.QR_CODE\n },\n {\n label: i18n.get('bankList'),\n value: IrisMode.BANK_LIST,\n id: IRIS_ALLY_LABELS.ButtonId.BANK_LIST,\n controls: IRIS_ALLY_LABELS.AreaId.BANK_LIST\n }\n ];\n\n return options.sort((a, b) => {\n if (a.value === defaultMode) return -1;\n if (b.value === defaultMode) return 1;\n return 0;\n });\n};\n"],"names":["getIrisSegmentedControlOptions","i18n","defaultMode","label","get","value","IrisMode","QR_CODE","id","IRIS_ALLY_LABELS","ButtonId","controls","AreaId","BANK_LIST","sort","a","b"],"mappings":"wFAKO,MAAMA,EAAiC,CAACC,EAAgBC,IAC3C,CACZ,CACIC,MAAOF,EAAKG,IAAI,UAChBC,MAAOC,EAASC,QAChBC,GAAIC,EAAiBC,SAASH,QAC9BI,SAAUF,EAAiBG,OAAOL,SAEtC,CACIJ,MAAOF,EAAKG,IAAI,YAChBC,MAAOC,EAASO,UAChBL,GAAIC,EAAiBC,SAASG,UAC9BF,SAAUF,EAAiBG,OAAOC,YAI3BC,KAAK,CAACC,EAAGC,IAChBD,EAAEV,QAAUH,GAAoB,EAChCc,EAAEX,QAAUH,EAAoB,EAC7B"}
@@ -1,2 +1,2 @@
1
- import{createElement as t}from"../../../external/preact/dist/preact.js";import e from"../../internal/SegmentedControl/SegmentedControl.js";import{useState as o,useMemo as a}from"../../../external/preact/hooks/dist/hooks.js";import n from"./PayIDInput.js";import s from"./BSBInput.js";import{useCoreContext as r}from"../../../core/Context/CoreProvider.js";import i from"../../../_virtual/index.js";import{getUniqueId as p}from"../../../utils/idGenerator.js";function l(l){const{i18n:d}=r(),[u,m]=o("ready"),c=a(()=>p("payid-input"),[]),f=a(()=>p("bsb-input"),[]),b=a(()=>[{value:"payid-option",label:"PayID",id:"payid-option",controls:c},{value:"bsb-option",label:d.get("payto.bsb.option.label"),id:"bsb-option",controls:f}],[d,c,f]),y=b[0].value,[h,C]=o(y),g=({data:t,valid:e,errors:o,isValid:a})=>{l.onChange({data:{selectedInput:h,...t},valid:e,errors:o,isValid:a})};return t("div",{className:i({"adyen-checkout__payto-component":!0,"adyen-checkout__payto-component--loading":"loading"===u})},t(e,{selectedValue:h,options:b,onChange:C}),"payid-option"===h&&t(n,{id:c,status:u,setStatus:m,setComponentRef:l.setComponentRef,onChange:g,defaultData:l.data,placeholders:l.placeholders}),"bsb-option"===h&&t(s,{id:f,status:u,setStatus:m,setComponentRef:l.setComponentRef,onChange:g,defaultData:l.data,placeholders:l.placeholders}),l.showPayButton&&l.payButton({status:u,label:d.get("continue")}))}export{l as default};
1
+ import{createElement as t}from"../../../external/preact/dist/preact.js";import{SegmentedControl as e}from"../../internal/SegmentedControl/SegmentedControl.js";import{useState as o,useMemo as a}from"../../../external/preact/hooks/dist/hooks.js";import n from"./PayIDInput.js";import s from"./BSBInput.js";import{useCoreContext as r}from"../../../core/Context/CoreProvider.js";import i from"../../../_virtual/index.js";import{getUniqueId as p}from"../../../utils/idGenerator.js";function l(l){const{i18n:d}=r(),[u,m]=o("ready"),c=a(()=>p("payid-input"),[]),f=a(()=>p("bsb-input"),[]),b=a(()=>[{value:"payid-option",label:"PayID",id:"payid-option",controls:c},{value:"bsb-option",label:d.get("payto.bsb.option.label"),id:"bsb-option",controls:f}],[d,c,f]),y=b[0].value,[h,C]=o(y),g=({data:t,valid:e,errors:o,isValid:a})=>{l.onChange({data:{selectedInput:h,...t},valid:e,errors:o,isValid:a})};return t("div",{className:i({"adyen-checkout__payto-component":!0,"adyen-checkout__payto-component--loading":"loading"===u})},t(e,{selectedValue:h,options:b,onChange:C}),"payid-option"===h&&t(n,{id:c,status:u,setStatus:m,setComponentRef:l.setComponentRef,onChange:g,defaultData:l.data,placeholders:l.placeholders}),"bsb-option"===h&&t(s,{id:f,status:u,setStatus:m,setComponentRef:l.setComponentRef,onChange:g,defaultData:l.data,placeholders:l.placeholders}),l.showPayButton&&l.payButton({status:u,label:d.get("continue")}))}export{l as default};
2
2
  //# sourceMappingURL=PayToComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayToComponent.js","sources":["../../../../../src/components/PayTo/components/PayToComponent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport SegmentedControl from '../../internal/SegmentedControl';\nimport { useMemo, useState } from 'preact/hooks';\nimport { SegmentedControlOptions } from '../../internal/SegmentedControl/SegmentedControl';\nimport PayIDInput from './PayIDInput';\nimport BSBInput from './BSBInput';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { ComponentMethodsRef, UIElementStatus } from '../../internal/UIElement/types';\nimport { PayToData, PayToPlaceholdersType } from '../types';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport classNames from 'classnames';\nimport { getUniqueId } from '../../../utils/idGenerator';\nimport './PayToComponent.scss';\n\nexport type PayToInputOption = 'payid-option' | 'bsb-option';\n\nexport type PayToComponentData = { selectedInput: PayToInputOption };\n\nexport interface PayToComponentProps {\n showPayButton: boolean;\n onChange: (e) => void;\n setComponentRef: (ref: ComponentMethodsRef) => void;\n data: PayToData;\n placeholders: PayToPlaceholdersType;\n payButton: (props: Partial<PayButtonProps>) => h.JSX.Element;\n}\n\nexport default function PayToComponent(props: PayToComponentProps) {\n const { i18n } = useCoreContext();\n\n const [status, setStatus] = useState<UIElementStatus>('ready');\n\n // Generate unique IDs for the input sections\n const payidInputId = useMemo(() => getUniqueId('payid-input'), []);\n const bsbInputId = useMemo(() => getUniqueId('bsb-input'), []);\n\n const inputOptions: SegmentedControlOptions<PayToInputOption> = useMemo(\n () => [\n {\n value: 'payid-option',\n label: 'PayID',\n id: 'payid-option',\n controls: payidInputId\n },\n {\n value: 'bsb-option',\n label: i18n.get('payto.bsb.option.label'),\n id: 'bsb-option',\n controls: bsbInputId\n }\n ],\n [i18n, payidInputId, bsbInputId]\n );\n\n const defaultOption = inputOptions[0].value;\n const [selectedInput, setSelectedInput] = useState<PayToInputOption>(defaultOption);\n\n const onChange = ({ data, valid, errors, isValid }) => {\n // merge selected input to as data, this keep the input layers untouched\n props.onChange({ data: { selectedInput: selectedInput, ...data }, valid, errors, isValid });\n };\n\n return (\n <div\n className={classNames({\n 'adyen-checkout__payto-component': true,\n 'adyen-checkout__payto-component--loading': status === 'loading'\n })}\n >\n <SegmentedControl selectedValue={selectedInput} options={inputOptions} onChange={setSelectedInput} />\n {selectedInput === 'payid-option' && (\n <PayIDInput\n id={payidInputId}\n status={status}\n setStatus={setStatus}\n setComponentRef={props.setComponentRef}\n onChange={onChange}\n defaultData={props.data}\n placeholders={props.placeholders}\n />\n )}\n {selectedInput === 'bsb-option' && (\n <BSBInput\n id={bsbInputId}\n status={status}\n setStatus={setStatus}\n setComponentRef={props.setComponentRef}\n onChange={onChange}\n defaultData={props.data}\n placeholders={props.placeholders}\n />\n )}\n\n {props.showPayButton && props.payButton({ status, label: i18n.get('continue') })}\n </div>\n );\n}\n"],"names":["PayToComponent","props","i18n","useCoreContext","status","setStatus","useState","payidInputId","useMemo","getUniqueId","bsbInputId","inputOptions","value","label","id","controls","get","defaultOption","selectedInput","setSelectedInput","onChange","data","valid","errors","isValid","h","div","className","classNames","SegmentedControl","selectedValue","options","PayIDInput","setComponentRef","defaultData","placeholders","BSBInput","showPayButton","payButton"],"mappings":"ycA2Be,SAASA,EAAeC,GACnC,MAAMC,KAAEA,GAASC,KAEVC,EAAQC,GAAaC,EAA0B,SAGhDC,EAAeC,EAAQ,IAAMC,EAAY,eAAgB,IACzDC,EAAaF,EAAQ,IAAMC,EAAY,aAAc,IAErDE,EAA0DH,EAC5D,IAAM,CACF,CACII,MAAO,eACPC,MAAO,QACPC,GAAI,eACJC,SAAUR,GAEd,CACIK,MAAO,aACPC,MAAOX,EAAKc,IAAI,0BAChBF,GAAI,aACJC,SAAUL,IAGlB,CAACR,EAAMK,EAAcG,IAGnBO,EAAgBN,EAAa,GAAGC,OAC/BM,EAAeC,GAAoBb,EAA2BW,GAE/DG,EAAW,EAAGC,OAAMC,QAAOC,SAAQC,cAErCvB,EAAMmB,SAAS,CAAEC,KAAM,CAAEH,cAAeA,KAAkBG,GAAQC,QAAOC,SAAQC,aAGrF,OACIC,EAACC,MAAAA,CACGC,UAAWC,EAAW,CAClB,mCAAmC,EACnC,2CAAuD,YAAXxB,KAGhDqB,EAACI,EAAAA,CAAiBC,cAAeZ,EAAea,QAASpB,EAAcS,SAAUD,IAC9D,iBAAlBD,GACGO,EAACO,EAAAA,CACGlB,GAAIP,EACJH,OAAQA,EACRC,UAAWA,EACX4B,gBAAiBhC,EAAMgC,gBACvBb,SAAUA,EACVc,YAAajC,EAAMoB,KACnBc,aAAclC,EAAMkC,eAGT,eAAlBjB,GACGO,EAACW,EAAAA,CACGtB,GAAIJ,EACJN,OAAQA,EACRC,UAAWA,EACX4B,gBAAiBhC,EAAMgC,gBACvBb,SAAUA,EACVc,YAAajC,EAAMoB,KACnBc,aAAclC,EAAMkC,eAI3BlC,EAAMoC,eAAiBpC,EAAMqC,UAAU,CAAElC,SAAQS,MAAOX,EAAKc,IAAI,cAG9E"}
1
+ {"version":3,"file":"PayToComponent.js","sources":["../../../../../src/components/PayTo/components/PayToComponent.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { SegmentedControl } from '../../internal/SegmentedControl';\nimport { useMemo, useState } from 'preact/hooks';\nimport { SegmentedControlOptions } from '../../internal/SegmentedControl/SegmentedControl';\nimport PayIDInput from './PayIDInput';\nimport BSBInput from './BSBInput';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { ComponentMethodsRef, UIElementStatus } from '../../internal/UIElement/types';\nimport { PayToData, PayToPlaceholdersType } from '../types';\nimport { PayButtonProps } from '../../internal/PayButton/PayButton';\nimport classNames from 'classnames';\nimport { getUniqueId } from '../../../utils/idGenerator';\nimport './PayToComponent.scss';\n\nexport type PayToInputOption = 'payid-option' | 'bsb-option';\n\nexport type PayToComponentData = { selectedInput: PayToInputOption };\n\nexport interface PayToComponentProps {\n showPayButton: boolean;\n onChange: (e) => void;\n setComponentRef: (ref: ComponentMethodsRef) => void;\n data: PayToData;\n placeholders: PayToPlaceholdersType;\n payButton: (props: Partial<PayButtonProps>) => h.JSX.Element;\n}\n\nexport default function PayToComponent(props: PayToComponentProps) {\n const { i18n } = useCoreContext();\n\n const [status, setStatus] = useState<UIElementStatus>('ready');\n\n // Generate unique IDs for the input sections\n const payidInputId = useMemo(() => getUniqueId('payid-input'), []);\n const bsbInputId = useMemo(() => getUniqueId('bsb-input'), []);\n\n const inputOptions: SegmentedControlOptions<PayToInputOption> = useMemo(\n () => [\n {\n value: 'payid-option',\n label: 'PayID',\n id: 'payid-option',\n controls: payidInputId\n },\n {\n value: 'bsb-option',\n label: i18n.get('payto.bsb.option.label'),\n id: 'bsb-option',\n controls: bsbInputId\n }\n ],\n [i18n, payidInputId, bsbInputId]\n );\n\n const defaultOption = inputOptions[0].value;\n const [selectedInput, setSelectedInput] = useState<PayToInputOption>(defaultOption);\n\n const onChange = ({ data, valid, errors, isValid }) => {\n // merge selected input to as data, this keep the input layers untouched\n props.onChange({ data: { selectedInput: selectedInput, ...data }, valid, errors, isValid });\n };\n\n return (\n <div\n className={classNames({\n 'adyen-checkout__payto-component': true,\n 'adyen-checkout__payto-component--loading': status === 'loading'\n })}\n >\n <SegmentedControl selectedValue={selectedInput} options={inputOptions} onChange={setSelectedInput} />\n {selectedInput === 'payid-option' && (\n <PayIDInput\n id={payidInputId}\n status={status}\n setStatus={setStatus}\n setComponentRef={props.setComponentRef}\n onChange={onChange}\n defaultData={props.data}\n placeholders={props.placeholders}\n />\n )}\n {selectedInput === 'bsb-option' && (\n <BSBInput\n id={bsbInputId}\n status={status}\n setStatus={setStatus}\n setComponentRef={props.setComponentRef}\n onChange={onChange}\n defaultData={props.data}\n placeholders={props.placeholders}\n />\n )}\n\n {props.showPayButton && props.payButton({ status, label: i18n.get('continue') })}\n </div>\n );\n}\n"],"names":["PayToComponent","props","i18n","useCoreContext","status","setStatus","useState","payidInputId","useMemo","getUniqueId","bsbInputId","inputOptions","value","label","id","controls","get","defaultOption","selectedInput","setSelectedInput","onChange","data","valid","errors","isValid","h","div","className","classNames","SegmentedControl","selectedValue","options","PayIDInput","setComponentRef","defaultData","placeholders","BSBInput","showPayButton","payButton"],"mappings":"6dA2Be,SAASA,EAAeC,GACnC,MAAMC,KAAEA,GAASC,KAEVC,EAAQC,GAAaC,EAA0B,SAGhDC,EAAeC,EAAQ,IAAMC,EAAY,eAAgB,IACzDC,EAAaF,EAAQ,IAAMC,EAAY,aAAc,IAErDE,EAA0DH,EAC5D,IAAM,CACF,CACII,MAAO,eACPC,MAAO,QACPC,GAAI,eACJC,SAAUR,GAEd,CACIK,MAAO,aACPC,MAAOX,EAAKc,IAAI,0BAChBF,GAAI,aACJC,SAAUL,IAGlB,CAACR,EAAMK,EAAcG,IAGnBO,EAAgBN,EAAa,GAAGC,OAC/BM,EAAeC,GAAoBb,EAA2BW,GAE/DG,EAAW,EAAGC,OAAMC,QAAOC,SAAQC,cAErCvB,EAAMmB,SAAS,CAAEC,KAAM,CAAEH,cAAeA,KAAkBG,GAAQC,QAAOC,SAAQC,aAGrF,OACIC,EAACC,MAAAA,CACGC,UAAWC,EAAW,CAClB,mCAAmC,EACnC,2CAAuD,YAAXxB,KAGhDqB,EAACI,EAAAA,CAAiBC,cAAeZ,EAAea,QAASpB,EAAcS,SAAUD,IAC9D,iBAAlBD,GACGO,EAACO,EAAAA,CACGlB,GAAIP,EACJH,OAAQA,EACRC,UAAWA,EACX4B,gBAAiBhC,EAAMgC,gBACvBb,SAAUA,EACVc,YAAajC,EAAMoB,KACnBc,aAAclC,EAAMkC,eAGT,eAAlBjB,GACGO,EAACW,EAAAA,CACGtB,GAAIJ,EACJN,OAAQA,EACRC,UAAWA,EACX4B,gBAAiBhC,EAAMgC,gBACvBb,SAAUA,EACVc,YAAajC,EAAMoB,KACnBc,aAAclC,EAAMkC,eAI3BlC,EAAMoC,eAAiBpC,EAAMqC,UAAU,CAAElC,SAAQS,MAAOX,EAAKc,IAAI,cAG9E"}
@@ -1,2 +1,2 @@
1
- import{createElement as e,Fragment as t}from"../../../../external/preact/dist/preact.js";import{useState as a,useCallback as o,useEffect as n}from"../../../../external/preact/hooks/dist/hooks.js";import i from"../VpaInput/VpaInput.js";import r from"../../../../core/Context/useImage.js";import{A11Y as s}from"../../constants.js";import l from"../../../internal/SegmentedControl/SegmentedControl.js";import d from"../UPIIntentAppList/UPIIntentAppList.js";import{useCoreContext as p}from"../../../../core/Context/CoreProvider.js";import c from"../../../internal/Alert/Alert.js";import u from"../UPIMandate/UPIMandate.js";function m({defaultMode:m,onChange:g,payButton:I,showPayButton:b,mandate:h,amount:f,onUpdateMode:y=()=>{},apps:C=[],segmentedControlOptions:A=[]}){const{i18n:N}=p(),j=r(),[k,v]=a("ready"),[P,S]=a(m),[V,q]=a(null),[x,B]=a(null),[M,U]=a("qrCode"===m),E=h&&e(u,{mandate:h,amount:f});this.setStatus=e=>{v(e)},this.showValidation=()=>{V?.validateInput(),"intent"===P&&w()};const T=o(e=>{q(e)},[]),Q=o(e=>{S(e),y(e)},[y]),R=o(e=>{e?.id!==x?.id&&(B(e),U(!0),v("ready"))},[x]),w=o(()=>{x?(v("ready"),U(!0)):(v("error"),U(!1))},[x]);return n(()=>{g("qrCode"!==P?{data:{...x&&{app:x}},isValid:M}:{data:{},valid:{},errors:{},isValid:!0})},[x,M,P,g]),e(t,null,A.length>0&&e("p",{className:"adyen-checkout_upi-mode-selection-text"},N.get("upi.modeSelection")),e(l,{onChange:Q,selectedValue:P,disabled:"loading"===k,classNameModifiers:["upi-margin-bottom"],options:A}),"intent"===P&&e("div",{id:s.AreaId.INTENT,"aria-labelledby":s.ButtonId.INTENT,className:"adyen-checkout-upi-area-intent",role:"region"},e("span",{className:"adyen-checkout-upi-instruction-label"},N.get("upi.intent.instruction")),"error"===k&&e(c,{icon:"cross"},N.get("upi.error.noAppSelected")),e(d,{disabled:"loading"===k,apps:C,selectedAppId:x?.id,onAppSelect:R}),E,b&&I({label:N.get("continue"),status:k})),"vpa"===P&&e("div",{id:s.AreaId.VPA,"aria-labelledby":s.ButtonId.VPA,className:"adyen-checkout-upi-area-vpa",role:"region"},e("span",{className:"adyen-checkout-upi-instruction-label"},N.get("upi.collect.instruction")),e(i,{disabled:"loading"===k,onChange:g,onSetInputHandlers:T}),E,b&&I({label:N.get("continue"),status:k})),"qrCode"===P&&e("div",{id:s.AreaId.QR,"aria-labelledby":s.ButtonId.QR,className:"adyen-checkout-upi-area-qr-code",role:"region"},e("span",{className:"adyen-checkout-upi-instruction-label"},N.get("upi.qrCode.instruction")),E,b&&I({label:N.get("generateQRCode"),icon:j({imageFolder:"components/"})("qr"),status:k})))}export{m as default};
1
+ import{createElement as e,Fragment as t}from"../../../../external/preact/dist/preact.js";import{useState as a,useCallback as n,useEffect as o}from"../../../../external/preact/hooks/dist/hooks.js";import r from"../VpaInput/VpaInput.js";import i from"../../../../core/Context/useImage.js";import{A11Y as s}from"../../constants.js";import{SegmentedControl as d}from"../../../internal/SegmentedControl/SegmentedControl.js";import{SegmentedControlRegion as l}from"../../../internal/SegmentedControl/SegmentedControlRegion.js";import p from"../UPIIntentAppList/UPIIntentAppList.js";import{useCoreContext as c}from"../../../../core/Context/CoreProvider.js";import u from"../../../internal/Alert/Alert.js";import m from"../UPIMandate/UPIMandate.js";function g({defaultMode:g,onChange:I,payButton:f,showPayButton:h,mandate:C,amount:y,onUpdateMode:b=()=>{},apps:A=[],segmentedControlOptions:N=[]}){const{i18n:j}=c(),k=i(),[S,B]=a("ready"),[P,V]=a(g),[q,x]=a(null),[v,L]=a(null),[M,U]=a("qrCode"===g),E=C&&e(m,{mandate:C,amount:y});this.setStatus=e=>{B(e)},this.showValidation=()=>{q?.validateInput(),"intent"===P&&w()};const R=n(e=>{x(e)},[]),T=n(e=>{V(e),b(e)},[b]),Q=n(e=>{e?.id!==v?.id&&(L(e),U(!0),B("ready"))},[v]),w=n(()=>{v?(B("ready"),U(!0)):(B("error"),U(!1))},[v]);return o(()=>{I("qrCode"!==P?{data:{...v&&{app:v}},isValid:M}:{data:{},valid:{},errors:{},isValid:!0})},[v,M,P,I]),e(t,null,N.length>0&&e("p",{className:"adyen-checkout_upi-mode-selection-text"},j.get("upi.modeSelection")),e(d,{onChange:T,selectedValue:P,disabled:"loading"===S,classNameModifiers:["upi-margin-bottom"],options:N}),"intent"===P&&e(l,{id:s.AreaId.INTENT,ariaLabelledBy:s.ButtonId.INTENT,className:"adyen-checkout-upi-area-intent"},e("span",{className:"adyen-checkout-upi-instruction-label"},j.get("upi.intent.instruction")),"error"===S&&e(u,{icon:"cross"},j.get("upi.error.noAppSelected")),e(p,{disabled:"loading"===S,apps:A,selectedAppId:v?.id,onAppSelect:Q}),E,h&&f({label:j.get("continue"),status:S})),"vpa"===P&&e(l,{id:s.AreaId.VPA,ariaLabelledBy:s.ButtonId.VPA,className:"adyen-checkout-upi-area-vpa"},e("span",{className:"adyen-checkout-upi-instruction-label"},j.get("upi.collect.instruction")),e(r,{disabled:"loading"===S,onChange:I,onSetInputHandlers:R}),E,h&&f({label:j.get("continue"),status:S})),"qrCode"===P&&e(l,{id:s.AreaId.QR,ariaLabelledBy:s.ButtonId.QR,className:"adyen-checkout-upi-area-qr-code"},e("span",{className:"adyen-checkout-upi-instruction-label"},j.get("upi.qrCode.instruction")),E,h&&f({label:j.get("generateQRCode"),icon:k({imageFolder:"components/"})("qr"),status:S})))}export{g as default};
2
2
  //# sourceMappingURL=UPIComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UPIComponent.js","sources":["../../../../../../src/components/UPI/components/UPIComponent/UPIComponent.tsx"],"sourcesContent":["import { Fragment, h, RefObject } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport { PayButtonFunctionProps, UIElementStatus } from '../../../types';\nimport VpaInput, { VpaInputHandlers } from '../VpaInput/VpaInput';\nimport { App, UpiMode } from '../../types';\nimport useImage from '../../../../core/Context/useImage';\nimport { A11Y } from '../../constants';\nimport './UPIComponent.scss';\nimport SegmentedControl from '../../../internal/SegmentedControl';\nimport UPIIntentAppList from '../UPIIntentAppList';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport Alert from '../../../internal/Alert';\nimport { SegmentedControlOption } from '../../../internal/SegmentedControl/SegmentedControl';\nimport UPIMandate, { Mandate } from '../UPIMandate/UPIMandate';\nimport type { PaymentAmount } from '../../../../types/global-types';\n\ntype UpiData = { app?: App; virtualPaymentAddress?: string };\n\ntype OnChangeProps = { data: UpiData; valid?: { [key: string]: boolean }; errors?: { [key: string]: any }; isValid: boolean };\n\ninterface UPIComponentProps {\n defaultMode: UpiMode;\n showPayButton: boolean;\n apps?: Array<App>;\n segmentedControlOptions?: Array<SegmentedControlOption<UpiMode>>;\n mandate?: Mandate;\n amount?: PaymentAmount;\n\n ref?(ref: RefObject<typeof UPIComponent>): void;\n\n payButton?(props: PayButtonFunctionProps): h.JSX.Element;\n\n onChange({ data, valid, errors, isValid }: OnChangeProps): void;\n\n onUpdateMode?(mode: UpiMode): void;\n}\n\nexport default function UPIComponent({\n defaultMode,\n onChange,\n payButton,\n showPayButton,\n mandate,\n amount,\n onUpdateMode = () => {},\n apps = [],\n segmentedControlOptions = []\n}: Readonly<UPIComponentProps>): h.JSX.Element {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const [status, setStatus] = useState<UIElementStatus>('ready');\n const [mode, setMode] = useState<UpiMode>(defaultMode);\n const [vpaInputHandlers, setVpaInputHandlers] = useState<VpaInputHandlers>(null);\n const [selectedApp, setSelectedApp] = useState<App>(null);\n const [isValid, setIsValid] = useState<boolean>(defaultMode === 'qrCode');\n const mandateComponent = mandate && <UPIMandate mandate={mandate} amount={amount} />;\n\n this.setStatus = (status: UIElementStatus) => {\n setStatus(status);\n };\n\n this.showValidation = () => {\n vpaInputHandlers?.validateInput();\n if (mode === 'intent') {\n validateIntentApp();\n }\n };\n\n const onSetVpaInputHandlers = useCallback((handlers: VpaInputHandlers) => {\n setVpaInputHandlers(handlers);\n }, []);\n\n const onChangeUpiMode = useCallback(\n (newMode: UpiMode) => {\n setMode(newMode);\n onUpdateMode(newMode);\n },\n [onUpdateMode]\n );\n\n const handleAppSelect = useCallback(\n (app: App) => {\n if (app?.id === selectedApp?.id) return;\n\n setSelectedApp(app);\n setIsValid(true);\n setStatus('ready');\n },\n [selectedApp]\n );\n\n const validateIntentApp = useCallback(() => {\n if (!selectedApp) {\n setStatus('error');\n setIsValid(false);\n } else {\n setStatus('ready');\n setIsValid(true);\n }\n }, [selectedApp]);\n\n useEffect(() => {\n if (mode !== 'qrCode') {\n onChange({\n data: { ...(selectedApp && { app: selectedApp }) },\n isValid\n });\n } else {\n /**\n * When selecting QR code mode, we need to clear the state data and trigger the 'onChange'.\n */\n onChange({ data: {}, valid: {}, errors: {}, isValid: true });\n }\n }, [selectedApp, isValid, mode, onChange]);\n\n return (\n <Fragment>\n {segmentedControlOptions.length > 0 && <p className=\"adyen-checkout_upi-mode-selection-text\">{i18n.get('upi.modeSelection')}</p>}\n <SegmentedControl\n onChange={onChangeUpiMode}\n selectedValue={mode}\n disabled={status === 'loading'}\n classNameModifiers={['upi-margin-bottom']}\n options={segmentedControlOptions}\n />\n\n {mode === 'intent' && (\n <div id={A11Y.AreaId.INTENT} aria-labelledby={A11Y.ButtonId.INTENT} className=\"adyen-checkout-upi-area-intent\" role=\"region\">\n <span className=\"adyen-checkout-upi-instruction-label\">{i18n.get('upi.intent.instruction')}</span>\n {status === 'error' && <Alert icon={'cross'}>{i18n.get('upi.error.noAppSelected')}</Alert>}\n <UPIIntentAppList disabled={status === 'loading'} apps={apps} selectedAppId={selectedApp?.id} onAppSelect={handleAppSelect} />\n {mandateComponent}\n {showPayButton &&\n payButton({\n label: i18n.get('continue'),\n status\n })}\n </div>\n )}\n {mode === 'vpa' && (\n <div id={A11Y.AreaId.VPA} aria-labelledby={A11Y.ButtonId.VPA} className=\"adyen-checkout-upi-area-vpa\" role=\"region\">\n <span className=\"adyen-checkout-upi-instruction-label\">{i18n.get('upi.collect.instruction')}</span>\n <VpaInput disabled={status === 'loading'} onChange={onChange} onSetInputHandlers={onSetVpaInputHandlers} />\n {mandateComponent}\n {showPayButton &&\n payButton({\n label: i18n.get('continue'),\n status\n })}\n </div>\n )}\n {mode === 'qrCode' && (\n <div id={A11Y.AreaId.QR} aria-labelledby={A11Y.ButtonId.QR} className=\"adyen-checkout-upi-area-qr-code\" role=\"region\">\n <span className=\"adyen-checkout-upi-instruction-label\">{i18n.get('upi.qrCode.instruction')}</span>\n {mandateComponent}\n {showPayButton &&\n payButton({\n label: i18n.get('generateQRCode'),\n icon: getImage({ imageFolder: 'components/' })('qr'),\n status\n })}\n </div>\n )}\n </Fragment>\n );\n}\n"],"names":["UPIComponent","defaultMode","onChange","payButton","showPayButton","mandate","amount","onUpdateMode","apps","segmentedControlOptions","i18n","useCoreContext","getImage","useImage","status","setStatus","useState","mode","setMode","vpaInputHandlers","setVpaInputHandlers","selectedApp","setSelectedApp","isValid","setIsValid","mandateComponent","h","UPIMandate","this","showValidation","validateInput","validateIntentApp","onSetVpaInputHandlers","useCallback","handlers","onChangeUpiMode","newMode","handleAppSelect","app","id","useEffect","data","valid","errors","Fragment","length","p","className","get","SegmentedControl","selectedValue","disabled","classNameModifiers","options","div","A11Y","AreaId","INTENT","aria-labelledby","ButtonId","role","span","Alert","icon","UPIIntentAppList","selectedAppId","onAppSelect","label","VPA","VpaInput","onSetInputHandlers","QR","imageFolder"],"mappings":"2mBAqCe,SAASA,GAAaC,YACjCA,EAAWC,SACXA,EAAQC,UACRA,EAASC,cACTA,EAAaC,QACbA,EAAOC,OACPA,EAAMC,aACNA,EAAe,OAAQC,KACvBA,EAAO,GAAEC,wBACTA,EAA0B,KAE1B,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KACVC,EAAQC,GAAaC,EAA0B,UAC/CC,EAAMC,GAAWF,EAAkBf,IACnCkB,EAAkBC,GAAuBJ,EAA2B,OACpEK,EAAaC,GAAkBN,EAAc,OAC7CO,EAASC,GAAcR,EAAkC,WAAhBf,GAC1CwB,EAAmBpB,GAAWqB,EAACC,EAAAA,CAAWtB,QAASA,EAASC,OAAQA,IAE1EsB,KAAKb,UAAaD,IACdC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KsC,IAAI,YAChBlC,YAIN,QAATG,GACGS,EAAC4B,MAAAA,CAAIf,GAAIgB,EAAKC,OAAOY,IAAKV,kBAAiBH,EAAKI,SAASS,IAAKrB,UAAU,8BAA8Ba,KAAK,UACvGlC,EAACmC,OAAAA,CAAKd,UAAU,wCAAwCrC,EAAKsC,IAAI,4BACjEtB,EAAC2C,EAAAA,CAASlB,SAAqB,YAAXrC,EAAsBZ,SAAUA,EAAUoE,mBAAoBtC,IACjFP,EACArB,GACGD,EAAU,CACNgE,MAAOzD,EAAKsC,IAAI,YAChBlC,YAIN,WAATG,GACGS,EAAC4B,MAAAA,CAAIf,GAAIgB,EAAKC,OAAOe,GAAIb,kBAAiBH,EAAKI,SAASY,GAAIxB,UAAU,kCAAkCa,KAAK,UACzGlC,EAACmC,OAAAA,CAAKd,UAAU,wCAAwCrC,EAAKsC,IAAI,2BAChEvB,EACArB,GACGD,EAAU,CACNgE,MAAOzD,EAAKsC,IAAI,kBAChBe,KAAMnD,EAAS,CAAE4D,YAAa,eAAxB5D,CAAyC,MAC/CE,YAM5B"}
1
+ {"version":3,"file":"UPIComponent.js","sources":["../../../../../../src/components/UPI/components/UPIComponent/UPIComponent.tsx"],"sourcesContent":["import { Fragment, h, RefObject } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport { PayButtonFunctionProps, UIElementStatus } from '../../../types';\nimport VpaInput, { VpaInputHandlers } from '../VpaInput/VpaInput';\nimport { App, UpiMode } from '../../types';\nimport useImage from '../../../../core/Context/useImage';\nimport { A11Y } from '../../constants';\nimport './UPIComponent.scss';\nimport { SegmentedControl, SegmentedControlRegion } from '../../../internal/SegmentedControl';\nimport UPIIntentAppList from '../UPIIntentAppList';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport Alert from '../../../internal/Alert';\nimport { SegmentedControlOption } from '../../../internal/SegmentedControl/SegmentedControl';\nimport UPIMandate, { Mandate } from '../UPIMandate/UPIMandate';\nimport type { PaymentAmount } from '../../../../types/global-types';\n\ntype UpiData = { app?: App; virtualPaymentAddress?: string };\n\ntype OnChangeProps = { data: UpiData; valid?: { [key: string]: boolean }; errors?: { [key: string]: any }; isValid: boolean };\n\ninterface UPIComponentProps {\n defaultMode: UpiMode;\n showPayButton: boolean;\n apps?: Array<App>;\n segmentedControlOptions?: Array<SegmentedControlOption<UpiMode>>;\n mandate?: Mandate;\n amount?: PaymentAmount;\n\n ref?(ref: RefObject<typeof UPIComponent>): void;\n\n payButton?(props: PayButtonFunctionProps): h.JSX.Element;\n\n onChange({ data, valid, errors, isValid }: OnChangeProps): void;\n\n onUpdateMode?(mode: UpiMode): void;\n}\n\nexport default function UPIComponent({\n defaultMode,\n onChange,\n payButton,\n showPayButton,\n mandate,\n amount,\n onUpdateMode = () => {},\n apps = [],\n segmentedControlOptions = []\n}: Readonly<UPIComponentProps>): h.JSX.Element {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const [status, setStatus] = useState<UIElementStatus>('ready');\n const [mode, setMode] = useState<UpiMode>(defaultMode);\n const [vpaInputHandlers, setVpaInputHandlers] = useState<VpaInputHandlers>(null);\n const [selectedApp, setSelectedApp] = useState<App>(null);\n const [isValid, setIsValid] = useState<boolean>(defaultMode === 'qrCode');\n const mandateComponent = mandate && <UPIMandate mandate={mandate} amount={amount} />;\n\n this.setStatus = (status: UIElementStatus) => {\n setStatus(status);\n };\n\n this.showValidation = () => {\n vpaInputHandlers?.validateInput();\n if (mode === 'intent') {\n validateIntentApp();\n }\n };\n\n const onSetVpaInputHandlers = useCallback((handlers: VpaInputHandlers) => {\n setVpaInputHandlers(handlers);\n }, []);\n\n const onChangeUpiMode = useCallback(\n (newMode: UpiMode) => {\n setMode(newMode);\n onUpdateMode(newMode);\n },\n [onUpdateMode]\n );\n\n const handleAppSelect = useCallback(\n (app: App) => {\n if (app?.id === selectedApp?.id) return;\n\n setSelectedApp(app);\n setIsValid(true);\n setStatus('ready');\n },\n [selectedApp]\n );\n\n const validateIntentApp = useCallback(() => {\n if (!selectedApp) {\n setStatus('error');\n setIsValid(false);\n } else {\n setStatus('ready');\n setIsValid(true);\n }\n }, [selectedApp]);\n\n useEffect(() => {\n if (mode !== 'qrCode') {\n onChange({\n data: { ...(selectedApp && { app: selectedApp }) },\n isValid\n });\n } else {\n /**\n * When selecting QR code mode, we need to clear the state data and trigger the 'onChange'.\n */\n onChange({ data: {}, valid: {}, errors: {}, isValid: true });\n }\n }, [selectedApp, isValid, mode, onChange]);\n\n return (\n <Fragment>\n {segmentedControlOptions.length > 0 && <p className=\"adyen-checkout_upi-mode-selection-text\">{i18n.get('upi.modeSelection')}</p>}\n <SegmentedControl\n onChange={onChangeUpiMode}\n selectedValue={mode}\n disabled={status === 'loading'}\n classNameModifiers={['upi-margin-bottom']}\n options={segmentedControlOptions}\n />\n\n {mode === 'intent' && (\n <SegmentedControlRegion id={A11Y.AreaId.INTENT} ariaLabelledBy={A11Y.ButtonId.INTENT} className=\"adyen-checkout-upi-area-intent\">\n <span className=\"adyen-checkout-upi-instruction-label\">{i18n.get('upi.intent.instruction')}</span>\n {status === 'error' && <Alert icon={'cross'}>{i18n.get('upi.error.noAppSelected')}</Alert>}\n <UPIIntentAppList disabled={status === 'loading'} apps={apps} selectedAppId={selectedApp?.id} onAppSelect={handleAppSelect} />\n {mandateComponent}\n {showPayButton &&\n payButton({\n label: i18n.get('continue'),\n status\n })}\n </SegmentedControlRegion>\n )}\n {mode === 'vpa' && (\n <SegmentedControlRegion id={A11Y.AreaId.VPA} ariaLabelledBy={A11Y.ButtonId.VPA} className=\"adyen-checkout-upi-area-vpa\">\n <span className=\"adyen-checkout-upi-instruction-label\">{i18n.get('upi.collect.instruction')}</span>\n <VpaInput disabled={status === 'loading'} onChange={onChange} onSetInputHandlers={onSetVpaInputHandlers} />\n {mandateComponent}\n {showPayButton &&\n payButton({\n label: i18n.get('continue'),\n status\n })}\n </SegmentedControlRegion>\n )}\n {mode === 'qrCode' && (\n <SegmentedControlRegion id={A11Y.AreaId.QR} ariaLabelledBy={A11Y.ButtonId.QR} className=\"adyen-checkout-upi-area-qr-code\">\n <span className=\"adyen-checkout-upi-instruction-label\">{i18n.get('upi.qrCode.instruction')}</span>\n {mandateComponent}\n {showPayButton &&\n payButton({\n label: i18n.get('generateQRCode'),\n icon: getImage({ imageFolder: 'components/' })('qr'),\n status\n })}\n </SegmentedControlRegion>\n )}\n </Fragment>\n );\n}\n"],"names":["UPIComponent","defaultMode","onChange","payButton","showPayButton","mandate","amount","onUpdateMode","apps","segmentedControlOptions","i18n","useCoreContext","getImage","useImage","status","setStatus","useState","mode","setMode","vpaInputHandlers","setVpaInputHandlers","selectedApp","setSelectedApp","isValid","setIsValid","mandateComponent","h","UPIMandate","this","showValidation","validateInput","validateIntentApp","onSetVpaInputHandlers","useCallback","handlers","onChangeUpiMode","newMode","handleAppSelect","app","id","useEffect","data","valid","errors","Fragment","length","p","className","get","SegmentedControl","selectedValue","disabled","classNameModifiers","options","SegmentedControlRegion","A11Y","AreaId","INTENT","ariaLabelledBy","ButtonId","span","Alert","icon","UPIIntentAppList","selectedAppId","onAppSelect","label","VPA","VpaInput","onSetInputHandlers","QR","imageFolder"],"mappings":"quBAqCe,SAASA,GAAaC,YACjCA,EAAWC,SACXA,EAAQC,UACRA,EAASC,cACTA,EAAaC,QACbA,EAAOC,OACPA,EAAMC,aACNA,EAAe,OAAQC,KACvBA,EAAO,GAAEC,wBACTA,EAA0B,KAE1B,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KACVC,EAAQC,GAAaC,EAA0B,UAC/CC,EAAMC,GAAWF,EAAkBf,IACnCkB,EAAkBC,GAAuBJ,EAA2B,OACpEK,EAAaC,GAAkBN,EAAc,OAC7CO,EAASC,GAAcR,EAAkC,WAAhBf,GAC1CwB,EAAmBpB,GAAWqB,EAACC,EAAAA,CAAWtB,QAASA,EAASC,OAAQA,IAE1EsB,KAAKb,UAAaD,IACdC,EAAUD,IAGdc,KAAKC,eAAiB,KAClBV,GAAkBW,gBACL,WAATb,GACA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KC,OAAOW,IAAKT,eAAgBH,EAAKI,SAASQ,IAAKpB,UAAU,+BACtFrB,EAACkC,OAAAA,CAAKb,UAAU,wCAAwCrC,EAAKsC,IAAI,4BACjEtB,EAAC0C,EAAAA,CAASjB,SAAqB,YAAXrC,EAAsBZ,SAAUA,EAAUmE,mBAAoBrC,IACjFP,EACArB,GACGD,EAAU,CACN+D,MAAOxD,EAAKsC,IAAI,YAChBlC,YAIN,WAATG,GACGS,EAAC4B,EAAAA,CAAuBf,GAAIgB,EAAKC,OAAOc,GAAIZ,eAAgBH,EAAKI,SAASW,GAAIvB,UAAU,mCACpFrB,EAACkC,OAAAA,CAAKb,UAAU,wCAAwCrC,EAAKsC,IAAI,2BAChEvB,EACArB,GACGD,EAAU,CACN+D,MAAOxD,EAAKsC,IAAI,kBAChBc,KAAMlD,EAAS,CAAE2D,YAAa,eAAxB3D,CAAyC,MAC/CE,YAM5B"}
@@ -1,2 +1,2 @@
1
- import{TxVariants as a}from"./tx-variants.js";const n={[a.address]:"Address",[a.donation]:"Donation",[a.personal_details]:"PersonalDetails",[a.bankTransfer_IBAN]:"BankTransfer",[a.bankTransfer_BE]:"BankTransfer",[a.bankTransfer_NL]:"BankTransfer",[a.bankTransfer_PL]:"BankTransfer",[a.bankTransfer_FR]:"BankTransfer",[a.bankTransfer_CH]:"BankTransfer",[a.bankTransfer_IE]:"BankTransfer",[a.bankTransfer_GB]:"BankTransfer",[a.bankTransfer_DE]:"BankTransfer",[a.bcmc]:"Bancontact",[a.card]:"Card",[a.scheme]:"Card",[a.storedCard]:"Card",[a.customCard]:"CustomCard",[a.ach]:"Ach",[a.directdebit_GB]:"BacsDirectDebit",[a.sepadirectdebit]:"SepaDirectDebit",[a.eft_directdebit_CA]:"PreAuthorizedDebitCanada",[a.affirm]:"Affirm",[a.afterpay]:"AfterPay",[a.afterpay_default]:"AfterPay",[a.afterpay_b2b]:"AfterPayB2B",[a.atome]:"Atome",[a.facilypay_3x]:"FacilyPay3x",[a.facilypay_4x]:"FacilyPay4x",[a.facilypay_6x]:"FacilyPay6x",[a.facilypay_10x]:"FacilyPay10x",[a.facilypay_12x]:"FacilyPay12x",[a.ratepay]:"RatePay",[a.ratepay_directdebit]:"RatePayDirectDebit",[a.amazonpay]:"AmazonPay",[a.applepay]:"ApplePay",[a.cashapp]:"CashAppPay",[a.clicktopay]:"ClickToPay",[a.googlepay]:"GooglePay",[a.paypal]:"PayPal",[a.fastlane]:"Fastlane",[a.paywithgoogle]:"GooglePay",[a.boletobancario]:"Boleto",[a.boletobancario_itau]:"Boleto",[a.boletobancario_santander]:"Boleto",[a.doku]:"Doku",[a.doku_alfamart]:"Doku",[a.doku_permata_lite_atm]:"Doku",[a.doku_indomaret]:"Doku",[a.doku_atm_mandiri_va]:"Doku",[a.doku_sinarmas_va]:"Doku",[a.doku_mandiri_va]:"Doku",[a.doku_cimb_va]:"Doku",[a.doku_danamon_va]:"Doku",[a.doku_bri_va]:"Doku",[a.doku_bni_va]:"Doku",[a.doku_bca_va]:"Doku",[a.doku_wallet]:"Doku",[a.oxxo]:"Oxxo",[a.primeiropay_boleto]:"Boleto",[a.billdesk_online]:"BillDeskOnline",[a.billdesk_wallet]:"BillDeskWallet",[a.dotpay]:"Dotpay",[a.eps]:"Eps",[a.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[a.molpay_ebanking_TH]:"MolPayEBankingTH",[a.molpay_ebanking_VN]:"MolPayEBankingVN",[a.onlineBanking_CZ]:"OnlineBankingCZ",[a.onlinebanking_IN]:"OnlineBankingIN",[a.onlineBanking_PL]:"OnlineBankingPL",[a.onlineBanking_SK]:"OnlineBankingSK",[a.paybybank]:"PayByBank",[a.payu_IN_cashcard]:"PayuCashcard",[a.payu_IN_nb]:"PayuNetBanking",[a.wallet_IN]:"WalletINElement",[a.dragonpay_ebanking]:"Dragonpay",[a.dragonpay_otc_banking]:"Dragonpay",[a.dragonpay_otc_non_banking]:"Dragonpay",[a.dragonpay_otc_philippines]:"Dragonpay",[a.econtext_atm]:"Econtext",[a.econtext_online]:"Econtext",[a.econtext_seven_eleven]:"Econtext",[a.econtext_stores]:"Econtext",[a.giropay]:"Giropay",[a.multibanco]:"Multibanco",[a.redirect]:"Redirect",[a.twint]:"Twint",[a.vipps]:"Vipps",[a.trustly]:"Trustly",[a.paybybank_AIS_DD]:"PayByBankUS",[a.riverty]:"Riverty",[a.paybybank_pix]:"PayByBankPix",[a.klarna]:"Klarna",[a.klarna_account]:"Klarna",[a.klarna_paynow]:"Klarna",[a.klarna_b2b]:"Klarna",[a.bcmc_mobile]:"BcmcMobile",[a.bcmc_mobile_QR]:"BcmcMobile",[a.pix]:"Pix",[a.swish]:"Swish",[a.wechatpay]:"WeChat",[a.wechatpayQR]:"WeChat",[a.promptpay]:"PromptPay",[a.paynow]:"PayNow",[a.duitnow]:"DuitNow",[a.blik]:"Blik",[a.mbway]:"MBWay",[a.ancv]:"ANCV",[a.payto]:"PayTo",[a.upi]:"UPI",[a.upi_qr]:"UPI",[a.upi_collect]:"UPI",[a.upi_intent]:"UPI",[a.giftcard]:"Giftcard",[a.mealVoucher_FR_natixis]:"MealVoucherFR",[a.mealVoucher_FR_sodexo]:"MealVoucherFR",[a.mealVoucher_FR_groupeup]:"MealVoucherFR"};function e(a){return n[a]}export{e as default};
1
+ import{TxVariants as a}from"./tx-variants.js";const n={[a.address]:"Address",[a.donation]:"Donation",[a.personal_details]:"PersonalDetails",[a.bankTransfer_IBAN]:"BankTransfer",[a.bankTransfer_BE]:"BankTransfer",[a.bankTransfer_NL]:"BankTransfer",[a.bankTransfer_PL]:"BankTransfer",[a.bankTransfer_FR]:"BankTransfer",[a.bankTransfer_CH]:"BankTransfer",[a.bankTransfer_IE]:"BankTransfer",[a.bankTransfer_GB]:"BankTransfer",[a.bankTransfer_DE]:"BankTransfer",[a.bcmc]:"Bancontact",[a.card]:"Card",[a.scheme]:"Card",[a.storedCard]:"Card",[a.customCard]:"CustomCard",[a.ach]:"Ach",[a.directdebit_GB]:"BacsDirectDebit",[a.sepadirectdebit]:"SepaDirectDebit",[a.eft_directdebit_CA]:"PreAuthorizedDebitCanada",[a.affirm]:"Affirm",[a.afterpay]:"AfterPay",[a.afterpay_default]:"AfterPay",[a.afterpay_b2b]:"AfterPayB2B",[a.atome]:"Atome",[a.facilypay_3x]:"FacilyPay3x",[a.facilypay_4x]:"FacilyPay4x",[a.facilypay_6x]:"FacilyPay6x",[a.facilypay_10x]:"FacilyPay10x",[a.facilypay_12x]:"FacilyPay12x",[a.ratepay]:"RatePay",[a.ratepay_directdebit]:"RatePayDirectDebit",[a.amazonpay]:"AmazonPay",[a.applepay]:"ApplePay",[a.cashapp]:"CashAppPay",[a.clicktopay]:"ClickToPay",[a.googlepay]:"GooglePay",[a.paypal]:"PayPal",[a.fastlane]:"Fastlane",[a.paywithgoogle]:"GooglePay",[a.boletobancario]:"Boleto",[a.boletobancario_itau]:"Boleto",[a.boletobancario_santander]:"Boleto",[a.doku]:"Doku",[a.doku_alfamart]:"Doku",[a.doku_permata_lite_atm]:"Doku",[a.doku_indomaret]:"Doku",[a.doku_atm_mandiri_va]:"Doku",[a.doku_sinarmas_va]:"Doku",[a.doku_mandiri_va]:"Doku",[a.doku_cimb_va]:"Doku",[a.doku_danamon_va]:"Doku",[a.doku_bri_va]:"Doku",[a.doku_bni_va]:"Doku",[a.doku_bca_va]:"Doku",[a.doku_wallet]:"Doku",[a.oxxo]:"Oxxo",[a.primeiropay_boleto]:"Boleto",[a.billdesk_online]:"BillDeskOnline",[a.billdesk_wallet]:"BillDeskWallet",[a.dotpay]:"Dotpay",[a.eps]:"Eps",[a.iris]:"Iris",[a.molpay_ebanking_fpx_MY]:"MolPayEBankingMY",[a.molpay_ebanking_TH]:"MolPayEBankingTH",[a.molpay_ebanking_VN]:"MolPayEBankingVN",[a.onlineBanking_CZ]:"OnlineBankingCZ",[a.onlinebanking_IN]:"OnlineBankingIN",[a.onlineBanking_PL]:"OnlineBankingPL",[a.onlineBanking_SK]:"OnlineBankingSK",[a.paybybank]:"PayByBank",[a.payu_IN_cashcard]:"PayuCashcard",[a.payu_IN_nb]:"PayuNetBanking",[a.wallet_IN]:"WalletINElement",[a.dragonpay_ebanking]:"Dragonpay",[a.dragonpay_otc_banking]:"Dragonpay",[a.dragonpay_otc_non_banking]:"Dragonpay",[a.dragonpay_otc_philippines]:"Dragonpay",[a.econtext_atm]:"Econtext",[a.econtext_online]:"Econtext",[a.econtext_seven_eleven]:"Econtext",[a.econtext_stores]:"Econtext",[a.giropay]:"Giropay",[a.multibanco]:"Multibanco",[a.redirect]:"Redirect",[a.twint]:"Twint",[a.vipps]:"Vipps",[a.trustly]:"Trustly",[a.paybybank_AIS_DD]:"PayByBankUS",[a.riverty]:"Riverty",[a.paybybank_pix]:"PayByBankPix",[a.klarna]:"Klarna",[a.klarna_account]:"Klarna",[a.klarna_paynow]:"Klarna",[a.klarna_b2b]:"Klarna",[a.bcmc_mobile]:"BcmcMobile",[a.bcmc_mobile_QR]:"BcmcMobile",[a.pix]:"Pix",[a.swish]:"Swish",[a.wechatpay]:"WeChat",[a.wechatpayQR]:"WeChat",[a.promptpay]:"PromptPay",[a.paynow]:"PayNow",[a.duitnow]:"DuitNow",[a.blik]:"Blik",[a.mbway]:"MBWay",[a.ancv]:"ANCV",[a.payto]:"PayTo",[a.upi]:"UPI",[a.upi_qr]:"UPI",[a.upi_collect]:"UPI",[a.upi_intent]:"UPI",[a.giftcard]:"Giftcard",[a.mealVoucher_FR_natixis]:"MealVoucherFR",[a.mealVoucher_FR_sodexo]:"MealVoucherFR",[a.mealVoucher_FR_groupeup]:"MealVoucherFR"};function e(a){return n[a]}export{e as default};
2
2
  //# sourceMappingURL=components-name-map.js.map
@@ -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","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,CAAC5B,EAAW6B,cAAe,cAC3B,CAAC7B,EAAW8B,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zB,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,a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KAAM,MAClB,CAACnG,EAAWoG,OAAQ,QACpB,CAACpG,EAAWqG,WAAY,SACxB,CAACrG,EAAWsG,aAAc,SAC1B,CAACtG,EAAWuG,WAAY,YACxB,CAACvG,EAAWwG,QAAS,SACrB,CAACxG,EAAWyG,SAAU,UAItB,CAACzG,EAAW0G,MAAO,OACnB,CAAC1G,EAAW2G,OAAQ,QACpB,CAAC3G,EAAW4G,MAAO,OACnB,CAAC5G,EAAW6G,OAAQ,QACpB,CAAC7G,EAAW8G,KAAM,MAClB,CAAC9G,EAAW+G,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,GACI,MAAO,CACHC,cAAe,CACXC,KAAMC,KAAKD,KACXE,OAAQD,KAAKE,OAAOC,MAAMF,QAGtC,CAKA,WAAIG,GACA,OAAkC,IAA9BJ,KAAKX,MAAMC,QAAQE,UAGdQ,KAAKE,OAAOE,OACzB,CAOA,UAAIC,GACA,OAAIL,KAAKX,MAAMiB,4BACJN,KAAKX,MAAMC,QAAQiB,IAAIC,IAEnB,CAAEC,KADSD,EAAMC,KACEC,KAAMF,EAAMG,MAIvC,EACX,CAEmBC,iBAAAA,GACf,OAAOZ,KAAKX,MAAMC,QAAQE,OAAS,EAC/BqB,EAACC,EAAAA,CACGC,IAAKA,IACDf,KAAKgB,aAAeD,GAExBnB,MAAOI,KAAKX,MAAMC,QAClB2B,eAAgBjB,KAAKX,MAAM6B,sBACvBlB,KAAKX,SACLW,KAAKE,MACTiB,UAAWnB,KAAKX,MAAM8B,UACtBpB,KAAMC,KAAKoB,YAAY,KACvBC,SAAUrB,KAAKsB,SACfC,SAAUvB,KAAKwB,OACfC,UAAWzB,KAAKyB,UAChBC,eAAgB1B,KAAKX,MAAMsC,KAAKC,IAAI,yCACpCC,kBAAmB7B,KAAK8B,kBAG5BjB,EAACkB,EAAAA,CACGC,cAAehC,KAAKX,MAAM2C,cAC1BtB,KAAMV,KAAKX,MAAMqB,QACbV,KAAKX,MACTkC,SAAUvB,KAAKwB,OACfC,UAAWzB,KAAKyB,UAChBV,IAAKA,IACDf,KAAKgB,aAAeD,IAIpC,CAxFA,WAAAK,CAAYa,EAAiB5C,GACzB6C,MAAMD,EAAU5C,GAEhB,MAAM8C,EAAW9C,GAASW,KAAKoC,UAAUD,SAAS9C,GAElD,GAAIW,KAAKX,MAAM8B,UAAW,CACtB,MAAMkB,EAAgBC,EAAkB,CAAEC,eAAgBvC,KAAKX,MAAMkD,gBAAkBvC,KAAKoB,iBAAqBe,GAEjHnC,KAAKX,MAAMC,QAAUU,KAAKX,MAAMC,QAAQiB,IAAIiC,QACrCA,EACH/B,KAAM4B,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_CON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,EAAW9C,GAASW,KAAKoC,UAAUD,SAAS9C,GAElD,GAAIW,KAAKX,MAAM8B,UAAW,CACtB,MAAMkB,EAAgBC,EAAkB,CAAEC,eAAgBvC,KAAKX,MAAMkD,gBAAkBvC,KAAKoB,iBAAqBe,GAEjHnC,KAAKX,MAAMC,QAAUU,KAAKX,MAAMC,QAAQiB,IAAIiC,QACrCA,EACH/B,KAAM4B,EAAcG,EAAK7B,MAEjC,CACJ,cArBgC,CAC5BQ,WAAW,EACX7B,QAAS,GACT4B,mBAAoB,GACpBqB,eAAgBE,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{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,EAAgB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Y,EAnBd,SAA8BJ,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASK,YAAkE,mBAA9BL,EAASM,iBAEtF,CAe+BC,CAAqBP,GAE5C,IAAKI,EACD,MAAM,IAAII,EACN,uBACA,uCAAuChD,KAAKG,YAAY,6DAIhEH,KAAKuC,KAAOC,EACZxC,KAAKF,kBAAkBG,GAEvBD,KAAKO,eAAiBP,KAAKO,eAAe0C,KAAKjD,KACnD,EAhBAyC,EAVW5C,EAUMqD,eAAe"}
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';\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,K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,CAAA,EAENX,KAAKmC,UAAUN,MAAM7B,KAAKkC,MACrC,CAKA,OAAAC,GAQI,OANAI,EAAIvC,KAAKkC,MAAO,WAAYlC,KAAKO,gBAE7BP,KAAKkC,OACLP,EAAO,KAAM3B,KAAKkC,OAGflC,IACX,CAMA,MAAAwC,GACIxC,KAAKmC,UAEDnC,KAAKyC,MACLzC,KAAKyC,KAAKD,OAAOxC,KAEzB,CA7JA,WAAAG,CAAYuC,EAAiBzC,GAX7B0C,EAAA3C,KAAgB4C,MAAM,GAAG5C,KAAKG,YAAY,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{createElement as e,Fragment as r}from"../../../external/preact/dist/preact.js";import{useRef as a,useMemo as t,useEffect as s}from"../../../external/preact/hooks/dist/hooks.js";import l from"../FormFields/Fieldset/Fieldset.js";import i from"../FormFields/Field/Field.js";import o from"./ReadOnlyPersonalDetails.js";import{personalDetailsValidationRules as m}from"./validate.js";import{useCoreContext as n}from"../../../core/Context/CoreProvider.js";import{checkDateInputSupport as d}from"../FormFields/InputDate/utils.js";import{getFormattedData as p}from"./utils.js";import u from"../../../utils/useForm/useForm.js";import f from"../FormFields/InputText.js";import h from"../FormFields/InputDate/InputDate.js";import c from"../FormFields/InputEmail.js";import N from"../FormFields/InputTelephone.js";import{getErrorMessage as b}from"../../../utils/getErrorMessage.js";const g=["firstName","lastName","dateOfBirth","shopperEmail","telephoneNumber"];function F(g){const{label:F="",namePrefix:M,placeholders:B,requiredFields:j,visibility:O}=g,{i18n:E}=n(),v=a({});Object.keys(v.current).length||g.setComponentRef?.(v.current);const I=t(d,[]),{handleChangeFor:C,triggerValidation:q,data:x,valid:D,errors:k,isValid:y}=u({schema:j,rules:{...m,...g.validationRules},defaultData:g.data});v.current.showValidation=()=>{q()};const R=e=>r=>{const{name:a}=r.target,t=a.split(`${M}.`).pop();C(t,e)(r)},P=e=>`${M?`${M}.`:""}${e}`;return s(()=>{const e=p(x);g.onChange({data:e,valid:D,errors:k,isValid:y})},[x,D,k,y]),"hidden"===O?null:"readOnly"===O?e(o,{...g,data:x}):e(r,null,e(l,{classNameModifiers:["personalDetails"],label:F},j.includes("firstName")&&e(i,{label:E.get("firstName"),classNameModifiers:["col-50","firstName"],errorMessage:b(E,k.firstName,E.get("firstName")),name:"firstName",i18n:E},e(f,{name:P("firstName"),value:x.firstName,classNameModifiers:["firstName"],onInput:R("input"),onBlur:R("blur"),placeholder:B.firstName,spellCheck:!1,required:!0})),j.includes("lastName")&&e(i,{label:E.get("lastName"),classNameModifiers:["col-50","lastName"],errorMessage:b(E,k.lastName,E.get("lastName")),name:"lastName",i18n:E},e(f,{name:P("lastName"),value:x.lastName,classNameModifiers:["lastName"],onInput:R("input"),onBlur:R("blur"),placeholder:B.lastName,spellCheck:!1,required:!0})),j.includes("dateOfBirth")&&e(i,{label:E.get("dateOfBirth"),classNameModifiers:["col-50","dateOfBirth"],errorMessage:b(E,k.dateOfBirth,E.get("dateOfBirth")),helper:I?null:E.get("dateOfBirth.format"),name:"dateOfBirth",i18n:E},e(h,{name:P("dateOfBirth"),value:x.dateOfBirth,classNameModifiers:["dateOfBirth"],onInput:R("input"),onBlur:R("blur"),placeholder:B.dateOfBirth,required:!0})),j.includes("shopperEmail")&&e(i,{label:E.get("shopperEmail"),classNameModifiers:["shopperEmail"],errorMessage:b(E,k.shopperEmail,E.get("shopperEmail")),dir:"ltr",name:"emailAddress",i18n:E},e(c,{name:P("shopperEmail"),value:x.shopperEmail,classNameModifiers:["shopperEmail"],onInput:R("input"),onBlur:R("blur"),placeholder:B.shopperEmail,required:!0})),j.includes("telephoneNumber")&&e(i,{label:E.get("telephoneNumber"),classNameModifiers:["telephoneNumber"],errorMessage:b(E,k.telephoneNumber,E.get("telephoneNumber")),dir:"ltr",name:"telephoneNumber",i18n:E},e(N,{name:P("telephoneNumber"),value:x.telephoneNumber,classNameModifiers:["telephoneNumber"],onInput:R("input"),onBlur:R("blur"),placeholder:B.telephoneNumber,required:!0}))))}F.defaultProps={data:{},onChange:()=>{},placeholders:{},requiredFields:g,validationRules:m,visibility:"editable"};export{g as PERSONAL_DETAILS_SCHEMA,F as default};
1
+ import{createElement as e}from"../../../external/preact/dist/preact.js";import{useMemo as r,useRef as a,useEffect as t}from"../../../external/preact/hooks/dist/hooks.js";import s from"../FormFields/Fieldset/Fieldset.js";import l from"../FormFields/Field/Field.js";import i from"./ReadOnlyPersonalDetails.js";import{personalDetailsValidationRules as o}from"./validate.js";import{useCoreContext as m}from"../../../core/Context/CoreProvider.js";import{checkDateInputSupport as n}from"../FormFields/InputDate/utils.js";import{getFormattedData as d}from"./utils.js";import p from"../../../utils/useForm/useForm.js";import u from"../FormFields/InputText.js";import f from"../FormFields/InputDate/InputDate.js";import h from"../FormFields/InputEmail.js";import N from"../FormFields/InputTelephone.js";import{getErrorMessage as c}from"../../../utils/getErrorMessage.js";const b=["firstName","lastName","dateOfBirth","shopperEmail","telephoneNumber"];function g(b){const{label:g="",namePrefix:F,placeholders:M,requiredFields:B,visibility:j}=b,{i18n:E}=m(),O=r(n,[]),{handleChangeFor:v,triggerValidation:I,data:C,valid:q,errors:x,isValid:D}=p({schema:B,rules:{...o,...b.validationRules},defaultData:b.data}),R=a({showValidation:()=>{I()}});t(()=>{b.setComponentRef(R.current)},[b.setComponentRef]);const k=e=>r=>{const{name:a}=r.target,t=a.split(`${F}.`).pop();v(t,e)(r)},y=e=>`${F?`${F}.`:""}${e}`;return t(()=>{const e=d(C);b.onChange({data:e,valid:q,errors:x,isValid:D})},[C,q,x,D]),"hidden"===j?null:"readOnly"===j?e(i,{...b,data:C}):e(s,{classNameModifiers:["personalDetails"],label:g},B.includes("firstName")&&e(l,{label:E.get("firstName"),classNameModifiers:["col-50","firstName"],errorMessage:c(E,x.firstName,E.get("firstName")),name:"firstName",i18n:E},e(u,{name:y("firstName"),value:C.firstName,classNameModifiers:["firstName"],onInput:k("input"),onBlur:k("blur"),placeholder:M.firstName,spellCheck:!1,required:!0})),B.includes("lastName")&&e(l,{label:E.get("lastName"),classNameModifiers:["col-50","lastName"],errorMessage:c(E,x.lastName,E.get("lastName")),name:"lastName",i18n:E},e(u,{name:y("lastName"),value:C.lastName,classNameModifiers:["lastName"],onInput:k("input"),onBlur:k("blur"),placeholder:M.lastName,spellCheck:!1,required:!0})),B.includes("dateOfBirth")&&e(l,{label:E.get("dateOfBirth"),classNameModifiers:["col-50","dateOfBirth"],errorMessage:c(E,x.dateOfBirth,E.get("dateOfBirth")),helper:O?null:E.get("dateOfBirth.format"),name:"dateOfBirth",i18n:E},e(f,{name:y("dateOfBirth"),value:C.dateOfBirth,classNameModifiers:["dateOfBirth"],onInput:k("input"),onBlur:k("blur"),placeholder:M.dateOfBirth,required:!0})),B.includes("shopperEmail")&&e(l,{label:E.get("shopperEmail"),classNameModifiers:["shopperEmail"],errorMessage:c(E,x.shopperEmail,E.get("shopperEmail")),dir:"ltr",name:"emailAddress",i18n:E},e(h,{name:y("shopperEmail"),value:C.shopperEmail,classNameModifiers:["shopperEmail"],onInput:k("input"),onBlur:k("blur"),placeholder:M.shopperEmail,required:!0})),B.includes("telephoneNumber")&&e(l,{label:E.get("telephoneNumber"),classNameModifiers:["telephoneNumber"],errorMessage:c(E,x.telephoneNumber,E.get("telephoneNumber")),dir:"ltr",name:"telephoneNumber",i18n:E},e(N,{name:y("telephoneNumber"),value:C.telephoneNumber,classNameModifiers:["telephoneNumber"],onInput:k("input"),onBlur:k("blur"),placeholder:M.telephoneNumber,required:!0})))}g.defaultProps={data:{},onChange:()=>{},placeholders:{},requiredFields:b,validationRules:o,visibility:"editable"};export{b as PERSONAL_DETAILS_SCHEMA,g as default};
2
2
  //# sourceMappingURL=PersonalDetails.js.map