@solvimon/solvimon-web 0.1.0-alpha.30 → 0.1.0-alpha.31
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 +152 -91
- package/dist/AddPaymentMethodModal-Bs_aOOCX.mjs +97 -0
- package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DF4PIR-A.mjs +89 -0
- package/dist/{Alert.vue.es-ZPG49yR_.mjs → Alert.vue.es-xhsk_7Gn.mjs} +1 -1
- package/dist/AuthProvider.handle-CUO6Qj-5.mjs +46 -0
- package/dist/{Avatar.vue.es-geDQsZwu.mjs → Avatar.vue.es-DrbtUiLO.mjs} +1 -1
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C3JYNZuR.mjs +64 -0
- package/dist/BillingInformationForm.lib-ad8B2Y1O.mjs +32 -0
- package/dist/BillingInformationForm.vue_vue_type_script_setup_true_lang-BUdcXy0H.mjs +340 -0
- package/dist/BillingInformationModal-crgTNGf4.mjs +85 -0
- package/dist/{Button.vue.es-j7iYlqtJ.mjs → Button.vue.es-BHbanjR0.mjs} +1 -1
- package/dist/{ChargeOnDemandModal-CR01PkP_.mjs → ChargeOnDemandModal-DYiFtw1n.mjs} +44 -43
- package/dist/{Chip.vue.es-Dxx_0dte.mjs → Chip.vue.es-Dc6-PjEn.mjs} +2 -2
- package/dist/{ContentWithAsideLayout-Bnbsq8_5.mjs → ContentWithAsideLayout-C2kFcft1.mjs} +1 -1
- package/dist/{ContextMenu.vue.es-BJO4U47Q.mjs → ContextMenu.vue.es-CvX6O2IM.mjs} +10 -10
- package/dist/{CustomerBillingInformation.vue.es-CmNpqcBw.mjs → CustomerBillingInformation.vue.es-DQWt9osz.mjs} +3 -3
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-hNVtamwL.mjs +217 -0
- package/dist/CustomerShippingAddresses-C0c-4D2W.mjs +282 -0
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DJnr5D56.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C50vGUvw.mjs} +992 -1100
- package/dist/{DividerText.vue.es-BusbyeAI.mjs → DividerText.vue.es-ChN6fnrH.mjs} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-wPma8Os-.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DCUml1W4.mjs} +3 -3
- package/dist/{ErrorNotification.vue.es-F068p7PY.mjs → ErrorNotification.vue.es-CWIVt5q9.mjs} +2 -2
- package/dist/{FormMessage.vue.es-CwMQpIAW.mjs → FormMessage.vue.es-CQ64C8dt.mjs} +1 -1
- package/dist/{IconButton.vue.es-D8DtBW9i.mjs → IconButton.vue.es-BXzwMvVk.mjs} +2 -2
- package/dist/{IconTitle.vue.es-6VJtjJX2.mjs → IconTitle.vue.es-GyanM-JQ.mjs} +3 -3
- package/dist/{Input.vue.es-BLyHcmu4.mjs → Input.vue.es-CxiwRZYs.mjs} +4 -4
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dl1vTzQD.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Ca0qflBR.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DYskT3r7.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-Dw73a5Yt.mjs} +7 -7
- package/dist/{InvoicePreview.vue.es-Cpf66_xV.mjs → InvoicePreview.vue.es-BvnikfEH.mjs} +6 -6
- package/dist/{InvoicePricingClauseChip.vue.es-CDrAE901.mjs → InvoicePricingClauseChip.vue.es-DxcyTRGr.mjs} +3 -3
- package/dist/{Label.vue.es-es7ZUBSP.mjs → Label.vue.es-3ACRco55.mjs} +3 -3
- package/dist/LoadFailedNotice.vue_vue_type_script_setup_true_lang-1qpRh-0S.mjs +20 -0
- package/dist/{Modal.vue.es-eeR9FmvQ.mjs → Modal.vue.es-CDjfZDDx.mjs} +138 -127
- package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-CnZwxJ5b.mjs +789 -0
- package/dist/{PaymentCompletedCard.vue_vue_type_script_setup_true_lang-CrjVPks0.mjs → PaymentCompletedCard.vue_vue_type_script_setup_true_lang-PICpXmC3.mjs} +2 -2
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DyjzaTK1.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-DpZtYBfM.mjs} +4 -4
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BHQrWy6r.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Co5qBQa8.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-CN42ewCn.mjs → PaymentHistoryBlock-HUazLER6.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3Y5fHvA.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DdmUoiet.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-D3Ye7LZ5.mjs → PaymentIntegrationForm-ZnIjTyda.mjs} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DU5wu66t.mjs +161 -0
- package/dist/{PaymentIntegrationFormAdyen-Fm-diCCO.mjs → PaymentIntegrationFormAdyen-sbw3AoKS.mjs} +302 -282
- package/dist/{PaymentIntegrationFormStripe-BANBL6za.mjs → PaymentIntegrationFormStripe-4JmKEwbS.mjs} +126 -117
- package/dist/{PaymentMethod.vue.es-t3-VyoE8.mjs → PaymentMethod.vue.es-DAabE41t.mjs} +23 -21
- package/dist/{PaymentMethodForm-CqP3GoNj.mjs → PaymentMethodForm-MmCUSJLE.mjs} +1 -1
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-DyiXLYRj.mjs +165 -0
- package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-D5wmRuCf.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Bv34aiZ6.mjs} +6 -6
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DhkkiJaQ.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DZ2Z-RMv.mjs} +28 -26
- package/dist/PaymentMethodsModal-CjpNw4kX.mjs +192 -0
- package/dist/PlanCustomizationEditor-BDWm_z2w.mjs +864 -0
- package/dist/{PortalLinkUnverified-Cp60_kRJ.mjs → PortalLinkUnverified-B7YYhv97.mjs} +3 -3
- package/dist/{PortalNotAvailable-DzSQnfzw.mjs → PortalNotAvailable-DIyeKrAp.mjs} +2 -2
- package/dist/{PricingGroupRangeInput.vue.es-Srq_3cga.mjs → PricingGroupRangeInput.vue.es-C6J8C7JS.mjs} +7 -7
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-oRijnVnZ.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CiQ-C9Hh.mjs} +16 -15
- package/dist/{RadioGroupExtended.vue.es-BbBMDf6l.mjs → RadioGroupExtended.vue.es-hDmUAKIA.mjs} +5 -5
- package/dist/{Section.vue.es-Oqn1wGPZ.mjs → Section.vue.es-CwKTCeZ1.mjs} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-OM19NPBh.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Gn1aE60E.mjs} +2 -2
- package/dist/ShippingAddressForm.vue_vue_type_script_setup_true_lang-y7yOKwR3.mjs +144 -0
- package/dist/ShippingAddressesModal-CNXxkxnJ.mjs +283 -0
- package/dist/{StepInput.vue.es-ieh4EuJ7.mjs → StepInput.vue.es-GkrOtOVa.mjs} +4 -4
- package/dist/SubscriptionCancellationModal-C_xFPx1I.mjs +4 -0
- package/dist/SubscriptionCancellationModal.vue_vue_type_script_setup_true_lang-DdTC33Qh.mjs +240 -0
- package/dist/SubscriptionCancellationSuccess.vue_vue_type_script_setup_true_lang-CQ-ZOzVI.mjs +64 -0
- package/dist/SubscriptionDetails.entry.ce-DuP8TtKu.mjs +764 -0
- package/dist/{SubscriptionSchedules-DMxX3GpK.mjs → SubscriptionSchedules-DosBeXD7.mjs} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DXro_64f.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-5tyDFxEh.mjs} +1948 -1965
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-C26HShPu.mjs +90 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-CHlXP_2x.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BUDuQk2e.mjs} +133 -108
- package/dist/Toggle.vue.es-S2g8WGY_.mjs +99 -0
- package/dist/{TooltipParagraph.vue.es-BES3zsYN.mjs → TooltipParagraph.vue.es-4HaXi8RP.mjs} +18 -18
- package/dist/{TranslationOverride.vue_vue_type_script_setup_true_lang-BJmlNrXT.mjs → TranslationOverride.vue_vue_type_script_setup_true_lang-C5Y6Kg-_.mjs} +1 -1
- package/dist/TrialChip.vue.es-CUfJ4SK3.mjs +47 -0
- package/dist/addonQuantity-BvoYTajN.mjs +128 -0
- package/dist/adyen-D4em6EgU.mjs +99 -0
- package/dist/adyenSdk-DUTO7xkT.mjs +63 -0
- package/dist/{api.es-qgvzNMU-.mjs → api.es-QaC926Xu.mjs} +2 -2
- package/dist/components/BillingInformation/BillingInformation.mjs +37 -41
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +45 -462
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +33 -42
- package/dist/components/Invoice/Invoice.mjs +426 -426
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +38 -47
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +29 -34
- package/dist/components/InvoicesList/InvoicesList.mjs +33 -42
- package/dist/components/PaymentHistory/PaymentHistory.mjs +39 -48
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +56 -64
- package/dist/components/ShippingAddressForm/ShippingAddressForm.ce.d.ts +1 -0
- package/dist/components/ShippingAddressForm/ShippingAddressForm.mjs +212 -0
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +34 -42
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +41 -50
- package/dist/components/WalletBalances/WalletBalances.mjs +46 -55
- package/dist/core/events.types.d.ts +1 -0
- package/dist/core/index.mjs +51 -34
- package/dist/{customElements-DK4GKNJG.mjs → customElements-d7Bhfqi_.mjs} +773 -746
- package/dist/{customer-lf6S5DBR.mjs → customer-CNCSN_G5.mjs} +1 -1
- package/dist/{de-DE-UJ6X6jXu.mjs → de-DE-D-sV3avS.mjs} +8 -5
- package/dist/{de-DE-Cyj_NtiI.mjs → de-DE-wZp39RC-.mjs} +68 -5
- package/dist/{fr-FR-Cvvbkwlj.mjs → fr-FR-BYHycSxz.mjs} +3 -0
- package/dist/{fr-FR-CRFoWQ7J.mjs → fr-FR-BrNXJ7gR.mjs} +68 -5
- package/dist/{countryData.es-BegoD-cZ.mjs → getCountryNameByCode.es-OGxn_zT0.mjs} +7 -2
- package/dist/index.es-BEZ2mumY.mjs +633 -0
- package/dist/{index.es-BrVTOW5D.mjs → index.es-C7J3WGGo.mjs} +4 -4
- package/dist/index.mjs +37 -33
- package/dist/invoices-CXvL8KQx.mjs +143 -0
- package/dist/{it-IT-DObZEc-U.mjs → it-IT-Bd1qsMVU.mjs} +68 -5
- package/dist/{it-IT-DnJP5URH.mjs → it-IT-zpPyT9PH.mjs} +8 -5
- package/dist/{nl-NL-q9xfTZF0.mjs → nl-NL-BOr4MR7L.mjs} +8 -5
- package/dist/{nl-NL-C02xHilF.mjs → nl-NL-C6Y6fqaW.mjs} +68 -5
- package/dist/paymentIntegrationFormLoaders-wi1vMgf_.mjs +31 -0
- package/dist/{paymentMethods-8w-ccfY_.mjs → paymentMethods-CG1fcG2v.mjs} +22 -21
- package/dist/{paymentOutcome-B6sW1eCV.mjs → paymentOutcome-D59QkGfm.mjs} +1 -1
- package/dist/paymentRedirect-DaS8Kccc.mjs +66 -0
- package/dist/payments-Dy81gmkC.mjs +71 -0
- package/dist/preloadPaymentIntegrationForms-C_9p7Jbi.mjs +9 -0
- package/dist/pricing-CBJT8C6L.mjs +42 -0
- package/dist/{pricingItem.es-bCPArbTa.mjs → pricingItem.es-AYq_hYeD.mjs} +1 -1
- package/dist/pricingPlanScheduleOverrides-GON_34ep.mjs +291 -0
- package/dist/randomUuid-BE_IQ-aq.mjs +10 -0
- package/dist/screens/Checkout/Checkout.mjs +1098 -3
- package/dist/screens/CheckoutSession/CheckoutSession.ce.d.ts +1 -0
- package/dist/screens/CheckoutSession/CheckoutSession.mjs +1316 -0
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +209 -133
- package/dist/screens/PayInvoice/PayInvoice.mjs +282 -274
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +92 -97
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +915 -404
- package/dist/{sorting.es-C0pdMgX0.mjs → sorting.es-kM0f1VX0.mjs} +1 -1
- package/dist/{subscription-BwzkagDI.mjs → subscription-DQ5mRp_e.mjs} +10 -10
- package/dist/subscriptions-Bm1eu9wc.mjs +99 -0
- package/dist/taxId.es-Zu2Ff1gL.mjs +510 -0
- package/dist/timePeriod.es-R9U0wLlB.mjs +13 -0
- package/dist/types/components/customer/BillingInformationForm/BillingInformationForm.types.d.ts +11 -14
- package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +2 -9
- package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +10 -0
- package/dist/types/components/customer/CustomerPaymentMethodsBlock/CustomerPaymentMethodsBlock.types.d.ts +6 -0
- package/dist/types/components/payments/AddPaymentMethodModal/AddPaymentMethodModal.types.d.ts +17 -0
- package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethodApplePay.types.d.ts +3 -2
- package/dist/types/components/payments/ExpressPaymentMethods/ExpressPaymentMethods.types.d.ts +3 -2
- package/dist/types/components/payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts +2 -0
- package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +12 -1
- package/dist/types/components/payments/PaymentMethodsList/PaymentMethodsList.types.d.ts +2 -0
- package/dist/types/components/payments/PaymentMethodsModal/PaymentMethodsModal.types.d.ts +22 -0
- package/dist/types/components/providers/ActionDispatchProvider/ActionDispatchProvider.lib.types.d.ts +1 -1
- package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +7 -1
- package/dist/types/components/providers/EntryProvider/EntryProvider.types.d.ts +2 -2
- package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +3 -11
- package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +1 -5
- package/dist/types/components/providers/HostElementProvider/HostElementProvider.lib.d.ts +11 -0
- package/dist/types/components/providers/HostElementProvider/composables/useHostEvent.d.ts +12 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +5 -4
- package/dist/types/components/providers/PortalProvider/PortalProvider.lib.d.ts +3 -3
- package/dist/types/components/providers/PortalProvider/PortalProvider.types.d.ts +3 -3
- package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +6 -1
- package/dist/types/components/providers/PortalProvider/composables/usePortal.d.ts +1 -0
- package/dist/types/components/providers/Provider/Provider.types.d.ts +10 -3
- package/dist/types/components/providers/Provider/Provider.vue.d.ts +3 -14
- package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +1 -1
- package/dist/types/components/subscriptions/OrderSummary.types.d.ts +14 -0
- package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +14 -1
- package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +9 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditor.types.d.ts +4 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditorItem.types.d.ts +2 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +4 -0
- package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +2 -0
- package/dist/types/components/subscriptions/SubscriptionCancellationSuccess/SubscriptionCancellationSuccess.types.d.ts +4 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +10 -9
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSuccess.types.d.ts +5 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSummary.types.d.ts +3 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanChangeSummary.types.d.ts +4 -0
- package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanSelector.types.d.ts +7 -0
- package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsList.types.d.ts +1 -0
- package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsListItem.types.d.ts +1 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/public/components/BillingInformation/BillingInformation.types.d.ts +5 -0
- package/dist/types/public/components/BillingInformationForm/BillingInformationForm.entry.types.d.ts +1 -2
- package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.types.d.ts +6 -2
- package/dist/types/public/components/Invoice/Invoice.types.d.ts +7 -7
- package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +2 -2
- package/dist/types/public/components/InvoicesList/InvoicesList.types.d.ts +6 -7
- package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.entry.types.d.ts +1 -1
- package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.types.d.ts +19 -14
- package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.ce.d.ts +1 -0
- package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.types.d.ts +6 -0
- package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.types.d.ts +5 -0
- package/dist/types/public/components/SubscriptionsList/SubscriptionsList.types.d.ts +10 -1
- package/dist/types/public/core/action-request.types.d.ts +18 -24
- package/dist/types/public/core/events.types.d.ts +99 -0
- package/dist/types/public/core/index.d.ts +3 -1
- package/dist/types/public/core/types.d.ts +11 -2
- package/dist/types/public/screens/Checkout/Checkout.entry.types.d.ts +1 -7
- package/dist/types/public/screens/Checkout/Checkout.source.types.d.ts +151 -0
- package/dist/types/public/screens/Checkout/Checkout.types.d.ts +7 -30
- package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.ce.d.ts +1 -0
- package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.types.d.ts +3 -0
- package/dist/types/public/screens/CustomerOverview/CustomerOverview.types.d.ts +8 -2
- package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +0 -6
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.configuration.types.d.ts +2 -19
- package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +2 -3
- package/dist/types/public/screens/SubscriptionManagement/SubscriptionManagement.types.d.ts +2 -1
- package/dist/types/services/paymentMethods.types.d.ts +12 -1
- package/dist/types/types/EntryBaseProps.d.ts +10 -6
- package/dist/types/types/branding.d.ts +15 -0
- package/dist/types/types/checkoutSession.d.ts +189 -0
- package/dist/types/types/errors.d.ts +2 -0
- package/dist/types/types/pricingPlanGroup.d.ts +25 -0
- package/dist/{useActionDispatchProvider-ChAHdwR8.mjs → useActionDispatchProvider-BWna0S6N.mjs} +1 -1
- package/dist/useAddressFormats-Dw7IEdxg.mjs +1997 -0
- package/dist/useCheckoutForm-BaV2j_ob.mjs +3310 -0
- package/dist/{useCustomer-CTMhg1nd.mjs → useCustomer-RUtEzDOY.mjs} +2 -2
- package/dist/useDefaultPaymentMethod-Dliq6_Yw.mjs +39 -0
- package/dist/useExperimentalFeature-DAKAF_a2.mjs +6 -0
- package/dist/useHostEvent-pjoWJ7ZH.mjs +12 -0
- package/dist/{useIncrementalLoading-CBVutPH8.mjs → useIncrementalLoading-B3gp58X-.mjs} +2 -2
- package/dist/{useInvoiceData-qUGbBAQK.mjs → useInvoiceData-Dya4mmvf.mjs} +2 -2
- package/dist/{useInvoicesList-wJvZAJpW.mjs → useInvoicesList-Dp3c_cb3.mjs} +9 -9
- package/dist/{useLoadInitialData-UvfYXgbi.mjs → useLoadInitialData-CwySdYZM.mjs} +1 -1
- package/dist/usePaymentFormHold-CYZ4BdOw.mjs +19 -0
- package/dist/{usePaymentMethodAvailability-35l4pWdH.mjs → usePaymentMethodAvailability-B7NV0ZtX.mjs} +4 -4
- package/dist/usePaymentMethodOptions-DDRjVvDJ.mjs +67 -0
- package/dist/{usePaymentMethods-De7hlLHo.mjs → usePaymentMethods-DBGyQA_I.mjs} +2 -2
- package/dist/{usePayments-hWS7fnOx.mjs → usePayments-ChGtK_As.mjs} +9 -9
- package/dist/usePortal--Uzbpbgr.mjs +14 -0
- package/dist/{useService-BwzIBIRp.mjs → useService-DayNZhPh.mjs} +1 -1
- package/dist/useShippingAddresses-TXVeGFPm.mjs +122 -0
- package/dist/useSubscription-lIGMFLG1.mjs +35 -0
- package/dist/useSubscriptionActions-BSlJVB4p.mjs +44 -0
- package/dist/useWatchDebounced-DkXgKe0E.mjs +20 -0
- package/package.json +12 -5
- package/dist/AuthProvider.handle-SRR_04XS.mjs +0 -50
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-nqKbgY7G.mjs +0 -58
- package/dist/Checkout.entry.ce-CopWuLJC.mjs +0 -4169
- package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-CEnM1uxK.mjs +0 -828
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Jyb5ZN3s.mjs +0 -136
- package/dist/CustomerShippingAddresses-BRPukhRI.mjs +0 -397
- package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-B_FpibLA.mjs +0 -441
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D07SEP8a.mjs +0 -181
- package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-CMRMbL3d.mjs +0 -161
- package/dist/PlanCustomizationEditor-B76UNEMm.mjs +0 -791
- package/dist/ShippingAddressesModal-c7nqf4Ny.mjs +0 -418
- package/dist/SubscriptionDetails.entry.ce-uYv45FGH.mjs +0 -1044
- package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-BZNsqN4G.mjs +0 -203
- package/dist/TrialChip.vue.es-C51z1ZiA.mjs +0 -35
- package/dist/addonQuantity-CCVaA3e-.mjs +0 -758
- package/dist/adyenSdk-B01MB9Ia.mjs +0 -58
- package/dist/getCountryNameByCode.es-BDHua7VM.mjs +0 -8
- package/dist/invoices-DdREPDXV.mjs +0 -123
- package/dist/paymentMethods-Goa25rTs.mjs +0 -61
- package/dist/payments-CKpU1K3t.mjs +0 -68
- package/dist/pricing-CEaZGgKe.mjs +0 -29
- package/dist/pricingPlanScheduleOverrides-BBp-DmpV.mjs +0 -233
- package/dist/pricingPlanSchedules-DSMptcAh.mjs +0 -38
- package/dist/subscriptions-B5bH8hsI.mjs +0 -66
- package/dist/taxId.es-e6NEvprh.mjs +0 -243
- package/dist/types/components/payments/ExpressPaymentMethodButton/ExpressPaymentMethodButton.types.d.ts +0 -3
- package/dist/useCustomerFormLabels-D4oDnfxA.mjs +0 -1173
- package/dist/usePaymentFormHold-Cwdr-vyc.mjs +0 -181
- package/dist/usePortal-DUfD6hrA.mjs +0 -7
- package/dist/useTimePeriod.es-BUorDLVK.mjs +0 -93
|
@@ -1,83 +1,86 @@
|
|
|
1
|
-
import { defineComponent as W, ref as
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { u as
|
|
5
|
-
import { _ as me } from "./ErrorNotification.vue.es-
|
|
6
|
-
import { i as
|
|
1
|
+
import { defineComponent as W, ref as I, onMounted as Lt, onBeforeUnmount as Ie, computed as s, openBlock as _, createBlock as E, withCtx as g, createElementVNode as N, toDisplayString as k, createVNode as C, createTextVNode as V, createElementBlock as Y, unref as u, createCommentVNode as R, renderSlot as ue, createSlots as re, Fragment as Te, renderList as Me, toRaw as He, watch as ee, normalizeClass as $e, useModel as Yt, isRef as Wt, mergeProps as ie, mergeModels as Ht, reactive as Oe, withModifiers as ze, normalizeStyle as je } from "vue";
|
|
2
|
+
import { w as zt } from "./api.es-QaC926Xu.mjs";
|
|
3
|
+
import { a as Q, d as Z, c as tt, u as ot, E as jt, b as be, e as Ue, p as Qt, f as Gt } from "./customElements-d7Bhfqi_.mjs";
|
|
4
|
+
import { u as Kt } from "./useService-DayNZhPh.mjs";
|
|
5
|
+
import { _ as me } from "./ErrorNotification.vue.es-CWIVt5q9.mjs";
|
|
6
|
+
import { i as Xt, a as Ce, h as Jt } from "./pricingItemConfigs.es-D3pX_9AJ.mjs";
|
|
7
7
|
import { b as Be } from "./wallets.es-eH2C2ygn.mjs";
|
|
8
|
-
import { _ as se, a as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { _ as we } from "./Section.vue.es-
|
|
11
|
-
import { _ as
|
|
12
|
-
import { _ as
|
|
13
|
-
import {
|
|
14
|
-
import { d as
|
|
8
|
+
import { _ as se, a as Zt } from "./Button.vue.es-BHbanjR0.mjs";
|
|
9
|
+
import { _ as nt, T as at, a as it } from "./TooltipParagraph.vue.es-4HaXi8RP.mjs";
|
|
10
|
+
import { _ as we } from "./Section.vue.es-CwKTCeZ1.mjs";
|
|
11
|
+
import { _ as st } from "./Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
|
|
12
|
+
import { _ as lt } from "./RadioGroupExtended.vue.es-hDmUAKIA.mjs";
|
|
13
|
+
import { b as eo } from "./subscription-DQ5mRp_e.mjs";
|
|
14
|
+
import { d as to, u as De, c as X, r as ut, b as rt } from "./formControl-BZQLHnOO.mjs";
|
|
15
15
|
import { f as Ne } from "./formatting.es-RclXHhKo.mjs";
|
|
16
|
-
import { _ as
|
|
17
|
-
import { _ as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { _ as
|
|
20
|
-
import { c as
|
|
21
|
-
import { u as
|
|
22
|
-
import { _ as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { u as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
16
|
+
import { _ as oo } from "./Divider.vue.es-DnP_HqLz.mjs";
|
|
17
|
+
import { _ as dt } from "./Expand.vue.es-BleuAfDz.mjs";
|
|
18
|
+
import { _ as ct } from "./InvoicePreview.vue.es-BvnikfEH.mjs";
|
|
19
|
+
import { _ as no } from "./Label.vue.es-3ACRco55.mjs";
|
|
20
|
+
import { c as pt } from "./invoices-CXvL8KQx.mjs";
|
|
21
|
+
import { u as ao } from "./useWatchDebounced-DkXgKe0E.mjs";
|
|
22
|
+
import { _ as io } from "./Toggle.vue.es-S2g8WGY_.mjs";
|
|
23
|
+
import { _ as so } from "./Input.vue.es-CxiwRZYs.mjs";
|
|
24
|
+
import { g as lo } from "./amount-CondixVt.mjs";
|
|
25
|
+
import { _ as mt } from "./PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Bv34aiZ6.mjs";
|
|
26
|
+
import { u as vt } from "./useDefaultPaymentMethod-Dliq6_Yw.mjs";
|
|
27
|
+
import { _ as uo } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-C26HShPu.mjs";
|
|
28
|
+
import { _ as ro, u as ft } from "./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DF4PIR-A.mjs";
|
|
29
|
+
import { M as ht } from "./Modal.vue.es-CDjfZDDx.mjs";
|
|
30
|
+
import { i as co } from "./paymentOutcome-D59QkGfm.mjs";
|
|
31
|
+
import { _ as po } from "./Alert.vue.es-xhsk_7Gn.mjs";
|
|
32
|
+
import { i as mo } from "./usePaymentMethodOptions-DDRjVvDJ.mjs";
|
|
33
|
+
const vo = 3e4, Se = 60, Pe = 12, fo = /* @__PURE__ */ W({
|
|
31
34
|
__name: "DateTimeAgo",
|
|
32
35
|
props: {
|
|
33
36
|
date: {},
|
|
34
37
|
actionVerb: {}
|
|
35
38
|
},
|
|
36
39
|
setup(e) {
|
|
37
|
-
const t = 60 * Se, o = 24 * t, n = e, { $t: a, formatDate: i } =
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
clearInterval(
|
|
40
|
+
const t = 60 * Se, o = 24 * t, n = e, { $t: a, formatDate: i } = Q(), l = I(Date.now());
|
|
41
|
+
let r;
|
|
42
|
+
Lt(() => {
|
|
43
|
+
r = setInterval(() => {
|
|
44
|
+
l.value = Date.now();
|
|
45
|
+
}, vo);
|
|
46
|
+
}), Ie(() => {
|
|
47
|
+
clearInterval(r);
|
|
45
48
|
});
|
|
46
|
-
const
|
|
47
|
-
const P = (
|
|
48
|
-
return
|
|
49
|
-
},
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
49
|
+
const f = (p, b) => {
|
|
50
|
+
const P = (b.getFullYear() - p.getFullYear()) * Pe + (b.getMonth() - p.getMonth());
|
|
51
|
+
return b.getDate() < p.getDate() ? P - 1 : P;
|
|
52
|
+
}, T = s(() => {
|
|
53
|
+
const p = Math.max(0, (l.value - n.date.getTime()) / 1e3);
|
|
54
|
+
if (p < Se)
|
|
52
55
|
return a(
|
|
53
56
|
{
|
|
54
57
|
defaultMessage: "{count, plural, one {# second} other {# seconds}} ago",
|
|
55
58
|
id: "dateTimeAgo.seconds",
|
|
56
59
|
description: "Relative time in whole seconds"
|
|
57
60
|
},
|
|
58
|
-
{ count: Math.trunc(
|
|
61
|
+
{ count: Math.trunc(p) }
|
|
59
62
|
);
|
|
60
|
-
if (
|
|
63
|
+
if (p < t)
|
|
61
64
|
return a(
|
|
62
65
|
{
|
|
63
66
|
defaultMessage: "{count, plural, one {# minute} other {# minutes}} ago",
|
|
64
67
|
id: "dateTimeAgo.minutes",
|
|
65
68
|
description: "Relative time in whole minutes"
|
|
66
69
|
},
|
|
67
|
-
{ count: Math.trunc(
|
|
70
|
+
{ count: Math.trunc(p / Se) }
|
|
68
71
|
);
|
|
69
|
-
if (
|
|
72
|
+
if (p < o)
|
|
70
73
|
return a(
|
|
71
74
|
{
|
|
72
75
|
defaultMessage: "{count, plural, one {# hour} other {# hours}} ago",
|
|
73
76
|
id: "dateTimeAgo.hours",
|
|
74
77
|
description: "Relative time in whole hours"
|
|
75
78
|
},
|
|
76
|
-
{ count: Math.trunc(
|
|
79
|
+
{ count: Math.trunc(p / t) }
|
|
77
80
|
);
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
const P = Math.trunc(
|
|
81
|
+
const b = f(n.date, new Date(l.value));
|
|
82
|
+
if (b < 1) {
|
|
83
|
+
const P = Math.trunc(p / o);
|
|
81
84
|
return P === 1 ? a({
|
|
82
85
|
defaultMessage: "yesterday",
|
|
83
86
|
id: "dateTimeAgo.yesterday",
|
|
@@ -91,33 +94,33 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
91
94
|
{ count: P }
|
|
92
95
|
);
|
|
93
96
|
}
|
|
94
|
-
return
|
|
97
|
+
return b < Pe ? a(
|
|
95
98
|
{
|
|
96
99
|
defaultMessage: "{count, plural, one {# month} other {# months}} ago",
|
|
97
100
|
id: "dateTimeAgo.months",
|
|
98
101
|
description: "Relative time in whole months"
|
|
99
102
|
},
|
|
100
|
-
{ count:
|
|
103
|
+
{ count: b }
|
|
101
104
|
) : a(
|
|
102
105
|
{
|
|
103
106
|
defaultMessage: "{count, plural, one {# year} other {# years}} ago",
|
|
104
107
|
id: "dateTimeAgo.years",
|
|
105
108
|
description: "Relative time in whole years"
|
|
106
109
|
},
|
|
107
|
-
{ count: Math.trunc(
|
|
110
|
+
{ count: Math.trunc(b / Pe) }
|
|
108
111
|
);
|
|
109
|
-
}),
|
|
110
|
-
() => n.actionVerb ? `${n.actionVerb} ${
|
|
111
|
-
),
|
|
112
|
+
}), M = s(
|
|
113
|
+
() => n.actionVerb ? `${n.actionVerb} ${T.value}` : T.value
|
|
114
|
+
), S = s(
|
|
112
115
|
() => i({ date: n.date, format: "dateTime", offsetType: "local" })
|
|
113
116
|
);
|
|
114
|
-
return (
|
|
115
|
-
tooltip:
|
|
116
|
-
C(
|
|
117
|
-
default:
|
|
118
|
-
C(
|
|
119
|
-
default:
|
|
120
|
-
V(
|
|
117
|
+
return (p, b) => (_(), E(nt, null, {
|
|
118
|
+
tooltip: g(() => [
|
|
119
|
+
C(at, null, {
|
|
120
|
+
default: g(() => [
|
|
121
|
+
C(it, null, {
|
|
122
|
+
default: g(() => [
|
|
123
|
+
V(k(S.value), 1)
|
|
121
124
|
]),
|
|
122
125
|
_: 1
|
|
123
126
|
})
|
|
@@ -125,79 +128,79 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
125
128
|
_: 1
|
|
126
129
|
})
|
|
127
130
|
]),
|
|
128
|
-
default:
|
|
129
|
-
|
|
131
|
+
default: g(() => [
|
|
132
|
+
N("span", null, k(M.value), 1)
|
|
130
133
|
]),
|
|
131
134
|
_: 1
|
|
132
135
|
}));
|
|
133
136
|
}
|
|
134
|
-
}),
|
|
135
|
-
const { $t: t, formatNumber: o } =
|
|
137
|
+
}), ho = (e) => {
|
|
138
|
+
const { $t: t, formatNumber: o } = Q(), n = (h) => Be(t, o, h), a = s(
|
|
136
139
|
() => {
|
|
137
|
-
var h,
|
|
138
|
-
return ((
|
|
140
|
+
var h, c;
|
|
141
|
+
return ((c = (h = e.walletBalance.wallet) == null ? void 0 : h.wallet_type) == null ? void 0 : c.name) || t({
|
|
139
142
|
defaultMessage: "Balance",
|
|
140
143
|
id: "wallet_balance.balance_label",
|
|
141
144
|
description: "Label shown above a wallet's balance amount"
|
|
142
145
|
});
|
|
143
146
|
}
|
|
144
147
|
), i = (h) => {
|
|
145
|
-
var
|
|
146
|
-
return (((
|
|
147
|
-
},
|
|
148
|
+
var c;
|
|
149
|
+
return (((c = h.pricing_item) == null ? void 0 : c.configs) ?? []).filter((A) => !!A.on_demand);
|
|
150
|
+
}, l = s(
|
|
148
151
|
() => (e.walletBalance.charge_on_demand_pricing_items ?? []).filter(
|
|
149
152
|
(h) => i(h).some(
|
|
150
|
-
(
|
|
153
|
+
(c) => Xt(c) || Ce(c)
|
|
151
154
|
)
|
|
152
155
|
)
|
|
153
|
-
),
|
|
154
|
-
() =>
|
|
155
|
-
(h) => i(h).some((
|
|
156
|
+
), r = s(
|
|
157
|
+
() => l.value.find(
|
|
158
|
+
(h) => i(h).some((c) => Ce(c))
|
|
156
159
|
)
|
|
157
|
-
),
|
|
158
|
-
() => !!e.showManualTopUp &&
|
|
159
|
-
),
|
|
160
|
+
), f = s(
|
|
161
|
+
() => !!e.showManualTopUp && l.value.length > 0
|
|
162
|
+
), T = s(() => !!e.showAutoTopUp && !!r.value), M = s(
|
|
160
163
|
() => {
|
|
161
|
-
var h,
|
|
162
|
-
return (
|
|
163
|
-
(
|
|
164
|
+
var h, c;
|
|
165
|
+
return (c = (h = e.walletBalance.wallet) == null ? void 0 : h.auto_top_up_configs) == null ? void 0 : c.find(
|
|
166
|
+
(A) => A.status === "ACTIVE"
|
|
164
167
|
);
|
|
165
168
|
}
|
|
166
|
-
),
|
|
169
|
+
), S = s(
|
|
167
170
|
() => {
|
|
168
|
-
var h,
|
|
169
|
-
return (
|
|
171
|
+
var h, c;
|
|
172
|
+
return (c = (h = e.walletBalance.wallet_balance.open_balance) == null ? void 0 : h.credits) == null ? void 0 : c.credit_type;
|
|
170
173
|
}
|
|
171
|
-
),
|
|
174
|
+
), p = (h, c) => n({
|
|
172
175
|
credits: {
|
|
173
176
|
quantity: h,
|
|
174
|
-
credit_type_id:
|
|
175
|
-
credit_type:
|
|
177
|
+
credit_type_id: c,
|
|
178
|
+
credit_type: S.value
|
|
176
179
|
}
|
|
177
|
-
}),
|
|
178
|
-
var h,
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
180
|
+
}), b = (h) => h.amount ? n({ amount: h.amount }) : h.credits ? p(h.credits.quantity, h.credits.credit_type_id) : "", P = s(() => {
|
|
181
|
+
var h, c;
|
|
182
|
+
const A = (h = M.value) == null ? void 0 : h.pricing_item_id;
|
|
183
|
+
if (!A)
|
|
181
184
|
return;
|
|
182
|
-
const B = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((U) => U.pricing_item_id ===
|
|
183
|
-
return B.find((U) => U.wallet_type_id ===
|
|
184
|
-
}),
|
|
185
|
-
var h,
|
|
186
|
-
const
|
|
187
|
-
if (!
|
|
185
|
+
const B = (e.walletBalance.charge_on_demand_pricing_items ?? []).filter((U) => U.pricing_item_id === A).flatMap((U) => i(U)).flatMap((U) => U.wallet_grants ?? []), v = (c = e.walletBalance.wallet) == null ? void 0 : c.wallet_type_id;
|
|
186
|
+
return B.find((U) => U.wallet_type_id === v) ?? B[0];
|
|
187
|
+
}), x = s(() => {
|
|
188
|
+
var h, c;
|
|
189
|
+
const A = (h = M.value) == null ? void 0 : h.topup_amount, B = (c = P.value) == null ? void 0 : c.credits_grant;
|
|
190
|
+
if (!A || !B)
|
|
188
191
|
return "";
|
|
189
192
|
if (B.credits)
|
|
190
|
-
return
|
|
193
|
+
return p(
|
|
191
194
|
B.credits.quantity,
|
|
192
195
|
B.credits.credit_type_id
|
|
193
196
|
);
|
|
194
197
|
if (B.conversion) {
|
|
195
|
-
const
|
|
196
|
-
return
|
|
198
|
+
const v = Number(A.quantity) * Number(B.conversion.rate);
|
|
199
|
+
return p(String(v), B.conversion.credit_type_id);
|
|
197
200
|
}
|
|
198
201
|
return "";
|
|
199
|
-
}),
|
|
200
|
-
() =>
|
|
202
|
+
}), w = s(
|
|
203
|
+
() => M.value ? t({
|
|
201
204
|
defaultMessage: "Auto top-up enabled",
|
|
202
205
|
id: "wallet_balance.auto_top_up_enabled_label",
|
|
203
206
|
description: "Label shown when a wallet tops itself up automatically"
|
|
@@ -206,50 +209,50 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
206
209
|
id: "wallet_balance.auto_top_up_disabled_label",
|
|
207
210
|
description: "Label shown when a wallet has no automatic top-up configured"
|
|
208
211
|
})
|
|
209
|
-
), $ =
|
|
210
|
-
const h =
|
|
212
|
+
), $ = s(() => {
|
|
213
|
+
const h = M.value;
|
|
211
214
|
if (!h)
|
|
212
215
|
return t({
|
|
213
216
|
defaultMessage: "Set up an automatic top-up and your balance is increased for you whenever it drops below an amount you choose, so you never run out.",
|
|
214
217
|
id: "wallet_balance.auto_top_up_setup_explanation",
|
|
215
218
|
description: "Tooltip explaining what automatic top-ups do, shown when none is configured yet"
|
|
216
219
|
});
|
|
217
|
-
const
|
|
218
|
-
return !
|
|
220
|
+
const c = h.topup_amount ? n({ amount: h.topup_amount }) : "", A = b(h.threshold);
|
|
221
|
+
return !c || !A ? t({
|
|
219
222
|
defaultMessage: "Your balance is topped up automatically once it runs low.",
|
|
220
223
|
id: "wallet_balance.auto_top_up_generic_explanation",
|
|
221
224
|
description: "Tooltip shown for an active automatic top-up whose amount or threshold is unknown"
|
|
222
|
-
}) :
|
|
225
|
+
}) : x.value ? t(
|
|
223
226
|
{
|
|
224
227
|
defaultMessage: "Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",
|
|
225
228
|
id: "wallet_balance.auto_top_up_credits_explanation",
|
|
226
229
|
description: "Tooltip explaining an automatic top-up that grants credits for a paid amount"
|
|
227
230
|
},
|
|
228
|
-
{ topUpCredits:
|
|
231
|
+
{ topUpCredits: x.value, topUpAmount: c, threshold: A }
|
|
229
232
|
) : t(
|
|
230
233
|
{
|
|
231
234
|
defaultMessage: "Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",
|
|
232
235
|
id: "wallet_balance.auto_top_up_explanation",
|
|
233
236
|
description: "Tooltip explaining how the automatic top-up of a wallet balance works"
|
|
234
237
|
},
|
|
235
|
-
{ topUpAmount:
|
|
238
|
+
{ topUpAmount: c, threshold: A }
|
|
236
239
|
);
|
|
237
240
|
});
|
|
238
241
|
return {
|
|
239
242
|
walletName: a,
|
|
240
243
|
formatBalance: n,
|
|
241
|
-
manualTopUpItems:
|
|
242
|
-
flexibleManualTopUpItem:
|
|
243
|
-
showManualTopUp:
|
|
244
|
-
showAutoTopUp:
|
|
245
|
-
activeTopUpConfig:
|
|
246
|
-
autoTopUpLabel:
|
|
244
|
+
manualTopUpItems: l,
|
|
245
|
+
flexibleManualTopUpItem: r,
|
|
246
|
+
showManualTopUp: f,
|
|
247
|
+
showAutoTopUp: T,
|
|
248
|
+
activeTopUpConfig: M,
|
|
249
|
+
autoTopUpLabel: w,
|
|
247
250
|
autoTopUpExplanation: $
|
|
248
251
|
};
|
|
249
|
-
},
|
|
252
|
+
}, go = { class: "flex flex-col gap-3 py-3" }, _o = { class: "flex flex-col gap-1 px-4" }, yo = { class: "flex w-full justify-between gap-3" }, bo = { class: "flex w-full items-center gap-4" }, wo = { key: 0 }, To = {
|
|
250
253
|
key: 1,
|
|
251
254
|
class: "flex w-full justify-between gap-3 px-4"
|
|
252
|
-
},
|
|
255
|
+
}, Mo = { class: "flex min-w-0 items-center gap-1" }, Uo = { class: "flex min-w-0 items-center gap-1" }, Ao = { class: "shrink-0" }, So = /* @__PURE__ */ W({
|
|
253
256
|
__name: "WalletBalancesItem",
|
|
254
257
|
props: {
|
|
255
258
|
walletBalance: {},
|
|
@@ -258,92 +261,92 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
258
261
|
},
|
|
259
262
|
emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
|
|
260
263
|
setup(e) {
|
|
261
|
-
const t = e, { $t: o } =
|
|
264
|
+
const t = e, { $t: o } = Q(), {
|
|
262
265
|
walletName: n,
|
|
263
266
|
formatBalance: a,
|
|
264
267
|
manualTopUpItems: i,
|
|
265
|
-
flexibleManualTopUpItem:
|
|
266
|
-
showManualTopUp:
|
|
267
|
-
showAutoTopUp:
|
|
268
|
-
activeTopUpConfig:
|
|
269
|
-
autoTopUpLabel:
|
|
270
|
-
autoTopUpExplanation:
|
|
271
|
-
} =
|
|
272
|
-
return (
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
C(
|
|
268
|
+
flexibleManualTopUpItem: l,
|
|
269
|
+
showManualTopUp: r,
|
|
270
|
+
showAutoTopUp: f,
|
|
271
|
+
activeTopUpConfig: T,
|
|
272
|
+
autoTopUpLabel: M,
|
|
273
|
+
autoTopUpExplanation: S
|
|
274
|
+
} = ho(t);
|
|
275
|
+
return (p, b) => (_(), Y("div", go, [
|
|
276
|
+
N("div", _o, [
|
|
277
|
+
N("div", yo, [
|
|
278
|
+
C(Z, {
|
|
276
279
|
variant: "body-xs",
|
|
277
280
|
color: "subtle",
|
|
278
281
|
"no-spacing": ""
|
|
279
282
|
}, {
|
|
280
|
-
default:
|
|
281
|
-
V(
|
|
283
|
+
default: g(() => [
|
|
284
|
+
V(k(u(n)), 1)
|
|
282
285
|
]),
|
|
283
286
|
_: 1
|
|
284
287
|
}),
|
|
285
|
-
C(
|
|
288
|
+
C(Z, {
|
|
286
289
|
variant: "body-xs",
|
|
287
290
|
color: "subtle",
|
|
288
291
|
"no-spacing": ""
|
|
289
292
|
}, {
|
|
290
|
-
default:
|
|
291
|
-
var P,
|
|
293
|
+
default: g(() => {
|
|
294
|
+
var P, x;
|
|
292
295
|
return [
|
|
293
|
-
(P = e.walletBalance.wallet_balance) != null && P.balance_at ? (
|
|
296
|
+
(P = e.walletBalance.wallet_balance) != null && P.balance_at ? (_(), E(fo, {
|
|
294
297
|
key: 0,
|
|
295
|
-
date: new Date((
|
|
296
|
-
"action-verb":
|
|
298
|
+
date: new Date((x = e.walletBalance.wallet_balance) == null ? void 0 : x.balance_at),
|
|
299
|
+
"action-verb": u(o)({
|
|
297
300
|
defaultMessage: "updated",
|
|
298
301
|
id: "wallet_balance.updated_action_verb",
|
|
299
302
|
description: "Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"
|
|
300
303
|
})
|
|
301
|
-
}, null, 8, ["date", "action-verb"])) :
|
|
304
|
+
}, null, 8, ["date", "action-verb"])) : R("", !0)
|
|
302
305
|
];
|
|
303
306
|
}),
|
|
304
307
|
_: 1
|
|
305
308
|
})
|
|
306
309
|
]),
|
|
307
|
-
|
|
308
|
-
C(
|
|
310
|
+
N("div", bo, [
|
|
311
|
+
C(Z, {
|
|
309
312
|
variant: "body-lg",
|
|
310
313
|
weight: "semibold",
|
|
311
314
|
"no-spacing": "",
|
|
312
315
|
class: "grow"
|
|
313
316
|
}, {
|
|
314
|
-
default:
|
|
315
|
-
V(
|
|
317
|
+
default: g(() => [
|
|
318
|
+
V(k(u(a)(t.walletBalance.wallet_balance.open_balance)), 1)
|
|
316
319
|
]),
|
|
317
320
|
_: 1
|
|
318
321
|
}),
|
|
319
|
-
r
|
|
322
|
+
u(r) ? (_(), E(u(se), {
|
|
320
323
|
key: 0,
|
|
321
324
|
size: "xs",
|
|
322
|
-
onClick:
|
|
325
|
+
onClick: b[0] || (b[0] = (P) => p.$emit("top-up", u(i)[0]))
|
|
323
326
|
}, {
|
|
324
|
-
default:
|
|
325
|
-
V(
|
|
327
|
+
default: g(() => [
|
|
328
|
+
V(k(u(o)({
|
|
326
329
|
defaultMessage: "Top up",
|
|
327
330
|
id: "v1V8kA",
|
|
328
331
|
description: "Button to top up a wallet balance"
|
|
329
332
|
})), 1)
|
|
330
333
|
]),
|
|
331
334
|
_: 1
|
|
332
|
-
})) :
|
|
335
|
+
})) : R("", !0)
|
|
333
336
|
])
|
|
334
337
|
]),
|
|
335
|
-
|
|
336
|
-
ue(
|
|
337
|
-
])) :
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
C(
|
|
341
|
-
tooltip:
|
|
342
|
-
C(
|
|
343
|
-
default:
|
|
344
|
-
C(
|
|
345
|
-
default:
|
|
346
|
-
V(
|
|
338
|
+
p.$slots.graph ? (_(), Y("div", wo, [
|
|
339
|
+
ue(p.$slots, "graph")
|
|
340
|
+
])) : R("", !0),
|
|
341
|
+
u(f) ? (_(), Y("div", To, [
|
|
342
|
+
N("div", Mo, [
|
|
343
|
+
C(nt, { class: "min-w-0" }, {
|
|
344
|
+
tooltip: g(() => [
|
|
345
|
+
C(at, null, {
|
|
346
|
+
default: g(() => [
|
|
347
|
+
C(it, null, {
|
|
348
|
+
default: g(() => [
|
|
349
|
+
V(k(u(S)), 1)
|
|
347
350
|
]),
|
|
348
351
|
_: 1
|
|
349
352
|
})
|
|
@@ -351,20 +354,20 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
351
354
|
_: 1
|
|
352
355
|
})
|
|
353
356
|
]),
|
|
354
|
-
default:
|
|
355
|
-
|
|
356
|
-
C(
|
|
357
|
+
default: g(() => [
|
|
358
|
+
N("div", Uo, [
|
|
359
|
+
C(Z, {
|
|
357
360
|
variant: "body-sm",
|
|
358
361
|
color: "secondary",
|
|
359
362
|
"no-spacing": "",
|
|
360
363
|
class: "truncate"
|
|
361
364
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
V(
|
|
365
|
+
default: g(() => [
|
|
366
|
+
V(k(u(M)), 1)
|
|
364
367
|
]),
|
|
365
368
|
_: 1
|
|
366
369
|
}),
|
|
367
|
-
C(
|
|
370
|
+
C(Zt, {
|
|
368
371
|
icon: "info",
|
|
369
372
|
size: "2xs",
|
|
370
373
|
class: "shrink-0 cursor-help text-gray-400"
|
|
@@ -374,29 +377,29 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
374
377
|
_: 1
|
|
375
378
|
})
|
|
376
379
|
]),
|
|
377
|
-
|
|
378
|
-
|
|
380
|
+
N("div", Ao, [
|
|
381
|
+
u(T) ? (_(), E(u(se), {
|
|
379
382
|
key: 0,
|
|
380
383
|
size: "xs",
|
|
381
384
|
intent: "secondary",
|
|
382
|
-
onClick:
|
|
385
|
+
onClick: b[1] || (b[1] = (P) => p.$emit("cancel-auto-top-up", u(T)))
|
|
383
386
|
}, {
|
|
384
|
-
default:
|
|
385
|
-
V(
|
|
387
|
+
default: g(() => [
|
|
388
|
+
V(k(u(o)({
|
|
386
389
|
defaultMessage: "Disable",
|
|
387
390
|
id: "wallet_balance.auto_top_up_disable_button",
|
|
388
391
|
description: "Button to turn off a wallet's automatic top-up"
|
|
389
392
|
})), 1)
|
|
390
393
|
]),
|
|
391
394
|
_: 1
|
|
392
|
-
})) : (
|
|
395
|
+
})) : (_(), E(u(se), {
|
|
393
396
|
key: 1,
|
|
394
397
|
size: "xs",
|
|
395
398
|
intent: "secondary",
|
|
396
|
-
onClick:
|
|
399
|
+
onClick: b[2] || (b[2] = (P) => p.$emit("auto-top-up", u(l)))
|
|
397
400
|
}, {
|
|
398
|
-
default:
|
|
399
|
-
V(
|
|
401
|
+
default: g(() => [
|
|
402
|
+
V(k(u(o)({
|
|
400
403
|
defaultMessage: "Enable",
|
|
401
404
|
id: "wallet_balance.auto_top_up_enable_button",
|
|
402
405
|
description: "Button to set up a wallet's automatic top-up"
|
|
@@ -405,10 +408,10 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
405
408
|
_: 1
|
|
406
409
|
}))
|
|
407
410
|
])
|
|
408
|
-
])) :
|
|
411
|
+
])) : R("", !0)
|
|
409
412
|
]));
|
|
410
413
|
}
|
|
411
|
-
}),
|
|
414
|
+
}), Po = { class: "flex flex-col gap-2" }, Co = /* @__PURE__ */ W({
|
|
412
415
|
__name: "WalletBalances",
|
|
413
416
|
props: {
|
|
414
417
|
customerWalletBalances: {},
|
|
@@ -418,19 +421,19 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
418
421
|
},
|
|
419
422
|
emits: ["top-up", "auto-top-up", "cancel-auto-top-up"],
|
|
420
423
|
setup(e) {
|
|
421
|
-
return (t, o) => (
|
|
424
|
+
return (t, o) => (_(), E(we, {
|
|
422
425
|
"no-spacing": "",
|
|
423
426
|
"no-border": "",
|
|
424
427
|
title: e.title
|
|
425
428
|
}, re({
|
|
426
|
-
default:
|
|
427
|
-
|
|
428
|
-
(
|
|
429
|
+
default: g(() => [
|
|
430
|
+
N("div", Po, [
|
|
431
|
+
(_(!0), Y(Te, null, Me(e.customerWalletBalances, (n) => (_(), E(we, {
|
|
429
432
|
key: n.wallet_id,
|
|
430
433
|
"no-spacing": ""
|
|
431
434
|
}, {
|
|
432
|
-
default:
|
|
433
|
-
C(
|
|
435
|
+
default: g(() => [
|
|
436
|
+
C(So, {
|
|
434
437
|
"wallet-balance": n,
|
|
435
438
|
"show-auto-top-up": e.showAutoTopUp,
|
|
436
439
|
"show-manual-top-up": e.showManualTopUp,
|
|
@@ -447,7 +450,7 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
447
450
|
}, [
|
|
448
451
|
t.$slots["heading-right"] ? {
|
|
449
452
|
name: "right",
|
|
450
|
-
fn:
|
|
453
|
+
fn: g(() => [
|
|
451
454
|
ue(t.$slots, "heading-right")
|
|
452
455
|
]),
|
|
453
456
|
key: "0"
|
|
@@ -455,8 +458,8 @@ const go = 3e4, Se = 60, Pe = 12, _o = /* @__PURE__ */ W({
|
|
|
455
458
|
]), 1032, ["title"]));
|
|
456
459
|
}
|
|
457
460
|
});
|
|
458
|
-
function
|
|
459
|
-
const e =
|
|
461
|
+
function Eo() {
|
|
462
|
+
const e = tt(), t = ot();
|
|
460
463
|
async function o(n) {
|
|
461
464
|
return e({
|
|
462
465
|
url: be(
|
|
@@ -467,7 +470,7 @@ function $o() {
|
|
|
467
470
|
"wallets",
|
|
468
471
|
"balance"
|
|
469
472
|
),
|
|
470
|
-
query:
|
|
473
|
+
query: zt({ expandParams: jt }),
|
|
471
474
|
options: { method: "POST" },
|
|
472
475
|
data: {}
|
|
473
476
|
});
|
|
@@ -476,13 +479,13 @@ function $o() {
|
|
|
476
479
|
getCustomerWalletBalances: o
|
|
477
480
|
};
|
|
478
481
|
}
|
|
479
|
-
function
|
|
480
|
-
const { getCustomerWalletBalances: t } =
|
|
482
|
+
function na({ customerId: e }) {
|
|
483
|
+
const { getCustomerWalletBalances: t } = Eo(), { data: o, execute: n, apiStatus: a, error: i, isPending: l } = Kt({
|
|
481
484
|
service: () => t(e)
|
|
482
485
|
});
|
|
483
|
-
return { walletBalances:
|
|
486
|
+
return { walletBalances: s(
|
|
484
487
|
() => o.value ?? null
|
|
485
|
-
), apiStatus: a, error: i, fetch: n, isPending:
|
|
488
|
+
), apiStatus: a, error: i, fetch: n, isPending: l };
|
|
486
489
|
}
|
|
487
490
|
const Qe = (e = [], t) => {
|
|
488
491
|
if (!(t != null && t.pricing_item_id))
|
|
@@ -495,7 +498,7 @@ const Qe = (e = [], t) => {
|
|
|
495
498
|
({ pricing_item_id: i }) => i === t.pricing_item_id
|
|
496
499
|
)
|
|
497
500
|
);
|
|
498
|
-
},
|
|
501
|
+
}, xo = (e, t) => {
|
|
499
502
|
const o = new Set(
|
|
500
503
|
(t ?? []).flatMap(
|
|
501
504
|
({ pricing_plan_schedule_infos: n }) => (n ?? []).map(({ id: a }) => a)
|
|
@@ -507,36 +510,36 @@ const Qe = (e = [], t) => {
|
|
|
507
510
|
({ pricing_plan_schedule_id: a }) => !!a && o.has(a)
|
|
508
511
|
)
|
|
509
512
|
}));
|
|
510
|
-
},
|
|
513
|
+
}, Io = ["TOP_UP", "ADD_PAYMENT_METHOD", "SUCCESS"], ke = (e) => typeof e == "object" && e !== null && "pricing_item" in e, $o = (e) => [
|
|
511
514
|
...new Set(
|
|
512
515
|
((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap(
|
|
513
516
|
(t) => ke(t) && t.pricing_plan_schedule_id ? [t.pricing_plan_schedule_id] : []
|
|
514
517
|
)
|
|
515
518
|
)
|
|
516
|
-
],
|
|
517
|
-
const o = new Set(
|
|
519
|
+
], Oo = (e, t) => {
|
|
520
|
+
const o = new Set($o(e));
|
|
518
521
|
return t.flatMap((n) => {
|
|
519
522
|
var i;
|
|
520
523
|
const a = (n.pricing_plan_schedule_infos ?? []).filter(
|
|
521
|
-
({ id:
|
|
524
|
+
({ id: l }) => o.has(l)
|
|
522
525
|
);
|
|
523
526
|
return a.length === 0 ? [] : [
|
|
524
527
|
{
|
|
525
528
|
id: n.id,
|
|
526
|
-
name: n.name || n.reference || ((i =
|
|
527
|
-
scheduleIds: a.map(({ id:
|
|
529
|
+
name: n.name || n.reference || ((i = eo(n)) == null ? void 0 : i.name) || void 0,
|
|
530
|
+
scheduleIds: a.map(({ id: l }) => l),
|
|
528
531
|
enabledPricingIds: a.flatMap(
|
|
529
|
-
(
|
|
530
|
-
var
|
|
531
|
-
return (((
|
|
532
|
-
({ pricing_id:
|
|
532
|
+
(l) => {
|
|
533
|
+
var r;
|
|
534
|
+
return (((r = l.pricing_plan_schedule) == null ? void 0 : r.enabled_pricings) ?? []).flatMap(
|
|
535
|
+
({ pricing_id: f }) => f ? [f] : []
|
|
533
536
|
);
|
|
534
537
|
}
|
|
535
538
|
)
|
|
536
539
|
}
|
|
537
540
|
];
|
|
538
541
|
});
|
|
539
|
-
},
|
|
542
|
+
}, Bo = (e, t) => {
|
|
540
543
|
if (!e || t.length === 0)
|
|
541
544
|
return e;
|
|
542
545
|
const o = new Set(t);
|
|
@@ -546,70 +549,70 @@ const Qe = (e = [], t) => {
|
|
|
546
549
|
(n) => ke(n) && !!n.pricing_plan_schedule_id && o.has(n.pricing_plan_schedule_id)
|
|
547
550
|
)
|
|
548
551
|
};
|
|
549
|
-
},
|
|
552
|
+
}, gt = (e) => ((e == null ? void 0 : e.charge_on_demand_pricing_items) ?? []).flatMap((t) => {
|
|
550
553
|
var n, a;
|
|
551
554
|
if (!ke(t))
|
|
552
555
|
return [];
|
|
553
556
|
const o = t.pricing_item_id ?? ((n = t.pricing_item) == null ? void 0 : n.id);
|
|
554
557
|
return o ? (((a = t.pricing_item) == null ? void 0 : a.configs) ?? []).map((i) => {
|
|
555
|
-
const
|
|
558
|
+
const l = Ro(i, e), r = Do(i, e);
|
|
556
559
|
return {
|
|
557
560
|
pricingItemId: o,
|
|
558
561
|
...t.pricing_plan_schedule_id && {
|
|
559
562
|
pricingPlanScheduleId: t.pricing_plan_schedule_id
|
|
560
563
|
},
|
|
561
564
|
config: i,
|
|
562
|
-
...
|
|
563
|
-
...
|
|
565
|
+
...l && { flexiblePricing: l },
|
|
566
|
+
...r && { fixedPricing: r }
|
|
564
567
|
};
|
|
565
568
|
}) : [];
|
|
566
569
|
});
|
|
567
|
-
function
|
|
568
|
-
var i,
|
|
569
|
-
if (!e.on_demand || !
|
|
570
|
+
function Do(e, t) {
|
|
571
|
+
var i, l, r;
|
|
572
|
+
if (!e.on_demand || !Jt(e, ["FIXED"]))
|
|
570
573
|
return;
|
|
571
|
-
const o = (
|
|
574
|
+
const o = (r = (l = (i = e.details) == null ? void 0 : i.bands) == null ? void 0 : l[0]) == null ? void 0 : r.fixed_amount;
|
|
572
575
|
if (!o)
|
|
573
576
|
return;
|
|
574
|
-
const n =
|
|
577
|
+
const n = _t(t), a = n ? ko(e, t) : void 0;
|
|
575
578
|
return {
|
|
576
579
|
amount: o,
|
|
577
580
|
value: a && n ? Re(a.quantity, n) : { amount: o }
|
|
578
581
|
};
|
|
579
582
|
}
|
|
580
|
-
const
|
|
583
|
+
const _t = (e) => {
|
|
581
584
|
var t;
|
|
582
585
|
return (t = e == null ? void 0 : e.wallet_balance.balance) == null ? void 0 : t.credits;
|
|
583
|
-
},
|
|
586
|
+
}, yt = (e, t) => {
|
|
584
587
|
var n;
|
|
585
588
|
const o = (n = t == null ? void 0 : t.wallet) == null ? void 0 : n.wallet_type_id;
|
|
586
589
|
return (e.wallet_grants ?? []).filter(
|
|
587
590
|
({ wallet_type_id: a }) => !o || a === o
|
|
588
591
|
);
|
|
589
|
-
},
|
|
592
|
+
}, No = (e, t) => {
|
|
590
593
|
var o, n;
|
|
591
|
-
return (n = (o =
|
|
594
|
+
return (n = (o = yt(e, t).find(
|
|
592
595
|
({ credits_grant: a }) => a == null ? void 0 : a.conversion
|
|
593
596
|
)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.conversion;
|
|
594
|
-
},
|
|
597
|
+
}, ko = (e, t) => {
|
|
595
598
|
var o, n;
|
|
596
|
-
return (n = (o =
|
|
597
|
-
}, Re = (e, t) => ({ credits: { ...t, quantity: e } }),
|
|
599
|
+
return (n = (o = yt(e, t).find(({ credits_grant: a }) => a == null ? void 0 : a.credits)) == null ? void 0 : o.credits_grant) == null ? void 0 : n.credits;
|
|
600
|
+
}, Re = (e, t) => ({ credits: { ...t, quantity: e } }), bt = (e, t) => {
|
|
598
601
|
const o = Number(e), n = Number(t);
|
|
599
602
|
return Number.isFinite(o) && Number.isFinite(n) ? String(o * n) : void 0;
|
|
600
603
|
};
|
|
601
|
-
function
|
|
602
|
-
var
|
|
604
|
+
function Ro(e, t) {
|
|
605
|
+
var f, T, M, S, p, b, P;
|
|
603
606
|
if (!e.on_demand || !Ce(e))
|
|
604
607
|
return;
|
|
605
|
-
const o = (
|
|
608
|
+
const o = (T = (f = e.details) == null ? void 0 : f.bands) == null ? void 0 : T[0], n = ((M = o == null ? void 0 : o.minimum_amount) == null ? void 0 : M.currency) ?? ((S = o == null ? void 0 : o.maximum_amount) == null ? void 0 : S.currency) ?? ((b = (p = t == null ? void 0 : t.wallet_balance.balance) == null ? void 0 : p.amount) == null ? void 0 : b.currency);
|
|
606
609
|
if (!n)
|
|
607
610
|
return;
|
|
608
|
-
const a =
|
|
609
|
-
if (!
|
|
611
|
+
const a = _t(t), i = a ? No(e, t) : void 0, l = (P = a == null ? void 0 : a.credit_type) == null ? void 0 : P.unit_name, r = (x) => {
|
|
612
|
+
if (!x)
|
|
610
613
|
return;
|
|
611
|
-
const
|
|
612
|
-
return
|
|
614
|
+
const w = a && i ? bt(x.quantity, i.rate) : void 0;
|
|
615
|
+
return w !== void 0 && a ? Re(w, a) : { amount: x };
|
|
613
616
|
};
|
|
614
617
|
return {
|
|
615
618
|
config: {
|
|
@@ -620,154 +623,154 @@ function Vo(e, t) {
|
|
|
620
623
|
...i && {
|
|
621
624
|
creditsConfiguration: {
|
|
622
625
|
conversionRate: i.rate,
|
|
623
|
-
...(
|
|
624
|
-
...(
|
|
626
|
+
...(l == null ? void 0 : l.singular) && { unitNameSingle: l.singular },
|
|
627
|
+
...(l == null ? void 0 : l.plural) && { unitNamePlural: l.plural }
|
|
625
628
|
}
|
|
626
629
|
},
|
|
627
630
|
bounds: {
|
|
628
|
-
...
|
|
629
|
-
...
|
|
631
|
+
...r(o == null ? void 0 : o.minimum_amount) && { minimum: r(o == null ? void 0 : o.minimum_amount) },
|
|
632
|
+
...r(o == null ? void 0 : o.maximum_amount) && { maximum: r(o == null ? void 0 : o.maximum_amount) }
|
|
630
633
|
}
|
|
631
634
|
};
|
|
632
635
|
}
|
|
633
636
|
const Fe = ({ fixedPricing: e, flexiblePricing: t }) => {
|
|
634
637
|
var o;
|
|
635
638
|
return (e == null ? void 0 : e.value.credits) ?? ((o = (t == null ? void 0 : t.bounds.minimum) ?? (t == null ? void 0 : t.bounds.maximum)) == null ? void 0 : o.credits);
|
|
636
|
-
},
|
|
639
|
+
}, Fo = (e) => {
|
|
637
640
|
var t;
|
|
638
641
|
return !!Fe(e) || !!((t = e.flexiblePricing) != null && t.creditsConfiguration);
|
|
639
|
-
},
|
|
642
|
+
}, qo = (e) => {
|
|
640
643
|
var t;
|
|
641
644
|
return (t = e.map(Fe).find((o) => o == null ? void 0 : o.credit_type_id)) == null ? void 0 : t.credit_type_id;
|
|
642
|
-
},
|
|
645
|
+
}, wt = (e = []) => {
|
|
643
646
|
for (const { flexiblePricing: t, fixedPricing: o } of e) {
|
|
644
647
|
const n = (t == null ? void 0 : t.currency) ?? (o == null ? void 0 : o.amount.currency);
|
|
645
648
|
if (n)
|
|
646
649
|
return n;
|
|
647
650
|
}
|
|
648
|
-
},
|
|
651
|
+
}, Tt = (e = []) => {
|
|
649
652
|
var t, o, n;
|
|
650
653
|
return (n = (o = (t = e.map(Fe).find((a) => {
|
|
651
|
-
var i,
|
|
652
|
-
return (
|
|
654
|
+
var i, l;
|
|
655
|
+
return (l = (i = a == null ? void 0 : a.credit_type) == null ? void 0 : i.unit_name) == null ? void 0 : l.plural;
|
|
653
656
|
})) == null ? void 0 : t.credit_type) == null ? void 0 : o.unit_name) == null ? void 0 : n.plural;
|
|
654
|
-
},
|
|
657
|
+
}, Vo = (e = []) => {
|
|
655
658
|
var t;
|
|
656
659
|
for (const { flexiblePricing: o } of e) {
|
|
657
660
|
const n = (t = o == null ? void 0 : o.creditsConfiguration) == null ? void 0 : t.conversionRate;
|
|
658
661
|
if (n)
|
|
659
662
|
return n;
|
|
660
663
|
}
|
|
661
|
-
},
|
|
664
|
+
}, Lo = (e = []) => {
|
|
662
665
|
for (const { flexiblePricing: t } of e) {
|
|
663
666
|
const { minimum_amount: o, maximum_amount: n } = (t == null ? void 0 : t.config) ?? {};
|
|
664
667
|
if (o || n)
|
|
665
668
|
return { ...o && { minimum: o }, ...n && { maximum: n } };
|
|
666
669
|
}
|
|
667
670
|
return {};
|
|
668
|
-
},
|
|
669
|
-
if (e.some(
|
|
670
|
-
const o =
|
|
671
|
+
}, Yo = (e = []) => {
|
|
672
|
+
if (e.some(Fo)) {
|
|
673
|
+
const o = qo(e);
|
|
671
674
|
return o ? { creditTypeId: o } : void 0;
|
|
672
675
|
}
|
|
673
|
-
const t =
|
|
676
|
+
const t = wt(e);
|
|
674
677
|
return t ? { currency: t } : void 0;
|
|
675
|
-
},
|
|
676
|
-
var
|
|
678
|
+
}, Wo = (e, t) => {
|
|
679
|
+
var l;
|
|
677
680
|
if (e.fixedPricing)
|
|
678
681
|
return e.fixedPricing.value;
|
|
679
682
|
if (!e.flexiblePricing || !t)
|
|
680
683
|
return;
|
|
681
|
-
const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (
|
|
684
|
+
const { bounds: o, creditsConfiguration: n } = e.flexiblePricing, a = (l = o.minimum ?? o.maximum) == null ? void 0 : l.credits, i = n ? bt(t.quantity, n.conversionRate) : void 0;
|
|
682
685
|
return a && i !== void 0 ? Re(i, a) : { amount: t };
|
|
683
|
-
},
|
|
684
|
-
const t =
|
|
686
|
+
}, Mt = (e = []) => {
|
|
687
|
+
const t = Yo(e);
|
|
685
688
|
if (t)
|
|
686
689
|
return {
|
|
687
690
|
denomination: t,
|
|
688
|
-
chargeCurrency:
|
|
689
|
-
creditUnitName:
|
|
690
|
-
conversionRate:
|
|
691
|
-
topUpBounds:
|
|
691
|
+
chargeCurrency: wt(e) ?? "",
|
|
692
|
+
creditUnitName: Tt(e),
|
|
693
|
+
conversionRate: Vo(e),
|
|
694
|
+
topUpBounds: Lo(e)
|
|
692
695
|
};
|
|
693
|
-
},
|
|
694
|
-
function
|
|
696
|
+
}, Ho = 400;
|
|
697
|
+
function zo({
|
|
695
698
|
pricingPlanScheduleId: e,
|
|
696
699
|
pricingItems: t
|
|
697
700
|
}) {
|
|
698
|
-
const { previewChargeOnDemandPricingItems: o } =
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
701
|
-
t.value && !
|
|
701
|
+
const { previewChargeOnDemandPricingItems: o } = pt(), n = Ue(), a = I(), i = I(!1), l = I(!1), r = s(() => i.value || l.value), f = I(!1), T = Qt(), M = async () => {
|
|
702
|
+
const S = e.value, p = T();
|
|
703
|
+
if (l.value = !1, !S || !t.value) {
|
|
704
|
+
t.value && !S && n.warn(
|
|
702
705
|
"INVOICE_PREVIEW_SKIPPED",
|
|
703
706
|
"Skipped the on-demand charge invoice preview: no schedule to charge it on",
|
|
704
707
|
{ missing: ["pricingPlanScheduleId"] }
|
|
705
|
-
), a.value = void 0, i.value = !1,
|
|
708
|
+
), a.value = void 0, i.value = !1, f.value = !1;
|
|
706
709
|
return;
|
|
707
710
|
}
|
|
708
|
-
i.value = !0,
|
|
711
|
+
i.value = !0, f.value = !1;
|
|
709
712
|
try {
|
|
710
|
-
const
|
|
711
|
-
pricingPlanScheduleId:
|
|
713
|
+
const b = await o({
|
|
714
|
+
pricingPlanScheduleId: S,
|
|
712
715
|
pricingItems: t.value
|
|
713
716
|
});
|
|
714
|
-
|
|
715
|
-
} catch (
|
|
716
|
-
|
|
717
|
+
p() && (a.value = b);
|
|
718
|
+
} catch (b) {
|
|
719
|
+
p() && (a.value = void 0, f.value = !0), n.error(
|
|
717
720
|
"INVOICE_PREVIEW_FAILED",
|
|
718
721
|
"Failed to load the invoice preview",
|
|
719
722
|
{ preview: "ON_DEMAND_CHARGE" },
|
|
720
|
-
|
|
723
|
+
b
|
|
721
724
|
);
|
|
722
725
|
} finally {
|
|
723
|
-
|
|
726
|
+
p() && (i.value = !1);
|
|
724
727
|
}
|
|
725
728
|
};
|
|
726
|
-
return
|
|
727
|
-
debounce: () => a.value || i.value ||
|
|
729
|
+
return ao(t, () => void M(), {
|
|
730
|
+
debounce: () => a.value || i.value || f.value ? Ho : 0,
|
|
728
731
|
deep: !0
|
|
729
|
-
}),
|
|
732
|
+
}), ee(
|
|
730
733
|
t,
|
|
731
|
-
(
|
|
732
|
-
|
|
734
|
+
(S) => {
|
|
735
|
+
l.value = !!S, S || (T(), a.value = void 0, f.value = !1, i.value = !1);
|
|
733
736
|
},
|
|
734
737
|
{ deep: !0, flush: "sync" }
|
|
735
|
-
),
|
|
738
|
+
), M(), { invoicePreview: a, isPreviewPending: r, hasPreviewFailed: f, loadPreview: M };
|
|
736
739
|
}
|
|
737
|
-
const
|
|
740
|
+
const jo = ["aria-busy"], Ut = /* @__PURE__ */ W({
|
|
738
741
|
__name: "TopUpInvoicePreview",
|
|
739
742
|
props: {
|
|
740
743
|
pricingPlanScheduleId: { type: String },
|
|
741
744
|
pricingItems: { type: Array }
|
|
742
745
|
},
|
|
743
746
|
setup(e) {
|
|
744
|
-
const t = e, { $t: o } =
|
|
747
|
+
const t = e, { $t: o } = Q(), n = s(() => t.pricingPlanScheduleId), a = s(() => t.pricingItems), { invoicePreview: i, isPreviewPending: l, hasPreviewFailed: r } = zo({
|
|
745
748
|
pricingPlanScheduleId: n,
|
|
746
749
|
pricingItems: a
|
|
747
|
-
}),
|
|
748
|
-
() =>
|
|
750
|
+
}), f = s(
|
|
751
|
+
() => r.value && !l.value ? o({
|
|
749
752
|
defaultMessage: "Unable to calculate the total. Please try again.",
|
|
750
753
|
description: "Shown in place of the top-up total when it failed to load",
|
|
751
754
|
id: "topup_modal.invoice_preview.error"
|
|
752
755
|
}) : void 0
|
|
753
756
|
);
|
|
754
|
-
return (
|
|
757
|
+
return (T, M) => f.value ? (_(), E(u(me), {
|
|
755
758
|
key: 0,
|
|
756
759
|
class: "sv-top-up-invoice-preview sv-top-up-invoice-preview--error sv-error",
|
|
757
|
-
title:
|
|
758
|
-
}, null, 8, ["title"])) : (
|
|
760
|
+
title: f.value
|
|
761
|
+
}, null, 8, ["title"])) : (_(), E(st, {
|
|
759
762
|
key: 1,
|
|
760
763
|
class: "sv-top-up-invoice-preview h-[152px]"
|
|
761
764
|
}, {
|
|
762
|
-
default:
|
|
763
|
-
|
|
765
|
+
default: g(() => [
|
|
766
|
+
u(i) ? (_(), Y("div", {
|
|
764
767
|
key: 0,
|
|
765
|
-
class: $e({ "opacity-60":
|
|
766
|
-
"aria-busy":
|
|
768
|
+
class: $e({ "opacity-60": u(l) }),
|
|
769
|
+
"aria-busy": u(l)
|
|
767
770
|
}, [
|
|
768
|
-
C(
|
|
769
|
-
default:
|
|
770
|
-
V(
|
|
771
|
+
C(u(no), { required: "" }, {
|
|
772
|
+
default: g(() => [
|
|
773
|
+
V(k(u(o)({
|
|
771
774
|
defaultMessage: "You will pay",
|
|
772
775
|
description: "Label above the preview of what topping up will be invoiced for",
|
|
773
776
|
id: "topup_modal.invoice_preview.label"
|
|
@@ -775,16 +778,16 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
775
778
|
]),
|
|
776
779
|
_: 1
|
|
777
780
|
}),
|
|
778
|
-
C(
|
|
779
|
-
default:
|
|
780
|
-
C(
|
|
781
|
-
invoice:
|
|
781
|
+
C(u(we), { "content-background": "none" }, {
|
|
782
|
+
default: g(() => [
|
|
783
|
+
C(u(ct), {
|
|
784
|
+
invoice: u(i),
|
|
782
785
|
"is-customer-facing": ""
|
|
783
786
|
}, null, 8, ["invoice"])
|
|
784
787
|
]),
|
|
785
788
|
_: 1
|
|
786
789
|
})
|
|
787
|
-
], 10,
|
|
790
|
+
], 10, jo)) : R("", !0)
|
|
788
791
|
]),
|
|
789
792
|
_: 1
|
|
790
793
|
}));
|
|
@@ -793,16 +796,16 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
793
796
|
quantity: e ?? null,
|
|
794
797
|
currency: t
|
|
795
798
|
}), Ee = (e, { denomination: t, chargeCurrency: o, creditUnitName: n, minimumTopUp: a }) => {
|
|
796
|
-
var i,
|
|
799
|
+
var i, l, r, f, T;
|
|
797
800
|
return {
|
|
798
801
|
enabled: (e == null ? void 0 : e.status) === "ACTIVE",
|
|
799
802
|
threshold: Ge(
|
|
800
|
-
((
|
|
803
|
+
((l = (i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) == null ? void 0 : l.quantity) ?? ((f = (r = e == null ? void 0 : e.threshold) == null ? void 0 : r.credits) == null ? void 0 : f.quantity),
|
|
801
804
|
At(t, n)
|
|
802
805
|
),
|
|
803
|
-
topUpAmount: Ge(((
|
|
806
|
+
topUpAmount: Ge(((T = e == null ? void 0 : e.topup_amount) == null ? void 0 : T.quantity) ?? a, o)
|
|
804
807
|
};
|
|
805
|
-
},
|
|
808
|
+
}, Qo = (e, t) => {
|
|
806
809
|
var n;
|
|
807
810
|
const o = (n = e.threshold) == null ? void 0 : n.quantity;
|
|
808
811
|
return o ? t.creditTypeId ? { credits: { quantity: o, credit_type_id: t.creditTypeId } } : { amount: { quantity: o, currency: t.currency ?? "" } } : {};
|
|
@@ -812,16 +815,16 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
812
815
|
quantity: e.topUpAmount.quantity,
|
|
813
816
|
currency: e.topUpAmount.currency ?? t
|
|
814
817
|
} : void 0;
|
|
815
|
-
},
|
|
818
|
+
}, St = (e, { denomination: t, chargeCurrency: o }) => ({
|
|
816
819
|
status: e.enabled ? "ACTIVE" : "INACTIVE",
|
|
817
|
-
threshold:
|
|
820
|
+
threshold: Qo(e, t),
|
|
818
821
|
...Ke(e, o) && {
|
|
819
822
|
topup_amount: Ke(e, o)
|
|
820
823
|
}
|
|
821
|
-
}), Xe = (e, t) =>
|
|
824
|
+
}), Xe = (e, t) => St(Ee(e, t), t), Je = (e, t) => JSON.stringify(e) === JSON.stringify(t), Pt = (e, t) => {
|
|
822
825
|
const o = Number(t == null ? void 0 : t.quantity);
|
|
823
826
|
return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e >= o;
|
|
824
|
-
},
|
|
827
|
+
}, Ct = (e, t) => {
|
|
825
828
|
const o = Number(t == null ? void 0 : t.quantity);
|
|
826
829
|
return e === null || !(t != null && t.quantity) || !Number.isFinite(o) || e <= o;
|
|
827
830
|
}, le = (e) => {
|
|
@@ -831,13 +834,13 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
831
834
|
const n = le(e), a = le(o);
|
|
832
835
|
if (!(n === void 0 || a === void 0 || a <= 0))
|
|
833
836
|
return t === "CREDITS" ? n / a : n * a;
|
|
834
|
-
}, Ze = (e, t, o, n) => t === o ? le(e) : qe(e, t, n),
|
|
835
|
-
const a =
|
|
837
|
+
}, Ze = (e, t, o, n) => t === o ? le(e) : qe(e, t, n), Go = (e, t, o) => t === "CREDITS" ? qe(e, "AMOUNT", o) : le(e), Ve = (e, t) => e.toFixed(lo(t)), et = (e, t, o) => t === "AMOUNT" ? Ve(e, o) : String(Number(e.toFixed(6))), Et = (e, t, o, n) => {
|
|
838
|
+
const a = Go(e == null ? void 0 : e.quantity, t, o);
|
|
836
839
|
if (a !== void 0)
|
|
837
840
|
return t === "CREDITS" ? n(a) : Ve(a, e == null ? void 0 : e.currency);
|
|
838
841
|
}, xe = /* @__PURE__ */ W({
|
|
839
842
|
__name: "ConvertedAmountInput",
|
|
840
|
-
props: /* @__PURE__ */
|
|
843
|
+
props: /* @__PURE__ */ Ht({
|
|
841
844
|
unit: { type: String },
|
|
842
845
|
modelBase: { type: String },
|
|
843
846
|
entryBase: { type: String },
|
|
@@ -857,103 +860,103 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
857
860
|
}),
|
|
858
861
|
emits: ["update:modelValue"],
|
|
859
862
|
setup(e) {
|
|
860
|
-
const t = e, o =
|
|
863
|
+
const t = e, o = Yt(e, "modelValue"), { $t: n, formatNumber: a } = Q(), i = s(() => t.entryBase ?? t.modelBase), l = s(
|
|
861
864
|
() => i.value !== t.modelBase && le(t.conversionRate) !== void 0
|
|
862
|
-
),
|
|
863
|
-
|
|
865
|
+
), r = I("");
|
|
866
|
+
ee(
|
|
864
867
|
() => [o.value, i.value, t.modelBase, t.conversionRate],
|
|
865
|
-
([
|
|
866
|
-
if (!
|
|
867
|
-
|
|
868
|
+
([c]) => {
|
|
869
|
+
if (!l.value) {
|
|
870
|
+
r.value = c ?? "";
|
|
868
871
|
return;
|
|
869
872
|
}
|
|
870
|
-
if (
|
|
873
|
+
if (c === f(r.value))
|
|
871
874
|
return;
|
|
872
|
-
const
|
|
873
|
-
|
|
875
|
+
const A = Ze(
|
|
876
|
+
c,
|
|
874
877
|
t.modelBase,
|
|
875
878
|
i.value,
|
|
876
879
|
t.conversionRate
|
|
877
880
|
);
|
|
878
|
-
|
|
881
|
+
r.value = A === void 0 ? "" : et(A, i.value, t.currency);
|
|
879
882
|
},
|
|
880
883
|
{ immediate: !0 }
|
|
881
884
|
);
|
|
882
|
-
function
|
|
883
|
-
const
|
|
884
|
-
return
|
|
885
|
+
function f(c) {
|
|
886
|
+
const A = Ze(c, i.value, t.modelBase, t.conversionRate);
|
|
887
|
+
return A === void 0 ? "" : et(A, t.modelBase, t.currency);
|
|
885
888
|
}
|
|
886
|
-
const
|
|
887
|
-
get: () =>
|
|
888
|
-
set: (
|
|
889
|
-
|
|
889
|
+
const T = s({
|
|
890
|
+
get: () => r.value,
|
|
891
|
+
set: (c) => {
|
|
892
|
+
r.value = to(c), o.value = l.value ? f(r.value) : r.value;
|
|
890
893
|
}
|
|
891
|
-
}),
|
|
892
|
-
() => qe(
|
|
893
|
-
),
|
|
894
|
+
}), M = s(
|
|
895
|
+
() => qe(r.value, i.value, t.conversionRate)
|
|
896
|
+
), S = s(() => t.creditUnitName ? t.creditUnitName : i.value === "CREDITS" ? t.unit : n({
|
|
894
897
|
defaultMessage: "credits",
|
|
895
898
|
description: "Generic name for a wallet credit, where its credit type does not name one",
|
|
896
899
|
id: "converted_amount_input.credits"
|
|
897
|
-
})),
|
|
898
|
-
const
|
|
899
|
-
return Array.isArray(
|
|
900
|
-
}),
|
|
901
|
-
const
|
|
902
|
-
if (!(P.value || !t.showConversionHint ||
|
|
900
|
+
})), p = (c, A) => Ne({ quantity: Ve(c, A), currency: A }), b = (c) => `${a(c)} ${S.value}`, P = s(() => {
|
|
901
|
+
const c = t.error;
|
|
902
|
+
return Array.isArray(c) ? c.length > 0 : !!(Wt(c) ? c.value : c);
|
|
903
|
+
}), x = s(() => {
|
|
904
|
+
const c = M.value;
|
|
905
|
+
if (!(P.value || !t.showConversionHint || c === void 0))
|
|
903
906
|
return i.value === "CREDITS" ? t.currency ? n(
|
|
904
907
|
{
|
|
905
908
|
defaultMessage: "Will cost {amount} excluding taxes",
|
|
906
909
|
description: "Helper text under a credits field, naming what those credits cost in money",
|
|
907
910
|
id: "converted_amount_input.cost"
|
|
908
911
|
},
|
|
909
|
-
{ amount: c
|
|
912
|
+
{ amount: p(c, t.currency) }
|
|
910
913
|
) : void 0 : n(
|
|
911
914
|
{
|
|
912
915
|
defaultMessage: "Buys about {credits}",
|
|
913
916
|
description: "Helper text under a money field, naming the credits that amount converts into",
|
|
914
917
|
id: "converted_amount_input.buys"
|
|
915
918
|
},
|
|
916
|
-
{ credits:
|
|
919
|
+
{ credits: b(c) }
|
|
917
920
|
);
|
|
918
|
-
}),
|
|
921
|
+
}), w = (c) => Et(c, i.value, t.conversionRate, a), $ = s(
|
|
919
922
|
() => {
|
|
920
|
-
var
|
|
921
|
-
return i.value === "CREDITS" ?
|
|
923
|
+
var c, A, B, v;
|
|
924
|
+
return i.value === "CREDITS" ? S.value : ((A = (c = t.bounds) == null ? void 0 : c.minimum) == null ? void 0 : A.currency) ?? ((v = (B = t.bounds) == null ? void 0 : B.maximum) == null ? void 0 : v.currency) ?? t.unit;
|
|
922
925
|
}
|
|
923
|
-
), h =
|
|
924
|
-
var
|
|
925
|
-
const
|
|
926
|
-
if (
|
|
926
|
+
), h = s(() => {
|
|
927
|
+
var v, U;
|
|
928
|
+
const c = w((v = t.bounds) == null ? void 0 : v.minimum), A = w((U = t.bounds) == null ? void 0 : U.maximum), B = $.value;
|
|
929
|
+
if (c && A)
|
|
927
930
|
return n(
|
|
928
931
|
{
|
|
929
932
|
defaultMessage: "Between {minimum} and {maximum} {unit}",
|
|
930
933
|
description: "Range of what a flexible top-up may be charged for, beside its label",
|
|
931
934
|
id: "converted_amount_input.bounds.range"
|
|
932
935
|
},
|
|
933
|
-
{ minimum:
|
|
936
|
+
{ minimum: c, maximum: A, unit: B }
|
|
934
937
|
);
|
|
935
|
-
if (
|
|
938
|
+
if (c)
|
|
936
939
|
return n(
|
|
937
940
|
{
|
|
938
941
|
defaultMessage: "At least {minimum} {unit}",
|
|
939
942
|
description: "Smallest amount a flexible top-up may be charged for, beside its label",
|
|
940
943
|
id: "converted_amount_input.bounds.minimum"
|
|
941
944
|
},
|
|
942
|
-
{ minimum:
|
|
945
|
+
{ minimum: c, unit: B }
|
|
943
946
|
);
|
|
944
|
-
if (
|
|
947
|
+
if (A)
|
|
945
948
|
return n(
|
|
946
949
|
{
|
|
947
950
|
defaultMessage: "Up to {maximum} {unit}",
|
|
948
951
|
description: "Largest amount a flexible top-up may be charged for, beside its label",
|
|
949
952
|
id: "converted_amount_input.bounds.maximum"
|
|
950
953
|
},
|
|
951
|
-
{ maximum:
|
|
954
|
+
{ maximum: A, unit: B }
|
|
952
955
|
);
|
|
953
956
|
});
|
|
954
|
-
return (
|
|
955
|
-
modelValue:
|
|
956
|
-
"onUpdate:modelValue":
|
|
957
|
+
return (c, A) => (_(), E(u(so), ie({
|
|
958
|
+
modelValue: T.value,
|
|
959
|
+
"onUpdate:modelValue": A[0] || (A[0] = (B) => T.value = B),
|
|
957
960
|
class: "sv-converted-amount-input",
|
|
958
961
|
type: "number",
|
|
959
962
|
"as-text-type": "",
|
|
@@ -963,39 +966,39 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
963
966
|
disabled: e.disabled,
|
|
964
967
|
error: e.error
|
|
965
968
|
}, P.value ? { "aria-invalid": "true" } : {}), re({
|
|
966
|
-
suffix:
|
|
967
|
-
|
|
969
|
+
suffix: g(() => [
|
|
970
|
+
N("span", null, k(e.unit), 1)
|
|
968
971
|
]),
|
|
969
972
|
_: 2
|
|
970
973
|
}, [
|
|
971
974
|
h.value ? {
|
|
972
975
|
name: "label-suffix",
|
|
973
|
-
fn:
|
|
974
|
-
C(
|
|
976
|
+
fn: g(() => [
|
|
977
|
+
C(u(Z), {
|
|
975
978
|
tag: "span",
|
|
976
979
|
variant: "body-xs",
|
|
977
980
|
color: "subtle",
|
|
978
981
|
"no-spacing": ""
|
|
979
982
|
}, {
|
|
980
|
-
default:
|
|
981
|
-
V(
|
|
983
|
+
default: g(() => [
|
|
984
|
+
V(k(h.value), 1)
|
|
982
985
|
]),
|
|
983
986
|
_: 1
|
|
984
987
|
})
|
|
985
988
|
]),
|
|
986
989
|
key: "0"
|
|
987
990
|
} : void 0,
|
|
988
|
-
|
|
991
|
+
x.value ? {
|
|
989
992
|
name: "helper",
|
|
990
|
-
fn:
|
|
991
|
-
C(
|
|
993
|
+
fn: g(() => [
|
|
994
|
+
C(u(Z), {
|
|
992
995
|
tag: "span",
|
|
993
996
|
variant: "body-xs",
|
|
994
997
|
color: "subtle",
|
|
995
998
|
"no-spacing": ""
|
|
996
999
|
}, {
|
|
997
|
-
default:
|
|
998
|
-
V(
|
|
1000
|
+
default: g(() => [
|
|
1001
|
+
V(k(x.value), 1)
|
|
999
1002
|
]),
|
|
1000
1003
|
_: 1
|
|
1001
1004
|
})
|
|
@@ -1004,7 +1007,7 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1004
1007
|
} : void 0
|
|
1005
1008
|
]), 1040, ["modelValue", "name", "label", "required", "disabled", "error"]));
|
|
1006
1009
|
}
|
|
1007
|
-
}),
|
|
1010
|
+
}), Ko = /* @__PURE__ */ W({
|
|
1008
1011
|
__name: "Section",
|
|
1009
1012
|
props: {
|
|
1010
1013
|
emphasized: { type: Boolean, default: !1 },
|
|
@@ -1020,31 +1023,31 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1020
1023
|
"sv-section__accent relative",
|
|
1021
1024
|
"before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5",
|
|
1022
1025
|
"before:rounded-full before:bg-primary-600"
|
|
1023
|
-
].join(" "), n =
|
|
1026
|
+
].join(" "), n = s(
|
|
1024
1027
|
() => [t.emphasized ? o : void 0, t.contentClasses].filter(Boolean).join(" ")
|
|
1025
|
-
), a =
|
|
1026
|
-
const { emphasized: i, ...
|
|
1027
|
-
return
|
|
1028
|
+
), a = s(() => {
|
|
1029
|
+
const { emphasized: i, ...l } = t;
|
|
1030
|
+
return l;
|
|
1028
1031
|
});
|
|
1029
|
-
return (i,
|
|
1032
|
+
return (i, l) => (_(), E(u(we), ie(a.value, {
|
|
1030
1033
|
class: "sv-section",
|
|
1031
1034
|
"content-classes": n.value
|
|
1032
1035
|
}), re({
|
|
1033
|
-
default:
|
|
1036
|
+
default: g(() => [
|
|
1034
1037
|
ue(i.$slots, "default")
|
|
1035
1038
|
]),
|
|
1036
1039
|
_: 2
|
|
1037
1040
|
}, [
|
|
1038
1041
|
i.$slots.right ? {
|
|
1039
1042
|
name: "right",
|
|
1040
|
-
fn:
|
|
1043
|
+
fn: g(() => [
|
|
1041
1044
|
ue(i.$slots, "right")
|
|
1042
1045
|
]),
|
|
1043
1046
|
key: "0"
|
|
1044
1047
|
} : void 0
|
|
1045
1048
|
]), 1040, ["content-classes"]));
|
|
1046
1049
|
}
|
|
1047
|
-
}),
|
|
1050
|
+
}), Xo = { class: "flex grow flex-col" }, xt = /* @__PURE__ */ W({
|
|
1048
1051
|
__name: "AutoTopUpConfig",
|
|
1049
1052
|
props: {
|
|
1050
1053
|
config: { type: Object },
|
|
@@ -1059,66 +1062,66 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1059
1062
|
disabled: { type: Boolean }
|
|
1060
1063
|
},
|
|
1061
1064
|
setup(e, { expose: t }) {
|
|
1062
|
-
const o = e, { $t: n, formatNumber: a } =
|
|
1063
|
-
var
|
|
1065
|
+
const o = e, { $t: n, formatNumber: a } = Q(), i = s(() => {
|
|
1066
|
+
var v, U;
|
|
1064
1067
|
return {
|
|
1065
1068
|
denomination: o.denomination,
|
|
1066
1069
|
chargeCurrency: o.chargeCurrency,
|
|
1067
1070
|
creditUnitName: o.creditUnitName,
|
|
1068
|
-
minimumTopUp: (U = (
|
|
1071
|
+
minimumTopUp: (U = (v = o.topUpBounds) == null ? void 0 : v.minimum) == null ? void 0 : U.quantity
|
|
1069
1072
|
};
|
|
1070
|
-
}),
|
|
1073
|
+
}), l = I(Ee(o.config, i.value)), r = s(() => At(o.denomination, o.creditUnitName)), f = s(
|
|
1071
1074
|
() => o.denomination.creditTypeId ? "CREDITS" : "AMOUNT"
|
|
1072
|
-
),
|
|
1073
|
-
() =>
|
|
1074
|
-
),
|
|
1075
|
+
), T = s(
|
|
1076
|
+
() => f.value === "CREDITS" ? r.value : o.chargeCurrency
|
|
1077
|
+
), M = s({
|
|
1075
1078
|
get: () => {
|
|
1076
|
-
var
|
|
1077
|
-
return ((
|
|
1079
|
+
var v;
|
|
1080
|
+
return ((v = l.value.threshold) == null ? void 0 : v.quantity) ?? "";
|
|
1078
1081
|
},
|
|
1079
|
-
set: (
|
|
1080
|
-
|
|
1082
|
+
set: (v) => {
|
|
1083
|
+
l.value.threshold = { quantity: v || null, currency: r.value };
|
|
1081
1084
|
}
|
|
1082
|
-
}),
|
|
1085
|
+
}), S = s({
|
|
1083
1086
|
get: () => {
|
|
1084
|
-
var
|
|
1085
|
-
return ((
|
|
1087
|
+
var v;
|
|
1088
|
+
return ((v = l.value.topUpAmount) == null ? void 0 : v.quantity) ?? "";
|
|
1086
1089
|
},
|
|
1087
|
-
set: (
|
|
1088
|
-
|
|
1090
|
+
set: (v) => {
|
|
1091
|
+
l.value.topUpAmount = { quantity: v || null, currency: o.chargeCurrency };
|
|
1089
1092
|
}
|
|
1090
1093
|
});
|
|
1091
|
-
|
|
1094
|
+
ee(
|
|
1092
1095
|
() => [o.config, i.value],
|
|
1093
|
-
([
|
|
1094
|
-
Je(Xe(
|
|
1096
|
+
([v, U]) => {
|
|
1097
|
+
Je(Xe(v, U), P()) || (l.value = Ee(v, U));
|
|
1095
1098
|
}
|
|
1096
1099
|
);
|
|
1097
|
-
const
|
|
1098
|
-
get: () => o.alwaysEnabled ||
|
|
1099
|
-
set: (
|
|
1100
|
-
|
|
1100
|
+
const p = s({
|
|
1101
|
+
get: () => o.alwaysEnabled || l.value.enabled,
|
|
1102
|
+
set: (v) => {
|
|
1103
|
+
l.value.enabled = v;
|
|
1101
1104
|
}
|
|
1102
|
-
}),
|
|
1103
|
-
() =>
|
|
1104
|
-
), P = () =>
|
|
1105
|
-
threshold:
|
|
1106
|
-
var
|
|
1107
|
-
return le((
|
|
1105
|
+
}), b = s(
|
|
1106
|
+
() => St({ ...l.value, enabled: p.value }, i.value)
|
|
1107
|
+
), P = () => b.value, x = Oe({
|
|
1108
|
+
threshold: s(() => {
|
|
1109
|
+
var v;
|
|
1110
|
+
return le((v = l.value.threshold) == null ? void 0 : v.quantity) ?? null;
|
|
1108
1111
|
}),
|
|
1109
|
-
topUpAmount:
|
|
1110
|
-
var
|
|
1111
|
-
return le((
|
|
1112
|
+
topUpAmount: s(() => {
|
|
1113
|
+
var v;
|
|
1114
|
+
return le((v = l.value.topUpAmount) == null ? void 0 : v.quantity) ?? null;
|
|
1112
1115
|
})
|
|
1113
|
-
}),
|
|
1114
|
-
if (!
|
|
1116
|
+
}), w = (v) => {
|
|
1117
|
+
if (!v)
|
|
1115
1118
|
return "";
|
|
1116
|
-
const U =
|
|
1117
|
-
return U === void 0 ? Ne(
|
|
1118
|
-
}, $ =
|
|
1119
|
+
const U = Et(v, f.value, o.conversionRate, a);
|
|
1120
|
+
return U === void 0 ? Ne(v) : `${U} ${T.value}`;
|
|
1121
|
+
}, $ = ut(() => p.value), h = (v) => (U) => !p.value || v(U), c = De(
|
|
1119
1122
|
{
|
|
1120
1123
|
threshold: {
|
|
1121
|
-
required:
|
|
1124
|
+
required: X.withMessage(
|
|
1122
1125
|
() => n({
|
|
1123
1126
|
defaultMessage: "Enter the balance to top up at.",
|
|
1124
1127
|
description: "Error shown under the auto top-up threshold when it is left empty",
|
|
@@ -1126,17 +1129,17 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1126
1129
|
}),
|
|
1127
1130
|
$
|
|
1128
1131
|
),
|
|
1129
|
-
notNegative:
|
|
1132
|
+
notNegative: X.withMessage(
|
|
1130
1133
|
() => n({
|
|
1131
1134
|
defaultMessage: "The balance to top up at cannot be negative.",
|
|
1132
1135
|
description: "Error shown under the auto top-up threshold when it is below zero",
|
|
1133
1136
|
id: "auto_topup_config.threshold.not_negative"
|
|
1134
1137
|
}),
|
|
1135
|
-
h((
|
|
1138
|
+
h((v) => v === null || v >= 0)
|
|
1136
1139
|
)
|
|
1137
1140
|
},
|
|
1138
1141
|
topUpAmount: {
|
|
1139
|
-
required:
|
|
1142
|
+
required: X.withMessage(
|
|
1140
1143
|
() => n({
|
|
1141
1144
|
defaultMessage: "Enter the amount to top up with.",
|
|
1142
1145
|
description: "Error shown under the auto top-up amount when it is left empty",
|
|
@@ -1144,89 +1147,89 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1144
1147
|
}),
|
|
1145
1148
|
$
|
|
1146
1149
|
),
|
|
1147
|
-
positive:
|
|
1150
|
+
positive: X.withMessage(
|
|
1148
1151
|
() => n({
|
|
1149
1152
|
defaultMessage: "Top up with more than zero.",
|
|
1150
1153
|
description: "Error shown under the auto top-up amount when it is zero or negative",
|
|
1151
1154
|
id: "auto_topup_config.amount.positive"
|
|
1152
1155
|
}),
|
|
1153
|
-
h((
|
|
1156
|
+
h((v) => v === null || v > 0)
|
|
1154
1157
|
),
|
|
1155
|
-
atLeastMinimum:
|
|
1158
|
+
atLeastMinimum: X.withMessage(
|
|
1156
1159
|
() => {
|
|
1157
|
-
var
|
|
1160
|
+
var v;
|
|
1158
1161
|
return n(
|
|
1159
1162
|
{
|
|
1160
1163
|
defaultMessage: "Top up with at least {minimum}.",
|
|
1161
1164
|
description: "Error shown under the auto top-up amount when it is below what the pricing allows",
|
|
1162
1165
|
id: "auto_topup_config.amount.at_least_minimum"
|
|
1163
1166
|
},
|
|
1164
|
-
{ minimum:
|
|
1167
|
+
{ minimum: w((v = o.topUpBounds) == null ? void 0 : v.minimum) }
|
|
1165
1168
|
);
|
|
1166
1169
|
},
|
|
1167
|
-
h((
|
|
1170
|
+
h((v) => {
|
|
1168
1171
|
var U;
|
|
1169
|
-
return
|
|
1172
|
+
return Pt(v, (U = o.topUpBounds) == null ? void 0 : U.minimum);
|
|
1170
1173
|
})
|
|
1171
1174
|
),
|
|
1172
|
-
withinMaximum:
|
|
1175
|
+
withinMaximum: X.withMessage(
|
|
1173
1176
|
() => {
|
|
1174
|
-
var
|
|
1177
|
+
var v;
|
|
1175
1178
|
return n(
|
|
1176
1179
|
{
|
|
1177
1180
|
defaultMessage: "Top up with at most {maximum}.",
|
|
1178
1181
|
description: "Error shown under the auto top-up amount when it is above what the pricing allows",
|
|
1179
1182
|
id: "auto_topup_config.amount.within_maximum"
|
|
1180
1183
|
},
|
|
1181
|
-
{ maximum:
|
|
1184
|
+
{ maximum: w((v = o.topUpBounds) == null ? void 0 : v.maximum) }
|
|
1182
1185
|
);
|
|
1183
1186
|
},
|
|
1184
|
-
h((
|
|
1187
|
+
h((v) => {
|
|
1185
1188
|
var U;
|
|
1186
|
-
return
|
|
1189
|
+
return Ct(v, (U = o.topUpBounds) == null ? void 0 : U.maximum);
|
|
1187
1190
|
})
|
|
1188
1191
|
)
|
|
1189
1192
|
}
|
|
1190
1193
|
},
|
|
1191
|
-
|
|
1192
|
-
),
|
|
1194
|
+
x
|
|
1195
|
+
), A = s(
|
|
1193
1196
|
() => !Je(
|
|
1194
1197
|
P(),
|
|
1195
1198
|
Xe(o.config, i.value)
|
|
1196
1199
|
)
|
|
1197
1200
|
);
|
|
1198
1201
|
function B() {
|
|
1199
|
-
return
|
|
1202
|
+
return c.value.$touch(), c.value.$invalid ? void 0 : P();
|
|
1200
1203
|
}
|
|
1201
1204
|
return t({
|
|
1202
1205
|
validate: B,
|
|
1203
|
-
rule:
|
|
1204
|
-
hasChanges:
|
|
1205
|
-
isInvalid:
|
|
1206
|
-
}), (
|
|
1206
|
+
rule: b,
|
|
1207
|
+
hasChanges: A,
|
|
1208
|
+
isInvalid: s(() => c.value.$invalid)
|
|
1209
|
+
}), (v, U) => (_(), E(Ko, {
|
|
1207
1210
|
class: "sv-auto-topup-config",
|
|
1208
1211
|
"content-background": e.contained ? "gray" : "none",
|
|
1209
1212
|
"no-spacing": !e.contained,
|
|
1210
1213
|
"no-border": !e.contained
|
|
1211
1214
|
}, {
|
|
1212
|
-
default:
|
|
1213
|
-
e.alwaysEnabled ?
|
|
1215
|
+
default: g(() => [
|
|
1216
|
+
e.alwaysEnabled ? R("", !0) : (_(), E(u(io), {
|
|
1214
1217
|
key: 0,
|
|
1215
|
-
modelValue:
|
|
1216
|
-
"onUpdate:modelValue": U[0] || (U[0] = (
|
|
1218
|
+
modelValue: p.value,
|
|
1219
|
+
"onUpdate:modelValue": U[0] || (U[0] = (G) => p.value = G),
|
|
1217
1220
|
"no-spacing": "",
|
|
1218
1221
|
"label-position": "before",
|
|
1219
1222
|
class: "!flex",
|
|
1220
1223
|
disabled: e.disabled
|
|
1221
1224
|
}, {
|
|
1222
|
-
"inline-label":
|
|
1223
|
-
|
|
1224
|
-
C(
|
|
1225
|
+
"inline-label": g(() => [
|
|
1226
|
+
N("div", Xo, [
|
|
1227
|
+
C(u(Z), {
|
|
1225
1228
|
tag: "span",
|
|
1226
1229
|
variant: "body-sm"
|
|
1227
1230
|
}, {
|
|
1228
|
-
default:
|
|
1229
|
-
V(
|
|
1231
|
+
default: g(() => [
|
|
1232
|
+
V(k(u(n)({
|
|
1230
1233
|
defaultMessage: "Auto top-up",
|
|
1231
1234
|
description: "Title of the automatic wallet top-up settings",
|
|
1232
1235
|
id: "auto_topup_config.title"
|
|
@@ -1234,13 +1237,13 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1234
1237
|
]),
|
|
1235
1238
|
_: 1
|
|
1236
1239
|
}),
|
|
1237
|
-
C(
|
|
1240
|
+
C(u(Z), {
|
|
1238
1241
|
tag: "span",
|
|
1239
1242
|
variant: "body-xs",
|
|
1240
1243
|
color: "subtle"
|
|
1241
1244
|
}, {
|
|
1242
|
-
default:
|
|
1243
|
-
V(
|
|
1245
|
+
default: g(() => [
|
|
1246
|
+
V(k(u(n)({
|
|
1244
1247
|
defaultMessage: "Automatically top up your balance when it runs low.",
|
|
1245
1248
|
description: "Subtitle of the automatic wallet top-up settings",
|
|
1246
1249
|
id: "auto_topup_config.subtitle"
|
|
@@ -1252,38 +1255,38 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1252
1255
|
]),
|
|
1253
1256
|
_: 1
|
|
1254
1257
|
}, 8, ["modelValue", "disabled"])),
|
|
1255
|
-
C(
|
|
1256
|
-
default:
|
|
1257
|
-
|
|
1258
|
+
C(u(dt), { "is-open": p.value }, {
|
|
1259
|
+
default: g(() => [
|
|
1260
|
+
p.value ? (_(), Y("div", {
|
|
1258
1261
|
key: 0,
|
|
1259
1262
|
class: $e(["grid grid-cols-1 gap-3", { "mt-4": !e.alwaysEnabled }])
|
|
1260
1263
|
}, [
|
|
1261
1264
|
C(xe, {
|
|
1262
|
-
modelValue:
|
|
1263
|
-
"onUpdate:modelValue": U[1] || (U[1] = (
|
|
1265
|
+
modelValue: M.value,
|
|
1266
|
+
"onUpdate:modelValue": U[1] || (U[1] = (G) => M.value = G),
|
|
1264
1267
|
name: "auto-top-up-threshold",
|
|
1265
|
-
unit:
|
|
1266
|
-
"model-base":
|
|
1267
|
-
"entry-base":
|
|
1268
|
+
unit: r.value,
|
|
1269
|
+
"model-base": f.value,
|
|
1270
|
+
"entry-base": f.value,
|
|
1268
1271
|
currency: e.chargeCurrency,
|
|
1269
1272
|
"conversion-rate": e.conversionRate,
|
|
1270
1273
|
"show-conversion-hint": e.showThresholdConversion,
|
|
1271
1274
|
required: "",
|
|
1272
1275
|
disabled: e.disabled,
|
|
1273
|
-
error:
|
|
1274
|
-
label:
|
|
1276
|
+
error: u(c).threshold.$errors,
|
|
1277
|
+
label: u(n)({
|
|
1275
1278
|
defaultMessage: "When your balance falls below",
|
|
1276
1279
|
description: "Label of the balance at which an automatic top-up is charged",
|
|
1277
1280
|
id: "auto_topup_config.threshold.label"
|
|
1278
1281
|
})
|
|
1279
1282
|
}, null, 8, ["modelValue", "unit", "model-base", "entry-base", "currency", "conversion-rate", "show-conversion-hint", "disabled", "error", "label"]),
|
|
1280
1283
|
C(xe, {
|
|
1281
|
-
modelValue:
|
|
1282
|
-
"onUpdate:modelValue": U[2] || (U[2] = (
|
|
1284
|
+
modelValue: S.value,
|
|
1285
|
+
"onUpdate:modelValue": U[2] || (U[2] = (G) => S.value = G),
|
|
1283
1286
|
name: "auto-top-up-amount",
|
|
1284
|
-
unit:
|
|
1287
|
+
unit: T.value,
|
|
1285
1288
|
"model-base": "AMOUNT",
|
|
1286
|
-
"entry-base":
|
|
1289
|
+
"entry-base": f.value,
|
|
1287
1290
|
currency: e.chargeCurrency,
|
|
1288
1291
|
"credit-unit-name": e.creditUnitName,
|
|
1289
1292
|
"conversion-rate": e.conversionRate,
|
|
@@ -1291,14 +1294,14 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1291
1294
|
"show-conversion-hint": "",
|
|
1292
1295
|
required: "",
|
|
1293
1296
|
disabled: e.disabled,
|
|
1294
|
-
error:
|
|
1295
|
-
label:
|
|
1297
|
+
error: u(c).topUpAmount.$errors,
|
|
1298
|
+
label: u(n)({
|
|
1296
1299
|
defaultMessage: "Top-up with",
|
|
1297
1300
|
description: "Label of the amount every automatic top-up adds",
|
|
1298
1301
|
id: "auto_topup_config.amount.label"
|
|
1299
1302
|
})
|
|
1300
1303
|
}, null, 8, ["modelValue", "unit", "entry-base", "currency", "credit-unit-name", "conversion-rate", "bounds", "disabled", "error", "label"])
|
|
1301
|
-
], 2)) :
|
|
1304
|
+
], 2)) : R("", !0)
|
|
1302
1305
|
]),
|
|
1303
1306
|
_: 1
|
|
1304
1307
|
}, 8, ["is-open"])
|
|
@@ -1306,46 +1309,12 @@ const Ko = ["aria-busy"], Mt = /* @__PURE__ */ W({
|
|
|
1306
1309
|
_: 1
|
|
1307
1310
|
}, 8, ["content-background", "no-spacing", "no-border"]));
|
|
1308
1311
|
}
|
|
1309
|
-
})
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
};
|
|
1313
|
-
function xt({
|
|
1314
|
-
paymentMethods: e,
|
|
1315
|
-
selectedPaymentMethodId: t,
|
|
1316
|
-
preferredPaymentMethodId: o
|
|
1317
|
-
}) {
|
|
1318
|
-
const n = l(
|
|
1319
|
-
() => [...e.value ?? []].sort(
|
|
1320
|
-
(a, i) => tt(i.created_at) - tt(a.created_at)
|
|
1321
|
-
)
|
|
1322
|
-
);
|
|
1323
|
-
return Q(
|
|
1324
|
-
() => [
|
|
1325
|
-
e.value,
|
|
1326
|
-
o == null ? void 0 : o.value,
|
|
1327
|
-
t.value
|
|
1328
|
-
],
|
|
1329
|
-
([a, i, u], s) => {
|
|
1330
|
-
var A;
|
|
1331
|
-
const m = s == null ? void 0 : s[0], g = a == null ? void 0 : a.find(
|
|
1332
|
-
({ id: c }) => !(m != null && m.some((y) => y.id === c))
|
|
1333
|
-
);
|
|
1334
|
-
if (g && (m != null && m.length)) {
|
|
1335
|
-
t.value = g.id;
|
|
1336
|
-
return;
|
|
1337
|
-
}
|
|
1338
|
-
const T = (c) => !!c && !!(a != null && a.some((y) => y.id === c));
|
|
1339
|
-
T(u) || (t.value = T(i) ? i : (A = (a == null ? void 0 : a.find(({ is_default: c }) => c)) ?? n.value[0]) == null ? void 0 : A.id);
|
|
1340
|
-
},
|
|
1341
|
-
{ immediate: !0 }
|
|
1342
|
-
), { sortedPaymentMethods: n };
|
|
1343
|
-
}
|
|
1344
|
-
function Ue() {
|
|
1345
|
-
const { $t: e, formatNumber: t } = G(), o = (a) => Be(e, t, a);
|
|
1312
|
+
});
|
|
1313
|
+
function Ae() {
|
|
1314
|
+
const { $t: e, formatNumber: t } = Q(), o = (a) => Be(e, t, a);
|
|
1346
1315
|
return { formatValue: o, formatOpenBalance: (a) => o(a == null ? void 0 : a.wallet_balance.open_balance) };
|
|
1347
1316
|
}
|
|
1348
|
-
const
|
|
1317
|
+
const Jo = { class: "sv-top-up-form" }, Zo = { class: "grid grid-cols-1 gap-4" }, en = { class: "grid grid-cols-1 gap-1" }, tn = { class: "sv-top-up-form__option-details" }, on = { key: 0 }, nn = /* @__PURE__ */ W({
|
|
1349
1318
|
__name: "TopUpModalForm",
|
|
1350
1319
|
props: {
|
|
1351
1320
|
topUpPricingItems: { type: null },
|
|
@@ -1355,151 +1324,151 @@ const tn = { class: "sv-top-up-form" }, on = { class: "grid grid-cols-1 gap-4" }
|
|
|
1355
1324
|
},
|
|
1356
1325
|
emits: ["add-payment-method", "success", "save-auto-top-up", "failure"],
|
|
1357
1326
|
setup(e, { expose: t, emit: o }) {
|
|
1358
|
-
const n = e, a = o, { $t: i } =
|
|
1327
|
+
const n = e, a = o, { $t: i } = Q(), { formatValue: l } = Ae(), r = I({
|
|
1359
1328
|
pricing_plan_schedule_id: "",
|
|
1360
1329
|
pricing_items: [],
|
|
1361
1330
|
start_at: "",
|
|
1362
1331
|
finalize_immediately: !1,
|
|
1363
1332
|
payment_method_id: void 0,
|
|
1364
1333
|
preview: !0
|
|
1365
|
-
}),
|
|
1334
|
+
}), f = s(() => {
|
|
1366
1335
|
const d = (n.topUpPricingItems ?? []).filter(
|
|
1367
|
-
(
|
|
1336
|
+
(m) => m.flexiblePricing || m.fixedPricing
|
|
1368
1337
|
);
|
|
1369
1338
|
return [
|
|
1370
|
-
...d.filter(({ flexiblePricing:
|
|
1371
|
-
...d.filter(({ flexiblePricing:
|
|
1339
|
+
...d.filter(({ flexiblePricing: m }) => m),
|
|
1340
|
+
...d.filter(({ flexiblePricing: m }) => !m)
|
|
1372
1341
|
];
|
|
1373
|
-
}),
|
|
1374
|
-
const { config:
|
|
1375
|
-
return D &&
|
|
1376
|
-
},
|
|
1342
|
+
}), T = (d) => f.value.find((m) => m.pricingItemId === d), M = (d) => {
|
|
1343
|
+
const { config: m, currency: y } = d.flexiblePricing ?? {}, D = m == null ? void 0 : m.minimum_amount;
|
|
1344
|
+
return D && y ? { quantity: D.quantity, currency: y } : void 0;
|
|
1345
|
+
}, S = s({
|
|
1377
1346
|
get: () => {
|
|
1378
1347
|
var d;
|
|
1379
|
-
return (d =
|
|
1348
|
+
return (d = r.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id;
|
|
1380
1349
|
},
|
|
1381
1350
|
set: (d) => {
|
|
1382
|
-
const
|
|
1383
|
-
if (!
|
|
1384
|
-
|
|
1351
|
+
const m = T(typeof d == "string" ? d : void 0);
|
|
1352
|
+
if (!m) {
|
|
1353
|
+
r.value.pricing_items = [];
|
|
1385
1354
|
return;
|
|
1386
1355
|
}
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1356
|
+
const y = M(m);
|
|
1357
|
+
r.value.pricing_items = [
|
|
1389
1358
|
{
|
|
1390
|
-
pricing_item_id:
|
|
1391
|
-
...
|
|
1359
|
+
pricing_item_id: m.pricingItemId,
|
|
1360
|
+
...y && { flexible_amount: y }
|
|
1392
1361
|
}
|
|
1393
1362
|
];
|
|
1394
1363
|
}
|
|
1395
1364
|
});
|
|
1396
|
-
|
|
1397
|
-
|
|
1365
|
+
ee(
|
|
1366
|
+
f,
|
|
1398
1367
|
(d) => {
|
|
1399
1368
|
if (d.some(
|
|
1400
1369
|
({ pricingItemId: D }) => {
|
|
1401
1370
|
var L;
|
|
1402
|
-
return D === ((L =
|
|
1371
|
+
return D === ((L = r.value.pricing_items[0]) == null ? void 0 : L.pricing_item_id);
|
|
1403
1372
|
}
|
|
1404
1373
|
))
|
|
1405
1374
|
return;
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1375
|
+
const y = d.find(({ flexiblePricing: D }) => D) ?? d[0];
|
|
1376
|
+
S.value = y == null ? void 0 : y.pricingItemId;
|
|
1408
1377
|
},
|
|
1409
1378
|
{ immediate: !0 }
|
|
1410
1379
|
);
|
|
1411
|
-
const
|
|
1380
|
+
const p = s(
|
|
1412
1381
|
() => {
|
|
1413
|
-
var d,
|
|
1414
|
-
return (
|
|
1382
|
+
var d, m;
|
|
1383
|
+
return (m = T((d = r.value.pricing_items[0]) == null ? void 0 : d.pricing_item_id)) == null ? void 0 : m.pricingPlanScheduleId;
|
|
1415
1384
|
}
|
|
1416
1385
|
);
|
|
1417
|
-
|
|
1418
|
-
|
|
1386
|
+
ee(
|
|
1387
|
+
p,
|
|
1419
1388
|
(d) => {
|
|
1420
|
-
|
|
1389
|
+
r.value.pricing_plan_schedule_id = d ?? "";
|
|
1421
1390
|
},
|
|
1422
1391
|
{ immediate: !0 }
|
|
1423
1392
|
);
|
|
1424
|
-
const
|
|
1393
|
+
const b = s({
|
|
1425
1394
|
get: () => {
|
|
1426
1395
|
var d;
|
|
1427
|
-
return (d =
|
|
1396
|
+
return (d = r.value.pricing_items[0]) == null ? void 0 : d.flexible_amount;
|
|
1428
1397
|
},
|
|
1429
1398
|
set: (d) => {
|
|
1430
|
-
var
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
{ pricing_item_id:
|
|
1399
|
+
var y;
|
|
1400
|
+
const m = (y = r.value.pricing_items[0]) == null ? void 0 : y.pricing_item_id;
|
|
1401
|
+
m && (r.value.pricing_items = [
|
|
1402
|
+
{ pricing_item_id: m, ...d && { flexible_amount: d } }
|
|
1434
1403
|
]);
|
|
1435
1404
|
}
|
|
1436
1405
|
}), P = (d) => {
|
|
1437
|
-
var
|
|
1438
|
-
const
|
|
1439
|
-
return
|
|
1440
|
-
},
|
|
1406
|
+
var y;
|
|
1407
|
+
const m = (y = T(String(d))) == null ? void 0 : y.fixedPricing;
|
|
1408
|
+
return m != null && m.value.credits ? Ne(m.amount) : void 0;
|
|
1409
|
+
}, x = s(
|
|
1441
1410
|
() => {
|
|
1442
1411
|
var d;
|
|
1443
|
-
return (d =
|
|
1412
|
+
return (d = T(String(S.value))) == null ? void 0 : d.flexiblePricing;
|
|
1444
1413
|
}
|
|
1445
|
-
),
|
|
1414
|
+
), w = s({
|
|
1446
1415
|
get: () => {
|
|
1447
1416
|
var d;
|
|
1448
|
-
return ((d =
|
|
1417
|
+
return ((d = b.value) == null ? void 0 : d.quantity) ?? "";
|
|
1449
1418
|
},
|
|
1450
1419
|
set: (d) => {
|
|
1451
|
-
var
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1420
|
+
var y;
|
|
1421
|
+
const m = (y = x.value) == null ? void 0 : y.currency;
|
|
1422
|
+
b.value = d && m ? { quantity: d, currency: m } : void 0;
|
|
1454
1423
|
}
|
|
1455
|
-
}), $ = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", h =
|
|
1424
|
+
}), $ = (d) => d.creditsConfiguration ? "CREDITS" : "AMOUNT", h = s(() => Tt(n.topUpPricingItems)), c = (d) => d.creditsConfiguration ? h.value ?? d.creditsConfiguration.unitNamePlural ?? d.creditsConfiguration.unitNameSingle ?? "" : d.currency, A = ({ config: d }) => ({
|
|
1456
1425
|
...(d == null ? void 0 : d.minimum_amount) && { minimum: d.minimum_amount },
|
|
1457
1426
|
...(d == null ? void 0 : d.maximum_amount) && { maximum: d.maximum_amount }
|
|
1458
1427
|
}), B = (d) => {
|
|
1459
|
-
var
|
|
1460
|
-
const
|
|
1461
|
-
return
|
|
1462
|
-
},
|
|
1463
|
-
() =>
|
|
1428
|
+
var y;
|
|
1429
|
+
const m = (y = T(String(d))) == null ? void 0 : y.flexiblePricing;
|
|
1430
|
+
return m ? [m] : [];
|
|
1431
|
+
}, v = s(
|
|
1432
|
+
() => f.value.map((d) => ({
|
|
1464
1433
|
value: d.pricingItemId,
|
|
1465
|
-
label: d.fixedPricing ?
|
|
1434
|
+
label: d.fixedPricing ? l(d.fixedPricing.value) : i({
|
|
1466
1435
|
defaultMessage: "Choose your own amount",
|
|
1467
1436
|
description: "Label of the choose-your-amount option in the top-up modal",
|
|
1468
1437
|
id: "topup_modal.flexible_option.label"
|
|
1469
1438
|
})
|
|
1470
1439
|
}))
|
|
1471
|
-
), U =
|
|
1472
|
-
const d =
|
|
1473
|
-
(
|
|
1474
|
-
var
|
|
1475
|
-
return !((
|
|
1440
|
+
), U = s(() => {
|
|
1441
|
+
const d = r.value.pricing_items.filter(
|
|
1442
|
+
(m) => {
|
|
1443
|
+
var y;
|
|
1444
|
+
return !((y = T(m.pricing_item_id)) != null && y.flexiblePricing) || !!m.flexible_amount;
|
|
1476
1445
|
}
|
|
1477
1446
|
);
|
|
1478
1447
|
return d.length > 0 ? d : void 0;
|
|
1479
|
-
}),
|
|
1480
|
-
() => !!
|
|
1481
|
-
), he =
|
|
1482
|
-
paymentMethodId:
|
|
1483
|
-
flexibleAmount:
|
|
1448
|
+
}), G = s(() => !n.autoTopUpConfig && f.value.some(({ flexiblePricing: m }) => m) ? Mt(n.topUpPricingItems) : void 0), te = I(), { chargeOnDemandPricingItems: ve } = pt(), fe = Ue(), H = I(!1), de = s(
|
|
1449
|
+
() => !!r.value.pricing_plan_schedule_id && !!U.value && !!r.value.payment_method_id
|
|
1450
|
+
), he = Oe({
|
|
1451
|
+
paymentMethodId: s(() => r.value.payment_method_id ?? null),
|
|
1452
|
+
flexibleAmount: s(() => {
|
|
1484
1453
|
var d;
|
|
1485
|
-
return le((d =
|
|
1454
|
+
return le((d = b.value) == null ? void 0 : d.quantity) ?? null;
|
|
1486
1455
|
})
|
|
1487
1456
|
}), ce = (d) => {
|
|
1488
|
-
var
|
|
1489
|
-
const
|
|
1490
|
-
return
|
|
1457
|
+
var y;
|
|
1458
|
+
const m = (y = x.value) == null ? void 0 : y.bounds[d];
|
|
1459
|
+
return m ? l(m) : "";
|
|
1491
1460
|
}, z = De(
|
|
1492
1461
|
{
|
|
1493
1462
|
flexibleAmount: {
|
|
1494
|
-
required:
|
|
1463
|
+
required: X.withMessage(
|
|
1495
1464
|
() => i({
|
|
1496
1465
|
defaultMessage: "Enter the amount to top up with.",
|
|
1497
1466
|
description: "Error shown under the choose-your-amount input in the top-up modal when it is left empty",
|
|
1498
1467
|
id: "topup_modal.amount.required"
|
|
1499
1468
|
}),
|
|
1500
|
-
|
|
1469
|
+
ut(() => !!x.value)
|
|
1501
1470
|
),
|
|
1502
|
-
positive:
|
|
1471
|
+
positive: X.withMessage(
|
|
1503
1472
|
() => i({
|
|
1504
1473
|
defaultMessage: "Top up with more than zero.",
|
|
1505
1474
|
description: "Error shown under the choose-your-amount input in the top-up modal when it is zero or negative",
|
|
@@ -1507,7 +1476,7 @@ const tn = { class: "sv-top-up-form" }, on = { class: "grid grid-cols-1 gap-4" }
|
|
|
1507
1476
|
}),
|
|
1508
1477
|
(d) => d === null || d > 0
|
|
1509
1478
|
),
|
|
1510
|
-
atLeastMinimum:
|
|
1479
|
+
atLeastMinimum: X.withMessage(
|
|
1511
1480
|
() => i(
|
|
1512
1481
|
{
|
|
1513
1482
|
defaultMessage: "Top up with at least {minimum}.",
|
|
@@ -1517,11 +1486,11 @@ const tn = { class: "sv-top-up-form" }, on = { class: "grid grid-cols-1 gap-4" }
|
|
|
1517
1486
|
{ minimum: ce("minimum") }
|
|
1518
1487
|
),
|
|
1519
1488
|
(d) => {
|
|
1520
|
-
var
|
|
1521
|
-
return
|
|
1489
|
+
var m, y;
|
|
1490
|
+
return Pt(d, (y = (m = x.value) == null ? void 0 : m.config) == null ? void 0 : y.minimum_amount);
|
|
1522
1491
|
}
|
|
1523
1492
|
),
|
|
1524
|
-
withinMaximum:
|
|
1493
|
+
withinMaximum: X.withMessage(
|
|
1525
1494
|
() => i(
|
|
1526
1495
|
{
|
|
1527
1496
|
defaultMessage: "Top up with at most {maximum}.",
|
|
@@ -1531,44 +1500,44 @@ const tn = { class: "sv-top-up-form" }, on = { class: "grid grid-cols-1 gap-4" }
|
|
|
1531
1500
|
{ maximum: ce("maximum") }
|
|
1532
1501
|
),
|
|
1533
1502
|
(d) => {
|
|
1534
|
-
var
|
|
1535
|
-
return
|
|
1503
|
+
var m, y;
|
|
1504
|
+
return Ct(d, (y = (m = x.value) == null ? void 0 : m.config) == null ? void 0 : y.maximum_amount);
|
|
1536
1505
|
}
|
|
1537
1506
|
)
|
|
1538
1507
|
},
|
|
1539
1508
|
paymentMethodId: {
|
|
1540
|
-
required:
|
|
1509
|
+
required: X.withMessage(
|
|
1541
1510
|
() => i({
|
|
1542
1511
|
defaultMessage: "Select a payment method to pay for this top-up.",
|
|
1543
1512
|
description: "Error shown under the payment methods in the top-up modal when none is selected on submit",
|
|
1544
1513
|
id: "topup_modal.payment_method_required"
|
|
1545
1514
|
}),
|
|
1546
|
-
|
|
1515
|
+
rt
|
|
1547
1516
|
)
|
|
1548
1517
|
}
|
|
1549
1518
|
},
|
|
1550
1519
|
he
|
|
1551
|
-
), ne =
|
|
1552
|
-
const [d] =
|
|
1553
|
-
return
|
|
1520
|
+
), ne = s(() => {
|
|
1521
|
+
const [d] = r.value.pricing_items, m = T(d == null ? void 0 : d.pricing_item_id);
|
|
1522
|
+
return m ? Wo(m, d == null ? void 0 : d.flexible_amount) : void 0;
|
|
1554
1523
|
});
|
|
1555
1524
|
async function pe() {
|
|
1556
|
-
var
|
|
1525
|
+
var m, y, D;
|
|
1557
1526
|
z.value.$touch();
|
|
1558
|
-
const d = (
|
|
1559
|
-
if (!(z.value.$invalid || (
|
|
1527
|
+
const d = (m = te.value) == null ? void 0 : m.validate();
|
|
1528
|
+
if (!(z.value.$invalid || (y = te.value) != null && y.isInvalid || !de.value || H.value)) {
|
|
1560
1529
|
H.value = !0;
|
|
1561
1530
|
try {
|
|
1562
1531
|
const L = await ve({
|
|
1563
|
-
pricing_plan_schedule_id:
|
|
1532
|
+
pricing_plan_schedule_id: r.value.pricing_plan_schedule_id,
|
|
1564
1533
|
pricing_items: U.value ?? [],
|
|
1565
|
-
payment_method_id:
|
|
1534
|
+
payment_method_id: r.value.payment_method_id,
|
|
1566
1535
|
preview: !1
|
|
1567
1536
|
});
|
|
1568
|
-
(d == null ? void 0 : d.status) === "ACTIVE" && ((D = te.value) != null && D.hasChanges) &&
|
|
1537
|
+
(d == null ? void 0 : d.status) === "ACTIVE" && ((D = te.value) != null && D.hasChanges) && r.value.payment_method_id && a("save-auto-top-up", {
|
|
1569
1538
|
rule: d,
|
|
1570
|
-
paymentMethodId:
|
|
1571
|
-
pricingPlanScheduleId:
|
|
1539
|
+
paymentMethodId: r.value.payment_method_id,
|
|
1540
|
+
pricingPlanScheduleId: r.value.pricing_plan_schedule_id
|
|
1572
1541
|
}), a("success", L);
|
|
1573
1542
|
} catch (L) {
|
|
1574
1543
|
fe.error("TOP_UP_FAILED", "Failed to charge the wallet top-up", {}, L), a("failure", L);
|
|
@@ -1578,38 +1547,38 @@ const tn = { class: "sv-top-up-form" }, on = { class: "grid grid-cols-1 gap-4" }
|
|
|
1578
1547
|
}
|
|
1579
1548
|
}
|
|
1580
1549
|
t({ submit: pe, isCharging: H, canSubmit: de, chargedValue: ne });
|
|
1581
|
-
const oe =
|
|
1582
|
-
get: () =>
|
|
1550
|
+
const oe = s({
|
|
1551
|
+
get: () => r.value.payment_method_id ?? void 0,
|
|
1583
1552
|
set: (d) => {
|
|
1584
|
-
|
|
1553
|
+
r.value.payment_method_id = d;
|
|
1585
1554
|
}
|
|
1586
|
-
}), { sortedPaymentMethods: ge } =
|
|
1587
|
-
paymentMethods:
|
|
1555
|
+
}), { sortedPaymentMethods: ge } = vt({
|
|
1556
|
+
paymentMethods: s(() => n.paymentMethods),
|
|
1588
1557
|
selectedPaymentMethodId: oe
|
|
1589
1558
|
});
|
|
1590
|
-
return (d,
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1559
|
+
return (d, m) => (_(), Y("form", Jo, [
|
|
1560
|
+
N("div", Zo, [
|
|
1561
|
+
N("div", en, [
|
|
1562
|
+
v.value.length > 0 ? (_(), E(u(lt), {
|
|
1594
1563
|
key: 0,
|
|
1595
|
-
modelValue:
|
|
1596
|
-
"onUpdate:modelValue":
|
|
1564
|
+
modelValue: S.value,
|
|
1565
|
+
"onUpdate:modelValue": m[3] || (m[3] = (y) => S.value = y),
|
|
1597
1566
|
class: "sv-top-up-form__options",
|
|
1598
1567
|
name: "top-up-pricing-item",
|
|
1599
1568
|
direction: "column",
|
|
1600
1569
|
required: "",
|
|
1601
1570
|
disabled: H.value,
|
|
1602
|
-
options:
|
|
1571
|
+
options: v.value,
|
|
1603
1572
|
"show-radio": !1,
|
|
1604
|
-
label:
|
|
1573
|
+
label: u(i)({
|
|
1605
1574
|
defaultMessage: "Top up amount",
|
|
1606
1575
|
description: "Label above the list of ways to top up the wallet in the top-up modal",
|
|
1607
1576
|
id: "topup_modal.pricing_items.label"
|
|
1608
1577
|
})
|
|
1609
1578
|
}, {
|
|
1610
|
-
label:
|
|
1611
|
-
|
|
1612
|
-
P(D) ? (
|
|
1579
|
+
label: g(({ option: y, optionValue: D }) => [
|
|
1580
|
+
N("span", null, k(y.label), 1),
|
|
1581
|
+
P(D) ? (_(), E(u(Z), {
|
|
1613
1582
|
key: 0,
|
|
1614
1583
|
tag: "span",
|
|
1615
1584
|
variant: "body-sm",
|
|
@@ -1618,121 +1587,121 @@ const tn = { class: "sv-top-up-form" }, on = { class: "grid grid-cols-1 gap-4" }
|
|
|
1618
1587
|
"no-spacing": "",
|
|
1619
1588
|
class: "sv-top-up-form__option-cost"
|
|
1620
1589
|
}, {
|
|
1621
|
-
default:
|
|
1622
|
-
V(
|
|
1590
|
+
default: g(() => [
|
|
1591
|
+
V(k(P(D)), 1)
|
|
1623
1592
|
]),
|
|
1624
1593
|
_: 2
|
|
1625
|
-
}, 1024)) :
|
|
1594
|
+
}, 1024)) : R("", !0)
|
|
1626
1595
|
]),
|
|
1627
|
-
description:
|
|
1628
|
-
|
|
1629
|
-
B(
|
|
1596
|
+
description: g(({ optionValue: y }) => [
|
|
1597
|
+
N("div", tn, [
|
|
1598
|
+
B(y).length > 0 ? (_(), E(u(dt), {
|
|
1630
1599
|
key: 0,
|
|
1631
|
-
"is-open": String(
|
|
1600
|
+
"is-open": String(y) === S.value,
|
|
1632
1601
|
lazy: ""
|
|
1633
1602
|
}, {
|
|
1634
|
-
default:
|
|
1635
|
-
(
|
|
1603
|
+
default: g(() => [
|
|
1604
|
+
(_(!0), Y(Te, null, Me(B(y), (D) => {
|
|
1636
1605
|
var L;
|
|
1637
|
-
return
|
|
1606
|
+
return _(), Y("div", {
|
|
1638
1607
|
key: D.currency,
|
|
1639
1608
|
class: "sv-top-up-form__amount grid grid-cols-1 gap-3",
|
|
1640
|
-
onClick:
|
|
1609
|
+
onClick: m[1] || (m[1] = ze(() => {
|
|
1641
1610
|
}, ["stop"])),
|
|
1642
|
-
onKeydown:
|
|
1611
|
+
onKeydown: m[2] || (m[2] = ze(() => {
|
|
1643
1612
|
}, ["stop"]))
|
|
1644
1613
|
}, [
|
|
1645
1614
|
C(xe, {
|
|
1646
|
-
modelValue:
|
|
1647
|
-
"onUpdate:modelValue":
|
|
1615
|
+
modelValue: w.value,
|
|
1616
|
+
"onUpdate:modelValue": m[0] || (m[0] = (ae) => w.value = ae),
|
|
1648
1617
|
name: "top-up-amount",
|
|
1649
|
-
label:
|
|
1618
|
+
label: u(i)({
|
|
1650
1619
|
defaultMessage: "Amount",
|
|
1651
1620
|
description: "Label of the amount input of the choose-your-amount top-up",
|
|
1652
1621
|
id: "topup_modal.amount.label"
|
|
1653
1622
|
}),
|
|
1654
|
-
bounds:
|
|
1623
|
+
bounds: A(D),
|
|
1655
1624
|
"model-base": "AMOUNT",
|
|
1656
|
-
unit:
|
|
1625
|
+
unit: c(D),
|
|
1657
1626
|
"entry-base": $(D),
|
|
1658
1627
|
currency: D.currency,
|
|
1659
1628
|
"conversion-rate": (L = D.creditsConfiguration) == null ? void 0 : L.conversionRate,
|
|
1660
1629
|
required: "",
|
|
1661
1630
|
disabled: H.value,
|
|
1662
|
-
error:
|
|
1631
|
+
error: u(z).flexibleAmount.$errors
|
|
1663
1632
|
}, null, 8, ["modelValue", "label", "bounds", "unit", "entry-base", "currency", "conversion-rate", "disabled", "error"])
|
|
1664
1633
|
], 32);
|
|
1665
1634
|
}), 128))
|
|
1666
1635
|
]),
|
|
1667
1636
|
_: 2
|
|
1668
|
-
}, 1032, ["is-open"])) :
|
|
1637
|
+
}, 1032, ["is-open"])) : R("", !0)
|
|
1669
1638
|
])
|
|
1670
1639
|
]),
|
|
1671
1640
|
_: 1
|
|
1672
|
-
}, 8, ["modelValue", "disabled", "options", "label"])) :
|
|
1641
|
+
}, 8, ["modelValue", "disabled", "options", "label"])) : R("", !0)
|
|
1673
1642
|
]),
|
|
1674
|
-
|
|
1675
|
-
C(
|
|
1676
|
-
"pricing-plan-schedule-id":
|
|
1643
|
+
N("div", null, [
|
|
1644
|
+
C(Ut, {
|
|
1645
|
+
"pricing-plan-schedule-id": p.value,
|
|
1677
1646
|
"pricing-items": U.value
|
|
1678
1647
|
}, null, 8, ["pricing-plan-schedule-id", "pricing-items"])
|
|
1679
1648
|
]),
|
|
1680
|
-
|
|
1681
|
-
C(
|
|
1649
|
+
G.value ? (_(), Y("div", on, [
|
|
1650
|
+
C(xt, ie({
|
|
1682
1651
|
ref_key: "autoTopUpFormRef",
|
|
1683
1652
|
ref: te,
|
|
1684
1653
|
class: "sv-top-up-form__auto-top-up"
|
|
1685
|
-
},
|
|
1654
|
+
}, G.value, {
|
|
1686
1655
|
contained: "",
|
|
1687
1656
|
"show-threshold-conversion": !1,
|
|
1688
1657
|
disabled: H.value
|
|
1689
1658
|
}), null, 16, ["disabled"])
|
|
1690
|
-
])) :
|
|
1691
|
-
|
|
1692
|
-
C(
|
|
1659
|
+
])) : R("", !0),
|
|
1660
|
+
N("div", null, [
|
|
1661
|
+
C(u(oo), { spacing: "xs" })
|
|
1693
1662
|
]),
|
|
1694
|
-
|
|
1695
|
-
C(
|
|
1663
|
+
N("div", null, [
|
|
1664
|
+
C(mt, {
|
|
1696
1665
|
modelValue: oe.value,
|
|
1697
|
-
"onUpdate:modelValue":
|
|
1666
|
+
"onUpdate:modelValue": m[4] || (m[4] = (y) => oe.value = y),
|
|
1698
1667
|
class: "sv-top-up-form__payment-methods",
|
|
1699
|
-
"payment-methods":
|
|
1668
|
+
"payment-methods": u(ge),
|
|
1700
1669
|
required: "",
|
|
1701
|
-
error:
|
|
1670
|
+
error: u(z).paymentMethodId.$errors,
|
|
1702
1671
|
"payment-method-options": e.paymentMethodOptions,
|
|
1703
1672
|
disabled: H.value,
|
|
1704
|
-
label:
|
|
1673
|
+
label: u(i)({
|
|
1705
1674
|
defaultMessage: "Payment method",
|
|
1706
1675
|
description: "Label above the payment method that pays for the top-up, in the top-up modal",
|
|
1707
1676
|
id: "topup_modal.payment_method_selector.label"
|
|
1708
1677
|
}),
|
|
1709
|
-
onAddPaymentMethod:
|
|
1678
|
+
onAddPaymentMethod: m[5] || (m[5] = (y) => a("add-payment-method"))
|
|
1710
1679
|
}, null, 8, ["modelValue", "payment-methods", "error", "payment-method-options", "disabled", "label"])
|
|
1711
1680
|
])
|
|
1712
1681
|
])
|
|
1713
1682
|
]));
|
|
1714
1683
|
}
|
|
1715
|
-
}),
|
|
1684
|
+
}), an = { class: "sv-top-up-success grid grid-cols-1 gap-4" }, sn = /* @__PURE__ */ W({
|
|
1716
1685
|
__name: "TopUpModalSuccess",
|
|
1717
1686
|
props: {
|
|
1718
1687
|
invoice: { type: Object }
|
|
1719
1688
|
},
|
|
1720
1689
|
setup(e) {
|
|
1721
|
-
const { $t: t } =
|
|
1722
|
-
return (o, n) => (
|
|
1723
|
-
e.invoice ? (
|
|
1690
|
+
const { $t: t } = Q();
|
|
1691
|
+
return (o, n) => (_(), Y("div", an, [
|
|
1692
|
+
e.invoice ? (_(), E(u(we), {
|
|
1724
1693
|
key: 0,
|
|
1725
1694
|
"content-background": "none"
|
|
1726
1695
|
}, {
|
|
1727
|
-
default:
|
|
1728
|
-
C(
|
|
1696
|
+
default: g(() => [
|
|
1697
|
+
C(u(Z), {
|
|
1729
1698
|
tag: "span",
|
|
1730
1699
|
variant: "body-sm",
|
|
1731
1700
|
weight: "semibold",
|
|
1732
1701
|
class: "mb-2 block"
|
|
1733
1702
|
}, {
|
|
1734
|
-
default:
|
|
1735
|
-
V(
|
|
1703
|
+
default: g(() => [
|
|
1704
|
+
V(k(u(t)({
|
|
1736
1705
|
defaultMessage: "Receipt",
|
|
1737
1706
|
description: "Heading above the invoice a completed top-up produced",
|
|
1738
1707
|
id: "topup_modal.success.receipt.heading"
|
|
@@ -1740,22 +1709,22 @@ const tn = { class: "sv-top-up-form" }, on = { class: "grid grid-cols-1 gap-4" }
|
|
|
1740
1709
|
]),
|
|
1741
1710
|
_: 1
|
|
1742
1711
|
}),
|
|
1743
|
-
C(
|
|
1712
|
+
C(u(ct), {
|
|
1744
1713
|
invoice: e.invoice,
|
|
1745
1714
|
"is-customer-facing": ""
|
|
1746
1715
|
}, null, 8, ["invoice"])
|
|
1747
1716
|
]),
|
|
1748
1717
|
_: 1
|
|
1749
|
-
})) :
|
|
1718
|
+
})) : R("", !0)
|
|
1750
1719
|
]));
|
|
1751
1720
|
}
|
|
1752
1721
|
});
|
|
1753
|
-
function
|
|
1722
|
+
function ln({
|
|
1754
1723
|
step: e,
|
|
1755
1724
|
currentBalance: t,
|
|
1756
1725
|
topUpValue: o
|
|
1757
1726
|
}) {
|
|
1758
|
-
const { $t: n, formatNumber: a } =
|
|
1727
|
+
const { $t: n, formatNumber: a } = Q(), i = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1759
1728
|
defaultMessage: "Add payment method",
|
|
1760
1729
|
description: "Title of the top-up modal while the customer is adding a payment method",
|
|
1761
1730
|
id: "topup_modal.add_payment_method.title"
|
|
@@ -1767,7 +1736,7 @@ function dn({
|
|
|
1767
1736
|
defaultMessage: "Top up balance",
|
|
1768
1737
|
description: "Title of the wallet top-up modal",
|
|
1769
1738
|
id: "topup_modal.title"
|
|
1770
|
-
})),
|
|
1739
|
+
})), l = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1771
1740
|
defaultMessage: "Add a new payment method for topping up your balance.",
|
|
1772
1741
|
description: "Subtitle of the top-up modal while the customer is adding a payment method",
|
|
1773
1742
|
id: "topup_modal.add_payment_method.subtitle"
|
|
@@ -1782,7 +1751,7 @@ function dn({
|
|
|
1782
1751
|
id: "topup_modal.subtitle"
|
|
1783
1752
|
},
|
|
1784
1753
|
{ balance: t.value }
|
|
1785
|
-
)),
|
|
1754
|
+
)), r = s(
|
|
1786
1755
|
() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1787
1756
|
defaultMessage: "Back",
|
|
1788
1757
|
description: "Label of the button that leaves the add payment method step in the top-up modal",
|
|
@@ -1792,7 +1761,7 @@ function dn({
|
|
|
1792
1761
|
description: "Label of the button that closes the top-up modal",
|
|
1793
1762
|
id: "topup_modal.cancel_button.label"
|
|
1794
1763
|
})
|
|
1795
|
-
),
|
|
1764
|
+
), f = s(() => e.value === "ADD_PAYMENT_METHOD" ? n({
|
|
1796
1765
|
defaultMessage: "Save payment method",
|
|
1797
1766
|
description: "Label of the confirm button in the top-up modal while adding a payment method",
|
|
1798
1767
|
id: "topup_modal.save_payment_method.label"
|
|
@@ -1812,160 +1781,79 @@ function dn({
|
|
|
1812
1781
|
description: "Label of the confirm button in the top-up modal while no amount is entered",
|
|
1813
1782
|
id: "topup_modal.confirm_button.empty.label"
|
|
1814
1783
|
}));
|
|
1815
|
-
return { title: i, subTitle:
|
|
1816
|
-
}
|
|
1817
|
-
function Ot({
|
|
1818
|
-
isOpen: e,
|
|
1819
|
-
customer: t,
|
|
1820
|
-
subscriptionId: o,
|
|
1821
|
-
onError: n
|
|
1822
|
-
}) {
|
|
1823
|
-
const { paymentMethodOptions: a, get: i, isPending: u } = mo(), s = async () => {
|
|
1824
|
-
const g = t.value;
|
|
1825
|
-
if (!(!e.value || !g))
|
|
1826
|
-
try {
|
|
1827
|
-
await i({
|
|
1828
|
-
customerId: g.id,
|
|
1829
|
-
...o != null && o.value ? { subscriptionId: o.value } : {},
|
|
1830
|
-
country: po(g)
|
|
1831
|
-
});
|
|
1832
|
-
} catch (T) {
|
|
1833
|
-
n == null || n(T);
|
|
1834
|
-
}
|
|
1835
|
-
};
|
|
1836
|
-
Q(
|
|
1837
|
-
() => [e.value, t.value, o == null ? void 0 : o.value],
|
|
1838
|
-
() => void s(),
|
|
1839
|
-
{ immediate: !0 }
|
|
1840
|
-
);
|
|
1841
|
-
const m = l(
|
|
1842
|
-
() => u.value ? void 0 : a.value
|
|
1843
|
-
);
|
|
1844
|
-
return { paymentMethodOptions: a, settledOptions: m, isPending: u, load: s };
|
|
1784
|
+
return { title: i, subTitle: l, cancelButtonText: r, confirmButtonText: f };
|
|
1845
1785
|
}
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
props: {
|
|
1849
|
-
customer: { type: Object },
|
|
1850
|
-
paymentMethodOptions: { type: Array },
|
|
1851
|
-
isLoading: { type: Boolean },
|
|
1852
|
-
isActive: { type: Boolean }
|
|
1853
|
-
},
|
|
1854
|
-
emits: ["success", "failure"],
|
|
1855
|
-
setup(e, { expose: t }) {
|
|
1856
|
-
const o = jt(
|
|
1857
|
-
() => import("./PaymentMethodForm-CqP3GoNj.mjs").then((s) => s.default)
|
|
1858
|
-
), n = e, a = l(() => ({
|
|
1859
|
-
variant: "TOKENIZE"
|
|
1860
|
-
})), i = x(!1);
|
|
1861
|
-
Q(
|
|
1862
|
-
() => n.isActive,
|
|
1863
|
-
(s) => {
|
|
1864
|
-
i.value = i.value || !!s;
|
|
1865
|
-
},
|
|
1866
|
-
{ immediate: !0 }
|
|
1867
|
-
);
|
|
1868
|
-
const u = x();
|
|
1869
|
-
return t({
|
|
1870
|
-
/** Submits the form, for a host whose own chrome owns the button — a modal footer, say. */
|
|
1871
|
-
submit: () => {
|
|
1872
|
-
var s;
|
|
1873
|
-
return (s = u.value) == null ? void 0 : s.submit();
|
|
1874
|
-
},
|
|
1875
|
-
/**
|
|
1876
|
-
* Whether the gateway is working on it, so the host can show it and hold everything else. Read
|
|
1877
|
-
* through the pane being on screen: a form left behind on another pane is not what is pending.
|
|
1878
|
-
*/
|
|
1879
|
-
isSaving: l(() => {
|
|
1880
|
-
var s;
|
|
1881
|
-
return !!n.isActive && !!((s = u.value) != null && s.isPaymentPending);
|
|
1882
|
-
})
|
|
1883
|
-
}), (s, m) => e.customer && i.value ? (b(), E(r(o), {
|
|
1884
|
-
key: 0,
|
|
1885
|
-
ref_key: "formRef",
|
|
1886
|
-
ref: u,
|
|
1887
|
-
class: "sv-add-payment-method-pane",
|
|
1888
|
-
"hide-submit-button": "",
|
|
1889
|
-
customer: e.customer,
|
|
1890
|
-
"payment-method-options": e.paymentMethodOptions ?? [],
|
|
1891
|
-
"is-loading": e.isLoading,
|
|
1892
|
-
configuration: a.value,
|
|
1893
|
-
onSuccess: m[0] || (m[0] = (g) => s.$emit("success")),
|
|
1894
|
-
onFailure: m[1] || (m[1] = (g) => s.$emit("failure", g))
|
|
1895
|
-
}, null, 8, ["customer", "payment-method-options", "is-loading", "configuration"])) : N("", !0);
|
|
1896
|
-
}
|
|
1897
|
-
});
|
|
1898
|
-
function pn(e) {
|
|
1899
|
-
const t = x(0), o = (a) => {
|
|
1786
|
+
function un(e) {
|
|
1787
|
+
const t = I(0), o = (a) => {
|
|
1900
1788
|
t.value = (a == null ? void 0 : a.offsetHeight) ?? 0;
|
|
1901
1789
|
}, n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((a) => {
|
|
1902
|
-
var
|
|
1903
|
-
const i = (
|
|
1790
|
+
var l;
|
|
1791
|
+
const i = (l = a[0]) == null ? void 0 : l.target;
|
|
1904
1792
|
o(i instanceof HTMLElement ? i : void 0);
|
|
1905
1793
|
});
|
|
1906
|
-
return
|
|
1794
|
+
return ee(
|
|
1907
1795
|
e,
|
|
1908
1796
|
(a, i) => {
|
|
1909
1797
|
i && (n == null || n.unobserve(i)), o(a), a && (n == null || n.observe(a));
|
|
1910
1798
|
},
|
|
1911
1799
|
// `post` so the callback runs after the render that assigns the template ref, not before.
|
|
1912
1800
|
{ immediate: !0, flush: "post" }
|
|
1913
|
-
),
|
|
1801
|
+
), Ie(() => {
|
|
1914
1802
|
n == null || n.disconnect();
|
|
1915
1803
|
}), t;
|
|
1916
1804
|
}
|
|
1917
|
-
const
|
|
1805
|
+
const rn = ["inert"], dn = 300, cn = "1rem", pn = /* @__PURE__ */ W({
|
|
1918
1806
|
__name: "SlidingPanes",
|
|
1919
1807
|
props: {
|
|
1920
1808
|
panes: { type: Array },
|
|
1921
1809
|
current: { type: String }
|
|
1922
1810
|
},
|
|
1923
1811
|
setup(e) {
|
|
1924
|
-
const t = e, o =
|
|
1812
|
+
const t = e, o = I(!1);
|
|
1925
1813
|
let n;
|
|
1926
|
-
|
|
1814
|
+
ee(
|
|
1927
1815
|
() => t.current,
|
|
1928
1816
|
() => {
|
|
1929
1817
|
o.value = !0, clearTimeout(n), n = setTimeout(() => {
|
|
1930
1818
|
o.value = !1;
|
|
1931
|
-
},
|
|
1819
|
+
}, dn);
|
|
1932
1820
|
}
|
|
1933
|
-
),
|
|
1821
|
+
), Ie(() => {
|
|
1934
1822
|
clearTimeout(n);
|
|
1935
1823
|
});
|
|
1936
|
-
const a =
|
|
1937
|
-
a.value[
|
|
1938
|
-
}),
|
|
1939
|
-
const
|
|
1940
|
-
return
|
|
1824
|
+
const a = I({}), i = {}, l = (M) => i[M] ?? (i[M] = (S) => {
|
|
1825
|
+
a.value[M] = S instanceof HTMLElement ? S : void 0;
|
|
1826
|
+
}), r = s(() => a.value[t.current]), f = un(r), T = s(() => {
|
|
1827
|
+
const M = t.panes.indexOf(t.current);
|
|
1828
|
+
return M > 0 ? `translateX(calc(${-M} * (100% + ${cn})))` : "translateX(0px)";
|
|
1941
1829
|
});
|
|
1942
|
-
return (
|
|
1830
|
+
return (M, S) => (_(), Y("div", {
|
|
1943
1831
|
class: $e([
|
|
1944
1832
|
"sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",
|
|
1945
1833
|
o.value ? "transition-[height] duration-300 ease-in-out motion-reduce:transition-none" : ""
|
|
1946
1834
|
]),
|
|
1947
|
-
style: je(
|
|
1835
|
+
style: je(u(f) ? { height: `${u(f)}px` } : void 0)
|
|
1948
1836
|
}, [
|
|
1949
|
-
|
|
1837
|
+
N("div", {
|
|
1950
1838
|
class: "sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",
|
|
1951
|
-
style: je({ transform:
|
|
1839
|
+
style: je({ transform: T.value })
|
|
1952
1840
|
}, [
|
|
1953
|
-
(
|
|
1954
|
-
key:
|
|
1841
|
+
(_(!0), Y(Te, null, Me(e.panes, (p) => (_(), Y("div", {
|
|
1842
|
+
key: p,
|
|
1955
1843
|
class: "sv-sliding-panes__pane w-full shrink-0",
|
|
1956
|
-
inert:
|
|
1844
|
+
inert: p !== e.current || void 0
|
|
1957
1845
|
}, [
|
|
1958
|
-
|
|
1846
|
+
N("div", {
|
|
1959
1847
|
ref_for: !0,
|
|
1960
|
-
ref:
|
|
1848
|
+
ref: l(p)
|
|
1961
1849
|
}, [
|
|
1962
|
-
ue(
|
|
1850
|
+
ue(M.$slots, p)
|
|
1963
1851
|
], 512)
|
|
1964
|
-
], 8,
|
|
1852
|
+
], 8, rn))), 128))
|
|
1965
1853
|
], 4)
|
|
1966
1854
|
], 6));
|
|
1967
1855
|
}
|
|
1968
|
-
}),
|
|
1856
|
+
}), It = /* @__PURE__ */ W({
|
|
1969
1857
|
inheritAttrs: !1,
|
|
1970
1858
|
__name: "OnDemandPaymentModalShell",
|
|
1971
1859
|
props: {
|
|
@@ -1980,22 +1868,24 @@ const mn = ["inert"], vn = 300, fn = "1rem", hn = /* @__PURE__ */ W({
|
|
|
1980
1868
|
addPaymentMethodPane: { type: String },
|
|
1981
1869
|
customer: { type: Object },
|
|
1982
1870
|
paymentMethodOptions: { type: Array },
|
|
1983
|
-
isPaymentMethodOptionsPending: { type: Boolean }
|
|
1871
|
+
isPaymentMethodOptionsPending: { type: Boolean },
|
|
1872
|
+
noBottomSpacing: { type: Boolean }
|
|
1984
1873
|
},
|
|
1985
1874
|
emits: ["confirm", "cancel", "payment-success", "payment-failed"],
|
|
1986
1875
|
setup(e, { expose: t }) {
|
|
1987
|
-
const o = e, n =
|
|
1876
|
+
const o = e, n = I(), a = s(() => o.panes.filter((i) => i !== o.addPaymentMethodPane));
|
|
1988
1877
|
return t({
|
|
1989
1878
|
submit: () => {
|
|
1990
1879
|
var i;
|
|
1991
1880
|
return (i = n.value) == null ? void 0 : i.submit();
|
|
1992
1881
|
},
|
|
1993
|
-
isSaving:
|
|
1882
|
+
isSaving: s(() => {
|
|
1994
1883
|
var i;
|
|
1995
1884
|
return !!((i = n.value) != null && i.isSaving);
|
|
1996
1885
|
})
|
|
1997
|
-
}), (i,
|
|
1886
|
+
}), (i, l) => (_(), E(u(ht), {
|
|
1998
1887
|
"no-click-away": "",
|
|
1888
|
+
"full-screen-on-mobile": "",
|
|
1999
1889
|
"show-modal": e.showModal,
|
|
2000
1890
|
size: "lg",
|
|
2001
1891
|
title: e.title,
|
|
@@ -2003,33 +1893,35 @@ const mn = ["inert"], vn = 300, fn = "1rem", hn = /* @__PURE__ */ W({
|
|
|
2003
1893
|
"cancel-button-text": e.cancelButtonText,
|
|
2004
1894
|
"confirm-button-text": e.confirmButtonText,
|
|
2005
1895
|
"is-loading": e.isPending,
|
|
2006
|
-
onConfirm:
|
|
2007
|
-
onClose:
|
|
1896
|
+
onConfirm: l[2] || (l[2] = (r) => i.$emit("confirm")),
|
|
1897
|
+
onClose: l[3] || (l[3] = (r) => i.$emit("cancel"))
|
|
2008
1898
|
}, re({
|
|
2009
|
-
body:
|
|
2010
|
-
|
|
2011
|
-
|
|
1899
|
+
body: g(() => [
|
|
1900
|
+
N("div", ie({
|
|
1901
|
+
class: ["grid grid-cols-1 gap-4", { "pb-4": !e.noBottomSpacing }]
|
|
1902
|
+
}, i.$attrs), [
|
|
1903
|
+
C(pn, {
|
|
2012
1904
|
panes: e.panes,
|
|
2013
1905
|
current: e.step
|
|
2014
1906
|
}, re({
|
|
2015
|
-
[e.addPaymentMethodPane]:
|
|
2016
|
-
C(
|
|
1907
|
+
[e.addPaymentMethodPane]: g(() => [
|
|
1908
|
+
C(ro, {
|
|
2017
1909
|
ref_key: "paneRef",
|
|
2018
1910
|
ref: n,
|
|
2019
1911
|
customer: e.customer,
|
|
2020
1912
|
"payment-method-options": e.paymentMethodOptions,
|
|
2021
1913
|
"is-loading": e.isPaymentMethodOptionsPending,
|
|
2022
1914
|
"is-active": e.step === e.addPaymentMethodPane,
|
|
2023
|
-
onSuccess:
|
|
2024
|
-
onFailure:
|
|
1915
|
+
onSuccess: l[0] || (l[0] = (r) => i.$emit("payment-success")),
|
|
1916
|
+
onFailure: l[1] || (l[1] = (r) => i.$emit("payment-failed", r))
|
|
2025
1917
|
}, null, 8, ["customer", "payment-method-options", "is-loading", "is-active"])
|
|
2026
1918
|
]),
|
|
2027
1919
|
_: 2
|
|
2028
1920
|
}, [
|
|
2029
|
-
Me(a.value, (
|
|
2030
|
-
name:
|
|
2031
|
-
fn:
|
|
2032
|
-
ue(i.$slots,
|
|
1921
|
+
Me(a.value, (r) => ({
|
|
1922
|
+
name: r,
|
|
1923
|
+
fn: g(() => [
|
|
1924
|
+
ue(i.$slots, r)
|
|
2033
1925
|
])
|
|
2034
1926
|
}))
|
|
2035
1927
|
]), 1032, ["panes", "current"])
|
|
@@ -2039,23 +1931,23 @@ const mn = ["inert"], vn = 300, fn = "1rem", hn = /* @__PURE__ */ W({
|
|
|
2039
1931
|
}, [
|
|
2040
1932
|
i.$slots.footer ? {
|
|
2041
1933
|
name: "footer",
|
|
2042
|
-
fn:
|
|
1934
|
+
fn: g(() => [
|
|
2043
1935
|
ue(i.$slots, "footer")
|
|
2044
1936
|
]),
|
|
2045
1937
|
key: "0"
|
|
2046
1938
|
} : void 0
|
|
2047
1939
|
]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-loading"]));
|
|
2048
1940
|
}
|
|
2049
|
-
}),
|
|
1941
|
+
}), $t = (e) => {
|
|
2050
1942
|
var t;
|
|
2051
1943
|
return (((t = e == null ? void 0 : e.wallet) == null ? void 0 : t.auto_top_up_configs) ?? []).find(
|
|
2052
1944
|
({ status: o }) => o === "ACTIVE"
|
|
2053
1945
|
);
|
|
2054
|
-
},
|
|
1946
|
+
}, Ot = (e) => e ? {
|
|
2055
1947
|
status: e.status,
|
|
2056
1948
|
threshold: e.threshold,
|
|
2057
1949
|
...e.topup_amount && { topup_amount: e.topup_amount }
|
|
2058
|
-
} : void 0,
|
|
1950
|
+
} : void 0, Bt = (e, t = []) => {
|
|
2059
1951
|
if (e != null && e.pricing_item_id && e.pricing_plan_schedule_id)
|
|
2060
1952
|
return {
|
|
2061
1953
|
pricingItemId: e.pricing_item_id,
|
|
@@ -2068,14 +1960,14 @@ const mn = ["inert"], vn = 300, fn = "1rem", hn = /* @__PURE__ */ W({
|
|
|
2068
1960
|
pricingItemId: o.pricingItemId,
|
|
2069
1961
|
pricingPlanScheduleId: o.pricingPlanScheduleId
|
|
2070
1962
|
} : void 0;
|
|
2071
|
-
},
|
|
1963
|
+
}, Dt = ({
|
|
2072
1964
|
rule: e,
|
|
2073
1965
|
walletBalanceItem: t,
|
|
2074
1966
|
chargeTarget: o,
|
|
2075
1967
|
paymentMethodId: n
|
|
2076
1968
|
}) => {
|
|
2077
|
-
var i,
|
|
2078
|
-
const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((
|
|
1969
|
+
var i, l;
|
|
1970
|
+
const a = !!(((i = e == null ? void 0 : e.threshold) == null ? void 0 : i.amount) ?? ((l = e == null ? void 0 : e.threshold) == null ? void 0 : l.credits));
|
|
2079
1971
|
if (!(!e || !a || !(t != null && t.wallet_id) || !o || !n))
|
|
2080
1972
|
return {
|
|
2081
1973
|
wallet_id: t.wallet_id,
|
|
@@ -2087,16 +1979,16 @@ const mn = ["inert"], vn = 300, fn = "1rem", hn = /* @__PURE__ */ W({
|
|
|
2087
1979
|
...e.topup_amount && { topup_amount: e.topup_amount }
|
|
2088
1980
|
};
|
|
2089
1981
|
};
|
|
2090
|
-
function
|
|
1982
|
+
function Nt({
|
|
2091
1983
|
step: e,
|
|
2092
1984
|
name: t,
|
|
2093
1985
|
returnTo: o
|
|
2094
1986
|
}) {
|
|
2095
|
-
const n =
|
|
1987
|
+
const n = I();
|
|
2096
1988
|
return {
|
|
2097
1989
|
paneRef: n,
|
|
2098
|
-
isActive:
|
|
2099
|
-
isSaving:
|
|
1990
|
+
isActive: s(() => e.value === t),
|
|
1991
|
+
isSaving: s(() => {
|
|
2100
1992
|
var a;
|
|
2101
1993
|
return !!((a = n.value) != null && a.isSaving);
|
|
2102
1994
|
}),
|
|
@@ -2112,30 +2004,30 @@ function kt({
|
|
|
2112
2004
|
}
|
|
2113
2005
|
};
|
|
2114
2006
|
}
|
|
2115
|
-
function
|
|
2116
|
-
const e =
|
|
2117
|
-
function n(
|
|
2007
|
+
function kt() {
|
|
2008
|
+
const e = tt(), t = ot(), o = ["portal", "auto-top-up-configs"];
|
|
2009
|
+
function n(r) {
|
|
2118
2010
|
return e({
|
|
2119
2011
|
url: be(t.apiUrls.config, ...o),
|
|
2120
|
-
query: { ...
|
|
2012
|
+
query: { ...r },
|
|
2121
2013
|
isCollection: !0
|
|
2122
2014
|
});
|
|
2123
2015
|
}
|
|
2124
|
-
async function a(
|
|
2016
|
+
async function a(r) {
|
|
2125
2017
|
return e({
|
|
2126
|
-
url: be(t.apiUrls.config, ...o,
|
|
2018
|
+
url: be(t.apiUrls.config, ...o, r)
|
|
2127
2019
|
});
|
|
2128
2020
|
}
|
|
2129
|
-
function i(
|
|
2021
|
+
function i(r) {
|
|
2130
2022
|
return e({
|
|
2131
2023
|
url: be(t.apiUrls.config, ...o),
|
|
2132
2024
|
options: { method: "POST" },
|
|
2133
|
-
data:
|
|
2025
|
+
data: r
|
|
2134
2026
|
});
|
|
2135
2027
|
}
|
|
2136
|
-
async function
|
|
2028
|
+
async function l(r) {
|
|
2137
2029
|
return e({
|
|
2138
|
-
url: be(t.apiUrls.config, ...o,
|
|
2030
|
+
url: be(t.apiUrls.config, ...o, r, "deactivate"),
|
|
2139
2031
|
options: { method: "POST" }
|
|
2140
2032
|
});
|
|
2141
2033
|
}
|
|
@@ -2143,11 +2035,11 @@ function Rt() {
|
|
|
2143
2035
|
getAutoTopUpConfigs: n,
|
|
2144
2036
|
getAutoTopUpConfig: a,
|
|
2145
2037
|
createAutoTopUpConfig: i,
|
|
2146
|
-
deactivateAutoTopUpConfig:
|
|
2038
|
+
deactivateAutoTopUpConfig: l
|
|
2147
2039
|
};
|
|
2148
2040
|
}
|
|
2149
|
-
function
|
|
2150
|
-
const { createAutoTopUpConfig: e } =
|
|
2041
|
+
function Rt() {
|
|
2042
|
+
const { createAutoTopUpConfig: e } = kt(), t = Ue(), o = I(!1);
|
|
2151
2043
|
return { save: async (a) => {
|
|
2152
2044
|
if (!a || o.value)
|
|
2153
2045
|
return { saved: !1 };
|
|
@@ -2166,17 +2058,17 @@ function Ft() {
|
|
|
2166
2058
|
}
|
|
2167
2059
|
}, isSaving: o };
|
|
2168
2060
|
}
|
|
2169
|
-
function
|
|
2061
|
+
function mn(e) {
|
|
2170
2062
|
var t;
|
|
2171
|
-
return
|
|
2063
|
+
return Gt(e) ? e.statusCode === 422 ? e.resourceType === "PAYMENT" ? "PAYMENT_FAILED" : "FAILED" : e.statusCode !== 400 ? "FAILED" : e.field === "payment_method_id" ? "PAYMENT_METHOD" : e.field === "pricing_plan_subscription_id" ? "SUBSCRIPTION_INACTIVE" : e.field === "pricing_items" || (t = e.field) != null && t.startsWith("pricing_items.") ? "PRICING_ITEMS" : "FAILED" : "FAILED";
|
|
2172
2064
|
}
|
|
2173
|
-
function
|
|
2065
|
+
function aa(e) {
|
|
2174
2066
|
return e === "PAYMENT_METHOD" || e === "PRICING_ITEMS" || e === "SUBSCRIPTION_INACTIVE";
|
|
2175
2067
|
}
|
|
2176
|
-
const
|
|
2068
|
+
const vn = {
|
|
2177
2069
|
key: 0,
|
|
2178
2070
|
class: "mb-4"
|
|
2179
|
-
},
|
|
2071
|
+
}, fn = { class: "sr-only" }, hn = { class: "flex flex-col gap-2" }, gn = /* @__PURE__ */ W({
|
|
2180
2072
|
__name: "TopUpModal",
|
|
2181
2073
|
props: {
|
|
2182
2074
|
showModal: { type: Boolean },
|
|
@@ -2187,24 +2079,24 @@ const _n = {
|
|
|
2187
2079
|
},
|
|
2188
2080
|
emits: ["confirm", "close", "auto-top-up-saved", "payment-success", "payment-failed"],
|
|
2189
2081
|
setup(e, { emit: t }) {
|
|
2190
|
-
const o = e, n = t, { $t: a } =
|
|
2191
|
-
() =>
|
|
2192
|
-
),
|
|
2193
|
-
() =>
|
|
2194
|
-
),
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
(
|
|
2082
|
+
const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = Ae(), l = s(
|
|
2083
|
+
() => Ot($t(o.selectedBalanceItem))
|
|
2084
|
+
), r = s(() => i(o.selectedBalanceItem)), f = s(
|
|
2085
|
+
() => Oo(o.selectedBalanceItem, o.subscriptions ?? [])
|
|
2086
|
+
), T = I();
|
|
2087
|
+
ee(
|
|
2088
|
+
f,
|
|
2089
|
+
(O) => {
|
|
2198
2090
|
var q;
|
|
2199
|
-
|
|
2200
|
-
({ id: ye }) => ye ===
|
|
2201
|
-
) || (
|
|
2091
|
+
O.some(
|
|
2092
|
+
({ id: ye }) => ye === T.value
|
|
2093
|
+
) || (T.value = (q = O[0]) == null ? void 0 : q.id);
|
|
2202
2094
|
},
|
|
2203
2095
|
{ immediate: !0 }
|
|
2204
2096
|
);
|
|
2205
|
-
const
|
|
2206
|
-
() =>
|
|
2207
|
-
value:
|
|
2097
|
+
const M = s(() => f.value.length > 1), S = s(
|
|
2098
|
+
() => f.value.map(({ id: O, name: j }, q) => ({
|
|
2099
|
+
value: O,
|
|
2208
2100
|
label: j ?? a(
|
|
2209
2101
|
{
|
|
2210
2102
|
defaultMessage: "Subscription {number}",
|
|
@@ -2214,68 +2106,68 @@ const _n = {
|
|
|
2214
2106
|
{ number: String(q + 1) }
|
|
2215
2107
|
)
|
|
2216
2108
|
}))
|
|
2217
|
-
),
|
|
2109
|
+
), p = s(
|
|
2218
2110
|
() => Object.fromEntries(
|
|
2219
|
-
|
|
2220
|
-
const q = (o.subscriptions ?? []).find(({ id: ye }) => ye ===
|
|
2221
|
-
return q ? [[
|
|
2111
|
+
f.value.flatMap(({ id: O, enabledPricingIds: j }) => {
|
|
2112
|
+
const q = (o.subscriptions ?? []).find(({ id: ye }) => ye === O);
|
|
2113
|
+
return q ? [[O, { subscription: q, enabledPricingIds: j }]] : [];
|
|
2222
2114
|
})
|
|
2223
2115
|
)
|
|
2224
|
-
),
|
|
2116
|
+
), b = s(() => {
|
|
2225
2117
|
var j;
|
|
2226
2118
|
if (!o.selectedBalanceItem || !((j = o.subscriptions) != null && j.length))
|
|
2227
2119
|
return o.selectedBalanceItem;
|
|
2228
|
-
const
|
|
2229
|
-
return
|
|
2230
|
-
}), P =
|
|
2231
|
-
paymentMethodOptions:
|
|
2232
|
-
settledOptions:
|
|
2120
|
+
const O = f.value.find(({ id: q }) => q === T.value);
|
|
2121
|
+
return O ? Bo(o.selectedBalanceItem, O.scheduleIds) : { ...o.selectedBalanceItem, charge_on_demand_pricing_items: [] };
|
|
2122
|
+
}), P = s(() => gt(b.value)), {
|
|
2123
|
+
paymentMethodOptions: x,
|
|
2124
|
+
settledOptions: w,
|
|
2233
2125
|
isPending: $
|
|
2234
|
-
} =
|
|
2235
|
-
isOpen:
|
|
2236
|
-
customer:
|
|
2237
|
-
}), h =
|
|
2238
|
-
() => !$.value && (
|
|
2239
|
-
), B =
|
|
2240
|
-
() => h.value === "TOP_UP" && !
|
|
2241
|
-
),
|
|
2126
|
+
} = ft({
|
|
2127
|
+
isOpen: s(() => o.showModal),
|
|
2128
|
+
customer: s(() => o.customer)
|
|
2129
|
+
}), h = I("TOP_UP"), c = s(() => (o.paymentMethods ?? []).length > 0), A = s(
|
|
2130
|
+
() => !$.value && (x.value ?? []).length === 0
|
|
2131
|
+
), B = s(
|
|
2132
|
+
() => h.value === "TOP_UP" && !c.value && A.value
|
|
2133
|
+
), v = I(), U = () => {
|
|
2242
2134
|
H(), n("payment-success");
|
|
2243
2135
|
}, {
|
|
2244
|
-
paneRef:
|
|
2136
|
+
paneRef: G,
|
|
2245
2137
|
isActive: te,
|
|
2246
2138
|
isSaving: ve,
|
|
2247
2139
|
open: fe,
|
|
2248
2140
|
leave: H,
|
|
2249
2141
|
submit: de
|
|
2250
|
-
} =
|
|
2142
|
+
} = Nt({ step: h, name: "ADD_PAYMENT_METHOD", returnTo: "TOP_UP" }), { save: he, isSaving: ce } = Rt();
|
|
2251
2143
|
let z = 0;
|
|
2252
|
-
const ne =
|
|
2253
|
-
var
|
|
2254
|
-
return (
|
|
2255
|
-
}), oe =
|
|
2144
|
+
const ne = I(), pe = s(() => {
|
|
2145
|
+
var O;
|
|
2146
|
+
return (O = ne.value) == null ? void 0 : O.chargedValue;
|
|
2147
|
+
}), oe = s(
|
|
2256
2148
|
() => {
|
|
2257
|
-
var
|
|
2258
|
-
return ve.value || ce.value || !!((
|
|
2149
|
+
var O;
|
|
2150
|
+
return ve.value || ce.value || !!((O = ne.value) != null && O.isCharging);
|
|
2259
2151
|
}
|
|
2260
|
-
), { title: ge, subTitle: d, cancelButtonText:
|
|
2152
|
+
), { title: ge, subTitle: d, cancelButtonText: m, confirmButtonText: y } = ln({
|
|
2261
2153
|
step: h,
|
|
2262
|
-
currentBalance:
|
|
2154
|
+
currentBalance: r,
|
|
2263
2155
|
topUpValue: pe
|
|
2264
|
-
}), D =
|
|
2156
|
+
}), D = I(), L = I(!1), ae = I(!1), _e = s(
|
|
2265
2157
|
() => ae.value ? a({
|
|
2266
2158
|
defaultMessage: "Your wallet was topped up, but we couldn't save your automatic top-up. You can set it up from your wallet.",
|
|
2267
2159
|
description: "Error shown on the top-up receipt when the automatic top-up rule set alongside it failed to save",
|
|
2268
2160
|
id: "topup_modal.success.auto_top_up_failed"
|
|
2269
2161
|
}) : void 0
|
|
2270
2162
|
), F = () => {
|
|
2271
|
-
var
|
|
2163
|
+
var O;
|
|
2272
2164
|
if (te.value) {
|
|
2273
2165
|
de();
|
|
2274
2166
|
return;
|
|
2275
2167
|
}
|
|
2276
|
-
L.value || (D.value = void 0, (
|
|
2277
|
-
},
|
|
2278
|
-
if (n("payment-failed",
|
|
2168
|
+
L.value || (D.value = void 0, (O = ne.value) == null || O.submit());
|
|
2169
|
+
}, K = (O) => {
|
|
2170
|
+
if (n("payment-failed", O), co(O)) {
|
|
2279
2171
|
L.value = !0, D.value = a({
|
|
2280
2172
|
defaultMessage: "We couldn't confirm your top-up. It may still go through, so check your wallet balance before topping up again.",
|
|
2281
2173
|
description: "Error shown in the top-up modal when charging the top-up got no clear answer, so the wallet may still have been topped up",
|
|
@@ -2283,7 +2175,7 @@ const _n = {
|
|
|
2283
2175
|
});
|
|
2284
2176
|
return;
|
|
2285
2177
|
}
|
|
2286
|
-
D.value =
|
|
2178
|
+
D.value = mn(O) === "PAYMENT_FAILED" ? a({
|
|
2287
2179
|
defaultMessage: "Your payment was declined. Try another payment method.",
|
|
2288
2180
|
description: "Error shown in the top-up modal when the payment was declined",
|
|
2289
2181
|
id: "topup_modal.error.payment_declined"
|
|
@@ -2292,31 +2184,31 @@ const _n = {
|
|
|
2292
2184
|
description: "Error shown in the top-up modal when charging the top-up failed",
|
|
2293
2185
|
id: "topup_modal.error.charge_failed"
|
|
2294
2186
|
});
|
|
2295
|
-
},
|
|
2296
|
-
rule:
|
|
2187
|
+
}, J = async ({
|
|
2188
|
+
rule: O,
|
|
2297
2189
|
paymentMethodId: j,
|
|
2298
2190
|
pricingPlanScheduleId: q
|
|
2299
2191
|
}) => {
|
|
2300
|
-
const ye = z, { saved:
|
|
2301
|
-
|
|
2302
|
-
rule:
|
|
2192
|
+
const ye = z, { saved: qt } = await he(
|
|
2193
|
+
Dt({
|
|
2194
|
+
rule: O,
|
|
2303
2195
|
walletBalanceItem: o.selectedBalanceItem,
|
|
2304
|
-
chargeTarget:
|
|
2196
|
+
chargeTarget: Bt(
|
|
2305
2197
|
void 0,
|
|
2306
2198
|
P.value.filter(
|
|
2307
|
-
(
|
|
2199
|
+
(Vt) => Vt.pricingPlanScheduleId === q
|
|
2308
2200
|
)
|
|
2309
2201
|
),
|
|
2310
2202
|
paymentMethodId: j
|
|
2311
2203
|
})
|
|
2312
2204
|
);
|
|
2313
|
-
if (
|
|
2205
|
+
if (qt) {
|
|
2314
2206
|
n("auto-top-up-saved");
|
|
2315
2207
|
return;
|
|
2316
2208
|
}
|
|
2317
2209
|
ye === z && (ae.value = !0);
|
|
2318
|
-
},
|
|
2319
|
-
|
|
2210
|
+
}, Ft = (O) => {
|
|
2211
|
+
v.value = O, h.value = "SUCCESS";
|
|
2320
2212
|
}, Le = () => {
|
|
2321
2213
|
oe.value || (n("confirm"), n("close"));
|
|
2322
2214
|
}, Ye = () => {
|
|
@@ -2331,127 +2223,127 @@ const _n = {
|
|
|
2331
2223
|
}
|
|
2332
2224
|
n("close");
|
|
2333
2225
|
}
|
|
2334
|
-
}, We =
|
|
2335
|
-
return
|
|
2226
|
+
}, We = I(0);
|
|
2227
|
+
return ee(
|
|
2336
2228
|
() => o.showModal,
|
|
2337
|
-
(
|
|
2338
|
-
|
|
2229
|
+
(O) => {
|
|
2230
|
+
O && (z += 1, h.value = "TOP_UP", v.value = void 0, D.value = void 0, L.value = !1, ae.value = !1, We.value += 1);
|
|
2339
2231
|
}
|
|
2340
|
-
), (
|
|
2232
|
+
), (O, j) => (_(), E(It, {
|
|
2341
2233
|
ref_key: "addPaymentMethodRef",
|
|
2342
|
-
ref:
|
|
2234
|
+
ref: G,
|
|
2343
2235
|
"show-modal": e.showModal,
|
|
2344
|
-
title:
|
|
2345
|
-
"sub-title":
|
|
2346
|
-
"cancel-button-text":
|
|
2347
|
-
"confirm-button-text":
|
|
2236
|
+
title: u(ge),
|
|
2237
|
+
"sub-title": u(d),
|
|
2238
|
+
"cancel-button-text": u(m),
|
|
2239
|
+
"confirm-button-text": u(y),
|
|
2348
2240
|
"is-pending": oe.value,
|
|
2349
|
-
panes:
|
|
2241
|
+
panes: u(Io),
|
|
2350
2242
|
step: h.value,
|
|
2351
2243
|
"add-payment-method-pane": "ADD_PAYMENT_METHOD",
|
|
2352
2244
|
customer: e.customer,
|
|
2353
|
-
"payment-method-options":
|
|
2354
|
-
"is-payment-method-options-pending":
|
|
2245
|
+
"payment-method-options": u(x),
|
|
2246
|
+
"is-payment-method-options-pending": u($),
|
|
2355
2247
|
onConfirm: F,
|
|
2356
2248
|
onCancel: Ye,
|
|
2357
2249
|
onPaymentSuccess: U,
|
|
2358
|
-
onPaymentFailed: j[1] || (j[1] = (q) =>
|
|
2250
|
+
onPaymentFailed: j[1] || (j[1] = (q) => O.$emit("payment-failed", q))
|
|
2359
2251
|
}, re({
|
|
2360
|
-
TOP_UP:
|
|
2361
|
-
|
|
2362
|
-
C(
|
|
2363
|
-
modelValue:
|
|
2364
|
-
"onUpdate:modelValue": j[0] || (j[0] = (q) =>
|
|
2365
|
-
class: "sv-
|
|
2252
|
+
TOP_UP: g(() => [
|
|
2253
|
+
M.value ? (_(), Y("div", vn, [
|
|
2254
|
+
C(u(lt), {
|
|
2255
|
+
modelValue: T.value,
|
|
2256
|
+
"onUpdate:modelValue": j[0] || (j[0] = (q) => T.value = q),
|
|
2257
|
+
class: "sv-top-up-modal__subscription",
|
|
2366
2258
|
name: "top-up-subscription",
|
|
2367
2259
|
direction: "column",
|
|
2368
2260
|
required: "",
|
|
2369
|
-
options:
|
|
2261
|
+
options: S.value,
|
|
2370
2262
|
"show-radio": !1,
|
|
2371
|
-
label:
|
|
2263
|
+
label: u(a)({
|
|
2372
2264
|
defaultMessage: "Subscription to top up",
|
|
2373
2265
|
description: "Label above the list of subscriptions a top-up can be charged against, in the top-up modal",
|
|
2374
2266
|
id: "topup_modal.subscriptions.label"
|
|
2375
2267
|
})
|
|
2376
2268
|
}, {
|
|
2377
|
-
prefix:
|
|
2378
|
-
|
|
2269
|
+
prefix: g(({ optionValue: q }) => [
|
|
2270
|
+
p.value[String(q)] ? (_(), E(uo, {
|
|
2379
2271
|
key: 0,
|
|
2380
|
-
class: "sv-
|
|
2272
|
+
class: "sv-top-up-modal__subscription-option grow",
|
|
2381
2273
|
"no-spacing": "",
|
|
2382
|
-
subscription:
|
|
2383
|
-
"enabled-pricing-ids":
|
|
2384
|
-
}, null, 8, ["subscription", "enabled-pricing-ids"])) :
|
|
2274
|
+
subscription: p.value[String(q)].subscription,
|
|
2275
|
+
"enabled-pricing-ids": p.value[String(q)].enabledPricingIds
|
|
2276
|
+
}, null, 8, ["subscription", "enabled-pricing-ids"])) : R("", !0)
|
|
2385
2277
|
]),
|
|
2386
|
-
label:
|
|
2387
|
-
|
|
2278
|
+
label: g(({ option: q }) => [
|
|
2279
|
+
N("span", fn, k(q.label), 1)
|
|
2388
2280
|
]),
|
|
2389
2281
|
_: 1
|
|
2390
2282
|
}, 8, ["modelValue", "options", "label"])
|
|
2391
|
-
])) :
|
|
2392
|
-
(
|
|
2283
|
+
])) : R("", !0),
|
|
2284
|
+
(_(), E(nn, {
|
|
2393
2285
|
key: We.value,
|
|
2394
2286
|
ref_key: "topUpFormRef",
|
|
2395
2287
|
ref: ne,
|
|
2396
2288
|
"top-up-pricing-items": P.value,
|
|
2397
2289
|
"payment-methods": e.paymentMethods,
|
|
2398
|
-
"auto-top-up-config":
|
|
2399
|
-
"payment-method-options":
|
|
2400
|
-
onAddPaymentMethod:
|
|
2401
|
-
onSuccess:
|
|
2402
|
-
onFailure:
|
|
2403
|
-
onSaveAutoTopUp:
|
|
2290
|
+
"auto-top-up-config": l.value,
|
|
2291
|
+
"payment-method-options": u(w),
|
|
2292
|
+
onAddPaymentMethod: u(fe),
|
|
2293
|
+
onSuccess: Ft,
|
|
2294
|
+
onFailure: K,
|
|
2295
|
+
onSaveAutoTopUp: J
|
|
2404
2296
|
}, null, 8, ["top-up-pricing-items", "payment-methods", "auto-top-up-config", "payment-method-options", "onAddPaymentMethod"])),
|
|
2405
|
-
D.value ? (
|
|
2297
|
+
D.value ? (_(), E(u(me), {
|
|
2406
2298
|
key: 1,
|
|
2407
|
-
class: "sv-
|
|
2299
|
+
class: "sv-top-up-modal__error sv-error mt-4",
|
|
2408
2300
|
title: D.value
|
|
2409
|
-
}, null, 8, ["title"])) :
|
|
2301
|
+
}, null, 8, ["title"])) : R("", !0)
|
|
2410
2302
|
]),
|
|
2411
|
-
SUCCESS:
|
|
2412
|
-
_e.value ? (
|
|
2303
|
+
SUCCESS: g(() => [
|
|
2304
|
+
_e.value ? (_(), E(u(me), {
|
|
2413
2305
|
key: 0,
|
|
2414
|
-
class: "sv-
|
|
2306
|
+
class: "sv-top-up-modal__auto-top-up-error sv-error mb-4",
|
|
2415
2307
|
title: _e.value
|
|
2416
|
-
}, null, 8, ["title"])) :
|
|
2417
|
-
|
|
2308
|
+
}, null, 8, ["title"])) : R("", !0),
|
|
2309
|
+
v.value ? (_(), E(sn, {
|
|
2418
2310
|
key: 1,
|
|
2419
|
-
invoice:
|
|
2420
|
-
}, null, 8, ["invoice"])) :
|
|
2311
|
+
invoice: v.value
|
|
2312
|
+
}, null, 8, ["invoice"])) : R("", !0)
|
|
2421
2313
|
]),
|
|
2422
2314
|
_: 2
|
|
2423
2315
|
}, [
|
|
2424
2316
|
h.value === "SUCCESS" || B.value || h.value === "TOP_UP" && L.value ? {
|
|
2425
2317
|
name: "footer",
|
|
2426
|
-
fn:
|
|
2427
|
-
|
|
2428
|
-
h.value === "SUCCESS" ? (
|
|
2318
|
+
fn: g(() => [
|
|
2319
|
+
N("div", hn, [
|
|
2320
|
+
h.value === "SUCCESS" ? (_(), E(u(se), {
|
|
2429
2321
|
key: 0,
|
|
2430
2322
|
size: "lg",
|
|
2431
2323
|
loading: oe.value,
|
|
2432
2324
|
onClick: Le
|
|
2433
2325
|
}, {
|
|
2434
|
-
default:
|
|
2435
|
-
V(
|
|
2326
|
+
default: g(() => [
|
|
2327
|
+
V(k(u(y)), 1)
|
|
2436
2328
|
]),
|
|
2437
2329
|
_: 1
|
|
2438
|
-
}, 8, ["loading"])) : (
|
|
2439
|
-
C(
|
|
2330
|
+
}, 8, ["loading"])) : (_(), Y(Te, { key: 1 }, [
|
|
2331
|
+
C(u(se), {
|
|
2440
2332
|
size: "lg",
|
|
2441
2333
|
disabled: ""
|
|
2442
2334
|
}, {
|
|
2443
|
-
default:
|
|
2444
|
-
V(
|
|
2335
|
+
default: g(() => [
|
|
2336
|
+
V(k(u(y)), 1)
|
|
2445
2337
|
]),
|
|
2446
2338
|
_: 1
|
|
2447
2339
|
}),
|
|
2448
|
-
C(
|
|
2340
|
+
C(u(se), {
|
|
2449
2341
|
size: "lg",
|
|
2450
2342
|
intent: "subtle",
|
|
2451
2343
|
onClick: Ye
|
|
2452
2344
|
}, {
|
|
2453
|
-
default:
|
|
2454
|
-
V(
|
|
2345
|
+
default: g(() => [
|
|
2346
|
+
V(k(u(m)), 1)
|
|
2455
2347
|
]),
|
|
2456
2348
|
_: 1
|
|
2457
2349
|
})
|
|
@@ -2462,7 +2354,7 @@ const _n = {
|
|
|
2462
2354
|
} : void 0
|
|
2463
2355
|
]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-pending", "panes", "step", "customer", "payment-method-options", "is-payment-method-options-pending"]));
|
|
2464
2356
|
}
|
|
2465
|
-
}),
|
|
2357
|
+
}), _n = ["AUTO_TOP_UP", "ADD_PAYMENT_METHOD"], yn = { class: "grid grid-cols-1 gap-4" }, bn = { class: "flex flex-col gap-2" }, wn = /* @__PURE__ */ W({
|
|
2466
2358
|
__name: "AutoTopUpModal",
|
|
2467
2359
|
props: {
|
|
2468
2360
|
showModal: { type: Boolean },
|
|
@@ -2473,59 +2365,59 @@ const _n = {
|
|
|
2473
2365
|
},
|
|
2474
2366
|
emits: ["saved", "close", "payment-success", "payment-failed"],
|
|
2475
2367
|
setup(e, { emit: t }) {
|
|
2476
|
-
const o = e, n = t, { $t: a } =
|
|
2477
|
-
() =>
|
|
2478
|
-
),
|
|
2368
|
+
const o = e, n = t, { $t: a } = Q(), { formatOpenBalance: i } = Ae(), l = I("AUTO_TOP_UP"), r = s(() => i(o.walletBalanceItem)), f = s(() => gt(o.walletBalanceItem)), T = s(() => Mt(f.value)), M = s(() => $t(o.walletBalanceItem)), S = s(() => Ot(M.value)), p = s(
|
|
2369
|
+
() => Bt(o.topUpItem, f.value)
|
|
2370
|
+
), b = I(), P = s(
|
|
2479
2371
|
() => {
|
|
2480
2372
|
var F;
|
|
2481
|
-
return !!
|
|
2373
|
+
return !!T.value && !!p.value && !!((F = o.walletBalanceItem) != null && F.wallet_id);
|
|
2482
2374
|
}
|
|
2483
|
-
),
|
|
2484
|
-
var
|
|
2485
|
-
const F = (
|
|
2486
|
-
return F != null && F.quantity &&
|
|
2487
|
-
}), h =
|
|
2375
|
+
), x = s(() => l.value === "AUTO_TOP_UP" && !P.value), w = I(), $ = s(() => {
|
|
2376
|
+
var K, J;
|
|
2377
|
+
const F = (J = (K = b.value) == null ? void 0 : K.rule) == null ? void 0 : J.topup_amount;
|
|
2378
|
+
return F != null && F.quantity && p.value ? [{ pricing_item_id: p.value.pricingItemId, flexible_amount: F }] : void 0;
|
|
2379
|
+
}), h = s(() => {
|
|
2488
2380
|
var F;
|
|
2489
|
-
return (F =
|
|
2490
|
-
}),
|
|
2491
|
-
paymentMethods:
|
|
2492
|
-
selectedPaymentMethodId:
|
|
2493
|
-
preferredPaymentMethodId:
|
|
2381
|
+
return (F = p.value) == null ? void 0 : F.pricingPlanScheduleId;
|
|
2382
|
+
}), c = I(), { sortedPaymentMethods: A } = vt({
|
|
2383
|
+
paymentMethods: s(() => o.paymentMethods),
|
|
2384
|
+
selectedPaymentMethodId: c,
|
|
2385
|
+
preferredPaymentMethodId: s(() => {
|
|
2494
2386
|
var F;
|
|
2495
|
-
return (F =
|
|
2387
|
+
return (F = M.value) == null ? void 0 : F.payment_method_id;
|
|
2496
2388
|
})
|
|
2497
2389
|
}), {
|
|
2498
2390
|
paymentMethodOptions: B,
|
|
2499
|
-
settledOptions:
|
|
2391
|
+
settledOptions: v,
|
|
2500
2392
|
isPending: U
|
|
2501
|
-
} =
|
|
2502
|
-
isOpen:
|
|
2503
|
-
customer:
|
|
2393
|
+
} = ft({
|
|
2394
|
+
isOpen: s(() => o.showModal),
|
|
2395
|
+
customer: s(() => o.customer)
|
|
2504
2396
|
}), {
|
|
2505
|
-
paneRef:
|
|
2397
|
+
paneRef: G,
|
|
2506
2398
|
isActive: te,
|
|
2507
2399
|
isSaving: ve,
|
|
2508
2400
|
open: fe,
|
|
2509
2401
|
leave: H,
|
|
2510
2402
|
submit: de
|
|
2511
|
-
} =
|
|
2512
|
-
paymentMethodId:
|
|
2403
|
+
} = Nt({ step: l, name: "ADD_PAYMENT_METHOD", returnTo: "AUTO_TOP_UP" }), { save: he, isSaving: ce } = Rt(), z = s(() => ve.value || ce.value), ne = Oe({
|
|
2404
|
+
paymentMethodId: s(() => c.value ?? null)
|
|
2513
2405
|
}), pe = De(
|
|
2514
2406
|
{
|
|
2515
2407
|
paymentMethodId: {
|
|
2516
|
-
required:
|
|
2408
|
+
required: X.withMessage(
|
|
2517
2409
|
() => a({
|
|
2518
2410
|
defaultMessage: "Select a payment method to pay for automatic top-ups.",
|
|
2519
2411
|
description: "Error shown in the auto top-up modal when no payment method is selected",
|
|
2520
2412
|
id: "auto_topup_modal.payment_method.required"
|
|
2521
2413
|
}),
|
|
2522
|
-
|
|
2414
|
+
rt
|
|
2523
2415
|
)
|
|
2524
2416
|
}
|
|
2525
2417
|
},
|
|
2526
2418
|
ne
|
|
2527
|
-
), oe =
|
|
2528
|
-
() =>
|
|
2419
|
+
), oe = s(
|
|
2420
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2529
2421
|
defaultMessage: "Add payment method",
|
|
2530
2422
|
description: "Title of the auto top-up modal while the customer is adding a payment method",
|
|
2531
2423
|
id: "auto_topup_modal.add_payment_method.title"
|
|
@@ -2534,8 +2426,8 @@ const _n = {
|
|
|
2534
2426
|
description: "Title of the automatic wallet top-up modal",
|
|
2535
2427
|
id: "auto_topup_modal.title"
|
|
2536
2428
|
})
|
|
2537
|
-
), ge =
|
|
2538
|
-
() =>
|
|
2429
|
+
), ge = s(
|
|
2430
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2539
2431
|
defaultMessage: "This method pays for every automatic top-up.",
|
|
2540
2432
|
description: "Subtitle of the auto top-up modal while the customer is adding a payment method",
|
|
2541
2433
|
id: "auto_topup_modal.add_payment_method.subtitle"
|
|
@@ -2545,10 +2437,10 @@ const _n = {
|
|
|
2545
2437
|
description: "Subtitle of the automatic wallet top-up modal, naming the balance",
|
|
2546
2438
|
id: "auto_topup_modal.subtitle"
|
|
2547
2439
|
},
|
|
2548
|
-
{ balance:
|
|
2440
|
+
{ balance: r.value }
|
|
2549
2441
|
)
|
|
2550
|
-
), d =
|
|
2551
|
-
() =>
|
|
2442
|
+
), d = s(
|
|
2443
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2552
2444
|
defaultMessage: "Back",
|
|
2553
2445
|
description: "Button returning from adding a payment method to the auto top-up rule",
|
|
2554
2446
|
id: "auto_topup_modal.add_payment_method.cancel"
|
|
@@ -2557,8 +2449,8 @@ const _n = {
|
|
|
2557
2449
|
description: "Button dismissing the auto top-up modal",
|
|
2558
2450
|
id: "auto_topup_modal.cancel"
|
|
2559
2451
|
})
|
|
2560
|
-
),
|
|
2561
|
-
() =>
|
|
2452
|
+
), m = s(
|
|
2453
|
+
() => l.value === "ADD_PAYMENT_METHOD" ? a({
|
|
2562
2454
|
defaultMessage: "Add payment method",
|
|
2563
2455
|
description: "Button storing the payment method being added in the auto top-up modal",
|
|
2564
2456
|
id: "auto_topup_modal.add_payment_method.confirm"
|
|
@@ -2568,35 +2460,35 @@ const _n = {
|
|
|
2568
2460
|
id: "auto_topup_modal.confirm"
|
|
2569
2461
|
})
|
|
2570
2462
|
);
|
|
2571
|
-
async function
|
|
2572
|
-
var
|
|
2463
|
+
async function y() {
|
|
2464
|
+
var J;
|
|
2573
2465
|
if (pe.value.$touch(), z.value || !P.value)
|
|
2574
2466
|
return;
|
|
2575
|
-
|
|
2576
|
-
const { saved: F, error:
|
|
2577
|
-
|
|
2578
|
-
rule: (
|
|
2467
|
+
w.value = void 0;
|
|
2468
|
+
const { saved: F, error: K } = await he(
|
|
2469
|
+
Dt({
|
|
2470
|
+
rule: (J = b.value) == null ? void 0 : J.validate(),
|
|
2579
2471
|
walletBalanceItem: o.walletBalanceItem,
|
|
2580
|
-
chargeTarget:
|
|
2581
|
-
paymentMethodId:
|
|
2472
|
+
chargeTarget: p.value,
|
|
2473
|
+
paymentMethodId: c.value
|
|
2582
2474
|
})
|
|
2583
2475
|
);
|
|
2584
2476
|
if (F) {
|
|
2585
2477
|
n("saved"), n("close");
|
|
2586
2478
|
return;
|
|
2587
2479
|
}
|
|
2588
|
-
|
|
2480
|
+
K && (w.value = a({
|
|
2589
2481
|
defaultMessage: "We couldn't save your automatic top-up. Please try again.",
|
|
2590
2482
|
description: "Error shown in the auto top-up modal when saving the rule failed",
|
|
2591
2483
|
id: "auto_topup_modal.save_failed"
|
|
2592
|
-
}), n("payment-failed",
|
|
2484
|
+
}), n("payment-failed", K));
|
|
2593
2485
|
}
|
|
2594
2486
|
const D = () => {
|
|
2595
2487
|
if (te.value) {
|
|
2596
2488
|
de();
|
|
2597
2489
|
return;
|
|
2598
2490
|
}
|
|
2599
|
-
|
|
2491
|
+
y();
|
|
2600
2492
|
}, L = () => {
|
|
2601
2493
|
H(), n("payment-success");
|
|
2602
2494
|
}, ae = () => {
|
|
@@ -2607,102 +2499,102 @@ const _n = {
|
|
|
2607
2499
|
}
|
|
2608
2500
|
n("close");
|
|
2609
2501
|
}
|
|
2610
|
-
}, _e =
|
|
2611
|
-
return
|
|
2502
|
+
}, _e = I(0);
|
|
2503
|
+
return ee(
|
|
2612
2504
|
() => o.showModal,
|
|
2613
2505
|
(F) => {
|
|
2614
|
-
F && (
|
|
2506
|
+
F && (l.value = "AUTO_TOP_UP", c.value = void 0, w.value = void 0, _e.value += 1);
|
|
2615
2507
|
}
|
|
2616
|
-
), (F,
|
|
2508
|
+
), (F, K) => (_(), E(It, {
|
|
2617
2509
|
ref_key: "addPaymentMethodRef",
|
|
2618
|
-
ref:
|
|
2510
|
+
ref: G,
|
|
2619
2511
|
"show-modal": e.showModal,
|
|
2620
2512
|
title: oe.value,
|
|
2621
2513
|
"sub-title": ge.value,
|
|
2622
2514
|
"cancel-button-text": d.value,
|
|
2623
|
-
"confirm-button-text":
|
|
2515
|
+
"confirm-button-text": m.value,
|
|
2624
2516
|
"is-pending": z.value,
|
|
2625
|
-
panes:
|
|
2626
|
-
step:
|
|
2517
|
+
panes: u(_n),
|
|
2518
|
+
step: l.value,
|
|
2627
2519
|
"add-payment-method-pane": "ADD_PAYMENT_METHOD",
|
|
2628
2520
|
customer: e.customer,
|
|
2629
|
-
"payment-method-options":
|
|
2630
|
-
"is-payment-method-options-pending":
|
|
2521
|
+
"payment-method-options": u(B),
|
|
2522
|
+
"is-payment-method-options-pending": u(U),
|
|
2631
2523
|
onConfirm: D,
|
|
2632
2524
|
onCancel: ae,
|
|
2633
2525
|
onPaymentSuccess: L,
|
|
2634
|
-
onPaymentFailed:
|
|
2526
|
+
onPaymentFailed: K[1] || (K[1] = (J) => F.$emit("payment-failed", J))
|
|
2635
2527
|
}, re({
|
|
2636
|
-
AUTO_TOP_UP:
|
|
2637
|
-
|
|
2638
|
-
P.value ?
|
|
2528
|
+
AUTO_TOP_UP: g(() => [
|
|
2529
|
+
N("div", yn, [
|
|
2530
|
+
P.value ? R("", !0) : (_(), E(u(po), {
|
|
2639
2531
|
key: 0,
|
|
2640
2532
|
type: "warning",
|
|
2641
2533
|
class: "sv-auto-topup-modal__unavailable",
|
|
2642
|
-
title:
|
|
2534
|
+
title: u(a)({
|
|
2643
2535
|
defaultMessage: "Automatic top-up is not available for this wallet.",
|
|
2644
2536
|
description: "Shown in the auto top-up modal when the wallet has nothing an automatic top-up could charge",
|
|
2645
2537
|
id: "auto_topup_modal.unavailable"
|
|
2646
2538
|
})
|
|
2647
2539
|
}, null, 8, ["title"])),
|
|
2648
|
-
|
|
2540
|
+
T.value ? (_(), E(xt, ie({
|
|
2649
2541
|
key: _e.value,
|
|
2650
2542
|
ref_key: "autoTopUpFormRef",
|
|
2651
|
-
ref:
|
|
2543
|
+
ref: b,
|
|
2652
2544
|
class: "sv-auto-topup-modal__rule"
|
|
2653
|
-
},
|
|
2654
|
-
config:
|
|
2545
|
+
}, T.value, {
|
|
2546
|
+
config: S.value,
|
|
2655
2547
|
"always-enabled": "",
|
|
2656
2548
|
disabled: z.value
|
|
2657
|
-
}), null, 16, ["config", "disabled"])) :
|
|
2658
|
-
C(
|
|
2549
|
+
}), null, 16, ["config", "disabled"])) : R("", !0),
|
|
2550
|
+
C(Ut, {
|
|
2659
2551
|
"pricing-plan-schedule-id": h.value,
|
|
2660
2552
|
"pricing-items": $.value
|
|
2661
2553
|
}, null, 8, ["pricing-plan-schedule-id", "pricing-items"]),
|
|
2662
|
-
C(
|
|
2663
|
-
modelValue:
|
|
2664
|
-
"onUpdate:modelValue":
|
|
2554
|
+
C(mt, {
|
|
2555
|
+
modelValue: c.value,
|
|
2556
|
+
"onUpdate:modelValue": K[0] || (K[0] = (J) => c.value = J),
|
|
2665
2557
|
class: "sv-auto-topup-modal__payment-method",
|
|
2666
|
-
"payment-methods":
|
|
2667
|
-
"payment-method-options":
|
|
2558
|
+
"payment-methods": u(A),
|
|
2559
|
+
"payment-method-options": u(v),
|
|
2668
2560
|
disabled: z.value,
|
|
2669
|
-
error:
|
|
2670
|
-
label:
|
|
2561
|
+
error: u(pe).paymentMethodId.$errors,
|
|
2562
|
+
label: u(a)({
|
|
2671
2563
|
defaultMessage: "Pay automatic top-ups with",
|
|
2672
2564
|
description: "Label above the payment method an automatic top-up is charged to",
|
|
2673
2565
|
id: "auto_topup_modal.payment_method.label"
|
|
2674
2566
|
}),
|
|
2675
|
-
onAddPaymentMethod:
|
|
2567
|
+
onAddPaymentMethod: u(fe)
|
|
2676
2568
|
}, null, 8, ["modelValue", "payment-methods", "payment-method-options", "disabled", "error", "label", "onAddPaymentMethod"]),
|
|
2677
|
-
|
|
2569
|
+
w.value ? (_(), E(u(me), {
|
|
2678
2570
|
key: 2,
|
|
2679
2571
|
class: "sv-auto-topup-modal__error sv-error",
|
|
2680
|
-
title:
|
|
2681
|
-
}, null, 8, ["title"])) :
|
|
2572
|
+
title: w.value
|
|
2573
|
+
}, null, 8, ["title"])) : R("", !0)
|
|
2682
2574
|
])
|
|
2683
2575
|
]),
|
|
2684
2576
|
_: 2
|
|
2685
2577
|
}, [
|
|
2686
|
-
|
|
2578
|
+
x.value ? {
|
|
2687
2579
|
name: "footer",
|
|
2688
|
-
fn:
|
|
2689
|
-
|
|
2690
|
-
C(
|
|
2580
|
+
fn: g(() => [
|
|
2581
|
+
N("div", bn, [
|
|
2582
|
+
C(u(se), {
|
|
2691
2583
|
size: "lg",
|
|
2692
2584
|
disabled: ""
|
|
2693
2585
|
}, {
|
|
2694
|
-
default:
|
|
2695
|
-
V(
|
|
2586
|
+
default: g(() => [
|
|
2587
|
+
V(k(m.value), 1)
|
|
2696
2588
|
]),
|
|
2697
2589
|
_: 1
|
|
2698
2590
|
}),
|
|
2699
|
-
C(
|
|
2591
|
+
C(u(se), {
|
|
2700
2592
|
size: "lg",
|
|
2701
2593
|
intent: "subtle",
|
|
2702
2594
|
onClick: ae
|
|
2703
2595
|
}, {
|
|
2704
|
-
default:
|
|
2705
|
-
V(
|
|
2596
|
+
default: g(() => [
|
|
2597
|
+
V(k(d.value), 1)
|
|
2706
2598
|
]),
|
|
2707
2599
|
_: 1
|
|
2708
2600
|
})
|
|
@@ -2713,8 +2605,8 @@ const _n = {
|
|
|
2713
2605
|
]), 1032, ["show-modal", "title", "sub-title", "cancel-button-text", "confirm-button-text", "is-pending", "panes", "step", "customer", "payment-method-options", "is-payment-method-options-pending"]));
|
|
2714
2606
|
}
|
|
2715
2607
|
});
|
|
2716
|
-
function
|
|
2717
|
-
const { deactivateAutoTopUpConfig: e } =
|
|
2608
|
+
function Tn() {
|
|
2609
|
+
const { deactivateAutoTopUpConfig: e } = kt(), t = Ue(), o = I(!1);
|
|
2718
2610
|
return { deactivate: async (a) => {
|
|
2719
2611
|
if (!a || o.value)
|
|
2720
2612
|
return !1;
|
|
@@ -2733,7 +2625,7 @@ function Sn() {
|
|
|
2733
2625
|
}
|
|
2734
2626
|
}, isDeactivating: o };
|
|
2735
2627
|
}
|
|
2736
|
-
const
|
|
2628
|
+
const Mn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3" }, Un = /* @__PURE__ */ W({
|
|
2737
2629
|
__name: "AutoTopUpCancellationModal",
|
|
2738
2630
|
props: {
|
|
2739
2631
|
showModal: { type: Boolean },
|
|
@@ -2741,100 +2633,101 @@ const Pn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2741
2633
|
},
|
|
2742
2634
|
emits: ["confirmed", "close"],
|
|
2743
2635
|
setup(e, { emit: t }) {
|
|
2744
|
-
const o = e, n = t, { $t: a } =
|
|
2745
|
-
|
|
2636
|
+
const o = e, n = t, { $t: a } = Q(), { formatValue: i } = Ae(), { deactivate: l, isDeactivating: r } = Tn(), f = I(!1);
|
|
2637
|
+
ee(
|
|
2746
2638
|
() => o.showModal,
|
|
2747
|
-
(
|
|
2748
|
-
|
|
2639
|
+
(p) => {
|
|
2640
|
+
p && (f.value = !1);
|
|
2749
2641
|
}
|
|
2750
2642
|
);
|
|
2751
|
-
const
|
|
2752
|
-
var P,
|
|
2753
|
-
const
|
|
2754
|
-
return !(
|
|
2643
|
+
const T = s(() => {
|
|
2644
|
+
var P, x;
|
|
2645
|
+
const p = (P = o.config) == null ? void 0 : P.threshold, b = (x = o.config) == null ? void 0 : x.topup_amount;
|
|
2646
|
+
return !(p != null && p.amount) && !(p != null && p.credits) ? a({
|
|
2755
2647
|
defaultMessage: "Your balance will no longer be topped up automatically. You can still top up whenever you want to.",
|
|
2756
2648
|
description: "Explanation in the modal that turns a wallet automatic top-up off",
|
|
2757
2649
|
id: "auto_topup_cancellation_modal.explanation"
|
|
2758
|
-
}) :
|
|
2650
|
+
}) : b ? a(
|
|
2759
2651
|
{
|
|
2760
2652
|
defaultMessage: "Your balance will no longer be topped up with {amount} when it falls below {threshold}. You can still top up whenever you want to.",
|
|
2761
2653
|
description: "Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",
|
|
2762
2654
|
id: "auto_topup_cancellation_modal.explanation_with_amount"
|
|
2763
2655
|
},
|
|
2764
|
-
{ amount: i({ amount:
|
|
2656
|
+
{ amount: i({ amount: b }), threshold: i(p) }
|
|
2765
2657
|
) : a(
|
|
2766
2658
|
{
|
|
2767
2659
|
defaultMessage: "Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",
|
|
2768
2660
|
description: "Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",
|
|
2769
2661
|
id: "auto_topup_cancellation_modal.explanation_with_threshold"
|
|
2770
2662
|
},
|
|
2771
|
-
{ threshold: i(
|
|
2663
|
+
{ threshold: i(p) }
|
|
2772
2664
|
);
|
|
2773
|
-
}),
|
|
2774
|
-
var
|
|
2775
|
-
const
|
|
2776
|
-
if (!(!
|
|
2777
|
-
if (
|
|
2778
|
-
|
|
2665
|
+
}), M = async () => {
|
|
2666
|
+
var b;
|
|
2667
|
+
const p = (b = o.config) == null ? void 0 : b.id;
|
|
2668
|
+
if (!(!p || r.value)) {
|
|
2669
|
+
if (f.value = !1, !await l(p)) {
|
|
2670
|
+
f.value = !0;
|
|
2779
2671
|
return;
|
|
2780
2672
|
}
|
|
2781
2673
|
n("confirmed"), n("close");
|
|
2782
2674
|
}
|
|
2783
|
-
},
|
|
2784
|
-
|
|
2675
|
+
}, S = () => {
|
|
2676
|
+
r.value || n("close");
|
|
2785
2677
|
};
|
|
2786
|
-
return (
|
|
2678
|
+
return (p, b) => (_(), E(u(ht), {
|
|
2679
|
+
"full-screen-on-mobile": "",
|
|
2787
2680
|
size: "sm",
|
|
2788
2681
|
"show-modal": e.showModal,
|
|
2789
|
-
"is-loading": r
|
|
2790
|
-
"no-click-away": r
|
|
2791
|
-
"no-backdrop-close": r
|
|
2792
|
-
title:
|
|
2682
|
+
"is-loading": u(r),
|
|
2683
|
+
"no-click-away": u(r),
|
|
2684
|
+
"no-backdrop-close": u(r),
|
|
2685
|
+
title: u(a)({
|
|
2793
2686
|
defaultMessage: "Turn off automatic top-up",
|
|
2794
2687
|
description: "Title of the modal that turns a wallet automatic top-up off",
|
|
2795
2688
|
id: "auto_topup_cancellation_modal.title"
|
|
2796
2689
|
}),
|
|
2797
|
-
"confirm-button-text":
|
|
2690
|
+
"confirm-button-text": u(a)({
|
|
2798
2691
|
defaultMessage: "Yes, turn it off",
|
|
2799
2692
|
description: "Button confirming that a wallet automatic top-up is turned off",
|
|
2800
2693
|
id: "auto_topup_cancellation_modal.confirm"
|
|
2801
2694
|
}),
|
|
2802
|
-
"cancel-button-text":
|
|
2695
|
+
"cancel-button-text": u(a)({
|
|
2803
2696
|
defaultMessage: "Cancel",
|
|
2804
2697
|
description: "Button dismissing the modal that turns a wallet automatic top-up off",
|
|
2805
2698
|
id: "auto_topup_cancellation_modal.cancel"
|
|
2806
2699
|
}),
|
|
2807
|
-
onConfirm:
|
|
2808
|
-
onClose:
|
|
2700
|
+
onConfirm: M,
|
|
2701
|
+
onClose: S
|
|
2809
2702
|
}, {
|
|
2810
|
-
body:
|
|
2811
|
-
|
|
2812
|
-
C(
|
|
2703
|
+
body: g(() => [
|
|
2704
|
+
N("div", Mn, [
|
|
2705
|
+
C(u(Z), {
|
|
2813
2706
|
variant: "body-sm",
|
|
2814
2707
|
color: "subtle",
|
|
2815
2708
|
tag: "p",
|
|
2816
2709
|
class: "sv-auto-topup-cancellation-modal__explanation"
|
|
2817
2710
|
}, {
|
|
2818
|
-
default:
|
|
2819
|
-
V(
|
|
2711
|
+
default: g(() => [
|
|
2712
|
+
V(k(T.value), 1)
|
|
2820
2713
|
]),
|
|
2821
2714
|
_: 1
|
|
2822
2715
|
}),
|
|
2823
|
-
|
|
2716
|
+
f.value ? (_(), E(u(me), {
|
|
2824
2717
|
key: 0,
|
|
2825
2718
|
class: "sv-auto-topup-cancellation-modal__error sv-error",
|
|
2826
|
-
title:
|
|
2719
|
+
title: u(a)({
|
|
2827
2720
|
defaultMessage: "Could not turn off the automatic top-up. Please try again later.",
|
|
2828
2721
|
description: "Error shown when turning a wallet automatic top-up off failed",
|
|
2829
2722
|
id: "auto_topup_cancellation_modal.failed"
|
|
2830
2723
|
})
|
|
2831
|
-
}, null, 8, ["title"])) :
|
|
2724
|
+
}, null, 8, ["title"])) : R("", !0)
|
|
2832
2725
|
])
|
|
2833
2726
|
]),
|
|
2834
2727
|
_: 1
|
|
2835
2728
|
}, 8, ["show-modal", "is-loading", "no-click-away", "no-backdrop-close", "title", "confirm-button-text", "cancel-button-text"]));
|
|
2836
2729
|
}
|
|
2837
|
-
}),
|
|
2730
|
+
}), ia = /* @__PURE__ */ W({
|
|
2838
2731
|
inheritAttrs: !1,
|
|
2839
2732
|
__name: "CustomerWalletBalances",
|
|
2840
2733
|
props: {
|
|
@@ -2848,35 +2741,35 @@ const Pn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2848
2741
|
},
|
|
2849
2742
|
emits: ["top-up-charged", "auto-top-up-saved", "auto-top-up-cancelled", "payment-method-stored", "payment-failed"],
|
|
2850
2743
|
setup(e, { emit: t }) {
|
|
2851
|
-
const o = e, n = t, { $t: a } =
|
|
2852
|
-
() =>
|
|
2853
|
-
),
|
|
2744
|
+
const o = e, n = t, { $t: a } = Q(), i = s(
|
|
2745
|
+
() => xo(o.walletBalances, o.subscriptions)
|
|
2746
|
+
), l = s(
|
|
2854
2747
|
() => {
|
|
2855
|
-
var
|
|
2856
|
-
return (
|
|
2748
|
+
var x;
|
|
2749
|
+
return (x = o.paymentMethods) == null ? void 0 : x.filter((w) => mo(w));
|
|
2857
2750
|
}
|
|
2858
|
-
),
|
|
2859
|
-
() => Qe(i.value,
|
|
2860
|
-
),
|
|
2861
|
-
() => Qe(i.value,
|
|
2862
|
-
),
|
|
2863
|
-
return (
|
|
2864
|
-
e.isLoading ? (
|
|
2751
|
+
), r = I(), f = s(
|
|
2752
|
+
() => Qe(i.value, r.value)
|
|
2753
|
+
), T = s(() => !!f.value), M = I(), S = s(() => !!M.value), p = s(
|
|
2754
|
+
() => Qe(i.value, M.value)
|
|
2755
|
+
), b = I(), P = s(() => !!b.value);
|
|
2756
|
+
return (x, w) => (_(), Y(Te, null, [
|
|
2757
|
+
e.isLoading ? (_(), E(st, ie({
|
|
2865
2758
|
key: 0,
|
|
2866
2759
|
variant: "section"
|
|
2867
|
-
},
|
|
2760
|
+
}, x.$attrs, { class: "sv-wallet-balances sv-root sv-component sv-loading min-h-48" }), null, 16)) : e.hasError ? (_(), E(u(me), ie({ key: 1 }, x.$attrs, {
|
|
2868
2761
|
class: "sv-wallet-balances sv-root sv-component sv-error",
|
|
2869
|
-
title:
|
|
2762
|
+
title: u(a)({
|
|
2870
2763
|
defaultMessage: "Could not load wallet balances",
|
|
2871
2764
|
description: "Error shown when wallet balances fail to load",
|
|
2872
2765
|
id: "wallet_balance.load_failed"
|
|
2873
2766
|
})
|
|
2874
|
-
}), null, 16, ["title"])) : e.walletBalances.length > 0 ? (
|
|
2767
|
+
}), null, 16, ["title"])) : e.walletBalances.length > 0 ? (_(), E(u(Co), ie({ key: 2 }, x.$attrs, {
|
|
2875
2768
|
class: "sv-wallet-balances sv-root sv-component",
|
|
2876
2769
|
"customer-wallet-balances": i.value,
|
|
2877
2770
|
"show-auto-top-up": e.showTopUpButton,
|
|
2878
2771
|
"show-manual-top-up": e.showTopUpButton,
|
|
2879
|
-
title:
|
|
2772
|
+
title: u(a)(
|
|
2880
2773
|
{
|
|
2881
2774
|
defaultMessage: "{count, plural, one {Wallet} other {Wallets}}",
|
|
2882
2775
|
description: "Title for the wallets block on the customer overview page",
|
|
@@ -2884,53 +2777,52 @@ const Pn = { class: "sv-auto-topup-cancellation-modal sv-auto-topup-cancellation
|
|
|
2884
2777
|
},
|
|
2885
2778
|
{ count: String(e.walletBalances.length) }
|
|
2886
2779
|
),
|
|
2887
|
-
onTopUp:
|
|
2888
|
-
onAutoTopUp:
|
|
2889
|
-
onCancelAutoTopUp:
|
|
2890
|
-
}), null, 16, ["customer-wallet-balances", "show-auto-top-up", "show-manual-top-up", "title"])) :
|
|
2891
|
-
e.showTopUpButton ? (
|
|
2780
|
+
onTopUp: w[0] || (w[0] = ($) => r.value = $),
|
|
2781
|
+
onAutoTopUp: w[1] || (w[1] = ($) => M.value = $),
|
|
2782
|
+
onCancelAutoTopUp: w[2] || (w[2] = ($) => b.value = $)
|
|
2783
|
+
}), null, 16, ["customer-wallet-balances", "show-auto-top-up", "show-manual-top-up", "title"])) : R("", !0),
|
|
2784
|
+
e.showTopUpButton ? (_(), E(gn, {
|
|
2892
2785
|
key: 3,
|
|
2893
|
-
"show-modal":
|
|
2894
|
-
"selected-balance-item":
|
|
2895
|
-
"payment-methods":
|
|
2786
|
+
"show-modal": T.value,
|
|
2787
|
+
"selected-balance-item": f.value,
|
|
2788
|
+
"payment-methods": l.value,
|
|
2896
2789
|
customer: e.customer,
|
|
2897
2790
|
subscriptions: e.subscriptions,
|
|
2898
|
-
onClose:
|
|
2899
|
-
onConfirm:
|
|
2900
|
-
onAutoTopUpSaved:
|
|
2901
|
-
onPaymentSuccess:
|
|
2902
|
-
onPaymentFailed:
|
|
2903
|
-
}, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) :
|
|
2904
|
-
e.showTopUpButton ? (
|
|
2791
|
+
onClose: w[3] || (w[3] = ($) => r.value = void 0),
|
|
2792
|
+
onConfirm: w[4] || (w[4] = ($) => n("top-up-charged")),
|
|
2793
|
+
onAutoTopUpSaved: w[5] || (w[5] = ($) => n("auto-top-up-saved")),
|
|
2794
|
+
onPaymentSuccess: w[6] || (w[6] = ($) => n("payment-method-stored")),
|
|
2795
|
+
onPaymentFailed: w[7] || (w[7] = ($) => n("payment-failed", $))
|
|
2796
|
+
}, null, 8, ["show-modal", "selected-balance-item", "payment-methods", "customer", "subscriptions"])) : R("", !0),
|
|
2797
|
+
e.showTopUpButton ? (_(), E(wn, {
|
|
2905
2798
|
key: 4,
|
|
2906
|
-
"show-modal":
|
|
2907
|
-
"wallet-balance-item":
|
|
2908
|
-
"top-up-item":
|
|
2909
|
-
"payment-methods":
|
|
2799
|
+
"show-modal": S.value,
|
|
2800
|
+
"wallet-balance-item": p.value,
|
|
2801
|
+
"top-up-item": M.value,
|
|
2802
|
+
"payment-methods": l.value,
|
|
2910
2803
|
customer: e.customer,
|
|
2911
|
-
onClose:
|
|
2912
|
-
onSaved:
|
|
2913
|
-
onPaymentSuccess:
|
|
2914
|
-
onPaymentFailed:
|
|
2915
|
-
}, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) :
|
|
2916
|
-
e.showTopUpButton ? (
|
|
2804
|
+
onClose: w[8] || (w[8] = ($) => M.value = void 0),
|
|
2805
|
+
onSaved: w[9] || (w[9] = ($) => n("auto-top-up-saved")),
|
|
2806
|
+
onPaymentSuccess: w[10] || (w[10] = ($) => n("payment-method-stored")),
|
|
2807
|
+
onPaymentFailed: w[11] || (w[11] = ($) => n("payment-failed", $))
|
|
2808
|
+
}, null, 8, ["show-modal", "wallet-balance-item", "top-up-item", "payment-methods", "customer"])) : R("", !0),
|
|
2809
|
+
e.showTopUpButton ? (_(), E(Un, {
|
|
2917
2810
|
key: 5,
|
|
2918
2811
|
"show-modal": P.value,
|
|
2919
|
-
config:
|
|
2920
|
-
onClose:
|
|
2921
|
-
onConfirmed:
|
|
2922
|
-
}, null, 8, ["show-modal", "config"])) :
|
|
2812
|
+
config: b.value,
|
|
2813
|
+
onClose: w[12] || (w[12] = ($) => b.value = void 0),
|
|
2814
|
+
onConfirmed: w[13] || (w[13] = ($) => n("auto-top-up-cancelled"))
|
|
2815
|
+
}, null, 8, ["show-modal", "config"])) : R("", !0)
|
|
2923
2816
|
], 64));
|
|
2924
2817
|
}
|
|
2925
2818
|
});
|
|
2926
2819
|
export {
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
aa as u
|
|
2820
|
+
pn as _,
|
|
2821
|
+
It as a,
|
|
2822
|
+
ia as b,
|
|
2823
|
+
na as c,
|
|
2824
|
+
zo as d,
|
|
2825
|
+
mn as g,
|
|
2826
|
+
aa as i,
|
|
2827
|
+
Nt as u
|
|
2936
2828
|
};
|