rebill-web-components-sdk 1.8.3-beta.3 → 1.8.3-beta.5
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.
- package/dist/cjs/apm-checkout_16.cjs.entry.js +2 -2
- package/dist/cjs/apm-checkout_16.cjs.entry.js.map +1 -1
- package/dist/cjs/card-identification.card-iframe.card-skeleton.rebill-input-combo.rebill-installments.entry.cjs.js.map +1 -1
- package/dist/cjs/card-identification_5.cjs.entry.js +1 -1
- package/dist/cjs/card-identification_5.cjs.entry.js.map +1 -1
- package/dist/cjs/card-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/card-skeleton.cjs.entry.js.map +1 -1
- package/dist/cjs/card-skeleton.entry.cjs.js.map +1 -1
- package/dist/cjs/collapsible-card.cjs.entry.js +1 -1
- package/dist/cjs/collapsible-card.cjs.entry.js.map +1 -1
- package/dist/cjs/collapsible-card.entry.cjs.js.map +1 -1
- package/dist/cjs/{organization-logo-BZqb4lkj.js → organization-logo-D4gP9Bg_.js} +3 -3
- package/dist/cjs/{organization-logo-BZqb4lkj.js.map → organization-logo-D4gP9Bg_.js.map} +1 -1
- package/dist/cjs/{organization-logo-Dnfazz63.js → organization-logo-x4KEuA72.js} +3 -3
- package/dist/cjs/{organization-logo-Dnfazz63.js.map → organization-logo-x4KEuA72.js.map} +1 -1
- package/dist/cjs/organization-logo.cjs.entry.js +1 -1
- package/dist/cjs/organization-logo_4.cjs.entry.js +1 -1
- package/dist/cjs/otp-component.cjs.entry.js +5 -5
- package/dist/cjs/otp-component.cjs.entry.js.map +1 -1
- package/dist/cjs/otp-component.entry.cjs.js.map +1 -1
- package/dist/cjs/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.cjs.js.map +1 -1
- package/dist/cjs/otp-component_7.cjs.entry.js +10 -10
- package/dist/cjs/otp-component_7.cjs.entry.js.map +1 -1
- package/dist/cjs/rebill-address.cjs.entry.js +1 -1
- package/dist/cjs/rebill-address.cjs.entry.js.map +1 -1
- package/dist/cjs/rebill-address.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-checkout.cjs.entry.js +1 -1
- package/dist/cjs/rebill-icon.rebill-typography.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-icon_2.cjs.entry.js +1 -1
- package/dist/cjs/rebill-icon_2.cjs.entry.js.map +1 -1
- package/dist/cjs/rebill-input-text.cjs.entry.js +2 -2
- package/dist/cjs/rebill-input-text.cjs.entry.js.map +1 -1
- package/dist/cjs/rebill-input-text.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-mode-sandbox-mobile.cjs.entry.js +4 -4
- package/dist/cjs/rebill-mode-sandbox-mobile.cjs.entry.js.map +1 -1
- package/dist/cjs/rebill-mode-sandbox-mobile.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-renewal.cjs.entry.js +1 -1
- package/dist/cjs/rebill-renewal.cjs.entry.js.map +1 -1
- package/dist/cjs/rebill-renewal.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-typography.cjs.entry.js +1 -1
- package/dist/cjs/rebill-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/rebill-typography.entry.cjs.js.map +1 -1
- package/dist/cjs/renewal-success-page.cjs.entry.js +1 -1
- package/dist/cjs/renewal-success-page.cjs.entry.js.map +1 -1
- package/dist/cjs/renewal-success-page.entry.cjs.js.map +1 -1
- package/dist/cjs/renewal-success-page.renewal-summary.entry.cjs.js.map +1 -1
- package/dist/cjs/renewal-success-page_2.cjs.entry.js +1 -1
- package/dist/cjs/renewal-success-page_2.cjs.entry.js.map +1 -1
- package/dist/cjs/root-component.cjs.entry.js +1 -1
- package/dist/cjs/root-component.cjs.entry.js.map +1 -1
- package/dist/cjs/root-component.entry.cjs.js.map +1 -1
- package/dist/cjs/selectable-card.cjs.entry.js +1 -1
- package/dist/cjs/selectable-card.cjs.entry.js.map +1 -1
- package/dist/cjs/selectable-card.entry.cjs.js.map +1 -1
- package/dist/cjs/success-page.cjs.entry.js +1 -1
- package/dist/cjs/success-page.cjs.entry.js.map +1 -1
- package/dist/cjs/success-page.entry.cjs.js.map +1 -1
- package/dist/collection/components/checkout/address/address.css +0 -6
- package/dist/collection/components/checkout/card-success-page/success-page.css +0 -6
- package/dist/collection/components/checkout/otp/otp.css +16 -16
- package/dist/collection/components/checkout/otp/otp.js +4 -4
- package/dist/collection/components/checkout/otp/otp.js.map +1 -1
- package/dist/collection/components/checkout/payment-method-selector/card-fields/iframe/skeleton/cardSkeleton.css +0 -6
- package/dist/collection/components/renewal/rebill-renewal.css +0 -6
- package/dist/collection/components/renewal/renewal-success-page/renewal-success-page.css +0 -6
- package/dist/collection/components/root-component/root-component.css +0 -6
- package/dist/collection/components/shared/collapsible-card/collapsible-card.css +0 -6
- package/dist/collection/components/shared/inputs/input-text/input-text.css +4 -4
- package/dist/collection/components/shared/inputs/input-text/input-text.js +1 -1
- package/dist/collection/components/shared/inputs/input-text/input-text.js.map +1 -1
- package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.css +21 -16
- package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.js +3 -3
- package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.js.map +1 -1
- package/dist/collection/components/shared/organization-logo/organization-logo.css +0 -6
- package/dist/collection/components/shared/selectable-card/selectable-card.css +0 -6
- package/dist/collection/components/shared/typography/typography.css +0 -6
- package/dist/components/CardSkeleton.js +1 -1
- package/dist/components/CardSkeleton.js.map +1 -1
- package/dist/components/address.js +1 -1
- package/dist/components/address.js.map +1 -1
- package/dist/components/collapsible-card2.js +1 -1
- package/dist/components/collapsible-card2.js.map +1 -1
- package/dist/components/input-text.js +2 -2
- package/dist/components/input-text.js.map +1 -1
- package/dist/components/mode-sandbox-mobile.js +4 -4
- package/dist/components/mode-sandbox-mobile.js.map +1 -1
- package/dist/components/organization-logo2.js +1 -1
- package/dist/components/organization-logo2.js.map +1 -1
- package/dist/components/otp.js +5 -5
- package/dist/components/otp.js.map +1 -1
- package/dist/components/{p-F4jLIfkG.js → p-0BTfY4S5.js} +7 -7
- package/dist/components/{p-F4jLIfkG.js.map → p-0BTfY4S5.js.map} +1 -1
- package/dist/components/{p-BhZLfMCq.js → p-8Z6_-yhm.js} +4 -4
- package/dist/components/p-8Z6_-yhm.js.map +1 -0
- package/dist/components/{p-N7wfNpl2.js → p-B9aIvZlq.js} +4 -4
- package/dist/components/{p-N7wfNpl2.js.map → p-B9aIvZlq.js.map} +1 -1
- package/dist/components/{p-C1Jzk6t7.js → p-B9aJ7_rc.js} +9 -9
- package/dist/components/{p-C1Jzk6t7.js.map → p-B9aJ7_rc.js.map} +1 -1
- package/dist/components/{p-C-BFyHag.js → p-BId02g8-.js} +9 -9
- package/dist/components/p-BId02g8-.js.map +1 -0
- package/dist/components/{p-BGIg233G.js → p-BOrcSA8T.js} +3 -3
- package/dist/components/{p-BGIg233G.js.map → p-BOrcSA8T.js.map} +1 -1
- package/dist/components/{p-D_sGE3-j.js → p-BRjIL3fw.js} +3 -3
- package/dist/components/{p-D_sGE3-j.js.map → p-BRjIL3fw.js.map} +1 -1
- package/dist/components/{p-FoWuzUYH.js → p-BVfV2NVA.js} +6 -6
- package/dist/components/{p-FoWuzUYH.js.map → p-BVfV2NVA.js.map} +1 -1
- package/dist/components/{p-mGnGyYiQ.js → p-BVtSIdnS.js} +4 -4
- package/dist/components/{p-mGnGyYiQ.js.map → p-BVtSIdnS.js.map} +1 -1
- package/dist/components/{p-D6JNNodL.js → p-BZ90sz6G.js} +3 -3
- package/dist/components/{p-D6JNNodL.js.map → p-BZ90sz6G.js.map} +1 -1
- package/dist/components/{p-JVLfbdAy.js → p-C0a5bxXF.js} +3 -3
- package/dist/components/{p-JVLfbdAy.js.map → p-C0a5bxXF.js.map} +1 -1
- package/dist/components/{p-D_PXcKNq.js → p-C8bwQKOB.js} +3 -3
- package/dist/components/{p-D_PXcKNq.js.map → p-C8bwQKOB.js.map} +1 -1
- package/dist/components/{p-CKHlNMVF.js → p-CjKgYUL9.js} +3 -3
- package/dist/components/{p-CKHlNMVF.js.map → p-CjKgYUL9.js.map} +1 -1
- package/dist/components/{p-Mn8ErAAb.js → p-CwHrjjgl.js} +4 -4
- package/dist/components/{p-Mn8ErAAb.js.map → p-CwHrjjgl.js.map} +1 -1
- package/dist/components/{p-ojGSd7eA.js → p-D8FW7I0M.js} +3 -3
- package/dist/components/{p-ojGSd7eA.js.map → p-D8FW7I0M.js.map} +1 -1
- package/dist/components/{p-CdLmSaw6.js → p-DAJuJoZn.js} +4 -4
- package/dist/components/{p-CdLmSaw6.js.map → p-DAJuJoZn.js.map} +1 -1
- package/dist/components/{p-BaN8grjD.js → p-DNxp10y2.js} +5 -5
- package/dist/components/{p-BaN8grjD.js.map → p-DNxp10y2.js.map} +1 -1
- package/dist/components/{p-BshrHj7X.js → p-DQi9Jit7.js} +5 -5
- package/dist/components/{p-BshrHj7X.js.map → p-DQi9Jit7.js.map} +1 -1
- package/dist/components/{p-fLN8M37t.js → p-DbLIZ0gI.js} +3 -3
- package/dist/components/{p-fLN8M37t.js.map → p-DbLIZ0gI.js.map} +1 -1
- package/dist/components/{p-C81ESSvH.js → p-DlgrkLu0.js} +4 -4
- package/dist/components/{p-C81ESSvH.js.map → p-DlgrkLu0.js.map} +1 -1
- package/dist/components/{p-CGfY7lYE.js → p-DmG9jqf9.js} +3 -3
- package/dist/components/{p-CGfY7lYE.js.map → p-DmG9jqf9.js.map} +1 -1
- package/dist/components/{p-B2TDQClH.js → p-Dua4qdwP.js} +3 -3
- package/dist/components/{p-B2TDQClH.js.map → p-Dua4qdwP.js.map} +1 -1
- package/dist/components/{p-CgtGqqWz.js → p-Dy2kgG1_.js} +3 -3
- package/dist/components/{p-CgtGqqWz.js.map → p-Dy2kgG1_.js.map} +1 -1
- package/dist/components/{p-e4my43Fj.js → p-J04T9w3B.js} +4 -4
- package/dist/components/{p-e4my43Fj.js.map → p-J04T9w3B.js.map} +1 -1
- package/dist/components/{p-BMR1f9Ny.js → p-J4ePC1Gr.js} +7 -7
- package/dist/components/{p-BMR1f9Ny.js.map → p-J4ePC1Gr.js.map} +1 -1
- package/dist/components/{p-6crhm8xF.js → p-KnZ28rwQ.js} +7 -7
- package/dist/components/{p-6crhm8xF.js.map → p-KnZ28rwQ.js.map} +1 -1
- package/dist/components/p-ReaNe705.js +85 -0
- package/dist/components/p-ReaNe705.js.map +1 -0
- package/dist/components/{p--nzbbHU3.js → p-bhvS6Qdq.js} +3 -3
- package/dist/components/{p--nzbbHU3.js.map → p-bhvS6Qdq.js.map} +1 -1
- package/dist/components/{p-BKW3nMqk.js → p-d3WZKgsB.js} +5 -5
- package/dist/components/{p-BKW3nMqk.js.map → p-d3WZKgsB.js.map} +1 -1
- package/dist/components/{p-De6XbCCz.js → p-gCWikaoG.js} +7 -7
- package/dist/components/{p-De6XbCCz.js.map → p-gCWikaoG.js.map} +1 -1
- package/dist/components/{p-8OkGYgSm.js → p-nhr8VHHV.js} +4 -4
- package/dist/components/{p-8OkGYgSm.js.map → p-nhr8VHHV.js.map} +1 -1
- package/dist/components/{p-DWoIf2g_.js → p-rT7t0c3J.js} +9 -9
- package/dist/components/{p-DWoIf2g_.js.map → p-rT7t0c3J.js.map} +1 -1
- package/dist/components/{p-C1R9RQEK.js → p-u7D3-_Vp.js} +4 -4
- package/dist/components/{p-C1R9RQEK.js.map → p-u7D3-_Vp.js.map} +1 -1
- package/dist/components/rebill-renewal.js +1 -1
- package/dist/components/rebill-renewal.js.map +1 -1
- package/dist/components/renewal-success-page2.js +1 -1
- package/dist/components/renewal-success-page2.js.map +1 -1
- package/dist/components/root-component.js +1 -1
- package/dist/components/root-component.js.map +1 -1
- package/dist/components/selectable-card2.js +1 -1
- package/dist/components/selectable-card2.js.map +1 -1
- package/dist/components/success-page2.js +1 -1
- package/dist/components/success-page2.js.map +1 -1
- package/dist/components/typography.js +1 -1
- package/dist/components/typography.js.map +1 -1
- package/dist/esm/apm-checkout_16.entry.js +2 -2
- package/dist/esm/apm-checkout_16.entry.js.map +1 -1
- package/dist/esm/card-identification.card-iframe.card-skeleton.rebill-input-combo.rebill-installments.entry.js.map +1 -1
- package/dist/esm/card-identification_5.entry.js +1 -1
- package/dist/esm/card-identification_5.entry.js.map +1 -1
- package/dist/esm/card-skeleton.entry.js +1 -1
- package/dist/esm/card-skeleton.entry.js.map +1 -1
- package/dist/esm/collapsible-card.entry.js +1 -1
- package/dist/esm/collapsible-card.entry.js.map +1 -1
- package/dist/esm/{organization-logo-DTXw5Lu4.js → organization-logo-BPE5_Qxz.js} +3 -3
- package/dist/esm/{organization-logo-6pnwjRAd.js.map → organization-logo-BPE5_Qxz.js.map} +1 -1
- package/dist/{rebill-web-components-sdk/organization-logo-6pnwjRAd.js → esm/organization-logo-FuaJxXfD.js} +3 -3
- package/dist/{rebill-web-components-sdk/organization-logo-6pnwjRAd.js.map → esm/organization-logo-FuaJxXfD.js.map} +1 -1
- package/dist/esm/organization-logo.entry.js +1 -1
- package/dist/esm/organization-logo_4.entry.js +1 -1
- package/dist/esm/otp-component.entry.js +5 -5
- package/dist/esm/otp-component.entry.js.map +1 -1
- package/dist/esm/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.js.map +1 -1
- package/dist/esm/otp-component_7.entry.js +10 -10
- package/dist/esm/otp-component_7.entry.js.map +1 -1
- package/dist/esm/rebill-address.entry.js +1 -1
- package/dist/esm/rebill-address.entry.js.map +1 -1
- package/dist/esm/rebill-checkout.entry.js +1 -1
- package/dist/esm/rebill-icon.rebill-typography.entry.js.map +1 -1
- package/dist/esm/rebill-icon_2.entry.js +1 -1
- package/dist/esm/rebill-icon_2.entry.js.map +1 -1
- package/dist/esm/rebill-input-text.entry.js +2 -2
- package/dist/esm/rebill-input-text.entry.js.map +1 -1
- package/dist/esm/rebill-mode-sandbox-mobile.entry.js +4 -4
- package/dist/esm/rebill-mode-sandbox-mobile.entry.js.map +1 -1
- package/dist/esm/rebill-renewal.entry.js +1 -1
- package/dist/esm/rebill-renewal.entry.js.map +1 -1
- package/dist/esm/rebill-typography.entry.js +1 -1
- package/dist/esm/rebill-typography.entry.js.map +1 -1
- package/dist/esm/renewal-success-page.entry.js +1 -1
- package/dist/esm/renewal-success-page.entry.js.map +1 -1
- package/dist/esm/renewal-success-page.renewal-summary.entry.js.map +1 -1
- package/dist/esm/renewal-success-page_2.entry.js +1 -1
- package/dist/esm/renewal-success-page_2.entry.js.map +1 -1
- package/dist/esm/root-component.entry.js +1 -1
- package/dist/esm/root-component.entry.js.map +1 -1
- package/dist/esm/selectable-card.entry.js +1 -1
- package/dist/esm/selectable-card.entry.js.map +1 -1
- package/dist/esm/success-page.entry.js +1 -1
- package/dist/esm/success-page.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/card-identification.card-iframe.card-skeleton.rebill-input-combo.rebill-installments.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/card-skeleton.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/card-skeleton.entry.js +1 -1
- package/dist/rebill-web-components-sdk/card-skeleton.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/collapsible-card.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/collapsible-card.entry.js +1 -1
- package/dist/rebill-web-components-sdk/collapsible-card.entry.js.map +1 -1
- package/dist/{esm/organization-logo-6pnwjRAd.js → rebill-web-components-sdk/organization-logo-FuaJxXfD.js} +3 -3
- package/dist/{esm/organization-logo-DTXw5Lu4.js.map → rebill-web-components-sdk/organization-logo-FuaJxXfD.js.map} +1 -1
- package/dist/rebill-web-components-sdk/organization-logo.entry.js +1 -1
- package/dist/rebill-web-components-sdk/otp-component.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/otp-component.entry.js +5 -5
- package/dist/rebill-web-components-sdk/otp-component.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/p-07de170b.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-d189dea8.entry.js.map → p-07de170b.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-2be8b27e.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-a3f63a73.entry.js.map → p-2be8b27e.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-2f00f173.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-e16cc3b0.entry.js.map → p-2f00f173.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-3b7a11c7.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-f02133d8.entry.js.map → p-3b7a11c7.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-3c6aaa56.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-174a9543.entry.js.map → p-3c6aaa56.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-5485215c.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-62fc3d11.entry.js.map → p-5485215c.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/{p-68a78ab6.entry.js → p-932d5912.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-3fca32f8.entry.js → p-a09e3090.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-a780e6e8.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-a780e6e8.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/p-bf4f1bcc.entry.js +2 -0
- package/dist/rebill-web-components-sdk/{p-b8591c64.entry.js.map → p-bf4f1bcc.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/p-cecc2fbe.entry.js +2 -0
- package/dist/rebill-web-components-sdk/p-cecc2fbe.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/{p-DTsMkxC1.js → p-tu-WZjQJ.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-DTsMkxC1.js.map → p-tu-WZjQJ.js.map} +1 -1
- package/dist/rebill-web-components-sdk/rebill-address.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-address.entry.js +1 -1
- package/dist/rebill-web-components-sdk/rebill-address.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-checkout.entry.js +1 -1
- package/dist/rebill-web-components-sdk/rebill-icon.rebill-typography.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-input-text.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-input-text.entry.js +2 -2
- package/dist/rebill-web-components-sdk/rebill-input-text.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-mode-sandbox-mobile.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-mode-sandbox-mobile.entry.js +4 -4
- package/dist/rebill-web-components-sdk/rebill-mode-sandbox-mobile.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-renewal.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-renewal.entry.js +1 -1
- package/dist/rebill-web-components-sdk/rebill-renewal.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-typography.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-typography.entry.js +1 -1
- package/dist/rebill-web-components-sdk/rebill-typography.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/renewal-success-page.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/renewal-success-page.entry.js +1 -1
- package/dist/rebill-web-components-sdk/renewal-success-page.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/renewal-success-page.renewal-summary.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/root-component.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/root-component.entry.js +1 -1
- package/dist/rebill-web-components-sdk/root-component.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/selectable-card.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/selectable-card.entry.js +1 -1
- package/dist/rebill-web-components-sdk/selectable-card.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/success-page.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/success-page.entry.js +1 -1
- package/dist/rebill-web-components-sdk/success-page.entry.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/p-BhZLfMCq.js.map +0 -1
- package/dist/components/p-Bl3lkRJY.js +0 -85
- package/dist/components/p-Bl3lkRJY.js.map +0 -1
- package/dist/components/p-C-BFyHag.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-174a9543.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-62fc3d11.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-8edd1215.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-8edd1215.entry.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-a3f63a73.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-b8591c64.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-d189dea8.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-daa7cbb2.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-daa7cbb2.entry.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-e16cc3b0.entry.js +0 -2
- package/dist/rebill-web-components-sdk/p-f02133d8.entry.js +0 -2
- /package/dist/rebill-web-components-sdk/{p-68a78ab6.entry.js.map → p-932d5912.entry.js.map} +0 -0
- /package/dist/rebill-web-components-sdk/{p-3fca32f8.entry.js.map → p-a09e3090.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-DyaDabZ4.js";import{c as s}from"./p-BFhvUZPU.js";import{a as n,C as a}from"./p-C6wUNEUc.js";import{P as o,G as r,S as l}from"./p-A1UFEvOV.js";import"./p-uIXMJDkk.js";import"./p-2SuTTFdS.js";import"./p-DTsMkxC1.js";import{s as c,d as h,I as d,S as u,e as m,P as p,o as f,b as y}from"./p-dYKOc01W.js";import{m as b,g,b as w,i as k,P as x,a as v}from"./p-BqMM9Bcr.js";import{B as C,g as I,i as j}from"./p-Do_vNuMa.js";import"./p-BFTU3MAI.js";import"./p-B2LDUv1-.js";import"./p-uZj1dMLQ.js";import"./p-DA598vBj.js";import"./p-CTQZ1Sio.js";import"./p-BYrqevT1.js";import"./p-Bf6g23G6.js";import"./p-lWh04UqG.js";import"./p-C0jcntnC.js";import"./p-bcHxwlBu.js";import"./rebill-button.entry.esm.js";import"./p-B2q13jSm.js";const S={checkoutSummary:true,submitButton:true,billingAddress:true,customerInformation:true,discountCode:true,logo:true,footer:true,sandboxMode:true};var P;(function(t){t["BAMBOO"]="bamboo_payment";t["FISERV"]="fiserv";t["KUSHKI"]="kushki";t["PAYWAY"]="payway";t["DOCK"]="dock";t["KLAP"]="klap";t["MOVII"]="movii";t["STRIPE"]="stripe";t["DECIDIR"]="decidir"})(P||(P={}));const M=async(t,i,e)=>{const s=await n.checkout.getRequiredFields({currency:t,method:i},e);return{fields:b(s.data),original:s.data}};const N=async()=>{const t=c.data?.itemInformation?.paymentMethods;const i=t.map((async t=>{try{const i=o.mapToAPMPaymentMethod(t,c.data?.pricing?.country);const e=await M(c.data.pricing.currency,i,c.data.organization.id);return{paymentMethod:t,...e}}catch(i){console.error(`Error getting required fields for ${t}:`,i);return{paymentMethod:t,fields:[],original:[]}}}));const e=await Promise.all(i);const s={};e.forEach((t=>{s[t.paymentMethod]={fields:t.fields,original:t.original}}));return s};const D=(t,i)=>{const e=i[t];if(e){return e}else{return{fields:[],original:[]}}};const R=t=>typeof t==="string"?JSON.parse(t):t;const T=t=>R(t);const q=()=>"190.188.127.250";const A=async({publicKey:t,instantProduct:i,instantPlan:e})=>{const s=R(i?i:e);const a=await n.sessions.createSDKInstantSessionRequest(s,g(),q(),t);const o={...a.data,...a.data.plan&&{plan:{...a.data.plan,description:s.description||[]}},...a.data.product&&{product:{...a.data.product,description:s.description||[]}}};const r=o;return r};const z=async({publicKey:t,productId:i,planId:e})=>{const s=await n.sessions.createSDKItemSessionRequest({...i?{productId:i}:{},...e?{planId:e}:{},idempotencyKey:g(),deviceId:"123123123",clientIP:q(),publicKey:t});const a=s.data;return a};const E=async({publicKey:t,checkoutLandingSession:i,instantProduct:e,instantPlan:s,productId:n,planId:a})=>{if(i){const t=await T(i);return{session:t,type:h.CHECKOUT_LANDING}}if(e||s){const i=await A({publicKey:t,instantProduct:e,instantPlan:s});return{session:i,type:h.INSTANT}}if(n||a){const i=await z({publicKey:t,productId:n,planId:a});return{session:i,type:h.SDK_ITEM}}};const B="@media (max-width: 1024px){.rebill-checkout{width:100%;flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section-checkout .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}.rebill-checkout.full-width-layout .left-section{width:100%}.rebill-checkout.full-width-layout .left-section-container{max-width:none;width:100%}}@media (min-width: 1025px){.rebill-checkout{width:100%;min-height:600px;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section-checkout{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.rebill-checkout.full-width-layout .left-section{width:100%;justify-content:stretch}.rebill-checkout.full-width-layout .left-section-container{max-width:none;min-width:auto;width:100%;margin:2.5rem 2rem 1.5rem 2rem}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const F=class{constructor(e){t(this,e);this.error=i(this,"error");this.success=i(this,"success");this.successRedirect=i(this,"successRedirect");this.paymentMethodSelected=i(this,"paymentMethodSelected")}productId;planId;publicKey;instantProduct;instantPlan;display;customerInformation;oneClickCheckout=true;css;language;async handleLanguageChange(t,i){if(t&&t!==i){try{await d.changeLanguage(t);u.changeLanguage(t);console.log(`[RebillCheckout] Language changed from ${i} to ${t}`)}catch(t){console.error("[RebillCheckout] Failed to change language:",t)}}}error;success;successRedirect;checkoutLandingSession;externalPayment;rejectedPaymentCard=false;rejectedPaymentAPM=false;countries=[];currentPaymentMethod;checkoutResponse=null;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;isAPMSubmitting=false;isAPMSuccess=false;storedCheckoutResults=new Map;errorMessage=null;currentApmPaymentMethod=null;breakpoint=C.DESKTOP;showRefreshModal=false;cardError={showCardInvalid:false,type:null};initialData={};allRequiredFields={};currentRequiredFields=[];customerExists=false;showOtp=false;otpVerified=false;responseCheckoutCard=null;cardMode=null;formElement;emailDebounceTimeout=null;injectedStyleElement=null;get displayConfig(){if(!this.display){return S}if(typeof this.display==="string"){try{const t=JSON.parse(this.display);return{...S,...t}}catch(t){console.warn("Invalid display configuration string, using defaults:",t);return S}}return{...S,...this.display}}get parsedCustomerInformation(){if(!this.customerInformation){return null}if(typeof this.customerInformation==="string"){try{return JSON.parse(this.customerInformation)}catch(t){console.warn("Invalid customerInformation configuration string, ignoring:",t);return null}}return this.customerInformation}getCombinedUserData(t={}){const i=c.data.userInformation;const e=this.parsedCustomerInformation;return{email:t.email||e?.email||i.email,fullName:t.fullName||e?.fullName||i.fullName,countryCodePhoneNumber:t.countryCodePhoneNumber||e?.phoneNumber?.countryCode||e?.countryCode||i.countryCode,phoneNumber:t.phoneNumber||e?.phoneNumber?.number||i.phoneNumber,documentType:t.documentType||e?.documentType||i.documentType,documentNumber:t.documentNumber||e?.documentNumber||i.documentNumber,"billing-country":t["billing-country"]||e?.address?.billingAddress?.country||i.address?.billingAddress?.country,"billing-state":t["billing-state"]||e?.address?.billingAddress?.state||i.address?.billingAddress?.state,"billing-address":t["billing-address"]||e?.address?.billingAddress?.address||i.address?.billingAddress?.address,"billing-city":t["billing-city"]||e?.address?.billingAddress?.city||i.address?.billingAddress?.city,"billing-zip":t["billing-zip"]||e?.address?.billingAddress?.zip||i.address?.billingAddress?.zip}}injectCustomCSS(){if(!this.css){return}this.cleanupInjectedCSS();const t=`rebill-checkout-css-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;if(this.css.startsWith("http://")||this.css.startsWith("https://")||this.css.startsWith("//")){const i=document.createElement("link");i.rel="stylesheet";i.href=this.css;i.id=t;i.setAttribute("data-rebill-injected","true");document.head.appendChild(i);this.injectedStyleElement=i}else{const i=document.createElement("style");i.id=t;i.setAttribute("data-rebill-injected","true");i.textContent=this.css;document.head.appendChild(i);this.injectedStyleElement=i}}cleanupInjectedCSS(){if(this.injectedStyleElement){try{this.injectedStyleElement.remove()}catch(t){console.warn("Error removing injected CSS:",t)}this.injectedStyleElement=null}}timeToRedirectAPM=5e3;resizeHandler=()=>{const t=I(window.innerWidth);if(t!==this.breakpoint){this.breakpoint=t}};disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler);if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout);this.emailDebounceTimeout=null}this.cleanupInjectedCSS()}async componentWillLoad(){try{this.resizeHandler();window.addEventListener("resize",this.resizeHandler);this.injectCustomCSS();if(this.language){await d.changeLanguage(this.language)}else{m()}const{session:t,type:i}=await E({publicKey:this.publicKey,checkoutLandingSession:this.checkoutLandingSession,instantProduct:this.instantProduct,instantPlan:this.instantPlan,productId:this.productId,planId:this.planId});u.initializeSession({session:t,type:i,payment:typeof this.externalPayment==="string"?JSON.parse(this.externalPayment):this.externalPayment});if(c.sessionRefreshed){this.showRefreshModal=true}r.loadGoogleMapsScript();const e=await n.data.getCountries();this.countries=e.data;this.initialData=this.getInitialData();this.allRequiredFields=await N();if(c.data?.itemInformation?.paymentMethods?.length>0){if(c.data.paymentStatus===w.REJECTED||c.data.paymentStatus===w.APPROVED&&c.data?.itemInformation?.paymentMethods?.includes(p.BANK_TRANSFER)){const t=c.data?.itemInformation?.paymentMethods?.find((t=>t===p.BANK_TRANSFER));if(t){this.changePaymentMethod(t);u.setPaymentMethodSelected(t)}}else{this.changePaymentMethod(c.data?.itemInformation?.paymentMethods[0])}}if(this.oneClickCheckout){n.customers.exists({email:c.data?.prefilledData?.email},this.publicKey).then((t=>{this.customerExists=t.data.exists}))}this.cardMode=c.cardMode;f("cardMode",(()=>{this.cardMode=c.cardMode}))}catch(t){console.error("Error initializing checkout:",t)}}componentWillUpdate(){this.injectCustomCSS()}async changePaymentMethod(t){if(t!==this.currentPaymentMethod&&c.data?.itemInformation?.paymentMethods?.includes(t)){if(this.checkoutResponse){this.checkoutResponse=null;u.clearCheckoutResponse()}this.currentPaymentMethod=t;u.setPaymentMethodSelected(t);if(t!==p.CARD){this.cardMode="input";u.setCardMode("input")}this.isSubmitting=false;this.currentApmPaymentMethod=o.mapToAPMPaymentMethod(t,c.data?.pricing?.country);if(t!==p.CASH&&t!==p.BANK_TRANSFER){this.checkoutResponse=null;u.clearCheckoutResponse()}else{this.checkoutResponse=null;u.clearCheckoutResponse()}this.paymentMethodSelected.emit(t);try{this.currentRequiredFields=D(t,this.allRequiredFields).fields;const i=await n.sessions.updateCurrentSessionPaymentMethod(c.data.sessionId,{paymentMethodName:o.mapToAPMPaymentMethod(t,c.data.pricing.country),paymentMethodType:t,currency:c.data.pricing.currency});u.setProviderKey(i.providerKey);if(i.providerKey===P.DECIDIR||c.data.providerKey===P.DECIDIR){const t=crypto.randomUUID();const i=await n.fingerPrint.getFingerPrint(t);c.deviceId=t;const e=i.result.script;const s=document.createElement("script");s.innerHTML=e;document.body.appendChild(s)}}catch(t){console.error("Failed to update payment method or get required fields:",t)}}}get currentPaymentError(){if(this.currentPaymentMethod===p.CARD){return this.rejectedPaymentCard}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){return this.rejectedPaymentAPM}return false}paymentMethodSelected;async handlePaymentMethodSelected(t){t.stopPropagation();const i=t.detail;this.changePaymentMethod(i);if(this.formElement){this.formElement.resetValidation()}}async handleSubmit(t){if(this.isSubmitting){return}this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false;if(this.currentPaymentMethod===p.CARD){this.handleSubmitCard(t)}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){this.handleSubmitAPM(t)}}async handleSubmitCard(t){const i=t.detail;const e=this.getCombinedUserData(i);if(!c.data.cardTokenId&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"card_error"};return}if(!c.data.cardInformation&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"tokenization_error"};return}this.cardError={showCardInvalid:false,type:null};const s={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},installments:Number(i.installments||c.data.cardInformation?.installments?.selectedInstallment?.installment),...c.data.cardTokenId&&{cardTokenId:c.data.cardTokenId,...c.data?.itemInformation?.type!==y.PLAN&&{saveCard:c.saveCard}},...c.data.cardId&&{cardId:c.data.cardId},...(!this.otpVerified||this.cardMode==="input")&&{customer:{firstName:e.fullName?.split(" ")[0],lastName:e.fullName?.split(" ").slice(1).join(" "),email:e.email,phone:{countryCode:e.countryCodePhoneNumber,number:e.phoneNumber}}},billingDetails:{address:{lineOne:e["billing-address"],city:e["billing-city"],state:e["billing-state"],country:e["billing-country"],zipCode:e["billing-zip"]},identification:{type:e.documentType,value:e.documentNumber}},customAttributes:{...c.deviceId&&{deviceId:c.deviceId}},...c.metadata&&{paymentMetadata:c.metadata}};const o=g();this.isSubmitting=true;this.isCardSubmitting=true;try{const t=await n.checkout.createCardCheckoutRequest(c.data.sessionId,o,s,c.data.accessToken||undefined);u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;if(t.data.result?.status.toUpperCase()===a.APPROVED){this.isCardSuccess=true;u.setPaymentStatus(w.APPROVED);this.success.emit(t);c.data.cardInformation.lastFour=t.data.result?.cardLastFour}else{this.error.emit(t.data);u.setCheckoutResponse(t.data);this.rejectedPaymentCard=true;this.errorMessage={message:t.data.error?.error?.message,type:t.data.error?.error?.type}}}catch(t){this.error.emit(t);u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;this.rejectedPaymentCard=true;this.errorMessage={message:t.data?.error?.message,type:t.data?.error?.type}}finally{this.isSubmitting=false;this.isCardSubmitting=false}}async handleSubmitAPM(t){if(this.currentPaymentMethod!==p.CASH&&this.currentPaymentMethod!==p.BANK_TRANSFER){return}this.isSubmitting=true;const i=t.detail;const e=this.getCombinedUserData(i);try{const t={address:{country:e["billing-country"]||"",state:e["billing-state"]||"",city:e["billing-city"]||"",zipCode:e["billing-zip"]||"",lineOne:e["billing-address"]||""},identification:{type:e.documentType,value:e.documentNumber}};const s=this.currentApmPaymentMethod||o.mapToAPMPaymentMethod(this.currentPaymentMethod,c.data?.pricing?.country);const a={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},method:s,billingDetails:t,redirect:{approved:window.location.origin+"/payment/success",rejected:window.location.origin+"/payment/failure"},paymentMetadata:c.metadata,customAttributes:{bank:i.bankId||c.data?.bankId?.code}};{a.customer={firstName:e.fullName?.split(" ")[0]||"",lastName:e.fullName?.split(" ").slice(1).join(" ")||"",email:e.email,phone:{countryCode:e.countryCodePhoneNumber||"",number:e.phoneNumber||""}}}const r=g();const l=await n.checkout.createAPMCheckoutRequest(c.data.sessionId,r,a);this.isSubmitting=false;this.checkoutResponse=l.data;this.storedCheckoutResults.set(this.currentPaymentMethod,l.data);if(l.data?.date){c.data.paymentDate=l.data.date;c.createdAt=l.data.date}if(l.data?.traceId){c.data.paymentReference=l.data.traceId}}catch(t){this.isSubmitting=false;this.checkoutResponse=t.data;this.errorMessage={alertTitle:"paymentErrors.APMError",message:w.APM_MENSAJE_ERROR,type:t.data?.error?.type,paymentMethod:this.currentPaymentMethod};this.rejectedPaymentAPM=true}}async submit(){if(this.formElement&&typeof this.formElement.submit==="function"){this.formElement.submit()}else{await this.handleSubmit({detail:{}})}}handlePaymentStatusChange=t=>{if(t.isCompleted){if(t.status===l.APPROVED){u.setPaymentStatus(w.APPROVED)}else if(t.status===l.REJECTED){u.setPaymentStatus(w.REJECTED);this.errorMessage={message:w.REJECTED,type:this.checkoutResponse?.error?.type}}}};async handleInputChange(t){if(t?.detail?.id==="email"&&this.oneClickCheckout){if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout)}if(!t.detail.value||t.detail.value.trim()===""){this.customerExists=false;u.clearCustomerIdAndToken();return}this.emailDebounceTimeout=setTimeout((async()=>{try{const t=await n.customers.exists({email:c.data.userInformation.email},this.publicKey);this.customerExists=t.data.exists}catch(t){this.customerExists=false}}),500)}}validationSchema={email:s().when([],{is:()=>!this.otpVerified,then:t=>t.email("validation.emailInvalid").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"validation.emailInvalid").required("validation.emailRequired"),otherwise:t=>t.notRequired()}),fullName:s().when([],{is:()=>!this.otpVerified,then:t=>t.required("validation.fullNameRequired").matches(/^[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}\s+[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}$/,"validation.fullNameInvalid"),otherwise:t=>t.notRequired()}),isValidPhoneNumber:s().when([],{is:()=>k("phoneNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.equals(["true"],"validation.phoneRequired"),otherwise:t=>t.notRequired()}),"billing-country":s().when([],{is:()=>k("billing-country",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.countryRequired"),otherwise:t=>t.notRequired()}),"billing-state":s().when([],{is:()=>k("billing-state",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.stateRequired"),otherwise:t=>t.notRequired()}),"billing-address":s().when([],{is:()=>k("billing-address",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.addressRequired"),otherwise:t=>t.notRequired()}),"billing-city":s().when([],{is:()=>k("billing-city",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.cityRequired"),otherwise:t=>t.notRequired()}),"billing-zip":s().when([],{is:()=>k("billing-zip",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.zipRequired"),otherwise:t=>t.notRequired()}),bankId:s().when([],{is:()=>k("bankId",this.currentRequiredFields),then:t=>t.required("validation.bankRequired"),otherwise:t=>t.notRequired()}),installments:s().when([],{is:()=>this.currentPaymentMethod===p.CARD&&c.data.cardInformation.installments.isAvailableInstallments&&c.data.cardInformation?.installments?.installments.length>0&&c.data.itemInformation.type!==y.PLAN,then:t=>t.required("validation.installmentsRequired"),otherwise:t=>t.notRequired()}),documentType:s().when([],{is:()=>k("documentType",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentTypeRequired"),otherwise:t=>t.notRequired()}),documentNumber:s().when([],{is:()=>k("documentNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentNumberRequired").min(7,"validation.documentInvalid"),otherwise:t=>t.notRequired()})};getInitialData=()=>({email:c.data.userInformation.email||"",fullName:c.data.userInformation.fullName||"",phoneNumber:c.data.userInformation.phoneNumber?.number||"",countryCodePhoneNumber:c.data.userInformation.countryCode||"",documentType:"",documentNumber:"","billing-country":c.data.userInformation.address?.billingAddress?.country||"","billing-state":c.data.userInformation?.address?.billingAddress?.state||"","billing-address":c.data.userInformation?.address?.billingAddress?.address||"","billing-city":c.data.userInformation?.address?.billingAddress?.city||"","billing-zip":c.data.userInformation?.address?.billingAddress?.zip||"",bankId:c.data.bankId?.code||"",card:"",installments:c.data.cardInformation?.installments?.selectedInstallment?.installment?.toString()||""});hasPrefilledAddress=()=>{const t=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return t.some((t=>{const i=this.initialData[t];return i&&i.trim()!==""}))};get isQrCodeVisible(){return!!this.checkoutResponse?.result?.data?.qrCode}isPaymentApproved=()=>{if(c.data.paymentStatus===w.APPROVED){return true}return false};handleRebillAccountClick(t){this.showOtp=t.detail}handleReturnForm(t){this.showOtp=t.detail;u.clearCustomerIdAndToken()}handleSignOut(){this.showOtp=false;this.otpVerified=false;if(!c?.data?.prefilledData?.email){this.customerExists=false}u.clearCustomerIdAndToken();u.clearUserInformation();this.cardError={showCardInvalid:false,type:null};this.errorMessage=null;this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false}handleCodeVerified(){this.otpVerified=true;this.showOtp=false;this.rejectedPaymentCard=false;this.errorMessage=null;this.cardError={showCardInvalid:false,type:null};if(this.formElement){this.formElement.resetValidation()}}isPaymentRejected(){return c.data.paymentStatus===w.REJECTED&&this.currentPaymentMethod===p.BANK_TRANSFER}render(){const t=this.countries.map((t=>({label:t.country,value:t.isoCountryCode})));const i=(t={})=>e("rebill-summary",{key:"37d78e3270c9a49730507417a31306ee916dd3ed",totalAmount:c.data.pricing.total,currency:c.data.pricing.currency,itemTitle:c._session?.getTitle(),itemDescription:c._session?.getDescription(),itemAmount:c.data.pricing.subtotal,subtotal:c.data.pricing.subtotal,allowCoupon:c._session?.getAllowCoupon(this.displayConfig),currentBreakpoint:this.breakpoint,planFrequency:c._session?.getPlanFrequency(),planFrequencyCount:c._session?.getPlanFrequencyCount(),discountType:c.data.discount.discountType,discountedPercentage:c.data.discount.discountedPercentage,discountDuration:c.data.discount.discountDuration,discountAmount:c.data.discount.discountAmount,...t});return c.isInitialized&&e(e.Fragment,null,this.showRefreshModal&&e("rebill-modal-overlay",{key:"15f804b942d17c2b29d7d08fc9b807e0583355ce"}),e("rebill-processing-payment",{key:"2a4e483c4b108639823440b575b11323ad908ecb",style:{display:this.isCardSubmitting?"block":"none"}}),this.isPaymentApproved()&&c.isInitialized?e("success-page",{typePaymentMethod:c.data.paymentMethodSelected,paymentMethodName:o.mapToAPMPaymentMethod(c.data.paymentMethodSelected||c.data.payment?.paymentMethodType,c.data?.pricing?.country),country:c.data?.pricing?.country,bank:c.data.payment?.paymentMethodMetadata?.bank||c.data.payment?.paymentMethodMetadata?.bank,cardLastFour:this.responseCheckoutCard?.result?.cardLastFour||c.data.cardInformation?.lastFour,paymentDate:c.data.paymentDate||this.responseCheckoutCard?.date||c.data.payment?.createdAt||this.checkoutResponse?.result?.data?.createdAt,referenceNumber:c.data.paymentReference||c.data.payment?.traceId||this.responseCheckoutCard?.traceId,onSuccessRedirect:t=>{this.successRedirect.emit(t.detail)},trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,debitDay:c.data?.itemInformation?.debitDay,planAmount:c.data?.pricing?.planAmount}):e(e.Fragment,null,this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===h.CHECKOUT_LANDING&&j(this.breakpoint,C.DESKTOP)&&e("div",{class:"mode-sandbox-mobile-container",style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"}},e("rebill-mode-sandbox-mobile",null)),e("rebill-checkout-form",{ref:t=>this.formElement=t,style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:t=>this.handleSubmit(t),renderForm:({submit:s,formData:n,errors:a})=>{const o=!this.isCardSuccess&&this.checkoutResponse?.result&&(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER);return e("div",{class:`rebill-checkout ${!this.displayConfig.checkoutSummary?"full-width-layout":""}`},e("div",{class:"left-section"},e("div",{class:"left-section-container"},this.displayConfig.logo&&e("organization-logo",{organization:c.data.organization}),e("div",{class:"otp-container",style:{display:this.showOtp?"block":"none"}},e("otp-component",null)),e("div",{style:{display:this.showOtp?"none":"block"}},e("div",{class:"checkout-form-section"},this.displayConfig.checkoutSummary&&e("div",{class:"summary-mobile-tablet",style:{display:j(this.breakpoint,C.DESKTOP)?"block":"none"}},i({displayedComponents:["totalAmount","discount","timelineFreeTrial","timelineDebitDay","itemDetails"]})),!this.otpVerified&&this.displayConfig.customerInformation&&e("user-information",{customerExists:this.customerExists,disabled:this.isSubmitting,errors:{email:a.email,fullName:a.fullName}}),this.otpVerified&&this.displayConfig.customerInformation&&e("user-information-static",{variant:"otp",userInfo:{customerName:c.data.userInformation.fullName?.split(" ")[0],customerEmail:c.data.userInformation.email}}),e("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},e("payment-method-selector",{enabledPaymentMethods:c.data.itemInformation.paymentMethods,defaultSelected:this.currentPaymentMethod,disabled:this.isSubmitting,errorComponent:{showErrorComponent:this.currentPaymentError||this.isPaymentRejected(),alertTitle:this.errorMessage?.alertTitle,message:x.getErrorMessage(this.errorMessage)},country:c.data?.pricing?.country,installmentsError:a.installments,showDocument:(!this.otpVerified||this.otpVerified&&this.cardMode==="input")&&!o&&!this.isQrCodeVisible&&(k("documentNumber",this.currentRequiredFields)||k("documentType",this.currentRequiredFields)),documentTypeError:a.documentType,documentNumberError:a.documentNumber,cardError:this.cardError,customCSS:this.css}),!o&&(()=>{const t=k("bankId",this.currentRequiredFields);return t})()&&e("div",{class:"animated-component fade-in"},e("rebill-bank-selector",{banks:v("bank",this.allRequiredFields[this.currentPaymentMethod].original)||[],defaultSelectedBankId:n.bankId||"",error:a?.bankId}))),!o&&(!this.otpVerified||this.cardMode==="input")&&e(e.Fragment,null,this.displayConfig.billingAddress&&(k("billing-country",this.currentRequiredFields)||k("billing-state",this.currentRequiredFields)||k("billing-address",this.currentRequiredFields)||k("billing-city",this.currentRequiredFields)||k("billing-zip",this.currentRequiredFields))&&e("div",{class:"animated-component slide-in"},e("rebill-address",{disabled:this.isSubmitting,countryOptions:t,billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":a["billing-country"],"billing-state":a["billing-state"],"billing-address":a["billing-address"],"billing-city":a["billing-city"],"billing-zip":a["billing-zip"]}})),this.displayConfig.customerInformation&&k("phoneNumber",this.currentRequiredFields)&&e("div",{class:"animated-component fade-in"},e("user-information-phone",{disabled:this.isSubmitting,error:a?.phoneNumber,countryCode:c.data.userInformation?.countryCode||c.data.country}))),o&&e("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===p.CASH?this.checkoutResponse?.result?.data?.referenceId:undefined,qrCodeData:this.currentPaymentMethod===p.BANK_TRANSFER?this.checkoutResponse?.result?.data?.qrCode:undefined,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,providerName:c.data.providerKey,expirationDate:(()=>{const t=new Date;t.setDate(t.getDate()+30);return t.toISOString()})(),onPaymentStatusChange:t=>this.handlePaymentStatusChange(t.detail),country:c.data?.pricing?.country,redirectUrl:this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,bearerToken:this.checkoutResponse?.result?.data?.bearerToken}),this.displayConfig.checkoutSummary&&e("div",{class:"summary-price-details",style:{display:j(this.breakpoint,C.DESKTOP)?"block":"none"}},i({displayedComponents:["priceDetails"]})),this.displayConfig.submitButton&&!this.isQrCodeVisible&&e("div",{class:"payment-button-container"},e("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,onSubmit:()=>{s()},redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,isDisabled:c.data.fetchingInstallments,country:c.data?.pricing?.country}),e("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:d.translate("otp.secureMessage")}))),this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===h.CHECKOUT_LANDING&&!j(this.breakpoint,C.DESKTOP)&&e("rebill-mode-sandbox",null)),this.displayConfig.footer&&e("rebill-footer",{style:{marginTop:j(this.breakpoint,C.DESKTOP)?"16px":"auto"}}))),this.displayConfig.checkoutSummary&&e("div",{class:"right-section-checkout"},e("div",{class:"checkout-summary-section"},e("div",{class:"summary-desktop",style:{display:!j(this.breakpoint,C.DESKTOP)?"block":"none"}},i()))))}})))}static get watchers(){return{language:["handleLanguageChange"]}}};F.style=B;export{F as rebill_checkout};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-DyaDabZ4.js";import{c as s}from"./p-BFhvUZPU.js";import{a as n,C as a}from"./p-C6wUNEUc.js";import{P as o,G as r,S as l}from"./p-A1UFEvOV.js";import"./p-uIXMJDkk.js";import"./p-2SuTTFdS.js";import"./p-tu-WZjQJ.js";import{s as c,d as h,I as d,S as u,e as m,P as p,o as f,b as y}from"./p-dYKOc01W.js";import{m as b,g,b as w,i as k,P as x,a as v}from"./p-BqMM9Bcr.js";import{B as C,g as I,i as j}from"./p-Do_vNuMa.js";import"./p-BFTU3MAI.js";import"./p-B2LDUv1-.js";import"./p-uZj1dMLQ.js";import"./p-DA598vBj.js";import"./p-CTQZ1Sio.js";import"./p-BYrqevT1.js";import"./p-Bf6g23G6.js";import"./p-lWh04UqG.js";import"./p-C0jcntnC.js";import"./p-bcHxwlBu.js";import"./rebill-button.entry.esm.js";import"./p-B2q13jSm.js";const S={checkoutSummary:true,submitButton:true,billingAddress:true,customerInformation:true,discountCode:true,logo:true,footer:true,sandboxMode:true};var P;(function(t){t["BAMBOO"]="bamboo_payment";t["FISERV"]="fiserv";t["KUSHKI"]="kushki";t["PAYWAY"]="payway";t["DOCK"]="dock";t["KLAP"]="klap";t["MOVII"]="movii";t["STRIPE"]="stripe";t["DECIDIR"]="decidir"})(P||(P={}));const M=async(t,i,e)=>{const s=await n.checkout.getRequiredFields({currency:t,method:i},e);return{fields:b(s.data),original:s.data}};const N=async()=>{const t=c.data?.itemInformation?.paymentMethods;const i=t.map((async t=>{try{const i=o.mapToAPMPaymentMethod(t,c.data?.pricing?.country);const e=await M(c.data.pricing.currency,i,c.data.organization.id);return{paymentMethod:t,...e}}catch(i){console.error(`Error getting required fields for ${t}:`,i);return{paymentMethod:t,fields:[],original:[]}}}));const e=await Promise.all(i);const s={};e.forEach((t=>{s[t.paymentMethod]={fields:t.fields,original:t.original}}));return s};const D=(t,i)=>{const e=i[t];if(e){return e}else{return{fields:[],original:[]}}};const R=t=>typeof t==="string"?JSON.parse(t):t;const T=t=>R(t);const q=()=>"190.188.127.250";const A=async({publicKey:t,instantProduct:i,instantPlan:e})=>{const s=R(i?i:e);const a=await n.sessions.createSDKInstantSessionRequest(s,g(),q(),t);const o={...a.data,...a.data.plan&&{plan:{...a.data.plan,description:s.description||[]}},...a.data.product&&{product:{...a.data.product,description:s.description||[]}}};const r=o;return r};const z=async({publicKey:t,productId:i,planId:e})=>{const s=await n.sessions.createSDKItemSessionRequest({...i?{productId:i}:{},...e?{planId:e}:{},idempotencyKey:g(),deviceId:"123123123",clientIP:q(),publicKey:t});const a=s.data;return a};const E=async({publicKey:t,checkoutLandingSession:i,instantProduct:e,instantPlan:s,productId:n,planId:a})=>{if(i){const t=await T(i);return{session:t,type:h.CHECKOUT_LANDING}}if(e||s){const i=await A({publicKey:t,instantProduct:e,instantPlan:s});return{session:i,type:h.INSTANT}}if(n||a){const i=await z({publicKey:t,productId:n,planId:a});return{session:i,type:h.SDK_ITEM}}};const B="@media (max-width: 1024px){.rebill-checkout{width:100%;flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section-checkout .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}.rebill-checkout.full-width-layout .left-section{width:100%}.rebill-checkout.full-width-layout .left-section-container{max-width:none;width:100%}}@media (min-width: 1025px){.rebill-checkout{width:100%;min-height:600px;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section-checkout{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.rebill-checkout.full-width-layout .left-section{width:100%;justify-content:stretch}.rebill-checkout.full-width-layout .left-section-container{max-width:none;min-width:auto;width:100%;margin:2.5rem 2rem 1.5rem 2rem}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const F=class{constructor(e){t(this,e);this.error=i(this,"error");this.success=i(this,"success");this.successRedirect=i(this,"successRedirect");this.paymentMethodSelected=i(this,"paymentMethodSelected")}productId;planId;publicKey;instantProduct;instantPlan;display;customerInformation;oneClickCheckout=true;css;language;async handleLanguageChange(t,i){if(t&&t!==i){try{await d.changeLanguage(t);u.changeLanguage(t);console.log(`[RebillCheckout] Language changed from ${i} to ${t}`)}catch(t){console.error("[RebillCheckout] Failed to change language:",t)}}}error;success;successRedirect;checkoutLandingSession;externalPayment;rejectedPaymentCard=false;rejectedPaymentAPM=false;countries=[];currentPaymentMethod;checkoutResponse=null;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;isAPMSubmitting=false;isAPMSuccess=false;storedCheckoutResults=new Map;errorMessage=null;currentApmPaymentMethod=null;breakpoint=C.DESKTOP;showRefreshModal=false;cardError={showCardInvalid:false,type:null};initialData={};allRequiredFields={};currentRequiredFields=[];customerExists=false;showOtp=false;otpVerified=false;responseCheckoutCard=null;cardMode=null;formElement;emailDebounceTimeout=null;injectedStyleElement=null;get displayConfig(){if(!this.display){return S}if(typeof this.display==="string"){try{const t=JSON.parse(this.display);return{...S,...t}}catch(t){console.warn("Invalid display configuration string, using defaults:",t);return S}}return{...S,...this.display}}get parsedCustomerInformation(){if(!this.customerInformation){return null}if(typeof this.customerInformation==="string"){try{return JSON.parse(this.customerInformation)}catch(t){console.warn("Invalid customerInformation configuration string, ignoring:",t);return null}}return this.customerInformation}getCombinedUserData(t={}){const i=c.data.userInformation;const e=this.parsedCustomerInformation;return{email:t.email||e?.email||i.email,fullName:t.fullName||e?.fullName||i.fullName,countryCodePhoneNumber:t.countryCodePhoneNumber||e?.phoneNumber?.countryCode||e?.countryCode||i.countryCode,phoneNumber:t.phoneNumber||e?.phoneNumber?.number||i.phoneNumber,documentType:t.documentType||e?.documentType||i.documentType,documentNumber:t.documentNumber||e?.documentNumber||i.documentNumber,"billing-country":t["billing-country"]||e?.address?.billingAddress?.country||i.address?.billingAddress?.country,"billing-state":t["billing-state"]||e?.address?.billingAddress?.state||i.address?.billingAddress?.state,"billing-address":t["billing-address"]||e?.address?.billingAddress?.address||i.address?.billingAddress?.address,"billing-city":t["billing-city"]||e?.address?.billingAddress?.city||i.address?.billingAddress?.city,"billing-zip":t["billing-zip"]||e?.address?.billingAddress?.zip||i.address?.billingAddress?.zip}}injectCustomCSS(){if(!this.css){return}this.cleanupInjectedCSS();const t=`rebill-checkout-css-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;if(this.css.startsWith("http://")||this.css.startsWith("https://")||this.css.startsWith("//")){const i=document.createElement("link");i.rel="stylesheet";i.href=this.css;i.id=t;i.setAttribute("data-rebill-injected","true");document.head.appendChild(i);this.injectedStyleElement=i}else{const i=document.createElement("style");i.id=t;i.setAttribute("data-rebill-injected","true");i.textContent=this.css;document.head.appendChild(i);this.injectedStyleElement=i}}cleanupInjectedCSS(){if(this.injectedStyleElement){try{this.injectedStyleElement.remove()}catch(t){console.warn("Error removing injected CSS:",t)}this.injectedStyleElement=null}}timeToRedirectAPM=5e3;resizeHandler=()=>{const t=I(window.innerWidth);if(t!==this.breakpoint){this.breakpoint=t}};disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler);if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout);this.emailDebounceTimeout=null}this.cleanupInjectedCSS()}async componentWillLoad(){try{this.resizeHandler();window.addEventListener("resize",this.resizeHandler);this.injectCustomCSS();if(this.language){await d.changeLanguage(this.language)}else{m()}const{session:t,type:i}=await E({publicKey:this.publicKey,checkoutLandingSession:this.checkoutLandingSession,instantProduct:this.instantProduct,instantPlan:this.instantPlan,productId:this.productId,planId:this.planId});u.initializeSession({session:t,type:i,payment:typeof this.externalPayment==="string"?JSON.parse(this.externalPayment):this.externalPayment});if(c.sessionRefreshed){this.showRefreshModal=true}r.loadGoogleMapsScript();const e=await n.data.getCountries();this.countries=e.data;this.initialData=this.getInitialData();this.allRequiredFields=await N();if(c.data?.itemInformation?.paymentMethods?.length>0){if(c.data.paymentStatus===w.REJECTED||c.data.paymentStatus===w.APPROVED&&c.data?.itemInformation?.paymentMethods?.includes(p.BANK_TRANSFER)){const t=c.data?.itemInformation?.paymentMethods?.find((t=>t===p.BANK_TRANSFER));if(t){this.changePaymentMethod(t);u.setPaymentMethodSelected(t)}}else{this.changePaymentMethod(c.data?.itemInformation?.paymentMethods[0])}}if(this.oneClickCheckout){n.customers.exists({email:c.data?.prefilledData?.email},this.publicKey).then((t=>{this.customerExists=t.data.exists}))}this.cardMode=c.cardMode;f("cardMode",(()=>{this.cardMode=c.cardMode}))}catch(t){console.error("Error initializing checkout:",t)}}componentWillUpdate(){this.injectCustomCSS()}async changePaymentMethod(t){if(t!==this.currentPaymentMethod&&c.data?.itemInformation?.paymentMethods?.includes(t)){if(this.checkoutResponse){this.checkoutResponse=null;u.clearCheckoutResponse()}this.currentPaymentMethod=t;u.setPaymentMethodSelected(t);if(t!==p.CARD){this.cardMode="input";u.setCardMode("input")}this.isSubmitting=false;this.currentApmPaymentMethod=o.mapToAPMPaymentMethod(t,c.data?.pricing?.country);if(t!==p.CASH&&t!==p.BANK_TRANSFER){this.checkoutResponse=null;u.clearCheckoutResponse()}else{this.checkoutResponse=null;u.clearCheckoutResponse()}this.paymentMethodSelected.emit(t);try{this.currentRequiredFields=D(t,this.allRequiredFields).fields;const i=await n.sessions.updateCurrentSessionPaymentMethod(c.data.sessionId,{paymentMethodName:o.mapToAPMPaymentMethod(t,c.data.pricing.country),paymentMethodType:t,currency:c.data.pricing.currency});u.setProviderKey(i.providerKey);if(i.providerKey===P.DECIDIR||c.data.providerKey===P.DECIDIR){const t=crypto.randomUUID();const i=await n.fingerPrint.getFingerPrint(t);c.deviceId=t;const e=i.result.script;const s=document.createElement("script");s.innerHTML=e;document.body.appendChild(s)}}catch(t){console.error("Failed to update payment method or get required fields:",t)}}}get currentPaymentError(){if(this.currentPaymentMethod===p.CARD){return this.rejectedPaymentCard}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){return this.rejectedPaymentAPM}return false}paymentMethodSelected;async handlePaymentMethodSelected(t){t.stopPropagation();const i=t.detail;this.changePaymentMethod(i);if(this.formElement){this.formElement.resetValidation()}}async handleSubmit(t){if(this.isSubmitting){return}this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false;if(this.currentPaymentMethod===p.CARD){this.handleSubmitCard(t)}else if(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER){this.handleSubmitAPM(t)}}async handleSubmitCard(t){const i=t.detail;const e=this.getCombinedUserData(i);if(!c.data.cardTokenId&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"card_error"};return}if(!c.data.cardInformation&&!c.data.cardId){this.cardError={showCardInvalid:true,type:"tokenization_error"};return}this.cardError={showCardInvalid:false,type:null};const s={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},installments:Number(i.installments||c.data.cardInformation?.installments?.selectedInstallment?.installment),...c.data.cardTokenId&&{cardTokenId:c.data.cardTokenId,...c.data?.itemInformation?.type!==y.PLAN&&{saveCard:c.saveCard}},...c.data.cardId&&{cardId:c.data.cardId},...(!this.otpVerified||this.cardMode==="input")&&{customer:{firstName:e.fullName?.split(" ")[0],lastName:e.fullName?.split(" ").slice(1).join(" "),email:e.email,phone:{countryCode:e.countryCodePhoneNumber,number:e.phoneNumber}}},billingDetails:{address:{lineOne:e["billing-address"],city:e["billing-city"],state:e["billing-state"],country:e["billing-country"],zipCode:e["billing-zip"]},identification:{type:e.documentType,value:e.documentNumber}},customAttributes:{...c.deviceId&&{deviceId:c.deviceId}},...c.metadata&&{paymentMetadata:c.metadata}};const o=g();this.isSubmitting=true;this.isCardSubmitting=true;try{const t=await n.checkout.createCardCheckoutRequest(c.data.sessionId,o,s,c.data.accessToken||undefined);u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;if(t.data.result?.status.toUpperCase()===a.APPROVED){this.isCardSuccess=true;u.setPaymentStatus(w.APPROVED);this.success.emit(t);c.data.cardInformation.lastFour=t.data.result?.cardLastFour}else{this.error.emit(t.data);u.setCheckoutResponse(t.data);this.rejectedPaymentCard=true;this.errorMessage={message:t.data.error?.error?.message,type:t.data.error?.error?.type}}}catch(t){this.error.emit(t);u.setCheckoutResponse(t.data);this.responseCheckoutCard=t.data;this.rejectedPaymentCard=true;this.errorMessage={message:t.data?.error?.message,type:t.data?.error?.type}}finally{this.isSubmitting=false;this.isCardSubmitting=false}}async handleSubmitAPM(t){if(this.currentPaymentMethod!==p.CASH&&this.currentPaymentMethod!==p.BANK_TRANSFER){return}this.isSubmitting=true;const i=t.detail;const e=this.getCombinedUserData(i);try{const t={address:{country:e["billing-country"]||"",state:e["billing-state"]||"",city:e["billing-city"]||"",zipCode:e["billing-zip"]||"",lineOne:e["billing-address"]||""},identification:{type:e.documentType,value:e.documentNumber}};const s=this.currentApmPaymentMethod||o.mapToAPMPaymentMethod(this.currentPaymentMethod,c.data?.pricing?.country);const a={transaction:{quantity:1,...c.data.discount.couponCode&&{couponCode:c.data.discount.couponCode}},method:s,billingDetails:t,redirect:{approved:window.location.origin+"/payment/success",rejected:window.location.origin+"/payment/failure"},paymentMetadata:c.metadata,customAttributes:{bank:i.bankId||c.data?.bankId?.code}};{a.customer={firstName:e.fullName?.split(" ")[0]||"",lastName:e.fullName?.split(" ").slice(1).join(" ")||"",email:e.email,phone:{countryCode:e.countryCodePhoneNumber||"",number:e.phoneNumber||""}}}const r=g();const l=await n.checkout.createAPMCheckoutRequest(c.data.sessionId,r,a);this.isSubmitting=false;this.checkoutResponse=l.data;this.storedCheckoutResults.set(this.currentPaymentMethod,l.data);if(l.data?.date){c.data.paymentDate=l.data.date;c.createdAt=l.data.date}if(l.data?.traceId){c.data.paymentReference=l.data.traceId}}catch(t){this.isSubmitting=false;this.checkoutResponse=t.data;this.errorMessage={alertTitle:"paymentErrors.APMError",message:w.APM_MENSAJE_ERROR,type:t.data?.error?.type,paymentMethod:this.currentPaymentMethod};this.rejectedPaymentAPM=true}}async submit(){if(this.formElement&&typeof this.formElement.submit==="function"){this.formElement.submit()}else{await this.handleSubmit({detail:{}})}}handlePaymentStatusChange=t=>{if(t.isCompleted){if(t.status===l.APPROVED){u.setPaymentStatus(w.APPROVED)}else if(t.status===l.REJECTED){u.setPaymentStatus(w.REJECTED);this.errorMessage={message:w.REJECTED,type:this.checkoutResponse?.error?.type}}}};async handleInputChange(t){if(t?.detail?.id==="email"&&this.oneClickCheckout){if(this.emailDebounceTimeout){clearTimeout(this.emailDebounceTimeout)}if(!t.detail.value||t.detail.value.trim()===""){this.customerExists=false;u.clearCustomerIdAndToken();return}this.emailDebounceTimeout=setTimeout((async()=>{try{const t=await n.customers.exists({email:c.data.userInformation.email},this.publicKey);this.customerExists=t.data.exists}catch(t){this.customerExists=false}}),500)}}validationSchema={email:s().when([],{is:()=>!this.otpVerified,then:t=>t.email("validation.emailInvalid").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"validation.emailInvalid").required("validation.emailRequired"),otherwise:t=>t.notRequired()}),fullName:s().when([],{is:()=>!this.otpVerified,then:t=>t.required("validation.fullNameRequired").matches(/^[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}\s+[a-zA-ZÀ-ÿ\u00f1\u00d1\s]{2,}$/,"validation.fullNameInvalid"),otherwise:t=>t.notRequired()}),isValidPhoneNumber:s().when([],{is:()=>k("phoneNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.equals(["true"],"validation.phoneRequired"),otherwise:t=>t.notRequired()}),"billing-country":s().when([],{is:()=>k("billing-country",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.countryRequired"),otherwise:t=>t.notRequired()}),"billing-state":s().when([],{is:()=>k("billing-state",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.stateRequired"),otherwise:t=>t.notRequired()}),"billing-address":s().when([],{is:()=>k("billing-address",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.addressRequired"),otherwise:t=>t.notRequired()}),"billing-city":s().when([],{is:()=>k("billing-city",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.cityRequired"),otherwise:t=>t.notRequired()}),"billing-zip":s().when([],{is:()=>k("billing-zip",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.zipRequired"),otherwise:t=>t.notRequired()}),bankId:s().when([],{is:()=>k("bankId",this.currentRequiredFields),then:t=>t.required("validation.bankRequired"),otherwise:t=>t.notRequired()}),installments:s().when([],{is:()=>this.currentPaymentMethod===p.CARD&&c.data.cardInformation.installments.isAvailableInstallments&&c.data.cardInformation?.installments?.installments.length>0&&c.data.itemInformation.type!==y.PLAN,then:t=>t.required("validation.installmentsRequired"),otherwise:t=>t.notRequired()}),documentType:s().when([],{is:()=>k("documentType",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentTypeRequired"),otherwise:t=>t.notRequired()}),documentNumber:s().when([],{is:()=>k("documentNumber",this.currentRequiredFields)&&!this.otpVerified||this.otpVerified&&this.cardMode==="input",then:t=>t.required("validation.documentNumberRequired").min(7,"validation.documentInvalid"),otherwise:t=>t.notRequired()})};getInitialData=()=>({email:c.data.userInformation.email||"",fullName:c.data.userInformation.fullName||"",phoneNumber:c.data.userInformation.phoneNumber?.number||"",countryCodePhoneNumber:c.data.userInformation.countryCode||"",documentType:"",documentNumber:"","billing-country":c.data.userInformation.address?.billingAddress?.country||"","billing-state":c.data.userInformation?.address?.billingAddress?.state||"","billing-address":c.data.userInformation?.address?.billingAddress?.address||"","billing-city":c.data.userInformation?.address?.billingAddress?.city||"","billing-zip":c.data.userInformation?.address?.billingAddress?.zip||"",bankId:c.data.bankId?.code||"",card:"",installments:c.data.cardInformation?.installments?.selectedInstallment?.installment?.toString()||""});hasPrefilledAddress=()=>{const t=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return t.some((t=>{const i=this.initialData[t];return i&&i.trim()!==""}))};get isQrCodeVisible(){return!!this.checkoutResponse?.result?.data?.qrCode}isPaymentApproved=()=>{if(c.data.paymentStatus===w.APPROVED){return true}return false};handleRebillAccountClick(t){this.showOtp=t.detail}handleReturnForm(t){this.showOtp=t.detail;u.clearCustomerIdAndToken()}handleSignOut(){this.showOtp=false;this.otpVerified=false;if(!c?.data?.prefilledData?.email){this.customerExists=false}u.clearCustomerIdAndToken();u.clearUserInformation();this.cardError={showCardInvalid:false,type:null};this.errorMessage=null;this.rejectedPaymentCard=false;this.rejectedPaymentAPM=false}handleCodeVerified(){this.otpVerified=true;this.showOtp=false;this.rejectedPaymentCard=false;this.errorMessage=null;this.cardError={showCardInvalid:false,type:null};if(this.formElement){this.formElement.resetValidation()}}isPaymentRejected(){return c.data.paymentStatus===w.REJECTED&&this.currentPaymentMethod===p.BANK_TRANSFER}render(){const t=this.countries.map((t=>({label:t.country,value:t.isoCountryCode})));const i=(t={})=>e("rebill-summary",{key:"37d78e3270c9a49730507417a31306ee916dd3ed",totalAmount:c.data.pricing.total,currency:c.data.pricing.currency,itemTitle:c._session?.getTitle(),itemDescription:c._session?.getDescription(),itemAmount:c.data.pricing.subtotal,subtotal:c.data.pricing.subtotal,allowCoupon:c._session?.getAllowCoupon(this.displayConfig),currentBreakpoint:this.breakpoint,planFrequency:c._session?.getPlanFrequency(),planFrequencyCount:c._session?.getPlanFrequencyCount(),discountType:c.data.discount.discountType,discountedPercentage:c.data.discount.discountedPercentage,discountDuration:c.data.discount.discountDuration,discountAmount:c.data.discount.discountAmount,...t});return c.isInitialized&&e(e.Fragment,null,this.showRefreshModal&&e("rebill-modal-overlay",{key:"15f804b942d17c2b29d7d08fc9b807e0583355ce"}),e("rebill-processing-payment",{key:"2a4e483c4b108639823440b575b11323ad908ecb",style:{display:this.isCardSubmitting?"block":"none"}}),this.isPaymentApproved()&&c.isInitialized?e("success-page",{typePaymentMethod:c.data.paymentMethodSelected,paymentMethodName:o.mapToAPMPaymentMethod(c.data.paymentMethodSelected||c.data.payment?.paymentMethodType,c.data?.pricing?.country),country:c.data?.pricing?.country,bank:c.data.payment?.paymentMethodMetadata?.bank||c.data.payment?.paymentMethodMetadata?.bank,cardLastFour:this.responseCheckoutCard?.result?.cardLastFour||c.data.cardInformation?.lastFour,paymentDate:c.data.paymentDate||this.responseCheckoutCard?.date||c.data.payment?.createdAt||this.checkoutResponse?.result?.data?.createdAt,referenceNumber:c.data.paymentReference||c.data.payment?.traceId||this.responseCheckoutCard?.traceId,onSuccessRedirect:t=>{this.successRedirect.emit(t.detail)},trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,debitDay:c.data?.itemInformation?.debitDay,planAmount:c.data?.pricing?.planAmount}):e(e.Fragment,null,this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===h.CHECKOUT_LANDING&&j(this.breakpoint,C.DESKTOP)&&e("div",{class:"mode-sandbox-mobile-container",style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"}},e("rebill-mode-sandbox-mobile",null)),e("rebill-checkout-form",{ref:t=>this.formElement=t,style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:t=>this.handleSubmit(t),renderForm:({submit:s,formData:n,errors:a})=>{const o=!this.isCardSuccess&&this.checkoutResponse?.result&&(this.currentPaymentMethod===p.CASH||this.currentPaymentMethod===p.BANK_TRANSFER);return e("div",{class:`rebill-checkout ${!this.displayConfig.checkoutSummary?"full-width-layout":""}`},e("div",{class:"left-section"},e("div",{class:"left-section-container"},this.displayConfig.logo&&e("organization-logo",{organization:c.data.organization}),e("div",{class:"otp-container",style:{display:this.showOtp?"block":"none"}},e("otp-component",null)),e("div",{style:{display:this.showOtp?"none":"block"}},e("div",{class:"checkout-form-section"},this.displayConfig.checkoutSummary&&e("div",{class:"summary-mobile-tablet",style:{display:j(this.breakpoint,C.DESKTOP)?"block":"none"}},i({displayedComponents:["totalAmount","discount","timelineFreeTrial","timelineDebitDay","itemDetails"]})),!this.otpVerified&&this.displayConfig.customerInformation&&e("user-information",{customerExists:this.customerExists,disabled:this.isSubmitting,errors:{email:a.email,fullName:a.fullName}}),this.otpVerified&&this.displayConfig.customerInformation&&e("user-information-static",{variant:"otp",userInfo:{customerName:c.data.userInformation.fullName?.split(" ")[0],customerEmail:c.data.userInformation.email}}),e("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},e("payment-method-selector",{enabledPaymentMethods:c.data.itemInformation.paymentMethods,defaultSelected:this.currentPaymentMethod,disabled:this.isSubmitting,errorComponent:{showErrorComponent:this.currentPaymentError||this.isPaymentRejected(),alertTitle:this.errorMessage?.alertTitle,message:x.getErrorMessage(this.errorMessage)},country:c.data?.pricing?.country,installmentsError:a.installments,showDocument:(!this.otpVerified||this.otpVerified&&this.cardMode==="input")&&!o&&!this.isQrCodeVisible&&(k("documentNumber",this.currentRequiredFields)||k("documentType",this.currentRequiredFields)),documentTypeError:a.documentType,documentNumberError:a.documentNumber,cardError:this.cardError,customCSS:this.css}),!o&&(()=>{const t=k("bankId",this.currentRequiredFields);return t})()&&e("div",{class:"animated-component fade-in"},e("rebill-bank-selector",{banks:v("bank",this.allRequiredFields[this.currentPaymentMethod].original)||[],defaultSelectedBankId:n.bankId||"",error:a?.bankId}))),!o&&(!this.otpVerified||this.cardMode==="input")&&e(e.Fragment,null,this.displayConfig.billingAddress&&(k("billing-country",this.currentRequiredFields)||k("billing-state",this.currentRequiredFields)||k("billing-address",this.currentRequiredFields)||k("billing-city",this.currentRequiredFields)||k("billing-zip",this.currentRequiredFields))&&e("div",{class:"animated-component slide-in"},e("rebill-address",{disabled:this.isSubmitting,countryOptions:t,billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":a["billing-country"],"billing-state":a["billing-state"],"billing-address":a["billing-address"],"billing-city":a["billing-city"],"billing-zip":a["billing-zip"]}})),this.displayConfig.customerInformation&&k("phoneNumber",this.currentRequiredFields)&&e("div",{class:"animated-component fade-in"},e("user-information-phone",{disabled:this.isSubmitting,error:a?.phoneNumber,countryCode:c.data.userInformation?.countryCode||c.data.country}))),o&&e("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===p.CASH?this.checkoutResponse?.result?.data?.referenceId:undefined,qrCodeData:this.currentPaymentMethod===p.BANK_TRANSFER?this.checkoutResponse?.result?.data?.qrCode:undefined,checkoutRequestId:this.checkoutResponse?.result?.checkoutRequestId,providerName:c.data.providerKey,expirationDate:(()=>{const t=new Date;t.setDate(t.getDate()+30);return t.toISOString()})(),onPaymentStatusChange:t=>this.handlePaymentStatusChange(t.detail),country:c.data?.pricing?.country,redirectUrl:this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,bearerToken:this.checkoutResponse?.result?.data?.bearerToken}),this.displayConfig.checkoutSummary&&e("div",{class:"summary-price-details",style:{display:j(this.breakpoint,C.DESKTOP)?"block":"none"}},i({displayedComponents:["priceDetails"]})),this.displayConfig.submitButton&&!this.isQrCodeVisible&&e("div",{class:"payment-button-container"},e("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,trialPeriodDays:c.data?.itemInformation?.trial?.trialPeriodDays,onSubmit:()=>{s()},redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:this.timeToRedirectAPM,isDisabled:c.data.fetchingInstallments,country:c.data?.pricing?.country}),e("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:d.translate("otp.secureMessage")}))),this.displayConfig.sandboxMode&&c.isSandbox&&c.data.sessionType===h.CHECKOUT_LANDING&&!j(this.breakpoint,C.DESKTOP)&&e("rebill-mode-sandbox",null)),this.displayConfig.footer&&e("rebill-footer",{style:{marginTop:j(this.breakpoint,C.DESKTOP)?"16px":"auto"}}))),this.displayConfig.checkoutSummary&&e("div",{class:"right-section-checkout"},e("div",{class:"checkout-summary-section"},e("div",{class:"summary-desktop",style:{display:!j(this.breakpoint,C.DESKTOP)?"block":"none"}},i()))))}})))}static get watchers(){return{language:["handleLanguageChange"]}}};F.style=B;export{F as rebill_checkout};
|
|
2
|
+
//# sourceMappingURL=p-932d5912.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{O as organization_logo}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
export{O as organization_logo}from"./p-tu-WZjQJ.js";export{C as rebill_card_icon}from"./p-lWh04UqG.js";import{r as e,h as t}from"./p-DyaDabZ4.js";import{s as i,I as a,S as o}from"./p-dYKOc01W.js";import{L as n}from"./p-BzDRvtfU.js";import{B as r,g as l,i as c}from"./p-Do_vNuMa.js";import{C as d}from"./p-DA598vBj.js";const s=".checkout-single-column{min-height:100vh;background:var(--rebill-color-background);display:flex;flex-direction:column;position:relative;overflow-x:hidden;min-width:320px}.header{display:flex;justify-content:flex-start;align-items:center;height:72px;width:100%;max-width:1448px;min-width:348px;background:var(--rebill-color-background);margin-left:30px;box-sizing:border-box}.main-content{flex:1;display:flex;justify-content:center;align-items:center;min-height:0;width:100%;box-sizing:border-box;max-width:450px;margin:0 auto;gap:2rem}.footer-container{margin-top:auto;height:60px;display:flex;align-items:center;justify-content:flex-start;width:100%;box-sizing:border-box}.footer-content{width:100%;max-width:450px;min-width:auto;flex-shrink:1;flex-basis:auto;box-sizing:border-box}@media (max-width: 1024px){.header{width:100%;max-width:100%;justify-content:flex-start}.main-content{gap:0;align-items:center;justify-content:center;padding-top:2rem;flex:1;min-height:0;width:100%}.footer-container{width:100%;height:auto;min-height:60px;justify-content:center}.footer-content{width:100%;min-width:auto;max-width:100%;flex-basis:auto}}@media (max-width: 767px){.header{height:60px;margin-left:12px;margin-right:12px;width:100%}.main-content{padding-top:1rem;align-items:center;justify-content:center;flex:1;width:100%}.footer-container{margin-left:12px;margin-right:12px;height:auto;min-height:60px;width:100%;justify-content:center}}@media (min-width: 1025px){.checkout-single-column{background:var(--rebill-color-background-left)}.footer-container{margin-left:16px}.header{background:var(--rebill-color-background-left)}}";const f=class{constructor(t){e(this,t)}render(){return t("div",{key:"a5c6240bd4eaf072492868836a38299582a088ea",class:"checkout-single-column"},t("header",{key:"b2667a9b8b6e424254258a4b67f8edd58ffce4ed",class:"header"},t("div",{key:"225824c1484d6ee797ba076f0d4927b5404e501c",class:"header-container"},t("organization-logo",{key:"bfec47488aa19ffe6de330b92531e43bb2adc955",organization:i.data.organization}))),t("main",{key:"d454d7254f6fbcaf0aeda1d3f45e6d813663ebf9",class:"main-content"},t("slot",{key:"64ae361e02eee2be03459b8ffe9aa455fa311c0d"})),t("div",{key:"49807a190653886727a81c459fc352adc2203b34",class:"footer-container"},t("rebill-footer",{key:"89548f30b87bba2464aee178fcf9e2aa4cd74e43",class:"footer-content"})))}};f.style=s;const b=".language-selector{display:flex;align-items:center;margin-right:12px;height:24px}.rebill-footer__footer-content{display:flex;justify-content:space-between;align-items:center;width:100%;margin-bottom:18px}.terms-and-conditions{display:flex;align-items:center;gap:4px;margin-left:12px}.footer-powered{margin-right:4px}.footer-separator{margin-right:6px;margin-left:6px}.footer-link,.footer-powered,.footer-separator{display:flex;align-items:center}.footer-link a{font-size:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;text-decoration:none}";const h=class{constructor(t){e(this,t)}breakpoint=r.DESKTOP;resizeHandler=()=>{this.breakpoint=l(window.innerWidth)};disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler)}async componentWillLoad(){this.resizeHandler();window.addEventListener("resize",this.resizeHandler);const e=a.getCurrentLanguage();o.changeLanguage(e)}handleLanguageChange=e=>{a.changeLanguage(e.detail.value);o.changeLanguage(e.detail.value)};render(){return t("div",{key:"2f848185be3cc0420977d5d4ac0ad07534a06a41",class:"rebill-footer__footer-content"},t("div",{key:"2162f4c3728a073ed39d112864598cb5c0223be2",class:"terms-and-conditions"},!c(this.breakpoint,r.DESKTOP)&&t("rebill-typography",{key:"07ba952b0de49dde3220f80c9e8406c50e36ef55",variant:"subtitle3",color:d.SECONDARY,class:"footer-powered"},a.translate("footer.poweredBy")),t("rebill-icon",{key:"2c7dbdf01869cdce2ffcebb58383b87d418e75e3",name:"rebill-logo",color:d.SECONDARY}),t("rebill-icon",{key:"bf44f24d92209550a380cf0bb9e4598cbad53b29",name:"rebill",color:d.SECONDARY}),t("rebill-typography",{key:"4d91e0c2a32a7e8d7a78c20a172a1f5f0ca90d37",variant:"subtitle3",color:d.SECONDARY,class:"footer-separator"},"|"),t("rebill-typography",{key:"e38d140112eddf6990d7de70a37245aa7f354e60",variant:"subtitle3",color:d.SECONDARY,class:"footer-link"},t("a",{key:"d2d31c2b577b80c27367491672187a4671c3d910",href:"https://www.rebill.com/terminos-y-condiciones-usuarios-finales",target:"_blank"},a.translate("footer.termsAndConditions")))),t("div",{key:"e923b58c1442243d5d1469cbc895c92735df3446",class:"language-selector"},t("rebill-icon",{key:"bd9acbf6519dfdbbaf9f179b0375411d394afa4e",name:"world"}),t("rebill-input-select",{key:"c3dcfb2bab369f6586ddba960fa6426ac55c0919",id:"language-selector",variant:"underlined",backgroundColor:c(this.breakpoint,r.DESKTOP)?"":"var(--rebill-color-background-left)",options:[{label:"EN",value:n.EN},{label:"ES",value:n.ES},{label:"PT",value:n.PT}],value:i.currentLocale,"on-input":this.handleLanguageChange,fontSize:"10px",dropPosition:"up",arrowIcon:"down",class:"language-selector-input"})))}};h.style=b;export{f as rebill_checkout_single_column,h as rebill_footer};
|
|
2
|
+
//# sourceMappingURL=p-a09e3090.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as a,h as i,g as t,H as o}from"./p-DyaDabZ4.js";import{a as r}from"./p-C6wUNEUc.js";import{s as l,S as s,I as n,i as c,P as d,a as b,b as p}from"./p-dYKOc01W.js";import{C as f}from"./p-DA598vBj.js";import{c as m}from"./p-bcHxwlBu.js";import{c as h}from"./p-2SuTTFdS.js";export{R as rebill_mode_sandbox,S as rebill_summary}from"./p-2SuTTFdS.js";import{e as y,E as g,c as u}from"./p-B2q13jSm.js";import"./p-BFhvUZPU.js";import"./p-BYrqevT1.js";import{P as x}from"./p-CTQZ1Sio.js";import{g as v}from"./p-Bf6g23G6.js";import{f as _}from"./p-DkiBa5Y3.js";import"./p-uZj1dMLQ.js";import{B as k,g as w,i as C}from"./p-Do_vNuMa.js";import{g as j}from"./p-C0jcntnC.js";import"./p-BFTU3MAI.js";import"./p-B2LDUv1-.js";const D=".otp__otp-container{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;position:relative;margin-top:2rem}.otp__user-information{display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%;gap:8px}.otp__otp-description-container{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:4px}.otp__change-email{cursor:pointer;text-decoration:underline;margin-left:0}.otp__change-email:hover{color:var(--rebill-primary-color);text-decoration:underline}.otp__alternative{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:16px;margin:32px;width:100%}.otp__rebill-alert{width:100%}.otp__guest-options{display:flex;flex-direction:column;width:100%;gap:8px;margin-top:auto}.otp__verifying-container{display:flex;align-items:center;justify-content:center;gap:16px;margin:8px 0}.otp__code-resent-container rebill-typography{display:flex;line-height:1}.otp__code-resent-container rebill-icon{flex-shrink:0;display:inline-flex;vertical-align:middle;margin-right:8px}.otp__spinner{width:15px;height:15px;border:2px solid rgba(255, 255, 255, 0.3);border-radius:50%;border-top-color:var(--rebill-color-primary);animation:spin 1s linear infinite;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}@media (max-width: 1024px){.otp__otp-container{min-height:calc(100vh - 40px)}.otp__guest-options{margin-top:32px}}@media (min-width: 1025px){.otp__otp-container{justify-content:flex-start}.otp__guest-options{margin-top:auto;padding-bottom:2rem}}";const T=class{constructor(i){e(this,i);this.changeEmailClick=a(this,"changeEmailClick");this.returnForm=a(this,"returnForm");this.codeVerified=a(this,"codeVerified")}changeEmailClick;timeLeft=59;isTimerRunning=false;codeResent=false;isVerifying=false;otpValue="";returnForm;codeVerified;error=false;timer=m({duration:59,onTick:e=>{this.timeLeft=e},onComplete:()=>{this.isTimerRunning=false}});messageTimer=m({duration:5,onComplete:()=>{this.codeResent=false}});disconnectedCallback(){this.timer.stop()}startTimer(){this.timer.start();this.isTimerRunning=true}handleResendCode=async()=>{if(!this.isTimerRunning){await r.otp.generate(l.data.sessionId,{email:l.data.userInformation.email});this.codeResent=true;this.messageTimer.start();this.startTimer();this.error=false}};handleOtpChange=e=>{this.otpValue=e;if(e.length===6){this.handleVerifyOtp(e);this.error=false}};handleVerifyOtp=async e=>{this.isVerifying=true;try{const a=await r.otp.verify(l.data.sessionId,{email:l.data.userInformation.email,code:e});this.codeVerified.emit(a.data);s.setUserInformation({...a.data.customer,fullName:`${a.data.customer.firstName} ${a.data.customer.lastName}`.trim(),phoneNumber:{number:a.data.customer.phoneNumbers[0].number,countryCode:a.data.customer.phoneNumbers[0].countryCode},address:{billingAddress:{address:a.data.customer.addresses[0].lineOne,zip:a.data.customer.addresses[0].zipCode,city:a.data.customer.addresses[0].city,state:a.data.customer.addresses[0].state,country:a.data.customer.addresses[0].country}},documentType:a.data.customer.identifications[0].type,documentNumber:a.data.customer.identifications[0].value});s.setAccessToken(a.data.accessToken);s.setCustomerId(a.data.customer.id);this.otpValue="";this.error=false}catch(e){this.error=true}finally{this.isVerifying=false}};render(){return i("div",{key:"342b5631b2dfe15cc24880cf7d6d77b6c10ab12d",class:"otp__otp-container"},i("div",{key:"c6bf7502fa3f9c1940d1d07360a47c17cc2fdeb2",class:"otp__user-information"},i("div",{key:"078a4cb4dd563ff1ddfbc02f70e8c923f6973d0f",class:"otp__otp-description-container"},i("rebill-typography",{key:"d8ae4e71ee4e35b033347c6bc99200e48e5b9705",variant:"body2",class:"otp__otp-description"},n.translate("otp.description")),i("rebill-typography",{key:"2466a357c835bcd8314aa5f53aefabb474fdf55f",variant:"subtitle-bold",class:"otp__otp-description-digits"}," ",i("strong",{key:"3a4263b93f5ad7f9aec482f1d1eef76952cf60d3"},n.translate("otp.descriptionDigits"))," "),i("rebill-typography",{key:"d77b23e3581d353e2fdd73debe4fbc0e987376c4",variant:"body2",class:"otp__otp-description-email"},n.translate("otp.descriptionEmail"))),i("rebill-typography",{key:"723a510062706eed71186cf6b1a252f58554a4fc",variant:"body2",class:"otp__otp-email-line"},l.data.userInformation.email," ",!l.data.prefilledData?.email&&i("span",{key:"46fb8563cb20d2ae7a6d8bc8d369d8a985ff85f3",class:"otp__change-email",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},n.translate("otp.change")))),i("input-otp",{key:"8ed8dc00b9131753f6f23178e607049e6bc4ea72",otp:this.otpValue,onOtpChange:e=>this.handleOtpChange(e.detail),error:this.error?n.translate("otp.error"):""}),this.isVerifying&&i("div",{key:"364e208afc986a3272bf24b282c169fb243b86db",class:"otp__verifying-container"},i("rebill-typography",{key:"02cec9d49145d0f953b84d9ee0fbf015f5004d8d",variant:"subtitle2",color:f.PRIMARY},n.translate("otp.verifyingCode")),i("div",{key:"b436acb222dd7db455a86e4063567519e309d85e",class:"otp__spinner"})),i("rebill-button",{key:"ac5bcb96f2fac2426579ac33ca2f84f36e3dda51",type:"button",variant:"outline",theme:this.isTimerRunning?"secondary":"primary",disabled:this.isTimerRunning,onClick:this.handleResendCode,size:"small",style:{height:"24px",marginBottom:"8px"}},this.isTimerRunning?`${n.translate("otp.resendCodeIn")} (${this.timer.getFormattedTime()})`:n.translate("otp.resendCode")),this.codeResent&&i("div",{key:"b5f54b7f537c0e382d2c1a3ff79a24f2cf4e63a9",class:"otp__code-resent-container"},i("rebill-typography",{key:"4aeaeb7d4d37eab63ca63419dccb54e1b7d2fda8",variant:"subtitle2",color:f.GREEN},i("rebill-icon",{key:"4fea914f167a28bb06e0cf69d833fda493752d55",name:"check-radio"}),n.translate("otp.codeResent"))),i("rebill-alert",{key:"a8bcbdbc5af7a9e6a12bc842dd8142812638f3fa",class:"otp__rebill-alert",type:"secure",variant:"variant-info",message:n.translate("otp.infoMessage"),icon:"circle-info",alertTitle:n.translate("otp.infoTitle"),colorIcon:f.PRIMARY_DARK_LIGHT}),i("div",{key:"9ff81fa5dce0deaec0a292d2e25d396f559a27a5",class:"otp__alternative"},i("rebill-typography",{key:"b8e4f23db473f1049f4f6eae5a489722053aa24a",variant:"body2",color:f.PRIMARY_DARK},"o")),i("div",{key:"87a52e07d7c709c95517f0f3606d843c6580f9bf",class:"otp__guest-options"},i("rebill-button",{key:"3fb138f038065cb6ec2852f313de1eae3d194748",type:"button",variant:"outline",theme:"secondary",size:"medium",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},n.translate("otp.continueAsGuest")),i("rebill-alert",{key:"3bd11b6a8a91c2690998c2f7af36e872e485fffe",type:"secure",variant:"variant-secure",icon:"lock-outline",message:n.translate("otp.secureMessage")})))}};T.style=D;const L=".modal-overlay{position:fixed;top:0;left:0;right:0;background-color:transparent;display:flex;align-items:center;justify-content:center;z-index:10000;padding:12px 16px;box-sizing:border-box}.modal-content{background:white;border-radius:8px;padding:16px 20px;width:350px;box-shadow:0 4px 12px -2px rgba(0, 0, 0, 0.15),\n 0 2px 4px -1px rgba(0, 0, 0, 0.1);position:relative;display:flex;align-items:center;gap:12px}.modal-content .alert{margin:0;flex:1;padding:0;background:transparent;border:none;box-shadow:none}.modal-content .alert{background-color:transparent !important;border-color:transparent !important}.modal-content .alert-message{display:flex;flex-direction:column;gap:4px}.modal-content .close-button{position:absolute;top:8px;right:8px;width:20px;height:20px;border:none;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color 0.2s ease;padding:0;margin:0;outline:none;box-shadow:none;line-height:1}.modal-content .close-button:focus{outline:none;box-shadow:none}.modal-content .close-button:hover{background-color:#f0f0f0}.modal-content .close-button rebill-icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}@media (max-width: 768px){.modal-overlay{padding:8px 12px}.modal-content{padding:12px 16px;flex-direction:column;gap:8px;text-align:center}.modal-content .close-button{width:100%}}";const M=class{constructor(a){e(this,a)}visible=true;languageUpdateTrigger=0;unsubscribeCurrentLocaleStore;componentDidLoad(){this.unsubscribeCurrentLocaleStore=s.onChange("currentLocale",(()=>{this.languageUpdateTrigger++}))}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}}closeModal=()=>{this.visible=false};render(){if(!this.visible)return null;return i("div",{class:"modal-overlay"},i("div",{class:"modal-content"},i("div",{class:"alert info filled medium"},i("div",{class:"alert-icon"},i("rebill-icon",{name:"circle-info",size:"16px",color:f.ORANGE})),i("div",{class:"alert-message"},i("div",{class:"alert-title"},i("rebill-typography",{variant:"subtitle-bold",color:f.PRIMARY_DARK},n.translate("session.refreshedTitle"))),i("div",{class:"alert-message-text"},i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},n.translate("session.refreshedMessage"))))),i("button",{onClick:this.closeModal,class:"close-button",type:"button"},i("rebill-icon",{name:"close",size:"20px"}))))}};M.style=L;const $=":host{display:flex;position:relative;width:100%;justify-content:center;align-items:center}.mode-sandbox-mobile__test-mode-container{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.mode-sandbox-mobile__overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.5);z-index:5;animation:fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);pointer-events:auto;cursor:pointer}.mode-sandbox-mobile__test-mode-chip-mobile{display:flex;width:100%;min-width:auto;max-width:100%;height:40px;background:#ffffff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;position:relative;z-index:20}.mode-sandbox-mobile__chip-content-mobile{display:flex;align-items:center;gap:2px;justify-content:flex-end;min-height:24px;flex-shrink:0;width:100%;margin:8px}.mode-sandbox-mobile__info-icon{display:flex;align-items:center}.mode-sandbox-mobile__test-mode-chip-mobile.expanded .mode-sandbox-mobile__chip-content-mobile{justify-content:flex-end;width:100%}.mode-sandbox-mobile__cards-dropdown-panel-header{display:flex;align-items:center;gap:8px;padding:8px}.mode-sandbox-mobile__docs-section{display:flex;align-items:center;gap:8px;cursor:pointer;margin-left:0;transition:background-color 0.2s ease;justify-content:flex-end;padding:8px;margin-top:8px}.mode-sandbox-mobile__cards-dropdown-panel{position:absolute;top:100%;left:0;right:0;width:100%;background:#ffffff;border-top:none;border-left:1px solid #e5e7eb;border-right:1px solid #e5e7eb;border-bottom:1px solid #e5e7eb;margin-top:16px;z-index:25;animation:expandDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);transform-origin:top center}.mode-sandbox-mobile__card-section{display:flex;flex-direction:column;justify-content:space-between}.mode-sandbox-mobile__header-content{display:flex;align-items:center;gap:8px;margin:8px}.mode-sandbox-mobile__card-details{background:#fafafa;border-radius:8px;border:1px solid #e5e7eb;margin:8px;min-height:208px;display:flex;flex-direction:column}.mode-sandbox-mobile__card-row{display:flex;gap:12px;align-items:stretch;background:#ffffff;justify-content:space-around;border-radius:8px;border:1px solid #e5e7eb;height:auto;padding:8px;margin:8px}.mode-sandbox-mobile__card-value{display:flex;flex-direction:column;gap:6px;flex:1}.mode-sandbox-mobile__field-value{display:flex;flex-direction:row;align-items:center;gap:8px;max-height:20px}.mode-sandbox-mobile__copy-button{align-items:center;margin-left:auto;margin-right:0}.mode-sandbox-mobile__icon-button{margin-left:auto;margin-right:16px}@keyframes expandDown{from{opacity:0;transform:translateY(-10px) scaleY(0.9)}to{opacity:1;transform:translateY(0) scaleY(1)}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}";const z=class{constructor(a){e(this,a)}get el(){return t(this)}isPanelVisible=false;currentLanguage=n.getCurrentLanguage();componentWillLoad(){c.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){c.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=n.getCurrentLanguage()};togglePanel=()=>{this.isPanelVisible=!this.isPanelVisible};handleCopy=e=>{h(e);this.isPanelVisible=false};handleDocsClick=()=>{window.open("https://v3.docs.rebill.com/sdk/checkout","_blank")};renderBasicChip(){return i("div",{class:"mode-sandbox-mobile__chip-content-mobile"},i("div",{class:"mode-sandbox-mobile__info-icon"},i("rebill-icon",{name:"circle-info",size:"24px",color:f.ORANGE})),i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},n.translate("sandbox.testMode")),i("div",{class:"mode-sandbox-mobile__icon-button"},i("rebill-button",{variant:"text",size:"small",onClick:this.togglePanel},i("rebill-icon",{name:"hamburger"}))))}renderCardsPanel(){return i("div",{class:"mode-sandbox-mobile__cards-dropdown-panel"},i("div",{class:"mode-sandbox-mobile__cards-dropdown-panel-header"},i("rebill-icon",{name:"card-test"}),i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},n.translate("sandbox.cardTest"))),i("div",{class:"mode-sandbox-mobile__card-details"},i("div",{class:"mode-sandbox-mobile__card-section"},i("div",{class:"mode-sandbox-mobile__header-content"},i("rebill-icon",{name:"succes",color:f.GREEN}),i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},n.translate("sandbox.successPayment"))),i("div",{class:"mode-sandbox-mobile__card-row"},i("div",{class:"mode-sandbox-mobile__card-value"},i("rebill-typography",{variant:"subtitle3",color:f.GREY_700},n.translate("sandbox.cardNumber")),i("div",{class:"mode-sandbox-mobile__field-value"},i("rebill-icon",{name:"visa"}),i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},"4539148803436467"))),i("div",{class:"mode-sandbox-mobile__card-value"},i("rebill-typography",{variant:"subtitle3",color:f.GREY_700},n.translate("sandbox.exp")),i("div",{class:"mode-sandbox-mobile__field-value"},i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},"01/99"))),i("div",{class:"mode-sandbox-mobile__card-value"},i("rebill-typography",{variant:"subtitle3",color:f.GREY_700},n.translate("sandbox.cvv")),i("div",{class:"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy"},i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},"123"),i("div",{class:"mode-sandbox-mobile__copy-button"},i("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4539148803436467 01/99 123")},i("rebill-icon",{name:"copy"}))))))),i("div",{class:"mode-sandbox-mobile__card-section"},i("div",{class:"mode-sandbox-mobile__header-content"},i("rebill-icon",{name:"rejected",color:f.ERROR}),i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},n.translate("sandbox.rejectedPayment"))),i("div",{class:"mode-sandbox-mobile__card-row"},i("div",{class:"mode-sandbox-mobile__card-value"},i("rebill-typography",{variant:"subtitle3",color:f.GREY_700},n.translate("sandbox.cardNumber")),i("div",{class:"mode-sandbox-mobile__field-value"},i("rebill-icon",{name:"visa"}),i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},"4485364739527352"))),i("div",{class:"mode-sandbox-mobile__card-value"},i("rebill-typography",{variant:"subtitle3",color:f.GREY_700},n.translate("sandbox.exp")),i("div",{class:"mode-sandbox-mobile__field-value"},i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},"01/99"))),i("div",{class:"mode-sandbox-mobile__card-value"},i("rebill-typography",{variant:"subtitle3",color:f.GREY_700},n.translate("sandbox.cvv")),i("div",{class:"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy"},i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY_DARK},"123"),i("div",{class:"mode-sandbox-mobile__copy-button"},i("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4485364739527352 01/99 123")},i("rebill-icon",{name:"copy"})))))))),i("div",{class:"mode-sandbox-mobile__docs-section",onClick:this.handleDocsClick},i("rebill-typography",{variant:"subtitle2",color:f.PRIMARY},n.translate("sandbox.docs")),i("rebill-icon",{name:"external-link"})))}render(){return i("div",{key:"2051c42d557dcdfc491dc679684aa585e6b8375a",class:`mode-sandbox-mobile__test-mode-container ${this.isPanelVisible?"cards-visible":""}`},this.isPanelVisible&&i("div",{key:"90291e86c59667a2055457ad99aad90deb8f1dd7",class:"mode-sandbox-mobile__overlay"}),i("div",{key:"c405adb07262da6175badba97245914469480905",class:`mode-sandbox-mobile__test-mode-chip-mobile ${this.isPanelVisible?"expanded":""}`},this.renderBasicChip()),this.isPanelVisible&&this.renderCardsPanel())}};z.style=$;const I=":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}.text-content{margin-bottom:2rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}.success-content{display:flex;flex-direction:column;align-items:center;gap:1rem;width:100%;overflow-x:hidden;box-sizing:border-box}.lottie-container{width:80px;height:80px}.success-content rebill-typography[variant='h3']{margin:0 !important;padding:0 !important}.success-icon{display:flex;justify-content:center;margin:0.5rem 0}.success-page__info-card{padding:24px;gap:16px;width:100%;max-width:450px;border:1px solid #ebedef;border-radius:8px;display:flex;flex-direction:column;box-sizing:border-box}.success-page__card-row{display:flex;justify-content:space-between;align-items:start;min-height:20px;gap:15%}.success-page__card-row:last-of-type{margin-bottom:0}.success-page__card-value{display:flex;align-items:center;gap:0.5rem}.payment-method-display{display:flex;align-items:center;gap:8px;justify-content:center}.payment-method-display rebill-card-icon{display:inline-block;flex-shrink:0;margin-right:8px;vertical-align:middle}.payment-method-display rebill-card-icon svg{display:block}.payment-method-display rebill-icon{display:inline-block;vertical-align:middle;margin-right:8px}.payment-method-display rebill-icon div{display:block}.success-page__card-divider{height:1px;background:#e5e7eb}.download-container{display:flex;align-items:center;justify-content:flex-start;gap:2px;text-decoration:none;cursor:pointer}.contact-info{text-align:left}.reference-number{word-break:break-all;overflow-wrap:break-word;hyphens:auto;max-width:100%;text-align:right}.total-amount-container{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-direction:row}.trial-pill{background-color:var(--rebill-color-green-light-2);border-radius:4px;padding:4px 6px 4px 6px;display:flex;align-items:center;justify-content:center}.next-charge-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:12px}.next-charge-details{display:flex;justify-content:space-between;align-items:flex-start}.next-charge-amount{display:flex;flex-direction:row;align-items:center;gap:4px}.next-charge-date{text-align:right}@media (max-width: 1024px){.success-content{max-width:100%;gap:1.5rem;margin-left:16px;margin-right:16px}.success-page__info-card{width:100%;max-width:100%;padding:12px}.text-content{gap:12px}}@media (max-width: 767px){.success-page__info-card{padding:12px}.processing-container{padding:0 16px}}";const P=class{constructor(i){e(this,i);this.successRedirect=a(this,"successRedirect")}typePaymentMethod=d.CARD;country="";bank="";paymentMethodName="";cardLastFour="";paymentDate="";referenceNumber="";trialPeriodDays=0;debitDay=0;planAmount=0;currentLocale=l.currentLocale;breakpoint=k.DESKTOP;successRedirect;loaderProgress=0;isLoadingLottie=true;showRedirectMessage=false;timeToRedirect=3e3;progressInterval;lottieContainer;lottieAnimation;unsubscribeCurrentLocaleStore;successDisplayTimeout;applyStartCaseToBrand=e=>{if(!e)return"";return e.toLowerCase().split(/[\s-]+/).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")};getPaymentDate=()=>{const e=l?.data?.payment;if(!e)return"";if("createdAt"in e){return e.createdAt}return""};componentWillLoad(){this.breakpoint=w(window.innerWidth);this.unsubscribeCurrentLocaleStore=s.onChange("currentLocale",(()=>{this.currentLocale=l.currentLocale}));if(l.data?.itemInformation?.redirectSuccess){this.successDisplayTimeout=window.setTimeout((()=>{this.showRedirectMessage=true;this.loadLottieAnimation()}),1500);setTimeout((()=>{let e=l.data?.itemInformation?.redirectSuccess;if(e){this.successRedirect.emit({redirectUrl:e});this.stopLoaderAnimation()}}),this.timeToRedirect)}}componentDidLoad(){window.addEventListener("resize",this.handleResize);if(!l.data?.itemInformation?.redirectSuccess||this.showRedirectMessage){this.loadLottieAnimation()}}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}if(this.successDisplayTimeout){clearTimeout(this.successDisplayTimeout)}window.removeEventListener("resize",this.handleResize);this.stopLoaderAnimation()}handleResize=()=>{this.breakpoint=w(window.innerWidth)};loadLottieAnimation=async()=>{try{const e=await import("./p-DdEjhWUP.js").then((function(e){return e.l}));const a=await fetch(v(`loader-redirect1.json`));const i=await a.json();if(this.lottieContainer){this.lottieAnimation=e.default.loadAnimation({container:this.lottieContainer,renderer:"svg",loop:true,autoplay:true,animationData:i})}else{this.startLoaderAnimation()}}catch(e){this.startLoaderAnimation()}};startLoaderAnimation=()=>{const e=3e3;const a=50;const i=a/e*100;this.progressInterval=window.setInterval((()=>{this.loaderProgress=Math.min(this.loaderProgress+i,100);if(this.loaderProgress>=100){this.stopLoaderAnimation()}}),a)};stopLoaderAnimation=()=>{if(this.progressInterval){clearInterval(this.progressInterval);this.progressInterval=undefined}if(this.lottieAnimation){this.lottieAnimation.destroy();this.lottieAnimation=undefined}};handleDownloadReceipt=async()=>{try{await x.generateAndDownloadReceipt({paymentMethod:this.typePaymentMethod===d.CARD?this.textPaymentMethodCard():this.paymentMethodName,...this.typePaymentMethod===d.BANK_TRANSFER&&{bank:this.bank},...this.typePaymentMethod===d.CARD&&{cardBrand:this.applyStartCaseToBrand(l.data.cardInformation?.brand||"")},...this.typePaymentMethod===d.CARD&&{cardLastFour:this.cardLastFour??l.data.cardInformation?.lastFour},paymentDate:_(this.getPaymentDate())||"",email:l?.data?.userInformation?.email||"",referenceNumber:this.referenceNumber,productTitle:l?.data?.itemInformation?.title||"",subtotal:this.getFormattedSubtotal(),total:this.getFormattedTotal(),currency:l?.data?.pricing?.currency||" ",installments:l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment?`${y(l.data?.cardInformation?.installments?.selectedInstallment?.installment,u(l.data?.cardInformation?.installments?.selectedInstallment?.installmentAmount||0),l.data?.pricing?.currency,l.data?.cardInformation?.installments?.selectedInstallment?.cft,l.data?.cardInformation?.installments?.selectedInstallment?.model)}\n( ${n.translate("processing.purchaseTotal")}: ${this.getFormattedTotal()} )${l.data.cardInformation?.installments?.installments.find((e=>e.installment===l.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===g.CUSTOMER_FINANCED?`\n${n.translate("installments.interest")}`:""}`:"",discountAmount:this.getFormattedDiscountAmount(),trialPeriodDays:this.trialPeriodDays||l.data?.itemInformation?.trial?.trialPeriodDays,debitDay:this.debitDay||l.data?.itemInformation?.debitDay,planAmount:this.getFormattedSubtotal(this.planAmount),trialEndDate:this.hasFreeTrial()?this.getTrialEndDateFormatted():undefined,debitDate:this.hasDebitDay()?this.getDebitDateFormatted():undefined,isBankTransfer:this.typePaymentMethod===d.BANK_TRANSFER})}catch(e){console.error("Error downloading receipt:",e)}};getFormattedDiscountAmount=()=>{if(l?.data?.pricing?.discountAmount>0){const e=b(l.data?.pricing?.discountAmount,l.data?.pricing?.currency);return`-${e}`}return undefined};getFormattedSubtotal=(e=null)=>b(e||l?.data?.pricing?.subtotal,l?.data?.pricing?.currency);getFormattedTotal=()=>{if(this.trialPeriodDays>0){return b(0,l?.data?.pricing?.currency)}return b(l?.data?.pricing?.total,l?.data?.pricing?.currency)};hasFreeTrial=()=>l.data?.itemInformation?.type===p.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&l.data?.itemInformation?.trial?.trialPeriodDays>0;hasDebitDay=()=>{const e=l.data?.itemInformation?.debitDay;return e&&e>0};getTrialEndDateFormatted=()=>{const e=l.data?.itemInformation?.trial?.trialPeriodEndsAt;if(!e)return"";const a=new Date(e);const i=n.getCurrentLanguage();const t=i==="es"?"es-ES":i==="pt"?"pt-BR":"en-US";if(i==="en"){return`${a.toLocaleDateString(t,{month:"long"})} ${a.getDate()}`}else{return`${a.getDate()} de ${a.toLocaleDateString(t,{month:"long"})}`}};getDebitDateFormatted=()=>{const e=l.data?.itemInformation?.debitDay;if(!e||e<=0)return"";const a=new Date;const i=new Date(a);const t=n.getCurrentLanguage();const o=t==="es"?"es-ES":t==="pt"?"pt-BR":"en-US";if(e<a.getDate()){i.setMonth(a.getMonth()+1)}i.setDate(e);while(i.getDate()!==e){i.setDate(i.getDate()-1)}if(t==="en"){return`${i.toLocaleDateString(o,{month:"long"})} ${i.getDate()}`}else{return`${i.getDate()} de ${i.toLocaleDateString(o,{month:"long"})}`}};textPaymentMethodCard=()=>{const e=l.data?.cardInformation?.brand;const a=this.cardLastFour||l?.data?.cardInformation?.lastFour;const i=this.applyStartCaseToBrand(e||"");return e&&a?`${i} - ${a}`:i};render(){const e=l.data?.itemInformation?.redirectSuccess;return i("rebill-checkout-single-column",{key:"d8a814c5353cd2dcaa053ea6c205be11870f7629"},i("div",{key:"300d2de040e3d30cd48fc33b311b6c068bb5706f",class:"success-content"},i("rebill-typography",{key:"10bd5be46e1adbd9eb61808ce8e74b5c78d735a8",variant:"h3",color:f.PRIMARY_DARK_TEXT},e&&this.showRedirectMessage?n.translate("processing.redirectMessage"):n.translate("processing.successTitle")),e&&this.showRedirectMessage?i("div",{class:"redirect-message"},i("div",{class:"lottie-container"},i("div",{ref:e=>this.lottieContainer=e,class:"lottie-animation"}))):i("div",{class:"success-icon"},i("svg",{width:C(this.breakpoint,k.DESKTOP)?"64":"96",height:C(this.breakpoint,k.DESKTOP)?"64":"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.99219 47.998C7.99219 25.9067 25.9008 7.99805 47.9922 7.99805C70.0836 7.99805 87.9922 25.9067 87.9922 47.998C87.9922 70.0894 70.0836 87.998 47.9922 87.998C25.9008 87.998 7.99219 70.0894 7.99219 47.998ZM61.5401 39.2645C62.2396 38.4096 62.1136 37.1496 61.2587 36.4501C60.4038 35.7507 59.1437 35.8767 58.4443 36.7316L41.8437 57.0211L35.4064 50.5838C34.6254 49.8028 33.359 49.8028 32.578 50.5838C31.7969 51.3649 31.7969 52.6312 32.578 53.4123L40.578 61.4123C40.9775 61.8118 41.5275 62.0237 42.0918 61.9956C42.6562 61.9674 43.1823 61.7019 43.5401 61.2645L61.5401 39.2645Z",fill:"#35B093"}))),i("div",{key:"a4bec3c9deb9d5cc33a104861b4dfd459f698680",class:"success-page__info-card"},i("div",{key:"8d1d7bacc956826e7d3c17ede9c1881006dd85d6",class:"success-page__card-row"},i("rebill-typography",{key:"9cefa0019d0b3111bfe4d86e5d45b3be5096a669",variant:"body2",color:f.SECONDARY},n.translate("processing.paymentMethod")),i("div",{key:"0daedd45d705bbf2cc6126978f6940f67c3adfcb",class:"success-page__card-value"},i("div",{key:"2046c5f0ce8e12b425a682ca7abc39ce1e595e7c",class:"payment-method-display"},this.typePaymentMethod===d.CARD&&i(i.Fragment,null,i("rebill-card-icon",{key:"b738832b38e50744656e9fcf45785062c13d9b2b","card-brand":l.data?.cardInformation?.brand||""}),i("rebill-typography",{key:"e9928ed3a6196280a3cb17883ebcd3cc985a2b43",variant:"body2",color:f.PRIMARY_DARK_TEXT},this.textPaymentMethodCard())),this.typePaymentMethod===d.BANK_TRANSFER&&i("div",{key:"df21f77c4b1029feb215343aeca6c43c12d95fd1",style:{display:"flex",alignItems:"center",gap:"8px"}},i("rebill-icon",{key:"272644ea6337654a62a73b9ade66ab15d7c940c5",name:j(d.BANK_TRANSFER,this.country)?.toLowerCase()||"card"}),i("rebill-typography",{key:"d7240cbef960d4dc28fcd0d0f3e2f2336739c752",variant:"body2",color:f.PRIMARY_DARK_TEXT},n.translate("paymentMethods.bank_transfer")))))),l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment&&i("div",{key:"5fe838e33d7f75f91c86c2849224ef2a49342b81"},i("div",{key:"1aa1b037dcd780c009499ee09df50e68b76df935",class:"success-page__card-row"},i("rebill-typography",{key:"3e907c933564379479f9ca2acf271916c2bc4928",variant:"body2",color:f.SECONDARY},n.translate("summary.installments")),i("div",{key:"b0ab2acd74e05f95838de8f6b7d61625fe764d4a",style:{display:"flex",flexDirection:"column",gap:"10px",alignItems:"end"}},i("rebill-typography",{key:"f61f0a2f3d005fa52cff9c17cadf02ef11b1322d",variant:"body2",color:f.PRIMARY_DARK_TEXT,style:{textAlign:"end"}},y(l.data?.cardInformation?.installments?.selectedInstallment?.installment,u(l.data?.cardInformation?.installments?.selectedInstallment?.installmentAmount||0),l.data?.pricing?.currency,l.data?.cardInformation?.installments?.selectedInstallment?.cft,l.data?.cardInformation?.installments?.selectedInstallment?.model)),i("rebill-typography",{key:"0f42f8250afec3d6b3a79b12a538e27c68fe11dc",variant:"body2",color:f.PRIMARY_DARK_TEXT},`( ${n.translate("processing.purchaseTotal")}: ${this.getFormattedTotal()} )`),l.data.cardInformation?.installments?.installments.find((e=>e.installment===l.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===g.CUSTOMER_FINANCED&&i("rebill-typography",{key:"e60b60dd9d4140f0f68ac9337c4eeaeb16307e81",variant:"italic",color:f.SECONDARY,style:{textAlign:"end"}},`${n.translate("installments.interest")}`)))),i("div",{key:"0e16ac8326cd0542e8656593746fe2ab2c7394ed",class:"success-page__card-row"},i("rebill-typography",{key:"509f8b0a04aba8edefdf3da8e0f9039d3be47878",variant:"body2",color:f.SECONDARY},n.translate("processing.paymentDate")),i("rebill-typography",{key:"b3727f8eaab806ccecf422418c5d527ae18bfb31",variant:"body2",color:f.PRIMARY_DARK_TEXT},_(this.paymentDate||this.getPaymentDate()||l.createdAt)||"")),i("div",{key:"acf55b48d33c73b0fb1d5f8e68672ea2e33c7fbe",class:"success-page__card-row"},i("rebill-typography",{key:"d2c0becdd3096cfc995e7258f0c6741dbaaa5b28",variant:"body2",color:f.SECONDARY},n.translate("processing.paymentEmail")),i("rebill-typography",{key:"cd337abb3b8828129bf109875c3927ab5a76b507",variant:"body2",color:f.PRIMARY_DARK_TEXT},l?.data?.userInformation?.email)),i("div",{key:"7c78a3fc52c5c7966a5d1be7b2027f2e64893fa1",class:"success-page__card-row"},i("rebill-typography",{key:"d1097bda8329b97e7e19e15cf05c923899305723",variant:"body2",color:f.SECONDARY},n.translate("processing.paymentReference")),i("rebill-typography",{key:"0fe00585bc2b97f58e43e9647c31a38aa376b617",variant:"body2",color:f.PRIMARY_DARK_TEXT,class:"reference-number"},this.referenceNumber||""))),i("div",{key:"c9ce7fc78430de6ea3ed77a485832c2714cdfcfa",class:"success-page__info-card"},i("rebill-typography",{key:"f60ea9706de5730c2c6919b0cef92f545d80cce7",variant:"subtitle-bold",color:f.PRIMARY_DARK_TEXT},n.translate("processing.purchaseDetails")),i("div",{key:"65f24003ad3dad665b9c1ad1f09558caf43acaae",class:"success-page__card-row"},i("rebill-typography",{key:"f32902e2254725cc4b7788f70ef2fda36767676b",variant:"body2",color:f.SECONDARY},n.translate("processing.purchaseDetail")),i("rebill-typography",{key:"4ae4fed51cd2a89cdfc2b0e6c86336a5c39de38b",variant:"body2",color:f.PRIMARY_DARK_TEXT},l?.data?.itemInformation?.title||"")),!this.trialPeriodDays&&i("div",{key:"feb4816ba4e9d2fe8e852be99e1af07567eb704e",class:"success-page__card-row"},i("rebill-typography",{key:"d54c1b908a56af924dd93fcb32ece6dfecf88931",variant:"body2",color:f.SECONDARY},n.translate("processing.purchaseSubtotal")),i("rebill-typography",{key:"3a1d7af2bc28ae18efaedf5fb9d0489ab9ef295c",variant:"body2",color:f.PRIMARY_DARK_TEXT},this.getFormattedSubtotal())),l?.data?.pricing?.discountAmount>0&&i("div",{key:"e65e71710d6cd3c937f6aaf096543e496b1e2325",class:"success-page__card-row"},i("rebill-typography",{key:"a1a46e9e2b0f52c4cc8cdce002aaa1772c9ff696",variant:"body2",color:f.SECONDARY},n.translate("summary.discount")),i("rebill-typography",{key:"1af958f8c84761da45f0c3f20e172e8553006896",variant:"body2",color:f.PRIMARY_DARK_TEXT},this.getFormattedDiscountAmount())),i("div",{key:"9daf0cd1ba58159973ebb43bf9a54e27a4d2507b",class:"success-page__card-row"},i("rebill-typography",{key:"14d4365b7f5c4db15a2779e6d460293a2f0bddcb",variant:"body2",color:f.SECONDARY},n.translate("processing.purchaseMontoTotal")),i("div",{key:"688710a4705697093b56c93b2c88ea67d44f2e60",class:"total-amount-container"},this.trialPeriodDays>0&&i("div",{key:"9e387c929f2e52effcdc8a04985f7813af8e84e4",class:"trial-pill"},i("rebill-typography",{key:"f98ea49edec24bccad87ff8c142914c7ce4eee7b",variant:"body2",align:"center",color:f.GREEN_TEXT},n.translate("processing.trialPill",{days:this.trialPeriodDays,count:this.trialPeriodDays}))),i("rebill-typography",{key:"bd7340197baddea2e7131074841caec3ab1cc1d4",variant:"body2",color:f.PRIMARY_DARK_TEXT},this.getFormattedTotal()))),(this.trialPeriodDays||this.hasDebitDay())&&i("div",{key:"bb8305da72fe5f3a93f9350f1c60058d32734e21",class:"success-page__card-divider"}),(this.hasFreeTrial()||this.hasDebitDay())&&i("div",{key:"cb25a584c12fe4540c94e0d6c6256e54d3521f4e",class:"next-charge-section"},i("div",{key:"0e3a9c7d5b719f09476a1f44c783144f28169a85",class:"next-charge-header"},i("rebill-typography",{key:"4651348020cfbfaf44e70ea381a07f363a0a991a",variant:"subtitle-bold",color:f.PRIMARY_DARK_TEXT},n.translate("processing.nextCharge")),i("rebill-typography",{key:"a42507762f10f315c17a033dab4648f37eb46706",variant:"subtitle-bold",color:f.PRIMARY_DARK_TEXT},n.translate("processing.onDate",{date:this.hasFreeTrial()?this.getTrialEndDateFormatted():this.getDebitDateFormatted()}))),i("div",{key:"073b8086746ac54925028f40dcb6cc0388dc29d5",class:"success-page__card-row"},i("rebill-typography",{key:"f678239b390132e31e1a1992ce61899253ff7063",variant:"body2",color:f.PRIMARY_DARK_TEXT},this.hasFreeTrial()?n.translate("processing.atEndOfTrial"):""),i("rebill-typography",{key:"e3f59ea087b8fc704ae12b124e23835dee0f2e06",variant:"body2",color:f.PRIMARY_DARK_TEXT},this.getFormattedSubtotal(this.planAmount)," ",n.translate("processing.perMonth")))),i("div",{key:"7da44a91e541f2cad30c231165dfeb93a6fd5f4c",class:"success-page__card-divider"}),i("div",{key:"e0a328dd5e648474b89799c18083194c0f2ca4a8",class:"download-container"},i("svg",{key:"fbcbca40ea633f280a02307e356198d9cfe0d629",class:"download-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{key:"a1c03674854d117ea948858b0994eddacdadde0b",d:"M13.498 9.83333V12.1667C13.498 12.903 12.9011 13.5 12.1647 13.5H3.83138C3.095 13.5 2.49805 12.903 2.49805 12.1667V9.83333M7.99804 10V2.5M7.99804 10L5.66471 7.66667M7.99804 10L10.3314 7.66667",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})),i("rebill-button",{key:"434daabf2474882e211250ee56d03ed2a496adaf",type:"button",variant:"download",size:"small",onClick:this.handleDownloadReceipt},i("rebill-typography",{key:"b64910c30d0f64d83cac260a97409ce5a482176d",variant:"overline",color:f.PRIMARY_DARK_TEXT},n.translate("processing.download")))),i("div",{key:"2c2f930b614ac9194f7f496c1226ba724eb8c331",class:"contact-info"},i("rebill-typography",{key:"ffa8eb7284f57679d5e9725393c650c112680b98",variant:"information-text",color:f.SECONDARY},n.translate("processing.downloadDescription"))))))}};P.style=I;const B=":host{display:block}.inputs-container{display:flex;flex-direction:column;gap:16px;width:100%}.customer-exists{display:flex;justify-content:flex-end;margin-bottom:16px}";const A=class{constructor(i){e(this,i);this.onRebillAccountClick=a(this,"onRebillAccountClick")}userInformation={email:"",fullName:"",countryCode:""};errors=null;customerExists=false;disabled=false;onRebillAccountClick;translateError(e){if(!e)return"";if(e.includes("validation.")||e.includes("paymentErrors.")){return n.translate(e)}return e}handleInputChange(e){if(!e.detail)return;const{id:a,value:i}=e.detail;s.setUserInformation({[a]:i})}handleBlur(e){if(!e.detail)return;const{id:a,value:i}=e.detail;s.setUserInformation({[a]:i})}getCardLabels(){const e=[];if(l.data.prefilledData.email){e.push({label:n.translate("userInformation.emailPlaceholder"),value:l.data.prefilledData.email});s.setUserInformation({...l.data.userInformation,email:l.data.prefilledData.email})}if(l.data.prefilledData.fullName){e.push({label:n.translate("userInformation.fullNamePlaceholder"),value:l.data.prefilledData.fullName});s.setUserInformation({...l.data.userInformation,fullName:l.data.prefilledData.fullName})}return e}async handleRebillAccountClick(){r.otp.generate(l.data.sessionId,{email:l.data.userInformation.email});this.onRebillAccountClick.emit(true)}renderInputs(){const e=l.data.prefilledData.email;const a=l.data.prefilledData.fullName;const t=[];if(!e){t.push(i("rebill-input-text",{id:"email",variant:"floating",label:n.translate("userInformation.emailPlaceholder"),placeholder:n.translate("userInformation.emailPlaceholder"),"left-icon":"email",clearable:true,disabled:this.disabled,error:this.translateError(this.errors?.email)}))}if(!a){t.push(i("rebill-input-text",{id:"fullName",variant:"floating",label:n.translate("userInformation.fullNamePlaceholder"),placeholder:n.translate("userInformation.fullNamePlaceholder"),disabled:this.disabled,error:this.translateError(this.errors?.fullName)}))}return t.length>0?i("div",{class:"inputs-container",style:{marginTop:t.length>0&&(e||a)?"1rem":"0"}},t):null}render(){const e=i("div",{key:"46bb2f98219e56c8723289e3348514c4f27b4a53",class:"customer-exists"},i("rebill-button",{key:"eb6f81a732df9ef04a4c278588cd57998cbb6c25",style:{visibility:this.customerExists?"visible":"hidden",opacity:this.customerExists?"1":"0",transition:"opacity 0.3s ease-in-out"},variant:"text",size:"small",onClick:()=>this.handleRebillAccountClick(),icon:"lock"},n.translate("userInformation.rebillAccount"),i("rebill-icon",{key:"d270f5d5f8e2fecb9a6b39d439172c99233cc86d",name:"arrow-right"})));const a=l.data.prefilledData.email;const t=l.data.prefilledData.fullName;const r=a||t;return i(o,{key:"97e0d4dd9b6d3c798eee919274d4ed9be854319d"},e,r&&i("rebill-card",{key:"18f3d53e0386be0b4dff09bcfdcf69885d0093e7",cardTitle:n.translate("userInformation.personalInformation"),cardLabels:this.getCardLabels()}),this.renderInputs())}};A.style=B;export{T as otp_component,M as rebill_modal_overlay,z as rebill_mode_sandbox_mobile,P as success_page,A as user_information};
|
|
2
|
+
//# sourceMappingURL=p-a780e6e8.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["otpCss","Otp","changeEmailClick","timeLeft","isTimerRunning","codeResent","isVerifying","otpValue","returnForm","codeVerified","error","timer","createCountdownTimer","duration","onTick","this","onComplete","messageTimer","disconnectedCallback","stop","startTimer","start","handleResendCode","async","api","otp","generate","sessionState","data","sessionId","email","userInformation","handleOtpChange","value","length","handleVerifyOtp","response","verify","code","emit","SessionStore","setUserInformation","customer","fullName","firstName","lastName","trim","phoneNumber","number","phoneNumbers","countryCode","address","billingAddress","addresses","lineOne","zip","zipCode","city","state","country","documentType","identifications","type","documentNumber","setAccessToken","accessToken","setCustomerId","id","render","h","key","class","variant","I18nService","translate","prefilledData","onClick","onOtpChange","event","detail","color","COLORS_ENUM","PRIMARY","theme","disabled","size","style","height","marginBottom","getFormattedTime","GREEN","name","message","icon","alertTitle","colorIcon","PRIMARY_DARK_LIGHT","PRIMARY_DARK","modalOverlayCss","ModalOverlay","visible","languageUpdateTrigger","unsubscribeCurrentLocaleStore","componentDidLoad","onChange","closeModal","ORANGE","modeSandboxMobileCss","RebillTestModeChipMobile","isPanelVisible","currentLanguage","getCurrentLanguage","componentWillLoad","i18n","on","handleLanguageChange","off","togglePanel","handleCopy","text","copyToClipboard","handleDocsClick","window","open","renderBasicChip","renderCardsPanel","GREY_700","ERROR","successPageCss","CardSuccessPage","typePaymentMethod","PAYMENT_METHOD_ENUM","CARD","bank","paymentMethodName","cardLastFour","paymentDate","referenceNumber","trialPeriodDays","debitDay","planAmount","currentLocale","breakpoint","BREAKPOINT_ENUM","DESKTOP","successRedirect","loaderProgress","isLoadingLottie","showRedirectMessage","timeToRedirect","progressInterval","lottieContainer","lottieAnimation","successDisplayTimeout","applyStartCaseToBrand","brand","toLowerCase","split","map","word","charAt","toUpperCase","slice","join","getPaymentDate","payment","createdAt","getBreakpoint","innerWidth","itemInformation","redirectSuccess","setTimeout","loadLottieAnimation","redirectUrl","stopLoaderAnimation","addEventListener","handleResize","clearTimeout","removeEventListener","lottie","import","then","n","l","animationData","fetch","getAssetURL","animationJson","json","default","loadAnimation","container","renderer","loop","autoplay","startLoaderAnimation","interval","increment","setInterval","Math","min","clearInterval","undefined","destroy","handleDownloadReceipt","PDFGenerator","generateAndDownloadReceipt","paymentMethod","textPaymentMethodCard","BANK_TRANSFER","cardBrand","cardInformation","lastFour","formatDateTime","productTitle","title","subtotal","getFormattedSubtotal","total","getFormattedTotal","currency","pricing","installments","selectedInstallment","getInstallmentLabelSummary","installment","getRecalculatedInstallmentAmount","installmentAmount","cft","model","find","ENUM_INSTALLMENT_MODEL","CUSTOMER_FINANCED","discountAmount","getFormattedDiscountAmount","trial","trialEndDate","hasFreeTrial","getTrialEndDateFormatted","debitDate","hasDebitDay","getDebitDateFormatted","isBankTransfer","console","formattedAmount","formatAmount","SESSION_ITEM_TYPE_ENUM","PLAN","trialEndsAt","trialPeriodEndsAt","date","Date","locale","toLocaleDateString","month","getDate","today","targetDate","setMonth","getMonth","setDate","formattedBrand","hasRedirect","PRIMARY_DARK_TEXT","ref","el","width","isBreakpointBelow","viewBox","fill","xmlns","d","SECONDARY","Fragment","display","alignItems","gap","getPaymentMethodDisplayName","flexDirection","textAlign","align","GREEN_TEXT","days","count","stroke","userInformationCss","UserInformation","errors","customerExists","onRebillAccountClick","translateError","errorKey","includes","handleInputChange","handleBlur","getCardLabels","labels","push","label","handleRebillAccountClick","renderInputs","hasPrefilledEmail","hasPrefilledName","inputs","placeholder","clearable","marginTop","customerExistsButton","visibility","opacity","transition","hasAnyPrefilled","Host","cardTitle","cardLabels"],"sources":["src/components/checkout/otp/otp.css?tag=otp-component","src/components/checkout/otp/otp.tsx","src/components/shared/modal-overlay/modal-overlay.css?tag=rebill-modal-overlay","src/components/shared/modal-overlay/modal-overlay.tsx","src/components/shared/mode-sandbox/mode-sandbox-mobile.css?tag=rebill-mode-sandbox-mobile","src/components/shared/mode-sandbox/mode-sandbox-mobile.tsx","src/components/checkout/card-success-page/success-page.css?tag=success-page","src/components/checkout/card-success-page/success-page.tsx","src/components/checkout/user-information/user-information.css?tag=user-information","src/components/checkout/user-information/user-information.tsx"],"sourcesContent":[".otp__otp-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n width: 100%;\n position: relative;\n margin-top: 2rem;\n}\n\n.otp__user-information {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n}\n\n.otp__otp-description-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 4px;\n}\n.otp__change-email {\n cursor: pointer;\n text-decoration: underline;\n margin-left: 0;\n}\n\n.otp__change-email:hover {\n color: var(--rebill-primary-color);\n text-decoration: underline;\n}\n\n.otp__alternative {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 16px;\n margin: 32px;\n width: 100%;\n}\n\n.otp__rebill-alert {\n width: 100%;\n}\n\n.otp__guest-options {\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n margin-top: auto;\n}\n\n.otp__verifying-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n margin: 8px 0;\n}\n\n.otp__code-resent-container rebill-typography {\n display: flex;\n line-height: 1;\n}\n\n.otp__code-resent-container rebill-icon {\n flex-shrink: 0;\n display: inline-flex;\n vertical-align: middle;\n margin-right: 8px;\n}\n\n.otp__spinner {\n width: 15px;\n height: 15px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-radius: 50%;\n border-top-color: var(--rebill-color-primary);\n animation: spin 1s linear infinite;\n display: inline-block;\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Responsive adjustments */\n@media (max-width: 1024px) {\n .otp__otp-container {\n min-height: calc(100vh - 40px);\n }\n\n .otp__guest-options {\n margin-top: 32px;\n }\n}\n\n@media (min-width: 1025px) {\n .otp__otp-container {\n justify-content: flex-start;\n }\n\n .otp__guest-options {\n margin-top: auto;\n padding-bottom: 2rem;\n }\n}\n","import { Component, Event, EventEmitter, h, State } from '@stencil/core';\nimport { api } from '../../../api';\nimport { OTPVerifyResponse } from '../../../api/entities/OTP/types';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { sessionState, SessionStore } from '../../../store/session.store';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\nimport { createCountdownTimer } from '../../../utils/timer';\n\n@Component({\n tag: 'otp-component',\n styleUrl: 'otp.css',\n shadow: false,\n})\nexport class Otp {\n @Event() changeEmailClick: EventEmitter<void>;\n @State() timeLeft: number = 59;\n @State() isTimerRunning: boolean = false;\n @State() codeResent: boolean = false;\n @State() isVerifying: boolean = false;\n @State() otpValue: string = '';\n @Event() returnForm: EventEmitter<boolean>;\n @Event() codeVerified: EventEmitter<OTPVerifyResponse>;\n @State() error: boolean = false;\n\n private timer = createCountdownTimer({\n duration: 59,\n onTick: timeLeft => {\n this.timeLeft = timeLeft;\n },\n onComplete: () => {\n this.isTimerRunning = false;\n },\n });\n\n private messageTimer = createCountdownTimer({\n duration: 5,\n onComplete: () => {\n this.codeResent = false;\n },\n });\n\n disconnectedCallback() {\n this.timer.stop();\n }\n\n startTimer() {\n this.timer.start();\n this.isTimerRunning = true;\n }\n\n handleResendCode = async () => {\n if (!this.isTimerRunning) {\n await api.otp.generate(sessionState.data.sessionId, {\n email: sessionState.data.userInformation.email,\n });\n this.codeResent = true;\n this.messageTimer.start();\n this.startTimer();\n\n this.error = false;\n }\n };\n\n handleOtpChange = (value: string) => {\n this.otpValue = value;\n\n if (value.length === 6) {\n this.handleVerifyOtp(value);\n this.error = false;\n }\n };\n\n handleVerifyOtp = async (otp: string) => {\n this.isVerifying = true;\n try {\n const response = await api.otp.verify(sessionState.data.sessionId, {\n email: sessionState.data.userInformation.email,\n code: otp,\n });\n\n this.codeVerified.emit(response.data);\n SessionStore.setUserInformation({\n ...response.data.customer,\n fullName: `${response.data.customer.firstName} ${response.data.customer.lastName}`.trim(),\n phoneNumber: {\n number: response.data.customer.phoneNumbers[0].number,\n countryCode: response.data.customer.phoneNumbers[0].countryCode,\n },\n address: {\n billingAddress: {\n address: response.data.customer.addresses[0].lineOne,\n zip: response.data.customer.addresses[0].zipCode,\n city: response.data.customer.addresses[0].city,\n state: response.data.customer.addresses[0].state,\n country: response.data.customer.addresses[0].country,\n },\n },\n documentType: response.data.customer.identifications[0].type,\n documentNumber: response.data.customer.identifications[0].value,\n });\n SessionStore.setAccessToken(response.data.accessToken);\n SessionStore.setCustomerId(response.data.customer.id);\n this.otpValue = '';\n this.error = false;\n } catch (error) {\n this.error = true;\n } finally {\n this.isVerifying = false;\n }\n };\n\n render() {\n return (\n <div class=\"otp__otp-container\">\n <div class=\"otp__user-information\">\n <div class=\"otp__otp-description-container\">\n <rebill-typography variant=\"body2\" class=\"otp__otp-description\">\n {I18nService.translate('otp.description')}\n </rebill-typography>\n <rebill-typography variant=\"subtitle-bold\" class=\"otp__otp-description-digits\">\n {' '}\n <strong>{I18nService.translate('otp.descriptionDigits')}</strong>{' '}\n </rebill-typography>\n <rebill-typography variant=\"body2\" class=\"otp__otp-description-email\">\n {I18nService.translate('otp.descriptionEmail')}\n </rebill-typography>\n </div>\n <rebill-typography variant=\"body2\" class=\"otp__otp-email-line\">\n {sessionState.data.userInformation.email}{' '}\n {!sessionState.data.prefilledData?.email && (\n <span\n class=\"otp__change-email\"\n onClick={() => {\n this.otpValue = '';\n this.error = false;\n this.returnForm.emit(false);\n }}\n >\n {I18nService.translate('otp.change')}\n </span>\n )}\n </rebill-typography>\n </div>\n <input-otp\n otp={this.otpValue}\n onOtpChange={event => this.handleOtpChange(event.detail)}\n error={this.error ? I18nService.translate('otp.error') : ''}\n />\n\n {this.isVerifying && (\n <div class=\"otp__verifying-container\">\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY}>\n {I18nService.translate('otp.verifyingCode')}\n </rebill-typography>\n <div class=\"otp__spinner\"></div>\n </div>\n )}\n <rebill-button\n type=\"button\"\n variant=\"outline\"\n theme={this.isTimerRunning ? 'secondary' : 'primary'}\n disabled={this.isTimerRunning}\n onClick={this.handleResendCode}\n size=\"small\"\n style={{ height: '24px', marginBottom: '8px' }}\n >\n {this.isTimerRunning\n ? `${I18nService.translate('otp.resendCodeIn')} (${this.timer.getFormattedTime()})`\n : I18nService.translate('otp.resendCode')}\n </rebill-button>\n\n {this.codeResent && (\n <div class=\"otp__code-resent-container\">\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.GREEN}>\n <rebill-icon name=\"check-radio\" />\n {I18nService.translate('otp.codeResent')}\n </rebill-typography>\n </div>\n )}\n <rebill-alert\n class=\"otp__rebill-alert\"\n type=\"secure\"\n variant=\"variant-info\"\n message={I18nService.translate('otp.infoMessage')}\n icon=\"circle-info\"\n alertTitle={I18nService.translate('otp.infoTitle')}\n colorIcon={COLORS_ENUM.PRIMARY_DARK_LIGHT}\n />\n <div class=\"otp__alternative\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK}>\n o\n </rebill-typography>\n </div>\n <div class=\"otp__guest-options\">\n <rebill-button\n type=\"button\"\n variant=\"outline\"\n theme=\"secondary\"\n size=\"medium\"\n onClick={() => {\n this.otpValue = '';\n this.error = false;\n this.returnForm.emit(false);\n }}\n >\n {I18nService.translate('otp.continueAsGuest')}\n </rebill-button>\n\n <rebill-alert\n type=\"secure\"\n variant=\"variant-secure\"\n icon=\"lock-outline\"\n message={I18nService.translate('otp.secureMessage')}\n />\n </div>\n </div>\n );\n }\n}\n",".modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n background-color: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 12px 16px;\n box-sizing: border-box;\n}\n\n.modal-content {\n background: white;\n border-radius: 8px;\n padding: 16px 20px;\n width: 350px;\n box-shadow:\n 0 4px 12px -2px rgba(0, 0, 0, 0.15),\n 0 2px 4px -1px rgba(0, 0, 0, 0.1);\n position: relative;\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.modal-content .alert {\n margin: 0;\n flex: 1;\n padding: 0;\n background: transparent;\n border: none;\n box-shadow: none;\n}\n\n/* Override para quitar cualquier color de fondo del modal */\n.modal-content .alert {\n background-color: transparent !important;\n border-color: transparent !important;\n}\n\n.modal-content .alert-message {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.modal-content .close-button {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 20px;\n height: 20px;\n border: none;\n background: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n transition: background-color 0.2s ease;\n padding: 0;\n margin: 0;\n outline: none;\n box-shadow: none;\n line-height: 1;\n}\n\n.modal-content .close-button:focus {\n outline: none;\n box-shadow: none;\n}\n\n.modal-content .close-button:hover {\n background-color: #f0f0f0;\n}\n\n.modal-content .close-button rebill-icon {\n width: 16px;\n height: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n@media (max-width: 768px) {\n .modal-overlay {\n padding: 8px 12px;\n }\n\n .modal-content {\n padding: 12px 16px;\n flex-direction: column;\n gap: 8px;\n text-align: center;\n }\n\n .modal-content .close-button {\n width: 100%;\n }\n}\n","import { Component, h, State } from '@stencil/core';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { SessionStore } from '../../../store/session.store';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\n\n@Component({\n tag: 'rebill-modal-overlay',\n styleUrl: 'modal-overlay.css',\n shadow: false,\n})\nexport class ModalOverlay {\n @State() visible: boolean = true;\n @State() languageUpdateTrigger: number = 0;\n private unsubscribeCurrentLocaleStore?: () => void;\n\n componentDidLoad() {\n this.unsubscribeCurrentLocaleStore = SessionStore.onChange('currentLocale', () => {\n this.languageUpdateTrigger++;\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribeCurrentLocaleStore) {\n this.unsubscribeCurrentLocaleStore();\n }\n }\n\n private closeModal = () => {\n this.visible = false;\n };\n\n render() {\n if (!this.visible) return null;\n\n return (\n <div class=\"modal-overlay\">\n <div class=\"modal-content\">\n <div class=\"alert info filled medium\">\n <div class=\"alert-icon\">\n <rebill-icon name=\"circle-info\" size=\"16px\" color={COLORS_ENUM.ORANGE} />\n </div>\n <div class=\"alert-message\">\n <div class=\"alert-title\">\n <rebill-typography variant=\"subtitle-bold\" color={COLORS_ENUM.PRIMARY_DARK}>\n {I18nService.translate('session.refreshedTitle')}\n </rebill-typography>\n </div>\n <div class=\"alert-message-text\">\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n {I18nService.translate('session.refreshedMessage')}\n </rebill-typography>\n </div>\n </div>\n </div>\n <button onClick={this.closeModal} class=\"close-button\" type=\"button\">\n <rebill-icon name=\"close\" size=\"20px\" />\n </button>\n </div>\n </div>\n );\n }\n}\n",":host {\n display: flex;\n position: relative;\n width: 100%;\n justify-content: center;\n align-items: center;\n}\n\n.mode-sandbox-mobile__test-mode-container {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 8px;\n width: 100%;\n}\n\n.mode-sandbox-mobile__overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 5;\n animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n pointer-events: auto;\n cursor: pointer;\n}\n\n.mode-sandbox-mobile__test-mode-chip-mobile {\n display: flex;\n width: 100%;\n min-width: auto;\n max-width: 100%;\n height: 40px;\n background: #ffffff;\n border: 1px solid #e5e7eb;\n border-radius: 20px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n overflow: hidden;\n position: relative;\n z-index: 20;\n}\n\n.mode-sandbox-mobile__chip-content-mobile {\n display: flex;\n align-items: center;\n gap: 2px;\n justify-content: flex-end;\n min-height: 24px;\n flex-shrink: 0;\n width: 100%;\n margin: 8px;\n}\n\n.mode-sandbox-mobile__info-icon {\n display: flex;\n align-items: center;\n}\n\n.mode-sandbox-mobile__test-mode-chip-mobile.expanded .mode-sandbox-mobile__chip-content-mobile {\n justify-content: flex-end;\n width: 100%;\n}\n\n.mode-sandbox-mobile__cards-dropdown-panel-header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px;\n}\n\n/* Sección de Docs */\n.mode-sandbox-mobile__docs-section {\n display: flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n margin-left: 0;\n transition: background-color 0.2s ease;\n justify-content: flex-end;\n padding: 8px;\n margin-top: 8px;\n}\n\n.mode-sandbox-mobile__cards-dropdown-panel {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n width: 100%;\n background: #ffffff;\n border-top: none;\n border-left: 1px solid #e5e7eb;\n border-right: 1px solid #e5e7eb;\n border-bottom: 1px solid #e5e7eb;\n margin-top: 16px;\n z-index: 25;\n animation: expandDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n transform-origin: top center;\n}\n\n.mode-sandbox-mobile__card-section {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n\n.mode-sandbox-mobile__header-content {\n display: flex;\n align-items: center;\n gap: 8px;\n margin: 8px;\n}\n\n.mode-sandbox-mobile__card-details {\n background: #fafafa;\n border-radius: 8px;\n border: 1px solid #e5e7eb;\n margin: 8px;\n min-height: 208px;\n display: flex;\n flex-direction: column;\n}\n\n.mode-sandbox-mobile__card-row {\n display: flex;\n gap: 12px;\n align-items: stretch;\n background: #ffffff;\n justify-content: space-around;\n border-radius: 8px;\n border: 1px solid #e5e7eb;\n height: auto;\n padding: 8px;\n margin: 8px;\n}\n\n.mode-sandbox-mobile__card-value {\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n}\n\n.mode-sandbox-mobile__field-value {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n max-height: 20px;\n}\n\n.mode-sandbox-mobile__copy-button {\n align-items: center;\n margin-left: auto;\n margin-right: 0;\n}\n\n.mode-sandbox-mobile__icon-button {\n margin-left: auto;\n margin-right: 16px;\n}\n\n/* Animaciones */\n\n@keyframes expandDown {\n from {\n opacity: 0;\n transform: translateY(-10px) scaleY(0.9);\n }\n to {\n opacity: 1;\n transform: translateY(0) scaleY(1);\n }\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n","import { Component, Element, h, State } from '@stencil/core';\nimport i18n from '../../../i18n/i18n.config';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { copyToClipboard } from '../../../utils/clipboard';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\n\n@Component({\n tag: 'rebill-mode-sandbox-mobile',\n styleUrl: 'mode-sandbox-mobile.css',\n shadow: false,\n})\nexport class RebillTestModeChipMobile {\n @Element() el: HTMLElement;\n @State() isPanelVisible = false;\n @State() currentLanguage: string = I18nService.getCurrentLanguage();\n\n componentWillLoad() {\n i18n.on('languageChanged', this.handleLanguageChange);\n }\n\n disconnectedCallback() {\n i18n.off('languageChanged', this.handleLanguageChange);\n }\n\n private handleLanguageChange = () => {\n this.currentLanguage = I18nService.getCurrentLanguage();\n };\n\n private togglePanel = () => {\n this.isPanelVisible = !this.isPanelVisible;\n };\n\n private handleCopy = (text: string) => {\n copyToClipboard(text);\n this.isPanelVisible = false;\n };\n\n private handleDocsClick = () => {\n window.open('https://v3.docs.rebill.com/sdk/checkout', '_blank');\n };\n\n private renderBasicChip() {\n return (\n <div class=\"mode-sandbox-mobile__chip-content-mobile\">\n <div class=\"mode-sandbox-mobile__info-icon\">\n <rebill-icon name=\"circle-info\" size=\"24px\" color={COLORS_ENUM.ORANGE} />\n </div>\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n {I18nService.translate('sandbox.testMode')}\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__icon-button\">\n <rebill-button variant=\"text\" size=\"small\" onClick={this.togglePanel}>\n <rebill-icon name=\"hamburger\" />\n </rebill-button>\n </div>\n </div>\n );\n }\n\n private renderCardsPanel() {\n return (\n <div class=\"mode-sandbox-mobile__cards-dropdown-panel\">\n <div class=\"mode-sandbox-mobile__cards-dropdown-panel-header\">\n <rebill-icon name=\"card-test\" />\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n {I18nService.translate('sandbox.cardTest')}\n </rebill-typography>\n </div>\n <div class=\"mode-sandbox-mobile__card-details\">\n <div class=\"mode-sandbox-mobile__card-section\">\n <div class=\"mode-sandbox-mobile__header-content\">\n <rebill-icon name=\"succes\" color={COLORS_ENUM.GREEN} />\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n {I18nService.translate('sandbox.successPayment')}\n </rebill-typography>\n </div>\n <div class=\"mode-sandbox-mobile__card-row\">\n <div class=\"mode-sandbox-mobile__card-value\">\n <rebill-typography variant=\"subtitle3\" color={COLORS_ENUM.GREY_700}>\n {I18nService.translate('sandbox.cardNumber')}\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__field-value\">\n <rebill-icon name=\"visa\" />\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n 4539148803436467\n </rebill-typography>\n </div>\n </div>\n <div class=\"mode-sandbox-mobile__card-value\">\n <rebill-typography variant=\"subtitle3\" color={COLORS_ENUM.GREY_700}>\n {I18nService.translate('sandbox.exp')}\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__field-value\">\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n 01/99\n </rebill-typography>\n </div>\n </div>\n <div class=\"mode-sandbox-mobile__card-value\">\n <rebill-typography variant=\"subtitle3\" color={COLORS_ENUM.GREY_700}>\n {I18nService.translate('sandbox.cvv')}\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy\">\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n 123\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__copy-button\">\n <rebill-button\n variant=\"text\"\n size=\"small\"\n onClick={() => this.handleCopy('4539148803436467 01/99 123')}\n >\n <rebill-icon name=\"copy\" />\n </rebill-button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mode-sandbox-mobile__card-section\">\n <div class=\"mode-sandbox-mobile__header-content\">\n <rebill-icon name=\"rejected\" color={COLORS_ENUM.ERROR} />\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n {I18nService.translate('sandbox.rejectedPayment')}\n </rebill-typography>\n </div>\n <div class=\"mode-sandbox-mobile__card-row\">\n <div class=\"mode-sandbox-mobile__card-value\">\n <rebill-typography variant=\"subtitle3\" color={COLORS_ENUM.GREY_700}>\n {I18nService.translate('sandbox.cardNumber')}\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__field-value\">\n <rebill-icon name=\"visa\" />\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n 4485364739527352\n </rebill-typography>\n </div>\n </div>\n <div class=\"mode-sandbox-mobile__card-value\">\n <rebill-typography variant=\"subtitle3\" color={COLORS_ENUM.GREY_700}>\n {I18nService.translate('sandbox.exp')}\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__field-value\">\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n 01/99\n </rebill-typography>\n </div>\n </div>\n <div class=\"mode-sandbox-mobile__card-value\">\n <rebill-typography variant=\"subtitle3\" color={COLORS_ENUM.GREY_700}>\n {I18nService.translate('sandbox.cvv')}\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy\">\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY_DARK}>\n 123\n </rebill-typography>\n <div class=\"mode-sandbox-mobile__copy-button\">\n <rebill-button\n variant=\"text\"\n size=\"small\"\n onClick={() => this.handleCopy('4485364739527352 01/99 123')}\n >\n <rebill-icon name=\"copy\" />\n </rebill-button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"mode-sandbox-mobile__docs-section\" onClick={this.handleDocsClick}>\n <rebill-typography variant=\"subtitle2\" color={COLORS_ENUM.PRIMARY}>\n {I18nService.translate('sandbox.docs')}\n </rebill-typography>\n <rebill-icon name=\"external-link\" />\n </div>\n </div>\n );\n }\n\n render() {\n return (\n <div\n class={`mode-sandbox-mobile__test-mode-container ${this.isPanelVisible ? 'cards-visible' : ''}`}\n >\n {this.isPanelVisible && <div class=\"mode-sandbox-mobile__overlay\"></div>}\n <div\n class={`mode-sandbox-mobile__test-mode-chip-mobile ${this.isPanelVisible ? 'expanded' : ''}`}\n >\n {this.renderBasicChip()}\n </div>\n {this.isPanelVisible && this.renderCardsPanel()}\n </div>\n );\n }\n}\n","@import '../../../styles/variables.css';\n\n/* Text Content */\n.text-content {\n margin-bottom: 2rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n}\n\n/* Success View Styles */\n.success-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n width: 100%;\n overflow-x: hidden;\n box-sizing: border-box;\n}\n.lottie-container {\n width: 80px;\n height: 80px;\n}\n/* Eliminar márgenes del h3 en el componente de éxito */\n.success-content rebill-typography[variant='h3'] {\n margin: 0 !important;\n padding: 0 !important;\n}\n\n.success-icon {\n display: flex;\n justify-content: center;\n margin: 0.5rem 0;\n}\n\n/* Info Cards */\n.success-page__info-card {\n padding: 24px;\n gap: 16px;\n width: 100%;\n max-width: 450px;\n border: 1px solid #ebedef;\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n\n.success-page__card-row {\n display: flex;\n justify-content: space-between;\n align-items: start;\n min-height: 20px;\n gap: 15%;\n}\n\n.success-page__card-row:last-of-type {\n margin-bottom: 0;\n}\n\n.success-page__card-value {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.payment-method-display {\n display: flex;\n align-items: center;\n gap: 8px;\n justify-content: center;\n}\n\n.payment-method-display rebill-card-icon {\n display: inline-block;\n flex-shrink: 0;\n margin-right: 8px;\n vertical-align: middle;\n}\n\n.payment-method-display rebill-card-icon svg {\n display: block;\n}\n\n.payment-method-display rebill-icon {\n display: inline-block;\n vertical-align: middle;\n margin-right: 8px;\n}\n\n.payment-method-display rebill-icon div {\n display: block;\n}\n\n.success-page__card-divider {\n height: 1px;\n background: #e5e7eb;\n}\n\n.download-container {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 2px;\n text-decoration: none;\n cursor: pointer;\n}\n\n.contact-info {\n text-align: left;\n}\n\n.reference-number {\n word-break: break-all;\n overflow-wrap: break-word;\n hyphens: auto;\n max-width: 100%;\n text-align: right;\n}\n\n.total-amount-container {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n flex-direction: row;\n}\n\n.trial-pill {\n background-color: var(--rebill-color-green-light-2);\n border-radius: 4px;\n padding: 4px 6px 4px 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.next-charge-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 12px;\n}\n\n.next-charge-details {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n}\n\n.next-charge-amount {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n}\n\n.next-charge-date {\n text-align: right;\n}\n\n/* Responsive Styles */\n@media (max-width: 1024px) {\n .success-content {\n max-width: 100%;\n gap: 1.5rem;\n margin-left: 16px;\n margin-right: 16px;\n }\n\n .success-page__info-card {\n width: 100%;\n max-width: 100%;\n padding: 12px;\n }\n .text-content {\n gap: 12px;\n }\n}\n\n@media (max-width: 767px) {\n .success-page__info-card {\n padding: 12px;\n }\n\n .processing-container {\n padding: 0 16px;\n }\n}\n","import { Component, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { ENUM_INSTALLMENT_MODEL } from '../../../models/enums/installment.enum';\nimport { PAYMENT_METHOD_ENUM } from '../../../models/enums/payment-methods.enum';\nimport { SESSION_ITEM_TYPE_ENUM } from '../../../models/enums/session.enum';\nimport { sessionState, SessionStore } from '../../../store/session.store';\nimport { formatDateTime } from '../../../utils';\nimport { getAssetURL } from '../../../utils/assets';\nimport { BREAKPOINT_ENUM, getBreakpoint, isBreakpointBelow } from '../../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\nimport { formatAmount } from '../../../utils/currency-formatter';\nimport { getPaymentMethodDisplayName } from '../../../utils/get-payment-method-display-name';\nimport {\n getInstallmentLabelSummary,\n getRecalculatedInstallmentAmount,\n} from '../../../utils/installment-utils';\nimport { PDFGenerator } from '../../../utils/pdf-generator';\n\n@Component({\n tag: 'success-page',\n styleUrl: 'success-page.css',\n shadow: false,\n})\nexport class CardSuccessPage {\n @Prop() typePaymentMethod: PAYMENT_METHOD_ENUM = PAYMENT_METHOD_ENUM.CARD;\n @Prop() country?: string = '';\n @Prop() bank?: string = '';\n @Prop() paymentMethodName?: string = '';\n @Prop() cardLastFour?: string = '';\n @Prop() paymentDate: string = '';\n @Prop() referenceNumber: string = '';\n @Prop() trialPeriodDays?: number = 0;\n @Prop() debitDay?: number = 0;\n @Prop() planAmount?: number = 0;\n @State() currentLocale: string = sessionState.currentLocale;\n @State() breakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n\n @Event() successRedirect: EventEmitter<any>;\n @State() loaderProgress: number = 0;\n @State() isLoadingLottie: boolean = true;\n @State() showRedirectMessage: boolean = false;\n @Prop() timeToRedirect: number = 3000;\n private progressInterval?: number;\n private lottieContainer?: HTMLElement;\n private lottieAnimation?: any;\n private unsubscribeCurrentLocaleStore?: () => void;\n private successDisplayTimeout?: number;\n\n private applyStartCaseToBrand = (brand: string): string => {\n if (!brand) return '';\n\n return brand\n .toLowerCase()\n .split(/[\\s-]+/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n };\n\n private getPaymentDate = (): string => {\n const payment = sessionState?.data?.payment;\n if (!payment) return '';\n\n if ('createdAt' in payment) {\n return payment.createdAt;\n }\n\n return '';\n };\n\n componentWillLoad() {\n this.breakpoint = getBreakpoint(window.innerWidth);\n this.unsubscribeCurrentLocaleStore = SessionStore.onChange('currentLocale', () => {\n this.currentLocale = sessionState.currentLocale;\n });\n\n if (sessionState.data?.itemInformation?.redirectSuccess) {\n this.successDisplayTimeout = window.setTimeout(() => {\n this.showRedirectMessage = true;\n this.loadLottieAnimation();\n }, 1500);\n\n setTimeout(() => {\n let redirectUrl = sessionState.data?.itemInformation?.redirectSuccess;\n if (redirectUrl) {\n this.successRedirect.emit({ redirectUrl });\n this.stopLoaderAnimation();\n }\n }, this.timeToRedirect);\n }\n }\n\n componentDidLoad() {\n window.addEventListener('resize', this.handleResize);\n if (!sessionState.data?.itemInformation?.redirectSuccess || this.showRedirectMessage) {\n this.loadLottieAnimation();\n }\n }\n\n disconnectedCallback() {\n if (this.unsubscribeCurrentLocaleStore) {\n this.unsubscribeCurrentLocaleStore();\n }\n if (this.successDisplayTimeout) {\n clearTimeout(this.successDisplayTimeout);\n }\n window.removeEventListener('resize', this.handleResize);\n this.stopLoaderAnimation();\n }\n\n private handleResize = () => {\n this.breakpoint = getBreakpoint(window.innerWidth);\n };\n private loadLottieAnimation = async () => {\n try {\n const lottie = await import('lottie-web');\n const animationData = await fetch(getAssetURL(`loader-redirect1.json`));\n const animationJson = await animationData.json();\n\n if (this.lottieContainer) {\n this.lottieAnimation = lottie.default.loadAnimation({\n container: this.lottieContainer,\n renderer: 'svg',\n loop: true,\n autoplay: true,\n animationData: animationJson,\n });\n } else {\n this.startLoaderAnimation();\n }\n } catch (error) {\n this.startLoaderAnimation();\n }\n };\n\n private startLoaderAnimation = () => {\n const duration = 3000;\n const interval = 50;\n const increment = (interval / duration) * 100;\n\n this.progressInterval = window.setInterval(() => {\n this.loaderProgress = Math.min(this.loaderProgress + increment, 100);\n if (this.loaderProgress >= 100) {\n this.stopLoaderAnimation();\n }\n }, interval);\n };\n\n private stopLoaderAnimation = () => {\n if (this.progressInterval) {\n clearInterval(this.progressInterval);\n this.progressInterval = undefined;\n }\n if (this.lottieAnimation) {\n this.lottieAnimation.destroy();\n this.lottieAnimation = undefined;\n }\n };\n\n private handleDownloadReceipt = async () => {\n try {\n await PDFGenerator.generateAndDownloadReceipt({\n paymentMethod:\n this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD\n ? this.textPaymentMethodCard()\n : this.paymentMethodName,\n ...(this.typePaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && { bank: this.bank }),\n ...(this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD && {\n cardBrand: this.applyStartCaseToBrand(sessionState.data.cardInformation?.brand || ''),\n }),\n ...(this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD && {\n cardLastFour: this.cardLastFour ?? sessionState.data.cardInformation?.lastFour,\n }),\n paymentDate: formatDateTime(this.getPaymentDate()) || '',\n email: sessionState?.data?.userInformation?.email || '',\n referenceNumber: this.referenceNumber,\n productTitle: sessionState?.data?.itemInformation?.title || '',\n subtotal: this.getFormattedSubtotal(),\n total: this.getFormattedTotal(),\n currency: sessionState?.data?.pricing?.currency || ' ',\n installments:\n sessionState?.data?.pricing?.installments &&\n sessionState?.data?.cardInformation?.installments?.selectedInstallment\n ? `${getInstallmentLabelSummary(\n sessionState.data?.cardInformation?.installments?.selectedInstallment?.installment,\n getRecalculatedInstallmentAmount(\n sessionState.data?.cardInformation?.installments?.selectedInstallment\n ?.installmentAmount || 0,\n ),\n sessionState.data?.pricing?.currency,\n sessionState.data?.cardInformation?.installments?.selectedInstallment?.cft,\n sessionState.data?.cardInformation?.installments?.selectedInstallment?.model,\n )}\\n( ${I18nService.translate('processing.purchaseTotal')}: ${this.getFormattedTotal()} )${\n sessionState.data.cardInformation?.installments?.installments.find(\n installment =>\n installment.installment ===\n sessionState.data.cardInformation?.installments?.selectedInstallment\n ?.installment,\n )?.model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED\n ? `\\n${I18nService.translate('installments.interest')}`\n : ''\n }`\n : '',\n discountAmount: this.getFormattedDiscountAmount(),\n trialPeriodDays:\n this.trialPeriodDays || sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n debitDay: this.debitDay || sessionState.data?.itemInformation?.debitDay,\n planAmount: this.getFormattedSubtotal(this.planAmount),\n trialEndDate: this.hasFreeTrial() ? this.getTrialEndDateFormatted() : undefined,\n debitDate: this.hasDebitDay() ? this.getDebitDateFormatted() : undefined,\n isBankTransfer: this.typePaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER,\n });\n } catch (error) {\n console.error('Error downloading receipt:', error);\n }\n };\n\n private getFormattedDiscountAmount = () => {\n if (sessionState?.data?.pricing?.discountAmount > 0) {\n const formattedAmount = formatAmount(\n sessionState.data?.pricing?.discountAmount,\n sessionState.data?.pricing?.currency,\n );\n return `-${formattedAmount}`;\n }\n return undefined;\n };\n\n private getFormattedSubtotal = (planAmount: number = 0 || null) => {\n return formatAmount(\n planAmount || sessionState?.data?.pricing?.subtotal,\n sessionState?.data?.pricing?.currency,\n );\n };\n\n private getFormattedTotal = () => {\n if (this.trialPeriodDays > 0) {\n return formatAmount(0, sessionState?.data?.pricing?.currency);\n }\n return formatAmount(sessionState?.data?.pricing?.total, sessionState?.data?.pricing?.currency);\n };\n\n private hasFreeTrial = () => {\n return (\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays > 0\n );\n };\n\n private hasDebitDay = () => {\n const debitDay = sessionState.data?.itemInformation?.debitDay;\n return debitDay && debitDay > 0;\n };\n\n private getTrialEndDateFormatted = () => {\n const trialEndsAt = sessionState.data?.itemInformation?.trial?.trialPeriodEndsAt;\n if (!trialEndsAt) return '';\n\n const date = new Date(trialEndsAt);\n const currentLanguage = I18nService.getCurrentLanguage();\n const locale =\n currentLanguage === 'es' ? 'es-ES' : currentLanguage === 'pt' ? 'pt-BR' : 'en-US';\n\n if (currentLanguage === 'en') {\n return `${date.toLocaleDateString(locale, { month: 'long' })} ${date.getDate()}`;\n } else {\n return `${date.getDate()} de ${date.toLocaleDateString(locale, { month: 'long' })}`;\n }\n };\n\n private getDebitDateFormatted = () => {\n const debitDay = sessionState.data?.itemInformation?.debitDay;\n if (!debitDay || debitDay <= 0) return '';\n\n const today = new Date();\n const targetDate = new Date(today);\n const currentLanguage = I18nService.getCurrentLanguage();\n const locale =\n currentLanguage === 'es' ? 'es-ES' : currentLanguage === 'pt' ? 'pt-BR' : 'en-US';\n if (debitDay < today.getDate()) {\n targetDate.setMonth(today.getMonth() + 1);\n }\n targetDate.setDate(debitDay);\n\n while (targetDate.getDate() !== debitDay) {\n targetDate.setDate(targetDate.getDate() - 1);\n }\n\n if (currentLanguage === 'en') {\n return `${targetDate.toLocaleDateString(locale, { month: 'long' })} ${targetDate.getDate()}`;\n } else {\n return `${targetDate.getDate()} de ${targetDate.toLocaleDateString(locale, { month: 'long' })}`;\n }\n };\n\n private textPaymentMethodCard = () => {\n const cardBrand = sessionState.data?.cardInformation?.brand;\n const cardLastFour = this.cardLastFour || sessionState?.data?.cardInformation?.lastFour;\n\n const formattedBrand = this.applyStartCaseToBrand(cardBrand || '');\n return cardBrand && cardLastFour ? `${formattedBrand} - ${cardLastFour}` : formattedBrand;\n };\n\n render() {\n const hasRedirect = sessionState.data?.itemInformation?.redirectSuccess;\n\n return (\n <rebill-checkout-single-column>\n <div class=\"success-content\">\n <rebill-typography variant=\"h3\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {hasRedirect && this.showRedirectMessage\n ? I18nService.translate('processing.redirectMessage')\n : I18nService.translate('processing.successTitle')}\n </rebill-typography>\n\n {hasRedirect && this.showRedirectMessage ? (\n <div class=\"redirect-message\">\n <div class=\"lottie-container\">\n <div ref={el => (this.lottieContainer = el)} class=\"lottie-animation\"></div>\n </div>\n </div>\n ) : (\n <div class=\"success-icon\">\n <svg\n width={isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) ? '64' : '96'}\n height={isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) ? '64' : '96'}\n viewBox=\"0 0 96 96\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M7.99219 47.998C7.99219 25.9067 25.9008 7.99805 47.9922 7.99805C70.0836 7.99805 87.9922 25.9067 87.9922 47.998C87.9922 70.0894 70.0836 87.998 47.9922 87.998C25.9008 87.998 7.99219 70.0894 7.99219 47.998ZM61.5401 39.2645C62.2396 38.4096 62.1136 37.1496 61.2587 36.4501C60.4038 35.7507 59.1437 35.8767 58.4443 36.7316L41.8437 57.0211L35.4064 50.5838C34.6254 49.8028 33.359 49.8028 32.578 50.5838C31.7969 51.3649 31.7969 52.6312 32.578 53.4123L40.578 61.4123C40.9775 61.8118 41.5275 62.0237 42.0918 61.9956C42.6562 61.9674 43.1823 61.7019 43.5401 61.2645L61.5401 39.2645Z\"\n fill=\"#35B093\"\n />\n </svg>\n </div>\n )}\n\n {/* Payment Details Card */}\n <div class=\"success-page__info-card\">\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentMethod')}\n </rebill-typography>\n <div class=\"success-page__card-value\">\n <div class=\"payment-method-display\">\n {this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD && (\n <>\n <rebill-card-icon\n card-brand={sessionState.data?.cardInformation?.brand || ''}\n />\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.textPaymentMethodCard()}\n </rebill-typography>\n </>\n )}\n {this.typePaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && (\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <rebill-icon\n name={\n getPaymentMethodDisplayName(\n PAYMENT_METHOD_ENUM.BANK_TRANSFER,\n this.country,\n )?.toLowerCase() || 'card'\n }\n />\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('paymentMethods.bank_transfer')}\n </rebill-typography>\n </div>\n )}\n </div>\n </div>\n </div>\n {sessionState?.data?.pricing?.installments &&\n sessionState?.data?.cardInformation?.installments?.selectedInstallment && (\n <div>\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('summary.installments')}\n </rebill-typography>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '10px',\n alignItems: 'end',\n }}\n >\n <rebill-typography\n variant=\"body2\"\n color={COLORS_ENUM.PRIMARY_DARK_TEXT}\n style={{ textAlign: 'end' }}\n >\n {getInstallmentLabelSummary(\n sessionState.data?.cardInformation?.installments?.selectedInstallment\n ?.installment,\n getRecalculatedInstallmentAmount(\n sessionState.data?.cardInformation?.installments?.selectedInstallment\n ?.installmentAmount || 0,\n ),\n sessionState.data?.pricing?.currency,\n sessionState.data?.cardInformation?.installments?.selectedInstallment\n ?.cft,\n sessionState.data?.cardInformation?.installments?.selectedInstallment\n ?.model,\n )}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {`( ${I18nService.translate('processing.purchaseTotal')}: ${this.getFormattedTotal()} )`}\n </rebill-typography>\n {sessionState.data.cardInformation?.installments?.installments.find(\n installment =>\n installment.installment ===\n sessionState.data.cardInformation?.installments?.selectedInstallment\n ?.installment,\n )?.model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED && (\n <rebill-typography\n variant=\"italic\"\n color={COLORS_ENUM.SECONDARY}\n style={{ textAlign: 'end' }}\n >\n {`${I18nService.translate('installments.interest')}`}\n </rebill-typography>\n )}\n </div>\n </div>\n </div>\n )}\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentDate')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {formatDateTime(\n this.paymentDate || this.getPaymentDate() || sessionState.createdAt,\n ) || ''}\n </rebill-typography>\n </div>\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentEmail')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {sessionState?.data?.userInformation?.email}\n </rebill-typography>\n </div>\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentReference')}\n </rebill-typography>\n <rebill-typography\n variant=\"body2\"\n color={COLORS_ENUM.PRIMARY_DARK_TEXT}\n class=\"reference-number\"\n >\n {this.referenceNumber || ''}\n </rebill-typography>\n </div>\n </div>\n\n {/* Purchase Details Card */}\n <div class=\"success-page__info-card\">\n <rebill-typography variant=\"subtitle-bold\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('processing.purchaseDetails')}\n </rebill-typography>\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.purchaseDetail')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {sessionState?.data?.itemInformation?.title || ''}\n </rebill-typography>\n </div>\n {!this.trialPeriodDays && (\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.purchaseSubtotal')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.getFormattedSubtotal()}\n </rebill-typography>\n </div>\n )}\n {sessionState?.data?.pricing?.discountAmount > 0 && (\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('summary.discount')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.getFormattedDiscountAmount()}\n </rebill-typography>\n </div>\n )}\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.purchaseMontoTotal')}\n </rebill-typography>\n <div class=\"total-amount-container\">\n {this.trialPeriodDays > 0 && (\n <div class=\"trial-pill\">\n <rebill-typography\n variant=\"body2\"\n align=\"center\"\n color={COLORS_ENUM.GREEN_TEXT}\n >\n {I18nService.translate('processing.trialPill', {\n days: this.trialPeriodDays,\n count: this.trialPeriodDays,\n })}\n </rebill-typography>\n </div>\n )}\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.getFormattedTotal()}\n </rebill-typography>\n </div>\n </div>\n {(this.trialPeriodDays || this.hasDebitDay()) && (\n <div class=\"success-page__card-divider\"></div>\n )}\n\n {/* Next Charge Section */}\n {(this.hasFreeTrial() || this.hasDebitDay()) && (\n <div class=\"next-charge-section\">\n <div class=\"next-charge-header\">\n <rebill-typography variant=\"subtitle-bold\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('processing.nextCharge')}\n </rebill-typography>\n <rebill-typography variant=\"subtitle-bold\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('processing.onDate', {\n date: this.hasFreeTrial()\n ? this.getTrialEndDateFormatted()\n : this.getDebitDateFormatted(),\n })}\n </rebill-typography>\n </div>\n <div class=\"success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.hasFreeTrial() ? I18nService.translate('processing.atEndOfTrial') : ''}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.getFormattedSubtotal(this.planAmount)}{' '}\n {I18nService.translate('processing.perMonth')}\n </rebill-typography>\n </div>\n </div>\n )}\n <div class=\"success-page__card-divider\"></div>\n <div class=\"download-container\">\n <svg\n class=\"download-icon\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M13.498 9.83333V12.1667C13.498 12.903 12.9011 13.5 12.1647 13.5H3.83138C3.095 13.5 2.49805 12.903 2.49805 12.1667V9.83333M7.99804 10V2.5M7.99804 10L5.66471 7.66667M7.99804 10L10.3314 7.66667\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <rebill-button\n type=\"button\"\n variant=\"download\"\n size=\"small\"\n onClick={this.handleDownloadReceipt}\n >\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('processing.download')}\n </rebill-typography>\n </rebill-button>\n </div>\n\n {/* Contact Info */}\n <div class=\"contact-info\">\n <rebill-typography variant=\"information-text\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.downloadDescription')}\n </rebill-typography>\n </div>\n </div>\n </div>\n </rebill-checkout-single-column>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.inputs-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n}\n.customer-exists {\n display: flex;\n justify-content: flex-end;\n margin-bottom: 16px;\n}\n","import { Component, Event, EventEmitter, h, Host, Listen, Prop } from '@stencil/core';\nimport { api } from '../../../api';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { sessionState, SessionStore } from '../../../store/session.store';\n\n@Component({\n tag: 'user-information',\n styleUrl: 'user-information.css',\n shadow: false,\n})\nexport class UserInformation {\n @Prop() userInformation: {\n email?: string;\n fullName?: string;\n countryCode?: string;\n phoneNumber?: {\n number: string;\n countryCode: string;\n };\n } = {\n email: '',\n fullName: '',\n countryCode: '',\n };\n\n @Prop() errors: {\n email?: string;\n fullName?: string;\n } | null = null;\n\n @Prop() customerExists: boolean = false;\n @Prop() disabled: boolean = false;\n @Event() onRebillAccountClick: EventEmitter<boolean>;\n\n private translateError(errorKey: string | undefined): string {\n if (!errorKey) return '';\n if (errorKey.includes('validation.') || errorKey.includes('paymentErrors.')) {\n return I18nService.translate(errorKey);\n }\n return errorKey;\n }\n\n @Listen('input')\n handleInputChange(event: CustomEvent<{ id: string; value: string }>) {\n if (!event.detail) return;\n\n const { id, value } = event.detail;\n SessionStore.setUserInformation({ [id]: value });\n }\n\n @Listen('blur')\n handleBlur(event: CustomEvent<{ id: string; value: string }>) {\n if (!event.detail) return;\n\n const { id, value } = event.detail;\n SessionStore.setUserInformation({ [id]: value });\n }\n\n private getCardLabels() {\n const labels = [];\n\n if (sessionState.data.prefilledData.email) {\n labels.push({\n label: I18nService.translate('userInformation.emailPlaceholder'),\n value: sessionState.data.prefilledData.email,\n });\n SessionStore.setUserInformation({\n ...sessionState.data.userInformation,\n email: sessionState.data.prefilledData.email,\n });\n }\n\n if (sessionState.data.prefilledData.fullName) {\n labels.push({\n label: I18nService.translate('userInformation.fullNamePlaceholder'),\n value: sessionState.data.prefilledData.fullName,\n });\n SessionStore.setUserInformation({\n ...sessionState.data.userInformation,\n fullName: sessionState.data.prefilledData.fullName,\n });\n }\n\n return labels;\n }\n private async handleRebillAccountClick() {\n api.otp.generate(sessionState.data.sessionId, {\n email: sessionState.data.userInformation.email,\n });\n this.onRebillAccountClick.emit(true);\n }\n\n private renderInputs() {\n const hasPrefilledEmail = sessionState.data.prefilledData.email;\n const hasPrefilledName = sessionState.data.prefilledData.fullName;\n\n const inputs = [];\n\n if (!hasPrefilledEmail) {\n inputs.push(\n <rebill-input-text\n id=\"email\"\n variant=\"floating\"\n label={I18nService.translate('userInformation.emailPlaceholder')}\n placeholder={I18nService.translate('userInformation.emailPlaceholder')}\n left-icon=\"email\"\n clearable={true}\n disabled={this.disabled}\n error={this.translateError(this.errors?.email)}\n />,\n );\n }\n\n if (!hasPrefilledName) {\n inputs.push(\n <rebill-input-text\n id=\"fullName\"\n variant=\"floating\"\n label={I18nService.translate('userInformation.fullNamePlaceholder')}\n placeholder={I18nService.translate('userInformation.fullNamePlaceholder')}\n disabled={this.disabled}\n error={this.translateError(this.errors?.fullName)}\n />,\n );\n }\n\n return inputs.length > 0 ? (\n <div\n class=\"inputs-container\"\n style={{\n marginTop: inputs.length > 0 && (hasPrefilledEmail || hasPrefilledName) ? '1rem' : '0',\n }}\n >\n {inputs}\n </div>\n ) : null;\n }\n\n render() {\n const customerExistsButton = (\n <div class=\"customer-exists\">\n <rebill-button\n style={{\n visibility: this.customerExists ? 'visible' : 'hidden',\n opacity: this.customerExists ? '1' : '0',\n transition: 'opacity 0.3s ease-in-out',\n }}\n variant=\"text\"\n size=\"small\"\n onClick={() => this.handleRebillAccountClick()}\n icon=\"lock\"\n >\n {I18nService.translate('userInformation.rebillAccount')}\n <rebill-icon name=\"arrow-right\" />\n </rebill-button>\n </div>\n );\n\n const hasPrefilledEmail = sessionState.data.prefilledData.email;\n const hasPrefilledName = sessionState.data.prefilledData.fullName;\n const hasAnyPrefilled = hasPrefilledEmail || hasPrefilledName;\n\n return (\n <Host>\n {customerExistsButton}\n {hasAnyPrefilled && (\n <rebill-card\n cardTitle={I18nService.translate('userInformation.personalInformation')}\n cardLabels={this.getCardLabels()}\n />\n )}\n {this.renderInputs()}\n </Host>\n );\n }\n}\n"],"mappings":"otBAAA,MAAMA,EAAS,ugD,MCaFC,EAAG,M,wJACLC,iBACAC,SAAmB,GACnBC,eAA0B,MAC1BC,WAAsB,MACtBC,YAAuB,MACvBC,SAAmB,GACnBC,WACAC,aACAC,MAAiB,MAElBC,MAAQC,EAAqB,CACnCC,SAAU,GACVC,OAAQX,IACNY,KAAKZ,SAAWA,CAAQ,EAE1Ba,WAAY,KACVD,KAAKX,eAAiB,KAAK,IAIvBa,aAAeL,EAAqB,CAC1CC,SAAU,EACVG,WAAY,KACVD,KAAKV,WAAa,KAAK,IAI3B,oBAAAa,GACEH,KAAKJ,MAAMQ,M,CAGb,UAAAC,GACEL,KAAKJ,MAAMU,QACXN,KAAKX,eAAiB,I,CAGxBkB,iBAAmBC,UACjB,IAAKR,KAAKX,eAAgB,OAClBoB,EAAIC,IAAIC,SAASC,EAAaC,KAAKC,UAAW,CAClDC,MAAOH,EAAaC,KAAKG,gBAAgBD,QAE3Cf,KAAKV,WAAa,KAClBU,KAAKE,aAAaI,QAClBN,KAA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AAU,uCACjCgP,WAAY3S,KAAKwR,kBAGpBxR,KAAK6R,e","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-DyaDabZ4.js";import{c as r}from"./p-BFhvUZPU.js";import{a as o,C as n}from"./p-C6wUNEUc.js";import{P as a,G as s,a as l}from"./p-A1UFEvOV.js";import{P as c,I as d}from"./p-dYKOc01W.js";import{r as h,R as m,o as u}from"./p-StCSFC25.js";import{B as p,g as f,i as b}from"./p-Do_vNuMa.js";import{C as y}from"./p-DA598vBj.js";import{m as g,i as x,g as w,P as k,a as v}from"./p-BqMM9Bcr.js";import"./p-BFTU3MAI.js";import"./p-B2LDUv1-.js";import"./p-uZj1dMLQ.js";import"./p-CTQZ1Sio.js";import"./p-BYrqevT1.js";import"./p-Bf6g23G6.js";import"./p-lWh04UqG.js";const q=async(e,t,i)=>{const r=await o.checkout.getRequiredFields({currency:e,method:t},i);return{fields:g(r.data),original:r.data}};const C=async()=>{const e=[...new Set(h.data.paymentMethods.map((e=>e.type)))];const t=e.map((async e=>{try{const t=a.mapToAPMPaymentMethod(e,h.data.price.country);const i=await q(h.data.price.currency,t,h.data.organization.id);return{paymentMethod:e,...i}}catch(t){console.error(`Error getting required fields for ${e}:`,t);return{paymentMethod:e,fields:[],original:[]}}}));const i=await Promise.all(t);const r={};i.forEach((e=>{r[e.paymentMethod]={fields:e.fields,original:e.original}}));return r};const j=(e,t)=>{const i=t[e];if(i){return i}else{return{fields:[],original:[]}}};const M=":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}@media (max-width: 1024px){.rebill-checkout-renewal{flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%;margin-top:24px}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}}@media (min-width: 1025px){.rebill-checkout-renewal{width:100vw;min-height:100vh;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;margin-top:24px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const D=class{constructor(i){e(this,i);this.success=t(this,"success");this.paymentError=t(this,"paymentError");this.paymentMethodSelected=t(this,"paymentMethodSelected")}renewalData;renewalToken;currentPaymentMethod=c.CARD;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;errorMessage=null;breakpoint=p.DESKTOP;errorPaymentCard=false;errorPaymentAPM=false;initialData={};checkoutResponse=null;currentApmPaymentMethod=null;countries=[];allRequiredFields={};currentRequiredFields=[];errorCardInvalid=false;cardMode="select";success;paymentError;paymentMethodSelected;validationSchema={phoneNumber:r().when([],{is:()=>x("phoneNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.phoneRequired"),otherwise:e=>e.notRequired()}),"billing-country":r().when([],{is:()=>x("billing-country",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.countryRequired"),otherwise:e=>e.notRequired()}),"billing-state":r().when([],{is:()=>x("billing-state",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.stateRequired"),otherwise:e=>e.notRequired()}),"billing-address":r().when([],{is:()=>x("billing-address",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.addressRequired"),otherwise:e=>e.notRequired()}),"billing-city":r().when([],{is:()=>x("billing-city",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.cityRequired"),otherwise:e=>e.notRequired()}),"billing-zip":r().when([],{is:()=>x("billing-zip",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.zipRequired"),otherwise:e=>e.notRequired()}),bankId:r().when([],{is:()=>x("bankId",this.currentRequiredFields),then:e=>e.required("validation.bankRequired"),otherwise:e=>e.notRequired()}),documentType:r().when([],{is:()=>x("documentType",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentTypeRequired"),otherwise:e=>e.notRequired()}),documentNumber:r().when([],{is:()=>x("documentNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentNumberRequired").min(7,"validation.documentInvalid"),otherwise:e=>e.notRequired()})};resizeHandler=()=>{this.breakpoint=f(window.innerWidth)};async componentWillLoad(){this.resizeHandler();window.addEventListener("resize",this.resizeHandler);const e=typeof this.renewalData==="string"?JSON.parse(this.renewalData):this.renewalData;m.initializeRenewal({...e,token:this.renewalToken});s.loadGoogleMapsScript();try{const e=await o.data.getCountries();this.countries=e.data}catch(e){console.error("Error loading countries:",e)}try{this.allRequiredFields=await C()}catch(e){console.error("Error loading required fields:",e)}if(h.data.paymentMethods.length>0){const e=h.data.paymentMethods[0].type;this.currentPaymentMethod=e;m.setSelectedPaymentMethod(e);try{this.currentRequiredFields=j(e,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(e)}this.initialData=this.getInitialData();this.cardMode=h.cardMode;u("cardMode",(()=>{this.cardMode=h.cardMode}))}disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler)}async handlePaymentMethodSelected(e){e.stopPropagation();if(this.currentPaymentMethod===e.detail){return}this.currentPaymentMethod=e.detail;m.setSelectedPaymentMethod(this.currentPaymentMethod);if(this.currentPaymentMethod!==c.CARD){this.cardMode="input";m.setCardMode("input")}try{this.currentRequiredFields=j(this.currentPaymentMethod,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(this.currentPaymentMethod);this.paymentMethodSelected.emit(e.detail)}async initializeFingerprint(e){if(e===c.CARD&&!h.deviceId){try{const e=crypto.randomUUID();const t=await o.fingerPrint.getFingerPrint(e);m.setDeviceId(e);const i=t.result.script;const r=document.createElement("script");r.innerHTML=i;document.body.appendChild(r)}catch(e){console.error("Failed to initialize fingerprint:",e)}}}handleBankSelected(e){e.stopPropagation();m.setSelectedBankId(e.detail)}handleCardSelected(e){const{card:t,cvv:i}=e.detail;m.setSelectedCard(t);m.setCvv(i||"")}get currentPaymentError(){if(this.currentPaymentMethod===c.CARD){return this.errorPaymentCard}else if(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER){return this.errorPaymentAPM}return false}async handleSubmit(e){if(this.isSubmitting){return}if(this.currentPaymentMethod===c.CARD){await this.handleCardRenewal(e)}else{await this.handleAPMRenewal(e)}}async handleCardRenewal(e){const t=e?.detail||this.getInitialData();if(!h.data.cardId&&!h.data.cardTokenId){this.errorCardInvalid=true;return}if(!h.data.cardInformation&&!h.data.cardId){this.errorCardInvalid=true;return}this.errorCardInvalid=false;this.isSubmitting=true;this.isCardSubmitting=true;m.setLoading(true);try{const e={transaction:{quantity:1},...h.data.cardId&&{cardId:h.data.cardId},...h.data.cardTokenId&&{cardTokenId:h.data.cardTokenId},customAttributes:{...h.deviceId&&{deviceId:h.deviceId}},...this.cardMode==="input"&&{customer:{firstName:t.fullName?.split(" ")[0]||h.data.subscription.customerName?.split(" ")[0],lastName:t.fullName?.split(" ").slice(1).join(" ")||h.data.subscription.customerName?.split(" ").slice(1).join(" "),email:t.email||h.data.subscription.customerEmail,phone:{countryCode:t.countryCodePhoneNumber||"",number:t.phoneNumber||""}},billingDetails:{address:{lineOne:t["billing-address"]||"",city:t["billing-city"]||"",state:t["billing-state"]||"",country:t["billing-country"]||"",zipCode:t["billing-zip"]||""},identification:{type:t.documentType||"",value:t.documentNumber||""}}}};const i=w();const r=await o.checkout.createCardCheckoutRequest(h.data.id,i,e,h.token);this.isSubmitting=false;this.isCardSubmitting=false;m.setLoading(false);m.setCheckoutResponse(r.data);if(r.data.result?.status.toUpperCase()===n.APPROVED){this.isCardSuccess=true}else{this.isCardSuccess=false;this.errorPaymentCard=true;this.errorMessage={message:r.data.error?.error?.message,type:r.data.error?.error?.type}}}catch(e){this.isSubmitting=false;this.isCardSubmitting=false;m.setLoading(false);this.errorPaymentCard=true;this.errorMessage={message:e.data?.error?.message,type:e.data?.error?.type}}}async handleAPMRenewal(e){this.isSubmitting=true;m.setLoading(true);try{const t=a.mapToAPMPaymentMethod(this.currentPaymentMethod,h.data.price.country);const i=e?.detail||this.getFormData();const r={address:{country:i["billing-country"],state:i["billing-state"]||"",city:i["billing-city"]||"",zipCode:i["billing-zip"]||"",lineOne:i["billing-address"]||""},identification:{type:i.documentType||"dni",value:i.documentNumber||""}};const s={transaction:{quantity:1},method:t,billingDetails:r,redirect:{approved:window.location.origin+"/renewal/success",rejected:window.location.origin+"/renewal/failure"},paymentMetadata:{orderId:h.data.id,source:"renewal-web"},customAttributes:{bank:i.bankId||""},...t!==l.CO_TRANSFERENCE_PSE&&{targetCurrency:h.data.price.currency}};s.customer={firstName:i.fullName?.split(" ")[0]||h.data.subscription.customerName.split(" ")[0]||"",lastName:i.fullName?.split(" ").slice(1).join(" ")||h.data.subscription.customerName.split(" ").slice(1).join(" ")||"",email:i.email||h.data.subscription.customerEmail,phone:{countryCode:i.countryCodePhoneNumber||"",number:i.phoneNumber||""}};const c=w();const d=await o.checkout.createAPMCheckoutRequest(h.data.id,c,s);this.isSubmitting=false;m.setLoading(false);m.setCheckoutResponse(d.data);this.checkoutResponse=d.data;if(d.data.result?.status.toUpperCase()===n.APPROVED){this.isCardSuccess=true}else{this.paymentError.emit(d.data);m.setCheckoutResponse(d.data);this.errorPaymentAPM=true;this.errorMessage={alertTitle:d.data?.error?.message,message:d.data.error?.message,type:d.data.error?.type,paymentMethod:this.currentPaymentMethod}}}catch(e){this.isSubmitting=false;m.setLoading(false);this.paymentError.emit(e);this.errorPaymentAPM=true;this.errorMessage={alertTitle:e.data?.error?.message,message:e.data?.error?.message,type:e.data?.error?.type,paymentMethod:this.currentPaymentMethod}}}getFormData=()=>this.initialData;getInitialData=()=>({email:h.data.subscription.customerEmail,fullName:h.data.subscription.customerName,card:"","billing-country":"","billing-state":"","billing-address":"","billing-city":"","billing-zip":"",bankId:"",phoneNumber:"",countryCodePhoneNumber:"",documentType:"",documentNumber:""});hasPrefilledAddress=()=>{const e=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return e.some((e=>{const t=this.initialData[e];return t&&t.trim()!==""}))};getPaymentDate=()=>{const e=h.form.checkoutResponse;if(!e)return"";if("date"in e){return e.date}return""};getReferenceNumber=()=>{const e=h.form.checkoutResponse;if(!e)return"";if("traceId"in e){return e.traceId}return""};render(){if(!h.isInitialized){return i("div",{class:"loading"},d.translate("renewal.loading"))}const e=e=>i("renewal-summary",{totalAmount:h.data.price.amount,currency:h.data.price.currency,subscriptionTitle:h.data.subscription.name[0]?.text||"Subscription",subscriptionAmount:h.data.subscription.amount,nextChargeDate:h.data.subscription.nextChargeDate,frequency:h.data.subscription.frequency,...e});return i(i.Fragment,null,i("rebill-processing-payment",{style:{display:this.isCardSubmitting?"block":"none"}}),this.isCardSuccess?i("renewal-success-page",{typePaymentMethod:this.currentPaymentMethod,paymentDate:this.getPaymentDate(),referenceNumber:this.getReferenceNumber(),cardLastFour:h.data.subscription.cardLastFour,country:h.data.price.country,paymentMethodName:a.mapToAPMPaymentMethod(this.currentPaymentMethod,h.data?.price?.country),bank:h.form?.selectedBankId||""}):i("rebill-checkout-form",{style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:e=>this.handleSubmit(e),renderForm:({submit:t,formData:r,errors:o})=>i("div",{class:"rebill-checkout-renewal"},i("div",{class:"left-section"},i("div",{class:"left-section-container"},i("organization-logo",{organization:h.data.organization}),i("div",{class:"checkout-form-section"},i("user-information-static",{userInfo:{customerName:h.data.subscription.customerName,customerEmail:h.data.subscription.customerEmail}}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"header"}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"details"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"32px"}},i("payment-method-selector",{enabledPaymentMethods:[...new Set(h.data.paymentMethods.map((e=>e.type)))],defaultSelected:this.currentPaymentMethod,errorComponent:{showErrorComponent:this.currentPaymentError,message:k.getErrorMessage(this.errorMessage)},cardError:{showCardInvalid:this.errorCardInvalid,type:null},country:h.data.price.country,documentTypeError:o?.documentType,documentNumberError:o?.documentNumber,showDocument:this.cardMode==="input"&&(x("documentType",this.currentRequiredFields)||x("documentNumber",this.currentRequiredFields))}),this.currentPaymentMethod!==c.CARD&&i("rebill-alert",{type:"info",message:d.translate("renewal.paymentMethodAlert",{cardLastFour:h.data.subscription.cardLastFour||"****"}),icon:"calendar-edit",variant:"outlined",colorIcon:y.PRIMARY}),this.cardMode==="input"&&x("bankId",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("rebill-bank-selector",{banks:v("bank",this.allRequiredFields[this.currentPaymentMethod]?.original)||[],defaultSelectedBankId:r.bankId||"",error:o?.bankId}))),this.cardMode==="input"&&(x("billing-country",this.currentRequiredFields)||x("billing-state",this.currentRequiredFields)||x("billing-address",this.currentRequiredFields)||x("billing-city",this.currentRequiredFields)||x("billing-zip",this.currentRequiredFields))&&i("div",{class:"animated-component slide-in"},i("rebill-address",{countryOptions:this.countries.map((e=>({label:e.country,value:e.isoCountryCode}))),billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":o["billing-country"],"billing-state":o["billing-state"],"billing-address":o["billing-address"],"billing-city":o["billing-city"],"billing-zip":o["billing-zip"]}})),this.cardMode==="input"&&x("phoneNumber",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("user-information-phone",{error:o?.phoneNumber})),this.checkoutResponse?.result&&(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER)&&i("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===c.CASH?this.checkoutResponse.result.data.referenceId:undefined,qrCodeData:this.currentPaymentMethod===c.BANK_TRANSFER?this.checkoutResponse.result.data.qrCode:undefined,providerName:h.data.organization?.name||"",expirationDate:(()=>{const e=new Date;e.setDate(e.getDate()+30);return e.toISOString()})(),country:h.data.price.country,redirectUrl:this.checkoutResponse.result.data.url}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"summary"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},i("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,isRenewal:true,trialPeriodDays:h.data.subscription.trialPeriodDays,redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:5e3,country:h.data.price.country,isDisabled:h.fetchingInstallments,onSubmit:()=>t()}),i("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:d.translate("otp.secureMessage")}))),i("rebill-footer",null))),!b(this.breakpoint,p.DESKTOP)&&i("div",{class:"right-section"},i("div",{class:"checkout-summary-section"},e({displayedComponents:["header","details","summary"]}))))}))}};D.style=M;export{D as rebill_renewal};
|
|
2
|
+
//# sourceMappingURL=p-bf4f1bcc.entry.js.map
|