@solvimon/solvimon-web 0.1.0-alpha.3 → 0.1.0-alpha.31

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