@solvimon/solvimon-web 0.1.0-alpha.23 → 0.1.0-alpha.25
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/README.md +41 -0
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jXClPW91.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BM1_31Tl.js} +1 -1
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B70SyWOB.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Dh_a0NRB.mjs} +6 -6
- package/dist/{Avatar.vue.es-2E3laNRb.mjs → Avatar.vue.es-C9Jkfuvp.mjs} +1 -1
- package/dist/{Avatar.vue.es-DdJreyr_.js → Avatar.vue.es-CvxRdCes.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-ConpyC8n.js → BillingInformation.vue_vue_type_script_setup_true_lang-7wQAw6Lv.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-D5EoBLhj.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BRSUpMPU.mjs} +4 -4
- package/dist/{Button.vue.es-BJEy-e9C.mjs → Button.vue.es-BbSN0uOk.mjs} +1 -1
- package/dist/{Button.vue.es-CJNxYacb.js → Button.vue.es-CeUTAc2n.js} +1 -1
- package/dist/Checkout.entry.ce-BMzK8nQg.mjs +3900 -0
- package/dist/Checkout.entry.ce-DgA0ckyl.js +2 -0
- package/dist/{Chip.vue.es-DLQ4QEPo.js → Chip.vue.es-BN83K3Tk.js} +1 -1
- package/dist/{Chip.vue.es-DGbc4L_D.mjs → Chip.vue.es-T22Q7AF9.mjs} +2 -2
- package/dist/ContentWithAsideLayout-BCM8tmZN.mjs +38 -0
- package/dist/ContentWithAsideLayout-RSdKXqAf.js +1 -0
- package/dist/{ContextMenu.vue.es-DL1M7pcr.mjs → ContextMenu.vue.es-0PRmCAzL.mjs} +4 -4
- package/dist/{ContextMenu.vue.es-Bd2kmeVq.js → ContextMenu.vue.es-DXKR7WFg.js} +1 -1
- package/dist/{CustomerBillingInformation.vue.es-CE94ASC3.mjs → CustomerBillingInformation.vue.es-C2j40TYP.mjs} +2 -2
- package/dist/{CustomerBillingInformation.vue.es-hiFzB43w.js → CustomerBillingInformation.vue.es-yrLGc7oL.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bhih7rPR.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BZwGWhaL.mjs} +5 -5
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BE21tqgW.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C8diNL5x.js} +1 -1
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D018AmFA.js → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DzbPUvHN.js} +1 -1
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C5zc9n64.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-xqMsbuU6.mjs} +14 -14
- package/dist/{DividerText.vue.es-CFZUQ62L.mjs → DividerText.vue.es-CV1XK_Vz.mjs} +1 -1
- package/dist/{DividerText.vue.es-CvCgHHXN.js → DividerText.vue.es-DsYRZzuE.js} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-YcaBJDzx.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-kpjrC-4q.mjs} +4 -4
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-srXOpUb0.js} +1 -1
- package/dist/{ErrorNotification.vue.es-B3mvv79S.mjs → ErrorNotification.vue.es-CiUJva6S.mjs} +1 -1
- package/dist/{ErrorNotification.vue.es-DI2B7WiR.js → ErrorNotification.vue.es-QfRoDhkn.js} +1 -1
- package/dist/{IconButton.vue.es-GLcGhoHC.mjs → IconButton.vue.es-ChvsCZQG.mjs} +2 -2
- package/dist/{IconButton.vue.es-Dp8h4YOx.js → IconButton.vue.es-CytBZUkZ.js} +1 -1
- package/dist/{IconTitle.vue.es-CzuPQtOX.mjs → IconTitle.vue.es-DPruIJ6l.mjs} +3 -3
- package/dist/{IconTitle.vue.es-DN9r6nfK.js → IconTitle.vue.es-DtnpBObk.js} +1 -1
- package/dist/{Input.vue.es-DM81HeVv.js → Input.vue.es-BkzQDkrz.js} +1 -1
- package/dist/{Input.vue.es-5Cq8a7oH.mjs → Input.vue.es-DJQqJrsb.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D75LSIL8.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BC-zyUqe.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-w8w52LcV.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Do0dDtkA.js} +1 -1
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-dRLsZPNh.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-CFhhhwId.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DB5h39LA.js → InvoiceEntryView.vue_vue_type_script_setup_true_lang-DQFS7SfE.js} +1 -1
- package/dist/{InvoiceSummary.vue.es-DbtqsTuP.mjs → InvoiceSummary.vue.es-6qpbyymg.mjs} +7 -7
- package/dist/{InvoiceSummary.vue.es-Qy99kLZs.js → InvoiceSummary.vue.es-v1TkOUhA.js} +1 -1
- package/dist/{Modal.vue.es-Z2DWAN2u.mjs → Modal.vue.es-BuRlbyZw.mjs} +5 -5
- package/dist/{Modal.vue.es-DgLl6XBV.js → Modal.vue.es-JpE0eh_Q.js} +1 -1
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DYuFPIqs.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-UmKgVvdj.mjs} +4 -4
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBm51C7c.js → PaymentErrorCard.vue_vue_type_script_setup_true_lang-nAuhIopc.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CcdhYTB1.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DggCusgC.mjs} +3 -3
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BNZ9-GW1.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-YpcWHm24.js} +1 -1
- package/dist/{PaymentHistoryBlock-CjP_514k.mjs → PaymentHistoryBlock-DnmParhQ.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-DS1j-8m-.js → PaymentHistoryBlock-uWuWjr8I.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CSTfMB8U.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BS8N4yt9.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dr2jtJhK.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BziIf86i.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-CpOZUf-W.mjs → PaymentIntegrationForm-DL55i0HD.mjs} +1 -1
- package/dist/{PaymentIntegrationForm-80b19Lkq.js → PaymentIntegrationForm-DTXm56QQ.js} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-4RmdLbzY.js +1 -0
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BgztoQH5.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CvpFnl9V.mjs} +43 -40
- package/dist/PaymentIntegrationFormAdyen-C9KoiqMh.js +98 -0
- package/dist/{PaymentIntegrationFormAdyen-BQcgDcik.mjs → PaymentIntegrationFormAdyen-Cqsy82To.mjs} +313 -207
- package/dist/{PaymentIntegrationFormStripe-Dx1H3fZ2.mjs → PaymentIntegrationFormStripe-DIU1rnwH.mjs} +22 -21
- package/dist/{PaymentIntegrationFormStripe-CMwLqOe6.js → PaymentIntegrationFormStripe-DTLgGutU.js} +2 -2
- package/dist/{PaymentMethod.vue.es-pLCCzVxN.js → PaymentMethod.vue.es-ZWda5GqF.js} +1 -1
- package/dist/{PaymentMethod.vue.es-EhRCfeax.mjs → PaymentMethod.vue.es-m1NasGqw.mjs} +3 -3
- package/dist/{PaymentMethodForm-Bw2e1tXo.js → PaymentMethodForm-BEVdWCrH.js} +1 -1
- package/dist/{PaymentMethodForm-D3OY8zK5.mjs → PaymentMethodForm-BYzt1PVP.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-DHXw6qD0.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-CzUwtVEI.js} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-vGprVPpn.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-fdRTp7sc.mjs} +6 -6
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-D7b0HhDc.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-FChyZp2v.mjs} +6 -6
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-CdT1YyeU.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-FhMBZqtI.js} +1 -1
- package/dist/{PlanCustomizationEditor-RC8kj2rC.js → PlanCustomizationEditor-CunwwXTw.js} +1 -1
- package/dist/{PlanCustomizationEditor-BQqkgmzL.mjs → PlanCustomizationEditor-NLVkEYFF.mjs} +9 -9
- package/dist/{PricingGroupRangeInput.vue.es-DNsiUZyT.mjs → PricingGroupRangeInput.vue.es-B4ZbKxUw.mjs} +4 -4
- package/dist/{PricingGroupRangeInput.vue.es-ClkE98ML.js → PricingGroupRangeInput.vue.es-Ba3v0J_R.js} +1 -1
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CURXAgMT.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-Dvuj-fos.mjs} +5 -5
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-BJfQLRcS.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-iE4dLawA.js} +1 -1
- package/dist/{RadioGroupExtended.vue.es-Dk9xdj76.js → RadioGroupExtended.vue.es-CHrcqSRq.js} +1 -1
- package/dist/{RadioGroupExtended.vue.es-vUqn2ZUP.mjs → RadioGroupExtended.vue.es-CkhBp9kI.mjs} +2 -2
- package/dist/{Section.vue.es-Cybk1Nb8.js → Section.vue.es-CSrVPlUK.js} +1 -1
- package/dist/{Section.vue.es-C2_topx4.mjs → Section.vue.es-D5svcVS_.mjs} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-C9q_qwjt.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BM9Y4Cy3.mjs} +6 -6
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DIgVzXLg.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BqOSBdFQ.js} +1 -1
- package/dist/{SubscriptionSchedules-CNTg_oRy.js → SubscriptionSchedules-CMVoB2bw.js} +1 -1
- package/dist/{SubscriptionSchedules-BlCU_xc5.mjs → SubscriptionSchedules-yDcsD1hd.mjs} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-6LbR_Vni.js → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DH7IZrNT.js} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Cf3Dy8Yn.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DZHsQImd.mjs} +11 -11
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-BijBAdqp.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-BgXZMihr.js} +1 -1
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-CjzjchsS.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-BmNl5u8R.mjs} +2 -2
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-CxdrAanb.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BUzdZHah.mjs} +6 -6
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-Dz4s3CH_.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-DOJ0t_fo.js} +1 -1
- package/dist/{TooltipParagraph.vue.es-Fu9Od3Vr.mjs → TooltipParagraph.vue.es-CxdL8-B7.mjs} +1 -1
- package/dist/{TooltipParagraph.vue.es-OX6bAWP9.js → TooltipParagraph.vue.es-DS_69pl1.js} +1 -1
- package/dist/{TrialChip.vue.es-CbjdkR4i.js → TrialChip.vue.es-BCc8q5j0.js} +1 -1
- package/dist/{TrialChip.vue.es-c7tZOIW3.mjs → TrialChip.vue.es-BK7m7e7q.mjs} +2 -2
- package/dist/{cn.es-lC4_Xd0R.js → cn.es-71nFUose.js} +1 -1
- package/dist/{cn.es-C8Ogac5T.mjs → cn.es-ZXNzpauQ.mjs} +2 -2
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +6 -6
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +9 -9
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +3 -3
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +3 -3
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
- package/dist/{customElements-BYIdPSzQ.js → customElements-hH6pju3X.js} +14 -14
- package/dist/{customElements-Df6dGrN-.mjs → customElements-q_i9y0Ph.mjs} +637 -601
- package/dist/{customer-DmsKYpVi.mjs → customer-BDoOIAFr.mjs} +1 -1
- package/dist/{customer-DoLHZuMG.js → customer-C9q6ti8s.js} +1 -1
- package/dist/{de-DE-Bgm9bnmp.mjs → de-DE-B_ik9VNt.mjs} +8 -2
- package/dist/{de-DE-CAL9Mji2.js → de-DE-npBTLtKL.js} +1 -1
- package/dist/{en-US-E86eRIxh.mjs → en-US-DkCltadt.mjs} +6 -0
- package/dist/{en-US-_xe5H4TQ.js → en-US-kGduGoka.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{invoices-mw87cNTS.js → invoices-CHp75zZI.js} +1 -1
- package/dist/{invoices-CrO6p4Ms.mjs → invoices-DIzkXntV.mjs} +1 -1
- package/dist/{it-IT-QFQ1Ajbb.js → it-IT-BayNIAy7.js} +1 -1
- package/dist/{it-IT-co1BfV5s.mjs → it-IT-CHj2McbF.mjs} +6 -0
- package/dist/{nl-NL-CJXJC1bx.js → nl-NL-0rV4nFLw.js} +1 -1
- package/dist/{nl-NL-Drv2E66B.mjs → nl-NL-Cdvd_XMN.mjs} +6 -0
- package/dist/{paymentMethods-CQdhZwq4.js → paymentMethods-CZGP6_4W.js} +1 -1
- package/dist/{paymentMethods-BNQbW_f1.mjs → paymentMethods-DEKp_4QM.mjs} +1 -1
- package/dist/{payments-VS_N2xpJ.mjs → payments-C0-Hq2a4.mjs} +1 -1
- package/dist/{payments-KTjVHqOa.js → payments-DBvregE8.js} +1 -1
- package/dist/screens/Checkout/Checkout.cjs +1 -1
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +11 -11
- package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
- package/dist/screens/PayInvoice/PayInvoice.mjs +131 -127
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +10 -10
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +19 -19
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +19 -19
- package/dist/{subscriptions-U4xg2CO1.mjs → subscriptions--9MaTXMb.mjs} +1 -1
- package/dist/{subscriptions-Dugd-oZ1.js → subscriptions-BArXBCFr.js} +1 -1
- package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +8 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +4 -2
- package/dist/types/services/portals.types.d.ts +2 -0
- package/dist/types/services/requests.types.d.ts +2 -0
- package/dist/{url-DwiuKYpu.mjs → url-TNRgVI8A.mjs} +3 -2
- package/dist/url-vloPOiXd.js +1 -0
- package/dist/{useActionDispatchProvider-DyQbRCxR.mjs → useActionDispatchProvider-BdciAX8T.mjs} +1 -1
- package/dist/{useActionDispatchProvider-CTyDGRX8.js → useActionDispatchProvider-CKzeqXzY.js} +1 -1
- package/dist/{useCustomer-dcmU1539.mjs → useCustomer-D8ixhuuj.mjs} +1 -1
- package/dist/{useCustomer-BXI5Vmit.js → useCustomer-DSYr0F58.js} +1 -1
- package/dist/{useCustomerFormLabels-Ct6vD_b8.js → useCustomerFormLabels-CRumh405.js} +1 -1
- package/dist/{useCustomerFormLabels-BC1WfqWo.mjs → useCustomerFormLabels-htMZ0xqB.mjs} +5 -5
- package/dist/{useExperimentalFeature-9-p9_nP6.js → useExperimentalFeature-D29-TO3R.js} +1 -1
- package/dist/{useExperimentalFeature-4Y-ppDr7.mjs → useExperimentalFeature-JK_kAUQQ.mjs} +1 -1
- package/dist/{useInvoiceData-B2Z9aD2w.mjs → useInvoiceData-Bpbog3zW.mjs} +2 -2
- package/dist/{useInvoiceData-CGvtl7Ai.js → useInvoiceData-DhrItfv7.js} +1 -1
- package/dist/{useInvoicesList-DJPznhig.mjs → useInvoicesList-BGwcJn4I.mjs} +7 -7
- package/dist/{useInvoicesList-Ba0GO8p-.js → useInvoicesList-duu_b5GW.js} +1 -1
- package/dist/{useLoadInitialData-CWyI3_RR.mjs → useLoadInitialData-BDmmpcfb.mjs} +1 -1
- package/dist/{useLoadInitialData-BO9ZsSsF.js → useLoadInitialData-U2WvBmXT.js} +1 -1
- package/dist/{usePaymentMethodAvailability-bkmDrPXY.js → usePaymentMethodAvailability-DwtT5Czz.js} +1 -1
- package/dist/{usePaymentMethodAvailability-DqIvkjLF.mjs → usePaymentMethodAvailability-adqRujTA.mjs} +4 -4
- package/dist/{usePaymentMethodOptions-BPBVGNDg.js → usePaymentMethodOptions-CXdFKFqZ.js} +1 -1
- package/dist/{usePaymentMethodOptions-MSEp39xQ.mjs → usePaymentMethodOptions-DlZtTQNQ.mjs} +1 -1
- package/dist/{usePaymentMethods-U7gnZ0F5.mjs → usePaymentMethods-BnmSo_rr.mjs} +1 -1
- package/dist/{usePaymentMethods-BAOtOJZD.js → usePaymentMethods-DZ1a0mnr.js} +1 -1
- package/dist/{usePayments-G-HpKpK8.js → usePayments-DL4agK2i.js} +1 -1
- package/dist/{usePayments-Dq2V6bTV.mjs → usePayments-s-Z1di8d.mjs} +6 -6
- package/dist/{usePortal-CMHV-ShD.mjs → usePortal-C4rR5Rhu.mjs} +1 -1
- package/dist/{usePortal-BplmMkBG.js → usePortal-Hm7wvtgQ.js} +1 -1
- package/dist/{useSubscription-CvB8ROBt.js → useSubscription-DMAEJves.js} +1 -1
- package/dist/{useSubscription-V53WsZwQ.mjs → useSubscription-DSsXVO0h.mjs} +1 -1
- package/dist/{useTimePeriod.es-D31Zl1MJ.mjs → useTimePeriod.es-CW8ycmpT.mjs} +1 -1
- package/dist/{useTimePeriod.es-CtCTu9cz.js → useTimePeriod.es-anHB63am.js} +1 -1
- package/package.json +1 -1
- package/dist/Checkout.entry.ce-BfLlnQyb.js +0 -1
- package/dist/Checkout.entry.ce-CQkrWscC.mjs +0 -3769
- package/dist/ContentWithAsideLayout-Bnbsq8_5.mjs +0 -32
- package/dist/ContentWithAsideLayout-C6yMIVJF.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DKXhthkA.js +0 -1
- package/dist/PaymentIntegrationFormAdyen-DElXsJ96.js +0 -98
- package/dist/url-BNKStNY9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("../../Alert.vue.es-RyK53a2P.js"),P=require("../../Button.vue.es-CJNxYacb.js"),T=require("../../ErrorNotification.vue.es-DI2B7WiR.js"),b=require("../../customElements-BYIdPSzQ.js"),$=require("../../ContentWithAsideLayout-C6yMIVJF.js"),I=require("../../useActionDispatchProvider-CTyDGRX8.js"),E=require("../../subscription-ZA62t4E9.js"),L=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D018AmFA.js"),O=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BE21tqgW.js"),R=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js"),U=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),A=require("../../Section.vue.es-Cybk1Nb8.js"),j=require("../../pricing-BVAld27Y.js"),V=require("../../formatting.es-C72Nsrmh.js"),W=require("../../PaymentMethod.vue.es-pLCCzVxN.js"),F=require("../../Modal.vue.es-DgLl6XBV.js"),Y=require("../../subscriptions-Dugd-oZ1.js"),z=require("../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-BijBAdqp.js"),G=require("../../api.es-duCDtZD9.js"),H=require("../../useIncrementalLoading-CaWOE8Xl.js"),Z=require("../../paymentMethods-CQdhZwq4.js"),J=require("../../error-CmduqgVq.js"),K=require("../../useSubscription-CvB8ROBt.js"),Q=require("../../useCustomer-BXI5Vmit.js"),X=require("../../usePaymentMethods-BAOtOJZD.js"),ee=require("../../useLoadInitialData-BO9ZsSsF.js"),te=require("../../sessionReference-m_6Rp4X1.js");function ne({subscription:t}){const{dispatchAction:s}=I.useActionDispatchProvider(),i=e.computed(()=>{if(!t.value)return!1;const u=t.value.inactive_periods;return!u||u.length===0}),n=e.computed(()=>{var g;const u=(g=t.value)==null?void 0:g.inactive_periods;return Array.isArray(u)&&u.length>0}),a=e.ref();return{isCancellable:i,isRenewable:n,pendingVariant:a,cancel:()=>{t.value&&(a.value="CANCEL")},renew:()=>{t.value&&(a.value="RENEW")},dismiss:()=>{a.value=void 0},manage:()=>{t.value&&s({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}function ie(t){var n,a,o,r,c,d,u;const s=(o=(a=(n=t.items)==null?void 0:n[0])==null?void 0:a.configs)==null?void 0:o[0],i=(c=(r=s==null?void 0:s.details)==null?void 0:r.bands)==null?void 0:c[0];return{amount:(i==null?void 0:i.amount)??(i==null?void 0:i.fixed_amount),billingPeriod:((d=s==null?void 0:s.details)==null?void 0:d.pricing_period)??((u=s==null?void 0:s.details)==null?void 0:u.billing_period)}}function oe(t){var n,a,o;const s=new Set((((n=t.pricing_plan_schedule)==null?void 0:n.enabled_pricings)??[]).map(({pricing_id:r})=>r));return s.size===0?[]:(((o=(a=t.pricing_plan_version)==null?void 0:a.pricing_categories)==null?void 0:o.flatMap(r=>r.pricing_groups??[]))??[]).flatMap(r=>(r.pricings??[]).filter(c=>s.has(c.id)).map(c=>({pricingId:c.id,pricingGroupId:r.id,groupName:r.name,name:j.getNameFromPricing(c)||r.name,...ie(c)})))}const ae={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},se={class:"sv-enabled-pricings-list__item-content grow"},re=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>{const{amount:a,billingPeriod:o}=s.entry;if(a)return o?i({defaultMessage:"{amount} per {period}",id:"enabled_pricings_list.item.price",description:'The recurring price of an enabled pricing, e.g. "€ 100,00 per month"'},{amount:V.formatAmount(a),period:V.formatBillingPeriod(o,{short:!0,hideValueForExactPeriods:!0})}):V.formatAmount(a)});return(a,o)=>(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",se,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"subtle",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"h3",variant:"heading-3","no-spacing":"",class:"sv-enabled-pricings-list__item-name"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.name),1)]),_:1}),n.value?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(P._sfc_main),{intent:"secondary",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:o[0]||(o[0]=r=>a.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Upgrade",id:"enabled_pricings_list.item.upgrade_button.label",description:"Label for the button that changes which pricing is enabled for a group"})),1)]),_:1})])]),_:1}))}}),ce={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},le=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>oe(s.pricingPlanSchedule));return(a,o)=>n.value.length>0?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(i)({defaultMessage:"Upgrades",id:"enabled_pricings_list.title",description:"Title for the block listing the pricings enabled on a subscription"})},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,r=>(e.openBlock(),e.createBlock(re,{key:r.pricingId,entry:r,onUpgrade:o[0]||(o[0]=c=>a.$emit("upgrade",c))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}});function ue({variant:t,renewableUntil:s,billingPeriodEndsAt:i}){const{$t:n}=b.useIntl(),a=e.computed(()=>t.value==="RENEW"),o=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Title of the renew subscription confirmation modal",id:"subscription_cancellation_modal.renew.title"}):n({defaultMessage:"Cancel subscription",description:"Title of the cancel subscription confirmation modal",id:"subscription_cancellation_modal.cancel.title"})),r=e.computed(()=>a.value?s.value?n({defaultMessage:"You can renew your subscription until {date}. After this period you can only create a new subscription.",description:"Explanation of the deadline for undoing a cancellation, shown in the renew subscription modal",id:"subscription_cancellation_modal.renew.explanation_with_date"},{date:s.value}):n({defaultMessage:"Your subscription will continue as before, and billing will resume on its usual schedule.",description:"Explanation of what happens when a cancellation is undone, shown in the renew subscription modal when no end date is known",id:"subscription_cancellation_modal.renew.explanation"}):i.value?n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until {date}.",description:"Explanation of what happens when a running subscription is cancelled, naming the date access ends, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation_with_date"},{date:i.value}):n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until the end of the billing period.",description:"Explanation of what happens when a running subscription is cancelled, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation"})),c=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Label of the confirm button in the renew subscription modal",id:"subscription_cancellation_modal.renew.confirm_button.label"}):n({defaultMessage:"Cancel subscription",description:"Label of the confirm button in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.confirm_button.label"})),d=e.computed(()=>n({defaultMessage:"Cancel",description:"Label of the button that dismisses the cancellation modal",id:"subscription_cancellation_modal.cancel_button.label"})),u=e.computed(()=>a.value?n({defaultMessage:"We could not renew your subscription. Please try again.",description:"Error shown when undoing a cancellation fails",id:"subscription_cancellation_modal.renew.error"}):n({defaultMessage:"We could not cancel your subscription. Please try again.",description:"Error shown when cancelling a subscription fails",id:"subscription_cancellation_modal.cancel.error"}));return{title:o,explanation:r,confirmButtonText:c,cancelButtonText:d,errorMessage:u}}const de=50;function pe(){const{getPaymentMethods:t}=Z.createPaymentMethodsService(),s=e.shallowRef();return{paymentMethod:s,get:async({customerId:n,paymentMethodId:a})=>{const o=await G.getPaginatedFullList(async r=>{const c=await t({customerId:n,pagination:{page:r,pageSize:de}});if(!H.isApiSuccessCollectionResponse(c))throw new Error("Could not load the customer’s payment methods.");return c});return s.value=o.data.find(({id:r})=>r===a),s.value}}}const me={class:"sv-subscription-cancellation-modal sv-subscription-cancellation-modal__body flex flex-col gap-3"},be={key:0,class:"sv-subscription-cancellation-modal__meta flex flex-wrap items-center gap-x-6 gap-y-2 px-3 pb-2"},fe={key:0,class:"sv-subscription-cancellation-modal__renews flex gap-1"},ge=e.defineComponent({__name:"SubscriptionCancellationModal",props:{showModal:{type:Boolean},variant:{type:null},subscription:{type:Object},avatar:{type:String}},emits:["confirmed","close"],setup(t,{emit:s}){const i=t,n=s,{$t:a,formatDate:o}=b.useIntl(),r=b.useLogger(),{setSubscriptionCancellation:c}=Y.createSubscriptionsService(),d=e.computed(()=>i.variant),u=e.computed(()=>{var _;const l=((_=i.subscription)==null?void 0:_.inactive_periods)??[],f=l.find(({type:N})=>N==="CANCEL")??l[0];if(f)return o({date:f.start_at,format:"date",offsetType:"local"})}),g=e.computed(()=>{var f,_;const l=(_=(f=i.subscription)==null?void 0:f.next_invoice)==null?void 0:_.invoice_date;if(l)return o({date:l,format:"date",offsetType:"local"})}),y=g,w=e.computed(()=>{var l,f;return(((f=(l=E.getMostRecentScheduleInfo(i.subscription))==null?void 0:l.pricing_plan_schedule)==null?void 0:f.enabled_pricings)??[]).map(({pricing_id:_})=>_).filter(_=>!!_)}),{title:h,explanation:C,confirmButtonText:S,cancelButtonText:k,errorMessage:B}=ue({variant:d,renewableUntil:u,billingPeriodEndsAt:g}),{paymentMethod:v,get:M}=pe();e.watch([()=>i.showModal,()=>{var l;return(l=i.subscription)==null?void 0:l.payment_method_id},()=>{var l;return(l=i.subscription)==null?void 0:l.customer_id}],([l,f,_])=>{var N;!l||!f||!_||f!==((N=v.value)==null?void 0:N.id)&&M({customerId:_,paymentMethodId:f}).catch(()=>{})},{immediate:!0});const p=e.ref(!1),m=e.ref(!1);e.watch(()=>i.showModal,l=>{l&&(m.value=!1)});const x=async()=>{if(!(!i.subscription||!i.variant||p.value)){p.value=!0,m.value=!1;try{await c({id:i.subscription.id,variant:i.variant}),n("confirmed"),n("close")}catch(l){r.error("SUBSCRIPTION_CANCELLATION_FAILED","Failed to change the cancellation state of a subscription",{variant:i.variant},l),m.value=!0}finally{p.value=!1}}},q=()=>{p.value||n("close")};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(F.Modal),{size:"md","show-modal":t.showModal,title:e.unref(h),"confirm-button-text":e.unref(S),"cancel-button-text":e.unref(k),"is-loading":p.value,"no-click-away":p.value,"no-backdrop-close":p.value,onConfirm:x,onClose:q},{body:e.withCtx(()=>[e.createElementVNode("div",me,[e.createVNode(e.unref(b._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-subscription-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1}),t.subscription?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,"no-spacing":"",class:"sv-subscription-cancellation-modal__subscription"},{default:e.withCtx(()=>[e.createVNode(z._sfc_main,{subscription:t.subscription,avatar:t.avatar,"enabled-pricing-ids":w.value},null,8,["subscription","avatar","enabled-pricing-ids"]),e.unref(y)||e.unref(v)?(e.openBlock(),e.createElementBlock("div",be,[e.unref(y)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Renews",description:"Label before the date the subscription renews, shown in the cancel subscription modal",id:"subscription_cancellation_modal.renews_label"})),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createBlock(e.unref(W._sfc_main),{key:1,variant:"condensed",class:"sv-subscription-cancellation-modal__payment-method","payment-method":e.unref(v)},null,8,["payment-method"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,class:"sv-subscription-cancellation-modal__error sv-error",title:e.unref(B)},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","title","confirm-button-text","cancel-button-text","is-loading","no-click-away","no-backdrop-close"]))}}),_e={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},he=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},avatar:{type:String},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","subscription-changed"],setup(t,{emit:s}){const i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../SubscriptionSchedules-CNTg_oRy.js"))),n=t,a=s,{$t:o}=b.useIntl(),{isCancellable:r,isRenewable:c,pendingVariant:d,cancel:u,renew:g,dismiss:y,manage:w}=ne({subscription:e.toRef(n,"subscription")}),h=e.ref();e.watch(d,p=>{p&&(h.value=void 0)});const C=()=>{h.value=d.value,a("subscription-changed")},S=e.computed(()=>{if(h.value)return h.value==="RENEW"?o({defaultMessage:"Your subscription has been renewed.",id:"subscription_details.renew_success",description:"Confirmation shown after a cancellation has been undone"}):o({defaultMessage:"Your subscription has been cancelled. You keep access until the end of the billing period.",id:"subscription_details.cancel_success",description:"Confirmation shown after a subscription has been cancelled"})}),k=e.computed(()=>E.getMostRecentScheduleInfo(n.subscription)),B=e.computed(()=>(n.paymentMethods??[]).find(({id:p})=>{var m;return p===((m=n.subscription)==null?void 0:m.payment_method_id)})),v=e.computed(()=>n.subscription?[n.subscription]:[]),M=e.computed(()=>E.getSubscriptionName({subscription:n.subscription,fallback:o({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(p,m)=>(e.openBlock(),e.createBlock(e.unref($.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",_e,[e.createVNode(e.unref(b._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M.value),1)]),_:1}),e.unref(c)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:0,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Renew subscription",id:"subscription_details.renew_button.label",description:"Label for the renew subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:1,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Cancel subscription",id:"subscription_details.cancel_button.label",description:"Label for the cancel subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]),content:e.withCtx(()=>[S.value?(e.openBlock(),e.createBlock(e.unref(D._sfc_main),{key:0,class:"sv-subscription-details__cancellation-success",type:"success",title:S.value},null,8,["title"])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,class:"sv-subscription-details__error sv-error",title:e.unref(o)({defaultMessage:"Unable to load this subscription. Please try again later.",id:"subscription_details.load_error",description:"Error message shown when the subscription cannot be loaded on the subscription details page"})},null,8,["title"])):t.isLoading?(e.openBlock(),e.createBlock(U._sfc_main,{key:2,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createBlock(e.unref(i),{key:3,class:"sv-subscription-details__schedules","schedules-data":t.schedulesData??[],configuration:{subscriptionId:t.subscription.id},"is-loading":t.isLoading},null,8,["schedules-data","configuration","is-loading"])):(e.openBlock(),e.createBlock(R._sfc_main,{key:4,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Subscription not found",id:"subscription_details.empty_state.title",description:"Title shown when the requested subscription does not exist"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"This subscription is no longer available.",id:"subscription_details.empty_state.message",description:"Message shown when the requested subscription does not exist"})),1)]),_:1}))]),aside:e.withCtx(()=>[e.createVNode(L._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":!!t.hasWalletBalancesError,"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",customer:t.customer,"payment-methods":t.paymentMethods,subscriptions:v.value,onTopUpCharged:m[0]||(m[0]=x=>p.$emit("top-up-charged")),onAutoTopUpSaved:m[1]||(m[1]=x=>p.$emit("auto-top-up-saved")),onAutoTopUpCancelled:m[2]||(m[2]=x=>p.$emit("auto-top-up-cancelled")),onPaymentMethodStored:m[3]||(m[3]=x=>p.$emit("payment-method-stored"))},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),k.value?(e.openBlock(),e.createBlock(le,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":k.value,onUpgrade:e.unref(w)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(O._sfc_main,{key:1,class:"sv-subscription-details__payment-method","is-loading":t.isLoading,"payment-methods":[B.value],configuration:{showViewAllButton:!1,showAddButton:!1}},null,8,["is-loading","payment-methods"])):e.createCommentVNode("",!0),e.createVNode(ge,{"show-modal":!!e.unref(d),variant:e.unref(d),subscription:t.subscription,avatar:t.avatar,onConfirmed:C,onClose:e.unref(y)},null,8,["show-modal","variant","subscription","avatar","onClose"])]),_:1}))}}),ve=e.defineComponent({__name:"SubscriptionDetails.entry.view",props:{configuration:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object}},setup(t){const s=t,i=s.portalObject.customer_id,{subscription:n,withPlanData:a,get:o,error:r}=K.useSubscription({subscriptionId:s.configuration.subscriptionId}),{customer:c,get:d}=Q.useCustomer({customerId:i}),{items:u,fetchAll:g}=X.usePaymentMethods({customerId:i}),{walletBalances:y,apiStatus:w,fetch:h}=L.useCustomerWalletBalances({customerId:i}),{isLoading:C}=ee.useLoadInitialData(o(),d.execute(),g(),h()),S=e.computed(()=>n.value?a(n.value):[]),k=e.computed(()=>{var v;return((v=y.value)==null?void 0:v.wallet_balances)??[]}),B=e.computed(()=>w.value===J.ApiStatus.Failed);return(v,M)=>e.renderSlot(v.$slots,"default",{subscription:e.unref(n),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(u),walletBalances:k.value,hasWalletBalancesError:B.value,isLoading:e.unref(C),error:e.unref(r),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(g),refreshSubscription:e.unref(o)})}}),ye=e.defineComponent({__name:"SubscriptionDetails.entry",props:{configuration:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object}},setup(t){const s=te.getComponentName("subscription-details");return(i,n)=>(e.openBlock(),e.createBlock(e.unref(b._sfc_main$1),{entry:i.$props,"component-name":e.unref(s),"allowed-portal-types":["CUSTOMER"],onError:n[0]||(n[0]=a=>i.$emit("error",a))},{default:e.withCtx(()=>[e.createVNode(ve,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({subscription:a,schedulesData:o,customer:r,paymentMethods:c,walletBalances:d,hasWalletBalancesError:u,isLoading:g,error:y,refreshWalletBalances:w,refreshPaymentMethods:h,refreshSubscription:C})=>[e.createVNode(he,{subscription:a,"schedules-data":o,customer:r,avatar:t.configuration.avatar,"payment-methods":c,"wallet-balances":d,"has-wallet-balances-error":u,"is-loading":g,error:y,onTopUpCharged:w,onAutoTopUpSaved:w,onAutoTopUpCancelled:w,onPaymentMethodStored:h,onSubscriptionChanged:C},null,8,["subscription","schedules-data","customer","avatar","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onAutoTopUpSaved","onAutoTopUpCancelled","onPaymentMethodStored","onSubscriptionChanged"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:we}=b.createSolvimonElement(ye,"subscription-details");exports.defineSolvimonSubscriptionDetails=we;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("../../Alert.vue.es-RyK53a2P.js"),P=require("../../Button.vue.es-CeUTAc2n.js"),T=require("../../ErrorNotification.vue.es-QfRoDhkn.js"),b=require("../../customElements-hH6pju3X.js"),$=require("../../ContentWithAsideLayout-RSdKXqAf.js"),I=require("../../useActionDispatchProvider-CKzeqXzY.js"),E=require("../../subscription-ZA62t4E9.js"),L=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DzbPUvHN.js"),O=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C8diNL5x.js"),R=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-srXOpUb0.js"),U=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),A=require("../../Section.vue.es-CSrVPlUK.js"),j=require("../../pricing-BVAld27Y.js"),V=require("../../formatting.es-C72Nsrmh.js"),W=require("../../PaymentMethod.vue.es-ZWda5GqF.js"),F=require("../../Modal.vue.es-JpE0eh_Q.js"),Y=require("../../subscriptions-BArXBCFr.js"),z=require("../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-BgXZMihr.js"),G=require("../../api.es-duCDtZD9.js"),H=require("../../useIncrementalLoading-CaWOE8Xl.js"),Z=require("../../paymentMethods-CZGP6_4W.js"),J=require("../../error-CmduqgVq.js"),K=require("../../useSubscription-DMAEJves.js"),Q=require("../../useCustomer-DSYr0F58.js"),X=require("../../usePaymentMethods-DZ1a0mnr.js"),ee=require("../../useLoadInitialData-U2WvBmXT.js"),te=require("../../sessionReference-m_6Rp4X1.js");function ne({subscription:t}){const{dispatchAction:s}=I.useActionDispatchProvider(),i=e.computed(()=>{if(!t.value)return!1;const u=t.value.inactive_periods;return!u||u.length===0}),n=e.computed(()=>{var g;const u=(g=t.value)==null?void 0:g.inactive_periods;return Array.isArray(u)&&u.length>0}),a=e.ref();return{isCancellable:i,isRenewable:n,pendingVariant:a,cancel:()=>{t.value&&(a.value="CANCEL")},renew:()=>{t.value&&(a.value="RENEW")},dismiss:()=>{a.value=void 0},manage:()=>{t.value&&s({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}function ie(t){var n,a,o,r,c,d,u;const s=(o=(a=(n=t.items)==null?void 0:n[0])==null?void 0:a.configs)==null?void 0:o[0],i=(c=(r=s==null?void 0:s.details)==null?void 0:r.bands)==null?void 0:c[0];return{amount:(i==null?void 0:i.amount)??(i==null?void 0:i.fixed_amount),billingPeriod:((d=s==null?void 0:s.details)==null?void 0:d.pricing_period)??((u=s==null?void 0:s.details)==null?void 0:u.billing_period)}}function oe(t){var n,a,o;const s=new Set((((n=t.pricing_plan_schedule)==null?void 0:n.enabled_pricings)??[]).map(({pricing_id:r})=>r));return s.size===0?[]:(((o=(a=t.pricing_plan_version)==null?void 0:a.pricing_categories)==null?void 0:o.flatMap(r=>r.pricing_groups??[]))??[]).flatMap(r=>(r.pricings??[]).filter(c=>s.has(c.id)).map(c=>({pricingId:c.id,pricingGroupId:r.id,groupName:r.name,name:j.getNameFromPricing(c)||r.name,...ie(c)})))}const ae={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},se={class:"sv-enabled-pricings-list__item-content grow"},re=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>{const{amount:a,billingPeriod:o}=s.entry;if(a)return o?i({defaultMessage:"{amount} per {period}",id:"enabled_pricings_list.item.price",description:'The recurring price of an enabled pricing, e.g. "€ 100,00 per month"'},{amount:V.formatAmount(a),period:V.formatBillingPeriod(o,{short:!0,hideValueForExactPeriods:!0})}):V.formatAmount(a)});return(a,o)=>(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",se,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"subtle",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"h3",variant:"heading-3","no-spacing":"",class:"sv-enabled-pricings-list__item-name"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.name),1)]),_:1}),n.value?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(P._sfc_main),{intent:"secondary",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:o[0]||(o[0]=r=>a.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Upgrade",id:"enabled_pricings_list.item.upgrade_button.label",description:"Label for the button that changes which pricing is enabled for a group"})),1)]),_:1})])]),_:1}))}}),ce={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},le=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>oe(s.pricingPlanSchedule));return(a,o)=>n.value.length>0?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(i)({defaultMessage:"Upgrades",id:"enabled_pricings_list.title",description:"Title for the block listing the pricings enabled on a subscription"})},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,r=>(e.openBlock(),e.createBlock(re,{key:r.pricingId,entry:r,onUpgrade:o[0]||(o[0]=c=>a.$emit("upgrade",c))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}});function ue({variant:t,renewableUntil:s,billingPeriodEndsAt:i}){const{$t:n}=b.useIntl(),a=e.computed(()=>t.value==="RENEW"),o=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Title of the renew subscription confirmation modal",id:"subscription_cancellation_modal.renew.title"}):n({defaultMessage:"Cancel subscription",description:"Title of the cancel subscription confirmation modal",id:"subscription_cancellation_modal.cancel.title"})),r=e.computed(()=>a.value?s.value?n({defaultMessage:"You can renew your subscription until {date}. After this period you can only create a new subscription.",description:"Explanation of the deadline for undoing a cancellation, shown in the renew subscription modal",id:"subscription_cancellation_modal.renew.explanation_with_date"},{date:s.value}):n({defaultMessage:"Your subscription will continue as before, and billing will resume on its usual schedule.",description:"Explanation of what happens when a cancellation is undone, shown in the renew subscription modal when no end date is known",id:"subscription_cancellation_modal.renew.explanation"}):i.value?n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until {date}.",description:"Explanation of what happens when a running subscription is cancelled, naming the date access ends, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation_with_date"},{date:i.value}):n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until the end of the billing period.",description:"Explanation of what happens when a running subscription is cancelled, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation"})),c=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Label of the confirm button in the renew subscription modal",id:"subscription_cancellation_modal.renew.confirm_button.label"}):n({defaultMessage:"Cancel subscription",description:"Label of the confirm button in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.confirm_button.label"})),d=e.computed(()=>n({defaultMessage:"Cancel",description:"Label of the button that dismisses the cancellation modal",id:"subscription_cancellation_modal.cancel_button.label"})),u=e.computed(()=>a.value?n({defaultMessage:"We could not renew your subscription. Please try again.",description:"Error shown when undoing a cancellation fails",id:"subscription_cancellation_modal.renew.error"}):n({defaultMessage:"We could not cancel your subscription. Please try again.",description:"Error shown when cancelling a subscription fails",id:"subscription_cancellation_modal.cancel.error"}));return{title:o,explanation:r,confirmButtonText:c,cancelButtonText:d,errorMessage:u}}const de=50;function pe(){const{getPaymentMethods:t}=Z.createPaymentMethodsService(),s=e.shallowRef();return{paymentMethod:s,get:async({customerId:n,paymentMethodId:a})=>{const o=await G.getPaginatedFullList(async r=>{const c=await t({customerId:n,pagination:{page:r,pageSize:de}});if(!H.isApiSuccessCollectionResponse(c))throw new Error("Could not load the customer’s payment methods.");return c});return s.value=o.data.find(({id:r})=>r===a),s.value}}}const me={class:"sv-subscription-cancellation-modal sv-subscription-cancellation-modal__body flex flex-col gap-3"},be={key:0,class:"sv-subscription-cancellation-modal__meta flex flex-wrap items-center gap-x-6 gap-y-2 px-3 pb-2"},fe={key:0,class:"sv-subscription-cancellation-modal__renews flex gap-1"},ge=e.defineComponent({__name:"SubscriptionCancellationModal",props:{showModal:{type:Boolean},variant:{type:null},subscription:{type:Object},avatar:{type:String}},emits:["confirmed","close"],setup(t,{emit:s}){const i=t,n=s,{$t:a,formatDate:o}=b.useIntl(),r=b.useLogger(),{setSubscriptionCancellation:c}=Y.createSubscriptionsService(),d=e.computed(()=>i.variant),u=e.computed(()=>{var _;const l=((_=i.subscription)==null?void 0:_.inactive_periods)??[],f=l.find(({type:N})=>N==="CANCEL")??l[0];if(f)return o({date:f.start_at,format:"date",offsetType:"local"})}),g=e.computed(()=>{var f,_;const l=(_=(f=i.subscription)==null?void 0:f.next_invoice)==null?void 0:_.invoice_date;if(l)return o({date:l,format:"date",offsetType:"local"})}),y=g,w=e.computed(()=>{var l,f;return(((f=(l=E.getMostRecentScheduleInfo(i.subscription))==null?void 0:l.pricing_plan_schedule)==null?void 0:f.enabled_pricings)??[]).map(({pricing_id:_})=>_).filter(_=>!!_)}),{title:h,explanation:C,confirmButtonText:S,cancelButtonText:k,errorMessage:B}=ue({variant:d,renewableUntil:u,billingPeriodEndsAt:g}),{paymentMethod:v,get:M}=pe();e.watch([()=>i.showModal,()=>{var l;return(l=i.subscription)==null?void 0:l.payment_method_id},()=>{var l;return(l=i.subscription)==null?void 0:l.customer_id}],([l,f,_])=>{var N;!l||!f||!_||f!==((N=v.value)==null?void 0:N.id)&&M({customerId:_,paymentMethodId:f}).catch(()=>{})},{immediate:!0});const p=e.ref(!1),m=e.ref(!1);e.watch(()=>i.showModal,l=>{l&&(m.value=!1)});const x=async()=>{if(!(!i.subscription||!i.variant||p.value)){p.value=!0,m.value=!1;try{await c({id:i.subscription.id,variant:i.variant}),n("confirmed"),n("close")}catch(l){r.error("SUBSCRIPTION_CANCELLATION_FAILED","Failed to change the cancellation state of a subscription",{variant:i.variant},l),m.value=!0}finally{p.value=!1}}},q=()=>{p.value||n("close")};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(F.Modal),{size:"md","show-modal":t.showModal,title:e.unref(h),"confirm-button-text":e.unref(S),"cancel-button-text":e.unref(k),"is-loading":p.value,"no-click-away":p.value,"no-backdrop-close":p.value,onConfirm:x,onClose:q},{body:e.withCtx(()=>[e.createElementVNode("div",me,[e.createVNode(e.unref(b._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-subscription-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1}),t.subscription?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,"no-spacing":"",class:"sv-subscription-cancellation-modal__subscription"},{default:e.withCtx(()=>[e.createVNode(z._sfc_main,{subscription:t.subscription,avatar:t.avatar,"enabled-pricing-ids":w.value},null,8,["subscription","avatar","enabled-pricing-ids"]),e.unref(y)||e.unref(v)?(e.openBlock(),e.createElementBlock("div",be,[e.unref(y)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Renews",description:"Label before the date the subscription renews, shown in the cancel subscription modal",id:"subscription_cancellation_modal.renews_label"})),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createBlock(e.unref(W._sfc_main),{key:1,variant:"condensed",class:"sv-subscription-cancellation-modal__payment-method","payment-method":e.unref(v)},null,8,["payment-method"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,class:"sv-subscription-cancellation-modal__error sv-error",title:e.unref(B)},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","title","confirm-button-text","cancel-button-text","is-loading","no-click-away","no-backdrop-close"]))}}),_e={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},he=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},avatar:{type:String},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","subscription-changed"],setup(t,{emit:s}){const i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../SubscriptionSchedules-CMVoB2bw.js"))),n=t,a=s,{$t:o}=b.useIntl(),{isCancellable:r,isRenewable:c,pendingVariant:d,cancel:u,renew:g,dismiss:y,manage:w}=ne({subscription:e.toRef(n,"subscription")}),h=e.ref();e.watch(d,p=>{p&&(h.value=void 0)});const C=()=>{h.value=d.value,a("subscription-changed")},S=e.computed(()=>{if(h.value)return h.value==="RENEW"?o({defaultMessage:"Your subscription has been renewed.",id:"subscription_details.renew_success",description:"Confirmation shown after a cancellation has been undone"}):o({defaultMessage:"Your subscription has been cancelled. You keep access until the end of the billing period.",id:"subscription_details.cancel_success",description:"Confirmation shown after a subscription has been cancelled"})}),k=e.computed(()=>E.getMostRecentScheduleInfo(n.subscription)),B=e.computed(()=>(n.paymentMethods??[]).find(({id:p})=>{var m;return p===((m=n.subscription)==null?void 0:m.payment_method_id)})),v=e.computed(()=>n.subscription?[n.subscription]:[]),M=e.computed(()=>E.getSubscriptionName({subscription:n.subscription,fallback:o({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(p,m)=>(e.openBlock(),e.createBlock(e.unref($.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",_e,[e.createVNode(e.unref(b._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M.value),1)]),_:1}),e.unref(c)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:0,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Renew subscription",id:"subscription_details.renew_button.label",description:"Label for the renew subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:1,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Cancel subscription",id:"subscription_details.cancel_button.label",description:"Label for the cancel subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]),content:e.withCtx(()=>[S.value?(e.openBlock(),e.createBlock(e.unref(D._sfc_main),{key:0,class:"sv-subscription-details__cancellation-success",type:"success",title:S.value},null,8,["title"])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,class:"sv-subscription-details__error sv-error",title:e.unref(o)({defaultMessage:"Unable to load this subscription. Please try again later.",id:"subscription_details.load_error",description:"Error message shown when the subscription cannot be loaded on the subscription details page"})},null,8,["title"])):t.isLoading?(e.openBlock(),e.createBlock(U._sfc_main,{key:2,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createBlock(e.unref(i),{key:3,class:"sv-subscription-details__schedules","schedules-data":t.schedulesData??[],configuration:{subscriptionId:t.subscription.id},"is-loading":t.isLoading},null,8,["schedules-data","configuration","is-loading"])):(e.openBlock(),e.createBlock(R._sfc_main,{key:4,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Subscription not found",id:"subscription_details.empty_state.title",description:"Title shown when the requested subscription does not exist"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"This subscription is no longer available.",id:"subscription_details.empty_state.message",description:"Message shown when the requested subscription does not exist"})),1)]),_:1}))]),aside:e.withCtx(()=>[e.createVNode(L._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":!!t.hasWalletBalancesError,"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",customer:t.customer,"payment-methods":t.paymentMethods,subscriptions:v.value,onTopUpCharged:m[0]||(m[0]=x=>p.$emit("top-up-charged")),onAutoTopUpSaved:m[1]||(m[1]=x=>p.$emit("auto-top-up-saved")),onAutoTopUpCancelled:m[2]||(m[2]=x=>p.$emit("auto-top-up-cancelled")),onPaymentMethodStored:m[3]||(m[3]=x=>p.$emit("payment-method-stored"))},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),k.value?(e.openBlock(),e.createBlock(le,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":k.value,onUpgrade:e.unref(w)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(O._sfc_main,{key:1,class:"sv-subscription-details__payment-method","is-loading":t.isLoading,"payment-methods":[B.value],configuration:{showViewAllButton:!1,showAddButton:!1}},null,8,["is-loading","payment-methods"])):e.createCommentVNode("",!0),e.createVNode(ge,{"show-modal":!!e.unref(d),variant:e.unref(d),subscription:t.subscription,avatar:t.avatar,onConfirmed:C,onClose:e.unref(y)},null,8,["show-modal","variant","subscription","avatar","onClose"])]),_:1}))}}),ve=e.defineComponent({__name:"SubscriptionDetails.entry.view",props:{configuration:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object}},setup(t){const s=t,i=s.portalObject.customer_id,{subscription:n,withPlanData:a,get:o,error:r}=K.useSubscription({subscriptionId:s.configuration.subscriptionId}),{customer:c,get:d}=Q.useCustomer({customerId:i}),{items:u,fetchAll:g}=X.usePaymentMethods({customerId:i}),{walletBalances:y,apiStatus:w,fetch:h}=L.useCustomerWalletBalances({customerId:i}),{isLoading:C}=ee.useLoadInitialData(o(),d.execute(),g(),h()),S=e.computed(()=>n.value?a(n.value):[]),k=e.computed(()=>{var v;return((v=y.value)==null?void 0:v.wallet_balances)??[]}),B=e.computed(()=>w.value===J.ApiStatus.Failed);return(v,M)=>e.renderSlot(v.$slots,"default",{subscription:e.unref(n),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(u),walletBalances:k.value,hasWalletBalancesError:B.value,isLoading:e.unref(C),error:e.unref(r),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(g),refreshSubscription:e.unref(o)})}}),ye=e.defineComponent({__name:"SubscriptionDetails.entry",props:{configuration:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object}},setup(t){const s=te.getComponentName("subscription-details");return(i,n)=>(e.openBlock(),e.createBlock(e.unref(b._sfc_main$1),{entry:i.$props,"component-name":e.unref(s),"allowed-portal-types":["CUSTOMER"],onError:n[0]||(n[0]=a=>i.$emit("error",a))},{default:e.withCtx(()=>[e.createVNode(ve,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({subscription:a,schedulesData:o,customer:r,paymentMethods:c,walletBalances:d,hasWalletBalancesError:u,isLoading:g,error:y,refreshWalletBalances:w,refreshPaymentMethods:h,refreshSubscription:C})=>[e.createVNode(he,{subscription:a,"schedules-data":o,customer:r,avatar:t.configuration.avatar,"payment-methods":c,"wallet-balances":d,"has-wallet-balances-error":u,"is-loading":g,error:y,onTopUpCharged:w,onAutoTopUpSaved:w,onAutoTopUpCancelled:w,onPaymentMethodStored:h,onSubscriptionChanged:C},null,8,["subscription","schedules-data","customer","avatar","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onAutoTopUpSaved","onAutoTopUpCancelled","onPaymentMethodStored","onSubscriptionChanged"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:we}=b.createSolvimonElement(ye,"subscription-details");exports.defineSolvimonSubscriptionDetails=we;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { computed as u, ref as D, defineComponent as O, openBlock as c, createBlock as m, unref as e, withCtx as p, createElementVNode as U, createVNode as M, createTextVNode as w, toDisplayString as S, createCommentVNode as C, createElementBlock as F, Fragment as Z, renderList as J, shallowRef as K, watch as W, defineAsyncComponent as Q, toRef as X, renderSlot as ee, normalizeProps as te, guardReactiveProps as ne } from "vue";
|
|
2
2
|
import { _ as ae } from "../../Alert.vue.es-lIiAWf2S.mjs";
|
|
3
|
-
import { _ as V } from "../../Button.vue.es-
|
|
4
|
-
import { _ as G } from "../../ErrorNotification.vue.es-
|
|
5
|
-
import { u as N, _ as E, b as se, d as ie, e as oe } from "../../customElements-
|
|
6
|
-
import { C as re } from "../../ContentWithAsideLayout-
|
|
7
|
-
import { u as le } from "../../useActionDispatchProvider-
|
|
3
|
+
import { _ as V } from "../../Button.vue.es-BbSN0uOk.mjs";
|
|
4
|
+
import { _ as G } from "../../ErrorNotification.vue.es-CiUJva6S.mjs";
|
|
5
|
+
import { u as N, _ as E, b as se, d as ie, e as oe } from "../../customElements-q_i9y0Ph.mjs";
|
|
6
|
+
import { C as re } from "../../ContentWithAsideLayout-BCM8tmZN.mjs";
|
|
7
|
+
import { u as le } from "../../useActionDispatchProvider-BdciAX8T.mjs";
|
|
8
8
|
import { b as q, a as ce } from "../../subscription-CrVOr5MF.mjs";
|
|
9
|
-
import { _ as ue, u as de } from "../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { _ as pe } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
11
|
-
import { _ as me } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { _ as ue, u as de } from "../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-xqMsbuU6.mjs";
|
|
10
|
+
import { _ as pe } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BZwGWhaL.mjs";
|
|
11
|
+
import { _ as me } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-kpjrC-4q.mjs";
|
|
12
12
|
import { _ as be } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
|
|
13
|
-
import { _ as Y } from "../../Section.vue.es-
|
|
13
|
+
import { _ as Y } from "../../Section.vue.es-D5svcVS_.mjs";
|
|
14
14
|
import { g as ge } from "../../pricing-DLOeiAIB.mjs";
|
|
15
15
|
import { f as z, b as fe } from "../../formatting.es-RclXHhKo.mjs";
|
|
16
|
-
import { _ as he } from "../../PaymentMethod.vue.es-
|
|
17
|
-
import { M as ve } from "../../Modal.vue.es-
|
|
18
|
-
import { c as _e } from "../../subscriptions
|
|
19
|
-
import { _ as ye } from "../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-
|
|
16
|
+
import { _ as he } from "../../PaymentMethod.vue.es-m1NasGqw.mjs";
|
|
17
|
+
import { M as ve } from "../../Modal.vue.es-BuRlbyZw.mjs";
|
|
18
|
+
import { c as _e } from "../../subscriptions--9MaTXMb.mjs";
|
|
19
|
+
import { _ as ye } from "../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-BmNl5u8R.mjs";
|
|
20
20
|
import { g as we } from "../../api.es-QaC926Xu.mjs";
|
|
21
21
|
import { i as Se } from "../../useIncrementalLoading-Cgxw2GD7.mjs";
|
|
22
|
-
import { c as Ce } from "../../paymentMethods-
|
|
22
|
+
import { c as Ce } from "../../paymentMethods-DEKp_4QM.mjs";
|
|
23
23
|
import { A as Me } from "../../error-BHVZJGwD.mjs";
|
|
24
|
-
import { u as xe } from "../../useSubscription-
|
|
25
|
-
import { u as $e } from "../../useCustomer-
|
|
26
|
-
import { u as Pe } from "../../usePaymentMethods-
|
|
27
|
-
import { u as Ae } from "../../useLoadInitialData-
|
|
24
|
+
import { u as xe } from "../../useSubscription-DSsXVO0h.mjs";
|
|
25
|
+
import { u as $e } from "../../useCustomer-D8ixhuuj.mjs";
|
|
26
|
+
import { u as Pe } from "../../usePaymentMethods-BnmSo_rr.mjs";
|
|
27
|
+
import { u as Ae } from "../../useLoadInitialData-BDmmpcfb.mjs";
|
|
28
28
|
import { a as ke } from "../../sessionReference-3h-6FdrC.mjs";
|
|
29
29
|
function Ee({
|
|
30
30
|
subscription: t
|
|
@@ -470,7 +470,7 @@ const Fe = { class: "sv-subscription-cancellation-modal sv-subscription-cancella
|
|
|
470
470
|
emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "subscription-changed"],
|
|
471
471
|
setup(t, { emit: o }) {
|
|
472
472
|
const a = Q(
|
|
473
|
-
() => import("../../SubscriptionSchedules-
|
|
473
|
+
() => import("../../SubscriptionSchedules-yDcsD1hd.mjs")
|
|
474
474
|
), n = t, i = o, { $t: s } = N(), {
|
|
475
475
|
isCancellable: r,
|
|
476
476
|
isRenewable: l,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A=require("../../Button.vue.es-CJNxYacb.js"),L=require("../../ErrorNotification.vue.es-DI2B7WiR.js"),m=require("../../customElements-BYIdPSzQ.js"),Y=require("../../ContentWithAsideLayout-C6yMIVJF.js"),K=require("../../useActionDispatchProvider-CTyDGRX8.js"),H=require("../../usePortal-BplmMkBG.js"),J=require("../../useSubscription-CvB8ROBt.js"),Q=require("../../useCustomer-BXI5Vmit.js"),X=require("../../usePaymentMethods-BAOtOJZD.js"),Z=require("../../usePaymentMethodOptions-BPBVGNDg.js"),ee=require("../../useLoadInitialData-BO9ZsSsF.js"),te=require("../../invoices-mw87cNTS.js"),E=require("../../pricingPlanSchedule-BM8vsKkV.js"),ne=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DIgVzXLg.js"),ie=require("../../Divider.vue.es-UwnWvUTl.js"),ae=require("../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-BJfQLRcS.js"),T=require("../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jXClPW91.js"),oe=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js"),se=require("../../Section.vue.es-Cybk1Nb8.js"),j=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),re=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BNZ9-GW1.js"),ce=require("../../Modal.vue.es-DgLl6XBV.js"),ue=require("../../sessionReference-m_6Rp4X1.js");function le(){const{getInvoicePreview:t}=te.createInvoicesService(),a=m.useLogger(),n=e.ref(),o=e.ref(!1),c=e.ref(),p=m.createLatestGuard();return{invoice:n,isPending:o,error:c,load:async({subscription:u,enabledPricingIds:f})=>{const s=E.getScheduleCustomizations({enabledPricings:f.map(d=>({pricing_id:d})),pricingPlanScheduleInfos:u.pricing_plan_schedule_infos});if(!s){n.value=void 0;return}const i=p();o.value=!0,c.value=void 0;try{const d=await t({forExistingSubscription:!0,pricingPlanSubscriptionId:u.id,customizations:s});if(!i())return;n.value=d.invoice}catch(d){if(!i())return;a.error("INVOICE_PREVIEW_FAILED","Failed to preview the subscription upgrade",{},d),c.value=d,n.value=void 0}finally{i()&&(o.value=!1)}}}}function de(){const t=m.createRequestService(),a=m.useConfig();function n({scheduleId:c}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules/${c}/on-demand-pricing-items`})}function o({pricingPlanSubscriptionId:c,enabledPricings:p}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules`,options:{method:"POST"},data:{pricing_plan_subscription_id:c,enabled_pricings:p,start_at:new Date().toJSON()}})}return{getOnDemandPricingItems:n,createPricingPlanSchedule:o}}const me={class:"sv-subscription-management-form__body grid grid-cols-1 gap-4"},pe=e.defineComponent({__name:"SubscriptionManagementForm",props:e.mergeModels({pricingGroup:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},billingPeriod:{type:Object},currency:{type:String},disabled:{type:Boolean}},{enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{},paymentMethodId:{},paymentMethodIdModifiers:{}}),emits:e.mergeModels(["add-payment-method"],["update:enabledPricingIds","update:paymentMethodId"]),setup(t,{emit:a}){const n=t,o=a,c=e.useModel(t,"enabledPricingIds"),p=e.useModel(t,"paymentMethodId"),{$t:_}=m.useIntl(),u=s=>{const i=s?Date.parse(s):NaN;return Number.isFinite(i)?i:0},f=e.computed(()=>[...n.paymentMethods??[]].sort((s,i)=>u(i.created_at)-u(s.created_at)));return e.watch(()=>n.paymentMethods,(s,i)=>{var P;const d=s==null?void 0:s.find(({id:b})=>!(i!=null&&i.some(B=>B.id===b)));if(d&&(i!=null&&i.length)){p.value=d.id;return}s!=null&&s.some(({id:b})=>b===p.value)||(p.value=(P=(s==null?void 0:s.find(({is_default:b})=>b))??f.value[0])==null?void 0:P.id)},{immediate:!0}),(s,i)=>(e.openBlock(),e.createElementBlock("form",{class:"sv-subscription-management-form",onSubmit:i[3]||(i[3]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",me,[e.createVNode(ae._sfc_main,{modelValue:c.value,"onUpdate:modelValue":i[0]||(i[0]=d=>c.value=d),class:"sv-subscription-management-form__pricing-group","group-name":t.pricingGroup.name,pricings:t.pricingGroup.pricings,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"]),e.createElementVNode("div",null,[e.createVNode(e.unref(ie._sfc_main),{spacing:"xs"})]),e.createVNode(T._sfc_main,{modelValue:p.value,"onUpdate:modelValue":i[1]||(i[1]=d=>p.value=d),class:"sv-subscription-management-form__payment-methods","payment-methods":f.value,"payment-method-options":t.paymentMethodOptions,required:"",disabled:t.disabled,label:e.unref(_)({defaultMessage:"Payment method",id:"subscription_management.payment_method_selector.label",description:"Label above the payment method that pays for the subscription change"}),onAddPaymentMethod:i[2]||(i[2]=d=>o("add-payment-method"))},null,8,["modelValue","payment-methods","payment-method-options","disabled","label"])])],32))}}),ge=e.defineComponent({__name:"TranslationOverride",props:{messages:{type:Object}},setup(t){const a=t,n=e.inject(m.TRANSLATION_SETTINGS_KEY,void 0),o=e.computed(()=>({...n==null?void 0:n.messages.value,...a.messages}));return(c,p)=>{var _,u;return e.openBlock(),e.createBlock(e.unref(m._sfc_main$2),{locale:(_=e.unref(n))==null?void 0:_.locale.value,"date-locale":(u=e.unref(n))==null?void 0:u.dateLocale.value,messages:o.value,"show-timezones":!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},8,["locale","date-locale","messages"])}}}),fe=e.defineComponent({__name:"SubscriptionManagementSummary",props:{invoice:{type:Object},isPending:{type:Boolean},hasError:{type:Boolean}},setup(t){const{$t:a}=m.useIntl(),n=e.computed(()=>({"invoice_preview.total_due_today_heading":a({defaultMessage:"Total due",id:"subscription_management.summary.total_due_heading",description:'Heading above the total of the invoice previewing a subscription change, replacing the shared preview’s "Total due today"'})}));return(o,c)=>(e.openBlock(),e.createBlock(e.unref(se._sfc_main),{class:"sv-subscription-management-summary",title:e.unref(a)({defaultMessage:"Order summary",id:"subscription_management.summary.title",description:"Title of the block previewing what a subscription change is invoiced for"})},{default:e.withCtx(()=>[t.hasError?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management-summary__error sv-error",title:e.unref(a)({defaultMessage:"Unable to calculate the total. Please try again.",id:"subscription_management.summary.error",description:"Error shown when the invoice preview for a subscription change cannot be loaded"})},null,8,["title"])):t.isPending||!t.invoice?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"sv-subscription-management-summary__skeleton min-h-[120px]"},{default:e.withCtx(()=>[t.isPending?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,variant:"body-sm",color:"subtle",tag:"div",class:"sv-subscription-management-summary__empty-state"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Select your plan to see what it costs.",id:"subscription_management.summary.empty_state",description:"Shown in the order summary before a plan has been picked to preview"})),1)]),_:1}))]),_:1})):(e.openBlock(),e.createBlock(ge,{key:2,messages:n.value},{default:e.withCtx(()=>[e.createVNode(e.unref(oe._sfc_main$1),{class:"sv-subscription-management-summary__invoice",invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1},8,["messages"]))]),_:1},8,["title"]))}}),_e={class:"sv-subscription-management-success grid grid-cols-1 gap-4"},ve={class:"sv-subscription-management-success__message"},be=e.defineComponent({__name:"SubscriptionManagementSuccess",props:{pricingGroupName:{type:String}},setup(t){const a=t,{$t:n}=m.useIntl(),o=e.computed(()=>n({defaultMessage:"Subscription updated",description:"Title shown on the manage subscription screen once the change is committed",id:"subscription_management.success.title"})),c=e.computed(()=>a.pricingGroupName?n({defaultMessage:"Your {subject} has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of the pricing group a committed subscription change applied to",id:"subscription_management.success.message"},{subject:a.pricingGroupName}):n({defaultMessage:"Your subscription has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of a committed subscription change when the pricing group is not known",id:"subscription_management.success.message_generic"}));return(p,_)=>(e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(re._sfc_main,{status:"success",title:o.value},{default:e.withCtx(()=>[e.createElementVNode("span",ve,e.toDisplayString(c.value),1)]),_:1},8,["title"])]))}}),he=e.defineComponent({__name:"AddPaymentMethodModal",props:{showModal:{type:Boolean},customer:{type:Object},paymentMethodOptions:{type:Array},isLoading:{type:Boolean}},emits:["success","failure","close"],setup(t,{emit:a}){const n=a,{$t:o}=m.useIntl(),c=e.ref(),p=e.computed(()=>{var u;return!!((u=c.value)!=null&&u.isSaving)}),_=()=>{var u;(u=c.value)==null||u.submit()};return(u,f)=>(e.openBlock(),e.createBlock(e.unref(ce.Modal),{"no-click-away":"",size:"lg","show-modal":t.showModal,"is-loading":p.value,title:e.unref(o)({defaultMessage:"Add payment method",id:"add_payment_method_modal.title",description:"Title of the modal for adding a payment method"}),"sub-title":e.unref(o)({defaultMessage:"Add a new payment method to pay with.",id:"add_payment_method_modal.subtitle",description:"Subtitle of the modal for adding a payment method"}),"confirm-button-text":e.unref(o)({defaultMessage:"Save payment method",id:"add_payment_method_modal.confirm_button.label",description:"Label of the button that stores the payment method being added"}),"cancel-button-text":e.unref(o)({defaultMessage:"Cancel",id:"add_payment_method_modal.cancel_button.label",description:"Label of the button that abandons adding a payment method"}),onConfirm:_,onClose:f[2]||(f[2]=s=>n("close"))},{body:e.withCtx(()=>[e.createVNode(T._sfc_main$1,{ref_key:"addPaymentMethodRef",ref:c,class:"sv-add-payment-method-modal sv-add-payment-method-modal__form",customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isLoading,"is-active":t.showModal,onSuccess:f[0]||(f[0]=s=>n("success")),onFailure:f[1]||(f[1]=s=>n("failure",s))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:1},8,["show-modal","is-loading","title","sub-title","confirm-button-text","cancel-button-text"]))}}),ye={class:"sv-subscription-management__header"},we={class:"flex flex-col gap-2"},Se=e.defineComponent({__name:"SubscriptionManagement",props:{configuration:{type:Object}},setup(t){const a=t,{$t:n}=m.useIntl(),o=H.usePortal(),c=m.useLogger(),{dispatchAction:p}=K.useActionDispatchProvider(),{createPricingPlanSchedule:_}=de(),{subscription:u,get:f}=J.useSubscription({subscriptionId:a.configuration.subscriptionId}),{items:s,fetchAll:i}=X.usePaymentMethods({customerId:o.value.customer_id}),{customer:d,get:P}=Q.useCustomer({customerId:o.value.customer_id}),{paymentMethodOptions:b,get:B}=Z.usePaymentMethodOptions(),{isLoading:C}=ee.useLoadInitialData(f(),i(),P.execute(),B({customerId:o.value.customer_id})),k=e.ref(!1),D=async()=>{await i(),k.value=!1},N=e.computed(()=>{var r;return E.getActiveDefaultScheduleInfo(((r=u.value)==null?void 0:r.pricing_plan_schedule_infos)??[])}),w=e.computed(()=>{var h;const r=N.value;if(!r)return;const{enabledPricingId:l}=a.configuration;return(l?[l]:(((h=r.pricing_plan_schedule)==null?void 0:h.enabled_pricings)??[]).map(({pricing_id:g})=>g)).map(g=>E.getPricingGroupByPricingId({pricingPlanScheduleInfo:r,pricingId:g})).find(g=>!!g)}),U=e.computed(()=>{var r;return n({defaultMessage:"Manage {subject}",id:"subscription_management.title",description:"Title for the manage subscription page, naming the pricing group being changed"},{subject:((r=w.value)==null?void 0:r.name)||n({defaultMessage:"subscription",id:"subscription_management.title.default_subject",description:'Stands in for the pricing group name in the manage subscription title when no group is known, e.g. "Manage subscription"'})})}),y=e.ref([]),x=e.ref();e.watch([N,w],([r,l])=>{var q;const v=(((q=r==null?void 0:r.pricing_plan_schedule)==null?void 0:q.enabled_pricings)??[]).map(({pricing_id:S})=>S),{enabledPricingId:h}=a.configuration,g=((l==null?void 0:l.pricings)??[]).map(({id:S})=>S);y.value=h&&g.includes(h)?[...v.filter(S=>!g.includes(S)),h]:v},{immediate:!0});const{invoice:G,isPending:F,error:R,load:z}=le();e.watch([y,u],([r,l])=>{!l||r.length===0||z({subscription:l,enabledPricingIds:r})},{immediate:!0});const M=e.ref(!1),I=e.ref(),V=e.ref(!1),$=e.computed(()=>!C.value&&!M.value&&y.value.length>0&&!!u.value&&!!x.value),W=async()=>{if(!(!$.value||!u.value)){M.value=!0,I.value=void 0;try{await _({pricingPlanSubscriptionId:u.value.id,enabledPricings:y.value.map(r=>({pricing_id:r}))}),V.value=!0}catch(r){c.error("SUBSCRIPTION_UPDATE_FAILED","Failed to start a new pricing plan schedule",{},r),I.value=n({defaultMessage:"Something went wrong. Please try again.",id:"subscription_management.update_error",description:"Error shown when committing a subscription change fails"})}finally{M.value=!1}}},O=e.computed(()=>{var r,l,v;return((l=(r=N.value)==null?void 0:r.pricing_plan_schedule)==null?void 0:l.billing_period)??((v=u.value)==null?void 0:v.billing_period)});return(r,l)=>(e.openBlock(),e.createBlock(e.unref(Y.ContentWithAsideLayout),{class:"sv-subscription-management sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(m._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-management__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(U.value),1)]),_:1})])]),content:e.withCtx(()=>{var v,h;return[V.value?(e.openBlock(),e.createBlock(be,{key:0,class:"sv-subscription-management__success","pricing-group-name":(v=w.value)==null?void 0:v.name},null,8,["pricing-group-name"])):e.unref(C)?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"min-h-[220px]"})):w.value&&O.value?(e.openBlock(),e.createBlock(pe,{key:2,"enabled-pricing-ids":y.value,"onUpdate:enabledPricingIds":l[0]||(l[0]=g=>y.value=g),"payment-method-id":x.value,"onUpdate:paymentMethodId":l[1]||(l[1]=g=>x.value=g),class:"sv-subscription-management__form","pricing-group":w.value,"payment-methods":e.unref(s),"payment-method-options":e.unref(b),"billing-period":O.value,currency:(h=e.unref(u))==null?void 0:h.billing_currency,onAddPaymentMethod:l[2]||(l[2]=g=>k.value=!0)},null,8,["enabled-pricing-ids","payment-method-id","pricing-group","payment-methods","payment-method-options","billing-period","currency"])):e.createCommentVNode("",!0),e.createVNode(he,{"show-modal":k.value,customer:e.unref(d),"payment-method-options":e.unref(b),onSuccess:D,onClose:l[3]||(l[3]=g=>k.value=!1)},null,8,["show-modal","customer","payment-method-options"])]}),aside:e.withCtx(()=>[V.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__done w-full",type:"button",onClick:l[4]||(l[4]=v=>e.unref(p)({action:"navigate-to-customer-overview"}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Done",id:"subscription_management.done_button.label",description:"Label of the button that leaves the manage subscription screen once the change is committed"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(fe,{class:"sv-subscription-management__summary",invoice:e.unref(G),"is-pending":e.unref(C)||e.unref(F),"has-error":!!e.unref(R)},null,8,["invoice","is-pending","has-error"]),I.value?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management__update-error sv-error",title:I.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",we,[e.createVNode(e.unref(A._sfc_main),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__update w-full",type:"button",disabled:!$.value,loading:M.value,onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Update subscription",id:"subscription_management.update_button.label",description:"Label of the button that commits the subscription change"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(ne._sfc_main$1,{class:"sv-subscription-management__kpi","payment-method-options":e.unref(b)},null,8,["payment-method-options"])])],64))]),_:1}))}}),Pe=e.defineComponent({__name:"SubscriptionManagement.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup(t){const a=ue.getComponentName("subscription-management");return(n,o)=>(e.openBlock(),e.createBlock(e.unref(m._sfc_main$1),{entry:n.$props,"component-name":e.unref(a),"allowed-portal-types":["CUSTOMER"],onError:o[0]||(o[0]=c=>n.$emit("error",c))},{default:e.withCtx(()=>[e.createVNode(Se,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["entry","component-name"]))}}),{define:ke}=m.createSolvimonElement(Pe,"subscription-management");exports.defineSolvimonSubscriptionManagement=ke;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A=require("../../Button.vue.es-CeUTAc2n.js"),L=require("../../ErrorNotification.vue.es-QfRoDhkn.js"),m=require("../../customElements-hH6pju3X.js"),Y=require("../../ContentWithAsideLayout-RSdKXqAf.js"),K=require("../../useActionDispatchProvider-CKzeqXzY.js"),H=require("../../usePortal-Hm7wvtgQ.js"),J=require("../../useSubscription-DMAEJves.js"),Q=require("../../useCustomer-DSYr0F58.js"),X=require("../../usePaymentMethods-DZ1a0mnr.js"),Z=require("../../usePaymentMethodOptions-CXdFKFqZ.js"),ee=require("../../useLoadInitialData-U2WvBmXT.js"),te=require("../../invoices-CHp75zZI.js"),E=require("../../pricingPlanSchedule-BM8vsKkV.js"),ne=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BqOSBdFQ.js"),ie=require("../../Divider.vue.es-UwnWvUTl.js"),ae=require("../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-iE4dLawA.js"),T=require("../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BM1_31Tl.js"),oe=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-srXOpUb0.js"),se=require("../../Section.vue.es-CSrVPlUK.js"),j=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),re=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-YpcWHm24.js"),ce=require("../../Modal.vue.es-JpE0eh_Q.js"),ue=require("../../sessionReference-m_6Rp4X1.js");function le(){const{getInvoicePreview:t}=te.createInvoicesService(),a=m.useLogger(),n=e.ref(),o=e.ref(!1),c=e.ref(),p=m.createLatestGuard();return{invoice:n,isPending:o,error:c,load:async({subscription:u,enabledPricingIds:f})=>{const s=E.getScheduleCustomizations({enabledPricings:f.map(d=>({pricing_id:d})),pricingPlanScheduleInfos:u.pricing_plan_schedule_infos});if(!s){n.value=void 0;return}const i=p();o.value=!0,c.value=void 0;try{const d=await t({forExistingSubscription:!0,pricingPlanSubscriptionId:u.id,customizations:s});if(!i())return;n.value=d.invoice}catch(d){if(!i())return;a.error("INVOICE_PREVIEW_FAILED","Failed to preview the subscription upgrade",{},d),c.value=d,n.value=void 0}finally{i()&&(o.value=!1)}}}}function de(){const t=m.createRequestService(),a=m.useConfig();function n({scheduleId:c}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules/${c}/on-demand-pricing-items`})}function o({pricingPlanSubscriptionId:c,enabledPricings:p}){return t({url:`${a.apiUrls.config}/portal/pricing-plan-schedules`,options:{method:"POST"},data:{pricing_plan_subscription_id:c,enabled_pricings:p,start_at:new Date().toJSON()}})}return{getOnDemandPricingItems:n,createPricingPlanSchedule:o}}const me={class:"sv-subscription-management-form__body grid grid-cols-1 gap-4"},pe=e.defineComponent({__name:"SubscriptionManagementForm",props:e.mergeModels({pricingGroup:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},billingPeriod:{type:Object},currency:{type:String},disabled:{type:Boolean}},{enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{},paymentMethodId:{},paymentMethodIdModifiers:{}}),emits:e.mergeModels(["add-payment-method"],["update:enabledPricingIds","update:paymentMethodId"]),setup(t,{emit:a}){const n=t,o=a,c=e.useModel(t,"enabledPricingIds"),p=e.useModel(t,"paymentMethodId"),{$t:_}=m.useIntl(),u=s=>{const i=s?Date.parse(s):NaN;return Number.isFinite(i)?i:0},f=e.computed(()=>[...n.paymentMethods??[]].sort((s,i)=>u(i.created_at)-u(s.created_at)));return e.watch(()=>n.paymentMethods,(s,i)=>{var P;const d=s==null?void 0:s.find(({id:b})=>!(i!=null&&i.some(B=>B.id===b)));if(d&&(i!=null&&i.length)){p.value=d.id;return}s!=null&&s.some(({id:b})=>b===p.value)||(p.value=(P=(s==null?void 0:s.find(({is_default:b})=>b))??f.value[0])==null?void 0:P.id)},{immediate:!0}),(s,i)=>(e.openBlock(),e.createElementBlock("form",{class:"sv-subscription-management-form",onSubmit:i[3]||(i[3]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",me,[e.createVNode(ae._sfc_main,{modelValue:c.value,"onUpdate:modelValue":i[0]||(i[0]=d=>c.value=d),class:"sv-subscription-management-form__pricing-group","group-name":t.pricingGroup.name,pricings:t.pricingGroup.pricings,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"]),e.createElementVNode("div",null,[e.createVNode(e.unref(ie._sfc_main),{spacing:"xs"})]),e.createVNode(T._sfc_main,{modelValue:p.value,"onUpdate:modelValue":i[1]||(i[1]=d=>p.value=d),class:"sv-subscription-management-form__payment-methods","payment-methods":f.value,"payment-method-options":t.paymentMethodOptions,required:"",disabled:t.disabled,label:e.unref(_)({defaultMessage:"Payment method",id:"subscription_management.payment_method_selector.label",description:"Label above the payment method that pays for the subscription change"}),onAddPaymentMethod:i[2]||(i[2]=d=>o("add-payment-method"))},null,8,["modelValue","payment-methods","payment-method-options","disabled","label"])])],32))}}),ge=e.defineComponent({__name:"TranslationOverride",props:{messages:{type:Object}},setup(t){const a=t,n=e.inject(m.TRANSLATION_SETTINGS_KEY,void 0),o=e.computed(()=>({...n==null?void 0:n.messages.value,...a.messages}));return(c,p)=>{var _,u;return e.openBlock(),e.createBlock(e.unref(m._sfc_main$2),{locale:(_=e.unref(n))==null?void 0:_.locale.value,"date-locale":(u=e.unref(n))==null?void 0:u.dateLocale.value,messages:o.value,"show-timezones":!1},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},8,["locale","date-locale","messages"])}}}),fe=e.defineComponent({__name:"SubscriptionManagementSummary",props:{invoice:{type:Object},isPending:{type:Boolean},hasError:{type:Boolean}},setup(t){const{$t:a}=m.useIntl(),n=e.computed(()=>({"invoice_preview.total_due_today_heading":a({defaultMessage:"Total due",id:"subscription_management.summary.total_due_heading",description:'Heading above the total of the invoice previewing a subscription change, replacing the shared preview’s "Total due today"'})}));return(o,c)=>(e.openBlock(),e.createBlock(e.unref(se._sfc_main),{class:"sv-subscription-management-summary",title:e.unref(a)({defaultMessage:"Order summary",id:"subscription_management.summary.title",description:"Title of the block previewing what a subscription change is invoiced for"})},{default:e.withCtx(()=>[t.hasError?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management-summary__error sv-error",title:e.unref(a)({defaultMessage:"Unable to calculate the total. Please try again.",id:"subscription_management.summary.error",description:"Error shown when the invoice preview for a subscription change cannot be loaded"})},null,8,["title"])):t.isPending||!t.invoice?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"sv-subscription-management-summary__skeleton min-h-[120px]"},{default:e.withCtx(()=>[t.isPending?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,variant:"body-sm",color:"subtle",tag:"div",class:"sv-subscription-management-summary__empty-state"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Select your plan to see what it costs.",id:"subscription_management.summary.empty_state",description:"Shown in the order summary before a plan has been picked to preview"})),1)]),_:1}))]),_:1})):(e.openBlock(),e.createBlock(ge,{key:2,messages:n.value},{default:e.withCtx(()=>[e.createVNode(e.unref(oe._sfc_main$1),{class:"sv-subscription-management-summary__invoice",invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1},8,["messages"]))]),_:1},8,["title"]))}}),_e={class:"sv-subscription-management-success grid grid-cols-1 gap-4"},ve={class:"sv-subscription-management-success__message"},be=e.defineComponent({__name:"SubscriptionManagementSuccess",props:{pricingGroupName:{type:String}},setup(t){const a=t,{$t:n}=m.useIntl(),o=e.computed(()=>n({defaultMessage:"Subscription updated",description:"Title shown on the manage subscription screen once the change is committed",id:"subscription_management.success.title"})),c=e.computed(()=>a.pricingGroupName?n({defaultMessage:"Your {subject} has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of the pricing group a committed subscription change applied to",id:"subscription_management.success.message"},{subject:a.pricingGroupName}):n({defaultMessage:"Your subscription has been changed. Please be aware that it can take some time to reflect this change in your subscription.",description:"Confirmation of a committed subscription change when the pricing group is not known",id:"subscription_management.success.message_generic"}));return(p,_)=>(e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(re._sfc_main,{status:"success",title:o.value},{default:e.withCtx(()=>[e.createElementVNode("span",ve,e.toDisplayString(c.value),1)]),_:1},8,["title"])]))}}),he=e.defineComponent({__name:"AddPaymentMethodModal",props:{showModal:{type:Boolean},customer:{type:Object},paymentMethodOptions:{type:Array},isLoading:{type:Boolean}},emits:["success","failure","close"],setup(t,{emit:a}){const n=a,{$t:o}=m.useIntl(),c=e.ref(),p=e.computed(()=>{var u;return!!((u=c.value)!=null&&u.isSaving)}),_=()=>{var u;(u=c.value)==null||u.submit()};return(u,f)=>(e.openBlock(),e.createBlock(e.unref(ce.Modal),{"no-click-away":"",size:"lg","show-modal":t.showModal,"is-loading":p.value,title:e.unref(o)({defaultMessage:"Add payment method",id:"add_payment_method_modal.title",description:"Title of the modal for adding a payment method"}),"sub-title":e.unref(o)({defaultMessage:"Add a new payment method to pay with.",id:"add_payment_method_modal.subtitle",description:"Subtitle of the modal for adding a payment method"}),"confirm-button-text":e.unref(o)({defaultMessage:"Save payment method",id:"add_payment_method_modal.confirm_button.label",description:"Label of the button that stores the payment method being added"}),"cancel-button-text":e.unref(o)({defaultMessage:"Cancel",id:"add_payment_method_modal.cancel_button.label",description:"Label of the button that abandons adding a payment method"}),onConfirm:_,onClose:f[2]||(f[2]=s=>n("close"))},{body:e.withCtx(()=>[e.createVNode(T._sfc_main$1,{ref_key:"addPaymentMethodRef",ref:c,class:"sv-add-payment-method-modal sv-add-payment-method-modal__form",customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isLoading,"is-active":t.showModal,onSuccess:f[0]||(f[0]=s=>n("success")),onFailure:f[1]||(f[1]=s=>n("failure",s))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:1},8,["show-modal","is-loading","title","sub-title","confirm-button-text","cancel-button-text"]))}}),ye={class:"sv-subscription-management__header"},we={class:"flex flex-col gap-2"},Se=e.defineComponent({__name:"SubscriptionManagement",props:{configuration:{type:Object}},setup(t){const a=t,{$t:n}=m.useIntl(),o=H.usePortal(),c=m.useLogger(),{dispatchAction:p}=K.useActionDispatchProvider(),{createPricingPlanSchedule:_}=de(),{subscription:u,get:f}=J.useSubscription({subscriptionId:a.configuration.subscriptionId}),{items:s,fetchAll:i}=X.usePaymentMethods({customerId:o.value.customer_id}),{customer:d,get:P}=Q.useCustomer({customerId:o.value.customer_id}),{paymentMethodOptions:b,get:B}=Z.usePaymentMethodOptions(),{isLoading:C}=ee.useLoadInitialData(f(),i(),P.execute(),B({customerId:o.value.customer_id})),k=e.ref(!1),D=async()=>{await i(),k.value=!1},N=e.computed(()=>{var r;return E.getActiveDefaultScheduleInfo(((r=u.value)==null?void 0:r.pricing_plan_schedule_infos)??[])}),w=e.computed(()=>{var h;const r=N.value;if(!r)return;const{enabledPricingId:l}=a.configuration;return(l?[l]:(((h=r.pricing_plan_schedule)==null?void 0:h.enabled_pricings)??[]).map(({pricing_id:g})=>g)).map(g=>E.getPricingGroupByPricingId({pricingPlanScheduleInfo:r,pricingId:g})).find(g=>!!g)}),U=e.computed(()=>{var r;return n({defaultMessage:"Manage {subject}",id:"subscription_management.title",description:"Title for the manage subscription page, naming the pricing group being changed"},{subject:((r=w.value)==null?void 0:r.name)||n({defaultMessage:"subscription",id:"subscription_management.title.default_subject",description:'Stands in for the pricing group name in the manage subscription title when no group is known, e.g. "Manage subscription"'})})}),y=e.ref([]),x=e.ref();e.watch([N,w],([r,l])=>{var q;const v=(((q=r==null?void 0:r.pricing_plan_schedule)==null?void 0:q.enabled_pricings)??[]).map(({pricing_id:S})=>S),{enabledPricingId:h}=a.configuration,g=((l==null?void 0:l.pricings)??[]).map(({id:S})=>S);y.value=h&&g.includes(h)?[...v.filter(S=>!g.includes(S)),h]:v},{immediate:!0});const{invoice:G,isPending:F,error:R,load:z}=le();e.watch([y,u],([r,l])=>{!l||r.length===0||z({subscription:l,enabledPricingIds:r})},{immediate:!0});const M=e.ref(!1),I=e.ref(),V=e.ref(!1),$=e.computed(()=>!C.value&&!M.value&&y.value.length>0&&!!u.value&&!!x.value),W=async()=>{if(!(!$.value||!u.value)){M.value=!0,I.value=void 0;try{await _({pricingPlanSubscriptionId:u.value.id,enabledPricings:y.value.map(r=>({pricing_id:r}))}),V.value=!0}catch(r){c.error("SUBSCRIPTION_UPDATE_FAILED","Failed to start a new pricing plan schedule",{},r),I.value=n({defaultMessage:"Something went wrong. Please try again.",id:"subscription_management.update_error",description:"Error shown when committing a subscription change fails"})}finally{M.value=!1}}},O=e.computed(()=>{var r,l,v;return((l=(r=N.value)==null?void 0:r.pricing_plan_schedule)==null?void 0:l.billing_period)??((v=u.value)==null?void 0:v.billing_period)});return(r,l)=>(e.openBlock(),e.createBlock(e.unref(Y.ContentWithAsideLayout),{class:"sv-subscription-management sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createVNode(e.unref(m._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-management__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(U.value),1)]),_:1})])]),content:e.withCtx(()=>{var v,h;return[V.value?(e.openBlock(),e.createBlock(be,{key:0,class:"sv-subscription-management__success","pricing-group-name":(v=w.value)==null?void 0:v.name},null,8,["pricing-group-name"])):e.unref(C)?(e.openBlock(),e.createBlock(j._sfc_main,{key:1,variant:"section",class:"min-h-[220px]"})):w.value&&O.value?(e.openBlock(),e.createBlock(pe,{key:2,"enabled-pricing-ids":y.value,"onUpdate:enabledPricingIds":l[0]||(l[0]=g=>y.value=g),"payment-method-id":x.value,"onUpdate:paymentMethodId":l[1]||(l[1]=g=>x.value=g),class:"sv-subscription-management__form","pricing-group":w.value,"payment-methods":e.unref(s),"payment-method-options":e.unref(b),"billing-period":O.value,currency:(h=e.unref(u))==null?void 0:h.billing_currency,onAddPaymentMethod:l[2]||(l[2]=g=>k.value=!0)},null,8,["enabled-pricing-ids","payment-method-id","pricing-group","payment-methods","payment-method-options","billing-period","currency"])):e.createCommentVNode("",!0),e.createVNode(he,{"show-modal":k.value,customer:e.unref(d),"payment-method-options":e.unref(b),onSuccess:D,onClose:l[3]||(l[3]=g=>k.value=!1)},null,8,["show-modal","customer","payment-method-options"])]}),aside:e.withCtx(()=>[V.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__done w-full",type:"button",onClick:l[4]||(l[4]=v=>e.unref(p)({action:"navigate-to-customer-overview"}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Done",id:"subscription_management.done_button.label",description:"Label of the button that leaves the manage subscription screen once the change is committed"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(fe,{class:"sv-subscription-management__summary",invoice:e.unref(G),"is-pending":e.unref(C)||e.unref(F),"has-error":!!e.unref(R)},null,8,["invoice","is-pending","has-error"]),I.value?(e.openBlock(),e.createBlock(e.unref(L._sfc_main),{key:0,class:"sv-subscription-management__update-error sv-error",title:I.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",we,[e.createVNode(e.unref(A._sfc_main),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-subscription-management__update w-full",type:"button",disabled:!$.value,loading:M.value,onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Update subscription",id:"subscription_management.update_button.label",description:"Label of the button that commits the subscription change"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(ne._sfc_main$1,{class:"sv-subscription-management__kpi","payment-method-options":e.unref(b)},null,8,["payment-method-options"])])],64))]),_:1}))}}),Pe=e.defineComponent({__name:"SubscriptionManagement.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup(t){const a=ue.getComponentName("subscription-management");return(n,o)=>(e.openBlock(),e.createBlock(e.unref(m._sfc_main$1),{entry:n.$props,"component-name":e.unref(a),"allowed-portal-types":["CUSTOMER"],onError:o[0]||(o[0]=c=>n.$emit("error",c))},{default:e.withCtx(()=>[e.createVNode(Se,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["entry","component-name"]))}}),{define:ke}=m.createSolvimonElement(Pe,"subscription-management");exports.defineSolvimonSubscriptionManagement=ke;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { ref as S, defineComponent as I, useModel as H, computed as _, watch as F, openBlock as m, createElementBlock as z, withModifiers as ce, createElementVNode as A, createVNode as h, unref as e, mergeModels as J, inject as le, createBlock as f, withCtx as b, renderSlot as de, createTextVNode as T, toDisplayString as C, createCommentVNode as R, Fragment as me } from "vue";
|
|
2
|
-
import { _ as K } from "../../Button.vue.es-
|
|
3
|
-
import { _ as Q } from "../../ErrorNotification.vue.es-
|
|
4
|
-
import { b as X, g as ue, c as pe, a as ge, u as E, h as fe, i as be, _ as Z, d as ve, e as he } from "../../customElements-
|
|
5
|
-
import { C as _e } from "../../ContentWithAsideLayout-
|
|
6
|
-
import { u as ye } from "../../useActionDispatchProvider-
|
|
7
|
-
import { u as we } from "../../usePortal-
|
|
8
|
-
import { u as Se } from "../../useSubscription-
|
|
9
|
-
import { u as Pe } from "../../useCustomer-
|
|
10
|
-
import { u as Me } from "../../usePaymentMethods-
|
|
11
|
-
import { u as Ie } from "../../usePaymentMethodOptions-
|
|
12
|
-
import { u as $e } from "../../useLoadInitialData-
|
|
13
|
-
import { c as Oe } from "../../invoices-
|
|
2
|
+
import { _ as K } from "../../Button.vue.es-BbSN0uOk.mjs";
|
|
3
|
+
import { _ as Q } from "../../ErrorNotification.vue.es-CiUJva6S.mjs";
|
|
4
|
+
import { b as X, g as ue, c as pe, a as ge, u as E, h as fe, i as be, _ as Z, d as ve, e as he } from "../../customElements-q_i9y0Ph.mjs";
|
|
5
|
+
import { C as _e } from "../../ContentWithAsideLayout-BCM8tmZN.mjs";
|
|
6
|
+
import { u as ye } from "../../useActionDispatchProvider-BdciAX8T.mjs";
|
|
7
|
+
import { u as we } from "../../usePortal-C4rR5Rhu.mjs";
|
|
8
|
+
import { u as Se } from "../../useSubscription-DSsXVO0h.mjs";
|
|
9
|
+
import { u as Pe } from "../../useCustomer-D8ixhuuj.mjs";
|
|
10
|
+
import { u as Me } from "../../usePaymentMethods-BnmSo_rr.mjs";
|
|
11
|
+
import { u as Ie } from "../../usePaymentMethodOptions-DlZtTQNQ.mjs";
|
|
12
|
+
import { u as $e } from "../../useLoadInitialData-BDmmpcfb.mjs";
|
|
13
|
+
import { c as Oe } from "../../invoices-DIzkXntV.mjs";
|
|
14
14
|
import { b as ke, c as Ce, d as Ae } from "../../pricingPlanSchedule-BPrS2WRd.mjs";
|
|
15
|
-
import { a as Ee } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-
|
|
15
|
+
import { a as Ee } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BM9Y4Cy3.mjs";
|
|
16
16
|
import { _ as Le } from "../../Divider.vue.es-DnP_HqLz.mjs";
|
|
17
|
-
import { _ as xe } from "../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { _ as je, a as Ne } from "../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { a as Te } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-
|
|
20
|
-
import { _ as Ue } from "../../Section.vue.es-
|
|
17
|
+
import { _ as xe } from "../../PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-Dvuj-fos.mjs";
|
|
18
|
+
import { _ as je, a as Ne } from "../../AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Dh_a0NRB.mjs";
|
|
19
|
+
import { a as Te } from "../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-kpjrC-4q.mjs";
|
|
20
|
+
import { _ as Ue } from "../../Section.vue.es-D5svcVS_.mjs";
|
|
21
21
|
import { _ as ee } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
|
|
22
|
-
import { _ as Be } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { M as Ve } from "../../Modal.vue.es-
|
|
22
|
+
import { _ as Be } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DggCusgC.mjs";
|
|
23
|
+
import { M as Ve } from "../../Modal.vue.es-BuRlbyZw.mjs";
|
|
24
24
|
import { a as De } from "../../sessionReference-3h-6FdrC.mjs";
|
|
25
25
|
function Ge() {
|
|
26
26
|
const { getInvoicePreview: t } = Oe(), a = X(), n = S(), s = S(!1), c = S(), p = ue();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { w as s, a as f } from "./api.es-QaC926Xu.mjs";
|
|
2
|
-
import { a as E, c as m } from "./customElements-
|
|
2
|
+
import { a as E, c as m } from "./customElements-q_i9y0Ph.mjs";
|
|
3
3
|
import { E as e } from "./sessionReference-3h-6FdrC.mjs";
|
|
4
4
|
const a = "/portal/pricing-plan-subscriptions", N = {
|
|
5
5
|
CANCEL: "NEXT_BILLING_PERIOD",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const r=require("./api.es-duCDtZD9.js"),c=require("./customElements-
|
|
1
|
+
const r=require("./api.es-duCDtZD9.js"),c=require("./customElements-hH6pju3X.js"),o=require("./sessionReference-m_6Rp4X1.js"),s="/portal/pricing-plan-subscriptions",N={CANCEL:"NEXT_BILLING_PERIOD",RENEW:"UNDO"};function P(){const t=c.useConfig(),i=c.createRequestService();function a({id:e,expanded:n=!1}){return i({url:`${t.apiUrls.config}${s}/${e}`,query:r.withExpand({expandParams:o.EXPAND_ALL,expand:n})})}function u({customerId:e,pagination:n}){const l=n??{},E=r.withExpand({initialParams:{customer_id:e,statuses:["ACTIVE"],type:"BILLING"},expandParams:o.EXPAND_ALL});return i({url:`${t.apiUrls.config}${s}`,query:r.withPagination(E,l),isCollection:!0})}function p({id:e,variant:n}){return i({url:`${t.apiUrls.config}${s}/${e}/cancel`,data:{type:N[n]},options:{method:"POST"}})}return{getSubscription:a,getActiveSubscriptions:u,setSubscriptionCancellation:p}}exports.createSubscriptionsService=P;
|
package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts
CHANGED
|
@@ -29,6 +29,12 @@ interface BasePaymentIntegrationFormProps {
|
|
|
29
29
|
* to the merchant and an invoice payment that stays where it is.
|
|
30
30
|
*/
|
|
31
31
|
redirectsOnSuccess?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Legal name of the party collecting the money, named in the SEPA mandate. Only the screen
|
|
34
|
+
* knows it — it comes off the invoice when paying one and off the subscription in checkout —
|
|
35
|
+
* and the mandate falls back to unnamed wording without it.
|
|
36
|
+
*/
|
|
37
|
+
billingEntityName?: string;
|
|
32
38
|
}
|
|
33
39
|
export interface AuthorizePaymentIntegrationFormProps extends BasePaymentIntegrationFormProps {
|
|
34
40
|
customerId?: Customer['id'];
|
|
@@ -76,6 +82,8 @@ export interface PaymentIntegrationVariantProps {
|
|
|
76
82
|
forceStorePaymentMethod?: boolean;
|
|
77
83
|
storePaymentMethod?: boolean;
|
|
78
84
|
redirectsOnSuccess?: boolean;
|
|
85
|
+
/** Named in the SEPA mandate. See the note on the same prop in the base props. */
|
|
86
|
+
billingEntityName?: string;
|
|
79
87
|
}
|
|
80
88
|
export type PaymentIntegrationVariantEmits = PaymentIntegrationFormEmits;
|
|
81
89
|
export {};
|
|
@@ -75,5 +75,7 @@ export interface LoggerProviderProps {
|
|
|
75
75
|
*/
|
|
76
76
|
onLog?: LogSink;
|
|
77
77
|
}
|
|
78
|
-
export type WarnCode =
|
|
79
|
-
|
|
78
|
+
export type WarnCode =
|
|
79
|
+
/** Also an `ErrorCode`: the level separates a failure the SDK absorbed from one it did not. */
|
|
80
|
+
'REQUEST_FAILED' | 'ACTIVE_SCHEDULE_NOT_FOUND' | 'ADYEN_INVALID_CONFIGURATION' | 'PAYMENT_INTEGRATION_NOT_RENDERABLE' | 'APPLE_PAY_ACTION_REQUIRED' | 'INVOICE_PREVIEW_SKIPPED' | 'TRANSLATION_LOAD_FAILED';
|
|
81
|
+
export type ErrorCode = 'REQUEST_FAILED' | 'UNHANDLED_ERROR' | 'RESOURCE_REVOKED' | 'INVALID_EMAIL' | 'INVALID_COUNTRY_CODE' | 'PAYMENT_INTEGRATION_INITIALIZATION_FAILED' | 'PAYMENT_AUTHORIZATION_FAILED' | 'TOKENIZATION_FAILED' | 'INVALID_TOKEN' | 'SESSION_EXPIRED' | 'INVALID_REDIRECT_RESULT' | 'PAYMENT_DETAILS_CALL_FAILED' | 'PAYMENT_METHOD_OPTIONS_LOAD_FAILED' | 'NO_PAYMENT_METHODS_AVAILABLE' | 'INTEGRATION_ERROR' | 'EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR' | 'EXPRESS_CHECKOUT_PAYPAL_ERROR' | 'APPLE_PAY_ERROR' | 'APPLE_PAY_AUTHORIZATION_FAILED' | 'PROMOTION_CODE_APPLY_FAILED' | 'PROMOTION_CODE_REMOVE_FAILED' | 'SUBSCRIPTION_UPDATE_FAILED' | 'SUBSCRIPTION_CANCELLATION_FAILED' | 'INITIAL_DATA_LOAD_FAILED' | 'SUBSCRIPTION_LOAD_FAILED' | 'INVOICE_PREVIEW_FAILED' | 'TOP_UP_FAILED' | 'AUTO_TOP_UP_SAVE_FAILED' | 'AUTO_TOP_UP_CANCELLATION_FAILED' | 'REQUEST_PARSE_FAILED' | 'ADYEN_SUBMIT_FAILED' | 'STRIPE_SUBMIT_FAILED' | 'STRIPE_CONFIRMATION_TOKEN_FAILED' | 'STRIPE_ACTION_FAILED' | 'STRIPE_REDIRECT_RETURN_FAILED' | 'ADYEN_PAYMENT_FAILED' | 'PAYMENT_DETAILS_REJECTED' | 'PAYMENT_ACCEPTOR_MISSING';
|
|
@@ -62,6 +62,8 @@ export interface PortalUrlInitPricingPlanSubscription extends BasePortalUrl {
|
|
|
62
62
|
init_pricing_plan_subscription: {
|
|
63
63
|
pricing_plan_subscription_id: PricingPlanSubscription['id'];
|
|
64
64
|
success_url?: string;
|
|
65
|
+
/** Merchant-authored terms and conditions, in a limited markdown subset. */
|
|
66
|
+
note?: string | null;
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
69
|
export type PortalUrl = PortalUrlInvoice | PortalUrlPayInvoice | PortalUrlQuoteVersion | PortalUrlCustomer | PortalUrlInitPricingPlanSubscription;
|
|
@@ -5,6 +5,8 @@ export type GetDefaultHeaders = (params: {
|
|
|
5
5
|
export type RequestOptions = {
|
|
6
6
|
headers?: Record<string, string | null>;
|
|
7
7
|
method?: 'GET' | 'POST' | 'PATCH';
|
|
8
|
+
/** Statuses the caller handles itself. Still rejected; only the log entry drops to `warn`. */
|
|
9
|
+
expectedStatusCodes?: number[];
|
|
8
10
|
};
|
|
9
11
|
export type QueryParamValue = string | number | boolean | null | undefined | (string | number)[];
|
|
10
12
|
export type QueryParams = Record<string, QueryParamValue>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const e = /* @__PURE__ */ new Set(["https:", "http:"]);
|
|
2
|
-
function
|
|
2
|
+
function c(t, r = window.location.search) {
|
|
3
3
|
return new URLSearchParams(r).get(t);
|
|
4
4
|
}
|
|
5
5
|
function n(t) {
|
|
@@ -15,6 +15,7 @@ function o(t) {
|
|
|
15
15
|
r && window.location.replace(r);
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
n as a,
|
|
19
|
+
c as g,
|
|
19
20
|
o as s
|
|
20
21
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=new Set(["https:","http:"]);function a(r,t=window.location.search){return new URLSearchParams(t).get(r)}function e(r){try{const t=new URL(r);return n.has(t.protocol)?r:""}catch{return""}}function c(r){const t=e(r);t&&window.location.replace(t)}exports.getQueryParam=a;exports.safeUrlRedirect=c;exports.sanitizeUrl=e;
|
package/dist/{useActionDispatchProvider-CTyDGRX8.js → useActionDispatchProvider-CKzeqXzY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
const i=require("vue"),e=require("./customElements-
|
|
1
|
+
const i=require("vue"),e=require("./customElements-hH6pju3X.js");function o(){const t=i.inject(e.ACTION_DISPATCHER_PROVIDER_INJECTION_KEY);if(!t)throw new Error("dispatchAction is not provided");return{dispatchAction:t}}exports.useActionDispatchProvider=o;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as i } from "vue";
|
|
2
|
-
import { c as m } from "./customer-
|
|
2
|
+
import { c as m } from "./customer-BDoOIAFr.mjs";
|
|
3
3
|
import { u as s } from "./useService-Bh47bllz.mjs";
|
|
4
4
|
function C({ customerId: r }) {
|
|
5
5
|
const { getCustomer: u, updateCustomer: o } = m(), e = i(), { data: p, ...c } = s({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const i=require("vue"),v=require("./customer-
|
|
1
|
+
const i=require("vue"),v=require("./customer-C9q6ti8s.js"),u=require("./useService-H7BjLg8P.js");function m({customerId:r}){const{getCustomer:c,updateCustomer:a}=v.createCustomerService(),t=i.ref(),{data:C,...o}=u.useService({service:async()=>{const e=await c(r);return t.value=e,e}}),{data:d,...n}=u.useService({service:async e=>{const s=await a(r,e);return t.value=s,s}});return{customer:t,get:o,update:n}}exports.useCustomer=m;
|