@solvimon/solvimon-web 0.1.0-alpha.22 → 0.1.0-alpha.23
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 +3 -0
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DFv-awxb.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B70SyWOB.mjs} +6 -6
- package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Co3XAxaY.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jXClPW91.js} +1 -1
- package/dist/Alert.vue.es-RyK53a2P.js +1 -0
- package/dist/Alert.vue.es-lIiAWf2S.mjs +146 -0
- package/dist/{Avatar.vue.es-DNJ-jexx.mjs → Avatar.vue.es-2E3laNRb.mjs} +1 -1
- package/dist/{Avatar.vue.es-D42J_izE.js → Avatar.vue.es-DdJreyr_.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BEVkWJXT.js → BillingInformation.vue_vue_type_script_setup_true_lang-ConpyC8n.js} +1 -1
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-D1uVidXk.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-D5EoBLhj.mjs} +4 -4
- package/dist/{Button.vue.es-Dz-2L8dJ.mjs → Button.vue.es-BJEy-e9C.mjs} +1 -1
- package/dist/{Button.vue.es-M_jXZda4.js → Button.vue.es-CJNxYacb.js} +1 -1
- package/dist/Checkout.entry.ce-BfLlnQyb.js +1 -0
- package/dist/{Checkout.entry.ce-B5-0AM67.mjs → Checkout.entry.ce-CQkrWscC.mjs} +1095 -1073
- package/dist/{Chip.vue.es-DMK9C78d.mjs → Chip.vue.es-DGbc4L_D.mjs} +2 -2
- package/dist/{Chip.vue.es-G8doKsZb.js → Chip.vue.es-DLQ4QEPo.js} +1 -1
- package/dist/{ContextMenu.vue.es-B3Rz6Ojk.js → ContextMenu.vue.es-Bd2kmeVq.js} +1 -1
- package/dist/{ContextMenu.vue.es-CzkkNoJG.mjs → ContextMenu.vue.es-DL1M7pcr.mjs} +4 -4
- package/dist/{CustomerBillingInformation.vue.es-Db6bN2RZ.mjs → CustomerBillingInformation.vue.es-CE94ASC3.mjs} +2 -2
- package/dist/{CustomerBillingInformation.vue.es-BmtU9Pk0.js → CustomerBillingInformation.vue.es-hiFzB43w.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BGHaTx1A.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BE21tqgW.js} +1 -1
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-fESZVyPe.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bhih7rPR.mjs} +5 -5
- package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DdMHG1_Y.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C5zc9n64.mjs} +15 -15
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D018AmFA.js +1 -0
- package/dist/{DividerText.vue.es-IK2fns6f.mjs → DividerText.vue.es-CFZUQ62L.mjs} +1 -1
- package/dist/{DividerText.vue.es-D-QxT2OD.js → DividerText.vue.es-CvCgHHXN.js} +1 -1
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-lhJnqrrh.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-YcaBJDzx.mjs} +4 -4
- package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-jTJGN4jb.js} +1 -1
- package/dist/{ErrorNotification.vue.es-BGckEwHf.mjs → ErrorNotification.vue.es-B3mvv79S.mjs} +2 -2
- package/dist/ErrorNotification.vue.es-DI2B7WiR.js +1 -0
- package/dist/IconButton.vue.es-Dp8h4YOx.js +1 -0
- package/dist/IconButton.vue.es-GLcGhoHC.mjs +56 -0
- package/dist/{IconTitle.vue.es-BmX68uJx.mjs → IconTitle.vue.es-CzuPQtOX.mjs} +3 -3
- package/dist/{IconTitle.vue.es-CmR2xoeu.js → IconTitle.vue.es-DN9r6nfK.js} +1 -1
- package/dist/{Input.vue.es-BGPELaZU.mjs → Input.vue.es-5Cq8a7oH.mjs} +2 -2
- package/dist/{Input.vue.es-CTOrmrcB.js → Input.vue.es-DM81HeVv.js} +1 -1
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CMEOOuSU.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D75LSIL8.mjs} +2 -2
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-bheNAKzK.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-w8w52LcV.js} +1 -1
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-Xo9BR6AD.js → InvoiceEntryView.vue_vue_type_script_setup_true_lang-DB5h39LA.js} +1 -1
- package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-avhwysNq.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-dRLsZPNh.mjs} +2 -2
- package/dist/{InvoiceSummary.vue.es-BWLiwlNs.mjs → InvoiceSummary.vue.es-DbtqsTuP.mjs} +7 -7
- package/dist/{InvoiceSummary.vue.es-hpG8Tq1D.js → InvoiceSummary.vue.es-Qy99kLZs.js} +1 -1
- package/dist/{Modal.vue.es-BD4vUaOQ.js → Modal.vue.es-DgLl6XBV.js} +1 -1
- package/dist/{Modal.vue.es-B_G8NQS2.mjs → Modal.vue.es-Z2DWAN2u.mjs} +5 -5
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBm51C7c.js +1 -0
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DYuFPIqs.mjs +294 -0
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DIJbzWMV.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BNZ9-GW1.js} +1 -1
- package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DuorCFo9.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CcdhYTB1.mjs} +3 -3
- package/dist/{PaymentHistoryBlock-ComJzB3H.mjs → PaymentHistoryBlock-CjP_514k.mjs} +1 -1
- package/dist/{PaymentHistoryBlock-DSHW_eW1.js → PaymentHistoryBlock-DS1j-8m-.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DUN0Hf2v.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CSTfMB8U.js} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-hjtksV2D.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dr2jtJhK.mjs} +4 -4
- package/dist/{PaymentIntegrationForm-CwfCLnKt.js → PaymentIntegrationForm-80b19Lkq.js} +1 -1
- package/dist/{PaymentIntegrationForm-CH5B6BY5.mjs → PaymentIntegrationForm-CpOZUf-W.mjs} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BqYk4_T9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BgztoQH5.mjs} +3 -3
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DzSQC951.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DKXhthkA.js} +1 -1
- package/dist/{PaymentIntegrationFormAdyen-DfN7cPYZ.mjs → PaymentIntegrationFormAdyen-BQcgDcik.mjs} +281 -204
- package/dist/PaymentIntegrationFormAdyen-DElXsJ96.js +98 -0
- package/dist/PaymentIntegrationFormStripe-CMwLqOe6.js +102 -0
- package/dist/{PaymentIntegrationFormStripe-CBsXDuhy.mjs → PaymentIntegrationFormStripe-Dx1H3fZ2.mjs} +249 -178
- package/dist/{PaymentMethod.vue.es-DkQdPXfk.mjs → PaymentMethod.vue.es-EhRCfeax.mjs} +3 -3
- package/dist/{PaymentMethod.vue.es-D18g-QB4.js → PaymentMethod.vue.es-pLCCzVxN.js} +1 -1
- package/dist/{PaymentMethodForm-DK8ntFA0.js → PaymentMethodForm-Bw2e1tXo.js} +1 -1
- package/dist/{PaymentMethodForm-CpIZKfPH.mjs → PaymentMethodForm-D3OY8zK5.mjs} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-D7fDguwa.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-DHXw6qD0.js} +1 -1
- package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-C1tGJsay.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-vGprVPpn.mjs} +5 -5
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-H3vrPllf.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CdT1YyeU.js} +1 -1
- package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-C6BcIkEV.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-D7b0HhDc.mjs} +6 -6
- package/dist/{PlanCustomizationEditor-0zCXN-cv.mjs → PlanCustomizationEditor-BQqkgmzL.mjs} +9 -9
- package/dist/PlanCustomizationEditor-RC8kj2rC.js +1 -0
- package/dist/{PricingGroupRangeInput.vue.es-QnpfHxaY.js → PricingGroupRangeInput.vue.es-ClkE98ML.js} +2 -2
- package/dist/{PricingGroupRangeInput.vue.es-8_5nfZDI.mjs → PricingGroupRangeInput.vue.es-DNsiUZyT.mjs} +4 -4
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CGJhKKNL.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-BJfQLRcS.js} +1 -1
- package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-t6h1j6WD.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CURXAgMT.mjs} +5 -5
- package/dist/RadioGroupExtended.vue.es-Dk9xdj76.js +1 -0
- package/dist/{RadioGroupExtended.vue.es-C92xlCFQ.mjs → RadioGroupExtended.vue.es-vUqn2ZUP.mjs} +3 -3
- package/dist/{Section.vue.es-DQ5H7mqW.mjs → Section.vue.es-C2_topx4.mjs} +1 -1
- package/dist/{Section.vue.es-Btff-cLY.js → Section.vue.es-Cybk1Nb8.js} +1 -1
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DKsunuGT.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-C9q_qwjt.mjs} +6 -6
- package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BfvX14E3.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DIgVzXLg.js} +1 -1
- package/dist/{SubscriptionSchedules-Dc0rUnnf.mjs → SubscriptionSchedules-BlCU_xc5.mjs} +1 -1
- package/dist/{SubscriptionSchedules-pzNsego6.js → SubscriptionSchedules-CNTg_oRy.js} +1 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-6LbR_Vni.js +1 -0
- package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Brs9qDs5.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Cf3Dy8Yn.mjs} +12 -12
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-BijBAdqp.js} +1 -1
- package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-C1mkIPMr.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-CjzjchsS.mjs} +2 -2
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DSoNs7Xx.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-CxdrAanb.mjs} +6 -6
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-CFmCJK8M.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-Dz4s3CH_.js} +1 -1
- package/dist/{TooltipParagraph.vue.es-CIedcXGT.mjs → TooltipParagraph.vue.es-Fu9Od3Vr.mjs} +1 -1
- package/dist/{TooltipParagraph.vue.es-BaqCDjl8.js → TooltipParagraph.vue.es-OX6bAWP9.js} +1 -1
- package/dist/{TrialChip.vue.es-BzNI94k0.js → TrialChip.vue.es-CbjdkR4i.js} +1 -1
- package/dist/{TrialChip.vue.es-DkBuMNr_.mjs → TrialChip.vue.es-c7tZOIW3.mjs} +2 -2
- package/dist/{cn.es-BGqYNPM3.mjs → cn.es-C8Ogac5T.mjs} +2 -2
- package/dist/{cn.es-CvmLj7KH.js → cn.es-lC4_Xd0R.js} +1 -1
- package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
- package/dist/components/BillingInformation/BillingInformation.mjs +5 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.mjs +7 -7
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +5 -5
- package/dist/components/Invoice/Invoice.cjs +1 -1
- package/dist/components/Invoice/Invoice.mjs +10 -10
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
- package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
- package/dist/components/InvoiceHeader/InvoiceHeader.mjs +8 -8
- package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
- package/dist/components/InvoicesList/InvoicesList.mjs +4 -4
- package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.mjs +9 -9
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +6 -6
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +5 -5
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.mjs +6 -6
- package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
- package/dist/components/WalletBalances/WalletBalances.mjs +4 -4
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +26 -23
- package/dist/{customElements-Vox1PB6G.js → customElements-BYIdPSzQ.js} +10 -10
- package/dist/{customElements-CSE7dwUr.mjs → customElements-Df6dGrN-.mjs} +354 -353
- package/dist/{customer-5krPxZ8i.mjs → customer-DmsKYpVi.mjs} +1 -1
- package/dist/{customer-Dsq-Moea.js → customer-DoLHZuMG.js} +1 -1
- package/dist/{de-DE-DsFtpLsx.mjs → de-DE-Bgm9bnmp.mjs} +19 -0
- package/dist/{de-DE-C3DzP1nj.js → de-DE-CAL9Mji2.js} +1 -1
- package/dist/{en-US-DvkvbV0p.mjs → en-US-E86eRIxh.mjs} +19 -0
- package/dist/{en-US-X_pSFsNm.js → en-US-_xe5H4TQ.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{invoices-DRgfpkJ6.mjs → invoices-CrO6p4Ms.mjs} +1 -1
- package/dist/{invoices-xOV2YaEV.js → invoices-mw87cNTS.js} +1 -1
- package/dist/{it-IT-YBtHAao1.js → it-IT-QFQ1Ajbb.js} +1 -1
- package/dist/{it-IT-TE7oqvXa.mjs → it-IT-co1BfV5s.mjs} +21 -2
- package/dist/{nl-NL-C8wnyKju.js → nl-NL-CJXJC1bx.js} +1 -1
- package/dist/{nl-NL-Di3-JArV.mjs → nl-NL-Drv2E66B.mjs} +19 -0
- package/dist/paymentFailure-Bh60UhxA.mjs +47 -0
- package/dist/paymentFailure-Cki8c5BX.js +1 -0
- package/dist/{paymentMethods-PmkHYomw.mjs → paymentMethods-BNQbW_f1.mjs} +1 -1
- package/dist/{paymentMethods-CRDIw9lz.js → paymentMethods-CQdhZwq4.js} +1 -1
- package/dist/{payments-jAgXhdp_.js → payments-KTjVHqOa.js} +1 -1
- package/dist/{payments-Dvqh6CGW.mjs → payments-VS_N2xpJ.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 +20 -20
- 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 +10 -10
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
- package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +20 -20
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
- package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +19 -19
- package/dist/sessionReference-3h-6FdrC.mjs +43 -0
- package/dist/sessionReference-m_6Rp4X1.js +1 -0
- package/dist/subscriptions-Dugd-oZ1.js +1 -0
- package/dist/{subscriptions-XDyI2Cqm.mjs → subscriptions-U4xg2CO1.mjs} +2 -2
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.lib.d.ts +2 -0
- package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +10 -1
- package/dist/types/types/errors.d.ts +5 -0
- package/dist/{useActionDispatchProvider-CNAuaHdm.js → useActionDispatchProvider-CTyDGRX8.js} +1 -1
- package/dist/{useActionDispatchProvider-B8-oycQk.mjs → useActionDispatchProvider-DyQbRCxR.mjs} +1 -1
- package/dist/{useCustomer-DSx-wN-6.js → useCustomer-BXI5Vmit.js} +1 -1
- package/dist/{useCustomer-CP8eWUZV.mjs → useCustomer-dcmU1539.mjs} +1 -1
- package/dist/{useCustomerFormLabels-DW6jnDYH.mjs → useCustomerFormLabels-BC1WfqWo.mjs} +5 -5
- package/dist/{useCustomerFormLabels-TVTgy0MT.js → useCustomerFormLabels-Ct6vD_b8.js} +1 -1
- package/dist/{useExperimentalFeature-BvE_EOX-.mjs → useExperimentalFeature-4Y-ppDr7.mjs} +1 -1
- package/dist/{useExperimentalFeature-CC-DrIcL.js → useExperimentalFeature-9-p9_nP6.js} +1 -1
- package/dist/{useInvoiceData-D8ds05CX.mjs → useInvoiceData-B2Z9aD2w.mjs} +2 -2
- package/dist/{useInvoiceData-CRRPdXc6.js → useInvoiceData-CGvtl7Ai.js} +1 -1
- package/dist/{useInvoicesList-DIfQcvER.js → useInvoicesList-Ba0GO8p-.js} +1 -1
- package/dist/{useInvoicesList-SJU5YWBQ.mjs → useInvoicesList-DJPznhig.mjs} +7 -7
- package/dist/{useLoadInitialData-DsabgMLZ.js → useLoadInitialData-BO9ZsSsF.js} +1 -1
- package/dist/{useLoadInitialData-MUljS38K.mjs → useLoadInitialData-CWyI3_RR.mjs} +1 -1
- package/dist/{usePaymentMethodAvailability-D0NUanyF.mjs → usePaymentMethodAvailability-DqIvkjLF.mjs} +4 -4
- package/dist/{usePaymentMethodAvailability-Bt7P9InI.js → usePaymentMethodAvailability-bkmDrPXY.js} +1 -1
- package/dist/{usePaymentMethodOptions-cT1o-BA1.js → usePaymentMethodOptions-BPBVGNDg.js} +1 -1
- package/dist/{usePaymentMethodOptions-B7JYkGsw.mjs → usePaymentMethodOptions-MSEp39xQ.mjs} +1 -1
- package/dist/{usePaymentMethods-DNVw2eVg.js → usePaymentMethods-BAOtOJZD.js} +1 -1
- package/dist/{usePaymentMethods-CpzqXQUT.mjs → usePaymentMethods-U7gnZ0F5.mjs} +1 -1
- package/dist/{usePayments-Gx9kBvNB.mjs → usePayments-Dq2V6bTV.mjs} +6 -6
- package/dist/{usePayments-D9Eo-uBk.js → usePayments-G-HpKpK8.js} +1 -1
- package/dist/{usePortal-DsebXdhx.js → usePortal-BplmMkBG.js} +1 -1
- package/dist/{usePortal-3VCZwSUE.mjs → usePortal-CMHV-ShD.mjs} +1 -1
- package/dist/{useSubscription-K_gP9TeX.js → useSubscription-CvB8ROBt.js} +1 -1
- package/dist/{useSubscription-DnL1wVh1.mjs → useSubscription-V53WsZwQ.mjs} +1 -1
- package/dist/{useTimePeriod.es-CmltiTE-.js → useTimePeriod.es-CtCTu9cz.js} +1 -1
- package/dist/{useTimePeriod.es-DMtKzcoB.mjs → useTimePeriod.es-D31Zl1MJ.mjs} +1 -1
- package/package.json +2 -1
- package/dist/Checkout.entry.ce-C52gkrNZ.js +0 -1
- package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-Cnlbp0om.js +0 -1
- package/dist/ErrorNotification.vue.es-Cd2UKPAz.js +0 -1
- package/dist/IconButton.vue.es-BTAkuFsm.js +0 -1
- package/dist/IconButton.vue.es-C4dQEQAc.mjs +0 -198
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-BnilyGBO.mjs +0 -144
- package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-CSv-Luvz.js +0 -1
- package/dist/PaymentIntegrationFormAdyen-Q48aDXR7.js +0 -98
- package/dist/PaymentIntegrationFormStripe-BSEqarl7.js +0 -102
- package/dist/PlanCustomizationEditor-XpofGULc.js +0 -1
- package/dist/RadioGroupExtended.vue.es-Cb1iD73r.js +0 -1
- package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-nmVRb6hj.js +0 -1
- package/dist/component-5wqcK7yz.mjs +0 -8
- package/dist/component-B7ZDyqBp.js +0 -1
- package/dist/subscriptions-fJcj88X9.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),T=require("./customElements-Vox1PB6G.js"),it=require("./useTimePeriod.es-CmltiTE-.js"),ee=require("./formatting.es-C72Nsrmh.js"),te=require("./Button.vue.es-M_jXZda4.js"),xt=require("./ErrorNotification.vue.es-Cd2UKPAz.js"),kt=require("./countryData.es-C4jHBzfo.js"),wt=require("./subscriptions-fJcj88X9.js"),de=require("./error-CmduqgVq.js"),at=require("./TrialChip.vue.es-BzNI94k0.js"),St=require("./useService-H7BjLg8P.js"),Tt=require("./invoices-xOV2YaEV.js"),le=require("./pricingPlanSchedule-BM8vsKkV.js"),ae=require("./index-DwueOtPi.js"),Ie=require("./useCustomerFormLabels-TVTgy0MT.js"),Lt=require("./useWatchDebounced-CAU1WI1P.js"),Bt=require("./usePaymentMethodOptions-cT1o-BA1.js"),he=require("./subscription-ZA62t4E9.js"),Le=require("./pricing-BVAld27Y.js"),pe=require("./url-BNKStNY9.js"),_e=require("./adyen-Druit6gz.js"),Vt=require("./usePortal-DsebXdhx.js"),Ot=require("./getCountryNameByCode.es-Xxc0nZsH.js"),Ze=require("./Expand.vue.es-BtM0EZEr.js"),re=require("./Input.vue.es-CTOrmrcB.js"),ie=require("./Section.vue.es-Btff-cLY.js"),zt=require("./IconButton.vue.es-BTAkuFsm.js"),jt=require("./customer-Dsq-Moea.js"),me=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js"),we=require("./TooltipParagraph.vue.es-BaqCDjl8.js"),Rt=require("./PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DIJbzWMV.js"),Xe=require("./Chip.vue.es-G8doKsZb.js"),rt=require("./SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BfvX14E3.js"),Ut=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js"),lt=require("./useViewport-hPRVDWCm.js"),se=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),$t=require("./DividerText.vue.es-D-QxT2OD.js"),Ae=require("./adyenSdk-BP2XXzeJ.js"),Ft=require("./payments-jAgXhdp_.js"),Gt=require("./ContentWithAsideLayout-C6yMIVJF.js"),Yt=require("./cn.es-CvmLj7KH.js"),Kt=require("./component-B7ZDyqBp.js"),qt={AT:"Austria",BE:"Belgium",BG:"Bulgaria",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",EE:"Estonia",ES:"Spain",FI:"Finland",FR:"France",GR:"Greece",HR:"Croatia",HU:"Hungary",IE:"Ireland",IT:"Italy",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MT:"Malta",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SE:"Sweden",SI:"Slovenia",SK:"Slovakia"};function st(t){return Object.keys(qt).includes(t)}function We(t,n){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,i)}return o}function Me(t){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};n%2?We(Object(o),!0).forEach(function(i){Qt(t,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(o,i))})}return t}function Qt(t,n,o){return n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function Ce(t){return typeof t=="function"}function Te(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Ee(t){return Ce(t.$validator)?Me({},t):{$validator:t}}function ct(t){return typeof t=="object"?t.$valid:t}function ut(t){return t.$validator||t}function Ht(t,n){if(!Te(t))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof t}`);if(!Te(n)&&!Ce(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Ee(n);return o.$params=Me(Me({},o.$params||{}),t),o}function Zt(t,n){if(!Ce(t)&&typeof e.unref(t)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof t}`);if(!Te(n)&&!Ce(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Ee(n);return o.$message=t,o}function Xt(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const o=Ee(t);return Me(Me({},o),{},{$async:!0,$watchTargets:n})}function Wt(t){return{$validator(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return e.unref(n).reduce((r,s,g)=>{const d=Object.entries(s).reduce((N,f)=>{let[_,M]=f;const c=t[_]||{},A=Object.entries(c).reduce((y,E)=>{let[b,P]=E;const w=ut(P).call(this,M,s,g,...i),p=ct(w);if(y.$data[b]=w,y.$data.$invalid=!p||!!y.$data.$invalid,y.$data.$error=y.$data.$invalid,!p){let C=P.$message||"";const F=P.$params||{};typeof C=="function"&&(C=C({$pending:!1,$invalid:!p,$params:F,$model:M,$response:w})),y.$errors.push({$property:_,$message:C,$params:F,$response:w,$model:M,$pending:!1,$validator:b})}return{$valid:y.$valid&&p,$data:y.$data,$errors:y.$errors}},{$valid:!0,$data:{},$errors:[]});return N.$data[_]=A.$data,N.$errors[_]=A.$errors,{$valid:N.$valid&&A.$valid,$data:N.$data,$errors:N.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:r.$valid&&d.$valid,$data:r.$data.concat(d.$data),$errors:r.$errors.concat(d.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:n=>{let{$response:o}=n;return o?o.$errors.map(i=>Object.values(i).map(a=>a.map(r=>r.$message)).reduce((a,r)=>a.concat(r),[])):[]}}}const dt=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(t==null)return!1;if(t===!1)return!0;if(t instanceof Date)return!isNaN(t.getTime());if(typeof t=="object"){for(let n in t)return!0;return!1}return!!String(t).length},Jt=t=>(t=e.unref(t),Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:String(t).length);function ce(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return i=>(i=e.unref(i),!dt(i)||n.every(a=>(a.lastIndex=0,a.test(i))))}var en=Object.freeze({__proto__:null,forEach:Wt,len:Jt,normalizeValidatorObject:Ee,regex:ce,req:dt,unwrap:e.unref,unwrapNormalizedValidator:ut,unwrapValidatorResponse:ct,withAsync:Xt,withMessage:Zt,withParams:Ht});ce(/^[a-zA-Z]*$/);ce(/^[a-zA-Z0-9]*$/);ce(/^\d*(\.\d+)?$/);const tn=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;ce(tn);const nn=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;ce(nn);ce(/(^[0-9]*$)|(^-[0-9]+$)/);ce(/^[-]?\d*(\.\d+)?$/);function Pe(t){return!!kt.countryData.find(n=>n.key===t)}const pt={AT:{regex:/^ATU\d{8}$/,prefix:"AT",example:"ATU12345678"},BE:{regex:/^BE0?\d{9}$/,prefix:"BE",example:"BE0123456789"},BG:{regex:/^BG\d{9,10}$/,prefix:"BG",example:"BG123456789"},HR:{regex:/^HR\d{11}$/,prefix:"HR",example:"HR12345678901"},CY:{regex:/^CY\d{8}[A-Z]$/,prefix:"CY",example:"CY12345678X"},CZ:{regex:/^CZ\d{8,10}$/,prefix:"CZ",example:"CZ12345678"},DE:{regex:/^DE\d{9}$/,prefix:"DE",example:"DE123456789"},DK:{regex:/^DK\d{8}$/,prefix:"DK",example:"DK12345678"},EE:{regex:/^EE\d{9}$/,prefix:"EE",example:"EE123456789"},GR:{regex:/^(EL|GR)\d{9}$/,prefix:"GR",example:"GR123456789"},ES:{regex:/^ES[A-Z0-9]\d{7}[A-Z0-9]$/,prefix:"ES",example:"ESX1234567X"},FI:{regex:/^FI\d{8}$/,prefix:"FI",example:"FI12345678"},FR:{regex:/^FR[0-9A-Z]{2}\d{9}$/,prefix:"FR",example:"FRXX123456789"},HU:{regex:/^HU\d{8}$/,prefix:"HU",example:"HU12345678"},IE:{regex:/^IE[0-9A-Z]{8,9}$/,prefix:"IE",example:"IE1234567A"},IS:{regex:/^IS\d{5}$/,prefix:"IS",example:"IS12345"},IT:{regex:/^IT\d{11}$/,prefix:"IT",example:"IT12345678901"},LT:{regex:/^LT(\d{9}|\d{12})$/,prefix:"LT",example:"LT123456789 or LT123456789012"},LU:{regex:/^LU\d{8}$/,prefix:"LU",example:"LU12345678"},LV:{regex:/^LV\d{11}$/,prefix:"LV",example:"LV12345678901"},ME:{regex:/^ME\d{9}$/,prefix:"ME",example:"ME123456789"},MT:{regex:/^MT\d{8}$/,prefix:"MT",example:"MT12345678"},NL:{regex:/^NL\d{9}B\d{2}$/,prefix:"NL",example:"NL123456789B01"},PL:{regex:/^PL\d{10}$/,prefix:"PL",example:"PL1234567890"},PT:{regex:/^PT\d{9}$/,prefix:"PT",example:"PT123456789"},RO:{regex:/^RO\d{2,10}$/,prefix:"RO",example:"RO1234567890"},RU:{regex:/^RU(\d{9}|\d{10}|\d{12})$/,prefix:"RU",example:"RU123456789 or RU1234567890 or RU123456789012"},SE:{regex:/^SE\d{10}01$/,prefix:"SE",example:"SE123456789001"},SI:{regex:/^SI\d{8}$/,prefix:"SI",example:"SI12345678"},SK:{regex:/^SK\d{10}$/,prefix:"SK",example:"SK1234567890"},CH:{regex:/^CHE\d{9}(MWST|TVA|IVA)?$/,prefix:"CHE",example:"CHE123456789MWST"},NO:{regex:/^NO\d{9}MVA$/,prefix:"NO",example:"NO123456789MVA"},GB:{regex:/^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,prefix:"GB",example:"GB123456789"},XI:{regex:/^XI(\d{9}|\d{12})$/,prefix:"XI",example:"XI123456789"}},on=t=>!t||typeof t!="string"||t.trim()===""?!0:Object.values(pt).some(n=>n.regex.test(t)),an=({$model:t})=>{if(!t||typeof t!="string"||t.trim()==="")return"";const n=e.inject(T.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:o}=n,i=Object.values(pt).find(a=>t.toUpperCase().startsWith(a.prefix.toUpperCase()));return i?o({defaultMessage:"Invalid tax ID format. Example: {example}",id:"form_validation.tax_id.invalid_format",description:"Error message when tax ID format is invalid but prefix matches"},{example:i.example}):o({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},Be=en.withMessage(an,on),rn="preview",ln="NL",mt=t=>{var n,o;if("organization"in t)return(n=t.organization)==null?void 0:n.registered_address;if("individual"in t)return(o=t.individual)==null?void 0:o.residential_address},sn=t=>{const n=mt(t);return{...(n==null?void 0:n.line1)&&{line1:n.line1},...(n==null?void 0:n.line2)&&{line2:n.line2},...(n==null?void 0:n.city)&&{city:n.city},...(n==null?void 0:n.state)&&{state:n.state},country:(n==null?void 0:n.country)||ln,...(n==null?void 0:n.postal_code)&&{postal_code:n.postal_code}}},cn=t=>{var i,a;const n=sn(t),o=t.type??"INDIVIDUAL";if(o==="ORGANIZATION"){const r="organization"in t?t.organization:void 0,s=(a=(i=r==null?void 0:r.tax_ids)==null?void 0:i[0])==null?void 0:a.id;return{type:o,organization:{legal_name:(r==null?void 0:r.legal_name)||rn,registered_address:n,...s&&{tax_id:Be.$validator(s,{},{})?s:void 0}}}}return{type:o,individual:{residential_address:n}}},un={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"USD",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VES",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWL"},dn=t=>{if(t)return un[t]},gt=({country:t,pricingCurrencySettings:n,fallbackCurrency:o})=>{const i=dn(t),a=(n==null?void 0:n.pricing_currencies)??[];return i&&a.includes(i)?i:(n==null?void 0:n.default_pricing_currency)??o??i},pn=()=>{const{getInvoicePreview:t}=Tt.createInvoicesService(),n=T.useLogger(),o=e.ref(),i=e.ref(),a=e.ref(),r=e.ref({}),s=e.ref(de.ApiStatus.Initial),g=e.ref({}),d=e.ref(),N=_=>`${_.type}:${_.value}`;return{loadInvoicePreview:async({subscription:_,subscriptionStartAt:M,customer:c={},seatsValues:A,unitsValues:y,enabledPricingIds:E,promotionCode:b})=>{var m,h,D,S,j,O;const P=cn(c);s.value=de.ApiStatus.Loading;const L=le.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:_.pricing_plan_schedule_infos,type:"DEFAULT"}),w=(m=L==null?void 0:L.pricing_plan_version)==null?void 0:m.pricing_currency_settings,p=(((h=w==null?void 0:w.pricing_currencies)==null?void 0:h.length)??0)>1,C=((S=(D=L==null?void 0:L.pricing_plan_version)==null?void 0:D.billing_period_settings)==null?void 0:S.billing_periods)??[],F=C.length>1,Y=C.length>0?C.map(({period:V})=>V):_.billing_period?[_.billing_period]:[],u=gt({country:(j=mt(c))==null?void 0:j.country,pricingCurrencySettings:w,fallbackCurrency:_.billing_currency});if(!Y.length){n.warn("INVOICE_PREVIEW_SKIPPED","No billing period to preview an invoice for",{subscriptionId:_.id}),s.value=de.ApiStatus.Done;return}const v=_.billing_period?N(_.billing_period):N(Y[0]),l=Y.map(async V=>{var K;const H=N(V),R=le.getScheduleCustomizations({enabledPricings:E==null?void 0:E.map($=>({pricing_id:$})),seatsValues:A,unitsValues:y,pricingPlanScheduleInfos:_.pricing_plan_schedule_infos,pricingCurrency:p?u:void 0,billingPeriod:F?V:void 0})??[];if(b){const $=(K=_.pricing_plan_schedule_infos.find(({pricing_plan_schedule:G})=>G.type==="DEFAULT"))==null?void 0:K.id;if($){const G=R.find(({pricing_plan_schedule_id:q})=>q===$);G?G.promotion_codes=[b]:R.push({pricing_plan_schedule_id:$,promotion_codes:[b]})}}const Z={pricingPlanSubscriptionId:_.id,startAt:M,customizations:R,customer:P},Q=g.value[H];if(Q&&St.isEqual(Z,Q))return{periodKey:H,response:void 0};g.value={...g.value,[H]:Z};const B=await t(Z);return{periodKey:H,response:B}});try{const V={...r.value},H=await Promise.all(l),R=_.pricing_plan_schedule_infos.find(({pricing_plan_schedule:Q})=>Q.type==="TRIAL"),Z=(O=_.pricing_plan_schedule_infos.find(({pricing_plan_schedule:Q})=>Q.type==="DEFAULT"))==null?void 0:O.id;H.forEach(({periodKey:Q,response:B})=>{var G;if(!B)return;d.value=(G=B.invoice_infos.at(-1))==null?void 0:G.pricing_plan_schedule_id,R&&(i.value=B.first_invoice,R.start_at&&R.end_at&&(o.value=at.convertDateRangeToTimePeriod(new Date(R.start_at),new Date(R.end_at))));const K=B.invoice_infos.find(({pricing_plan_schedule_id:q})=>q===Z),$=K==null?void 0:K.invoices[0];$&&(V[Q]=$)}),r.value=V,a.value=V[v]}catch(V){throw s.value=de.ApiStatus.Failed,n.error("INVOICE_PREVIEW_FAILED","Failed to load invoice preview",{},V),V}finally{s.value=de.ApiStatus.Done}},invoicePreview:a,invoicePreviewByBillingPeriod:r,trialInvoicePreview:i,trialPeriod:o,lastPreviewScheduleId:d,isPending:e.computed(()=>s.value===de.ApiStatus.Loading)}},Je=["email","country"],ft="GENERIC_TAX_ID",et={US:["addressLine1","postalCode"],CA:["state"]},mn=t=>!t||!et[t]?Je:[...et[t],...Je],tt=t=>{const n={...t.addressLine1&&{line1:t.addressLine1},...t.addressLine2&&{line2:t.addressLine2},...t.city&&{city:t.city},...t.state&&{state:t.state},...t.postalCode&&{postal_code:t.postalCode},country:t.country??""};return t.type==="ORGANIZATION"?{type:"ORGANIZATION",organization:{legal_name:t.companyLegalName??"",registered_address:n,...t.companyVatNumber&&{tax_ids:[{id:t.companyVatNumber,type:ft}]}}}:{type:"INDIVIDUAL",individual:{residential_address:n}}};function gn(){return{getGeoLocation(){return fetch("https://api.country.is/").then(t=>t.json())}}}function fn({initialState:t,onRequiredFieldChange:n}){const o=e.ref(Ne(t)),i=e.ref(Ne(t)),a=f=>{const _=Ne({...e.toRaw(o.value),...f});o.value=_,i.value=structuredClone(_)},r=e.computed(()=>mn(o.value.country)),s=f=>r.value.includes(f),g=ae.useValidation({email:{required:ae.required,email:ae.email},country:{required:ae.required},state:{required:ae.requiredIf(()=>s("state"))},addressLine1:{required:ae.requiredIf(()=>s("addressLine1"))},postalCode:{required:ae.requiredIf(()=>s("postalCode"))},companyLegalName:ae.requiredIf(o.value.type==="ORGANIZATION"),companyVatNumber:{taxId:Be}},o),d=f=>{f||gn().getGeoLocation().then(({country:_})=>{o.value.country=_})},N=(f,_)=>{const M=Ie.objectDiff({from:_,to:f}),c=Object.keys(M).find(yn);if(c){if(["type","companyVatNumber"].includes(c)){n(f);return}if(c==="seatsValues"){n(f);return}if(c==="unitsValues"){n(f);return}if(c==="enabledPricingIds"){n(f);return}if(c!=="email"&&s(c)){n(f);return}}};return e.onMounted(async()=>{await d(t==null?void 0:t.country)}),Lt.useWatchDebounced(()=>JSON.parse(JSON.stringify(o.value)),N,{debounce:200}),{form:o,validation:g,getIsFieldRequired:s,updateInitialState:a,initialState:i}}const Ne=(t={})=>({email:void 0,country:void 0,type:"INDIVIDUAL",companyLegalName:void 0,firstName:void 0,infix:void 0,lastName:void 0,addressLine1:void 0,addressLine2:void 0,postalCode:void 0,city:void 0,state:void 0,companyVatNumber:void 0,seatsValues:void 0,unitsValues:void 0,enabledPricingIds:void 0,...t});function yn(t){return t in Ne()}function vn(t,n=void 0){const o=n??[],i=he.getPricingGroupsFromExtendedPricingPlanSubscription(t);for(const a of i)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(a.selection_constraint)){const r=a.pricings.map(s=>s.id);if(n!=null&&n.some(s=>r.includes(s)))continue;o.push(a.pricings[0].id)}return o}function _n(t){return he.getPricingGroupsFromExtendedPricingPlanSubscription(t).some(o=>o.selection_constraint==="EXACTLY_ONE"||o.selection_constraint==="AT_LEAST_ONE")}function hn(t){const n=Le.getAllPricingsFromScheduleInfos(t.pricing_plan_schedule_infos),o=he.getPricingGroupsFromExtendedPricingPlanSubscription(t);return n.some(i=>i.product_type==="ADDON")||o.some(i=>i.object_type==="ADDON")}const nt=t=>(t??[]).flatMap(n=>n.configs??[]),yt=t=>[...t.configs??[],...nt(t.billing_period_configs),...(t.pricing_currency_configs??[]).flatMap(n=>[...n.configs??[],...nt(n.billing_period_configs)])];function Mn({pricings:t,pricingItemConfigId:n}){var r,s;const o=t.flatMap(g=>g.items??[]).find(g=>{var d;return(d=g.configs)==null?void 0:d.some(N=>N.id===n)}),i=(r=o==null?void 0:o.configs)==null?void 0:r.find(g=>g.id===n),a=(s=o==null?void 0:o.product_items)==null?void 0:s[0];return{config:i,productItem:a}}const vt="1";function bn(t){const n=Le.getPricingsFromScheduleInfo(t).flatMap(o=>o.items??[]).flatMap(yt);return new Map(n.flatMap(o=>{var i;return(i=o.default_seats_value)!=null&&i.number?[[o.id,o.default_seats_value.number]]:[]}))}function In(t){var i;const n=(i=t==null?void 0:t.pricing_plan_schedule)==null?void 0:i.seats_values;if(!t||!(n!=null&&n.length))return;const o=t.pricing_plan_version?bn(t):new Map;return n.map(({pricing_item_config_id:a,number:r})=>({pricing_item_config_id:a,number:r||o.get(a)||vt}))}const _t="1";function Nn(t){const n=Le.getPricingsFromScheduleInfo(t).flatMap(o=>o.items??[]).flatMap(yt);return new Map(n.flatMap(o=>{var i;return(i=o.default_units)!=null&&i.number?[[o.id,o.default_units.number]]:[]}))}function Cn(t){var i;const n=(i=t==null?void 0:t.pricing_plan_schedule)==null?void 0:i.units;if(!t||!(n!=null&&n.length))return;const o=t.pricing_plan_version?Nn(t):new Map;return n.map(({pricing_item_config_id:a,number:r})=>({pricing_item_config_id:a,number:r||o.get(a)||_t}))}const Se="solvimon_checkout_redirect_state";function An({initialCountry:t,initialEmail:n,subscriptionId:o,enabledPricingIds:i}){const a=T.useLogger(),r=(()=>{if(t){if(Pe(t))return t;a.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${t}"`)}})(),s=(()=>{if(n){if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))return n;a.error("INVALID_EMAIL",`invalid email provided: "${n}"`)}})(),g=e.ref(!1),d=e.ref(),{getSubscription:N}=wt.createSubscriptionsService(),f=pn(),_=e.computed(()=>d.value&&p.form.value.country&&Y.value),{paymentMethodOptions:M,get:c,isPending:A,error:y}=Bt.usePaymentMethodOptions(),E=async(v,l)=>{try{await c({subscriptionId:d.value.id,country:v,amount:l})}catch{a.error("PAYMENT_METHOD_OPTIONS_LOAD_FAILED","Failed to load the payment methods the checkout can offer",{},y.value)}},b=e.computed(()=>y.value!==null),P=()=>{const{country:v}=p.form.value;!d.value||!v||!Y.value||E(v,Y.value)},L=()=>{const v=p.form.value;return f.loadInvoicePreview({subscription:d.value,customer:tt(v),seatsValues:v.seatsValues,unitsValues:v.unitsValues,enabledPricingIds:v.enabledPricingIds??i,promotionCode:v.promotionCode})},w=async v=>{const l=v.promotionCode??p.form.value.promotionCode,m=v.enabledPricingIds??p.form.value.enabledPricingIds,h={...p.form.value,...v};return await f.loadInvoicePreview({subscription:d.value,customer:tt(h),seatsValues:h.seatsValues,unitsValues:h.unitsValues,enabledPricingIds:m,promotionCode:l}),{trialInvoicePreview:f.trialInvoicePreview.value,invoicePreview:f.invoicePreview.value}},p=fn({initialState:{country:r,email:s},onRequiredFieldChange:()=>{d.value&&L().catch(()=>{})}}),C=async()=>{var S,j,O,V;const v=await N({id:o,expanded:!0}),l=le.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:v.pricing_plan_schedule_infos,type:"DEFAULT"}),m=(V=(O=(j=(S=l==null?void 0:l.pricing_plan_version)==null?void 0:S.billing_period_settings)==null?void 0:j.billing_periods)==null?void 0:O[0])==null?void 0:V.period;d.value={...v,billing_period:m??v.billing_period};const h=In(l),D=Cn(l);p.updateInitialState({...p.form.value,enabledPricingIds:vn(v,i),...h?{seatsValues:h}:{},...D?{unitsValues:D}:{}})},F=e.computed(()=>{var R,Z,Q,B,K,$,G,q,W;const v=p.form.value.firstName||p.form.value.infix||p.form.value.lastName?{...p.form.value.firstName?{first_name:p.form.value.firstName}:{},...p.form.value.infix?{infix:p.form.value.infix}:{},...p.form.value.lastName?{last_name:p.form.value.lastName}:{}}:{},l={...p.form.value.addressLine1&&{line1:p.form.value.addressLine1},...p.form.value.addressLine2&&{line2:p.form.value.addressLine2},...p.form.value.city&&{city:p.form.value.city},...p.form.value.postalCode&&{postal_code:p.form.value.postalCode},...p.form.value.state&&{state:p.form.value.state},country:p.form.value.country??""},m=le.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((R=d.value)==null?void 0:R.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),h=(Z=m==null?void 0:m.pricing_plan_version)==null?void 0:Z.pricing_currency_settings,D=(((Q=h==null?void 0:h.pricing_currencies)==null?void 0:Q.length)??0)>1,j=(((K=(B=m==null?void 0:m.pricing_plan_version)==null?void 0:B.billing_period_settings)==null?void 0:K.billing_periods)??[]).length>1,O=le.getScheduleCustomizations({enabledPricings:($=p.form.value.enabledPricingIds)==null?void 0:$.map(J=>({pricing_id:J})),seatsValues:p.form.value.seatsValues,unitsValues:p.form.value.unitsValues,pricingPlanScheduleInfos:((G=d.value)==null?void 0:G.pricing_plan_schedule_infos)??[],pricingCurrency:D?(q=d.value)==null?void 0:q.billing_currency:void 0,billingPeriod:j?(W=d.value)==null?void 0:W.billing_period:void 0}),V=p.form.value.promotionCode,H=V&&d.value?(()=>{var fe,be,ye;const J=O?[...O]:[],ne=((fe=J[0])==null?void 0:fe.pricing_plan_schedule_id)??((ye=le.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((be=d.value)==null?void 0:be.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))==null?void 0:ye.id);if(!ne)return O;const ge=J.find(({pricing_plan_schedule_id:X})=>X===ne);if(ge)ge.promotion_codes=[V];else{const X=O==null?void 0:O[0];J.push({pricing_plan_schedule_id:ne,...(X==null?void 0:X.enabled_pricings)&&{enabled_pricings:X.enabled_pricings},...(X==null?void 0:X.seats_values)&&{seats_values:X.seats_values},...(X==null?void 0:X.units)&&{units:X.units},promotion_codes:[V]})}return J})():O;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:o,...H&&{pricing_plan_schedule_customizations:H},customer_details:{email:p.form.value.email??"",type:p.form.value.type,...p.form.value.type==="INDIVIDUAL"?{individual:{residential_address:l,...v?{name:v}:{}}}:{organization:{registered_address:l,legal_name:p.form.value.companyLegalName??"",...p.form.value.companyVatNumber&&Be.$validator(p.form.value.companyVatNumber,{},{})?{tax_ids:[{id:p.form.value.companyVatNumber,type:ft}]}:{}}}}}}}),Y=e.computed(()=>{var v,l;return((v=f.trialInvoicePreview.value)==null?void 0:v.invoice_amount_including_tax)??((l=f.invoicePreview.value)==null?void 0:l.invoice_amount_including_tax)});e.watch([()=>p.form.value.country,Y],([v,l])=>{!d.value||!v||!l||E(v,l)});function u(){sessionStorage.setItem(Se,JSON.stringify(p.form.value))}return e.onMounted(async()=>{const v=pe.getQueryParam("redirect_status"),l=!!pe.getQueryParam(_e.PAYMENT_ACCEPTOR_ID_QUERY_STRING),m=!!pe.getQueryParam("payment_intent_client_secret")||!!pe.getQueryParam("setup_intent_client_secret");v==="succeeded"&&l&&m&&(g.value=!0);const D=sessionStorage.getItem(Se);let S=null;if(D)try{S=JSON.parse(D)}catch{}S&&p.updateInitialState(S);try{await C()}catch(j){throw a.error("SUBSCRIPTION_LOAD_FAILED","Failed to load the subscription the checkout prices",{},j),j}try{await L()}catch{}S&&(p.updateInitialState(S),sessionStorage.removeItem(Se))}),e.watch(_,v=>{v&&P()},{once:!0}),{validatedEmail:s,validatedCountry:r,invoicePreview:f.invoicePreview,invoicePreviewByBillingPeriod:f.invoicePreviewByBillingPeriod,trialInvoicePreview:f.trialInvoicePreview,trialPeriod:f.trialPeriod,loadInvoicePreview:L,updateInvoicePreviewOnBillingInformationChange:w,lastPreviewScheduleId:f.lastPreviewScheduleId,paymentMethodOptions:M,hasPaymentMethodOptionsError:b,retryPaymentMethodOptions:P,isPaymentMethodsPending:A,isInvoicePreviewPending:f.isPending,subscription:d,checkoutForm:p,authorizationContext:F,isPaid:g,amount:Y,saveFormStateForRedirect:u}}function En({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:n,formatErrorMessage:o,onInvalidPromotionCode:i,onApplyError:a}){const r=T.useLogger(),s=e.ref(!1),g=e.ref(null),d=(M,c)=>{g.value=o?o({action:M,error:c}):M==="apply"?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},N=M=>Pn(M)&&M.field==="promotion_codes",f=async M=>{const c=M==null?void 0:M.trim();if(c){g.value=null,t.form.value.promotionCode=c,s.value=!0;try{await n({promotionCode:c})}catch(A){r.capture(A,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),d("apply",A),a==null||a(),N(A)&&(i==null||i()),await _({suppressError:!0,preserveErrorMessage:!0})}finally{s.value=!1}}},_=async({suppressError:M=!1,preserveErrorMessage:c=!1}={})=>{c||(g.value=null),delete t.form.value.promotionCode,s.value=!0;try{await n({})}catch(A){r.capture(A,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),M||d("remove",A)}finally{s.value=!1}};return{applyPromotionCode:f,removePromotionCode:_,isPromotionCodePending:s,promotionCodeErrorMessage:g}}function Pn(t){return typeof t=="object"&&t!==null&&"field"in t}function Dn({subscription:t,promotionCode:n,appliedPromotionCode:o,applyPromotionCode:i}){e.watch(t,a=>{a&&n&&(o.value=n,i(n))},{once:!0})}const xn={class:"flex items-center gap-2"},kn=e.defineComponent({__name:"TaxIDCheckNotice",props:{taxIdValidationResult:{type:Object}},setup(t){const n=t,{formatMessage:o}=T.useIntl(),i=e.computed(()=>n.taxIdValidationResult.valid==="VALID"),a=e.computed(()=>i.value?o({defaultMessage:"VAT number is valid.",id:"tax_check.valid_vat_number",description:"The message shown when the VAT number is valid"}):o({defaultMessage:"VAT number is invalid.",id:"tax_check.invalid_vat_number",description:"The message shown when the VAT number is invalid"}));return(r,s)=>(e.openBlock(),e.createBlock(e.unref(zt._sfc_main),{type:i.value?"success":"danger",icon:!1},{default:e.withCtx(()=>[e.createElementVNode("div",xn,[e.createVNode(e.unref(T._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value),1)]),_:1})])]),_:1},8,["type"]))}});function wn(t){const{checkTaxID:n}=jt.createCustomerService(),o=e.ref(void 0),i=e.computed(()=>{var _;return((_=t.value.companyVatNumber)==null?void 0:_.trim())??""}),a=e.computed(()=>t.value.companyLegalName??""),r=e.computed(()=>t.value.country),s=e.ref(!1),g=e.computed(()=>st(r.value??"")),d=e.computed(()=>!!(i.value&&a.value&&r.value)),N=e.computed(()=>g.value&&i.value);async function f(){var _;if(!(!d.value||!g.value||!r.value)){s.value=!0;try{const M=await n({type:"ORGANIZATION",organization:{legal_name:a.value,tax_ids:[{id:i.value,type:"GENERIC_TAX_ID"}],registered_address:{country:r.value}}});(_=M==null?void 0:M.data)!=null&&_.length?o.value=M.data[0]:o.value=void 0}finally{s.value=!1}}}return{runTaxIDCheck:f,taxIdValidationData:o,isTaxIDCheckPending:s,isTaxIDCheckEnabled:d,showViesCheckNotice:N,isSelectedCountryEU:g}}const Sn={class:"grid grid-cols-1 gap-1"},Tn={class:"grid grid-cols-1 gap-2"},Ln={key:0},Bn={class:"mt-2 flex flex-col gap-3"},Vn={class:"grid grid-cols-3 gap-2"},On={key:0},zn={class:"mt-4 grid grid-cols-1 gap-3"},jn="checkout-form",Rn=e.defineComponent({__name:"CheckoutForm",props:e.mergeModels({validation:{type:null},initialState:{type:Object},readOnlyEmail:{type:String},showCustomerInfoOnTop:{type:Boolean},isBillingInformationMandatory:{type:Boolean},getIsFieldRequired:{type:Function},readOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["submit"],["update:modelValue"]),setup(t){const n=t,o=e.ref(!1),i=e.useModel(t,"modelValue"),a=e.computed({get:()=>i.value.type==="ORGANIZATION",set:E=>{i.value.type=E?"ORGANIZATION":"INDIVIDUAL"}}),r=e.computed(()=>i.value.type==="ORGANIZATION"),s=e.computed({get:()=>i.value.country,set:E=>{i.value.country=E&&Pe(E)?E:void 0}}),g=e.computed(()=>i.value.country!=="US"),{isTaxIDCheckEnabled:d,isTaxIDCheckPending:N,taxIdValidationData:f,runTaxIDCheck:_}=wn(i),{$t:M}=T.useIntl(),c=Ie.useCustomerFormLabels(),A=E=>n.getIsFieldRequired(E)?"":" "+M({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),y=e.computed(()=>i.value.country?Ot.getCountryNameByCode(i.value.country):void 0);return(E,b)=>(e.openBlock(),e.createElementBlock("form",{id:jn,onSubmit:b[12]||(b[12]=e.withModifiers(P=>E.$emit("submit",i.value),["prevent"]))},[e.createElementVNode("div",Sn,[e.createVNode(e.unref(ie._sfc_main),{title:e.unref(c).contactInformationTitle},{default:e.withCtx(()=>[e.createElementVNode("div",Tn,[t.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(T._sfc_main),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.email),1)]),_:1}),e.createVNode(e.unref(T._sfc_main),{variant:"body-sm",tag:"span",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(re._sfc_main),{modelValue:i.value.email,"onUpdate:modelValue":b[0]||(b[0]=P=>i.value.email=P),required:"",type:"email",name:"email",disabled:!!t.readOnlyEmail,label:e.unref(c).emailLabel,placeholder:e.unref(c).emailPlaceholder+A("email"),error:t.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(Ie._sfc_main),{"single-model-value":s.value,"onUpdate:singleModelValue":b[3]||(b[3]=P=>s.value=P),required:"",name:"country",label:e.unref(c).countryLabel+A("country"),error:t.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[!o.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{key:0,size:"xs",intent:"subtle","icon-prefix":"add",class:"py-0.5",onClick:b[1]||(b[1]=P=>o.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"More billing details",description:"Label of the button in the checkout that lets you fill out all billing details",id:"checkout.billing_details.add_billing_details_button.label"})),1)]),_:1})):e.createCommentVNode("",!0),o.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{key:1,size:"sm",intent:"subtle","icon-prefix":"close",class:"py-0.5",onClick:b[2]||(b[2]=P=>o.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Remove billing details",id:"checkout.billing_details.remove_billing_details_button.label",description:"Label of the button in the checkout that lets you remove the billing details"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["single-model-value","label","error"])],64))]),e.createVNode(e.unref(Ze._sfc_main),{"is-open":o.value||!!t.isBillingInformationMandatory},{default:e.withCtx(()=>[o.value||t.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",Ln,[e.createElementVNode("div",Bn,[e.createVNode(e.unref(re._sfc_main),{modelValue:i.value.addressLine1,"onUpdate:modelValue":b[4]||(b[4]=P=>i.value.addressLine1=P),name:"address_line_1",label:e.unref(M)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(M)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+A("addressLine1"),required:"",error:t.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(re._sfc_main),{modelValue:i.value.addressLine2,"onUpdate:modelValue":b[5]||(b[5]=P=>i.value.addressLine2=P),name:"address_line_2",placeholder:e.unref(M)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+A("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Vn,[e.createVNode(e.unref(re._sfc_main),{modelValue:i.value.postalCode,"onUpdate:modelValue":b[6]||(b[6]=P=>i.value.postalCode=P),name:"postal_code",placeholder:e.unref(c).postalCodePlaceholder+A("postalCode"),error:t.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(re._sfc_main),{modelValue:i.value.city,"onUpdate:modelValue":b[7]||(b[7]=P=>i.value.city=P),name:"city",placeholder:e.unref(c).cityPlaceholder+A("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(re._sfc_main),{modelValue:i.value.state,"onUpdate:modelValue":b[8]||(b[8]=P=>i.value.state=P),name:"state",placeholder:e.unref(c).statePlaceholder+A("state"),error:t.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["title"]),t.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{key:0},{default:e.withCtx(()=>[e.createVNode(Ie._sfc_main$1,{modelValue:a.value,"onUpdate:modelValue":b[9]||(b[9]=P=>a.value=P),"no-spacing":"",class:"!flex"},null,8,["modelValue"]),e.createVNode(e.unref(Ze._sfc_main),{"is-open":r.value},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",On,[e.createElementVNode("div",zn,[e.createVNode(e.unref(re._sfc_main),{modelValue:i.value.companyLegalName,"onUpdate:modelValue":b[10]||(b[10]=P=>i.value.companyLegalName=P),required:"",name:"legal_name",label:e.unref(c).legalNameLabel,placeholder:e.unref(c).legalNamePlaceholder},null,8,["modelValue","label","placeholder"]),g.value?(e.openBlock(),e.createBlock(e.unref(re._sfc_main),{key:0,modelValue:i.value.companyVatNumber,"onUpdate:modelValue":b[11]||(b[11]=P=>i.value.companyVatNumber=P),name:"vat_number","input-class":"focus:outline-none focus:ring-0",label:e.unref(c).vatNumberLabel,placeholder:e.unref(c).vatNumberPlaceholder,error:t.validation.value.companyVatNumber.$errors,"suffix-class":"px-2 border-l-0"},e.createSlots({_:2},[e.unref(st)(i.value.country??"")?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(te._sfc_main),{type:"button",size:"sm",intent:"secondary",disabled:!e.unref(d)||e.unref(N)||t.validation.value.companyVatNumber.$invalid,onClick:e.unref(_)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Check",id:"checkout.vat_number.check_button.label",description:"The label for the check button in the checkout form"})),1)]),_:1},8,["disabled","onClick"])]),key:"0"}:void 0]),1032,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass({"opacity-75":e.unref(N)})},[e.createVNode(kn,{"tax-id-validation-result":e.unref(f)},null,8,["tax-id-validation-result"])],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1}))])],32))}}),Un={key:0,class:"flex items-center"},$n=["innerHTML"],Fn=["innerHTML"],Gn=e.defineComponent({__name:"CheckoutTitle",props:{trialPeriod:{type:Object},subscriptionName:{type:String},amount:{type:Object},billingPeriod:{type:Object},countryCode:{type:null},trialStartDate:{type:Date},subscriptionStartDate:{type:Date}},setup(t){const{$t:n}=T.useIntl();return(o,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(T._sfc_main),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.trialStartDate?t.subscriptionName:e.unref(n)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),t.trialPeriod?(e.openBlock(),e.createBlock(e.unref(at._sfc_main),{key:0,"trial-period":t.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(T._sfc_main),{variant:"body-sm",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[t.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",id:"checkout.trial_period_description",description:"The description of the trial period"},{price:e.unref(ee.formatAmount)(t.amount),startDate:t.subscriptionStartDate,period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:a=>`<strong>${a}</strong>`}):e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting today.",id:"checkout.subscription_description",description:"The description of the subscription"},{price:e.unref(ee.formatAmount)(t.amount),period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:a=>`<strong>${a}</strong>`})},null,8,Fn)):(e.openBlock(),e.createElementBlock("span",Un,[e.createVNode(e.unref(we._sfc_main),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(we.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(we._sfc_main$1),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(me._sfc_main$2),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"mr-1.5 inline-block"})]),_:1}),e.createElementVNode("span",{innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description_without_price",description:"The description of the trial period, while the price is still being determined"},{startDate:t.subscriptionStartDate,period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(n)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description_without_price",description:"The description of the subscription, while the price is still being determined"},{period_name:e.unref(ee.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,$n)]))]),_:1})]))}}),Yn=t=>{var n;return((n=t.periods)==null?void 0:n.some(o=>o.groups.some(i=>{var a;return(a=i.lines)==null?void 0:a.some(r=>r.product_items.some(s=>s.model_type==="USAGE_BASED"))})))??!1},Kn={class:"flex min-h-96 w-full items-center justify-center"},qn={class:"max-w-sm"},Qn=e.defineComponent({__name:"CheckoutNotAvailable",setup(t){const{$t:n}=T.useIntl(),o=()=>{window.location.reload()};return(i,a)=>(e.openBlock(),e.createElementBlock("div",Kn,[e.createElementVNode("div",qn,[e.createVNode(e.unref(T._sfc_main),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Checkout not available",id:"checkout.not_available.title",description:"The title of the checkout not available page"})),1)]),_:1}),e.createVNode(e.unref(T._sfc_main),{variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"The checkout is currently not available.",id:"checkout.not_available.description",description:"The description of the checkout not available page"}))+" ",1),e.createElementVNode("a",{href:"#",class:"text-primary-900 hover:underline",onClick:e.withModifiers(o,["prevent"])},e.toDisplayString(e.unref(n)({defaultMessage:"Reload",id:"checkout.not_available.reload_button",description:"The label of the reload button"})),1),e.createTextVNode(" "+e.toDisplayString(e.unref(n)({defaultMessage:"this page to try again, or contact customer support.",id:"checkout.not_available.contact_support_message",description:"The message shown when the user wants to contact customer support"})),1)]),_:1})])]))}}),Hn=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",emits:["continue-to-merchant"],setup(t){const{$t:n}=T.useIntl();return(o,i)=>(e.openBlock(),e.createBlock(Rt._sfc_main,{status:"success",title:e.unref(n)({defaultMessage:"Payment successful",id:"subscription_payment_completed_card.title",description:"The title for when a payment has been successful"})},{default:e.withCtx(()=>[e.createVNode(e.unref(T._sfc_main),{variant:"body-xs",color:"subtle",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Thank you for subscribing.",id:"subscription_payment_completed_card.thank_you_for_subscribing",description:"The text shown after a successful message before a redirect"})),1)]),_:1})]),_:1},8,["title"]))}}),Zn={class:"flex items-start"},Xn={class:"flex grow flex-col"},Wn={class:"flex items-center gap-1"},Jn={class:"ml-4 flex items-center self-center"},ht=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Zn,[e.createElementVNode("div",Xn,[e.createElementVNode("div",Wn,[e.createVNode(e.unref(T._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.name),1)]),_:1}),e.renderSlot(n.$slots,"badge")]),e.createVNode(e.unref(T._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})]),e.createElementVNode("div",Jn,[e.renderSlot(n.$slots,"default")])]))}}),eo={class:"sv-order-summary__body grid grid-cols-1 gap-1"},to={class:"px-3 py-2"},no={class:"sv-order-summary__billing-period flex flex-col gap-3"},oo={class:"px-3 py-2"},io={key:3,class:"sv-order-summary__items"},ot=e.defineComponent({__name:"OrderSummary",props:{subscription:{type:Object},invoice:{type:Object},invoicePreviewByBillingPeriod:{type:Object},trialInvoice:{type:Object},enabledPricingIds:{type:Array},trialPeriod:{type:Object},avatar:{type:String},isPaid:{type:Boolean},isUsageBased:{type:Boolean},isPreviewAndPaymentMethodsPending:{type:Boolean},collapsible:{type:String},noTitle:{type:Boolean},countryCode:{type:null},variant:{type:String}},emits:["billing-period-change"],setup(t,{emit:n}){const o=t,i=n,{$t:a}=T.useIntl(),{map:r,formatTimePeriod:s}=it.useTimePeriod(),{isMobileViewport:g}=lt.useViewport(),d=e.computed(()=>g.value?"sm":"xs"),N=l=>`${l.type}:${l.value}`,f=["DAY","WEEK","MONTH","YEAR"],_=l=>f.includes(l),M=l=>{if(!l)return;const[m,h]=l.split(":"),D=Number(h);if(!(!D||!_(m)))return{type:m,value:D}},c=e.computed({get:()=>{const l=o.subscription.billing_period;return l?`${l.type}:${l.value}`:void 0},set:l=>{if(!l)return;const[m,h]=l.split(":"),D=Number(h);D&&_(m)&&i("billing-period-change",{type:m,value:D})}}),A=l=>{var D,S,j,O;const m=(O=(j=(S=(D=o.invoicePreviewByBillingPeriod)==null?void 0:D[N(l)])==null?void 0:S.periods)==null?void 0:j[0])==null?void 0:O.amount_including_tax;if(!m)return;const h=l.type==="MONTH"&&l.value===3?a({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):a({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:s(l,{prefix:!1,hideValueForExactPeriods:!0})});return a({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:ee.formatAmount(m),period:h})},y=l=>{var m,h,D,S;return(S=(D=(h=(m=o.invoicePreviewByBillingPeriod)==null?void 0:m[N(l)])==null?void 0:h.periods)==null?void 0:D[0])==null?void 0:S.amount_including_tax},E=l=>Number(l.quantity),b=(l,m)=>{if(!m)return;const D={DAY:365,WEEK:52,MONTH:12,YEAR:1}[l.type]/Math.max(l.value??1,1),S=E(m)*D;if(Number.isFinite(S))return{quantity:S.toFixed(2),currency:m.currency}},P=(l,m)=>{if(!l||!m)return;const h=E(l)-E(m);if(!(!Number.isFinite(h)||h<=0))return{quantity:h.toFixed(2),currency:l.currency}},L=l=>{if(!l)return;const m=a({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:ee.formatAmount(l)}),h=a({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"});return`${m}${h}`},w=e.computed(()=>{var R,Z,Q;const l=le.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos??[],type:"DEFAULT"}),m=((Z=(R=l==null?void 0:l.pricing_plan_version)==null?void 0:R.billing_period_settings)==null?void 0:Z.billing_periods)??[],h=new Map,D=B=>{B&&h.set(N(B),B)},S=B=>{var K;(K=B==null?void 0:B.items)==null||K.forEach($=>{var G,q;(G=$.billing_period_configs)==null||G.forEach(W=>D(W.billing_period)),(q=$.pricing_currency_configs)==null||q.forEach(W=>{var J;(J=W.billing_period_configs)==null||J.forEach(ne=>D(ne.billing_period))})})};if((((Q=l==null?void 0:l.pricing_plan_version)==null?void 0:Q.pricing_categories)??[]).forEach(B=>{var K,$;(K=B.pricings)==null||K.forEach(G=>S(G)),($=B.pricing_groups)==null||$.forEach(G=>{var q;return(q=G.pricings)==null?void 0:q.forEach(W=>S(W))})}),!h.size)return[];const O=m.map(B=>h.get(N(B.period))).filter(B=>!!B),V=new Set(O.map(N)),H=[...h.values()].filter(B=>!V.has(N(B)));return[...O,...H]}),p=e.computed(()=>{const l=w.value[w.value.length-1],m=l?b(l,y(l)):void 0;return w.value.map(D=>{const S=D.type==="MONTH"&&D.value===3?a({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):a({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:r.value[D.type].full}),j=y(D),O=b(D,j),V=l&&D.type===l.type&&D.value===l.value?void 0:P(O,m),H=L(V);return{label:S,subLabel:A(D),labelSuffixComponent:H?{component:Xe._sfc_main,props:{color:"primary",content:H,size:d.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:c.value===`${D.type}:${D.value}`,value:`${D.type}:${D.value}`}})}),C=e.computed(()=>{const l=p.value,m=l[0],h=l[l.length-1];return{smallestPeriod:m==null?void 0:m.value,biggestPeriod:h==null?void 0:h.value}}),F=e.computed(()=>p.value.find(l=>l.value===C.value.biggestPeriod)),Y=e.computed(()=>p.value.find(l=>l.value===c.value)),u=e.computed(()=>{var R,Z,Q,B,K,$,G,q;const l=p.value,m=l[l.length-1],h=c.value;if(!m||!h||h===m.value)return"";const D=M(m.value);if(!D)return"";const S=(B=(Q=(Z=(R=o.invoicePreviewByBillingPeriod)==null?void 0:R[m.value])==null?void 0:Z.periods)==null?void 0:Q[0])==null?void 0:B.amount_including_tax,j=M(h),O=(q=(G=($=(K=o.invoicePreviewByBillingPeriod)==null?void 0:K[h])==null?void 0:$.periods)==null?void 0:G[0])==null?void 0:q.amount_including_tax;if(!j||!O)return"";const V=b(j,O),H=b(D,S);return L(P(V,H))??""}),v=l=>{const{smallestPeriod:m,biggestPeriod:h}=C.value;c.value=l?h:m};return(l,m)=>(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{class:"sv-order-summary","no-border":"","no-spacing":"","content-background":"none",title:t.noTitle?void 0:e.unref(a)({defaultMessage:"Order summary",id:"checkout.order_summary_block.title",description:"The title of the order summary block that lists the subscription cost in the checkout"})},{default:e.withCtx(()=>[e.createElementVNode("div",eo,[e.createVNode(e.unref(ie._sfc_main),{"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[t.subscription?(e.openBlock(),e.createBlock(Ut._sfc_main,{key:0,avatar:t.avatar,invoice:t.invoice,subscription:t.subscription,"enabled-pricing-ids":t.enabledPricingIds,loading:t.isPreviewAndPaymentMethodsPending,"trial-period":t.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),p.value.length===2?(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{key:0,"no-spacing":"","content-classes":c.value===C.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var h;return[e.createElementVNode("div",to,[e.createElementVNode("div",no,[F.value?(e.openBlock(),e.createBlock(ht,{key:0,name:F.value.label,description:((h=Y.value)==null?void 0:h.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(ae._sfc_main),{"model-value":c.value===C.value.biggestPeriod,"onUpdate:modelValue":v},null,8,["model-value"])]),_:2},[u.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(Xe._sfc_main),{intent:"brand",content:u.value,size:d.value,class:"whitespace-nowrap text-left leading-tight"},null,8,["content","size"])]),key:"0"}:void 0]),1032,["name","description"])):e.createCommentVNode("",!0)])])]}),_:1},8,["content-classes"])):p.value.length>2?(e.openBlock(),e.createBlock(e.unref(rt._sfc_main),{key:1,"single-model-value":c.value,"onUpdate:singleModelValue":m[0]||(m[0]=h=>c.value=h),class:"sv-order-summary__billing-period",options:p.value,size:"xl","has-large-dropdown":"","show-sub-label-in-input":"","show-suffix-in-closed-input":""},null,8,["single-model-value","options"])):e.createCommentVNode("",!0),t.isUsageBased?(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),{key:2,"no-spacing":"",class:"sv-order-summary__usage"},{default:e.withCtx(()=>[e.createElementVNode("div",oo,[e.createVNode(e.unref(T._sfc_main),{"no-spacing":"",variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"+ Usage",id:"checkout.invoice_preview.usage_based_message",description:"The message shown for the usage based invoice preview"})),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0),t.invoice&&t.variant!=="products-inline"?(e.openBlock(),e.createElementBlock("div",io,[e.createVNode(e.unref(me._sfc_main$3),{invoice:t.invoice,"wrapper-component":e.unref(ie._sfc_main)},null,8,["invoice","wrapper-component"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(ie._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(me._sfc_main$1),{key:0,class:"sv-order-summary__invoice-preview",variant:t.variant==="products-inline"?"default":"without-products",invoice:t.invoice,"trial-invoice":t.trialInvoice,"is-paid":t.isPaid,collapsible:t.collapsible,"is-preview-without-taxes":!t.countryCode,"is-customer-facing":""},null,8,["variant","invoice","trial-invoice","is-paid","collapsible","is-preview-without-taxes"])):(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,variant:"body-sm",color:"subtle",class:"sv-order-summary__empty"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Please select a country first",description:"The message shown for the invoice preview when no country is set",id:"checkout.invoice_preview.no_country_selected_message"})),1)]),_:1}))]),_:1})])]),_:1},8,["title"]))}});async function Mt(t,n){const{AdyenCheckout:o}=await Ae.loadAdyenSdk();return o(_e.getAdyenExpressCheckoutConfiguration({locale:t.locale,amount:t.amount,countryCode:t.countryCode,paymentMethodOptionResponse:t.paymentMethodOptionsResponse,logger:n}))}function bt({props:t,create:n,onMissingButton:o,onMountFailed:i,afterMount:a}){const r=e.ref(),s=T.useLogger(),g=async()=>{const d=await Mt(t,s),N=await n(d);if(!r.value){o();return}try{await N.isAvailable(),N.mount(r.value),a==null||a()}catch(f){i(f)}};return e.onMounted(()=>{g()}),{buttonRef:r}}const ao={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},ro={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},Ve=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(t,{emit:n}){const o=t,i=n,a=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),r=e.computed(()=>{switch(o.type){case"applepay":return"!bg-black !py-0";case"googlepay":return"!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";case"paypal":return"!bg-[#ffc439]";default:return}});function s(){i("click")}return(g,d)=>(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{size:"lg","aria-label":a.value,class:e.normalizeClass([r.value,"!block h-11 w-full bg-center bg-no-repeat"]),onClick:s},{default:e.withCtx(()=>[o.type==="applepay"?(e.openBlock(),e.createElementBlock("svg",ao,[...d[0]||(d[0]=[e.createElementVNode("svg",{id:"svg-logo",x:"0",y:"3.85",height:"7.3",width:"35",class:"logo",viewBox:"0 0 105 43",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("title",null,"Apple Logo"),e.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{fill:"#FFF"},[e.createElementVNode("path",{d:"M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674"}),e.createElementVNode("path",{d:"M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926"}),e.createElementVNode("path",{d:"M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381"}),e.createElementVNode("path",{d:"M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z"}),e.createElementVNode("path",{d:"M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345"})])])],-1)])])):o.type==="paypal"?(e.openBlock(),e.createElementBlock("img",ro)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),lo={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},so="ADYEN",co=e.defineComponent({__name:"ExpressPaymentMethodApplePay",props:{onBillingInformationChange:{type:Function},amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=e.ref(),r=T.useLogger(),{authorizePayment:s}=Ft.createPaymentsService(),g=o.paymentMethodOptionsResponse.payment_acceptor.id,d=async()=>{const{ApplePay:y}=await Ae.loadAdyenSdk(),E=await Mt(o,r),b=new y(E,{isExpress:!0,recurringPaymentRequest:{paymentDescription:o.billingInformation.description,billingAgreement:o.billingInformation.agreement,managementURL:"https://www.google.com",...o.billingInformation.trial&&{trialBilling:{label:o.billingInformation.trial.label,amount:o.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.trial.startDate,recurringPaymentEndDate:o.billingInformation.trial.endDate}},...o.billingInformation.regular&&{regularBilling:{label:o.billingInformation.regular.label,amount:o.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.regular.startDate,...N(o.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(P,L,w)=>{var Y,u,v,l,m,h,D;const{invoicePreview:p,trialInvoicePreview:C}=await o.onBillingInformationChange({...((Y=w.paymentMethod.billingContact)==null?void 0:Y.postalCode)&&{postal_code:w.paymentMethod.billingContact.postalCode},...((u=w.paymentMethod.billingContact)==null?void 0:u.locality)&&{city:w.paymentMethod.billingContact.locality},...M((v=w.paymentMethod.billingContact)==null?void 0:v.countryCode)&&{country:M((l=w.paymentMethod.billingContact)==null?void 0:l.countryCode)}}),F=C?C.invoice_amount_including_tax.quantity.toString():p.invoice_amount_including_tax.quantity.toString();i("update-billing-information",{postal_code:(m=w.paymentMethod.billingContact)==null?void 0:m.postalCode,city:(h=w.paymentMethod.billingContact)==null?void 0:h.locality,country:(D=w.paymentMethod.billingContact)==null?void 0:D.countryCode}),P({newTotal:{label:o.billingInformation.regular.label,amount:F,type:"final"}})},onError:P=>{r.error("APPLE_PAY_ERROR","Apple Pay error",{error:P})},onAuthorized:async(P,L)=>{try{r.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{data:P});const w=P.authorizedEvent;r.info("APPLE_PAY_EVENT_DATA","Apple Pay event data structure",{eventData:w,hasPaymentMethod:!!w.payment.token.paymentMethod,hasBrowserInfo:!!w.payment.token.paymentData,billingAddress:P.billingAddress});const p=w.payment.billingContact,C=P.billingAddress;p?i("update-billing-information",f(p)):C&&i("update-billing-information",_(C));const F={payment_method:_e.transformObjectToAdyenObject(w.payment.token.paymentMethod),browser_info:_e.transformObjectToAdyenObject(w.payment.token.paymentData)};r.info("APPLE_PAY_ADYEN_PAYLOAD","Adyen payload prepared",{adyen:F});const Y=_e.createReturnUrl({paymentAcceptorId:g,redirectUrl:window.location.href});r.info("APPLE_PAY_CALLING_API","Calling authorizePayment API",{paymentAcceptorId:g,amount:o.amount});const u=await s({payment_acceptor_id:g,payment_gateway_variant:so,adyen:{...F,store_payment_method:!0},amount:o.amount,return_url:Y});if(r.info("APPLE_PAY_API_RESPONSE","Payment API response received",{status:u.status,paymentResult:u}),u.status==="FAILURE"){r.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",{error:u}),L.reject();return}if(u.status==="ACTION_REQUIRED"){r.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",{action:u.action}),L.reject();return}r.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),L.resolve()}catch(w){r.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",{error:w}),L.reject()}}});if(!a.value){r.error("APPLE_PAY_ERROR","Apple Pay button ref not found");return}try{await b.isAvailable(),b.mount(a.value),i("ready")}catch(P){r.error("APPLE_PAY_ERROR","Apple Pay not available on this device",{},P)}},N=y=>{if(!y.value)return;let E=y.value??1,b=y.type.toLowerCase();if(y.type==="WEEK"&&(b="day",E=y.value*7),b==="day"||b==="month"||b==="year"||b==="hour"||b==="minute")return{recurringPaymentIntervalUnit:b,recurringPaymentIntervalCount:E}},f=y=>({postal_code:y.postalCode,city:y.locality,country:y.countryCode}),_=y=>({postal_code:y.postalCode,city:y.city,country:y.country}),M=y=>y&&c(y)?y:void 0,c=y=>Pe(y),A=()=>{var E;const y=(E=a.value)==null?void 0:E.querySelector("apple-pay-button");if(y){const b=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});y.dispatchEvent(b)}};return e.onMounted(()=>{d()}),(y,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Ve,{key:0,type:"applepay",onClick:A})):e.createCommentVNode("",!0),e.createElementVNode("div",lo,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:a},null,512)])],64))}}),uo={class:"relative overflow-hidden"},po=e.defineComponent({__name:"ExpressPaymentMethodPaypal",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=T.useLogger(),{buttonRef:r}=bt({props:o,onMissingButton:()=>a.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted"),onMountFailed:s=>a.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:s}),create:async s=>{const{PayPal:g}=await Ae.loadAdyenSdk();return new g(s,{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{i("ready")}})}});return(s,g)=>(e.openBlock(),e.createElementBlock("div",uo,[t.isVisible?(e.openBlock(),e.createBlock(Ve,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:r,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),mo={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},go=e.defineComponent({__name:"ExpressPaymentMethodGooglePay",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=T.useLogger(),{buttonRef:r}=bt({props:o,onMissingButton:()=>a.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted"),onMountFailed:g=>a.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{error:g}),create:async g=>{const{GooglePay:d}=await Ae.loadAdyenSdk();return new d(g,{isExpress:!0})},afterMount:()=>i("ready")}),s=()=>{var d;const g=(d=r.value)==null?void 0:d.querySelector("#gpay-button-online-api-id");if(g){const N=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});g.dispatchEvent(N)}};return(g,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Ve,{key:0,type:"googlepay",onClick:s})):e.createCommentVNode("",!0),e.createElementVNode("div",mo,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:r},null,512)])],64))}}),fo={key:0,class:"mt-4n"},yo={class:"mb-2"},vo={class:"grid grid-cols-6 gap-1 md:gap-2"},_o={class:"mt-4 h-4"},ho=2,Mo=e.defineComponent({__name:"ExpressPaymentMethods",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},paymentMethodsOptionsResponse:{type:null},billingInformation:{type:Object},onBillingInformationChange:{type:Function}},emits:["update-billing-information"],setup(t){const n=["applepay"],o=t,{$t:i}=T.useIntl(),a=e.ref(!1),r=e.ref(!1),s=e.ref(!1),g=e.computed(()=>{var c;if(n.includes("applepay"))return(c=o.paymentMethodsOptionsResponse)==null?void 0:c.find(A=>{var y;return(y=A.options)==null?void 0:y.some(E=>E.name.toLowerCase()==="apple pay"&&E.payment_gateway_variant==="ADYEN")})}),d=e.computed(()=>{var c;if(n.includes("paypal"))return(c=o.paymentMethodsOptionsResponse)==null?void 0:c.find(A=>{var y;return(y=A.options)==null?void 0:y.some(E=>E.name.toLowerCase()==="paypal"&&E.payment_gateway_variant==="ADYEN")})}),N=e.computed(()=>{var c;if(n.includes("googlepay"))return(c=o.paymentMethodsOptionsResponse)==null?void 0:c.find(A=>{var y;return(y=A.options)==null?void 0:y.some(E=>E.name.toLowerCase()==="google pay"&&E.payment_gateway_variant==="ADYEN")})}),f=e.computed(()=>!!(g.value||N.value||d.value)),_=e.computed(()=>{var E;if(((E=o.paymentMethodsOptionsResponse)==null?void 0:E.length)===0)return!1;const c=!g.value||a.value,A=!N.value||r.value,y=!d.value||s.value;return c&&A&&y}),M=e.computed(()=>_.value?(g.value?1:0)+(N.value?1:0)+(d.value?1:0):ho);return(c,A)=>f.value?(e.openBlock(),e.createElementBlock("div",fo,[e.createElementVNode("div",yo,[_.value?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Subscribe instantly with",id:"checkout.express_payment_methods.title",description:"The title of the express payment methods block in the checkout form"})),1)]),_:1})):(e.openBlock(),e.createBlock(se._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",vo,[_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(se._sfc_main,{class:"col-span-3 h-11"}),e.createVNode(se._sfc_main,{class:"col-span-3 h-11"})],64)),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!g.value,"!col-span-6":M.value===1,"md:!col-span-3":M.value===2,"!col-span-6 md:!col-span-2":M.value===3}])},[g.value?(e.openBlock(),e.createBlock(co,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":_.value,"payment-method-options-response":g.value,"on-billing-information-change":t.onBillingInformationChange,onReady:A[0]||(A[0]=y=>a.value=!0),onUpdateBillingInformation:A[1]||(A[1]=y=>c.$emit("update-billing-information",y))},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response","on-billing-information-change"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!N.value,"col-span-6 md:col-span-6":M.value===1,"md:!col-span-3":M.value===2}])},[N.value?(e.openBlock(),e.createBlock(go,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":_.value,"payment-method-options-response":N.value,onReady:A[2]||(A[2]=y=>r.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!d.value,"col-span-6 md:col-span-6":M.value===1,"md:!col-span-3":M.value===2}])},[d.value?(e.openBlock(),e.createBlock(po,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":_.value,"payment-method-options-response":d.value,onReady:A[3]||(A[3]=y=>s.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",_o,[_.value?(e.openBlock(),e.createBlock(e.unref($t._sfc_main),{key:1,text:e.unref(i)({defaultMessage:"Or",id:"checkout.express_payment_methods.divider_text",description:"The text of the divider text in the express payment methods block in the checkout form"}),"text-position":"center"},null,8,["text"])):(e.openBlock(),e.createBlock(se._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),bo=["aria-expanded","aria-label"],Io={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},No={class:"flex flex-row items-center gap-2"},Co=["onKeydown"],Ao=["aria-label"],Eo={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},Po={class:"flex flex-row items-center gap-2"},Do={class:"sr-only","aria-live":"polite"},xo=e.defineComponent({inheritAttrs:!1,__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(t,{emit:n}){const{$t:o}=T.useIntl(),i=t,a=n,r=e.ref(!1),s=e.ref(""),g=e.ref(""),d=e.ref(null),N=e.ref(null),f=Yt.uniqueId("promotion-code-"),_=`${f}-label`,M=`${f}-panel`,c=e.computed(()=>i.promotionCode!==null&&i.promotionCode!==""),A=e.computed(()=>s.value.trim().length>0),y=e.computed(()=>i.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),E=e.computed(()=>r.value?o({defaultMessage:"Collapse promotion code input",id:"checkout.promotion_code.collapse_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is open"}):o({defaultMessage:"Expand promotion code input",id:"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is closed"})),b=e.computed(()=>o({defaultMessage:"Apply promotion code",id:"checkout.promotion_code.apply_aria_label",description:"Aria label for the promotion code apply button in checkout"})),P=e.computed(()=>o({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),L=()=>{s.value=""},w=()=>{var v;const u=(v=N.value)==null?void 0:v.querySelector("input");u instanceof HTMLInputElement&&u.focus()},p=()=>{r.value&&(r.value=!1)},C=()=>{c.value||(r.value=!r.value)},F=()=>{if(!A.value)return;const u=s.value.trim();a("update:appliedCode",u),a("apply",u),g.value=o({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),r.value=!1},Y=()=>{a("update:appliedCode",null),a("remove"),g.value=o({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),L(),e.nextTick(()=>{var u;(u=d.value)==null||u.focus()})};return e.watch(r,u=>{if(!u){L(),e.nextTick(()=>{var v;(v=d.value)==null||v.focus()});return}e.nextTick(()=>{w()})}),e.watch(()=>i.promotionCode,u=>{u||L()}),(u,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c.value?(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),e.mergeProps({key:1},u.$attrs,{"no-border":"","no-spacing":"","content-background":"none",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full rounded border border-primary-900 bg-white","aria-label":P.value,onClick:Y},[e.createElementVNode("div",Eo,[e.createElementVNode("div",Po,[e.createVNode(e.unref(te._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(T._sfc_main),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1})]),e.createVNode(e.unref(te._sfc_main$1),{icon:"close"})])],8,Ao)]),_:1},16)):(e.openBlock(),e.createBlock(e.unref(ie._sfc_main),e.mergeProps({key:0},u.$attrs,{"no-spacing":"",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:d,type:"button",class:"w-full","aria-expanded":r.value,"aria-controls":M,"aria-label":E.value,onClick:C},[e.createElementVNode("div",Io,[e.createElementVNode("div",No,[e.createVNode(e.unref(te._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(T._sfc_main),{id:_,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add promotion code",id:"checkout.promotion_code.add_label",description:"Label for adding a promotion code in checkout"})),1)]),_:1})]),e.createVNode(e.unref(te._sfc_main$1),{icon:r.value?"remove":"add"},null,8,["icon"])])],8,bo),e.withDirectives(e.createElementVNode("div",{id:M,ref_key:"panelRef",ref:N,role:"region","aria-labelledby":_,class:"flex w-full flex-row items-center gap-2 overflow-hidden border-t px-3 py-2",onKeydown:e.withKeys(e.withModifiers(p,["prevent"]),["esc"])},[e.createVNode(e.unref(re._sfc_main),{modelValue:s.value,"onUpdate:modelValue":v[0]||(v[0]=l=>s.value=l),placeholder:e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.input_aria_label",description:"Aria label for promotion code input in checkout"}),class:"w-full",onKeydown:e.withKeys(e.withModifiers(F,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(te._sfc_main),{type:"button",disabled:!A.value,"aria-label":b.value,"aria-disabled":!A.value,onClick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Apply",id:"checkout.promotion_code.apply_button",description:"Button label for applying a promotion code in checkout"})),1)]),_:1},8,["disabled","aria-label","aria-disabled"])],40,Co),[[e.vShow,r.value]])]),_:1},16)),e.createElementVNode("span",Do,e.toDisplayString(g.value),1)],64))}}),ko={class:"sv-checkout__header"},wo={class:"sv-checkout__payment-methods"},So={key:0,class:"sv-checkout__payment-methods-body"},To={key:3,class:"sv-checkout__payment-form"},Lo={class:"sv-checkout__order-summary"},Bo={class:"flex flex-col gap-2"},Vo=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var Ue,$e,Fe,Ge,Ye,Ke,qe,Qe,He;const o=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PaymentIntegrationForm-CwfCLnKt.js"))),i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PlanCustomizationEditor-XpofGULc.js"))),a=t,r=n,s=e.computed(()=>a.configuration),g=e.ref(),d=e.ref(),N=T.useLogger(),{$t:f,locale:_}=T.useIntl(),{formatTimePeriod:M}=it.useTimePeriod(),c=Vt.usePortal(),{isMobileViewport:A}=lt.useViewport();if(N.info("COMPONENT_INITIALIZED","Checkout component initialized"),((Ue=c.value)==null?void 0:Ue.type)!=="INIT_PRICING_PLAN_SUBSCRIPTION")throw N.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");c.value.status==="REVOKED"&&(g.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${c.value.id}" is revoked`},N.error("RESOURCE_REVOKED",`Portal url with resource id "${c.value.id}" is revoked`));const y=(Fe=($e=c.value)==null?void 0:$e.init_pricing_plan_subscription)==null?void 0:Fe.pricing_plan_subscription_id,E=(Ye=(Ge=c.value)==null?void 0:Ge.init_pricing_plan_subscription)==null?void 0:Ye.success_url,{validatedEmail:b,validatedCountry:P,paymentMethodOptions:L,hasPaymentMethodOptionsError:w,retryPaymentMethodOptions:p,subscription:C,isPaymentMethodsPending:F,isInvoicePreviewPending:Y,checkoutForm:u,invoicePreview:v,invoicePreviewByBillingPeriod:l,trialInvoicePreview:m,trialPeriod:h,authorizationContext:D,isPaid:S,amount:j,loadInvoicePreview:O,updateInvoicePreviewOnBillingInformationChange:V,saveFormStateForRedirect:H}=An({initialCountry:(Ke=a.configuration)==null?void 0:Ke.countryCode,initialEmail:(qe=a.configuration)==null?void 0:qe.email,subscriptionId:y,enabledPricingIds:(Qe=a.configuration)==null?void 0:Qe.enabledPricingIds}),R=e.ref(!1),Z=async()=>{var I;await u.validation.value.$validate(),!u.validation.value.$invalid&&(R.value=!0,H(),(I=d.value)==null||I.submit())},Q=()=>{R.value=!1},B=async()=>(await u.validation.value.$validate(),!u.validation.value.$invalid),K=e.computed(()=>!!m.value),$=e.computed(()=>v.value?Yn(v.value):!1),G=e.computed(()=>u.form.value.country&&["US","CA"].includes(u.form.value.country)||!1),q=e.computed({get:()=>u.form.value.enabledPricingIds??[],set:I=>{u.form.value.enabledPricingIds=I}}),W=e.computed(()=>C.value?le.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:C.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),J=e.computed(()=>{var x,k;if(!C.value)return;const I=(k=(x=W.value)==null?void 0:x.pricing_plan_version)==null?void 0:k.pricing_currency_settings;return gt({country:u.form.value.country,pricingCurrencySettings:I,fallbackCurrency:C.value.billing_currency})}),ne=e.computed(()=>{if(!W.value||!C.value)return new Set;const I=le.getPricingItemConfigMetaById({pricingPlanScheduleInfo:W.value}),x=J.value,k=C.value.billing_period,U=new Set;return I.forEach((z,oe)=>{x&&z.currency!==x||k&&z.billingPeriod&&(z.billingPeriod.type!==k.type||z.billingPeriod.value!==k.value)||U.add(oe)}),U}),ge=e.computed({get:()=>{const I=u.form.value.seatsValues??[],x=ne.value;return x.size?I.filter(({pricing_item_config_id:k})=>x.has(k)):I},set:I=>{const x=u.form.value.seatsValues??[],k=ne.value;if(!k.size){u.form.value.seatsValues=I;return}const U=x.filter(({pricing_item_config_id:z})=>!k.has(z));u.form.value.seatsValues=U.concat(I)}}),fe=e.computed({get:()=>{const I=u.form.value.unitsValues??[],x=ne.value;return x.size?I.filter(({pricing_item_config_id:k})=>x.has(k)):I},set:I=>{const x=u.form.value.unitsValues??[],k=ne.value;if(!k.size){u.form.value.unitsValues=I;return}const U=x.filter(({pricing_item_config_id:z})=>!k.has(z));u.form.value.unitsValues=U.concat(I)}}),be=e.computed(()=>{var I,x,k,U,z;return m.value?f({defaultMessage:"{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",id:"checkout.agreement.trial",description:"The agreement for the trial period"},{discounted_amount:m.value.tax_summary.total_amount.quantity==="0.00"?f({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):ee.formatAmount(m.value.tax_summary.total_amount),trial_period:M(h.value,{short:!0}),subscription_amount:ee.formatAmount(((I=v.value)==null?void 0:I.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:M(((x=v.value)==null?void 0:x.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(ue.value)}):f({defaultMessage:"{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",id:"checkout.agreement.subscription",description:"The agreement for the subscription"},{subscription_amount:(k=v.value)!=null&&k.tax_summary.total_amount?ee.formatAmount((U=v.value)==null?void 0:U.tax_summary.total_amount):"",billing_period:M(((z=v.value)==null?void 0:z.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(ue.value)})}),ye=e.computed(()=>{var x;if(!v.value)return;const I=he.getSubscriptionName({subscription:C.value,fallback:f({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})});return{description:I,managementURL:"https://www.solvimon.com/account/billing",agreement:be.value,...m.value&&h.value&&{trial:{label:f({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:m.value.tax_summary.total_amount,startDate:De.value?new Date(De.value):void 0,endDate:Oe.value?new Date(Oe.value):void 0}},regular:{label:I,amount:v.value.tax_summary.total_amount,startDate:ue.value?new Date(ue.value):void 0,interval:((x=C.value)==null?void 0:x.billing_period)??{type:"MONTH",value:1}}}}),X=I=>Pe(I),It=I=>{const{country:x,...k}=I;u.updateInitialState({...k,...x&&X(x)?{country:x}:{}})},Nt=e.computed(()=>!(b&&P)),De=e.computed(()=>{var k,U,z;const I=(U=(k=m.value)==null?void 0:k.periods)==null?void 0:U[0],x=(z=xe.value)==null?void 0:z.trialStartDate;return I!=null&&I.start_at?new Date(I.start_at):x}),xe=e.computed(()=>he.getFallbackTrialAndSubscriptionStartAndEndDates(C.value)),Oe=e.computed(()=>{var k,U,z;const I=(U=(k=m.value)==null?void 0:k.periods)==null?void 0:U[0],x=(z=xe.value)==null?void 0:z.trialEndDate;return I!=null&&I.end_at?new Date(I.end_at):x}),ue=e.computed(()=>{var k,U,z;const I=(U=(k=v.value)==null?void 0:k.periods)==null?void 0:U[0],x=(z=xe.value)==null?void 0:z.subscriptionStartDate;return I!=null&&I.start_at?new Date(I.start_at):x}),Ct=e.computed(()=>!!(u.form.value.seatsValues&&u.form.value.seatsValues.length>0||u.form.value.unitsValues&&u.form.value.unitsValues.length>0||C.value&&_n(C.value)||C.value&&hn(C.value))),ve=e.ref(null),{applyPromotionCode:ze,removePromotionCode:At,isPromotionCodePending:Et,promotionCodeErrorMessage:ke}=En({checkoutForm:u,updateInvoicePreviewOnBillingInformationChange:V,formatErrorMessage:({action:I})=>f(I==="apply"?{defaultMessage:"Promotion code could not be applied. Please try again.",id:"checkout.promotion_code.apply_failed",description:"Error message when applying a promotion code in checkout failed"}:{defaultMessage:"Promotion code could not be removed. Please try again.",id:"checkout.promotion_code.remove_failed",description:"Error message when removing a promotion code in checkout failed"}),onInvalidPromotionCode:()=>{ve.value=null},onApplyError:()=>{ve.value=null}});Dn({subscription:C,promotionCode:(He=a.configuration)==null?void 0:He.couponCode,appliedPromotionCode:ve,applyPromotionCode:ze});const je=()=>{E&&pe.safeUrlRedirect(E)},Pt=e.computed(()=>{var I;return!((I=a.configuration)!=null&&I.onPaymentSuccess)&&!!E}),Dt=()=>{var I;if(S.value=!0,ke.value=null,(I=a.configuration)!=null&&I.onPaymentSuccess){a.configuration.onPaymentSuccess();return}if(E){je();return}},Re=I=>{C.value&&(C.value={...C.value,billing_period:I},O())};return e.onMounted(()=>{r("ready")}),(I,x)=>g.value?(e.openBlock(),e.createBlock(Qn,{key:0,class:"sv-checkout sv-root sv-screen sv-checkout--error"})):(e.openBlock(),e.createBlock(e.unref(Gt.ContentWithAsideLayout),{key:1,class:e.normalizeClass(["sv-checkout sv-root sv-screen",{"sv-checkout--paid":e.unref(S)}])},{header:e.withCtx(()=>[e.createElementVNode("div",ko,[e.createVNode(se._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var k,U,z;return[e.unref(v)&&e.unref(C)&&ue.value?(e.openBlock(),e.createBlock(Gn,{key:0,class:"sv-checkout__title","trial-start-date":De.value,"trial-period":e.unref(h),"subscription-start-date":ue.value,"subscription-name":((k=e.unref(C))==null?void 0:k.name)??"",amount:(U=e.unref(v))==null?void 0:U.invoice_amount_including_tax,"billing-period":(z=e.unref(C))==null?void 0:z.billing_period,"country-code":e.unref(u).form.value.country},null,8,["trial-start-date","trial-period","subscription-start-date","subscription-name","amount","billing-period","country-code"])):e.createCommentVNode("",!0)]}),_:1})])]),content:e.withCtx(()=>{var k,U,z;return[e.unref(S)?(e.openBlock(),e.createBlock(Hn,{key:0,class:"sv-checkout__completed-payment",onContinueToMerchant:je})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(C)&&e.unref(A)?(e.openBlock(),e.createBlock(ot,{key:0,class:"sv-checkout__mobile-order-summary",subscription:e.unref(C),invoice:e.unref(v),"invoice-preview-by-billing-period":e.unref(l),"trial-invoice":e.unref(m),"enabled-pricing-ids":q.value,"trial-period":e.unref(h),avatar:(k=s.value)==null?void 0:k.avatar,"is-paid":e.unref(S),"is-usage-based":$.value,"is-preview-and-payment-methods-pending":e.unref(F)||e.unref(Y),"country-code":e.unref(u).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:Re},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending","country-code"])):e.createCommentVNode("",!0),Ct.value&&e.unref(C)?(e.openBlock(),e.createBlock(e.unref(i),{key:1,"seats-values":ge.value,"onUpdate:seatsValues":x[0]||(x[0]=oe=>ge.value=oe),"units-values":fe.value,"onUpdate:unitsValues":x[1]||(x[1]=oe=>fe.value=oe),"enabled-pricing-ids":q.value,"onUpdate:enabledPricingIds":x[2]||(x[2]=oe=>q.value=oe),class:"sv-checkout__plan-customization",subscription:e.unref(C),"initial-seats-values":(U=e.unref(u).initialState)==null?void 0:U.value.seatsValues,"initial-units-values":(z=e.unref(u).initialState)==null?void 0:z.value.unitsValues,"billing-period":e.unref(C).billing_period,currency:J.value},null,8,["seats-values","units-values","enabled-pricing-ids","subscription","initial-seats-values","initial-units-values","billing-period","currency"])):e.createCommentVNode("",!0),e.unref(u).form.value.country&&e.unref(j)&&ye.value?(e.openBlock(),e.createBlock(Mo,{key:2,class:"sv-checkout__express-payment-methods",amount:e.unref(j),"country-code":e.unref(u).form.value.country,locale:e.unref(_),"payment-methods-options-response":e.unref(L)??[],"billing-information":ye.value,"on-billing-information-change":e.unref(V),onUpdateBillingInformation:It},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.createVNode(Rn,{modelValue:e.unref(u).form.value,"onUpdate:modelValue":x[3]||(x[3]=oe=>e.unref(u).form.value=oe),class:"sv-checkout__customer-form",validation:e.unref(u).validation,"read-only-email":e.unref(b),"show-customer-info-on-top":Nt.value||e.unref(S),"is-billing-information-mandatory":G.value,"get-is-field-required":e.unref(u).getIsFieldRequired,"read-only":e.unref(S)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"]),e.createElementVNode("div",wo,[e.createVNode(se._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!e.unref(F)||e.unref(F)&&e.unref(L).length>0?(e.openBlock(),e.createElementBlock("div",So,[e.createVNode(e.unref(T._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-checkout__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Payment method",id:"checkout.payment_method_block.title",description:"The title of the payment method block in the checkout form"})),1)]),_:1}),e.unref(u).form.value.country?e.unref(w)?(e.openBlock(),e.createBlock(me._sfc_main,{key:1,class:"sv-checkout__payment-methods-error",icon:"error"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Could not load payment methods",id:"checkout.payment_method_block.load_failed_title",description:"The title shown when the payment methods failed to load"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Check your connection and try again.",id:"checkout.payment_method_block.load_failed_message",description:"The message shown when the payment methods failed to load"})),1)]),action:e.withCtx(()=>[e.createVNode(e.unref(te._sfc_main),{type:"button",intent:"secondary",size:"sm",class:"sv-action sv-action--secondary sv-checkout__payment-methods-retry",onClick:e.unref(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Try again",id:"checkout.payment_method_block.load_failed_retry_button.label",description:"The label of the button that loads the payment methods again"})),1)]),_:1},8,["onClick"])]),_:1})):e.unref(L).length===0?(e.openBlock(),e.createBlock(me._sfc_main,{key:2,class:"sv-checkout__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No payment methods available",id:"checkout.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),_:1})):e.unref(j)&&e.unref(u).form.value.country?(e.openBlock(),e.createElementBlock("div",To,[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":R.value})},[e.createVNode(e.unref(o),{ref_key:"paymentIntegrationFormRef",ref:d,"country-code":e.unref(u).form.value.country,context:e.unref(D),amount:e.unref(j),email:e.unref(u).form.value.email,variant:"AUTHORIZE","payment-method-options":e.unref(L)??[],"validate-on-submit":B,"redirects-on-success":Pt.value,"force-store-payment-method":"",onPaymentSuccess:Dt,onPaymentFailed:Q,onReady:x[4]||(x[4]=oe=>r("ready"))},null,8,["country-code","context","amount","email","payment-method-options","redirects-on-success"])],2)])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(me._sfc_main,{key:0,class:"sv-checkout__payment-methods-empty",icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Select your billing country",id:"checkout.payment_method_block.no_country_selected_title",description:"The title shown when no country is selected"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Payment methods will be shown after you select the billing country.",id:"checkout.payment_method_block.no_country_selected_message",description:"The message shown when no country is selected"})),1)]),_:1}))])):e.createCommentVNode("",!0)]),_:1})])],64))]}),aside:e.withCtx(()=>[e.createElementVNode("div",Lo,[e.createVNode(se._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var k;return[e.unref(C)&&e.unref(v)?(e.openBlock(),e.createBlock(ot,{key:0,subscription:e.unref(C),invoice:e.unref(v),"invoice-preview-by-billing-period":e.unref(l),"trial-invoice":e.unref(m),"enabled-pricing-ids":q.value,"trial-period":e.unref(h),"country-code":e.unref(u).form.value.country,avatar:(k=s.value)==null?void 0:k.avatar,"is-paid":e.unref(S),"is-usage-based":$.value,"is-preview-and-payment-methods-pending":e.unref(F)||e.unref(Y),onBillingPeriodChange:Re},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","country-code","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending"])):e.createCommentVNode("",!0)]}),_:1})]),e.unref(S)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(xo,{class:"sv-checkout__promotion-code","promotion-code":ve.value,"onUpdate:appliedCode":x[5]||(x[5]=k=>ve.value=k),onRemove:e.unref(At),onApply:e.unref(ze)},null,8,["promotion-code","onRemove","onApply"]),e.unref(ke)?(e.openBlock(),e.createBlock(e.unref(xt._sfc_main),{key:0,class:"sv-checkout__promotion-error mt-2",title:e.unref(ke)},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",Bo,[e.createVNode(se._sfc_main,{class:"sv-checkout__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.unref(v)?(e.openBlock(),e.createBlock(e.unref(te._sfc_main),{key:0,type:"button",size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-checkout__submit w-full",disabled:e.unref(Et)||e.unref(L).length===0||R.value,loading:R.value,onClick:Z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(K.value?e.unref(f)({defaultMessage:"Start trial",id:"checkout.pay_and_subscribe_button_trial.label",description:"The label of the start trial button in the checkout form"}):e.unref(f)({defaultMessage:"Pay and subscribe",id:"checkout.pay_and_subscribe_button.label",description:"The label of the pay and subscribe button in the checkout form"})),1)]),_:1},8,["disabled","loading"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(rt._sfc_main$1,{"payment-method-options":e.unref(L)},null,8,["payment-method-options"])])],64))]),_:1},8,["class"]))}}),Oo=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var s;const o=Kt.getComponentName("checkout"),i=t,a=n,r=((s=i.configuration)==null?void 0:s.couponCode)??pe.getQueryParam("coupon_code")??void 0;return(g,d)=>(e.openBlock(),e.createBlock(e.unref(T._sfc_main$1),{entry:g.$props,"component-name":e.unref(o),"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],onError:d[1]||(d[1]=N=>g.$emit("error",N))},{default:e.withCtx(()=>{var N,f,_,M,c;return[e.createVNode(Vo,{configuration:{avatar:(f=(N=t.branding)==null?void 0:N.emblem)==null?void 0:f.public_url,email:(_=t.configuration)==null?void 0:_.email,countryCode:(M=t.configuration)==null?void 0:M.countryCode,enabledPricingIds:(c=t.configuration)==null?void 0:c.enabledPricingIds,couponCode:e.unref(r)},onReady:d[0]||(d[0]=A=>a("ready"))},e.createSlots({_:2},[g.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(g.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["configuration"])]}),_:3},8,["entry","component-name"]))}}),{define:zo}=T.createSolvimonElement(Oo,"checkout");exports.FALLBACK_SEATS_NUMBER=vt;exports.FALLBACK_UNITS_NUMBER=_t;exports._sfc_main=ht;exports.defineSolvimonCheckout=zo;exports.getPricingItemByPricingConfigId=Mn;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),Je=require("./api.es-duCDtZD9.js"),M=require("./customElements-Vox1PB6G.js"),Ze=require("./component-B7ZDyqBp.js"),et=require("./useService-H7BjLg8P.js"),Me=require("./ErrorNotification.vue.es-Cd2UKPAz.js"),J=require("./pricingItemConfigs.es-D4aYkYcf.js"),ue=require("./wallets.es-CNIMW5ay.js"),z=require("./Button.vue.es-M_jXZda4.js"),j=require("./TooltipParagraph.vue.es-BaqCDjl8.js"),Z=require("./Section.vue.es-Btff-cLY.js"),Se=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),xe=require("./RadioGroupExtended.vue.es-Cb1iD73r.js"),I=require("./index-DwueOtPi.js"),le=require("./formatting.es-C72Nsrmh.js"),tt=require("./Divider.vue.es-UwnWvUTl.js"),Be=require("./Expand.vue.es-BtM0EZEr.js"),Ue=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js"),ot=require("./cn.es-CvmLj7KH.js"),Pe=require("./invoices-xOV2YaEV.js"),nt=require("./useWatchDebounced-CAU1WI1P.js"),at=require("./Input.vue.es-CTOrmrcB.js"),re=require("./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Co3XAxaY.js"),it=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js"),st=require("./customer.es-BButyYo0.js"),ut=require("./usePaymentMethodOptions-cT1o-BA1.js"),Ae=require("./Modal.vue.es-BD4vUaOQ.js"),lt=3e4,ne=60,ae=12,rt=e.defineComponent({__name:"DateTimeAgo",props:{date:{},actionVerb:{}},setup(t){const o=60*ne,n=24*o,a=t,{$t:i,formatDate:s}=M.useIntl(),l=e.ref(Date.now());let u;e.onMounted(()=>{u=setInterval(()=>{l.value=Date.now()},lt)}),e.onBeforeUnmount(()=>{clearInterval(u)});const d=(f,v)=>{const p=(v.getFullYear()-f.getFullYear())*ae+(v.getMonth()-f.getMonth());return v.getDate()<f.getDate()?p-1:p},g=e.computed(()=>{const f=Math.max(0,(l.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=d(a.date,new Date(l.value));if(v<1){const p=Math.trunc(f/n);return p===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:p})}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)})}),y=e.computed(()=>a.actionVerb?`${a.actionVerb} ${g.value}`:g.value),S=e.computed(()=>s({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(S.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(y.value),1)]),_:1}))}}),ct=t=>{const{$t:o,formatNumber:n}=M.useIntl(),a=h=>ue.formatWalletBalanceValue(o,n,h),i=e.computed(()=>{var h,T;return((T=(h=t.walletBalance.wallet)==null?void 0:h.wallet_type)==null?void 0:T.name)||o({defaultMessage:"Balance",id:"wallet_balance.balance_label",description:"Label shown above a wallet's balance amount"})}),s=h=>{var T;return(((T=h.pricing_item)==null?void 0:T.configs)??[]).filter(m=>!!m.on_demand)},l=e.computed(()=>(t.walletBalance.charge_on_demand_pricing_items??[]).filter(h=>s(h).some(T=>J.isFixedPricing(T)||J.isFlexiblePricing(T)))),u=e.computed(()=>l.value.find(h=>s(h).some(T=>J.isFlexiblePricing(T)))),d=e.computed(()=>!!t.showManualTopUp&&l.value.length>0),g=e.computed(()=>!!t.showAutoTopUp&&!!u.value),y=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet)==null?void 0:h.auto_top_up_configs)==null?void 0:T.find(m=>m.status==="ACTIVE")}),S=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet_balance.open_balance)==null?void 0:h.credits)==null?void 0:T.credit_type}),f=(h,T)=>a({credits:{quantity:h,credit_type_id:T,credit_type:S.value}}),v=h=>h.amount?a({amount:h.amount}):h.credits?f(h.credits.quantity,h.credits.credit_type_id):"",p=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.pricing_item_id;if(!m)return;const C=(t.walletBalance.charge_on_demand_pricing_items??[]).filter(A=>A.pricing_item_id===m).flatMap(A=>s(A)).flatMap(A=>A.wallet_grants??[]),B=(T=t.walletBalance.wallet)==null?void 0:T.wallet_type_id;return C.find(A=>A.wallet_type_id===B)??C[0]}),w=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.topup_amount,C=(T=p.value)==null?void 0:T.credits_grant;if(!m||!C)return"";if(C.credits)return f(C.credits.quantity,C.credits.credit_type_id);if(C.conversion){const B=Number(m.quantity)*Number(C.conversion.rate);return f(String(B),C.conversion.credit_type_id)}return""}),P=e.computed(()=>y.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"})),D=e.computed(()=>{const h=y.value;if(!h)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 T=h.topup_amount?a({amount:h.topup_amount}):"",m=v(h.threshold);return!T||!m?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:T,threshold:m}):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:T,threshold:m})});return{walletName:i,formatBalance:a,manualTopUpItems:l,flexibleManualTopUpItem:u,showManualTopUp:d,showAutoTopUp:g,activeTopUpConfig:y,autoTopUpLabel:P,autoTopUpExplanation:D}},dt={class:"flex flex-col gap-3 py-3"},pt={class:"flex flex-col gap-1 px-4"},mt={class:"flex w-full justify-between gap-3"},ft={class:"flex w-full items-center gap-4"},vt={key:0},ht={key:1,class:"flex w-full justify-between gap-3 px-4"},gt={class:"flex min-w-0 items-center gap-1"},_t={class:"flex min-w-0 items-center gap-1"},yt={class:"shrink-0"},bt=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:s,flexibleManualTopUpItem:l,showManualTopUp:u,showAutoTopUp:d,activeTopUpConfig:g,autoTopUpLabel:y,autoTopUpExplanation:S}=ct(o);return(f,v)=>(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[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 p,w;return[(p=t.walletBalance.wallet_balance)!=null&&p.balance_at?(e.openBlock(),e.createBlock(rt,{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",ft,[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(u)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",onClick:v[0]||(v[0]=p=>f.$emit("top-up",e.unref(s)[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",vt,[e.renderSlot(f.$slots,"graph")])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",gt,[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(S)),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",_t,[e.createVNode(M._sfc_main,{variant:"body-sm",color:"secondary","no-spacing":"",class:"truncate"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1}),e.createVNode(z._sfc_main$1,{icon:"info",size:"2xs",class:"shrink-0 cursor-help text-gray-400"})])]),_:1})]),e.createElementVNode("div",yt,[e.unref(g)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",intent:"secondary",onClick:v[1]||(v[1]=p=>f.$emit("cancel-auto-top-up",e.unref(g)))},{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]=p=>f.$emit("auto-top-up",e.unref(l)))},{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)]))}}),wt={class:"flex flex-col gap-2"},Tt=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",wt,[(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(bt,{"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 Ct(){const t=M.createRequestService(),o=M.useConfig();function n(a){return t({url:`${o.apiUrls.config}/portal/customers/${a}/wallets/balance`,query:Je.withExpand({expandParams:Ze.EXPAND_ALL}),options:{method:"POST"},data:{}})}return{getCustomerWalletBalances:n}}function Mt({customerId:t}){const{getCustomerWalletBalances:o}=Ct(),{data:n,execute:a,apiStatus:i,error:s,isPending:l}=et.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:i,error:s,fetch:a,isPending:l}}const ve=(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))},St=["TOP_UP","ADD_PAYMENT_METHOD","SUCCESS"],ce=t=>typeof t=="object"&&t!==null&&"pricing_item"in t,xt=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]:[]))],Bt=(t,o)=>{const n=new Set(xt(t));return o.flatMap(a=>{const i=(a.pricing_plan_schedule_infos??[]).filter(({id:s})=>n.has(s));return i.length===0?[]:[{id:a.id,name:a.name||a.reference||a.id,scheduleIds:i.map(({id:s})=>s),enabledPricingIds:i.flatMap(s=>{var l;return(((l=s.pricing_plan_schedule)==null?void 0:l.enabled_pricings)??[]).flatMap(({pricing_id:u})=>u?[u]:[])})}]})},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))}},Ne=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(s=>{const l=kt(s,t),u=Pt(s,t);return{pricingItemId:n,...o.pricing_plan_schedule_id&&{pricingPlanScheduleId:o.pricing_plan_schedule_id},config:s,...l&&{flexiblePricing:l},...u&&{fixedPricing:u}}}):[]});function Pt(t,o){var s,l,u;if(!t.on_demand||!J.hasOneOfPricingTypes(t,["FIXED"]))return;const n=(u=(l=(s=t.details)==null?void 0:s.bands)==null?void 0:l[0])==null?void 0:u.fixed_amount;if(!n)return;const a=ke(o),i=a?Nt(t,o):void 0;return{amount:n,value:i&&a?de(i.quantity,a):{amount:n}}}const ke=t=>{var o;return(o=t==null?void 0:t.wallet_balance.balance)==null?void 0:o.credits},Ee=(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)},At=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.conversion))==null?void 0:n.credits_grant)==null?void 0:a.conversion},Nt=(t,o)=>{var n,a;return(a=(n=Ee(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}}),Ve=(t,o)=>{const n=Number(t),a=Number(o);return Number.isFinite(n)&&Number.isFinite(a)?String(n*a):void 0};function kt(t,o){var d,g,y,S,f,v,p;if(!t.on_demand||!J.isFlexiblePricing(t))return;const n=(g=(d=t.details)==null?void 0:d.bands)==null?void 0:g[0],a=((y=n==null?void 0:n.minimum_amount)==null?void 0:y.currency)??((S=n==null?void 0:n.maximum_amount)==null?void 0:S.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=ke(o),s=i?At(t,o):void 0,l=(p=i==null?void 0:i.credit_type)==null?void 0:p.unit_name,u=w=>{if(!w)return;const P=i&&s?Ve(w.quantity,s.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,...s&&{creditsConfiguration:{conversionRate:s.rate,...(l==null?void 0:l.singular)&&{unitNameSingle:l.singular},...(l==null?void 0:l.plural)&&{unitNamePlural:l.plural}}},bounds:{...u(n==null?void 0:n.minimum_amount)&&{minimum:u(n==null?void 0:n.minimum_amount)},...u(n==null?void 0:n.maximum_amount)&&{maximum:u(n==null?void 0:n.maximum_amount)}}}}const Et=t=>{var o,n,a,i,s;return!!((o=t.fixedPricing)!=null&&o.value.credits)||!!((n=t.flexiblePricing)!=null&&n.creditsConfiguration)||!!((s=((a=t.flexiblePricing)==null?void 0:a.bounds.minimum)??((i=t.flexiblePricing)==null?void 0:i.bounds.maximum))!=null&&s.credits)},Vt=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}},$t=(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}},$e=(t=[])=>{var o,n,a;for(const{fixedPricing:i,flexiblePricing:s}of t){const l=(i==null?void 0:i.value.credits)??((o=(s==null?void 0:s.bounds.minimum)??(s==null?void 0:s.bounds.maximum))==null?void 0:o.credits);if((a=(n=l==null?void 0:l.credit_type)==null?void 0:n.unit_name)!=null&&a.plural)return l.credit_type.unit_name.plural}},Ot=(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{}},Dt=(t=[])=>{if(t.some(Et)){const o=Vt(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}}},qt=(t,o)=>{var l;if(t.fixedPricing)return t.fixedPricing.value;if(!t.flexiblePricing||!o)return;const{bounds:n,creditsConfiguration:a}=t.flexiblePricing,i=(l=n.minimum??n.maximum)==null?void 0:l.credits,s=a?Ve(o.quantity,a.conversionRate):void 0;return i&&s!==void 0?de(s,i):{amount:o}},Oe=(t=[])=>{const o=Dt(t);if(o)return{denomination:o,chargeCurrency:$t(t)??"",creditUnitName:$e(t),conversionRate:Ot(t),topUpBounds:It(t)}},Rt=400;function Ft({pricingPlanScheduleId:t,pricingItems:o}){const{previewChargeOnDemandPricingItems:n}=Pe.createInvoicesService(),a=M.useLogger(),i=e.ref(),s=e.ref(!1),l=M.createLatestGuard(),u=async()=>{const d=t.value,g=l();if(!d||!o.value){o.value&&!d&&a.warn("INVOICE_PREVIEW_SKIPPED","Skipped the top-up invoice preview: no schedule to charge it on",{missing:["pricingPlanScheduleId"]}),i.value=void 0,s.value=!1;return}s.value=!0;try{const y=await n({pricingPlanScheduleId:d,pricingItems:o.value});g()&&(i.value=y)}catch(y){g()&&(i.value=void 0),a.error("INVOICE_PREVIEW_FAILED","Failed to load top-up invoice preview",{},y)}finally{g()&&(s.value=!1)}};return nt.useWatchDebounced(o,()=>void u(),{debounce:Rt,deep:!0}),u(),{invoicePreview:i,isPreviewPending:s,loadPreview:u}}const Lt={key:0},Ie=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:s}=Ft({pricingPlanScheduleId:a,pricingItems:i});return(l,u)=>(e.openBlock(),e.createBlock(Se._sfc_main,{class:"sv-top-up-invoice-preview h-[152px]","data-testid":"top-up-invoice-preview-skeleton"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(ot._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(Ue._sfc_main$1),{invoice:e.unref(s),"is-customer-facing":""},null,8,["invoice"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))}}),De=(t,o)=>t.currency??o??t.creditTypeId??"",he=(t,o)=>({quantity:t??null,currency:o}),ie=(t,{denomination:o,chargeCurrency:n,creditUnitName:a,minimumTopUp:i})=>{var s,l,u,d,g;return{enabled:(t==null?void 0:t.status)==="ACTIVE",threshold:he(((l=(s=t==null?void 0:t.threshold)==null?void 0:s.amount)==null?void 0:l.quantity)??((d=(u=t==null?void 0:t.threshold)==null?void 0:u.credits)==null?void 0:d.quantity),De(o,a)),topUpAmount:he(((g=t==null?void 0:t.topup_amount)==null?void 0:g.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??""}}:{}},ge=(t,o)=>{var n;return(n=t.topUpAmount)!=null&&n.quantity?{quantity:t.topUpAmount.quantity,currency:t.topUpAmount.currency??o}:void 0},qe=(t,{denomination:o,chargeCurrency:n})=>({status:t.enabled?"ACTIVE":"INACTIVE",threshold:Yt(t,o),...ge(t,n)&&{topup_amount:ge(t,n)}}),_e=(t,o)=>qe(ie(t,o),o),ye=(t,o)=>JSON.stringify(t)===JSON.stringify(o),be=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},we=(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),Te=(t,o)=>o==="AMOUNT"?me(t):String(Number(t.toFixed(6))),Re=(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"],se=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(),s=e.computed(()=>o.entryBase??o.modelBase),l=e.computed(()=>s.value!==o.modelBase&&ee(o.conversionRate)!==void 0),u=e.ref("");e.watch(()=>[n.value,s.value,o.modelBase,o.conversionRate],([m])=>{if(!l.value){u.value=m??"";return}if(m===g(u.value))return;const C=we(m,o.modelBase,s.value,o.conversionRate);u.value=C===void 0?"":Te(C,s.value)},{immediate:!0});function d(m){return typeof m=="string"?m:typeof m=="number"?String(m):""}function g(m){const C=we(m,s.value,o.modelBase,o.conversionRate);return C===void 0?"":Te(C,o.modelBase)}const y=e.computed({get:()=>u.value,set:m=>{u.value=d(m),n.value=l.value?g(u.value):u.value}}),S=e.computed(()=>pe(u.value,s.value,o.conversionRate)),f=e.computed(()=>o.creditUnitName?o.creditUnitName:s.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"})),v=(m,C)=>le.formatAmount({quantity:me(m),currency:C}),p=m=>`${i(m)} ${f.value}`,w=e.computed(()=>{const m=o.error;return Array.isArray(m)?m.length>0:!!(e.isRef(m)?m.value:m)}),P=e.computed(()=>{const m=S.value;if(!(w.value||!o.showConversionHint||m===void 0))return s.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:v(m,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:p(m)})}),D=m=>Re(m,s.value,o.conversionRate,i),h=e.computed(()=>{var m,C,B,A;return s.value==="CREDITS"?f.value:((C=(m=o.bounds)==null?void 0:m.minimum)==null?void 0:C.currency)??((A=(B=o.bounds)==null?void 0:B.maximum)==null?void 0:A.currency)??o.unit}),T=e.computed(()=>{var A,_;const m=D((A=o.bounds)==null?void 0:A.minimum),C=D((_=o.bounds)==null?void 0:_.maximum),B=h.value;if(m&&C)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:m,maximum:C,unit:B});if(m)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:m,unit:B});if(C)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:C,unit:B})});return(m,C)=>(e.openBlock(),e.createBlock(e.unref(at._sfc_main),{modelValue:y.value,"onUpdate:modelValue":C[0]||(C[0]=B=>y.value=B),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},[T.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(T.value),1)]),_:1},8,["data-testid"])]),key:"0"}:void 0,P.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(P.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:s,...l}=o;return l});return(s,l)=>(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(s.$slots,"default")]),_:2},[s.$slots.right?{name:"right",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"right")]),key:"0"}:void 0]),1040,["content-classes"]))}}),Gt={class:"flex grow flex-col"},Fe=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:s,formatNumber:l}=M.useIntl(),u=e.computed(()=>{var _,x;return{denomination:a.denomination,chargeCurrency:a.chargeCurrency,creditUnitName:a.creditUnitName,minimumTopUp:(x=(_=a.topUpBounds)==null?void 0:_.minimum)==null?void 0:x.quantity}}),d=e.ref(ie(a.config,u.value)),g=e.computed(()=>De(a.denomination,a.creditUnitName)),y=e.computed(()=>a.denomination.creditTypeId?"CREDITS":"AMOUNT"),S=e.computed(()=>y.value==="CREDITS"?g.value:a.chargeCurrency),f=e.computed({get:()=>{var _;return((_=d.value.threshold)==null?void 0:_.quantity)??""},set:_=>{d.value.threshold={quantity:_||null,currency:g.value}}}),v=e.computed({get:()=>{var _;return((_=d.value.topUpAmount)==null?void 0:_.quantity)??""},set:_=>{d.value.topUpAmount={quantity:_||null,currency:a.chargeCurrency}}});e.watch(()=>[a.config,u.value],([_,x])=>{ye(_e(_,x),P())||(d.value=ie(_,x))});const p=e.computed({get:()=>a.alwaysEnabled||d.value.enabled,set:_=>{d.value.enabled=_}}),w=e.computed(()=>qe({...d.value,enabled:p.value},u.value)),P=()=>w.value,D=e.reactive({threshold:e.computed(()=>be(d.value.threshold)??null),topUpAmount:e.computed(()=>be(d.value.topUpAmount)??null)}),h=_=>{if(!_)return"";const x=Re(_,y.value,a.conversionRate,l);return x===void 0?le.formatAmount(_):`${x} ${S.value}`},T=I.requiredIf(()=>p.value),m=I.useValidation({threshold:{required:I.common.withMessage(()=>s({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"}),T),notNegative:I.common.withMessage(()=>s({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"}),_=>_===null||_>=0)},topUpAmount:{required:I.common.withMessage(()=>s({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"}),T),positive:I.common.withMessage(()=>s({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"}),_=>_===null||_>0),atLeastMinimum:I.common.withMessage(()=>{var _;return s({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:h((_=a.topUpBounds)==null?void 0:_.minimum)})},_=>{var x;return Wt(_,(x=a.topUpBounds)==null?void 0:x.minimum)}),withinMaximum:I.common.withMessage(()=>{var _;return s({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:h((_=a.topUpBounds)==null?void 0:_.maximum)})},_=>{var x;return Ht(_,(x=a.topUpBounds)==null?void 0:x.maximum)})}},D),C=e.computed(()=>!ye(P(),_e(a.config,u.value)));function B(){return m.value.$touch(),m.value.$invalid?void 0:P()}function A(){const _=B();_&&i("save",_)}return o({submit:A,validate:B,rule:w,hasChanges:C,isInvalid:e.computed(()=>m.value.$invalid)}),(_,x)=>(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(I._sfc_main),{key:0,modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=q=>p.value=q),"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(s)({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(s)({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(Be._sfc_main),{"is-open":p.value},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid grid-cols-1 gap-3",{"mt-4":!t.alwaysEnabled}])},[e.createVNode(se,{modelValue:f.value,"onUpdate:modelValue":x[1]||(x[1]=q=>f.value=q),name:"auto-top-up-threshold",unit:g.value,"model-base":y.value,"entry-base":y.value,currency:t.chargeCurrency,"conversion-rate":t.conversionRate,"show-conversion-hint":t.showThresholdConversion,required:"",disabled:t.disabled,error:e.unref(m).threshold.$errors,label:e.unref(s)({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(se,{modelValue:v.value,"onUpdate:modelValue":x[2]||(x[2]=q=>v.value=q),name:"auto-top-up-amount",unit:S.value,"model-base":"AMOUNT","entry-base":y.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(m).topUpAmount.$errors,label:e.unref(s)({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"]))}}),Ce=t=>{const o=Date.parse(t??"");return Number.isFinite(o)?o:0};function Le({paymentMethods:t,selectedPaymentMethodId:o,preferredPaymentMethodId:n}){const a=e.computed(()=>[...t.value??[]].sort((i,s)=>Ce(s.created_at)-Ce(i.created_at)));return e.watch(()=>[t.value,n==null?void 0:n.value,o.value],([i,s,l],u)=>{var S;const d=u==null?void 0:u[0],g=i==null?void 0:i.find(({id:f})=>!(d!=null&&d.some(v=>v.id===f)));if(g&&(d!=null&&d.length)){o.value=g.id;return}const y=f=>!!f&&!!(i!=null&&i.some(v=>v.id===f));y(l)||(o.value=y(s)?s:(S=(i==null?void 0:i.find(({is_default:f})=>f))??a.value[0])==null?void 0:S.id)},{immediate:!0}),{sortedPaymentMethods:a}}function te(){const{$t:t,formatNumber:o}=M.useIntl(),n=i=>ue.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:s}=M.useIntl(),{formatValue:l}=te(),u=e.ref({pricing_plan_schedule_id:"",pricing_items:[],start_at:"",finalize_immediately:!1,payment_method_id:void 0,preview:!0}),d=e.computed(()=>{const r=(a.topUpPricingItems??[]).filter(c=>c.flexiblePricing||c.fixedPricing);return[...r.filter(({flexiblePricing:c})=>c),...r.filter(({flexiblePricing:c})=>!c)]}),g=r=>d.value.find(c=>c.pricingItemId===r),y=e.computed(()=>{var r,c;return(c=(r=a.topUpPricingItems)==null?void 0:r.find(b=>b.pricingPlanScheduleId))==null?void 0:c.pricingPlanScheduleId});e.watch(y,r=>{u.value.pricing_plan_schedule_id=r??""},{immediate:!0});const S=r=>{const{config:c,currency:b}=r.flexiblePricing??{},N=c==null?void 0:c.minimum_amount;return N&&b?{quantity:N.quantity,currency:b}:void 0},f=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.pricing_item_id},set:r=>{const c=g(typeof r=="string"?r:void 0);if(!c){u.value.pricing_items=[];return}const b=S(c);u.value.pricing_items=[{pricing_item_id:c.pricingItemId,...b&&{flexible_amount:b}}]}});e.watch(d,r=>{if(r.some(({pricingItemId:N})=>{var V;return N===((V=u.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=u.value.pricing_items[0])==null?void 0:r.flexible_amount},set:r=>{var b;const c=(b=u.value.pricing_items[0])==null?void 0:b.pricing_item_id;c&&(u.value.pricing_items=[{pricing_item_id:c,...r&&{flexible_amount:r}}])}}),p=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.fixedPricing;return c!=null&&c.value.credits?le.formatAmount(c.amount):void 0},w=e.computed(()=>{var r;return(r=g(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 c=(b=w.value)==null?void 0:b.currency;v.value=r&&c?{quantity:r,currency:c}:void 0}}),D=r=>r.creditsConfiguration?"CREDITS":"AMOUNT",h=e.computed(()=>$e(a.topUpPricingItems)),T=r=>r.creditsConfiguration?h.value??r.creditsConfiguration.unitNamePlural??r.creditsConfiguration.unitNameSingle??"":r.currency,m=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.flexiblePricing;return c?[c]:[]},C=r=>{var c;return!!((c=g(String(r)))!=null&&c.flexiblePricing)},B=e.computed(()=>d.value.map(r=>{var c;return{value:r.pricingItemId,label:r.fixedPricing?l(r.fixedPricing.value):s({defaultMessage:"Choose your own amount",description:"Label of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.label"}),...((c=r.flexiblePricing)==null?void 0:c.bounds.minimum)&&r.flexiblePricing.bounds.maximum&&{description:s({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:l(r.flexiblePricing.bounds.minimum),maximum:l(r.flexiblePricing.bounds.maximum)})}}})),A=e.computed(()=>{const r=u.value.pricing_items.filter(c=>{var b;return!((b=g(c.pricing_item_id))!=null&&b.flexiblePricing)||!!c.flexible_amount});return r.length>0?r:void 0}),_=e.computed(()=>!a.autoTopUpConfig&&d.value.some(({flexiblePricing:c})=>c)?Oe(a.topUpPricingItems):void 0),x=e.ref(),{chargeOnDemandPricingItems:q}=Pe.createInvoicesService(),Q=M.useLogger(),R=e.ref(!1),L=e.computed(()=>!!u.value.pricing_plan_schedule_id&&!!A.value&&!!u.value.payment_method_id),G=e.reactive({paymentMethodId:e.computed(()=>u.value.payment_method_id??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>s({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"}),I.required)}},G),Y=e.computed(()=>{const[r]=u.value.pricing_items,c=g(r==null?void 0:r.pricing_item_id);return c?qt(c,r==null?void 0:r.flexible_amount):void 0});async function K(){var c,b,N;W.value.$touch();const r=(c=x.value)==null?void 0:c.validate();if(!(W.value.$invalid||(b=x.value)!=null&&b.isInvalid||!L.value||R.value)){R.value=!0;try{const V=await q({pricing_plan_schedule_id:u.value.pricing_plan_schedule_id,pricing_items:A.value??[],payment_method_id:u.value.payment_method_id,preview:!1});r&&((N=x.value)!=null&&N.hasChanges)&&u.value.payment_method_id&&i("save-auto-top-up",{rule:r,paymentMethodId:u.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:()=>u.value.payment_method_id??void 0,set:r=>{u.value.payment_method_id=r}}),{sortedPaymentMethods:X}=Le({paymentMethods:e.computed(()=>a.paymentMethods),selectedPaymentMethodId:H});return(r,c)=>(e.openBlock(),e.createElementBlock("form",Kt,[e.createElementVNode("div",Xt,[e.createElementVNode("div",Jt,[B.value.length>0?(e.openBlock(),e.createBlock(e.unref(xe._sfc_main),{key:0,modelValue:f.value,"onUpdate:modelValue":c[3]||(c[3]=b=>f.value=b),class:"sv-top-up-form__options",name:"top-up-pricing-item",direction:"column",required:"",disabled:R.value,options:B.value,"show-radio":!1,label:e.unref(s)({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),p(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(p(N)),1)]),_:2},1024)):e.createCommentVNode("",!0)]),description:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("div",Zt,[b.description&&!C(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),m(N).length>0?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),{key:1,"is-open":String(N)===f.value,lazy:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(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:c[1]||(c[1]=e.withModifiers(()=>{},["stop"])),onKeydown:c[2]||(c[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(se,{modelValue:P.value,"onUpdate:modelValue":c[0]||(c[0]=O=>P.value=O),name:"top-up-amount","model-base":"AMOUNT",unit:T(V),"entry-base":D(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(Ie,{"pricing-plan-schedule-id":y.value,"pricing-items":A.value},null,8,["pricing-plan-schedule-id","pricing-items"])]),_.value?(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(Fe,e.mergeProps({ref_key:"autoTopUpFormRef",ref:x,class:"sv-top-up-form__auto-top-up"},_.value,{contained:"","show-threshold-conversion":!1,disabled:R.value}),null,16,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode(e.unref(tt._sfc_main),{spacing:"xs"})]),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"payment-method",{},()=>[e.createVNode(re._sfc_main,{modelValue:H.value,"onUpdate:modelValue":c[4]||(c[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(s)({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:c[5]||(c[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(Ue._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(),s=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"})),l=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})),u=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"})),d=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:ue.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:s,subTitle:l,cancelButtonText:u,confirmButtonText:d}}function Ye({isOpen:t,customer:o}){const{paymentMethodOptions:n,get:a,isPending:i}=ut.usePaymentMethodOptions();e.watch(()=>[t.value,o.value],([l,u])=>{!l||!u||a({customerId:u.id,country:st.getCustomerCountry(u)})},{immediate:!0});const s=e.computed(()=>i.value?void 0:n.value);return{paymentMethodOptions:n,settledOptions:s,isPending:i}}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 l;const s=(l=i[0])==null?void 0:l.target;n(s instanceof HTMLElement?s:void 0)});return e.watch(t,(i,s)=>{s&&(a==null||a.unobserve(s)),n(i),i&&(a==null||a.observe(i))},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{a==null||a.disconnect()}),o}const so=["inert"],uo=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},uo)}),e.onBeforeUnmount(()=>{clearTimeout(a)});const i=e.ref({}),s={},l=y=>s[y]??(s[y]=S=>{i.value[y]=S instanceof HTMLElement?S:void 0}),u=e.computed(()=>i.value[o.current]),d=io(u),g=e.computed(()=>{const y=o.panes.indexOf(o.current);return y>0?`translateX(calc(${-y} * (100% + ${lo})))`:"translateX(0px)"});return(y,S)=>(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(d)?{height:`${e.unref(d)}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:g.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:l(f)},[e.renderSlot(y.$slots,f)],512)],8,so))),128))],4)],6))}}),co={class:"grid grid-cols-1 gap-4 pb-4"},We=e.defineComponent({__name:"WalletModalShell",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(s=>s!==n.addPaymentMethodPane));return o({submit:()=>{var s;return(s=a.value)==null?void 0:s.submit()},isSaving:e.computed(()=>{var s;return!!((s=a.value)!=null&&s.isSaving)})}),(s,l)=>(e.openBlock(),e.createBlock(e.unref(Ae.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:l[2]||(l[2]=u=>s.$emit("confirm")),onClose:l[3]||(l[3]=u=>s.$emit("cancel"))},e.createSlots({body:e.withCtx(()=>[e.createElementVNode("div",co,[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:l[0]||(l[0]=u=>s.$emit("payment-success")),onFailure:l[1]||(l[1]=u=>s.$emit("payment-failed",u))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:2},[e.renderList(i.value,u=>({name:u,fn:e.withCtx(()=>[e.renderSlot(s.$slots,u)])}))]),1032,["panes","current"])])]),_:2},[s.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"footer")]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-loading"]))}}),He=t=>{var o;return(((o=t==null?void 0:t.wallet)==null?void 0:o.auto_top_up_configs)??[]).find(({status:n})=>n==="ACTIVE")},ze=t=>t?{status:t.status,threshold:t.threshold,...t.topup_amount&&{topup_amount:t.topup_amount}}:void 0,je=(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},Qe=({rule:t,walletBalanceItem:o,chargeTarget:n,paymentMethodId:a})=>{var s,l;const i=!!(((s=t==null?void 0:t.threshold)==null?void 0:s.amount)??((l=t==null?void 0:t.threshold)==null?void 0:l.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 Ge({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 Ke(){const t=M.createRequestService(),o=M.useConfig(),n="/portal/auto-top-up-configs";function a(u){return t({url:`${o.apiUrls.config}${n}`,query:{...u},isCollection:!0})}function i(u){return t({url:`${o.apiUrls.config}${n}/${u}`})}function s(u){return t({url:`${o.apiUrls.config}${n}`,options:{method:"POST"},data:u})}function l(u){return t({url:`${o.apiUrls.config}${n}/${u}/deactivate`,options:{method:"POST"}})}return{getAutoTopUpConfigs:a,getAutoTopUpConfig:i,createAutoTopUpConfig:s,deactivateAutoTopUpConfig:l}}function Xe(){const{createAutoTopUpConfig:t}=Ke(),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(s){return o.error("AUTO_TOP_UP_SAVE_FAILED","Failed to save the automatic top-up rule",{},s),{saved:!1,error:s}}finally{n.value=!1}},isSaving:n}}const po={key:0,class:"mb-4"},mo={class:"sr-only"},fo={class:"flex flex-col gap-2"},vo=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:s}=te(),l=e.computed(()=>ze(He(n.selectedBalanceItem))),u=e.computed(()=>s(n.selectedBalanceItem)),d=e.computed(()=>Bt(n.selectedBalanceItem,n.subscriptions??[])),g=e.ref();e.watch(d,U=>{var E;U.some(({id:oe})=>oe===g.value)||(g.value=(E=U[0])==null?void 0:E.id)},{immediate:!0});const y=e.computed(()=>d.value.length>1),S=e.computed(()=>d.value.map(({id:U,name:$})=>({value:U,label:$}))),f=e.computed(()=>Object.fromEntries(d.value.flatMap(({id:U,enabledPricingIds:$})=>{const E=(n.subscriptions??[]).find(({id:oe})=>oe===U);return E?[[U,{subscription:E,enabledPricingIds:$}]]:[]}))),v=e.computed(()=>{var $;if(!n.selectedBalanceItem||!(($=n.subscriptions)!=null&&$.length))return n.selectedBalanceItem;const U=d.value.find(({id:E})=>E===g.value);return U?Ut(n.selectedBalanceItem,U.scheduleIds):{...n.selectedBalanceItem,charge_on_demand_pricing_items:[]}}),p=e.computed(()=>Ne(v.value)),{paymentMethodOptions:w,settledOptions:P,isPending:D}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),h=e.ref("TOP_UP"),T=e.computed(()=>(n.paymentMethods??[]).length>0),m=e.computed(()=>!D.value&&(w.value??[]).length===0),C=e.computed(()=>h.value==="TOP_UP"&&!T.value&&m.value),B=e.ref(),A=e.ref(),_=()=>{L(),a("payment-success")},{paneRef:x,isActive:q,isSaving:Q,open:R,leave:L,submit:G}=Ge({step:h,name:"ADD_PAYMENT_METHOD",returnTo:"TOP_UP"}),{save:W}=Xe(),Y=e.ref(),K=e.computed(()=>{var U;return(U=Y.value)==null?void 0:U.chargedValue}),H=e.computed(()=>{var U;return Q.value||!!((U=Y.value)!=null&&U.isCharging)}),{title:X,subTitle:r,cancelButtonText:c,confirmButtonText:b}=ao({step:h,currentBalance:u,topUpValue:K}),N=()=>{var U;if(q.value){G();return}(U=Y.value)==null||U.submit()},V=async({rule:U,paymentMethodId:$})=>{const{saved:E}=await W(Qe({rule:U,walletBalanceItem:n.selectedBalanceItem,chargeTarget:je(void 0,p.value),paymentMethodId:$}));E&&a("auto-top-up-saved")},k=U=>{var $;B.value=U,A.value=($=Y.value)==null?void 0:$.chargedValue,h.value="SUCCESS"},O=()=>{a("confirm"),a("close")},F=()=>{if(!H.value){if(q.value){L();return}if(h.value==="SUCCESS"){O();return}a("close")}},fe=e.ref(0);return e.watch(()=>n.showModal,U=>{U&&(h.value="TOP_UP",B.value=void 0,A.value=void 0,fe.value+=1)}),(U,$)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:x,"show-modal":t.showModal,title:e.unref(X),"sub-title":e.unref(r),"cancel-button-text":e.unref(c),"confirm-button-text":e.unref(b),"is-pending":H.value,panes:e.unref(St),step:h.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(w),"is-payment-method-options-pending":e.unref(D),"is-adding-payment-method":e.unref(q),onConfirm:N,onCancel:F,onPaymentSuccess:_,onPaymentFailed:$[1]||($[1]=E=>U.$emit("payment-failed",E))},e.createSlots({TOP_UP:e.withCtx(()=>[y.value?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(e.unref(xe._sfc_main),{modelValue:g.value,"onUpdate:modelValue":$[0]||($[0]=E=>g.value=E),class:"sv-topup-modal__subscription",name:"top-up-subscription",direction:"column",required:"",options:S.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(it._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",mo,e.toDisplayString(E.label),1)]),_:1},8,["modelValue","options","label"])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(to,{key:fe.value,ref_key:"topUpFormRef",ref:Y,"top-up-pricing-items":p.value,"payment-methods":t.paymentMethods,"auto-top-up-config":l.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(()=>[B.value?(e.openBlock(),e.createBlock(no,{key:0,"added-value":A.value,invoice:B.value},null,8,["added-value","invoice"])):e.createCommentVNode("",!0)]),_:2},[h.value==="SUCCESS"||C.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",fo,[h.value==="SUCCESS"?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"lg","data-testid":"done",onClick:O},{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(c)),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"]))}}),ho=["AUTO_TOP_UP","ADD_PAYMENT_METHOD"],go={class:"grid grid-cols-1 gap-4"},_o=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:s}=te(),l=e.ref("AUTO_TOP_UP"),u=e.computed(()=>s(n.walletBalanceItem)),d=e.computed(()=>Ne(n.walletBalanceItem)),g=e.computed(()=>Oe(d.value)),y=e.computed(()=>He(n.walletBalanceItem)),S=e.computed(()=>ze(y.value)),f=e.computed(()=>je(n.topUpItem,d.value)),v=e.ref(),p=e.computed(()=>{var O,F;const k=(F=(O=v.value)==null?void 0:O.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:D}=Le({paymentMethods:e.computed(()=>n.paymentMethods),selectedPaymentMethodId:P,preferredPaymentMethodId:e.computed(()=>{var k;return(k=y.value)==null?void 0:k.payment_method_id})}),{paymentMethodOptions:h,settledOptions:T,isPending:m}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),{paneRef:C,isActive:B,isSaving:A,open:_,leave:x,submit:q}=Ge({step:l,name:"ADD_PAYMENT_METHOD",returnTo:"AUTO_TOP_UP"}),{save:Q,isSaving:R}=Xe(),L=e.computed(()=>A.value||R.value),G=e.reactive({paymentMethodId:e.computed(()=>P.value??null)}),W=I.useValidation({paymentMethodId:{required:I.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"}),I.required)}},G),Y=e.computed(()=>l.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(()=>l.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:u.value})),H=e.computed(()=>l.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(()=>l.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:O}=await Q(Qe({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}O&&a("payment-failed",O)}const c=()=>{if(B.value){q();return}r()},b=()=>{x(),a("payment-success")},N=()=>{if(!L.value){if(B.value){x();return}a("close")}},V=e.ref(0);return e.watch(()=>n.showModal,k=>{k&&(l.value="AUTO_TOP_UP",P.value=void 0,V.value+=1)}),(k,O)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:C,"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(ho),step:l.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(h),"is-payment-method-options-pending":e.unref(m),"is-adding-payment-method":e.unref(B),onConfirm:c,onCancel:N,onPaymentSuccess:b,onPaymentFailed:O[1]||(O[1]=F=>k.$emit("payment-failed",F))},{AUTO_TOP_UP:e.withCtx(()=>[e.createElementVNode("div",go,[g.value?(e.openBlock(),e.createBlock(Fe,e.mergeProps({key:V.value,ref_key:"autoTopUpFormRef",ref:v,class:"sv-auto-topup-modal__rule"},g.value,{config:S.value,"always-enabled":"",disabled:L.value}),null,16,["config","disabled"])):e.createCommentVNode("",!0),e.createVNode(Ie,{"pricing-plan-schedule-id":w.value,"pricing-items":p.value},null,8,["pricing-plan-schedule-id","pricing-items"]),e.createVNode(re._sfc_main,{modelValue:P.value,"onUpdate:modelValue":O[0]||(O[0]=F=>P.value=F),class:"sv-auto-topup-modal__payment-method","payment-methods":e.unref(D),"payment-method-options":e.unref(T),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(_)},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"]))}}),yo={class:"sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3"},bo=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(),s=M.useLogger(),{formatValue:l}=te(),{deactivateAutoTopUpConfig:u}=Ke(),d=e.ref(!1),g=e.ref(!1);e.watch(()=>n.showModal,v=>{v&&(g.value=!1)});const y=e.computed(()=>{var w,P;const v=(w=n.config)==null?void 0:w.threshold,p=(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"}):p?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:l({amount:p}),threshold:l(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:l(v)})}),S=async()=>{var p;const v=(p=n.config)==null?void 0:p.id;if(!(!v||d.value)){d.value=!0,g.value=!1;try{await u(v),a("confirmed"),a("close")}catch(w){s.error("AUTO_TOP_UP_CANCELLATION_FAILED","Failed to turn off a wallet's automatic top-up",{},w),g.value=!0}finally{d.value=!1}}},f=()=>{d.value||a("close")};return(v,p)=>(e.openBlock(),e.createBlock(e.unref(Ae.Modal),{size:"sm","show-modal":t.showModal,"is-loading":d.value,"no-click-away":d.value,"no-backdrop-close":d.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:S,onClose:f},{body:e.withCtx(()=>[e.createElementVNode("div",yo,[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(y.value),1)]),_:1}),g.value?(e.openBlock(),e.createBlock(e.unref(Me._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"]))}}),wo=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(),s=e.ref(),l=e.computed(()=>ve(n.walletBalances,s.value)),u=e.computed(()=>!!l.value),d=e.ref(),g=e.computed(()=>!!d.value),y=e.computed(()=>ve(n.walletBalances,d.value)),S=e.ref(),f=e.computed(()=>!!S.value);return(v,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isLoading?(e.openBlock(),e.createBlock(Se._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(Me._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(Tt),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:p[0]||(p[0]=w=>s.value=w),onAutoTopUp:p[1]||(p[1]=w=>d.value=w),onCancelAutoTopUp:p[2]||(p[2]=w=>S.value=w)}),null,16,["customer-wallet-balances","title"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(vo,{key:3,"show-modal":u.value,"selected-balance-item":l.value,"payment-methods":t.paymentMethods,customer:t.customer,subscriptions:t.subscriptions,onClose:p[3]||(p[3]=w=>s.value=void 0),onConfirm:p[4]||(p[4]=w=>a("top-up-charged")),onPaymentSuccess:p[5]||(p[5]=w=>a("payment-method-stored")),onPaymentFailed:p[6]||(p[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(_o,{key:4,"show-modal":g.value,"wallet-balance-item":y.value,"top-up-item":d.value,"payment-methods":t.paymentMethods,customer:t.customer,onClose:p[7]||(p[7]=w=>d.value=void 0),onSaved:p[8]||(p[8]=w=>a("auto-top-up-saved")),onPaymentSuccess:p[9]||(p[9]=w=>a("payment-method-stored")),onPaymentFailed:p[10]||(p[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(bo,{key:5,"show-modal":f.value,config:S.value,onClose:p[11]||(p[11]=w=>S.value=void 0),onConfirmed:p[12]||(p[12]=w=>a("auto-top-up-cancelled"))},null,8,["show-modal","config"])):e.createCommentVNode("",!0)],64))}});exports._sfc_main=wo;exports.useCustomerWalletBalances=Mt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),r=require("./IconButton.vue.es-BTAkuFsm.js"),c=require("./customElements-Vox1PB6G.js"),a={class:"grid gap-1"},d={class:"font-medium"},l={key:0},m=e.defineComponent({__name:"ErrorNotification",props:{title:{},description:{}},setup(t){const{formatMessage:o}=c.useIntl(),n=t,s=e.computed(()=>n.title??o({defaultMessage:"Something went wrong",id:"error_notification.default_error_message",description:"The default message to display"}));return(i,u)=>(e.openBlock(),e.createBlock(r._sfc_main,e.mergeProps({type:"danger"},i.$attrs),{default:e.withCtx(()=>[e.createElementVNode("div",a,[e.createElementVNode("span",d,e.toDisplayString(s.value),1),t.description?(e.openBlock(),e.createElementBlock("span",l,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])]),_:1},16))}});exports._sfc_main=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("vue"),g=require("./object.es-CdriXMPs.js"),u=require("./TooltipParagraph.vue.es-BaqCDjl8.js"),m=require("./Button.vue.es-M_jXZda4.js"),b="py-2 px-4 text-sm",v={danger:"text-feedback-danger",neutral:"text-secondary",info:"text-feedback-info",success:"text-feedback-success",warning:"text-feedback-warning"},C={danger:"bg-feedback-danger",neutral:"bg-feedback-neutral",info:"bg-feedback-info",success:"bg-feedback-success",warning:"bg-feedback-warning"},y={danger:"rounded-sm border border-red-200",neutral:"rounded-sm border border-gray-200",info:"rounded-sm border border-blue-200",success:"rounded-sm border border-green-200",warning:"rounded-sm border border-yellow-200"},x="ml-auto -mx-1.5 -my-1.5 rounded focus:ring-2 p-1.5 inline-flex h-8 w-8",k={danger:"hover:bg-red-200 focus:ring-red-400 bg-red-100 text-red-500",neutral:"hover:bg-gray-200 focus:ring-gray-400 bg-feedback-neutral text-gray-500",info:"hover:bg-blue-200 focus:ring-blue-400 bg-blue-100 text-blue-500",success:"bg-green-100 text-green-500 focus:ring-green-400 hover:bg-green-200",warning:"focus:ring-yellow-400 hover:bg-yellow-200 bg-yellow-100 text-yellow-500"};function w(t){const s=e.computed(()=>[b,C[t.type.value],n.value,y[t.type.value],t.inline.value?"flex items-center":""].filter(l=>!!l).join(" ")),n=e.computed(()=>v[t.type.value]??""),o=e.computed(()=>[x,k[t.type.value]??""].filter(l=>!!l).join(" ")),r=e.computed(()=>t.inline.value?!t.icon.value&&!t.title.value?"":t.title.value?"grow ml-1":"grow ml-2":"my-2"),i=e.computed(()=>!t.icon.value||!t.inline.value?["font-medium",t.inline.value?"":"text-lg ml-2"].filter(l=>!!l).join(" "):["font-medium ml-2",t.inline.value?"":"text-lg"].filter(l=>!!l).join(" "));return{alertClasses:s,textClasses:n,closeClasses:o,contentClasses:r,titleClasses:i}}const B={key:0,class:"ml-auto inline-flex items-center"},p=e.defineComponent({__name:"Alert",props:{type:{default:"info"},title:{default:""},closable:{type:Boolean,default:!1},icon:{type:Boolean,default:!0},inline:{type:Boolean,default:!0}},setup(t){const s=t,{alertClasses:n,textClasses:o,closeClasses:r,contentClasses:i,titleClasses:l}=w(e.toRefs(s)),d=e.ref(!0),f=()=>{d.value=!1};return(c,a)=>d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n)),role:"alert"},[e.createElementVNode("div",{class:e.normalizeClass(t.inline?"flex":"flex items-center")},[t.icon?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["flex-shrink-0","w-5","h-5",e.unref(o)]),fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[...a[0]||(a[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"},null,-1)])],2)):e.createCommentVNode("",!0),t.title?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(l))},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0),!t.inline&&t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(e.unref(r)),"aria-label":"Close",onClick:f},[...a[1]||(a[1]=[e.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),e.createElementVNode("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(i))},[e.renderSlot(c.$slots,"default")],2),c.$slots.actions?(e.openBlock(),e.createElementBlock("div",B,[e.renderSlot(c.$slots,"actions")])):e.createCommentVNode("",!0),t.inline&&t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(e.unref(r)),"aria-label":"Close",onClick:f},[...a[2]||(a[2]=[e.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),e.createElementVNode("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])],2)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}}),h={inheritAttrs:!1},N=e.defineComponent({...h,__name:"IconButton",props:{tooltip:{},icon:{},type:{},intent:{},size:{},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{},iconSuffix:{},tag:{},preventDoubleClick:{type:Boolean}},setup(t){const s=t,n=e.useAttrs(),o=e.computed(()=>g.omit({...s,...n},"icon","tooltip"));return(r,i)=>t.tooltip?(e.openBlock(),e.createBlock(u._sfc_main,{key:0},{tooltip:e.withCtx(()=>[e.createVNode(u.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(u._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.tooltip),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(m._sfc_main,e.mergeProps(o.value,{"icon-prefix":t.icon,square:""}),null,16,["icon-prefix"])]),_:1})):(e.openBlock(),e.createBlock(m._sfc_main,e.mergeProps({key:1},o.value,{square:"","icon-prefix":t.icon}),null,16,["icon-prefix"]))}});exports._sfc_main=p;exports._sfc_main$1=N;
|