@solvimon/solvimon-web 0.1.0-alpha.26 → 0.1.0-alpha.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -10
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DwbIiJBY.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-081H9T3X.js} +1 -1
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DcrLNA_x.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DNepCMRp.mjs} +6 -6
- package/dist/{Avatar.vue.es-Bm6MCMAL.js → Avatar.vue.es-BJxSCU76.js} +1 -1
- package/dist/{Avatar.vue.es-BqQHvLGA.mjs → Avatar.vue.es-sfMZiX7A.mjs} +1 -1
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-BV5iEOxn.js +1 -0
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BFza7Nf9.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-DmY3a-Wi.mjs} +14 -15
- package/dist/{Button.vue.es-qGvnOKnK.js → Button.vue.es-BzkuglKw.js} +1 -1
- package/dist/{Button.vue.es-C32_baQN.mjs → Button.vue.es-Cmjfm4jw.mjs} +1 -1
- package/dist/{ChargeOnDemandModal-CIiI74ls.mjs → ChargeOnDemandModal-CB4mrvkU.mjs} +145 -153
- package/dist/{ChargeOnDemandModal-DIQaGnRs.js → ChargeOnDemandModal-b17YswWA.js} +1 -1
- package/dist/Checkout.entry.ce-HlUrJ1kh.js +2 -0
- package/dist/Checkout.entry.ce-X2zGo6hG.mjs +4381 -0
- package/dist/{Chip.vue.es-D60gTbfe.js → Chip.vue.es-B2jjzIOc.js} +1 -1
- package/dist/{Chip.vue.es-CKCOY5T6.mjs → Chip.vue.es-DksjbJO8.mjs} +2 -2
- package/dist/{ContextMenu.vue.es-C7KI8Gz6.js → ContextMenu.vue.es-DUU43tCy.js} +1 -1
- package/dist/{ContextMenu.vue.es-Da-lAmTl.mjs → ContextMenu.vue.es-zRvoEJlV.mjs} +4 -4
- package/dist/{CustomerBillingInformation.vue.es-bFUx81Ig.js → CustomerBillingInformation.vue.es-BfPEB42w.js} +1 -1
- package/dist/{CustomerBillingInformation.vue.es-BxBQt4Q0.mjs → CustomerBillingInformation.vue.es-DhFbpZPK.mjs} +2 -2
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BcTZgshS.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-B41la-T7.mjs} +14 -15
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C0lJ_ESU.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BISD6n8X.js} +1 -1
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DkbQ2MiR.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DssxYPSA.mjs} +110 -123
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-XufY6bdV.js +1 -0
- package/dist/{DividerText.vue.es-BF3gnr4e.js → DividerText.vue.es-CoyDk9eH.js} +1 -1
- package/dist/{DividerText.vue.es-DKl3FnDJ.mjs → DividerText.vue.es-nAo1eRMV.mjs} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CQ0KrXHJ.js} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3QYra1x.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-QW9NdxyZ.mjs} +4 -4
- package/dist/{ErrorNotification.vue.es-rRKgmkzV.mjs → ErrorNotification.vue.es-h-D37rfG.mjs} +1 -1
- package/dist/{ErrorNotification.vue.es-BX9dHEc-.js → ErrorNotification.vue.es-tS9vySUZ.js} +1 -1
- package/dist/{IconButton.vue.es-Bwdfu-jm.js → IconButton.vue.es-DgQN18Am.js} +1 -1
- package/dist/{IconButton.vue.es-UlqwNPAX.mjs → IconButton.vue.es-DvfErUOq.mjs} +2 -2
- package/dist/{IconTitle.vue.es-CK9k69tV.mjs → IconTitle.vue.es-B_8bS0tn.mjs} +3 -3
- package/dist/{IconTitle.vue.es-Cei98MBw.js → IconTitle.vue.es-Dn2xcPHj.js} +1 -1
- package/dist/{Input.vue.es-B47l_feL.js → Input.vue.es-B60eK8Ds.js} +1 -1
- package/dist/{Input.vue.es-D9IjIWc-.mjs → Input.vue.es-CU9u5yKH.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DKlPrxQS.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dqdezse7.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DUfJl07Y.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-gpMtYNzn.mjs} +2 -2
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DlJ6lELc.js → InvoiceEntryView.vue_vue_type_script_setup_true_lang-Cl6HU243.js} +1 -1
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-D9Rtgapa.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-DNqawlYV.mjs} +2 -2
- package/dist/{InvoiceSummary.vue.es-DBnR9Hs7.js → InvoiceSummary.vue.es-CAmA8g0t.js} +1 -1
- package/dist/{InvoiceSummary.vue.es-DQ4KvTaw.mjs → InvoiceSummary.vue.es-CRiFJ5x-.mjs} +7 -7
- package/dist/{Modal.vue.es-B9xMiyn3.mjs → Modal.vue.es-BeI5C9-9.mjs} +5 -5
- package/dist/{Modal.vue.es-8LN4gBh0.js → Modal.vue.es-DvLB3uCG.js} +1 -1
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-B1yGKkWN.js → PaymentErrorCard.vue_vue_type_script_setup_true_lang-Dg4rn1cm.js} +1 -1
- package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-BVzL2PGe.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-DqHcOnZp.mjs} +5 -6
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DSGf6uFP.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-B9R5JRJv.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-nLTPnH4j.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DlqoWKQq.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-Ds93gNvh.js → PaymentHistoryBlock-Uw8xeKUk.js} +1 -1
- package/dist/{PaymentHistoryBlock-DYa99P1M.mjs → PaymentHistoryBlock-mCqdFjnL.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CBZhXQfC.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-ALI5f0py.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D0KnSy0y.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DxaY3eFN.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-B_Db4DG1.js → PaymentIntegrationForm-Cx0zCf_C.js} +1 -1
- package/dist/{PaymentIntegrationForm-UWoyZgsR.mjs → PaymentIntegrationForm-DVx4DEtD.mjs} +1 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B-viSd_i.js +1 -0
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-J15IDbMc.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CCKCXXZX.mjs} +4 -4
- package/dist/PaymentIntegrationFormAdyen-B-v-4nlj.js +98 -0
- package/dist/{PaymentIntegrationFormAdyen-D4qfNtZ_.mjs → PaymentIntegrationFormAdyen-Yr8p5Fly.mjs} +16 -20
- package/dist/{PaymentIntegrationFormStripe-DUCJTIAq.js → PaymentIntegrationFormStripe-CoLmAzas.js} +3 -3
- package/dist/{PaymentIntegrationFormStripe-BIiMCWlV.mjs → PaymentIntegrationFormStripe-Ds0BXt89.mjs} +5 -5
- package/dist/{PaymentMethod.vue.es-CKu5nApX.mjs → PaymentMethod.vue.es-4YRmQZHX.mjs} +3 -3
- package/dist/{PaymentMethod.vue.es-CJcSZ9lN.js → PaymentMethod.vue.es-D0D9jW8s.js} +1 -1
- package/dist/{PaymentMethodForm-1d0YIGOu.js → PaymentMethodForm-CMP5FLRO.js} +1 -1
- package/dist/{PaymentMethodForm-B05sHWcW.mjs → PaymentMethodForm-Dnj_7mJU.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-D1yIYsb_.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-DsD3UjkC.mjs} +33 -35
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-BDm8l_6N.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-nxnGyJmE.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-BE4S26JX.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CIrrQUS6.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DGpXRtp4.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CjECKNi_.mjs} +6 -6
- package/dist/PlanCustomizationEditor-DS1r2vBO.js +1 -0
- package/dist/{PlanCustomizationEditor-CpZeilm5.mjs → PlanCustomizationEditor-DlVSCKGN.mjs} +234 -206
- package/dist/{PricingGroupRangeInput.vue.es-CJpvUP3-.mjs → PricingGroupRangeInput.vue.es-BhNcjD7z.mjs} +4 -4
- package/dist/{PricingGroupRangeInput.vue.es-DZSJ5Mz0.js → PricingGroupRangeInput.vue.es-VoOTnHjk.js} +1 -1
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DJ81eUJX.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CmJITenR.mjs} +6 -6
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-jrkraJMu.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-hS6A-KcP.js} +1 -1
- package/dist/{RadioGroupExtended.vue.es-BalV7gwp.mjs → RadioGroupExtended.vue.es-9YzXzZF0.mjs} +2 -2
- package/dist/{RadioGroupExtended.vue.es-Dt6LH9Yh.js → RadioGroupExtended.vue.es-DlbURHQN.js} +1 -1
- package/dist/{Section.vue.es-zVXBHAL6.js → Section.vue.es-Bbt0RITt.js} +1 -1
- package/dist/{Section.vue.es-D7eiXUbk.mjs → Section.vue.es-DVEpre9O.mjs} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BdjYFrVC.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Dl7MbMlk.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DudMRVka.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-xzjqB-v-.mjs} +6 -6
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CJWE7wVi.mjs +41 -0
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-otI7Hz2w.js +1 -0
- package/dist/{StepInput.vue.es-mAnuCuDQ.js → StepInput.vue.es-H-3R4jJq.js} +1 -1
- package/dist/{StepInput.vue.es-C3Zm6Wc9.mjs → StepInput.vue.es-o-3Lg4Ai.mjs} +4 -4
- package/dist/{SubscriptionDetails.entry.ce-WEimiOex.mjs → SubscriptionDetails.entry.ce-CGl6Z5ql.mjs} +22 -22
- package/dist/{SubscriptionDetails.entry.ce-D4CsSoR9.js → SubscriptionDetails.entry.ce-CQUO_uXH.js} +1 -1
- package/dist/{SubscriptionSchedules-DrrEAPlx.mjs → SubscriptionSchedules-DuWZmnD2.mjs} +1 -1
- package/dist/{SubscriptionSchedules-Cm5Dt-1H.js → SubscriptionSchedules-Dy0fUgx5.js} +1 -1
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DHp_KtbF.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-C1kTiW-H.mjs} +11 -11
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-t2Awijf5.js → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Dd_Rr6qn.js} +1 -1
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-CYyP4ra9.js} +1 -1
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-3VYfm6Hm.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-CsekphtV.mjs} +2 -2
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-Bu-_clEa.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-B4j8Clbj.js} +1 -1
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DFU0IULg.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BsdevoeT.mjs} +8 -9
- package/dist/{TooltipParagraph.vue.es-BXbOJmjr.mjs → TooltipParagraph.vue.es-B9A17aG7.mjs} +1 -1
- package/dist/{TooltipParagraph.vue.es-Cph6zT31.js → TooltipParagraph.vue.es-DvC5Wjaz.js} +1 -1
- package/dist/{TrialChip.vue.es-C_wgHGuN.js → TrialChip.vue.es-CLQZ5F0n.js} +1 -1
- package/dist/{TrialChip.vue.es-C_yRujip.mjs → TrialChip.vue.es-Dmv3lPiQ.mjs} +2 -2
- package/dist/{cn.es-D9YMDvG2.js → cn.es-C9Yqq4tg.js} +1 -1
- package/dist/{cn.es-CGa6b2Lt.mjs → cn.es-Cvt6TIwv.mjs} +2 -2
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +6 -6
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +9 -9
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +15 -16
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +14 -15
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
- package/dist/{customElements-D5DAoHRI.mjs → customElements-B58FcXIN.mjs} +5 -5
- package/dist/{customElements-C963-LtW.js → customElements-DUMRMFQ5.js} +2 -2
- package/dist/{customer-DKa1B2vp.mjs → customer-B3LPAhaD.mjs} +1 -1
- package/dist/{customer-TE1FnGT0.js → customer-CisTPaXj.js} +1 -1
- package/dist/{de-DE-CLfzTbbX.mjs → de-DE-DKp5LCu0.mjs} +15 -1
- package/dist/de-DE-DL74pMLb.js +1 -0
- package/dist/en-US-B2XFj-_p.js +1 -0
- package/dist/{en-US-D6SGRAch.mjs → en-US-DQ5vlv9Z.mjs} +15 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{invoices-DJTwftJv.mjs → invoices-3520M5AN.mjs} +1 -1
- package/dist/{invoices-ClqTWYF9.js → invoices-CKQBLar2.js} +1 -1
- package/dist/{it-IT-Cym1UvvK.mjs → it-IT-BgFVsO5S.mjs} +15 -1
- package/dist/it-IT-CqNK62qe.js +1 -0
- package/dist/nl-NL-Dx-TNXQ1.js +1 -0
- package/dist/{nl-NL-D0c4x5C0.mjs → nl-NL-UiRWbO9S.mjs} +15 -1
- package/dist/{paymentMethods-CWzJhcWK.mjs → paymentMethods-CWlvwK5V.mjs} +1 -1
- package/dist/{paymentMethods-AL2U_byg.js → paymentMethods-Cw-i95mM.js} +1 -1
- package/dist/{payments-aXyfylwk.mjs → payments-2qeQdpiW.mjs} +1 -1
- package/dist/{payments-BmiHMlQt.js → payments-CS7_YcOW.js} +1 -1
- package/dist/pricing-BIMpDI_p.mjs +29 -0
- package/dist/pricing-BOqG21f9.js +1 -0
- package/dist/{pricingPlanSchedules-BfsMSvN0.js → pricingPlanSchedules-B_sTAIgU.js} +1 -1
- package/dist/{pricingPlanSchedules-BD4GIP_F.mjs → pricingPlanSchedules-ChQCbMfe.mjs} +1 -1
- package/dist/screens/Checkout/Checkout.cjs +1 -1
- package/dist/screens/Checkout/Checkout.mjs +2 -2
- package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.mjs +10 -10
- package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
- package/dist/screens/PayInvoice/PayInvoice.mjs +12 -12
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
- package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +9 -9
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +20 -20
- package/dist/{subscriptions-cnR5fnf7.mjs → subscriptions-DcfcBYAq.mjs} +1 -1
- package/dist/{subscriptions-Cm83ckfl.js → subscriptions-DwVsf4Ev.js} +1 -1
- package/dist/types/components/checkout/CheckoutTitle.types.d.ts +10 -0
- package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethod.types.d.ts +9 -5
- package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethodApplePay.types.d.ts +3 -1
- package/dist/types/components/payments/ExpressPaymentMethods/ExpressPaymentMethods.types.d.ts +5 -1
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +1 -1
- package/dist/{useActionDispatchProvider-DDYqIh3r.mjs → useActionDispatchProvider-B3AvkLL2.mjs} +1 -1
- package/dist/{useActionDispatchProvider-CHkVQMaE.js → useActionDispatchProvider-DFhppdve.js} +1 -1
- package/dist/{useCustomer-XZKWsolE.mjs → useCustomer-B-jyJIVy.mjs} +1 -1
- package/dist/{useCustomer-DGYtowRy.js → useCustomer-BwZKd9i5.js} +1 -1
- package/dist/{useCustomerFormLabels-CcnkJLcB.mjs → useCustomerFormLabels-BQk3d9PZ.mjs} +5 -5
- package/dist/{useCustomerFormLabels-DAZziqYt.js → useCustomerFormLabels-DV9QiMYh.js} +1 -1
- package/dist/useExperimentalFeature-BciA3Ok9.mjs +135 -0
- package/dist/useExperimentalFeature-CGIkgFR4.js +1 -0
- package/dist/{useInvoiceData-BEK-7msA.mjs → useInvoiceData-BocKdeg7.mjs} +2 -2
- package/dist/{useInvoiceData-CQRn8l9C.js → useInvoiceData-CNV_FMV8.js} +1 -1
- package/dist/{useInvoicesList-C4I118KM.mjs → useInvoicesList-C8nsXMJ6.mjs} +7 -7
- package/dist/{useInvoicesList-BQkKyyXa.js → useInvoicesList-S0IbQcrD.js} +1 -1
- package/dist/{useLoadInitialData-CR0kbYw8.mjs → useLoadInitialData-D9GkzY8t.mjs} +1 -1
- package/dist/{useLoadInitialData-CrKnBZs_.js → useLoadInitialData-D_R6Jy1s.js} +1 -1
- package/dist/usePaymentMethodAvailability-BO_guwAw.js +1 -0
- package/dist/{usePaymentMethodAvailability-ZH-m3B-A.mjs → usePaymentMethodAvailability-DAcsKGeh.mjs} +13 -14
- package/dist/{usePaymentMethodOptions-Ciifjo6c.mjs → usePaymentMethodOptions-1vRAo6Ib.mjs} +1 -1
- package/dist/{usePaymentMethodOptions-Cqe92ZBn.js → usePaymentMethodOptions-CuzOoi2k.js} +1 -1
- package/dist/{usePaymentMethods-B-OKRyKd.mjs → usePaymentMethods-CbwnGONc.mjs} +1 -1
- package/dist/{usePaymentMethods-BKwrl82-.js → usePaymentMethods-DDaTZQZp.js} +1 -1
- package/dist/{usePayments-CV85OV8V.mjs → usePayments-Cr6NlGaW.mjs} +6 -6
- package/dist/{usePayments-Bauj16B-.js → usePayments-DDSjo0rH.js} +1 -1
- package/dist/{usePortal-DSLImEfr.js → usePortal-C27omjhz.js} +1 -1
- package/dist/{usePortal-H8Tv2TnZ.mjs → usePortal-C5AsegpS.mjs} +1 -1
- package/dist/{useSubscription-DqnxWNKg.mjs → useSubscription-BZJL0VOA.mjs} +1 -1
- package/dist/{useSubscription-BiYNJT2e.js → useSubscription-D787IXY-.js} +1 -1
- package/dist/{useTimePeriod.es-B22-fno3.mjs → useTimePeriod.es-DWLsLFqs.mjs} +1 -1
- package/dist/{useTimePeriod.es-D2aiyfd-.js → useTimePeriod.es-rzxqUCTu.js} +1 -1
- package/package.json +10 -7
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-0JHnqIpC.js +0 -1
- package/dist/Checkout.entry.ce-8EcavNgT.js +0 -2
- package/dist/Checkout.entry.ce-BA5ljKj8.mjs +0 -3924
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-hBo2Y2mJ.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C0J37ZVe.js +0 -1
- package/dist/PaymentIntegrationFormAdyen-HeA9XIj-.js +0 -98
- package/dist/PlanCustomizationEditor-CEMP_Dhz.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D60YtA9z.mjs +0 -51
- package/dist/adyen-CvsH5fok.mjs +0 -117
- package/dist/adyen-Druit6gz.js +0 -1
- package/dist/de-DE-DaBBl-Ak.js +0 -1
- package/dist/en-US-BNevqm0M.js +0 -1
- package/dist/it-IT-BkPbTueL.js +0 -1
- package/dist/nl-NL-jIfAVGv0.js +0 -1
- package/dist/pricing-BVAld27Y.js +0 -1
- package/dist/pricing-DLOeiAIB.mjs +0 -16
- package/dist/useExperimentalFeature-COOU6IZd.js +0 -1
- package/dist/useExperimentalFeature-ierhOt9Q.mjs +0 -6
- package/dist/usePaymentMethodAvailability-Ci6LeYKt.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),Ze=require("./api.es-duCDtZD9.js"),M=require("./customElements-C963-LtW.js"),et=require("./sessionReference-m_6Rp4X1.js"),tt=require("./useService-H7BjLg8P.js"),Be=require("./ErrorNotification.vue.es-BX9dHEc-.js"),J=require("./pricingItemConfigs.es-D4aYkYcf.js"),se=require("./wallets.es-CNIMW5ay.js"),z=require("./Button.vue.es-qGvnOKnK.js"),j=require("./TooltipParagraph.vue.es-Cph6zT31.js"),Z=require("./Section.vue.es-zVXBHAL6.js"),Pe=require("./Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js"),Ue=require("./RadioGroupExtended.vue.es-Dt6LH9Yh.js"),O=require("./formControl-ODrpUvcA.js"),le=require("./formatting.es-C72Nsrmh.js"),ot=require("./Divider.vue.es-UwnWvUTl.js"),Ae=require("./Expand.vue.es-BtM0EZEr.js"),Ne=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js"),nt=require("./cn.es-D9YMDvG2.js"),ke=require("./invoices-ClqTWYF9.js"),at=require("./useWatchDebounced-B8iX7ykx.js"),it=require("./Input.vue.es-B47l_feL.js"),re=require("./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DwbIiJBY.js"),ut=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js"),st=require("./customer.es-BButyYo0.js"),lt=require("./usePaymentMethodOptions-Cqe92ZBn.js"),Ee=require("./Modal.vue.es-8LN4gBh0.js"),rt=3e4,ne=60,ae=12,ct=e.defineComponent({__name:"DateTimeAgo",props:{date:{},actionVerb:{}},setup(t){const o=60*ne,n=24*o,a=t,{$t:i,formatDate:u}=M.useIntl(),s=e.ref(Date.now());let l;e.onMounted(()=>{l=setInterval(()=>{s.value=Date.now()},rt)}),e.onBeforeUnmount(()=>{clearInterval(l)});const c=(f,v)=>{const m=(v.getFullYear()-f.getFullYear())*ae+(v.getMonth()-f.getMonth());return v.getDate()<f.getDate()?m-1:m},h=e.computed(()=>{const f=Math.max(0,(s.value-a.date.getTime())/1e3);if(f<ne)return i({defaultMessage:"{count, plural, one {# second} other {# seconds}} ago",id:"dateTimeAgo.seconds",description:"Relative time in whole seconds"},{count:Math.trunc(f)});if(f<o)return i({defaultMessage:"{count, plural, one {# minute} other {# minutes}} ago",id:"dateTimeAgo.minutes",description:"Relative time in whole minutes"},{count:Math.trunc(f/ne)});if(f<n)return i({defaultMessage:"{count, plural, one {# hour} other {# hours}} ago",id:"dateTimeAgo.hours",description:"Relative time in whole hours"},{count:Math.trunc(f/o)});const v=c(a.date,new Date(s.value));if(v<1){const m=Math.trunc(f/n);return m===1?i({defaultMessage:"yesterday",id:"dateTimeAgo.yesterday",description:'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'}):i({defaultMessage:"{count, plural, one {# day} other {# days}} ago",id:"dateTimeAgo.days",description:"Relative time in whole days"},{count:m})}return v<ae?i({defaultMessage:"{count, plural, one {# month} other {# months}} ago",id:"dateTimeAgo.months",description:"Relative time in whole months"},{count:v}):i({defaultMessage:"{count, plural, one {# year} other {# years}} ago",id:"dateTimeAgo.years",description:"Relative time in whole years"},{count:Math.trunc(v/ae)})}),_=e.computed(()=>a.actionVerb?`${a.actionVerb} ${h.value}`:h.value),C=e.computed(()=>u({date:a.date,format:"dateTime",offsetType:"local"}));return(f,v)=>(e.openBlock(),e.createBlock(j._sfc_main,null,{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(_.value),1)]),_:1}))}}),dt=t=>{const{$t:o,formatNumber:n}=M.useIntl(),a=g=>se.formatWalletBalanceValue(o,n,g),i=e.computed(()=>{var g,d;return((d=(g=t.walletBalance.wallet)==null?void 0:g.wallet_type)==null?void 0:d.name)||o({defaultMessage:"Balance",id:"wallet_balance.balance_label",description:"Label shown above a wallet's balance amount"})}),u=g=>{var d;return(((d=g.pricing_item)==null?void 0:d.configs)??[]).filter(T=>!!T.on_demand)},s=e.computed(()=>(t.walletBalance.charge_on_demand_pricing_items??[]).filter(g=>u(g).some(d=>J.isFixedPricing(d)||J.isFlexiblePricing(d)))),l=e.computed(()=>s.value.find(g=>u(g).some(d=>J.isFlexiblePricing(d)))),c=e.computed(()=>!!t.showManualTopUp&&s.value.length>0),h=e.computed(()=>!!t.showAutoTopUp&&!!l.value),_=e.computed(()=>{var g,d;return(d=(g=t.walletBalance.wallet)==null?void 0:g.auto_top_up_configs)==null?void 0:d.find(T=>T.status==="ACTIVE")}),C=e.computed(()=>{var g,d;return(d=(g=t.walletBalance.wallet_balance.open_balance)==null?void 0:g.credits)==null?void 0:d.credit_type}),f=(g,d)=>a({credits:{quantity:g,credit_type_id:d,credit_type:C.value}}),v=g=>g.amount?a({amount:g.amount}):g.credits?f(g.credits.quantity,g.credits.credit_type_id):"",m=e.computed(()=>{var g,d;const T=(g=_.value)==null?void 0:g.pricing_item_id;if(!T)return;const x=(t.walletBalance.charge_on_demand_pricing_items??[]).filter(A=>A.pricing_item_id===T).flatMap(A=>u(A)).flatMap(A=>A.wallet_grants??[]),U=(d=t.walletBalance.wallet)==null?void 0:d.wallet_type_id;return x.find(A=>A.wallet_type_id===U)??x[0]}),w=e.computed(()=>{var g,d;const T=(g=_.value)==null?void 0:g.topup_amount,x=(d=m.value)==null?void 0:d.credits_grant;if(!T||!x)return"";if(x.credits)return f(x.credits.quantity,x.credits.credit_type_id);if(x.conversion){const U=Number(T.quantity)*Number(x.conversion.rate);return f(String(U),x.conversion.credit_type_id)}return""}),P=e.computed(()=>_.value?o({defaultMessage:"Auto top-up enabled",id:"wallet_balance.auto_top_up_enabled_label",description:"Label shown when a wallet tops itself up automatically"}):o({defaultMessage:"No auto top-up enabled",id:"wallet_balance.auto_top_up_disabled_label",description:"Label shown when a wallet has no automatic top-up configured"})),q=e.computed(()=>{const g=_.value;if(!g)return o({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.",id:"wallet_balance.auto_top_up_setup_explanation",description:"Tooltip explaining what automatic top-ups do, shown when none is configured yet"});const d=g.topup_amount?a({amount:g.topup_amount}):"",T=v(g.threshold);return!d||!T?o({defaultMessage:"Your balance is topped up automatically once it runs low.",id:"wallet_balance.auto_top_up_generic_explanation",description:"Tooltip shown for an active automatic top-up whose amount or threshold is unknown"}):w.value?o({defaultMessage:"Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",id:"wallet_balance.auto_top_up_credits_explanation",description:"Tooltip explaining an automatic top-up that grants credits for a paid amount"},{topUpCredits:w.value,topUpAmount:d,threshold:T}):o({defaultMessage:"Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",id:"wallet_balance.auto_top_up_explanation",description:"Tooltip explaining how the automatic top-up of a wallet balance works"},{topUpAmount:d,threshold:T})});return{walletName:i,formatBalance:a,manualTopUpItems:s,flexibleManualTopUpItem:l,showManualTopUp:c,showAutoTopUp:h,activeTopUpConfig:_,autoTopUpLabel:P,autoTopUpExplanation:q}},pt={class:"flex flex-col gap-3 py-3"},mt={class:"flex flex-col gap-1 px-4"},ft={class:"flex w-full justify-between gap-3"},vt={class:"flex w-full items-center gap-4"},ht={key:0},gt={key:1,class:"flex w-full justify-between gap-3 px-4"},_t={class:"flex min-w-0 items-center gap-1"},yt={class:"flex min-w-0 items-center gap-1"},bt={class:"shrink-0"},wt=e.defineComponent({__name:"WalletBalancesItem",props:{walletBalance:{},showAutoTopUp:{type:Boolean},showManualTopUp:{type:Boolean}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){const o=t,{$t:n}=M.useIntl(),{walletName:a,formatBalance:i,manualTopUpItems:u,flexibleManualTopUpItem:s,showManualTopUp:l,showAutoTopUp:c,activeTopUpConfig:h,autoTopUpLabel:_,autoTopUpExplanation:C}=dt(o);return(f,v)=>(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("div",ft,[e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>{var m,w;return[(m=t.walletBalance.wallet_balance)!=null&&m.balance_at?(e.openBlock(),e.createBlock(ct,{key:0,date:new Date((w=t.walletBalance.wallet_balance)==null?void 0:w.balance_at),"action-verb":e.unref(n)({defaultMessage:"updated",id:"wallet_balance.updated_action_verb",description:"Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"})},null,8,["date","action-verb"])):e.createCommentVNode("",!0)]}),_:1})]),e.createElementVNode("div",vt,[e.createVNode(M._sfc_main,{variant:"body-lg",weight:"semibold","no-spacing":"",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(o.walletBalance.wallet_balance.open_balance)),1)]),_:1}),e.unref(l)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",onClick:v[0]||(v[0]=m=>f.$emit("top-up",e.unref(u)[0]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Top up",id:"v1V8kA",description:"Button to top up a wallet balance"})),1)]),_:1})):e.createCommentVNode("",!0)])]),f.$slots.graph?(e.openBlock(),e.createElementBlock("div",ht,[e.renderSlot(f.$slots,"graph")])):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("div",gt,[e.createElementVNode("div",_t,[e.createVNode(j._sfc_main,{class:"min-w-0"},{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",yt,[e.createVNode(M._sfc_main,{variant:"body-sm",color:"secondary","no-spacing":"",class:"truncate"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_)),1)]),_:1}),e.createVNode(z._sfc_main$1,{icon:"info",size:"2xs",class:"shrink-0 cursor-help text-gray-400"})])]),_:1})]),e.createElementVNode("div",bt,[e.unref(h)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",intent:"secondary",onClick:v[1]||(v[1]=m=>f.$emit("cancel-auto-top-up",e.unref(h)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Disable",id:"wallet_balance.auto_top_up_disable_button",description:"Button to turn off a wallet's automatic top-up"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:1,size:"xs",intent:"secondary",onClick:v[2]||(v[2]=m=>f.$emit("auto-top-up",e.unref(s)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Enable",id:"wallet_balance.auto_top_up_enable_button",description:"Button to set up a wallet's automatic top-up"})),1)]),_:1}))])])):e.createCommentVNode("",!0)]))}}),Tt={class:"flex flex-col gap-2"},Ct=e.defineComponent({__name:"WalletBalances",props:{customerWalletBalances:{},title:{default:void 0},showAutoTopUp:{type:Boolean,default:!1},showManualTopUp:{type:Boolean,default:!1}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(Z._sfc_main,{"no-spacing":"","no-border":"",title:t.title},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.customerWalletBalances,a=>(e.openBlock(),e.createBlock(Z._sfc_main,{key:a.wallet_id,"no-spacing":""},{default:e.withCtx(()=>[e.createVNode(wt,{"wallet-balance":a,"show-auto-top-up":t.showAutoTopUp,"show-manual-top-up":t.showManualTopUp,onTopUp:n[0]||(n[0]=i=>o.$emit("top-up",i)),onAutoTopUp:n[1]||(n[1]=i=>o.$emit("auto-top-up",i)),onCancelAutoTopUp:n[2]||(n[2]=i=>o.$emit("cancel-auto-top-up",i))},null,8,["wallet-balance","show-auto-top-up","show-manual-top-up"])]),_:2},1024))),128))])]),_:2},[o.$slots["heading-right"]?{name:"right",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"heading-right")]),key:"0"}:void 0]),1032,["title"]))}});function Mt(){const t=M.createRequestService(),o=M.useConfig();function n(a){return t({url:`${o.apiUrls.config}/portal/customers/${a}/wallets/balance`,query:Ze.withExpand({expandParams:et.EXPAND_ALL}),options:{method:"POST"},data:{}})}return{getCustomerWalletBalances:n}}function St({customerId:t}){const{getCustomerWalletBalances:o}=Mt(),{data:n,execute:a,apiStatus:i,error:u,isPending:s}=tt.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:i,error:u,fetch:a,isPending:s}}const _e=(t=[],o)=>{if(o!=null&&o.pricing_item_id)return t.find(n=>(n.charge_on_demand_pricing_items??[]).some(({pricing_item_id:a})=>a===o.pricing_item_id))},xt=["TOP_UP","ADD_PAYMENT_METHOD","SUCCESS"],ce=t=>typeof t=="object"&&t!==null&&"pricing_item"in t,Bt=t=>[...new Set(((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>ce(o)&&o.pricing_plan_schedule_id?[o.pricing_plan_schedule_id]:[]))],Pt=(t,o)=>{const n=new Set(Bt(t));return o.flatMap(a=>{const i=(a.pricing_plan_schedule_infos??[]).filter(({id:u})=>n.has(u));return i.length===0?[]:[{id:a.id,name:a.name||a.reference||a.id,scheduleIds:i.map(({id:u})=>u),enabledPricingIds:i.flatMap(u=>{var s;return(((s=u.pricing_plan_schedule)==null?void 0:s.enabled_pricings)??[]).flatMap(({pricing_id:l})=>l?[l]:[])})}]})},Ut=(t,o)=>{if(!t||o.length===0)return t;const n=new Set(o);return{...t,charge_on_demand_pricing_items:(t.charge_on_demand_pricing_items??[]).filter(a=>ce(a)&&!!a.pricing_plan_schedule_id&&n.has(a.pricing_plan_schedule_id))}},Ve=t=>((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>{var a,i;if(!ce(o))return[];const n=o.pricing_item_id??((a=o.pricing_item)==null?void 0:a.id);return n?(((i=o.pricing_item)==null?void 0:i.configs)??[]).map(u=>{const s=Et(u,t),l=At(u,t);return{pricingItemId:n,...o.pricing_plan_schedule_id&&{pricingPlanScheduleId:o.pricing_plan_schedule_id},config:u,...s&&{flexiblePricing:s},...l&&{fixedPricing:l}}}):[]});function At(t,o){var u,s,l;if(!t.on_demand||!J.hasOneOfPricingTypes(t,["FIXED"]))return;const n=(l=(s=(u=t.details)==null?void 0:u.bands)==null?void 0:s[0])==null?void 0:l.fixed_amount;if(!n)return;const a=$e(o),i=a?kt(t,o):void 0;return{amount:n,value:i&&a?de(i.quantity,a):{amount:n}}}const $e=t=>{var o;return(o=t==null?void 0:t.wallet_balance.balance)==null?void 0:o.credits},Oe=(t,o)=>{var a;const n=(a=o==null?void 0:o.wallet)==null?void 0:a.wallet_type_id;return(t.wallet_grants??[]).filter(({wallet_type_id:i})=>!n||i===n)},Nt=(t,o)=>{var n,a;return(a=(n=Oe(t,o).find(({credits_grant:i})=>i==null?void 0:i.conversion))==null?void 0:n.credits_grant)==null?void 0:a.conversion},kt=(t,o)=>{var n,a;return(a=(n=Oe(t,o).find(({credits_grant:i})=>i==null?void 0:i.credits))==null?void 0:n.credits_grant)==null?void 0:a.credits},de=(t,o)=>({credits:{...o,quantity:t}}),De=(t,o)=>{const n=Number(t),a=Number(o);return Number.isFinite(n)&&Number.isFinite(a)?String(n*a):void 0};function Et(t,o){var c,h,_,C,f,v,m;if(!t.on_demand||!J.isFlexiblePricing(t))return;const n=(h=(c=t.details)==null?void 0:c.bands)==null?void 0:h[0],a=((_=n==null?void 0:n.minimum_amount)==null?void 0:_.currency)??((C=n==null?void 0:n.maximum_amount)==null?void 0:C.currency)??((v=(f=o==null?void 0:o.wallet_balance.balance)==null?void 0:f.amount)==null?void 0:v.currency);if(!a)return;const i=$e(o),u=i?Nt(t,o):void 0,s=(m=i==null?void 0:i.credit_type)==null?void 0:m.unit_name,l=w=>{if(!w)return;const P=i&&u?De(w.quantity,u.rate):void 0;return P!==void 0&&i?de(P,i):{amount:w}};return{config:{...(n==null?void 0:n.minimum_amount)&&{minimum_amount:n.minimum_amount},...(n==null?void 0:n.maximum_amount)&&{maximum_amount:n.maximum_amount}},currency:a,...u&&{creditsConfiguration:{conversionRate:u.rate,...(s==null?void 0:s.singular)&&{unitNameSingle:s.singular},...(s==null?void 0:s.plural)&&{unitNamePlural:s.plural}}},bounds:{...l(n==null?void 0:n.minimum_amount)&&{minimum:l(n==null?void 0:n.minimum_amount)},...l(n==null?void 0:n.maximum_amount)&&{maximum:l(n==null?void 0:n.maximum_amount)}}}}const Vt=t=>{var o,n,a,i,u;return!!((o=t.fixedPricing)!=null&&o.value.credits)||!!((n=t.flexiblePricing)!=null&&n.creditsConfiguration)||!!((u=((a=t.flexiblePricing)==null?void 0:a.bounds.minimum)??((i=t.flexiblePricing)==null?void 0:i.bounds.maximum))!=null&&u.credits)},$t=t=>{var o;for(const{fixedPricing:n,flexiblePricing:a}of t){const i=(n==null?void 0:n.value.credits)??((o=(a==null?void 0:a.bounds.minimum)??(a==null?void 0:a.bounds.maximum))==null?void 0:o.credits);if(i!=null&&i.credit_type_id)return i.credit_type_id}},Ot=(t=[])=>{for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return a}},Ie=(t=[])=>{var o,n,a;for(const{fixedPricing:i,flexiblePricing:u}of t){const s=(i==null?void 0:i.value.credits)??((o=(u==null?void 0:u.bounds.minimum)??(u==null?void 0:u.bounds.maximum))==null?void 0:o.credits);if((a=(n=s==null?void 0:s.credit_type)==null?void 0:n.unit_name)!=null&&a.plural)return s.credit_type.unit_name.plural}},Dt=(t=[])=>{var o;for(const{flexiblePricing:n}of t){const a=(o=n==null?void 0:n.creditsConfiguration)==null?void 0:o.conversionRate;if(a)return a}},It=(t=[])=>{for(const{flexiblePricing:o}of t){const{minimum_amount:n,maximum_amount:a}=(o==null?void 0:o.config)??{};if(n||a)return{...n&&{minimum:n},...a&&{maximum:a}}}return{}},qt=(t=[])=>{if(t.some(Vt)){const o=$t(t);return o?{creditTypeId:o}:void 0}for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return{currency:a}}},Rt=(t,o)=>{var s;if(t.fixedPricing)return t.fixedPricing.value;if(!t.flexiblePricing||!o)return;const{bounds:n,creditsConfiguration:a}=t.flexiblePricing,i=(s=n.minimum??n.maximum)==null?void 0:s.credits,u=a?De(o.quantity,a.conversionRate):void 0;return i&&u!==void 0?de(u,i):{amount:o}},qe=(t=[])=>{const o=qt(t);if(o)return{denomination:o,chargeCurrency:Ot(t)??"",creditUnitName:Ie(t),conversionRate:Dt(t),topUpBounds:It(t)}},Ft=400;function Re({pricingPlanScheduleId:t,pricingItems:o}){const{previewChargeOnDemandPricingItems:n}=ke.createInvoicesService(),a=M.useLogger(),i=e.ref(),u=e.ref(!1),s=e.ref(!1),l=e.computed(()=>u.value||s.value),c=e.ref(!1),h=M.createLatestGuard(),_=async()=>{const C=t.value,f=h();if(s.value=!1,!C||!o.value){o.value&&!C&&a.warn("INVOICE_PREVIEW_SKIPPED","Skipped the on-demand charge invoice preview: no schedule to charge it on",{missing:["pricingPlanScheduleId"]}),i.value=void 0,u.value=!1,c.value=!1;return}u.value=!0,c.value=!1;try{const v=await n({pricingPlanScheduleId:C,pricingItems:o.value});f()&&(i.value=v)}catch(v){f()&&(i.value=void 0,c.value=!0),a.error("INVOICE_PREVIEW_FAILED","Failed to load the invoice preview",{preview:"ON_DEMAND_CHARGE"},v)}finally{f()&&(u.value=!1)}};return at.useWatchDebounced(o,()=>void _(),{debounce:()=>i.value||u.value||c.value?Ft:0,deep:!0}),e.watch(o,C=>{s.value=!!C,C||(h(),i.value=void 0,c.value=!1,u.value=!1)},{deep:!0,flush:"sync"}),_(),{invoicePreview:i,isPreviewPending:l,hasPreviewFailed:c,loadPreview:_}}const Lt={key:0},Fe=e.defineComponent({__name:"TopUpInvoicePreview",props:{pricingPlanScheduleId:{type:String},pricingItems:{type:Array}},setup(t){const o=t,{$t:n}=M.useIntl(),a=e.computed(()=>o.pricingPlanScheduleId),i=e.computed(()=>o.pricingItems),{invoicePreview:u}=Re({pricingPlanScheduleId:a,pricingItems:i});return(s,l)=>(e.openBlock(),e.createBlock(Pe._sfc_main,{class:"sv-top-up-invoice-preview h-[152px]","data-testid":"top-up-invoice-preview-skeleton"},{default:e.withCtx(()=>[e.unref(u)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(nt._sfc_main),{required:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"You will pay",description:"Label above the preview of what topping up will be invoiced for",id:"topup_modal.invoice_preview.label"})),1)]),_:1}),e.createVNode(e.unref(Z._sfc_main),{"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ne._sfc_main$1),{invoice:e.unref(u),"is-customer-facing":""},null,8,["invoice"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))}}),Le=(t,o)=>t.currency??o??t.creditTypeId??"",ye=(t,o)=>({quantity:t??null,currency:o}),ie=(t,{denomination:o,chargeCurrency:n,creditUnitName:a,minimumTopUp:i})=>{var u,s,l,c,h;return{enabled:(t==null?void 0:t.status)==="ACTIVE",threshold:ye(((s=(u=t==null?void 0:t.threshold)==null?void 0:u.amount)==null?void 0:s.quantity)??((c=(l=t==null?void 0:t.threshold)==null?void 0:l.credits)==null?void 0:c.quantity),Le(o,a)),topUpAmount:ye(((h=t==null?void 0:t.topup_amount)==null?void 0:h.quantity)??i,n)}},Yt=(t,o)=>{var a;const n=(a=t.threshold)==null?void 0:a.quantity;return n?o.creditTypeId?{credits:{quantity:n,credit_type_id:o.creditTypeId}}:{amount:{quantity:n,currency:o.currency??""}}:{}},be=(t,o)=>{var n;return(n=t.topUpAmount)!=null&&n.quantity?{quantity:t.topUpAmount.quantity,currency:t.topUpAmount.currency??o}:void 0},Ye=(t,{denomination:o,chargeCurrency:n})=>({status:t.enabled?"ACTIVE":"INACTIVE",threshold:Yt(t,o),...be(t,n)&&{topup_amount:be(t,n)}}),we=(t,o)=>Ye(ie(t,o),o),Te=(t,o)=>JSON.stringify(t)===JSON.stringify(o),Ce=t=>{const o=Number(t==null?void 0:t.quantity);return t!=null&&t.quantity&&Number.isFinite(o)?o:void 0},Wt=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t>=n},Ht=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t<=n},ee=t=>{const o=Number(t);return t!=null&&t!==""&&Number.isFinite(o)?o:void 0},pe=(t,o,n)=>{const a=ee(t),i=ee(n);if(!(a===void 0||i===void 0||i<=0))return o==="CREDITS"?a/i:a*i},Me=(t,o,n,a)=>o===n?ee(t):pe(t,o,a),zt=(t,o,n)=>o==="CREDITS"?pe(t,"AMOUNT",n):ee(t),me=t=>t.toFixed(2),Se=(t,o)=>o==="AMOUNT"?me(t):String(Number(t.toFixed(6))),We=(t,o,n,a)=>{const i=zt(t==null?void 0:t.quantity,o,n);if(i!==void 0)return o==="CREDITS"?a(i):me(i)},jt=["data-testid"],ue=e.defineComponent({__name:"ConvertedAmountInput",props:e.mergeModels({unit:{type:String},modelBase:{type:String},entryBase:{type:String},conversionRate:{type:String},showConversionHint:{type:Boolean},currency:{type:String},creditUnitName:{type:String},bounds:{type:Object},label:{type:String},name:{type:String},required:{type:Boolean},disabled:{type:Boolean},error:{type:[String,Object,Array]}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:a,formatNumber:i}=M.useIntl(),u=e.computed(()=>o.entryBase??o.modelBase),s=e.computed(()=>u.value!==o.modelBase&&ee(o.conversionRate)!==void 0),l=e.ref("");e.watch(()=>[n.value,u.value,o.modelBase,o.conversionRate],([d])=>{if(!s.value){l.value=d??"";return}if(d===c(l.value))return;const T=Me(d,o.modelBase,u.value,o.conversionRate);l.value=T===void 0?"":Se(T,u.value)},{immediate:!0});function c(d){const T=Me(d,u.value,o.modelBase,o.conversionRate);return T===void 0?"":Se(T,o.modelBase)}const h=e.computed({get:()=>l.value,set:d=>{l.value=O.asText(d),n.value=s.value?c(l.value):l.value}}),_=e.computed(()=>pe(l.value,u.value,o.conversionRate)),C=e.computed(()=>o.creditUnitName?o.creditUnitName:u.value==="CREDITS"?o.unit:a({defaultMessage:"credits",description:"Generic name for a wallet credit, where its credit type does not name one",id:"converted_amount_input.credits"})),f=(d,T)=>le.formatAmount({quantity:me(d),currency:T}),v=d=>`${i(d)} ${C.value}`,m=e.computed(()=>{const d=o.error;return Array.isArray(d)?d.length>0:!!(e.isRef(d)?d.value:d)}),w=e.computed(()=>{const d=_.value;if(!(m.value||!o.showConversionHint||d===void 0))return u.value==="CREDITS"?o.currency?a({defaultMessage:"Will cost {amount} excluding taxes",description:"Helper text under a credits field, naming what those credits cost in money",id:"converted_amount_input.cost"},{amount:f(d,o.currency)}):void 0:a({defaultMessage:"Buys about {credits}",description:"Helper text under a money field, naming the credits that amount converts into",id:"converted_amount_input.buys"},{credits:v(d)})}),P=d=>We(d,u.value,o.conversionRate,i),q=e.computed(()=>{var d,T,x,U;return u.value==="CREDITS"?C.value:((T=(d=o.bounds)==null?void 0:d.minimum)==null?void 0:T.currency)??((U=(x=o.bounds)==null?void 0:x.maximum)==null?void 0:U.currency)??o.unit}),g=e.computed(()=>{var U,A;const d=P((U=o.bounds)==null?void 0:U.minimum),T=P((A=o.bounds)==null?void 0:A.maximum),x=q.value;if(d&&T)return a({defaultMessage:"Between {minimum} and {maximum} {unit}",description:"Range of what a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.range"},{minimum:d,maximum:T,unit:x});if(d)return a({defaultMessage:"At least {minimum} {unit}",description:"Smallest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.minimum"},{minimum:d,unit:x});if(T)return a({defaultMessage:"Up to {maximum} {unit}",description:"Largest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.maximum"},{maximum:T,unit:x})});return(d,T)=>(e.openBlock(),e.createBlock(e.unref(it._sfc_main),{modelValue:h.value,"onUpdate:modelValue":T[0]||(T[0]=x=>h.value=x),class:"sv-converted-amount-input",type:"number","as-text-type":"",name:t.name,label:t.label,required:t.required,disabled:t.disabled,error:t.error},e.createSlots({suffix:e.withCtx(()=>[e.createElementVNode("span",{"data-testid":`${t.name}-unit`},e.toDisplayString(t.unit),9,jt)]),_:2},[g.value?{name:"label-suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-bounds`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1},8,["data-testid"])]),key:"0"}:void 0,w.value?{name:"helper",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-conversion`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.value),1)]),_:1},8,["data-testid"])]),key:"1"}:void 0]),1032,["modelValue","name","label","required","disabled","error"]))}}),Qt=e.defineComponent({__name:"Section",props:{emphasized:{type:Boolean,default:!1},contentClasses:{type:String},contentBackground:{type:String},title:{type:String},noSpacing:{type:Boolean},hasError:{type:Boolean},noBorder:{type:Boolean}},setup(t){const o=t,n=["sv-section__accent relative","before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5","before:rounded-full before:bg-primary-600"].join(" "),a=e.computed(()=>[o.emphasized?n:void 0,o.contentClasses].filter(Boolean).join(" ")),i=e.computed(()=>{const{emphasized:u,...s}=o;return s});return(u,s)=>(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),e.mergeProps(i.value,{class:"sv-section","content-classes":a.value}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:2},[u.$slots.right?{name:"right",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"right")]),key:"0"}:void 0]),1040,["content-classes"]))}}),Gt={class:"flex grow flex-col"},He=e.defineComponent({__name:"AutoTopUpConfig",props:{config:{type:Object},denomination:{type:Object},creditUnitName:{type:String},chargeCurrency:{type:String},conversionRate:{type:String},topUpBounds:{type:Object},showThresholdConversion:{type:Boolean,default:!0},contained:{type:Boolean},alwaysEnabled:{type:Boolean},disabled:{type:Boolean}},emits:["save"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:u,formatNumber:s}=M.useIntl(),l=e.computed(()=>{var y,S;return{denomination:a.denomination,chargeCurrency:a.chargeCurrency,creditUnitName:a.creditUnitName,minimumTopUp:(S=(y=a.topUpBounds)==null?void 0:y.minimum)==null?void 0:S.quantity}}),c=e.ref(ie(a.config,l.value)),h=e.computed(()=>Le(a.denomination,a.creditUnitName)),_=e.computed(()=>a.denomination.creditTypeId?"CREDITS":"AMOUNT"),C=e.computed(()=>_.value==="CREDITS"?h.value:a.chargeCurrency),f=e.computed({get:()=>{var y;return((y=c.value.threshold)==null?void 0:y.quantity)??""},set:y=>{c.value.threshold={quantity:y||null,currency:h.value}}}),v=e.computed({get:()=>{var y;return((y=c.value.topUpAmount)==null?void 0:y.quantity)??""},set:y=>{c.value.topUpAmount={quantity:y||null,currency:a.chargeCurrency}}});e.watch(()=>[a.config,l.value],([y,S])=>{Te(we(y,S),P())||(c.value=ie(y,S))});const m=e.computed({get:()=>a.alwaysEnabled||c.value.enabled,set:y=>{c.value.enabled=y}}),w=e.computed(()=>Ye({...c.value,enabled:m.value},l.value)),P=()=>w.value,q=e.reactive({threshold:e.computed(()=>Ce(c.value.threshold)??null),topUpAmount:e.computed(()=>Ce(c.value.topUpAmount)??null)}),g=y=>{if(!y)return"";const S=We(y,_.value,a.conversionRate,s);return S===void 0?le.formatAmount(y):`${S} ${C.value}`},d=O.requiredIf(()=>m.value),T=O.useValidation({threshold:{required:O.common.withMessage(()=>u({defaultMessage:"Enter the balance to top up at.",description:"Error shown under the auto top-up threshold when it is left empty",id:"auto_topup_config.threshold.required"}),d),notNegative:O.common.withMessage(()=>u({defaultMessage:"The balance to top up at cannot be negative.",description:"Error shown under the auto top-up threshold when it is below zero",id:"auto_topup_config.threshold.not_negative"}),y=>y===null||y>=0)},topUpAmount:{required:O.common.withMessage(()=>u({defaultMessage:"Enter the amount to top up with.",description:"Error shown under the auto top-up amount when it is left empty",id:"auto_topup_config.amount.required"}),d),positive:O.common.withMessage(()=>u({defaultMessage:"Top up with more than zero.",description:"Error shown under the auto top-up amount when it is zero or negative",id:"auto_topup_config.amount.positive"}),y=>y===null||y>0),atLeastMinimum:O.common.withMessage(()=>{var y;return u({defaultMessage:"Top up with at least {minimum}.",description:"Error shown under the auto top-up amount when it is below what the pricing allows",id:"auto_topup_config.amount.at_least_minimum"},{minimum:g((y=a.topUpBounds)==null?void 0:y.minimum)})},y=>{var S;return Wt(y,(S=a.topUpBounds)==null?void 0:S.minimum)}),withinMaximum:O.common.withMessage(()=>{var y;return u({defaultMessage:"Top up with at most {maximum}.",description:"Error shown under the auto top-up amount when it is above what the pricing allows",id:"auto_topup_config.amount.within_maximum"},{maximum:g((y=a.topUpBounds)==null?void 0:y.maximum)})},y=>{var S;return Ht(y,(S=a.topUpBounds)==null?void 0:S.maximum)})}},q),x=e.computed(()=>!Te(P(),we(a.config,l.value)));function U(){return T.value.$touch(),T.value.$invalid?void 0:P()}function A(){const y=U();y&&i("save",y)}return o({submit:A,validate:U,rule:w,hasChanges:x,isInvalid:e.computed(()=>T.value.$invalid)}),(y,S)=>(e.openBlock(),e.createBlock(Qt,{class:"sv-auto-topup-config","content-background":t.contained?"gray":"none","no-spacing":!t.contained,"no-border":!t.contained},{default:e.withCtx(()=>[t.alwaysEnabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(O._sfc_main),{key:0,modelValue:m.value,"onUpdate:modelValue":S[0]||(S[0]=I=>m.value=I),"no-spacing":"","label-position":"before",class:"!flex",disabled:t.disabled},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",Gt,[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Auto top-up",description:"Title of the automatic wallet top-up settings",id:"auto_topup_config.title"})),1)]),_:1}),e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)({defaultMessage:"Automatically top up your balance when it runs low.",description:"Subtitle of the automatic wallet top-up settings",id:"auto_topup_config.subtitle"})),1)]),_:1})])]),_:1},8,["modelValue","disabled"])),e.createVNode(e.unref(Ae._sfc_main),{"is-open":m.value},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid grid-cols-1 gap-3",{"mt-4":!t.alwaysEnabled}])},[e.createVNode(ue,{modelValue:f.value,"onUpdate:modelValue":S[1]||(S[1]=I=>f.value=I),name:"auto-top-up-threshold",unit:h.value,"model-base":_.value,"entry-base":_.value,currency:t.chargeCurrency,"conversion-rate":t.conversionRate,"show-conversion-hint":t.showThresholdConversion,required:"",disabled:t.disabled,error:e.unref(T).threshold.$errors,label:e.unref(u)({defaultMessage:"When your balance falls below",description:"Label of the balance at which an automatic top-up is charged",id:"auto_topup_config.threshold.label"})},null,8,["modelValue","unit","model-base","entry-base","currency","conversion-rate","show-conversion-hint","disabled","error","label"]),e.createVNode(ue,{modelValue:v.value,"onUpdate:modelValue":S[2]||(S[2]=I=>v.value=I),name:"auto-top-up-amount",unit:C.value,"model-base":"AMOUNT","entry-base":_.value,currency:t.chargeCurrency,"credit-unit-name":t.creditUnitName,"conversion-rate":t.conversionRate,bounds:t.topUpBounds,"show-conversion-hint":"",required:"",disabled:t.disabled,error:e.unref(T).topUpAmount.$errors,label:e.unref(u)({defaultMessage:"Top-up with",description:"Label of the amount every automatic top-up adds",id:"auto_topup_config.amount.label"})},null,8,["modelValue","unit","entry-base","currency","credit-unit-name","conversion-rate","bounds","disabled","error","label"])],2)):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["content-background","no-spacing","no-border"]))}}),xe=t=>{const o=Date.parse(t??"");return Number.isFinite(o)?o:0};function ze({paymentMethods:t,selectedPaymentMethodId:o,preferredPaymentMethodId:n}){const a=e.computed(()=>[...t.value??[]].sort((i,u)=>xe(u.created_at)-xe(i.created_at)));return e.watch(()=>[t.value,n==null?void 0:n.value,o.value],([i,u,s],l)=>{var C;const c=l==null?void 0:l[0],h=i==null?void 0:i.find(({id:f})=>!(c!=null&&c.some(v=>v.id===f)));if(h&&(c!=null&&c.length)){o.value=h.id;return}const _=f=>!!f&&!!(i!=null&&i.some(v=>v.id===f));_(s)||(o.value=_(u)?u:(C=(i==null?void 0:i.find(({is_default:f})=>f))??a.value[0])==null?void 0:C.id)},{immediate:!0}),{sortedPaymentMethods:a}}function te(){const{$t:t,formatNumber:o}=M.useIntl(),n=i=>se.formatWalletBalanceValue(t,o,i);return{formatValue:n,formatOpenBalance:i=>n(i==null?void 0:i.wallet_balance.open_balance)}}const Kt={class:"sv-top-up-form"},Xt={class:"grid grid-cols-1 gap-4"},Jt={class:"grid grid-cols-1 gap-1"},Zt={class:"sv-top-up-form__option-details"},eo={key:0},to=e.defineComponent({__name:"TopUpModalForm",props:{topUpPricingItems:{type:null},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},autoTopUpConfig:{type:Object}},emits:["add-payment-method","success","save-auto-top-up","failure"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:u}=M.useIntl(),{formatValue:s}=te(),l=e.ref({pricing_plan_schedule_id:"",pricing_items:[],start_at:"",finalize_immediately:!1,payment_method_id:void 0,preview:!0}),c=e.computed(()=>{const r=(a.topUpPricingItems??[]).filter(p=>p.flexiblePricing||p.fixedPricing);return[...r.filter(({flexiblePricing:p})=>p),...r.filter(({flexiblePricing:p})=>!p)]}),h=r=>c.value.find(p=>p.pricingItemId===r),_=e.computed(()=>{var r,p;return(p=(r=a.topUpPricingItems)==null?void 0:r.find(b=>b.pricingPlanScheduleId))==null?void 0:p.pricingPlanScheduleId});e.watch(_,r=>{l.value.pricing_plan_schedule_id=r??""},{immediate:!0});const C=r=>{const{config:p,currency:b}=r.flexiblePricing??{},N=p==null?void 0:p.minimum_amount;return N&&b?{quantity:N.quantity,currency:b}:void 0},f=e.computed({get:()=>{var r;return(r=l.value.pricing_items[0])==null?void 0:r.pricing_item_id},set:r=>{const p=h(typeof r=="string"?r:void 0);if(!p){l.value.pricing_items=[];return}const b=C(p);l.value.pricing_items=[{pricing_item_id:p.pricingItemId,...b&&{flexible_amount:b}}]}});e.watch(c,r=>{if(r.some(({pricingItemId:N})=>{var V;return N===((V=l.value.pricing_items[0])==null?void 0:V.pricing_item_id)}))return;const b=r.find(({flexiblePricing:N})=>N)??r[0];f.value=b==null?void 0:b.pricingItemId},{immediate:!0});const v=e.computed({get:()=>{var r;return(r=l.value.pricing_items[0])==null?void 0:r.flexible_amount},set:r=>{var b;const p=(b=l.value.pricing_items[0])==null?void 0:b.pricing_item_id;p&&(l.value.pricing_items=[{pricing_item_id:p,...r&&{flexible_amount:r}}])}}),m=r=>{var b;const p=(b=h(String(r)))==null?void 0:b.fixedPricing;return p!=null&&p.value.credits?le.formatAmount(p.amount):void 0},w=e.computed(()=>{var r;return(r=h(String(f.value)))==null?void 0:r.flexiblePricing}),P=e.computed({get:()=>{var r;return((r=v.value)==null?void 0:r.quantity)??""},set:r=>{var b;const p=(b=w.value)==null?void 0:b.currency;v.value=r&&p?{quantity:r,currency:p}:void 0}}),q=r=>r.creditsConfiguration?"CREDITS":"AMOUNT",g=e.computed(()=>Ie(a.topUpPricingItems)),d=r=>r.creditsConfiguration?g.value??r.creditsConfiguration.unitNamePlural??r.creditsConfiguration.unitNameSingle??"":r.currency,T=r=>{var b;const p=(b=h(String(r)))==null?void 0:b.flexiblePricing;return p?[p]:[]},x=r=>{var p;return!!((p=h(String(r)))!=null&&p.flexiblePricing)},U=e.computed(()=>c.value.map(r=>{var p;return{value:r.pricingItemId,label:r.fixedPricing?s(r.fixedPricing.value):u({defaultMessage:"Choose your own amount",description:"Label of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.label"}),...((p=r.flexiblePricing)==null?void 0:p.bounds.minimum)&&r.flexiblePricing.bounds.maximum&&{description:u({defaultMessage:"Between {minimum} and {maximum}",description:"Bounds of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.bounds"},{minimum:s(r.flexiblePricing.bounds.minimum),maximum:s(r.flexiblePricing.bounds.maximum)})}}})),A=e.computed(()=>{const r=l.value.pricing_items.filter(p=>{var b;return!((b=h(p.pricing_item_id))!=null&&b.flexiblePricing)||!!p.flexible_amount});return r.length>0?r:void 0}),y=e.computed(()=>!a.autoTopUpConfig&&c.value.some(({flexiblePricing:p})=>p)?qe(a.topUpPricingItems):void 0),S=e.ref(),{chargeOnDemandPricingItems:I}=ke.createInvoicesService(),Q=M.useLogger(),R=e.ref(!1),L=e.computed(()=>!!l.value.pricing_plan_schedule_id&&!!A.value&&!!l.value.payment_method_id),G=e.reactive({paymentMethodId:e.computed(()=>l.value.payment_method_id??null)}),W=O.useValidation({paymentMethodId:{required:O.common.withMessage(()=>u({defaultMessage:"Select a payment method to pay for this top-up.",description:"Error shown under the payment methods in the top-up modal when none is selected on submit",id:"topup_modal.payment_method_required"}),O.required)}},G),Y=e.computed(()=>{const[r]=l.value.pricing_items,p=h(r==null?void 0:r.pricing_item_id);return p?Rt(p,r==null?void 0:r.flexible_amount):void 0});async function K(){var p,b,N;W.value.$touch();const r=(p=S.value)==null?void 0:p.validate();if(!(W.value.$invalid||(b=S.value)!=null&&b.isInvalid||!L.value||R.value)){R.value=!0;try{const V=await I({pricing_plan_schedule_id:l.value.pricing_plan_schedule_id,pricing_items:A.value??[],payment_method_id:l.value.payment_method_id,preview:!1});r&&((N=S.value)!=null&&N.hasChanges)&&l.value.payment_method_id&&i("save-auto-top-up",{rule:r,paymentMethodId:l.value.payment_method_id}),i("success",V)}catch(V){Q.error("TOP_UP_FAILED","Failed to charge the wallet top-up",{},V),i("failure",V)}finally{R.value=!1}}}o({submit:K,isCharging:R,canSubmit:L,chargedValue:Y});const H=e.computed({get:()=>l.value.payment_method_id??void 0,set:r=>{l.value.payment_method_id=r}}),{sortedPaymentMethods:X}=ze({paymentMethods:e.computed(()=>a.paymentMethods),selectedPaymentMethodId:H});return(r,p)=>(e.openBlock(),e.createElementBlock("form",Kt,[e.createElementVNode("div",Xt,[e.createElementVNode("div",Jt,[U.value.length>0?(e.openBlock(),e.createBlock(e.unref(Ue._sfc_main),{key:0,modelValue:f.value,"onUpdate:modelValue":p[3]||(p[3]=b=>f.value=b),class:"sv-top-up-form__options",name:"top-up-pricing-item",direction:"column",required:"",disabled:R.value,options:U.value,"show-radio":!1,label:e.unref(u)({defaultMessage:"Top up amount",description:"Label above the list of ways to top up the wallet in the top-up modal",id:"topup_modal.pricing_items.label"})},{label:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("span",null,e.toDisplayString(b.label),1),m(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",weight:"normal","no-spacing":"",class:"sv-top-up-form__option-cost"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(N)),1)]),_:2},1024)):e.createCommentVNode("",!0)]),description:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("div",Zt,[b.description&&!x(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),T(N).length>0?(e.openBlock(),e.createBlock(e.unref(Ae._sfc_main),{key:1,"is-open":String(N)===f.value,lazy:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T(N),V=>{var k;return e.openBlock(),e.createElementBlock("div",{key:V.currency,class:"sv-top-up-form__amount grid grid-cols-1 gap-3",onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"])),onKeydown:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[b.description?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(ue,{modelValue:P.value,"onUpdate:modelValue":p[0]||(p[0]=D=>P.value=D),name:"top-up-amount","model-base":"AMOUNT",unit:d(V),"entry-base":q(V),currency:V.currency,"conversion-rate":(k=V.creditsConfiguration)==null?void 0:k.conversionRate,required:"",disabled:R.value},null,8,["modelValue","unit","entry-base","currency","conversion-rate","disabled"])],32)}),128))]),_:2},1032,["is-open"])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","disabled","options","label"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(Fe,{"pricing-plan-schedule-id":_.value,"pricing-items":A.value},null,8,["pricing-plan-schedule-id","pricing-items"])]),y.value?(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(He,e.mergeProps({ref_key:"autoTopUpFormRef",ref:S,class:"sv-top-up-form__auto-top-up"},y.value,{contained:"","show-threshold-conversion":!1,disabled:R.value}),null,16,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode(e.unref(ot._sfc_main),{spacing:"xs"})]),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"payment-method",{},()=>[e.createVNode(re._sfc_main,{modelValue:H.value,"onUpdate:modelValue":p[4]||(p[4]=b=>H.value=b),class:"sv-top-up-form__payment-methods","payment-methods":e.unref(X),required:"",error:e.unref(W).paymentMethodId.$errors,"payment-method-options":t.paymentMethodOptions,disabled:R.value,label:e.unref(u)({defaultMessage:"Payment method",description:"Label above the payment method that pays for the top-up, in the top-up modal",id:"topup_modal.payment_method_selector.label"}),onAddPaymentMethod:p[5]||(p[5]=b=>i("add-payment-method"))},null,8,["modelValue","payment-methods","error","payment-method-options","disabled","label"])])])])]))}}),oo={class:"sv-top-up-success grid grid-cols-1 gap-4"},no=e.defineComponent({__name:"TopUpModalSuccess",props:{addedValue:{type:Object},invoice:{type:Object}},setup(t){const{$t:o}=M.useIntl();return(n,a)=>(e.openBlock(),e.createElementBlock("div",oo,[t.invoice?(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),{key:0,"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold",class:"mb-2 block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Receipt",description:"Heading above the invoice a completed top-up produced",id:"topup_modal.success.receipt.heading"})),1)]),_:1}),e.createVNode(e.unref(Ne._sfc_main$1),{invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})):e.createCommentVNode("",!0)]))}});function ao({step:t,currentBalance:o,topUpValue:n}){const{$t:a,formatNumber:i}=M.useIntl(),u=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add payment method",description:"Title of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.title"}):t.value==="SUCCESS"?a({defaultMessage:"Top-up complete",description:"Title of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_title"}):a({defaultMessage:"Top up balance",description:"Title of the wallet top-up modal",id:"topup_modal.title"})),s=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add a new payment method for topping up your balance.",description:"Subtitle of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.subtitle"}):t.value==="SUCCESS"?a({defaultMessage:"Your payment went through.",description:"Subtitle of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_subtitle"}):a({defaultMessage:"Your current balance is {balance}.",description:"Subtitle of the top-up modal showing the current wallet balance",id:"topup_modal.subtitle"},{balance:o.value})),l=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Back",description:"Label of the button that leaves the add payment method step in the top-up modal",id:"topup_modal.back_button.label"}):a({defaultMessage:"Cancel",description:"Label of the button that closes the top-up modal",id:"topup_modal.cancel_button.label"})),c=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Save payment method",description:"Label of the confirm button in the top-up modal while adding a payment method",id:"topup_modal.save_payment_method.label"}):t.value==="SUCCESS"?a({defaultMessage:"Done",description:"Label of the button that dismisses the top-up modal once the top-up has been charged",id:"topup_modal.done_button.label"}):n.value?a({defaultMessage:"Top up balance with {value}",description:"Label of the confirm button in the top-up modal once an amount is entered",id:"topup_modal.confirm_button.label"},{value:se.formatWalletBalanceValue(a,i,n.value)}):a({defaultMessage:"Top up balance",description:"Label of the confirm button in the top-up modal while no amount is entered",id:"topup_modal.confirm_button.empty.label"}));return{title:u,subTitle:s,cancelButtonText:l,confirmButtonText:c}}function fe({isOpen:t,customer:o,subscriptionId:n,onError:a}){const{paymentMethodOptions:i,get:u,isPending:s}=lt.usePaymentMethodOptions(),l=async()=>{const h=o.value;if(!(!t.value||!h))try{await u({customerId:h.id,...n!=null&&n.value?{subscriptionId:n.value}:{},country:st.getCustomerCountry(h)})}catch(_){a==null||a(_)}};e.watch(()=>[t.value,o.value,n==null?void 0:n.value],()=>void l(),{immediate:!0});const c=e.computed(()=>s.value?void 0:i.value);return{paymentMethodOptions:i,settledOptions:c,isPending:s,load:l}}function io(t){const o=e.ref(0),n=i=>{o.value=(i==null?void 0:i.offsetHeight)??0},a=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i=>{var s;const u=(s=i[0])==null?void 0:s.target;n(u instanceof HTMLElement?u:void 0)});return e.watch(t,(i,u)=>{u&&(a==null||a.unobserve(u)),n(i),i&&(a==null||a.observe(i))},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{a==null||a.disconnect()}),o}const uo=["inert"],so=300,lo="1rem",ro=e.defineComponent({__name:"SlidingPanes",props:{panes:{type:Array},current:{type:String}},setup(t){const o=t,n=e.ref(!1);let a;e.watch(()=>o.current,()=>{n.value=!0,clearTimeout(a),a=setTimeout(()=>{n.value=!1},so)}),e.onBeforeUnmount(()=>{clearTimeout(a)});const i=e.ref({}),u={},s=_=>u[_]??(u[_]=C=>{i.value[_]=C instanceof HTMLElement?C:void 0}),l=e.computed(()=>i.value[o.current]),c=io(l),h=e.computed(()=>{const _=o.panes.indexOf(o.current);return _>0?`translateX(calc(${-_} * (100% + ${lo})))`:"translateX(0px)"});return(_,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",n.value?"transition-[height] duration-300 ease-in-out motion-reduce:transition-none":""]),style:e.normalizeStyle(e.unref(c)?{height:`${e.unref(c)}px`}:void 0)},[e.createElementVNode("div",{class:"sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",style:e.normalizeStyle({transform:h.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.panes,f=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"sv-sliding-panes__pane w-full shrink-0",inert:f!==t.current||void 0},[e.createElementVNode("div",{ref_for:!0,ref:s(f)},[e.renderSlot(_.$slots,f)],512)],8,uo))),128))],4)],6))}}),ve=e.defineComponent({inheritAttrs:!1,__name:"OnDemandPaymentModalShell",props:{showModal:{type:Boolean},title:{type:String},subTitle:{type:String},cancelButtonText:{type:String},confirmButtonText:{type:String},isPending:{type:Boolean},panes:{type:Array},step:{type:String},addPaymentMethodPane:{type:String},customer:{type:Object},paymentMethodOptions:{type:Array},isPaymentMethodOptionsPending:{type:Boolean},isAddingPaymentMethod:{type:Boolean}},emits:["confirm","cancel","payment-success","payment-failed"],setup(t,{expose:o}){const n=t,a=e.ref(),i=e.computed(()=>n.panes.filter(u=>u!==n.addPaymentMethodPane));return o({submit:()=>{var u;return(u=a.value)==null?void 0:u.submit()},isSaving:e.computed(()=>{var u;return!!((u=a.value)!=null&&u.isSaving)})}),(u,s)=>(e.openBlock(),e.createBlock(e.unref(Ee.Modal),{"no-click-away":"","show-modal":t.showModal,size:"lg",title:t.title,"sub-title":t.subTitle,"cancel-button-text":t.cancelButtonText,"confirm-button-text":t.confirmButtonText,"is-loading":t.isPending,onConfirm:s[2]||(s[2]=l=>u.$emit("confirm")),onClose:s[3]||(s[3]=l=>u.$emit("cancel"))},e.createSlots({body:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({class:"grid grid-cols-1 gap-4 pb-4"},u.$attrs),[e.createVNode(ro,{panes:t.panes,current:t.step},e.createSlots({[t.addPaymentMethodPane]:e.withCtx(()=>[e.createVNode(re._sfc_main$1,{ref_key:"paneRef",ref:a,customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isPaymentMethodOptionsPending,"is-active":t.isAddingPaymentMethod,onSuccess:s[0]||(s[0]=l=>u.$emit("payment-success")),onFailure:s[1]||(s[1]=l=>u.$emit("payment-failed",l))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:2},[e.renderList(i.value,l=>({name:l,fn:e.withCtx(()=>[e.renderSlot(u.$slots,l)])}))]),1032,["panes","current"])],16)]),_:2},[u.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"footer")]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-loading"]))}}),je=t=>{var o;return(((o=t==null?void 0:t.wallet)==null?void 0:o.auto_top_up_configs)??[]).find(({status:n})=>n==="ACTIVE")},Qe=t=>t?{status:t.status,threshold:t.threshold,...t.topup_amount&&{topup_amount:t.topup_amount}}:void 0,Ge=(t,o=[])=>{if(t!=null&&t.pricing_item_id&&t.pricing_plan_schedule_id)return{pricingItemId:t.pricing_item_id,pricingPlanScheduleId:t.pricing_plan_schedule_id};const n=o.find(({flexiblePricing:a,pricingPlanScheduleId:i})=>a&&i);return n!=null&&n.pricingPlanScheduleId?{pricingItemId:n.pricingItemId,pricingPlanScheduleId:n.pricingPlanScheduleId}:void 0},Ke=({rule:t,walletBalanceItem:o,chargeTarget:n,paymentMethodId:a})=>{var u,s;const i=!!(((u=t==null?void 0:t.threshold)==null?void 0:u.amount)??((s=t==null?void 0:t.threshold)==null?void 0:s.credits));if(!(!t||!i||!(o!=null&&o.wallet_id)||!n||!a))return{wallet_id:o.wallet_id,status:t.status,threshold:t.threshold,pricing_plan_schedule_id:n.pricingPlanScheduleId,pricing_item_id:n.pricingItemId,payment_method_id:a,...t.topup_amount&&{topup_amount:t.topup_amount}}};function he({step:t,name:o,returnTo:n}){const a=e.ref();return{paneRef:a,isActive:e.computed(()=>t.value===o),isSaving:e.computed(()=>{var i;return!!((i=a.value)!=null&&i.isSaving)}),open:()=>{t.value=o},leave:()=>{t.value=n},submit:()=>{var i;return(i=a.value)==null?void 0:i.submit()}}}function Xe(){const t=M.createRequestService(),o=M.useConfig(),n="/portal/auto-top-up-configs";function a(l){return t({url:`${o.apiUrls.config}${n}`,query:{...l},isCollection:!0})}function i(l){return t({url:`${o.apiUrls.config}${n}/${l}`})}function u(l){return t({url:`${o.apiUrls.config}${n}`,options:{method:"POST"},data:l})}function s(l){return t({url:`${o.apiUrls.config}${n}/${l}/deactivate`,options:{method:"POST"}})}return{getAutoTopUpConfigs:a,getAutoTopUpConfig:i,createAutoTopUpConfig:u,deactivateAutoTopUpConfig:s}}function Je(){const{createAutoTopUpConfig:t}=Xe(),o=M.useLogger(),n=e.ref(!1);return{save:async i=>{if(!i||n.value)return{saved:!1};n.value=!0;try{return await t(i),{saved:!0}}catch(u){return o.error("AUTO_TOP_UP_SAVE_FAILED","Failed to save the automatic top-up rule",{},u),{saved:!1,error:u}}finally{n.value=!1}},isSaving:n}}const co={key:0,class:"mb-4"},po={class:"sr-only"},mo={class:"flex flex-col gap-2"},fo=e.defineComponent({__name:"TopUpModal",props:{showModal:{type:Boolean},selectedBalanceItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object},subscriptions:{type:Array}},emits:["confirm","close","auto-top-up-saved","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:u}=te(),s=e.computed(()=>Qe(je(n.selectedBalanceItem))),l=e.computed(()=>u(n.selectedBalanceItem)),c=e.computed(()=>Pt(n.selectedBalanceItem,n.subscriptions??[])),h=e.ref();e.watch(c,B=>{var E;B.some(({id:oe})=>oe===h.value)||(h.value=(E=B[0])==null?void 0:E.id)},{immediate:!0});const _=e.computed(()=>c.value.length>1),C=e.computed(()=>c.value.map(({id:B,name:$})=>({value:B,label:$}))),f=e.computed(()=>Object.fromEntries(c.value.flatMap(({id:B,enabledPricingIds:$})=>{const E=(n.subscriptions??[]).find(({id:oe})=>oe===B);return E?[[B,{subscription:E,enabledPricingIds:$}]]:[]}))),v=e.computed(()=>{var $;if(!n.selectedBalanceItem||!(($=n.subscriptions)!=null&&$.length))return n.selectedBalanceItem;const B=c.value.find(({id:E})=>E===h.value);return B?Ut(n.selectedBalanceItem,B.scheduleIds):{...n.selectedBalanceItem,charge_on_demand_pricing_items:[]}}),m=e.computed(()=>Ve(v.value)),{paymentMethodOptions:w,settledOptions:P,isPending:q}=fe({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),g=e.ref("TOP_UP"),d=e.computed(()=>(n.paymentMethods??[]).length>0),T=e.computed(()=>!q.value&&(w.value??[]).length===0),x=e.computed(()=>g.value==="TOP_UP"&&!d.value&&T.value),U=e.ref(),A=e.ref(),y=()=>{L(),a("payment-success")},{paneRef:S,isActive:I,isSaving:Q,open:R,leave:L,submit:G}=he({step:g,name:"ADD_PAYMENT_METHOD",returnTo:"TOP_UP"}),{save:W}=Je(),Y=e.ref(),K=e.computed(()=>{var B;return(B=Y.value)==null?void 0:B.chargedValue}),H=e.computed(()=>{var B;return Q.value||!!((B=Y.value)!=null&&B.isCharging)}),{title:X,subTitle:r,cancelButtonText:p,confirmButtonText:b}=ao({step:g,currentBalance:l,topUpValue:K}),N=()=>{var B;if(I.value){G();return}(B=Y.value)==null||B.submit()},V=async({rule:B,paymentMethodId:$})=>{const{saved:E}=await W(Ke({rule:B,walletBalanceItem:n.selectedBalanceItem,chargeTarget:Ge(void 0,m.value),paymentMethodId:$}));E&&a("auto-top-up-saved")},k=B=>{var $;U.value=B,A.value=($=Y.value)==null?void 0:$.chargedValue,g.value="SUCCESS"},D=()=>{a("confirm"),a("close")},F=()=>{if(!H.value){if(I.value){L();return}if(g.value==="SUCCESS"){D();return}a("close")}},ge=e.ref(0);return e.watch(()=>n.showModal,B=>{B&&(g.value="TOP_UP",U.value=void 0,A.value=void 0,ge.value+=1)}),(B,$)=>(e.openBlock(),e.createBlock(ve,{ref_key:"addPaymentMethodRef",ref:S,"show-modal":t.showModal,title:e.unref(X),"sub-title":e.unref(r),"cancel-button-text":e.unref(p),"confirm-button-text":e.unref(b),"is-pending":H.value,panes:e.unref(xt),step:g.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(w),"is-payment-method-options-pending":e.unref(q),"is-adding-payment-method":e.unref(I),onConfirm:N,onCancel:F,onPaymentSuccess:y,onPaymentFailed:$[1]||($[1]=E=>B.$emit("payment-failed",E))},e.createSlots({TOP_UP:e.withCtx(()=>[_.value?(e.openBlock(),e.createElementBlock("div",co,[e.createVNode(e.unref(Ue._sfc_main),{modelValue:h.value,"onUpdate:modelValue":$[0]||($[0]=E=>h.value=E),class:"sv-topup-modal__subscription",name:"top-up-subscription",direction:"column",required:"",options:C.value,"show-radio":!1,label:e.unref(i)({defaultMessage:"Subscription to top up",description:"Label above the list of subscriptions a top-up can be charged against, in the top-up modal",id:"topup_modal.subscriptions.label"})},{prefix:e.withCtx(({optionValue:E})=>[f.value[String(E)]?(e.openBlock(),e.createBlock(ut._sfc_main,{key:0,class:"sv-topup-modal__subscription-option grow","no-spacing":"",subscription:f.value[String(E)].subscription,"enabled-pricing-ids":f.value[String(E)].enabledPricingIds},null,8,["subscription","enabled-pricing-ids"])):e.createCommentVNode("",!0)]),label:e.withCtx(({option:E})=>[e.createElementVNode("span",po,e.toDisplayString(E.label),1)]),_:1},8,["modelValue","options","label"])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(to,{key:ge.value,ref_key:"topUpFormRef",ref:Y,"top-up-pricing-items":m.value,"payment-methods":t.paymentMethods,"auto-top-up-config":s.value,"payment-method-options":e.unref(P),onAddPaymentMethod:e.unref(R),onSuccess:k,onSaveAutoTopUp:V},null,8,["top-up-pricing-items","payment-methods","auto-top-up-config","payment-method-options","onAddPaymentMethod"]))]),SUCCESS:e.withCtx(()=>[U.value?(e.openBlock(),e.createBlock(no,{key:0,"added-value":A.value,invoice:U.value},null,8,["added-value","invoice"])):e.createCommentVNode("",!0)]),_:2},[g.value==="SUCCESS"||x.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",mo,[g.value==="SUCCESS"?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"lg","data-testid":"done",onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(z._sfc_main),{size:"lg",disabled:"","data-testid":"confirm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1}),e.createVNode(e.unref(z._sfc_main),{size:"lg",intent:"subtle","data-testid":"cancel",onClick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)]),_:1})],64))])]),key:"0"}:void 0]),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","is-adding-payment-method"]))}}),vo=["AUTO_TOP_UP","ADD_PAYMENT_METHOD"],ho={class:"grid grid-cols-1 gap-4"},go=e.defineComponent({__name:"AutoTopUpModal",props:{showModal:{type:Boolean},walletBalanceItem:{type:Object},topUpItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object}},emits:["saved","close","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:u}=te(),s=e.ref("AUTO_TOP_UP"),l=e.computed(()=>u(n.walletBalanceItem)),c=e.computed(()=>Ve(n.walletBalanceItem)),h=e.computed(()=>qe(c.value)),_=e.computed(()=>je(n.walletBalanceItem)),C=e.computed(()=>Qe(_.value)),f=e.computed(()=>Ge(n.topUpItem,c.value)),v=e.ref(),m=e.computed(()=>{var D,F;const k=(F=(D=v.value)==null?void 0:D.rule)==null?void 0:F.topup_amount;return k!=null&&k.quantity&&f.value?[{pricing_item_id:f.value.pricingItemId,flexible_amount:k}]:void 0}),w=e.computed(()=>{var k;return(k=f.value)==null?void 0:k.pricingPlanScheduleId}),P=e.ref(),{sortedPaymentMethods:q}=ze({paymentMethods:e.computed(()=>n.paymentMethods),selectedPaymentMethodId:P,preferredPaymentMethodId:e.computed(()=>{var k;return(k=_.value)==null?void 0:k.payment_method_id})}),{paymentMethodOptions:g,settledOptions:d,isPending:T}=fe({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),{paneRef:x,isActive:U,isSaving:A,open:y,leave:S,submit:I}=he({step:s,name:"ADD_PAYMENT_METHOD",returnTo:"AUTO_TOP_UP"}),{save:Q,isSaving:R}=Je(),L=e.computed(()=>A.value||R.value),G=e.reactive({paymentMethodId:e.computed(()=>P.value??null)}),W=O.useValidation({paymentMethodId:{required:O.common.withMessage(()=>i({defaultMessage:"Select a payment method to pay for automatic top-ups.",description:"Error shown in the auto top-up modal when no payment method is selected",id:"auto_topup_modal.payment_method.required"}),O.required)}},G),Y=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Title of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.title"}):i({defaultMessage:"Automatic top-up",description:"Title of the automatic wallet top-up modal",id:"auto_topup_modal.title"})),K=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"This method pays for every automatic top-up.",description:"Subtitle of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.subtitle"}):i({defaultMessage:"Your current balance is {balance}. Enable auto top so you can stay productive",description:"Subtitle of the automatic wallet top-up modal, naming the balance",id:"auto_topup_modal.subtitle"},{balance:l.value})),H=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Back",description:"Button returning from adding a payment method to the auto top-up rule",id:"auto_topup_modal.add_payment_method.cancel"}):i({defaultMessage:"Cancel",description:"Button dismissing the auto top-up modal",id:"auto_topup_modal.cancel"})),X=e.computed(()=>s.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Button storing the payment method being added in the auto top-up modal",id:"auto_topup_modal.add_payment_method.confirm"}):i({defaultMessage:"Save",description:"Button saving the automatic top-up rule",id:"auto_topup_modal.confirm"}));async function r(){var F;if(W.value.$touch(),L.value)return;const{saved:k,error:D}=await Q(Ke({rule:(F=v.value)==null?void 0:F.validate(),walletBalanceItem:n.walletBalanceItem,chargeTarget:f.value,paymentMethodId:P.value}));if(k){a("saved"),a("close");return}D&&a("payment-failed",D)}const p=()=>{if(U.value){I();return}r()},b=()=>{S(),a("payment-success")},N=()=>{if(!L.value){if(U.value){S();return}a("close")}},V=e.ref(0);return e.watch(()=>n.showModal,k=>{k&&(s.value="AUTO_TOP_UP",P.value=void 0,V.value+=1)}),(k,D)=>(e.openBlock(),e.createBlock(ve,{ref_key:"addPaymentMethodRef",ref:x,"show-modal":t.showModal,title:Y.value,"sub-title":K.value,"cancel-button-text":H.value,"confirm-button-text":X.value,"is-pending":L.value,panes:e.unref(vo),step:s.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(g),"is-payment-method-options-pending":e.unref(T),"is-adding-payment-method":e.unref(U),onConfirm:p,onCancel:N,onPaymentSuccess:b,onPaymentFailed:D[1]||(D[1]=F=>k.$emit("payment-failed",F))},{AUTO_TOP_UP:e.withCtx(()=>[e.createElementVNode("div",ho,[h.value?(e.openBlock(),e.createBlock(He,e.mergeProps({key:V.value,ref_key:"autoTopUpFormRef",ref:v,class:"sv-auto-topup-modal__rule"},h.value,{config:C.value,"always-enabled":"",disabled:L.value}),null,16,["config","disabled"])):e.createCommentVNode("",!0),e.createVNode(Fe,{"pricing-plan-schedule-id":w.value,"pricing-items":m.value},null,8,["pricing-plan-schedule-id","pricing-items"]),e.createVNode(re._sfc_main,{modelValue:P.value,"onUpdate:modelValue":D[0]||(D[0]=F=>P.value=F),class:"sv-auto-topup-modal__payment-method","payment-methods":e.unref(q),"payment-method-options":e.unref(d),disabled:L.value,error:e.unref(W).paymentMethodId.$errors,label:e.unref(i)({defaultMessage:"Pay automatic top-ups with",description:"Label above the payment method an automatic top-up is charged to",id:"auto_topup_modal.payment_method.label"}),onAddPaymentMethod:e.unref(y)},null,8,["modelValue","payment-methods","payment-method-options","disabled","error","label","onAddPaymentMethod"])])]),_:1},8,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),_o={class:"sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3"},yo=e.defineComponent({__name:"AutoTopUpCancellationModal",props:{showModal:{type:Boolean},config:{type:Object}},emits:["confirmed","close"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),u=M.useLogger(),{formatValue:s}=te(),{deactivateAutoTopUpConfig:l}=Xe(),c=e.ref(!1),h=e.ref(!1);e.watch(()=>n.showModal,v=>{v&&(h.value=!1)});const _=e.computed(()=>{var w,P;const v=(w=n.config)==null?void 0:w.threshold,m=(P=n.config)==null?void 0:P.topup_amount;return!(v!=null&&v.amount)&&!(v!=null&&v.credits)?i({defaultMessage:"Your balance will no longer be topped up automatically. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.explanation"}):m?i({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.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",id:"auto_topup_cancellation_modal.explanation_with_amount"},{amount:s({amount:m}),threshold:s(v)}):i({defaultMessage:"Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",id:"auto_topup_cancellation_modal.explanation_with_threshold"},{threshold:s(v)})}),C=async()=>{var m;const v=(m=n.config)==null?void 0:m.id;if(!(!v||c.value)){c.value=!0,h.value=!1;try{await l(v),a("confirmed"),a("close")}catch(w){u.error("AUTO_TOP_UP_CANCELLATION_FAILED","Failed to turn off a wallet's automatic top-up",{},w),h.value=!0}finally{c.value=!1}}},f=()=>{c.value||a("close")};return(v,m)=>(e.openBlock(),e.createBlock(e.unref(Ee.Modal),{size:"sm","show-modal":t.showModal,"is-loading":c.value,"no-click-away":c.value,"no-backdrop-close":c.value,title:e.unref(i)({defaultMessage:"Turn off automatic top-up",description:"Title of the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.title"}),"confirm-button-text":e.unref(i)({defaultMessage:"Yes, turn it off",description:"Button confirming that a wallet automatic top-up is turned off",id:"auto_topup_cancellation_modal.confirm"}),"cancel-button-text":e.unref(i)({defaultMessage:"Cancel",description:"Button dismissing the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.cancel"}),onConfirm:C,onClose:f},{body:e.withCtx(()=>[e.createElementVNode("div",_o,[e.createVNode(e.unref(M._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-auto-topup-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.value),1)]),_:1}),h.value?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),{key:0,class:"sv-auto-topup-cancellation-modal__error sv-error",title:e.unref(i)({defaultMessage:"Could not turn off the automatic top-up. Please try again later.",description:"Error shown when turning a wallet automatic top-up off failed",id:"auto_topup_cancellation_modal.failed"})},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","is-loading","no-click-away","no-backdrop-close","title","confirm-button-text","cancel-button-text"]))}}),bo=e.defineComponent({inheritAttrs:!1,__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array},showTopUpButton:{type:Boolean},customer:{type:Object},paymentMethods:{type:Array},subscriptions:{type:Array}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),u=e.ref(),s=e.computed(()=>_e(n.walletBalances,u.value)),l=e.computed(()=>!!s.value),c=e.ref(),h=e.computed(()=>!!c.value),_=e.computed(()=>_e(n.walletBalances,c.value)),C=e.ref(),f=e.computed(()=>!!C.value);return(v,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isLoading?(e.openBlock(),e.createBlock(Pe._sfc_main,e.mergeProps({key:0,variant:"section"},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-loading min-h-48","data-testid":"customer-wallet-balances-skeleton"}),null,16)):t.hasError?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),e.mergeProps({key:1},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-error",title:e.unref(i)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})}),null,16,["title"])):t.walletBalances.length>0?(e.openBlock(),e.createBlock(e.unref(Ct),e.mergeProps({key:2},v.$attrs,{class:"sv-wallet-balances sv-root sv-component","customer-wallet-balances":t.walletBalances,"show-auto-top-up":"","show-manual-top-up":"",title:e.unref(i)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(t.walletBalances.length)}),onTopUp:m[0]||(m[0]=w=>u.value=w),onAutoTopUp:m[1]||(m[1]=w=>c.value=w),onCancelAutoTopUp:m[2]||(m[2]=w=>C.value=w)}),null,16,["customer-wallet-balances","title"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(fo,{key:3,"show-modal":l.value,"selected-balance-item":s.value,"payment-methods":t.paymentMethods,customer:t.customer,subscriptions:t.subscriptions,onClose:m[3]||(m[3]=w=>u.value=void 0),onConfirm:m[4]||(m[4]=w=>a("top-up-charged")),onPaymentSuccess:m[5]||(m[5]=w=>a("payment-method-stored")),onPaymentFailed:m[6]||(m[6]=w=>a("payment-failed",w))},null,8,["show-modal","selected-balance-item","payment-methods","customer","subscriptions"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(go,{key:4,"show-modal":h.value,"wallet-balance-item":_.value,"top-up-item":c.value,"payment-methods":t.paymentMethods,customer:t.customer,onClose:m[7]||(m[7]=w=>c.value=void 0),onSaved:m[8]||(m[8]=w=>a("auto-top-up-saved")),onPaymentSuccess:m[9]||(m[9]=w=>a("payment-method-stored")),onPaymentFailed:m[10]||(m[10]=w=>a("payment-failed",w))},null,8,["show-modal","wallet-balance-item","top-up-item","payment-methods","customer"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(yo,{key:5,"show-modal":f.value,config:C.value,onClose:m[11]||(m[11]=w=>C.value=void 0),onConfirmed:m[12]||(m[12]=w=>a("auto-top-up-cancelled"))},null,8,["show-modal","config"])):e.createCommentVNode("",!0)],64))}});exports._sfc_main=bo;exports._sfc_main$1=ve;exports.useAddPaymentMethodStep=he;exports.useChargeOnDemandInvoicePreview=Re;exports.useCustomerPaymentMethodOptions=fe;exports.useCustomerWalletBalances=St;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=require("vue"),E=require("./FormMessage.vue.es-dqATjC2N.js"),$=require("./customElements-C963-LtW.js"),w=require("./adyen-Druit6gz.js"),I=e=>{var i;return((i=e.integration.payment_gateway)==null?void 0:i.variant)==="ADYEN"},b=e=>{var i;return((i=e.integration.payment_gateway)==null?void 0:i.variant)==="STRIPE"},S=({selectedIntegration:e,paymentMethodOption:i})=>{var r,s;return e===((s=(r=i.integration)==null?void 0:r.payment_gateway)==null?void 0:s.variant)},F=(e,{excludeExpressPaymentMethods:i=!1}={})=>{var r;return I(e)?w.getAdyenDropInPaymentMethods(e,{excludeExpressPaymentMethods:i}).length>0:b(e)?!!((r=e.integration.payment_gateway.stripe)!=null&&r.public_key):!1},C=(e,i={})=>e.some(r=>F(r,i)),N=t.defineComponent({__name:"PaymentIntegrationForm",props:{customerId:{type:String},variant:{type:String},context:{type:Object},paymentMethodOptions:{type:Array},countryCode:{type:String},invoiceId:{type:String},amount:{type:Object},selectedOption:{type:String},email:{type:String},name:{type:String},validateOnSubmit:{type:Function},forceStorePaymentMethod:{type:Boolean},storePaymentMethod:{type:Boolean,default:void 0},redirectsOnSuccess:{type:Boolean},billingEntityName:{type:String}},emits:["select","payment-failed","payment-success","invalid","ready"],setup(e,{expose:i,emit:r}){const s=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PaymentIntegrationFormStripe-DUCJTIAq.js")).then(n=>n.default)),P=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PaymentIntegrationFormAdyen-HeA9XIj-.js")).then(n=>n.default)),l=e,c=r;i({submit:h});const{$t:k}=$.useIntl(),y=t.ref(),d=t.computed(()=>{var n,a;return y.value??((a=(n=l.paymentMethodOptions[0])==null?void 0:n.integration.payment_gateway)==null?void 0:a.variant)}),v=t.ref(new Map),u=t.ref(!1),g=({paymentGatewayVariant:n,paymentMethodType:a})=>{u.value=!1,y.value=n,c("select",{paymentGatewayVariant:n,paymentMethodType:a})},f=n=>a=>{var o;return v.value.set((o=n.integration.payment_gateway)==null?void 0:o.variant,a)},B=n=>{n==="NO_PAYMENT_METHOD"&&(u.value=!0),c("invalid",n)};function h(){var a;if(!d.value){u.value=!0,(a=l.validateOnSubmit)==null||a.call(l),c("invalid");return}const n=v.value.get(d.value);if(!n){c("invalid");return}n.submit()}return(n,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.paymentMethodOptions,o=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:o.integration.id},[t.unref(I)(o)?(t.openBlock(),t.createBlock(t.unref(P),{key:0,ref_for:!0,ref:f(o),context:e.context,"payment-method-option-response-entry":o,"country-code":e.countryCode,"customer-id":e.customerId,variant:e.variant,amount:e.amount,"invoice-id":e.invoiceId,selected:t.unref(S)({selectedIntegration:d.value,paymentMethodOption:o}),"validate-on-submit":e.validateOnSubmit,"force-store-payment-method":e.forceStorePaymentMethod,"store-payment-method":e.storePaymentMethod,"redirects-on-success":e.redirectsOnSuccess,"billing-entity-name":e.billingEntityName,onSelect:g,onPaymentFailed:a[0]||(a[0]=m=>n.$emit("payment-failed",m)),onPaymentSuccess:a[1]||(a[1]=m=>n.$emit("payment-success")),onInvalid:B,onReady:a[2]||(a[2]=m=>n.$emit("ready"))},null,8,["context","payment-method-option-response-entry","country-code","customer-id","variant","amount","invoice-id","selected","validate-on-submit","force-store-payment-method","store-payment-method","redirects-on-success","billing-entity-name"])):t.unref(b)(o)?(t.openBlock(),t.createBlock(t.unref(s),{key:1,ref_for:!0,ref:f(o),context:e.context,"payment-method-option-response-entry":o,"country-code":e.countryCode,"customer-id":e.customerId,variant:e.variant,amount:e.amount,"invoice-id":e.invoiceId,selected:t.unref(S)({selectedIntegration:d.value,paymentMethodOption:o}),email:e.email,name:e.name,"validate-on-submit":e.validateOnSubmit,"force-store-payment-method":e.forceStorePaymentMethod,"store-payment-method":e.storePaymentMethod,"redirects-on-success":e.redirectsOnSuccess,"billing-entity-name":e.billingEntityName,onSelect:g,onPaymentFailed:a[3]||(a[3]=m=>n.$emit("payment-failed",m)),onPaymentSuccess:a[4]||(a[4]=m=>n.$emit("payment-success")),onInvalid:a[5]||(a[5]=m=>n.$emit("invalid")),onReady:a[6]||(a[6]=m=>n.$emit("ready"))},null,8,["context","payment-method-option-response-entry","country-code","customer-id","variant","amount","invoice-id","selected","email","name","validate-on-submit","force-store-payment-method","store-payment-method","redirects-on-success","billing-entity-name"])):t.createCommentVNode("",!0)],64))),128)),u.value?(t.openBlock(),t.createBlock(t.unref(E._sfc_main),{key:0,variant:"error",class:"mt-2"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(k)({defaultMessage:"Select a payment method",id:"payment_integration_form.select_payment_method_error",description:"Error shown when no payment method is selected"})),1)]),_:1})):t.createCommentVNode("",!0)],64))}});exports._sfc_main=N;exports.hasRenderablePaymentIntegration=C;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),re=require("./useService-H7BjLg8P.js"),N=require("./customElements-C963-LtW.js"),F=require("./PaymentErrorCard.vue_vue_type_script_setup_true_lang-B1yGKkWN.js"),ie=require("./payments-BmiHMlQt.js"),U=require("./url-vloPOiXd.js"),de=require("./paymentMethods-AL2U_byg.js"),y=require("./adyen-Druit6gz.js"),se=require("./adyenSdk-BP2XXzeJ.js"),ce=require("./useExperimentalFeature-COOU6IZd.js"),Y=require("./paymentFailure-Cki8c5BX.js"),ue=".adyen-checkout__payment-method--sepadirectdebit .adyen-checkout__payment-method__details__content";function me(u){return(u==null?void 0:u.querySelector(ue))??null}function pe(u,p){return!!u&&!!p&&!u.contains(p)}const ye=u=>{let p={};return u==="TOKENIZE"&&(p={"en-US":{payButton:"Add payment method",confirmPurchase:"Add payment method"},"fr-FR":{payButton:"Ajouter un moyen de paiement",confirmPurchase:"Ajouter un moyen de paiement"},"de-DE":{payButton:"Zahlungsmethode hinzufügen",confirmPurchase:"Zahlungsmethode hinzufügen"},"it-IT":{payButton:"Aggiungi metodo di pagamento",confirmPurchase:"Aggiungi metodo di pagamento"},"es-ES":{payButton:"Añadir método de pago",confirmPurchase:"Añadir método de pago"},"nl-NL":{payButton:"Betaalmethode toevoegen",confirmPurchase:"Betaalmethode toevoegen"},"pt-BR":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pt-PT":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pl-PL":{payButton:"Dodaj metodę płatności",confirmPurchase:"Dodaj metodę płatności"},"ru-RU":{payButton:"Добавить способ оплаты",confirmPurchase:"Добавить способ оплаты"},"sv-SE":{payButton:"Lägg till betalningsmetod",confirmPurchase:"Lägg till betalningsmetod"},"da-DK":{payButton:"Tilføj betalingsmetode",confirmPurchase:"Tilføj betalingsmetode"},"fi-FI":{payButton:"Lisää maksutapa",confirmPurchase:"Lisää maksutapa"},"no-NO":{payButton:"Legg til betalingsmetode",confirmPurchase:"Legg til betalingsmetode"},"cs-CZ":{payButton:"Přidat platební metodu",confirmPurchase:"Přidat platební metodu"},"hu-HU":{payButton:"Fizetési mód hozzáadása",confirmPurchase:"Fizetési mód hozzáadása"},"ro-RO":{payButton:"Adăugați metodă de plată",confirmPurchase:"Adăugați metodă de plată"},"ja-JP":{payButton:"支払い方法を追加",confirmPurchase:"支払い方法を追加"},"ko-KR":{payButton:"결제 수단 추가",confirmPurchase:"결제 수단 추가"},"zh-CN":{payButton:"添加支付方式",confirmPurchase:"添加支付方式"},"zh-TW":{payButton:"新增付款方式",confirmPurchase:"新增付款方式"},ar:{payButton:"إضافة وسيلة دفع",confirmPurchase:"إضافة وسيلة دفع"},"hr-HR":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"el-GR":{payButton:"Προσθήκη μεθόδου πληρωμής",confirmPurchase:"Προσθήκη μεθόδου πληρωμής"},"sk-SK":{payButton:"Pridať spôsob platby",confirmPurchase:"Pridať spôsob platby"},"sl-SI":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"bg-BG":{payButton:"Добавяне на начин на плащане",confirmPurchase:"Добавяне на начин на плащане"},"ca-ES":{payButton:"Afegir mètode de pagament",confirmPurchase:"Afegir mètode de pagament"},"et-EE":{payButton:"Lisa makseviis",confirmPurchase:"Lisa makseviis"},"lv-LV":{payButton:"Pievienot maksājuma veidu",confirmPurchase:"Pievienot maksājuma veidu"},"lt-LT":{payButton:"Pridėti mokėjimo metodą",confirmPurchase:"Pridėti mokėjimo metodą"}}),p},le={class:"sv-sepa-mandate mt-3","data-testid":"sepa-mandate-notice"},he=n.defineComponent({__name:"SepaMandateNotice",props:{billingEntityName:{type:String}},setup(u){const p=u,{$t:g}=N.useIntl(),i=n.computed(()=>g({defaultMessage:"SEPA Direct Debit mandate — recurring payments",description:"Title of the SEPA direct debit mandate shown inside the SEPA payment form",id:"payments.sepa_mandate.title"})),b=n.computed(()=>p.billingEntityName?g({defaultMessage:"By confirming this mandate, you authorise {billingEntityName} to instruct your bank to collect payments from your account, and you authorise your bank to carry out those instructions.",description:"SEPA direct debit mandate authorisation, naming the billing entity",id:"payments.sepa_mandate.authorisation"},{billingEntityName:p.billingEntityName}):g({defaultMessage:"By confirming this mandate, you authorise us to instruct your bank to collect payments from your account, and you authorise your bank to carry out those instructions.",description:"SEPA direct debit mandate authorisation, where the billing entity is not known",id:"payments.sepa_mandate.authorisation_unnamed"})),a=n.computed(()=>p.billingEntityName?g({defaultMessage:"This bank account will be used automatically to pay subsequent invoices from {billingEntityName} until you cancel this mandate.",description:"Explains that the SEPA mandate covers later invoices, naming the billing entity",id:"payments.sepa_mandate.recurrence"},{billingEntityName:p.billingEntityName}):g({defaultMessage:"This bank account will be used automatically to pay subsequent invoices until you cancel this mandate.",description:"Explains that the SEPA mandate covers later invoices, where the billing entity is not known",id:"payments.sepa_mandate.recurrence_unnamed"})),l=n.computed(()=>g({defaultMessage:"As part of your rights, you're entitled to a refund from your bank under the terms and conditions of your agreement with your bank. You must claim a refund within 8 weeks from the date your account was debited. You can request a statement from your bank explaining your rights.",description:"SEPA direct debit mandate refund rights, held against the payer's own bank",id:"payments.sepa_mandate.refund_rights"}));return(h,v)=>(n.openBlock(),n.createElementBlock("div",le,[n.createVNode(n.unref(N._sfc_main),{tag:"p",variant:"body-xs",class:"font-semibold"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(i.value),1)]),_:1}),n.createVNode(n.unref(N._sfc_main),{tag:"p",variant:"body-xs",color:"subtle"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value)+" "+n.toDisplayString(a.value)+" "+n.toDisplayString(l.value),1)]),_:1})]))}}),T="ADYEN",_e=n.defineComponent({__name:"PaymentIntegrationFormAdyen",props:{context:{type:Object},countryCode:{type:String},customerId:{type:String},invoiceId:{type:String},paymentMethodOptionResponseEntry:{type:Object},variant:{type:String},selected:{type:Boolean},amount:{type:Object},validateOnSubmit:{type:Function,default:()=>Promise.resolve(!0)},forceStorePaymentMethod:{type:Boolean},storePaymentMethod:{type:Boolean,default:void 0},redirectsOnSuccess:{type:Boolean},billingEntityName:{type:String}},emits:["select","payment-failed","payment-success","invalid","ready"],setup(u,{expose:p,emit:g}){let i=null,b=null;const a=u,l=g;p({submit:V});const h=n.ref(),v=n.ref(null),A=n.ref(null);let _;const R=n.ref(!1),P=n.ref(),d=N.useLogger(),{locale:j}=N.useIntl(),{authorizePayment:Z,getPaymentDetails:z}=ie.createPaymentsService(),{tokenizePaymentMethod:G}=de.createPaymentMethodsService(),O=ce.useExperimentalFeature(),M=n.computed(()=>{var e;return y.getAdyenDropInPaymentMethods(a.paymentMethodOptionResponseEntry,{excludeExpressPaymentMethods:!!((e=O==null?void 0:O.value)!=null&&e["express-checkout"])})}),S=n.computed(()=>M.value.length>0);function m(e){return Y.createPaymentFailureContext({gateway:T,paymentAcceptorId:a.paymentMethodOptionResponseEntry.payment_acceptor.id,variant:a.variant,invoiceId:a.invoiceId,customerId:a.customerId,...e})}function E(e){const t=Y.createPaymentFailureError(e);P.value=t,l("payment-failed",t)}function V(){if(!(i!=null&&i.isValid)){if(i&&!i.activePaymentMethod){l("invalid","NO_PAYMENT_METHOD");return}i==null||i.showValidation(),l("invalid");return}try{i.submit()}catch(e){d.error("ADYEN_SUBMIT_FAILED","Failed to submit Adyen drop-in",m({reason:"ADYEN_SUBMIT_FAILED",cause:e}),e),E({code:a.variant==="TOKENIZE"?"TOKENIZE_FAILED":"AUTHORIZATION_FAILED",message:"Failed to submit Adyen drop-in",error:e})}}async function K(){const e=y.toMinorUnitAmount(a.amount),t=M.value;return{checkoutConfig:{amount:e,clientKey:y.getAdyenClientKeyFromPaymentMethodOptionsResponse(a.paymentMethodOptionResponseEntry),environment:y.getAdyenEnvironmentFromPaymentMethodOptionsResponse(a.paymentMethodOptionResponseEntry,d),locale:j,translations:ye(a.variant),countryCode:a.countryCode,analytics:{enabled:!1},paymentMethodsResponse:{paymentMethods:t},onSubmit:J,onAdditionalDetails:X,onPaymentCompleted:ne,onPaymentFailed:te,onError:ae,showPayButton:!1},dropInConfig:{disableFinalAnimation:!0,paymentMethodsConfiguration:{card:{hasHolderName:!0,holderNameRequired:!0,enableStoreDetails:!a.forceStorePaymentMethod&&a.storePaymentMethod===void 0&&a.variant==="AUTHORIZE"},paypal:{intent:e.value>0?"authorize":"tokenize",showPayButton:!0}},openFirstPaymentMethod:a.selected,onSelect:({props:{type:r}})=>{r&&l("select",{paymentMethodType:r,paymentGatewayVariant:"ADYEN"})},onReady:()=>l("ready")}}}function H(){return Promise.all([se.loadAdyenSdk(),Promise.resolve().then(()=>require("./adyen-BJfC7N6f.js")).then(e=>e.default)])}async function D(){if(await L(),P.value=void 0,!S.value){const{payment_acceptor:e,integration:t}=a.paymentMethodOptionResponseEntry;d.warn("PAYMENT_INTEGRATION_NOT_RENDERABLE","No Adyen payment methods to offer",{fingerprint:["PAYMENT_INTEGRATION_NOT_RENDERABLE",e.id],paymentAcceptorId:e.id,integrationId:t.id,...a.invoiceId?{invoiceId:a.invoiceId}:{}});return}if(await n.nextTick(),!!h.value)try{const[e,t]=await H(),{checkoutConfig:r,dropInConfig:o}=await K();b=await e.AdyenCheckout(r),i=new e.Dropin(b,{...o,paymentMethodComponents:e.dropInPaymentMethodComponents}).mount(h.value),Q(t),q()}catch(e){d.error("PAYMENT_INTEGRATION_INITIALIZATION_FAILED","Failed to mount Adyen web drop-in",m({reason:"ADYEN_DROP_IN_MOUNT_FAILED",cause:e}),e),E({code:"PAYMENT_INTEGRATION_INITIALIZATION_FAILED",message:"Failed to mount Adyen web drop-in",error:e})}}function C(){const e=me(h.value);if(pe(e,v.value)){A.value=null,n.nextTick(()=>A.value=e);return}A.value=e}function q(){_==null||_.disconnect(),h.value&&(_=new MutationObserver(()=>C()),_.observe(h.value,{childList:!0,subtree:!0}),C())}function $(){_==null||_.disconnect(),_=void 0,A.value=null}async function L(){$(),i&&(i.unmount(),i=null),h.value&&(h.value.innerHTML="")}function Q(e){var r;const t=(r=h.value)==null?void 0:r.getRootNode();if(t instanceof ShadowRoot){const o=document.createElement("style");o.textContent=e,t.appendChild(o);const s=document.createElement("style");s.textContent=`
|
|
2
|
-
:host {
|
|
3
|
-
--adyen-sdk-color-background-secondary: transparent;
|
|
4
|
-
--adyen-sdk-color-background-primary: rgb(243 244 246 / 0.5);
|
|
5
|
-
--adyen-sdk-color-outline-secondary: #e5e7eb;
|
|
6
|
-
--adyen-sdk-color-outline-primary: transparent;
|
|
7
|
-
--adyen-sdk-color-background-always-dark: var(--color-primary-500);
|
|
8
|
-
--adyen-sdk-color-background-inverse-primary-hover: var(--color-primary-600);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.adyen-checkout__payment-method__image__wrapper {
|
|
12
|
-
width: 32px;
|
|
13
|
-
height: 32px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.adyen-checkout__payment-method__image {
|
|
17
|
-
height: 32px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.adyen-checkout__input-wrapper,
|
|
21
|
-
.adyen-checkout__input {
|
|
22
|
-
border-color: rgb(229, 231, 235);
|
|
23
|
-
border-radius: var(--adyen-sdk-border-radius-s, 4px);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.adyen-checkout__button,
|
|
27
|
-
.adyen-checkout__payment-method {
|
|
28
|
-
border-radius: var(--adyen-sdk-border-radius-s, 4px);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.adyen-checkout__payment-method {
|
|
32
|
-
border-color: rgb(229, 231, 235);
|
|
33
|
-
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
34
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.adyen-checkout__payment-method--selected {
|
|
38
|
-
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.adyen-checkout__payment-method:after {
|
|
42
|
-
transform: scale(0%);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.adyen-checkout__paypal__button {
|
|
46
|
-
display: block !important;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.adyen-checkout__payment-methods-list {
|
|
50
|
-
gap: 4px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.adyen-checkout__dropdown__list {
|
|
54
|
-
background-color: white;
|
|
55
|
-
border-radius: var(--adyen-sdk-border-radius-s, 4px);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.adyen-checkout__payment-method.adyen-checkout__payment-method--selected:after {
|
|
59
|
-
content: '✓';
|
|
60
|
-
width: 20px;
|
|
61
|
-
height: 20px;
|
|
62
|
-
border-radius: 10px;
|
|
63
|
-
background-color: var(--color-primary-600);
|
|
64
|
-
position: absolute;
|
|
65
|
-
top: 14px;
|
|
66
|
-
right: 14px;
|
|
67
|
-
text-align: center;
|
|
68
|
-
line-height: 20px;
|
|
69
|
-
color: white;
|
|
70
|
-
transform: scale(100%);
|
|
71
|
-
font-size: 12px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.adyen-checkout__payment-method__header {
|
|
75
|
-
padding: 8px 16px !important;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.adyen-checkout__payment-method__brands {
|
|
79
|
-
align-items: center;
|
|
80
|
-
}
|
|
81
|
-
.adyen-checkout__payment-method__brand-number {
|
|
82
|
-
line-height: 1;
|
|
83
|
-
}
|
|
84
|
-
.adyen-checkout__button__text {
|
|
85
|
-
font-size: 14px;
|
|
86
|
-
}
|
|
87
|
-
.adyen-checkout__store-details {
|
|
88
|
-
background: transparent;
|
|
89
|
-
padding: 0;
|
|
90
|
-
}
|
|
91
|
-
.adyen-checkout__checkbox__input + .adyen-checkout__checkbox__label:after {
|
|
92
|
-
border-color: rgb(229, 231, 235);
|
|
93
|
-
}
|
|
94
|
-
`,a.variant==="AUTHORIZE"&&(s.textContent+=`
|
|
95
|
-
.adyen-checkout__payment-method--cashapp .adyen-checkout-pm-details-wrapper {
|
|
96
|
-
display: none;
|
|
97
|
-
}
|
|
98
|
-
`),t.appendChild(s)}}function w(e,{paymentMethodType:t,actions:r,logFailure:o}){if(e.status==="ACTION_REQUIRED"&&e.action.payment_gateway_variant===T){const s=W(e,t);if(!s){o(e);return}i.handleAction(s),r.resolve({resultCode:e.action.adyen.result_code,action:s});return}if(e.payment.result==="AUTHORIZED"){R.value=!0,r.resolve({resultCode:"Authorised"});return}o(e),r.resolve({resultCode:"Error"})}function J(...e){const[t,r,o]=e;a.validateOnSubmit().then(s=>{if(!s){i==null||i.setStatus("ready"),l("invalid");return}const c=a.paymentMethodOptionResponseEntry.payment_acceptor.id,B={risk_data:y.transformObjectToAdyenObject(t.data.riskData),payment_method:y.transformObjectToAdyenObject(t.data.paymentMethod),browser_info:y.transformObjectToAdyenObject(t.data.browserInfo)};if(a.variant==="AUTHORIZE"){const k=y.createReturnUrl({paymentAcceptorId:a.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});Z({payment_acceptor_id:c,...a.customerId?{customer_id:a.customerId}:{},payment_gateway_variant:T,adyen:{...B,store_payment_method:a.storePaymentMethod??(a.forceStorePaymentMethod||t.data.storePaymentMethod)},amount:a.amount,...a.context?{context:a.context}:{},return_url:k}).then(f=>w(f,{paymentMethodType:t.data.paymentMethod.type,actions:o,logFailure:I=>d.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${c}`,m({reason:"PAYMENT_AUTHORIZATION_REJECTED",paymentMethodType:t.data.paymentMethod.type,cause:I}),I)})).catch(f=>{d.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${c}`,m({reason:"PAYMENT_AUTHORIZATION_FAILED",paymentMethodType:t.data.paymentMethod.type,cause:f}),f),o.resolve({resultCode:"Error"})});return}if(a.variant==="TOKENIZE"){const k=y.createReturnUrl({paymentAcceptorId:a.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});if(!a.customerId){d.error("TOKENIZATION_FAILED",`Missing customer id for payment acceptor with id ${c}`,m({reason:"TOKENIZATION_FAILED_NO_CUSTOMER"})),E({code:"TOKENIZE_FAILED",message:"Missing customer id"});return}G({customer_id:a.customerId,payment_acceptor_id:c,payment_gateway_variant:T,adyen:B,return_url:k}).then(f=>w(f,{paymentMethodType:t.data.paymentMethod.type,actions:o,logFailure:I=>d.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${c}`,m({reason:"TOKENIZATION_REJECTED",paymentMethodType:t.data.paymentMethod.type,cause:I}),I)})).catch(f=>{d.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${c}`,m({reason:"TOKENIZATION_FAILED",paymentMethodType:t.data.paymentMethod.type,cause:f}),f),o.resolve({resultCode:"Error"})})}}).catch(s=>{d.error("INTEGRATION_ERROR","Unhandled error in payment submission flow",m({reason:"ADYEN_SUBMISSION_FLOW_FAILED",cause:s}),s)})}function W(e,t){if(e.status!=="ACTION_REQUIRED")return;const r=e.action;if(r.payment_gateway_variant!="ADYEN")return;const o=r.adyen;return{paymentMethodType:(o==null?void 0:o.payment_method_type)??t,method:r.method,url:r.url,data:r.data,type:o==null?void 0:o.action_type,paymentData:o==null?void 0:o.payment_data,sdkData:o==null?void 0:o.sdk_data}}function X(...e){const[t]=e,r=t.data.details,o=t.data.paymentData;if(a.paymentMethodOptionResponseEntry.payment_acceptor.id){x({detailsResult:r?ee(r):void 0,paymentDataResult:o,paymentAcceptorId:a.paymentMethodOptionResponseEntry.payment_acceptor.id});return}d.error("PAYMENT_ACCEPTOR_MISSING","Additional details arrived without a payment acceptor id",m({reason:"PAYMENT_ACCEPTOR_MISSING"})),E({code:"REDIRECT_RESULT_PAYMENT_ACCEPTOR_MISSING",message:"Payment failed",error:e})}function ee(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}function te(...e){const[t]=e;d.error("ADYEN_PAYMENT_FAILED","Adyen reported the payment as failed",m({reason:"ADYEN_PAYMENT_FAILED",extra:{resultCode:t==null?void 0:t.resultCode}}),t),E({code:"AUTHORIZATION_FAILED",message:"Payment failed",error:t})}function ne(...e){const[,t]=e;t==null||t.unmount(),l("payment-success")}function ae(...e){const[t,r]=e;t.name!=="CANCEL"&&(d.error("INTEGRATION_ERROR","The Adyen drop-in reported an error",m({reason:"ADYEN_INTEGRATION_ERROR",cause:t,extra:{adyenErrorName:t.name}}),t),E({code:"UNKNOWN_ERROR",message:"Something went wrong",error:t}),r==null||r.unmount())}function x({detailsResult:e,threeDSResult:t,redirectResult:r,paymentDataResult:o,paymentAcceptorId:s}){z({paymentAcceptorId:s,paymentGatewayVariant:T,adyen:{...e?{details:e}:{},...r?{redirect_result:r}:{},...t?{threeds_result:t}:{},...o?{payment_data:o}:{}}}).then(c=>{if(c.payment_status==="FAILURE"){d.error("PAYMENT_DETAILS_REJECTED","Payment details returned a failed payment",m({reason:"PAYMENT_DETAILS_REJECTED",paymentAcceptorId:s,extra:{paymentStatus:c.payment_status}})),E({code:"AUTHORIZATION_FAILED",message:"Failed getting payment details",error:c});return}if(c.payment_status==="SUCCESS"){l("payment-success");return}}).catch(c=>{d.error("PAYMENT_DETAILS_CALL_FAILED","Failed fetching payment details",m({reason:"PAYMENT_DETAILS_CALL_FAILED",paymentAcceptorId:s,cause:c}),c),E({code:"PAYMENT_DETAILS_CALL_FAILED",message:"Failed fetching payment details",error:c})})}function oe(){const e=U.getQueryParam(y.REDIRECT_RESULT_QUERY_STRING),t=U.getQueryParam(y.PAYMENT_ACCEPTOR_ID_QUERY_STRING);if(e){if(!t){d.error("INVALID_REDIRECT_RESULT","Redirect result is set but payment acceptor id is missing",m({reason:"INVALID_REDIRECT_RESULT"})),E({code:"REDIRECT_RESULT_PAYMENT_ACCEPTOR_MISSING",message:"Redirect result is set but payment acceptor id is missing"});return}x({paymentAcceptorId:t,detailsResult:{redirectResult:decodeURI(e)}})}}return n.onMounted(()=>{D(),oe()}),n.onBeforeUnmount(()=>{L()}),n.watch(()=>a.paymentMethodOptionResponseEntry,(e,t)=>{re.isEqual(e,t)||D()},{deep:!0}),(e,t)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[R.value?(n.openBlock(),n.createBlock(F._sfc_main,{key:0,variant:u.variant,redirecting:u.redirectsOnSuccess},null,8,["variant","redirecting"])):P.value?(n.openBlock(),n.createBlock(F._sfc_main$1,{key:1,error:P.value},null,8,["error"])):n.createCommentVNode("",!0),S.value?(n.openBlock(),n.createElementBlock("div",{key:2,ref_key:"dropInContainerRef",ref:h},null,512)):n.createCommentVNode("",!0),A.value?(n.openBlock(),n.createBlock(n.Teleport,{key:3,to:A.value},[n.createElementVNode("div",{ref_key:"sepaNoticeRef",ref:v},[n.createVNode(he,{"billing-entity-name":u.billingEntityName},null,8,["billing-entity-name"])],512)],8,["to"])):n.createCommentVNode("",!0)],64))}});exports.default=_e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("./Section.vue.es-zVXBHAL6.js"),p=require("./customElements-C963-LtW.js"),h=require("./useTimePeriod.es-D2aiyfd-.js"),V=require("./formatting.es-C72Nsrmh.js"),E=require("./Expand.vue.es-BtM0EZEr.js"),v=require("./Button.vue.es-qGvnOKnK.js"),N=require("./StepInput.vue.es-mAnuCuDQ.js"),b=require("./Checkout.entry.ce-8EcavNgT.js"),T=require("./formControl-ODrpUvcA.js"),_=require("./PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-jrkraJMu.js"),x=require("./pricing-BVAld27Y.js"),M=require("./pricingPlanSchedule-BM8vsKkV.js"),S=require("./subscription-ZA62t4E9.js"),P={class:"grid grid-cols-2 gap-2"},w=e.defineComponent({__name:"TieredTableRow",props:{band:{type:Object},previousBand:{type:Object},isFirst:{type:Boolean},period:{type:Object}},setup(t){const o=t,{$t:n}=p.useIntl(),{formatTimePeriod:i}=h.useTimePeriod(),d=e.computed(()=>{var c;if(o.isFirst)return"0";if((c=o.previousBand)!=null&&c.tier_top_bound&&"number"in o.previousBand.tier_top_bound)return o.previousBand.tier_top_bound.number}),r=e.computed(()=>{if(!(!o.band.tier_top_bound||!("number"in o.band.tier_top_bound)))return o.band.tier_top_bound.number});return(c,l)=>(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(e.unref(p._sfc_main),{variant:"body-xs",color:"subtle",tag:"div"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"{lower_bound} - {upper_bound} seats",id:"seats.tiered_range_label",description:"The label showing the seat count range for a tiered pricing tier"},{lower_bound:d.value??"0",upper_bound:r.value})),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"> {lower_bound} seats",id:"seats.tiered_unbounded_range_label",description:"The label showing the unbounded seat count range (greater than) for a tiered pricing tier"},{lower_bound:d.value??"0"})),1)],64))]),_:1}),e.createVNode(e.unref(p._sfc_main),{variant:"body-xs",color:"subtle",tag:"div",class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.band.amount&&e.unref(n)({defaultMessage:"{amount} per seat/{period}",id:"seats.tiered_price_per_seat_period",description:"The price per seat and billing period label for a tiered pricing tier"},{amount:e.unref(V.formatAmount)(t.band.amount),period:t.period?e.unref(i)(t.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})]))}}),A={class:"grid grid-cols-1 gap-0.5 pt-1.5"},U=e.defineComponent({__name:"TieredTable",props:{bands:{type:Array},period:{type:Object}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",A,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bands,(i,d)=>(e.openBlock(),e.createBlock(w,{key:d,band:i,"is-first":d===0,"previous-band":d>0?t.bands[d-1]:void 0,period:t.period},null,8,["band","is-first","previous-band","period"]))),128))]))}});function C({pricings:t,pricingItemConfigId:o}){return e.computed(()=>{var d,r,c,l,m,a,u,s;const{config:n,productItem:i}=b.getPricingItemByPricingConfigId({pricings:t,pricingItemConfigId:o});return{billing:{period:(r=(d=n==null?void 0:n.billing_period_configs)==null?void 0:d[0])==null?void 0:r.billing_period,billedInAdvance:n==null?void 0:n.billing_in_advance},product:{name:i==null?void 0:i.name,description:i==null?void 0:i.description},pricing:{...((c=n==null?void 0:n.details)==null?void 0:c.pricing_type)==="FLAT"&&{amount:(a=(m=(l=n.details)==null?void 0:l.bands)==null?void 0:m[0])==null?void 0:a.amount},...((u=n==null?void 0:n.details)==null?void 0:u.pricing_type)==="TIERED"&&{tiered:{bands:(s=n.details)==null?void 0:s.bands}}}}})}const D={class:"flex flex-row-reverse gap-4 md:flex-row"},q={class:"w-24 shrink-0 justify-start md:w-32"},O=["tabindex"],F={key:0},z={key:0},I=e.defineComponent({__name:"SeatsEditorItem",props:e.mergeModels({modelValue:{type:Object},defaultValue:{type:Object},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:i}=p.useIntl(),{formatTimePeriod:d}=h.useTimePeriod(),r=e.ref(!1),c=e.computed({get:()=>+(n.value.number||b.FALLBACK_SEATS_NUMBER),set(a){n.value={...n.value,number:a!==void 0?a.toString():void 0}}}),l=C({pricings:o.pricings,pricingItemConfigId:n.value.pricing_item_config_id}),m=e.computed(()=>{var a,u;return!!((u=(a=l.value.pricing)==null?void 0:a.tiered)!=null&&u.bands)});return(a,u)=>{var s,g,y;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",D,[e.createElementVNode("div",q,[e.createVNode(e.unref(N._sfc_main),{modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=k=>c.value=k),size:"sm",min:(s=t.defaultValue)!=null&&s.number?+t.defaultValue.number:void 0},null,8,["modelValue","min"])]),e.createElementVNode("div",{class:e.normalizeClass(["flex grow flex-col",{"hover:cursor-pointer":m.value}]),tabindex:m.value?0:void 0,onClick:u[1]||(u[1]=k=>m.value?r.value=!r.value:void 0)},[e.createVNode(e.unref(p._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l).product.name||e.unref(i)({defaultMessage:"Seats",id:"seats.label",description:"The label for the seats input field"})),1)]),_:1}),e.unref(l).pricing.amount?(e.openBlock(),e.createBlock(e.unref(p._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"{amount} per seat/{period}",id:"seats.price_per_seat_period",description:"The price per seat and billing period label for seat-based pricing"},{amount:e.unref(V.formatAmount)(e.unref(l).pricing.amount),period:e.unref(l).billing.period?e.unref(d)(e.unref(l).billing.period,{short:!0,hideValueForExactPeriods:!0}):""})),1)]),_:1})):e.unref(l).pricing.tiered?(e.openBlock(),e.createBlock(e.unref(p._sfc_main),{key:1,tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Tiered pricing",id:"seats.tiered_pricing_label",description:"The label indicating tiered pricing structure for seats"}))+" ",1),e.createVNode(e.unref(v._sfc_main$1),{icon:"keyboard_arrow_down",size:"xs",class:e.normalizeClass(["absolute text-gray-400 transition ease-in-out",{"rotate-0":!r.value,"rotate-180":r.value}])},null,8,["class"])]),_:1})):e.createCommentVNode("",!0)],10,O)]),(y=(g=e.unref(l).pricing)==null?void 0:g.tiered)!=null&&y.bands?(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(e.unref(E._sfc_main),{"is-open":r.value},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(U,{bands:e.unref(l).pricing.tiered.bands,period:e.unref(l).billing.period},null,8,["bands","period"])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])])):e.createCommentVNode("",!0)])}}}),$={key:0,class:"grid grid-cols-1 gap-1"},L=e.defineComponent({__name:"SeatsEditor",props:e.mergeModels({modelValue:{type:Array},initialSeatsValues:{type:Array},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue"),n=i=>e.computed({get:()=>o.value[i],set:d=>{const r=o.value.slice();r[i]=d,o.value=r}});return(i,d)=>t.modelValue.length>0?(e.openBlock(),e.createElementBlock("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.modelValue,(r,c)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{key:c},{default:e.withCtx(()=>{var l;return[r.pricing_item_config_id?(e.openBlock(),e.createBlock(I,{key:r.pricing_item_config_id,modelValue:n(c).value,"onUpdate:modelValue":m=>n(c).value=m,"default-value":(l=t.initialSeatsValues)==null?void 0:l[c],pricings:t.pricings},null,8,["modelValue","onUpdate:modelValue","default-value","pricings"])):e.createCommentVNode("",!0)]}),_:2},1024))),128))])):e.createCommentVNode("",!0)}}),j={class:"flex flex-row-reverse gap-4 md:flex-row"},R={class:"w-24 shrink-0 justify-start md:w-32"},Y={class:"flex grow flex-col"},K=e.defineComponent({__name:"UnitsEditorItem",props:e.mergeModels({modelValue:{type:Object},defaultValue:{type:Object},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:i}=p.useIntl(),d=e.computed({get:()=>+(n.value.number||b.FALLBACK_UNITS_NUMBER),set(c){n.value={...n.value,number:c!==void 0?c.toString():void 0}}}),r=C({pricings:o.pricings,pricingItemConfigId:n.value.pricing_item_config_id});return(c,l)=>{var m;return e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",R,[e.createVNode(e.unref(N._sfc_main),{modelValue:d.value,"onUpdate:modelValue":l[0]||(l[0]=a=>d.value=a),size:"sm",min:(m=t.defaultValue)!=null&&m.number?+t.defaultValue.number:void 0},null,8,["modelValue","min"])]),e.createElementVNode("div",Y,[e.createVNode(e.unref(p._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r).product.name||e.unref(i)({defaultMessage:"Units",id:"units.label",description:"The label for the one-off flat item units input field"})),1)]),_:1}),e.unref(r).pricing.amount?(e.openBlock(),e.createBlock(e.unref(p._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"{amount} per unit",id:"units.price_per_unit",description:"The price per unit label for one-off flat pricing"},{amount:e.unref(V.formatAmount)(e.unref(r).pricing.amount)})),1)]),_:1})):e.createCommentVNode("",!0)])])}}}),X={key:0,class:"grid grid-cols-1 gap-1"},H=e.defineComponent({__name:"UnitsEditor",props:e.mergeModels({modelValue:{type:Array},initialUnitsValues:{type:Array},pricings:{type:Array}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue"),n=i=>e.computed({get:()=>o.value[i],set:d=>{const r=o.value.slice();r[i]=d,o.value=r}});return(i,d)=>t.modelValue.length>0?(e.openBlock(),e.createElementBlock("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.modelValue,(r,c)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{key:c},{default:e.withCtx(()=>{var l;return[r.pricing_item_config_id?(e.openBlock(),e.createBlock(K,{key:r.pricing_item_config_id,modelValue:n(c).value,"onUpdate:modelValue":m=>n(c).value=m,"default-value":(l=t.initialUnitsValues)==null?void 0:l[c],pricings:t.pricings},null,8,["modelValue","onUpdate:modelValue","default-value","pricings"])):e.createCommentVNode("",!0)]}),_:2},1024))),128))])):e.createCommentVNode("",!0)}}),J={class:"p-1"},Q={class:"grid grid-cols-1 gap-1 pt-1"},W=e.defineComponent({__name:"AddonSingleEditor",props:e.mergeModels({constraint:{type:String},modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:i}=p.useIntl(),{describePricing:d}=_.usePricingDescription({currency:e.toRef(o,"currency"),billingPeriod:e.toRef(o,"billingPeriod")}),r=o.pricings.map(a=>a.id),c=e.computed(()=>o.constraint==="AT_MOST_ONE"?i({defaultMessage:"Select up to one product",id:"addon_single_editor.description.at_most_one",description:"The description of the addon single editor for at most one product"}):o.constraint==="EXACTLY_ONE"?i({defaultMessage:"Select one product",id:"addon_single_editor.description.exactly_one",description:"The description of the addon single editor for exactly one product"}):o.constraint==="AT_LEAST_ONE"?i({defaultMessage:"Select at least one product",id:"addon_single_editor.description.at_least_one",description:"The description of the addon single editor for at least one product"}):""),l=a=>o.modelValue.includes(a),m=a=>{if(l(a))n.value=n.value.filter(u=>u!==a);else{const u=n.value.filter(s=>!r.includes(s));n.value=[...u,a]}};return(a,u)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{"no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createVNode(_._sfc_main$1,null,{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1}),e.createElementVNode("div",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pricings,s=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{key:s.id,"content-background":"none",class:e.normalizeClass({"!bg-white":l(s.id)})},{default:e.withCtx(()=>[e.createVNode(b._sfc_main,{name:e.unref(x.getNameFromPricing)(s)??"",description:e.unref(d)(s)},{default:e.withCtx(()=>[e.createVNode(e.unref(T._sfc_main),{"model-value":l(s.id),"onUpdate:modelValue":g=>m(s.id)},null,8,["model-value","onUpdate:modelValue"])]),_:2},1032,["name","description"])]),_:2},1032,["class"]))),128))])])]),_:1}))}}),Z={class:"grid grid-cols-1 gap-1"},B=e.defineComponent({__name:"AddonMultipleEditor",props:e.mergeModels({modelValue:{type:Array},pricings:{type:Array},billingPeriod:{type:Object},currency:{type:String},groupName:{type:String}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:i}=p.useIntl(),{describePricing:d}=_.usePricingDescription({currency:e.toRef(o,"currency"),billingPeriod:e.toRef(o,"billingPeriod")}),r=l=>n.value.includes(l),c=l=>{r(l)?n.value=n.value.filter(m=>m!==l):n.value=[...n.value,l]};return(l,m)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{"no-spacing":"","no-border":!t.groupName,"content-background":t.groupName?"gray":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["grid grid-cols-1 gap-1",{"p-1":t.groupName}])},[t.groupName?(e.openBlock(),e.createBlock(_._sfc_main$1,{key:0},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.groupName),1)]),description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Select any number of products",id:"addon_multiple_editor.description",description:"The description of the addon multiple editor"})),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pricings,a=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{key:a.id,"content-background":t.groupName||r(a.id)?"none":"gray",class:e.normalizeClass({"!bg-white":r(a.id)})},{default:e.withCtx(()=>[e.createVNode(b._sfc_main,{name:e.unref(x.getNameFromPricing)(a)??"",description:e.unref(d)(a)},{default:e.withCtx(()=>[r(a.id)?(e.openBlock(),e.createBlock(e.unref(v._sfc_main),{key:0,intent:"secondary",square:"",size:"sm","icon-prefix":"remove_shopping_cart",onClick:u=>c(a.id)},null,8,["onClick"])):(e.openBlock(),e.createBlock(e.unref(v._sfc_main),{key:1,intent:"primary","icon-prefix":"add",size:"sm",onClick:u=>c(a.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Add to subscription ",id:"addon_multiple_editor.add_to_subscription_button",description:"The button to add a pricing to the subscription"})),1)]),_:1},8,["onClick"]))]),_:2},1032,["name","description"])]),_:2},1032,["content-background","class"]))),128))])],2)]),_:1},8,["no-border","content-background"]))}});function G(t){var n;return(((n=t.pricing_categories)==null?void 0:n.flatMap(i=>i.pricings??[]))??[]).filter(i=>i!==null)}const ee={class:"sv-plan-customization__body grid grid-cols-1 gap-1"},te=e.defineComponent({__name:"PlanCustomizationEditor",props:e.mergeModels({subscription:{type:Object},enabledPricingIds:{type:Array},initialSeatsValues:{type:Array},initialUnitsValues:{type:Array},billingPeriod:{type:Object},currency:{type:String}},{seatsValues:{required:!0},seatsValuesModifiers:{},unitsValues:{required:!0},unitsValuesModifiers:{},enabledPricingIds:{required:!0},enabledPricingIdsModifiers:{}}),emits:["update:seatsValues","update:unitsValues","update:enabledPricingIds"],setup(t){const o=t,n=e.useModel(t,"seatsValues"),i=e.useModel(t,"unitsValues"),d=e.useModel(t,"enabledPricingIds"),{$t:r}=p.useIntl(),c=e.computed(()=>{var u;const a=(u=M.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos,type:"DEFAULT"}))==null?void 0:u.pricing_plan_version;return a?G(a):[]}),l=e.computed(()=>c.value.filter(a=>a.product_type==="ADDON")),m=e.computed(()=>S.getPricingGroupsFromExtendedPricingPlanSubscription(o.subscription));return(a,u)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main),{class:"sv-plan-customization",title:e.unref(r)({defaultMessage:"Customize plan",id:"checkout.customize_plan_block.title",description:"The title of the customize plan block in the checkout form"}),"no-spacing":"","no-border":"","content-background":"none"},{default:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(L,{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=s=>n.value=s),class:"sv-plan-customization__seats","initial-seats-values":t.initialSeatsValues,pricings:c.value},null,8,["modelValue","initial-seats-values","pricings"]),e.createVNode(H,{modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=s=>i.value=s),class:"sv-plan-customization__units","initial-units-values":t.initialUnitsValues,pricings:c.value},null,8,["modelValue","initial-units-values","pricings"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,s=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s.id},[s.product_type==="DEFAULT"&&s.selection_constraint==="EXACTLY_ONE"?(e.openBlock(),e.createBlock(_._sfc_main,{key:0,modelValue:d.value,"onUpdate:modelValue":u[2]||(u[2]=g=>d.value=g),class:"sv-plan-customization__group","group-name":s.name,pricings:s.pricings,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","group-name","pricings","billing-period","currency"])):s.product_type==="ADDON"&&s.selection_constraint==="AT_MOST_ONE"?(e.openBlock(),e.createBlock(W,{key:1,modelValue:d.value,"onUpdate:modelValue":u[3]||(u[3]=g=>d.value=g),class:"sv-plan-customization__group","group-name":s.name,pricings:s.pricings,constraint:s.selection_constraint,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","group-name","pricings","constraint","billing-period","currency"])):s.product_type==="ADDON"&&s.selection_constraint==="ANY"?(e.openBlock(),e.createBlock(B,{key:2,modelValue:d.value,"onUpdate:modelValue":u[4]||(u[4]=g=>d.value=g),class:"sv-plan-customization__group",pricings:s.pricings,"group-name":s.name,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","pricings","group-name","billing-period","currency"])):e.createCommentVNode("",!0)],64))),128)),e.createVNode(B,{modelValue:d.value,"onUpdate:modelValue":u[5]||(u[5]=s=>d.value=s),class:"sv-plan-customization__group",pricings:l.value,"billing-period":t.billingPeriod,currency:t.currency},null,8,["modelValue","pricings","billing-period","currency"])])]),_:1},8,["title"]))}});exports.default=te;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),o=["data-testid"],d=["data-testid"],i=["data-testid"],u=["data-testid"],c=e.defineComponent({__name:"Skeleton",props:{variant:{type:String},class:{type:String},dataTestid:{type:String}},setup(s){const a=e.useSlots(),n=t=>{if(t==null||t===!1)return!0;if(typeof t=="string"||typeof t=="number")return String(t).trim().length===0;if(Array.isArray(t))return t.every(n);if(!e.isVNode(t))return!1;const r=t;return r.type===e.Comment?!0:r.type===e.Text?typeof r.children=="string"?!r.children.trim():!0:r.type===e.Fragment?r.children==null?!0:Array.isArray(r.children)?r.children.every(n):!1:!1},l=e.computed(()=>{if(!a.default)return!1;const t=a.default({});return!t||t.length===0?!1:!t.every(n)});return(t,r)=>l.value?e.renderSlot(t.$slots,"default",{},void 0,void 0,0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.variant==="title"?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0},t.$attrs,{"data-testid":s.dataTestid,class:"sv-skeleton sv-skeleton--title h-6 w-40 rounded border border-gray-50 bg-gray-50/50"}),null,16,o)):s.variant==="divider-text"?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1},t.$attrs,{"data-testid":s.dataTestid,class:"sv-skeleton sv-skeleton--divider-text mx-auto h-4 w-12 rounded border border-gray-50 bg-gray-50/50"}),null,16,d)):s.variant==="section"?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:2},t.$attrs,{"data-testid":s.dataTestid,class:"sv-skeleton sv-skeleton--section"}),[r[0]||(r[0]=e.createElementVNode("div",{class:"sv-skeleton__title h-6 w-40 rounded border border-gray-50 bg-gray-50/50"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["sv-skeleton__body mt-1 rounded border border-gray-50 bg-gray-50/50 md:mt-2",t.$props.class])},null,2)],16,i)):(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:3},t.$attrs,{"data-testid":s.dataTestid,class:["sv-skeleton rounded border border-gray-50 bg-gray-50/50",t.$props.class]}),null,16,u))],64))}});exports._sfc_main=c;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { defineComponent as y, useSlots as v, computed as f, renderSlot as g, openBlock as s, createElementBlock as a, Fragment as l, mergeProps as n, createElementVNode as o, normalizeClass as c, isVNode as m, Comment as b, Text as k } from "vue";
|
|
2
|
-
const h = ["data-testid"], p = ["data-testid"], S = ["data-testid"], $ = ["data-testid"], A = /* @__PURE__ */ y({
|
|
3
|
-
__name: "Skeleton",
|
|
4
|
-
props: {
|
|
5
|
-
variant: { type: String },
|
|
6
|
-
class: { type: String },
|
|
7
|
-
dataTestid: { type: String }
|
|
8
|
-
},
|
|
9
|
-
setup(r) {
|
|
10
|
-
const i = v(), d = (e) => {
|
|
11
|
-
if (e == null || e === !1) return !0;
|
|
12
|
-
if (typeof e == "string" || typeof e == "number")
|
|
13
|
-
return String(e).trim().length === 0;
|
|
14
|
-
if (Array.isArray(e))
|
|
15
|
-
return e.every(d);
|
|
16
|
-
if (!m(e)) return !1;
|
|
17
|
-
const t = e;
|
|
18
|
-
return t.type === b ? !0 : t.type === k ? typeof t.children == "string" ? !t.children.trim() : !0 : t.type === l ? t.children == null ? !0 : Array.isArray(t.children) ? t.children.every(d) : !1 : !1;
|
|
19
|
-
}, u = f(() => {
|
|
20
|
-
if (!i.default) return !1;
|
|
21
|
-
const e = i.default({});
|
|
22
|
-
return !e || e.length === 0 ? !1 : !e.every(d);
|
|
23
|
-
});
|
|
24
|
-
return (e, t) => u.value ? g(e.$slots, "default", {}, void 0, void 0, 0) : (s(), a(l, { key: 1 }, [
|
|
25
|
-
r.variant === "title" ? (s(), a("div", n({ key: 0 }, e.$attrs, {
|
|
26
|
-
"data-testid": r.dataTestid,
|
|
27
|
-
class: "sv-skeleton sv-skeleton--title h-6 w-40 rounded border border-gray-50 bg-gray-50/50"
|
|
28
|
-
}), null, 16, h)) : r.variant === "divider-text" ? (s(), a("div", n({ key: 1 }, e.$attrs, {
|
|
29
|
-
"data-testid": r.dataTestid,
|
|
30
|
-
class: "sv-skeleton sv-skeleton--divider-text mx-auto h-4 w-12 rounded border border-gray-50 bg-gray-50/50"
|
|
31
|
-
}), null, 16, p)) : r.variant === "section" ? (s(), a("div", n({ key: 2 }, e.$attrs, {
|
|
32
|
-
"data-testid": r.dataTestid,
|
|
33
|
-
class: "sv-skeleton sv-skeleton--section"
|
|
34
|
-
}), [
|
|
35
|
-
t[0] || (t[0] = o("div", { class: "sv-skeleton__title h-6 w-40 rounded border border-gray-50 bg-gray-50/50" }, null, -1)),
|
|
36
|
-
o("div", {
|
|
37
|
-
class: c([
|
|
38
|
-
"sv-skeleton__body mt-1 rounded border border-gray-50 bg-gray-50/50 md:mt-2",
|
|
39
|
-
e.$props.class
|
|
40
|
-
])
|
|
41
|
-
}, null, 2)
|
|
42
|
-
], 16, S)) : (s(), a("div", n({ key: 3 }, e.$attrs, {
|
|
43
|
-
"data-testid": r.dataTestid,
|
|
44
|
-
class: ["sv-skeleton rounded border border-gray-50 bg-gray-50/50", e.$props.class]
|
|
45
|
-
}), null, 16, $))
|
|
46
|
-
], 64));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
export {
|
|
50
|
-
A as _
|
|
51
|
-
};
|
package/dist/adyen-CvsH5fok.mjs
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
function o(e) {
|
|
2
|
-
const t = new Intl.NumberFormat(void 0, {
|
|
3
|
-
style: "currency",
|
|
4
|
-
currency: e.currency
|
|
5
|
-
}), { maximumFractionDigits: n = 10 } = t.resolvedOptions();
|
|
6
|
-
return {
|
|
7
|
-
value: Math.round(+e.quantity * Math.pow(10, n)),
|
|
8
|
-
currency: e.currency
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
const u = ["applepay"];
|
|
12
|
-
function c(e) {
|
|
13
|
-
return e.filter(
|
|
14
|
-
(t) => !u.some((n) => {
|
|
15
|
-
var r;
|
|
16
|
-
return n === ((r = t.type) == null ? void 0 : r.toLowerCase());
|
|
17
|
-
})
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
const s = "payment_acceptor_id", m = "redirectResult";
|
|
21
|
-
function f(e) {
|
|
22
|
-
var t, n;
|
|
23
|
-
return (n = (t = e.integration.payment_gateway) == null ? void 0 : t.adyen) == null ? void 0 : n.public_key;
|
|
24
|
-
}
|
|
25
|
-
function i(e) {
|
|
26
|
-
var t;
|
|
27
|
-
return ((t = e.options) == null ? void 0 : t.filter(
|
|
28
|
-
(n) => n.payment_gateway_variant === "ADYEN"
|
|
29
|
-
).flatMap(
|
|
30
|
-
(n) => l(n.adyen)
|
|
31
|
-
)) ?? [];
|
|
32
|
-
}
|
|
33
|
-
function y(e, { excludeExpressPaymentMethods: t = !1 } = {}) {
|
|
34
|
-
const n = i(e);
|
|
35
|
-
return t ? c(n) : n;
|
|
36
|
-
}
|
|
37
|
-
function l(e) {
|
|
38
|
-
return {
|
|
39
|
-
type: e.type,
|
|
40
|
-
name: e.name,
|
|
41
|
-
...e.issuers ? { issuers: e.issuers } : {},
|
|
42
|
-
...e.brands ? { brands: e.brands } : {},
|
|
43
|
-
...e.funding_source ? { fundingSource: e.funding_source } : {},
|
|
44
|
-
...e.configuration ? { configuration: e.configuration } : {}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function _({
|
|
48
|
-
paymentAcceptorId: e,
|
|
49
|
-
redirectUrl: t = window.location.href
|
|
50
|
-
}) {
|
|
51
|
-
const n = new URL(t);
|
|
52
|
-
return n.searchParams.set(s, e), n.toString();
|
|
53
|
-
}
|
|
54
|
-
function d(e, t) {
|
|
55
|
-
var r, a;
|
|
56
|
-
const n = (a = (r = e == null ? void 0 : e.integration.payment_gateway) == null ? void 0 : r.adyen) == null ? void 0 : a.environment;
|
|
57
|
-
if (!n)
|
|
58
|
-
return t.warn(
|
|
59
|
-
"ADYEN_INVALID_CONFIGURATION",
|
|
60
|
-
"No environment set for adyen advanced flow, defaulted to live"
|
|
61
|
-
), "live";
|
|
62
|
-
switch (n) {
|
|
63
|
-
case "TEST":
|
|
64
|
-
return "test";
|
|
65
|
-
case "LIVE_IN":
|
|
66
|
-
return "live-in";
|
|
67
|
-
case "LIVE_AU":
|
|
68
|
-
return "live-au";
|
|
69
|
-
case "LIVE_US":
|
|
70
|
-
return "live-us";
|
|
71
|
-
case "LIVE_APSE":
|
|
72
|
-
return "live-apse";
|
|
73
|
-
case "LIVE":
|
|
74
|
-
return "live";
|
|
75
|
-
default:
|
|
76
|
-
return t.warn(
|
|
77
|
-
"ADYEN_INVALID_CONFIGURATION",
|
|
78
|
-
`Unsupported environment "${n}" for adyen advanced flow, defaulted to "live"`
|
|
79
|
-
), "live";
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function E({
|
|
83
|
-
amount: e,
|
|
84
|
-
countryCode: t,
|
|
85
|
-
locale: n,
|
|
86
|
-
paymentMethodOptionResponse: r,
|
|
87
|
-
logger: a
|
|
88
|
-
}) {
|
|
89
|
-
return {
|
|
90
|
-
...e ? { amount: o(e) } : {},
|
|
91
|
-
analytics: { enabled: !1 },
|
|
92
|
-
clientKey: f(r),
|
|
93
|
-
countryCode: t,
|
|
94
|
-
environment: d(
|
|
95
|
-
r,
|
|
96
|
-
a
|
|
97
|
-
),
|
|
98
|
-
locale: n,
|
|
99
|
-
paymentMethodsResponse: {
|
|
100
|
-
paymentMethods: i(r)
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function v(e) {
|
|
105
|
-
return e ? Object.fromEntries(Object.entries(e).map(([t, n]) => [t, String(n)])) : void 0;
|
|
106
|
-
}
|
|
107
|
-
export {
|
|
108
|
-
s as P,
|
|
109
|
-
m as R,
|
|
110
|
-
d as a,
|
|
111
|
-
f as b,
|
|
112
|
-
v as c,
|
|
113
|
-
_ as d,
|
|
114
|
-
E as e,
|
|
115
|
-
y as g,
|
|
116
|
-
o as t
|
|
117
|
-
};
|
package/dist/adyen-Druit6gz.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function i(e){const t=new Intl.NumberFormat(void 0,{style:"currency",currency:e.currency}),{maximumFractionDigits:n=10}=t.resolvedOptions();return{value:Math.round(+e.quantity*Math.pow(10,n)),currency:e.currency}}const d=["applepay"];function f(e){return e.filter(t=>!d.some(n=>{var r;return n===((r=t.type)==null?void 0:r.toLowerCase())}))}const a="payment_acceptor_id",m="redirectResult";function u(e){var t,n;return(n=(t=e.integration.payment_gateway)==null?void 0:t.adyen)==null?void 0:n.public_key}function c(e){var t;return((t=e.options)==null?void 0:t.filter(n=>n.payment_gateway_variant==="ADYEN").flatMap(n=>l(n.adyen)))??[]}function y(e,{excludeExpressPaymentMethods:t=!1}={}){const n=c(e);return t?f(n):n}function l(e){return{type:e.type,name:e.name,...e.issuers?{issuers:e.issuers}:{},...e.brands?{brands:e.brands}:{},...e.funding_source?{fundingSource:e.funding_source}:{},...e.configuration?{configuration:e.configuration}:{}}}function E({paymentAcceptorId:e,redirectUrl:t=window.location.href}){const n=new URL(t);return n.searchParams.set(a,e),n.toString()}function s(e,t){var r,o;const n=(o=(r=e==null?void 0:e.integration.payment_gateway)==null?void 0:r.adyen)==null?void 0:o.environment;if(!n)return t.warn("ADYEN_INVALID_CONFIGURATION","No environment set for adyen advanced flow, defaulted to live"),"live";switch(n){case"TEST":return"test";case"LIVE_IN":return"live-in";case"LIVE_AU":return"live-au";case"LIVE_US":return"live-us";case"LIVE_APSE":return"live-apse";case"LIVE":return"live";default:return t.warn("ADYEN_INVALID_CONFIGURATION",`Unsupported environment "${n}" for adyen advanced flow, defaulted to "live"`),"live"}}function _({amount:e,countryCode:t,locale:n,paymentMethodOptionResponse:r,logger:o}){return{...e?{amount:i(e)}:{},analytics:{enabled:!1},clientKey:u(r),countryCode:t,environment:s(r,o),locale:n,paymentMethodsResponse:{paymentMethods:c(r)}}}function A(e){return e?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,String(n)])):void 0}exports.PAYMENT_ACCEPTOR_ID_QUERY_STRING=a;exports.REDIRECT_RESULT_QUERY_STRING=m;exports.createReturnUrl=E;exports.getAdyenClientKeyFromPaymentMethodOptionsResponse=u;exports.getAdyenDropInPaymentMethods=y;exports.getAdyenEnvironmentFromPaymentMethodOptionsResponse=s;exports.getAdyenExpressCheckoutConfiguration=_;exports.toMinorUnitAmount=i;exports.transformObjectToAdyenObject=A;
|