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